gdc-sdk-node-ts 0.4.0 → 0.5.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.
@@ -5,13 +5,28 @@ import type { NodeOrganizationActivationInput } from './orchestration/client-por
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';
8
- import { type CommunicationIngestionInput, type ClinicalBundleSearchInput, type GrantProfessionalAccessInput, type GrantProfessionalAccessResult, type IndividualMemberLifecycleInput, type IndividualOrganizationLifecycleInput, type OrganizationEmployeeCreationInput, type OrganizationEmployeeLifecycleInput, type RelatedPersonUpsertInput } from './resource-operations.js';
8
+ import { type CommunicationIngestionInput, type ClinicalBundleSearchInput, type GrantProfessionalAccessInput, type GrantProfessionalAccessResult, type IndividualMemberLifecycleInput, type IndividualOrganizationLifecycleInput, type OrganizationEmployeeCreationInput, type OrganizationEmployeeLifecycleInput, type RelatedPersonUpsertInput, type RelatedProfileSearchRuntimeInput } from './resource-operations.js';
9
9
  import type { LegalOrganizationOrderInput } from './host-onboarding.js';
10
10
  import type { SmartTokenExchangeResult } from './smart-token.js';
11
11
  import type { NodeRuntimeClient, PollOptions, PollResult, SubmitAndPollResult, SubmitPayload, SubmitResponse } from './orchestration/client-port.js';
