@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,418 @@
|
|
|
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
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
11
|
+
var t = {};
|
|
12
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
13
|
+
t[p] = s[p];
|
|
14
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
15
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
16
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
17
|
+
t[p[i]] = s[p[i]];
|
|
18
|
+
}
|
|
19
|
+
return t;
|
|
20
|
+
};
|
|
21
|
+
import { FORM_DOCUMENT_BACK } from '../../form/events.js';
|
|
22
|
+
import { RESULT_STATE } from '../../form/vendors/react/appConfig.type.js';
|
|
23
|
+
import { manualLoading } from '../../form/vendors/react/features/Loading/loading.config.js';
|
|
24
|
+
import { hostCtaKeysOnly } from '../screens/ctaConfig.js';
|
|
25
|
+
const REQUIRED_CONSENTS = ['general', 'docs', 'creditheader'];
|
|
26
|
+
export const mkScreenSequence = (deps) => {
|
|
27
|
+
const { oneSdk, config, machine, firstPaint } = deps;
|
|
28
|
+
let open = [];
|
|
29
|
+
let extraction;
|
|
30
|
+
let verifying;
|
|
31
|
+
let captureLoader;
|
|
32
|
+
/** whether we had to position `config.container` ourselves, to restore it */
|
|
33
|
+
let containerWasStatic = false;
|
|
34
|
+
const logo = config.logo ? { src: config.logo } : undefined;
|
|
35
|
+
const unmountAll = () => {
|
|
36
|
+
const screens = open;
|
|
37
|
+
open = [];
|
|
38
|
+
extraction = undefined;
|
|
39
|
+
verifying = undefined;
|
|
40
|
+
// the loader owns a DOM node of its own, so it needs more than an unmount
|
|
41
|
+
hideCaptureLoader();
|
|
42
|
+
restoreContainer();
|
|
43
|
+
screens.forEach((screen) => {
|
|
44
|
+
// guard each unmount individually -- one screen throwing must not
|
|
45
|
+
// abort cleanup of the rest, nor propagate out of teardown.
|
|
46
|
+
try {
|
|
47
|
+
screen.unmount();
|
|
48
|
+
}
|
|
49
|
+
catch (_a) {
|
|
50
|
+
// swallow: a noisy unmount is preferable to a half-torn-down journey
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
machine.release(unmountAll);
|
|
55
|
+
/**
|
|
56
|
+
* Wire the extra events that ALSO complete `step`, each with the value the
|
|
57
|
+
* step then settles with. `stepMachine`'s `attach()` completes with no
|
|
58
|
+
* value, which is all a single-exit step needs; a step with more than one
|
|
59
|
+
* exit has to report WHICH one happened, so these listeners call
|
|
60
|
+
* `complete()` with the value themselves. Released on the machine's single
|
|
61
|
+
* teardown, exactly like `attach()`'s own listeners.
|
|
62
|
+
*/
|
|
63
|
+
const wireExits = (spec) => {
|
|
64
|
+
const listeners = Object.entries(spec.exits).map(([event, value]) => [event, () => machine.complete(spec.step, value)]);
|
|
65
|
+
listeners.forEach(([event, cb]) => spec.emitter.on(event, cb));
|
|
66
|
+
machine.release(() => listeners.forEach(([event, cb]) => { var _a, _b; return (_b = (_a = spec.emitter).off) === null || _b === void 0 ? void 0 : _b.call(_a, event, cb); }));
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Mount a form screen as a step, and let the machine complete that step when
|
|
70
|
+
* the event `stepTable.ts` declares for it arrives.
|
|
71
|
+
*
|
|
72
|
+
* Which event that is, and what it actually means, is not decided here: it is
|
|
73
|
+
* in the table, in one reviewable place, because every `FORM_*_READY` event a
|
|
74
|
+
* screen step waits on is emitted on CTA click / submit and not on render.
|
|
75
|
+
* That is also why there is **no timeout**: these are human-gated waits, and
|
|
76
|
+
* a person reading a consent screen is not a stalled flow. Timeouts guard
|
|
77
|
+
* engine silence, never human action.
|
|
78
|
+
*
|
|
79
|
+
* A screen that fails to *mount* is engine silence, and fails the step — the
|
|
80
|
+
* runner attributes that as `error / internal` rather than pretending the
|
|
81
|
+
* applicant acted. A step started after `destroy()` never gets this far: the
|
|
82
|
+
* machine refuses before the screen is even constructed.
|
|
83
|
+
*/
|
|
84
|
+
const mountStep = (spec) => machine.run(spec.step, (attach) => {
|
|
85
|
+
var _a;
|
|
86
|
+
// same reason as showExtraction(): a step screen mounting means capture
|
|
87
|
+
// is over, so the loader must not outlive it on a vendor whose `ready`
|
|
88
|
+
// never arrived. A no-op before capture, when there is no loader yet.
|
|
89
|
+
hideCaptureLoader();
|
|
90
|
+
const screen = oneSdk.component('form', Object.assign({ logo }, spec.options));
|
|
91
|
+
open.push(screen);
|
|
92
|
+
// Listener attached before mounting, so a fast CTA cannot be missed. The
|
|
93
|
+
// form component types `on` per screen/event key while the table hands it
|
|
94
|
+
// a `string`, so the emitter is cast once, here, at the boundary.
|
|
95
|
+
const emitter = screen;
|
|
96
|
+
attach(emitter);
|
|
97
|
+
wireExits({ step: spec.step, emitter, exits: (_a = spec.exits) !== null && _a !== void 0 ? _a : {} });
|
|
98
|
+
// ScreenWrapper.tsx fires `form:{name}:loaded` for every screen it
|
|
99
|
+
// renders (`eventName` mirrors `options.name`, same derivation
|
|
100
|
+
// `getEventConfig` itself uses) — whichever screen this journey
|
|
101
|
+
// mounts first is the one that decides when `journey_ready` fires.
|
|
102
|
+
firstPaint.watch(emitter, [
|
|
103
|
+
`form:${String(spec.options.name)}:loaded`.toLowerCase(),
|
|
104
|
+
]);
|
|
105
|
+
return screen.mount(config.container);
|
|
106
|
+
});
|
|
107
|
+
/** the single-exit case: every screen step but DOCUMENT */
|
|
108
|
+
const present = (step, options) => mountStep({ step, options });
|
|
109
|
+
const hasConsent = () => {
|
|
110
|
+
var _a;
|
|
111
|
+
const given = (_a = oneSdk.individual().access('consentsGiven').getValue()) !== null && _a !== void 0 ? _a : [];
|
|
112
|
+
return REQUIRED_CONSENTS.every((consent) => given.includes(consent));
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* Present the consent screen and record consent once the applicant submits
|
|
116
|
+
* it. Also reachable mid-capture: the engine's `AWAITING_CONSENT` status
|
|
117
|
+
* asks for consent to be re-presented (spec §5.4).
|
|
118
|
+
*/
|
|
119
|
+
const presentConsent = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
120
|
+
yield present('CONSENT', Object.assign({ name: 'CONSENT', mode: 'individual', type: 'manual' }, config.consent));
|
|
121
|
+
REQUIRED_CONSENTS.forEach((consent) => oneSdk.individual().addConsent(consent));
|
|
122
|
+
});
|
|
123
|
+
const presentPreCapture = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
124
|
+
if (config.withStart) {
|
|
125
|
+
yield present('START', Object.assign({ name: 'START' }, config.start));
|
|
126
|
+
}
|
|
127
|
+
if (config.withWelcome) {
|
|
128
|
+
yield present('WELCOME', Object.assign({ name: 'WELCOME' }, config.welcome));
|
|
129
|
+
}
|
|
130
|
+
if (!config.withConsent || hasConsent())
|
|
131
|
+
return;
|
|
132
|
+
yield presentConsent();
|
|
133
|
+
});
|
|
134
|
+
/** ekycFlow.ts only — no vendor capture, so PERSONAL/DOCUMENT are just form screens */
|
|
135
|
+
const presentPersonal = () => present('PERSONAL', Object.assign({ name: 'PERSONAL', mode: 'individual', type: 'manual' }, config.personal));
|
|
136
|
+
/**
|
|
137
|
+
* ekycFlow.ts only. The one screen step with two exits (`DocumentExit`).
|
|
138
|
+
*
|
|
139
|
+
* `form:document:ready` completes it the ordinary way, through the table's
|
|
140
|
+
* DOCUMENT row, and resolves `'ready'`. IdSelection.tsx's "Back" link
|
|
141
|
+
* (`form:document:back`) is wired as a second exit because the form vendor
|
|
142
|
+
* tears its own screen down on that event — `vendors/react/index.tsx`
|
|
143
|
+
* registers `cleanUpInstance` on `{screen}:back` as well as `{screen}:ready`
|
|
144
|
+
* — so a flow that ignores it is left with a blank container and a DOCUMENT
|
|
145
|
+
* step that never completes. The caller re-presents PERSONAL, which is what
|
|
146
|
+
* `templateManualKyc.js` does by hand for the same event.
|
|
147
|
+
*/
|
|
148
|
+
const presentDocument = () => mountStep({
|
|
149
|
+
step: 'DOCUMENT',
|
|
150
|
+
options: Object.assign({ name: 'DOCUMENT', mode: 'individual', type: 'manual' }, config.document),
|
|
151
|
+
exits: { [FORM_DOCUMENT_BACK]: 'back' },
|
|
152
|
+
// `attach()` completes with no value, so the table's own row is the
|
|
153
|
+
// `undefined` branch here
|
|
154
|
+
}).then((exit) => exit !== null && exit !== void 0 ? exit : 'ready');
|
|
155
|
+
/**
|
|
156
|
+
* Resolve after the browser has actually painted, not merely after React has
|
|
157
|
+
* been told to render. A single rAF callback runs *before* the next paint, so
|
|
158
|
+
* the second one is what guarantees the frame is on screen — which is the
|
|
159
|
+
* whole point here: `journey_ready` must not tell a host to drop their
|
|
160
|
+
* loading UI while ours is still invisible. Degrades to a resolved promise
|
|
161
|
+
* where rAF does not exist (SSR, older test environments).
|
|
162
|
+
*/
|
|
163
|
+
const nextPaint = () => new Promise((resolve) => {
|
|
164
|
+
if (typeof requestAnimationFrame !== 'function') {
|
|
165
|
+
resolve();
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
let inner;
|
|
169
|
+
const outer = requestAnimationFrame(() => {
|
|
170
|
+
inner = requestAnimationFrame(() => resolve());
|
|
171
|
+
});
|
|
172
|
+
// Registered like every other timer the journey opens: `teardown()`
|
|
173
|
+
// must leave none behind (`stepMachine.ts`). Resolving on release also
|
|
174
|
+
// stops the caller hanging forever on a frame that will never come.
|
|
175
|
+
machine.release(() => {
|
|
176
|
+
cancelAnimationFrame(outer);
|
|
177
|
+
if (inner !== undefined)
|
|
178
|
+
cancelAnimationFrame(inner);
|
|
179
|
+
resolve();
|
|
180
|
+
});
|
|
181
|
+
});
|
|
182
|
+
/**
|
|
183
|
+
* Mount our own loading screen over the container the vendor is about to
|
|
184
|
+
* mount into, and resolve once it has painted.
|
|
185
|
+
*
|
|
186
|
+
* It gets its own absolutely-positioned host element rather than being
|
|
187
|
+
* appended straight into `config.container`: the vendor iframe is itself
|
|
188
|
+
* `position: absolute; inset: 0` (`createIframe.ts:48-60`), and a positioned
|
|
189
|
+
* element paints above in-flow siblings — so a plainly-appended loader would
|
|
190
|
+
* sit *behind* the iframe and be hidden by its opaque white document the
|
|
191
|
+
* moment that document loads, which is exactly the window this is meant to
|
|
192
|
+
* cover.
|
|
193
|
+
*
|
|
194
|
+
* This does NOT make the vendor's own `ready` accurate — see the per-vendor
|
|
195
|
+
* notes at `idvFlow.ts`/`ocrFlow.ts`'s `firstPaint.watch` call sites. What it
|
|
196
|
+
* does is make the *host-facing* signal deterministic (we own this surface,
|
|
197
|
+
* so we know when it painted) and replace an unstyled white gap with our own
|
|
198
|
+
* loading state for the vendors whose `ready` fires early.
|
|
199
|
+
*/
|
|
200
|
+
const showCaptureLoader = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
201
|
+
if (machine.isTorn() || captureLoader)
|
|
202
|
+
return;
|
|
203
|
+
const host = document.createElement('div');
|
|
204
|
+
Object.assign(host.style, {
|
|
205
|
+
position: 'absolute',
|
|
206
|
+
top: '0',
|
|
207
|
+
left: '0',
|
|
208
|
+
right: '0',
|
|
209
|
+
bottom: '0',
|
|
210
|
+
zIndex: '1',
|
|
211
|
+
});
|
|
212
|
+
// `inset: 0` anchors to the nearest positioned ancestor; if the host's
|
|
213
|
+
// container is static the loader would escape it, so position it — and
|
|
214
|
+
// record that we did, to put it back on teardown. Browsers report the
|
|
215
|
+
// default as `static`, jsdom reports it as an empty string; both mean
|
|
216
|
+
// "not positioned".
|
|
217
|
+
const containerPosition = getComputedStyle(config.container).position;
|
|
218
|
+
if (!containerPosition || containerPosition === 'static') {
|
|
219
|
+
config.container.style.position = 'relative';
|
|
220
|
+
containerWasStatic = true;
|
|
221
|
+
}
|
|
222
|
+
config.container.appendChild(host);
|
|
223
|
+
const screen = oneSdk.component('form', Object.assign({ name: 'LOADING', logo,
|
|
224
|
+
// Bare spinner: no copy. Both have to be suppressed explicitly rather
|
|
225
|
+
// than omitted — `Loading.tsx:15-16` merges over `pageConfigs[LOADING]`,
|
|
226
|
+
// whose default (`loading.config.tsx`'s `loadingPage`) carries
|
|
227
|
+
// "Loading..." / "Data extracting...", and the latter is plainly wrong
|
|
228
|
+
// for this phase. `Progress.tsx` guards on `title?.label` being truthy
|
|
229
|
+
// and maps over `descriptions`, so an empty label and an empty array
|
|
230
|
+
// render the spinner alone. `captureLoader` spreads last, so a host can
|
|
231
|
+
// still put copy back.
|
|
232
|
+
title: { label: '' }, descriptions: [] }, config.captureLoader));
|
|
233
|
+
captureLoader = { screen, host };
|
|
234
|
+
open.push(screen);
|
|
235
|
+
yield screen.mount(host);
|
|
236
|
+
yield nextPaint();
|
|
237
|
+
});
|
|
238
|
+
const hideCaptureLoader = () => {
|
|
239
|
+
const current = captureLoader;
|
|
240
|
+
captureLoader = undefined;
|
|
241
|
+
if (!current)
|
|
242
|
+
return;
|
|
243
|
+
try {
|
|
244
|
+
current.screen.unmount();
|
|
245
|
+
}
|
|
246
|
+
catch (_a) {
|
|
247
|
+
// swallow: a noisy unmount must not leave the host element behind
|
|
248
|
+
}
|
|
249
|
+
current.host.remove();
|
|
250
|
+
// The container's `position` is deliberately NOT restored here — see
|
|
251
|
+
// `restoreContainer`, which teardown owns (FDEL-53728 F1).
|
|
252
|
+
};
|
|
253
|
+
/**
|
|
254
|
+
* Put the container's `position` back, once the journey is finished with it.
|
|
255
|
+
*
|
|
256
|
+
* FDEL-53728 F1. This used to happen in `hideCaptureLoader`, which is the one
|
|
257
|
+
* moment it must not: the loader comes down on the vendor's `ready`, while the
|
|
258
|
+
* vendor's own iframe — `position: absolute; inset: 0` (`createIframe.ts`) —
|
|
259
|
+
* is mounted in that same container and is relying on it being positioned.
|
|
260
|
+
* Un-positioning it there hands the iframe a different containing block
|
|
261
|
+
* mid-capture, which is how QA's Daon run ended up staring at a blank screen
|
|
262
|
+
* that only came good once the container was given an explicit height.
|
|
263
|
+
*
|
|
264
|
+
* So the container stays positioned for as long as the journey owns anything
|
|
265
|
+
* in it, and is restored by the single teardown — which is also the only point
|
|
266
|
+
* at which the host gets its element back.
|
|
267
|
+
*/
|
|
268
|
+
const restoreContainer = () => {
|
|
269
|
+
if (!containerWasStatic)
|
|
270
|
+
return;
|
|
271
|
+
config.container.style.position = '';
|
|
272
|
+
containerWasStatic = false;
|
|
273
|
+
};
|
|
274
|
+
/**
|
|
275
|
+
* Take the vendor's iframe out of the container once capture is done.
|
|
276
|
+
*
|
|
277
|
+
* `defineIframeIDVWrapper.ts:193-228` emits `detection_complete`, then
|
|
278
|
+
* `loading('Retrieving IDV results')`, then polls our own backend for
|
|
279
|
+
* seconds, and only calls `cleanup({ iframe })` at the very end. So without
|
|
280
|
+
* this the vendor's own post-capture screen sits in the container the whole
|
|
281
|
+
* time the extraction screen is also mounted there — two loading screens,
|
|
282
|
+
* different copy, stacked. The reference flow removes it at exactly this
|
|
283
|
+
* point (`idv.html:248-251`).
|
|
284
|
+
*
|
|
285
|
+
* Safe here because the polling that follows talks to our backend, not the
|
|
286
|
+
* frame. The wrapper's own later `iframe.remove()` becomes a no-op, and its
|
|
287
|
+
* `message.source === iframe.contentWindow` guard simply stops matching —
|
|
288
|
+
* which is already true of the reference's behaviour.
|
|
289
|
+
*/
|
|
290
|
+
const removeVendorFrames = () => {
|
|
291
|
+
config.container
|
|
292
|
+
.querySelectorAll('iframe')
|
|
293
|
+
.forEach((frame) => frame.remove());
|
|
294
|
+
};
|
|
295
|
+
const showExtraction = () => {
|
|
296
|
+
// Whatever else takes over the container ends the capture loader, whether
|
|
297
|
+
// or not the vendor's `ready` ever arrived. Relying on `ready` alone left
|
|
298
|
+
// the loader stacked on top of this screen on Daon, whose `ready` is the
|
|
299
|
+
// iframe's own `onload` — see the per-vendor notes in idvFlow.ts.
|
|
300
|
+
hideCaptureLoader();
|
|
301
|
+
// guard against a second `showExtraction()` orphaning the first screen --
|
|
302
|
+
// a split OCR-then-biometrics flow can call this twice in one journey. A
|
|
303
|
+
// throwing unmount must not stop the new screen from being mounted -- the
|
|
304
|
+
// applicant would otherwise be left with no screen at all.
|
|
305
|
+
try {
|
|
306
|
+
extraction === null || extraction === void 0 ? void 0 : extraction.unmount();
|
|
307
|
+
}
|
|
308
|
+
catch (_a) {
|
|
309
|
+
// swallow: a noisy teardown of the old screen must not block the new one
|
|
310
|
+
}
|
|
311
|
+
// the extraction screen is not a step: it completes on nothing, it is
|
|
312
|
+
// replaced by whatever the engine says next.
|
|
313
|
+
if (machine.isTorn())
|
|
314
|
+
return;
|
|
315
|
+
extraction = oneSdk.component('form', {
|
|
316
|
+
name: 'LOADING',
|
|
317
|
+
logo,
|
|
318
|
+
title: { label: 'Extracting data...' },
|
|
319
|
+
descriptions: [
|
|
320
|
+
{
|
|
321
|
+
label: 'Hold tight, this can take up to 30 seconds. Please do not refresh this page.',
|
|
322
|
+
},
|
|
323
|
+
],
|
|
324
|
+
});
|
|
325
|
+
open.push(extraction);
|
|
326
|
+
extraction.mount(config.container);
|
|
327
|
+
};
|
|
328
|
+
/**
|
|
329
|
+
* Shown while `individual().submit({ verify: true })` is in flight — the gap
|
|
330
|
+
* between the applicant submitting the review form and the result screen
|
|
331
|
+
* appearing, which is a network call and can take seconds.
|
|
332
|
+
*
|
|
333
|
+
* The reference flow covers this with its own page-level spinner
|
|
334
|
+
* (`idv.html:264-279`, `ocr_only.html:209-222`: hide `#app`, `setLoading(true)`,
|
|
335
|
+
* await the submit, then mount the result). Journey has no page-level loader
|
|
336
|
+
* to fall back on, so it uses the SDK's own canonical copy for this moment —
|
|
337
|
+
* `manualLoading`, which is what `ReviewDocument.tsx` already renders during
|
|
338
|
+
* its built-in verify — rather than inventing new strings.
|
|
339
|
+
*
|
|
340
|
+
* Not a step: it completes on nothing, and is replaced by whatever the
|
|
341
|
+
* classification produces.
|
|
342
|
+
*/
|
|
343
|
+
const showVerifying = () => {
|
|
344
|
+
try {
|
|
345
|
+
verifying === null || verifying === void 0 ? void 0 : verifying.unmount();
|
|
346
|
+
}
|
|
347
|
+
catch (_a) {
|
|
348
|
+
// swallow: a noisy teardown of the old screen must not block the new one
|
|
349
|
+
}
|
|
350
|
+
if (machine.isTorn())
|
|
351
|
+
return;
|
|
352
|
+
verifying = oneSdk.component('form', Object.assign(Object.assign({ logo }, manualLoading), config.verifying));
|
|
353
|
+
open.push(verifying);
|
|
354
|
+
verifying.mount(config.container);
|
|
355
|
+
};
|
|
356
|
+
const hideVerifying = () => {
|
|
357
|
+
try {
|
|
358
|
+
verifying === null || verifying === void 0 ? void 0 : verifying.unmount();
|
|
359
|
+
}
|
|
360
|
+
catch (_a) {
|
|
361
|
+
// swallow: the result screen still has to be allowed to mount
|
|
362
|
+
}
|
|
363
|
+
verifying = undefined;
|
|
364
|
+
};
|
|
365
|
+
const presentReview = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
366
|
+
if (!config.withReview)
|
|
367
|
+
return;
|
|
368
|
+
// config.review is the form module's native REVIEW config, passed through
|
|
369
|
+
// verbatim — including its per-country / per-state structure. The journey
|
|
370
|
+
// never translates it (see the note above on `JourneyScreenConfig['review']`).
|
|
371
|
+
yield present('REVIEW', Object.assign({ name: 'REVIEW', mode: 'individual', type: 'ocr' }, config.review));
|
|
372
|
+
});
|
|
373
|
+
/**
|
|
374
|
+
* spec §6 — the data-correction retry's first screen. Its CTA ("Review
|
|
375
|
+
* details") *is* the retry action, so it keeps its CTA where terminal
|
|
376
|
+
* screens hide theirs (D5), and the step completes on that click.
|
|
377
|
+
*
|
|
378
|
+
* `hidden` is never honoured here. The step completes only on
|
|
379
|
+
* `FORM_RESULT_PARTIAL`, which `Result.tsx` emits on the click, and it has
|
|
380
|
+
* no timeout because it is human-gated — so a hidden CTA is a journey that
|
|
381
|
+
* never finishes, with a dead card on screen. Only the allowlisted CTA keys
|
|
382
|
+
* (`ctaConfig.ts`'s `hostCtaKeysOnly` — `label`, `icon`, `style`, `inline`)
|
|
383
|
+
* and the rest of the host's own copy pass through; `hidden`, `onClick`,
|
|
384
|
+
* `visible` and `disabled` do not.
|
|
385
|
+
*
|
|
386
|
+
* When the host configured no CTA, no `cta` key is passed at all rather than
|
|
387
|
+
* `{ hidden: false }`: the form's merge is a shallow spread, so passing one
|
|
388
|
+
* would replace `resultInfoMapping[PARTIAL]`'s default object and strip the
|
|
389
|
+
* "Review details" label with it.
|
|
390
|
+
*/
|
|
391
|
+
const presentPartial = () => {
|
|
392
|
+
var _a, _b;
|
|
393
|
+
const hostState = (_b = (_a = config.result) === null || _a === void 0 ? void 0 : _a[RESULT_STATE.PARTIAL]) !== null && _b !== void 0 ? _b : {};
|
|
394
|
+
const { cta } = hostState, hostConfig = __rest(hostState, ["cta"]);
|
|
395
|
+
return present('PARTIAL', Object.assign(Object.assign(Object.assign({ name: 'RESULT', mode: 'individual', type: 'manual' }, hostConfig), { state: RESULT_STATE.PARTIAL }), (cta
|
|
396
|
+
? {
|
|
397
|
+
cta: Object.assign(Object.assign({}, hostCtaKeysOnly(cta)), { hidden: false }),
|
|
398
|
+
}
|
|
399
|
+
: {})));
|
|
400
|
+
};
|
|
401
|
+
return {
|
|
402
|
+
presentPreCapture,
|
|
403
|
+
presentConsent,
|
|
404
|
+
showCaptureLoader,
|
|
405
|
+
hideCaptureLoader,
|
|
406
|
+
removeVendorFrames,
|
|
407
|
+
showExtraction,
|
|
408
|
+
hideExtraction: () => extraction === null || extraction === void 0 ? void 0 : extraction.unmount(),
|
|
409
|
+
showVerifying,
|
|
410
|
+
hideVerifying,
|
|
411
|
+
presentPersonal,
|
|
412
|
+
presentDocument,
|
|
413
|
+
presentReview,
|
|
414
|
+
presentPartial,
|
|
415
|
+
unmountAll,
|
|
416
|
+
};
|
|
417
|
+
};
|
|
418
|
+
//# sourceMappingURL=screenSequence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screenSequence.js","sourceRoot":"","sources":["../../../../../modules/journey/flows/screenSequence.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,4DAA4D,CAAC;AAG3F,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AA8HvD,MAAM,iBAAiB,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,cAAc,CAAC,CAAC;AAmB9D,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,IAKhC,EAAkB,EAAE;IACnB,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,UA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,CAAC,MAAM,CAAC,UAAU;YAAE,OAAO;QAC/B,0EAA0E;QAC1E,0EAA0E;QAC1E,+EAA+E;QAC/E,MAAM,OAAO,CAAC,QAAQ,kBACpB,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,KAAK,IACR,MAAM,CAAC,MAAM,EAChB,CAAC;IACL,CAAC,CAAA,CAAC;IAEF;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,cAAc,GAAG,GAAkB,EAAE;;QACzC,MAAM,SAAS,GACb,MAAA,MAAA,MAAM,CAAC,MAAM,0CAAG,YAAY,CAAC,OAAO,CAAC,mCAAI,EAAE,CAAC;QAC9C,MAAM,EAAE,GAAG,KAAoB,SAAS,EAAxB,UAAU,UAAK,SAAS,EAAlC,OAAsB,CAAY,CAAC;QACzC,OAAO,OAAO,CAAC,SAAS,8CACtB,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,QAAQ,IACX,UAAU,KACb,KAAK,EAAE,YAAY,CAAC,OAAO,KACxB,CAAC,GAAG;YACL,CAAC,CAAC;gBACE,GAAG,kCACE,eAAe,CAAC,GAA8B,CAAC,KAClD,MAAM,EAAE,KAAK,GACd;aACF;YACH,CAAC,CAAC,EAAE,CAAC,EACP,CAAC;IACL,CAAC,CAAC;IAEF,OAAO;QACL,iBAAiB;QACjB,cAAc;QACd,iBAAiB;QACjB,iBAAiB;QACjB,kBAAkB;QAClB,cAAc;QACd,cAAc,EAAE,GAAG,EAAE,CAAC,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,OAAO,EAAE;QAC3C,aAAa;QACb,aAAa;QACb,eAAe;QACf,eAAe;QACf,aAAa;QACb,cAAc;QACd,UAAU;KACX,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { OneSdkContext } from '../../sdk/types/oneSDK';
|
|
2
|
+
import type { ClassifierInput } from '../types/classifierInput';
|
|
3
|
+
/** the subset of a flow's journey config this helper needs, shared by every flow */
|
|
4
|
+
export type SubmitConfig = {
|
|
5
|
+
triggerVerificationOnSubmit?: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Whether the flow has a review screen at all. Not used to decide what to
|
|
8
|
+
* mount — that is `screenSequence.ts`'s job — but to decide whether a
|
|
9
|
+
* retryable result is actionable at all. See `settleable` below.
|
|
10
|
+
*/
|
|
11
|
+
withReview?: boolean;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Whether this flow should call `individual().submit({ verify: true })` at all.
|
|
15
|
+
*
|
|
16
|
+
* Exported because the flows need the same answer for a different reason: they
|
|
17
|
+
* mount a "Verifying your identity" loader around the submit, and a loader for
|
|
18
|
+
* a call that never happens is a spinner for no work. Sharing the predicate
|
|
19
|
+
* keeps that decision and the branch it guards from drifting apart.
|
|
20
|
+
*/
|
|
21
|
+
export declare const verificationRequested: (config: SubmitConfig) => boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Submit for verification and turn the result into a `ClassifierInput`.
|
|
24
|
+
* Shared by every flow's CAPTURE step (`idvFlow.ts`, `ocrFlow.ts`, …): none of
|
|
25
|
+
* this is flow-specific — it is `individual().submit()` and the shape
|
|
26
|
+
* `classify.ts` already expects.
|
|
27
|
+
*/
|
|
28
|
+
export declare const submitAndClassify: (deps: {
|
|
29
|
+
oneSdk: OneSdkContext;
|
|
30
|
+
config: SubmitConfig;
|
|
31
|
+
}) => Promise<ClassifierInput>;
|
|
32
|
+
//# sourceMappingURL=submitAndClassify.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"submitAndClassify.d.ts","sourceRoot":"","sources":["../../../../../modules/journey/flows/submitAndClassify.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAM9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEhE,oFAAoF;AACpF,MAAM,MAAM,YAAY,GAAG;IACzB,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAwCF;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,WAAY,YAAY,KAAG,OACf,CAAC;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,SAAgB;IAC5C,MAAM,EAAE,aAAa,CAAC;IACtB,MAAM,EAAE,YAAY,CAAC;CACtB,KAAG,OAAO,CAAC,eAAe,CAoB1B,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
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 { classify } from '../classify/classify.js';
|
|
11
|
+
import { transportErrorSignal } from '../classify/transportError.js';
|
|
12
|
+
/**
|
|
13
|
+
* A retryable check result is only retryable if the applicant can change
|
|
14
|
+
* something. `idvFlow.ts`/`ocrFlow.ts` answer a `retry` classification with
|
|
15
|
+
* `retryWithCorrectedData()` — the PARTIAL screen, then the review form — so
|
|
16
|
+
* with `withReview: false` the review is a no-op and the retry resubmits byte
|
|
17
|
+
* for byte identical data until attempts exhaust, having shown the applicant a
|
|
18
|
+
* "Review details" CTA that cannot be honoured (FDEL-53227).
|
|
19
|
+
*
|
|
20
|
+
* So the retry is not offered, and the result settles as what it actually is:
|
|
21
|
+
* `declined / checks_failed`. The check did not pass, and the one thing that
|
|
22
|
+
* could still have changed that — a data correction — is not on offer. There
|
|
23
|
+
* is no pending work here to wait on, which is why this is not `pending`.
|
|
24
|
+
*
|
|
25
|
+
* It is deliberately NOT given a reason of its own. A host reading `reason`
|
|
26
|
+
* learns the only thing that changes what it does next: this applicant was not
|
|
27
|
+
* verified and there is nothing further to await. Anyone who needs to tell a
|
|
28
|
+
* partial apart from an outright fail — support, ops, a manual-review queue —
|
|
29
|
+
* reads `partial` off the carried `checkResult.alertList` (spec D10).
|
|
30
|
+
*
|
|
31
|
+
* `classify()` decides which results this applies to, rather than a
|
|
32
|
+
* `RETRY_ALERTS` test here, precisely so this cannot diverge from the real
|
|
33
|
+
* classification — and so a result that would NOT have looped is left exactly
|
|
34
|
+
* as it was. A `partial` arriving alongside `blacklist` still declines as
|
|
35
|
+
* blocklisted, because `classify()` returns `declined` for it and this branch
|
|
36
|
+
* never fires.
|
|
37
|
+
*
|
|
38
|
+
* `ekycFlow.ts` is unaffected: its data-correction retry is the RETRY module,
|
|
39
|
+
* which it mounts unconditionally, and it does not call this helper at all.
|
|
40
|
+
*/
|
|
41
|
+
const settleable = (input, config) => {
|
|
42
|
+
if (config.withReview)
|
|
43
|
+
return input;
|
|
44
|
+
if (classify(input).outcome !== 'retry')
|
|
45
|
+
return input;
|
|
46
|
+
return Object.assign(Object.assign({}, input), { signal: 'partial_unrecoverable' });
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Whether this flow should call `individual().submit({ verify: true })` at all.
|
|
50
|
+
*
|
|
51
|
+
* Exported because the flows need the same answer for a different reason: they
|
|
52
|
+
* mount a "Verifying your identity" loader around the submit, and a loader for
|
|
53
|
+
* a call that never happens is a spinner for no work. Sharing the predicate
|
|
54
|
+
* keeps that decision and the branch it guards from drifting apart.
|
|
55
|
+
*/
|
|
56
|
+
export const verificationRequested = (config) => config.triggerVerificationOnSubmit !== false;
|
|
57
|
+
/**
|
|
58
|
+
* Submit for verification and turn the result into a `ClassifierInput`.
|
|
59
|
+
* Shared by every flow's CAPTURE step (`idvFlow.ts`, `ocrFlow.ts`, …): none of
|
|
60
|
+
* this is flow-specific — it is `individual().submit()` and the shape
|
|
61
|
+
* `classify.ts` already expects.
|
|
62
|
+
*/
|
|
63
|
+
export const submitAndClassify = (deps) => __awaiter(void 0, void 0, void 0, function* () {
|
|
64
|
+
var _a, _b, _c, _d, _e;
|
|
65
|
+
const { oneSdk, config } = deps;
|
|
66
|
+
if (!verificationRequested(config)) {
|
|
67
|
+
return { alerts: [], signal: 'captured' };
|
|
68
|
+
}
|
|
69
|
+
try {
|
|
70
|
+
const summary = yield oneSdk.individual().submit({ verify: true });
|
|
71
|
+
return settleable({
|
|
72
|
+
statusType: (_b = (_a = summary === null || summary === void 0 ? void 0 : summary.status) === null || _a === void 0 ? void 0 : _a.type) !== null && _b !== void 0 ? _b : undefined,
|
|
73
|
+
alerts: ((_c = summary === null || summary === void 0 ? void 0 : summary.alertList) !== null && _c !== void 0 ? _c : []).map((alert) => alert.term),
|
|
74
|
+
retryPage: (_e = (_d = summary === null || summary === void 0 ? void 0 : summary.retryPages) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.name,
|
|
75
|
+
// spec D10 — decision outcomes hand the check result back verbatim
|
|
76
|
+
checkResult: summary,
|
|
77
|
+
}, config);
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
return fromSubmitError(error);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
/**
|
|
84
|
+
* A submit that threw. `transportErrorSignal` names the two the contract calls
|
|
85
|
+
* out; anything else keeps `submit_failed`, so an unfamiliar failure stays
|
|
86
|
+
* diagnosable rather than being guessed at.
|
|
87
|
+
*/
|
|
88
|
+
const fromSubmitError = (error) => {
|
|
89
|
+
var _a;
|
|
90
|
+
const { message } = (error !== null && error !== void 0 ? error : {});
|
|
91
|
+
const signal = (_a = transportErrorSignal(error)) !== null && _a !== void 0 ? _a : 'submit_failed';
|
|
92
|
+
return {
|
|
93
|
+
alerts: [],
|
|
94
|
+
signal,
|
|
95
|
+
errorDetail: {
|
|
96
|
+
code: signal,
|
|
97
|
+
message: message !== null && message !== void 0 ? message : `Journey failed: ${signal}`,
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
//# sourceMappingURL=submitAndClassify.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"submitAndClassify.js","sourceRoot":"","sources":["../../../../../modules/journey/flows/submitAndClassify.ts"],"names":[],"mappings":";;;;;;;;;AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAelE;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,UAAU,GAAG,CACjB,KAAsB,EACtB,MAAoB,EACH,EAAE;IACnB,IAAI,MAAM,CAAC,UAAU;QAAE,OAAO,KAAK,CAAC;IACpC,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,OAAO,KAAK,OAAO;QAAE,OAAO,KAAK,CAAC;IACtD,uCAAY,KAAK,KAAE,MAAM,EAAE,uBAAuB,IAAG;AACvD,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,MAAoB,EAAW,EAAE,CACrE,MAAM,CAAC,2BAA2B,KAAK,KAAK,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAO,IAGvC,EAA4B,EAAE;;IAC7B,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAChC,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE,CAAC;QACnC,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;IAC5C,CAAC;IACD,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,M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enConfig } from './flows/idvFlow';
|
|
4
|
+
import type { JourneyHandle } from './journeyHandle';
|
|
5
|
+
import type { ThemeTokens } from './theme/applyTheme';
|
|
6
|
+
export type JourneyOptions = JourneyScreenConfig & {
|
|
7
|
+
style?: ThemeTokens;
|
|
8
|
+
maxAttempts?: number;
|
|
9
|
+
simulate?: string;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* ekyc's options, minus the one that does not apply to it.
|
|
13
|
+
*
|
|
14
|
+
* `triggerVerificationOnSubmit` decides whether the flow calls
|
|
15
|
+
* `individual().submit({ verify: true })` itself. `ekycFlow.ts` never does:
|
|
16
|
+
* REVIEW's own `ReviewDocument.tsx` submits and reports the outcome, which is
|
|
17
|
+
* why that flow does not call `submitAndClassify` at all. So on ekyc the flag
|
|
18
|
+
* was accepted and silently ignored — a host could set it, watch the journey
|
|
19
|
+
* verify anyway, and have nothing to read that explained why.
|
|
20
|
+
*
|
|
21
|
+
* `?: never` rather than a plain `Omit`: `Omit` alone only rejects the key on a
|
|
22
|
+
* fresh object literal, so a host who builds their config into a variable first
|
|
23
|
+
* would still slip through. This rejects both.
|
|
24
|
+
*/
|
|
25
|
+
export type EkycJourneyOptions = Omit<JourneyOptions, 'triggerVerificationOnSubmit'> & {
|
|
26
|
+
triggerVerificationOnSubmit?: never;
|
|
27
|
+
};
|
|
28
|
+
/** the options each flow accepts — see `EkycJourneyOptions` for the one difference */
|
|
29
|
+
type OptionsFor<TName extends JourneyName> = TName extends JourneyName.EKYC ? EkycJourneyOptions : JourneyOptions;
|
|
30
|
+
export declare const mkJourney: (deps: {
|
|
31
|
+
oneSdk: OneSdkContext;
|
|
32
|
+
}) => <TName extends JourneyName>(name: TName, options?: OptionsFor<TName>) => JourneyHandle;
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../modules/journey/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAW9D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAc,MAAM,iBAAiB,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGtD,MAAM,MAAM,cAAc,GAAG,mBAAmB,GAAG;IACjD,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,kBAAkB,GAAG,IAAI,CACnC,cAAc,EACd,6BAA6B,CAC9B,GAAG;IACF,2BAA2B,CAAC,EAAE,KAAK,CAAC;CACrC,CAAC;AAEF,sFAAsF;AACtF,KAAK,UAAU,CAAC,KAAK,SAAS,WAAW,IAAI,KAAK,SAAS,WAAW,CAAC,IAAI,GACvE,kBAAkB,GAClB,cAAc,CAAC;AAwDnB,eAAO,MAAM,SAAS,SACb;IAAE,MAAM,EAAE,aAAa,CAAA;CAAE,MAC/B,KAAK,SAAS,WAAW,QAClB,KAAK,YACD,UAAU,CAAC,KAAK,CAAC,KAC1B,aAyHF,CAAC"}
|