@regulaforensics/idv-capture-web 4.0.672-nightly → 4.0.673-rc

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