@idmission/websdk-ui 0.2.0-rc.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +135 -56
- package/dist/DocumentCaptureView.d.ts +37 -0
- package/dist/DocumentCaptureView.d.ts.map +1 -1
- package/dist/DocumentCaptureView.js +489 -6
- package/dist/FaceLivenessView.d.ts +1 -1
- package/dist/FaceLivenessView.d.ts.map +1 -1
- package/dist/FaceLivenessView.js +37 -29
- package/dist/IdCaptureView.d.ts +6 -5
- package/dist/IdCaptureView.d.ts.map +1 -1
- package/dist/IdCaptureView.js +52 -12
- package/dist/SelfieCaptureView.d.ts +1 -1
- package/dist/SelfieCaptureView.d.ts.map +1 -1
- package/dist/SelfieCaptureView.js +6 -3
- package/dist/SignatureCaptureView.d.ts +9 -1
- package/dist/SignatureCaptureView.d.ts.map +1 -1
- package/dist/SignatureCaptureView.js +51 -10
- package/dist/VideoIdCaptureView.d.ts +1 -1
- package/dist/VideoIdCaptureView.d.ts.map +1 -1
- package/dist/VideoIdCaptureView.js +24 -4
- package/dist/components/CameraFeed.d.ts +11 -3
- package/dist/components/CameraFeed.d.ts.map +1 -1
- package/dist/components/CameraFeed.js +24 -4
- package/dist/components/barcode/BarcodeGuideOverlay.d.ts +7 -1
- package/dist/components/barcode/BarcodeGuideOverlay.d.ts.map +1 -1
- package/dist/components/barcode/BarcodeGuideOverlay.js +2 -2
- package/dist/components/debug/debug.d.ts +4 -4
- package/dist/components/document/DocumentCaptureAutoCaptureDebugLayer.d.ts +29 -0
- package/dist/components/document/DocumentCaptureAutoCaptureDebugLayer.d.ts.map +1 -0
- package/dist/components/document/DocumentCaptureAutoCaptureDebugLayer.js +274 -0
- package/dist/components/document/DocumentCaptureAutoCaptureGuidance.d.ts +56 -0
- package/dist/components/document/DocumentCaptureAutoCaptureGuidance.d.ts.map +1 -0
- package/dist/components/document/DocumentCaptureAutoCaptureGuidance.js +101 -0
- package/dist/components/document/DocumentCaptureGuideOverlay.d.ts +31 -1
- package/dist/components/document/DocumentCaptureGuideOverlay.d.ts.map +1 -1
- package/dist/components/document/DocumentCaptureGuideOverlay.js +121 -2
- package/dist/components/document/DocumentCaptureReviewScreen.d.ts +44 -0
- package/dist/components/document/DocumentCaptureReviewScreen.d.ts.map +1 -0
- package/dist/components/document/DocumentCaptureReviewScreen.js +40 -0
- package/dist/components/document/types.d.ts +25 -0
- package/dist/components/document/types.d.ts.map +1 -1
- package/dist/components/document/types.js +18 -1
- package/dist/components/guides/IdCaptureGuides.d.ts.map +1 -1
- package/dist/components/guides/IdCaptureGuides.js +3 -4
- package/dist/components/review/ReviewScreen.d.ts.map +1 -1
- package/dist/components/review/ReviewScreen.js +1 -1
- package/dist/components/review/SignatureCaptureDiagnostics.d.ts +50 -0
- package/dist/components/review/SignatureCaptureDiagnostics.d.ts.map +1 -0
- package/dist/components/review/SignatureCaptureDiagnostics.js +142 -0
- package/dist/components/selfie/SelfieCaptureSurface.d.ts +11 -2
- package/dist/components/selfie/SelfieCaptureSurface.d.ts.map +1 -1
- package/dist/components/selfie/SelfieCaptureSurface.js +5 -2
- package/dist/components/videoId/VideoIdCaptureGuides.d.ts +4 -1
- package/dist/components/videoId/VideoIdCaptureGuides.d.ts.map +1 -1
- package/dist/components/videoId/VideoIdCaptureGuides.js +2 -2
- package/dist/flows/CompositeWizard.d.ts +5 -0
- package/dist/flows/CompositeWizard.d.ts.map +1 -1
- package/dist/flows/CompositeWizard.js +2 -1
- package/dist/flows/DocumentCaptureFlow.d.ts +1 -1
- package/dist/flows/DocumentCaptureFlow.d.ts.map +1 -1
- package/dist/flows/DocumentCaptureFlow.js +6 -6
- package/dist/flows/SubmissionProvider.d.ts.map +1 -1
- package/dist/flows/SubmissionProvider.js +2 -4
- package/dist/flows/approval.d.ts +15 -0
- package/dist/flows/approval.d.ts.map +1 -0
- package/dist/flows/approval.js +19 -0
- package/dist/flows/autoCaptureMountGuard.d.ts +22 -0
- package/dist/flows/autoCaptureMountGuard.d.ts.map +1 -0
- package/dist/flows/autoCaptureMountGuard.js +61 -0
- package/dist/flows/ringScreens.d.ts +0 -3
- package/dist/flows/ringScreens.d.ts.map +1 -1
- package/dist/flows/ringScreens.js +2 -3
- package/dist/guidance/selfieStrings.d.ts +9 -1
- package/dist/guidance/selfieStrings.d.ts.map +1 -1
- package/dist/guidance/selfieStrings.js +59 -20
- package/dist/i18n/index.d.ts +28 -1177
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js +58 -22
- package/dist/i18n/locales/threeOh.d.ts +4 -0
- package/dist/i18n/locales/threeOh.d.ts.map +1 -0
- package/dist/i18n/locales/threeOh.js +105 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/testing/autoCaptureFrames.d.ts +23 -0
- package/dist/testing/autoCaptureFrames.d.ts.map +1 -0
- package/dist/testing/autoCaptureFrames.js +187 -0
- package/dist/testing/fakeDocumentController.d.ts +7 -1
- package/dist/testing/fakeDocumentController.d.ts.map +1 -1
- package/dist/testing/fakeDocumentController.js +10 -2
- package/dist/testing/index.d.ts +1 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +1 -0
- package/dist/useIdmissionClient.d.ts +29 -0
- package/dist/useIdmissionClient.d.ts.map +1 -0
- package/dist/useIdmissionClient.js +44 -0
- package/dist/utils/canvas.d.ts.map +1 -1
- package/dist/utils/canvas.js +41 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -2
package/dist/i18n/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/i18n/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/i18n/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,aA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f,MAAM,GAAG,YAAY,CAOvB;AAED,wBAAgB,eAAe,CAC7B,CAAC,SAAS;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,uBAAuB,CAAA;CAAE,EAEpD,QAAQ,EAAE,CAAC,GAAG,SAAS,EACvB,SAAS,EAAE;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,MAAM;CAAE,GACpC;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,MAAM,GAAG,YAAY;CAAE,CAqB3C"}
|
package/dist/i18n/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useEffect, useMemo } from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { createContext, createElement, useContext, useEffect, useMemo, } from 'react';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
3
|
import LanguageDetector from 'i18next-browser-languagedetector';
|
|
4
|
-
import
|
|
4
|
+
import { createInstance } from 'i18next';
|
|
5
5
|
import en from './locales/en';
|
|
6
6
|
import es from './locales/es';
|
|
7
7
|
import de from './locales/de';
|
|
@@ -11,6 +11,7 @@ import ja from './locales/ja';
|
|
|
11
11
|
import pt from './locales/pt';
|
|
12
12
|
import ru from './locales/ru';
|
|
13
13
|
import zh from './locales/zh';
|
|
14
|
+
import { withThreeOhTranslations } from './locales/threeOh';
|
|
14
15
|
import { renderVerbiage } from './render';
|
|
15
16
|
// Re-exported: consumers (Tasks 8-12) resolve CustomerSuppliedVerbiage-shaped
|
|
16
17
|
// values themselves in places that don't go through useVerbiage/useTranslations.
|
|
@@ -27,31 +28,66 @@ export const ALL_LANGUAGES = [
|
|
|
27
28
|
'ru',
|
|
28
29
|
'zh',
|
|
29
30
|
];
|
|
31
|
+
// The eight locale files are byte-identical mirrors of sdk2's and stay that
|
|
32
|
+
// way; `threeOh.ts` layers 3.0-only translations over them at init. See that
|
|
33
|
+
// file's header for why the split is structural rather than a convention.
|
|
34
|
+
// `en` is untouched: English source strings ARE the keys.
|
|
30
35
|
export const resources = {
|
|
31
36
|
en: { translation: en },
|
|
32
|
-
es: { translation: es },
|
|
33
|
-
de: { translation: de },
|
|
34
|
-
fr: { translation: fr },
|
|
35
|
-
it: { translation: it },
|
|
36
|
-
ja: { translation: ja },
|
|
37
|
-
pt: { translation: pt },
|
|
38
|
-
ru: { translation: ru },
|
|
39
|
-
zh: { translation: zh },
|
|
37
|
+
es: { translation: withThreeOhTranslations('es', es) },
|
|
38
|
+
de: { translation: withThreeOhTranslations('de', de) },
|
|
39
|
+
fr: { translation: withThreeOhTranslations('fr', fr) },
|
|
40
|
+
it: { translation: withThreeOhTranslations('it', it) },
|
|
41
|
+
ja: { translation: withThreeOhTranslations('ja', ja) },
|
|
42
|
+
pt: { translation: withThreeOhTranslations('pt', pt) },
|
|
43
|
+
ru: { translation: withThreeOhTranslations('ru', ru) },
|
|
44
|
+
zh: { translation: withThreeOhTranslations('zh', zh) },
|
|
40
45
|
};
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
const sdkI18n = createInstance();
|
|
47
|
+
let initializationStarted = false;
|
|
48
|
+
function initializeSdkI18n() {
|
|
49
|
+
if (initializationStarted)
|
|
50
|
+
return;
|
|
51
|
+
initializationStarted = true;
|
|
52
|
+
void sdkI18n.use(LanguageDetector).init({
|
|
46
53
|
resources,
|
|
47
54
|
detection: { caches: [] },
|
|
48
55
|
fallbackLng: 'en',
|
|
49
56
|
debug: false,
|
|
57
|
+
initImmediate: false,
|
|
50
58
|
interpolation: { escapeValue: false },
|
|
51
59
|
});
|
|
52
60
|
}
|
|
61
|
+
initializeSdkI18n();
|
|
62
|
+
const detectedLanguage = sdkI18n.language || 'en';
|
|
63
|
+
const SdkLanguageContext = createContext(undefined);
|
|
64
|
+
/**
|
|
65
|
+
* Binds one rendered SDK tree to its requested language. A fixed translator
|
|
66
|
+
* avoids waiting for a post-render changeLanguage() effect and keeps SSR and
|
|
67
|
+
* concurrently mounted SDK views independent of the shared detector instance.
|
|
68
|
+
*/
|
|
69
|
+
export function SdkLanguageProvider({ children, lang, }) {
|
|
70
|
+
return createElement(SdkLanguageContext.Provider, { value: lang === 'auto' ? detectedLanguage : lang }, children);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* @deprecated UI translations initialize automatically. Existing calls are
|
|
74
|
+
* retained as an idempotent compatibility shim.
|
|
75
|
+
*/
|
|
76
|
+
export function initializeI18n() {
|
|
77
|
+
initializeSdkI18n();
|
|
78
|
+
}
|
|
79
|
+
export function useSdkTranslation() {
|
|
80
|
+
const scopedLanguage = useContext(SdkLanguageContext);
|
|
81
|
+
const { t: detectedT, i18n } = useTranslation(undefined, { i18n: sdkI18n });
|
|
82
|
+
const t = useMemo(() => scopedLanguage === undefined ? detectedT : i18n.getFixedT(scopedLanguage), [detectedT, i18n, scopedLanguage]);
|
|
83
|
+
return {
|
|
84
|
+
t,
|
|
85
|
+
i18n,
|
|
86
|
+
language: scopedLanguage ?? i18n.language,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
53
89
|
export const useLanguage = (lang) => {
|
|
54
|
-
const { i18n } =
|
|
90
|
+
const { i18n } = useSdkTranslation();
|
|
55
91
|
useEffect(() => {
|
|
56
92
|
if (lang !== 'auto') {
|
|
57
93
|
void i18n.changeLanguage(lang);
|
|
@@ -77,16 +113,16 @@ function evaluateVerbiage(t, currentLanguage, verbiage, fallback) {
|
|
|
77
113
|
return t(fallback);
|
|
78
114
|
}
|
|
79
115
|
export function useVerbiage(verbiage, fallback) {
|
|
80
|
-
const { t,
|
|
81
|
-
return useMemo(() => evaluateVerbiage(t,
|
|
116
|
+
const { t, language } = useSdkTranslation();
|
|
117
|
+
return useMemo(() => evaluateVerbiage(t, language, verbiage, fallback), [fallback, language, t, verbiage]);
|
|
82
118
|
}
|
|
83
119
|
export function useTranslations(verbiage, fallbacks) {
|
|
84
|
-
const { t,
|
|
120
|
+
const { t, language } = useSdkTranslation();
|
|
85
121
|
return useMemo(() => ({
|
|
86
122
|
...verbiage,
|
|
87
123
|
...Object.keys(fallbacks).reduce((result, key) => ({
|
|
88
124
|
...result,
|
|
89
|
-
[key]: evaluateVerbiage(t,
|
|
125
|
+
[key]: evaluateVerbiage(t, language, verbiage?.[key], fallbacks[key]),
|
|
90
126
|
}), {}),
|
|
91
|
-
}), [fallbacks,
|
|
127
|
+
}), [fallbacks, language, t, verbiage]);
|
|
92
128
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const threeOhTranslations: Record<string, Record<string, string>>;
|
|
2
|
+
/** Base entries win nothing — the supplement may only ADD. See `noShadowing`. */
|
|
3
|
+
export declare function withThreeOhTranslations(lang: string, base: Record<string, string>): Record<string, string>;
|
|
4
|
+
//# sourceMappingURL=threeOh.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"threeOh.d.ts","sourceRoot":"","sources":["../../../src/i18n/locales/threeOh.ts"],"names":[],"mappings":"AAsDA,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA+DtE,CAAA;AAED,iFAAiF;AACjF,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC3B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAExB"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
// Translations 3.0 owns, merged OVER the eight sdk2-mirrored locale files.
|
|
2
|
+
//
|
|
3
|
+
// WHY THIS FILE EXISTS AS A SEPARATE LAYER
|
|
4
|
+
//
|
|
5
|
+
// `localeParity.test.ts` assertion 4 asserts each of `de/es/fr/it/ja/pt/ru/zh`
|
|
6
|
+
// is BYTE-IDENTICAL to sdk2's copy, under an explicit "gaps are RECORDED, NOT
|
|
7
|
+
// FIXED" doctrine — which is why ~30 3.0-only strings ship untranslated today.
|
|
8
|
+
// Any translated key added to those files breaks that gate.
|
|
9
|
+
//
|
|
10
|
+
// So the split is structural rather than conventional: "inherited from 2.x" and
|
|
11
|
+
// "3.0's own" become a fact about which file a key lives in, not a comment
|
|
12
|
+
// inside a shared one. That matters on a surface this repo has watched drift
|
|
13
|
+
// silently four times, where "looks fine in English" IS the failure mode.
|
|
14
|
+
//
|
|
15
|
+
// Two alternatives were considered and rejected:
|
|
16
|
+
//
|
|
17
|
+
// - Mirror the keys into sdk2's locale files too, as `e89acbef` did for the
|
|
18
|
+
// booklet strings. Needs zero test changes. Rejected because sdk2 is frozen
|
|
19
|
+
// and publishes nothing, so it edits a dead build purely to green a
|
|
20
|
+
// port-fidelity test.
|
|
21
|
+
// - Relax assertion 4 to a subset check. Genuinely close and cheaper.
|
|
22
|
+
// Rejected on the one thing it loses: once additions are legal in the file,
|
|
23
|
+
// nothing but a comment tells the next reader which entries are inherited.
|
|
24
|
+
//
|
|
25
|
+
// IT LIVES INSIDE `locales/` DELIBERATELY. `test/localeAudit.ts`'s `SKIP_DIRS`
|
|
26
|
+
// skips this directory by name, so a supplement placed anywhere else under
|
|
27
|
+
// `src/i18n/` would be walked by the key scanner as if it were component
|
|
28
|
+
// source, and every English string below would be reported as a key the SDK
|
|
29
|
+
// uses.
|
|
30
|
+
//
|
|
31
|
+
// The English source strings ARE the keys, so the left-hand side of every entry
|
|
32
|
+
// must stay byte-identical to the literal in `DOCUMENT_CAPTURE_FALLBACK_VERBIAGE`.
|
|
33
|
+
// One comma of drift silently drops all eight locales back to English.
|
|
34
|
+
//
|
|
35
|
+
// Register, phrasing and script follow each locale's existing booklet-guidance
|
|
36
|
+
// rendering so these read as siblings of what already ships beside them: `es`
|
|
37
|
+
// impersonal-formal, `it`/`fr` informal-imperative, `zh` TRADITIONAL per
|
|
38
|
+
// `40d6360c`.
|
|
39
|
+
//
|
|
40
|
+
// DRAFTED BY A NON-NATIVE SPEAKER, `es` INCLUDED — and `es` is the locale AMEX
|
|
41
|
+
// Mexico actually renders, so it is worth a real reviewer's five minutes.
|
|
42
|
+
// Posture matches `8e59bdb7`: drafted, shipped, native-speaker review trails.
|
|
43
|
+
// A handful of strings is too small a surface to gate a release on a review nobody
|
|
44
|
+
// scheduled.
|
|
45
|
+
const MOVE_BACK = 'Move back, make sure all 4 edges of the page are visible.';
|
|
46
|
+
const MOVE_CLOSER = 'Move closer, fill the frame with the whole page.';
|
|
47
|
+
// The caption beside the Capture button once auto-capture concedes. It
|
|
48
|
+
// replaced a four-string bottom sheet — a question, a reassurance and two
|
|
49
|
+
// actions — because the sheet covered the guidance pill that answered it.
|
|
50
|
+
const MANUAL_CAPTURE_HINT = 'Automatic capture is having trouble. Tap the button to take the photo yourself.';
|
|
51
|
+
const REVIEW_HEADING = 'Document captured';
|
|
52
|
+
export const threeOhTranslations = {
|
|
53
|
+
de: {
|
|
54
|
+
[MANUAL_CAPTURE_HINT]: 'Die automatische Aufnahme hat Schwierigkeiten. Tippen Sie auf die Taste, um das Foto selbst aufzunehmen.',
|
|
55
|
+
[REVIEW_HEADING]: 'Dokument aufgenommen',
|
|
56
|
+
[MOVE_BACK]: 'Gehen Sie zurück und stellen Sie sicher, dass alle 4 Kanten des Blatts sichtbar sind.',
|
|
57
|
+
[MOVE_CLOSER]: 'Kommen Sie näher und füllen Sie den Rahmen mit dem gesamten Blatt aus.',
|
|
58
|
+
},
|
|
59
|
+
es: {
|
|
60
|
+
[MANUAL_CAPTURE_HINT]: 'La captura automática tiene dificultades. Toque el botón para tomar la foto usted mismo.',
|
|
61
|
+
[REVIEW_HEADING]: 'Documento capturado',
|
|
62
|
+
[MOVE_BACK]: 'Aléjese y asegúrese de que los 4 bordes de la hoja sean visibles.',
|
|
63
|
+
[MOVE_CLOSER]: 'Acérquese y llene el encuadre con la hoja completa.',
|
|
64
|
+
},
|
|
65
|
+
fr: {
|
|
66
|
+
[MANUAL_CAPTURE_HINT]: 'La capture automatique rencontre des difficultés. Appuyez sur le bouton pour prendre la photo vous-même.',
|
|
67
|
+
[REVIEW_HEADING]: 'Document capturé',
|
|
68
|
+
[MOVE_BACK]: 'Reculez et assurez-vous que les 4 bords de la page sont visibles.',
|
|
69
|
+
[MOVE_CLOSER]: 'Rapprochez-vous et remplissez le cadre avec la page entière.',
|
|
70
|
+
},
|
|
71
|
+
it: {
|
|
72
|
+
[MANUAL_CAPTURE_HINT]: 'La cattura automatica sta avendo difficoltà. Tocca il pulsante per scattare la foto manualmente.',
|
|
73
|
+
[REVIEW_HEADING]: 'Documento acquisito',
|
|
74
|
+
[MOVE_BACK]: 'Allontanati e assicurati che tutti e 4 i bordi del foglio siano visibili.',
|
|
75
|
+
[MOVE_CLOSER]: "Avvicinati e riempi l'inquadratura con l'intero foglio.",
|
|
76
|
+
},
|
|
77
|
+
ja: {
|
|
78
|
+
[MANUAL_CAPTURE_HINT]: '自動撮影がうまくいきません。ボタンを押してご自身で撮影してください。',
|
|
79
|
+
[REVIEW_HEADING]: '書類を撮影しました',
|
|
80
|
+
[MOVE_BACK]: '離れて、書類の4つの端がすべて見えるようにしてください。',
|
|
81
|
+
[MOVE_CLOSER]: '近づいて、書類全体で画面いっぱいに表示してください。',
|
|
82
|
+
},
|
|
83
|
+
pt: {
|
|
84
|
+
[MANUAL_CAPTURE_HINT]: 'A captura automática está com dificuldades. Toque no botão para tirar a foto você mesmo.',
|
|
85
|
+
[REVIEW_HEADING]: 'Documento capturado',
|
|
86
|
+
[MOVE_BACK]: 'Afaste-se e certifique-se de que as 4 bordas da folha estejam visíveis.',
|
|
87
|
+
[MOVE_CLOSER]: 'Aproxime-se e preencha o quadro com a folha inteira.',
|
|
88
|
+
},
|
|
89
|
+
ru: {
|
|
90
|
+
[MANUAL_CAPTURE_HINT]: 'Автоматическая съёмка не справляется. Нажмите кнопку, чтобы сделать снимок самостоятельно.',
|
|
91
|
+
[REVIEW_HEADING]: 'Документ снят',
|
|
92
|
+
[MOVE_BACK]: 'Отойдите назад и убедитесь, что видны все 4 края листа.',
|
|
93
|
+
[MOVE_CLOSER]: 'Подойдите ближе и заполните кадр всем листом.',
|
|
94
|
+
},
|
|
95
|
+
zh: {
|
|
96
|
+
[MANUAL_CAPTURE_HINT]: '自動拍攝遇到困難。請點選按鈕自行拍攝。',
|
|
97
|
+
[REVIEW_HEADING]: '已拍攝文件',
|
|
98
|
+
[MOVE_BACK]: '後退一些,確保紙張的四個邊緣都清晰可見。',
|
|
99
|
+
[MOVE_CLOSER]: '靠近一些,讓整張紙填滿畫面。',
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
/** Base entries win nothing — the supplement may only ADD. See `noShadowing`. */
|
|
103
|
+
export function withThreeOhTranslations(lang, base) {
|
|
104
|
+
return { ...base, ...(threeOhTranslations[lang] ?? {}) };
|
|
105
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { webSdkUiVersion } from './version';
|
|
2
|
+
export { useIdmissionClient } from './useIdmissionClient';
|
|
3
|
+
export type { IdmissionClientSession, UseIdmissionClientOptions, } from './useIdmissionClient';
|
|
2
4
|
export { IdCaptureView } from './IdCaptureView';
|
|
3
5
|
export type { IdCaptureViewProps, IdCaptureViewVerbiage, IdCaptureViewClassNames, IdCaptureViewAssets, } from './IdCaptureView';
|
|
4
6
|
export { SelfieCaptureView } from './SelfieCaptureView';
|
|
@@ -14,6 +16,7 @@ export type { DocumentCaptureViewProps, DocumentCaptureViewClassNames, DocumentC
|
|
|
14
16
|
export { DocumentCaptureGuideOverlay } from './components/document/DocumentCaptureGuideOverlay';
|
|
15
17
|
export type { DocumentCaptureGuideOverlayProps, DocumentCaptureGuideOverlayClassNames, } from './components/document/DocumentCaptureGuideOverlay';
|
|
16
18
|
export type { CapturedDocument, DocumentCapturePrompt, } from './components/document/types';
|
|
19
|
+
export type { DocumentAutoCaptureOptions, DocumentAutoCaptureThresholds, } from '@idmission/websdk-core/documentCapture';
|
|
17
20
|
export { useIdCapture, useIdCaptureSelector } from './bindings/useIdCapture';
|
|
18
21
|
export { useSelfieCapture, useSelfieCaptureSelector } from './bindings/useSelfieCapture';
|
|
19
22
|
export { useSignatureCapture } from './bindings/useSignatureCapture';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAE3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACzD,YAAY,EACV,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,sBAAsB,CAAA;AAK7B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,YAAY,EACV,kBAAkB,EAClB,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,YAAY,EACV,sBAAsB,EACtB,yBAAyB,EACzB,2BAA2B,EAC3B,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,YAAY,EACV,qBAAqB,EACrB,wBAAwB,EACxB,0BAA0B,EAC1B,sBAAsB,EACtB,4BAA4B,GAC7B,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,YAAY,EACV,+BAA+B,EAC/B,yBAAyB,EACzB,0BAA0B,EAC1B,8BAA8B,EAC9B,4BAA4B,GAC7B,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACzD,YAAY,EACV,uBAAuB,EACvB,4BAA4B,EAC5B,0BAA0B,GAC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
package/dist/index.js
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
// it): every type-only declaration must be re-exported with `export type`,
|
|
13
13
|
// not a plain `export`, or the build fails.
|
|
14
14
|
export { webSdkUiVersion } from './version';
|
|
15
|
+
export { useIdmissionClient } from './useIdmissionClient';
|
|
15
16
|
// ---------------------------------------------------------------------
|
|
16
17
|
// Top-level assembly (Task 12) — most consumers need only this.
|
|
17
18
|
// ---------------------------------------------------------------------
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type AutoCaptureDiagnostics } from '@idmission/websdk-core/documentCapture';
|
|
2
|
+
/** A 1080x1920 portrait phone frame — the shape AMEX users actually hold. */
|
|
3
|
+
export declare const FIXTURE_FRAME_WIDTH = 1080;
|
|
4
|
+
export declare const FIXTURE_FRAME_HEIGHT = 1920;
|
|
5
|
+
type FrameSpec = {
|
|
6
|
+
/** Box edges as fractions of the frame, the way #342 reports them. */
|
|
7
|
+
bounds: [xMin: number, yMin: number, xMax: number, yMax: number] | null;
|
|
8
|
+
poaScore?: number;
|
|
9
|
+
singlePageScore?: number;
|
|
10
|
+
focusScore?: number;
|
|
11
|
+
worstIou?: number;
|
|
12
|
+
framesTracked?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Preceding `fill` readings, newest first — what the engine's window would
|
|
15
|
+
* hold on this frame. Defaults to a still window of this frame's own value.
|
|
16
|
+
*/
|
|
17
|
+
priorFills?: readonly number[];
|
|
18
|
+
};
|
|
19
|
+
export declare function buildAutoCaptureFrame(spec: FrameSpec, index?: number): AutoCaptureDiagnostics;
|
|
20
|
+
/** The recorded log, oldest frame first — the order the ring buffer keeps. */
|
|
21
|
+
export declare const RECORDED_AUTO_CAPTURE_LOG: AutoCaptureDiagnostics[];
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=autoCaptureFrames.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"autoCaptureFrames.d.ts","sourceRoot":"","sources":["../../src/testing/autoCaptureFrames.ts"],"names":[],"mappings":"AAqBA,OAAO,EAEL,KAAK,sBAAsB,EAE5B,MAAM,wCAAwC,CAAA;AAE/C,6EAA6E;AAC7E,eAAO,MAAM,mBAAmB,OAAO,CAAA;AACvC,eAAO,MAAM,oBAAoB,OAAO,CAAA;AAExC,KAAK,SAAS,GAAG;IACf,sEAAsE;IACtE,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,GAAG,IAAI,CAAA;IACvE,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAC/B,CAAA;AAUD,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,SAAS,EACf,KAAK,SAAI,GACR,sBAAsB,CA6HxB;AA8CD,8EAA8E;AAC9E,eAAO,MAAM,yBAAyB,EAAE,sBAAsB,EAClB,CAAA"}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
// A recorded auto-capture frame log, and the builder that made it.
|
|
2
|
+
//
|
|
3
|
+
// The engine's ring buffer is the deliverable of a tuning session (#341), so
|
|
4
|
+
// "a log round-trips into the replay story" is #353's own resolution
|
|
5
|
+
// criterion. That means the log has to be a first-class, replayable artifact
|
|
6
|
+
// rather than a console paste — hence a shared fixture that the Storybook
|
|
7
|
+
// replay story, the debug-layer tests and the geometry fixtures all read.
|
|
8
|
+
//
|
|
9
|
+
// The numbers below are transcribed from #342's real-corpus measurements, so
|
|
10
|
+
// the story shows what a real POA capture actually looks like rather than
|
|
11
|
+
// round invented values:
|
|
12
|
+
// - a correctly framed sheet fills 0.72-0.97 of the binding axis, a sheet
|
|
13
|
+
// cropped to its address block runs past 1.0 (#343's ground truth)
|
|
14
|
+
// - POA scores 0.73-0.85, while `Single page` collapses to 0.05-0.33 on the
|
|
15
|
+
// same sheet (#339's re-partition finding)
|
|
16
|
+
// - focus on a printed bill reads 0.87-0.92 (#344)
|
|
17
|
+
//
|
|
18
|
+
// The fill window is built by the ENGINE'S OWN aggregator rather than
|
|
19
|
+
// recomputed here, so a fixture cannot drift away from the gate it stands in
|
|
20
|
+
// for — the whole point of #343's ruling is that the verdict is taken on the
|
|
21
|
+
// aggregate, and a hand-rolled mean would be a second implementation of it.
|
|
22
|
+
import { computePoaFillWindow, } from '@idmission/websdk-core/documentCapture';
|
|
23
|
+
/** A 1080x1920 portrait phone frame — the shape AMEX users actually hold. */
|
|
24
|
+
export const FIXTURE_FRAME_WIDTH = 1080;
|
|
25
|
+
export const FIXTURE_FRAME_HEIGHT = 1920;
|
|
26
|
+
const FILL_MIN = 0.7;
|
|
27
|
+
const FILL_MAX = 0.99;
|
|
28
|
+
/** #344's POA-specific slot, taken to its 0.5 fallback by #380's live frames. */
|
|
29
|
+
const FOCUS_THRESHOLD = 0.5;
|
|
30
|
+
const STABILITY_THRESHOLD = 0.5;
|
|
31
|
+
const STABILITY_FRAMES = 12;
|
|
32
|
+
const MIN_SCORE = 0.55;
|
|
33
|
+
export function buildAutoCaptureFrame(spec, index = 0) {
|
|
34
|
+
const { bounds, poaScore = 0.81, singlePageScore = 0.09, focusScore = 0.9, worstIou = 0.93, framesTracked = STABILITY_FRAMES, priorFills, } = spec;
|
|
35
|
+
const scores = bounds
|
|
36
|
+
? { POA: poaScore, 'Single page': singlePageScore }
|
|
37
|
+
: {};
|
|
38
|
+
const box = bounds && {
|
|
39
|
+
xMin: bounds[0] * FIXTURE_FRAME_WIDTH,
|
|
40
|
+
yMin: bounds[1] * FIXTURE_FRAME_HEIGHT,
|
|
41
|
+
xMax: bounds[2] * FIXTURE_FRAME_WIDTH,
|
|
42
|
+
yMax: bounds[3] * FIXTURE_FRAME_HEIGHT,
|
|
43
|
+
width: (bounds[2] - bounds[0]) * FIXTURE_FRAME_WIDTH,
|
|
44
|
+
height: (bounds[3] - bounds[1]) * FIXTURE_FRAME_HEIGHT,
|
|
45
|
+
};
|
|
46
|
+
const framing = bounds &&
|
|
47
|
+
box && {
|
|
48
|
+
leftMargin: bounds[0],
|
|
49
|
+
rightMargin: 1 - bounds[2],
|
|
50
|
+
topMargin: bounds[1],
|
|
51
|
+
bottomMargin: 1 - bounds[3],
|
|
52
|
+
minMargin: Math.min(bounds[0], 1 - bounds[2], bounds[1], 1 - bounds[3]),
|
|
53
|
+
fill: Math.max(bounds[2] - bounds[0], bounds[3] - bounds[1]),
|
|
54
|
+
fillWidth: bounds[2] - bounds[0],
|
|
55
|
+
fillHeight: bounds[3] - bounds[1],
|
|
56
|
+
};
|
|
57
|
+
const fillWindow = computePoaFillWindow(framing
|
|
58
|
+
? [
|
|
59
|
+
framing.fill,
|
|
60
|
+
...(priorFills ??
|
|
61
|
+
Array.from({ length: STABILITY_FRAMES - 1 }, () => framing.fill)),
|
|
62
|
+
].slice(0, STABILITY_FRAMES)
|
|
63
|
+
: [], { fillMin: FILL_MIN, fillMax: FILL_MAX, framesNeeded: STABILITY_FRAMES });
|
|
64
|
+
const isStable = framesTracked >= STABILITY_FRAMES && worstIou >= STABILITY_THRESHOLD;
|
|
65
|
+
// Built in POA_GATE_ORDER: noDocument, tooClose, tooFar, notStable,
|
|
66
|
+
// outOfFocus. `notStable` sits above `outOfFocus` because on paper a focus
|
|
67
|
+
// failure IS a motion failure (#383), so "hold still" is the instruction
|
|
68
|
+
// that fixes both.
|
|
69
|
+
const failingGates = [];
|
|
70
|
+
if (!framing)
|
|
71
|
+
failingGates.push('noDocument');
|
|
72
|
+
if (fillWindow.tooClose)
|
|
73
|
+
failingGates.push('tooClose');
|
|
74
|
+
if (fillWindow.tooFar)
|
|
75
|
+
failingGates.push('tooFar');
|
|
76
|
+
if (!isStable)
|
|
77
|
+
failingGates.push('notStable');
|
|
78
|
+
// The engine reports `focus: null` when there is no box to crop, and an
|
|
79
|
+
// absent signal is not a failing one.
|
|
80
|
+
if (framing && focusScore < FOCUS_THRESHOLD)
|
|
81
|
+
failingGates.push('outOfFocus');
|
|
82
|
+
const satisfied = failingGates.length === 0;
|
|
83
|
+
const timeRunning = index * 33;
|
|
84
|
+
return {
|
|
85
|
+
frameId: index,
|
|
86
|
+
timeRunning,
|
|
87
|
+
detectedObjects: box && framing
|
|
88
|
+
? [
|
|
89
|
+
{ label: 'POA', score: poaScore, box },
|
|
90
|
+
{ label: 'Single page', score: singlePageScore, box },
|
|
91
|
+
]
|
|
92
|
+
: [],
|
|
93
|
+
scores,
|
|
94
|
+
target: box && framing ? { label: 'POA', score: poaScore, box } : null,
|
|
95
|
+
targetMinScore: MIN_SCORE,
|
|
96
|
+
framing,
|
|
97
|
+
fillWindow,
|
|
98
|
+
// Null without a box: the crop IS the box, so there is nothing to score.
|
|
99
|
+
// #353 lost a real detour to this being rendered as "model not loaded".
|
|
100
|
+
focus: framing
|
|
101
|
+
? {
|
|
102
|
+
score: focusScore,
|
|
103
|
+
threshold: FOCUS_THRESHOLD,
|
|
104
|
+
branch: 'mobile',
|
|
105
|
+
thresholdMet: focusScore >= FOCUS_THRESHOLD,
|
|
106
|
+
predictionTimeMs: 9,
|
|
107
|
+
}
|
|
108
|
+
: null,
|
|
109
|
+
stability: {
|
|
110
|
+
worstIou: box ? worstIou : null,
|
|
111
|
+
threshold: STABILITY_THRESHOLD,
|
|
112
|
+
framesTracked: box ? framesTracked : 0,
|
|
113
|
+
framesNeeded: STABILITY_FRAMES,
|
|
114
|
+
isStable: !!box && isStable,
|
|
115
|
+
},
|
|
116
|
+
failingGates,
|
|
117
|
+
satisfied,
|
|
118
|
+
// The fixtures feed the overlay, not the stabilizer, so the raw code is
|
|
119
|
+
// simply carried through to `displayed`. A replayed session's real
|
|
120
|
+
// debounce history lives in the recorded log, not here.
|
|
121
|
+
guidance: {
|
|
122
|
+
raw: satisfied ? 'holdStill' : (failingGates[0] ?? 'holdStill'),
|
|
123
|
+
pendingCandidate: satisfied ? 'holdStill' : (failingGates[0] ?? 'none'),
|
|
124
|
+
displayed: satisfied ? 'holdStill' : (failingGates[0] ?? 'none'),
|
|
125
|
+
displayedForMs: timeRunning,
|
|
126
|
+
},
|
|
127
|
+
detectionTimeMs: 27,
|
|
128
|
+
frameRate: 34.8,
|
|
129
|
+
// These fixtures declare no guide aspect, so the guide rect IS the frame
|
|
130
|
+
// and every `bounds` fraction below keeps meaning what it meant.
|
|
131
|
+
guideRect: {
|
|
132
|
+
x: 0,
|
|
133
|
+
y: 0,
|
|
134
|
+
width: FIXTURE_FRAME_WIDTH,
|
|
135
|
+
height: FIXTURE_FRAME_HEIGHT,
|
|
136
|
+
},
|
|
137
|
+
frameWidth: FIXTURE_FRAME_WIDTH,
|
|
138
|
+
frameHeight: FIXTURE_FRAME_HEIGHT,
|
|
139
|
+
videoWidth: FIXTURE_FRAME_WIDTH,
|
|
140
|
+
videoHeight: FIXTURE_FRAME_HEIGHT,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* One AMEX-shaped framing attempt against #343's two-sided window: the user
|
|
145
|
+
* starts too far back, walks the sheet in, over-corrects until it crops in
|
|
146
|
+
* past `FILL_MAX`, then settles inside the window.
|
|
147
|
+
*
|
|
148
|
+
* The over-corrected frames are the AMEX failure in miniature — a sheet
|
|
149
|
+
* cropped to its address block has paper edge to edge, so its `fill` runs past
|
|
150
|
+
* 1.0 while a complete sheet reads 0.72-0.97. #343 measured exactly this
|
|
151
|
+
* separation, and `dithered` reproduces why the verdict is taken on the
|
|
152
|
+
* aggregate: the same held sheet reads across 2-3 grid cells frame to frame,
|
|
153
|
+
* so the instantaneous value straddles the threshold while the mean does not.
|
|
154
|
+
*/
|
|
155
|
+
const FRAMING_ATTEMPT = [
|
|
156
|
+
// Nothing detected: below #342's hard detection floor at 0.40 linear scale.
|
|
157
|
+
{ bounds: null, framesTracked: 0 },
|
|
158
|
+
{ bounds: null, framesTracked: 0 },
|
|
159
|
+
// Detected but small — `tooFar`. Focus stays high the whole way in: #344
|
|
160
|
+
// found it flat at 0.86-0.93 on a sheet shrunk to 0.4 linear, because the
|
|
161
|
+
// crop is the box. `FILL_MIN` is the only gate that catches this.
|
|
162
|
+
{ bounds: [0.28, 0.31, 0.72, 0.69], poaScore: 0.74, focusScore: 0.88, framesTracked: 3 },
|
|
163
|
+
{ bounds: [0.23, 0.26, 0.77, 0.74], poaScore: 0.79, focusScore: 0.89, framesTracked: 7 },
|
|
164
|
+
// Over-corrected past FILL_MAX: cropped in, the failure AMEX receives.
|
|
165
|
+
{ bounds: [-0.0002, 0.02, 0.994, 0.98], poaScore: 0.83, focusScore: 0.9, worstIou: 0.71 },
|
|
166
|
+
{ bounds: [0.004, 0.011, 0.998, 0.986], poaScore: 0.82, focusScore: 0.91, worstIou: 0.88 },
|
|
167
|
+
// Blurred mid-correction: under #344's 0.6 seed, over `singlePage`'s 0.3.
|
|
168
|
+
{ bounds: [0.03, 0.04, 0.96, 0.95], poaScore: 0.8, focusScore: 0.38, worstIou: 0.9 },
|
|
169
|
+
// Settled inside the window. Every gate passes — but the instantaneous
|
|
170
|
+
// reading still dithers across the grid, which is what the mean absorbs.
|
|
171
|
+
{
|
|
172
|
+
bounds: [0.03, 0.04, 0.955, 0.95],
|
|
173
|
+
poaScore: 0.81,
|
|
174
|
+
focusScore: 0.9,
|
|
175
|
+
worstIou: 0.96,
|
|
176
|
+
priorFills: [0.938, 0.921, 0.938, 0.905, 0.921, 0.938, 0.921, 0.905, 0.938, 0.921, 0.938],
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
bounds: [0.028, 0.04, 0.958, 0.95],
|
|
180
|
+
poaScore: 0.82,
|
|
181
|
+
focusScore: 0.91,
|
|
182
|
+
worstIou: 0.97,
|
|
183
|
+
priorFills: [0.925, 0.938, 0.921, 0.938, 0.905, 0.921, 0.938, 0.921, 0.905, 0.938, 0.921],
|
|
184
|
+
},
|
|
185
|
+
];
|
|
186
|
+
/** The recorded log, oldest frame first — the order the ring buffer keeps. */
|
|
187
|
+
export const RECORDED_AUTO_CAPTURE_LOG = FRAMING_ATTEMPT.map(buildAutoCaptureFrame);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SubmissionArtifacts } from '@idmission/websdk-core/client';
|
|
2
|
-
import { type DocumentCaptureController, type DocumentCaptureControllerState } from '@idmission/websdk-core/documentCapture';
|
|
2
|
+
import { type AutoCaptureDiagnostics, type DocumentCaptureController, type DocumentCaptureControllerState } from '@idmission/websdk-core/documentCapture';
|
|
3
3
|
export type FakeDocumentControllerCall = {
|
|
4
4
|
method: string;
|
|
5
5
|
args: unknown[];
|
|
@@ -24,6 +24,12 @@ export type FakeDocumentControllerOptions = {
|
|
|
24
24
|
*/
|
|
25
25
|
isRearFacing?: boolean;
|
|
26
26
|
artifacts?: SubmissionArtifacts;
|
|
27
|
+
/**
|
|
28
|
+
* Stands in for the engine's ring buffer. The replay story hands back a
|
|
29
|
+
* recorded log here, so `getAutoCaptureLog()` returns real frames without a
|
|
30
|
+
* camera or a model — which is what makes the log round-trip testable.
|
|
31
|
+
*/
|
|
32
|
+
autoCaptureLog?: readonly AutoCaptureDiagnostics[];
|
|
27
33
|
};
|
|
28
34
|
/**
|
|
29
35
|
* Unlike the other fakes in this directory, this one drives the REAL reducer
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fakeDocumentController.d.ts","sourceRoot":"","sources":["../../src/testing/fakeDocumentController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAA;AACxE,OAAO,
|
|
1
|
+
{"version":3,"file":"fakeDocumentController.d.ts","sourceRoot":"","sources":["../../src/testing/fakeDocumentController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAA;AACxE,OAAO,EAGL,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,8BAA8B,EACpC,MAAM,wCAAwC,CAAA;AAE/C,MAAM,MAAM,0BAA0B,GAAG;IACvC,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,OAAO,EAAE,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,6BAA6B,GAAG,yBAAyB,GAAG;IACtE,KAAK,EAAE,0BAA0B,EAAE,CAAA;IACnC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,8BAA8B,CAAC,GAAG,IAAI,CAAA;IAC9D,8EAA8E;IAC9E,QAAQ,CAAC,aAAa,EAAE,gBAAgB,GAAG,IAAI,CAAA;CAChD,CAAA;AAED,MAAM,MAAM,6BAA6B,GAAG;IAC1C,0EAA0E;IAC1E,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,yEAAyE;IACzE,eAAe,CAAC,EAAE,IAAI,CAAA;IACtB,6EAA6E;IAC7E,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,SAAS,CAAC,EAAE,mBAAmB,CAAA;IAC/B;;;;OAIG;IACH,cAAc,CAAC,EAAE,SAAS,sBAAsB,EAAE,CAAA;CACnD,CAAA;AAKD;;;;;;;GAOG;AACH,wBAAgB,mCAAmC,CACjD,YAAY,EAAE,8BAA8B,EAC5C,OAAO,GAAE,6BAAkC,GAC1C,6BAA6B,CA+G/B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { reduceDocumentCapture, } from '@idmission/websdk-core/documentCapture';
|
|
1
|
+
import { buildAttemptMetadata, reduceDocumentCapture, } from '@idmission/websdk-core/documentCapture';
|
|
2
2
|
const DEFAULT_CONTENT_URL = 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==';
|
|
3
3
|
/**
|
|
4
4
|
* Unlike the other fakes in this directory, this one drives the REAL reducer
|
|
@@ -9,7 +9,7 @@ const DEFAULT_CONTENT_URL = 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5B
|
|
|
9
9
|
* and the network upload are still faked; nothing here touches a device.
|
|
10
10
|
*/
|
|
11
11
|
export function createFakeDocumentCaptureController(initialState, options = {}) {
|
|
12
|
-
const { uploadFails = false, capturedContent = new Blob(['fake-frame'], { type: 'image/jpeg' }), capturedContentUrl = DEFAULT_CONTENT_URL, isRearFacing = true, artifacts = {}, } = options;
|
|
12
|
+
const { uploadFails = false, capturedContent = new Blob(['fake-frame'], { type: 'image/jpeg' }), capturedContentUrl = DEFAULT_CONTENT_URL, isRearFacing = true, artifacts = {}, autoCaptureLog = [], } = options;
|
|
13
13
|
let state = initialState;
|
|
14
14
|
let uploadCounter = 0;
|
|
15
15
|
// Mirrors the real controller's disposal contract so tests written against
|
|
@@ -46,6 +46,7 @@ export function createFakeDocumentCaptureController(initialState, options = {})
|
|
|
46
46
|
attachedVideo = null;
|
|
47
47
|
},
|
|
48
48
|
getState: () => state,
|
|
49
|
+
getAutoCaptureLog: () => autoCaptureLog.slice(),
|
|
49
50
|
subscribe(listener) {
|
|
50
51
|
listeners.add(listener);
|
|
51
52
|
return () => {
|
|
@@ -74,6 +75,13 @@ export function createFakeDocumentCaptureController(initialState, options = {})
|
|
|
74
75
|
type: 'captureCompleted',
|
|
75
76
|
content: capturedContent,
|
|
76
77
|
contentUrl: capturedContentUrl,
|
|
78
|
+
captureMode: 'Manual',
|
|
79
|
+
// The control-arm record: a manual shutter with no engine behind it,
|
|
80
|
+
// and therefore auto-capture fields ABSENT rather than zeroed (#377).
|
|
81
|
+
captureMetadata: buildAttemptMetadata(null, {
|
|
82
|
+
captureMode: 'Manual',
|
|
83
|
+
autoCaptureStatus: 'disabled:unconfigured',
|
|
84
|
+
}),
|
|
77
85
|
});
|
|
78
86
|
},
|
|
79
87
|
retry() {
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export { createFakeDocumentCaptureController, type FakeDocumentCaptureController
|
|
|
9
9
|
export { buildVideoIdControllerState } from './buildVideoIdState';
|
|
10
10
|
export { createFakeVideoIdCaptureController, type FakeVideoIdCaptureController, type FakeVideoIdControllerCall, } from './fakeVideoIdController';
|
|
11
11
|
export { createFakeIdmissionClient, buildSubmissionResponse, livenessRejectedResult, type FakeClientSubmitCall, type FakeIdmissionClient, } from './fakeClient';
|
|
12
|
+
export { buildAutoCaptureFrame, RECORDED_AUTO_CAPTURE_LOG, FIXTURE_FRAME_WIDTH, FIXTURE_FRAME_HEIGHT, } from './autoCaptureFrames';
|
|
12
13
|
export { alignFileAndBlobGlobals } from './alignGlobals';
|
|
13
14
|
export { stubVideoCaptureDomGlobals } from './stubVideoCaptureDom';
|
|
14
15
|
export { stubSignatureCanvasGlobals } from './stubSignatureCanvas';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AACnD,OAAO,EACL,6BAA6B,EAC7B,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,GACxB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,0BAA0B,EAC1B,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,EACb,iBAAiB,GAClB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,iCAAiC,EACjC,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,GAC9B,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAA;AACrE,OAAO,EACL,oCAAoC,EACpC,KAAK,8BAA8B,EACnC,KAAK,2BAA2B,GACjC,MAAM,2BAA2B,CAAA;AAClC,OAAO,EACL,4BAA4B,EAC5B,oBAAoB,GACrB,MAAM,sBAAsB,CAAA;AAC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,EACnC,KAAK,6BAA6B,EAClC,KAAK,0BAA0B,EAC/B,KAAK,6BAA6B,GACnC,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAA;AACjE,OAAO,EACL,kCAAkC,EAClC,KAAK,4BAA4B,EACjC,KAAK,yBAAyB,GAC/B,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACL,yBAAyB,EACzB,uBAAuB,EACvB,sBAAsB,EACtB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,GACzB,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,qBAAqB,EACrB,yBAAyB,EACzB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAA;AACxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAA;AAClE,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAA"}
|
package/dist/testing/index.js
CHANGED
|
@@ -13,6 +13,7 @@ export { createFakeDocumentCaptureController, } from './fakeDocumentController';
|
|
|
13
13
|
export { buildVideoIdControllerState } from './buildVideoIdState';
|
|
14
14
|
export { createFakeVideoIdCaptureController, } from './fakeVideoIdController';
|
|
15
15
|
export { createFakeIdmissionClient, buildSubmissionResponse, livenessRejectedResult, } from './fakeClient';
|
|
16
|
+
export { buildAutoCaptureFrame, RECORDED_AUTO_CAPTURE_LOG, FIXTURE_FRAME_WIDTH, FIXTURE_FRAME_HEIGHT, } from './autoCaptureFrames';
|
|
16
17
|
export { alignFileAndBlobGlobals } from './alignGlobals';
|
|
17
18
|
export { stubVideoCaptureDomGlobals } from './stubVideoCaptureDom';
|
|
18
19
|
export { stubSignatureCanvasGlobals } from './stubSignatureCanvas';
|