@regulaforensics/idv-capture-web 2.5.194-rc → 2.5.196-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/README.md CHANGED
@@ -52,6 +52,12 @@ Install idv-capture-web:
52
52
 
53
53
  ```
54
54
  npm i @regulaforensics/idv-capture-web
55
+ npm i @regulaforensics/idv-gui
56
+
57
+ #optionally
58
+
59
+ npm i @regulaforensics/idv-face
60
+ npm i @regulaforensics/idv-document
55
61
  ```
56
62
 
57
63
  Create `index.html` and `index.js` files in the root directory of the project.
@@ -60,6 +66,7 @@ Import `@regulaforensics/idv-capture-web` into your `index.js`:
60
66
 
61
67
  ```javascript
62
68
  import './node_modules/@regulaforensics/idv-capture-web/dist/main.js';
69
+ import './node_modules/@regulaforensics/idv-gui/dist/main.js';
63
70
  ```
64
71
 
65
72
  In `index.html` connect `index.js` and add the name of the component you want to use. Available components:
@@ -90,6 +97,11 @@ For example:
90
97
 
91
98
  ```html
92
99
  <script src="https://unpkg.com/@regulaforensics/idv-capture-web@latest/dist/main.iife.js"></script>
100
+ <script src="https://unpkg.com/@regulaforensics/idv-gui@latest/dist/main.iife.js"></script>
101
+
102
+ <script src="https://unpkg.com/@regulaforensics/idv-face@latest/dist/main.iife.js"></script>
103
+ <script src="https://unpkg.com/@regulaforensics/idv-document@latest/dist/main.iife.js"></script>
104
+
93
105
  ```
94
106
 
95
107
  Add the name of the component to the html, as in the example above.
@@ -101,6 +113,14 @@ Use `IdvIntegrationService` to setup idv flow.
101
113
  General example of the integration step by step
102
114
 
