gdc-sdk-node-ts 0.9.1 → 2.0.2

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 (39) hide show
  1. package/README.md +153 -2
  2. package/dist/backend-profile-runtime.d.ts +214 -0
  3. package/dist/backend-profile-runtime.js +436 -0
  4. package/dist/consent-claim-helpers.d.ts +2 -1
  5. package/dist/constants/lifecycle.d.ts +1 -0
  6. package/dist/constants/lifecycle.js +2 -0
  7. package/dist/gdc-session-bridge.js +6 -2
  8. package/dist/host-onboarding.d.ts +6 -39
  9. package/dist/host-onboarding.js +8 -38
  10. package/dist/index.d.ts +5 -0
  11. package/dist/index.js +5 -0
  12. package/dist/individual-controller-backend-runtime.d.ts +46 -0
  13. package/dist/individual-controller-backend-runtime.js +53 -0
  14. package/dist/individual-onboarding.d.ts +1 -0
  15. package/dist/individual-onboarding.js +1 -0
  16. package/dist/individual-start.d.ts +1 -10
  17. package/dist/legacy-compat.d.ts +2 -0
  18. package/dist/legacy-compat.js +1 -0
  19. package/dist/node-runtime-client.d.ts +141 -10
  20. package/dist/node-runtime-client.js +337 -26
  21. package/dist/orchestration/client-port.d.ts +46 -2
  22. package/dist/orchestration/host-onboarding-sdk.d.ts +16 -4
  23. package/dist/orchestration/host-onboarding-sdk.js +22 -1
  24. package/dist/orchestration/individual-controller-sdk.d.ts +41 -1
  25. package/dist/orchestration/individual-controller-sdk.js +58 -0
  26. package/dist/orchestration/organization-controller-sdk.d.ts +79 -2
  27. package/dist/orchestration/organization-controller-sdk.js +101 -0
  28. package/dist/orchestration/personal-sdk.d.ts +19 -1
  29. package/dist/orchestration/personal-sdk.js +36 -0
  30. package/dist/orchestration/professional-sdk.d.ts +6 -1
  31. package/dist/orchestration/professional-sdk.js +7 -0
  32. package/dist/order-offer-summary.d.ts +6 -0
  33. package/dist/order-offer-summary.js +11 -0
  34. package/dist/organization-license-order.d.ts +40 -0
  35. package/dist/organization-license-order.js +42 -0
  36. package/dist/resource-operations.d.ts +204 -1
  37. package/dist/resource-operations.js +213 -14
  38. package/dist/session.js +1 -1
  39. package/package.json +17 -4
@@ -1,3 +1,6 @@
1
+ import { IndividualOrganizationLifecycleEditor } from 'gdc-common-utils-ts';
2
+ import type { LicenseOfferSearchState, LicenseOrderSearchState } from 'gdc-common-utils-ts/utils/license-commercial-search';
3
+ import type { LicenseListSearchState } from 'gdc-common-utils-ts/utils/license-list-search';
1
4
  import type { BundleSearchQuery, CommunicationInput, DateRange, EmployeeSearchValue } from 'gdc-sdk-core-ts';
2
5
  import type { SubmitAndPollResult } from './orchestration/client-port.js';
3
6
  import type { RouteContext } from './individual-onboarding.js';
@@ -59,6 +62,43 @@ export type OrganizationEmployeeSearchInput = {
59
62
  intervalMs?: number;
60
63
  };
61
64
  };
65
+ /**
66
+ * Runtime search/list input for license seats exposed through actor facades.
67
+ *
68
+ * The semantic filter set comes from the shared license controller facade.
69
+ */
70
+ export type LicenseListRuntimeSearchInput = {
71
+ licenseQuery?: Partial<LicenseListSearchState>;
72
+ requestThid?: string;
73
+ pollOptions?: {
74
+ timeoutMs?: number;
75
+ intervalMs?: number;
76
+ };
77
+ };
78
+ /**
79
+ * Runtime search/list input for commercial offer read-models exposed through
80
+ * actor facades.
81
+ */
82
+ export type LicenseOfferRuntimeSearchInput = {
83
+ offerQuery?: Partial<LicenseOfferSearchState>;
84
+ requestThid?: string;
85
+ pollOptions?: {
86
+ timeoutMs?: number;
87
+ intervalMs?: number;
88
+ };
89
+ };
90
+ /**
91
+ * Runtime search/list input for commercial order/payment read-models exposed
92
+ * through actor facades.
93
+ */
94
+ export type LicenseOrderRuntimeSearchInput = {
95
+ orderQuery?: Partial<LicenseOrderSearchState>;
96
+ requestThid?: string;
97
+ pollOptions?: {
98
+ timeoutMs?: number;
99
+ intervalMs?: number;
100
+ };
101
+ };
62
102
  /**
63
103
  * Current GW CORE individual/family lifecycle locator payload.
64
104
  *
@@ -71,7 +111,12 @@ export type IndividualOrganizationLifecycleInput = {
71
111
  * Canonical claims used by GW CORE to locate the hosted individual/family
72
112
  * registration.
73
113
  */
