@incodetech/core 0.0.0-dev-20260622-9bf8c7b6 → 0.0.0-dev-20260622-1afbb270

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.
Files changed (47) hide show
  1. package/dist/ae-signature.d.ts +1 -1
  2. package/dist/{browser-DlFgHpoC-DwBHV6-1.esm.js → browser-DlFgHpoC-7tbRR1aR.esm.js} +1 -1
  3. package/dist/certificate-issuance.d.ts +28 -28
  4. package/dist/consent.d.ts +1 -1
  5. package/dist/{consentManager-2cEnSo5X.d.ts → consentManager-CxLnd7tp.d.ts} +55 -55
  6. package/dist/cpf-ocr.d.ts +1 -1
  7. package/dist/{cpfOcrManager-DBrAAaFq.d.ts → cpfOcrManager-C-94IPvN.d.ts} +20 -20
  8. package/dist/document-capture.d.ts +231 -231
  9. package/dist/document-upload.d.ts +49 -49
  10. package/dist/ekyb.esm.js +4 -3
  11. package/dist/{ekybStateMachine-_BUAKJoA.esm.js → ekybStateMachine-BYjsYX7O.esm.js} +1 -1
  12. package/dist/electronic-signature.d.ts +1 -1
  13. package/dist/extensibility.d.ts +4 -4
  14. package/dist/extensibility.esm.js +4 -3
  15. package/dist/flow.d.ts +2 -2
  16. package/dist/flow.esm.js +4 -2
  17. package/dist/{flowServices-D5V9TKpY.esm.js → flowServices-BB4RL-gf.esm.js} +1 -1
  18. package/dist/home.d.ts +10 -10
  19. package/dist/id-ocr.d.ts +52 -52
  20. package/dist/id-verification.d.ts +25 -25
  21. package/dist/id.esm.js +4 -3
  22. package/dist/{idCaptureManager-BpZHwjw6.esm.js → idCaptureManager-DuCmYhFN.esm.js} +1 -1
  23. package/dist/{idCaptureStateMachine-BmG31m_2.esm.js → idCaptureStateMachine-CYIMIv2b.esm.js} +1 -1
  24. package/dist/identity-reuse.d.ts +1 -1
  25. package/dist/{identityReuseManager-D14Yjbzj.d.ts → identityReuseManager--EgVi_nR.d.ts} +34 -34
  26. package/dist/{index-Cu5ZqstL.d.ts → index-52_qi4bd.d.ts} +18 -31
  27. package/dist/{index-IN3Ff4iD.d.ts → index-BHo34ss0.d.ts} +168 -168
  28. package/dist/index.d.ts +2 -2
  29. package/dist/index.esm.js +3 -3
  30. package/dist/mandatory-consent.d.ts +1 -1
  31. package/dist/{mandatoryConsentManager-ClPmYpP2.d.ts → mandatoryConsentManager-DGWgVRlI.d.ts} +52 -52
  32. package/dist/qe-signature.d.ts +1 -1
  33. package/dist/session.d.ts +4 -3
  34. package/dist/session.esm.js +3 -1
  35. package/dist/{sessionInitializer-DJv0L4rG.esm.js → sessionInitializer-DTbS9zxu.esm.js} +7 -4
  36. package/dist/{setup-DHGBjYDo.d.ts → setup-BJZAkajt.d.ts} +1 -3
  37. package/dist/{setup-DlXggroI.esm.js → setup-BMR3iW6s.esm.js} +3 -5
  38. package/dist/{tri-nGQNAf3M.esm.js → tri-CtxWthxz.esm.js} +81 -25
  39. package/dist/tri.d.ts +2 -2
  40. package/dist/{tri.esm-seBni-5K.esm.js → tri.esm-CrWAulDi.esm.js} +261 -252
  41. package/dist/tri.esm.js +2 -2
  42. package/dist/trust-graph.d.ts +2 -2
  43. package/dist/wasm.d.ts +2 -2
  44. package/dist/wasm.esm.js +3 -3
  45. package/dist/workflow.d.ts +142 -142
  46. package/dist/workflow.esm.js +5 -4
  47. package/package.json +3 -3
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import "./warmup--6HA3yUR.js";
2
- import "./index-Cu5ZqstL.js";
3
- import { a as reset, i as isConfigured, s as setup, t as SetupOptions } from "./setup-DHGBjYDo.js";
2
+ import "./index-52_qi4bd.js";
3
+ import { a as reset, i as isConfigured, s as setup, t as SetupOptions } from "./setup-BJZAkajt.js";
4
4
  export { type SetupOptions, isConfigured, reset, setup };
package/dist/index.esm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./WasmUtilProvider-CIu373BZ.esm.js";
2
- import { a as setup, n as isConfigured, r as reset } from "./setup-DlXggroI.esm.js";
2
+ import { a as setup, n as isConfigured, r as reset } from "./setup-BMR3iW6s.esm.js";
3
3
  import "./BrowserTimerProvider-BVgutW_b.esm.js";
4
4
  import "./api-DUZwyz0o.esm.js";
5
5
  import "./events-DN-u67gb.esm.js";
@@ -7,9 +7,9 @@ import "./endpoints-BM2_j_IE.esm.js";
7
7
  import "./stats-DntyIiGr.esm.js";
8
8
  import "./IpifyProvider-oZf7Ke1O.esm.js";
9
9
  import "./browserSimulation-CGjpdNA1.esm.js";
