@incodetech/core 2.0.0 → 2.0.1-rc.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/dist/Actor-CI32dTbG.d.ts +2 -0
- package/dist/BaseWasmProvider-C_DLEI40.esm.js +1118 -0
- package/dist/BrowserStorageProvider-CuOW1Er2.esm.js +55 -0
- package/dist/BrowserTimerProvider-DhNc_x02.esm.js +22 -0
- package/dist/ITimerCapability-C67ZRskg.esm.js +7 -0
- package/dist/IpifyProvider-D7jx52AL.esm.js +139 -0
- package/dist/Manager-C8PrhBOx.d.ts +19 -0
- package/dist/MotionSensorProvider-4v7xkqAp.esm.js +254 -0
- package/dist/OpenViduRecordingProvider-CMu6XVdc.esm.js +87 -0
- package/dist/StateMachine-BCQrZJhf.d.ts +2 -0
- package/dist/WasmUtilProvider-j98OJf-S.esm.js +114 -0
- package/dist/addressSearch-BpTbTWCa.esm.js +430 -0
- package/dist/ae-signature-DDDZmWXj.esm.js +12 -0
- package/dist/ae-signature.d.ts +25 -0
- package/dist/ae-signature.esm.js +8 -0
- package/dist/antifraud.d.ts +57 -0
- package/dist/antifraud.esm.js +45 -0
- package/dist/antifraudStateMachine-O0TMf6yc.esm.js +39 -0
- package/dist/api-CESGtpbH.esm.js +53 -0
- package/dist/authentication.d.ts +12 -0
- package/dist/authentication.esm.js +25 -0
- package/dist/authenticationManager-5M-fKzXx.esm.js +67 -0
- package/dist/authenticationManager-C83GNIhl.d.ts +66 -0
- package/dist/authenticationStateMachine-BMZqatiF.esm.js +139 -0
- package/dist/backCameraStream-DMdMeGk2.esm.js +346 -0
- package/dist/browserSimulation-gxD8cSpM.esm.js +20 -0
- package/dist/camera-DBSxa6ML.d.ts +4 -0
- package/dist/camera-PA2Ljri3.esm.js +22 -0
- package/dist/camera.d.ts +15 -0
- package/dist/camera.esm.js +5 -0
- package/dist/chunk-CRF6K_H_.esm.js +49 -0
- package/dist/consent.d.ts +398 -0
- package/dist/consent.esm.js +79 -0
- package/dist/consentStateMachine-CCT-B60O.esm.js +151 -0
- package/dist/cpf-PPz2Njto.esm.js +38 -0
- package/dist/cpf-ocr.d.ts +204 -0
- package/dist/cpf-ocr.esm.js +177 -0
- package/dist/cross-document-data-match.d.ts +34 -0
- package/dist/cross-document-data-match.esm.js +71 -0
- package/dist/curp-validation.d.ts +188 -0
- package/dist/curp-validation.esm.js +110 -0
- package/dist/curpValidationStateMachine-CitWLr2c.esm.js +595 -0
- package/dist/custom-fields.d.ts +115 -0
- package/dist/custom-fields.esm.js +177 -0
- package/dist/custom-watchlist.d.ts +66 -0
- package/dist/custom-watchlist.esm.js +86 -0
- package/dist/dateUtils-UoN5xswP.esm.js +23 -0
- package/dist/deepsightLoader-Cm4JIT_z.esm.js +52 -0
- package/dist/deepsightService-CEVxzehb.d.ts +412 -0
- package/dist/deepsightService-O74l4Y__.esm.js +489 -0
- package/dist/device.d.ts +46 -0
- package/dist/device.esm.js +106 -0
- package/dist/displayErrors-DqJ_IbsG.d.ts +39 -0
- package/dist/document-capture.d.ts +906 -0
- package/dist/document-capture.esm.js +156 -0
- package/dist/document-upload.d.ts +331 -0
- package/dist/document-upload.esm.js +203 -0
- package/dist/documentCaptureStateMachine-BqzTDy9k.esm.js +394 -0
- package/dist/dynamic-forms.d.ts +178 -0
- package/dist/dynamic-forms.esm.js +323 -0
- package/dist/ekyb.d.ts +148 -0
- package/dist/ekyb.esm.js +127 -0
- package/dist/ekybStateMachine-BR2let5f.esm.js +674 -0
- package/dist/ekyc.d.ts +164 -0
- package/dist/ekyc.esm.js +104 -0
- package/dist/ekycStateMachine-oeO0Iekd.esm.js +10626 -0
- package/dist/electronic-signature.d.ts +4 -0
- package/dist/electronic-signature.esm.js +7 -0
- package/dist/electronicSignatureManager-D9OHzTpG.esm.js +428 -0
- package/dist/email.d.ts +4 -0
- package/dist/email.esm.js +9 -0
- package/dist/emailManager-DIfnS5g1.d.ts +352 -0
- package/dist/emailManager-wAV0LE-H.esm.js +238 -0
- package/dist/emailStateMachine-DOf4j58N.esm.js +292 -0
- package/dist/endpoints-CnN3SyDa.esm.js +87 -0
- package/dist/events-D6-e4vok.esm.js +596 -0
- package/dist/events.d.ts +265 -0
- package/dist/events.esm.js +4 -0
- package/dist/extensibility.d.ts +122 -0
- package/dist/extensibility.esm.js +43 -0
- package/dist/face-match.d.ts +228 -0
- package/dist/face-match.esm.js +173 -0
- package/dist/faceCaptureManagerFactory-Dh2PdGlF.esm.js +290 -0
- package/dist/faceCaptureManagerFactory-yqtpxjnN.d.ts +690 -0
- package/dist/faceCaptureSetup-B3faSpYA.esm.js +873 -0
- package/dist/faceMatchStateMachine-DNFrxTFS.esm.js +127 -0
- package/dist/flow-events.d.ts +6 -0
- package/dist/flow-events.esm.js +0 -0
- package/dist/flow.d.ts +358 -0
- package/dist/flow.esm.js +825 -0
- package/dist/flowCompletionService-DhkT4SRY.d.ts +10 -0
- package/dist/flowCompletionService-P54yzGvA.esm.js +13 -0
- package/dist/flowServices-DG3IdWw6.esm.js +188 -0
- package/dist/geolocation.d.ts +127 -0
- package/dist/geolocation.esm.js +89 -0
- package/dist/geolocationStateMachine-asasuHY2.esm.js +105 -0
- package/dist/getBrowser-BSXUTWXw.esm.js +41 -0
- package/dist/getDeviceClass-BSntT9_j.esm.js +14 -0
- package/dist/government-validation.d.ts +67 -0
- package/dist/government-validation.esm.js +81 -0
- package/dist/governmentValidationStateMachine-BDDYrJTo.esm.js +271 -0
- package/dist/home.d.ts +99 -0
- package/dist/home.esm.js +61 -0
- package/dist/http.d.ts +68 -0
- package/dist/http.esm.js +3 -0
- package/dist/id-ocr.d.ts +635 -0
- package/dist/id-ocr.esm.js +86 -0
- package/dist/id-verification.d.ts +190 -0
- package/dist/id-verification.esm.js +43 -0
- package/dist/id.d.ts +24 -0
- package/dist/id.esm.js +164 -0
- package/dist/idCaptureManager-Fyd0eam-.d.ts +958 -0
- package/dist/idCaptureManager-ZPkD7Gjk.esm.js +581 -0
- package/dist/idCaptureStateMachine-BK0bPHoc.esm.js +2963 -0
- package/dist/idOcrStateMachine-YbjjC_Gg.esm.js +388 -0
- package/dist/idVerificationStateMachine-xbw9HP1Z.esm.js +71 -0
- package/dist/identity-reuse.d.ts +530 -0
- package/dist/identity-reuse.esm.js +274 -0
- package/dist/index-BcRG8rtJ.d.ts +97 -0
- package/dist/index-DZoqeAo9.d.ts +1177 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.esm.js +12 -0
- package/dist/invokeOnCaptureCallback-rc6kBHo5.esm.js +30 -0
- package/dist/lib-BB0B_qQX.esm.js +12499 -0
- package/dist/mandatory-consent.d.ts +412 -0
- package/dist/mandatory-consent.esm.js +78 -0
- package/dist/mandatoryConsentStateMachine-Cnco1jvn.esm.js +126 -0
- package/dist/openviduLazy-Cm0XFh_v.esm.js +3 -0
- package/dist/openviduLazy-Cok70ZSg.esm.js +12 -0
- package/dist/permissionServices-D_i6nzEw.esm.js +50 -0
- package/dist/phone.d.ts +4 -0
- package/dist/phone.esm.js +9 -0
- package/dist/phoneManager-B6M30hKE.d.ts +397 -0
- package/dist/phoneManager-DAJbGhlY.esm.js +256 -0
- package/dist/phoneStateMachine-CuPARRaT.esm.js +351 -0
- package/dist/platform-CfrjKhmi.esm.js +83 -0
- package/dist/qe-signature-DFo_Cc-I.esm.js +12 -0
- package/dist/qe-signature.d.ts +25 -0
- package/dist/qe-signature.esm.js +8 -0
- package/dist/recordingService-Ig2UgbLv.esm.js +1003 -0
- package/dist/redirect-to-mobile.d.ts +107 -0
- package/dist/redirect-to-mobile.esm.js +102 -0
- package/dist/redirectToMobileStateMachine-BOEqe46A.esm.js +249 -0
- package/dist/runChildModule-CqqwqAkW.esm.js +219 -0
- package/dist/selfie.d.ts +26 -0
- package/dist/selfie.esm.js +146 -0
- package/dist/selfieManager-D0lSgd-J.d.ts +68 -0
- package/dist/selfieManager-Duisl7qN.esm.js +60 -0
- package/dist/selfieStateMachine-D76whWEf.esm.js +68 -0
- package/dist/session-CGtQJJzB.esm.js +3206 -0
- package/dist/session.d.ts +217 -0
- package/dist/session.esm.js +9 -0
- package/dist/setup-C5AITV8m.d.ts +254 -0
- package/dist/setup-DsM8IG7k.esm.js +887 -0
- package/dist/signature.d.ts +94 -0
- package/dist/signature.esm.js +66 -0
- package/dist/signatureStateMachine-B5-QVUve.esm.js +132 -0
- package/dist/stats-CIfiPzb1.esm.js +16 -0
- package/dist/stats.d.ts +16 -0
- package/dist/stats.esm.js +4 -0
- package/dist/trust-graph.d.ts +54 -0
- package/dist/trust-graph.esm.js +56 -0
- package/dist/types-B06Ypu2F.d.ts +49 -0
- package/dist/types-BP1m8VRw.d.ts +340 -0
- package/dist/types-CAD4va6a.d.ts +5 -0
- package/dist/types-CFV9G_7j.d.ts +24 -0
- package/dist/warmup-CEcppFiS.d.ts +63 -0
- package/dist/wasm.d.ts +15 -0
- package/dist/wasm.esm.js +12 -0
- package/dist/watchlist-for-business.d.ts +79 -0
- package/dist/watchlist-for-business.esm.js +148 -0
- package/dist/watchlist.d.ts +62 -0
- package/dist/watchlist.esm.js +86 -0
- package/dist/watchlistServices-DMbUhkBX.esm.js +12 -0
- package/dist/workflow.d.ts +907 -0
- package/dist/workflow.esm.js +702 -0
- package/dist/xstate.esm-B70JrNqo.esm.js +3404 -0
- package/package.json +1 -1
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { t as Manager } from "./Manager-C8PrhBOx.js";
|
|
2
|
+
import "./Actor-CI32dTbG.js";
|
|
3
|
+
import * as xstate522 from "xstate";
|
|
4
|
+
|
|
5
|
+
//#region src/modules/id-verification/types.d.ts
|
|
6
|
+
type IdVerificationConfig = {
|
|
7
|
+
/** When true, verify the second captured ID via `/omni/process/second-id`. */
|
|
8
|
+
isSecondId?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Queue name forwarded as a query parameter. Always sent (default empty
|
|
11
|
+
* string) so the request shape matches the legacy `/omni/process/id?queueName=`
|
|
12
|
+
* call that returns 200 today.
|
|
13
|
+
*/
|
|
14
|
+
queueName?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Workflow engine writes the rank into the module configuration when one
|
|
17
|
+
* `ID` node represents the second ID. When set to `'SECOND_ID'` the
|
|
18
|
+
* verification routes to the second-id endpoint even without an explicit
|
|
19
|
+
* `isSecondId` flag.
|
|
20
|
+
*/
|
|
21
|
+
idRank?: 'FIRST_ID' | 'SECOND_ID' | 'THIRD_ID';
|
|
22
|
+
};
|
|
23
|
+
type ProcessIdResponse = {
|
|
24
|
+
isDocumentExpired: boolean;
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/modules/id-verification/idVerificationStateMachine.d.ts
|
|
28
|
+
type IdVerificationContext = {
|
|
29
|
+
config: IdVerificationConfig;
|
|
30
|
+
isSecondId: boolean;
|
|
31
|
+
};
|
|
32
|
+
type IdVerificationInput = {
|
|
33
|
+
config: IdVerificationConfig;
|
|
34
|
+
};
|
|
35
|
+
declare const idVerificationMachine: xstate522.StateMachine<IdVerificationContext, {
|
|
36
|
+
type: "LOAD";
|
|
37
|
+
} | {
|
|
38
|
+
type: "CONTINUE";
|
|
39
|
+
}, {
|
|
40
|
+
[x: string]: xstate522.ActorRefFromLogic<xstate522.PromiseActorLogic<ProcessIdResponse, {
|
|
41
|
+
isSecondId: boolean;
|
|
42
|
+
queueName: string;
|
|
43
|
+
}, xstate522.EventObject>> | undefined;
|
|
44
|
+
}, {
|
|
45
|
+
src: "processId";
|
|
46
|
+
logic: xstate522.PromiseActorLogic<ProcessIdResponse, {
|
|
47
|
+
isSecondId: boolean;
|
|
48
|
+
queueName: string;
|
|
49
|
+
}, xstate522.EventObject>;
|
|
50
|
+
id: string | undefined;
|
|
51
|
+
}, never, {
|
|
52
|
+
type: "isDocumentExpired";
|
|
53
|
+
params: unknown;
|
|
54
|
+
}, never, "idle" | "processing" | "finished" | "expired", string, IdVerificationInput, xstate522.NonReducibleUnknown, xstate522.EventObject, xstate522.MetaObject, {
|
|
55
|
+
readonly id: "idVerification";
|
|
56
|
+
readonly initial: "idle";
|
|
57
|
+
readonly context: ({
|
|
58
|
+
input
|
|
59
|
+
}: {
|
|
60
|
+
spawn: {
|
|
61
|
+
<TSrc extends "processId">(logic: TSrc, ...[options]: {
|
|
62
|
+
src: "processId";
|
|
63
|
+
logic: xstate522.PromiseActorLogic<ProcessIdResponse, {
|
|
64
|
+
isSecondId: boolean;
|
|
65
|
+
queueName: string;
|
|
66
|
+
}, xstate522.EventObject>;
|
|
67
|
+
id: string | undefined;
|
|
68
|
+
} extends infer T ? T extends {
|
|
69
|
+
src: "processId";
|
|
70
|
+
logic: xstate522.PromiseActorLogic<ProcessIdResponse, {
|
|
71
|
+
isSecondId: boolean;
|
|
72
|
+
queueName: string;
|
|
73
|
+
}, xstate522.EventObject>;
|
|
74
|
+
id: string | undefined;
|
|
75
|
+
} ? T extends {
|
|
76
|
+
src: TSrc;
|
|
77
|
+
} ? xstate522.ConditionalRequired<[options?: ({
|
|
78
|
+
id?: T["id"] | undefined;
|
|
79
|
+
systemId?: string;
|
|
80
|
+
input?: xstate522.InputFrom<T["logic"]> | undefined;
|
|
81
|
+
syncSnapshot?: boolean;
|
|
82
|
+
} & { [K in xstate522.RequiredActorOptions<T>]: unknown }) | undefined], xstate522.IsNotNever<xstate522.RequiredActorOptions<T>>> : never : never : never): xstate522.ActorRefFromLogic<xstate522.GetConcreteByKey<{
|
|
83
|
+
src: "processId";
|
|
84
|
+
logic: xstate522.PromiseActorLogic<ProcessIdResponse, {
|
|
85
|
+
isSecondId: boolean;
|
|
86
|
+
queueName: string;
|
|
87
|
+
}, xstate522.EventObject>;
|
|
88
|
+
id: string | undefined;
|
|
89
|
+
}, "src", TSrc>["logic"]>;
|
|
90
|
+
<TLogic extends xstate522.AnyActorLogic>(src: TLogic, ...[options]: xstate522.ConditionalRequired<[options?: ({
|
|
91
|
+
id?: never;
|
|
92
|
+
systemId?: string;
|
|
93
|
+
input?: xstate522.InputFrom<TLogic> | undefined;
|
|
94
|
+
syncSnapshot?: boolean;
|
|
95
|
+
} & { [K in xstate522.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate522.IsNotNever<xstate522.RequiredLogicInput<TLogic>>>): xstate522.ActorRefFromLogic<TLogic>;
|
|
96
|
+
};
|
|
97
|
+
input: IdVerificationInput;
|
|
98
|
+
self: xstate522.ActorRef<xstate522.MachineSnapshot<IdVerificationContext, {
|
|
99
|
+
type: "LOAD";
|
|
100
|
+
} | {
|
|
101
|
+
type: "CONTINUE";
|
|
102
|
+
}, Record<string, xstate522.AnyActorRef | undefined>, xstate522.StateValue, string, unknown, any, any>, {
|
|
103
|
+
type: "LOAD";
|
|
104
|
+
} | {
|
|
105
|
+
type: "CONTINUE";
|
|
106
|
+
}, xstate522.AnyEventObject>;
|
|
107
|
+
}) => {
|
|
108
|
+
config: IdVerificationConfig;
|
|
109
|
+
isSecondId: boolean;
|
|
110
|
+
};
|
|
111
|
+
readonly states: {
|
|
112
|
+
readonly idle: {
|
|
113
|
+
readonly on: {
|
|
114
|
+
readonly LOAD: "processing";
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
readonly processing: {
|
|
118
|
+
readonly invoke: {
|
|
119
|
+
readonly id: "processId";
|
|
120
|
+
readonly src: "processId";
|
|
121
|
+
readonly input: ({
|
|
122
|
+
context
|
|
123
|
+
}: {
|
|
124
|
+
context: IdVerificationContext;
|
|
125
|
+
event: {
|
|
126
|
+
type: "LOAD";
|
|
127
|
+
} | {
|
|
128
|
+
type: "CONTINUE";
|
|
129
|
+
};
|
|
130
|
+
self: xstate522.ActorRef<xstate522.MachineSnapshot<IdVerificationContext, {
|
|
131
|
+
type: "LOAD";
|
|
132
|
+
} | {
|
|
133
|
+
type: "CONTINUE";
|
|
134
|
+
}, Record<string, xstate522.AnyActorRef>, xstate522.StateValue, string, unknown, any, any>, {
|
|
135
|
+
type: "LOAD";
|
|
136
|
+
} | {
|
|
137
|
+
type: "CONTINUE";
|
|
138
|
+
}, xstate522.AnyEventObject>;
|
|
139
|
+
}) => {
|
|
140
|
+
isSecondId: boolean;
|
|
141
|
+
queueName: string;
|
|
142
|
+
};
|
|
143
|
+
readonly onDone: readonly [{
|
|
144
|
+
readonly target: "expired";
|
|
145
|
+
readonly guard: "isDocumentExpired";
|
|
146
|
+
}, {
|
|
147
|
+
readonly target: "finished";
|
|
148
|
+
}];
|
|
149
|
+
readonly onError: {
|
|
150
|
+
readonly target: "finished";
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
readonly expired: {
|
|
155
|
+
readonly on: {
|
|
156
|
+
readonly CONTINUE: "finished";
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
readonly finished: {
|
|
160
|
+
readonly type: "final";
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
}>;
|
|
164
|
+
//#endregion
|
|
165
|
+
//#region src/modules/id-verification/idVerificationActor.d.ts
|
|
166
|
+
type CreateIdVerificationActorOptions = {
|
|
167
|
+
config: IdVerificationConfig;
|
|
168
|
+
};
|
|
169
|
+
//#endregion
|
|
170
|
+
//#region src/modules/id-verification/idVerificationManager.d.ts
|
|
171
|
+
type IdVerificationIdleState = {
|
|
172
|
+
status: 'idle';
|
|
173
|
+
};
|
|
174
|
+
type IdVerificationProcessingState = {
|
|
175
|
+
status: 'processing';
|
|
176
|
+
};
|
|
177
|
+
type IdVerificationExpiredState = {
|
|
178
|
+
status: 'expired';
|
|
179
|
+
};
|
|
180
|
+
type IdVerificationFinishedState = {
|
|
181
|
+
status: 'finished';
|
|
182
|
+
};
|
|
183
|
+
type IdVerificationState = IdVerificationIdleState | IdVerificationProcessingState | IdVerificationExpiredState | IdVerificationFinishedState;
|
|
184
|
+
declare function createIdVerificationManager(options: CreateIdVerificationActorOptions): Manager<IdVerificationState> & {
|
|
185
|
+
load(): void;
|
|
186
|
+
continue(): void;
|
|
187
|
+
};
|
|
188
|
+
type IdVerificationManager = ReturnType<typeof createIdVerificationManager>;
|
|
189
|
+
//#endregion
|
|
190
|
+
export { type IdVerificationConfig, type IdVerificationManager, type IdVerificationState, createIdVerificationManager, idVerificationMachine };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import "./api-CESGtpbH.esm.js";
|
|
2
|
+
import { o as createManagerInstrumentation } from "./events-D6-e4vok.esm.js";
|
|
3
|
+
import "./endpoints-CnN3SyDa.esm.js";
|
|
4
|
+
import { c as createManager, s as createActor } from "./xstate.esm-B70JrNqo.esm.js";
|
|
5
|
+
import { t as idVerificationMachine } from "./idVerificationStateMachine-xbw9HP1Z.esm.js";
|
|
6
|
+
|
|
7
|
+
//#region src/modules/id-verification/idVerificationActor.ts
|
|
8
|
+
function createIdVerificationActor(options) {
|
|
9
|
+
return createActor(idVerificationMachine, { input: { config: options.config } }).start();
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/modules/id-verification/idVerificationManager.ts
|
|
14
|
+
function mapState(snapshot) {
|
|
15
|
+
const typedSnapshot = snapshot;
|
|
16
|
+
if (typedSnapshot.matches("idle")) return { status: "idle" };
|
|
17
|
+
if (typedSnapshot.matches("processing")) return { status: "processing" };
|
|
18
|
+
if (typedSnapshot.matches("expired")) return { status: "expired" };
|
|
19
|
+
if (typedSnapshot.matches("finished")) return { status: "finished" };
|
|
20
|
+
return { status: "idle" };
|
|
21
|
+
}
|
|
22
|
+
function createApi({ actor, trackElementClicked }) {
|
|
23
|
+
return {
|
|
24
|
+
load() {
|
|
25
|
+
actor.send({ type: "LOAD" });
|
|
26
|
+
},
|
|
27
|
+
continue() {
|
|
28
|
+
trackElementClicked?.("continue");
|
|
29
|
+
actor.send({ type: "CONTINUE" });
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function createIdVerificationManager(options) {
|
|
34
|
+
return createManager({
|
|
35
|
+
actor: createIdVerificationActor(options),
|
|
36
|
+
mapState,
|
|
37
|
+
createApi,
|
|
38
|
+
instrumentation: createManagerInstrumentation("ID_VERIFICATION")
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
//#endregion
|
|
43
|
+
export { createIdVerificationManager, idVerificationMachine };
|
package/dist/id.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import "./warmup-CEcppFiS.js";
|
|
2
|
+
import "./Manager-C8PrhBOx.js";
|
|
3
|
+
import "./Actor-CI32dTbG.js";
|
|
4
|
+
import "./StateMachine-BCQrZJhf.js";
|
|
5
|
+
import { t as CameraStream } from "./camera-DBSxa6ML.js";
|
|
6
|
+
import "./types-CFV9G_7j.js";
|
|
7
|
+
import "./types-BP1m8VRw.js";
|
|
8
|
+
import "./deepsightService-CEVxzehb.js";
|
|
9
|
+
import { n as PermissionStatus, t as PermissionResult } from "./types-CAD4va6a.js";
|
|
10
|
+
import { $ as MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES, A as CaptureIdResponse, B as IdCaptureGeometry, C as IdCaptureOnlyMachine, D as createIdCaptureActor, E as IdCaptureActor, F as ID_ERROR_CODES, G as IdCapturedImageData, H as IdCaptureMode, I as IdCaptureConfig, J as IdErrorCode, K as IdDocumentType, L as IdCaptureContext, M as CapturedImage, N as DetectionArea, O as IdCaptureMachine, P as DetectionStatus, Q as MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS, R as IdCaptureDependencies, S as createIdCaptureOnlyActor, T as CreateIdCaptureActorOptions, U as IdCaptureOnlyConfig, V as IdCaptureInput, W as IdCaptureThresholds, X as RecordingSession, Y as IdFlowStep, Z as UploadIdResponse, _ as uploadIdImage, a as IdCaptureInitResult, at as IdCaptureSettings, b as CreateIdCaptureOnlyActorOptions, c as UploadIdImageParams, d as initializeIdCapture, et as MANUAL_UPLOAD_MAX_RETRIES, f as preloadIdRecordingProvider, g as stopStream, h as stopRecording, it as DetectionOrientation, j as CaptureOnlyResponse, k as idCaptureMachine, l as UploadManualIdFileParams, m as startRecordingSession, n as IdCaptureManager, nt as ManualUploadSide, o as InitializeIdCaptureParams, p as processId, q as IdError, r as IdCaptureState, rt as ManualUploadTab, s as StartRecordingParams, t as createIdCaptureManager, tt as ManualUploadContext, u as ValidationError, v as uploadManualIdFile, w as idCaptureOnlyMachine, x as IdCaptureOnlyActor, y as validateUploadResponse, z as IdCaptureEvent } from "./idCaptureManager-Fyd0eam-.js";
|
|
11
|
+
|
|
12
|
+
//#region src/modules/id/idCaptureOnlyManager.d.ts
|
|
13
|
+
type IdCaptureOnlyManager = IdCaptureManager;
|
|
14
|
+
declare function createIdCaptureOnlyManagerFromActor(actor: IdCaptureOnlyActor, config: IdCaptureOnlyConfig): IdCaptureOnlyManager;
|
|
15
|
+
/**
|
|
16
|
+
* Creates a captureOnly ID capture manager.
|
|
17
|
+
*
|
|
18
|
+
* Unlike {@link createIdCaptureManager}, the captured ID image(s) are
|
|
19
|
+
* delivered locally to the integrator's `onCapture` callback instead of
|
|
20
|
+
* being uploaded to the Incode backend. `onCapture` is required.
|
|
21
|
+
*/
|
|
22
|
+
declare function createIdCaptureOnlyManager(options: CreateIdCaptureOnlyActorOptions): IdCaptureOnlyManager;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { CameraStream, CaptureIdResponse, CaptureOnlyResponse, CapturedImage, type CreateIdCaptureActorOptions, type CreateIdCaptureOnlyActorOptions, DetectionArea, DetectionOrientation, DetectionStatus, ID_ERROR_CODES, type IdCaptureActor, IdCaptureConfig, type IdCaptureContext, IdCaptureDependencies, type IdCaptureEvent, IdCaptureGeometry, IdCaptureInitResult, type IdCaptureInput, type IdCaptureMachine, type IdCaptureManager, IdCaptureMode, type IdCaptureOnlyActor, IdCaptureOnlyConfig, type IdCaptureOnlyMachine, type IdCaptureOnlyManager, IdCaptureSettings, type IdCaptureState, IdCaptureThresholds, IdCapturedImageData, IdDocumentType, IdError, IdErrorCode, IdFlowStep, InitializeIdCaptureParams, MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS, MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES, MANUAL_UPLOAD_MAX_RETRIES, ManualUploadContext, ManualUploadSide, ManualUploadTab, PermissionResult, PermissionStatus, RecordingSession, StartRecordingParams, UploadIdImageParams, UploadIdResponse, UploadManualIdFileParams, ValidationError, createIdCaptureActor, createIdCaptureManager, createIdCaptureOnlyActor, createIdCaptureOnlyManager, createIdCaptureOnlyManagerFromActor, idCaptureMachine, idCaptureOnlyMachine, initializeIdCapture, preloadIdRecordingProvider, processId, startRecordingSession, stopRecording, stopStream, uploadIdImage, uploadManualIdFile, validateUploadResponse };
|
package/dist/id.esm.js
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import "./BaseWasmProvider-C_DLEI40.esm.js";
|
|
2
|
+
import "./BrowserTimerProvider-DhNc_x02.esm.js";
|
|
3
|
+
import "./api-CESGtpbH.esm.js";
|
|
4
|
+
import { n as eventModuleNames } from "./events-D6-e4vok.esm.js";
|
|
5
|
+
import "./endpoints-CnN3SyDa.esm.js";
|
|
6
|
+
import "./session-CGtQJJzB.esm.js";
|
|
7
|
+
import "./IpifyProvider-D7jx52AL.esm.js";
|
|
8
|
+
import "./browserSimulation-gxD8cSpM.esm.js";
|
|
9
|
+
import { a as fromPromise, r as assign, s as createActor } from "./xstate.esm-B70JrNqo.esm.js";
|
|
10
|
+
import { t as BrowserStorageProvider } from "./BrowserStorageProvider-CuOW1Er2.esm.js";
|
|
11
|
+
import "./ITimerCapability-C67ZRskg.esm.js";
|
|
12
|
+
import "./camera-PA2Ljri3.esm.js";
|
|
13
|
+
import "./deepsightService-O74l4Y__.esm.js";
|
|
14
|
+
import "./recordingService-Ig2UgbLv.esm.js";
|
|
15
|
+
import "./platform-CfrjKhmi.esm.js";
|
|
16
|
+
import "./backCameraStream-DMdMeGk2.esm.js";
|
|
17
|
+
import "./getBrowser-BSXUTWXw.esm.js";
|
|
18
|
+
import "./stats-CIfiPzb1.esm.js";
|
|
19
|
+
import "./getDeviceClass-BSntT9_j.esm.js";
|
|
20
|
+
import "./MotionSensorProvider-4v7xkqAp.esm.js";
|
|
21
|
+
import "./permissionServices-D_i6nzEw.esm.js";
|
|
22
|
+
import { a as startRecordingSession, c as uploadIdImage, d as ID_ERROR_CODES, f as MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS, i as processId, l as uploadManualIdFile, m as MANUAL_UPLOAD_MAX_RETRIES, n as initializeIdCapture, o as stopRecording, p as MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES, r as preloadIdRecordingProvider, s as stopStream, t as idCaptureMachine, u as validateUploadResponse } from "./idCaptureStateMachine-BK0bPHoc.esm.js";
|
|
23
|
+
import { n as createIdCaptureActor, r as createIdCaptureManagerFromActor, t as createIdCaptureManager } from "./idCaptureManager-ZPkD7Gjk.esm.js";
|
|
24
|
+
import { t as invokeOnCaptureCallback } from "./invokeOnCaptureCallback-rc6kBHo5.esm.js";
|
|
25
|
+
|
|
26
|
+
//#region src/modules/id/idCaptureOnlyStateMachine.ts
|
|
27
|
+
function buildSubImage(canvas) {
|
|
28
|
+
if (!canvas) return void 0;
|
|
29
|
+
canvas.updateBlob();
|
|
30
|
+
const blobData = canvas.getBlobData();
|
|
31
|
+
if (!blobData) return void 0;
|
|
32
|
+
const imageBase64 = canvas.getBase64Image() ?? "";
|
|
33
|
+
if (!imageBase64) return void 0;
|
|
34
|
+
return {
|
|
35
|
+
imageBase64,
|
|
36
|
+
blob: blobData.blob,
|
|
37
|
+
url: blobData.url
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Local finalize for the captureOnly flow. Reads the canvases the base
|
|
42
|
+
* machine's `storeCapturedCanvasInProvider` already prepared:
|
|
43
|
+
* - `originalCanvas` — full unprocessed frame.
|
|
44
|
+
* - `transformedCanvas` — homography-warped crop produced by the WASM
|
|
45
|
+
* `transformPerspective`.
|
|
46
|
+
*
|
|
47
|
+
* Deepsight metadata is best-effort; failure does not block delivery.
|
|
48
|
+
*/
|
|
49
|
+
async function finalizeIdCaptureOnly(input, signal) {
|
|
50
|
+
const originalCanvas = input.canvas;
|
|
51
|
+
if (!originalCanvas) throw new Error(ID_ERROR_CODES.UPLOAD_ERROR);
|
|
52
|
+
const imageData = originalCanvas.getImageData() ?? void 0;
|
|
53
|
+
let metadata = "";
|
|
54
|
+
if (input.deepsightService && imageData) try {
|
|
55
|
+
await input.deepsightService.analyzeFrame(imageData);
|
|
56
|
+
if (signal.aborted) throw new DOMException("Aborted", "AbortError");
|
|
57
|
+
metadata = input.deepsightService.getMetadata();
|
|
58
|
+
} catch (error) {
|
|
59
|
+
if (error?.name === "AbortError") throw error;
|
|
60
|
+
}
|
|
61
|
+
const imageBase64 = originalCanvas.getBase64Image() ?? "";
|
|
62
|
+
originalCanvas.updateBlob();
|
|
63
|
+
const blobData = originalCanvas.getBlobData();
|
|
64
|
+
if (!blobData) throw new Error(ID_ERROR_CODES.UPLOAD_ERROR);
|
|
65
|
+
return {
|
|
66
|
+
imageBase64,
|
|
67
|
+
blob: blobData.blob,
|
|
68
|
+
url: blobData.url,
|
|
69
|
+
metadata,
|
|
70
|
+
croppedImage: buildSubImage(input.croppedCanvas ?? null)
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
const _idCaptureOnlyMachine = idCaptureMachine.provide({
|
|
74
|
+
actors: {
|
|
75
|
+
uploadIdImage: fromPromise(async ({ input, signal }) => {
|
|
76
|
+
return await finalizeIdCaptureOnly(input, signal);
|
|
77
|
+
}),
|
|
78
|
+
processId: fromPromise(async () => ({ isDocumentExpired: false })),
|
|
79
|
+
startRecording: fromPromise(async () => void 0)
|
|
80
|
+
},
|
|
81
|
+
actions: { storeCapturedImage: assign(({ context, event }) => {
|
|
82
|
+
if (!("output" in event) || !context.currentMode) return { captureOnlyImages: context.captureOnlyImages };
|
|
83
|
+
const image = event.output;
|
|
84
|
+
const side = context.currentMode === "back" ? "back" : "front";
|
|
85
|
+
return { captureOnlyImages: {
|
|
86
|
+
...context.captureOnlyImages,
|
|
87
|
+
[side]: image
|
|
88
|
+
} };
|
|
89
|
+
}) },
|
|
90
|
+
guards: {
|
|
91
|
+
hasUploadValidationError: () => false,
|
|
92
|
+
shouldContinueToBack: ({ context }) => {
|
|
93
|
+
if (context.currentMode !== "front" && context.currentMode !== "passport") return false;
|
|
94
|
+
if (context.config.onlyFront) return false;
|
|
95
|
+
if (context.config.onlyBack) return false;
|
|
96
|
+
if (context.config.usSmartCapture) return false;
|
|
97
|
+
return true;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
/**
|
|
102
|
+
* ID capture state machine variant for the captureOnly flow. Shares the full
|
|
103
|
+
* base ID-capture state tree (chooser, tutorial, permissions, capture,
|
|
104
|
+
* front/back finished, processing, finished); only the upload, process, and
|
|
105
|
+
* recording steps are local instead of remote.
|
|
106
|
+
*/
|
|
107
|
+
const idCaptureOnlyMachine = _idCaptureOnlyMachine;
|
|
108
|
+
|
|
109
|
+
//#endregion
|
|
110
|
+
//#region src/modules/id/idCaptureOnlyActor.ts
|
|
111
|
+
function createIdCaptureOnlyActor(options) {
|
|
112
|
+
const dependencies = options.dependencies ?? { storage: new BrowserStorageProvider() };
|
|
113
|
+
return createActor(idCaptureOnlyMachine, { input: {
|
|
114
|
+
config: options.config,
|
|
115
|
+
dependencies
|
|
116
|
+
} }).start();
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
//#endregion
|
|
120
|
+
//#region src/modules/id/idCaptureOnlyManager.ts
|
|
121
|
+
/**
|
|
122
|
+
* Wraps an ID captureOnly actor with a manager that fires `onCapture` exactly
|
|
123
|
+
* once when the actor reaches the `finished` final state. `complete` fires
|
|
124
|
+
* for both `finished` and `closed` — gating on `finished` prevents a
|
|
125
|
+
* user-quit mid-capture from delivering a partial payload.
|
|
126
|
+
*/
|
|
127
|
+
function attachOnCaptureFiring(actor, config) {
|
|
128
|
+
const subscription = actor.subscribe({ complete: () => {
|
|
129
|
+
const snapshot = actor.getSnapshot();
|
|
130
|
+
if (!snapshot.matches("finished")) return;
|
|
131
|
+
const frontImage = snapshot.context.captureOnlyImages.front;
|
|
132
|
+
if (!frontImage) return;
|
|
133
|
+
const response = {
|
|
134
|
+
frontImage,
|
|
135
|
+
backImage: snapshot.context.captureOnlyImages.back
|
|
136
|
+
};
|
|
137
|
+
invokeOnCaptureCallback(config.onCapture, response, eventModuleNames.id);
|
|
138
|
+
} });
|
|
139
|
+
return () => subscription.unsubscribe();
|
|
140
|
+
}
|
|
141
|
+
function createIdCaptureOnlyManagerFromActor(actor, config) {
|
|
142
|
+
const unsubscribe = attachOnCaptureFiring(actor, config);
|
|
143
|
+
const manager = createIdCaptureManagerFromActor(actor);
|
|
144
|
+
return {
|
|
145
|
+
...manager,
|
|
146
|
+
stop: () => {
|
|
147
|
+
unsubscribe();
|
|
148
|
+
manager.stop();
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Creates a captureOnly ID capture manager.
|
|
154
|
+
*
|
|
155
|
+
* Unlike {@link createIdCaptureManager}, the captured ID image(s) are
|
|
156
|
+
* delivered locally to the integrator's `onCapture` callback instead of
|
|
157
|
+
* being uploaded to the Incode backend. `onCapture` is required.
|
|
158
|
+
*/
|
|
159
|
+
function createIdCaptureOnlyManager(options) {
|
|
160
|
+
return createIdCaptureOnlyManagerFromActor(createIdCaptureOnlyActor(options), options.config);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
//#endregion
|
|
164
|
+
export { ID_ERROR_CODES, MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS, MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES, MANUAL_UPLOAD_MAX_RETRIES, createIdCaptureActor, createIdCaptureManager, createIdCaptureOnlyActor, createIdCaptureOnlyManager, createIdCaptureOnlyManagerFromActor, idCaptureMachine, idCaptureOnlyMachine, initializeIdCapture, preloadIdRecordingProvider, processId, startRecordingSession, stopRecording, stopStream, uploadIdImage, uploadManualIdFile, validateUploadResponse };
|