@regulaforensics/idv 3.2.23-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 (113) hide show
  1. package/README.md +36 -0
  2. package/RNIDV.podspec +21 -0
  3. package/android/CVDIDV.kt +48 -0
  4. package/android/build.gradle +41 -0
  5. package/android/cordova.gradle +20 -0
  6. package/android/src/main/java/com/regula/plugin/idv/JSONConstructor.kt +135 -0
  7. package/android/src/main/java/com/regula/plugin/idv/Main.kt +124 -0
  8. package/android/src/main/java/com/regula/plugin/idv/RNIDVModule.kt +71 -0
  9. package/android/src/main/java/com/regula/plugin/idv/Utils.kt +60 -0
  10. package/examples/capacitor/README.md +15 -0
  11. package/examples/capacitor/android/app/build.gradle +50 -0
  12. package/examples/capacitor/android/app/capacitor.build.gradle +22 -0
  13. package/examples/capacitor/android/app/proguard-rules.pro +21 -0
  14. package/examples/capacitor/android/app/src/main/AndroidManifest.xml +26 -0
  15. package/examples/capacitor/android/app/src/main/assets/Regula/.gitkeep +0 -0
  16. package/examples/capacitor/android/app/src/main/java/com/regula/example/idv/capacitor/MainActivity.java +5 -0
  17. package/examples/capacitor/android/app/src/main/res/drawable/ic_launcher.png +0 -0
  18. package/examples/capacitor/android/app/src/main/res/drawable/ic_launcher_foreground.png +0 -0
  19. package/examples/capacitor/android/app/src/main/res/drawable/ic_launcher_round.png +0 -0
  20. package/examples/capacitor/android/app/src/main/res/drawable/launcher.xml +4 -0
  21. package/examples/capacitor/android/app/src/main/res/drawable/launcher_round.xml +4 -0
  22. package/examples/capacitor/android/app/src/main/res/drawable/splash.png +0 -0
  23. package/examples/capacitor/android/app/src/main/res/layout/activity_main.xml +12 -0
  24. package/examples/capacitor/android/app/src/main/res/values/styles.xml +22 -0
  25. package/examples/capacitor/android/build.gradle +30 -0
  26. package/examples/capacitor/android/capacitor.settings.gradle +15 -0
  27. package/examples/capacitor/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  28. package/examples/capacitor/android/gradle/wrapper/gradle-wrapper.properties +7 -0
  29. package/examples/capacitor/android/gradle.properties +22 -0
  30. package/examples/capacitor/android/gradlew +252 -0
  31. package/examples/capacitor/android/gradlew.bat +94 -0
  32. package/examples/capacitor/android/settings.gradle +5 -0
  33. package/examples/capacitor/android/variables.gradle +16 -0
  34. package/examples/capacitor/index.html +5 -0
  35. package/examples/capacitor/index.tsx +16 -0
  36. package/examples/capacitor/ionic.config.json +7 -0
  37. package/examples/capacitor/ios/App/App/App.entitlements +10 -0
  38. package/examples/capacitor/ios/App/App/AppDelegate.swift +49 -0
  39. package/examples/capacitor/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png +0 -0
  40. package/examples/capacitor/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json +14 -0
  41. package/examples/capacitor/ios/App/App/Assets.xcassets/Contents.json +6 -0
  42. package/examples/capacitor/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json +23 -0
  43. package/examples/capacitor/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png +0 -0
  44. package/examples/capacitor/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png +0 -0
  45. package/examples/capacitor/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png +0 -0
  46. package/examples/capacitor/ios/App/App/Base.lproj/LaunchScreen.storyboard +32 -0
  47. package/examples/capacitor/ios/App/App/Base.lproj/Main.storyboard +19 -0
  48. package/examples/capacitor/ios/App/App/Info.plist +65 -0
  49. package/examples/capacitor/ios/App/App.xcodeproj/project.pbxproj +414 -0
  50. package/examples/capacitor/ios/App/App.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  51. package/examples/capacitor/ios/App/App.xcworkspace/contents.xcworkspacedata +10 -0
  52. package/examples/capacitor/ios/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  53. package/examples/capacitor/ios/App/Podfile +26 -0
  54. package/examples/capacitor/package.json +27 -0
  55. package/examples/capacitor/public/assets/.gitkeep +0 -0
  56. package/examples/capacitor/scripts/android.sh +9 -0
  57. package/examples/capacitor/scripts/ios.sh +8 -0
  58. package/examples/capacitor/scripts/setup.sh +14 -0
  59. package/examples/capacitor/src/main.css +148 -0
  60. package/examples/capacitor/src/main.html +38 -0
  61. package/examples/capacitor/src/main.tsx +10 -0
  62. package/examples/capacitor/tsconfig.json +5 -0
  63. package/examples/capacitor/vite.config.ts +17 -0
  64. package/examples/ionic/README.md +15 -0
  65. package/examples/ionic/angular.json +39 -0
  66. package/examples/ionic/assets/.gitkeep +0 -0
  67. package/examples/ionic/config.xml +59 -0
  68. package/examples/ionic/images/icon.png +0 -0
  69. package/examples/ionic/index.html +19 -0
  70. package/examples/ionic/index.tsx +28 -0
  71. package/examples/ionic/ionic.config.json +7 -0
  72. package/examples/ionic/package.json +46 -0
  73. package/examples/ionic/scripts/android.sh +8 -0
  74. package/examples/ionic/scripts/ios.sh +8 -0
  75. package/examples/ionic/scripts/setup.sh +8 -0
  76. package/examples/ionic/src/main.css +148 -0
  77. package/examples/ionic/src/main.html +38 -0
  78. package/examples/ionic/src/main.tsx +10 -0
  79. package/examples/ionic/tsconfig.json +14 -0
  80. package/examples/react_native/README.md +15 -0
  81. package/examples/react_native/app.config.ts +46 -0
  82. package/examples/react_native/assets/.gitkeep +0 -0
  83. package/examples/react_native/images/icon.png +0 -0
  84. package/examples/react_native/index.html +11 -0
  85. package/examples/react_native/index.tsx +63 -0
  86. package/examples/react_native/metro.config.js +7 -0
  87. package/examples/react_native/package.json +29 -0
  88. package/examples/react_native/scripts/android.sh +13 -0
  89. package/examples/react_native/scripts/ios.sh +12 -0
  90. package/examples/react_native/scripts/setup.sh +9 -0
  91. package/examples/react_native/src/main.css +148 -0
  92. package/examples/react_native/src/main.html +38 -0
  93. package/examples/react_native/src/main.tsx +10 -0
  94. package/ios/CVDIDV.swift +72 -0
  95. package/ios/FlutterIDVPlugin.swift +72 -0
  96. package/ios/JSONConstructor.swift +134 -0
  97. package/ios/Main.swift +89 -0
  98. package/ios/RNIDV.swift +72 -0
  99. package/ios/Utils.swift +56 -0
  100. package/package.json +38 -0
  101. package/plugin.xml +45 -0
  102. package/test/json.tsx +0 -0
  103. package/test/package-lock.json +584 -0
  104. package/test/package.json +9 -0
  105. package/test/test.tsx +3 -0
  106. package/test/utils.tsx +38 -0
  107. package/www/capacitor/index.js +6 -0
  108. package/www/capacitor/internal/bridge.js +19 -0
  109. package/www/capacitor/internal/cordova.js +17 -0
  110. package/www/cordova.js +150 -0
  111. package/www/react-native/index.js +6 -0
  112. package/www/react-native/internal/bridge.js +19 -0
  113. package/www/types/index.d.ts +12 -0
