@incodetech/core 0.0.0-dev-20260402-43cf9b8 → 0.0.0-dev-20260402-7cf9db4
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 +53 -53
- package/dist/document-capture.d.ts +55 -55
- package/dist/document-upload.d.ts +43 -43
- package/dist/email.d.ts +1 -1
- package/dist/email.esm.js +1 -1
- package/dist/{emailManager-B-CZIR0O.d.ts → emailManager-BIq6pJa8.d.ts} +9 -3
- package/dist/{emailManager-DJp8zUDV.esm.js → emailManager-C5GCSw78.esm.js} +40 -20
- 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-DsMwQU5C.d.ts → phoneManager-Ba66ysK2.d.ts} +7 -1
- package/dist/{phoneManager-2JbMadIR.esm.js → phoneManager-CQJim-Ky.esm.js} +29 -18
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import "./camera-Dv2WEhGe.js";
|
|
|
3
3
|
import "./types-BWGxcjiZ.js";
|
|
4
4
|
import { i as RegulationTypes } from "./types-BX1ZlbSR.js";
|
|
5
5
|
import { t as Manager } from "./Manager-BndLda4_.js";
|
|
6
|
-
import * as
|
|
6
|
+
import * as xstate204 from "xstate";
|
|
7
7
|
|
|
8
8
|
//#region src/modules/mandatory-consent/types.d.ts
|
|
9
9
|
type MandatoryConsentConfig = {
|
|
@@ -30,7 +30,7 @@ type MandatoryConsentContext = {
|
|
|
30
30
|
type MandatoryConsentInput = {
|
|
31
31
|
config: MandatoryConsentConfig;
|
|
32
32
|
};
|
|
33
|
-
declare const mandatoryConsentMachine:
|
|
33
|
+
declare const mandatoryConsentMachine: xstate204.StateMachine<MandatoryConsentContext, {
|
|
34
34
|
type: "LOAD";
|
|
35
35
|
} | {
|
|
36
36
|
type: "TOGGLE";
|
|
@@ -43,53 +43,53 @@ declare const mandatoryConsentMachine: xstate0.StateMachine<MandatoryConsentCont
|
|
|
43
43
|
} | {
|
|
44
44
|
type: "RESET";
|
|
45
45
|
}, {
|
|
46
|
-
[x: string]:
|
|
46
|
+
[x: string]: xstate204.ActorRefFromLogic<xstate204.PromiseActorLogic<FetchMandatoryConsentResponse, {
|
|
47
47
|
config: MandatoryConsentConfig;
|
|
48
|
-
},
|
|
48
|
+
}, xstate204.EventObject>> | xstate204.ActorRefFromLogic<xstate204.PromiseActorLogic<void, {
|
|
49
49
|
consentId: string;
|
|
50
50
|
isSigned: boolean;
|
|
51
|
-
},
|
|
52
|
-
},
|
|
51
|
+
}, xstate204.EventObject>> | undefined;
|
|
52
|
+
}, xstate204.Values<{
|
|
53
53
|
fetchConsent: {
|
|
54
54
|
src: "fetchConsent";
|
|
55
|
-
logic:
|
|
55
|
+
logic: xstate204.PromiseActorLogic<FetchMandatoryConsentResponse, {
|
|
56
56
|
config: MandatoryConsentConfig;
|
|
57
|
-
},
|
|
57
|
+
}, xstate204.EventObject>;
|
|
58
58
|
id: string | undefined;
|
|
59
59
|
};
|
|
60
60
|
submitConsent: {
|
|
61
61
|
src: "submitConsent";
|
|
62
|
-
logic:
|
|
62
|
+
logic: xstate204.PromiseActorLogic<void, {
|
|
63
63
|
consentId: string;
|
|
64
64
|
isSigned: boolean;
|
|
65
|
-
},
|
|
65
|
+
}, xstate204.EventObject>;
|
|
66
66
|
id: string | undefined;
|
|
67
67
|
};
|
|
68
|
-
}>,
|
|
69
|
-
setConsent: {
|
|
70
|
-
type: "setConsent";
|
|
71
|
-
params: xstate0.NonReducibleUnknown;
|
|
72
|
-
};
|
|
73
|
-
toggleSigned: {
|
|
74
|
-
type: "toggleSigned";
|
|
75
|
-
params: xstate0.NonReducibleUnknown;
|
|
76
|
-
};
|
|
68
|
+
}>, xstate204.Values<{
|
|
77
69
|
setError: {
|
|
78
70
|
type: "setError";
|
|
79
|
-
params:
|
|
71
|
+
params: xstate204.NonReducibleUnknown;
|
|
80
72
|
};
|
|
81
73
|
clearError: {
|
|
82
74
|
type: "clearError";
|
|
83
|
-
params:
|
|
75
|
+
params: xstate204.NonReducibleUnknown;
|
|
84
76
|
};
|
|
85
77
|
resetContext: {
|
|
86
78
|
type: "resetContext";
|
|
87
|
-
params:
|
|
79
|
+
params: xstate204.NonReducibleUnknown;
|
|
80
|
+
};
|
|
81
|
+
setConsent: {
|
|
82
|
+
type: "setConsent";
|
|
83
|
+
params: xstate204.NonReducibleUnknown;
|
|
84
|
+
};
|
|
85
|
+
toggleSigned: {
|
|
86
|
+
type: "toggleSigned";
|
|
87
|
+
params: xstate204.NonReducibleUnknown;
|
|
88
88
|
};
|
|
89
89
|
}>, {
|
|
90
90
|
type: "canSubmit";
|
|
91
91
|
params: unknown;
|
|
92
|
-
}, never, "error" | "idle" | "loading" | "display" | "submitting" | "
|
|
92
|
+
}, never, "error" | "idle" | "loading" | "display" | "submitting" | "finished" | "closed", string, MandatoryConsentInput, xstate204.NonReducibleUnknown, xstate204.EventObject, xstate204.MetaObject, {
|
|
93
93
|
readonly id: "mandatoryConsent";
|
|
94
94
|
readonly initial: "idle";
|
|
95
95
|
readonly context: ({
|
|
@@ -98,70 +98,70 @@ declare const mandatoryConsentMachine: xstate0.StateMachine<MandatoryConsentCont
|
|
|
98
98
|
spawn: {
|
|
99
99
|
<TSrc extends "fetchConsent" | "submitConsent">(logic: TSrc, ...[options]: ({
|
|
100
100
|
src: "fetchConsent";
|
|
101
|
-
logic:
|
|
101
|
+
logic: xstate204.PromiseActorLogic<FetchMandatoryConsentResponse, {
|
|
102
102
|
config: MandatoryConsentConfig;
|
|
103
|
-
},
|
|
103
|
+
}, xstate204.EventObject>;
|
|
104
104
|
id: string | undefined;
|
|
105
105
|
} extends infer T ? T extends {
|
|
106
106
|
src: "fetchConsent";
|
|
107
|
-
logic:
|
|
107
|
+
logic: xstate204.PromiseActorLogic<FetchMandatoryConsentResponse, {
|
|
108
108
|
config: MandatoryConsentConfig;
|
|
109
|
-
},
|
|
109
|
+
}, xstate204.EventObject>;
|
|
110
110
|
id: string | undefined;
|
|
111
111
|
} ? T extends {
|
|
112
112
|
src: TSrc;
|
|
113
|
-
} ?
|
|
113
|
+
} ? xstate204.ConditionalRequired<[options?: ({
|
|
114
114
|
id?: T["id"] | undefined;
|
|
115
115
|
systemId?: string;
|
|
116
|
-
input?:
|
|
116
|
+
input?: xstate204.InputFrom<T["logic"]> | undefined;
|
|
117
117
|
syncSnapshot?: boolean;
|
|
118
|
-
} & { [K in
|
|
118
|
+
} & { [K in xstate204.RequiredActorOptions<T>]: unknown }) | undefined], xstate204.IsNotNever<xstate204.RequiredActorOptions<T>>> : never : never : never) | ({
|
|
119
119
|
src: "submitConsent";
|
|
120
|
-
logic:
|
|
120
|
+
logic: xstate204.PromiseActorLogic<void, {
|
|
121
121
|
consentId: string;
|
|
122
122
|
isSigned: boolean;
|
|
123
|
-
},
|
|
123
|
+
}, xstate204.EventObject>;
|
|
124
124
|
id: string | undefined;
|
|
125
125
|
} extends infer T_1 ? T_1 extends {
|
|
126
126
|
src: "submitConsent";
|
|
127
|
-
logic:
|
|
127
|
+
logic: xstate204.PromiseActorLogic<void, {
|
|
128
128
|
consentId: string;
|
|
129
129
|
isSigned: boolean;
|
|
130
|
-
},
|
|
130
|
+
}, xstate204.EventObject>;
|
|
131
131
|
id: string | undefined;
|
|
132
132
|
} ? T_1 extends {
|
|
133
133
|
src: TSrc;
|
|
134
|
-
} ?
|
|
134
|
+
} ? xstate204.ConditionalRequired<[options?: ({
|
|
135
135
|
id?: T_1["id"] | undefined;
|
|
136
136
|
systemId?: string;
|
|
137
|
-
input?:
|
|
137
|
+
input?: xstate204.InputFrom<T_1["logic"]> | undefined;
|
|
138
138
|
syncSnapshot?: boolean;
|
|
139
|
-
} & { [K_1 in
|
|
139
|
+
} & { [K_1 in xstate204.RequiredActorOptions<T_1>]: unknown }) | undefined], xstate204.IsNotNever<xstate204.RequiredActorOptions<T_1>>> : never : never : never)): xstate204.ActorRefFromLogic<xstate204.GetConcreteByKey<xstate204.Values<{
|
|
140
140
|
fetchConsent: {
|
|
141
141
|
src: "fetchConsent";
|
|
142
|
-
logic:
|
|
142
|
+
logic: xstate204.PromiseActorLogic<FetchMandatoryConsentResponse, {
|
|
143
143
|
config: MandatoryConsentConfig;
|
|
144
|
-
},
|
|
144
|
+
}, xstate204.EventObject>;
|
|
145
145
|
id: string | undefined;
|
|
146
146
|
};
|
|
147
147
|
submitConsent: {
|
|
148
148
|
src: "submitConsent";
|
|
149
|
-
logic:
|
|
149
|
+
logic: xstate204.PromiseActorLogic<void, {
|
|
150
150
|
consentId: string;
|
|
151
151
|
isSigned: boolean;
|
|
152
|
-
},
|
|
152
|
+
}, xstate204.EventObject>;
|
|
153
153
|
id: string | undefined;
|
|
154
154
|
};
|
|
155
155
|
}>, "src", TSrc>["logic"]>;
|
|
156
|
-
<TLogic extends
|
|
156
|
+
<TLogic extends xstate204.AnyActorLogic>(src: TLogic, ...[options]: xstate204.ConditionalRequired<[options?: ({
|
|
157
157
|
id?: never;
|
|
158
158
|
systemId?: string;
|
|
159
|
-
input?:
|
|
159
|
+
input?: xstate204.InputFrom<TLogic> | undefined;
|
|
160
160
|
syncSnapshot?: boolean;
|
|
161
|
-
} & { [K in
|
|
161
|
+
} & { [K in xstate204.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate204.IsNotNever<xstate204.RequiredLogicInput<TLogic>>>): xstate204.ActorRefFromLogic<TLogic>;
|
|
162
162
|
};
|
|
163
163
|
input: MandatoryConsentInput;
|
|
164
|
-
self:
|
|
164
|
+
self: xstate204.ActorRef<xstate204.MachineSnapshot<MandatoryConsentContext, {
|
|
165
165
|
type: "LOAD";
|
|
166
166
|
} | {
|
|
167
167
|
type: "TOGGLE";
|
|
@@ -173,7 +173,7 @@ declare const mandatoryConsentMachine: xstate0.StateMachine<MandatoryConsentCont
|
|
|
173
173
|
type: "RETRY";
|
|
174
174
|
} | {
|
|
175
175
|
type: "RESET";
|
|
176
|
-
}, Record<string,
|
|
176
|
+
}, Record<string, xstate204.AnyActorRef | undefined>, xstate204.StateValue, string, unknown, any, any>, {
|
|
177
177
|
type: "LOAD";
|
|
178
178
|
} | {
|
|
179
179
|
type: "TOGGLE";
|
|
@@ -185,7 +185,7 @@ declare const mandatoryConsentMachine: xstate0.StateMachine<MandatoryConsentCont
|
|
|
185
185
|
type: "RETRY";
|
|
186
186
|
} | {
|
|
187
187
|
type: "RESET";
|
|
188
|
-
},
|
|
188
|
+
}, xstate204.AnyEventObject>;
|
|
189
189
|
}) => {
|
|
190
190
|
config: MandatoryConsentConfig;
|
|
191
191
|
consent: undefined;
|
|
@@ -222,7 +222,7 @@ declare const mandatoryConsentMachine: xstate0.StateMachine<MandatoryConsentCont
|
|
|
222
222
|
} | {
|
|
223
223
|
type: "RESET";
|
|
224
224
|
};
|
|
225
|
-
self:
|
|
225
|
+
self: xstate204.ActorRef<xstate204.MachineSnapshot<MandatoryConsentContext, {
|
|
226
226
|
type: "LOAD";
|
|
227
227
|
} | {
|
|
228
228
|
type: "TOGGLE";
|
|
@@ -234,7 +234,7 @@ declare const mandatoryConsentMachine: xstate0.StateMachine<MandatoryConsentCont
|
|
|
234
234
|
type: "RETRY";
|
|
235
235
|
} | {
|
|
236
236
|
type: "RESET";
|
|
237
|
-
}, Record<string,
|
|
237
|
+
}, Record<string, xstate204.AnyActorRef>, xstate204.StateValue, string, unknown, any, any>, {
|
|
238
238
|
type: "LOAD";
|
|
239
239
|
} | {
|
|
240
240
|
type: "TOGGLE";
|
|
@@ -246,7 +246,7 @@ declare const mandatoryConsentMachine: xstate0.StateMachine<MandatoryConsentCont
|
|
|
246
246
|
type: "RETRY";
|
|
247
247
|
} | {
|
|
248
248
|
type: "RESET";
|
|
249
|
-
},
|
|
249
|
+
}, xstate204.AnyEventObject>;
|
|
250
250
|
}) => {
|
|
251
251
|
config: MandatoryConsentConfig;
|
|
252
252
|
};
|
|
@@ -299,7 +299,7 @@ declare const mandatoryConsentMachine: xstate0.StateMachine<MandatoryConsentCont
|
|
|
299
299
|
} | {
|
|
300
300
|
type: "RESET";
|
|
301
301
|
};
|
|
302
|
-
self:
|
|
302
|
+
self: xstate204.ActorRef<xstate204.MachineSnapshot<MandatoryConsentContext, {
|
|
303
303
|
type: "LOAD";
|
|
304
304
|
} | {
|
|
305
305
|
type: "TOGGLE";
|
|
@@ -311,7 +311,7 @@ declare const mandatoryConsentMachine: xstate0.StateMachine<MandatoryConsentCont
|
|
|
311
311
|
type: "RETRY";
|
|
312
312
|
} | {
|
|
313
313
|
type: "RESET";
|
|
314
|
-
}, Record<string,
|
|
314
|
+
}, Record<string, xstate204.AnyActorRef>, xstate204.StateValue, string, unknown, any, any>, {
|
|
315
315
|
type: "LOAD";
|
|
316
316
|
} | {
|
|
317
317
|
type: "TOGGLE";
|
|
@@ -323,7 +323,7 @@ declare const mandatoryConsentMachine: xstate0.StateMachine<MandatoryConsentCont
|
|
|
323
323
|
type: "RETRY";
|
|
324
324
|
} | {
|
|
325
325
|
type: "RESET";
|
|
326
|
-
},
|
|
326
|
+
}, xstate204.AnyEventObject>;
|
|
327
327
|
}) => {
|
|
328
328
|
consentId: string;
|
|
329
329
|
isSigned: boolean;
|
package/dist/phone.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "./Actor-phIcsUhv.js";
|
|
2
2
|
import "./Manager-BndLda4_.js";
|
|
3
|
-
import { a as phoneMachine, n as PhoneState, o as PhoneConfig, r as createPhoneManager, t as PhoneManager } from "./phoneManager-
|
|
3
|
+
import { a as phoneMachine, n as PhoneState, o as PhoneConfig, r as createPhoneManager, t as PhoneManager } from "./phoneManager-Ba66ysK2.js";
|
|
4
4
|
export { type PhoneConfig, type PhoneManager, type PhoneState, createPhoneManager, phoneMachine };
|
package/dist/phone.esm.js
CHANGED
|
@@ -2,6 +2,6 @@ import "./api-3fZO5bmj.esm.js";
|
|
|
2
2
|
import "./Manager-D_DMzMWz.esm.js";
|
|
3
3
|
import "./endpoints-CCuj1KZH.esm.js";
|
|
4
4
|
import "./BrowserTimerProvider-CRhCvln7.esm.js";
|
|
5
|
-
import { r as phoneMachine, t as createPhoneManager } from "./phoneManager-
|
|
5
|
+
import { r as phoneMachine, t as createPhoneManager } from "./phoneManager-CQJim-Ky.esm.js";
|
|
6
6
|
|
|
7
7
|
export { createPhoneManager, phoneMachine };
|
|
@@ -125,9 +125,15 @@ type PhoneAwaitingOtpState = {
|
|
|
125
125
|
canResend: boolean;
|
|
126
126
|
attemptsRemaining: number;
|
|
127
127
|
};
|
|
128
|
-
/**
|
|
128
|
+
/**
|
|
129
|
+
* OTP code is being verified against the backend
|
|
130
|
+
* @property resendTimer - Seconds remaining on resend cooldown (unchanged while verifying)
|
|
131
|
+
* @property canResend - Whether resend is allowed (cooldown finished)
|
|
132
|
+
*/
|
|
129
133
|
type PhoneVerifyingOtpState = {
|
|
130
134
|
status: 'verifyingOtp';
|
|
135
|
+
resendTimer: number;
|
|
136
|
+
canResend: boolean;
|
|
131
137
|
};
|
|
132
138
|
/**
|
|
133
139
|
* OTP verification failed - user can retry with `submitOtp()`
|
|
@@ -72,13 +72,14 @@ const phoneMachine = setup({
|
|
|
72
72
|
verifyOtp: fromPromise(async ({ input, signal }) => {
|
|
73
73
|
return verifyOtp(input.code, signal);
|
|
74
74
|
}),
|
|
75
|
-
resendTimer: fromCallback(({ sendBack }) => {
|
|
75
|
+
resendTimer: fromCallback(({ input, sendBack }) => {
|
|
76
76
|
const timer = BrowserTimerProvider.getInstance();
|
|
77
|
-
let
|
|
77
|
+
let remaining = input.seconds;
|
|
78
|
+
if (remaining <= 0) return () => {};
|
|
78
79
|
const interval = timer.setInterval(() => {
|
|
79
|
-
seconds -= 1;
|
|
80
80
|
sendBack({ type: "TICK" });
|
|
81
|
-
|
|
81
|
+
remaining -= 1;
|
|
82
|
+
if (remaining <= 0) timer.clearInterval(interval);
|
|
82
83
|
}, 1e3);
|
|
83
84
|
return () => timer.clearInterval(interval);
|
|
84
85
|
})
|
|
@@ -135,7 +136,6 @@ const phoneMachine = setup({
|
|
|
135
136
|
resendTimerActive: newTimer > 0
|
|
136
137
|
};
|
|
137
138
|
}),
|
|
138
|
-
stopResendTimer: assign({ resendTimerActive: () => false }),
|
|
139
139
|
resetContext: assign(({ context }) => ({
|
|
140
140
|
config: context.config,
|
|
141
141
|
phone: "",
|
|
@@ -152,11 +152,7 @@ const phoneMachine = setup({
|
|
|
152
152
|
attemptsRemaining: context.config.maxOtpAttempts ?? 3,
|
|
153
153
|
resendTimer: 0,
|
|
154
154
|
resendTimerActive: false
|
|
155
|
-
}))
|
|
156
|
-
clearResendTimer: assign({
|
|
157
|
-
resendTimer: () => 0,
|
|
158
|
-
resendTimerActive: () => false
|
|
159
|
-
})
|
|
155
|
+
}))
|
|
160
156
|
},
|
|
161
157
|
guards: {
|
|
162
158
|
hasPrefill: ({ context }) => context.config.prefill,
|
|
@@ -239,26 +235,32 @@ const phoneMachine = setup({
|
|
|
239
235
|
sendingInitialOtp: { invoke: {
|
|
240
236
|
id: "sendOtp",
|
|
241
237
|
src: "sendOtp",
|
|
242
|
-
onDone: {
|
|
238
|
+
onDone: {
|
|
239
|
+
target: "awaitingOtp",
|
|
240
|
+
actions: "startResendTimer"
|
|
241
|
+
},
|
|
243
242
|
onError: {
|
|
244
243
|
target: "awaitingOtp",
|
|
245
|
-
actions: "setError"
|
|
244
|
+
actions: ["setError", "startResendTimer"]
|
|
246
245
|
}
|
|
247
246
|
} },
|
|
248
247
|
resendingOtp: { invoke: {
|
|
249
248
|
id: "sendOtp",
|
|
250
249
|
src: "sendOtp",
|
|
251
|
-
onDone: {
|
|
250
|
+
onDone: {
|
|
251
|
+
target: "awaitingOtp",
|
|
252
|
+
actions: "startResendTimer"
|
|
253
|
+
},
|
|
252
254
|
onError: {
|
|
253
255
|
target: "awaitingOtp",
|
|
254
|
-
actions: "setError"
|
|
256
|
+
actions: ["setError", "startResendTimer"]
|
|
255
257
|
}
|
|
256
258
|
} },
|
|
257
259
|
awaitingOtp: {
|
|
258
|
-
entry: "startResendTimer",
|
|
259
260
|
invoke: {
|
|
260
261
|
id: "resendTimer",
|
|
261
|
-
src: "resendTimer"
|
|
262
|
+
src: "resendTimer",
|
|
263
|
+
input: ({ context }) => ({ seconds: context.resendTimer })
|
|
262
264
|
},
|
|
263
265
|
on: {
|
|
264
266
|
TICK: { actions: "tickResendTimer" },
|
|
@@ -303,8 +305,13 @@ const phoneMachine = setup({
|
|
|
303
305
|
}]
|
|
304
306
|
} },
|
|
305
307
|
otpError: {
|
|
306
|
-
|
|
308
|
+
invoke: {
|
|
309
|
+
id: "resendTimer",
|
|
310
|
+
src: "resendTimer",
|
|
311
|
+
input: ({ context }) => ({ seconds: context.resendTimer })
|
|
312
|
+
},
|
|
307
313
|
on: {
|
|
314
|
+
TICK: { actions: "tickResendTimer" },
|
|
308
315
|
OTP_CHANGED: {
|
|
309
316
|
target: "awaitingOtp",
|
|
310
317
|
actions: "setOtpCode"
|
|
@@ -451,7 +458,11 @@ function mapState(snapshot) {
|
|
|
451
458
|
canResend: !context.resendTimerActive,
|
|
452
459
|
attemptsRemaining: context.attemptsRemaining
|
|
453
460
|
};
|
|
454
|
-
if (typedSnapshot.matches("verifyingOtp")) return {
|
|
461
|
+
if (typedSnapshot.matches("verifyingOtp")) return {
|
|
462
|
+
status: "verifyingOtp",
|
|
463
|
+
resendTimer: context.resendTimer,
|
|
464
|
+
canResend: !context.resendTimerActive
|
|
465
|
+
};
|
|
455
466
|
if (typedSnapshot.matches("otpError")) return {
|
|
456
467
|
status: "otpError",
|
|
457
468
|
otpError: context.otpError ?? "otp.errorv2",
|