@incodetech/core 0.0.0-dev-20260313-486e658 → 0.0.0-dev-20260313-bc2dab4

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 (80) hide show
  1. package/dist/Actor-BAf9LRYf.d.ts +2 -0
  2. package/dist/StateMachine-DJpZF_HP.d.ts +2 -0
  3. package/dist/authentication.d.ts +10 -78
  4. package/dist/authentication.esm.js +11 -195
  5. package/dist/authenticationManager-4j4j8ac9.esm.js +197 -0
  6. package/dist/authenticationManager-DQL9XsaI.d.ts +66 -0
  7. package/dist/{backCameraStream-B57NWDGu.esm.js → backCameraStream-4aLwsDOv.esm.js} +1 -1
  8. package/dist/curp-validation.d.ts +4 -4
  9. package/dist/curp-validation.esm.js +5 -5
  10. package/dist/{deepsightLoader-BXTRzhYx.esm.js → deepsightLoader-C-Xil8cg.esm.js} +4 -4
  11. package/dist/{deepsightService-CTK55DG8.esm.js → deepsightService-BgqD33AH.esm.js} +3 -3
  12. package/dist/{deepsightService-CYCDsan2.d.ts → deepsightService-UhtHJCFb.d.ts} +131 -3
  13. package/dist/document-capture.d.ts +49 -49
  14. package/dist/document-capture.esm.js +6 -6
  15. package/dist/document-upload.d.ts +49 -49
  16. package/dist/document-upload.esm.js +5 -5
  17. package/dist/ekyb.d.ts +2 -2
  18. package/dist/ekyb.esm.js +6 -6
  19. package/dist/ekyc.d.ts +2 -2
  20. package/dist/ekyc.esm.js +6 -6
  21. package/dist/email.d.ts +3 -263
  22. package/dist/email.esm.js +6 -477
  23. package/dist/emailManager-DZeOYBQ6.d.ts +335 -0
  24. package/dist/emailManager-e7j__XBB.esm.js +486 -0
  25. package/dist/{events-b4_xvENs.esm.js → events-3HzCcoEy.esm.js} +2 -2
  26. package/dist/extensibility.d.ts +95 -0
  27. package/dist/extensibility.esm.js +17 -0
  28. package/dist/face-match.d.ts +1 -1
  29. package/dist/face-match.esm.js +5 -5
  30. package/dist/faceCaptureManagerFactory-CiQWYHp2.d.ts +610 -0
  31. package/dist/{faceCaptureSetup-10lCb_yE.esm.js → faceCaptureSetup-CF9TJlsc.esm.js} +11 -11
  32. package/dist/flow.d.ts +7 -7
  33. package/dist/flow.esm.js +5 -5
  34. package/dist/{flowCompletionService-DHXqHOAk.esm.js → flowCompletionService-CV8Ywiut.esm.js} +2 -2
  35. package/dist/geolocation.d.ts +1 -1
  36. package/dist/geolocation.esm.js +5 -5
  37. package/dist/government-validation.d.ts +1 -1
  38. package/dist/government-validation.esm.js +4 -4
  39. package/dist/id-A_upgNRR.esm.js +0 -0
  40. package/dist/id.d.ts +9 -9
  41. package/dist/id.esm.js +11 -10
  42. package/dist/{id-TUJyOPso.esm.js → idCaptureManager-B9BsU7-M.esm.js} +18 -11
  43. package/dist/{index-5ZEjz-8I.d.ts → idCaptureManager-D8FwP0TW.d.ts} +30 -8
  44. package/dist/index-BtQzTfU9.d.ts +1 -0
  45. package/dist/index.d.ts +21 -12
  46. package/dist/index.esm.js +33 -21
  47. package/dist/{lib-V3Lo-Jit.esm.js → lib-COh1FH9n.esm.js} +1 -1
  48. package/dist/phone.d.ts +3 -291
  49. package/dist/phone.esm.js +6 -551
  50. package/dist/phoneManager-B6fNmxhw.esm.js +560 -0
  51. package/dist/phoneManager-BsamACjL.d.ts +370 -0
  52. package/dist/redirect-to-mobile.d.ts +1 -1
  53. package/dist/redirect-to-mobile.esm.js +4 -4
  54. package/dist/selfie.d.ts +10 -408
  55. package/dist/selfie.esm.js +11 -118
  56. package/dist/selfieManager-ByV0akn-.esm.js +117 -0
  57. package/dist/selfieManager-Czysy-lv.d.ts +68 -0
  58. package/dist/session.d.ts +1 -1
  59. package/dist/session.esm.js +3 -3
  60. package/dist/{src-D3v6I2la.esm.js → src-BmVrWkLJ.esm.js} +2 -2
  61. package/dist/{stats-D76Thmqp.esm.js → stats-kLtQIgsA.esm.js} +1 -1
  62. package/dist/stats.esm.js +2 -2
  63. package/dist/{streamingEvents-CQq5fJCL.esm.js → streamingEvents-Cw6kqXEh.esm.js} +3 -3
  64. package/dist/{types-DnrAr9fb.d.ts → types-BugcSDaO.d.ts} +1 -1
  65. package/dist/{types-Bn54lmeM.d.ts → types-C9Jo2XOb.d.ts} +1 -1
  66. package/package.json +5 -1
  67. package/dist/Actor-B6Lr-x6S.d.ts +0 -2
  68. package/dist/StateMachine-WHeQE3lC.d.ts +0 -2
  69. package/dist/faceCaptureManagerFactory-D1NUo68Z.d.ts +0 -231
  70. package/dist/types-B4KNFqC4.d.ts +0 -130
  71. /package/dist/{Manager-CG5CQ1kY.d.ts → Manager-CXnC-tN_.d.ts} +0 -0
  72. /package/dist/{api-3fZO5bmj.esm.js → api-C2uzxrpN.esm.js} +0 -0
  73. /package/dist/{camera-D7zu0Mls.d.ts → camera-DDn9ILon.d.ts} +0 -0
  74. /package/dist/{chunk-B1Ox1Owh.esm.js → chunk-C4_ANvih.esm.js} +0 -0
  75. /package/dist/{endpoints-5sPFFmaB.esm.js → endpoints-IAlXA1zN.esm.js} +0 -0
  76. /package/dist/{flowCompletionService-DeWKduBI.d.ts → flowCompletionService-D4YDcHQR.d.ts} +0 -0
  77. /package/dist/{types-BYYaKde4.d.ts → types-DTieLton.d.ts} +0 -0
  78. /package/dist/{usStates-D4SmlpeT.esm.js → usStates-vWM_ZgEH.esm.js} +0 -0
  79. /package/dist/{warmup-Da5qDIWZ.d.ts → warmup-Bp_1oXoL.d.ts} +0 -0
  80. /package/dist/{xstate.esm-07M59Cte.esm.js → xstate.esm-CcoTezCZ.esm.js} +0 -0
