@incodetech/core 2.0.0-rc.0 → 2.0.0

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 (178) hide show
  1. package/package.json +3 -3
  2. package/dist/Actor-CI32dTbG.d.ts +0 -2
  3. package/dist/BaseWasmProvider-C_DLEI40.esm.js +0 -1118
  4. package/dist/BrowserStorageProvider-CuOW1Er2.esm.js +0 -55
  5. package/dist/BrowserTimerProvider-DhNc_x02.esm.js +0 -22
  6. package/dist/ITimerCapability-C67ZRskg.esm.js +0 -7
  7. package/dist/IpifyProvider-D7jx52AL.esm.js +0 -139
  8. package/dist/Manager-C8PrhBOx.d.ts +0 -19
  9. package/dist/MotionSensorProvider-4v7xkqAp.esm.js +0 -254
  10. package/dist/OpenViduRecordingProvider-CMu6XVdc.esm.js +0 -87
  11. package/dist/StateMachine-BCQrZJhf.d.ts +0 -2
  12. package/dist/WasmUtilProvider-j98OJf-S.esm.js +0 -114
  13. package/dist/addressSearch-BpTbTWCa.esm.js +0 -430
  14. package/dist/ae-signature-DDDZmWXj.esm.js +0 -12
  15. package/dist/ae-signature.d.ts +0 -25
  16. package/dist/ae-signature.esm.js +0 -8
  17. package/dist/antifraud.d.ts +0 -57
  18. package/dist/antifraud.esm.js +0 -45
  19. package/dist/antifraudStateMachine-O0TMf6yc.esm.js +0 -39
  20. package/dist/api-CESGtpbH.esm.js +0 -53
  21. package/dist/authentication.d.ts +0 -12
  22. package/dist/authentication.esm.js +0 -25
  23. package/dist/authenticationManager-5M-fKzXx.esm.js +0 -67
  24. package/dist/authenticationManager-C83GNIhl.d.ts +0 -66
  25. package/dist/authenticationStateMachine-BMZqatiF.esm.js +0 -139
  26. package/dist/backCameraStream-DMdMeGk2.esm.js +0 -346
  27. package/dist/browserSimulation-gxD8cSpM.esm.js +0 -20
  28. package/dist/camera-DBSxa6ML.d.ts +0 -4
  29. package/dist/camera-PA2Ljri3.esm.js +0 -22
  30. package/dist/camera.d.ts +0 -15
  31. package/dist/camera.esm.js +0 -5
  32. package/dist/chunk-CRF6K_H_.esm.js +0 -49
  33. package/dist/consent.d.ts +0 -398
  34. package/dist/consent.esm.js +0 -79
  35. package/dist/consentStateMachine-CCT-B60O.esm.js +0 -151
  36. package/dist/cpf-PPz2Njto.esm.js +0 -38
  37. package/dist/cpf-ocr.d.ts +0 -204
  38. package/dist/cpf-ocr.esm.js +0 -177
  39. package/dist/cross-document-data-match.d.ts +0 -34
  40. package/dist/cross-document-data-match.esm.js +0 -71
  41. package/dist/curp-validation.d.ts +0 -188
  42. package/dist/curp-validation.esm.js +0 -110
  43. package/dist/curpValidationStateMachine-CitWLr2c.esm.js +0 -595
  44. package/dist/custom-fields.d.ts +0 -115
  45. package/dist/custom-fields.esm.js +0 -177
  46. package/dist/custom-watchlist.d.ts +0 -66
  47. package/dist/custom-watchlist.esm.js +0 -86
  48. package/dist/dateUtils-UoN5xswP.esm.js +0 -23
  49. package/dist/deepsightLoader-Cm4JIT_z.esm.js +0 -52
  50. package/dist/deepsightService-CEVxzehb.d.ts +0 -412
  51. package/dist/deepsightService-O74l4Y__.esm.js +0 -489
  52. package/dist/device.d.ts +0 -46
  53. package/dist/device.esm.js +0 -106
  54. package/dist/displayErrors-DqJ_IbsG.d.ts +0 -39
  55. package/dist/document-capture.d.ts +0 -906
  56. package/dist/document-capture.esm.js +0 -156
  57. package/dist/document-upload.d.ts +0 -331
  58. package/dist/document-upload.esm.js +0 -203
  59. package/dist/documentCaptureStateMachine-BqzTDy9k.esm.js +0 -394
  60. package/dist/dynamic-forms.d.ts +0 -178
  61. package/dist/dynamic-forms.esm.js +0 -323
  62. package/dist/ekyb.d.ts +0 -148
  63. package/dist/ekyb.esm.js +0 -127
  64. package/dist/ekybStateMachine-B59rQjgj.esm.js +0 -674
  65. package/dist/ekyc.d.ts +0 -164
  66. package/dist/ekyc.esm.js +0 -104
  67. package/dist/ekycStateMachine-oeO0Iekd.esm.js +0 -10626
  68. package/dist/electronic-signature.d.ts +0 -4
  69. package/dist/electronic-signature.esm.js +0 -7
  70. package/dist/electronicSignatureManager-D9OHzTpG.esm.js +0 -428
  71. package/dist/email.d.ts +0 -4
  72. package/dist/email.esm.js +0 -9
  73. package/dist/emailManager-DIfnS5g1.d.ts +0 -352
  74. package/dist/emailManager-wAV0LE-H.esm.js +0 -238
  75. package/dist/emailStateMachine-DOf4j58N.esm.js +0 -292
  76. package/dist/endpoints-CnN3SyDa.esm.js +0 -87
  77. package/dist/events-D6-e4vok.esm.js +0 -596
  78. package/dist/events.d.ts +0 -265
  79. package/dist/events.esm.js +0 -4
  80. package/dist/extensibility.d.ts +0 -122
  81. package/dist/extensibility.esm.js +0 -43
  82. package/dist/face-match.d.ts +0 -228
  83. package/dist/face-match.esm.js +0 -173
  84. package/dist/faceCaptureManagerFactory-Dh2PdGlF.esm.js +0 -290
  85. package/dist/faceCaptureManagerFactory-yqtpxjnN.d.ts +0 -690
  86. package/dist/faceCaptureSetup-B3faSpYA.esm.js +0 -873
  87. package/dist/faceMatchStateMachine-DNFrxTFS.esm.js +0 -127
  88. package/dist/flow-events.d.ts +0 -6
  89. package/dist/flow-events.esm.js +0 -0
  90. package/dist/flow.d.ts +0 -358
  91. package/dist/flow.esm.js +0 -825
  92. package/dist/flowCompletionService-DhkT4SRY.d.ts +0 -10
  93. package/dist/flowCompletionService-P54yzGvA.esm.js +0 -13
  94. package/dist/flowServices-DTsm-Vf1.esm.js +0 -188
  95. package/dist/geolocation.d.ts +0 -127
  96. package/dist/geolocation.esm.js +0 -89
  97. package/dist/geolocationStateMachine-asasuHY2.esm.js +0 -105
  98. package/dist/getBrowser-BSXUTWXw.esm.js +0 -41
  99. package/dist/getDeviceClass-BSntT9_j.esm.js +0 -14
  100. package/dist/government-validation.d.ts +0 -67
  101. package/dist/government-validation.esm.js +0 -81
  102. package/dist/governmentValidationStateMachine-BDDYrJTo.esm.js +0 -271
  103. package/dist/home.d.ts +0 -99
  104. package/dist/home.esm.js +0 -61
  105. package/dist/http.d.ts +0 -68
  106. package/dist/http.esm.js +0 -3
  107. package/dist/id-ocr.d.ts +0 -635
  108. package/dist/id-ocr.esm.js +0 -86
  109. package/dist/id-verification.d.ts +0 -190
  110. package/dist/id-verification.esm.js +0 -43
  111. package/dist/id.d.ts +0 -24
  112. package/dist/id.esm.js +0 -164
  113. package/dist/idCaptureManager-B9TGA5dq.d.ts +0 -956
  114. package/dist/idCaptureManager-DMK0GIt3.esm.js +0 -581
  115. package/dist/idCaptureStateMachine-Bq0fVZXl.esm.js +0 -2954
  116. package/dist/idOcrStateMachine-YbjjC_Gg.esm.js +0 -388
  117. package/dist/idVerificationStateMachine-xbw9HP1Z.esm.js +0 -71
  118. package/dist/identity-reuse.d.ts +0 -530
  119. package/dist/identity-reuse.esm.js +0 -274
  120. package/dist/index-BLKtMA0g.d.ts +0 -1177
  121. package/dist/index-BcRG8rtJ.d.ts +0 -97
  122. package/dist/index.d.ts +0 -3
  123. package/dist/index.esm.js +0 -12
  124. package/dist/invokeOnCaptureCallback-rc6kBHo5.esm.js +0 -30
  125. package/dist/lib-BB0B_qQX.esm.js +0 -12499
  126. package/dist/mandatory-consent.d.ts +0 -412
  127. package/dist/mandatory-consent.esm.js +0 -78
  128. package/dist/mandatoryConsentStateMachine-Cnco1jvn.esm.js +0 -126
  129. package/dist/openviduLazy-Cm0XFh_v.esm.js +0 -3
  130. package/dist/openviduLazy-Cok70ZSg.esm.js +0 -12
  131. package/dist/permissionServices-D_i6nzEw.esm.js +0 -50
  132. package/dist/phone.d.ts +0 -4
  133. package/dist/phone.esm.js +0 -9
  134. package/dist/phoneManager-B6M30hKE.d.ts +0 -397
  135. package/dist/phoneManager-DAJbGhlY.esm.js +0 -256
  136. package/dist/phoneStateMachine-CuPARRaT.esm.js +0 -351
  137. package/dist/platform-CfrjKhmi.esm.js +0 -83
  138. package/dist/qe-signature-DFo_Cc-I.esm.js +0 -12
  139. package/dist/qe-signature.d.ts +0 -25
  140. package/dist/qe-signature.esm.js +0 -8
  141. package/dist/recordingService-Ig2UgbLv.esm.js +0 -1003
  142. package/dist/redirect-to-mobile.d.ts +0 -107
  143. package/dist/redirect-to-mobile.esm.js +0 -102
  144. package/dist/redirectToMobileStateMachine-BOEqe46A.esm.js +0 -249
  145. package/dist/runChildModule-CqqwqAkW.esm.js +0 -219
  146. package/dist/selfie.d.ts +0 -26
  147. package/dist/selfie.esm.js +0 -146
  148. package/dist/selfieManager-D0lSgd-J.d.ts +0 -68
  149. package/dist/selfieManager-Duisl7qN.esm.js +0 -60
  150. package/dist/selfieStateMachine-D76whWEf.esm.js +0 -68
  151. package/dist/session-BS-d_vuE.esm.js +0 -3206
  152. package/dist/session.d.ts +0 -217
  153. package/dist/session.esm.js +0 -9
  154. package/dist/setup-Buy-hyj4.esm.js +0 -887
  155. package/dist/setup-C5AITV8m.d.ts +0 -254
  156. package/dist/signature.d.ts +0 -94
  157. package/dist/signature.esm.js +0 -66
  158. package/dist/signatureStateMachine-B5-QVUve.esm.js +0 -132
  159. package/dist/stats-CIfiPzb1.esm.js +0 -16
  160. package/dist/stats.d.ts +0 -16
  161. package/dist/stats.esm.js +0 -4
  162. package/dist/trust-graph.d.ts +0 -54
  163. package/dist/trust-graph.esm.js +0 -56
  164. package/dist/types-B06Ypu2F.d.ts +0 -49
  165. package/dist/types-BP1m8VRw.d.ts +0 -340
  166. package/dist/types-CAD4va6a.d.ts +0 -5
  167. package/dist/types-CFV9G_7j.d.ts +0 -24
  168. package/dist/warmup-CEcppFiS.d.ts +0 -63
  169. package/dist/wasm.d.ts +0 -15
  170. package/dist/wasm.esm.js +0 -12
  171. package/dist/watchlist-for-business.d.ts +0 -79
  172. package/dist/watchlist-for-business.esm.js +0 -148
  173. package/dist/watchlist.d.ts +0 -62
  174. package/dist/watchlist.esm.js +0 -86
  175. package/dist/watchlistServices-DMbUhkBX.esm.js +0 -12
  176. package/dist/workflow.d.ts +0 -907
  177. package/dist/workflow.esm.js +0 -702
  178. package/dist/xstate.esm-B70JrNqo.esm.js +0 -3404
