@regulaforensics/idv-capture-web 0.1.82-nightly → 0.1.84-nightly

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/index.d.ts CHANGED
@@ -1,63 +1,56 @@
1
- export declare enum ErrorTypes {
2
- WASM_ERROR = "WASM_ERROR"
3
- }
4
-
5
- declare type GetWorkFlowsRequest = {
6
- limit: number;
7
- skip: number;
8
- };
9
-
10
- declare type GetWorkFlowsResult = {
11
- count: number;
12
- items: unknown[];
13
- };
14
-
15
- declare enum IDV_TEMPLATES {
16
- FACE_LIVENESS = "LIVENESS",
17
- INFO = "INFO",
18
- INFO_DETAILS = "INFO_DETAILS",
19
- DOC_READER = "DOC_READER",
20
- STATUS = "STATUS",
21
- PROGRESS = "PROGRESS"
22
- }
23
-
24
1
  export declare enum IdvEventTargets {
25
2
  WEB_COMPONENT = "WEB_COMPONENT",
26
3
  SERVICE = "SERVICE"
27
4
  }
28
5
 
6
+ declare enum IdvEventTypes {
7
+ MESSAGE = "MESSAGE",
8
+ ERROR = "ERROR"
9
+ }
10
+
29
11
  export declare class IdvIntegrationService {
30
- constructor(options: IIdvOptions);
31
- getWorkFlows(params?: GetWorkFlowsRequest): Promise<GetWorkFlowsResult>;
12
+ initialize(config: IIdvConfig): Promise<{
13
+ error?: string;
14
+ }>;
32
15
  setNonce(id: string): void;
33
- prepareWorkflow(id: string): void;
34
- playWorkflow(): void;
35
- isIdvServiceRunning(): boolean | undefined;
36
- shutdownService(): void;
16
+ getWorkFlows(params?: WorkflowListRequest): Promise<WorkflowListCompletion>;
17
+ prepareWorkflow({ workfowId }: {
18
+ workfowId: string;
19
+ }): Promise<PrepareWorkflowCompletion>;
20
+ startWorkflow(): Promise<WorkflowCompetion>;
21
+ deinitialize(): Promise<void>;
37
22
  }
38
23
 
39
24
  export declare type IdvMessageEvent = {
40
- target: 'SERVICE' | 'WEB_COMPONENT';
41
- eventType: 'ERROR' | 'MESSAGE';
42
- module?: IDV_TEMPLATES | 'IDV';
43
- message: any;
25
+ target: IdvEventTargets;
26
+ eventType: IdvEventTypes;
27
+ module?: string | 'IDV';
28
+ message?: IdvServiceMessages;
29
+ error?: IdvServiceErrors;
44
30
  details?: any;
45
31
  };
46
32
 
33
+ declare enum IdvServiceErrors {
34
+ CONNECT_TO_IDV_ERROR = "CONNECT_TO_IDV_ERROR",
35
+ PLAY_WORKFLOW_ERROR = "PLAY_WORKFLOW_ERROR",
36
+ SERVICE_NOT_RUNNING_ERROR = "SERVICE_NOT_RUNNING_ERROR",
37
+ WASM_ERROR = "WASM_ERROR",
38
+ GET_SESSION_STATE_ERROR = "GET_SESSION_STATE_ERROR",
39
+ PUSH_DATA_ERROR = "PUSH_DATA_ERROR",
40
+ SET_MODULES_ERROR = "SET_MODULES_ERROR"
41
+ }
42
+
47
43
  export declare enum IdvServiceMessages {
44
+ INITIALIZED = "INITIALIZED",
48
45
  READY_TO_PLAY = "READY_TO_PLAY",
49
46
  CONNECT_TO_IDV = "CONNECT_TO_IDV",
50
47
  START_SESSION = "START_SESSION",
51
48
  SHUT_DOWN = "SHUT_DOWN",
52
- WASM_ERROR = "WASM_ERROR",
53
- PLAY_WORKFLOW_ERROR = "PLAY_WORKFLOW_ERROR",
54
- SERVICE_NOT_RUNNING_ERROR = "SERVICE_NOT_RUNNING_ERROR",
55
49
  CURRENT_STEP = "CURRENT_STEP",
56
- GET_SESSION_STATE_ERROR = "GET_SESSION_STATE_ERROR",
57
- PUSH_DATA_ERROR = "PUSH_DATA_ERROR"
50
+ FINAL = "FINAL"
58
51
  }
