@incodetech/core 0.0.0-dev-20260325-72e1e24 → 0.0.0-dev-20260326-106dc21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/consent.d.ts +50 -50
- package/dist/document-capture.d.ts +52 -52
- package/dist/document-upload.d.ts +46 -46
- package/dist/email.d.ts +1 -1
- package/dist/email.esm.js +1 -1
- package/dist/{emailManager-Bl3NqSZ-.esm.js → emailManager-C8EeT_ZS.esm.js} +27 -17
- package/dist/{emailManager-DsAtfVR-.d.ts → emailManager-vDj9azjD.d.ts} +12 -4
- package/dist/extensibility.d.ts +2 -2
- package/dist/extensibility.esm.js +2 -2
- package/dist/mandatory-consent.d.ts +53 -53
- package/dist/phone.d.ts +1 -1
- package/dist/phone.esm.js +1 -1
- package/dist/{phoneManager-CenWu6bP.d.ts → phoneManager-BBEdl-dP.d.ts} +13 -5
- package/dist/{phoneManager-2NN9q777.esm.js → phoneManager-Chu-DkAG.esm.js} +37 -18
- package/package.json +1 -1
|
@@ -100,9 +100,13 @@ type PhoneInputtingState = {
|
|
|
100
100
|
type PhoneSubmittingState = {
|
|
101
101
|
status: 'submitting';
|
|
102
102
|
};
|
|
103
|
-
/** OTP is being sent to the phone number */
|
|
104
|
-
type
|
|
105
|
-
status: '
|
|
103
|
+
/** OTP is being sent to the phone number on resend */
|
|
104
|
+
type PhoneResendingOtpState = {
|
|
105
|
+
status: 'resendingOtp';
|
|
106
|
+
};
|
|
107
|
+
/** OTP is being initialy sent to the phone number */
|
|
108
|
+
type PhoneSendingInitialOtp = {
|
|
109
|
+
status: 'sendingInitialOtp';
|
|
106
110
|
};
|
|
107
111
|
/**
|
|
108
112
|
* Waiting for OTP code - use `submitOtp()`, `resendOtp()`, or `back()`
|
|
@@ -124,11 +128,15 @@ type PhoneVerifyingOtpState = {
|
|
|
124
128
|
* OTP verification failed - user can retry with `submitOtp()`
|
|
125
129
|
* @property error - Error message describing why verification failed
|
|
126
130
|
* @property attemptsRemaining - Number of remaining attempts before lockout
|
|
131
|
+
* @property resendTimer - Seconds remaining on resend cooldown (same as awaiting OTP)
|
|
132
|
+
* @property canResend - Whether resend is allowed (cooldown finished)
|
|
127
133
|
*/
|
|
128
134
|
type PhoneOtpErrorState = {
|
|
129
135
|
status: 'otpError';
|
|
130
|
-
|
|
136
|
+
otpError: string;
|
|
131
137
|
attemptsRemaining: number;
|
|
138
|
+
resendTimer: number;
|
|
139
|
+
canResend: boolean;
|
|
132
140
|
};
|
|
133
141
|
/** Phone verification completed successfully */
|
|
134
142
|
type PhoneFinishedState = {
|
|
@@ -155,7 +163,7 @@ type PhoneErrorState = {
|
|
|
155
163
|
* }
|
|
156
164
|
* ```
|
|
157
165
|
*/
|
|
158
|
-
type PhoneState = PhoneIdleState | PhoneLoadingPrefillState | PhoneInputtingState | PhoneSubmittingState |
|
|
166
|
+
type PhoneState = PhoneIdleState | PhoneLoadingPrefillState | PhoneInputtingState | PhoneSubmittingState | PhoneResendingOtpState | PhoneSendingInitialOtp | PhoneAwaitingOtpState | PhoneVerifyingOtpState | PhoneOtpErrorState | PhoneFinishedState | PhoneErrorState;
|
|
159
167
|
/**
|
|
160
168
|
* Creates a phone verification manager for headless or UI-driven usage.
|
|
161
169
|
*
|
|
@@ -152,7 +152,11 @@ const phoneMachine = setup({
|
|
|
152
152
|
attemptsRemaining: context.config.maxOtpAttempts ?? 3,
|
|
153
153
|
resendTimer: 0,
|
|
154
154
|
resendTimerActive: false
|
|
155
|
-
}))
|
|
155
|
+
})),
|
|
156
|
+
clearResendTimer: assign({
|
|
157
|
+
resendTimer: () => 0,
|
|
158
|
+
resendTimerActive: () => false
|
|
159
|
+
})
|
|
156
160
|
},
|
|
157
161
|
guards: {
|
|
158
162
|
hasPrefill: ({ context }) => context.config.prefill,
|
|
@@ -224,7 +228,7 @@ const phoneMachine = setup({
|
|
|
224
228
|
isInstantVerify: context.config.isInstantVerify ?? false
|
|
225
229
|
}),
|
|
226
230
|
onDone: [{
|
|
227
|
-
target: "
|
|
231
|
+
target: "sendingInitialOtp",
|
|
228
232
|
guard: "hasOtpVerification"
|
|
229
233
|
}, { target: "finished" }],
|
|
230
234
|
onError: {
|
|
@@ -232,7 +236,16 @@ const phoneMachine = setup({
|
|
|
232
236
|
actions: "setPhoneError"
|
|
233
237
|
}
|
|
234
238
|
} },
|
|
235
|
-
|
|
239
|
+
sendingInitialOtp: { invoke: {
|
|
240
|
+
id: "sendOtp",
|
|
241
|
+
src: "sendOtp",
|
|
242
|
+
onDone: { target: "awaitingOtp" },
|
|
243
|
+
onError: {
|
|
244
|
+
target: "awaitingOtp",
|
|
245
|
+
actions: "setError"
|
|
246
|
+
}
|
|
247
|
+
} },
|
|
248
|
+
resendingOtp: { invoke: {
|
|
236
249
|
id: "sendOtp",
|
|
237
250
|
src: "sendOtp",
|
|
238
251
|
onDone: { target: "awaitingOtp" },
|
|
@@ -252,7 +265,7 @@ const phoneMachine = setup({
|
|
|
252
265
|
OTP_CHANGED: { actions: "setOtpCode" },
|
|
253
266
|
VERIFY_OTP: { target: "verifyingOtp" },
|
|
254
267
|
RESEND_OTP: {
|
|
255
|
-
target: "
|
|
268
|
+
target: "resendingOtp",
|
|
256
269
|
guard: "canResend"
|
|
257
270
|
},
|
|
258
271
|
BACK: { target: "inputting" }
|
|
@@ -289,17 +302,20 @@ const phoneMachine = setup({
|
|
|
289
302
|
actions: "setError"
|
|
290
303
|
}]
|
|
291
304
|
} },
|
|
292
|
-
otpError: {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
305
|
+
otpError: {
|
|
306
|
+
entry: "clearResendTimer",
|
|
307
|
+
on: {
|
|
308
|
+
OTP_CHANGED: {
|
|
309
|
+
target: "awaitingOtp",
|
|
310
|
+
actions: "setOtpCode"
|
|
311
|
+
},
|
|
312
|
+
RESEND_OTP: {
|
|
313
|
+
target: "resendingOtp",
|
|
314
|
+
guard: "canResend"
|
|
315
|
+
},
|
|
316
|
+
BACK: { target: "inputting" }
|
|
317
|
+
}
|
|
318
|
+
},
|
|
303
319
|
finished: { type: "final" },
|
|
304
320
|
error: { on: { RESET: {
|
|
305
321
|
target: "idle",
|
|
@@ -423,7 +439,8 @@ function mapState(snapshot) {
|
|
|
423
439
|
phoneError: context.phoneError
|
|
424
440
|
};
|
|
425
441
|
if (typedSnapshot.matches("submitting")) return { status: "submitting" };
|
|
426
|
-
if (typedSnapshot.matches("
|
|
442
|
+
if (typedSnapshot.matches("resendingOtp")) return { status: "resendingOtp" };
|
|
443
|
+
if (typedSnapshot.matches("sendingInitialOtp")) return { status: "sendingInitialOtp" };
|
|
427
444
|
if (typedSnapshot.matches("awaitingOtp")) return {
|
|
428
445
|
status: "awaitingOtp",
|
|
429
446
|
resendTimer: context.resendTimer,
|
|
@@ -433,8 +450,10 @@ function mapState(snapshot) {
|
|
|
433
450
|
if (typedSnapshot.matches("verifyingOtp")) return { status: "verifyingOtp" };
|
|
434
451
|
if (typedSnapshot.matches("otpError")) return {
|
|
435
452
|
status: "otpError",
|
|
436
|
-
|
|
437
|
-
attemptsRemaining: context.attemptsRemaining
|
|
453
|
+
otpError: context.otpError ?? "otp.errorv2",
|
|
454
|
+
attemptsRemaining: context.attemptsRemaining,
|
|
455
|
+
resendTimer: context.resendTimer,
|
|
456
|
+
canResend: !context.resendTimerActive
|
|
438
457
|
};
|
|
439
458
|
if (typedSnapshot.matches("finished")) return { status: "finished" };
|
|
440
459
|
if (typedSnapshot.matches("error")) return {
|