gdc-sdk-front-ts 2.0.7 → 2.0.9

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 CHANGED
@@ -38,17 +38,10 @@ If you are integrating this package for the first time, open these in order:
38
38
  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)
39
39
  Why `core`, `node`, and `front` are separate packages, what each one owns,
40
40
  and why frontend facades should mirror backend actor boundaries.
41
- 1. [tests/101-frontend-profile-runtime.test.mjs](./tests/101-frontend-profile-runtime.test.mjs)
42
- Minimal frontend-generic walkthrough for loading one actor profile,
43
- registering one trusted device/runtime context, connecting to one subject
44
- index, and reading one subject index composition.
45
- 1. [tests/101-individual-controller-frontend-runtime.test.mjs](./tests/101-individual-controller-frontend-runtime.test.mjs)
46
- First pragmatic frontend wrapper over the generic profile runtime for the
47
- current individual-controller baseline.
48
41
  1. [docs/101-SDK_INTEGRATION.md](./docs/101-SDK_INTEGRATION.md)
49
42
  Real frontend/native setup, imports, `new ClientSDK(...)`,
50
- `initializeCommunicationIdentity(...)`, provider discovery, and
51
- `initializeSession(...)`.
43
+ `initializeCommunicationIdentity(...)`, `initializeSession(...)`, and the
44
+ public actor entrypoints exposed by `ProfileManager.asXxx()`.
52
45
  2. [docs/DATASPACE_DISCOVERY_FRONTEND_TODO.md](./docs/DATASPACE_DISCOVERY_FRONTEND_TODO.md)
53
46
  Frontend discovery guide for BFF-first provider/operator discovery, UI card
54
47
  mapping, and copy/paste backend DTO consumption.
@@ -64,6 +57,12 @@ If you are integrating this package for the first time, open these in order:
64
57
  Shared profile/session payload source of truth.
