gdc-sdk-node-ts 0.3.0 → 0.3.1

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.
@@ -1,7 +1,7 @@
1
- import type { ControllerBindingInput } from 'gdc-common-utils-ts/models';
2
1
  import type { AppInfo } from 'gdc-sdk-core-ts';
3
2
  import { type ResolvedAppInfo } from 'gdc-sdk-core-ts';
4
3
  import { type HostRouteContext } from './host-onboarding.js';
4
+ import type { NodeOrganizationActivationInput } from './orchestration/client-port.js';
5
5
  import { type IndividualOrganizationConfirmOrderInput, type RouteContext } from './individual-onboarding.js';
6
6
  import { type SmartTokenRequestInput } from './smart-token.js';
7
7
  import { type IndividualOrganizationBootstrapInput, type IndividualOrganizationStartResult } from './individual-start.js';
@@ -91,11 +91,7 @@ export declare class HttpRuntimeClient implements NodeRuntimeClient {
91
91
  * Activates a legal organization in the gateway host registry using an ICA
92
92
  * proof token already obtained by the caller.
93
93
  */
94
- activateOrganizationInGatewayFromIcaProof(hostCtx: HostRouteContext, input: {
95
- vpToken: string;
96
- controller?: ControllerBindingInput;
97
- additionalClaims?: Record<string, unknown>;
98
- }, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
94
+ activateOrganizationInGatewayFromIcaProof(hostCtx: HostRouteContext, input: NodeOrganizationActivationInput, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
99
95
  /**
100
96
  * Confirms a host-side legal organization order after the initial activation.
101
97
  */
@@ -1,7 +1,8 @@
1
1
  // Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
2
+ // Always create JSDoc, do not use strings inline in keys nor values, use types instead, and reuse the data test examples.
2
3
  import fs from 'node:fs';
3
4
  import path from 'node:path';
4
- import { buildAppHeaders, resolveAppInfo, } from 'gdc-sdk-core-ts';
5
+ import { buildAppHeaders, createBootstrapFacade, resolveAppInfo, } from 'gdc-sdk-core-ts';
5
6
  import { buildConsentClaimsSimpleWithCid } from 'gdc-common-utils-ts/utils/consent';
6
7
  import { pollUntilCompleteWithMethod } from './async-polling.js';
7
8
  import { confirmLegalOrganizationOrderWithDeps } from './host-onboarding.js';
@@ -10,6 +11,7 @@ import { requestSmartTokenWithDeps } from './smart-token.js';
10
11
  import { startIndividualOrganizationWithDeps } from './individual-start.js';
11
12
  import { createOrganizationEmployeeWithDeps, grantProfessionalAccessWithDeps, ingestCommunicationAndUpdateIndexWithDeps, searchClinicalBundleWithDeps, searchLatestIpsWithDeps, upsertRelatedPersonAndPollWithDeps, } from './resource-operations.js';
12
13
  import { submitAndPollWithMethods } from './orchestration/client-port.js';
14
+ const bootstrapFacade = createBootstrapFacade();
13
15
  /**
14
16
  * Runtime-oriented HTTP client for Node backends, BFFs, and workers that need
15
17
  * to submit GDC gateway requests and poll asynchronous responses.
@@ -87,6 +89,13 @@ export class HttpRuntimeClient {
87
89
  */
88
90
  async activateOrganizationInGatewayFromIcaProof(hostCtx, input, pollOptions) {
89
91
  const thid = `activate-org-${runtimeUuid()}`;
92
+ const activationDraft = bootstrapFacade.createOrganizationActivationDraft({
93
+ vpToken: input.vpToken,
94
+ controller: input.controller,
95
+ service: input.service,
96
+ additionalClaims: input.additionalClaims,
97
+ });
98
+ const serviceClaims = activationDraft.buildServiceClaims();
90
99
  const payload = {
91
100
  thid,
92
101
  iss: String(hostCtx.controllerDid || '').trim() || undefined,
@@ -100,6 +109,7 @@ export class HttpRuntimeClient {
100
109
  meta: {
101
110
  claims: {
102
111
  '@context': 'org.schema',
112
+ ...serviceClaims,
103
113
  ...(input.additionalClaims || {}),
104
114
  },
105
115
  },
@@ -107,6 +117,7 @@ export class HttpRuntimeClient {
107
117
  meta: {
108
118
  claims: {
109
119
  '@context': 'org.schema',
120
+ ...serviceClaims,
110
121
  ...(input.additionalClaims || {}),
111
122
  },
112
123
  },
@@ -1,5 +1,5 @@
1
1
  import type { ControllerBindingInput } from 'gdc-common-utils-ts/models';
2
- import type { AsyncPollRequest, PollOptions, PollResult, SubmitAndPollResult, SubmitPayload, SubmitResponse } from 'gdc-sdk-core-ts';
2
+ import type { AsyncPollRequest, OrganizationActivationServiceOptions, PollOptions, PollResult, SubmitAndPollResult, SubmitPayload, SubmitResponse } from 'gdc-sdk-core-ts';
3
3
  export type { AsyncPollRequest, PollOptions, PollResult, SubmitAndPollResult, SubmitPayload, SubmitResponse, } from 'gdc-sdk-core-ts';
4
4
  import type { EmployeeDeviceActivationResult, EmployeeDeviceActivationRequestInput } from '../device-activation.js';
5
5
  import type { HostRouteContext, LegalOrganizationOrderInput } from '../host-onboarding.js';
@@ -7,6 +7,18 @@ import type { IndividualOrganizationConfirmOrderInput, RouteContext } from '../i
7
7
  import type { IndividualOrganizationBootstrapInput, IndividualOrganizationStartResult } from '../individual-start.js';
8
8
  import type { SmartTokenExchangeResult, SmartTokenRequestInput } from '../smart-token.js';
9
9
  import type { CommunicationIngestionInput, ClinicalBundleSearchInput, DigitalTwinGenerationInput, GrantProfessionalAccessInput, GrantProfessionalAccessResult, IpsOrFhirImportInput, OrganizationEmployeeCreationInput, RelatedPersonUpsertInput } from '../resource-operations.js';
10
+ /**
11
+ * Shared node-runtime activation input.
12
+ *
13
+ * Keep this centralized in the node runtime until every consumer compiles
14
+ * against a published `gdc-sdk-core-ts` version that exports the same alias.
15
+ */
16
+ export type NodeOrganizationActivationInput = {
17
+ vpToken: string;
18
+ controller?: ControllerBindingInput;
19
+ service?: OrganizationActivationServiceOptions;
20
+ additionalClaims?: Record<string, unknown>;
21
+ };
10
22
  /**
11
23
  * Runtime-neutral actor/application client contract as exposed by the Node SDK.
12
24
  *
@@ -15,11 +27,7 @@ import type { CommunicationIngestionInput, ClinicalBundleSearchInput, DigitalTwi
15
27
  * converge across runtimes.
16
28
  */
17
29
  export type RuntimeClient = {
18
- activateOrganizationInGatewayFromIcaProof?: (hostCtx: HostRouteContext, input: {
19
- vpToken: string;
20
- controller?: ControllerBindingInput;
21
- additionalClaims?: Record<string, unknown>;
22
- }, pollOptions?: PollOptions) => Promise<SubmitAndPollResult>;
30
+ activateOrganizationInGatewayFromIcaProof?: (hostCtx: HostRouteContext, input: NodeOrganizationActivationInput, pollOptions?: PollOptions) => Promise<SubmitAndPollResult>;
23
31
  confirmLegalOrganizationOrder?: (hostCtx: HostRouteContext, input: LegalOrganizationOrderInput, pollOptions?: PollOptions) => Promise<SubmitAndPollResult>;
24
32
  createOrganizationEmployee?: (ctx: RouteContext, input: OrganizationEmployeeCreationInput, pollOptions?: PollOptions) => Promise<SubmitAndPollResult>;
25
33
  activateEmployeeDeviceWithActivationRequest?: (input: EmployeeDeviceActivationRequestInput) => Promise<EmployeeDeviceActivationResult>;
@@ -1,14 +1,13 @@
1
- import type { ControllerBindingInput } from 'gdc-common-utils-ts/models';
2
- import { type NodeRuntimeClient, type PollOptions, type SubmitAndPollResult, type SubmitPayload } from './client-port.js';
1
+ import { type NodeOrganizationActivationInput, type NodeRuntimeClient, type PollOptions, type SubmitAndPollResult, type SubmitPayload } from './client-port.js';
3
2
  import type { HostRouteContext, LegalOrganizationOrderInput } from '../host-onboarding.js';
4
3
  export declare class HostOnboardingSdk {
5
4
  private readonly client;
6
5
  constructor(client: NodeRuntimeClient);
7
- activateOrganizationInGatewayFromIcaProof(hostCtx: HostRouteContext, input: {
8
- vpToken: string;
9
- controller?: ControllerBindingInput;
10
- additionalClaims?: Record<string, unknown>;
11
- }, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
6
+ /**
7
+ * Submits the legal organization activation proof and required declared
8
+ * service capabilities to GW CORE.
9
+ */
10
+ activateOrganizationInGatewayFromIcaProof(hostCtx: HostRouteContext, input: NodeOrganizationActivationInput, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
12
11
  confirmLegalOrganizationOrder(hostCtx: HostRouteContext, input: LegalOrganizationOrderInput, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
13
12
  submitAndPoll(submitPath: string, pollPath: string, payload: SubmitPayload, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
14
13
  }
@@ -1,8 +1,14 @@
1
+ // Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
2
+ // Always create JSDoc, do not use strings inline in keys nor values, use types instead, and reuse the data test examples.
1
3
  import { requireClientMethod, submitAndPollWithClient, } from './client-port.js';
2
4
  export class HostOnboardingSdk {
3
5
  constructor(client) {
4
6
  this.client = client;
5
7
  }
8
+ /**
9
+ * Submits the legal organization activation proof and required declared
10
+ * service capabilities to GW CORE.
11
+ */
6
12
  activateOrganizationInGatewayFromIcaProof(hostCtx, input, pollOptions) {
7
13
  return requireClientMethod(this.client, 'activateOrganizationInGatewayFromIcaProof')(hostCtx, input, pollOptions);
8
14
  }
@@ -8,7 +8,7 @@ export declare class IndividualMemberSdk {
8
8
  /**
9
9
  * Creates or updates the member/caregiver `RelatedPerson` relationship to the subject.
10
10
  */
11
- upsertRelatedPersonAndPoll(ctx: RouteContext, input: RelatedPersonUpsertInput): Promise<import("gdc-sdk-core-ts/dist/polling-model.js").SubmitAndPollResult>;
11
+ upsertRelatedPersonAndPoll(ctx: RouteContext, input: RelatedPersonUpsertInput): Promise<import("gdc-sdk-core-ts/polling-model.js").SubmitAndPollResult>;
12
12
  /**
13
13
  * Requests a SMART token for a non-employee actor such as a `RelatedPerson`
14
14
  * caregiver, guardian, or family member.
@@ -1,5 +1,4 @@
1
- import type { ControllerBindingInput } from 'gdc-common-utils-ts/models';
2
- import { type NodeRuntimeClient, type PollOptions, type SubmitAndPollResult, type SubmitPayload } from './client-port.js';
1
+ import { type NodeOrganizationActivationInput, type NodeRuntimeClient, type PollOptions, type SubmitAndPollResult, type SubmitPayload } from './client-port.js';
3
2
  import type { HostRouteContext } from '../host-onboarding.js';
4
3
  import type { RouteContext } from '../individual-onboarding.js';
5
4
  import type { EmployeeDeviceActivationResult, EmployeeDeviceActivationRequestInput } from '../device-activation.js';
@@ -16,13 +15,11 @@ export declare class ProfessionalSdk {
16
15
  */
17
16
  constructor(client: NodeRuntimeClient);
18
17
  /**
19
- * Activates the legal organization in the gateway from an ICA-issued proof token.
18
+ * Activates the legal organization in the gateway from an ICA-issued proof
19
+ * token and the declared service capabilities that will be published through
20
+ * DID/DCAT discovery.
20
21
  */
21
- activateOrganizationInGatewayFromIcaProof(hostCtx: HostRouteContext, input: {
22
- vpToken: string;
23
- controller?: ControllerBindingInput;
24
- additionalClaims?: Record<string, unknown>;
25
- }, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
22
+ activateOrganizationInGatewayFromIcaProof(hostCtx: HostRouteContext, input: NodeOrganizationActivationInput, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
26
23
  /**
27
24
  * Creates an employee/professional under the current organization tenant.
28
25
  */
@@ -1,3 +1,5 @@
1
+ // Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
2
+ // Always create JSDoc, do not use strings inline in keys nor values, use types instead, and reuse the data test examples.
1
3
  import { requireClientMethod, submitAndPollWithClient, } from './client-port.js';
2
4
  /**
3
5
  * Professional-oriented facade combining host onboarding, employee bootstrap,
@@ -11,7 +13,9 @@ export class ProfessionalSdk {
11
13
  this.client = client;
12
14
  }
13
15
  /**
14
- * Activates the legal organization in the gateway from an ICA-issued proof token.
16
+ * Activates the legal organization in the gateway from an ICA-issued proof
17
+ * token and the declared service capabilities that will be published through
18
+ * DID/DCAT discovery.
15
19
  */
16
20
  activateOrganizationInGatewayFromIcaProof(hostCtx, input, pollOptions) {
17
21
  return requireClientMethod(this.client, 'activateOrganizationInGatewayFromIcaProof')(hostCtx, input, pollOptions);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gdc-sdk-node-ts",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
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.",
@@ -17,8 +17,8 @@
17
17
  "test:e2e:live-gw": "npm run build && RUN_LIVE_GW_E2E=1 node --test tests/live-gw-node-runtime.e2e.test.mjs"
18
18
  },
19
19
  "dependencies": {
20
- "gdc-common-utils-ts": "^1.6.0",
21
- "gdc-sdk-core-ts": "^0.3.0"
20
+ "gdc-common-utils-ts": "^1.7.0",
21
+ "gdc-sdk-core-ts": "^0.3.2"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@types/node": "^20.14.10",