gdc-sdk-node-ts 2.4.23 → 2.4.30

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 (32) hide show
  1. package/README.md +18 -7
  2. package/dist/constants/lifecycle.d.ts +8 -0
  3. package/dist/constants/lifecycle.js +8 -0
  4. package/dist/device-activation.d.ts +48 -1
  5. package/dist/device-activation.js +157 -1
  6. package/dist/digital-twin.d.ts +4 -0
  7. package/dist/digital-twin.js +16 -4
  8. package/dist/host-onboarding.d.ts +7 -0
  9. package/dist/node-managed-wallet.d.ts +41 -1
  10. package/dist/node-managed-wallet.js +52 -0
  11. package/dist/node-runtime-client.d.ts +39 -4
  12. package/dist/node-runtime-client.js +142 -51
  13. package/dist/orchestration/client-port.d.ts +11 -1
  14. package/dist/orchestration/digital-twin-sdk.js +3 -1
  15. package/dist/orchestration/host-onboarding-sdk.d.ts +9 -3
  16. package/dist/orchestration/host-onboarding-sdk.js +10 -1
  17. package/dist/orchestration/individual-controller-sdk.d.ts +29 -3
  18. package/dist/orchestration/individual-controller-sdk.js +48 -2
  19. package/dist/orchestration/organization-controller-sdk.d.ts +19 -6
  20. package/dist/orchestration/organization-controller-sdk.js +27 -6
  21. package/dist/organization-controller-recovery.d.ts +4 -2
  22. package/dist/organization-controller-recovery.js +14 -8
  23. package/dist/organization-employee-lifecycle.d.ts +4 -0
  24. package/dist/organization-employee-lifecycle.js +17 -1
  25. package/dist/organization-license-order.d.ts +8 -3
  26. package/dist/resource-operations.d.ts +67 -0
  27. package/dist/resource-operations.js +62 -1
  28. package/dist/runtime-client-paths.d.ts +10 -0
  29. package/dist/runtime-client-paths.js +10 -0
  30. package/dist/server-profile-session.d.ts +32 -3
  31. package/dist/server-profile-session.js +21 -17
  32. package/package.json +1 -1
@@ -3,6 +3,7 @@ import type { AppInfo } from 'gdc-sdk-core-ts';
3
3
  import type { IndividualOrganizationLifecycleInput } from 'gdc-sdk-core-ts';
4
4
  import { type ResolvedAppInfo, type CommunicationClinicalFormatRenderers, type SecureDidcommTransportAdapter, type TransportProfile } from 'gdc-sdk-core-ts';
5
5
  import { type HostRouteContext, type HostedTenantLifecycleInput } from './host-onboarding.js';
6
+ import type { HostedTenantDescendantKind } from './host-onboarding.js';
6
7
  import type { NodeLegalOrganizationVerificationTransactionInput, NodeOrganizationDidBindingInput, NodeOrganizationActivationInput } from './orchestration/client-port.js';
7
8
  import { type IndividualOrganizationConfirmOrderInput, type RouteContext } from './individual-onboarding.js';
8
9
  import { type EnsureFamilyOrganizationRegistrationInput } from './family-organization-registration.js';
@@ -11,7 +12,7 @@ import { type SmartTokenRequestInput } from './smart-token.js';
11
12
  import { type EmployeeDeviceActivationRequestInput, type EmployeeDeviceActivationResult, type EmployeeDeviceRevocationInput } from './device-activation.js';
12
13
  import { type OrganizationLicenseOrderConfirmInput } from './organization-license-order.js';
13
14
  import { type IndividualOrganizationBootstrapInput, type IndividualOrganizationStartResult } from './individual-start.js';
14
- import { type CommunicationIngestionInput, type BlockchainArtifactRegistrationInput, type VitalSignBatchCommunicationFromSearchResponseInput, type CommunicationParticipantRuntimeSearchInput, type ClinicalBundleSearchInput, type ClinicalSectionUpdateInput, type ClinicalSummaryReadResult, type ClinicalSummaryRequestInput, type ClinicalSummaryUpdateInput, type GrantProfessionalAccessInput, type GrantProfessionalAccessResult, type IndividualMemberLifecycleInput, type IndividualMemberLicenseAddInput, type IndividualMemberLicenseInvitationInput, type IndividualMemberLicenseTransitionInput, type LicenseListRuntimeSearchInput, type LicenseOfferRuntimeSearchInput, type LicenseOrderRuntimeSearchInput, type OrganizationEmployeeCreationInput, type OrganizationEmployeeLicenseAddInput, type OrganizationEmployeeLicenseOfferInput, type OrganizationEmployeeLicenseInvitationInput, type OrganizationEmployeeLifecycleInput, type OrganizationEmployeeSearchInput, type ProfessionalAccessRequestInput, type ProfessionalAccessRequestResult, type RevokeProfessionalAccessInput, type RevokeProfessionalAccessResult, type RelatedPersonUpsertInput } from './resource-operations.js';
15
+ import { type CommunicationIngestionInput, type BlockchainArtifactRegistrationInput, type VitalSignBatchCommunicationFromSearchResponseInput, type CommunicationParticipantRuntimeSearchInput, type ClinicalBundleSearchInput, type ClinicalSectionUpdateInput, type ClinicalSummaryReadResult, type ClinicalSummaryRequestInput, type ClinicalSummaryUpdateInput, type GrantProfessionalAccessInput, type GrantProfessionalAccessResult, type DigitalTwinSecondaryUseConsentInput, type DigitalTwinSecondaryUseConsentResult, type DigitalTwinSubjectLinkPurgeInput, type DigitalTwinSubjectLinkPurgeResult, type IndividualMemberLifecycleInput, type IndividualMemberLicenseAddInput, type IndividualMemberLicenseInvitationInput, type IndividualMemberLicenseTransitionInput, type LicenseListRuntimeSearchInput, type LicenseOfferRuntimeSearchInput, type LicenseOrderRuntimeSearchInput, type OrganizationEmployeeCreationInput, type OrganizationEmployeeLicenseAddInput, type OrganizationEmployeeLicenseOfferInput, type OrganizationEmployeeLicenseInvitationInput, type OrganizationEmployeeLifecycleInput, type OrganizationEmployeeSearchInput, type ProfessionalAccessRequestInput, type ProfessionalAccessRequestResult, type RevokeProfessionalAccessInput, type RevokeProfessionalAccessResult, type RelatedPersonUpsertInput } from './resource-operations.js';
15
16
  import type { LegalOrganizationOrderInput } from './host-onboarding.js';
16
17
  import type { SmartTokenExchangeResult } from './smart-token.js';
17
18
  import { type OrganizationEmployeeProvisioningInput, type OrganizationEmployeeProvisioningResult } from './organization-employee-lifecycle.js';
