@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,335 @@
1
+ import { t as Manager } from "./Manager-CXnC-tN_.js";
2
+ import { t as ActorRefFrom } from "./Actor-BAf9LRYf.js";
3
+
4
+ //#region src/modules/email/types.d.ts
5
+
6
+ /**
7
+ * Configuration options for email verification.
8
+ *
9
+ * @example Standard OTP verification
10
+ * ```typescript
11
+ * const config: EmailConfig = {
12
+ * otpVerification: true,
13
+ * otpExpirationInMinutes: 5,
14
+ * prefill: false,
15
+ * };
16
+ * ```
17
+ *
18
+ * @example With all options
19
+ * ```typescript
20
+ * const config: EmailConfig = {
21
+ * otpVerification: true,
22
+ * otpExpirationInMinutes: 10,
23
+ * prefill: true,
24
+ * maxOtpAttempts: 3,
25
+ * };
26
+ * ```
27
+ */
28
+ type EmailConfig = {
29
+ /**
30
+ * Whether to require OTP (email code) verification.
31
+ * If false, email is verified immediately after submission.
32
+ */
33
+ otpVerification: boolean;
34
+ /**
35
+ * How long the OTP code remains valid, in minutes.
36
+ * After expiration, user must request a new code.
37
+ */
38
+ otpExpirationInMinutes: number;
39
+ /**
40
+ * Whether to pre-populate with user's previously stored email address.
41
+ * Useful for returning users.
42
+ */
43
+ prefill: boolean;
44
+ /**
45
+ * Maximum number of OTP verification attempts before lockout.
46
+ * After exhausting attempts, user sees an error state.
47
+ * @default 3
48
+ */
49
+ maxOtpAttempts?: number;
50
+ };
51
+ //#endregion
52
+ //#region src/modules/email/emailStateMachine.d.ts
53
+
54
+ declare const emailMachine: any;
55
+ type EmailMachine = typeof emailMachine;
56
+ //#endregion
57
+ //#region src/modules/email/emailActor.d.ts
58
+ type CreateEmailActorOptions = {
59
+ config: EmailConfig;
60
+ };
61
+ type EmailActor = ActorRefFrom<EmailMachine>;
62
+ //#endregion
63
+ //#region src/modules/email/emailManager.d.ts
64
+ /** Email manager is in initial state, waiting for `load()` to be called */
65
+ type EmailIdleState = {
66
+ status: 'idle';
67
+ };
68
+ /** Loading prefilled email address from backend (if prefill is enabled) */
69
+ type EmailLoadingPrefillState = {
70
+ status: 'loadingPrefill';
71
+ };
72
+ /**
73
+ * Ready for email input - use `setEmail()` and `submit()`
74
+ * @property prefilledEmail - Pre-populated email address (if prefill enabled)
75
+ * @property emailError - Validation error message if email was rejected
76
+ */
77
+ type EmailInputtingState = {
78
+ status: 'inputting';
79
+ prefilledEmail?: string;
80
+ emailError?: string;
81
+ };
82
+ /** Email address is being submitted to the backend */
83
+ type EmailSubmittingState = {
84
+ status: 'submitting';
85
+ };
86
+ /** OTP is being sent to the email address */
87
+ type EmailSendingOtpState = {
88
+ status: 'sendingOtp';
89
+ };
90
+ /**
91
+ * Waiting for OTP code - use `submitOtp()`, `resendOtp()`, or `back()`
92
+ * @property resendTimer - Seconds remaining before resend is allowed
93
+ * @property canResend - Whether the resend button should be enabled
94
+ * @property attemptsRemaining - Number of OTP verification attempts left
95
+ */
96
+ type EmailAwaitingOtpState = {
97
+ status: 'awaitingOtp';
98
+ resendTimer: number;
99
+ canResend: boolean;
100
+ attemptsRemaining: number;
101
+ };
102
+ /** OTP code is being verified against the backend */
103
+ type EmailVerifyingOtpState = {
104
+ status: 'verifyingOtp';
105
+ };
106
+ /**
107
+ * OTP verification failed - user can retry with `submitOtp()`
108
+ * @property error - Error message describing why verification failed
109
+ * @property attemptsRemaining - Number of remaining attempts before lockout
110
+ */
111
+ type EmailOtpErrorState = {
112
+ status: 'otpError';
113
+ error: string;
114
+ attemptsRemaining: number;
115
+ };
116
+ /** Email verification completed successfully */
117
+ type EmailFinishedState = {
118
+ status: 'finished';
119
+ };
120
+ /**
121
+ * Fatal error occurred - call `reset()` to start over
122
+ * @property error - Error message describing what went wrong
123
+ */
124
+ type EmailErrorState = {
125
+ status: 'error';
126
+ error: string;
127
+ };
128
+ /**
129
+ * Union of all possible email manager states.
130
+ * Use discriminated union pattern to narrow the type:
131
+ *
132
+ * @example
133
+ * ```typescript
134
+ * const state = emailManager.getState();
135
+ * if (state.status === 'inputting') {
136
+ * // TypeScript knows state has prefilledEmail, emailError, etc.
137
+ * console.log(state.prefilledEmail);
138
+ * }
139
+ * ```
140
+ */
141
+ type EmailState = EmailIdleState | EmailLoadingPrefillState | EmailInputtingState | EmailSubmittingState | EmailSendingOtpState | EmailAwaitingOtpState | EmailVerifyingOtpState | EmailOtpErrorState | EmailFinishedState | EmailErrorState;
142
+ /**
143
+ * Creates an email verification manager for headless or UI-driven usage.
144
+ *
145
+ * The manager provides a state machine-based API for email address verification
146
+ * with optional OTP (one-time password) verification.
147
+ *
148
+ * @param options - Configuration options
149
+ * @param options.config - Email verification configuration
150
+ * @param options.config.otpVerification - Whether to require OTP verification
151
+ * @param options.config.otpExpirationInMinutes - How long the OTP is valid
152
+ * @param options.config.prefill - Whether to fetch a pre-filled email address
153
+ * @param options.config.maxOtpAttempts - Maximum OTP verification attempts (default: 3)
154
+ *
155
+ * @returns Email manager with state, API methods, and subscription
156
+ *
157
+ * @example Headless usage
158
+ * ```typescript
159
+ * const manager = createEmailManager({
160
+ * config: { otpVerification: true, otpExpirationInMinutes: 5, prefill: false },
161
+ * });
162
+ *
163
+ * manager.subscribe((state) => console.log(state.status));
164
+ * manager.load();
165
+ * manager.setEmail('user@example.com', true);
166
+ * manager.submit();
167
+ * // ... wait for 'awaitingOtp' state ...
168
+ * manager.submitOtp('ABC123');
169
+ * manager.stop();
170
+ * ```
171
+ *
172
+ * @example With React/Preact UI hook
173
+ * ```tsx
174
+ * const [state, manager] = useManager(() => createEmailManager({ config }));
175
+ *
176
+ * if (state.status === 'inputting') {
177
+ * return <input onChange={(e) => manager.setEmail(e.target.value, true)} />;
178
+ * }
179
+ * ```
180
+ */
181
+ declare function createEmailManager(options: CreateEmailActorOptions): Manager<EmailState> & {
182
+ /**
183
+ * Initializes the email verification flow.
184
+ * Transitions from 'idle' to 'loadingPrefill' or 'inputting'.
185
+ * Must be called before any other method.
186
+ */
187
+ load(): void;
188
+ /**
189
+ * Sets the email address for verification.
190
+ * Should be called when state is 'inputting'.
191
+ *
192
+ * @param email - Email address (e.g., 'user@example.com')
193
+ * @param isValid - Whether the email address passes validation
194
+ *
195
+ * @example
196
+ * ```typescript
197
+ * // Using regex for validation
198
+ * const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
199
+ * const email = 'user@example.com';
200
+ * emailManager.setEmail(email, emailRegex.test(email));
201
+ * ```
202
+ */
203
+ setEmail(email: string, isValid: boolean): void;
204
+ /**
205
+ * Submits the email address for verification.
206
+ * Requires a valid email address to be set via `setEmail()`.
207
+ * Transitions to 'submitting', then to 'sendingOtp' or 'success' (if no OTP).
208
+ */
209
+ submit(): void;
210
+ /**
211
+ * Sets the OTP code without submitting.
212
+ * Use this for controlled input components.
213
+ *
214
+ * @param code - The OTP code entered by the user
215
+ */
216
+ setOtpCode(code: string): void;
217
+ /**
218
+ * Sets and submits the OTP code in one call.
219
+ * Should be called when state is 'awaitingOtp' or 'otpError'.
220
+ *
221
+ * @param code - The complete OTP code (typically 6 alphanumeric characters)
222
+ *
223
+ * @example
224
+ * ```typescript
225
+ * // Submit OTP when user completes entry
226
+ * emailManager.submitOtp('HH36LP');
227
+ * ```
228
+ */
229
+ submitOtp(code: string): void;
230
+ /**
231
+ * Requests a new OTP code to be sent.
232
+ * Only works when state is 'awaitingOtp' and `canResend` is true.
233
+ * Resets the resend timer.
234
+ */
235
+ resendOtp(): void;
236
+ /**
237
+ * Returns to the email input screen from OTP entry.
238
+ * Allows the user to change their email address.
239
+ * Transitions from 'awaitingOtp' or 'otpError' back to 'inputting'.
240
+ */
241
+ back(): void;
242
+ /**
243
+ * Resets the manager to initial state.
244
+ * Can be called from 'success' or 'error' states to start over.
245
+ * Clears all stored data including email address and OTP.
246
+ */
247
+ reset(): void;
248
+ };
249
+ declare function createEmailManagerFromActor(actor: EmailActor): Manager<EmailState> & {
250
+ /**
251
+ * Initializes the email verification flow.
252
+ * Transitions from 'idle' to 'loadingPrefill' or 'inputting'.
253
+ * Must be called before any other method.
254
+ */
255
+ load(): void;
256
+ /**
257
+ * Sets the email address for verification.
258
+ * Should be called when state is 'inputting'.
259
+ *
260
+ * @param email - Email address (e.g., 'user@example.com')
261
+ * @param isValid - Whether the email address passes validation
262
+ *
263
+ * @example
264
+ * ```typescript
265
+ * // Using regex for validation
266
+ * const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
267
+ * const email = 'user@example.com';
268
+ * emailManager.setEmail(email, emailRegex.test(email));
269
+ * ```
270
+ */
271
+ setEmail(email: string, isValid: boolean): void;
272
+ /**
273
+ * Submits the email address for verification.
274
+ * Requires a valid email address to be set via `setEmail()`.
275
+ * Transitions to 'submitting', then to 'sendingOtp' or 'success' (if no OTP).
276
+ */
277
+ submit(): void;
278
+ /**
279
+ * Sets the OTP code without submitting.
280
+ * Use this for controlled input components.
281
+ *
282
+ * @param code - The OTP code entered by the user
283
+ */
284
+ setOtpCode(code: string): void;
285
+ /**
286
+ * Sets and submits the OTP code in one call.
287
+ * Should be called when state is 'awaitingOtp' or 'otpError'.
288
+ *
289
+ * @param code - The complete OTP code (typically 6 alphanumeric characters)
290
+ *
291
+ * @example
292
+ * ```typescript
293
+ * // Submit OTP when user completes entry
294
+ * emailManager.submitOtp('HH36LP');
295
+ * ```
296
+ */
297
+ submitOtp(code: string): void;
298
+ /**
299
+ * Requests a new OTP code to be sent.
300
+ * Only works when state is 'awaitingOtp' and `canResend` is true.
301
+ * Resets the resend timer.
302
+ */
303
+ resendOtp(): void;
304
+ /**
305
+ * Returns to the email input screen from OTP entry.
306
+ * Allows the user to change their email address.
307
+ * Transitions from 'awaitingOtp' or 'otpError' back to 'inputting'.
308
+ */
309
+ back(): void;
310
+ /**
311
+ * Resets the manager to initial state.
312
+ * Can be called from 'success' or 'error' states to start over.
313
+ * Clears all stored data including email address and OTP.
314
+ */
315
+ reset(): void;
316
+ };
317
+ /**
318
+ * Type representing an email manager instance.
319
+ * Includes state access, API methods, and lifecycle management.
320
+ *
321
+ * @property getState - Returns the current EmailState
322
+ * @property subscribe - Subscribes to state changes, returns unsubscribe function
323
+ * @property stop - Stops the manager and cleans up resources
324
+ * @property load - Initializes the verification flow
325
+ * @property setEmail - Sets the email address
326
+ * @property submit - Submits the email address
327
+ * @property setOtpCode - Sets OTP code without submitting
328
+ * @property submitOtp - Sets and submits OTP code
329
+ * @property resendOtp - Requests new OTP code
330
+ * @property back - Returns to email input from OTP screen
331
+ * @property reset - Resets to initial state
332
+ */
333
+ type EmailManager = ReturnType<typeof createEmailManager>;
334
+ //#endregion
335
+ export { emailMachine as a, createEmailManagerFromActor as i, EmailState as n, EmailConfig as o, createEmailManager as r, EmailManager as t };