smartcomply-web-sdk 1.0.47 → 1.0.48
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/camera/CameraManager.d.ts +7 -0
- package/dist/camera/CameraManager.d.ts.map +1 -1
- package/dist/camera/CameraManager.js +9 -0
- package/dist/camera/CameraManager.js.map +1 -1
- package/dist/esm/camera/CameraManager.d.ts +7 -0
- package/dist/esm/camera/CameraManager.d.ts.map +1 -1
- package/dist/esm/camera/CameraManager.js +9 -0
- package/dist/esm/camera/CameraManager.js.map +1 -1
- package/dist/esm/flow/SmartComplyFlow.d.ts +1 -0
- package/dist/esm/flow/SmartComplyFlow.d.ts.map +1 -1
- package/dist/esm/flow/SmartComplyFlow.js +66 -9
- package/dist/esm/flow/SmartComplyFlow.js.map +1 -1
- package/dist/esm/modules/liveness/liveness.d.ts.map +1 -1
- package/dist/esm/modules/liveness/liveness.js +5 -1
- package/dist/esm/modules/liveness/liveness.js.map +1 -1
- package/dist/flow/SmartComplyFlow.d.ts +1 -0
- package/dist/flow/SmartComplyFlow.d.ts.map +1 -1
- package/dist/flow/SmartComplyFlow.js +66 -9
- package/dist/flow/SmartComplyFlow.js.map +1 -1
- package/dist/modules/liveness/liveness.d.ts.map +1 -1
- package/dist/modules/liveness/liveness.js +5 -1
- package/dist/modules/liveness/liveness.js.map +1 -1
- package/dist/smartcomply.browser.js +55 -4
- package/dist/smartcomply.browser.js.map +2 -2
- package/package.json +1 -1
|
@@ -2,6 +2,13 @@ export declare class CameraManager {
|
|
|
2
2
|
private stream;
|
|
3
3
|
open(constraints?: MediaStreamConstraints): Promise<MediaStream>;
|
|
4
4
|
getStream(): MediaStream | null;
|
|
5
|
+
/**
|
|
6
|
+
* Adopt an externally-obtained stream (e.g. a pre-warmed getUserMedia
|
|
7
|
+
* stream) so stop() also releases it. Without this, a stream assigned
|
|
8
|
+
* directly by a caller instead of via open() is never tracked here and
|
|
9
|
+
* stop() becomes a no-op for it, leaking the camera.
|
|
10
|
+
*/
|
|
11
|
+
setStream(stream: MediaStream): void;
|
|
5
12
|
stop(): void;
|
|
6
13
|
}
|
|
7
14
|
//# sourceMappingURL=CameraManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CameraManager.d.ts","sourceRoot":"","sources":["../../src/camera/CameraManager.ts"],"names":[],"mappings":"AAAA,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAA4B;IAEpC,IAAI,CAAC,WAAW,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,WAAW,CAAC;IAiBtE,SAAS,IAAI,WAAW,GAAG,IAAI;IAI/B,IAAI,IAAI,IAAI;CAMb"}
|
|
1
|
+
{"version":3,"file":"CameraManager.d.ts","sourceRoot":"","sources":["../../src/camera/CameraManager.ts"],"names":[],"mappings":"AAAA,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAA4B;IAEpC,IAAI,CAAC,WAAW,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,WAAW,CAAC;IAiBtE,SAAS,IAAI,WAAW,GAAG,IAAI;IAI/B;;;;;OAKG;IACH,SAAS,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI;IAIpC,IAAI,IAAI,IAAI;CAMb"}
|
|
@@ -20,6 +20,15 @@ class CameraManager {
|
|
|
20
20
|
getStream() {
|
|
21
21
|
return this.stream;
|
|
22
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Adopt an externally-obtained stream (e.g. a pre-warmed getUserMedia
|
|
25
|
+
* stream) so stop() also releases it. Without this, a stream assigned
|
|
26
|
+
* directly by a caller instead of via open() is never tracked here and
|
|
27
|
+
* stop() becomes a no-op for it, leaking the camera.
|
|
28
|
+
*/
|
|
29
|
+
setStream(stream) {
|
|
30
|
+
this.stream = stream;
|
|
31
|
+
}
|
|
23
32
|
stop() {
|
|
24
33
|
if (this.stream) {
|
|
25
34
|
this.stream.getTracks().forEach((track) => track.stop());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CameraManager.js","sourceRoot":"","sources":["../../src/camera/CameraManager.ts"],"names":[],"mappings":";;;AAAA,MAAa,aAAa;IAA1B;QACU,WAAM,GAAuB,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"CameraManager.js","sourceRoot":"","sources":["../../src/camera/CameraManager.ts"],"names":[],"mappings":";;;AAAA,MAAa,aAAa;IAA1B;QACU,WAAM,GAAuB,IAAI,CAAC;IAuC5C,CAAC;IArCC,KAAK,CAAC,IAAI,CAAC,WAAoC;QAC7C,MAAM,QAAQ,GAA2B;YACvC,KAAK,EAAE;gBACL,UAAU,EAAE,MAAM;gBAClB,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE;gBACtB,MAAM,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE;aACvB;YACD,KAAK,EAAE,KAAK;SACb,CAAC;QAEF,IAAI,CAAC,MAAM,GAAG,MAAM,SAAS,CAAC,YAAY,CAAC,YAAY,CACrD,WAAW,IAAI,QAAQ,CACxB,CAAC;QAEF,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED;;;;;OAKG;IACH,SAAS,CAAC,MAAmB;QAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,IAAI;QACF,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;YACzD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACrB,CAAC;IACH,CAAC;CACF;AAxCD,sCAwCC"}
|
|
@@ -2,6 +2,13 @@ export declare class CameraManager {
|
|
|
2
2
|
private stream;
|
|
3
3
|
open(constraints?: MediaStreamConstraints): Promise<MediaStream>;
|
|
4
4
|
getStream(): MediaStream | null;
|
|
5
|
+
/**
|
|
6
|
+
* Adopt an externally-obtained stream (e.g. a pre-warmed getUserMedia
|
|
7
|
+
* stream) so stop() also releases it. Without this, a stream assigned
|
|
8
|
+
* directly by a caller instead of via open() is never tracked here and
|
|
9
|
+
* stop() becomes a no-op for it, leaking the camera.
|
|
10
|
+
*/
|
|
11
|
+
setStream(stream: MediaStream): void;
|
|
5
12
|
stop(): void;
|
|
6
13
|
}
|
|
7
14
|
//# sourceMappingURL=CameraManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CameraManager.d.ts","sourceRoot":"","sources":["../../../src/camera/CameraManager.ts"],"names":[],"mappings":"AAAA,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAA4B;IAEpC,IAAI,CAAC,WAAW,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,WAAW,CAAC;IAiBtE,SAAS,IAAI,WAAW,GAAG,IAAI;IAI/B,IAAI,IAAI,IAAI;CAMb"}
|
|
1
|
+
{"version":3,"file":"CameraManager.d.ts","sourceRoot":"","sources":["../../../src/camera/CameraManager.ts"],"names":[],"mappings":"AAAA,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAA4B;IAEpC,IAAI,CAAC,WAAW,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,WAAW,CAAC;IAiBtE,SAAS,IAAI,WAAW,GAAG,IAAI;IAI/B;;;;;OAKG;IACH,SAAS,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI;IAIpC,IAAI,IAAI,IAAI;CAMb"}
|
|
@@ -17,6 +17,15 @@ export class CameraManager {
|
|
|
17
17
|
getStream() {
|
|
18
18
|
return this.stream;
|
|
19
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Adopt an externally-obtained stream (e.g. a pre-warmed getUserMedia
|
|
22
|
+
* stream) so stop() also releases it. Without this, a stream assigned
|
|
23
|
+
* directly by a caller instead of via open() is never tracked here and
|
|
24
|
+
* stop() becomes a no-op for it, leaking the camera.
|
|
25
|
+
*/
|
|
26
|
+
setStream(stream) {
|
|
27
|
+
this.stream = stream;
|
|
28
|
+
}
|
|
20
29
|
stop() {
|
|
21
30
|
if (this.stream) {
|
|
22
31
|
this.stream.getTracks().forEach((track) => track.stop());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CameraManager.js","sourceRoot":"","sources":["../../../src/camera/CameraManager.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,aAAa;IAA1B;QACU,WAAM,GAAuB,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"CameraManager.js","sourceRoot":"","sources":["../../../src/camera/CameraManager.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,aAAa;IAA1B;QACU,WAAM,GAAuB,IAAI,CAAC;IAuC5C,CAAC;IArCC,KAAK,CAAC,IAAI,CAAC,WAAoC;QAC7C,MAAM,QAAQ,GAA2B;YACvC,KAAK,EAAE;gBACL,UAAU,EAAE,MAAM;gBAClB,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE;gBACtB,MAAM,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE;aACvB;YACD,KAAK,EAAE,KAAK;SACb,CAAC;QAEF,IAAI,CAAC,MAAM,GAAG,MAAM,SAAS,CAAC,YAAY,CAAC,YAAY,CACrD,WAAW,IAAI,QAAQ,CACxB,CAAC;QAEF,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED;;;;;OAKG;IACH,SAAS,CAAC,MAAmB;QAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,IAAI;QACF,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAA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;IAmChB,OAAO,CAAC,UAAU;IA6DlB,OAAO,CAAC,aAAa;IAqCrB,OAAO,CAAC,aAAa;IA0IrB,OAAO,CAAC,mBAAmB;IAoC3B,OAAO,CAAC,kBAAkB;IAoF1B,OAAO,CAAC,aAAa;IA4VrB,OAAO,CAAC,qBAAqB;IAqD7B,OAAO,CAAC,qBAAqB;IA+E7B,OAAO,CAAC,qBAAqB;IAsG7B,OAAO,CAAC,aAAa;IAyGrB,OAAO,CAAC,sBAAsB;IAyB9B,OAAO,CAAC,qBAAqB;IA6B7B,OAAO,CAAC,UAAU;IAgDlB,OAAO,CAAC,wBAAwB;IAqBhC,OAAO,CAAC,cAAc;IAUtB;;OAEG;YACW,4BAA4B;IAgB1C;;OAEG;YACW,mBAAmB;IAqHjC,OAAO,CAAC,6BAA6B;IA8DrC,OAAO,CAAC,cAAc;IAkFtB,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,aAAa;IA8FrB,OAAO,CAAC,YAAY;IAmGpB,OAAO,CAAC,YAAY;IAoBpB,OAAO,CAAC,eAAe;IAUvB,OAAO,CAAC,gBAAgB;IAkDxB,OAAO,CAAC,mBAAmB;IAsB3B,OAAO,CAAC,qBAAqB;IAmB7B,OAAO,CAAC,cAAc;IAgBtB,OAAO,CAAC,cAAc;IAkFtB,OAAO,CAAC,UAAU;IAUlB,OAAO,CAAC,YAAY;CAoCrB"}
|
|
@@ -247,6 +247,7 @@ export class SmartComplyFlow {
|
|
|
247
247
|
this.contentArea = null;
|
|
248
248
|
this.progressBar = null;
|
|
249
249
|
this.stepLabel = null;
|
|
250
|
+
this.stageDots = null;
|
|
250
251
|
this.brandLabel = null;
|
|
251
252
|
// State
|
|
252
253
|
this.sdkConfig = null;
|
|
@@ -477,6 +478,14 @@ export class SmartComplyFlow {
|
|
|
477
478
|
clearTimeout(this._ocrPollTimer);
|
|
478
479
|
this._ocrPollTimer = null;
|
|
479
480
|
}
|
|
481
|
+
// Release a pre-warmed camera stream if we're navigating anywhere other
|
|
482
|
+
// than liveness (the only step that consumes it) — otherwise "No, use a
|
|
483
|
+
// different ID" / "No, retake document" / header back-button leave the
|
|
484
|
+
// camera held open indefinitely with no consumer.
|
|
485
|
+
if (step !== "liveness" && this._prewarmedStream) {
|
|
486
|
+
this._prewarmedStream.getTracks().forEach(t => t.stop());
|
|
487
|
+
this._prewarmedStream = null;
|
|
488
|
+
}
|
|
480
489
|
// Update progress
|
|
481
490
|
this.updateProgress();
|
|
482
491
|
// Animate out current content
|
|
@@ -619,8 +628,8 @@ export class SmartComplyFlow {
|
|
|
619
628
|
// W2: Use client brand name in title
|
|
620
629
|
const brandName = this.sdkConfig?.brand_name;
|
|
621
630
|
title.textContent = brandName
|
|
622
|
-
?
|
|
623
|
-
: "Identity
|
|
631
|
+
? `${brandName} Identity Verification`
|
|
632
|
+
: "Verify Your Identity";
|
|
624
633
|
titleWrap.appendChild(title);
|
|
625
634
|
const desc = document.createElement("p");
|
|
626
635
|
desc.style.cssText = `
|
|
@@ -1061,6 +1070,13 @@ export class SmartComplyFlow {
|
|
|
1061
1070
|
this._ivsName = [nd.first_name || nd.firstname || "", nd.last_name || nd.lastname || nd.surname || ""]
|
|
1062
1071
|
.map(s => String(s || "").trim()).filter(Boolean).join(" ");
|
|
1063
1072
|
this._ivsGender = nd.gender || "";
|
|
1073
|
+
// W4: If IVS returned no name, there is nothing for the user to confirm —
|
|
1074
|
+
// auto-proceed straight to Stage 2 (liveness) instead of showing a
|
|
1075
|
+
// confirmation screen with no identity details to check.
|
|
1076
|
+
if (!this._ivsName) {
|
|
1077
|
+
this.showStep("liveness");
|
|
1078
|
+
return;
|
|
1079
|
+
}
|
|
1064
1080
|
// Route to confirmation screen — user must confirm before liveness
|
|
1065
1081
|
this.showStep("confirm_identity");
|
|
1066
1082
|
}
|
|
@@ -1724,6 +1740,11 @@ export class SmartComplyFlow {
|
|
|
1724
1740
|
// ── Liveness ────────────────────────────────────────────────────
|
|
1725
1741
|
renderLiveness(container) {
|
|
1726
1742
|
container.style.cssText += "display:flex;flex-direction:column;gap:14px;";
|
|
1743
|
+
// W13: Check retry limit before starting another liveness attempt
|
|
1744
|
+
if (this._livenessFailures >= SmartComplyFlow.MAX_RETRIES) {
|
|
1745
|
+
this._renderRetryLimitReached(container);
|
|
1746
|
+
return;
|
|
1747
|
+
}
|
|
1727
1748
|
const title = this.createStepTitle("Face verification");
|
|
1728
1749
|
container.appendChild(title);
|
|
1729
1750
|
const desc = document.createElement("div");
|
|
@@ -1734,11 +1755,18 @@ export class SmartComplyFlow {
|
|
|
1734
1755
|
const livenessContainer = document.createElement("div");
|
|
1735
1756
|
livenessContainer.style.cssText = "margin:8px 0;width:100%;";
|
|
1736
1757
|
container.appendChild(livenessContainer);
|
|
1737
|
-
//
|
|
1738
|
-
//
|
|
1739
|
-
|
|
1740
|
-
|
|
1758
|
+
// W9: For data verification, identity is already held by the backend via
|
|
1759
|
+
// identity_check_id — the real ID number/type must not be re-sent. The
|
|
1760
|
+
// backend's LivenessEntrySerializer still requires non-blank identifier /
|
|
1761
|
+
// identifier_type fields, so a non-identifying stub is sent to satisfy that
|
|
1762
|
+
// constraint without leaking the user's actual ID data a second time.
|
|
1763
|
+
// "SES-" + Date.now() (13 digits) = 17 chars, safely under the backend's
|
|
1764
|
+
// 20-char max on identifier.
|
|
1765
|
+
const isDataVerification = !!this.identityCheckId;
|
|
1766
|
+
const identifier = isDataVerification
|
|
1767
|
+
? `SES-${Date.now()}`
|
|
1741
1768
|
: (this.idNumber || Object.values(this.collectedFields)[0] || this.selectedIdType || `DOC-${Date.now()}`);
|
|
1769
|
+
const identifierType = isDataVerification ? "session" : this.selectedIdType;
|
|
1742
1770
|
const COUNTRY_CODES = {
|
|
1743
1771
|
nigeria: "NG", ghana: "GH", kenya: "KE",
|
|
1744
1772
|
south_africa: "ZA", united_states: "US", united_kingdom: "GB", global: "US",
|
|
@@ -1749,7 +1777,7 @@ export class SmartComplyFlow {
|
|
|
1749
1777
|
this.sdk.liveness
|
|
1750
1778
|
.startCheck(livenessContainer, {
|
|
1751
1779
|
identifier,
|
|
1752
|
-
identifier_type:
|
|
1780
|
+
identifier_type: identifierType,
|
|
1753
1781
|
country,
|
|
1754
1782
|
document: this.documentBlob || undefined,
|
|
1755
1783
|
document_back: this.documentBackBlob || undefined,
|
|
@@ -1907,7 +1935,22 @@ export class SmartComplyFlow {
|
|
|
1907
1935
|
this.brandLabel.textContent = this.sdkConfig?.brand_name || "SmartComply";
|
|
1908
1936
|
leftArea.appendChild(this.brandLabel);
|
|
1909
1937
|
header.appendChild(leftArea);
|
|
1910
|
-
// Step indicator
|
|
1938
|
+
// Step indicator: stage dots + label
|
|
1939
|
+
const stepIndicator = document.createElement("div");
|
|
1940
|
+
stepIndicator.style.cssText = `
|
|
1941
|
+
display:flex;align-items:center;gap:8px;flex-shrink:0;
|
|
1942
|
+
`;
|
|
1943
|
+
this.stageDots = document.createElement("div");
|
|
1944
|
+
this.stageDots.style.cssText = `display:flex;align-items:center;gap:4px;`;
|
|
1945
|
+
for (let i = 0; i < 2; i++) {
|
|
1946
|
+
const dot = document.createElement("span");
|
|
1947
|
+
dot.style.cssText = `
|
|
1948
|
+
width:6px;height:6px;border-radius:50%;
|
|
1949
|
+
background:${this.theme.border};transition:background 0.2s ease;
|
|
1950
|
+
`;
|
|
1951
|
+
this.stageDots.appendChild(dot);
|
|
1952
|
+
}
|
|
1953
|
+
stepIndicator.appendChild(this.stageDots);
|
|
1911
1954
|
this.stepLabel = document.createElement("div");
|
|
1912
1955
|
this.stepLabel.setAttribute("aria-live", "polite");
|
|
1913
1956
|
this.stepLabel.setAttribute("aria-atomic", "true");
|
|
@@ -1915,7 +1958,8 @@ export class SmartComplyFlow {
|
|
|
1915
1958
|
font-size:12px;color:${this.theme.textMuted};
|
|
1916
1959
|
font-variant-numeric:tabular-nums;flex-shrink:0;
|
|
1917
1960
|
`;
|
|
1918
|
-
|
|
1961
|
+
stepIndicator.appendChild(this.stepLabel);
|
|
1962
|
+
header.appendChild(stepIndicator);
|
|
1919
1963
|
// Close button
|
|
1920
1964
|
const closeBtn = document.createElement("button");
|
|
1921
1965
|
closeBtn.innerHTML = "✕";
|
|
@@ -2096,6 +2140,19 @@ export class SmartComplyFlow {
|
|
|
2096
2140
|
this.stepLabel.textContent = "";
|
|
2097
2141
|
}
|
|
2098
2142
|
}
|
|
2143
|
+
// W3: Stage dots — dot 1 lights once Stage 1 is reached, dot 2 once Stage 2 is reached
|
|
2144
|
+
if (this.stageDots) {
|
|
2145
|
+
const dots = Array.from(this.stageDots.children);
|
|
2146
|
+
const inStage1 = stage1Steps.includes(this.currentStep);
|
|
2147
|
+
const inStage2 = stage2Steps.includes(this.currentStep);
|
|
2148
|
+
const isComplete = this.currentStep === "done" || this.currentStep === "result";
|
|
2149
|
+
const stage1Active = inStage1 || inStage2 || isComplete;
|
|
2150
|
+
const stage2Active = inStage2 || isComplete;
|
|
2151
|
+
if (dots[0])
|
|
2152
|
+
dots[0].style.background = stage1Active ? this.theme.primary : this.theme.border;
|
|
2153
|
+
if (dots[1])
|
|
2154
|
+
dots[1].style.background = stage2Active ? this.theme.primary : this.theme.border;
|
|
2155
|
+
}
|
|
2099
2156
|
// Back button — show for navigable steps only
|
|
2100
2157
|
if (this.headerBackBtn) {
|
|
2101
2158
|
const backTargets = {
|