@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
package/dist/id-ocr.d.ts DELETED
@@ -1,635 +0,0 @@
1
- import { t as Manager } from "./Manager-C8PrhBOx.js";
2
- import "./Actor-CI32dTbG.js";
3
- import * as xstate601 from "xstate";
4
-
5
- //#region src/modules/id-ocr/types.d.ts
6
- type IdOcrConfig = {
7
- /** Allows user to edit OCR information @default false */
8
- editableOcr?: boolean;
9
- /**
10
- * When true (from flow/onboarding), after the first ID OCR step completes the
11
- * machine loads and optionally edits OCR for the second captured ID.
12
- */
13
- secondId?: boolean;
14
- /**
15
- * Session flow id (injected by orchestrated flow UI). When listed in `CPFFlowIds`
16
- * (`idOcrConsts`), only the CPF field is shown and validated; it maps to `documentNumber` on OCR.
17
- */
18
- flowId?: string;
19
- };
20
- type NameBean = {
21
- fullName?: string;
22
- firstName?: string;
23
- middleName?: string;
24
- givenName?: string;
25
- nameSuffix?: string;
26
- paternalLastName?: string;
27
- maternalLastName?: string;
28
- lastNameMrz?: string;
29
- };
30
- type AddressBean = {
31
- street?: string;
32
- colony?: string;
33
- postalCode?: string;
34
- city?: string;
35
- state?: string;
36
- label?: string;
37
- confidentGeolocation?: boolean;
38
- };
39
- type AddressStatements = {
40
- _id: string;
41
- dateType: string;
42
- addressStatementTimestamp: number;
43
- };
44
- type OcrData = {
45
- name: NameBean;
46
- givenName?: string;
47
- firstName?: string;
48
- middleName?: string;
49
- nameSuffix?: string;
50
- mothersSurname?: string;
51
- fathersSurname?: string;
52
- nickName?: string;
53
- address?: string;
54
- street?: string;
55
- colony?: string;
56
- postalCode?: string;
57
- city?: string;
58
- state?: string;
59
- stateCode?: string;
60
- countryCode?: string;
61
- addressFields?: AddressBean;
62
- fullAddress?: boolean;
63
- invalidAddress?: boolean;
64
- checkedAddress?: string;
65
- checkedAddressBean?: AddressBean;
66
- exteriorNumber?: string;
67
- interiorNumber?: string;
68
- addressFromStatement?: string;
69
- addressFieldsFromStatement?: AddressBean;
70
- invalidAddressFromStatement?: boolean;
71
- addressStatementEmissionDate?: number;
72
- documentType?: string;
73
- addressStatementTimestamps?: AddressStatements[];
74
- poaName?: string;
75
- typeOfId?: string;
76
- documentFrontSubtype?: string;
77
- documentBackSubtype?: string;
78
- birthDate?: number | string;
79
- gender?: string;
80
- claveDeElector?: string;
81
- curp?: string;
82
- numeroEmisionCredencial?: string;
83
- cic?: string;
84
- ocr?: string;
85
- documentNumber?: string;
86
- personalNumber?: string;
87
- refNumber?: string;
88
- nue?: string;
89
- externalId?: string;
90
- issuedAt?: string;
91
- expireAt?: string;
92
- expirationDate?: number;
93
- issueDate?: number;
94
- registrationDate?: number;
95
- issuingCountry?: string;
96
- issuingState?: string;
97
- birthPlace?: string;
98
- issuingAuthority?: string;
99
- height?: string;
100
- weight?: string;
101
- eyeColor?: string;
102
- hairColor?: string;
103
- bloodType?: string;
104
- maritalStatus?: string;
105
- nationality?: string;
106
- nationalityMrz?: string;
107
- classes?: string;
108
- cond?: string;
109
- mentions?: string;
110
- restrictions?: string;
111
- mrz1?: string;
112
- mrz2?: string;
113
- mrz3?: string;
114
- fullNameMrz?: string;
115
- documentNumberCheckDigit?: string;
116
- dateOfBirthCheckDigit?: string;
117
- expirationDateCheckDigit?: string;
118
- fathersName?: string;
119
- mothersName?: string;
120
- federalRevenueNumber?: string;
121
- originDocumentId?: string;
122
- driversLicenseCategory?: string;
123
- controlNumber?: string;
124
- renach?: string;
125
- ocrReliabilityConfidence?: number;
126
- ocrDataConfidence?: unknown;
127
- };
128
- type UpdateOcrDataParams = {
129
- address?: string;
130
- documentNumber?: string;
131
- name?: string;
132
- firstName?: string;
133
- lastName?: string;
134
- paternalLastName?: string;
135
- maternalLastName?: string;
136
- personalNumber?: string;
137
- curp?: string;
138
- email?: string;
139
- birthDate?: string;
140
- expireAt?: string;
141
- gender?: string;
142
- issuingCountry?: string;
143
- };
144
- type ValidationRule = {
145
- type: 'required';
146
- } | {
147
- type: 'minAge';
148
- years: number;
149
- } | {
150
- type: 'cpf';
151
- };
152
- type OcrFieldConfig = {
153
- key: keyof UpdateOcrDataParams;
154
- labelKey: string;
155
- type: 'text' | 'date' | 'radio';
156
- options?: {
157
- label: string;
158
- value: string;
159
- }[];
160
- validation?: ValidationRule[];
161
- required: boolean;
162
- };
163
- type UpdateOcrResponse = {
164
- success: boolean;
165
- };
166
- //#endregion
167
- //#region src/modules/id-ocr/idOcrStateMachine.d.ts
168
- type IdOcrOcrDocument = 'first' | 'second';
169
- type IdOcrContext = {
170
- config: IdOcrConfig;
171
- error?: string;
172
- formData: UpdateOcrDataParams;
173
- editedFields: UpdateOcrDataParams;
174
- activeOcrDocument: IdOcrOcrDocument;
175
- validationErrors?: Partial<Record<keyof UpdateOcrDataParams, string>>;
176
- };
177
- type IdOcrInput = {
178
- config: IdOcrConfig;
179
- };
180
- declare const idOcrStateMachine: xstate601.StateMachine<IdOcrContext, {
181
- type: "LOAD";
182
- } | {
183
- type: "DATA_CHANGED";
184
- field: keyof UpdateOcrDataParams;
185
- value: string;
186
- } | {
187
- type: "VALIDATE_FIELD";
188
- field: keyof UpdateOcrDataParams;
189
- } | {
190
- type: "CONTINUE";
191
- } | {
192
- type: "RETRY";
193
- }, {
194
- [x: string]: xstate601.ActorRefFromLogic<xstate601.PromiseActorLogic<OcrData, {
195
- isSecondId: boolean;
196
- }, xstate601.EventObject>> | xstate601.ActorRefFromLogic<xstate601.PromiseActorLogic<UpdateOcrResponse, {
197
- params: UpdateOcrDataParams;
198
- isSecondId: boolean;
199
- }, xstate601.EventObject>> | undefined;
200
- }, xstate601.Values<{
201
- getOcrData: {
202
- src: "getOcrData";
203
- logic: xstate601.PromiseActorLogic<OcrData, {
204
- isSecondId: boolean;
205
- }, xstate601.EventObject>;
206
- id: string | undefined;
207
- };
208
- updateOcrData: {
209
- src: "updateOcrData";
210
- logic: xstate601.PromiseActorLogic<UpdateOcrResponse, {
211
- params: UpdateOcrDataParams;
212
- isSecondId: boolean;
213
- }, xstate601.EventObject>;
214
- id: string | undefined;
215
- };
216
- }>, xstate601.Values<{
217
- setError: {
218
- type: "setError";
219
- params: xstate601.NonReducibleUnknown;
220
- };
221
- setInitialData: {
222
- type: "setInitialData";
223
- params: xstate601.NonReducibleUnknown;
224
- };
225
- updateField: {
226
- type: "updateField";
227
- params: xstate601.NonReducibleUnknown;
228
- };
229
- clearFieldValidationError: {
230
- type: "clearFieldValidationError";
231
- params: xstate601.NonReducibleUnknown;
232
- };
233
- setOcrValidationErrors: {
234
- type: "setOcrValidationErrors";
235
- params: xstate601.NonReducibleUnknown;
236
- };
237
- validateFormField: {
238
- type: "validateFormField";
239
- params: xstate601.NonReducibleUnknown;
240
- };
241
- beginSecondIdOcrPhase: {
242
- type: "beginSecondIdOcrPhase";
243
- params: xstate601.NonReducibleUnknown;
244
- };
245
- resetForRetry: {
246
- type: "resetForRetry";
247
- params: xstate601.NonReducibleUnknown;
248
- };
249
- computeValidationResult: {
250
- type: "computeValidationResult";
251
- params: xstate601.NonReducibleUnknown;
252
- };
253
- }>, xstate601.Values<{
254
- isOcrEditable: {
255
- type: "isOcrEditable";
256
- params: unknown;
257
- };
258
- shouldLoadSecondOcrAfterFirst: {
259
- type: "shouldLoadSecondOcrAfterFirst";
260
- params: unknown;
261
- };
262
- isOcrFormValid: {
263
- type: "isOcrFormValid";
264
- params: unknown;
265
- };
266
- shouldSubmit: {
267
- type: "shouldSubmit";
268
- params: unknown;
269
- };
270
- shouldProceedWithoutSubmitToSecondId: {
271
- type: "shouldProceedWithoutSubmitToSecondId";
272
- params: unknown;
273
- };
274
- }>, never, "error" | "idle" | "success" | "finished" | "loading" | "submitting" | "inputting" | "readonly" | "validatingContinue", string, IdOcrInput, xstate601.NonReducibleUnknown, xstate601.EventObject, xstate601.MetaObject, {
275
- readonly id: "idOcr";
276
- readonly initial: "idle";
277
- readonly context: ({
278
- input
279
- }: {
280
- spawn: {
281
- <TSrc extends "getOcrData" | "updateOcrData">(logic: TSrc, ...[options]: ({
282
- src: "getOcrData";
283
- logic: xstate601.PromiseActorLogic<OcrData, {
284
- isSecondId: boolean;
285
- }, xstate601.EventObject>;
286
- id: string | undefined;
287
- } extends infer T ? T extends {
288
- src: "getOcrData";
289
- logic: xstate601.PromiseActorLogic<OcrData, {
290
- isSecondId: boolean;
291
- }, xstate601.EventObject>;
292
- id: string | undefined;
293
- } ? T extends {
294
- src: TSrc;
295
- } ? xstate601.ConditionalRequired<[options?: ({
296
- id?: T["id"] | undefined;
297
- systemId?: string;
298
- input?: xstate601.InputFrom<T["logic"]> | undefined;
299
- syncSnapshot?: boolean;
300
- } & { [K in xstate601.RequiredActorOptions<T>]: unknown }) | undefined], xstate601.IsNotNever<xstate601.RequiredActorOptions<T>>> : never : never : never) | ({
301
- src: "updateOcrData";
302
- logic: xstate601.PromiseActorLogic<UpdateOcrResponse, {
303
- params: UpdateOcrDataParams;
304
- isSecondId: boolean;
305
- }, xstate601.EventObject>;
306
- id: string | undefined;
307
- } extends infer T_1 ? T_1 extends {
308
- src: "updateOcrData";
309
- logic: xstate601.PromiseActorLogic<UpdateOcrResponse, {
310
- params: UpdateOcrDataParams;
311
- isSecondId: boolean;
312
- }, xstate601.EventObject>;
313
- id: string | undefined;
314
- } ? T_1 extends {
315
- src: TSrc;
316
- } ? xstate601.ConditionalRequired<[options?: ({
317
- id?: T_1["id"] | undefined;
318
- systemId?: string;
319
- input?: xstate601.InputFrom<T_1["logic"]> | undefined;
320
- syncSnapshot?: boolean;
321
- } & { [K_1 in xstate601.RequiredActorOptions<T_1>]: unknown }) | undefined], xstate601.IsNotNever<xstate601.RequiredActorOptions<T_1>>> : never : never : never)): xstate601.ActorRefFromLogic<xstate601.GetConcreteByKey<xstate601.Values<{
322
- getOcrData: {
323
- src: "getOcrData";
324
- logic: xstate601.PromiseActorLogic<OcrData, {
325
- isSecondId: boolean;
326
- }, xstate601.EventObject>;
327
- id: string | undefined;
328
- };
329
- updateOcrData: {
330
- src: "updateOcrData";
331
- logic: xstate601.PromiseActorLogic<UpdateOcrResponse, {
332
- params: UpdateOcrDataParams;
333
- isSecondId: boolean;
334
- }, xstate601.EventObject>;
335
- id: string | undefined;
336
- };
337
- }>, "src", TSrc>["logic"]>;
338
- <TLogic extends xstate601.AnyActorLogic>(src: TLogic, ...[options]: xstate601.ConditionalRequired<[options?: ({
339
- id?: never;
340
- systemId?: string;
341
- input?: xstate601.InputFrom<TLogic> | undefined;
342
- syncSnapshot?: boolean;
343
- } & { [K in xstate601.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate601.IsNotNever<xstate601.RequiredLogicInput<TLogic>>>): xstate601.ActorRefFromLogic<TLogic>;
344
- };
345
- input: IdOcrInput;
346
- self: xstate601.ActorRef<xstate601.MachineSnapshot<IdOcrContext, {
347
- type: "LOAD";
348
- } | {
349
- type: "DATA_CHANGED";
350
- field: keyof UpdateOcrDataParams;
351
- value: string;
352
- } | {
353
- type: "VALIDATE_FIELD";
354
- field: keyof UpdateOcrDataParams;
355
- } | {
356
- type: "CONTINUE";
357
- } | {
358
- type: "RETRY";
359
- }, Record<string, xstate601.AnyActorRef | undefined>, xstate601.StateValue, string, unknown, any, any>, {
360
- type: "LOAD";
361
- } | {
362
- type: "DATA_CHANGED";
363
- field: keyof UpdateOcrDataParams;
364
- value: string;
365
- } | {
366
- type: "VALIDATE_FIELD";
367
- field: keyof UpdateOcrDataParams;
368
- } | {
369
- type: "CONTINUE";
370
- } | {
371
- type: "RETRY";
372
- }, xstate601.AnyEventObject>;
373
- }) => {
374
- config: IdOcrConfig;
375
- formData: UpdateOcrDataParams;
376
- editedFields: {};
377
- activeOcrDocument: IdOcrOcrDocument;
378
- };
379
- readonly states: {
380
- readonly idle: {
381
- readonly on: {
382
- readonly LOAD: readonly [{
383
- readonly target: "loading";
384
- }];
385
- };
386
- };
387
- readonly loading: {
388
- readonly invoke: {
389
- readonly src: "getOcrData";
390
- readonly input: ({
391
- context
392
- }: {
393
- context: IdOcrContext;
394
- event: {
395
- type: "LOAD";
396
- } | {
397
- type: "DATA_CHANGED";
398
- field: keyof UpdateOcrDataParams;
399
- value: string;
400
- } | {
401
- type: "VALIDATE_FIELD";
402
- field: keyof UpdateOcrDataParams;
403
- } | {
404
- type: "CONTINUE";
405
- } | {
406
- type: "RETRY";
407
- };
408
- self: xstate601.ActorRef<xstate601.MachineSnapshot<IdOcrContext, {
409
- type: "LOAD";
410
- } | {
411
- type: "DATA_CHANGED";
412
- field: keyof UpdateOcrDataParams;
413
- value: string;
414
- } | {
415
- type: "VALIDATE_FIELD";
416
- field: keyof UpdateOcrDataParams;
417
- } | {
418
- type: "CONTINUE";
419
- } | {
420
- type: "RETRY";
421
- }, Record<string, xstate601.AnyActorRef>, xstate601.StateValue, string, unknown, any, any>, {
422
- type: "LOAD";
423
- } | {
424
- type: "DATA_CHANGED";
425
- field: keyof UpdateOcrDataParams;
426
- value: string;
427
- } | {
428
- type: "VALIDATE_FIELD";
429
- field: keyof UpdateOcrDataParams;
430
- } | {
431
- type: "CONTINUE";
432
- } | {
433
- type: "RETRY";
434
- }, xstate601.AnyEventObject>;
435
- }) => {
436
- isSecondId: boolean;
437
- };
438
- readonly onDone: readonly [{
439
- readonly target: "inputting";
440
- readonly guard: "isOcrEditable";
441
- readonly actions: "setInitialData";
442
- }, {
443
- readonly target: "readonly";
444
- readonly actions: "setInitialData";
445
- }];
446
- readonly onError: {
447
- readonly target: "error";
448
- readonly actions: "setError";
449
- };
450
- };
451
- };
452
- readonly readonly: {
453
- readonly on: {
454
- readonly CONTINUE: readonly [{
455
- readonly target: "loading";
456
- readonly guard: "shouldLoadSecondOcrAfterFirst";
457
- readonly actions: "beginSecondIdOcrPhase";
458
- }, {
459
- readonly target: "success";
460
- }];
461
- };
462
- };
463
- readonly inputting: {
464
- readonly on: {
465
- readonly DATA_CHANGED: {
466
- readonly actions: readonly ["updateField", "clearFieldValidationError"];
467
- };
468
- readonly VALIDATE_FIELD: {
469
- readonly actions: "validateFormField";
470
- };
471
- readonly CONTINUE: {
472
- readonly target: "validatingContinue";
473
- };
474
- };
475
- };
476
- readonly validatingContinue: {
477
- readonly entry: "computeValidationResult";
478
- readonly always: readonly [{
479
- readonly guard: "shouldSubmit";
480
- readonly target: "submitting";
481
- }, {
482
- readonly guard: "shouldProceedWithoutSubmitToSecondId";
483
- readonly target: "loading";
484
- readonly actions: "beginSecondIdOcrPhase";
485
- }, {
486
- readonly guard: "isOcrFormValid";
487
- readonly target: "success";
488
- }, {
489
- readonly target: "inputting";
490
- }];
491
- };
492
- readonly submitting: {
493
- readonly invoke: {
494
- readonly src: "updateOcrData";
495
- readonly input: ({
496
- context
497
- }: {
498
- context: IdOcrContext;
499
- event: {
500
- type: "LOAD";
501
- } | {
502
- type: "DATA_CHANGED";
503
- field: keyof UpdateOcrDataParams;
504
- value: string;
505
- } | {
506
- type: "VALIDATE_FIELD";
507
- field: keyof UpdateOcrDataParams;
508
- } | {
509
- type: "CONTINUE";
510
- } | {
511
- type: "RETRY";
512
- };
513
- self: xstate601.ActorRef<xstate601.MachineSnapshot<IdOcrContext, {
514
- type: "LOAD";
515
- } | {
516
- type: "DATA_CHANGED";
517
- field: keyof UpdateOcrDataParams;
518
- value: string;
519
- } | {
520
- type: "VALIDATE_FIELD";
521
- field: keyof UpdateOcrDataParams;
522
- } | {
523
- type: "CONTINUE";
524
- } | {
525
- type: "RETRY";
526
- }, Record<string, xstate601.AnyActorRef>, xstate601.StateValue, string, unknown, any, any>, {
527
- type: "LOAD";
528
- } | {
529
- type: "DATA_CHANGED";
530
- field: keyof UpdateOcrDataParams;
531
- value: string;
532
- } | {
533
- type: "VALIDATE_FIELD";
534
- field: keyof UpdateOcrDataParams;
535
- } | {
536
- type: "CONTINUE";
537
- } | {
538
- type: "RETRY";
539
- }, xstate601.AnyEventObject>;
540
- }) => {
541
- params: UpdateOcrDataParams;
542
- isSecondId: boolean;
543
- };
544
- readonly onDone: readonly [{
545
- readonly target: "loading";
546
- readonly guard: "shouldLoadSecondOcrAfterFirst";
547
- readonly actions: "beginSecondIdOcrPhase";
548
- }, {
549
- readonly target: "success";
550
- }];
551
- readonly onError: {
552
- readonly target: "error";
553
- readonly actions: "setError";
554
- };
555
- };
556
- };
557
- readonly error: {
558
- readonly on: {
559
- readonly RETRY: {
560
- readonly target: "loading";
561
- readonly actions: "resetForRetry";
562
- };
563
- };
564
- };
565
- readonly success: {
566
- readonly after: {
567
- readonly 3000: "finished";
568
- };
569
- };
570
- readonly finished: {
571
- readonly type: "final";
572
- };
573
- };
574
- }>;
575
- //#endregion
576
- //#region src/modules/id-ocr/idOcrActor.d.ts
577
- type CreateIdOcrActorOptions = {
578
- config: IdOcrConfig;
579
- };
580
- //#endregion
581
- //#region src/modules/id-ocr/idOcrManager.d.ts
582
- type IdOcrIdleState = {
583
- status: 'idle';
584
- };
585
- type IdOcrLoadingState = {
586
- status: 'loading';
587
- ocrDocument: IdOcrOcrDocument;
588
- };
589
- type IdOcrReadonlyState = {
590
- status: 'readonly';
591
- formData: UpdateOcrDataParams;
592
- editableOcr: boolean;
593
- ocrDocument: IdOcrOcrDocument;
594
- };
595
- type IdOcrInputtingState = {
596
- status: 'inputting';
597
- formData: UpdateOcrDataParams;
598
- editedFields: UpdateOcrDataParams;
599
- editableOcr: boolean;
600
- ocrDocument: IdOcrOcrDocument;
601
- validationErrors?: Partial<Record<keyof UpdateOcrDataParams, string>>;
602
- };
603
- type IdOcrSubmittingState = {
604
- status: 'submitting';
605
- ocrDocument: IdOcrOcrDocument;
606
- };
607
- type IdOcrFinishedState = {
608
- status: 'finished';
609
- };
610
- type IdOcrErrorState = {
611
- status: 'error';
612
- error: string;
613
- };
614
- type IdOcrSuccessState = {
615
- status: 'success';
616
- };
617
- type IdOcrState = IdOcrIdleState | IdOcrLoadingState | IdOcrReadonlyState | IdOcrInputtingState | IdOcrSubmittingState | IdOcrFinishedState | IdOcrErrorState | IdOcrSuccessState;
618
- declare function createIdOcrManager(options: CreateIdOcrActorOptions): Manager<IdOcrState> & {
619
- load(): void;
620
- setField(field: keyof UpdateOcrDataParams, value: string): void;
621
- validateField(field: keyof UpdateOcrDataParams): void;
622
- continue(): void;
623
- retry(): void;
624
- };
625
- type IdOcrManager = ReturnType<typeof createIdOcrManager>;
626
- //#endregion
627
- //#region src/modules/id-ocr/idOcrFields.d.ts
628
- declare const OCR_FIELDS: OcrFieldConfig[];
629
- declare const getOcrFields: (config: Pick<IdOcrConfig, "flowId">) => OcrFieldConfig[];
630
- //#endregion
631
- //#region src/modules/id-ocr/idOcrConsts.d.ts
632
- declare const MIN_AGE = 18;
633
- declare const CPFFlowIds: string[];
634
- //#endregion
635
- export { CPFFlowIds, type IdOcrConfig, type IdOcrManager, type IdOcrOcrDocument, type IdOcrState, MIN_AGE, OCR_FIELDS, type OcrData, type OcrFieldConfig, type UpdateOcrDataParams, type ValidationRule, createIdOcrManager, getOcrFields, idOcrStateMachine };
@@ -1,86 +0,0 @@
1
- import "./api-CESGtpbH.esm.js";
2
- import { n as eventModuleNames, 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 "./cpf-PPz2Njto.esm.js";
6
- import { a as MIN_AGE, i as CPFFlowIds, n as OCR_FIELDS, r as getOcrFields, t as idOcrStateMachine } from "./idOcrStateMachine-YbjjC_Gg.esm.js";
7
-
8
- //#region src/modules/id-ocr/idOcrActor.ts
9
- function createIdOcrActor(options) {
10
- return createActor(idOcrStateMachine, { input: { config: options.config } }).start();
11
- }
12
-
13
- //#endregion
14
- //#region src/modules/id-ocr/idOcrManager.ts
15
- function mapState(snapshot) {
16
- const { context } = snapshot;
17
- const editableOcr = context.config.editableOcr === true;
18
- if (snapshot.matches("idle")) return { status: "idle" };
19
- if (snapshot.matches("loading")) return {
20
- status: "loading",
21
- ocrDocument: context.activeOcrDocument
22
- };
23
- if (snapshot.matches("readonly")) return {
24
- status: "readonly",
25
- formData: context.formData,
26
- editableOcr,
27
- ocrDocument: context.activeOcrDocument
28
- };
29
- if (snapshot.matches("inputting")) return {
30
- status: "inputting",
31
- formData: context.formData,
32
- editedFields: context.editedFields,
33
- editableOcr,
34
- ocrDocument: context.activeOcrDocument,
35
- validationErrors: context.validationErrors
36
- };
37
- if (snapshot.matches("submitting")) return {
38
- status: "submitting",
39
- ocrDocument: context.activeOcrDocument
40
- };
41
- if (snapshot.matches("success")) return { status: "success" };
42
- if (snapshot.matches("finished")) return { status: "finished" };
43
- if (snapshot.matches("error")) return {
44
- status: "error",
45
- error: context.error ?? "Unknown error"
46
- };
47
- return { status: "idle" };
48
- }
49
- function createApi({ actor, trackElementClicked }) {
50
- return {
51
- load() {
52
- actor.send({ type: "LOAD" });
53
- },
54
- setField(field, value) {
55
- actor.send({
56
- type: "DATA_CHANGED",
57
- field,
58
- value
59
- });
60
- },
61
- validateField(field) {
62
- actor.send({
63
- type: "VALIDATE_FIELD",
64
- field
65
- });
66
- },
67
- continue() {
68
- actor.send({ type: "CONTINUE" });
69
- trackElementClicked?.("continue");
70
- },
71
- retry() {
72
- actor.send({ type: "RETRY" });
73
- }
74
- };
75
- }
76
- function createIdOcrManager(options) {
77
- return createManager({
78
- actor: createIdOcrActor(options),
79
- mapState,
80
- createApi,
81
- instrumentation: createManagerInstrumentation(eventModuleNames.idOcr)
82
- });
83
- }
84
-
85
- //#endregion
86
- export { CPFFlowIds, MIN_AGE, OCR_FIELDS, createIdOcrManager, getOcrFields, idOcrStateMachine };