@incodetech/core 0.0.0-dev-20260317-6ffceac → 0.0.0-dev-20260317-5e90a15
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/document-capture.d.ts +47 -47
- package/dist/document-upload.d.ts +46 -46
- package/dist/ekyb.d.ts +2 -0
- package/dist/ekyb.esm.js +21 -0
- package/dist/ekyc.d.ts +5 -0
- package/dist/ekyc.esm.js +28 -3
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as Manager } from "./Manager-DsNvecSe.js";
|
|
2
2
|
import { t as CameraStream } from "./camera-Bzi6CMAW.js";
|
|
3
|
-
import * as
|
|
3
|
+
import * as xstate63 from "xstate";
|
|
4
4
|
|
|
5
5
|
//#region src/modules/document-capture/types.d.ts
|
|
6
6
|
type DocumentType = 'addressStatement' | 'otherDocument1' | 'otherDocument2' | 'otherDocument3' | 'v5cMultiPageLogbook' | 'circulationCard' | 'financeSettlement' | 'carInvoice' | 'capture' | 'processPoaOcr' | 'processLoaOcr' | 'processAsylumSeekerVisaZaf' | 'processBankStatementOCR' | 'processBankCheck' | 'processV5CLogbook' | 'processCarInvoice' | 'processCirculationCard' | 'processFinanceSettlement';
|
|
@@ -72,7 +72,7 @@ type DocumentCaptureInput = {
|
|
|
72
72
|
};
|
|
73
73
|
//#endregion
|
|
74
74
|
//#region src/modules/document-capture/documentCaptureStateMachine.d.ts
|
|
75
|
-
declare const documentCaptureMachine:
|
|
75
|
+
declare const documentCaptureMachine: xstate63.StateMachine<DocumentCaptureContext, {
|
|
76
76
|
type: "CAPTURE";
|
|
77
77
|
} | {
|
|
78
78
|
type: "FILE_SELECTED";
|
|
@@ -95,31 +95,43 @@ declare const documentCaptureMachine: xstate0.StateMachine<DocumentCaptureContex
|
|
|
95
95
|
} | {
|
|
96
96
|
type: "CLOSE";
|
|
97
97
|
}, {
|
|
98
|
-
[x: string]:
|
|
98
|
+
[x: string]: xstate63.ActorRefFromLogic<xstate63.PromiseActorLogic<MediaStream, void, xstate63.EventObject>> | xstate63.ActorRefFromLogic<xstate63.PromiseActorLogic<DocumentUploadResponse, {
|
|
99
99
|
capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
|
|
100
100
|
processingType: string;
|
|
101
101
|
onProgress: (progress: number) => void;
|
|
102
|
-
},
|
|
103
|
-
},
|
|
102
|
+
}, xstate63.EventObject>> | undefined;
|
|
103
|
+
}, xstate63.Values<{
|
|
104
104
|
initCamera: {
|
|
105
105
|
src: "initCamera";
|
|
106
|
-
logic:
|
|
106
|
+
logic: xstate63.PromiseActorLogic<MediaStream, void, xstate63.EventObject>;
|
|
107
107
|
id: string | undefined;
|
|
108
108
|
};
|
|
109
109
|
uploadDocument: {
|
|
110
110
|
src: "uploadDocument";
|
|
111
|
-
logic:
|
|
111
|
+
logic: xstate63.PromiseActorLogic<DocumentUploadResponse, {
|
|
112
112
|
capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
|
|
113
113
|
processingType: string;
|
|
114
114
|
onProgress: (progress: number) => void;
|
|
115
|
-
},
|
|
115
|
+
}, xstate63.EventObject>;
|
|
116
116
|
id: string | undefined;
|
|
117
117
|
};
|
|
118
|
-
}>,
|
|
118
|
+
}>, xstate63.Values<{
|
|
119
119
|
setStream: {
|
|
120
120
|
type: "setStream";
|
|
121
121
|
params: unknown;
|
|
122
122
|
};
|
|
123
|
+
setProgress: {
|
|
124
|
+
type: "setProgress";
|
|
125
|
+
params: unknown;
|
|
126
|
+
};
|
|
127
|
+
clearError: {
|
|
128
|
+
type: "clearError";
|
|
129
|
+
params: unknown;
|
|
130
|
+
};
|
|
131
|
+
stopStream: {
|
|
132
|
+
type: "stopStream";
|
|
133
|
+
params: unknown;
|
|
134
|
+
};
|
|
123
135
|
setCapturedDocument: {
|
|
124
136
|
type: "setCapturedDocument";
|
|
125
137
|
params: unknown;
|
|
@@ -128,10 +140,6 @@ declare const documentCaptureMachine: xstate0.StateMachine<DocumentCaptureContex
|
|
|
128
140
|
type: "setFileTooLargeError";
|
|
129
141
|
params: unknown;
|
|
130
142
|
};
|
|
131
|
-
setProgress: {
|
|
132
|
-
type: "setProgress";
|
|
133
|
-
params: unknown;
|
|
134
|
-
};
|
|
135
143
|
setUploadError: {
|
|
136
144
|
type: "setUploadError";
|
|
137
145
|
params: unknown;
|
|
@@ -160,18 +168,10 @@ declare const documentCaptureMachine: xstate0.StateMachine<DocumentCaptureContex
|
|
|
160
168
|
type: "clearForNextPage";
|
|
161
169
|
params: unknown;
|
|
162
170
|
};
|
|
163
|
-
clearError: {
|
|
164
|
-
type: "clearError";
|
|
165
|
-
params: unknown;
|
|
166
|
-
};
|
|
167
171
|
resetProgress: {
|
|
168
172
|
type: "resetProgress";
|
|
169
173
|
params: unknown;
|
|
170
174
|
};
|
|
171
|
-
stopStream: {
|
|
172
|
-
type: "stopStream";
|
|
173
|
-
params: unknown;
|
|
174
|
-
};
|
|
175
175
|
trackTutorial: {
|
|
176
176
|
type: "trackTutorial";
|
|
177
177
|
params: unknown;
|
|
@@ -196,7 +196,7 @@ declare const documentCaptureMachine: xstate0.StateMachine<DocumentCaptureContex
|
|
|
196
196
|
type: "trackFailure";
|
|
197
197
|
params: unknown;
|
|
198
198
|
};
|
|
199
|
-
}>,
|
|
199
|
+
}>, xstate63.Values<{
|
|
200
200
|
allowSkip: {
|
|
201
201
|
type: "allowSkip";
|
|
202
202
|
params: unknown;
|
|
@@ -229,7 +229,7 @@ declare const documentCaptureMachine: xstate0.StateMachine<DocumentCaptureContex
|
|
|
229
229
|
type: "isPendingNextPage";
|
|
230
230
|
params: unknown;
|
|
231
231
|
};
|
|
232
|
-
}>, never, "initCamera" | "
|
|
232
|
+
}>, never, "initCamera" | "capturing" | "closed" | "uploading" | "finished" | "tutorial" | "preview" | "failure" | "success", string, DocumentCaptureInput, xstate63.NonReducibleUnknown, xstate63.EventObject, xstate63.MetaObject, {
|
|
233
233
|
readonly id: "documentCapture";
|
|
234
234
|
readonly initial: "tutorial";
|
|
235
235
|
readonly context: ({
|
|
@@ -238,67 +238,67 @@ declare const documentCaptureMachine: xstate0.StateMachine<DocumentCaptureContex
|
|
|
238
238
|
spawn: {
|
|
239
239
|
<TSrc extends "initCamera" | "uploadDocument">(logic: TSrc, ...[options]: ({
|
|
240
240
|
src: "initCamera";
|
|
241
|
-
logic:
|
|
241
|
+
logic: xstate63.PromiseActorLogic<MediaStream, void, xstate63.EventObject>;
|
|
242
242
|
id: string | undefined;
|
|
243
243
|
} extends infer T ? T extends {
|
|
244
244
|
src: "initCamera";
|
|
245
|
-
logic:
|
|
245
|
+
logic: xstate63.PromiseActorLogic<MediaStream, void, xstate63.EventObject>;
|
|
246
246
|
id: string | undefined;
|
|
247
247
|
} ? T extends {
|
|
248
248
|
src: TSrc;
|
|
249
|
-
} ?
|
|
249
|
+
} ? xstate63.ConditionalRequired<[options?: ({
|
|
250
250
|
id?: T["id"] | undefined;
|
|
251
251
|
systemId?: string;
|
|
252
|
-
input?:
|
|
252
|
+
input?: xstate63.InputFrom<T["logic"]> | undefined;
|
|
253
253
|
syncSnapshot?: boolean;
|
|
254
|
-
} & { [K in
|
|
254
|
+
} & { [K in xstate63.RequiredActorOptions<T>]: unknown }) | undefined], xstate63.IsNotNever<xstate63.RequiredActorOptions<T>>> : never : never : never) | ({
|
|
255
255
|
src: "uploadDocument";
|
|
256
|
-
logic:
|
|
256
|
+
logic: xstate63.PromiseActorLogic<DocumentUploadResponse, {
|
|
257
257
|
capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
|
|
258
258
|
processingType: string;
|
|
259
259
|
onProgress: (progress: number) => void;
|
|
260
|
-
},
|
|
260
|
+
}, xstate63.EventObject>;
|
|
261
261
|
id: string | undefined;
|
|
262
262
|
} extends infer T_1 ? T_1 extends {
|
|
263
263
|
src: "uploadDocument";
|
|
264
|
-
logic:
|
|
264
|
+
logic: xstate63.PromiseActorLogic<DocumentUploadResponse, {
|
|
265
265
|
capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
|
|
266
266
|
processingType: string;
|
|
267
267
|
onProgress: (progress: number) => void;
|
|
268
|
-
},
|
|
268
|
+
}, xstate63.EventObject>;
|
|
269
269
|
id: string | undefined;
|
|
270
270
|
} ? T_1 extends {
|
|
271
271
|
src: TSrc;
|
|
272
|
-
} ?
|
|
272
|
+
} ? xstate63.ConditionalRequired<[options?: ({
|
|
273
273
|
id?: T_1["id"] | undefined;
|
|
274
274
|
systemId?: string;
|
|
275
|
-
input?:
|
|
275
|
+
input?: xstate63.InputFrom<T_1["logic"]> | undefined;
|
|
276
276
|
syncSnapshot?: boolean;
|
|
277
|
-
} & { [K_1 in
|
|
277
|
+
} & { [K_1 in xstate63.RequiredActorOptions<T_1>]: unknown }) | undefined], xstate63.IsNotNever<xstate63.RequiredActorOptions<T_1>>> : never : never : never)): xstate63.ActorRefFromLogic<xstate63.GetConcreteByKey<xstate63.Values<{
|
|
278
278
|
initCamera: {
|
|
279
279
|
src: "initCamera";
|
|
280
|
-
logic:
|
|
280
|
+
logic: xstate63.PromiseActorLogic<MediaStream, void, xstate63.EventObject>;
|
|
281
281
|
id: string | undefined;
|
|
282
282
|
};
|
|
283
283
|
uploadDocument: {
|
|
284
284
|
src: "uploadDocument";
|
|
285
|
-
logic:
|
|
285
|
+
logic: xstate63.PromiseActorLogic<DocumentUploadResponse, {
|
|
286
286
|
capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
|
|
287
287
|
processingType: string;
|
|
288
288
|
onProgress: (progress: number) => void;
|
|
289
|
-
},
|
|
289
|
+
}, xstate63.EventObject>;
|
|
290
290
|
id: string | undefined;
|
|
291
291
|
};
|
|
292
292
|
}>, "src", TSrc>["logic"]>;
|
|
293
|
-
<TLogic extends
|
|
293
|
+
<TLogic extends xstate63.AnyActorLogic>(src: TLogic, ...[options]: xstate63.ConditionalRequired<[options?: ({
|
|
294
294
|
id?: never;
|
|
295
295
|
systemId?: string;
|
|
296
|
-
input?:
|
|
296
|
+
input?: xstate63.InputFrom<TLogic> | undefined;
|
|
297
297
|
syncSnapshot?: boolean;
|
|
298
|
-
} & { [K in
|
|
298
|
+
} & { [K in xstate63.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate63.IsNotNever<xstate63.RequiredLogicInput<TLogic>>>): xstate63.ActorRefFromLogic<TLogic>;
|
|
299
299
|
};
|
|
300
300
|
input: DocumentCaptureInput;
|
|
301
|
-
self:
|
|
301
|
+
self: xstate63.ActorRef<xstate63.MachineSnapshot<DocumentCaptureContext, {
|
|
302
302
|
type: "CAPTURE";
|
|
303
303
|
} | {
|
|
304
304
|
type: "FILE_SELECTED";
|
|
@@ -320,7 +320,7 @@ declare const documentCaptureMachine: xstate0.StateMachine<DocumentCaptureContex
|
|
|
320
320
|
type: "SKIP";
|
|
321
321
|
} | {
|
|
322
322
|
type: "CLOSE";
|
|
323
|
-
}, Record<string,
|
|
323
|
+
}, Record<string, xstate63.AnyActorRef | undefined>, xstate63.StateValue, string, unknown, any, any>, {
|
|
324
324
|
type: "CAPTURE";
|
|
325
325
|
} | {
|
|
326
326
|
type: "FILE_SELECTED";
|
|
@@ -342,7 +342,7 @@ declare const documentCaptureMachine: xstate0.StateMachine<DocumentCaptureContex
|
|
|
342
342
|
type: "SKIP";
|
|
343
343
|
} | {
|
|
344
344
|
type: "CLOSE";
|
|
345
|
-
},
|
|
345
|
+
}, xstate63.AnyEventObject>;
|
|
346
346
|
}) => {
|
|
347
347
|
config: {
|
|
348
348
|
processingType: DocumentType;
|
|
@@ -479,7 +479,7 @@ declare const documentCaptureMachine: xstate0.StateMachine<DocumentCaptureContex
|
|
|
479
479
|
} | {
|
|
480
480
|
type: "CLOSE";
|
|
481
481
|
};
|
|
482
|
-
self:
|
|
482
|
+
self: xstate63.ActorRef<xstate63.MachineSnapshot<DocumentCaptureContext, {
|
|
483
483
|
type: "CAPTURE";
|
|
484
484
|
} | {
|
|
485
485
|
type: "FILE_SELECTED";
|
|
@@ -501,7 +501,7 @@ declare const documentCaptureMachine: xstate0.StateMachine<DocumentCaptureContex
|
|
|
501
501
|
type: "SKIP";
|
|
502
502
|
} | {
|
|
503
503
|
type: "CLOSE";
|
|
504
|
-
}, Record<string,
|
|
504
|
+
}, Record<string, xstate63.AnyActorRef>, xstate63.StateValue, string, unknown, any, any>, {
|
|
505
505
|
type: "CAPTURE";
|
|
506
506
|
} | {
|
|
507
507
|
type: "FILE_SELECTED";
|
|
@@ -523,7 +523,7 @@ declare const documentCaptureMachine: xstate0.StateMachine<DocumentCaptureContex
|
|
|
523
523
|
type: "SKIP";
|
|
524
524
|
} | {
|
|
525
525
|
type: "CLOSE";
|
|
526
|
-
},
|
|
526
|
+
}, xstate63.AnyEventObject>;
|
|
527
527
|
}) => {
|
|
528
528
|
capturedDocument: CapturedDocument;
|
|
529
529
|
processingType: DocumentType;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { t as Manager } from "./Manager-DsNvecSe.js";
|
|
2
2
|
import "./camera-Bzi6CMAW.js";
|
|
3
3
|
import { n as DocumentUploadContext, r as DocumentUploadInput, t as DocumentUploadConfig } from "./types-BHnsBsl_.js";
|
|
4
|
-
import * as
|
|
4
|
+
import * as xstate0 from "xstate";
|
|
5
5
|
|
|
6
6
|
//#region src/modules/document-upload/documentUploadStateMachine.d.ts
|
|
7
|
-
declare const documentUploadMachine:
|
|
7
|
+
declare const documentUploadMachine: xstate0.StateMachine<DocumentUploadContext, {
|
|
8
8
|
type: "START";
|
|
9
9
|
} | {
|
|
10
10
|
type: "CAPTURE";
|
|
@@ -17,52 +17,52 @@ declare const documentUploadMachine: xstate58.StateMachine<DocumentUploadContext
|
|
|
17
17
|
} | {
|
|
18
18
|
type: "CLOSE";
|
|
19
19
|
}, {
|
|
20
|
-
[x: string]:
|
|
20
|
+
[x: string]: xstate0.ActorRefFromLogic<xstate0.PromiseActorLogic<MediaStream, void, xstate0.EventObject>> | xstate0.ActorRefFromLogic<xstate0.PromiseActorLogic<void, {
|
|
21
21
|
imageBase64: string;
|
|
22
22
|
documentType: string;
|
|
23
23
|
onProgress: (progress: number) => void;
|
|
24
|
-
},
|
|
25
|
-
},
|
|
24
|
+
}, xstate0.EventObject>> | undefined;
|
|
25
|
+
}, xstate0.Values<{
|
|
26
26
|
initCamera: {
|
|
27
27
|
src: "initCamera";
|
|
28
|
-
logic:
|
|
28
|
+
logic: xstate0.PromiseActorLogic<MediaStream, void, xstate0.EventObject>;
|
|
29
29
|
id: string | undefined;
|
|
30
30
|
};
|
|
31
31
|
uploadDocument: {
|
|
32
32
|
src: "uploadDocument";
|
|
33
|
-
logic:
|
|
33
|
+
logic: xstate0.PromiseActorLogic<void, {
|
|
34
34
|
imageBase64: string;
|
|
35
35
|
documentType: string;
|
|
36
36
|
onProgress: (progress: number) => void;
|
|
37
|
-
},
|
|
37
|
+
}, xstate0.EventObject>;
|
|
38
38
|
id: string | undefined;
|
|
39
39
|
};
|
|
40
|
-
}>,
|
|
40
|
+
}>, xstate0.Values<{
|
|
41
41
|
setStream: {
|
|
42
42
|
type: "setStream";
|
|
43
|
-
params:
|
|
43
|
+
params: xstate0.NonReducibleUnknown;
|
|
44
|
+
};
|
|
45
|
+
setImageAndClearError: {
|
|
46
|
+
type: "setImageAndClearError";
|
|
47
|
+
params: xstate0.NonReducibleUnknown;
|
|
44
48
|
};
|
|
45
49
|
setProgress: {
|
|
46
50
|
type: "setProgress";
|
|
47
|
-
params:
|
|
51
|
+
params: xstate0.NonReducibleUnknown;
|
|
52
|
+
};
|
|
53
|
+
setError: {
|
|
54
|
+
type: "setError";
|
|
55
|
+
params: xstate0.NonReducibleUnknown;
|
|
48
56
|
};
|
|
49
57
|
clearError: {
|
|
50
58
|
type: "clearError";
|
|
51
|
-
params:
|
|
59
|
+
params: xstate0.NonReducibleUnknown;
|
|
52
60
|
};
|
|
53
61
|
stopStream: {
|
|
54
62
|
type: "stopStream";
|
|
55
|
-
params:
|
|
56
|
-
};
|
|
57
|
-
setImageAndClearError: {
|
|
58
|
-
type: "setImageAndClearError";
|
|
59
|
-
params: xstate58.NonReducibleUnknown;
|
|
60
|
-
};
|
|
61
|
-
setError: {
|
|
62
|
-
type: "setError";
|
|
63
|
-
params: xstate58.NonReducibleUnknown;
|
|
63
|
+
params: xstate0.NonReducibleUnknown;
|
|
64
64
|
};
|
|
65
|
-
}>, never, never, "
|
|
65
|
+
}>, never, never, "initCamera" | "error" | "idle" | "capturing" | "closed" | "uploading" | "finished", string, DocumentUploadInput, xstate0.NonReducibleUnknown, xstate0.EventObject, xstate0.MetaObject, {
|
|
66
66
|
readonly id: "documentUpload";
|
|
67
67
|
readonly initial: "idle";
|
|
68
68
|
readonly context: ({
|
|
@@ -71,67 +71,67 @@ declare const documentUploadMachine: xstate58.StateMachine<DocumentUploadContext
|
|
|
71
71
|
spawn: {
|
|
72
72
|
<TSrc extends "initCamera" | "uploadDocument">(logic: TSrc, ...[options]: ({
|
|
73
73
|
src: "initCamera";
|
|
74
|
-
logic:
|
|
74
|
+
logic: xstate0.PromiseActorLogic<MediaStream, void, xstate0.EventObject>;
|
|
75
75
|
id: string | undefined;
|
|
76
76
|
} extends infer T ? T extends {
|
|
77
77
|
src: "initCamera";
|
|
78
|
-
logic:
|
|
78
|
+
logic: xstate0.PromiseActorLogic<MediaStream, void, xstate0.EventObject>;
|
|
79
79
|
id: string | undefined;
|
|
80
80
|
} ? T extends {
|
|
81
81
|
src: TSrc;
|
|
82
|
-
} ?
|
|
82
|
+
} ? xstate0.ConditionalRequired<[options?: ({
|
|
83
83
|
id?: T["id"] | undefined;
|
|
84
84
|
systemId?: string;
|
|
85
|
-
input?:
|
|
85
|
+
input?: xstate0.InputFrom<T["logic"]> | undefined;
|
|
86
86
|
syncSnapshot?: boolean;
|
|
87
|
-
} & { [K in
|
|
87
|
+
} & { [K in xstate0.RequiredActorOptions<T>]: unknown }) | undefined], xstate0.IsNotNever<xstate0.RequiredActorOptions<T>>> : never : never : never) | ({
|
|
88
88
|
src: "uploadDocument";
|
|
89
|
-
logic:
|
|
89
|
+
logic: xstate0.PromiseActorLogic<void, {
|
|
90
90
|
imageBase64: string;
|
|
91
91
|
documentType: string;
|
|
92
92
|
onProgress: (progress: number) => void;
|
|
93
|
-
},
|
|
93
|
+
}, xstate0.EventObject>;
|
|
94
94
|
id: string | undefined;
|
|
95
95
|
} extends infer T_1 ? T_1 extends {
|
|
96
96
|
src: "uploadDocument";
|
|
97
|
-
logic:
|
|
97
|
+
logic: xstate0.PromiseActorLogic<void, {
|
|
98
98
|
imageBase64: string;
|
|
99
99
|
documentType: string;
|
|
100
100
|
onProgress: (progress: number) => void;
|
|
101
|
-
},
|
|
101
|
+
}, xstate0.EventObject>;
|
|
102
102
|
id: string | undefined;
|
|
103
103
|
} ? T_1 extends {
|
|
104
104
|
src: TSrc;
|
|
105
|
-
} ?
|
|
105
|
+
} ? xstate0.ConditionalRequired<[options?: ({
|
|
106
106
|
id?: T_1["id"] | undefined;
|
|
107
107
|
systemId?: string;
|
|
108
|
-
input?:
|
|
108
|
+
input?: xstate0.InputFrom<T_1["logic"]> | undefined;
|
|
109
109
|
syncSnapshot?: boolean;
|
|
110
|
-
} & { [K_1 in
|
|
110
|
+
} & { [K_1 in xstate0.RequiredActorOptions<T_1>]: unknown }) | undefined], xstate0.IsNotNever<xstate0.RequiredActorOptions<T_1>>> : never : never : never)): xstate0.ActorRefFromLogic<xstate0.GetConcreteByKey<xstate0.Values<{
|
|
111
111
|
initCamera: {
|
|
112
112
|
src: "initCamera";
|
|
113
|
-
logic:
|
|
113
|
+
logic: xstate0.PromiseActorLogic<MediaStream, void, xstate0.EventObject>;
|
|
114
114
|
id: string | undefined;
|
|
115
115
|
};
|
|
116
116
|
uploadDocument: {
|
|
117
117
|
src: "uploadDocument";
|
|
118
|
-
logic:
|
|
118
|
+
logic: xstate0.PromiseActorLogic<void, {
|
|
119
119
|
imageBase64: string;
|
|
120
120
|
documentType: string;
|
|
121
121
|
onProgress: (progress: number) => void;
|
|
122
|
-
},
|
|
122
|
+
}, xstate0.EventObject>;
|
|
123
123
|
id: string | undefined;
|
|
124
124
|
};
|
|
125
125
|
}>, "src", TSrc>["logic"]>;
|
|
126
|
-
<TLogic extends
|
|
126
|
+
<TLogic extends xstate0.AnyActorLogic>(src: TLogic, ...[options]: xstate0.ConditionalRequired<[options?: ({
|
|
127
127
|
id?: never;
|
|
128
128
|
systemId?: string;
|
|
129
|
-
input?:
|
|
129
|
+
input?: xstate0.InputFrom<TLogic> | undefined;
|
|
130
130
|
syncSnapshot?: boolean;
|
|
131
|
-
} & { [K in
|
|
131
|
+
} & { [K in xstate0.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate0.IsNotNever<xstate0.RequiredLogicInput<TLogic>>>): xstate0.ActorRefFromLogic<TLogic>;
|
|
132
132
|
};
|
|
133
133
|
input: DocumentUploadInput;
|
|
134
|
-
self:
|
|
134
|
+
self: xstate0.ActorRef<xstate0.MachineSnapshot<DocumentUploadContext, {
|
|
135
135
|
type: "START";
|
|
136
136
|
} | {
|
|
137
137
|
type: "CAPTURE";
|
|
@@ -143,7 +143,7 @@ declare const documentUploadMachine: xstate58.StateMachine<DocumentUploadContext
|
|
|
143
143
|
type: "RETRY";
|
|
144
144
|
} | {
|
|
145
145
|
type: "CLOSE";
|
|
146
|
-
}, Record<string,
|
|
146
|
+
}, Record<string, xstate0.AnyActorRef | undefined>, xstate0.StateValue, string, unknown, any, any>, {
|
|
147
147
|
type: "START";
|
|
148
148
|
} | {
|
|
149
149
|
type: "CAPTURE";
|
|
@@ -155,7 +155,7 @@ declare const documentUploadMachine: xstate58.StateMachine<DocumentUploadContext
|
|
|
155
155
|
type: "RETRY";
|
|
156
156
|
} | {
|
|
157
157
|
type: "CLOSE";
|
|
158
|
-
},
|
|
158
|
+
}, xstate0.AnyEventObject>;
|
|
159
159
|
}) => {
|
|
160
160
|
config: DocumentUploadConfig;
|
|
161
161
|
stream: undefined;
|
|
@@ -225,7 +225,7 @@ declare const documentUploadMachine: xstate58.StateMachine<DocumentUploadContext
|
|
|
225
225
|
} | {
|
|
226
226
|
type: "CLOSE";
|
|
227
227
|
};
|
|
228
|
-
self:
|
|
228
|
+
self: xstate0.ActorRef<xstate0.MachineSnapshot<DocumentUploadContext, {
|
|
229
229
|
type: "START";
|
|
230
230
|
} | {
|
|
231
231
|
type: "CAPTURE";
|
|
@@ -237,7 +237,7 @@ declare const documentUploadMachine: xstate58.StateMachine<DocumentUploadContext
|
|
|
237
237
|
type: "RETRY";
|
|
238
238
|
} | {
|
|
239
239
|
type: "CLOSE";
|
|
240
|
-
}, Record<string,
|
|
240
|
+
}, Record<string, xstate0.AnyActorRef>, xstate0.StateValue, string, unknown, any, any>, {
|
|
241
241
|
type: "START";
|
|
242
242
|
} | {
|
|
243
243
|
type: "CAPTURE";
|
|
@@ -249,7 +249,7 @@ declare const documentUploadMachine: xstate58.StateMachine<DocumentUploadContext
|
|
|
249
249
|
type: "RETRY";
|
|
250
250
|
} | {
|
|
251
251
|
type: "CLOSE";
|
|
252
|
-
},
|
|
252
|
+
}, xstate0.AnyEventObject>;
|
|
253
253
|
}) => {
|
|
254
254
|
imageBase64: string;
|
|
255
255
|
documentType: string;
|
package/dist/ekyb.d.ts
CHANGED
|
@@ -86,6 +86,8 @@ declare function createEkybManager(options: CreateEkybActorOptions): Manager<Eky
|
|
|
86
86
|
setCountry(country: string): void;
|
|
87
87
|
/** Sets a form field value and triggers revalidation */
|
|
88
88
|
setField(name: string, value: string): void;
|
|
89
|
+
/** Marks a field as touched on blur, triggering "required" errors if empty */
|
|
90
|
+
blurField(name: string): void;
|
|
89
91
|
/** Adds a new UBO entry (max 8) */
|
|
90
92
|
addUbo(): void;
|
|
91
93
|
/** Removes a UBO entry by index */
|
package/dist/ekyb.esm.js
CHANGED
|
@@ -476,6 +476,20 @@ const ekybMachine = setup({
|
|
|
476
476
|
errorParams
|
|
477
477
|
};
|
|
478
478
|
}),
|
|
479
|
+
blurField: assign(({ context, event }) => {
|
|
480
|
+
const { name } = event;
|
|
481
|
+
if (context.touched[name]) return {};
|
|
482
|
+
const newTouched = {
|
|
483
|
+
...context.touched,
|
|
484
|
+
[name]: true
|
|
485
|
+
};
|
|
486
|
+
const { displayErrors, errorParams } = computeDisplayErrors(context.errors, newTouched, context.submitAttempted, context.country, context.fields);
|
|
487
|
+
return {
|
|
488
|
+
touched: newTouched,
|
|
489
|
+
displayErrors,
|
|
490
|
+
errorParams
|
|
491
|
+
};
|
|
492
|
+
}),
|
|
479
493
|
addUbo: assign(({ context }) => {
|
|
480
494
|
const newId = context._nextUboId;
|
|
481
495
|
const ubos = [...context.ubos, {
|
|
@@ -667,6 +681,7 @@ const ekybMachine = setup({
|
|
|
667
681
|
actions: "setCountry"
|
|
668
682
|
},
|
|
669
683
|
SET_FIELD: { actions: "updateField" },
|
|
684
|
+
BLUR_FIELD: { actions: "blurField" },
|
|
670
685
|
SEARCH_ADDRESS: {
|
|
671
686
|
target: ".searching",
|
|
672
687
|
actions: assign(({ event }) => ({
|
|
@@ -777,6 +792,12 @@ function createApi({ actor }) {
|
|
|
777
792
|
value
|
|
778
793
|
});
|
|
779
794
|
},
|
|
795
|
+
blurField(name) {
|
|
796
|
+
actor.send({
|
|
797
|
+
type: "BLUR_FIELD",
|
|
798
|
+
name
|
|
799
|
+
});
|
|
800
|
+
},
|
|
780
801
|
addUbo() {
|
|
781
802
|
actor.send({ type: "ADD_UBO" });
|
|
782
803
|
},
|
package/dist/ekyc.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ type EkycVerificationFields = {
|
|
|
19
19
|
idNum?: EkycFieldSource;
|
|
20
20
|
idNum1?: EkycFieldSource;
|
|
21
21
|
gender?: EkycFieldSource;
|
|
22
|
+
panNumber?: EkycFieldSource;
|
|
22
23
|
};
|
|
23
24
|
type EkycModuleConfig = {
|
|
24
25
|
source: string;
|
|
@@ -51,6 +52,8 @@ type EkycModuleConfig = {
|
|
|
51
52
|
idNum1Source?: string;
|
|
52
53
|
checkGender?: boolean;
|
|
53
54
|
genderSource?: string;
|
|
55
|
+
checkPanNumber?: boolean;
|
|
56
|
+
panNumberSource?: string;
|
|
54
57
|
};
|
|
55
58
|
type EkycFormValues = Record<string, string | undefined>;
|
|
56
59
|
/** Manager creation config */
|
|
@@ -122,6 +125,8 @@ declare function createEkycManager(options: CreateEkycActorOptions): Manager<Eky
|
|
|
122
125
|
load(): void;
|
|
123
126
|
/** Sets a form field value and triggers revalidation */
|
|
124
127
|
setField(name: string, value: string): void;
|
|
128
|
+
/** Marks a field as touched on blur, triggering "required" errors if empty */
|
|
129
|
+
blurField(name: string): void;
|
|
125
130
|
/** Initiates a debounced address autocomplete search */
|
|
126
131
|
searchAddress(query: string): void;
|
|
127
132
|
/** Selects an address suggestion and populates address fields */
|
package/dist/ekyc.esm.js
CHANGED
|
@@ -9857,7 +9857,8 @@ function getEKYCFields(config) {
|
|
|
9857
9857
|
last4SSN: config.checkLast4SSN ? mapToEKYCvalue(config.last4SSNSource ?? "") : false,
|
|
9858
9858
|
idNum: config.checkIdNum ? mapToEKYCvalue(config.idNumSource ?? "") : false,
|
|
9859
9859
|
idNum1: config.checkIdNum1 ? mapToEKYCvalue(config.idNum1Source ?? "") : false,
|
|
9860
|
-
gender: config.checkGender ? mapToEKYCvalue(config.genderSource ?? "") : false
|
|
9860
|
+
gender: config.checkGender ? mapToEKYCvalue(config.genderSource ?? "") : false,
|
|
9861
|
+
panNumber: config.checkPanNumber ? mapToEKYCvalue(config.panNumberSource ?? "") : false
|
|
9861
9862
|
};
|
|
9862
9863
|
}
|
|
9863
9864
|
/** Maps a verification source string to a country code */
|
|
@@ -9875,6 +9876,7 @@ function getEKYCCountry(source) {
|
|
|
9875
9876
|
case "CO_1": return "CO";
|
|
9876
9877
|
case "CR_1": return "CR";
|
|
9877
9878
|
case "CA_RES_CREDIT": return "CA";
|
|
9879
|
+
case "INDIA_PAN": return "IN";
|
|
9878
9880
|
default: return "US";
|
|
9879
9881
|
}
|
|
9880
9882
|
}
|
|
@@ -9971,14 +9973,14 @@ function buildFieldDefs(fields, configSource, country, enablePhoneRisk = false)
|
|
|
9971
9973
|
maxLength: 100,
|
|
9972
9974
|
placeholder: "verification.placeholder.firstName"
|
|
9973
9975
|
});
|
|
9974
|
-
if (configSource === "US_CREDIT_BUREAU_1" || configSource === "CA_RES_CREDIT") add("middleName", "text", "verification.labels.middleName", fields.name, {
|
|
9976
|
+
if (configSource === "US_CREDIT_BUREAU_1" || configSource === "CA_RES_CREDIT" || country === "IN") add("middleName", "text", "verification.labels.middleName", fields.name, {
|
|
9975
9977
|
maxLength: 100,
|
|
9976
9978
|
placeholder: "verification.placeholder.middleName",
|
|
9977
9979
|
optional: true
|
|
9978
9980
|
});
|
|
9979
9981
|
add("surName", "text", country === "US" ? "verification.labels.lastName" : "verification.labels.surName", fields.name, {
|
|
9980
9982
|
maxLength: 100,
|
|
9981
|
-
placeholder: "verification.placeholder.lastName"
|
|
9983
|
+
placeholder: country === "US" ? "verification.placeholder.lastName" : "verification.placeholder.surname"
|
|
9982
9984
|
});
|
|
9983
9985
|
if (country === "MX") add("maternalSurname", "text", "verification.labels.maternalSurname", fields.name, {
|
|
9984
9986
|
maxLength: 100,
|
|
@@ -10026,6 +10028,7 @@ function buildFieldDefs(fields, configSource, country, enablePhoneRisk = false)
|
|
|
10026
10028
|
value: "M",
|
|
10027
10029
|
label: "common.male"
|
|
10028
10030
|
}] });
|
|
10031
|
+
if (fields.panNumber) add("panNumber", "text", "verification.labels.panNumber", fields.panNumber, { maxLength: 10 });
|
|
10029
10032
|
if (fields.address) {
|
|
10030
10033
|
add("street", "text", "verification.labels.street", fields.address, { section: "address" });
|
|
10031
10034
|
add("houseNo", "text", "verification.labels.houseNo", fields.address, { section: "address" });
|
|
@@ -10066,6 +10069,7 @@ function validateField(name, value, required, country, configSource) {
|
|
|
10066
10069
|
if (!isFieldOptional("phone", configSource) || val) return validatePhone(val, country) ? void 0 : "verification.errors.invalidPhone";
|
|
10067
10070
|
}
|
|
10068
10071
|
if (name === "email" && val) return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(val) ? void 0 : "verification.errors.invalidEmail";
|
|
10072
|
+
if (name === "panNumber" && val) return val.length === 10 ? void 0 : "verification.errors.exactly10Characters";
|
|
10069
10073
|
}
|
|
10070
10074
|
function computeValidation(fields, values, country, configSource) {
|
|
10071
10075
|
const errors = {};
|
|
@@ -10360,6 +10364,20 @@ const ekycMachine = setup({
|
|
|
10360
10364
|
submitError: ""
|
|
10361
10365
|
};
|
|
10362
10366
|
}),
|
|
10367
|
+
blurField: assign(({ context, event }) => {
|
|
10368
|
+
const { name } = event;
|
|
10369
|
+
if (context.touched[name]) return {};
|
|
10370
|
+
const newTouched = {
|
|
10371
|
+
...context.touched,
|
|
10372
|
+
[name]: true
|
|
10373
|
+
};
|
|
10374
|
+
const { displayErrors, errorParams } = computeDisplayErrors(context.errors, newTouched, context.submitAttempted, context.fieldsCountry, context.fields);
|
|
10375
|
+
return {
|
|
10376
|
+
touched: newTouched,
|
|
10377
|
+
displayErrors,
|
|
10378
|
+
errorParams
|
|
10379
|
+
};
|
|
10380
|
+
}),
|
|
10363
10381
|
fillAddressFields: assign(({ context, event }) => {
|
|
10364
10382
|
const { suggestion } = event;
|
|
10365
10383
|
const { values: newValues, touched: newTouched } = fillFromSuggestion(context.values, context.touched, suggestion);
|
|
@@ -10525,6 +10543,7 @@ const ekycMachine = setup({
|
|
|
10525
10543
|
},
|
|
10526
10544
|
on: {
|
|
10527
10545
|
SET_FIELD: { actions: "updateField" },
|
|
10546
|
+
BLUR_FIELD: { actions: "blurField" },
|
|
10528
10547
|
SEARCH_ADDRESS: {
|
|
10529
10548
|
target: ".searching",
|
|
10530
10549
|
actions: assign(({ event }) => ({
|
|
@@ -10634,6 +10653,12 @@ function createApi({ actor }) {
|
|
|
10634
10653
|
value
|
|
10635
10654
|
});
|
|
10636
10655
|
},
|
|
10656
|
+
blurField(name) {
|
|
10657
|
+
actor.send({
|
|
10658
|
+
type: "BLUR_FIELD",
|
|
10659
|
+
name
|
|
10660
|
+
});
|
|
10661
|
+
},
|
|
10637
10662
|
searchAddress(query) {
|
|
10638
10663
|
actor.send({
|
|
10639
10664
|
type: "SEARCH_ADDRESS",
|