@incodetech/core 2.0.0-rc.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/package.json +3 -3
  2. package/dist/Actor-CI32dTbG.d.ts +0 -2
  3. package/dist/BaseWasmProvider-C_DLEI40.esm.js +0 -1118
  4. package/dist/BrowserStorageProvider-CuOW1Er2.esm.js +0 -55
  5. package/dist/BrowserTimerProvider-DhNc_x02.esm.js +0 -22
  6. package/dist/ITimerCapability-C67ZRskg.esm.js +0 -7
  7. package/dist/IpifyProvider-D7jx52AL.esm.js +0 -139
  8. package/dist/Manager-C8PrhBOx.d.ts +0 -19
  9. package/dist/MotionSensorProvider-4v7xkqAp.esm.js +0 -254
  10. package/dist/OpenViduRecordingProvider-CMu6XVdc.esm.js +0 -87
  11. package/dist/StateMachine-BCQrZJhf.d.ts +0 -2
  12. package/dist/WasmUtilProvider-j98OJf-S.esm.js +0 -114
  13. package/dist/addressSearch-BpTbTWCa.esm.js +0 -430
  14. package/dist/ae-signature-DDDZmWXj.esm.js +0 -12
  15. package/dist/ae-signature.d.ts +0 -25
  16. package/dist/ae-signature.esm.js +0 -8
  17. package/dist/antifraud.d.ts +0 -57
  18. package/dist/antifraud.esm.js +0 -45
  19. package/dist/antifraudStateMachine-O0TMf6yc.esm.js +0 -39
  20. package/dist/api-CESGtpbH.esm.js +0 -53
  21. package/dist/authentication.d.ts +0 -12
  22. package/dist/authentication.esm.js +0 -25
  23. package/dist/authenticationManager-5M-fKzXx.esm.js +0 -67
  24. package/dist/authenticationManager-C83GNIhl.d.ts +0 -66
  25. package/dist/authenticationStateMachine-BMZqatiF.esm.js +0 -139
  26. package/dist/backCameraStream-DMdMeGk2.esm.js +0 -346
  27. package/dist/browserSimulation-gxD8cSpM.esm.js +0 -20
  28. package/dist/camera-DBSxa6ML.d.ts +0 -4
  29. package/dist/camera-PA2Ljri3.esm.js +0 -22
  30. package/dist/camera.d.ts +0 -15
  31. package/dist/camera.esm.js +0 -5
  32. package/dist/chunk-CRF6K_H_.esm.js +0 -49
  33. package/dist/consent.d.ts +0 -398
  34. package/dist/consent.esm.js +0 -79
  35. package/dist/consentStateMachine-CCT-B60O.esm.js +0 -151
  36. package/dist/cpf-PPz2Njto.esm.js +0 -38
  37. package/dist/cpf-ocr.d.ts +0 -204
  38. package/dist/cpf-ocr.esm.js +0 -177
  39. package/dist/cross-document-data-match.d.ts +0 -34
  40. package/dist/cross-document-data-match.esm.js +0 -71
  41. package/dist/curp-validation.d.ts +0 -188
  42. package/dist/curp-validation.esm.js +0 -110
  43. package/dist/curpValidationStateMachine-CitWLr2c.esm.js +0 -595
  44. package/dist/custom-fields.d.ts +0 -115
  45. package/dist/custom-fields.esm.js +0 -177
  46. package/dist/custom-watchlist.d.ts +0 -66
  47. package/dist/custom-watchlist.esm.js +0 -86
  48. package/dist/dateUtils-UoN5xswP.esm.js +0 -23
  49. package/dist/deepsightLoader-Cm4JIT_z.esm.js +0 -52
  50. package/dist/deepsightService-CEVxzehb.d.ts +0 -412
  51. package/dist/deepsightService-O74l4Y__.esm.js +0 -489
  52. package/dist/device.d.ts +0 -46
  53. package/dist/device.esm.js +0 -106
  54. package/dist/displayErrors-DqJ_IbsG.d.ts +0 -39
  55. package/dist/document-capture.d.ts +0 -906
  56. package/dist/document-capture.esm.js +0 -156
  57. package/dist/document-upload.d.ts +0 -331
  58. package/dist/document-upload.esm.js +0 -203
  59. package/dist/documentCaptureStateMachine-BqzTDy9k.esm.js +0 -394
  60. package/dist/dynamic-forms.d.ts +0 -178
  61. package/dist/dynamic-forms.esm.js +0 -323
  62. package/dist/ekyb.d.ts +0 -148
  63. package/dist/ekyb.esm.js +0 -127
  64. package/dist/ekybStateMachine-B59rQjgj.esm.js +0 -674
  65. package/dist/ekyc.d.ts +0 -164
  66. package/dist/ekyc.esm.js +0 -104
  67. package/dist/ekycStateMachine-oeO0Iekd.esm.js +0 -10626
  68. package/dist/electronic-signature.d.ts +0 -4
  69. package/dist/electronic-signature.esm.js +0 -7
  70. package/dist/electronicSignatureManager-D9OHzTpG.esm.js +0 -428
  71. package/dist/email.d.ts +0 -4
  72. package/dist/email.esm.js +0 -9
  73. package/dist/emailManager-DIfnS5g1.d.ts +0 -352
  74. package/dist/emailManager-wAV0LE-H.esm.js +0 -238
  75. package/dist/emailStateMachine-DOf4j58N.esm.js +0 -292
  76. package/dist/endpoints-CnN3SyDa.esm.js +0 -87
  77. package/dist/events-D6-e4vok.esm.js +0 -596
  78. package/dist/events.d.ts +0 -265
  79. package/dist/events.esm.js +0 -4
  80. package/dist/extensibility.d.ts +0 -122
  81. package/dist/extensibility.esm.js +0 -43
  82. package/dist/face-match.d.ts +0 -228
  83. package/dist/face-match.esm.js +0 -173
  84. package/dist/faceCaptureManagerFactory-Dh2PdGlF.esm.js +0 -290
  85. package/dist/faceCaptureManagerFactory-yqtpxjnN.d.ts +0 -690
  86. package/dist/faceCaptureSetup-B3faSpYA.esm.js +0 -873
  87. package/dist/faceMatchStateMachine-DNFrxTFS.esm.js +0 -127
  88. package/dist/flow-events.d.ts +0 -6
  89. package/dist/flow-events.esm.js +0 -0
  90. package/dist/flow.d.ts +0 -358
  91. package/dist/flow.esm.js +0 -825
  92. package/dist/flowCompletionService-DhkT4SRY.d.ts +0 -10
  93. package/dist/flowCompletionService-P54yzGvA.esm.js +0 -13
  94. package/dist/flowServices-DTsm-Vf1.esm.js +0 -188
  95. package/dist/geolocation.d.ts +0 -127
  96. package/dist/geolocation.esm.js +0 -89
  97. package/dist/geolocationStateMachine-asasuHY2.esm.js +0 -105
  98. package/dist/getBrowser-BSXUTWXw.esm.js +0 -41
  99. package/dist/getDeviceClass-BSntT9_j.esm.js +0 -14
  100. package/dist/government-validation.d.ts +0 -67
  101. package/dist/government-validation.esm.js +0 -81
  102. package/dist/governmentValidationStateMachine-BDDYrJTo.esm.js +0 -271
  103. package/dist/home.d.ts +0 -99
  104. package/dist/home.esm.js +0 -61
  105. package/dist/http.d.ts +0 -68
  106. package/dist/http.esm.js +0 -3
  107. package/dist/id-ocr.d.ts +0 -635
  108. package/dist/id-ocr.esm.js +0 -86
  109. package/dist/id-verification.d.ts +0 -190
  110. package/dist/id-verification.esm.js +0 -43
  111. package/dist/id.d.ts +0 -24
  112. package/dist/id.esm.js +0 -164
  113. package/dist/idCaptureManager-B9TGA5dq.d.ts +0 -956
  114. package/dist/idCaptureManager-DMK0GIt3.esm.js +0 -581
  115. package/dist/idCaptureStateMachine-Bq0fVZXl.esm.js +0 -2954
  116. package/dist/idOcrStateMachine-YbjjC_Gg.esm.js +0 -388
  117. package/dist/idVerificationStateMachine-xbw9HP1Z.esm.js +0 -71
  118. package/dist/identity-reuse.d.ts +0 -530
  119. package/dist/identity-reuse.esm.js +0 -274
  120. package/dist/index-BLKtMA0g.d.ts +0 -1177
  121. package/dist/index-BcRG8rtJ.d.ts +0 -97
  122. package/dist/index.d.ts +0 -3
  123. package/dist/index.esm.js +0 -12
  124. package/dist/invokeOnCaptureCallback-rc6kBHo5.esm.js +0 -30
  125. package/dist/lib-BB0B_qQX.esm.js +0 -12499
  126. package/dist/mandatory-consent.d.ts +0 -412
  127. package/dist/mandatory-consent.esm.js +0 -78
  128. package/dist/mandatoryConsentStateMachine-Cnco1jvn.esm.js +0 -126
  129. package/dist/openviduLazy-Cm0XFh_v.esm.js +0 -3
  130. package/dist/openviduLazy-Cok70ZSg.esm.js +0 -12
  131. package/dist/permissionServices-D_i6nzEw.esm.js +0 -50
  132. package/dist/phone.d.ts +0 -4
  133. package/dist/phone.esm.js +0 -9
  134. package/dist/phoneManager-B6M30hKE.d.ts +0 -397
  135. package/dist/phoneManager-DAJbGhlY.esm.js +0 -256
  136. package/dist/phoneStateMachine-CuPARRaT.esm.js +0 -351
  137. package/dist/platform-CfrjKhmi.esm.js +0 -83
  138. package/dist/qe-signature-DFo_Cc-I.esm.js +0 -12
  139. package/dist/qe-signature.d.ts +0 -25
  140. package/dist/qe-signature.esm.js +0 -8
  141. package/dist/recordingService-Ig2UgbLv.esm.js +0 -1003
  142. package/dist/redirect-to-mobile.d.ts +0 -107
  143. package/dist/redirect-to-mobile.esm.js +0 -102
  144. package/dist/redirectToMobileStateMachine-BOEqe46A.esm.js +0 -249
  145. package/dist/runChildModule-CqqwqAkW.esm.js +0 -219
  146. package/dist/selfie.d.ts +0 -26
  147. package/dist/selfie.esm.js +0 -146
  148. package/dist/selfieManager-D0lSgd-J.d.ts +0 -68
  149. package/dist/selfieManager-Duisl7qN.esm.js +0 -60
  150. package/dist/selfieStateMachine-D76whWEf.esm.js +0 -68
  151. package/dist/session-BS-d_vuE.esm.js +0 -3206
  152. package/dist/session.d.ts +0 -217
  153. package/dist/session.esm.js +0 -9
  154. package/dist/setup-Buy-hyj4.esm.js +0 -887
  155. package/dist/setup-C5AITV8m.d.ts +0 -254
  156. package/dist/signature.d.ts +0 -94
  157. package/dist/signature.esm.js +0 -66
  158. package/dist/signatureStateMachine-B5-QVUve.esm.js +0 -132
  159. package/dist/stats-CIfiPzb1.esm.js +0 -16
  160. package/dist/stats.d.ts +0 -16
  161. package/dist/stats.esm.js +0 -4
  162. package/dist/trust-graph.d.ts +0 -54
  163. package/dist/trust-graph.esm.js +0 -56
  164. package/dist/types-B06Ypu2F.d.ts +0 -49
  165. package/dist/types-BP1m8VRw.d.ts +0 -340
  166. package/dist/types-CAD4va6a.d.ts +0 -5
  167. package/dist/types-CFV9G_7j.d.ts +0 -24
  168. package/dist/warmup-CEcppFiS.d.ts +0 -63
  169. package/dist/wasm.d.ts +0 -15
  170. package/dist/wasm.esm.js +0 -12
  171. package/dist/watchlist-for-business.d.ts +0 -79
  172. package/dist/watchlist-for-business.esm.js +0 -148
  173. package/dist/watchlist.d.ts +0 -62
  174. package/dist/watchlist.esm.js +0 -86
  175. package/dist/watchlistServices-DMbUhkBX.esm.js +0 -12
  176. package/dist/workflow.d.ts +0 -907
  177. package/dist/workflow.esm.js +0 -702
  178. package/dist/xstate.esm-B70JrNqo.esm.js +0 -3404
