smartcomply-web-sdk 1.0.94 → 1.0.96
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 +1 -1
- package/dist/client/Smartcomply.d.ts.map +1 -1
- package/dist/client/Smartcomply.js +6 -2
- package/dist/client/Smartcomply.js.map +1 -1
- package/dist/esm/client/Smartcomply.d.ts +1 -1
- package/dist/esm/client/Smartcomply.d.ts.map +1 -1
- package/dist/esm/client/Smartcomply.js +6 -2
- package/dist/esm/client/Smartcomply.js.map +1 -1
- package/dist/esm/flow/SmartComplyFlow.d.ts +18 -1
- package/dist/esm/flow/SmartComplyFlow.d.ts.map +1 -1
- package/dist/esm/flow/SmartComplyFlow.js +38 -12
- package/dist/esm/flow/SmartComplyFlow.js.map +1 -1
- package/dist/esm/types/onboarding.d.ts +5 -1
- package/dist/esm/types/onboarding.d.ts.map +1 -1
- package/dist/esm/utils/channels.d.ts +16 -0
- package/dist/esm/utils/channels.d.ts.map +1 -0
- package/dist/esm/utils/channels.js +48 -0
- package/dist/esm/utils/channels.js.map +1 -0
- package/dist/flow/SmartComplyFlow.d.ts +18 -1
- package/dist/flow/SmartComplyFlow.d.ts.map +1 -1
- package/dist/flow/SmartComplyFlow.js +42 -15
- package/dist/flow/SmartComplyFlow.js.map +1 -1
- package/dist/smartcomply.browser.js +43 -9
- package/dist/smartcomply.browser.js.map +4 -4
- package/dist/types/onboarding.d.ts +5 -1
- package/dist/types/onboarding.d.ts.map +1 -1
- package/dist/utils/channels.d.ts +16 -0
- package/dist/utils/channels.d.ts.map +1 -0
- package/dist/utils/channels.js +52 -0
- package/dist/utils/channels.js.map +1 -0
- package/package.json +1 -1
|
@@ -22,7 +22,7 @@ export declare class SmartComply {
|
|
|
22
22
|
* CDN tag they installed with (e.g. @1, which floats to the latest
|
|
23
23
|
* matching release) actually resolved to the version they expect.
|
|
24
24
|
*/
|
|
25
|
-
static readonly VERSION = "1.0.
|
|
25
|
+
static readonly VERSION = "1.0.96";
|
|
26
26
|
private http;
|
|
27
27
|
private clientId;
|
|
28
28
|
private _sessionToken;
|
|
@@ -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;
|
|
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;AAG9D,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;IAahD;;;;;;;;;OASG;IACG,aAAa,IAAI,OAAO,CAAC,0BAA0B,CAAC;CAM3D"}
|
|
@@ -5,6 +5,7 @@ const HttpClient_1 = require("./HttpClient");
|
|
|
5
5
|
const onboarding_1 = require("../modules/onboarding/onboarding");
|
|
6
6
|
const liveness_1 = require("../modules/liveness/liveness");
|
|
7
7
|
const logger_1 = require("../utils/logger");
|
|
8
|
+
const channels_1 = require("../utils/channels");
|
|
8
9
|
/**
|
|
9
10
|
* SmartComply SDK — main entry point.
|
|
10
11
|
*
|
|
@@ -97,7 +98,10 @@ class SmartComply {
|
|
|
97
98
|
* Returns: { brand_name, theme, verification_type, channels, redirect_url, ... }
|
|
98
99
|
*/
|
|
99
100
|
async initializeConfig() {
|
|
100
|
-
const
|
|
101
|
+
const response = await this.http.sessionRequest("GET", "/v1/initialize/");
|
|
102
|
+
// Older backends send one flat channel list per country; always hand
|
|
103
|
+
// callers the {data_verification, document_verification} shape.
|
|
104
|
+
const config = { ...response, channels: (0, channels_1.normalizeChannels)(response.channels) };
|
|
101
105
|
this._sdkConfig = config;
|
|
102
106
|
return config;
|
|
103
107
|
}
|
|
@@ -125,5 +129,5 @@ exports.SmartComply = SmartComply;
|
|
|
125
129
|
* CDN tag they installed with (e.g. @1, which floats to the latest
|
|
126
130
|
* matching release) actually resolved to the version they expect.
|
|
127
131
|
*/
|
|
128
|
-
SmartComply.VERSION = "1.0.
|
|
132
|
+
SmartComply.VERSION = "1.0.96";
|
|
129
133
|
//# 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;AAC5C,gDAAsD;AAOtD;;;;;;;;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,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;QACrD,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAC;QACnF,CAAC;QAED,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QAChC,IAAI,CAAC,IAAI,GAAG,IAAI,uBAAU,CAAC,MAAM,CAAC,CAAC;QAEnC,IAAI,CAAC,UAAU,GAAG,IAAI,6BAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClD,IAAI,CAAC,QAAQ,GAAG,IAAI,yBAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAE9C,kBAAS,CAAC,MAAM,CAAC,IAAI,WAAW,CAAC,OAAO,EAAE,CAAC,CAAC;IAC9C,CAAC;IAED,sDAAsD;IACtD,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED,uCAAuC;IACvC,IAAI,gBAAgB;QAClB,OAAO,IAAI,CAAC,iBAAiB,CAAC;IAChC,CAAC;IAED,gFAAgF;IAChF,IAAI,SAAS;QACX,OA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;GAQG;AACa,mBAAO,GAAG,QAAQ,AAAX,CAAY"}
|
|
@@ -22,7 +22,7 @@ export declare class SmartComply {
|
|
|
22
22
|
* CDN tag they installed with (e.g. @1, which floats to the latest
|
|
23
23
|
* matching release) actually resolved to the version they expect.
|
|
24
24
|
*/
|
|
25
|
-
static readonly VERSION = "1.0.
|
|
25
|
+
static readonly VERSION = "1.0.96";
|
|
26
26
|
private http;
|
|
27
27
|
private clientId;
|
|
28
28
|
private _sessionToken;
|
|
@@ -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;
|
|
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;AAG9D,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;IAahD;;;;;;;;;OASG;IACG,aAAa,IAAI,OAAO,CAAC,0BAA0B,CAAC;CAM3D"}
|
|
@@ -2,6 +2,7 @@ import { HttpClient } from "./HttpClient";
|
|
|
2
2
|
import { OnboardingModule } from "../modules/onboarding/onboarding";
|
|
3
3
|
import { LivenessModule } from "../modules/liveness/liveness";
|
|
4
4
|
import { SDKLogger } from "../utils/logger";
|
|
5
|
+
import { normalizeChannels } from "../utils/channels";
|
|
5
6
|
/**
|
|
6
7
|
* SmartComply SDK — main entry point.
|
|
7
8
|
*
|
|
@@ -94,7 +95,10 @@ export class SmartComply {
|
|
|
94
95
|
* Returns: { brand_name, theme, verification_type, channels, redirect_url, ... }
|
|
95
96
|
*/
|
|
96
97
|
async initializeConfig() {
|
|
97
|
-
const
|
|
98
|
+
const response = await this.http.sessionRequest("GET", "/v1/initialize/");
|
|
99
|
+
// Older backends send one flat channel list per country; always hand
|
|
100
|
+
// callers the {data_verification, document_verification} shape.
|
|
101
|
+
const config = { ...response, channels: normalizeChannels(response.channels) };
|
|
98
102
|
this._sdkConfig = config;
|
|
99
103
|
return config;
|
|
100
104
|
}
|
|
@@ -121,5 +125,5 @@ export class SmartComply {
|
|
|
121
125
|
* CDN tag they installed with (e.g. @1, which floats to the latest
|
|
122
126
|
* matching release) actually resolved to the version they expect.
|
|
123
127
|
*/
|
|
124
|
-
SmartComply.VERSION = "1.0.
|
|
128
|
+
SmartComply.VERSION = "1.0.96";
|
|
125
129
|
//# 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;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAOtD;;;;;;;;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,iCAAiC,CAAC,CAAC;QACrD,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAC;QACnF,CAAC;QAED,IAAI,CAAC,QAAQ,GAAG,MAAM,CAA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;;;;;OAQG;IACH,KAAK,CAAC,gBAAgB;QACpB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,cAAc,CAC7C,KAAK,EACL,iBAAiB,CAClB,CAAC;QACF,qEAAqE;QACrE,gEAAgE;QAChE,MAAM,MAAM,GAAG,EAAE,GAAG,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QAE/E,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;;AA9ID;;;;;;;;GAQG;AACa,mBAAO,GAAG,QAAQ,AAAX,CAAY"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SDKChannel, VerifyIdentityResponse } from "../types/onboarding";
|
|
1
|
+
import { SDKChannel, ChannelsByCategory, VerifyIdentityResponse } from "../types/onboarding";
|
|
2
2
|
import { Environment } from "../client/Config";
|
|
3
3
|
import { BackSideMode } from "../utils/documentRules";
|
|
4
4
|
export interface FlowOptions {
|
|
@@ -58,6 +58,23 @@ export interface FlowResult {
|
|
|
58
58
|
* so that's the only case the global flow mode is still used for.
|
|
59
59
|
*/
|
|
60
60
|
export declare function isChannelDocumentFlow(idType: string | SDKChannel, globalDocFlow: boolean): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Picks the channel list for the "Select document type" / "Select ID type"
|
|
63
|
+
* screen — the one list that actually matches this screen's mode, not a
|
|
64
|
+
* flat list mixing both categories.
|
|
65
|
+
*
|
|
66
|
+
* Reported live: the deployed widget's document-scan screen showed a bare
|
|
67
|
+
* "Passport" (data_verification, number-entry) right next to "Document
|
|
68
|
+
* Verification - Passport" (document_verification, scan) as if they were
|
|
69
|
+
* the same kind of option — because channels[country] used to be one flat
|
|
70
|
+
* list with no category split at all. Splitting the backend response
|
|
71
|
+
* (SDKSecureLoaderView, adhere-backend) into {data_verification,
|
|
72
|
+
* document_verification} only helps if this screen then reads the ONE
|
|
73
|
+
* list matching globalDocFlow, instead of still flattening both — that's
|
|
74
|
+
* what actually removes the duplicate, not just how each entry displays
|
|
75
|
+
* (see isChannelDocumentFlow above, which only decides that).
|
|
76
|
+
*/
|
|
77
|
+
export declare function selectIdTypesForScreen(byCategory: ChannelsByCategory | undefined, globalDocFlow: boolean): (string | SDKChannel)[];
|
|
61
78
|
/**
|
|
62
79
|
* Whether a showErrorStep() message is about an expired/invalid resume or
|
|
63
80
|
* resubmit link (RESUME_TARGET_UNAVAILABLE / NOT_A_RESUME_TOKEN — see
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SmartComplyFlow.d.ts","sourceRoot":"","sources":["../../../src/flow/SmartComplyFlow.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,UAAU,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"SmartComplyFlow.d.ts","sourceRoot":"","sources":["../../../src/flow/SmartComplyFlow.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,UAAU,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAK5G,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAoB,YAAY,EAAE,MAAM,wBAAwB,CAAC;AA4CxE,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;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,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,CAAC,aAAa;IAiHrB,OAAO,CAAC,YAAY;IAqHpB,OAAO,CAAC,YAAY;IAyBpB,OAAO,CAAC,eAAe;IAUvB,OAAO,CAAC,gBAAgB;IAmDxB,OAAO,CAAC,mBAAmB;IAsB3B,OAAO,CAAC,qBAAqB;IAmB7B,sGAAsG;IACtG,OAAO,CAAC,UAAU;IAUlB,OAAO,CAAC,cAAc;IAsBtB;;;;;;;OAOG;IACH,OAAO,CAAC,kBAAkB;IAO1B;;;;;OAKG;IACH,OAAO,CAAC,cAAc;IAkBtB,OAAO,CAAC,cAAc;IAmFtB,OAAO,CAAC,UAAU;IAUlB,OAAO,CAAC,YAAY;CAiCrB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SmartComply } from "../client/Smartcomply";
|
|
2
2
|
import { getTheme, TYPE, RADIUS } from "./theme";
|
|
3
3
|
import { DocumentCapture } from "./DocumentCapture";
|
|
4
|
+
import { isUploadFieldType } from "../utils/channels";
|
|
4
5
|
import { collectDeviceMetadata } from "../utils/device";
|
|
5
6
|
import { requiresBackSide } from "../utils/documentRules";
|
|
6
7
|
import { DEFAULT_CHALLENGE_ACTIONS } from "../utils/constants";
|
|
@@ -60,13 +61,6 @@ const COUNTRY_LABELS = {
|
|
|
60
61
|
united_states: "🇺🇸 United States",
|
|
61
62
|
united_kingdom: "🇬🇧 United Kingdom",
|
|
62
63
|
};
|
|
63
|
-
// Backend/admin data tags document-capture fields inconsistently — the field
|
|
64
|
-
// renderer (below) already treats "image" and "file" as file inputs alongside
|
|
65
|
-
// "upload", so flow-routing decisions must recognize the same set or a channel
|
|
66
|
-
// tagged "image"/"file" silently falls back to the number-entry screen.
|
|
67
|
-
function isUploadFieldType(type) {
|
|
68
|
-
return type === "upload" || type === "image" || type === "file";
|
|
69
|
-
}
|
|
70
64
|
/**
|
|
71
65
|
* Whether a SPECIFIC channel is a document-scan item, vs. a plain
|
|
72
66
|
* number-entry one. channels[country] is a flat list that can mix
|
|
@@ -89,6 +83,27 @@ export function isChannelDocumentFlow(idType, globalDocFlow) {
|
|
|
89
83
|
return globalDocFlow;
|
|
90
84
|
return (idType.fields || []).some((f) => isUploadFieldType(f.type));
|
|
91
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* Picks the channel list for the "Select document type" / "Select ID type"
|
|
88
|
+
* screen — the one list that actually matches this screen's mode, not a
|
|
89
|
+
* flat list mixing both categories.
|
|
90
|
+
*
|
|
91
|
+
* Reported live: the deployed widget's document-scan screen showed a bare
|
|
92
|
+
* "Passport" (data_verification, number-entry) right next to "Document
|
|
93
|
+
* Verification - Passport" (document_verification, scan) as if they were
|
|
94
|
+
* the same kind of option — because channels[country] used to be one flat
|
|
95
|
+
* list with no category split at all. Splitting the backend response
|
|
96
|
+
* (SDKSecureLoaderView, adhere-backend) into {data_verification,
|
|
97
|
+
* document_verification} only helps if this screen then reads the ONE
|
|
98
|
+
* list matching globalDocFlow, instead of still flattening both — that's
|
|
99
|
+
* what actually removes the duplicate, not just how each entry displays
|
|
100
|
+
* (see isChannelDocumentFlow above, which only decides that).
|
|
101
|
+
*/
|
|
102
|
+
export function selectIdTypesForScreen(byCategory, globalDocFlow) {
|
|
103
|
+
if (!byCategory)
|
|
104
|
+
return [];
|
|
105
|
+
return (globalDocFlow ? byCategory.document_verification : byCategory.data_verification) || [];
|
|
106
|
+
}
|
|
92
107
|
/**
|
|
93
108
|
* Whether a showErrorStep() message is about an expired/invalid resume or
|
|
94
109
|
* resubmit link (RESUME_TARGET_UNAVAILABLE / NOT_A_RESUME_TOKEN — see
|
|
@@ -757,8 +772,11 @@ export class SmartComplyFlow {
|
|
|
757
772
|
return "liveness";
|
|
758
773
|
}
|
|
759
774
|
if (info.failure_stage === "document" && info.country && info.identifier_type) {
|
|
775
|
+
// A document-stage resume always references a document_verification
|
|
776
|
+
// channel by its doc code — channels[country] is now split by
|
|
777
|
+
// category (see ChannelsByCategory), so search that list directly.
|
|
760
778
|
const channels = this.sdkConfig?.channels || {};
|
|
761
|
-
const idTypes = channels[info.country] || [];
|
|
779
|
+
const idTypes = channels[info.country]?.document_verification || [];
|
|
762
780
|
const match = idTypes.find((idType) => {
|
|
763
781
|
const code = typeof idType === "string" ? idType : (idType.code || idType.name);
|
|
764
782
|
return code === info.identifier_type;
|
|
@@ -1134,7 +1152,9 @@ export class SmartComplyFlow {
|
|
|
1134
1152
|
subtitle.textContent = "Choose the country that issued your ID";
|
|
1135
1153
|
container.appendChild(subtitle);
|
|
1136
1154
|
for (const country of countries) {
|
|
1137
|
-
const
|
|
1155
|
+
const count = channels[country].data_verification.length
|
|
1156
|
+
+ channels[country].document_verification.length;
|
|
1157
|
+
const card = this.createOptionCard(COUNTRY_LABELS[country] || country, `${count} ID type${count > 1 ? "s" : ""} available`, () => {
|
|
1138
1158
|
this.selectedCountry = country;
|
|
1139
1159
|
this.showStep("id_type");
|
|
1140
1160
|
});
|
|
@@ -1154,7 +1174,7 @@ export class SmartComplyFlow {
|
|
|
1154
1174
|
: "Choose the ID you want to verify";
|
|
1155
1175
|
container.appendChild(subtitle);
|
|
1156
1176
|
const channels = this.sdkConfig?.channels || {};
|
|
1157
|
-
const idTypes = channels[this.selectedCountry]
|
|
1177
|
+
const idTypes = selectIdTypesForScreen(channels[this.selectedCountry], globalDocFlow);
|
|
1158
1178
|
for (const idType of idTypes) {
|
|
1159
1179
|
const typeName = typeof idType === "string" ? idType : idType.name;
|
|
1160
1180
|
// Use code (canonical) for API calls, fallback to name for backward compatibility
|
|
@@ -2747,10 +2767,16 @@ export class SmartComplyFlow {
|
|
|
2747
2767
|
if (types.includes("data_verification"))
|
|
2748
2768
|
return false;
|
|
2749
2769
|
}
|
|
2750
|
-
// 2. Fallback: inspect channel fields — any upload field = document flow
|
|
2770
|
+
// 2. Fallback: inspect channel fields — any upload field = document flow.
|
|
2771
|
+
// channels[country] is now split {data_verification, document_verification}
|
|
2772
|
+
// (see ChannelsByCategory) — flatten both sub-lists per country, not the
|
|
2773
|
+
// per-country objects themselves.
|
|
2751
2774
|
const channels = this.sdkConfig?.channels || {};
|
|
2752
2775
|
const allFields = Object.values(channels)
|
|
2753
|
-
.
|
|
2776
|
+
.flatMap((byCategory) => [
|
|
2777
|
+
...(byCategory.data_verification || []),
|
|
2778
|
+
...(byCategory.document_verification || []),
|
|
2779
|
+
])
|
|
2754
2780
|
.flatMap((ch) => ch.fields || []);
|
|
2755
2781
|
return allFields.some((f) => isUploadFieldType(f.type));
|
|
2756
2782
|
}
|