Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VL-8414 - align to ios structure sdk v0.10.0 #147

Merged
merged 1 commit into from
Oct 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/sample-server/src/utils/Converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
VCLPresentationRequestDescriptor,
VCLPresentationSubmission,
VCLPublicJwk,
VCLServiceCredentialAgentIssuer,
VCLService,
VCLSubmissionResult,
VCLToken,
VCLVerifiableCredential,
Expand Down Expand Up @@ -115,7 +115,7 @@ const credentialManifestDescriptorByDeepLinkFrom = (json: Dictionary<any>): VCLC

const credentialManifestDescriptorByServiceFrom = (json: Dictionary<any>): VCLCredentialManifestDescriptorByService => {
return new VCLCredentialManifestDescriptorByService(
new VCLServiceCredentialAgentIssuer(json.service),
new VCLService(json.service),
issuingTypeFromString(json.issuingType),
json.credentialTypes,
null,
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@velocitycareerlabs/vnf-nodejs-wallet-sdk",
"version": "0.9.22",
"version": "0.10.0",
"description": "VNF Wallet SDK Nodejs",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
10 changes: 5 additions & 5 deletions packages/sdk/src/api/entities/VCLOrganization.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { Dictionary } from "../VCLTypes";
import VCLServiceCredentialAgentIssuer from "./VCLServiceCredentialAgentIssuer";
import VCLService from "./VCLService";

export default class VCLOrganization {
TAG = VCLOrganization.name;

get serviceCredentialAgentIssuers(): VCLServiceCredentialAgentIssuer[] {
get serviceCredentialAgentIssuers(): VCLService[] {
return this.parseServiceCredentialAgentIssuers();
}
constructor(public readonly payload: Dictionary<any>) {}

private parseServiceCredentialAgentIssuers(): VCLServiceCredentialAgentIssuer[] {
const result: VCLServiceCredentialAgentIssuer[] = [];
private parseServiceCredentialAgentIssuers(): VCLService[] {
const result: VCLService[] = [];

try {
const serviceJsonArr = (this.payload[VCLOrganization.KeyService] ??
Expand All @@ -19,7 +19,7 @@ export default class VCLOrganization {
for (const i in serviceJsonArr) {
const it = serviceJsonArr[i];
if (it) {
result.push(new VCLServiceCredentialAgentIssuer(it));
result.push(new VCLService(it));
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions packages/sdk/src/api/entities/VCLService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ export default class VCLService {
id: string;
type: string;
serviceEndpoint: string;
credentialTypes: string;
constructor(public payload: Dictionary<any>) {
this.id = payload[VCLService.KeyId];
this.type = payload[VCLService.KeyType];
this.serviceEndpoint = payload[VCLService.KeyServiceEndpoint];
this.credentialTypes = payload[VCLService.KeyCredentialTypes];
}

static readonly KeyId = "id";
Expand Down
11 changes: 0 additions & 11 deletions packages/sdk/src/api/entities/VCLServiceCredentialAgentIssuer.ts

This file was deleted.

2 changes: 0 additions & 2 deletions packages/sdk/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import VCLPresentationSubmission from "./api/entities/VCLPresentationSubmission"
import VCLPublicJwk from "./api/entities/VCLPublicJwk";
import VCLPushDelegate from "./api/entities/VCLPushDelegate";
import VCLService from "./api/entities/VCLService";
import VCLServiceCredentialAgentIssuer from "./api/entities/VCLServiceCredentialAgentIssuer";
import VCLServiceType from "./api/entities/VCLServiceType";
import VCLServiceTypes from "./api/entities/VCLServiceTypes";
import { VCLIssuingType, issuingTypeFromString } from "./api/entities/VCLIssuingType";
Expand Down Expand Up @@ -115,7 +114,6 @@ export {
VCLPublicJwk,
VCLPushDelegate,
VCLService,
VCLServiceCredentialAgentIssuer,
VCLSubmissionResult,
VCLToken,
VCLVerifiableCredential,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import VCLCredentialManifestDescriptorByService from "../../src/api/entities/VCLCredentialManifestDescriptorByService";
import { VCLIssuingType } from "../../src";
import VCLServiceCredentialAgentIssuer from "../../src/api/entities/VCLServiceCredentialAgentIssuer";
import VCLService from "../../src/api/entities/VCLService";
import { CredentialManifestDescriptorMocks } from "../infrastructure/resources/valid/CredentialManifestDescriptorMocks";
import { DidJwkMocks } from "../infrastructure/resources/valid/DidJwkMocks";

describe("VCLCredentialManifestDescriptorByService Tests", () => {
let subject: VCLCredentialManifestDescriptorByService;

test("testCredentialManifestDescriptorByServiceWithFullInput1Success", () => {
const service = new VCLServiceCredentialAgentIssuer(
const service = new VCLService(
JSON.parse(CredentialManifestDescriptorMocks.IssuingServiceJsonStr)
);
subject = new VCLCredentialManifestDescriptorByService(
Expand Down Expand Up @@ -39,7 +39,7 @@ describe("VCLCredentialManifestDescriptorByService Tests", () => {
});

test("testCredentialManifestDescriptorByServiceWithFullInput2Success", () => {
const service = new VCLServiceCredentialAgentIssuer(
const service = new VCLService(
JSON.parse(CredentialManifestDescriptorMocks.IssuingServiceJsonStr)
);
subject = new VCLCredentialManifestDescriptorByService(
Expand Down Expand Up @@ -70,7 +70,7 @@ describe("VCLCredentialManifestDescriptorByService Tests", () => {
});

test("testCredentialManifestDescriptorByServiceWithPartialInput3Success", () => {
const service = new VCLServiceCredentialAgentIssuer(
const service = new VCLService(
JSON.parse(CredentialManifestDescriptorMocks.IssuingServiceJsonStr)
);
subject = new VCLCredentialManifestDescriptorByService(
Expand All @@ -97,7 +97,7 @@ describe("VCLCredentialManifestDescriptorByService Tests", () => {
});

test("testCredentialManifestDescriptorByServiceWithPartialInput4Success", () => {
const service = new VCLServiceCredentialAgentIssuer(
const service = new VCLService(
JSON.parse(
CredentialManifestDescriptorMocks.IssuingServiceWithParamJsonStr
)
Expand All @@ -118,7 +118,7 @@ describe("VCLCredentialManifestDescriptorByService Tests", () => {
});

test("testCredentialManifestDescriptorByServiceWithPartialInput5Success", () => {
const service = new VCLServiceCredentialAgentIssuer(
const service = new VCLService(
JSON.parse(
CredentialManifestDescriptorMocks.IssuingServiceWithParamJsonStr
)
Expand All @@ -139,7 +139,7 @@ describe("VCLCredentialManifestDescriptorByService Tests", () => {
});

test("testCredentialManifestDescriptorByServiceWithPartialInput6Success", () => {
const service = new VCLServiceCredentialAgentIssuer(
const service = new VCLService(
JSON.parse(CredentialManifestDescriptorMocks.IssuingServiceJsonStr)
);
subject = new VCLCredentialManifestDescriptorByService(
Expand Down