@privateid/ultrapass-web-sdk 1.7.0 → 2.0.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.
Files changed (115) hide show
  1. package/dist/application/modules/core/document/DocumentService.js +16 -31
  2. package/dist/application/modules/core/document/DocumentService.js.map +1 -1
  3. package/dist/application/modules/core/document/document.types.d.ts +151 -0
  4. package/dist/application/modules/core/document/document.utils.d.ts +23 -1
  5. package/dist/application/modules/core/document/document.utils.js +123 -20
  6. package/dist/application/modules/core/document/document.utils.js.map +1 -1
  7. package/dist/application/modules/core/face/FaceService.d.ts +1 -2
  8. package/dist/application/modules/core/face/FaceService.js +11 -23
  9. package/dist/application/modules/core/face/FaceService.js.map +1 -1
  10. package/dist/application/modules/core/face/face.types.d.ts +104 -2
  11. package/dist/application/modules/core/face/face.types.js.map +1 -1
  12. package/dist/application/modules/core/face/face.utils.d.ts +14 -0
  13. package/dist/application/modules/core/face/face.utils.js +86 -2
  14. package/dist/application/modules/core/face/face.utils.js.map +1 -1
  15. package/dist/application/modules/internal/feature-flag/LDFeatureFlagService.js +0 -1
  16. package/dist/application/modules/internal/feature-flag/LDFeatureFlagService.js.map +1 -1
  17. package/dist/application/modules/internal/shared/index.d.ts +1 -0
  18. package/dist/application/modules/internal/shared/index.js +1 -0
  19. package/dist/application/modules/internal/shared/index.js.map +1 -1
  20. package/dist/application/modules/internal/shared/shared.types.d.ts +21 -0
  21. package/dist/application/modules/internal/shared/shared.types.js +2 -0
  22. package/dist/application/modules/internal/shared/shared.types.js.map +1 -0
  23. package/dist/application/modules/internal/shared/shared.utils.d.ts +6 -0
  24. package/dist/application/modules/internal/shared/shared.utils.js +26 -3
  25. package/dist/application/modules/internal/shared/shared.utils.js.map +1 -1
  26. package/dist/application/modules/internal/wasm-orchestrator/WasmOrchestratorService.d.ts +0 -1
  27. package/dist/application/modules/internal/wasm-orchestrator/WasmOrchestratorService.js +87 -208
  28. package/dist/application/modules/internal/wasm-orchestrator/WasmOrchestratorService.js.map +1 -1
  29. package/dist/application/modules/internal/wasm-orchestrator/index.d.ts +1 -2
  30. package/dist/application/modules/internal/wasm-orchestrator/index.js +0 -2
  31. package/dist/application/modules/internal/wasm-orchestrator/index.js.map +1 -1
  32. package/dist/application/modules/internal/wasm-orchestrator/wasm-orchestrator.types.d.ts +7 -19
  33. package/dist/application/modules/internal/wasm-orchestrator/wasm-orchestrator.utils.d.ts +18 -0
  34. package/dist/application/modules/internal/wasm-orchestrator/wasm-orchestrator.utils.js +69 -10
  35. package/dist/application/modules/internal/wasm-orchestrator/wasm-orchestrator.utils.js.map +1 -1
  36. package/dist/application/modules/internal/wasm-orchestrator/wasm-orchestrator.utils.test.d.ts +1 -0
  37. package/dist/application/modules/internal/wasm-orchestrator/wasm-orchestrator.utils.test.js +218 -0
  38. package/dist/application/modules/internal/wasm-orchestrator/wasm-orchestrator.utils.test.js.map +1 -0
  39. package/dist/application/modules/support/camera/CameraServiceFactory.js +0 -1
  40. package/dist/application/modules/support/camera/CameraServiceFactory.js.map +1 -1
  41. package/dist/application/modules/support/camera/camera.types.d.ts +8 -3
  42. package/dist/application/modules/support/camera/camera.types.js +9 -5
  43. package/dist/application/modules/support/camera/camera.types.js.map +1 -1
  44. package/dist/application/modules/support/camera/camera.utils.js +0 -1
  45. package/dist/application/modules/support/camera/camera.utils.js.map +1 -1
  46. package/dist/application/modules/support/camera/index.d.ts +2 -1
  47. package/dist/application/modules/support/camera/index.js +1 -0
  48. package/dist/application/modules/support/camera/index.js.map +1 -1
  49. package/dist/application/modules/support/camera/services/BaseCameraService.js +0 -3
  50. package/dist/application/modules/support/camera/services/BaseCameraService.js.map +1 -1
  51. package/dist/application/modules/support/camera/services/DesktopCameraService.js +0 -1
  52. package/dist/application/modules/support/camera/services/DesktopCameraService.js.map +1 -1
  53. package/dist/application/modules/support/camera/services/FirefoxCameraService.js +0 -1
  54. package/dist/application/modules/support/camera/services/FirefoxCameraService.js.map +1 -1
  55. package/dist/application/modules/support/camera/services/MacSafariCameraService.js +0 -1
  56. package/dist/application/modules/support/camera/services/MacSafariCameraService.js.map +1 -1
  57. package/dist/application/modules/support/camera/services/MobileCameraService.js +1 -3
  58. package/dist/application/modules/support/camera/services/MobileCameraService.js.map +1 -1
  59. package/dist/application/modules/support/engine/EngineService.js +0 -2
  60. package/dist/application/modules/support/engine/EngineService.js.map +1 -1
  61. package/dist/application/modules/support/engine/engine.types.d.ts +2 -21
  62. package/dist/application/modules/support/engine/engine.utils.js +1 -3
  63. package/dist/application/modules/support/engine/engine.utils.js.map +1 -1
  64. package/dist/application/modules/support/engine/index.d.ts +1 -1
  65. package/dist/application/modules/support/permissions/PermissionsService.js +0 -2
  66. package/dist/application/modules/support/permissions/PermissionsService.js.map +1 -1
  67. package/dist/application/modules/support/permissions/index.js +0 -1
  68. package/dist/application/modules/support/permissions/index.js.map +1 -1
  69. package/dist/application/workers/wasm/WasmWorkerService.d.ts +14 -3
  70. package/dist/application/workers/wasm/WasmWorkerService.js +270 -206
  71. package/dist/application/workers/wasm/WasmWorkerService.js.map +1 -1
  72. package/dist/application/workers/wasm/wasm-worker.types.d.ts +19 -1
  73. package/dist/application/workers/wasm/wasm-worker.utils.d.ts +28 -1
  74. package/dist/application/workers/wasm/wasm-worker.utils.js +132 -22
  75. package/dist/application/workers/wasm/wasm-worker.utils.js.map +1 -1
  76. package/dist/application/workers/wasm/wasm-worker.utils.test.d.ts +1 -0
  77. package/dist/application/workers/wasm/wasm-worker.utils.test.js +123 -0
  78. package/dist/application/workers/wasm/wasm-worker.utils.test.js.map +1 -0
  79. package/dist/index.d.ts +46 -35
  80. package/dist/index.js +104 -77
  81. package/dist/index.js.map +1 -1
  82. package/package.json +19 -11
  83. package/wasm/ultra/manifest.json +3 -3
  84. package/workers/wasm-new.worker.js +1 -1
  85. package/workers/wasm-new.worker.js.map +3 -3
  86. package/dist/apiUtils.d.ts +0 -46
  87. package/dist/apiUtils.js +0 -923
  88. package/dist/apiUtils.js.map +0 -1
  89. package/dist/cameraUtils.d.ts +0 -77
  90. package/dist/cameraUtils.js +0 -362
  91. package/dist/cameraUtils.js.map +0 -1
  92. package/dist/constants.d.ts +0 -9
  93. package/dist/constants.js +0 -14
  94. package/dist/constants.js.map +0 -1
  95. package/dist/createCallback.d.ts +0 -57
  96. package/dist/createCallback.js +0 -336
  97. package/dist/createCallback.js.map +0 -1
  98. package/dist/dbUtils.d.ts +0 -14
  99. package/dist/dbUtils.js +0 -149
  100. package/dist/dbUtils.js.map +0 -1
  101. package/dist/envUtils.d.ts +0 -4
  102. package/dist/envUtils.js +0 -17
  103. package/dist/envUtils.js.map +0 -1
  104. package/dist/faceModule.d.ts +0 -233
  105. package/dist/faceModule.js +0 -1021
  106. package/dist/faceModule.js.map +0 -1
  107. package/dist/main.d.ts +0 -48
  108. package/dist/main.js +0 -111
  109. package/dist/main.js.map +0 -1
  110. package/dist/types.d.ts +0 -139
  111. package/dist/types.js +0 -78
  112. package/dist/types.js.map +0 -1
  113. package/dist/utils.d.ts +0 -90
  114. package/dist/utils.js +0 -587
  115. package/dist/utils.js.map +0 -1
