@regulaforensics/idv-capture-web 4.0.510-nightly → 4.0.511-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
@@ -1,23 +1,12 @@
1
- import { BaseError } from '../../interfaces-idv/src';
2
- import { BaseError as BaseError_2 } from '../../../interfaces-idv/src';
3
- import { BaseModule } from '../../interfaces-idv/src';
4
1
  import { CSSResult } from 'lit';
5
- import { FailedAssets } from '../../interfaces-idv/src';
6
- import { IdvModuleProps } from '../../interfaces-idv/src';
7
- import { IdvModuleStaticMethods } from '../../interfaces-idv/src';
8
2
  import { LitElement } from 'lit';
9
- import { ModuleClass } from '../../interfaces-idv/src';
10
3
  import { nothing } from 'lit';
11
- import { PerformType } from '../../../interfaces-idv/src';
12
- import { PerformType as PerformType_2 } from '../../../../interfaces-idv/src';
13
- import { registerModule } from '../../interfaces-idv/src';
14
4
  import { TemplateResult } from 'lit-html';
15
5
 
16
6
  export declare type ApiKeyConnectionConfig = {
17
7
  baseUrl: string;
18
8
  apiKey: string;
19
9
  ttl?: number;
20
- httpTimeoutMs?: number;
21
10
  };
22
11
 
