@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.
- package/package.json +3 -3
- package/dist/Actor-CI32dTbG.d.ts +0 -2
- package/dist/BaseWasmProvider-C_DLEI40.esm.js +0 -1118
- package/dist/BrowserStorageProvider-CuOW1Er2.esm.js +0 -55
- package/dist/BrowserTimerProvider-DhNc_x02.esm.js +0 -22
- package/dist/ITimerCapability-C67ZRskg.esm.js +0 -7
- package/dist/IpifyProvider-D7jx52AL.esm.js +0 -139
- package/dist/Manager-C8PrhBOx.d.ts +0 -19
- package/dist/MotionSensorProvider-4v7xkqAp.esm.js +0 -254
- package/dist/OpenViduRecordingProvider-CMu6XVdc.esm.js +0 -87
- package/dist/StateMachine-BCQrZJhf.d.ts +0 -2
- package/dist/WasmUtilProvider-j98OJf-S.esm.js +0 -114
- package/dist/addressSearch-BpTbTWCa.esm.js +0 -430
- package/dist/ae-signature-DDDZmWXj.esm.js +0 -12
- package/dist/ae-signature.d.ts +0 -25
- package/dist/ae-signature.esm.js +0 -8
- package/dist/antifraud.d.ts +0 -57
- package/dist/antifraud.esm.js +0 -45
- package/dist/antifraudStateMachine-O0TMf6yc.esm.js +0 -39
- package/dist/api-CESGtpbH.esm.js +0 -53
- package/dist/authentication.d.ts +0 -12
- package/dist/authentication.esm.js +0 -25
- package/dist/authenticationManager-5M-fKzXx.esm.js +0 -67
- package/dist/authenticationManager-C83GNIhl.d.ts +0 -66
- package/dist/authenticationStateMachine-BMZqatiF.esm.js +0 -139
- package/dist/backCameraStream-DMdMeGk2.esm.js +0 -346
- package/dist/browserSimulation-gxD8cSpM.esm.js +0 -20
- package/dist/camera-DBSxa6ML.d.ts +0 -4
- package/dist/camera-PA2Ljri3.esm.js +0 -22
- package/dist/camera.d.ts +0 -15
- package/dist/camera.esm.js +0 -5
- package/dist/chunk-CRF6K_H_.esm.js +0 -49
- package/dist/consent.d.ts +0 -398
- package/dist/consent.esm.js +0 -79
- package/dist/consentStateMachine-CCT-B60O.esm.js +0 -151
- package/dist/cpf-PPz2Njto.esm.js +0 -38
- package/dist/cpf-ocr.d.ts +0 -204
- package/dist/cpf-ocr.esm.js +0 -177
- package/dist/cross-document-data-match.d.ts +0 -34
- package/dist/cross-document-data-match.esm.js +0 -71
- package/dist/curp-validation.d.ts +0 -188
- package/dist/curp-validation.esm.js +0 -110
- package/dist/curpValidationStateMachine-CitWLr2c.esm.js +0 -595
- package/dist/custom-fields.d.ts +0 -115
- package/dist/custom-fields.esm.js +0 -177
- package/dist/custom-watchlist.d.ts +0 -66
- package/dist/custom-watchlist.esm.js +0 -86
- package/dist/dateUtils-UoN5xswP.esm.js +0 -23
- package/dist/deepsightLoader-Cm4JIT_z.esm.js +0 -52
- package/dist/deepsightService-CEVxzehb.d.ts +0 -412
- package/dist/deepsightService-O74l4Y__.esm.js +0 -489
- package/dist/device.d.ts +0 -46
- package/dist/device.esm.js +0 -106
- package/dist/displayErrors-DqJ_IbsG.d.ts +0 -39
- package/dist/document-capture.d.ts +0 -906
- package/dist/document-capture.esm.js +0 -156
- package/dist/document-upload.d.ts +0 -331
- package/dist/document-upload.esm.js +0 -203
- package/dist/documentCaptureStateMachine-BqzTDy9k.esm.js +0 -394
- package/dist/dynamic-forms.d.ts +0 -178
- package/dist/dynamic-forms.esm.js +0 -323
- package/dist/ekyb.d.ts +0 -148
- package/dist/ekyb.esm.js +0 -127
- package/dist/ekybStateMachine-B59rQjgj.esm.js +0 -674
- package/dist/ekyc.d.ts +0 -164
- package/dist/ekyc.esm.js +0 -104
- package/dist/ekycStateMachine-oeO0Iekd.esm.js +0 -10626
- package/dist/electronic-signature.d.ts +0 -4
- package/dist/electronic-signature.esm.js +0 -7
- package/dist/electronicSignatureManager-D9OHzTpG.esm.js +0 -428
- package/dist/email.d.ts +0 -4
- package/dist/email.esm.js +0 -9
- package/dist/emailManager-DIfnS5g1.d.ts +0 -352
- package/dist/emailManager-wAV0LE-H.esm.js +0 -238
- package/dist/emailStateMachine-DOf4j58N.esm.js +0 -292
- package/dist/endpoints-CnN3SyDa.esm.js +0 -87
- package/dist/events-D6-e4vok.esm.js +0 -596
- package/dist/events.d.ts +0 -265
- package/dist/events.esm.js +0 -4
- package/dist/extensibility.d.ts +0 -122
- package/dist/extensibility.esm.js +0 -43
- package/dist/face-match.d.ts +0 -228
- package/dist/face-match.esm.js +0 -173
- package/dist/faceCaptureManagerFactory-Dh2PdGlF.esm.js +0 -290
- package/dist/faceCaptureManagerFactory-yqtpxjnN.d.ts +0 -690
- package/dist/faceCaptureSetup-B3faSpYA.esm.js +0 -873
- package/dist/faceMatchStateMachine-DNFrxTFS.esm.js +0 -127
- package/dist/flow-events.d.ts +0 -6
- package/dist/flow-events.esm.js +0 -0
- package/dist/flow.d.ts +0 -358
- package/dist/flow.esm.js +0 -825
- package/dist/flowCompletionService-DhkT4SRY.d.ts +0 -10
- package/dist/flowCompletionService-P54yzGvA.esm.js +0 -13
- package/dist/flowServices-DTsm-Vf1.esm.js +0 -188
- package/dist/geolocation.d.ts +0 -127
- package/dist/geolocation.esm.js +0 -89
- package/dist/geolocationStateMachine-asasuHY2.esm.js +0 -105
- package/dist/getBrowser-BSXUTWXw.esm.js +0 -41
- package/dist/getDeviceClass-BSntT9_j.esm.js +0 -14
- package/dist/government-validation.d.ts +0 -67
- package/dist/government-validation.esm.js +0 -81
- package/dist/governmentValidationStateMachine-BDDYrJTo.esm.js +0 -271
- package/dist/home.d.ts +0 -99
- package/dist/home.esm.js +0 -61
- package/dist/http.d.ts +0 -68
- package/dist/http.esm.js +0 -3
- package/dist/id-ocr.d.ts +0 -635
- package/dist/id-ocr.esm.js +0 -86
- package/dist/id-verification.d.ts +0 -190
- package/dist/id-verification.esm.js +0 -43
- package/dist/id.d.ts +0 -24
- package/dist/id.esm.js +0 -164
- package/dist/idCaptureManager-B9TGA5dq.d.ts +0 -956
- package/dist/idCaptureManager-DMK0GIt3.esm.js +0 -581
- package/dist/idCaptureStateMachine-Bq0fVZXl.esm.js +0 -2954
- package/dist/idOcrStateMachine-YbjjC_Gg.esm.js +0 -388
- package/dist/idVerificationStateMachine-xbw9HP1Z.esm.js +0 -71
- package/dist/identity-reuse.d.ts +0 -530
- package/dist/identity-reuse.esm.js +0 -274
- package/dist/index-BLKtMA0g.d.ts +0 -1177
- package/dist/index-BcRG8rtJ.d.ts +0 -97
- package/dist/index.d.ts +0 -3
- package/dist/index.esm.js +0 -12
- package/dist/invokeOnCaptureCallback-rc6kBHo5.esm.js +0 -30
- package/dist/lib-BB0B_qQX.esm.js +0 -12499
- package/dist/mandatory-consent.d.ts +0 -412
- package/dist/mandatory-consent.esm.js +0 -78
- package/dist/mandatoryConsentStateMachine-Cnco1jvn.esm.js +0 -126
- package/dist/openviduLazy-Cm0XFh_v.esm.js +0 -3
- package/dist/openviduLazy-Cok70ZSg.esm.js +0 -12
- package/dist/permissionServices-D_i6nzEw.esm.js +0 -50
- package/dist/phone.d.ts +0 -4
- package/dist/phone.esm.js +0 -9
- package/dist/phoneManager-B6M30hKE.d.ts +0 -397
- package/dist/phoneManager-DAJbGhlY.esm.js +0 -256
- package/dist/phoneStateMachine-CuPARRaT.esm.js +0 -351
- package/dist/platform-CfrjKhmi.esm.js +0 -83
- package/dist/qe-signature-DFo_Cc-I.esm.js +0 -12
- package/dist/qe-signature.d.ts +0 -25
- package/dist/qe-signature.esm.js +0 -8
- package/dist/recordingService-Ig2UgbLv.esm.js +0 -1003
- package/dist/redirect-to-mobile.d.ts +0 -107
- package/dist/redirect-to-mobile.esm.js +0 -102
- package/dist/redirectToMobileStateMachine-BOEqe46A.esm.js +0 -249
- package/dist/runChildModule-CqqwqAkW.esm.js +0 -219
- package/dist/selfie.d.ts +0 -26
- package/dist/selfie.esm.js +0 -146
- package/dist/selfieManager-D0lSgd-J.d.ts +0 -68
- package/dist/selfieManager-Duisl7qN.esm.js +0 -60
- package/dist/selfieStateMachine-D76whWEf.esm.js +0 -68
- package/dist/session-BS-d_vuE.esm.js +0 -3206
- package/dist/session.d.ts +0 -217
- package/dist/session.esm.js +0 -9
- package/dist/setup-Buy-hyj4.esm.js +0 -887
- package/dist/setup-C5AITV8m.d.ts +0 -254
- package/dist/signature.d.ts +0 -94
- package/dist/signature.esm.js +0 -66
- package/dist/signatureStateMachine-B5-QVUve.esm.js +0 -132
- package/dist/stats-CIfiPzb1.esm.js +0 -16
- package/dist/stats.d.ts +0 -16
- package/dist/stats.esm.js +0 -4
- package/dist/trust-graph.d.ts +0 -54
- package/dist/trust-graph.esm.js +0 -56
- package/dist/types-B06Ypu2F.d.ts +0 -49
- package/dist/types-BP1m8VRw.d.ts +0 -340
- package/dist/types-CAD4va6a.d.ts +0 -5
- package/dist/types-CFV9G_7j.d.ts +0 -24
- package/dist/warmup-CEcppFiS.d.ts +0 -63
- package/dist/wasm.d.ts +0 -15
- package/dist/wasm.esm.js +0 -12
- package/dist/watchlist-for-business.d.ts +0 -79
- package/dist/watchlist-for-business.esm.js +0 -148
- package/dist/watchlist.d.ts +0 -62
- package/dist/watchlist.esm.js +0 -86
- package/dist/watchlistServices-DMbUhkBX.esm.js +0 -12
- package/dist/workflow.d.ts +0 -907
- package/dist/workflow.esm.js +0 -702
- package/dist/xstate.esm-B70JrNqo.esm.js +0 -3404
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import "./BrowserTimerProvider-DhNc_x02.esm.js";
|
|
2
|
-
import "./api-CESGtpbH.esm.js";
|
|
3
|
-
import { o as createManagerInstrumentation } from "./events-D6-e4vok.esm.js";
|
|
4
|
-
import "./endpoints-CnN3SyDa.esm.js";
|
|
5
|
-
import { c as createManager, s as createActor } from "./xstate.esm-B70JrNqo.esm.js";
|
|
6
|
-
import { t as governmentValidationMachine } from "./governmentValidationStateMachine-BDDYrJTo.esm.js";
|
|
7
|
-
|
|
8
|
-
//#region src/modules/government-validation/governmentValidationActor.ts
|
|
9
|
-
function createGovernmentValidationActor(options) {
|
|
10
|
-
return createActor(governmentValidationMachine, { input: { config: options.config } }).start();
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
//#endregion
|
|
14
|
-
//#region src/modules/government-validation/governmentValidationManager.ts
|
|
15
|
-
function mapState(snapshot) {
|
|
16
|
-
const typedSnapshot = snapshot;
|
|
17
|
-
const { context } = typedSnapshot;
|
|
18
|
-
if (typedSnapshot.matches("idle")) return { status: "idle" };
|
|
19
|
-
if (typedSnapshot.matches("loading")) return { status: "loading" };
|
|
20
|
-
if (typedSnapshot.matches("polling") || typedSnapshot.matches("pollingRequest")) return { status: "processing" };
|
|
21
|
-
if (typedSnapshot.matches("awaitingOtp")) return {
|
|
22
|
-
status: "awaitingOtp",
|
|
23
|
-
resendTimer: context.resendTimer,
|
|
24
|
-
canResend: !context.resendTimerActive,
|
|
25
|
-
attemptsRemaining: context.attemptsRemaining,
|
|
26
|
-
otpError: context.otpError
|
|
27
|
-
};
|
|
28
|
-
if (typedSnapshot.matches("verifyingOtp")) return { status: "verifyingOtp" };
|
|
29
|
-
if (typedSnapshot.matches("displaySuccess")) return { status: "finished" };
|
|
30
|
-
if (typedSnapshot.matches("displayProcessing")) return { status: "processing" };
|
|
31
|
-
if (typedSnapshot.matches("finished")) return { status: "finished" };
|
|
32
|
-
if (typedSnapshot.matches("displayError")) return {
|
|
33
|
-
status: "error",
|
|
34
|
-
error: context.error ?? "An error occurred"
|
|
35
|
-
};
|
|
36
|
-
if (typedSnapshot.matches("displayUnknown")) return {
|
|
37
|
-
status: "unknown",
|
|
38
|
-
error: context.error ?? "Unknown validation status"
|
|
39
|
-
};
|
|
40
|
-
return { status: "idle" };
|
|
41
|
-
}
|
|
42
|
-
function createApi({ actor, trackElementClicked }) {
|
|
43
|
-
return {
|
|
44
|
-
load() {
|
|
45
|
-
actor.send({ type: "LOAD" });
|
|
46
|
-
},
|
|
47
|
-
setOtpCode(code) {
|
|
48
|
-
actor.send({
|
|
49
|
-
type: "OTP_CHANGED",
|
|
50
|
-
code
|
|
51
|
-
});
|
|
52
|
-
},
|
|
53
|
-
submitOtp(code) {
|
|
54
|
-
trackElementClicked?.("submitOtp");
|
|
55
|
-
actor.send({
|
|
56
|
-
type: "OTP_CHANGED",
|
|
57
|
-
code
|
|
58
|
-
});
|
|
59
|
-
actor.send({ type: "SUBMIT_OTP" });
|
|
60
|
-
},
|
|
61
|
-
resendOtp() {
|
|
62
|
-
trackElementClicked?.("resendOtp");
|
|
63
|
-
actor.send({ type: "RESEND_OTP" });
|
|
64
|
-
},
|
|
65
|
-
retry() {
|
|
66
|
-
trackElementClicked?.("retry");
|
|
67
|
-
actor.send({ type: "RETRY" });
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
function createGovernmentValidationManager(options) {
|
|
72
|
-
return createManager({
|
|
73
|
-
actor: createGovernmentValidationActor(options),
|
|
74
|
-
mapState,
|
|
75
|
-
createApi,
|
|
76
|
-
instrumentation: createManagerInstrumentation("GOVERNMENT_VALIDATION")
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
//#endregion
|
|
81
|
-
export { createGovernmentValidationManager, governmentValidationMachine };
|
|
@@ -1,271 +0,0 @@
|
|
|
1
|
-
import { t as BrowserTimerProvider } from "./BrowserTimerProvider-DhNc_x02.esm.js";
|
|
2
|
-
import { t as api } from "./api-CESGtpbH.esm.js";
|
|
3
|
-
import { t as endpoints } from "./endpoints-CnN3SyDa.esm.js";
|
|
4
|
-
import { a as fromPromise, i as fromCallback, r as assign, t as setup } from "./xstate.esm-B70JrNqo.esm.js";
|
|
5
|
-
|
|
6
|
-
//#region src/modules/government-validation/governmentValidationServices.ts
|
|
7
|
-
async function processGovernmentValidation(signal) {
|
|
8
|
-
const res = await api.post(endpoints.governmentValidation, {}, { signal });
|
|
9
|
-
if (!res.ok) throw new Error(`POST ${endpoints.governmentValidation} failed: ${res.status} ${res.statusText}`);
|
|
10
|
-
return res.data;
|
|
11
|
-
}
|
|
12
|
-
async function submitGovernmentValidationOtp(params, signal) {
|
|
13
|
-
const res = await api.post(endpoints.governmentValidation, { otpCode: params.code }, { signal });
|
|
14
|
-
if (!res.ok) throw new Error(`POST ${endpoints.governmentValidation} (OTP) failed: ${res.status} ${res.statusText}`);
|
|
15
|
-
return res.data;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
//#endregion
|
|
19
|
-
//#region src/modules/government-validation/governmentValidationStateMachine.ts
|
|
20
|
-
const RESEND_TIMER_SECONDS = 30;
|
|
21
|
-
const POLL_INTERVAL_MS = 2e3;
|
|
22
|
-
const MAX_POLL_COUNT = 60;
|
|
23
|
-
const AUTO_PROCEED_DELAY_MS = 3e3;
|
|
24
|
-
const governmentValidationMachine = setup({
|
|
25
|
-
types: {
|
|
26
|
-
context: {},
|
|
27
|
-
events: {},
|
|
28
|
-
input: {}
|
|
29
|
-
},
|
|
30
|
-
delays: { AUTO_PROCEED: AUTO_PROCEED_DELAY_MS },
|
|
31
|
-
actors: {
|
|
32
|
-
processValidation: fromPromise(async ({ signal }) => {
|
|
33
|
-
return processGovernmentValidation(signal);
|
|
34
|
-
}),
|
|
35
|
-
submitOtp: fromPromise(async ({ input, signal }) => {
|
|
36
|
-
return submitGovernmentValidationOtp({ code: input.code }, signal);
|
|
37
|
-
}),
|
|
38
|
-
pollingTimer: fromCallback(({ sendBack }) => {
|
|
39
|
-
const timer = BrowserTimerProvider.getInstance();
|
|
40
|
-
const interval = timer.setInterval(() => {
|
|
41
|
-
sendBack({ type: "POLL" });
|
|
42
|
-
}, POLL_INTERVAL_MS);
|
|
43
|
-
return () => timer.clearInterval(interval);
|
|
44
|
-
}),
|
|
45
|
-
resendTimer: fromCallback(({ sendBack }) => {
|
|
46
|
-
const timer = BrowserTimerProvider.getInstance();
|
|
47
|
-
let seconds = RESEND_TIMER_SECONDS;
|
|
48
|
-
const interval = timer.setInterval(() => {
|
|
49
|
-
seconds -= 1;
|
|
50
|
-
sendBack({ type: "TICK" });
|
|
51
|
-
if (seconds <= 0) timer.clearInterval(interval);
|
|
52
|
-
}, 1e3);
|
|
53
|
-
return () => timer.clearInterval(interval);
|
|
54
|
-
})
|
|
55
|
-
},
|
|
56
|
-
actions: {
|
|
57
|
-
setError: assign(({ event }) => ({ error: String(event.error) })),
|
|
58
|
-
setErrorFromResponse: assign({ error: () => "Government validation failed" }),
|
|
59
|
-
setUnknownError: assign({ error: () => "Unknown validation status" }),
|
|
60
|
-
clearError: assign({ error: () => void 0 }),
|
|
61
|
-
setOtpCode: assign(({ event }) => ({
|
|
62
|
-
otpCode: event.code,
|
|
63
|
-
otpError: void 0
|
|
64
|
-
})),
|
|
65
|
-
setOtpError: assign(({ context }) => ({
|
|
66
|
-
otpError: "Invalid OTP code",
|
|
67
|
-
attemptsRemaining: context.attemptsRemaining - 1
|
|
68
|
-
})),
|
|
69
|
-
clearOtpError: assign({
|
|
70
|
-
otpError: () => void 0,
|
|
71
|
-
otpCode: () => ""
|
|
72
|
-
}),
|
|
73
|
-
startResendTimer: assign({
|
|
74
|
-
resendTimer: () => RESEND_TIMER_SECONDS,
|
|
75
|
-
resendTimerActive: () => true
|
|
76
|
-
}),
|
|
77
|
-
tickResendTimer: assign(({ context }) => {
|
|
78
|
-
const newTimer = Math.max(0, context.resendTimer - 1);
|
|
79
|
-
return {
|
|
80
|
-
resendTimer: newTimer,
|
|
81
|
-
resendTimerActive: newTimer > 0
|
|
82
|
-
};
|
|
83
|
-
}),
|
|
84
|
-
incrementPollCount: assign(({ context }) => ({ pollCount: context.pollCount + 1 })),
|
|
85
|
-
resetPollCount: assign({ pollCount: () => 0 }),
|
|
86
|
-
resetContext: assign(({ context }) => ({
|
|
87
|
-
config: context.config,
|
|
88
|
-
error: void 0,
|
|
89
|
-
otpCode: "",
|
|
90
|
-
otpError: void 0,
|
|
91
|
-
attemptsRemaining: context.config.maxOtpAttempts ?? 3,
|
|
92
|
-
resendTimer: 0,
|
|
93
|
-
resendTimerActive: false,
|
|
94
|
-
pollCount: 0
|
|
95
|
-
}))
|
|
96
|
-
},
|
|
97
|
-
guards: {
|
|
98
|
-
isProcessing: (_, params) => params.response.statusCode === -1,
|
|
99
|
-
isSuccess: (_, params) => params.response.statusCode === 0 && params.response.validationStatus?.status !== "UNKNOWN",
|
|
100
|
-
isError: (_, params) => params.response.statusCode > 0,
|
|
101
|
-
isOtpRequested: (_, params) => params.response.otpResponse?.authBridge?.otpCodeRequested === true,
|
|
102
|
-
isUnknown: (_, params) => params.response.validationStatus?.status === "UNKNOWN",
|
|
103
|
-
hasAttemptsRemaining: ({ context }) => context.attemptsRemaining > 0,
|
|
104
|
-
canResend: ({ context }) => !context.resendTimerActive,
|
|
105
|
-
hasReachedMaxPolls: ({ context }) => context.pollCount >= MAX_POLL_COUNT
|
|
106
|
-
}
|
|
107
|
-
}).createMachine({
|
|
108
|
-
id: "governmentValidation",
|
|
109
|
-
initial: "idle",
|
|
110
|
-
context: ({ input }) => ({
|
|
111
|
-
config: input.config,
|
|
112
|
-
error: void 0,
|
|
113
|
-
otpCode: "",
|
|
114
|
-
otpError: void 0,
|
|
115
|
-
attemptsRemaining: input.config.maxOtpAttempts ?? 3,
|
|
116
|
-
resendTimer: 0,
|
|
117
|
-
resendTimerActive: false,
|
|
118
|
-
pollCount: 0
|
|
119
|
-
}),
|
|
120
|
-
states: {
|
|
121
|
-
idle: { on: { LOAD: { target: "loading" } } },
|
|
122
|
-
loading: { invoke: {
|
|
123
|
-
id: "processValidation",
|
|
124
|
-
src: "processValidation",
|
|
125
|
-
onDone: [
|
|
126
|
-
{
|
|
127
|
-
target: "awaitingOtp",
|
|
128
|
-
guard: {
|
|
129
|
-
type: "isOtpRequested",
|
|
130
|
-
params: ({ event }) => ({ response: event.output })
|
|
131
|
-
}
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
target: "displaySuccess",
|
|
135
|
-
guard: {
|
|
136
|
-
type: "isSuccess",
|
|
137
|
-
params: ({ event }) => ({ response: event.output })
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
target: "polling",
|
|
142
|
-
guard: {
|
|
143
|
-
type: "isProcessing",
|
|
144
|
-
params: ({ event }) => ({ response: event.output })
|
|
145
|
-
}
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
target: "displayUnknown",
|
|
149
|
-
guard: {
|
|
150
|
-
type: "isUnknown",
|
|
151
|
-
params: ({ event }) => ({ response: event.output })
|
|
152
|
-
},
|
|
153
|
-
actions: "setUnknownError"
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
target: "displayError",
|
|
157
|
-
actions: "setErrorFromResponse"
|
|
158
|
-
}
|
|
159
|
-
],
|
|
160
|
-
onError: {
|
|
161
|
-
target: "displayError",
|
|
162
|
-
actions: "setError"
|
|
163
|
-
}
|
|
164
|
-
} },
|
|
165
|
-
polling: {
|
|
166
|
-
invoke: {
|
|
167
|
-
id: "pollingTimer",
|
|
168
|
-
src: "pollingTimer"
|
|
169
|
-
},
|
|
170
|
-
on: { POLL: [{
|
|
171
|
-
target: "displayError",
|
|
172
|
-
guard: "hasReachedMaxPolls",
|
|
173
|
-
actions: assign({ error: () => "Validation timed out" })
|
|
174
|
-
}, {
|
|
175
|
-
target: "pollingRequest",
|
|
176
|
-
actions: "incrementPollCount"
|
|
177
|
-
}] }
|
|
178
|
-
},
|
|
179
|
-
pollingRequest: { invoke: {
|
|
180
|
-
id: "pollValidation",
|
|
181
|
-
src: "processValidation",
|
|
182
|
-
onDone: [
|
|
183
|
-
{
|
|
184
|
-
target: "displaySuccess",
|
|
185
|
-
guard: {
|
|
186
|
-
type: "isSuccess",
|
|
187
|
-
params: ({ event }) => ({ response: event.output })
|
|
188
|
-
}
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
target: "polling",
|
|
192
|
-
guard: {
|
|
193
|
-
type: "isProcessing",
|
|
194
|
-
params: ({ event }) => ({ response: event.output })
|
|
195
|
-
}
|
|
196
|
-
},
|
|
197
|
-
{
|
|
198
|
-
target: "displayUnknown",
|
|
199
|
-
guard: {
|
|
200
|
-
type: "isUnknown",
|
|
201
|
-
params: ({ event }) => ({ response: event.output })
|
|
202
|
-
},
|
|
203
|
-
actions: "setUnknownError"
|
|
204
|
-
},
|
|
205
|
-
{
|
|
206
|
-
target: "displayError",
|
|
207
|
-
actions: "setErrorFromResponse"
|
|
208
|
-
}
|
|
209
|
-
],
|
|
210
|
-
onError: {
|
|
211
|
-
target: "displayError",
|
|
212
|
-
actions: "setError"
|
|
213
|
-
}
|
|
214
|
-
} },
|
|
215
|
-
awaitingOtp: {
|
|
216
|
-
entry: "startResendTimer",
|
|
217
|
-
invoke: {
|
|
218
|
-
id: "resendTimer",
|
|
219
|
-
src: "resendTimer"
|
|
220
|
-
},
|
|
221
|
-
on: {
|
|
222
|
-
TICK: { actions: "tickResendTimer" },
|
|
223
|
-
OTP_CHANGED: { actions: "setOtpCode" },
|
|
224
|
-
SUBMIT_OTP: { target: "verifyingOtp" },
|
|
225
|
-
RESEND_OTP: {
|
|
226
|
-
target: "loading",
|
|
227
|
-
guard: "canResend"
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
},
|
|
231
|
-
verifyingOtp: { invoke: {
|
|
232
|
-
id: "submitOtp",
|
|
233
|
-
src: "submitOtp",
|
|
234
|
-
input: ({ context }) => ({ code: context.otpCode }),
|
|
235
|
-
onDone: [
|
|
236
|
-
{
|
|
237
|
-
target: "displaySuccess",
|
|
238
|
-
guard: {
|
|
239
|
-
type: "isSuccess",
|
|
240
|
-
params: ({ event }) => ({ response: event.output })
|
|
241
|
-
}
|
|
242
|
-
},
|
|
243
|
-
{
|
|
244
|
-
target: "awaitingOtp",
|
|
245
|
-
guard: "hasAttemptsRemaining",
|
|
246
|
-
actions: "setOtpError"
|
|
247
|
-
},
|
|
248
|
-
{
|
|
249
|
-
target: "displayError",
|
|
250
|
-
actions: assign({ error: () => "Maximum OTP attempts exceeded" })
|
|
251
|
-
}
|
|
252
|
-
],
|
|
253
|
-
onError: [{
|
|
254
|
-
target: "awaitingOtp",
|
|
255
|
-
guard: "hasAttemptsRemaining",
|
|
256
|
-
actions: "setOtpError"
|
|
257
|
-
}, {
|
|
258
|
-
target: "displayError",
|
|
259
|
-
actions: "setError"
|
|
260
|
-
}]
|
|
261
|
-
} },
|
|
262
|
-
displaySuccess: { after: { AUTO_PROCEED: { target: "finished" } } },
|
|
263
|
-
displayProcessing: { after: { AUTO_PROCEED: { target: "finished" } } },
|
|
264
|
-
displayError: { after: { AUTO_PROCEED: { target: "finished" } } },
|
|
265
|
-
displayUnknown: { after: { AUTO_PROCEED: { target: "finished" } } },
|
|
266
|
-
finished: { type: "final" }
|
|
267
|
-
}
|
|
268
|
-
});
|
|
269
|
-
|
|
270
|
-
//#endregion
|
|
271
|
-
export { governmentValidationMachine as t };
|
package/dist/home.d.ts
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { t as Manager } from "./Manager-C8PrhBOx.js";
|
|
2
|
-
import "./camera-DBSxa6ML.js";
|
|
3
|
-
import "./types-CFV9G_7j.js";
|
|
4
|
-
import { t as EmptyConfig } from "./types-BP1m8VRw.js";
|
|
5
|
-
import * as xstate0 from "xstate";
|
|
6
|
-
|
|
7
|
-
//#region src/modules/home/types.d.ts
|
|
8
|
-
type HomeConfig = EmptyConfig;
|
|
9
|
-
//#endregion
|
|
10
|
-
//#region src/modules/home/homeManager.d.ts
|
|
11
|
-
type HomeIdleState = {
|
|
12
|
-
status: 'idle';
|
|
13
|
-
};
|
|
14
|
-
type HomeMainState = {
|
|
15
|
-
status: 'main';
|
|
16
|
-
};
|
|
17
|
-
type HomeFinishedState = {
|
|
18
|
-
status: 'finished';
|
|
19
|
-
};
|
|
20
|
-
type HomeState = HomeIdleState | HomeMainState | HomeFinishedState;
|
|
21
|
-
declare function createHomeManager(options?: {
|
|
22
|
-
config?: HomeConfig;
|
|
23
|
-
}): Manager<HomeState> & {
|
|
24
|
-
load(): void;
|
|
25
|
-
complete(): void;
|
|
26
|
-
reset(): void;
|
|
27
|
-
};
|
|
28
|
-
type HomeManager = ReturnType<typeof createHomeManager>;
|
|
29
|
-
//#endregion
|
|
30
|
-
//#region src/modules/home/homeStateMachine.d.ts
|
|
31
|
-
type HomeContext = {
|
|
32
|
-
config: EmptyConfig;
|
|
33
|
-
};
|
|
34
|
-
type HomeInput = {
|
|
35
|
-
config: EmptyConfig;
|
|
36
|
-
};
|
|
37
|
-
declare const homeMachine: xstate0.StateMachine<HomeContext, {
|
|
38
|
-
type: "LOAD";
|
|
39
|
-
} | {
|
|
40
|
-
type: "COMPLETE";
|
|
41
|
-
} | {
|
|
42
|
-
type: "RESET";
|
|
43
|
-
}, {}, never, never, never, never, "idle" | "finished" | "main", string, HomeInput, xstate0.NonReducibleUnknown, xstate0.EventObject, xstate0.MetaObject, {
|
|
44
|
-
readonly id: "home";
|
|
45
|
-
readonly initial: "idle";
|
|
46
|
-
readonly context: ({
|
|
47
|
-
input
|
|
48
|
-
}: {
|
|
49
|
-
spawn: {
|
|
50
|
-
<TSrc extends never>(logic: TSrc, ...[options]: never): xstate0.ActorRefFromLogic<never>;
|
|
51
|
-
<TLogic extends xstate0.AnyActorLogic>(src: TLogic, ...[options]: xstate0.ConditionalRequired<[options?: ({
|
|
52
|
-
id?: never;
|
|
53
|
-
systemId?: string;
|
|
54
|
-
input?: xstate0.InputFrom<TLogic> | undefined;
|
|
55
|
-
syncSnapshot?: boolean;
|
|
56
|
-
} & { [K in xstate0.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate0.IsNotNever<xstate0.RequiredLogicInput<TLogic>>>): xstate0.ActorRefFromLogic<TLogic>;
|
|
57
|
-
};
|
|
58
|
-
input: HomeInput;
|
|
59
|
-
self: xstate0.ActorRef<xstate0.MachineSnapshot<HomeContext, {
|
|
60
|
-
type: "LOAD";
|
|
61
|
-
} | {
|
|
62
|
-
type: "COMPLETE";
|
|
63
|
-
} | {
|
|
64
|
-
type: "RESET";
|
|
65
|
-
}, Record<string, xstate0.AnyActorRef | undefined>, xstate0.StateValue, string, unknown, any, any>, {
|
|
66
|
-
type: "LOAD";
|
|
67
|
-
} | {
|
|
68
|
-
type: "COMPLETE";
|
|
69
|
-
} | {
|
|
70
|
-
type: "RESET";
|
|
71
|
-
}, xstate0.AnyEventObject>;
|
|
72
|
-
}) => {
|
|
73
|
-
config: EmptyConfig;
|
|
74
|
-
};
|
|
75
|
-
readonly states: {
|
|
76
|
-
readonly idle: {
|
|
77
|
-
readonly on: {
|
|
78
|
-
readonly LOAD: {
|
|
79
|
-
readonly target: "main";
|
|
80
|
-
};
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
readonly main: {
|
|
84
|
-
readonly on: {
|
|
85
|
-
readonly COMPLETE: {
|
|
86
|
-
readonly target: "finished";
|
|
87
|
-
};
|
|
88
|
-
readonly RESET: {
|
|
89
|
-
readonly target: "idle";
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
|
-
};
|
|
93
|
-
readonly finished: {
|
|
94
|
-
readonly type: "final";
|
|
95
|
-
};
|
|
96
|
-
};
|
|
97
|
-
}>;
|
|
98
|
-
//#endregion
|
|
99
|
-
export { type HomeConfig, type HomeManager, type HomeState, createHomeManager, homeMachine };
|
package/dist/home.esm.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import "./api-CESGtpbH.esm.js";
|
|
2
|
-
import { 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/home/homeStateMachine.ts
|
|
6
|
-
const homeMachine = setup({ types: {
|
|
7
|
-
context: {},
|
|
8
|
-
events: {},
|
|
9
|
-
input: {}
|
|
10
|
-
} }).createMachine({
|
|
11
|
-
id: "home",
|
|
12
|
-
initial: "idle",
|
|
13
|
-
context: ({ input }) => ({ config: input.config }),
|
|
14
|
-
states: {
|
|
15
|
-
idle: { on: { LOAD: { target: "main" } } },
|
|
16
|
-
main: { on: {
|
|
17
|
-
COMPLETE: { target: "finished" },
|
|
18
|
-
RESET: { target: "idle" }
|
|
19
|
-
} },
|
|
20
|
-
finished: { type: "final" }
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
//#endregion
|
|
25
|
-
//#region src/modules/home/homeActor.ts
|
|
26
|
-
function createHomeActor(options = {}) {
|
|
27
|
-
return createActor(homeMachine, { input: { config: options.config ?? {} } }).start();
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
//#endregion
|
|
31
|
-
//#region src/modules/home/homeManager.ts
|
|
32
|
-
function mapState(snapshot) {
|
|
33
|
-
const typedSnapshot = snapshot;
|
|
34
|
-
if (typedSnapshot.matches("main")) return { status: "main" };
|
|
35
|
-
if (typedSnapshot.matches("finished")) return { status: "finished" };
|
|
36
|
-
return { status: "idle" };
|
|
37
|
-
}
|
|
38
|
-
function createApi({ actor }) {
|
|
39
|
-
return {
|
|
40
|
-
load() {
|
|
41
|
-
actor.send({ type: "LOAD" });
|
|
42
|
-
},
|
|
43
|
-
complete() {
|
|
44
|
-
actor.send({ type: "COMPLETE" });
|
|
45
|
-
},
|
|
46
|
-
reset() {
|
|
47
|
-
actor.send({ type: "RESET" });
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
function createHomeManager(options = {}) {
|
|
52
|
-
return createManager({
|
|
53
|
-
actor: createHomeActor({ config: options.config }),
|
|
54
|
-
mapState,
|
|
55
|
-
createApi,
|
|
56
|
-
instrumentation: createManagerInstrumentation("HOME")
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
//#endregion
|
|
61
|
-
export { createHomeManager, homeMachine };
|
package/dist/http.d.ts
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
//#region ../infra/src/http/types.d.ts
|
|
2
|
-
|
|
3
|
-
type RequestConfig = {
|
|
4
|
-
method?: string;
|
|
5
|
-
url: string;
|
|
6
|
-
headers?: Record<string, string>;
|
|
7
|
-
query?: Record<string, string | number | boolean | undefined>;
|
|
8
|
-
params?: Record<string, string | number | boolean | undefined>;
|
|
9
|
-
body?: unknown;
|
|
10
|
-
signal?: AbortSignal;
|
|
11
|
-
timeout?: number;
|
|
12
|
-
parse?: 'json' | 'text' | 'blob' | 'arrayBuffer' | 'response';
|
|
13
|
-
onUploadProgress?: (progress: number) => void;
|
|
14
|
-
keepalive?: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* Transport-internal flag: the request body has already been inline-
|
|
17
|
-
* encrypted by C++ `SessionEncryptor` (used only by the on-device face-
|
|
18
|
-
* results path). When true, `createWasmApi` attaches the SHA-256 OAEP
|
|
19
|
-
* scheme header so the server can unwrap the embedded AES key, and
|
|
20
|
-
* forwards the flag to the WASM WebClient so it does not double-encrypt.
|
|
21
|
-
* Ignored by non-WASM transports.
|
|
22
|
-
*/
|
|
23
|
-
ie?: boolean;
|
|
24
|
-
};
|
|
25
|
-
type HttpResponse<T = unknown> = {
|
|
26
|
-
ok: boolean;
|
|
27
|
-
status: number;
|
|
28
|
-
statusText: string;
|
|
29
|
-
url: string;
|
|
30
|
-
headers: Record<string, string>;
|
|
31
|
-
data: T;
|
|
32
|
-
};
|
|
33
|
-
type HttpClient = {
|
|
34
|
-
defaults: {
|
|
35
|
-
baseURL: string;
|
|
36
|
-
headers: Record<string, string>;
|
|
37
|
-
};
|
|
38
|
-
request<T = unknown>(config: RequestConfig): Promise<HttpResponse<T>>;
|
|
39
|
-
get<T = unknown>(url: string, config?: Omit<RequestConfig, 'method' | 'url'>): Promise<HttpResponse<T>>;
|
|
40
|
-
post<T = unknown>(url: string, body?: unknown, config?: Omit<RequestConfig, 'method' | 'url' | 'body'>): Promise<HttpResponse<T>>;
|
|
41
|
-
put<T = unknown>(url: string, body?: unknown, config?: Omit<RequestConfig, 'method' | 'url' | 'body'>): Promise<HttpResponse<T>>;
|
|
42
|
-
patch<T = unknown>(url: string, body?: unknown, config?: Omit<RequestConfig, 'method' | 'url' | 'body'>): Promise<HttpResponse<T>>;
|
|
43
|
-
delete<T = unknown>(url: string, config?: Omit<RequestConfig, 'method' | 'url'>): Promise<HttpResponse<T>>;
|
|
44
|
-
head<T = unknown>(url: string, config?: Omit<RequestConfig, 'method' | 'url'>): Promise<HttpResponse<T>>;
|
|
45
|
-
options<T = unknown>(url: string, config?: Omit<RequestConfig, 'method' | 'url'>): Promise<HttpResponse<T>>;
|
|
46
|
-
setHeader(name: string, value: string): void;
|
|
47
|
-
};
|
|
48
|
-
//#endregion
|
|
49
|
-
//#region src/internal/http/api.d.ts
|
|
50
|
-
type MethodConfig = {
|
|
51
|
-
headers?: Record<string, string>;
|
|
52
|
-
signal?: AbortSignal;
|
|
53
|
-
timeout?: number;
|
|
54
|
-
query?: Record<string, string | number | boolean | undefined>;
|
|
55
|
-
onUploadProgress?: (progress: number) => void;
|
|
56
|
-
keepalive?: boolean;
|
|
57
|
-
};
|
|
58
|
-
type ApiClient = {
|
|
59
|
-
get<T>(url: string, config?: MethodConfig): Promise<HttpResponse<T>>;
|
|
60
|
-
post<T>(url: string, data?: unknown, config?: MethodConfig): Promise<HttpResponse<T>>;
|
|
61
|
-
put<T>(url: string, data?: unknown, config?: MethodConfig): Promise<HttpResponse<T>>;
|
|
62
|
-
patch<T>(url: string, data?: unknown, config?: MethodConfig): Promise<HttpResponse<T>>;
|
|
63
|
-
delete<T>(url: string, config?: MethodConfig): Promise<HttpResponse<T>>;
|
|
64
|
-
};
|
|
65
|
-
declare function getApi(): HttpClient;
|
|
66
|
-
declare const api: ApiClient;
|
|
67
|
-
//#endregion
|
|
68
|
-
export { api, getApi };
|
package/dist/http.esm.js
DELETED