65
58
  7. [gdc-common-utils-ts/docs/101-LIFECYCLE.md](https://github.com/Global-DataCare/gdc-common-utils-ts/blob/main/docs/101-LIFECYCLE.md)
66
59
  Canonical lifecycle semantics and reusable placeholders for UI and portal flows.
60
+ 8. [tests/101-frontend-profile-runtime.test.mjs](./tests/101-frontend-profile-runtime.test.mjs)
61
+ Technical frontend runtime slice for profile/device/session wiring.
62
+ Read this after the public actor-session guides, not before them.
63
+ 9. [tests/101-individual-controller-frontend-runtime.test.mjs](./tests/101-individual-controller-frontend-runtime.test.mjs)
64
+ Technical wrapper slice around the generic runtime for the current
65
+ individual-controller baseline.
67
66
 
68
67
  If you need the shortest path:
69
68
 
@@ -76,6 +75,9 @@ If you need the shortest path:
76
75
  [`ClientSDK`](src/ClientSDK.ts)
77
76
  - profile/session bootstrap:
78
77
  [`initializeSession(...)`](./docs/101-SDK_INTEGRATION.md)
78
+ - first public actor entrypoints:
79
+ `session.asHostOnboarding()`, `session.asOrganizationController()`,
80
+ `session.asIndividualController()`, `session.asProfessional()`
79
81
 
80
82
  ## Frontend Runtime Modes
81
83
 
@@ -0,0 +1,58 @@
1
+ import type { IVaultRepository, UserProfileIndex, UserProfileLookupKey } from './types.js';
2
+ /**
3
+ * Persisted local user-profile index document.
4
+ *
5
+ * The shared `UserProfileIndex` contract from `gdc-sdk-core-ts` does not impose
6
+ * a storage identifier because it is runtime-neutral. Frontend runtimes need a
7
+ * stable document id to persist and replace one logical index record.
8
+ */
9
+ export interface UserProfileIndexRecord extends UserProfileIndex {
10
+ /**
11
+ * Stable storage identifier for one local profile-index document.
12
+ */
13
+ id: string;
14
+ }
15
+ /**
16
+ * Frontend persistence adapter for local hashed user-profile indexes.
17
+ *
18
+ * Responsibilities:
19
+ * - store ordered local profile indexes
20
+ * - list available index documents
21
+ * - resolve one index by hashed lookup key before profile unlock
22
+ *
23
+ * Non-responsibilities:
24
+ * - hashing raw phone/email input
25
+ * - unlocking profiles with PIN
26
+ * - storing seeds or decrypted key material
27
+ */
28
+ export declare class UserProfileIndexStore {
29
+ private readonly vault;
30
+ constructor(vault: IVaultRepository);
31
+ /**
32
+ * Initializes the underlying storage adapter.
33
+ */
34
+ initialize(): Promise<void>;
35
+ /**
36
+ * Creates or replaces one stored user-profile index record.
37
+ */
38
+ upsert(record: UserProfileIndexRecord): Promise<UserProfileIndexRecord>;
39
+ /**
40
+ * Returns every stored user-profile index record.
41
+ */
42
+ list(): Promise<UserProfileIndexRecord[]>;
43
+ /**
44
+ * Returns one stored index by storage id.
45
+ */
46
+ get(id: string): Promise<UserProfileIndexRecord | undefined>;
47
+ /**
48
+ * Resolves the first stored index that contains the given hashed lookup key.
49
+ *
50
+ * This intentionally compares hashed lookup tokens only. Raw phone/email
51
+ * values are outside this store contract.
52
+ */
53
+ findByLookup(lookup: UserProfileLookupKey): Promise<UserProfileIndexRecord | undefined>;
54
+ /**
55
+ * Deletes one stored index by storage id.
56
+ */
57
+ remove(id: string): Promise<boolean>;
58
+ }
@@ -0,0 +1,66 @@
1
+ // Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
2
+ const COLLECTION = 'user-profile-index';
3
+ /**
4
+ * Frontend persistence adapter for local hashed user-profile indexes.
5
+ *
6
+ * Responsibilities:
7
+ * - store ordered local profile indexes
8
+ * - list available index documents
9
+ * - resolve one index by hashed lookup key before profile unlock
10
+ *
11
+ * Non-responsibilities:
12
+ * - hashing raw phone/email input
13
+ * - unlocking profiles with PIN
14
+ * - storing seeds or decrypted key material
15
+ */
16
+ export class UserProfileIndexStore {
17
+ constructor(vault) {
18
+ this.vault = vault;
19
+ }
20
+ /**
21
+ * Initializes the underlying storage adapter.
22
+ */
23
+ async initialize() {
24
+ await this.vault.initialize();
25
+ }
26
+ /**
27
+ * Creates or replaces one stored user-profile index record.
28
+ */
29
+ async upsert(record) {
30
+ await this.vault.put(COLLECTION, record);
31
+ return record;
32
+ }
33
+ /**
34
+ * Returns every stored user-profile index record.
35
+ */
36
+ async list() {
37
+ return this.vault.query(COLLECTION, {});
38
+ }
39
+ /**
40
+ * Returns one stored index by storage id.
41
+ */
42
+ async get(id) {
43
+ return this.vault.get(COLLECTION, id);
44
+ }
45
+ /**
46
+ * Resolves the first stored index that contains the given hashed lookup key.
47
+ *
48
+ * This intentionally compares hashed lookup tokens only. Raw phone/email
49
+ * values are outside this store contract.
50
+ */
51
+ async findByLookup(lookup) {
52
+ const records = await this.list();
53
+ return records.find((record) => record.lookup.some((item) => lookupEquals(item, lookup)));
54
+ }
55
+ /**
56
+ * Deletes one stored index by storage id.
57
+ */
58
+ async remove(id) {
59
+ return this.vault.delete(COLLECTION, id);
60
+ }
61
+ }
62
+ function lookupEquals(left, right) {
63
+ return left.kind === right.kind
64
+ && left.algorithm === right.algorithm
65
+ && left.value === right.value;
66
+ }
package/dist/index.d.ts CHANGED
@@ -10,6 +10,7 @@ export * from './capabilityMapper.js';
10
10
  export * from './VerifierService.js';
11
11
  export * from './ProfileManager.js';
12
12
  export * from './ProfileRegistry.js';
13
+ export * from './UserProfileIndexStore.js';
13
14
  export * from './ClientSDK.js';
14
15
  export * from './frontend-profile-runtime.js';
15
16
  export * from './individual-controller-frontend-runtime.js';
package/dist/index.js CHANGED
@@ -11,6 +11,7 @@ export * from './capabilityMapper.js';
11
11
  export * from './VerifierService.js';
12
12
  export * from './ProfileManager.js';
13
13
  export * from './ProfileRegistry.js';
14
+ export * from './UserProfileIndexStore.js';
14
15
  export * from './ClientSDK.js';
15
16
  export * from './frontend-profile-runtime.js';
16
17
  export * from './individual-controller-frontend-runtime.js';
package/dist/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { IApiConfig, INetwork, BundleSearchQuery, CommunicationInput, DateRange } from 'gdc-sdk-core-ts';
2
- export type { AppInfo, ResolvedAppInfo, InitializeSessionParams, Profile, ProfileRegistryEntry, VaultQueryCondition, VaultQuery, IVaultRepository, IApiConfig, INetwork, IVerifier } from 'gdc-sdk-core-ts';
2
+ export type { AppInfo, ResolvedAppInfo, InitializeSessionParams, Profile, ProfileRegistryEntry, UserProfileIndex, UserProfileLookupKey, VaultQueryCondition, VaultQuery, IVaultRepository, IApiConfig, INetwork, IVerifier } from 'gdc-sdk-core-ts';
3
3
  export type SdkConfig = {
4
4
  crypto?: unknown;
5
5
  network: INetwork;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gdc-sdk-front-ts",
3
- "version": "2.0.7",
3
+ "version": "2.0.9",
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.0.10",
21
- "gdc-sdk-core-ts": "^2.0.7"
20
+ "gdc-common-utils-ts": "^2.0.11",
21
+ "gdc-sdk-core-ts": "file:../gdc-sdk-core-ts"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@types/node": "^20.14.10",