74
- organizationClaims: Record<string, unknown>;
114
+ organizationClaims?: Record<string, unknown>;
115
+ /**
116
+ * Preferred high-level shared editor for lifecycle callers that want to
117
+ * avoid assembling raw claims inline.
118
+ */
119
+ organizationEditor?: IndividualOrganizationLifecycleEditor;
75
120
  /**
76
121
  * Optional canonical resource id when already known by the caller.
77
122
  */
@@ -122,6 +167,39 @@ export type CommunicationIngestionInput = {
122
167
  intervalMs?: number;
123
168
  };
124
169
  };
170
+ /**
171
+ * Runtime participant query for `Communication/_search`.
172
+ *
173
+ * Search semantics:
174
+ * - `subject` scopes which individual communication sections to inspect
175
+ * - `userActorId` and `targetActorId` both match sender OR any recipient
176
+ * - `senderActorId` and `recipientActorId` constrain one side explicitly
177
+ * - `actorId` is the generic sender-or-recipient filter
178
+ * - `*` means "all" for the corresponding operand
179
+ *
180
+ * Canonical prefixes are normalized by shared `gdc-common-utils-ts` helpers:
181
+ * - `did:`
182
+ * - `email:` / `mailto:`
183
+ * - `tel:` / `phone:`
184
+ */
185
+ export type CommunicationParticipantRuntimeSearchInput = {
186
+ searchParams?: Record<string, string | number | boolean | Array<string | number | boolean> | undefined>;
187
+ subject?: string | string[];
188
+ actorId?: string | string[];
189
+ senderActorId?: string | string[];
190
+ recipientActorId?: string | string[];
191
+ userActorId?: string | string[];
192
+ targetActorId?: string | string[];
193
+ periodStart?: string;
194
+ periodEnd?: string;
195
+ requestThid?: string;
196
+ pollOptions?: {
197
+ timeoutMs?: number;
198
+ intervalMs?: number;
199
+ };
200
+ page?: number;
201
+ count?: number;
202
+ };
125
203
  export type ClinicalDateRange = DateRange;
126
204
  export type ClinicalBundleSearchInput = Omit<BundleSearchQuery, 'section' | 'searchParams'> & {
127
205
  section?: string | string[];
@@ -255,6 +333,54 @@ export declare function searchOrganizationEmployeesWithDeps(routeCtx: RouteConte
255
333
  intervalMs?: number;
256
334
  }) => Promise<SubmitAndPollResult>;
257
335
  }): Promise<SubmitAndPollResult>;
336
+ /**
337
+ * Searches license seats for one organization/tenant through `License/_search`.
338
+ */
339
+ export declare function searchOrganizationLicensesWithDeps(routeCtx: RouteContext, input: LicenseListRuntimeSearchInput, deps: {
340
+ organizationLicenseSearchPath: (ctx: RouteContext) => string;
341
+ organizationLicenseSearchPollPath: (ctx: RouteContext) => string;
342
+ submitAndPoll: (submitPath: string, pollPath: string, payload: {
343
+ thid?: string;
344
+ } & Record<string, unknown>, pollOptions?: {
345
+ timeoutMs?: number;
346
+ intervalMs?: number;
347
+ }) => Promise<SubmitAndPollResult>;
348
+ }): Promise<SubmitAndPollResult>;
349
+ /**
350
+ * Lists license seats using the same canonical `License/_search` route with no
351
+ * mandatory filters.
352
+ */
353
+ export declare function listOrganizationLicensesWithDeps(routeCtx: RouteContext, input: LicenseListRuntimeSearchInput | undefined, deps: Parameters<typeof searchOrganizationLicensesWithDeps>[2]): Promise<SubmitAndPollResult>;
354
+ /**
355
+ * Searches commercial license offers for one organization/tenant through
356
+ * `Offer/_search`.
357
+ */
358
+ export declare function searchOrganizationLicenseOffersWithDeps(routeCtx: RouteContext, input: LicenseOfferRuntimeSearchInput, deps: {
359
+ organizationLicenseOfferSearchPath: (ctx: RouteContext) => string;
360
+ organizationLicenseOfferSearchPollPath: (ctx: RouteContext) => string;
361
+ submitAndPoll: (submitPath: string, pollPath: string, payload: {
362
+ thid?: string;
363
+ } & Record<string, unknown>, pollOptions?: {
364
+ timeoutMs?: number;
365
+ intervalMs?: number;
366
+ }) => Promise<SubmitAndPollResult>;
367
+ }): Promise<SubmitAndPollResult>;
368
+ export declare function listOrganizationLicenseOffersWithDeps(routeCtx: RouteContext, input: LicenseOfferRuntimeSearchInput | undefined, deps: Parameters<typeof searchOrganizationLicenseOffersWithDeps>[2]): Promise<SubmitAndPollResult>;
369
+ /**
370
+ * Searches commercial license orders/payment projections for one
371
+ * organization/tenant through `Order/_search`.
372
+ */
373
+ export declare function searchOrganizationLicenseOrdersWithDeps(routeCtx: RouteContext, input: LicenseOrderRuntimeSearchInput, deps: {
374
+ organizationLicenseOrderSearchPath: (ctx: RouteContext) => string;
375
+ organizationLicenseOrderSearchPollPath: (ctx: RouteContext) => string;
376
+ submitAndPoll: (submitPath: string, pollPath: string, payload: {
377
+ thid?: string;
378
+ } & Record<string, unknown>, pollOptions?: {
379
+ timeoutMs?: number;
380
+ intervalMs?: number;
381
+ }) => Promise<SubmitAndPollResult>;
382
+ }): Promise<SubmitAndPollResult>;
383
+ export declare function listOrganizationLicenseOrdersWithDeps(routeCtx: RouteContext, input: LicenseOrderRuntimeSearchInput | undefined, deps: Parameters<typeof searchOrganizationLicenseOrdersWithDeps>[2]): Promise<SubmitAndPollResult>;
258
384
  export declare function disableIndividualOrganizationWithDeps(routeCtx: RouteContext, input: IndividualOrganizationLifecycleInput, options: {
259
385
  timeoutMs?: number;
260
386
  intervalMs?: number;
@@ -281,6 +407,47 @@ export declare function purgeIndividualOrganizationWithDeps(routeCtx: RouteConte
281
407
  intervalMs?: number;
282
408
  }) => Promise<SubmitAndPollResult>;
283
409
  }): Promise<SubmitAndPollResult>;
