@regulaforensics/idv-capture-web 4.0.665-nightly → 4.0.666-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,
@@ -358,62 +344,121 @@ declare class IdvFetchService {
358
344
  private _setConnectionToken;
359
345
  private _getOriginFromConfig;
360
346
  private _getOriginFromUrl;
347
+ private _getSessionIdFromUrl;
361
348
  private _getExpiresAtFromTtl;
362
349
  private _getAuthorizationHeaderFromConnectionToken;
363
350
  private _getAuthorizationHeaderFromBasicToken;
364
351
  private _getAuthorizationHeaderFromAuthToken;
365
352
  private _getApiKeyAuthTokenFromLs;
366
353
  private _getApiKeyAuthTokenFromHeader;
367
- private _requestEphemeralAuthToken;
368
- 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;
369
367
  private _getResponseTextFromBadResponse;
370
368
  private _applyHttpTimeout;
371
369
  private _getRequestSignal;
372
370
  private _httpFetch;
373
- private _fetchAndHandleResponse;
374
371
  private _fetchPing;
375
372
  private _fetchMe;
376
373
  private _fetchConnection;
377
374
  private _fetchEphemeral;
375
+ private _fetchSessionByWorkflowId;
378
376
  private _fetchSessionState;
379
- connectByUserPass(config: ConnectionConfigCore): Promise<FetchResult<ConnectResult>>;
380
- connectByApiKey(config: ConnectionByApiKeyConfigCore, isFromSession: boolean): Promise<FetchResult<ApiKeyConnectResult>>;
381
- 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>;
382
401
  getConnectionToken(isFromSession: boolean): Promise<string>;
383
402
  startSession({ workflowId, locale, metadata, location, }: {
384
403
  workflowId: string;
385
404
  locale: string;
386
405
  metadata?: Record<string, unknown>;
387
406
  location?: GeoCoords | null;
388
- }): Promise<FetchResult<SessionData>>;
407
+ }): Promise<{
408
+ code: FetchResultCode.SUCCESS;
409
+ data: SessionData;
410
+ } | FetchErrorResult>;
389
411
  continueSession({ sessionId, locale, }: {
390
412
  sessionId: string;
391
413
  locale: string;
392
- }): Promise<FetchResult<SessionData>>;
414
+ }): Promise<{
415
+ code: FetchResultCode.SUCCESS;
416
+ data: SessionData;
417
+ } | FetchErrorResult>;
393
418
  listWorkflows(params?: {
394
419
  limit: number;
395
420
  skip: number;
396
- }): Promise<FetchResult<WorkflowsData>>;
397
- 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>;
398
432
  pushData({ sessionId, stepId, data, type, }: {
399
433
  sessionId: string;
400
434
  stepId: string;
401
435
  data: any;
402
436
  type?: PerformType;
403
- }): Promise<FetchResult<Record<string, unknown>>>;
404
- getSessionState(sessionId: string, locale?: string): Promise<FetchResult<SessionData>>;
405
- 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>>;
406
446
  startIamAuth({ applicationId, baseUrl, metadata, locale, httpTimeoutMs, }: {
407
447
  applicationId: string;
408
448
  baseUrl: string;
409
449
  metadata?: Record<string, unknown>;
410
450
  locale?: string;
411
451
  httpTimeoutMs?: number;
412
- }): Promise<FetchResult<Record<string, unknown>>>;
413
- private _startUpload;
414
- private _uploadFileChunk;
452
+ }): Promise<Record<string, unknown>>;
453
+ private _postStartUpload;
454
+ private _postFileChunk;
415
455
  private _uploadFileInChunks;
416
- 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>;
417
462
  abortRequest(): void;
418
463
  }
419
464
 
@@ -482,15 +527,13 @@ declare enum IdvLogLevelConfigEnum {
482
527
  INFO = "INFO"
483
528
  }
484
529
 
485
- declare const IdvLogLevelEnum: {
486
- readonly DEBUG: "DEBUG";
487
- readonly ERROR: "ERROR";
488
- readonly INFO: "INFO";
489
- readonly WARNING: "WARNING";
490
- readonly CRITICAL: "CRITICAL";
491
- };
492
-
493
- 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
+ }
494
537
 
495
538
  export declare type IdvMessageEvent = {
496
539
  /** @deprecated Prefer `logLevel` and `message`; scheduled for removal. */
@@ -573,7 +616,7 @@ export declare class IdvWebComponent extends LitElement {
573
616
  modulesConfig: Record<string, any>;
574
617
  storeNonce: string | undefined;
575
618
  connectedCallback(): void;
576
- _listenerFromModule: (module: string, data: any, logLevel?: IdvLogLevelEnum) => void;
619
+ _listenerFromModule: (module: string, data: any) => void;
577
620
  _isProcessingCallback: (isProcessing: boolean) => void;
578
621
  _performFromModule: (data: any, type?: PerformType_2) => void;
579
622
  _processingScreen(): HTMLElement | TemplateResult<1>;
@@ -756,10 +799,6 @@ export declare type StartWorkflowConfig = {
756
799
  locale?: string;
757
800
  };
758
801
 
759
- declare type TempFileIdResult = {
760
- tempFileId: string;
761
- };
762
-
763
802
  export declare type TokenConfigureCompletion = {
764
803
  workflows: string[];
765
804
  error?: BaseTokenInitializationError;
@@ -874,11 +913,6 @@ declare type WorkflowResult = {
874
913
  };
875
914
  } & Record<string, any>;
876
915
 
877
- declare type WorkflowsData = {
878
- count: number;
879
- items: Workflow[];
880
- };
881
-
882
916
  declare type WorkflowStep = {
883
917
  type: string;
884
918
  id: string;