@regulaforensics/document-reader 9.10.1289-rc → 9.10.1297-rc

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.
Files changed (44) hide show
  1. package/Package.swift +2 -2
  2. package/android/src/main/kotlin/com/regula/plugin/document/reader/Config.kt +2 -0
  3. package/android/src/main/kotlin/com/regula/plugin/document/reader/JSONConstructor.kt +10 -18
  4. package/android/src/main/kotlin/com/regula/plugin/document/reader/Main.kt +10 -0
  5. package/examples/capacitor/ios/App/App.xcodeproj/project.pbxproj +4 -4
  6. package/examples/capacitor/package-lock.json +114 -107
  7. package/examples/capacitor/package.json +1 -1
  8. package/examples/ionic/config.xml +1 -1
  9. package/examples/ionic/package-lock.json +581 -1100
  10. package/examples/ionic/package.json +19 -2
  11. package/examples/react_native/package-lock.json +398 -758
  12. package/examples/react_native/package.json +9 -2
  13. package/examples/react_native/scripts/withoutMetroServer.js +11 -8
  14. package/ios/RGLWConfig.m +2 -0
  15. package/ios/RGLWJSONConstructor.m +1 -0
  16. package/ios/RGLWMain.h +1 -0
  17. package/ios/RGLWMain.m +16 -0
  18. package/ios/RNDocumentReader.m +1 -0
  19. package/package.json +1 -1
  20. package/plugin.xml +3 -3
  21. package/react-native-document-reader.podspec +3 -3
  22. package/test/json.tsx +6 -6
  23. package/test/test.tsx +259 -261
  24. package/www/capacitor/config/RFIDConfig.js +2 -0
  25. package/www/capacitor/index.js +2 -0
  26. package/www/capacitor/internal/bridge.js +8 -0
  27. package/www/capacitor/params/process_params/AuthenticityPropertiesParams.js +8 -0
  28. package/www/capacitor/results/authenticity/CheckDiagnose.js +2 -0
  29. package/www/capacitor/results/authenticity/SecurityFeatureType.js +1 -0
  30. package/www/capacitor/results/visual_results/FieldType.js +2 -0
  31. package/www/cordova.js +25 -0
  32. package/www/react-native/config/RFIDConfig.js +2 -0
  33. package/www/react-native/index.js +2 -0
  34. package/www/react-native/internal/bridge.js +8 -0
  35. package/www/react-native/params/process_params/AuthenticityPropertiesParams.js +8 -0
  36. package/www/react-native/results/authenticity/CheckDiagnose.js +2 -0
  37. package/www/react-native/results/authenticity/SecurityFeatureType.js +1 -0
  38. package/www/react-native/results/visual_results/FieldType.js +2 -0
  39. package/www/types/config/RFIDConfig.d.ts +15 -0
  40. package/www/types/config/RecognizeConfig.d.ts +2 -2
  41. package/www/types/params/process_params/AuthenticityPropertiesParams.d.ts +2 -0
  42. package/www/types/results/authenticity/CheckDiagnose.d.ts +2 -0
  43. package/www/types/results/authenticity/SecurityFeatureType.d.ts +1 -0
  44. package/www/types/results/visual_results/FieldType.d.ts +2 -0
@@ -7,13 +7,13 @@
7
7
  "android": "scripts/android.sh"
8
8
  },
9
9
  "dependencies": {
10
- "@regulaforensics/document-reader": "9.10.1289-rc",
10
+ "@regulaforensics/document-reader": "9.10.1297-rc",
11
11
  "@regulaforensics/document-reader-core-fullauthrfid": "9.9.3305",
12
12
  "@regulaforensics/document-reader-btdevice": "9.9.140",
13
13
  "react-native-fs": "^2.20.0",
14
14
  "react-native-image-picker": "^8.3.0",
15
15
  "react-native-webview": "^14.0.1",
16
- "react-native": "0.88.0",
16
+ "react-native": "0.88.1",
17
17
  "react": "19.3.1",
18
18
  "@types/react": "19.3.0",
19
19
  "expo": "~58.0.10",
@@ -25,6 +25,13 @@
25
25
  "overrides": {
26
26
  "xcode": {
27
27
  "uuid": "^11.1.1"
28
+ },
29
+ "glob@^13.0.0": "^14.0.3",
30
+ "minimatch@^10.0.0": "^11.0.4",
31
+ "@regulaforensics/document-reader": {
32
+ "@expo/config-plugins": {
33
+ "glob": "^14.0.3"
34
+ }
28
35
  }
29
36
  }
30
37
  }
