gdc-sdk-node-ts 2.2.2 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/backend-profile-runtime.d.ts +23 -0
  2. package/dist/backend-profile-runtime.js +23 -0
  3. package/dist/index.d.ts +2 -0
  4. package/dist/index.js +2 -0
  5. package/dist/node-runtime-client.d.ts +39 -4
  6. package/dist/node-runtime-client.js +124 -4
  7. package/dist/orchestration/client-port.d.ts +4 -1
  8. package/dist/orchestration/individual-controller-sdk.d.ts +10 -1
  9. package/dist/orchestration/individual-controller-sdk.js +15 -0
  10. package/dist/orchestration/individual-member-sdk.d.ts +10 -1
  11. package/dist/orchestration/individual-member-sdk.js +15 -0
  12. package/dist/resource-operations.d.ts +111 -4
  13. package/dist/resource-operations.js +83 -3
  14. package/dist/runtime-client-paths.d.ts +6 -2
  15. package/dist/runtime-client-paths.js +4 -0
  16. package/dist/runtime-transport.d.ts +13 -1
  17. package/dist/runtime-transport.js +18 -3
  18. package/dist/server-profile-protection.d.ts +64 -0
  19. package/dist/server-profile-protection.js +110 -0
  20. package/dist/server-profile-session.d.ts +115 -0
  21. package/dist/server-profile-session.js +259 -0
  22. package/dist/session.d.ts +7 -0
  23. package/dist/session.js +10 -0
  24. package/package.json +3 -3
  25. package/dist/legal-organization-onboarding-facade.d.ts +0 -70
  26. package/dist/legal-organization-onboarding-facade.js +0 -169
  27. package/dist/lifecycle-examples.d.ts +0 -7
  28. package/dist/lifecycle-examples.js +0 -8
  29. package/dist/runtime-software-proof.d.ts +0 -51
  30. package/dist/runtime-software-proof.js +0 -34
  31. package/dist/simple-device-activation.d.ts +0 -44
  32. package/dist/simple-device-activation.js +0 -44
  33. package/dist/simple-host-onboarding.d.ts +0 -27
  34. package/dist/simple-host-onboarding.js +0 -39
  35. package/dist/simple-individual-onboarding.d.ts +0 -27
  36. package/dist/simple-individual-onboarding.js +0 -38
  37. package/dist/simple-individual-start.d.ts +0 -45
  38. package/dist/simple-individual-start.js +0 -59
  39. package/dist/simple-poll-options.d.ts +0 -5
  40. package/dist/simple-poll-options.js +0 -17
  41. package/dist/simple-smart-token.d.ts +0 -58
  42. package/dist/simple-smart-token.js +0 -85
