@regulaforensics/idv-capture-web 4.0.666-rc → 4.0.667-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
@@ -20,6 +20,11 @@ export declare type ApiKeyConnectionConfig = {
20
20
  httpTimeoutMs?: number;
21
21
  };
22
22
 
23
+ declare type ApiKeyConnectResult = {
24
+ authToken: string;
25
+ workflows: string[];
26
+ };
27
+
23
28
  declare type AuthTokenStoreData = {
24
29
  apiKey: string;
25
30
  authToken: string;
@@ -165,6 +170,10 @@ export declare enum ConnectionError {
165
170
  DECODING_FAILED = 2
166
171
  }
167
172
 
173
+ declare type ConnectResult = {
174
+ workflows: string[];
175
+ };
176
+
168
177
  declare type ContinueSessionResults = {
169
178
  error: BaseWorkflowError;
170
179
  } | {
@@ -225,6 +234,11 @@ declare type FetchErrorResult = {
225
234
  data: FetchState;
226
235
  };
227
236
 
237
+ declare type FetchResult<T> = {
238
+ code: FetchResultCode.SUCCESS;
239
+ data: T;
240
+ } | FetchErrorResult;
241
+
228
242
  declare enum FetchResultCode {
229
243
  SUCCESS = 0,
230
244
  HTTP_ISSUE = 4,
@@ -316,6 +330,8 @@ declare type IdvBusinessLogicControllerProps = {
316
330
  setFinalWaitingUi: (isWaitingUi: boolean) => void;
317
331
  _setFinalStepAndStopProcess: (stepId?: string) => void;
318
332
  _setIamAuthCodeAndStopProcess: (step: WorkflowStep) => void;
333
+ _redirectUsingFormSubmit: (url: string, authorizationToken: string) => void;
334
+ _redirectAndStopProcess: (step: WorkflowStep) => Promise<void>;
319
335
  resetSession: () => void;
320
336
  resetFetchService: () => void;
321
337
  _decodeMessageFromWebSocket: (eventData: MessageEvent['data']) => WebSocketDecodedSessionMessage | null;
@@ -344,121 +360,62 @@ declare class IdvFetchService {
344
360
  private _setConnectionToken;
345
361
  private _getOriginFromConfig;
346
362
  private _getOriginFromUrl;
347
- private _getSessionIdFromUrl;
348
363
  private _getExpiresAtFromTtl;
349
364
  private _getAuthorizationHeaderFromConnectionToken;
350
365
  private _getAuthorizationHeaderFromBasicToken;
351
366
  private _getAuthorizationHeaderFromAuthToken;
352
367
  private _getApiKeyAuthTokenFromLs;
353
368
  private _getApiKeyAuthTokenFromHeader;
354
- _getValidApiKeyAuthToken(config: {
355
- apiKey: string;
356
- deviceDescriptor: {
357
- ttl: number;
358
- };
359
- }, isFromSession: boolean): Promise<{
360
- code: FetchResultCode.SUCCESS;
361
- data: {
362
- token: string;
363
- expiresAt: number;
364
- };
365
- } | FetchErrorResult>;
366
- private _getAuthorizationSearchParam;
369
+ private _requestEphemeralAuthToken;
370
+ private _getValidApiKeyAuthToken;
367
371
  private _getResponseTextFromBadResponse;
368
372
  private _applyHttpTimeout;
369
373
  private _getRequestSignal;
370
374
  private _httpFetch;
375
+ private _fetchAndHandleResponse;
371
376
  private _fetchPing;
372
377
  private _fetchMe;
373
378
  private _fetchConnection;
374
379
  private _fetchEphemeral;
375
- private _fetchSessionByWorkflowId;
376
380
  private _fetchSessionState;
377
- private _fetchWorkflows;
378
- private _fetchWorkflow;
379
- private _fetchStep;
380
- private _fetchSessionLogs;
381
- private _fetchStartIamAuth;
382
- connectByUserPass(config: ConnectionConfigCore): Promise<{
383
- code: FetchResultCode.SUCCESS;
384
- data: {
385
- workflows: string[];
386
- };
387
- } | FetchErrorResult>;
388
- connectByApiKey(config: ConnectionByApiKeyConfigCore, isFromSession: boolean): Promise<{
389
- code: FetchResultCode.SUCCESS;
390
- data: {
391
- authToken: string;
392
- workflows: string[];
393
- };
394
- } | FetchErrorResult>;
395
- connectByUrl(urlWithToken: string): Promise<{
396
- code: FetchResultCode.SUCCESS;
397
- data: {
398
- workflows: string[];
399
- };
400
- } | FetchErrorResult>;
381
+ connectByUserPass(config: ConnectionConfigCore): Promise<FetchResult<ConnectResult>>;
382
+ connectByApiKey(config: ConnectionByApiKeyConfigCore, isFromSession: boolean): Promise<FetchResult<ApiKeyConnectResult>>;
383
+ connectByUrl(urlWithToken: string): Promise<FetchResult<ConnectResult>>;
401
384
  getConnectionToken(isFromSession: boolean): Promise<string>;
402
385
  startSession({ workflowId, locale, metadata, location, }: {
403
386
  workflowId: string;
404
387
  locale: string;
405
388
  metadata?: Record<string, unknown>;
406
389
  location?: GeoCoords | null;
407
- }): Promise<{
408
- code: FetchResultCode.SUCCESS;
409
- data: SessionData;
410
- } | FetchErrorResult>;
390
+ }): Promise<FetchResult<SessionData>>;
411
391
  continueSession({ sessionId, locale, }: {
412
392
  sessionId: string;
413
393
  locale: string;
414
- }): Promise<{
415
- code: FetchResultCode.SUCCESS;
416
- data: SessionData;
417
- } | FetchErrorResult>;
394
+ }): Promise<FetchResult<SessionData>>;
418
395
  listWorkflows(params?: {
419
396
  limit: number;
420
397
  skip: number;
421
- }): Promise<{
422
- code: FetchResultCode.SUCCESS;
423
- data: {
424
- count: number;
425
- items: Workflow[];
426
- };
427
- } | FetchErrorResult>;
428
- getWorkflow(workflowId: string, sessionIdFromUrl?: string | null, locale?: string): Promise<{
429
- code: FetchResultCode.SUCCESS;
430
- data: Workflow;
431
- } | FetchErrorResult>;
398
+ }): Promise<FetchResult<WorkflowsData>>;
399
+ getWorkflow(workflowId: string, sessionIdFromUrl?: string | null, locale?: string): Promise<FetchResult<Workflow>>;
432
400
  pushData({ sessionId, stepId, data, type, }: {
433
401
  sessionId: string;
434
402
  stepId: string;
435
403
  data: any;
436
404
  type?: PerformType;
437
- }): Promise<{
438
- code: FetchResultCode.SUCCESS;
439
- data: Record<string, unknown>;
440
- } | FetchErrorResult>;
441
- getSessionState(sessionId: string, locale?: string): Promise<{
442
- code: FetchResultCode.SUCCESS;
443
- data: SessionData;
444
- } | FetchErrorResult>;
445
- pushLogs(sessionId: string, pushLogsParams: PushLogsParams): Promise<Record<string, unknown>>;
405
+ }): Promise<FetchResult<Record<string, unknown>>>;
406
+ getSessionState(sessionId: string, locale?: string): Promise<FetchResult<SessionData>>;
407
+ pushLogs(sessionId: string, pushLogsParams: PushLogsParams): Promise<FetchResult<Record<string, unknown>>>;
446
408
  startIamAuth({ applicationId, baseUrl, metadata, locale, httpTimeoutMs, }: {
447
409
  applicationId: string;
448
410
  baseUrl: string;
449
411
  metadata?: Record<string, unknown>;
450
412
  locale?: string;
451
413
  httpTimeoutMs?: number;
452
- }): Promise<Record<string, unknown>>;
453
- private _postStartUpload;
454
- private _postFileChunk;
414
+ }): Promise<FetchResult<Record<string, unknown>>>;
415
+ private _startUpload;
416
+ private _uploadFileChunk;
455
417
  private _uploadFileInChunks;
