@regulaforensics/document-reader 9.4.717-rc → 9.4.720-nightly
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/RNDocumentReader.podspec +2 -2
- package/android/build.gradle +2 -2
- package/android/cordova.gradle +2 -2
- package/android/src/main/java/com/regula/plugin/documentreader/JSONConstructor.kt +36 -0
- package/android/src/main/java/com/regula/plugin/documentreader/Main.kt +46 -43
- package/examples/capacitor/package-lock.json +15 -15
- package/examples/capacitor/package.json +1 -1
- package/examples/ionic/package-lock.json +208 -235
- package/examples/ionic/package.json +3 -2
- package/examples/react_native/package-lock.json +33 -30
- package/examples/react_native/package.json +1 -1
- package/ios/RGLWJSONConstructor.h +4 -0
- package/ios/RGLWJSONConstructor.m +93 -47
- package/ios/RGLWMain.h +2 -4
- package/ios/RGLWMain.m +49 -13
- package/ios/RNDocumentReader.m +2 -0
- package/package.json +1 -1
- package/plugin.xml +2 -2
- package/test/json.tsx +11 -0
- package/test/package-lock.json +1 -1
- package/test/test.tsx +4 -2
- package/www/capacitor/config/RFIDConfig.js +14 -0
- package/www/capacitor/index.js +9 -7
- package/www/capacitor/internal/bridge.js +19 -1
- package/www/capacitor/rfid/CAProtocol.js +27 -0
- package/www/capacitor/rfid/PACEProtocol.js +24 -0
- package/www/cordova.js +152 -29
- package/www/react-native/config/RFIDConfig.js +14 -0
- package/www/react-native/index.js +9 -7
- package/www/react-native/internal/bridge.js +19 -1
- package/www/react-native/rfid/CAProtocol.js +27 -0
- package/www/react-native/rfid/PACEProtocol.js +24 -0
- package/www/types/config/RFIDConfig.d.ts +35 -3
- package/www/types/index.d.ts +3 -1
- package/www/types/rfid/CAProtocol.d.ts +6 -0
- package/www/types/rfid/PACEProtocol.d.ts +5 -0
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@ionic/cordova-builders": "^12.3.0",
|
|
19
19
|
"@awesome-cordova-plugins/camera": "^8.1.0",
|
|
20
20
|
"@awesome-cordova-plugins/file": "^8.1.0",
|
|
21
|
-
"@regulaforensics/document-reader": "9.4.
|
|
21
|
+
"@regulaforensics/document-reader": "9.4.720-nightly",
|
|
22
22
|
"@regulaforensics/document-reader-core-fullauthrfid": "9.3.1817",
|
|
23
23
|
"@regulaforensics/document-reader-btdevice": "9.1.35",
|
|
24
24
|
"cordova-android": "^14.0.1",
|
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
"ajv": "^8.18.0",
|
|
32
32
|
"serialize-javascript": "^7.0.4",
|
|
33
33
|
"@angular/compiler": "^21.2.4",
|
|
34
|
-
"undici": "^7.24.0"
|
|
34
|
+
"undici": "^7.24.0",
|
|
35
|
+
"picomatch": "^4.0.4"
|
|
35
36
|
},
|
|
36
37
|
"cordova": {
|
|
37
38
|
"plugins": {
|
|
@@ -3036,9 +3036,9 @@
|
|
|
3036
3036
|
}
|
|
3037
3037
|
},
|
|
3038
3038
|
"node_modules/@xmldom/xmldom": {
|
|
3039
|
-
"version": "0.8.
|
|
3040
|
-
"resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.
|
|
3041
|
-
"integrity": "sha512-
|
|
3039
|
+
"version": "0.8.12",
|
|
3040
|
+
"resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.12.tgz",
|
|
3041
|
+
"integrity": "sha512-9k/gHF6n/pAi/9tqr3m3aqkuiNosYTurLLUtc7xQ9sxB/wm7WPygCv8GYa6mS0fLJEHhqMC1ATYhz++U/lRHqg==",
|
|
3042
3042
|
"license": "MIT",
|
|
3043
3043
|
"engines": {
|
|
3044
3044
|
"node": ">=10.0.0"
|
|
@@ -3183,9 +3183,9 @@
|
|
|
3183
3183
|
}
|
|
3184
3184
|
},
|
|
3185
3185
|
"node_modules/anymatch/node_modules/picomatch": {
|
|
3186
|
-
"version": "2.3.
|
|
3187
|
-
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.
|
|
3188
|
-
"integrity": "sha512-
|
|
3186
|
+
"version": "2.3.2",
|
|
3187
|
+
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz",
|
|
3188
|
+
"integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==",
|
|
3189
3189
|
"license": "MIT",
|
|
3190
3190
|
"engines": {
|
|
3191
3191
|
"node": ">=8.6"
|
|
@@ -3527,9 +3527,9 @@
|
|
|
3527
3527
|
}
|
|
3528
3528
|
},
|
|
3529
3529
|
"node_modules/brace-expansion": {
|
|
3530
|
-
"version": "2.0.
|
|
3531
|
-
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.
|
|
3532
|
-
"integrity": "sha512-
|
|
3530
|
+
"version": "2.0.3",
|
|
3531
|
+
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.3.tgz",
|
|
3532
|
+
"integrity": "sha512-MCV/fYJEbqx68aE58kv2cA/kiky1G8vux3OR6/jbS+jIMe/6fJWa0DTzJU7dqijOWYwHi1t29FlfYI9uytqlpA==",
|
|
3533
3533
|
"license": "MIT",
|
|
3534
3534
|
"dependencies": {
|
|
3535
3535
|
"balanced-match": "^1.0.0"
|
|
@@ -4734,9 +4734,9 @@
|
|
|
4734
4734
|
}
|
|
4735
4735
|
},
|
|
4736
4736
|
"node_modules/glob/node_modules/brace-expansion": {
|
|
4737
|
-
"version": "1.1.
|
|
4738
|
-
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.
|
|
4739
|
-
"integrity": "sha512-
|
|
4737
|
+
"version": "1.1.13",
|
|
4738
|
+
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.13.tgz",
|
|
4739
|
+
"integrity": "sha512-9ZLprWS6EENmhEOpjCYW2c8VkmOvckIJZfkr7rBW6dObmfgJ/L1GpSYW5Hpo9lDz4D1+n0Ckz8rU7FwHDQiG/w==",
|
|
4740
4740
|
"license": "MIT",
|
|
4741
4741
|
"dependencies": {
|
|
4742
4742
|
"balanced-match": "^1.0.0",
|
|
@@ -5168,9 +5168,9 @@
|
|
|
5168
5168
|
}
|
|
5169
5169
|
},
|
|
5170
5170
|
"node_modules/jest-util/node_modules/picomatch": {
|
|
5171
|
-
"version": "2.3.
|
|
5172
|
-
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.
|
|
5173
|
-
"integrity": "sha512-
|
|
5171
|
+
"version": "2.3.2",
|
|
5172
|
+
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz",
|
|
5173
|
+
"integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==",
|
|
5174
5174
|
"license": "MIT",
|
|
5175
5175
|
"engines": {
|
|
5176
5176
|
"node": ">=8.6"
|
|
@@ -6426,9 +6426,9 @@
|
|
|
6426
6426
|
}
|
|
6427
6427
|
},
|
|
6428
6428
|
"node_modules/micromatch/node_modules/picomatch": {
|
|
6429
|
-
"version": "2.3.
|
|
6430
|
-
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.
|
|
6431
|
-
"integrity": "sha512-
|
|
6429
|
+
"version": "2.3.2",
|
|
6430
|
+
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz",
|
|
6431
|
+
"integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==",
|
|
6432
6432
|
"license": "MIT",
|
|
6433
6433
|
"engines": {
|
|
6434
6434
|
"node": ">=8.6"
|
|
@@ -6596,9 +6596,9 @@
|
|
|
6596
6596
|
"license": "MIT"
|
|
6597
6597
|
},
|
|
6598
6598
|
"node_modules/node-forge": {
|
|
6599
|
-
"version": "1.
|
|
6600
|
-
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.
|
|
6601
|
-
"integrity": "sha512-
|
|
6599
|
+
"version": "1.4.0",
|
|
6600
|
+
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.4.0.tgz",
|
|
6601
|
+
"integrity": "sha512-LarFH0+6VfriEhqMMcLX2F7SwSXeWwnEAJEsYm5QKWchiVYVvJyV9v7UDvUv+w5HO23ZpQTXDv/GxdDdMyOuoQ==",
|
|
6602
6602
|
"license": "(BSD-3-Clause OR GPL-2.0)",
|
|
6603
6603
|
"engines": {
|
|
6604
6604
|
"node": ">= 6.13.0"
|
|
@@ -6953,9 +6953,9 @@
|
|
|
6953
6953
|
"license": "ISC"
|
|
6954
6954
|
},
|
|
6955
6955
|
"node_modules/picomatch": {
|
|
6956
|
-
"version": "3.0.
|
|
6957
|
-
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-3.0.
|
|
6958
|
-
"integrity": "sha512-
|
|
6956
|
+
"version": "3.0.2",
|
|
6957
|
+
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-3.0.2.tgz",
|
|
6958
|
+
"integrity": "sha512-cfDHL6LStTEKlNilboNtobT/kEa30PtAf2Q1OgszfrG/rpVl1xaFWT9ktfkS306GmHgmnad1Sw4wabhlvFtsTw==",
|
|
6959
6959
|
"license": "MIT",
|
|
6960
6960
|
"engines": {
|
|
6961
6961
|
"node": ">=10"
|
|
@@ -8204,9 +8204,9 @@
|
|
|
8204
8204
|
}
|
|
8205
8205
|
},
|
|
8206
8206
|
"node_modules/test-exclude/node_modules/brace-expansion": {
|
|
8207
|
-
"version": "1.1.
|
|
8208
|
-
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.
|
|
8209
|
-
"integrity": "sha512-
|
|
8207
|
+
"version": "1.1.13",
|
|
8208
|
+
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.13.tgz",
|
|
8209
|
+
"integrity": "sha512-9ZLprWS6EENmhEOpjCYW2c8VkmOvckIJZfkr7rBW6dObmfgJ/L1GpSYW5Hpo9lDz4D1+n0Ckz8rU7FwHDQiG/w==",
|
|
8210
8210
|
"license": "MIT",
|
|
8211
8211
|
"dependencies": {
|
|
8212
8212
|
"balanced-match": "^1.0.0",
|
|
@@ -8706,15 +8706,18 @@
|
|
|
8706
8706
|
"license": "ISC"
|
|
8707
8707
|
},
|
|
8708
8708
|
"node_modules/yaml": {
|
|
8709
|
-
"version": "2.8.
|
|
8710
|
-
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.
|
|
8711
|
-
"integrity": "sha512-
|
|
8709
|
+
"version": "2.8.3",
|
|
8710
|
+
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.3.tgz",
|
|
8711
|
+
"integrity": "sha512-AvbaCLOO2Otw/lW5bmh9d/WEdcDFdQp2Z2ZUH3pX9U2ihyUY0nvLv7J6TrWowklRGPYbB/IuIMfYgxaCPg5Bpg==",
|
|
8712
8712
|
"license": "ISC",
|
|
8713
8713
|
"bin": {
|
|
8714
8714
|
"yaml": "bin.mjs"
|
|
8715
8715
|
},
|
|
8716
8716
|
"engines": {
|
|
8717
8717
|
"node": ">= 14.6"
|
|
8718
|
+
},
|
|
8719
|
+
"funding": {
|
|
8720
|
+
"url": "https://github.com/sponsors/eemeli"
|
|
8718
8721
|
}
|
|
8719
8722
|
},
|
|
8720
8723
|
"node_modules/yargs": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"start": "expo start"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@regulaforensics/document-reader": "9.4.
|
|
11
|
+
"@regulaforensics/document-reader": "9.4.720-nightly",
|
|
12
12
|
"@regulaforensics/document-reader-core-fullauthrfid": "9.3.1817",
|
|
13
13
|
"@regulaforensics/document-reader-btdevice": "9.1.35",
|
|
14
14
|
"react-native": "^0.81.4",
|
|
@@ -198,6 +198,10 @@
|
|
|
198
198
|
+(NSDictionary* _Nullable)generateDocumentRequestMDL:(RGLDocumentRequestMDL* _Nullable)input;
|
|
199
199
|
+(RGLFinalizeConfig* _Nullable)finalizeConfigFromJson:(NSDictionary* _Nullable)input;
|
|
200
200
|
+(NSDictionary* _Nullable)generateFinalizeConfig:(RGLFinalizeConfig* _Nullable)input;
|
|
201
|
+
+(RGLRFIDAccessControlPACE* _Nullable)paceProtocolFromJson:(NSDictionary* _Nullable)input;
|
|
202
|
+
+(NSDictionary* _Nullable)generatePaceProtocol:(RGLRFIDAccessControlPACE* _Nullable)input;
|
|
203
|
+
+(RGLRFIDAccessControlCA* _Nullable)caProtocolFromJson:(NSDictionary* _Nullable)input;
|
|
204
|
+
+(NSDictionary* _Nullable)generateCaProtocol:(RGLRFIDAccessControlCA* _Nullable)input;
|
|
201
205
|
|
|
202
206
|
@end
|
|
203
207
|
|
|
@@ -61,22 +61,22 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
61
61
|
+(NSDictionary*)generateError:(NSError*)input {
|
|
62
62
|
if(input == nil) return nil;
|
|
63
63
|
NSMutableDictionary *result = [NSMutableDictionary new];
|
|
64
|
-
|
|
64
|
+
|
|
65
65
|
result[@"code"] = [NSNumber numberWithInteger:input.code];
|
|
66
66
|
result[@"message"] = input.localizedDescription;
|
|
67
|
-
|
|
67
|
+
|
|
68
68
|
return result;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
+(NSString*)generateCompletion:(NSNumber*)action :(RGLDocumentReaderResults*)results :(NSError*)error {
|
|
72
72
|
NSMutableDictionary *result = [NSMutableDictionary new];
|
|
73
73
|
int actionInt = [action intValue];
|
|
74
|
-
|
|
74
|
+
|
|
75
75
|
if(actionInt == 0 || actionInt == 2 || actionInt == 3 || actionInt == 4 || actionInt == 6)
|
|
76
76
|
result[@"results"] = [self generateDocumentReaderResults:results];
|
|
77
77
|
result[@"action"] = action;
|
|
78
78
|
result[@"error"] = [self generateError:error];
|
|
79
|
-
|
|
79
|
+
|
|
80
80
|
return [RGLWJSONConstructor dictToString: result];
|
|
81
81
|
}
|
|
82
82
|
|
|
@@ -100,11 +100,11 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
100
100
|
|
|
101
101
|
+(NSString*)generateFinalizePackageCompletion:(NSNumber*)action :(RGLTransactionInfo*)info :(NSError*)error {
|
|
102
102
|
NSMutableDictionary *result = [NSMutableDictionary new];
|
|
103
|
-
|
|
103
|
+
|
|
104
104
|
result[@"action"] = action;
|
|
105
105
|
result[@"info"] = [self generateTransactionInfo:info];
|
|
106
106
|
result[@"error"] = [self generateError:error];
|
|
107
|
-
|
|
107
|
+
|
|
108
108
|
return [RGLWJSONConstructor dictToString: result];
|
|
109
109
|
}
|
|
110
110
|
|
|
@@ -158,12 +158,12 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
158
158
|
if (!input) return nil;
|
|
159
159
|
if (!input[@"license"]) return nil;
|
|
160
160
|
RGLConfig *config = [[RGLConfig alloc] initWithLicenseData:[self base64Decode: input[@"license"]]];
|
|
161
|
-
|
|
161
|
+
|
|
162
162
|
if (input[@"databasePath"]) config.databasePath = input[@"databasePath"];
|
|
163
163
|
if (input[@"licenseUpdateTimeout"]) config.licenseUpdateTimeout = input[@"licenseUpdateTimeout"];
|
|
164
164
|
if (input[@"licenseUpdate"]) config.licenseUpdateCheck = [input[@"licenseUpdate"] boolValue];
|
|
165
165
|
if (input[@"delayedNNLoad"]) config.delayedNNLoadEnabled = [input[@"delayedNNLoad"] boolValue];
|
|
166
|
-
|
|
166
|
+
|
|
167
167
|
return config;
|
|
168
168
|
}
|
|
169
169
|
|
|
@@ -176,19 +176,19 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
176
176
|
result[@"licenseUpdateTimeout"] = input.licenseUpdateTimeout;
|
|
177
177
|
result[@"licenseUpdate"] = @(input.licenseUpdateCheck);
|
|
178
178
|
result[@"delayedNNLoad"] = @(input.delayedNNLoadEnabled);
|
|
179
|
-
|
|
179
|
+
|
|
180
180
|
return result;
|
|
181
181
|
}
|
|
182
182
|
|
|
183
183
|
+(RGLBleConfig*)bleDeviceConfigFromJson:(NSDictionary*)input :(RGLBluetooth*)bluetooth {
|
|
184
184
|
if (!input) return nil;
|
|
185
185
|
RGLBleConfig *config = [[RGLBleConfig alloc] initWithBluetooth:bluetooth];
|
|
186
|
-
|
|
186
|
+
|
|
187
187
|
if (input[@"databasePath"]) config.databasePath = input[@"databasePath"];
|
|
188
188
|
if (input[@"licenseUpdateTimeout"]) config.licenseUpdateTimeout = input[@"licenseUpdateTimeout"];
|
|
189
189
|
if (input[@"licenseUpdate"]) config.licenseUpdateCheck = [input[@"licenseUpdate"] boolValue];
|
|
190
190
|
if (input[@"delayedNNLoad"]) config.delayedNNLoadEnabled = [input[@"delayedNNLoad"] boolValue];
|
|
191
|
-
|
|
191
|
+
|
|
192
192
|
return config;
|
|
193
193
|
}
|
|
194
194
|
|
|
@@ -223,7 +223,7 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
223
223
|
RGLRecognizeConfig *config = [RGLRecognizeConfig alloc];
|
|
224
224
|
if (input[@"scenario"]) config = [config initWithScenario:input[@"scenario"]];
|
|
225
225
|
else config = [config initWithOnlineProcessingConfig:[self onlineProcessingConfigFromJson:input[@"onlineProcessingConfig"]]];
|
|
226
|
-
|
|
226
|
+
|
|
227
227
|
if (input[@"image"]) config.image = [RGLWJSONConstructor imageWithBase64:input[@"image"]];
|
|
228
228
|
if (input[@"data"]) config.imageData = [RGLWJSONConstructor base64Decode:input[@"data"]];
|
|
229
229
|
if (input[@"images"]) {
|
|
@@ -238,13 +238,13 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
238
238
|
[imageInputs addObject:[RGLWJSONConstructor imageInputFromJson: imageInput]];
|
|
239
239
|
config.imageInputs = imageInputs;
|
|
240
240
|
}
|
|
241
|
-
|
|
241
|
+
|
|
242
242
|
if (input[@"scenario"]) config.scenario = input[@"scenario"];
|
|
243
243
|
if (input[@"livePortrait"]) config.livePortrait = [self imageWithBase64:input[@"livePortrait"]];
|
|
244
244
|
if (input[@"extPortrait"]) config.extPortrait = [self imageWithBase64:input[@"extPortrait"]];
|
|
245
245
|
if (input[@"oneShotIdentification"]) config.oneShotIdentification = input[@"oneShotIdentification"];
|
|
246
246
|
if (input[@"dtc"]) config.dtc = [RGLWJSONConstructor base64Decode:input[@"dtc"]];
|
|
247
|
-
|
|
247
|
+
|
|
248
248
|
return config;
|
|
249
249
|
}
|
|
250
250
|
|
|
@@ -533,10 +533,10 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
533
533
|
|
|
534
534
|
+(RGLRFIDParams*)rfidParamsFromJson:(NSDictionary*)input {
|
|
535
535
|
RGLRFIDParams* result = [RGLRFIDParams new];
|
|
536
|
-
|
|
536
|
+
|
|
537
537
|
if([input valueForKey:@"paIgnoreNotificationCodes"] != nil)
|
|
538
538
|
result.paIgnoreNotificationCodes = [input valueForKey:@"paIgnoreNotificationCodes"];
|
|
539
|
-
|
|
539
|
+
|
|
540
540
|
return result;
|
|
541
541
|
}
|
|
542
542
|
|
|
@@ -561,7 +561,7 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
561
561
|
|
|
562
562
|
+(RGLFaceAPIParams*)faceAPIParamsFromJson:(NSDictionary*)input {
|
|
563
563
|
RGLFaceAPIParams* result = [RGLFaceAPIParams defaultParams];
|
|
564
|
-
|
|
564
|
+
|
|
565
565
|
if([input valueForKey:@"url"] != nil)
|
|
566
566
|
result.url = [input valueForKey:@"url"];
|
|
567
567
|
if([input valueForKey:@"mode"] != nil)
|
|
@@ -578,7 +578,7 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
578
578
|
result.proxyPassword = [input valueForKey:@"proxyPassword"];
|
|
579
579
|
if([input valueForKey:@"proxyType"] != nil)
|
|
580
580
|
result.proxyType = [input valueForKey:@"proxyType"];
|
|
581
|
-
|
|
581
|
+
|
|
582
582
|
return result;
|
|
583
583
|
}
|
|
584
584
|
|
|
@@ -600,14 +600,14 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
600
600
|
|
|
601
601
|
+(RGLFaceAPISearchParams*)faceAPISearchParamsFromJson:(NSDictionary*)input {
|
|
602
602
|
RGLFaceAPISearchParams* result = [RGLFaceAPISearchParams new];
|
|
603
|
-
|
|
603
|
+
|
|
604
604
|
if([input valueForKey:@"limit"] != nil)
|
|
605
605
|
result.limit = [input valueForKey:@"limit"];
|
|
606
606
|
if([input valueForKey:@"threshold"] != nil)
|
|
607
607
|
result.threshold = [input valueForKey:@"threshold"];
|
|
608
608
|
if([input valueForKey:@"groupIds"] != nil)
|
|
609
609
|
result.groupIDs = [input valueForKey:@"groupIds"];
|
|
610
|
-
|
|
610
|
+
|
|
611
611
|
return result;
|
|
612
612
|
}
|
|
613
613
|
|
|
@@ -1055,7 +1055,7 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
1055
1055
|
result[@"notificationCode"] = @(input.code & -0x10000);
|
|
1056
1056
|
result[@"dataFileType"] = @((int)input.attachment);
|
|
1057
1057
|
result[@"progress"] = @((int)input.value);
|
|
1058
|
-
|
|
1058
|
+
|
|
1059
1059
|
return [RGLWJSONConstructor dictToString: result];
|
|
1060
1060
|
}
|
|
1061
1061
|
|
|
@@ -1714,10 +1714,10 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
1714
1714
|
+(NSDictionary*)generateDataField:(RGLDataField*)input {
|
|
1715
1715
|
NSMutableDictionary *result = [NSMutableDictionary new];
|
|
1716
1716
|
if(input == nil) return nil;
|
|
1717
|
-
|
|
1717
|
+
|
|
1718
1718
|
result[@"data"] = input.data;
|
|
1719
1719
|
result[@"fieldType"] = @(input.fieldType);
|
|
1720
|
-
|
|
1720
|
+
|
|
1721
1721
|
return result;
|
|
1722
1722
|
}
|
|
1723
1723
|
|
|
@@ -1835,7 +1835,7 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
1835
1835
|
for(NSDictionary* item in [input valueForKey:@"checks"])
|
|
1836
1836
|
[array addObject:[self authenticityCheckFromJson:item]];
|
|
1837
1837
|
RGLDocumentReaderAuthenticityResult* result = [[RGLDocumentReaderAuthenticityResult alloc]
|
|
1838
|
-
|
|
1838
|
+
initWithAuthenticityChecks:array];
|
|
1839
1839
|
if (input[@"status"]) [result setValue:input[@"status"] forKey:@"_security"];
|
|
1840
1840
|
return result;
|
|
1841
1841
|
}
|
|
@@ -2434,7 +2434,7 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
2434
2434
|
for (NSString* key in map) {
|
|
2435
2435
|
[result addField:key intentToRetain:[map[key] integerValue]];
|
|
2436
2436
|
}
|
|
2437
|
-
|
|
2437
|
+
|
|
2438
2438
|
return result;
|
|
2439
2439
|
|
|
2440
2440
|
}
|
|
@@ -2459,7 +2459,7 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
2459
2459
|
[nameSpaces addObject:[self nameSpaceMDLFromJson: item]];
|
|
2460
2460
|
}
|
|
2461
2461
|
[result setValue:nameSpaces forKey:@"nameSpaces"];
|
|
2462
|
-
|
|
2462
|
+
|
|
2463
2463
|
return result;
|
|
2464
2464
|
|
|
2465
2465
|
}
|
|
@@ -2632,7 +2632,7 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
2632
2632
|
if (input[@"video"]) result.video = [input[@"video"] boolValue];
|
|
2633
2633
|
if (input[@"rfidSession"]) result.rfidSession = [input[@"rfidSession"] boolValue];
|
|
2634
2634
|
if (input[@"mdlSession"]) result.mdlSession = [input[@"mdlSession"] boolValue];
|
|
2635
|
-
|
|
2635
|
+
|
|
2636
2636
|
return result;
|
|
2637
2637
|
}
|
|
2638
2638
|
|
|
@@ -2648,6 +2648,52 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
2648
2648
|
return result;
|
|
2649
2649
|
}
|
|
2650
2650
|
|
|
2651
|
+
+(RGLRFIDAccessControlPACE*)paceProtocolFromJson:(NSDictionary*)input {
|
|
2652
|
+
NSMutableDictionary* json = input.mutableCopy;
|
|
2653
|
+
|
|
2654
|
+
json[@"Version"] = input[@"version"];
|
|
2655
|
+
json[@"StdDomainParams"] = input[@"stdDomainParams"];
|
|
2656
|
+
json[@"KeyAlgorithm"] = input[@"keyAlgorithm"];
|
|
2657
|
+
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
|
|
2658
|
+
return [[RGLRFIDAccessControlPACE alloc] performSelector:NSSelectorFromString(@"initWithJSON:") withObject:json];
|
|
2659
|
+
#pragma clang diagnostic pop
|
|
2660
|
+
}
|
|
2661
|
+
|
|
2662
|
+
+(NSDictionary*)generatePaceProtocol:(RGLRFIDAccessControlPACE*)input {
|
|
2663
|
+
if(input == nil) return nil;
|
|
2664
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
2665
|
+
|
|
2666
|
+
result[@"version"] = [NSString stringWithFormat:@"%ld", (long)input.version];
|
|
2667
|
+
result[@"stdDomainParams"] = input.stdDomainParams;
|
|
2668
|
+
result[@"keyAlgorithm"] = input.keyAlgorithm;
|
|
2669
|
+
|
|
2670
|
+
return result;
|
|
2671
|
+
}
|
|
2672
|
+
|
|
2673
|
+
+(RGLRFIDAccessControlCA*)caProtocolFromJson:(NSDictionary*)input {
|
|
2674
|
+
NSMutableDictionary* json = input.mutableCopy;
|
|
2675
|
+
|
|
2676
|
+
json[@"Version"] = input[@"version"];
|
|
2677
|
+
json[@"Scheme"] = input[@"scheme"];
|
|
2678
|
+
json[@"KeyAlgorithm"] = input[@"keyAlgorithm"];
|
|
2679
|
+
json[@"ChipIndividual"] = input[@"chipIndividual"];
|
|
2680
|
+
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
|
|
2681
|
+
return [[RGLRFIDAccessControlCA alloc] performSelector:NSSelectorFromString(@"initWithJSON:") withObject:json];
|
|
2682
|
+
#pragma clang diagnostic pop
|
|
2683
|
+
}
|
|
2684
|
+
|
|
2685
|
+
+(NSDictionary*)generateCaProtocol:(RGLRFIDAccessControlCA*)input {
|
|
2686
|
+
if(input == nil) return nil;
|
|
2687
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
2688
|
+
|
|
2689
|
+
result[@"version"] = [NSString stringWithFormat:@"%ld", (long)input.version];
|
|
2690
|
+
result[@"scheme"] = input.scheme;
|
|
2691
|
+
result[@"keyAlgorithm"] = input.keyAlgorithm;
|
|
2692
|
+
result[@"chipIndividual"] = [NSNumber numberWithBool: input.chipIndividual];
|
|
2693
|
+
|
|
2694
|
+
return result;
|
|
2695
|
+
}
|
|
2696
|
+
|
|
2651
2697
|
+(RGLDocumentReaderResults*)documentReaderResultsFromJson:(NSDictionary*)input {
|
|
2652
2698
|
NSMutableArray<RGLDocumentReaderDocumentType*>* documentType = [NSMutableArray new];
|
|
2653
2699
|
for(NSDictionary* item in [input valueForKey:@"documentType"]){
|
|
@@ -2671,26 +2717,26 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
2671
2717
|
}
|
|
2672
2718
|
|
|
2673
2719
|
RGLDocumentReaderResults* result = [[RGLDocumentReaderResults alloc]
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2720
|
+
initWithDocumentTypes:documentType
|
|
2721
|
+
textResult:[self documentReaderTextResultFromJson: [input valueForKey:@"textResult"]]
|
|
2722
|
+
graphicResult:[self documentReaderGraphicResultFromJson: [input valueForKey:@"graphicResult"]]
|
|
2723
|
+
rawResult:[input valueForKey:@"rawResult"]
|
|
2724
|
+
documentPosition:documentPosition
|
|
2725
|
+
barcodePosition:barcodePosition
|
|
2726
|
+
mrzPosition:mrzPosition
|
|
2727
|
+
imageQualityGroup:imageQuality
|
|
2728
|
+
authenticityResults:[self documentReaderAuthenticityResultFromJson: [input valueForKey:@"authenticityResult"]]
|
|
2729
|
+
rfidSessionData:[self rfidSessionDataFromJson: [input valueForKey:@"rfidSessionData"]]
|
|
2730
|
+
chipPage:[[input valueForKey:@"chipPage"] integerValue]
|
|
2731
|
+
barcodeResult:[self documentReaderBarcodeResultFromJson: [input valueForKey:@"barcodeResult"]]
|
|
2732
|
+
vdsncData:[self vdsncDataFromJson: [input valueForKey:@"vdsncData"]]
|
|
2733
|
+
vdsData:[self vdsDataFromJson: [input valueForKey:@"vdsData"]]
|
|
2734
|
+
status:[self documentReaderResultsStatusFromJson: [input valueForKey:@"status"]]
|
|
2735
|
+
processingFinished:[[input valueForKey:@"processingFinishedStatus"] integerValue]
|
|
2736
|
+
morePagesAvailable:[[input valueForKey:@"morePagesAvailable"] integerValue]
|
|
2737
|
+
elapsedTime:[[input valueForKey:@"elapsedTime"] integerValue]
|
|
2738
|
+
elapsedTimeRFID:[[input valueForKey:@"elapsedTimeRFID"] integerValue]
|
|
2739
|
+
transactionInfo:[self transactionInfoFromJson:[input valueForKey:@"transactionInfo"]]];
|
|
2694
2740
|
|
|
2695
2741
|
[result setValue:[RGLWJSONConstructor base64Decode:input[@"dtcData"]] forKey:@"dtcData"];
|
|
2696
2742
|
[result setValue:input[@"bsiTr03135Results"] forKey:@"bsiTr03135Results"];
|
package/ios/RGLWMain.h
CHANGED
|
@@ -18,10 +18,6 @@ extern UIViewController*_Nonnull(^ _Nonnull RGLWRootViewController)(void);
|
|
|
18
18
|
:(RGLWCallback _Nonnull)callback
|
|
19
19
|
:(RGLWEventSender _Nonnull)eventSender;
|
|
20
20
|
|
|
21
|
-
@property NSNumber* _Nonnull doRequestPACertificates;
|
|
22
|
-
@property NSNumber* _Nonnull doRequestTACertificates;
|
|
23
|
-
@property NSNumber* _Nonnull doRequestTASignature;
|
|
24
|
-
|
|
25
21
|
@end
|
|
26
22
|
|
|
27
23
|
static NSString* _Nonnull completionEvent = @"completion";
|
|
@@ -32,5 +28,7 @@ static NSString* _Nonnull rfidOnRetryReadChipEvent = @"rfidOnRetryReadChipEvent"
|
|
|
32
28
|
static NSString* _Nonnull paCertificateCompletionEvent = @"pa_certificate_completion";
|
|
33
29
|
static NSString* _Nonnull taCertificateCompletionEvent = @"ta_certificate_completion";
|
|
34
30
|
static NSString* _Nonnull taSignatureCompletionEvent = @"ta_signature_completion";
|
|
31
|
+
static NSString* _Nonnull paceProtocolCompletionEvent = @"paceProtocolCompletionEvent";
|
|
32
|
+
static NSString* _Nonnull caProtocolCompletionEvent = @"caProtocolCompletionEvent";
|
|
35
33
|
static NSString* _Nonnull drVideoEncoderCompletionEvent = @"video_encoder_completion";
|
|
36
34
|
static NSString* _Nonnull drOnCustomButtonTappedEvent = @"onCustomButtonTappedEvent";
|
package/ios/RGLWMain.m
CHANGED
|
@@ -41,12 +41,14 @@
|
|
|
41
41
|
@"recognize": ^{ [self recognize :args[0]]; },
|
|
42
42
|
@"startNewPage": ^{ [self startNewPage]; },
|
|
43
43
|
@"stopScanner": ^{ [self stopScanner]; },
|
|
44
|
-
@"startRFIDReader": ^{ [self startRFIDReader :args[0]
|
|
45
|
-
@"readRFID": ^{ [self readRFID :args[0]
|
|
44
|
+
@"startRFIDReader": ^{ [self startRFIDReader :args[0]]; },
|
|
45
|
+
@"readRFID": ^{ [self readRFID :args[0]]; },
|
|
46
46
|
@"stopRFIDReader": ^{ [self stopRFIDReader]; },
|
|
47
47
|
@"providePACertificates": ^{ [self providePACertificates :args[0]]; },
|
|
48
48
|
@"provideTACertificates": ^{ [self provideTACertificates :args[0]]; },
|
|
49
49
|
@"provideTASignature": ^{ [self provideTASignature :args[0]]; },
|
|
50
|
+
@"selectPACEProtocol": ^{ [self selectPACEProtocol :args[0]]; },
|
|
51
|
+
@"selectCAProtocol": ^{ [self selectCAProtocol :args[0]]; },
|
|
50
52
|
@"setTCCParams": ^{ [self setTCCParams :args[0] :callback]; },
|
|
51
53
|
@"addPKDCertificates": ^{ [self addPKDCertificates :args[0]]; },
|
|
52
54
|
@"clearPKDCertificates": ^{ [self clearPKDCertificates]; },
|
|
@@ -249,19 +251,15 @@ static NSDictionary* headers;
|
|
|
249
251
|
});
|
|
250
252
|
}
|
|
251
253
|
|
|
252
|
-
+(void)startRFIDReader:(
|
|
253
|
-
|
|
254
|
-
this.doRequestTACertificates = taCert;
|
|
255
|
-
this.doRequestTASignature = taSig;
|
|
254
|
+
+(void)startRFIDReader:(NSDictionary*)config {
|
|
255
|
+
rfidReaderRequest = config;
|
|
256
256
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
257
257
|
[RGLDocReader.shared startRFIDReaderFromPresenter:RGLWRootViewController() completion:[self completion]];
|
|
258
258
|
});
|
|
259
259
|
}
|
|
260
260
|
|
|
261
|
-
+(void)readRFID:(
|
|
262
|
-
|
|
263
|
-
this.doRequestTACertificates = taCert;
|
|
264
|
-
this.doRequestTASignature = taSig;
|
|
261
|
+
+(void)readRFID:(NSDictionary*)config {
|
|
262
|
+
rfidReaderRequest = config;
|
|
265
263
|
[RGLDocReader.shared readRFID:^(RGLRFIDNotificationAction notificationAction, RGLRFIDNotify* _Nullable notification) {
|
|
266
264
|
if (notification != nil) sendEvent(rfidOnProgressEvent, [RGLWJSONConstructor generateDocumentReaderNotification:notification]);
|
|
267
265
|
} completion :^(RGLRFIDCompleteAction action, RGLDocumentReaderResults * _Nullable results, NSError * _Nullable error, RGLRFIDErrorCodes errorCode) {
|
|
@@ -291,6 +289,14 @@ static NSDictionary* headers;
|
|
|
291
289
|
taSignatureCompletion([RGLWJSONConstructor base64Decode:signature]);
|
|
292
290
|
}
|
|
293
291
|
|
|
292
|
+
+(void)selectPACEProtocol:(NSDictionary*)protocol {
|
|
293
|
+
paceProtocolCompletion([RGLWJSONConstructor paceProtocolFromJson:protocol]);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
+(void)selectCAProtocol:(NSDictionary*)protocol {
|
|
297
|
+
caProtocolCompletion([RGLWJSONConstructor caProtocolFromJson:protocol]);
|
|
298
|
+
}
|
|
299
|
+
|
|
294
300
|
+(void)setTCCParams:(NSDictionary*)params :(RGLWCallback)callback {
|
|
295
301
|
[RGLDocReader.shared setTCCParams:[RGLWJSONConstructor tccParamsFromJson:params] completion:^(BOOL success, NSError * _Nullable error) {
|
|
296
302
|
callback([RGLWJSONConstructor generateSuccessCompletion:success :error]);
|
|
@@ -626,9 +632,13 @@ RGLWCallback savedCallbackForBluetoothResult;
|
|
|
626
632
|
RGLRFIDCertificatesCallback paCertificateCompletion;
|
|
627
633
|
RGLRFIDCertificatesCallback taCertificateCompletion;
|
|
628
634
|
RGLWRFIDSignatureCallback taSignatureCompletion;
|
|
635
|
+
RGLRFIDAccessControlPACECallback paceProtocolCompletion;
|
|
636
|
+
RGLRFIDAccessControlCACallback caProtocolCompletion;
|
|
637
|
+
|
|
638
|
+
NSDictionary* rfidReaderRequest;
|
|
629
639
|
|
|
630
640
|
- (void)onRequestPACertificatesWithSerial:(NSData *)serialNumber issuer:(RGLPAResourcesIssuer *)issuer callback:(RGLRFIDCertificatesCallback)callback {
|
|
631
|
-
if([
|
|
641
|
+
if (rfidReaderRequest && [rfidReaderRequest[@"paCertificates"] boolValue]) {
|
|
632
642
|
paCertificateCompletion = callback;
|
|
633
643
|
sendEvent(paCertificateCompletionEvent, [RGLWJSONConstructor generatePACertificateCompletion:serialNumber :issuer]);
|
|
634
644
|
} else {
|
|
@@ -638,7 +648,7 @@ RGLWRFIDSignatureCallback taSignatureCompletion;
|
|
|
638
648
|
}
|
|
639
649
|
|
|
640
650
|
- (void)onRequestTACertificatesWithKey:(NSString *)keyCAR callback:(RGLRFIDCertificatesCallback)callback {
|
|
641
|
-
if([
|
|
651
|
+
if (rfidReaderRequest && [rfidReaderRequest[@"taCertificates"] boolValue]) {
|
|
642
652
|
taCertificateCompletion = callback;
|
|
643
653
|
sendEvent(taCertificateCompletionEvent, keyCAR);
|
|
644
654
|
} else {
|
|
@@ -648,7 +658,7 @@ RGLWRFIDSignatureCallback taSignatureCompletion;
|
|
|
648
658
|
}
|
|
649
659
|
|
|
650
660
|
- (void)onRequestTASignatureWithChallenge:(RGLTAChallenge *)challenge callback:(void(^)(NSData *signature))callback {
|
|
651
|
-
if([
|
|
661
|
+
if (rfidReaderRequest && [rfidReaderRequest[@"taSignature"] boolValue]) {
|
|
652
662
|
taSignatureCompletion = callback;
|
|
653
663
|
sendEvent(taSignatureCompletionEvent, [RGLWJSONConstructor dictToString: [RGLWJSONConstructor generateTAChallenge:challenge]]);
|
|
654
664
|
} else {
|
|
@@ -657,6 +667,32 @@ RGLWRFIDSignatureCallback taSignatureCompletion;
|
|
|
657
667
|
}
|
|
658
668
|
}
|
|
659
669
|
|
|
670
|
+
- (void)onRequestPACEProtocolWithOptions:(NSArray<RGLRFIDAccessControlPACE*>*)protocols callback:(RGLRFIDAccessControlPACECallback)callback {
|
|
671
|
+
if (rfidReaderRequest && [rfidReaderRequest[@"paceProtocol"] boolValue]) {
|
|
672
|
+
paceProtocolCompletion = callback;
|
|
673
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
674
|
+
for(RGLRFIDAccessControlPACE* item in protocols)
|
|
675
|
+
[array addObject:[RGLWJSONConstructor generatePaceProtocol:item]];
|
|
676
|
+
sendEvent(paceProtocolCompletionEvent, [RGLWJSONConstructor arrayToString: array]);
|
|
677
|
+
} else {
|
|
678
|
+
paceProtocolCompletion = nil;
|
|
679
|
+
callback(nil);
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
- (void)onRequestCAProtocolWithOptions:(NSArray<RGLRFIDAccessControlCA*>*)protocols callback:(RGLRFIDAccessControlCACallback)callback {
|
|
684
|
+
if (rfidReaderRequest && [rfidReaderRequest[@"caProtocol"] boolValue]) {
|
|
685
|
+
caProtocolCompletion = callback;
|
|
686
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
687
|
+
for(RGLRFIDAccessControlCA* item in protocols)
|
|
688
|
+
[array addObject:[RGLWJSONConstructor generateCaProtocol:item]];
|
|
689
|
+
sendEvent(caProtocolCompletionEvent, [RGLWJSONConstructor arrayToString: array]);
|
|
690
|
+
} else {
|
|
691
|
+
caProtocolCompletionEvent = nil;
|
|
692
|
+
callback(nil);
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
|
|
660
696
|
- (void)didChipConnected {
|
|
661
697
|
sendEvent(rfidOnChipDetectedEvent, @"");
|
|
662
698
|
}
|
package/ios/RNDocumentReader.m
CHANGED
|
@@ -18,6 +18,8 @@ static NSMutableArray<RCTResponseSenderBlock>* _firedCallbacks = nil;
|
|
|
18
18
|
paCertificateCompletionEvent,
|
|
19
19
|
taCertificateCompletionEvent,
|
|
20
20
|
taSignatureCompletionEvent,
|
|
21
|
+
paceProtocolCompletionEvent,
|
|
22
|
+
caProtocolCompletionEvent,
|
|
21
23
|
drVideoEncoderCompletionEvent,
|
|
22
24
|
drOnCustomButtonTappedEvent];
|
|
23
25
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@regulaforensics/document-reader",
|
|
3
|
-
"version": "9.4.
|
|
3
|
+
"version": "9.4.720-nightly",
|
|
4
4
|
"description": "This is an npm module for Regula Document Reader SDK. It allows you to read various kinds of identification documents using your phone's camera.",
|
|
5
5
|
"main": "www/react-native/index.js",
|
|
6
6
|
"module": "www/capacitor/index.js",
|