@idmission/websdk-core 0.1.0-rc.1

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 (416) hide show
  1. package/README.md +66 -0
  2. package/dist/attestation/attestationState.d.ts +24 -0
  3. package/dist/attestation/attestationState.d.ts.map +1 -0
  4. package/dist/attestation/attestationState.js +57 -0
  5. package/dist/attestation/clientAttestation.d.ts +40 -0
  6. package/dist/attestation/clientAttestation.d.ts.map +1 -0
  7. package/dist/attestation/clientAttestation.js +19 -0
  8. package/dist/attestation/collectClientAttestation.d.ts +10 -0
  9. package/dist/attestation/collectClientAttestation.d.ts.map +1 -0
  10. package/dist/attestation/collectClientAttestation.js +18 -0
  11. package/dist/attestation/index.d.ts +5 -0
  12. package/dist/attestation/index.d.ts.map +1 -0
  13. package/dist/attestation/index.js +4 -0
  14. package/dist/attestation/nativeAttestationBridge.d.ts +3 -0
  15. package/dist/attestation/nativeAttestationBridge.d.ts.map +1 -0
  16. package/dist/attestation/nativeAttestationBridge.js +38 -0
  17. package/dist/barcode/AAMVAParser.d.ts +77 -0
  18. package/dist/barcode/AAMVAParser.d.ts.map +1 -0
  19. package/dist/barcode/AAMVAParser.js +422 -0
  20. package/dist/barcode/NativeBarcodeDecoder.d.ts +157 -0
  21. package/dist/barcode/NativeBarcodeDecoder.d.ts.map +1 -0
  22. package/dist/barcode/NativeBarcodeDecoder.js +832 -0
  23. package/dist/barcode/Parse.d.ts +6 -0
  24. package/dist/barcode/Parse.d.ts.map +1 -0
  25. package/dist/barcode/Parse.js +148 -0
  26. package/dist/barcode/decodeSummary.d.ts +45 -0
  27. package/dist/barcode/decodeSummary.d.ts.map +1 -0
  28. package/dist/barcode/decodeSummary.js +23 -0
  29. package/dist/barcode/index.d.ts +5 -0
  30. package/dist/barcode/index.d.ts.map +1 -0
  31. package/dist/barcode/index.js +4 -0
  32. package/dist/camera/Camera.d.ts +37 -0
  33. package/dist/camera/Camera.d.ts.map +1 -0
  34. package/dist/camera/Camera.js +453 -0
  35. package/dist/camera/acquireCamera.d.ts +29 -0
  36. package/dist/camera/acquireCamera.d.ts.map +1 -0
  37. package/dist/camera/acquireCamera.js +224 -0
  38. package/dist/camera/cameraSignals.d.ts +23 -0
  39. package/dist/camera/cameraSignals.d.ts.map +1 -0
  40. package/dist/camera/cameraSignals.js +32 -0
  41. package/dist/camera/getUserMediaIntegrity.d.ts +72 -0
  42. package/dist/camera/getUserMediaIntegrity.d.ts.map +1 -0
  43. package/dist/camera/getUserMediaIntegrity.js +256 -0
  44. package/dist/camera/index.d.ts +6 -0
  45. package/dist/camera/index.d.ts.map +1 -0
  46. package/dist/camera/index.js +5 -0
  47. package/dist/camera/isVirtualCamera.d.ts +10 -0
  48. package/dist/camera/isVirtualCamera.d.ts.map +1 -0
  49. package/dist/camera/isVirtualCamera.js +11 -0
  50. package/dist/client/IdmissionClient.d.ts +151 -0
  51. package/dist/client/IdmissionClient.d.ts.map +1 -0
  52. package/dist/client/IdmissionClient.js +638 -0
  53. package/dist/client/additionalDocument.d.ts +14 -0
  54. package/dist/client/additionalDocument.d.ts.map +1 -0
  55. package/dist/client/additionalDocument.js +24 -0
  56. package/dist/client/artifacts.d.ts +146 -0
  57. package/dist/client/artifacts.d.ts.map +1 -0
  58. package/dist/client/artifacts.js +1 -0
  59. package/dist/client/blobToB64.d.ts +2 -0
  60. package/dist/client/blobToB64.d.ts.map +1 -0
  61. package/dist/client/blobToB64.js +17 -0
  62. package/dist/client/endpoints.d.ts +7 -0
  63. package/dist/client/endpoints.d.ts.map +1 -0
  64. package/dist/client/endpoints.js +59 -0
  65. package/dist/client/errors.d.ts +20 -0
  66. package/dist/client/errors.d.ts.map +1 -0
  67. package/dist/client/errors.js +45 -0
  68. package/dist/client/index.d.ts +23 -0
  69. package/dist/client/index.d.ts.map +1 -0
  70. package/dist/client/index.js +38 -0
  71. package/dist/client/payload.d.ts +36 -0
  72. package/dist/client/payload.d.ts.map +1 -0
  73. package/dist/client/payload.js +397 -0
  74. package/dist/client/sessionMachine.d.ts +26 -0
  75. package/dist/client/sessionMachine.d.ts.map +1 -0
  76. package/dist/client/sessionMachine.js +23 -0
  77. package/dist/client/submissionMetadata.d.ts +31 -0
  78. package/dist/client/submissionMetadata.d.ts.map +1 -0
  79. package/dist/client/submissionMetadata.js +90 -0
  80. package/dist/client/timings.d.ts +49 -0
  81. package/dist/client/timings.d.ts.map +1 -0
  82. package/dist/client/timings.js +32 -0
  83. package/dist/client/types.d.ts +305 -0
  84. package/dist/client/types.d.ts.map +1 -0
  85. package/dist/client/types.js +18 -0
  86. package/dist/client/upload.d.ts +60 -0
  87. package/dist/client/upload.d.ts.map +1 -0
  88. package/dist/client/upload.js +313 -0
  89. package/dist/client/uploadedDocument.d.ts +7 -0
  90. package/dist/client/uploadedDocument.d.ts.map +1 -0
  91. package/dist/client/uploadedDocument.js +4 -0
  92. package/dist/client/urls.d.ts +30 -0
  93. package/dist/client/urls.d.ts.map +1 -0
  94. package/dist/client/urls.js +73 -0
  95. package/dist/client/validateSession.d.ts +7 -0
  96. package/dist/client/validateSession.d.ts.map +1 -0
  97. package/dist/client/validateSession.js +63 -0
  98. package/dist/config/cdn.d.ts +2 -0
  99. package/dist/config/cdn.d.ts.map +1 -0
  100. package/dist/config/cdn.js +1 -0
  101. package/dist/diagnostics/buffer.d.ts +8 -0
  102. package/dist/diagnostics/buffer.d.ts.map +1 -0
  103. package/dist/diagnostics/buffer.js +25 -0
  104. package/dist/diagnostics/envCapability.d.ts +3 -0
  105. package/dist/diagnostics/envCapability.d.ts.map +1 -0
  106. package/dist/diagnostics/envCapability.js +40 -0
  107. package/dist/diagnostics/floodControl.d.ts +6 -0
  108. package/dist/diagnostics/floodControl.d.ts.map +1 -0
  109. package/dist/diagnostics/floodControl.js +29 -0
  110. package/dist/diagnostics/index.d.ts +8 -0
  111. package/dist/diagnostics/index.d.ts.map +1 -0
  112. package/dist/diagnostics/index.js +17 -0
  113. package/dist/diagnostics/install.d.ts +20 -0
  114. package/dist/diagnostics/install.d.ts.map +1 -0
  115. package/dist/diagnostics/install.js +159 -0
  116. package/dist/diagnostics/redaction.d.ts +7 -0
  117. package/dist/diagnostics/redaction.d.ts.map +1 -0
  118. package/dist/diagnostics/redaction.js +73 -0
  119. package/dist/diagnostics/transport.d.ts +15 -0
  120. package/dist/diagnostics/transport.d.ts.map +1 -0
  121. package/dist/diagnostics/transport.js +35 -0
  122. package/dist/diagnostics/types.d.ts +59 -0
  123. package/dist/diagnostics/types.d.ts.map +1 -0
  124. package/dist/diagnostics/types.js +1 -0
  125. package/dist/documentCapture/controller.d.ts +35 -0
  126. package/dist/documentCapture/controller.d.ts.map +1 -0
  127. package/dist/documentCapture/controller.js +254 -0
  128. package/dist/documentCapture/index.d.ts +4 -0
  129. package/dist/documentCapture/index.d.ts.map +1 -0
  130. package/dist/documentCapture/index.js +8 -0
  131. package/dist/documentCapture/reducer.d.ts +31 -0
  132. package/dist/documentCapture/reducer.d.ts.map +1 -0
  133. package/dist/documentCapture/reducer.js +87 -0
  134. package/dist/documentCapture/state.d.ts +49 -0
  135. package/dist/documentCapture/state.d.ts.map +1 -0
  136. package/dist/documentCapture/state.js +36 -0
  137. package/dist/idCapture/controller.d.ts +228 -0
  138. package/dist/idCapture/controller.d.ts.map +1 -0
  139. package/dist/idCapture/controller.js +1453 -0
  140. package/dist/idCapture/errors.d.ts +36 -0
  141. package/dist/idCapture/errors.d.ts.map +1 -0
  142. package/dist/idCapture/errors.js +18 -0
  143. package/dist/idCapture/guidance.d.ts +80 -0
  144. package/dist/idCapture/guidance.d.ts.map +1 -0
  145. package/dist/idCapture/guidance.js +143 -0
  146. package/dist/idCapture/index.d.ts +22 -0
  147. package/dist/idCapture/index.d.ts.map +1 -0
  148. package/dist/idCapture/index.js +46 -0
  149. package/dist/idCapture/phase.d.ts +10 -0
  150. package/dist/idCapture/phase.d.ts.map +1 -0
  151. package/dist/idCapture/phase.js +28 -0
  152. package/dist/idCapture/pipeline.d.ts +176 -0
  153. package/dist/idCapture/pipeline.d.ts.map +1 -0
  154. package/dist/idCapture/pipeline.js +1028 -0
  155. package/dist/idCapture/reducer.d.ts +3 -0
  156. package/dist/idCapture/reducer.d.ts.map +1 -0
  157. package/dist/idCapture/reducer.js +661 -0
  158. package/dist/idCapture/requirements.d.ts +10 -0
  159. package/dist/idCapture/requirements.d.ts.map +1 -0
  160. package/dist/idCapture/requirements.js +43 -0
  161. package/dist/idCapture/stabilizer.d.ts +2 -0
  162. package/dist/idCapture/stabilizer.d.ts.map +1 -0
  163. package/dist/idCapture/stabilizer.js +4 -0
  164. package/dist/idCapture/state.d.ts +426 -0
  165. package/dist/idCapture/state.d.ts.map +1 -0
  166. package/dist/idCapture/state.js +91 -0
  167. package/dist/idCapture/submit.d.ts +33 -0
  168. package/dist/idCapture/submit.d.ts.map +1 -0
  169. package/dist/idCapture/submit.js +105 -0
  170. package/dist/idCapture/types.d.ts +20 -0
  171. package/dist/idCapture/types.d.ts.map +1 -0
  172. package/dist/idCapture/types.js +12 -0
  173. package/dist/index.d.ts +6 -0
  174. package/dist/index.d.ts.map +1 -0
  175. package/dist/index.js +5 -0
  176. package/dist/liveness/challengeGeometry.d.ts +66 -0
  177. package/dist/liveness/challengeGeometry.d.ts.map +1 -0
  178. package/dist/liveness/challengeGeometry.js +226 -0
  179. package/dist/liveness/challengeSequence.d.ts +49 -0
  180. package/dist/liveness/challengeSequence.d.ts.map +1 -0
  181. package/dist/liveness/challengeSequence.js +71 -0
  182. package/dist/liveness/index.d.ts +4 -0
  183. package/dist/liveness/index.d.ts.map +1 -0
  184. package/dist/liveness/index.js +3 -0
  185. package/dist/liveness/livenessResult.d.ts +11 -0
  186. package/dist/liveness/livenessResult.d.ts.map +1 -0
  187. package/dist/liveness/livenessResult.js +16 -0
  188. package/dist/models/BarcodeReadability.d.ts +36 -0
  189. package/dist/models/BarcodeReadability.d.ts.map +1 -0
  190. package/dist/models/BarcodeReadability.js +71 -0
  191. package/dist/models/CapabilityProbing.d.ts +25 -0
  192. package/dist/models/CapabilityProbing.d.ts.map +1 -0
  193. package/dist/models/CapabilityProbing.js +172 -0
  194. package/dist/models/DocumentDetection.d.ts +96 -0
  195. package/dist/models/DocumentDetection.d.ts.map +1 -0
  196. package/dist/models/DocumentDetection.js +257 -0
  197. package/dist/models/FaceDetection.d.ts +21 -0
  198. package/dist/models/FaceDetection.d.ts.map +1 -0
  199. package/dist/models/FaceDetection.js +4 -0
  200. package/dist/models/Focus.d.ts +36 -0
  201. package/dist/models/Focus.d.ts.map +1 -0
  202. package/dist/models/Focus.js +69 -0
  203. package/dist/models/FrameLoop.d.ts +13 -0
  204. package/dist/models/FrameLoop.d.ts.map +1 -0
  205. package/dist/models/FrameLoop.js +56 -0
  206. package/dist/models/VisionRuntime.d.ts +18 -0
  207. package/dist/models/VisionRuntime.d.ts.map +1 -0
  208. package/dist/models/VisionRuntime.js +158 -0
  209. package/dist/models/defaults/BarcodeReadability.d.ts +3 -0
  210. package/dist/models/defaults/BarcodeReadability.d.ts.map +1 -0
  211. package/dist/models/defaults/BarcodeReadability.js +3 -0
  212. package/dist/models/defaults/BarcodeReadabilityLiteRT.d.ts +3 -0
  213. package/dist/models/defaults/BarcodeReadabilityLiteRT.d.ts.map +1 -0
  214. package/dist/models/defaults/BarcodeReadabilityLiteRT.js +3 -0
  215. package/dist/models/defaults/DocumentDetector.d.ts +3 -0
  216. package/dist/models/defaults/DocumentDetector.d.ts.map +1 -0
  217. package/dist/models/defaults/DocumentDetector.js +3 -0
  218. package/dist/models/defaults/DocumentDetectorLiteRT.d.ts +3 -0
  219. package/dist/models/defaults/DocumentDetectorLiteRT.d.ts.map +1 -0
  220. package/dist/models/defaults/DocumentDetectorLiteRT.js +3 -0
  221. package/dist/models/defaults/FaceDetector.d.ts +3 -0
  222. package/dist/models/defaults/FaceDetector.d.ts.map +1 -0
  223. package/dist/models/defaults/FaceDetector.js +3 -0
  224. package/dist/models/defaults/FaceLandmarker.d.ts +3 -0
  225. package/dist/models/defaults/FaceLandmarker.d.ts.map +1 -0
  226. package/dist/models/defaults/FaceLandmarker.js +8 -0
  227. package/dist/models/defaults/FaceLandmarkerLiteRT.d.ts +3 -0
  228. package/dist/models/defaults/FaceLandmarkerLiteRT.d.ts.map +1 -0
  229. package/dist/models/defaults/FaceLandmarkerLiteRT.js +3 -0
  230. package/dist/models/defaults/Focus.d.ts +3 -0
  231. package/dist/models/defaults/Focus.d.ts.map +1 -0
  232. package/dist/models/defaults/Focus.js +3 -0
  233. package/dist/models/defaults/FocusLiteRT.d.ts +3 -0
  234. package/dist/models/defaults/FocusLiteRT.d.ts.map +1 -0
  235. package/dist/models/defaults/FocusLiteRT.js +3 -0
  236. package/dist/models/defaults/index.d.ts +31 -0
  237. package/dist/models/defaults/index.d.ts.map +1 -0
  238. package/dist/models/defaults/index.js +38 -0
  239. package/dist/models/helpers.d.ts +25 -0
  240. package/dist/models/helpers.d.ts.map +1 -0
  241. package/dist/models/helpers.js +98 -0
  242. package/dist/models/index.d.ts +15 -0
  243. package/dist/models/index.d.ts.map +1 -0
  244. package/dist/models/index.js +14 -0
  245. package/dist/models/modelLifecycle.d.ts +26 -0
  246. package/dist/models/modelLifecycle.d.ts.map +1 -0
  247. package/dist/models/modelLifecycle.js +137 -0
  248. package/dist/models/occlusion.d.ts +20 -0
  249. package/dist/models/occlusion.d.ts.map +1 -0
  250. package/dist/models/occlusion.js +109 -0
  251. package/dist/models/passportBooklet.d.ts +34 -0
  252. package/dist/models/passportBooklet.d.ts.map +1 -0
  253. package/dist/models/passportBooklet.js +152 -0
  254. package/dist/models/preloadModels.d.ts +42 -0
  255. package/dist/models/preloadModels.d.ts.map +1 -0
  256. package/dist/models/preloadModels.js +204 -0
  257. package/dist/models/providers/litert/BarcodeReadability.d.ts +11 -0
  258. package/dist/models/providers/litert/BarcodeReadability.d.ts.map +1 -0
  259. package/dist/models/providers/litert/BarcodeReadability.js +135 -0
  260. package/dist/models/providers/litert/CapabilityProbe.d.ts +3 -0
  261. package/dist/models/providers/litert/CapabilityProbe.d.ts.map +1 -0
  262. package/dist/models/providers/litert/CapabilityProbe.js +44 -0
  263. package/dist/models/providers/litert/DocumentDetection.d.ts +18 -0
  264. package/dist/models/providers/litert/DocumentDetection.d.ts.map +1 -0
  265. package/dist/models/providers/litert/DocumentDetection.js +194 -0
  266. package/dist/models/providers/litert/FaceDetection.d.ts +11 -0
  267. package/dist/models/providers/litert/FaceDetection.d.ts.map +1 -0
  268. package/dist/models/providers/litert/FaceDetection.js +204 -0
  269. package/dist/models/providers/litert/FaceLandmarker.d.ts +11 -0
  270. package/dist/models/providers/litert/FaceLandmarker.d.ts.map +1 -0
  271. package/dist/models/providers/litert/FaceLandmarker.js +199 -0
  272. package/dist/models/providers/litert/Focus.d.ts +11 -0
  273. package/dist/models/providers/litert/Focus.d.ts.map +1 -0
  274. package/dist/models/providers/litert/Focus.js +141 -0
  275. package/dist/models/providers/litert/barcodeReadabilityPrePost.d.ts +6 -0
  276. package/dist/models/providers/litert/barcodeReadabilityPrePost.d.ts.map +1 -0
  277. package/dist/models/providers/litert/barcodeReadabilityPrePost.js +68 -0
  278. package/dist/models/providers/litert/blazeFacePrePost.d.ts +30 -0
  279. package/dist/models/providers/litert/blazeFacePrePost.d.ts.map +1 -0
  280. package/dist/models/providers/litert/blazeFacePrePost.js +206 -0
  281. package/dist/models/providers/litert/docDetectPrePost.d.ts +25 -0
  282. package/dist/models/providers/litert/docDetectPrePost.d.ts.map +1 -0
  283. package/dist/models/providers/litert/docDetectPrePost.js +197 -0
  284. package/dist/models/providers/litert/faceMeshPrePost.d.ts +23 -0
  285. package/dist/models/providers/litert/faceMeshPrePost.d.ts.map +1 -0
  286. package/dist/models/providers/litert/faceMeshPrePost.js +86 -0
  287. package/dist/models/providers/litert/focusPrePost.d.ts +6 -0
  288. package/dist/models/providers/litert/focusPrePost.d.ts.map +1 -0
  289. package/dist/models/providers/litert/focusPrePost.js +67 -0
  290. package/dist/models/providers/litert/runtime.d.ts +14 -0
  291. package/dist/models/providers/litert/runtime.d.ts.map +1 -0
  292. package/dist/models/providers/litert/runtime.js +83 -0
  293. package/dist/models/providers/mediapipe/BarcodeReadability.d.ts +11 -0
  294. package/dist/models/providers/mediapipe/BarcodeReadability.d.ts.map +1 -0
  295. package/dist/models/providers/mediapipe/BarcodeReadability.js +68 -0
  296. package/dist/models/providers/mediapipe/CapabilityProbe.d.ts +2 -0
  297. package/dist/models/providers/mediapipe/CapabilityProbe.d.ts.map +1 -0
  298. package/dist/models/providers/mediapipe/CapabilityProbe.js +14 -0
  299. package/dist/models/providers/mediapipe/DocumentDetection.d.ts +12 -0
  300. package/dist/models/providers/mediapipe/DocumentDetection.d.ts.map +1 -0
  301. package/dist/models/providers/mediapipe/DocumentDetection.js +90 -0
  302. package/dist/models/providers/mediapipe/FaceDetection.d.ts +11 -0
  303. package/dist/models/providers/mediapipe/FaceDetection.d.ts.map +1 -0
  304. package/dist/models/providers/mediapipe/FaceDetection.js +93 -0
  305. package/dist/models/providers/mediapipe/FaceLandmarker.d.ts +46 -0
  306. package/dist/models/providers/mediapipe/FaceLandmarker.d.ts.map +1 -0
  307. package/dist/models/providers/mediapipe/FaceLandmarker.js +166 -0
  308. package/dist/models/providers/mediapipe/Focus.d.ts +11 -0
  309. package/dist/models/providers/mediapipe/Focus.d.ts.map +1 -0
  310. package/dist/models/providers/mediapipe/Focus.js +51 -0
  311. package/dist/models/runtimeSelection.d.ts +5 -0
  312. package/dist/models/runtimeSelection.d.ts.map +1 -0
  313. package/dist/models/runtimeSelection.js +21 -0
  314. package/dist/selfieCapture/challengeRunner.d.ts +38 -0
  315. package/dist/selfieCapture/challengeRunner.d.ts.map +1 -0
  316. package/dist/selfieCapture/challengeRunner.js +181 -0
  317. package/dist/selfieCapture/controller.d.ts +166 -0
  318. package/dist/selfieCapture/controller.d.ts.map +1 -0
  319. package/dist/selfieCapture/controller.js +1253 -0
  320. package/dist/selfieCapture/faceTracking.d.ts +67 -0
  321. package/dist/selfieCapture/faceTracking.d.ts.map +1 -0
  322. package/dist/selfieCapture/faceTracking.js +158 -0
  323. package/dist/selfieCapture/guidance.d.ts +24 -0
  324. package/dist/selfieCapture/guidance.d.ts.map +1 -0
  325. package/dist/selfieCapture/guidance.js +41 -0
  326. package/dist/selfieCapture/index.d.ts +18 -0
  327. package/dist/selfieCapture/index.d.ts.map +1 -0
  328. package/dist/selfieCapture/index.js +11 -0
  329. package/dist/selfieCapture/lighting.d.ts +36 -0
  330. package/dist/selfieCapture/lighting.d.ts.map +1 -0
  331. package/dist/selfieCapture/lighting.js +95 -0
  332. package/dist/selfieCapture/livenessMachine.d.ts +66 -0
  333. package/dist/selfieCapture/livenessMachine.d.ts.map +1 -0
  334. package/dist/selfieCapture/livenessMachine.js +137 -0
  335. package/dist/selfieCapture/pipeline.d.ts +42 -0
  336. package/dist/selfieCapture/pipeline.d.ts.map +1 -0
  337. package/dist/selfieCapture/pipeline.js +282 -0
  338. package/dist/selfieCapture/reducer.d.ts +35 -0
  339. package/dist/selfieCapture/reducer.d.ts.map +1 -0
  340. package/dist/selfieCapture/reducer.js +143 -0
  341. package/dist/selfieCapture/state.d.ts +40 -0
  342. package/dist/selfieCapture/state.d.ts.map +1 -0
  343. package/dist/selfieCapture/state.js +36 -0
  344. package/dist/selfieCapture/testing/challengeFixtures.d.ts +43 -0
  345. package/dist/selfieCapture/testing/challengeFixtures.d.ts.map +1 -0
  346. package/dist/selfieCapture/testing/challengeFixtures.js +43 -0
  347. package/dist/signature/frameDecode.d.ts +48 -0
  348. package/dist/signature/frameDecode.d.ts.map +1 -0
  349. package/dist/signature/frameDecode.js +491 -0
  350. package/dist/signature/index.d.ts +5 -0
  351. package/dist/signature/index.d.ts.map +1 -0
  352. package/dist/signature/index.js +4 -0
  353. package/dist/signature/metadata.d.ts +63 -0
  354. package/dist/signature/metadata.d.ts.map +1 -0
  355. package/dist/signature/metadata.js +1 -0
  356. package/dist/signature/quality.d.ts +169 -0
  357. package/dist/signature/quality.d.ts.map +1 -0
  358. package/dist/signature/quality.js +186 -0
  359. package/dist/signature/signatureValidity.d.ts +149 -0
  360. package/dist/signature/signatureValidity.d.ts.map +1 -0
  361. package/dist/signature/signatureValidity.js +305 -0
  362. package/dist/signatureCapture/controller.d.ts +67 -0
  363. package/dist/signatureCapture/controller.d.ts.map +1 -0
  364. package/dist/signatureCapture/controller.js +534 -0
  365. package/dist/signatureCapture/guidance.d.ts +9 -0
  366. package/dist/signatureCapture/guidance.d.ts.map +1 -0
  367. package/dist/signatureCapture/guidance.js +7 -0
  368. package/dist/signatureCapture/index.d.ts +6 -0
  369. package/dist/signatureCapture/index.d.ts.map +1 -0
  370. package/dist/signatureCapture/index.js +5 -0
  371. package/dist/signatureCapture/pipeline.d.ts +111 -0
  372. package/dist/signatureCapture/pipeline.d.ts.map +1 -0
  373. package/dist/signatureCapture/pipeline.js +680 -0
  374. package/dist/signatureCapture/reducer.d.ts +42 -0
  375. package/dist/signatureCapture/reducer.d.ts.map +1 -0
  376. package/dist/signatureCapture/reducer.js +159 -0
  377. package/dist/signatureCapture/state.d.ts +92 -0
  378. package/dist/signatureCapture/state.d.ts.map +1 -0
  379. package/dist/signatureCapture/state.js +24 -0
  380. package/dist/utils/canvas.d.ts +4 -0
  381. package/dist/utils/canvas.d.ts.map +1 -0
  382. package/dist/utils/canvas.js +21 -0
  383. package/dist/utils/cropping.d.ts +8 -0
  384. package/dist/utils/cropping.d.ts.map +1 -0
  385. package/dist/utils/cropping.js +85 -0
  386. package/dist/utils/dataUrlToBase64.d.ts +7 -0
  387. package/dist/utils/dataUrlToBase64.d.ts.map +1 -0
  388. package/dist/utils/dataUrlToBase64.js +67 -0
  389. package/dist/utils/getFrameDimensions.d.ts +3 -0
  390. package/dist/utils/getFrameDimensions.d.ts.map +1 -0
  391. package/dist/utils/getFrameDimensions.js +12 -0
  392. package/dist/utils/isMobile.d.ts +3 -0
  393. package/dist/utils/isMobile.d.ts.map +1 -0
  394. package/dist/utils/isMobile.js +36 -0
  395. package/dist/utils/logger.d.ts +19 -0
  396. package/dist/utils/logger.d.ts.map +1 -0
  397. package/dist/utils/logger.js +25 -0
  398. package/dist/utils/platform.d.ts +4 -0
  399. package/dist/utils/platform.d.ts.map +1 -0
  400. package/dist/utils/platform.js +11 -0
  401. package/dist/utils/stabilizer.d.ts +26 -0
  402. package/dist/utils/stabilizer.d.ts.map +1 -0
  403. package/dist/utils/stabilizer.js +65 -0
  404. package/dist/version.d.ts +2 -0
  405. package/dist/version.d.ts.map +1 -0
  406. package/dist/version.js +1 -0
  407. package/dist/videoIdCapture/controller.d.ts +108 -0
  408. package/dist/videoIdCapture/controller.d.ts.map +1 -0
  409. package/dist/videoIdCapture/controller.js +833 -0
  410. package/dist/videoIdCapture/index.d.ts +5 -0
  411. package/dist/videoIdCapture/index.d.ts.map +1 -0
  412. package/dist/videoIdCapture/index.js +2 -0
  413. package/dist/videoIdCapture/state.d.ts +88 -0
  414. package/dist/videoIdCapture/state.d.ts.map +1 -0
  415. package/dist/videoIdCapture/state.js +67 -0
  416. package/package.json +111 -0
