bureau-sdk 0.0.1-alpha01

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 (51) hide show
  1. package/README.md +107 -0
  2. package/android/build.gradle +120 -0
  3. package/android/gradle.properties +5 -0
  4. package/android/libs/id/bureau/analytics/1.0.0/analytics-1.0.0.aar +0 -0
  5. package/android/libs/id/bureau/analytics/1.0.0/analytics-1.0.0.module +137 -0
  6. package/android/libs/id/bureau/analytics/1.0.0/analytics-1.0.0.pom +64 -0
  7. package/android/libs/id/bureau/analytics/maven-metadata-local.xml +13 -0
  8. package/android/libs/id/bureau/backend-config/1.0.0/backend-config-1.0.0.aar +0 -0
  9. package/android/libs/id/bureau/backend-config/1.0.0/backend-config-1.0.0.module +179 -0
  10. package/android/libs/id/bureau/backend-config/1.0.0/backend-config-1.0.0.pom +100 -0
  11. package/android/libs/id/bureau/backend-config/maven-metadata-local.xml +13 -0
  12. package/android/libs/id/bureau/base/1.0.0/base-1.0.0.aar +0 -0
  13. package/android/libs/id/bureau/base/1.0.0/base-1.0.0.module +102 -0
  14. package/android/libs/id/bureau/base/1.0.0/base-1.0.0.pom +46 -0
  15. package/android/libs/id/bureau/base/maven-metadata-local.xml +13 -0
  16. package/android/libs/id/bureau/behavioural-biometrics/1.0.0/behavioural-biometrics-1.0.0.aar +0 -0
  17. package/android/libs/id/bureau/behavioural-biometrics/1.0.0/behavioural-biometrics-1.0.0.module +193 -0
  18. package/android/libs/id/bureau/behavioural-biometrics/1.0.0/behavioural-biometrics-1.0.0.pom +106 -0
  19. package/android/libs/id/bureau/behavioural-biometrics/maven-metadata-local.xml +13 -0
  20. package/android/libs/id/bureau/bureausdk/1.0.0/bureausdk-1.0.0.aar +0 -0
  21. package/android/libs/id/bureau/bureausdk/1.0.0/bureausdk-1.0.0.module +144 -0
  22. package/android/libs/id/bureau/bureausdk/1.0.0/bureausdk-1.0.0.pom +58 -0
  23. package/android/libs/id/bureau/bureausdk/maven-metadata-local.xml +13 -0
  24. package/android/libs/id/bureau/checkRoot/1.0.0/checkRoot-1.0.0.aar +0 -0
  25. package/android/libs/id/bureau/checkRoot/1.0.0/checkRoot-1.0.0.module +88 -0
  26. package/android/libs/id/bureau/checkRoot/1.0.0/checkRoot-1.0.0.pom +34 -0
  27. package/android/libs/id/bureau/checkRoot/maven-metadata-local.xml +13 -0
  28. package/android/libs/id/bureau/device-intelligence/1.0.0/device-intelligence-1.0.0.aar +0 -0
  29. package/android/libs/id/bureau/device-intelligence/1.0.0/device-intelligence-1.0.0.module +228 -0
  30. package/android/libs/id/bureau/device-intelligence/1.0.0/device-intelligence-1.0.0.pom +124 -0
  31. package/android/libs/id/bureau/device-intelligence/maven-metadata-local.xml +13 -0
  32. package/android/libs/id/bureau/network/1.0.0/network-1.0.0.aar +0 -0
  33. package/android/libs/id/bureau/network/1.0.0/network-1.0.0.module +109 -0
  34. package/android/libs/id/bureau/network/1.0.0/network-1.0.0.pom +52 -0
  35. package/android/libs/id/bureau/network/maven-metadata-local.xml +13 -0
  36. package/android/src/main/AndroidManifest.xml +3 -0
  37. package/android/src/main/AndroidManifestNew.xml +2 -0
  38. package/android/src/main/java/com/samplenativemodule/FraudNativeModule.kt +70 -0
  39. package/android/src/main/java/com/samplenativemodule/FraudNativeModulePackage.kt +17 -0
  40. package/bureau-sdk.podspec +43 -0
  41. package/ios/FraudNativeModule.mm +21 -0
  42. package/ios/FraudNativeModule.swift +40 -0
  43. package/ios/SampleNativeModule-Bridging-Header.h +2 -0
  44. package/ios/SampleNativeModule.mm +14 -0
  45. package/ios/SampleNativeModule.swift +8 -0
  46. package/lib/commonjs/index.js +43 -0
  47. package/lib/commonjs/index.js.map +1 -0
  48. package/lib/module/index.js +38 -0
  49. package/lib/module/index.js.map +1 -0
  50. package/package.json +129 -0
  51. package/src/index.tsx +58 -0
