@regulaforensics/idv-capture-web 0.1.85-nightly → 0.1.87-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,15 +99,17 @@ 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;
105
+ setSessionRestoreMode(isEnabled: boolean): void;
106
+ get currentSessionId(): string | null;
16
107
  getWorkFlows(params?: WorkflowListRequest): Promise<WorkflowListCompletion>;
17
108
  prepareWorkflow({ workfowId }: {
18
109
  workfowId: string;
19
110
  }): Promise<PrepareWorkflowCompletion>;
20
111
  startWorkflow(): Promise<WorkflowCompetion>;
21
- deinitialize(): Promise<void>;
112
+ deinitialize(): Promise<DeinitializeCompletion>;
22
113
  }
23
114
 
24
115
  export declare type IdvMessageEvent = {
@@ -30,7 +121,7 @@ export declare type IdvMessageEvent = {
30
121
  details?: any;
31
122
  };
32
123
 
33
- declare enum IdvServiceErrors {
124
+ export declare enum IdvServiceErrors {
34
125
  CONNECT_TO_IDV_ERROR = "CONNECT_TO_IDV_ERROR",
35
126
  PLAY_WORKFLOW_ERROR = "PLAY_WORKFLOW_ERROR",
36
127
  SERVICE_NOT_RUNNING_ERROR = "SERVICE_NOT_RUNNING_ERROR",
@@ -42,6 +133,9 @@ declare enum IdvServiceErrors {
42
133
 
43
134
  export declare enum IdvServiceMessages {
44
135
  INITIALIZED = "INITIALIZED",
136
+ DID_START_SESSION = "DID_START_SESSION",
137
+ DID_END_SESSION = "DID_END_SESSION",
138
+ DID_START_RESTORE_SESSION = "DID_START_RESTORE_SESSION",
45
139
  READY_TO_PLAY = "READY_TO_PLAY",
46
140
  CONNECT_TO_IDV = "CONNECT_TO_IDV",
47
141
  START_SESSION = "START_SESSION",
@@ -53,25 +147,23 @@ export declare enum IdvServiceMessages {
53
147
  export declare class IdvWebComponent extends HTMLElement {
54
148
  private _root;
55
149
  private _mounted;
56
- private _nonce?;
57
150
  constructor();
58
151
  static get observedAttributes(): Array<string>;
59
- private setNonce;
60
152
  connectedCallback(): void;
61
153
  get version(): string;
62
154
  private render;
63
155
  disconnectedCallback(): void;
64
156
  }
65
157
 
66
- declare type IIdvConfig = {
158
+ export declare type IIdvConfig = {
67
159
  connectionConfig: IIdvOptions;
68
- modulesConfig: Record<string, any>;
160
+ modulesConfig?: Record<string, any>;
69
161
  includedModules: any[];
70
162
  licenseConfig?: Record<string, any>;
71
163
  listener?: (message: IdvMessageEvent) => void;
72
164
  };
73
165
 
74
- declare type IIdvOptions = {
166
+ export declare type IIdvOptions = {
75
167
  host: string;
76
168
  httpRetryCount?: number;
77
169
  httpTimeoutMs?: number;
@@ -82,54 +174,82 @@ declare type IIdvOptions = {
82
174
  userName: string;
83
175
  };
84
176
 
85
- declare type PrepareWorkflowCompletion = {
177
+ export declare type InitializeCompletion = {
178
+ error?: BaseInitializationError;
179
+ };
180
+
181
+ export declare enum InitializeError {
182
+ CONFIG_MISSED_OR_INVALID = 0,
183
+ MODULES_INSTANTIATION_FAILURE = 1,
184
+ INITIALIZATION_IN_PROGRESS = 2
185
+ }
186
+
187
+ export declare type PrepareWorkflowCompletion = {
86
188
  workflow?: Workflow;
87
- error?: PrepareWorkflowError;
189
+ error?: BasePrepareWorkflowError;
88
190
  };
89
191
 
90
- declare enum PrepareWorkflowError {
91
- CONNECTION_ISSUE = "CONNECTION_ISSUE",
92
- WORKFLOW_ISSUE = "WORKFLOW_ISSUE",
93
- INTERNAL_ISSUE = "INTERNAL_ISSUE"
192
+ export declare enum PrepareWorkflowError {
193
+ INITIALIZATION_REQUIRED = 0,
194
+ CONNECTION_ISSUE = 1,
195
+ WORKFLOW_ISSUE = 2,
196
+ INTERNAL_ISSUE = 3,
197
+ SCENARIO_IN_PROGRESS = 4
94
198
  }
95
199
 
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"
200
+ export declare enum ScenarioError {
201
+ INITIALIZATION_REQUIRED = 0,
202
+ PREPARED_REQUIRED = 1,
203
+ START_SESSION_ERROR = 2,
204
+ UNKNOWN_STEP = 3,
205
+ MODULES_ISSUE = 4,
206
+ ALREADY_STARTED = 5,
207
+ INTERNAL_ISSUE = 6
102
208
  }
103
209
 
104
210
  declare type ScenarioResults = {
105
- status: ScenarioStatus;
106
- results?: Record<string, any>;
107
- };
211
+ sessionId?: string;
212
+ finalStep?: WorkflowStep;
213
+ } & Record<string, any>;
108
214
 
109
- declare enum ScenarioStatus {
110
- FINISHED = "FINISHED",
111
- CANCELLED = "CANCELLED",
112
- ERROR = "ERROR"
215
+ export declare enum SessionError {
216
+ HTTP_ISSUE = 0,
217
+ PROVIDER_ERROR = 1,
218
+ DECODING_FAILED = 2,
219
+ SAME_STEP = 3,
220
+ IS_PROCESSING = 4,
221
+ NOT_DATA_TYPE = 5
222
+ }
223
+
224
+ export declare enum StartSessionError {
225
+ HTTP_ISSUE = 0,
226
+ PROVIDER_ERROR = 1,
227
+ DECODING_FAILED = 2
113
228
  }
114
229
 
115
230
  declare type Workflow = {
116
231
  id: string;
117
- currentStep: string;
118
- steps: Array<any>;
232
+ steps: Array<WorkflowStep>;
119
233
  client: {
120
234
  layout: Record<string, any>;
121
- steps: Array<any>;
235
+ steps: Array<WorkflowStep>;
122
236
  };
123
237
  } & Record<string, any>;
124
238
 
125
- declare type WorkflowCompetion = {
239
+ export declare type WorkflowCompetion = {
126
240
  results?: ScenarioResults;
127
- error?: ScenarioError;
241
+ error?: BaseScenarioError;
128
242
  };
129
243
 
130
- declare type WorkflowListCompletion = {
244
+ export declare enum WorkflowError {
245
+ HTTP_ISSUE = 0,
246
+ PROVIDER_ERROR = 1,
247
+ DECODING_FAILED = 2
248
+ }
249
+
250
+ export declare type WorkflowListCompletion = {
131
251
  results?: Workflow[];
132
- error?: PrepareWorkflowError;
252
+ error?: BasePrepareWorkflowError;
133
253
  };
134
254
 
135
255
  declare type WorkflowListRequest = {
@@ -137,4 +257,10 @@ declare type WorkflowListRequest = {
137
257
  skip: number;
138
258
  };
139
259
 
260
+ declare type WorkflowStep = {
261
+ id: string;
262
+ name: string;
263
+ final: boolean;
264
+ } & Record<string, any>;
265
+
140
266
  export { }