From 41c6145596b226a31a2f1a11f57baff11f016c1a Mon Sep 17 00:00:00 2001 From: Michael Avoyan Date: Thu, 30 May 2024 12:22:44 +0300 Subject: [PATCH] v0.9.3 - offers fix --- packages/sample-server/package.json | 2 +- packages/sdk/package.json | 2 +- packages/sdk/src/api/entities/VCLOffers.ts | 2 +- packages/sdk/test/entities/VCLOffers.test.ts | 2 +- packages/sdk/test/usecases/GenerateOffersUseCase.test.ts | 8 ++++---- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/sample-server/package.json b/packages/sample-server/package.json index 3927328..1e10c69 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.9.2" + "@velocitycareerlabs/vnf-nodejs-wallet-sdk": "^0.9.3" }, "devDependencies": { "@jest/globals": "~29.5.0", diff --git a/packages/sdk/package.json b/packages/sdk/package.json index e570737..537a304 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@velocitycareerlabs/vnf-nodejs-wallet-sdk", - "version": "0.9.2", + "version": "0.9.3", "description": "VNF Wallet SDK Nodejs", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/sdk/src/api/entities/VCLOffers.ts b/packages/sdk/src/api/entities/VCLOffers.ts index ec00803..0b80cc5 100644 --- a/packages/sdk/src/api/entities/VCLOffers.ts +++ b/packages/sdk/src/api/entities/VCLOffers.ts @@ -7,7 +7,7 @@ export default class VCLOffers { public readonly payload: Dictionary, public readonly all: VCLOffer[], public readonly responseCode: number, - public readonly token: VCLToken, + public readonly sessionToken: VCLToken, public readonly challenge: Nullish = null ) {} diff --git a/packages/sdk/test/entities/VCLOffers.test.ts b/packages/sdk/test/entities/VCLOffers.test.ts index 975d1c0..11875f9 100644 --- a/packages/sdk/test/entities/VCLOffers.test.ts +++ b/packages/sdk/test/entities/VCLOffers.test.ts @@ -53,7 +53,7 @@ describe("VCLOffers tests", () => { const testExpectations = (subject: VCLOffers) => { expect(subject.responseCode).toBe(123); - expect(subject.token).toStrictEqual(new VCLToken('some token')); + expect(subject.sessionToken).toStrictEqual(new VCLToken('some token')); expect(subject.all.length).toBe(11); } }) \ No newline at end of file diff --git a/packages/sdk/test/usecases/GenerateOffersUseCase.test.ts b/packages/sdk/test/usecases/GenerateOffersUseCase.test.ts index c15c527..01cde30 100644 --- a/packages/sdk/test/usecases/GenerateOffersUseCase.test.ts +++ b/packages/sdk/test/usecases/GenerateOffersUseCase.test.ts @@ -44,7 +44,7 @@ describe("GenerateOffersUseCase Tests", () => { expect(generatedOffers?.all[0]).toStrictEqual(expectedOffer1); expect(generatedOffers?.all[1]).toStrictEqual(expectedOffer2); expect(generatedOffers?.challenge).toBe(GenerateOffersMocks.Challenge); - expect(generatedOffers?.token).toStrictEqual(CommonMocks.Token); + expect(generatedOffers?.sessionToken).toStrictEqual(CommonMocks.Token); }); test("testGenerateOffersJsonArr", async () => { @@ -73,7 +73,7 @@ describe("GenerateOffersUseCase Tests", () => { expect(generatedOffers?.all[0]).toStrictEqual(expectedOffer1); expect(generatedOffers?.all[1]).toStrictEqual(expectedOffer2); expect(generatedOffers?.challenge).toBeNull() - expect(generatedOffers?.token).toStrictEqual(CommonMocks.Token); + expect(generatedOffers?.sessionToken).toStrictEqual(CommonMocks.Token); }); test("testGenerateOffersEmptyJsonObj", async () => { @@ -101,7 +101,7 @@ describe("GenerateOffersUseCase Tests", () => { expect(generatedOffers?.payload).toStrictEqual({}); expect(generatedOffers?.all).toStrictEqual([]); expect(generatedOffers?.challenge).toBeNull(); - expect(generatedOffers?.token).toStrictEqual(CommonMocks.Token); + expect(generatedOffers?.sessionToken).toStrictEqual(CommonMocks.Token); }); test("testGenerateOffersEmptyJsonArr", async () => { @@ -129,6 +129,6 @@ describe("GenerateOffersUseCase Tests", () => { expect(generatedOffers?.payload).toStrictEqual([]); expect(generatedOffers?.all).toStrictEqual([]); expect(generatedOffers?.challenge).toBeNull(); - expect(generatedOffers?.token).toStrictEqual(CommonMocks.Token); + expect(generatedOffers?.sessionToken).toStrictEqual(CommonMocks.Token); }); }); \ No newline at end of file