gdc-sdk-node-ts 0.3.1 → 0.4.0
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.
- package/README.md +1 -0
- package/dist/constants/lifecycle.d.ts +42 -0
- package/dist/constants/lifecycle.js +43 -0
- package/dist/gdc-session-bridge.js +23 -10
- package/dist/individual-start.js +2 -1
- package/dist/node-runtime-client.d.ts +67 -1
- package/dist/node-runtime-client.js +110 -7
- package/dist/orchestration/capability-guard.d.ts +9 -0
- package/dist/orchestration/capability-guard.js +15 -0
- package/dist/orchestration/client-port.d.ts +11 -1
- package/dist/orchestration/individual-controller-sdk.d.ts +34 -2
- package/dist/orchestration/individual-controller-sdk.js +53 -1
- package/dist/orchestration/organization-controller-sdk.d.ts +20 -2
- package/dist/orchestration/organization-controller-sdk.js +33 -1
- package/dist/resource-operations.d.ts +108 -0
- package/dist/resource-operations.js +98 -15
- package/dist/session.d.ts +2 -2
- package/dist/session.js +9 -8
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -41,6 +41,7 @@ If you need the shortest path:
|
|
|
41
41
|
`appId` mandatory, `appVersion` optional with default `v1.0`
|
|
42
42
|
- backend technical identity:
|
|
43
43
|
[`initializeCommunicationIdentity(...)`](./docs/SDK_INTEGRATION_101.md)
|
|
44
|
+
for the technical channel/runtime identity, not the legal organization id
|
|
44
45
|
- runtime client:
|
|
45
46
|
[`NodeHttpClient`](src/node-runtime-client.ts)
|
|
46
47
|
- step-by-step runtime usage:
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GW CORE lifecycle route/action tokens used by the Node runtime SDK.
|
|
3
|
+
*
|
|
4
|
+
* These constants intentionally model the currently deployed GW CORE contract.
|
|
5
|
+
* Do not rewrite them to the target normalized `PATCH` contract until the
|
|
6
|
+
* backend migration described in `gwtemplate-node-ts/docs/90.L-LIFECYCLE_CURRENT_VS_TARGET.md`
|
|
7
|
+
* is actually deployed.
|
|
8
|
+
*/
|
|
9
|
+
export declare const GwCoreLifecycleAction: Readonly<{
|
|
10
|
+
readonly Batch: "_batch";
|
|
11
|
+
readonly BatchResponse: "_batch-response";
|
|
12
|
+
readonly Transaction: "_transaction";
|
|
13
|
+
readonly TransactionResponse: "_transaction-response";
|
|
14
|
+
readonly Disable: "_disable";
|
|
15
|
+
readonly Purge: "_purge";
|
|
16
|
+
}>;
|
|
17
|
+
/**
|
|
18
|
+
* Entry request methods currently used by GW CORE lifecycle handlers.
|
|
19
|
+
*/
|
|
20
|
+
export declare const GwCoreLifecycleRequestMethod: Readonly<{
|
|
21
|
+
readonly Post: "POST";
|
|
22
|
+
readonly Delete: "DELETE";
|
|
23
|
+
}>;
|
|
24
|
+
/**
|
|
25
|
+
* Stable request type ids for the currently deployed GW CORE lifecycle flows.
|
|
26
|
+
*/
|
|
27
|
+
export declare const GwCoreLifecycleRequestType: Readonly<{
|
|
28
|
+
readonly EmployeeCreate: "Employee-create-request-v1.0";
|
|
29
|
+
readonly EmployeeDisable: "Employee-disable-request-v1.0";
|
|
30
|
+
readonly EmployeePurge: "Employee-purge-request-v1.0";
|
|
31
|
+
readonly IndividualOrganizationRegistration: "SubjectOrg-registration-form-v1.0";
|
|
32
|
+
readonly IndividualOrganizationDisable: "Family-disable-request-v1.0";
|
|
33
|
+
readonly IndividualOrganizationPurge: "Family-purge-request-v1.0";
|
|
34
|
+
}>;
|
|
35
|
+
/**
|
|
36
|
+
* Named TODO ids kept close to the current lifecycle implementation so the
|
|
37
|
+
* target-contract migration is easy to track later.
|
|
38
|
+
*/
|
|
39
|
+
export declare const GwCoreLifecycleTodo: Readonly<{
|
|
40
|
+
readonly EmployeeDisablePatchMigration: "TODO(gw-core-lifecycle-target-patch-employee-disable)";
|
|
41
|
+
readonly IndividualDisablePatchMigration: "TODO(gw-core-lifecycle-target-patch-individual-disable)";
|
|
42
|
+
}>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
|
|
2
|
+
/**
|
|
3
|
+
* GW CORE lifecycle route/action tokens used by the Node runtime SDK.
|
|
4
|
+
*
|
|
5
|
+
* These constants intentionally model the currently deployed GW CORE contract.
|
|
6
|
+
* Do not rewrite them to the target normalized `PATCH` contract until the
|
|
7
|
+
* backend migration described in `gwtemplate-node-ts/docs/90.L-LIFECYCLE_CURRENT_VS_TARGET.md`
|
|
8
|
+
* is actually deployed.
|
|
9
|
+
*/
|
|
10
|
+
export const GwCoreLifecycleAction = Object.freeze({
|
|
11
|
+
Batch: '_batch',
|
|
12
|
+
BatchResponse: '_batch-response',
|
|
13
|
+
Transaction: '_transaction',
|
|
14
|
+
TransactionResponse: '_transaction-response',
|
|
15
|
+
Disable: '_disable',
|
|
16
|
+
Purge: '_purge',
|
|
17
|
+
});
|
|
18
|
+
/**
|
|
19
|
+
* Entry request methods currently used by GW CORE lifecycle handlers.
|
|
20
|
+
*/
|
|
21
|
+
export const GwCoreLifecycleRequestMethod = Object.freeze({
|
|
22
|
+
Post: 'POST',
|
|
23
|
+
Delete: 'DELETE',
|
|
24
|
+
});
|
|
25
|
+
/**
|
|
26
|
+
* Stable request type ids for the currently deployed GW CORE lifecycle flows.
|
|
27
|
+
*/
|
|
28
|
+
export const GwCoreLifecycleRequestType = Object.freeze({
|
|
29
|
+
EmployeeCreate: 'Employee-create-request-v1.0',
|
|
30
|
+
EmployeeDisable: 'Employee-disable-request-v1.0',
|
|
31
|
+
EmployeePurge: 'Employee-purge-request-v1.0',
|
|
32
|
+
IndividualOrganizationRegistration: 'SubjectOrg-registration-form-v1.0',
|
|
33
|
+
IndividualOrganizationDisable: 'Family-disable-request-v1.0',
|
|
34
|
+
IndividualOrganizationPurge: 'Family-purge-request-v1.0',
|
|
35
|
+
});
|
|
36
|
+
/**
|
|
37
|
+
* Named TODO ids kept close to the current lifecycle implementation so the
|
|
38
|
+
* target-contract migration is easy to track later.
|
|
39
|
+
*/
|
|
40
|
+
export const GwCoreLifecycleTodo = Object.freeze({
|
|
41
|
+
EmployeeDisablePatchMigration: 'TODO(gw-core-lifecycle-target-patch-employee-disable)',
|
|
42
|
+
IndividualDisablePatchMigration: 'TODO(gw-core-lifecycle-target-patch-individual-disable)',
|
|
43
|
+
});
|
|
@@ -1,17 +1,30 @@
|
|
|
1
1
|
// Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
|
|
2
|
+
import { ActorCapabilities } from 'gdc-common-utils-ts/constants/actor-session';
|
|
2
3
|
import { expandActorSessionDescriptorToFacades, filterCapabilitiesForActor, } from 'gdc-sdk-core-ts';
|
|
3
4
|
import { ActorSession, NodeActorSession } from './session.js';
|
|
4
5
|
const capabilityMap = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
[ActorCapabilities.HostActivateOrganization]: ActorCapabilities.HostActivateOrganization,
|
|
7
|
+
[ActorCapabilities.HostConfirmOrder]: ActorCapabilities.HostConfirmOrder,
|
|
8
|
+
[ActorCapabilities.OrganizationCreateEmployee]: ActorCapabilities.OrganizationCreateEmployee,
|
|
9
|
+
[ActorCapabilities.OrganizationActivateDevice]: ActorCapabilities.OrganizationActivateDevice,
|
|
10
|
+
[ActorCapabilities.OrganizationIssueActivationCode]: ActorCapabilities.OrganizationIssueActivationCode,
|
|
11
|
+
[ActorCapabilities.OrganizationRequestSmartToken]: ActorCapabilities.OrganizationRequestSmartToken,
|
|
12
|
+
[ActorCapabilities.OrganizationDisableEmployee]: ActorCapabilities.OrganizationDisableEmployee,
|
|
13
|
+
[ActorCapabilities.OrganizationPurgeEmployee]: ActorCapabilities.OrganizationPurgeEmployee,
|
|
14
|
+
[ActorCapabilities.IndividualBootstrap]: ActorCapabilities.IndividualBootstrap,
|
|
15
|
+
[ActorCapabilities.IndividualDisable]: ActorCapabilities.IndividualDisable,
|
|
16
|
+
[ActorCapabilities.IndividualPurge]: ActorCapabilities.IndividualPurge,
|
|
17
|
+
[ActorCapabilities.IndividualImportIps]: ActorCapabilities.IndividualImportIps,
|
|
18
|
+
[ActorCapabilities.IndividualGenerateDigitalTwin]: ActorCapabilities.IndividualGenerateDigitalTwin,
|
|
19
|
+
[ActorCapabilities.IndividualIngestCommunication]: ActorCapabilities.IndividualIngestCommunication,
|
|
20
|
+
[ActorCapabilities.IndividualUpsertRelatedPerson]: ActorCapabilities.IndividualUpsertRelatedPerson,
|
|
21
|
+
[ActorCapabilities.IndividualMemberDisable]: ActorCapabilities.IndividualMemberDisable,
|
|
22
|
+
[ActorCapabilities.IndividualMemberPurge]: ActorCapabilities.IndividualMemberPurge,
|
|
23
|
+
[ActorCapabilities.ConsentGrantProfessionalAccess]: ActorCapabilities.ConsentGrantProfessionalAccess,
|
|
24
|
+
[ActorCapabilities.ProfessionalMedication]: ActorCapabilities.ProfessionalMedication,
|
|
25
|
+
[ActorCapabilities.ProfessionalAppointment]: ActorCapabilities.ProfessionalAppointment,
|
|
26
|
+
[ActorCapabilities.ProfessionalRequestSmartToken]: ActorCapabilities.ProfessionalRequestSmartToken,
|
|
27
|
+
[ActorCapabilities.TokenRequestSmart]: ActorCapabilities.TokenRequestSmart,
|
|
15
28
|
};
|
|
16
29
|
function mapCapabilities(capabilities) {
|
|
17
30
|
return [...new Set(capabilities.map(capability => capabilityMap[capability]))];
|
package/dist/individual-start.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
|
|
2
2
|
import { ClaimsOrganizationSchemaorg, ClaimsPersonSchemaorg, ClaimsServiceSchemaorg, } from 'gdc-common-utils-ts/constants';
|
|
3
|
+
import { GwCoreLifecycleRequestType } from './constants/lifecycle.js';
|
|
3
4
|
import { resolvePollOptionsFromSeconds } from './poll-options.js';
|
|
4
5
|
export async function startIndividualOrganizationWithDeps(deps) {
|
|
5
6
|
/**
|
|
@@ -51,7 +52,7 @@ export async function startIndividualOrganizationWithDeps(deps) {
|
|
|
51
52
|
thid: `family-org-${createRuntimeUuid()}`,
|
|
52
53
|
body: {
|
|
53
54
|
data: [{
|
|
54
|
-
type:
|
|
55
|
+
type: GwCoreLifecycleRequestType.IndividualOrganizationRegistration,
|
|
55
56
|
meta: { claims },
|
|
56
57
|
resource: { meta: { claims } },
|
|
57
58
|
}],
|
|
@@ -5,7 +5,7 @@ import type { NodeOrganizationActivationInput } from './orchestration/client-por
|
|
|
5
5
|
import { type IndividualOrganizationConfirmOrderInput, type RouteContext } from './individual-onboarding.js';
|
|
6
6
|
import { type SmartTokenRequestInput } from './smart-token.js';
|
|
7
7
|
import { type IndividualOrganizationBootstrapInput, type IndividualOrganizationStartResult } from './individual-start.js';
|
|
8
|
-
import { type CommunicationIngestionInput, type ClinicalBundleSearchInput, type GrantProfessionalAccessInput, type GrantProfessionalAccessResult, type OrganizationEmployeeCreationInput, type RelatedPersonUpsertInput } from './resource-operations.js';
|
|
8
|
+
import { type CommunicationIngestionInput, type ClinicalBundleSearchInput, type GrantProfessionalAccessInput, type GrantProfessionalAccessResult, type IndividualMemberLifecycleInput, type IndividualOrganizationLifecycleInput, type OrganizationEmployeeCreationInput, type OrganizationEmployeeLifecycleInput, type RelatedPersonUpsertInput } from './resource-operations.js';
|
|
9
9
|
import type { LegalOrganizationOrderInput } from './host-onboarding.js';
|
|
10
10
|
import type { SmartTokenExchangeResult } from './smart-token.js';
|
|
11
11
|
import type { NodeRuntimeClient, PollOptions, PollResult, SubmitAndPollResult, SubmitPayload, SubmitResponse } from './orchestration/client-port.js';
|
|
@@ -100,6 +100,28 @@ export declare class HttpRuntimeClient implements NodeRuntimeClient {
|
|
|
100
100
|
* Creates an employee or professional entry under an existing organization tenant.
|
|
101
101
|
*/
|
|
102
102
|
createOrganizationEmployee(ctx: RouteContext, input: OrganizationEmployeeCreationInput, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
|
|
103
|
+
/**
|
|
104
|
+
* Disables an employee using the current GW CORE contract.
|
|
105
|
+
*
|
|
106
|
+
* Current live behavior still uses `Employee/_batch` with entry
|
|
107
|
+
* `request.method = DELETE`. This intentionally does not release licenses.
|
|
108
|
+
*/
|
|
109
|
+
disableOrganizationEmployee(ctx: RouteContext, input: OrganizationEmployeeLifecycleInput, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
|
|
110
|
+
/**
|
|
111
|
+
* Preferred public alias for employee disable in the current SDK surface.
|
|
112
|
+
*/
|
|
113
|
+
disableEmployee(ctx: RouteContext, input: OrganizationEmployeeLifecycleInput, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
|
|
114
|
+
/**
|
|
115
|
+
* Purges an inactive employee using the current GW CORE explicit purge route.
|
|
116
|
+
*
|
|
117
|
+
* Purge preserves traceability and releases/disassociates licenses only after
|
|
118
|
+
* the employee is already inactive.
|
|
119
|
+
*/
|
|
120
|
+
purgeOrganizationEmployee(ctx: RouteContext, input: OrganizationEmployeeLifecycleInput, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
|
|
121
|
+
/**
|
|
122
|
+
* Preferred public alias for employee purge in the current SDK surface.
|
|
123
|
+
*/
|
|
124
|
+
purgeEmployee(ctx: RouteContext, input: OrganizationEmployeeLifecycleInput, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
|
|
103
125
|
/**
|
|
104
126
|
* Starts the onboarding flow for an individual-oriented tenant or index.
|
|
105
127
|
*/
|
|
@@ -108,6 +130,42 @@ export declare class HttpRuntimeClient implements NodeRuntimeClient {
|
|
|
108
130
|
* Confirms the order returned by `startIndividualOrganization(...)`.
|
|
109
131
|
*/
|
|
110
132
|
confirmIndividualOrganizationOrder(input: IndividualOrganizationConfirmOrderInput): Promise<SubmitAndPollResult>;
|
|
133
|
+
/**
|
|
134
|
+
* Disables a hosted individual/family organization without releasing licenses.
|
|
135
|
+
*
|
|
136
|
+
* This follows the current explicit GW CORE `_disable` route rather than the
|
|
137
|
+
* future normalized `_batch + PATCH` target contract.
|
|
138
|
+
*/
|
|
139
|
+
disableIndividualOrganization(ctx: RouteContext, input: IndividualOrganizationLifecycleInput, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
|
|
140
|
+
/**
|
|
141
|
+
* Preferred public alias for hosted individual/family disable.
|
|
142
|
+
*/
|
|
143
|
+
disableIndividual(ctx: RouteContext, input: IndividualOrganizationLifecycleInput, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
|
|
144
|
+
/**
|
|
145
|
+
* Purges an inactive hosted individual/family organization.
|
|
146
|
+
*
|
|
147
|
+
* Purge preserves the record for traceability and releases/disassociates
|
|
148
|
+
* licenses only after the registration is already inactive.
|
|
149
|
+
*/
|
|
150
|
+
purgeIndividualOrganization(ctx: RouteContext, input: IndividualOrganizationLifecycleInput, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
|
|
151
|
+
/**
|
|
152
|
+
* Preferred public alias for hosted individual/family purge.
|
|
153
|
+
*/
|
|
154
|
+
purgeIndividual(ctx: RouteContext, input: IndividualOrganizationLifecycleInput, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
|
|
155
|
+
/**
|
|
156
|
+
* Placeholder for a future GW CORE member/caregiver lifecycle contract.
|
|
157
|
+
*
|
|
158
|
+
* Current GW CORE does not yet expose a stable lifecycle route for
|
|
159
|
+
* `RelatedPerson` / individual-member disable.
|
|
160
|
+
*/
|
|
161
|
+
disableIndividualMember(_ctx: RouteContext, _input: IndividualMemberLifecycleInput, _pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
|
|
162
|
+
/**
|
|
163
|
+
* Placeholder for a future GW CORE member/caregiver lifecycle contract.
|
|
164
|
+
*
|
|
165
|
+
* Current GW CORE does not yet expose a stable lifecycle route for
|
|
166
|
+
* `RelatedPerson` / individual-member purge.
|
|
167
|
+
*/
|
|
168
|
+
purgeIndividualMember(_ctx: RouteContext, _input: IndividualMemberLifecycleInput, _pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
|
|
111
169
|
/**
|
|
112
170
|
* Creates and submits a consent-oriented access grant for a professional actor.
|
|
113
171
|
*/
|
|
@@ -183,8 +241,16 @@ export declare class HttpRuntimeClient implements NodeRuntimeClient {
|
|
|
183
241
|
hostRegistryOrderPollPath(ctx?: HostRouteContext): string;
|
|
184
242
|
employeeBatchPath(ctx?: RouteContext): string;
|
|
185
243
|
employeePollPath(ctx?: RouteContext): string;
|
|
244
|
+
employeePurgePath(ctx?: RouteContext): string;
|
|
245
|
+
employeePurgePollPath(ctx?: RouteContext): string;
|
|
186
246
|
individualFamilyOrganizationBatchPath(ctx?: RouteContext): string;
|
|
187
247
|
individualFamilyOrganizationPollPath(ctx?: RouteContext): string;
|
|
248
|
+
individualFamilyOrganizationTransactionPath(ctx?: RouteContext): string;
|
|
249
|
+
individualFamilyOrganizationTransactionPollPath(ctx?: RouteContext): string;
|
|
250
|
+
individualFamilyOrganizationDisablePath(ctx?: RouteContext): string;
|
|
251
|
+
individualFamilyOrganizationDisablePollPath(ctx?: RouteContext): string;
|
|
252
|
+
individualFamilyOrganizationPurgePath(ctx?: RouteContext): string;
|
|
253
|
+
individualFamilyOrganizationPurgePollPath(ctx?: RouteContext): string;
|
|
188
254
|
individualFamilyOrderBatchPath(ctx?: RouteContext): string;
|
|
189
255
|
individualFamilyOrderPollPath(ctx?: RouteContext): string;
|
|
190
256
|
individualRelatedPersonBatchPath(ctx?: RouteContext): string;
|
|
@@ -9,8 +9,9 @@ import { confirmLegalOrganizationOrderWithDeps } from './host-onboarding.js';
|
|
|
9
9
|
import { confirmIndividualOrganizationOrderWithDeps, } from './individual-onboarding.js';
|
|
10
10
|
import { requestSmartTokenWithDeps } from './smart-token.js';
|
|
11
11
|
import { startIndividualOrganizationWithDeps } from './individual-start.js';
|
|
12
|
-
import { createOrganizationEmployeeWithDeps, grantProfessionalAccessWithDeps, ingestCommunicationAndUpdateIndexWithDeps, searchClinicalBundleWithDeps, searchLatestIpsWithDeps, upsertRelatedPersonAndPollWithDeps, } from './resource-operations.js';
|
|
12
|
+
import { createOrganizationEmployeeWithDeps, disableIndividualOrganizationWithDeps, disableOrganizationEmployeeWithDeps, grantProfessionalAccessWithDeps, ingestCommunicationAndUpdateIndexWithDeps, purgeIndividualOrganizationWithDeps, purgeOrganizationEmployeeWithDeps, searchClinicalBundleWithDeps, searchLatestIpsWithDeps, upsertRelatedPersonAndPollWithDeps, } from './resource-operations.js';
|
|
13
13
|
import { submitAndPollWithMethods } from './orchestration/client-port.js';
|
|
14
|
+
import { GwCoreLifecycleAction } from './constants/lifecycle.js';
|
|
14
15
|
const bootstrapFacade = createBootstrapFacade();
|
|
15
16
|
/**
|
|
16
17
|
* Runtime-oriented HTTP client for Node backends, BFFs, and workers that need
|
|
@@ -151,6 +152,44 @@ export class HttpRuntimeClient {
|
|
|
151
152
|
submitAndPoll: this.submitAndPoll.bind(this),
|
|
152
153
|
});
|
|
153
154
|
}
|
|
155
|
+
/**
|
|
156
|
+
* Disables an employee using the current GW CORE contract.
|
|
157
|
+
*
|
|
158
|
+
* Current live behavior still uses `Employee/_batch` with entry
|
|
159
|
+
* `request.method = DELETE`. This intentionally does not release licenses.
|
|
160
|
+
*/
|
|
161
|
+
async disableOrganizationEmployee(ctx, input, pollOptions) {
|
|
162
|
+
return disableOrganizationEmployeeWithDeps(ctx, input, pollOptions, {
|
|
163
|
+
employeeBatchPath: this.employeeBatchPath.bind(this),
|
|
164
|
+
employeePollPath: this.employeePollPath.bind(this),
|
|
165
|
+
submitAndPoll: this.submitAndPoll.bind(this),
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Preferred public alias for employee disable in the current SDK surface.
|
|
170
|
+
*/
|
|
171
|
+
async disableEmployee(ctx, input, pollOptions) {
|
|
172
|
+
return this.disableOrganizationEmployee(ctx, input, pollOptions);
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Purges an inactive employee using the current GW CORE explicit purge route.
|
|
176
|
+
*
|
|
177
|
+
* Purge preserves traceability and releases/disassociates licenses only after
|
|
178
|
+
* the employee is already inactive.
|
|
179
|
+
*/
|
|
180
|
+
async purgeOrganizationEmployee(ctx, input, pollOptions) {
|
|
181
|
+
return purgeOrganizationEmployeeWithDeps(ctx, input, pollOptions, {
|
|
182
|
+
employeePurgePath: this.employeePurgePath.bind(this),
|
|
183
|
+
employeePurgePollPath: this.employeePurgePollPath.bind(this),
|
|
184
|
+
submitAndPoll: this.submitAndPoll.bind(this),
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Preferred public alias for employee purge in the current SDK surface.
|
|
189
|
+
*/
|
|
190
|
+
async purgeEmployee(ctx, input, pollOptions) {
|
|
191
|
+
return this.purgeOrganizationEmployee(ctx, input, pollOptions);
|
|
192
|
+
}
|
|
154
193
|
/**
|
|
155
194
|
* Starts the onboarding flow for an individual-oriented tenant or index.
|
|
156
195
|
*/
|
|
@@ -159,8 +198,8 @@ export class HttpRuntimeClient {
|
|
|
159
198
|
return startIndividualOrganizationWithDeps({
|
|
160
199
|
input,
|
|
161
200
|
routeCtx,
|
|
162
|
-
individualFamilyOrganizationBatchPath: this.
|
|
163
|
-
individualFamilyOrganizationPollPath: this.
|
|
201
|
+
individualFamilyOrganizationBatchPath: this.individualFamilyOrganizationTransactionPath.bind(this),
|
|
202
|
+
individualFamilyOrganizationPollPath: this.individualFamilyOrganizationTransactionPollPath.bind(this),
|
|
164
203
|
submitAndPoll: this.submitAndPoll.bind(this),
|
|
165
204
|
getOfferIdFromResponse: (result) => this.extractOfferId(result.poll.body),
|
|
166
205
|
getOfferPreviewFromResponse: () => ({}),
|
|
@@ -179,6 +218,62 @@ export class HttpRuntimeClient {
|
|
|
179
218
|
submitAndPoll: this.submitAndPoll.bind(this),
|
|
180
219
|
});
|
|
181
220
|
}
|
|
221
|
+
/**
|
|
222
|
+
* Disables a hosted individual/family organization without releasing licenses.
|
|
223
|
+
*
|
|
224
|
+
* This follows the current explicit GW CORE `_disable` route rather than the
|
|
225
|
+
* future normalized `_batch + PATCH` target contract.
|
|
226
|
+
*/
|
|
227
|
+
async disableIndividualOrganization(ctx, input, pollOptions) {
|
|
228
|
+
return disableIndividualOrganizationWithDeps(ctx, input, pollOptions, {
|
|
229
|
+
individualOrganizationDisablePath: this.individualFamilyOrganizationDisablePath.bind(this),
|
|
230
|
+
individualOrganizationDisablePollPath: this.individualFamilyOrganizationDisablePollPath.bind(this),
|
|
231
|
+
submitAndPoll: this.submitAndPoll.bind(this),
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Preferred public alias for hosted individual/family disable.
|
|
236
|
+
*/
|
|
237
|
+
async disableIndividual(ctx, input, pollOptions) {
|
|
238
|
+
return this.disableIndividualOrganization(ctx, input, pollOptions);
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Purges an inactive hosted individual/family organization.
|
|
242
|
+
*
|
|
243
|
+
* Purge preserves the record for traceability and releases/disassociates
|
|
244
|
+
* licenses only after the registration is already inactive.
|
|
245
|
+
*/
|
|
246
|
+
async purgeIndividualOrganization(ctx, input, pollOptions) {
|
|
247
|
+
return purgeIndividualOrganizationWithDeps(ctx, input, pollOptions, {
|
|
248
|
+
individualOrganizationPurgePath: this.individualFamilyOrganizationPurgePath.bind(this),
|
|
249
|
+
individualOrganizationPurgePollPath: this.individualFamilyOrganizationPurgePollPath.bind(this),
|
|
250
|
+
submitAndPoll: this.submitAndPoll.bind(this),
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Preferred public alias for hosted individual/family purge.
|
|
255
|
+
*/
|
|
256
|
+
async purgeIndividual(ctx, input, pollOptions) {
|
|
257
|
+
return this.purgeIndividualOrganization(ctx, input, pollOptions);
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Placeholder for a future GW CORE member/caregiver lifecycle contract.
|
|
261
|
+
*
|
|
262
|
+
* Current GW CORE does not yet expose a stable lifecycle route for
|
|
263
|
+
* `RelatedPerson` / individual-member disable.
|
|
264
|
+
*/
|
|
265
|
+
async disableIndividualMember(_ctx, _input, _pollOptions) {
|
|
266
|
+
throw new Error('disableIndividualMember is not supported by the current GW CORE contract. TODO(gw-core-lifecycle-target-member-disable).');
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Placeholder for a future GW CORE member/caregiver lifecycle contract.
|
|
270
|
+
*
|
|
271
|
+
* Current GW CORE does not yet expose a stable lifecycle route for
|
|
272
|
+
* `RelatedPerson` / individual-member purge.
|
|
273
|
+
*/
|
|
274
|
+
async purgeIndividualMember(_ctx, _input, _pollOptions) {
|
|
275
|
+
throw new Error('purgeIndividualMember is not supported by the current GW CORE contract. TODO(gw-core-lifecycle-target-member-purge).');
|
|
276
|
+
}
|
|
182
277
|
/**
|
|
183
278
|
* Creates and submits a consent-oriented access grant for a professional actor.
|
|
184
279
|
*/
|
|
@@ -421,10 +516,18 @@ export class HttpRuntimeClient {
|
|
|
421
516
|
hostRegistryOrganizationActivatePollPath(ctx) { return this.hostRegistryPath(ctx, 'Organization', '_activate-response'); }
|
|
422
517
|
hostRegistryOrderBatchPath(ctx) { return this.hostRegistryPath(ctx, 'Order', '_batch'); }
|
|
423
518
|
hostRegistryOrderPollPath(ctx) { return this.hostRegistryPath(ctx, 'Order', '_batch-response'); }
|
|
424
|
-
employeeBatchPath(ctx) { return this.v1Path(ctx, 'entity', 'org.schema', 'Employee',
|
|
425
|
-
employeePollPath(ctx) { return this.v1Path(ctx, 'entity', 'org.schema', 'Employee',
|
|
426
|
-
|
|
427
|
-
|
|
519
|
+
employeeBatchPath(ctx) { return this.v1Path(ctx, 'entity', 'org.schema', 'Employee', GwCoreLifecycleAction.Batch); }
|
|
520
|
+
employeePollPath(ctx) { return this.v1Path(ctx, 'entity', 'org.schema', 'Employee', GwCoreLifecycleAction.BatchResponse); }
|
|
521
|
+
employeePurgePath(ctx) { return this.v1Path(ctx, 'entity', 'org.schema', 'Employee', GwCoreLifecycleAction.Purge); }
|
|
522
|
+
employeePurgePollPath(ctx) { return this.v1Path(ctx, 'entity', 'org.schema', 'Employee', `${GwCoreLifecycleAction.Purge}-response`); }
|
|
523
|
+
individualFamilyOrganizationBatchPath(ctx) { return this.v1Path(ctx, 'individual', 'org.schema', 'Organization', GwCoreLifecycleAction.Batch); }
|
|
524
|
+
individualFamilyOrganizationPollPath(ctx) { return this.v1Path(ctx, 'individual', 'org.schema', 'Organization', GwCoreLifecycleAction.BatchResponse); }
|
|
525
|
+
individualFamilyOrganizationTransactionPath(ctx) { return this.v1Path(ctx, 'individual', 'org.schema', 'Organization', GwCoreLifecycleAction.Transaction); }
|
|
526
|
+
individualFamilyOrganizationTransactionPollPath(ctx) { return this.v1Path(ctx, 'individual', 'org.schema', 'Organization', GwCoreLifecycleAction.TransactionResponse); }
|
|
527
|
+
individualFamilyOrganizationDisablePath(ctx) { return this.v1Path(ctx, 'individual', 'org.schema', 'Organization', GwCoreLifecycleAction.Disable); }
|
|
528
|
+
individualFamilyOrganizationDisablePollPath(ctx) { return this.v1Path(ctx, 'individual', 'org.schema', 'Organization', `${GwCoreLifecycleAction.Disable}-response`); }
|
|
529
|
+
individualFamilyOrganizationPurgePath(ctx) { return this.v1Path(ctx, 'individual', 'org.schema', 'Organization', GwCoreLifecycleAction.Purge); }
|
|
530
|
+
individualFamilyOrganizationPurgePollPath(ctx) { return this.v1Path(ctx, 'individual', 'org.schema', 'Organization', `${GwCoreLifecycleAction.Purge}-response`); }
|
|
428
531
|
individualFamilyOrderBatchPath(ctx) { return this.v1Path(ctx, 'individual', 'org.schema', 'Order', '_batch'); }
|
|
429
532
|
individualFamilyOrderPollPath(ctx) { return this.v1Path(ctx, 'individual', 'org.schema', 'Order', '_batch-response'); }
|
|
430
533
|
individualRelatedPersonBatchPath(ctx) { return this.v1Path(ctx, 'individual', 'org.hl7.fhir.r4', 'RelatedPerson', '_batch'); }
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { NodeCapability } from '../session.js';
|
|
2
|
+
/**
|
|
3
|
+
* Enforces actor-session capabilities on facade methods when the facade was
|
|
4
|
+
* materialized from an `ActorSession`.
|
|
5
|
+
*
|
|
6
|
+
* Direct facade construction without explicit capabilities stays permissive for
|
|
7
|
+
* backward compatibility with existing integrations.
|
|
8
|
+
*/
|
|
9
|
+
export declare function assertFacadeCapability(capabilities: readonly NodeCapability[] | undefined, requiredCapability: NodeCapability, actorLabel: string, methodName: string): void;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
|
|
2
|
+
/**
|
|
3
|
+
* Enforces actor-session capabilities on facade methods when the facade was
|
|
4
|
+
* materialized from an `ActorSession`.
|
|
5
|
+
*
|
|
6
|
+
* Direct facade construction without explicit capabilities stays permissive for
|
|
7
|
+
* backward compatibility with existing integrations.
|
|
8
|
+
*/
|
|
9
|
+
export function assertFacadeCapability(capabilities, requiredCapability, actorLabel, methodName) {
|
|
10
|
+
if (!capabilities)
|
|
11
|
+
return;
|
|
12
|
+
if (capabilities.includes(requiredCapability))
|
|
13
|
+
return;
|
|
14
|
+
throw new Error(`${actorLabel}.${methodName} requires capability '${requiredCapability}'.`);
|
|
15
|
+
}
|
|
@@ -6,7 +6,7 @@ import type { HostRouteContext, LegalOrganizationOrderInput } from '../host-onbo
|
|
|
6
6
|
import type { IndividualOrganizationConfirmOrderInput, RouteContext } from '../individual-onboarding.js';
|
|
7
7
|
import type { IndividualOrganizationBootstrapInput, IndividualOrganizationStartResult } from '../individual-start.js';
|
|
8
8
|
import type { SmartTokenExchangeResult, SmartTokenRequestInput } from '../smart-token.js';
|
|
9
|
-
import type { CommunicationIngestionInput, ClinicalBundleSearchInput, DigitalTwinGenerationInput, GrantProfessionalAccessInput, GrantProfessionalAccessResult, IpsOrFhirImportInput, OrganizationEmployeeCreationInput, RelatedPersonUpsertInput } from '../resource-operations.js';
|
|
9
|
+
import type { CommunicationIngestionInput, ClinicalBundleSearchInput, DigitalTwinGenerationInput, GrantProfessionalAccessInput, GrantProfessionalAccessResult, IndividualMemberLifecycleInput, IndividualOrganizationLifecycleInput, IpsOrFhirImportInput, OrganizationEmployeeCreationInput, OrganizationEmployeeLifecycleInput, RelatedPersonUpsertInput } from '../resource-operations.js';
|
|
10
10
|
/**
|
|
11
11
|
* Shared node-runtime activation input.
|
|
12
12
|
*
|
|
@@ -30,10 +30,20 @@ export type RuntimeClient = {
|
|
|
30
30
|
activateOrganizationInGatewayFromIcaProof?: (hostCtx: HostRouteContext, input: NodeOrganizationActivationInput, pollOptions?: PollOptions) => Promise<SubmitAndPollResult>;
|
|
31
31
|
confirmLegalOrganizationOrder?: (hostCtx: HostRouteContext, input: LegalOrganizationOrderInput, pollOptions?: PollOptions) => Promise<SubmitAndPollResult>;
|
|
32
32
|
createOrganizationEmployee?: (ctx: RouteContext, input: OrganizationEmployeeCreationInput, pollOptions?: PollOptions) => Promise<SubmitAndPollResult>;
|
|
33
|
+
disableEmployee?: (ctx: RouteContext, input: OrganizationEmployeeLifecycleInput, pollOptions?: PollOptions) => Promise<SubmitAndPollResult>;
|
|
34
|
+
purgeEmployee?: (ctx: RouteContext, input: OrganizationEmployeeLifecycleInput, pollOptions?: PollOptions) => Promise<SubmitAndPollResult>;
|
|
35
|
+
disableOrganizationEmployee?: (ctx: RouteContext, input: OrganizationEmployeeLifecycleInput, pollOptions?: PollOptions) => Promise<SubmitAndPollResult>;
|
|
36
|
+
purgeOrganizationEmployee?: (ctx: RouteContext, input: OrganizationEmployeeLifecycleInput, pollOptions?: PollOptions) => Promise<SubmitAndPollResult>;
|
|
33
37
|
activateEmployeeDeviceWithActivationRequest?: (input: EmployeeDeviceActivationRequestInput) => Promise<EmployeeDeviceActivationResult>;
|
|
34
38
|
requestSmartToken?: (input: SmartTokenRequestInput) => Promise<SmartTokenExchangeResult>;
|
|
35
39
|
startIndividualOrganization?: (input: IndividualOrganizationBootstrapInput) => Promise<IndividualOrganizationStartResult>;
|
|
36
40
|
confirmIndividualOrganizationOrder?: (input: IndividualOrganizationConfirmOrderInput) => Promise<SubmitAndPollResult>;
|
|
41
|
+
disableIndividual?: (ctx: RouteContext, input: IndividualOrganizationLifecycleInput, pollOptions?: PollOptions) => Promise<SubmitAndPollResult>;
|
|
42
|
+
purgeIndividual?: (ctx: RouteContext, input: IndividualOrganizationLifecycleInput, pollOptions?: PollOptions) => Promise<SubmitAndPollResult>;
|
|
43
|
+
disableIndividualMember?: (ctx: RouteContext, input: IndividualMemberLifecycleInput, pollOptions?: PollOptions) => Promise<SubmitAndPollResult>;
|
|
44
|
+
purgeIndividualMember?: (ctx: RouteContext, input: IndividualMemberLifecycleInput, pollOptions?: PollOptions) => Promise<SubmitAndPollResult>;
|
|
45
|
+
disableIndividualOrganization?: (ctx: RouteContext, input: IndividualOrganizationLifecycleInput, pollOptions?: PollOptions) => Promise<SubmitAndPollResult>;
|
|
46
|
+
purgeIndividualOrganization?: (ctx: RouteContext, input: IndividualOrganizationLifecycleInput, pollOptions?: PollOptions) => Promise<SubmitAndPollResult>;
|
|
37
47
|
ingestCommunicationAndUpdateIndex?: (ctx: RouteContext, input: CommunicationIngestionInput) => Promise<SubmitAndPollResult>;
|
|
38
48
|
grantProfessionalAccess?: (ctx: RouteContext, input: GrantProfessionalAccessInput) => Promise<GrantProfessionalAccessResult>;
|
|
39
49
|
bootstrapIndividualOrganization?: (input: IndividualOrganizationBootstrapInput) => Promise<IndividualOrganizationStartResult>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type NodeRuntimeClient, type PollOptions, type SubmitAndPollResult, type SubmitPayload } from './client-port.js';
|
|
2
2
|
import type { IndividualOrganizationConfirmOrderInput, RouteContext } from '../individual-onboarding.js';
|
|
3
3
|
import type { IndividualOrganizationBootstrapInput, IndividualOrganizationStartResult } from '../individual-start.js';
|
|
4
|
-
import type {
|
|
4
|
+
import type { NodeCapability } from '../session.js';
|
|
5
|
+
import type { CommunicationIngestionInput, DigitalTwinGenerationInput, GrantProfessionalAccessInput, GrantProfessionalAccessResult, IndividualMemberLifecycleInput, IndividualOrganizationLifecycleInput, IpsOrFhirImportInput, RelatedPersonUpsertInput } from '../resource-operations.js';
|
|
5
6
|
import type { SmartTokenExchangeResult, SmartTokenRequestInput } from '../smart-token.js';
|
|
6
7
|
/**
|
|
7
8
|
* Individual-controller oriented facade over a `NodeRuntimeClient`.
|
|
@@ -11,10 +12,11 @@ import type { SmartTokenExchangeResult, SmartTokenRequestInput } from '../smart-
|
|
|
11
12
|
*/
|
|
12
13
|
export declare class IndividualControllerSdk {
|
|
13
14
|
private readonly client;
|
|
15
|
+
private readonly capabilities?;
|
|
14
16
|
/**
|
|
15
17
|
* @param client Runtime client implementation used to submit and poll GW flows.
|
|
16
18
|
*/
|
|
17
|
-
constructor(client: NodeRuntimeClient);
|
|
19
|
+
constructor(client: NodeRuntimeClient, capabilities?: readonly NodeCapability[] | undefined);
|
|
18
20
|
/**
|
|
19
21
|
* Starts the individual onboarding/bootstrap flow.
|
|
20
22
|
*/
|
|
@@ -23,6 +25,36 @@ export declare class IndividualControllerSdk {
|
|
|
23
25
|
* Confirms the order returned by `startIndividualOrganization(...)`.
|
|
24
26
|
*/
|
|
25
27
|
confirmIndividualOrganizationOrder(input: IndividualOrganizationConfirmOrderInput): Promise<SubmitAndPollResult>;
|
|
28
|
+
/**
|
|
29
|
+
* Disables the hosted individual/family organization without freeing licenses.
|
|
30
|
+
*/
|
|
31
|
+
disableIndividualOrganization(ctx: RouteContext, input: IndividualOrganizationLifecycleInput, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
|
|
32
|
+
/**
|
|
33
|
+
* Preferred public alias for hosted individual/family disable.
|
|
34
|
+
*/
|
|
35
|
+
disableIndividual(ctx: RouteContext, input: IndividualOrganizationLifecycleInput, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
|
|
36
|
+
/**
|
|
37
|
+
* Purges an already inactive hosted individual/family organization.
|
|
38
|
+
*/
|
|
39
|
+
purgeIndividualOrganization(ctx: RouteContext, input: IndividualOrganizationLifecycleInput, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
|
|
40
|
+
/**
|
|
41
|
+
* Preferred public alias for hosted individual/family purge.
|
|
42
|
+
*/
|
|
43
|
+
purgeIndividual(ctx: RouteContext, input: IndividualOrganizationLifecycleInput, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
|
|
44
|
+
/**
|
|
45
|
+
* Controller-only placeholder for a future individual-member lifecycle flow.
|
|
46
|
+
*
|
|
47
|
+
* Current GW CORE still lacks the stable member disable route. The runtime
|
|
48
|
+
* client currently throws a not-supported error by design.
|
|
49
|
+
*/
|
|
50
|
+
disableIndividualMember(ctx: RouteContext, input: IndividualMemberLifecycleInput, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
|
|
51
|
+
/**
|
|
52
|
+
* Controller-only placeholder for a future individual-member lifecycle flow.
|
|
53
|
+
*
|
|
54
|
+
* Current GW CORE still lacks the stable member purge route. The runtime
|
|
55
|
+
* client currently throws a not-supported error by design.
|
|
56
|
+
*/
|
|
57
|
+
purgeIndividualMember(ctx: RouteContext, input: IndividualMemberLifecycleInput, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
|
|
26
58
|
/**
|
|
27
59
|
* Grants access to a professional through a consent flow.
|
|
28
60
|
*/
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
|
|
2
|
+
import { ActorCapabilities, ActorKinds } from 'gdc-common-utils-ts/constants/actor-session';
|
|
2
3
|
import { requireClientMethod, submitAndPollWithClient, } from './client-port.js';
|
|
4
|
+
import { assertFacadeCapability } from './capability-guard.js';
|
|
3
5
|
/**
|
|
4
6
|
* Individual-controller oriented facade over a `NodeRuntimeClient`.
|
|
5
7
|
*
|
|
@@ -10,13 +12,15 @@ export class IndividualControllerSdk {
|
|
|
10
12
|
/**
|
|
11
13
|
* @param client Runtime client implementation used to submit and poll GW flows.
|
|
12
14
|
*/
|
|
13
|
-
constructor(client) {
|
|
15
|
+
constructor(client, capabilities) {
|
|
14
16
|
this.client = client;
|
|
17
|
+
this.capabilities = capabilities;
|
|
15
18
|
}
|
|
16
19
|
/**
|
|
17
20
|
* Starts the individual onboarding/bootstrap flow.
|
|
18
21
|
*/
|
|
19
22
|
startIndividualOrganization(input) {
|
|
23
|
+
assertFacadeCapability(this.capabilities, ActorCapabilities.IndividualBootstrap, ActorKinds.IndividualController, 'startIndividualOrganization');
|
|
20
24
|
return requireClientMethod(this.client, 'startIndividualOrganization')(input);
|
|
21
25
|
}
|
|
22
26
|
/**
|
|
@@ -25,6 +29,54 @@ export class IndividualControllerSdk {
|
|
|
25
29
|
confirmIndividualOrganizationOrder(input) {
|
|
26
30
|
return requireClientMethod(this.client, 'confirmIndividualOrganizationOrder')(input);
|
|
27
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* Disables the hosted individual/family organization without freeing licenses.
|
|
34
|
+
*/
|
|
35
|
+
disableIndividualOrganization(ctx, input, pollOptions) {
|
|
36
|
+
assertFacadeCapability(this.capabilities, ActorCapabilities.IndividualDisable, ActorKinds.IndividualController, 'disableIndividualOrganization');
|
|
37
|
+
return requireClientMethod(this.client, 'disableIndividualOrganization')(ctx, input, pollOptions);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Preferred public alias for hosted individual/family disable.
|
|
41
|
+
*/
|
|
42
|
+
disableIndividual(ctx, input, pollOptions) {
|
|
43
|
+
assertFacadeCapability(this.capabilities, ActorCapabilities.IndividualDisable, ActorKinds.IndividualController, 'disableIndividual');
|
|
44
|
+
return requireClientMethod(this.client, 'disableIndividual')(ctx, input, pollOptions);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Purges an already inactive hosted individual/family organization.
|
|
48
|
+
*/
|
|
49
|
+
purgeIndividualOrganization(ctx, input, pollOptions) {
|
|
50
|
+
assertFacadeCapability(this.capabilities, ActorCapabilities.IndividualPurge, ActorKinds.IndividualController, 'purgeIndividualOrganization');
|
|
51
|
+
return requireClientMethod(this.client, 'purgeIndividualOrganization')(ctx, input, pollOptions);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Preferred public alias for hosted individual/family purge.
|
|
55
|
+
*/
|
|
56
|
+
purgeIndividual(ctx, input, pollOptions) {
|
|
57
|
+
assertFacadeCapability(this.capabilities, ActorCapabilities.IndividualPurge, ActorKinds.IndividualController, 'purgeIndividual');
|
|
58
|
+
return requireClientMethod(this.client, 'purgeIndividual')(ctx, input, pollOptions);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Controller-only placeholder for a future individual-member lifecycle flow.
|
|
62
|
+
*
|
|
63
|
+
* Current GW CORE still lacks the stable member disable route. The runtime
|
|
64
|
+
* client currently throws a not-supported error by design.
|
|
65
|
+
*/
|
|
66
|
+
disableIndividualMember(ctx, input, pollOptions) {
|
|
67
|
+
assertFacadeCapability(this.capabilities, ActorCapabilities.IndividualMemberDisable, ActorKinds.IndividualController, 'disableIndividualMember');
|
|
68
|
+
return requireClientMethod(this.client, 'disableIndividualMember')(ctx, input, pollOptions);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Controller-only placeholder for a future individual-member lifecycle flow.
|
|
72
|
+
*
|
|
73
|
+
* Current GW CORE still lacks the stable member purge route. The runtime
|
|
74
|
+
* client currently throws a not-supported error by design.
|
|
75
|
+
*/
|
|
76
|
+
purgeIndividualMember(ctx, input, pollOptions) {
|
|
77
|
+
assertFacadeCapability(this.capabilities, ActorCapabilities.IndividualMemberPurge, ActorKinds.IndividualController, 'purgeIndividualMember');
|
|
78
|
+
return requireClientMethod(this.client, 'purgeIndividualMember')(ctx, input, pollOptions);
|
|
79
|
+
}
|
|
28
80
|
/**
|
|
29
81
|
* Grants access to a professional through a consent flow.
|
|
30
82
|
*/
|
|
@@ -2,7 +2,8 @@ import { type NodeRuntimeClient, type PollOptions, type SubmitAndPollResult, typ
|
|
|
2
2
|
import type { RouteContext } from '../individual-onboarding.js';
|
|
3
3
|
import type { EmployeeDeviceActivationResult, EmployeeDeviceActivationRequestInput } from '../device-activation.js';
|
|
4
4
|
import type { SmartTokenExchangeResult, SmartTokenRequestInput } from '../smart-token.js';
|
|
5
|
-
import type {
|
|
5
|
+
import type { NodeCapability } from '../session.js';
|
|
6
|
+
import type { CommunicationIngestionInput, GrantProfessionalAccessInput, GrantProfessionalAccessResult, OrganizationEmployeeCreationInput, OrganizationEmployeeLifecycleInput } from '../resource-operations.js';
|
|
6
7
|
/**
|
|
7
8
|
* Organization-controller oriented facade over a `NodeRuntimeClient`.
|
|
8
9
|
*
|
|
@@ -11,14 +12,31 @@ import type { CommunicationIngestionInput, GrantProfessionalAccessInput, GrantPr
|
|
|
11
12
|
*/
|
|
12
13
|
export declare class OrganizationControllerSdk {
|
|
13
14
|
private readonly client;
|
|
15
|
+
private readonly capabilities?;
|
|
14
16
|
/**
|
|
15
17
|
* @param client Runtime client implementation used to submit and poll GW flows.
|
|
16
18
|
*/
|
|
17
|
-
constructor(client: NodeRuntimeClient);
|
|
19
|
+
constructor(client: NodeRuntimeClient, capabilities?: readonly NodeCapability[] | undefined);
|
|
18
20
|
/**
|
|
19
21
|
* Creates an employee/professional under the current organization tenant.
|
|
20
22
|
*/
|
|
21
23
|
createOrganizationEmployee(ctx: RouteContext, input: OrganizationEmployeeCreationInput, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
|
|
24
|
+
/**
|
|
25
|
+
* Disables an employee using the current GW CORE lifecycle contract.
|
|
26
|
+
*/
|
|
27
|
+
disableOrganizationEmployee(ctx: RouteContext, input: OrganizationEmployeeLifecycleInput, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
|
|
28
|
+
/**
|
|
29
|
+
* Preferred public alias for employee disable.
|
|
30
|
+
*/
|
|
31
|
+
disableEmployee(ctx: RouteContext, input: OrganizationEmployeeLifecycleInput, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
|
|
32
|
+
/**
|
|
33
|
+
* Purges an already inactive employee and frees the associated license seat.
|
|
34
|
+
*/
|
|
35
|
+
purgeOrganizationEmployee(ctx: RouteContext, input: OrganizationEmployeeLifecycleInput, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
|
|
36
|
+
/**
|
|
37
|
+
* Preferred public alias for employee purge.
|
|
38
|
+
*/
|
|
39
|
+
purgeEmployee(ctx: RouteContext, input: OrganizationEmployeeLifecycleInput, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
|
|
22
40
|
/**
|
|
23
41
|
* Activates the employee device from a previously issued activation request.
|
|
24
42
|
*/
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
|
|
2
|
+
import { ActorCapabilities, ActorKinds } from 'gdc-common-utils-ts/constants/actor-session';
|
|
2
3
|
import { requireClientMethod, submitAndPollWithClient, } from './client-port.js';
|
|
4
|
+
import { assertFacadeCapability } from './capability-guard.js';
|
|
3
5
|
/**
|
|
4
6
|
* Organization-controller oriented facade over a `NodeRuntimeClient`.
|
|
5
7
|
*
|
|
@@ -10,15 +12,45 @@ export class OrganizationControllerSdk {
|
|
|
10
12
|
/**
|
|
11
13
|
* @param client Runtime client implementation used to submit and poll GW flows.
|
|
12
14
|
*/
|
|
13
|
-
constructor(client) {
|
|
15
|
+
constructor(client, capabilities) {
|
|
14
16
|
this.client = client;
|
|
17
|
+
this.capabilities = capabilities;
|
|
15
18
|
}
|
|
16
19
|
/**
|
|
17
20
|
* Creates an employee/professional under the current organization tenant.
|
|
18
21
|
*/
|
|
19
22
|
createOrganizationEmployee(ctx, input, pollOptions) {
|
|
23
|
+
assertFacadeCapability(this.capabilities, ActorCapabilities.OrganizationCreateEmployee, ActorKinds.OrganizationController, 'createOrganizationEmployee');
|
|
20
24
|
return requireClientMethod(this.client, 'createOrganizationEmployee')(ctx, input, pollOptions);
|
|
21
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* Disables an employee using the current GW CORE lifecycle contract.
|
|
28
|
+
*/
|
|
29
|
+
disableOrganizationEmployee(ctx, input, pollOptions) {
|
|
30
|
+
assertFacadeCapability(this.capabilities, ActorCapabilities.OrganizationDisableEmployee, ActorKinds.OrganizationController, 'disableOrganizationEmployee');
|
|
31
|
+
return requireClientMethod(this.client, 'disableOrganizationEmployee')(ctx, input, pollOptions);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Preferred public alias for employee disable.
|
|
35
|
+
*/
|
|
36
|
+
disableEmployee(ctx, input, pollOptions) {
|
|
37
|
+
assertFacadeCapability(this.capabilities, ActorCapabilities.OrganizationDisableEmployee, ActorKinds.OrganizationController, 'disableEmployee');
|
|
38
|
+
return requireClientMethod(this.client, 'disableEmployee')(ctx, input, pollOptions);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Purges an already inactive employee and frees the associated license seat.
|
|
42
|
+
*/
|
|
43
|
+
purgeOrganizationEmployee(ctx, input, pollOptions) {
|
|
44
|
+
assertFacadeCapability(this.capabilities, ActorCapabilities.OrganizationPurgeEmployee, ActorKinds.OrganizationController, 'purgeOrganizationEmployee');
|
|
45
|
+
return requireClientMethod(this.client, 'purgeOrganizationEmployee')(ctx, input, pollOptions);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Preferred public alias for employee purge.
|
|
49
|
+
*/
|
|
50
|
+
purgeEmployee(ctx, input, pollOptions) {
|
|
51
|
+
assertFacadeCapability(this.capabilities, ActorCapabilities.OrganizationPurgeEmployee, ActorKinds.OrganizationController, 'purgeEmployee');
|
|
52
|
+
return requireClientMethod(this.client, 'purgeEmployee')(ctx, input, pollOptions);
|
|
53
|
+
}
|
|
22
54
|
/**
|
|
23
55
|
* Activates the employee device from a previously issued activation request.
|
|
24
56
|
*/
|
|
@@ -22,6 +22,62 @@ export type OrganizationEmployeeCreationInput = {
|
|
|
22
22
|
employeeClaims: Record<string, unknown>;
|
|
23
23
|
dataType?: string;
|
|
24
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* Current GW CORE employee lifecycle locator payload.
|
|
27
|
+
*
|
|
28
|
+
* Current backend behavior:
|
|
29
|
+
* - disable is still `Employee/_batch` with entry `request.method = DELETE`
|
|
30
|
+
* - purge is `Employee/_purge` with entry `request.method = POST`
|
|
31
|
+
*
|
|
32
|
+
* This SDK intentionally models the deployed GW CORE contract. It does not
|
|
33
|
+
* synthesize the future normalized `_batch + PATCH` contract ahead of the backend.
|
|
34
|
+
*/
|
|
35
|
+
export type OrganizationEmployeeLifecycleInput = {
|
|
36
|
+
/**
|
|
37
|
+
* Canonical employee/person claims used by GW CORE to locate the employee.
|
|
38
|
+
*/
|
|
39
|
+
employeeClaims: Record<string, unknown>;
|
|
40
|
+
/**
|
|
41
|
+
* Optional canonical resource id when already known by the caller.
|
|
42
|
+
*/
|
|
43
|
+
resourceId?: string;
|
|
44
|
+
dataType?: string;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Current GW CORE individual/family lifecycle locator payload.
|
|
48
|
+
*
|
|
49
|
+
* Current backend behavior:
|
|
50
|
+
* - disable is `individual/org.schema/Organization/_disable`
|
|
51
|
+
* - purge is `individual/org.schema/Organization/_purge`
|
|
52
|
+
*/
|
|
53
|
+
export type IndividualOrganizationLifecycleInput = {
|
|
54
|
+
/**
|
|
55
|
+
* Canonical claims used by GW CORE to locate the hosted individual/family
|
|
56
|
+
* registration.
|
|
57
|
+
*/
|
|
58
|
+
organizationClaims: Record<string, unknown>;
|
|
59
|
+
/**
|
|
60
|
+
* Optional canonical resource id when already known by the caller.
|
|
61
|
+
*/
|
|
62
|
+
resourceId?: string;
|
|
63
|
+
dataType?: string;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Forward-looking locator payload for a future individual-member lifecycle contract.
|
|
67
|
+
*
|
|
68
|
+
* Current GW CORE does not yet expose a stable lifecycle contract for
|
|
69
|
+
* `RelatedPerson` / individual-member records. The Node SDK keeps this type so
|
|
70
|
+
* controller-only methods and TDD can be prepared without fabricating backend behavior.
|
|
71
|
+
*/
|
|
72
|
+
export type IndividualMemberLifecycleInput = {
|
|
73
|
+
/**
|
|
74
|
+
* Canonical claims expected to locate the member/caregiver relationship once
|
|
75
|
+
* GW CORE exposes the lifecycle contract.
|
|
76
|
+
*/
|
|
77
|
+
memberClaims: Record<string, unknown>;
|
|
78
|
+
resourceId?: string;
|
|
79
|
+
dataType?: string;
|
|
80
|
+
};
|
|
25
81
|
export type IpsOrFhirImportInput = {
|
|
26
82
|
compositionPayload: {
|
|
27
83
|
thid?: string;
|
|
@@ -147,6 +203,58 @@ export declare function createOrganizationEmployeeWithDeps(routeCtx: RouteContex
|
|
|
147
203
|
intervalMs?: number;
|
|
148
204
|
}) => Promise<SubmitAndPollResult>;
|
|
149
205
|
}): Promise<SubmitAndPollResult>;
|
|
206
|
+
export declare function disableOrganizationEmployeeWithDeps(routeCtx: RouteContext, input: OrganizationEmployeeLifecycleInput, options: {
|
|
207
|
+
timeoutMs?: number;
|
|
208
|
+
intervalMs?: number;
|
|
209
|
+
} | undefined, deps: {
|
|
210
|
+
employeeBatchPath: (ctx: RouteContext) => string;
|
|
211
|
+
employeePollPath: (ctx: RouteContext) => string;
|
|
212
|
+
submitAndPoll: (submitPath: string, pollPath: string, payload: {
|
|
213
|
+
thid?: string;
|
|
214
|
+
} & Record<string, unknown>, pollOptions?: {
|
|
215
|
+
timeoutMs?: number;
|
|
216
|
+
intervalMs?: number;
|
|
217
|
+
}) => Promise<SubmitAndPollResult>;
|
|
218
|
+
}): Promise<SubmitAndPollResult>;
|
|
219
|
+
export declare function purgeOrganizationEmployeeWithDeps(routeCtx: RouteContext, input: OrganizationEmployeeLifecycleInput, options: {
|
|
220
|
+
timeoutMs?: number;
|
|
221
|
+
intervalMs?: number;
|
|
222
|
+
} | undefined, deps: {
|
|
223
|
+
employeePurgePath: (ctx: RouteContext) => string;
|
|
224
|
+
employeePurgePollPath: (ctx: RouteContext) => string;
|
|
225
|
+
submitAndPoll: (submitPath: string, pollPath: string, payload: {
|
|
226
|
+
thid?: string;
|
|
227
|
+
} & Record<string, unknown>, pollOptions?: {
|
|
228
|
+
timeoutMs?: number;
|
|
229
|
+
intervalMs?: number;
|
|
230
|
+
}) => Promise<SubmitAndPollResult>;
|
|
231
|
+
}): Promise<SubmitAndPollResult>;
|
|
232
|
+
export declare function disableIndividualOrganizationWithDeps(routeCtx: RouteContext, input: IndividualOrganizationLifecycleInput, options: {
|
|
233
|
+
timeoutMs?: number;
|
|
234
|
+
intervalMs?: number;
|
|
235
|
+
} | undefined, deps: {
|
|
236
|
+
individualOrganizationDisablePath: (ctx: RouteContext) => string;
|
|
237
|
+
individualOrganizationDisablePollPath: (ctx: RouteContext) => string;
|
|
238
|
+
submitAndPoll: (submitPath: string, pollPath: string, payload: {
|
|
239
|
+
thid?: string;
|
|
240
|
+
} & Record<string, unknown>, pollOptions?: {
|
|
241
|
+
timeoutMs?: number;
|
|
242
|
+
intervalMs?: number;
|
|
243
|
+
}) => Promise<SubmitAndPollResult>;
|
|
244
|
+
}): Promise<SubmitAndPollResult>;
|
|
245
|
+
export declare function purgeIndividualOrganizationWithDeps(routeCtx: RouteContext, input: IndividualOrganizationLifecycleInput, options: {
|
|
246
|
+
timeoutMs?: number;
|
|
247
|
+
intervalMs?: number;
|
|
248
|
+
} | undefined, deps: {
|
|
249
|
+
individualOrganizationPurgePath: (ctx: RouteContext) => string;
|
|
250
|
+
individualOrganizationPurgePollPath: (ctx: RouteContext) => string;
|
|
251
|
+
submitAndPoll: (submitPath: string, pollPath: string, payload: {
|
|
252
|
+
thid?: string;
|
|
253
|
+
} & Record<string, unknown>, pollOptions?: {
|
|
254
|
+
timeoutMs?: number;
|
|
255
|
+
intervalMs?: number;
|
|
256
|
+
}) => Promise<SubmitAndPollResult>;
|
|
257
|
+
}): Promise<SubmitAndPollResult>;
|
|
150
258
|
export declare function importIpsOrFhirAndUpdateIndexWithDeps(routeCtx: RouteContext, input: IpsOrFhirImportInput, deps: {
|
|
151
259
|
individualCompositionR4BatchPath: (ctx: RouteContext) => string;
|
|
152
260
|
individualCompositionR4PollPath: (ctx: RouteContext) => string;
|
|
@@ -1,23 +1,64 @@
|
|
|
1
1
|
// Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
|
|
2
2
|
import { HealthcareBasicSections } from 'gdc-common-utils-ts/constants';
|
|
3
|
+
import { GwCoreLifecycleRequestMethod, GwCoreLifecycleRequestType, GwCoreLifecycleTodo, } from './constants/lifecycle.js';
|
|
3
4
|
export async function createOrganizationEmployeeWithDeps(routeCtx, input, options, deps) {
|
|
4
|
-
const payload = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
data: [{
|
|
12
|
-
type: input.dataType || 'Employee-create-request-v1.0',
|
|
13
|
-
request: { method: 'POST' },
|
|
14
|
-
meta: { claims: input.employeeClaims || {} },
|
|
15
|
-
resource: { meta: { claims: input.employeeClaims || {} } },
|
|
16
|
-
}],
|
|
17
|
-
},
|
|
18
|
-
};
|
|
5
|
+
const payload = buildEmployeeLifecyclePayload({
|
|
6
|
+
routeCtx,
|
|
7
|
+
requestType: input.dataType || GwCoreLifecycleRequestType.EmployeeCreate,
|
|
8
|
+
requestMethod: GwCoreLifecycleRequestMethod.Post,
|
|
9
|
+
employeeClaims: input.employeeClaims,
|
|
10
|
+
thidPrefix: 'employee',
|
|
11
|
+
});
|
|
19
12
|
return deps.submitAndPoll(deps.employeeBatchPath(routeCtx), deps.employeePollPath(routeCtx), payload, options);
|
|
20
13
|
}
|
|
14
|
+
export async function disableOrganizationEmployeeWithDeps(routeCtx, input, options, deps) {
|
|
15
|
+
// TODO(gw-core-lifecycle-target-patch-employee-disable): switch this
|
|
16
|
+
// legacy DELETE-in-_batch flow to `_batch + PATCH` when GW CORE deploys it.
|
|
17
|
+
void GwCoreLifecycleTodo.EmployeeDisablePatchMigration;
|
|
18
|
+
const payload = buildEmployeeLifecyclePayload({
|
|
19
|
+
routeCtx,
|
|
20
|
+
requestType: input.dataType || GwCoreLifecycleRequestType.EmployeeDisable,
|
|
21
|
+
requestMethod: GwCoreLifecycleRequestMethod.Delete,
|
|
22
|
+
employeeClaims: input.employeeClaims,
|
|
23
|
+
resourceId: input.resourceId,
|
|
24
|
+
thidPrefix: 'employee-disable',
|
|
25
|
+
});
|
|
26
|
+
return deps.submitAndPoll(deps.employeeBatchPath(routeCtx), deps.employeePollPath(routeCtx), payload, options);
|
|
27
|
+
}
|
|
28
|
+
export async function purgeOrganizationEmployeeWithDeps(routeCtx, input, options, deps) {
|
|
29
|
+
const payload = buildEmployeeLifecyclePayload({
|
|
30
|
+
routeCtx,
|
|
31
|
+
requestType: input.dataType || GwCoreLifecycleRequestType.EmployeePurge,
|
|
32
|
+
requestMethod: GwCoreLifecycleRequestMethod.Post,
|
|
33
|
+
employeeClaims: input.employeeClaims,
|
|
34
|
+
resourceId: input.resourceId,
|
|
35
|
+
thidPrefix: 'employee-purge',
|
|
36
|
+
});
|
|
37
|
+
return deps.submitAndPoll(deps.employeePurgePath(routeCtx), deps.employeePurgePollPath(routeCtx), payload, options);
|
|
38
|
+
}
|
|
39
|
+
export async function disableIndividualOrganizationWithDeps(routeCtx, input, options, deps) {
|
|
40
|
+
// TODO(gw-core-lifecycle-target-patch-individual-disable): migrate from
|
|
41
|
+
// explicit `_disable` to `_batch + PATCH` only after GW CORE supports it.
|
|
42
|
+
void GwCoreLifecycleTodo.IndividualDisablePatchMigration;
|
|
43
|
+
const payload = buildIndividualOrganizationLifecyclePayload({
|
|
44
|
+
routeCtx,
|
|
45
|
+
requestType: input.dataType || GwCoreLifecycleRequestType.IndividualOrganizationDisable,
|
|
46
|
+
organizationClaims: input.organizationClaims,
|
|
47
|
+
resourceId: input.resourceId,
|
|
48
|
+
thidPrefix: 'individual-organization-disable',
|
|
49
|
+
});
|
|
50
|
+
return deps.submitAndPoll(deps.individualOrganizationDisablePath(routeCtx), deps.individualOrganizationDisablePollPath(routeCtx), payload, options);
|
|
51
|
+
}
|
|
52
|
+
export async function purgeIndividualOrganizationWithDeps(routeCtx, input, options, deps) {
|
|
53
|
+
const payload = buildIndividualOrganizationLifecyclePayload({
|
|
54
|
+
routeCtx,
|
|
55
|
+
requestType: input.dataType || GwCoreLifecycleRequestType.IndividualOrganizationPurge,
|
|
56
|
+
organizationClaims: input.organizationClaims,
|
|
57
|
+
resourceId: input.resourceId,
|
|
58
|
+
thidPrefix: 'individual-organization-purge',
|
|
59
|
+
});
|
|
60
|
+
return deps.submitAndPoll(deps.individualOrganizationPurgePath(routeCtx), deps.individualOrganizationPurgePollPath(routeCtx), payload, options);
|
|
61
|
+
}
|
|
21
62
|
export async function importIpsOrFhirAndUpdateIndexWithDeps(routeCtx, input, deps) {
|
|
22
63
|
const payload = {
|
|
23
64
|
thid: input.compositionPayload.thid || `composition-${createRuntimeUuid()}`,
|
|
@@ -136,6 +177,48 @@ function createRuntimeUuid() {
|
|
|
136
177
|
}
|
|
137
178
|
return `fallback-${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
138
179
|
}
|
|
180
|
+
function buildEmployeeLifecyclePayload(input) {
|
|
181
|
+
const claims = input.employeeClaims || {};
|
|
182
|
+
return {
|
|
183
|
+
jti: `jti-${createRuntimeUuid()}`,
|
|
184
|
+
iss: input.routeCtx.tenantId,
|
|
185
|
+
aud: input.routeCtx.tenantId,
|
|
186
|
+
type: 'application/didcomm-plain+json',
|
|
187
|
+
thid: `${input.thidPrefix}-${createRuntimeUuid()}`,
|
|
188
|
+
body: {
|
|
189
|
+
data: [{
|
|
190
|
+
type: input.requestType,
|
|
191
|
+
request: { method: input.requestMethod },
|
|
192
|
+
meta: { claims },
|
|
193
|
+
resource: {
|
|
194
|
+
...(input.resourceId ? { id: input.resourceId } : {}),
|
|
195
|
+
meta: { claims },
|
|
196
|
+
},
|
|
197
|
+
}],
|
|
198
|
+
},
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
function buildIndividualOrganizationLifecyclePayload(input) {
|
|
202
|
+
const claims = input.organizationClaims || {};
|
|
203
|
+
return {
|
|
204
|
+
jti: `jti-${createRuntimeUuid()}`,
|
|
205
|
+
iss: input.routeCtx.tenantId,
|
|
206
|
+
aud: input.routeCtx.tenantId,
|
|
207
|
+
type: 'application/didcomm-plain+json',
|
|
208
|
+
thid: `${input.thidPrefix}-${createRuntimeUuid()}`,
|
|
209
|
+
body: {
|
|
210
|
+
data: [{
|
|
211
|
+
type: input.requestType,
|
|
212
|
+
request: { method: GwCoreLifecycleRequestMethod.Post },
|
|
213
|
+
meta: { claims },
|
|
214
|
+
resource: {
|
|
215
|
+
...(input.resourceId ? { id: input.resourceId } : {}),
|
|
216
|
+
meta: { claims },
|
|
217
|
+
},
|
|
218
|
+
}],
|
|
219
|
+
},
|
|
220
|
+
};
|
|
221
|
+
}
|
|
139
222
|
function buildBundleSearchQuery(input) {
|
|
140
223
|
const params = new URLSearchParams();
|
|
141
224
|
params.set('subject', input.subject);
|
package/dist/session.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ActorKind, Capability } from 'gdc-
|
|
1
|
+
import type { ActorKind, Capability } from 'gdc-common-utils-ts/models/actor-session';
|
|
2
2
|
import { HostOnboardingSdk } from './orchestration/host-onboarding-sdk.js';
|
|
3
3
|
import { IndividualControllerSdk } from './orchestration/individual-controller-sdk.js';
|
|
4
4
|
import { IndividualMemberSdk } from './orchestration/individual-member-sdk.js';
|
|
@@ -6,7 +6,7 @@ import { OrganizationControllerSdk } from './orchestration/organization-controll
|
|
|
6
6
|
import { OrganizationEmployeeSdk } from './orchestration/organization-employee-sdk.js';
|
|
7
7
|
import { ProfessionalSdk } from './orchestration/professional-sdk.js';
|
|
8
8
|
import type { RuntimeClient } from './orchestration/client-port.js';
|
|
9
|
-
export type NodeCapability = Capability
|
|
9
|
+
export type NodeCapability = Capability;
|
|
10
10
|
export type NodeActorSessionContext = {
|
|
11
11
|
actorKind: ActorKind;
|
|
12
12
|
actorDid?: string;
|
package/dist/session.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
|
|
2
|
+
import { ActorKinds } from 'gdc-common-utils-ts/constants/actor-session';
|
|
2
3
|
import { HostOnboardingSdk } from './orchestration/host-onboarding-sdk.js';
|
|
3
4
|
import { IndividualControllerSdk } from './orchestration/individual-controller-sdk.js';
|
|
4
5
|
import { IndividualMemberSdk } from './orchestration/individual-member-sdk.js';
|
|
@@ -28,27 +29,27 @@ export class ActorSession {
|
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
asHostOnboarding() {
|
|
31
|
-
this.assertActorKind(
|
|
32
|
+
this.assertActorKind(ActorKinds.HostOnboarding);
|
|
32
33
|
return new HostOnboardingSdk(this.requireClient());
|
|
33
34
|
}
|
|
34
35
|
asOrganizationController() {
|
|
35
|
-
this.assertActorKind(
|
|
36
|
-
return new OrganizationControllerSdk(this.requireClient());
|
|
36
|
+
this.assertActorKind(ActorKinds.OrganizationController);
|
|
37
|
+
return new OrganizationControllerSdk(this.requireClient(), this.capabilities);
|
|
37
38
|
}
|
|
38
39
|
asOrganizationEmployee() {
|
|
39
|
-
this.assertActorKind(
|
|
40
|
+
this.assertActorKind(ActorKinds.OrganizationEmployee);
|
|
40
41
|
return new OrganizationEmployeeSdk(this.requireClient());
|
|
41
42
|
}
|
|
42
43
|
asIndividualController() {
|
|
43
|
-
this.assertActorKind(
|
|
44
|
-
return new IndividualControllerSdk(this.requireClient());
|
|
44
|
+
this.assertActorKind(ActorKinds.IndividualController);
|
|
45
|
+
return new IndividualControllerSdk(this.requireClient(), this.capabilities);
|
|
45
46
|
}
|
|
46
47
|
asIndividualMember() {
|
|
47
|
-
this.assertActorKind(
|
|
48
|
+
this.assertActorKind(ActorKinds.IndividualMember);
|
|
48
49
|
return new IndividualMemberSdk(this.requireClient());
|
|
49
50
|
}
|
|
50
51
|
asProfessional() {
|
|
51
|
-
this.assertActorKind(
|
|
52
|
+
this.assertActorKind(ActorKinds.Professional);
|
|
52
53
|
return new ProfessionalSdk(this.requireClient());
|
|
53
54
|
}
|
|
54
55
|
requireClient() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gdc-sdk-node-ts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Next-generation Node runtime package for the GDC SDK family",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Antifraud Services Inc.",
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"test:e2e:live-gw": "npm run build && RUN_LIVE_GW_E2E=1 node --test tests/live-gw-node-runtime.e2e.test.mjs"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"gdc-common-utils-ts": "^1.
|
|
21
|
-
"gdc-sdk-core-ts": "^0.
|
|
20
|
+
"gdc-common-utils-ts": "^1.8.0",
|
|
21
|
+
"gdc-sdk-core-ts": "^0.4.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@types/node": "^20.14.10",
|