@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.
Files changed (51) hide show
  1. package/README.md +6 -6
  2. package/android/build.gradle +16 -12
  3. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  4. package/android/gradle/wrapper/gradle-wrapper.properties +3 -1
  5. package/android/gradle.properties +4 -4
  6. package/android/gradlew +28 -13
  7. package/android/gradlew.bat +19 -16
  8. package/android/src/main/AndroidManifest.xml +1 -2
  9. package/android/src/main/java/{com/reactnativedidomi → io/didomi/reactnative}/DidomiModule.kt +8 -6
  10. package/android/src/main/java/{com/reactnativedidomi → io/didomi/reactnative}/DidomiPackage.kt +1 -2
  11. package/android/src/main/java/{com/reactnativedidomi → io/didomi/reactnative}/EventTypes.kt +11 -1
  12. package/ios/RNDidomi.swift +1 -0
  13. package/lib/commonjs/Constants.js +1 -1
  14. package/lib/commonjs/Constants.js.map +1 -1
  15. package/lib/commonjs/CurrentUserStatusTransaction.js.map +1 -1
  16. package/lib/commonjs/Didomi.js.map +1 -1
  17. package/lib/commonjs/DidomiListener.js +4 -14
  18. package/lib/commonjs/DidomiListener.js.map +1 -1
  19. package/lib/commonjs/DidomiTypes.js.map +1 -1
  20. package/lib/commonjs/index.js.map +1 -1
  21. package/lib/commonjs/package.json +1 -0
  22. package/lib/module/Constants.js +3 -1
  23. package/lib/module/Constants.js.map +1 -1
  24. package/lib/module/CurrentUserStatusTransaction.js +2 -0
  25. package/lib/module/CurrentUserStatusTransaction.js.map +1 -1
  26. package/lib/module/Didomi.js +2 -0
  27. package/lib/module/Didomi.js.map +1 -1
  28. package/lib/module/DidomiListener.js +6 -14
  29. package/lib/module/DidomiListener.js.map +1 -1
  30. package/lib/module/DidomiTypes.js +2 -0
  31. package/lib/module/DidomiTypes.js.map +1 -1
  32. package/lib/module/index.js +2 -0
  33. package/lib/module/index.js.map +1 -1
  34. package/lib/module/package.json +1 -0
  35. package/lib/typescript/Constants.d.ts +2 -1
  36. package/lib/typescript/Constants.d.ts.map +1 -0
  37. package/lib/typescript/CurrentUserStatusTransaction.d.ts +1 -0
  38. package/lib/typescript/CurrentUserStatusTransaction.d.ts.map +1 -0
  39. package/lib/typescript/Didomi.d.ts +1 -0
  40. package/lib/typescript/Didomi.d.ts.map +1 -0
  41. package/lib/typescript/DidomiListener.d.ts +1 -0
  42. package/lib/typescript/DidomiListener.d.ts.map +1 -0
  43. package/lib/typescript/DidomiTypes.d.ts +2 -0
  44. package/lib/typescript/DidomiTypes.d.ts.map +1 -0
  45. package/lib/typescript/index.d.ts +1 -0
  46. package/lib/typescript/index.d.ts.map +1 -0
  47. package/package.json +22 -87
  48. package/react-native-didomi.podspec +1 -1
  49. package/src/Constants.ts +1 -1
  50. package/src/DidomiListener.ts +5 -21
  51. 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.7.0",
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/testApp",
18
- "!lib/typescript/sampleApp",
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
- "release": "release-it",
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
- "@commitlint/config-conventional": "^11.0.0",
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": "^16.9.19",
57
- "@types/react-native": "0.62.13",
58
- "commitlint": "^11.0.0",
59
- "eslint": "^7.32.0",
60
- "eslint-config-prettier": "^7.0.0",
61
- "eslint-plugin-prettier": "^3.1.3",
62
- "husky": "^4.2.5",
63
- "jest": "^26.6.3",
64
- "pod-install": "^0.1.0",
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>/testApp/node_modules",
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",
@@ -16,5 +16,5 @@ Pod::Spec.new do |s|
16
16
  s.source_files = "ios/**/*.{h,m,mm,swift}"
17
17
 
18
18
  s.dependency "React-Core"
19
- s.dependency "Didomi-XCFramework", "2.11.1"
19
+ s.dependency "Didomi-XCFramework", "2.17.0"
20
20
  end
package/src/Constants.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  // User agent name
2
2
  export const DIDOMI_USER_AGENT_NAME = "Didomi React-Native SDK"
3
3
  // User agent version
4
- export const DIDOMI_VERSION = "2.7.0"
4
+ export const DIDOMI_VERSION = "2.8.0"
@@ -1,4 +1,4 @@
1
- import { NativeModules, NativeEventEmitter, EmitterSubscription } from 'react-native';
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
- if (subscription) {
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
- subscription = DidomiListener.eventEmitter.addListener(
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
- if (subscription) {
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
- subscription = DidomiListener.eventEmitter.addListener(
92
+ DidomiListener.eventEmitter.addListener(
109
93
  InternalEventType.ERROR_CALLBACK,
110
94
  listener
111
95
  );
@@ -150,6 +150,7 @@ export interface VendorStatus {
150
150
  }
151
151
 
152
152
  export interface SyncReadyEvent {
153
+ organizationUserId: string;
153
154
  statusApplied: boolean;
154
155
  syncAcknowledged: () => Promise<boolean>;
155
156
  }