smartcomply-web-sdk 1.0.93 → 1.0.94
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 +19 -1
- package/dist/esm/flow/SmartComplyFlow.d.ts.map +1 -1
- package/dist/esm/flow/SmartComplyFlow.js +28 -9
- package/dist/esm/flow/SmartComplyFlow.js.map +1 -1
- package/dist/flow/SmartComplyFlow.d.ts +19 -1
- package/dist/flow/SmartComplyFlow.d.ts.map +1 -1
- package/dist/flow/SmartComplyFlow.js +29 -9
- package/dist/flow/SmartComplyFlow.js.map +1 -1
- package/dist/smartcomply.browser.js +7 -7
- package/dist/smartcomply.browser.js.map +3 -3
- 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.94";
|
|
26
26
|
private http;
|
|
27
27
|
private clientId;
|
|
28
28
|
private _sessionToken;
|
|
@@ -125,5 +125,5 @@ exports.SmartComply = 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.94";
|
|
129
129
|
//# 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.94";
|
|
26
26
|
private http;
|
|
27
27
|
private clientId;
|
|
28
28
|
private _sessionToken;
|
|
@@ -121,5 +121,5 @@ export class SmartComply {
|
|
|
121
121
|
* CDN tag they installed with (e.g. @1, which floats to the latest
|
|
122
122
|
* matching release) actually resolved to the version they expect.
|
|
123
123
|
*/
|
|
124
|
-
SmartComply.VERSION = "1.0.
|
|
124
|
+
SmartComply.VERSION = "1.0.94";
|
|
125
125
|
//# sourceMappingURL=Smartcomply.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { VerifyIdentityResponse } from "../types/onboarding";
|
|
1
|
+
import { SDKChannel, VerifyIdentityResponse } from "../types/onboarding";
|
|
2
2
|
import { Environment } from "../client/Config";
|
|
3
3
|
import { BackSideMode } from "../utils/documentRules";
|
|
4
4
|
export interface FlowOptions {
|
|
@@ -40,6 +40,24 @@ export interface FlowResult {
|
|
|
40
40
|
submittedAt: string | null;
|
|
41
41
|
verificationResult?: VerifyIdentityResponse;
|
|
42
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Whether a SPECIFIC channel is a document-scan item, vs. a plain
|
|
45
|
+
* number-entry one. channels[country] is a flat list that can mix
|
|
46
|
+
* data_verification channels (e.g. bare "Passport", a number-entry lookup)
|
|
47
|
+
* with document_verification channels (e.g. "Document Verification -
|
|
48
|
+
* Passport", a scan) whenever an SDK config's verification_type covers
|
|
49
|
+
* both modes — a real, valid dual-mode setup, not a misconfiguration.
|
|
50
|
+
*
|
|
51
|
+
* Reported live: with both modes enabled, every channel rendered and
|
|
52
|
+
* routed as a document scan, including number-entry ones — because the
|
|
53
|
+
* per-channel decision fell back to the config's overall
|
|
54
|
+
* globalDocFlow/verification_type the moment document_verification was
|
|
55
|
+
* enabled ANYWHERE in the config, instead of checking whether THIS
|
|
56
|
+
* channel actually has an upload field. A legacy string-only channel
|
|
57
|
+
* (typeof idType === "string") carries no fields array to check at all,
|
|
58
|
+
* so that's the only case the global flow mode is still used for.
|
|
59
|
+
*/
|
|
60
|
+
export declare function isChannelDocumentFlow(idType: string | SDKChannel, globalDocFlow: boolean): boolean;
|
|
43
61
|
/**
|
|
44
62
|
* Whether a showErrorStep() message is about an expired/invalid resume or
|
|
45
63
|
* 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,
|
|
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;AAIxF,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,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|
|
67
67
|
function isUploadFieldType(type) {
|
|
68
68
|
return type === "upload" || type === "image" || type === "file";
|
|
69
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* Whether a SPECIFIC channel is a document-scan item, vs. a plain
|
|
72
|
+
* number-entry one. channels[country] is a flat list that can mix
|
|
73
|
+
* data_verification channels (e.g. bare "Passport", a number-entry lookup)
|
|
74
|
+
* with document_verification channels (e.g. "Document Verification -
|
|
75
|
+
* Passport", a scan) whenever an SDK config's verification_type covers
|
|
76
|
+
* both modes — a real, valid dual-mode setup, not a misconfiguration.
|
|
77
|
+
*
|
|
78
|
+
* Reported live: with both modes enabled, every channel rendered and
|
|
79
|
+
* routed as a document scan, including number-entry ones — because the
|
|
80
|
+
* per-channel decision fell back to the config's overall
|
|
81
|
+
* globalDocFlow/verification_type the moment document_verification was
|
|
82
|
+
* enabled ANYWHERE in the config, instead of checking whether THIS
|
|
83
|
+
* channel actually has an upload field. A legacy string-only channel
|
|
84
|
+
* (typeof idType === "string") carries no fields array to check at all,
|
|
85
|
+
* so that's the only case the global flow mode is still used for.
|
|
86
|
+
*/
|
|
87
|
+
export function isChannelDocumentFlow(idType, globalDocFlow) {
|
|
88
|
+
if (typeof idType === "string")
|
|
89
|
+
return globalDocFlow;
|
|
90
|
+
return (idType.fields || []).some((f) => isUploadFieldType(f.type));
|
|
91
|
+
}
|
|
70
92
|
/**
|
|
71
93
|
* Whether a showErrorStep() message is about an expired/invalid resume or
|
|
72
94
|
* resubmit link (RESUME_TARGET_UNAVAILABLE / NOT_A_RESUME_TOKEN — see
|
|
@@ -1137,9 +1159,9 @@ export class SmartComplyFlow {
|
|
|
1137
1159
|
const typeName = typeof idType === "string" ? idType : idType.name;
|
|
1138
1160
|
// Use code (canonical) for API calls, fallback to name for backward compatibility
|
|
1139
1161
|
const typeCode = typeof idType === "string" ? idType : (idType.code || idType.name);
|
|
1140
|
-
// Detect per-channel
|
|
1141
|
-
|
|
1142
|
-
const isThisDocFlow =
|
|
1162
|
+
// Detect per-channel, not from the config's overall mode — see
|
|
1163
|
+
// isChannelDocumentFlow's docstring for why.
|
|
1164
|
+
const isThisDocFlow = isChannelDocumentFlow(idType, globalDocFlow);
|
|
1143
1165
|
const info = resolveIdTypeInfo(typeName, isThisDocFlow);
|
|
1144
1166
|
// Prefer the backend-provided back-side flag; fall back to local heuristics only when absent.
|
|
1145
1167
|
const requiresBackFromBackend = typeof idType !== "string" ? idType.requires_back_side : undefined;
|
|
@@ -1177,12 +1199,9 @@ export class SmartComplyFlow {
|
|
|
1177
1199
|
this.selectedChannelId = idType.id;
|
|
1178
1200
|
this.selectedChannelFields = idType.fields || []; // guard null/undefined from backend
|
|
1179
1201
|
}
|
|
1180
|
-
// Route
|
|
1181
|
-
//
|
|
1182
|
-
const
|
|
1183
|
-
const vType = this.sdkConfig?.verification_type;
|
|
1184
|
-
const vTypes = vType ? (Array.isArray(vType) ? vType : [vType]) : [];
|
|
1185
|
-
const isDocChannel = hasUpload || (vTypes.length > 0 && vTypes.includes("document_verification"));
|
|
1202
|
+
// Route on THIS channel, same as isThisDocFlow above — see
|
|
1203
|
+
// isChannelDocumentFlow's docstring.
|
|
1204
|
+
const isDocChannel = isChannelDocumentFlow(idType, globalDocFlow);
|
|
1186
1205
|
this.showStep(isDocChannel ? "document_capture" : "id_input");
|
|
1187
1206
|
});
|
|
1188
1207
|
container.appendChild(card);
|