12
12
  export type HttpRuntimeClientOptions = {
13
13
  baseUrl: string;
14
14
  bearerToken?: string;
15
+ /**
16
+ * Optional ICA-issued runtime/software proof token reused as the default
17
+ * HTTP Bearer credential in demo/compat profiles when no explicit
18
+ * `bearerToken` is provided.
19
+ *
20
+ * This keeps the SDK wiring ready for a future ICA-authorized software
21
+ * runtime contract without forcing callers to overload the semantic name
22
+ * `bearerToken` in documentation or app code.
23
+ *
24
+ * Current `gwtemplate-node-ts` demo/bootstrap flows do not yet require a
25
+ * registered software/runtime proof for this path, so callers may omit this
26
+ * field or pass an empty string until the ICA runtime-registration contract
27
+ * is finalized.
28
+ */
29
+ runtimeVpToken?: string;
15
30
  /**
16
31
  * Host app identity required by GW CORE.
17
32
  *
@@ -44,6 +59,7 @@ export type NodeHttpClientOptions = HttpRuntimeClientOptions;
44
59
  export declare class HttpRuntimeClient implements NodeRuntimeClient {
45
60
  private readonly baseUrl;
46
61
  private readonly bearerToken?;
62
+ private readonly runtimeVpToken?;
47
63
  private readonly resolvedAppInfo?;
48
64
  private readonly ctx?;
49
65
  private readonly defaultHeaders;
@@ -54,6 +70,7 @@ export declare class HttpRuntimeClient implements NodeRuntimeClient {
54
70
  * @param options.baseUrl Gateway base URL without trailing slash.
55
71
  * @param options.interopMode Optional runtime interoperability mode from the SDK config layer (`demo`, `compat`, `strict`).
56
72
  * @param options.bearerToken Optional bearer token reused for direct HTTP calls.
73
+ * @param options.runtimeVpToken Optional ICA-issued runtime/software proof token reused as Bearer when `bearerToken` is not set. Current `gwtemplate-node-ts` demo/bootstrap flows may omit it or pass an empty string because software/runtime registration is not enforced there yet.
57
74
  * @param options.appInfo Optional GW CORE app identity. When present, the
58
75
  * client injects `AppId` and `AppVersion` into all outgoing requests.
59
76
  * @param options.ctx Optional default route context.
@@ -69,6 +86,10 @@ export declare class HttpRuntimeClient implements NodeRuntimeClient {
69
86
  * Returns the standard GW CORE headers currently injected by the Node client.
70
87
  */
71
88
  getAppHeaders(): Record<'AppId' | 'AppVersion', string> | undefined;
89
+ /**
90
+ * Returns the configured ICA-issued runtime/software proof token, when present.
91
+ */
92
+ getRuntimeVpToken(): string | undefined;
72
93
  /**
73
94
  * Builds a canonical GDC v1 resource/action path from a route context.
74
95
  */
@@ -184,6 +205,11 @@ export declare class HttpRuntimeClient implements NodeRuntimeClient {
184
205
  * roles such as a grandfather, guardian, or external caregiver.
185
206
  */
186
207
  upsertRelatedPersonAndPoll(ctx: RouteContext, input: RelatedPersonUpsertInput): Promise<SubmitAndPollResult>;
208
+ /**
209
+ * Searches active related profiles for the given actor identifier by querying
210
+ * `RelatedPerson/_search`.
211
+ */
212
+ searchRelatedProfiles(ctx: RouteContext, input: RelatedProfileSearchRuntimeInput): Promise<SubmitAndPollResult>;
187
213
  /**
188
214
  * Submits a FHIR `Communication` ingestion request and polls until the
189
215
  * GW has persisted the audit record and related projections.
@@ -255,6 +281,8 @@ export declare class HttpRuntimeClient implements NodeRuntimeClient {
255
281
  individualFamilyOrderPollPath(ctx?: RouteContext): string;
256
282
  individualRelatedPersonBatchPath(ctx?: RouteContext): string;
257
283
  individualRelatedPersonPollPath(ctx?: RouteContext): string;
284
+ individualRelatedPersonSearchPath(ctx?: RouteContext): string;
285
+ individualRelatedPersonSearchPollPath(ctx?: RouteContext): string;
258
286
  individualConsentR4BatchPath(ctx: RouteContext): string;
259
287
  individualConsentR4PollPath(ctx: RouteContext): string;
260
288
  individualCommunicationBatchPath(ctx: RouteContext, format: 'org.hl7.fhir.api' | 'org.hl7.fhir.r4'): string;
@@ -1,5 +1,11 @@
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
+ * @fileoverview Default HTTP implementation of the node runtime client.
4
+ *
5
+ * @architecture 101
6
+ * Keep deployed path conventions centralized here so higher-level SDK methods can
7
+ * stay business-oriented and testable.
8
+ */
3
9
  import fs from 'node:fs';
4
10
  import path from 'node:path';
5
11
  import { buildAppHeaders, createBootstrapFacade, resolveAppInfo, } from 'gdc-sdk-core-ts';
@@ -9,7 +15,7 @@ import { confirmLegalOrganizationOrderWithDeps } from './host-onboarding.js';
9
15
  import { confirmIndividualOrganizationOrderWithDeps, } from './individual-onboarding.js';
10
16
  import { requestSmartTokenWithDeps } from './smart-token.js';
11
17
  import { startIndividualOrganizationWithDeps } from './individual-start.js';
12
- import { createOrganizationEmployeeWithDeps, disableIndividualOrganizationWithDeps, disableOrganizationEmployeeWithDeps, grantProfessionalAccessWithDeps, ingestCommunicationAndUpdateIndexWithDeps, purgeIndividualOrganizationWithDeps, purgeOrganizationEmployeeWithDeps, searchClinicalBundleWithDeps, searchLatestIpsWithDeps, upsertRelatedPersonAndPollWithDeps, } from './resource-operations.js';
18
+ import { createOrganizationEmployeeWithDeps, disableIndividualOrganizationWithDeps, disableOrganizationEmployeeWithDeps, grantProfessionalAccessWithDeps, ingestCommunicationAndUpdateIndexWithDeps, purgeIndividualOrganizationWithDeps, purgeOrganizationEmployeeWithDeps, searchRelatedProfilesWithDeps, searchClinicalBundleWithDeps, searchLatestIpsWithDeps, upsertRelatedPersonAndPollWithDeps, } from './resource-operations.js';
13
19
  import { submitAndPollWithMethods } from './orchestration/client-port.js';
14
20
  import { GwCoreLifecycleAction } from './constants/lifecycle.js';
15
21
  const bootstrapFacade = createBootstrapFacade();
@@ -26,6 +32,7 @@ export class HttpRuntimeClient {
26
32
  * @param options.baseUrl Gateway base URL without trailing slash.
27
33
  * @param options.interopMode Optional runtime interoperability mode from the SDK config layer (`demo`, `compat`, `strict`).
28
34
  * @param options.bearerToken Optional bearer token reused for direct HTTP calls.
35
+ * @param options.runtimeVpToken Optional ICA-issued runtime/software proof token reused as Bearer when `bearerToken` is not set. Current `gwtemplate-node-ts` demo/bootstrap flows may omit it or pass an empty string because software/runtime registration is not enforced there yet.
29
36
  * @param options.appInfo Optional GW CORE app identity. When present, the
30
37
  * client injects `AppId` and `AppVersion` into all outgoing requests.
31
38
  * @param options.ctx Optional default route context.
@@ -35,7 +42,10 @@ export class HttpRuntimeClient {
35
42
  constructor(options) {
36
43
  this.tokenCache = new Map();
37
44
  this.baseUrl = String(options.baseUrl || '').replace(/\/+$/, '');
38
- this.bearerToken = String(options.bearerToken || '').trim() || undefined;
45
+ this.runtimeVpToken = String(options.runtimeVpToken || '').trim() || undefined;
46
+ this.bearerToken = String(options.bearerToken || '').trim()
47
+ || this.runtimeVpToken
48
+ || undefined;
39
49
  this.resolvedAppInfo = options.appInfo ? resolveAppInfo(options.appInfo) : undefined;
40
50
  this.ctx = options.ctx;
41
51
  this.defaultHeaders = {
@@ -59,6 +69,12 @@ export class HttpRuntimeClient {
59
69
  return undefined;
60
70
  return buildAppHeaders(this.resolvedAppInfo);
61
71
  }
72
+ /**
73
+ * Returns the configured ICA-issued runtime/software proof token, when present.
74
+ */
75
+ getRuntimeVpToken() {
76
+ return this.runtimeVpToken;
77
+ }
62
78
  /**
63
79
  * Builds a canonical GDC v1 resource/action path from a route context.
64
80
  */
@@ -320,6 +336,17 @@ export class HttpRuntimeClient {
320
336
  submitAndPoll: this.submitAndPoll.bind(this),
321
337
  });
322
338
  }
339
+ /**
340
+ * Searches active related profiles for the given actor identifier by querying
341
+ * `RelatedPerson/_search`.
342
+ */
343
+ async searchRelatedProfiles(ctx, input) {
344
+ return searchRelatedProfilesWithDeps(ctx, input, {
345
+ individualRelatedPersonSearchPath: this.individualRelatedPersonSearchPath.bind(this),
346
+ individualRelatedPersonSearchPollPath: this.individualRelatedPersonSearchPollPath.bind(this),
347
+ submitAndPoll: this.submitAndPoll.bind(this),
348
+ });
349
+ }
323
350
  /**
324
351
  * Submits a FHIR `Communication` ingestion request and polls until the
325
352
  * GW has persisted the audit record and related projections.
@@ -532,6 +559,8 @@ export class HttpRuntimeClient {
532
559
  individualFamilyOrderPollPath(ctx) { return this.v1Path(ctx, 'individual', 'org.schema', 'Order', '_batch-response'); }
533
560
  individualRelatedPersonBatchPath(ctx) { return this.v1Path(ctx, 'individual', 'org.hl7.fhir.r4', 'RelatedPerson', '_batch'); }
534
561
  individualRelatedPersonPollPath(ctx) { return this.v1Path(ctx, 'individual', 'org.hl7.fhir.r4', 'RelatedPerson', '_batch-response'); }
562
+ individualRelatedPersonSearchPath(ctx) { return this.v1Path(ctx, 'individual', 'org.hl7.fhir.r4', 'RelatedPerson', '_search'); }
563
+ individualRelatedPersonSearchPollPath(ctx) { return this.v1Path(ctx, 'individual', 'org.hl7.fhir.r4', 'RelatedPerson', '_search-response'); }
535
564
  individualConsentR4BatchPath(ctx) { return this.v1Path(ctx, 'individual', 'org.hl7.fhir.r4', 'Consent', '_batch'); }
536
565
  individualConsentR4PollPath(ctx) { return this.v1Path(ctx, 'individual', 'org.hl7.fhir.r4', 'Consent', '_batch-response'); }
537
566
  individualCommunicationBatchPath(ctx, format) { return this.v1Path(ctx, 'individual', format, 'Communication', '_batch'); }
@@ -1,4 +1,10 @@
1
- import type { ControllerBindingInput } from 'gdc-common-utils-ts/models';
1
+ /**
2
+ * @fileoverview Shared runtime-client contracts for node orchestration.
3
+ *
4
+ * @architecture 101
5
+ * This module is contract-only. Route/path details stay in concrete runtime clients.
6
+ */
7
+ import type { ControllerBindingInput } from 'gdc-common-utils-ts/models/index';
2
8
  import type { AsyncPollRequest, OrganizationActivationServiceOptions, PollOptions, PollResult, SubmitAndPollResult, SubmitPayload, SubmitResponse } from 'gdc-sdk-core-ts';
3
9
  export type { AsyncPollRequest, PollOptions, PollResult, SubmitAndPollResult, SubmitPayload, SubmitResponse, } from 'gdc-sdk-core-ts';
4
10
  import type { EmployeeDeviceActivationResult, EmployeeDeviceActivationRequestInput } from '../device-activation.js';
@@ -6,7 +12,7 @@ import type { HostRouteContext, LegalOrganizationOrderInput } from '../host-onbo
6
12
  import type { IndividualOrganizationConfirmOrderInput, RouteContext } from '../individual-onboarding.js';
7
13
  import type { IndividualOrganizationBootstrapInput, IndividualOrganizationStartResult } from '../individual-start.js';
8
14
  import type { SmartTokenExchangeResult, SmartTokenRequestInput } from '../smart-token.js';
9
- import type { CommunicationIngestionInput, ClinicalBundleSearchInput, DigitalTwinGenerationInput, GrantProfessionalAccessInput, GrantProfessionalAccessResult, IndividualMemberLifecycleInput, IndividualOrganizationLifecycleInput, IpsOrFhirImportInput, OrganizationEmployeeCreationInput, OrganizationEmployeeLifecycleInput, RelatedPersonUpsertInput } from '../resource-operations.js';
15
+ import type { CommunicationIngestionInput, ClinicalBundleSearchInput, DigitalTwinGenerationInput, GrantProfessionalAccessInput, GrantProfessionalAccessResult, IndividualMemberLifecycleInput, IndividualOrganizationLifecycleInput, IpsOrFhirImportInput, OrganizationEmployeeCreationInput, OrganizationEmployeeLifecycleInput, RelatedPersonUpsertInput, RelatedProfileSearchRuntimeInput } from '../resource-operations.js';
10
16
  /**
11
17
  * Shared node-runtime activation input.
12
18
  *
@@ -49,6 +55,7 @@ export type RuntimeClient = {
49
55
  bootstrapIndividualOrganization?: (input: IndividualOrganizationBootstrapInput) => Promise<IndividualOrganizationStartResult>;
50
56
  importIpsOrFhirAndUpdateIndex?: (ctx: RouteContext, input: IpsOrFhirImportInput) => Promise<SubmitAndPollResult>;
51
57
  upsertRelatedPersonAndPoll?: (ctx: RouteContext, input: RelatedPersonUpsertInput) => Promise<SubmitAndPollResult>;
58
+ searchRelatedProfiles?: (ctx: RouteContext, input: RelatedProfileSearchRuntimeInput) => Promise<SubmitAndPollResult>;
52
59
  generateDigitalTwinFromSubjectData?: (ctx: RouteContext, input: DigitalTwinGenerationInput) => Promise<SubmitAndPollResult>;
53
60
  searchClinicalBundle?: (ctx: RouteContext, input: ClinicalBundleSearchInput) => Promise<SubmitAndPollResult>;
54
61
  submitBatch?: (submitPath: string, payload: SubmitPayload) => Promise<SubmitResponse>;
@@ -1,4 +1,11 @@
1
- import type { BundleSearchQuery, CommunicationInput, DateRange } from 'gdc-sdk-core-ts';
1
+ /**
2
+ * @fileoverview Runtime helpers for GW resource submit/poll operations.
3
+ *
4
+ * @architecture 101
5
+ * - Keep request-payload construction centralized here.
6
+ * - Reuse shared DTO/parameter constants instead of repeating string literals.
7
+ */
8
+ import type { BundleSearchQuery, CommunicationInput, DateRange, RelatedProfileSearchInput } from 'gdc-sdk-core-ts';
2
9
  import type { SubmitAndPollResult } from './orchestration/client-port.js';
3
10
  import type { RouteContext } from './individual-onboarding.js';
4
11
  export type OrganizationEmployeeCreationInput = {
@@ -97,6 +104,13 @@ export type RelatedPersonUpsertInput = {
97
104
  intervalMs?: number;
98
105
  };
99
106
  };
107
+ export type RelatedProfileSearchRuntimeInput = RelatedProfileSearchInput & {
108
+ requestThid?: string;
109
+ pollOptions?: {
110
+ timeoutMs?: number;
111
+ intervalMs?: number;
112
+ };
113
+ };
100
114
  export type CommunicationIngestionInput = {
101
115
  communicationPayload: CommunicationInput & Record<string, unknown>;
102
116
  pathFormatSegment?: 'org.hl7.fhir.api' | 'org.hl7.fhir.r4' | 'api' | 'r4' | 'fhir.r4';
@@ -275,6 +289,16 @@ export declare function upsertRelatedPersonAndPollWithDeps(routeCtx: RouteContex
275
289
  intervalMs?: number;
276
290
  }) => Promise<SubmitAndPollResult>;
277
291
  }): Promise<SubmitAndPollResult>;
292
+ export declare function searchRelatedProfilesWithDeps(routeCtx: RouteContext, input: RelatedProfileSearchRuntimeInput, deps: {
293
+ individualRelatedPersonSearchPath: (ctx: RouteContext) => string;
294
+ individualRelatedPersonSearchPollPath: (ctx: RouteContext) => string;
295
+ submitAndPoll: (submitPath: string, pollPath: string, payload: {
296
+ thid?: string;
297
+ } & Record<string, unknown>, pollOptions?: {
298
+ timeoutMs?: number;
299
+ intervalMs?: number;
300
+ }) => Promise<SubmitAndPollResult>;
301
+ }): Promise<SubmitAndPollResult>;
278
302
  export declare function ingestCommunicationAndUpdateIndexWithDeps(routeCtx: RouteContext, input: CommunicationIngestionInput, deps: {
279
303
  individualCommunicationBatchPath: (ctx: RouteContext, pathFormatSegment: 'org.hl7.fhir.api' | 'org.hl7.fhir.r4') => string;
280
304
  individualCommunicationPollPath: (ctx: RouteContext, pathFormatSegment: 'org.hl7.fhir.api' | 'org.hl7.fhir.r4') => string;
@@ -1,5 +1,13 @@
1
1
  // Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
2
+ /**
3
+ * @fileoverview Runtime helpers for GW resource submit/poll operations.
4
+ *
5
+ * @architecture 101
6
+ * - Keep request-payload construction centralized here.
7
+ * - Reuse shared DTO/parameter constants instead of repeating string literals.
8
+ */
2
9
  import { HealthcareBasicSections } from 'gdc-common-utils-ts/constants';
10
+ import { RELATED_PROFILE_SEARCH_PARAM_ACTOR_IDENTIFIER, RELATED_PROFILE_SEARCH_PARAM_INCLUDE_INACTIVE, RELATED_PROFILE_SEARCH_PARAM_RELATIONSHIP, RELATED_PROFILE_SEARCH_PARAM_SUBJECT_ID, } from 'gdc-sdk-core-ts';
3
11
  import { GwCoreLifecycleRequestMethod, GwCoreLifecycleRequestType, GwCoreLifecycleTodo, } from './constants/lifecycle.js';
4
12
  export async function createOrganizationEmployeeWithDeps(routeCtx, input, options, deps) {
5
13
  const payload = buildEmployeeLifecyclePayload({
@@ -79,6 +87,21 @@ export async function upsertRelatedPersonAndPollWithDeps(routeCtx, input, deps)
79
87
  };
80
88
  return deps.submitAndPoll(deps.individualRelatedPersonBatchPath(routeCtx), deps.individualRelatedPersonPollPath(routeCtx), payload, input.pollOptions);
81
89
  }
90
+ export async function searchRelatedProfilesWithDeps(routeCtx, input, deps) {
91
+ const payload = {
92
+ thid: input.requestThid || `relatedprofile-search-${createRuntimeUuid()}`,
93
+ body: {
94
+ resourceType: 'Parameters',
95
+ parameter: [
96
+ { name: RELATED_PROFILE_SEARCH_PARAM_ACTOR_IDENTIFIER, valueString: input.actorIdentifier },
97
+ ...(input.subjectId ? [{ name: RELATED_PROFILE_SEARCH_PARAM_SUBJECT_ID, valueString: input.subjectId }] : []),
98
+ ...(input.relationship ? [{ name: RELATED_PROFILE_SEARCH_PARAM_RELATIONSHIP, valueString: input.relationship }] : []),
99
+ ...(input.includeInactive === true ? [{ name: RELATED_PROFILE_SEARCH_PARAM_INCLUDE_INACTIVE, valueBoolean: true }] : []),
100
+ ],
101
+ },
102
+ };
103
+ return deps.submitAndPoll(deps.individualRelatedPersonSearchPath(routeCtx), deps.individualRelatedPersonSearchPollPath(routeCtx), payload, input.pollOptions);
104
+ }
82
105
  export async function ingestCommunicationAndUpdateIndexWithDeps(routeCtx, input, deps) {
83
106
  const payload = {
84
107
  thid: input.communicationPayload.thid || `communication-${createRuntimeUuid()}`,
@@ -0,0 +1,51 @@
1
+ import type { NodeSdkCommunicationIdentityBootstrapResult } from './identity-bootstrap.js';
2
+ export type SoftwareRuntimeCredentialInput = {
3
+ /**
4
+ * Public DID of the portal/backend/software runtime profile.
5
+ */
6
+ softwareDid: string;
7
+ /**
8
+ * Technical communication identity previously created with
9
+ * `initializeCommunicationIdentity(...)`.
10
+ */
11
+ deviceIdentity: NodeSdkCommunicationIdentityBootstrapResult;
12
+ /**
13
+ * Optional VC identifier.
14
+ */
15
+ credentialId?: string;
16
+ /**
17
+ * Optional ICA issuer DID placeholder for examples/tests.
18
+ */
19
+ issuerDid?: string;
20
+ /**
21
+ * Optional human-readable software/application name.
22
+ */
23
+ softwareName?: string;
24
+ /**
25
+ * Optional issuance timestamp.
26
+ */
27
+ issuanceDate?: string;
28
+ /**
29
+ * Optional extra `credentialSubject` claims for profile-specific examples.
30
+ */
31
+ additionalCredentialSubject?: Record<string, unknown>;
32
+ };
33
+ export type SoftwareRuntimeCredential = {
34
+ '@context': string[];
35
+ type: string[];
36
+ id?: string;
37
+ issuer?: string;
38
+ issuanceDate?: string;
39
+ credentialSubject: Record<string, unknown>;
40
+ };
41
+ /**
42
+ * Builds a copy/paste-friendly VC example for an ICA-authorized software or
43
+ * runtime profile. The key binding is taken from the technical communication
44
+ * signing key generated by `initializeCommunicationIdentity(...)`.
45
+ *
46
+ * This helper is intentionally example-oriented. It wires the runtime
47
+ * communication `kid` into `credentialSubject.material` so SDK docs and tests
48
+ * can express the intended future ICA contract without hand-shaping the object
49
+ * inline every time.
50
+ */
51
+ export declare function buildSoftwareRuntimeCredential(input: SoftwareRuntimeCredentialInput): SoftwareRuntimeCredential;
@@ -0,0 +1,34 @@
1
+ // Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
2
+ /**
3
+ * Builds a copy/paste-friendly VC example for an ICA-authorized software or
4
+ * runtime profile. The key binding is taken from the technical communication
5
+ * signing key generated by `initializeCommunicationIdentity(...)`.
6
+ *
7
+ * This helper is intentionally example-oriented. It wires the runtime
8
+ * communication `kid` into `credentialSubject.material` so SDK docs and tests
9
+ * can express the intended future ICA contract without hand-shaping the object
10
+ * inline every time.
11
+ */
12
+ export function buildSoftwareRuntimeCredential(input) {
13
+ const communicationKid = String(input.deviceIdentity.commSigningKeyPair.publicJWKey.kid || '').trim();
14
+ if (!communicationKid) {
15
+ throw new Error('buildSoftwareRuntimeCredential requires deviceIdentity.commSigningKeyPair.publicJWKey.kid.');
16
+ }
17
+ const softwareDid = String(input.softwareDid || '').trim();
18
+ if (!softwareDid) {
19
+ throw new Error('buildSoftwareRuntimeCredential requires softwareDid.');
20
+ }
21
+ return {
22
+ '@context': ['https://www.w3.org/2018/credentials/v1', 'https://schema.org'],
23
+ type: ['VerifiableCredential', 'SoftwareApplicationCredential'],
24
+ ...(input.credentialId ? { id: input.credentialId } : {}),
25
+ ...(input.issuerDid ? { issuer: input.issuerDid } : {}),
26
+ ...(input.issuanceDate ? { issuanceDate: input.issuanceDate } : {}),
27
+ credentialSubject: {
28
+ id: softwareDid,
29
+ material: communicationKid,
30
+ ...(input.softwareName ? { name: input.softwareName } : {}),
31
+ ...(input.additionalCredentialSubject || {}),
32
+ },
33
+ };
34
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gdc-sdk-node-ts",
3
- "version": "0.4.0",
3
+ "version": "0.5.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.8.0",
21
- "gdc-sdk-core-ts": "^0.4.0"
20
+ "gdc-common-utils-ts": "^1.10.0",
21
+ "gdc-sdk-core-ts": "^0.5.1"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@types/node": "^20.14.10",