gdc-sdk-node-ts 2.4.9 → 2.4.10

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.
@@ -11,7 +11,7 @@ import { type SmartTokenRequestInput } from './smart-token.js';
11
11
  import { type EmployeeDeviceActivationRequestInput, type EmployeeDeviceActivationResult, type EmployeeDeviceRevocationInput } from './device-activation.js';
12
12
  import { type OrganizationLicenseOrderConfirmInput } from './organization-license-order.js';
13
13
  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 OrganizationEmployeeLicenseInvitationInput, type OrganizationEmployeeLifecycleInput, type OrganizationEmployeeSearchInput, type ProfessionalAccessRequestInput, type ProfessionalAccessRequestResult, type RevokeProfessionalAccessInput, type RevokeProfessionalAccessResult, type RelatedPersonUpsertInput } from './resource-operations.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 OrganizationEmployeeLicenseInvitationInput, type OrganizationEmployeeLifecycleInput, type OrganizationEmployeeSearchInput, type ProfessionalAccessRequestInput, type ProfessionalAccessRequestResult, type RevokeProfessionalAccessInput, type RevokeProfessionalAccessResult, type RelatedPersonUpsertInput } from './resource-operations.js';
15
15
  import type { LegalOrganizationOrderInput } from './host-onboarding.js';
16
16
  import type { SmartTokenExchangeResult } from './smart-token.js';
17
17
  import { type OrganizationEmployeeProvisioningInput, type OrganizationEmployeeProvisioningResult } from './organization-employee-lifecycle.js';
@@ -297,6 +297,8 @@ export declare class HttpRuntimeClient implements NodeRuntimeClient {
297
297
  * route with optional filters.
298
298
  */
299
299
  listOrganizationLicenses(ctx: RouteContext, input?: LicenseListRuntimeSearchInput): Promise<SubmitAndPollResult>;
300
+ /** Adds zero-cost employee seats when the target GW is a test-network. */
301
+ addFreeOrganizationEmployeeLicenses(ctx: RouteContext, input: OrganizationEmployeeLicenseAddInput): Promise<SubmitAndPollResult>;
300
302
  searchOrganizationLicenseOffers(ctx: RouteContext, input: LicenseOfferRuntimeSearchInput): Promise<SubmitAndPollResult>;
301
303
  listOrganizationLicenseOffers(ctx: RouteContext, input?: LicenseOfferRuntimeSearchInput): Promise<SubmitAndPollResult>;
302
304
  searchOrganizationLicenseOrders(ctx: RouteContext, input: LicenseOrderRuntimeSearchInput): Promise<SubmitAndPollResult>;
@@ -12,7 +12,7 @@ import { activateEmployeeDeviceWithActivationCodeWithDeps, activateEmployeeDevic
12
12
  import { extractOfferIdFromResponseBody, extractOfferPreviewFromResponseBody, } from './order-offer-summary.js';
13
13
  import { confirmOrganizationLicenseOrderWithDeps } from './organization-license-order.js';
14
14
  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, } from './resource-operations.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, } from './resource-operations.js';
16
16
  import { listOrganizationEmployeeLifecycleWithDeps, provisionOrganizationEmployeeWithDeps, } from './organization-employee-lifecycle.js';
17
17
  import { submitAndPollWithMethods } from './orchestration/client-port.js';
18
18
  import { buildRuntimeHeaders, fetchWithTimeout, parseResponseBody, pollBatchResponseWithRuntimeConfig, postJsonWithRuntimeConfig, postRenderedWithRuntimeConfig, } from './runtime-transport.js';
@@ -473,6 +473,16 @@ export class HttpRuntimeClient {
473
473
  submitAndPoll: this.submitAndPoll.bind(this),
474
474
  });
475
475
  }
