@incodetech/core 0.0.0-dev-20260617-8a69e08c → 0.0.0-dev-20260617-7cc8f894
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/{OpenViduRecordingProvider-BDIlX9Cq.esm.js → OpenViduRecordingProvider-DF7A4ZNJ.esm.js} +1 -1
- package/dist/{StreamCanvasCapture-uQFmjDCE.d.ts → StreamCanvasCapture-CDN2Apbm.d.ts} +1 -1
- package/dist/ae-signature.d.ts +3 -3
- package/dist/antifraud.d.ts +3 -3
- package/dist/{antifraudManager-vkuogwAe.d.ts → antifraudManager-DbrsuESv.d.ts} +2 -2
- package/dist/authentication.d.ts +13 -13
- package/dist/authentication.esm.js +5 -5
- package/dist/{authenticationManager-Dz4IJIrK.esm.js → authenticationManager-DVgli_vD.esm.js} +1 -1
- package/dist/{authenticationManager-CDxVMHF1.d.ts → authenticationManager-DnOZ0hIZ.d.ts} +2 -2
- package/dist/{authenticationStateMachine-ZqIWl4M4.esm.js → authenticationStateMachine-PtGChFaq.esm.js} +15 -18
- package/dist/camera.d.ts +1 -1
- package/dist/certificate-issuance.d.ts +30 -30
- package/dist/consent.d.ts +3 -3
- package/dist/{consentManager-WjRO-QwM.d.ts → consentManager-CDgMJdcr.d.ts} +49 -49
- package/dist/cpf-ocr.d.ts +3 -3
- package/dist/{cpfOcrManager-DV-v9XjQ.d.ts → cpfOcrManager-D3lUVFbI.d.ts} +19 -19
- package/dist/cross-document-data-match.d.ts +1 -1
- package/dist/curp-validation.d.ts +7 -7
- package/dist/{curpValidationManager-CeXO_2dN.d.ts → curpValidationManager-Cmv2orSI.d.ts} +3 -3
- package/dist/custom-fields.d.ts +2 -2
- package/dist/custom-watchlist.d.ts +1 -1
- package/dist/{deepsightService-BpVpDm2O.d.ts → deepsightService-DpHuyW3G.d.ts} +1 -1
- package/dist/document-capture.d.ts +235 -235
- package/dist/document-upload.d.ts +47 -47
- package/dist/dynamic-forms.d.ts +2 -2
- package/dist/dynamic-forms.esm.js +5 -282
- package/dist/dynamicFormsStateMachine-p7MuNqYk.esm.js +284 -0
- package/dist/ekyb.d.ts +6 -6
- package/dist/ekyb.esm.js +5 -5
- package/dist/{ekybStateMachine-LYbmoerq.esm.js → ekybStateMachine-CRSuNnsu.esm.js} +2 -2
- package/dist/ekyc.d.ts +3 -3
- package/dist/ekyc.esm.js +2 -2
- package/dist/{ekycStateMachine-dXnYshTa.esm.js → ekycStateMachine-BqzVRrZz.esm.js} +1 -1
- package/dist/electronic-signature.d.ts +3 -3
- package/dist/email.d.ts +4 -4
- package/dist/email.esm.js +3 -3
- package/dist/{emailManager-DLFWfHIl.d.ts → emailManager-DbZkzbPP.d.ts} +3 -3
- package/dist/{emailManager-DQJIAsix.esm.js → emailManager-DfgCL3O0.esm.js} +2 -2
- package/dist/{emailStateMachine-C1DabizS.esm.js → emailStateMachine-DWzBDO0i.esm.js} +1 -1
- package/dist/extensibility.d.ts +26 -26
- package/dist/extensibility.esm.js +23 -23
- package/dist/face-match.d.ts +1 -1
- package/dist/face-match.esm.js +1 -1
- package/dist/{faceCaptureManagerFactory-BQg4HVQ0.d.ts → faceCaptureManagerFactory-B2Vhybvk.d.ts} +10 -9
- package/dist/{faceCaptureSetup-B2H2mNGa.esm.js → faceCaptureSetup-D3yv2HY3.esm.js} +2 -2
- package/dist/field-comparison.d.ts +3 -3
- package/dist/field-comparison.esm.js +1 -1
- package/dist/{fieldComparisonManager-CgJctoEw.d.ts → fieldComparisonManager-6YiDreZW.d.ts} +2 -2
- package/dist/fiscal-qr.d.ts +3 -3
- package/dist/fiscal-qr.esm.js +1 -1
- package/dist/flow-events.d.ts +6 -6
- package/dist/flow.d.ts +12 -12
- package/dist/flow.esm.js +6 -6
- package/dist/{flowServices-D_FMT6Fi.esm.js → flowServices-BLUYSdW9.esm.js} +1 -1
- package/dist/geolocation.d.ts +2 -2
- package/dist/geolocation.esm.js +1 -1
- package/dist/government-validation.d.ts +3 -3
- package/dist/government-validation.esm.js +2 -2
- package/dist/{governmentValidationStateMachine-DXqbvuKL.esm.js → governmentValidationStateMachine-CC_MEsWI.esm.js} +1 -1
- package/dist/home.d.ts +15 -15
- package/dist/http.esm.js +1 -1
- package/dist/id-ocr.d.ts +2 -2
- package/dist/id-ocr.esm.js +1 -1
- package/dist/id-verification.d.ts +27 -27
- package/dist/id-verification.esm.js +1 -1
- package/dist/id.d.ts +12 -12
- package/dist/id.esm.js +7 -7
- package/dist/{idCaptureManager-k5tfqV1x.esm.js → idCaptureManager-BsyVVBx7.esm.js} +1 -1
- package/dist/{idCaptureManager-Wn84cPTa.d.ts → idCaptureManager-CV3Tioi4.d.ts} +8 -8
- package/dist/{idCaptureStateMachine-BY5csicv.esm.js → idCaptureStateMachine-DQkygy-A.esm.js} +4 -4
- package/dist/identity-reuse.d.ts +3 -3
- package/dist/identity-reuse.esm.js +2 -2
- package/dist/{identityReuseManager-Bew667Pj.esm.js → identityReuseManager-CqBkUE4l.esm.js} +1 -1
- package/dist/{identityReuseManager-ByGgS8ML.d.ts → identityReuseManager-Dei197Hq.d.ts} +33 -33
- package/dist/{index-Bna2s_tk.d.ts → index-BFqpqVT2.d.ts} +169 -169
- package/dist/{index-cIuvyWMa.d.ts → index-DCwyzc5q.d.ts} +2 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.esm.js +3 -3
- package/dist/mandatory-consent.d.ts +7 -7
- package/dist/mandatory-consent.esm.js +2 -2
- package/dist/{mandatoryConsentManager-DDs8TlGY.d.ts → mandatoryConsentManager-BJRO5-0a.d.ts} +50 -50
- package/dist/{mandatoryConsentManager-kbO0Dr65.esm.js → mandatoryConsentManager-Qub7zBH8.esm.js} +1 -1
- package/dist/openviduLazy-B_s6jnEk.esm.js +3 -0
- package/dist/{openviduLazy-BapX8Ljx.esm.js → openviduLazy-oAXXI9w_.esm.js} +1 -1
- package/dist/phone.d.ts +4 -4
- package/dist/phone.esm.js +3 -3
- package/dist/{phoneManager-CZA4CST1.esm.js → phoneManager-ApM3CWwR.esm.js} +2 -2
- package/dist/{phoneManager-CkEiuAuM.d.ts → phoneManager-h6NgdQCA.d.ts} +3 -3
- package/dist/{phoneStateMachine-BQNuJGjq.esm.js → phoneStateMachine-Nn0ifgsM.esm.js} +1 -1
- package/dist/qe-signature.d.ts +3 -3
- package/dist/qe-signature.esm.js +1 -1
- package/dist/{recordingService-Cw3hJgT2.esm.js → recordingService-D6wX1gjP.esm.js} +5 -5
- package/dist/redirect-to-mobile.d.ts +3 -3
- package/dist/redirect-to-mobile.esm.js +2 -2
- package/dist/{redirectToMobileManager-B4PTmB3H.esm.js → redirectToMobileManager-Bw0Dew2v.esm.js} +1 -1
- package/dist/{redirectToMobileManager-DYQsXMqo.d.ts → redirectToMobileManager-DYv4-nNn.d.ts} +2 -2
- package/dist/{runChildModule-DaOsL9FE.esm.js → runChildModule-BGecSlg0.esm.js} +8 -21
- package/dist/selfie.d.ts +13 -13
- package/dist/selfie.esm.js +6 -6
- package/dist/{selfieManager-CxktnRiy.d.ts → selfieManager-BjwgTTSs.d.ts} +2 -2
- package/dist/{selfieManager-MGv9xxlB.esm.js → selfieManager-DgUgks9i.esm.js} +1 -1
- package/dist/{selfieStateMachine-DIep8sRA.esm.js → selfieStateMachine-YDCX3Ew4.esm.js} +3 -3
- package/dist/session.d.ts +5 -5
- package/dist/session.esm.js +3 -3
- package/dist/{sessionInitializer-CMFY9E5w.esm.js → sessionInitializer-zHt8j5xW.esm.js} +1 -1
- package/dist/{setup-CuLzlVAN.esm.js → setup-BqOF4vbP.esm.js} +2 -2
- package/dist/{setup-CbuQnURW.d.ts → setup-DHGBjYDo.d.ts} +2 -2
- package/dist/signature.d.ts +2 -2
- package/dist/signature.esm.js +1 -1
- package/dist/{tri-BO556jKl.esm.js → tri-Dm8DCwTc.esm.js} +1 -1
- package/dist/tri.d.ts +1 -1
- package/dist/{tri.esm-Drm5tKql.esm.js → tri.esm-Cb1T14_N.esm.js} +1 -1
- package/dist/tri.esm.js +1 -1
- package/dist/trust-graph.d.ts +3 -3
- package/dist/{types-C3Yf5jrM.esm.js → types-BdVOWGGW.esm.js} +2 -1
- package/dist/{types-CNiMvUpA.d.ts → types-Cjx73NNd.d.ts} +1 -1
- package/dist/{types-D8y52YD5.d.ts → types-Dv-9WPJX.d.ts} +2 -2
- package/dist/{types-DR2YKE_o.d.ts → types-Z9wv19v2.d.ts} +1 -1
- package/dist/wasm.d.ts +3 -3
- package/dist/wasm.esm.js +3 -3
- package/dist/watchlist-for-business.d.ts +1 -1
- package/dist/watchlist-for-business.esm.js +1 -1
- package/dist/watchlist.d.ts +1 -1
- package/dist/watchlist.esm.js +1 -1
- package/dist/workflow.d.ts +94 -94
- package/dist/workflow.esm.js +33 -30
- package/package.json +1 -1
- package/dist/openviduLazy--VDjpeVq.esm.js +0 -3
- /package/dist/{Actor-CeqUTqL9.d.ts → Actor-fIPLXfoi.d.ts} +0 -0
- /package/dist/{Manager-CHiHBvMT.d.ts → Manager-Dsj-sPxS.d.ts} +0 -0
- /package/dist/{StateMachine-HpHVxl3G.d.ts → StateMachine-BIfEYukU.d.ts} +0 -0
- /package/dist/{addressSearch-4xxBiFtH.esm.js → addressSearch-Byq4gwCN.esm.js} +0 -0
- /package/dist/{browser-8Za96B1X-CUY3snMa.esm.js → browser-8Za96B1X-2HhouIRF.esm.js} +0 -0
- /package/dist/{camera-D0c7ez3w.d.ts → camera-biGPWlmx.d.ts} +0 -0
- /package/dist/{deepsightLoader-cR0EgL9O.esm.js → deepsightLoader-D8lOvUfM.esm.js} +0 -0
- /package/dist/{faceMatchStateMachine-eQOGyK1R.esm.js → faceMatchStateMachine-BzP_cdwX.esm.js} +0 -0
- /package/dist/{fieldComparisonManager-IaJfvmEt.esm.js → fieldComparisonManager-m1j9K66T.esm.js} +0 -0
- /package/dist/{flowCompletionService-DSPt5J5M.d.ts → flowCompletionService-BAFssHBk.d.ts} +0 -0
- /package/dist/{flowCompletionService-D9l6fDFY.esm.js → flowCompletionService-Y1UICFg1.esm.js} +0 -0
- /package/dist/{geolocationStateMachine-CB4yyRz1.esm.js → geolocationStateMachine-BRas1Frw.esm.js} +0 -0
- /package/dist/{http-B2UWIXGr.esm.js → http-CfVTgMfU.esm.js} +0 -0
- /package/dist/{idOcrStateMachine-BwksZ-bt.esm.js → idOcrStateMachine-DBR2PV3V.esm.js} +0 -0
- /package/dist/{idVerificationStateMachine-BMzgkkbQ.esm.js → idVerificationStateMachine-9pEdKmP9.esm.js} +0 -0
- /package/dist/{identityReuseStateMachine-CbR5itoo.esm.js → identityReuseStateMachine-Mhf3pwuo.esm.js} +0 -0
- /package/dist/{index-B6TAFzyx.d.ts → index-Cu5ZqstL.d.ts} +0 -0
- /package/dist/{invokeOnCaptureCallback-DyJrH089.esm.js → invokeOnCaptureCallback-BlFdnfoh.esm.js} +0 -0
- /package/dist/{lib-DOI53AqI.esm.js → lib-7ZQ9BdKH.esm.js} +0 -0
- /package/dist/{mandatoryConsentStateMachine-DtjGqH2e.esm.js → mandatoryConsentStateMachine-OCd0A55c.esm.js} +0 -0
- /package/dist/{otp-BHJnjEEc.d.ts → otp-BwLdGT6f.d.ts} +0 -0
- /package/dist/{otp-BcSa5nTM.esm.js → otp-D87RTwrx.esm.js} +0 -0
- /package/dist/{qe-signature-BVUV3TE_.esm.js → qe-signature-D6-Qpyfo.esm.js} +0 -0
- /package/dist/{redirectToMobileStateMachine-BWrpS_sN.esm.js → redirectToMobileStateMachine-60oeuo-V.esm.js} +0 -0
- /package/dist/{session-C_G3d7av.esm.js → session-Da435G0o.esm.js} +0 -0
- /package/dist/{signatureStateMachine-B7hxdXio.esm.js → signatureStateMachine-BTkVm04g.esm.js} +0 -0
- /package/dist/{types-F0IXbaCB.d.ts → types-D3dxOdyZ.d.ts} +0 -0
- /package/dist/{types-C1ixFPzO.d.ts → types-DYZja-k9.d.ts} +0 -0
- /package/dist/{warmup-CdT_pVcp.d.ts → warmup--6HA3yUR.d.ts} +0 -0
- /package/dist/{watchlistForBusinessStateMachine-D3W0_TEt.esm.js → watchlistForBusinessStateMachine-fEpRdtnj.esm.js} +0 -0
- /package/dist/{watchlistStateMachine-D8EXhr5W.esm.js → watchlistStateMachine-C92XRtlP.esm.js} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { t as Manager } from "./Manager-
|
|
2
|
-
import "./Actor-
|
|
3
|
-
import "./camera-
|
|
4
|
-
import { n as DocumentUploadContext, r as DocumentUploadInput, t as DocumentUploadConfig } from "./types-
|
|
5
|
-
import * as
|
|
1
|
+
import { t as Manager } from "./Manager-Dsj-sPxS.js";
|
|
2
|
+
import "./Actor-fIPLXfoi.js";
|
|
3
|
+
import "./camera-biGPWlmx.js";
|
|
4
|
+
import { n as DocumentUploadContext, r as DocumentUploadInput, t as DocumentUploadConfig } from "./types-Z9wv19v2.js";
|
|
5
|
+
import * as xstate1141 from "xstate";
|
|
6
6
|
|
|
7
7
|
//#region src/modules/document-upload/documentUploadStateMachine.d.ts
|
|
8
|
-
declare const documentUploadMachine:
|
|
8
|
+
declare const documentUploadMachine: xstate1141.StateMachine<DocumentUploadContext, {
|
|
9
9
|
type: "START";
|
|
10
10
|
} | {
|
|
11
11
|
type: "CAPTURE";
|
|
@@ -18,52 +18,52 @@ declare const documentUploadMachine: xstate512.StateMachine<DocumentUploadContex
|
|
|
18
18
|
} | {
|
|
19
19
|
type: "CLOSE";
|
|
20
20
|
}, {
|
|
21
|
-
[x: string]:
|
|
21
|
+
[x: string]: xstate1141.ActorRefFromLogic<xstate1141.PromiseActorLogic<MediaStream, void, xstate1141.EventObject>> | xstate1141.ActorRefFromLogic<xstate1141.PromiseActorLogic<void, {
|
|
22
22
|
imageBase64: string;
|
|
23
23
|
documentType: string;
|
|
24
24
|
onProgress: (progress: number) => void;
|
|
25
|
-
},
|
|
26
|
-
},
|
|
25
|
+
}, xstate1141.EventObject>> | undefined;
|
|
26
|
+
}, xstate1141.Values<{
|
|
27
27
|
uploadDocument: {
|
|
28
28
|
src: "uploadDocument";
|
|
29
|
-
logic:
|
|
29
|
+
logic: xstate1141.PromiseActorLogic<void, {
|
|
30
30
|
imageBase64: string;
|
|
31
31
|
documentType: string;
|
|
32
32
|
onProgress: (progress: number) => void;
|
|
33
|
-
},
|
|
33
|
+
}, xstate1141.EventObject>;
|
|
34
34
|
id: string | undefined;
|
|
35
35
|
};
|
|
36
36
|
initCamera: {
|
|
37
37
|
src: "initCamera";
|
|
38
|
-
logic:
|
|
38
|
+
logic: xstate1141.PromiseActorLogic<MediaStream, void, xstate1141.EventObject>;
|
|
39
39
|
id: string | undefined;
|
|
40
40
|
};
|
|
41
|
-
}>,
|
|
41
|
+
}>, xstate1141.Values<{
|
|
42
42
|
setError: {
|
|
43
43
|
type: "setError";
|
|
44
|
-
params:
|
|
44
|
+
params: xstate1141.NonReducibleUnknown;
|
|
45
45
|
};
|
|
46
46
|
setStream: {
|
|
47
47
|
type: "setStream";
|
|
48
|
-
params:
|
|
49
|
-
};
|
|
50
|
-
setImageAndClearError: {
|
|
51
|
-
type: "setImageAndClearError";
|
|
52
|
-
params: xstate512.NonReducibleUnknown;
|
|
48
|
+
params: xstate1141.NonReducibleUnknown;
|
|
53
49
|
};
|
|
54
50
|
setProgress: {
|
|
55
51
|
type: "setProgress";
|
|
56
|
-
params:
|
|
52
|
+
params: xstate1141.NonReducibleUnknown;
|
|
57
53
|
};
|
|
58
54
|
clearError: {
|
|
59
55
|
type: "clearError";
|
|
60
|
-
params:
|
|
56
|
+
params: xstate1141.NonReducibleUnknown;
|
|
61
57
|
};
|
|
62
58
|
stopStream: {
|
|
63
59
|
type: "stopStream";
|
|
64
|
-
params:
|
|
60
|
+
params: xstate1141.NonReducibleUnknown;
|
|
61
|
+
};
|
|
62
|
+
setImageAndClearError: {
|
|
63
|
+
type: "setImageAndClearError";
|
|
64
|
+
params: xstate1141.NonReducibleUnknown;
|
|
65
65
|
};
|
|
66
|
-
}>, never, never, "error" | "idle" | "uploading" | "closed" | "finished" | "initCamera" | "capturing", string, DocumentUploadInput,
|
|
66
|
+
}>, never, never, "error" | "idle" | "uploading" | "closed" | "finished" | "initCamera" | "capturing", string, DocumentUploadInput, xstate1141.NonReducibleUnknown, xstate1141.EventObject, xstate1141.MetaObject, {
|
|
67
67
|
readonly id: "documentUpload";
|
|
68
68
|
readonly initial: "idle";
|
|
69
69
|
readonly context: ({
|
|
@@ -72,67 +72,67 @@ declare const documentUploadMachine: xstate512.StateMachine<DocumentUploadContex
|
|
|
72
72
|
spawn: {
|
|
73
73
|
<TSrc extends "uploadDocument" | "initCamera">(logic: TSrc, ...[options]: ({
|
|
74
74
|
src: "uploadDocument";
|
|
75
|
-
logic:
|
|
75
|
+
logic: xstate1141.PromiseActorLogic<void, {
|
|
76
76
|
imageBase64: string;
|
|
77
77
|
documentType: string;
|
|
78
78
|
onProgress: (progress: number) => void;
|
|
79
|
-
},
|
|
79
|
+
}, xstate1141.EventObject>;
|
|
80
80
|
id: string | undefined;
|
|
81
81
|
} extends infer T ? T extends {
|
|
82
82
|
src: "uploadDocument";
|
|
83
|
-
logic:
|
|
83
|
+
logic: xstate1141.PromiseActorLogic<void, {
|
|
84
84
|
imageBase64: string;
|
|
85
85
|
documentType: string;
|
|
86
86
|
onProgress: (progress: number) => void;
|
|
87
|
-
},
|
|
87
|
+
}, xstate1141.EventObject>;
|
|
88
88
|
id: string | undefined;
|
|
89
89
|
} ? T extends {
|
|
90
90
|
src: TSrc;
|
|
91
|
-
} ?
|
|
91
|
+
} ? xstate1141.ConditionalRequired<[options?: ({
|
|
92
92
|
id?: T["id"] | undefined;
|
|
93
93
|
systemId?: string;
|
|
94
|
-
input?:
|
|
94
|
+
input?: xstate1141.InputFrom<T["logic"]> | undefined;
|
|
95
95
|
syncSnapshot?: boolean;
|
|
96
|
-
} & { [K in
|
|
96
|
+
} & { [K in xstate1141.RequiredActorOptions<T>]: unknown }) | undefined], xstate1141.IsNotNever<xstate1141.RequiredActorOptions<T>>> : never : never : never) | ({
|
|
97
97
|
src: "initCamera";
|
|
98
|
-
logic:
|
|
98
|
+
logic: xstate1141.PromiseActorLogic<MediaStream, void, xstate1141.EventObject>;
|
|
99
99
|
id: string | undefined;
|
|
100
100
|
} extends infer T_1 ? T_1 extends {
|
|
101
101
|
src: "initCamera";
|
|
102
|
-
logic:
|
|
102
|
+
logic: xstate1141.PromiseActorLogic<MediaStream, void, xstate1141.EventObject>;
|
|
103
103
|
id: string | undefined;
|
|
104
104
|
} ? T_1 extends {
|
|
105
105
|
src: TSrc;
|
|
106
|
-
} ?
|
|
106
|
+
} ? xstate1141.ConditionalRequired<[options?: ({
|
|
107
107
|
id?: T_1["id"] | undefined;
|
|
108
108
|
systemId?: string;
|
|
109
|
-
input?:
|
|
109
|
+
input?: xstate1141.InputFrom<T_1["logic"]> | undefined;
|
|
110
110
|
syncSnapshot?: boolean;
|
|
111
|
-
} & { [K_1 in
|
|
111
|
+
} & { [K_1 in xstate1141.RequiredActorOptions<T_1>]: unknown }) | undefined], xstate1141.IsNotNever<xstate1141.RequiredActorOptions<T_1>>> : never : never : never)): xstate1141.ActorRefFromLogic<xstate1141.GetConcreteByKey<xstate1141.Values<{
|
|
112
112
|
uploadDocument: {
|
|
113
113
|
src: "uploadDocument";
|
|
114
|
-
logic:
|
|
114
|
+
logic: xstate1141.PromiseActorLogic<void, {
|
|
115
115
|
imageBase64: string;
|
|
116
116
|
documentType: string;
|
|
117
117
|
onProgress: (progress: number) => void;
|
|
118
|
-
},
|
|
118
|
+
}, xstate1141.EventObject>;
|
|
119
119
|
id: string | undefined;
|
|
120
120
|
};
|
|
121
121
|
initCamera: {
|
|
122
122
|
src: "initCamera";
|
|
123
|
-
logic:
|
|
123
|
+
logic: xstate1141.PromiseActorLogic<MediaStream, void, xstate1141.EventObject>;
|
|
124
124
|
id: string | undefined;
|
|
125
125
|
};
|
|
126
126
|
}>, "src", TSrc>["logic"]>;
|
|
127
|
-
<TLogic extends
|
|
127
|
+
<TLogic extends xstate1141.AnyActorLogic>(src: TLogic, ...[options]: xstate1141.ConditionalRequired<[options?: ({
|
|
128
128
|
id?: never;
|
|
129
129
|
systemId?: string;
|
|
130
|
-
input?:
|
|
130
|
+
input?: xstate1141.InputFrom<TLogic> | undefined;
|
|
131
131
|
syncSnapshot?: boolean;
|
|
132
|
-
} & { [K in
|
|
132
|
+
} & { [K in xstate1141.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate1141.IsNotNever<xstate1141.RequiredLogicInput<TLogic>>>): xstate1141.ActorRefFromLogic<TLogic>;
|
|
133
133
|
};
|
|
134
134
|
input: DocumentUploadInput;
|
|
135
|
-
self:
|
|
135
|
+
self: xstate1141.ActorRef<xstate1141.MachineSnapshot<DocumentUploadContext, {
|
|
136
136
|
type: "START";
|
|
137
137
|
} | {
|
|
138
138
|
type: "CAPTURE";
|
|
@@ -144,7 +144,7 @@ declare const documentUploadMachine: xstate512.StateMachine<DocumentUploadContex
|
|
|
144
144
|
type: "RETRY";
|
|
145
145
|
} | {
|
|
146
146
|
type: "CLOSE";
|
|
147
|
-
}, Record<string,
|
|
147
|
+
}, Record<string, xstate1141.AnyActorRef | undefined>, xstate1141.StateValue, string, unknown, any, any>, {
|
|
148
148
|
type: "START";
|
|
149
149
|
} | {
|
|
150
150
|
type: "CAPTURE";
|
|
@@ -156,7 +156,7 @@ declare const documentUploadMachine: xstate512.StateMachine<DocumentUploadContex
|
|
|
156
156
|
type: "RETRY";
|
|
157
157
|
} | {
|
|
158
158
|
type: "CLOSE";
|
|
159
|
-
},
|
|
159
|
+
}, xstate1141.AnyEventObject>;
|
|
160
160
|
}) => {
|
|
161
161
|
config: DocumentUploadConfig;
|
|
162
162
|
stream: undefined;
|
|
@@ -226,7 +226,7 @@ declare const documentUploadMachine: xstate512.StateMachine<DocumentUploadContex
|
|
|
226
226
|
} | {
|
|
227
227
|
type: "CLOSE";
|
|
228
228
|
};
|
|
229
|
-
self:
|
|
229
|
+
self: xstate1141.ActorRef<xstate1141.MachineSnapshot<DocumentUploadContext, {
|
|
230
230
|
type: "START";
|
|
231
231
|
} | {
|
|
232
232
|
type: "CAPTURE";
|
|
@@ -238,7 +238,7 @@ declare const documentUploadMachine: xstate512.StateMachine<DocumentUploadContex
|
|
|
238
238
|
type: "RETRY";
|
|
239
239
|
} | {
|
|
240
240
|
type: "CLOSE";
|
|
241
|
-
}, Record<string,
|
|
241
|
+
}, Record<string, xstate1141.AnyActorRef>, xstate1141.StateValue, string, unknown, any, any>, {
|
|
242
242
|
type: "START";
|
|
243
243
|
} | {
|
|
244
244
|
type: "CAPTURE";
|
|
@@ -250,7 +250,7 @@ declare const documentUploadMachine: xstate512.StateMachine<DocumentUploadContex
|
|
|
250
250
|
type: "RETRY";
|
|
251
251
|
} | {
|
|
252
252
|
type: "CLOSE";
|
|
253
|
-
},
|
|
253
|
+
}, xstate1141.AnyEventObject>;
|
|
254
254
|
}) => {
|
|
255
255
|
imageBase64: string;
|
|
256
256
|
documentType: string;
|
package/dist/dynamic-forms.d.ts
CHANGED
|
@@ -1,287 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "./api-DUZwyz0o.esm.js";
|
|
2
2
|
import { n as eventModuleNames, o as topLevelStateName, s as createManagerInstrumentation } from "./events-CmarQoum.esm.js";
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
3
|
+
import "./endpoints-B2t80MAM.esm.js";
|
|
4
|
+
import { c as createManager, s as createActor } from "./xstate.esm-CbU9dpcC.esm.js";
|
|
5
|
+
import "./dateUtils-8dCcuArE.esm.js";
|
|
6
|
+
import { t as dynamicFormsMachine } from "./dynamicFormsStateMachine-p7MuNqYk.esm.js";
|
|
6
7
|
|
|
7
|
-
//#region src/modules/dynamic-forms/dynamicFormsFields.ts
|
|
8
|
-
function getEffectiveType(question) {
|
|
9
|
-
return question.inputType ?? question.overrides ?? "TEXT";
|
|
10
|
-
}
|
|
11
|
-
const FORMAT_ERROR_KEY_BY_TYPE = {
|
|
12
|
-
PHONE: "phone.invalidPhone",
|
|
13
|
-
EMAIL: "verification.errors.emailInvalid",
|
|
14
|
-
CPF: "dynamicForms.invalidCpf"
|
|
15
|
-
};
|
|
16
|
-
function buildQuestionValidation(question) {
|
|
17
|
-
const effectiveType = getEffectiveType(question);
|
|
18
|
-
const rules = [];
|
|
19
|
-
if (!question.isOptional) rules.push({ type: "required" });
|
|
20
|
-
const formatErrorKey = FORMAT_ERROR_KEY_BY_TYPE[effectiveType];
|
|
21
|
-
if (formatErrorKey) rules.push({
|
|
22
|
-
type: "formatViaAnswerValidity",
|
|
23
|
-
errorKey: formatErrorKey
|
|
24
|
-
});
|
|
25
|
-
return rules;
|
|
26
|
-
}
|
|
27
|
-
function buildScreenFields(formScreen) {
|
|
28
|
-
return formScreen.questions.map((q) => ({
|
|
29
|
-
questionId: q.questionId,
|
|
30
|
-
inputType: getEffectiveType(q),
|
|
31
|
-
isOptional: q.isOptional ?? false,
|
|
32
|
-
validation: buildQuestionValidation(q)
|
|
33
|
-
}));
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
//#endregion
|
|
37
|
-
//#region src/modules/dynamic-forms/dynamicFormsValidators.ts
|
|
38
|
-
const VALIDATORS = {
|
|
39
|
-
required: ({ value }) => value.trim().length === 0 ? "dynamicForms.fieldRequired" : void 0,
|
|
40
|
-
formatViaAnswerValidity: ({ questionId, answerValidity }, rule) => answerValidity[questionId] === false ? rule.errorKey : void 0
|
|
41
|
-
};
|
|
42
|
-
const normalizeValue = (value) => typeof value === "string" ? value : String(value ?? "");
|
|
43
|
-
function evaluateRules(input, rules) {
|
|
44
|
-
for (const rule of rules) {
|
|
45
|
-
const error = rule.type === "required" ? VALIDATORS.required(input) : VALIDATORS.formatViaAnswerValidity(input, rule);
|
|
46
|
-
if (error) return error;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
/** Runs full-screen validation. Returns first failing key per field; empty = pass. */
|
|
50
|
-
function validateScreenForm(answers, fields, answerValidity) {
|
|
51
|
-
return fields.reduce((errors, field) => {
|
|
52
|
-
const error = evaluateRules({
|
|
53
|
-
value: normalizeValue(answers[field.questionId]),
|
|
54
|
-
questionId: field.questionId,
|
|
55
|
-
answerValidity
|
|
56
|
-
}, field.validation);
|
|
57
|
-
if (error) errors[field.questionId] = error;
|
|
58
|
-
return errors;
|
|
59
|
-
}, {});
|
|
60
|
-
}
|
|
61
|
-
/** Runs single-field validation (blur). Unknown `questionId` → `undefined`. */
|
|
62
|
-
function validateScreenField(answers, questionId, fields, answerValidity) {
|
|
63
|
-
const field = fields.find((f) => f.questionId === questionId);
|
|
64
|
-
if (!field) return void 0;
|
|
65
|
-
return evaluateRules({
|
|
66
|
-
value: normalizeValue(answers[questionId]),
|
|
67
|
-
questionId,
|
|
68
|
-
answerValidity
|
|
69
|
-
}, field.validation);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
//#endregion
|
|
73
|
-
//#region src/modules/dynamic-forms/dynamicFormsServices.ts
|
|
74
|
-
async function fetchForms(flowId, signal) {
|
|
75
|
-
const url = `${endpoints.moduleConfig}?id=${encodeURIComponent(flowId)}&moduleKey=DYNAMIC_FORMS`;
|
|
76
|
-
const res = await api.get(url, { signal });
|
|
77
|
-
if (!res.ok) throw new Error(`GET ${endpoints.moduleConfig} failed: ${res.status} ${res.statusText}`);
|
|
78
|
-
return res.data;
|
|
79
|
-
}
|
|
80
|
-
async function submitFormAnswer(params, signal) {
|
|
81
|
-
const res = await api.post(endpoints.dynamicFormsSubmitAnswer, {
|
|
82
|
-
questionId: params.questionId,
|
|
83
|
-
answerDetails: { singleAnswer: params.singleAnswer }
|
|
84
|
-
}, { signal });
|
|
85
|
-
if (!res.ok) throw new Error(`POST ${endpoints.dynamicFormsSubmitAnswer} failed: ${res.status} ${res.statusText}`);
|
|
86
|
-
return res.data;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
//#endregion
|
|
90
|
-
//#region src/modules/dynamic-forms/dynamicFormsStateMachine.ts
|
|
91
|
-
function transformAnswerValue(inputType, value) {
|
|
92
|
-
switch (inputType) {
|
|
93
|
-
case "CPF": return value.replace(/[-.]/g, "");
|
|
94
|
-
case "DATE": return isoDateToMs(value).toString();
|
|
95
|
-
default: return value;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
const removeKey = (errors, key) => {
|
|
99
|
-
if (!errors?.[key]) return errors;
|
|
100
|
-
const next = { ...errors };
|
|
101
|
-
delete next[key];
|
|
102
|
-
return Object.keys(next).length > 0 ? next : void 0;
|
|
103
|
-
};
|
|
104
|
-
const upsertKey = (errors, key, message) => {
|
|
105
|
-
const next = { ...errors ?? {} };
|
|
106
|
-
if (message) next[key] = message;
|
|
107
|
-
else delete next[key];
|
|
108
|
-
return Object.keys(next).length > 0 ? next : void 0;
|
|
109
|
-
};
|
|
110
|
-
const dynamicFormsMachine = setup({
|
|
111
|
-
types: {
|
|
112
|
-
context: {},
|
|
113
|
-
events: {},
|
|
114
|
-
input: {}
|
|
115
|
-
},
|
|
116
|
-
actors: {
|
|
117
|
-
fetchScreens: fromPromise(async ({ input, signal }) => {
|
|
118
|
-
return fetchForms(input.flowId, signal);
|
|
119
|
-
}),
|
|
120
|
-
submitScreenAnswers: fromPromise(async ({ input, signal }) => {
|
|
121
|
-
const { screen: formScreen, answers } = input;
|
|
122
|
-
for (const question of formScreen.questions) {
|
|
123
|
-
const singleAnswer = transformAnswerValue(question.inputType ?? question.overrides ?? "TEXT", answers[question.questionId] ?? "");
|
|
124
|
-
try {
|
|
125
|
-
await submitFormAnswer({
|
|
126
|
-
questionId: question.questionId,
|
|
127
|
-
singleAnswer
|
|
128
|
-
}, signal);
|
|
129
|
-
} catch {}
|
|
130
|
-
}
|
|
131
|
-
return { success: true };
|
|
132
|
-
})
|
|
133
|
-
},
|
|
134
|
-
actions: {
|
|
135
|
-
setScreens: assign(({ event }) => {
|
|
136
|
-
const screens = event.output.screens;
|
|
137
|
-
const firstScreen = screens[0];
|
|
138
|
-
return {
|
|
139
|
-
screens,
|
|
140
|
-
answers: {},
|
|
141
|
-
currentScreenFields: firstScreen ? buildScreenFields(firstScreen) : []
|
|
142
|
-
};
|
|
143
|
-
}),
|
|
144
|
-
setAnswer: assign(({ context, event }) => {
|
|
145
|
-
const e = event;
|
|
146
|
-
return {
|
|
147
|
-
answers: {
|
|
148
|
-
...context.answers,
|
|
149
|
-
[e.questionId]: e.value
|
|
150
|
-
},
|
|
151
|
-
validationErrors: removeKey(context.validationErrors, e.questionId)
|
|
152
|
-
};
|
|
153
|
-
}),
|
|
154
|
-
setAnswerValidity: assign(({ context, event }) => {
|
|
155
|
-
const e = event;
|
|
156
|
-
return {
|
|
157
|
-
answerValidity: {
|
|
158
|
-
...context.answerValidity,
|
|
159
|
-
[e.questionId]: e.isValid
|
|
160
|
-
},
|
|
161
|
-
validationErrors: removeKey(context.validationErrors, e.questionId)
|
|
162
|
-
};
|
|
163
|
-
}),
|
|
164
|
-
validateFormField: assign(({ context, event }) => {
|
|
165
|
-
if (event.type !== "VALIDATE_FIELD") return {};
|
|
166
|
-
const message = validateScreenField(context.answers, event.questionId, context.currentScreenFields, context.answerValidity);
|
|
167
|
-
return { validationErrors: upsertKey(context.validationErrors, event.questionId, message) };
|
|
168
|
-
}),
|
|
169
|
-
computeValidationResult: assign(({ context }) => {
|
|
170
|
-
const errors = validateScreenForm(context.answers, context.currentScreenFields, context.answerValidity);
|
|
171
|
-
return { validationErrors: Object.keys(errors).length > 0 ? errors : void 0 };
|
|
172
|
-
}),
|
|
173
|
-
advanceScreen: assign(({ context }) => {
|
|
174
|
-
const nextIndex = context.currentScreenIndex + 1;
|
|
175
|
-
const nextScreen = context.screens[nextIndex];
|
|
176
|
-
return {
|
|
177
|
-
currentScreenIndex: nextIndex,
|
|
178
|
-
answers: {},
|
|
179
|
-
answerValidity: {},
|
|
180
|
-
currentScreenFields: nextScreen ? buildScreenFields(nextScreen) : [],
|
|
181
|
-
validationErrors: void 0
|
|
182
|
-
};
|
|
183
|
-
}),
|
|
184
|
-
markCompleted: assign({ result: "completed" }),
|
|
185
|
-
markSkipped: assign({ result: "skipped" })
|
|
186
|
-
},
|
|
187
|
-
guards: {
|
|
188
|
-
hasPreloadedScreens: ({ context }) => (context.config.screens?.length ?? 0) > 0,
|
|
189
|
-
hasFlowId: ({ context }) => !!context.config.flowId,
|
|
190
|
-
isLastScreen: ({ context }) => context.currentScreenIndex >= context.screens.length - 1,
|
|
191
|
-
isScreenValid: ({ context }) => Object.keys(context.validationErrors ?? {}).length === 0
|
|
192
|
-
}
|
|
193
|
-
}).createMachine({
|
|
194
|
-
id: "dynamicForms",
|
|
195
|
-
initial: "idle",
|
|
196
|
-
context: ({ input }) => {
|
|
197
|
-
const screens = input.config.screens ?? [];
|
|
198
|
-
const firstScreen = screens[0];
|
|
199
|
-
return {
|
|
200
|
-
config: input.config,
|
|
201
|
-
screens,
|
|
202
|
-
currentScreenIndex: 0,
|
|
203
|
-
answers: {},
|
|
204
|
-
answerValidity: {},
|
|
205
|
-
currentScreenFields: firstScreen ? buildScreenFields(firstScreen) : [],
|
|
206
|
-
result: null
|
|
207
|
-
};
|
|
208
|
-
},
|
|
209
|
-
states: {
|
|
210
|
-
idle: { on: { LOAD: [
|
|
211
|
-
{
|
|
212
|
-
target: "inputting",
|
|
213
|
-
guard: "hasPreloadedScreens"
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
target: "loadingScreens",
|
|
217
|
-
guard: "hasFlowId"
|
|
218
|
-
},
|
|
219
|
-
{ target: "misconfigured" }
|
|
220
|
-
] } },
|
|
221
|
-
loadingScreens: { invoke: {
|
|
222
|
-
id: "fetchScreens",
|
|
223
|
-
src: "fetchScreens",
|
|
224
|
-
input: ({ context }) => ({ flowId: context.config.flowId ?? "" }),
|
|
225
|
-
onDone: {
|
|
226
|
-
target: "inputting",
|
|
227
|
-
actions: "setScreens"
|
|
228
|
-
},
|
|
229
|
-
onError: {
|
|
230
|
-
target: "finished",
|
|
231
|
-
actions: "markSkipped"
|
|
232
|
-
}
|
|
233
|
-
} },
|
|
234
|
-
inputting: {
|
|
235
|
-
initial: "editing",
|
|
236
|
-
states: {
|
|
237
|
-
editing: { on: {
|
|
238
|
-
ANSWER_CHANGED: { actions: "setAnswer" },
|
|
239
|
-
ANSWER_VALIDITY_CHANGED: { actions: "setAnswerValidity" },
|
|
240
|
-
VALIDATE_FIELD: { actions: "validateFormField" },
|
|
241
|
-
SUBMIT: { target: "validatingSubmit" }
|
|
242
|
-
} },
|
|
243
|
-
validatingSubmit: {
|
|
244
|
-
entry: "computeValidationResult",
|
|
245
|
-
always: [{
|
|
246
|
-
guard: "isScreenValid",
|
|
247
|
-
target: "#dynamicForms.submitting"
|
|
248
|
-
}, { target: "editing" }]
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
},
|
|
252
|
-
submitting: { invoke: {
|
|
253
|
-
id: "submitScreenAnswers",
|
|
254
|
-
src: "submitScreenAnswers",
|
|
255
|
-
input: ({ context }) => ({
|
|
256
|
-
screen: context.screens[context.currentScreenIndex],
|
|
257
|
-
answers: context.answers
|
|
258
|
-
}),
|
|
259
|
-
onDone: [{
|
|
260
|
-
target: "success",
|
|
261
|
-
guard: "isLastScreen"
|
|
262
|
-
}, {
|
|
263
|
-
target: "inputting",
|
|
264
|
-
actions: "advanceScreen"
|
|
265
|
-
}],
|
|
266
|
-
onError: [{
|
|
267
|
-
target: "success",
|
|
268
|
-
guard: "isLastScreen"
|
|
269
|
-
}, {
|
|
270
|
-
target: "inputting",
|
|
271
|
-
actions: "advanceScreen"
|
|
272
|
-
}]
|
|
273
|
-
} },
|
|
274
|
-
success: { after: { 3e3: {
|
|
275
|
-
target: "finished",
|
|
276
|
-
actions: "markCompleted"
|
|
277
|
-
} } },
|
|
278
|
-
finished: { type: "final" },
|
|
279
|
-
misconfigured: { on: { CLOSE: { target: "closed" } } },
|
|
280
|
-
closed: { type: "final" }
|
|
281
|
-
}
|
|
282
|
-
});
|
|
283
|
-
|
|
284
|
-
//#endregion
|
|
285
8
|
//#region src/modules/dynamic-forms/dynamicFormsActor.ts
|
|
286
9
|
function createDynamicFormsActor(options) {
|
|
287
10
|
return createActor(dynamicFormsMachine, { input: { config: options.config } }).start();
|