package/www/cordova.js ADDED
@@ -0,0 +1,150 @@
1
+ /******/ (() => { // webpackBootstrap
2
+ /******/ "use strict";
3
+ /******/ var __webpack_modules__ = ({
4
+
5
+ /***/ "./src/internal/bridge.js":
6
+ /*!********************************!*\
7
+ !*** ./src/internal/bridge.js ***!
8
+ \********************************/
9
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
10
+
11
+ __webpack_require__.r(__webpack_exports__);
12
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13
+ /* harmony export */ exec: () => (/* binding */ exec)
14
+ /* harmony export */ });
15
+ /* harmony import */ var _cordova__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./cordova */ "./src/internal/cordova.js");
16
+
17
+
18
+ const { RNIDV } = _cordova__WEBPACK_IMPORTED_MODULE_0__.NativeModules
19
+ var eventManager = new _cordova__WEBPACK_IMPORTED_MODULE_0__.NativeEventEmitter(RNIDV)
20
+
21
+ async function exec(name, params) {
22
+ return RNIDV.exec(name, params)
23
+ }
24
+
25
+ function _setEvent(id, completion, fromJson) {
26
+ eventManager.removeAllListeners(id)
27
+ if (completion == null) return
28
+ if (fromJson == null) eventManager.addListener(id, completion)
29
+ else eventManager.addListener(id, data => {
30
+ data = fromJson(data)
31
+ if (data !== null && typeof data[Symbol.iterator] === 'function') completion(...data)
32
+ else completion(data)
33
+ })
34
+ }
35
+
36
+
37
+ /***/ }),
38
+
39
+ /***/ "./src/internal/cordova.js":
40
+ /*!*********************************!*\
41
+ !*** ./src/internal/cordova.js ***!
42
+ \*********************************/
43
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
44
+
45
+ __webpack_require__.r(__webpack_exports__);
46
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
47
+ /* harmony export */ NativeEventEmitter: () => (/* binding */ NativeEventEmitter),
48
+ /* harmony export */ NativeModules: () => (/* binding */ NativeModules)
49
+ /* harmony export */ });
50
+ var _exec = (completion, params) => cordova.exec(completion, null, "IDV", "exec", params)
51
+
52
+ const NativeModules = {
53
+ RNIDV: {
54
+ exec: async (name, params) => new Promise((resolve, _) => _exec(data => resolve(data), [name, ...params]))
55
+ }
56
+ }
57
+
58
+ class NativeEventEmitter {
59
+ addListener(id, completion) {
60
+ _exec(completion, ["setEvent", id])
61
+ }
62
+
63
+ removeAllListeners(id) {
64
+ _exec(null, ["setEvent", id])
65
+ }
66
+ }
67
+
68
+ /***/ })
69
+
70
+ /******/ });
71
+ /************************************************************************/
72
+ /******/ // The module cache
73
+ /******/ var __webpack_module_cache__ = {};
74
+ /******/
75
+ /******/ // The require function
76
+ /******/ function __webpack_require__(moduleId) {
77
+ /******/ // Check if module is in cache
78
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
79
+ /******/ if (cachedModule !== undefined) {
80
+ /******/ return cachedModule.exports;
81
+ /******/ }
82
+ /******/ // Create a new module (and put it into the cache)
83
+ /******/ var module = __webpack_module_cache__[moduleId] = {
84
+ /******/ // no module.id needed
85
+ /******/ // no module.loaded needed
86
+ /******/ exports: {}
87
+ /******/ };
88
+ /******/
89
+ /******/ // Execute the module function
90
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
91
+ /******/
92
+ /******/ // Return the exports of the module
93
+ /******/ return module.exports;
94
+ /******/ }
95
+ /******/
96
+ /************************************************************************/
97
+ /******/ /* webpack/runtime/define property getters */
98
+ /******/ (() => {
99
+ /******/ // define getter functions for harmony exports
100
+ /******/ __webpack_require__.d = (exports, definition) => {
101
+ /******/ for(var key in definition) {
102
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
103
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
104
+ /******/ }
105
+ /******/ }
106
+ /******/ };
107
+ /******/ })();
108
+ /******/
109
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
110
+ /******/ (() => {
111
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
112
+ /******/ })();
113
+ /******/
114
+ /******/ /* webpack/runtime/make namespace object */
115
+ /******/ (() => {
116
+ /******/ // define __esModule on exports
117
+ /******/ __webpack_require__.r = (exports) => {
118
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
119
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
120
+ /******/ }
121
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
122
+ /******/ };
123
+ /******/ })();
124
+ /******/
125
+ /************************************************************************/
126
+ var __webpack_exports__ = {};
127
+ // This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
128
+ (() => {
129
+ /*!**********************!*\
130
+ !*** ./src/index.js ***!
131
+ \**********************/
132
+ __webpack_require__.r(__webpack_exports__);
133
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
134
+ /* harmony export */ IDV: () => (/* binding */ IDV)
135
+ /* harmony export */ });
136
+ /* harmony import */ var _internal_bridge__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./internal/bridge */ "./src/internal/bridge.js");
137
+
138
+
139
+ class IDV {
140
+ static get instance() { return IDV._instance }
141
+ static _instance = new IDV()
142
+ }
143
+
144
+ })();
145
+
146
+ var __webpack_export_target__ = exports;
147
+ for(var __webpack_i__ in __webpack_exports__) __webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
148
+ if(__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, "__esModule", { value: true });
149
+ /******/ })()
150
+ ;
@@ -0,0 +1,6 @@
1
+ import { exec } from './internal/bridge'
2
+
3
+ export class IDV {
4
+ static get instance() { return IDV._instance }
5
+ static _instance = new IDV()
6
+ }
@@ -0,0 +1,19 @@
1
+ import { NativeModules, NativeEventEmitter } from 'react-native'
2
+
3
+ const { RNIDV } = NativeModules
4
+ var eventManager = new NativeEventEmitter(RNIDV)
5
+
6
+ export async function exec(name, params) {
7
+ return RNIDV.exec(name, params)
8
+ }
9
+
10
+ function _setEvent(id, completion, fromJson) {
11
+ eventManager.removeAllListeners(id)
12
+ if (completion == null) return
13
+ if (fromJson == null) eventManager.addListener(id, completion)
14
+ else eventManager.addListener(id, data => {
15
+ data = fromJson(data)
16
+ if (data !== null && typeof data[Symbol.iterator] === 'function') completion(...data)
17
+ else completion(data)
18
+ })
19
+ }
@@ -0,0 +1,12 @@
1
+
2
+
3
+ /**
4
+ * Entry point of the Regula IDV.
5
+ */
6
+ export class IDV {
7
+ /**
8
+ * The only instance of singleton class {@link IDV}.
9
+ */
10
+ static get instance(): IDV
11
+ private constructor()
12
+ }