gdc-sdk-front-ts 2.1.0 → 2.2.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 +9 -3
- package/dist/ClientSDK.d.ts +11 -1
- package/dist/ClientSDK.js +13 -1
- package/dist/frontend-profile-workspace.d.ts +62 -0
- package/dist/frontend-profile-workspace.js +129 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/individual-controller-frontend-runtime.d.ts +9 -3
- package/dist/individual-controller-frontend-runtime.js +7 -6
- package/dist/orchestration/client-port.d.ts +9 -11
- package/dist/orchestration/professional-sdk.d.ts +25 -0
- package/dist/orchestration/professional-sdk.js +29 -0
- package/dist/services.d.ts +3 -9
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -7,8 +7,11 @@ profile/session runtime logic, or orchestration tests.
|
|
|
7
7
|
Short rule:
|
|
8
8
|
|
|
9
9
|
- `101` tests must stay didactic and step by step
|
|
10
|
-
-
|
|
11
|
-
|
|
10
|
+
- `gdc-common-utils-ts` owns the canonical step-by-step editors/readers,
|
|
11
|
+
shared fixtures, and reusable payload examples
|
|
12
|
+
- `gdc-sdk-front-ts` starts at `ProfileRuntime -> loadProfile(...) ->
|
|
13
|
+
workspace/session -> actor facade` and only then handles frontend runtime
|
|
14
|
+
orchestration
|
|
12
15
|
|
|
13
16
|
Frontend runtime package for consuming the shared GDC SDK contracts in web or
|
|
14
17
|
mobile apps.
|
|
@@ -39,7 +42,8 @@ If you are integrating this package for the first time, open these in order:
|
|
|
39
42
|
Why `core`, `node`, and `front` are separate packages, what each one owns,
|
|
40
43
|
and why frontend facades should mirror backend actor boundaries.
|
|
41
44
|
1. [docs/101-SDK_INTEGRATION.md](./docs/101-SDK_INTEGRATION.md)
|
|
42
|
-
Real frontend/native setup,
|
|
45
|
+
Real frontend/native setup, injected runtime adapters, `loadProfile(...)`
|
|
46
|
+
into one loaded workspace/session, `new ClientSDK(...)`,
|
|
43
47
|
`initializeCommunicationIdentity(...)`, `initializeSession(...)`, and the
|
|
44
48
|
public actor entrypoints exposed by `ProfileManager.asXxx()`.
|
|
45
49
|
2. [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)
|
|
@@ -72,6 +76,8 @@ If you need the shortest path:
|
|
|
72
76
|
[`ClientSDK`](src/ClientSDK.ts)
|
|
73
77
|
- profile/session bootstrap:
|
|
74
78
|
[`initializeSession(...)`](./docs/101-SDK_INTEGRATION.md)
|
|
79
|
+
- loaded profile workspace bootstrap:
|
|
80
|
+
`new ProfileRuntime(...).loadProfile(...)`
|
|
75
81
|
- first public actor entrypoints:
|
|
76
82
|
`session.asHostOnboarding()`, `session.asOrganizationController()`,
|
|
77
83
|
`session.asIndividualController()`, `session.asProfessional()`
|
package/dist/ClientSDK.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ProfileManager } from './ProfileManager.js';
|
|
2
2
|
import { ProfileRegistry } from './ProfileRegistry.js';
|
|
3
3
|
import type { AppInfo, InitializeSessionParams, IVerifier, IVaultRepository, ProfileRegistryEntry, SdkConfig } from './types.js';
|
|
4
|
-
import { type ResolvedAppInfo } from 'gdc-sdk-core-ts';
|
|
4
|
+
import { type AuthorityResolution, type AuthorityResolutionInput, type AuthorityResolver, type ResolvedAppInfo } from 'gdc-sdk-core-ts';
|
|
5
5
|
/**
|
|
6
6
|
* Frontend-facing SDK entry point for profile/session bootstrapping, lightweight
|
|
7
7
|
* provider discovery, and role-scoped session creation.
|
|
@@ -94,6 +94,16 @@ export declare class ClientSDK {
|
|
|
94
94
|
* Clears the current in-memory session reference.
|
|
95
95
|
*/
|
|
96
96
|
shutdownSession(): void;
|
|
97
|
+
/**
|
|
98
|
+
* Resolves one technical host/authority descriptor from business tenant
|
|
99
|
+
* context or one already-known subject/public identifier.
|
|
100
|
+
*
|
|
101
|
+
* Convenience rule:
|
|
102
|
+
* - browser/native callers should not have to handcraft `did:web`
|
|
103
|
+
* - pass a shared resolver when your app already preloaded one
|
|
104
|
+
* - without a resolver, the SDK falls back to the shared static/legacy rules
|
|
105
|
+
*/
|
|
106
|
+
resolveAuthority(input: AuthorityResolutionInput, resolver?: AuthorityResolver): Promise<AuthorityResolution>;
|
|
97
107
|
private resolveBaseUrl;
|
|
98
108
|
}
|
|
99
109
|
export type { InitializeSessionParams, ProfileRegistryEntry, };
|
package/dist/ClientSDK.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
|
|
2
2
|
import { ProfileManager } from './ProfileManager.js';
|
|
3
3
|
import { ProfileRegistry } from './ProfileRegistry.js';
|
|
4
|
-
import { buildAppHeaders, resolveAppInfo, } from 'gdc-sdk-core-ts';
|
|
4
|
+
import { StaticAuthorityResolver, buildAppHeaders, resolveAppInfo, } from 'gdc-sdk-core-ts';
|
|
5
5
|
/**
|
|
6
6
|
* Frontend-facing SDK entry point for profile/session bootstrapping, lightweight
|
|
7
7
|
* provider discovery, and role-scoped session creation.
|
|
@@ -154,6 +154,18 @@ export class ClientSDK {
|
|
|
154
154
|
shutdownSession() {
|
|
155
155
|
this.currentSession = null;
|
|
156
156
|
}
|
|
157
|
+
/**
|
|
158
|
+
* Resolves one technical host/authority descriptor from business tenant
|
|
159
|
+
* context or one already-known subject/public identifier.
|
|
160
|
+
*
|
|
161
|
+
* Convenience rule:
|
|
162
|
+
* - browser/native callers should not have to handcraft `did:web`
|
|
163
|
+
* - pass a shared resolver when your app already preloaded one
|
|
164
|
+
* - without a resolver, the SDK falls back to the shared static/legacy rules
|
|
165
|
+
*/
|
|
166
|
+
async resolveAuthority(input, resolver = new StaticAuthorityResolver()) {
|
|
167
|
+
return resolver.resolveAuthority(input);
|
|
168
|
+
}
|
|
157
169
|
async resolveBaseUrl(source) {
|
|
158
170
|
const raw = String(source || '').trim();
|
|
159
171
|
if (!raw)
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { LoadedActorProfile, ProfileLoadRequest, SubjectIndexCompositionRequest, SubjectIndexConnectionRequest, TrustedDeviceRegistrationRequest } from 'gdc-sdk-core-ts';
|
|
2
|
+
import { ProfileManager } from './ProfileManager.js';
|
|
3
|
+
import type { FrontendProfileRuntimeClient, FrontendSubjectIndexCompositionResult, FrontendSubjectIndexConnectionResult, FrontendTrustedDeviceRegistrationResult } from './frontend-profile-runtime.js';
|
|
4
|
+
import { HostOnboardingSdk } from './orchestration/host-onboarding-sdk.js';
|
|
5
|
+
import { IndividualControllerSdk } from './orchestration/individual-controller-sdk.js';
|
|
6
|
+
import { IndividualMemberSdk } from './orchestration/individual-member-sdk.js';
|
|
7
|
+
import { OrganizationControllerSdk } from './orchestration/organization-controller-sdk.js';
|
|
8
|
+
import { OrganizationEmployeeSdk } from './orchestration/organization-employee-sdk.js';
|
|
9
|
+
import { PersonalSdk } from './orchestration/personal-sdk.js';
|
|
10
|
+
import { ProfessionalSdk } from './orchestration/professional-sdk.js';
|
|
11
|
+
import type { FrontRuntimeClient } from './orchestration/client-port.js';
|
|
12
|
+
export type FrontendLoadedActorProfile = LoadedActorProfile & {
|
|
13
|
+
actorSession: ProfileManager;
|
|
14
|
+
};
|
|
15
|
+
export type LoadedProfile = FrontendLoadedActorProfile;
|
|
16
|
+
/**
|
|
17
|
+
* Frontend loaded-profile workspace that keeps the login/profile bootstrap
|
|
18
|
+
* steps explicit and then exposes actor-scoped facades from that loaded
|
|
19
|
+
* profile.
|
|
20
|
+
*/
|
|
21
|
+
export declare class LoadedProfileWorkspace {
|
|
22
|
+
readonly profile: FrontendLoadedActorProfile;
|
|
23
|
+
readonly actorSession: ProfileManager;
|
|
24
|
+
private readonly profileRuntime;
|
|
25
|
+
private readonly facadeClient?;
|
|
26
|
+
constructor(profileRuntime: FrontendProfileRuntimeClient, loadedProfile: LoadedActorProfile, facadeClient?: FrontRuntimeClient);
|
|
27
|
+
registerTrustedDevice(input: TrustedDeviceRegistrationRequest): Promise<FrontendTrustedDeviceRegistrationResult>;
|
|
28
|
+
connectToSubjectIndex(input: SubjectIndexConnectionRequest): Promise<FrontendSubjectIndexConnectionResult>;
|
|
29
|
+
getSubjectIndexComposition(input: SubjectIndexCompositionRequest): Promise<FrontendSubjectIndexCompositionResult>;
|
|
30
|
+
asHostOnboarding(): HostOnboardingSdk;
|
|
31
|
+
asOrganizationController(): OrganizationControllerSdk;
|
|
32
|
+
asOrganizationEmployee(): OrganizationEmployeeSdk;
|
|
33
|
+
asIndividualController(): IndividualControllerSdk;
|
|
34
|
+
asIndividualMember(): IndividualMemberSdk;
|
|
35
|
+
asPersonal(): PersonalSdk;
|
|
36
|
+
asProfessional(): ProfessionalSdk;
|
|
37
|
+
private requireFacadeClient;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Frontend counterpart to the backend loaded-profile runtime:
|
|
41
|
+
* inject adapters once, load one protected profile, then work from the
|
|
42
|
+
* returned workspace/session facade instead of one-off helper calls.
|
|
43
|
+
*/
|
|
44
|
+
export declare class ProfileRuntime {
|
|
45
|
+
private readonly profileRuntime;
|
|
46
|
+
private readonly facadeClient?;
|
|
47
|
+
constructor(profileRuntime: FrontendProfileRuntimeClient, facadeClient?: FrontRuntimeClient | undefined);
|
|
48
|
+
loadProfile(input: ProfileLoadRequest): Promise<LoadedProfileWorkspace>;
|
|
49
|
+
}
|
|
50
|
+
export declare function createLoadedProfileWorkspace(profileRuntime: FrontendProfileRuntimeClient, loadedProfile: LoadedActorProfile, facadeClient?: FrontRuntimeClient): LoadedProfileWorkspace;
|
|
51
|
+
/**
|
|
52
|
+
* @deprecated Prefer `LoadedProfileWorkspace`.
|
|
53
|
+
*/
|
|
54
|
+
export { LoadedProfileWorkspace as FrontendProfileWorkspace };
|
|
55
|
+
/**
|
|
56
|
+
* @deprecated Prefer `ProfileRuntime`.
|
|
57
|
+
*/
|
|
58
|
+
export { ProfileRuntime as FrontendProfileWorkspaceRuntime };
|
|
59
|
+
/**
|
|
60
|
+
* @deprecated Prefer `createLoadedProfileWorkspace`.
|
|
61
|
+
*/
|
|
62
|
+
export { createLoadedProfileWorkspace as createFrontendProfileWorkspace };
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
// Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
|
|
2
|
+
import { ActorKinds, } from 'gdc-common-utils-ts/constants/actor-session';
|
|
3
|
+
import { ProfileAppTypes } from 'gdc-common-utils-ts/constants';
|
|
4
|
+
import { ProfileManager } from './ProfileManager.js';
|
|
5
|
+
import { getFrontendSubjectIndexComposition, loadFrontendProfile, connectFrontendToSubjectIndex, registerFrontendTrustedDevice, } from './frontend-profile-runtime.js';
|
|
6
|
+
import { HostOnboardingSdk } from './orchestration/host-onboarding-sdk.js';
|
|
7
|
+
import { IndividualControllerSdk } from './orchestration/individual-controller-sdk.js';
|
|
8
|
+
import { IndividualMemberSdk } from './orchestration/individual-member-sdk.js';
|
|
9
|
+
import { OrganizationControllerSdk } from './orchestration/organization-controller-sdk.js';
|
|
10
|
+
import { OrganizationEmployeeSdk } from './orchestration/organization-employee-sdk.js';
|
|
11
|
+
import { PersonalSdk } from './orchestration/personal-sdk.js';
|
|
12
|
+
import { ProfessionalSdk } from './orchestration/professional-sdk.js';
|
|
13
|
+
function toSessionProfile(profile) {
|
|
14
|
+
const descriptor = profile.descriptor || {};
|
|
15
|
+
const id = String(descriptor.profileId
|
|
16
|
+
|| descriptor.profileDid
|
|
17
|
+
|| descriptor.subjectDid
|
|
18
|
+
|| descriptor.providerDid
|
|
19
|
+
|| 'frontend-profile').trim();
|
|
20
|
+
return {
|
|
21
|
+
id,
|
|
22
|
+
email: String(descriptor.email || '').trim(),
|
|
23
|
+
role: String(descriptor.actorRole || '').trim(),
|
|
24
|
+
providerDid: String(descriptor.providerDid || '').trim(),
|
|
25
|
+
appType: descriptor.appType || ProfileAppTypes.Family,
|
|
26
|
+
createdAt: new Date().toISOString(),
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
function requireActorKind(profile, actorKind) {
|
|
30
|
+
if (!profile.session.actorKinds.includes(actorKind)) {
|
|
31
|
+
throw new Error(`Loaded frontend profile does not expose actor kind '${actorKind}'.`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function requirePersonalCapability(profile) {
|
|
35
|
+
if (profile.session.actorKinds.includes(ActorKinds.IndividualController)
|
|
36
|
+
|| profile.session.actorKinds.includes(ActorKinds.IndividualMember)) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
throw new Error('Loaded frontend profile does not expose one personal-capable actor kind.');
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Frontend loaded-profile workspace that keeps the login/profile bootstrap
|
|
43
|
+
* steps explicit and then exposes actor-scoped facades from that loaded
|
|
44
|
+
* profile.
|
|
45
|
+
*/
|
|
46
|
+
export class LoadedProfileWorkspace {
|
|
47
|
+
constructor(profileRuntime, loadedProfile, facadeClient) {
|
|
48
|
+
this.profileRuntime = profileRuntime;
|
|
49
|
+
this.facadeClient = facadeClient;
|
|
50
|
+
this.actorSession = new ProfileManager(toSessionProfile(loadedProfile), String(loadedProfile.descriptor.providerDid || ''));
|
|
51
|
+
this.profile = {
|
|
52
|
+
...loadedProfile,
|
|
53
|
+
actorSession: this.actorSession,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
registerTrustedDevice(input) {
|
|
57
|
+
return registerFrontendTrustedDevice(this.profileRuntime, input);
|
|
58
|
+
}
|
|
59
|
+
connectToSubjectIndex(input) {
|
|
60
|
+
return connectFrontendToSubjectIndex(this.profileRuntime, input);
|
|
61
|
+
}
|
|
62
|
+
getSubjectIndexComposition(input) {
|
|
63
|
+
return getFrontendSubjectIndexComposition(this.profileRuntime, input);
|
|
64
|
+
}
|
|
65
|
+
asHostOnboarding() {
|
|
66
|
+
requireActorKind(this.profile, ActorKinds.HostOnboarding);
|
|
67
|
+
return new HostOnboardingSdk(this.requireFacadeClient('HostOnboardingSdk'));
|
|
68
|
+
}
|
|
69
|
+
asOrganizationController() {
|
|
70
|
+
requireActorKind(this.profile, ActorKinds.OrganizationController);
|
|
71
|
+
return new OrganizationControllerSdk(this.requireFacadeClient('OrganizationControllerSdk'));
|
|
72
|
+
}
|
|
73
|
+
asOrganizationEmployee() {
|
|
74
|
+
requireActorKind(this.profile, ActorKinds.OrganizationEmployee);
|
|
75
|
+
return new OrganizationEmployeeSdk(this.requireFacadeClient('OrganizationEmployeeSdk'));
|
|
76
|
+
}
|
|
77
|
+
asIndividualController() {
|
|
78
|
+
requireActorKind(this.profile, ActorKinds.IndividualController);
|
|
79
|
+
return new IndividualControllerSdk(this.requireFacadeClient('IndividualControllerSdk'));
|
|
80
|
+
}
|
|
81
|
+
asIndividualMember() {
|
|
82
|
+
requireActorKind(this.profile, ActorKinds.IndividualMember);
|
|
83
|
+
return new IndividualMemberSdk(this.requireFacadeClient('IndividualMemberSdk'));
|
|
84
|
+
}
|
|
85
|
+
asPersonal() {
|
|
86
|
+
requirePersonalCapability(this.profile);
|
|
87
|
+
return new PersonalSdk(this.requireFacadeClient('PersonalSdk'));
|
|
88
|
+
}
|
|
89
|
+
asProfessional() {
|
|
90
|
+
requireActorKind(this.profile, ActorKinds.Professional);
|
|
91
|
+
return new ProfessionalSdk(this.requireFacadeClient('ProfessionalSdk'));
|
|
92
|
+
}
|
|
93
|
+
requireFacadeClient(name) {
|
|
94
|
+
if (!this.facadeClient) {
|
|
95
|
+
throw new Error(`${name} requires one FrontRuntimeClient on the loaded frontend profile workspace.`);
|
|
96
|
+
}
|
|
97
|
+
return this.facadeClient;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Frontend counterpart to the backend loaded-profile runtime:
|
|
102
|
+
* inject adapters once, load one protected profile, then work from the
|
|
103
|
+
* returned workspace/session facade instead of one-off helper calls.
|
|
104
|
+
*/
|
|
105
|
+
export class ProfileRuntime {
|
|
106
|
+
constructor(profileRuntime, facadeClient) {
|
|
107
|
+
this.profileRuntime = profileRuntime;
|
|
108
|
+
this.facadeClient = facadeClient;
|
|
109
|
+
}
|
|
110
|
+
async loadProfile(input) {
|
|
111
|
+
const profile = await loadFrontendProfile(this.profileRuntime, input);
|
|
112
|
+
return new LoadedProfileWorkspace(this.profileRuntime, profile, this.facadeClient);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
export function createLoadedProfileWorkspace(profileRuntime, loadedProfile, facadeClient) {
|
|
116
|
+
return new LoadedProfileWorkspace(profileRuntime, loadedProfile, facadeClient);
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* @deprecated Prefer `LoadedProfileWorkspace`.
|
|
120
|
+
*/
|
|
121
|
+
export { LoadedProfileWorkspace as FrontendProfileWorkspace };
|
|
122
|
+
/**
|
|
123
|
+
* @deprecated Prefer `ProfileRuntime`.
|
|
124
|
+
*/
|
|
125
|
+
export { ProfileRuntime as FrontendProfileWorkspaceRuntime };
|
|
126
|
+
/**
|
|
127
|
+
* @deprecated Prefer `createLoadedProfileWorkspace`.
|
|
128
|
+
*/
|
|
129
|
+
export { createLoadedProfileWorkspace as createFrontendProfileWorkspace };
|
package/dist/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export * from './ProfileRegistry.js';
|
|
|
13
13
|
export * from './UserProfileIndexStore.js';
|
|
14
14
|
export * from './ClientSDK.js';
|
|
15
15
|
export * from './frontend-profile-runtime.js';
|
|
16
|
+
export * from './frontend-profile-workspace.js';
|
|
16
17
|
export * from './individual-controller-frontend-runtime.js';
|
|
17
18
|
export * from './discovery/index.js';
|
|
18
19
|
export * from './orchestration/client-port.js';
|
package/dist/index.js
CHANGED
|
@@ -14,6 +14,7 @@ export * from './ProfileRegistry.js';
|
|
|
14
14
|
export * from './UserProfileIndexStore.js';
|
|
15
15
|
export * from './ClientSDK.js';
|
|
16
16
|
export * from './frontend-profile-runtime.js';
|
|
17
|
+
export * from './frontend-profile-workspace.js';
|
|
17
18
|
export * from './individual-controller-frontend-runtime.js';
|
|
18
19
|
export * from './discovery/index.js';
|
|
19
20
|
export * from './orchestration/client-port.js';
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import type { SubmitAndPollResult } from 'gdc-sdk-core-ts';
|
|
2
2
|
import type { ProfileLoadRequest } from 'gdc-sdk-core-ts';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import type { ProfileManager } from './ProfileManager.js';
|
|
4
|
+
import { type LoadedProfileWorkspace } from './frontend-profile-workspace.js';
|
|
5
|
+
import type { FrontendProfileRuntimeClient } from './frontend-profile-runtime.js';
|
|
6
|
+
import type { IndividualControllerSdk } from './orchestration/individual-controller-sdk.js';
|
|
5
7
|
import type { FrontClinicalBundleSearchInput, FrontIndividualOrganizationBootstrapInput, FrontIndividualOrganizationConfirmOrderInput, FrontIndividualOrganizationStartResult, FrontRouteContext, FrontRuntimeClient } from './orchestration/client-port.js';
|
|
6
8
|
import type { LoadedActorProfile } from 'gdc-sdk-core-ts';
|
|
7
9
|
export type FrontendIndividualControllerProfile = {
|
|
8
|
-
profile: LoadedActorProfile
|
|
10
|
+
profile: LoadedActorProfile & {
|
|
11
|
+
actorSession: ProfileManager;
|
|
12
|
+
};
|
|
13
|
+
workspace: LoadedProfileWorkspace;
|
|
14
|
+
actorSession: ProfileManager;
|
|
9
15
|
sdk: IndividualControllerSdk;
|
|
10
16
|
};
|
|
11
17
|
/**
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
|
|
2
2
|
import { ActorKinds } from 'gdc-common-utils-ts/constants/actor-session';
|
|
3
|
-
import {
|
|
4
|
-
import { IndividualControllerSdk } from './orchestration/individual-controller-sdk.js';
|
|
3
|
+
import { ProfileRuntime, } from './frontend-profile-workspace.js';
|
|
5
4
|
/**
|
|
6
5
|
* First pragmatic frontend use-case wrapper on top of the generic v2 profile
|
|
7
6
|
* runtime.
|
|
@@ -20,13 +19,15 @@ export class IndividualControllerFrontendRuntime {
|
|
|
20
19
|
* actor capability before materializing the facade.
|
|
21
20
|
*/
|
|
22
21
|
async loadProfile(input) {
|
|
23
|
-
const
|
|
24
|
-
if (!profile.session.actorKinds.includes(ActorKinds.IndividualController)) {
|
|
22
|
+
const workspace = await new ProfileRuntime(this.profileRuntime, this.facadeClient).loadProfile(input);
|
|
23
|
+
if (!workspace.profile.session.actorKinds.includes(ActorKinds.IndividualController)) {
|
|
25
24
|
throw new Error('Loaded frontend profile does not expose actor kind \'individual_controller\'.');
|
|
26
25
|
}
|
|
27
26
|
return {
|
|
28
|
-
profile,
|
|
29
|
-
|
|
27
|
+
profile: workspace.profile,
|
|
28
|
+
workspace,
|
|
29
|
+
actorSession: workspace.actorSession,
|
|
30
|
+
sdk: workspace.asIndividualController(),
|
|
30
31
|
};
|
|
31
32
|
}
|
|
32
33
|
/**
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { DeviceAppType, DeviceUserClass } from 'gdc-common-utils-ts/constants';
|
|
2
2
|
import type { LicenseListSearchState } from 'gdc-common-utils-ts/utils/license-list-search';
|
|
3
3
|
import type { LicenseOfferSearchState, LicenseOrderSearchState } from 'gdc-common-utils-ts/utils/license-commercial-search';
|
|
4
|
+
import type { IndividualOrganizationLifecycleEditor } from 'gdc-common-utils-ts/utils/individual-organization-lifecycle';
|
|
4
5
|
import type { IndividualOnboardingDraftInput, IndividualOnboardingDraftResult } from 'gdc-common-utils-ts/models/individual-onboarding';
|
|
5
|
-
import type { BundleSearchQuery, CommunicationInput, EmployeeSearchValue, HostLifecycleInput, HostRouteContext, HostedTenantLifecycleInput, OrganizationDidBindingInput, LegalOrganizationOrderInput, PollOptions, SubmitAndPollResult, SubmitPayload } from 'gdc-sdk-core-ts';
|
|
6
|
+
import type { BundleSearchQuery, CommunicationInput, EmployeeSearchValue, HostLifecycleInput, HostRouteContext, HostedTenantLifecycleInput, OrganizationDidBindingInput, LegalOrganizationOrderInput, PollOptions, SmartTokenRequestContract, SubmitAndPollResult, SubmitPayload } from 'gdc-sdk-core-ts';
|
|
6
7
|
export type FrontRouteContext = {
|
|
7
8
|
providerDid: string;
|
|
8
9
|
idToken: string;
|
|
@@ -72,16 +73,7 @@ export type FrontEmployeeDeviceActivationRequestInput = {
|
|
|
72
73
|
activationCode: string;
|
|
73
74
|
dcrPayload?: Record<string, unknown>;
|
|
74
75
|
};
|
|
75
|
-
export type FrontSmartTokenRequestInput =
|
|
76
|
-
idToken: string;
|
|
77
|
-
scopes: string[];
|
|
78
|
-
actorDid?: string;
|
|
79
|
-
subjectDid?: string;
|
|
80
|
-
clientId?: string;
|
|
81
|
-
issuer?: string;
|
|
82
|
-
audience?: string;
|
|
83
|
-
additionalClaims?: Record<string, unknown>;
|
|
84
|
-
};
|
|
76
|
+
export type FrontSmartTokenRequestInput = SmartTokenRequestContract;
|
|
85
77
|
export type FrontSmartTokenExchangeResult = {
|
|
86
78
|
status: 'fetched' | 'failed';
|
|
87
79
|
accessToken?: string;
|
|
@@ -106,7 +98,13 @@ export type FrontIndividualOrganizationConfirmOrderInput = {
|
|
|
106
98
|
};
|
|
107
99
|
export type FrontIndividualOrganizationLifecycleInput = {
|
|
108
100
|
organizationClaims?: Record<string, unknown>;
|
|
101
|
+
individualEditor?: IndividualOrganizationLifecycleEditor;
|
|
102
|
+
/**
|
|
103
|
+
* @deprecated Use `individualEditor`.
|
|
104
|
+
*/
|
|
105
|
+
organizationEditor?: IndividualOrganizationLifecycleEditor;
|
|
109
106
|
resourceId?: string;
|
|
107
|
+
dataType?: string;
|
|
110
108
|
};
|
|
111
109
|
export type FrontIndividualMemberLifecycleInput = {
|
|
112
110
|
memberClaims?: Record<string, unknown>;
|
|
@@ -1,9 +1,34 @@
|
|
|
1
|
+
import { type ProfessionalEmployeeCredentialInput, type ProfessionalSmartVpPayloadInput } from 'gdc-common-utils-ts';
|
|
1
2
|
import type { PollOptions, SubmitAndPollResult, SubmitPayload } from 'gdc-sdk-core-ts';
|
|
2
3
|
import { type FrontCommunicationIngestionInput, type FrontGrantProfessionalAccessInput, type FrontGrantProfessionalAccessResult, type FrontRouteContext, type FrontRuntimeClient, type FrontSmartTokenExchangeResult, type FrontSmartTokenRequestInput } from './client-port.js';
|
|
3
4
|
export declare class ProfessionalSdk {
|
|
4
5
|
private readonly client;
|
|
5
6
|
constructor(client: FrontRuntimeClient);
|
|
6
7
|
requestSmartToken(input: FrontSmartTokenRequestInput): Promise<FrontSmartTokenExchangeResult>;
|
|
8
|
+
/**
|
|
9
|
+
* Returns the normalized public continuity aliases that would be embedded in
|
|
10
|
+
* the professional identity VC for SMART/OpenID4VP flows.
|
|
11
|
+
*/
|
|
12
|
+
getIdentitySameAs(input: ProfessionalEmployeeCredentialInput): string[];
|
|
13
|
+
/**
|
|
14
|
+
* Builds the canonical professional identity VC used by the shared SMART VP
|
|
15
|
+
* helpers.
|
|
16
|
+
*/
|
|
17
|
+
getIdentityVC(input: ProfessionalEmployeeCredentialInput): Record<string, unknown>;
|
|
18
|
+
/**
|
|
19
|
+
* Builds the canonical professional identity VP payload used by the shared
|
|
20
|
+
* SMART/OpenID4VP helpers.
|
|
21
|
+
*/
|
|
22
|
+
buildIdentityVpPayload(input: ProfessionalSmartVpPayloadInput): Record<string, unknown>;
|
|
23
|
+
/**
|
|
24
|
+
* Builds one unsigned compact VP JWT for the canonical professional
|
|
25
|
+
* identity payload.
|
|
26
|
+
*/
|
|
27
|
+
buildUnsignedIdentityVpJwt(input: ProfessionalSmartVpPayloadInput, options?: Readonly<{
|
|
28
|
+
nowSeconds?: number;
|
|
29
|
+
ttlSeconds?: number;
|
|
30
|
+
nonce?: string;
|
|
31
|
+
}>): string;
|
|
7
32
|
ingestCommunicationAndUpdateIndex(ctx: FrontRouteContext, input: FrontCommunicationIngestionInput): Promise<SubmitAndPollResult>;
|
|
8
33
|
grantProfessionalAccess(ctx: FrontRouteContext, input: FrontGrantProfessionalAccessInput): Promise<FrontGrantProfessionalAccessResult>;
|
|
9
34
|
submitAndPoll(submitPath: string, pollPath: string, payload: SubmitPayload, pollOptions?: PollOptions): Promise<SubmitAndPollResult>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
|
|
2
|
+
import { buildProfessionalIdentityVpPayload, buildUnsignedProfessionalIdentityVpJwt, getProfessionalIdentitySameAs, getProfessionalIdentityVC, } from 'gdc-common-utils-ts';
|
|
2
3
|
import { requireClientMethod } from './client-port.js';
|
|
3
4
|
export class ProfessionalSdk {
|
|
4
5
|
constructor(client) {
|
|
@@ -7,6 +8,34 @@ export class ProfessionalSdk {
|
|
|
7
8
|
requestSmartToken(input) {
|
|
8
9
|
return requireClientMethod(this.client, 'requestSmartToken')(input);
|
|
9
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* Returns the normalized public continuity aliases that would be embedded in
|
|
13
|
+
* the professional identity VC for SMART/OpenID4VP flows.
|
|
14
|
+
*/
|
|
15
|
+
getIdentitySameAs(input) {
|
|
16
|
+
return getProfessionalIdentitySameAs(input);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Builds the canonical professional identity VC used by the shared SMART VP
|
|
20
|
+
* helpers.
|
|
21
|
+
*/
|
|
22
|
+
getIdentityVC(input) {
|
|
23
|
+
return getProfessionalIdentityVC(input);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Builds the canonical professional identity VP payload used by the shared
|
|
27
|
+
* SMART/OpenID4VP helpers.
|
|
28
|
+
*/
|
|
29
|
+
buildIdentityVpPayload(input) {
|
|
30
|
+
return buildProfessionalIdentityVpPayload(input);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Builds one unsigned compact VP JWT for the canonical professional
|
|
34
|
+
* identity payload.
|
|
35
|
+
*/
|
|
36
|
+
buildUnsignedIdentityVpJwt(input, options = {}) {
|
|
37
|
+
return buildUnsignedProfessionalIdentityVpJwt(input, options);
|
|
38
|
+
}
|
|
10
39
|
ingestCommunicationAndUpdateIndex(ctx, input) {
|
|
11
40
|
return requireClientMethod(this.client, 'ingestCommunicationAndUpdateIndex')(ctx, input);
|
|
12
41
|
}
|
package/dist/services.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DeviceAppType, DeviceUserClass } from 'gdc-common-utils-ts/constants';
|
|
2
2
|
import type { IndividualOnboardingDraftInput, IndividualOnboardingDraftResult } from 'gdc-common-utils-ts/models/individual-onboarding';
|
|
3
3
|
import { type HostLifecycleInput, type HostRouteContext, type HostedTenantLifecycleInput, type LegalOrganizationOrderInput, type SubmitAndPollResult } from 'gdc-sdk-core-ts';
|
|
4
|
-
import { type FrontLicenseListSearchInput, type FrontLicenseOfferSearchInput, type FrontLicenseOrderSearchInput, type FrontOrganizationEmployeeSearchInput, type FrontGrantProfessionalAccessResult, type FrontSmartTokenExchangeResult, type FrontSmartTokenRequestInput } from './orchestration/client-port.js';
|
|
4
|
+
import { type FrontLicenseListSearchInput, type FrontLicenseOfferSearchInput, type FrontLicenseOrderSearchInput, type FrontIndividualOrganizationLifecycleInput, type FrontOrganizationEmployeeSearchInput, type FrontGrantProfessionalAccessResult, type FrontSmartTokenExchangeResult, type FrontSmartTokenRequestInput } from './orchestration/client-port.js';
|
|
5
5
|
export declare class CommonAuthService {
|
|
6
6
|
activateDevice(_licenseCode: string, _providerDid: string, _idToken: string): Promise<{
|
|
7
7
|
thid: string;
|
|
@@ -70,14 +70,8 @@ export declare class FamilyAdminService {
|
|
|
70
70
|
offerId: string;
|
|
71
71
|
orderClaims?: Record<string, unknown>;
|
|
72
72
|
}): Promise<SubmitAndPollResult>;
|
|
73
|
-
disableIndividual(_providerDid: string, _idToken: string, _input:
|
|
74
|
-
|
|
75
|
-
resourceId?: string;
|
|
76
|
-
}): Promise<SubmitAndPollResult>;
|
|
77
|
-
purgeIndividual(_providerDid: string, _idToken: string, _input: {
|
|
78
|
-
organizationClaims?: Record<string, unknown>;
|
|
79
|
-
resourceId?: string;
|
|
80
|
-
}): Promise<SubmitAndPollResult>;
|
|
73
|
+
disableIndividual(_providerDid: string, _idToken: string, _input: FrontIndividualOrganizationLifecycleInput): Promise<SubmitAndPollResult>;
|
|
74
|
+
purgeIndividual(_providerDid: string, _idToken: string, _input: FrontIndividualOrganizationLifecycleInput): Promise<SubmitAndPollResult>;
|
|
81
75
|
disableIndividualMember(_providerDid: string, _idToken: string, _input: {
|
|
82
76
|
memberClaims?: Record<string, unknown>;
|
|
83
77
|
resourceId?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gdc-sdk-front-ts",
|
|
3
|
-
"version": "2.1
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"description": "Next-generation frontend 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
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@babel/runtime": "^7.28.4",
|
|
20
|
-
"gdc-common-utils-ts": "^2.
|
|
21
|
-
"gdc-sdk-core-ts": "
|
|
20
|
+
"gdc-common-utils-ts": "^2.2.2",
|
|
21
|
+
"gdc-sdk-core-ts": "~2.2.1"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@types/node": "^20.14.10",
|