@@ -0,0 +1,115 @@
1
+ import type { JWK } from 'gdc-common-utils-ts/models/jwk';
2
+ import type { ActorKind } from 'gdc-common-utils-ts/models/actor-session';
3
+ import type { RouteContext } from './individual-onboarding.js';
4
+ import type { SecureDidcommTransportAdapter } from 'gdc-sdk-core-ts';
5
+ import { type PinProtectedProfileSecret, type ProfileProtectionOptions, type ServerProfileSealer } from './server-profile-protection.js';
6
+ export type { ServerProfileSealer } from './server-profile-protection.js';
7
+ export type ServerActorMode = 'self' | 'controller' | 'member';
8
+ /** Durable public metadata plus PIN-and-host protected private material. */
9
+ export type ServerProfileRecord = Readonly<{
10
+ profileId: string;
11
+ ownerId: string;
12
+ actorKind: ActorKind;
13
+ actorMode: ServerActorMode;
14
+ actorDid: string;
15
+ profileDid: string;
16
+ providerDid: string;
17
+ routeContext: RouteContext;
18
+ allowedSubjectDids: string[];
19
+ clientId: string;
20
+ deviceDid: string;
21
+ publicJwks: Record<string, unknown>[];
22
+ protectedWalletSeed: PinProtectedProfileSecret;
23
+ protectedVpToken: PinProtectedProfileSecret;
24
+ failedUnlocks: number;
25
+ lockedUntil?: string;
26
+ createdAt: string;
27
+ updatedAt: string;
28
+ }>;
29
+ export type ServerProfileSessionRecord = Readonly<{
30
+ sessionId: string;
31
+ ownerId: string;
32
+ profileId: string;
33
+ subjectDid: string;
34
+ scopes: string[];
35
+ sealedUnlockedWalletSeed: string;
36
+ sealedAccessToken: string;
37
+ expiresAt: string;
38
+ }>;
39
+ /** Persistence port; implementations must isolate environment and tenant data. */
40
+ export type ServerProfileStore = Readonly<{
41
+ listProfiles(ownerId: string): Promise<ServerProfileRecord[]>;
42
+ getProfile(profileId: string): Promise<ServerProfileRecord | undefined>;
43
+ putProfile(profile: ServerProfileRecord): Promise<void>;
44
+ getSession(sessionId: string): Promise<ServerProfileSessionRecord | undefined>;
45
+ putSession(session: ServerProfileSessionRecord): Promise<void>;
46
+ deleteSession(sessionId: string): Promise<void>;
47
+ }>;
48
+ export type ServerProfileEnrollmentInput = Readonly<{
49
+ ownerId: string;
50
+ profileId: string;
51
+ actorKind: ActorKind;
52
+ actorMode: ServerActorMode;
53
+ actorDid: string;
54
+ profileDid: string;
55
+ providerDid: string;
56
+ routeContext: RouteContext;
57
+ allowedSubjectDids: string[];
58
+ pin: string;
59
+ idToken: string;
60
+ activationCode: string;
61
+ vpToken: string;
62
+ }>;
63
+ /** One explicit unlock request; scopes and subject remain session-bound. */
64
+ export type ServerProfileUnlockInput = Readonly<{
65
+ ownerId: string;
66
+ profileId: string;
67
+ subjectDid: string;
68
+ scopes: string[];
69
+ pin: string;
70
+ idToken: string;
71
+ }>;
72
+ /** Material available only during an authenticated, unexpired server session. */
73
+ export type ResolvedServerProfileSession = Readonly<{
74
+ sessionId: string;
75
+ profile: ServerProfileRecord;
76
+ subjectDid: string;
77
+ scopes: string[];
78
+ accessToken: string;
79
+ secureTransportAdapter: SecureDidcommTransportAdapter;
80
+ }>;
81
+ export type ServerProfileSessionManagerOptions = Readonly<{
82
+ store: ServerProfileStore;
83
+ sealer: ServerProfileSealer;
84
+ gatewayBaseUrl: string;
85
+ recipientDid: string;
86
+ resolveRecipientJwk: (recipientDid: string) => Promise<JWK>;
87
+ fetchImpl?: typeof fetch;
88
+ sessionTtlSeconds?: number;
89
+ maxFailedUnlocks?: number;
90
+ lockSeconds?: number;
91
+ profileProtection?: ProfileProtectionOptions;
92
+ now?: () => Date;
93
+ }>;
94
+ /**
95
+ * Coordinates device registration, two-factor profile protection and SMART sessions.
96
+ *
97
+ * Persisted seeds require both the PIN-derived key and the host KEK. After a
98
+ * successful unlock, a short-lived host-sealed seed is copied into the server
99
+ * session so subsequent requests do not need to resend the PIN. Expiring or
100
+ * locking the session removes that temporary bypass.
101
+ */
102
+ export declare class ServerProfileSessionManager {
103
+ private readonly options;
104
+ constructor(options: ServerProfileSessionManagerOptions);
105
+ enroll(input: ServerProfileEnrollmentInput): Promise<ServerProfileRecord>;
106
+ listProfiles(ownerId: string): Promise<ServerProfileRecord[]>;
107
+ unlock(input: ServerProfileUnlockInput): Promise<ResolvedServerProfileSession>;
108
+ resolveSession(ownerId: string, sessionId: string): Promise<ResolvedServerProfileSession>;
109
+ lock(ownerId: string, sessionId: string): Promise<void>;
110
+ private createClient;
111
+ private createWallet;
112
+ private requireOwnedProfile;
113
+ private requireSubject;
114
+ private now;
115
+ }
@@ -0,0 +1,259 @@
1
+ // Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
2
+ import { randomBytes } from 'node:crypto';
3
+ import { NodeManagedWallet } from './node-managed-wallet.js';
4
+ import { NodeHttpClient } from './node-runtime-client.js';
5
+ import { ProfilePinRejectedError, openServerProfileSecret, protectServerProfileSecret, } from './server-profile-protection.js';
6
+ /**
7
+ * Coordinates device registration, two-factor profile protection and SMART sessions.
8
+ *
9
+ * Persisted seeds require both the PIN-derived key and the host KEK. After a
10
+ * successful unlock, a short-lived host-sealed seed is copied into the server
11
+ * session so subsequent requests do not need to resend the PIN. Expiring or
12
+ * locking the session removes that temporary bypass.
13
+ */
14
+ export class ServerProfileSessionManager {
15
+ constructor(options) {
16
+ this.options = options;
17
+ }
18
+ async enroll(input) {
19
+ requireEnrollment(input);
20
+ const seed = randomBytes(32).toString('base64url');
21
+ const wallet = await this.createWallet(input.profileId, seed);
22
+ const context = walletContext(input.profileId);
23
+ const publicKeys = await wallet.getPublicJwks(context, {});
24
+ const client = this.createClient(input.routeContext, input.idToken);
25
+ const activation = await client.activateProfileDeviceWithActivationRequest({
26
+ ...input.routeContext,
27
+ activationCode: input.activationCode,
28
+ idToken: input.idToken,
29
+ dcrPayload: {
30
+ application_type: 'web',
31
+ actor_did: input.actorDid,
32
+ profile_did: input.profileDid,
33
+ jwks: { keys: publicKeys.map((entry) => entry.publicJwk) },
34
+ },
35
+ });
36
+ const dcrBody = terminalBody(activation.dcr.poll.body);
37
+ const clientId = findText(dcrBody, ['client_id', 'clientId']);
38
+ if (!clientId)
39
+ throw new Error('GW DCR did not return client_id.');
40
+ const deviceDid = findText(dcrBody, ['device_did', 'deviceDid', 'did']) || clientId;
41
+ const now = this.now();
42
+ const record = {
43
+ profileId: input.profileId,
44
+ ownerId: input.ownerId,
45
+ actorKind: input.actorKind,
46
+ actorMode: input.actorMode,
47
+ actorDid: input.actorDid,
48
+ profileDid: input.profileDid,
49
+ providerDid: input.providerDid,
50
+ routeContext: input.routeContext,
51
+ allowedSubjectDids: unique(input.allowedSubjectDids),
52
+ clientId,
53
+ deviceDid,
54
+ publicJwks: publicKeys.map((entry) => entry.publicJwk),
55
+ protectedWalletSeed: await protectServerProfileSecret(seed, input.pin, `${input.profileId}:wallet-seed`, this.options.sealer, this.options.profileProtection),
56
+ protectedVpToken: await protectServerProfileSecret(input.vpToken, input.pin, `${input.profileId}:vp-token`, this.options.sealer, this.options.profileProtection),
57
+ failedUnlocks: 0,
58
+ createdAt: now.toISOString(),
59
+ updatedAt: now.toISOString(),
60
+ };
61
+ await this.options.store.putProfile(record);
62
+ return record;
63
+ }
64
+ listProfiles(ownerId) {
65
+ return this.options.store.listProfiles(ownerId);
66
+ }
67
+ async unlock(input) {
68
+ const profile = await this.requireOwnedProfile(input.ownerId, input.profileId);
69
+ this.requireSubject(profile, input.subjectDid);
70
+ const now = this.now();
71
+ if (profile.lockedUntil && new Date(profile.lockedUntil) > now) {
72
+ throw new Error('Profile is temporarily locked after failed PIN attempts.');
73
+ }
74
+ let seed;
75
+ let vpToken;
76
+ try {
77
+ seed = await openServerProfileSecret(profile.protectedWalletSeed, input.pin, `${profile.profileId}:wallet-seed`, this.options.sealer);
78
+ vpToken = await openServerProfileSecret(profile.protectedVpToken, input.pin, `${profile.profileId}:vp-token`, this.options.sealer);
79
+ }
80
+ catch (reason) {
81
+ if (!(reason instanceof ProfilePinRejectedError))
82
+ throw reason;
83
+ const failures = profile.failedUnlocks + 1;
84
+ const max = this.options.maxFailedUnlocks ?? 5;
85
+ const lockedUntil = failures >= max
86
+ ? new Date(now.getTime() + (this.options.lockSeconds ?? 300) * 1000).toISOString()
87
+ : undefined;
88
+ await this.options.store.putProfile({ ...profile, failedUnlocks: failures, lockedUntil, updatedAt: now.toISOString() });
89
+ throw new Error('Profile PIN rejected.');
90
+ }
91
+ const wallet = await this.createWallet(profile.profileId, seed);
92
+ const assertion = await buildWalletClientAssertion(wallet, profile, this.options.gatewayBaseUrl, now);
93
+ const token = await this.createClient(profile.routeContext, input.idToken).requestSmartToken({
94
+ ...profile.routeContext,
95
+ actorDid: profile.actorDid,
96
+ subjectDid: input.subjectDid,
97
+ clientId: profile.clientId,
98
+ issuer: profile.clientId,
99
+ audience: this.options.gatewayBaseUrl,
100
+ idToken: input.idToken,
101
+ vpToken,
102
+ clientAssertion: assertion,
103
+ clientAssertionType: 'private_key_jwt',
104
+ smartTokenKind: 'openid-smart',
105
+ scopes: unique(input.scopes),
106
+ tokenCacheKey: `profile:${profile.profileId}:${input.subjectDid}:${unique(input.scopes).join(',')}`,
107
+ });
108
+ if (token.status !== 'fetched' || !token.accessToken)
109
+ throw new Error('SMART token exchange failed.');
110
+ const sessionId = randomBytes(32).toString('base64url');
111
+ const expiresAt = new Date(now.getTime() + (this.options.sessionTtlSeconds ?? 300) * 1000);
112
+ await this.options.store.putProfile({ ...profile, failedUnlocks: 0, lockedUntil: undefined, updatedAt: now.toISOString() });
113
+ await this.options.store.putSession({
114
+ sessionId,
115
+ ownerId: input.ownerId,
116
+ profileId: profile.profileId,
117
+ subjectDid: input.subjectDid,
118
+ scopes: unique(input.scopes),
119
+ sealedUnlockedWalletSeed: await this.options.sealer.seal(seed, `${sessionId}:unlocked-wallet-seed`),
120
+ sealedAccessToken: await this.options.sealer.seal(token.accessToken, `${sessionId}:access-token`),
121
+ expiresAt: expiresAt.toISOString(),
122
+ });
123
+ return this.resolveSession(input.ownerId, sessionId);
124
+ }
125
+ async resolveSession(ownerId, sessionId) {
126
+ const session = await this.options.store.getSession(sessionId);
127
+ if (!session || session.ownerId !== ownerId)
128
+ throw new Error('Profile session not found.');
129
+ if (new Date(session.expiresAt) <= this.now()) {
130
+ await this.options.store.deleteSession(sessionId);
131
+ throw new Error('Profile session expired.');
132
+ }
133
+ const profile = await this.requireOwnedProfile(ownerId, session.profileId);
134
+ const seed = await this.options.sealer.unseal(session.sealedUnlockedWalletSeed, `${sessionId}:unlocked-wallet-seed`);
135
+ const wallet = await this.createWallet(profile.profileId, seed);
136
+ const context = walletContext(profile.profileId);
137
+ return {
138
+ sessionId,
139
+ profile,
140
+ subjectDid: session.subjectDid,
141
+ scopes: session.scopes,
142
+ accessToken: await this.options.sealer.unseal(session.sealedAccessToken, `${sessionId}:access-token`),
143
+ secureTransportAdapter: {
144
+ pack: (message) => wallet.packForRecipientWithContext(message, this.options.recipientDid, { context }),
145
+ unpack: async (jwe) => (await wallet.unpackWithContext(jwe, { context })).content,
146
+ },
147
+ };
148
+ }
149
+ async lock(ownerId, sessionId) {
150
+ const session = await this.options.store.getSession(sessionId);
151
+ if (session?.ownerId === ownerId)
152
+ await this.options.store.deleteSession(sessionId);
153
+ }
154
+ createClient(ctx, bearerToken) {
155
+ return new NodeHttpClient({
156
+ baseUrl: this.options.gatewayBaseUrl,
157
+ ctx,
158
+ bearerToken,
159
+ fetchImpl: this.options.fetchImpl,
160
+ });
161
+ }
162
+ async createWallet(profileId, seed) {
163
+ const wallet = new NodeManagedWallet({ resolveRecipientJwk: this.options.resolveRecipientJwk });
164
+ const context = walletContext(profileId);
165
+ await wallet.provisionManagedKeys(context, {
166
+ ownerScope: 'profile',
167
+ purposes: ['actor-signing'],
168
+ mode: 'deterministic',
169
+ seedMaterial: seed,
170
+ });
171
+ await wallet.provisionManagedKeys(context, {
172
+ ownerScope: 'runtime',
173
+ purposes: ['openid-id-token-signing', 'vp-token-signing', 'comm-signing', 'comm-encryption'],
174
+ mode: 'deterministic',
175
+ seedMaterial: seed,
176
+ });
177
+ return wallet;
178
+ }
179
+ async requireOwnedProfile(ownerId, profileId) {
180
+ const profile = await this.options.store.getProfile(profileId);
181
+ if (!profile || profile.ownerId !== ownerId)
182
+ throw new Error('Profile not found.');
183
+ return profile;
184
+ }
185
+ requireSubject(profile, subjectDid) {
186
+ if (!profile.allowedSubjectDids.includes(subjectDid))
187
+ throw new Error('Subject is not linked to this profile.');
188
+ }
189
+ now() { return this.options.now?.() || new Date(); }
190
+ }
191
+ async function buildWalletClientAssertion(wallet, profile, audience, now) {
192
+ const seconds = Math.floor(now.getTime() / 1000);
193
+ return wallet.signCompactJws(walletContext(profile.profileId), {
194
+ header: { alg: 'ES384', typ: 'JWT' },
195
+ claims: {
196
+ iss: profile.clientId,
197
+ sub: profile.clientId,
198
+ aud: audience,
199
+ iat: seconds,
200
+ exp: seconds + 300,
201
+ jti: randomBytes(16).toString('base64url'),
202
+ },
203
+ key: { ownerScope: 'runtime', purpose: 'openid-id-token-signing' },
204
+ });
205
+ }
206
+ function walletContext(profileId) {
207
+ return {
208
+ profile: { profileId },
209
+ runtime: { runtimeId: `${profileId}:server-runtime`, runtimeType: 'backend-service' },
210
+ };
211
+ }
212
+ function requireEnrollment(input) {
213
+ for (const [name, value] of Object.entries({
214
+ ownerId: input.ownerId,
215
+ profileId: input.profileId,
216
+ actorDid: input.actorDid,
217
+ profileDid: input.profileDid,
218
+ providerDid: input.providerDid,
219
+ activationCode: input.activationCode,
220
+ vpToken: input.vpToken,
221
+ }))
222
+ if (!String(value || '').trim())
223
+ throw new Error(`Profile enrollment requires ${name}.`);
224
+ if (!input.allowedSubjectDids.length)
225
+ throw new Error('Profile enrollment requires an allowed subject.');
226
+ }
227
+ function unique(values) {
228
+ return [...new Set(values.map((value) => String(value).trim()).filter(Boolean))].sort();
229
+ }
230
+ function terminalBody(value) {
231
+ if (value && typeof value === 'object' && !Array.isArray(value) && 'body' in value) {
232
+ return value.body || value;
233
+ }
234
+ return value;
235
+ }
236
+ function findText(value, keys) {
237
+ if (!value || typeof value !== 'object')
238
+ return undefined;
239
+ if (Array.isArray(value)) {
240
+ for (const item of value) {
241
+ const found = findText(item, keys);
242
+ if (found)
243
+ return found;
244
+ }
245
+ return undefined;
246
+ }
247
+ const record = value;
248
+ for (const key of keys) {
249
+ const found = String(record[key] || '').trim();
250
+ if (found)
251
+ return found;
252
+ }
253
+ for (const child of Object.values(record)) {
254
+ const found = findText(child, keys);
255
+ if (found)
256
+ return found;
257
+ }
258
+ return undefined;
259
+ }
package/dist/session.d.ts CHANGED
@@ -2,6 +2,7 @@ import type { ActorKind, Capability } from 'gdc-common-utils-ts/models/actor-ses
2
2
  import { HostOnboardingSdk } from './orchestration/host-onboarding-sdk.js';
