@regulaforensics/react-native-document-reader-api 6.8.1 → 6.9.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.
Files changed (75) hide show
  1. package/RNDocumentReaderApi.podspec +1 -1
  2. package/android/build.gradle +18 -1
  3. package/android/src/main/java/com/regula/documentreader/BluetoothUtil.kt +6 -6
  4. package/android/src/main/java/com/regula/documentreader/Helpers.java +117 -3
  5. package/android/src/main/java/com/regula/documentreader/JSONConstructor.java +182 -261
  6. package/android/src/main/java/com/regula/documentreader/RNRegulaDocumentReaderModule.java +142 -125
  7. package/android/src/main/java/com/regula/documentreader/RegulaConfig.java +114 -26
  8. package/example/.bundle/config +2 -0
  9. package/example/.eslintrc.js +1 -1
  10. package/example/.prettierrc.js +2 -2
  11. package/example/.watchmanconfig +1 -1
  12. package/example/App.tsx +358 -0
  13. package/example/Gemfile +6 -0
  14. package/example/Gemfile.lock +98 -0
  15. package/example/__tests__/{App-test.js → App.test.tsx} +3 -0
  16. package/example/android/app/build.gradle +77 -59
  17. package/example/android/app/src/debug/AndroidManifest.xml +1 -1
  18. package/example/android/app/src/debug/java/com/regula/dr/fullrfid/ReactNativeFlipper.java +7 -4
  19. package/example/android/app/src/main/AndroidManifest.xml +4 -9
  20. package/example/android/app/src/main/java/com/regula/dr/fullrfid/MainActivity.java +17 -0
  21. package/example/android/app/src/main/java/com/regula/dr/fullrfid/MainApplication.java +17 -36
  22. package/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +36 -0
  23. package/example/android/app/src/main/res/values/styles.xml +2 -2
  24. package/example/android/app/src/release/java/com/regula/dr/fullrfid/ReactNativeFlipper.java +20 -0
  25. package/example/android/build.gradle +7 -18
  26. package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  27. package/example/android/gradle/wrapper/gradle-wrapper.properties +2 -1
  28. package/example/android/gradle.properties +42 -2
  29. package/example/android/gradlew +164 -105
  30. package/example/android/gradlew.bat +92 -89
  31. package/example/android/settings.gradle +2 -1
  32. package/example/app.json +1 -1
  33. package/example/ios/.xcode.env +11 -0
  34. package/example/ios/DocumentReader/AppDelegate.h +2 -4
  35. package/example/ios/DocumentReader/AppDelegate.mm +26 -0
  36. package/example/ios/DocumentReader/DocumentReader.entitlements +0 -1
  37. package/example/ios/DocumentReader/Images.xcassets/AppIcon.appiconset/Contents.json +30 -15
  38. package/example/ios/DocumentReader/Info.plist +8 -4
  39. package/example/ios/DocumentReader/main.m +2 -1
  40. package/example/ios/DocumentReader.xcodeproj/project.pbxproj +134 -96
  41. package/example/ios/DocumentReaderTests/DocumentReaderTests.m +14 -13
  42. package/example/ios/Podfile +45 -15
  43. package/example/jest.config.js +3 -0
  44. package/example/metro.config.js +18 -15
  45. package/example/package-lock.json +13091 -0
  46. package/example/package.json +32 -22
  47. package/example/tsconfig.json +3 -0
  48. package/index.d.ts +426 -3015
  49. package/index.js +253 -2954
  50. package/ios/RGLWJSONConstructor.h +8 -6
  51. package/ios/RGLWJSONConstructor.m +109 -92
  52. package/ios/RGLWRegulaConfig.h +2 -1
  53. package/ios/RGLWRegulaConfig.m +139 -41
  54. package/ios/RNRegulaDocumentReader.m +55 -42
  55. package/package.json +1 -1
  56. package/example/.buckconfig +0 -6
  57. package/example/.editorconfig +0 -3
  58. package/example/.flowconfig +0 -65
  59. package/example/.gitattributes +0 -3
  60. package/example/App.js +0 -399
  61. package/example/android/app/BUCK +0 -55
  62. package/example/android/app/_BUCK +0 -55
  63. package/example/android/app/build_defs.bzl +0 -19
  64. package/example/android/app/src/main/assets/index.android.bundle +0 -636
  65. package/example/android/app/src/main/res/drawable-mdpi/images_id.png +0 -0
  66. package/example/android/app/src/main/res/drawable-mdpi/images_portrait.png +0 -0
  67. package/example/android/app/src/main/res/drawable-mdpi/node_modules_reactnativecheckbox_img_ic_check_box.png +0 -0
  68. package/example/android/app/src/main/res/drawable-mdpi/node_modules_reactnativecheckbox_img_ic_check_box_outline_blank.png +0 -0
  69. package/example/android/app/src/main/res/drawable-mdpi/node_modules_reactnativecheckbox_img_ic_indeterminate_check_box.png +0 -0
  70. package/example/android/app/src/main/res/drawable-xhdpi/node_modules_reactnativecheckbox_img_ic_check_box.png +0 -0
  71. package/example/android/app/src/main/res/drawable-xhdpi/node_modules_reactnativecheckbox_img_ic_check_box_outline_blank.png +0 -0
  72. package/example/android/app/src/main/res/drawable-xxhdpi/node_modules_reactnativecheckbox_img_ic_check_box.png +0 -0
  73. package/example/android/app/src/main/res/drawable-xxhdpi/node_modules_reactnativecheckbox_img_ic_check_box_outline_blank.png +0 -0
  74. package/example/ios/DocumentReader/AppDelegate.m +0 -62
  75. package/example/ios/DocumentReader/Base.lproj/LaunchScreen.xib +0 -42
