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