smartcomply-web-sdk 1.0.64 → 1.0.66
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/esm/flow/DocumentCapture.d.ts +16 -9
- package/dist/esm/flow/DocumentCapture.d.ts.map +1 -1
- package/dist/esm/flow/DocumentCapture.js +77 -121
- package/dist/esm/flow/DocumentCapture.js.map +1 -1
- package/dist/esm/flow/SmartComplyFlow.d.ts.map +1 -1
- package/dist/esm/flow/SmartComplyFlow.js +17 -5
- 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 +13 -9
- package/dist/esm/modules/liveness/liveness.js.map +1 -1
- package/dist/esm/utils/documentRules.d.ts +9 -2
- package/dist/esm/utils/documentRules.d.ts.map +1 -1
- package/dist/esm/utils/documentRules.js +7 -2
- package/dist/esm/utils/documentRules.js.map +1 -1
- package/dist/flow/DocumentCapture.d.ts +16 -9
- package/dist/flow/DocumentCapture.d.ts.map +1 -1
- package/dist/flow/DocumentCapture.js +76 -120
- package/dist/flow/DocumentCapture.js.map +1 -1
- package/dist/flow/SmartComplyFlow.d.ts.map +1 -1
- package/dist/flow/SmartComplyFlow.js +17 -5
- package/dist/flow/SmartComplyFlow.js.map +1 -1
- package/dist/modules/liveness/liveness.d.ts.map +1 -1
- package/dist/modules/liveness/liveness.js +13 -9
- package/dist/modules/liveness/liveness.js.map +1 -1
- package/dist/smartcomply.browser.js +77 -223
- package/dist/smartcomply.browser.js.map +4 -4
- package/dist/utils/documentRules.d.ts +9 -2
- package/dist/utils/documentRules.d.ts.map +1 -1
- package/dist/utils/documentRules.js +7 -2
- package/dist/utils/documentRules.js.map +1 -1
- package/package.json +1 -1
|
@@ -4,8 +4,15 @@
|
|
|
4
4
|
* one place so the two can't silently diverge on which documents need a
|
|
5
5
|
* back-side photo.
|
|
6
6
|
*/
|
|
7
|
-
/**
|
|
8
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Whether a document's back side should be captured:
|
|
9
|
+
* true — required, the flow forces a back-capture step
|
|
10
|
+
* false — never offered
|
|
11
|
+
* "optional" — offered, but the user can skip it and proceed on front alone
|
|
12
|
+
*/
|
|
13
|
+
export type BackSideMode = boolean | "optional";
|
|
14
|
+
/** Documents where the backend OCR pipeline needs (or can use) the reverse side. */
|
|
15
|
+
export declare function requiresBackSide(documentType: string): BackSideMode;
|
|
9
16
|
/**
|
|
10
17
|
* Scale ratio for fitting an image within maxWidth x maxHeight, never
|
|
11
18
|
* upscaling. Shared by DocumentCapture's canvas sizing and compressImage so
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documentRules.d.ts","sourceRoot":"","sources":["../../src/utils/documentRules.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,
|
|
1
|
+
{"version":3,"file":"documentRules.d.ts","sourceRoot":"","sources":["../../src/utils/documentRules.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,UAAU,CAAC;AAEhD,oFAAoF;AACpF,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,YAAY,CAenE;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,GAChB,MAAM,CAER"}
|
|
@@ -8,9 +8,15 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.requiresBackSide = requiresBackSide;
|
|
10
10
|
exports.computeScaleRatio = computeScaleRatio;
|
|
11
|
-
/** Documents where the backend OCR pipeline needs the reverse side. */
|
|
11
|
+
/** Documents where the backend OCR pipeline needs (or can use) the reverse side. */
|
|
12
12
|
function requiresBackSide(documentType) {
|
|
13
13
|
const type = documentType.toLowerCase();
|
|
14
|
+
if (type.includes("nin")) {
|
|
15
|
+
// The physical NIN card is two-sided, but not every printed card in
|
|
16
|
+
// circulation carries meaningful back-side content — offer the step
|
|
17
|
+
// instead of forcing it.
|
|
18
|
+
return "optional";
|
|
19
|
+
}
|
|
14
20
|
return type.includes("voter") ||
|
|
15
21
|
type.includes("driver") ||
|
|
16
22
|
type.includes("license") ||
|
|
@@ -18,7 +24,6 @@ function requiresBackSide(documentType) {
|
|
|
18
24
|
type.includes("national id card") ||
|
|
19
25
|
type.includes("ghana");
|
|
20
26
|
// Passport: back side is the machine-readable zone but OCR reads from front only.
|
|
21
|
-
// NIN / NIN with face: front only needed — the NIN card is single-sided for OCR.
|
|
22
27
|
}
|
|
23
28
|
/**
|
|
24
29
|
* Scale ratio for fitting an image within maxWidth x maxHeight, never
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documentRules.js","sourceRoot":"","sources":["../../src/utils/documentRules.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;
|
|
1
|
+
{"version":3,"file":"documentRules.js","sourceRoot":"","sources":["../../src/utils/documentRules.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAWH,4CAeC;AAOD,8CAOC;AA9BD,oFAAoF;AACpF,SAAgB,gBAAgB,CAAC,YAAoB;IACnD,MAAM,IAAI,GAAG,YAAY,CAAC,WAAW,EAAE,CAAC;IACxC,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,oEAAoE;QACpE,oEAAoE;QACpE,yBAAyB;QACzB,OAAO,UAAU,CAAC;IACpB,CAAC;IACD,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC;QACtB,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;QACvB,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;QACxB,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC;QAC5B,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC;QACjC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC9B,kFAAkF;AACpF,CAAC;AAED;;;;GAIG;AACH,SAAgB,iBAAiB,CAC/B,QAAgB,EAChB,SAAiB,EACjB,QAAgB,EAChB,SAAiB;IAEjB,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,GAAG,QAAQ,EAAE,SAAS,GAAG,SAAS,EAAE,CAAC,CAAC,CAAC;AACjE,CAAC"}
|
package/package.json
CHANGED