gdc-sdk-node-ts 0.1.1
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 +166 -0
- package/dist/async-polling.d.ts +7 -0
- package/dist/async-polling.js +26 -0
- package/dist/device-activation.d.ts +44 -0
- package/dist/device-activation.js +44 -0
- package/dist/gdc-session-bridge.d.ts +11 -0
- package/dist/gdc-session-bridge.js +74 -0
- package/dist/host-onboarding.d.ts +38 -0
- package/dist/host-onboarding.js +39 -0
- package/dist/identity-bootstrap.d.ts +30 -0
- package/dist/identity-bootstrap.js +32 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +24 -0
- package/dist/individual-onboarding.d.ts +35 -0
- package/dist/individual-onboarding.js +38 -0
- package/dist/individual-start.d.ts +87 -0
- package/dist/individual-start.js +82 -0
- package/dist/legacy-compat.d.ts +22 -0
- package/dist/legacy-compat.js +18 -0
- package/dist/node-runtime-client.d.ts +195 -0
- package/dist/node-runtime-client.js +483 -0
- package/dist/orchestration/client-port.d.ts +47 -0
- package/dist/orchestration/client-port.js +31 -0
- package/dist/orchestration/host-onboarding-sdk.d.ts +14 -0
- package/dist/orchestration/host-onboarding-sdk.js +15 -0
- package/dist/orchestration/individual-controller-sdk.d.ts +54 -0
- package/dist/orchestration/individual-controller-sdk.js +70 -0
- package/dist/orchestration/individual-member-sdk.d.ts +17 -0
- package/dist/orchestration/individual-member-sdk.js +20 -0
- package/dist/orchestration/organization-controller-sdk.d.ts +46 -0
- package/dist/orchestration/organization-controller-sdk.js +56 -0
- package/dist/orchestration/organization-employee-sdk.d.ts +9 -0
- package/dist/orchestration/organization-employee-sdk.js +13 -0
- package/dist/orchestration/personal-sdk.d.ts +22 -0
- package/dist/orchestration/personal-sdk.js +34 -0
- package/dist/orchestration/professional-sdk.d.ts +58 -0
- package/dist/orchestration/professional-sdk.js +63 -0
- package/dist/poll-options.d.ts +1 -0
- package/dist/poll-options.js +2 -0
- package/dist/resource-operations.d.ts +225 -0
- package/dist/resource-operations.js +184 -0
- package/dist/runtime-contracts.d.ts +65 -0
- package/dist/runtime-contracts.js +7 -0
- package/dist/session.d.ts +64 -0
- package/dist/session.js +80 -0
- package/dist/simple-device-activation.d.ts +44 -0
- package/dist/simple-device-activation.js +44 -0
- package/dist/simple-host-onboarding.d.ts +27 -0
- package/dist/simple-host-onboarding.js +39 -0
- package/dist/simple-individual-onboarding.d.ts +27 -0
- package/dist/simple-individual-onboarding.js +38 -0
- package/dist/simple-individual-start.d.ts +45 -0
- package/dist/simple-individual-start.js +59 -0
- package/dist/simple-poll-options.d.ts +5 -0
- package/dist/simple-poll-options.js +17 -0
- package/dist/simple-smart-token.d.ts +58 -0
- package/dist/simple-smart-token.js +85 -0
- package/dist/smart-token.d.ts +135 -0
- package/dist/smart-token.js +100 -0
- package/package.json +26 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
|
|
2
|
+
import { requireClientMethod, submitAndPollWithClient, } from './client-port.js';
|
|
3
|
+
/**
|
|
4
|
+
* Individual-controller oriented facade over a `NodeRuntimeClient`.
|
|
5
|
+
*
|
|
6
|
+
* It groups the most common individual subject flows: organization/index
|
|
7
|
+
* bootstrap, consent, IPS/FHIR ingestion, digital twin generation, and token requests.
|
|
8
|
+
*/
|
|
9
|
+
export class IndividualControllerSdk {
|
|
10
|
+
/**
|
|
11
|
+
* @param client Runtime client implementation used to submit and poll GW flows.
|
|
12
|
+
*/
|
|
13
|
+
constructor(client) {
|
|
14
|
+
this.client = client;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Starts the individual onboarding/bootstrap flow.
|
|
18
|
+
*/
|
|
19
|
+
startIndividualOrganization(input) {
|
|
20
|
+
return requireClientMethod(this.client, 'startIndividualOrganization')(input);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Confirms the order returned by `startIndividualOrganization(...)`.
|
|
24
|
+
*/
|
|
25
|
+
confirmIndividualOrganizationOrder(input) {
|
|
26
|
+
return requireClientMethod(this.client, 'confirmIndividualOrganizationOrder')(input);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Grants access to a professional through a consent flow.
|
|
30
|
+
*/
|
|
31
|
+
grantProfessionalAccess(ctx, input) {
|
|
32
|
+
return requireClientMethod(this.client, 'grantProfessionalAccess')(ctx, input);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Imports a FHIR/IPS payload and waits until it is indexed.
|
|
36
|
+
*/
|
|
37
|
+
importIpsOrFhirAndUpdateIndex(ctx, input) {
|
|
38
|
+
return requireClientMethod(this.client, 'importIpsOrFhirAndUpdateIndex')(ctx, input);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Creates or updates a `RelatedPerson` for non-employee caregivers or family members.
|
|
42
|
+
*/
|
|
43
|
+
upsertRelatedPersonAndPoll(ctx, input) {
|
|
44
|
+
return requireClientMethod(this.client, 'upsertRelatedPersonAndPoll')(ctx, input);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Ingests a FHIR `Communication` and waits for indexing.
|
|
48
|
+
*/
|
|
49
|
+
ingestCommunicationAndUpdateIndex(ctx, input) {
|
|
50
|
+
return requireClientMethod(this.client, 'ingestCommunicationAndUpdateIndex')(ctx, input);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Generates a digital twin projection from subject data.
|
|
54
|
+
*/
|
|
55
|
+
generateDigitalTwinFromSubjectData(ctx, input) {
|
|
56
|
+
return requireClientMethod(this.client, 'generateDigitalTwinFromSubjectData')(ctx, input);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Requests a SMART/OpenID token for subsequent data access flows.
|
|
60
|
+
*/
|
|
61
|
+
requestSmartToken(input) {
|
|
62
|
+
return requireClientMethod(this.client, 'requestSmartToken')(input);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Low-level escape hatch for direct submit/poll flows.
|
|
66
|
+
*/
|
|
67
|
+
submitAndPoll(submitPath, pollPath, payload, pollOptions) {
|
|
68
|
+
return submitAndPollWithClient(this.client, submitPath, pollPath, payload, pollOptions);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type NodeRuntimeClient } from './client-port.js';
|
|
2
|
+
import type { SmartTokenExchangeResult, SmartTokenRequestInput } from '../smart-token.js';
|
|
3
|
+
import type { RouteContext } from '../individual-onboarding.js';
|
|
4
|
+
import type { RelatedPersonUpsertInput } from '../resource-operations.js';
|
|
5
|
+
export declare class IndividualMemberSdk {
|
|
6
|
+
private readonly client;
|
|
7
|
+
constructor(client: NodeRuntimeClient);
|
|
8
|
+
/**
|
|
9
|
+
* Creates or updates the member/caregiver `RelatedPerson` relationship to the subject.
|
|
10
|
+
*/
|
|
11
|
+
upsertRelatedPersonAndPoll(ctx: RouteContext, input: RelatedPersonUpsertInput): Promise<import("./client-port.js").SubmitAndPollResult>;
|
|
12
|
+
/**
|
|
13
|
+
* Requests a SMART token for a non-employee actor such as a `RelatedPerson`
|
|
14
|
+
* caregiver, guardian, or family member.
|
|
15
|
+
*/
|
|
16
|
+
requestSmartToken(input: SmartTokenRequestInput): Promise<SmartTokenExchangeResult>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
|
|
2
|
+
import { requireClientMethod } from './client-port.js';
|
|
3
|
+
export class IndividualMemberSdk {
|
|
4
|
+
constructor(client) {
|
|
5
|
+
this.client = client;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Creates or updates the member/caregiver `RelatedPerson` relationship to the subject.
|
|
9
|
+
*/
|
|
10
|
+
upsertRelatedPersonAndPoll(ctx, input) {
|
|
11
|
+
return requireClientMethod(this.client, 'upsertRelatedPersonAndPoll')(ctx, input);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Requests a SMART token for a non-employee actor such as a `RelatedPerson`
|
|
15
|
+
* caregiver, guardian, or family member.
|
|
16
|
+
*/
|
|
17
|
+
requestSmartToken(input) {
|
|
18
|
+
return requireClientMethod(this.client, 'requestSmartToken')(input);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { type NodeRuntimeClient, type PollOptions, type SubmitAndPollResult, type SubmitPayload } from './client-port.js';
|
|
2
|
+
import type { RouteContext } from '../individual-onboarding.js';
|
|
3
|
+
import type { EmployeeDeviceActivationResult, EmployeeDeviceActivationRequestInput } from '../device-activation.js';
|
|
4
|
+
import type { SmartTokenExchangeResult, SmartTokenRequestInput } from '../smart-token.js';
|
|
5
|
+
import type { CommunicationIngestionInput, GrantProfessionalAccessInput, GrantProfessionalAccessResult, OrganizationEmployeeCreationInput } from '../resource-operations.js';
|
|
6
|
+
/**
|
|
7
|
+
* Organization-controller oriented facade over a `NodeRuntimeClient`.
|
|
8
|
+
*
|
|
9
|
+
* Use this class when the caller already knows it is acting as an organization
|
|
10
|
+
* controller/admin and wants the smallest API surface for that role.
|
|
11
|
+
*/
|
|
12
|
+
export declare class OrganizationControllerSdk {
|
|
13
|
+
private readonly client;
|
|
14
|
+
/**
|
|
15
|
+
* @param client Runtime client implementation used to submit and poll GW flows.
|
|
16
|
+
*/
|
|
17
|
+
constructor(client: NodeRuntimeClient);
|
|
18
|
+
/**
|
|
19
|
+
* Creates an employee/professional under the current organization tenant.
|
|
20
|
+
*/
|
|
21
|
+
createOrganizationEmployee(ctx: RouteContext, input: OrganizationEmployeeCreationInput, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
|
|
22
|
+
/**
|
|
23
|
+
* Activates the employee device from a previously issued activation request.
|
|
24
|
+
*/
|
|
25
|
+
activateEmployeeDeviceWithActivationRequest(input: EmployeeDeviceActivationRequestInput): Promise<EmployeeDeviceActivationResult>;
|
|
26
|
+
/**
|
|
27
|
+
* Requests a SMART token for the current organization-scoped actor.
|
|
28
|
+
*
|
|
29
|
+
* The actor identity should normally be passed as `actorDid`, while route
|
|
30
|
+
* details should come from the client default context unless legacy
|
|
31
|
+
* compatibility requires overriding them on the call.
|
|
32
|
+
*/
|
|
33
|
+
requestSmartToken(input: SmartTokenRequestInput): Promise<SmartTokenExchangeResult>;
|
|
34
|
+
/**
|
|
35
|
+
* Ingests a `Communication` and waits for indexing.
|
|
36
|
+
*/
|
|
37
|
+
ingestCommunicationAndUpdateIndex(ctx: RouteContext, input: CommunicationIngestionInput): Promise<SubmitAndPollResult>;
|
|
38
|
+
/**
|
|
39
|
+
* Grants access to a professional through a consent flow.
|
|
40
|
+
*/
|
|
41
|
+
grantProfessionalAccess(ctx: RouteContext, input: GrantProfessionalAccessInput): Promise<GrantProfessionalAccessResult>;
|
|
42
|
+
/**
|
|
43
|
+
* Low-level escape hatch for direct submit/poll flows.
|
|
44
|
+
*/
|
|
45
|
+
submitAndPoll(submitPath: string, pollPath: string, payload: SubmitPayload, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
|
|
46
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
|
|
2
|
+
import { requireClientMethod, submitAndPollWithClient, } from './client-port.js';
|
|
3
|
+
/**
|
|
4
|
+
* Organization-controller oriented facade over a `NodeRuntimeClient`.
|
|
5
|
+
*
|
|
6
|
+
* Use this class when the caller already knows it is acting as an organization
|
|
7
|
+
* controller/admin and wants the smallest API surface for that role.
|
|
8
|
+
*/
|
|
9
|
+
export class OrganizationControllerSdk {
|
|
10
|
+
/**
|
|
11
|
+
* @param client Runtime client implementation used to submit and poll GW flows.
|
|
12
|
+
*/
|
|
13
|
+
constructor(client) {
|
|
14
|
+
this.client = client;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Creates an employee/professional under the current organization tenant.
|
|
18
|
+
*/
|
|
19
|
+
createOrganizationEmployee(ctx, input, pollOptions) {
|
|
20
|
+
return requireClientMethod(this.client, 'createOrganizationEmployee')(ctx, input, pollOptions);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Activates the employee device from a previously issued activation request.
|
|
24
|
+
*/
|
|
25
|
+
activateEmployeeDeviceWithActivationRequest(input) {
|
|
26
|
+
return requireClientMethod(this.client, 'activateEmployeeDeviceWithActivationRequest')(input);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Requests a SMART token for the current organization-scoped actor.
|
|
30
|
+
*
|
|
31
|
+
* The actor identity should normally be passed as `actorDid`, while route
|
|
32
|
+
* details should come from the client default context unless legacy
|
|
33
|
+
* compatibility requires overriding them on the call.
|
|
34
|
+
*/
|
|
35
|
+
requestSmartToken(input) {
|
|
36
|
+
return requireClientMethod(this.client, 'requestSmartToken')(input);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Ingests a `Communication` and waits for indexing.
|
|
40
|
+
*/
|
|
41
|
+
ingestCommunicationAndUpdateIndex(ctx, input) {
|
|
42
|
+
return requireClientMethod(this.client, 'ingestCommunicationAndUpdateIndex')(ctx, input);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Grants access to a professional through a consent flow.
|
|
46
|
+
*/
|
|
47
|
+
grantProfessionalAccess(ctx, input) {
|
|
48
|
+
return requireClientMethod(this.client, 'grantProfessionalAccess')(ctx, input);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Low-level escape hatch for direct submit/poll flows.
|
|
52
|
+
*/
|
|
53
|
+
submitAndPoll(submitPath, pollPath, payload, pollOptions) {
|
|
54
|
+
return submitAndPollWithClient(this.client, submitPath, pollPath, payload, pollOptions);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type NodeRuntimeClient } from './client-port.js';
|
|
2
|
+
import type { EmployeeDeviceActivationResult, EmployeeDeviceActivationRequestInput } from '../device-activation.js';
|
|
3
|
+
import type { SmartTokenExchangeResult, SmartTokenRequestInput } from '../smart-token.js';
|
|
4
|
+
export declare class OrganizationEmployeeSdk {
|
|
5
|
+
private readonly client;
|
|
6
|
+
constructor(client: NodeRuntimeClient);
|
|
7
|
+
activateEmployeeDeviceWithActivationRequest(input: EmployeeDeviceActivationRequestInput): Promise<EmployeeDeviceActivationResult>;
|
|
8
|
+
requestSmartToken(input: SmartTokenRequestInput): Promise<SmartTokenExchangeResult>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
|
|
2
|
+
import { requireClientMethod } from './client-port.js';
|
|
3
|
+
export class OrganizationEmployeeSdk {
|
|
4
|
+
constructor(client) {
|
|
5
|
+
this.client = client;
|
|
6
|
+
}
|
|
7
|
+
activateEmployeeDeviceWithActivationRequest(input) {
|
|
8
|
+
return requireClientMethod(this.client, 'activateEmployeeDeviceWithActivationRequest')(input);
|
|
9
|
+
}
|
|
10
|
+
requestSmartToken(input) {
|
|
11
|
+
return requireClientMethod(this.client, 'requestSmartToken')(input);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type NodeRuntimeClient, type PollOptions, type SubmitAndPollResult, type SubmitPayload } from './client-port.js';
|
|
2
|
+
import type { IndividualOrganizationBootstrapInput, IndividualOrganizationStartResult } from '../individual-start.js';
|
|
3
|
+
import type { RouteContext } from '../individual-onboarding.js';
|
|
4
|
+
import type { CommunicationIngestionInput, DigitalTwinGenerationInput, GrantProfessionalAccessInput, GrantProfessionalAccessResult, IpsOrFhirImportInput } from '../resource-operations.js';
|
|
5
|
+
import type { SmartTokenExchangeResult, SmartTokenRequestInput } from '../smart-token.js';
|
|
6
|
+
export declare class PersonalSdk {
|
|
7
|
+
private readonly client;
|
|
8
|
+
constructor(client: NodeRuntimeClient);
|
|
9
|
+
/** Starts individual subject onboarding (organization profile) and returns offer preview. */
|
|
10
|
+
startIndividualOrganization(input: IndividualOrganizationBootstrapInput): Promise<IndividualOrganizationStartResult>;
|
|
11
|
+
/** Grants professional access via Consent for a subject. */
|
|
12
|
+
grantProfessionalAccess(ctx: RouteContext, input: GrantProfessionalAccessInput): Promise<GrantProfessionalAccessResult>;
|
|
13
|
+
/** Imports IPS/FHIR payload and updates document index projections. */
|
|
14
|
+
importIpsOrFhirAndUpdateIndex(ctx: RouteContext, input: IpsOrFhirImportInput): Promise<SubmitAndPollResult>;
|
|
15
|
+
/** Ingests canonical Communication and waits for projection completion. */
|
|
16
|
+
ingestCommunicationAndUpdateIndex(ctx: RouteContext, input: CommunicationIngestionInput): Promise<SubmitAndPollResult>;
|
|
17
|
+
/** Triggers digital twin generation from subject data. */
|
|
18
|
+
generateDigitalTwinFromSubjectData(ctx: RouteContext, input: DigitalTwinGenerationInput): Promise<SubmitAndPollResult>;
|
|
19
|
+
/** Requests SMART/OpenID token with simplified exchange flow. */
|
|
20
|
+
requestSmartToken(input: SmartTokenRequestInput): Promise<SmartTokenExchangeResult>;
|
|
21
|
+
submitAndPoll(submitPath: string, pollPath: string, payload: SubmitPayload, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
|
|
2
|
+
import { requireClientMethod, submitAndPollWithClient, } from './client-port.js';
|
|
3
|
+
export class PersonalSdk {
|
|
4
|
+
constructor(client) {
|
|
5
|
+
this.client = client;
|
|
6
|
+
}
|
|
7
|
+
/** Starts individual subject onboarding (organization profile) and returns offer preview. */
|
|
8
|
+
startIndividualOrganization(input) {
|
|
9
|
+
return requireClientMethod(this.client, 'startIndividualOrganization')(input);
|
|
10
|
+
}
|
|
11
|
+
/** Grants professional access via Consent for a subject. */
|
|
12
|
+
grantProfessionalAccess(ctx, input) {
|
|
13
|
+
return requireClientMethod(this.client, 'grantProfessionalAccess')(ctx, input);
|
|
14
|
+
}
|
|
15
|
+
/** Imports IPS/FHIR payload and updates document index projections. */
|
|
16
|
+
importIpsOrFhirAndUpdateIndex(ctx, input) {
|
|
17
|
+
return requireClientMethod(this.client, 'importIpsOrFhirAndUpdateIndex')(ctx, input);
|
|
18
|
+
}
|
|
19
|
+
/** Ingests canonical Communication and waits for projection completion. */
|
|
20
|
+
ingestCommunicationAndUpdateIndex(ctx, input) {
|
|
21
|
+
return requireClientMethod(this.client, 'ingestCommunicationAndUpdateIndex')(ctx, input);
|
|
22
|
+
}
|
|
23
|
+
/** Triggers digital twin generation from subject data. */
|
|
24
|
+
generateDigitalTwinFromSubjectData(ctx, input) {
|
|
25
|
+
return requireClientMethod(this.client, 'generateDigitalTwinFromSubjectData')(ctx, input);
|
|
26
|
+
}
|
|
27
|
+
/** Requests SMART/OpenID token with simplified exchange flow. */
|
|
28
|
+
requestSmartToken(input) {
|
|
29
|
+
return requireClientMethod(this.client, 'requestSmartToken')(input);
|
|
30
|
+
}
|
|
31
|
+
submitAndPoll(submitPath, pollPath, payload, pollOptions) {
|
|
32
|
+
return submitAndPollWithClient(this.client, submitPath, pollPath, payload, pollOptions);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { ControllerBindingInput } from 'gdc-common-utils-ts/models';
|
|
2
|
+
import { type NodeRuntimeClient, type PollOptions, type SubmitAndPollResult, type SubmitPayload } from './client-port.js';
|
|
3
|
+
import type { HostRouteContext } from '../host-onboarding.js';
|
|
4
|
+
import type { RouteContext } from '../individual-onboarding.js';
|
|
5
|
+
import type { EmployeeDeviceActivationResult, EmployeeDeviceActivationRequestInput } from '../device-activation.js';
|
|
6
|
+
import type { SmartTokenExchangeResult, SmartTokenRequestInput } from '../smart-token.js';
|
|
7
|
+
import type { CommunicationIngestionInput, GrantProfessionalAccessInput, GrantProfessionalAccessResult, OrganizationEmployeeCreationInput } from '../resource-operations.js';
|
|
8
|
+
/**
|
|
9
|
+
* Professional-oriented facade combining host onboarding, employee bootstrap,
|
|
10
|
+
* consent, communication, and SMART token runtime calls.
|
|
11
|
+
*/
|
|
12
|
+
export declare class ProfessionalSdk {
|
|
13
|
+
private readonly client;
|
|
14
|
+
/**
|
|
15
|
+
* @param client Runtime client implementation used to submit and poll GW flows.
|
|
16
|
+
*/
|
|
17
|
+
constructor(client: NodeRuntimeClient);
|
|
18
|
+
/**
|
|
19
|
+
* Activates the legal organization in the gateway from an ICA-issued proof token.
|
|
20
|
+
*/
|
|
21
|
+
activateOrganizationInGatewayFromIcaProof(hostCtx: HostRouteContext, input: {
|
|
22
|
+
vpToken: string;
|
|
23
|
+
controller?: ControllerBindingInput;
|
|
24
|
+
additionalClaims?: Record<string, unknown>;
|
|
25
|
+
}, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
|
|
26
|
+
/**
|
|
27
|
+
* Creates an employee/professional under the current organization tenant.
|
|
28
|
+
*/
|
|
29
|
+
createOrganizationEmployee(ctx: RouteContext, input: OrganizationEmployeeCreationInput, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
|
|
30
|
+
/**
|
|
31
|
+
* Activates the current employee device from a previously issued activation request.
|
|
32
|
+
*/
|
|
33
|
+
activateEmployeeDeviceWithActivationRequest(input: EmployeeDeviceActivationRequestInput): Promise<EmployeeDeviceActivationResult>;
|
|
34
|
+
/**
|
|
35
|
+
* Requests a SMART token suitable for subsequent clinical/document calls.
|
|
36
|
+
*
|
|
37
|
+
* In the canonical flow the caller normally provides:
|
|
38
|
+
* - `actorDid`
|
|
39
|
+
* - `subjectDid`
|
|
40
|
+
* - requested `scopes`
|
|
41
|
+
*
|
|
42
|
+
* Tenant route context can be inherited from the configured
|
|
43
|
+
* `NodeHttpClient({ ctx })` instead of being repeated on every call.
|
|
44
|
+
*/
|
|
45
|
+
requestSmartToken(input: SmartTokenRequestInput): Promise<SmartTokenExchangeResult>;
|
|
46
|
+
/**
|
|
47
|
+
* Ingests a FHIR `Communication` and waits for indexing.
|
|
48
|
+
*/
|
|
49
|
+
ingestCommunicationAndUpdateIndex(ctx: RouteContext, input: CommunicationIngestionInput): Promise<SubmitAndPollResult>;
|
|
50
|
+
/**
|
|
51
|
+
* Grants access to a professional through a consent flow.
|
|
52
|
+
*/
|
|
53
|
+
grantProfessionalAccess(ctx: RouteContext, input: GrantProfessionalAccessInput): Promise<GrantProfessionalAccessResult>;
|
|
54
|
+
/**
|
|
55
|
+
* Low-level escape hatch for direct submit/poll flows.
|
|
56
|
+
*/
|
|
57
|
+
submitAndPoll(submitPath: string, pollPath: string, payload: SubmitPayload, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
|
|
58
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { requireClientMethod, submitAndPollWithClient, } from './client-port.js';
|
|
2
|
+
/**
|
|
3
|
+
* Professional-oriented facade combining host onboarding, employee bootstrap,
|
|
4
|
+
* consent, communication, and SMART token runtime calls.
|
|
5
|
+
*/
|
|
6
|
+
export class ProfessionalSdk {
|
|
7
|
+
/**
|
|
8
|
+
* @param client Runtime client implementation used to submit and poll GW flows.
|
|
9
|
+
*/
|
|
10
|
+
constructor(client) {
|
|
11
|
+
this.client = client;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Activates the legal organization in the gateway from an ICA-issued proof token.
|
|
15
|
+
*/
|
|
16
|
+
activateOrganizationInGatewayFromIcaProof(hostCtx, input, pollOptions) {
|
|
17
|
+
return requireClientMethod(this.client, 'activateOrganizationInGatewayFromIcaProof')(hostCtx, input, pollOptions);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Creates an employee/professional under the current organization tenant.
|
|
21
|
+
*/
|
|
22
|
+
createOrganizationEmployee(ctx, input, pollOptions) {
|
|
23
|
+
return requireClientMethod(this.client, 'createOrganizationEmployee')(ctx, input, pollOptions);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Activates the current employee device from a previously issued activation request.
|
|
27
|
+
*/
|
|
28
|
+
activateEmployeeDeviceWithActivationRequest(input) {
|
|
29
|
+
return requireClientMethod(this.client, 'activateEmployeeDeviceWithActivationRequest')(input);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Requests a SMART token suitable for subsequent clinical/document calls.
|
|
33
|
+
*
|
|
34
|
+
* In the canonical flow the caller normally provides:
|
|
35
|
+
* - `actorDid`
|
|
36
|
+
* - `subjectDid`
|
|
37
|
+
* - requested `scopes`
|
|
38
|
+
*
|
|
39
|
+
* Tenant route context can be inherited from the configured
|
|
40
|
+
* `NodeHttpClient({ ctx })` instead of being repeated on every call.
|
|
41
|
+
*/
|
|
42
|
+
requestSmartToken(input) {
|
|
43
|
+
return requireClientMethod(this.client, 'requestSmartToken')(input);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Ingests a FHIR `Communication` and waits for indexing.
|
|
47
|
+
*/
|
|
48
|
+
ingestCommunicationAndUpdateIndex(ctx, input) {
|
|
49
|
+
return requireClientMethod(this.client, 'ingestCommunicationAndUpdateIndex')(ctx, input);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Grants access to a professional through a consent flow.
|
|
53
|
+
*/
|
|
54
|
+
grantProfessionalAccess(ctx, input) {
|
|
55
|
+
return requireClientMethod(this.client, 'grantProfessionalAccess')(ctx, input);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Low-level escape hatch for direct submit/poll flows.
|
|
59
|
+
*/
|
|
60
|
+
submitAndPoll(submitPath, pollPath, payload, pollOptions) {
|
|
61
|
+
return submitAndPollWithClient(this.client, submitPath, pollPath, payload, pollOptions);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { resolvePollOptionsFromSeconds } from '../../gdc-sdk-core-ts/dist/index.js';
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import type { BundleSearchQuery, CommunicationInput, DateRange } from '../../gdc-sdk-core-ts/dist/index.js';
|
|
2
|
+
import type { SubmitAndPollResult } from './orchestration/client-port.js';
|
|
3
|
+
import type { RouteContext } from './individual-onboarding.js';
|
|
4
|
+
export type OrganizationEmployeeCreationInput = {
|
|
5
|
+
/**
|
|
6
|
+
* Canonical employee/person claims sent to CORE GW.
|
|
7
|
+
*
|
|
8
|
+
* Use `org.schema.Person.*` claim keys, not invented `Employee.*` keys.
|
|
9
|
+
* Typical examples are:
|
|
10
|
+
* - `@context = org.schema`
|
|
11
|
+
* - `org.schema.Person.identifier`
|
|
12
|
+
* - `org.schema.Person.email`
|
|
13
|
+
* - `org.schema.Person.hasOccupation.identifier.value`
|
|
14
|
+
* - optionally `org.schema.Person.memberOf`
|
|
15
|
+
* - canonically `org.schema.Person.memberOf.taxID` for employee membership under an organization
|
|
16
|
+
*
|
|
17
|
+
* Current CORE GW examples and ICA representative/employee materials are based
|
|
18
|
+
* on `org.schema.Person.memberOf.taxID`. In shared constants this can be
|
|
19
|
+
* referenced as `ClaimsPersonSchemaorg.memberOfOrgTaxId`. Do not invent
|
|
20
|
+
* `Employee.*` claims.
|
|
21
|
+
*/
|
|
22
|
+
employeeClaims: Record<string, unknown>;
|
|
23
|
+
dataType?: string;
|
|
24
|
+
};
|
|
25
|
+
export type IpsOrFhirImportInput = {
|
|
26
|
+
compositionPayload: {
|
|
27
|
+
thid?: string;
|
|
28
|
+
} & Record<string, unknown>;
|
|
29
|
+
format?: 'api' | 'r4';
|
|
30
|
+
pollOptions?: {
|
|
31
|
+
timeoutMs?: number;
|
|
32
|
+
intervalMs?: number;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export type RelatedPersonUpsertInput = {
|
|
36
|
+
relatedPersonPayload: {
|
|
37
|
+
thid?: string;
|
|
38
|
+
} & Record<string, unknown>;
|
|
39
|
+
pollOptions?: {
|
|
40
|
+
timeoutMs?: number;
|
|
41
|
+
intervalMs?: number;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
export type CommunicationIngestionInput = {
|
|
45
|
+
communicationPayload: CommunicationInput & Record<string, unknown>;
|
|
46
|
+
pathFormatSegment?: 'org.hl7.fhir.api' | 'org.hl7.fhir.r4' | 'api' | 'r4' | 'fhir.r4';
|
|
47
|
+
autoConvertClaimsToFhirR4?: boolean;
|
|
48
|
+
pollOptions?: {
|
|
49
|
+
timeoutMs?: number;
|
|
50
|
+
intervalMs?: number;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
export type ClinicalDateRange = DateRange;
|
|
54
|
+
export type ClinicalBundleSearchInput = Omit<BundleSearchQuery, 'section' | 'searchParams'> & {
|
|
55
|
+
section?: string | string[];
|
|
56
|
+
extraSearchParams?: BundleSearchQuery['searchParams'];
|
|
57
|
+
requestThid?: string;
|
|
58
|
+
pollOptions?: {
|
|
59
|
+
timeoutMs?: number;
|
|
60
|
+
intervalMs?: number;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
export type ConsentActorTargetInput = string | string[] | {
|
|
64
|
+
identifier?: string;
|
|
65
|
+
url?: string;
|
|
66
|
+
didWeb?: string;
|
|
67
|
+
organizationUrl?: string;
|
|
68
|
+
organizationTaxId?: string;
|
|
69
|
+
email?: string;
|
|
70
|
+
phone?: string;
|
|
71
|
+
};
|
|
72
|
+
export type GrantProfessionalAccessInput = {
|
|
73
|
+
subjectDid?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Compatibility/extension field.
|
|
76
|
+
*
|
|
77
|
+
* CORE canonical consent examples identify the subject with `subjectDid`.
|
|
78
|
+
* Phone-based subject targeting should be treated as an extension concern.
|
|
79
|
+
*/
|
|
80
|
+
subjectPhone?: string;
|
|
81
|
+
/**
|
|
82
|
+
* Compatibility/extension field used by phone/notification-heavy UX layers.
|
|
83
|
+
*
|
|
84
|
+
* CORE canonical consent examples do not require a display name side-field.
|
|
85
|
+
*/
|
|
86
|
+
subjectGivenName?: string;
|
|
87
|
+
/**
|
|
88
|
+
* Canonical flat actor identifier for the actor receiving the permission.
|
|
89
|
+
*
|
|
90
|
+
* Preferred input forms:
|
|
91
|
+
* - `did:web:...`
|
|
92
|
+
* - `user@example.org`
|
|
93
|
+
* - `tel:+34600111222`
|
|
94
|
+
* - `ES`
|
|
95
|
+
* - comma-separated lists or string arrays of those tokens
|
|
96
|
+
*
|
|
97
|
+
* A legacy structured object is still accepted for compatibility, but new
|
|
98
|
+
* integrations should send canonical strings or string arrays.
|
|
99
|
+
*/
|
|
100
|
+
actorId?: ConsentActorTargetInput;
|
|
101
|
+
/**
|
|
102
|
+
* @deprecated Use `actorId`.
|
|
103
|
+
*/
|
|
104
|
+
actor?: ConsentActorTargetInput;
|
|
105
|
+
actorRole: string;
|
|
106
|
+
purpose: string;
|
|
107
|
+
actions: string[];
|
|
108
|
+
consentIdentifier?: string;
|
|
109
|
+
consentDate?: string;
|
|
110
|
+
decision?: 'permit' | 'deny';
|
|
111
|
+
attachmentContentType?: string;
|
|
112
|
+
attachmentBase64?: string;
|
|
113
|
+
dataType?: string;
|
|
114
|
+
pollOptions?: {
|
|
115
|
+
timeoutMs?: number;
|
|
116
|
+
intervalMs?: number;
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
export type GrantProfessionalAccessResult = {
|
|
120
|
+
thid: string;
|
|
121
|
+
consent: SubmitAndPollResult;
|
|
122
|
+
subjectIdentifier: string;
|
|
123
|
+
actorIdentifier: string;
|
|
124
|
+
consentClaims: Record<string, unknown>;
|
|
125
|
+
claimsCid?: string;
|
|
126
|
+
};
|
|
127
|
+
export type DigitalTwinGenerationInput = {
|
|
128
|
+
compositionPayload: {
|
|
129
|
+
thid?: string;
|
|
130
|
+
} & Record<string, unknown>;
|
|
131
|
+
format?: 'api' | 'r4';
|
|
132
|
+
pollOptions?: {
|
|
133
|
+
timeoutMs?: number;
|
|
134
|
+
intervalMs?: number;
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
export declare function createOrganizationEmployeeWithDeps(routeCtx: RouteContext, input: OrganizationEmployeeCreationInput, options: {
|
|
138
|
+
timeoutMs?: number;
|
|
139
|
+
intervalMs?: number;
|
|
140
|
+
} | undefined, deps: {
|
|
141
|
+
employeeBatchPath: (ctx: RouteContext) => string;
|
|
142
|
+
employeePollPath: (ctx: RouteContext) => string;
|
|
143
|
+
submitAndPoll: (submitPath: string, pollPath: string, payload: {
|
|
144
|
+
thid?: string;
|
|
145
|
+
} & Record<string, unknown>, pollOptions?: {
|
|
146
|
+
timeoutMs?: number;
|
|
147
|
+
intervalMs?: number;
|
|
148
|
+
}) => Promise<SubmitAndPollResult>;
|
|
149
|
+
}): Promise<SubmitAndPollResult>;
|
|
150
|
+
export declare function importIpsOrFhirAndUpdateIndexWithDeps(routeCtx: RouteContext, input: IpsOrFhirImportInput, deps: {
|
|
151
|
+
individualCompositionR4BatchPath: (ctx: RouteContext) => string;
|
|
152
|
+
individualCompositionR4PollPath: (ctx: RouteContext) => string;
|
|
153
|
+
submitAndPoll: (submitPath: string, pollPath: string, payload: {
|
|
154
|
+
thid?: string;
|
|
155
|
+
} & Record<string, unknown>, pollOptions?: {
|
|
156
|
+
timeoutMs?: number;
|
|
157
|
+
intervalMs?: number;
|
|
158
|
+
}) => Promise<SubmitAndPollResult>;
|
|
159
|
+
}): Promise<SubmitAndPollResult>;
|
|
160
|
+
export declare function upsertRelatedPersonAndPollWithDeps(routeCtx: RouteContext, input: RelatedPersonUpsertInput, deps: {
|
|
161
|
+
individualRelatedPersonBatchPath: (ctx: RouteContext) => string;
|
|
162
|
+
individualRelatedPersonPollPath: (ctx: RouteContext) => string;
|
|
163
|
+
submitAndPoll: (submitPath: string, pollPath: string, payload: {
|
|
164
|
+
thid?: string;
|
|
165
|
+
} & Record<string, unknown>, pollOptions?: {
|
|
166
|
+
timeoutMs?: number;
|
|
167
|
+
intervalMs?: number;
|
|
168
|
+
}) => Promise<SubmitAndPollResult>;
|
|
169
|
+
}): Promise<SubmitAndPollResult>;
|
|
170
|
+
export declare function ingestCommunicationAndUpdateIndexWithDeps(routeCtx: RouteContext, input: CommunicationIngestionInput, deps: {
|
|
171
|
+
individualCommunicationBatchPath: (ctx: RouteContext, pathFormatSegment: 'org.hl7.fhir.api' | 'org.hl7.fhir.r4') => string;
|
|
172
|
+
individualCommunicationPollPath: (ctx: RouteContext, pathFormatSegment: 'org.hl7.fhir.api' | 'org.hl7.fhir.r4') => string;
|
|
173
|
+
transformPayloadForFhirR4?: (payload: Record<string, unknown>, enabled: boolean) => Record<string, unknown>;
|
|
174
|
+
submitAndPoll: (submitPath: string, pollPath: string, payload: {
|
|
175
|
+
thid?: string;
|
|
176
|
+
} & Record<string, unknown>, pollOptions?: {
|
|
177
|
+
timeoutMs?: number;
|
|
178
|
+
intervalMs?: number;
|
|
179
|
+
}) => Promise<SubmitAndPollResult>;
|
|
180
|
+
}): Promise<SubmitAndPollResult>;
|
|
181
|
+
export declare function searchClinicalBundleWithDeps(routeCtx: RouteContext, input: ClinicalBundleSearchInput, deps: {
|
|
182
|
+
bundleSearchPath: (ctx: RouteContext) => string;
|
|
183
|
+
bundleSearchPollPath: (ctx: RouteContext) => string;
|
|
184
|
+
submitAndPoll: (submitPath: string, pollPath: string, payload: {
|
|
185
|
+
thid?: string;
|
|
186
|
+
} & Record<string, unknown>, pollOptions?: {
|
|
187
|
+
timeoutMs?: number;
|
|
188
|
+
intervalMs?: number;
|
|
189
|
+
}) => Promise<SubmitAndPollResult>;
|
|
190
|
+
}): Promise<SubmitAndPollResult>;
|
|
191
|
+
export declare function searchLatestIpsWithDeps(routeCtx: RouteContext, input: Omit<ClinicalBundleSearchInput, 'includedTypes' | 'section'> & {
|
|
192
|
+
section?: string | string[];
|
|
193
|
+
}, deps: {
|
|
194
|
+
searchClinicalBundle: (routeCtx: RouteContext, input: ClinicalBundleSearchInput) => Promise<SubmitAndPollResult>;
|
|
195
|
+
}): Promise<SubmitAndPollResult>;
|
|
196
|
+
export declare function grantProfessionalAccessWithDeps(routeCtx: RouteContext, input: GrantProfessionalAccessInput, deps: {
|
|
197
|
+
buildConsentClaimsWithCid: (input: GrantProfessionalAccessInput, options?: {
|
|
198
|
+
consentIdentifierFactory: () => string;
|
|
199
|
+
}) => {
|
|
200
|
+
actorIdentifier: string;
|
|
201
|
+
subjectIdentifier: string;
|
|
202
|
+
consentClaims: Record<string, unknown>;
|
|
203
|
+
claimsCid?: string;
|
|
204
|
+
};
|
|
205
|
+
individualConsentR4BatchPath: (ctx: RouteContext) => string;
|
|
206
|
+
individualConsentR4PollPath: (ctx: RouteContext) => string;
|
|
207
|
+
submitAndPoll: (submitPath: string, pollPath: string, payload: {
|
|
208
|
+
thid?: string;
|
|
209
|
+
} & Record<string, unknown>, pollOptions?: {
|
|
210
|
+
timeoutMs?: number;
|
|
211
|
+
intervalMs?: number;
|
|
212
|
+
}) => Promise<SubmitAndPollResult>;
|
|
213
|
+
}): Promise<GrantProfessionalAccessResult>;
|
|
214
|
+
export declare function generateDigitalTwinFromSubjectDataWithDeps(routeCtx: RouteContext, input: DigitalTwinGenerationInput, deps: {
|
|
215
|
+
digitalTwinCompositionApiBatchPath: (ctx: RouteContext) => string;
|
|
216
|
+
digitalTwinCompositionApiPollPath: (ctx: RouteContext) => string;
|
|
217
|
+
digitalTwinCompositionR4BatchPath: (ctx: RouteContext) => string;
|
|
218
|
+
digitalTwinCompositionR4PollPath: (ctx: RouteContext) => string;
|
|
219
|
+
submitAndPoll: (submitPath: string, pollPath: string, payload: {
|
|
220
|
+
thid?: string;
|
|
221
|
+
} & Record<string, unknown>, pollOptions?: {
|
|
222
|
+
timeoutMs?: number;
|
|
223
|
+
intervalMs?: number;
|
|
224
|
+
}) => Promise<SubmitAndPollResult>;
|
|
225
|
+
}): Promise<SubmitAndPollResult>;
|