diff --git a/packages/sample-server/package.json b/packages/sample-server/package.json index 36c1fad..1332221 100644 --- a/packages/sample-server/package.json +++ b/packages/sample-server/package.json @@ -19,7 +19,7 @@ "@fastify/autoload": "~5.7.1", "env-var": "~7.3.0", "fastify": "~4.15.0", - "@velocitycareerlabs/vnf-nodejs-wallet-sdk": "^0.8.31" + "@velocitycareerlabs/vnf-nodejs-wallet-sdk": "^0.8.32" }, "devDependencies": { "@jest/globals": "~29.5.0", diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 01c371a..64161b1 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@velocitycareerlabs/vnf-nodejs-wallet-sdk", - "version": "0.8.31", + "version": "0.8.32", "description": "VNF Wallet SDK Nodejs", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/sdk/src/api/VCL.ts b/packages/sdk/src/api/VCL.ts index 6ae8ac3..6aba6fb 100644 --- a/packages/sdk/src/api/VCL.ts +++ b/packages/sdk/src/api/VCL.ts @@ -38,8 +38,7 @@ export default interface VCL { ): Promise; submitPresentation( - presentationSubmission: VCLPresentationSubmission, - didJwk: VCLDidJwk + presentationSubmission: VCLPresentationSubmission ): Promise; getExchangeProgress( @@ -55,8 +54,7 @@ export default interface VCL { ): Promise; generateOffers( - generateOffersDescriptor: VCLGenerateOffersDescriptor, - didJwk: VCLDidJwk + generateOffersDescriptor: VCLGenerateOffersDescriptor ): Promise; checkForOffers( @@ -66,8 +64,7 @@ export default interface VCL { finalizeOffers( finalizeOffersDescriptor: VCLFinalizeOffersDescriptor, - token: VCLToken, - didJwk: VCLDidJwk + token: VCLToken ): Promise; getCredentialTypesUIFormSchema( diff --git a/packages/sdk/src/impl/VCLImpl.ts b/packages/sdk/src/impl/VCLImpl.ts index f11c287..005a77b 100644 --- a/packages/sdk/src/impl/VCLImpl.ts +++ b/packages/sdk/src/impl/VCLImpl.ts @@ -269,13 +269,11 @@ export class VCLImpl implements VCL { }; submitPresentation = async ( - presentationSubmission: VCLPresentationSubmission, - didJwk: VCLDidJwk + presentationSubmission: VCLPresentationSubmission ) => { const presentationSubmissionSubmission = await this.presentationSubmissionUseCase.submit( - presentationSubmission, - didJwk + presentationSubmission ); const [error, presentationSubmissionResult] = presentationSubmissionSubmission.handleResult(); @@ -371,7 +369,6 @@ export class VCLImpl implements VCL { }; generateOffers = async ( generateOffersDescriptor: VCLGenerateOffersDescriptor, - didJwk: VCLDidJwk ) => { const identificationSubmission = new VCLIdentificationSubmission( generateOffersDescriptor.credentialManifest, @@ -381,7 +378,6 @@ export class VCLImpl implements VCL { const identificationSubmissionResult = await this.identificationUseCase.submit( identificationSubmission, - didJwk ); const [error, submission] = identificationSubmissionResult.handleResult(); @@ -410,14 +406,12 @@ export class VCLImpl implements VCL { } finalizeOffers = async ( finalizeOffersDescriptor: VCLFinalizeOffersDescriptor, - token: VCLToken, - didJwk: VCLDidJwk + token: VCLToken ) => { const jwtVerifiableCredentials = await this.finalizeOffersUseCase.finalizeOffers( token, - finalizeOffersDescriptor, - didJwk + finalizeOffersDescriptor ); const [error, result] = jwtVerifiableCredentials.handleResult(); diff --git a/packages/sdk/src/impl/data/usecases/FinalizeOffersUseCaseImpl.ts b/packages/sdk/src/impl/data/usecases/FinalizeOffersUseCaseImpl.ts index 44779a1..89f634c 100644 --- a/packages/sdk/src/impl/data/usecases/FinalizeOffersUseCaseImpl.ts +++ b/packages/sdk/src/impl/data/usecases/FinalizeOffersUseCaseImpl.ts @@ -19,8 +19,7 @@ export default class FinalizeOffersUseCaseImpl ) {} async finalizeOffers( token: VCLToken, - finalizeOffersDescriptor: VCLFinalizeOffersDescriptor, - didJwk: Nullish + finalizeOffersDescriptor: VCLFinalizeOffersDescriptor ): Promise> { const passedCredentials: VCLJwt[] = []; const failedCredentials: VCLJwt[] = []; diff --git a/packages/sdk/src/impl/data/usecases/SubmissionUseCaseImpl.ts b/packages/sdk/src/impl/data/usecases/SubmissionUseCaseImpl.ts index 188b76c..4ad8a7b 100644 --- a/packages/sdk/src/impl/data/usecases/SubmissionUseCaseImpl.ts +++ b/packages/sdk/src/impl/data/usecases/SubmissionUseCaseImpl.ts @@ -14,18 +14,17 @@ export default class SubmissionUseCaseImpl implements SubmissionUseCase { private jwtServiceRepository: JwtServiceRepository ) {} async submit( - submission: VCLSubmission, - didJwk: Nullish + submission: VCLSubmission ): Promise> { const signedJwtResult = await this.jwtServiceRepository.generateSignedJwt( new VCLJwtDescriptor( submission.generatePayload(), submission.iss, submission.jti, - didJwk?.keyId + submission.didJwk?.keyId ), null, - didJwk, + submission.didJwk, submission.remoteCryptoServicesToken ); diff --git a/packages/sdk/src/impl/domain/usecases/FinalizeOffersUseCase.ts b/packages/sdk/src/impl/domain/usecases/FinalizeOffersUseCase.ts index ee68978..b69accf 100644 --- a/packages/sdk/src/impl/domain/usecases/FinalizeOffersUseCase.ts +++ b/packages/sdk/src/impl/domain/usecases/FinalizeOffersUseCase.ts @@ -9,6 +9,5 @@ export default interface FinalizeOffersUseCase { finalizeOffers( token: VCLToken, finalizeOffersDescriptor: VCLFinalizeOffersDescriptor, - didJwk: Nullish ): Promise>; } diff --git a/packages/sdk/src/impl/domain/usecases/SubmissionUseCase.ts b/packages/sdk/src/impl/domain/usecases/SubmissionUseCase.ts index 1b9599d..da1465c 100644 --- a/packages/sdk/src/impl/domain/usecases/SubmissionUseCase.ts +++ b/packages/sdk/src/impl/domain/usecases/SubmissionUseCase.ts @@ -6,7 +6,6 @@ import VCLSubmissionResult from "../../../api/entities/VCLSubmissionResult"; export default interface SubmissionUseCase { submit( - submission: VCLSubmission, - didJwk: Nullish + submission: VCLSubmission ): Promise>; } diff --git a/packages/sdk/test/usecases/CredentialManifestUseCase.test.ts b/packages/sdk/test/usecases/CredentialManifestUseCase.test.ts index 6ea6175..057635e 100644 --- a/packages/sdk/test/usecases/CredentialManifestUseCase.test.ts +++ b/packages/sdk/test/usecases/CredentialManifestUseCase.test.ts @@ -52,7 +52,7 @@ describe("CredentialManifestUseCase Tests", () => { expect(credentialManifest?.jwt.header).toStrictEqual(JSON.parse(CredentialManifestMocks.Header)); expect(credentialManifest?.jwt.payload).toStrictEqual(JSON.parse(CredentialManifestMocks.Payload)); expect(credentialManifest?.jwt.signature).toBe(CredentialManifestMocks.Signature); - expect(credentialManifest?.didJwk.did).toStrictEqual(DidJwkMocks.DidJwk.did); + expect(credentialManifest?.didJwk).toStrictEqual(DidJwkMocks.DidJwk); expect(credentialManifest?.remoteCryptoServicesToken?.value).toBe("some token"); } catch (error) { console.log(error);