@@ -1,190 +0,0 @@
1
- import { t as Manager } from "./Manager-C8PrhBOx.js";
2
- import "./Actor-CI32dTbG.js";
3
- import * as xstate899 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: xstate899.StateMachine<IdVerificationContext, {
36
- type: "LOAD";
37
- } | {
38
- type: "CONTINUE";
39
- }, {
40
- [x: string]: xstate899.ActorRefFromLogic<xstate899.PromiseActorLogic<ProcessIdResponse, {
41
- isSecondId: boolean;
42
- queueName: string;
43
- }, xstate899.EventObject>> | undefined;
44
- }, {
45
- src: "processId";
46
- logic: xstate899.PromiseActorLogic<ProcessIdResponse, {
47
- isSecondId: boolean;
48
- queueName: string;
49
- }, xstate899.EventObject>;
50
- id: string | undefined;
51
- }, never, {
52
- type: "isDocumentExpired";
53
- params: unknown;
54
- }, never, "idle" | "processing" | "finished" | "expired", string, IdVerificationInput, xstate899.NonReducibleUnknown, xstate899.EventObject, xstate899.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: xstate899.PromiseActorLogic<ProcessIdResponse, {
64
- isSecondId: boolean;
65
- queueName: string;
66
- }, xstate899.EventObject>;
67
- id: string | undefined;
68
- } extends infer T ? T extends {
69
- src: "processId";
70
- logic: xstate899.PromiseActorLogic<ProcessIdResponse, {
71
- isSecondId: boolean;
72
- queueName: string;
73
- }, xstate899.EventObject>;
74
- id: string | undefined;
75
- } ? T extends {
76
- src: TSrc;
77
- } ? xstate899.ConditionalRequired<[options?: ({
78
- id?: T["id"] | undefined;
79
- systemId?: string;
80
- input?: xstate899.InputFrom<T["logic"]> | undefined;
81
- syncSnapshot?: boolean;
82
- } & { [K in xstate899.RequiredActorOptions<T>]: unknown }) | undefined], xstate899.IsNotNever<xstate899.RequiredActorOptions<T>>> : never : never : never): xstate899.ActorRefFromLogic<xstate899.GetConcreteByKey<{
83
- src: "processId";
84
- logic: xstate899.PromiseActorLogic<ProcessIdResponse, {
85
- isSecondId: boolean;
86
- queueName: string;
87
- }, xstate899.EventObject>;
88
- id: string | undefined;
89
- }, "src", TSrc>["logic"]>;
90
- <TLogic extends xstate899.AnyActorLogic>(src: TLogic, ...[options]: xstate899.ConditionalRequired<[options?: ({
91
- id?: never;
92
- systemId?: string;
93
- input?: xstate899.InputFrom<TLogic> | undefined;
94
- syncSnapshot?: boolean;
95
- } & { [K in xstate899.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate899.IsNotNever<xstate899.RequiredLogicInput<TLogic>>>): xstate899.ActorRefFromLogic<TLogic>;
96
- };
97
- input: IdVerificationInput;
98
- self: xstate899.ActorRef<xstate899.MachineSnapshot<IdVerificationContext, {
99
- type: "LOAD";
100
- } | {
101
- type: "CONTINUE";
102
- }, Record<string, xstate899.AnyActorRef | undefined>, xstate899.StateValue, string, unknown, any, any>, {
103
- type: "LOAD";
104
- } | {
105
- type: "CONTINUE";
106
- }, xstate899.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: xstate899.ActorRef<xstate899.MachineSnapshot<IdVerificationContext, {
131
- type: "LOAD";
132
- } | {
133
- type: "CONTINUE";
134
- }, Record<string, xstate899.AnyActorRef>, xstate899.StateValue, string, unknown, any, any>, {
135
- type: "LOAD";
136
- } | {
137
- type: "CONTINUE";
138
- }, xstate899.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 };
@@ -1,43 +0,0 @@
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 DELETED
@@ -1,24 +0,0 @@
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-B9TGA5dq.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 DELETED
@@ -1,164 +0,0 @@
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-BS-d_vuE.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-Bq0fVZXl.esm.js";
23
- import { n as createIdCaptureActor, r as createIdCaptureManagerFromActor, t as createIdCaptureManager } from "./idCaptureManager-DMK0GIt3.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 };