410
+ /**
411
+ * Searches license seats for one individual/family controller context through
412
+ * the shared `License/_search` route.
413
+ */
414
+ export declare function searchIndividualLicensesWithDeps(routeCtx: RouteContext, input: LicenseListRuntimeSearchInput, deps: {
415
+ individualLicenseSearchPath: (ctx: RouteContext) => string;
416
+ individualLicenseSearchPollPath: (ctx: RouteContext) => string;
417
+ submitAndPoll: (submitPath: string, pollPath: string, payload: {
418
+ thid?: string;
419
+ } & Record<string, unknown>, pollOptions?: {
420
+ timeoutMs?: number;
421
+ intervalMs?: number;
422
+ }) => Promise<SubmitAndPollResult>;
423
+ }): Promise<SubmitAndPollResult>;
424
+ /**
425
+ * Lists license seats for the individual/family side using the same canonical
426
+ * search route without mandatory filters.
427
+ */
428
+ export declare function listIndividualLicensesWithDeps(routeCtx: RouteContext, input: LicenseListRuntimeSearchInput | undefined, deps: Parameters<typeof searchIndividualLicensesWithDeps>[2]): Promise<SubmitAndPollResult>;
429
+ export declare function searchIndividualLicenseOffersWithDeps(routeCtx: RouteContext, input: LicenseOfferRuntimeSearchInput, deps: {
430
+ individualLicenseOfferSearchPath: (ctx: RouteContext) => string;
431
+ individualLicenseOfferSearchPollPath: (ctx: RouteContext) => string;
432
+ submitAndPoll: (submitPath: string, pollPath: string, payload: {
433
+ thid?: string;
434
+ } & Record<string, unknown>, pollOptions?: {
435
+ timeoutMs?: number;
436
+ intervalMs?: number;
437
+ }) => Promise<SubmitAndPollResult>;
438
+ }): Promise<SubmitAndPollResult>;
439
+ export declare function listIndividualLicenseOffersWithDeps(routeCtx: RouteContext, input: LicenseOfferRuntimeSearchInput | undefined, deps: Parameters<typeof searchIndividualLicenseOffersWithDeps>[2]): Promise<SubmitAndPollResult>;
440
+ export declare function searchIndividualLicenseOrdersWithDeps(routeCtx: RouteContext, input: LicenseOrderRuntimeSearchInput, deps: {
441
+ individualLicenseOrderSearchPath: (ctx: RouteContext) => string;
442
+ individualLicenseOrderSearchPollPath: (ctx: RouteContext) => string;
443
+ submitAndPoll: (submitPath: string, pollPath: string, payload: {
444
+ thid?: string;
445
+ } & Record<string, unknown>, pollOptions?: {
446
+ timeoutMs?: number;
447
+ intervalMs?: number;
448
+ }) => Promise<SubmitAndPollResult>;
449
+ }): Promise<SubmitAndPollResult>;
450
+ export declare function listIndividualLicenseOrdersWithDeps(routeCtx: RouteContext, input: LicenseOrderRuntimeSearchInput | undefined, deps: Parameters<typeof searchIndividualLicenseOrdersWithDeps>[2]): Promise<SubmitAndPollResult>;
284
451
  export declare function importIpsOrFhirAndUpdateIndexWithDeps(routeCtx: RouteContext, input: IpsOrFhirImportInput, deps: {
285
452
  individualCompositionR4BatchPath: (ctx: RouteContext) => string;
286
453
  individualCompositionR4PollPath: (ctx: RouteContext) => string;
@@ -291,6 +458,32 @@ export declare function importIpsOrFhirAndUpdateIndexWithDeps(routeCtx: RouteCon
291
458
  intervalMs?: number;
292
459
  }) => Promise<SubmitAndPollResult>;
293
460
  }): Promise<SubmitAndPollResult>;
