@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.
Files changed (543) hide show
  1. package/README.md +23 -0
  2. package/RNFaceSDK.podspec +21 -0
  3. package/android/CVDFaceSDK.kt +34 -0
  4. package/android/build.gradle +48 -0
  5. package/android/cordova.gradle +18 -0
  6. package/android/src/main/AndroidManifest.xml +1 -0
  7. package/android/src/main/java/com/regula/plugin/facesdk/Config.kt +165 -0
  8. package/android/src/main/java/com/regula/plugin/facesdk/JSONConstructor.kt +904 -0
  9. package/android/src/main/java/com/regula/plugin/facesdk/Main.kt +370 -0
  10. package/android/src/main/java/com/regula/plugin/facesdk/RNFaceApiModule.kt +54 -0
  11. package/android/src/main/java/com/regula/plugin/facesdk/RNFaceApiPackage.kt +11 -0
  12. package/android/src/main/java/com/regula/plugin/facesdk/Utils.kt +287 -0
  13. package/examples/capacitor/.browserslistrc +6 -0
  14. package/examples/capacitor/.eslintrc.js +17 -0
  15. package/examples/capacitor/README.md +27 -0
  16. package/examples/capacitor/android/app/build.gradle +54 -0
  17. package/examples/capacitor/android/app/capacitor.build.gradle +22 -0
  18. package/examples/capacitor/android/app/proguard-rules.pro +21 -0
  19. package/examples/capacitor/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java +26 -0
  20. package/examples/capacitor/android/app/src/main/AndroidManifest.xml +43 -0
  21. package/examples/capacitor/android/app/src/main/java/com/regula/faceapi/MainActivity.java +5 -0
  22. package/examples/capacitor/android/app/src/main/res/drawable/ic_launcher_background.xml +170 -0
  23. package/examples/capacitor/android/app/src/main/res/drawable/splash.png +0 -0
  24. package/examples/capacitor/android/app/src/main/res/drawable-land-hdpi/splash.png +0 -0
  25. package/examples/capacitor/android/app/src/main/res/drawable-land-mdpi/splash.png +0 -0
  26. package/examples/capacitor/android/app/src/main/res/drawable-land-xhdpi/splash.png +0 -0
  27. package/examples/capacitor/android/app/src/main/res/drawable-land-xxhdpi/splash.png +0 -0
  28. package/examples/capacitor/android/app/src/main/res/drawable-land-xxxhdpi/splash.png +0 -0
  29. package/examples/capacitor/android/app/src/main/res/drawable-port-hdpi/splash.png +0 -0
  30. package/examples/capacitor/android/app/src/main/res/drawable-port-mdpi/splash.png +0 -0
  31. package/examples/capacitor/android/app/src/main/res/drawable-port-xhdpi/splash.png +0 -0
  32. package/examples/capacitor/android/app/src/main/res/drawable-port-xxhdpi/splash.png +0 -0
  33. package/examples/capacitor/android/app/src/main/res/drawable-port-xxxhdpi/splash.png +0 -0
  34. package/examples/capacitor/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml +34 -0
  35. package/examples/capacitor/android/app/src/main/res/layout/activity_main.xml +12 -0
  36. package/examples/capacitor/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +5 -0
  37. package/examples/capacitor/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +5 -0
  38. package/examples/capacitor/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  39. package/examples/capacitor/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png +0 -0
  40. package/examples/capacitor/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  41. package/examples/capacitor/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  42. package/examples/capacitor/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png +0 -0
  43. package/examples/capacitor/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  44. package/examples/capacitor/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  45. package/examples/capacitor/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png +0 -0
  46. package/examples/capacitor/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  47. package/examples/capacitor/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  48. package/examples/capacitor/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png +0 -0
  49. package/examples/capacitor/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  50. package/examples/capacitor/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  51. package/examples/capacitor/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png +0 -0
  52. package/examples/capacitor/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  53. package/examples/capacitor/android/app/src/main/res/values/ic_launcher_background.xml +4 -0
  54. package/examples/capacitor/android/app/src/main/res/values/strings.xml +7 -0
  55. package/examples/capacitor/android/app/src/main/res/values/styles.xml +22 -0
  56. package/examples/capacitor/android/app/src/main/res/xml/file_paths.xml +5 -0
  57. package/examples/capacitor/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java +18 -0
  58. package/examples/capacitor/android/build.gradle +30 -0
  59. package/examples/capacitor/android/capacitor.settings.gradle +15 -0
  60. package/examples/capacitor/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  61. package/examples/capacitor/android/gradle/wrapper/gradle-wrapper.properties +6 -0
  62. package/examples/capacitor/android/gradle.properties +22 -0
  63. package/examples/capacitor/android/gradlew +244 -0
  64. package/examples/capacitor/android/gradlew.bat +92 -0
  65. package/examples/capacitor/android/settings.gradle +5 -0
  66. package/examples/capacitor/android/variables.gradle +16 -0
  67. package/examples/capacitor/capacitor.config.ts +12 -0
  68. package/examples/capacitor/cypress/e2e/test.cy.ts +6 -0
  69. package/examples/capacitor/cypress/fixtures/example.json +5 -0
  70. package/examples/capacitor/cypress/support/commands.ts +37 -0
  71. package/examples/capacitor/cypress/support/e2e.ts +20 -0
  72. package/examples/capacitor/cypress.config.ts +10 -0
  73. package/examples/capacitor/index.html +106 -0
  74. package/examples/capacitor/ionic.config.json +7 -0
  75. package/examples/capacitor/ios/App/App/App.entitlements +5 -0
  76. package/examples/capacitor/ios/App/App/AppDelegate.swift +49 -0
  77. package/examples/capacitor/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png +0 -0
  78. package/examples/capacitor/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json +14 -0
  79. package/examples/capacitor/ios/App/App/Assets.xcassets/Contents.json +6 -0
  80. package/examples/capacitor/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json +23 -0
  81. package/examples/capacitor/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png +0 -0
  82. package/examples/capacitor/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png +0 -0
  83. package/examples/capacitor/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png +0 -0
  84. package/examples/capacitor/ios/App/App/Base.lproj/LaunchScreen.storyboard +32 -0
  85. package/examples/capacitor/ios/App/App/Base.lproj/Main.storyboard +19 -0
  86. package/examples/capacitor/ios/App/App/Info.plist +53 -0
  87. package/examples/capacitor/ios/App/App.xcodeproj/project.pbxproj +410 -0
  88. package/examples/capacitor/ios/App/App.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  89. package/examples/capacitor/ios/App/App.xcworkspace/contents.xcworkspacedata +10 -0
  90. package/examples/capacitor/ios/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  91. package/examples/capacitor/ios/App/Podfile +27 -0
  92. package/examples/capacitor/package.json +64 -0
  93. package/examples/capacitor/public/assets/.gitkeep +0 -0
  94. package/examples/capacitor/public/assets/img/id.png +0 -0
  95. package/examples/capacitor/public/assets/img/portrait.png +0 -0
  96. package/examples/capacitor/public/favicon.png +0 -0
  97. package/examples/capacitor/public/manifest.json +21 -0
  98. package/examples/capacitor/src/App.test.tsx +8 -0
  99. package/examples/capacitor/src/App.tsx +42 -0
  100. package/examples/capacitor/src/components/ExploreContainer.css +24 -0
  101. package/examples/capacitor/src/components/ExploreContainer.tsx +14 -0
  102. package/examples/capacitor/src/main.tsx +11 -0
  103. package/examples/capacitor/src/pages/Home.tsx +159 -0
  104. package/examples/capacitor/src/setupTests.ts +14 -0
  105. package/examples/capacitor/src/theme/variables.css +242 -0
  106. package/examples/capacitor/src/vite-env.d.ts +1 -0
  107. package/examples/capacitor/tsconfig.json +21 -0
  108. package/examples/capacitor/tsconfig.node.json +9 -0
  109. package/examples/capacitor/vite.config.ts +16 -0
  110. package/examples/cordova/.vscode/launch.json +28 -0
  111. package/examples/cordova/config.xml +37 -0
  112. package/examples/cordova/jsconfig.json +1 -0
  113. package/examples/cordova/package.json +40 -0
  114. package/examples/cordova/www/css/index.css +107 -0
  115. package/examples/cordova/www/img/id.png +0 -0
  116. package/examples/cordova/www/img/logo.png +0 -0
  117. package/examples/cordova/www/img/portrait.png +0 -0
  118. package/examples/cordova/www/index.html +94 -0
  119. package/examples/cordova/www/js/index.js +154 -0
  120. package/examples/ionic/angular.json +187 -0
  121. package/examples/ionic/browserslist +12 -0
  122. package/examples/ionic/config.xml +114 -0
  123. package/examples/ionic/e2e/protractor.conf.js +28 -0
  124. package/examples/ionic/e2e/src/app.e2e-spec.ts +14 -0
  125. package/examples/ionic/e2e/src/app.po.ts +11 -0
  126. package/examples/ionic/e2e/tsconfig.json +13 -0
  127. package/examples/ionic/ionic.config.json +7 -0
  128. package/examples/ionic/karma.conf.js +31 -0
  129. package/examples/ionic/package.json +97 -0
  130. package/examples/ionic/resources/README.md +8 -0
  131. package/examples/ionic/resources/android/icon/drawable-hdpi-icon.png +0 -0
  132. package/examples/ionic/resources/android/icon/drawable-ldpi-icon.png +0 -0
  133. package/examples/ionic/resources/android/icon/drawable-mdpi-icon.png +0 -0
  134. package/examples/ionic/resources/android/icon/drawable-xhdpi-icon.png +0 -0
  135. package/examples/ionic/resources/android/icon/drawable-xxhdpi-icon.png +0 -0
  136. package/examples/ionic/resources/android/icon/drawable-xxxhdpi-icon.png +0 -0
  137. package/examples/ionic/resources/android/splash/drawable-land-hdpi-screen.png +0 -0
  138. package/examples/ionic/resources/android/splash/drawable-land-ldpi-screen.png +0 -0
  139. package/examples/ionic/resources/android/splash/drawable-land-mdpi-screen.png +0 -0
  140. package/examples/ionic/resources/android/splash/drawable-land-xhdpi-screen.png +0 -0
  141. package/examples/ionic/resources/android/splash/drawable-land-xxhdpi-screen.png +0 -0
  142. package/examples/ionic/resources/android/splash/drawable-land-xxxhdpi-screen.png +0 -0
  143. package/examples/ionic/resources/android/splash/drawable-port-hdpi-screen.png +0 -0
  144. package/examples/ionic/resources/android/splash/drawable-port-ldpi-screen.png +0 -0
  145. package/examples/ionic/resources/android/splash/drawable-port-mdpi-screen.png +0 -0
  146. package/examples/ionic/resources/android/splash/drawable-port-xhdpi-screen.png +0 -0
  147. package/examples/ionic/resources/android/splash/drawable-port-xxhdpi-screen.png +0 -0
  148. package/examples/ionic/resources/android/splash/drawable-port-xxxhdpi-screen.png +0 -0
  149. package/examples/ionic/resources/android/xml/network_security_config.xml +6 -0
  150. package/examples/ionic/resources/icon.png +0 -0
  151. package/examples/ionic/resources/ios/icon/icon-1024.png +0 -0
  152. package/examples/ionic/resources/ios/icon/icon-20.png +0 -0
  153. package/examples/ionic/resources/ios/icon/icon-20@2x.png +0 -0
  154. package/examples/ionic/resources/ios/icon/icon-20@3x.png +0 -0
  155. package/examples/ionic/resources/ios/icon/icon-24@2x.png +0 -0
  156. package/examples/ionic/resources/ios/icon/icon-27.5@2x.png +0 -0
  157. package/examples/ionic/resources/ios/icon/icon-29.png +0 -0
  158. package/examples/ionic/resources/ios/icon/icon-29@2x.png +0 -0
  159. package/examples/ionic/resources/ios/icon/icon-29@3x.png +0 -0
  160. package/examples/ionic/resources/ios/icon/icon-40.png +0 -0
  161. package/examples/ionic/resources/ios/icon/icon-40@2x.png +0 -0
  162. package/examples/ionic/resources/ios/icon/icon-40@3x.png +0 -0
  163. package/examples/ionic/resources/ios/icon/icon-44@2x.png +0 -0
  164. package/examples/ionic/resources/ios/icon/icon-50.png +0 -0
  165. package/examples/ionic/resources/ios/icon/icon-50@2x.png +0 -0
  166. package/examples/ionic/resources/ios/icon/icon-60.png +0 -0
  167. package/examples/ionic/resources/ios/icon/icon-60@2x.png +0 -0
  168. package/examples/ionic/resources/ios/icon/icon-60@3x.png +0 -0
  169. package/examples/ionic/resources/ios/icon/icon-72.png +0 -0
  170. package/examples/ionic/resources/ios/icon/icon-72@2x.png +0 -0
  171. package/examples/ionic/resources/ios/icon/icon-76.png +0 -0
  172. package/examples/ionic/resources/ios/icon/icon-76@2x.png +0 -0
  173. package/examples/ionic/resources/ios/icon/icon-83.5@2x.png +0 -0
  174. package/examples/ionic/resources/ios/icon/icon-86@2x.png +0 -0
  175. package/examples/ionic/resources/ios/icon/icon-98@2x.png +0 -0
  176. package/examples/ionic/resources/ios/icon/icon-small.png +0 -0
  177. package/examples/ionic/resources/ios/icon/icon-small@2x.png +0 -0
  178. package/examples/ionic/resources/ios/icon/icon-small@3x.png +0 -0
  179. package/examples/ionic/resources/ios/icon/icon.png +0 -0
  180. package/examples/ionic/resources/ios/icon/icon@2x.png +0 -0
  181. package/examples/ionic/resources/ios/splash/Default-2436h.png +0 -0
  182. package/examples/ionic/resources/ios/splash/Default-568h@2x~iphone.png +0 -0
  183. package/examples/ionic/resources/ios/splash/Default-667h.png +0 -0
  184. package/examples/ionic/resources/ios/splash/Default-736h.png +0 -0
  185. package/examples/ionic/resources/ios/splash/Default-Landscape-2436h.png +0 -0
  186. package/examples/ionic/resources/ios/splash/Default-Landscape-736h.png +0 -0
  187. package/examples/ionic/resources/ios/splash/Default-Landscape@2x~ipad.png +0 -0
  188. package/examples/ionic/resources/ios/splash/Default-Landscape@~ipadpro.png +0 -0
  189. package/examples/ionic/resources/ios/splash/Default-Landscape~ipad.png +0 -0
  190. package/examples/ionic/resources/ios/splash/Default-Portrait@2x~ipad.png +0 -0
  191. package/examples/ionic/resources/ios/splash/Default-Portrait@~ipadpro.png +0 -0
  192. package/examples/ionic/resources/ios/splash/Default-Portrait~ipad.png +0 -0
  193. package/examples/ionic/resources/ios/splash/Default@2x~iphone.png +0 -0
  194. package/examples/ionic/resources/ios/splash/Default@2x~universal~anyany.png +0 -0
  195. package/examples/ionic/resources/ios/splash/Default~iphone.png +0 -0
  196. package/examples/ionic/resources/splash.png +0 -0
  197. package/examples/ionic/src/app/app-routing.module.ts +15 -0
  198. package/examples/ionic/src/app/app.component.html +3 -0
  199. package/examples/ionic/src/app/app.component.scss +0 -0
  200. package/examples/ionic/src/app/app.component.spec.ts +47 -0
  201. package/examples/ionic/src/app/app.component.ts +27 -0
  202. package/examples/ionic/src/app/app.module.ts +23 -0
  203. package/examples/ionic/src/app/home/home.module.ts +29 -0
  204. package/examples/ionic/src/app/home/home.page.html +75 -0
  205. package/examples/ionic/src/app/home/home.page.scss +1 -0
  206. package/examples/ionic/src/app/home/home.page.spec.ts +24 -0
  207. package/examples/ionic/src/app/home/home.page.ts +166 -0
  208. package/examples/ionic/src/assets/icon/favicon.png +0 -0
  209. package/examples/ionic/src/assets/img/portrait.png +0 -0
  210. package/examples/ionic/src/assets/shapes.svg +1 -0
  211. package/examples/ionic/src/environments/environment.prod.ts +3 -0
  212. package/examples/ionic/src/environments/environment.ts +16 -0
  213. package/examples/ionic/src/global.scss +31 -0
  214. package/examples/ionic/src/index.html +25 -0
  215. package/examples/ionic/src/main.ts +12 -0
  216. package/examples/ionic/src/polyfills.ts +66 -0
  217. package/examples/ionic/src/test.ts +20 -0
  218. package/examples/ionic/src/theme/variables.scss +77 -0
  219. package/examples/ionic/src/zone-flags.ts +5 -0
  220. package/examples/ionic/tsconfig.app.json +14 -0
  221. package/examples/ionic/tsconfig.json +26 -0
  222. package/examples/ionic/tsconfig.spec.json +19 -0
  223. package/examples/ionic/tslint.json +88 -0
  224. package/examples/react-native/.vscode/launch.json +26 -0
  225. package/examples/react-native/.watchmanconfig +1 -0
  226. package/examples/react-native/App.tsx +206 -0
  227. package/examples/react-native/Gemfile +8 -0
  228. package/examples/react-native/Gemfile.lock +134 -0
  229. package/examples/react-native/android/app/build.gradle +123 -0
  230. package/examples/react-native/android/app/debug.keystore +0 -0
  231. package/examples/react-native/android/app/proguard-rules.pro +10 -0
  232. package/examples/react-native/android/app/src/debug/AndroidManifest.xml +9 -0
  233. package/examples/react-native/android/app/src/main/AndroidManifest.xml +27 -0
  234. package/examples/react-native/android/app/src/main/assets/.gitkeep +0 -0
  235. package/examples/react-native/android/app/src/main/java/com/regula/face/api/MainActivity.kt +22 -0
  236. package/examples/react-native/android/app/src/main/java/com/regula/face/api/MainApplication.kt +43 -0
  237. package/examples/react-native/android/app/src/main/res/drawable/rn_edit_text_material.xml +37 -0
  238. package/examples/react-native/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  239. package/examples/react-native/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  240. package/examples/react-native/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  241. package/examples/react-native/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  242. package/examples/react-native/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  243. package/examples/react-native/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  244. package/examples/react-native/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  245. package/examples/react-native/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  246. package/examples/react-native/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  247. package/examples/react-native/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  248. package/examples/react-native/android/app/src/main/res/values/strings.xml +3 -0
  249. package/examples/react-native/android/app/src/main/res/values/styles.xml +9 -0
  250. package/examples/react-native/android/build.gradle +21 -0
  251. package/examples/react-native/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  252. package/examples/react-native/android/gradle/wrapper/gradle-wrapper.properties +7 -0
  253. package/examples/react-native/android/gradle.properties +39 -0
  254. package/examples/react-native/android/gradlew +249 -0
  255. package/examples/react-native/android/gradlew.bat +92 -0
  256. package/examples/react-native/android/settings.gradle +6 -0
  257. package/examples/react-native/images/portrait.png +0 -0
  258. package/examples/react-native/index.js +4 -0
  259. package/examples/react-native/ios/.xcode.env +11 -0
  260. package/examples/react-native/ios/FaceSDK/AppDelegate.h +6 -0
  261. package/examples/react-native/ios/FaceSDK/AppDelegate.mm +31 -0
  262. package/examples/react-native/ios/FaceSDK/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
  263. package/examples/react-native/ios/FaceSDK/Images.xcassets/Contents.json +6 -0
  264. package/examples/react-native/ios/FaceSDK/Info.plist +51 -0
  265. package/examples/react-native/ios/FaceSDK/LaunchScreen.storyboard +47 -0
  266. package/examples/react-native/ios/FaceSDK/PrivacyInfo.xcprivacy +38 -0
  267. package/examples/react-native/ios/FaceSDK/main.m +10 -0
  268. package/examples/react-native/ios/FaceSDK.xcodeproj/project.pbxproj +719 -0
  269. package/examples/react-native/ios/FaceSDK.xcodeproj/xcshareddata/xcschemes/FaceSDK.xcscheme +88 -0
  270. package/examples/react-native/ios/FaceSDK.xcworkspace/contents.xcworkspacedata +10 -0
  271. package/examples/react-native/ios/FaceSDK.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  272. package/examples/react-native/ios/FaceSDKTests/FaceSDKTests.m +66 -0
  273. package/examples/react-native/ios/FaceSDKTests/Info.plist +24 -0
  274. package/examples/react-native/ios/Podfile +40 -0
  275. package/examples/react-native/ios/Podfile.lock +1822 -0
  276. package/examples/react-native/ios/license/.gitkeep +0 -0
  277. package/examples/react-native/metro.config.js +15 -0
  278. package/examples/react-native/package-lock.json +13098 -0
  279. package/examples/react-native/package.json +42 -0
  280. package/ios/CVDFaceSDK.h +7 -0
  281. package/ios/CVDFaceSDK.m +34 -0
  282. package/ios/RFSWConfig.h +27 -0
  283. package/ios/RFSWConfig.m +189 -0
  284. package/ios/RFSWJSONConstructor.h +134 -0
  285. package/ios/RFSWJSONConstructor.m +977 -0
  286. package/ios/RFSWMain.h +23 -0
  287. package/ios/RFSWMain.m +352 -0
  288. package/ios/RNFaceSDK.h +8 -0
  289. package/ios/RNFaceSDK.m +42 -0
  290. package/ios-ci/.gitlab-ci.yml +41 -0
  291. package/ios-ci/.sample-env +22 -0
  292. package/ios-ci/README.md +97 -0
  293. package/ios-ci/RegulaDanger/Package.swift +34 -0
  294. package/ios-ci/RegulaDanger/Sources/RegulaDanger/RegulaDanger.swift +44 -0
  295. package/ios-ci/RegulaDanger/Tests/LinuxMain.swift +7 -0
  296. package/ios-ci/RegulaDanger/Tests/RegulaDangerTests/RegulaDangerTests.swift +15 -0
  297. package/ios-ci/RegulaDanger/Tests/RegulaDangerTests/XCTestManifests.swift +9 -0
  298. package/ios-ci/install.sh +9 -0
  299. package/ios-ci/ios_ci/__init__.py +8 -0
  300. package/ios-ci/ios_ci/cli.py +408 -0
  301. package/ios-ci/ios_ci/common/__init__.py +0 -0
  302. package/ios-ci/ios_ci/common/build_index.py +70 -0
  303. package/ios-ci/ios_ci/common/clean_cocoapod.sh +13 -0
  304. package/ios-ci/ios_ci/common/dependency.py +466 -0
  305. package/ios-ci/ios_ci/common/ftp.py +314 -0
  306. package/ios-ci/ios_ci/common/searchpod.sh +6 -0
  307. package/ios-ci/ios_ci/common/wait_for_cocopod.sh +21 -0
  308. package/ios-ci/ios_ci/inject.py +145 -0
  309. package/ios-ci/ios_ci/podspec/__init__.py +0 -0
  310. package/ios-ci/ios_ci/podspec/podspec.py +88 -0
  311. package/ios-ci/ios_ci/podspec/templates/BTDevice.podspec +17 -0
  312. package/ios-ci/ios_ci/podspec/templates/Core.podspec +17 -0
  313. package/ios-ci/ios_ci/podspec/templates/DocumentReader.podspec +19 -0
  314. package/ios-ci/ios_ci/podspec/templates/FaceCore.podspec +17 -0
  315. package/ios-ci/ios_ci/podspec/templates/FaceSDK.podspec +18 -0
  316. package/ios-ci/ios_ci/podspec/templates/IRS.podspec +17 -0
  317. package/ios-ci/ios_ci/podspec/templates/RegulaCommon.podspec +17 -0
  318. package/ios-ci/ios_ci/resolve_podfile_common.py +76 -0
  319. package/ios-ci/ios_ci/spm/AppleRootCA-G3.cer +0 -0
  320. package/ios-ci/ios_ci/spm/AppleWWDRCAG3.cer +0 -0
  321. package/ios-ci/ios_ci/spm/SwiftPackageGenerator+Common.sh +48 -0
  322. package/ios-ci/ios_ci/spm/SwiftPackageGenerator.sh +33 -0
  323. package/ios-ci/ios_ci/spm/XcodeSPMCollection.json +29 -0
  324. package/ios-ci/ios_ci/spm/__init__.py +0 -0
  325. package/ios-ci/ios_ci/spm/askpass.py +19 -0
  326. package/ios-ci/ios_ci/spm/spm.py +227 -0
  327. package/ios-ci/ios_ci/upload_build.py +158 -0
  328. package/ios-ci/ios_ci/version.py +14 -0
  329. package/ios-ci/poetry.lock +342 -0
  330. package/ios-ci/pyproject.toml +26 -0
  331. package/ios-ci/scripts.py +9 -0
  332. package/ios-ci/tests/__init__.py +0 -0
  333. package/ios-ci/tests/podspec/fixtures/BTDevice.podspec +17 -0
  334. package/ios-ci/tests/podspec/fixtures/BTDeviceBeta.podspec +17 -0
  335. package/ios-ci/tests/podspec/fixtures/DocumentReaderBeta_RegulaCommon_Beta.podspec +19 -0
  336. package/ios-ci/tests/podspec/fixtures/DocumentReaderBeta_RegulaCommon_Release.podspec +19 -0
  337. package/ios-ci/tests/podspec/fixtures/DocumentReaderFullRFID.podspec +17 -0
  338. package/ios-ci/tests/podspec/fixtures/DocumentReaderFullRFIDBeta.podspec +17 -0
  339. package/ios-ci/tests/podspec/fixtures/DocumentReader_RegulaCommon_Beta.podspec +19 -0
  340. package/ios-ci/tests/podspec/fixtures/DocumentReader_RegulaCommon_Release.podspec +19 -0
  341. package/ios-ci/tests/podspec/fixtures/FaceSDK.podspec +18 -0
  342. package/ios-ci/tests/podspec/fixtures/FaceSDKBeta.podspec +18 -0
  343. package/ios-ci/tests/podspec/fixtures/IRS.podspec +17 -0
  344. package/ios-ci/tests/podspec/fixtures/IRSBeta.podspec +17 -0
  345. package/ios-ci/tests/podspec/fixtures/RegulaCommon.podspec +17 -0
  346. package/ios-ci/tests/podspec/fixtures/RegulaCommonBeta.podspec +17 -0
  347. package/ios-ci/tests/podspec/test_podspec.py +188 -0
  348. package/ios-ci/tests/test_build_index.py +117 -0
  349. package/ios-ci/tests/test_dependency.py +139 -0
  350. package/ios-ci/tests/test_ios_ci.py +5 -0
  351. package/package.json +36 -0
  352. package/plugin.xml +48 -0
  353. package/www/capacitor/customization/camera_position.js +4 -0
  354. package/www/capacitor/customization/customization.js +66 -0
  355. package/www/capacitor/customization/customization_colors.js +233 -0
  356. package/www/capacitor/customization/customization_fonts.js +106 -0
  357. package/www/capacitor/customization/customization_images.js +129 -0
  358. package/www/capacitor/customization/font.js +23 -0
  359. package/www/capacitor/customization/screen_orientation.js +4 -0
  360. package/www/capacitor/detect_faces/detect_face_result.js +38 -0
  361. package/www/capacitor/detect_faces/detect_faces_attribute.js +15 -0
  362. package/www/capacitor/detect_faces/detect_faces_attribute_result.js +20 -0
  363. package/www/capacitor/detect_faces/detect_faces_backend_exception.js +23 -0
  364. package/www/capacitor/detect_faces/detect_faces_config.js +14 -0
  365. package/www/capacitor/detect_faces/detect_faces_exception.js +30 -0
  366. package/www/capacitor/detect_faces/detect_faces_request.js +67 -0
  367. package/www/capacitor/detect_faces/detect_faces_response.js +24 -0
  368. package/www/capacitor/detect_faces/detect_faces_scenario.js +10 -0
  369. package/www/capacitor/face_capture/face_capture_config.js +28 -0
  370. package/www/capacitor/face_capture/face_capture_exception.js +25 -0
  371. package/www/capacitor/face_capture/face_capture_image.js +26 -0
  372. package/www/capacitor/face_capture/face_capture_response.js +17 -0
  373. package/www/capacitor/image_params/output_image_crop.js +21 -0
  374. package/www/capacitor/image_params/output_image_params.js +9 -0
  375. package/www/capacitor/image_params/point.js +14 -0
  376. package/www/capacitor/image_params/rect.js +18 -0
  377. package/www/capacitor/image_params/size.js +9 -0
  378. package/www/capacitor/image_quality/image_quality_characteristic.js +24 -0
  379. package/www/capacitor/image_quality/image_quality_characteristic_name.js +58 -0
  380. package/www/capacitor/image_quality/image_quality_group.js +332 -0
  381. package/www/capacitor/image_quality/image_quality_range.js +26 -0
  382. package/www/capacitor/image_quality/image_quality_result.js +40 -0
  383. package/www/capacitor/index.js +219 -0
  384. package/www/capacitor/init/face_sdk_version.js +16 -0
  385. package/www/capacitor/init/init_config.js +9 -0
  386. package/www/capacitor/init/init_exception.js +29 -0
  387. package/www/capacitor/init/license_exception.js +29 -0
  388. package/www/capacitor/internal/bridge.js +39 -0
  389. package/www/capacitor/internal/cordova.js +17 -0
  390. package/www/capacitor/internal/webpack.config.js +11 -0
  391. package/www/capacitor/liveness/liveness_backend_exception.js +38 -0
  392. package/www/capacitor/liveness/liveness_config.js +54 -0
  393. package/www/capacitor/liveness/liveness_exception.js +35 -0
  394. package/www/capacitor/liveness/liveness_notification.js +34 -0
  395. package/www/capacitor/liveness/liveness_response.js +30 -0
  396. package/www/capacitor/match_faces/compared_face.js +21 -0
  397. package/www/capacitor/match_faces/compared_faces_pair.js +23 -0
  398. package/www/capacitor/match_faces/compared_faces_split.js +22 -0
  399. package/www/capacitor/match_faces/match_faces_backend_exception.js +14 -0
  400. package/www/capacitor/match_faces/match_faces_config.js +12 -0
  401. package/www/capacitor/match_faces/match_faces_detection.js +25 -0
  402. package/www/capacitor/match_faces/match_faces_detection_face.js +28 -0
  403. package/www/capacitor/match_faces/match_faces_exception.js +30 -0
  404. package/www/capacitor/match_faces/match_faces_image.js +25 -0
  405. package/www/capacitor/match_faces/match_faces_request.js +13 -0
  406. package/www/capacitor/match_faces/match_faces_response.js +28 -0
  407. package/www/capacitor/person_database/edit_group_persons_request.js +9 -0
  408. package/www/capacitor/person_database/image_upload.js +16 -0
  409. package/www/capacitor/person_database/pageable_item_list.js +22 -0
  410. package/www/capacitor/person_database/person.js +22 -0
  411. package/www/capacitor/person_database/person_database.js +145 -0
  412. package/www/capacitor/person_database/person_group.js +18 -0
  413. package/www/capacitor/person_database/person_image.js +22 -0
  414. package/www/capacitor/person_database/search_person.js +31 -0
  415. package/www/capacitor/person_database/search_person_detection.js +22 -0
  416. package/www/capacitor/person_database/search_person_image.js +26 -0
  417. package/www/capacitor/person_database/search_person_request.js +17 -0
  418. package/www/cordova.js +3738 -0
  419. package/www/react-native/customization/camera_position.js +4 -0
  420. package/www/react-native/customization/customization.js +66 -0
  421. package/www/react-native/customization/customization_colors.js +233 -0
  422. package/www/react-native/customization/customization_fonts.js +106 -0
  423. package/www/react-native/customization/customization_images.js +129 -0
  424. package/www/react-native/customization/font.js +23 -0
  425. package/www/react-native/customization/screen_orientation.js +4 -0
  426. package/www/react-native/detect_faces/detect_face_result.js +38 -0
  427. package/www/react-native/detect_faces/detect_faces_attribute.js +15 -0
  428. package/www/react-native/detect_faces/detect_faces_attribute_result.js +20 -0
  429. package/www/react-native/detect_faces/detect_faces_backend_exception.js +23 -0
  430. package/www/react-native/detect_faces/detect_faces_config.js +14 -0
  431. package/www/react-native/detect_faces/detect_faces_exception.js +30 -0
  432. package/www/react-native/detect_faces/detect_faces_request.js +67 -0
  433. package/www/react-native/detect_faces/detect_faces_response.js +24 -0
  434. package/www/react-native/detect_faces/detect_faces_scenario.js +10 -0
  435. package/www/react-native/face_capture/face_capture_config.js +28 -0
  436. package/www/react-native/face_capture/face_capture_exception.js +25 -0
  437. package/www/react-native/face_capture/face_capture_image.js +26 -0
  438. package/www/react-native/face_capture/face_capture_response.js +17 -0
  439. package/www/react-native/image_params/output_image_crop.js +21 -0
  440. package/www/react-native/image_params/output_image_params.js +9 -0
  441. package/www/react-native/image_params/point.js +14 -0
  442. package/www/react-native/image_params/rect.js +18 -0
  443. package/www/react-native/image_params/size.js +9 -0
  444. package/www/react-native/image_quality/image_quality_characteristic.js +24 -0
  445. package/www/react-native/image_quality/image_quality_characteristic_name.js +58 -0
  446. package/www/react-native/image_quality/image_quality_group.js +332 -0
  447. package/www/react-native/image_quality/image_quality_range.js +26 -0
  448. package/www/react-native/image_quality/image_quality_result.js +40 -0
  449. package/www/react-native/index.js +219 -0
  450. package/www/react-native/init/face_sdk_version.js +16 -0
  451. package/www/react-native/init/init_config.js +9 -0
  452. package/www/react-native/init/init_exception.js +29 -0
  453. package/www/react-native/init/license_exception.js +29 -0
  454. package/www/react-native/internal/bridge.js +39 -0
  455. package/www/react-native/liveness/liveness_backend_exception.js +38 -0
  456. package/www/react-native/liveness/liveness_config.js +54 -0
  457. package/www/react-native/liveness/liveness_exception.js +35 -0
  458. package/www/react-native/liveness/liveness_notification.js +34 -0
  459. package/www/react-native/liveness/liveness_response.js +30 -0
  460. package/www/react-native/match_faces/compared_face.js +21 -0
  461. package/www/react-native/match_faces/compared_faces_pair.js +23 -0
  462. package/www/react-native/match_faces/compared_faces_split.js +22 -0
  463. package/www/react-native/match_faces/match_faces_backend_exception.js +14 -0
  464. package/www/react-native/match_faces/match_faces_config.js +12 -0
  465. package/www/react-native/match_faces/match_faces_detection.js +25 -0
  466. package/www/react-native/match_faces/match_faces_detection_face.js +28 -0
  467. package/www/react-native/match_faces/match_faces_exception.js +30 -0
  468. package/www/react-native/match_faces/match_faces_image.js +25 -0
  469. package/www/react-native/match_faces/match_faces_request.js +13 -0
  470. package/www/react-native/match_faces/match_faces_response.js +28 -0
  471. package/www/react-native/person_database/edit_group_persons_request.js +9 -0
  472. package/www/react-native/person_database/image_upload.js +16 -0
  473. package/www/react-native/person_database/pageable_item_list.js +22 -0
  474. package/www/react-native/person_database/person.js +22 -0
  475. package/www/react-native/person_database/person_database.js +145 -0
  476. package/www/react-native/person_database/person_group.js +18 -0
  477. package/www/react-native/person_database/person_image.js +22 -0
  478. package/www/react-native/person_database/search_person.js +31 -0
  479. package/www/react-native/person_database/search_person_detection.js +22 -0
  480. package/www/react-native/person_database/search_person_image.js +26 -0
  481. package/www/react-native/person_database/search_person_request.js +17 -0
  482. package/www/types/customization/camera_position.d.ts +4 -0
  483. package/www/types/customization/customization.d.ts +24 -0
  484. package/www/types/customization/customization_colors.d.ts +31 -0
  485. package/www/types/customization/customization_fonts.d.ts +17 -0
  486. package/www/types/customization/customization_images.d.ts +18 -0
  487. package/www/types/customization/font.d.ts +14 -0
  488. package/www/types/customization/screen_orientation.d.ts +4 -0
  489. package/www/types/detect_faces/detect_face_result.d.ts +16 -0
  490. package/www/types/detect_faces/detect_faces_attribute.d.ts +15 -0
  491. package/www/types/detect_faces/detect_faces_attribute_result.d.ts +11 -0
  492. package/www/types/detect_faces/detect_faces_backend_exception.d.ts +15 -0
  493. package/www/types/detect_faces/detect_faces_config.d.ts +19 -0
  494. package/www/types/detect_faces/detect_faces_exception.d.ts +21 -0
  495. package/www/types/detect_faces/detect_faces_request.d.ts +27 -0
  496. package/www/types/detect_faces/detect_faces_response.d.ts +12 -0
  497. package/www/types/detect_faces/detect_faces_scenario.d.ts +10 -0
  498. package/www/types/face_capture/face_capture_config.d.ts +30 -0
  499. package/www/types/face_capture/face_capture_exception.d.ts +17 -0
  500. package/www/types/face_capture/face_capture_image.d.ts +15 -0
  501. package/www/types/face_capture/face_capture_response.d.ts +9 -0
  502. package/www/types/image_params/output_image_crop.d.ts +25 -0
  503. package/www/types/image_params/output_image_params.d.ts +13 -0
  504. package/www/types/image_params/point.d.ts +6 -0
  505. package/www/types/image_params/rect.d.ts +8 -0
  506. package/www/types/image_params/size.d.ts +6 -0
  507. package/www/types/image_quality/image_quality_characteristic.d.ts +4 -0
  508. package/www/types/image_quality/image_quality_characteristic_name.d.ts +58 -0
  509. package/www/types/image_quality/image_quality_group.d.ts +155 -0
  510. package/www/types/image_quality/image_quality_range.d.ts +8 -0
  511. package/www/types/image_quality/image_quality_result.d.ts +30 -0
  512. package/www/types/index.d.ts +159 -0
  513. package/www/types/init/face_sdk_version.d.ts +7 -0
  514. package/www/types/init/init_config.d.ts +7 -0
  515. package/www/types/init/init_exception.d.ts +20 -0
  516. package/www/types/init/license_exception.d.ts +21 -0
  517. package/www/types/liveness/liveness_backend_exception.d.ts +30 -0
  518. package/www/types/liveness/liveness_config.d.ts +56 -0
  519. package/www/types/liveness/liveness_exception.d.ts +26 -0
  520. package/www/types/liveness/liveness_notification.d.ts +28 -0
  521. package/www/types/liveness/liveness_response.d.ts +18 -0
  522. package/www/types/match_faces/compared_face.d.ts +11 -0
  523. package/www/types/match_faces/compared_faces_pair.d.ts +12 -0
  524. package/www/types/match_faces/compared_faces_split.d.ts +8 -0
  525. package/www/types/match_faces/match_faces_backend_exception.d.ts +6 -0
  526. package/www/types/match_faces/match_faces_config.d.ts +14 -0
  527. package/www/types/match_faces/match_faces_detection.d.ts +12 -0
  528. package/www/types/match_faces/match_faces_detection_face.d.ts +13 -0
  529. package/www/types/match_faces/match_faces_exception.d.ts +21 -0
  530. package/www/types/match_faces/match_faces_image.d.ts +16 -0
  531. package/www/types/match_faces/match_faces_request.d.ts +18 -0
  532. package/www/types/match_faces/match_faces_response.d.ts +12 -0
  533. package/www/types/person_database/edit_group_persons_request.d.ts +8 -0
  534. package/www/types/person_database/image_upload.d.ts +6 -0
  535. package/www/types/person_database/pageable_item_list.d.ts +7 -0
  536. package/www/types/person_database/person.d.ts +10 -0
  537. package/www/types/person_database/person_database.d.ts +92 -0
  538. package/www/types/person_database/person_group.d.ts +8 -0
  539. package/www/types/person_database/person_image.d.ts +10 -0
  540. package/www/types/person_database/search_person.d.ts +15 -0
  541. package/www/types/person_database/search_person_detection.d.ts +11 -0
  542. package/www/types/person_database/search_person_image.d.ts +12 -0
  543. package/www/types/person_database/search_person_request.d.ts +15 -0