@@ -127,7 +128,9 @@ export declare class HttpRuntimeClient implements NodeRuntimeClient {
127
128
  */
128
129
  v1Path(ctx: RouteContext | undefined, section: string, format: string, resourceType: string, action: string): string;
129
130
  /**
130
- * Submits a batch payload to a gateway batch endpoint.
131
+ * Submits a batch payload using the transport profile selected once when the
132
+ * runtime client was constructed. Operations cannot downgrade or replace
133
+ * that profile locally.
131
134
  */
132
135
  submitBatch(path: string, payload: SubmitPayload): Promise<SubmitResponse>;
133
136
  /**
@@ -145,6 +148,13 @@ export declare class HttpRuntimeClient implements NodeRuntimeClient {
145
148
  /** Registers one tenant or exact-subject FHIR R5 rest-hook Subscription. */
146
149
  submitFhirR5SubscriptionBatch(ctx: RouteContext, input: FhirR5SubscriptionBatchInput, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
147
150
  private submitAndPollWithBearerToken;
151
+ /**
152
+ * Enforces the client-owned transport policy. Operation inputs retained for
153
+ * source compatibility may repeat the configured profile, but can never
154
+ * replace it or silently downgrade the wire protection selected at runtime
155
+ * construction.
156
+ */
157
+ private requireConfiguredTransportProfile;
148
158
  /**
149
159
  * Starts the host-side legal-organization verification transaction that GW
150
160
  * CORE forwards to ICA `_verify`.
@@ -245,10 +255,23 @@ export declare class HttpRuntimeClient implements NodeRuntimeClient {
245
255
  * have already been disabled/purged.
246
256
  */
247
257
  disableTenant(hostCtx: HostRouteContext, input: HostedTenantLifecycleInput, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
258
+ /** Re-enables one suspended hosted tenant without changing its legal identity. */
259
+ enableTenant(hostCtx: HostRouteContext, input: HostedTenantLifecycleInput, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
248
260
  /**
249
261
  * Purges one already-disabled hosted tenant through the host registry.
250
262
  */
251
263
  purgeTenant(hostCtx: HostRouteContext, input: HostedTenantLifecycleInput, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
264
+ /** Reads authoritative tenant and descendant lifecycle state from the host registry. */
265
+ getTenantLifecycleStatus(hostCtx: HostRouteContext, input: HostedTenantLifecycleInput, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
266
+ /** Explicitly disables one descendant group; tenant disable itself never cascades. */
267
+ disableTenantDescendants(hostCtx: HostRouteContext, input: HostedTenantLifecycleInput & {
268
+ descendantKind: HostedTenantDescendantKind;
269
+ }, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
270
+ /** Explicitly purges one descendant group; tenant purge itself never cascades. */
271
+ purgeTenantDescendants(hostCtx: HostRouteContext, input: HostedTenantLifecycleInput & {
272
+ descendantKind: HostedTenantDescendantKind;
273
+ }, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
274
+ private submitTenantDescendantLifecycle;
252
275
  /**
253
276
  * Creates an employee or professional entry under an existing organization tenant.
254
277
  */
@@ -410,6 +433,13 @@ export declare class HttpRuntimeClient implements NodeRuntimeClient {
410
433
  * Creates and submits a consent-oriented access grant for a professional actor.
411
434
  */
412
435
  grantProfessionalAccess(ctx: RouteContext, input: GrantProfessionalAccessInput): Promise<GrantProfessionalAccessResult>;
436
+ /**
437
+ * Applies the subject's reversible secondary-use decision and lets GW
438
+ * rebuild or pause the tenant-private digital-twin projection.
439
+ */
440
+ setDigitalTwinSecondaryUseConsent(ctx: RouteContext, input: DigitalTwinSecondaryUseConsentInput): Promise<DigitalTwinSecondaryUseConsentResult>;
441
+ /** Offboards the subject from this index provider without deleting the anonymous twin. */
442
+ purgeDigitalTwinSubjectLink(ctx: RouteContext, input: DigitalTwinSubjectLinkPurgeInput): Promise<DigitalTwinSubjectLinkPurgeResult>;
413
443
  /**
414
444
  * Closes an existing professional consent by setting its period end and
415
445
  * resubmitting the updated consent resource.
@@ -430,6 +460,11 @@ export declare class HttpRuntimeClient implements NodeRuntimeClient {
430
460
  * actor-neutral and is used by portal and telephone profile runtimes.
431
461
  */
432
462
  activateProfileDeviceWithActivationRequest(input: EmployeeDeviceActivationRequestInput): Promise<EmployeeDeviceActivationResult>;
463
+ /**
464
+ * Actor-facade name retained for organization controllers and employees.
465
+ * The implementation is actor-neutral and shares the profile-device flow.
466
+ */
467
+ activateEmployeeDeviceWithActivationRequest(input: EmployeeDeviceActivationRequestInput): Promise<EmployeeDeviceActivationResult>;
433
468
  /**
434
469
  * Creates or updates a `RelatedPerson` for non-employee family/caregiver
435
470
  * roles such as a grandfather, guardian, or external caregiver.
@@ -547,8 +582,6 @@ export declare class HttpRuntimeClient implements NodeRuntimeClient {
547
582
  pollOptions?: PollOptions;
548
583
  }): Promise<SubmitAndPollResult>;
549
584
  private buildConsentClaimsWithCid;
550
- private pollBatchResponse;
551
- private postJson;
552
585
  private buildHeaders;
553
586
  private fetchWithTimeout;
554
587
  private parseResponseBody;
@@ -609,6 +642,8 @@ export declare class HttpRuntimeClient implements NodeRuntimeClient {
609
642
  individualRelatedPersonPurgePollPath(ctx?: RouteContext): string;
610
643
  individualConsentR4BatchPath(ctx: RouteContext): string;
611
644
  individualConsentR4PollPath(ctx: RouteContext): string;
645
+ individualResearchSubjectPurgePath(ctx: RouteContext): string;
646
+ individualResearchSubjectPurgePollPath(ctx: RouteContext): string;
612
647
  individualCommunicationBatchPath(ctx: RouteContext, format: string): string;
613
648
  individualCommunicationPollPath(ctx: RouteContext, format: string): string;
614
649
  individualCommunicationSearchPath(ctx: RouteContext): string;
@@ -1,9 +1,7 @@
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.
3
- import { DIDCOMM_PLAINTEXT_JSON_MEDIA_TYPE, } from 'gdc-common-utils-ts/utils/didcomm-submit';
4
1
  import { buildAppHeaders, createBootstrapFacade, decodeTransportResponse, renderCommunicationOutboxRequest, renderGatewayMessageRequest, renderTransportPollRequest, resolveAppInfo, TransportProfiles, } from 'gdc-sdk-core-ts';
5
2
  import { pollUntilCompleteWithMethod } from './async-polling.js';
6
3
  import { confirmLegalOrganizationOrderWithDeps, HostLifecycleRequestType, HostedTenantLifecycleRequestType, submitHostedTenantLifecycleWithDeps, } from './host-onboarding.js';
4
+ import { GwCoreLifecycleRequestType } from './constants/lifecycle.js';
7
5
  import { confirmIndividualOrganizationOrderWithDeps, } from './individual-onboarding.js';
8
6
  import { ensureFamilyOrganizationRegistrationWithDeps, } from './family-organization-registration.js';
9
7
  import { searchFamilyOrganizationWithDeps } from './family-organization-search.js';
@@ -12,10 +10,9 @@ import { activateEmployeeDeviceWithActivationCodeWithDeps, activateEmployeeDevic
12
10
  import { extractOfferIdFromResponseBody, extractOfferPreviewFromResponseBody, } from './order-offer-summary.js';
13
11
  import { confirmOrganizationLicenseOrderWithDeps } from './organization-license-order.js';
14
12
  import { startIndividualOrganizationWithDeps } from './individual-start.js';
15
- import { createOrganizationEmployeeWithDeps, issueOrganizationEmployeeLicenseWithDeps, disableIndividualMemberWithDeps, disableIndividualOrganizationWithDeps, disableOrganizationEmployeeWithDeps, listIndividualLicenseOffersWithDeps, listIndividualLicenseOrdersWithDeps, listIndividualLicensesWithDeps, addFreeIndividualMemberLicensesWithDeps, issueIndividualMemberLicenseWithDeps, transitionIndividualMemberLicenseWithDeps, listOrganizationLicenseOffersWithDeps, listOrganizationLicenseOrdersWithDeps, listOrganizationLicensesWithDeps, grantProfessionalAccessWithDeps, buildClinicalSectionUpdateIngestion, buildClinicalSummaryUpdateIngestion, ingestCommunicationAndUpdateIndexWithDeps, requestProfessionalAccessWithDeps, buildVitalSignBatchCommunicationFromSearchResponse, registerBlockchainArtifactAndUpdateIndexWithDeps, requestClinicalSummaryWithDeps, revokeProfessionalAccessWithDeps, searchCommunicationParticipantsWithDeps, purgeIndividualMemberWithDeps, purgeIndividualOrganizationWithDeps, purgeOrganizationEmployeeWithDeps, prepareEmployeeLifecycleMessageForTransport, searchIndividualLicensesWithDeps, searchIndividualLicenseOffersWithDeps, searchIndividualLicenseOrdersWithDeps, searchOrganizationLicensesWithDeps, searchOrganizationLicenseOffersWithDeps, searchOrganizationLicenseOrdersWithDeps, searchOrganizationEmployeesWithDeps, searchClinicalBundleWithDeps, searchLatestIpsWithDeps, upsertRelatedPersonAndPollWithDeps, normalizeCommunicationPathFormatSegment, addFreeOrganizationEmployeeLicensesWithDeps, requestOrganizationEmployeeLicenseOfferWithDeps, } from './resource-operations.js';
13
+ import { createOrganizationEmployeeWithDeps, issueOrganizationEmployeeLicenseWithDeps, disableIndividualMemberWithDeps, disableIndividualOrganizationWithDeps, disableOrganizationEmployeeWithDeps, listIndividualLicenseOffersWithDeps, listIndividualLicenseOrdersWithDeps, listIndividualLicensesWithDeps, addFreeIndividualMemberLicensesWithDeps, issueIndividualMemberLicenseWithDeps, transitionIndividualMemberLicenseWithDeps, listOrganizationLicenseOffersWithDeps, listOrganizationLicenseOrdersWithDeps, listOrganizationLicensesWithDeps, grantProfessionalAccessWithDeps, setDigitalTwinSecondaryUseConsentWithDeps, purgeDigitalTwinSubjectLinkWithDeps, buildClinicalSectionUpdateIngestion, buildClinicalSummaryUpdateIngestion, ingestCommunicationAndUpdateIndexWithDeps, requestProfessionalAccessWithDeps, buildVitalSignBatchCommunicationFromSearchResponse, registerBlockchainArtifactAndUpdateIndexWithDeps, requestClinicalSummaryWithDeps, revokeProfessionalAccessWithDeps, searchCommunicationParticipantsWithDeps, purgeIndividualMemberWithDeps, purgeIndividualOrganizationWithDeps, purgeOrganizationEmployeeWithDeps, prepareEmployeeLifecycleMessageForTransport, searchIndividualLicensesWithDeps, searchIndividualLicenseOffersWithDeps, searchIndividualLicenseOrdersWithDeps, searchOrganizationLicensesWithDeps, searchOrganizationLicenseOffersWithDeps, searchOrganizationLicenseOrdersWithDeps, searchOrganizationEmployeesWithDeps, searchClinicalBundleWithDeps, searchLatestIpsWithDeps, upsertRelatedPersonAndPollWithDeps, normalizeCommunicationPathFormatSegment, addFreeOrganizationEmployeeLicensesWithDeps, requestOrganizationEmployeeLicenseOfferWithDeps, } from './resource-operations.js';
16
14
  import { listOrganizationEmployeeLifecycleWithDeps, provisionOrganizationEmployeeWithDeps, } from './organization-employee-lifecycle.js';
17
- import { submitAndPollWithMethods } from './orchestration/client-port.js';
18
- import { buildRuntimeHeaders, fetchWithTimeout, parseResponseBody, pollBatchResponseWithRuntimeConfig, postJsonWithRuntimeConfig, postRenderedWithRuntimeConfig, } from './runtime-transport.js';
15
+ import { buildRuntimeHeaders, fetchWithTimeout, parseResponseBody, postRenderedWithRuntimeConfig, } from './runtime-transport.js';
19
16
  import { activateOrganizationInGatewayFromIcaProofWithDeps, submitLegalOrganizationCredentialReissuanceWithDeps, submitLegalOrganizationVerificationTransactionWithDeps, submitOrganizationDidBindingWithDeps, } from './runtime-host-submission.js';
20
17
  import { buildGrantProfessionalAccessClaimsWithCid } from './runtime-consent.js';
21
18
  import { RuntimeClientPaths } from './runtime-client-paths.js';
@@ -102,22 +99,38 @@ export class HttpRuntimeClient {
102
99
  return this.paths.v1Path(ctx, section, format, resourceType, action);
103
100
  }
104
101
  /**
105
- * Submits a batch payload to a gateway batch endpoint.
102
+ * Submits a batch payload using the transport profile selected once when the
103
+ * runtime client was constructed. Operations cannot downgrade or replace
104
+ * that profile locally.
106
105
  */
107
106
  async submitBatch(path, payload) {
108
- return this.postJson(path, payload, DIDCOMM_PLAINTEXT_JSON_MEDIA_TYPE);
107
+ const rendered = await renderGatewayMessageRequest(payload, this.transportProfile, this.secureTransportAdapter);
108
+ const response = await postRenderedWithRuntimeConfig(this.transportConfig, path, rendered);
109
+ return { status: response.status, location: response.location, body: response.body };
109
110
  }
110
111
  /**
111
112
  * Polls a batch-response endpoint until the GW reports a terminal state.
112
113
  */
113
114
  async pollUntilComplete(pollPath, request, pollOptions) {
114
- return pollUntilCompleteWithMethod(this.pollBatchResponse.bind(this), pollPath, request, pollOptions);
115
+ return pollUntilCompleteWithMethod(async (path, currentRequest) => {
116
+ const rendered = await renderTransportPollRequest(currentRequest.thid, this.transportProfile, this.secureTransportAdapter);
117
+ const response = await postRenderedWithRuntimeConfig(this.transportConfig, path, rendered);
118
+ return {
119
+ status: response.status,
120
+ body: response.status === 202
121
+ ? response.body
122
+ : response.status >= 200 && response.status < 300
123
+ ? await decodeTransportResponse(response.body, this.transportProfile, this.secureTransportAdapter)
124
+ : response.body,
125
+ retryAfterMs: response.retryAfterMs,
126
+ };
127
+ }, pollPath, request, pollOptions);
115
128
  }
116
129
  /**
117
130
  * Convenience wrapper that performs submit and poll in sequence.
118
131
  */
119
132
  async submitAndPoll(submitPath, pollPath, payload, pollOptions) {
120
- return submitAndPollWithMethods(this, submitPath, pollPath, payload, pollOptions);
133
+ return this.submitClinicalMessageAndPoll(submitPath, pollPath, payload, this.transportProfile, pollOptions);
121
134
  }
122
135
  /** Registers one neutral FHIR R5 topic in the tenant-owned CORE catalog. */
123
136
  submitFhirR5SubscriptionTopicBatch(ctx, topic, pollOptions) {
@@ -138,13 +151,19 @@ export class HttpRuntimeClient {
138
151
  });
139
152
  }
140
153
  async submitAndPollWithBearerToken(bearerToken, submitPath, pollPath, payload, pollOptions) {
141
- const config = { ...this.transportConfig, bearerToken };
142
- const submitted = await postJsonWithRuntimeConfig(config, submitPath, payload, DIDCOMM_PLAINTEXT_JSON_MEDIA_TYPE);
143
- const poll = await pollUntilCompleteWithMethod((path, request) => pollBatchResponseWithRuntimeConfig(config, path, request), pollPath, { thid: String(payload.thid) }, pollOptions);
144
- return {
145
- submit: { status: submitted.status, location: submitted.location, body: submitted.body },
146
- poll,
147
- };
154
+ return this.submitClinicalMessageAndPoll(submitPath, pollPath, payload, this.transportProfile, pollOptions, bearerToken);
155
+ }
156
+ /**
157
+ * Enforces the client-owned transport policy. Operation inputs retained for
158
+ * source compatibility may repeat the configured profile, but can never
159
+ * replace it or silently downgrade the wire protection selected at runtime
160
+ * construction.
161
+ */
162
+ requireConfiguredTransportProfile(requested) {
163
+ if (requested && requested !== this.transportProfile) {
164
+ throw new Error(`Operation transport profile '${requested}' conflicts with configured runtime profile '${this.transportProfile}'.`);
165
+ }
166
+ return this.transportProfile;
148
167
  }
149
168
  /**
150
169
  * Starts the host-side legal-organization verification transaction that GW
@@ -175,9 +194,7 @@ export class HttpRuntimeClient {
175
194
  wrapBundleAsGatewayTransactionMessage: this.wrapBundleAsGatewayTransactionMessage.bind(this),
176
195
  submitPath: this.hostRegistryOrganizationTransactionPath.bind(this),
177
196
  pollPath: this.hostRegistryOrganizationTransactionPollPath.bind(this),
178
- submitAndPoll: this.transportProfile === TransportProfiles.DidcommEncryptedForm
179
- ? (submitPath, pollPath, payload, pollOptions) => this.submitClinicalMessageAndPoll(submitPath, pollPath, payload, this.transportProfile, pollOptions)
180
- : this.submitAndPoll.bind(this),
197
+ submitAndPoll: this.submitAndPoll.bind(this),
181
198
  });
182
199
  }
183
200
  /**
@@ -199,9 +216,7 @@ export class HttpRuntimeClient {
199
216
  wrapBundleAsGatewayTransactionMessage: this.wrapBundleAsGatewayTransactionMessage.bind(this),
200
217
  submitPath: this.hostRegistryOrganizationIssuePath.bind(this),
201
218
  pollPath: this.hostRegistryOrganizationIssuePollPath.bind(this),
202
- submitAndPoll: this.transportProfile === TransportProfiles.DidcommEncryptedForm
203
- ? (submitPath, pollPath, payload, pollOptions) => this.submitClinicalMessageAndPoll(submitPath, pollPath, payload, this.transportProfile, pollOptions)
204
- : this.submitAndPoll.bind(this),
219
+ submitAndPoll: this.submitAndPoll.bind(this),
205
220
  });
206
221
  }
207
222
  /**
@@ -341,6 +356,20 @@ export class HttpRuntimeClient {
341
356
  defaultIntervalMs: pollOptions?.intervalMs,
342
357
  });
343
358
  }
359
+ /** Re-enables one suspended hosted tenant without changing its legal identity. */
360
+ async enableTenant(hostCtx, input, pollOptions) {
361
+ return submitHostedTenantLifecycleWithDeps({
362
+ hostCtx,
363
+ input,
364
+ requestType: GwCoreLifecycleRequestType.TenantEnable,
365
+ submitPath: this.paths.hostRegistryOrganizationEnablePath.bind(this.paths),
366
+ pollPath: this.paths.hostRegistryOrganizationEnablePollPath.bind(this.paths),
367
+ thidPrefix: 'tenant-enable',
368
+ submitAndPoll: this.submitAndPoll.bind(this),
369
+ defaultTimeoutMs: pollOptions?.timeoutMs,
370
+ defaultIntervalMs: pollOptions?.intervalMs,
371
+ });
372
+ }
344
373
  /**
345
374
  * Purges one already-disabled hosted tenant through the host registry.
346
375
  */
@@ -357,6 +386,53 @@ export class HttpRuntimeClient {
357
386
  defaultIntervalMs: pollOptions?.intervalMs,
358
387
  });
359
388
  }
389
+ /** Reads authoritative tenant and descendant lifecycle state from the host registry. */
390
+ async getTenantLifecycleStatus(hostCtx, input, pollOptions) {
391
+ return submitHostedTenantLifecycleWithDeps({
392
+ hostCtx,
393
+ input,
394
+ requestType: GwCoreLifecycleRequestType.TenantStatus,
395
+ submitPath: this.paths.hostRegistryOrganizationStatusPath.bind(this.paths),
396
+ pollPath: this.paths.hostRegistryOrganizationStatusPollPath.bind(this.paths),
397
+ thidPrefix: 'tenant-status',
398
+ submitAndPoll: this.submitAndPoll.bind(this),
399
+ defaultTimeoutMs: pollOptions?.timeoutMs,
400
+ defaultIntervalMs: pollOptions?.intervalMs,
401
+ });
402
+ }
403
+ /** Explicitly disables one descendant group; tenant disable itself never cascades. */
404
+ async disableTenantDescendants(hostCtx, input, pollOptions) {
405
+ return this.submitTenantDescendantLifecycle(hostCtx, input, false, pollOptions);
406
+ }
407
+ /** Explicitly purges one descendant group; tenant purge itself never cascades. */
408
+ async purgeTenantDescendants(hostCtx, input, pollOptions) {
409
+ return this.submitTenantDescendantLifecycle(hostCtx, input, true, pollOptions);
410
+ }
411
+ submitTenantDescendantLifecycle(hostCtx, input, purge, pollOptions) {
412
+ return submitHostedTenantLifecycleWithDeps({
413
+ hostCtx,
414
+ input: {
415
+ ...input,
416
+ additionalClaims: {
417
+ ...input.additionalClaims,
418
+ 'org.schema.Action.lifecycle.descendantKind': input.descendantKind,
419
+ },
420
+ },
421
+ requestType: purge
422
+ ? GwCoreLifecycleRequestType.TenantPurgeDescendants
423
+ : GwCoreLifecycleRequestType.TenantDisableDescendants,
424
+ submitPath: purge
425
+ ? this.paths.hostRegistryOrganizationPurgeDescendantsPath.bind(this.paths)
426
+ : this.paths.hostRegistryOrganizationDisableDescendantsPath.bind(this.paths),
427
+ pollPath: purge
428
+ ? this.paths.hostRegistryOrganizationPurgeDescendantsPollPath.bind(this.paths)
429
+ : this.paths.hostRegistryOrganizationDisableDescendantsPollPath.bind(this.paths),
430
+ thidPrefix: purge ? 'tenant-purge-descendants' : 'tenant-disable-descendants',
431
+ submitAndPoll: this.submitAndPoll.bind(this),
432
+ defaultTimeoutMs: pollOptions?.timeoutMs,
433
+ defaultIntervalMs: pollOptions?.intervalMs,
434
+ });
435
+ }
360
436
  /**
361
437
  * Creates an employee or professional entry under an existing organization tenant.
362
438
  */
@@ -364,7 +440,7 @@ export class HttpRuntimeClient {
364
440
  return createOrganizationEmployeeWithDeps(ctx, input, pollOptions, {
365
441
  employeeBatchPath: this.paths.employeeBatchPath.bind(this.paths),
366
442
  employeePollPath: this.paths.employeePollPath.bind(this.paths),
367
- submitAndPoll: (submitPath, pollPath, payload, options) => this.submitClinicalMessageAndPoll(submitPath, pollPath, prepareEmployeeLifecycleMessageForTransport(payload, this.transportProfile), this.transportProfile, options),
443
+ submitAndPoll: (submitPath, pollPath, payload, options) => this.submitAndPoll(submitPath, pollPath, prepareEmployeeLifecycleMessageForTransport(payload, this.transportProfile), options),
368
444
  });
369
445
  }
370
446
  /** Creates an employee and reserves its activation credential as one SDK workflow. */
@@ -382,9 +458,7 @@ export class HttpRuntimeClient {
382
458
  input,
383
459
  identityDeviceRevokePath: this.paths.identityDeviceRevokePath.bind(this.paths),
384
460
  identityDeviceRevokePollPath: this.paths.identityDeviceRevokePollPath.bind(this.paths),
385
- submitAndPoll: this.transportProfile === TransportProfiles.DidcommEncryptedForm
386
- ? (submitPath, pollPath, payload, pollOptions) => this.submitClinicalMessageAndPoll(submitPath, pollPath, payload, this.transportProfile, pollOptions)
387
- : this.submitAndPoll.bind(this),
461
+ submitAndPoll: this.submitAndPoll.bind(this),
388
462
  });
389
463
  }
390
464
  /** Reserves an employee seat and issues its bounded multi-device activation credential. */
@@ -392,9 +466,7 @@ export class HttpRuntimeClient {
392
466
  return issueOrganizationEmployeeLicenseWithDeps(ctx, input, {
393
467
  identityLicenseIssuePath: this.paths.identityLicenseIssuePath.bind(this.paths),
394
468
  identityLicenseIssuePollPath: this.paths.identityLicenseIssuePollPath.bind(this.paths),
395
- submitAndPoll: this.transportProfile === TransportProfiles.DidcommEncryptedForm
396
- ? (submitPath, pollPath, payload, pollOptions) => this.submitClinicalMessageAndPoll(submitPath, pollPath, payload, this.transportProfile, pollOptions)
397
- : this.submitAndPoll.bind(this),
469
+ submitAndPoll: this.submitAndPoll.bind(this),
398
470
  });
399
471
  }
400
472
  /**
@@ -479,9 +551,7 @@ export class HttpRuntimeClient {
479
551
  return addFreeOrganizationEmployeeLicensesWithDeps(ctx, input, {
480
552
  organizationLicenseOfferCreatePath: this.paths.organizationLicenseOfferCreatePath.bind(this.paths),
481
553
  organizationLicenseOfferCreatePollPath: this.paths.organizationLicenseOfferCreatePollPath.bind(this.paths),
482
- submitAndPoll: this.transportProfile === TransportProfiles.DidcommEncryptedForm
483
- ? (submitPath, pollPath, payload, pollOptions) => this.submitClinicalMessageAndPoll(submitPath, pollPath, payload, this.transportProfile, pollOptions)
484
- : this.submitAndPoll.bind(this),
554
+ submitAndPoll: this.submitAndPoll.bind(this),
485
555
  });
486
556
  }
487
557
  /** Starts the commercial Offer flow for additional professional seats. */
@@ -489,9 +559,7 @@ export class HttpRuntimeClient {
489
559
  return requestOrganizationEmployeeLicenseOfferWithDeps(ctx, input, {
490
560
  organizationLicenseOfferCreatePath: this.paths.organizationLicenseOfferCreatePath.bind(this.paths),
491
561
  organizationLicenseOfferCreatePollPath: this.paths.organizationLicenseOfferCreatePollPath.bind(this.paths),
492
- submitAndPoll: this.transportProfile === TransportProfiles.DidcommEncryptedForm
493
- ? (submitPath, pollPath, payload, pollOptions) => this.submitClinicalMessageAndPoll(submitPath, pollPath, payload, this.transportProfile, pollOptions)
494
- : this.submitAndPoll.bind(this),
562
+ submitAndPoll: this.submitAndPoll.bind(this),
495
563
  });
496
564
  }
497
565
  async searchOrganizationLicenseOffers(ctx, input) {
@@ -540,9 +608,7 @@ export class HttpRuntimeClient {
540
608
  defaultIntervalMs: pollOptions?.intervalMs,
541
609
  hostRegistryOrderBatchPath: this.paths.hostRegistryOrderBatchPath.bind(this.paths),
542
610
  hostRegistryOrderPollPath: this.paths.hostRegistryOrderPollPath.bind(this.paths),
543
- submitAndPoll: this.transportProfile === TransportProfiles.DidcommEncryptedForm
544
- ? (submitPath, pollPath, payload, options) => this.submitClinicalMessageAndPoll(submitPath, pollPath, payload, this.transportProfile, options)
545
- : this.submitAndPoll.bind(this),
611
+ submitAndPoll: this.submitAndPoll.bind(this),
546
612
  });
547
613
  }
548
614
  /**
@@ -759,6 +825,26 @@ export class HttpRuntimeClient {
759
825
  submitAndPoll: this.submitAndPoll.bind(this),
760
826
  });
761
827
  }
828
+ /**
829
+ * Applies the subject's reversible secondary-use decision and lets GW
830
+ * rebuild or pause the tenant-private digital-twin projection.
831
+ */
832
+ async setDigitalTwinSecondaryUseConsent(ctx, input) {
833
+ return setDigitalTwinSecondaryUseConsentWithDeps(ctx, input, {
834
+ buildConsentClaimsWithCid: this.buildConsentClaimsWithCid.bind(this),
835
+ individualConsentR4BatchPath: this.paths.individualConsentR4BatchPath.bind(this.paths),
836
+ individualConsentR4PollPath: this.paths.individualConsentR4PollPath.bind(this.paths),
837
+ submitAndPoll: this.submitAndPoll.bind(this),
838
+ });
839
+ }
840
+ /** Offboards the subject from this index provider without deleting the anonymous twin. */
841
+ async purgeDigitalTwinSubjectLink(ctx, input) {
842
+ return purgeDigitalTwinSubjectLinkWithDeps(ctx, input, {
843
+ individualResearchSubjectPurgePath: this.paths.individualResearchSubjectPurgePath.bind(this.paths),
844
+ individualResearchSubjectPurgePollPath: this.paths.individualResearchSubjectPurgePollPath.bind(this.paths),
845
+ submitAndPoll: this.submitAndPoll.bind(this),
846
+ });
847
+ }
762
848
  /**
763
849
  * Closes an existing professional consent by setting its period end and
764
850
  * resubmitting the updated consent resource.
@@ -816,6 +902,13 @@ export class HttpRuntimeClient {
816
902
  }),
817
903
  });
818
904
  }
905
+ /**
906
+ * Actor-facade name retained for organization controllers and employees.
907
+ * The implementation is actor-neutral and shares the profile-device flow.
908
+ */
909
+ async activateEmployeeDeviceWithActivationRequest(input) {
910
+ return this.activateProfileDeviceWithActivationRequest(input);
911
+ }
819
912
  /**
820
913
  * Creates or updates a `RelatedPerson` for non-employee family/caregiver
821
914
  * roles such as a grandfather, guardian, or external caregiver.
@@ -850,10 +943,11 @@ export class HttpRuntimeClient {
850
943
  * configured secure transport adapter signs/encrypts DIDComm when enabled.
851
944
  */
852
945
  async requestProfessionalAccess(ctx, input) {
946
+ this.requireConfiguredTransportProfile(input.transportProfile);
853
947
  return requestProfessionalAccessWithDeps(ctx, input, {
854
948
  individualCommunicationBatchPath: this.paths.individualCommunicationBatchPath.bind(this.paths),
855
949
  individualCommunicationPollPath: this.paths.individualCommunicationPollPath.bind(this.paths),
856
- submitAndPoll: (submitPath, pollPath, payload, pollOptions) => this.submitClinicalMessageAndPoll(submitPath, pollPath, payload, input.transportProfile || this.transportProfile, pollOptions),
950
+ submitAndPoll: this.submitAndPoll.bind(this),
857
951
  });
858
952
  }
859
953
  /**
@@ -897,7 +991,7 @@ export class HttpRuntimeClient {
897
991
  */
898
992
  async submitCommunicationOutboxJobAndPoll(ctx, input) {
899
993
  const job = input.communicationJob;
900
- const profile = input.transportProfile || this.transportProfile;
994
+ const profile = this.requireConfiguredTransportProfile(input.transportProfile);
901
995
  const format = normalizeCommunicationPathFormatSegment(input.clinicalFormat || input.pathFormatSegment);
902
996
  const submitPath = this.paths.individualCommunicationBatchPath(ctx, format);
903
997
  const pollPath = this.paths.individualCommunicationPollPath(ctx, format);
@@ -1013,10 +1107,11 @@ export class HttpRuntimeClient {
1013
1107
  * @param input Search parameters such as subject, section, date and included resource types.
1014
1108
  */
1015
1109
  async searchClinicalBundle(ctx, input) {
1110
+ this.requireConfiguredTransportProfile(input.transportProfile);
1016
1111
  return searchClinicalBundleWithDeps(ctx, input, {
1017
1112
  bundleSearchPath: this.paths.individualBundleSearchPath.bind(this.paths),
1018
1113
  bundleSearchPollPath: this.paths.individualBundleSearchPollPath.bind(this.paths),
1019
- submitAndPoll: (submitPath, pollPath, payload, pollOptions) => this.submitClinicalMessageAndPoll(submitPath, pollPath, payload, input.transportProfile || this.transportProfile, pollOptions),
1114
+ submitAndPoll: this.submitAndPoll.bind(this),
1020
1115
  });
1021
1116
  }
1022
1117
  /** Searches tenant digital twins using coded, pseudonymous research claims. */
@@ -1028,7 +1123,7 @@ export class HttpRuntimeClient {
1028
1123
  digitalTwinCompositionPollPath: this.paths.digitalTwinCompositionPollPath.bind(this.paths),
1029
1124
  digitalTwinCommunicationBatchPath: this.paths.digitalTwinCommunicationBatchPath.bind(this.paths),
1030
1125
  digitalTwinCommunicationPollPath: this.paths.digitalTwinCommunicationPollPath.bind(this.paths),
1031
- submitAndPoll: (submitPath, pollPath, payload, pollOptions) => this.submitClinicalMessageAndPoll(submitPath, pollPath, payload, this.transportProfile, pollOptions, input.accessToken),
1126
+ submitAndPoll: (submitPath, pollPath, payload, pollOptions) => this.submitAndPollWithBearerToken(input.accessToken, submitPath, pollPath, payload, pollOptions),
1032
1127
  });
1033
1128
  }
1034
1129
  /** Saves one tagged researcher working copy without mutating the canonical twin. */
@@ -1040,7 +1135,7 @@ export class HttpRuntimeClient {
1040
1135
  digitalTwinCompositionPollPath: this.paths.digitalTwinCompositionPollPath.bind(this.paths),
1041
1136
  digitalTwinCommunicationBatchPath: this.paths.digitalTwinCommunicationBatchPath.bind(this.paths),
1042
1137
  digitalTwinCommunicationPollPath: this.paths.digitalTwinCommunicationPollPath.bind(this.paths),
1043
- submitAndPoll: (submitPath, pollPath, payload, pollOptions) => this.submitClinicalMessageAndPoll(submitPath, pollPath, payload, this.transportProfile, pollOptions, input.accessToken),
1138
+ submitAndPoll: (submitPath, pollPath, payload, pollOptions) => this.submitAndPollWithBearerToken(input.accessToken, submitPath, pollPath, payload, pollOptions),
1044
1139
  });
1045
1140
  }
1046
1141
  /** Materializes one selected pseudonymous research subject as a summary Bundle. */
@@ -1052,7 +1147,7 @@ export class HttpRuntimeClient {
1052
1147
  digitalTwinCompositionPollPath: this.paths.digitalTwinCompositionPollPath.bind(this.paths),
1053
1148
  digitalTwinCommunicationBatchPath: this.paths.digitalTwinCommunicationBatchPath.bind(this.paths),
1054
1149
  digitalTwinCommunicationPollPath: this.paths.digitalTwinCommunicationPollPath.bind(this.paths),
1055
- submitAndPoll: (submitPath, pollPath, payload, pollOptions) => this.submitClinicalMessageAndPoll(submitPath, pollPath, payload, this.transportProfile, pollOptions, input.accessToken),
1150
+ submitAndPoll: (submitPath, pollPath, payload, pollOptions) => this.submitAndPollWithBearerToken(input.accessToken, submitPath, pollPath, payload, pollOptions),
1056
1151
  });