461
+ export declare function disableIndividualMemberWithDeps(routeCtx: RouteContext, input: IndividualMemberLifecycleInput, options: {
462
+ timeoutMs?: number;
463
+ intervalMs?: number;
464
+ } | undefined, deps: {
465
+ individualRelatedPersonBatchPath: (ctx: RouteContext) => string;
466
+ individualRelatedPersonPollPath: (ctx: RouteContext) => string;
467
+ submitAndPoll: (submitPath: string, pollPath: string, payload: {
468
+ thid?: string;
469
+ } & Record<string, unknown>, pollOptions?: {
470
+ timeoutMs?: number;
471
+ intervalMs?: number;
472
+ }) => Promise<SubmitAndPollResult>;
473
+ }): Promise<SubmitAndPollResult>;
474
+ export declare function purgeIndividualMemberWithDeps(routeCtx: RouteContext, input: IndividualMemberLifecycleInput, options: {
475
+ timeoutMs?: number;
476
+ intervalMs?: number;
477
+ } | undefined, deps: {
478
+ individualRelatedPersonPurgePath: (ctx: RouteContext) => string;
479
+ individualRelatedPersonPurgePollPath: (ctx: RouteContext) => string;
480
+ submitAndPoll: (submitPath: string, pollPath: string, payload: {
481
+ thid?: string;
482
+ } & Record<string, unknown>, pollOptions?: {
483
+ timeoutMs?: number;
484
+ intervalMs?: number;
485
+ }) => Promise<SubmitAndPollResult>;
486
+ }): Promise<SubmitAndPollResult>;
294
487
  export declare function upsertRelatedPersonAndPollWithDeps(routeCtx: RouteContext, input: RelatedPersonUpsertInput, deps: {
295
488
  individualRelatedPersonBatchPath: (ctx: RouteContext) => string;
296
489
  individualRelatedPersonPollPath: (ctx: RouteContext) => string;
@@ -312,6 +505,16 @@ export declare function ingestCommunicationAndUpdateIndexWithDeps(routeCtx: Rout
312
505
  intervalMs?: number;
313
506
  }) => Promise<SubmitAndPollResult>;
314
507
  }): Promise<SubmitAndPollResult>;
508
+ export declare function searchCommunicationParticipantsWithDeps(routeCtx: RouteContext, input: CommunicationParticipantRuntimeSearchInput, deps: {
509
+ communicationSearchPath: (ctx: RouteContext) => string;
510
+ communicationSearchPollPath: (ctx: RouteContext) => string;
511
+ submitAndPoll: (submitPath: string, pollPath: string, payload: {
512
+ thid?: string;
513
+ } & Record<string, unknown>, pollOptions?: {
514
+ timeoutMs?: number;
515
+ intervalMs?: number;
516
+ }) => Promise<SubmitAndPollResult>;
517
+ }): Promise<SubmitAndPollResult>;
315
518
  export declare function searchClinicalBundleWithDeps(routeCtx: RouteContext, input: ClinicalBundleSearchInput, deps: {
316
519
  bundleSearchPath: (ctx: RouteContext) => string;
317
520
  bundleSearchPollPath: (ctx: RouteContext) => string;
@@ -1,5 +1,8 @@
1
1
  // Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
2
- import { HealthcareBasicSections } from 'gdc-common-utils-ts/constants';
2
+ import { HealthcareBasicSections, ResourceTypesFhirR4 } from 'gdc-common-utils-ts/constants';
3
+ import { Format } from 'gdc-common-utils-ts/constants/Schemas';
4
+ import { RelatedPersonClaim } from 'gdc-common-utils-ts/models/interoperable-claims/related-person-claims';
5
+ import { buildCommunicationParticipantSearchBundle, createInteroperableResourceOperationEditor, IndividualOrganizationLifecycleEditor, LicenseOfferSearchEditor, LicenseOrderSearchEditor, InteroperableLifecycleStatuses, LicenseListSearchEditor, } from 'gdc-common-utils-ts';
3
6
  import { GwCoreLifecycleRequestMethod, GwCoreLifecycleRequestType, GwCoreLifecycleTodo, } from './constants/lifecycle.js';
4
7
  import { buildEmployeeBatchEntry, buildEmployeeSearchBundle, } from 'gdc-sdk-core-ts';
5
8
  export async function createOrganizationEmployeeWithDeps(routeCtx, input, options, deps) {
@@ -43,6 +46,69 @@ export async function searchOrganizationEmployeesWithDeps(routeCtx, input, deps)
43
46
  body: buildEmployeeSearchBundle({ claims: input.employeeClaims }),
44
47
  }, input.pollOptions);
45
48
  }
