@incodetech/welcome 1.77.2 → 1.78.0-20250120144126.0

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.
@@ -20,6 +20,7 @@ export declare const getImagesFromFile: (file: File) => Promise<{
20
20
  imageBase64: string;
21
21
  fullImage: File;
22
22
  }>;
23
+ export declare const rotateCanvasVertically: (canvas: HTMLCanvasElement) => void;
23
24
  export declare const getBase64: (file: File) => Promise<string>;
24
25
  export declare const getScaledBase64: (file: File, targetWidth?: number, shouldBeVertical?: boolean) => Promise<string>;
25
26
  export declare const getScaledImageFromFile: (file: File, targetWidth?: number, shouldBeVertical?: boolean) => Promise<{
@@ -1,5 +1,5 @@
1
1
  export default CameraPaperStatement;
2
- declare function CameraPaperStatement({ onSuccess, permission, setPermission, permissionMessage, permissionBackgroundColor, onLog, token, onError, numberOfTries, timeout, hideRetake, }: {
2
+ declare function CameraPaperStatement({ onSuccess, permission, setPermission, permissionMessage, permissionBackgroundColor, onLog, token, onError, numberOfTries, timeout, hideRetake, documentType, }: {
3
3
  onSuccess: any;
4
4
  permission: any;
5
5
  setPermission: any;
@@ -11,4 +11,5 @@ declare function CameraPaperStatement({ onSuccess, permission, setPermission, pe
11
11
  numberOfTries: any;
12
12
  timeout?: number;
13
13
  hideRetake: any;
14
+ documentType: any;
14
15
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const _default: import("react").ComponentType<import("opentok-react-incode").PreloadScriptProps>;
2
3
  export default _default;
@@ -1,7 +1,9 @@
1
- export default Mask;
2
- declare function Mask({ type, showIDOverlay, isKiosk, ...props }: {
1
+ declare const _default: import("react").MemoExoticComponent<typeof Mask>;
2
+ export default _default;
3
+ declare function Mask({ type, showIDOverlay, isKiosk, orientation, ...props }: {
3
4
  [x: string]: any;
4
5
  type: any;
5
6
  showIDOverlay: any;
6
7
  isKiosk?: boolean;
8
+ orientation: any;
7
9
  }): import("react/jsx-runtime").JSX.Element;
@@ -27,6 +27,7 @@ export type WebcamProps = {
27
27
  type?: 'BackId' | 'FrontId' | 'Passport' | 'fiscalQR' | 'linkTicket' | 'login' | 'loginDesktop' | 'additionalId' | 'selfie' | 'desktopSelfie';
28
28
  isRecordingEnabled?: boolean;
29
29
  isKiosk?: boolean;
30
+ flipVerticallyImage?: boolean;
30
31
  };
31
32
  export type UpdateCanvas = (options: {
32
33
  width?: number;
@@ -2,5 +2,9 @@ type GenerateSessionRecordingUploadUrlProps = {
2
2
  token: string;
3
3
  type: 'frontId' | 'backId' | 'selfie';
4
4
  };
5
- declare function generateSessionRecordingUploadUrl({ token, type, }: GenerateSessionRecordingUploadUrlProps): Promise<any>;
5
+ type GenerateSessionRecordingUploadUrlResponse = {
6
+ recordingId: string;
7
+ url: string;
8
+ };
9
+ declare function generateSessionRecordingUploadUrl({ token, type, }: GenerateSessionRecordingUploadUrlProps): Promise<GenerateSessionRecordingUploadUrlResponse>;
6
10
  export default generateSessionRecordingUploadUrl;
@@ -0,0 +1,5 @@
1
+ import type { Session } from '../../../types/src';
2
+ export declare const uploadDeepsightVideo: (video: Blob, token: Session['token']) => Promise<{
3
+ recordingId: string;
4
+ }>;
5
+ export default uploadDeepsightVideo;
@@ -0,0 +1,8 @@
1
+ type UseMediaRecorderLocallyReturn = {
2
+ isRecording: boolean;
3
+ startRecording: (stream: MediaStream) => void;
4
+ stopRecording: () => Promise<Blob | null>;
5
+ error: string | null;
6
+ };
7
+ export declare const useMediaRecorderLocally: () => UseMediaRecorderLocallyReturn;
8
+ export {};
@@ -5,13 +5,13 @@ type CaptureParams = {
5
5
  type: 'front' | 'back' | 'selfie';
6
6
  token: string;
7
7
  image: string | Blob;
8
- onProgress: (...props: unknown[]) => void;
9
- sendBase64: boolean;
10
- isRetry: boolean;
11
- isSecondId: boolean;
12
- onlyFront: boolean;
13
- encrypted: boolean;
14
- imageType: string;
8
+ onProgress?: (...props: unknown[]) => void;
9
+ sendBase64?: boolean;
10
+ isRetry?: boolean;
11
+ isSecondId?: boolean;
12
+ onlyFront?: boolean;
13
+ encrypted?: boolean;
14
+ imageType?: string;
15
15
  faceCoordinates?: unknown;
16
16
  glare?: number;
17
17
  sharpness?: number;
@@ -19,6 +19,7 @@ type CaptureParams = {
19
19
  shouldSkipGlareFront?: boolean;
20
20
  captureType?: string;
21
21
  shouldAddGlare?: boolean;
22
+ recordingId?: string;
22
23
  };
23
24
  declare function capture({ type, ...props }: CaptureParams): Promise<any>;
24
25
  export default capture;
@@ -329,7 +329,12 @@ declare function create({ apiKey, apiURL, lang, encrypt, translations, theme: _t
329
329
  darkMode: boolean;
330
330
  getSecondIdImages: typeof getSecondIdImages;
331
331
  getSecondIdImagesV2: typeof getSecondIdImagesV2;
332
- enableDeviceRiskModule: (token: string, isSandbox?: boolean) => Promise<unknown>;
332
+ enableDeviceRiskModule: ({ token, isSandbox, interviewId, sardineRiskClientId, }: {
333
+ token: string;
334
+ interviewId: string;
335
+ sardineRiskClientId: string;
336
+ isSandbox?: boolean;
337
+ }) => Promise<any>;
333
338
  addBankInfo: ({ token, bankData, }: {
334
339
  token: string;
335
340
  bankData: import("./addBankInfo").BankData;
@@ -5,9 +5,12 @@ declare abstract class IdDetectorBase {
5
5
  protected pipelineProfile: PipelineProfile | null;
6
6
  protected currentCanvas: IncodeCanvas | null;
7
7
  abstract getOnCapturing(onCapturing: any): any;
8
+ abstract getOnCapture(onCapture: any): any;
9
+ abstract getOnBestFrame(): any;
8
10
  abstract detect(canvas: IncodeCanvas): Promise<void>;
9
- initialize({ onCapturing, onFarAway, onGlare, onBlur, onIDNotDetected, onMaskChange, onDetectionStarted, onSwitchToManualCapture, onIDTypeChange, onIDSideChange, idType, isFixedMask, isBlurCheckEnabled, isGlareCheckEnabled, pipelineProfile, idDetectedTimeout, autocaptureTimeout, }: {
11
+ initialize({ onCapturing, onFarAway, onGlare, onBlur, onIDNotDetected, onMaskChange, onDetectionStarted, onSwitchToManualCapture, onIDTypeChange, onIDSideChange, idType, isFixedMask, isBlurCheckEnabled, isGlareCheckEnabled, pipelineProfile, onCapture, idDetectedTimeout, autocaptureTimeout, }: {
10
12
  onCapturing: any;
13
+ onCapture: any;
11
14
  onFarAway: any;
12
15
  onGlare: any;
13
16
  onBlur: any;
@@ -28,12 +31,18 @@ declare abstract class IdDetectorBase {
28
31
  protected detectCommon(canvas: IncodeCanvas, pipelineType: WasmPipelineType): Promise<void>;
29
32
  }
30
33
  export declare class IdCapture extends IdDetectorBase {
34
+ private bestCanvas;
35
+ private qualityElements;
36
+ getOnBestFrame(): any;
37
+ getOnCapture(onCapture: any): any;
31
38
  getOnCapturing(onCapturing: any): any;
32
39
  detect(canvas: IncodeCanvas): Promise<void>;
33
40
  }
34
41
  export declare class IdVideoSelfie extends IdDetectorBase {
35
42
  private currentMode;
36
43
  getOnCapturing(onCapturing: any): any;
44
+ getOnCapture(_onCapture: any): any;
45
+ getOnBestFrame(): any;
37
46
  detect(canvas: IncodeCanvas): Promise<void>;
38
47
  updateCurrentMode(mode: string): void;
39
48
  }
@@ -0,0 +1,20 @@
1
+ import { IncodeCanvas } from '../camera/IncodeCanvas';
2
+ export type DetectionState = 'detecting' | 'capturing' | 'farAway' | 'glare' | 'blur' | 'idNotDetected' | 'manualCapture';
3
+ type IdSide = 'front' | 'back' | 'unknown' | '';
4
+ declare const useIdDetection: ({ getCanvas }: {
5
+ getCanvas: () => IncodeCanvas;
6
+ }) => {
7
+ startDetection: () => void;
8
+ detectionState: DetectionState;
9
+ idType: string;
10
+ idSide: IdSide;
11
+ shouldShowIdHint: boolean;
12
+ isCapturing: boolean;
13
+ isFarAway: boolean;
14
+ isGlare: boolean;
15
+ isBlur: boolean;
16
+ isManualCapture: boolean;
17
+ isWrongSide: boolean;
18
+ isIdle: boolean;
19
+ };
20
+ export default useIdDetection;
@@ -1,7 +1,7 @@
1
1
  import { FC } from 'react';
2
2
  type DocumentSelectorProps = {
3
3
  goNext: () => void;
4
- onSourceChange: (source: Event) => void;
4
+ onSourceChange: (source: 'front' | 'passport') => void;
5
5
  };
6
6
  declare const DocumentSelector: FC<DocumentSelectorProps>;
7
7
  export default DocumentSelector;
@@ -1,11 +1,7 @@
1
1
  import type { LooseSession } from '../../../types/src';
2
- type RenderQrProps = {
2
+ type RenderFiscalQrProps = {
3
3
  onSuccess: () => void;
4
4
  session: LooseSession;
5
- url?: string;
6
- primaryColor?: string;
7
- secondaryColor?: string;
8
- sizePx?: number;
9
5
  };
10
- declare function renderFiscalQr(element: Element, { onSuccess, session, url, primaryColor, secondaryColor, sizePx, }: RenderQrProps): void;
6
+ declare function renderFiscalQr(element: Element, { onSuccess, session }: RenderFiscalQrProps): void;
11
7
  export default renderFiscalQr;
@@ -1,4 +1,5 @@
1
- export default function getRandomQuestions({ token, numberOfQuestions }: {
1
+ export default function getRandomQuestions({ token, numberOfQuestions, returnVoiceConsentQuestion, }: {
2
2
  token: any;
3
3
  numberOfQuestions?: number;
4
+ returnVoiceConsentQuestion?: boolean;
4
5
  }): Promise<any>;
@@ -96,3 +96,4 @@ export { default as renderRetrySteps } from './retries/renderRetrySteps';
96
96
  export { default as renderFiscarQr } from './fiscalQr/renderFiscalQr';
97
97
  export { renderVideoSelfie } from './recorder/renderVideoSelfie';
98
98
  export { initializeDetection } from './setup';
99
+ export { default as useIdDetection } from './detection/useIdDetection';
@@ -45,9 +45,10 @@ export type RenderCameraProps = {
45
45
  publishAudio?: boolean;
46
46
  zoomLevel?: number;
47
47
  idDetectedTimeout?: number;
48
+ flipVerticallyImage?: boolean;
48
49
  };
49
50
  export declare function App(props: any): import("react/jsx-runtime").JSX.Element;
50
- declare function renderCamera(type: string, element: Element, { onSuccess, onError, numberOfTries, onLog, permissionMessage, permissionBackgroundColor, token, timeout, sendBase64, documentType, showPreview, stream, nativeCamera, hideRetake, showTutorial, showPaperDLTutorial, onlyCapture, scanPdf417, videoTutorialSrc, showCustomCameraPermissionScreen, isSecondId, fullScreen, assistedOnboarding, isRecordingEnabled, onRestartOnboarding, showDoublePermissionsRequest, onlyAllowCapture, disableFullScreen, onStreamReady, showAutoCaptureIDOverlay, showManualCaptureIDOverlay, skipProcessFace, defaultHorizontalMask, isFixedMask, blurrinessStrictMode, isKiosk, ageAssurance, publishAudio, zoomLevel, idDetectedTimeout, }: RenderCameraProps): {
51
+ declare function renderCamera(type: string, element: Element, { onSuccess, onError, numberOfTries, onLog, permissionMessage, permissionBackgroundColor, token, timeout, sendBase64, documentType, showPreview, stream, nativeCamera, hideRetake, showTutorial, showPaperDLTutorial, onlyCapture, scanPdf417, videoTutorialSrc, showCustomCameraPermissionScreen, isSecondId, fullScreen, assistedOnboarding, isRecordingEnabled, onRestartOnboarding, showDoublePermissionsRequest, onlyAllowCapture, disableFullScreen, onStreamReady, showAutoCaptureIDOverlay, showManualCaptureIDOverlay, skipProcessFace, defaultHorizontalMask, isFixedMask, blurrinessStrictMode, isKiosk, ageAssurance, publishAudio, zoomLevel, idDetectedTimeout, flipVerticallyImage, }: RenderCameraProps): {
51
52
  close: (...props: unknown[]) => void;
52
53
  };
53
54
  export default renderCamera;
@@ -1,9 +1,9 @@
1
1
  import type { LooseSession } from '../../../types/src';
2
- declare global {
3
- interface Window {
4
- _Sardine: {
5
- createContext: (options: any) => any;
6
- };
7
- }
8
- }
9
- export declare const enableDeviceRiskModule: (token: LooseSession['token'], isSandbox?: boolean) => Promise<unknown>;
2
+ type EnableDeviceRiskModuleParams = {
3
+ token: LooseSession['token'];
4
+ interviewId: string;
5
+ sardineRiskClientId: string;
6
+ isSandbox?: boolean;
7
+ };
8
+ export declare const enableDeviceRiskModule: ({ token, isSandbox, interviewId, sardineRiskClientId, }: EnableDeviceRiskModuleParams) => Promise<any>;
9
+ export {};
@@ -1,4 +1,4 @@
1
- declare const FEATURE_FLAGS: readonly ["id_text_barcode_readability"];
1
+ declare const FEATURE_FLAGS: readonly ["id_text_barcode_readability", "selfie_local_lenses_check_web"];
2
2
  type FeatureFlag = (typeof FEATURE_FLAGS)[number];
3
3
  type FeatureFlags = {
4
4
  [key in FeatureFlag]: boolean;
@@ -11,5 +11,5 @@ interface InitializationParams {
11
11
  profiles: Map<DetectionType, PipelineProfile>;
12
12
  wasmVersion: string;
13
13
  }
14
- export declare function getInitializationParams(enableABForSelfie: boolean): InitializationParams;
14
+ export declare function getInitializationParams(): InitializationParams;
15
15
  export {};
@@ -116,8 +116,8 @@ declare class MlWasmJSApi {
116
116
  setFaceAttributesEnabled(type: WasmPipelineType, isLensesCheckEnabled: boolean, isMaskCheckEnabled: boolean, isClosedEyesCheckEnabled: boolean, isHeadWearCheckEnabled: boolean): Promise<void>;
117
117
  setFaceDetectionMode(type: WasmPipelineType, isVideoSelfie: boolean): Promise<void>;
118
118
  setFaceDetectionCallbacks(type: WasmPipelineType, onFarAway: Function, onTooClose: Function, onTooManyFaces: Function, onNoFace: Function, onCapture: Function, onCapturing: Function, onCenterFace: Function, onDark: Function, onBlur: Function, onFaceAngle: Function, onBestShot: Function, onLenses: Function, onMask: Function, onEyesClosed: Function, onHeadWear: Function, onSwitchToManualCapture: Function): Promise<void>;
119
- setIdCaptureThresholds(type: WasmPipelineType, blurThreshold: number, blurChangeThreshold: number, glareThreshold: number, clsThreshold: number, idDetectedTimeout: number, autocaptureTimeout: number): Promise<void>;
120
- setIdCaptureCallbacks(type: WasmPipelineType, onFarAway: Function, onDetectionStarted: Function, onMaskChange: Function, onBlur: Function, onGlare: Function, onCapturing: Function, onIDNotDetected: Function, onSwitchToManualCapture: Function, onIDTypeChange: Function, onIDSideChange: Function): Promise<void>;
119
+ setIdCaptureThresholds(type: WasmPipelineType, blurThreshold: number, blurChangeThreshold: number, glareThreshold: number, clsThreshold: number, idDetectedTimeout: number, autocaptureTimeout: number, framesAggregationInterval: number): Promise<void>;
120
+ setIdCaptureCallbacks(type: WasmPipelineType, onFarAway: Function, onDetectionStarted: Function, onMaskChange: Function, onBlur: Function, onGlare: Function, onCapturing: Function, onCapture: Function, onBestFrame: Function, onIDNotDetected: Function, onSwitchToManualCapture: Function, onIDTypeChange: Function, onIDSideChange: Function): Promise<void>;
121
121
  setIdCaptureGeometryParams(type: WasmPipelineType, areaDown: number, areaUp: number, areaIOSPassportUp: number, areaIOSPassportDown: number, widthIOSUp: number, widthIOSDown: number, widthDown: number, widthUp: number, windowOuterWidth: number, windowOuterHeight: number, windowInnerWidth: number, windowInnerHeight: number): Promise<void>;
122
122
  setIdCaptureConfigParams(type: WasmPipelineType, isFixedMask: boolean, isIPhone14OrHigher: boolean, idType: string, isBlurCheckEnabled: boolean, isGlareCheckEnabled: boolean): Promise<void>;
123
123
  setIdCaptureModelType(pipelineType: WasmPipelineType, modelType: IdCaptureModelType): void;