@@ -1,15 +1,18 @@
1
1
  const { withAppDelegate, withAppBuildGradle, withMainApplication, withXcodeProject } = require('expo/config-plugins')
2
2
 
3
- function replaceRequired(contents, pattern, replacement, description) {
4
- if (!pattern.test(contents)) throw new Error(`Standalone build: cannot find ${description}`)
5
- return contents.replace(pattern, replacement)
3
+ function replaceRequired(contents, search, replacement, description, endMarker) {
4
+ const start = contents.indexOf(search)
5
+ if (start === -1) throw new Error(`Standalone build: cannot find ${description}`)
6
+ const end = endMarker ? contents.indexOf(endMarker, start + search.length) : start + search.length
7
+ if (end === -1) throw new Error(`Standalone build: cannot find end of ${description}`)
8
+ return contents.slice(0, start) + replacement + contents.slice(end + (endMarker ? endMarker.length : 0))
6
9
  }
7
10
 
8
11
  module.exports = config => {
9
12
  config = withAppDelegate(config, config => {
10
13
  let contents = config.modResults.contents
11
14
  if (!contents.includes('// Standalone demo: no development menu.')) {
12
- contents = replaceRequired(contents, /let factory = ExpoReactNativeFactory\(delegate: delegate\)/,
15
+ contents = replaceRequired(contents, 'let factory = ExpoReactNativeFactory(delegate: delegate)',
13
16
  `let factory = ExpoReactNativeFactory(delegate: delegate)
14
17
  // Standalone demo: no development menu.
15
18
  #if DEBUG
@@ -18,10 +21,10 @@ module.exports = config => {
18
21
  #endif`, 'React Native factory')
19
22
  }
20
23
  contents = replaceRequired(contents,
21
- /override func bundleURL\(\) -> URL\? \{[\s\S]*?\n \}/,
24
+ 'override func bundleURL() -> URL? {',
22
25
  `override func bundleURL() -> URL? {
23
26
  return Bundle.main.url(forResource: "main", withExtension: "jsbundle")
24
- }`, 'bundleURL method')
27
+ }`, 'bundleURL method', '\n }')
25
28
  config.modResults.contents = contents
26
29
  return config
27
30
  })
@@ -56,14 +59,14 @@ cp -R images "$DEST/web/"
56
59
  config = withMainApplication(config, config => {
57
60
  if (!config.modResults.contents.includes('useDevSupport = false')) {
58
61
  config.modResults.contents = replaceRequired(config.modResults.contents,
59
- /context = applicationContext,/, 'context = applicationContext,\n useDevSupport = false,', 'Android ReactHost context')
62
+ 'context = applicationContext,', 'context = applicationContext,\n useDevSupport = false,', 'Android ReactHost context')
60
63
  }
61
64
  return config
62
65
  })
63
66
 
64
67
  config = withAppBuildGradle(config, config => {
65
68
  if (!config.modResults.contents.includes('// Standalone demo: embed JS in Debug.')) {
66
- config.modResults.contents = replaceRequired(config.modResults.contents, /react \{/,
69
+ config.modResults.contents = replaceRequired(config.modResults.contents, 'react {',
67
70
  `react {
68
71
  // Standalone demo: embed JS in Debug.
69
72
  debuggableVariants = []
package/ios/RGLWConfig.m CHANGED
@@ -1102,6 +1102,7 @@
1102
1102
 
1103
1103
  +(void)setAuthenticityPropertiesParams:(RGLAuthenticityPropertiesParams*)result input:(NSDictionary*)input {
1104
1104
  if(input[@"checkHoldersSignature"]) result.checkHoldersSignature = input[@"checkHoldersSignature"];
1105
+ if(input[@"checkDocumentDamage"]) result.checkDocumentDamage = input[@"checkDocumentDamage"];
1105
1106
  }
1106
1107
 
1107
1108
  +(NSDictionary*)getAuthenticityPropertiesParams:(RGLAuthenticityPropertiesParams*)input {
@@ -1109,6 +1110,7 @@
1109
1110
  NSMutableDictionary *result = [NSMutableDictionary new];
1110
1111
 
1111
1112
  result[@"checkHoldersSignature"] = input.checkHoldersSignature;
1113
+ result[@"checkDocumentDamage"] = input.checkDocumentDamage;
1112
1114
 
1113
1115
  return result;
1114
1116
  }
@@ -246,6 +246,7 @@ static NSMutableArray* weakReferencesHolder;
246
246
  }
247
247
 
248
248
  if (input[@"scenario"]) config.scenario = input[@"scenario"];
249
+ if (input[@"onlineProcessingConfig"]) config.onlineProcessingConfig = [self onlineProcessingConfigFromJson:input[@"onlineProcessingConfig"]];
249
250
  if (input[@"livePortrait"]) config.livePortrait = [self imageWithBase64:input[@"livePortrait"]];
250
251
  if (input[@"extPortrait"]) config.extPortrait = [self imageWithBase64:input[@"extPortrait"]];
251
252
  if (input[@"oneShotIdentification"]) config.oneShotIdentification = input[@"oneShotIdentification"];
package/ios/RGLWMain.h CHANGED
@@ -27,6 +27,7 @@ static NSString* _Nonnull rfidOnRetryReadChipEvent = @"rfidOnRetryReadChipEvent"
27
27
  static NSString* _Nonnull paCertificateCompletionEvent = @"pa_certificate_completion";
28
28
  static NSString* _Nonnull taCertificateCompletionEvent = @"ta_certificate_completion";
29
29
  static NSString* _Nonnull taSignatureCompletionEvent = @"ta_signature_completion";
30
+ static NSString* _Nonnull aaChallengeCompletionEvent = @"aaChallengeCompletionEvent";
30
31
  static NSString* _Nonnull paceProtocolCompletionEvent = @"paceProtocolCompletionEvent";
31
32
  static NSString* _Nonnull caProtocolCompletionEvent = @"caProtocolCompletionEvent";
32
33
  static NSString* _Nonnull drVideoEncoderCompletionEvent = @"video_encoder_completion";
package/ios/RGLWMain.m CHANGED
@@ -47,6 +47,7 @@
47
47
  @"providePACertificates": ^{ [self providePACertificates :args[0]]; },
48
48
  @"provideTACertificates": ^{ [self provideTACertificates :args[0]]; },
49
49
  @"provideTASignature": ^{ [self provideTASignature :args[0]]; },
50
+ @"provideAAChallenge": ^{ [self provideAAChallenge :args[0]]; },
50
51
  @"selectPACEProtocol": ^{ [self selectPACEProtocol :args[0]]; },
51
52
  @"selectCAProtocol": ^{ [self selectCAProtocol :args[0]]; },
52
53
  @"setTCCParams": ^{ [self setTCCParams :args[0] :callback]; },
@@ -289,6 +290,10 @@ static NSDictionary* headers;
289
290
  taSignatureCompletion([RGLWJSONConstructor base64Decode:signature]);
290
291
  }
291
292
 
293
+ +(void)provideAAChallenge:(NSString*)challenge {
294
+ aaChallengeCompletion(challenge);
295
+ }
296
+
292
297
  +(void)selectPACEProtocol:(NSDictionary*)protocol {
293
298
  paceProtocolCompletion([RGLWJSONConstructor paceProtocolFromJson:protocol]);
294
299
  }
@@ -632,6 +637,7 @@ RGLWCallback savedCallbackForBluetoothResult;
632
637
  RGLRFIDCertificatesCallback paCertificateCompletion;
633
638
  RGLRFIDCertificatesCallback taCertificateCompletion;
634
639
  RGLWRFIDSignatureCallback taSignatureCompletion;
640
+ RGLRFIDAAChallengeCallback aaChallengeCompletion;
635
641
  RGLRFIDAccessControlPACECallback paceProtocolCompletion;
636
642
  RGLRFIDAccessControlCACallback caProtocolCompletion;
637
643
 
@@ -667,6 +673,16 @@ NSDictionary* rfidReaderRequest;
667
673
  }
668
674
  }
669
675
 
676
+ - (void)onRequestAAChallenge:(NSString*)challenge callback:(void(^)(NSString* challenge))callback {
677
+ if ([rfidReaderRequest isKindOfClass:[NSDictionary class]] && [rfidReaderRequest[@"aaChallenge"] boolValue]) {
678
+ aaChallengeCompletion = callback;
679
+ sendEvent(aaChallengeCompletionEvent, challenge);
680
+ } else {
681
+ aaChallengeCompletion = nil;
682
+ callback(nil);
683
+ }
684
+ }
685
+
670
686
  - (void)onRequestPACEProtocolWithOptions:(NSArray<RGLRFIDAccessControlPACE*>*)protocols callback:(RGLRFIDAccessControlPACECallback)callback {
671
687
  if ([rfidReaderRequest isKindOfClass:[NSDictionary class]] && [rfidReaderRequest[@"paceProtocol"] boolValue]) {
672
688
  paceProtocolCompletion = callback;
@@ -18,6 +18,7 @@ static NSMutableArray<RCTResponseSenderBlock>* _firedCallbacks = nil;
18
18
  paCertificateCompletionEvent,
19
19
  taCertificateCompletionEvent,
20
20
  taSignatureCompletionEvent,
21
+ aaChallengeCompletionEvent,
21
22
  paceProtocolCompletionEvent,
22
23
  caProtocolCompletionEvent,
23
24
  drVideoEncoderCompletionEvent,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@regulaforensics/document-reader",
3
- "version": "9.10.1289-rc",
3
+ "version": "9.10.1297-rc",
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",
package/plugin.xml CHANGED
@@ -1,5 +1,5 @@
1
1
  <?xml version='1.0' encoding='utf-8'?>
2
- <plugin id="@regulaforensics/document-reader" version="9.10.1289-rc" xmlns="http://apache.org/cordova/ns/plugins/1.0">
2
+ <plugin id="@regulaforensics/document-reader" version="9.10.1297-rc" xmlns="http://apache.org/cordova/ns/plugins/1.0">
3
3
  <name>DocumentReader</name>
4
4
  <description>Cordova plugin for Regula Document Reader SDK</description>
5
5
  <license>commercial</license>
@@ -14,7 +14,7 @@
14
14
  <feature name="DocumentReader">
15
15
  <param name="ios-package" value="CVDDocumentReader" />
16
16
  </feature>
17
- <preference name="deployment-target" value="15.0" />
17
+ <preference name="deployment-target" value="16.0" />
18
18
  </config-file>
19
19
  <header-file src="ios/CVDDocumentReader.h" />
20
20
  <source-file src="ios/CVDDocumentReader.m" />
@@ -29,7 +29,7 @@
29
29
  <source url="https://github.com/regulaforensics/podspecs.git" />
30
30
  </config>
31
31
  <pods>
32
- <pod name="DocumentReaderStage" spec="9.10.7308" nospm="true" />
32
+ <pod name="DocumentReaderStage" spec="9.10.7309" nospm="true" />
33
33
  </pods>
34
34
  </podspec>
35
35
  </platform>
@@ -1,14 +1,14 @@
1
1
  Pod::Spec.new do |s|
2
2
  s.name = 'react-native-document-reader'
3
- s.version = '9.10.1289-rc'
3
+ s.version = '9.10.1297-rc'
4
4
  s.summary = 'Regula React Native plugin.'
5
5
  s.license = 'commercial'
6
6
  s.authors = { 'RegulaForensics' => 'support@regulaforensics.com' }
7
7
  s.homepage = 'https://regulaforensics.com'
8
8
  s.source = { :path => '.' }
9
- s.ios.deployment_target = '15.0'
9
+ s.ios.deployment_target = '16.0'
10
10
  s.source_files = 'ios/*.{h,m}'
11
11
  s.exclude_files = [ 'ios/CVDDocumentReader.h', 'ios/CVDDocumentReader.m' ]
12
- s.dependency 'DocumentReaderStage', '9.10.7308'
12
+ s.dependency 'DocumentReaderStage', '9.10.7309'
13
13
  s.dependency 'React'
14
14
  end
package/test/json.tsx CHANGED
@@ -33,6 +33,7 @@ export var livenessParams = {
33
33
  };
34
34
  export var propertiesParams = {
35
35
  "checkHoldersSignature": true,
36
+ "checkDocumentDamage": false,
36
37
  };
37
38
  export var authenticityParams = {
38
39
  "useLivenessCheck": true,
@@ -554,13 +555,12 @@ export var recognizeConfig = {
554
555
  };
555
556
  export var recognizeConfig2 = {
556
557
  "onlineProcessingConfig": onlineProcessingConfig,
557
- "livePortrait": img1,
558
- "extPortrait": img2,
559
558
  "oneShotIdentification": true,
560
- "image": img3,
561
- "data": img1,
562
- "images": [img1, img2, img3],
563
- "imageInputData": [imageInputData, imageInputData, imageInputData],
559
+ };
560
+ export var recognizeConfig3 = {
561
+ "scenario": "Mrz",
562
+ "onlineProcessingConfig": onlineProcessingConfig,
563
+ "oneShotIdentification": true,
564
564
  };
565
565
  export var scannerConfig = {
566
566
  "scenario": "Mrz",