456
- uploadFileToTemp(file: File, onProgress: (sentBytes: number, total: number) => void): Promise<{
457
- code: FetchResultCode.SUCCESS;
458
- data: {
459
- tempFileId: string;
460
- };
461
- } | FetchErrorResult>;
418
+ uploadFileToTemp(file: File, onProgress: (sentBytes: number, total: number) => void): Promise<FetchResult<TempFileIdResult>>;
462
419
  abortRequest(): void;
463
420
  }
464
421
 
@@ -527,13 +484,15 @@ declare enum IdvLogLevelConfigEnum {
527
484
  INFO = "INFO"
528
485
  }
529
486
 
530
- declare enum IdvLogLevelEnum {
531
- DEBUG = "DEBUG",
532
- ERROR = "ERROR",
533
- INFO = "INFO",
534
- WARNING = "WARNING",
535
- CRITICAL = "CRITICAL"
536
- }
487
+ declare const IdvLogLevelEnum: {
488
+ readonly DEBUG: "DEBUG";
489
+ readonly ERROR: "ERROR";
490
+ readonly INFO: "INFO";
491
+ readonly WARNING: "WARNING";
492
+ readonly CRITICAL: "CRITICAL";
493
+ };
494
+
495
+ declare type IdvLogLevelEnum = (typeof IdvLogLevelEnum)[keyof typeof IdvLogLevelEnum];
537
496
 
538
497
  export declare type IdvMessageEvent = {
539
498
  /** @deprecated Prefer `logLevel` and `message`; scheduled for removal. */
@@ -616,7 +575,7 @@ export declare class IdvWebComponent extends LitElement {
616
575
  modulesConfig: Record<string, any>;
617
576
  storeNonce: string | undefined;
618
577
  connectedCallback(): void;
619
- _listenerFromModule: (module: string, data: any) => void;
578
+ _listenerFromModule: (module: string, data: any, logLevel?: IdvLogLevelEnum) => void;
620
579
  _isProcessingCallback: (isProcessing: boolean) => void;
621
580
  _performFromModule: (data: any, type?: PerformType_2) => void;
622
581
  _processingScreen(): HTMLElement | TemplateResult<1>;
@@ -799,6 +758,10 @@ export declare type StartWorkflowConfig = {
799
758
  locale?: string;
800
759
  };
801
760
 
761
+ declare type TempFileIdResult = {
762
+ tempFileId: string;
763
+ };
764
+
802
765
  export declare type TokenConfigureCompletion = {
803
766
  workflows: string[];
804
767
  error?: BaseTokenInitializationError;
@@ -913,6 +876,11 @@ declare type WorkflowResult = {
913
876
  };
914
877
  } & Record<string, any>;
915
878
 
879
+ declare type WorkflowsData = {
880
+ count: number;
881
+ items: Workflow[];
882
+ };
883
+
916
884
  declare type WorkflowStep = {
917
885
  type: string;
918
886
  id: string;