@frankieone/one-sdk 1.9.42 → 1.10.0-rc
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/dist/commit.txt +1 -1
- package/dist/esm/modules/biometrics/vendors/Daon/index.d.ts +1 -1
- package/dist/esm/modules/biometrics/vendors/Onfido/onfido.init.d.ts +3 -1
- package/dist/esm/modules/biometrics/vendors/Onfido/onfido.init.d.ts.map +1 -1
- package/dist/esm/modules/biometrics/vendors/Onfido/onfido.init.js +15 -2
- package/dist/esm/modules/biometrics/vendors/Onfido/onfido.init.js.map +1 -1
- package/dist/esm/modules/biometrics/vendors/Onfido/onfidoLegacy.init.d.ts +3 -1
- package/dist/esm/modules/biometrics/vendors/Onfido/onfidoLegacy.init.d.ts.map +1 -1
- package/dist/esm/modules/biometrics/vendors/Onfido/onfidoLegacy.init.js +15 -2
- package/dist/esm/modules/biometrics/vendors/Onfido/onfidoLegacy.init.js.map +1 -1
- package/dist/esm/modules/biometrics/vendors/Onfido/shared.d.ts +7 -0
- package/dist/esm/modules/biometrics/vendors/Onfido/shared.d.ts.map +1 -1
- package/dist/esm/modules/biometrics/vendors/Onfido/shared.js +20 -5
- package/dist/esm/modules/biometrics/vendors/Onfido/shared.js.map +1 -1
- package/dist/esm/modules/common/shared/utils/fetchCheckProcessingStatus.d.ts.map +1 -1
- package/dist/esm/modules/common/shared/utils/fetchCheckProcessingStatus.js +6 -2
- package/dist/esm/modules/common/shared/utils/fetchCheckProcessingStatus.js.map +1 -1
- package/dist/esm/modules/common/vendors/common/iframeUtils/createIframe.d.ts.map +1 -1
- package/dist/esm/modules/common/vendors/common/iframeUtils/createIframe.js +5 -2
- package/dist/esm/modules/common/vendors/common/iframeUtils/createIframe.js.map +1 -1
- package/dist/esm/modules/common/vendors/common/iframeUtils/createIframeEventListener.d.ts +11 -0
- package/dist/esm/modules/common/vendors/common/iframeUtils/createIframeEventListener.d.ts.map +1 -1
- package/dist/esm/modules/common/vendors/common/iframeUtils/createIframeEventListener.js +1 -0
- package/dist/esm/modules/common/vendors/common/iframeUtils/createIframeEventListener.js.map +1 -1
- package/dist/esm/modules/common/vendors/daon/mapMessageToEvent.d.ts.map +1 -1
- package/dist/esm/modules/common/vendors/daon/mapMessageToEvent.js +18 -3
- package/dist/esm/modules/common/vendors/daon/mapMessageToEvent.js.map +1 -1
- package/dist/esm/modules/form/vendors/react/components/base/FrankieLoader/FrankieLoader.d.ts.map +1 -1
- package/dist/esm/modules/form/vendors/react/components/base/FrankieLoader/FrankieLoader.js +1 -1
- package/dist/esm/modules/form/vendors/react/components/base/FrankieLoader/FrankieLoader.js.map +1 -1
- package/dist/esm/modules/form/vendors/react/components/view/Progress/Progress.d.ts.map +1 -1
- package/dist/esm/modules/form/vendors/react/components/view/Progress/Progress.js +1 -1
- package/dist/esm/modules/form/vendors/react/components/view/Progress/Progress.js.map +1 -1
- package/dist/esm/modules/form/vendors/react/features/PersonalDetails/personalDetails.config.d.ts +585 -585
- package/dist/esm/modules/form/vendors/react/features/PersonalDetails/personalDetails.config.d.ts.map +1 -1
- package/dist/esm/modules/form/vendors/react/index.js +15 -0
- package/dist/esm/modules/form/vendors/react/index.js.map +1 -1
- package/dist/esm/modules/frankie-client/clients/F2/IDVClientF2.d.ts +4 -4
- package/dist/esm/modules/frankie-client/clients/F2/IDVClientF2.d.ts.map +1 -1
- package/dist/esm/modules/frankie-client/clients/F2/IDVClientF2.js.map +1 -1
- package/dist/esm/modules/frankie-client/clients/IDVClient.d.ts +4 -4
- package/dist/esm/modules/frankie-client/clients/IDVClient.d.ts.map +1 -1
- package/dist/esm/modules/frankie-client/clients/IDVClient.js.map +1 -1
- package/dist/esm/modules/idv/actions/mount.d.ts +9 -0
- package/dist/esm/modules/idv/actions/mount.d.ts.map +1 -1
- package/dist/esm/modules/idv/actions/mount.js +3 -1
- package/dist/esm/modules/idv/actions/mount.js.map +1 -1
- package/dist/esm/modules/idv/index.d.ts.map +1 -1
- package/dist/esm/modules/idv/index.js +17 -2
- package/dist/esm/modules/idv/index.js.map +1 -1
- package/dist/esm/modules/idv/vendors/Daon/index.d.ts +1 -1
- package/dist/esm/modules/idv/vendors/Incode/index.d.ts +1 -1
- package/dist/esm/modules/idv/vendors/Mastercard/index.d.ts +1 -1
- package/dist/esm/modules/idv/vendors/OcrLabs/index.d.ts +1 -1
- package/dist/esm/modules/idv/vendors/Onfido/index.d.ts +1 -1
- package/dist/esm/modules/idv/vendors/Onfido/index.d.ts.map +1 -1
- package/dist/esm/modules/idv/vendors/Onfido/index.js +20 -2
- package/dist/esm/modules/idv/vendors/Onfido/index.js.map +1 -1
- package/dist/esm/modules/idv/vendors/Onfido/index.useOneStep.d.ts +3 -1
- package/dist/esm/modules/idv/vendors/Onfido/index.useOneStep.d.ts.map +1 -1
- package/dist/esm/modules/idv/vendors/Onfido/index.useOneStep.js +15 -2
- package/dist/esm/modules/idv/vendors/Onfido/index.useOneStep.js.map +1 -1
- package/dist/esm/modules/idv/vendors/Sumsub/index.d.ts +1 -1
- package/dist/esm/modules/idv/vendors/Truuth/index.d.ts +1 -1
- package/dist/esm/modules/idv/vendors/Truuth/index.d.ts.map +1 -1
- package/dist/esm/modules/idv/vendors/Truuth/index.js +13 -1
- package/dist/esm/modules/idv/vendors/Truuth/index.js.map +1 -1
- package/dist/esm/modules/idv/vendors/common/iframeUtils/defineIframeIDVWrapper.d.ts +1 -1
- package/dist/esm/modules/idv/vendors/common/iframeUtils/defineIframeIDVWrapper.d.ts.map +1 -1
- package/dist/esm/modules/idv/vendors/common/iframeUtils/defineIframeIDVWrapper.js +19 -1
- package/dist/esm/modules/idv/vendors/common/iframeUtils/defineIframeIDVWrapper.js.map +1 -1
- package/dist/esm/modules/index.d.ts +2 -0
- package/dist/esm/modules/index.d.ts.map +1 -1
- package/dist/esm/modules/index.js +1 -0
- package/dist/esm/modules/index.js.map +1 -1
- package/dist/esm/modules/journey/classify/classify.d.ts +8 -0
- package/dist/esm/modules/journey/classify/classify.d.ts.map +1 -0
- package/dist/esm/modules/journey/classify/classify.js +105 -0
- package/dist/esm/modules/journey/classify/classify.js.map +1 -0
- package/dist/esm/modules/journey/classify/transportError.d.ts +24 -0
- package/dist/esm/modules/journey/classify/transportError.d.ts.map +1 -0
- package/dist/esm/modules/journey/classify/transportError.js +35 -0
- package/dist/esm/modules/journey/classify/transportError.js.map +1 -0
- package/dist/esm/modules/journey/classify/v1Status.d.ts +24 -0
- package/dist/esm/modules/journey/classify/v1Status.d.ts.map +1 -0
- package/dist/esm/modules/journey/classify/v1Status.js +43 -0
- package/dist/esm/modules/journey/classify/v1Status.js.map +1 -0
- package/dist/esm/modules/journey/flows/ekycFlow.d.ts +38 -0
- package/dist/esm/modules/journey/flows/ekycFlow.d.ts.map +1 -0
- package/dist/esm/modules/journey/flows/ekycFlow.js +179 -0
- package/dist/esm/modules/journey/flows/ekycFlow.js.map +1 -0
- package/dist/esm/modules/journey/flows/idvFlow.d.ts +32 -0
- package/dist/esm/modules/journey/flows/idvFlow.d.ts.map +1 -0
- package/dist/esm/modules/journey/flows/idvFlow.js +509 -0
- package/dist/esm/modules/journey/flows/idvFlow.js.map +1 -0
- package/dist/esm/modules/journey/flows/ocrFlow.d.ts +27 -0
- package/dist/esm/modules/journey/flows/ocrFlow.d.ts.map +1 -0
- package/dist/esm/modules/journey/flows/ocrFlow.js +434 -0
- package/dist/esm/modules/journey/flows/ocrFlow.js.map +1 -0
- package/dist/esm/modules/journey/flows/screenSequence.d.ts +127 -0
- package/dist/esm/modules/journey/flows/screenSequence.d.ts.map +1 -0
- package/dist/esm/modules/journey/flows/screenSequence.js +418 -0
- package/dist/esm/modules/journey/flows/screenSequence.js.map +1 -0
- package/dist/esm/modules/journey/flows/submitAndClassify.d.ts +32 -0
- package/dist/esm/modules/journey/flows/submitAndClassify.d.ts.map +1 -0
- package/dist/esm/modules/journey/flows/submitAndClassify.js +101 -0
- package/dist/esm/modules/journey/flows/submitAndClassify.js.map +1 -0
- package/dist/esm/modules/journey/index.d.ts +34 -0
- package/dist/esm/modules/journey/index.d.ts.map +1 -0
- package/dist/esm/modules/journey/index.js +183 -0
- package/dist/esm/modules/journey/index.js.map +1 -0
- package/dist/esm/modules/journey/journeyHandle.d.ts +35 -0
- package/dist/esm/modules/journey/journeyHandle.d.ts.map +1 -0
- package/dist/esm/modules/journey/journeyHandle.js +130 -0
- package/dist/esm/modules/journey/journeyHandle.js.map +1 -0
- package/dist/esm/modules/journey/screens/ctaConfig.d.ts +2 -0
- package/dist/esm/modules/journey/screens/ctaConfig.d.ts.map +1 -0
- package/dist/esm/modules/journey/screens/ctaConfig.js +23 -0
- package/dist/esm/modules/journey/screens/ctaConfig.js.map +1 -0
- package/dist/esm/modules/journey/screens/resultScreen.d.ts +21 -0
- package/dist/esm/modules/journey/screens/resultScreen.d.ts.map +1 -0
- package/dist/esm/modules/journey/screens/resultScreen.js +108 -0
- package/dist/esm/modules/journey/screens/resultScreen.js.map +1 -0
- package/dist/esm/modules/journey/simulate/fixtures.d.ts +9 -0
- package/dist/esm/modules/journey/simulate/fixtures.d.ts.map +1 -0
- package/dist/esm/modules/journey/simulate/fixtures.js +41 -0
- package/dist/esm/modules/journey/simulate/fixtures.js.map +1 -0
- package/dist/esm/modules/journey/steps/firstPaint.d.ts +43 -0
- package/dist/esm/modules/journey/steps/firstPaint.d.ts.map +1 -0
- package/dist/esm/modules/journey/steps/firstPaint.js +28 -0
- package/dist/esm/modules/journey/steps/firstPaint.js.map +1 -0
- package/dist/esm/modules/journey/steps/stepMachine.d.ts +52 -0
- package/dist/esm/modules/journey/steps/stepMachine.d.ts.map +1 -0
- package/dist/esm/modules/journey/steps/stepMachine.js +90 -0
- package/dist/esm/modules/journey/steps/stepMachine.js.map +1 -0
- package/dist/esm/modules/journey/steps/stepTable.d.ts +234 -0
- package/dist/esm/modules/journey/steps/stepTable.d.ts.map +1 -0
- package/dist/esm/modules/journey/steps/stepTable.js +241 -0
- package/dist/esm/modules/journey/steps/stepTable.js.map +1 -0
- package/dist/esm/modules/journey/theme/applyTheme.d.ts +17 -0
- package/dist/esm/modules/journey/theme/applyTheme.d.ts.map +1 -0
- package/dist/esm/modules/journey/theme/applyTheme.js +49 -0
- package/dist/esm/modules/journey/theme/applyTheme.js.map +1 -0
- package/dist/esm/modules/journey/types/classification.d.ts +10 -0
- package/dist/esm/modules/journey/types/classification.d.ts.map +1 -0
- package/dist/esm/modules/journey/types/classification.js +2 -0
- package/dist/esm/modules/journey/types/classification.js.map +1 -0
- package/dist/esm/modules/journey/types/classifierInput.d.ts +45 -0
- package/dist/esm/modules/journey/types/classifierInput.d.ts.map +1 -0
- package/dist/esm/modules/journey/types/classifierInput.js +2 -0
- package/dist/esm/modules/journey/types/classifierInput.js.map +1 -0
- package/dist/esm/modules/journey/types/contract.d.ts +60 -0
- package/dist/esm/modules/journey/types/contract.d.ts.map +1 -0
- package/dist/esm/modules/journey/types/contract.js +7 -0
- package/dist/esm/modules/journey/types/contract.js.map +1 -0
- package/dist/esm/modules/journey/types/resultConfig.d.ts +23 -0
- package/dist/esm/modules/journey/types/resultConfig.d.ts.map +1 -0
- package/dist/esm/modules/journey/types/resultConfig.js +2 -0
- package/dist/esm/modules/journey/types/resultConfig.js.map +1 -0
- package/dist/esm/modules/meta.json +1 -1
- package/dist/esm/modules/ocr/vendors/Daon/index.d.ts +1 -1
- package/dist/esm/modules/ocr/vendors/Onfido/onfido.init.d.ts +3 -1
- package/dist/esm/modules/ocr/vendors/Onfido/onfido.init.d.ts.map +1 -1
- package/dist/esm/modules/ocr/vendors/Onfido/onfido.init.js +15 -2
- package/dist/esm/modules/ocr/vendors/Onfido/onfido.init.js.map +1 -1
- package/dist/esm/modules/ocr/vendors/Onfido/onfidoLegacy.init.d.ts +3 -1
- package/dist/esm/modules/ocr/vendors/Onfido/onfidoLegacy.init.d.ts.map +1 -1
- package/dist/esm/modules/ocr/vendors/Onfido/onfidoLegacy.init.js +15 -2
- package/dist/esm/modules/ocr/vendors/Onfido/onfidoLegacy.init.js.map +1 -1
- package/dist/esm/modules/ocr/vendors/Onfido/shared.d.ts +17 -0
- package/dist/esm/modules/ocr/vendors/Onfido/shared.d.ts.map +1 -1
- package/dist/esm/modules/ocr/vendors/Onfido/shared.js +33 -5
- package/dist/esm/modules/ocr/vendors/Onfido/shared.js.map +1 -1
- package/dist/esm/modules/sdk/index.d.ts.map +1 -1
- package/dist/esm/modules/sdk/index.js +5 -1
- package/dist/esm/modules/sdk/index.js.map +1 -1
- package/dist/esm/modules/sdk/types/globalEvents.d.ts +13 -0
- package/dist/esm/modules/sdk/types/globalEvents.d.ts.map +1 -1
- package/dist/esm/modules/sdk/types/oneSDK.d.ts +1 -0
- package/dist/esm/modules/sdk/types/oneSDK.d.ts.map +1 -1
- package/dist/esm/styles/f1-style.css +1 -1
- package/dist/release.txt +1 -1
- package/dist/version.txt +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,434 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { MOUNT_DEBOUNCE_WAIT } from '../../common/shared/utils/index.js';
|
|
11
|
+
import { IDVStatus } from '../../frankie-client/clients/IDVClient.js';
|
|
12
|
+
import { OCRStatus } from '../../frankie-client/clients/OCRClient.js';
|
|
13
|
+
import { OCR_CAPTURE_EVENTS } from '../steps/stepTable.js';
|
|
14
|
+
import { transportErrorSignal } from '../classify/transportError.js';
|
|
15
|
+
import { mkScreenSequence } from './screenSequence.js';
|
|
16
|
+
import { submitAndClassify, verificationRequested } from './submitAndClassify.js';
|
|
17
|
+
/**
|
|
18
|
+
* Confirmed recapture statuses only — see the OCR_CAPTURE_EVENTS doc
|
|
19
|
+
* (`steps/stepTable.ts`) for the vendor-by-vendor vocabulary this unions:
|
|
20
|
+
* IDV's shared vocabulary (Daon, via `defineIframeIDVWrapper`) plus the
|
|
21
|
+
* `OCRStatus` enum's confirmed upload-failure values (Incode/Onfido/Sumsub,
|
|
22
|
+
* via `statusEvaluators.ts`'s `default` branch). `WAITING_BACK`/`WAITING_FRONT`
|
|
23
|
+
* /`WAITING_OCR_RUN` are deliberately excluded: they are not confirmed to be
|
|
24
|
+
* failures rather than normal mid-capture polling, so a status this list does
|
|
25
|
+
* not recognise falls through to `unmapped_status` (diagnosable) instead of
|
|
26
|
+
* being guessed at.
|
|
27
|
+
*/
|
|
28
|
+
const RECAPTURE_STATUSES = [
|
|
29
|
+
// IDV's vocabulary, reached when Daon OCR goes through the shared iframe
|
|
30
|
+
// wrapper. Written as `IDVStatus` members, not literals, so they cannot drift
|
|
31
|
+
// from what the module emits — FDEL-53728 B5 was exactly that drift: a bare
|
|
32
|
+
// 'DOCUMENTS_INVALID' sat here and was dead, because both enums define it as
|
|
33
|
+
// 'AWAITING_DOCUMENT_UPLOAD_INVALID_TYPE'. The `OCRStatus.DOCUMENTS_INVALID`
|
|
34
|
+
// entry below is the real value, which is why this list happened to work and
|
|
35
|
+
// `idvFlow.ts`'s did not.
|
|
36
|
+
IDVStatus.INCOMPLETE,
|
|
37
|
+
IDVStatus.WAITING_DOC_UPLOAD,
|
|
38
|
+
IDVStatus.WAITING_SELFIE_UPLOAD,
|
|
39
|
+
IDVStatus.INTERRUPTED,
|
|
40
|
+
OCRStatus.DOCUMENTS_INVALID,
|
|
41
|
+
OCRStatus.DOCUMENTS_UPLOAD_FAILED,
|
|
42
|
+
OCRStatus.FAILED_FILE_SIZE,
|
|
43
|
+
OCRStatus.FAILED_FILE_FORMAT,
|
|
44
|
+
OCRStatus.SHARE_DECLINED,
|
|
45
|
+
];
|
|
46
|
+
const ABANDONED = { alerts: [], signal: 'user_exited' };
|
|
47
|
+
/**
|
|
48
|
+
* The `ocr` module's own CAPTURE step runner — see `idvFlow.ts` for the
|
|
49
|
+
* mechanism this mirrors (mount-debounce absorption, retry-kind tracking,
|
|
50
|
+
* teardown ordering). The two deltas are documented at their call sites:
|
|
51
|
+
* `oneSdk.component('ocr')` instead of `oneSdk.flow('idv')`, and
|
|
52
|
+
* `detection_complete` always shows the extraction screen — there is no
|
|
53
|
+
* biometrics leg here to suppress it for (contrast FDEL-52471 in idvFlow.ts).
|
|
54
|
+
*/
|
|
55
|
+
export const mkOcrStepRunner = (deps) => {
|
|
56
|
+
const { oneSdk, config, machine, firstPaint } = deps;
|
|
57
|
+
const screens = mkScreenSequence({ oneSdk, config, machine, firstPaint });
|
|
58
|
+
const mkOcr = () => oneSdk.component('ocr');
|
|
59
|
+
let ocr;
|
|
60
|
+
let retryKind = 'recapture';
|
|
61
|
+
const finish = (input, kind = 'recapture') => {
|
|
62
|
+
if (!machine.isPending('CAPTURE'))
|
|
63
|
+
return;
|
|
64
|
+
retryKind = kind;
|
|
65
|
+
machine.complete('CAPTURE', input);
|
|
66
|
+
};
|
|
67
|
+
machine.release(() => finish(ABANDONED));
|
|
68
|
+
const failInternal = (error) => {
|
|
69
|
+
// FDEL-53728 Q2. A transport failure is not an internal fault, and the same
|
|
70
|
+
// 401 must not report one way from the verify-submit and another from
|
|
71
|
+
// `search()`. `transportErrorSignal` returns undefined for everything else,
|
|
72
|
+
// so a genuine fault keeps `unmapped_status` / `internal` as before.
|
|
73
|
+
const transport = transportErrorSignal(error);
|
|
74
|
+
if (transport) {
|
|
75
|
+
finish({
|
|
76
|
+
alerts: [],
|
|
77
|
+
signal: transport,
|
|
78
|
+
errorDetail: { code: transport, message: error.message },
|
|
79
|
+
});
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
finish({
|
|
83
|
+
alerts: [],
|
|
84
|
+
signal: 'unmapped_status',
|
|
85
|
+
errorDetail: { code: 'internal', message: error.message },
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* The verification submit, with the loading screen the reference flow shows
|
|
90
|
+
* around it (`idv.html:264-279` / `ocr_only.html:209-222`). Hidden in a
|
|
91
|
+
* `finally` so a thrown submit cannot strand the spinner over the result
|
|
92
|
+
* screen -- matching the reference, which also drops its loader before
|
|
93
|
+
* mounting the result. That loading screen is conditional, not shown at
|
|
94
|
+
* all when verification was not requested (`triggerVerificationOnSubmit:
|
|
95
|
+
* false`), since there is then no submit for it to wrap.
|
|
96
|
+
*/
|
|
97
|
+
const verifyAndClassify = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
98
|
+
// No submit means no wait, so no loader: `submitAndClassify` returns
|
|
99
|
+
// `captured` synchronously and the applicant would see a spinner flash
|
|
100
|
+
// over work that never happened.
|
|
101
|
+
if (!verificationRequested(config)) {
|
|
102
|
+
return submitAndClassify({ oneSdk, config });
|
|
103
|
+
}
|
|
104
|
+
screens.showVerifying();
|
|
105
|
+
try {
|
|
106
|
+
return yield submitAndClassify({ oneSdk, config });
|
|
107
|
+
}
|
|
108
|
+
finally {
|
|
109
|
+
screens.hideVerifying();
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
const finishCapture = () => {
|
|
113
|
+
screens.hideExtraction();
|
|
114
|
+
void screens
|
|
115
|
+
.presentReview()
|
|
116
|
+
.then(() => verifyAndClassify())
|
|
117
|
+
.then((input) => finish(input, 'data'))
|
|
118
|
+
.catch(failInternal);
|
|
119
|
+
};
|
|
120
|
+
const waits = new Map();
|
|
121
|
+
machine.release(() => {
|
|
122
|
+
const cleared = [...waits.entries()];
|
|
123
|
+
waits.clear();
|
|
124
|
+
cleared.forEach(([timer, wake]) => {
|
|
125
|
+
clearTimeout(timer);
|
|
126
|
+
wake();
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
const now = () => typeof performance === 'undefined' ? Date.now() : performance.now();
|
|
130
|
+
const waitFor = (ms) => new Promise((resolve) => {
|
|
131
|
+
const timer = setTimeout(() => {
|
|
132
|
+
waits.delete(timer);
|
|
133
|
+
resolve();
|
|
134
|
+
}, ms);
|
|
135
|
+
waits.set(timer, resolve);
|
|
136
|
+
});
|
|
137
|
+
let mountClaimedFor;
|
|
138
|
+
/**
|
|
139
|
+
* Same debounce quirk as idvFlow.ts's `mountCapture`, confirmed for this
|
|
140
|
+
* module too — `modules/ocr/index.ts:192` debounces `mount` with the same
|
|
141
|
+
* `MOUNT_DEBOUNCE_WAIT`, leading-edge only.
|
|
142
|
+
*/
|
|
143
|
+
const mountCapture = (flow) => __awaiter(void 0, void 0, void 0, function* () {
|
|
144
|
+
// same as idvFlow.ts: our own loader is the surface `journey_ready` is
|
|
145
|
+
// measured from, and covers the vendor's blank frame while it boots
|
|
146
|
+
// not awaited, for the same reason as idvFlow.ts -- see the note there
|
|
147
|
+
void screens
|
|
148
|
+
.showCaptureLoader()
|
|
149
|
+
.then(() => firstPaint.signal())
|
|
150
|
+
.catch(() => {
|
|
151
|
+
// a loader that fails to mount must not fail the capture step
|
|
152
|
+
});
|
|
153
|
+
const idle = mountClaimedFor === undefined ? Infinity : now() - mountClaimedFor;
|
|
154
|
+
const wait = MOUNT_DEBOUNCE_WAIT - idle;
|
|
155
|
+
mountClaimedFor = now() + Math.max(wait, 0);
|
|
156
|
+
if (wait > 0)
|
|
157
|
+
yield waitFor(wait);
|
|
158
|
+
if (machine.isTorn())
|
|
159
|
+
return;
|
|
160
|
+
flow.mount(config.container);
|
|
161
|
+
});
|
|
162
|
+
const onInputRequired = (checkStatus, flow) => {
|
|
163
|
+
if (checkStatus === IDVStatus.AWAITING_CONSENT) {
|
|
164
|
+
screens.hideExtraction();
|
|
165
|
+
void screens
|
|
166
|
+
.presentConsent()
|
|
167
|
+
.then(() => mountCapture(flow))
|
|
168
|
+
.catch(failInternal);
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
if (checkStatus === IDVStatus.PROVIDER_OFFLINE) {
|
|
172
|
+
// kept for parity with idvFlow.ts / defensiveness against a future
|
|
173
|
+
// vendor — no current OCR vendor reaches this branch (see
|
|
174
|
+
// OCR_CAPTURE_EVENTS doc): Daon and the statusEvaluators.ts vendors both
|
|
175
|
+
// report offline providers as a payload-less `error` instead.
|
|
176
|
+
screens.hideExtraction();
|
|
177
|
+
finish({
|
|
178
|
+
alerts: [],
|
|
179
|
+
signal: 'vendor_offline',
|
|
180
|
+
errorDetail: {
|
|
181
|
+
code: 'PROVIDER_OFFLINE',
|
|
182
|
+
message: 'The identity provider is offline or returned an unrecognised error.',
|
|
183
|
+
},
|
|
184
|
+
});
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
if (checkStatus === IDVStatus.INCOMPLETE) {
|
|
188
|
+
void oneSdk.individual().search().then(finishCapture).catch(failInternal);
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
if (RECAPTURE_STATUSES.includes(checkStatus)) {
|
|
192
|
+
screens.hideExtraction();
|
|
193
|
+
finish({ alerts: ['partial'] }, 'recapture');
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
finish({
|
|
197
|
+
alerts: [],
|
|
198
|
+
signal: 'unmapped_status',
|
|
199
|
+
errorDetail: {
|
|
200
|
+
code: 'unmapped_status',
|
|
201
|
+
message: `Unmodelled OCR status on input_required: ${checkStatus}`,
|
|
202
|
+
},
|
|
203
|
+
});
|
|
204
|
+
};
|
|
205
|
+
const captureListeners = (flow) => ({
|
|
206
|
+
// Unlike idvFlow.ts, never suppressed: there is no biometrics leg whose
|
|
207
|
+
// own detection_complete should be the one that shows extraction instead.
|
|
208
|
+
detection_complete: (props) => {
|
|
209
|
+
// same as idvFlow.ts — Daon OCR goes through the very same iframe
|
|
210
|
+
// wrapper, which holds its frame open across the results poll
|
|
211
|
+
if ((props === null || props === void 0 ? void 0 : props.provider) !== 'sumsub')
|
|
212
|
+
screens.removeVendorFrames();
|
|
213
|
+
screens.showExtraction();
|
|
214
|
+
},
|
|
215
|
+
/**
|
|
216
|
+
* See the CAPTURE row's `vendor_sdk_failed_loading` signal
|
|
217
|
+
* (`stepTable.ts`). The vendor's SDK never loaded, so there is no capture
|
|
218
|
+
* UI and no amount of waiting produces one — `classify.ts` lists
|
|
219
|
+
* `vendor_load_failed` as unrecoverable, so the applicant is not offered a
|
|
220
|
+
* retry that cannot succeed. Settled directly, not deferred: this fires
|
|
221
|
+
* immediately before the generic `error` the loader also emits, and
|
|
222
|
+
* first-wins is what claims the step (FDEL-53728 Q2).
|
|
223
|
+
*/
|
|
224
|
+
vendor_sdk_failed_loading: (failure) => {
|
|
225
|
+
screens.hideExtraction();
|
|
226
|
+
const vendor = failure === null || failure === void 0 ? void 0 : failure.vendor;
|
|
227
|
+
finish({
|
|
228
|
+
alerts: [],
|
|
229
|
+
signal: 'vendor_load_failed',
|
|
230
|
+
errorDetail: {
|
|
231
|
+
code: 'vendor_load_failed',
|
|
232
|
+
message: `Vendor sdk '${vendor !== null && vendor !== void 0 ? vendor : 'unknown'}' failed loading`,
|
|
233
|
+
vendor,
|
|
234
|
+
},
|
|
235
|
+
});
|
|
236
|
+
},
|
|
237
|
+
/**
|
|
238
|
+
* See the CAPTURE row's `detection_failed` signal (`stepTable.ts`).
|
|
239
|
+
*
|
|
240
|
+
* Deferred by exactly one microtask, which is the whole fix (FDEL-53728
|
|
241
|
+
* B7). Iframe vendors, Truuth and OcrLabs emit this and then go quiet, so
|
|
242
|
+
* without it the container is blank and the step never settles. Onfido and
|
|
243
|
+
* IDVerse emit it *first* and then, in the same synchronous burst, emit the
|
|
244
|
+
* event that actually says what happened — a user exit, a rejection. The
|
|
245
|
+
* EventHub is synchronous, so deferring one microtask lets every one of
|
|
246
|
+
* those land before this does, and `finish()` is a no-op once the step has
|
|
247
|
+
* settled. A timer would do the same job less exactly; this is ordering,
|
|
248
|
+
* not waiting, so nothing is left on the clock for teardown to clear.
|
|
249
|
+
*/
|
|
250
|
+
detection_failed: (failure) => {
|
|
251
|
+
const message = failure === null || failure === void 0 ? void 0 : failure.message;
|
|
252
|
+
void Promise.resolve().then(() => finish({
|
|
253
|
+
alerts: [],
|
|
254
|
+
signal: 'vendor_offline',
|
|
255
|
+
errorDetail: {
|
|
256
|
+
code: 'detection_failed',
|
|
257
|
+
message: message
|
|
258
|
+
? String(message)
|
|
259
|
+
: 'The vendor ended capture without a result.',
|
|
260
|
+
},
|
|
261
|
+
}));
|
|
262
|
+
},
|
|
263
|
+
error: (error) => {
|
|
264
|
+
var _a;
|
|
265
|
+
const payload = error === null || error === void 0 ? void 0 : error.payload;
|
|
266
|
+
// FDEL-53728 B6, same as `idvFlow.ts`. Daon OCR goes through
|
|
267
|
+
// `defineIframeIDVWrapper` and so through `checkStatusEventMapping.ts`,
|
|
268
|
+
// which emits AWAITING_CONSENT and PROVIDER_OFFLINE as an `error` with
|
|
269
|
+
// the status under `errorStatus` — never as `input_required`. QA
|
|
270
|
+
// recorded OCR as unaffected, but measured it on Onfido; on Daon this
|
|
271
|
+
// half had the identical defect.
|
|
272
|
+
const { errorStatus } = payload !== null && payload !== void 0 ? payload : {};
|
|
273
|
+
if (errorStatus !== undefined) {
|
|
274
|
+
onInputRequired(String(errorStatus), flow);
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
screens.hideExtraction();
|
|
278
|
+
if ((payload === null || payload === void 0 ? void 0 : payload.result) === 'REJECTED') {
|
|
279
|
+
finish({ alerts: [], signal: 'idv_rejected' });
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
// statusEvaluators.ts's PROVIDER_OFFLINE/FAILED/WAITING_OCR_RUN cases
|
|
283
|
+
// (Incode/Onfido/Sumsub) emit exactly this: a payload-less error, so
|
|
284
|
+
// `payload?.checkStatus` is `undefined` and this generic fallback is
|
|
285
|
+
// what actually classifies them, not a special case above.
|
|
286
|
+
finish({
|
|
287
|
+
alerts: [],
|
|
288
|
+
signal: 'vendor_offline',
|
|
289
|
+
errorDetail: {
|
|
290
|
+
code: String((_a = payload === null || payload === void 0 ? void 0 : payload.checkStatus) !== null && _a !== void 0 ? _a : 'ocr_error'),
|
|
291
|
+
message: error.message,
|
|
292
|
+
},
|
|
293
|
+
});
|
|
294
|
+
},
|
|
295
|
+
info: (payload) => {
|
|
296
|
+
if (payload.name !== 'FetchProcessingExceededAttempts')
|
|
297
|
+
return;
|
|
298
|
+
screens.hideExtraction();
|
|
299
|
+
finish({ alerts: [], signal: 'processing_timeout' });
|
|
300
|
+
},
|
|
301
|
+
session_interrupted: (payload) => {
|
|
302
|
+
const closed = (payload === null || payload === void 0 ? void 0 : payload.eventName) === 'USER_CLOSED_MODAL';
|
|
303
|
+
finish({
|
|
304
|
+
alerts: [],
|
|
305
|
+
signal: closed ? 'user_exited' : 'session_interrupted',
|
|
306
|
+
});
|
|
307
|
+
},
|
|
308
|
+
input_required: (_info, checkStatus) => onInputRequired(String(checkStatus), flow),
|
|
309
|
+
results: () => finishCapture(),
|
|
310
|
+
});
|
|
311
|
+
const ensureOcr = () => {
|
|
312
|
+
if (ocr)
|
|
313
|
+
return ocr;
|
|
314
|
+
const flow = mkOcr();
|
|
315
|
+
const listeners = captureListeners(flow);
|
|
316
|
+
const emitter = flow;
|
|
317
|
+
OCR_CAPTURE_EVENTS.forEach((event) => emitter.on(event, listeners[event]));
|
|
318
|
+
// same standard vendor-module 'ready' event as idvFlow.ts, reachable as
|
|
319
|
+
// the first screen only when every pre-capture screen is off.
|
|
320
|
+
//
|
|
321
|
+
// KNOWN GAP, vendor-by-vendor, not yet fixed (see idvFlow.ts's own note
|
|
322
|
+
// — `ready` is purely vendor-delegated, not equally reliable here either):
|
|
323
|
+
// - dummy-ocr: NEVER emits `ready` at all (only session_data_*/results) —
|
|
324
|
+
// journey_ready never fires for that attempt if it's the provider and
|
|
325
|
+
// CAPTURE is the first screen.
|
|
326
|
+
// - Incode: fires right after the camera-render call *returns*, not
|
|
327
|
+
// after anything is confirmed painted.
|
|
328
|
+
// - Daon: the shared iframe wrapper fires on the iframe's own `onload`,
|
|
329
|
+
// same caveat as idvFlow.ts.
|
|
330
|
+
// - Onfido, Sumsub, IDVerse: confirmed against real vendor-declared or
|
|
331
|
+
// DOM-observed readiness.
|
|
332
|
+
//
|
|
333
|
+
// `journey_ready` no longer depends on any of this — it is signalled from
|
|
334
|
+
// our own capture loader in `mountCapture`. This watch stays as a backstop
|
|
335
|
+
// for the path where that loader fails to mount, and is idempotent.
|
|
336
|
+
firstPaint.watch(emitter, ['ready']);
|
|
337
|
+
// Take our loader down once the vendor says it is up (see idvFlow.ts).
|
|
338
|
+
const hideLoader = () => screens.hideCaptureLoader();
|
|
339
|
+
emitter.on('ready', hideLoader);
|
|
340
|
+
machine.release(() => { var _a; return (_a = emitter.off) === null || _a === void 0 ? void 0 : _a.call(emitter, 'ready', hideLoader); });
|
|
341
|
+
machine.release(() => {
|
|
342
|
+
OCR_CAPTURE_EVENTS.forEach((event) => { var _a; return (_a = emitter.off) === null || _a === void 0 ? void 0 : _a.call(emitter, event, listeners[event]); });
|
|
343
|
+
flow.unmount();
|
|
344
|
+
});
|
|
345
|
+
ocr = flow;
|
|
346
|
+
return flow;
|
|
347
|
+
};
|
|
348
|
+
/**
|
|
349
|
+
* spec §6 — data-correction retry: PARTIAL screen, review form, resubmit
|
|
350
|
+
*
|
|
351
|
+
* Only reached when `withReview` is on: `submitAndClassify.ts` settles a
|
|
352
|
+
* retryable result as `declined / checks_failed` when it is off, so the loop
|
|
353
|
+
* never asks for a correction the review screen is not there to collect
|
|
354
|
+
* (FDEL-53227).
|
|
355
|
+
*/
|
|
356
|
+
const retryWithCorrectedData = () => screens
|
|
357
|
+
.presentPartial()
|
|
358
|
+
.then(() => screens.presentReview())
|
|
359
|
+
.then(() => verifyAndClassify())
|
|
360
|
+
.then((input) => finish(input, 'data'))
|
|
361
|
+
.catch(failInternal);
|
|
362
|
+
const startAtReview = () => screens
|
|
363
|
+
.presentReview()
|
|
364
|
+
.then(() => verifyAndClassify())
|
|
365
|
+
.then((input) => finish(input, 'data'))
|
|
366
|
+
.catch(failInternal);
|
|
367
|
+
const run = (attempt) => {
|
|
368
|
+
if (machine.isTorn())
|
|
369
|
+
return Promise.resolve(ABANDONED);
|
|
370
|
+
return machine.run('CAPTURE', () => {
|
|
371
|
+
if (attempt === 0 && config.startAt === 'REVIEW') {
|
|
372
|
+
void startAtReview();
|
|
373
|
+
return undefined;
|
|
374
|
+
}
|
|
375
|
+
if (attempt > 0 && retryKind === 'data') {
|
|
376
|
+
void retryWithCorrectedData();
|
|
377
|
+
return undefined;
|
|
378
|
+
}
|
|
379
|
+
const flow = ensureOcr();
|
|
380
|
+
const start = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
381
|
+
if (attempt === 0 && config.startAt !== 'CAPTURE') {
|
|
382
|
+
yield screens.presentPreCapture();
|
|
383
|
+
}
|
|
384
|
+
yield mountCapture(flow);
|
|
385
|
+
});
|
|
386
|
+
void start().catch(failInternal);
|
|
387
|
+
return undefined;
|
|
388
|
+
});
|
|
389
|
+
};
|
|
390
|
+
/**
|
|
391
|
+
* Leave the container clear for the journey's own terminal card
|
|
392
|
+
* (FDEL-53993 QA B10).
|
|
393
|
+
*
|
|
394
|
+
* The journey has never had an event meaning "my UI is gone". `results` says
|
|
395
|
+
* the check came back COMPLETE, nothing more, so this was never waited on —
|
|
396
|
+
* it was merely arrived at late: `showVerifying()` covered the container and
|
|
397
|
+
* `submit()` added a network round trip, and the vendor removed itself inside
|
|
398
|
+
* that window. Capture-only has neither, so the terminal card was mounting
|
|
399
|
+
* over a vendor still on screen.
|
|
400
|
+
*
|
|
401
|
+
* **Asking the vendor to unmount is not enough, which is how the first fix
|
|
402
|
+
* failed.** `ocr.unmount()` is `wrapperContextRef.current?.unmount?.()`, and
|
|
403
|
+
* most wrappers never set one: of the OCR vendors only Onfido and Incode
|
|
404
|
+
* implement it — Daon, IDVerse, Sumsub and dummy-ocr do not — so for them it
|
|
405
|
+
* optional-chains into nothing and their DOM stays exactly where it is.
|
|
406
|
+
*
|
|
407
|
+
* So the vendor is asked first, as a courtesy to the wrappers that do clean
|
|
408
|
+
* up after themselves properly, and then the journey clears the container it
|
|
409
|
+
* owns. That works whatever the vendor implements. `unmountAll()` comes
|
|
410
|
+
* before the clear so the journey's own React screens unmount through their
|
|
411
|
+
* own lifecycle rather than having their DOM pulled from under them.
|
|
412
|
+
*
|
|
413
|
+
* `removeVendorFrames()` on `detection_complete` is untouched and still
|
|
414
|
+
* handles iframe vendors earlier; this is the backstop for every shape.
|
|
415
|
+
*
|
|
416
|
+
* **Called only at terminal settlement, never from `finish()`.** `ensureOcr()`
|
|
417
|
+
* caches and REUSES this instance — a recapture retry re-mounts the same
|
|
418
|
+
* object — so doing this per attempt would tear down a capture still in use.
|
|
419
|
+
* A retry never reaches the terminal path, which is why that is the safe seam.
|
|
420
|
+
*/
|
|
421
|
+
const clearForTerminalScreen = () => {
|
|
422
|
+
try {
|
|
423
|
+
ocr === null || ocr === void 0 ? void 0 : ocr.unmount();
|
|
424
|
+
}
|
|
425
|
+
catch (_a) {
|
|
426
|
+
// swallow: a wrapper with no `unmount`, or one that throws in it, must
|
|
427
|
+
// not stop the clear below — nor the terminal card that follows it
|
|
428
|
+
}
|
|
429
|
+
screens.unmountAll();
|
|
430
|
+
config.container.innerHTML = '';
|
|
431
|
+
};
|
|
432
|
+
return { run, clearForTerminalScreen };
|
|
433
|
+
};
|
|
434
|
+
//# sourceMappingURL=ocrFlow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ocrFlow.js","sourceRoot":"","sources":["../../../../../modules/journey/flows/ocrFlow.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,0CAA0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,IAAI,OAAO,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;oBAClD,MAAM,OAAO,CAAC,iBAAiB,EAAE,CAAC;gBACpC,CAAC;gBACD,MAAM,YAAY,CAAC,IAAI,CAAC,CAAC;YAC3B,CAAC,CAAA,CAAC;YACF,KAAK,KAAK,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;YACjC,OAAO,SAAS,CAAC;QACnB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,MAAM,sBAAsB,GAAG,GAAS,EAAE;QACxC,IAAI,CAAC;YACH,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,OAAO,EAAE,CAAC;QACjB,CAAC;QAAC,WAAM,CAAC;YACP,uEAAuE;YACvE,mEAAmE;QACrE,CAAC;QACD,OAAO,CAAC,UAAU,EAAE,CAAC;QACrB,MAAM,CAAC,SAAS,CAAC,SAAS,GAAG,EAAE,CAAC;IAClC,CAAC,CAAC;IAEF,OAAO,EAAE,GAAG,EAAE,sBAAsB,EAAE,CAAC;AACzC,CAAC,CAAC"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import type { OneSdkContext } from '../../sdk/types/oneSDK';
|
|
2
|
+
import type { FirstPaintSignal } from '../steps/firstPaint';
|
|
3
|
+
import type { StepMachine } from '../steps/stepMachine';
|
|
4
|
+
import type { JourneyResultConfig } from '../types/resultConfig';
|
|
5
|
+
export type JourneyScreenConfig = {
|
|
6
|
+
container: HTMLElement;
|
|
7
|
+
withStart?: boolean;
|
|
8
|
+
withWelcome?: boolean;
|
|
9
|
+
withConsent?: boolean;
|
|
10
|
+
withReview?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Whether the journey mounts its own terminal RESULT screen. Defaults to
|
|
13
|
+
* `true` — it renders today, so turning it off cannot be a silent breaking
|
|
14
|
+
* change, which is why this toggle is opt-OUT where the others are opt-in.
|
|
15
|
+
*
|
|
16
|
+
* Off means the host owns the ending: `start()` resolves as soon as the
|
|
17
|
+
* outcome is known, nothing is mounted, and the container is emptied on
|
|
18
|
+
* settlement (`journeyHandle.ts`'s `cleanupOnSettle`) so the host can
|
|
19
|
+
* immediately reuse it.
|
|
20
|
+
*
|
|
21
|
+
* Governs the TERMINAL screen only. The PARTIAL screen shares the same
|
|
22
|
+
* component but is part of the data-correction retry, not an ending —
|
|
23
|
+
* `withReview: false` is what disables that path.
|
|
24
|
+
*/
|
|
25
|
+
withResult?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* The form module's native RESULT config, per screen state, verbatim — the
|
|
28
|
+
* same passthrough `review`, `welcome` and `consent` already have. Layered
|
|
29
|
+
* over the SDK's own defaults (`result.config.ts`'s `resultInfoMapping`), so
|
|
30
|
+
* naming one key overrides only that key.
|
|
31
|
+
*
|
|
32
|
+
* The journey keeps `state`: the outcome decides which card renders. A `cta`
|
|
33
|
+
* here also decides settlement — see `screens/resultScreen.ts`. `PARTIAL` is
|
|
34
|
+
* the data-correction retry card and is NOT governed by `withResult`.
|
|
35
|
+
*/
|
|
36
|
+
result?: JourneyResultConfig;
|
|
37
|
+
/**
|
|
38
|
+
* Whether the flow calls `individual().submit({ verify: true })` itself.
|
|
39
|
+
* Defaults to `true`; `false` settles `success / captured` instead, for a
|
|
40
|
+
* host that verifies server-side on its own schedule.
|
|
41
|
+
*
|
|
42
|
+
* **idv and ocr only.** `ekycFlow.ts` never calls `submitAndClassify` —
|
|
43
|
+
* REVIEW's own `ReviewDocument.tsx` submits and reports the outcome — so the
|
|
44
|
+
* flag has nothing to switch there. `EkycJourneyOptions` in `../index.ts`
|
|
45
|
+
* types it away for that flow rather than leaving it silently ignored.
|
|
46
|
+
*/
|
|
47
|
+
triggerVerificationOnSubmit?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* TEST SEAM — not a customer-facing option. Begins the journey at a later
|
|
50
|
+
* step, skipping everything before it, so a single screen's config can be
|
|
51
|
+
* exercised without walking the whole flow.
|
|
52
|
+
*
|
|
53
|
+
* `'REVIEW'` is the one that cannot be reached any other way: the review
|
|
54
|
+
* screen normally requires a completed vendor capture, so testing review field
|
|
55
|
+
* config otherwise means a real document scan per iteration. It composes with
|
|
56
|
+
* `simulate` (which settles an outcome without a vendor) and, like it, produces
|
|
57
|
+
* states a real applicant cannot reach — the review form opens with whatever
|
|
58
|
+
* data the entity already has, which for a fresh entity is nothing.
|
|
59
|
+
*/
|
|
60
|
+
startAt?: 'CAPTURE' | 'REVIEW';
|
|
61
|
+
logo?: string;
|
|
62
|
+
welcome?: Record<string, unknown>;
|
|
63
|
+
consent?: Record<string, unknown>;
|
|
64
|
+
/**
|
|
65
|
+
* The form module's native REVIEW config, verbatim. Keeps the per-country /
|
|
66
|
+
* per-state structure — the journey does not flatten or translate it, because
|
|
67
|
+
* any simplified shape would have to grow that structure back.
|
|
68
|
+
*/
|
|
69
|
+
review?: Record<string, unknown>;
|
|
70
|
+
start?: Record<string, unknown>;
|
|
71
|
+
/** ekycFlow.ts only — the form module's native PERSONAL/DOCUMENT config, verbatim */
|
|
72
|
+
personal?: Record<string, unknown>;
|
|
73
|
+
document?: Record<string, unknown>;
|
|
74
|
+
/**
|
|
75
|
+
* ekycFlow.ts only — the form module's native RETRY config, verbatim. The
|
|
76
|
+
* data-correction retry's own screen (`Retry.tsx`), not `review`'s config:
|
|
77
|
+
* it renders `<ReviewDocument/>` once it lands back on REVIEW, and that
|
|
78
|
+
* still reads `review`'s config (the react form vendor's redux store is a
|
|
79
|
+
* module-level singleton — `modules/form/vendors/react/redux/store.ts` —
|
|
80
|
+
* so the REVIEW slot populated by the main attempt persists into the retry
|
|
81
|
+
* mount without needing to be repeated here).
|
|
82
|
+
*/
|
|
83
|
+
retry?: Record<string, unknown>;
|
|
84
|
+
/**
|
|
85
|
+
* idvFlow.ts/ocrFlow.ts only — the form module's native LOADING config for
|
|
86
|
+
* the screen shown over the container while the vendor's capture UI boots.
|
|
87
|
+
* That screen is a bare spinner by default; pass `title`/`descriptions`
|
|
88
|
+
* here to put copy back.
|
|
89
|
+
*/
|
|
90
|
+
captureLoader?: Record<string, unknown>;
|
|
91
|
+
/**
|
|
92
|
+
* idvFlow.ts/ocrFlow.ts only — the form module's native LOADING config for
|
|
93
|
+
* the screen shown while the verification submit is in flight. Defaults to
|
|
94
|
+
* `manualLoading`, the SDK's own copy for this moment.
|
|
95
|
+
*/
|
|
96
|
+
verifying?: Record<string, unknown>;
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* How the DOCUMENT screen was left. Alone among the screen steps it has two
|
|
100
|
+
* exits, not one: `'ready'` is `form:document:ready` (an ID type was picked)
|
|
101
|
+
* and `'back'` is IdSelection.tsx's "Back" link, which returns to PERSONAL.
|
|
102
|
+
* See `stepTable.ts`'s DOCUMENT row.
|
|
103
|
+
*/
|
|
104
|
+
export type DocumentExit = 'ready' | 'back';
|
|
105
|
+
export type ScreenSequence = {
|
|
106
|
+
presentPreCapture: () => Promise<void>;
|
|
107
|
+
presentConsent: () => Promise<void>;
|
|
108
|
+
showCaptureLoader: () => Promise<void>;
|
|
109
|
+
hideCaptureLoader: () => void;
|
|
110
|
+
removeVendorFrames: () => void;
|
|
111
|
+
showExtraction: () => void;
|
|
112
|
+
hideExtraction: () => void;
|
|
113
|
+
showVerifying: () => void;
|
|
114
|
+
hideVerifying: () => void;
|
|
115
|
+
presentPersonal: () => Promise<void>;
|
|
116
|
+
presentDocument: () => Promise<DocumentExit>;
|
|
117
|
+
presentReview: () => Promise<void>;
|
|
118
|
+
presentPartial: () => Promise<void>;
|
|
119
|
+
unmountAll: () => void;
|
|
120
|
+
};
|
|
121
|
+
export declare const mkScreenSequence: (deps: {
|
|
122
|
+
oneSdk: OneSdkContext;
|
|
123
|
+
config: JourneyScreenConfig;
|
|
124
|
+
machine: StepMachine;
|
|
125
|
+
firstPaint: FirstPaintSignal;
|
|
126
|
+
}) => ScreenSequence;
|
|
127
|
+
//# sourceMappingURL=screenSequence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screenSequence.d.ts","sourceRoot":"","sources":["../../../../../modules/journey/flows/screenSequence.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAI9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAe,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAErE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE,MAAM,MAAM,mBAAmB,GAAG;IAChC,SAAS,EAAE,WAAW,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;;;;;;;;;OAaG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B;;;;;;;;;OASG;IACH,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,qFAAqF;IACrF,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC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