@@ -0,0 +1,124 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
3
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
4
+ <!-- This module was also published with a richer model, Gradle metadata, -->
5
+ <!-- which should be used instead. Do not delete the following line which -->
6
+ <!-- is to indicate to Gradle or any Gradle module metadata file consumer -->
7
+ <!-- that they should prefer consuming it instead. -->
8
+ <!-- do_not_remove: published-with-gradle-metadata -->
9
+ <modelVersion>4.0.0</modelVersion>
10
+ <groupId>id.bureau</groupId>
11
+ <artifactId>device-intelligence</artifactId>
12
+ <version>1.0.0</version>
13
+ <packaging>aar</packaging>
14
+ <dependencies>
15
+ <dependency>
16
+ <groupId>id.bureau</groupId>
17
+ <artifactId>network</artifactId>
18
+ <version>1.0.0</version>
19
+ <scope>compile</scope>
20
+ </dependency>
21
+ <dependency>
22
+ <groupId>id.bureau</groupId>
23
+ <artifactId>base</artifactId>
24
+ <version>1.0.0</version>
25
+ <scope>compile</scope>
26
+ </dependency>
27
+ <dependency>
28
+ <groupId>id.bureau</groupId>
29
+ <artifactId>checkRoot</artifactId>
30
+ <version>1.0.0</version>
31
+ <scope>compile</scope>
32
+ </dependency>
33
+ <dependency>
34
+ <groupId>id.bureau</groupId>
35
+ <artifactId>analytics</artifactId>
36
+ <version>1.0.0</version>
37
+ <scope>compile</scope>
38
+ </dependency>
39
+ <dependency>
40
+ <groupId>id.bureau</groupId>
41
+ <artifactId>backend-config</artifactId>
42
+ <version>1.0.0</version>
43
+ <scope>compile</scope>
44
+ </dependency>
45
+ <dependency>
46
+ <groupId>org.jetbrains.kotlin</groupId>
47
+ <artifactId>kotlin-stdlib-jdk8</artifactId>
48
+ <version>1.6.21</version>
49
+ <scope>compile</scope>
50
+ </dependency>
51
+ <dependency>
52
+ <groupId>io.michaelrocks</groupId>
53
+ <artifactId>paranoid-core</artifactId>
54
+ <version>0.3.7</version>
55
+ <scope>runtime</scope>
56
+ </dependency>
57
+ <dependency>
58
+ <groupId>androidx.core</groupId>
59
+ <artifactId>core-ktx</artifactId>
60
+ <version>1.8.0</version>
61
+ <scope>runtime</scope>
62
+ </dependency>
63
+ <dependency>
64
+ <groupId>androidx.recyclerview</groupId>
65
+ <artifactId>recyclerview</artifactId>
66
+ <version>1.1.0-beta02</version>
67
+ <scope>runtime</scope>
68
+ </dependency>
69
+ <dependency>
70
+ <groupId>com.google.android.gms</groupId>
71
+ <artifactId>play-services-ads-identifier</artifactId>
72
+ <version>18.0.1</version>
73
+ <scope>runtime</scope>
74
+ </dependency>
75
+ <dependency>
76
+ <groupId>com.squareup.retrofit2</groupId>
77
+ <artifactId>retrofit</artifactId>
78
+ <version>2.9.0</version>
79
+ <scope>runtime</scope>
80
+ </dependency>
81
+ <dependency>
82
+ <groupId>com.google.android.gms</groupId>
83
+ <artifactId>play-services-location</artifactId>
84
+ <version>17.0.0</version>
85
+ <scope>runtime</scope>
86
+ </dependency>
87
+ <dependency>
88
+ <groupId>com.google.code.gson</groupId>
89
+ <artifactId>gson</artifactId>
90
+ <version>2.10.1</version>
91
+ <scope>runtime</scope>
92
+ </dependency>
93
+ <dependency>
94
+ <groupId>com.google.android.gms</groupId>
95
+ <artifactId>play-services-appset</artifactId>
96
+ <version>16.1.0</version>
97
+ <scope>runtime</scope>
98
+ </dependency>
99
+ <dependency>
100
+ <groupId>org.jetbrains.kotlinx</groupId>
101
+ <artifactId>kotlinx-coroutines-play-services</artifactId>
102
+ <version>1.6.4</version>
103
+ <scope>runtime</scope>
104
+ </dependency>
105
+ <dependency>
106
+ <groupId>androidx.datastore</groupId>
107
+ <artifactId>datastore-preferences</artifactId>
108
+ <version>1.0.0</version>
109
+ <scope>runtime</scope>
110
+ </dependency>
111
+ <dependency>
112
+ <groupId>com.google.dagger</groupId>
113
+ <artifactId>dagger-android</artifactId>
114
+ <version>2.41</version>
115
+ <scope>runtime</scope>
116
+ </dependency>
117
+ <dependency>
118
+ <groupId>com.google.dagger</groupId>
119
+ <artifactId>dagger-android-support</artifactId>
120
+ <version>2.41</version>
121
+ <scope>runtime</scope>
122
+ </dependency>
123
+ </dependencies>
124
+ </project>
@@ -0,0 +1,13 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <metadata>
3
+ <groupId>id.bureau</groupId>
4
+ <artifactId>device-intelligence</artifactId>
5
+ <versioning>
6
+ <latest>1.0.0</latest>
7
+ <release>1.0.0</release>
8
+ <versions>
9
+ <version>1.0.0</version>
10
+ </versions>
11
+ <lastUpdated>20251218105029</lastUpdated>
12
+ </versioning>
13
+ </metadata>
@@ -0,0 +1,109 @@
1
+ {
2
+ "formatVersion": "1.1",
3
+ "component": {
4
+ "group": "id.bureau",
5
+ "module": "network",
6
+ "version": "1.0.0",
7
+ "attributes": {
8
+ "org.gradle.status": "release"
9
+ }
10
+ },
11
+ "createdBy": {
12
+ "gradle": {
13
+ "version": "7.4.2"
14
+ }
15
+ },
16
+ "variants": [
17
+ {
18
+ "name": "releaseApiElements-published",
19
+ "attributes": {
20
+ "org.gradle.category": "library",
21
+ "org.gradle.usage": "java-api",
22
+ "org.jetbrains.kotlin.platform.type": "androidJvm"
23
+ },
24
+ "dependencies": [
25
+ {
26
+ "group": "org.jetbrains.kotlin",
27
+ "module": "kotlin-stdlib-jdk8",
28
+ "version": {
29
+ "requires": "1.6.21"
30
+ }
31
+ }
32
+ ],
33
+ "files": [
34
+ {
35
+ "name": "network-1.0.0.aar",
36
+ "url": "network-1.0.0.aar",
37
+ "size": 8583,
38
+ "sha512": "e366deab947d74e1085e49516b7adeba51600bcbb5c248669d11fbacc40bcd8c9a430db611b7236ca1729cd722700ccf9f1cdd128002acc06e7e7dce0b694c0c",
39
+ "sha256": "d41f776e604a64c1a2f527c6445169cf4ebbb994920d2cc1f4e29fb7aa889b0d",
40
+ "sha1": "bee07c66cb08a1c62202c537a065cfb9c584bcdb",
41
+ "md5": "df0100d0264bec1243938111422d130b"
42
+ }
43
+ ]
44
+ },
45
+ {
46
+ "name": "releaseRuntimeElements-published",
47
+ "attributes": {
48
+ "org.gradle.category": "library",
49
+ "org.gradle.usage": "java-runtime",
50
+ "org.jetbrains.kotlin.platform.type": "androidJvm"
51
+ },
52
+ "dependencies": [
53
+ {
54
+ "group": "org.jetbrains.kotlin",
55
+ "module": "kotlin-stdlib-jdk8",
56
+ "version": {
57
+ "requires": "1.6.21"
58
+ }
59
+ },
60
+ {
61
+ "group": "io.michaelrocks",
62
+ "module": "paranoid-core",
63
+ "version": {
64
+ "requires": "0.3.7"
65
+ }
66
+ },
67
+ {
68
+ "group": "androidx.core",
69
+ "module": "core-ktx",
70
+ "version": {
71
+ "requires": "1.8.0"
72
+ }
73
+ },
74
+ {
75
+ "group": "com.squareup.retrofit2",
76
+ "module": "retrofit",
77
+ "version": {
78
+ "requires": "2.9.0"
79
+ }
80
+ },
81
+ {
82
+ "group": "com.squareup.retrofit2",
83
+ "module": "converter-gson",
84
+ "version": {
85
+ "requires": "2.9.0"
86
+ }
87
+ },
88
+ {
89
+ "group": "com.squareup.okhttp3",
90
+ "module": "logging-interceptor",
91
+ "version": {
92
+ "requires": "4.11.0"
93
+ }
94
+ }
95
+ ],
96
+ "files": [
97
+ {
98
+ "name": "network-1.0.0.aar",
99
+ "url": "network-1.0.0.aar",
100
+ "size": 8583,
101
+ "sha512": "e366deab947d74e1085e49516b7adeba51600bcbb5c248669d11fbacc40bcd8c9a430db611b7236ca1729cd722700ccf9f1cdd128002acc06e7e7dce0b694c0c",
102
+ "sha256": "d41f776e604a64c1a2f527c6445169cf4ebbb994920d2cc1f4e29fb7aa889b0d",
103
+ "sha1": "bee07c66cb08a1c62202c537a065cfb9c584bcdb",
104
+ "md5": "df0100d0264bec1243938111422d130b"
105
+ }
106
+ ]
107
+ }
108
+ ]
109
+ }
@@ -0,0 +1,52 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
3
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
4
+ <!-- This module was also published with a richer model, Gradle metadata, -->
5
+ <!-- which should be used instead. Do not delete the following line which -->
6
+ <!-- is to indicate to Gradle or any Gradle module metadata file consumer -->
7
+ <!-- that they should prefer consuming it instead. -->
8
+ <!-- do_not_remove: published-with-gradle-metadata -->
9
+ <modelVersion>4.0.0</modelVersion>
10
+ <groupId>id.bureau</groupId>
11
+ <artifactId>network</artifactId>
12
+ <version>1.0.0</version>
13
+ <packaging>aar</packaging>
14
+ <dependencies>
15
+ <dependency>
16
+ <groupId>org.jetbrains.kotlin</groupId>
17
+ <artifactId>kotlin-stdlib-jdk8</artifactId>
18
+ <version>1.6.21</version>
19
+ <scope>compile</scope>
20
+ </dependency>
21
+ <dependency>
22
+ <groupId>io.michaelrocks</groupId>
23
+ <artifactId>paranoid-core</artifactId>
24
+ <version>0.3.7</version>
25
+ <scope>runtime</scope>
26
+ </dependency>
27
+ <dependency>
28
+ <groupId>androidx.core</groupId>
29
+ <artifactId>core-ktx</artifactId>
30
+ <version>1.8.0</version>
31
+ <scope>runtime</scope>
32
+ </dependency>
33
+ <dependency>
34
+ <groupId>com.squareup.retrofit2</groupId>
35
+ <artifactId>retrofit</artifactId>
36
+ <version>2.9.0</version>
37
+ <scope>runtime</scope>
38
+ </dependency>
39
+ <dependency>
40
+ <groupId>com.squareup.retrofit2</groupId>
41
+ <artifactId>converter-gson</artifactId>
42
+ <version>2.9.0</version>
43
+ <scope>runtime</scope>
44
+ </dependency>
45
+ <dependency>
46
+ <groupId>com.squareup.okhttp3</groupId>
47
+ <artifactId>logging-interceptor</artifactId>
48
+ <version>4.11.0</version>
49
+ <scope>runtime</scope>
50
+ </dependency>
51
+ </dependencies>
52
+ </project>
@@ -0,0 +1,13 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <metadata>
3
+ <groupId>id.bureau</groupId>
4
+ <artifactId>network</artifactId>
5
+ <versioning>
6
+ <latest>1.0.0</latest>
7
+ <release>1.0.0</release>
8
+ <versions>
9
+ <version>1.0.0</version>
10
+ </versions>
11
+ <lastUpdated>20251218105025</lastUpdated>
12
+ </versioning>
13
+ </metadata>
@@ -0,0 +1,3 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
+ package="com.samplenativemodule">
3
+ </manifest>
@@ -0,0 +1,2 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
+ </manifest>
@@ -0,0 +1,70 @@
1
+ package com.samplenativemodule
2
+
3
+ import android.app.Application
4
+ import android.util.Log
5
+ import com.bureau.base.Environment
6
+ import com.bureau.base.models.BureauConfig
7
+ import com.bureau.behavioralbiometricsanddevicefingerprint.BureauSDK
8
+ import com.facebook.react.bridge.Promise
9
+ import com.facebook.react.bridge.ReactApplicationContext
10
+ import com.facebook.react.bridge.ReactContextBaseJavaModule
11
+ import com.facebook.react.bridge.ReactMethod
12
+
13
+
14
+ class FraudNativeModule(private val reactContext: ReactApplicationContext) :
15
+ ReactContextBaseJavaModule(reactContext) {
16
+
17
+ companion object {
18
+ const val NAME = "FraudNativeModule"
19
+ private const val LOG_TAG = "FraudNativeModule"
20
+ }
21
+
22
+
23
+ override fun getName(): String {
24
+ return NAME
25
+ }
26
+
27
+ // Example method
28
+ // See https://reactnative.dev/docs/native-modules-android
29
+ @ReactMethod
30
+ fun submitDeviceIntelligence(promise: Promise) {
31
+ val eventId = BureauSDK.submit()
32
+ promise.resolve(eventId)
33
+ }
34
+
35
+ @ReactMethod
36
+ fun initDeviceIntelligence(
37
+ credentialId: String,
38
+ env: String,
39
+ enableBehavioralBiometrics: Boolean?,
40
+ flow: String?,
41
+ ) {
42
+ try {
43
+ val environment =
44
+ if (env.equals("production", ignoreCase = true)) Environment.PRODUCTION else Environment.STAGING
45
+
46
+ // Build Bureau config using the Application context
47
+ val config = BureauConfig(
48
+ reactContext.applicationContext as Application,
49
+ credentialId = credentialId,
50
+ environment = environment,
51
+ enableBehavioralBiometrics = enableBehavioralBiometrics ?: true,
52
+ flow = flow ?: "",
53
+ )
54
+
55
+ // Get the current Activity from the React context
56
+ val currentActivity = currentActivity
57
+
58
+ if (currentActivity == null) {
59
+ Log.e(LOG_TAG, "Failed to initialize device intelligence: currentActivity is null")
60
+ return
61
+ }
62
+
63
+ // Initialize the SDK with config and Activity
64
+ BureauSDK.init(config, currentActivity)
65
+ Log.d(LOG_TAG, "Device intelligence initialized successfully")
66
+ } catch (e: Throwable) {
67
+ Log.e(LOG_TAG, "Failed to initialize device intelligence: ${e.message}")
68
+ }
69
+ }
70
+ }
@@ -0,0 +1,17 @@
1
+ package com.samplenativemodule
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
+
9
+ class FraudNativeModulePackage : ReactPackage {
10
+ override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> {
11
+ return listOf(FraudNativeModule(reactContext))
12
+ }
13
+
14
+ override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
15
+ return emptyList()
16
+ }
17
+ }
@@ -0,0 +1,43 @@
1
+ require "json"
2
+
3
+ package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
+ folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
5
+
6
+ Pod::Spec.new do |s|
7
+ s.name = "bureau-sdk"
8
+ s.version = package["version"]
9
+ s.summary = package["description"]
10
+ s.homepage = package["homepage"]
11
+ s.license = package["license"]
12
+ s.authors = package["author"]
13
+
14
+ s.platforms = { :ios => "12.0" }
15
+ s.source = { :git => "https://.git", :tag => "#{s.version}" }
16
+
17
+ s.source_files = "ios/**/*.{h,m,mm,swift}"
18
+ s.dependency "BureauSDKiOS", '0.0.1'
19
+
20
+ # Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
21
+ # See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
22
+ if respond_to?(:install_modules_dependencies, true)
23
+ install_modules_dependencies(s)
24
+ else
25
+ s.dependency "React-Core"
26
+
27
+ # Don't install the dependencies when we run `pod install` in the old architecture.
28
+ if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
29
+ s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
30
+ s.pod_target_xcconfig = {
31
+ "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
32
+ "OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
33
+ "CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
34
+ }
35
+ s.dependency "React-Codegen"
36
+ s.dependency "RCT-Folly"
37
+ s.dependency "RCTRequired"
38
+ s.dependency "RCTTypeSafety"
39
+ s.dependency "ReactCommon/turbomodule/core"
40
+ end
41
+ end
42
+ end
43
+
@@ -0,0 +1,21 @@
1
+ #import <React/RCTBridgeModule.h>
2
+ #import <React/RCTEventEmitter.h>
3
+
4
+ @interface RCT_EXTERN_MODULE(FraudNativeModule, RCTEventEmitter)
5
+
6
+ RCT_EXTERN_METHOD(initDeviceIntelligence:(NSString *)credentialId
7
+ env:(NSString *)env
8
+ enableBehavioralBiometrics:(nonnull NSNumber *)enableBehavioralBiometrics
9
+ flow:(NSString *)flow)
10
+
11
+
12
+ RCT_EXTERN_METHOD(submitDeviceIntelligence:(RCTPromiseResolveBlock)resolve
13
+ withRejecter:(RCTPromiseRejectBlock)reject
14
+ )
15
+
16
+ + (BOOL)requiresMainQueueSetup
17
+ {
18
+ return NO;
19
+ }
20
+
21
+ @end
@@ -0,0 +1,40 @@
1
+ import CoreLocation
2
+ import BureauSDKiOS
3
+ import React
4
+
5
+ @objc(FraudNativeModule)
6
+ class FraudNativeModule: NSObject{
7
+
8
+ var resultResolve:RCTPromiseResolveBlock!
9
+ var locationManager = CLLocationManager()
10
+ var location: CLLocation?
11
+
12
+ override init() {
13
+ super.init()
14
+ }
15
+
16
+ @objc(submitDeviceIntelligence:withRejecter:)
17
+ func submitDeviceIntelligence(resolve:@escaping RCTPromiseResolveBlock,reject:RCTPromiseRejectBlock){
18
+ resultResolve = resolve
19
+ DispatchQueue.main.async {
20
+ let eventId = BureauSDK.shared.submit()
21
+ resolve(eventId)
22
+ }
23
+ }
24
+
25
+ @objc(initDeviceIntelligence:env:enableBehavioralBiometrics:flow:)
26
+ func initDeviceIntelligence(clientId:String,env:String, enableBehavioralBiometrics: NSNumber?, flow: String?){
27
+ var mode = Environment.production
28
+ switch(env.lowercased()){
29
+ case "production":
30
+ mode = Environment.production
31
+ default:
32
+ mode = Environment.staging
33
+ }
34
+ DispatchQueue.main.async {
35
+ let config = BureauConfig(credentialID: clientId, environment: mode, enableBehavioralBiometrics: enableBehavioralBiometrics?.boolValue ?? true, flow: flow ?? "", enableDebugLog: true)
36
+ BureauSDK.initialize(config: config)
37
+ }
38
+ }
39
+
40
+ }
@@ -0,0 +1,2 @@
1
+ #import <React/RCTBridgeModule.h>
2
+ #import <React/RCTViewManager.h>
@@ -0,0 +1,14 @@
1
+ #import <React/RCTBridgeModule.h>
2
+
3
+ @interface RCT_EXTERN_MODULE(SampleNativeModule, NSObject)
4
+
5
+ RCT_EXTERN_METHOD(multiply:(float)a withB:(float)b
6
+ withResolver:(RCTPromiseResolveBlock)resolve
7
+ withRejecter:(RCTPromiseRejectBlock)reject)
8
+
9
+ + (BOOL)requiresMainQueueSetup
10
+ {
11
+ return NO;
12
+ }
13
+
14
+ @end
@@ -0,0 +1,8 @@
1
+ @objc(SampleNativeModule)
2
+ class SampleNativeModule: NSObject {
3
+
4
+ @objc(multiply:withB:withResolver:withRejecter:)
5
+ func multiply(a: Float, b: Float, resolve:RCTPromiseResolveBlock,reject:RCTPromiseRejectBlock) -> Void {
6
+ resolve(a*b)
7
+ }
8
+ }
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Environment = exports.BureauSDK = void 0;
7
+ var _reactNative = require("react-native");
8
+ const LINKING_ERROR = `The package 'bureau-sdk' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
9
+ ios: "- You have run 'pod install'\n",
10
+ default: ''
11
+ });
12
+ '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
13
+ const FraudNativeModule = _reactNative.NativeModules.FraudNativeModule ? _reactNative.NativeModules.FraudNativeModule : new Proxy({}, {
14
+ get() {
15
+ throw new Error(LINKING_ERROR);
16
+ }
17
+ });
18
+ let Environment = exports.Environment = /*#__PURE__*/function (Environment) {
19
+ Environment["PRODUCTION"] = "production";
20
+ Environment["STAGING"] = "staging";
21
+ return Environment;
22
+ }({}); // BureauSDK class for unified API
23
+ class BureauSDK {
24
+ constructor() {}
25
+
26
+ /**
27
+ * Static method to initialize the Bureau SDK with device intelligence
28
+ */
29
+ static async init(config) {
30
+ const api = new BureauSDK();
31
+ FraudNativeModule.initDeviceIntelligence(config.credentialId, config.env, config.enableBehavioralBiometrics, config.flow);
32
+ return api;
33
+ }
34
+
35
+ /**
36
+ * Submit device intelligence data
37
+ */
38
+ static async submit() {
39
+ return await FraudNativeModule.submitDeviceIntelligence();
40
+ }
41
+ }
42
+ exports.BureauSDK = BureauSDK;
43
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","LINKING_ERROR","Platform","select","ios","default","FraudNativeModule","NativeModules","Proxy","get","Error","Environment","exports","BureauSDK","constructor","init","config","api","initDeviceIntelligence","credentialId","env","enableBehavioralBiometrics","flow","submit","submitDeviceIntelligence"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,MAAMC,aAAa,GACjB,qEAAqE,GACrEC,qBAAQ,CAACC,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC;AACzE,sDAAsD,GACpD,+BAA+B;AAEjC,MAAMC,iBAAiB,GAAGC,0BAAa,CAACD,iBAAiB,GACrDC,0BAAa,CAACD,iBAAiB,GAC/B,IAAIE,KAAK,CACT,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACT,aAAa,CAAC;EAChC;AACF,CACF,CAAC;AAAC,IASQU,WAAW,GAAAC,OAAA,CAAAD,WAAA,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA,OAKvB;AACO,MAAME,SAAS,CAAC;EAEbC,WAAWA,CAAA,EAAG,CAAE;;EAExB;AACF;AACA;EACE,aAAaC,IAAIA,CAACC,MAAoB,EAAsB;IAC1D,MAAMC,GAAG,GAAG,IAAIJ,SAAS,CAAC,CAAC;IAC3BP,iBAAiB,CAACY,sBAAsB,CACpCF,MAAM,CAACG,YAAY,EACnBH,MAAM,CAACI,GAAG,EACVJ,MAAM,CAACK,0BAA0B,EACjCL,MAAM,CAACM,IACT,CAAC;IACH,OAAOL,GAAG;EACZ;;EAEA;AACF;AACA;EACE,aAAaM,MAAMA,CAAA,EAAoB;IACrC,OAAO,MAAMjB,iBAAiB,CAACkB,wBAAwB,CAAC,CAAC;EAC3D;AACF;AAACZ,OAAA,CAAAC,SAAA,GAAAA,SAAA","ignoreList":[]}
@@ -0,0 +1,38 @@
1
+ import { NativeModules, Platform } from 'react-native';
2
+ const LINKING_ERROR = `The package 'bureau-sdk' doesn't seem to be linked. Make sure: \n\n` + Platform.select({
3
+ ios: "- You have run 'pod install'\n",
4
+ default: ''
5
+ });
6
+ '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
7
+ const FraudNativeModule = NativeModules.FraudNativeModule ? NativeModules.FraudNativeModule : new Proxy({}, {
8
+ get() {
9
+ throw new Error(LINKING_ERROR);
10
+ }
11
+ });
12
+ export let Environment = /*#__PURE__*/function (Environment) {
13
+ Environment["PRODUCTION"] = "production";
14
+ Environment["STAGING"] = "staging";
15
+ return Environment;
16
+ }({});
17
+
18
+ // BureauSDK class for unified API
19
+ export class BureauSDK {
20
+ constructor() {}
21
+
22
+ /**
23
+ * Static method to initialize the Bureau SDK with device intelligence
24
+ */
25
+ static async init(config) {
26
+ const api = new BureauSDK();
27
+ FraudNativeModule.initDeviceIntelligence(config.credentialId, config.env, config.enableBehavioralBiometrics, config.flow);
28
+ return api;
29
+ }
30
+
31
+ /**
32
+ * Submit device intelligence data
33
+ */
34
+ static async submit() {
35
+ return await FraudNativeModule.submitDeviceIntelligence();
36
+ }
37
+ }
38
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","FraudNativeModule","Proxy","get","Error","Environment","BureauSDK","constructor","init","config","api","initDeviceIntelligence","credentialId","env","enableBehavioralBiometrics","flow","submit","submitDeviceIntelligence"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,SAASA,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAEtD,MAAMC,aAAa,GACjB,qEAAqE,GACrED,QAAQ,CAACE,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC;AACzE,sDAAsD,GACpD,+BAA+B;AAEjC,MAAMC,iBAAiB,GAAGN,aAAa,CAACM,iBAAiB,GACrDN,aAAa,CAACM,iBAAiB,GAC/B,IAAIC,KAAK,CACT,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACP,aAAa,CAAC;EAChC;AACF,CACF,CAAC;AASH,WAAYQ,WAAW,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;;AAKvB;AACA,OAAO,MAAMC,SAAS,CAAC;EAEbC,WAAWA,CAAA,EAAG,CAAE;;EAExB;AACF;AACA;EACE,aAAaC,IAAIA,CAACC,MAAoB,EAAsB;IAC1D,MAAMC,GAAG,GAAG,IAAIJ,SAAS,CAAC,CAAC;IAC3BL,iBAAiB,CAACU,sBAAsB,CACpCF,MAAM,CAACG,YAAY,EACnBH,MAAM,CAACI,GAAG,EACVJ,MAAM,CAACK,0BAA0B,EACjCL,MAAM,CAACM,IACT,CAAC;IACH,OAAOL,GAAG;EACZ;;EAEA;AACF;AACA;EACE,aAAaM,MAAMA,CAAA,EAAoB;IACrC,OAAO,MAAMf,iBAAiB,CAACgB,wBAAwB,CAAC,CAAC;EAC3D;AACF","ignoreList":[]}