scandit-datacapture-frameworks-id 8.1.1 → 8.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/dist/index.js CHANGED
@@ -522,8 +522,30 @@ var Sex;
522
522
  Sex["Unspecified"] = "unspecified";
523
523
  })(Sex || (Sex = {}));
524
524
 
525
+ let idDefaultsLoader;
526
+ function setIdDefaultsLoader(loader) {
527
+ idDefaultsLoader = loader;
528
+ }
529
+ function ensureIdDefaults() {
530
+ var _a, _b;
531
+ const existing = (_a = FactoryMaker.instances.get('IdDefaults')) === null || _a === void 0 ? void 0 : _a.instance;
532
+ if (existing) {
533
+ return existing;
534
+ }
535
+ idDefaultsLoader === null || idDefaultsLoader === void 0 ? void 0 : idDefaultsLoader();
536
+ const reloaded = (_b = FactoryMaker.instances.get('IdDefaults')) === null || _b === void 0 ? void 0 : _b.instance;
537
+ if (reloaded) {
538
+ return reloaded;
539
+ }
540
+ throw new Error('IdDefaults missing and re-init failed');
541
+ }
542
+ function loadIdDefaults(jsonDefaults) {
543
+ const idDefaults = parseIdDefaults(jsonDefaults);
544
+ FactoryMaker.bindInstanceIfNotExists('IdDefaults', idDefaults);
545
+ }
546
+
525
547
  function getIdDefaults() {
526
- return FactoryMaker.getInstance('IdDefaults');
548
+ return ensureIdDefaults();
527
549
  }