1057
1152
  }
1058
1153
  /**
@@ -1090,12 +1185,6 @@ export class HttpRuntimeClient {
1090
1185
  buildConsentClaimsWithCid(input) {
1091
1186
  return buildGrantProfessionalAccessClaimsWithCid(input, runtimeUuid);
1092
1187
  }
1093
- async pollBatchResponse(path, request) {
1094
- return pollBatchResponseWithRuntimeConfig(this.transportConfig, path, request);
1095
- }
1096
- async postJson(path, payload, contentType) {
1097
- return postJsonWithRuntimeConfig(this.transportConfig, path, payload, contentType);
1098
- }
1099
1188
  buildHeaders(contentType) {
1100
1189
  return buildRuntimeHeaders(this.transportConfig, contentType);
1101
1190
  }
@@ -1164,6 +1253,8 @@ export class HttpRuntimeClient {
1164
1253
  individualRelatedPersonPurgePollPath(ctx) { return this.paths.individualRelatedPersonPurgePollPath(ctx); }
1165
1254
  individualConsentR4BatchPath(ctx) { return this.paths.individualConsentR4BatchPath(ctx); }
1166
1255
  individualConsentR4PollPath(ctx) { return this.paths.individualConsentR4PollPath(ctx); }
1256
+ individualResearchSubjectPurgePath(ctx) { return this.paths.individualResearchSubjectPurgePath(ctx); }
1257
+ individualResearchSubjectPurgePollPath(ctx) { return this.paths.individualResearchSubjectPurgePollPath(ctx); }
1167
1258
  individualCommunicationBatchPath(ctx, format) { return this.paths.individualCommunicationBatchPath(ctx, format); }
1168
1259
  individualCommunicationPollPath(ctx, format) { return this.paths.individualCommunicationPollPath(ctx, format); }
1169
1260
  individualCommunicationSearchPath(ctx) { return this.paths.individualCommunicationSearchPath(ctx); }
@@ -18,7 +18,7 @@ import type { EnsureFamilyOrganizationRegistrationInput, EnsureFamilyOrganizatio
18
18
  import type { OrganizationLicenseOrderConfirmInput } from '../organization-license-order.js';
19
19
  import type { SmartTokenExchangeResult, SmartTokenRequestInput } from '../smart-token.js';
20
20
  import type { DigitalTwinMaterializationInput, DigitalTwinSearchInput, DigitalTwinSelectionInput } from '../digital-twin.js';
21
- import type { CommunicationIngestionInput, BlockchainArtifactRegistrationInput, CommunicationParticipantRuntimeSearchInput, ClinicalBundleSearchInput, ClinicalSectionUpdateInput, ClinicalSummaryReadResult, ClinicalSummaryRequestInput, ClinicalSummaryUpdateInput, VitalSignBatchCommunicationFromSearchResponseInput, DigitalTwinGenerationInput, GrantProfessionalAccessInput, GrantProfessionalAccessResult, IndividualMemberLifecycleInput, IndividualMemberLicenseAddInput, IndividualMemberLicenseInvitationInput, IndividualMemberLicenseTransitionInput, IpsOrFhirImportInput, OrganizationEmployeeCreationInput, OrganizationEmployeeLicenseAddInput, OrganizationEmployeeLicenseOfferInput, OrganizationEmployeeLicenseInvitationInput, OrganizationEmployeeLifecycleInput, OrganizationEmployeeSearchInput, ProfessionalAccessRequestInput, ProfessionalAccessRequestResult, RevokeProfessionalAccessInput, RevokeProfessionalAccessResult, RelatedPersonUpsertInput } from '../resource-operations.js';
21
+ import type { CommunicationIngestionInput, BlockchainArtifactRegistrationInput, CommunicationParticipantRuntimeSearchInput, ClinicalBundleSearchInput, ClinicalSectionUpdateInput, ClinicalSummaryReadResult, ClinicalSummaryRequestInput, ClinicalSummaryUpdateInput, VitalSignBatchCommunicationFromSearchResponseInput, DigitalTwinGenerationInput, DigitalTwinSecondaryUseConsentInput, DigitalTwinSecondaryUseConsentResult, DigitalTwinSubjectLinkPurgeInput, DigitalTwinSubjectLinkPurgeResult, GrantProfessionalAccessInput, GrantProfessionalAccessResult, IndividualMemberLifecycleInput, IndividualMemberLicenseAddInput, IndividualMemberLicenseInvitationInput, IndividualMemberLicenseTransitionInput, IpsOrFhirImportInput, OrganizationEmployeeCreationInput, OrganizationEmployeeLicenseAddInput, OrganizationEmployeeLicenseOfferInput, OrganizationEmployeeLicenseInvitationInput, OrganizationEmployeeLifecycleInput, OrganizationEmployeeSearchInput, ProfessionalAccessRequestInput, ProfessionalAccessRequestResult, RevokeProfessionalAccessInput, RevokeProfessionalAccessResult, RelatedPersonUpsertInput } from '../resource-operations.js';
22
22
  /**
23
23
  * Shared node-runtime activation input.
24
24
  *
@@ -73,7 +73,15 @@ export type RuntimeClient = {
73
73
  disableHost?: (hostCtx: HostRouteContext, input: HostedTenantLifecycleInput, pollOptions?: PollOptions) => Promise<SubmitAndPollResult>;
74
74
  purgeHost?: (hostCtx: HostRouteContext, input: HostedTenantLifecycleInput, pollOptions?: PollOptions) => Promise<SubmitAndPollResult>;
75
75
  disableTenant?: (hostCtx: HostRouteContext, input: HostedTenantLifecycleInput, pollOptions?: PollOptions) => Promise<SubmitAndPollResult>;
76
+ enableTenant?: (hostCtx: HostRouteContext, input: HostedTenantLifecycleInput, pollOptions?: PollOptions) => Promise<SubmitAndPollResult>;
76
77
  purgeTenant?: (hostCtx: HostRouteContext, input: HostedTenantLifecycleInput, pollOptions?: PollOptions) => Promise<SubmitAndPollResult>;
78
+ getTenantLifecycleStatus?: (hostCtx: HostRouteContext, input: HostedTenantLifecycleInput, pollOptions?: PollOptions) => Promise<SubmitAndPollResult>;
79
+ disableTenantDescendants?: (hostCtx: HostRouteContext, input: HostedTenantLifecycleInput & {
80
+ descendantKind: 'individuals';
81
+ }, pollOptions?: PollOptions) => Promise<SubmitAndPollResult>;
82
+ purgeTenantDescendants?: (hostCtx: HostRouteContext, input: HostedTenantLifecycleInput & {
83
+ descendantKind: 'individuals';
84
+ }, pollOptions?: PollOptions) => Promise<SubmitAndPollResult>;
77
85
  createOrganizationEmployee?: (ctx: RouteContext, input: OrganizationEmployeeCreationInput, pollOptions?: PollOptions) => Promise<SubmitAndPollResult>;
78
86
  provisionOrganizationEmployee?: (ctx: RouteContext, input: OrganizationEmployeeProvisioningInput) => Promise<OrganizationEmployeeProvisioningResult>;
79
87
  issueOrganizationEmployeeLicense?: (ctx: RouteContext, input: OrganizationEmployeeLicenseInvitationInput) => Promise<SubmitAndPollResult>;
@@ -127,6 +135,8 @@ export type RuntimeClient = {
127
135
  importIpsOrFhirAndUpdateIndex?: (ctx: RouteContext, input: IpsOrFhirImportInput) => Promise<SubmitAndPollResult>;
128
136
  upsertRelatedPersonAndPoll?: (ctx: RouteContext, input: RelatedPersonUpsertInput) => Promise<SubmitAndPollResult>;
129
137
  generateDigitalTwinFromSubjectData?: (ctx: RouteContext, input: DigitalTwinGenerationInput) => Promise<SubmitAndPollResult>;
138
+ setDigitalTwinSecondaryUseConsent?: (ctx: RouteContext, input: DigitalTwinSecondaryUseConsentInput) => Promise<DigitalTwinSecondaryUseConsentResult>;
139
+ purgeDigitalTwinSubjectLink?: (ctx: RouteContext, input: DigitalTwinSubjectLinkPurgeInput) => Promise<DigitalTwinSubjectLinkPurgeResult>;
130
140
  searchClinicalBundle?: (ctx: RouteContext, input: ClinicalBundleSearchInput) => Promise<SubmitAndPollResult>;
131
141
  searchDigitalTwins?: (ctx: RouteContext, input: DigitalTwinSearchInput) => Promise<SubmitAndPollResult>;
132
142
  saveDigitalTwinSelection?: (ctx: RouteContext, input: DigitalTwinSelectionInput) => Promise<SubmitAndPollResult>;
@@ -1,7 +1,7 @@
1
1
  // Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
2
2
  import { HealthcareConsentPurposes, ServiceCapability } from 'gdc-common-utils-ts/constants';
3
3
  import { CompositionClaim } from 'gdc-common-utils-ts/models';
4
- import { DigitalTwinSearchParameter, readDigitalTwinSearchResult } from '../digital-twin.js';
4
+ import { assertDigitalTwinSubjectId, DigitalTwinSearchParameter, readDigitalTwinSearchResult, } from '../digital-twin.js';
5
5
  import { requireClientMethod } from './client-port.js';
6
6
  /** Public research facade for licensed digital-twin access. */
