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
package/package.json ADDED
@@ -0,0 +1,129 @@
1
+ {
2
+ "name": "bureau-sdk",
3
+ "version": "0.0.1-alpha01",
4
+ "description": "Bureau Device Intelligence React Native SDK",
5
+ "main": "lib/commonjs/index",
6
+ "module": "lib/module/index",
7
+ "types": "lib/typescript/src/index.d.ts",
8
+ "react-native": "src/index",
9
+ "source": "src/index",
10
+ "files": [
11
+ "src",
12
+ "lib",
13
+ "android",
14
+ "ios",
15
+ "*.podspec",
16
+ "!ios/build",
17
+ "!android/build",
18
+ "!android/gradle",
19
+ "!android/gradlew",
20
+ "!android/gradlew.bat",
21
+ "!android/local.properties",
22
+ "!**/__tests__",
23
+ "!**/__fixtures__",
24
+ "!**/__mocks__",
25
+ "!**/.*"
26
+ ],
27
+ "scripts": {
28
+ "build": "bob build",
29
+ "dev": "bob build --watch",
30
+ "test": "jest",
31
+ "test:watch": "jest --watch",
32
+ "test:ci": "jest --ci --coverage --watchAll=false",
33
+ "lint": "eslint src --ext .ts,.tsx",
34
+ "lint:fix": "eslint src --ext .ts,.tsx --fix",
35
+ "typecheck": "tsc --noEmit",
36
+ "prepare": "bob build",
37
+ "clean": "del-cli lib android/build ios/build"
38
+ },
39
+ "keywords": [
40
+ "react-native",
41
+ "ios",
42
+ "android",
43
+ "device-intelligence",
44
+ "fraud-detection"
45
+ ],
46
+ "author": "bureau <nikhil@bureau.id> (https://bureau.id)",
47
+ "license": "MIT",
48
+ "repository": {
49
+ "type": "git",
50
+ "url": "https://github.com/bureau-id/react-native-device-fraud.git",
51
+ "directory": "packages/bureau-sdk"
52
+ },
53
+ "bugs": {
54
+ "url": "https://github.com/bureau-id/react-native-device-fraud/issues"
55
+ },
56
+ "homepage": "https://github.com/bureau-id/react-native-device-fraud#readme",
57
+ "publishConfig": {
58
+ "registry": "https://registry.npmjs.org/",
59
+ "access": "public"
60
+ },
61
+ "dependencies": {
62
+ "react-native-permissions": "^4.1.5",
63
+ "uuid": "^9.0.1"
64
+ },
65
+ "devDependencies": {
66
+ "@react-native/eslint-config": "^0.72.2",
67
+ "@types/jest": "^29.5.0",
68
+ "@types/react": "~17.0.21",
69
+ "@types/react-native": "0.70.0",
70
+ "@types/uuid": "^9.0.7",
71
+ "@typescript-eslint/eslint-plugin": "^5.0.0",
72
+ "@typescript-eslint/parser": "^5.0.0",
73
+ "del-cli": "^5.0.0",
74
+ "eslint": "^8.4.1",
75
+ "jest": "^29.5.0",
76
+ "prettier": "^2.0.5",
77
+ "react": "18.2.0",
78
+ "react-native": "0.72.7",
79
+ "react-native-builder-bob": "^0.20.0",
80
+ "typescript": "^5.0.2"
81
+ },
82
+ "peerDependencies": {
83
+ "react": "*",
84
+ "react-native": "*"
85
+ },
86
+ "eslintConfig": {
87
+ "root": true,
88
+ "extends": [
89
+ "eslint:recommended"
90
+ ],
91
+ "parser": "@typescript-eslint/parser",
92
+ "plugins": [
93
+ "@typescript-eslint"
94
+ ],
95
+ "env": {
96
+ "node": true,
97
+ "es2021": true,
98
+ "jest": true
99
+ },
100
+ "parserOptions": {
101
+ "ecmaVersion": "latest",
102
+ "sourceType": "module"
103
+ },
104
+ "rules": {
105
+ "no-unused-vars": "off",
106
+ "@typescript-eslint/no-unused-vars": "warn",
107
+ "no-console": "warn"
108
+ }
109
+ },
110
+ "eslintIgnore": [
111
+ "node_modules/",
112
+ "lib/",
113
+ "jest.config.js"
114
+ ],
115
+ "react-native-builder-bob": {
116
+ "source": "src",
117
+ "output": "lib",
118
+ "targets": [
119
+ "commonjs",
120
+ "module",
121
+ [
122
+ "typescript",
123
+ {
124
+ "project": "tsconfig.build.json"
125
+ }
126
+ ]
127
+ ]
128
+ }
129
+ }
package/src/index.tsx ADDED
@@ -0,0 +1,58 @@
1
+ import { NativeModules, Platform } from 'react-native';
2
+
3
+ const LINKING_ERROR =
4
+ `The package 'bureau-sdk' doesn't seem to be linked. Make sure: \n\n` +
5
+ Platform.select({ ios: "- You have run 'pod install'\n", default: '' });
6
+ '- You rebuilt the app after installing the package\n' +
7
+ '- You are not using Expo Go\n';
8
+
9
+ const FraudNativeModule = NativeModules.FraudNativeModule
10
+ ? NativeModules.FraudNativeModule
11
+ : new Proxy(
12
+ {},
13
+ {
14
+ get() {
15
+ throw new Error(LINKING_ERROR);
16
+ },
17
+ }
18
+ );
19
+
20
+ export interface BureauConfig {
21
+ credentialId: string;
22
+ env: Environment;
23
+ enableBehavioralBiometrics?: boolean;
24
+ flow?: string;
25
+ }
26
+
27
+ export enum Environment {
28
+ PRODUCTION = 'production',
29
+ STAGING = 'staging',
30
+ }
31
+
32
+ // BureauSDK class for unified API
33
+ export class BureauSDK {
34
+
35
+ private constructor() { }
36
+
37
+ /**
38
+ * Static method to initialize the Bureau SDK with device intelligence
39
+ */
40
+ static async init(config: BureauConfig): Promise<BureauSDK> {
41
+ const api = new BureauSDK();
42
+ FraudNativeModule.initDeviceIntelligence(
43
+ config.credentialId,
44
+ config.env,
45
+ config.enableBehavioralBiometrics,
46
+ config.flow,
47
+ );
48
+ return api;
49
+ }
50
+
51
+ /**
52
+ * Submit device intelligence data
53
+ */
54
+ static async submit(): Promise<string> {
55
+ return await FraudNativeModule.submitDeviceIntelligence() as string;
56
+ }
57
+ }
58
+