gdc-sdk-node-ts 2.0.10 → 2.0.11

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.
package/README.md CHANGED
@@ -63,50 +63,42 @@ If you are integrating this package for the first time, open these in order:
63
63
  1. [gdc-sdk-core-ts/docs/101-SDK_PACKAGE_BOUNDARIES.md](https://github.com/Global-DataCare/gdc-sdk-core-ts/blob/main/docs/101-SDK_PACKAGE_BOUNDARIES.md)
64
64
  Why `core`, `node`, and `front` are separate packages, what belongs in each
65
65
  one, and why actor-scoped facades must stay aligned across runtimes.
66
- 1. [tests/101-live-full-cycle-bff-runtime.e2e.test.mjs](./tests/101-live-full-cycle-bff-runtime.e2e.test.mjs)
67
- Canonical live backend/BFF walkthrough on a fresh local GW lifecycle:
68
- host/tenant activation, employee provisioning, individual bootstrap,
69
- consent grant, professional SMART token, clinical read, and final cleanup.
70
- 1. [tests/101-backend-profile-runtime.test.mjs](./tests/101-backend-profile-runtime.test.mjs)
71
- Minimal backend-generic walkthrough for loading one actor profile,
72
- registering one trusted device/runtime context, connecting to one subject
73
- index, reading one subject index composition, and then materializing the
74
- `IndividualController` facade from the loaded backend session.
75
- That walkthrough now uses the concrete direct backend runtime over the
76
- injected `RuntimeClient`, not only one abstract adapter mock, and now also
77
- demonstrates in-memory `JobManager` usage plus `closeProfile(...)`.
78
- 1. [tests/101-individual-controller-backend-runtime.test.mjs](./tests/101-individual-controller-backend-runtime.test.mjs)
79
- First pragmatic backend wrapper over the generic profile runtime for the
80
- current individual-controller CORE baseline:
81
- load profile, start registration, confirm order, and search the clinical
82
- index.
83
- 1. [docs/V2_INDIVIDUAL_REGISTRATION_RECONCILIATION.md](./docs/V2_INDIVIDUAL_REGISTRATION_RECONCILIATION.md)
84
- Reconciles the old consumer flow with the current CORE registration baseline
85
- and separates the stable registration base from later product extensions.
86
66
  1. [docs/101-SDK_END_TO_END.md](./docs/101-SDK_END_TO_END.md)
87
67
  Ordered onboarding guide with end-to-end journeys, copy/paste snippets, and
88
68
  the recommended reading path for new backend integrators.
89
69
  2. [docs/101-SDK_INTEGRATION.md](./docs/101-SDK_INTEGRATION.md)
90
- Real backend setup, imports, `initializeCommunicationIdentity(...)`,
91
- `new NodeHttpClient(...)`, route context, facade selection, and live method
92
- usage.
93
- 3. [docs/101-LIVE_GW_LOCAL.md](./docs/101-LIVE_GW_LOCAL.md)
70
+ Real backend setup plus the public runtime entrypoints:
71
+ `HostOnboardingSdk`, `OrganizationControllerSdk`,
72
+ `IndividualControllerSdk`, `ProfessionalSdk`, and route-context usage.
73
+ 3. [tests/101-live-full-cycle-bff-runtime.e2e.test.mjs](./tests/101-live-full-cycle-bff-runtime.e2e.test.mjs)
74
+ Canonical live backend/BFF walkthrough on a fresh local GW lifecycle:
75
+ host/tenant activation, employee provisioning, individual bootstrap,
76
+ consent grant, professional SMART token, clinical read, and final cleanup.
77
+ 4. [docs/101-LIVE_GW_LOCAL.md](./docs/101-LIVE_GW_LOCAL.md)
94
78
  Exact TTY/local/Docker commands for running the SDK against a real local GW
95
79
  CORE, including tenant bootstrap and employee-seat setup.
96
- 4. [docs/101-DISCOVERY.md](./docs/101-DISCOVERY.md)
80
+ 5. [docs/101-DISCOVERY.md](./docs/101-DISCOVERY.md)
97
81
  Node/BFF dataspace discovery, hosting-operator resolution, provider
98
82
  resolution, and the correct integration boundary for fallback and cache.
99
- 5. [gdc-sdk-core-ts/docs/101-SDK_FLOWS.md](https://github.com/Global-DataCare/gdc-sdk-core-ts/blob/main/docs/101-SDK_FLOWS.md)
83
+ 6. [gdc-sdk-core-ts/docs/101-SDK_FLOWS.md](https://github.com/Global-DataCare/gdc-sdk-core-ts/blob/main/docs/101-SDK_FLOWS.md)
100
84
  Actor split and business-flow map across organization, individual,
101
85
  permissions, invitation, import, and SMART flows.
102
- 6. [gwtemplate-node-ts/docs/PORTAL_API_TO_GW_CORE.md](https://github.com/Global-DataCare/gwtemplate-node-ts/blob/main/docs/PORTAL_API_TO_GW_CORE.md)
86
+ 7. [gwtemplate-node-ts/docs/PORTAL_API_TO_GW_CORE.md](https://github.com/Global-DataCare/gwtemplate-node-ts/blob/main/docs/PORTAL_API_TO_GW_CORE.md)
103
87
  Canonical portal/BFF functional map over GW CORE, including the domain
104
88
  split between `employees`, `related persons`, `members`, and `consents`.
105
- 7. [gdc-common-utils-ts/src/examples/](https://github.com/Global-DataCare/gdc-common-utils-ts/tree/main/src/examples)
89
+ 8. [gdc-common-utils-ts/src/examples/](https://github.com/Global-DataCare/gdc-common-utils-ts/tree/main/src/examples)
106
90
  Shared payload values used by the docs and tests.
107
- 8. [gdc-common-utils-ts/docs/101-LIFECYCLE.md](https://github.com/Global-DataCare/gdc-common-utils-ts/blob/main/docs/101-LIFECYCLE.md)
91
+ 9. [gdc-common-utils-ts/docs/101-LIFECYCLE.md](https://github.com/Global-DataCare/gdc-common-utils-ts/blob/main/docs/101-LIFECYCLE.md)
108
92
  Canonical `enable/disable/delete` semantics and copy/paste placeholders.
109
- 9. [docs/NEXT_STEPS.md](./docs/NEXT_STEPS.md)
93
+ 10. [tests/101-backend-profile-runtime.test.mjs](./tests/101-backend-profile-runtime.test.mjs)
94
+ Technical runtime slice for profile/device/session orchestration internals.
95
+ Read this after the public actor SDK guides, not before them.
96
+ 11. [tests/101-individual-controller-backend-runtime.test.mjs](./tests/101-individual-controller-backend-runtime.test.mjs)
97
+ Technical wrapper slice around the generic profile runtime. This is not the
98
+ main onboarding path for new integrators.
99
+ 12. [docs/V2_INDIVIDUAL_REGISTRATION_RECONCILIATION.md](./docs/V2_INDIVIDUAL_REGISTRATION_RECONCILIATION.md)
100
+ Historical reconciliation note for the current CORE registration baseline.
101
+ 13. [docs/NEXT_STEPS.md](./docs/NEXT_STEPS.md)
110
102
  Follow-up scope after GW CORE live validation, including the future user job
111
103
  manager boundary.
112
104
 
@@ -114,6 +106,9 @@ If you need the shortest path:
114
106
 
115
107
  - main onboarding guide:
116
108
  [docs/101-SDK_END_TO_END.md](./docs/101-SDK_END_TO_END.md)
109
+ - first public actor surfaces:
110
+ `HostOnboardingSdk`, `OrganizationControllerSdk`,
111
+ `IndividualControllerSdk`, `ProfessionalSdk`
117
112
  - GW CORE app identity:
118
113
  `appId` mandatory, `appVersion` optional with default `v1.0`
119
114
  - backend technical identity:
@@ -130,7 +125,7 @@ Current live teaching target:
130
125
 
131
126
  - the main executable tutorial for integrators is now:
132
127
  [tests/101-live-full-cycle-bff-runtime.e2e.test.mjs](tests/101-live-full-cycle-bff-runtime.e2e.test.mjs)
133
- - the standalone actor-profile suites still exist as focused technical slices:
128
+ - the standalone actor-profile suites still exist only as focused technical slices:
134
129
  - [tests/live-profile-runtime-individual.e2e.test.mjs](tests/live-profile-runtime-individual.e2e.test.mjs)
135
130
  - [tests/live-profile-runtime-professional.e2e.test.mjs](tests/live-profile-runtime-professional.e2e.test.mjs)
136
131
  - the larger runtime suite remains the regression-oriented environment proof:
@@ -1,6 +1,13 @@
1
1
  // Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
2
2
  import { resolvePollOptionsFromSeconds } from './poll-options.js';
3
3
  export async function confirmIndividualOrganizationOrderWithDeps(deps) {
4
+ /**
5
+ * Programming rule:
6
+ * - `offerId` here must come from the commercial individual/family bootstrap
7
+ * response
8
+ * - this helper must not be used for embedded legacy individual registration
9
+ * responses that do not mint an Offer
10
+ */
4
11
  const offerId = String(deps.input.offerId || '').trim();
5
12
  if (!offerId) {
6
13
  throw new Error('confirmIndividualOrganizationOrder requires offerId.');
@@ -64,6 +64,15 @@ export async function startIndividualOrganizationWithDeps(deps) {
64
64
  });
65
65
  const registration = await deps.submitAndPoll(deps.individualFamilyOrganizationBatchPath(deps.routeCtx), deps.individualFamilyOrganizationPollPath(deps.routeCtx), registrationPayload, pollOptions);
66
66
  deps.assertFirstDidcommEntrySuccess?.(registration, 'startIndividualOrganization.registration');
67
+ /**
68
+ * Commercial contract for this SDK path:
69
+ * - this helper targets the family/individual commercial bootstrap flow
70
+ * - the registration response must expose one Offer identifier
71
+ * - the caller must later confirm that Offer through `Order/_batch`
72
+ *
73
+ * This helper must therefore fail fast if the underlying GW route behaves
74
+ * like the embedded non-commercial individual registration flow instead.
75
+ */
67
76
  const offerId = deps.getOfferIdFromResponse(registration);
68
77
  if (!offerId) {
69
78
  throw new Error('startIndividualOrganization failed: missing offerId in registration response.');
@@ -125,6 +125,12 @@ export declare class HttpRuntimeClient implements NodeRuntimeClient {
125
125
  * - `_transaction` is the new host onboarding step
126
126
  * - this runtime does not chain `_activate` after `_transaction`
127
127
  * - `_activate` remains available only for the older ICA `_verify` based flow
128
+ *
129
+ * Commercial contract:
130
+ * - the final poll response is expected to mint
131
+ * `meta.claims['org.schema.Offer.identifier']`
132
+ * - callers should then pass that exact value to
133
+ * `confirmLegalOrganizationOrder(...)`
128
134
  */
129
135
  submitLegalOrganizationVerificationTransaction(hostCtx: HostRouteContext, input: NodeLegalOrganizationVerificationTransactionInput, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
130
136
  /**
@@ -135,6 +141,7 @@ export declare class HttpRuntimeClient implements NodeRuntimeClient {
135
141
  * - reuse the same signed evidence/controller binding contract as `_transaction`
136
142
  * - do not create a new Offer
137
143
  * - expect GW CORE to reissue one controller activation code in the response
144
+ * - do not call `confirmLegalOrganizationOrder(...)` after this flow
138
145
  */
139
146
  submitLegalOrganizationIssue(hostCtx: HostRouteContext, input: NodeLegalOrganizationVerificationTransactionInput, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
140
147
  /**
@@ -162,10 +169,19 @@ export declare class HttpRuntimeClient implements NodeRuntimeClient {
162
169
  * headers instead of plaintext `meta`
163
170
  * - this mirrored metadata is transport fallback only; the canonical
164
171
  * activation contract remains `body.vp_token` plus `body.controller.*`
172
+ *
173
+ * Commercial contract:
174
+ * - legacy `_activate` is still expected to mint
175
+ * `meta.claims['org.schema.Offer.identifier']`
176
+ * - callers should then pass that exact value to
177
+ * `confirmLegalOrganizationOrder(...)`
165
178
  */
166
179
  activateOrganizationInGatewayFromIcaProof(hostCtx: HostRouteContext, input: NodeOrganizationActivationInput, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
167
180
  /**
168
181
  * Confirms a host-side legal organization order after the initial activation.
182
+ *
183
+ * Use this only when the previous flow actually returned one canonical Offer
184
+ * identifier. `_transaction` and legacy `_activate` do; `_issue` does not.
169
185
  */
170
186
  confirmLegalOrganizationOrder(hostCtx: HostRouteContext, input: LegalOrganizationOrderInput, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
171
187
  /**
@@ -244,6 +260,15 @@ export declare class HttpRuntimeClient implements NodeRuntimeClient {
244
260
  confirmOrganizationLicenseOrder(ctx: RouteContext, input: OrganizationLicenseOrderConfirmInput, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
245
261
  /**
246
262
  * Starts the onboarding flow for an individual-oriented tenant or index.
263
+ *
264
+ * Commercial contract:
265
+ * - this SDK method targets the family/individual commercial bootstrap flow
266
+ * - the registration poll response is expected to return one Offer id
267
+ * - callers should then confirm it through
268
+ * `confirmIndividualOrganizationOrder(...)`
269
+ *
270
+ * This is distinct from embedded legacy individual registration helpers in
271
+ * GW CORE that may persist an individual record without minting an Offer.
247
272
  */
248
273
  startIndividualOrganization(input: IndividualOrganizationBootstrapInput): Promise<IndividualOrganizationStartResult>;
249
274
  /**
@@ -113,6 +113,12 @@ export class HttpRuntimeClient {
113
113
  * - `_transaction` is the new host onboarding step
114
114
  * - this runtime does not chain `_activate` after `_transaction`
115
115
  * - `_activate` remains available only for the older ICA `_verify` based flow
116
+ *
117
+ * Commercial contract:
118
+ * - the final poll response is expected to mint
119
+ * `meta.claims['org.schema.Offer.identifier']`
120
+ * - callers should then pass that exact value to
121
+ * `confirmLegalOrganizationOrder(...)`
116
122
  */
117
123
  async submitLegalOrganizationVerificationTransaction(hostCtx, input, pollOptions) {
118
124
  const thid = `organization-verification-transaction-${runtimeUuid()}`;
@@ -134,6 +140,7 @@ export class HttpRuntimeClient {
134
140
  * - reuse the same signed evidence/controller binding contract as `_transaction`
135
141
  * - do not create a new Offer
136
142
  * - expect GW CORE to reissue one controller activation code in the response
143
+ * - do not call `confirmLegalOrganizationOrder(...)` after this flow
137
144
  */
138
145
  async submitLegalOrganizationIssue(hostCtx, input, pollOptions) {
139
146
  const thid = `organization-issue-${runtimeUuid()}`;
@@ -182,6 +189,12 @@ export class HttpRuntimeClient {
182
189
  * headers instead of plaintext `meta`
183
190
  * - this mirrored metadata is transport fallback only; the canonical
184
191
  * activation contract remains `body.vp_token` plus `body.controller.*`
192
+ *
193
+ * Commercial contract:
194
+ * - legacy `_activate` is still expected to mint
195
+ * `meta.claims['org.schema.Offer.identifier']`
196
+ * - callers should then pass that exact value to
197
+ * `confirmLegalOrganizationOrder(...)`
185
198
  */
186
199
  async activateOrganizationInGatewayFromIcaProof(hostCtx, input, pollOptions) {
187
200
  const thid = `activate-org-${runtimeUuid()}`;
@@ -230,6 +243,9 @@ export class HttpRuntimeClient {
230
243
  }
231
244
  /**
232
245
  * Confirms a host-side legal organization order after the initial activation.
246
+ *
247
+ * Use this only when the previous flow actually returned one canonical Offer
248
+ * identifier. `_transaction` and legacy `_activate` do; `_issue` does not.
233
249
  */
234
250
  async confirmLegalOrganizationOrder(hostCtx, input, pollOptions) {
235
251
  return confirmLegalOrganizationOrderWithDeps({
@@ -440,6 +456,15 @@ export class HttpRuntimeClient {
440
456
  }
441
457
  /**
442
458
  * Starts the onboarding flow for an individual-oriented tenant or index.
459
+ *
460
+ * Commercial contract:
461
+ * - this SDK method targets the family/individual commercial bootstrap flow
462
+ * - the registration poll response is expected to return one Offer id
463
+ * - callers should then confirm it through
464
+ * `confirmIndividualOrganizationOrder(...)`
465
+ *
466
+ * This is distinct from embedded legacy individual registration helpers in
467
+ * GW CORE that may persist an individual record without minting an Offer.
443
468
  */
444
469
  async startIndividualOrganization(input) {
445
470
  const routeCtx = this.routeCtxFromInput(input);
@@ -8,6 +8,12 @@ export declare class HostOnboardingSdk implements HostingControllerFacade {
8
8
  /**
9
9
  * Submits the legal organization activation proof and required declared
10
10
  * service capabilities to GW CORE.
11
+ *
12
+ * Commercial contract:
13
+ * - this legacy `_activate` facade must return one canonical Offer in
14
+ * `meta.claims['org.schema.Offer.identifier']`
15
+ * - callers are expected to pass that Offer to
16
+ * `confirmLegalOrganizationOrder(...)`
11
17
  */
12
18
  activateOrganizationInGatewayFromIcaProof(hostCtx: HostRouteContext, input: NodeOrganizationActivationInput, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
13
19
  confirmLegalOrganizationOrder(hostCtx: HostRouteContext, input: LegalOrganizationOrderInput, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
@@ -11,6 +11,12 @@ export class HostOnboardingSdk {
11
11
  /**
12
12
  * Submits the legal organization activation proof and required declared
13
13
  * service capabilities to GW CORE.
14
+ *
15
+ * Commercial contract:
16
+ * - this legacy `_activate` facade must return one canonical Offer in
17
+ * `meta.claims['org.schema.Offer.identifier']`
18
+ * - callers are expected to pass that Offer to
19
+ * `confirmLegalOrganizationOrder(...)`
14
20
  */
15
21
  activateOrganizationInGatewayFromIcaProof(hostCtx, input, pollOptions) {
16
22
  assertFacadeCapability(this.capabilities, ActorCapabilities.HostingActivateOrganization, ActorKinds.HostOnboarding, 'activateOrganizationInGatewayFromIcaProof');
@@ -1,6 +1,12 @@
1
1
  // Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
2
2
  import { activateEmployeeDeviceWithActivationCodeWithDeps } from './device-activation.js';
3
3
  export async function recoverOrganizationControllerWithIssueWithDeps(deps) {
4
+ /**
5
+ * Existing-tenant controller recovery contract:
6
+ * - `Organization/_issue` is expected to reissue controller activation
7
+ * material only
8
+ * - this flow must not depend on a new commercial Offer or Order step
9
+ */
4
10
  const issue = await deps.submitLegalOrganizationIssue(deps.hostCtx, deps.input.issueInput, deps.input.issuePollOptions);
5
11
  const activationCode = readActivationCodeFromIssueResult(issue);
6
12
  if (!activationCode) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gdc-sdk-node-ts",
3
- "version": "2.0.10",
3
+ "version": "2.0.11",
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.0.15",
39
- "gdc-sdk-core-ts": "^2.0.9"
38
+ "gdc-common-utils-ts": "^2.0.17",
39
+ "gdc-sdk-core-ts": "^2.0.10"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@types/node": "^20.14.10",