gdc-sdk-node-ts 0.6.6 → 0.6.8
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 +51 -23
- package/dist/node-runtime-client.d.ts +7 -1
- package/dist/node-runtime-client.js +13 -1
- package/dist/orchestration/client-port.d.ts +2 -1
- package/dist/orchestration/professional-sdk.d.ts +9 -20
- package/dist/orchestration/professional-sdk.js +7 -22
- package/dist/resource-operations.d.ts +27 -1
- package/dist/resource-operations.js +12 -8
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -14,43 +14,56 @@ Use this package when your backend needs to:
|
|
|
14
14
|
This package is for runtime execution. It is not the place where the canonical
|
|
15
15
|
business contract is defined.
|
|
16
16
|
|
|
17
|
+
Architectural rule:
|
|
18
|
+
|
|
19
|
+
- shared contracts and actor boundaries come from `gdc-sdk-core-ts`
|
|
20
|
+
- this package executes those flows against GW
|
|
21
|
+
- this package should not widen an actor facade just because the runtime client
|
|
22
|
+
happens to expose the underlying method
|
|
23
|
+
|
|
17
24
|
## Start Here
|
|
18
25
|
|
|
19
26
|
If you are integrating this package for the first time, open these in order:
|
|
20
27
|
|
|
21
|
-
1. [docs/
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
28
|
+
1. [gdc-sdk-core-ts/docs/101-SDK_PACKAGE_BOUNDARIES.md](https://github.com/Global-DataCare/gdc-sdk-core-ts/blob/main/docs/101-SDK_PACKAGE_BOUNDARIES.md)
|
|
29
|
+
Why `core`, `node`, and `front` are separate packages, what belongs in each
|
|
30
|
+
one, and why actor-scoped facades must stay aligned across runtimes.
|
|
31
|
+
1. [docs/101-SDK_END_TO_END.md](./docs/101-SDK_END_TO_END.md)
|
|
32
|
+
Ordered onboarding guide with end-to-end journeys, copy/paste snippets, and
|
|
33
|
+
the recommended reading path for new backend integrators.
|
|
34
|
+
2. [docs/101-SDK_INTEGRATION.md](./docs/101-SDK_INTEGRATION.md)
|
|
25
35
|
Real backend setup, imports, `initializeCommunicationIdentity(...)`,
|
|
26
36
|
`new NodeHttpClient(...)`, route context, facade selection, and live method
|
|
27
37
|
usage.
|
|
28
|
-
3. [docs/
|
|
38
|
+
3. [docs/101-LIVE_GW_LOCAL.md](./docs/101-LIVE_GW_LOCAL.md)
|
|
39
|
+
Exact TTY/local/Docker commands for running the SDK against a real local GW
|
|
40
|
+
CORE, including tenant bootstrap and employee-seat setup.
|
|
41
|
+
4. [docs/101-DISCOVERY.md](./docs/101-DISCOVERY.md)
|
|
29
42
|
Node/BFF dataspace discovery, hosting-operator resolution, provider
|
|
30
43
|
resolution, and the correct integration boundary for fallback and cache.
|
|
31
|
-
|
|
44
|
+
5. [gdc-sdk-core-ts/docs/101-SDK_FLOWS.md](https://github.com/Global-DataCare/gdc-sdk-core-ts/blob/main/docs/101-SDK_FLOWS.md)
|
|
32
45
|
Actor split and business-flow map across organization, individual,
|
|
33
46
|
permissions, invitation, import, and SMART flows.
|
|
34
|
-
|
|
47
|
+
6. [gdc-common-utils-ts/src/examples/](https://github.com/Global-DataCare/gdc-common-utils-ts/tree/main/src/examples)
|
|
35
48
|
Shared payload values used by the docs and tests.
|
|
36
|
-
|
|
49
|
+
7. [gdc-common-utils-ts/docs/101-LIFECYCLE.md](https://github.com/Global-DataCare/gdc-common-utils-ts/blob/main/docs/101-LIFECYCLE.md)
|
|
37
50
|
Canonical `enable/disable/delete` semantics and copy/paste placeholders.
|
|
38
51
|
|
|
39
52
|
If you need the shortest path:
|
|
40
53
|
|
|
41
54
|
- main onboarding guide:
|
|
42
|
-
[docs/
|
|
55
|
+
[docs/101-SDK_END_TO_END.md](./docs/101-SDK_END_TO_END.md)
|
|
43
56
|
- GW CORE app identity:
|
|
44
57
|
`appId` mandatory, `appVersion` optional with default `v1.0`
|
|
45
58
|
- backend technical identity:
|
|
46
|
-
[`initializeCommunicationIdentity(...)`](./docs/
|
|
59
|
+
[`initializeCommunicationIdentity(...)`](./docs/101-SDK_INTEGRATION.md)
|
|
47
60
|
for the technical channel/runtime identity, not the legal organization id
|
|
48
61
|
- runtime client:
|
|
49
62
|
[`NodeHttpClient`](src/node-runtime-client.ts)
|
|
50
63
|
- step-by-step runtime usage:
|
|
51
|
-
[docs/
|
|
64
|
+
[docs/101-SDK_INTEGRATION.md](./docs/101-SDK_INTEGRATION.md)
|
|
52
65
|
- dataspace discovery and fallback/cache boundary:
|
|
53
|
-
[docs/
|
|
66
|
+
[docs/101-DISCOVERY.md](./docs/101-DISCOVERY.md)
|
|
54
67
|
|
|
55
68
|
## Executable Usage Examples
|
|
56
69
|
|
|
@@ -70,18 +83,21 @@ Open these tests when you want to see exact method calls and exact inputs:
|
|
|
70
83
|
SMART token request flow.
|
|
71
84
|
- [tests/live-gw-node-runtime.e2e.test.mjs](tests/live-gw-node-runtime.e2e.test.mjs)
|
|
72
85
|
End-to-end runtime wiring against a real GW environment.
|
|
73
|
-
- [tests/dataspace-resolver.
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
`getIndexProviders(...)`, and `getDigitalTwinProviders(...)` calls.
|
|
86
|
+
- [tests/101-dataspace-resolver.test.mjs](tests/101-dataspace-resolver.test.mjs)
|
|
87
|
+
Minimal `HttpDataspaceResolver` 101 with one host and one published provider.
|
|
88
|
+
- [tests/101-default-first-dataspace-discovery.test.mjs](tests/101-default-first-dataspace-discovery.test.mjs)
|
|
89
|
+
Minimal `default-first` discovery with one host and one published
|
|
90
|
+
`IndexProvider`.
|
|
79
91
|
|
|
80
92
|
## Live GW CORE Flow
|
|
81
93
|
|
|
82
94
|
Use [tests/live-gw-node-runtime.e2e.test.mjs](tests/live-gw-node-runtime.e2e.test.mjs)
|
|
83
95
|
as the canonical runtime flow.
|
|
84
96
|
|
|
97
|
+
Before running that suite, read:
|
|
98
|
+
|
|
99
|
+
- [docs/101-LIVE_GW_LOCAL.md](./docs/101-LIVE_GW_LOCAL.md)
|
|
100
|
+
|
|
85
101
|
Teaching rule:
|
|
86
102
|
|
|
87
103
|
- defaults come from `gdc-common-utils-ts/examples`
|
|
@@ -94,9 +110,13 @@ Current live flow covered by the test suite:
|
|
|
94
110
|
1. bootstrap tenant / legal organization
|
|
95
111
|
2. bootstrap doctor or controller employee
|
|
96
112
|
3. bootstrap individual and grant consent for the doctor
|
|
113
|
+
default example: `INDIVIDUAL_ALTERNATE_NAME=Doraemon`
|
|
97
114
|
4. ingest two IPS `Communication` bundles, each with one `MedicationStatement`
|
|
98
115
|
5. read the IPS/clinical index and verify both medications are present
|
|
99
|
-
6.
|
|
116
|
+
6. request the consolidated IPS bundle through
|
|
117
|
+
`Bundle?type=document&composition.subject=<did>&composition.type=http://loinc.org|60591-5`
|
|
118
|
+
7. verify the returned bundle document contains both medication statements
|
|
119
|
+
8. persist audit/debug traces in `test-results/*.jsonl`
|
|
100
120
|
|
|
101
121
|
Shared example source of truth:
|
|
102
122
|
|
|
@@ -128,6 +148,13 @@ RUN_LIVE_GW_E2E_IPS_INGESTION=1 \
|
|
|
128
148
|
npm run test:e2e:live-gw
|
|
129
149
|
```
|
|
130
150
|
|
|
151
|
+
Implementation note:
|
|
152
|
+
|
|
153
|
+
- the public runtime contract is still `Bundle/_search`
|
|
154
|
+
- `gdc-sdk-node-ts` submits that request as-is
|
|
155
|
+
- GW CORE resolves it internally from indexed subject sections and returns the
|
|
156
|
+
consolidated IPS bundle document
|
|
157
|
+
|
|
131
158
|
Common overrides:
|
|
132
159
|
|
|
133
160
|
```bash
|
|
@@ -170,9 +197,10 @@ Use the Node discovery layer when your backend or BFF needs to:
|
|
|
170
197
|
|
|
171
198
|
Primary references:
|
|
172
199
|
|
|
173
|
-
- [docs/
|
|
174
|
-
- [tests/default-first-dataspace-discovery.
|
|
175
|
-
- [tests/dataspace-resolver.
|
|
200
|
+
- [docs/101-DISCOVERY.md](./docs/101-DISCOVERY.md)
|
|
201
|
+
- [tests/101-default-first-dataspace-discovery.test.mjs](tests/101-default-first-dataspace-discovery.test.mjs)
|
|
202
|
+
- [tests/101-dataspace-resolver.test.mjs](tests/101-dataspace-resolver.test.mjs)
|
|
203
|
+
- [tests/dataspace-resolver-advanced.test.mjs](tests/dataspace-resolver-advanced.test.mjs)
|
|
176
204
|
- [tests/dataspace-resolver.test.mjs](tests/dataspace-resolver.test.mjs)
|
|
177
205
|
|
|
178
206
|
Copy/paste starting point:
|
|
@@ -375,7 +403,7 @@ Teaching rule:
|
|
|
375
403
|
## Shared Contract Sources
|
|
376
404
|
|
|
377
405
|
- [gdc-sdk-core-ts/README.md](https://github.com/Global-DataCare/gdc-sdk-core-ts/blob/main/README.md)
|
|
378
|
-
- [gdc-common-utils-ts/docs/
|
|
406
|
+
- [gdc-common-utils-ts/docs/101-CONSENT_ACCESS.md](https://github.com/Global-DataCare/gdc-common-utils-ts/blob/main/docs/101-CONSENT_ACCESS.md)
|
|
379
407
|
|
|
380
408
|
Reusable payload examples:
|
|
381
409
|
|
|
@@ -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 IndividualMemberLifecycleInput, type IndividualOrganizationLifecycleInput, type OrganizationEmployeeCreationInput, type OrganizationEmployeeLifecycleInput, 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 OrganizationEmployeeSearchInput, 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';
|
|
@@ -143,6 +143,10 @@ export declare class HttpRuntimeClient implements NodeRuntimeClient {
|
|
|
143
143
|
* Preferred public alias for employee purge in the current SDK surface.
|
|
144
144
|
*/
|
|
145
145
|
purgeEmployee(ctx: RouteContext, input: OrganizationEmployeeLifecycleInput, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
|
|
146
|
+
/**
|
|
147
|
+
* Searches employees/professionals under the selected organization tenant.
|
|
148
|
+
*/
|
|
149
|
+
searchOrganizationEmployees(ctx: RouteContext, input: OrganizationEmployeeSearchInput): Promise<SubmitAndPollResult>;
|
|
146
150
|
/**
|
|
147
151
|
* Starts the onboarding flow for an individual-oriented tenant or index.
|
|
148
152
|
*/
|
|
@@ -262,6 +266,8 @@ export declare class HttpRuntimeClient implements NodeRuntimeClient {
|
|
|
262
266
|
hostRegistryOrderPollPath(ctx?: HostRouteContext): string;
|
|
263
267
|
employeeBatchPath(ctx?: RouteContext): string;
|
|
264
268
|
employeePollPath(ctx?: RouteContext): string;
|
|
269
|
+
employeeSearchPath(ctx?: RouteContext): string;
|
|
270
|
+
employeeSearchPollPath(ctx?: RouteContext): string;
|
|
265
271
|
employeePurgePath(ctx?: RouteContext): string;
|
|
266
272
|
employeePurgePollPath(ctx?: RouteContext): string;
|
|
267
273
|
individualFamilyOrganizationBatchPath(ctx?: RouteContext): string;
|
|
@@ -9,7 +9,7 @@ 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, disableIndividualOrganizationWithDeps, disableOrganizationEmployeeWithDeps, grantProfessionalAccessWithDeps, ingestCommunicationAndUpdateIndexWithDeps, purgeIndividualOrganizationWithDeps, purgeOrganizationEmployeeWithDeps, searchClinicalBundleWithDeps, searchLatestIpsWithDeps, upsertRelatedPersonAndPollWithDeps, } from './resource-operations.js';
|
|
12
|
+
import { createOrganizationEmployeeWithDeps, disableIndividualOrganizationWithDeps, disableOrganizationEmployeeWithDeps, grantProfessionalAccessWithDeps, ingestCommunicationAndUpdateIndexWithDeps, purgeIndividualOrganizationWithDeps, purgeOrganizationEmployeeWithDeps, searchOrganizationEmployeesWithDeps, searchClinicalBundleWithDeps, searchLatestIpsWithDeps, upsertRelatedPersonAndPollWithDeps, } from './resource-operations.js';
|
|
13
13
|
import { submitAndPollWithMethods } from './orchestration/client-port.js';
|
|
14
14
|
import { GwCoreLifecycleAction } from './constants/lifecycle.js';
|
|
15
15
|
const bootstrapFacade = createBootstrapFacade();
|
|
@@ -200,6 +200,16 @@ export class HttpRuntimeClient {
|
|
|
200
200
|
async purgeEmployee(ctx, input, pollOptions) {
|
|
201
201
|
return this.purgeOrganizationEmployee(ctx, input, pollOptions);
|
|
202
202
|
}
|
|
203
|
+
/**
|
|
204
|
+
* Searches employees/professionals under the selected organization tenant.
|
|
205
|
+
*/
|
|
206
|
+
async searchOrganizationEmployees(ctx, input) {
|
|
207
|
+
return searchOrganizationEmployeesWithDeps(ctx, input, {
|
|
208
|
+
employeeSearchPath: this.employeeSearchPath.bind(this),
|
|
209
|
+
employeeSearchPollPath: this.employeeSearchPollPath.bind(this),
|
|
210
|
+
submitAndPoll: this.submitAndPoll.bind(this),
|
|
211
|
+
});
|
|
212
|
+
}
|
|
203
213
|
/**
|
|
204
214
|
* Starts the onboarding flow for an individual-oriented tenant or index.
|
|
205
215
|
*/
|
|
@@ -529,6 +539,8 @@ export class HttpRuntimeClient {
|
|
|
529
539
|
hostRegistryOrderPollPath(ctx) { return this.hostRegistryPath(ctx, 'Order', '_batch-response'); }
|
|
530
540
|
employeeBatchPath(ctx) { return this.v1Path(ctx, 'entity', 'org.schema', 'Employee', GwCoreLifecycleAction.Batch); }
|
|
531
541
|
employeePollPath(ctx) { return this.v1Path(ctx, 'entity', 'org.schema', 'Employee', GwCoreLifecycleAction.BatchResponse); }
|
|
542
|
+
employeeSearchPath(ctx) { return this.v1Path(ctx, 'entity', 'org.schema', 'Employee', '_search'); }
|
|
543
|
+
employeeSearchPollPath(ctx) { return this.v1Path(ctx, 'entity', 'org.schema', 'Employee', '_search-response'); }
|
|
532
544
|
employeePurgePath(ctx) { return this.v1Path(ctx, 'entity', 'org.schema', 'Employee', GwCoreLifecycleAction.Purge); }
|
|
533
545
|
employeePurgePollPath(ctx) { return this.v1Path(ctx, 'entity', 'org.schema', 'Employee', `${GwCoreLifecycleAction.Purge}-response`); }
|
|
534
546
|
individualFamilyOrganizationBatchPath(ctx) { return this.v1Path(ctx, 'individual', 'org.schema', 'Organization', GwCoreLifecycleAction.Batch); }
|
|
@@ -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, IndividualMemberLifecycleInput, IndividualOrganizationLifecycleInput, IpsOrFhirImportInput, OrganizationEmployeeCreationInput, OrganizationEmployeeLifecycleInput, RelatedPersonUpsertInput } from '../resource-operations.js';
|
|
9
|
+
import type { CommunicationIngestionInput, ClinicalBundleSearchInput, DigitalTwinGenerationInput, GrantProfessionalAccessInput, GrantProfessionalAccessResult, IndividualMemberLifecycleInput, IndividualOrganizationLifecycleInput, IpsOrFhirImportInput, OrganizationEmployeeCreationInput, OrganizationEmployeeLifecycleInput, OrganizationEmployeeSearchInput, RelatedPersonUpsertInput } from '../resource-operations.js';
|
|
10
10
|
/**
|
|
11
11
|
* Shared node-runtime activation input.
|
|
12
12
|
*
|
|
@@ -30,6 +30,7 @@ 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
|
+
searchOrganizationEmployees?: (ctx: RouteContext, input: OrganizationEmployeeSearchInput) => Promise<SubmitAndPollResult>;
|
|
33
34
|
disableEmployee?: (ctx: RouteContext, input: OrganizationEmployeeLifecycleInput, pollOptions?: PollOptions) => Promise<SubmitAndPollResult>;
|
|
34
35
|
purgeEmployee?: (ctx: RouteContext, input: OrganizationEmployeeLifecycleInput, pollOptions?: PollOptions) => Promise<SubmitAndPollResult>;
|
|
35
36
|
disableOrganizationEmployee?: (ctx: RouteContext, input: OrganizationEmployeeLifecycleInput, pollOptions?: PollOptions) => Promise<SubmitAndPollResult>;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import type { HostRouteContext } from '../host-onboarding.js';
|
|
1
|
+
import { type NodeRuntimeClient, type PollOptions, type SubmitAndPollResult, type SubmitPayload } from './client-port.js';
|
|
3
2
|
import type { RouteContext } from '../individual-onboarding.js';
|
|
4
|
-
import type { EmployeeDeviceActivationResult, EmployeeDeviceActivationRequestInput } from '../device-activation.js';
|
|
5
3
|
import type { SmartTokenExchangeResult, SmartTokenRequestInput } from '../smart-token.js';
|
|
6
|
-
import type { CommunicationIngestionInput, GrantProfessionalAccessInput, GrantProfessionalAccessResult
|
|
4
|
+
import type { CommunicationIngestionInput, GrantProfessionalAccessInput, GrantProfessionalAccessResult } from '../resource-operations.js';
|
|
7
5
|
/**
|
|
8
|
-
* Professional-oriented facade
|
|
9
|
-
*
|
|
6
|
+
* Professional-oriented facade for runtime actions that belong to the
|
|
7
|
+
* professional actor itself after tenant and employee provisioning have already
|
|
8
|
+
* happened through the organization-scoped facades.
|
|
9
|
+
*
|
|
10
|
+
* Keep this boundary strict:
|
|
11
|
+
* - professional runtime actions belong here
|
|
12
|
+
* - organization activation and employee provisioning do not
|
|
10
13
|
*/
|
|
11
14
|
export declare class ProfessionalSdk {
|
|
12
15
|
private readonly client;
|
|
@@ -14,20 +17,6 @@ export declare class ProfessionalSdk {
|
|
|
14
17
|
* @param client Runtime client implementation used to submit and poll GW flows.
|
|
15
18
|
*/
|
|
16
19
|
constructor(client: NodeRuntimeClient);
|
|
17
|
-
/**
|
|
18
|
-
* Activates the legal organization in the gateway from an ICA-issued proof
|
|
19
|
-
* token and the declared service capabilities that will be published through
|
|
20
|
-
* DID/DCAT discovery.
|
|
21
|
-
*/
|
|
22
|
-
activateOrganizationInGatewayFromIcaProof(hostCtx: HostRouteContext, input: NodeOrganizationActivationInput, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
|
|
23
|
-
/**
|
|
24
|
-
* Creates an employee/professional under the current organization tenant.
|
|
25
|
-
*/
|
|
26
|
-
createOrganizationEmployee(ctx: RouteContext, input: OrganizationEmployeeCreationInput, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
|
|
27
|
-
/**
|
|
28
|
-
* Activates the current employee device from a previously issued activation request.
|
|
29
|
-
*/
|
|
30
|
-
activateEmployeeDeviceWithActivationRequest(input: EmployeeDeviceActivationRequestInput): Promise<EmployeeDeviceActivationResult>;
|
|
31
20
|
/**
|
|
32
21
|
* Requests a SMART token suitable for subsequent clinical/document calls.
|
|
33
22
|
*
|
|
@@ -2,8 +2,13 @@
|
|
|
2
2
|
// Always create JSDoc, do not use strings inline in keys nor values, use types instead, and reuse the data test examples.
|
|
3
3
|
import { requireClientMethod, submitAndPollWithClient, } from './client-port.js';
|
|
4
4
|
/**
|
|
5
|
-
* Professional-oriented facade
|
|
6
|
-
*
|
|
5
|
+
* Professional-oriented facade for runtime actions that belong to the
|
|
6
|
+
* professional actor itself after tenant and employee provisioning have already
|
|
7
|
+
* happened through the organization-scoped facades.
|
|
8
|
+
*
|
|
9
|
+
* Keep this boundary strict:
|
|
10
|
+
* - professional runtime actions belong here
|
|
11
|
+
* - organization activation and employee provisioning do not
|
|
7
12
|
*/
|
|
8
13
|
export class ProfessionalSdk {
|
|
9
14
|
/**
|
|
@@ -12,26 +17,6 @@ export class ProfessionalSdk {
|
|
|
12
17
|
constructor(client) {
|
|
13
18
|
this.client = client;
|
|
14
19
|
}
|
|
15
|
-
/**
|
|
16
|
-
* Activates the legal organization in the gateway from an ICA-issued proof
|
|
17
|
-
* token and the declared service capabilities that will be published through
|
|
18
|
-
* DID/DCAT discovery.
|
|
19
|
-
*/
|
|
20
|
-
activateOrganizationInGatewayFromIcaProof(hostCtx, input, pollOptions) {
|
|
21
|
-
return requireClientMethod(this.client, 'activateOrganizationInGatewayFromIcaProof')(hostCtx, input, pollOptions);
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Creates an employee/professional under the current organization tenant.
|
|
25
|
-
*/
|
|
26
|
-
createOrganizationEmployee(ctx, input, pollOptions) {
|
|
27
|
-
return requireClientMethod(this.client, 'createOrganizationEmployee')(ctx, input, pollOptions);
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Activates the current employee device from a previously issued activation request.
|
|
31
|
-
*/
|
|
32
|
-
activateEmployeeDeviceWithActivationRequest(input) {
|
|
33
|
-
return requireClientMethod(this.client, 'activateEmployeeDeviceWithActivationRequest')(input);
|
|
34
|
-
}
|
|
35
20
|
/**
|
|
36
21
|
* Requests a SMART token suitable for subsequent clinical/document calls.
|
|
37
22
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BundleSearchQuery, CommunicationInput, DateRange } from 'gdc-sdk-core-ts';
|
|
1
|
+
import type { BundleSearchQuery, CommunicationInput, DateRange, EmployeeSearchValue } from 'gdc-sdk-core-ts';
|
|
2
2
|
import type { SubmitAndPollResult } from './orchestration/client-port.js';
|
|
3
3
|
import type { RouteContext } from './individual-onboarding.js';
|
|
4
4
|
export type OrganizationEmployeeCreationInput = {
|
|
@@ -43,6 +43,22 @@ export type OrganizationEmployeeLifecycleInput = {
|
|
|
43
43
|
resourceId?: string;
|
|
44
44
|
dataType?: string;
|
|
45
45
|
};
|
|
46
|
+
export type OrganizationEmployeeSearchInput = {
|
|
47
|
+
/**
|
|
48
|
+
* Canonical employee/person claims used as search filters against GW CORE.
|
|
49
|
+
*
|
|
50
|
+
* Typical examples:
|
|
51
|
+
* - `org.schema.Person.email`
|
|
52
|
+
* - `org.schema.Person.hasOccupation.identifier.value`
|
|
53
|
+
* - `org.schema.Person.memberOf.taxID`
|
|
54
|
+
*/
|
|
55
|
+
employeeClaims?: Record<string, EmployeeSearchValue>;
|
|
56
|
+
requestThid?: string;
|
|
57
|
+
pollOptions?: {
|
|
58
|
+
timeoutMs?: number;
|
|
59
|
+
intervalMs?: number;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
46
62
|
/**
|
|
47
63
|
* Current GW CORE individual/family lifecycle locator payload.
|
|
48
64
|
*
|
|
@@ -229,6 +245,16 @@ export declare function purgeOrganizationEmployeeWithDeps(routeCtx: RouteContext
|
|
|
229
245
|
intervalMs?: number;
|
|
230
246
|
}) => Promise<SubmitAndPollResult>;
|
|
231
247
|
}): Promise<SubmitAndPollResult>;
|
|
248
|
+
export declare function searchOrganizationEmployeesWithDeps(routeCtx: RouteContext, input: OrganizationEmployeeSearchInput, deps: {
|
|
249
|
+
employeeSearchPath: (ctx: RouteContext) => string;
|
|
250
|
+
employeeSearchPollPath: (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>;
|
|
232
258
|
export declare function disableIndividualOrganizationWithDeps(routeCtx: RouteContext, input: IndividualOrganizationLifecycleInput, options: {
|
|
233
259
|
timeoutMs?: number;
|
|
234
260
|
intervalMs?: number;
|
|
@@ -1,6 +1,7 @@
|
|
|
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
3
|
import { GwCoreLifecycleRequestMethod, GwCoreLifecycleRequestType, GwCoreLifecycleTodo, } from './constants/lifecycle.js';
|
|
4
|
+
import { buildEmployeeBatchEntry, buildEmployeeSearchBundle, } from 'gdc-sdk-core-ts';
|
|
4
5
|
export async function createOrganizationEmployeeWithDeps(routeCtx, input, options, deps) {
|
|
5
6
|
const payload = buildEmployeeLifecyclePayload({
|
|
6
7
|
routeCtx,
|
|
@@ -36,6 +37,12 @@ export async function purgeOrganizationEmployeeWithDeps(routeCtx, input, options
|
|
|
36
37
|
});
|
|
37
38
|
return deps.submitAndPoll(deps.employeePurgePath(routeCtx), deps.employeePurgePollPath(routeCtx), payload, options);
|
|
38
39
|
}
|
|
40
|
+
export async function searchOrganizationEmployeesWithDeps(routeCtx, input, deps) {
|
|
41
|
+
return deps.submitAndPoll(deps.employeeSearchPath(routeCtx), deps.employeeSearchPollPath(routeCtx), {
|
|
42
|
+
thid: input.requestThid || `employee-search-${createRuntimeUuid()}`,
|
|
43
|
+
body: buildEmployeeSearchBundle({ claims: input.employeeClaims }),
|
|
44
|
+
}, input.pollOptions);
|
|
45
|
+
}
|
|
39
46
|
export async function disableIndividualOrganizationWithDeps(routeCtx, input, options, deps) {
|
|
40
47
|
// TODO(gw-core-lifecycle-target-patch-individual-disable): migrate from
|
|
41
48
|
// explicit `_disable` to `_batch + PATCH` only after GW CORE supports it.
|
|
@@ -186,15 +193,12 @@ function buildEmployeeLifecyclePayload(input) {
|
|
|
186
193
|
type: 'application/didcomm-plain+json',
|
|
187
194
|
thid: `${input.thidPrefix}-${createRuntimeUuid()}`,
|
|
188
195
|
body: {
|
|
189
|
-
data: [{
|
|
196
|
+
data: [buildEmployeeBatchEntry({
|
|
190
197
|
type: input.requestType,
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
meta: { claims },
|
|
196
|
-
},
|
|
197
|
-
}],
|
|
198
|
+
method: input.requestMethod,
|
|
199
|
+
claims,
|
|
200
|
+
resourceId: input.resourceId,
|
|
201
|
+
})],
|
|
198
202
|
},
|
|
199
203
|
};
|
|
200
204
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gdc-sdk-node-ts",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.8",
|
|
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.14.
|
|
21
|
-
"gdc-sdk-core-ts": "^0.6.
|
|
20
|
+
"gdc-common-utils-ts": "^1.14.15",
|
|
21
|
+
"gdc-sdk-core-ts": "^0.6.14"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@types/node": "^20.14.10",
|