@scandit/web-datacapture-parser 8.5.2 → 8.6.0-beta.1
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/build/js/{Parser-B40VkgNk.d.ts → Parser-C4WgdnHj.d.ts} +3 -4
- package/build/js/{ParserDataFormat-Cvg4icRY.d.ts → ParserDataFormat-D4r2R0TO.d.ts} +2 -1
- package/build/js/{ParserInterfaceProxy-BpWEpVNc.js → ParserInterfaceProxy-BQGxG0Fb.js} +1 -1
- package/build/js/ParserLoader-QVNobJ8p.js +1 -0
- package/build/js/{ParserSettings-DQLtovTC.d.ts → ParserSettings-DEgQrDes.d.ts} +1 -2
- package/build/js/global.d.ts +5 -3
- package/build/js/index.d.ts +4 -3
- package/build/js/moduleLoader.d.ts +0 -1
- package/build/js/moduleLoader.js +1 -1
- package/build/js/parser/ParsedData.d.ts +1 -1
- package/build/js/parser/Parser.d.ts +1 -1
- package/build/js/parser/Parser.js +1 -1
- package/build/js/parser/ParserDataFormat.d.ts +1 -1
- package/build/js/parser/ParserDataFormat.js +1 -1
- package/build/js/parser/index.d.ts +3 -3
- package/build/js/parser/private/ParserInterfaceProxy.d.ts +1 -2
- package/build/js/parser/private/ParserInterfaceProxy.js +1 -1
- package/build/js/parser/private/ParserLoader.d.ts +0 -1
- package/build/js/parser/private/ParserLoader.js +1 -1
- package/build/js/parser/private/ParserSettings.d.ts +1 -1
- package/build/js/parser/private/sdcParserCommon.d.ts +1 -1
- package/build/js/parser/private/sdcParserInternal.d.ts +1 -1
- package/build/js/parser/private/sdcParserModule.d.ts +1 -1
- package/build/js/private/decorators/AbstractProxyableClass.d.ts +1 -2
- package/build/js/private/decorators/Proxyable.d.ts +0 -1
- package/build/js/{proxyableWorkerRelated-RQECsB33.d.ts → proxyableWorkerRelated-DHSTtz1c.d.ts} +2 -3
- package/build/js/{sdcParserInternal-ChHb5VwM.d.ts → sdcParserInternal-rUCac0j3.d.ts} +1 -2
- package/build/js/{sdcParserModule-CBBa2ycO.d.ts → sdcParserModule-DhnmS8Aa.d.ts} +17 -18
- package/build/js/umd/index.js +1 -0
- package/build/js/vite-env.d.ts +1 -1
- package/build/js/worker/ParserComponent.d.ts +1 -2
- package/build/js/worker/ParserComponent.js +1 -1
- package/build/js/worker/proxyableWorkerRelated.d.ts +1 -1
- package/package.json +12 -8
- package/sdc-lib/parser-worker-8.6.0-beta.1.js +1 -0
- package/sdc-lib/resources/models/aus_mdl_keypoint_detection.1b3529e0e8a3.model +0 -0
- package/sdc-lib/resources/models/barcode_classification_default.5afae5235672.model +0 -0
- package/sdc-lib/resources/models/barcode_keypoints_oned.963fc43efda2.model +0 -0
- package/sdc-lib/resources/models/barcode_keypoints_twod.90548e549497.model +0 -0
- package/sdc-lib/resources/models/barcode_label_localization_mslc_model_s.cf4be2418f6d.model +0 -0
- package/sdc-lib/resources/models/barcode_label_localization_mslc_model_smartphone.d37117f6a058.model +0 -0
- package/sdc-lib/resources/models/barcode_localization_clutter_aware.40a9ddd42447.model +0 -0
- package/sdc-lib/resources/models/barcode_localization_default.67ae150de2e5.model +0 -0
- package/sdc-lib/resources/models/barcode_localization_dpm_default.96d5335f10a1.model +0 -0
- package/sdc-lib/resources/models/barcode_localization_generic_postal_code_default.3aff51b79974.model +0 -0
- package/sdc-lib/resources/models/barcode_localization_oned_default.ca3e3afb3c45.model +0 -0
- package/sdc-lib/resources/models/barcode_localization_twod_default.62d5ab2b650d.model +0 -0
- package/sdc-lib/resources/models/id_outline_localization_model_kpts.376104335628.model +0 -0
- package/sdc-lib/resources/models/mqr_model_1.f74eb91b2d3b.model +0 -0
- package/sdc-lib/resources/models/mqr_model_2.300660c7d3db.model +0 -0
- package/sdc-lib/resources/models/mrz_line_localization.6598e20b3c9e.model +0 -0
- package/sdc-lib/resources/models/mrz_localization.07beaad40bbd.model +0 -0
- package/sdc-lib/resources/models/ocr_attention.61cf55c1930f.model +0 -0
- package/sdc-lib/resources/models/ocr_attention_big.81959e2e4ef4.model +0 -0
- package/sdc-lib/resources/models/price_localization_in_whole_label.ef6641ccf26f.model +0 -0
- package/sdc-lib/resources/models/qr_model_1.d46cc8f45676.model +0 -0
- package/sdc-lib/resources/models/via_id_template_database.948ef137372d.model +0 -0
- package/sdc-lib/scandit-datacapture-sdk-parser-pthreads.js +1 -1
- package/sdc-lib/scandit-datacapture-sdk-parser-pthreads.wasm +0 -0
- package/sdc-lib/scandit-datacapture-sdk-parser-simd-pthreads.js +1 -1
- package/sdc-lib/scandit-datacapture-sdk-parser-simd-pthreads.wasm +0 -0
- package/sdc-lib/scandit-datacapture-sdk-parser-simd.js +1 -1
- package/sdc-lib/scandit-datacapture-sdk-parser-simd.wasm +0 -0
- package/sdc-lib/scandit-datacapture-sdk-parser.js +1 -1
- package/sdc-lib/scandit-datacapture-sdk-parser.wasm +0 -0
- package/build/js/ParserLoader-AIYHONEt.js +0 -1
- package/sdc-lib/parser-worker-8.5.2.js +0 -1
- package/sdc-lib/resources/models/aus_mdl_keypoint_detection.17f1b2958a9e.model +0 -0
- package/sdc-lib/resources/models/barcode_classification_default.48685f5fe19b.model +0 -0
- package/sdc-lib/resources/models/barcode_keypoints_oned.c499e5bd6ed4.model +0 -0
- package/sdc-lib/resources/models/barcode_label_localization_mslc_model_s.616a59ec3a8d.model +0 -0
- package/sdc-lib/resources/models/barcode_label_localization_mslc_model_smartphone.29decf3dd9e6.model +0 -0
- package/sdc-lib/resources/models/barcode_localization_clutter_aware.69933853e03e.model +0 -0
- package/sdc-lib/resources/models/barcode_localization_default.59f74a846b63.model +0 -0
- package/sdc-lib/resources/models/barcode_localization_dpm_default.7e4fe5631f81.model +0 -0
- package/sdc-lib/resources/models/barcode_localization_generic_postal_code_default.184ecbeb5b83.model +0 -0
- package/sdc-lib/resources/models/barcode_localization_oned_default.c547484132c1.model +0 -0
- package/sdc-lib/resources/models/barcode_localization_twod_default.4b64523bf755.model +0 -0
- package/sdc-lib/resources/models/id_outline_localization_model_kpts.b74ff5cc58cf.model +0 -0
- package/sdc-lib/resources/models/mrz_line_localization.577844e2ebed.model +0 -0
- package/sdc-lib/resources/models/mrz_localization.77e331c44b52.model +0 -0
- package/sdc-lib/resources/models/ocr_attention.75e86b6ca0ca.model +0 -0
- package/sdc-lib/resources/models/price_localization_in_whole_label.555b33695325.model +0 -0
- package/sdc-lib/resources/models/qr_model_1.e790edc14d39.model +0 -0
- package/sdc-lib/resources/models/via_id_template_database.e54ca9420de3.model +0 -0
- /package/build/js/{ParsedData-yvvQiOan.d.ts → ParsedData-DbcKDII5.d.ts} +0 -0
- /package/build/js/{sdcParserCommon-CqRP95xP.d.ts → sdcParserCommon-tP1rojW-.d.ts} +0 -0
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { t as ParsedField } from "./ParsedData-
|
|
2
|
-
import { t as ParserDataFormat } from "./ParserDataFormat-
|
|
3
|
-
import { n as ParserSettingsJSON } from "./ParserSettings-
|
|
1
|
+
import { t as ParsedField } from "./ParsedData-DbcKDII5.js";
|
|
2
|
+
import { t as ParserDataFormat } from "./ParserDataFormat-D4r2R0TO.js";
|
|
3
|
+
import { n as ParserSettingsJSON } from "./ParserSettings-DEgQrDes.js";
|
|
4
4
|
import { DataCaptureComponent, DataCaptureComponentJSON, DataCaptureContext } from "@scandit/web-datacapture-core";
|
|
5
|
-
|
|
6
5
|
//#region src/main/parser/Parser.d.ts
|
|
7
6
|
interface ParserJSON extends DataCaptureComponentJSON {
|
|
8
7
|
type: "parser";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./ParserLoader-
|
|
1
|
+
import{t as e}from"./ParserLoader-QVNobJ8p.js";import{AbstractProxyableClass as t}from"./private/decorators/AbstractProxyableClass.js";import{MirrorToWorkerClass as n,proxy as r}from"./private/decorators/Proxyable.js";function i(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}let a=class extends t{constructor(...e){super(...e),this.command=`djinniAction`}get worker(){return e.worker}async parseStringToJson(e){return{}}async setOptions(e){return!1}getId(){return`${this.dataFormat}`}async create(e){return this.dataFormat=e,``}};i([r()],a.prototype,`parseStringToJson`,null),i([r({argumentsSerializer:e=>[JSON.stringify(e[0])]})],a.prototype,`setOptions`,null),i([r()],a.prototype,`create`,null),a=i([n(`ParserInterface`)],a);export{a as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{WorkersRegistry as e}from"./parser/private/WorkersRegistry.js";import{Deferred as t}from"@scandit/web-datacapture-core/build/js/private/utils/deferred.js";var n=`parser-worker-8.6.0-beta.1.js`;function r(e){try{var t=e.endsWith(`/`)?e:e+`/`;return new URL(n,t).href}catch(t){var r=t instanceof Error?t.message:String(t);throw Error(`Invalid worker URL: `+e+`/`+n+` (`+r+`)`)}}function i(e){try{return new URL(e).origin===location.origin}catch(n){var t=n instanceof Error?n.message:String(n);return console.warn(`Could not determine origin for worker URL "`+e+`": `+t+`. Defaulting to cross-origin path.`),!1}}function a(e,t){/javascript|ecmascript/i.test(e.type)||(e=new Blob([e],{type:`application/javascript`}));var n=URL.createObjectURL(e),r=new Worker(n,{name:t});return setTimeout(function(){URL.revokeObjectURL(n)},0),r}async function o(e){if(!e||!e.libraryLocation)throw Error(`ExternalWorker requires options.libraryLocation`);var t=r(e.libraryLocation);try{var n=await fetch(t,i(t)?{}:{mode:`cors`});if(!n.ok)throw Error(`Failed to load worker script: `+t+` (status `+n.status+`)`);var o=await n.blob();return i(t)?new Worker(t,{name:e.name}):a(o,e.name)}catch(e){throw e instanceof Error&&e.message.startsWith(`Failed to load worker script:`)?e:Error(`Failed to load worker script: `+t+` (`+(e instanceof Error?e.message:e)+`)`)}}var s=class n{constructor(e){this.moduleName=`Parser`,this.id=0,this.loadingOptions=e}static get worker(){return e.get(`ParserWorker`)}static async create(t){if(!e.has(`ParserWorker`)){let n=await o({name:`ParserWorker`,libraryLocation:t.libraryLocation});e.set(`ParserWorker`,n)}return new n(t)}async load(){await this.sendMessage({id:this.id++,methodName:`load`,className:`ParserLoader`,args:[{libraryLocation:this.loadingOptions.libraryLocation,simdSupport:this.loadingOptions.simdSupport,threadsSupport:this.loadingOptions.threadsSupport,verifyResponseHash:this.loadingOptions.verifyResponseHash,referredOrigin:this.loadingOptions.referredOrigin??``}]})}async setLogLevel(e){await this.sendMessage({id:this.id++,methodName:`setLogLevel`,className:`ParserLoader`,args:[e]})}async sendMessage(e){let r=new t,i=t=>{let{data:a}=t;e.id===a.payload.id&&(a.payload.result.type===`result`?r.resolve(a.payload.result.result):r.reject(a.payload.result.error),n.worker.removeEventListener(`message`,i))};return n.worker.addEventListener(`message`,i),n.worker.postMessage(e),r.promise}};export{s as t};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { t as ParserDataFormat } from "./ParserDataFormat-
|
|
1
|
+
import { t as ParserDataFormat } from "./ParserDataFormat-D4r2R0TO.js";
|
|
2
2
|
import { JSONType } from "@scandit/web-datacapture-core";
|
|
3
3
|
import { Serializable } from "@scandit/web-datacapture-core/build/js/private/Serializable";
|
|
4
|
-
|
|
5
4
|
//#region src/main/parser/private/ParserSettings.d.ts
|
|
6
5
|
interface ParserSettingsJSON extends JSONType {
|
|
7
6
|
dataFormat: ParserDataFormat;
|
package/build/js/global.d.ts
CHANGED
|
@@ -12,11 +12,13 @@ declare global {
|
|
|
12
12
|
var SDC_WASM_CORE_MT_HASH: string;
|
|
13
13
|
var SDC_WASM_CORE_MT_SIMD_HASH: string;
|
|
14
14
|
var SDC_WASM_SIDE_MODULE_FILE_NAME: string;
|
|
15
|
-
var SDC_WASM_JS_VERSION: string;
|
|
15
|
+
var SDC_WASM_JS_VERSION: string;
|
|
16
|
+
// PARSER FILES
|
|
16
17
|
var SDC_WASM_PARSER_FILE_NAME: string;
|
|
17
18
|
var SDC_WASM_PARSER_SIMD_FILE_NAME: string;
|
|
18
19
|
var SDC_WASM_PARSER_MT_FILE_NAME: string;
|
|
19
|
-
var SDC_WASM_PARSER_MT_SIMD_FILE_NAME: string;
|
|
20
|
+
var SDC_WASM_PARSER_MT_SIMD_FILE_NAME: string;
|
|
21
|
+
// PARSER FILES HASHES
|
|
20
22
|
var SDC_WASM_PARSER_HASH: string;
|
|
21
23
|
var SDC_WASM_PARSER_SIMD_HASH: string;
|
|
22
24
|
var SDC_WASM_PARSER_MT_HASH: string;
|
|
@@ -31,4 +33,4 @@ declare global {
|
|
|
31
33
|
webkitVibrate?: Navigator["vibrate"];
|
|
32
34
|
enumerateDevices?: () => Promise<MediaDeviceInfo[]>;
|
|
33
35
|
}
|
|
34
|
-
}
|
|
36
|
+
}
|
package/build/js/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ParserLoaderOptions, parserLoader } from "./moduleLoader.js";
|
|
2
|
-
import { n as ParserIssue, r as ParserIssueCode, t as ParsedField } from "./ParsedData-
|
|
3
|
-
import { t as ParserDataFormat } from "./ParserDataFormat-
|
|
4
|
-
import { n as ParserJSON, t as Parser } from "./Parser-
|
|
2
|
+
import { n as ParserIssue, r as ParserIssueCode, t as ParsedField } from "./ParsedData-DbcKDII5.js";
|
|
3
|
+
import { t as ParserDataFormat } from "./ParserDataFormat-D4r2R0TO.js";
|
|
4
|
+
import { n as ParserJSON, t as Parser } from "./Parser-C4WgdnHj.js";
|
|
5
|
+
import "./parser/index.js";
|
|
5
6
|
export { ParsedField, Parser, ParserDataFormat, ParserIssue, ParserIssueCode, ParserJSON, ParserLoaderOptions, parserLoader };
|
package/build/js/moduleLoader.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./ParserLoader-
|
|
1
|
+
import{t as e}from"./ParserLoader-QVNobJ8p.js";import{Logger as t}from"@scandit/web-datacapture-core";import{normalizeLibraryLocation as n}from"@scandit/web-datacapture-core/build/js/private/Helper.js";function r(r){return r!=null&&r.libraryLocation&&(r.libraryLocation=n(r.libraryLocation)),{moduleName:`Parser`,load:async n=>{let i=n,a=await e.create({libraryLocation:(r==null?void 0:r.libraryLocation)??i.libraryLocation,simdSupport:i.simdSupport,threadsSupport:i.threadsSupport,verifyResponseHash:!0,referredOrigin:globalThis.location.origin});await a.setLogLevel(n.logLevel??t.Level.Debug),await a.load()}}}export{r as parserLoader};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as ParserIssue, r as ParserIssueCode, t as ParsedField } from "../ParsedData-
|
|
1
|
+
import { n as ParserIssue, r as ParserIssueCode, t as ParsedField } from "../ParsedData-DbcKDII5.js";
|
|
2
2
|
export { ParsedField, ParserIssue, ParserIssueCode };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as ParserJSON, t as Parser } from "../Parser-
|
|
1
|
+
import { n as ParserJSON, t as Parser } from "../Parser-C4WgdnHj.js";
|
|
2
2
|
export { Parser, ParserJSON };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"../ParserInterfaceProxy-
|
|
1
|
+
import{t as e}from"../ParserInterfaceProxy-BQGxG0Fb.js";import{ParserSettings as t}from"./private/ParserSettings.js";import{LicensedFeature as n}from"@scandit/web-datacapture-core/build/js/worker/index.js";var r=class r{constructor(e){this.type=`parser`,this.settings=new t,this.settings.dataFormat=e}get id(){return`${this.settings.dataFormat}`}static async forFormat(t,i){let a=t,o=new r(i);if(o.parserProxy=new e,!await a.isFeatureSupported(n.Parser))throw Error(`Parser not supported by the current license`);return await o.parserProxy.create(i),o}async parseStringToJson(e){return this.parserProxy.parseStringToJson(e)}async setOptions(e){return this.parserProxy.setOptions(e)}toJSONObject(){return{type:this.type,settings:this.settings.toJSONObject()}}};export{r as Parser};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as ParserDataFormat } from "../ParserDataFormat-
|
|
1
|
+
import { t as ParserDataFormat } from "../ParserDataFormat-D4r2R0TO.js";
|
|
2
2
|
export { ParserDataFormat };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
let e=function(e){return e[e.GS1_AI=0]=`GS1_AI`,e[e.HIBC=1]=`HIBC`,e[e.SWISS_QR=4]=`SWISS_QR`,e[e.VIN=5]=`VIN`,e[e.IATA_BCBP=7]=`IATA_BCBP`,e[e.GS1_DIGITAL_LINK=8]=`GS1_DIGITAL_LINK`,e[e.EPC=9]=`EPC`,e}({});export{e as ParserDataFormat};
|
|
1
|
+
let e=function(e){return e[e.GS1_AI=0]=`GS1_AI`,e[e.HIBC=1]=`HIBC`,e[e.SWISS_QR=4]=`SWISS_QR`,e[e.VIN=5]=`VIN`,e[e.IATA_BCBP=7]=`IATA_BCBP`,e[e.GS1_DIGITAL_LINK=8]=`GS1_DIGITAL_LINK`,e[e.EPC=9]=`EPC`,e[e.FRENCH_2D_DOC=10]=`FRENCH_2D_DOC`,e}({});export{e as ParserDataFormat};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as ParserIssue, r as ParserIssueCode, t as ParsedField } from "../ParsedData-
|
|
2
|
-
import { t as ParserDataFormat } from "../ParserDataFormat-
|
|
3
|
-
import { n as ParserJSON, t as Parser } from "../Parser-
|
|
1
|
+
import { n as ParserIssue, r as ParserIssueCode, t as ParsedField } from "../ParsedData-DbcKDII5.js";
|
|
2
|
+
import { t as ParserDataFormat } from "../ParserDataFormat-D4r2R0TO.js";
|
|
3
|
+
import { n as ParserJSON, t as Parser } from "../Parser-C4WgdnHj.js";
|
|
4
4
|
export { ParsedField, Parser, ParserDataFormat, ParserIssue, ParserIssueCode, ParserJSON };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { t as ParsedField } from "../../ParsedData-
|
|
1
|
+
import { t as ParsedField } from "../../ParsedData-DbcKDII5.js";
|
|
2
2
|
import { AbstractProxyableClass } from "../../private/decorators/AbstractProxyableClass.js";
|
|
3
|
-
|
|
4
3
|
//#region src/main/parser/private/ParserInterfaceProxy.d.ts
|
|
5
4
|
declare class ParserInterfaceProxy extends AbstractProxyableClass {
|
|
6
5
|
readonly command: `djinniAction`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"../../ParserInterfaceProxy-
|
|
1
|
+
import{t as e}from"../../ParserInterfaceProxy-BQGxG0Fb.js";export{e as ParserInterfaceProxy};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"../../ParserLoader-
|
|
1
|
+
import{t as e}from"../../ParserLoader-QVNobJ8p.js";export{e as ParserLoader};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as ParserSettingsJSON, t as ParserSettings } from "../../ParserSettings-
|
|
1
|
+
import { n as ParserSettingsJSON, t as ParserSettings } from "../../ParserSettings-DEgQrDes.js";
|
|
2
2
|
export { ParserSettings, ParserSettingsJSON };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as SdcParserCommon_statics, t as ParserIssueAdditionalInfoKeyDjinni } from "../../sdcParserCommon-
|
|
1
|
+
import { n as SdcParserCommon_statics, t as ParserIssueAdditionalInfoKeyDjinni } from "../../sdcParserCommon-tP1rojW-.js";
|
|
2
2
|
export { ParserIssueAdditionalInfoKeyDjinni, SdcParserCommon_statics };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as SdcParserInternal_statics, i as ParserIssueRecord, n as ParsedFieldInterface, r as ParserIssueInterface, t as ParsedDataInterface } from "../../sdcParserInternal-
|
|
1
|
+
import { a as SdcParserInternal_statics, i as ParserIssueRecord, n as ParsedFieldInterface, r as ParserIssueInterface, t as ParsedDataInterface } from "../../sdcParserInternal-rUCac0j3.js";
|
|
2
2
|
export { ParsedDataInterface, ParsedFieldInterface, ParserIssueInterface, ParserIssueRecord, SdcParserInternal_statics };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as ParserInterface_statics, r as SdcParserModule_statics, t as ParserInterface } from "../../sdcParserModule-
|
|
1
|
+
import { n as ParserInterface_statics, r as SdcParserModule_statics, t as ParserInterface } from "../../sdcParserModule-DhnmS8Aa.js";
|
|
2
2
|
export { ParserInterface, ParserInterface_statics, SdcParserModule_statics };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { p as ProxyableActionMessage } from "../../proxyableWorkerRelated-
|
|
2
|
-
|
|
1
|
+
import { p as ProxyableActionMessage } from "../../proxyableWorkerRelated-DHSTtz1c.js";
|
|
3
2
|
//#region src/main/private/decorators/AbstractProxyableClass.d.ts
|
|
4
3
|
declare abstract class AbstractProxyableClass<ActionMessage extends ProxyableActionMessage = ProxyableActionMessage> {
|
|
5
4
|
abstract command: ActionMessage["command"];
|
package/build/js/{proxyableWorkerRelated-RQECsB33.d.ts → proxyableWorkerRelated-DHSTtz1c.d.ts}
RENAMED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/// <reference types="emscripten" />
|
|
2
|
-
import { i as ResultOrError, n as ParserInterface_statics, t as ParserInterface } from "./sdcParserModule-
|
|
2
|
+
import { i as ResultOrError, n as ParserInterface_statics, t as ParserInterface } from "./sdcParserModule-DhnmS8Aa.js";
|
|
3
3
|
import { Logger } from "@scandit/web-datacapture-core";
|
|
4
|
-
|
|
5
4
|
//#region src/main/worker/proxyableWorkerRelated.d.ts
|
|
6
5
|
type ValuesOf<T> = T[keyof T];
|
|
7
6
|
type Djinni = "djinni";
|
|
@@ -17,7 +16,7 @@ type ClassInfo<T> = { [K in keyof T]: T[K] extends ((...arguments_: any[]) => an
|
|
|
17
16
|
} ? ClassName : never;
|
|
18
17
|
args: Parameters<T[K]>;
|
|
19
18
|
result: ReturnType<T[K]>;
|
|
20
|
-
} : never };
|
|
19
|
+
} : never; };
|
|
21
20
|
interface BaseAction {
|
|
22
21
|
id: number;
|
|
23
22
|
instanceId?: string;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { t as ParserIssueAdditionalInfoKeyDjinni } from "./sdcParserCommon-
|
|
2
|
-
|
|
1
|
+
import { t as ParserIssueAdditionalInfoKeyDjinni } from "./sdcParserCommon-tP1rojW-.js";
|
|
3
2
|
//#region src/main/parser/private/sdcParserInternal.d.ts
|
|
4
3
|
interface ParsedFieldInterface {
|
|
5
4
|
getName(): string;
|
|
@@ -1,24 +1,23 @@
|
|
|
1
|
-
import { t as ParserDataFormat } from "./ParserDataFormat-
|
|
2
|
-
import { r as ParserIssueInterface, t as ParsedDataInterface } from "./sdcParserInternal-
|
|
1
|
+
import { t as ParserDataFormat } from "./ParserDataFormat-D4r2R0TO.js";
|
|
2
|
+
import { r as ParserIssueInterface, t as ParsedDataInterface } from "./sdcParserInternal-rUCac0j3.js";
|
|
3
3
|
import { DataCaptureComponent } from "@scandit/web-datacapture-core";
|
|
4
|
-
|
|
5
4
|
//#region ../../../../external_non_restricted/djinni-extension-lib/ts/ResultOrError.d.ts
|
|
6
5
|
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
6
|
+
* Copyright 2021 Snap, Inc.
|
|
7
|
+
* Copyright 2024 Scandit AG
|
|
8
|
+
*
|
|
9
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
+
* you may not use this file except in compliance with the License.
|
|
11
|
+
* You may obtain a copy of the License at
|
|
12
|
+
*
|
|
13
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
*
|
|
15
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
16
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
+
* See the License for the specific language governing permissions and
|
|
19
|
+
* limitations under the License.
|
|
20
|
+
*/
|
|
22
21
|
interface ResultOutcome<T> {
|
|
23
22
|
type: "result";
|
|
24
23
|
result: T;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@scandit/web-datacapture-core"),require("@scandit/web-datacapture-core/build/js/private/Helper.js"),require("@scandit/web-datacapture-core/build/js/private/utils/deferred.js"),require("@scandit/web-datacapture-core/build/js/worker/index.js")):typeof define==`function`&&define.amd?define([`exports`,`@scandit/web-datacapture-core`,`@scandit/web-datacapture-core/build/js/private/Helper.js`,`@scandit/web-datacapture-core/build/js/private/utils/deferred.js`,`@scandit/web-datacapture-core/build/js/worker/index.js`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.SDCParser={},e.SDCCore,e.SDCCore.Internal.private_Helper,e.SDCCore.Internal.private_utils_deferred,e.SDCCore.Internal.worker_index))})(this,function(e,t,n,r,i){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var a=`parser-worker-8.6.0-beta.1.js`;function o(e){try{var t=e.endsWith(`/`)?e:e+`/`;return new URL(a,t).href}catch(t){var n=t instanceof Error?t.message:String(t);throw Error(`Invalid worker URL: `+e+`/`+a+` (`+n+`)`)}}function s(e){try{return new URL(e).origin===location.origin}catch(n){var t=n instanceof Error?n.message:String(n);return console.warn(`Could not determine origin for worker URL "`+e+`": `+t+`. Defaulting to cross-origin path.`),!1}}function c(e,t){/javascript|ecmascript/i.test(e.type)||(e=new Blob([e],{type:`application/javascript`}));var n=URL.createObjectURL(e),r=new Worker(n,{name:t});return setTimeout(function(){URL.revokeObjectURL(n)},0),r}async function l(e){if(!e||!e.libraryLocation)throw Error(`ExternalWorker requires options.libraryLocation`);var t=o(e.libraryLocation);try{var n=await fetch(t,s(t)?{}:{mode:`cors`});if(!n.ok)throw Error(`Failed to load worker script: `+t+` (status `+n.status+`)`);var r=await n.blob();return s(t)?new Worker(t,{name:e.name}):c(r,e.name)}catch(e){throw e instanceof Error&&e.message.startsWith(`Failed to load worker script:`)?e:Error(`Failed to load worker script: `+t+` (`+(e instanceof Error?e.message:e)+`)`)}}let u=new Map;var d=class e{constructor(e){this.moduleName=`Parser`,this.id=0,this.loadingOptions=e}static get worker(){return u.get(`ParserWorker`)}static async create(t){if(!u.has(`ParserWorker`)){let e=await l({name:`ParserWorker`,libraryLocation:t.libraryLocation});u.set(`ParserWorker`,e)}return new e(t)}async load(){await this.sendMessage({id:this.id++,methodName:`load`,className:`ParserLoader`,args:[{libraryLocation:this.loadingOptions.libraryLocation,simdSupport:this.loadingOptions.simdSupport,threadsSupport:this.loadingOptions.threadsSupport,verifyResponseHash:this.loadingOptions.verifyResponseHash,referredOrigin:this.loadingOptions.referredOrigin??``}]})}async setLogLevel(e){await this.sendMessage({id:this.id++,methodName:`setLogLevel`,className:`ParserLoader`,args:[e]})}async sendMessage(t){let n=new r.Deferred,i=r=>{let{data:a}=r;t.id===a.payload.id&&(a.payload.result.type===`result`?n.resolve(a.payload.result.result):n.reject(a.payload.result.error),e.worker.removeEventListener(`message`,i))};return e.worker.addEventListener(`message`,i),e.worker.postMessage(t),n.promise}};function f(e){return e!=null&&e.libraryLocation&&(e.libraryLocation=(0,n.normalizeLibraryLocation)(e.libraryLocation)),{moduleName:`Parser`,load:async n=>{let r=n,i=await d.create({libraryLocation:(e==null?void 0:e.libraryLocation)??r.libraryLocation,simdSupport:r.simdSupport,threadsSupport:r.threadsSupport,verifyResponseHash:!0,referredOrigin:globalThis.location.origin});await i.setLogLevel(n.logLevel??t.Logger.Level.Debug),await i.load()}}}let p=function(e){return e[e.NONE=0]=`NONE`,e[e.UNSPECIFIED=2]=`UNSPECIFIED`,e[e.MANDATORY_EPD_MISSING=1e3]=`MANDATORY_EPD_MISSING`,e[e.INVALID_DATE=1001]=`INVALID_DATE`,e[e.STRING_TOO_SHORT=1002]=`STRING_TOO_SHORT`,e[e.WRONG_STARTING_CHARACTERS=1003]=`WRONG_STARTING_CHARACTERS`,e[e.INVALID_SEPARATION_BETWEEN_ELEMENTS=1004]=`INVALID_SEPARATION_BETWEEN_ELEMENTS`,e[e.UNSUPPORTED_VERSION=1005]=`UNSUPPORTED_VERSION`,e[e.INCOMPLETE_CODE=1006]=`INCOMPLETE_CODE`,e[e.EMPTY_ELEMENT_CONTENT=1007]=`EMPTY_ELEMENT_CONTENT`,e[e.INVALID_ELEMENT_LENGTH=1008]=`INVALID_ELEMENT_LENGTH`,e[e.TOO_LONG_ELEMENT=1009]=`TOO_LONG_ELEMENT`,e[e.NON_EMPTY_ELEMENT_CONTENT=1010]=`NON_EMPTY_ELEMENT_CONTENT`,e[e.INVALID_CHARSET_IN_ELEMENT=1011]=`INVALID_CHARSET_IN_ELEMENT`,e[e.TOO_MANY_ALT_PMT_FIELDS=1012]=`TOO_MANY_ALT_PMT_FIELDS`,e[e.CANNOT_CONTAIN_SPACES=1013]=`CANNOT_CONTAIN_SPACES`,e}({});var m=class{};function h(e){return function(t,n,r){return r.value!=null&&typeof r.value==`function`&&(r.value.proxy=!0,typeof(e==null?void 0:e.argumentsSerializer)==`function`&&(r.value.argumentsSerializer=e.argumentsSerializer)),r}}function g(e,t){return Object.getOwnPropertyDescriptor(e,t)}function _(e){return function(t){let n={};for(let e of Object.getOwnPropertyNames(t.prototype))if(e!==`constructor`){let r=g(t.prototype,e);typeof(r==null?void 0:r.value)==`function`&&`proxy`in r.value&&(n[e]=r)}for(let[i,a]of Object.entries(n)){let n=0,o=a.value;a.value=async function(...t){typeof o==`function`&&o.apply(this,t);let a=t;if(typeof o.argumentsSerializer==`function`){var s;a=((s=o.argumentsSerializer)==null?void 0:s.call(this,t))??[]}let c={id:n++,command:this.command,instanceId:this.getId(),className:e,args:a,methodName:i},{promise:l,resolve:u,reject:d}=new r.Deferred,f=e=>{let{data:t}=e;c.id===t.payload.id&&(t.payload.result.type===`result`?u(t.payload.result.result):d(t.payload.result.error),this.worker.removeEventListener(`message`,f))};return this.worker.addEventListener(`message`,f),this.worker.postMessage(c),l},Object.defineProperty(t.prototype,i,a)}return t}}function v(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}let y=class extends m{constructor(...e){super(...e),this.command=`djinniAction`}get worker(){return d.worker}async parseStringToJson(e){return{}}async setOptions(e){return!1}getId(){return`${this.dataFormat}`}async create(e){return this.dataFormat=e,``}};v([h()],y.prototype,`parseStringToJson`,null),v([h({argumentsSerializer:e=>[JSON.stringify(e[0])]})],y.prototype,`setOptions`,null),v([h()],y.prototype,`create`,null),y=v([_(`ParserInterface`)],y);let b=function(e){return e[e.GS1_AI=0]=`GS1_AI`,e[e.HIBC=1]=`HIBC`,e[e.SWISS_QR=4]=`SWISS_QR`,e[e.VIN=5]=`VIN`,e[e.IATA_BCBP=7]=`IATA_BCBP`,e[e.GS1_DIGITAL_LINK=8]=`GS1_DIGITAL_LINK`,e[e.EPC=9]=`EPC`,e[e.FRENCH_2D_DOC=10]=`FRENCH_2D_DOC`,e}({});var x=class{constructor(){this.dataFormat=7}toJSONObject(){return{dataFormat:this.dataFormat}}};e.Parser=class e{constructor(e){this.type=`parser`,this.settings=new x,this.settings.dataFormat=e}get id(){return`${this.settings.dataFormat}`}static async forFormat(t,n){let r=t,a=new e(n);if(a.parserProxy=new y,!await r.isFeatureSupported(i.LicensedFeature.Parser))throw Error(`Parser not supported by the current license`);return await a.parserProxy.create(n),a}async parseStringToJson(e){return this.parserProxy.parseStringToJson(e)}async setOptions(e){return this.parserProxy.setOptions(e)}toJSONObject(){return{type:this.type,settings:this.settings.toJSONObject()}}},e.ParserDataFormat=b,e.ParserIssueCode=p,e.parserLoader=f});
|
package/build/js/vite-env.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference types="emscripten" />
|
|
2
|
-
import { c as ParserLoadAction, d as ParserSetLogLevelAction, f as ParserSetLogLevelResult, l as ParserLoadResult, o as ParserInterfaceActionMessage, s as ParserInterfaceResultMessage, t as AugmentedWorker, u as ParserModule } from "../proxyableWorkerRelated-
|
|
3
|
-
|
|
2
|
+
import { c as ParserLoadAction, d as ParserSetLogLevelAction, f as ParserSetLogLevelResult, l as ParserLoadResult, o as ParserInterfaceActionMessage, s as ParserInterfaceResultMessage, t as AugmentedWorker, u as ParserModule } from "../proxyableWorkerRelated-DHSTtz1c.js";
|
|
4
3
|
//#region src/main/worker/ParserComponent.d.ts
|
|
5
4
|
interface ModuleHandler<M extends EmscriptenModule> {
|
|
6
5
|
get: () => M;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DataCaptureError as e,DataCaptureVersion as t,Logger as n}from"@scandit/web-datacapture-core";import{getLibraryLocationURIs as r}from"@scandit/web-datacapture-core/build/js/private/Helper.js";import{Deferred as i}from"@scandit/web-datacapture-core/build/js/private/utils/deferred.js";import{isWorkerScope as a}from"@scandit/web-datacapture-core/build/js/private/utils/isWorkerScope.js";import{instantiateWebAssembly as o}from"@scandit/web-datacapture-core/build/js/worker/helper.js";import{setWasmMetadata as s}from"@scandit/web-datacapture-core/build/js/worker/helperFetch.js";import{importWasmScript as c}from"@scandit/web-datacapture-core/build/js/worker/importWasmScript.js";const l=e=>e.result!=null&&e.error==null;function u(e,t){return{type:`djinniResult`,payload:{id:e.id,className:e.className,methodName:e.methodName,instanceId:e.instanceId,result:t}}}function d(e,t){return{type:`parserLoaderResult`,payload:{id:e.id,className:e.className,methodName:e.methodName,result:t}}}var f=class{constructor(e,t){this.parsers=new Map,this.onMessageListener=this.onMessage.bind(this),this.setupPromise=null,this.workerSelf=e,this.moduleHandler=t,a(e)&&(this.workerFunctions={postMessage:this.workerSelf.postMessage.bind(this.workerSelf)},this.listenToMessages()),s({"scandit-datacapture-sdk-parser-pthreads.wasm":{bytes:
|
|
1
|
+
import{DataCaptureError as e,DataCaptureVersion as t,Logger as n}from"@scandit/web-datacapture-core";import{getLibraryLocationURIs as r}from"@scandit/web-datacapture-core/build/js/private/Helper.js";import{Deferred as i}from"@scandit/web-datacapture-core/build/js/private/utils/deferred.js";import{isWorkerScope as a}from"@scandit/web-datacapture-core/build/js/private/utils/isWorkerScope.js";import{instantiateWebAssembly as o}from"@scandit/web-datacapture-core/build/js/worker/helper.js";import{setWasmMetadata as s}from"@scandit/web-datacapture-core/build/js/worker/helperFetch.js";import{importWasmScript as c}from"@scandit/web-datacapture-core/build/js/worker/importWasmScript.js";const l=e=>e.result!=null&&e.error==null;function u(e,t){return{type:`djinniResult`,payload:{id:e.id,className:e.className,methodName:e.methodName,instanceId:e.instanceId,result:t}}}function d(e,t){return{type:`parserLoaderResult`,payload:{id:e.id,className:e.className,methodName:e.methodName,result:t}}}var f=class{constructor(e,t){this.parsers=new Map,this.onMessageListener=this.onMessage.bind(this),this.setupPromise=null,this.workerSelf=e,this.moduleHandler=t,a(e)&&(this.workerFunctions={postMessage:this.workerSelf.postMessage.bind(this.workerSelf)},this.listenToMessages()),s({"scandit-datacapture-sdk-parser-pthreads.wasm":{bytes:7479689},"scandit-datacapture-sdk-parser-simd-pthreads.wasm":{bytes:7432431},"scandit-datacapture-sdk-parser.wasm":{bytes:7531109},"scandit-datacapture-sdk-parser-simd.wasm":{bytes:7469522}})}get Module(){return this.moduleHandler.get()}setLogLevel(e){n.setLevel(e.args[0]),this.workerFunctions.postMessage(d(e,{type:`result`,result:!0}))}async load(e){try{await this.setup(e.args[0]),this.workerFunctions.postMessage(d(e,{type:`result`,result:!0}))}catch(t){this.workerFunctions.postMessage(d(e,{type:`error`,error:t}))}}listenToMessages(){this.workerSelf.addEventListener(`message`,this.onMessageListener),this.workerSelf.addEventListener(`error`,e=>{n.log(n.Level.Error,e)}),this.workerSelf.addEventListener(`messageerror`,e=>{n.log(n.Level.Error,e)})}onMessage(e){return e.data.className===`ParserLoader`&&e.data.methodName===`load`&&this.load(e.data),e.data.className===`ParserLoader`&&e.data.methodName===`setLogLevel`&&this.setLogLevel(e.data),e.data.className===`ParserInterface`&&this.performDjinniAction(e.data),!0}async performDjinniAction(e){let t;if(n.log(n.Level.Debug,`${e.className}::${e.methodName}(`,e.args,`)`),e.methodName===`create`){let r=e.args[0].toString();if(this.parsers.has(r)){this.workerFunctions.postMessage(u(e,{type:`result`,result:r}));return}t=this.createParser(e),n.log(n.Level.Debug,t),this.workerFunctions.postMessage(t);return}let r=this.parsers.get(e.instanceId??``);if(r==null){this.workerFunctions.postMessage(u(e,{type:`error`,error:`parser is not defined: try to access instance with id ${e.instanceId??``}`}));return}let i=r[e.methodName](...e.args);t=l(i)?u(e,i):u(e,{type:`error`,error:i.error}),this.workerFunctions.postMessage(t)}async setup({libraryLocation:a,threadsSupport:s,simdSupport:l,verifyResponseHash:u,referredOrigin:d}){if(this.setupPromise!=null)return this.setupPromise;let{resolve:f,reject:p,promise:m}=new i;this.setupPromise=m;let h=t.sdkVersion();if(h===``)throw new e({name:`Invalid library version`,message:`Library version is not defined or empty, cannot generate proper path to library files.`});let{jsURI:g,wasmURI:_}=r(h,a,this.getWasmParserFileName(l,s));return this.moduleHandler.set({mainScriptUrlOrBlob:g,locateFile:e=>a+e,onMainComplete:()=>{},onRuntimeInitialized:()=>{f()},print:e=>{n.log(n.Level.Info,e)},instantiateWasm:(e,t)=>(o({importObject:e,wasmURI:_,expectedHash:this.getWasmParserExpectedHash(l,s),verifyResponseHash:u,successCallback:t,progressCallback:()=>{},referredOrigin:d}),{})}),await c(g,h)||p(`Couldn't retrieve Parser library at ${g}, did you configure the path for it correctly?`),m}createParser(e){var t;let r=this.Module.ParserInterface.create(e.args[0]);if(n.log(n.Level.Debug,`Parser:create returns ${r.type}`,r),r.type===`error`)return u(e,r);let i=((t=e.args[0])==null?void 0:t.toString())??``,a=u(e,{type:`result`,result:i});return this.parsers.set(i,r.result),a}getWasmParserExpectedHash(e,t){return t?e?`46cad9a3bfa0a33e417dc37ce1fd350fbc63d9a858ffdb83f0d8b939f7f1b46b`:`05aaacc48a08977933ef77bd934703a6f5398777594b05f05b9446b876149a56`:e?`8c12631fd9807b1c175c31e779257605717f2b080f91644ffe15589f6b69254f`:`4a7a45ead4e254c5d880523ef8f8c405b18b6714f0a3aea5d84eb4dda94bb045`}getWasmParserFileName(e,t){return t?e?`scandit-datacapture-sdk-parser-simd-pthreads.wasm`:`scandit-datacapture-sdk-parser-pthreads.wasm`:e?`scandit-datacapture-sdk-parser-simd.wasm`:`scandit-datacapture-sdk-parser.wasm`}};export{f as ParserComponent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as ValuesOf, a as ModuleHandler, c as ParserLoadAction, d as ParserSetLogLevelAction, f as ParserSetLogLevelResult, g as SenderParserWorker, h as ReceiverParserWorker, i as DjinniActionMessageKey, l as ParserLoadResult, m as ProxyableResultMessage, n as ClassInfo, o as ParserInterfaceActionMessage, p as ProxyableActionMessage, r as Djinni, s as ParserInterfaceResultMessage, t as AugmentedWorker, u as ParserModule } from "../proxyableWorkerRelated-
|
|
1
|
+
import { _ as ValuesOf, a as ModuleHandler, c as ParserLoadAction, d as ParserSetLogLevelAction, f as ParserSetLogLevelResult, g as SenderParserWorker, h as ReceiverParserWorker, i as DjinniActionMessageKey, l as ParserLoadResult, m as ProxyableResultMessage, n as ClassInfo, o as ParserInterfaceActionMessage, p as ProxyableActionMessage, r as Djinni, s as ParserInterfaceResultMessage, t as AugmentedWorker, u as ParserModule } from "../proxyableWorkerRelated-DHSTtz1c.js";
|
|
2
2
|
export { AugmentedWorker, ClassInfo, Djinni, DjinniActionMessageKey, ModuleHandler, ParserInterfaceActionMessage, ParserInterfaceResultMessage, ParserLoadAction, ParserLoadResult, ParserModule, ParserSetLogLevelAction, ParserSetLogLevelResult, ProxyableActionMessage, ProxyableResultMessage, ReceiverParserWorker, SenderParserWorker, ValuesOf };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scandit/web-datacapture-parser",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.6.0-beta.1",
|
|
4
4
|
"description": "Scandit Data Capture SDK for the Web",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -16,6 +16,10 @@
|
|
|
16
16
|
"browser": "./build/js/index.js",
|
|
17
17
|
"exports": {
|
|
18
18
|
"./package.json": "./package.json",
|
|
19
|
+
"./umd": {
|
|
20
|
+
"types": "./build/js/index.d.ts",
|
|
21
|
+
"default": "./build/js/umd/index.js"
|
|
22
|
+
},
|
|
19
23
|
".": {
|
|
20
24
|
"types": "./build/js/index.d.ts",
|
|
21
25
|
"import": "./build/js/index.js",
|
|
@@ -80,6 +84,13 @@
|
|
|
80
84
|
"build/",
|
|
81
85
|
"sdc-lib/"
|
|
82
86
|
],
|
|
87
|
+
"peerDependencies": {
|
|
88
|
+
"@scandit/web-datacapture-barcode": "8.6.0-beta.1",
|
|
89
|
+
"@scandit/web-datacapture-core": "8.6.0-beta.1"
|
|
90
|
+
},
|
|
91
|
+
"dependencies": {
|
|
92
|
+
"@types/emscripten": "1.41.5"
|
|
93
|
+
},
|
|
83
94
|
"scripts": {
|
|
84
95
|
"types-watch": "tsc -p tsconfig.json -w --noEmit --preserveWatchOutput",
|
|
85
96
|
"types:check": "tsc -p tsconfig.json --noEmit",
|
|
@@ -93,12 +104,5 @@
|
|
|
93
104
|
"test-ci-coverage": "vitest run --coverage",
|
|
94
105
|
"check": "biome check .",
|
|
95
106
|
"check-ci": "biome ci --diagnostic-level=error ."
|
|
96
|
-
},
|
|
97
|
-
"peerDependencies": {
|
|
98
|
-
"@scandit/web-datacapture-barcode": "8.5.2",
|
|
99
|
-
"@scandit/web-datacapture-core": "8.5.2"
|
|
100
|
-
},
|
|
101
|
-
"dependencies": {
|
|
102
|
-
"@types/emscripten": "1.40.1"
|
|
103
107
|
}
|
|
104
108
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(){let e;(function(e){e.Level=function(e){return e.Debug=`debug`,e.Info=`info`,e.Warn=`warn`,e.Error=`error`,e.Quiet=`quiet`,e}({});let t=new Map([[`debug`,1],[`info`,2],[`warn`,3],[`error`,4],[`quiet`,5]]),n=`debug`;function r(e){n=e}e.setLevel=r;function i(e,...r){if(!(t.get(n)>t.get(e)))switch(e){case`debug`:console.debug(...r);break;case`info`:console.log(...r);break;case`warn`:console.warn(...r);break;case`error`:console.error(...r);break;default:break}}e.log=i;function a(...e){i(`warn`,...e)}e.warn=a;function o(...e){i(`debug`,...e)}e.debug=o;function s(...e){i(`info`,...e)}e.info=s;function c(...e){i(`error`,...e)}e.error=c})(e||={});var t=class e extends Error{constructor(t){super(t.message),Object.setPrototypeOf(this,e.prototype),this.name=t.name}toString(){return`${this.name}: ${this.message}`}};function n(e){return/^https?:\/\/(?:[^./]*\.)*cdn.jsdelivr.net\//.test(e)?{result:!0,cdnBaseURL:`https://cdn.jsdelivr.net/npm/`}:/^https?:\/\/(?:[^./]*\.)*unpkg.com\//.test(e)?{result:!0,cdnBaseURL:`https://unpkg.com/`}:{result:!1,cdnBaseURL:``}}function r(e){let t=/@scandit\/web-datacapture-[a-z]+/i.exec(e);return t?t[0]:null}function i(e,t,i){let a=t,o=n(a);if(o.result){let t=r(a);t!=null&&(a=`${o.cdnBaseURL}${t}@${e}/sdc-lib/`)}let s=i.replace(`.wasm`,``);return o.result?{jsURI:`${a}${s}.js`,wasmURI:`${a}${s}.wasm`}:{jsURI:`${a}${s}.js?v=${e}`,wasmURI:`${a}${s}.wasm?v=${e}`}}let a;(function(e){function t(){return`8.6.0-beta.1`}e.sdkVersion=t})(a||={});function o(e){return typeof e==`object`&&!!e&&e.document==null&&`addEventListener`in e&&typeof e.importScripts==`function`}var s=class{constructor(){this.promise=new Promise((e,t)=>{this.reject=t,this.resolve=e})}};let c={};function l(e){return[...new Uint8Array(e)].map(e=>{let t=e.toString(16);return t.length===1?`0${t}`:t}).join(``)}async function*u(e){let t=e.getReader();try{for(;;){let{done:e,value:n}=await t.read();if(e)return;yield n}}finally{t.releaseLock()}}async function d(e){let t=[],n=0,r=0;for await(let r of u(e))t.push(r),n+=r.length;let i=new Uint8Array(n);for(let e of t)i.set(e,r),r+=e.length;return i.buffer}(function(e){return e.VALID=`VALID`,e.INVALID=`INVALID`,e.NOT_VERIFIABLE=`NOT_VERIFIABLE`,e})({});async function f(t,n,r){if(typeof crypto.subtle.digest!=`function`)return e.log(e.Level.Warn,`Insecure context (see https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts): The hash of the Scandit Data Capture library WASM file found at ${r} could not be verified`),`NOT_VERIFIABLE`;try{let i=t instanceof Promise?await t:t,a=l(await crypto.subtle.digest(`SHA-256`,i));return n==null?(e.log(e.Level.Warn,`The library hash is not defined or empty, cannot correctly verify integrity.`),`NOT_VERIFIABLE`):a===n?(e.log(e.Level.Debug,`Data Capture library WASM integrity found at ${r} has been verified correctly.`),`VALID`):(e.log(e.Level.Warn,`The Scandit Data Capture library WASM file found at ${r} seems invalid: expected file hash doesn't match (received: ${a}, expected: ${n}). Please ensure the correct Scandit Data Capture file (with correct version) is retrieved.`),`INVALID`)}catch(t){return e.log(e.Level.Warn,`Wasm response could not be verified`,t),`NOT_VERIFIABLE`}}let p=new Map([[`br`,4.4],[`gzip`,2.9],[`none`,1]]);function m(e){let t=`content-encoding`;if(e==null||e.get(t)==null)return p.get(`none`);let n=new Set((e.get(t)??``).split(`,`).map(e=>e.trim()));for(let[e,t]of p)if(n.has(e))return t;return p.get(`none`)}function h(e){if(e==null)return 0;let t=m(e)??1,n=Number.parseInt(e.get(`content-length`)??`0`,10);return Number.isNaN(n)?0:Math.floor(n*t*100)/100}function g(e){let{pathname:t}=new URL(e);for(let[e,n]of Object.entries(c))if(t.endsWith(e))return n.bytes;return 0}function _(e){c=e}let v=(e,t)=>{let n=h(t);return n===0?g(e):n};function y(t,n,r,{onProgress:i,onError:a,onComplete:o}){if(!n.body)return[n];let s=v(t,n.headers),c=0,l=0;if(typeof TransformStream>`u`)return e.warn(`TransformStream is not supported in this environment. Progress tracking will be disabled.`),[n];let[u,d]=r?n.body.tee():[n.body],f=u.pipeThrough(new TransformStream({async transform(e,n){try{c+=e.length,l=Number((c/s*100).toFixed(2)),s>0&&e.length>0&&l<100?i?.({percentage:l,loadedBytes:c,privateUri:t}):s===0&&e.length>0&&i?.({percentage:null,loadedBytes:c,privateUri:t}),n.enqueue(e)}catch(e){n.error(e),a?.({error:e})}},flush(e){i?.({percentage:100,loadedBytes:c,privateUri:t}),o?.({percentage:100,loadedBytes:c,privateUri:t}),e.terminate()}}));return[new Response(f,{headers:new Headers(n.headers),status:n.status,statusText:n.statusText}),d]}async function b({wasmURI:e,expectedHash:t,verifyResponseHash:n,onProgress:r,onComplete:i,onError:a,referredOrigin:o}){let s=await fetch(e,{referrerPolicy:`origin`,referrer:o??``});if(!s.ok)throw Error(`HTTP status code is not ok: ${s.status}, ${s.statusText}`);let[c,l]=y(e,s,n,{onProgress:r,onError:a,onComplete:i});return l!=null&&f(d(l),t,e),c}function x({wasmURI:t,expectedHash:n,verifyResponseHash:r,progressCallback:i,successCallback:a,errorCallback:o,importObject:s,referredOrigin:c}){async function l(l){try{let e=await b({wasmURI:t,expectedHash:n,verifyResponseHash:r,onProgress:i,referredOrigin:c}),o=await(l??e).arrayBuffer(),u=await globalThis.WebAssembly.instantiate(o,s);a(u.instance,u.module)}catch(n){e.log(e.Level.Error,n),e.log(e.Level.Error,`Couldn't instantiate Scandit SDK DataCapture library at ${t}, did you configure the path for it correctly?`),o?.(n)}}async function u(){let o;try{o=await b({wasmURI:t,expectedHash:n,verifyResponseHash:r,onProgress:i,referredOrigin:c});let e=await globalThis.WebAssembly.instantiateStreaming(o,s);a(e.instance,e.module)}catch(t){e.log(e.Level.Warn,t),e.log(e.Level.Warn,`WebAssembly streaming compile failed. Falling back to ArrayBuffer instantiation (this will make things slower)`),l(o?.bodyUsed===!0?void 0:o)}}typeof globalThis.WebAssembly.instantiateStreaming==`function`?u():l()}async function S(e,t,n,r){return new Promise((i,a)=>{e().then(i).catch(o=>{let s=t*2;if(s>n){a(o);return}r(o),globalThis.setTimeout(()=>{S(e,s,n,r).then(i).catch(a)},t)})})}async function C(t,n){function r(t){try{return new URL(t,self.location.href).origin!==self.location.origin}catch(n){return e.log(e.Level.Warn,`Could not determine origin for WASM JS URL "${t}": ${n instanceof Error?n.message:String(n)}. Defaulting to same-origin path.`),!1}}function i(n){e.log(e.Level.Warn,n),e.log(e.Level.Warn,`Couldn't retrieve Scandit Data Capture library at ${t}, retrying...`)}try{if(r(t)){let e=await S(async()=>{let e=await fetch(t,{mode:`cors`,credentials:`omit`});if(!e.ok)throw Error(`Failed to load WASM JS script: ${t} (status ${e.status})`);let n=await e.blob();return/javascript|ecmascript/i.test(n.type)?n:new Blob([n],{type:`application/javascript`})},250,4e3,i),n=URL.createObjectURL(e);try{await importScripts(n)}finally{URL.revokeObjectURL(n)}self.Module.mainScriptUrlOrBlob=e}else await S(async()=>importScripts(t),250,4e3,i),self.Module.mainScriptUrlOrBlob=t;let a=globalThis.SDC_WASM_JS_VERSION;return a!==n&&e.log(e.Level.Warn,`The Scandit Data Capture library JS file found at ${t} seems invalid: expected version doesn't match (received: ${a}, expected: ${n}). Please ensure the correct Scandit Data Capture file (with correct version) is retrieved.`),!0}catch(t){return e.log(e.Level.Error,t),!1}}let w=e=>e.result!=null&&e.error==null;function T(e,t){return{type:`djinniResult`,payload:{id:e.id,className:e.className,methodName:e.methodName,instanceId:e.instanceId,result:t}}}function E(e,t){return{type:`parserLoaderResult`,payload:{id:e.id,className:e.className,methodName:e.methodName,result:t}}}new class{constructor(e,t){this.parsers=new Map,this.onMessageListener=this.onMessage.bind(this),this.setupPromise=null,this.workerSelf=e,this.moduleHandler=t,o(e)&&(this.workerFunctions={postMessage:this.workerSelf.postMessage.bind(this.workerSelf)},this.listenToMessages()),_({"scandit-datacapture-sdk-parser-pthreads.wasm":{bytes:7479689},"scandit-datacapture-sdk-parser-simd-pthreads.wasm":{bytes:7432431},"scandit-datacapture-sdk-parser.wasm":{bytes:7531109},"scandit-datacapture-sdk-parser-simd.wasm":{bytes:7469522}})}get Module(){return this.moduleHandler.get()}setLogLevel(t){e.setLevel(t.args[0]),this.workerFunctions.postMessage(E(t,{type:`result`,result:!0}))}async load(e){try{await this.setup(e.args[0]),this.workerFunctions.postMessage(E(e,{type:`result`,result:!0}))}catch(t){this.workerFunctions.postMessage(E(e,{type:`error`,error:t}))}}listenToMessages(){this.workerSelf.addEventListener(`message`,this.onMessageListener),this.workerSelf.addEventListener(`error`,t=>{e.log(e.Level.Error,t)}),this.workerSelf.addEventListener(`messageerror`,t=>{e.log(e.Level.Error,t)})}onMessage(e){return e.data.className===`ParserLoader`&&e.data.methodName===`load`&&this.load(e.data),e.data.className===`ParserLoader`&&e.data.methodName===`setLogLevel`&&this.setLogLevel(e.data),e.data.className===`ParserInterface`&&this.performDjinniAction(e.data),!0}async performDjinniAction(t){let n;if(e.log(e.Level.Debug,`${t.className}::${t.methodName}(`,t.args,`)`),t.methodName===`create`){let r=t.args[0].toString();if(this.parsers.has(r)){this.workerFunctions.postMessage(T(t,{type:`result`,result:r}));return}n=this.createParser(t),e.log(e.Level.Debug,n),this.workerFunctions.postMessage(n);return}let r=this.parsers.get(t.instanceId??``);if(r==null){this.workerFunctions.postMessage(T(t,{type:`error`,error:`parser is not defined: try to access instance with id ${t.instanceId??``}`}));return}let i=r[t.methodName](...t.args);n=w(i)?T(t,i):T(t,{type:`error`,error:i.error}),this.workerFunctions.postMessage(n)}async setup({libraryLocation:n,threadsSupport:r,simdSupport:o,verifyResponseHash:c,referredOrigin:l}){if(this.setupPromise!=null)return this.setupPromise;let{resolve:u,reject:d,promise:f}=new s;this.setupPromise=f;let p=a.sdkVersion();if(p===``)throw new t({name:`Invalid library version`,message:`Library version is not defined or empty, cannot generate proper path to library files.`});let{jsURI:m,wasmURI:h}=i(p,n,this.getWasmParserFileName(o,r));return this.moduleHandler.set({mainScriptUrlOrBlob:m,locateFile:e=>n+e,onMainComplete:()=>{},onRuntimeInitialized:()=>{u()},print:t=>{e.log(e.Level.Info,t)},instantiateWasm:(e,t)=>(x({importObject:e,wasmURI:h,expectedHash:this.getWasmParserExpectedHash(o,r),verifyResponseHash:c,successCallback:t,progressCallback:()=>{},referredOrigin:l}),{})}),await C(m,p)||d(`Couldn't retrieve Parser library at ${m}, did you configure the path for it correctly?`),f}createParser(t){let n=this.Module.ParserInterface.create(t.args[0]);if(e.log(e.Level.Debug,`Parser:create returns ${n.type}`,n),n.type===`error`)return T(t,n);let r=t.args[0]?.toString()??``,i=T(t,{type:`result`,result:r});return this.parsers.set(r,n.result),i}getWasmParserExpectedHash(e,t){return t?e?`46cad9a3bfa0a33e417dc37ce1fd350fbc63d9a858ffdb83f0d8b939f7f1b46b`:`05aaacc48a08977933ef77bd934703a6f5398777594b05f05b9446b876149a56`:e?`8c12631fd9807b1c175c31e779257605717f2b080f91644ffe15589f6b69254f`:`4a7a45ead4e254c5d880523ef8f8c405b18b6714f0a3aea5d84eb4dda94bb045`}getWasmParserFileName(e,t){return t?e?`scandit-datacapture-sdk-parser-simd-pthreads.wasm`:`scandit-datacapture-sdk-parser-pthreads.wasm`:e?`scandit-datacapture-sdk-parser-simd.wasm`:`scandit-datacapture-sdk-parser.wasm`}}(globalThis,{get:()=>globalThis.Module,set:e=>{globalThis.Module=e}})})();
|
|
Binary file
|
|
Binary file
|
package/sdc-lib/resources/models/barcode_label_localization_mslc_model_smartphone.d37117f6a058.model
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/sdc-lib/resources/models/barcode_localization_generic_postal_code_default.3aff51b79974.model
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|