528
550
  function parseIdDefaults(jsonDefaults) {
529
551
  const idDefaults = {
@@ -563,6 +585,7 @@ function parseIdDefaults(jsonDefaults) {
563
585
  },
564
586
  IdCaptureSettings: {
565
587
  anonymizationMode: jsonDefaults.IdCaptureSettings.anonymizationMode,
588
+ anonymizeDefaultFields: jsonDefaults.IdCaptureSettings.anonymizeDefaultFields,
566
589
  rejectVoidedIds: jsonDefaults.IdCaptureSettings.rejectVoidedIds,
567
590
  decodeBackOfEuropeanDrivingLicense: jsonDefaults.IdCaptureSettings.decodeBackOfEuropeanDrivingLicense,
568
591
  rejectExpiredIds: jsonDefaults.IdCaptureSettings.rejectExpiredIds,
@@ -578,11 +601,6 @@ function parseIdDefaults(jsonDefaults) {
578
601
  return idDefaults;
579
602
  }
580
603
 
581
- function loadIdDefaults(jsonDefaults) {
582
- const idDefaults = parseIdDefaults(jsonDefaults);
583
- FactoryMaker.bindInstanceIfNotExists('IdDefaults', idDefaults);
584
- }
585
-
586
604
  var AamvaBarcodeVerificationStatus;
587
605
  (function (AamvaBarcodeVerificationStatus) {
588
606
  AamvaBarcodeVerificationStatus["Authentic"] = "authentic";
@@ -1099,6 +1117,9 @@ class DriverLicense extends DefaultSerializeable {
1099
1117
  this._documentType = IdCaptureDocumentType.DriverLicense;
1100
1118
  this._region = region;
1101
1119
  }
1120
+ get documentType() {
1121
+ return this._documentType;
1122
+ }
1102
1123
  get region() {
1103
1124
  return this._region;
1104
1125
  }
@@ -1137,6 +1158,9 @@ class HealthInsuranceCard extends DefaultSerializeable {
1137
1158
  this._documentType = IdCaptureDocumentType.HealthInsuranceCard;
1138
1159
  this._region = region;
1139
1160
  }
1161
+ get documentType() {
1162
+ return this._documentType;
1163
+ }
1140
1164
  get region() {
1141
1165
  return this._region;
1142
1166
  }
@@ -1175,6 +1199,9 @@ class IdCard extends DefaultSerializeable {
1175
1199
  this._documentType = IdCaptureDocumentType.IdCard;
1176
1200
  this._region = region;
1177
1201
  }
1202
+ get documentType() {
1203
+ return this._documentType;
1204
+ }
1178
1205
  get region() {
1179
1206
  return this._region;
1180
1207
  }
@@ -1213,6 +1240,9 @@ class Passport extends DefaultSerializeable {
1213
1240
  this._documentType = IdCaptureDocumentType.Passport;
1214
1241
  this._region = region;
1215
1242
  }
1243
+ get documentType() {
1244
+ return this._documentType;
1245
+ }
1216
1246
  get region() {
1217
1247
  return this._region;
1218
1248
  }
@@ -1252,6 +1282,9 @@ class RegionSpecific extends DefaultSerializeable {
1252
1282
  this._region = IdCaptureRegion.Any;
1253
1283
  this._documentSubtype = subtype;
1254
1284
  }
1285
+ get documentType() {
1286
+ return this._documentType;
1287
+ }
1255
1288
  get region() {
1256
1289
  return this._region;
1257
1290
  }
@@ -1296,6 +1329,9 @@ class ResidencePermit extends DefaultSerializeable {
1296
1329
  this._documentType = IdCaptureDocumentType.ResidencePermit;
1297
1330
  this._region = region;
1298
1331
  }
1332
+ get documentType() {
1333
+ return this._documentType;
1334
+ }
1299
1335
  get region() {
1300
1336
  return this._region;
1301
1337
  }
@@ -1334,6 +1370,9 @@ class VisaIcao extends DefaultSerializeable {
1334
1370
  this._documentType = IdCaptureDocumentType.VisaIcao;
1335
1371
  this._region = region;
1336
1372
  }
1373
+ get documentType() {
1374
+ return this._documentType;
1375
+ }
1337
1376
  get region() {
1338
1377
  return this._region;
1339
1378
  }
@@ -1804,35 +1843,211 @@ var MobileDocumentDataElement;
1804
1843
  MobileDocumentDataElement["AamvaVersion"] = "aamvaVersion";
1805
1844
  })(MobileDocumentDataElement || (MobileDocumentDataElement = {}));
1806
1845
 
1846
+ /*
1847
+ * This file is part of the Scandit Data Capture SDK
1848
+ *
1849
+ * Copyright (C) 2025- Scandit AG. All rights reserved.
1850
+ */
1851
+ /**
1852
+ * Adapter class for Id operations.
1853
+ * Provides typed methods that internally call $executeId.
1854
+ * Generated from schema definition to ensure parameter and method name consistency.
1855
+ */
1856
+ class IdProxyAdapter {
1857
+ constructor(proxy) {
1858
+ this.proxy = proxy;
1859
+ }
1860
+ /**
1861
+ * Resets the ID capture mode
1862
+ * @param modeId Unique identifier of the ID capture mode
1863
+ */
1864
+ resetIdCaptureMode(_a) {
1865
+ return __awaiter(this, arguments, void 0, function* ({ modeId }) {
1866
+ const result = yield this.proxy.$executeId({
1867
+ moduleName: 'IdCaptureModule',
1868
+ methodName: 'resetIdCaptureMode',
1869
+ isEventRegistration: false,
1870
+ modeId,
1871
+ });
1872
+ return result;
1873
+ });
1874
+ }
1875
+ /**
1876
+ * Sets the enabled state of the ID capture mode
1877
+ * @param modeId Unique identifier of the ID capture mode
1878
+ * @param enabled Whether the mode should be enabled
1879
+ */
1880
+ setModeEnabledState(_a) {
1881
+ return __awaiter(this, arguments, void 0, function* ({ modeId, enabled }) {
1882
+ const result = yield this.proxy.$executeId({
1883
+ moduleName: 'IdCaptureModule',
1884
+ methodName: 'setModeEnabledState',
1885
+ isEventRegistration: false,
1886
+ modeId,
1887
+ enabled,
1888
+ });
1889
+ return result;
1890
+ });
1891
+ }
1892
+ /**
1893
+ * Updates the ID capture mode configuration
1894
+ * @param modeJson ID capture mode configuration as JSON string
1895
+ * @param modeId Unique identifier of the ID capture mode
1896
+ */
1897
+ updateIdCaptureMode(_a) {
1898
+ return __awaiter(this, arguments, void 0, function* ({ modeJson, modeId }) {
1899
+ const result = yield this.proxy.$executeId({
1900
+ moduleName: 'IdCaptureModule',
1901
+ methodName: 'updateIdCaptureMode',
1902
+ isEventRegistration: false,
1903
+ modeJson,
1904
+ modeId,
1905
+ });
1906
+ return result;
1907
+ });
1908
+ }
1909
+ /**
1910
+ * Applies new settings to the ID capture mode
1911
+ * @param settingsJson ID capture mode settings as JSON string
1912
+ * @param modeId Unique identifier of the ID capture mode
1913
+ */
1914
+ applyIdCaptureModeSettings(_a) {
1915
+ return __awaiter(this, arguments, void 0, function* ({ settingsJson, modeId, }) {
1916
+ const result = yield this.proxy.$executeId({
1917
+ moduleName: 'IdCaptureModule',
1918
+ methodName: 'applyIdCaptureModeSettings',
1919
+ isEventRegistration: false,
1920
+ settingsJson,
1921
+ modeId,
1922
+ });
1923
+ return result;
1924
+ });
1925
+ }
1926
+ /**
1927
+ * Updates the ID capture feedback configuration
1928
+ * @param feedbackJson Feedback configuration as JSON string
1929
+ * @param modeId Unique identifier of the ID capture mode
1930
+ */
1931
+ updateFeedback(_a) {
1932
+ return __awaiter(this, arguments, void 0, function* ({ feedbackJson, modeId }) {
1933
+ const result = yield this.proxy.$executeId({
1934
+ moduleName: 'IdCaptureModule',
1935
+ methodName: 'updateFeedback',
1936
+ isEventRegistration: false,
1937
+ feedbackJson,
1938
+ modeId,
1939
+ });
1940
+ return result;
1941
+ });
1942
+ }
1943
+ /**
1944
+ * Updates the ID capture overlay configuration
1945
+ * @param overlayJson ID capture overlay configuration as JSON string
1946
+ */
1947
+ updateIdCaptureOverlay(_a) {
1948
+ return __awaiter(this, arguments, void 0, function* ({ overlayJson }) {
1949
+ const result = yield this.proxy.$executeId({
1950
+ moduleName: 'IdCaptureModule',
1951
+ methodName: 'updateIdCaptureOverlay',
1952
+ isEventRegistration: false,
1953
+ overlayJson,
1954
+ });
1955
+ return result;
1956
+ });
1957
+ }
1958
+ /**
1959
+ * Finish callback for ID capture did capture event
1960
+ * @param modeId Unique identifier of the ID capture mode
1961
+ * @param enabled Whether the mode is enabled
1962
+ */
1963
+ finishDidCaptureCallback(_a) {
1964
+ return __awaiter(this, arguments, void 0, function* ({ modeId, enabled }) {
1965
+ const result = yield this.proxy.$executeId({
1966
+ moduleName: 'IdCaptureModule',
1967
+ methodName: 'finishDidCaptureCallback',
1968
+ isEventRegistration: false,
1969
+ modeId,
1970
+ enabled,
1971
+ });
1972
+ return result;
1973
+ });
1974
+ }
1975
+ /**
1976
+ * Finish callback for ID capture did reject event
1977
+ * @param modeId Unique identifier of the ID capture mode
1978
+ * @param enabled Whether the mode is enabled
1979
+ */
1980
+ finishDidRejectCallback(_a) {
1981
+ return __awaiter(this, arguments, void 0, function* ({ modeId, enabled }) {
1982
+ const result = yield this.proxy.$executeId({
1983
+ moduleName: 'IdCaptureModule',
1984
+ methodName: 'finishDidRejectCallback',
1985
+ isEventRegistration: false,
1986
+ modeId,
1987
+ enabled,
1988
+ });
1989
+ return result;
1990
+ });
1991
+ }
1992
+ /**
1993
+ * Register persistent event listener for ID capture events
1994
+ * @param modeId Unique identifier of the ID capture mode
1995
+ */
1996
+ addIdCaptureListener(_a) {
1997
+ return __awaiter(this, arguments, void 0, function* ({ modeId }) {
1998
+ const result = yield this.proxy.$executeId({
1999
+ moduleName: 'IdCaptureModule',
2000
+ methodName: 'addIdCaptureListener',
2001
+ isEventRegistration: true,
2002
+ modeId,
2003
+ });
2004
+ return result;
2005
+ });
2006
+ }
2007
+ /**
2008
+ * Unregister event listener for ID capture events
2009
+ * @param modeId Unique identifier of the ID capture mode
2010
+ */
2011
+ removeIdCaptureListener(_a) {
2012
+ return __awaiter(this, arguments, void 0, function* ({ modeId }) {
2013
+ const result = yield this.proxy.$executeId({
2014
+ moduleName: 'IdCaptureModule',
2015
+ methodName: 'removeIdCaptureListener',
2016
+ isEventRegistration: false,
2017
+ modeId,
2018
+ });
2019
+ return result;
2020
+ });
2021
+ }
2022
+ }
2023
+
1807
2024
  class IdCaptureController extends BaseController {
1808
2025
  constructor(idCapture = null) {
1809
- super('IdCaptureProxy');
2026
+ super('IdProxy');
1810
2027
  this.idCapture = null;
2028
+ this.adapter = new IdProxyAdapter(this._proxy);
1811
2029
  this.idCapture = idCapture;
1812
2030
  }
1813
2031
  reset() {
1814
- return this._proxy.$resetIdCaptureMode({ modeId: this.modeId });
2032
+ return this.adapter.resetIdCaptureMode({ modeId: this.modeId });
1815
2033
  }
1816
2034
  setModeEnabledState(enabled) {
1817
- return this._proxy.$setModeEnabledState({ modeId: this.modeId, enabled: enabled });
2035
+ return this.adapter.setModeEnabledState({ modeId: this.modeId, enabled: enabled });
1818
2036
  }
1819
2037
  updateIdCaptureMode() {
1820
2038
  if (this.idCapture == null) {
1821
2039
  throw new Error('IdCaptureController is not initialized with an IdCapture instance');
1822
2040
  }
1823
- return this._proxy.$updateIdCaptureMode({ modeJson: JSON.stringify(this.idCapture.toJSON()), modeId: this.modeId });
2041
+ return this.adapter.updateIdCaptureMode({ modeJson: JSON.stringify(this.idCapture.toJSON()), modeId: this.modeId });
1824
2042
  }
1825
2043
  applyIdCaptureModeSettings(newSettings) {
1826
- return this._proxy.$applyIdCaptureModeSettings({
2044
+ return this.adapter.applyIdCaptureModeSettings({
1827
2045
  settingsJson: JSON.stringify(newSettings.toJSON()),
1828
2046
  modeId: this.modeId,
1829
2047
  });
1830
2048
  }
1831
2049
  updateFeedback(feedback) {
1832
- return this._proxy.$updateIdCaptureFeedback({
1833
- feedbackJson: JSON.stringify(feedback.toJSON()),
1834
- modeId: this.modeId,
1835
- });
2050
+ return this.adapter.updateFeedback({ feedbackJson: JSON.stringify(feedback.toJSON()), modeId: this.modeId });
1836
2051
  }
1837
2052
  get modeId() {
1838
2053
  return this.idCapture.modeId;
@@ -1846,7 +2061,7 @@ var IdCaptureListenerEvents;
1846
2061
  })(IdCaptureListenerEvents || (IdCaptureListenerEvents = {}));
1847
2062
  class IdCaptureListenerController extends BaseController {
1848
2063
  constructor(idCapture) {
1849
- super('IdCaptureListenerProxy');
2064
+ super('IdProxy');
1850
2065
  this.hasListeners = false;
1851
2066
  this.handleDidCaptureWrapper = (ev) => __awaiter(this, void 0, void 0, function* () {
1852
2067
  return this.handleDidCapture(ev);
@@ -1855,6 +2070,7 @@ class IdCaptureListenerController extends BaseController {
1855
2070
  return this.handleDidReject(ev);
1856
2071
  });
1857
2072
  this.idCapture = idCapture;
2073
+ this.adapter = new IdProxyAdapter(this._proxy);
1858
2074
  void this.initialize();
1859
2075
  }
1860
2076
  subscribeListener() {
@@ -1865,7 +2081,7 @@ class IdCaptureListenerController extends BaseController {
1865
2081
  this._proxy.subscribeForEvents(Object.values(IdCaptureListenerEvents));
1866
2082
  this._proxy.eventEmitter.on(IdCaptureListenerEvents.didCapture, this.handleDidCaptureWrapper);
1867
2083
  this._proxy.eventEmitter.on(IdCaptureListenerEvents.didReject, this.handleDidRejectWrapper);
1868
- yield this._proxy.$$addIdCaptureListener({ modeId: this.modeId });
2084
+ yield this.adapter.addIdCaptureListener({ modeId: this.modeId });
1869
2085
  this.hasListeners = true;
1870
2086
  });
1871
2087
  }
@@ -1874,7 +2090,7 @@ class IdCaptureListenerController extends BaseController {
1874
2090
  if (!this.hasListeners) {
1875
2091
  return;
1876
2092
  }
1877
- yield this._proxy.$removeIdCaptureListener({ modeId: this.modeId });
2093
+ yield this.adapter.removeIdCaptureListener({ modeId: this.modeId });
1878
2094
  this._proxy.unsubscribeFromEvents(Object.values(IdCaptureListenerEvents));
1879
2095
  this._proxy.eventEmitter.off(IdCaptureListenerEvents.didCapture, this.handleDidCaptureWrapper);
1880
2096
  this._proxy.eventEmitter.off(IdCaptureListenerEvents.didReject, this.handleDidRejectWrapper);
@@ -1903,7 +2119,7 @@ class IdCaptureListenerController extends BaseController {
1903
2119
  this.enrichCapturedIdJson(capturedIdJson, event.imageInfo, event.frontReviewImage);
1904
2120
  const captureId = CapturedId.fromJSON(capturedIdJson);
1905
2121
  this.notifyListenersOfDidCapture(captureId);
1906
- return this._proxy.$finishDidCaptureCallback({ modeId: this.modeId, enabled: this.idCapture.isEnabled });
2122
+ return this.adapter.finishDidCaptureCallback({ modeId: this.modeId, enabled: this.idCapture.isEnabled });
1907
2123
  });
1908
2124
  }
1909
2125
  handleDidReject(ev) {
@@ -1920,7 +2136,7 @@ class IdCaptureListenerController extends BaseController {
1920
2136
  rejectedId = CapturedId.fromJSON(rejectedIdJson);
1921
2137
  }
1922
2138
  this.notifyListenersOfDidReject(rejectedId, event.rejectionReason);
1923
- return this._proxy.$finishDidRejectCallback({ modeId: this.modeId, enabled: this.idCapture.isEnabled });
2139
+ return this.adapter.finishDidRejectCallback({ modeId: this.modeId, enabled: this.idCapture.isEnabled });
1924
2140
  });
1925
2141
  }
1926
2142
  notifyListenersOfDidCapture(captureId) {
@@ -1955,11 +2171,12 @@ class IdCaptureListenerController extends BaseController {
1955
2171
 
1956
2172
  class IdCaptureOverlayController extends BaseController {
1957
2173
  constructor(overlay) {
1958
- super('IdCaptureOverlayProxy');
2174
+ super('IdProxy');
1959
2175
  this.overlay = overlay;
2176
+ this.adapter = new IdProxyAdapter(this._proxy);
1960
2177
  }
1961
2178
  updateIdCaptureOverlay(overlay) {
1962
- return this._proxy.$updateIdCaptureOverlay({ overlayJson: JSON.stringify(overlay.toJSON()) });
2179
+ return this.adapter.updateIdCaptureOverlay({ overlayJson: JSON.stringify(overlay.toJSON()) });
1963
2180
  }
1964
2181
  dispose() {
1965
2182
  this._proxy.dispose();
@@ -2448,6 +2665,7 @@ class IdCaptureSettings extends DefaultSerializeable {
2448
2665
  constructor() {
2449
2666
  super();
2450
2667
  this.anonymizationMode = IdCaptureSettings.idCaptureDefaults.IdCapture.IdCaptureSettings.anonymizationMode;
2668
+ this.anonymizeDefaultFields = IdCaptureSettings.idCaptureDefaults.IdCapture.IdCaptureSettings.anonymizeDefaultFields;
2451
2669
  this.rejectVoidedIds = IdCaptureSettings.idCaptureDefaults.IdCapture.IdCaptureSettings.rejectVoidedIds;
2452
2670
  this.decodeBackOfEuropeanDrivingLicense = IdCaptureSettings.idCaptureDefaults.IdCapture.IdCaptureSettings.decodeBackOfEuropeanDrivingLicense;
2453
2671
  this.acceptedDocuments = [];
@@ -2492,14 +2710,12 @@ __decorate([
2492
2710
  ], IdCaptureSettings, "idCaptureDefaults", null);
2493
2711
 
2494
2712
  const ID_PROXY_TYPE_NAMES = [
2495
- 'IdCaptureListenerProxy',
2496
- 'IdCaptureProxy',
2497
- 'IdCaptureOverlayProxy',
2713
+ 'IdProxy',
2498
2714
  ];
2499
2715
 
2500
2716
  function registerIdProxies(provider) {
2501
2717
  registerProxies(ID_PROXY_TYPE_NAMES, provider);
2502
2718
  }
2503
2719
 
2504
- export { AamvaBarcodeVerificationResult, AamvaBarcodeVerificationStatus, BarcodeResult, CapturedId, CapturedSides, DataConsistencyCheck, DataConsistencyResult, DateResult, DriverLicense, DrivingLicenseCategory, DrivingLicenseDetails, Duration, FullDocumentScanner, HealthInsuranceCard, ID_PROXY_TYPE_NAMES, IdAnonymizationMode, IdCapture, IdCaptureController, IdCaptureDocumentType, IdCaptureFeedback, IdCaptureListenerController, IdCaptureListenerEvents, IdCaptureOverlay, IdCaptureOverlayController, IdCaptureRegion, IdCaptureScanner, IdCaptureSettings, IdCard, IdFieldType, IdImageType, IdImages, IdLayoutLineStyle, IdLayoutStyle, IdSide, MRZResult, MobileDocumentDataElement, MobileDocumentOCRResult, MobileDocumentResult, MobileDocumentScanner, Passport, ProfessionalDrivingPermit, RegionSpecific, RegionSpecificSubtype, RejectionReason, ResidencePermit, Sex, SingleSideScanner, TextHintPosition, UsRealIdStatus, VIZResult, VehicleRestriction, VerificationResult, VisaIcao, getIdDefaults, loadIdDefaults, parseIdDefaults, registerIdProxies };
2720
+ export { AamvaBarcodeVerificationResult, AamvaBarcodeVerificationStatus, BarcodeResult, CapturedId, CapturedSides, DataConsistencyCheck, DataConsistencyResult, DateResult, DriverLicense, DrivingLicenseCategory, DrivingLicenseDetails, Duration, FullDocumentScanner, HealthInsuranceCard, ID_PROXY_TYPE_NAMES, IdAnonymizationMode, IdCapture, IdCaptureController, IdCaptureDocumentType, IdCaptureFeedback, IdCaptureListenerController, IdCaptureListenerEvents, IdCaptureOverlay, IdCaptureOverlayController, IdCaptureRegion, IdCaptureScanner, IdCaptureSettings, IdCard, IdFieldType, IdImageType, IdImages, IdLayoutLineStyle, IdLayoutStyle, IdSide, MRZResult, MobileDocumentDataElement, MobileDocumentOCRResult, MobileDocumentResult, MobileDocumentScanner, Passport, ProfessionalDrivingPermit, RegionSpecific, RegionSpecificSubtype, RejectionReason, ResidencePermit, Sex, SingleSideScanner, TextHintPosition, UsRealIdStatus, VIZResult, VehicleRestriction, VerificationResult, VisaIcao, ensureIdDefaults, getIdDefaults, loadIdDefaults, parseIdDefaults, registerIdProxies, setIdDefaultsLoader };
2505
2721
  //# sourceMappingURL=index.js.map