gdc-sdk-node-ts 0.12.0 → 2.0.4
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 +118 -12
- package/dist/backend-profile-runtime.d.ts +262 -0
- package/dist/backend-profile-runtime.js +498 -0
- package/dist/consent-claim-helpers.d.ts +2 -1
- package/dist/family-organization-registration.d.ts +40 -0
- package/dist/family-organization-registration.js +54 -0
- package/dist/family-organization-search.d.ts +30 -0
- package/dist/family-organization-search.js +59 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +7 -0
- package/dist/individual-controller-backend-runtime.d.ts +59 -0
- package/dist/individual-controller-backend-runtime.js +67 -0
- package/dist/legal-organization-onboarding-facade.d.ts +70 -0
- package/dist/legal-organization-onboarding-facade.js +169 -0
- package/dist/node-runtime-client.d.ts +98 -2
- package/dist/node-runtime-client.js +178 -6
- package/dist/orchestration/client-port.d.ts +31 -1
- package/dist/orchestration/individual-controller-sdk.d.ts +23 -1
- package/dist/orchestration/individual-controller-sdk.js +28 -0
- package/dist/orchestration/organization-controller-sdk.d.ts +22 -1
- package/dist/orchestration/organization-controller-sdk.js +25 -0
- package/dist/orchestration/personal-sdk.d.ts +3 -1
- package/dist/orchestration/personal-sdk.js +4 -0
- package/dist/orchestration/professional-sdk.d.ts +16 -1
- package/dist/orchestration/professional-sdk.js +21 -0
- package/dist/organization-controller-backend-runtime.d.ts +65 -0
- package/dist/organization-controller-backend-runtime.js +83 -0
- package/dist/professional-backend-runtime.d.ts +36 -0
- package/dist/professional-backend-runtime.js +41 -0
- package/dist/profile-workspace.d.ts +82 -0
- package/dist/profile-workspace.js +127 -0
- package/dist/resource-operations.d.ts +79 -5
- package/dist/resource-operations.js +50 -5
- package/package.json +8 -3
package/README.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# gdc-sdk-node-ts
|
|
2
2
|
|
|
3
|
+
See [ARCHITECTURE.md](./ARCHITECTURE.md) and
|
|
4
|
+
[CONTRIBUTING.md](./CONTRIBUTING.md) before adding node runtime facades,
|
|
5
|
+
execution adapters, or orchestration tests.
|
|
6
|
+
|
|
7
|
+
Short rule:
|
|
8
|
+
|
|
9
|
+
- `101` tests must read like executable tutorials
|
|
10
|
+
- shared fixtures/types belong in `gdc-common-utils-ts`, not as local literals
|
|
11
|
+
in node runtime tests
|
|
12
|
+
|
|
3
13
|
Node runtime package for consuming the shared GDC SDK contracts against real
|
|
4
14
|
gateway backends.
|
|
5
15
|
|
|
@@ -32,6 +42,13 @@ Important live-run rule:
|
|
|
32
42
|
- if sandboxed runs disagree with the user's terminal, trust the user's
|
|
33
43
|
terminal for live GW validation
|
|
34
44
|
|
|
45
|
+
Required live validation order:
|
|
46
|
+
|
|
47
|
+
1. local process E2E from real TTY
|
|
48
|
+
2. local Docker image/container E2E
|
|
49
|
+
3. staging E2E
|
|
50
|
+
4. production image/deploy only after staging is green
|
|
51
|
+
|
|
35
52
|
Architectural rule:
|
|
36
53
|
|
|
37
54
|
- shared contracts and actor boundaries come from `gdc-sdk-core-ts`
|
|
@@ -46,6 +63,26 @@ If you are integrating this package for the first time, open these in order:
|
|
|
46
63
|
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)
|
|
47
64
|
Why `core`, `node`, and `front` are separate packages, what belongs in each
|
|
48
65
|
one, and why actor-scoped facades must stay aligned across runtimes.
|
|
66
|
+
1. [tests/101-live-full-cycle-bff-runtime.e2e.test.mjs](./tests/101-live-full-cycle-bff-runtime.e2e.test.mjs)
|
|
67
|
+
Canonical live backend/BFF walkthrough on a fresh local GW lifecycle:
|
|
68
|
+
host/tenant activation, employee provisioning, individual bootstrap,
|
|
69
|
+
consent grant, professional SMART token, clinical read, and final cleanup.
|
|
70
|
+
1. [tests/101-backend-profile-runtime.test.mjs](./tests/101-backend-profile-runtime.test.mjs)
|
|
71
|
+
Minimal backend-generic walkthrough for loading one actor profile,
|
|
72
|
+
registering one trusted device/runtime context, connecting to one subject
|
|
73
|
+
index, reading one subject index composition, and then materializing the
|
|
74
|
+
`IndividualController` facade from the loaded backend session.
|
|
75
|
+
That walkthrough now uses the concrete direct backend runtime over the
|
|
76
|
+
injected `RuntimeClient`, not only one abstract adapter mock, and now also
|
|
77
|
+
demonstrates in-memory `JobManager` usage plus `closeProfile(...)`.
|
|
78
|
+
1. [tests/101-individual-controller-backend-runtime.test.mjs](./tests/101-individual-controller-backend-runtime.test.mjs)
|
|
79
|
+
First pragmatic backend wrapper over the generic profile runtime for the
|
|
80
|
+
current individual-controller CORE baseline:
|
|
81
|
+
load profile, start registration, confirm order, and search the clinical
|
|
82
|
+
index.
|
|
83
|
+
1. [docs/V2_INDIVIDUAL_REGISTRATION_RECONCILIATION.md](./docs/V2_INDIVIDUAL_REGISTRATION_RECONCILIATION.md)
|
|
84
|
+
Reconciles the old consumer flow with the current CORE registration baseline
|
|
85
|
+
and separates the stable registration base from later product extensions.
|
|
49
86
|
1. [docs/101-SDK_END_TO_END.md](./docs/101-SDK_END_TO_END.md)
|
|
50
87
|
Ordered onboarding guide with end-to-end journeys, copy/paste snippets, and
|
|
51
88
|
the recommended reading path for new backend integrators.
|
|
@@ -89,6 +126,16 @@ If you need the shortest path:
|
|
|
89
126
|
- dataspace discovery and fallback/cache boundary:
|
|
90
127
|
[docs/101-DISCOVERY.md](./docs/101-DISCOVERY.md)
|
|
91
128
|
|
|
129
|
+
Current live teaching target:
|
|
130
|
+
|
|
131
|
+
- the main executable tutorial for integrators is now:
|
|
132
|
+
[tests/101-live-full-cycle-bff-runtime.e2e.test.mjs](tests/101-live-full-cycle-bff-runtime.e2e.test.mjs)
|
|
133
|
+
- the standalone actor-profile suites still exist as focused technical slices:
|
|
134
|
+
- [tests/live-profile-runtime-individual.e2e.test.mjs](tests/live-profile-runtime-individual.e2e.test.mjs)
|
|
135
|
+
- [tests/live-profile-runtime-professional.e2e.test.mjs](tests/live-profile-runtime-professional.e2e.test.mjs)
|
|
136
|
+
- the larger runtime suite remains the regression-oriented environment proof:
|
|
137
|
+
[tests/live-gw-node-runtime.e2e.test.mjs](tests/live-gw-node-runtime.e2e.test.mjs)
|
|
138
|
+
|
|
92
139
|
## Executable Usage Examples
|
|
93
140
|
|
|
94
141
|
Open these tests when you want to see exact method calls and exact inputs:
|
|
@@ -107,6 +154,12 @@ Open these tests when you want to see exact method calls and exact inputs:
|
|
|
107
154
|
SMART token request flow.
|
|
108
155
|
- [tests/live-gw-node-runtime.e2e.test.mjs](tests/live-gw-node-runtime.e2e.test.mjs)
|
|
109
156
|
End-to-end runtime wiring against a real GW environment.
|
|
157
|
+
- [tests/101-live-full-cycle-bff-runtime.e2e.test.mjs](tests/101-live-full-cycle-bff-runtime.e2e.test.mjs)
|
|
158
|
+
Single live BFF-oriented `101` that chains tenant, professional, individual,
|
|
159
|
+
consent, SMART, read, and cleanup in one executable conversation.
|
|
160
|
+
- [tests/live-profile-runtime-individual.e2e.test.mjs](tests/live-profile-runtime-individual.e2e.test.mjs)
|
|
161
|
+
Standalone actor-profile E2E for the individual controller on an already
|
|
162
|
+
operational tenant, including scenario-owned cleanup.
|
|
110
163
|
- [tests/101-dataspace-resolver.test.mjs](tests/101-dataspace-resolver.test.mjs)
|
|
111
164
|
Minimal `HttpDataspaceResolver` 101 with one host and one published provider.
|
|
112
165
|
- [tests/101-default-first-dataspace-discovery.test.mjs](tests/101-default-first-dataspace-discovery.test.mjs)
|
|
@@ -115,8 +168,11 @@ Open these tests when you want to see exact method calls and exact inputs:
|
|
|
115
168
|
|
|
116
169
|
## Live GW CORE Flow
|
|
117
170
|
|
|
171
|
+
Use [tests/101-live-full-cycle-bff-runtime.e2e.test.mjs](tests/101-live-full-cycle-bff-runtime.e2e.test.mjs)
|
|
172
|
+
as the canonical live `101` for backend/BFF integrators.
|
|
173
|
+
|
|
118
174
|
Use [tests/live-gw-node-runtime.e2e.test.mjs](tests/live-gw-node-runtime.e2e.test.mjs)
|
|
119
|
-
as the
|
|
175
|
+
as the broader runtime-regression suite.
|
|
120
176
|
|
|
121
177
|
Before running that suite, read:
|
|
122
178
|
|
|
@@ -137,18 +193,23 @@ Teaching rule:
|
|
|
137
193
|
- `LIVE_GW_E2E_EXECUTION_MODE=direct` is the current and only supported mode
|
|
138
194
|
for live validation; queued app-side job management is a later phase
|
|
139
195
|
|
|
140
|
-
Current live flow covered by the test suite:
|
|
196
|
+
Current live `101` flow covered by the test suite:
|
|
197
|
+
|
|
198
|
+
1. activate one hosted tenant / legal organization
|
|
199
|
+
2. provision one professional employee through the organization controller
|
|
200
|
+
3. load the individual-controller profile and bootstrap one hosted individual
|
|
201
|
+
4. confirm the returned order and verify the invoice bundle projection
|
|
202
|
+
5. ingest one IPS/clinical `Communication` through the individual controller
|
|
203
|
+
6. grant professional consent for one patient-summary section
|
|
204
|
+
7. load the professional profile and request one SMART token
|
|
205
|
+
8. read the allowed IPS bundle as the professional actor
|
|
206
|
+
9. clean up consent, individual, employee, tenant, and host state
|
|
207
|
+
|
|
208
|
+
Run the main live `101`:
|
|
141
209
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
default example: `INDIVIDUAL_ALTERNATE_NAME=Doraemon`
|
|
146
|
-
4. ingest two IPS `Communication` bundles, each with one `MedicationStatement`
|
|
147
|
-
5. read the IPS/clinical index and verify both medications are present
|
|
148
|
-
6. request the consolidated IPS bundle through
|
|
149
|
-
`Bundle?type=document&composition.subject=<did>&composition.type=http://loinc.org|60591-5`
|
|
150
|
-
7. verify the returned bundle document contains both medication statements
|
|
151
|
-
8. persist audit/debug traces in `test-results/*.jsonl`
|
|
210
|
+
```bash
|
|
211
|
+
npm run test:e2e:101:live-full-cycle
|
|
212
|
+
```
|
|
152
213
|
|
|
153
214
|
What is still not fully covered as one single root lifecycle:
|
|
154
215
|
|
|
@@ -581,6 +642,7 @@ modules below.
|
|
|
581
642
|
### Node runtime client
|
|
582
643
|
|
|
583
644
|
- [`NodeHttpClient`](src/node-runtime-client.ts)
|
|
645
|
+
- [`NodeHttpClient.submitLegalOrganizationVerificationTransaction(...)`](src/node-runtime-client.ts)
|
|
584
646
|
- [`NodeHttpClient.ingestCommunicationAndUpdateIndex(...)`](src/node-runtime-client.ts)
|
|
585
647
|
- [`NodeHttpClient.submitCommunicationAndPoll(...)`](src/node-runtime-client.ts)
|
|
586
648
|
- [`NodeHttpClient.searchClinicalBundle(...)`](src/node-runtime-client.ts)
|
|
@@ -608,3 +670,47 @@ modules below.
|
|
|
608
670
|
- README explains backend-facing flows first.
|
|
609
671
|
- Shared contract shapes must be documented in `gdc-sdk-core-ts`, not duplicated here.
|
|
610
672
|
- Route details and GW-specific behavior belong in runtime docs and JSDoc, not in app-facing examples.
|
|
673
|
+
|
|
674
|
+
## Host Onboarding Runtime Flow
|
|
675
|
+
|
|
676
|
+
For legal-organization onboarding from a Node BFF/runtime, keep the host steps separate:
|
|
677
|
+
|
|
678
|
+
1. new flow: `Organization/_transaction`
|
|
679
|
+
2. legacy compatibility flow: `ICA _verify -> Organization/_activate`
|
|
680
|
+
3. downstream business continuation: `Order/_batch`
|
|
681
|
+
|
|
682
|
+
Use `OrganizationControllerSdk.submitLegalOrganizationVerificationTransaction(...)` or
|
|
683
|
+
`NodeHttpClient.submitLegalOrganizationVerificationTransaction(...)` for step 1.
|
|
684
|
+
|
|
685
|
+
Rules:
|
|
686
|
+
|
|
687
|
+
- `_transaction` and `_activate` are different flows
|
|
688
|
+
- transport/runtime communication keys stay outside the business payload
|
|
689
|
+
- controller binding key stays in `body.data[].resource.controller.*`
|
|
690
|
+
- do not mix this path with `requestIcaEnrollment` or Fabric
|
|
691
|
+
|
|
692
|
+
Legacy compatibility coverage in the live suite:
|
|
693
|
+
|
|
694
|
+
- the canonical test is `LIVE professional lifecycle on GW`
|
|
695
|
+
- set `RUN_LIVE_GW_E2E_HOST_VERIFICATION_TRANSACTION=1` to exercise:
|
|
696
|
+
- `Organization/_transaction -> Order/_batch`
|
|
697
|
+
- set `RUN_LIVE_GW_E2E_HOST_VERIFICATION_TRANSACTION=0` to exercise the older:
|
|
698
|
+
- `ICA _verify -> Organization/_activate -> Order/_batch`
|
|
699
|
+
|
|
700
|
+
Dedicated legacy live command:
|
|
701
|
+
|
|
702
|
+
```bash
|
|
703
|
+
cd /Users/fernando/GITS/gdc-workspace/gdc-sdk-node-ts
|
|
704
|
+
RUN_LIVE_GW_E2E=1 \
|
|
705
|
+
RUN_LIVE_GW_E2E_ACTOR_CHAIN=1 \
|
|
706
|
+
RUN_LIVE_GW_E2E_HOST_VERIFICATION_TRANSACTION=0 \
|
|
707
|
+
LIVE_GW_E2E_SUITE=professional \
|
|
708
|
+
node --test tests/live-gw-node-runtime.e2e.test.mjs
|
|
709
|
+
```
|
|
710
|
+
|
|
711
|
+
Live E2E legal PDF source:
|
|
712
|
+
|
|
713
|
+
- local file: set `LIVE_GW_HOST_VERIFICATION_PDF_PATH=/abs/path/file.pdf`
|
|
714
|
+
- public URL: set `LIVE_GW_HOST_VERIFICATION_PDF_URL=https://.../file.pdf`
|
|
715
|
+
- if both are present, the live suite prefers `LIVE_GW_HOST_VERIFICATION_PDF_URL`
|
|
716
|
+
- Dropbox-style links are normalized to `dl=1` direct-download mode automatically
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import type { ActorProfileDescriptor, IJobManager, ActorKind, LoadedActorProfile, ProfileLoadRequest, SubjectIndexCompositionRequest, SubjectIndexConnectionRequest, TrustedDeviceRegistrationRequest } from 'gdc-sdk-core-ts';
|
|
2
|
+
import type { ActorSession } from './session.js';
|
|
3
|
+
import type { RuntimeClient } from './orchestration/client-port.js';
|
|
4
|
+
import { IndividualControllerSdk } from './orchestration/individual-controller-sdk.js';
|
|
5
|
+
import { OrganizationControllerSdk } from './orchestration/organization-controller-sdk.js';
|
|
6
|
+
import { ProfessionalSdk } from './orchestration/professional-sdk.js';
|
|
7
|
+
import type { RouteContext } from './individual-onboarding.js';
|
|
8
|
+
/**
|
|
9
|
+
* Result of registering one trusted backend runtime device/profile context.
|
|
10
|
+
*
|
|
11
|
+
* This is intentionally backend-generic. It does not describe one concrete
|
|
12
|
+
* channel or product flow.
|
|
13
|
+
*/
|
|
14
|
+
export type BackendTrustedDeviceRegistrationResult = {
|
|
15
|
+
trustedDeviceId: string;
|
|
16
|
+
status: 'registered' | 'already-trusted';
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Result of connecting one loaded actor profile to one subject index.
|
|
20
|
+
*/
|
|
21
|
+
export type BackendSubjectIndexConnectionResult = {
|
|
22
|
+
subjectId: string;
|
|
23
|
+
userId: string;
|
|
24
|
+
userRoleCode: string;
|
|
25
|
+
status: 'connected' | 'already-connected';
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Result of reading one subject index composition after the relationship is
|
|
29
|
+
* already established.
|
|
30
|
+
*/
|
|
31
|
+
export type BackendSubjectIndexCompositionResult = {
|
|
32
|
+
subjectId: string;
|
|
33
|
+
userId: string;
|
|
34
|
+
userRoleCode: string;
|
|
35
|
+
composition: unknown;
|
|
36
|
+
};
|
|
37
|
+
export declare const BackendSubjectIndexReadModes: Readonly<{
|
|
38
|
+
LatestIps: "latest-ips";
|
|
39
|
+
ClinicalBundle: "clinical-bundle";
|
|
40
|
+
}>;
|
|
41
|
+
export type BackendSubjectIndexReadMode = typeof BackendSubjectIndexReadModes[keyof typeof BackendSubjectIndexReadModes];
|
|
42
|
+
/**
|
|
43
|
+
* Backend materialization of one loaded actor profile with runtime sessions
|
|
44
|
+
* ready to expose actor-scoped facades.
|
|
45
|
+
*/
|
|
46
|
+
export type BackendLoadedActorProfile = LoadedActorProfile & {
|
|
47
|
+
actorSessions: ActorSession[];
|
|
48
|
+
};
|
|
49
|
+
export type BackendIndividualControllerProfile = {
|
|
50
|
+
profile: BackendLoadedActorProfile;
|
|
51
|
+
session: ActorSession;
|
|
52
|
+
sdk: IndividualControllerSdk;
|
|
53
|
+
};
|
|
54
|
+
export type BackendOrganizationControllerProfile = {
|
|
55
|
+
profile: BackendLoadedActorProfile;
|
|
56
|
+
session: ActorSession;
|
|
57
|
+
sdk: OrganizationControllerSdk;
|
|
58
|
+
};
|
|
59
|
+
export type BackendProfessionalProfile = {
|
|
60
|
+
profile: BackendLoadedActorProfile;
|
|
61
|
+
session: ActorSession;
|
|
62
|
+
sdk: ProfessionalSdk;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Canonical backend runtime contract for loading one actor profile after
|
|
66
|
+
* authentication and then working with trusted device registration and subject
|
|
67
|
+
* index access.
|
|
68
|
+
*
|
|
69
|
+
* This surface is intentionally generic for BFF or other backend runtimes.
|
|
70
|
+
* It does not encode one product-specific interaction channel.
|
|
71
|
+
*/
|
|
72
|
+
export type BackendProfileRuntimeClient = {
|
|
73
|
+
loadProfile?: (input: ProfileLoadRequest) => Promise<BackendLoadedActorProfile>;
|
|
74
|
+
closeProfile?: (profileKey: string) => Promise<void>;
|
|
75
|
+
registerTrustedDevice?: (input: TrustedDeviceRegistrationRequest) => Promise<BackendTrustedDeviceRegistrationResult>;
|
|
76
|
+
connectToSubjectIndex?: (input: SubjectIndexConnectionRequest) => Promise<BackendSubjectIndexConnectionResult>;
|
|
77
|
+
getSubjectIndexComposition?: (input: SubjectIndexCompositionRequest) => Promise<BackendSubjectIndexCompositionResult>;
|
|
78
|
+
};
|
|
79
|
+
export type BackendProfileRuntimeAdapters = {
|
|
80
|
+
loadProfile(input: ProfileLoadRequest): Promise<LoadedActorProfile>;
|
|
81
|
+
registerTrustedDevice(input: TrustedDeviceRegistrationRequest): Promise<BackendTrustedDeviceRegistrationResult>;
|
|
82
|
+
connectToSubjectIndex(input: SubjectIndexConnectionRequest): Promise<BackendSubjectIndexConnectionResult>;
|
|
83
|
+
getSubjectIndexComposition(input: SubjectIndexCompositionRequest): Promise<BackendSubjectIndexCompositionResult>;
|
|
84
|
+
};
|
|
85
|
+
export type BackendProfileRuntimeOptions = {
|
|
86
|
+
/**
|
|
87
|
+
* Runtime client injected into the materialized actor sessions so backend
|
|
88
|
+
* consumers can immediately call `asIndividualController()`,
|
|
89
|
+
* `asProfessional()`, and the other actor-specific facades after
|
|
90
|
+
* `loadProfile(...)`.
|
|
91
|
+
*/
|
|
92
|
+
facadeClient?: RuntimeClient;
|
|
93
|
+
};
|
|
94
|
+
export type BackendLoadedProfileKey = string;
|
|
95
|
+
export type DirectBackendProfileRuntimeOptions = BackendProfileRuntimeOptions & {
|
|
96
|
+
/**
|
|
97
|
+
* Default route context reused by the current GW CORE subject-index fallback.
|
|
98
|
+
*
|
|
99
|
+
* This is intentionally optional because some integrators only need
|
|
100
|
+
* `loadProfile(...)` plus explicit actor facades first.
|
|
101
|
+
*/
|
|
102
|
+
defaultRouteContext?: RouteContext;
|
|
103
|
+
/**
|
|
104
|
+
* Current temporary CORE-facing index read helper to use when the caller asks
|
|
105
|
+
* for one subject index composition through the profile runtime.
|
|
106
|
+
*
|
|
107
|
+
* Until GW CORE freezes one canonical public profile-runtime read contract,
|
|
108
|
+
* keep this selectable instead of hardcoding one final wording.
|
|
109
|
+
*/
|
|
110
|
+
subjectIndexReadMode?: BackendSubjectIndexReadMode;
|
|
111
|
+
/**
|
|
112
|
+
* Optional override for trusted-device registration while GW CORE finalizes
|
|
113
|
+
* the backend runtime contract for that step.
|
|
114
|
+
*/
|
|
115
|
+
registerTrustedDevice?: (input: TrustedDeviceRegistrationRequest) => Promise<BackendTrustedDeviceRegistrationResult>;
|
|
116
|
+
/**
|
|
117
|
+
* Optional override for backend subject-index connection while GW CORE
|
|
118
|
+
* finalizes the stable contract for that step.
|
|
119
|
+
*/
|
|
120
|
+
connectToSubjectIndex?: (input: SubjectIndexConnectionRequest) => Promise<BackendSubjectIndexConnectionResult>;
|
|
121
|
+
/**
|
|
122
|
+
* Optional override for reading the subject index after connection.
|
|
123
|
+
*/
|
|
124
|
+
getSubjectIndexComposition?: (input: SubjectIndexCompositionRequest) => Promise<BackendSubjectIndexCompositionResult>;
|
|
125
|
+
/**
|
|
126
|
+
* Optional custom job-manager factory. When omitted, the backend runtime
|
|
127
|
+
* creates one in-memory job manager so `loadProfile(...)` returns one
|
|
128
|
+
* complete v2 profile object immediately.
|
|
129
|
+
*/
|
|
130
|
+
createJobManager?: (descriptor: ActorProfileDescriptor, input: ProfileLoadRequest) => IJobManager;
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* Default backend-generic runtime implementation backed by injected adapters.
|
|
134
|
+
*
|
|
135
|
+
* This class is the first concrete v2 slice intended for backend consumers that
|
|
136
|
+
* need one reusable actor-aware profile runtime after authentication.
|
|
137
|
+
*/
|
|
138
|
+
export declare class BackendProfileRuntime implements BackendProfileRuntimeClient {
|
|
139
|
+
private readonly adapters;
|
|
140
|
+
private readonly options;
|
|
141
|
+
constructor(adapters: BackendProfileRuntimeAdapters, options?: BackendProfileRuntimeOptions);
|
|
142
|
+
loadProfile(input: ProfileLoadRequest): Promise<BackendLoadedActorProfile>;
|
|
143
|
+
closeProfile(_profileKey: string): Promise<void>;
|
|
144
|
+
registerTrustedDevice(input: TrustedDeviceRegistrationRequest): Promise<BackendTrustedDeviceRegistrationResult>;
|
|
145
|
+
connectToSubjectIndex(input: SubjectIndexConnectionRequest): Promise<BackendSubjectIndexConnectionResult>;
|
|
146
|
+
getSubjectIndexComposition(input: SubjectIndexCompositionRequest): Promise<BackendSubjectIndexCompositionResult>;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Current concrete backend profile runtime over one injected runtime client.
|
|
150
|
+
*
|
|
151
|
+
* This is the pragmatic v2 bridge for backend consumers that already possess
|
|
152
|
+
* an authenticated `RuntimeClient` and need `loadProfile(...)` to materialize
|
|
153
|
+
* actor facades immediately against the current GW CORE contract.
|
|
154
|
+
*/
|
|
155
|
+
export declare class DirectBackendProfileRuntime implements BackendProfileRuntimeClient {
|
|
156
|
+
private readonly loadedProfiles;
|
|
157
|
+
private readonly options;
|
|
158
|
+
constructor(options: DirectBackendProfileRuntimeOptions);
|
|
159
|
+
loadProfile(input: ProfileLoadRequest): Promise<BackendLoadedActorProfile>;
|
|
160
|
+
closeProfile(profileKey: string): Promise<void>;
|
|
161
|
+
registerTrustedDevice(input: TrustedDeviceRegistrationRequest): Promise<BackendTrustedDeviceRegistrationResult>;
|
|
162
|
+
connectToSubjectIndex(input: SubjectIndexConnectionRequest): Promise<BackendSubjectIndexConnectionResult>;
|
|
163
|
+
getSubjectIndexComposition(input: SubjectIndexCompositionRequest): Promise<BackendSubjectIndexCompositionResult>;
|
|
164
|
+
private rememberLoadedProfile;
|
|
165
|
+
private forgetLoadedProfile;
|
|
166
|
+
private resolveLoadedProfile;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Preferred developer-facing factory for the current backend profile runtime.
|
|
170
|
+
*
|
|
171
|
+
* Use this helper in tutorials and app/BFF code when you already have one
|
|
172
|
+
* configured runtime client and want the canonical
|
|
173
|
+
* `loadProfile(...) -> session -> actor facade` entrypoint without exposing the
|
|
174
|
+
* concrete class name in every example.
|
|
175
|
+
*/
|
|
176
|
+
export declare function createBackendProfileRuntime(options: DirectBackendProfileRuntimeOptions): BackendProfileRuntimeClient;
|
|
177
|
+
/**
|
|
178
|
+
* Minimal in-memory `JobManager` for backend runtimes that do not need durable
|
|
179
|
+
* persistence during one live session.
|
|
180
|
+
*/
|
|
181
|
+
export declare function createJobManagerInMemory(descriptor: ActorProfileDescriptor): IJobManager;
|
|
182
|
+
/**
|
|
183
|
+
* Requires one backend profile-runtime method from one runtime client.
|
|
184
|
+
*/
|
|
185
|
+
export declare function requireBackendProfileRuntimeMethod<T extends keyof BackendProfileRuntimeClient>(client: BackendProfileRuntimeClient, method: T): NonNullable<BackendProfileRuntimeClient[T]>;
|
|
186
|
+
/**
|
|
187
|
+
* Canonical backend helper for loading one actor profile after authentication.
|
|
188
|
+
*/
|
|
189
|
+
export declare function loadBackendProfile(client: BackendProfileRuntimeClient, input: ProfileLoadRequest): Promise<BackendLoadedActorProfile>;
|
|
190
|
+
/**
|
|
191
|
+
* Canonical backend helper for closing one loaded actor profile and clearing
|
|
192
|
+
* runtime-owned in-memory state.
|
|
193
|
+
*/
|
|
194
|
+
export declare function closeBackendProfile(client: BackendProfileRuntimeClient, profileKey: string): Promise<void>;
|
|
195
|
+
/**
|
|
196
|
+
* Canonical backend helper for registering one trusted device/runtime context.
|
|
197
|
+
*/
|
|
198
|
+
export declare function registerBackendTrustedDevice(client: BackendProfileRuntimeClient, input: TrustedDeviceRegistrationRequest): Promise<BackendTrustedDeviceRegistrationResult>;
|
|
199
|
+
/**
|
|
200
|
+
* Canonical backend helper for connecting one actor profile to one subject
|
|
201
|
+
* index after the profile is already loaded.
|
|
202
|
+
*/
|
|
203
|
+
export declare function connectBackendToSubjectIndex(client: BackendProfileRuntimeClient, input: SubjectIndexConnectionRequest): Promise<BackendSubjectIndexConnectionResult>;
|
|
204
|
+
/**
|
|
205
|
+
* Canonical backend helper for reading one subject index composition after the
|
|
206
|
+
* relationship is already established.
|
|
207
|
+
*/
|
|
208
|
+
export declare function getBackendSubjectIndexComposition(client: BackendProfileRuntimeClient, input: SubjectIndexCompositionRequest): Promise<BackendSubjectIndexCompositionResult>;
|
|
209
|
+
/**
|
|
210
|
+
* Returns one materialized backend actor session by actor kind.
|
|
211
|
+
*
|
|
212
|
+
* Backend callers should use this instead of scanning `actorSessions` manually.
|
|
213
|
+
*/
|
|
214
|
+
export declare function requireBackendActorSession(profile: BackendLoadedActorProfile, actorKind: ActorKind): ActorSession;
|
|
215
|
+
/**
|
|
216
|
+
* Returns the individual-controller session from one loaded backend profile.
|
|
217
|
+
*
|
|
218
|
+
* This helper is the first concrete bridge from the generic backend runtime to
|
|
219
|
+
* the current individual bootstrap/index use case.
|
|
220
|
+
*/
|
|
221
|
+
export declare function requireBackendIndividualControllerSession(profile: BackendLoadedActorProfile): ActorSession;
|
|
222
|
+
/**
|
|
223
|
+
* Materializes the individual-controller facade directly from one loaded
|
|
224
|
+
* backend profile.
|
|
225
|
+
*/
|
|
226
|
+
export declare function requireBackendIndividualControllerSdk(profile: BackendLoadedActorProfile): IndividualControllerSdk;
|
|
227
|
+
/**
|
|
228
|
+
* Returns the organization-controller session from one loaded backend profile.
|
|
229
|
+
*/
|
|
230
|
+
export declare function requireBackendOrganizationControllerSession(profile: BackendLoadedActorProfile): ActorSession;
|
|
231
|
+
/**
|
|
232
|
+
* Materializes the organization-controller facade directly from one loaded
|
|
233
|
+
* backend profile.
|
|
234
|
+
*/
|
|
235
|
+
export declare function requireBackendOrganizationControllerSdk(profile: BackendLoadedActorProfile): OrganizationControllerSdk;
|
|
236
|
+
/**
|
|
237
|
+
* Returns the professional session from one loaded backend profile.
|
|
238
|
+
*/
|
|
239
|
+
export declare function requireBackendProfessionalSession(profile: BackendLoadedActorProfile): ActorSession;
|
|
240
|
+
/**
|
|
241
|
+
* Materializes the professional facade directly from one loaded backend
|
|
242
|
+
* profile.
|
|
243
|
+
*/
|
|
244
|
+
export declare function requireBackendProfessionalSdk(profile: BackendLoadedActorProfile): ProfessionalSdk;
|
|
245
|
+
/**
|
|
246
|
+
* Loads one backend profile and resolves the individual-controller session in
|
|
247
|
+
* one step.
|
|
248
|
+
*
|
|
249
|
+
* This is the first pragmatic use-case helper on top of the generic backend
|
|
250
|
+
* profile runtime, because the current stable CORE bootstrap baseline starts
|
|
251
|
+
* from the individual-controller flow.
|
|
252
|
+
*/
|
|
253
|
+
export declare function loadBackendIndividualControllerProfile(client: BackendProfileRuntimeClient, input: ProfileLoadRequest): Promise<BackendIndividualControllerProfile>;
|
|
254
|
+
/**
|
|
255
|
+
* Loads one backend profile and resolves the organization-controller session in
|
|
256
|
+
* one step.
|
|
257
|
+
*/
|
|
258
|
+
export declare function loadBackendOrganizationControllerProfile(client: BackendProfileRuntimeClient, input: ProfileLoadRequest): Promise<BackendOrganizationControllerProfile>;
|
|
259
|
+
/**
|
|
260
|
+
* Loads one backend profile and resolves the professional session in one step.
|
|
261
|
+
*/
|
|
262
|
+
export declare function loadBackendProfessionalProfile(client: BackendProfileRuntimeClient, input: ProfileLoadRequest): Promise<BackendProfessionalProfile>;
|