package/ios/RFSWMain.h ADDED
@@ -0,0 +1,23 @@
1
+ #import "RFSWJSONConstructor.h"
2
+ @import FaceSDK;
3
+
4
+ typedef void (^RFSWCallback)(id _Nullable response);
5
+ typedef void (^RFSWEventSender)(NSString* _Nonnull event, id _Nullable data);
6
+
7
+ @interface RFSWMain: NSObject<RFSURLRequestInterceptingDelegate,
8
+ RFSVideoUploadingDelegate,
9
+ RFSCustomizationActionDelegate,
10
+ RFSFaceCaptureDelegate,
11
+ RFSLivenessDelegate>
12
+
13
+ +(void)methodCall:(NSString* _Nonnull)method
14
+ :(NSArray* _Nonnull)args
15
+ :(RFSWCallback _Nonnull)callback
16
+ :(RFSWEventSender _Nonnull)eventSender;
17
+
18
+ @end
19
+
20
+ static NSString* _Nonnull RFSWCameraSwitchEvent = @"cameraSwitchEvent";
21
+ static NSString* _Nonnull RFSWLivenessNotificationEvent = @"livenessNotificationEvent";
22
+ static NSString* _Nonnull RFSWVideoEncoderCompletionEvent = @"video_encoder_completion";
23
+ static NSString* _Nonnull RFSWOnCustomButtonTappedEvent = @"onCustomButtonTappedEvent";
package/ios/RFSWMain.m ADDED
@@ -0,0 +1,352 @@
1
+ #import "RFSWMain.h"
2
+
3
+ @implementation RFSWMain
4
+
5
+ RFSWMain* RFSWSelf;
6
+ RFSWEventSender RFSWSendEvent;
7
+
8
+ NSDictionary* RFSWheaders;
9
+
10
+ +(void)methodCall:(NSString*)method :(NSArray*)args :(RFSWCallback)callback :(RFSWEventSender)eventSender {
11
+ if(!RFSWSelf) RFSWSelf = [RFSWMain new];
12
+ RFSWSendEvent = eventSender;
13
+ NSDictionary* Switch = @{
14
+ @"getVersion": ^{ [self getVersion :callback]; },
15
+ @"getServiceUrl": ^{ [self getServiceUrl :callback]; },
16
+ @"setServiceUrl": ^{ [self setServiceUrl :args[0] :callback]; },
17
+ @"setLocalizationDictionary": ^{ [self setLocalizationDictionary :args[0]]; },
18
+ @"setRequestHeaders": ^{ [self setRequestHeaders :args[0]]; },
19
+ @"setCustomization": ^{ [self setCustomization :args[0]]; },
20
+ @"isInitialized": ^{ [self isInitialized :callback]; },
21
+ @"initialize": ^{ [self initialize :args[0] :callback]; },
22
+ @"deinitialize": ^{ [self deinitialize]; },
23
+ @"startFaceCapture": ^{ [self startFaceCapture :args[0] :callback]; },
24
+ @"stopFaceCapture": ^{ [self stopFaceCapture]; },
25
+ @"startLiveness": ^{ [self startLiveness :args[0] :callback]; },
26
+ @"stopLiveness": ^{ [self stopLiveness]; },
27
+ @"matchFaces": ^{ [self matchFaces :args[0] :args[1] :callback]; },
28
+ @"splitComparedFaces": ^{ [self splitComparedFaces :args[0] :args[1] :callback]; },
29
+ @"detectFaces": ^{ [self detectFaces :args[0] :callback]; },
30
+ @"createPerson": ^{ [self createPerson :args[0] :args[1] :args[2] :callback]; },
31
+ @"updatePerson": ^{ [self updatePerson :args[0] :callback]; },
32
+ @"deletePerson": ^{ [self deletePerson :args[0] :callback]; },
33
+ @"getPerson": ^{ [self getPerson :args[0] :callback]; },
34
+ @"addPersonImage": ^{ [self addPersonImage :args[0] :args[1] :callback]; },
35
+ @"deletePersonImage": ^{ [self deletePersonImage :args[0] :args[1] :callback]; },
36
+ @"getPersonImage": ^{ [self getPersonImage :args[0] :args[1] :callback]; },
37
+ @"getPersonImages": ^{ [self getPersonImages :args[0] :callback]; },
38
+ @"getPersonImagesForPage": ^{ [self getPersonImagesForPage :args[0] :args[1] :args[2] :callback]; },
39
+ @"createGroup": ^{ [self createGroup :args[0] :args[1] :callback]; },
40
+ @"updateGroup": ^{ [self updateGroup :args[0] :callback]; },
41
+ @"editPersonsInGroup": ^{ [self editPersonsInGroup :args[0] :args[1] :callback]; },
42
+ @"deleteGroup": ^{ [self deleteGroup :args[0] :callback]; },
43
+ @"getGroup": ^{ [self getGroup :args[0] :callback]; },
44
+ @"getGroups": ^{ [self getGroups :callback]; },
45
+ @"getGroupsForPage": ^{ [self getGroupsForPage :args[0] :args[1] :callback]; },
46
+ @"getPersonGroups": ^{ [self getPersonGroups :args[0] :callback]; },
47
+ @"getPersonGroupsForPage": ^{ [self getPersonGroupsForPage :args[0] :args[1] :args[2] :callback]; },
48
+ @"getPersonsInGroup": ^{ [self getPersonsInGroup :args[0] :callback]; },
49
+ @"getPersonsInGroupForPage": ^{ [self getPersonsInGroupForPage :args[0] :args[1] :args[2] :callback]; },
50
+ @"searchPerson": ^{ [self searchPerson :args[0] :callback]; },
51
+ };
52
+ ((void(^)(void))Switch[method])();
53
+ }
54
+
55
+ +(void)getVersion:(RFSWCallback)callback {
56
+ callback([RFSWJSONConstructor generateFaceSDKVersion:RFSFaceSDK.service.version]);
57
+ }
58
+
59
+ +(void)getServiceUrl:(RFSWCallback)callback {
60
+ callback([RFSFaceSDK.service serviceURL]);
61
+ }
62
+
63
+ +(void)setServiceUrl:(NSString*)url :(RFSWCallback)callback {
64
+ [RFSFaceSDK.service setServiceURL:url];
65
+ callback(@"");
66
+ }
67
+
68
+ +(void)setLocalizationDictionary:(NSDictionary*)dictionary {
69
+ RFSFaceSDK.service.localizationHandler = ^NSString* (NSString* localizationKey) {
70
+ if (dictionary[localizationKey]) return dictionary[localizationKey];
71
+ return nil;
72
+ };
73
+ }
74
+
75
+ +(void)setRequestHeaders:(NSDictionary*)headersDict {
76
+ RFSWheaders = headersDict;
77
+ RFSFaceSDK.service.requestInterceptingDelegate = RFSWSelf;
78
+ }
79
+
80
+ -(NSURLRequest*)interceptorPrepareRequest:(NSURLRequest*)request {
81
+ NSMutableURLRequest *interceptedRequest = [request mutableCopy];
82
+ for (NSString* key in RFSWheaders.allKeys)
83
+ [interceptedRequest addValue:[RFSWheaders valueForKey:key] forHTTPHeaderField:key];
84
+ return interceptedRequest;
85
+ }
86
+
87
+ +(void)setCustomization:(NSDictionary*)config {
88
+ [RFSWConfig setCustomization:config :RFSFaceSDK.service.customization];
89
+ }
90
+
91
+ +(void)isInitialized:(RFSWCallback)callback {
92
+ callback(@([RFSFaceSDK.service isInitialized]));
93
+ }
94
+
95
+ +(void)initialize:(NSDictionary*)config :(RFSWCallback)callback {
96
+ [RFSFaceSDK.service initializeWithConfiguration:[RFSWJSONConstructor initConfigFromJSON:config]
97
+ completion:[RFSWMain initCompletion:callback]];
98
+ }
99
+
100
+ +(void)deinitialize {
101
+ [RFSFaceSDK.service deinitialize];
102
+ }
103
+
104
+ +(void)startFaceCapture:(NSDictionary*)config :(RFSWCallback)callback {
105
+ dispatch_async(dispatch_get_main_queue(), ^{
106
+ [RFSFaceSDK.service presentFaceCaptureViewControllerFrom:[UIApplication sharedApplication].windows.lastObject.rootViewController
107
+ animated:true
108
+ configuration:[RFSWConfig faceCaptureConfigFromJSON:config]
109
+ onCapture:[self faceCaptureCompletion:callback]
110
+ completion:nil];
111
+ });
112
+ }
113
+
114
+ +(void)stopFaceCapture {
115
+ [RFSFaceSDK.service stopFaceCaptureViewController];
116
+ }
117
+
118
+ +(void)startLiveness:(NSDictionary*)config :(RFSWCallback)callback {
119
+ dispatch_async(dispatch_get_main_queue(), ^{
120
+ [RFSFaceSDK.service startLivenessFrom:[UIApplication sharedApplication].windows.lastObject.rootViewController
121
+ animated:true
122
+ configuration:[RFSWConfig livenessConfigFromJSON:config]
123
+ onLiveness:[self livenessCompletion:callback]
124
+ completion:nil];
125
+ });
126
+ }
127
+
128
+ +(void)stopLiveness {
129
+ [RFSFaceSDK.service stopLivenessProcessing];
130
+ }
131
+
132
+ +(void)matchFaces:(NSDictionary*)request :(NSDictionary*)config :(RFSWCallback)callback {
133
+ [RFSFaceSDK.service matchFaces:[RFSWJSONConstructor matchFacesRequestFromJSON:request]
134
+ configuration:[RFSWConfig matchFacesConfigFromJSON:config]
135
+ completion:[self matchFacesCompletion:callback]];
136
+ }
137
+
138
+ +(void)splitComparedFaces:(NSArray*)faces :(NSNumber*)similarity :(RFSWCallback)callback {
139
+ NSArray* array = [RFSWJSONConstructor arrayFromJSON:faces :@selector(comparedFacesPairFromJSON:)];
140
+ RFSMatchFacesSimilarityThresholdSplit *split = [RFSMatchFacesSimilarityThresholdSplit splitPairs:array bySimilarityThreshold:similarity];
141
+ callback([RFSWJSONConstructor generateComparedFacesSplit:split]);
142
+ }
143
+
144
+ +(void)detectFaces:(NSDictionary*)request :(RFSWCallback)callback {
145
+ [RFSFaceSDK.service detectFacesByRequest:[RFSWJSONConstructor detectFacesRequestFromJSON:request]
146
+ completion:[self detectFacesCompletion:callback]];
147
+ }
148
+
149
+ +(void)createPerson:(NSString*)name :(NSDictionary*)metadata :(NSArray<NSString*>*)groupIds :(RFSWCallback)callback {
150
+ [RFSFaceSDK.service.personDatabase createPersonWithName:name
151
+ metadata:metadata
152
+ groupIds:groupIds
153
+ completion:[self databaseItemCompletion :callback :@selector(generatePerson:)]];
154
+ }
155
+
156
+ +(void)updatePerson:(NSDictionary*)person :(RFSWCallback)callback {
157
+ [RFSFaceSDK.service.personDatabase getPersonByPersonId:[RFSWJSONConstructor idFromJSON:person] completion:^(RFSItemResponse<RFSPerson *> * response) {
158
+ if (response.error) callback([RFSWJSONConstructor generatePersonDBResponse:nil :response.error]);
159
+ else [RFSFaceSDK.service.personDatabase updatePerson:[RFSWJSONConstructor updatePersonFromJSON:response.item :person]
160
+ completion:[self databaseCompletion:callback]];
161
+ }];
162
+ }
163
+
164
+ +(void)deletePerson:(NSString*)personId :(RFSWCallback)callback {
165
+ [RFSFaceSDK.service.personDatabase deletePersonByPersonId:personId
166
+ completion:[self databaseCompletion:callback]];
167
+ }
168
+
169
+ +(void)getPerson:(NSString*)personId :(RFSWCallback)callback {
170
+ [RFSFaceSDK.service.personDatabase getPersonByPersonId:personId
171
+ completion:[self databaseItemCompletion :callback :@selector(generatePerson:)]];
172
+ }
173
+
174
+ +(void)addPersonImage:(NSString*)personId :(NSDictionary*)image :(RFSWCallback)callback {
175
+ [RFSFaceSDK.service.personDatabase addPersonImageByPersonId:personId
176
+ imageUpload:[RFSWJSONConstructor imageUploadFromJSON:image]
177
+ completion:[self databaseItemCompletion :callback :@selector(generatePersonImage:)]];
178
+ }
179
+
180
+ +(void)deletePersonImage:(NSString*)personId :(NSString*)imageId :(RFSWCallback)callback {
181
+ [RFSFaceSDK.service.personDatabase deletePersonImageByPersonId:personId
182
+ imageId: imageId
183
+ completion:[self databaseCompletion:callback]];
184
+ }
185
+
186
+ +(void)getPersonImage:(NSString*)personId :(NSString*)imageId :(RFSWCallback)callback {
187
+ [RFSFaceSDK.service.personDatabase getPersonImageByPersonId:personId imageId:imageId completion:^(RFSDataResponse* response) {
188
+ callback([RFSWJSONConstructor generatePersonDBResponse:[RFSWJSONConstructor base64Encode:response.data] :response.error]);
189
+ }];
190
+ }
191
+
192
+ +(void)getPersonImages:(NSString*)personId :(RFSWCallback)callback {
193
+ [RFSFaceSDK.service.personDatabase getPersonImagesByPersonId:personId
194
+ completion:[self databasePageCompletion :callback :@selector(generatePersonImage:)]];
195
+ }
196
+
197
+ +(void)getPersonImagesForPage:(NSString*)personId :(NSNumber*)page :(NSNumber*)size :(RFSWCallback)callback {
198
+ [RFSFaceSDK.service.personDatabase getPersonImagesByPersonId:personId
199
+ page:[page integerValue]
200
+ size:[size integerValue]
201
+ completion:[self databasePageCompletion :callback :@selector(generatePersonImage:)]];
202
+ }
203
+
204
+ +(void)createGroup:(NSString*)name :(NSDictionary*)metadata :(RFSWCallback)callback {
205
+ [RFSFaceSDK.service.personDatabase createGroupWithName:name
206
+ metadata:metadata
207
+ completion:[self databaseItemCompletion :callback :@selector(generatePersonGroup:)]];
208
+ }
209
+
210
+ +(void)updateGroup:(NSDictionary*)group :(RFSWCallback)callback {
211
+ [RFSFaceSDK.service.personDatabase getGroupByGroupId:[RFSWJSONConstructor idFromJSON:group] completion:^(RFSItemResponse<RFSPersonGroup *> * response) {
212
+ if (response.error) callback([RFSWJSONConstructor generatePersonDBResponse:nil :response.error]);
213
+ else [RFSFaceSDK.service.personDatabase updateGroup:[RFSWJSONConstructor updatePersonGroupFromJSON:response.item :group]
214
+ completion:[self databaseCompletion:callback]];
215
+ }];
216
+ }
217
+
218
+ +(void)editPersonsInGroup:(NSString*)groupId :(NSDictionary*)editGroupPersonsRequest :(RFSWCallback)callback {
219
+ [RFSFaceSDK.service.personDatabase editGroupPersonsByGroupId:groupId
220
+ request:[RFSWJSONConstructor editGroupPersonsRequestFromJSON:editGroupPersonsRequest]
221
+ completion:[self databaseCompletion:callback]];
222
+ }
223
+
224
+ +(void)deleteGroup:(NSString*)groupId :(RFSWCallback)callback {
225
+ [RFSFaceSDK.service.personDatabase deleteGroupByGroupId:groupId
226
+ completion:[self databaseCompletion:callback]];
227
+ }
228
+
229
+ +(void)getGroup:(NSString*)groupId :(RFSWCallback)callback {
230
+ [RFSFaceSDK.service.personDatabase getGroupByGroupId:groupId
231
+ completion:[self databaseItemCompletion :callback :@selector(generatePersonGroup:)]];
232
+ }
233
+
234
+ +(void)getGroups:(RFSWCallback)callback {
235
+ [RFSFaceSDK.service.personDatabase getGroups:[self databasePageCompletion :callback :@selector(generatePersonGroup:)]];
236
+ }
237
+
238
+ +(void)getGroupsForPage:(NSNumber*)page :(NSNumber*)size :(RFSWCallback)callback {
239
+ [RFSFaceSDK.service.personDatabase getGroupsForPage:[page integerValue]
240
+ size:[size integerValue]
241
+ completion:[self databasePageCompletion :callback :@selector(generatePersonGroup:)]];
242
+ }
243
+
244
+ +(void)getPersonGroups:(NSString*)personId :(RFSWCallback)callback {
245
+ [RFSFaceSDK.service.personDatabase getPersonGroupsByPersonId:personId
246
+ completion:[self databasePageCompletion :callback :@selector(generatePersonGroup:)]];
247
+ }
248
+
249
+ +(void)getPersonGroupsForPage:(NSString*)personId :(NSNumber*)page :(NSNumber*)size :(RFSWCallback)callback {
250
+ [RFSFaceSDK.service.personDatabase getPersonGroupsByPersonId:personId
251
+ page:[page integerValue]
252
+ size:[size integerValue]
253
+ completion:[self databasePageCompletion :callback :@selector(generatePersonGroup:)]];
254
+ }
255
+
256
+ +(void)getPersonsInGroup:(NSString*)groupId :(RFSWCallback)callback {
257
+ [RFSFaceSDK.service.personDatabase getGroupPersonsByGroupId:groupId
258
+ completion:[self databasePageCompletion :callback :@selector(generatePerson:)]];
259
+ }
260
+
261
+ +(void)getPersonsInGroupForPage:(NSString*)groupId :(NSNumber*)page :(NSNumber*)size :(RFSWCallback)callback {
262
+ [RFSFaceSDK.service.personDatabase getGroupPersonsByGroupId:groupId
263
+ page:[page integerValue]
264
+ size:[size integerValue]
265
+ completion:[self databasePageCompletion :callback :@selector(generatePerson:)]];
266
+ }
267
+
268
+ +(void)searchPerson:(NSDictionary*)searchPersonRequest :(RFSWCallback)callback {
269
+ [RFSFaceSDK.service.personDatabase searchPerson:[RFSWJSONConstructor searchPersonRequestFromJSON:searchPersonRequest]
270
+ completion:^(RFSSearchPersonResponse *response) {
271
+ callback([RFSWJSONConstructor generatePersonDBResponse:[RFSWJSONConstructor generateArray:response.results :@selector(generateSearchPerson:)] :response.error]);
272
+ }];
273
+ }
274
+
275
+ +(RFSInitializationCompletion)initCompletion:(RFSWCallback)callback {
276
+ return ^(BOOL success, NSError* error) {
277
+ RFSFaceSDK.service.customization.configuration = [RFSUIConfiguration defaultConfiguration];
278
+ [RFSFaceSDK.service setVideoUploadingDelegate:RFSWSelf];
279
+ [RFSFaceSDK.service setFaceCaptureDelegate:RFSWSelf];
280
+ [RFSFaceSDK.service setLivenessDelegate:RFSWSelf];
281
+ RFSFaceSDK.service.customization.actionDelegate = RFSWSelf;
282
+ callback([RFSWJSONConstructor generateInitCompletion:success :error]);
283
+ };
284
+ }
285
+
286
+ +(void (^)(RFSFaceCaptureResponse*)) faceCaptureCompletion:(RFSWCallback)callback {
287
+ return ^(RFSFaceCaptureResponse* response) {
288
+ callback([RFSWJSONConstructor generateFaceCaptureResponse:response]);
289
+ };
290
+ }
291
+
292
+ +(void (^)(RFSLivenessResponse*)) livenessCompletion:(RFSWCallback)callback {
293
+ return ^(RFSLivenessResponse* response) {
294
+ callback([RFSWJSONConstructor generateLivenessResponse:response]);
295
+ };
296
+ }
297
+
298
+ +(void (^)(RFSMatchFacesResponse*)) matchFacesCompletion:(RFSWCallback)callback {
299
+ return ^(RFSMatchFacesResponse* response) {
300
+ callback([RFSWJSONConstructor generateMatchFacesResponse:response]);
301
+ };
302
+ }
303
+
304
+ +(void (^)(RFSDetectFacesResponse*)) detectFacesCompletion:(RFSWCallback)callback {
305
+ return ^(RFSDetectFacesResponse* response) {
306
+ callback([RFSWJSONConstructor generateDetectFacesResponse:response]);
307
+ };
308
+ }
309
+
310
+ +(void (^)(RFSComfirmResponse *response))databaseCompletion:(RFSWCallback)callback {
311
+ return ^(RFSComfirmResponse *response) {
312
+ callback([RFSWJSONConstructor generatePersonDBResponse:@YES :response.error]);
313
+ };
314
+ }
315
+
316
+ +(void (^)(RFSItemResponse<RFSDBBaseItem *> *response))databaseItemCompletion:(RFSWCallback)callback :(SEL)toJson {
317
+ return ^(RFSItemResponse<RFSDBBaseItem *> *response) {
318
+ callback([RFSWJSONConstructor generatePersonDBResponse:[RFSWJSONConstructor performSelector:toJson withObject:response.item] :response.error]);
319
+ };
320
+ }
321
+
322
+ +(void (^)(RFSPageResponse<RFSDBBaseItem *> *response))databasePageCompletion:(RFSWCallback)callback :(SEL)toJson {
323
+ return ^(RFSPageResponse<RFSDBBaseItem *> *response) {
324
+ callback([RFSWJSONConstructor generatePersonDBResponse:@{
325
+ @"items": [RFSWJSONConstructor generateArray:response.items :toJson],
326
+ @"page": @(response.page),
327
+ @"totalPages": @(response.totalPages),
328
+ } :response.error]);
329
+ };
330
+ }
331
+
332
+ // RFSFaceCaptureDelegate & RFSLivenessDelegate
333
+ -(void)cameraPositionChanged:(RFSCameraPosition)cameraPosition {
334
+ RFSWSendEvent(RFSWCameraSwitchEvent, @(cameraPosition));
335
+ }
336
+
337
+ // RFSLivenessDelegate
338
+ -(void)processStatusChanged:(RFSLivenessProcessStatus)status result:(RFSLivenessResponse*)result {
339
+ RFSWSendEvent(RFSWLivenessNotificationEvent, [RFSWJSONConstructor generateLivenessNotification:status result:result]);
340
+ }
341
+
342
+ // RFSVideoUploadingDelegate
343
+ -(void)videoUploadingForTransactionId:(NSString*)transactionId didFinishedWithSuccess:(BOOL)success {
344
+ RFSWSendEvent(RFSWVideoEncoderCompletionEvent, [RFSWJSONConstructor generateVideoEncoderCompletion:transactionId :success]);
345
+ }
346
+
347
+ // RFSCustomizationActionDelegate
348
+ -(void)onFaceCustomButtonTappedWithTag:(NSInteger)tag {
349
+ RFSWSendEvent(RFSWOnCustomButtonTappedEvent, @(tag));
350
+ }
351
+
352
+ @end
@@ -0,0 +1,8 @@
1
+ #import <React/RCTBridgeModule.h>
2
+ #import <React/RCTEventEmitter.h>
3
+ #import "RFSWMain.h"
4
+ @import UIKit;
5
+
6
+ @interface RNFaceSDK : RCTEventEmitter <RCTBridgeModule>
7
+
8
+ @end
@@ -0,0 +1,42 @@
1
+ #import "RNFaceSDK.h"
2
+
3
+ RNFaceSDK* RFSWPlugin;
4
+ @implementation RNFaceSDK
5
+ RCT_EXPORT_MODULE();
6
+
7
+ NSMutableArray<RCTResponseSenderBlock>* _firedCallbacks = nil;
8
+ - (NSMutableArray<RCTResponseSenderBlock>*)firedCallbacks {
9
+ if (_firedCallbacks == nil) _firedCallbacks = @[].mutableCopy;
10
+ return _firedCallbacks;
11
+ }
12
+
13
+ - (NSArray<NSString*>*)supportedEvents {
14
+ return @[RFSWCameraSwitchEvent,
15
+ RFSWLivenessNotificationEvent,
16
+ RFSWVideoEncoderCompletionEvent,
17
+ RFSWOnCustomButtonTappedEvent];
18
+ }
19
+
20
+ bool hasListeners;
21
+ - (void)startObserving { hasListeners = YES; }
22
+ - (void)stopObserving { hasListeners = NO; }
23
+
24
+ RCT_EXPORT_METHOD(exec:(NSString*)method:(NSArray*)args:(RCTPromiseResolveBlock)resolve:(RCTPromiseRejectBlock)reject) {
25
+ RFSWPlugin = self;
26
+
27
+ RFSWCallback callback = ^(id _Nullable data) {
28
+ if ([self.firedCallbacks containsObject:resolve]) return;
29
+ [self.firedCallbacks addObject:resolve];
30
+ resolve([RFSWJSONConstructor toSendable:data]);
31
+ };
32
+
33
+ RFSWEventSender sendEvent = ^(NSString* event, id data) {
34
+ dispatch_async(dispatch_get_main_queue(), ^{
35
+ if (hasListeners) [RFSWPlugin sendEventWithName:event body:[RFSWJSONConstructor toSendable:data]];
36
+ });
37
+ };
38
+
39
+ [RFSWMain methodCall:method :args :callback :sendEvent];
40
+ }
41
+
42
+ @end
@@ -0,0 +1,41 @@
1
+ # Official language image. Look for the different tagged releases at:
2
+ # https://hub.docker.com/r/library/python/tags/
3
+ image: python:latest
4
+
5
+ # Change pip's cache directory to be inside the project directory since we can
6
+ # only cache local items.
7
+ variables:
8
+ PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
9
+
10
+ # Pip's cache doesn't store the python packages
11
+ # https://pip.pypa.io/en/stable/reference/pip_install/#caching
12
+ #
13
+ # If you want to also cache the installed packages, you have to install
14
+ # them in a virtualenv and cache it as well.
15
+ cache:
16
+ paths:
17
+ - .cache/pip
18
+ - venv/
19
+
20
+ before_script:
21
+ - python -V # Print out python version for debugging
22
+ - pip install virtualenv
23
+ - virtualenv venv
24
+ - source venv/bin/activate
25
+ - pip install poetry
26
+ - poetry install
27
+
28
+ stages:
29
+ - build
30
+ - test
31
+
32
+ build-job:
33
+ stage: build
34
+ script:
35
+ - poetry build
36
+
37
+ unit-test-job:
38
+ stage: test
39
+ script:
40
+ - poetry run pytest
41
+
@@ -0,0 +1,22 @@
1
+ # This is a sample .env file for use in local development.
2
+ # Duplicate this file as .env in the root of the project
3
+ # and update the environment variables to match your needs.
4
+
5
+ # Overrides FTP host for Temp uploads.
6
+ # This is usefull when you are under a VPN and the FTP host is different.
7
+ LOCAL_FTP_RENAME=
8
+
9
+ # Credentials for public github repositories access. Needed for updating SPM manifests.
10
+ GITHUB_USERNAME=
11
+ GITHUB_PASSWORD=
12
+
13
+ # Credentials for public pods FTP.
14
+ PUBLIC_UPLOAD_FTP_USERNAME=
15
+ PUBLIC_UPLOAD_FTP_PASSWORD=
16
+
17
+ # Credentials for private pods FTP.
18
+ PRIVATE_UPLOAD_FTP_USERNAME=
19
+ PRIVATE_UPLOAD_FTP_PASSWORD=
20
+
21
+ # Sets how many times inject-dependency will retry to redownload a dependency when unzip fails.
22
+ IOS_CI_DEPENDENCY_DOWNLOAD_ATTEMPTS=
@@ -0,0 +1,97 @@
1
+ # iOS CI
2
+ Collection of tools related to Continuous Integration for iOS Platform
3
+
4
+ ## Dependencies
5
+ We manage our dependencies with [Poetry](!https://python-poetry.org/docs/#osx--linux--bashonwindows-install-instructions).
6
+
7
+ Make sure to install `poetry` and dependencies before using `ios-ci`.
8
+ ```bash
9
+ poetry install
10
+ ```
11
+
12
+ ## Configuration
13
+
14
+ The app supports `.env` configuration.
15
+ Please see `.sample-env` for more information on the environment variables.
16
+
17
+ ## Installation
18
+
19
+ You can install the package globally as an executable and run `ci [command]` instead of `poetry run ci [command]`.
20
+ This may be usefull when you dont want to have this project as a working directory for calling the commands.
21
+
22
+ The script will build the project and install it using pip3.
23
+ ```bash
24
+ bash install.sh
25
+ ```
26
+
27
+ ## Commands
28
+ The CLI supports help description of the options.
29
+ Run the command with `-h` or `--help` to get more information.
30
+ ```bash
31
+ poetry run ci --help
32
+ ```
33
+
34
+ ### Inject dependency
35
+ Downloads and unzips specified dependency.
36
+
37
+ Supports exact version and `+`.
38
+ Finds the most appropriate location for the framework to store if the directory is not specified explicitly.
39
+ If there is a Pods directory - the dependency will be injected there.
40
+ Otherwise the location is the root of the host project.
41
+
42
+ ```bash
43
+ poetry run ci inject-dependency --help
44
+ poetry run ci inject-dependency -n FaceSDK -v + -t Release -d ./Dependency
45
+ poetry run ci inject-dependency -n RegulaCommon -v + -t Release
46
+ poetry run ci inject-dependency -n fullrfid -v + -t Temp -b develop
47
+ ```
48
+
49
+
50
+ ### FTP Upload
51
+ Determines the ftp location (private or public FTP server) by the name and the version of a package.
52
+ Creates `.zip` archive and upload the build to the server.
53
+
54
+ Prompts the user with credentials for the FTP server.
55
+ To skip the interaction please specify environment variables:
56
+ ```
57
+ PUBLIC_UPLOAD_FTP_USERNAME
58
+ PUBLIC_UPLOAD_FTP_PASSWORD
59
+ PRIVATE_UPLOAD_FTP_USERNAME
60
+ PRIVATE_UPLOAD_FTP_PASSWORD
61
+ ```
62
+
63
+ ```bash
64
+ poetry run ci ftp-upload --help
65
+ poetry run ci ftp-upload -n BTDevice -v 0.1.0 -t Temp -p ./temp/BTDevice.framework
66
+ poetry run ci ftp-upload -n FaceSDK -v 0.1.0 -t Beta -p ../Build/FaceSDK.xcframework
67
+ ```
68
+
69
+ ### Depdendency Version
70
+ Fetches the version of a dependency by the name and the type.
71
+
72
+ ```bash
73
+ poetry run ci dependency-version --help
74
+ poetry run ci dependency-version -n fullrfid -t Beta
75
+ poetry run ci dependency-version -n FaceSDK -t Beta
76
+ poetry run ci dependency-version -n RegulaCommon -t Temp -b develop
77
+ ```
78
+
79
+
80
+ ### Publish SwiftPackage Manifest
81
+ Updates the `SPM` repository manifest with provided version and `.zip` archived build.
82
+
83
+ ```bash
84
+ poetry run ci update-spm --help
85
+ poetry run ci update-spm -v 3.0.799 -f ../Build/FaceSDK.xcframework.zip -r https://github.com/regulaforensics/FaceSDK-Swift-Package
86
+ ```
87
+
88
+ ### Create .podspec file
89
+ Creates a `.podspec` file for a package at a given location with a dependency.
90
+ Packages such as `FaceSDK`, `DocumentReader` and `IRS` require specifying a dependency.
91
+
92
+ ```bash
93
+
94
+ poetry run ci create-podspec --help
95
+ poetry run ci create-podspec -n FaceSDK -v "1.0.3" -t Release --d RegulaCommon Temp 1.1.1
96
+ poetry run ci create-podspec -n FaceSDK -v "1.0.3" -t Release --d RegulaCommon 1.1.1 Release -d ../
97
+ ```
@@ -0,0 +1,34 @@
1
+ // swift-tools-version:5.3
2
+ // The swift-tools-version declares the minimum version of Swift required to build this package.
3
+
4
+ import PackageDescription
5
+
6
+ let package = Package(
7
+ name: "RegulaDanger",
8
+ products: [
9
+ // Products define the executables and libraries a package produces, and make them visible to other packages.
10
+ .library(
11
+ name: "RegulaDanger",
12
+ targets: ["RegulaDanger"]
13
+ ),
14
+ ],
15
+ dependencies: [
16
+ // Dependencies declare other packages that this package depends on.
17
+ // .package(url: /* package url */, from: "1.0.0"),
18
+ .package(name: "danger-swift", url: "https://github.com/danger/swift", .upToNextMinor(from: "3.12.0"))
19
+ ],
20
+ targets: [
21
+ // Targets are the basic building blocks of a package. A target can define a module or a test suite.
22
+ // Targets can depend on other targets in this package, and on products in packages this package depends on.
23
+ .target(
24
+ name: "RegulaDanger",
25
+ dependencies: [
26
+ .product(name: "Danger", package: "danger-swift")
27
+ ]
28
+ ),
29
+ .testTarget(
30
+ name: "RegulaDangerTests",
31
+ dependencies: ["RegulaDanger"]
32
+ ),
33
+ ]
34
+ )
@@ -0,0 +1,44 @@
1
+ import Danger
2
+ import Foundation
3
+
4
+ public enum RegulaDanger {
5
+ public static func lint(using danger: DangerDSL = Danger(), rootSourceFolderName: String = "Sources") {
6
+ validateFiles(using: danger, rootSourceFolderName: rootSourceFolderName)
7
+ validateMegeRequest(using: danger)
8
+
9
+ if danger.hasReports {
10
+ danger.message("Reported by [Regula's iOS-CI](http://gitlab.regula.local/mobile-sdk/ios-ci).")
11
+ }
12
+ }
13
+
14
+ static func validateFiles(using danger: DangerDSL, rootSourceFolderName: String) {
15
+ let allFiles = Set(danger.git.createdFiles).union(danger.git.modifiedFiles)
16
+
17
+ let changelogChanged = allFiles.contains("CHANGELOG.md")
18
+ let sourceChanges = allFiles.first(where: { $0.hasPrefix(rootSourceFolderName) })
19
+ if !changelogChanged && sourceChanges != nil {
20
+ warn("No CHANGELOG entry added.")
21
+ }
22
+ }
23
+
24
+ static func validateMegeRequest(using danger: DangerDSL) {
25
+ guard let mr = danger.gitLab?.mergeRequest else {
26
+ print("There is no gitlab.")
27
+ return
28
+ }
29
+
30
+ if !mr.description.contains("app.clickup.com") {
31
+ danger.warn("Missing a link to the task from the [clickup](https://app.clickup.com/4535044/home) in the Merge Request description.")
32
+ }
33
+
34
+ if mr.title.range(of: #"SP-\d+:"#, options: .regularExpression) == nil {
35
+ danger.warn("Missing a task prefix in the Merge Request title. Expected format `SP-X: \(mr.title)` where `X` is a task number from the [clickup](https://app.clickup.com/4535044/home).")
36
+ }
37
+ }
38
+ }
39
+
40
+ extension DangerDSL {
41
+ var hasReports: Bool {
42
+ return !self.fails.isEmpty || !self.warnings.isEmpty || !self.messages.isEmpty || !self.markdowns.isEmpty
43
+ }
44
+ }
@@ -0,0 +1,7 @@
1
+ import XCTest
2
+
3
+ import RegulaDangerTests
4
+
5
+ var tests = [XCTestCaseEntry]()
6
+ tests += RegulaDangerTests.allTests()
7
+ XCTMain(tests)