@@ -0,0 +1,370 @@
1
+ import { t as Manager } from "./Manager-CXnC-tN_.js";
2
+ import { t as ActorRefFrom } from "./Actor-BAf9LRYf.js";
3
+
4
+ //#region src/modules/phone/types.d.ts
5
+
6
+ /**
7
+ * Configuration options for phone verification.
8
+ *
9
+ * @example Standard OTP verification
10
+ * ```typescript
11
+ * const config: PhoneConfig = {
12
+ * otpVerification: true,
13
+ * otpExpirationInMinutes: 5,
14
+ * prefill: false,
15
+ * };
16
+ * ```
17
+ *
18
+ * @example With all options
19
+ * ```typescript
20
+ * const config: PhoneConfig = {
21
+ * otpVerification: true,
22
+ * otpExpirationInMinutes: 10,
23
+ * prefill: true,
24
+ * isInstantVerify: false,
25
+ * optinEnabled: true,
26
+ * maxOtpAttempts: 3,
27
+ * };
28
+ * ```
29
+ */
30
+ type PhoneConfig = {
31
+ /**
32
+ * Whether to require OTP (SMS code) verification.
33
+ * If false, phone is verified immediately after submission.
34
+ */
35
+ otpVerification: boolean;
36
+ /**
37
+ * How long the OTP code remains valid, in minutes.
38
+ * After expiration, user must request a new code.
39
+ */
40
+ otpExpirationInMinutes: number;
41
+ /**
42
+ * Whether to pre-populate with user's previously stored phone number.
43
+ * Useful for returning users.
44
+ */
45
+ prefill: boolean;
46
+ /**
47
+ * Use carrier-based instant verification instead of OTP.
48
+ * Not available in all regions.
49
+ * @default false
50
+ */
51
+ isInstantVerify?: boolean;
52
+ /**
53
+ * Show a marketing opt-in checkbox in the UI.
54
+ * User's preference is sent with the phone submission.
55
+ * @default false
56
+ */
57
+ optinEnabled?: boolean;
58
+ /**
59
+ * Maximum number of OTP verification attempts before lockout.
60
+ * After exhausting attempts, user sees an error state.
61
+ * @default 3
62
+ */
63
+ maxOtpAttempts?: number;
64
+ };
65
+ //#endregion
66
+ //#region src/modules/phone/phoneStateMachine.d.ts
67
+
68
+ declare const phoneMachine: any;
69
+ type PhoneMachine = typeof phoneMachine;
70
+ //#endregion
71
+ //#region src/modules/phone/phoneActor.d.ts
72
+ type CreatePhoneActorOptions = {
73
+ config: PhoneConfig;
74
+ };
75
+ type PhoneActor = ActorRefFrom<PhoneMachine>;
76
+ //#endregion
77
+ //#region src/modules/phone/phoneManager.d.ts
78
+ /** Phone manager is in initial state, waiting for `load()` to be called */
79
+ type PhoneIdleState = {
80
+ status: 'idle';
81
+ };
82
+ /** Loading prefilled phone number from backend (if prefill is enabled) */
83
+ type PhoneLoadingPrefillState = {
84
+ status: 'loadingPrefill';
85
+ };
86
+ /**
87
+ * Ready for phone input - use `setPhoneNumber()` and `submit()`
88
+ * @property countryCode - ISO country code (e.g., 'US', 'MX')
89
+ * @property phonePrefix - International dialing prefix (e.g., '+1', '+52')
90
+ * @property prefilledPhone - Pre-populated phone number (if prefill enabled)
91
+ * @property phoneError - Validation error message if phone was rejected
92
+ */
93
+ type PhoneInputtingState = {
94
+ status: 'inputting';
95
+ countryCode: string;
96
+ phonePrefix: string;
97
+ prefilledPhone?: string;
98
+ phoneError?: string;
99
+ };
100
+ /** Phone number is being submitted to the backend */
101
+ type PhoneSubmittingState = {
102
+ status: 'submitting';
103
+ };
104
+ /** OTP is being sent to the phone number */
105
+ type PhoneSendingOtpState = {
106
+ status: 'sendingOtp';
107
+ };
108
+ /**
109
+ * Waiting for OTP code - use `submitOtp()`, `resendOtp()`, or `back()`
110
+ * @property resendTimer - Seconds remaining before resend is allowed
111
+ * @property canResend - Whether the resend button should be enabled
112
+ * @property attemptsRemaining - Number of OTP verification attempts left
113
+ */
114
+ type PhoneAwaitingOtpState = {
115
+ status: 'awaitingOtp';
116
+ resendTimer: number;
117
+ canResend: boolean;
118
+ attemptsRemaining: number;
119
+ };
120
+ /** OTP code is being verified against the backend */
121
+ type PhoneVerifyingOtpState = {
122
+ status: 'verifyingOtp';
123
+ };
124
+ /**
125
+ * OTP verification failed - user can retry with `submitOtp()`
126
+ * @property error - Error message describing why verification failed
127
+ * @property attemptsRemaining - Number of remaining attempts before lockout
128
+ */
129
+ type PhoneOtpErrorState = {
130
+ status: 'otpError';
131
+ error: string;
132
+ attemptsRemaining: number;
133
+ };
134
+ /** Phone verification completed successfully */
135
+ type PhoneFinishedState = {
136
+ status: 'finished';
137
+ };
138
+ /**
139
+ * Fatal error occurred - call `reset()` to start over
140
+ * @property error - Error message describing what went wrong
141
+ */
142
+ type PhoneErrorState = {
143
+ status: 'error';
144
+ error: string;
145
+ };
146
+ /**
147
+ * Union of all possible phone manager states.
148
+ * Use discriminated union pattern to narrow the type:
149
+ *
150
+ * @example
151
+ * ```typescript
152
+ * const state = phoneManager.getState();
153
+ * if (state.status === 'inputting') {
154
+ * // TypeScript knows state has countryCode, phonePrefix, etc.
155
+ * console.log(state.countryCode);
156
+ * }
157
+ * ```
158
+ */
159
+ type PhoneState = PhoneIdleState | PhoneLoadingPrefillState | PhoneInputtingState | PhoneSubmittingState | PhoneSendingOtpState | PhoneAwaitingOtpState | PhoneVerifyingOtpState | PhoneOtpErrorState | PhoneFinishedState | PhoneErrorState;
160
+ /**
161
+ * Creates a phone verification manager for headless or UI-driven usage.
162
+ *
163
+ * The manager provides a state machine-based API for phone number verification
164
+ * with optional OTP (one-time password) verification.
165
+ *
166
+ * @param options - Configuration options
167
+ * @param options.config - Phone verification configuration
168
+ * @param options.config.otpVerification - Whether to require OTP verification
169
+ * @param options.config.otpExpirationInMinutes - How long the OTP is valid
170
+ * @param options.config.prefill - Whether to fetch a pre-filled phone number
171
+ * @param options.config.isInstantVerify - Use instant verification API
172
+ * @param options.config.optinEnabled - Show marketing opt-in checkbox
173
+ * @param options.config.maxOtpAttempts - Maximum OTP verification attempts (default: 3)
174
+ *
175
+ * @returns Phone manager with state, API methods, and subscription
176
+ *
177
+ * @example Headless usage
178
+ * ```typescript
179
+ * const manager = createPhoneManager({
180
+ * config: { otpVerification: true, otpExpirationInMinutes: 5, prefill: false },
181
+ * });
182
+ *
183
+ * manager.subscribe((state) => console.log(state.status));
184
+ * manager.load();
185
+ * manager.setPhoneNumber('+14155551234', true);
186
+ * manager.submit();
187
+ * // ... wait for 'awaitingOtp' state ...
188
+ * manager.submitOtp('ABC123');
189
+ * manager.stop();
190
+ * ```
191
+ *
192
+ * @example With React/Preact UI hook
193
+ * ```tsx
194
+ * const [state, manager] = useManager(() => createPhoneManager({ config }));
195
+ *
196
+ * if (state.status === 'inputting') {
197
+ * return <input onChange={(e) => manager.setPhoneNumber(e.target.value, true)} />;
198
+ * }
199
+ * ```
200
+ */
201
+ declare function createPhoneManager(options: CreatePhoneActorOptions): Manager<PhoneState> & {
202
+ /**
203
+ * Initializes the phone verification flow.
204
+ * Transitions from 'idle' to 'loadingPrefill' or 'inputting'.
205
+ * Must be called before any other method.
206
+ */
207
+ load(): void;
208
+ /**
209
+ * Sets the phone number for verification.
210
+ * Should be called when state is 'inputting'.
211
+ *
212
+ * @param phone - Full phone number with country code (e.g., '+14155551234')
213
+ * @param isValid - Whether the phone number passes validation
214
+ *
215
+ * @example
216
+ * ```typescript
217
+ * // Using libphonenumber-js for validation
218
+ * import { isValidPhoneNumber } from 'libphonenumber-js';
219
+ * const phone = '+14155551234';
220
+ * phoneManager.setPhoneNumber(phone, isValidPhoneNumber(phone));
221
+ * ```
222
+ */
223
+ setPhoneNumber(phone: string, isValid: boolean): void;
224
+ /**
225
+ * Sets the marketing opt-in preference.
226
+ * Only relevant if `config.optinEnabled` is true.
227
+ *
228
+ * @param granted - Whether the user consented to receive marketing messages
229
+ */
230
+ setOptInGranted(granted: boolean): void;
231
+ /**
232
+ * Submits the phone number for verification.
233
+ * Requires a valid phone number to be set via `setPhoneNumber()`.
234
+ * Transitions to 'submitting', then to 'sendingOtp' or 'success' (if no OTP).
235
+ */
236
+ submit(): void;
237
+ /**
238
+ * Sets the OTP code without submitting.
239
+ * Use this for controlled input components.
240
+ *
241
+ * @param code - The OTP code entered by the user
242
+ */
243
+ setOtpCode(code: string): void;
244
+ /**
245
+ * Sets and submits the OTP code in one call.
246
+ * Should be called when state is 'awaitingOtp' or 'otpError'.
247
+ *
248
+ * @param code - The complete OTP code (typically 6 alphanumeric characters)
249
+ *
250
+ * @example
251
+ * ```typescript
252
+ * // Submit OTP when user completes entry
253
+ * phoneManager.submitOtp('HH36LP');
254
+ * ```
255
+ */
256
+ submitOtp(code: string): void;
257
+ /**
258
+ * Requests a new OTP code to be sent.
259
+ * Only works when state is 'awaitingOtp' and `canResend` is true.
260
+ * Resets the resend timer.
261
+ */
262
+ resendOtp(): void;
263
+ /**
264
+ * Returns to the phone input screen from OTP entry.
265
+ * Allows the user to change their phone number.
266
+ * Transitions from 'awaitingOtp' or 'otpError' back to 'inputting'.
267
+ */
268
+ back(): void;
269
+ /**
270
+ * Resets the manager to initial state.
271
+ * Can be called from 'success' or 'error' states to start over.
272
+ * Clears all stored data including phone number and OTP.
273
+ */
274
+ reset(): void;
275
+ };
276
+ declare function createPhoneManagerFromActor(actor: PhoneActor): Manager<PhoneState> & {
277
+ /**
278
+ * Initializes the phone verification flow.
279
+ * Transitions from 'idle' to 'loadingPrefill' or 'inputting'.
280
+ * Must be called before any other method.
281
+ */
282
+ load(): void;
283
+ /**
284
+ * Sets the phone number for verification.
285
+ * Should be called when state is 'inputting'.
286
+ *
287
+ * @param phone - Full phone number with country code (e.g., '+14155551234')
288
+ * @param isValid - Whether the phone number passes validation
289
+ *
290
+ * @example
291
+ * ```typescript
292
+ * // Using libphonenumber-js for validation
293
+ * import { isValidPhoneNumber } from 'libphonenumber-js';
294
+ * const phone = '+14155551234';
295
+ * phoneManager.setPhoneNumber(phone, isValidPhoneNumber(phone));
296
+ * ```
297
+ */
298
+ setPhoneNumber(phone: string, isValid: boolean): void;
299
+ /**
300
+ * Sets the marketing opt-in preference.
301
+ * Only relevant if `config.optinEnabled` is true.
302
+ *
303
+ * @param granted - Whether the user consented to receive marketing messages
304
+ */
305
+ setOptInGranted(granted: boolean): void;
306
+ /**
307
+ * Submits the phone number for verification.
308
+ * Requires a valid phone number to be set via `setPhoneNumber()`.
309
+ * Transitions to 'submitting', then to 'sendingOtp' or 'success' (if no OTP).
310
+ */
311
+ submit(): void;
312
+ /**
313
+ * Sets the OTP code without submitting.
314
+ * Use this for controlled input components.
315
+ *
316
+ * @param code - The OTP code entered by the user
317
+ */
318
+ setOtpCode(code: string): void;
319
+ /**
320
+ * Sets and submits the OTP code in one call.
321
+ * Should be called when state is 'awaitingOtp' or 'otpError'.
322
+ *
323
+ * @param code - The complete OTP code (typically 6 alphanumeric characters)
324
+ *
325
+ * @example
326
+ * ```typescript
327
+ * // Submit OTP when user completes entry
328
+ * phoneManager.submitOtp('HH36LP');
329
+ * ```
330
+ */
331
+ submitOtp(code: string): void;
332
+ /**
333
+ * Requests a new OTP code to be sent.
334
+ * Only works when state is 'awaitingOtp' and `canResend` is true.
335
+ * Resets the resend timer.
336
+ */
337
+ resendOtp(): void;
338
+ /**
339
+ * Returns to the phone input screen from OTP entry.
340
+ * Allows the user to change their phone number.
341
+ * Transitions from 'awaitingOtp' or 'otpError' back to 'inputting'.
342
+ */
343
+ back(): void;
344
+ /**
345
+ * Resets the manager to initial state.
346
+ * Can be called from 'success' or 'error' states to start over.
347
+ * Clears all stored data including phone number and OTP.
348
+ */
349
+ reset(): void;
350
+ };
351
+ /**
352
+ * Type representing a phone manager instance.
353
+ * Includes state access, API methods, and lifecycle management.
354
+ *
355
+ * @property getState - Returns the current PhoneState
356
+ * @property subscribe - Subscribes to state changes, returns unsubscribe function
357
+ * @property stop - Stops the manager and cleans up resources
358
+ * @property load - Initializes the verification flow
359
+ * @property setPhoneNumber - Sets the phone number
360
+ * @property setOptInGranted - Sets marketing opt-in preference
361
+ * @property submit - Submits the phone number
362
+ * @property setOtpCode - Sets OTP code without submitting
363
+ * @property submitOtp - Sets and submits OTP code
364
+ * @property resendOtp - Requests new OTP code
365
+ * @property back - Returns to phone input from OTP screen
366
+ * @property reset - Resets to initial state
367
+ */
368
+ type PhoneManager = ReturnType<typeof createPhoneManager>;
369
+ //#endregion
370
+ export { phoneMachine as a, createPhoneManagerFromActor as i, PhoneState as n, PhoneConfig as o, createPhoneManager as r, PhoneManager as t };
@@ -1,4 +1,4 @@
1
- import { t as Manager } from "./Manager-CG5CQ1kY.js";
1
+ import { t as Manager } from "./Manager-CXnC-tN_.js";
2
2
 
3
3
  //#region src/modules/redirect-to-mobile/types.d.ts
4
4
  type RedirectToMobileConfig = {
@@ -1,7 +1,7 @@
1
- import { A as createManager, g as BrowserTimerProvider } from "./src-D3v6I2la.esm.js";
2
- import { a as createActor, i as fromPromise, n as assign, r as fromCallback, t as setup } from "./xstate.esm-07M59Cte.esm.js";
3
- import { t as api } from "./api-3fZO5bmj.esm.js";
4
- import { t as endpoints } from "./endpoints-5sPFFmaB.esm.js";
1
+ import { A as createManager, g as BrowserTimerProvider } from "./src-BmVrWkLJ.esm.js";
2
+ import { a as createActor, i as fromPromise, n as assign, r as fromCallback, t as setup } from "./xstate.esm-CcoTezCZ.esm.js";
3
+ import { t as api } from "./api-C2uzxrpN.esm.js";
4
+ import { t as endpoints } from "./endpoints-IAlXA1zN.esm.js";
5
5
 
6
6
  //#region ../infra/src/url/urlUtils.ts
7
7
  function getUrlSearchParam(url, param) {