@@ -2,27 +2,29 @@
2
2
  #define RGLWJSONConstructor_h
3
3
 
4
4
  #import <DocumentReader/DocumentReader.h>
5
+ #import "RGLWRegulaConfig.h"
5
6
  @import CoreGraphics;
6
7
  @import UIKit;
7
8
 
8
9
  @interface RGLWJSONConstructor : NSObject
9
10
  +(NSString* _Nonnull)dictToString:(NSMutableDictionary* _Nonnull)input;
10
11
  +(NSString* _Nonnull)arrayToString:(NSMutableArray* _Nonnull)input;
11
- +(NSMutableDictionary* _Nonnull)generateRfidNotificationCompletion:(NSInteger)notification;
12
- +(NSMutableDictionary* _Nonnull)generateRfidNotificationCompletionWithError:(NSInteger)notification : (NSInteger)value;
13
12
  +(NSMutableDictionary* _Nonnull)generateNSDictionary:(NSDictionary<NSNumber*, NSNumber*>* _Nullable)input;
13
+ +(UIImage* _Nullable)imageWithBase64:(NSString* _Nullable)input;
14
+ +(NSString* _Nullable)base64WithImage:(UIImage* _Nullable)input;
14
15
  +(RGLPKDCertificate* _Nullable)RGLPKDCertificateFromJson:(NSDictionary* _Nullable) dict;
15
16
  +(RGLTCCParams* _Nonnull)RGLTCCParamsFromJson:(NSDictionary* _Nonnull)input;
16
17
  +(RGLConfig* _Nullable)RGLConfigFromJson:(NSDictionary* _Nonnull)input;
18
+ +(RGLScannerConfig* _Nullable)RGLScannerConfigFromJson:(NSDictionary* _Nonnull)input;
19
+ +(RGLRecognizeConfig* _Nullable)RGLRecognizeConfigFromJson:(NSDictionary* _Nonnull)input;
17
20
  +(RGLImageInput* _Nonnull)RGLImageInputFromJson:(NSDictionary* _Nonnull)input;
18
21
  +(NSInteger)generateDocReaderAction:(RGLDocReaderAction)action;
19
22
  +(NSInteger)generateRFIDCompleteAction:(RGLRFIDCompleteAction)action;
20
- +(NSInteger)generateRFIDNotificationAction:(RGLRFIDNotificationAction)action;
21
- +(NSMutableDictionary* _Nullable)generateCompletion:(NSInteger)action :(RGLDocumentReaderResults*_Nullable)results :(NSError*_Nullable)error :(RGLRFIDNotify*_Nullable)notify;
23
+ +(NSMutableDictionary* _Nullable)generateCompletion:(NSInteger)action :(RGLDocumentReaderResults*_Nullable)results :(NSError*_Nullable)error;
22
24
  +(NSMutableDictionary* _Nonnull)generateVideoEncoderCompletion:(NSURL* _Nullable)input :(NSError* _Nullable)error;