103
115
  ```javascript
116
+ /** import necessary service & packages */
117
+ import { IdvIntegrationService } from '@regulaforensics/idv-capture-web';
118
+ import { GuiIdv } from "@regulaforensics/idv-gui";
119
+ /** depends of your workflow */
120
+ import { FaceIdv } from "@regulaforensics/idv-face";
121
+ import { DocumentIdv } from "@regulaforensics/idv-document";
122
+
123
+
104
124
  /** create service */
105
125
  const service = new IdvIntegrationService();
106
126
 
@@ -118,7 +138,7 @@ service.eventListener = idvEventListener;
118
138
  /** set modules */
119
139
  const initResult = await service.initialize({
120
140
  modulesConfig: { docreader: { devLicense: 'yourBase64license' } },
121
- includedModules: [IdvModules.LIVENESS, IdvModules.DOC_READER], //import IdvModules from @regulaforensics/idv-capture-web
141
+ includedModules: [GuiIdv, FaceIdv, DocumentIdv],
122
142
  });
123
143
  /** if something goes wrong, the command error will contain an error field. */
124
144
  if (initResult.error) {
@@ -206,7 +226,7 @@ Check types in the `index.d.ts`
206
226
 
207
227
 
208
228
  `async configure(
209
- config: ConnectionConfig | UrlConnectionConfig
229
+ config: ConnectionConfig | UrlConnectionConfig | ConnectionByApiKeyConfig,
210
230
  ): Promise<ConfigureCompletion | UrlConfigureCompletion>` - configures the service. accepts input parameters for connecting to the platform
211
231
 
212
232
  `async getWorkFlows(params?: WorkflowListRequest): Promise<WorkflowListCompletion>` - returns list of available workflows
package/dist/index.d.ts CHANGED
@@ -86,11 +86,23 @@ declare class BaseTokenInitializationError extends BaseError {
86
86
  });
87
87
  }
88
88
 
89
- declare type ConfigureCompletion = {
89
+ export declare type ConfigureCompletion = {
90
90
  error?: BaseInitializationError;
91
91
  };
92
92
 
93
- declare type ConnectionConfig = {
93
+ export declare type ConnectionByApiKeyConfig = {
94
+ host: string;
95
+ apiKey: string;
96
+ isSecure?: boolean;
97
+ port?: number;
98
+ deviceDescriptor: {
99
+ ttl: number;
100
+ } & Record<string, unknown>;
101
+ httpRetryCount?: number;
102
+ httpTimeoutMs?: number;
103
+ };
104
+
105
+ export declare type ConnectionConfig = {
94
106
  host: string;
95
107
  httpRetryCount?: number;
96
108
  httpTimeoutMs?: number;
@@ -99,6 +111,9 @@ declare type ConnectionConfig = {
99
111
  port?: number;
100
112
  schema?: string;
101
113
  userName: string;
114
+ deviceDescriptor?: {
115
+ ttl?: number;
116
+ } & Record<string, unknown>;
102
117
  };
103
118
 
104
119
  export declare enum ConnectionError {
@@ -127,7 +142,7 @@ export declare class IdvIntegrationService {
127
142
  initialize(config: InitConfig): Promise<{
128
143
  error?: BaseInitializationError;
129
144
  }>;
130
- configure(config: ConnectionConfig | UrlConnectionConfig): Promise<ConfigureCompletion | UrlConfigureCompletion>;
145
+ configure(config: ConnectionConfig | UrlConnectionConfig | ConnectionByApiKeyConfig): Promise<ConfigureCompletion | UrlConfigureCompletion>;
131
146
  getWorkFlows(params?: WorkflowListRequest): Promise<WorkflowListCompletion>;
132
147
  prepareWorkflow({ workflowId }: {
133
148
  workflowId: string;
@@ -157,7 +172,8 @@ export declare type IdvModulesType = (typeof IdvModules)[keyof typeof IdvModules
157
172
  export declare enum IdvServiceMessages {
158
173
  DID_START_SESSION = "DID_START_SESSION",
159
174
  DID_END_SESSION = "DID_END_SESSION",
160
- DID_START_RESTORE_SESSION = "DID_START_RESTORE_SESSION"
175
+ DID_START_RESTORE_SESSION = "DID_START_RESTORE_SESSION",
176
+ DID_CONTINUE_REMOTE_SESSION = "DID_CONTINUE_REMOTE_SESSION"
161
177
  }
162
178
 
163
179
  export declare class IdvWebComponent extends HTMLElement {
@@ -171,14 +187,14 @@ export declare class IdvWebComponent extends HTMLElement {
171
187
  disconnectedCallback(): void;
172
188
  }
173
189
 
174
- declare type InitConfig = {
190
+ export declare type InitConfig = {
175
191
  modulesConfig?: {
176
192
  docreader?: {
177
193
  devLicense: string;
178
194
  };
179
195
  face?: Record<string, any>;
180
196
  };
181
- includedModules: IdvModulesType[];
197
+ includedModules: any[];
182
198
  };
183
199
 
184
200
  export declare type InitializeCompletion = {
@@ -207,7 +223,7 @@ export declare enum PrepareWorkflowError {
207
223
  export declare enum ScenarioError {
208
224
  INITIALIZATION_REQUIRED = 0,
209
225
  PREPARED_REQUIRED = 1,
210
- START_SESSION_ERROR = 2,
226
+ START_SESSION_FAILED = 2,
211
227
  UNKNOWN_STEP = 3,
212
228
  MODULES_ISSUE = 4,
213
229
  ALREADY_STARTED = 5,
@@ -236,10 +252,11 @@ export declare enum StartSessionError {
236
252
  HTTP_ISSUE = 0,
237
253
  PROVIDER_ERROR = 1,
238
254
  DECODING_FAILED = 2,
239
- TOKEN_ERROR = 3
255
+ TOKEN_ERROR = 3,
256
+ CONNECTION_ISSUE = 4
240
257
  }
241
258
 
242
- declare type StartWorkflowConfig = {
259
+ export declare type StartWorkflowConfig = {
243
260
  metadata?: Record<string, unknown>;
244
261
  locale?: string;
245
262
  };
@@ -249,12 +266,14 @@ declare enum TokenInitializeError {
249
266
  WORKFLOW_ISSUE = 1
250
267
  }
251
268
 
252
- declare type UrlConfigureCompletion = {
269
+ export declare type UrlConfigureCompletion = {
253
270
  workflows: string[];
254
271
  error?: BaseTokenInitializationError;
255
272
  };
256
273
 
257
- declare type UrlConnectionConfig = string;
274
+ export declare type UrlConnectionConfig = {
275
+ url: string;
276
+ };
258
277
 
259
278
  declare type Workflow = {
260
279
  id: string;
@@ -265,11 +284,6 @@ declare type Workflow = {
265
284
  };
266
285
  } & Record<string, any>;
267
286
 
268
- /**
269
- * @deprecated Use `WorkflowCompletion` instead.
270
- */
271
- export declare type WorkflowCompetion = WorkflowCompletion;
272
-
273
287
  export declare type WorkflowCompletion = {
274
288
  results?: ScenarioResults;
275
289
  error?: BaseScenarioError;
@@ -286,7 +300,7 @@ export declare type WorkflowListCompletion = {
286
300
  error?: BasePrepareWorkflowError;
287
301
  };
288
302
 
289
- declare type WorkflowListRequest = {
303
+ export declare type WorkflowListRequest = {
290
304
  limit: number;
291
305
  skip: number;
292
306
  };