scandit-react-native-datacapture-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/THIRD_PARTY.txt +0 -1
- package/android/build.gradle +1 -1
- package/android/src/main/kotlin/com/scandit/datacapture/reactnative/id/ScanditDataCaptureIdModule.kt +25 -68
- package/android/src/main/kotlin/com/scandit/datacapture/reactnative/id/ScanditDataCaptureIdPackage.kt +18 -4
- package/dist/dts/index.d.ts +0 -5
- package/dist/id.js +242 -26
- package/dist/id.js.map +1 -1
- package/dist/index.js +9 -7
- package/dist/index.js.flow +58 -0
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/ios/Sources/ScanditDataCaptureId.m +1 -37
- package/ios/Sources/ScanditDataCaptureId.swift +15 -93
- package/package.json +8 -5
- package/scandit-react-native-datacapture-id.podspec +37 -2
package/THIRD_PARTY.txt
CHANGED
package/android/build.gradle
CHANGED
|
@@ -75,7 +75,7 @@ if (file( "${rootProject.projectDir}/build-test.gradle").exists()) {
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
dependencies {
|
|
78
|
-
def sdk_version = "8.
|
|
78
|
+
def sdk_version = "8.2.0"
|
|
79
79
|
|
|
80
80
|
println("Version of the native sdk used in this build: ${safeExtGet("global_sdk_version", sdk_version)}")
|
|
81
81
|
api project(path: ":scandit-react-native-datacapture-core")
|
package/android/src/main/kotlin/com/scandit/datacapture/reactnative/id/ScanditDataCaptureIdModule.kt
CHANGED
|
@@ -11,17 +11,22 @@ import com.facebook.react.bridge.ReactApplicationContext
|
|
|
11
11
|
import com.facebook.react.bridge.ReactContextBaseJavaModule
|
|
12
12
|
import com.facebook.react.bridge.ReactMethod
|
|
13
13
|
import com.facebook.react.bridge.ReadableMap
|
|
14
|
-
import com.
|
|
14
|
+
import com.facebook.react.module.annotations.ReactModule
|
|
15
|
+
import com.scandit.datacapture.frameworks.core.CoreModule
|
|
16
|
+
import com.scandit.datacapture.frameworks.core.FrameworkModule
|
|
17
|
+
import com.scandit.datacapture.frameworks.core.locator.ServiceLocator
|
|
15
18
|
import com.scandit.datacapture.frameworks.id.IdCaptureModule
|
|
19
|
+
import com.scandit.datacapture.reactnative.core.utils.ReactNativeMethodCall
|
|
16
20
|
import com.scandit.datacapture.reactnative.core.utils.ReactNativeResult
|
|
17
|
-
import com.scandit.datacapture.reactnative.core.utils.modeId
|
|
18
21
|
|
|
19
|
-
|
|
22
|
+
@ReactModule(name = ScanditDataCaptureIdModule.NAME)
|
|
23
|
+
open class ScanditDataCaptureIdModule(
|
|
20
24
|
reactContext: ReactApplicationContext,
|
|
21
25
|
private val idCaptureModule: IdCaptureModule,
|
|
26
|
+
private val serviceLocator: ServiceLocator<FrameworkModule>,
|
|
22
27
|
) : ReactContextBaseJavaModule(reactContext) {
|
|
23
28
|
|
|
24
|
-
override fun getName(): String =
|
|
29
|
+
override fun getName(): String = NAME
|
|
25
30
|
|
|
26
31
|
override fun invalidate() {
|
|
27
32
|
idCaptureModule.onDestroy()
|
|
@@ -29,75 +34,26 @@ class ScanditDataCaptureIdModule(
|
|
|
29
34
|
}
|
|
30
35
|
|
|
31
36
|
@ReactMethod
|
|
32
|
-
fun
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
fun removeIdCaptureListener(readableMap: ReadableMap) {
|
|
38
|
-
idCaptureModule.removeListener(readableMap.modeId)
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
@ReactMethod
|
|
42
|
-
fun resetIdCaptureMode(readableMap: ReadableMap) {
|
|
43
|
-
idCaptureModule.resetMode(readableMap.modeId)
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
@ReactMethod
|
|
47
|
-
fun finishDidCaptureCallback(readableMap: ReadableMap) {
|
|
48
|
-
idCaptureModule.finishDidCaptureId(readableMap.modeId, readableMap.getBoolean("enabled"))
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
@ReactMethod
|
|
52
|
-
fun finishDidRejectCallback(readableMap: ReadableMap) {
|
|
53
|
-
idCaptureModule.finishDidRejectId(readableMap.modeId, readableMap.getBoolean("enabled"))
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
@ReactMethod
|
|
57
|
-
fun setModeEnabledState(readableMap: ReadableMap) {
|
|
58
|
-
idCaptureModule.setModeEnabled(readableMap.modeId, readableMap.getBoolean("enabled"))
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
@ReactMethod
|
|
62
|
-
fun updateIdCaptureOverlay(readableMap: ReadableMap, promise: Promise) {
|
|
63
|
-
val overlayJson = readableMap.getString("overlayJson") ?: return promise.reject(
|
|
64
|
-
ParameterNullError("overlayJson")
|
|
65
|
-
)
|
|
66
|
-
idCaptureModule.updateOverlay(overlayJson, ReactNativeResult(promise))
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
@ReactMethod
|
|
70
|
-
fun updateIdCaptureMode(readableMap: ReadableMap, promise: Promise) {
|
|
71
|
-
val modeJson = readableMap.getString("modeJson")
|
|
72
|
-
if (modeJson == null) {
|
|
73
|
-
promise.reject(ParameterNullError("modeJson"))
|
|
74
|
-
return
|
|
37
|
+
fun executeId(data: ReadableMap, promise: Promise) {
|
|
38
|
+
val coreModule = serviceLocator.resolve(
|
|
39
|
+
CoreModule::class.java.simpleName
|
|
40
|
+
) as? CoreModule ?: return run {
|
|
41
|
+
promise.reject("-1", "Unable to retrieve the CoreModule from the locator.")
|
|
75
42
|
}
|
|
76
|
-
idCaptureModule.updateModeFromJson(readableMap.modeId, modeJson, ReactNativeResult(promise))
|
|
77
|
-
}
|
|
78
43
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
promise.reject(ParameterNullError("settingsJson"))
|
|
84
|
-
return
|
|
85
|
-
}
|
|
86
|
-
idCaptureModule.applyModeSettings(
|
|
87
|
-
readableMap.modeId,
|
|
88
|
-
settingsJson,
|
|
89
|
-
ReactNativeResult(promise)
|
|
44
|
+
val result = coreModule.execute(
|
|
45
|
+
ReactNativeMethodCall(data),
|
|
46
|
+
ReactNativeResult(promise),
|
|
47
|
+
idCaptureModule
|
|
90
48
|
)
|
|
91
|
-
}
|
|
92
49
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
50
|
+
if (!result) {
|
|
51
|
+
val methodName = data.getString("methodName") ?: "unknown"
|
|
52
|
+
promise.reject(
|
|
53
|
+
"METHOD_NOT_FOUND",
|
|
54
|
+
"Unknown Core method: $methodName"
|
|
55
|
+
)
|
|
99
56
|
}
|
|
100
|
-
idCaptureModule.updateFeedback(readableMap.modeId, feedbackJson, ReactNativeResult(promise))
|
|
101
57
|
}
|
|
102
58
|
|
|
103
59
|
override fun getConstants(): MutableMap<String, Any> = mutableMapOf(
|
|
@@ -115,6 +71,7 @@ class ScanditDataCaptureIdModule(
|
|
|
115
71
|
}
|
|
116
72
|
|
|
117
73
|
companion object {
|
|
74
|
+
const val NAME = "ScanditDataCaptureId"
|
|
118
75
|
private const val DEFAULTS_KEY = "Defaults"
|
|
119
76
|
}
|
|
120
77
|
}
|
|
@@ -6,23 +6,37 @@
|
|
|
6
6
|
|
|
7
7
|
package com.scandit.datacapture.reactnative.id
|
|
8
8
|
|
|
9
|
-
import com.facebook.react.ReactPackage
|
|
10
9
|
import com.facebook.react.bridge.NativeModule
|
|
11
10
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
12
11
|
import com.facebook.react.uimanager.ViewManager
|
|
12
|
+
import com.scandit.datacapture.frameworks.core.locator.DefaultServiceLocator
|
|
13
13
|
import com.scandit.datacapture.frameworks.id.IdCaptureModule
|
|
14
|
+
import com.scandit.datacapture.reactnative.core.ScanditReactPackageBase
|
|
14
15
|
import com.scandit.datacapture.reactnative.core.utils.ReactNativeEventEmitter
|
|
15
16
|
|
|
16
|
-
class ScanditDataCaptureIdPackage :
|
|
17
|
+
class ScanditDataCaptureIdPackage : ScanditReactPackageBase() {
|
|
18
|
+
private val serviceLocator = DefaultServiceLocator.getInstance()
|
|
19
|
+
|
|
17
20
|
override fun createNativeModules(
|
|
18
21
|
reactContext: ReactApplicationContext
|
|
19
|
-
): MutableList<NativeModule>
|
|
20
|
-
|
|
22
|
+
): MutableList<NativeModule> {
|
|
23
|
+
val idCaptureModule = getIdCaptureModule(reactContext)
|
|
24
|
+
return mutableListOf(
|
|
25
|
+
ScanditDataCaptureIdModule(
|
|
26
|
+
reactContext,
|
|
27
|
+
idCaptureModule,
|
|
28
|
+
serviceLocator
|
|
29
|
+
)
|
|
30
|
+
)
|
|
31
|
+
}
|
|
21
32
|
|
|
22
33
|
override fun createViewManagers(
|
|
23
34
|
reactContext: ReactApplicationContext
|
|
24
35
|
): MutableList<ViewManager<*, *>> = mutableListOf()
|
|
25
36
|
|
|
37
|
+
override fun getModuleClasses(): List<Class<out NativeModule>> =
|
|
38
|
+
listOf(ScanditDataCaptureIdModule::class.java)
|
|
39
|
+
|
|
26
40
|
private fun getIdCaptureModule(reactContext: ReactApplicationContext): IdCaptureModule {
|
|
27
41
|
val emitter = ReactNativeEventEmitter(reactContext)
|
|
28
42
|
return IdCaptureModule(emitter).also {
|
package/dist/dts/index.d.ts
CHANGED
|
@@ -49,9 +49,4 @@ export { ProfessionalDrivingPermit } from 'scandit-datacapture-frameworks-id';
|
|
|
49
49
|
export { VehicleRestriction } from 'scandit-datacapture-frameworks-id';
|
|
50
50
|
export { DrivingLicenseCategory } from 'scandit-datacapture-frameworks-id';
|
|
51
51
|
export { DrivingLicenseDetails } from 'scandit-datacapture-frameworks-id';
|
|
52
|
-
export { IdCaptureController } from 'scandit-datacapture-frameworks-id';
|
|
53
|
-
export { IdCaptureListenerController } from 'scandit-datacapture-frameworks-id';
|
|
54
|
-
export { IdCaptureListenerProxy } from 'scandit-datacapture-frameworks-id';
|
|
55
|
-
export { IdCaptureListenerEvents } from 'scandit-datacapture-frameworks-id';
|
|
56
|
-
export { IdCaptureProxy } from 'scandit-datacapture-frameworks-id';
|
|
57
52
|
export * from './IdCaptureView';
|
package/dist/id.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
|
|
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('
|
|
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.
|
|
2032
|
+
return this.adapter.resetIdCaptureMode({ modeId: this.modeId });
|
|
1815
2033
|
}
|
|
1816
2034
|
setModeEnabledState(enabled) {
|
|
1817
|
-
return this.
|
|
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.
|
|
2041
|
+
return this.adapter.updateIdCaptureMode({ modeJson: JSON.stringify(this.idCapture.toJSON()), modeId: this.modeId });
|
|
1824
2042
|
}
|
|
1825
2043
|
applyIdCaptureModeSettings(newSettings) {
|
|
1826
|
-
return this.
|
|
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.
|
|
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('
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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('
|
|
2174
|
+
super('IdProxy');
|
|
1959
2175
|
this.overlay = overlay;
|
|
2176
|
+
this.adapter = new IdProxyAdapter(this._proxy);
|
|
1960
2177
|
}
|
|
1961
2178
|
updateIdCaptureOverlay(overlay) {
|
|
1962
|
-
return this.
|
|
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,13 +2710,11 @@ __decorate([
|
|
|
2492
2710
|
], IdCaptureSettings, "idCaptureDefaults", null);
|
|
2493
2711
|
|
|
2494
2712
|
const ID_PROXY_TYPE_NAMES = [
|
|
2495
|
-
'
|
|
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 };
|