@regulaforensics/document-reader 8.2.186-beta
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/README.md +18 -0
- package/RNDocumentReader.podspec +21 -0
- package/android/CVDDocumentReader.kt +74 -0
- package/android/build.gradle +36 -0
- package/android/cordova.gradle +12 -0
- package/android/src/main/java/com/regula/plugin/documentreader/BluetoothUtil.kt +160 -0
- package/android/src/main/java/com/regula/plugin/documentreader/Config.kt +826 -0
- package/android/src/main/java/com/regula/plugin/documentreader/JSONConstructor.kt +1795 -0
- package/android/src/main/java/com/regula/plugin/documentreader/Main.kt +573 -0
- package/android/src/main/java/com/regula/plugin/documentreader/RNDocumentReaderModule.kt +100 -0
- package/android/src/main/java/com/regula/plugin/documentreader/Utils.kt +181 -0
- package/examples/capacitor/README.md +12 -0
- package/examples/capacitor/android/app/build.gradle +50 -0
- package/examples/capacitor/android/app/capacitor.build.gradle +22 -0
- package/examples/capacitor/android/app/proguard-rules.pro +21 -0
- package/examples/capacitor/android/app/src/main/AndroidManifest.xml +27 -0
- package/examples/capacitor/android/app/src/main/assets/Regula/.gitkeep +0 -0
- package/examples/capacitor/android/app/src/main/java/com/regula/dr/fullauthrfid/MainActivity.java +5 -0
- package/examples/capacitor/android/app/src/main/res/drawable/ic_launcher.png +0 -0
- package/examples/capacitor/android/app/src/main/res/drawable/splash.png +0 -0
- package/examples/capacitor/android/app/src/main/res/layout/activity_main.xml +12 -0
- package/examples/capacitor/android/app/src/main/res/values/strings.xml +7 -0
- package/examples/capacitor/android/app/src/main/res/values/styles.xml +22 -0
- package/examples/capacitor/android/build.gradle +30 -0
- package/examples/capacitor/android/capacitor.settings.gradle +15 -0
- package/examples/capacitor/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/examples/capacitor/android/gradle/wrapper/gradle-wrapper.properties +7 -0
- package/examples/capacitor/android/gradle.properties +22 -0
- package/examples/capacitor/android/gradlew +252 -0
- package/examples/capacitor/android/gradlew.bat +94 -0
- package/examples/capacitor/android/settings.gradle +5 -0
- package/examples/capacitor/android/variables.gradle +16 -0
- package/examples/capacitor/index.html +10 -0
- package/examples/capacitor/ionic.config.json +7 -0
- package/examples/capacitor/ios/App/App/App.entitlements +5 -0
- package/examples/capacitor/ios/App/App/AppDelegate.swift +49 -0
- package/examples/capacitor/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png +0 -0
- package/examples/capacitor/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json +14 -0
- package/examples/capacitor/ios/App/App/Assets.xcassets/Contents.json +6 -0
- package/examples/capacitor/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json +23 -0
- package/examples/capacitor/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png +0 -0
- package/examples/capacitor/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png +0 -0
- package/examples/capacitor/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png +0 -0
- package/examples/capacitor/ios/App/App/Base.lproj/LaunchScreen.storyboard +32 -0
- package/examples/capacitor/ios/App/App/Base.lproj/Main.storyboard +19 -0
- package/examples/capacitor/ios/App/App/Info.plist +53 -0
- package/examples/capacitor/ios/App/App.xcodeproj/project.pbxproj +414 -0
- package/examples/capacitor/ios/App/App.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/examples/capacitor/ios/App/App.xcworkspace/contents.xcworkspacedata +10 -0
- package/examples/capacitor/ios/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/examples/capacitor/ios/App/Podfile +26 -0
- package/examples/capacitor/ios/App/Podfile.lock +56 -0
- package/examples/capacitor/package-lock.json +3467 -0
- package/examples/capacitor/package.json +29 -0
- package/examples/capacitor/public/assets/.gitkeep +0 -0
- package/examples/capacitor/public/images/document.png +0 -0
- package/examples/capacitor/public/images/portrait.png +0 -0
- package/examples/capacitor/scripts/android.sh +9 -0
- package/examples/capacitor/scripts/ios.sh +8 -0
- package/examples/capacitor/scripts/setup.sh +6 -0
- package/examples/capacitor/src/extra/bt_device.tsx +32 -0
- package/examples/capacitor/src/extra/custom_rfid.tsx +74 -0
- package/examples/capacitor/src/main.css +131 -0
- package/examples/capacitor/src/main.html +41 -0
- package/examples/capacitor/src/main.tsx +175 -0
- package/examples/capacitor/tsconfig.json +5 -0
- package/examples/capacitor/vite.config.ts +17 -0
- package/examples/cordova/.vscode/launch.json +28 -0
- package/examples/cordova/.vscode/typings/cordova/cordova.d.ts +80 -0
- package/examples/cordova/README.md +12 -0
- package/examples/cordova/config.xml +29 -0
- package/examples/cordova/package-lock.json +1314 -0
- package/examples/cordova/package.json +32 -0
- package/examples/cordova/scripts/android.sh +8 -0
- package/examples/cordova/scripts/ios.sh +8 -0
- package/examples/cordova/scripts/setup.sh +8 -0
- package/examples/cordova/www/images/document.png +0 -0
- package/examples/cordova/www/images/logo.png +0 -0
- package/examples/cordova/www/images/portrait.png +0 -0
- package/examples/cordova/www/index.html +21 -0
- package/examples/cordova/www/src/main.css +130 -0
- package/examples/cordova/www/src/main.html +63 -0
- package/examples/cordova/www/src/main.js +50 -0
- package/examples/ionic/README.md +12 -0
- package/examples/ionic/angular.json +39 -0
- package/examples/ionic/config.xml +28 -0
- package/examples/ionic/index.html +19 -0
- package/examples/ionic/index.ts +17 -0
- package/examples/ionic/ionic.config.json +7 -0
- package/examples/ionic/package-lock.json +16559 -0
- package/examples/ionic/package.json +47 -0
- package/examples/ionic/scripts/android.sh +8 -0
- package/examples/ionic/scripts/ios.sh +8 -0
- package/examples/ionic/scripts/setup.sh +8 -0
- package/examples/ionic/src/assets/.gitkeep +0 -0
- package/examples/ionic/src/images/document.png +0 -0
- package/examples/ionic/src/images/icon.png +0 -0
- package/examples/ionic/src/images/portrait.png +0 -0
- package/examples/ionic/src/main.css +130 -0
- package/examples/ionic/src/main.html +63 -0
- package/examples/ionic/src/main.ts +66 -0
- package/examples/ionic/tsconfig.json +12 -0
- package/examples/react_native/README.md +12 -0
- package/examples/react_native/app.config.ts +53 -0
- package/examples/react_native/assets/.gitkeep +0 -0
- package/examples/react_native/images/document.png +0 -0
- package/examples/react_native/images/icon/adaptive-icon.png +0 -0
- package/examples/react_native/images/icon/icon.png +0 -0
- package/examples/react_native/images/portrait.png +0 -0
- package/examples/react_native/index.html +11 -0
- package/examples/react_native/index.tsx +52 -0
- package/examples/react_native/metro.config.js +7 -0
- package/examples/react_native/package-lock.json +9254 -0
- package/examples/react_native/package.json +27 -0
- package/examples/react_native/scripts/android.sh +12 -0
- package/examples/react_native/scripts/ios.sh +11 -0
- package/examples/react_native/scripts/setup.sh +8 -0
- package/examples/react_native/src/main.css +130 -0
- package/examples/react_native/src/main.html +63 -0
- package/examples/react_native/src/main.tsx +50 -0
- package/ios/CVDDocumentReader.h +7 -0
- package/ios/CVDDocumentReader.m +39 -0
- package/ios/RGLWConfig.h +42 -0
- package/ios/RGLWConfig.m +1398 -0
- package/ios/RGLWJSONConstructor.h +185 -0
- package/ios/RGLWJSONConstructor.m +2379 -0
- package/ios/RGLWMain.h +36 -0
- package/ios/RGLWMain.m +610 -0
- package/ios/RNDocumentReader.h +8 -0
- package/ios/RNDocumentReader.m +49 -0
- package/package.json +36 -0
- package/plugin.xml +51 -0
- package/www/capacitor/config/InitConfig.js +25 -0
- package/www/capacitor/config/OnlineProcessingConfig.js +41 -0
- package/www/capacitor/config/RFIDConfig.js +31 -0
- package/www/capacitor/config/RecognizeConfig.js +103 -0
- package/www/capacitor/config/ScannerConfig.js +38 -0
- package/www/capacitor/index.js +486 -0
- package/www/capacitor/info/DocReaderException.js +57 -0
- package/www/capacitor/info/DocReaderScenario.js +71 -0
- package/www/capacitor/info/DocReaderVersion.js +23 -0
- package/www/capacitor/info/DocumentsDatabase.js +27 -0
- package/www/capacitor/info/License.js +22 -0
- package/www/capacitor/info/PrepareProgress.js +23 -0
- package/www/capacitor/info/RFIDException.js +19 -0
- package/www/capacitor/internal/bridge.js +98 -0
- package/www/capacitor/internal/cordova.js +17 -0
- package/www/capacitor/params/Functionality.js +303 -0
- package/www/capacitor/params/customization/Customization.js +550 -0
- package/www/capacitor/params/customization/CustomizationColors.js +74 -0
- package/www/capacitor/params/customization/CustomizationFonts.js +40 -0
- package/www/capacitor/params/customization/CustomizationImages.js +25 -0
- package/www/capacitor/params/customization/Font.js +28 -0
- package/www/capacitor/params/process_params/AuthenticityParams.js +129 -0
- package/www/capacitor/params/process_params/BackendProcessingConfig.js +25 -0
- package/www/capacitor/params/process_params/FaceApiParams.js +38 -0
- package/www/capacitor/params/process_params/FaceApiSearchParams.js +21 -0
- package/www/capacitor/params/process_params/GlaresCheckParams.js +18 -0
- package/www/capacitor/params/process_params/ImageQA.js +97 -0
- package/www/capacitor/params/process_params/LivenessParams.js +67 -0
- package/www/capacitor/params/process_params/ProcessParams.js +570 -0
- package/www/capacitor/params/process_params/RfidParams.js +15 -0
- package/www/capacitor/params/rfid_scenario/DTCDataGroups.js +53 -0
- package/www/capacitor/params/rfid_scenario/EDLDataGroups.js +116 -0
- package/www/capacitor/params/rfid_scenario/EIDDataGroups.js +165 -0
- package/www/capacitor/params/rfid_scenario/EPassportDataGroups.js +130 -0
- package/www/capacitor/params/rfid_scenario/RFIDScenario.js +493 -0
- package/www/capacitor/results/DocumentType.js +285 -0
- package/www/capacitor/results/Position.js +60 -0
- package/www/capacitor/results/Results.js +318 -0
- package/www/capacitor/results/TransactionInfo.js +16 -0
- package/www/capacitor/results/authenticity/Authenticity.js +23 -0
- package/www/capacitor/results/authenticity/AuthenticityCheck.js +33 -0
- package/www/capacitor/results/authenticity/AuthenticityElement.js +27 -0
- package/www/capacitor/results/authenticity/AuthenticityResult.js +26 -0
- package/www/capacitor/results/authenticity/CheckDiagnose.js +124 -0
- package/www/capacitor/results/authenticity/SecurityFeatureType.js +59 -0
- package/www/capacitor/results/barcode/BarcodeField.js +24 -0
- package/www/capacitor/results/barcode/BarcodeResult.js +24 -0
- package/www/capacitor/results/barcode/BarcodeStatus.js +33 -0
- package/www/capacitor/results/barcode/BarcodeType.js +21 -0
- package/www/capacitor/results/barcode/PDF417Info.js +16 -0
- package/www/capacitor/results/image_quality/ImageQuality.js +31 -0
- package/www/capacitor/results/image_quality/ImageQualityCheckType.js +19 -0
- package/www/capacitor/results/image_quality/ImageQualityGroup.js +30 -0
- package/www/capacitor/results/rfid/AccessControlProcedureType.js +21 -0
- package/www/capacitor/results/rfid/Application.js +47 -0
- package/www/capacitor/results/rfid/Attribute.js +16 -0
- package/www/capacitor/results/rfid/Authority.js +28 -0
- package/www/capacitor/results/rfid/CardProperties.js +38 -0
- package/www/capacitor/results/rfid/CertificateChain.js +51 -0
- package/www/capacitor/results/rfid/CertificateData.js +14 -0
- package/www/capacitor/results/rfid/DataField.js +16 -0
- package/www/capacitor/results/rfid/Extension.js +14 -0
- package/www/capacitor/results/rfid/File.js +39 -0
- package/www/capacitor/results/rfid/FileData.js +18 -0
- package/www/capacitor/results/rfid/RFIDAccessControlProcedureType.js +10 -0
- package/www/capacitor/results/rfid/RFIDCertificateType.js +13 -0
- package/www/capacitor/results/rfid/RFIDDataFileType.js +98 -0
- package/www/capacitor/results/rfid/RFIDSessionData.js +76 -0
- package/www/capacitor/results/rfid/RFIDValidity.js +16 -0
- package/www/capacitor/results/rfid/RFIDValue.js +20 -0
- package/www/capacitor/results/rfid/SecurityObject.js +31 -0
- package/www/capacitor/results/rfid/SecurityObjectCertificates.js +14 -0
- package/www/capacitor/results/rfid/SignerInfo.js +57 -0
- package/www/capacitor/results/status/CheckResult.js +5 -0
- package/www/capacitor/results/status/OpticalStatus.js +30 -0
- package/www/capacitor/results/status/RFIDStatus.js +26 -0
- package/www/capacitor/results/status/ResultsStatus.js +28 -0
- package/www/capacitor/results/visible_digital_seals/BytesData.js +18 -0
- package/www/capacitor/results/visible_digital_seals/LDSParsingErrorCodes.js +134 -0
- package/www/capacitor/results/visible_digital_seals/LDSParsingNotificationCodes.js +232 -0
- package/www/capacitor/results/visible_digital_seals/VDSNCData.js +40 -0
- package/www/capacitor/results/visual_results/Comparison.js +19 -0
- package/www/capacitor/results/visual_results/FieldType.js +658 -0
- package/www/capacitor/results/visual_results/GraphicField.js +33 -0
- package/www/capacitor/results/visual_results/GraphicFieldType.js +25 -0
- package/www/capacitor/results/visual_results/GraphicResult.js +22 -0
- package/www/capacitor/results/visual_results/LCID.js +174 -0
- package/www/capacitor/results/visual_results/Lights.js +11 -0
- package/www/capacitor/results/visual_results/RFIDOrigin.js +18 -0
- package/www/capacitor/results/visual_results/Rect.js +18 -0
- package/www/capacitor/results/visual_results/Symbol.js +18 -0
- package/www/capacitor/results/visual_results/TextField.js +68 -0
- package/www/capacitor/results/visual_results/TextResult.js +42 -0
- package/www/capacitor/results/visual_results/TextSource.js +19 -0
- package/www/capacitor/results/visual_results/Validity.js +17 -0
- package/www/capacitor/results/visual_results/Value.js +39 -0
- package/www/capacitor/rfid/PAAttribute.js +17 -0
- package/www/capacitor/rfid/PAResourcesIssuer.js +27 -0
- package/www/capacitor/rfid/PKDCertificate.js +54 -0
- package/www/capacitor/rfid/RFIDErrorCodes.js +123 -0
- package/www/capacitor/rfid/RFIDNotification.js +60 -0
- package/www/capacitor/rfid/TAChallenge.js +23 -0
- package/www/capacitor/rfid/TccParams.js +24 -0
- package/www/cordova.js +9816 -0
- package/www/react-native/config/InitConfig.js +25 -0
- package/www/react-native/config/OnlineProcessingConfig.js +41 -0
- package/www/react-native/config/RFIDConfig.js +31 -0
- package/www/react-native/config/RecognizeConfig.js +103 -0
- package/www/react-native/config/ScannerConfig.js +38 -0
- package/www/react-native/index.js +486 -0
- package/www/react-native/info/DocReaderException.js +57 -0
- package/www/react-native/info/DocReaderScenario.js +71 -0
- package/www/react-native/info/DocReaderVersion.js +23 -0
- package/www/react-native/info/DocumentsDatabase.js +27 -0
- package/www/react-native/info/License.js +22 -0
- package/www/react-native/info/PrepareProgress.js +23 -0
- package/www/react-native/info/RFIDException.js +19 -0
- package/www/react-native/internal/bridge.js +98 -0
- package/www/react-native/params/Functionality.js +303 -0
- package/www/react-native/params/customization/Customization.js +550 -0
- package/www/react-native/params/customization/CustomizationColors.js +74 -0
- package/www/react-native/params/customization/CustomizationFonts.js +40 -0
- package/www/react-native/params/customization/CustomizationImages.js +25 -0
- package/www/react-native/params/customization/Font.js +28 -0
- package/www/react-native/params/process_params/AuthenticityParams.js +129 -0
- package/www/react-native/params/process_params/BackendProcessingConfig.js +25 -0
- package/www/react-native/params/process_params/FaceApiParams.js +38 -0
- package/www/react-native/params/process_params/FaceApiSearchParams.js +21 -0
- package/www/react-native/params/process_params/GlaresCheckParams.js +18 -0
- package/www/react-native/params/process_params/ImageQA.js +97 -0
- package/www/react-native/params/process_params/LivenessParams.js +67 -0
- package/www/react-native/params/process_params/ProcessParams.js +570 -0
- package/www/react-native/params/process_params/RfidParams.js +15 -0
- package/www/react-native/params/rfid_scenario/DTCDataGroups.js +53 -0
- package/www/react-native/params/rfid_scenario/EDLDataGroups.js +116 -0
- package/www/react-native/params/rfid_scenario/EIDDataGroups.js +165 -0
- package/www/react-native/params/rfid_scenario/EPassportDataGroups.js +130 -0
- package/www/react-native/params/rfid_scenario/RFIDScenario.js +493 -0
- package/www/react-native/results/DocumentType.js +285 -0
- package/www/react-native/results/Position.js +60 -0
- package/www/react-native/results/Results.js +318 -0
- package/www/react-native/results/TransactionInfo.js +16 -0
- package/www/react-native/results/authenticity/Authenticity.js +23 -0
- package/www/react-native/results/authenticity/AuthenticityCheck.js +33 -0
- package/www/react-native/results/authenticity/AuthenticityElement.js +27 -0
- package/www/react-native/results/authenticity/AuthenticityResult.js +26 -0
- package/www/react-native/results/authenticity/CheckDiagnose.js +124 -0
- package/www/react-native/results/authenticity/SecurityFeatureType.js +59 -0
- package/www/react-native/results/barcode/BarcodeField.js +24 -0
- package/www/react-native/results/barcode/BarcodeResult.js +24 -0
- package/www/react-native/results/barcode/BarcodeStatus.js +33 -0
- package/www/react-native/results/barcode/BarcodeType.js +21 -0
- package/www/react-native/results/barcode/PDF417Info.js +16 -0
- package/www/react-native/results/image_quality/ImageQuality.js +31 -0
- package/www/react-native/results/image_quality/ImageQualityCheckType.js +19 -0
- package/www/react-native/results/image_quality/ImageQualityGroup.js +30 -0
- package/www/react-native/results/rfid/AccessControlProcedureType.js +21 -0
- package/www/react-native/results/rfid/Application.js +47 -0
- package/www/react-native/results/rfid/Attribute.js +16 -0
- package/www/react-native/results/rfid/Authority.js +28 -0
- package/www/react-native/results/rfid/CardProperties.js +38 -0
- package/www/react-native/results/rfid/CertificateChain.js +51 -0
- package/www/react-native/results/rfid/CertificateData.js +14 -0
- package/www/react-native/results/rfid/DataField.js +16 -0
- package/www/react-native/results/rfid/Extension.js +14 -0
- package/www/react-native/results/rfid/File.js +39 -0
- package/www/react-native/results/rfid/FileData.js +18 -0
- package/www/react-native/results/rfid/RFIDAccessControlProcedureType.js +10 -0
- package/www/react-native/results/rfid/RFIDCertificateType.js +13 -0
- package/www/react-native/results/rfid/RFIDDataFileType.js +98 -0
- package/www/react-native/results/rfid/RFIDSessionData.js +76 -0
- package/www/react-native/results/rfid/RFIDValidity.js +16 -0
- package/www/react-native/results/rfid/RFIDValue.js +20 -0
- package/www/react-native/results/rfid/SecurityObject.js +31 -0
- package/www/react-native/results/rfid/SecurityObjectCertificates.js +14 -0
- package/www/react-native/results/rfid/SignerInfo.js +57 -0
- package/www/react-native/results/status/CheckResult.js +5 -0
- package/www/react-native/results/status/OpticalStatus.js +30 -0
- package/www/react-native/results/status/RFIDStatus.js +26 -0
- package/www/react-native/results/status/ResultsStatus.js +28 -0
- package/www/react-native/results/visible_digital_seals/BytesData.js +18 -0
- package/www/react-native/results/visible_digital_seals/LDSParsingErrorCodes.js +134 -0
- package/www/react-native/results/visible_digital_seals/LDSParsingNotificationCodes.js +232 -0
- package/www/react-native/results/visible_digital_seals/VDSNCData.js +40 -0
- package/www/react-native/results/visual_results/Comparison.js +19 -0
- package/www/react-native/results/visual_results/FieldType.js +658 -0
- package/www/react-native/results/visual_results/GraphicField.js +33 -0
- package/www/react-native/results/visual_results/GraphicFieldType.js +25 -0
- package/www/react-native/results/visual_results/GraphicResult.js +22 -0
- package/www/react-native/results/visual_results/LCID.js +174 -0
- package/www/react-native/results/visual_results/Lights.js +11 -0
- package/www/react-native/results/visual_results/RFIDOrigin.js +18 -0
- package/www/react-native/results/visual_results/Rect.js +18 -0
- package/www/react-native/results/visual_results/Symbol.js +18 -0
- package/www/react-native/results/visual_results/TextField.js +68 -0
- package/www/react-native/results/visual_results/TextResult.js +42 -0
- package/www/react-native/results/visual_results/TextSource.js +19 -0
- package/www/react-native/results/visual_results/Validity.js +17 -0
- package/www/react-native/results/visual_results/Value.js +39 -0
- package/www/react-native/rfid/PAAttribute.js +17 -0
- package/www/react-native/rfid/PAResourcesIssuer.js +27 -0
- package/www/react-native/rfid/PKDCertificate.js +54 -0
- package/www/react-native/rfid/RFIDErrorCodes.js +123 -0
- package/www/react-native/rfid/RFIDNotification.js +60 -0
- package/www/react-native/rfid/TAChallenge.js +23 -0
- package/www/react-native/rfid/TccParams.js +24 -0
- package/www/types/config/InitConfig.d.ts +63 -0
- package/www/types/config/OnlineProcessingConfig.d.ts +22 -0
- package/www/types/config/RFIDConfig.d.ts +131 -0
- package/www/types/config/RecognizeConfig.d.ts +119 -0
- package/www/types/config/ScannerConfig.d.ts +54 -0
- package/www/types/index.d.ts +421 -0
- package/www/types/info/DocReaderException.d.ts +79 -0
- package/www/types/info/DocReaderScenario.d.ts +90 -0
- package/www/types/info/DocReaderVersion.d.ts +28 -0
- package/www/types/info/DocumentsDatabase.d.ts +42 -0
- package/www/types/info/License.d.ts +23 -0
- package/www/types/info/PrepareProgress.d.ts +15 -0
- package/www/types/info/RFIDException.d.ts +8 -0
- package/www/types/params/Functionality.d.ts +316 -0
- package/www/types/params/customization/Customization.d.ts +558 -0
- package/www/types/params/customization/CustomizationColors.d.ts +16 -0
- package/www/types/params/customization/CustomizationFonts.d.ts +13 -0
- package/www/types/params/customization/CustomizationImages.d.ts +12 -0
- package/www/types/params/customization/Font.d.ts +36 -0
- package/www/types/params/process_params/AuthenticityParams.d.ts +30 -0
- package/www/types/params/process_params/BackendProcessingConfig.d.ts +25 -0
- package/www/types/params/process_params/FaceApiParams.d.ts +68 -0
- package/www/types/params/process_params/FaceApiSearchParams.d.ts +35 -0
- package/www/types/params/process_params/GlaresCheckParams.d.ts +26 -0
- package/www/types/params/process_params/ImageQA.d.ts +79 -0
- package/www/types/params/process_params/LivenessParams.d.ts +20 -0
- package/www/types/params/process_params/ProcessParams.d.ts +465 -0
- package/www/types/params/process_params/RfidParams.d.ts +19 -0
- package/www/types/params/rfid_scenario/DTCDataGroups.d.ts +13 -0
- package/www/types/params/rfid_scenario/EDLDataGroups.d.ts +22 -0
- package/www/types/params/rfid_scenario/EIDDataGroups.d.ts +29 -0
- package/www/types/params/rfid_scenario/EPassportDataGroups.d.ts +24 -0
- package/www/types/params/rfid_scenario/RFIDScenario.d.ts +167 -0
- package/www/types/results/DocumentType.d.ts +525 -0
- package/www/types/results/Position.d.ts +50 -0
- package/www/types/results/Results.d.ts +283 -0
- package/www/types/results/TransactionInfo.d.ts +9 -0
- package/www/types/results/authenticity/Authenticity.d.ts +67 -0
- package/www/types/results/authenticity/AuthenticityCheck.d.ts +23 -0
- package/www/types/results/authenticity/AuthenticityElement.d.ts +26 -0
- package/www/types/results/authenticity/AuthenticityResult.d.ts +16 -0
- package/www/types/results/authenticity/CheckDiagnose.d.ts +229 -0
- package/www/types/results/authenticity/SecurityFeatureType.d.ts +100 -0
- package/www/types/results/barcode/BarcodeField.d.ts +37 -0
- package/www/types/results/barcode/BarcodeResult.d.ts +14 -0
- package/www/types/results/barcode/BarcodeStatus.d.ts +66 -0
- package/www/types/results/barcode/BarcodeType.d.ts +45 -0
- package/www/types/results/barcode/PDF417Info.d.ts +15 -0
- package/www/types/results/image_quality/ImageQuality.d.ts +18 -0
- package/www/types/results/image_quality/ImageQualityCheckType.d.ts +30 -0
- package/www/types/results/image_quality/ImageQualityGroup.d.ts +17 -0
- package/www/types/results/rfid/AccessControlProcedureType.d.ts +21 -0
- package/www/types/results/rfid/Application.d.ts +44 -0
- package/www/types/results/rfid/Attribute.d.ts +9 -0
- package/www/types/results/rfid/Authority.d.ts +11 -0
- package/www/types/results/rfid/CardProperties.d.ts +48 -0
- package/www/types/results/rfid/CertificateChain.d.ts +28 -0
- package/www/types/results/rfid/CertificateData.d.ts +7 -0
- package/www/types/results/rfid/DataField.d.ts +9 -0
- package/www/types/results/rfid/Extension.d.ts +7 -0
- package/www/types/results/rfid/File.d.ts +22 -0
- package/www/types/results/rfid/FileData.d.ts +9 -0
- package/www/types/results/rfid/RFIDAccessControlProcedureType.d.ts +18 -0
- package/www/types/results/rfid/RFIDCertificateType.d.ts +13 -0
- package/www/types/results/rfid/RFIDDataFileType.d.ts +101 -0
- package/www/types/results/rfid/RFIDSessionData.d.ts +48 -0
- package/www/types/results/rfid/RFIDValidity.d.ts +9 -0
- package/www/types/results/rfid/RFIDValue.d.ts +10 -0
- package/www/types/results/rfid/SecurityObject.d.ts +28 -0
- package/www/types/results/rfid/SecurityObjectCertificates.d.ts +8 -0
- package/www/types/results/rfid/SignerInfo.d.ts +41 -0
- package/www/types/results/status/CheckResult.d.ts +8 -0
- package/www/types/results/status/OpticalStatus.d.ts +29 -0
- package/www/types/results/status/RFIDStatus.d.ts +22 -0
- package/www/types/results/status/ResultsStatus.d.ts +24 -0
- package/www/types/results/visible_digital_seals/BytesData.d.ts +9 -0
- package/www/types/results/visible_digital_seals/LDSParsingErrorCodes.d.ts +132 -0
- package/www/types/results/visible_digital_seals/LDSParsingNotificationCodes.d.ts +230 -0
- package/www/types/results/visible_digital_seals/VDSNCData.d.ts +35 -0
- package/www/types/results/visual_results/Comparison.d.ts +15 -0
- package/www/types/results/visual_results/FieldType.d.ts +1310 -0
- package/www/types/results/visual_results/GraphicField.d.ts +29 -0
- package/www/types/results/visual_results/GraphicFieldType.d.ts +52 -0
- package/www/types/results/visual_results/GraphicResult.d.ts +10 -0
- package/www/types/results/visual_results/LCID.d.ts +173 -0
- package/www/types/results/visual_results/Lights.d.ts +23 -0
- package/www/types/results/visual_results/RFIDOrigin.d.ts +10 -0
- package/www/types/results/visual_results/Rect.d.ts +9 -0
- package/www/types/results/visual_results/Symbol.d.ts +14 -0
- package/www/types/results/visual_results/TextField.d.ts +40 -0
- package/www/types/results/visual_results/TextResult.d.ts +23 -0
- package/www/types/results/visual_results/TextSource.d.ts +15 -0
- package/www/types/results/visual_results/Validity.d.ts +13 -0
- package/www/types/results/visual_results/Value.d.ts +27 -0
- package/www/types/rfid/PAAttribute.d.ts +4 -0
- package/www/types/rfid/PAResourcesIssuer.d.ts +7 -0
- package/www/types/rfid/PKDCertificate.d.ts +34 -0
- package/www/types/rfid/RFIDErrorCodes.d.ts +121 -0
- package/www/types/rfid/RFIDNotification.d.ts +153 -0
- package/www/types/rfid/TAChallenge.d.ts +7 -0
- package/www/types/rfid/TccParams.d.ts +25 -0
|
@@ -0,0 +1,2379 @@
|
|
|
1
|
+
#import <Foundation/Foundation.h>
|
|
2
|
+
#import "RGLWJSONConstructor.h"
|
|
3
|
+
|
|
4
|
+
@implementation RGLWJSONConstructor
|
|
5
|
+
|
|
6
|
+
static NSMutableArray* weakReferencesHolder;
|
|
7
|
+
+(void) holdWeakReference:(id)reference {
|
|
8
|
+
if(!weakReferencesHolder)
|
|
9
|
+
weakReferencesHolder = [NSMutableArray new];
|
|
10
|
+
[weakReferencesHolder addObject:reference];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
+(id)toSendable:(id)input {
|
|
14
|
+
if (!input || [input isEqual:[NSNull null]]) return nil;
|
|
15
|
+
if ([input isKindOfClass:[NSDictionary class]] || [input isKindOfClass:[NSArray class]])
|
|
16
|
+
return [[NSString alloc] initWithData:[NSJSONSerialization dataWithJSONObject:input
|
|
17
|
+
options:NSJSONWritingPrettyPrinted
|
|
18
|
+
error:nil]
|
|
19
|
+
encoding:NSUTF8StringEncoding];
|
|
20
|
+
return input;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
+(NSString*)dictToString:(NSDictionary*)input {
|
|
24
|
+
if(input == nil) return nil;
|
|
25
|
+
return [[NSString alloc] initWithData:[NSJSONSerialization dataWithJSONObject:input options:NSJSONWritingPrettyPrinted error:nil] encoding:NSUTF8StringEncoding];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
+(NSString*)arrayToString:(NSArray*)input {
|
|
29
|
+
if(input == nil) return nil;
|
|
30
|
+
return [[NSString alloc] initWithData:[NSJSONSerialization dataWithJSONObject:input options:NSJSONWritingPrettyPrinted error:nil] encoding:NSUTF8StringEncoding];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
+(NSData*)base64Decode:(NSString*)input {
|
|
34
|
+
if(input == nil) return nil;
|
|
35
|
+
if ([input hasPrefix:@"data"]) input = [input substringFromIndex:[input rangeOfString:@","].location + 1];
|
|
36
|
+
return [[NSData alloc] initWithBase64EncodedString:input options:0];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
+(NSString*)base64Encode:(NSData*)input {
|
|
40
|
+
if(input == nil) return nil;
|
|
41
|
+
return [input base64EncodedStringWithOptions:0];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
+(UIImage*)imageWithBase64:(NSString*)input {
|
|
45
|
+
if(input == nil) return nil;
|
|
46
|
+
return [UIImage imageWithData:[self base64Decode:input]];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
+(NSString*)base64WithImage:(UIImage*)input {
|
|
50
|
+
return [self base64Encode: UIImagePNGRepresentation(input)];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
+(NSError*)errorFromJson:(NSDictionary*)input {
|
|
54
|
+
if(input == nil) return nil;
|
|
55
|
+
NSInteger code = [[input valueForKey:@"code"] integerValue];
|
|
56
|
+
NSString* message = [input valueForKey:@"message"];
|
|
57
|
+
NSDictionary *userInfo = @{NSLocalizedDescriptionKey: NSLocalizedString(message, nil)};
|
|
58
|
+
return [NSError errorWithDomain:RGLDocumentReaderDomain code:code userInfo:userInfo];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
+(NSDictionary*)generateError:(NSError*)input {
|
|
62
|
+
if(input == nil) return nil;
|
|
63
|
+
NSMutableDictionary *result = [NSMutableDictionary new];
|
|
64
|
+
|
|
65
|
+
result[@"code"] = [NSNumber numberWithInteger:input.code];
|
|
66
|
+
result[@"message"] = input.localizedDescription;
|
|
67
|
+
|
|
68
|
+
return result;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
+(NSString*)generateCompletion:(NSNumber*)action :(RGLDocumentReaderResults*)results :(NSError*)error {
|
|
72
|
+
NSMutableDictionary *result = [NSMutableDictionary new];
|
|
73
|
+
int actionInt = [action intValue];
|
|
74
|
+
|
|
75
|
+
if(actionInt == 0 || actionInt == 2 || actionInt == 3 || actionInt == 4 || actionInt == 6)
|
|
76
|
+
result[@"results"] = [self generateDocumentReaderResults:results];
|
|
77
|
+
result[@"action"] = action;
|
|
78
|
+
result[@"error"] = [self generateError:error];
|
|
79
|
+
|
|
80
|
+
return [RGLWJSONConstructor dictToString: result];
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
+(NSString*)generateSuccessCompletion:(BOOL)success :(NSError*)error {
|
|
84
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
85
|
+
|
|
86
|
+
result[@"success"] = success? @YES : @NO;
|
|
87
|
+
result[@"error"] = [self generateError:error];
|
|
88
|
+
|
|
89
|
+
return [RGLWJSONConstructor dictToString: result];
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
+(NSString*)generatePACertificateCompletion:(NSData *)serialNumber :(RGLPAResourcesIssuer *)issuer{
|
|
93
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
94
|
+
|
|
95
|
+
result[@"serialNumber"] = [self base64Encode:serialNumber];;
|
|
96
|
+
result[@"issuer"] = [self generatePAResourcesIssuer:issuer];
|
|
97
|
+
|
|
98
|
+
return [RGLWJSONConstructor dictToString: result];
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
+(NSString*)generateFinalizePackageCompletion:(NSNumber*)action :(RGLTransactionInfo*)info :(NSError*)error {
|
|
102
|
+
NSMutableDictionary *result = [NSMutableDictionary new];
|
|
103
|
+
|
|
104
|
+
result[@"action"] = action;
|
|
105
|
+
result[@"info"] = [self generateTransactionInfo:info];
|
|
106
|
+
result[@"error"] = [self generateError:error];
|
|
107
|
+
|
|
108
|
+
return [RGLWJSONConstructor dictToString: result];
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
+(RGLTransactionInfo*)transactionInfoFromJson:(NSDictionary*)input {
|
|
112
|
+
if(input == nil) return nil;
|
|
113
|
+
|
|
114
|
+
NSString* transactionId = [input valueForKey:@"transactionId"];
|
|
115
|
+
NSString* tag = [input valueForKey:@"tag"];
|
|
116
|
+
NSString* sessionLogFolder = input[@"sessionLogFolder"];
|
|
117
|
+
|
|
118
|
+
return [[RGLTransactionInfo alloc] initWithTag:tag transactionId:transactionId sessionLogFolder:sessionLogFolder];
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
+(NSDictionary*)generateTransactionInfo:(RGLTransactionInfo*)input {
|
|
122
|
+
if(input == nil) return nil;
|
|
123
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
124
|
+
|
|
125
|
+
result[@"transactionId"] = input.transactionId;
|
|
126
|
+
result[@"tag"] = input.tag;
|
|
127
|
+
result[@"sessionLogFolder"] = input.sessionLogFolder;
|
|
128
|
+
|
|
129
|
+
return result;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
+(RGLTCCParams*)tccParamsFromJson:(NSDictionary*)input {
|
|
133
|
+
if(input == nil) return nil;
|
|
134
|
+
|
|
135
|
+
NSString* serviceTAURLString = [input valueForKey:@"serviceUrlTA"];
|
|
136
|
+
NSString* servicePAURLString = [input valueForKey:@"serviceUrlPA"];
|
|
137
|
+
NSString* pfxCertURLString = [input valueForKey:@"pfxCertUrl"];
|
|
138
|
+
NSString* pfxPassPhrase = [input valueForKey:@"pfxPassPhrase"];
|
|
139
|
+
NSData* pfxCertData = [self base64Decode:[input objectForKey:@"pfxCert"]];
|
|
140
|
+
|
|
141
|
+
return [[RGLTCCParams alloc] initWithServiceTAURLString:serviceTAURLString servicePAURLString:servicePAURLString pfxCertURLString:pfxCertURLString pfxCertData: pfxCertData pfxPassPhrase:pfxPassPhrase];
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
+(NSDictionary*)generateTCCParams:(RGLTCCParams*)input {
|
|
145
|
+
if(input == nil) return nil;
|
|
146
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
147
|
+
|
|
148
|
+
result[@"serviceUrlTA"] = input.serviceTAURLString;
|
|
149
|
+
result[@"serviceUrlPA"] = input.servicePAURLString;
|
|
150
|
+
result[@"pfxCertUrl"] = input.pfxCertURLString;
|
|
151
|
+
result[@"pfxPassPhrase"] = input.pfxPassPhrase;
|
|
152
|
+
result[@"pfxCert"] = [self base64Encode:input.pfxCertData];
|
|
153
|
+
|
|
154
|
+
return result;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
+(RGLConfig*)configFromJson:(NSDictionary*)input {
|
|
158
|
+
if (!input) return nil;
|
|
159
|
+
if (!input[@"license"]) return nil;
|
|
160
|
+
RGLConfig *config = [[RGLConfig alloc] initWithLicenseData:[self base64Decode: input[@"license"]]];
|
|
161
|
+
|
|
162
|
+
if (input[@"databasePath"]) config.databasePath = [[NSBundle mainBundle] pathForResource:input[@"databasePath"] ofType:nil];
|
|
163
|
+
if (input[@"licenseUpdate"]) config.licenseUpdateCheck = [input[@"licenseUpdate"] boolValue];
|
|
164
|
+
if (input[@"delayedNNLoad"]) config.delayedNNLoadEnabled = [input[@"delayedNNLoad"] boolValue];
|
|
165
|
+
|
|
166
|
+
return config;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
+(NSDictionary*)generateConfig:(RGLConfig*)input {
|
|
170
|
+
if(input == nil) return nil;
|
|
171
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
172
|
+
|
|
173
|
+
result[@"license"] = [self base64Encode: input.licenseData];
|
|
174
|
+
result[@"databasePath"] = input.databasePath;
|
|
175
|
+
result[@"licenseUpdate"] = @(input.licenseUpdateCheck);
|
|
176
|
+
result[@"delayedNNLoad"] = @(input.delayedNNLoadEnabled);
|
|
177
|
+
|
|
178
|
+
return result;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
+(RGLBleConfig*)bleDeviceConfigFromJson:(NSDictionary*)input :(RGLBluetooth*)bluetooth {
|
|
182
|
+
if (!input) return nil;
|
|
183
|
+
RGLBleConfig *config = [[RGLBleConfig alloc] initWithBluetooth:bluetooth];
|
|
184
|
+
|
|
185
|
+
if (input[@"databasePath"]) config.databasePath = [[NSBundle mainBundle] pathForResource:input[@"databasePath"] ofType:nil];
|
|
186
|
+
if (input[@"licenseUpdate"]) config.licenseUpdateCheck = [input[@"licenseUpdate"] boolValue];
|
|
187
|
+
if (input[@"delayedNNLoad"]) config.delayedNNLoadEnabled = [input[@"delayedNNLoad"] boolValue];
|
|
188
|
+
|
|
189
|
+
return config;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
+(RGLScannerConfig*)scannerConfigFromJson:(NSDictionary*)input {
|
|
193
|
+
RGLScannerConfig *config = [RGLScannerConfig alloc];
|
|
194
|
+
if (input[@"scenario"]) config = [config initWithScenario:input[@"scenario"]];
|
|
195
|
+
else config = [config initWithOnlineProcessingConfig:[self onlineProcessingConfigFromJson:input[@"onlineProcessingConfig"]]];
|
|
196
|
+
|
|
197
|
+
if(input[@"onlineProcessingConfig"])
|
|
198
|
+
config.onlineProcessingConfig = [self onlineProcessingConfigFromJson:input[@"onlineProcessingConfig"]];
|
|
199
|
+
if(input[@"livePortrait"])
|
|
200
|
+
config.livePortrait = [self imageWithBase64:input[@"livePortrait"]];
|
|
201
|
+
if(input[@"extPortrait"])
|
|
202
|
+
config.extPortrait = [self imageWithBase64:input[@"extPortrait"]];
|
|
203
|
+
|
|
204
|
+
return config;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
+(NSDictionary*)generateScannerConfig:(RGLScannerConfig*)input {
|
|
208
|
+
if(input == nil) return nil;
|
|
209
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
210
|
+
|
|
211
|
+
result[@"scenario"] = input.scenario;
|
|
212
|
+
result[@"onlineProcessingConfig"] = [self generateOnlineProcessingConfig: input.onlineProcessingConfig];
|
|
213
|
+
result[@"livePortrait"] = [self base64WithImage: input.livePortrait];
|
|
214
|
+
result[@"extPortrait"] = [self base64WithImage: input.extPortrait];
|
|
215
|
+
|
|
216
|
+
return result;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
+(RGLRecognizeConfig*)recognizeConfigFromJson:(NSDictionary*)input {
|
|
220
|
+
RGLRecognizeConfig *config = [RGLRecognizeConfig alloc];
|
|
221
|
+
if (input[@"scenario"]) config = [config initWithScenario:input[@"scenario"]];
|
|
222
|
+
else config = [config initWithOnlineProcessingConfig:[self onlineProcessingConfigFromJson:input[@"onlineProcessingConfig"]]];
|
|
223
|
+
|
|
224
|
+
if (input[@"image"]) config.image = [RGLWJSONConstructor imageWithBase64:input[@"image"]];
|
|
225
|
+
if (input[@"data"]) config.imageData = [RGLWJSONConstructor base64Decode:input[@"data"]];
|
|
226
|
+
if (input[@"images"]) {
|
|
227
|
+
NSMutableArray<UIImage*>* images = [NSMutableArray new];
|
|
228
|
+
for(NSString* base64 in input[@"images"])
|
|
229
|
+
[images addObject:[RGLWJSONConstructor imageWithBase64:base64]];
|
|
230
|
+
config.images = images;
|
|
231
|
+
}
|
|
232
|
+
if(input[@"imageInputData"]) {
|
|
233
|
+
NSMutableArray<RGLImageInput*>* imageInputs = [NSMutableArray new];
|
|
234
|
+
for(NSDictionary* imageInput in input[@"imageInputData"])
|
|
235
|
+
[imageInputs addObject:[RGLWJSONConstructor imageInputFromJson: imageInput]];
|
|
236
|
+
config.imageInputs = imageInputs;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
if (input[@"scenario"]) config.scenario = input[@"scenario"];
|
|
240
|
+
if (input[@"livePortrait"]) config.livePortrait = [self imageWithBase64:input[@"livePortrait"]];
|
|
241
|
+
if (input[@"extPortrait"]) config.extPortrait = [self imageWithBase64:input[@"extPortrait"]];
|
|
242
|
+
if (input[@"oneShotIdentification"]) config.oneShotIdentification = input[@"oneShotIdentification"];
|
|
243
|
+
if (input[@"dtc"]) config.dtc = [RGLWJSONConstructor base64Decode:input[@"dtc"]];
|
|
244
|
+
|
|
245
|
+
return config;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
+(NSDictionary*)generateRecognizeConfig:(RGLRecognizeConfig*)input {
|
|
249
|
+
if(input == nil) return nil;
|
|
250
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
251
|
+
|
|
252
|
+
result[@"scenario"] = input.scenario;
|
|
253
|
+
result[@"onlineProcessingConfig"] = [self generateOnlineProcessingConfig: input.onlineProcessingConfig];
|
|
254
|
+
result[@"livePortrait"] = [self base64WithImage: input.livePortrait];
|
|
255
|
+
result[@"extPortrait"] = [self base64WithImage: input.extPortrait];
|
|
256
|
+
result[@"oneShotIdentification"] = @(input.oneShotIdentification);
|
|
257
|
+
result[@"dtc"] = [self base64Encode: input.dtc];
|
|
258
|
+
result[@"image"] = [self base64WithImage: input.image];
|
|
259
|
+
result[@"data"] = [self base64Encode: input.imageData];
|
|
260
|
+
if(input.images != nil) {
|
|
261
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
262
|
+
for(UIImage* item in input.images)
|
|
263
|
+
[array addObject:[self base64WithImage:item]];
|
|
264
|
+
result[@"images"] = array;
|
|
265
|
+
}
|
|
266
|
+
if(input.imageInputs != nil) {
|
|
267
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
268
|
+
for(RGLImageInput* item in input.imageInputs)
|
|
269
|
+
[array addObject:[self generateImageInput:item]];
|
|
270
|
+
result[@"imageInputData"] = array;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
return result;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
+(RGLBackendProcessingConfig*)backendProcessingConfigFromJson:(NSDictionary*)input {
|
|
277
|
+
if(input == nil) return nil;
|
|
278
|
+
RGLBackendProcessingConfig *result = [RGLBackendProcessingConfig new];
|
|
279
|
+
|
|
280
|
+
if([input valueForKey:@"url"] != nil)
|
|
281
|
+
result.url = [input valueForKey:@"url"];
|
|
282
|
+
if([input valueForKey:@"httpHeaders"] != nil)
|
|
283
|
+
result.httpHeaders = [input valueForKey:@"httpHeaders"];
|
|
284
|
+
if([input valueForKey:@"rfidServerSideChipVerification"] != nil)
|
|
285
|
+
result.rfidServerSideChipVerification = [input valueForKey:@"rfidServerSideChipVerification"];
|
|
286
|
+
if (input[@"timeoutConnection"]) result.timeoutConnection = input[@"timeoutConnection"];
|
|
287
|
+
|
|
288
|
+
return result;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
+(NSDictionary*)generateBackendProcessingConfig:(RGLBackendProcessingConfig*)input {
|
|
292
|
+
if(input == nil) return nil;
|
|
293
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
294
|
+
|
|
295
|
+
result[@"url"] = input.url;
|
|
296
|
+
result[@"httpHeaders"] = input.httpHeaders;
|
|
297
|
+
result[@"rfidServerSideChipVerification"] = input.rfidServerSideChipVerification;
|
|
298
|
+
result[@"timeoutConnection"] = input.timeoutConnection;
|
|
299
|
+
|
|
300
|
+
return result;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
+(RGLImageQA*)imageQAFromJson:(NSDictionary*)input {
|
|
304
|
+
RGLImageQA *result = [RGLImageQA new];
|
|
305
|
+
[RGLWConfig setImageQA:result input:input];
|
|
306
|
+
return result;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
+(NSDictionary*)generateImageQA:(RGLImageQA*)input {
|
|
310
|
+
return [RGLWConfig getImageQA:input];
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
+(RGLAuthenticityParams*)authenticityParamsFromJson:(NSDictionary*)input {
|
|
314
|
+
RGLAuthenticityParams *result = [RGLAuthenticityParams defaultParams];
|
|
315
|
+
[RGLWConfig setAuthenticityParams:result input:input];
|
|
316
|
+
return result;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
+(NSDictionary*)generateAuthenticityParams:(RGLAuthenticityParams*)input {
|
|
320
|
+
return [RGLWConfig getAuthenticityParams:input];
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
+(RGLLivenessParams*)livenessParamsFromJson:(NSDictionary*)input {
|
|
324
|
+
RGLLivenessParams *result = [RGLLivenessParams defaultParams];
|
|
325
|
+
[RGLWConfig setLivenessParams:result input:input];
|
|
326
|
+
return result;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
+(NSDictionary*)generateLivenessParams:(RGLLivenessParams*)input {
|
|
330
|
+
return [RGLWConfig getLivenessParams:input];
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
+(RGLeDLDataGroup*)eDLDataGroupsFromJson:(NSDictionary*)input {
|
|
334
|
+
RGLeDLDataGroup *result = [RGLeDLDataGroup new];
|
|
335
|
+
[RGLWConfig setDataGroups :result dict:input];
|
|
336
|
+
return result;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
+(NSDictionary*)generateEDLDataGroups:(RGLeDLDataGroup*)input {
|
|
340
|
+
return [RGLWConfig getDataGroups:input];
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
+(RGLePassportDataGroup*)ePassportDataGroupsFromJson:(NSDictionary*)input {
|
|
344
|
+
RGLePassportDataGroup *result = [RGLePassportDataGroup new];
|
|
345
|
+
[RGLWConfig setDataGroups :result dict:input];
|
|
346
|
+
return result;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
+(NSDictionary*)generateEPassportDataGroups:(RGLePassportDataGroup*)input {
|
|
350
|
+
return [RGLWConfig getDataGroups:input];
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
+(RGLeIDDataGroup*)eIDDataGroupsFromJson:(NSDictionary*)input {
|
|
354
|
+
RGLeIDDataGroup *result = [RGLeIDDataGroup new];
|
|
355
|
+
[RGLWConfig setDataGroups :result dict:input];
|
|
356
|
+
return result;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
+(NSDictionary*)generateEIDDataGroups:(RGLeIDDataGroup*)input {
|
|
360
|
+
return [RGLWConfig getDataGroups:input];
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
+(RGLDTCDataGroup*)dtcDataGroupFromJson:(NSDictionary*)input {
|
|
364
|
+
RGLDTCDataGroup *result = [RGLDTCDataGroup new];
|
|
365
|
+
[RGLWConfig setDTCDataGroup:result dict:input];
|
|
366
|
+
return result;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
+(NSDictionary*)generateRGLDTCDataGroup:(RGLDTCDataGroup*)input {
|
|
370
|
+
return [RGLWConfig getDTCDataGroup:input];
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
+(RGLRFIDScenario*)rfidScenarioFromJson:(NSDictionary*)input {
|
|
374
|
+
RGLRFIDScenario *result = [RGLRFIDScenario new];
|
|
375
|
+
[RGLWConfig setRfidScenario:input :result];
|
|
376
|
+
return result;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
+(NSDictionary*)generateRFIDScenario:(RGLRFIDScenario*)input {
|
|
380
|
+
return [RGLWConfig getRfidScenario:input];
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
+(RGLCustomization*)customizationFromJson:(NSDictionary*)input {
|
|
384
|
+
RGLCustomization *result = [RGLCustomization new];
|
|
385
|
+
[RGLWConfig setCustomization:input :result];
|
|
386
|
+
return result;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
+(NSDictionary*)generateCustomization:(RGLCustomization*)input {
|
|
390
|
+
return [RGLWConfig getCustomization:input];
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
+(RGLFunctionality*)functionalityFromJson:(NSDictionary*)input {
|
|
394
|
+
RGLFunctionality *result = [RGLFunctionality new];
|
|
395
|
+
[RGLWConfig setFunctionality:input :result];
|
|
396
|
+
return result;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
+(NSDictionary*)generateFunctionality:(RGLFunctionality*)input {
|
|
400
|
+
return [RGLWConfig getFunctionality:input];
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
+(RGLOnlineProcessingConfig*)onlineProcessingConfigFromJson:(NSDictionary*)input {
|
|
404
|
+
if(input == nil) return nil;
|
|
405
|
+
if([input valueForKey:@"mode"] == nil) return nil;
|
|
406
|
+
|
|
407
|
+
RGLOnlineProcessingConfig *result = [[RGLOnlineProcessingConfig alloc] initWithMode:[[input valueForKey:@"mode"] integerValue]];
|
|
408
|
+
|
|
409
|
+
if([input valueForKey:@"imageFormat"] != nil)
|
|
410
|
+
result.imageFormat = [[input valueForKey:@"imageFormat"] integerValue];
|
|
411
|
+
if([input valueForKey:@"url"] != nil)
|
|
412
|
+
result.serviceURL = [input valueForKey:@"url"];
|
|
413
|
+
if([input valueForKey:@"imageCompressionQuality"] != nil)
|
|
414
|
+
result.imageCompressionQuality = [[input valueForKey:@"imageCompressionQuality"] floatValue];
|
|
415
|
+
if([input valueForKey:@"processParams"] != nil) {
|
|
416
|
+
RGLProcessParams *params = [RGLProcessParams new];
|
|
417
|
+
[RGLWConfig setProcessParams:[input valueForKey:@"processParams"] :params];
|
|
418
|
+
result.processParams = params;
|
|
419
|
+
}
|
|
420
|
+
if([input valueForKey:@"requestHeaders"] != nil) {
|
|
421
|
+
RGLWRequestInterceptorProxy* proxy = [[RGLWRequestInterceptorProxy alloc] initWithHeaders:[input valueForKey:@"requestHeaders"]];
|
|
422
|
+
[self holdWeakReference: proxy];
|
|
423
|
+
result.requestInterceptingDelegate = proxy;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
return result;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
+(NSDictionary*)generateOnlineProcessingConfig:(RGLOnlineProcessingConfig*)input {
|
|
430
|
+
if(input == nil) return nil;
|
|
431
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
432
|
+
|
|
433
|
+
result[@"mode"] = @(input.mode);
|
|
434
|
+
result[@"url"] = input.serviceURL;
|
|
435
|
+
result[@"processParams"] = [RGLWConfig getProcessParams:input.processParams];
|
|
436
|
+
result[@"imageFormat"] = @(input.imageFormat);
|
|
437
|
+
result[@"imageCompressionQuality"] = @(input.imageCompressionQuality);
|
|
438
|
+
|
|
439
|
+
return result;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
+(RGLGlaresCheckParams*)glaresCheckParamsFromJson:(NSDictionary*)input {
|
|
443
|
+
if(input == nil) return nil;
|
|
444
|
+
RGLGlaresCheckParams *result = [RGLGlaresCheckParams new];
|
|
445
|
+
|
|
446
|
+
if([input valueForKey:@"imgMarginPart"] != nil)
|
|
447
|
+
result.imgMarginPart = [input valueForKey:@"imgMarginPart"];
|
|
448
|
+
if([input valueForKey:@"maxGlaringPart"] != nil)
|
|
449
|
+
result.maxGlaringPart = [input valueForKey:@"maxGlaringPart"];
|
|
450
|
+
|
|
451
|
+
return result;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
+(NSDictionary*)generateGlaresCheckParams:(RGLGlaresCheckParams*)input {
|
|
455
|
+
if(input == nil) return nil;
|
|
456
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
457
|
+
|
|
458
|
+
result[@"imgMarginPart"] = input.imgMarginPart;
|
|
459
|
+
result[@"maxGlaringPart"] = input.maxGlaringPart;
|
|
460
|
+
|
|
461
|
+
return result;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
+(RGLImageInput*)imageInputFromJson:(NSDictionary*)input {
|
|
465
|
+
if(input == nil) return nil;
|
|
466
|
+
|
|
467
|
+
NSInteger pageIndex = 0;
|
|
468
|
+
if([input valueForKey:@"pageIndex"] != nil)
|
|
469
|
+
pageIndex = [[input valueForKey:@"pageIndex"] integerValue];
|
|
470
|
+
NSInteger light = 6;
|
|
471
|
+
if([input valueForKey:@"light"] != nil)
|
|
472
|
+
light = [[input valueForKey:@"light"] integerValue];
|
|
473
|
+
if([input valueForKey:@"image"] != nil)
|
|
474
|
+
return [[RGLImageInput alloc] initWithImage:[self imageWithBase64:[input valueForKey:@"image"]] light:light pageIndex:pageIndex];
|
|
475
|
+
return nil;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
+(NSDictionary*)generateImageInput:(RGLImageInput*)input {
|
|
479
|
+
if(input == nil) return nil;
|
|
480
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
481
|
+
|
|
482
|
+
result[@"pageIndex"] = @(input.pageIndex);
|
|
483
|
+
result[@"light"] = @(input.lightType);
|
|
484
|
+
result[@"image"] = [self base64WithImage:input.image];
|
|
485
|
+
|
|
486
|
+
return result;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
+(RGLPKDCertificate*)pkdCertificateFromJson:(NSDictionary*)input {
|
|
490
|
+
if(input == nil) return nil;
|
|
491
|
+
|
|
492
|
+
NSInteger type = [[input valueForKey:@"resourceType"] integerValue];
|
|
493
|
+
NSData* binaryData = [self base64Decode:[input objectForKey:@"binaryData"]];
|
|
494
|
+
NSData* privateKey = [self base64Decode:[input objectForKey:@"privateKey"]];
|
|
495
|
+
|
|
496
|
+
return [[RGLPKDCertificate alloc] initWithBinaryData:binaryData resourceType:type privateKey:privateKey];
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
+(NSDictionary*)generatePKDCertificate:(RGLPKDCertificate*)input {
|
|
500
|
+
if(input == nil) return nil;
|
|
501
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
502
|
+
|
|
503
|
+
result[@"resourceType"] = @(input.resourceType);
|
|
504
|
+
result[@"binaryData"] = [self base64Encode:input.binaryData];
|
|
505
|
+
result[@"privateKey"] = [self base64Encode:input.privateKey];
|
|
506
|
+
|
|
507
|
+
return result;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
+(RGLRFIDParams*)rfidParamsFromJson:(NSDictionary*)input {
|
|
511
|
+
RGLRFIDParams* result = [RGLRFIDParams new];
|
|
512
|
+
|
|
513
|
+
if([input valueForKey:@"paIgnoreNotificationCodes"] != nil)
|
|
514
|
+
result.paIgnoreNotificationCodes = [input valueForKey:@"paIgnoreNotificationCodes"];
|
|
515
|
+
|
|
516
|
+
return result;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
+(NSDictionary*)generateRFIDParams:(RGLRFIDParams*)input {
|
|
520
|
+
if(input == nil) return nil;
|
|
521
|
+
NSMutableDictionary *result = [NSMutableDictionary new];
|
|
522
|
+
|
|
523
|
+
result[@"paIgnoreNotificationCodes"] = input.paIgnoreNotificationCodes;
|
|
524
|
+
|
|
525
|
+
return result;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
+(RGLProcessParams*)processParamsFromJson:(NSDictionary*)input {
|
|
529
|
+
RGLProcessParams* result = [RGLProcessParams new];
|
|
530
|
+
[RGLWConfig setProcessParams:input :result];
|
|
531
|
+
return result;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
+(NSDictionary*)generateProcessParams:(RGLProcessParams*)input {
|
|
535
|
+
return [RGLWConfig getProcessParams:input];
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
+(RGLFaceAPIParams*)faceAPIParamsFromJson:(NSDictionary*)input {
|
|
539
|
+
RGLFaceAPIParams* result = [RGLFaceAPIParams defaultParams];
|
|
540
|
+
|
|
541
|
+
if([input valueForKey:@"url"] != nil)
|
|
542
|
+
result.url = [input valueForKey:@"url"];
|
|
543
|
+
if([input valueForKey:@"mode"] != nil)
|
|
544
|
+
result.mode = [input valueForKey:@"mode"];
|
|
545
|
+
if([input valueForKey:@"threshold"] != nil)
|
|
546
|
+
result.threshold = [input valueForKey:@"threshold"];
|
|
547
|
+
if([input valueForKey:@"searchParams"] != nil)
|
|
548
|
+
result.searchParams = [self faceAPISearchParamsFromJson:[input valueForKey:@"searchParams"]];
|
|
549
|
+
if([input valueForKey:@"serviceTimeout"] != nil)
|
|
550
|
+
result.serviceTimeout = [input valueForKey:@"serviceTimeout"];
|
|
551
|
+
if([input valueForKey:@"proxy"] != nil)
|
|
552
|
+
result.proxy = [input valueForKey:@"proxy"];
|
|
553
|
+
if([input valueForKey:@"proxyPassword"] != nil)
|
|
554
|
+
result.proxyPassword = [input valueForKey:@"proxyPassword"];
|
|
555
|
+
if([input valueForKey:@"proxyType"] != nil)
|
|
556
|
+
result.proxyType = [input valueForKey:@"proxyType"];
|
|
557
|
+
|
|
558
|
+
return result;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
+(NSDictionary*)generateFaceAPIParams:(RGLFaceAPIParams*)input {
|
|
562
|
+
if(input == nil) return nil;
|
|
563
|
+
NSMutableDictionary *result = [NSMutableDictionary new];
|
|
564
|
+
|
|
565
|
+
result[@"url"] = input.url;
|
|
566
|
+
result[@"mode"] = input.mode;
|
|
567
|
+
result[@"searchParams"] = [self generateFaceAPISearchParams:input.searchParams];
|
|
568
|
+
result[@"threshold"] = input.threshold;
|
|
569
|
+
result[@"serviceTimeout"] = input.serviceTimeout;
|
|
570
|
+
result[@"proxy"] = input.proxy;
|
|
571
|
+
result[@"proxyPassword"] = input.proxyPassword;
|
|
572
|
+
result[@"proxyType"] = input.proxyType;
|
|
573
|
+
|
|
574
|
+
return result;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
+(RGLFaceAPISearchParams*)faceAPISearchParamsFromJson:(NSDictionary*)input {
|
|
578
|
+
RGLFaceAPISearchParams* result = [RGLFaceAPISearchParams new];
|
|
579
|
+
|
|
580
|
+
if([input valueForKey:@"limit"] != nil)
|
|
581
|
+
result.limit = [input valueForKey:@"limit"];
|
|
582
|
+
if([input valueForKey:@"threshold"] != nil)
|
|
583
|
+
result.threshold = [input valueForKey:@"threshold"];
|
|
584
|
+
if([input valueForKey:@"groupIds"] != nil)
|
|
585
|
+
result.groupIDs = [input valueForKey:@"groupIds"];
|
|
586
|
+
|
|
587
|
+
return result;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
+(NSDictionary*)generateFaceAPISearchParams:(RGLFaceAPISearchParams*)input {
|
|
591
|
+
if(input == nil) return nil;
|
|
592
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
593
|
+
|
|
594
|
+
result[@"limit"] = input.limit;
|
|
595
|
+
result[@"threshold"] = input.threshold;
|
|
596
|
+
result[@"groupIds"] = input.groupIDs;
|
|
597
|
+
|
|
598
|
+
return result;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
+(RGLScenario*)scenarioFromJson:(NSDictionary*)input {
|
|
602
|
+
if(input == nil) return nil;
|
|
603
|
+
|
|
604
|
+
NSString* identifier = [input valueForKey:@"name"];
|
|
605
|
+
double frameKWHLandscape = [[input valueForKey:@"frameKWHLandscape"] doubleValue];
|
|
606
|
+
double frameKWHPortrait = [[input valueForKey:@"frameKWHPortrait"] doubleValue];
|
|
607
|
+
double frameKWHDoublePageSpreadPortrait = [[input valueForKey:@"frameKWHDoublePageSpreadPortrait"] doubleValue];
|
|
608
|
+
double frameKWHDoublePageSpreadLandscape = [[input valueForKey:@"frameKWHDoublePageSpreadLandscape"] doubleValue];
|
|
609
|
+
NSString* scenarioDescription = [input valueForKey:@"description"];
|
|
610
|
+
BOOL faceExt = [[input valueForKey:@"faceExt"] boolValue];
|
|
611
|
+
BOOL multiPageOff = [[input valueForKey:@"multiPageOff"] boolValue];
|
|
612
|
+
BOOL seriesProcessMode = [[input valueForKey:@"seriesProcessMode"] boolValue];
|
|
613
|
+
NSString* caption = [input valueForKey:@"caption"];
|
|
614
|
+
BOOL uvTorch = [[input valueForKey:@"uvTorch"] boolValue];
|
|
615
|
+
NSInteger frameOrientation = [[input valueForKey:@"frameOrientation"] integerValue];
|
|
616
|
+
BOOL manualCrop = [[input valueForKey:@"manualCrop"] boolValue];
|
|
617
|
+
|
|
618
|
+
return [[RGLScenario new] initWithIdentifier:identifier frame:0 frameKWHLandscape:frameKWHLandscape frameKWHPortrait:frameKWHPortrait frameKWHDoublePageSpreadPortrait:frameKWHDoublePageSpreadPortrait frameKWHDoublePageSpreadLandscape:frameKWHDoublePageSpreadLandscape scenarioDescription:scenarioDescription barcodeExt:nil faceExt:faceExt multiPageOff:multiPageOff caption:caption uvTorch:uvTorch frameOrientation:frameOrientation seriesProcessMode:seriesProcessMode manualCrop:manualCrop];
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
+(NSDictionary*)generateScenario:(RGLScenario*)input {
|
|
622
|
+
if(input == nil) return nil;
|
|
623
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
624
|
+
|
|
625
|
+
result[@"name"] = input.identifier;
|
|
626
|
+
result[@"frameKWHLandscape"] = @(input.frameKWHLandscape);
|
|
627
|
+
result[@"frameKWHPortrait"] = @(input.frameKWHPortrait);
|
|
628
|
+
result[@"frameKWHDoublePageSpreadPortrait"] = @(input.frameKWHDoublePageSpreadPortrait);
|
|
629
|
+
result[@"frameKWHDoublePageSpreadLandscape"] = @(input.frameKWHDoublePageSpreadLandscape);
|
|
630
|
+
result[@"description"] = input.scenarioDescription;
|
|
631
|
+
result[@"faceExt"] = @(input.faceExt);
|
|
632
|
+
result[@"multiPageOff"] = @(input.multiPageOff);
|
|
633
|
+
result[@"seriesProcessMode"] = @(input.seriesProcessMode);
|
|
634
|
+
result[@"caption"] = input.caption;
|
|
635
|
+
result[@"uvTorch"] = @(input.uvTorch);
|
|
636
|
+
result[@"frameOrientation"] = @(input.frameOrientation);
|
|
637
|
+
result[@"manualCrop"] = @(input.manualCrop);
|
|
638
|
+
|
|
639
|
+
return result;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
+(CGRect)rectFromJson:(NSDictionary*)input {
|
|
643
|
+
return CGRectMake(
|
|
644
|
+
[[input valueForKey:@"left"] floatValue],
|
|
645
|
+
[[input valueForKey:@"top"] floatValue],
|
|
646
|
+
[[input valueForKey:@"right"] floatValue] - [[input valueForKey:@"left"] floatValue],
|
|
647
|
+
[[input valueForKey:@"bottom"] floatValue] - [[input valueForKey:@"top"] floatValue]);
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
+(NSDictionary*)generateRect:(CGRect)input {
|
|
651
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
652
|
+
if(input.origin.x == 0 && input.origin.y == 0) return nil;
|
|
653
|
+
|
|
654
|
+
result[@"top"] = @(input.origin.y);
|
|
655
|
+
result[@"left"] = @(input.origin.x);
|
|
656
|
+
result[@"bottom"] = @(input.origin.y+input.size.height);
|
|
657
|
+
result[@"right"] = @(input.origin.x+input.size.width);
|
|
658
|
+
|
|
659
|
+
return result;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
+(RGLDocumentReaderGraphicField*)documentReaderGraphicFieldFromJson:(NSDictionary*)input {
|
|
663
|
+
return [[RGLDocumentReaderGraphicField alloc]
|
|
664
|
+
initWithSourceType:[[input valueForKey:@"sourceType"] integerValue]
|
|
665
|
+
fieldType:[[input valueForKey:@"fieldType"] integerValue]
|
|
666
|
+
boundRect:[self rectFromJson: [input valueForKey:@"fieldRect"]]
|
|
667
|
+
value:[self imageWithBase64: [input valueForKey:@"value"]]
|
|
668
|
+
light:[[input valueForKey:@"light"] integerValue]
|
|
669
|
+
pageIndex:[[input valueForKey:@"pageIndex"] integerValue]
|
|
670
|
+
originalPageIndex:[[input valueForKey:@"originalPageIndex"] integerValue]];
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
+(NSDictionary*)generateDocumentReaderGraphicField:(RGLDocumentReaderGraphicField*)input {
|
|
674
|
+
if(input == nil) return nil;
|
|
675
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
676
|
+
|
|
677
|
+
result[@"sourceType"] = @(input.sourceType);
|
|
678
|
+
result[@"fieldType"] = @(input.fieldType);
|
|
679
|
+
result[@"fieldName"] = input.fieldName;
|
|
680
|
+
result[@"fieldRect"] = [self generateRect:input.boundRect];
|
|
681
|
+
result[@"value"] = [self base64WithImage:input.value];
|
|
682
|
+
result[@"light"] = @(input.lightType);
|
|
683
|
+
result[@"lightName"] = input.lightName;
|
|
684
|
+
result[@"pageIndex"] = @(input.pageIndex);
|
|
685
|
+
result[@"originalPageIndex"] = @(input.originalPageIndex);
|
|
686
|
+
|
|
687
|
+
return result;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
+(RGLDocumentReaderGraphicResult*)documentReaderGraphicResultFromJson:(NSDictionary*)input {
|
|
691
|
+
NSMutableArray<RGLDocumentReaderGraphicField*>* array = [NSMutableArray new];
|
|
692
|
+
for(NSDictionary* item in [input valueForKey:@"fields"]){
|
|
693
|
+
[array addObject:[self documentReaderGraphicFieldFromJson: item]];
|
|
694
|
+
}
|
|
695
|
+
return [[RGLDocumentReaderGraphicResult alloc] initWithFields:array];
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
+(NSDictionary*)generateDocumentReaderGraphicResult:(RGLDocumentReaderGraphicResult*)input {
|
|
699
|
+
if(input == nil) return nil;
|
|
700
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
701
|
+
|
|
702
|
+
if(input.fields != nil) {
|
|
703
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
704
|
+
for(RGLDocumentReaderGraphicField* item in input.fields)
|
|
705
|
+
[array addObject:[self generateDocumentReaderGraphicField:item]];
|
|
706
|
+
result[@"fields"] = array;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
return result;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
+(NSDictionary*)documentReaderValueDictionaryFromJson:(NSDictionary*)input {
|
|
713
|
+
NSMutableDictionary* json = input.mutableCopy;
|
|
714
|
+
|
|
715
|
+
json[@"containerType"] = [input valueForKey:@"sourceType"];
|
|
716
|
+
json[@"fieldRect"] = [input valueForKey:@"boundRect"];
|
|
717
|
+
|
|
718
|
+
return json;
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
+(RGLDocumentReaderValue*)documentReaderValueFromJson:(NSDictionary*)input {
|
|
722
|
+
return [RGLDocumentReaderValue initWithJSON:[self documentReaderValueDictionaryFromJson:input] field:[RGLDocumentReaderTextField initWithJSON:[NSDictionary new] sourceList:[NSDictionary new]]];
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
+(NSDictionary*)generateDocumentReaderValue:(RGLDocumentReaderValue*)input {
|
|
726
|
+
if(input == nil) return nil;
|
|
727
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
728
|
+
|
|
729
|
+
result[@"sourceType"] = @(input.sourceType);
|
|
730
|
+
result[@"value"] = input.value;
|
|
731
|
+
result[@"originalValue"] = input.originalValue;
|
|
732
|
+
result[@"boundRect"] = [self generateRect:input.boundRect];
|
|
733
|
+
result[@"pageIndex"] = @(input.pageIndex);
|
|
734
|
+
result[@"probability"] = @(input.probability);
|
|
735
|
+
if(input.originalSymbols != nil){
|
|
736
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
737
|
+
for(RGLDocumentReaderSymbol* item in input.originalSymbols)
|
|
738
|
+
[array addObject:[self generateDocumentReaderSymbol:item]];
|
|
739
|
+
result[@"originalSymbols"] = array;
|
|
740
|
+
}
|
|
741
|
+
result[@"rfidOrigin"] = [self generateDocumentReaderRfidOrigin:input.rfidOrigin];
|
|
742
|
+
|
|
743
|
+
return result;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
+(NSDictionary*)documentReaderTextFieldDictionaryFromJson:(NSDictionary*)input {
|
|
747
|
+
NSMutableDictionary* json = input.mutableCopy;
|
|
748
|
+
|
|
749
|
+
json[@"sourceType"] = [[[input mutableArrayValueForKey:@"validityList"] objectAtIndex:0] valueForKey:@"sourceType"];
|
|
750
|
+
json[@"sourceTypeLeft"] = [[[input mutableArrayValueForKey:@"comparisonList"] objectAtIndex:0] valueForKey:@"sourceTypeLeft"];
|
|
751
|
+
json[@"sourceTypeRight"] = [[[input mutableArrayValueForKey:@"comparisonList"] objectAtIndex:0] valueForKey:@"sourceTypeRight"];
|
|
752
|
+
NSMutableArray<NSDictionary*>* validityList = [NSMutableArray new];
|
|
753
|
+
for(NSDictionary* item in [input valueForKey:@"validityList"]){
|
|
754
|
+
[validityList addObject:[self documentReaderValidityDictionaryFromJson:item]];
|
|
755
|
+
}
|
|
756
|
+
json[@"validityList"] = validityList;
|
|
757
|
+
NSMutableArray<NSDictionary*>* comparisonList = [NSMutableArray new];
|
|
758
|
+
for(NSDictionary* item in [input valueForKey:@"comparisonList"]){
|
|
759
|
+
[comparisonList addObject:[self documentReaderComparisonDictionaryFromJson:item]];
|
|
760
|
+
}
|
|
761
|
+
json[@"comparisonList"] = comparisonList;
|
|
762
|
+
NSMutableArray<NSDictionary*>* valueList = [NSMutableArray new];
|
|
763
|
+
for(NSDictionary* item in [input valueForKey:@"values"]){
|
|
764
|
+
[valueList addObject:[self documentReaderValueDictionaryFromJson:item]];
|
|
765
|
+
}
|
|
766
|
+
json[@"valueList"] = valueList;
|
|
767
|
+
|
|
768
|
+
return json;
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
+(RGLDocumentReaderTextField*)documentReaderTextFieldFromJson:(NSDictionary*)input {
|
|
772
|
+
return [RGLDocumentReaderTextField initWithJSON:[self documentReaderTextFieldDictionaryFromJson:input] sourceList:[self documentReaderTextFieldDictionaryFromJson:input]];
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
+(NSDictionary*)generateDocumentReaderTextField:(RGLDocumentReaderTextField*)input {
|
|
776
|
+
if(input == nil) return nil;
|
|
777
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
778
|
+
|
|
779
|
+
result[@"fieldType"] = @(input.fieldType);
|
|
780
|
+
result[@"fieldName"] = input.fieldName;
|
|
781
|
+
result[@"lcid"] = @(input.lcid);
|
|
782
|
+
result[@"lcidName"] = [RGLDocumentReaderTextField lcidName:input.lcid];
|
|
783
|
+
if(input.values != nil){
|
|
784
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
785
|
+
for(RGLDocumentReaderValue* item in input.values)
|
|
786
|
+
[array addObject:[self generateDocumentReaderValue:item]];
|
|
787
|
+
result[@"values"] = array;
|
|
788
|
+
}
|
|
789
|
+
result[@"status"] = @(input.status);
|
|
790
|
+
result[@"comparisonStatus"] = @(input.comparisonStatus);
|
|
791
|
+
result[@"validityStatus"] = @(input.validityStatus);
|
|
792
|
+
result[@"value"] = input.value;
|
|
793
|
+
result[@"getValue"] = [self generateDocumentReaderValue:[input getValue]];
|
|
794
|
+
if(input.comparisonList != nil){
|
|
795
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
796
|
+
for(RGLDocumentReaderComparison* item in input.comparisonList)
|
|
797
|
+
[array addObject:[self generateDocumentReaderComparison:item]];
|
|
798
|
+
result[@"comparisonList"] = array;
|
|
799
|
+
}
|
|
800
|
+
if(input.validityList != nil){
|
|
801
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
802
|
+
for(RGLDocumentReaderValidity* item in input.validityList)
|
|
803
|
+
[array addObject:[self generateDocumentReaderValidity:item]];
|
|
804
|
+
result[@"validityList"] = array;
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
return result;
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
+(NSDictionary*)documentReaderTextResultDictionaryFromJson:(NSDictionary*)input {
|
|
811
|
+
NSMutableDictionary* json = input.mutableCopy;
|
|
812
|
+
|
|
813
|
+
NSMutableArray<NSDictionary*>* availableSourceList = [NSMutableArray new];
|
|
814
|
+
for(NSDictionary* item in [input valueForKey:@"availableSourceList"]){
|
|
815
|
+
[availableSourceList addObject:[self documentReaderTextSourceDictionaryFromJson:item]];
|
|
816
|
+
}
|
|
817
|
+
json[@"availableSourceList"] = availableSourceList;
|
|
818
|
+
NSMutableArray<NSDictionary*>* fields = [NSMutableArray new];
|
|
819
|
+
for(NSDictionary* item in [input valueForKey:@"fields"]){
|
|
820
|
+
[fields addObject:[self documentReaderTextFieldDictionaryFromJson:item]];
|
|
821
|
+
}
|
|
822
|
+
json[@"fieldList"] = fields;
|
|
823
|
+
|
|
824
|
+
return json;
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
+(RGLDocumentReaderTextResult*)documentReaderTextResultFromJson:(NSDictionary*)input {
|
|
828
|
+
return [RGLDocumentReaderTextResult initWithJSON:[self documentReaderTextResultDictionaryFromJson: input]];
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
+(NSDictionary*)generateDocumentReaderTextResult:(RGLDocumentReaderTextResult*)input {
|
|
832
|
+
if(input == nil) return nil;
|
|
833
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
834
|
+
|
|
835
|
+
if(input.fields != nil){
|
|
836
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
837
|
+
for(RGLDocumentReaderTextField* item in input.fields)
|
|
838
|
+
[array addObject:[self generateDocumentReaderTextField:item]];
|
|
839
|
+
result[@"fields"] = array;
|
|
840
|
+
}
|
|
841
|
+
result[@"status"] = @(input.status);
|
|
842
|
+
result[@"comparisonStatus"] = @(input.comparisonStatus);
|
|
843
|
+
result[@"validityStatus"] = @(input.validityStatus);
|
|
844
|
+
if(input.availableSourceList != nil){
|
|
845
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
846
|
+
for(RGLDocumentReaderTextSource* item in input.availableSourceList)
|
|
847
|
+
[array addObject:[self generateDocumentReaderTextSource:item]];
|
|
848
|
+
result[@"availableSourceList"] = array;
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
return result;
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
+(CGPoint)pointFromJson:(NSDictionary*)input {
|
|
855
|
+
return CGPointMake([[input valueForKey:@"x"] floatValue], [[input valueForKey:@"y"] floatValue]);
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
+(NSDictionary*)generatePoint:(CGPoint)input {
|
|
859
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
860
|
+
|
|
861
|
+
result[@"x"] = [NSNumber numberWithFloat:input.x];
|
|
862
|
+
result[@"y"] = [NSNumber numberWithFloat:input.y];
|
|
863
|
+
|
|
864
|
+
return result;
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
+(RGLPosition*)positionFromJson:(NSDictionary*)input {
|
|
868
|
+
NSMutableDictionary* json = input.mutableCopy;
|
|
869
|
+
|
|
870
|
+
json[@"Width"] = [input valueForKey:@"width"];
|
|
871
|
+
json[@"Height"] = [input valueForKey:@"height"];
|
|
872
|
+
json[@"Angle"] = [input valueForKey:@"angle"];
|
|
873
|
+
json[@"Center"] = [input valueForKey:@"center"];
|
|
874
|
+
json[@"LeftTop"] = [input valueForKey:@"leftTop"];
|
|
875
|
+
json[@"LeftBottom"] = [input valueForKey:@"leftBottom"];
|
|
876
|
+
json[@"RightTop"] = [input valueForKey:@"rightTop"];
|
|
877
|
+
json[@"RightBottom"] = [input valueForKey:@"rightBottom"];
|
|
878
|
+
json[@"PerspectiveTr"] = [input valueForKey:@"perspectiveTr"];
|
|
879
|
+
json[@"ObjArea"] = [input valueForKey:@"objArea"];
|
|
880
|
+
json[@"ObjIntAngleDev"] = [input valueForKey:@"objIntAngleDev"];
|
|
881
|
+
json[@"ResultStatus"] = [input valueForKey:@"resultStatus"];
|
|
882
|
+
json[@"docFormat"] = [input valueForKey:@"docFormat"];
|
|
883
|
+
json[@"page_idx"] = [input valueForKey:@"pageIndex"];
|
|
884
|
+
json[@"Dpi"] = [input valueForKey:@"dpi"];
|
|
885
|
+
json[@"Inverse"] = [input valueForKey:@"inverse"];
|
|
886
|
+
|
|
887
|
+
return [RGLPosition initWithJSON:json];
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
+(NSDictionary*)generatePosition:(RGLPosition*)input {
|
|
891
|
+
if(input == nil) return nil;
|
|
892
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
893
|
+
|
|
894
|
+
result[@"width"] = @(input.size.width);
|
|
895
|
+
result[@"height"] = @(input.size.height);
|
|
896
|
+
result[@"angle"] = @(input.angle);
|
|
897
|
+
result[@"center"] = [self generatePoint:input.center];
|
|
898
|
+
result[@"leftTop"] = [self generatePoint:input.leftTop];
|
|
899
|
+
result[@"leftBottom"] = [self generatePoint:input.leftBottom];
|
|
900
|
+
result[@"rightTop"] = [self generatePoint:input.rightTop];
|
|
901
|
+
result[@"rightBottom"] = [self generatePoint:input.rightBottom];
|
|
902
|
+
result[@"perspectiveTr"] = @(input.perspectiveTr);
|
|
903
|
+
result[@"objArea"] = @(input.objArea);
|
|
904
|
+
result[@"objIntAngleDev"] = @(input.objIntAngleDev);
|
|
905
|
+
result[@"resultStatus"] = @(input.resultStatus);
|
|
906
|
+
result[@"docFormat"] = @(input.docFormat);
|
|
907
|
+
result[@"pageIndex"] = @(input.pageIndex);
|
|
908
|
+
result[@"dpi"] = @(input.dpi);
|
|
909
|
+
result[@"inverse"] = @(input.inverse);
|
|
910
|
+
|
|
911
|
+
return result;
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
+(NSDictionary*)imageQualityDictionaryFromJson:(NSDictionary*)input {
|
|
915
|
+
NSMutableDictionary* json = [NSMutableDictionary new];
|
|
916
|
+
|
|
917
|
+
json[@"featureType"] = [input valueForKey:@"featureType"];
|
|
918
|
+
json[@"type"] = [RGLWConfig imageQualityCheckTypeWithNumber:[input valueForKey:@"type"]];
|
|
919
|
+
json[@"result"] = [input valueForKey:@"result"];
|
|
920
|
+
NSDictionary* dict = @{@"List":[input valueForKey:@"boundRects"]};
|
|
921
|
+
json[@"areas"] = dict;
|
|
922
|
+
|
|
923
|
+
return json;
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
+(RGLImageQuality*)imageQualityFromJson:(NSDictionary*)input {
|
|
927
|
+
return [RGLImageQuality initWithJSON:[self imageQualityDictionaryFromJson:input]];
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
+(NSDictionary*)generateImageQuality:(RGLImageQuality*)input {
|
|
931
|
+
if(input == nil) return nil;
|
|
932
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
933
|
+
|
|
934
|
+
result[@"type"] = [RGLWConfig generateImageQualityCheckType:input.type];
|
|
935
|
+
result[@"result"] = @(input.result);
|
|
936
|
+
result[@"featureType"] = @(input.featureType);
|
|
937
|
+
if(input.boundRects != nil){
|
|
938
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
939
|
+
for(NSValue* item in input.boundRects) {
|
|
940
|
+
id rect = [self generateRect:[item CGRectValue]];
|
|
941
|
+
if(rect) [array addObject:rect];
|
|
942
|
+
}
|
|
943
|
+
result[@"boundRects"] = array;
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
return result;
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
+(RGLImageQualityGroup*)imageQualityGroupFromJson:(NSDictionary*)input {
|
|
950
|
+
if(input == nil) return nil;
|
|
951
|
+
NSMutableDictionary* json = [NSMutableDictionary new];
|
|
952
|
+
|
|
953
|
+
json[@"Count"] = [input valueForKey:@"count"];
|
|
954
|
+
json[@"result"] = [input valueForKey:@"result"];
|
|
955
|
+
json[@"page_idx"] = [input valueForKey:@"pageIndex"];
|
|
956
|
+
NSMutableArray<NSDictionary*>* array = [NSMutableArray new];
|
|
957
|
+
for(NSDictionary* item in [input valueForKey:@"imageQualityList"]){
|
|
958
|
+
[array addObject:[self imageQualityDictionaryFromJson:item]];
|
|
959
|
+
}
|
|
960
|
+
json[@"List"] = array;
|
|
961
|
+
|
|
962
|
+
return [RGLImageQualityGroup initWithJSON:json];
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
+(NSDictionary*)generateImageQualityGroup:(RGLImageQualityGroup*)input {
|
|
966
|
+
if(input == nil) return nil;
|
|
967
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
968
|
+
|
|
969
|
+
result[@"count"] = @(input.count);
|
|
970
|
+
result[@"result"] = @(input.result);
|
|
971
|
+
if(input.imageQualityList != nil){
|
|
972
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
973
|
+
for(RGLImageQuality* item in input.imageQualityList)
|
|
974
|
+
[array addObject:[self generateImageQuality:item]];
|
|
975
|
+
result[@"imageQualityList"] = array;
|
|
976
|
+
}
|
|
977
|
+
result[@"pageIndex"] = @(input.pageIndex);
|
|
978
|
+
|
|
979
|
+
return result;
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
+(RGLDocumentReaderDocumentType*)documentReaderDocumentTypeFromJson:(NSDictionary*)input {
|
|
983
|
+
NSMutableDictionary* json = input.mutableCopy;
|
|
984
|
+
|
|
985
|
+
json[@"DocumentName"] = [input valueForKey:@"name"];
|
|
986
|
+
json[@"ID"] = [input valueForKey:@"documentID"];
|
|
987
|
+
json[@"ICAOCode"] = [input valueForKey:@"ICAOCode"];
|
|
988
|
+
json[@"List"] = [input valueForKey:@"FDSID"];
|
|
989
|
+
json[@"dType"] = [input valueForKey:@"dType"];
|
|
990
|
+
json[@"dFormat"] = [input valueForKey:@"dFormat"];
|
|
991
|
+
json[@"dMRZ"] = [input valueForKey:@"dMRZ"];
|
|
992
|
+
json[@"isDeprecated"] = [input valueForKey:@"isDeprecated"];
|
|
993
|
+
json[@"dDescription"] = [input valueForKey:@"dDescription"];
|
|
994
|
+
json[@"dYear"] = [input valueForKey:@"dYear"];
|
|
995
|
+
json[@"dCountryName"] = [input valueForKey:@"dCountryName"];
|
|
996
|
+
json[@"page_idx"] = [input valueForKey:@"pageIndex"];
|
|
997
|
+
json[@"FDSIDList"] = json.copy;
|
|
998
|
+
|
|
999
|
+
return [RGLDocumentReaderDocumentType initWithJSON:json];
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
+(NSDictionary*)generateDocumentReaderDocumentType:(RGLDocumentReaderDocumentType*)input {
|
|
1003
|
+
if(input == nil) return nil;
|
|
1004
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
1005
|
+
|
|
1006
|
+
result[@"name"] = input.name;
|
|
1007
|
+
result[@"documentID"] = @(input.documentID);
|
|
1008
|
+
result[@"ICAOCode"] = input.ICAOCode;
|
|
1009
|
+
if(input.FDSID != nil){
|
|
1010
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
1011
|
+
for(NSNumber* item in input.FDSID)
|
|
1012
|
+
[array addObject:item];
|
|
1013
|
+
result[@"FDSID"] = array;
|
|
1014
|
+
}
|
|
1015
|
+
result[@"dType"] = @(input.dType);
|
|
1016
|
+
result[@"dFormat"] = @(input.dFormat);
|
|
1017
|
+
result[@"dMRZ"] = @(input.dMRZ);
|
|
1018
|
+
result[@"isDeprecated"] = @(input.isDeprecated);
|
|
1019
|
+
result[@"dDescription"] = input.dDescription;
|
|
1020
|
+
result[@"dYear"] = input.dYear;
|
|
1021
|
+
result[@"dCountryName"] = input.dCountryName;
|
|
1022
|
+
result[@"pageIndex"] = @(input.pageIndex);
|
|
1023
|
+
|
|
1024
|
+
return result;
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
+(NSString*)generateDocumentReaderNotification:(RGLRFIDNotify*)input{
|
|
1028
|
+
if(input == nil) return nil;
|
|
1029
|
+
NSMutableDictionary *result = [NSMutableDictionary new];
|
|
1030
|
+
|
|
1031
|
+
result[@"notificationCode"] = @(input.code & -0x10000);
|
|
1032
|
+
result[@"dataFileType"] = @((int)input.attachment);
|
|
1033
|
+
result[@"progress"] = @((int)input.value);
|
|
1034
|
+
|
|
1035
|
+
return [RGLWJSONConstructor dictToString: result];
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
+(NSDictionary*)accessControlProcedureTypeDictionaryFromJson:(NSDictionary*)input {
|
|
1039
|
+
NSMutableDictionary* json = [NSMutableDictionary new];
|
|
1040
|
+
|
|
1041
|
+
json[@"ActiveOptionIdx"] = [input valueForKey:@"activeOptionIdx"];
|
|
1042
|
+
json[@"Notifications"] = [input valueForKey:@"notifications"];
|
|
1043
|
+
json[@"Status"] = [input valueForKey:@"status"];
|
|
1044
|
+
json[@"Type"] = [input valueForKey:@"type"];
|
|
1045
|
+
|
|
1046
|
+
return json;
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
+(RGLAccessControlProcedureType*)accessControlProcedureTypeFromJson:(NSDictionary*)input {
|
|
1050
|
+
return [RGLAccessControlProcedureType initWithJSON:[self accessControlProcedureTypeDictionaryFromJson:input]];
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
+(NSDictionary*)generateAccessControlProcedureType:(RGLAccessControlProcedureType*)input {
|
|
1054
|
+
if(input == nil) return nil;
|
|
1055
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
1056
|
+
|
|
1057
|
+
result[@"activeOptionIdx"] = @(input.activeOptionIdx);
|
|
1058
|
+
if(input.notifications != nil){
|
|
1059
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
1060
|
+
for(NSNumber* item in input.notifications)
|
|
1061
|
+
[array addObject:item];
|
|
1062
|
+
result[@"notifications"] = array;
|
|
1063
|
+
}
|
|
1064
|
+
result[@"status"] = @(input.status);
|
|
1065
|
+
result[@"type"] = @(input.type);
|
|
1066
|
+
|
|
1067
|
+
return result;
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
+(NSDictionary*)fileDataDictionaryFromJson:(NSDictionary*)input {
|
|
1071
|
+
NSMutableDictionary* json = [NSMutableDictionary new];
|
|
1072
|
+
|
|
1073
|
+
json[@"Data"] = [input valueForKey:@"data"];
|
|
1074
|
+
json[@"Length"] = [input valueForKey:@"length"];
|
|
1075
|
+
json[@"Status"] = [input valueForKey:@"status"];
|
|
1076
|
+
json[@"Type"] = [input valueForKey:@"type"];
|
|
1077
|
+
|
|
1078
|
+
return json;
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
+(RGLFileData*)fileDataFromJson:(NSDictionary*)input {
|
|
1082
|
+
return [RGLFileData initWithJSON:[self fileDataDictionaryFromJson:input]];
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
+(NSDictionary*)generateFileData:(RGLFileData*)input {
|
|
1086
|
+
if(input == nil) return nil;
|
|
1087
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
1088
|
+
|
|
1089
|
+
result[@"data"] = input.data;
|
|
1090
|
+
result[@"length"] = @(input.length);
|
|
1091
|
+
result[@"status"] = @(input.status);
|
|
1092
|
+
result[@"type"] = @(input.type);
|
|
1093
|
+
|
|
1094
|
+
return result;
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
+(NSDictionary*)certificateDataDictionaryFromJson:(NSDictionary*)input {
|
|
1098
|
+
NSMutableDictionary* json = [NSMutableDictionary new];
|
|
1099
|
+
|
|
1100
|
+
json[@"Data"] = [input valueForKey:@"data"];
|
|
1101
|
+
json[@"Length"] = [input valueForKey:@"length"];
|
|
1102
|
+
|
|
1103
|
+
return json;
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
+(RGLCertificateData*)certificateDataFromJson:(NSDictionary*)input {
|
|
1107
|
+
return [RGLCertificateData initWithJSON:[self certificateDataDictionaryFromJson:input]];
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
+(NSDictionary*)generateCertificateData:(RGLCertificateData*)input {
|
|
1111
|
+
if(input == nil) return nil;
|
|
1112
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
1113
|
+
|
|
1114
|
+
result[@"data"] = input.data;
|
|
1115
|
+
result[@"length"] = @(input.length);
|
|
1116
|
+
|
|
1117
|
+
return result;
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
+(NSDictionary*)securityObjectCertificatesDictionaryFromJson:(NSDictionary*)input {
|
|
1121
|
+
NSMutableDictionary* json = [NSMutableDictionary new];
|
|
1122
|
+
|
|
1123
|
+
json[@"Certificate_Data"] = [self certificateDataDictionaryFromJson: [input valueForKey:@"securityObject"]];
|
|
1124
|
+
|
|
1125
|
+
return json;
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
+(RGLSecurityObjectCertificates*)securityObjectCertificatesFromJson:(NSDictionary*)input {
|
|
1129
|
+
return [RGLSecurityObjectCertificates initWithJSON:[self securityObjectCertificatesDictionaryFromJson:input]];
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
+(NSDictionary*)generateSecurityObjectCertificates:(RGLSecurityObjectCertificates*)input {
|
|
1133
|
+
if(input == nil) return nil;
|
|
1134
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
1135
|
+
|
|
1136
|
+
result[@"securityObject"] = [self generateCertificateData:input.securityObject];
|
|
1137
|
+
|
|
1138
|
+
return result;
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
+(NSDictionary*)fileDictionaryFromJson:(NSDictionary*)input {
|
|
1142
|
+
NSMutableDictionary* json = [NSMutableDictionary new];
|
|
1143
|
+
|
|
1144
|
+
json[@"FileData"] = [self fileDataDictionaryFromJson: [input valueForKey:@"fileData"]];
|
|
1145
|
+
json[@"SecurityObject_Certificates"] = [self securityObjectCertificatesDictionaryFromJson: [input valueForKey:@"certificates"]];
|
|
1146
|
+
json[@"FileID"] = [input valueForKey:@"fileID"];
|
|
1147
|
+
json[@"PA_Status"] = [input valueForKey:@"pAStatus"];
|
|
1148
|
+
json[@"ReadingStatus"] = [input valueForKey:@"readingStatus"];
|
|
1149
|
+
json[@"ReadingTime"] = [input valueForKey:@"readingTime"];
|
|
1150
|
+
json[@"Type"] = [input valueForKey:@"type"];
|
|
1151
|
+
json[@"DocFields_Originals"] = [input valueForKey:@"docFieldsOriginals"];
|
|
1152
|
+
json[@"DocFields_Graphics"] = [input valueForKey:@"docFieldsGraphics"];
|
|
1153
|
+
json[@"DocFields_Text"] = [input valueForKey:@"docFieldsText"];
|
|
1154
|
+
json[@"Notifications"] = [input valueForKey:@"notifications"];
|
|
1155
|
+
|
|
1156
|
+
return json;
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
+(RGLFile*)fileFromJson:(NSDictionary*)input {
|
|
1160
|
+
return [RGLFile initWithJSON:[self fileDictionaryFromJson:input]];
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
+(NSDictionary*)generateFile:(RGLFile*)input {
|
|
1164
|
+
if(input == nil) return nil;
|
|
1165
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
1166
|
+
|
|
1167
|
+
result[@"fileData"] = [self generateFileData:input.fileData];
|
|
1168
|
+
result[@"fileID"] = input.fileID;
|
|
1169
|
+
if(input.notifications != nil){
|
|
1170
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
1171
|
+
for(NSNumber* item in input.notifications)
|
|
1172
|
+
[array addObject:item];
|
|
1173
|
+
result[@"notifications"] = array;
|
|
1174
|
+
}
|
|
1175
|
+
result[@"pAStatus"] = @(input.pAStatus);
|
|
1176
|
+
result[@"readingStatus"] = @(input.readingStatus);
|
|
1177
|
+
result[@"readingTime"] = @(input.readingTime);
|
|
1178
|
+
result[@"type"] = @(input.type);
|
|
1179
|
+
result[@"typeName"] = input.typeName;
|
|
1180
|
+
if(input.docFieldsText != nil){
|
|
1181
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
1182
|
+
for(NSNumber* item in input.docFieldsText)
|
|
1183
|
+
[array addObject:item];
|
|
1184
|
+
result[@"docFieldsText"] = array;
|
|
1185
|
+
}
|
|
1186
|
+
if(input.docFieldsGraphics != nil){
|
|
1187
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
1188
|
+
for(NSNumber* item in input.docFieldsGraphics)
|
|
1189
|
+
[array addObject:item];
|
|
1190
|
+
result[@"docFieldsGraphics"] = array;
|
|
1191
|
+
}
|
|
1192
|
+
if(input.docFieldsOriginals != nil){
|
|
1193
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
1194
|
+
for(NSNumber* item in input.docFieldsOriginals)
|
|
1195
|
+
[array addObject:item];
|
|
1196
|
+
result[@"docFieldsOriginals"] = array;
|
|
1197
|
+
}
|
|
1198
|
+
result[@"certificates"] = [self generateSecurityObjectCertificates:input.certificates];
|
|
1199
|
+
|
|
1200
|
+
return result;
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
+(NSDictionary*)applicationDictionaryFromJson:(NSDictionary*)input {
|
|
1204
|
+
NSMutableDictionary* json = [NSMutableDictionary new];
|
|
1205
|
+
|
|
1206
|
+
json[@"ApplicationID"] = [input valueForKey:@"applicationID"];
|
|
1207
|
+
json[@"DataHashAlgorithm"] = [input valueForKey:@"dataHashAlgorithm"];
|
|
1208
|
+
json[@"Type"] = [input valueForKey:@"type"];
|
|
1209
|
+
json[@"Status"] = [input valueForKey:@"status"];
|
|
1210
|
+
json[@"UnicodeVersion"] = [input valueForKey:@"unicodeVersion"];
|
|
1211
|
+
json[@"Version"] = [input valueForKey:@"version"];
|
|
1212
|
+
NSMutableArray<NSDictionary*>* array = [NSMutableArray new];
|
|
1213
|
+
for(NSDictionary* item in [input valueForKey:@"files"]){
|
|
1214
|
+
[array addObject:[self fileDictionaryFromJson:item]];
|
|
1215
|
+
}
|
|
1216
|
+
json[@"Files"] = array;
|
|
1217
|
+
|
|
1218
|
+
return json;
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
+(RGLApplication*)applicationFromJson:(NSDictionary*)input {
|
|
1222
|
+
return [RGLApplication initWithJSON:[self applicationDictionaryFromJson:input]];
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
+(NSDictionary*)generateApplication:(RGLApplication*)input {
|
|
1226
|
+
if(input == nil) return nil;
|
|
1227
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
1228
|
+
|
|
1229
|
+
result[@"applicationID"] = input.applicationID;
|
|
1230
|
+
result[@"dataHashAlgorithm"] = input.dataHashAlgorithm;
|
|
1231
|
+
if(input.files != nil){
|
|
1232
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
1233
|
+
for(RGLFile* item in input.files)
|
|
1234
|
+
[array addObject:[self generateFile:item]];
|
|
1235
|
+
result[@"files"] = array;
|
|
1236
|
+
}
|
|
1237
|
+
result[@"type"] = @(input.type);
|
|
1238
|
+
result[@"status"] = @(input.status);
|
|
1239
|
+
result[@"unicodeVersion"] = input.unicodeVersion;
|
|
1240
|
+
result[@"version"] = input.version;
|
|
1241
|
+
|
|
1242
|
+
return result;
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
+(NSDictionary*)rfidValueDictionaryFromJson:(NSDictionary*)input {
|
|
1246
|
+
NSMutableDictionary* json = [NSMutableDictionary new];
|
|
1247
|
+
|
|
1248
|
+
json[@"Type"] = [input valueForKey:@"type"];
|
|
1249
|
+
json[@"Data"] = [input valueForKey:@"data"];
|
|
1250
|
+
json[@"Length"] = [input valueForKey:@"length"];
|
|
1251
|
+
json[@"Status"] = [input valueForKey:@"status"];
|
|
1252
|
+
json[@"Format"] = [input valueForKey:@"format"];
|
|
1253
|
+
|
|
1254
|
+
return json;
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
+(RGLRFIDValue*)rfidValueFromJson:(NSDictionary*)input {
|
|
1258
|
+
return [RGLRFIDValue initWithJSON:[self rfidValueDictionaryFromJson:input]];
|
|
1259
|
+
}
|
|
1260
|
+
|
|
1261
|
+
+(NSDictionary*)generateRFIDValue:(RGLRFIDValue*)input {
|
|
1262
|
+
if(input == nil) return nil;
|
|
1263
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
1264
|
+
|
|
1265
|
+
result[@"data"] = input.data;
|
|
1266
|
+
result[@"length"] = @(input.length);
|
|
1267
|
+
result[@"status"] = @(input.status);
|
|
1268
|
+
result[@"type"] = @(input.type);
|
|
1269
|
+
result[@"format"] = input.format;
|
|
1270
|
+
|
|
1271
|
+
return result;
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
+(NSDictionary*)attributeDictionaryFromJson:(NSDictionary*)input {
|
|
1275
|
+
NSMutableDictionary* json = [NSMutableDictionary new];
|
|
1276
|
+
|
|
1277
|
+
json[@"Type"] = [input valueForKey:@"type"];
|
|
1278
|
+
json[@"Value"] = [self rfidValueDictionaryFromJson: [input valueForKey:@"value"]];
|
|
1279
|
+
|
|
1280
|
+
return json;
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
+(RGLAttribute*)attributeFromJson:(NSDictionary*)input {
|
|
1284
|
+
return [RGLAttribute initWithJSON:[self attributeDictionaryFromJson:input]];
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
+(NSDictionary*)generateAttribute:(RGLAttribute*)input {
|
|
1288
|
+
if(input == nil) return nil;
|
|
1289
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
1290
|
+
|
|
1291
|
+
result[@"type"] = input.type;
|
|
1292
|
+
result[@"value"] = [self generateRFIDValue:input.value];
|
|
1293
|
+
|
|
1294
|
+
return result;
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
+(NSDictionary*)authorityDictionaryFromJson:(NSDictionary*)input {
|
|
1298
|
+
NSMutableDictionary* json = [NSMutableDictionary new];
|
|
1299
|
+
|
|
1300
|
+
json[@"Data"] = [input valueForKey:@"data"];
|
|
1301
|
+
json[@"FriendlyName"] = [self rfidValueDictionaryFromJson: [input valueForKey:@"friendlyName"]];
|
|
1302
|
+
NSMutableArray<NSDictionary*>* array = [NSMutableArray new];
|
|
1303
|
+
for(NSDictionary* item in [input valueForKey:@"attributes"]){
|
|
1304
|
+
[array addObject:[self attributeDictionaryFromJson:item]];
|
|
1305
|
+
}
|
|
1306
|
+
json[@"Attributes"] = array;
|
|
1307
|
+
|
|
1308
|
+
return json;
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
+(RGLAuthority*)authorityFromJson:(NSDictionary*)input {
|
|
1312
|
+
return [RGLAuthority initWithJSON:[self authorityDictionaryFromJson:input]];
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1315
|
+
+(NSDictionary*)generateAuthority:(RGLAuthority*)input {
|
|
1316
|
+
if(input == nil) return nil;
|
|
1317
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
1318
|
+
|
|
1319
|
+
if(input.attributes != nil){
|
|
1320
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
1321
|
+
for(RGLAttribute* item in input.attributes)
|
|
1322
|
+
[array addObject:[self generateAttribute:item]];
|
|
1323
|
+
result[@"attributes"] = array;
|
|
1324
|
+
}
|
|
1325
|
+
result[@"data"] = input.data;
|
|
1326
|
+
result[@"friendlyName"] = [self generateRFIDValue:input.friendlyName];
|
|
1327
|
+
|
|
1328
|
+
return result;
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1331
|
+
+(NSDictionary*)extensionDictionaryFromJson:(NSDictionary*)input {
|
|
1332
|
+
NSMutableDictionary* json = [NSMutableDictionary new];
|
|
1333
|
+
|
|
1334
|
+
json[@"Data"] = [input valueForKey:@"data"];
|
|
1335
|
+
json[@"Type"] = [input valueForKey:@"type"];
|
|
1336
|
+
|
|
1337
|
+
return json;
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
+(RGLExtension*)extensionFromJson:(NSDictionary*)input {
|
|
1341
|
+
return [RGLExtension initWithJSON:[self extensionDictionaryFromJson:input]];
|
|
1342
|
+
}
|
|
1343
|
+
|
|
1344
|
+
+(NSDictionary*)generateExtension:(RGLExtension*)input {
|
|
1345
|
+
if(input == nil) return nil;
|
|
1346
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
1347
|
+
|
|
1348
|
+
result[@"data"] = input.data;
|
|
1349
|
+
result[@"type"] = input.type;
|
|
1350
|
+
|
|
1351
|
+
return result;
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1354
|
+
+(NSDictionary*)validityDictionaryFromJson:(NSDictionary*)input {
|
|
1355
|
+
NSMutableDictionary* json = [NSMutableDictionary new];
|
|
1356
|
+
|
|
1357
|
+
json[@"NotAfter"] = [self rfidValueDictionaryFromJson: [input valueForKey:@"notAfter"]];
|
|
1358
|
+
json[@"NotBefore"] = [self rfidValueDictionaryFromJson: [input valueForKey:@"notBefore"]];
|
|
1359
|
+
|
|
1360
|
+
return json;
|
|
1361
|
+
}
|
|
1362
|
+
|
|
1363
|
+
+(RGLValidity*)validityFromJson:(NSDictionary*)input {
|
|
1364
|
+
return [RGLValidity initWithJSON:[self validityDictionaryFromJson:input]];
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1367
|
+
+(NSDictionary*)generateValidity:(RGLValidity*)input {
|
|
1368
|
+
if(input == nil) return nil;
|
|
1369
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
1370
|
+
|
|
1371
|
+
result[@"notAfter"] = [self generateRFIDValue:input.notAfter];
|
|
1372
|
+
result[@"notBefore"] = [self generateRFIDValue:input.notBefore];
|
|
1373
|
+
|
|
1374
|
+
return result;
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
+(NSDictionary*)certificateChainDictionaryFromJson:(NSDictionary*)input {
|
|
1378
|
+
NSMutableDictionary* json = [NSMutableDictionary new];
|
|
1379
|
+
|
|
1380
|
+
json[@"Version"] = [input valueForKey:@"version"];
|
|
1381
|
+
json[@"Type"] = [input valueForKey:@"type"];
|
|
1382
|
+
json[@"SubjectPKAlgorithm"] = [input valueForKey:@"subjectPKAlgorithm"];
|
|
1383
|
+
json[@"SignatureAlgorithm"] = [input valueForKey:@"signatureAlgorithm"];
|
|
1384
|
+
json[@"SerialNumber"] = [input valueForKey:@"serialNumber"];
|
|
1385
|
+
json[@"PA_Status"] = [input valueForKey:@"paStatus"];
|
|
1386
|
+
json[@"Origin"] = [input valueForKey:@"origin"];
|
|
1387
|
+
json[@"Notifications"] = [input valueForKey:@"notifications"];
|
|
1388
|
+
json[@"Validity"] = [self validityDictionaryFromJson: [input valueForKey:@"validity"]];
|
|
1389
|
+
json[@"Subject"] = [self authorityDictionaryFromJson: [input valueForKey:@"subject"]];
|
|
1390
|
+
json[@"Issuer"] = [self authorityDictionaryFromJson: [input valueForKey:@"issuer"]];
|
|
1391
|
+
json[@"FileName"] = [self rfidValueDictionaryFromJson: [input valueForKey:@"fileName"]];
|
|
1392
|
+
NSMutableArray<NSDictionary*>* array = [NSMutableArray new];
|
|
1393
|
+
for(NSDictionary* item in [input valueForKey:@"extensions"]){
|
|
1394
|
+
[array addObject:[self extensionDictionaryFromJson:item]];
|
|
1395
|
+
}
|
|
1396
|
+
json[@"Extensions"] = array;
|
|
1397
|
+
|
|
1398
|
+
return json;
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
+(RGLCertificateChain*)certificateChainFromJson:(NSDictionary*)input {
|
|
1402
|
+
return [RGLCertificateChain initWithJSON:[self certificateChainDictionaryFromJson:input]];
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1405
|
+
+(NSDictionary*)generateCertificateChain:(RGLCertificateChain*)input {
|
|
1406
|
+
if(input == nil) return nil;
|
|
1407
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
1408
|
+
|
|
1409
|
+
if(input.extensions != nil){
|
|
1410
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
1411
|
+
for(RGLExtension* item in input.extensions)
|
|
1412
|
+
[array addObject:[self generateExtension:item]];
|
|
1413
|
+
result[@"extensions"] = array;
|
|
1414
|
+
}
|
|
1415
|
+
result[@"fileName"] = [self generateRFIDValue:input.fileName];
|
|
1416
|
+
result[@"issuer"] = [self generateAuthority:input.issuer];
|
|
1417
|
+
if(input.notifications != nil){
|
|
1418
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
1419
|
+
for(NSNumber* item in input.notifications)
|
|
1420
|
+
[array addObject:item];
|
|
1421
|
+
result[@"notifications"] = array;
|
|
1422
|
+
}
|
|
1423
|
+
result[@"origin"] = @(input.origin);
|
|
1424
|
+
result[@"paStatus"] = @(input.paStatus);
|
|
1425
|
+
result[@"serialNumber"] = input.serialNumber;
|
|
1426
|
+
result[@"signatureAlgorithm"] = input.signatureAlgorithm;
|
|
1427
|
+
result[@"subject"] = [self generateAuthority:input.subject];
|
|
1428
|
+
result[@"subjectPKAlgorithm"] = input.subjectPKAlgorithm;
|
|
1429
|
+
result[@"type"] = @(input.type);
|
|
1430
|
+
result[@"validity"] = [self generateValidity:input.validity];
|
|
1431
|
+
result[@"version"] = @(input.version);
|
|
1432
|
+
|
|
1433
|
+
return result;
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
+(NSDictionary*)signerInfoDictionaryFromJson:(NSDictionary*)input {
|
|
1437
|
+
NSMutableDictionary* json = [NSMutableDictionary new];
|
|
1438
|
+
|
|
1439
|
+
json[@"DataToHash"] = [input valueForKey:@"dataToHash"];
|
|
1440
|
+
json[@"DigestAlgorithm"] = [input valueForKey:@"digestAlgorithm"];
|
|
1441
|
+
json[@"PA_Status"] = [input valueForKey:@"paStatus"];
|
|
1442
|
+
json[@"SignatureAlgorithm"] = [input valueForKey:@"signatureAlgorithm"];
|
|
1443
|
+
json[@"Version"] = [input valueForKey:@"version"];
|
|
1444
|
+
json[@"Notifications"] = [input valueForKey:@"notifications"];
|
|
1445
|
+
json[@"Issuer"] = [self authorityDictionaryFromJson: [input valueForKey:@"issuer"]];
|
|
1446
|
+
json[@"SerialNumber"] = [self rfidValueDictionaryFromJson: [input valueForKey:@"serialNumber"]];
|
|
1447
|
+
json[@"Signature"] = [self rfidValueDictionaryFromJson: [input valueForKey:@"signature"]];
|
|
1448
|
+
json[@"SubjectKeyIdentifier"] = [self rfidValueDictionaryFromJson: [input valueForKey:@"subjectKeyIdentifier"]];
|
|
1449
|
+
NSMutableArray<NSDictionary*>* array = [NSMutableArray new];
|
|
1450
|
+
for(NSDictionary* item in [input valueForKey:@"certificateChain"]){
|
|
1451
|
+
[array addObject:[self certificateChainDictionaryFromJson:item]];
|
|
1452
|
+
}
|
|
1453
|
+
json[@"CertificateChain"] = array;
|
|
1454
|
+
NSMutableArray<NSDictionary*>* array2 = [NSMutableArray new];
|
|
1455
|
+
for(NSDictionary* item in [input valueForKey:@"signedAttributes"]){
|
|
1456
|
+
[array2 addObject:[self extensionDictionaryFromJson:item]];
|
|
1457
|
+
}
|
|
1458
|
+
json[@"SignedAttributes"] = array2;
|
|
1459
|
+
|
|
1460
|
+
return json;
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
+(RGLSignerInfo*)signerInfoFromJson:(NSDictionary*)input {
|
|
1464
|
+
return [RGLSignerInfo initWithJSON:[self signerInfoDictionaryFromJson:input]];
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1467
|
+
+(NSDictionary*)generateSignerInfo:(RGLSignerInfo*)input {
|
|
1468
|
+
if(input == nil) return nil;
|
|
1469
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
1470
|
+
|
|
1471
|
+
result[@"dataToHash"] = input.dataToHash;
|
|
1472
|
+
result[@"digestAlgorithm"] = input.digestAlgorithm;
|
|
1473
|
+
result[@"paStatus"] = @(input.paStatus);
|
|
1474
|
+
result[@"signatureAlgorithm"] = input.signatureAlgorithm;
|
|
1475
|
+
result[@"version"] = @(input.version);
|
|
1476
|
+
result[@"issuer"] = [self generateAuthority:input.issuer];
|
|
1477
|
+
result[@"serialNumber"] = [self generateRFIDValue:input.serialNumber];
|
|
1478
|
+
result[@"signature"] = [self generateRFIDValue:input.signature];
|
|
1479
|
+
if(input.signedAttributes != nil){
|
|
1480
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
1481
|
+
for(RGLExtension* item in input.signedAttributes)
|
|
1482
|
+
[array addObject:[self generateExtension:item]];
|
|
1483
|
+
result[@"signedAttributes"] = array;
|
|
1484
|
+
}
|
|
1485
|
+
result[@"subjectKeyIdentifier"] = [self generateRFIDValue:input.subjectKeyIdentifier];
|
|
1486
|
+
if(input.certificateChain != nil){
|
|
1487
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
1488
|
+
for(RGLCertificateChain* item in input.certificateChain)
|
|
1489
|
+
[array addObject:[self generateCertificateChain:item]];
|
|
1490
|
+
result[@"certificateChain"] = array;
|
|
1491
|
+
}
|
|
1492
|
+
if(input.notifications != nil){
|
|
1493
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
1494
|
+
for(NSNumber* item in input.notifications)
|
|
1495
|
+
[array addObject:item];
|
|
1496
|
+
result[@"notifications"] = array;
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1499
|
+
return result;
|
|
1500
|
+
}
|
|
1501
|
+
|
|
1502
|
+
+(NSDictionary*)securityObjectDictionaryFromJson:(NSDictionary*)input {
|
|
1503
|
+
NSMutableDictionary* json = [NSMutableDictionary new];
|
|
1504
|
+
|
|
1505
|
+
json[@"FileReference"] = [input valueForKey:@"fileReference"];
|
|
1506
|
+
json[@"ObjectType"] = [input valueForKey:@"objectType"];
|
|
1507
|
+
json[@"Version"] = [input valueForKey:@"version"];
|
|
1508
|
+
json[@"Notifications"] = [input valueForKey:@"notifications"];
|
|
1509
|
+
NSMutableArray<NSDictionary*>* array = [NSMutableArray new];
|
|
1510
|
+
for(NSDictionary* item in [input valueForKey:@"signerInfos"]){
|
|
1511
|
+
[array addObject:[self signerInfoDictionaryFromJson:item]];
|
|
1512
|
+
}
|
|
1513
|
+
json[@"SignerInfos"] = array;
|
|
1514
|
+
|
|
1515
|
+
return json;
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
+(RGLSecurityObject*)securityObjectFromJson:(NSDictionary*)input {
|
|
1519
|
+
return [RGLSecurityObject initWithJSON:[self securityObjectDictionaryFromJson:input]];
|
|
1520
|
+
}
|
|
1521
|
+
|
|
1522
|
+
+(NSDictionary*)generateSecurityObject:(RGLSecurityObject*)input {
|
|
1523
|
+
if(input == nil) return nil;
|
|
1524
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
1525
|
+
|
|
1526
|
+
result[@"fileReference"] = @(input.fileReference);
|
|
1527
|
+
result[@"objectType"] = input.objectType;
|
|
1528
|
+
result[@"version"] = @(input.version);
|
|
1529
|
+
if(input.signerInfos != nil){
|
|
1530
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
1531
|
+
for(RGLSignerInfo* item in input.signerInfos)
|
|
1532
|
+
[array addObject:[self generateSignerInfo:item]];
|
|
1533
|
+
result[@"signerInfos"] = array;
|
|
1534
|
+
}
|
|
1535
|
+
if(input.notifications != nil){
|
|
1536
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
1537
|
+
for(NSNumber* item in input.notifications)
|
|
1538
|
+
[array addObject:item];
|
|
1539
|
+
result[@"notifications"] = array;
|
|
1540
|
+
}
|
|
1541
|
+
|
|
1542
|
+
return result;
|
|
1543
|
+
}
|
|
1544
|
+
|
|
1545
|
+
+(NSDictionary*)cardPropertiesDictionaryFromJson:(NSDictionary*)input {
|
|
1546
|
+
NSMutableDictionary* json = [NSMutableDictionary new];
|
|
1547
|
+
|
|
1548
|
+
json[@"ATQ_A"] = [input valueForKey:@"aTQA"];
|
|
1549
|
+
json[@"ATQ_B"] = [input valueForKey:@"aTQB"];
|
|
1550
|
+
json[@"ATR"] = [input valueForKey:@"aTR"];
|
|
1551
|
+
json[@"Baudrate1"] = [input valueForKey:@"baudrate1"];
|
|
1552
|
+
json[@"Baudrate2"] = [input valueForKey:@"baudrate2"];
|
|
1553
|
+
json[@"BitRateR"] = [input valueForKey:@"bitRateR"];
|
|
1554
|
+
json[@"BitRateS"] = [input valueForKey:@"bitRateS"];
|
|
1555
|
+
json[@"ChipType_A"] = [input valueForKey:@"chipTypeA"];
|
|
1556
|
+
json[@"MifareMemory"] = [input valueForKey:@"mifareMemory"];
|
|
1557
|
+
json[@"RFID_Type"] = [input valueForKey:@"rfidType"];
|
|
1558
|
+
json[@"SAK"] = [input valueForKey:@"sAK"];
|
|
1559
|
+
json[@"Support_4"] = [input valueForKey:@"support4"];
|
|
1560
|
+
json[@"Support_Mifare"] = [input valueForKey:@"supportMifare"];
|
|
1561
|
+
json[@"UID"] = [input valueForKey:@"uID"];
|
|
1562
|
+
|
|
1563
|
+
return json;
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1566
|
+
+(RGLCardProperties*)cardPropertiesFromJson:(NSDictionary*)input {
|
|
1567
|
+
return [RGLCardProperties initWithJSON:[self cardPropertiesDictionaryFromJson:input]];
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
+(NSDictionary*)generateCardProperties:(RGLCardProperties*)input {
|
|
1571
|
+
if(input == nil) return nil;
|
|
1572
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
1573
|
+
|
|
1574
|
+
result[@"aTQA"] = @(input.aTQA);
|
|
1575
|
+
result[@"aTQB"] = input.aTQB;
|
|
1576
|
+
result[@"aTR"] = input.aTR;
|
|
1577
|
+
result[@"baudrate1"] = input.baudrate1;
|
|
1578
|
+
result[@"baudrate2"] = input.baudrate2;
|
|
1579
|
+
result[@"bitRateR"] = @(input.bitRateR);
|
|
1580
|
+
result[@"bitRateS"] = @(input.bitRateS);
|
|
1581
|
+
result[@"chipTypeA"] = @(input.chipTypeA);
|
|
1582
|
+
result[@"mifareMemory"] = @(input.mifareMemory);
|
|
1583
|
+
result[@"rfidType"] = @(input.rfidType);
|
|
1584
|
+
result[@"sAK"] = @(input.sAK);
|
|
1585
|
+
result[@"support4"] = @(input.support4);
|
|
1586
|
+
result[@"supportMifare"] = @(input.supportMifare);
|
|
1587
|
+
result[@"uID"] = input.uID;
|
|
1588
|
+
|
|
1589
|
+
return result;
|
|
1590
|
+
}
|
|
1591
|
+
|
|
1592
|
+
+(NSDictionary*)rfidSessionDataDictionaryFromJson:(NSDictionary*)input {
|
|
1593
|
+
NSMutableDictionary* json = [NSMutableDictionary new];
|
|
1594
|
+
|
|
1595
|
+
json[@"ExtLeSupport"] = [input valueForKey:@"extLeSupport"];
|
|
1596
|
+
json[@"ProcessTime"] = [input valueForKey:@"processTime"];
|
|
1597
|
+
json[@"Status"] = [input valueForKey:@"status"];
|
|
1598
|
+
json[@"TotalBytesReceived"] = [input valueForKey:@"totalBytesReceived"];
|
|
1599
|
+
json[@"TotalBytesSent"] = [input valueForKey:@"totalBytesSent"];
|
|
1600
|
+
json[@"DataGroups"] = [input valueForKey:@"dataGroups"];
|
|
1601
|
+
json[@"CardProperties"] = [self cardPropertiesDictionaryFromJson: [input valueForKey:@"cardProperties"]];
|
|
1602
|
+
NSMutableArray<NSDictionary*>* array = [NSMutableArray new];
|
|
1603
|
+
for(NSDictionary* item in [input valueForKey:@"accessControls"]){
|
|
1604
|
+
[array addObject:[self accessControlProcedureTypeDictionaryFromJson:item]];
|
|
1605
|
+
}
|
|
1606
|
+
json[@"AccessControls"] = array;
|
|
1607
|
+
NSMutableArray<NSDictionary*>* array2 = [NSMutableArray new];
|
|
1608
|
+
for(NSDictionary* item in [input valueForKey:@"applications"]){
|
|
1609
|
+
[array2 addObject:[self applicationDictionaryFromJson:item]];
|
|
1610
|
+
}
|
|
1611
|
+
json[@"Applications"] = array2;
|
|
1612
|
+
NSMutableArray<NSDictionary*>* array3 = [NSMutableArray new];
|
|
1613
|
+
for(NSDictionary* item in [input valueForKey:@"securityObjects"]){
|
|
1614
|
+
[array3 addObject:[self securityObjectDictionaryFromJson:item]];
|
|
1615
|
+
}
|
|
1616
|
+
json[@"SecurityObjects"] = array3;
|
|
1617
|
+
|
|
1618
|
+
return json;
|
|
1619
|
+
}
|
|
1620
|
+
|
|
1621
|
+
+(RGLRFIDSessionData*)rfidSessionDataFromJson:(NSDictionary*)input {
|
|
1622
|
+
NSMutableArray<RGLDataField*>* array = [NSMutableArray new];
|
|
1623
|
+
for(NSDictionary* item in [input valueForKey:@"dataFields"]){
|
|
1624
|
+
[array addObject:[self dataFieldFromJson:item]];
|
|
1625
|
+
}
|
|
1626
|
+
return [RGLRFIDSessionData
|
|
1627
|
+
initWithJSON:[self rfidSessionDataDictionaryFromJson:input]
|
|
1628
|
+
dataFields:array];
|
|
1629
|
+
}
|
|
1630
|
+
|
|
1631
|
+
+(NSDictionary*)generateRFIDSessionData:(RGLRFIDSessionData*)input {
|
|
1632
|
+
if(input == nil) return nil;
|
|
1633
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
1634
|
+
|
|
1635
|
+
if(input.accessControls != nil){
|
|
1636
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
1637
|
+
for(RGLAccessControlProcedureType* item in input.accessControls)
|
|
1638
|
+
[array addObject:[self generateAccessControlProcedureType:item]];
|
|
1639
|
+
result[@"accessControls"] = array;
|
|
1640
|
+
}
|
|
1641
|
+
if(input.applications != nil){
|
|
1642
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
1643
|
+
for(RGLApplication* item in input.applications)
|
|
1644
|
+
[array addObject:[self generateApplication:item]];
|
|
1645
|
+
result[@"applications"] = array;
|
|
1646
|
+
}
|
|
1647
|
+
if(input.securityObjects != nil){
|
|
1648
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
1649
|
+
for(RGLSecurityObject* item in input.securityObjects)
|
|
1650
|
+
[array addObject:[self generateSecurityObject:item]];
|
|
1651
|
+
result[@"securityObjects"] = array;
|
|
1652
|
+
}
|
|
1653
|
+
result[@"cardProperties"] = [self generateCardProperties:input.cardProperties];
|
|
1654
|
+
result[@"totalBytesReceived"] = @(input.totalBytesReceived);
|
|
1655
|
+
result[@"totalBytesSent"] = @(input.totalBytesSent);
|
|
1656
|
+
result[@"status"] = @(input.status);
|
|
1657
|
+
result[@"extLeSupport"] = @(input.extLeSupport);
|
|
1658
|
+
result[@"processTime"] = @(input.processTime);
|
|
1659
|
+
if(input.dataGroups != nil){
|
|
1660
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
1661
|
+
for(NSNumber* item in input.dataGroups)
|
|
1662
|
+
if(item != nil)
|
|
1663
|
+
[array addObject:item];
|
|
1664
|
+
result[@"dataGroups"] = array;
|
|
1665
|
+
}
|
|
1666
|
+
if(input.dataFields != nil){
|
|
1667
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
1668
|
+
for(RGLDataField* item in input.dataFields)
|
|
1669
|
+
if(item != nil)
|
|
1670
|
+
[array addObject:[self generateDataField:item]];
|
|
1671
|
+
result[@"dataFields"] = array;
|
|
1672
|
+
}
|
|
1673
|
+
|
|
1674
|
+
return result;
|
|
1675
|
+
}
|
|
1676
|
+
|
|
1677
|
+
+(NSDictionary*)dataFieldDictionaryFromJson:(NSDictionary*)input {
|
|
1678
|
+
NSMutableDictionary* json = [NSMutableDictionary new];
|
|
1679
|
+
|
|
1680
|
+
json[@"Data"] = [input valueForKey:@"data"];
|
|
1681
|
+
json[@"FieldType"] = [input valueForKey:@"fieldType"];
|
|
1682
|
+
|
|
1683
|
+
return json;
|
|
1684
|
+
}
|
|
1685
|
+
|
|
1686
|
+
+(RGLDataField*)dataFieldFromJson:(NSDictionary*)input {
|
|
1687
|
+
return [RGLDataField initWithJSON:[self dataFieldDictionaryFromJson:input]];
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1690
|
+
+(NSDictionary*)generateDataField:(RGLDataField*)input {
|
|
1691
|
+
NSMutableDictionary *result = [NSMutableDictionary new];
|
|
1692
|
+
if(input == nil) return nil;
|
|
1693
|
+
|
|
1694
|
+
result[@"data"] = input.data;
|
|
1695
|
+
result[@"fieldType"] = @(input.fieldType);
|
|
1696
|
+
|
|
1697
|
+
return result;
|
|
1698
|
+
}
|
|
1699
|
+
|
|
1700
|
+
+(RGLAuthenticityCheck*)authenticityCheckFromJson:(NSDictionary*)input {
|
|
1701
|
+
if(input == nil) return nil;
|
|
1702
|
+
NSMutableArray<RGLAuthenticityElement*> *array = [NSMutableArray new];
|
|
1703
|
+
for(NSDictionary* item in [input valueForKey:@"elements"])
|
|
1704
|
+
[array addObject:[self authenticityElementFromJson:item]];
|
|
1705
|
+
RGLAuthenticityCheck* result = [[RGLAuthenticityCheck alloc]
|
|
1706
|
+
initWithAuthenticity:[[input valueForKey:@"type"] integerValue]
|
|
1707
|
+
elements:array
|
|
1708
|
+
pageIndex:[[input valueForKey:@"pageIndex"] integerValue]];
|
|
1709
|
+
if (input[@"status"]) [result setValue:input[@"status"] forKey:@"status"];
|
|
1710
|
+
return result;;
|
|
1711
|
+
}
|
|
1712
|
+
|
|
1713
|
+
+(NSDictionary*)generateAuthenticityCheck:(RGLAuthenticityCheck*)input {
|
|
1714
|
+
if(input == nil) return nil;
|
|
1715
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
1716
|
+
|
|
1717
|
+
result[@"type"] = @(input.type);
|
|
1718
|
+
result[@"typeName"] = input.typeName;
|
|
1719
|
+
result[@"status"] = @(input.status);
|
|
1720
|
+
if(input.elements != nil){
|
|
1721
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
1722
|
+
for(RGLAuthenticityElement* item in input.elements)
|
|
1723
|
+
[array addObject:[self generateAuthenticityElement:item]];
|
|
1724
|
+
result[@"elements"] = array;
|
|
1725
|
+
}
|
|
1726
|
+
result[@"pageIndex"] = @(input.pageIndex);
|
|
1727
|
+
|
|
1728
|
+
return result;
|
|
1729
|
+
}
|
|
1730
|
+
|
|
1731
|
+
+(NSDictionary*)pdf417InfoDictionaryFromJson:(NSDictionary*)input {
|
|
1732
|
+
NSMutableDictionary* json = [NSMutableDictionary new];
|
|
1733
|
+
|
|
1734
|
+
json[@"bcErrorLevel"] = [input valueForKey:@"errorLevel"];
|
|
1735
|
+
json[@"bcColumn"] = [input valueForKey:@"columns"];
|
|
1736
|
+
json[@"bcRow"] = [input valueForKey:@"rows"];
|
|
1737
|
+
|
|
1738
|
+
return json;
|
|
1739
|
+
}
|
|
1740
|
+
|
|
1741
|
+
+(RGLPDF417Info*)pdf417InfoFromJson:(NSDictionary*)input {
|
|
1742
|
+
return [RGLPDF417Info initWithJSON:[self pdf417InfoDictionaryFromJson:input]];
|
|
1743
|
+
}
|
|
1744
|
+
|
|
1745
|
+
+(NSDictionary*)generatePDF417Info:(RGLPDF417Info*)input {
|
|
1746
|
+
if(input == nil) return nil;
|
|
1747
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
1748
|
+
|
|
1749
|
+
result[@"errorLevel"] = @(input.errorLevel);
|
|
1750
|
+
result[@"columns"] = @(input.columns);
|
|
1751
|
+
result[@"rows"] = @(input.rows);
|
|
1752
|
+
|
|
1753
|
+
return result;
|
|
1754
|
+
}
|
|
1755
|
+
|
|
1756
|
+
+(RGLDocumentReaderBarcodeResult*)documentReaderBarcodeResultFromJson:(NSDictionary*)input {
|
|
1757
|
+
NSMutableArray<RGLDocumentReaderBarcodeField*> *array = [NSMutableArray new];
|
|
1758
|
+
for(NSDictionary* item in [input valueForKey:@"fields"])
|
|
1759
|
+
[array addObject:[self documentReaderBarcodeFieldFromJson:item]];
|
|
1760
|
+
return [[RGLDocumentReaderBarcodeResult alloc]
|
|
1761
|
+
initWithFields:array];
|
|
1762
|
+
}
|
|
1763
|
+
|
|
1764
|
+
+(NSDictionary*)generateDocumentReaderBarcodeResult:(RGLDocumentReaderBarcodeResult*)input {
|
|
1765
|
+
if(input == nil) return nil;
|
|
1766
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
1767
|
+
|
|
1768
|
+
if(input.fields != nil){
|
|
1769
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
1770
|
+
for(RGLDocumentReaderBarcodeField* item in input.fields)
|
|
1771
|
+
[array addObject:[self generateDocumentReaderBarcodeField:item]];
|
|
1772
|
+
result[@"fields"] = array;
|
|
1773
|
+
}
|
|
1774
|
+
|
|
1775
|
+
return result;
|
|
1776
|
+
}
|
|
1777
|
+
|
|
1778
|
+
+(RGLDocumentReaderBarcodeField*)documentReaderBarcodeFieldFromJson:(NSDictionary*)input {
|
|
1779
|
+
if(input == nil) return nil;
|
|
1780
|
+
NSMutableDictionary* json = [NSMutableDictionary new];
|
|
1781
|
+
|
|
1782
|
+
json[@"bcType_DECODE"] = [input valueForKey:@"barcodeType"];
|
|
1783
|
+
json[@"bcCodeResult"] = [input valueForKey:@"status"];
|
|
1784
|
+
json[@"bcPDF417INFO"] = [self pdf417InfoDictionaryFromJson:[input valueForKey:@"pdf417Info"]];
|
|
1785
|
+
NSMutableArray<NSDictionary*>* array = [NSMutableArray new];
|
|
1786
|
+
NSMutableDictionary* dict = [NSMutableDictionary new];
|
|
1787
|
+
dict[@"mData"] = [input valueForKey:@"data"];
|
|
1788
|
+
[array addObject:dict];
|
|
1789
|
+
json[@"bcDataModule"] = array;
|
|
1790
|
+
json[@"page_idx"] = [input valueForKey:@"pageIndex"];
|
|
1791
|
+
|
|
1792
|
+
return [RGLDocumentReaderBarcodeField initWithJSON:json];
|
|
1793
|
+
}
|
|
1794
|
+
|
|
1795
|
+
+(NSDictionary*)generateDocumentReaderBarcodeField:(RGLDocumentReaderBarcodeField*)input {
|
|
1796
|
+
if(input == nil) return nil;
|
|
1797
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
1798
|
+
|
|
1799
|
+
result[@"barcodeType"] = @(input.barcodeType);
|
|
1800
|
+
result[@"status"] = @(input.status);
|
|
1801
|
+
result[@"pdf417Info"] = [self generatePDF417Info:input.pdf417Info];
|
|
1802
|
+
result[@"data"] = [self base64Encode:input.data];
|
|
1803
|
+
result[@"pageIndex"] = @(input.pageIndex);
|
|
1804
|
+
|
|
1805
|
+
return result;
|
|
1806
|
+
}
|
|
1807
|
+
|
|
1808
|
+
+(RGLDocumentReaderAuthenticityResult*)documentReaderAuthenticityResultFromJson:(NSDictionary*)input {
|
|
1809
|
+
if(input == nil) return nil;
|
|
1810
|
+
NSMutableArray<RGLAuthenticityCheck*> *array = [NSMutableArray new];
|
|
1811
|
+
for(NSDictionary* item in [input valueForKey:@"checks"])
|
|
1812
|
+
[array addObject:[self authenticityCheckFromJson:item]];
|
|
1813
|
+
RGLDocumentReaderAuthenticityResult* result = [[RGLDocumentReaderAuthenticityResult alloc]
|
|
1814
|
+
initWithAuthenticityChecks:array];
|
|
1815
|
+
if (input[@"status"]) [result setValue:input[@"status"] forKey:@"_security"];
|
|
1816
|
+
return result;
|
|
1817
|
+
}
|
|
1818
|
+
|
|
1819
|
+
+(NSDictionary*)generateDocumentReaderAuthenticityResult:(RGLDocumentReaderAuthenticityResult*)input {
|
|
1820
|
+
if(input == nil) return nil;
|
|
1821
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
1822
|
+
|
|
1823
|
+
result[@"status"] = @(input.status);
|
|
1824
|
+
if(input.checks != nil){
|
|
1825
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
1826
|
+
for(RGLAuthenticityCheck* item in input.checks)
|
|
1827
|
+
[array addObject:[self generateAuthenticityCheck:item]];
|
|
1828
|
+
result[@"checks"] = array;
|
|
1829
|
+
}
|
|
1830
|
+
|
|
1831
|
+
return result;
|
|
1832
|
+
}
|
|
1833
|
+
|
|
1834
|
+
+(RGLAuthenticityElement*)authenticityElementFromJson:(NSDictionary*)input {
|
|
1835
|
+
if(input == nil) return nil;
|
|
1836
|
+
return [[RGLAuthenticityElement alloc]
|
|
1837
|
+
initWithStatus:[[input valueForKey:@"status"] integerValue]
|
|
1838
|
+
elementType:[[input valueForKey:@"elementType"] integerValue]
|
|
1839
|
+
elementDiagnose:[[input valueForKey:@"elementDiagnose"] integerValue]];
|
|
1840
|
+
}
|
|
1841
|
+
|
|
1842
|
+
+(NSDictionary*)generateAuthenticityElement:(RGLAuthenticityElement*)input {
|
|
1843
|
+
if(input == nil) return nil;
|
|
1844
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
1845
|
+
|
|
1846
|
+
result[@"status"] = @(input.status);
|
|
1847
|
+
result[@"elementType"] = @(input.elementType);
|
|
1848
|
+
result[@"elementTypeName"] = input.elementTypeName;
|
|
1849
|
+
result[@"elementDiagnose"] = @(input.elementDiagnose);
|
|
1850
|
+
result[@"elementDiagnoseName"] = input.elementDiagnoseName;
|
|
1851
|
+
|
|
1852
|
+
return result;
|
|
1853
|
+
}
|
|
1854
|
+
|
|
1855
|
+
+(NSDictionary*)paResourcesIssuerDictionaryFromJson:(NSDictionary*)input {
|
|
1856
|
+
NSMutableDictionary* json = input.mutableCopy;
|
|
1857
|
+
|
|
1858
|
+
json[@"Data"] = @{@"#text": [input valueForKey:@"data"]};
|
|
1859
|
+
json[@"FriendlyName"] = [input valueForKey:@"friendlyName"];
|
|
1860
|
+
NSMutableArray<NSDictionary*> *array = [NSMutableArray new];
|
|
1861
|
+
for(NSDictionary* item in [input valueForKey:@"attributes"])
|
|
1862
|
+
[array addObject:[self paAttributeDictionaryFromJson:item]];
|
|
1863
|
+
json[@"Attributes"] = @{@"RFID_Attribute_Name": array};
|
|
1864
|
+
|
|
1865
|
+
return json;
|
|
1866
|
+
}
|
|
1867
|
+
|
|
1868
|
+
+(RGLPAResourcesIssuer*)paResourcesIssuerFromJson:(NSDictionary*)input {
|
|
1869
|
+
return [RGLPAResourcesIssuer initWithJSON:[self paResourcesIssuerDictionaryFromJson: input]];
|
|
1870
|
+
}
|
|
1871
|
+
|
|
1872
|
+
+(NSDictionary*)generatePAResourcesIssuer:(RGLPAResourcesIssuer*)input {
|
|
1873
|
+
if(input == nil) return nil;
|
|
1874
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
1875
|
+
|
|
1876
|
+
result[@"data"] = [self base64Encode:input.data];
|
|
1877
|
+
result[@"friendlyName"] = input.friendlyName;
|
|
1878
|
+
if(input.attributes != nil){
|
|
1879
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
1880
|
+
for(RGLPAAttribute* item in input.attributes)
|
|
1881
|
+
[array addObject:[self generatePAAttribute:item]];
|
|
1882
|
+
result[@"attributes"] = array;
|
|
1883
|
+
}
|
|
1884
|
+
|
|
1885
|
+
return result;
|
|
1886
|
+
}
|
|
1887
|
+
|
|
1888
|
+
+(NSDictionary*)paAttributeDictionaryFromJson:(NSDictionary*)input {
|
|
1889
|
+
NSMutableDictionary* json = input.mutableCopy;
|
|
1890
|
+
|
|
1891
|
+
json[@"Value"] = [input valueForKey:@"value"];
|
|
1892
|
+
json[@"Type"] = [input valueForKey:@"type"];
|
|
1893
|
+
|
|
1894
|
+
return json;
|
|
1895
|
+
}
|
|
1896
|
+
|
|
1897
|
+
+(RGLPAAttribute*)paAttributeFromJson:(NSDictionary*)input {
|
|
1898
|
+
return [RGLPAAttribute initWithJSON:[self paAttributeDictionaryFromJson: input]];
|
|
1899
|
+
}
|
|
1900
|
+
|
|
1901
|
+
+(NSDictionary*)generatePAAttribute:(RGLPAAttribute*)input {
|
|
1902
|
+
if(input == nil) return nil;
|
|
1903
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
1904
|
+
|
|
1905
|
+
result[@"value"] = input.value;
|
|
1906
|
+
result[@"type"] = input.type;
|
|
1907
|
+
|
|
1908
|
+
return result;
|
|
1909
|
+
}
|
|
1910
|
+
|
|
1911
|
+
+(RGLTAChallenge*)taChallengeFromJson:(NSDictionary*)input {
|
|
1912
|
+
NSMutableDictionary* json = input.mutableCopy;
|
|
1913
|
+
|
|
1914
|
+
json[@"#text"] = [input valueForKey:@"data"];
|
|
1915
|
+
json[@"@auxPCD"] = [input valueForKey:@"auxPCD"];
|
|
1916
|
+
json[@"@challengePICC"] = [input valueForKey: @"challengePICC"];
|
|
1917
|
+
json[@"@hashPK"] = [input valueForKey:@"hashPK"];
|
|
1918
|
+
json[@"@idPICC"] = [input valueForKey:@"idPICC"];
|
|
1919
|
+
|
|
1920
|
+
return [RGLTAChallenge initWithJSON:json];
|
|
1921
|
+
}
|
|
1922
|
+
|
|
1923
|
+
+(NSDictionary*)generateTAChallenge:(RGLTAChallenge*)input {
|
|
1924
|
+
if(input == nil) return nil;
|
|
1925
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
1926
|
+
|
|
1927
|
+
result[@"data"] = [self base64Encode:input.data];
|
|
1928
|
+
result[@"auxPCD"] = input.auxPCD;
|
|
1929
|
+
result[@"challengePICC"] = input.challengePICC;
|
|
1930
|
+
result[@"hashPK"] = input.hashPK;
|
|
1931
|
+
result[@"idPICC"] = input.idPICC;
|
|
1932
|
+
|
|
1933
|
+
return result;
|
|
1934
|
+
}
|
|
1935
|
+
|
|
1936
|
+
+(NSDictionary*)documentReaderResultsStatusDictionaryFromJson:(NSDictionary*)input {
|
|
1937
|
+
NSMutableDictionary* json = input.mutableCopy;
|
|
1938
|
+
|
|
1939
|
+
json[@"detailsRFID"] = [self rfidSessionDataStatusDictionaryFromJson: [input valueForKey:@"detailsRFID"] ];
|
|
1940
|
+
|
|
1941
|
+
return json;
|
|
1942
|
+
}
|
|
1943
|
+
|
|
1944
|
+
+(RGLDocumentReaderResultsStatus*)documentReaderResultsStatusFromJson:(NSDictionary*)input {
|
|
1945
|
+
return [RGLDocumentReaderResultsStatus performSelector:NSSelectorFromString(@"resultsStatusWithJSON:") withObject:[self documentReaderResultsStatusDictionaryFromJson: input]];
|
|
1946
|
+
}
|
|
1947
|
+
|
|
1948
|
+
+(NSDictionary*)generateDocumentReaderResultsStatus:(RGLDocumentReaderResultsStatus*)input {
|
|
1949
|
+
if(input == nil) return nil;
|
|
1950
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
1951
|
+
|
|
1952
|
+
result[@"overallStatus"] = @(input.overallStatus);
|
|
1953
|
+
result[@"optical"] = @(input.optical);
|
|
1954
|
+
result[@"detailsOptical"] = [self generateOpticalStatus:input.detailsOptical];
|
|
1955
|
+
result[@"rfid"] = @(input.rfid);
|
|
1956
|
+
result[@"detailsRFID"] = [self generateRFIDSessionDataStatus:input.detailsRFID];
|
|
1957
|
+
result[@"portrait"] = @(input.portrait);
|
|
1958
|
+
result[@"stopList"] = @(input.stopList);
|
|
1959
|
+
|
|
1960
|
+
return result;
|
|
1961
|
+
}
|
|
1962
|
+
|
|
1963
|
+
+(RGLOpticalStatus*)opticalStatusFromJson:(NSDictionary*)input {
|
|
1964
|
+
return [RGLOpticalStatus performSelector:NSSelectorFromString(@"opticalStatusWithJSON:") withObject:input];
|
|
1965
|
+
}
|
|
1966
|
+
|
|
1967
|
+
+(NSDictionary*)generateOpticalStatus:(RGLOpticalStatus*)input {
|
|
1968
|
+
if(input == nil) return nil;
|
|
1969
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
1970
|
+
|
|
1971
|
+
result[@"overallStatus"] = @(input.overallStatus);
|
|
1972
|
+
result[@"mrz"] = @(input.mrz);
|
|
1973
|
+
result[@"text"] = @(input.text);
|
|
1974
|
+
result[@"docType"] = @(input.docType);
|
|
1975
|
+
result[@"security"] = @(input.security);
|
|
1976
|
+
result[@"imageQA"] = @(input.imageQA);
|
|
1977
|
+
result[@"expiry"] = @(input.expiry);
|
|
1978
|
+
result[@"vds"] = @(input.vds);
|
|
1979
|
+
result[@"pagesCount"] = @(input.pagesCount);
|
|
1980
|
+
|
|
1981
|
+
return result;
|
|
1982
|
+
}
|
|
1983
|
+
|
|
1984
|
+
+(NSDictionary*)rfidSessionDataStatusDictionaryFromJson:(NSDictionary*)input {
|
|
1985
|
+
NSMutableDictionary* json = [NSMutableDictionary new];
|
|
1986
|
+
|
|
1987
|
+
json[@"overallStatus"] = [input valueForKey:@"overallStatus"];
|
|
1988
|
+
json[@"AA"] = [input valueForKey:@"aa"];
|
|
1989
|
+
json[@"BAC"] = [input valueForKey:@"bac"];
|
|
1990
|
+
json[@"CA"] = [input valueForKey:@"ca"];
|
|
1991
|
+
json[@"PA"] = [input valueForKey:@"pa"];
|
|
1992
|
+
json[@"PACE"] = [input valueForKey:@"pace"];
|
|
1993
|
+
json[@"TA"] = [input valueForKey:@"ta"];
|
|
1994
|
+
|
|
1995
|
+
return json;
|
|
1996
|
+
}
|
|
1997
|
+
|
|
1998
|
+
+(RGLRFIDSessionDataStatus*)rfidSessionDataStatusFromJson:(NSDictionary*)input {
|
|
1999
|
+
return [RGLRFIDSessionDataStatus performSelector:NSSelectorFromString(@"rfidStatusWithJSON:") withObject:[self rfidSessionDataStatusDictionaryFromJson: input]];
|
|
2000
|
+
}
|
|
2001
|
+
|
|
2002
|
+
+(NSDictionary*)generateRFIDSessionDataStatus:(RGLRFIDSessionDataStatus*)input {
|
|
2003
|
+
if(input == nil) return nil;
|
|
2004
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
2005
|
+
|
|
2006
|
+
result[@"aa"] = @(input.AA);
|
|
2007
|
+
result[@"bac"] = @(input.BAC);
|
|
2008
|
+
result[@"ca"] = @(input.CA);
|
|
2009
|
+
result[@"pa"] = @(input.PA);
|
|
2010
|
+
result[@"pace"] = @(input.PACE);
|
|
2011
|
+
result[@"ta"] = @(input.TA);
|
|
2012
|
+
result[@"overallStatus"] = @(input.overallStatus);
|
|
2013
|
+
|
|
2014
|
+
return result;
|
|
2015
|
+
}
|
|
2016
|
+
|
|
2017
|
+
+(NSDictionary*)vdsncDataDictionaryFromJson:(NSDictionary*)input {
|
|
2018
|
+
NSMutableDictionary* json = [NSMutableDictionary new];
|
|
2019
|
+
|
|
2020
|
+
json[@"Type"] = [input valueForKey:@"type"];
|
|
2021
|
+
json[@"Version"] = [input valueForKey:@"version"];
|
|
2022
|
+
json[@"IssuingCountry"] = [input valueForKey:@"issuingCountry"];
|
|
2023
|
+
json[@"Message"] = [input valueForKey:@"message"];
|
|
2024
|
+
json[@"SignatureAlg"] = [input valueForKey:@"signatureAlgorithm"];
|
|
2025
|
+
json[@"Notifications"] = [input valueForKey:@"notifications"];
|
|
2026
|
+
json[@"Signature"] = [self bytesDataDictionaryFromJson: [input valueForKey:@"signature"]];
|
|
2027
|
+
json[@"Certificate"] = [self bytesDataDictionaryFromJson: [input valueForKey:@"certificate"]];
|
|
2028
|
+
NSMutableArray<NSDictionary*>* array = [NSMutableArray new];
|
|
2029
|
+
for(NSDictionary* item in [input valueForKey:@"certificateChain"]){
|
|
2030
|
+
[array addObject:[self certificateChainDictionaryFromJson:item]];
|
|
2031
|
+
}
|
|
2032
|
+
json[@"CertificateChain"] = array;
|
|
2033
|
+
|
|
2034
|
+
return json;
|
|
2035
|
+
}
|
|
2036
|
+
|
|
2037
|
+
+(RGLVDSNCData*)vdsncDataFromJson:(NSDictionary*)input {
|
|
2038
|
+
return [RGLVDSNCData performSelector:NSSelectorFromString(@"dataWithJSON:") withObject:[self vdsncDataDictionaryFromJson: input]];
|
|
2039
|
+
}
|
|
2040
|
+
|
|
2041
|
+
+(NSDictionary*)generateVDSNCData:(RGLVDSNCData*)input {
|
|
2042
|
+
if(input == nil) return nil;
|
|
2043
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
2044
|
+
|
|
2045
|
+
result[@"type"] = input.type;
|
|
2046
|
+
result[@"version"] = @(input.version);
|
|
2047
|
+
result[@"issuingCountry"] = input.issuingCountry;
|
|
2048
|
+
result[@"message"] = input.message;
|
|
2049
|
+
result[@"signatureAlgorithm"] = input.signatureAlgorithm;
|
|
2050
|
+
result[@"signature"] = [self generateBytesData:input.signature];
|
|
2051
|
+
result[@"certificate"] = [self generateBytesData:input.certificate];
|
|
2052
|
+
if(input.certificateChain != nil){
|
|
2053
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
2054
|
+
for(RGLCertificateChain* item in input.certificateChain)
|
|
2055
|
+
[array addObject:[self generateCertificateChain:item]];
|
|
2056
|
+
result[@"certificateChain"] = array;
|
|
2057
|
+
}
|
|
2058
|
+
if(input.notifications != nil){
|
|
2059
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
2060
|
+
for(NSNumber* item in input.notifications)
|
|
2061
|
+
[array addObject:item];
|
|
2062
|
+
result[@"notifications"] = array;
|
|
2063
|
+
}
|
|
2064
|
+
|
|
2065
|
+
return result;
|
|
2066
|
+
}
|
|
2067
|
+
|
|
2068
|
+
+(NSDictionary*)bytesDataDictionaryFromJson:(NSDictionary*)input {
|
|
2069
|
+
NSMutableDictionary* json = [NSMutableDictionary new];
|
|
2070
|
+
|
|
2071
|
+
json[@"Data"] = [input valueForKey:@"data"];
|
|
2072
|
+
json[@"Length"] = [input valueForKey:@"length"];
|
|
2073
|
+
json[@"Status"] = [input valueForKey:@"status"];
|
|
2074
|
+
json[@"Type"] = [input valueForKey:@"type"];
|
|
2075
|
+
|
|
2076
|
+
return json;
|
|
2077
|
+
}
|
|
2078
|
+
|
|
2079
|
+
+(RGLBytesData*)bytesDataFromJson:(NSDictionary*)input {
|
|
2080
|
+
return [RGLBytesData performSelector:NSSelectorFromString(@"bytesDataWithJSON:") withObject:[self bytesDataDictionaryFromJson: input]];
|
|
2081
|
+
}
|
|
2082
|
+
|
|
2083
|
+
+(NSDictionary*)generateBytesData:(RGLBytesData*)input {
|
|
2084
|
+
if(input == nil) return nil;
|
|
2085
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
2086
|
+
|
|
2087
|
+
result[@"data"] = input.data;
|
|
2088
|
+
result[@"length"] = @(input.length);
|
|
2089
|
+
result[@"status"] = @(input.status);
|
|
2090
|
+
result[@"type"] = @(input.type);
|
|
2091
|
+
|
|
2092
|
+
return result;
|
|
2093
|
+
}
|
|
2094
|
+
|
|
2095
|
+
+(NSString*)generateLicense:(RGLLicense*)input {
|
|
2096
|
+
if(input == nil) return nil;
|
|
2097
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
2098
|
+
|
|
2099
|
+
if(input.expiryDate != nil) {
|
|
2100
|
+
NSDateFormatter *formatter = [NSDateFormatter new];
|
|
2101
|
+
[formatter setFormatterBehavior:NSDateFormatterBehaviorDefault];
|
|
2102
|
+
[formatter setDateStyle:NSDateFormatterShortStyle];
|
|
2103
|
+
[formatter setTimeStyle:NSDateFormatterNoStyle];
|
|
2104
|
+
result[@"expiryDate"] = [formatter stringFromDate:input.expiryDate];
|
|
2105
|
+
} else result[@"expiryDate"] = nil;
|
|
2106
|
+
|
|
2107
|
+
result[@"countryFilter"] = input.countryFilter;
|
|
2108
|
+
result[@"isRfidAvailable"] = input.rfidAvailable ? @YES : @NO;
|
|
2109
|
+
|
|
2110
|
+
return [RGLWJSONConstructor dictToString: result];
|
|
2111
|
+
}
|
|
2112
|
+
|
|
2113
|
+
+(NSString*)generateDocReaderVersion:(RGLDocReaderVersion*)input {
|
|
2114
|
+
if(input == nil) return nil;
|
|
2115
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
2116
|
+
|
|
2117
|
+
result[@"api"] = input.api;
|
|
2118
|
+
result[@"core"] = input.core;
|
|
2119
|
+
result[@"coreMode"] = input.coreMode;
|
|
2120
|
+
result[@"database"] = [self generateDocReaderDocumentsDatabase:input.database];
|
|
2121
|
+
|
|
2122
|
+
return [RGLWJSONConstructor dictToString: result];
|
|
2123
|
+
}
|
|
2124
|
+
|
|
2125
|
+
+(RGLDocReaderDocumentsDatabase*)docReaderDocumentsDatabaseFromJson:(NSDictionary*)input {
|
|
2126
|
+
if(input == nil) return nil;
|
|
2127
|
+
NSMutableDictionary* json = [NSMutableDictionary new];
|
|
2128
|
+
|
|
2129
|
+
json[@"id"] = [input valueForKey:@"databaseID"];
|
|
2130
|
+
json[@"version"] = [input valueForKey:@"version"];
|
|
2131
|
+
json[@"export_date"] = [input valueForKey:@"date"];
|
|
2132
|
+
json[@"description"] = [input valueForKey:@"databaseDescription"];
|
|
2133
|
+
json[@"countriesNumber"] = [input valueForKey:@"countriesNumber"];
|
|
2134
|
+
json[@"documentsNumber"] = [input valueForKey:@"documentsNumber"];
|
|
2135
|
+
json[@"size"] = [input valueForKey:@"size"];
|
|
2136
|
+
|
|
2137
|
+
return [RGLDocReaderDocumentsDatabase initWithJSON:json];
|
|
2138
|
+
}
|
|
2139
|
+
|
|
2140
|
+
+(NSDictionary*)generateDocReaderDocumentsDatabase:(RGLDocReaderDocumentsDatabase*)input {
|
|
2141
|
+
if(input == nil) return nil;
|
|
2142
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
2143
|
+
|
|
2144
|
+
result[@"databaseID"] = input.databaseID;
|
|
2145
|
+
result[@"version"] = input.version;
|
|
2146
|
+
result[@"date"] = input.date;
|
|
2147
|
+
result[@"databaseDescription"] = input.databaseDescription;
|
|
2148
|
+
result[@"countriesNumber"] = @(input.countriesNumber);
|
|
2149
|
+
result[@"documentsNumber"] = @(input.documentsNumber);
|
|
2150
|
+
result[@"size"] = input.size;
|
|
2151
|
+
|
|
2152
|
+
return result;
|
|
2153
|
+
}
|
|
2154
|
+
|
|
2155
|
+
+(NSDictionary*)documentReaderComparisonDictionaryFromJson:(NSDictionary*)input {
|
|
2156
|
+
NSMutableDictionary* json = input.mutableCopy;
|
|
2157
|
+
json[@"sourceLeft"] = @"sourceTypeLeft";
|
|
2158
|
+
json[@"sourceRight"] = @"sourceTypeRight";
|
|
2159
|
+
return json;
|
|
2160
|
+
}
|
|
2161
|
+
|
|
2162
|
+
+(RGLDocumentReaderComparison*)documentReaderComparisonFromJson:(NSDictionary*)input {
|
|
2163
|
+
return [RGLDocumentReaderComparison initWithJSON:[self documentReaderComparisonDictionaryFromJson: input] sourceList:[self documentReaderComparisonDictionaryFromJson: input]];
|
|
2164
|
+
}
|
|
2165
|
+
|
|
2166
|
+
+(NSDictionary*)generateDocumentReaderComparison:(RGLDocumentReaderComparison*)input {
|
|
2167
|
+
if(input == nil) return nil;
|
|
2168
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
2169
|
+
|
|
2170
|
+
result[@"sourceTypeLeft"] = @(input.sourceTypeLeft);
|
|
2171
|
+
result[@"sourceTypeRight"] = @(input.sourceTypeRight);
|
|
2172
|
+
result[@"status"] = @(input.status);
|
|
2173
|
+
|
|
2174
|
+
return result;
|
|
2175
|
+
}
|
|
2176
|
+
|
|
2177
|
+
+(RGLDocumentReaderRfidOrigin*)documentReaderRfidOriginFromJson:(NSDictionary*)input {
|
|
2178
|
+
return [RGLDocumentReaderRfidOrigin initWithJSON:input];
|
|
2179
|
+
}
|
|
2180
|
+
|
|
2181
|
+
+(NSDictionary*)generateDocumentReaderRfidOrigin:(RGLDocumentReaderRfidOrigin*)input {
|
|
2182
|
+
if(input == nil) return nil;
|
|
2183
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
2184
|
+
|
|
2185
|
+
result[@"dg"] = @(input.dg);
|
|
2186
|
+
result[@"dgTag"] = @(input.dgTag);
|
|
2187
|
+
result[@"entryView"] = @(input.entryView);
|
|
2188
|
+
result[@"tagEntry"] = @(input.tagEntry);
|
|
2189
|
+
|
|
2190
|
+
return result;
|
|
2191
|
+
}
|
|
2192
|
+
|
|
2193
|
+
+(NSDictionary*)documentReaderTextSourceDictionaryFromJson:(NSDictionary*)input {
|
|
2194
|
+
NSMutableDictionary* json = input.mutableCopy;
|
|
2195
|
+
json[@"containerType"] = [input valueForKey:@"sourceType"];
|
|
2196
|
+
return json;
|
|
2197
|
+
}
|
|
2198
|
+
|
|
2199
|
+
+(RGLDocumentReaderTextSource*)documentReaderTextSourceFromJson:(NSDictionary*)input {
|
|
2200
|
+
return [RGLDocumentReaderTextSource initWithJSON:[self documentReaderTextSourceDictionaryFromJson: input]];
|
|
2201
|
+
}
|
|
2202
|
+
|
|
2203
|
+
+(NSDictionary*)generateDocumentReaderTextSource:(RGLDocumentReaderTextSource*)input {
|
|
2204
|
+
if(input == nil) return nil;
|
|
2205
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
2206
|
+
|
|
2207
|
+
result[@"sourceType"] = @(input.sourceType);
|
|
2208
|
+
result[@"source"] = input.source;
|
|
2209
|
+
result[@"validityStatus"] = @(input.validityStatus);
|
|
2210
|
+
|
|
2211
|
+
return result;
|
|
2212
|
+
}
|
|
2213
|
+
|
|
2214
|
+
+(RGLDocumentReaderSymbol*)documentReaderSymbolFromJson:(NSDictionary*)input {
|
|
2215
|
+
return [RGLDocumentReaderSymbol initWithJSON:input];
|
|
2216
|
+
}
|
|
2217
|
+
|
|
2218
|
+
+(NSDictionary*)generateDocumentReaderSymbol:(RGLDocumentReaderSymbol*)input {
|
|
2219
|
+
if(input == nil) return nil;
|
|
2220
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
2221
|
+
|
|
2222
|
+
result[@"code"] = @(input.code);
|
|
2223
|
+
result[@"rect"] = [self generateRect:input.rect];
|
|
2224
|
+
result[@"probability"] = @(input.probability);
|
|
2225
|
+
|
|
2226
|
+
return result;
|
|
2227
|
+
}
|
|
2228
|
+
|
|
2229
|
+
+(NSDictionary*)documentReaderValidityDictionaryFromJson:(NSDictionary*)input {
|
|
2230
|
+
NSMutableDictionary* json = input.mutableCopy;
|
|
2231
|
+
json[@"source"] = @"sourceType";
|
|
2232
|
+
return json;
|
|
2233
|
+
}
|
|
2234
|
+
|
|
2235
|
+
+(RGLDocumentReaderValidity*)documentReaderValidityFromJson:(NSDictionary*)input {
|
|
2236
|
+
return [RGLDocumentReaderValidity initWithJSON:[self documentReaderValidityDictionaryFromJson:input] sourceList:[self documentReaderValidityDictionaryFromJson:input]];
|
|
2237
|
+
}
|
|
2238
|
+
|
|
2239
|
+
+(NSDictionary*)generateDocumentReaderValidity:(RGLDocumentReaderValidity*)input {
|
|
2240
|
+
if(input == nil) return nil;
|
|
2241
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
2242
|
+
|
|
2243
|
+
result[@"sourceType"] = @(input.sourceType);
|
|
2244
|
+
result[@"status"] = @(input.status);
|
|
2245
|
+
|
|
2246
|
+
return result;
|
|
2247
|
+
}
|
|
2248
|
+
|
|
2249
|
+
+(RGLDocumentReaderResults*)documentReaderResultsFromJson:(NSDictionary*)input {
|
|
2250
|
+
NSMutableArray<RGLDocumentReaderDocumentType*>* documentType = [NSMutableArray new];
|
|
2251
|
+
for(NSDictionary* item in [input valueForKey:@"documentType"]){
|
|
2252
|
+
[documentType addObject:[self documentReaderDocumentTypeFromJson:item]];
|
|
2253
|
+
}
|
|
2254
|
+
NSMutableArray<RGLDocumentPosition*>* documentPosition = [NSMutableArray new];
|
|
2255
|
+
for(NSDictionary* item in [input valueForKey:@"documentPosition"]){
|
|
2256
|
+
[documentPosition addObject:(RGLDocumentPosition*)[self positionFromJson:item]];
|
|
2257
|
+
}
|
|
2258
|
+
NSMutableArray<RGLBarcodePosition*>* barcodePosition = [NSMutableArray new];
|
|
2259
|
+
for(NSDictionary* item in [input valueForKey:@"barcodePosition"]){
|
|
2260
|
+
[barcodePosition addObject:(RGLBarcodePosition*)[self positionFromJson:item]];
|
|
2261
|
+
}
|
|
2262
|
+
NSMutableArray<RGLMrzPosition*>* mrzPosition = [NSMutableArray new];
|
|
2263
|
+
for(NSDictionary* item in [input valueForKey:@"mrzPosition"]){
|
|
2264
|
+
[mrzPosition addObject:(RGLMrzPosition*)[self positionFromJson:item]];
|
|
2265
|
+
}
|
|
2266
|
+
NSMutableArray<RGLImageQualityGroup*>* imageQuality = [NSMutableArray new];
|
|
2267
|
+
for(NSDictionary* item in [input valueForKey:@"imageQuality"]){
|
|
2268
|
+
[imageQuality addObject:[self imageQualityGroupFromJson:item]];
|
|
2269
|
+
}
|
|
2270
|
+
|
|
2271
|
+
RGLDocumentReaderResults* result = [[RGLDocumentReaderResults alloc]
|
|
2272
|
+
initWithDocumentTypes:documentType
|
|
2273
|
+
textResult:[self documentReaderTextResultFromJson: [input valueForKey:@"textResult"]]
|
|
2274
|
+
graphicResult:[self documentReaderGraphicResultFromJson: [input valueForKey:@"graphicResult"]]
|
|
2275
|
+
rawResult:[input valueForKey:@"rawResult"]
|
|
2276
|
+
documentPosition:documentPosition
|
|
2277
|
+
barcodePosition:barcodePosition
|
|
2278
|
+
mrzPosition:mrzPosition
|
|
2279
|
+
imageQualityGroup:imageQuality
|
|
2280
|
+
authenticityResults:[self documentReaderAuthenticityResultFromJson: [input valueForKey:@"authenticityResult"]]
|
|
2281
|
+
rfidSessionData:[self rfidSessionDataFromJson: [input valueForKey:@"rfidSessionData"]]
|
|
2282
|
+
chipPage:[[input valueForKey:@"chipPage"] integerValue]
|
|
2283
|
+
barcodeResult:[self documentReaderBarcodeResultFromJson: [input valueForKey:@"barcodeResult"]]
|
|
2284
|
+
vdsncData:[self vdsncDataFromJson: [input valueForKey:@"vdsncData"]]
|
|
2285
|
+
status:[self documentReaderResultsStatusFromJson: [input valueForKey:@"status"]]
|
|
2286
|
+
processingFinished:[[input valueForKey:@"processingFinishedStatus"] integerValue]
|
|
2287
|
+
morePagesAvailable:[[input valueForKey:@"morePagesAvailable"] integerValue]
|
|
2288
|
+
elapsedTime:[[input valueForKey:@"elapsedTime"] integerValue]
|
|
2289
|
+
elapsedTimeRFID:[[input valueForKey:@"elapsedTimeRFID"] integerValue]
|
|
2290
|
+
transactionInfo:[self transactionInfoFromJson:[input valueForKey:@"transactionInfo"]]];
|
|
2291
|
+
|
|
2292
|
+
[result setValue:[RGLWJSONConstructor base64Decode:input[@"dtcData"]] forKey:@"dtcData"];
|
|
2293
|
+
|
|
2294
|
+
return result;
|
|
2295
|
+
}
|
|
2296
|
+
|
|
2297
|
+
+(NSDictionary*)generateDocumentReaderResults:(RGLDocumentReaderResults*)input {
|
|
2298
|
+
if(input == nil) return nil;
|
|
2299
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
2300
|
+
|
|
2301
|
+
if(input.documentType != nil){
|
|
2302
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
2303
|
+
for(RGLDocumentReaderDocumentType* item in input.documentType)
|
|
2304
|
+
[array addObject:[self generateDocumentReaderDocumentType:item]];
|
|
2305
|
+
result[@"documentType"] = array;
|
|
2306
|
+
}
|
|
2307
|
+
result[@"textResult"] = [self generateDocumentReaderTextResult:input.textResult];
|
|
2308
|
+
result[@"graphicResult"] = [self generateDocumentReaderGraphicResult:input.graphicResult];
|
|
2309
|
+
if(input.documentPosition != nil){
|
|
2310
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
2311
|
+
for(RGLPosition* item in input.documentPosition)
|
|
2312
|
+
[array addObject:[self generatePosition:item]];
|
|
2313
|
+
result[@"documentPosition"] = array;
|
|
2314
|
+
}
|
|
2315
|
+
if(input.barcodePosition != nil){
|
|
2316
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
2317
|
+
for(RGLPosition* item in input.barcodePosition)
|
|
2318
|
+
[array addObject:[self generatePosition:item]];
|
|
2319
|
+
result[@"barcodePosition"] = array;
|
|
2320
|
+
}
|
|
2321
|
+
if(input.mrzPosition != nil){
|
|
2322
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
2323
|
+
for(RGLPosition* item in input.mrzPosition)
|
|
2324
|
+
[array addObject:[self generatePosition:item]];
|
|
2325
|
+
result[@"mrzPosition"] = array;
|
|
2326
|
+
}
|
|
2327
|
+
if(input.imageQualityGroup != nil){
|
|
2328
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
2329
|
+
for(RGLImageQualityGroup* item in input.imageQualityGroup)
|
|
2330
|
+
[array addObject:[self generateImageQualityGroup:item]];
|
|
2331
|
+
result[@"imageQuality"] = array;
|
|
2332
|
+
}
|
|
2333
|
+
result[@"authenticityResult"] = [self generateDocumentReaderAuthenticityResult:input.authenticityResults];
|
|
2334
|
+
result[@"rfidSessionData"] = [self generateRFIDSessionData:input.rfidSessionData];
|
|
2335
|
+
result[@"chipPage"] = @(input.chipPage);
|
|
2336
|
+
result[@"barcodeResult"] = [self generateDocumentReaderBarcodeResult:input.barcodeResult];
|
|
2337
|
+
result[@"processingFinishedStatus"] = @(input.processingFinishedStatus);
|
|
2338
|
+
result[@"morePagesAvailable"] = @(input.morePagesAvailable);
|
|
2339
|
+
result[@"elapsedTime"] = @(input.elapsedTime);
|
|
2340
|
+
result[@"elapsedTimeRFID"] = @(input.elapsedTimeRFID);
|
|
2341
|
+
result[@"rawResult"] = input.rawResult;
|
|
2342
|
+
result[@"status"] = [self generateDocumentReaderResultsStatus:input.status];
|
|
2343
|
+
result[@"vdsncData"] = [self generateVDSNCData:input.vdsncData];
|
|
2344
|
+
result[@"dtcData"] = [self base64Encode: input.dtcData];
|
|
2345
|
+
result[@"transactionInfo"] = [self generateTransactionInfo:input.transactionInfo];
|
|
2346
|
+
|
|
2347
|
+
return result;
|
|
2348
|
+
}
|
|
2349
|
+
|
|
2350
|
+
+(NSDictionary*)generateDictionary:(NSDictionary<NSNumber*, NSNumber*>*)input {
|
|
2351
|
+
if(input == nil) return nil;
|
|
2352
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
2353
|
+
|
|
2354
|
+
for(NSNumber* key in input)
|
|
2355
|
+
result[[key stringValue]] = input[key];
|
|
2356
|
+
|
|
2357
|
+
return result;
|
|
2358
|
+
}
|
|
2359
|
+
|
|
2360
|
+
@end
|
|
2361
|
+
|
|
2362
|
+
@implementation RGLWRequestInterceptorProxy {
|
|
2363
|
+
NSDictionary* _headers;
|
|
2364
|
+
}
|
|
2365
|
+
|
|
2366
|
+
- (instancetype)initWithHeaders:(NSDictionary*)headers {
|
|
2367
|
+
self = [super init];
|
|
2368
|
+
_headers = [headers copy];
|
|
2369
|
+
return self;
|
|
2370
|
+
}
|
|
2371
|
+
|
|
2372
|
+
-(NSURLRequest*)interceptorPrepareRequest:(NSURLRequest*)request {
|
|
2373
|
+
NSMutableURLRequest *interceptedRequest = [request mutableCopy];
|
|
2374
|
+
for (NSString* key in _headers.allKeys)
|
|
2375
|
+
[interceptedRequest addValue:[_headers valueForKey:key] forHTTPHeaderField:key];
|
|
2376
|
+
return interceptedRequest;
|
|
2377
|
+
}
|
|
2378
|
+
|
|
2379
|
+
@end
|