23
25
  +(NSString*_Nonnull)generateNSData:(NSData *_Nullable)input;
24
26
  +(NSMutableDictionary* _Nonnull)generatePACertificateCompletion:(NSData *_Nullable)serialNumber :(RGLPAResourcesIssuer *_Nullable)issuer;
25
- +(NSMutableDictionary* _Nonnull)generateRGLRFIDNotify:(RGLRFIDNotify* _Nullable)input;
27
+ +(NSMutableDictionary* _Nonnull)generateDocumentReaderNotification:(RGLRFIDNotify* _Nullable)input;
26
28
  +(NSMutableDictionary* _Nonnull)generateRGLDocumentReaderResults:(RGLDocumentReaderResults* _Nullable)input;
27
29
  +(NSMutableDictionary* _Nonnull)generateRGLPosition:(RGLPosition* _Nullable)input;
28
30
  +(NSMutableDictionary* _Nonnull)generateRGLDocumentReaderBarcodeResult:(RGLDocumentReaderBarcodeResult* _Nullable)input;
@@ -41,6 +43,7 @@
41
43
  +(NSMutableDictionary* _Nonnull)generateRGLDocumentReaderDocumentType:(RGLDocumentReaderDocumentType* _Nullable)input;
42
44
  +(NSMutableDictionary* _Nonnull)generateRGLScenario:(RGLScenario* _Nullable)input;
43
45
  +(NSMutableDictionary* _Nonnull)generateRGLRFIDSessionData:(RGLRFIDSessionData* _Nullable)input;
46
+ +(NSMutableDictionary* _Nonnull)generateRGLDataField:(RGLDataField* _Nullable)input;
44
47
  +(NSMutableDictionary* _Nonnull)generateRGLCardProperties:(RGLCardProperties* _Nullable)input;
45
48
  +(NSMutableDictionary* _Nonnull)generateRGLRFIDSessionDataStatus:(RGLRFIDSessionDataStatus* _Nullable)input;
46
49
  +(NSMutableDictionary* _Nonnull)generateRGLAccessControlProcedureType:(RGLAccessControlProcedureType* _Nullable)input;
@@ -57,7 +60,6 @@
57
60
  +(NSMutableDictionary* _Nonnull)generateRGLExtension:(RGLExtension* _Nullable)input;
58
61
  +(NSMutableDictionary* _Nonnull)generateRGLCertificateChain:(RGLCertificateChain* _Nullable)input;
59
62
  +(NSMutableDictionary* _Nonnull)generateRGLValidity:(RGLValidity* _Nullable)input;
60
- +(NSMutableDictionary* _Nonnull)generateNSError:(NSError* _Nullable)input;
61
63
  +(NSMutableDictionary* _Nonnull)generateRGLPAResourcesIssuer:(RGLPAResourcesIssuer* _Nullable)input;
62
64
  +(NSMutableDictionary* _Nonnull)generateRGLPAAttribute:(RGLPAAttribute* _Nullable)input;
63
65
  +(NSMutableDictionary* _Nonnull)generateRGLTAChallenge:(RGLTAChallenge* _Nullable)input;
@@ -12,6 +12,16 @@
12
12
  return [[NSString alloc] initWithData:[NSJSONSerialization dataWithJSONObject:input options:NSJSONWritingPrettyPrinted error:nil] encoding:NSUTF8StringEncoding];
13
13
  }
14
14
 
15
+ +(NSMutableDictionary* _Nonnull)generateNSError:(NSError* _Nullable)input {
16
+ NSMutableDictionary *result = [NSMutableDictionary new];
17
+ if(input == nil) return result;
18
+
19
+ result[@"errorCode"] = [NSNumber numberWithInteger:input.code];
20
+ result[@"message"] = input.localizedDescription;
21
+
22
+ return result;
23
+ }
24
+
15
25
  +(NSMutableDictionary* _Nonnull)generateNSDictionary:(NSDictionary<NSNumber*, NSNumber*>* _Nullable)input {
16
26
  NSMutableDictionary *result = [NSMutableDictionary new];
17
27
  if(input == nil) return result;
@@ -22,6 +32,16 @@
22
32
  return result;
23
33
  }
