@regulaforensics/idv-capture-web 0.1.84-nightly → 0.1.86-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,3 +1,92 @@
1
+ declare class BaseDeinitializationError extends BaseError {
2
+ private static readonly MODULE;
3
+ private static readonly ERROR_ENUM_NAME;
4
+ private static readonly SHORT_CODE;
5
+ constructor({ errorCode, message, underlyingError, underlyingBaseError, }: {
6
+ errorCode: DeinitializationError;
7
+ message?: string;
8
+ underlyingError?: string;
9
+ underlyingBaseError?: BaseError;
10
+ });
11
+ }
12
+
13
+ declare class BaseError {
14
+ errorCode: number | string;
15
+ errorCodeKey: string;
16
+ message?: string;
17
+ underlyingError?: string;
18
+ underlyingBaseError?: BaseError;
19
+ domain?: string;
20
+ module: string;
21
+ errorEnumName: string;
22
+ shortDomainCode: string;
23
+ constructor({ errorCode, errorCodeKey, message, underlyingError, underlyingBaseError, domain, module, errorEnumName, shortDomainCode, }: {
24
+ errorCode: number | string;
25
+ errorCodeKey: string;
26
+ module: string;
27
+ message?: string;
28
+ underlyingError?: string;
29
+ underlyingBaseError?: BaseError;
30
+ domain?: string;
31
+ errorEnumName: string;
32
+ shortDomainCode: string;
33
+ });
34
+ static getErrorKey<T extends Record<string, any>>(errorCode: number | string, errorEnum: T): string;
35
+ get lastUnderlyingError(): string | undefined;
36
+ toObject(): Record<string, any>;
37
+ get shortChain(): string;
38
+ get fullChain(): string;
39
+ }
40
+
41
+ declare class BaseInitializationError extends BaseError {
42
+ private static readonly MODULE;
43
+ private static readonly ERROR_ENUM_NAME;
44
+ private static readonly SHORT_CODE;
45
+ constructor({ errorCode, message, underlyingError, underlyingBaseError, }: {
46
+ errorCode: InitializeError;
47
+ message?: string;
48
+ underlyingError?: string;
49
+ underlyingBaseError?: BaseError;
50
+ });
51
+ }
52
+
53
+ declare class BasePrepareWorkflowError extends BaseError {
54
+ private static readonly MODULE;
55
+ private static readonly ERROR_ENUM_NAME;
56
+ private static readonly SHORT_CODE;
57
+ constructor({ errorCode, message, underlyingError, underlyingBaseError, }: {
58
+ errorCode: PrepareWorkflowError;
59
+ message?: string;
60
+ underlyingError?: string;
61
+ underlyingBaseError?: BaseError;
62
+ });
63
+ }
64
+
65
+ declare class BaseScenarioError extends BaseError {
66
+ private static readonly MODULE;
67
+ private static readonly ERROR_ENUM_NAME;
68
+ private static readonly SHORT_CODE;
69
+ constructor({ errorCode, message, underlyingError, underlyingBaseError, }: {
70
+ errorCode: ScenarioError;
71
+ message?: string;
72
+ underlyingError?: string;
73
+ underlyingBaseError?: BaseError;
74
+ });
75
+ }
76
+
77
+ export declare enum ConnectionError {
78
+ HTTP_ISSUE = 0,
79
+ PROVIDER_ERROR = 1
80
+ }
81
+
82
+ export declare enum DeinitializationError {
83
+ SERVICE_NOT_CONNECTED = 0
84
+ }
85
+
86
+ export declare type DeinitializeCompletion = {
87
+ error?: BaseDeinitializationError;
88
+ };
89
+
1
90
  export declare enum IdvEventTargets {
2
91
  WEB_COMPONENT = "WEB_COMPONENT",
3
92
  SERVICE = "SERVICE"
@@ -10,7 +99,7 @@ declare enum IdvEventTypes {
10
99
 
11
100
  export declare class IdvIntegrationService {
12
101
  initialize(config: IIdvConfig): Promise<{
13
- error?: string;
102
+ error?: BaseInitializationError;
14
103
  }>;
15
104
  setNonce(id: string): void;
16
105
  getWorkFlows(params?: WorkflowListRequest): Promise<WorkflowListCompletion>;
@@ -18,7 +107,7 @@ export declare class IdvIntegrationService {
18
107
  workfowId: string;
19
108
  }): Promise<PrepareWorkflowCompletion>;
20
109
  startWorkflow(): Promise<WorkflowCompetion>;
21
- deinitialize(): Promise<void>;
110
+ deinitialize(): Promise<DeinitializeCompletion>;
22
111
  }
23
112
 
24
113
  export declare type IdvMessageEvent = {
@@ -30,7 +119,7 @@ export declare type IdvMessageEvent = {
30
119
  details?: any;
31
120
  };
32
121
 
33
- declare enum IdvServiceErrors {
122
+ export declare enum IdvServiceErrors {
34
123
  CONNECT_TO_IDV_ERROR = "CONNECT_TO_IDV_ERROR",
35
124
  PLAY_WORKFLOW_ERROR = "PLAY_WORKFLOW_ERROR",
36
125
  SERVICE_NOT_RUNNING_ERROR = "SERVICE_NOT_RUNNING_ERROR",
@@ -63,15 +152,15 @@ export declare class IdvWebComponent extends HTMLElement {
63
152
  disconnectedCallback(): void;
64
153
  }
65
154
 
66
- declare type IIdvConfig = {
155
+ export declare type IIdvConfig = {
67
156
  connectionConfig: IIdvOptions;
68
- modulesConfig: Record<string, any>;
157
+ modulesConfig?: Record<string, any>;
69
158
  includedModules: any[];
70
159
  licenseConfig?: Record<string, any>;
71
160
  listener?: (message: IdvMessageEvent) => void;
72
161
  };
73
162
 
74
- declare type IIdvOptions = {
163
+ export declare type IIdvOptions = {
75
164
  host: string;
76
165
  httpRetryCount?: number;
77
166
  httpTimeoutMs?: number;
@@ -82,54 +171,82 @@ declare type IIdvOptions = {
82
171
  userName: string;
83
172
  };
84
173
 
85
- declare type PrepareWorkflowCompletion = {
174
+ export declare type InitializeCompletion = {
175
+ error?: BaseInitializationError;
176
+ };
177
+
178
+ export declare enum InitializeError {
179
+ CONFIG_MISSED_OR_INVALID = 0,
180
+ MODULES_INSTANTIATION_FAILURE = 1,
181
+ INITIALIZATION_IN_PROGRESS = 2
182
+ }
183
+
184
+ export declare type PrepareWorkflowCompletion = {
86
185
  workflow?: Workflow;
87
- error?: PrepareWorkflowError;
186
+ error?: BasePrepareWorkflowError;
88
187
  };
89
188
 
90
- declare enum PrepareWorkflowError {
91
- CONNECTION_ISSUE = "CONNECTION_ISSUE",
92
- WORKFLOW_ISSUE = "WORKFLOW_ISSUE",
93
- INTERNAL_ISSUE = "INTERNAL_ISSUE"
189
+ export declare enum PrepareWorkflowError {
190
+ INITIALIZATION_REQUIRED = 0,
191
+ CONNECTION_ISSUE = 1,
192
+ WORKFLOW_ISSUE = 2,
193
+ INTERNAL_ISSUE = 3,
194
+ SCENARIO_IN_PROGRESS = 4
94
195
  }
95
196
 
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"
197
+ export declare enum ScenarioError {
198
+ INITIALIZATION_REQUIRED = 0,
199
+ PREPARED_REQUIRED = 1,
200
+ START_SESSION_ERROR = 2,
201
+ UNKNOWN_STEP = 3,
202
+ MODULES_ISSUE = 4,
203
+ ALREADY_STARTED = 5,
204
+ INTERNAL_ISSUE = 6
102
205
  }
103
206
 
104
207
  declare type ScenarioResults = {
105
- status: ScenarioStatus;
106
- results?: Record<string, any>;
107
- };
208
+ sessionId?: string;
209
+ finalStep?: WorkflowStep;
210
+ } & Record<string, any>;
108
211
 
109
- declare enum ScenarioStatus {
110
- FINISHED = "FINISHED",
111
- CANCELLED = "CANCELLED",
112
- ERROR = "ERROR"
212
+ export declare enum SessionError {
213
+ HTTP_ISSUE = 0,
214
+ PROVIDER_ERROR = 1,
215
+ DECODING_FAILED = 2,
216
+ SAME_STEP = 3,
217
+ IS_PROCESSING = 4,
218
+ NOT_DATA_TYPE = 5
219
+ }
220
+
221
+ export declare enum StartSessionError {
222
+ HTTP_ISSUE = 0,
223
+ PROVIDER_ERROR = 1,
224
+ DECODING_FAILED = 2
113
225
  }
114
226
 
115
227
  declare type Workflow = {
116
228
  id: string;
117
- currentStep: string;
118
- steps: Array<any>;
229
+ steps: Array<WorkflowStep>;
119
230
  client: {
120
231
  layout: Record<string, any>;
121
- steps: Array<any>;
232
+ steps: Array<WorkflowStep>;
122
233
  };
123
234
  } & Record<string, any>;
124
235
 
125
- declare type WorkflowCompetion = {
236
+ export declare type WorkflowCompetion = {
126
237
  results?: ScenarioResults;
127
- error?: ScenarioError;
238
+ error?: BaseScenarioError;
128
239
  };
129
240
 
130
- declare type WorkflowListCompletion = {
241
+ export declare enum WorkflowError {
242
+ HTTP_ISSUE = 0,
243
+ PROVIDER_ERROR = 1,
244
+ DECODING_FAILED = 2
245
+ }
246
+
247
+ export declare type WorkflowListCompletion = {
131
248
  results?: Workflow[];
132
- error?: PrepareWorkflowError;
249
+ error?: BasePrepareWorkflowError;
133
250
  };
134
251
 
135
252
  declare type WorkflowListRequest = {
@@ -137,4 +254,10 @@ declare type WorkflowListRequest = {
137
254
  skip: number;
138
255
  };
139
256
 
257
+ declare type WorkflowStep = {
258
+ id: string;
259
+ name: string;
260
+ final: boolean;
261
+ } & Record<string, any>;
262
+
140
263
  export { }