From 5916cf46ee8b2234975e96d2ed57c1bc7131ecdd Mon Sep 17 00:00:00 2001 From: Michael Avoyan Date: Tue, 26 Dec 2023 16:46:45 +0200 Subject: [PATCH] add push delegate to deep link issuing --- packages/sample-server/package.json | 2 +- packages/sdk/package.json | 2 +- .../entities/VCLCredentialManifestDescriptorByDeepLink.ts | 6 ++++-- .../VCLCredentialManifestDescriptorByDeepLink.test.ts | 7 ++++++- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/packages/sample-server/package.json b/packages/sample-server/package.json index 51a8166..c425abc 100644 --- a/packages/sample-server/package.json +++ b/packages/sample-server/package.json @@ -17,7 +17,7 @@ "@fastify/autoload": "~5.7.1", "env-var": "~7.3.0", "fastify": "~4.15.0", - "@velocitycareerlabs/vnf-nodejs-wallet-sdk": "^0.3.0" + "@velocitycareerlabs/vnf-nodejs-wallet-sdk": "^0.4.0" }, "devDependencies": { "@jest/globals": "~29.5.0", diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 09b9cb7..47bd5d3 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@velocitycareerlabs/vnf-nodejs-wallet-sdk", - "version": "0.3.0", + "version": "0.4.0", "description": "VNF Wallet SDK Nodejs", "main": "dist/index.js", "types": "dist/global.d.ts", diff --git a/packages/sdk/src/api/entities/VCLCredentialManifestDescriptorByDeepLink.ts b/packages/sdk/src/api/entities/VCLCredentialManifestDescriptorByDeepLink.ts index 91577f7..28b7fb2 100644 --- a/packages/sdk/src/api/entities/VCLCredentialManifestDescriptorByDeepLink.ts +++ b/packages/sdk/src/api/entities/VCLCredentialManifestDescriptorByDeepLink.ts @@ -1,17 +1,19 @@ import VCLCredentialManifestDescriptor from "./VCLCredentialManifestDescriptor"; import VCLDeepLink from "./VCLDeepLink"; import VCLIssuingType from "./VCLIssuingType"; +import VCLPushDelegate from "./VCLPushDelegate"; export default class VCLCredentialManifestDescriptorByDeepLink extends VCLCredentialManifestDescriptor { constructor( public deeplink: VCLDeepLink, - public issuingType: VCLIssuingType = VCLIssuingType.Career + public issuingType: VCLIssuingType = VCLIssuingType.Career, + public readonly pushDelegate: Nullish = null, ) { super( deeplink.requestUri, issuingType, null, - null, + pushDelegate, deeplink.vendorOriginContext ); } diff --git a/packages/sdk/test/entities/VCLCredentialManifestDescriptorByDeepLink.test.ts b/packages/sdk/test/entities/VCLCredentialManifestDescriptorByDeepLink.test.ts index c94fb4a..4d4bd10 100644 --- a/packages/sdk/test/entities/VCLCredentialManifestDescriptorByDeepLink.test.ts +++ b/packages/sdk/test/entities/VCLCredentialManifestDescriptorByDeepLink.test.ts @@ -3,6 +3,7 @@ import VCLCredentialManifestDescriptorByDeepLink from "../../src/api/entities/VC import VCLIssuingType from "../../src/api/entities/VCLIssuingType"; import { CredentialManifestDescriptorMocks } from "../infrastructure/resources/valid/CredentialManifestDescriptorMocks"; import "../../src/impl/extensions/StringExtensions"; +import VCLPushDelegate from "../../src/api/entities/VCLPushDelegate"; describe("VCLCredentialManifestDescriptorByDeepLink Tests", () => { let subject: VCLCredentialManifestDescriptorByDeepLink; @@ -14,7 +15,8 @@ describe("VCLCredentialManifestDescriptorByDeepLink Tests", () => { test("testCredentialManifestDescriptorFullValidByDeepLinkSuccess", () => { subject = new VCLCredentialManifestDescriptorByDeepLink( CredentialManifestDescriptorMocks.DeepLink, - VCLIssuingType.Career + VCLIssuingType.Career, + new VCLPushDelegate("some push url", "some push token") ); expect.stringMatching( @@ -23,5 +25,8 @@ describe("VCLCredentialManifestDescriptorByDeepLink Tests", () => { expect(subject.did).toEqual( CredentialManifestDescriptorMocks.IssuerDid ); + expect(subject.issuingType).toEqual(VCLIssuingType.Career); + expect(subject.pushDelegate?.pushUrl).toEqual("some push url"); + expect(subject.pushDelegate?.pushToken).toEqual("some push token"); }); });