10
- import "./sessionInitializer-DJv0L4rG.esm.js";
10
+ import "./sessionInitializer-DTbS9zxu.esm.js";
11
11
  import "./platform-BfoqeM61.esm.js";
12
12
  import "./getBrowser-Dv8LZyHE.esm.js";
13
- import "./tri-nGQNAf3M.esm.js";
13
+ import "./tri-CtxWthxz.esm.js";
14
14
 
15
15
  export { isConfigured, reset, setup };
@@ -4,5 +4,5 @@ import "./camera-biGPWlmx.js";
4
4
  import "./types-Z9wv19v2.js";
5
5
  import "./types-DYZja-k9.js";
6
6
  import "./types-Dv-9WPJX.js";
7
- import { a as MandatoryConsentActor, i as createMandatoryConsentManagerFromActor, n as MandatoryConsentState, o as mandatoryConsentMachine, r as createMandatoryConsentManager, s as MandatoryConsentConfig, t as MandatoryConsentManager } from "./mandatoryConsentManager-ClPmYpP2.js";
7
+ import { a as MandatoryConsentActor, i as createMandatoryConsentManagerFromActor, n as MandatoryConsentState, o as mandatoryConsentMachine, r as createMandatoryConsentManager, s as MandatoryConsentConfig, t as MandatoryConsentManager } from "./mandatoryConsentManager-DGWgVRlI.js";
8
8
  export { type MandatoryConsentActor, type MandatoryConsentConfig, type MandatoryConsentManager, type MandatoryConsentState, createMandatoryConsentManager, createMandatoryConsentManagerFromActor, mandatoryConsentMachine };
@@ -1,7 +1,7 @@
1
1
  import { t as Manager } from "./Manager-B2OEDYqf.js";
2
2
  import { t as ActorRefFrom } from "./Actor-fIPLXfoi.js";
3
3
  import { a as RegulationTypes } from "./types-Dv-9WPJX.js";
4
- import * as xstate391 from "xstate";
4
+ import * as xstate1456 from "xstate";
5
5
 
6
6
  //#region src/modules/mandatory-consent/types.d.ts
7
7
  type RegulatoryConsentType = 'MANDATORY' | 'ML';