24
34
 
35
+ +(UIImage*)imageWithBase64:(NSString*)input {
36
+ if(input == nil) return nil;
37
+ return [UIImage imageWithData:[[NSData alloc]initWithBase64EncodedString:input options:NSDataBase64DecodingIgnoreUnknownCharacters]];
38
+ }
39
+
40
+ +(NSString*)base64WithImage:(UIImage*)input {
41
+ if(input == nil) return nil;
42
+ return [UIImageJPEGRepresentation(input, 1.0) base64EncodedStringWithOptions:0];
43
+ }
44
+
25
45
  +(RGLPKDCertificate*)RGLPKDCertificateFromJson:(NSDictionary*)input {
26
46
  NSInteger type = [[input valueForKey:@"resourceType"] integerValue];
27
47
  NSData* binaryData = [[NSData alloc] initWithBase64EncodedString:[input objectForKey:@"binaryData"] options:0];
@@ -41,26 +61,67 @@
41
61
  }
42
62
 
43
63
  +(RGLConfig*)RGLConfigFromJson:(NSDictionary*)input {
44
- NSData* license;
45
- if([input valueForKey:@"license"] != nil)
46
- license = [[NSData alloc] initWithBase64EncodedString:[input valueForKey:@"license"] options:0];
47
- else return nil;
48
-
49
- RGLConfig *config = [[RGLConfig alloc] initWithLicenseData:license];
64
+ if([input valueForKey:@"license"] == nil) return nil;
65
+ RGLConfig *config = [[RGLConfig alloc] initWithLicenseData:[[NSData alloc] initWithBase64EncodedString:[input valueForKey:@"license"] options:0]];
50
66
 
51
- if([input valueForKey:@"databasePath"] != nil){
67
+ if([input valueForKey:@"databasePath"] != nil)
52
68
  config.databasePath = [[input valueForKey:@"databasePath"] stringValue];
53
- }
54
- if([input valueForKey:@"licenseUpdate"] != nil){
69
+ if([input valueForKey:@"licenseUpdate"] != nil)
55
70
  config.licenseUpdateCheck = [[input valueForKey:@"licenseUpdate"] boolValue];
56
- }
57
- if([input valueForKey:@"delayedNNLoad"] != nil){
71
+ if([input valueForKey:@"delayedNNLoad"] != nil)
58
72
  config.delayedNNLoadEnabled = [[input valueForKey:@"delayedNNLoad"] boolValue];
59
- }
60
73
 
61
74
  return config;
62
75
  }
63
76
 
