smartcomply-web-sdk 1.0.100 β 1.0.101
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 +0 -1
- package/dist/esm/flow/SmartComplyFlow.d.ts.map +1 -1
- package/dist/esm/flow/SmartComplyFlow.js +59 -62
- package/dist/esm/flow/SmartComplyFlow.js.map +1 -1
- package/dist/esm/types/onboarding.d.ts +2 -0
- package/dist/esm/types/onboarding.d.ts.map +1 -1
- package/dist/esm/utils/channels.d.ts +15 -0
- package/dist/esm/utils/channels.d.ts.map +1 -1
- package/dist/esm/utils/channels.js +41 -0
- package/dist/esm/utils/channels.js.map +1 -1
- package/dist/flow/SmartComplyFlow.d.ts +0 -1
- package/dist/flow/SmartComplyFlow.d.ts.map +1 -1
- package/dist/flow/SmartComplyFlow.js +58 -61
- package/dist/flow/SmartComplyFlow.js.map +1 -1
- package/dist/smartcomply.browser.js +73 -76
- package/dist/smartcomply.browser.js.map +3 -3
- package/dist/types/onboarding.d.ts +2 -0
- package/dist/types/onboarding.d.ts.map +1 -1
- package/dist/utils/channels.d.ts +15 -0
- package/dist/utils/channels.d.ts.map +1 -1
- package/dist/utils/channels.js +44 -0
- package/dist/utils/channels.js.map +1 -1
- 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.101";
|
|
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.101";
|
|
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.101";
|
|
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.101";
|
|
129
129
|
//# sourceMappingURL=Smartcomply.js.map
|
|
@@ -183,7 +183,6 @@ export declare class SmartComplyFlow {
|
|
|
183
183
|
private renderConfirmIdentity;
|
|
184
184
|
private renderDocumentConfirm;
|
|
185
185
|
private renderOcrGate;
|
|
186
|
-
private _renderExpiredDocument;
|
|
187
186
|
private _renderOcrQualityFail;
|
|
188
187
|
/**
|
|
189
188
|
* The document passed OCR's own quality gate (it was readable) but failed
|
|
@@ -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;AAK5G,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAoB,YAAY,EAAE,MAAM,wBAAwB,CAAC;A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,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,7 +1,7 @@
|
|
|
1
1
|
import { SmartComply } from "../client/Smartcomply";
|
|
2
2
|
import { getTheme, TYPE, RADIUS } from "./theme";
|
|
3
3
|
import { DocumentCapture, DocumentCaptureCancelledError } from "./DocumentCapture";
|
|
4
|
-
import { isUploadFieldType } from "../utils/channels";
|
|
4
|
+
import { countryCodeFor, countryLabel, filterCountries, isUploadFieldType } from "../utils/channels";
|
|
5
5
|
import { collectDeviceMetadata } from "../utils/device";
|
|
6
6
|
import { requiresBackSide } from "../utils/documentRules";
|
|
7
7
|
import { DEFAULT_CHALLENGE_ACTIONS, MAX_DOCUMENT_BYTES } from "../utils/constants";
|
|
@@ -52,15 +52,9 @@ const STEP_ORDER = [
|
|
|
52
52
|
"liveness",
|
|
53
53
|
"done",
|
|
54
54
|
];
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
ghana: "π¬π Ghana",
|
|
59
|
-
kenya: "π°πͺ Kenya",
|
|
60
|
-
south_africa: "πΏπ¦ South Africa",
|
|
61
|
-
united_states: "πΊπΈ United States",
|
|
62
|
-
united_kingdom: "π¬π§ United Kingdom",
|
|
63
|
-
};
|
|
55
|
+
// From this many countries up, the country screen shows a search box: a
|
|
56
|
+
// setup can offer passports from every supported country (188).
|
|
57
|
+
const COUNTRY_SEARCH_MIN = 7;
|
|
64
58
|
/**
|
|
65
59
|
* Whether a SPECIFIC channel is a document-scan item, vs. a plain
|
|
66
60
|
* number-entry one. channels[country] is a flat list that can mix
|
|
@@ -1145,15 +1139,47 @@ export class SmartComplyFlow {
|
|
|
1145
1139
|
subtitle.style.cssText = `color:${this.theme.textSecondary};font-size:13px;margin-top:-8px;`;
|
|
1146
1140
|
subtitle.textContent = "Choose the country that issued your ID";
|
|
1147
1141
|
container.appendChild(subtitle);
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1142
|
+
const list = document.createElement("div");
|
|
1143
|
+
list.setAttribute("role", "list");
|
|
1144
|
+
list.style.cssText = "display:flex;flex-direction:column;gap:10px;max-height:min(52vh,420px);overflow-y:auto;padding:2px;";
|
|
1145
|
+
const renderList = (query) => {
|
|
1146
|
+
list.innerHTML = "";
|
|
1147
|
+
const matches = filterCountries(channels, query);
|
|
1148
|
+
if (matches.length === 0) {
|
|
1149
|
+
const empty = document.createElement("div");
|
|
1150
|
+
empty.setAttribute("role", "status");
|
|
1151
|
+
empty.style.cssText = `color:${this.theme.textSecondary};font-size:13px;line-height:1.6;padding:8px 2px;`;
|
|
1152
|
+
empty.textContent = `No country matches "${query.trim()}". Check the spelling or try another name.`;
|
|
1153
|
+
list.appendChild(empty);
|
|
1154
|
+
return;
|
|
1155
|
+
}
|
|
1156
|
+
for (const country of matches) {
|
|
1157
|
+
const count = channels[country].data_verification.length
|
|
1158
|
+
+ channels[country].document_verification.length;
|
|
1159
|
+
const card = this.createOptionCard(countryLabel(channels, country), `${count} ID type${count > 1 ? "s" : ""} available`, () => {
|
|
1160
|
+
this.selectedCountry = country;
|
|
1161
|
+
this.showStep("id_type");
|
|
1162
|
+
});
|
|
1163
|
+
card.setAttribute("role", "listitem");
|
|
1164
|
+
list.appendChild(card);
|
|
1165
|
+
}
|
|
1166
|
+
};
|
|
1167
|
+
if (countries.length >= COUNTRY_SEARCH_MIN) {
|
|
1168
|
+
const search = document.createElement("input");
|
|
1169
|
+
search.type = "search";
|
|
1170
|
+
search.placeholder = "Search countries";
|
|
1171
|
+
search.setAttribute("aria-label", "Search countries");
|
|
1172
|
+
search.autocomplete = "off";
|
|
1173
|
+
search.style.cssText = `
|
|
1174
|
+
width:100%;box-sizing:border-box;padding:11px 14px;border-radius:${RADIUS.md}px;
|
|
1175
|
+
background:${this.theme.cardBg};color:${this.theme.text};
|
|
1176
|
+
border:1.5px solid ${this.theme.border};font-size:14px;outline-offset:2px;
|
|
1177
|
+
`;
|
|
1178
|
+
search.addEventListener("input", () => renderList(search.value));
|
|
1179
|
+
container.appendChild(search);
|
|
1156
1180
|
}
|
|
1181
|
+
renderList("");
|
|
1182
|
+
container.appendChild(list);
|
|
1157
1183
|
}
|
|
1158
1184
|
// ββ ID Type Select ββββββββββββββββββββββββββββββββββββββββββββββ
|
|
1159
1185
|
renderIdTypeSelect(container) {
|
|
@@ -1741,8 +1767,15 @@ export class SmartComplyFlow {
|
|
|
1741
1767
|
faceWrap.appendChild(faceImg);
|
|
1742
1768
|
container.appendChild(faceWrap);
|
|
1743
1769
|
}
|
|
1744
|
-
//
|
|
1745
|
-
if (this.
|
|
1770
|
+
// Expired or expiring-soon notice
|
|
1771
|
+
if (this._ocrIsExpired) {
|
|
1772
|
+
const expired = document.createElement("div");
|
|
1773
|
+
expired.setAttribute("role", "alert");
|
|
1774
|
+
expired.style.cssText = `width:100%;padding:10px 14px;border-radius:10px;background:${this.theme.errorBg};border:1px solid ${this.theme.error}40;color:${this.theme.error};font-size:12px;text-align:left;line-height:1.5;`;
|
|
1775
|
+
expired.textContent = "β οΈ This document has expired. You can continue, but a check with an expired document won't be approved. Use a valid document if you have one.";
|
|
1776
|
+
container.appendChild(expired);
|
|
1777
|
+
}
|
|
1778
|
+
else if (this._ocrExpirySoon) {
|
|
1746
1779
|
const warn = document.createElement("div");
|
|
1747
1780
|
warn.style.cssText = `width:100%;padding:10px 14px;border-radius:10px;background:${this.theme.warning}18;border:1px solid ${this.theme.warning}40;color:${this.theme.warning};font-size:12px;text-align:left;line-height:1.5;`;
|
|
1748
1781
|
warn.textContent = "β οΈ Your document expires soon. Some services may not accept it, but you can still continue.";
|
|
@@ -1845,12 +1878,10 @@ export class SmartComplyFlow {
|
|
|
1845
1878
|
polls++;
|
|
1846
1879
|
try {
|
|
1847
1880
|
const result = await this.sdk.liveness.pollResult(entryId);
|
|
1848
|
-
//
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
return;
|
|
1853
|
-
}
|
|
1881
|
+
// An expired document does not stop the flow: liveness and the face
|
|
1882
|
+
// match still run so the client gets the full result, and the backend
|
|
1883
|
+
// fails the check at the end with "Document has expired." The confirm
|
|
1884
|
+
// screen tells the user (see _ocrIsExpired).
|
|
1854
1885
|
// W8: OCR quality fail β offer retake
|
|
1855
1886
|
if (result.ocr_quality_failed === true) {
|
|
1856
1887
|
container.innerHTML = "";
|
|
@@ -1926,32 +1957,6 @@ export class SmartComplyFlow {
|
|
|
1926
1957
|
// First poll after 3s β give OCR submission time to start
|
|
1927
1958
|
this._ocrPollTimer = setTimeout(poll, 3000);
|
|
1928
1959
|
}
|
|
1929
|
-
_renderExpiredDocument(container) {
|
|
1930
|
-
container.style.cssText += "display:flex;flex-direction:column;align-items:center;text-align:center;gap:14px;padding:20px 0;";
|
|
1931
|
-
const icon = document.createElement("div");
|
|
1932
|
-
icon.style.cssText = `width:72px;height:72px;border-radius:50%;background:${this.theme.errorBg};border:3px solid ${this.theme.error};display:flex;align-items:center;justify-content:center;font-size:28px;`;
|
|
1933
|
-
icon.textContent = "π
";
|
|
1934
|
-
container.appendChild(icon);
|
|
1935
|
-
const t = document.createElement("h2");
|
|
1936
|
-
t.style.cssText = `color:${this.theme.text};font-size:${TYPE.heading}px;font-weight:700;margin:0;`;
|
|
1937
|
-
t.textContent = "Document Expired";
|
|
1938
|
-
container.appendChild(t);
|
|
1939
|
-
const d = document.createElement("p");
|
|
1940
|
-
d.style.cssText = `color:${this.theme.textSecondary};font-size:13px;margin:0;max-width:280px;line-height:1.6;`;
|
|
1941
|
-
d.textContent = "The document you submitted has expired. Please use a valid, current ID.";
|
|
1942
|
-
container.appendChild(d);
|
|
1943
|
-
const retryBtn = this.createPrimaryButton("Try a different document");
|
|
1944
|
-
retryBtn.addEventListener("click", () => {
|
|
1945
|
-
this.livenessEntryId = null;
|
|
1946
|
-
this.documentBlob = null;
|
|
1947
|
-
this.documentBackBlob = null;
|
|
1948
|
-
this.showStep("document_capture");
|
|
1949
|
-
});
|
|
1950
|
-
container.appendChild(retryBtn);
|
|
1951
|
-
const endBtn = this.createSecondaryButton("End session");
|
|
1952
|
-
endBtn.addEventListener("click", () => { this.options.onError?.(new Error("Document expired")); this.close(); });
|
|
1953
|
-
container.appendChild(endBtn);
|
|
1954
|
-
}
|
|
1955
1960
|
_renderOcrQualityFail(container, reason) {
|
|
1956
1961
|
container.style.cssText += "display:flex;flex-direction:column;align-items:center;text-align:center;gap:14px;padding:20px 0;";
|
|
1957
1962
|
const icon = document.createElement("div");
|
|
@@ -2179,11 +2184,7 @@ export class SmartComplyFlow {
|
|
|
2179
2184
|
|| this.idNumber
|
|
2180
2185
|
|| this.selectedIdType
|
|
2181
2186
|
|| `DOC-${Date.now()}`;
|
|
2182
|
-
const
|
|
2183
|
-
nigeria: "NG", ghana: "GH", kenya: "KE",
|
|
2184
|
-
south_africa: "ZA", united_states: "US", united_kingdom: "GB", global: "US",
|
|
2185
|
-
};
|
|
2186
|
-
const country = COUNTRY_CODES[this.selectedCountry] || this.selectedCountry.toUpperCase().slice(0, 2);
|
|
2187
|
+
const country = countryCodeFor(this.sdkConfig?.channels || {}, this.selectedCountry);
|
|
2187
2188
|
const deviceMeta = collectDeviceMetadata();
|
|
2188
2189
|
let createResult;
|
|
2189
2190
|
try {
|
|
@@ -2373,11 +2374,7 @@ export class SmartComplyFlow {
|
|
|
2373
2374
|
? ""
|
|
2374
2375
|
: (this.idNumber || Object.values(this.collectedFields)[0] || this.selectedIdType || `DOC-${Date.now()}`);
|
|
2375
2376
|
const identifierType = isDataVerification ? "" : this.selectedIdType;
|
|
2376
|
-
const
|
|
2377
|
-
nigeria: "NG", ghana: "GH", kenya: "KE",
|
|
2378
|
-
south_africa: "ZA", united_states: "US", united_kingdom: "GB", global: "US",
|
|
2379
|
-
};
|
|
2380
|
-
const country = COUNTRY_CODES[this.selectedCountry] || this.selectedCountry.toUpperCase().slice(0, 2);
|
|
2377
|
+
const country = countryCodeFor(this.sdkConfig?.channels || {}, this.selectedCountry);
|
|
2381
2378
|
// Start liveness check (this handles camera, detection, recording, submission)
|
|
2382
2379
|
// If livenessEntryId exists (document flow), reuse it instead of creating a new one
|
|
2383
2380
|
this.sdk.liveness
|