smartcomply-web-sdk 1.0.97 → 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.
Files changed (37) hide show
  1. package/dist/client/Smartcomply.d.ts +1 -1
  2. package/dist/client/Smartcomply.js +1 -1
  3. package/dist/esm/client/Smartcomply.d.ts +1 -1
  4. package/dist/esm/client/Smartcomply.js +1 -1
  5. package/dist/esm/flow/DocumentCapture.d.ts +7 -0
  6. package/dist/esm/flow/DocumentCapture.d.ts.map +1 -1
  7. package/dist/esm/flow/DocumentCapture.js +77 -10
  8. package/dist/esm/flow/DocumentCapture.js.map +1 -1
  9. package/dist/esm/flow/SmartComplyFlow.d.ts +4 -3
  10. package/dist/esm/flow/SmartComplyFlow.d.ts.map +1 -1
  11. package/dist/esm/flow/SmartComplyFlow.js +33 -7
  12. package/dist/esm/flow/SmartComplyFlow.js.map +1 -1
  13. package/dist/esm/modules/liveness/liveness.d.ts.map +1 -1
  14. package/dist/esm/modules/liveness/liveness.js +6 -5
  15. package/dist/esm/modules/liveness/liveness.js.map +1 -1
  16. package/dist/esm/utils/documentFiles.d.ts +19 -0
  17. package/dist/esm/utils/documentFiles.d.ts.map +1 -0
  18. package/dist/esm/utils/documentFiles.js +31 -0
  19. package/dist/esm/utils/documentFiles.js.map +1 -0
  20. package/dist/flow/DocumentCapture.d.ts +7 -0
  21. package/dist/flow/DocumentCapture.d.ts.map +1 -1
  22. package/dist/flow/DocumentCapture.js +77 -10
  23. package/dist/flow/DocumentCapture.js.map +1 -1
  24. package/dist/flow/SmartComplyFlow.d.ts +4 -3
  25. package/dist/flow/SmartComplyFlow.d.ts.map +1 -1
  26. package/dist/flow/SmartComplyFlow.js +33 -7
  27. package/dist/flow/SmartComplyFlow.js.map +1 -1
  28. package/dist/modules/liveness/liveness.d.ts.map +1 -1
  29. package/dist/modules/liveness/liveness.js +6 -5
  30. package/dist/modules/liveness/liveness.js.map +1 -1
  31. package/dist/smartcomply.browser.js +129 -21
  32. package/dist/smartcomply.browser.js.map +3 -3
  33. package/dist/utils/documentFiles.d.ts +19 -0
  34. package/dist/utils/documentFiles.d.ts.map +1 -0
  35. package/dist/utils/documentFiles.js +38 -0
  36. package/dist/utils/documentFiles.js.map +1 -0
  37. package/package.json +2 -2
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Document files the widget can upload: a JPEG or PNG photo, or a PDF. The
3
+ * backend's LivenessEntry serializer accepts the same three for `document`
4
+ * and `document_back` (single-page PDFs), and the OCR provider reads PDFs.
5
+ */
6
+ export declare const PDF_MIME = "application/pdf";
7
+ /** What the file picker shows: photos and PDFs, nothing else. */
8
+ export declare const DOCUMENT_UPLOAD_ACCEPT = "image/jpeg,image/png,application/pdf,.pdf";
9
+ export declare function isPdf(file: Blob): boolean;
10
+ export declare function isAllowedDocumentType(file: Blob): boolean;
11
+ /**
12
+ * Some systems report a PDF with an empty type. Upload sends file.type as the
13
+ * part's content type and the backend checks it, so give such a file the PDF
14
+ * type from its .pdf name.
15
+ */
16
+ export declare function withDocumentType(file: File): File;
17
+ /** Upload file name with the extension that matches what's inside. */
18
+ export declare function documentFileName(file: Blob, base: string): string;
19
+ //# sourceMappingURL=documentFiles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"documentFiles.d.ts","sourceRoot":"","sources":["../../src/utils/documentFiles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,QAAQ,oBAAoB,CAAC;AAI1C,iEAAiE;AACjE,eAAO,MAAM,sBAAsB,8CAA8C,CAAC;AAElF,wBAAgB,KAAK,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAEzC;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAEzD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAKjD;AAED,sEAAsE;AACtE,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjE"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DOCUMENT_UPLOAD_ACCEPT = exports.PDF_MIME = void 0;
4
+ exports.isPdf = isPdf;
5
+ exports.isAllowedDocumentType = isAllowedDocumentType;
6
+ exports.withDocumentType = withDocumentType;
7
+ exports.documentFileName = documentFileName;
8
+ /**
9
+ * Document files the widget can upload: a JPEG or PNG photo, or a PDF. The
10
+ * backend's LivenessEntry serializer accepts the same three for `document`
11
+ * and `document_back` (single-page PDFs), and the OCR provider reads PDFs.
12
+ */
13
+ exports.PDF_MIME = "application/pdf";
14
+ const ALLOWED_DOCUMENT_TYPES = ["image/jpeg", "image/jpg", "image/png", exports.PDF_MIME];
15
+ /** What the file picker shows: photos and PDFs, nothing else. */
16
+ exports.DOCUMENT_UPLOAD_ACCEPT = "image/jpeg,image/png,application/pdf,.pdf";
17
+ function isPdf(file) {
18
+ return file.type === exports.PDF_MIME;
19
+ }
20
+ function isAllowedDocumentType(file) {
21
+ return ALLOWED_DOCUMENT_TYPES.includes(file.type);
22
+ }
23
+ /**
24
+ * Some systems report a PDF with an empty type. Upload sends file.type as the
25
+ * part's content type and the backend checks it, so give such a file the PDF
26
+ * type from its .pdf name.
27
+ */
28
+ function withDocumentType(file) {
29
+ if (!file.type && /\.pdf$/i.test(file.name)) {
30
+ return new File([file], file.name, { type: exports.PDF_MIME });
31
+ }
32
+ return file;
33
+ }
34
+ /** Upload file name with the extension that matches what's inside. */
35
+ function documentFileName(file, base) {
36
+ return `${base}.${isPdf(file) ? "pdf" : "jpg"}`;
37
+ }
38
+ //# sourceMappingURL=documentFiles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"documentFiles.js","sourceRoot":"","sources":["../../src/utils/documentFiles.ts"],"names":[],"mappings":";;;AAYA,sBAEC;AAED,sDAEC;AAOD,4CAKC;AAGD,4CAEC;AAnCD;;;;GAIG;AACU,QAAA,QAAQ,GAAG,iBAAiB,CAAC;AAE1C,MAAM,sBAAsB,GAAG,CAAC,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAQ,CAAC,CAAC;AAElF,iEAAiE;AACpD,QAAA,sBAAsB,GAAG,2CAA2C,CAAC;AAElF,SAAgB,KAAK,CAAC,IAAU;IAC9B,OAAO,IAAI,CAAC,IAAI,KAAK,gBAAQ,CAAC;AAChC,CAAC;AAED,SAAgB,qBAAqB,CAAC,IAAU;IAC9C,OAAO,sBAAsB,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACpD,CAAC;AAED;;;;GAIG;AACH,SAAgB,gBAAgB,CAAC,IAAU;IACzC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5C,OAAO,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,gBAAQ,EAAE,CAAC,CAAC;IACzD,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,sEAAsE;AACtE,SAAgB,gBAAgB,CAAC,IAAU,EAAE,IAAY;IACvD,OAAO,GAAG,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;AAClD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smartcomply-web-sdk",
3
- "version": "1.0.97",
3
+ "version": "1.0.99",
4
4
  "description": "Drop-in identity verification (KYC) widget for web apps — face liveness, NIN/BVN, document verification",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -23,7 +23,7 @@
23
23
  "build:esm": "tsc -p tsconfig.esm.json",
24
24
  "build:browser": "npx esbuild src/index.ts --bundle --format=iife --global-name=SmartComplySDK --outfile=dist/smartcomply.browser.js --target=es2020 --sourcemap --charset=utf8",
25
25
  "build:all": "npm run build && npm run build:esm && npm run build:browser",
26
- "prepublishOnly": "npm run build:all",
26
+ "prepublishOnly": "npm run build:all && node scripts/check-bundle-version.js",
27
27
  "postpublish": "node scripts/purge-jsdelivr.js",
28
28
  "typecheck": "tsc --noEmit",
29
29
  "test": "vitest run",