23
12
  declare type AuthTokenStoreData = {
@@ -26,7 +15,7 @@ declare type AuthTokenStoreData = {
26
15
  tokenExpiresAt: number;
27
16
  };
28
17
 
29
- declare class BaseConfigureError extends BaseError_2 {
18
+ declare class BaseConfigureError extends BaseError {
30
19
  private static readonly MODULE;
31
20
  private static readonly ERROR_ENUM_NAME;
32
21
  private static readonly SHORT_CODE;
@@ -34,11 +23,11 @@ declare class BaseConfigureError extends BaseError_2 {
34
23
  errorCode: ConfigureError;
35
24
  message?: string;
36
25
  underlyingError?: string;
37
- underlyingBaseError?: BaseError_2;
26
+ underlyingBaseError?: BaseError;
38
27
  });
39
28
  }
40
29
 
41
- declare class BaseConnectionError extends BaseError_2 {
30
+ declare class BaseConnectionError extends BaseError {
42
31
  private static readonly MODULE;
43
32
  private static readonly ERROR_ENUM_NAME;
44
33
  private static readonly SHORT_CODE;
@@ -46,11 +35,11 @@ declare class BaseConnectionError extends BaseError_2 {
46
35
  errorCode: ConnectionError;
47
36
  message?: string;
48
37
  underlyingError?: string;
49
- underlyingBaseError?: BaseError_2;
38
+ underlyingBaseError?: BaseError;
50
39
  });
51
40
  }
52
41
 
53
- declare class BaseDeinitializationError extends BaseError_2 {
42
+ declare class BaseDeinitializationError extends BaseError {
54
43
  private static readonly MODULE;
55
44
  private static readonly ERROR_ENUM_NAME;
56
45
  private static readonly SHORT_CODE;
@@ -58,13 +47,39 @@ declare class BaseDeinitializationError extends BaseError_2 {
58
47
  errorCode: DeinitializationError;
59
48
  message?: string;
60
49
  underlyingError?: string;
61
- underlyingBaseError?: BaseError_2;
50
+ underlyingBaseError?: BaseError;
62
51
  });
63
52
  }
64
53
 
65
- export { BaseError }
54
+ export declare class BaseError {
55
+ errorCode: number | string;
56
+ errorCodeKey: string;
57
+ message?: string;
58
+ underlyingError?: string;
59
+ underlyingBaseError?: BaseError;
60
+ domain?: string;
61
+ module: string;
62
+ errorEnumName: string;
63
+ shortDomainCode: string;
64
+ constructor({ errorCode, errorCodeKey, message, underlyingError, underlyingBaseError, domain, module, errorEnumName, shortDomainCode, }: {
65
+ errorCode: number | string;
66
+ errorCodeKey: string;
67
+ module: string;
68
+ message?: string;
69
+ underlyingError?: string;
70
+ underlyingBaseError?: BaseError;
71
+ domain?: string;
72
+ errorEnumName: string;
73
+ shortDomainCode: string;
74
+ });
75
+ static getErrorKey<T extends Record<string, any>>(errorCode: number | string, errorEnum: T): string;
76
+ get lastUnderlyingError(): string | undefined;
77
+ toObject(): Record<string, any>;
78
+ get shortChain(): string;
79
+ get fullChain(): string;
80
+ }
66
81
 
67
- declare class BaseInitializationError extends BaseError_2 {
82
+ declare class BaseInitializationError extends BaseError {
68
83
  private static readonly MODULE;
69
84
  private static readonly ERROR_ENUM_NAME;
70
85
  private static readonly SHORT_CODE;
@@ -72,11 +87,11 @@ declare class BaseInitializationError extends BaseError_2 {
72
87
  errorCode: InitializeError;
73
88
  message?: string;
74
89
  underlyingError?: string;
75
- underlyingBaseError?: BaseError_2;
90
+ underlyingBaseError?: BaseError;
76
91
  });
77
92
  }
78
93
 
79
- export declare class BaseLoginError extends BaseError_2 {
94
+ export declare class BaseLoginError extends BaseError {
80
95
  private static readonly MODULE;
81
96
  private static readonly ERROR_ENUM_NAME;
82
97
  private static readonly SHORT_CODE;
@@ -84,13 +99,16 @@ export declare class BaseLoginError extends BaseError_2 {
84
99
  errorCode: LoginError;
85
100
  message?: string;
86
101
  underlyingError?: string;
87
- underlyingBaseError?: BaseError_2;
102
+ underlyingBaseError?: BaseError;
88
103
  });
89
104
  }
90
105
 
91
- export { BaseModule }
106
+ export declare abstract class BaseModule<TModuleProps = unknown, TModulesConfig = unknown> extends HTMLElement {
107
+ abstract props: IdvModuleProps<TModuleProps, TModulesConfig> | null;
108
+ abstract setProps(config: IdvModuleProps<TModuleProps, TModulesConfig>): void;
109
+ }
92
110
 
93
- declare class BasePrepareWorkflowError extends BaseError_2 {
111
+ declare class BasePrepareWorkflowError extends BaseError {
94
112
  private static readonly MODULE;
95
113
  private static readonly ERROR_ENUM_NAME;
96
114
  private static readonly SHORT_CODE;
@@ -98,11 +116,11 @@ declare class BasePrepareWorkflowError extends BaseError_2 {
98
116
  errorCode: PrepareWorkflowError;
99
117
  message?: string;
100
118
  underlyingError?: string;
101
- underlyingBaseError?: BaseError_2;
119
+ underlyingBaseError?: BaseError;
102
120
  });
103
121
  }
104
122
 
105
- declare class BaseTokenInitializationError extends BaseError_2 {
123
+ declare class BaseTokenInitializationError extends BaseError {
106
124
  private static readonly MODULE;
107
125
  private static readonly ERROR_ENUM_NAME;
108
126
  private static readonly SHORT_CODE;
@@ -110,11 +128,11 @@ declare class BaseTokenInitializationError extends BaseError_2 {
110
128
  errorCode: TokenInitializeError;
111
129
  message?: string;
112
130
  underlyingError?: string;
113
- underlyingBaseError?: BaseError_2;
131
+ underlyingBaseError?: BaseError;
114
132
  });
115
133
  }
116
134
 
117
- declare class BaseWorkflowError extends BaseError_2 {
135
+ declare class BaseWorkflowError extends BaseError {
118
136
  private static readonly MODULE;
119
137
  private static readonly ERROR_ENUM_NAME;
120
138
  private static readonly SHORT_CODE;
@@ -122,7 +140,7 @@ declare class BaseWorkflowError extends BaseError_2 {
122
140
  errorCode: WorkflowError;
123
141
  message?: string;
124
142
  underlyingError?: string;
125
- underlyingBaseError?: BaseError_2;
143
+ underlyingBaseError?: BaseError;
126
144
  });
127
145
  }
128
146
 
@@ -147,7 +165,6 @@ declare type ConnectionByApiKeyConfigCore = {
147
165
  deviceDescriptor: {
148
166
  ttl: number;
149
167
  };
150
- httpTimeoutMs?: number;
151
168
  };
152
169
 
153
170
  declare type ConnectionConfigCore = {
@@ -156,7 +173,6 @@ declare type ConnectionConfigCore = {
156
173
  password: string;
157
174
  port?: number;
158
175
  userName: string;
159
- httpTimeoutMs?: number;
160
176
  };
161
177
 
162
178
  export declare enum ConnectionError {
@@ -173,7 +189,6 @@ export declare type CredentialConnectionConfig = {
173
189
  baseUrl: string;
174
190
  password: string;
175
191
  userName: string;
176
- httpTimeoutMs?: number;
177
192
  };
178
193
 
179
194
  declare type CurrentScreenConfig = {
@@ -218,6 +233,12 @@ export declare type DeinitializeCompletion = {
218
233
  error?: BaseDeinitializationError;
219
234
  };
220
235
 
236
+ declare type FailedAssets = {
237
+ imageURL: Set<string>;
238
+ base64: Set<string>;
239
+ blockingAssets: Set<string>;
240
+ };
241
+
221
242
  declare type FetchErrorResult = {
222
243
  code: FetchResultCode.HTTP_ISSUE | FetchResultCode.PROVIDER_ERROR | FetchResultCode.DECODING_FAILED;
223
244
  data: FetchState;
@@ -328,7 +349,6 @@ export declare const IdvEventTypesEnum: {
328
349
 
329
350
  declare class IdvFetchService {
330
351
  private _connectionTokenExpirationBufferMs;
331
- private _httpTimeoutMs;
332
352
  private _origin;
333
353
  private _apiKeyAuthToken;
334
354
  private _connectionToken;
@@ -360,8 +380,6 @@ declare class IdvFetchService {
360
380
  } | FetchErrorResult>;
361
381
  private _getAuthorizationSearchParam;
362
382
  private _getResponseTextFromBadResponse;
363
- private _applyHttpTimeout;
364
- private _getRequestSignal;
365
383
  private _httpFetch;
366
384
  private _fetchPing;
367
385
  private _fetchMe;
@@ -438,12 +456,11 @@ declare class IdvFetchService {
438
456
  data: SessionData;
439
457
  } | FetchErrorResult>;
440
458
  pushLogs(sessionId: string, pushLogsParams: PushLogsParams): Promise<Record<string, unknown>>;
441
- startIamAuth({ applicationId, baseUrl, metadata, locale, httpTimeoutMs, }: {
459
+ startIamAuth({ applicationId, baseUrl, metadata, locale, }: {
442
460
  applicationId: string;
443
461
  baseUrl: string;
444
462
  metadata?: Record<string, unknown>;
445
463
  locale?: string;
446
- httpTimeoutMs?: number;
447
464
  }): Promise<Record<string, unknown>>;
448
465
  private _postStartUpload;
449
466
  private _postFileChunk;
@@ -481,7 +498,7 @@ declare type IdvIntegrationControllerProps = {
481
498
  }>;
482
499
  getWorkflows: (params?: WorkflowListRequest) => Promise<WorkflowListCompletion>;
483
500
  prepareWorkflowAndPrepareUi: (workflowId: string) => Promise<PrepareWorkflowCompletion>;
484
- startSession: (params: {
501
+ startNewSession: (params: {
485
502
  completion: (data: WorkflowCompletion) => void;
486
503
  locale: string;
487
504
  metadata?: Record<string, unknown>;
@@ -493,7 +510,6 @@ declare type IdvIntegrationControllerProps = {
493
510
  baseUrl: string;
494
511
  metadata?: Record<string, unknown>;
495
512
  locale?: string;
496
- httpTimeoutMs?: number;
497
513
  }) => Promise<Record<string, unknown>>;
498
514
  };
499
515
 
@@ -538,9 +554,23 @@ export declare type IdvMessageEvent = {
538
554
  message?: IdvServiceMessages | string;
539
555
  };
540
556
 
541
- export { IdvModuleProps }
557
+ export declare type IdvModuleProps<TModuleProps, TModulesConfig> = {
558
+ isProcessing?: (isProcessing: boolean) => void;
559
+ moduleProps: TModuleProps;
560
+ modulesConfig?: TModulesConfig;
561
+ perform: (data: any, type?: PerformType) => void;
562
+ idvEventListener: (module: string, data: any) => void;
563
+ nonce?: string;
564
+ };
542
565
 
543
- export { IdvModuleStaticMethods }
566
+ export declare interface IdvModuleStaticMethods {
567
+ displayName: string;
568
+ isReady(): boolean;
569
+ getSupportedTemplates(): string[];
570
+ initialize(modulesConfig: Record<string, unknown>): void;
571
+ deinitialize(): void;
572
+ getIdentifier(): string;
573
+ }
544
574
 
545
575
  export declare enum IdvServiceMessages {
546
576
  DID_START_SESSION = "DID_START_SESSION",
@@ -613,7 +643,7 @@ export declare class IdvWebComponent extends LitElement {
613
643
  connectedCallback(): void;
614
644
  _listenerFromModule: (module: string, data: any) => void;
615
645
  _isProcessingCallback: (isProcessing: boolean) => void;
616
- _performFromModule: (data: any, type?: PerformType_2) => void;
646
+ _performFromModule: (data: any, type?: PerformType) => void;
617
647
  _processingScreen(): HTMLElement | TemplateResult<1>;
618
648
  private _isTheSameModuleAndScreen;
619
649
  _currentScreen(): HTMLElement | typeof nothing;
@@ -654,7 +684,6 @@ export declare type LoginConfig = {
654
684
  baseUrl: string;
655
685
  metadata?: Record<string, unknown>;
656
686
  locale?: string;
657
- httpTimeoutMs?: number;
658
687
  };
659
688
 
660
689
  export declare enum LoginError {
@@ -668,7 +697,14 @@ export declare enum LoginError {
668
697
  AUTH_FAILURE = 7
669
698
  }
670
699
 
671
- export { ModuleClass }
700
+ export declare type ModuleClass<TModuleProps = unknown, TModulesConfig = unknown> = IdvModuleStaticMethods & (new (...args: any[]) => BaseModule<TModuleProps, TModulesConfig>);
701
+
702
+ declare type PerformType = (typeof PerformTypes)[keyof typeof PerformTypes] | undefined;
703
+
704
+ declare const PerformTypes: {
705
+ readonly FORM: "form";
706
+ readonly DATA: "data";
707
+ };
672
708
 
673
709
  export declare type PrepareWorkflowCompletion = {
674
710
  workflow?: Workflow;
@@ -708,7 +744,7 @@ declare type PushLogsParams = {
708
744
  };
709
745
  };
710
746
 
711
- export { registerModule }
747
+ export declare function registerModule<TModuleProps = unknown, TModulesConfig = unknown>(name: string, ModuleClass: ModuleClass<TModuleProps, TModulesConfig>): void;
712
748
 
713
749
  declare type SessionData = {
714
750
  id: string;
@@ -769,7 +805,6 @@ declare type StartConfig = {
769
805
  isSecure?: boolean;
770
806
  apiKey?: string;
771
807
  port?: number;
772
- httpTimeoutMs?: number;
773
808
  };
774
809
 
775
810
  export declare type StartLoginCompletion = string | BaseLoginError;
@@ -816,7 +851,6 @@ declare type Workflow = {
816
851
  id: string;
817
852
  logging?: WorkflowLogging | null;
818
853
  steps: Array<WorkflowStep>;
819
- stepTemplateIds?: string[];
820
854
  client: WorkflowClient;
821
855
  trackLocation?: boolean;
822
856
  error?: string | null;
@@ -871,7 +905,6 @@ declare class WorkflowModel implements Workflow {
871
905
  id: string;
872
906
  steps: WorkflowStepModel[];
873
907
  client: WorkflowClientModel;
874
- stepTemplateIds?: string[];
875
908
  name?: string;
876
909
  logging?: WorkflowLoggingModel | null;
877
910
  error?: string | null;
@@ -932,25 +965,3 @@ declare class WorkflowStepModel implements WorkflowStep {
932
965
  }
933
966
 
934
967
  export { }
935
-
936
-
937
-
938
- declare global {
939
- const VERSION: string;
940
- const ENV: string;
941
-
942
- interface Window {
943
- RegulaIdvService: IdvFetchService;
944
- allowedCameras: InputDeviceInfo[];
945
- }
946
-
947
- declare namespace preact.JSX {
948
- interface IntrinsicElements {
949
- 'face-liveness': IFaceLiveness;
950
- 'document-reader': IDocumentReader;
951
- 'idv-flow': any;
952
- 'idv-document': any;
953
- 'idv-face': any;
954
- }
955
- }
956
- }