@scandit/web-datacapture-id 7.2.0-beta.1 → 7.2.0
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/IdCapture.d.ts +3 -0
- package/build/js/IdCaptureSettings.d.ts +0 -2
- package/build/js/index.js +3 -3
- package/build/js/safariOOMDetection/SafariOOMDetector.d.ts +20 -0
- package/build/js/safariOOMDetection/SafariOOMStatsCollector.d.ts +28 -0
- package/build/js/safariOOMDetection/WriteThrottledStorage.d.ts +21 -0
- package/build/js/safariOOMDetection/types.d.ts +12 -0
- package/build/js/worker/dataCaptureEngine.d.ts +3 -0
- package/build/js/worker/dataCaptureWorkerRelated.d.ts +11 -2
- package/package.json +2 -2
- package/sdc-lib/resources/models/barcode_semantics_ocr_detector_default.f383d4282ee9.model +0 -0
- package/sdc-lib/resources/models/ocr_barcode_semantics_default.b8e0fdb8dc2c.model +0 -0
- package/sdc-lib/scandit-datacapture-sdk-id-pthreads.js +1 -1
- package/sdc-lib/scandit-datacapture-sdk-id-pthreads.wasm +0 -0
- package/sdc-lib/scandit-datacapture-sdk-id-simd-pthreads.js +1 -1
- package/sdc-lib/scandit-datacapture-sdk-id-simd-pthreads.wasm +0 -0
- package/sdc-lib/scandit-datacapture-sdk-id-simd.js +1 -1
- package/sdc-lib/scandit-datacapture-sdk-id-simd.wasm +0 -0
- package/sdc-lib/scandit-datacapture-sdk-id.js +1 -1
- package/sdc-lib/scandit-datacapture-sdk-id.wasm +0 -0
- /package/sdc-lib/resources/models/{barcode_classification_default_model.b90ecc5d362d6cb82801c877fdde7c3e64b6b5ef.model → barcode_classification_default.b90ecc5d362d.model} +0 -0
- /package/sdc-lib/resources/models/{barcode_localization_default_model.47d1f96d10ccb378344a3009cded24a85c22a5f9.model → barcode_localization_default.47d1f96d10cc.model} +0 -0
- /package/sdc-lib/resources/models/{barcode_localization_dpm_default_model.866e3546778825d3a9bc1f2070c892de9c525092.model → barcode_localization_dpm_default.866e35467788.model} +0 -0
- /package/sdc-lib/resources/models/{barcode_localization_generic_postal_code_default_model.4c1ba34eafc0f30fbafdd458c6eed156bd3b3498.model → barcode_localization_generic_postal_code_default.4c1ba34eafc0.model} +0 -0
- /package/sdc-lib/resources/models/{barcode_localization_oned_default_model.5f2c85a7773b298068deecb49059c7a477c280c4.model → barcode_localization_oned_default.5f2c85a7773b.model} +0 -0
- /package/sdc-lib/resources/models/{barcode_localization_twod_default_model.795c17cef2bf529a00a9e0d235c1b8ddfca66cf5.model → barcode_localization_twod_default.795c17cef2bf.model} +0 -0
- /package/sdc-lib/resources/models/{ocr_barcode_semantics_default_model.4df1cd250f2d31a69eecb30466b7823bbdd06730.model → barcode_ocr_fallback_ocr_default.4df1cd250f2d.model} +0 -0
- /package/sdc-lib/resources/models/{barcode_semantics_ocr_detector_default_model.e440ae4acaf7c7a2f42814ddc46c0920423eb372.model → barcode_ocr_fallback_ocr_detector_default.e440ae4acaf7.model} +0 -0
- /package/sdc-lib/resources/models/{eu_dl_localization_model.e440ae4acaf7c7a2f42814ddc46c0920423eb372.model → eu_dl_localization.e440ae4acaf7.model} +0 -0
- /package/sdc-lib/resources/models/{id_ocr_model.f42a207632c0e54aed010bff4b40df1264e3f304.model → id_ocr.f42a207632c0.model} +0 -0
- /package/sdc-lib/resources/models/{invalidated_id_classification_default.a055873831c99a035fa94bbf7a8568b1e8e004e5.model → invalidated_id_classification_default.a055873831c9.model} +0 -0
- /package/sdc-lib/resources/models/{mrz_line_localization_model.4573c5a05b53d7f5cfac0f0fda2ead609011df50.model → mrz_line_localization.4573c5a05b53.model} +0 -0
- /package/sdc-lib/resources/models/{mrz_localization_model.c6b469e57923be136dfd2b6d3fef354eadda3e04.model → mrz_localization.c6b469e57923.model} +0 -0
- /package/sdc-lib/resources/models/{ocr_mrz_default_model.050ddaa9b8339897a9c7bc8b7dea02f2c6f11856.model → ocr_mrz_default.050ddaa9b833.model} +0 -0
- /package/sdc-lib/resources/models/{uk_dl_code_localization_model.e440ae4acaf7c7a2f42814ddc46c0920423eb372.model → uk_dl_code_localization.e440ae4acaf7.model} +0 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Safari triggers a page reload when too much memory is requested (RangeError: Out of memory).
|
|
3
|
+
* This detector tracks these reloads and reports them to the passed callback.
|
|
4
|
+
* Some data can also be set in the storage to give more context about the page when the error occurs.
|
|
5
|
+
*/
|
|
6
|
+
export declare class SafariOOMDetector<T extends {}> {
|
|
7
|
+
private _onPageAbruptlyReloaded;
|
|
8
|
+
private _storage;
|
|
9
|
+
constructor(onPageAbruptlyReloaded: () => void);
|
|
10
|
+
static isSafari(): boolean;
|
|
11
|
+
install(): void;
|
|
12
|
+
/**
|
|
13
|
+
* Update the data stored in the storage.
|
|
14
|
+
*/
|
|
15
|
+
updateData(data: T): void;
|
|
16
|
+
get data(): T;
|
|
17
|
+
uninstall(): void;
|
|
18
|
+
private getStorage;
|
|
19
|
+
private onUnload;
|
|
20
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { SafariOOMDetector } from "./SafariOOMDetector";
|
|
2
|
+
import type { SafariOOMStats } from "./types";
|
|
3
|
+
export declare class SafariOOMStatsCollector {
|
|
4
|
+
private static readonly UP_TIME_UPDATE_INTERVAL_MS;
|
|
5
|
+
private _framesProcessedCount;
|
|
6
|
+
private _didCaptureCount;
|
|
7
|
+
private _didRejectCount;
|
|
8
|
+
private _applySettingsCount;
|
|
9
|
+
private _videoResolution;
|
|
10
|
+
private _firstFrameProcessedTime?;
|
|
11
|
+
private _detector;
|
|
12
|
+
private _upTimeMs;
|
|
13
|
+
private _upTimeTimer;
|
|
14
|
+
constructor(detector: SafariOOMDetector<SafariOOMStats>);
|
|
15
|
+
destroy(): void;
|
|
16
|
+
get framesProcessedCount(): number;
|
|
17
|
+
get didCaptureCount(): number;
|
|
18
|
+
get didRejectCount(): number;
|
|
19
|
+
get applySettingsCount(): number;
|
|
20
|
+
get videoResolution(): string | null;
|
|
21
|
+
set framesProcessedCount(count: number);
|
|
22
|
+
set didCaptureCount(count: number);
|
|
23
|
+
set didRejectCount(count: number);
|
|
24
|
+
set applySettingsCount(count: number);
|
|
25
|
+
set videoResolution(resolution: string);
|
|
26
|
+
private get data();
|
|
27
|
+
private updateUpTime;
|
|
28
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
type Data = Record<string, unknown>;
|
|
2
|
+
/**
|
|
3
|
+
* A storage that throttles writes to the underlying storage.
|
|
4
|
+
* This is useful to avoid excessive writes to the storage, as we may have many updates
|
|
5
|
+
* of the data in a short period of time.
|
|
6
|
+
*/
|
|
7
|
+
export declare class WriteThrottledStorage {
|
|
8
|
+
private static readonly DEFAULT_WRITE_INTERVAL_MS;
|
|
9
|
+
private readonly _storage;
|
|
10
|
+
private _lastWrite;
|
|
11
|
+
private _pendingData?;
|
|
12
|
+
private _writeTimer?;
|
|
13
|
+
private readonly _writeIntervalMs;
|
|
14
|
+
constructor(storage: Storage, writeIntervalMs?: number);
|
|
15
|
+
hasDataAlreadyWritten(): boolean;
|
|
16
|
+
write(data: Data): Data;
|
|
17
|
+
read(): Data;
|
|
18
|
+
clear(): void;
|
|
19
|
+
private scheduleWrite;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface SafariOOMStats {
|
|
2
|
+
framesProcessedCount: number;
|
|
3
|
+
didCaptureCount: number;
|
|
4
|
+
didRejectCount: number;
|
|
5
|
+
applySettingsCount: number;
|
|
6
|
+
upTime: number;
|
|
7
|
+
videoResolution: string;
|
|
8
|
+
}
|
|
9
|
+
export type SafariOOMEventData = SafariOOMStats & {
|
|
10
|
+
parentDomain: string | undefined;
|
|
11
|
+
centaurusEnabled: boolean;
|
|
12
|
+
};
|
|
@@ -3,6 +3,7 @@ import { DataCaptureEngine as CoreDataCaptureEngine } from "@scandit/web-datacap
|
|
|
3
3
|
import type { CapturedIdJSONWithoutCommonFieldsJSON, DataCaptureCallbackMessage, EngineWorkerResponse, IdCaptureSessionHolder, Module, ParseResult, WasmCaptureId } from "./dataCaptureWorkerRelated";
|
|
4
4
|
import type { IdCaptureSettingsJSON } from "../IdCaptureSettings";
|
|
5
5
|
import type { AamvaBarcodeVerificationResultJSON, CapturedIdJSON, CapturedIdJSONWithRawImageInfo, DataConsistencyResultJSON, IdCaptureSessionJSON } from "../SerializedTypes";
|
|
6
|
+
import type { SafariOOMEventData } from "../safariOOMDetection/types";
|
|
6
7
|
export interface WorkerFunctions extends BaseWorkerFunctions {
|
|
7
8
|
postMessage: (message: DataCaptureCallbackMessage, transfer?: Transferable[]) => void;
|
|
8
9
|
}
|
|
@@ -28,6 +29,7 @@ export declare class DataCaptureEngine extends CoreDataCaptureEngine<Module> {
|
|
|
28
29
|
idCaptureDataConsistencyVerifyCapture(capturedId: CapturedIdJSON): EngineWorkerResponse<"idCaptureDataConsistencyVerifyCapture">;
|
|
29
30
|
idCaptureDrivingLicenseDetailsCreateWithBlinkIdData(vehicleClass: string, restrictions: string, endorsements: string): EngineWorkerResponse<"idCaptureDrivingLicenseDetailsCreateWithBlinkIdData">;
|
|
30
31
|
getIdOpenSourceSoftwareLicenseInfo(): EngineWorkerResponse<"getIdOpenSourceSoftwareLicenseInfo">;
|
|
32
|
+
idCaptureReportSafariAbruptReload(environmentData: SafariOOMEventData): EngineWorkerResponse<"idCaptureReportSafariAbruptReload">;
|
|
31
33
|
getModeDeserializers(): Vector;
|
|
32
34
|
protected getWasmSideModuleFileName(): string;
|
|
33
35
|
protected getWasmCoreFileName(simdSupport: boolean, webassemblyMultithreadingSupport: boolean): string;
|
|
@@ -74,6 +76,7 @@ export declare class IdCaptureMode {
|
|
|
74
76
|
extractCaptureId(wasmCapturedId: WasmCaptureId | null): CapturedIdJSONWithRawImageInfo | null;
|
|
75
77
|
onShutterButtonPositionChangedCallback(position: string): void;
|
|
76
78
|
onShutterButtonStateChangedCallback(state: string): void;
|
|
79
|
+
reportSafariAbruptReload(environmentData: SafariOOMEventData): Promise<void>;
|
|
77
80
|
/**
|
|
78
81
|
* The session holder contains everything except the common fields for the captured id, which have to be
|
|
79
82
|
* gathered manually.
|
|
@@ -3,10 +3,11 @@ import type { CaptureModeDeserializerInstance, AnyDataCaptureActionMessage as Co
|
|
|
3
3
|
import type { IdCaptureSettingsJSON } from "../IdCaptureSettings";
|
|
4
4
|
import type { AamvaBarcodeVerificationResultJSON, CapturedIdCommonFieldsJSON, CapturedIdJSON, CapturedIdJSONWithRawImageInfo, DataConsistencyResultJSON, DrivingLicenseDetailsJSON } from "../SerializedTypes";
|
|
5
5
|
import type { ShutterButtonState } from "scandit-web-datacapture-id-private";
|
|
6
|
+
import type { SafariOOMEventData } from "../safariOOMDetection/types";
|
|
6
7
|
/**
|
|
7
8
|
* MESSAGES (ACTIONS) SENT TO THE WORKER
|
|
8
9
|
*/
|
|
9
|
-
export type DataCaptureActionMessageKey = CoreDataCaptureActionMessageKey | "idCaptureApplySettings" | "idCaptureBarcodeVerifyAamvaCapture" | "idCaptureDataConsistencyVerifyCapture" | "idCaptureParse" | "idCaptureReset" | "idCaptureSetLastDetectionIssue" | "idCaptureSetLastError" | "idCaptureSetLastLocalizedId" | "idCaptureSetLastResult" | "idCaptureDrivingLicenseDetailsCreateWithBlinkIdData" | "getIdOpenSourceSoftwareLicenseInfo";
|
|
10
|
+
export type DataCaptureActionMessageKey = CoreDataCaptureActionMessageKey | "idCaptureApplySettings" | "idCaptureBarcodeVerifyAamvaCapture" | "idCaptureDataConsistencyVerifyCapture" | "idCaptureParse" | "idCaptureReset" | "idCaptureSetLastDetectionIssue" | "idCaptureSetLastError" | "idCaptureSetLastLocalizedId" | "idCaptureSetLastResult" | "idCaptureDrivingLicenseDetailsCreateWithBlinkIdData" | "getIdOpenSourceSoftwareLicenseInfo" | "idCaptureReportSafariAbruptReload";
|
|
10
11
|
export interface IdCaptureParseResponse {
|
|
11
12
|
result: ParseResult | null;
|
|
12
13
|
}
|
|
@@ -78,7 +79,11 @@ export interface IdCaptureDrivingLicenseDetailsCreateWithBlinkIdDataDataCaptureA
|
|
|
78
79
|
export interface GetIdOpenSourceSoftwareLicenseInfoAction extends DataCaptureActionMessage {
|
|
79
80
|
command: "getIdOpenSourceSoftwareLicenseInfo";
|
|
80
81
|
}
|
|
81
|
-
export
|
|
82
|
+
export interface IdCaptureReportSafariAbruptReloadAction extends DataCaptureActionMessage {
|
|
83
|
+
command: "idCaptureReportSafariAbruptReload";
|
|
84
|
+
environmentData: SafariOOMEventData;
|
|
85
|
+
}
|
|
86
|
+
export type AnyDataCaptureActionMessage = CoreAnyDataCaptureActionMessage | IdCaptureApplySettingsDataCaptureAction | IdCaptureBarcodeVerifyAamvaCaptureDataCaptureAction | IdCaptureDataConsistencyVerifyCaptureDataCaptureAction | IdCaptureParseDataCaptureAction | IdCaptureResetDataCaptureAction | IdCaptureSetLastDetectionIssueDataCaptureAction | IdCaptureSetLastErrorDataCaptureAction | IdCaptureSetLastLocalizedIdDataCaptureAction | IdCaptureSetLastResultDataCaptureAction | IdCaptureDrivingLicenseDetailsCreateWithBlinkIdDataDataCaptureAction | GetIdOpenSourceSoftwareLicenseInfoAction | IdCaptureReportSafariAbruptReloadAction;
|
|
82
87
|
export type MessagePayloadByCommand = {
|
|
83
88
|
[key in AnyDataCaptureActionMessage["command"]]: Prettify<Omit<Extract<AnyDataCaptureActionMessage, {
|
|
84
89
|
command: key;
|
|
@@ -296,6 +301,10 @@ interface IdCaptureModule {
|
|
|
296
301
|
IdOpenSourceSoftwareLicenseInfo: {
|
|
297
302
|
getLicenseText(): string;
|
|
298
303
|
};
|
|
304
|
+
OutOfMemoryAnalyticsData: new (framesProcessedCount: number, didCaptureCount: number, didRejectCount: number, applySettingsCount: number, upTime: number, videoResolution: string, parentDomain: string | undefined, centaurusEnabled: boolean) => EmscriptenClassHandle;
|
|
305
|
+
OutOfMemoryAnalyticsHelper: {
|
|
306
|
+
storeAnalyticsEvent: (context: unknown, event: unknown) => void;
|
|
307
|
+
};
|
|
299
308
|
}
|
|
300
309
|
export interface Module extends CoreModule, IdCaptureModule {
|
|
301
310
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scandit/web-datacapture-id",
|
|
3
|
-
"version": "7.2.0
|
|
3
|
+
"version": "7.2.0",
|
|
4
4
|
"description": "Scandit Data Capture SDK for the Web",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -102,6 +102,6 @@
|
|
|
102
102
|
"@types/emscripten": "^1.39.13"
|
|
103
103
|
},
|
|
104
104
|
"peerDependencies": {
|
|
105
|
-
"@scandit/web-datacapture-core": "7.2.0
|
|
105
|
+
"@scandit/web-datacapture-core": "7.2.0"
|
|
106
106
|
}
|
|
107
107
|
}
|
|
Binary file
|