@@ -1,254 +0,0 @@
1
- import { n as WasmPipeline } from "./warmup-CEcppFiS.js";
2
-
3
- //#region src/setup.d.ts
4
-
5
- /**
6
- * WASM warmup configuration. Path fields are optional; omitted values resolve to the Incode CDN defaults.
7
- */
8
- type WasmConfig = {
9
- /** Path to the WASM binary */
10
- wasmPath?: string;
11
- /** Path to the SIMD-optimized WASM binary (optional) */
12
- wasmSimdPath?: string;
13
- /** Path to the WASM glue code (paired with `wasmPath`) */
14
- glueCodePath?: string;
15
- /**
16
- * Path to the SIMD-optimized WASM glue code (paired with `wasmSimdPath`).
17
- * If omitted, defaults to a sibling `.js` derived from `wasmSimdPath`.
18
- */
19
- glueCodeSimdPath?: string;
20
- /** Whether to use SIMD optimizations (default: true) */
21
- useSimd?: boolean;
22
- /** Which pipelines to preload models for */
23
- pipelines?: WasmPipeline[];
24
- /**
25
- * Base path for ML model files. Models will be loaded from `${modelsBasePath}/${modelFileName}`.
26
- * If not provided, models are expected in a 'models' subdirectory relative to the WASM binary.
27
- */
28
- modelsBasePath?: string;
29
- };
30
- /**
31
- * Object form of the `encryption` option for {@link SetupOptions}. Reach for
32
- * this when you need to pin the OAEP MGF1 hash; the boolean shorthand
33
- * (`encryption: true`) is equivalent to `{}` and uses the SHA-1 default.
34
- *
35
- * Which value to pass is **dictated by the E2EE environment Incode has
36
- * provisioned for your account** — confirm with your Incode account team
37
- * before changing it.
38
- */
39
- type EncryptionOptions = {
40
- /**
41
- * OAEP MGF1 hash for the in-binary RSA handshake.
42
- * - `'sha1'` (default) — matches the legacy Java backend default. Most
43
- * E2EE environments are happy with this.
44
- * - `'sha256'` — sends the
45
- * `X-RSA-Encryption-Scheme: RSA/NONE/OAEPWITHSHA-256ANDMGF1PADDING`
46
- * header on every encrypted request so the server matches. Only use this
47
- * if the environment has been configured to honor the explicit header.
48
- *
49
- * Locked at the first `setup()` call. To change it, call `reset()` and
50
- * re-`setup()` from scratch.
51
- */
52
- mgf1?: 'sha1' | 'sha256';
53
- };
54
- /**
55
- * Configuration options for the SDK setup.
56
- */
57
- type SetupOptions = {
58
- /** The base URL for the API. When omitted, no HTTP client is created — useful when all API actors are overridden via .provide(). */
59
- apiURL?: string;
60
- /**
61
- * The session token for API requests.
62
- *
63
- * Optional convenience — when provided, `setup` delegates to
64
- * `initializeSession({ token, hostingApp })` after the HTTP client is in
65
- * place. Equivalent to calling `initializeSession` yourself after
66
- * `setup({ apiURL })` returns, which is the preferred shape when you want to
67
- * own the moment the session is activated (e.g. between `createSession` and
68
- * mounting `<incode-flow>`).
69
- */
70
- token?: string;
71
- /** Custom headers to include in all requests */
72
- customHeaders?: Record<string, string>;
73
- /** Request timeout in milliseconds */
74
- timeout?: number;
75
- /**
76
- * WASM warmup config.
77
- * - Omit (default): does not load WASM.
78
- * - `false`: explicitly disable WASM loading.
79
- * - Object: load WASM with CDN defaults plus any overrides you provide.
80
- */
81
- wasm?: WasmConfig | false;
82
- /**
83
- * Enable end-to-end encryption for SDK traffic. When enabled, the SDK
84
- * negotiates an encrypted transport during initialization (RSA-OAEP key
85
- * transport + AES-GCM payload encryption). Independent of `token` —
86
- * encryption can be set up before a session token is known.
87
- *
88
- * **Not a self-serve flag.** E2EE has to be provisioned for your account
89
- * by Incode, and you'll be given a dedicated `apiURL` (typically a
90
- * `*-e2ee-api.incodesmile.com` host) plus the `mgf1` scheme that
91
- * environment expects. Pointing this at a non-E2EE host will fail the
92
- * handshake at `setup()`. Coordinate with your Incode account team before
93
- * flipping this on.
94
- *
95
- * Accepts:
96
- * - `true` → enabled with the default OAEP MGF1 hash (`'sha1'`).
97
- * - `false` (or omitted) → disabled.
98
- * - `{}` → same as `true`.
99
- * - `{ mgf1: 'sha256' }` → enabled with the SHA-256 MGF1 hash.
100
- *
101
- * Encryption requires the binary (WASM) transport. If `wasm: false` is set,
102
- * `setup` throws. If `wasm` is omitted, the binary transport is provisioned
103
- * automatically with CDN defaults.
104
- *
105
- * **Locked at boot.** The first `setup()` call decides whether encryption
106
- * is on, and if so which MGF1 scheme is used. Subsequent `setup()` calls
107
- * that would change either of those values throw with a descriptive error.
108
- * Call `reset()` if you need to change them.
109
- *
110
- * **Failure modes.** `setup()` rejects with a descriptive error if the
111
- * encrypted-transport handshake (`GET /e2ee/key/v2` + `POST /e2ee/key`)
112
- * cannot complete — most commonly because `apiURL` points at a host that
113
- * isn't provisioned for E2EE, or because the requested `mgf1` doesn't
114
- * match what the environment expects. There is no built-in retry; catch
115
- * and re-call `setup()` after `reset()` if your environment is
116
- * known-flaky.
117
- *
118
- * @throws If `wasm: false` is also set, or if the handshake fails, or if
119
- * the encryption value differs from what was locked in on the first
120
- * `setup()` call.
121
- */
122
- encryption?: boolean | EncryptionOptions;
123
- /** Optional hosting app identifier for fingerprint tracking */
124
- hostingApp?: string;
125
- };
126
- /**
127
- * Initializes the SDK with the provided configuration.
128
- * Must be called before using any SDK functionality.
129
- *
130
- * WASM loads only when `options.wasm` is provided as an object.
131
- *
132
- * `setup` is boot — it provisions the HTTP client, the optional E2EE
133
- * handshake, WASM warmup, and the analytics batcher. The session token is a
134
- * separate concern: hand it off via `initializeSession({ token })` from
135
- * `@incodetech/core/session`, or pass it inline as `setup({ apiURL, token })`
136
- * (a convenience that delegates to `initializeSession` for you).
137
- *
138
- * @param options - Configuration options for the SDK
139
- *
140
- * @example Boot first, activate the session later (preferred)
141
- * ```ts
142
- * import { setup } from '@incodetech/core';
143
- * import { createSession, initializeSession } from '@incodetech/core/session';
144
- *
145
- * await setup({ apiURL: 'https://api.incode.com' });
146
- * const session = await createSession(apiKey, { configurationId });
147
- * await initializeSession({ token: session.token });
148
- * ```
149
- *
150
- * @example One-shot convenience
151
- * ```ts
152
- * await setup({ apiURL: 'https://api.incode.com', token: 'session-token' });
153
- * ```
154
- *
155
- * @example Explicitly disable WASM
156
- * ```ts
157
- * await setup({ apiURL: 'https://api.incode.com', wasm: false });
158
- * ```
159
- *
160
- * @example Use CDN defaults for paths and preload only one pipeline
161
- * ```ts
162
- * await setup({
163
- * apiURL: 'https://api.incode.com',
164
- * wasm: { pipelines: ['selfie'] },
165
- * });
166
- * ```
167
- *
168
- * @example Self-hosted / custom version (full or partial path overrides)
169
- * ```ts
170
- * await setup({
171
- * apiURL: 'https://api.incode.com',
172
- * wasm: {
173
- * wasmPath: '/my-cdn/webLib.wasm',
174
- * glueCodePath: '/my-cdn/webLib.js',
175
- * },
176
- * });
177
- * ```
178
- *
179
- * @example Partial override: only models path, rest from CDN
180
- * ```ts
181
- * await setup({
182
- * apiURL: 'https://api.incode.com',
183
- * wasm: { modelsBasePath: 'https://my-cdn/models' },
184
- * });
185
- * ```
186
- *
187
- * @example Sessionless setup (all API actors overridden via .provide())
188
- * ```ts
189
- * await setup({
190
- * wasm: {
191
- * wasmPath: '/wasm/ml-wasm.wasm',
192
- * glueCodePath: '/wasm/ml-wasm.js',
193
- * pipelines: ['selfie'],
194
- * },
195
- * });
196
- * ```
197
- *
198
- * @example Enable end-to-end encryption at boot (defaults to MGF1 = SHA-1)
199
- * ```ts
200
- * await setup({ apiURL: 'https://api.incode.com', encryption: true });
201
- * ```
202
- *
203
- * @example Enable encryption with the SHA-256 MGF1 padding
204
- * ```ts
205
- * await setup({
206
- * apiURL: 'https://api.incode.com',
207
- * encryption: { mgf1: 'sha256' },
208
- * });
209
- * ```
210
- */
211
- declare function setup(options: SetupOptions): Promise<void>;
212
- /**
213
- * Sets the WASM configuration without performing warmup.
214
- * Useful when WASM warmup is handled separately (e.g., conditionally based on flow).
215
- *
216
- * @param config - WASM configuration to store
217
- */
218
- declare function setWasmConfig(config: WasmConfig): void;
219
- /**
220
- * Initializes WasmUtilProvider with the stored WASM configuration.
221
- * Should be called after warmupWasm() completes when using conditional warmup.
222
- * This ensures image encryption works properly.
223
- *
224
- * @param config - Optional WASM configuration. If not provided, uses the stored config from setWasmConfig().
225
- * @throws Error if no config is provided and none is stored
226
- */
227
- declare function initializeWasmUtil(config?: WasmConfig): Promise<void>;
228
- /**
229
- * Replaces the active HTTP client with the WASM-backed one. Used internally
230
- * by lazy-loading UI components (`<incode-flow>`, `<incode-workflow>`) when
231
- * WASM finishes warming up.
232
- *
233
- * No-op when no apiURL was originally configured, or when the active client is
234
- * already the WASM one.
235
- *
236
- * @internal NOT a public API. Application code should use
237
- * `setup({ wasm: {...} })` instead — that path is the supported way to opt
238
- * into the WASM HTTP client.
239
- *
240
- * @param config - Optional WASM configuration. Defaults to the config stored via `setWasmConfig`.
241
- */
242
- declare function upgradeToWasmHttpClient(config?: WasmConfig): Promise<void>;
243
- /**
244
- * Checks if the SDK has been configured.
245
- *
246
- * @returns true if setup() has been called, false otherwise
247
- */
248
- declare function isConfigured(): boolean;
249
- /**
250
- * Resets the SDK configuration. Useful for testing.
251
- */
252
- declare function reset(): void;
253
- //#endregion
254
- export { reset as a, upgradeToWasmHttpClient as c, isConfigured as i, WasmConfig as n, setWasmConfig as o, initializeWasmUtil as r, setup as s, SetupOptions as t };
@@ -1,94 +0,0 @@
1
- import { t as Manager } from "./Manager-C8PrhBOx.js";
2
- import "./Actor-CI32dTbG.js";
3
-
4
- //#region src/modules/signature/types.d.ts
5
- /**
6
- * Configuration options for Signature.
7
- */
8
- type SignatureConfig = {
9
- type?: string;
10
- /**
11
- * Optional header title for both steps. When omitted, the UI uses per-step defaults
12
- * (“Draw your signature”).
13
- */
14
- title?: string;
15
- /**
16
- * Optional subtitle for both steps. When omitted, the UI uses the default finger/mouse copy.
17
- * Backend field name: `subTitle` (capital T).
18
- */
19
- subTitle?: string;
20
- /**
21
- * When true, uploads base64 via Omni `addSignature` v2 JSON body.
22
- * When false (default), uploads JPEG bytes (`image/jpeg`).
23
- */
24
- sendBase64?: boolean;
25
- /**
26
- * Optional fill behind the drawing area (e.g. hex, `rgb()`, or a CSS variable).
27
- * When omitted, the default themed surface from the signature UI is used.
28
- */
29
- canvasBackgroundColor?: string;
30
- /**
31
- * Optional maximum stroke width for the pen, in CSS pixels (passed to `SignaturePad` as `maxWidth`).
32
- * When omitted, the pad uses its default sizing.
33
- */
34
- penStrokeWidth?: number;
35
- /**
36
- * Optional ink color (e.g. hex, `rgb()`, or `var(--token)` resolved where supported).
37
- * When omitted, the default signature pen color from theme tokens is used.
38
- */
39
- penColor?: string;
40
- /**
41
- * Optional border color for the drawing area (same format as `penColor`).
42
- * When omitted, the default input border token from the signature UI is used.
43
- */
44
- canvasBorderColor?: string;
45
- };
46
- /** Response body from Omni add-signature endpoints. */
47
- type AddSignatureResponse = {
48
- image: string | Blob;
49
- type: string;
50
- };
51
- //#endregion
52
- //#region src/modules/signature/signatureStateMachine.d.ts
53
-
54
- declare const signatureMachine: any;
55
- //#endregion
56
- //#region src/modules/signature/signatureActor.d.ts
57
- type CreateSignatureActorOptions = {
58
- config: SignatureConfig;
59
- };
60
- //#endregion
61
- //#region src/modules/signature/signatureManager.d.ts
62
- type SignatureIdleState = {
63
- status: 'idle';
64
- };
65
- type SignatureCaptureState = {
66
- status: 'capture';
67
- title: string | undefined;
68
- subtitle: string | undefined;
69
- canContinue: boolean;
70
- };
71
- type SignatureSubmittingState = {
72
- status: 'submitting';
73
- };
74
- type SignatureFinishedState = {
75
- status: 'finished';
76
- result: AddSignatureResponse | undefined;
77
- };
78
- type SignatureErrorState = {
79
- status: 'error';
80
- error: string;
81
- };
82
- type SignatureSuccessState = {
83
- status: 'success';
84
- };
85
- type SignatureState = SignatureIdleState | SignatureCaptureState | SignatureSubmittingState | SignatureFinishedState | SignatureErrorState | SignatureSuccessState;
86
- declare function createSignatureManager(options: CreateSignatureActorOptions): Manager<SignatureState> & {
87
- load(): void;
88
- setSignatureValid(isValid: boolean): void;
89
- /** Exported image (base64 string or JPEG Blob) from the canvas; starts the upload actor. */
90
- submit(image: string | Blob): void;
91
- };
92
- type SignatureManager = ReturnType<typeof createSignatureManager>;
93
- //#endregion
94
- export { type SignatureCaptureState, type SignatureConfig, type SignatureManager, type SignatureState, createSignatureManager, signatureMachine };
@@ -1,66 +0,0 @@
1
- import "./api-CESGtpbH.esm.js";
2
- import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-D6-e4vok.esm.js";
3
- import "./endpoints-CnN3SyDa.esm.js";
4
- import { c as createManager, s as createActor } from "./xstate.esm-B70JrNqo.esm.js";
5
- import { t as signatureMachine } from "./signatureStateMachine-B5-QVUve.esm.js";
6
-
7
- //#region src/modules/signature/signatureActor.ts
8
- function createSignatureActor(options) {
9
- return createActor(signatureMachine, { input: { config: options.config } }).start();
10
- }
11
-
12
- //#endregion
13
- //#region src/modules/signature/signatureManager.ts
14
- function mapState(snapshot) {
15
- const typedSnapshot = snapshot;
16
- const { context } = typedSnapshot;
17
- if (typedSnapshot.matches("idle")) return { status: "idle" };
18
- if (typedSnapshot.matches("captureSignature")) return {
19
- status: "capture",
20
- title: context.config.title,
21
- subtitle: context.config.subTitle,
22
- canContinue: context.isValid
23
- };
24
- if (typedSnapshot.matches("submittingSignature")) return { status: "submitting" };
25
- if (typedSnapshot.matches("success")) return { status: "success" };
26
- if (typedSnapshot.matches("finished")) return {
27
- status: "finished",
28
- result: context.signatureSubmitResult
29
- };
30
- if (typedSnapshot.matches("error")) return {
31
- status: "error",
32
- error: context.error ?? "Upload failed"
33
- };
34
- return { status: "idle" };
35
- }
36
- function createApi({ actor, trackElementClicked }) {
37
- return {
38
- load() {
39
- actor.send({ type: "LOAD" });
40
- },
41
- setSignatureValid(isValid) {
42
- actor.send({
43
- type: "SIGNATURE_CHANGED",
44
- isValid
45
- });
46
- },
47
- submit(image) {
48
- trackElementClicked?.("continue");
49
- actor.send({
50
- type: "CONTINUE",
51
- image
52
- });
53
- }
54
- };
55
- }
56
- function createSignatureManager(options) {
57
- return createManager({
58
- actor: createSignatureActor(options),
59
- mapState,
60
- createApi,
61
- instrumentation: createManagerInstrumentation(eventModuleNames.signature)
62
- });
63
- }
64
-
65
- //#endregion
66
- export { createSignatureManager, signatureMachine };
@@ -1,132 +0,0 @@
1
- import { t as api } from "./api-CESGtpbH.esm.js";
2
- import { h as addEvent, n as eventModuleNames, r as eventScreenNames } from "./events-D6-e4vok.esm.js";
3
- import { t as endpoints } from "./endpoints-CnN3SyDa.esm.js";
4
- import { a as fromPromise, r as assign, t as setup } from "./xstate.esm-B70JrNqo.esm.js";
5
-
6
- //#region src/modules/signature/signatureServices.ts
7
- /**
8
- * Uploads a signature image to the Omni API.
9
- * Uses JSON + base64 when `sendBase64` is true, otherwise sends raw JPEG bytes.
10
- * Throws on failure.
11
- */
12
- async function addSignature(params, signal) {
13
- const { image, type, sendBase64 = false } = params;
14
- const url = sendBase64 ? endpoints.addSignatureV2 : endpoints.addSignature;
15
- const body = sendBase64 ? { base64Image: image } : image;
16
- const res = await api.post(url, body, {
17
- signal,
18
- headers: { "Content-Type": sendBase64 ? "application/json" : "image/jpeg" },
19
- query: { type }
20
- });
21
- if (!res.ok) throw new Error(`POST ${url} failed: ${res.status} ${res.statusText}`);
22
- return res.data;
23
- }
24
-
25
- //#endregion
26
- //#region src/modules/signature/signatureStateMachine.ts
27
- function emptyCaptureState() {
28
- return {
29
- image: void 0,
30
- isValid: false,
31
- error: void 0,
32
- signatureSubmitResult: void 0
33
- };
34
- }
35
- const signatureMachine = setup({
36
- types: {
37
- context: {},
38
- events: {},
39
- input: {}
40
- },
41
- actors: { submitSignature: fromPromise(async ({ input, signal }) => {
42
- const { ...params } = input;
43
- return addSignature(params, signal);
44
- }) },
45
- actions: {
46
- setSignatureValidity: assign(({ event }) => {
47
- return {
48
- isValid: event.isValid,
49
- error: void 0
50
- };
51
- }),
52
- assignImageForSubmit: assign(({ event }) => {
53
- return {
54
- image: event.image,
55
- error: void 0
56
- };
57
- }),
58
- setSignatureSubmitResult: assign(({ event }) => ({
59
- signatureSubmitResult: event.output,
60
- error: void 0
61
- })),
62
- setErrorFromInvoke: assign(({ event }) => {
63
- const error = event.error;
64
- return { error: error instanceof Error ? error.message : typeof error === "string" ? error : "Something went wrong" };
65
- }),
66
- clearError: assign({ error: () => void 0 }),
67
- resetContext: assign({
68
- isValid: () => false,
69
- image: () => void 0,
70
- error: () => void 0
71
- }),
72
- trackSubmitAttempt: () => {
73
- addEvent({
74
- code: "continue",
75
- module: eventModuleNames.signature,
76
- screen: eventScreenNames.signatureInput
77
- });
78
- },
79
- trackError: ({ context }) => {
80
- addEvent({
81
- code: "verificationError",
82
- module: eventModuleNames.signature,
83
- payload: context.error ? { error: context.error } : void 0
84
- });
85
- }
86
- },
87
- guards: { canContinue: ({ context, event }) => context.isValid && event.type === "CONTINUE" && !!event.image }
88
- }).createMachine({
89
- id: "signature",
90
- initial: "idle",
91
- context: ({ input }) => ({
92
- config: input.config,
93
- ...emptyCaptureState()
94
- }),
95
- states: {
96
- idle: { on: { LOAD: "captureSignature" } },
97
- captureSignature: { on: {
98
- SIGNATURE_CHANGED: { actions: "setSignatureValidity" },
99
- CONTINUE: {
100
- target: "submittingSignature",
101
- guard: "canContinue",
102
- actions: "assignImageForSubmit"
103
- }
104
- } },
105
- submittingSignature: {
106
- entry: "trackSubmitAttempt",
107
- invoke: {
108
- id: "submitSignature",
109
- src: "submitSignature",
110
- input: ({ context }) => ({
111
- image: context.image,
112
- type: context.config.type,
113
- sendBase64: context.config.sendBase64 ?? false
114
- }),
115
- onDone: {
116
- target: "success",
117
- actions: "setSignatureSubmitResult"
118
- },
119
- onError: {
120
- target: "error",
121
- actions: "setErrorFromInvoke"
122
- }
123
- }
124
- },
125
- success: { after: { 3e3: "finished" } },
126
- finished: { type: "final" },
127
- error: { entry: "trackError" }
128
- }
129
- });
130
-
131
- //#endregion
132
- export { signatureMachine as t };
@@ -1,16 +0,0 @@
1
- import { t as api } from "./api-CESGtpbH.esm.js";
2
-
3
- //#region src/modules/stats/statsServices.ts
4
- /**
5
- * Sends device stats to the backend.
6
- */
7
- async function addDeviceStats(stats) {
8
- try {
9
- await api.post("/omni/device/stats", stats);
10
- } catch {
11
- return;
12
- }
13
- }
14
-
15
- //#endregion
16
- export { addDeviceStats as t };
package/dist/stats.d.ts DELETED
@@ -1,16 +0,0 @@
1
- //#region src/modules/stats/statsServices.d.ts
2
- type LabelInspectionStatus = 'FAIL' | 'PASS';
3
- type DeviceStats = {
4
- cameraLabelInspectionStatus?: LabelInspectionStatus;
5
- virtualCameraDetected?: boolean;
6
- frontIdStatsAnalysisStatus?: string;
7
- backIdStatsAnalysisStatus?: string;
8
- selfieStatsAnalysisStatus?: string;
9
- motionStatus?: string;
10
- };
11
- /**
12
- * Sends device stats to the backend.
13
- */
14
- declare function addDeviceStats(stats: DeviceStats): Promise<void>;
15
- //#endregion
16
- export { type DeviceStats, type LabelInspectionStatus, addDeviceStats };
package/dist/stats.esm.js DELETED
@@ -1,4 +0,0 @@
1
- import "./api-CESGtpbH.esm.js";
2
- import { t as addDeviceStats } from "./stats-CIfiPzb1.esm.js";
3
-
4
- export { addDeviceStats };
@@ -1,54 +0,0 @@
1
- import { t as Manager } from "./Manager-C8PrhBOx.js";
2
-
3
- //#region src/modules/trust-graph/trustGraphManager.d.ts
4
- type TrustGraphIdleState = {
5
- status: 'idle';
6
- };
7
- type TrustGraphFinishedState = {
8
- status: 'finished';
9
- };
10
- /**
11
- * Union of all possible trust-graph manager states.
12
- *
13
- * @example
14
- * ```typescript
15
- * const state = trustGraphManager.getState();
16
- * if (state.status === 'finished') {
17
- * console.log('Trust graph check complete');
18
- * }
19
- * ```
20
- */
21
- type TrustGraphState = TrustGraphIdleState | TrustGraphFinishedState;
22
- /**
23
- * Creates a trust-graph manager for headless usage.
24
- *
25
- * @example Headless usage
26
- * ```typescript
27
- * const manager = createTrustGraphManager();
28
- * manager.subscribe((state) => console.log(state.status));
29
- * manager.load();
30
- * ```
31
- */
32
- declare function createTrustGraphManager(): Manager<TrustGraphState> & {
33
- /**
34
- * Kicks off the trust-graph module.
35
- * Transitions immediately from 'idle' to 'finished' (backend-only, no SDK action).
36
- */
37
- load(): void;
38
- };
39
- type TrustGraphManager = ReturnType<typeof createTrustGraphManager>;
40
- //#endregion
41
- //#region src/modules/trust-graph/trustGraphStateMachine.d.ts
42
- declare const trustGraphMachine: any;
43
- //#endregion
44
- //#region src/modules/trust-graph/types.d.ts
45
- /**
46
- * Configuration options for the trust-graph module.
47
- *
48
- * The trust-graph module requires no configuration — it is a backend-only
49
- * process that runs risk scoring analysis server-side. The SDK skips
50
- * immediately without any user interaction.
51
- */
52
- type TrustGraphConfig = Record<string, never>;
53
- //#endregion
54
- export { type TrustGraphConfig, type TrustGraphFinishedState, type TrustGraphManager, type TrustGraphState, createTrustGraphManager, trustGraphMachine };
@@ -1,56 +0,0 @@
1
- import "./api-CESGtpbH.esm.js";
2
- import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-D6-e4vok.esm.js";
3
- import { c as createManager, s as createActor, t as setup } from "./xstate.esm-B70JrNqo.esm.js";
4
-
5
- //#region src/modules/trust-graph/trustGraphStateMachine.ts
6
- const trustGraphMachine = setup({ types: {
7
- context: {},
8
- events: {}
9
- } }).createMachine({
10
- id: "trust-graph",
11
- initial: "idle",
12
- context: {},
13
- states: {
14
- idle: { on: { LOAD: { target: "finished" } } },
15
- finished: { type: "final" }
16
- }
17
- });
18
-
19
- //#endregion
20
- //#region src/modules/trust-graph/trustGraphActor.ts
21
- function createTrustGraphActor() {
22
- return createActor(trustGraphMachine).start();
23
- }
24
-
25
- //#endregion
26
- //#region src/modules/trust-graph/trustGraphManager.ts
27
- function mapState(snapshot) {
28
- if (snapshot.matches("finished")) return { status: "finished" };
29
- return { status: "idle" };
30
- }
31
- function createApi({ actor }) {
32
- return { load() {
33
- actor.send({ type: "LOAD" });
34
- } };
35
- }
36
- /**
37
- * Creates a trust-graph manager for headless usage.
38
- *
39
- * @example Headless usage
40
- * ```typescript
41
- * const manager = createTrustGraphManager();
42
- * manager.subscribe((state) => console.log(state.status));
43
- * manager.load();
44
- * ```
45
- */
46
- function createTrustGraphManager() {
47
- return createManager({
48
- actor: createTrustGraphActor(),
49
- mapState,
50
- createApi,
51
- instrumentation: createManagerInstrumentation(eventModuleNames.trustGraph)
52
- });
53
- }
54
-
55
- //#endregion
56
- export { createTrustGraphManager, trustGraphMachine };