77
+ +(RGLScannerConfig*)RGLScannerConfigFromJson:(NSDictionary*)input {
78
+ if([input valueForKey:@"scenario"] == nil && [input valueForKey:@"onlineProcessingConfig"] == nil) return nil;
79
+ RGLScannerConfig *config = [RGLScannerConfig new];
80
+
81
+ if([input valueForKey:@"scenario"] != nil)
82
+ config.scenario = [input valueForKey:@"scenario"];
83
+ if([input valueForKey:@"onlineProcessingConfig"] != nil)
84
+ config.onlineProcessingConfig = [RGLWRegulaConfig RGLOnlineProcessingConfigFromJSON:[input valueForKey:@"onlineProcessingConfig"]];
85
+ if([input valueForKey:@"livePortrait"] != nil)
86
+ config.livePortrait = [self imageWithBase64:[input valueForKey:@"livePortrait"]];
87
+ if([input valueForKey:@"extPortrait"] != nil)
88
+ config.extPortrait = [self imageWithBase64:[input valueForKey:@"extPortrait"]];
89
+
90
+ return config;
91
+ }
92
+
93
+ +(RGLRecognizeConfig*)RGLRecognizeConfigFromJson:(NSDictionary*)input {
94
+ if([input valueForKey:@"scenario"] == nil && [input valueForKey:@"onlineProcessingConfig"] == nil) return nil;
95
+ if([input valueForKey:@"image"] == nil && [input valueForKey:@"images"] == nil && [input valueForKey:@"imageInputs"] == nil) return nil;
96
+ RGLRecognizeConfig *config = [RGLRecognizeConfig alloc];
97
+
98
+ if([input valueForKey:@"image"] != nil)
99
+ config = [config initWithImage:[RGLWJSONConstructor imageWithBase64:[input valueForKey:@"image"]]];
100
+ else if([input valueForKey:@"images"] != nil){
101
+ NSMutableArray<UIImage*>* images = [[NSMutableArray alloc] init];
102
+ for(NSMutableString* base64 in [input valueForKey:@"images"])
103
+ [images addObject:[RGLWJSONConstructor imageWithBase64:base64]];
104
+ config = [config initWithImages:images];
105
+ } else if([input valueForKey:@"imageInputs"] != nil){
106
+ NSMutableArray<RGLImageInput*>* images = [[NSMutableArray alloc] init];
107
+ for(NSDictionary* image in [input valueForKey:@"imageInputs"])
108
+ [images addObject:[RGLWJSONConstructor RGLImageInputFromJson: image]];
109
+ config = [config initWithImageInputs:images];
110
+ }
111
+
112
+ if([input valueForKey:@"scenario"] != nil)
113
+ config.scenario = [input valueForKey:@"scenario"];
114
+ if([input valueForKey:@"onlineProcessingConfig"] != nil)
115
+ config.onlineProcessingConfig = [RGLWRegulaConfig RGLOnlineProcessingConfigFromJSON:[input valueForKey:@"onlineProcessingConfig"]];
116
+ if([input valueForKey:@"livePortrait"] != nil)
117
+ config.livePortrait = [self imageWithBase64:[input valueForKey:@"livePortrait"]];
118
+ if([input valueForKey:@"extPortrait"] != nil)
119
+ config.extPortrait = [self imageWithBase64:[input valueForKey:@"extPortrait"]];
120
+ if([input valueForKey:@"oneShotIdentification"] != nil)
121
+ config.oneShotIdentification = [input valueForKey:@"oneShotIdentification"];
122
+
123
+ return config;
124
+ }
64
125
 
65
126
  +(RGLImageInput*)RGLImageInputFromJson:(NSDictionary*)input {
66
127
  NSInteger pageIndex = 0;
@@ -68,11 +129,9 @@
68
129
  pageIndex = [[input valueForKey:@"pageIndex"] integerValue];
69
130
  NSInteger light = 6;
70
131
  if([input valueForKey:@"light"] != nil)
71
- pageIndex = [[input valueForKey:@"light"] integerValue];
72
- if([input valueForKey:@"bitmap"] != nil){
73
- UIImage* image = [UIImage imageWithData:[[NSData alloc]initWithBase64EncodedString:[input valueForKey:@"bitmap"] options:NSDataBase64DecodingIgnoreUnknownCharacters]];
74
- return [[RGLImageInput alloc] initWithImage:image light:light pageIndex:pageIndex];
75
- }
132
+ light = [[input valueForKey:@"light"] integerValue];
133
+ if([input valueForKey:@"image"] != nil)
134
+ return [[RGLImageInput alloc] initWithImage:[self imageWithBase64:[input valueForKey:@"image"]] light:light pageIndex:pageIndex];
76
135
  return nil;
77
136
  }
78
137
 
@@ -113,23 +172,6 @@
113
172
  return result;
114
173
  }
115
174
 
