@didomi/react-native 2.7.0 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/android/build.gradle +16 -12
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +3 -1
- package/android/gradle.properties +4 -4
- package/android/gradlew +28 -13
- package/android/gradlew.bat +19 -16
- package/android/src/main/AndroidManifest.xml +1 -2
- package/android/src/main/java/{com/reactnativedidomi → io/didomi/reactnative}/DidomiModule.kt +8 -6
- package/android/src/main/java/{com/reactnativedidomi → io/didomi/reactnative}/DidomiPackage.kt +1 -2
- package/android/src/main/java/{com/reactnativedidomi → io/didomi/reactnative}/EventTypes.kt +11 -1
- package/ios/RNDidomi.swift +1 -0
- package/lib/commonjs/Constants.js +1 -1
- package/lib/commonjs/Constants.js.map +1 -1
- package/lib/commonjs/CurrentUserStatusTransaction.js.map +1 -1
- package/lib/commonjs/Didomi.js.map +1 -1
- package/lib/commonjs/DidomiListener.js +4 -14
- package/lib/commonjs/DidomiListener.js.map +1 -1
- package/lib/commonjs/DidomiTypes.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/package.json +1 -0
- package/lib/module/Constants.js +3 -1
- package/lib/module/Constants.js.map +1 -1
- package/lib/module/CurrentUserStatusTransaction.js +2 -0
- package/lib/module/CurrentUserStatusTransaction.js.map +1 -1
- package/lib/module/Didomi.js +2 -0
- package/lib/module/Didomi.js.map +1 -1
- package/lib/module/DidomiListener.js +6 -14
- package/lib/module/DidomiListener.js.map +1 -1
- package/lib/module/DidomiTypes.js +2 -0
- package/lib/module/DidomiTypes.js.map +1 -1
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/package.json +1 -0
- package/lib/typescript/Constants.d.ts +2 -1
- package/lib/typescript/Constants.d.ts.map +1 -0
- package/lib/typescript/CurrentUserStatusTransaction.d.ts +1 -0
- package/lib/typescript/CurrentUserStatusTransaction.d.ts.map +1 -0
- package/lib/typescript/Didomi.d.ts +1 -0
- package/lib/typescript/Didomi.d.ts.map +1 -0
- package/lib/typescript/DidomiListener.d.ts +1 -0
- package/lib/typescript/DidomiListener.d.ts.map +1 -0
- package/lib/typescript/DidomiTypes.d.ts +2 -0
- package/lib/typescript/DidomiTypes.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +1 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/package.json +22 -87
- package/react-native-didomi.podspec +1 -1
- package/src/Constants.ts +1 -1
- package/src/DidomiListener.ts +5 -21
- package/src/DidomiTypes.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@didomi/react-native",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.0",
|
|
4
4
|
"description": "Didomi React Native SDK",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -14,24 +14,24 @@
|
|
|
14
14
|
"ios",
|
|
15
15
|
"cpp",
|
|
16
16
|
"react-native-didomi.podspec",
|
|
17
|
-
"!lib/typescript/
|
|
18
|
-
"!lib/typescript/
|
|
17
|
+
"!lib/typescript/sample",
|
|
18
|
+
"!lib/typescript/test",
|
|
19
19
|
"!android/build",
|
|
20
20
|
"!ios/build",
|
|
21
21
|
"!**/__tests__",
|
|
22
22
|
"!**/__fixtures__",
|
|
23
23
|
"!**/__mocks__"
|
|
24
24
|
],
|
|
25
|
+
"workspaces": [
|
|
26
|
+
".",
|
|
27
|
+
"sample",
|
|
28
|
+
"test"
|
|
29
|
+
],
|
|
25
30
|
"scripts": {
|
|
26
31
|
"test": "jest",
|
|
27
32
|
"typescript": "tsc --noEmit",
|
|
28
|
-
"lint": "eslint --quiet \"**/*.{js,ts,tsx}\"",
|
|
29
33
|
"prepare": "bob build",
|
|
30
|
-
"
|
|
31
|
-
"testApp": "yarn --cwd testApp",
|
|
32
|
-
"sampleApp": "yarn --cwd sampleApp",
|
|
33
|
-
"pods": "cd testApp && pod-install --quiet",
|
|
34
|
-
"bootstrap": "yarn testApp && yarn sampleApp && yarn && yarn && yarn pods"
|
|
34
|
+
"pods": "cd test && pod-install --quiet"
|
|
35
35
|
},
|
|
36
36
|
"keywords": [
|
|
37
37
|
"react-native",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
],
|
|
41
41
|
"repository": {
|
|
42
42
|
"type": "git",
|
|
43
|
-
"url": "https://github.com/didomi/react-native"
|
|
43
|
+
"url": "git+https://github.com/didomi/react-native.git"
|
|
44
44
|
},
|
|
45
45
|
"author": "Didomi",
|
|
46
46
|
"license": "BSD-3",
|
|
@@ -49,25 +49,17 @@
|
|
|
49
49
|
"registry": "https://registry.npmjs.org/"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@
|
|
53
|
-
"@react-native-community/eslint-config": "^2.0.0",
|
|
54
|
-
"@release-it/conventional-changelog": "^2.0.0",
|
|
52
|
+
"@rnx-kit/metro-config": "^1.3.15",
|
|
55
53
|
"@types/jest": "^26.0.0",
|
|
56
|
-
"@types/react": "^
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"prettier": "^2.0.5",
|
|
66
|
-
"react": "17.0.2",
|
|
67
|
-
"react-native": "0.68.5",
|
|
68
|
-
"react-native-builder-bob": "^0.18.0",
|
|
69
|
-
"release-it": "^14.2.2",
|
|
70
|
-
"typescript": "^4.1.3"
|
|
54
|
+
"@types/react": "^18.3.3",
|
|
55
|
+
"jest": "^29.7.0",
|
|
56
|
+
"metro-config": "^0.80.9",
|
|
57
|
+
"pod-install": "^0.2.2",
|
|
58
|
+
"react": "18.2.0",
|
|
59
|
+
"react-native": "0.73.8",
|
|
60
|
+
"react-native-builder-bob": "^0.29.1",
|
|
61
|
+
"react-native-monorepo-tools": "^1.2.1",
|
|
62
|
+
"typescript": "^5.0.4"
|
|
71
63
|
},
|
|
72
64
|
"peerDependencies": {
|
|
73
65
|
"react": "*",
|
|
@@ -76,68 +68,11 @@
|
|
|
76
68
|
"jest": {
|
|
77
69
|
"preset": "react-native",
|
|
78
70
|
"modulePathIgnorePatterns": [
|
|
79
|
-
"<rootDir>/
|
|
71
|
+
"<rootDir>/sample/node_modules",
|
|
72
|
+
"<rootDir>/test/node_modules",
|
|
80
73
|
"<rootDir>/lib/"
|
|
81
74
|
]
|
|
82
75
|
},
|
|
83
|
-
"husky": {
|
|
84
|
-
"hooks": {
|
|
85
|
-
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
|
|
86
|
-
"pre-commit": "yarn lint && yarn typescript"
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
"commitlint": {
|
|
90
|
-
"extends": [
|
|
91
|
-
"@commitlint/config-conventional"
|
|
92
|
-
]
|
|
93
|
-
},
|
|
94
|
-
"release-it": {
|
|
95
|
-
"git": {
|
|
96
|
-
"commitMessage": "chore: release ${version}",
|
|
97
|
-
"tagName": "v${version}"
|
|
98
|
-
},
|
|
99
|
-
"npm": {
|
|
100
|
-
"publish": true
|
|
101
|
-
},
|
|
102
|
-
"github": {
|
|
103
|
-
"release": true
|
|
104
|
-
},
|
|
105
|
-
"plugins": {
|
|
106
|
-
"@release-it/conventional-changelog": {
|
|
107
|
-
"preset": "angular"
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
},
|
|
111
|
-
"eslintConfig": {
|
|
112
|
-
"root": true,
|
|
113
|
-
"extends": [
|
|
114
|
-
"@react-native-community",
|
|
115
|
-
"prettier"
|
|
116
|
-
],
|
|
117
|
-
"rules": {
|
|
118
|
-
"prettier/prettier": [
|
|
119
|
-
"error",
|
|
120
|
-
{
|
|
121
|
-
"quoteProps": "consistent",
|
|
122
|
-
"singleQuote": true,
|
|
123
|
-
"tabWidth": 2,
|
|
124
|
-
"trailingComma": "es5",
|
|
125
|
-
"useTabs": false
|
|
126
|
-
}
|
|
127
|
-
]
|
|
128
|
-
}
|
|
129
|
-
},
|
|
130
|
-
"eslintIgnore": [
|
|
131
|
-
"node_modules/",
|
|
132
|
-
"lib/"
|
|
133
|
-
],
|
|
134
|
-
"prettier": {
|
|
135
|
-
"quoteProps": "consistent",
|
|
136
|
-
"singleQuote": true,
|
|
137
|
-
"tabWidth": 2,
|
|
138
|
-
"trailingComma": "es5",
|
|
139
|
-
"useTabs": false
|
|
140
|
-
},
|
|
141
76
|
"react-native-builder-bob": {
|
|
142
77
|
"source": "src",
|
|
143
78
|
"output": "lib",
|
package/src/Constants.ts
CHANGED
package/src/DidomiListener.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NativeModules, NativeEventEmitter
|
|
1
|
+
import { NativeModules, NativeEventEmitter } from 'react-native';
|
|
2
2
|
import { DidomiEventType, VendorStatus } from './DidomiTypes';
|
|
3
3
|
|
|
4
4
|
const { Didomi: RNDidomi } = NativeModules;
|
|
@@ -72,19 +72,11 @@ export const DidomiListener = {
|
|
|
72
72
|
|
|
73
73
|
setOnReadyListener: (): Promise<void> => {
|
|
74
74
|
return new Promise<void>((resolve) => {
|
|
75
|
-
let subscription: EmitterSubscription;
|
|
76
75
|
const listener = (_event: any) => {
|
|
77
76
|
resolve();
|
|
78
|
-
|
|
79
|
-
subscription.remove();
|
|
80
|
-
} else if ('removeListener' in DidomiListener.eventEmitter) {
|
|
81
|
-
DidomiListener.eventEmitter.removeListener(
|
|
82
|
-
InternalEventType.READY_CALLBACK,
|
|
83
|
-
listener
|
|
84
|
-
);
|
|
85
|
-
}
|
|
77
|
+
DidomiListener.eventEmitter.removeAllListeners(InternalEventType.READY_CALLBACK);
|
|
86
78
|
};
|
|
87
|
-
|
|
79
|
+
DidomiListener.eventEmitter.addListener(
|
|
88
80
|
InternalEventType.READY_CALLBACK,
|
|
89
81
|
listener
|
|
90
82
|
);
|
|
@@ -93,19 +85,11 @@ export const DidomiListener = {
|
|
|
93
85
|
|
|
94
86
|
setOnErrorListener: (): Promise<void> => {
|
|
95
87
|
return new Promise<void>((resolve) => {
|
|
96
|
-
let subscription: EmitterSubscription;
|
|
97
88
|
const listener = (_event: any) => {
|
|
98
89
|
resolve(_event);
|
|
99
|
-
|
|
100
|
-
subscription.remove();
|
|
101
|
-
} else if ('removeListener' in DidomiListener.eventEmitter) {
|
|
102
|
-
DidomiListener.eventEmitter.removeListener(
|
|
103
|
-
InternalEventType.ERROR_CALLBACK,
|
|
104
|
-
listener
|
|
105
|
-
);
|
|
106
|
-
}
|
|
90
|
+
DidomiListener.eventEmitter.removeAllListeners(InternalEventType.ERROR_CALLBACK);
|
|
107
91
|
};
|
|
108
|
-
|
|
92
|
+
DidomiListener.eventEmitter.addListener(
|
|
109
93
|
InternalEventType.ERROR_CALLBACK,
|
|
110
94
|
listener
|
|
111
95
|
);
|