59
52
 
60
- export declare class IdvWebComponent extends HTMLElement implements IdvWebComponent_2 {
53
+ export declare class IdvWebComponent extends HTMLElement {
61
54
  private _root;
62
55
  private _mounted;
63
56
  private _nonce?;
@@ -70,18 +63,15 @@ export declare class IdvWebComponent extends HTMLElement implements IdvWebCompon
70
63
  disconnectedCallback(): void;
71
64
  }
72
65
 
73
- declare class IdvWebComponent_2 extends HTMLElement {
74
- }
75
-
76
- export declare enum IdvWebComponentMessages {
77
- ELEMENT_VISIBLE = "IDV_VISIBLE",
78
- DOC_READER = "DOC_READER",
79
- LIVENESS = "LIVENESS",
80
- CLOSE_BUTTON_CLICKED = "CLOSE_BUTTON_WAS_CLICKED"
81
- }
66
+ declare type IIdvConfig = {
67
+ connectionConfig: IIdvOptions;
68
+ modulesConfig: Record<string, any>;
69
+ includedModules: any[];
70
+ licenseConfig?: Record<string, any>;
71
+ listener?: (message: IdvMessageEvent) => void;
72
+ };
82
73
 
83
74
  declare type IIdvOptions = {
84
- workflowId?: string;
85
75
  host: string;
86
76
  httpRetryCount?: number;
87
77
  httpTimeoutMs?: number;
@@ -90,7 +80,61 @@ declare type IIdvOptions = {
90
80
  port?: number;
91
81
  schema?: string;
92
82
  userName: string;
93
- listener: (message: IdvMessageEvent) => void;
83
+ };
84
+
85
+ declare type PrepareWorkflowCompletion = {
86
+ workflow?: Workflow;
87
+ error?: PrepareWorkflowError;
88
+ };
89
+
90
+ declare enum PrepareWorkflowError {
91
+ CONNECTION_ISSUE = "CONNECTION_ISSUE",
92
+ WORKFLOW_ISSUE = "WORKFLOW_ISSUE",
93
+ INTERNAL_ISSUE = "INTERNAL_ISSUE"
94
+ }
95
+
96
+ declare enum ScenarioError {
97
+ SESSION_ISSUE = "SESSION_ISSUE",
98
+ ALREADY_STARTED = "ALREADY_STARTED",
99
+ NOT_PREPARED = "NOT_PREPARED",
100
+ STEP_ISSUE = "STEP_ISSUE",
101
+ INTERNAL_ISSUE = "INTERNAL_ISSUE"
102
+ }
103
+
104
+ declare type ScenarioResults = {
105
+ status: ScenarioStatus;
106
+ results?: Record<string, any>;
107
+ };
108
+
109
+ declare enum ScenarioStatus {
110
+ FINISHED = "FINISHED",
111
+ CANCELLED = "CANCELLED",
112
+ ERROR = "ERROR"
113
+ }
114
+
115
+ declare type Workflow = {
116
+ id: string;
117
+ currentStep: string;
118
+ steps: Array<any>;
119
+ client: {
120
+ layout: Record<string, any>;
121
+ steps: Array<any>;
122
+ };
123
+ } & Record<string, any>;
124
+
125
+ declare type WorkflowCompetion = {
126
+ results?: ScenarioResults;
127
+ error?: ScenarioError;
128
+ };
129
+
130
+ declare type WorkflowListCompletion = {
131
+ results?: Workflow[];
132
+ error?: PrepareWorkflowError;
133
+ };
134
+
135
+ declare type WorkflowListRequest = {
136
+ limit: number;
137
+ skip: number;
94
138
  };
95
139
 
96
140
  export { }