476
+ /** Adds zero-cost employee seats when the target GW is a test-network. */
477
+ async addFreeOrganizationEmployeeLicenses(ctx, input) {
478
+ return addFreeOrganizationEmployeeLicensesWithDeps(ctx, input, {
479
+ organizationLicenseActionPath: this.paths.organizationLicenseActionPath.bind(this.paths),
480
+ organizationLicenseActionPollPath: this.paths.organizationLicenseActionPollPath.bind(this.paths),
481
+ submitAndPoll: this.transportProfile === TransportProfiles.DidcommEncryptedForm
482
+ ? (submitPath, pollPath, payload, pollOptions) => this.submitClinicalMessageAndPoll(submitPath, pollPath, payload, this.transportProfile, pollOptions)
483
+ : this.submitAndPoll.bind(this),
484
+ });
485
+ }
476
486
  async searchOrganizationLicenseOffers(ctx, input) {
477
487
  return searchOrganizationLicenseOffersWithDeps(ctx, input, {
478
488
  organizationLicenseOfferSearchPath: this.paths.organizationLicenseOfferSearchPath.bind(this.paths),
@@ -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, 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, GrantProfessionalAccessInput, GrantProfessionalAccessResult, IndividualMemberLifecycleInput, IndividualMemberLicenseAddInput, IndividualMemberLicenseInvitationInput, IndividualMemberLicenseTransitionInput, IpsOrFhirImportInput, OrganizationEmployeeCreationInput, OrganizationEmployeeLicenseAddInput, OrganizationEmployeeLicenseInvitationInput, OrganizationEmployeeLifecycleInput, OrganizationEmployeeSearchInput, ProfessionalAccessRequestInput, ProfessionalAccessRequestResult, RevokeProfessionalAccessInput, RevokeProfessionalAccessResult, RelatedPersonUpsertInput } from '../resource-operations.js';
22
22
  /**
23
23
  * Shared node-runtime activation input.
24
24
  *
@@ -81,6 +81,7 @@ export type RuntimeClient = {
81
81
  listOrganizationEmployeeLifecycle?: (ctx: RouteContext) => Promise<OrganizationEmployeeLifecycleRecord[]>;
82
82
  searchOrganizationLicenses?: (ctx: RouteContext, input: LicenseListRuntimeSearchInput) => Promise<SubmitAndPollResult>;
83
83
  listOrganizationLicenses?: (ctx: RouteContext, input?: LicenseListRuntimeSearchInput) => Promise<SubmitAndPollResult>;
84
+ addFreeOrganizationEmployeeLicenses?: (ctx: RouteContext, input: OrganizationEmployeeLicenseAddInput) => Promise<SubmitAndPollResult>;
84
85
  searchOrganizationLicenseOffers?: (ctx: RouteContext, input: LicenseOfferRuntimeSearchInput) => Promise<SubmitAndPollResult>;
85
86
  listOrganizationLicenseOffers?: (ctx: RouteContext, input?: LicenseOfferRuntimeSearchInput) => Promise<SubmitAndPollResult>;
86
87
  searchOrganizationLicenseOrders?: (ctx: RouteContext, input: LicenseOrderRuntimeSearchInput) => Promise<SubmitAndPollResult>;
@@ -5,7 +5,7 @@ import type { EmployeeDeviceActivationResult, EmployeeDeviceActivationRequestInp
5
5
  import type { SmartTokenExchangeResult, SmartTokenRequestInput } from '../smart-token.js';
6
6
  import type { OrganizationLicenseOrderConfirmInput } from '../organization-license-order.js';
7
7
  import type { NodeCapability } from '../session.js';
8
- import type { LicenseListRuntimeSearchInput, LicenseOfferRuntimeSearchInput, LicenseOrderRuntimeSearchInput, OrganizationEmployeeCreationInput, OrganizationEmployeeLicenseInvitationInput, OrganizationEmployeeLifecycleInput, OrganizationEmployeeSearchInput } from '../resource-operations.js';
8
+ import type { LicenseListRuntimeSearchInput, LicenseOfferRuntimeSearchInput, LicenseOrderRuntimeSearchInput, OrganizationEmployeeCreationInput, OrganizationEmployeeLicenseAddInput, OrganizationEmployeeLicenseInvitationInput, OrganizationEmployeeLifecycleInput, OrganizationEmployeeSearchInput } from '../resource-operations.js';
9
9
  import type { OrganizationEmployeeProvisioningInput, OrganizationEmployeeProvisioningResult } from '../organization-employee-lifecycle.js';
10
10
  import type { OrganizationEmployeeLifecycleRecord } from 'gdc-common-utils-ts/models/organization-employee-lifecycle';
11
11
  /**
@@ -83,6 +83,8 @@ export declare class OrganizationControllerSdk {
83
83
  * Lists organization-owned license seats with optional filters.
84
84
  */
85
85
  listLicenses(ctx: RouteContext, input?: LicenseListRuntimeSearchInput): Promise<SubmitAndPollResult>;
86
+ /** Adds zero-cost employee seats on an explicitly configured test network. */
87
+ addFreeEmployeeLicenses(ctx: RouteContext, input: OrganizationEmployeeLicenseAddInput): Promise<SubmitAndPollResult>;
86
88
  /**
87
89
  * Searches commercial license offers known for the current organization.
88
90
  */
@@ -111,6 +111,10 @@ export class OrganizationControllerSdk {
111
111
  listLicenses(ctx, input = {}) {
112
112
  return requireClientMethod(this.client, 'listOrganizationLicenses')(ctx, input);
113
113
  }
114
+ /** Adds zero-cost employee seats on an explicitly configured test network. */
115
+ addFreeEmployeeLicenses(ctx, input) {
116
+ return requireClientMethod(this.client, 'addFreeOrganizationEmployeeLicenses')(ctx, input);
117
+ }
114
118
  /**
115
119
  * Searches commercial license offers known for the current organization.
116
120
  */
@@ -21,6 +21,11 @@ export type OrganizationEmployeeProvisioningDeps = Readonly<{
21
21
  }>;
22
22
  /** Creates the employee, reserves its seat and returns the exact GW credential. */
23
23
  export declare function provisionOrganizationEmployeeWithDeps(routeContext: RouteContext, input: OrganizationEmployeeProvisioningInput, deps: OrganizationEmployeeProvisioningDeps): Promise<OrganizationEmployeeProvisioningResult>;
24
+ /**
25
+ * Rejects failed outer HTTP responses and failed entries hidden inside a
26
+ * successful async poll envelope before a caller starts the next mutation.
27
+ */
28
+ export declare function assertSuccessfulEmployeeOperation(operation: string, result: SubmitAndPollResult): void;
24
29
  /** Shared dependencies for combining employee and license directory searches. */
25
30
  export type OrganizationEmployeeLifecycleQueryDeps = Readonly<{
26
31
  searchEmployees(routeContext: RouteContext, input: OrganizationEmployeeSearchInput): Promise<SubmitAndPollResult>;
@@ -5,13 +5,102 @@ import { buildStableActorIdentifier } from 'gdc-common-utils-ts/utils/actor-iden
5
5
  /** Creates the employee, reserves its seat and returns the exact GW credential. */
6
6
  export async function provisionOrganizationEmployeeWithDeps(routeContext, input, deps) {
7
7
  const employee = await deps.createEmployee(routeContext, input.creation);
8
+ assertSuccessfulEmployeeOperation('employee creation', employee);
8
9
  const license = await deps.issueLicense(routeContext, input.invitation);
10
+ assertSuccessfulEmployeeOperation('licence issue', license);
9
11
  const activationCode = readEmployeeActivationCode(license.poll.body);
10
12
  if (!activationCode) {
11
13
  throw new Error('provisionOrganizationEmployee: GW response did not contain an employee activation credential.');
12
14
  }
13
15
  return { employee, license, activationCode };
14
16
  }
17
+ /**
18
+ * Rejects failed outer HTTP responses and failed entries hidden inside a
19
+ * successful async poll envelope before a caller starts the next mutation.
20
+ */
21
+ export function assertSuccessfulEmployeeOperation(operation, result) {
22
+ const failure = responseFailure(result.submit.status, result.submit.body)
23
+ || responseFailure(result.poll.status, result.poll.body)
24
+ || nestedEmployeeOperationFailure(result.poll.body);
25
+ if (!failure)
26
+ return;
27
+ const status = failure.status ? ` (HTTP ${failure.status})` : '';
28
+ const diagnostics = failure.diagnostics ? `: ${failure.diagnostics}` : '';
29
+ throw new Error(`provisionOrganizationEmployee: ${operation} failed${status}${diagnostics}.`);
30
+ }
31
+ function responseFailure(status, body) {
32
+ return status >= 200 && status < 300
33
+ ? undefined
34
+ : { status, diagnostics: firstOperationOutcomeDiagnostics(body) };
35
+ }
36
+ function nestedEmployeeOperationFailure(value) {
37
+ for (const candidate of nestedRecords(value)) {
38
+ const response = record(candidate.response);
39
+ const status = parseHttpStatus(response?.status);
40
+ const outcome = record(response?.outcome);
41
+ if (status !== undefined && (status < 200 || status >= 300)) {
42
+ return { status, diagnostics: firstOperationOutcomeDiagnostics(outcome || candidate) };
43
+ }
44
+ if (candidate.resourceType === 'OperationOutcome') {
45
+ const issue = firstFailedIssue(candidate.issue);
46
+ if (issue)
47
+ return { status, diagnostics: issue };
48
+ }
49
+ }
50
+ return undefined;
51
+ }
52
+ function firstOperationOutcomeDiagnostics(value) {
53
+ for (const candidate of nestedRecords(value)) {
54
+ if (candidate.resourceType !== 'OperationOutcome')
55
+ continue;
56
+ const diagnostics = firstFailedIssue(candidate.issue);
57
+ if (diagnostics)
58
+ return diagnostics;
59
+ }
60
+ return undefined;
61
+ }
62
+ function firstFailedIssue(value) {
63
+ if (!Array.isArray(value))
64
+ return undefined;
65
+ for (const issue of value) {
66
+ const candidate = record(issue);
67
+ const severity = String(candidate?.severity || '').trim().toLowerCase();
68
+ if (severity !== 'error' && severity !== 'fatal')
69
+ continue;
70
+ const diagnostics = String(candidate?.diagnostics || '').trim();
71
+ if (diagnostics)
72
+ return diagnostics;
73
+ }
74
+ return undefined;
75
+ }
76
+ function parseHttpStatus(value) {
77
+ const match = String(value || '').match(/^\s*(\d{3})/);
78
+ return match ? Number(match[1]) : undefined;
79
+ }
80
+ function nestedRecords(root) {
81
+ const records = [];
82
+ const pending = [root];
83
+ const visited = new Set();
84
+ while (pending.length > 0) {
85
+ const value = pending.shift();
86
+ if (!value || typeof value !== 'object' || visited.has(value))
87
+ continue;
88
+ visited.add(value);
89
+ if (Array.isArray(value)) {
90
+ pending.push(...value);
91
+ continue;
92
+ }
93
+ const candidate = value;
94
+ records.push(candidate);
95
+ pending.push(...Object.values(candidate));
96
+ }
97
+ return records;
98
+ }
99
+ function record(value) {
100
+ return value && typeof value === 'object' && !Array.isArray(value)
101
+ ? value
102
+ : undefined;
103
+ }
15
104
  /** Lists employees and their installation allowance through one typed projection. */
16
105
  export async function listOrganizationEmployeeLifecycleWithDeps(routeContext, deps) {
17
106
  const [employees, licenses] = await Promise.all([
@@ -133,6 +133,15 @@ export type IndividualMemberLicenseAddInput = {
133
133
  intervalMs?: number;
134
134
  };
135
135
  };
136
+ /** Adds zero-cost employee seats on an explicitly configured test network. */
137
+ export type OrganizationEmployeeLicenseAddInput = {
138
+ quantity: number;
139
+ requestThid?: string;
140
+ pollOptions?: {
141
+ timeoutMs?: number;
142
+ intervalMs?: number;
143
+ };
144
+ };
136
145
  /** Input shared by invitation acceptance, deactivation and release. */
137
146
  export type IndividualMemberLicenseTransitionInput = {
138
147
  /** Required for controller deactivation/release; acceptance resolves by code. */
@@ -655,6 +664,17 @@ type IndividualLicenseMutationDeps = {
655
664
  intervalMs?: number;
656
665
  }) => Promise<SubmitAndPollResult>;
657
666
  };
667
+ type OrganizationLicenseMutationDeps = {
668
+ organizationLicenseActionPath: (ctx: RouteContext, action: string) => string;
669
+ organizationLicenseActionPollPath: (ctx: RouteContext, action: string) => string;
670
+ submitAndPoll: IndividualLicenseMutationDeps['submitAndPoll'];
671
+ };
672
+ /**
673
+ * Requests additional zero-cost employee seats from a GW test-network.
674
+ * Production callers must use the provider-payment and confirmed Order flow;
675
+ * the gateway enforces that environment boundary independently of this SDK.
676
+ */
677
+ export declare function addFreeOrganizationEmployeeLicensesWithDeps(routeCtx: RouteContext, input: OrganizationEmployeeLicenseAddInput, deps: OrganizationLicenseMutationDeps): Promise<SubmitAndPollResult>;
658
678
  /**
659
679
  * Reserves one available household/member seat for a selected contact.
660
680
  *
@@ -243,6 +243,24 @@ export async function searchIndividualLicensesWithDeps(routeCtx, input, deps) {
243
243
  export async function listIndividualLicensesWithDeps(routeCtx, input, deps) {
244
244
  return searchIndividualLicensesWithDeps(routeCtx, input || {}, deps);
245
245
  }
246
+ /**
247
+ * Requests additional zero-cost employee seats from a GW test-network.
248
+ * Production callers must use the provider-payment and confirmed Order flow;
249
+ * the gateway enforces that environment boundary independently of this SDK.
250
+ */
251
+ export async function addFreeOrganizationEmployeeLicensesWithDeps(routeCtx, input, deps) {
252
+ const entry = buildLicensePurchaseEntry({
253
+ quantity: input.quantity,
254
+ userClass: 'employee',
255
+ type: 'web',
256
+ price: 0,
257
+ priceCurrency: 'EUR',
258
+ });
259
+ return deps.submitAndPoll(deps.organizationLicenseActionPath(routeCtx, '_add'), deps.organizationLicenseActionPollPath(routeCtx, '_add'), {
260
+ thid: input.requestThid || `organization-license-add-${createRuntimeUuid()}`,
261
+ body: { resourceType: 'Bundle', type: 'batch', data: [entry] },
262
+ }, input.pollOptions);
263
+ }
246
264
  /**
247
265
  * Reserves one available household/member seat for a selected contact.
248
266
  *
@@ -32,6 +32,10 @@ export declare class RuntimeClientPaths {
32
32
  employeeSearchPollPath(ctx?: RouteContext): string;
33
33
  organizationLicenseSearchPath(ctx?: RouteContext): string;
34
34
  organizationLicenseSearchPollPath(ctx?: RouteContext): string;
35
+ /** Builds one legal-organization license mutation path. */
36
+ organizationLicenseActionPath(ctx: RouteContext | undefined, action: string): string;
37
+ /** Builds the poll path paired with a legal-organization license mutation. */
38
+ organizationLicenseActionPollPath(ctx: RouteContext | undefined, action: string): string;
35
39
  organizationDidBindingPath(ctx?: RouteContext): string;
36
40
  organizationDidBindingPollPath(ctx?: RouteContext): string;
37
41
  organizationLicenseOfferSearchPath(ctx?: RouteContext): string;
@@ -46,6 +46,10 @@ export class RuntimeClientPaths {
46
46
  employeeSearchPollPath(ctx) { return this.v1Path(ctx, 'entity', 'org.schema', 'Employee', '_search-response'); }
47
47
  organizationLicenseSearchPath(ctx) { return this.v1Path(ctx, 'entity', 'org.schema', 'License', '_search'); }
48
48
  organizationLicenseSearchPollPath(ctx) { return this.v1Path(ctx, 'entity', 'org.schema', 'License', '_search-response'); }
49
+ /** Builds one legal-organization license mutation path. */
50
+ organizationLicenseActionPath(ctx, action) { return this.v1Path(ctx, 'entity', 'org.schema', 'License', action); }
51
+ /** Builds the poll path paired with a legal-organization license mutation. */
52
+ organizationLicenseActionPollPath(ctx, action) { return this.v1Path(ctx, 'entity', 'org.schema', 'License', `${action}-response`); }
49
53
  organizationDidBindingPath(ctx) { return buildOrganizationDidBindingPath(this.requireRouteContext(ctx)); }
50
54
  organizationDidBindingPollPath(ctx) { return buildOrganizationDidBindingPollPath(this.requireRouteContext(ctx)); }
51
55
  organizationLicenseOfferSearchPath(ctx) { return this.v1Path(ctx, 'entity', 'org.schema', 'Offer', '_search'); }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gdc-sdk-node-ts",
3
- "version": "2.4.9",
3
+ "version": "2.4.10",
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.",