smartcomply-web-sdk 1.0.89 → 1.0.90
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/client/Smartcomply.d.ts +13 -1
- package/dist/client/Smartcomply.d.ts.map +1 -1
- package/dist/client/Smartcomply.js +14 -1
- package/dist/client/Smartcomply.js.map +1 -1
- package/dist/esm/client/Smartcomply.d.ts +13 -1
- package/dist/esm/client/Smartcomply.d.ts.map +1 -1
- package/dist/esm/client/Smartcomply.js +14 -1
- package/dist/esm/client/Smartcomply.js.map +1 -1
- package/dist/esm/flow/SmartComplyFlow.d.ts +14 -9
- package/dist/esm/flow/SmartComplyFlow.d.ts.map +1 -1
- package/dist/esm/flow/SmartComplyFlow.js +67 -1
- package/dist/esm/flow/SmartComplyFlow.js.map +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/liveness.d.ts +15 -0
- package/dist/esm/types/liveness.d.ts.map +1 -1
- package/dist/flow/SmartComplyFlow.d.ts +14 -9
- package/dist/flow/SmartComplyFlow.d.ts.map +1 -1
- package/dist/flow/SmartComplyFlow.js +67 -1
- package/dist/flow/SmartComplyFlow.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/smartcomply.browser.js +68 -2
- package/dist/smartcomply.browser.js.map +3 -3
- package/dist/types/liveness.d.ts +15 -0
- package/dist/types/liveness.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@ import { SDKConfig } from "./Config";
|
|
|
2
2
|
import { OnboardingModule } from "../modules/onboarding/onboarding";
|
|
3
3
|
import { LivenessModule } from "../modules/liveness/liveness";
|
|
4
4
|
import { SessionResponse, SDKInitConfig } from "../types/onboarding";
|
|
5
|
+
import { LivenessResumeInfoResponse } from "../types/liveness";
|
|
5
6
|
/**
|
|
6
7
|
* SmartComply SDK — main entry point.
|
|
7
8
|
*
|
|
@@ -21,7 +22,7 @@ export declare class SmartComply {
|
|
|
21
22
|
* CDN tag they installed with (e.g. @1, which floats to the latest
|
|
22
23
|
* matching release) actually resolved to the version they expect.
|
|
23
24
|
*/
|
|
24
|
-
static readonly VERSION = "1.0.
|
|
25
|
+
static readonly VERSION = "1.0.90";
|
|
25
26
|
private http;
|
|
26
27
|
private clientId;
|
|
27
28
|
private _sessionToken;
|
|
@@ -79,5 +80,16 @@ export declare class SmartComply {
|
|
|
79
80
|
* Returns: { brand_name, theme, verification_type, channels, redirect_url, ... }
|
|
80
81
|
*/
|
|
81
82
|
initializeConfig(): Promise<SDKInitConfig>;
|
|
83
|
+
/**
|
|
84
|
+
* Resolve a resume_token to the entry/step it's resuming, without
|
|
85
|
+
* consuming the single-use resume binding (unlike create/, which does).
|
|
86
|
+
* Only meaningful after resumeSession() — a normal createSession()
|
|
87
|
+
* session was never issued for a resume, so this returns a 404
|
|
88
|
+
* (NOT_A_RESUME_TOKEN) for it, same as the backend.
|
|
89
|
+
*
|
|
90
|
+
* GET /v1/sdk/liveness/resume-info/
|
|
91
|
+
* Auth: x-access-token: <sessionToken>
|
|
92
|
+
*/
|
|
93
|
+
getResumeInfo(): Promise<LivenessResumeInfoResponse>;
|
|
82
94
|
}
|
|
83
95
|
//# sourceMappingURL=Smartcomply.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Smartcomply.d.ts","sourceRoot":"","sources":["../../src/client/Smartcomply.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,EACL,eAAe,EACf,aAAa,EACd,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"Smartcomply.d.ts","sourceRoot":"","sources":["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
104
|
+
/**
|
|
105
|
+
* Resolve a resume_token to the entry/step it's resuming, without
|
|
106
|
+
* consuming the single-use resume binding (unlike create/, which does).
|
|
107
|
+
* Only meaningful after resumeSession() — a normal createSession()
|
|
108
|
+
* session was never issued for a resume, so this returns a 404
|
|
109
|
+
* (NOT_A_RESUME_TOKEN) for it, same as the backend.
|
|
110
|
+
*
|
|
111
|
+
* GET /v1/sdk/liveness/resume-info/
|
|
112
|
+
* Auth: x-access-token: <sessionToken>
|
|
113
|
+
*/
|
|
114
|
+
async getResumeInfo() {
|
|
115
|
+
return this.http.sessionRequest("GET", "/v1/sdk/liveness/resume-info/");
|
|
116
|
+
}
|
|
104
117
|
}
|
|
105
118
|
exports.SmartComply = SmartComply;
|
|
106
119
|
/**
|
|
@@ -112,5 +125,5 @@ exports.SmartComply = SmartComply;
|
|
|
112
125
|
* CDN tag they installed with (e.g. @1, which floats to the latest
|
|
113
126
|
* matching release) actually resolved to the version they expect.
|
|
114
127
|
*/
|
|
115
|
-
SmartComply.VERSION = "1.0.
|
|
128
|
+
SmartComply.VERSION = "1.0.90";
|
|
116
129
|
//# sourceMappingURL=Smartcomply.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Smartcomply.js","sourceRoot":"","sources":["../../src/client/Smartcomply.ts"],"names":[],"mappings":";;;AACA,6CAA0C;AAC1C,iEAAoE;AACpE,2DAA8D;AAC9D,4CAA4C;
|
|
1
|
+
{"version":3,"file":"Smartcomply.js","sourceRoot":"","sources":["../../src/client/Smartcomply.ts"],"names":[],"mappings":";;;AACA,6CAA0C;AAC1C,iEAAoE;AACpE,2DAA8D;AAC9D,4CAA4C;AAO5C;;;;;;;;GAQG;AACH,MAAa,WAAW;IAqBtB,YAAY,MAAiB;QAPrB,kBAAa,GAAkB,IAAI,CAAC;QACpC,sBAAiB,GAAkB,IAAI,CAAC;QACxC,eAAU,GAAyB,IAAI,CAAC;QAM9C,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,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;;;;;;;;;;;;;;;;;;;OAqBG;IACH,aAAa,CAAC,WAAmB;QAC/B,IAAI,CAAC,aAAa,GAAG,WAAW,CAAC;QACjC,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;QAC9B,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;IACzC,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,gBAAgB;QACpB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,cAAc,CAC3C,KAAK,EACL,iBAAiB,CAClB,CAAC;QAEF,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC;QACzB,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,aAAa;QACjB,OAAO,IAAI,CAAC,IAAI,CAAC,cAAc,CAC7B,KAAK,EACL,+BAA+B,CAChC,CAAC;IACJ,CAAC;;AA5IH,kCA6IC;AA5IC;;;;;;;;GAQG;AACa,mBAAO,GAAG,QAAQ,AAAX,CAAY"}
|
|
@@ -2,6 +2,7 @@ import { SDKConfig } from "./Config";
|
|
|
2
2
|
import { OnboardingModule } from "../modules/onboarding/onboarding";
|
|
3
3
|
import { LivenessModule } from "../modules/liveness/liveness";
|
|
4
4
|
import { SessionResponse, SDKInitConfig } from "../types/onboarding";
|
|
5
|
+
import { LivenessResumeInfoResponse } from "../types/liveness";
|
|
5
6
|
/**
|
|
6
7
|
* SmartComply SDK — main entry point.
|
|
7
8
|
*
|
|
@@ -21,7 +22,7 @@ export declare class SmartComply {
|
|
|
21
22
|
* CDN tag they installed with (e.g. @1, which floats to the latest
|
|
22
23
|
* matching release) actually resolved to the version they expect.
|
|
23
24
|
*/
|
|
24
|
-
static readonly VERSION = "1.0.
|
|
25
|
+
static readonly VERSION = "1.0.90";
|
|
25
26
|
private http;
|
|
26
27
|
private clientId;
|
|
27
28
|
private _sessionToken;
|
|
@@ -79,5 +80,16 @@ export declare class SmartComply {
|
|
|
79
80
|
* Returns: { brand_name, theme, verification_type, channels, redirect_url, ... }
|
|
80
81
|
*/
|
|
81
82
|
initializeConfig(): Promise<SDKInitConfig>;
|
|
83
|
+
/**
|
|
84
|
+
* Resolve a resume_token to the entry/step it's resuming, without
|
|
85
|
+
* consuming the single-use resume binding (unlike create/, which does).
|
|
86
|
+
* Only meaningful after resumeSession() — a normal createSession()
|
|
87
|
+
* session was never issued for a resume, so this returns a 404
|
|
88
|
+
* (NOT_A_RESUME_TOKEN) for it, same as the backend.
|
|
89
|
+
*
|
|
90
|
+
* GET /v1/sdk/liveness/resume-info/
|
|
91
|
+
* Auth: x-access-token: <sessionToken>
|
|
92
|
+
*/
|
|
93
|
+
getResumeInfo(): Promise<LivenessResumeInfoResponse>;
|
|
82
94
|
}
|
|
83
95
|
//# sourceMappingURL=Smartcomply.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Smartcomply.d.ts","sourceRoot":"","sources":["../../../src/client/Smartcomply.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,EACL,eAAe,EACf,aAAa,EACd,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"Smartcomply.d.ts","sourceRoot":"","sources":["../../../src/client/Smartcomply.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,EACL,eAAe,EACf,aAAa,EACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAE/D;;;;;;;;GAQG;AACH,qBAAa,WAAW;IACtB;;;;;;;;OAQG;IACH,MAAM,CAAC,QAAQ,CAAC,OAAO,YAAY;IAEnC,OAAO,CAAC,IAAI,CAAa;IACzB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,aAAa,CAAuB;IAC5C,OAAO,CAAC,iBAAiB,CAAuB;IAChD,OAAO,CAAC,UAAU,CAA8B;IAEzC,UAAU,EAAE,gBAAgB,CAAC;IAC7B,QAAQ,EAAE,cAAc,CAAC;gBAEpB,MAAM,EAAE,SAAS;IAiB7B,sDAAsD;IACtD,IAAI,YAAY,IAAI,MAAM,GAAG,IAAI,CAEhC;IAED,uCAAuC;IACvC,IAAI,gBAAgB,IAAI,MAAM,GAAG,IAAI,CAEpC;IAED,gFAAgF;IAChF,IAAI,SAAS,IAAI,aAAa,GAAG,IAAI,CAEpC;IAED;;;;;;;;OAQG;IACG,aAAa,IAAI,OAAO,CAAC,eAAe,CAAC;IAgB/C;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAMxC;;;;;;;;OAQG;IACG,gBAAgB,IAAI,OAAO,CAAC,aAAa,CAAC;IAUhD;;;;;;;;;OASG;IACG,aAAa,IAAI,OAAO,CAAC,0BAA0B,CAAC;CAM3D"}
|
|
@@ -98,6 +98,19 @@ export class SmartComply {
|
|
|
98
98
|
this._sdkConfig = config;
|
|
99
99
|
return config;
|
|
100
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* Resolve a resume_token to the entry/step it's resuming, without
|
|
103
|
+
* consuming the single-use resume binding (unlike create/, which does).
|
|
104
|
+
* Only meaningful after resumeSession() — a normal createSession()
|
|
105
|
+
* session was never issued for a resume, so this returns a 404
|
|
106
|
+
* (NOT_A_RESUME_TOKEN) for it, same as the backend.
|
|
107
|
+
*
|
|
108
|
+
* GET /v1/sdk/liveness/resume-info/
|
|
109
|
+
* Auth: x-access-token: <sessionToken>
|
|
110
|
+
*/
|
|
111
|
+
async getResumeInfo() {
|
|
112
|
+
return this.http.sessionRequest("GET", "/v1/sdk/liveness/resume-info/");
|
|
113
|
+
}
|
|
101
114
|
}
|
|
102
115
|
/**
|
|
103
116
|
* Package version, hardcoded to match package.json — bump this alongside
|
|
@@ -108,5 +121,5 @@ export class SmartComply {
|
|
|
108
121
|
* CDN tag they installed with (e.g. @1, which floats to the latest
|
|
109
122
|
* matching release) actually resolved to the version they expect.
|
|
110
123
|
*/
|
|
111
|
-
SmartComply.VERSION = "1.0.
|
|
124
|
+
SmartComply.VERSION = "1.0.90";
|
|
112
125
|
//# sourceMappingURL=Smartcomply.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Smartcomply.js","sourceRoot":"","sources":["../../../src/client/Smartcomply.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"Smartcomply.js","sourceRoot":"","sources":["../../../src/client/Smartcomply.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAO5C;;;;;;;;GAQG;AACH,MAAM,OAAO,WAAW;IAqBtB,YAAY,MAAiB;QAPrB,kBAAa,GAAkB,IAAI,CAAC;QACpC,sBAAiB,GAAkB,IAAI,CAAC;QACxC,eAAU,GAAyB,IAAI,CAAC;QAM9C,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,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,CAAC,WAAmB;QAC/B,IAAI,CAAC,aAAa,GAAG,WAAW,CAAC;QACjC,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;QAC9B,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;IACzC,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,gBAAgB;QACpB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,cAAc,CAC3C,KAAK,EACL,iBAAiB,CAClB,CAAC;QAEF,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC;QACzB,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,aAAa;QACjB,OAAO,IAAI,CAAC,IAAI,CAAC,cAAc,CAC7B,KAAK,EACL,+BAA+B,CAChC,CAAC;IACJ,CAAC;;AA3ID;;;;;;;;GAQG;AACa,mBAAO,GAAG,QAAQ,AAAX,CAAY"}
|
|
@@ -14,15 +14,19 @@ export interface FlowOptions {
|
|
|
14
14
|
* deep-link payload, etc.) and pass it straight through here; the SDK
|
|
15
15
|
* does not parse the host page's URL itself.
|
|
16
16
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
17
|
+
* Authenticates the widget as the resumed session (instead of creating a
|
|
18
|
+
* new one) and looks up which step failed, so the customer lands
|
|
19
|
+
* directly on document_capture or liveness instead of the welcome
|
|
20
|
+
* screen — skipping country/ID-type selection, which is pre-filled from
|
|
21
|
+
* the original attempt. Falls back to the normal welcome screen if that
|
|
22
|
+
* lookup doesn't resolve cleanly (an already-used/expired token, or the
|
|
23
|
+
* original channel no longer exists in this config); the resume itself
|
|
24
|
+
* still works correctly via the backend's own resume-match once
|
|
25
|
+
* create/submit is called either way — this only affects which screen
|
|
26
|
+
* is shown first.
|
|
27
|
+
*
|
|
28
|
+
* A data-verification/liveness-only failure has no document channel to
|
|
29
|
+
* re-select, so it goes straight to the liveness step.
|
|
26
30
|
*/
|
|
27
31
|
resumeToken?: string;
|
|
28
32
|
onComplete?: (result: FlowResult) => void;
|
|
@@ -117,6 +121,7 @@ export declare class SmartComplyFlow {
|
|
|
117
121
|
close(): void;
|
|
118
122
|
private mount;
|
|
119
123
|
private initialize;
|
|
124
|
+
private _resolveResumeStep;
|
|
120
125
|
private _showExpiryWarningWhenSafe;
|
|
121
126
|
private static readonly MAX_EXPIRY_DEFERRALS;
|
|
122
127
|
private _expiryDeferrals;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SmartComplyFlow.d.ts","sourceRoot":"","sources":["../../../src/flow/SmartComplyFlow.ts"],"names":[],"mappings":"AACA,OAAO,EAA6B,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAIxF,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAoB,YAAY,EAAE,MAAM,wBAAwB,CAAC;AA2CxE,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB
|
|
1
|
+
{"version":3,"file":"SmartComplyFlow.d.ts","sourceRoot":"","sources":["../../../src/flow/SmartComplyFlow.ts"],"names":[],"mappings":"AACA,OAAO,EAA6B,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAIxF,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAoB,YAAY,EAAE,MAAM,wBAAwB,CAAC;AA2CxE,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC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IAgBtB;;;;;;;OAOG;IACH,OAAO,CAAC,kBAAkB;IAO1B;;;;;OAKG;IACH,OAAO,CAAC,cAAc;IAkBtB,OAAO,CAAC,cAAc;IAmFtB,OAAO,CAAC,UAAU;IAUlB,OAAO,CAAC,YAAY;CAiCrB"}
|
|
@@ -654,12 +654,78 @@ export class SmartComplyFlow {
|
|
|
654
654
|
}
|
|
655
655
|
if (this.isDestroyed)
|
|
656
656
|
return;
|
|
657
|
-
this.showStep("welcome");
|
|
657
|
+
this.showStep(this.options.resumeToken ? await this._resolveResumeStep() : "welcome");
|
|
658
658
|
}
|
|
659
659
|
catch (err) {
|
|
660
660
|
this.showErrorStep(err.message || "Failed to initialize. Please try again.");
|
|
661
661
|
}
|
|
662
662
|
}
|
|
663
|
+
// Resolves a resume_token to the step the customer should land on,
|
|
664
|
+
// pre-selecting the same country/ID type the original attempt used (the
|
|
665
|
+
// same state renderCountrySelect/renderIdTypeSelect's own click handlers
|
|
666
|
+
// set) so document_capture/liveness render correctly instead of assuming
|
|
667
|
+
// state that was never set. Falls back to "welcome" on anything that
|
|
668
|
+
// doesn't resolve cleanly — this is a UX improvement, not a requirement:
|
|
669
|
+
// the backend's own resume-match at create/ time still works correctly
|
|
670
|
+
// even if the widget can't figure out which screen to pre-select.
|
|
671
|
+
async _resolveResumeStep() {
|
|
672
|
+
try {
|
|
673
|
+
const info = await this.sdk.getResumeInfo();
|
|
674
|
+
if (info.verification_type === "liveness_only" ||
|
|
675
|
+
info.failure_stage === "liveness" ||
|
|
676
|
+
// data_match is always a selfie-vs-identity-photo mismatch (see the
|
|
677
|
+
// backend's own comment in _process_identity_face_match) — fixed by
|
|
678
|
+
// redoing the selfie/video, same as a "liveness" failure. There is
|
|
679
|
+
// no document step in data verification at all, so this can never
|
|
680
|
+
// legitimately need document_capture.
|
|
681
|
+
info.failure_stage === "data_match") {
|
|
682
|
+
// Nothing to re-select — there's no document channel to pick, just
|
|
683
|
+
// liveness itself to redo. selectedCountry still needs a non-blank
|
|
684
|
+
// value (renderLiveness sends it as a required field) the same way
|
|
685
|
+
// the liveness-only welcome-screen path already handles this.
|
|
686
|
+
this.selectedCountry = info.country || this.selectedCountry || "global";
|
|
687
|
+
return "liveness";
|
|
688
|
+
}
|
|
689
|
+
if (info.failure_stage === "document" && info.country && info.identifier_type) {
|
|
690
|
+
const channels = this.sdkConfig?.channels || {};
|
|
691
|
+
const idTypes = channels[info.country] || [];
|
|
692
|
+
const match = idTypes.find((idType) => {
|
|
693
|
+
const code = typeof idType === "string" ? idType : (idType.code || idType.name);
|
|
694
|
+
return code === info.identifier_type;
|
|
695
|
+
});
|
|
696
|
+
if (match) {
|
|
697
|
+
const typeName = typeof match === "string" ? match : match.name;
|
|
698
|
+
const typeCode = typeof match === "string" ? match : (match.code || match.name);
|
|
699
|
+
const channelFields = typeof match !== "string" ? (match.fields || []) : [];
|
|
700
|
+
const isDocFlow = channelFields.some((f) => isUploadFieldType(f.type)) || this.isDocumentFlow();
|
|
701
|
+
const info2 = resolveIdTypeInfo(typeName, isDocFlow);
|
|
702
|
+
const requiresBackFromBackend = typeof match !== "string" ? match.requires_back_side : undefined;
|
|
703
|
+
this.selectedCountry = info.country;
|
|
704
|
+
this.selectedIdType = typeCode;
|
|
705
|
+
this.selectedIdTypeName = typeName;
|
|
706
|
+
this.selectedRequiresBack = requiresBackFromBackend ?? info2.requiresBack;
|
|
707
|
+
if (typeof match !== "string") {
|
|
708
|
+
this.selectedChannelId = match.id;
|
|
709
|
+
this.selectedChannelFields = match.fields || [];
|
|
710
|
+
}
|
|
711
|
+
return "document_capture";
|
|
712
|
+
}
|
|
713
|
+
// Channel from the original submission no longer exists in this
|
|
714
|
+
// config (e.g. it was disabled since) — fall through to welcome
|
|
715
|
+
// rather than render document_capture with no title/back-side info.
|
|
716
|
+
}
|
|
717
|
+
// Nothing above matched cleanly (e.g. a document channel that no
|
|
718
|
+
// longer exists in this config) — the entry is still correctly bound
|
|
719
|
+
// server-side regardless of which screen the widget shows first.
|
|
720
|
+
return "welcome";
|
|
721
|
+
}
|
|
722
|
+
catch {
|
|
723
|
+
// NOT_A_RESUME_TOKEN / RESUME_TARGET_UNAVAILABLE / network error —
|
|
724
|
+
// never block the flow on this lookup. create/'s own resume-match
|
|
725
|
+
// still runs correctly once the customer gets there.
|
|
726
|
+
return "welcome";
|
|
727
|
+
}
|
|
728
|
+
}
|
|
663
729
|
// Defers the expiry warning while the user is on a camera-active step
|
|
664
730
|
// (document_capture/liveness) — showing it there would blow away a live
|
|
665
731
|
// video element and in-progress MediaRecorder mid-scan.
|