smartcomply-web-sdk 1.0.98 → 1.0.99
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.js +1 -1
- package/dist/esm/client/Smartcomply.d.ts +1 -1
- package/dist/esm/client/Smartcomply.js +1 -1
- package/dist/esm/flow/SmartComplyFlow.d.ts +4 -3
- package/dist/esm/flow/SmartComplyFlow.d.ts.map +1 -1
- package/dist/esm/flow/SmartComplyFlow.js +27 -5
- package/dist/esm/flow/SmartComplyFlow.js.map +1 -1
- package/dist/flow/SmartComplyFlow.d.ts +4 -3
- package/dist/flow/SmartComplyFlow.d.ts.map +1 -1
- package/dist/flow/SmartComplyFlow.js +27 -5
- package/dist/flow/SmartComplyFlow.js.map +1 -1
- package/dist/smartcomply.browser.js +19 -4
- package/dist/smartcomply.browser.js.map +2 -2
- package/package.json +66 -66
|
@@ -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.99";
|
|
26
26
|
private http;
|
|
27
27
|
private clientId;
|
|
28
28
|
private _sessionToken;
|
|
@@ -129,5 +129,5 @@ exports.SmartComply = SmartComply;
|
|
|
129
129
|
* CDN tag they installed with (e.g. @1, which floats to the latest
|
|
130
130
|
* matching release) actually resolved to the version they expect.
|
|
131
131
|
*/
|
|
132
|
-
SmartComply.VERSION = "1.0.
|
|
132
|
+
SmartComply.VERSION = "1.0.99";
|
|
133
133
|
//# sourceMappingURL=Smartcomply.js.map
|
|
@@ -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.99";
|
|
26
26
|
private http;
|
|
27
27
|
private clientId;
|
|
28
28
|
private _sessionToken;
|
|
@@ -125,5 +125,5 @@ export class SmartComply {
|
|
|
125
125
|
* CDN tag they installed with (e.g. @1, which floats to the latest
|
|
126
126
|
* matching release) actually resolved to the version they expect.
|
|
127
127
|
*/
|
|
128
|
-
SmartComply.VERSION = "1.0.
|
|
128
|
+
SmartComply.VERSION = "1.0.99";
|
|
129
129
|
//# sourceMappingURL=Smartcomply.js.map
|
|
@@ -60,8 +60,9 @@ export interface FlowResult {
|
|
|
60
60
|
export declare function isChannelDocumentFlow(idType: string | SDKChannel, globalDocFlow: boolean): boolean;
|
|
61
61
|
/**
|
|
62
62
|
* Picks the channel list for the "Select document type" / "Select ID type"
|
|
63
|
-
* screen
|
|
64
|
-
*
|
|
63
|
+
* screen: the list matching this screen's mode, both lists when the config
|
|
64
|
+
* enables both modes, and the other list when this mode has nothing for the
|
|
65
|
+
* country (so the screen is never an empty dead end).
|
|
65
66
|
*
|
|
66
67
|
* Reported live: the deployed widget's document-scan screen showed a bare
|
|
67
68
|
* "Passport" (data_verification, number-entry) right next to "Document
|
|
@@ -74,7 +75,7 @@ export declare function isChannelDocumentFlow(idType: string | SDKChannel, globa
|
|
|
74
75
|
* what actually removes the duplicate, not just how each entry displays
|
|
75
76
|
* (see isChannelDocumentFlow above, which only decides that).
|
|
76
77
|
*/
|
|
77
|
-
export declare function selectIdTypesForScreen(byCategory: ChannelsByCategory | undefined, globalDocFlow: boolean): (string | SDKChannel)[];
|
|
78
|
+
export declare function selectIdTypesForScreen(byCategory: ChannelsByCategory | undefined, globalDocFlow: boolean, verificationTypes?: string[]): (string | SDKChannel)[];
|
|
78
79
|
/**
|
|
79
80
|
* Whether a showErrorStep() message is about an expired/invalid resume or
|
|
80
81
|
* 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,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAM5G,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,CAAC;IAC1C,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,kBAAkB,CAAC,EAAE,sBAAsB,CAAC;CAC7C;AA4CD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,GAAG,UAAU,EAC3B,aAAa,EAAE,OAAO,GACrB,OAAO,CAGT;AAED
|
|
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;AA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AO,CAAC,qBAAqB;IA+E7B,OAAO,CAAC,qBAAqB;IAuI7B,OAAO,CAAC,aAAa;IA6HrB,OAAO,CAAC,sBAAsB;IAyB9B,OAAO,CAAC,qBAAqB;IA0C7B;;;;;;;;OAQG;IACH,OAAO,CAAC,iCAAiC;IA6BzC;;;;;OAKG;IACH,OAAO,CAAC,iBAAiB;IAwBzB,OAAO,CAAC,UAAU;IA+ClB,OAAO,CAAC,wBAAwB;IAqBhC,OAAO,CAAC,cAAc;IAUtB;;OAEG;YACW,4BAA4B;IAoB1C;;OAEG;YACW,mBAAmB;IA4HjC,OAAO,CAAC,6BAA6B;IA8DrC,OAAO,CAAC,cAAc;IA4HtB,OAAO,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"}
|
|
@@ -86,8 +86,9 @@ export function isChannelDocumentFlow(idType, globalDocFlow) {
|
|
|
86
86
|
}
|
|
87
87
|
/**
|
|
88
88
|
* Picks the channel list for the "Select document type" / "Select ID type"
|
|
89
|
-
* screen
|
|
90
|
-
*
|
|
89
|
+
* screen: the list matching this screen's mode, both lists when the config
|
|
90
|
+
* enables both modes, and the other list when this mode has nothing for the
|
|
91
|
+
* country (so the screen is never an empty dead end).
|
|
91
92
|
*
|
|
92
93
|
* Reported live: the deployed widget's document-scan screen showed a bare
|
|
93
94
|
* "Passport" (data_verification, number-entry) right next to "Document
|
|
@@ -100,10 +101,21 @@ export function isChannelDocumentFlow(idType, globalDocFlow) {
|
|
|
100
101
|
* what actually removes the duplicate, not just how each entry displays
|
|
101
102
|
* (see isChannelDocumentFlow above, which only decides that).
|
|
102
103
|
*/
|
|
103
|
-
export function selectIdTypesForScreen(byCategory, globalDocFlow) {
|
|
104
|
+
export function selectIdTypesForScreen(byCategory, globalDocFlow, verificationTypes = []) {
|
|
104
105
|
if (!byCategory)
|
|
105
106
|
return [];
|
|
106
|
-
|
|
107
|
+
const documents = byCategory.document_verification || [];
|
|
108
|
+
const data = byCategory.data_verification || [];
|
|
109
|
+
// A config with both modes offers both kinds; each card then routes on its
|
|
110
|
+
// own channel (isChannelDocumentFlow), scan or number entry.
|
|
111
|
+
if (verificationTypes.includes("document_verification") && verificationTypes.includes("data_verification")) {
|
|
112
|
+
return [...documents, ...data];
|
|
113
|
+
}
|
|
114
|
+
const primary = globalDocFlow ? documents : data;
|
|
115
|
+
// Reported live: a country with nothing in this screen's category showed
|
|
116
|
+
// an empty "Select document type" screen with no way forward. Showing the
|
|
117
|
+
// other category is what the widget did before the split (1.0.94).
|
|
118
|
+
return primary.length > 0 ? primary : (globalDocFlow ? data : documents);
|
|
107
119
|
}
|
|
108
120
|
/**
|
|
109
121
|
* Whether a showErrorStep() message is about an expired/invalid resume or
|
|
@@ -1175,7 +1187,17 @@ export class SmartComplyFlow {
|
|
|
1175
1187
|
: "Choose the ID you want to verify";
|
|
1176
1188
|
container.appendChild(subtitle);
|
|
1177
1189
|
const channels = this.sdkConfig?.channels || {};
|
|
1178
|
-
const
|
|
1190
|
+
const vType = this.sdkConfig?.verification_type;
|
|
1191
|
+
const verificationTypes = !vType ? [] : Array.isArray(vType) ? vType : [vType];
|
|
1192
|
+
const idTypes = selectIdTypesForScreen(channels[this.selectedCountry], globalDocFlow, verificationTypes);
|
|
1193
|
+
if (idTypes.length === 0) {
|
|
1194
|
+
const empty = document.createElement("div");
|
|
1195
|
+
empty.style.cssText = `color:${this.theme.textSecondary};font-size:13px;line-height:1.6;`;
|
|
1196
|
+
empty.textContent =
|
|
1197
|
+
"No ID types are set up for this country yet. Please go back and choose another country, or contact support.";
|
|
1198
|
+
container.appendChild(empty);
|
|
1199
|
+
return;
|
|
1200
|
+
}
|
|
1179
1201
|
for (const idType of idTypes) {
|
|
1180
1202
|
const typeName = typeof idType === "string" ? idType : idType.name;
|
|
1181
1203
|
// Use code (canonical) for API calls, fallback to name for backward compatibility
|