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