@incodetech/core 0.0.0-dev-20260611-3dbdc7fd → 0.0.0-dev-20260611-09d74a69
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/{ae-signature-BFZta3TZ.esm.js → ae-signature-ai7OSLgB.esm.js} +1 -1
- package/dist/ae-signature.d.ts +1 -1
- package/dist/ae-signature.esm.js +3 -3
- package/dist/antifraud.esm.js +2 -2
- package/dist/{antifraudManager-CkV4u-LE.esm.js → antifraudManager-Bm_s1FGq.esm.js} +31 -3
- package/dist/authentication.esm.js +3 -3
- package/dist/{authenticationManager-BlR6mSaG.esm.js → authenticationManager-Bx6JOGrA.esm.js} +2 -2
- package/dist/consent.d.ts +1 -1
- package/dist/consent.esm.js +2 -2
- package/dist/{consentManager-BYo9Nu1r.esm.js → consentManager-CcYtoZcH.esm.js} +27 -3
- package/dist/{consentManager-B-qo4-xH.d.ts → consentManager-xD5HBcPI.d.ts} +47 -47
- package/dist/cpf-ocr.d.ts +1 -1
- package/dist/cpf-ocr.esm.js +2 -2
- package/dist/{cpfOcrManager-sSKegxox.esm.js → cpfOcrManager-D_Jz3zTE.esm.js} +1 -1
- package/dist/{cpfOcrManager-b5eyxzi_.d.ts → cpfOcrManager-DbWOV3mR.d.ts} +17 -17
- package/dist/cross-document-data-match.esm.js +1 -1
- package/dist/curp-validation.d.ts +1 -1
- package/dist/curp-validation.esm.js +2 -2
- package/dist/{curpValidationManager-RttixpIc.d.ts → curpValidationManager-DIQbAvYR.d.ts} +1 -0
- package/dist/{curpValidationManager-CFem6zP9.esm.js → curpValidationManager-DnJc2FXu.esm.js} +49 -3
- package/dist/custom-fields.esm.js +1 -1
- package/dist/custom-watchlist.esm.js +22 -2
- package/dist/document-capture.d.ts +170 -170
- package/dist/document-capture.esm.js +65 -2
- package/dist/document-upload.d.ts +40 -40
- package/dist/document-upload.esm.js +2 -2
- package/dist/dynamic-forms.esm.js +30 -3
- package/dist/ekyb.d.ts +1 -0
- package/dist/ekyb.esm.js +46 -5
- package/dist/{ekybStateMachine-B3RM9ruw.esm.js → ekybStateMachine-B9GEv84i.esm.js} +1 -1
- package/dist/ekyc.d.ts +1 -0
- package/dist/ekyc.esm.js +47 -2
- package/dist/electronic-signature.d.ts +1 -1
- package/dist/electronic-signature.esm.js +2 -2
- package/dist/{electronicSignatureManager-BaECdJ1u.esm.js → electronicSignatureManager-NH8uW69s.esm.js} +98 -6
- package/dist/email.d.ts +1 -1
- package/dist/email.esm.js +2 -2
- package/dist/{emailManager-lAzDoQOs.d.ts → emailManager-CSgOY352.d.ts} +1 -0
- package/dist/{emailManager--D5G3ChB.esm.js → emailManager-DZAmAA6M.esm.js} +43 -3
- package/dist/{events-Dvvriq9l.esm.js → events-CqFVBE7N.esm.js} +83 -41
- package/dist/events.d.ts +20 -16
- package/dist/events.esm.js +1 -1
- package/dist/extensibility.d.ts +7 -7
- package/dist/extensibility.esm.js +17 -17
- package/dist/face-match.esm.js +1 -1
- package/dist/{faceCaptureManagerFactory-ej2j1LMr.esm.js → faceCaptureManagerFactory-C6Cugf_Z.esm.js} +3 -7
- package/dist/field-comparison.esm.js +2 -2
- package/dist/{fieldComparisonManager-COGI2ARD.esm.js → fieldComparisonManager-Dcw-NMWo.esm.js} +1 -1
- package/dist/fiscal-qr.esm.js +1 -1
- package/dist/flow.d.ts +2 -2
- package/dist/flow.esm.js +4 -4
- package/dist/{flowServices-Dz3oouEJ.esm.js → flowServices-DjNSRHb0.esm.js} +1 -1
- package/dist/geolocation.d.ts +1 -0
- package/dist/geolocation.esm.js +30 -2
- package/dist/government-validation.esm.js +36 -2
- package/dist/home.d.ts +10 -10
- package/dist/home.esm.js +2 -2
- package/dist/id-ocr.d.ts +52 -52
- package/dist/id-ocr.esm.js +2 -2
- package/dist/id-verification.d.ts +25 -25
- package/dist/id-verification.esm.js +1 -1
- package/dist/id.esm.js +5 -5
- package/dist/{idCaptureManager-Dnd7avjb.esm.js → idCaptureManager-CTxEsHk6.esm.js} +8 -3
- package/dist/{idCaptureStateMachine-BymZWyzp.esm.js → idCaptureStateMachine-C909OCfF.esm.js} +138 -65
- package/dist/{idOcrStateMachine-CDQ5d_VM.esm.js → idOcrStateMachine-CyMxAWAD.esm.js} +1 -1
- package/dist/identity-reuse.d.ts +1 -1
- package/dist/identity-reuse.esm.js +2 -2
- package/dist/{identityReuseManager-DwLtVzUn.d.ts → identityReuseManager-CCbd9rQ6.d.ts} +34 -34
- package/dist/{identityReuseManager-C6n_97dw.esm.js → identityReuseManager-D_lHhELK.esm.js} +1 -1
- package/dist/{index-Vto9CgAR.d.ts → index-BHyqaXBC.d.ts} +168 -168
- package/dist/index.esm.js +3 -3
- package/dist/{invokeOnCaptureCallback-ygByVdnn.esm.js → invokeOnCaptureCallback-D65AJm3b.esm.js} +1 -1
- package/dist/mandatory-consent.d.ts +1 -1
- package/dist/mandatory-consent.esm.js +2 -2
- package/dist/{mandatoryConsentManager-Cptkf2gO.d.ts → mandatoryConsentManager-C1vQknOC.d.ts} +47 -47
- package/dist/{mandatoryConsentManager-H6D18cZB.esm.js → mandatoryConsentManager-Cm12uk83.esm.js} +1 -1
- package/dist/phone.d.ts +1 -1
- package/dist/phone.esm.js +2 -2
- package/dist/{phoneManager-fPmIBYQK.d.ts → phoneManager-BmdGkGC3.d.ts} +1 -0
- package/dist/{phoneManager-BmF-0Ez4.esm.js → phoneManager-N9f10gYZ.esm.js} +44 -3
- package/dist/{qe-signature-CUYPcHVo.esm.js → qe-signature-CDWeO6k7.esm.js} +1 -1
- package/dist/qe-signature.d.ts +1 -1
- package/dist/qe-signature.esm.js +3 -3
- package/dist/redirect-to-mobile.esm.js +2 -2
- package/dist/{redirectToMobileManager-Dy3t7o0C.esm.js → redirectToMobileManager-DdhezJQZ.esm.js} +1 -1
- package/dist/{runChildModule-CuoHZ1cx.esm.js → runChildModule-6pSd76go.esm.js} +1 -1
- package/dist/selfie.esm.js +4 -4
- package/dist/{selfieManager-BNuTIGAz.esm.js → selfieManager-CvP5itLQ.esm.js} +2 -2
- package/dist/session.esm.js +2 -2
- package/dist/{sessionInitializer-Bwk3EweR.esm.js → sessionInitializer-DX2Nj28R.esm.js} +2 -2
- package/dist/{setup-BE0cu5ra.esm.js → setup-B_XVGDlL.esm.js} +2 -2
- package/dist/signature.d.ts +1 -0
- package/dist/signature.esm.js +45 -3
- package/dist/{signatureStateMachine-C5qqYLRz.esm.js → signatureStateMachine-CzYIzrj9.esm.js} +18 -36
- package/dist/trust-graph.d.ts +2 -2
- package/dist/trust-graph.esm.js +1 -1
- package/dist/wasm.esm.js +3 -3
- package/dist/watchlist-for-business.esm.js +25 -3
- package/dist/watchlist.esm.js +23 -2
- package/dist/workflow.d.ts +135 -135
- package/dist/workflow.esm.js +12 -12
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./WasmUtilProvider-BKWm8rSA.esm.js";
|
|
2
2
|
import "./api-CESGtpbH.esm.js";
|
|
3
|
-
import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-
|
|
3
|
+
import { n as eventModuleNames, o as topLevelStateName, s as createManagerInstrumentation } from "./events-CqFVBE7N.esm.js";
|
|
4
4
|
import "./endpoints-BeTK0Mlt.esm.js";
|
|
5
5
|
import "./platform-SKvEfCBh.esm.js";
|
|
6
6
|
import { c as createManager, s as createActor } from "./xstate.esm-C9wncMQa.esm.js";
|
|
@@ -19,6 +19,66 @@ function createDocumentCaptureActor(options) {
|
|
|
19
19
|
|
|
20
20
|
//#endregion
|
|
21
21
|
//#region src/modules/document-capture/documentCaptureManager.ts
|
|
22
|
+
/**
|
|
23
|
+
* Maps a document-capture state-machine snapshot to the exact Figma
|
|
24
|
+
* "📊 Tracked Events" screen name. Source: POA / Document Capture Figma file
|
|
25
|
+
* (`https://www.figma.com/design/cbFXiChmJ8cWQDHwVghBqJ/Document-Capture---Latest-Design?node-id=5140-36443`).
|
|
26
|
+
* Family is `documentCapture.*` with three sub-families:
|
|
27
|
+
*
|
|
28
|
+
* - `documentCapture.tutorial.*` — tutorial / next-page surfaces.
|
|
29
|
+
* - `documentCapture.capture.*` — camera capture path (when
|
|
30
|
+
* `config.captureMode === 'camera'`).
|
|
31
|
+
* - `documentCapture.upload.*` — file upload path (when
|
|
32
|
+
* `config.captureMode === 'file'`).
|
|
33
|
+
* - `documentCapture.errors.*` — recoverable / exhausted error surfaces.
|
|
34
|
+
*
|
|
35
|
+
* The mapper returns Figma-verbatim strings (e.g.
|
|
36
|
+
* `'documentCapture.upload.reviewFile'`) which the adapter emits as-is on
|
|
37
|
+
* `event.screen`. See `docs/patterns/INSTRUMENTATION.md` for the contract.
|
|
38
|
+
*
|
|
39
|
+
* Figma sub-states the state machine does not surface as discrete states
|
|
40
|
+
* (intentionally not mapped here — they collapse into the section's primary
|
|
41
|
+
* screen until the SM surfaces them):
|
|
42
|
+
*
|
|
43
|
+
* - `documentCapture.tutorial.{default,uploadOnlySelector,methodSelectionWeb,nativeMethodSelectionOnWeb,methodSelectionNative}`
|
|
44
|
+
* — UI sub-states of the tutorial step driven by config or platform. The
|
|
45
|
+
* SM only knows `captureMode`, not the explicit selector or platform
|
|
46
|
+
* variant; the mapper collapses these onto `tutorial.captureOnly` (camera)
|
|
47
|
+
* and `tutorial.uploadOnly` (file).
|
|
48
|
+
* - `documentCapture.capture.{filled,commonIssues}` — UI sub-states of
|
|
49
|
+
* `capturing` (file selected / common issues hint).
|
|
50
|
+
* - `documentCapture.upload.{selectFromLibrary,selectFromFiles}` — the SM
|
|
51
|
+
* has a single `capturing` state for file mode that collapses these.
|
|
52
|
+
* - `documentCapture.errors.noConnection` — requires network-error
|
|
53
|
+
* classification at the `failure` boundary; not yet wired.
|
|
54
|
+
*
|
|
55
|
+
* `permissions`/`initCamera`/`finalizing` are intentionally unmapped — the
|
|
56
|
+
* Figma canvas does not define screens for them and falling back to the
|
|
57
|
+
* generic `<module>.<state>` default is the better signal for analytics.
|
|
58
|
+
* `closed` is intentionally unmapped (terminal user-dismissed state —
|
|
59
|
+
* handled by `moduleClosed`).
|
|
60
|
+
*/
|
|
61
|
+
function getDocumentCaptureScreenName(snapshot) {
|
|
62
|
+
const stateName = topLevelStateName(snapshot.value);
|
|
63
|
+
if (stateName === void 0) return void 0;
|
|
64
|
+
const isFileMode = snapshot.context.config.captureMode === "file";
|
|
65
|
+
switch (stateName) {
|
|
66
|
+
case "tutorial": return isFileMode ? "documentCapture.tutorial.uploadOnly" : "documentCapture.tutorial.captureOnly";
|
|
67
|
+
case "capturing": return isFileMode ? "documentCapture.upload.selectFromFiles" : "documentCapture.capture.default";
|
|
68
|
+
case "preview": return isFileMode ? "documentCapture.upload.reviewFile" : "documentCapture.capture.reviewPhoto";
|
|
69
|
+
case "uploading": return isFileMode ? "documentCapture.upload.analyzing" : "documentCapture.capture.analyzing";
|
|
70
|
+
case "success":
|
|
71
|
+
case "finished": return isFileMode ? "documentCapture.upload.success" : "documentCapture.capture.success";
|
|
72
|
+
case "failure": return (snapshot.context.attemptsRemaining ?? 0) > 0 ? "documentCapture.errors.genericError" : "documentCapture.errors.genericErrorExhausted";
|
|
73
|
+
case "nextPage": {
|
|
74
|
+
const nextPageType = snapshot.context.nextPageType;
|
|
75
|
+
if (nextPageType === "required") return "documentCapture.tutorial.nextPageMandatory";
|
|
76
|
+
if (nextPageType === "optional") return "documentCapture.tutorial.nextPageOptional";
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
default: return;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
22
82
|
function getPermissionStatus(snapshot) {
|
|
23
83
|
if (snapshot.matches({ permissions: "learnMore" })) return "learnMore";
|
|
24
84
|
if (snapshot.matches({ permissions: "requesting" })) return "requesting";
|
|
@@ -174,7 +234,10 @@ function createDocumentCaptureManager(options) {
|
|
|
174
234
|
actor: createDocumentCaptureActor(options),
|
|
175
235
|
mapState,
|
|
176
236
|
createApi,
|
|
177
|
-
instrumentation: createManagerInstrumentation(eventModuleNames.document, {
|
|
237
|
+
instrumentation: createManagerInstrumentation(eventModuleNames.document, {
|
|
238
|
+
getEventScreenName: getDocumentCaptureScreenName,
|
|
239
|
+
getErrorPayload: getDocumentCaptureErrorPayload
|
|
240
|
+
})
|
|
178
241
|
});
|
|
179
242
|
}
|
|
180
243
|
|
|
@@ -2,10 +2,10 @@ import { t as Manager } from "./Manager-BHn8wH8K.js";
|
|
|
2
2
|
import "./Actor-Y0_Fj-KL.js";
|
|
3
3
|
import "./camera-SRBpPq2X.js";
|
|
4
4
|
import { n as DocumentUploadContext, r as DocumentUploadInput, t as DocumentUploadConfig } from "./types-Bj9hdFjU.js";
|
|
5
|
-
import * as
|
|
5
|
+
import * as xstate1225 from "xstate";
|
|
6
6
|
|
|
7
7
|
//#region src/modules/document-upload/documentUploadStateMachine.d.ts
|
|
8
|
-
declare const documentUploadMachine:
|
|
8
|
+
declare const documentUploadMachine: xstate1225.StateMachine<DocumentUploadContext, {
|
|
9
9
|
type: "START";
|
|
10
10
|
} | {
|
|
11
11
|
type: "CAPTURE";
|
|
@@ -18,52 +18,52 @@ declare const documentUploadMachine: xstate588.StateMachine<DocumentUploadContex
|
|
|
18
18
|
} | {
|
|
19
19
|
type: "CLOSE";
|
|
20
20
|
}, {
|
|
21
|
-
[x: string]:
|
|
21
|
+
[x: string]: xstate1225.ActorRefFromLogic<xstate1225.PromiseActorLogic<void, {
|
|
22
22
|
imageBase64: string;
|
|
23
23
|
documentType: string;
|
|
24
24
|
onProgress: (progress: number) => void;
|
|
25
|
-
},
|
|
26
|
-
},
|
|
25
|
+
}, xstate1225.EventObject>> | xstate1225.ActorRefFromLogic<xstate1225.PromiseActorLogic<MediaStream, void, xstate1225.EventObject>> | undefined;
|
|
26
|
+
}, xstate1225.Values<{
|
|
27
27
|
uploadDocument: {
|
|
28
28
|
src: "uploadDocument";
|
|
29
|
-
logic:
|
|
29
|
+
logic: xstate1225.PromiseActorLogic<void, {
|
|
30
30
|
imageBase64: string;
|
|
31
31
|
documentType: string;
|
|
32
32
|
onProgress: (progress: number) => void;
|
|
33
|
-
},
|
|
33
|
+
}, xstate1225.EventObject>;
|
|
34
34
|
id: string | undefined;
|
|
35
35
|
};
|
|
36
36
|
initCamera: {
|
|
37
37
|
src: "initCamera";
|
|
38
|
-
logic:
|
|
38
|
+
logic: xstate1225.PromiseActorLogic<MediaStream, void, xstate1225.EventObject>;
|
|
39
39
|
id: string | undefined;
|
|
40
40
|
};
|
|
41
|
-
}>,
|
|
41
|
+
}>, xstate1225.Values<{
|
|
42
42
|
setError: {
|
|
43
43
|
type: "setError";
|
|
44
|
-
params:
|
|
44
|
+
params: xstate1225.NonReducibleUnknown;
|
|
45
45
|
};
|
|
46
46
|
clearError: {
|
|
47
47
|
type: "clearError";
|
|
48
|
-
params:
|
|
48
|
+
params: xstate1225.NonReducibleUnknown;
|
|
49
49
|
};
|
|
50
50
|
setStream: {
|
|
51
51
|
type: "setStream";
|
|
52
|
-
params:
|
|
52
|
+
params: xstate1225.NonReducibleUnknown;
|
|
53
53
|
};
|
|
54
54
|
setImageAndClearError: {
|
|
55
55
|
type: "setImageAndClearError";
|
|
56
|
-
params:
|
|
56
|
+
params: xstate1225.NonReducibleUnknown;
|
|
57
57
|
};
|
|
58
58
|
setProgress: {
|
|
59
59
|
type: "setProgress";
|
|
60
|
-
params:
|
|
60
|
+
params: xstate1225.NonReducibleUnknown;
|
|
61
61
|
};
|
|
62
62
|
stopStream: {
|
|
63
63
|
type: "stopStream";
|
|
64
|
-
params:
|
|
64
|
+
params: xstate1225.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, xstate1225.NonReducibleUnknown, xstate1225.EventObject, xstate1225.MetaObject, {
|
|
67
67
|
readonly id: "documentUpload";
|
|
68
68
|
readonly initial: "idle";
|
|
69
69
|
readonly context: ({
|
|
@@ -72,67 +72,67 @@ declare const documentUploadMachine: xstate588.StateMachine<DocumentUploadContex
|
|
|
72
72
|
spawn: {
|
|
73
73
|
<TSrc extends "uploadDocument" | "initCamera">(logic: TSrc, ...[options]: ({
|
|
74
74
|
src: "uploadDocument";
|
|
75
|
-
logic:
|
|
75
|
+
logic: xstate1225.PromiseActorLogic<void, {
|
|
76
76
|
imageBase64: string;
|
|
77
77
|
documentType: string;
|
|
78
78
|
onProgress: (progress: number) => void;
|
|
79
|
-
},
|
|
79
|
+
}, xstate1225.EventObject>;
|
|
80
80
|
id: string | undefined;
|
|
81
81
|
} extends infer T ? T extends {
|
|
82
82
|
src: "uploadDocument";
|
|
83
|
-
logic:
|
|
83
|
+
logic: xstate1225.PromiseActorLogic<void, {
|
|
84
84
|
imageBase64: string;
|
|
85
85
|
documentType: string;
|
|
86
86
|
onProgress: (progress: number) => void;
|
|
87
|
-
},
|
|
87
|
+
}, xstate1225.EventObject>;
|
|
88
88
|
id: string | undefined;
|
|
89
89
|
} ? T extends {
|
|
90
90
|
src: TSrc;
|
|
91
|
-
} ?
|
|
91
|
+
} ? xstate1225.ConditionalRequired<[options?: ({
|
|
92
92
|
id?: T["id"] | undefined;
|
|
93
93
|
systemId?: string;
|
|
94
|
-
input?:
|
|
94
|
+
input?: xstate1225.InputFrom<T["logic"]> | undefined;
|
|
95
95
|
syncSnapshot?: boolean;
|
|
96
|
-
} & { [K in
|
|
96
|
+
} & { [K in xstate1225.RequiredActorOptions<T>]: unknown }) | undefined], xstate1225.IsNotNever<xstate1225.RequiredActorOptions<T>>> : never : never : never) | ({
|
|
97
97
|
src: "initCamera";
|
|
98
|
-
logic:
|
|
98
|
+
logic: xstate1225.PromiseActorLogic<MediaStream, void, xstate1225.EventObject>;
|
|
99
99
|
id: string | undefined;
|
|
100
100
|
} extends infer T_1 ? T_1 extends {
|
|
101
101
|
src: "initCamera";
|
|
102
|
-
logic:
|
|
102
|
+
logic: xstate1225.PromiseActorLogic<MediaStream, void, xstate1225.EventObject>;
|
|
103
103
|
id: string | undefined;
|
|
104
104
|
} ? T_1 extends {
|
|
105
105
|
src: TSrc;
|
|
106
|
-
} ?
|
|
106
|
+
} ? xstate1225.ConditionalRequired<[options?: ({
|
|
107
107
|
id?: T_1["id"] | undefined;
|
|
108
108
|
systemId?: string;
|
|
109
|
-
input?:
|
|
109
|
+
input?: xstate1225.InputFrom<T_1["logic"]> | undefined;
|
|
110
110
|
syncSnapshot?: boolean;
|
|
111
|
-
} & { [K_1 in
|
|
111
|
+
} & { [K_1 in xstate1225.RequiredActorOptions<T_1>]: unknown }) | undefined], xstate1225.IsNotNever<xstate1225.RequiredActorOptions<T_1>>> : never : never : never)): xstate1225.ActorRefFromLogic<xstate1225.GetConcreteByKey<xstate1225.Values<{
|
|
112
112
|
uploadDocument: {
|
|
113
113
|
src: "uploadDocument";
|
|
114
|
-
logic:
|
|
114
|
+
logic: xstate1225.PromiseActorLogic<void, {
|
|
115
115
|
imageBase64: string;
|
|
116
116
|
documentType: string;
|
|
117
117
|
onProgress: (progress: number) => void;
|
|
118
|
-
},
|
|
118
|
+
}, xstate1225.EventObject>;
|
|
119
119
|
id: string | undefined;
|
|
120
120
|
};
|
|
121
121
|
initCamera: {
|
|
122
122
|
src: "initCamera";
|
|
123
|
-
logic:
|
|
123
|
+
logic: xstate1225.PromiseActorLogic<MediaStream, void, xstate1225.EventObject>;
|
|
124
124
|
id: string | undefined;
|
|
125
125
|
};
|
|
126
126
|
}>, "src", TSrc>["logic"]>;
|
|
127
|
-
<TLogic extends
|
|
127
|
+
<TLogic extends xstate1225.AnyActorLogic>(src: TLogic, ...[options]: xstate1225.ConditionalRequired<[options?: ({
|
|
128
128
|
id?: never;
|
|
129
129
|
systemId?: string;
|
|
130
|
-
input?:
|
|
130
|
+
input?: xstate1225.InputFrom<TLogic> | undefined;
|
|
131
131
|
syncSnapshot?: boolean;
|
|
132
|
-
} & { [K in
|
|
132
|
+
} & { [K in xstate1225.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate1225.IsNotNever<xstate1225.RequiredLogicInput<TLogic>>>): xstate1225.ActorRefFromLogic<TLogic>;
|
|
133
133
|
};
|
|
134
134
|
input: DocumentUploadInput;
|
|
135
|
-
self:
|
|
135
|
+
self: xstate1225.ActorRef<xstate1225.MachineSnapshot<DocumentUploadContext, {
|
|
136
136
|
type: "START";
|
|
137
137
|
} | {
|
|
138
138
|
type: "CAPTURE";
|
|
@@ -144,7 +144,7 @@ declare const documentUploadMachine: xstate588.StateMachine<DocumentUploadContex
|
|
|
144
144
|
type: "RETRY";
|
|
145
145
|
} | {
|
|
146
146
|
type: "CLOSE";
|
|
147
|
-
}, Record<string,
|
|
147
|
+
}, Record<string, xstate1225.AnyActorRef | undefined>, xstate1225.StateValue, string, unknown, any, any>, {
|
|
148
148
|
type: "START";
|
|
149
149
|
} | {
|
|
150
150
|
type: "CAPTURE";
|
|
@@ -156,7 +156,7 @@ declare const documentUploadMachine: xstate588.StateMachine<DocumentUploadContex
|
|
|
156
156
|
type: "RETRY";
|
|
157
157
|
} | {
|
|
158
158
|
type: "CLOSE";
|
|
159
|
-
},
|
|
159
|
+
}, xstate1225.AnyEventObject>;
|
|
160
160
|
}) => {
|
|
161
161
|
config: DocumentUploadConfig;
|
|
162
162
|
stream: undefined;
|
|
@@ -226,7 +226,7 @@ declare const documentUploadMachine: xstate588.StateMachine<DocumentUploadContex
|
|
|
226
226
|
} | {
|
|
227
227
|
type: "CLOSE";
|
|
228
228
|
};
|
|
229
|
-
self:
|
|
229
|
+
self: xstate1225.ActorRef<xstate1225.MachineSnapshot<DocumentUploadContext, {
|
|
230
230
|
type: "START";
|
|
231
231
|
} | {
|
|
232
232
|
type: "CAPTURE";
|
|
@@ -238,7 +238,7 @@ declare const documentUploadMachine: xstate588.StateMachine<DocumentUploadContex
|
|
|
238
238
|
type: "RETRY";
|
|
239
239
|
} | {
|
|
240
240
|
type: "CLOSE";
|
|
241
|
-
}, Record<string,
|
|
241
|
+
}, Record<string, xstate1225.AnyActorRef>, xstate1225.StateValue, string, unknown, any, any>, {
|
|
242
242
|
type: "START";
|
|
243
243
|
} | {
|
|
244
244
|
type: "CAPTURE";
|
|
@@ -250,7 +250,7 @@ declare const documentUploadMachine: xstate588.StateMachine<DocumentUploadContex
|
|
|
250
250
|
type: "RETRY";
|
|
251
251
|
} | {
|
|
252
252
|
type: "CLOSE";
|
|
253
|
-
},
|
|
253
|
+
}, xstate1225.AnyEventObject>;
|
|
254
254
|
}) => {
|
|
255
255
|
imageBase64: string;
|
|
256
256
|
documentType: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as api } from "./api-CESGtpbH.esm.js";
|
|
2
|
-
import { n as eventModuleNames,
|
|
2
|
+
import { n as eventModuleNames, s as createManagerInstrumentation } from "./events-CqFVBE7N.esm.js";
|
|
3
3
|
import { t as endpoints } from "./endpoints-BeTK0Mlt.esm.js";
|
|
4
4
|
import "./platform-SKvEfCBh.esm.js";
|
|
5
5
|
import { a as fromPromise, c as createManager, r as assign, s as createActor, t as setup } from "./xstate.esm-C9wncMQa.esm.js";
|
|
@@ -195,7 +195,7 @@ function createDocumentUploadManager(options) {
|
|
|
195
195
|
actor: createDocumentUploadActor(options),
|
|
196
196
|
mapState,
|
|
197
197
|
createApi,
|
|
198
|
-
instrumentation: createManagerInstrumentation(eventModuleNames.
|
|
198
|
+
instrumentation: createManagerInstrumentation(eventModuleNames.documentUpload)
|
|
199
199
|
});
|
|
200
200
|
}
|
|
201
201
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as api } from "./api-CESGtpbH.esm.js";
|
|
2
|
-
import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-
|
|
2
|
+
import { n as eventModuleNames, o as topLevelStateName, s as createManagerInstrumentation } from "./events-CqFVBE7N.esm.js";
|
|
3
3
|
import { t as endpoints } from "./endpoints-BeTK0Mlt.esm.js";
|
|
4
4
|
import { a as fromPromise, c as createManager, r as assign, s as createActor, t as setup } from "./xstate.esm-C9wncMQa.esm.js";
|
|
5
5
|
import { t as isoDateToMs } from "./dateUtils-AksLQmgV.esm.js";
|
|
@@ -322,6 +322,31 @@ function createDynamicFormsActor(options) {
|
|
|
322
322
|
function hasNoErrors(errors) {
|
|
323
323
|
return Object.keys(errors ?? {}).length === 0;
|
|
324
324
|
}
|
|
325
|
+
function hasAnyAnswer(answers) {
|
|
326
|
+
for (const value of Object.values(answers)) if (typeof value === "string" && value.length > 0) return true;
|
|
327
|
+
return false;
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Maps a Dynamic Forms state-machine snapshot to the exact Figma
|
|
331
|
+
* "📊 Tracked Events" screen name. Source: Forms and Data entry Figma file
|
|
332
|
+
* (`https://www.figma.com/design/N6otHMuY2Hha5eBqRz0uC3/Forms-and-Data-entry---Latest-Designs?node-id=53-60567`).
|
|
333
|
+
* Family is `forms.*` with a single longform sub-family.
|
|
334
|
+
*
|
|
335
|
+
* `idle`, `loadingScreens`, `submitting`, `misconfigured`, and `closed` are
|
|
336
|
+
* intentionally unmapped — the Figma canvas does not define discrete
|
|
337
|
+
* tracked-event surfaces for them. They fall back to the generic
|
|
338
|
+
* `<module>.<state>` default.
|
|
339
|
+
*/
|
|
340
|
+
function getDynamicFormsScreenName(snapshot) {
|
|
341
|
+
const stateName = topLevelStateName(snapshot.value);
|
|
342
|
+
if (stateName === void 0) return void 0;
|
|
343
|
+
switch (stateName) {
|
|
344
|
+
case "inputting": return hasAnyAnswer(snapshot.context.answers) ? "forms.longform.filled" : "forms.longform.default";
|
|
345
|
+
case "success":
|
|
346
|
+
case "finished": return "forms.success";
|
|
347
|
+
default: return;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
325
350
|
function mapState(snapshot) {
|
|
326
351
|
const typedSnapshot = snapshot;
|
|
327
352
|
const { context } = typedSnapshot;
|
|
@@ -358,7 +383,7 @@ function mapState(snapshot) {
|
|
|
358
383
|
if (typedSnapshot.matches("closed")) return { status: "closed" };
|
|
359
384
|
return { status: "idle" };
|
|
360
385
|
}
|
|
361
|
-
function createApi({ actor }) {
|
|
386
|
+
function createApi({ actor, trackElementClicked }) {
|
|
362
387
|
return {
|
|
363
388
|
load() {
|
|
364
389
|
actor.send({ type: "LOAD" });
|
|
@@ -384,9 +409,11 @@ function createApi({ actor }) {
|
|
|
384
409
|
});
|
|
385
410
|
},
|
|
386
411
|
submit() {
|
|
412
|
+
trackElementClicked?.("submit");
|
|
387
413
|
actor.send({ type: "SUBMIT" });
|
|
388
414
|
},
|
|
389
415
|
close() {
|
|
416
|
+
trackElementClicked?.("close");
|
|
390
417
|
actor.send({ type: "CLOSE" });
|
|
391
418
|
}
|
|
392
419
|
};
|
|
@@ -404,7 +431,7 @@ function createDynamicFormsManager(options) {
|
|
|
404
431
|
actor: createDynamicFormsActor(options),
|
|
405
432
|
mapState,
|
|
406
433
|
createApi,
|
|
407
|
-
instrumentation: createManagerInstrumentation(eventModuleNames.forms)
|
|
434
|
+
instrumentation: createManagerInstrumentation(eventModuleNames.forms, { getEventScreenName: getDynamicFormsScreenName })
|
|
408
435
|
});
|
|
409
436
|
}
|
|
410
437
|
|
package/dist/ekyb.d.ts
CHANGED
package/dist/ekyb.esm.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import "./BrowserTimerProvider-DhNc_x02.esm.js";
|
|
2
2
|
import "./api-CESGtpbH.esm.js";
|
|
3
|
-
import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-
|
|
3
|
+
import { n as eventModuleNames, o as topLevelStateName, s as createManagerInstrumentation } from "./events-CqFVBE7N.esm.js";
|
|
4
4
|
import "./endpoints-BeTK0Mlt.esm.js";
|
|
5
5
|
import "./stats-BMNUG1AU.esm.js";
|
|
6
6
|
import "./IpifyProvider-D4LWD15E.esm.js";
|
|
7
7
|
import "./browserSimulation-B1dWiXp7.esm.js";
|
|
8
|
-
import "./sessionInitializer-
|
|
8
|
+
import "./sessionInitializer-DX2Nj28R.esm.js";
|
|
9
9
|
import "./platform-SKvEfCBh.esm.js";
|
|
10
10
|
import "./getBrowser-C8DP7oTB.esm.js";
|
|
11
11
|
import { c as createManager, s as createActor } from "./xstate.esm-C9wncMQa.esm.js";
|
|
12
12
|
import "./apiError-B-j-gyDx.esm.js";
|
|
13
|
-
import { a as SUPPORTED_COUNTRIES, i as DEV_ONLY_COUNTRIES, n as toEkybConfig, o as isSupportedCountry, r as ALL_COUNTRIES, t as ekybMachine } from "./ekybStateMachine-
|
|
13
|
+
import { a as SUPPORTED_COUNTRIES, i as DEV_ONLY_COUNTRIES, n as toEkybConfig, o as isSupportedCountry, r as ALL_COUNTRIES, t as ekybMachine } from "./ekybStateMachine-B9GEv84i.esm.js";
|
|
14
14
|
import "./addressSearch-DvmWXKZg.esm.js";
|
|
15
15
|
import "./session-DoVb-OcB.esm.js";
|
|
16
|
-
import "./flowServices-
|
|
16
|
+
import "./flowServices-DjNSRHb0.esm.js";
|
|
17
17
|
|
|
18
18
|
//#region src/modules/ekyb/ekybActor.ts
|
|
19
19
|
/**
|
|
@@ -26,6 +26,47 @@ function createEkybActor(options) {
|
|
|
26
26
|
|
|
27
27
|
//#endregion
|
|
28
28
|
//#region src/modules/ekyb/ekybManager.ts
|
|
29
|
+
/**
|
|
30
|
+
* Maps an eKYB state-machine snapshot to the exact Figma "📊 Tracked
|
|
31
|
+
* Events" screen name. Source: eKYC / eKYB Figma file → Tracked Events
|
|
32
|
+
* canvas
|
|
33
|
+
* (`https://www.figma.com/design/TWgYZVhurQCizfC4tfLEut/eKYC---eKYB---Ready-for-Dev?node-id=2977-10474`).
|
|
34
|
+
* Family is `eKYB.*` and section names are returned verbatim, emitted as-is
|
|
35
|
+
* on `event.screen` by `createManagerInstrumentation` (e.g. `eKYB.default`,
|
|
36
|
+
* `eKYB.processing`). See `docs/patterns/INSTRUMENTATION.md`.
|
|
37
|
+
*
|
|
38
|
+
* Figma sub-states not currently surfaced by the state machine (the form
|
|
39
|
+
* state machine collapses country selection, business details, and UBO
|
|
40
|
+
* entry into a single `form` compound state):
|
|
41
|
+
*
|
|
42
|
+
* - `eKYB.bdetails` (business details, empty) — UI step after country
|
|
43
|
+
* selection.
|
|
44
|
+
* - `eKYB.filled` (business details filled) — UI sub-state when required
|
|
45
|
+
* fields have values.
|
|
46
|
+
* - `eKYB.UBO` (empty / filled — the Figma canvas duplicates the section
|
|
47
|
+
* name for both variants) — UBO entry step.
|
|
48
|
+
*
|
|
49
|
+
* All three collapse onto `eKYB.default` (the country selection / form
|
|
50
|
+
* entry surface). Promoting them requires the state machine to surface
|
|
51
|
+
* step-based sub-states; tracked for a follow-up.
|
|
52
|
+
*
|
|
53
|
+
* `closed` is intentionally unmapped (terminal user-dismissed state —
|
|
54
|
+
* handled by `moduleClosed`).
|
|
55
|
+
*/
|
|
56
|
+
function getEkybScreenName(snapshot) {
|
|
57
|
+
const stateName = topLevelStateName(snapshot.value);
|
|
58
|
+
if (stateName === void 0) return void 0;
|
|
59
|
+
switch (stateName) {
|
|
60
|
+
case "idle":
|
|
61
|
+
case "loading":
|
|
62
|
+
case "form": return "eKYB.default";
|
|
63
|
+
case "submitting": return "eKYB.processing";
|
|
64
|
+
case "success":
|
|
65
|
+
case "finished": return "eKYB.success";
|
|
66
|
+
case "error": return "eKYB.error";
|
|
67
|
+
default: return;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
29
70
|
function mapState(snapshot) {
|
|
30
71
|
const typedSnapshot = snapshot;
|
|
31
72
|
const { context } = typedSnapshot;
|
|
@@ -129,7 +170,7 @@ function createEkybManager(options) {
|
|
|
129
170
|
actor: createEkybActor(options),
|
|
130
171
|
mapState,
|
|
131
172
|
createApi,
|
|
132
|
-
instrumentation: createManagerInstrumentation(eventModuleNames.ekyb)
|
|
173
|
+
instrumentation: createManagerInstrumentation(eventModuleNames.ekyb, { getEventScreenName: getEkybScreenName })
|
|
133
174
|
});
|
|
134
175
|
}
|
|
135
176
|
|
|
@@ -2,7 +2,7 @@ import { t as api } from "./api-CESGtpbH.esm.js";
|
|
|
2
2
|
import { t as endpoints } from "./endpoints-BeTK0Mlt.esm.js";
|
|
3
3
|
import { a as fromPromise, r as assign, t as setup } from "./xstate.esm-C9wncMQa.esm.js";
|
|
4
4
|
import { a as getPostalCodeMaxLength, c as STREET_LEVEL_REQUIRED_ERROR, d as usStateOptions, i as getPostalCodeErrorKey, l as fillFromSuggestion, n as FIXED_DIGIT_POSTAL_CODE_LENGTH, o as validatePostalCode, r as formatPostalCode, s as DYNAMIC_REQUIRED_KEY, t as debounceSearchActor, u as getStreetLevelErrorForSuggestion } from "./addressSearch-DvmWXKZg.esm.js";
|
|
5
|
-
import { t as getFlow } from "./flowServices-
|
|
5
|
+
import { t as getFlow } from "./flowServices-DjNSRHb0.esm.js";
|
|
6
6
|
|
|
7
7
|
//#region src/modules/ekyb/ekybConstants.ts
|
|
8
8
|
const UBO_INPUT_LIMIT = 8;
|
package/dist/ekyc.d.ts
CHANGED
package/dist/ekyc.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./BrowserTimerProvider-DhNc_x02.esm.js";
|
|
2
2
|
import "./api-CESGtpbH.esm.js";
|
|
3
|
-
import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-
|
|
3
|
+
import { n as eventModuleNames, o as topLevelStateName, s as createManagerInstrumentation } from "./events-CqFVBE7N.esm.js";
|
|
4
4
|
import "./endpoints-BeTK0Mlt.esm.js";
|
|
5
5
|
import { c as createManager, s as createActor } from "./xstate.esm-C9wncMQa.esm.js";
|
|
6
6
|
import "./cpf-BRzggV8G.esm.js";
|
|
@@ -18,6 +18,51 @@ function createEkycActor(options) {
|
|
|
18
18
|
|
|
19
19
|
//#endregion
|
|
20
20
|
//#region src/modules/ekyc/ekycManager.ts
|
|
21
|
+
/**
|
|
22
|
+
* Maps an eKYC state-machine snapshot to the exact Figma "📊 Tracked Events"
|
|
23
|
+
* screen name. Source: eKYC Figma file → Tracked Events canvas
|
|
24
|
+
* (`https://www.figma.com/design/TWgYZVhurQCizfC4tfLEut/eKYC---eKYB---Ready-for-Dev?node-id=2977-10474`).
|
|
25
|
+
* Family is `eKYC.*` and section names are returned verbatim, emitted as-is
|
|
26
|
+
* on `event.screen` by `createManagerInstrumentation` (e.g. `eKYC.filled`,
|
|
27
|
+
* `eKYC.verify`). See `docs/patterns/INSTRUMENTATION.md`.
|
|
28
|
+
*
|
|
29
|
+
* Note the canvas uses `eKYC.filled` for the entry surface (not
|
|
30
|
+
* `eKYC.default`) and `eKYC.verify` for the submit-in-flight surface (the
|
|
31
|
+
* success instance lives inside the verify section).
|
|
32
|
+
*
|
|
33
|
+
* State → screen mapping rationale:
|
|
34
|
+
*
|
|
35
|
+
* - `idle` / `loading` / `prefilling` collapse onto `eKYC.filled` — the
|
|
36
|
+
* prefill round-trip happens before the user sees the form, but Figma does
|
|
37
|
+
* not define a dedicated loading/prefill surface (the per-country
|
|
38
|
+
* `eKYC-empty *` instances in the `eKYC-States` section are visual
|
|
39
|
+
* references, not analytics screens). Keeping the family on `eKYC.filled`
|
|
40
|
+
* avoids falling back to a generic `eKYC.loading` default and mixing
|
|
41
|
+
* taxonomies in dashboards.
|
|
42
|
+
* - `submitting` → `eKYC.verify` (verifying surface).
|
|
43
|
+
* - `success`/`finished` → `eKYC.success` so the terminal `finished` state
|
|
44
|
+
* stays on the visible success canvas.
|
|
45
|
+
* - `misconfigured` is intentionally unmapped — Figma does not define a
|
|
46
|
+
* misconfiguration surface, and the misconfigured state is an SDK
|
|
47
|
+
* configuration error rather than a user-visible journey screen.
|
|
48
|
+
* - `closed` is intentionally unmapped (terminal user-dismissed state —
|
|
49
|
+
* handled by `moduleClosed`).
|
|
50
|
+
*/
|
|
51
|
+
function getEkycScreenName(snapshot) {
|
|
52
|
+
const stateName = topLevelStateName(snapshot.value);
|
|
53
|
+
if (stateName === void 0) return void 0;
|
|
54
|
+
switch (stateName) {
|
|
55
|
+
case "idle":
|
|
56
|
+
case "loading":
|
|
57
|
+
case "prefilling":
|
|
58
|
+
case "form": return "eKYC.filled";
|
|
59
|
+
case "submitting": return "eKYC.verify";
|
|
60
|
+
case "success":
|
|
61
|
+
case "finished": return "eKYC.success";
|
|
62
|
+
case "error": return "eKYC.error";
|
|
63
|
+
default: return;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
21
66
|
function mapState(snapshot) {
|
|
22
67
|
const typedSnapshot = snapshot;
|
|
23
68
|
const { context } = typedSnapshot;
|
|
@@ -101,7 +146,7 @@ function createEkycManager(options) {
|
|
|
101
146
|
actor: createEkycActor(options),
|
|
102
147
|
mapState,
|
|
103
148
|
createApi,
|
|
104
|
-
instrumentation: createManagerInstrumentation(eventModuleNames.ekyc)
|
|
149
|
+
instrumentation: createManagerInstrumentation(eventModuleNames.ekyc, { getEventScreenName: getEkycScreenName })
|
|
105
150
|
});
|
|
106
151
|
}
|
|
107
152
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "./Manager-BHn8wH8K.js";
|
|
2
2
|
import "./Actor-Y0_Fj-KL.js";
|
|
3
|
-
import { a as AE_CONSENT_KEYS, c as ConsentKey, d as ElectronicSignatureVariant, f as QE_CONSENT_KEYS, g as getDefaultConsentChecks, h as getConsentKeys, i as electronicSignatureMachine, l as ElectronicSignatureConfig, m as areAllConsented, n as ElectronicSignatureState, o as AeConsentKey, p as QeConsentKey, r as createElectronicSignatureManager, s as ConsentChecks, t as ElectronicSignatureManager, u as ElectronicSignatureDocument } from "./index-
|
|
3
|
+
import { a as AE_CONSENT_KEYS, c as ConsentKey, d as ElectronicSignatureVariant, f as QE_CONSENT_KEYS, g as getDefaultConsentChecks, h as getConsentKeys, i as electronicSignatureMachine, l as ElectronicSignatureConfig, m as areAllConsented, n as ElectronicSignatureState, o as AeConsentKey, p as QeConsentKey, r as createElectronicSignatureManager, s as ConsentChecks, t as ElectronicSignatureManager, u as ElectronicSignatureDocument } from "./index-BHyqaXBC.js";
|
|
4
4
|
export { AE_CONSENT_KEYS, AeConsentKey, ConsentChecks, ConsentKey, ElectronicSignatureConfig, ElectronicSignatureDocument, ElectronicSignatureManager, ElectronicSignatureState, ElectronicSignatureVariant, QE_CONSENT_KEYS, QeConsentKey, areAllConsented, createElectronicSignatureManager, electronicSignatureMachine, getConsentKeys, getDefaultConsentChecks };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "./api-CESGtpbH.esm.js";
|
|
2
|
-
import "./events-
|
|
2
|
+
import "./events-CqFVBE7N.esm.js";
|
|
3
3
|
import "./endpoints-BeTK0Mlt.esm.js";
|
|
4
4
|
import "./xstate.esm-C9wncMQa.esm.js";
|
|
5
5
|
import "./apiError-B-j-gyDx.esm.js";
|
|
6
|
-
import { a as areAllConsented, i as QE_CONSENT_KEYS, n as electronicSignatureMachine, o as getConsentKeys, r as AE_CONSENT_KEYS, s as getDefaultConsentChecks, t as createElectronicSignatureManager } from "./electronicSignatureManager-
|
|
6
|
+
import { a as areAllConsented, i as QE_CONSENT_KEYS, n as electronicSignatureMachine, o as getConsentKeys, r as AE_CONSENT_KEYS, s as getDefaultConsentChecks, t as createElectronicSignatureManager } from "./electronicSignatureManager-NH8uW69s.esm.js";
|
|
7
7
|
|
|
8
8
|
export { AE_CONSENT_KEYS, QE_CONSENT_KEYS, areAllConsented, createElectronicSignatureManager, electronicSignatureMachine, getConsentKeys, getDefaultConsentChecks };
|