gdc-sdk-node-ts 2.4.22 → 2.4.23

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.
@@ -7,6 +7,8 @@
7
7
  * is actually deployed.
8
8
  */
9
9
  export declare const GwCoreLifecycleAction: Readonly<{
10
+ readonly Create: "_create";
11
+ readonly CreateResponse: "_create-response";
10
12
  readonly Batch: "_batch";
11
13
  readonly BatchResponse: "_batch-response";
12
14
  readonly Issue: "_issue";
@@ -9,6 +9,8 @@ import { LifecycleRequestType } from 'gdc-common-utils-ts';
9
9
  * is actually deployed.
10
10
  */
11
11
  export const GwCoreLifecycleAction = Object.freeze({
12
+ Create: '_create',
13
+ CreateResponse: '_create-response',
12
14
  Batch: '_batch',
13
15
  BatchResponse: '_batch-response',
14
16
  Issue: '_issue',
@@ -477,8 +477,8 @@ export class HttpRuntimeClient {
477
477
  /** @deprecated Professional seats use Employee Offer and confirmed Order. */
478
478
  async addFreeOrganizationEmployeeLicenses(ctx, input) {
479
479
  return addFreeOrganizationEmployeeLicensesWithDeps(ctx, input, {
480
- organizationLicenseActionPath: this.paths.organizationLicenseActionPath.bind(this.paths),
481
- organizationLicenseActionPollPath: this.paths.organizationLicenseActionPollPath.bind(this.paths),
480
+ organizationLicenseOfferCreatePath: this.paths.organizationLicenseOfferCreatePath.bind(this.paths),
481
+ organizationLicenseOfferCreatePollPath: this.paths.organizationLicenseOfferCreatePollPath.bind(this.paths),
482
482
  submitAndPoll: this.transportProfile === TransportProfiles.DidcommEncryptedForm
483
483
  ? (submitPath, pollPath, payload, pollOptions) => this.submitClinicalMessageAndPoll(submitPath, pollPath, payload, this.transportProfile, pollOptions)
484
484
  : this.submitAndPoll.bind(this),
@@ -487,8 +487,8 @@ export class HttpRuntimeClient {
487
487
  /** Starts the commercial Offer flow for additional professional seats. */
488
488
  async requestOrganizationEmployeeLicenseOffer(ctx, input) {
489
489
  return requestOrganizationEmployeeLicenseOfferWithDeps(ctx, input, {
490
- organizationLicenseActionPath: this.paths.organizationLicenseActionPath.bind(this.paths),
491
- organizationLicenseActionPollPath: this.paths.organizationLicenseActionPollPath.bind(this.paths),
490
+ organizationLicenseOfferCreatePath: this.paths.organizationLicenseOfferCreatePath.bind(this.paths),
491
+ organizationLicenseOfferCreatePollPath: this.paths.organizationLicenseOfferCreatePollPath.bind(this.paths),
492
492
  submitAndPoll: this.transportProfile === TransportProfiles.DidcommEncryptedForm
493
493
  ? (submitPath, pollPath, payload, pollOptions) => this.submitClinicalMessageAndPoll(submitPath, pollPath, payload, this.transportProfile, pollOptions)
494
494
  : this.submitAndPoll.bind(this),
@@ -540,7 +540,9 @@ export class HttpRuntimeClient {
540
540
  defaultIntervalMs: pollOptions?.intervalMs,
541
541
  hostRegistryOrderBatchPath: this.paths.hostRegistryOrderBatchPath.bind(this.paths),
542
542
  hostRegistryOrderPollPath: this.paths.hostRegistryOrderPollPath.bind(this.paths),
543
- submitAndPoll: this.submitAndPoll.bind(this),
543
+ submitAndPoll: this.transportProfile === TransportProfiles.DidcommEncryptedForm
544
+ ? (submitPath, pollPath, payload, options) => this.submitClinicalMessageAndPoll(submitPath, pollPath, payload, this.transportProfile, options)
545
+ : this.submitAndPoll.bind(this),
544
546
  });
545
547
  }
546
548
  /**
@@ -937,7 +939,13 @@ export class HttpRuntimeClient {
937
939
  const renderedSubmit = await renderGatewayMessageRequest(payload, profile, this.secureTransportAdapter);
938
940
  const submit = await postRenderedWithRuntimeConfig(transportConfig, submitPath, renderedSubmit);
939
941
  const poll = await pollUntilCompleteWithMethod(async (path, request) => {
940
- const renderedPoll = await renderTransportPollRequest(request.thid, profile, this.secureTransportAdapter);
942
+ const renderedPoll = profile === TransportProfiles.DidcommEncryptedForm
943
+ ? await renderGatewayMessageRequest({
944
+ thid: request.thid,
945
+ ...(typeof payload.iss === 'string' ? { iss: payload.iss } : {}),
946
+ ...(typeof payload.aud === 'string' ? { aud: payload.aud } : {}),
947
+ }, profile, this.secureTransportAdapter)
948
+ : await renderTransportPollRequest(request.thid, profile, this.secureTransportAdapter);
941
949
  const response = await postRenderedWithRuntimeConfig(transportConfig, path, renderedPoll);
942
950
  return {
943
951
  status: response.status,
@@ -18,6 +18,8 @@ import type { RouteContext } from './individual-onboarding.js';
18
18
  * runtime adapts that higher-level intent onto the current host route
19
19
  */
20
20
  export type OrganizationLicenseOrderConfirmInput = Readonly<{
21
+ /** Exact DCR-registered controller DID that signs the protected request. */
22
+ issuerDid: string;
21
23
  offerId: string;
22
24
  hostNetwork?: string;
23
25
  dataType?: string;
@@ -5,6 +5,10 @@ export async function confirmOrganizationLicenseOrderWithDeps(deps) {
5
5
  if (!offerId) {
6
6
  throw new Error('confirmOrganizationLicenseOrder requires offerId.');
7
7
  }
8
+ const issuerDid = String(deps.input.issuerDid || '').trim();
9
+ if (!issuerDid) {
10
+ throw new Error('confirmOrganizationLicenseOrder requires issuerDid.');
11
+ }
8
12
  const claims = {
9
13
  '@context': 'org.schema',
10
14
  'Order.acceptedOffer.identifier': offerId,
@@ -16,7 +20,7 @@ export async function confirmOrganizationLicenseOrderWithDeps(deps) {
16
20
  };
17
21
  const payload = {
18
22
  jti: `jti-${createRuntimeUuid()}`,
19
- iss: deps.routeCtx.tenantId,
23
+ iss: issuerDid,
20
24
  aud: deps.routeCtx.tenantId,
21
25
  type: 'application/didcomm-plain+json',
22
26
  thid: `organization-license-order-${createRuntimeUuid()}`,
@@ -135,6 +135,8 @@ export type IndividualMemberLicenseAddInput = {
135
135
  };
136
136
  /** Requests a host-authored Offer for additional professional employee seats. */
137
137
  export type OrganizationEmployeeLicenseOfferInput = {
138
+ /** Exact DCR-registered controller DID that signs the protected request. */
139
+ issuerDid: string;
138
140
  quantity: number;
139
141
  requestThid?: string;
140
142
  pollOptions?: {
@@ -667,8 +669,8 @@ type IndividualLicenseMutationDeps = {
667
669
  }) => Promise<SubmitAndPollResult>;
668
670
  };
669
671
  type OrganizationLicenseMutationDeps = {
670
- organizationLicenseActionPath: (ctx: RouteContext, action: string) => string;
671
- organizationLicenseActionPollPath: (ctx: RouteContext, action: string) => string;
672
+ organizationLicenseOfferCreatePath: (ctx: RouteContext) => string;
673
+ organizationLicenseOfferCreatePollPath: (ctx: RouteContext) => string;
672
674
  submitAndPoll: IndividualLicenseMutationDeps['submitAndPoll'];
673
675
  };
674
676
  /**
@@ -253,7 +253,14 @@ export async function requestOrganizationEmployeeLicenseOfferWithDeps(routeCtx,
253
253
  userClass: 'employee',
254
254
  type: 'web',
255
255
  });
256
- return deps.submitAndPoll(deps.organizationLicenseActionPath(routeCtx, '_add'), deps.organizationLicenseActionPollPath(routeCtx, '_add'), {
256
+ const issuerDid = String(input.issuerDid || '').trim();
257
+ if (!issuerDid)
258
+ throw new Error('requestOrganizationEmployeeLicenseOffer requires issuerDid.');
259
+ return deps.submitAndPoll(deps.organizationLicenseOfferCreatePath(routeCtx), deps.organizationLicenseOfferCreatePollPath(routeCtx), {
260
+ jti: `jti-${createRuntimeUuid()}`,
261
+ iss: issuerDid,
262
+ aud: routeCtx.tenantId,
263
+ type: 'application/didcomm-plain+json',
257
264
  thid: input.requestThid || `organization-license-offer-${createRuntimeUuid()}`,
258
265
  body: { resourceType: 'Bundle', type: 'batch', data: [entry] },
259
266
  }, input.pollOptions);
@@ -40,6 +40,9 @@ export declare class RuntimeClientPaths {
40
40
  organizationDidBindingPollPath(ctx?: RouteContext): string;
41
41
  organizationLicenseOfferSearchPath(ctx?: RouteContext): string;
42
42
  organizationLicenseOfferSearchPollPath(ctx?: RouteContext): string;
43
+ /** Host-authored professional seat Offer creation; this never mutates License inventory. */
44
+ organizationLicenseOfferCreatePath(ctx?: RouteContext): string;
45
+ organizationLicenseOfferCreatePollPath(ctx?: RouteContext): string;
43
46
  organizationLicenseOrderSearchPath(ctx?: RouteContext): string;
44
47
  organizationLicenseOrderSearchPollPath(ctx?: RouteContext): string;
45
48
  employeePurgePath(ctx?: RouteContext): string;
@@ -54,6 +54,9 @@ export class RuntimeClientPaths {
54
54
  organizationDidBindingPollPath(ctx) { return buildOrganizationDidBindingPollPath(this.requireRouteContext(ctx)); }
55
55
  organizationLicenseOfferSearchPath(ctx) { return this.v1Path(ctx, 'entity', 'org.schema', 'Offer', '_search'); }
56
56
  organizationLicenseOfferSearchPollPath(ctx) { return this.v1Path(ctx, 'entity', 'org.schema', 'Offer', '_search-response'); }
57
+ /** Host-authored professional seat Offer creation; this never mutates License inventory. */
58
+ organizationLicenseOfferCreatePath(ctx) { return this.v1Path(ctx, 'entity', 'org.schema', 'Offer', GwCoreLifecycleAction.Create); }
59
+ organizationLicenseOfferCreatePollPath(ctx) { return this.v1Path(ctx, 'entity', 'org.schema', 'Offer', GwCoreLifecycleAction.CreateResponse); }
57
60
  organizationLicenseOrderSearchPath(ctx) { return this.v1Path(ctx, 'entity', 'org.schema', 'Order', '_search'); }
58
61
  organizationLicenseOrderSearchPollPath(ctx) { return this.v1Path(ctx, 'entity', 'org.schema', 'Order', '_search-response'); }
59
62
  employeePurgePath(ctx) { return this.v1Path(ctx, 'entity', 'org.schema', 'Employee', GwCoreLifecycleAction.Purge); }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gdc-sdk-node-ts",
3
- "version": "2.4.22",
3
+ "version": "2.4.23",
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.",