@privateid/ultrapass-web-sdk 1.2.0 → 1.3.1-1300478
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/README.md +75 -75
- package/dist/apiUtils.d.ts +46 -46
- package/dist/apiUtils.js +922 -921
- package/dist/apiUtils.js.map +1 -1
- package/dist/application/index.d.ts +7 -7
- package/dist/application/index.js +27 -25
- package/dist/application/index.js.map +1 -1
- package/dist/application/modules/core/document/DocumentService.d.ts +22 -22
- package/dist/application/modules/core/document/DocumentService.js +254 -254
- package/dist/application/modules/core/document/document.constants.d.ts +15 -15
- package/dist/application/modules/core/document/document.constants.js +21 -21
- package/dist/application/modules/core/document/document.domain.d.ts +7 -7
- package/dist/application/modules/core/document/document.domain.js +1 -1
- package/dist/application/modules/core/document/document.types.d.ts +17 -17
- package/dist/application/modules/core/document/document.types.js +1 -1
- package/dist/application/modules/core/document/document.utils.d.ts +3 -3
- package/dist/application/modules/core/document/document.utils.js +58 -58
- package/dist/application/modules/core/document/index.d.ts +3 -3
- package/dist/application/modules/core/document/index.js +1 -1
- package/dist/application/modules/core/face/FaceService.d.ts +33 -33
- package/dist/application/modules/core/face/FaceService.js +228 -221
- package/dist/application/modules/core/face/FaceService.js.map +1 -1
- package/dist/application/modules/core/face/face.constants.d.ts +53 -53
- package/dist/application/modules/core/face/face.constants.js +53 -53
- package/dist/application/modules/core/face/face.domain.d.ts +10 -10
- package/dist/application/modules/core/face/face.domain.js +1 -1
- package/dist/application/modules/core/face/face.types.d.ts +41 -38
- package/dist/application/modules/core/face/face.types.js +1 -1
- package/dist/application/modules/core/face/face.utils.d.ts +15 -15
- package/dist/application/modules/core/face/face.utils.js +101 -101
- package/dist/application/modules/core/face/index.d.ts +3 -3
- package/dist/application/modules/core/face/index.js +1 -1
- package/dist/application/modules/global/shared.constants.d.ts +2 -2
- package/dist/application/modules/global/shared.constants.js +2 -2
- package/dist/application/modules/global/shared.utils.d.ts +25 -25
- package/dist/application/modules/global/shared.utils.js +100 -100
- package/dist/application/modules/global/shared.utils.js.map +1 -1
- package/dist/application/modules/internal/feature-flag/LDFeatureFlagService.d.ts +9 -0
- package/dist/application/modules/internal/feature-flag/LDFeatureFlagService.js +32 -0
- package/dist/application/modules/internal/feature-flag/LDFeatureFlagService.js.map +1 -0
- package/dist/application/modules/internal/feature-flag/feature-flag-init.d.ts +11 -0
- package/dist/application/modules/internal/feature-flag/feature-flag-init.js +24 -0
- package/dist/application/modules/internal/feature-flag/feature-flag-init.js.map +1 -0
- package/dist/application/modules/internal/feature-flag/feature-flag.domain.d.ts +10 -0
- package/dist/application/modules/internal/feature-flag/feature-flag.domain.js +7 -0
- package/dist/application/modules/internal/feature-flag/feature-flag.domain.js.map +1 -0
- package/dist/application/modules/internal/feature-flag/featureFlagInit.d.ts +11 -0
- package/dist/application/modules/internal/feature-flag/featureFlagInit.js +44 -0
- package/dist/application/modules/internal/feature-flag/featureFlagInit.js.map +1 -0
- package/dist/application/modules/internal/feature-flag/index.d.ts +2 -0
- package/dist/application/modules/internal/feature-flag/index.js +3 -0
- package/dist/application/modules/internal/feature-flag/index.js.map +1 -0
- package/dist/application/modules/internal/shared/index.d.ts +2 -0
- package/dist/application/modules/internal/shared/index.js +3 -0
- package/dist/application/modules/internal/shared/index.js.map +1 -0
- package/dist/application/modules/internal/shared/shared.constants.d.ts +2 -0
- package/dist/application/modules/internal/shared/shared.constants.js +3 -0
- package/dist/application/modules/internal/shared/shared.constants.js.map +1 -0
- package/dist/application/modules/internal/shared/shared.utils.d.ts +44 -0
- package/dist/application/modules/internal/shared/shared.utils.js +204 -0
- package/dist/application/modules/internal/shared/shared.utils.js.map +1 -0
- package/dist/application/modules/internal/wasm-orchestrator/WasmOrchestratorService.d.ts +28 -0
- package/dist/application/modules/internal/wasm-orchestrator/WasmOrchestratorService.js +380 -0
- package/dist/application/modules/internal/wasm-orchestrator/WasmOrchestratorService.js.map +1 -0
- package/dist/application/modules/internal/wasm-orchestrator/index.d.ts +6 -0
- package/dist/application/modules/internal/wasm-orchestrator/index.js +9 -0
- package/dist/application/modules/internal/wasm-orchestrator/index.js.map +1 -0
- package/dist/application/modules/internal/wasm-orchestrator/wasm-orchestrator.constants.d.ts +28 -0
- package/dist/application/modules/internal/wasm-orchestrator/wasm-orchestrator.constants.js +35 -0
- package/dist/application/modules/internal/wasm-orchestrator/wasm-orchestrator.constants.js.map +1 -0
- package/dist/application/modules/internal/wasm-orchestrator/wasm-orchestrator.domain.d.ts +51 -0
- package/dist/application/modules/internal/wasm-orchestrator/wasm-orchestrator.domain.js +2 -0
- package/dist/application/modules/internal/wasm-orchestrator/wasm-orchestrator.domain.js.map +1 -0
- package/dist/application/modules/internal/wasm-orchestrator/wasm-orchestrator.types.d.ts +142 -0
- package/dist/application/modules/internal/wasm-orchestrator/wasm-orchestrator.types.js +2 -0
- package/dist/application/modules/internal/wasm-orchestrator/wasm-orchestrator.types.js.map +1 -0
- package/dist/application/modules/internal/wasm-orchestrator/wasm-orchestrator.utils.d.ts +86 -0
- package/dist/application/modules/internal/wasm-orchestrator/wasm-orchestrator.utils.js +201 -0
- package/dist/application/modules/internal/wasm-orchestrator/wasm-orchestrator.utils.js.map +1 -0
- package/dist/application/modules/support/camera/CameraServiceFactory.d.ts +10 -8
- package/dist/application/modules/support/camera/CameraServiceFactory.js +33 -32
- package/dist/application/modules/support/camera/CameraServiceFactory.js.map +1 -1
- package/dist/application/modules/support/camera/camera.constants.d.ts +9 -9
- package/dist/application/modules/support/camera/camera.constants.js +48 -48
- package/dist/application/modules/support/camera/camera.domain.d.ts +15 -15
- package/dist/application/modules/support/camera/camera.domain.js +1 -1
- package/dist/application/modules/support/camera/camera.types.d.ts +42 -42
- package/dist/application/modules/support/camera/camera.types.js +10 -10
- package/dist/application/modules/support/camera/camera.utils.d.ts +157 -157
- package/dist/application/modules/support/camera/camera.utils.js +623 -637
- package/dist/application/modules/support/camera/camera.utils.js.map +1 -1
- package/dist/application/modules/support/camera/index.d.ts +24 -25
- package/dist/application/modules/support/camera/index.js +27 -29
- package/dist/application/modules/support/camera/index.js.map +1 -1
- package/dist/application/modules/support/camera/services/BaseCameraService.d.ts +41 -37
- package/dist/application/modules/support/camera/services/BaseCameraService.js +278 -277
- package/dist/application/modules/support/camera/services/BaseCameraService.js.map +1 -1
- package/dist/application/modules/support/camera/services/DesktopCameraService.d.ts +5 -5
- package/dist/application/modules/support/camera/services/DesktopCameraService.js +46 -45
- package/dist/application/modules/support/camera/services/DesktopCameraService.js.map +1 -1
- package/dist/application/modules/support/camera/services/FirefoxCameraService.d.ts +5 -5
- package/dist/application/modules/support/camera/services/FirefoxCameraService.js +46 -45
- package/dist/application/modules/support/camera/services/FirefoxCameraService.js.map +1 -1
- package/dist/application/modules/support/camera/services/MacSafariCameraService.d.ts +5 -5
- package/dist/application/modules/support/camera/services/MacSafariCameraService.js +47 -46
- package/dist/application/modules/support/camera/services/MacSafariCameraService.js.map +1 -1
- package/dist/application/modules/support/camera/services/MobileCameraService.d.ts +5 -5
- package/dist/application/modules/support/camera/services/MobileCameraService.js +133 -129
- package/dist/application/modules/support/camera/services/MobileCameraService.js.map +1 -1
- package/dist/application/modules/support/engine/EngineService.d.ts +15 -0
- package/dist/application/modules/support/engine/EngineService.js +106 -0
- package/dist/application/modules/support/engine/EngineService.js.map +1 -0
- package/dist/application/modules/support/engine/engine.constants.d.ts +33 -0
- package/dist/application/modules/support/engine/engine.constants.js +35 -0
- package/dist/application/modules/support/engine/engine.constants.js.map +1 -0
- package/dist/application/modules/support/engine/engine.domain.d.ts +23 -0
- package/dist/application/modules/support/engine/engine.domain.js +2 -0
- package/dist/application/modules/support/engine/engine.domain.js.map +1 -0
- package/dist/application/modules/support/engine/engine.types.d.ts +32 -0
- package/dist/application/modules/support/engine/engine.types.js +2 -0
- package/dist/application/modules/support/engine/engine.types.js.map +1 -0
- package/dist/application/modules/support/engine/engine.utils.d.ts +65 -0
- package/dist/application/modules/support/engine/engine.utils.js +135 -0
- package/dist/application/modules/support/engine/engine.utils.js.map +1 -0
- package/dist/application/modules/support/engine/index.d.ts +3 -0
- package/dist/application/modules/support/engine/index.js +2 -0
- package/dist/application/modules/support/engine/index.js.map +1 -0
- package/dist/application/modules/support/permissions/PermissionsService.d.ts +55 -0
- package/dist/application/modules/support/permissions/PermissionsService.js +184 -0
- package/dist/application/modules/support/permissions/PermissionsService.js.map +1 -0
- package/dist/application/modules/support/permissions/index.d.ts +4 -0
- package/dist/application/modules/support/permissions/index.js +3 -0
- package/dist/application/modules/support/permissions/index.js.map +1 -0
- package/dist/application/modules/support/permissions/permission.utils.d.ts +6 -0
- package/dist/application/modules/support/permissions/permission.utils.js +34 -0
- package/dist/application/modules/support/permissions/permission.utils.js.map +1 -0
- package/dist/application/modules/support/permissions/permissions.domain.d.ts +6 -0
- package/dist/application/modules/support/permissions/permissions.domain.js +2 -0
- package/dist/application/modules/support/permissions/permissions.domain.js.map +1 -0
- package/dist/application/modules/support/permissions/permissions.types.d.ts +9 -0
- package/dist/application/modules/support/permissions/permissions.types.js +2 -0
- package/dist/application/modules/support/permissions/permissions.types.js.map +1 -0
- package/dist/application/modules/support/wasm/WasmService.d.ts +25 -25
- package/dist/application/modules/support/wasm/WasmService.js +156 -155
- package/dist/application/modules/support/wasm/WasmService.js.map +1 -1
- package/dist/application/modules/support/wasm/index.d.ts +6 -6
- package/dist/application/modules/support/wasm/index.js +8 -8
- package/dist/application/modules/support/wasm/wasm.constants.d.ts +78 -78
- package/dist/application/modules/support/wasm/wasm.constants.js +86 -86
- package/dist/application/modules/support/wasm/wasm.domain.d.ts +52 -52
- package/dist/application/modules/support/wasm/wasm.domain.js +1 -1
- package/dist/application/modules/support/wasm/wasm.types.d.ts +119 -118
- package/dist/application/modules/support/wasm/wasm.types.js +1 -1
- package/dist/application/modules/support/wasm/wasm.utils.d.ts +88 -88
- package/dist/application/modules/support/wasm/wasm.utils.js +243 -243
- package/dist/application/modules/support/wasm-orchestrator/WasmOrchestratorService.d.ts +28 -0
- package/dist/application/modules/support/wasm-orchestrator/WasmOrchestratorService.js +324 -0
- package/dist/application/modules/support/wasm-orchestrator/WasmOrchestratorService.js.map +1 -0
- package/dist/application/modules/support/wasm-orchestrator/index.d.ts +6 -0
- package/dist/application/modules/support/wasm-orchestrator/index.js +9 -0
- package/dist/application/modules/support/wasm-orchestrator/index.js.map +1 -0
- package/dist/application/modules/support/wasm-orchestrator/wasm-orchestrator.constants.d.ts +36 -0
- package/dist/application/modules/support/wasm-orchestrator/wasm-orchestrator.constants.js +44 -0
- package/dist/application/modules/support/wasm-orchestrator/wasm-orchestrator.constants.js.map +1 -0
- package/dist/application/modules/support/wasm-orchestrator/wasm-orchestrator.domain.d.ts +47 -0
- package/dist/application/modules/support/wasm-orchestrator/wasm-orchestrator.domain.js +2 -0
- package/dist/application/modules/support/wasm-orchestrator/wasm-orchestrator.domain.js.map +1 -0
- package/dist/application/modules/support/wasm-orchestrator/wasm-orchestrator.types.d.ts +136 -0
- package/dist/application/modules/support/wasm-orchestrator/wasm-orchestrator.types.js +2 -0
- package/dist/application/modules/support/wasm-orchestrator/wasm-orchestrator.types.js.map +1 -0
- package/dist/application/modules/support/wasm-orchestrator/wasm-orchestrator.utils.d.ts +91 -0
- package/dist/application/modules/support/wasm-orchestrator/wasm-orchestrator.utils.js +250 -0
- package/dist/application/modules/support/wasm-orchestrator/wasm-orchestrator.utils.js.map +1 -0
- package/dist/application/workers/index.d.ts +42 -42
- package/dist/application/workers/index.js +8 -8
- package/dist/application/workers/wasm/WasmWorkerService.d.ts +66 -0
- package/dist/application/workers/wasm/WasmWorkerService.js +801 -0
- package/dist/application/workers/wasm/WasmWorkerService.js.map +1 -0
- package/dist/application/workers/wasm/index.d.ts +4 -0
- package/dist/application/workers/wasm/index.js +9 -0
- package/dist/application/workers/wasm/index.js.map +1 -0
- package/dist/application/workers/wasm/wasm-worker.constants.d.ts +5 -0
- package/dist/application/workers/wasm/wasm-worker.constants.js +6 -0
- package/dist/application/workers/wasm/wasm-worker.constants.js.map +1 -0
- package/dist/application/workers/wasm/wasm-worker.domain.d.ts +99 -0
- package/dist/application/workers/wasm/wasm-worker.domain.js +2 -0
- package/dist/application/workers/wasm/wasm-worker.domain.js.map +1 -0
- package/dist/application/workers/wasm/wasm-worker.types.d.ts +88 -0
- package/dist/application/workers/wasm/wasm-worker.types.js +2 -0
- package/dist/application/workers/wasm/wasm-worker.types.js.map +1 -0
- package/dist/application/workers/wasm/wasm-worker.utils.d.ts +10 -0
- package/dist/application/workers/wasm/wasm-worker.utils.js +130 -0
- package/dist/application/workers/wasm/wasm-worker.utils.js.map +1 -0
- package/dist/buildConfig.d.ts +3 -0
- package/dist/buildConfig.js +7 -0
- package/dist/buildConfig.js.map +1 -0
- package/dist/cameraUtils.d.ts +77 -77
- package/dist/cameraUtils.js +361 -360
- package/dist/cameraUtils.js.map +1 -1
- package/dist/constants.d.ts +9 -9
- package/dist/constants.js +13 -12
- package/dist/constants.js.map +1 -1
- package/dist/createCallback.d.ts +56 -56
- package/dist/createCallback.js +332 -330
- package/dist/createCallback.js.map +1 -1
- package/dist/dbUtils.d.ts +14 -14
- package/dist/dbUtils.js +148 -147
- package/dist/dbUtils.js.map +1 -1
- package/dist/envUtils.d.ts +4 -4
- package/dist/envUtils.js +16 -15
- package/dist/envUtils.js.map +1 -1
- package/dist/faceModule.d.ts +196 -196
- package/dist/faceModule.js +978 -981
- package/dist/faceModule.js.map +1 -1
- package/dist/featureFlagInit.d.ts +11 -0
- package/dist/featureFlagInit.js +44 -0
- package/dist/featureFlagInit.js.map +1 -0
- package/dist/index.d.ts +38 -38
- package/dist/index.js +82 -82
- package/dist/main.d.ts +30 -13
- package/dist/main.js +84 -51
- package/dist/main.js.map +1 -1
- package/dist/types.d.ts +139 -139
- package/dist/types.js +77 -77
- package/dist/utils.d.ts +84 -84
- package/dist/utils.js +580 -579
- package/dist/utils.js.map +1 -1
- package/package.json +102 -102
- package/wasm/ultra/nosimd/{25.11.13-1357710 → 26.01.08-1300478}/privid_fhe_uber.js +18 -18
- package/wasm/ultra/nosimd/{25.11.13-1357710 → 26.01.08-1300478}/privid_fhe_uber.wasm +0 -0
- package/wasm/ultra/nosimd/version.json +2 -2
- package/wasm/ultra/simd/{25.11.13-1357710 → 26.01.08-1300478}/privid_fhe_uber.js +18 -18
- package/wasm/ultra/simd/{25.11.13-1357710 → 26.01.08-1300478}/privid_fhe_uber.wasm +0 -0
- package/wasm/ultra/simd/version.json +2 -2
- package/workers/comlink.min.js +7 -7
- package/workers/comlink.min.js.map +1 -1
- package/workers/wasm.worker.js +936 -924
package/dist/createCallback.js
CHANGED
|
@@ -1,331 +1,333 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
callbackTypeEnum["
|
|
6
|
-
callbackTypeEnum["
|
|
7
|
-
callbackTypeEnum["
|
|
8
|
-
callbackTypeEnum["
|
|
9
|
-
callbackTypeEnum["
|
|
10
|
-
callbackTypeEnum["
|
|
11
|
-
callbackTypeEnum["
|
|
12
|
-
callbackTypeEnum["
|
|
13
|
-
callbackTypeEnum["
|
|
14
|
-
callbackTypeEnum["
|
|
15
|
-
callbackTypeEnum["
|
|
16
|
-
callbackTypeEnum["
|
|
17
|
-
callbackTypeEnum["
|
|
18
|
-
callbackTypeEnum["
|
|
19
|
-
callbackTypeEnum["
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
printLogs(`[JS RESPONSE]:
|
|
26
|
-
printLogs(`[JS RESPONSE]:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
printLogs(`[JS RESPONSE]:
|
|
49
|
-
printLogs(`[JS RESPONSE]:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
printLogs(`[JS RESPONSE]:
|
|
77
|
-
printLogs(`[JS RESPONSE]:
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
printLogs(`[JS RESPONSE]:
|
|
108
|
-
printLogs(`[JS RESPONSE]:
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
printLogs(`[JS RESPONSE]:
|
|
136
|
-
printLogs(`[JS RESPONSE]:
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
printLogs(`[JS RESPONSE]:
|
|
161
|
-
printLogs(`[JS RESPONSE]:
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
const
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
printLogs(`[JS RESPONSE]:
|
|
179
|
-
printLogs(`[JS RESPONSE]:
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
const
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
printLogs(`[JS RESPONSE]:
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
printLogs(`[JS RESPONSE]:
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
printLogs(`[JS RESPONSE]:
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
printLogs(`[JS RESPONSE]:
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
case callbackTypeEnum.
|
|
304
|
-
return
|
|
305
|
-
case callbackTypeEnum.
|
|
306
|
-
return
|
|
307
|
-
case callbackTypeEnum.
|
|
308
|
-
return createCallbackPredict({ callback: callbackFunction });
|
|
309
|
-
case callbackTypeEnum.
|
|
310
|
-
return createCallbackPredict({ callback: callbackFunction });
|
|
311
|
-
case callbackTypeEnum.
|
|
312
|
-
return
|
|
313
|
-
case callbackTypeEnum.
|
|
314
|
-
return
|
|
315
|
-
case callbackTypeEnum.
|
|
316
|
-
return
|
|
317
|
-
case callbackTypeEnum.
|
|
318
|
-
return
|
|
319
|
-
case callbackTypeEnum.
|
|
320
|
-
return
|
|
321
|
-
case callbackTypeEnum.
|
|
322
|
-
return
|
|
323
|
-
case callbackTypeEnum.
|
|
324
|
-
return
|
|
325
|
-
case callbackTypeEnum.
|
|
326
|
-
return
|
|
327
|
-
|
|
328
|
-
return
|
|
329
|
-
|
|
330
|
-
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import { printLogs } from './utils';
|
|
3
|
+
export var callbackTypeEnum;
|
|
4
|
+
(function (callbackTypeEnum) {
|
|
5
|
+
callbackTypeEnum["isValid"] = "isValid";
|
|
6
|
+
callbackTypeEnum["predict"] = "predict";
|
|
7
|
+
callbackTypeEnum["enroll"] = "enroll";
|
|
8
|
+
callbackTypeEnum["frontScan"] = "frontScan";
|
|
9
|
+
callbackTypeEnum["passportScan"] = "passportScan";
|
|
10
|
+
callbackTypeEnum["documentScanNoFace"] = "documentScanNoFace";
|
|
11
|
+
callbackTypeEnum["backScan"] = "backScan";
|
|
12
|
+
callbackTypeEnum["faceLogin"] = "faceLogin";
|
|
13
|
+
callbackTypeEnum["faceISO"] = "faceISO";
|
|
14
|
+
callbackTypeEnum["delete"] = "delete";
|
|
15
|
+
callbackTypeEnum["documentOcr"] = "documentOcr";
|
|
16
|
+
callbackTypeEnum["continuousPredict"] = "continuousPredict";
|
|
17
|
+
callbackTypeEnum["ageEstimation"] = "ageEstimation";
|
|
18
|
+
callbackTypeEnum["faceCompare"] = "faceCompare";
|
|
19
|
+
callbackTypeEnum["faceCompareDocumentAndFace"] = "faceCompareDocumentAndFace";
|
|
20
|
+
callbackTypeEnum["compareEmbeddings"] = "compareEmbeddings";
|
|
21
|
+
})(callbackTypeEnum || (callbackTypeEnum = {}));
|
|
22
|
+
export const createCallback = ({ type, callbackFunction, returnType, imageData, portrait, isMobile, }) => {
|
|
23
|
+
const createCallbackIsValid = ({ callback, returnType }) => (operation, id, response_str) => {
|
|
24
|
+
const isResponse = response_str.length > 0;
|
|
25
|
+
printLogs(`[JS RESPONSE]: response_str': `, isResponse ? JSON.parse(response_str) : '');
|
|
26
|
+
printLogs(`[JS RESPONSE]: operation': `, operation || 'null');
|
|
27
|
+
printLogs(`[JS RESPONSE]: id: `, id || 'null');
|
|
28
|
+
if (isResponse) {
|
|
29
|
+
const returnValue = JSON.parse(response_str);
|
|
30
|
+
const returnData = {
|
|
31
|
+
call_status: returnValue.call_status.return_status,
|
|
32
|
+
face_validation_status: returnValue.faces.faces[0].face_validation_status,
|
|
33
|
+
antispoof_status: returnValue.faces.faces[0].antispoofing_status,
|
|
34
|
+
};
|
|
35
|
+
if (operation === 'validate_face') {
|
|
36
|
+
if (returnType && returnType === 'all') {
|
|
37
|
+
callback(returnValue);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
callback(returnData);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
const createCallbackEnroll = ({ callback, returnType }) => (operation, id, response_str) => {
|
|
46
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
47
|
+
const isResponse = response_str.length > 0;
|
|
48
|
+
printLogs(`[JS RESPONSE]: response_str': `, isResponse ? JSON.parse(response_str) : '');
|
|
49
|
+
printLogs(`[JS RESPONSE]: operation': `, operation || 'null');
|
|
50
|
+
printLogs(`[JS RESPONSE]: id: `, id || 'null');
|
|
51
|
+
if (isResponse) {
|
|
52
|
+
const returnValue = JSON.parse(response_str);
|
|
53
|
+
if (operation === 'user_enroll') {
|
|
54
|
+
const returnData = {
|
|
55
|
+
mf_token: (_a = returnValue === null || returnValue === void 0 ? void 0 : returnValue.call_status) === null || _a === void 0 ? void 0 : _a.mf_token,
|
|
56
|
+
callback_status: (_b = returnValue === null || returnValue === void 0 ? void 0 : returnValue.call_status) === null || _b === void 0 ? void 0 : _b.return_status,
|
|
57
|
+
face_validation_status: (_d = (_c = returnValue === null || returnValue === void 0 ? void 0 : returnValue.uber_operation_result) === null || _c === void 0 ? void 0 : _c.face) === null || _d === void 0 ? void 0 : _d.face_validation_status,
|
|
58
|
+
antispoof_status: (_f = (_e = returnValue === null || returnValue === void 0 ? void 0 : returnValue.uber_operation_result) === null || _e === void 0 ? void 0 : _e.face) === null || _f === void 0 ? void 0 : _f.antispoofing_status,
|
|
59
|
+
encrypted_embeddings: (_g = returnValue === null || returnValue === void 0 ? void 0 : returnValue.uber_operation_result) === null || _g === void 0 ? void 0 : _g.embedding,
|
|
60
|
+
iso_image: (_k = (_j = (_h = returnValue === null || returnValue === void 0 ? void 0 : returnValue.uber_operation_result) === null || _h === void 0 ? void 0 : _h.cropped_images) === null || _j === void 0 ? void 0 : _j.items) === null || _k === void 0 ? void 0 : _k.iso,
|
|
61
|
+
api_response: (_l = returnValue === null || returnValue === void 0 ? void 0 : returnValue.uber_operation_result) === null || _l === void 0 ? void 0 : _l.response,
|
|
62
|
+
face_position: (_o = (_m = returnValue === null || returnValue === void 0 ? void 0 : returnValue.uber_operation_result) === null || _m === void 0 ? void 0 : _m.face) === null || _o === void 0 ? void 0 : _o.face_position,
|
|
63
|
+
};
|
|
64
|
+
if (returnType && returnType === 'all') {
|
|
65
|
+
callback(returnValue);
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
callback(returnData);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
const createCallbackPredict = ({ callback, returnType }) => (operation, id, response_str) => {
|
|
74
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
75
|
+
const isResponse = response_str.length > 0;
|
|
76
|
+
printLogs(`[JS RESPONSE]: response_str': `, isResponse ? JSON.parse(response_str) : '');
|
|
77
|
+
printLogs(`[JS RESPONSE]: operation': `, operation || 'null');
|
|
78
|
+
printLogs(`[JS RESPONSE]: id: `, id || 'null');
|
|
79
|
+
if (isResponse) {
|
|
80
|
+
const returnValue = JSON.parse(response_str);
|
|
81
|
+
const cache_content = returnValue.uber_operation_result.cache_content;
|
|
82
|
+
if (cache_content) {
|
|
83
|
+
localStorage.setItem('cache_content', cache_content);
|
|
84
|
+
}
|
|
85
|
+
const returnData = {
|
|
86
|
+
mf_token: (_a = returnValue === null || returnValue === void 0 ? void 0 : returnValue.call_status) === null || _a === void 0 ? void 0 : _a.mf_token,
|
|
87
|
+
callback_status: (_b = returnValue === null || returnValue === void 0 ? void 0 : returnValue.call_status) === null || _b === void 0 ? void 0 : _b.return_status,
|
|
88
|
+
face_validation_status: (_d = (_c = returnValue === null || returnValue === void 0 ? void 0 : returnValue.uber_operation_result) === null || _c === void 0 ? void 0 : _c.face) === null || _d === void 0 ? void 0 : _d.face_validation_status,
|
|
89
|
+
antispoof_status: (_f = (_e = returnValue === null || returnValue === void 0 ? void 0 : returnValue.uber_operation_result) === null || _e === void 0 ? void 0 : _e.face) === null || _f === void 0 ? void 0 : _f.antispoofing_status,
|
|
90
|
+
api_response: (_g = returnValue === null || returnValue === void 0 ? void 0 : returnValue.uber_operation_result) === null || _g === void 0 ? void 0 : _g.response,
|
|
91
|
+
encrypted_embeddings: (_h = returnValue === null || returnValue === void 0 ? void 0 : returnValue.uber_operation_result) === null || _h === void 0 ? void 0 : _h.embedding,
|
|
92
|
+
cache_content: cache_content,
|
|
93
|
+
};
|
|
94
|
+
if (operation === 'user_predict') {
|
|
95
|
+
if (returnType && returnType === 'all') {
|
|
96
|
+
callback(returnValue);
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
callback(returnData);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
const createCallbackFrontDlScan = ({ callback, returnType, inputImage }) => (operation, id, response_str) => {
|
|
105
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
106
|
+
const isResponse = response_str.length > 0;
|
|
107
|
+
printLogs(`[JS RESPONSE]: response_str': `, isResponse ? JSON.parse(response_str) : '');
|
|
108
|
+
printLogs(`[JS RESPONSE]: operation': `, operation || 'null');
|
|
109
|
+
printLogs(`[JS RESPONSE]: id: `, id || 'null');
|
|
110
|
+
if (isResponse) {
|
|
111
|
+
if (operation === 'doc_scan_front') {
|
|
112
|
+
const returnValue = JSON.parse(response_str);
|
|
113
|
+
const returnData = {
|
|
114
|
+
callback_status: (_a = returnValue === null || returnValue === void 0 ? void 0 : returnValue.call_status) === null || _a === void 0 ? void 0 : _a.return_status,
|
|
115
|
+
doc_validation_status: (_c = (_b = returnValue === null || returnValue === void 0 ? void 0 : returnValue.uber_operation_result) === null || _b === void 0 ? void 0 : _b.document) === null || _c === void 0 ? void 0 : _c.document_validation_status,
|
|
116
|
+
cropped_document: (_f = (_e = (_d = returnValue === null || returnValue === void 0 ? void 0 : returnValue.uber_operation_result) === null || _d === void 0 ? void 0 : _d.cropped_images) === null || _e === void 0 ? void 0 : _e.items) === null || _f === void 0 ? void 0 : _f.document,
|
|
117
|
+
cropped_mugshot: (_j = (_h = (_g = returnValue === null || returnValue === void 0 ? void 0 : returnValue.uber_operation_result) === null || _g === void 0 ? void 0 : _g.cropped_images) === null || _h === void 0 ? void 0 : _h.items) === null || _j === void 0 ? void 0 : _j.mugshot,
|
|
118
|
+
input_image: ((_l = (_k = returnValue === null || returnValue === void 0 ? void 0 : returnValue.uber_operation_result) === null || _k === void 0 ? void 0 : _k.document) === null || _l === void 0 ? void 0 : _l.document_validation_status) === 0 ? inputImage : undefined,
|
|
119
|
+
embedding: (_m = returnValue === null || returnValue === void 0 ? void 0 : returnValue.uber_operation_result) === null || _m === void 0 ? void 0 : _m.embedding,
|
|
120
|
+
api_request: (_o = returnValue === null || returnValue === void 0 ? void 0 : returnValue.uber_operation_result) === null || _o === void 0 ? void 0 : _o.request,
|
|
121
|
+
barcode_detection_status: ((_q = (_p = returnValue === null || returnValue === void 0 ? void 0 : returnValue.uber_operation_result) === null || _p === void 0 ? void 0 : _p.barcode) === null || _q === void 0 ? void 0 : _q.bar_code_detection_status) === 0,
|
|
122
|
+
};
|
|
123
|
+
if (returnType === 'all') {
|
|
124
|
+
callback(returnValue);
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
callback(returnData);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
const createCallbackPassportScan = ({ callback, returnType }) => (operation, id, response_str) => {
|
|
133
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
134
|
+
const isResponse = response_str.length > 0;
|
|
135
|
+
printLogs(`[JS RESPONSE]: Passport response_str': `, isResponse ? JSON.parse(response_str) : '');
|
|
136
|
+
printLogs(`[JS RESPONSE]: operation': `, operation || 'null');
|
|
137
|
+
printLogs(`[JS RESPONSE]: id: `, id || 'null');
|
|
138
|
+
if (isResponse) {
|
|
139
|
+
if (operation === 'doc_scan_front') {
|
|
140
|
+
const returnValue = JSON.parse(response_str);
|
|
141
|
+
const returnData = {
|
|
142
|
+
callback_status: (_a = returnValue === null || returnValue === void 0 ? void 0 : returnValue.call_status) === null || _a === void 0 ? void 0 : _a.return_status,
|
|
143
|
+
doc_validation_status: (_c = (_b = returnValue === null || returnValue === void 0 ? void 0 : returnValue.uber_operation_result) === null || _b === void 0 ? void 0 : _b.document) === null || _c === void 0 ? void 0 : _c.document_validation_status,
|
|
144
|
+
cropped_document: (_f = (_e = (_d = returnValue === null || returnValue === void 0 ? void 0 : returnValue.uber_operation_result) === null || _d === void 0 ? void 0 : _d.cropped_images) === null || _e === void 0 ? void 0 : _e.items) === null || _f === void 0 ? void 0 : _f.document,
|
|
145
|
+
cropped_mugshot: (_j = (_h = (_g = returnValue === null || returnValue === void 0 ? void 0 : returnValue.uber_operation_result) === null || _g === void 0 ? void 0 : _g.cropped_images) === null || _h === void 0 ? void 0 : _h.items) === null || _j === void 0 ? void 0 : _j.mugshot,
|
|
146
|
+
embedding: (_k = returnValue === null || returnValue === void 0 ? void 0 : returnValue.uber_operation_result) === null || _k === void 0 ? void 0 : _k.embedding,
|
|
147
|
+
mrz_text_detected: ((_m = (_l = returnValue === null || returnValue === void 0 ? void 0 : returnValue.uber_operation_result) === null || _l === void 0 ? void 0 : _l.document) === null || _m === void 0 ? void 0 : _m.mrz_text.length) > 0,
|
|
148
|
+
};
|
|
149
|
+
if (returnType === 'all') {
|
|
150
|
+
callback(returnValue);
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
callback(returnData);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
const createCallbackDelete = ({ callback }) => (operation, id, response_str) => {
|
|
159
|
+
const isResponse = response_str.length > 0;
|
|
160
|
+
printLogs(`[JS RESPONSE]: response_str': `, isResponse ? JSON.parse(response_str) : '');
|
|
161
|
+
printLogs(`[JS RESPONSE]: operation': `, operation || 'null');
|
|
162
|
+
printLogs(`[JS RESPONSE]: id: `, id || 'null');
|
|
163
|
+
if (isResponse) {
|
|
164
|
+
const returnValue = JSON.parse(response_str);
|
|
165
|
+
const returnData = {
|
|
166
|
+
call_status: returnValue.call_status.return_status,
|
|
167
|
+
delete_status: returnValue.user_delete.status,
|
|
168
|
+
delete_message: returnValue.user_delete.message,
|
|
169
|
+
};
|
|
170
|
+
if (operation === 'delete') {
|
|
171
|
+
callback(returnData);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
const createCallbackPredictAge = ({ callback, portrait, returnType }) => (operation, id, response_str) => {
|
|
176
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
177
|
+
const isResponse = response_str.length > 0;
|
|
178
|
+
printLogs(`[JS RESPONSE]: response_str': `, isResponse ? JSON.parse(response_str) : '');
|
|
179
|
+
printLogs(`[JS RESPONSE]: operation': `, operation || 'null');
|
|
180
|
+
printLogs(`[JS RESPONSE]: id: `, id || 'null');
|
|
181
|
+
if (isResponse) {
|
|
182
|
+
const returnValue = JSON.parse(response_str);
|
|
183
|
+
const returnData = {
|
|
184
|
+
mf_token: (_a = returnValue === null || returnValue === void 0 ? void 0 : returnValue.call_status) === null || _a === void 0 ? void 0 : _a.mf_token,
|
|
185
|
+
face_validation_status: (_c = (_b = returnValue === null || returnValue === void 0 ? void 0 : returnValue.uber_operation_result) === null || _b === void 0 ? void 0 : _b.face) === null || _c === void 0 ? void 0 : _c.face_validation_status,
|
|
186
|
+
antispoof_status: (_e = (_d = returnValue === null || returnValue === void 0 ? void 0 : returnValue.uber_operation_result) === null || _d === void 0 ? void 0 : _d.face) === null || _e === void 0 ? void 0 : _e.antispoofing_status,
|
|
187
|
+
call_status: (_f = returnValue === null || returnValue === void 0 ? void 0 : returnValue.call_status) === null || _f === void 0 ? void 0 : _f.return_status,
|
|
188
|
+
api_request: (_g = returnValue === null || returnValue === void 0 ? void 0 : returnValue.uber_operation_result) === null || _g === void 0 ? void 0 : _g.request,
|
|
189
|
+
embedding: (_h = returnValue === null || returnValue === void 0 ? void 0 : returnValue.uber_operation_result) === null || _h === void 0 ? void 0 : _h.embedding,
|
|
190
|
+
remove_glasses: (_j = returnValue === null || returnValue === void 0 ? void 0 : returnValue.uber_operation_result) === null || _j === void 0 ? void 0 : _j.young_person_with_glasses,
|
|
191
|
+
execution_time_ms: (_k = returnValue === null || returnValue === void 0 ? void 0 : returnValue.call_status) === null || _k === void 0 ? void 0 : _k.execution_time_ms,
|
|
192
|
+
};
|
|
193
|
+
if (operation === 'estimate_age') {
|
|
194
|
+
if (returnType && returnType === 'all') {
|
|
195
|
+
callback(Object.assign(Object.assign({}, returnValue), { portrait }));
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
callback(Object.assign(Object.assign({}, returnData), { portrait }));
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
const createCallbackCompareDocumentAndFace = ({ callback, returnType }) => (operation, id, response_str) => {
|
|
204
|
+
const isResponse = response_str.length > 0;
|
|
205
|
+
printLogs(`[JS RESPONSE]: response_str': `, isResponse ? JSON.parse(response_str) : '');
|
|
206
|
+
printLogs(`[JS RESPONSE]: operation': `, operation || 'null');
|
|
207
|
+
printLogs(`[JS RESPONSE]: id: `, id || 'null');
|
|
208
|
+
if (isResponse) {
|
|
209
|
+
if (operation === 'compare_mugshot_and_face') {
|
|
210
|
+
const returnValue = JSON.parse(response_str);
|
|
211
|
+
const returnData = {
|
|
212
|
+
image_a_face_validation_status: returnValue.face_compare.a_face_validation_status,
|
|
213
|
+
image_b_face_validation_status: returnValue.face_compare.b_face_validation_status,
|
|
214
|
+
call_status: returnValue.call_status.return_status,
|
|
215
|
+
compare_score: returnValue.face_compare.conf_score,
|
|
216
|
+
compare_status: returnValue.face_compare.result,
|
|
217
|
+
};
|
|
218
|
+
if (returnType === 'all') {
|
|
219
|
+
callback(returnValue);
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
callback(returnData);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
const createCallbackBackDlScan = ({ callback, returnType, isMobile = false }) => (operation, id, response_str) => {
|
|
228
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
229
|
+
const isResponse = response_str.length > 0;
|
|
230
|
+
printLogs(`[JS RESPONSE]: response_str': `, isResponse ? JSON.parse(response_str) : '');
|
|
231
|
+
printLogs(`[JS RESPONSE]: operation': `, operation || 'null');
|
|
232
|
+
printLogs(`[JS RESPONSE]: id: `, id || 'null');
|
|
233
|
+
if (isResponse) {
|
|
234
|
+
const returnValue = JSON.parse(response_str);
|
|
235
|
+
const returnData = {
|
|
236
|
+
callback_status: (_a = returnValue === null || returnValue === void 0 ? void 0 : returnValue.call_status) === null || _a === void 0 ? void 0 : _a.return_status,
|
|
237
|
+
doc_validation_status: (_c = (_b = returnValue === null || returnValue === void 0 ? void 0 : returnValue.uber_operation_result) === null || _b === void 0 ? void 0 : _b.document) === null || _c === void 0 ? void 0 : _c.document_validation_status,
|
|
238
|
+
barcode_detection_status: (_e = (_d = returnValue === null || returnValue === void 0 ? void 0 : returnValue.uber_operation_result) === null || _d === void 0 ? void 0 : _d.barcode) === null || _e === void 0 ? void 0 : _e.bar_code_detection_status,
|
|
239
|
+
cropped_document_base64: (_h = (_g = (_f = returnValue === null || returnValue === void 0 ? void 0 : returnValue.uber_operation_result) === null || _f === void 0 ? void 0 : _f.cropped_images) === null || _g === void 0 ? void 0 : _g.items) === null || _h === void 0 ? void 0 : _h.document,
|
|
240
|
+
cropped_barcode_base64: (_l = (_k = (_j = returnValue === null || returnValue === void 0 ? void 0 : returnValue.uber_operation_result) === null || _j === void 0 ? void 0 : _j.cropped_images) === null || _k === void 0 ? void 0 : _k.items) === null || _l === void 0 ? void 0 : _l.barcode,
|
|
241
|
+
barcode_data: (_o = (_m = returnValue === null || returnValue === void 0 ? void 0 : returnValue.uber_operation_result) === null || _m === void 0 ? void 0 : _m.barcode) === null || _o === void 0 ? void 0 : _o.barcode_data,
|
|
242
|
+
is_mobile: isMobile,
|
|
243
|
+
};
|
|
244
|
+
if (operation === 'doc_scan_back') {
|
|
245
|
+
if (returnType && returnType === 'all') {
|
|
246
|
+
callback(returnValue);
|
|
247
|
+
}
|
|
248
|
+
else {
|
|
249
|
+
callback(returnData);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
const createCallbackCompareEmbeddings = ({ callback, returnType }) => (operation, id, response_str) => {
|
|
255
|
+
var _a, _b, _c, _d, _e;
|
|
256
|
+
const isResponse = response_str.length > 0;
|
|
257
|
+
printLogs(`[JS RESPONSE]: response_str': `, isResponse ? JSON.parse(response_str) : '');
|
|
258
|
+
printLogs(`[JS RESPONSE]: operation': `, operation || 'null');
|
|
259
|
+
printLogs(`[JS RESPONSE]: id: `, id || 'null');
|
|
260
|
+
if (isResponse) {
|
|
261
|
+
if (operation === 'compare_embeddings') {
|
|
262
|
+
const returnValue = JSON.parse(response_str);
|
|
263
|
+
const returnData = {
|
|
264
|
+
confidence_score: (_a = returnValue === null || returnValue === void 0 ? void 0 : returnValue.uber_operation_result) === null || _a === void 0 ? void 0 : _a.confidence_score,
|
|
265
|
+
call_status: (_b = returnValue === null || returnValue === void 0 ? void 0 : returnValue.call_status) === null || _b === void 0 ? void 0 : _b.return_status,
|
|
266
|
+
call_status_message: (_c = returnValue === null || returnValue === void 0 ? void 0 : returnValue.call_status) === null || _c === void 0 ? void 0 : _c.return_message,
|
|
267
|
+
is_same_face: (_d = returnValue === null || returnValue === void 0 ? void 0 : returnValue.uber_operation_result) === null || _d === void 0 ? void 0 : _d.is_same_face,
|
|
268
|
+
api_request: (_e = returnValue === null || returnValue === void 0 ? void 0 : returnValue.uber_operation_result) === null || _e === void 0 ? void 0 : _e.request,
|
|
269
|
+
};
|
|
270
|
+
if (returnType === 'all') {
|
|
271
|
+
callback(returnValue);
|
|
272
|
+
}
|
|
273
|
+
else {
|
|
274
|
+
callback(returnData);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
const createCallbackDocumentOcr = ({ callback }) => (operation, id, response_str) => {
|
|
280
|
+
var _a, _b, _c;
|
|
281
|
+
const isResponse = response_str.length > 0;
|
|
282
|
+
printLogs(`[JS RESPONSE]: response_str': `, isResponse ? JSON.parse(response_str) : '');
|
|
283
|
+
printLogs(`[JS RESPONSE]: operation': `, operation || 'null');
|
|
284
|
+
printLogs(`[JS RESPONSE]: id: `, id || 'null');
|
|
285
|
+
if (isResponse) {
|
|
286
|
+
if (operation === 'doc_ocr_front') {
|
|
287
|
+
const returnValue = JSON.parse(response_str);
|
|
288
|
+
const returnData = {
|
|
289
|
+
api_request: (_a = returnValue === null || returnValue === void 0 ? void 0 : returnValue.uber_operation_result) === null || _a === void 0 ? void 0 : _a.request,
|
|
290
|
+
call_status: (_b = returnValue === null || returnValue === void 0 ? void 0 : returnValue.call_status) === null || _b === void 0 ? void 0 : _b.return_status,
|
|
291
|
+
call_status_message: (_c = returnValue === null || returnValue === void 0 ? void 0 : returnValue.call_status) === null || _c === void 0 ? void 0 : _c.return_message,
|
|
292
|
+
};
|
|
293
|
+
if (returnType === 'all') {
|
|
294
|
+
callback(returnValue);
|
|
295
|
+
}
|
|
296
|
+
else {
|
|
297
|
+
callback(returnData);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
switch (type) {
|
|
303
|
+
case callbackTypeEnum.isValid:
|
|
304
|
+
return createCallbackIsValid({ callback: callbackFunction });
|
|
305
|
+
case callbackTypeEnum.enroll:
|
|
306
|
+
return createCallbackEnroll({ callback: callbackFunction });
|
|
307
|
+
case callbackTypeEnum.predict:
|
|
308
|
+
return createCallbackPredict({ callback: callbackFunction });
|
|
309
|
+
case callbackTypeEnum.faceLogin:
|
|
310
|
+
return createCallbackPredict({ callback: callbackFunction });
|
|
311
|
+
case callbackTypeEnum.continuousPredict:
|
|
312
|
+
return createCallbackPredict({ callback: callbackFunction });
|
|
313
|
+
case callbackTypeEnum.delete:
|
|
314
|
+
return createCallbackDelete({ callback: callbackFunction });
|
|
315
|
+
case callbackTypeEnum.frontScan:
|
|
316
|
+
return createCallbackFrontDlScan({ callback: callbackFunction, inputImage: imageData });
|
|
317
|
+
case callbackTypeEnum.backScan:
|
|
318
|
+
return createCallbackBackDlScan({ callback: callbackFunction, returnType, isMobile });
|
|
319
|
+
case callbackTypeEnum.faceCompareDocumentAndFace:
|
|
320
|
+
return createCallbackCompareDocumentAndFace({ callback: callbackFunction });
|
|
321
|
+
case callbackTypeEnum.compareEmbeddings:
|
|
322
|
+
return createCallbackCompareEmbeddings({ callback: callbackFunction, returnType });
|
|
323
|
+
case callbackTypeEnum.ageEstimation:
|
|
324
|
+
return createCallbackPredictAge({ callback: callbackFunction, portrait, returnType });
|
|
325
|
+
case callbackTypeEnum.passportScan:
|
|
326
|
+
return createCallbackPassportScan({ callback: callbackFunction });
|
|
327
|
+
case callbackTypeEnum.documentOcr:
|
|
328
|
+
return createCallbackDocumentOcr({ callback: callbackFunction });
|
|
329
|
+
default:
|
|
330
|
+
return null;
|
|
331
|
+
}
|
|
332
|
+
};
|
|
331
333
|
//# sourceMappingURL=createCallback.js.map
|