49
+ /**
50
+ * Searches license seats for one organization/tenant through `License/_search`.
51
+ */
52
+ export async function searchOrganizationLicensesWithDeps(routeCtx, input, deps) {
53
+ return deps.submitAndPoll(deps.organizationLicenseSearchPath(routeCtx), deps.organizationLicenseSearchPollPath(routeCtx), {
54
+ thid: input.requestThid || `organization-license-search-${createRuntimeUuid()}`,
55
+ body: {
56
+ resourceType: 'Bundle',
57
+ type: 'batch',
58
+ entry: [
59
+ new LicenseListSearchEditor(input.licenseQuery || {})
60
+ .buildSearchEntry(),
61
+ ],
62
+ },
63
+ }, input.pollOptions);
64
+ }
65
+ /**
66
+ * Lists license seats using the same canonical `License/_search` route with no
67
+ * mandatory filters.
68
+ */
69
+ export async function listOrganizationLicensesWithDeps(routeCtx, input, deps) {
70
+ return searchOrganizationLicensesWithDeps(routeCtx, input || {}, deps);
71
+ }
72
+ /**
73
+ * Searches commercial license offers for one organization/tenant through
74
+ * `Offer/_search`.
75
+ */
76
+ export async function searchOrganizationLicenseOffersWithDeps(routeCtx, input, deps) {
77
+ return deps.submitAndPoll(deps.organizationLicenseOfferSearchPath(routeCtx), deps.organizationLicenseOfferSearchPollPath(routeCtx), {
78
+ thid: input.requestThid || `organization-license-offer-search-${createRuntimeUuid()}`,
79
+ body: {
80
+ resourceType: 'Bundle',
81
+ type: 'batch',
82
+ data: [
83
+ new LicenseOfferSearchEditor(input.offerQuery || {})
84
+ .buildSearchEntry(),
85
+ ],
86
+ },
87
+ }, input.pollOptions);
88
+ }
89
+ export async function listOrganizationLicenseOffersWithDeps(routeCtx, input, deps) {
90
+ return searchOrganizationLicenseOffersWithDeps(routeCtx, input || {}, deps);
91
+ }
92
+ /**
93
+ * Searches commercial license orders/payment projections for one
94
+ * organization/tenant through `Order/_search`.
95
+ */
96
+ export async function searchOrganizationLicenseOrdersWithDeps(routeCtx, input, deps) {
97
+ return deps.submitAndPoll(deps.organizationLicenseOrderSearchPath(routeCtx), deps.organizationLicenseOrderSearchPollPath(routeCtx), {
98
+ thid: input.requestThid || `organization-license-order-search-${createRuntimeUuid()}`,
99
+ body: {
100
+ resourceType: 'Bundle',
101
+ type: 'batch',
102
+ data: [
103
+ new LicenseOrderSearchEditor(input.orderQuery || {})
104
+ .buildSearchEntry(),
105
+ ],
106
+ },
107
+ }, input.pollOptions);
108
+ }
109
+ export async function listOrganizationLicenseOrdersWithDeps(routeCtx, input, deps) {
110
+ return searchOrganizationLicenseOrdersWithDeps(routeCtx, input || {}, deps);
111
+ }
46
112
  export async function disableIndividualOrganizationWithDeps(routeCtx, input, options, deps) {
47
113
  // TODO(gw-core-lifecycle-target-patch-individual-disable): migrate from
48
114
  // explicit `_disable` to `_batch + PATCH` only after GW CORE supports it.
@@ -51,6 +117,7 @@ export async function disableIndividualOrganizationWithDeps(routeCtx, input, opt
51
117
  routeCtx,
52
118
  requestType: input.dataType || GwCoreLifecycleRequestType.IndividualOrganizationDisable,
53
119
  organizationClaims: input.organizationClaims,
120
+ organizationEditor: input.organizationEditor,
54
121
  resourceId: input.resourceId,
55
122
  thidPrefix: 'individual-organization-disable',
56
123
  });
@@ -61,11 +128,68 @@ export async function purgeIndividualOrganizationWithDeps(routeCtx, input, optio
61
128
  routeCtx,
62
129
  requestType: input.dataType || GwCoreLifecycleRequestType.IndividualOrganizationPurge,
63
130
  organizationClaims: input.organizationClaims,
131
+ organizationEditor: input.organizationEditor,
64
132
  resourceId: input.resourceId,
65
133
  thidPrefix: 'individual-organization-purge',
66
134
  });
