@regulaforensics/idv-capture-web 3.10.596-nightly → 3.10.597-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 {
@@ -165,17 +181,14 @@ export declare enum ConnectionError {
165
181
  DECODING_FAILED = 2
166
182
  }
167
183
 
168
- declare type ContinueSessionResults = {
169
- error: BaseWorkflowError;
170
- } | {
171
- shouldStartNewSession: boolean;
184
+ declare type ContinueSessionResults = SessionData | WorkflowResult | {
185
+ error?: BaseWorkflowError;
172
186
  };
173
187
 
174
188
  export declare type CredentialConnectionConfig = {
175
189
  baseUrl: string;
176
190
  password: string;
177
191
  userName: string;
178
- httpTimeoutMs?: number;
179
192
  };
180
193
 
181
194
  declare type CurrentScreenConfig = {
@@ -220,6 +233,12 @@ export declare type DeinitializeCompletion = {
220
233
  error?: BaseDeinitializationError;
221
234
  };
222
235
 
236
+ declare type FailedAssets = {
237
+ imageURL: Set<string>;
238
+ base64: Set<string>;
239
+ blockingAssets: Set<string>;
240
+ };
241
+
223
242
  declare type FetchErrorResult = {
224
243
  code: FetchResultCode.HTTP_ISSUE | FetchResultCode.PROVIDER_ERROR | FetchResultCode.DECODING_FAILED;
225
244
  data: FetchState;
@@ -292,10 +311,7 @@ declare type IdvBusinessLogicControllerProps = {
292
311
  sessionData?: undefined;
293
312
  error: BaseWorkflowError;
294
313
  }>;
295
- _waitForNextStep: () => {
296
- startHttpTimer: () => void;
297
- cancel: () => void;
298
- };
314
+ _waitForNextStep: () => Promise<void>;
299
315
  _stepSocketListenerWhenStepIsRunning: (isStepRunning: boolean) => void;
300
316
  _getSessionStateNextStepConditionResult: () => Promise<DataOrError<SessionModel>>;
301
317
  _findStepById: (stepId: string) => WorkflowStep | null;
@@ -333,7 +349,6 @@ export declare const IdvEventTypesEnum: {
333
349
 
334
350
  declare class IdvFetchService {
335
351
  private _connectionTokenExpirationBufferMs;
336
- private _httpTimeoutMs;
337
352
  private _origin;
338
353
  private _apiKeyAuthToken;
339
354
  private _connectionToken;
@@ -365,8 +380,6 @@ declare class IdvFetchService {
365
380
  } | FetchErrorResult>;
366
381
  private _getAuthorizationSearchParam;
367
382
  private _getResponseTextFromBadResponse;
368
- private _applyHttpTimeout;
369
- private _getRequestSignal;
370
383
  private _httpFetch;
371
384
  private _fetchPing;
372
385
  private _fetchMe;
@@ -443,12 +456,11 @@ declare class IdvFetchService {
443
456
  data: SessionData;
444
457
  } | FetchErrorResult>;
445
458
  pushLogs(sessionId: string, pushLogsParams: PushLogsParams): Promise<Record<string, unknown>>;
446
- startIamAuth({ applicationId, baseUrl, metadata, locale, httpTimeoutMs, }: {
459
+ startIamAuth({ applicationId, baseUrl, metadata, locale, }: {
447
460
  applicationId: string;
448
461
  baseUrl: string;
449
462
  metadata?: Record<string, unknown>;
450
463
  locale?: string;
451
- httpTimeoutMs?: number;
452
464
  }): Promise<Record<string, unknown>>;
453
465
  private _postStartUpload;
454
466
  private _postFileChunk;
@@ -486,7 +498,7 @@ declare type IdvIntegrationControllerProps = {
486
498
  }>;
487
499
  getWorkflows: (params?: WorkflowListRequest) => Promise<WorkflowListCompletion>;
488
500
  prepareWorkflowAndPrepareUi: (workflowId: string) => Promise<PrepareWorkflowCompletion>;
489
- startSession: (params: {
501
+ startNewSession: (params: {
490
502
  completion: (data: WorkflowCompletion) => void;
491
503
  locale: string;
492
504
  metadata?: Record<string, unknown>;
@@ -498,7 +510,6 @@ declare type IdvIntegrationControllerProps = {
498
510
  baseUrl: string;
499
511
  metadata?: Record<string, unknown>;
500
512
  locale?: string;
501
- httpTimeoutMs?: number;
502
513
  }) => Promise<Record<string, unknown>>;
503
514
  };
504
515
 
@@ -543,9 +554,23 @@ export declare type IdvMessageEvent = {
543
554
  message?: IdvServiceMessages | string;
544
555
  };
545
556
 
546
- 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
+ };
547
565
 
548
- 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
+ }
549
574
 
550
575
  export declare enum IdvServiceMessages {
551
576
  DID_START_SESSION = "DID_START_SESSION",
@@ -618,7 +643,7 @@ export declare class IdvWebComponent extends LitElement {
618
643
  connectedCallback(): void;
619
644
  _listenerFromModule: (module: string, data: any) => void;
620
645
  _isProcessingCallback: (isProcessing: boolean) => void;
621
- _performFromModule: (data: any, type?: PerformType_2) => void;
646
+ _performFromModule: (data: any, type?: PerformType) => void;
622
647
  _processingScreen(): HTMLElement | TemplateResult<1>;
623
648
  private _isTheSameModuleAndScreen;
624
649
  _currentScreen(): HTMLElement | typeof nothing;
@@ -659,7 +684,6 @@ export declare type LoginConfig = {
659
684
  baseUrl: string;
660
685
  metadata?: Record<string, unknown>;
661
686
  locale?: string;
662
- httpTimeoutMs?: number;
663
687
  };
664
688
 
665
689
  export declare enum LoginError {
@@ -673,7 +697,14 @@ export declare enum LoginError {
673
697
  AUTH_FAILURE = 7
674
698
  }
675
699
 
676
- 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
+ };
677
708
 
678
709
  export declare type PrepareWorkflowCompletion = {
679
710
  workflow?: Workflow;
@@ -713,7 +744,7 @@ declare type PushLogsParams = {
713
744
  };
714
745
  };
715
746
 
716
- export { registerModule }
747
+ export declare function registerModule<TModuleProps = unknown, TModulesConfig = unknown>(name: string, ModuleClass: ModuleClass<TModuleProps, TModulesConfig>): void;
717
748
 
718
749
  declare type SessionData = {
719
750
  id: string;
@@ -769,19 +800,11 @@ declare type SessionPropertiesItem = {
769
800
  object?: unknown;
770
801
  };
771
802
 
772
- export declare enum SocketError {
773
- UNKNOWN = 0,
774
- SESSION_NOT_FOUND_OR_ACCESS_DENIED = 1,
775
- INVALID_MESSAGE_FORMAT = 2,
776
- UNSUPPORTED_COMMAND = 3
777
- }
778
-
779
803
  declare type StartConfig = {
780
804
  host?: string;
781
805
  isSecure?: boolean;
782
806
  apiKey?: string;
783
807
  port?: number;
784
- httpTimeoutMs?: number;
785
808
  };
786
809
 
787
810
  export declare type StartLoginCompletion = string | BaseLoginError;
@@ -828,7 +851,6 @@ declare type Workflow = {
828
851
  id: string;
829
852
  logging?: WorkflowLogging | null;
830
853
  steps: Array<WorkflowStep>;
831
- stepTemplateIds?: string[];
832
854
  client: WorkflowClient;
833
855
  trackLocation?: boolean;
834
856
  error?: string | null;
@@ -883,7 +905,6 @@ declare class WorkflowModel implements Workflow {
883
905
  id: string;
884
906
  steps: WorkflowStepModel[];
885
907
  client: WorkflowClientModel;
886
- stepTemplateIds?: string[];
887
908
  name?: string;
888
909
  logging?: WorkflowLoggingModel | null;
889
910
  error?: string | null;
@@ -944,25 +965,3 @@ declare class WorkflowStepModel implements WorkflowStep {
944
965
  }
945
966
 
946
967
  export { }
947
-
948
-
949
-
950
- declare global {
951
- const VERSION: string;
952
- const ENV: string;
953
-
954
- interface Window {
955
- RegulaIdvService: IdvFetchService;
956
- allowedCameras: InputDeviceInfo[];
957
- }
958
-
959
- declare namespace preact.JSX {
960
- interface IntrinsicElements {
961
- 'face-liveness': IFaceLiveness;
962
- 'document-reader': IDocumentReader;
963
- 'idv-flow': any;
964
- 'idv-document': any;
965
- 'idv-face': any;
966
- }
967
- }
968
- }