3
3
  import { IndividualControllerSdk } from './orchestration/individual-controller-sdk.js';
4
4
  import { IndividualMemberSdk } from './orchestration/individual-member-sdk.js';
5
+ import { PersonalSdk } from './orchestration/personal-sdk.js';
5
6
  import { OrganizationControllerSdk } from './orchestration/organization-controller-sdk.js';
6
7
  import { OrganizationEmployeeSdk } from './orchestration/organization-employee-sdk.js';
7
8
  import { ProfessionalSdk } from './orchestration/professional-sdk.js';
@@ -39,6 +40,11 @@ export declare class ActorSession {
39
40
  asOrganizationController(): OrganizationControllerSdk;
40
41
  asOrganizationEmployee(): OrganizationEmployeeSdk;
41
42
  asIndividualController(): IndividualControllerSdk;
43
+ /**
44
+ * Presents the reduced self-service surface for an individual-controller
45
+ * actor whose selected relationship mode is ONESELF.
46
+ */
47
+ asPersonal(): PersonalSdk;
42
48
  asIndividualMember(): IndividualMemberSdk;
43
49
  asProfessional(): ProfessionalSdk;
44
50
  private requireClient;
@@ -59,6 +65,7 @@ export declare class NodeActorSession {
59
65
  asOrganizationController(): OrganizationControllerSdk;
60
66
  asOrganizationEmployee(): OrganizationEmployeeSdk;
61
67
  asIndividualController(): IndividualControllerSdk;
68
+ asPersonal(): PersonalSdk;
62
69
  asIndividualMember(): IndividualMemberSdk;
63
70
  asProfessional(): ProfessionalSdk;
64
71
  }
package/dist/session.js CHANGED
@@ -3,6 +3,7 @@ import { ActorKinds } from 'gdc-common-utils-ts/constants/actor-session';
3
3
  import { HostOnboardingSdk } from './orchestration/host-onboarding-sdk.js';
4
4
  import { IndividualControllerSdk } from './orchestration/individual-controller-sdk.js';
5
5
  import { IndividualMemberSdk } from './orchestration/individual-member-sdk.js';
6
+ import { PersonalSdk } from './orchestration/personal-sdk.js';
6
7
  import { OrganizationControllerSdk } from './orchestration/organization-controller-sdk.js';
7
8
  import { OrganizationEmployeeSdk } from './orchestration/organization-employee-sdk.js';
8
9
  import { ProfessionalSdk } from './orchestration/professional-sdk.js';
@@ -44,6 +45,14 @@ export class ActorSession {
44
45
  this.assertActorKind(ActorKinds.IndividualController);
45
46
  return new IndividualControllerSdk(this.requireClient(), this.capabilities);
46
47
  }
48
+ /**
49
+ * Presents the reduced self-service surface for an individual-controller
50
+ * actor whose selected relationship mode is ONESELF.
51
+ */
52
+ asPersonal() {
53
+ this.assertActorKind(ActorKinds.IndividualController);
54
+ return new PersonalSdk(this.requireClient());
55
+ }
47
56
  asIndividualMember() {
48
57
  this.assertActorKind(ActorKinds.IndividualMember);
49
58
  return new IndividualMemberSdk(this.requireClient());
@@ -76,6 +85,7 @@ export class NodeActorSession {
76
85
  asOrganizationController() { return this.inner.asOrganizationController(); }
77
86
  asOrganizationEmployee() { return this.inner.asOrganizationEmployee(); }
78
87
  asIndividualController() { return this.inner.asIndividualController(); }
88
+ asPersonal() { return this.inner.asPersonal(); }
79
89
  asIndividualMember() { return this.inner.asIndividualMember(); }
80
90
  asProfessional() { return this.inner.asProfessional(); }
81
91
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gdc-sdk-node-ts",
3
- "version": "2.2.2",
3
+ "version": "2.3.0",
4
4
  "description": "Next-generation Node runtime package for the GDC SDK family",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Antifraud Services Inc.",
@@ -35,8 +35,8 @@
35
35
  "test:e2e:live-gw:clean": "bash ./scripts/run-live-gw-clean.sh"
36
36
  },
37
37
  "dependencies": {
38
- "gdc-common-utils-ts": "^2.2.2",
39
- "gdc-sdk-core-ts": "~2.2.1"
38
+ "gdc-common-utils-ts": "^2.3.0",
39
+ "gdc-sdk-core-ts": "~2.3.0"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@types/node": "^20.14.10",
@@ -1,70 +0,0 @@
1
- import type { LegalOrganizationVerificationRouting, LegalOrganizationVerificationTransactionController, LegalOrganizationVerificationTransactionInput, LegalOrganizationVerificationTransactionOrganization, LegalOrganizationVerificationRepresentativePayload } from 'gdc-common-utils-ts/utils/legal-organization-verification-transaction';
2
- import type { NodeOrganizationActivationInput } from './orchestration/client-port.js';
3
- export type LegalOrganizationFormFields = Readonly<{
4
- legalName?: string;
5
- legalIdentifierType?: string;
6
- legalIdentifierValue?: string;
7
- taxId?: string;
8
- addressCountry?: string;
9
- controllerEmail?: string;
10
- controllerRole?: string;
11
- serviceCategory?: string;
12
- serviceIdentifier?: string;
13
- serviceUrl?: string;
14
- }>;
15
- export type LegalOrganizationOnboardingValidationIssue = Readonly<{
16
- severity: 'error' | 'warning';
17
- code: string;
18
- message: string;
19
- field?: keyof LegalOrganizationFormFields | 'claims' | string;
20
- }>;
21
- export type LegalOrganizationOnboardingValidationResult = Readonly<{
22
- ok: boolean;
23
- errors: LegalOrganizationOnboardingValidationIssue[];
24
- warnings: LegalOrganizationOnboardingValidationIssue[];
25
- normalizedClaims: Record<string, unknown>;
26
- }>;
27
- export interface LegalOrganizationOnboardingEditor {
28
- setLegalName(value: string): LegalOrganizationOnboardingEditor;
29
- setLegalIdentifierType(value: string): LegalOrganizationOnboardingEditor;
30
- setLegalIdentifierValue(value: string): LegalOrganizationOnboardingEditor;
31
- setTaxId(value: string): LegalOrganizationOnboardingEditor;
32
- setAddressCountry(value: string): LegalOrganizationOnboardingEditor;
33
- setControllerEmail(value: string): LegalOrganizationOnboardingEditor;
34
- setControllerRole(value: string): LegalOrganizationOnboardingEditor;
35
- setServiceCategory(value: string): LegalOrganizationOnboardingEditor;
36
- setServiceIdentifier(value: string): LegalOrganizationOnboardingEditor;
37
- setServiceUrl(value: string): LegalOrganizationOnboardingEditor;
38
- getFormFields(): LegalOrganizationFormFields;
39
- buildClaims(): Record<string, unknown>;
40
- validate(): LegalOrganizationOnboardingValidationResult;
41
- buildVerificationTransactionInput(input: Readonly<{
42
- controller: LegalOrganizationVerificationTransactionController;
43
- organization?: LegalOrganizationVerificationTransactionOrganization;
44
- legalRepresentativePayload?: LegalOrganizationVerificationRepresentativePayload;
45
- verification?: LegalOrganizationVerificationRouting;
46
- attachments?: unknown[];
47
- }>): LegalOrganizationVerificationTransactionInput;
48
- buildActivationInput(input: Readonly<{
49
- vpToken: string;
50
- controller: LegalOrganizationVerificationTransactionController;
51
- capabilities?: readonly string[];
52
- }>): NodeOrganizationActivationInput;
53
- }
54
- export interface LegalOrganizationOnboardingFacade {
55
- createDraft(initial?: LegalOrganizationFormFields): LegalOrganizationFormFields;
56
- createEditor(initial?: LegalOrganizationFormFields): LegalOrganizationOnboardingEditor;
57
- setLegalName(fields: LegalOrganizationFormFields, value: string): LegalOrganizationFormFields;
58
- setLegalIdentifierType(fields: LegalOrganizationFormFields, value: string): LegalOrganizationFormFields;
59
- setLegalIdentifierValue(fields: LegalOrganizationFormFields, value: string): LegalOrganizationFormFields;
60
- setTaxId(fields: LegalOrganizationFormFields, value: string): LegalOrganizationFormFields;
61
- setAddressCountry(fields: LegalOrganizationFormFields, value: string): LegalOrganizationFormFields;
62
- setControllerEmail(fields: LegalOrganizationFormFields, value: string): LegalOrganizationFormFields;
63
- setControllerRole(fields: LegalOrganizationFormFields, value: string): LegalOrganizationFormFields;
64
- setServiceCategory(fields: LegalOrganizationFormFields, value: string): LegalOrganizationFormFields;
65
- setServiceIdentifier(fields: LegalOrganizationFormFields, value: string): LegalOrganizationFormFields;
66
- setServiceUrl(fields: LegalOrganizationFormFields, value: string): LegalOrganizationFormFields;
67
- buildClaims(fields: LegalOrganizationFormFields): Record<string, unknown>;
68
- validate(fields: LegalOrganizationFormFields): LegalOrganizationOnboardingValidationResult;
69
- }
70
- export declare function createLegalOrganizationOnboardingFacade(): LegalOrganizationOnboardingFacade;