67
135
  return deps.submitAndPoll(deps.individualOrganizationPurgePath(routeCtx), deps.individualOrganizationPurgePollPath(routeCtx), payload, options);
68
136
  }
137
+ /**
138
+ * Searches license seats for one individual/family controller context through
139
+ * the shared `License/_search` route.
140
+ */
141
+ export async function searchIndividualLicensesWithDeps(routeCtx, input, deps) {
142
+ return deps.submitAndPoll(deps.individualLicenseSearchPath(routeCtx), deps.individualLicenseSearchPollPath(routeCtx), {
143
+ thid: input.requestThid || `individual-license-search-${createRuntimeUuid()}`,
144
+ body: {
145
+ resourceType: 'Bundle',
146
+ type: 'batch',
147
+ entry: [
148
+ new LicenseListSearchEditor(input.licenseQuery || {})
149
+ .buildSearchEntry(),
150
+ ],
151
+ },
152
+ }, input.pollOptions);
153
+ }
154
+ /**
155
+ * Lists license seats for the individual/family side using the same canonical
156
+ * search route without mandatory filters.
157
+ */
158
+ export async function listIndividualLicensesWithDeps(routeCtx, input, deps) {
159
+ return searchIndividualLicensesWithDeps(routeCtx, input || {}, deps);
160
+ }
161
+ export async function searchIndividualLicenseOffersWithDeps(routeCtx, input, deps) {
162
+ return deps.submitAndPoll(deps.individualLicenseOfferSearchPath(routeCtx), deps.individualLicenseOfferSearchPollPath(routeCtx), {
163
+ thid: input.requestThid || `individual-license-offer-search-${createRuntimeUuid()}`,
164
+ body: {
165
+ resourceType: 'Bundle',
166
+ type: 'batch',
167
+ data: [
168
+ new LicenseOfferSearchEditor(input.offerQuery || {})
169
+ .buildSearchEntry(),
170
+ ],
171
+ },
172
+ }, input.pollOptions);
173
+ }
174
+ export async function listIndividualLicenseOffersWithDeps(routeCtx, input, deps) {
175
+ return searchIndividualLicenseOffersWithDeps(routeCtx, input || {}, deps);
176
+ }
177
+ export async function searchIndividualLicenseOrdersWithDeps(routeCtx, input, deps) {
178
+ return deps.submitAndPoll(deps.individualLicenseOrderSearchPath(routeCtx), deps.individualLicenseOrderSearchPollPath(routeCtx), {
179
+ thid: input.requestThid || `individual-license-order-search-${createRuntimeUuid()}`,
180
+ body: {
181
+ resourceType: 'Bundle',
182
+ type: 'batch',
183
+ data: [
184
+ new LicenseOrderSearchEditor(input.orderQuery || {})
185
+ .buildSearchEntry(),
186
+ ],
187
+ },
188
+ }, input.pollOptions);
189
+ }
190
+ export async function listIndividualLicenseOrdersWithDeps(routeCtx, input, deps) {
191
+ return searchIndividualLicenseOrdersWithDeps(routeCtx, input || {}, deps);
192
+ }
69
193
  export async function importIpsOrFhirAndUpdateIndexWithDeps(routeCtx, input, deps) {
70
194
  const payload = {
71
195
  thid: input.compositionPayload.thid || `composition-${createRuntimeUuid()}`,
@@ -79,6 +203,65 @@ export async function importIpsOrFhirAndUpdateIndexWithDeps(routeCtx, input, dep
79
203
  : deps.individualCompositionR4PollPath(routeCtx);
80
204
  return deps.submitAndPoll(submitPath, pollPath, payload, input.pollOptions);
81
205
  }
206
+ export async function disableIndividualMemberWithDeps(routeCtx, input, options, deps) {
207
+ const claims = {
208
+ '@context': String(input.memberClaims?.['@context'] || Format.FHIR_API).trim() || Format.FHIR_API,
209
+ ...(input.memberClaims || {}),
210
+ };
211
+ const resource = createInteroperableResourceOperationEditor()
212
+ .setResourceType(ResourceTypesFhirR4.RelatedPerson)
213
+ .setIdentifierClaimKey(RelatedPersonClaim.IdentifierValue)
214
+ .setBusinessIdentifier(String(claims[RelatedPersonClaim.IdentifierValue] || claims[RelatedPersonClaim.Identifier] || '').trim())
215
+ .setClaims(claims)
216
+ .setLifecycleStatus(InteroperableLifecycleStatuses.Inactive)
217
+ .buildLifecycleResource();
218
+ const payload = {
219
+ thid: `relatedperson-disable-${createRuntimeUuid()}`,
220
+ body: {
221
+ resourceType: 'Bundle',
222
+ type: 'batch',
223
+ entry: [{
224
+ request: { method: GwCoreLifecycleRequestMethod.Post },
225
+ meta: { claims },
226
+ resource: {
227
+ ...resource,
228
+ ...(input.resourceId ? { id: input.resourceId } : {}),
229
+ },
230
+ }],
231
+ },
232
+ };
233
+ return deps.submitAndPoll(deps.individualRelatedPersonBatchPath(routeCtx), deps.individualRelatedPersonPollPath(routeCtx), payload, options);
234
+ }
235
+ export async function purgeIndividualMemberWithDeps(routeCtx, input, options, deps) {
236
+ const claims = {
237
+ '@context': String(input.memberClaims?.['@context'] || Format.FHIR_API).trim() || Format.FHIR_API,
238
+ ...(input.memberClaims || {}),
239
+ };
240
+ const resource = createInteroperableResourceOperationEditor()
241
+ .setResourceType(ResourceTypesFhirR4.RelatedPerson)
242
+ .setIdentifierClaimKey(RelatedPersonClaim.IdentifierValue)
243
+ .setBusinessIdentifier(String(claims[RelatedPersonClaim.IdentifierValue] || claims[RelatedPersonClaim.Identifier] || '').trim())
244
+ .setClaims(claims)
245
+ .setLifecycleStatus(InteroperableLifecycleStatuses.Purged)
246
+ .buildLifecycleResource();
247
+ const payload = {
248
+ thid: `relatedperson-purge-${createRuntimeUuid()}`,
249
+ body: {
250
+ resourceType: 'Bundle',
251
+ type: 'batch',
252
+ entry: [{
253
+ type: input.dataType || GwCoreLifecycleRequestType.IndividualMemberPurge,
254
+ request: { method: GwCoreLifecycleRequestMethod.Post },
255
+ meta: { claims },
256
+ resource: {
257
+ ...resource,
258
+ ...(input.resourceId ? { id: input.resourceId } : {}),
259
+ },
260
+ }],
261
+ },
262
+ };
263
+ return deps.submitAndPoll(deps.individualRelatedPersonPurgePath(routeCtx), deps.individualRelatedPersonPurgePollPath(routeCtx), payload, options);
264
+ }
82
265
  export async function upsertRelatedPersonAndPollWithDeps(routeCtx, input, deps) {
83
266
  const payload = {
84
267
  thid: input.relatedPersonPayload.thid || `relatedperson-${createRuntimeUuid()}`,
@@ -99,6 +282,25 @@ export async function ingestCommunicationAndUpdateIndexWithDeps(routeCtx, input,
99
282
  : payload;
100
283
  return deps.submitAndPoll(deps.individualCommunicationBatchPath(routeCtx, pathFormatSegment), deps.individualCommunicationPollPath(routeCtx, pathFormatSegment), convertedPayload, input.pollOptions);
101
284
  }
285
+ export async function searchCommunicationParticipantsWithDeps(routeCtx, input, deps) {
286
+ const payload = {
287
+ thid: input.requestThid || `communication-search-${createRuntimeUuid()}`,
288
+ body: buildCommunicationParticipantSearchBundle({
289
+ searchParams: input.searchParams,
290
+ subject: input.subject,
291
+ actorId: input.actorId,
292
+ senderActorId: input.senderActorId,
293
+ recipientActorId: input.recipientActorId,
294
+ userActorId: input.userActorId,
295
+ targetActorId: input.targetActorId,
296
+ periodStart: input.periodStart,
297
+ periodEnd: input.periodEnd,
298
+ page: input.page,
299
+ count: input.count,
300
+ }),
301
+ };
302
+ return deps.submitAndPoll(deps.communicationSearchPath(routeCtx), deps.communicationSearchPollPath(routeCtx), payload, input.pollOptions);
303
+ }
102
304
  export async function searchClinicalBundleWithDeps(routeCtx, input, deps) {
103
305
  const query = buildBundleSearchQuery(input);
104
306
  const payload = {
@@ -203,24 +405,21 @@ function buildEmployeeLifecyclePayload(input) {
203
405
  };
204
406
  }
205
407
  function buildIndividualOrganizationLifecyclePayload(input) {
206
- const claims = input.organizationClaims || {};
408
+ const payload = input.organizationEditor
409
+ ? new IndividualOrganizationLifecycleEditor(input.organizationEditor.getState())
410
+ : new IndividualOrganizationLifecycleEditor().setClaims(input.organizationClaims || {});
411
+ payload
412
+ .setRequestType(input.requestType)
413
+ .setThreadId(`${input.thidPrefix}-${createRuntimeUuid()}`);
414
+ if (input.resourceId) {
415
+ payload.setResourceId(input.resourceId);
416
+ }
207
417
  return {
208
418
  jti: `jti-${createRuntimeUuid()}`,
209
419
  iss: input.routeCtx.tenantId,
210
420
  aud: input.routeCtx.tenantId,
211
421
  type: 'application/didcomm-plain+json',
212
- thid: `${input.thidPrefix}-${createRuntimeUuid()}`,
213
- body: {
214
- data: [{
215
- type: input.requestType,
216
- request: { method: GwCoreLifecycleRequestMethod.Post },
217
- meta: { claims },
218
- resource: {
219
- ...(input.resourceId ? { id: input.resourceId } : {}),
220
- meta: { claims },
221
- },
222
- }],
223
- },
422
+ ...payload.buildCurrentGwPayload(),
224
423
  };
225
424
  }
226
425
  function buildBundleSearchQuery(input) {
package/dist/session.js CHANGED
@@ -30,7 +30,7 @@ export class ActorSession {
30
30
  }
31
31
  asHostOnboarding() {
32
32
  this.assertActorKind(ActorKinds.HostOnboarding);
33
- return new HostOnboardingSdk(this.requireClient());
33
+ return new HostOnboardingSdk(this.requireClient(), this.capabilities);
34
34
  }
35
35
  asOrganizationController() {
36
36
  this.assertActorKind(ActorKinds.OrganizationController);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gdc-sdk-node-ts",
3
- "version": "0.9.1",
3
+ "version": "2.0.2",
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.",
@@ -13,12 +13,25 @@
13
13
  "scripts": {
14
14
  "build": "tsc -p tsconfig.json",
15
15
  "type-check": "tsc -p tsconfig.json --noEmit",
16
+ "local:close": "PORTS=3000 bash ./scripts/local-close.sh",
17
+ "docker:close": "PORTS=8000 bash ./scripts/local-close.sh",
16
18
  "test": "npm run build && node --test tests/*.test.mjs",
17
- "test:e2e:live-gw": "npm run build && RUN_LIVE_GW_E2E=1 node --test tests/live-gw-node-runtime.e2e.test.mjs"
19
+ "test:e2e:live-gw": "npm run build && RUN_LIVE_GW_E2E=1 node --test tests/live-gw-node-runtime.e2e.test.mjs",
20
+ "test:e2e:live-gw:professional": "npm run build && RUN_LIVE_GW_E2E=1 LIVE_GW_E2E_SUITE=professional node --test tests/live-gw-node-runtime.e2e.test.mjs",
21
+ "test:e2e:live-gw:individual": "npm run build && RUN_LIVE_GW_E2E=1 LIVE_GW_E2E_SUITE=individual node --test tests/live-gw-node-runtime.e2e.test.mjs",
22
+ "test:e2e:live-gw:clinical": "npm run build && RUN_LIVE_GW_E2E=1 LIVE_GW_E2E_SUITE=clinical node --test tests/live-gw-node-runtime.e2e.test.mjs",
23
+ "test:e2e:live-gw:didcomm-plain": "npm run build && RUN_LIVE_GW_E2E=1 LIVE_GW_E2E_TRANSPORT=didcomm-plain node --test tests/live-gw-node-runtime.e2e.test.mjs",
24
+ "test:e2e:live-gw:legacy-fhir": "npm run build && RUN_LIVE_GW_E2E=1 LIVE_GW_E2E_TRANSPORT=legacy-fhir node --test tests/live-gw-node-runtime.e2e.test.mjs",
25
+ "test:e2e:live-gw:all": "npm run build && RUN_LIVE_GW_E2E=1 LIVE_GW_E2E_TRANSPORT=all node --test tests/live-gw-node-runtime.e2e.test.mjs",
26
+ "test:e2e:live-gw:host-transaction:clean": "bash ./scripts/run-live-gw-host-transaction-clean.sh",
27
+ "test:e2e:live-profile-runtime:individual": "npm run build && RUN_LIVE_PROFILE_RUNTIME_E2E=1 node --test tests/live-profile-runtime-individual.e2e.test.mjs",
28
+ "test:e2e:live-profile-runtime:professional": "npm run build && RUN_LIVE_PROFILE_RUNTIME_PROFESSIONAL_E2E=1 node --test tests/live-profile-runtime-professional.e2e.test.mjs",
29
+ "test:e2e:live-dialogue:consent-professional": "npm run build && RUN_LIVE_DIALOGUE_CONSENT_PROFESSIONAL_E2E=1 node --test tests/live-dialogue-consent-professional-access.e2e.test.mjs",
30
+ "test:e2e:live-gw:clean": "bash ./scripts/run-live-gw-clean.sh"
18
31
  },
19
32
  "dependencies": {
20
- "gdc-common-utils-ts": "^1.20.1",
21
- "gdc-sdk-core-ts": "^0.9.1"
33
+ "gdc-common-utils-ts": "^2.0.4",
34
+ "gdc-sdk-core-ts": "^2.0.3"
22
35
  },
23
36
  "devDependencies": {
24
37
  "@types/node": "^20.14.10",