@regulaforensics/face-sdk 6.3.3-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 +23 -0
- package/RNFaceSDK.podspec +21 -0
- package/android/CVDFaceSDK.kt +34 -0
- package/android/build.gradle +48 -0
- package/android/cordova.gradle +18 -0
- package/android/src/main/AndroidManifest.xml +1 -0
- package/android/src/main/java/com/regula/plugin/facesdk/Config.kt +165 -0
- package/android/src/main/java/com/regula/plugin/facesdk/JSONConstructor.kt +904 -0
- package/android/src/main/java/com/regula/plugin/facesdk/Main.kt +370 -0
- package/android/src/main/java/com/regula/plugin/facesdk/RNFaceApiModule.kt +54 -0
- package/android/src/main/java/com/regula/plugin/facesdk/RNFaceApiPackage.kt +11 -0
- package/android/src/main/java/com/regula/plugin/facesdk/Utils.kt +287 -0
- package/examples/capacitor/.browserslistrc +6 -0
- package/examples/capacitor/.eslintrc.js +17 -0
- package/examples/capacitor/README.md +27 -0
- package/examples/capacitor/android/app/build.gradle +54 -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/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java +26 -0
- package/examples/capacitor/android/app/src/main/AndroidManifest.xml +43 -0
- package/examples/capacitor/android/app/src/main/java/com/regula/faceapi/MainActivity.java +5 -0
- package/examples/capacitor/android/app/src/main/res/drawable/ic_launcher_background.xml +170 -0
- package/examples/capacitor/android/app/src/main/res/drawable/splash.png +0 -0
- package/examples/capacitor/android/app/src/main/res/drawable-land-hdpi/splash.png +0 -0
- package/examples/capacitor/android/app/src/main/res/drawable-land-mdpi/splash.png +0 -0
- package/examples/capacitor/android/app/src/main/res/drawable-land-xhdpi/splash.png +0 -0
- package/examples/capacitor/android/app/src/main/res/drawable-land-xxhdpi/splash.png +0 -0
- package/examples/capacitor/android/app/src/main/res/drawable-land-xxxhdpi/splash.png +0 -0
- package/examples/capacitor/android/app/src/main/res/drawable-port-hdpi/splash.png +0 -0
- package/examples/capacitor/android/app/src/main/res/drawable-port-mdpi/splash.png +0 -0
- package/examples/capacitor/android/app/src/main/res/drawable-port-xhdpi/splash.png +0 -0
- package/examples/capacitor/android/app/src/main/res/drawable-port-xxhdpi/splash.png +0 -0
- package/examples/capacitor/android/app/src/main/res/drawable-port-xxxhdpi/splash.png +0 -0
- package/examples/capacitor/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml +34 -0
- package/examples/capacitor/android/app/src/main/res/layout/activity_main.xml +12 -0
- package/examples/capacitor/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +5 -0
- package/examples/capacitor/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +5 -0
- package/examples/capacitor/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/examples/capacitor/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png +0 -0
- package/examples/capacitor/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/examples/capacitor/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/examples/capacitor/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png +0 -0
- package/examples/capacitor/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/examples/capacitor/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/examples/capacitor/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png +0 -0
- package/examples/capacitor/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/examples/capacitor/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/examples/capacitor/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png +0 -0
- package/examples/capacitor/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/examples/capacitor/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/examples/capacitor/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png +0 -0
- package/examples/capacitor/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/examples/capacitor/android/app/src/main/res/values/ic_launcher_background.xml +4 -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/app/src/main/res/xml/file_paths.xml +5 -0
- package/examples/capacitor/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java +18 -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 +6 -0
- package/examples/capacitor/android/gradle.properties +22 -0
- package/examples/capacitor/android/gradlew +244 -0
- package/examples/capacitor/android/gradlew.bat +92 -0
- package/examples/capacitor/android/settings.gradle +5 -0
- package/examples/capacitor/android/variables.gradle +16 -0
- package/examples/capacitor/capacitor.config.ts +12 -0
- package/examples/capacitor/cypress/e2e/test.cy.ts +6 -0
- package/examples/capacitor/cypress/fixtures/example.json +5 -0
- package/examples/capacitor/cypress/support/commands.ts +37 -0
- package/examples/capacitor/cypress/support/e2e.ts +20 -0
- package/examples/capacitor/cypress.config.ts +10 -0
- package/examples/capacitor/index.html +106 -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 +410 -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 +27 -0
- package/examples/capacitor/package.json +64 -0
- package/examples/capacitor/public/assets/.gitkeep +0 -0
- package/examples/capacitor/public/assets/img/id.png +0 -0
- package/examples/capacitor/public/assets/img/portrait.png +0 -0
- package/examples/capacitor/public/favicon.png +0 -0
- package/examples/capacitor/public/manifest.json +21 -0
- package/examples/capacitor/src/App.test.tsx +8 -0
- package/examples/capacitor/src/App.tsx +42 -0
- package/examples/capacitor/src/components/ExploreContainer.css +24 -0
- package/examples/capacitor/src/components/ExploreContainer.tsx +14 -0
- package/examples/capacitor/src/main.tsx +11 -0
- package/examples/capacitor/src/pages/Home.tsx +159 -0
- package/examples/capacitor/src/setupTests.ts +14 -0
- package/examples/capacitor/src/theme/variables.css +242 -0
- package/examples/capacitor/src/vite-env.d.ts +1 -0
- package/examples/capacitor/tsconfig.json +21 -0
- package/examples/capacitor/tsconfig.node.json +9 -0
- package/examples/capacitor/vite.config.ts +16 -0
- package/examples/cordova/.vscode/launch.json +28 -0
- package/examples/cordova/config.xml +37 -0
- package/examples/cordova/jsconfig.json +1 -0
- package/examples/cordova/package.json +40 -0
- package/examples/cordova/www/css/index.css +107 -0
- package/examples/cordova/www/img/id.png +0 -0
- package/examples/cordova/www/img/logo.png +0 -0
- package/examples/cordova/www/img/portrait.png +0 -0
- package/examples/cordova/www/index.html +94 -0
- package/examples/cordova/www/js/index.js +154 -0
- package/examples/ionic/angular.json +187 -0
- package/examples/ionic/browserslist +12 -0
- package/examples/ionic/config.xml +114 -0
- package/examples/ionic/e2e/protractor.conf.js +28 -0
- package/examples/ionic/e2e/src/app.e2e-spec.ts +14 -0
- package/examples/ionic/e2e/src/app.po.ts +11 -0
- package/examples/ionic/e2e/tsconfig.json +13 -0
- package/examples/ionic/ionic.config.json +7 -0
- package/examples/ionic/karma.conf.js +31 -0
- package/examples/ionic/package.json +97 -0
- package/examples/ionic/resources/README.md +8 -0
- package/examples/ionic/resources/android/icon/drawable-hdpi-icon.png +0 -0
- package/examples/ionic/resources/android/icon/drawable-ldpi-icon.png +0 -0
- package/examples/ionic/resources/android/icon/drawable-mdpi-icon.png +0 -0
- package/examples/ionic/resources/android/icon/drawable-xhdpi-icon.png +0 -0
- package/examples/ionic/resources/android/icon/drawable-xxhdpi-icon.png +0 -0
- package/examples/ionic/resources/android/icon/drawable-xxxhdpi-icon.png +0 -0
- package/examples/ionic/resources/android/splash/drawable-land-hdpi-screen.png +0 -0
- package/examples/ionic/resources/android/splash/drawable-land-ldpi-screen.png +0 -0
- package/examples/ionic/resources/android/splash/drawable-land-mdpi-screen.png +0 -0
- package/examples/ionic/resources/android/splash/drawable-land-xhdpi-screen.png +0 -0
- package/examples/ionic/resources/android/splash/drawable-land-xxhdpi-screen.png +0 -0
- package/examples/ionic/resources/android/splash/drawable-land-xxxhdpi-screen.png +0 -0
- package/examples/ionic/resources/android/splash/drawable-port-hdpi-screen.png +0 -0
- package/examples/ionic/resources/android/splash/drawable-port-ldpi-screen.png +0 -0
- package/examples/ionic/resources/android/splash/drawable-port-mdpi-screen.png +0 -0
- package/examples/ionic/resources/android/splash/drawable-port-xhdpi-screen.png +0 -0
- package/examples/ionic/resources/android/splash/drawable-port-xxhdpi-screen.png +0 -0
- package/examples/ionic/resources/android/splash/drawable-port-xxxhdpi-screen.png +0 -0
- package/examples/ionic/resources/android/xml/network_security_config.xml +6 -0
- package/examples/ionic/resources/icon.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-1024.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-20.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-20@2x.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-20@3x.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-24@2x.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-27.5@2x.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-29.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-29@2x.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-29@3x.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-40.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-40@2x.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-40@3x.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-44@2x.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-50.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-50@2x.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-60.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-60@2x.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-60@3x.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-72.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-72@2x.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-76.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-76@2x.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-83.5@2x.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-86@2x.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-98@2x.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-small.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-small@2x.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-small@3x.png +0 -0
- package/examples/ionic/resources/ios/icon/icon.png +0 -0
- package/examples/ionic/resources/ios/icon/icon@2x.png +0 -0
- package/examples/ionic/resources/ios/splash/Default-2436h.png +0 -0
- package/examples/ionic/resources/ios/splash/Default-568h@2x~iphone.png +0 -0
- package/examples/ionic/resources/ios/splash/Default-667h.png +0 -0
- package/examples/ionic/resources/ios/splash/Default-736h.png +0 -0
- package/examples/ionic/resources/ios/splash/Default-Landscape-2436h.png +0 -0
- package/examples/ionic/resources/ios/splash/Default-Landscape-736h.png +0 -0
- package/examples/ionic/resources/ios/splash/Default-Landscape@2x~ipad.png +0 -0
- package/examples/ionic/resources/ios/splash/Default-Landscape@~ipadpro.png +0 -0
- package/examples/ionic/resources/ios/splash/Default-Landscape~ipad.png +0 -0
- package/examples/ionic/resources/ios/splash/Default-Portrait@2x~ipad.png +0 -0
- package/examples/ionic/resources/ios/splash/Default-Portrait@~ipadpro.png +0 -0
- package/examples/ionic/resources/ios/splash/Default-Portrait~ipad.png +0 -0
- package/examples/ionic/resources/ios/splash/Default@2x~iphone.png +0 -0
- package/examples/ionic/resources/ios/splash/Default@2x~universal~anyany.png +0 -0
- package/examples/ionic/resources/ios/splash/Default~iphone.png +0 -0
- package/examples/ionic/resources/splash.png +0 -0
- package/examples/ionic/src/app/app-routing.module.ts +15 -0
- package/examples/ionic/src/app/app.component.html +3 -0
- package/examples/ionic/src/app/app.component.scss +0 -0
- package/examples/ionic/src/app/app.component.spec.ts +47 -0
- package/examples/ionic/src/app/app.component.ts +27 -0
- package/examples/ionic/src/app/app.module.ts +23 -0
- package/examples/ionic/src/app/home/home.module.ts +29 -0
- package/examples/ionic/src/app/home/home.page.html +75 -0
- package/examples/ionic/src/app/home/home.page.scss +1 -0
- package/examples/ionic/src/app/home/home.page.spec.ts +24 -0
- package/examples/ionic/src/app/home/home.page.ts +166 -0
- package/examples/ionic/src/assets/icon/favicon.png +0 -0
- package/examples/ionic/src/assets/img/portrait.png +0 -0
- package/examples/ionic/src/assets/shapes.svg +1 -0
- package/examples/ionic/src/environments/environment.prod.ts +3 -0
- package/examples/ionic/src/environments/environment.ts +16 -0
- package/examples/ionic/src/global.scss +31 -0
- package/examples/ionic/src/index.html +25 -0
- package/examples/ionic/src/main.ts +12 -0
- package/examples/ionic/src/polyfills.ts +66 -0
- package/examples/ionic/src/test.ts +20 -0
- package/examples/ionic/src/theme/variables.scss +77 -0
- package/examples/ionic/src/zone-flags.ts +5 -0
- package/examples/ionic/tsconfig.app.json +14 -0
- package/examples/ionic/tsconfig.json +26 -0
- package/examples/ionic/tsconfig.spec.json +19 -0
- package/examples/ionic/tslint.json +88 -0
- package/examples/react-native/.vscode/launch.json +26 -0
- package/examples/react-native/.watchmanconfig +1 -0
- package/examples/react-native/App.tsx +206 -0
- package/examples/react-native/Gemfile +8 -0
- package/examples/react-native/Gemfile.lock +134 -0
- package/examples/react-native/android/app/build.gradle +123 -0
- package/examples/react-native/android/app/debug.keystore +0 -0
- package/examples/react-native/android/app/proguard-rules.pro +10 -0
- package/examples/react-native/android/app/src/debug/AndroidManifest.xml +9 -0
- package/examples/react-native/android/app/src/main/AndroidManifest.xml +27 -0
- package/examples/react-native/android/app/src/main/assets/.gitkeep +0 -0
- package/examples/react-native/android/app/src/main/java/com/regula/face/api/MainActivity.kt +22 -0
- package/examples/react-native/android/app/src/main/java/com/regula/face/api/MainApplication.kt +43 -0
- package/examples/react-native/android/app/src/main/res/drawable/rn_edit_text_material.xml +37 -0
- package/examples/react-native/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/examples/react-native/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/examples/react-native/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/examples/react-native/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/examples/react-native/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/examples/react-native/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/examples/react-native/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/examples/react-native/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/examples/react-native/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/examples/react-native/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/examples/react-native/android/app/src/main/res/values/strings.xml +3 -0
- package/examples/react-native/android/app/src/main/res/values/styles.xml +9 -0
- package/examples/react-native/android/build.gradle +21 -0
- package/examples/react-native/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/examples/react-native/android/gradle/wrapper/gradle-wrapper.properties +7 -0
- package/examples/react-native/android/gradle.properties +39 -0
- package/examples/react-native/android/gradlew +249 -0
- package/examples/react-native/android/gradlew.bat +92 -0
- package/examples/react-native/android/settings.gradle +6 -0
- package/examples/react-native/images/portrait.png +0 -0
- package/examples/react-native/index.js +4 -0
- package/examples/react-native/ios/.xcode.env +11 -0
- package/examples/react-native/ios/FaceSDK/AppDelegate.h +6 -0
- package/examples/react-native/ios/FaceSDK/AppDelegate.mm +31 -0
- package/examples/react-native/ios/FaceSDK/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
- package/examples/react-native/ios/FaceSDK/Images.xcassets/Contents.json +6 -0
- package/examples/react-native/ios/FaceSDK/Info.plist +51 -0
- package/examples/react-native/ios/FaceSDK/LaunchScreen.storyboard +47 -0
- package/examples/react-native/ios/FaceSDK/PrivacyInfo.xcprivacy +38 -0
- package/examples/react-native/ios/FaceSDK/main.m +10 -0
- package/examples/react-native/ios/FaceSDK.xcodeproj/project.pbxproj +719 -0
- package/examples/react-native/ios/FaceSDK.xcodeproj/xcshareddata/xcschemes/FaceSDK.xcscheme +88 -0
- package/examples/react-native/ios/FaceSDK.xcworkspace/contents.xcworkspacedata +10 -0
- package/examples/react-native/ios/FaceSDK.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/examples/react-native/ios/FaceSDKTests/FaceSDKTests.m +66 -0
- package/examples/react-native/ios/FaceSDKTests/Info.plist +24 -0
- package/examples/react-native/ios/Podfile +40 -0
- package/examples/react-native/ios/Podfile.lock +1822 -0
- package/examples/react-native/ios/license/.gitkeep +0 -0
- package/examples/react-native/metro.config.js +15 -0
- package/examples/react-native/package-lock.json +13098 -0
- package/examples/react-native/package.json +42 -0
- package/ios/CVDFaceSDK.h +7 -0
- package/ios/CVDFaceSDK.m +34 -0
- package/ios/RFSWConfig.h +27 -0
- package/ios/RFSWConfig.m +189 -0
- package/ios/RFSWJSONConstructor.h +134 -0
- package/ios/RFSWJSONConstructor.m +977 -0
- package/ios/RFSWMain.h +23 -0
- package/ios/RFSWMain.m +352 -0
- package/ios/RNFaceSDK.h +8 -0
- package/ios/RNFaceSDK.m +42 -0
- package/ios-ci/.gitlab-ci.yml +41 -0
- package/ios-ci/.sample-env +22 -0
- package/ios-ci/README.md +97 -0
- package/ios-ci/RegulaDanger/Package.swift +34 -0
- package/ios-ci/RegulaDanger/Sources/RegulaDanger/RegulaDanger.swift +44 -0
- package/ios-ci/RegulaDanger/Tests/LinuxMain.swift +7 -0
- package/ios-ci/RegulaDanger/Tests/RegulaDangerTests/RegulaDangerTests.swift +15 -0
- package/ios-ci/RegulaDanger/Tests/RegulaDangerTests/XCTestManifests.swift +9 -0
- package/ios-ci/install.sh +9 -0
- package/ios-ci/ios_ci/__init__.py +8 -0
- package/ios-ci/ios_ci/cli.py +408 -0
- package/ios-ci/ios_ci/common/__init__.py +0 -0
- package/ios-ci/ios_ci/common/build_index.py +70 -0
- package/ios-ci/ios_ci/common/clean_cocoapod.sh +13 -0
- package/ios-ci/ios_ci/common/dependency.py +466 -0
- package/ios-ci/ios_ci/common/ftp.py +314 -0
- package/ios-ci/ios_ci/common/searchpod.sh +6 -0
- package/ios-ci/ios_ci/common/wait_for_cocopod.sh +21 -0
- package/ios-ci/ios_ci/inject.py +145 -0
- package/ios-ci/ios_ci/podspec/__init__.py +0 -0
- package/ios-ci/ios_ci/podspec/podspec.py +88 -0
- package/ios-ci/ios_ci/podspec/templates/BTDevice.podspec +17 -0
- package/ios-ci/ios_ci/podspec/templates/Core.podspec +17 -0
- package/ios-ci/ios_ci/podspec/templates/DocumentReader.podspec +19 -0
- package/ios-ci/ios_ci/podspec/templates/FaceCore.podspec +17 -0
- package/ios-ci/ios_ci/podspec/templates/FaceSDK.podspec +18 -0
- package/ios-ci/ios_ci/podspec/templates/IRS.podspec +17 -0
- package/ios-ci/ios_ci/podspec/templates/RegulaCommon.podspec +17 -0
- package/ios-ci/ios_ci/resolve_podfile_common.py +76 -0
- package/ios-ci/ios_ci/spm/AppleRootCA-G3.cer +0 -0
- package/ios-ci/ios_ci/spm/AppleWWDRCAG3.cer +0 -0
- package/ios-ci/ios_ci/spm/SwiftPackageGenerator+Common.sh +48 -0
- package/ios-ci/ios_ci/spm/SwiftPackageGenerator.sh +33 -0
- package/ios-ci/ios_ci/spm/XcodeSPMCollection.json +29 -0
- package/ios-ci/ios_ci/spm/__init__.py +0 -0
- package/ios-ci/ios_ci/spm/askpass.py +19 -0
- package/ios-ci/ios_ci/spm/spm.py +227 -0
- package/ios-ci/ios_ci/upload_build.py +158 -0
- package/ios-ci/ios_ci/version.py +14 -0
- package/ios-ci/poetry.lock +342 -0
- package/ios-ci/pyproject.toml +26 -0
- package/ios-ci/scripts.py +9 -0
- package/ios-ci/tests/__init__.py +0 -0
- package/ios-ci/tests/podspec/fixtures/BTDevice.podspec +17 -0
- package/ios-ci/tests/podspec/fixtures/BTDeviceBeta.podspec +17 -0
- package/ios-ci/tests/podspec/fixtures/DocumentReaderBeta_RegulaCommon_Beta.podspec +19 -0
- package/ios-ci/tests/podspec/fixtures/DocumentReaderBeta_RegulaCommon_Release.podspec +19 -0
- package/ios-ci/tests/podspec/fixtures/DocumentReaderFullRFID.podspec +17 -0
- package/ios-ci/tests/podspec/fixtures/DocumentReaderFullRFIDBeta.podspec +17 -0
- package/ios-ci/tests/podspec/fixtures/DocumentReader_RegulaCommon_Beta.podspec +19 -0
- package/ios-ci/tests/podspec/fixtures/DocumentReader_RegulaCommon_Release.podspec +19 -0
- package/ios-ci/tests/podspec/fixtures/FaceSDK.podspec +18 -0
- package/ios-ci/tests/podspec/fixtures/FaceSDKBeta.podspec +18 -0
- package/ios-ci/tests/podspec/fixtures/IRS.podspec +17 -0
- package/ios-ci/tests/podspec/fixtures/IRSBeta.podspec +17 -0
- package/ios-ci/tests/podspec/fixtures/RegulaCommon.podspec +17 -0
- package/ios-ci/tests/podspec/fixtures/RegulaCommonBeta.podspec +17 -0
- package/ios-ci/tests/podspec/test_podspec.py +188 -0
- package/ios-ci/tests/test_build_index.py +117 -0
- package/ios-ci/tests/test_dependency.py +139 -0
- package/ios-ci/tests/test_ios_ci.py +5 -0
- package/package.json +36 -0
- package/plugin.xml +48 -0
- package/www/capacitor/customization/camera_position.js +4 -0
- package/www/capacitor/customization/customization.js +66 -0
- package/www/capacitor/customization/customization_colors.js +233 -0
- package/www/capacitor/customization/customization_fonts.js +106 -0
- package/www/capacitor/customization/customization_images.js +129 -0
- package/www/capacitor/customization/font.js +23 -0
- package/www/capacitor/customization/screen_orientation.js +4 -0
- package/www/capacitor/detect_faces/detect_face_result.js +38 -0
- package/www/capacitor/detect_faces/detect_faces_attribute.js +15 -0
- package/www/capacitor/detect_faces/detect_faces_attribute_result.js +20 -0
- package/www/capacitor/detect_faces/detect_faces_backend_exception.js +23 -0
- package/www/capacitor/detect_faces/detect_faces_config.js +14 -0
- package/www/capacitor/detect_faces/detect_faces_exception.js +30 -0
- package/www/capacitor/detect_faces/detect_faces_request.js +67 -0
- package/www/capacitor/detect_faces/detect_faces_response.js +24 -0
- package/www/capacitor/detect_faces/detect_faces_scenario.js +10 -0
- package/www/capacitor/face_capture/face_capture_config.js +28 -0
- package/www/capacitor/face_capture/face_capture_exception.js +25 -0
- package/www/capacitor/face_capture/face_capture_image.js +26 -0
- package/www/capacitor/face_capture/face_capture_response.js +17 -0
- package/www/capacitor/image_params/output_image_crop.js +21 -0
- package/www/capacitor/image_params/output_image_params.js +9 -0
- package/www/capacitor/image_params/point.js +14 -0
- package/www/capacitor/image_params/rect.js +18 -0
- package/www/capacitor/image_params/size.js +9 -0
- package/www/capacitor/image_quality/image_quality_characteristic.js +24 -0
- package/www/capacitor/image_quality/image_quality_characteristic_name.js +58 -0
- package/www/capacitor/image_quality/image_quality_group.js +332 -0
- package/www/capacitor/image_quality/image_quality_range.js +26 -0
- package/www/capacitor/image_quality/image_quality_result.js +40 -0
- package/www/capacitor/index.js +219 -0
- package/www/capacitor/init/face_sdk_version.js +16 -0
- package/www/capacitor/init/init_config.js +9 -0
- package/www/capacitor/init/init_exception.js +29 -0
- package/www/capacitor/init/license_exception.js +29 -0
- package/www/capacitor/internal/bridge.js +39 -0
- package/www/capacitor/internal/cordova.js +17 -0
- package/www/capacitor/internal/webpack.config.js +11 -0
- package/www/capacitor/liveness/liveness_backend_exception.js +38 -0
- package/www/capacitor/liveness/liveness_config.js +54 -0
- package/www/capacitor/liveness/liveness_exception.js +35 -0
- package/www/capacitor/liveness/liveness_notification.js +34 -0
- package/www/capacitor/liveness/liveness_response.js +30 -0
- package/www/capacitor/match_faces/compared_face.js +21 -0
- package/www/capacitor/match_faces/compared_faces_pair.js +23 -0
- package/www/capacitor/match_faces/compared_faces_split.js +22 -0
- package/www/capacitor/match_faces/match_faces_backend_exception.js +14 -0
- package/www/capacitor/match_faces/match_faces_config.js +12 -0
- package/www/capacitor/match_faces/match_faces_detection.js +25 -0
- package/www/capacitor/match_faces/match_faces_detection_face.js +28 -0
- package/www/capacitor/match_faces/match_faces_exception.js +30 -0
- package/www/capacitor/match_faces/match_faces_image.js +25 -0
- package/www/capacitor/match_faces/match_faces_request.js +13 -0
- package/www/capacitor/match_faces/match_faces_response.js +28 -0
- package/www/capacitor/person_database/edit_group_persons_request.js +9 -0
- package/www/capacitor/person_database/image_upload.js +16 -0
- package/www/capacitor/person_database/pageable_item_list.js +22 -0
- package/www/capacitor/person_database/person.js +22 -0
- package/www/capacitor/person_database/person_database.js +145 -0
- package/www/capacitor/person_database/person_group.js +18 -0
- package/www/capacitor/person_database/person_image.js +22 -0
- package/www/capacitor/person_database/search_person.js +31 -0
- package/www/capacitor/person_database/search_person_detection.js +22 -0
- package/www/capacitor/person_database/search_person_image.js +26 -0
- package/www/capacitor/person_database/search_person_request.js +17 -0
- package/www/cordova.js +3738 -0
- package/www/react-native/customization/camera_position.js +4 -0
- package/www/react-native/customization/customization.js +66 -0
- package/www/react-native/customization/customization_colors.js +233 -0
- package/www/react-native/customization/customization_fonts.js +106 -0
- package/www/react-native/customization/customization_images.js +129 -0
- package/www/react-native/customization/font.js +23 -0
- package/www/react-native/customization/screen_orientation.js +4 -0
- package/www/react-native/detect_faces/detect_face_result.js +38 -0
- package/www/react-native/detect_faces/detect_faces_attribute.js +15 -0
- package/www/react-native/detect_faces/detect_faces_attribute_result.js +20 -0
- package/www/react-native/detect_faces/detect_faces_backend_exception.js +23 -0
- package/www/react-native/detect_faces/detect_faces_config.js +14 -0
- package/www/react-native/detect_faces/detect_faces_exception.js +30 -0
- package/www/react-native/detect_faces/detect_faces_request.js +67 -0
- package/www/react-native/detect_faces/detect_faces_response.js +24 -0
- package/www/react-native/detect_faces/detect_faces_scenario.js +10 -0
- package/www/react-native/face_capture/face_capture_config.js +28 -0
- package/www/react-native/face_capture/face_capture_exception.js +25 -0
- package/www/react-native/face_capture/face_capture_image.js +26 -0
- package/www/react-native/face_capture/face_capture_response.js +17 -0
- package/www/react-native/image_params/output_image_crop.js +21 -0
- package/www/react-native/image_params/output_image_params.js +9 -0
- package/www/react-native/image_params/point.js +14 -0
- package/www/react-native/image_params/rect.js +18 -0
- package/www/react-native/image_params/size.js +9 -0
- package/www/react-native/image_quality/image_quality_characteristic.js +24 -0
- package/www/react-native/image_quality/image_quality_characteristic_name.js +58 -0
- package/www/react-native/image_quality/image_quality_group.js +332 -0
- package/www/react-native/image_quality/image_quality_range.js +26 -0
- package/www/react-native/image_quality/image_quality_result.js +40 -0
- package/www/react-native/index.js +219 -0
- package/www/react-native/init/face_sdk_version.js +16 -0
- package/www/react-native/init/init_config.js +9 -0
- package/www/react-native/init/init_exception.js +29 -0
- package/www/react-native/init/license_exception.js +29 -0
- package/www/react-native/internal/bridge.js +39 -0
- package/www/react-native/liveness/liveness_backend_exception.js +38 -0
- package/www/react-native/liveness/liveness_config.js +54 -0
- package/www/react-native/liveness/liveness_exception.js +35 -0
- package/www/react-native/liveness/liveness_notification.js +34 -0
- package/www/react-native/liveness/liveness_response.js +30 -0
- package/www/react-native/match_faces/compared_face.js +21 -0
- package/www/react-native/match_faces/compared_faces_pair.js +23 -0
- package/www/react-native/match_faces/compared_faces_split.js +22 -0
- package/www/react-native/match_faces/match_faces_backend_exception.js +14 -0
- package/www/react-native/match_faces/match_faces_config.js +12 -0
- package/www/react-native/match_faces/match_faces_detection.js +25 -0
- package/www/react-native/match_faces/match_faces_detection_face.js +28 -0
- package/www/react-native/match_faces/match_faces_exception.js +30 -0
- package/www/react-native/match_faces/match_faces_image.js +25 -0
- package/www/react-native/match_faces/match_faces_request.js +13 -0
- package/www/react-native/match_faces/match_faces_response.js +28 -0
- package/www/react-native/person_database/edit_group_persons_request.js +9 -0
- package/www/react-native/person_database/image_upload.js +16 -0
- package/www/react-native/person_database/pageable_item_list.js +22 -0
- package/www/react-native/person_database/person.js +22 -0
- package/www/react-native/person_database/person_database.js +145 -0
- package/www/react-native/person_database/person_group.js +18 -0
- package/www/react-native/person_database/person_image.js +22 -0
- package/www/react-native/person_database/search_person.js +31 -0
- package/www/react-native/person_database/search_person_detection.js +22 -0
- package/www/react-native/person_database/search_person_image.js +26 -0
- package/www/react-native/person_database/search_person_request.js +17 -0
- package/www/types/customization/camera_position.d.ts +4 -0
- package/www/types/customization/customization.d.ts +24 -0
- package/www/types/customization/customization_colors.d.ts +31 -0
- package/www/types/customization/customization_fonts.d.ts +17 -0
- package/www/types/customization/customization_images.d.ts +18 -0
- package/www/types/customization/font.d.ts +14 -0
- package/www/types/customization/screen_orientation.d.ts +4 -0
- package/www/types/detect_faces/detect_face_result.d.ts +16 -0
- package/www/types/detect_faces/detect_faces_attribute.d.ts +15 -0
- package/www/types/detect_faces/detect_faces_attribute_result.d.ts +11 -0
- package/www/types/detect_faces/detect_faces_backend_exception.d.ts +15 -0
- package/www/types/detect_faces/detect_faces_config.d.ts +19 -0
- package/www/types/detect_faces/detect_faces_exception.d.ts +21 -0
- package/www/types/detect_faces/detect_faces_request.d.ts +27 -0
- package/www/types/detect_faces/detect_faces_response.d.ts +12 -0
- package/www/types/detect_faces/detect_faces_scenario.d.ts +10 -0
- package/www/types/face_capture/face_capture_config.d.ts +30 -0
- package/www/types/face_capture/face_capture_exception.d.ts +17 -0
- package/www/types/face_capture/face_capture_image.d.ts +15 -0
- package/www/types/face_capture/face_capture_response.d.ts +9 -0
- package/www/types/image_params/output_image_crop.d.ts +25 -0
- package/www/types/image_params/output_image_params.d.ts +13 -0
- package/www/types/image_params/point.d.ts +6 -0
- package/www/types/image_params/rect.d.ts +8 -0
- package/www/types/image_params/size.d.ts +6 -0
- package/www/types/image_quality/image_quality_characteristic.d.ts +4 -0
- package/www/types/image_quality/image_quality_characteristic_name.d.ts +58 -0
- package/www/types/image_quality/image_quality_group.d.ts +155 -0
- package/www/types/image_quality/image_quality_range.d.ts +8 -0
- package/www/types/image_quality/image_quality_result.d.ts +30 -0
- package/www/types/index.d.ts +159 -0
- package/www/types/init/face_sdk_version.d.ts +7 -0
- package/www/types/init/init_config.d.ts +7 -0
- package/www/types/init/init_exception.d.ts +20 -0
- package/www/types/init/license_exception.d.ts +21 -0
- package/www/types/liveness/liveness_backend_exception.d.ts +30 -0
- package/www/types/liveness/liveness_config.d.ts +56 -0
- package/www/types/liveness/liveness_exception.d.ts +26 -0
- package/www/types/liveness/liveness_notification.d.ts +28 -0
- package/www/types/liveness/liveness_response.d.ts +18 -0
- package/www/types/match_faces/compared_face.d.ts +11 -0
- package/www/types/match_faces/compared_faces_pair.d.ts +12 -0
- package/www/types/match_faces/compared_faces_split.d.ts +8 -0
- package/www/types/match_faces/match_faces_backend_exception.d.ts +6 -0
- package/www/types/match_faces/match_faces_config.d.ts +14 -0
- package/www/types/match_faces/match_faces_detection.d.ts +12 -0
- package/www/types/match_faces/match_faces_detection_face.d.ts +13 -0
- package/www/types/match_faces/match_faces_exception.d.ts +21 -0
- package/www/types/match_faces/match_faces_image.d.ts +16 -0
- package/www/types/match_faces/match_faces_request.d.ts +18 -0
- package/www/types/match_faces/match_faces_response.d.ts +12 -0
- package/www/types/person_database/edit_group_persons_request.d.ts +8 -0
- package/www/types/person_database/image_upload.d.ts +6 -0
- package/www/types/person_database/pageable_item_list.d.ts +7 -0
- package/www/types/person_database/person.d.ts +10 -0
- package/www/types/person_database/person_database.d.ts +92 -0
- package/www/types/person_database/person_group.d.ts +8 -0
- package/www/types/person_database/person_image.d.ts +10 -0
- package/www/types/person_database/search_person.d.ts +15 -0
- package/www/types/person_database/search_person_detection.d.ts +11 -0
- package/www/types/person_database/search_person_image.d.ts +12 -0
- package/www/types/person_database/search_person_request.d.ts +15 -0
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
package com.regula.plugin.facesdk
|
|
2
|
+
|
|
3
|
+
import android.annotation.SuppressLint
|
|
4
|
+
import android.app.Activity
|
|
5
|
+
import com.regula.plugin.facesdk.Convert.toBase64
|
|
6
|
+
import com.regula.common.LocalizationCallbacks
|
|
7
|
+
import com.regula.facesdk.FaceSDK.Instance
|
|
8
|
+
import com.regula.facesdk.callback.DetectFacesCompletion
|
|
9
|
+
import com.regula.facesdk.callback.FaceCaptureCallback
|
|
10
|
+
import com.regula.facesdk.callback.FaceCaptureNotificationCallback
|
|
11
|
+
import com.regula.facesdk.callback.FaceInitializationCompletion
|
|
12
|
+
import com.regula.facesdk.callback.LivenessCallback
|
|
13
|
+
import com.regula.facesdk.callback.LivenessNotificationCallback
|
|
14
|
+
import com.regula.facesdk.callback.MatchFaceCallback
|
|
15
|
+
import com.regula.facesdk.callback.PersonDBCallback
|
|
16
|
+
import com.regula.facesdk.listener.NetworkInterceptorListener
|
|
17
|
+
import com.regula.facesdk.model.LivenessNotification
|
|
18
|
+
import com.regula.facesdk.model.results.matchfaces.MatchFacesSimilarityThresholdSplit
|
|
19
|
+
import com.regula.facesdk.model.results.person.DbBaseItem
|
|
20
|
+
import com.regula.facesdk.model.results.person.PageableItemList
|
|
21
|
+
import com.regula.facesdk.model.results.person.Person
|
|
22
|
+
import com.regula.facesdk.model.results.person.PersonGroup
|
|
23
|
+
import com.regula.facesdk.model.results.person.SearchPerson
|
|
24
|
+
import org.json.JSONArray
|
|
25
|
+
import org.json.JSONObject
|
|
26
|
+
|
|
27
|
+
fun methodCall(method: String, callback: (Any?) -> Unit): Any = when (method) {
|
|
28
|
+
"getVersion" -> getVersion(callback)
|
|
29
|
+
"getServiceUrl" -> getServiceUrl(callback)
|
|
30
|
+
"setServiceUrl" -> setServiceUrl(argsNullable(0))
|
|
31
|
+
"setLocalizationDictionary" -> setLocalizationDictionary(args(0))
|
|
32
|
+
"setRequestHeaders" -> setRequestHeaders(args(0))
|
|
33
|
+
"setCustomization" -> setCustomization(args(0))
|
|
34
|
+
"isInitialized" -> isInitialized(callback)
|
|
35
|
+
"initialize" -> initialize(callback, argsNullable(0))
|
|
36
|
+
"deinitialize" -> deinitialize()
|
|
37
|
+
"startFaceCapture" -> startFaceCapture(callback, argsNullable(0))
|
|
38
|
+
"stopFaceCapture" -> stopFaceCapture()
|
|
39
|
+
"startLiveness" -> startLiveness(callback, argsNullable(0))
|
|
40
|
+
"stopLiveness" -> stopLiveness()
|
|
41
|
+
"matchFaces" -> matchFaces(callback, args(0), argsNullable(1))
|
|
42
|
+
"splitComparedFaces" -> splitComparedFaces(callback, args(0), args(1))
|
|
43
|
+
"detectFaces" -> detectFaces(callback, args(0))
|
|
44
|
+
"createPerson" -> createPerson(callback, args(0), argsNullable(1), argsNullable(2))
|
|
45
|
+
"updatePerson" -> updatePerson(callback, args(0))
|
|
46
|
+
"deletePerson" -> deletePerson(callback, args(0))
|
|
47
|
+
"getPerson" -> getPerson(callback, args(0))
|
|
48
|
+
"addPersonImage" -> addPersonImage(callback, args(0), args(1))
|
|
49
|
+
"deletePersonImage" -> deletePersonImage(callback, args(0), args(1))
|
|
50
|
+
"getPersonImage" -> getPersonImage(callback, args(0), args(1))
|
|
51
|
+
"getPersonImages" -> getPersonImages(callback, args(0))
|
|
52
|
+
"getPersonImagesForPage" -> getPersonImagesForPage(callback, args(0), args(1), args(2))
|
|
53
|
+
"createGroup" -> createGroup(callback, args(0), argsNullable(1))
|
|
54
|
+
"updateGroup" -> updateGroup(callback, args(0))
|
|
55
|
+
"editPersonsInGroup" -> editPersonsInGroup(callback, args(0), args(1))
|
|
56
|
+
"deleteGroup" -> deleteGroup(callback, args(0))
|
|
57
|
+
"getGroup" -> getGroup(callback, args(0))
|
|
58
|
+
"getGroups" -> getGroups(callback)
|
|
59
|
+
"getGroupsForPage" -> getGroupsForPage(callback, args(0), args(1))
|
|
60
|
+
"getPersonGroups" -> getPersonGroups(callback, args(0))
|
|
61
|
+
"getPersonGroupsForPage" -> getPersonGroupsForPage(callback, args(0), args(1), args(2))
|
|
62
|
+
"getPersonsInGroup" -> getPersonsInGroup(callback, args(0))
|
|
63
|
+
"getPersonsInGroupForPage" -> getPersonsInGroupForPage(callback, args(0), args(1), args(2))
|
|
64
|
+
"searchPerson" -> searchPerson(callback, args(0))
|
|
65
|
+
else -> Unit
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
inline fun <reified T> args(index: Int) = argsNullable<T>(index)!!
|
|
69
|
+
typealias Callback = (Any?) -> Unit
|
|
70
|
+
|
|
71
|
+
@SuppressLint("StaticFieldLeak")
|
|
72
|
+
lateinit var activity: Activity
|
|
73
|
+
val context
|
|
74
|
+
get() = activity
|
|
75
|
+
|
|
76
|
+
const val cameraSwitchEvent = "cameraSwitchEvent"
|
|
77
|
+
const val livenessNotificationEvent = "livenessNotificationEvent"
|
|
78
|
+
const val videoEncoderCompletionEvent = "video_encoder_completion"
|
|
79
|
+
const val onCustomButtonTappedEvent = "onCustomButtonTappedEvent"
|
|
80
|
+
|
|
81
|
+
fun getVersion(callback: Callback) = callback(generateFaceSDKVersion(Instance().version))
|
|
82
|
+
|
|
83
|
+
fun getServiceUrl(callback: Callback) = callback(Instance().serviceUrl)
|
|
84
|
+
|
|
85
|
+
fun setServiceUrl(url: String?) = url.let { Instance().serviceUrl = it }
|
|
86
|
+
|
|
87
|
+
fun setLocalizationDictionary(dictionary: JSONObject) {
|
|
88
|
+
localizationCallbacks = LocalizationCallbacks { if (dictionary.has(it)) dictionary.getString(it) else null }
|
|
89
|
+
Instance().setLocalizationCallback(localizationCallbacks!!)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
fun setRequestHeaders(headers: JSONObject) {
|
|
93
|
+
networkInterceptorListener = NetworkInterceptorListener { headers.forEach { k, v -> it.header(k, v as String) } }
|
|
94
|
+
Instance().setNetworkInterceptorListener(networkInterceptorListener)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
fun setCustomization(config: JSONObject) = setCustomization(Instance().customization, config)
|
|
98
|
+
|
|
99
|
+
fun isInitialized(callback: Callback) = callback(Instance().isInitialized)
|
|
100
|
+
|
|
101
|
+
fun initialize(callback: Callback, config: JSONObject?) = config?.let {
|
|
102
|
+
Instance().initialize(context, initConfigFromJSON(it), initCompletion(callback))
|
|
103
|
+
} ?: Instance().initialize(context, initCompletion(callback))
|
|
104
|
+
|
|
105
|
+
fun deinitialize() = Instance().deinitialize()
|
|
106
|
+
|
|
107
|
+
fun startFaceCapture(callback: Callback, config: JSONObject?) = config?.let {
|
|
108
|
+
Instance().presentFaceCaptureActivity(
|
|
109
|
+
context,
|
|
110
|
+
faceCaptureConfigFromJSON(it),
|
|
111
|
+
faceCaptureCompletion(callback),
|
|
112
|
+
faceCaptureNotificationCompletion()
|
|
113
|
+
)
|
|
114
|
+
} ?: Instance().presentFaceCaptureActivity(
|
|
115
|
+
context,
|
|
116
|
+
faceCaptureCompletion(callback),
|
|
117
|
+
faceCaptureNotificationCompletion()
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
fun stopFaceCapture() = Instance().stopFaceCaptureActivity(context)
|
|
121
|
+
|
|
122
|
+
fun startLiveness(callback: Callback, config: JSONObject?) = config?.let {
|
|
123
|
+
Instance().startLiveness(
|
|
124
|
+
context,
|
|
125
|
+
livenessConfigFromJSON(it),
|
|
126
|
+
livenessCompletion(callback),
|
|
127
|
+
livenessNotificationCompletion()
|
|
128
|
+
)
|
|
129
|
+
} ?: Instance().startLiveness(
|
|
130
|
+
context,
|
|
131
|
+
livenessCompletion(callback),
|
|
132
|
+
livenessNotificationCompletion()
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
fun stopLiveness() = Instance().stopLivenessProcessing(context)
|
|
136
|
+
|
|
137
|
+
fun matchFaces(callback: Callback, request: JSONObject, config: JSONObject?) = config?.let {
|
|
138
|
+
Instance().matchFaces(
|
|
139
|
+
matchFacesRequestFromJSON(request),
|
|
140
|
+
matchFacesConfigFromJSON(it),
|
|
141
|
+
matchFacesCompletion(callback)
|
|
142
|
+
)
|
|
143
|
+
} ?: Instance().matchFaces(
|
|
144
|
+
matchFacesRequestFromJSON(request),
|
|
145
|
+
matchFacesCompletion(callback)
|
|
146
|
+
)
|
|
147
|
+
|
|
148
|
+
fun splitComparedFaces(callback: Callback, faces: JSONArray, similarity: Double) {
|
|
149
|
+
val list = faces.toList(::comparedFacesPairFromJSON)
|
|
150
|
+
val split = MatchFacesSimilarityThresholdSplit(list, similarity)
|
|
151
|
+
callback(generateComparedFacesSplit(split))
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
fun detectFaces(callback: Callback, request: JSONObject) = Instance().detectFaces(
|
|
155
|
+
detectFacesRequestFromJSON(request),
|
|
156
|
+
detectFacesCompletion(callback)
|
|
157
|
+
)
|
|
158
|
+
|
|
159
|
+
fun createPerson(
|
|
160
|
+
callback: Callback,
|
|
161
|
+
name: String,
|
|
162
|
+
groupIds: JSONArray?,
|
|
163
|
+
metadata: JSONObject?
|
|
164
|
+
) = Instance().personDatabase().createPerson(
|
|
165
|
+
name,
|
|
166
|
+
metadata,
|
|
167
|
+
groupIds.toArray(),
|
|
168
|
+
databaseItemCompletion(callback, ::generatePerson)
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
fun updatePerson(callback: Callback, personJson: JSONObject) =
|
|
172
|
+
Instance().personDatabase().getPerson(idFromJSON(personJson), object : PersonDBCallback<Person?> {
|
|
173
|
+
override fun onSuccess(person: Person?) = Instance().personDatabase().updatePerson(
|
|
174
|
+
updatePersonFromJSON(person!!, personJson),
|
|
175
|
+
databaseItemCompletion(callback, null)
|
|
176
|
+
)
|
|
177
|
+
|
|
178
|
+
override fun onFailure(error: String) = callback(generatePersonDBResponse(null, error))
|
|
179
|
+
})
|
|
180
|
+
|
|
181
|
+
fun deletePerson(callback: Callback, personId: String) = Instance().personDatabase().deletePerson(
|
|
182
|
+
personId,
|
|
183
|
+
databaseItemCompletion(callback, null)
|
|
184
|
+
)
|
|
185
|
+
|
|
186
|
+
fun getPerson(callback: Callback, personId: String) = Instance().personDatabase().getPerson(
|
|
187
|
+
personId,
|
|
188
|
+
databaseItemCompletion(callback, ::generatePerson)
|
|
189
|
+
)
|
|
190
|
+
|
|
191
|
+
fun addPersonImage(callback: Callback, personId: String, image: JSONObject) = Instance().personDatabase().addPersonImage(
|
|
192
|
+
personId,
|
|
193
|
+
imageUploadFromJSON(image),
|
|
194
|
+
databaseItemCompletion(callback, ::generatePersonImage)
|
|
195
|
+
)
|
|
196
|
+
|
|
197
|
+
fun deletePersonImage(callback: Callback, personId: String, imageId: String) = Instance().personDatabase().deletePersonImage(
|
|
198
|
+
personId,
|
|
199
|
+
imageId,
|
|
200
|
+
databaseItemCompletion(callback, null)
|
|
201
|
+
)
|
|
202
|
+
|
|
203
|
+
fun getPersonImage(callback: Callback, personId: String, imageId: String) = Instance().personDatabase().getPersonImageById(
|
|
204
|
+
personId,
|
|
205
|
+
imageId,
|
|
206
|
+
object : PersonDBCallback<ByteArray> {
|
|
207
|
+
override fun onSuccess(data: ByteArray?) = callback(generatePersonDBResponse(data.toBase64()!!, null))
|
|
208
|
+
override fun onFailure(error: String) = callback(generatePersonDBResponse(null, error))
|
|
209
|
+
}
|
|
210
|
+
)
|
|
211
|
+
|
|
212
|
+
fun getPersonImages(callback: Callback, personId: String) = Instance().personDatabase().getPersonImages(
|
|
213
|
+
personId,
|
|
214
|
+
databasePageCompletion(callback, ::generatePersonImage)
|
|
215
|
+
)
|
|
216
|
+
|
|
217
|
+
fun getPersonImagesForPage(
|
|
218
|
+
callback: Callback,
|
|
219
|
+
personId: String,
|
|
220
|
+
page: Int,
|
|
221
|
+
size: Int
|
|
222
|
+
) = Instance().personDatabase().getPersonImagesForPage(
|
|
223
|
+
personId,
|
|
224
|
+
page,
|
|
225
|
+
size,
|
|
226
|
+
databasePageCompletion(callback, ::generatePersonImage)
|
|
227
|
+
)
|
|
228
|
+
|
|
229
|
+
fun createGroup(callback: Callback, name: String, metadata: JSONObject?) = Instance().personDatabase().createGroup(
|
|
230
|
+
name,
|
|
231
|
+
metadata,
|
|
232
|
+
databaseItemCompletion(callback, ::generatePersonGroup)
|
|
233
|
+
)
|
|
234
|
+
|
|
235
|
+
fun updateGroup(callback: Callback, groupJson: JSONObject) =
|
|
236
|
+
Instance().personDatabase().getGroup(idFromJSON(groupJson), object : PersonDBCallback<PersonGroup?> {
|
|
237
|
+
override fun onSuccess(group: PersonGroup?) = Instance().personDatabase().updateGroup(
|
|
238
|
+
updatePersonGroupFromJSON(group!!, groupJson),
|
|
239
|
+
databaseItemCompletion(callback, null)
|
|
240
|
+
)
|
|
241
|
+
|
|
242
|
+
override fun onFailure(error: String) = callback(generatePersonDBResponse(null, error))
|
|
243
|
+
})
|
|
244
|
+
|
|
245
|
+
fun editPersonsInGroup(callback: Callback, groupId: String, editGroupPersonsRequest: JSONObject) =
|
|
246
|
+
Instance().personDatabase().editPersonsInGroup(
|
|
247
|
+
groupId,
|
|
248
|
+
editGroupPersonsRequestFromJSON(editGroupPersonsRequest),
|
|
249
|
+
databaseItemCompletion(callback, null)
|
|
250
|
+
)
|
|
251
|
+
|
|
252
|
+
fun deleteGroup(callback: Callback, groupId: String) = Instance().personDatabase().deleteGroup(
|
|
253
|
+
groupId,
|
|
254
|
+
databaseItemCompletion(callback, null)
|
|
255
|
+
)
|
|
256
|
+
|
|
257
|
+
fun getGroup(callback: Callback, groupId: String) = Instance().personDatabase().getGroup(
|
|
258
|
+
groupId,
|
|
259
|
+
databaseItemCompletion(callback, ::generatePersonGroup)
|
|
260
|
+
)
|
|
261
|
+
|
|
262
|
+
fun getGroups(callback: Callback) =
|
|
263
|
+
Instance().personDatabase().getGroups(databasePageCompletion(callback, ::generatePersonGroup))
|
|
264
|
+
|
|
265
|
+
fun getGroupsForPage(callback: Callback, page: Int, size: Int) = Instance().personDatabase().getGroupsForPage(
|
|
266
|
+
page,
|
|
267
|
+
size,
|
|
268
|
+
databasePageCompletion(callback, ::generatePersonGroup)
|
|
269
|
+
)
|
|
270
|
+
|
|
271
|
+
fun getPersonGroups(callback: Callback, personId: String) = Instance().personDatabase().getPersonGroups(
|
|
272
|
+
personId,
|
|
273
|
+
databasePageCompletion(callback, ::generatePersonGroup)
|
|
274
|
+
)
|
|
275
|
+
|
|
276
|
+
fun getPersonGroupsForPage(
|
|
277
|
+
callback: Callback,
|
|
278
|
+
personId: String,
|
|
279
|
+
page: Int,
|
|
280
|
+
size: Int
|
|
281
|
+
) = Instance().personDatabase().getPersonGroupsForPage(
|
|
282
|
+
personId,
|
|
283
|
+
page,
|
|
284
|
+
size,
|
|
285
|
+
databasePageCompletion(callback, ::generatePersonGroup)
|
|
286
|
+
)
|
|
287
|
+
|
|
288
|
+
fun getPersonsInGroup(callback: Callback, groupId: String) = Instance().personDatabase().getPersonsInGroup(
|
|
289
|
+
groupId,
|
|
290
|
+
databasePageCompletion(callback, ::generatePerson)
|
|
291
|
+
)
|
|
292
|
+
|
|
293
|
+
fun getPersonsInGroupForPage(
|
|
294
|
+
callback: Callback,
|
|
295
|
+
groupId: String,
|
|
296
|
+
page: Int,
|
|
297
|
+
size: Int
|
|
298
|
+
) = Instance().personDatabase().getPersonsInGroupForPage(
|
|
299
|
+
groupId,
|
|
300
|
+
page,
|
|
301
|
+
size,
|
|
302
|
+
databasePageCompletion(callback, ::generatePerson)
|
|
303
|
+
)
|
|
304
|
+
|
|
305
|
+
fun searchPerson(callback: Callback, searchPersonRequest: JSONObject) = Instance().personDatabase().searchPerson(
|
|
306
|
+
searchPersonRequestFromJSON(searchPersonRequest),
|
|
307
|
+
object : PersonDBCallback<List<SearchPerson>> {
|
|
308
|
+
override fun onSuccess(data: List<SearchPerson>?) = callback(generatePersonDBResponse(data.toJsonNullable(::generateSearchPerson)!!, null))
|
|
309
|
+
override fun onFailure(error: String) = callback(generatePersonDBResponse(null, error))
|
|
310
|
+
}
|
|
311
|
+
)
|
|
312
|
+
|
|
313
|
+
fun initCompletion(callback: Callback) = FaceInitializationCompletion { success, error ->
|
|
314
|
+
if (success) {
|
|
315
|
+
// initializes MutableLiveData
|
|
316
|
+
Instance().customization.uiConfigurationLive
|
|
317
|
+
Instance().setVideoEncoderCompletion { id, s -> sendEvent(videoEncoderCompletionEvent, generateVideoEncoderCompletion(id, s)) }
|
|
318
|
+
Instance().setOnClickListener { sendEvent(onCustomButtonTappedEvent, it.tag.toInt()) }
|
|
319
|
+
}
|
|
320
|
+
callback(generateInitCompletion(success, error))
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
fun faceCaptureCompletion(callback: Callback) = FaceCaptureCallback {
|
|
324
|
+
callback(generateFaceCaptureResponse(it))
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
fun faceCaptureNotificationCompletion() = object : FaceCaptureNotificationCallback() {
|
|
328
|
+
override fun onCameraSwitched(cameraId: Int) = sendEvent(cameraSwitchEvent, cameraId)
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
fun livenessCompletion(callback: Callback) = LivenessCallback {
|
|
332
|
+
callback(generateLivenessResponse(it))
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
fun livenessNotificationCompletion() = object : LivenessNotificationCallback() {
|
|
336
|
+
override fun onCameraSwitched(cameraId: Int) = sendEvent(cameraSwitchEvent, cameraId)
|
|
337
|
+
override fun onLivenessNotification(ln: LivenessNotification) = sendEvent(livenessNotificationEvent, generateLivenessNotification(ln))
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
fun matchFacesCompletion(callback: Callback) = MatchFaceCallback {
|
|
341
|
+
callback(generateMatchFacesResponse(it))
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
fun detectFacesCompletion(callback: Callback) = DetectFacesCompletion {
|
|
345
|
+
callback(generateDetectFacesResponse(it))
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
fun <T> databaseItemCompletion(callback: Callback, toJson: ((T?) -> JSONObject?)?) = object : PersonDBCallback<T> {
|
|
349
|
+
override fun onSuccess(data: T?) = callback(generatePersonDBResponse(toJson?.let { it(data) } ?: true, null))
|
|
350
|
+
override fun onFailure(error: String) = callback(generatePersonDBResponse(null, error))
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
fun <T : DbBaseItem?> databasePageCompletion(callback: Callback, toJson: (T?) -> JSONObject?) = object : PersonDBCallback<PageableItemList<List<T>?, T>> {
|
|
354
|
+
override fun onSuccess(data: PageableItemList<List<T>?, T>?) = callback(
|
|
355
|
+
generatePersonDBResponse(
|
|
356
|
+
mapOf(
|
|
357
|
+
"items" to data!!.itemsList.toJsonNullable(toJson),
|
|
358
|
+
"page" to data.page,
|
|
359
|
+
"totalPages" to data.totalPages,
|
|
360
|
+
).toJson(),
|
|
361
|
+
null
|
|
362
|
+
)
|
|
363
|
+
)
|
|
364
|
+
|
|
365
|
+
override fun onFailure(error: String) = callback(generatePersonDBResponse(null, error))
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
// Weak references
|
|
369
|
+
var localizationCallbacks: LocalizationCallbacks? = null
|
|
370
|
+
var networkInterceptorListener: NetworkInterceptorListener? = null
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
package com.regula.plugin.facesdk
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.Promise
|
|
4
|
+
import com.facebook.react.bridge.ReactApplicationContext
|
|
5
|
+
import com.facebook.react.bridge.ReactContext
|
|
6
|
+
import com.facebook.react.bridge.ReactContextBaseJavaModule
|
|
7
|
+
import com.facebook.react.bridge.ReactMethod
|
|
8
|
+
import com.facebook.react.bridge.ReadableArray
|
|
9
|
+
import com.facebook.react.modules.core.DeviceEventManagerModule
|
|
10
|
+
import org.json.JSONArray
|
|
11
|
+
import org.json.JSONObject
|
|
12
|
+
|
|
13
|
+
var listenerCount = 0
|
|
14
|
+
lateinit var args: JSONArray
|
|
15
|
+
lateinit var reactContext: ReactContext
|
|
16
|
+
|
|
17
|
+
fun sendEvent(event: String, data: Any? = "") {
|
|
18
|
+
if (listenerCount <= 0) return
|
|
19
|
+
val result = if (data is JSONObject || data is JSONArray) data.toString() else data.toString() + ""
|
|
20
|
+
reactContext.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java).emit(event, result)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@Suppress("UNCHECKED_CAST")
|
|
24
|
+
fun <T> argsNullable(index: Int): T? {
|
|
25
|
+
val value = args[index]
|
|
26
|
+
if (value is Double && value % 1 == 0.0) return value.toInt() as T
|
|
27
|
+
if (value.toString() == "null") return null
|
|
28
|
+
return value as T
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@Suppress("unused", "UNUSED_PARAMETER")
|
|
32
|
+
class RNFaceSDKModule(rc: ReactApplicationContext) : ReactContextBaseJavaModule(rc) {
|
|
33
|
+
init {
|
|
34
|
+
reactContext = rc
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@ReactMethod
|
|
38
|
+
fun addListener(eventName: String) {
|
|
39
|
+
listenerCount += 1
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@ReactMethod
|
|
43
|
+
fun removeListeners(count: Int) {
|
|
44
|
+
listenerCount -= count
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@ReactMethod
|
|
48
|
+
fun exec(method: String, arguments: ReadableArray, promise: Promise) {
|
|
49
|
+
args = JSONArray(arguments.toArrayList())
|
|
50
|
+
reactContext.currentActivity?.let { activity = it }
|
|
51
|
+
methodCall(method) { data: Any? -> promise.resolve(data.toSendable()) }
|
|
52
|
+
}
|
|
53
|
+
override fun getName() = "RNFaceSDK"
|
|
54
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
package com.regula.plugin.facesdk
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.ReactPackage
|
|
4
|
+
import com.facebook.react.bridge.NativeModule
|
|
5
|
+
import com.facebook.react.bridge.ReactApplicationContext
|
|
6
|
+
import com.facebook.react.uimanager.ViewManager
|
|
7
|
+
|
|
8
|
+
class RNFaceSDKPackage : ReactPackage {
|
|
9
|
+
override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> = listOf(RNFaceSDKModule(reactContext))
|
|
10
|
+
override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> = emptyList()
|
|
11
|
+
}
|