@@ -32,7 +32,7 @@ type MandatoryConsentContext = {
32
32
  type MandatoryConsentInput = {
33
33
  config: MandatoryConsentConfig;
34
34
  };
35
- declare const mandatoryConsentMachine: xstate391.StateMachine<MandatoryConsentContext, {
35
+ declare const mandatoryConsentMachine: xstate1456.StateMachine<MandatoryConsentContext, {
36
36
  type: "LOAD";
37
37
  } | {
38
38
  type: "TOGGLE";
@@ -45,53 +45,53 @@ declare const mandatoryConsentMachine: xstate391.StateMachine<MandatoryConsentCo
45
45
  } | {
46
46
  type: "RESET";
47
47
  }, {
48
- [x: string]: xstate391.ActorRefFromLogic<xstate391.PromiseActorLogic<FetchMandatoryConsentResponse, {
48
+ [x: string]: xstate1456.ActorRefFromLogic<xstate1456.PromiseActorLogic<FetchMandatoryConsentResponse, {
49
49
  config: MandatoryConsentConfig;
50
- }, xstate391.EventObject>> | xstate391.ActorRefFromLogic<xstate391.PromiseActorLogic<void, {
50
+ }, xstate1456.EventObject>> | xstate1456.ActorRefFromLogic<xstate1456.PromiseActorLogic<void, {
51
51
  consentId: string;
52
52
  isSigned: boolean;
53
- }, xstate391.EventObject>> | undefined;
54
- }, xstate391.Values<{
53
+ }, xstate1456.EventObject>> | undefined;
54
+ }, xstate1456.Values<{
55
55
  fetchConsent: {
56
56
  src: "fetchConsent";
57
- logic: xstate391.PromiseActorLogic<FetchMandatoryConsentResponse, {
57
+ logic: xstate1456.PromiseActorLogic<FetchMandatoryConsentResponse, {
58
58
  config: MandatoryConsentConfig;
59
- }, xstate391.EventObject>;
59
+ }, xstate1456.EventObject>;
60
60
  id: string | undefined;
61
61
  };
62
62
  submitConsent: {
63
63
  src: "submitConsent";
64
- logic: xstate391.PromiseActorLogic<void, {
64
+ logic: xstate1456.PromiseActorLogic<void, {
65
65
  consentId: string;
66
66
  isSigned: boolean;
67
- }, xstate391.EventObject>;
67
+ }, xstate1456.EventObject>;
68
68
  id: string | undefined;
69
69
  };
70
- }>, xstate391.Values<{
70
+ }>, xstate1456.Values<{
71
71
  setConsent: {
72
72
  type: "setConsent";
73
- params: xstate391.NonReducibleUnknown;
74
- };
75
- clearError: {
76
- type: "clearError";
77
- params: xstate391.NonReducibleUnknown;
73
+ params: xstate1456.NonReducibleUnknown;
78
74
  };
79
75
  setError: {
80
76
  type: "setError";
81
- params: xstate391.NonReducibleUnknown;
77
+ params: xstate1456.NonReducibleUnknown;
82
78
  };
83
- toggleSigned: {
84
- type: "toggleSigned";
85
- params: xstate391.NonReducibleUnknown;
79
+ clearError: {
80
+ type: "clearError";
81
+ params: xstate1456.NonReducibleUnknown;
86
82
  };
87
83
  resetContext: {
88
84
  type: "resetContext";
89
- params: xstate391.NonReducibleUnknown;
85
+ params: xstate1456.NonReducibleUnknown;
86
+ };
87
+ toggleSigned: {
88
+ type: "toggleSigned";
89
+ params: xstate1456.NonReducibleUnknown;
90
90
  };
91
91
  }>, {
92
92
  type: "canSubmit";
93
93
  params: unknown;
94
- }, never, "error" | "idle" | "closed" | "finished" | "loading" | "display" | "submitting", string, MandatoryConsentInput, xstate391.NonReducibleUnknown, xstate391.EventObject, xstate391.MetaObject, {
94
+ }, never, "error" | "idle" | "closed" | "finished" | "loading" | "display" | "submitting", string, MandatoryConsentInput, xstate1456.NonReducibleUnknown, xstate1456.EventObject, xstate1456.MetaObject, {
95
95
  readonly id: "mandatoryConsent";
96
96
  readonly initial: "idle";
97
97
  readonly context: ({
@@ -100,70 +100,70 @@ declare const mandatoryConsentMachine: xstate391.StateMachine<MandatoryConsentCo
100
100
  spawn: {
101
101
  <TSrc extends "fetchConsent" | "submitConsent">(logic: TSrc, ...[options]: ({
102
102
  src: "fetchConsent";
103
- logic: xstate391.PromiseActorLogic<FetchMandatoryConsentResponse, {
103
+ logic: xstate1456.PromiseActorLogic<FetchMandatoryConsentResponse, {
104
104
  config: MandatoryConsentConfig;
105
- }, xstate391.EventObject>;
105
+ }, xstate1456.EventObject>;
106
106
  id: string | undefined;
107
107
  } extends infer T ? T extends {
108
108
  src: "fetchConsent";
109
- logic: xstate391.PromiseActorLogic<FetchMandatoryConsentResponse, {
109
+ logic: xstate1456.PromiseActorLogic<FetchMandatoryConsentResponse, {
110
110
  config: MandatoryConsentConfig;
111
- }, xstate391.EventObject>;
111
+ }, xstate1456.EventObject>;
112
112
  id: string | undefined;
113
113
  } ? T extends {
114
114
  src: TSrc;
115
- } ? xstate391.ConditionalRequired<[options?: ({
115
+ } ? xstate1456.ConditionalRequired<[options?: ({
116
116
  id?: T["id"] | undefined;
117
117
  systemId?: string;
118
- input?: xstate391.InputFrom<T["logic"]> | undefined;
118
+ input?: xstate1456.InputFrom<T["logic"]> | undefined;
119
119
  syncSnapshot?: boolean;
120
- } & { [K in xstate391.RequiredActorOptions<T>]: unknown }) | undefined], xstate391.IsNotNever<xstate391.RequiredActorOptions<T>>> : never : never : never) | ({
120
+ } & { [K in xstate1456.RequiredActorOptions<T>]: unknown }) | undefined], xstate1456.IsNotNever<xstate1456.RequiredActorOptions<T>>> : never : never : never) | ({
121
121
  src: "submitConsent";
122
- logic: xstate391.PromiseActorLogic<void, {
122
+ logic: xstate1456.PromiseActorLogic<void, {
123
123
  consentId: string;
124
124
  isSigned: boolean;
125
- }, xstate391.EventObject>;
125
+ }, xstate1456.EventObject>;
126
126
  id: string | undefined;
127
127
  } extends infer T_1 ? T_1 extends {
128
128
  src: "submitConsent";
129
- logic: xstate391.PromiseActorLogic<void, {
129
+ logic: xstate1456.PromiseActorLogic<void, {
130
130
  consentId: string;
131
131
  isSigned: boolean;
132
- }, xstate391.EventObject>;
132
+ }, xstate1456.EventObject>;
133
133
  id: string | undefined;
134
134
  } ? T_1 extends {
135
135
  src: TSrc;
136
- } ? xstate391.ConditionalRequired<[options?: ({
136
+ } ? xstate1456.ConditionalRequired<[options?: ({
137
137
  id?: T_1["id"] | undefined;
138
138
  systemId?: string;
139
- input?: xstate391.InputFrom<T_1["logic"]> | undefined;
139
+ input?: xstate1456.InputFrom<T_1["logic"]> | undefined;
140
140
  syncSnapshot?: boolean;
141
- } & { [K_1 in xstate391.RequiredActorOptions<T_1>]: unknown }) | undefined], xstate391.IsNotNever<xstate391.RequiredActorOptions<T_1>>> : never : never : never)): xstate391.ActorRefFromLogic<xstate391.GetConcreteByKey<xstate391.Values<{
141
+ } & { [K_1 in xstate1456.RequiredActorOptions<T_1>]: unknown }) | undefined], xstate1456.IsNotNever<xstate1456.RequiredActorOptions<T_1>>> : never : never : never)): xstate1456.ActorRefFromLogic<xstate1456.GetConcreteByKey<xstate1456.Values<{
142
142
  fetchConsent: {
143
143
  src: "fetchConsent";
144
- logic: xstate391.PromiseActorLogic<FetchMandatoryConsentResponse, {
144
+ logic: xstate1456.PromiseActorLogic<FetchMandatoryConsentResponse, {
145
145
  config: MandatoryConsentConfig;
146
- }, xstate391.EventObject>;
146
+ }, xstate1456.EventObject>;
147
147
  id: string | undefined;
148
148
  };
149
149
  submitConsent: {
150
150
  src: "submitConsent";
151
- logic: xstate391.PromiseActorLogic<void, {
151
+ logic: xstate1456.PromiseActorLogic<void, {
152
152
  consentId: string;
153
153
  isSigned: boolean;
154
- }, xstate391.EventObject>;
154
+ }, xstate1456.EventObject>;
155
155
  id: string | undefined;
156
156
  };
157
157
  }>, "src", TSrc>["logic"]>;
158
- <TLogic extends xstate391.AnyActorLogic>(src: TLogic, ...[options]: xstate391.ConditionalRequired<[options?: ({
158
+ <TLogic extends xstate1456.AnyActorLogic>(src: TLogic, ...[options]: xstate1456.ConditionalRequired<[options?: ({
159
159
  id?: never;
160
160
  systemId?: string;
161
- input?: xstate391.InputFrom<TLogic> | undefined;
161
+ input?: xstate1456.InputFrom<TLogic> | undefined;
162
162
  syncSnapshot?: boolean;
163
- } & { [K in xstate391.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate391.IsNotNever<xstate391.RequiredLogicInput<TLogic>>>): xstate391.ActorRefFromLogic<TLogic>;
163
+ } & { [K in xstate1456.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate1456.IsNotNever<xstate1456.RequiredLogicInput<TLogic>>>): xstate1456.ActorRefFromLogic<TLogic>;
164
164
  };
165
165
  input: MandatoryConsentInput;
166
- self: xstate391.ActorRef<xstate391.MachineSnapshot<MandatoryConsentContext, {
166
+ self: xstate1456.ActorRef<xstate1456.MachineSnapshot<MandatoryConsentContext, {
167
167
  type: "LOAD";
168
168
  } | {
169
169
  type: "TOGGLE";
@@ -175,7 +175,7 @@ declare const mandatoryConsentMachine: xstate391.StateMachine<MandatoryConsentCo
175
175
  type: "RETRY";
176
176
  } | {
177
177
  type: "RESET";
178
- }, Record<string, xstate391.AnyActorRef | undefined>, xstate391.StateValue, string, unknown, any, any>, {
178
+ }, Record<string, xstate1456.AnyActorRef | undefined>, xstate1456.StateValue, string, unknown, any, any>, {
179
179
  type: "LOAD";
180
180
  } | {
181
181
  type: "TOGGLE";
@@ -187,7 +187,7 @@ declare const mandatoryConsentMachine: xstate391.StateMachine<MandatoryConsentCo
187
187
  type: "RETRY";
188
188
  } | {
189
189
  type: "RESET";
190
- }, xstate391.AnyEventObject>;
190
+ }, xstate1456.AnyEventObject>;
191
191
  }) => {
192
192
  config: MandatoryConsentConfig;
193
193
  consent: undefined;
@@ -224,7 +224,7 @@ declare const mandatoryConsentMachine: xstate391.StateMachine<MandatoryConsentCo
224
224
  } | {
225
225
  type: "RESET";
226
226
  };
227
- self: xstate391.ActorRef<xstate391.MachineSnapshot<MandatoryConsentContext, {
227
+ self: xstate1456.ActorRef<xstate1456.MachineSnapshot<MandatoryConsentContext, {
228
228
  type: "LOAD";
229
229
  } | {
230
230
  type: "TOGGLE";
@@ -236,7 +236,7 @@ declare const mandatoryConsentMachine: xstate391.StateMachine<MandatoryConsentCo
236
236
  type: "RETRY";
237
237
  } | {
238
238
  type: "RESET";
239
- }, Record<string, xstate391.AnyActorRef>, xstate391.StateValue, string, unknown, any, any>, {
239
+ }, Record<string, xstate1456.AnyActorRef>, xstate1456.StateValue, string, unknown, any, any>, {
240
240
  type: "LOAD";
241
241
  } | {
242
242
  type: "TOGGLE";
@@ -248,7 +248,7 @@ declare const mandatoryConsentMachine: xstate391.StateMachine<MandatoryConsentCo
248
248
  type: "RETRY";
249
249
  } | {
250
250
  type: "RESET";
251
- }, xstate391.AnyEventObject>;
251
+ }, xstate1456.AnyEventObject>;
252
252
  }) => {
253
253
  config: MandatoryConsentConfig;
254
254
  };
@@ -301,7 +301,7 @@ declare const mandatoryConsentMachine: xstate391.StateMachine<MandatoryConsentCo
301
301
  } | {
302
302
  type: "RESET";
303
303
  };
304
- self: xstate391.ActorRef<xstate391.MachineSnapshot<MandatoryConsentContext, {
304
+ self: xstate1456.ActorRef<xstate1456.MachineSnapshot<MandatoryConsentContext, {
305
305
  type: "LOAD";
306
306
  } | {
307
307
  type: "TOGGLE";
@@ -313,7 +313,7 @@ declare const mandatoryConsentMachine: xstate391.StateMachine<MandatoryConsentCo
313
313
  type: "RETRY";
314
314
  } | {
315
315
  type: "RESET";
316
- }, Record<string, xstate391.AnyActorRef>, xstate391.StateValue, string, unknown, any, any>, {
316
+ }, Record<string, xstate1456.AnyActorRef>, xstate1456.StateValue, string, unknown, any, any>, {
317
317
  type: "LOAD";
318
318
  } | {
319
319
  type: "TOGGLE";
@@ -325,7 +325,7 @@ declare const mandatoryConsentMachine: xstate391.StateMachine<MandatoryConsentCo
325
325
  type: "RETRY";
326
326
  } | {
327
327
  type: "RESET";
328
- }, xstate391.AnyEventObject>;
328
+ }, xstate1456.AnyEventObject>;
329
329
  }) => {
330
330
  consentId: string;
331
331
  isSigned: boolean;
@@ -1,6 +1,6 @@
1
1
  import { t as Manager } from "./Manager-B2OEDYqf.js";
2
2
  import "./Actor-fIPLXfoi.js";
3
- import { c as ConsentKey, f as QE_CONSENT_KEYS, g as getDefaultConsentChecks, i as electronicSignatureMachine, l as ElectronicSignatureConfig, m as areAllConsented, n as ElectronicSignatureState, s as ConsentChecks, u as ElectronicSignatureDocument } from "./index-IN3Ff4iD.js";
3
+ import { c as ConsentKey, f as QE_CONSENT_KEYS, g as getDefaultConsentChecks, i as electronicSignatureMachine, l as ElectronicSignatureConfig, m as areAllConsented, n as ElectronicSignatureState, s as ConsentChecks, u as ElectronicSignatureDocument } from "./index-BHo34ss0.js";
4
4
 
5
5
  //#region src/modules/qe-signature/index.d.ts
6
6
 
package/dist/session.d.ts CHANGED
@@ -222,9 +222,10 @@ type SessionInitResult = {
222
222
  *
223
223
  * Performs:
224
224
  * 1. Sets the token (and clears stale session-init cache if the token changed)
225
- * 2. Fetches feature configuration from backend
226
- * 3. Submits device fingerprint
227
- * 4. Starts the analytics batcher so buffered events are flushed
225
+ * 2. Links the session with the TRI activity if TRI is enabled
226
+ * 3. Fetches feature configuration from backend
227
+ * 4. Submits device fingerprint
228
+ * 5. Starts the analytics batcher so buffered events are flushed
228
229
  *
229
230
  * Results are cached per token. Calling again with the same token returns the
230
231
  * cached result; calling with a different token re-initializes from scratch.
@@ -1,12 +1,14 @@
1
+ import "./BrowserTimerProvider-BVgutW_b.esm.js";
1
2
  import "./api-DUZwyz0o.esm.js";
2
3
  import "./events-DN-u67gb.esm.js";
3
4
  import "./endpoints-BM2_j_IE.esm.js";
4
5
  import "./stats-DntyIiGr.esm.js";
5
6
  import "./IpifyProvider-oZf7Ke1O.esm.js";
6
7
  import "./browserSimulation-CGjpdNA1.esm.js";
7
- import { r as initializeSession } from "./sessionInitializer-DJv0L4rG.esm.js";
8
+ import { r as initializeSession } from "./sessionInitializer-DTbS9zxu.esm.js";
8
9
  import "./platform-BfoqeM61.esm.js";
9
10
  import "./getBrowser-Dv8LZyHE.esm.js";
11
+ import "./tri-CtxWthxz.esm.js";
10
12
  import { t as IncodeApiError } from "./apiError-D-GTvFrH.esm.js";
11
13
  import { a as refreshQrUrlUuid, i as createSession, n as QrValidationError, o as validateQrUuid, r as bootstrapSession, t as QR_VALIDATION_ERROR_CODES } from "./session-Be_IA1e0.esm.js";
12
14
  import { n as getFinishStatus } from "./flowCompletionService-D_CsiDZM.esm.js";
@@ -4,6 +4,7 @@ import { t as endpoints } from "./endpoints-BM2_j_IE.esm.js";
4
4
  import { n as flushDeviceStatsQueue, r as resetDeviceStatsQueue } from "./stats-DntyIiGr.esm.js";
5
5
  import { n as resetIpifyCache, r as BrowserEnvironmentProvider, t as IpifyProvider } from "./IpifyProvider-oZf7Ke1O.esm.js";
6
6
  import { i as UAParser, n as getThumbmarkId, r as getParsedUserAgent, t as isBrowserSimulation } from "./browserSimulation-CGjpdNA1.esm.js";
7
+ import { i as linkSessionWithTRI, r as isTRIStarted } from "./tri-CtxWthxz.esm.js";
7
8
 
8
9
  //#region ../infra/src/providers/browser/BrowserInfoProvider.ts
9
10
  var BrowserInfoProvider = class {
@@ -185,7 +186,7 @@ function resetFeatureConfigCache() {
185
186
 
186
187
  //#endregion
187
188
  //#region src/internal/version/sdkVersion.ts
188
- const SDK_VERSION = "0.0.0-dev-20260622-9bf8c7b6";
189
+ const SDK_VERSION = "0.0.0-dev-20260622-1afbb270";
189
190
 
190
191
  //#endregion
191
192
  //#region src/internal/fingerprint/fingerprintService.ts
@@ -238,9 +239,10 @@ let sessionInitPromise = null;
238
239
  *
239
240
  * Performs:
240
241
  * 1. Sets the token (and clears stale session-init cache if the token changed)
241
- * 2. Fetches feature configuration from backend
242
- * 3. Submits device fingerprint
243
- * 4. Starts the analytics batcher so buffered events are flushed
242
+ * 2. Links the session with the TRI activity if TRI is enabled
243
+ * 3. Fetches feature configuration from backend
244
+ * 4. Submits device fingerprint
245
+ * 5. Starts the analytics batcher so buffered events are flushed
244
246
  *
245
247
  * Results are cached per token. Calling again with the same token returns the
246
248
  * cached result; calling with a different token re-initializes from scratch.
@@ -265,6 +267,7 @@ async function initializeSession(options = {}) {
265
267
  if (token !== void 0 && token !== getToken()) {
266
268
  setToken(token);
267
269
  resetSessionInit();
270
+ if (isTRIStarted()) await linkSessionWithTRI(token);
268
271
  }
269
272
  if (sessionInitialized && cachedFeatures) return {
270
273
  features: cachedFeatures,
@@ -1,5 +1,5 @@
1
1
  import { n as WasmPipeline } from "./warmup--6HA3yUR.js";
2
- import { s as TransactionalRiskIntelligenceSetupConfig } from "./index-Cu5ZqstL.js";
2
+ import { s as TransactionalRiskIntelligenceSetupConfig } from "./index-52_qi4bd.js";
3
3
 
4
4
  //#region src/setup.d.ts
5
5
 
@@ -330,8 +330,6 @@ type SetupOptions = {
330
330
  * tri: { token: session.token, apiURL: process.env.INCODE_TRI_API_URL, autostart: false },
331
331
  * });
332
332
  *
333
- * // Delayed start:
334
- * await setupTRI({ token: session.token, apiURL: process.env.INCODE_TRI_API_URL });
335
333
  * // somewhere else in the code
336
334
  * await startTRI();
337
335
  * ```
@@ -4,8 +4,8 @@ import { a as resetApi, i as isApiConfigured, n as getApi, o as setClient, r as
4
4
  import { _ as getAnalyticsBatcher, h as createAnalyticsBatchingService, v as resetAnalyticsBatcher, y as setAnalyticsBatcher } from "./events-DN-u67gb.esm.js";
5
5
  import { t as endpoints } from "./endpoints-BM2_j_IE.esm.js";
6
6
  import { r as resetDeviceStatsQueue, t as addDeviceStats } from "./stats-DntyIiGr.esm.js";
7
- import { a as setClientIpLookupEnabled, i as resetSessionInit, r as initializeSession } from "./sessionInitializer-DJv0L4rG.esm.js";
8
- import { i as resetTRIProviderInstance, n as initializeTRI, r as resetTRI } from "./tri-nGQNAf3M.esm.js";
7
+ import { a as setClientIpLookupEnabled, i as resetSessionInit, r as initializeSession } from "./sessionInitializer-DTbS9zxu.esm.js";
8
+ import { a as resetTRI, n as initializeTRI, o as resetTRIProviderInstance } from "./tri-CtxWthxz.esm.js";
9
9
 
10
10
  //#region ../infra/src/wasm/wasmDefaults.ts
11
11
  const WASM_CDN_BASE_URL = "https://cdn.incodesmile.com/ml-wasm-kit-release";
@@ -943,8 +943,6 @@ let configured = false;
943
943
  * tri: { token: session.token, apiURL: process.env.INCODE_TRI_API_URL, autostart: false },
944
944
  * });
945
945
  *
946
- * // Delayed start:
947
- * await setupTRI({ token: session.token, apiURL: process.env.INCODE_TRI_API_URL });
948
946
  * // somewhere else in the code
949
947
  * await startTRI();
950
948
  * ```
@@ -989,7 +987,7 @@ async function setup(options) {
989
987
  await provider.setProductionMode(!showWasmLogs);
990
988
  if (!options.devMode) startDevtoolsDetector();
991
989
  }
992
- if (options.tri) await initializeTRI(options.tri);
990
+ if (options.tri) await initializeTRI(options.tri, { sessionToken: options.token });
993
991
  }
994
992
  /**
995
993
  * Sets the WASM configuration without performing warmup.
@@ -120,7 +120,7 @@ const LAZY_IMPORT_OPTIONS = {
120
120
  timeoutMs: 1e4,
121
121
  disabledMessage: "TRI will be disabled for this session."
122
122
  };
123
- const importSdk = () => import("./tri.esm-seBni-5K.esm.js");
123
+ const importSdk = () => import("./tri.esm-CrWAulDi.esm.js");
124
124
  /**
125
125
  * Concrete implementation of {@link ITransactionalRiskIntelligenceCapability}.
126
126
  *
@@ -129,10 +129,11 @@ const importSdk = () => import("./tri.esm-seBni-5K.esm.js");
129
129
  * {@link setup} is called, so consumers that never opt into TRI (i.e. never
130
130
  * pass `tri` to `setup()`) do not pay the bundle cost.
131
131
  *
132
- * `start()`, `stop()`, and `reset()` require a prior successful `setup()`
133
- * call. The SDK cannot start without the foundation, collection-status check,
134
- * and managers that `setup()` establishes. Calling these methods before
135
- * `setup()` is a no-op that returns `'init-failed'`.
132
+ * `start()`, `stop()`, `reset()`, and `linkInterview()` require a prior
133
+ * successful `setup()` call. The SDK cannot start without the foundation,
134
+ * collection-status check, and managers that `setup()` establishes. Calling
135
+ * these methods before `setup()` is a no-op that returns `'init-failed'` or
136
+ * `false` respectively.
136
137
  *
137
138
  * The dynamic `import('@incodetech/tri-sdk')` is managed by
138
139
  * {@link BrowserLazyImportProvider}, which races the import against a
@@ -142,6 +143,7 @@ const importSdk = () => import("./tri.esm-seBni-5K.esm.js");
142
143
  */
143
144
  var TransactionalRiskIntelligenceProvider = class TransactionalRiskIntelligenceProvider {
144
145
  constructor() {
146
+ this._isStarted = false;
145
147
  this._lazySdk = BrowserLazyImportProvider.getInstance().create(importSdk, LAZY_IMPORT_OPTIONS);
146
148
  }
147
149
  static getInstance() {
@@ -150,6 +152,9 @@ var TransactionalRiskIntelligenceProvider = class TransactionalRiskIntelligenceP
150
152
  static resetInstance() {
151
153
  this._instance = void 0;
152
154
  }
155
+ get isStarted() {
156
+ return this._isStarted;
157
+ }
153
158
  /**
154
159
  * Lazy-loads `@incodetech/tri-sdk` (shared lazy handle) and exchanges the
155
160
  * organization API key for a short-lived SDK token via the module's
@@ -175,12 +180,19 @@ var TransactionalRiskIntelligenceProvider = class TransactionalRiskIntelligenceP
175
180
  * timeout), then delegates to its `setup()`. Returns a promise that resolves
176
181
  * once the SDK module has been fetched and the backend collection-status
177
182
  * check has completed.
183
+ *
184
+ * When `config.autostart` is `true` (the default), the underlying `setup()`
185
+ * also calls `start()` and returns `'started'` on success. `_isStarted` is
186
+ * updated to reflect the resulting state so that `isTRIStarted()` is
187
+ * accurate immediately after `setup()` returns.
178
188
  */
179
189
  async setup(config) {
180
190
  try {
181
191
  const module = await this._lazySdk.load();
182
192
  if (!module) return "init-failed";
183
- return await module.default.setup(config);
193
+ const state = await module.default.setup(config);
194
+ if (state === "started") this._isStarted = true;
195
+ return state;
184
196
  } catch {
185
197
  return "init-failed";
186
198
  }
@@ -190,19 +202,39 @@ var TransactionalRiskIntelligenceProvider = class TransactionalRiskIntelligenceP
190
202
  * Returns `'init-failed'` without starting if called before `setup()`.
191
203
  */
192
204
  async start() {
193
- return this._getSdk()?.start() ?? Promise.resolve("init-failed");
205
+ const state = await (this._getSdk()?.start() ?? Promise.resolve("init-failed"));
206
+ this._isStarted = state === "started";
207
+ return state;
194
208
  }
195
209
  /**
196
210
  * Stops all collectors and managers. No-op when called before `setup()`.
197
211
  */
198
212
  async stop() {
199
- return this._getSdk()?.stop() ?? Promise.resolve("init-failed");
213
+ const state = await (this._getSdk()?.stop() ?? Promise.resolve("init-failed"));
214
+ this._isStarted = false;
215
+ return state;
200
216
  }
201
217
  /**
202
218
  * Resets the TRI SDK to its initial state. No-op when called before `setup()`.
203
219
  */
204
220
  async reset() {
205
- return this._getSdk()?.reset() ?? Promise.resolve("init-failed");
221
+ const state = await (this._getSdk()?.reset() ?? Promise.resolve("init-failed"));
222
+ this._isStarted = false;
223
+ return state;
224
+ }
225
+ /**
226
+ * Links an interview to the current TRI activity. Returns `false` when
227
+ * called before `setup()` or when the backend request fails. Never throws,
228
+ * so the boot/flow path is never blocked by a failed link.
229
+ *
230
+ * @param sessionToken - The Incode session token to link.
231
+ */
232
+ async linkInterview(sessionToken) {
233
+ try {
234
+ return await this._getSdk()?.linkInterview(sessionToken) ?? false;
235
+ } catch {
236
+ return false;
237
+ }
206
238
  }
207
239
  _getSdk() {
208
240
  return this._lazySdk.get()?.default ?? null;
@@ -218,16 +250,24 @@ var TransactionalRiskIntelligenceProvider = class TransactionalRiskIntelligenceP
218
250
  * (the interface) rather than the concrete provider class. The provider is
219
251
  * referenced here only to supply the default singleton. This integration
220
252
  * module is the single owner of the concrete provider reference — the rest of
221
- * core goes through these functions ({@link resetTRIProviderInstance}, etc.)
222
- * instead of importing the provider directly.
253
+ * core goes through these functions ({@link isTRIStarted},
254
+ * {@link resetTRIProviderInstance}, etc.) instead of importing the provider.
223
255
  */
224
256
  function getProvider() {
225
257
  return TransactionalRiskIntelligenceProvider.getInstance();
226
258
  }
227
259
  /**
260
+ * Returns `true` when TRI collectors are currently running (a successful
261
+ * `setupTRI()` autostart or explicit `startTRI()`, with no subsequent
262
+ * `stopTRI()`/`resetTRI()`). Returns `false` before setup or after teardown.
263
+ */
264
+ function isTRIStarted() {
265
+ return getProvider().isStarted;
266
+ }
267
+ /**
228
268
  * Discards the cached TRI provider singleton so the next access constructs a
229
269
  * fresh instance. Call from the SDK's `reset()` after `resetTRI()` to clear
230
- * the started flag and lazy-import state.
270
+ * the `isStarted` flag and lazy-import state.
231
271
  */
232
272
  function resetTRIProviderInstance() {
233
273
  TransactionalRiskIntelligenceProvider.resetInstance();
@@ -249,31 +289,35 @@ async function createTRISession(apiKey, options) {
249
289
  return getProvider().createSession(apiKey, options);
250
290
  }
251
291
  /**
252
- * Initializes TRI in a single step: resolves the config, calls `setupTRI`,
253
- * and — unless `config.autostart` is `false` — calls `startTRI`.
292
+ * Initializes TRI in a single step: resolves the config, calls `setupTRI`
293
+ * (which autostarts unless `config.autostart` is `false`), and optionally
294
+ * links the current Incode session.
254
295
  *
255
296
  * Returns the resolved {@link TransactionalRiskIntelligenceState}. If the
256
297
  * config cannot be resolved (e.g. missing `token` or `apiURL`), returns
257
298
  * `'init-failed'` after emitting a `[TRI]` warning.
258
299
  *
259
- * When `config.autostart` is `false`, setup runs fully (lazy-load,
260
- * config validation, backend collection-status check) but collection is
261
- * deferred — call `startTRI()` explicitly when ready. The returned state
262
- * is `'ready'` (or another non-started state from `setupTRI` on failure).
300
+ * When `config.autostart` is `false`, the underlying `setupTRI` returns
301
+ * `'ready'` without starting collection — call `startTRI()` explicitly when
302
+ * ready (e.g. after a consent gate). Linking is skipped in that case since
303
+ * TRI has not started.
263
304
  *
264
305
  * @param config - TRI setup config (must include `token` and `apiURL`).
306
+ * @param options - Optional session-linking hints (`sessionToken`).
265
307
  */
266
- async function initializeTRI(config) {
308
+ async function initializeTRI(config, options = {}) {
267
309
  const resolvedTriConfig = resolveTRIConfig(config);
268
310
  if (!resolvedTriConfig) return "init-failed";
269
- const setupState = await setupTRI(resolvedTriConfig);
270
- if (setupState !== "ready" || config.autostart === false) return setupState;
271
- return startTRI();
311
+ const state = await setupTRI(resolvedTriConfig);
312
+ if (isTRIStarted() && options.sessionToken) await linkSessionWithTRI(options.sessionToken);
313
+ return state;
272
314
  }
273
315
  /**
274
316
  * Calls the provider's `setup()` with the given config. This is the step that
275
317
  * lazy-loads `@incodetech/tri-sdk`, validates the config, and checks the
276
- * backend collection-status endpoint. Must be called before `startTRI`.
318
+ * backend collection-status endpoint. When `config.autostart` is `true` (the
319
+ * default), also calls `start()` internally and returns `'started'` on
320
+ * success. Pass `autostart: false` to receive `'ready'` and start explicitly.
277
321
  *
278
322
  * @param config - Resolved TRI config (`token` and `apiURL` required).
279
323
  * @returns The resulting {@link TransactionalRiskIntelligenceState}.
@@ -283,7 +327,8 @@ async function setupTRI(config) {
283
327
  }
284
328
  /**
285
329
  * Begins behavioral data collection. Requires a prior successful `setupTRI()`
286
- * call. Returns `'init-failed'` without starting if called beforehand.
330
+ * call with `autostart: false`. Returns `'init-failed'` without starting if
331
+ * called before setup, or is a no-op if already started.
287
332
  *
288
333
  * @returns The resulting {@link TransactionalRiskIntelligenceState}.
289
334
  */
@@ -305,6 +350,17 @@ async function resetTRI() {
305
350
  return getProvider().reset();
306
351
  }
307
352
  /**
353
+ * Links the current Incode interview session to the active TRI activity.
354
+ *
355
+ * Returns `false` when the session token is missing or TRI has not been set up.
356
+ *
357
+ * @param sessionToken - Incode session JWT.
358
+ */
359
+ async function linkSessionWithTRI(sessionToken) {
360
+ if (!sessionToken) return false;
361
+ return getProvider().linkInterview(sessionToken);
362
+ }
363
+ /**
308
364
  * @private This function is not used outside of this file.
309
365
  *
310
366
  * Validates and narrows a {@link TransactionalRiskIntelligenceSetupConfig}
@@ -330,4 +386,4 @@ function resolveTRIConfig(config) {
330
386
  }
331
387
 
332
388
  //#endregion
333
- export { setupTRI as a, resetTRIProviderInstance as i, initializeTRI as n, startTRI as o, resetTRI as r, stopTRI as s, createTRISession as t };
389
+ export { resetTRI as a, startTRI as c, linkSessionWithTRI as i, stopTRI as l, initializeTRI as n, resetTRIProviderInstance as o, isTRIStarted as r, setupTRI as s, createTRISession as t };
package/dist/tri.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as startTRI, i as setupTRI, n as initializeTRI, o as stopTRI, r as resetTRI, s as TransactionalRiskIntelligenceSetupConfig, t as createTRISession } from "./index-Cu5ZqstL.js";
2
- export { TransactionalRiskIntelligenceSetupConfig, createTRISession, initializeTRI, resetTRI, setupTRI, startTRI, stopTRI };
1
+ import { a as startTRI, i as setupTRI, n as isTRIStarted, o as stopTRI, r as resetTRI, s as TransactionalRiskIntelligenceSetupConfig, t as createTRISession } from "./index-52_qi4bd.js";
2
+ export { TransactionalRiskIntelligenceSetupConfig, createTRISession, isTRIStarted, resetTRI, setupTRI, startTRI, stopTRI };