@@ -0,0 +1,491 @@
1
+ /**
2
+ * Off-screen, post-capture validation that proves a real frame renders at the
3
+ * signature's trim start offset. This is the authoritative detector for the
4
+ * truncated / undecodable signature videos that cause downstream trim failures:
5
+ * those videos look fine to every wall-clock heuristic, but the frame at the
6
+ * signature timecode is past the real decodable end (or the stream is garbage).
7
+ *
8
+ * Two probe strategies, chosen per file:
9
+ * - SEEK: seek to the offset and check the decoder didn't clamp short / drew
10
+ * a real frame. Fast, and correct whenever the browser knows the true end
11
+ * (finalized media, or non-finalized WebM with NO Duration element — the
12
+ * browser is forced to demux to the end).
13
+ * - PLAYBACK: play the stream and read real decoded-frame timestamps via
14
+ * requestVideoFrameCallback. Required for finalized-but-bogus-`Duration`
15
+ * WebM (e.g. MediaRecorder writing `Duration=0.001s`), where the browser
16
+ * CLAMPS seeks to the lie even though the frames physically decode — so a
17
+ * seek-based check false-trips good videos. Playback reaches the real
18
+ * frames regardless.
19
+ *
20
+ * Nothing is shown to the user — both run on a 1px, off-viewport `<video>` and
21
+ * a tiny detached canvas.
22
+ */
23
+ // Mirror the server-side trim padding defaults so the SDK probes the SAME
24
+ // offsets MediaConvert clips at. Keep in sync with
25
+ // api/internal/mediaconvertclient/config.go
26
+ // (MEDIA_CONVERT_SIGNATURE_VIDEO_PADDING_START_MS / _END_MS).
27
+ export const TRIM_PADDING_START_MS = 1000;
28
+ export const TRIM_PADDING_END_MS = 5000;
29
+ // Tuning knobs. Timeouts are generous because the device is decoding a blob it
30
+ // just produced itself — load should be fast — but low-end hardware is exactly
31
+ // the population we care about, so we give it room before failing closed.
32
+ const METADATA_LOAD_TIMEOUT_MS = 8000;
33
+ const DURATION_RESOLVE_TIMEOUT_MS = 4000;
34
+ const SEEK_TIMEOUT_MS = 4000;
35
+ // How far below the requested offset we tolerate the decoder landing before
36
+ // calling it "clamped" (i.e. the frame doesn't exist). Also the slack applied
37
+ // to the beyond-decodable-end comparison.
38
+ const SEEK_TOLERANCE_MS = 600;
39
+ // Luma variance floor for a frame to count as "non-blank". A genuine signature
40
+ // frame (camera background + ink overlay) sits far above this; a
41
+ // black/transparent "no pictures decoded" frame sits at ~0.
42
+ const MIN_LUMA_VARIANCE = 6;
43
+ const PROBE_CANVAS_SIZE = 32;
44
+ // A resolved decodable end below this is never a real signature capture — it
45
+ // means the browser only gave us the bogus container duration (MediaRecorder
46
+ // WebM reports ~0.001s). Treat the seek-resolved end as unusable.
47
+ const MIN_PLAUSIBLE_END_MS = 500;
48
+ // When the seek-resolved end is null, or this small a fraction of the known
49
+ // wall-clock recording length, seeking is unreliable for this file (the browser
50
+ // clamps seeks to a bogus Duration even though the frames decode). Route to the
51
+ // playback path instead. Truncated bad videos keep a much larger fraction
52
+ // (0.4–0.8 in practice) so they stay on the fast seek path.
53
+ const RELIABLE_END_FRACTION = 0.15;
54
+ // Playback-path knobs. Chrome caps playbackRate at 16. The cap bounds the rare
55
+ // slow case (a long, good, bogus-duration capture); on cap we FAIL OPEN (treat
56
+ // the unreached probe as rendered) so we never re-introduce a false trip on a
57
+ // good video.
58
+ const PLAYBACK_RATE = 16;
59
+ const PLAYBACK_CAP_MS = 8000;
60
+ /**
61
+ * Pure decision for a single probe. Extracted from the DOM orchestration so the
62
+ * "is this frame real?" logic is unit-testable without a browser.
63
+ */
64
+ export function classifyProbe(input) {
65
+ const { requestedMs, seekableEndMs, seekedToMs, lumaVariance } = input;
66
+ // Definitive: the requested point is past what the container says is
67
+ // decodable. The trim will fail here.
68
+ if (seekableEndMs != null &&
69
+ requestedMs > seekableEndMs + SEEK_TOLERANCE_MS) {
70
+ return {
71
+ requestedMs,
72
+ seekedToMs,
73
+ rendered: false,
74
+ reason: 'beyond-decodable-end',
75
+ };
76
+ }
77
+ if (seekedToMs == null) {
78
+ return {
79
+ requestedMs,
80
+ seekedToMs: null,
81
+ rendered: false,
82
+ reason: 'seek-failed',
83
+ };
84
+ }
85
+ // The decoder clamped the seek well short of where we asked — the frame at
86
+ // `requestedMs` does not exist even though the container didn't advertise a
87
+ // shorter end.
88
+ if (seekedToMs + SEEK_TOLERANCE_MS < requestedMs) {
89
+ return { requestedMs, seekedToMs, rendered: false, reason: 'clamped-short' };
90
+ }
91
+ // Couldn't sample pixels — accept the successful seek as sufficient
92
+ // evidence rather than risk a false fail.
93
+ if (lumaVariance == null) {
94
+ return {
95
+ requestedMs,
96
+ seekedToMs,
97
+ rendered: true,
98
+ reason: 'pixels-unverified',
99
+ };
100
+ }
101
+ // Seeked to the right place but nothing decoded — garbage stream.
102
+ if (lumaVariance < MIN_LUMA_VARIANCE) {
103
+ return { requestedMs, seekedToMs, rendered: false, reason: 'blank-frame' };
104
+ }
105
+ return { requestedMs, seekedToMs, rendered: true };
106
+ }
107
+ /** Variance of per-pixel luma over RGBA bytes. Pure; unit-testable. */
108
+ export function lumaVariance(data) {
109
+ let sum = 0;
110
+ let sumSq = 0;
111
+ let n = 0;
112
+ for (let i = 0; i + 3 < data.length; i += 4) {
113
+ const luma = 0.299 * data[i] + 0.587 * data[i + 1] + 0.114 * data[i + 2];
114
+ sum += luma;
115
+ sumSq += luma * luma;
116
+ n++;
117
+ }
118
+ if (n === 0)
119
+ return 0;
120
+ const mean = sum / n;
121
+ return Math.max(0, sumSq / n - mean * mean);
122
+ }
123
+ const skipped = () => ({
124
+ value: 'skipped',
125
+ tripped: false,
126
+ durationReportedMs: null,
127
+ seekableEndMs: null,
128
+ usedPlayback: false,
129
+ probes: [],
130
+ });
131
+ /**
132
+ * Decode `blob` off-screen and confirm a real frame renders at each offset in
133
+ * `probeTimesMs`. Resolves `{ value:'skipped', tripped:false }` when there's no
134
+ * DOM to run in (SSR/Node) — the caller treats "didn't run" as "no objection".
135
+ */
136
+ export async function validateDecodableFrames(blob, probeTimesMs, opts = {}) {
137
+ if (typeof document === 'undefined' || typeof URL === 'undefined') {
138
+ return skipped();
139
+ }
140
+ // No offsets to probe — there's nothing to validate, so raise no objection
141
+ // rather than fail closed (an empty `probes` array would otherwise read as
142
+ // "not all rendered" below).
143
+ if (probeTimesMs.length === 0) {
144
+ return skipped();
145
+ }
146
+ const url = URL.createObjectURL(blob);
147
+ const video = document.createElement('video');
148
+ video.muted = true;
149
+ video.defaultMuted = true;
150
+ video.playsInline = true;
151
+ video.preload = 'auto';
152
+ // Off-screen but in the DOM — some engines won't decode/seek a fully
153
+ // detached element. Visually inert, removed from layout and a11y.
154
+ video.setAttribute('aria-hidden', 'true');
155
+ Object.assign(video.style, {
156
+ position: 'fixed',
157
+ left: '-9999px',
158
+ top: '0',
159
+ width: '1px',
160
+ height: '1px',
161
+ opacity: '0',
162
+ pointerEvents: 'none',
163
+ });
164
+ document.body.appendChild(video);
165
+ const cleanup = () => {
166
+ try {
167
+ video.pause();
168
+ video.removeAttribute('src');
169
+ video.load();
170
+ }
171
+ catch {
172
+ // best-effort teardown
173
+ }
174
+ video.remove();
175
+ URL.revokeObjectURL(url);
176
+ };
177
+ try {
178
+ video.src = url;
179
+ await waitForEvent(video, 'loadedmetadata', METADATA_LOAD_TIMEOUT_MS);
180
+ const seekableEndMs = await resolveSeekableEndMs(video);
181
+ const durationReportedMs = Number.isFinite(video.duration) && video.duration > 0
182
+ ? video.duration * 1000
183
+ : null;
184
+ const canvas = document.createElement('canvas');
185
+ canvas.width = PROBE_CANVAS_SIZE;
186
+ canvas.height = PROBE_CANVAS_SIZE;
187
+ const ctx = canvas.getContext('2d', { willReadFrequently: true });
188
+ // Choose the probe strategy. Trust seeking only when the resolved end is a
189
+ // real, plausible value relative to the wall-clock recording length; else
190
+ // the browser's seek model is broken for this file — use playback.
191
+ const seekReliable = seekableEndMs != null &&
192
+ (opts.wallClockMs == null ||
193
+ opts.wallClockMs <= 0 ||
194
+ seekableEndMs >= opts.wallClockMs * RELIABLE_END_FRACTION);
195
+ const probes = seekReliable
196
+ ? await seekProbes(video, ctx, canvas, probeTimesMs, seekableEndMs)
197
+ : await playbackProbes(video, ctx, canvas, probeTimesMs);
198
+ const allRendered = probes.length > 0 && probes.every((p) => p.rendered);
199
+ return {
200
+ value: allRendered ? 'passed' : 'failed',
201
+ tripped: !allRendered,
202
+ durationReportedMs,
203
+ seekableEndMs,
204
+ usedPlayback: !seekReliable,
205
+ probes,
206
+ };
207
+ }
208
+ catch (e) {
209
+ // Failing to even load/seek the just-recorded blob is itself evidence of a
210
+ // bad capture — fail closed.
211
+ return {
212
+ value: 'failed',
213
+ tripped: true,
214
+ durationReportedMs: null,
215
+ seekableEndMs: null,
216
+ usedPlayback: false,
217
+ probes: [],
218
+ error: e instanceof Error ? e.message : String(e),
219
+ };
220
+ }
221
+ finally {
222
+ cleanup();
223
+ }
224
+ }
225
+ async function probeFrame(video, ctx, canvas, requestedMs, seekableEndMs) {
226
+ // Short-circuit: no need to seek if the container already tells us the point
227
+ // is past the decodable end.
228
+ if (seekableEndMs != null &&
229
+ requestedMs > seekableEndMs + SEEK_TOLERANCE_MS) {
230
+ return classifyProbe({
231
+ requestedMs,
232
+ seekableEndMs,
233
+ seekedToMs: seekableEndMs,
234
+ lumaVariance: null,
235
+ });
236
+ }
237
+ let seekedToMs = null;
238
+ try {
239
+ await seekTo(video, requestedMs / 1000, SEEK_TIMEOUT_MS);
240
+ seekedToMs = video.currentTime * 1000;
241
+ }
242
+ catch {
243
+ return classifyProbe({
244
+ requestedMs,
245
+ seekableEndMs,
246
+ seekedToMs: null,
247
+ lumaVariance: null,
248
+ });
249
+ }
250
+ let variance = null;
251
+ if (ctx) {
252
+ try {
253
+ ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
254
+ variance = lumaVariance(ctx.getImageData(0, 0, canvas.width, canvas.height).data);
255
+ }
256
+ catch {
257
+ // drawImage/getImageData throws when no decoded frame is available.
258
+ return classifyProbe({
259
+ requestedMs,
260
+ seekableEndMs,
261
+ seekedToMs,
262
+ lumaVariance: 0,
263
+ });
264
+ }
265
+ }
266
+ return classifyProbe({
267
+ requestedMs,
268
+ seekableEndMs,
269
+ seekedToMs,
270
+ lumaVariance: variance,
271
+ });
272
+ }
273
+ /** Seek path: probe each offset by seeking to it. Fast; correct when the
274
+ * browser knows the real decodable end. */
275
+ async function seekProbes(video, ctx, canvas, probeTimesMs, seekableEndMs) {
276
+ const probes = [];
277
+ for (const requestedMs of probeTimesMs) {
278
+ probes.push(await probeFrame(video, ctx, canvas, requestedMs, seekableEndMs));
279
+ }
280
+ return probes;
281
+ }
282
+ /**
283
+ * Playback path: PLAY the stream and read real decoded-frame timestamps via
284
+ * requestVideoFrameCallback. A frame exists at a probe offset iff playback's
285
+ * mediaTime reaches it before the stream ends. Used when seeking is unreliable
286
+ * (finalized bogus-`Duration` WebM, where the browser clamps seeks to the lie
287
+ * even though the frames decode fine). Early-exits as soon as the largest probe
288
+ * offset is reached, so the common pass case is cheap.
289
+ */
290
+ async function playbackProbes(video, ctx, canvas, probeTimesMs) {
291
+ const targets = probeTimesMs.map((ms) => ({
292
+ ms,
293
+ result: null,
294
+ }));
295
+ const maxTargetMs = probeTimesMs.length ? Math.max(...probeTimesMs) : 0;
296
+ let maxMediaMs = 0;
297
+ // resolveSeekableEndMs left currentTime at the end; rewind to play from 0.
298
+ await seekTo(video, 0, SEEK_TIMEOUT_MS).catch(() => { });
299
+ await new Promise((resolve) => {
300
+ let settled = false;
301
+ let rvfcHandle;
302
+ const hasRVFC = typeof video.requestVideoFrameCallback === 'function';
303
+ const finish = () => {
304
+ if (settled)
305
+ return;
306
+ settled = true;
307
+ clearTimeout(cap);
308
+ video.removeEventListener('ended', finish);
309
+ video.removeEventListener('timeupdate', onTimeUpdate);
310
+ if (rvfcHandle !== undefined &&
311
+ typeof video.cancelVideoFrameCallback === 'function') {
312
+ video.cancelVideoFrameCallback(rvfcHandle);
313
+ }
314
+ try {
315
+ video.pause();
316
+ }
317
+ catch {
318
+ // best effort
319
+ }
320
+ resolve();
321
+ };
322
+ const grab = (mediaSec) => {
323
+ if (mediaSec * 1000 > maxMediaMs)
324
+ maxMediaMs = mediaSec * 1000;
325
+ for (const t of targets) {
326
+ if (t.result != null)
327
+ continue;
328
+ if (maxMediaMs + SEEK_TOLERANCE_MS < t.ms)
329
+ continue;
330
+ let variance = null;
331
+ if (ctx) {
332
+ try {
333
+ ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
334
+ variance = lumaVariance(ctx.getImageData(0, 0, canvas.width, canvas.height).data);
335
+ }
336
+ catch {
337
+ variance = 0;
338
+ }
339
+ }
340
+ const nonBlank = variance == null || variance >= MIN_LUMA_VARIANCE;
341
+ t.result = {
342
+ requestedMs: t.ms,
343
+ seekedToMs: Math.round(maxMediaMs),
344
+ rendered: nonBlank,
345
+ reason: nonBlank ? 'playback' : 'blank-frame',
346
+ };
347
+ }
348
+ if (targets.every((t) => t.result != null) || maxMediaMs >= maxTargetMs) {
349
+ finish();
350
+ }
351
+ };
352
+ const onFrame = (_now, meta) => {
353
+ grab(meta.mediaTime);
354
+ if (!settled && hasRVFC) {
355
+ rvfcHandle = video.requestVideoFrameCallback(onFrame);
356
+ }
357
+ };
358
+ const onTimeUpdate = () => grab(video.currentTime);
359
+ const cap = setTimeout(finish, PLAYBACK_CAP_MS);
360
+ video.addEventListener('ended', finish, { once: true });
361
+ try {
362
+ video.playbackRate = PLAYBACK_RATE;
363
+ }
364
+ catch {
365
+ // some engines reject high rates — default rate still works
366
+ }
367
+ if (hasRVFC) {
368
+ rvfcHandle = video.requestVideoFrameCallback(onFrame);
369
+ }
370
+ else {
371
+ video.addEventListener('timeupdate', onTimeUpdate);
372
+ }
373
+ video.play().catch(finish);
374
+ });
375
+ // Resolve any target playback never reached: if the stream ENDED, the frame
376
+ // is genuinely past the decodable end → not rendered (trip). If we stopped on
377
+ // the wall-clock cap, FAIL OPEN (rendered) so a long good capture is never
378
+ // falsely flagged.
379
+ for (const t of targets) {
380
+ if (t.result != null)
381
+ continue;
382
+ const beyondEnd = video.ended;
383
+ t.result = {
384
+ requestedMs: t.ms,
385
+ seekedToMs: Math.round(maxMediaMs),
386
+ rendered: !beyondEnd,
387
+ reason: beyondEnd ? 'beyond-decodable-end' : 'decode-budget-exceeded',
388
+ };
389
+ }
390
+ return targets.map((t) => t.result);
391
+ }
392
+ function waitForEvent(el, name, timeoutMs) {
393
+ return new Promise((resolve, reject) => {
394
+ let done = false;
395
+ const finish = (err) => {
396
+ if (done)
397
+ return;
398
+ done = true;
399
+ clearTimeout(timer);
400
+ el.removeEventListener(name, onOk);
401
+ el.removeEventListener('error', onErr);
402
+ if (err)
403
+ reject(err);
404
+ else
405
+ resolve();
406
+ };
407
+ const onOk = () => finish();
408
+ const onErr = () => finish(new Error(`${name}: media error`));
409
+ const timer = setTimeout(() => finish(new Error(`${name}: timeout`)), timeoutMs);
410
+ el.addEventListener(name, onOk, { once: true });
411
+ el.addEventListener('error', onErr, { once: true });
412
+ });
413
+ }
414
+ /**
415
+ * Find the real decodable end. We CANNOT trust `video.duration` here:
416
+ * MediaRecorder / streamed WebM has no finalized Duration element, so the
417
+ * browser reports either Infinity or a bogus tiny value (e.g. 0.001s) at
418
+ * `loadedmetadata` — even though the stream has seconds of real frames. So we
419
+ * always force the browser to demux to the end by seeking past it, which makes
420
+ * it compute the true duration + seekable range, then read those settled
421
+ * values. Harmless for already-finalized media (it just seeks to the end).
422
+ */
423
+ async function resolveSeekableEndMs(video) {
424
+ await forceEndResolution(video);
425
+ const seekableEndMs = video.seekable && video.seekable.length > 0
426
+ ? video.seekable.end(video.seekable.length - 1) * 1000
427
+ : null;
428
+ const durationMs = Number.isFinite(video.duration) && video.duration > 0
429
+ ? video.duration * 1000
430
+ : null;
431
+ const resolved = seekableEndMs != null && durationMs != null
432
+ ? Math.max(seekableEndMs, durationMs)
433
+ : (seekableEndMs ?? durationMs);
434
+ // Distrust an implausibly small end — the browser only handed us the bogus
435
+ // container duration. Returning null lets the seek-clamp / blank-frame checks
436
+ // decide instead of raising a spurious beyond-decodable-end.
437
+ if (resolved == null || resolved < MIN_PLAUSIBLE_END_MS)
438
+ return null;
439
+ return resolved;
440
+ }
441
+ /**
442
+ * Seek past the end to force the browser to demux the whole stream and settle
443
+ * the real duration / seekable range. Resolves on `seeked` or a timeout.
444
+ */
445
+ function forceEndResolution(video) {
446
+ return new Promise((resolve) => {
447
+ let done = false;
448
+ const finish = () => {
449
+ if (done)
450
+ return;
451
+ done = true;
452
+ clearTimeout(timer);
453
+ video.removeEventListener('seeked', onSeeked);
454
+ resolve();
455
+ };
456
+ const onSeeked = () => finish();
457
+ const timer = setTimeout(finish, DURATION_RESOLVE_TIMEOUT_MS);
458
+ video.addEventListener('seeked', onSeeked, { once: true });
459
+ try {
460
+ video.currentTime = 1e101;
461
+ }
462
+ catch {
463
+ finish();
464
+ }
465
+ });
466
+ }
467
+ function seekTo(video, seconds, timeoutMs) {
468
+ return new Promise((resolve, reject) => {
469
+ let done = false;
470
+ const finish = (err) => {
471
+ if (done)
472
+ return;
473
+ done = true;
474
+ clearTimeout(timer);
475
+ video.removeEventListener('seeked', onSeeked);
476
+ if (err)
477
+ reject(err);
478
+ else
479
+ resolve();
480
+ };
481
+ const onSeeked = () => finish();
482
+ const timer = setTimeout(() => finish(new Error('seek: timeout')), timeoutMs);
483
+ video.addEventListener('seeked', onSeeked, { once: true });
484
+ try {
485
+ video.currentTime = seconds;
486
+ }
487
+ catch (e) {
488
+ finish(e instanceof Error ? e : new Error('seek: threw'));
489
+ }
490
+ });
491
+ }
@@ -0,0 +1,5 @@
1
+ export * from './signatureValidity';
2
+ export * from './frameDecode';
3
+ export * from './quality';
4
+ export * from './metadata';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/signature/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,eAAe,CAAA;AAC7B,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA"}
@@ -0,0 +1,4 @@
1
+ export * from './signatureValidity';
2
+ export * from './frameDecode';
3
+ export * from './quality';
4
+ export * from './metadata';
@@ -0,0 +1,63 @@
1
+ import type { SignatureValidityResult } from './signatureValidity';
2
+ import type { RecorderState, VideoSignatureQualityWarning } from './quality';
3
+ export type VideoChunkRateStats = {
4
+ averageRate: number;
5
+ minRate: number;
6
+ maxRate: number;
7
+ totalChunksReceived: number;
8
+ recordingDurationMs: number;
9
+ };
10
+ export type VideoSignatureMetadata = {
11
+ mimeType?: string;
12
+ browserFeatures?: {
13
+ supportsRequestVideoFrameCallback?: boolean;
14
+ supportsRoundRect?: boolean;
15
+ };
16
+ diagnostics?: {
17
+ nullChunksReceived?: number;
18
+ firstNullChunkReceivedAt?: number;
19
+ lastNullChunkReceivedAt?: number;
20
+ finalChunkReceived?: boolean;
21
+ finalChunkTimedOut?: boolean;
22
+ finalChunkWaitedMs?: number;
23
+ videoChunkRate?: VideoChunkRateStats;
24
+ timesSignatureCleared?: number;
25
+ totalFramesDrawn?: number;
26
+ framesWithSignatureDrawn?: number;
27
+ maxFrameGapMs?: number;
28
+ visibilityChanges?: Array<{
29
+ state: string;
30
+ at: number;
31
+ }>;
32
+ wasHiddenDuringCapture?: boolean;
33
+ signingWindowFrameCount?: number;
34
+ signingWindowFps?: number;
35
+ videoElementNotReadyCount?: number;
36
+ /** Set only when the recorder left `recording` without being asked to:
37
+ * the state it was found in, when (`io.now()`), and the `onerror` detail
38
+ * if that is what surfaced it. */
39
+ recorderDiedState?: RecorderState;
40
+ recorderDiedAt?: number;
41
+ recorderDiedError?: string;
42
+ qualityWarning?: VideoSignatureQualityWarning;
43
+ };
44
+ timingData?: {
45
+ recordingStartRequestedAt?: number;
46
+ recordingStartedAt?: number;
47
+ firstChunkReceivedAt?: number;
48
+ signatureStartedAt?: number;
49
+ signatureEndedAt?: number;
50
+ acceptClickedAt?: number;
51
+ clearClickedAt?: number;
52
+ recordingStopRequestedAt?: number;
53
+ lastChunkReceivedAt?: number;
54
+ recordingStoppedAt?: number;
55
+ };
56
+ /**
57
+ * Post-accept signature-validity estimate (AMEXDESK-676). Advisory: surfaced
58
+ * for tuning/telemetry, not used to block capture. `concern` is true when the
59
+ * signature looks too simple to plausibly be real.
60
+ */
61
+ signatureValidity?: SignatureValidityResult;
62
+ };
63
+ //# sourceMappingURL=metadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../src/signature/metadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,4BAA4B,EAAE,MAAM,WAAW,CAAA;AAE5E,MAAM,MAAM,mBAAmB,GAAG;IAChC,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,mBAAmB,EAAE,MAAM,CAAA;IAC3B,mBAAmB,EAAE,MAAM,CAAA;CAC5B,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,eAAe,CAAC,EAAE;QAChB,iCAAiC,CAAC,EAAE,OAAO,CAAA;QAC3C,iBAAiB,CAAC,EAAE,OAAO,CAAA;KAC5B,CAAA;IACD,WAAW,CAAC,EAAE;QACZ,kBAAkB,CAAC,EAAE,MAAM,CAAA;QAC3B,wBAAwB,CAAC,EAAE,MAAM,CAAA;QACjC,uBAAuB,CAAC,EAAE,MAAM,CAAA;QAChC,kBAAkB,CAAC,EAAE,OAAO,CAAA;QAC5B,kBAAkB,CAAC,EAAE,OAAO,CAAA;QAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAA;QAC3B,cAAc,CAAC,EAAE,mBAAmB,CAAA;QACpC,qBAAqB,CAAC,EAAE,MAAM,CAAA;QAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAA;QACzB,wBAAwB,CAAC,EAAE,MAAM,CAAA;QACjC,aAAa,CAAC,EAAE,MAAM,CAAA;QACtB,iBAAiB,CAAC,EAAE,KAAK,CAAC;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,EAAE,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;QACxD,sBAAsB,CAAC,EAAE,OAAO,CAAA;QAChC,uBAAuB,CAAC,EAAE,MAAM,CAAA;QAChC,gBAAgB,CAAC,EAAE,MAAM,CAAA;QACzB,yBAAyB,CAAC,EAAE,MAAM,CAAA;QAClC;;0CAEkC;QAClC,iBAAiB,CAAC,EAAE,aAAa,CAAA;QACjC,cAAc,CAAC,EAAE,MAAM,CAAA;QACvB,iBAAiB,CAAC,EAAE,MAAM,CAAA;QAC1B,cAAc,CAAC,EAAE,4BAA4B,CAAA;KAC9C,CAAA;IACD,UAAU,CAAC,EAAE;QACX,yBAAyB,CAAC,EAAE,MAAM,CAAA;QAClC,kBAAkB,CAAC,EAAE,MAAM,CAAA;QAC3B,oBAAoB,CAAC,EAAE,MAAM,CAAA;QAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAA;QAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAA;QACzB,eAAe,CAAC,EAAE,MAAM,CAAA;QACxB,cAAc,CAAC,EAAE,MAAM,CAAA;QACvB,wBAAwB,CAAC,EAAE,MAAM,CAAA;QACjC,mBAAmB,CAAC,EAAE,MAAM,CAAA;QAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAA;KAC5B,CAAA;IACD;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,uBAAuB,CAAA;CAC5C,CAAA"}
@@ -0,0 +1 @@
1
+ export {};