@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
@@ -662,6 +662,8 @@ export const FieldType = {
662
662
  DLCLASSCODE_B3_FROM: 706,
663
663
  DLCLASSCODE_B3_TO: 707,
664
664
  DLCLASSCODE_B3_NOTES: 708,
665
+ ADDRESS_POST_OFFICE: 709,
666
+ ADDRESS_LOT: 710,
665
667
  }
666
668
 
667
669
  FieldType.getTranslation = async function (value) {
package/www/cordova.js CHANGED
@@ -229,6 +229,7 @@ class RFIDConfig {
229
229
  onRequestPACertificates
230
230
  onRequestTACertificates
231
231
  onRequestTASignature
232
+ onRequestAAChallenge
232
233
  onRequestPACEProtocol
233
234
  onRequestCAProtocol
234
235
 
@@ -249,6 +250,7 @@ class RFIDConfig {
249
250
  "paCertificates": this.onRequestPACertificates != null,
250
251
  "taCertificates": this.onRequestTACertificates != null,
251
252
  "taSignature": this.onRequestTASignature != null,
253
+ "aaChallenge": this.onRequestAAChallenge != null,
252
254
  "paceProtocol": this.onRequestPACEProtocol != null,
253
255
  "caProtocol": this.onRequestCAProtocol != null,
254
256
  }
@@ -1113,6 +1115,7 @@ class DocumentReader {
1113
1115
  (0,_internal_bridge__WEBPACK_IMPORTED_MODULE_0__._setPaCertificateCompletion)(config.onRequestPACertificates);
1114
1116
  (0,_internal_bridge__WEBPACK_IMPORTED_MODULE_0__._setTaCertificateCompletion)(config.onRequestTACertificates);
1115
1117
  (0,_internal_bridge__WEBPACK_IMPORTED_MODULE_0__._setTaSignatureCompletion)(config.onRequestTASignature);
1118
+ (0,_internal_bridge__WEBPACK_IMPORTED_MODULE_0__._setAAChallengeCompletion)(config.onRequestAAChallenge);
1116
1119
 
1117
1120
  (0,_internal_bridge__WEBPACK_IMPORTED_MODULE_0__._setPACEProtocolCompletion)(config.onRequestPACEProtocol);
1118
1121
  (0,_internal_bridge__WEBPACK_IMPORTED_MODULE_0__._setCAProtocolCompletion)(config.onRequestCAProtocol);
@@ -1759,6 +1762,7 @@ class RFIDException {
1759
1762
 
1760
1763
  __webpack_require__.r(__webpack_exports__);
1761
1764
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1765
+ /* harmony export */ _setAAChallengeCompletion: () => (/* binding */ _setAAChallengeCompletion),
1762
1766
  /* harmony export */ _setCAProtocolCompletion: () => (/* binding */ _setCAProtocolCompletion),
1763
1767
  /* harmony export */ _setChipDetectedCompletion: () => (/* binding */ _setChipDetectedCompletion),
1764
1768
  /* harmony export */ _setCustomButtonTappedCompletion: () => (/* binding */ _setCustomButtonTappedCompletion),
@@ -1893,6 +1897,14 @@ function _setTaSignatureCompletion(completion) {
1893
1897
  })
1894
1898
  }
1895
1899
 
1900
+ function _setAAChallengeCompletion(completion) {
1901
+ _setEvent("aaChallengeCompletionEvent", completion, json => {
1902
+ return [json, async challenge => {
1903
+ await exec("provideAAChallenge", [challenge])
1904
+ }]
1905
+ })
1906
+ }
1907
+
1896
1908
  function _setPACEProtocolCompletion(completion) {
1897
1909
  _setEvent("paceProtocolCompletionEvent", completion, json => {
1898
1910
  return [JSON.parse(json).map(item => _rfid_PACEProtocol__WEBPACK_IMPORTED_MODULE_8__.PACEProtocol.fromJson(item)), async protocol => {
@@ -4541,11 +4553,18 @@ class AuthenticityPropertiesParams {
4541
4553
  this._set({ "checkHoldersSignature": val });
4542
4554
  }
4543
4555
 
4556
+ get checkDocumentDamage() { return this._checkDocumentDamage; }
4557
+ set checkDocumentDamage(val) {
4558
+ this._checkDocumentDamage = val;
4559
+ this._set({ "checkDocumentDamage": val });
4560
+ }
4561
+
4544
4562
  static fromJson(jsonObject) {
4545
4563
  if (jsonObject == null) return new AuthenticityPropertiesParams();
4546
4564
 
4547
4565
  const result = new AuthenticityPropertiesParams();
4548
4566
  result._checkHoldersSignature = jsonObject["checkHoldersSignature"];
4567
+ result._checkDocumentDamage = jsonObject["checkDocumentDamage"];
4549
4568
 
4550
4569
  return result;
4551
4570
  }
@@ -4560,6 +4579,7 @@ class AuthenticityPropertiesParams {
4560
4579
  toJson() {
4561
4580
  return {
4562
4581
  "checkHoldersSignature": this.checkHoldersSignature,
4582
+ "checkDocumentDamage": this.checkDocumentDamage,
4563
4583
  }
4564
4584
  }
4565
4585
  }
@@ -8273,6 +8293,8 @@ const CheckDiagnose = {
8273
8293
  PROPERTY_NO_SIGNATURE: 260,
8274
8294
  PROPERTY_TEXT_AS_SIGNATURE: 261,
8275
8295
  PROPERTY_FINGERPRINT_AS_SIGNATURE: 262,
8296
+ PROPERTY_DOCUMENT_DAMAGED: 263,
8297
+ PROPERTY_DOCUMENT_CANCELLED: 264,
8276
8298
  }
8277
8299
 
8278
8300
 
@@ -8353,6 +8375,7 @@ const SecurityFeatureType = {
8353
8375
  PORTRAIT_COMPARISON_GHOSTVSLIVE: 60,
8354
8376
  PORTRAIT_COMPARISON_EXTVSGHOST: 61,
8355
8377
  SIGNATURE_PRESENCE: 62,
8378
+ DAMAGE_CHECK: 63,
8356
8379
  }
8357
8380
 
8358
8381
 
@@ -11481,6 +11504,8 @@ const FieldType = {
11481
11504
  DLCLASSCODE_B3_FROM: 706,
11482
11505
  DLCLASSCODE_B3_TO: 707,
11483
11506
  DLCLASSCODE_B3_NOTES: 708,
11507
+ ADDRESS_POST_OFFICE: 709,
11508
+ ADDRESS_LOT: 710,
11484
11509
  }
11485
11510
 
11486
11511
  FieldType.getTranslation = async function (value) {
@@ -18,6 +18,7 @@ export class RFIDConfig {
18
18
  onRequestPACertificates
19
19
  onRequestTACertificates
20
20
  onRequestTASignature
21
+ onRequestAAChallenge
21
22
  onRequestPACEProtocol
22
23
  onRequestCAProtocol
23
24
 
@@ -38,6 +39,7 @@ export class RFIDConfig {
38
39
  "paCertificates": this.onRequestPACertificates != null,
39
40
  "taCertificates": this.onRequestTACertificates != null,
40
41
  "taSignature": this.onRequestTASignature != null,
42
+ "aaChallenge": this.onRequestAAChallenge != null,
41
43
  "paceProtocol": this.onRequestPACEProtocol != null,
42
44
  "caProtocol": this.onRequestCAProtocol != null,
43
45
  }
@@ -12,6 +12,7 @@ import {
12
12
  _setPaCertificateCompletion,
13
13
  _setTaCertificateCompletion,
14
14
  _setTaSignatureCompletion,
15
+ _setAAChallengeCompletion,
15
16
  _setPACEProtocolCompletion,
16
17
  _setCAProtocolCompletion,
17
18
  } from './internal/bridge'
@@ -538,6 +539,7 @@ export class DocumentReader {
538
539
  _setPaCertificateCompletion(config.onRequestPACertificates);
539
540
  _setTaCertificateCompletion(config.onRequestTACertificates);
540
541
  _setTaSignatureCompletion(config.onRequestTASignature);
542
+ _setAAChallengeCompletion(config.onRequestAAChallenge);
541
543
 
542
544
  _setPACEProtocolCompletion(config.onRequestPACEProtocol);
543
545
  _setCAProtocolCompletion(config.onRequestCAProtocol);
@@ -106,6 +106,14 @@ export function _setTaSignatureCompletion(completion) {
106
106
  })
107
107
  }
108
108
 
109
+ export function _setAAChallengeCompletion(completion) {
110
+ _setEvent("aaChallengeCompletionEvent", completion, json => {
111
+ return [json, async challenge => {
112
+ await exec("provideAAChallenge", [challenge])
113
+ }]
114
+ })
115
+ }
116
+
109
117
  export function _setPACEProtocolCompletion(completion) {
110
118
  _setEvent("paceProtocolCompletionEvent", completion, json => {
111
119
  return [JSON.parse(json).map(item => PACEProtocol.fromJson(item)), async protocol => {
@@ -7,11 +7,18 @@ export class AuthenticityPropertiesParams {
7
7
  this._set({ "checkHoldersSignature": val });
8
8
  }
9
9
 
10
+ get checkDocumentDamage() { return this._checkDocumentDamage; }
11
+ set checkDocumentDamage(val) {
12
+ this._checkDocumentDamage = val;
13
+ this._set({ "checkDocumentDamage": val });
14
+ }
15
+
10
16
  static fromJson(jsonObject) {
11
17
  if (jsonObject == null) return new AuthenticityPropertiesParams();
12
18
 
13
19
  const result = new AuthenticityPropertiesParams();
14
20
  result._checkHoldersSignature = jsonObject["checkHoldersSignature"];
21
+ result._checkDocumentDamage = jsonObject["checkDocumentDamage"];
15
22
 
16
23
  return result;
17
24
  }
@@ -26,6 +33,7 @@ export class AuthenticityPropertiesParams {
26
33
  toJson() {
27
34
  return {
28
35
  "checkHoldersSignature": this.checkHoldersSignature,
36
+ "checkDocumentDamage": this.checkDocumentDamage,
29
37
  }
30
38
  }
31
39
  }
@@ -128,4 +128,6 @@ export const CheckDiagnose = {
128
128
  PROPERTY_NO_SIGNATURE: 260,
129
129
  PROPERTY_TEXT_AS_SIGNATURE: 261,
130
130
  PROPERTY_FINGERPRINT_AS_SIGNATURE: 262,
131
+ PROPERTY_DOCUMENT_DAMAGED: 263,
132
+ PROPERTY_DOCUMENT_CANCELLED: 264,
131
133
  }
@@ -63,4 +63,5 @@ export const SecurityFeatureType = {
63
63
  PORTRAIT_COMPARISON_GHOSTVSLIVE: 60,
64
64
  PORTRAIT_COMPARISON_EXTVSGHOST: 61,
65
65
  SIGNATURE_PRESENCE: 62,
66
+ DAMAGE_CHECK: 63,
66
67
  }
@@ -662,6 +662,8 @@ export const FieldType = {
662
662
  DLCLASSCODE_B3_FROM: 706,
663
663
  DLCLASSCODE_B3_TO: 707,
664
664
  DLCLASSCODE_B3_NOTES: 708,
665
+ ADDRESS_POST_OFFICE: 709,
666
+ ADDRESS_LOT: 710,
665
667
  }
666
668
 
667
669
  FieldType.getTranslation = async function (value) {
@@ -51,6 +51,11 @@ export declare class RFIDConfig {
51
51
  */
52
52
  onRequestTASignature?: TaSignatureCompletion;
53
53
 
54
+ /**
55
+ * Callback for receiving RFID request data
56
+ */
57
+ onRequestAAChallenge?: AAChallengeCompletion;
58
+
54
59
  /**
55
60
  * Callback for receiving RFID request data
56
61
  */
@@ -142,6 +147,16 @@ export type TaSignatureCompletion = (challenge: TAChallenge | null, request: TAS
142
147
  */
143
148
  export type TASignatureRequest = (signature?: string) => Promise<void>;
144
149
 
150
+ /**
151
+ * Callback for receiving RFID request data.
152
+ */
153
+ export type AAChallengeCompletion = (challenge: string | null, request: AAChallengeRequest) => void;
154
+
155
+ /**
156
+ * Provided to a user for passing AAChallenge to the native part of DocumentReader.
157
+ */
158
+ export type AAChallengeRequest = (challenge?: string | null) => Promise<void>;
159
+
145
160
  /**
146
161
  * Callback for receiving RFID request data.
147
162
  */
@@ -9,14 +9,14 @@ export declare class RecognizeConfig {
9
9
  /**
10
10
  * Documents processing scenario.
11
11
  */
12
- readonly scenario?: Scenario;
12
+ scenario?: Scenario;
13
13
 
14
14
  /**
15
15
  * Configuration class for online processing.
16
16
  *
17
17
  * Requires network connection.
18
18
  */
19
- readonly onlineProcessingConfig?: OnlineProcessingConfig;
19
+ onlineProcessingConfig?: OnlineProcessingConfig;
20
20
 
21
21
  /**
22
22
  * Image for processing. Base64 string.
@@ -2,6 +2,8 @@ export declare class AuthenticityPropertiesParams {
2
2
  /** Set to true to enable detection of the document holder’s signature. */
3
3
  checkHoldersSignature?: boolean;
4
4
 
5
+ checkDocumentDamage?: boolean;
6
+
5
7
  /**
6
8
  * Allows you to deserialize object.
7
9
  * @param jsonObject
@@ -237,4 +237,6 @@ export declare enum CheckDiagnose {
237
237
  PROPERTY_NO_SIGNATURE = 260,
238
238
  PROPERTY_TEXT_AS_SIGNATURE = 261,
239
239
  PROPERTY_FINGERPRINT_AS_SIGNATURE = 262,
240
+ PROPERTY_DOCUMENT_DAMAGED = 263,
241
+ PROPERTY_DOCUMENT_CANCELLED = 264,
240
242
  }
@@ -106,4 +106,5 @@ export declare enum SecurityFeatureType {
106
106
  PORTRAIT_COMPARISON_GHOSTVSLIVE = 60,
107
107
  PORTRAIT_COMPARISON_EXTVSGHOST = 61,
108
108
  SIGNATURE_PRESENCE = 62,
109
+ DAMAGE_CHECK = 63,
109
110
  }
@@ -1319,6 +1319,8 @@ export declare enum FieldType {
1319
1319
  DLCLASSCODE_B3_FROM = 706,
1320
1320
  DLCLASSCODE_B3_TO = 707,
1321
1321
  DLCLASSCODE_B3_NOTES = 708,
1322
+ ADDRESS_POST_OFFICE = 709,
1323
+ ADDRESS_LOT = 710,
1322
1324
  }
1323
1325
 
1324
1326
  export declare namespace FieldType {