@regulaforensics/idv-capture-web 3.6.417-nightly → 3.6.419-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
@@ -165,7 +165,8 @@ declare type ConnectionConfigCore = {
165
165
 
166
166
  export declare enum ConnectionError {
167
167
  HTTP_ISSUE = 0,
168
- PROVIDER_ERROR = 1
168
+ PROVIDER_ERROR = 1,
169
+ DECODING_FAILED = 2
169
170
  }
170
171
 
171
172
  declare type ContinueSessionResults = SessionData | WorkflowResult | {
@@ -276,13 +277,29 @@ declare type IdvBusinessLogicControllerProps = {
276
277
  _pushStep: (stepId: string, data: Record<string, any>, type?: PerformType) => Promise<{
277
278
  error?: BaseWorkflowError;
278
279
  }>;
279
- _waitingForNextStep: () => Promise<{
280
+ waitForStartSession: (params: {
281
+ workflowId: string;
282
+ locale: string;
283
+ metadata?: Record<string, unknown>;
284
+ location?: GeoCoords | null;
285
+ }) => Promise<{
280
286
  sessionData: SessionModel;
281
287
  error?: undefined;
282
288
  } | {
289
+ sessionData?: undefined;
283
290
  error: BaseWorkflowError;
291
+ }>;
292
+ waitForContinueSession: (params: {
293
+ sessionId: string;
294
+ locale: string;
295
+ }) => Promise<{
296
+ sessionData: SessionModel;
297
+ error?: undefined;
298
+ } | {
284
299
  sessionData?: undefined;
300
+ error: BaseWorkflowError;
285
301
  }>;
302
+ _waitForNextStep: () => Promise<void>;
286
303
  _stepSocketListenerWhenStepIsRunning: (isStepRunning: boolean) => void;
287
304
  _getSessionStateNextStepConditionResult: () => Promise<DataOrError<SessionModel>>;
288
305
  _findStepById: (stepId: string) => WorkflowStep | null;
@@ -293,7 +310,7 @@ declare type IdvBusinessLogicControllerProps = {
293
310
  nextStepId: string;
294
311
  locale?: string;
295
312
  }) => Promise<void>;
296
- prepareScreenConfigAndShowStep: (stepId: string | null) => Promise<void>;
313
+ _prepareScreenConfigAndShowStep: (stepId: string | null) => Promise<void>;
297
314
  deinitializationIdv: () => Promise<{
298
315
  error?: any;
299
316
  }>;
@@ -304,6 +321,10 @@ declare type IdvBusinessLogicControllerProps = {
304
321
  setFinalStepAndStopProcess: (stepId?: string) => void;
305
322
  resetSession: () => void;
306
323
  resetFetchService: () => void;
324
+ _decodeMessageFromWebSocket: (eventData: MessageEvent['data']) => WebSocketDecodedSessionMessage | null;
325
+ _validateSession: (session?: SessionData) => SessionModel | {
326
+ validationErrorMessage: string;
327
+ };
307
328
  };
308
329
 
309
330
  export declare type IdvEventTypes = (typeof IdvEventTypesEnum)[keyof typeof IdvEventTypesEnum];
@@ -316,14 +337,11 @@ export declare const IdvEventTypesEnum: {
316
337
  declare class IdvFetchService {
317
338
  private _connectionTokenExpirationBufferMs;
318
339
  private _origin;
319
- private _workflowId;
320
- private _session;
321
340
  private _apiKeyAuthToken;
322
341
  private _connectionToken;
323
342
  private _connect;
324
343
  private abortController;
325
344
  constructor();
326
- private _getErrorTextFromError;
327
345
  private _setApiKeyAuthToken;
328
346
  private _setConnectionToken;
329
347
  private _getOriginFromConfig;
@@ -389,7 +407,10 @@ declare class IdvFetchService {
389
407
  code: FetchResultCode.SUCCESS;
390
408
  data: SessionData;
391
409
  } | FetchErrorResult>;
392
- continueSession(sessionId: string, locale: string): Promise<{
410
+ continueSession({ sessionId, locale, }: {
411
+ sessionId: string;
412
+ locale: string;
413
+ }): Promise<{
393
414
  code: FetchResultCode.SUCCESS;
394
415
  data: SessionData;
395
416
  } | FetchErrorResult>;
@@ -403,19 +424,24 @@ declare class IdvFetchService {
403
424
  items: Workflow[];
404
425
  };
405
426
  } | FetchErrorResult>;
406
- getWorkflow(workflowId: string, sessionIdFromUrl?: string | null): Promise<{
427
+ getWorkflow(workflowId: string, sessionIdFromUrl?: string | null, locale?: string): Promise<{
407
428
  code: FetchResultCode.SUCCESS;
408
429
  data: Workflow;
409
430
  } | FetchErrorResult>;
410
- pushData(stepId: string, data: any, type?: PerformType): Promise<{
431
+ pushData({ sessionId, stepId, data, type, }: {
432
+ sessionId: string;
433
+ stepId: string;
434
+ data: any;
435
+ type?: PerformType;
436
+ }): Promise<{
411
437
  code: FetchResultCode.SUCCESS;
412
438
  data: Record<string, unknown>;
413
439
  } | FetchErrorResult>;
414
- getSessionState(): Promise<{
440
+ getSessionState(sessionId: string, locale?: string): Promise<{
415
441
  code: FetchResultCode.SUCCESS;
416
442
  data: SessionData;
417
443
  } | FetchErrorResult>;
418
- pushLogs(pushLogsParams: PushLogsParams): Promise<Record<string, unknown>>;
444
+ pushLogs(sessionId: string, pushLogsParams: PushLogsParams): Promise<Record<string, unknown>>;
419
445
  private _postStartUpload;
420
446
  private _postFileChunk;
421
447
  private _uploadFileInChunks;
@@ -434,8 +460,7 @@ declare type IdvIntegrationControllerProps = {
434
460
  _initializationInProgress: boolean;
435
461
  _sessionIdFromUrl: null | string;
436
462
  _ttl: number;
437
- _continueSession: (locale: string, forceSessionId: string | null) => Promise<ContinueSessionResults>;
438
- _checkAndSetApiTokenToLs: (sessionId: string) => void;
463
+ _continueSession: (locale: string) => Promise<ContinueSessionResults>;
439
464
  _runSocketConnection: (token: string) => Promise<{
440
465
  error?: BaseWorkflowError;
441
466
  }>;
@@ -533,10 +558,13 @@ declare type IdvStoreProps = {
533
558
  currentSessionData: {
534
559
  sessionId: string;
535
560
  workflowId: string;
561
+ locale?: string;
536
562
  } | null;
537
563
  setCurrentSessionDataLsAndStore: (data: {
564
+ isApiKeyConnection: boolean;
538
565
  sessionId: string;
539
566
  workflowId: string;
567
+ locale?: string;
540
568
  }) => void;
541
569
  removeCurrentSessionDataLsAndStore: () => void;
542
570
  getCurrentSessionDataLs: () => {
@@ -560,7 +588,7 @@ declare type IdvStoreProps = {
560
588
  currentScreenConfig: CurrentScreenConfig | null;
561
589
  externalModules: LoadedModule[] | [];
562
590
  serviceToken?: string;
563
- apiKeyAuthTokenCollection: AuthTokenStoreData | Record<string, unknown>;
591
+ apiKeyAuthTokenCollection: Partial<AuthTokenStoreData>;
564
592
  setApiKeyAuthTokenCollection: (apiKey: string, authToken: string, tokenExpiresAt: number) => void;
565
593
  setServiceSessionToken: (token: string) => void;
566
594
  resetProps: () => void;
@@ -704,7 +732,7 @@ declare class SessionModel implements SessionData {
704
732
  deviceMetadata?: Record<string, unknown>;
705
733
  metadata?: Record<string, unknown>;
706
734
  static isSessionModel(value: unknown): value is SessionModel;
707
- static fromPlain: (input: SessionData) => SessionModel | {
735
+ static fromPlain: (input?: SessionData) => SessionModel | {
708
736
  validationErrorMessage: string;
709
737
  };
710
738
  }
@@ -761,6 +789,17 @@ declare enum TokenInitializeError {
761
789
  WORKFLOW_ISSUE = 1
762
790
  }
763
791
 
792
+ declare type WebSocketDecodedSessionMessage = {
793
+ eventType: string;
794
+ options?: {
795
+ session?: SessionData;
796
+ };
797
+ error?: {
798
+ code: number;
799
+ message: string;
800
+ };
801
+ };
802
+
764
803
  declare type Workflow = {
765
804
  id: string;
766
805
  logging?: WorkflowLogging | null;