7
7
  export class DigitalTwinSdk {
@@ -62,6 +62,7 @@ export class DigitalTwinSdk {
62
62
  * The canonical clinical twin is never modified.
63
63
  */
64
64
  saveSelection(ctx, input) {
65
+ assertDigitalTwinSubjectId(input.twinSubjectId);
65
66
  const requestedAuthorDid = String(input.authorDid || '').trim() || undefined;
66
67
  if (this.researcherDid && requestedAuthorDid && requestedAuthorDid !== this.researcherDid) {
67
68
  throw new Error('Digital twin selection authorDid must match the actor session.');
@@ -92,6 +93,7 @@ export class DigitalTwinSdk {
92
93
  }
93
94
  /** Materializes one selected research subject through `ResearchSubject/$summary`. */
94
95
  materialize(ctx, input) {
96
+ assertDigitalTwinSubjectId(input.twinSubjectId);
95
97
  return requireClientMethod(this.client, 'materializeDigitalTwin')(ctx, {
96
98
  ...input,
97
99
  accessToken: input.accessToken || this.smartAccessToken,
@@ -1,10 +1,16 @@
1
- import { type NodeRuntimeClient, type NodeOrganizationActivationInput, type PollOptions, type SubmitAndPollResult, type SubmitPayload } from './client-port.js';
1
+ import { type NodeRuntimeClient, type NodeLegalOrganizationVerificationTransactionInput, type NodeOrganizationActivationInput, type PollOptions, type SubmitAndPollResult, type SubmitPayload } from './client-port.js';
2
2
  import type { HostingControllerFacade, HostLifecycleInput, HostRouteContext, LegalOrganizationOrderInput } from '../host-onboarding.js';
3
3
  import type { NodeCapability } from '../session.js';
4
4
  export declare class HostOnboardingSdk implements HostingControllerFacade {
5
5
  private readonly client;
6
- private readonly capabilities;
7
- constructor(client: NodeRuntimeClient, capabilities?: readonly NodeCapability[]);
6
+ private readonly capabilities?;
7
+ constructor(client: NodeRuntimeClient, capabilities?: readonly NodeCapability[] | undefined);
8
+ /**
9
+ * Starts the canonical host-side legal-organization verification
10
+ * transaction. Confirm the returned Offer through
11
+ * `confirmLegalOrganizationOrder(...)`.
12
+ */
13
+ submitLegalOrganizationVerificationTransaction(hostCtx: HostRouteContext, input: NodeLegalOrganizationVerificationTransactionInput, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
8
14
  /**
9
15
  * Submits the legal organization activation proof and required declared
10
16
  * service capabilities to GW CORE.
@@ -4,10 +4,19 @@ import { requireClientMethod, submitAndPollWithClient, } from './client-port.js'
4
4
  import { ActorCapabilities, ActorKinds } from 'gdc-common-utils-ts/constants/actor-session';
5
5
  import { assertFacadeCapability } from './capability-guard.js';
6
6
  export class HostOnboardingSdk {
7
- constructor(client, capabilities = []) {
7
+ constructor(client, capabilities) {
8
8
  this.client = client;
9
9
  this.capabilities = capabilities;
10
10
  }
11
+ /**
12
+ * Starts the canonical host-side legal-organization verification
13
+ * transaction. Confirm the returned Offer through
14
+ * `confirmLegalOrganizationOrder(...)`.
15
+ */
16
+ submitLegalOrganizationVerificationTransaction(hostCtx, input, pollOptions) {
17
+ assertFacadeCapability(this.capabilities, ActorCapabilities.HostingActivateOrganization, ActorKinds.HostOnboarding, 'submitLegalOrganizationVerificationTransaction');
18
+ return requireClientMethod(this.client, 'submitLegalOrganizationVerificationTransaction')(hostCtx, input, pollOptions);
19
+ }
11
20
  /**
12
21
  * Submits the legal organization activation proof and required declared
13
22
  * service capabilities to GW CORE.