gdc-sdk-node-ts 2.3.15 → 2.3.16

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.
@@ -154,7 +154,9 @@ export class HttpRuntimeClient {
154
154
  wrapBundleAsGatewayTransactionMessage: this.wrapBundleAsGatewayTransactionMessage.bind(this),
155
155
  submitPath: this.hostRegistryOrganizationTransactionPath.bind(this),
156
156
  pollPath: this.hostRegistryOrganizationTransactionPollPath.bind(this),
157
- submitAndPoll: this.submitAndPoll.bind(this),
157
+ submitAndPoll: this.transportProfile === TransportProfiles.DidcommEncryptedForm
158
+ ? (submitPath, pollPath, payload, pollOptions) => this.submitClinicalMessageAndPoll(submitPath, pollPath, payload, this.transportProfile, pollOptions)
159
+ : this.submitAndPoll.bind(this),
158
160
  });
159
161
  }
160
162
  /**
@@ -176,7 +178,9 @@ export class HttpRuntimeClient {
176
178
  wrapBundleAsGatewayTransactionMessage: this.wrapBundleAsGatewayTransactionMessage.bind(this),
177
179
  submitPath: this.hostRegistryOrganizationIssuePath.bind(this),
178
180
  pollPath: this.hostRegistryOrganizationIssuePollPath.bind(this),
179
- submitAndPoll: this.submitAndPoll.bind(this),
181
+ submitAndPoll: this.transportProfile === TransportProfiles.DidcommEncryptedForm
182
+ ? (submitPath, pollPath, payload, pollOptions) => this.submitClinicalMessageAndPoll(submitPath, pollPath, payload, this.transportProfile, pollOptions)
183
+ : this.submitAndPoll.bind(this),
180
184
  });
181
185
  }
182
186
  /**
@@ -800,7 +804,9 @@ export class HttpRuntimeClient {
800
804
  status: response.status,
801
805
  body: response.status === 202
802
806
  ? response.body
803
- : await decodeTransportResponse(response.body, profile, this.secureTransportAdapter),
807
+ : response.status >= 200 && response.status < 300
808
+ ? await decodeTransportResponse(response.body, profile, this.secureTransportAdapter)
809
+ : response.body,
804
810
  retryAfterMs: response.retryAfterMs,
805
811
  };
806
812
  }, pollPath, { thid: job.thid }, input.pollOptions);
@@ -824,7 +830,9 @@ export class HttpRuntimeClient {
824
830
  status: response.status,
825
831
  body: response.status === 202
826
832
  ? response.body
827
- : await decodeTransportResponse(response.body, profile, this.secureTransportAdapter),
833
+ : response.status >= 200 && response.status < 300
834
+ ? await decodeTransportResponse(response.body, profile, this.secureTransportAdapter)
835
+ : response.body,
828
836
  retryAfterMs: response.retryAfterMs,
829
837
  };
830
838
  }, pollPath, { thid: renderedSubmit.thid }, pollOptions);
@@ -1,7 +1,9 @@
1
1
  import type { JWK } from 'gdc-common-utils-ts/models/jwk';
2
2
  import type { ActorKind } from 'gdc-common-utils-ts/models/actor-session';
3
- import type { ConfidentialStorageProfile } from 'gdc-sdk-core-ts';
3
+ import type { LegalOrganizationVerificationTransactionInput } from 'gdc-common-utils-ts/utils/legal-organization-verification-transaction';
4
+ import { type ConfidentialStorageProfile, type PollOptions, type SubmitAndPollResult } from 'gdc-sdk-core-ts';
4
5
  import type { RouteContext } from './individual-onboarding.js';
6
+ import type { HostRouteContext } from './host-onboarding.js';
5
7
  import type { SecureDidcommTransportAdapter } from 'gdc-sdk-core-ts';
6
8
  import { type PinProtectedProfileSecret, type ProfileProtectionOptions, type ServerProfileSealer } from './server-profile-protection.js';
7
9
  export type { ServerProfileSealer } from './server-profile-protection.js';
@@ -66,6 +68,10 @@ export type ServerProfileEnrollmentInput = Readonly<{
66
68
  idToken: string;
67
69
  activationCode: string;
68
70
  vpToken: string;
71
+ /** Registered web redirect URIs included in the OpenID DCR metadata. */
72
+ dcrRedirectUris?: string[];
73
+ /** Human-readable DCR client name. */
74
+ dcrClientName?: string;
69
75
  /**
70
76
  * Optional server-only recovery seed. It must be 32 bytes encoded as
71
77
  * base64url and must never be accepted from an untrusted browser payload.
@@ -82,6 +88,17 @@ export type ServerProfileEnrollmentPublicKey = Readonly<{
82
88
  kid: string;
83
89
  publicJwk: Record<string, unknown>;
84
90
  }>;
91
+ /** Server-only existing-tenant reissue performed with deterministic bootstrap keys. */
92
+ export type ServerProfileOrganizationIssueInput = Readonly<{
93
+ walletSeed: string;
94
+ walletKeyDerivationId: string;
95
+ bearerToken: string;
96
+ providerDid: string;
97
+ routeContext: RouteContext;
98
+ hostContext: HostRouteContext;
99
+ verificationInput: LegalOrganizationVerificationTransactionInput;
100
+ pollOptions?: PollOptions;
101
+ }>;
85
102
  /** One explicit unlock request; scopes and subject remain session-bound. */