116
- +(NSMutableDictionary*)generateRfidNotificationCompletion:(NSInteger)notification {
117
- NSMutableDictionary *result = [NSMutableDictionary new];
118
-
119
- result[@"notification"] = [NSNumber numberWithInteger:notification];
120
-
121
- return result;
122
- }
123
-
124
- +(NSMutableDictionary*)generateRfidNotificationCompletionWithError:(NSInteger)notification :(NSInteger)value {
125
- NSMutableDictionary *result = [NSMutableDictionary new];
126
-
127
- result[@"notification"] = [NSNumber numberWithInteger:notification];
128
- result[@"value"] = [NSNumber numberWithInteger:value];
129
-
130
- return result;
131
- }
132
-
133
175
  +(NSInteger)generateDocReaderAction:(RGLDocReaderAction)input {
134
176
  NSInteger result = -1;
135
177
  switch (input) {
@@ -168,7 +210,7 @@
168
210
  NSInteger result = 0;
169
211
  switch (input) {
170
212
  case RGLRFIDCompleteActionComplete:
171
- result = 999;
213
+ result = 0;
172
214
  break;
173
215
  case RGLRFIDCompleteActionError:
174
216
  result = 4;
@@ -186,51 +228,13 @@
186
228
  return result;
187
229
  }
188
230
 
189
- +(NSInteger)generateRFIDNotificationAction:(RGLRFIDNotificationAction)input {
190
- return 101;
191
- }
192
-
193
- +(NSMutableDictionary*)generateCompletion:(NSInteger)action :(RGLDocumentReaderResults*)results :(NSError*)error :(RGLRFIDNotify*)notify {
231
+ +(NSMutableDictionary*)generateCompletion:(NSInteger)action :(RGLDocumentReaderResults*)results :(NSError*)error {
194
232
  NSMutableDictionary *result = [NSMutableDictionary new];
195
233
 
196
- switch (action) {
197
- case 0:
198
- case 2:
199
- case 3:
200
- case 4:
201
- case 6:
202
- result[@"results"] = [self generateRGLDocumentReaderResults:results];
203
- break;
204
- case 101:
205
- result[@"results"] = [self generateResultsWithNotification:[self generateRGLRFIDNotify:notify]];
206
- break;
207
- case 999:
208
- result[@"results"] = [self generateResultsWithRFID :results :1];
209
- action = 0;
210
- break;
211
- default:
212
- break;
213
- }
214
-
234
+ if(action == 0 || action == 2 || action == 3 || action == 4 || action == 6)
235
+ result[@"results"] = [self generateRGLDocumentReaderResults:results];
215
236
  result[@"action"] = [NSNumber numberWithInteger:action];
216
- if(error != nil)
217
- result[@"error"] = [self generateNSError:error];
218
-
219
- return result;
220
- }
221
-
222
- +(NSMutableDictionary*)generateResultsWithNotification:(NSMutableDictionary*)input {
223
- NSMutableDictionary *result = [NSMutableDictionary new];
224
-
225
- result[@"documentReaderNotification"] = input;
226
-
227
- return result;
228
- }
229
-
230
- +(NSMutableDictionary*)generateResultsWithRFID:(RGLDocumentReaderResults*)results :(NSInteger)input {
231
- NSMutableDictionary *result = [self generateRGLDocumentReaderResults:results];
232
-
233
- result[@"rfidResult"] = [NSNumber numberWithInteger:input];
237
+ result[@"error"] = [self generateNSError:error];
234
238
 
235
239
  return result;
236
240
  }
@@ -271,15 +275,13 @@
271
275
  return result;
272
276
  }
273
277
 
274
- +(NSMutableDictionary* _Nonnull)generateRGLRFIDNotify:(RGLRFIDNotify* _Nullable)input {
278
+ +(NSMutableDictionary* _Nonnull)generateDocumentReaderNotification:(RGLRFIDNotify* _Nullable)input{
275
279
  NSMutableDictionary *result = [NSMutableDictionary new];
276
280
  if(input == nil) return result;
277
281
 
278
- result[@"code"] = @(input.code);
279
- result[@"value"] = @(input.value);
280
282
  result[@"notificationCode"] = @(input.code & 0xFFFF0000);
281
283
  result[@"dataFileType"] = @(input.code & 0x0000FFFF);
282
- // result[@"progress"] = @(input.value & 0xFFFFFFF0);
284
+ result[@"progress"] = @((int)input.value & 0xFFFFFFF0);
283
285
 
284
286
  return result;
285
287
  }
@@ -506,7 +508,7 @@
506
508
  result[@"fieldName"] = input.fieldName;
507
509
  result[@"fieldRect"] = [self generateCGRect:input.boundRect];
508
510
  result[@"value"] = [UIImageJPEGRepresentation(input.value, 1.0) base64EncodedStringWithOptions:0];
509
- result[@"lightType"] = @(input.lightType);
511
+ result[@"light"] = @(input.lightType);
510
512
  result[@"lightName"] = input.lightName;
511
513
  result[@"pageIndex"] = @(input.pageIndex);
512
514
  result[@"originalPageIndex"] = @(input.originalPageIndex);
@@ -679,6 +681,30 @@
679
681
  result[@"status"] = @(input.status);
680
682
  result[@"extLeSupport"] = @(input.extLeSupport);
681
683
  result[@"processTime"] = @(input.processTime);
684
+ if(input.dataGroups != nil){
685
+ NSMutableArray *array = [NSMutableArray new];
686
+ for(NSNumber* item in input.dataGroups)
687
+ if(item != nil)
688
+ [array addObject:item];
689
+ result[@"dataGroups"] = array;
690
+ }
691
+ if(input.dataFields != nil){
692
+ NSMutableArray *array = [NSMutableArray new];
693
+ for(RGLDataField* item in input.dataFields)
694
+ if(item != nil)
695
+ [array addObject:[self generateRGLDataField:item]];
696
+ result[@"dataFields"] = array;
697
+ }
698
+
699
+ return result;
700
+ }
701
+
702
+ +(NSMutableDictionary* _Nonnull)generateRGLDataField:(RGLDataField* _Nullable)input {
703
+ NSMutableDictionary *result = [NSMutableDictionary new];
704
+ if(input == nil) return result;
705
+
706
+ result[@"data"] = input.data;
707
+ result[@"fieldType"] = @(input.fieldType);
682
708
 
683
709
  return result;
684
710
  }
@@ -990,16 +1016,6 @@
990
1016
  return result;
991
1017
  }
992
1018
 
993
- +(NSMutableDictionary* _Nonnull)generateNSError:(NSError* _Nullable)input {
994
- NSMutableDictionary *result = [NSMutableDictionary new];
995
- if(input == nil) return result;
996
-
997
- result[@"code"] = @(input.code);
998
- result[@"localizedDescription"] = input.localizedDescription;
999
-
1000
- return result;
1001
- }
1002
-
1003
1019
  +(NSMutableDictionary* _Nonnull)generateRGLPAResourcesIssuer:(RGLPAResourcesIssuer* _Nullable)input {
1004
1020
  NSMutableDictionary *result = [NSMutableDictionary new];
1005
1021
  if(input == nil) return result;
@@ -1173,6 +1189,7 @@
1173
1189
  result[@"databaseDescription"] = input.databaseDescription;
1174
1190
  result[@"countriesNumber"] = @(input.countriesNumber);
1175
1191
  result[@"documentsNumber"] = @(input.documentsNumber);
1192
+ result[@"size"] = input.size;
1176
1193
 
1177
1194
  return result;
1178
1195
  }
@@ -1,6 +1,7 @@
1
1
  #ifndef RGLWRegulaConfig_h
2
2
  #define RGLWRegulaConfig_h
3
3
  #import <DocumentReader/DocumentReader.h>
4
+ #import "RGLWJSONConstructor.h"
4
5
  @import CoreGraphics;
5
6
  @import UIKit;
6
7
  @import AVFoundation;
@@ -15,11 +16,11 @@
15
16
  +(void)setProcessParams:(NSDictionary*) options : (RGLProcessParams*) processParams;
16
17
  +(UIColor *)getUIColorObjectFromHexString:(NSString *)hexStr alpha:(CGFloat)alpha;
17
18
  +(unsigned int)intFromHexString:(NSString *)hexStr;
18
- +(UIImage*)imageFromBase64:(NSString *)base64image;
19
19
  +(RGLePassportDataGroup*)RGLePassportDataGroupFromJson:(NSDictionary *) dict;
20
20
  +(RGLeIDDataGroup*)RGLeIDDataGroupFromJson:(NSDictionary*) dict;
21
21
  +(RGLeDLDataGroup*)RGLeDLDataGroupFromJson:(NSDictionary*) dict;
22
22
  +(RGLImageQA*)ImageQAFromJson:(NSDictionary*) dict;
23
23
  +(NSDictionary*)ImageQAToJson:(RGLImageQA*) input;
24
+ +(RGLOnlineProcessingConfig*)RGLOnlineProcessingConfigFromJSON:(NSDictionary*) dict;
24
25
  @end
25
26
  #endif