@@ -1,233 +0,0 @@
1
- import { callbackTypeEnum } from './createCallback';
2
- import { CameraFaceMode } from './types';
3
- interface CameraOpenResult {
4
- stream: MediaStream | null;
5
- devices: MediaDeviceInfo[] | null;
6
- faceMode: CameraFaceMode | null;
7
- settings: MediaTrackSettings | null;
8
- status: boolean;
9
- errorMessage?: string | null;
10
- capabilities: MediaTrackCapabilities | null;
11
- }
12
- interface openCameraProps {
13
- videoElementId: string;
14
- deviceId?: string;
15
- requestFaceMode?: CameraFaceMode;
16
- canvasResolution?: {
17
- width: number;
18
- height: number;
19
- };
20
- isDocumentScan?: boolean;
21
- }
22
- export declare const openCamera: ({ videoElementId, deviceId, requestFaceMode, canvasResolution, isDocumentScan, }: openCameraProps) => Promise<CameraOpenResult>;
23
- /**
24
- * This function close camera, and clear all memories related to the camera.
25
- * @category Face
26
- * @param domElement id of the video tag
27
- * @deprecated This function is being replaced with cameraClose.
28
- */
29
- export declare const closeCamera: (element: string) => Promise<void>;
30
- interface openCameraProps {
31
- videoElementId: string;
32
- deviceId?: string;
33
- requestFaceMode?: CameraFaceMode;
34
- canvasResolution?: {
35
- width: number;
36
- height: number;
37
- };
38
- isDocumentScan?: boolean;
39
- }
40
- /**
41
- * This function switch camera from front to back on mobile, and to another device on desktop
42
- * @category Face
43
- * @param selectedCamera Selected camera either front or back
44
- * @param device Selected camera ID
45
- * @param canvasResolution
46
- * @deprecated This function is being replaced with cameraSwitch.
47
- */
48
- export declare const switchCamera: (selectedCamera: CameraFaceMode | null, device: string, canvasResolution?: {
49
- width: number;
50
- height: number;
51
- } | null) => Promise<{
52
- capabilities: MediaTrackCapabilities | null;
53
- settings: MediaTrackSettings | null;
54
- } | null>;
55
- interface enrollProps {
56
- callback: (result: any) => void;
57
- config?: any;
58
- element?: string;
59
- returnPortrait?: boolean;
60
- }
61
- export declare const getBaseConfigEnroll: () => {
62
- input_image_format: string;
63
- angle_rotation_left_threshold: number;
64
- angle_rotation_right_threshold: number;
65
- threshold_high_vertical_enroll: number;
66
- threshold_down_vertical_enroll: number;
67
- anti_spoofing_threshold: number;
68
- threshold_profile_enroll: number;
69
- blur_threshold_enroll_pred: number;
70
- threshold_user_too_close: number;
71
- threshold_user_too_far: number;
72
- allow_only_one_face: boolean;
73
- threshold_user_up: number;
74
- threshold_user_down: number;
75
- threshold_user_left: number;
76
- threshold_user_right: number;
77
- };
78
- /**
79
- * @deprecated This function is being replaced with faceEnroll.
80
- */
81
- export declare function enroll({ callback, config, element, returnPortrait }: enrollProps): Promise<ImageData | {
82
- result: number;
83
- imageData: Uint8ClampedArray;
84
- height: number;
85
- width: number;
86
- } | {
87
- result: string;
88
- }>;
89
- interface BaseProps {
90
- callback: (result: any) => void;
91
- config?: any;
92
- element?: string;
93
- returnPortrait?: boolean;
94
- }
95
- interface FaceLoginProps extends BaseProps {
96
- }
97
- interface PredictProps extends BaseProps {
98
- image?: ImageData;
99
- }
100
- /**
101
- * This function performs faceLogin, the camera should already be open. the functions performs the identification and return the result. This function is more restrictive than predict1Fa.
102
- * @category Face
103
- * @param callback Callbacks triggered on the `predict` operation
104
- * @param config Configuration recommeded default: { input_image_format: "rgba" }
105
- * @param element Element id of video tag. (Optional) By default it uses the element id used when opening the camera using openCamera()
106
- */
107
- interface FaceLoginProps {
108
- callback: (result: any) => void;
109
- config?: any;
110
- element?: string;
111
- returnPortrait?: boolean;
112
- }
113
- /**
114
- * @deprecated This function is being replaced with faceAgeEstimation.
115
- */
116
- export declare const estimateAge: (options: Parameters<typeof runUltraProcess>[1]) => Promise<any>;
117
- type PredictFunction = (images: ImageData[], isSimd: boolean, config: string, resultProxy: any) => Promise<any>;
118
- declare const runUltraProcess: (fn: PredictFunction, options: {
119
- callback: (result: any) => void;
120
- config?: any;
121
- element?: string;
122
- image?: ImageData;
123
- returnPortrait?: boolean;
124
- useExistingCanvas?: boolean;
125
- logMessage?: string;
126
- callbackType?: callbackTypeEnum;
127
- }) => Promise<any>;
128
- /**
129
- * @deprecated This function is being replaced with facePredict.
130
- */
131
- export declare const faceLogin: (props: FaceLoginProps) => Promise<any>;
132
- /**
133
- * @deprecated This function is being replaced with facePredict({ type: 'VERIFY' }).
134
- * This function performs predict, the camera should already be open. the functions performs the identification return the result then restart again.
135
- * @category Face
136
- * @param callback Callbacks triggered on the predict operation
137
- * @param config Configuration recommeded default: { input_image_format: "rgba" }
138
- * @param element Element id of video tag. (Optional) By default it uses the element id used when opening the camera using openCamera()
139
- * @param image ImageData, If there is an image passed, it will be predicting the image instead of the video feed.
140
- */
141
- export declare const predictVerify: (props: PredictProps) => Promise<any>;
142
- /**
143
- * @deprecated This function is being replaced with facePredict({ type: 'PREDICT' }).
144
- */
145
- export declare const predict: (props: PredictProps) => Promise<any>;
146
- /**
147
- * @deprecated This function is being replaced with facePredict({ type: 'PREDICT_STATUS' }).
148
- */
149
- export declare const predictWithStatus: (props: PredictProps) => Promise<any>;
150
- /**
151
- * @deprecated This function is being replaced with facePredict({ type: 'CONFIRM_USER' }).
152
- */
153
- export declare const predictConfirmUser: (props: PredictProps) => Promise<any>;
154
- /**
155
- * @deprecated This function is being replaced with facePredict({ type: 'ULTRA_VERIFY' }).
156
- */
157
- export declare const ultraVerify: (props: PredictProps) => Promise<any>;
158
- /**
159
- * @deprecated This function is being replaced with facePredict({ type: 'DELETE' }).
160
- */
161
- export declare const predictDeleteUser: (props: PredictProps) => Promise<any>;
162
- /**
163
- *
164
- * @deprecated This function is being replaced with engineEncryptData.
165
- */
166
- export declare const pkiEncryptData: (payload: any) => Promise<(string | null)[]>;
167
- /**
168
- * @deprecated This function is being replaced with engineCheckModelsAreLoaded.
169
- */
170
- export declare const checkIfModelsAreLoaded: (isEnroll: boolean) => Promise<number>;
171
- interface frontScanInterface {
172
- callback: (returnData: any) => void;
173
- config?: any;
174
- doOcr?: boolean;
175
- }
176
- /**
177
- * @deprecated This function is being replaced with documentScanGovernmentPhotoId.
178
- */
179
- export declare const scanFrontDocument: ({ callback, config }: frontScanInterface) => Promise<{
180
- result: string;
181
- } | {
182
- result: number;
183
- }>;
184
- /**
185
- * @deprecated This function is being replaced with documentScanPassport.
186
- */
187
- export declare const scanPassport: ({ callback, config }: frontScanInterface) => Promise<{
188
- result: string;
189
- } | {
190
- result: number;
191
- }>;
192
- interface backScanInterface {
193
- callback: (returnData: any) => void;
194
- image?: ImageData;
195
- config?: any;
196
- }
197
- /**
198
- * @deprecated This function is being replaced with documentScanBackGovernmentPhotoId.
199
- */
200
- export declare const scanBackDocument: ({ callback, image, config }: backScanInterface) => Promise<{
201
- result: string;
202
- } | {
203
- [x: string]: any;
204
- result?: undefined;
205
- } | {
206
- result: number;
207
- }>;
208
- /**
209
- * @deprecated This function is being replaced with compareImageEmbeddings.
210
- */
211
- export declare const compareEmbeddings: (embeddingsA: string, embeddingsB: string, config: {}, callback: (result: any) => void, encryptData?: boolean) => Promise<{
212
- result: number;
213
- imageData: Uint8ClampedArray;
214
- height: number;
215
- width: number;
216
- }>;
217
- interface documentOcrInterface {
218
- inputImage: string;
219
- callback: (returnData: any) => void;
220
- config?: any;
221
- }
222
- /**
223
- * @deprecated This function is being replaced with documentExtractOCR.
224
- */
225
- export declare const documentOcr: ({ inputImage, callback, config }: documentOcrInterface) => Promise<{
226
- result: number;
227
- }>;
228
- /**
229
- *
230
- * @deprecated This function is being replaced with engineFreeMemory.
231
- */
232
- export declare const freeFrontScanMemory: () => Promise<boolean>;
233
- export {};