From 5ee0d0d81f35db8bb1f425c0a9317ad323ba3944 Mon Sep 17 00:00:00 2001 From: sksadjad Date: Tue, 25 Jun 2024 10:33:57 +0200 Subject: [PATCH] chore: prettier --- .../lib/__tests__/issuerCallback.spec.ts | 5 +-- .../lib/CredentialRequestClientBuilder.ts | 28 ++++++------ packages/client/lib/__tests__/IT.spec.ts | 44 ++++++++++--------- 3 files changed, 38 insertions(+), 39 deletions(-) diff --git a/packages/callback-example/lib/__tests__/issuerCallback.spec.ts b/packages/callback-example/lib/__tests__/issuerCallback.spec.ts index fe733dbe..572da72e 100644 --- a/packages/callback-example/lib/__tests__/issuerCallback.spec.ts +++ b/packages/callback-example/lib/__tests__/issuerCallback.spec.ts @@ -1,9 +1,6 @@ import { KeyObject } from 'crypto' -import { - CredentialRequestClientBuilder, - ProofOfPossessionBuilder, -} from '@sphereon/oid4vci-client' +import { CredentialRequestClientBuilder, ProofOfPossessionBuilder } from '@sphereon/oid4vci-client' import { Alg, CNonceState, diff --git a/packages/client/lib/CredentialRequestClientBuilder.ts b/packages/client/lib/CredentialRequestClientBuilder.ts index 3b7f5907..3b01cd41 100644 --- a/packages/client/lib/CredentialRequestClientBuilder.ts +++ b/packages/client/lib/CredentialRequestClientBuilder.ts @@ -8,9 +8,9 @@ import { ExperimentalSubjectIssuance, OID4VCICredentialFormat, OpenId4VCIVersion, - UniformCredentialOfferRequest -} from '@sphereon/oid4vci-common' -import { CredentialFormat } from '@sphereon/ssi-types' + UniformCredentialOfferRequest, +} from '@sphereon/oid4vci-common'; +import { CredentialFormat } from '@sphereon/ssi-types'; import { CredentialOfferClient } from './CredentialOfferClient'; import { CredentialRequestClientBuilderV1_0_11 } from './CredentialRequestClientBuilderV1_0_11'; @@ -30,12 +30,12 @@ export class CredentialRequestClientBuilder { } public static fromCredentialIssuer({ - credentialIssuer, - metadata, - version, - credentialIdentifier, - credentialTypes, - }: { + credentialIssuer, + metadata, + version, + credentialIdentifier, + credentialTypes, + }: { credentialIssuer: string; metadata?: EndpointMetadata; version?: OpenId4VCIVersion; @@ -99,9 +99,9 @@ export class CredentialRequestClientBuilder { } public static fromCredentialOffer({ - credentialOffer, - metadata, - }: { + credentialOffer, + metadata, + }: { credentialOffer: CredentialOfferRequestWithBaseUrl; metadata?: EndpointMetadata; }): CredentialRequestClientBuilder { @@ -129,9 +129,9 @@ export class CredentialRequestClientBuilder { public withCredentialEndpointFromMetadata(metadata: CredentialIssuerMetadata | CredentialIssuerMetadataV1_0_13): this { if (isV1_0_13(this._builder)) { - this._builder.withCredentialEndpointFromMetadata(metadata as CredentialIssuerMetadataV1_0_13) + this._builder.withCredentialEndpointFromMetadata(metadata as CredentialIssuerMetadataV1_0_13); } else { - this._builder.withCredentialEndpointFromMetadata(metadata as CredentialIssuerMetadata) + this._builder.withCredentialEndpointFromMetadata(metadata as CredentialIssuerMetadata); } return this; } diff --git a/packages/client/lib/__tests__/IT.spec.ts b/packages/client/lib/__tests__/IT.spec.ts index 70d2dab8..e14c599e 100644 --- a/packages/client/lib/__tests__/IT.spec.ts +++ b/packages/client/lib/__tests__/IT.spec.ts @@ -1,12 +1,14 @@ import { AccessTokenResponse, - Alg, CredentialOfferPayloadV1_0_13, + Alg, + CredentialOfferPayloadV1_0_13, CredentialOfferRequestWithBaseUrl, Jwt, OpenId4VCIVersion, - ProofOfPossession, resolveCredentialOfferURI, - WellKnownEndpoints -} from '@sphereon/oid4vci-common' + ProofOfPossession, + resolveCredentialOfferURI, + WellKnownEndpoints, +} from '@sphereon/oid4vci-common'; // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore import nock from 'nock'; @@ -311,8 +313,8 @@ describe('OID4VCI-Client should', () => { }); nock(ISSUER_URL) - .post(/token.*/) - .reply(200, JSON.stringify(mockedAccessTokenResponse)); + .post(/token.*/) + .reply(200, JSON.stringify(mockedAccessTokenResponse)); /* The actual access token calls */ const accessTokenClient: AccessTokenClient = new AccessTokenClient(); @@ -320,16 +322,16 @@ describe('OID4VCI-Client should', () => { expect(accessTokenResponse.successBody).toEqual(mockedAccessTokenResponse); // Get the credential nock(ISSUER_URL) - .post(/credential/) - .reply(200, { - format: 'jwt-vc', - credential: mockedVC, - }); + .post(/credential/) + .reply(200, { + format: 'jwt-vc', + credential: mockedVC, + }); const credReqClient = CredentialRequestClientBuilder.fromCredentialOffer({ credentialOffer: credentialOffer }) - .withFormat('jwt_vc') + .withFormat('jwt_vc') - .withTokenFromResponse(accessTokenResponse.successBody!) - .build(); + .withTokenFromResponse(accessTokenResponse.successBody!) + .build(); const proof: ProofOfPossession = await ProofOfPossessionBuilder.fromJwt({ jwt: jwtDid, @@ -338,13 +340,13 @@ describe('OID4VCI-Client should', () => { }, version: OpenId4VCIVersion.VER_1_0_11, }) - .withEndpointMetadata({ - issuer: 'https://issuer.research.identiproof.io', - credential_endpoint: 'https://issuer.research.identiproof.io/credential', - token_endpoint: 'https://issuer.research.identiproof.io/token', - }) - .withKid('did:example:ebfeb1f712ebc6f1c276e12ec21/keys/1') - .build(); + .withEndpointMetadata({ + issuer: 'https://issuer.research.identiproof.io', + credential_endpoint: 'https://issuer.research.identiproof.io/credential', + token_endpoint: 'https://issuer.research.identiproof.io/token', + }) + .withKid('did:example:ebfeb1f712ebc6f1c276e12ec21/keys/1') + .build(); const credResponse = await credReqClient.acquireCredentialsUsingProof({ proofInput: proof, credentialTypes: credentialOffer.original_credential_offer.credential_configuration_ids[0],