86
103
  export type ServerProfileUnlockInput = Readonly<{
87
104
  ownerId: string;
@@ -146,6 +163,12 @@ export declare class ServerProfileSessionManager {
146
163
  walletSeed: string;
147
164
  walletKeyDerivationId: string;
148
165
  }>): Promise<ServerProfileEnrollmentPublicKey[]>;
166
+ /**
167
+ * Reissues an existing organization controller activation through protected
168
+ * DIDComm transport before a durable profile exists. The deterministic seed
169
+ * remains server-only and the caller receives only the normal GW response.
170
+ */
171
+ submitLegalOrganizationIssueWithBootstrapWallet(input: ServerProfileOrganizationIssueInput): Promise<SubmitAndPollResult>;
149
172
  listProfiles(ownerId: string): Promise<ServerProfileRecord[]>;
150
173
  unlock(input: ServerProfileUnlockInput): Promise<ResolvedServerProfileSession>;
151
174
  resolveSession(ownerId: string, sessionId: string): Promise<ResolvedServerProfileSession>;
@@ -1,5 +1,6 @@
1
1
  // Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
2
2
  import { randomBytes } from 'node:crypto';
3
+ import { TransportProfiles, } from 'gdc-sdk-core-ts';
3
4
  import { NodeManagedWallet } from './node-managed-wallet.js';
4
5
  import { NodeHttpClient } from './node-runtime-client.js';
5
6
  import { buildIdentityOpenIdSmartTokenPath } from './runtime-paths.js';
@@ -35,6 +36,8 @@ export class ServerProfileSessionManager {
35
36
  idToken: input.idToken,
36
37
  dcrPayload: {
37
38
  application_type: 'web',
39
+ ...(input.dcrRedirectUris?.length ? { redirect_uris: unique(input.dcrRedirectUris) } : {}),
40
+ ...(input.dcrClientName ? { client_name: input.dcrClientName } : {}),
38
41
  actor_did: input.actorDid,
39
42
  profile_did: input.profileDid,
40
43
  jwks: { keys: publicKeys.filter((entry) => entry.purpose !== 'document-at-rest').map((entry) => entry.publicJwk) },
@@ -92,6 +95,32 @@ export class ServerProfileSessionManager {
92
95
  publicJwk: entry.publicJwk,
93
96
  }));
94
97
  }
98
+ /**
99
+ * Reissues an existing organization controller activation through protected
100
+ * DIDComm transport before a durable profile exists. The deterministic seed
101
+ * remains server-only and the caller receives only the normal GW response.
102
+ */
103
+ async submitLegalOrganizationIssueWithBootstrapWallet(input) {
104
+ requireBase64UrlSeed32(input.walletSeed);
105
+ const walletKeyDerivationId = normalizedWalletKeyDerivationId(input.walletKeyDerivationId, '');
106
+ if (!walletKeyDerivationId) {
107
+ throw new Error('submitLegalOrganizationIssueWithBootstrapWallet requires walletKeyDerivationId.');
108
+ }
109
+ const wallet = await this.createWallet(walletKeyDerivationId, input.walletSeed);
110
+ const context = walletContext(walletKeyDerivationId);
111
+ const client = new NodeHttpClient({
112
+ baseUrl: this.options.gatewayBaseUrl,
113
+ ctx: input.routeContext,
114
+ bearerToken: input.bearerToken,
115
+ fetchImpl: this.options.fetchImpl,
116
+ transportProfile: TransportProfiles.DidcommEncryptedForm,
117
+ secureTransportAdapter: {
118
+ pack: (message) => wallet.packForRecipientWithContext(message, input.providerDid, { context }),
119
+ unpack: async (jwe) => (await wallet.unpackWithContext(jwe, { context })).content,
120
+ },
121
+ });
122
+ return client.submitLegalOrganizationIssue(input.hostContext, input.verificationInput, input.pollOptions);
123
+ }
95
124
  listProfiles(ownerId) {
96
125
  return this.options.store.listProfiles(ownerId);
97
126
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gdc-sdk-node-ts",
3
- "version": "2.3.15",
3
+ "version": "2.3.16",
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.",