@didomi/react-native 1.10.0 → 1.11.1
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/android/build.gradle +1 -1
- package/ios/RNDidomi.swift +28 -4
- package/lib/commonjs/Constants.js +1 -1
- package/lib/commonjs/Constants.js.map +1 -1
- package/lib/commonjs/Didomi.js +22 -22
- package/lib/commonjs/Didomi.js.map +1 -1
- package/lib/commonjs/DidomiTypes.js.map +1 -1
- package/lib/module/Constants.js +1 -1
- package/lib/module/Constants.js.map +1 -1
- package/lib/module/Didomi.js +22 -22
- package/lib/module/Didomi.js.map +1 -1
- package/lib/module/DidomiTypes.js.map +1 -1
- package/lib/typescript/Constants.d.ts +1 -1
- package/lib/typescript/Didomi.d.ts +38 -38
- package/lib/typescript/DidomiTypes.d.ts +17 -12
- package/package.json +3 -2
- package/react-native-didomi.podspec +1 -1
- package/src/Constants.ts +1 -1
- package/src/Didomi.ts +38 -38
- package/src/DidomiTypes.ts +17 -12
package/src/Didomi.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NativeModules } from 'react-native';
|
|
2
2
|
import { DidomiListener } from './DidomiListener';
|
|
3
|
-
import { DidomiEventType } from './DidomiTypes';
|
|
3
|
+
import { DidomiEventType, Purpose, UserStatus, Vendor } from './DidomiTypes';
|
|
4
4
|
import { DIDOMI_USER_AGENT_NAME, DIDOMI_VERSION } from './Constants';
|
|
5
5
|
|
|
6
6
|
const { Didomi: RNDidomi } = NativeModules;
|
|
@@ -116,65 +116,65 @@ export const Didomi = {
|
|
|
116
116
|
* Method used to get an array of disabled purposes.
|
|
117
117
|
* @returns: array of disabled purposes.
|
|
118
118
|
* @deprecated use {@link #getUserStatus()} instead. The result of this method
|
|
119
|
-
* has been replaced by getUserStatus().
|
|
119
|
+
* has been replaced by getUserStatus().purposes.consent.disabled.
|
|
120
120
|
*/
|
|
121
|
-
getDisabledPurposes: (): Promise<
|
|
121
|
+
getDisabledPurposes: (): Promise<Purpose[]> => RNDidomi.getDisabledPurposes(),
|
|
122
122
|
|
|
123
123
|
/**
|
|
124
124
|
* Method used to get a set of disabled purpose IDs.
|
|
125
125
|
* @returns: set that contains the IDs of disabled purposes.
|
|
126
126
|
* @deprecated use {@link #getUserStatus()} instead. The result of this method
|
|
127
|
-
* has been replaced by getUserStatus().
|
|
127
|
+
* has been replaced by getUserStatus().purposes.consent.enabled.
|
|
128
128
|
*/
|
|
129
|
-
getDisabledPurposeIds: (): Promise<
|
|
129
|
+
getDisabledPurposeIds: (): Promise<string[]> => RNDidomi.getDisabledPurposeIds(),
|
|
130
130
|
|
|
131
131
|
/**
|
|
132
132
|
* Method used to get an array of disabled vendors.
|
|
133
133
|
* @returns: array of disabled vendors.
|
|
134
134
|
* @deprecated use {@link #getUserStatus()} instead. The result of this method
|
|
135
|
-
* has been replaced by getUserStatus().
|
|
135
|
+
* has been replaced by getUserStatus().vendors.consent.disabled.
|
|
136
136
|
*/
|
|
137
|
-
getDisabledVendors: (): Promise<
|
|
137
|
+
getDisabledVendors: (): Promise<Vendor[]> => RNDidomi.getDisabledVendors(),
|
|
138
138
|
|
|
139
139
|
/**
|
|
140
140
|
* Method used to get a set of disabled vendor IDs.
|
|
141
141
|
* @returns: set that contains the IDs of disabled vendors.
|
|
142
142
|
* @deprecated use {@link #getUserStatus()} instead. The result of this method
|
|
143
|
-
* has been replaced by getUserStatus().
|
|
143
|
+
* has been replaced by getUserStatus().vendors.consent.disabled.
|
|
144
144
|
*/
|
|
145
|
-
getDisabledVendorIds: (): Promise<
|
|
145
|
+
getDisabledVendorIds: (): Promise<string[]> => RNDidomi.getDisabledVendorIds(),
|
|
146
146
|
|
|
147
147
|
/**
|
|
148
148
|
* Method used to get an array of enabled purposes.
|
|
149
149
|
* @returns: array of enabled purposes.
|
|
150
150
|
* @deprecated use {@link #getUserStatus()} instead. The result of this method
|
|
151
|
-
* has been replaced by getUserStatus().
|
|
151
|
+
* has been replaced by getUserStatus().purposes.consent.enabled.
|
|
152
152
|
*/
|
|
153
|
-
getEnabledPurposes: (): Promise<
|
|
153
|
+
getEnabledPurposes: (): Promise<Purpose[]> => RNDidomi.getEnabledPurposes(),
|
|
154
154
|
|
|
155
155
|
/**
|
|
156
156
|
* Method used to get a set of enabled purpose IDs.
|
|
157
157
|
* @returns: set that contains the IDs of enabled purposes.
|
|
158
158
|
* @deprecated use {@link #getUserStatus()} instead. The result of this method
|
|
159
|
-
* has been replaced by getUserStatus().
|
|
159
|
+
* has been replaced by getUserStatus().purposes.consent.enabled.
|
|
160
160
|
*/
|
|
161
|
-
getEnabledPurposeIds: (): Promise<
|
|
161
|
+
getEnabledPurposeIds: (): Promise<string[]> => RNDidomi.getEnabledPurposeIds(),
|
|
162
162
|
|
|
163
163
|
/**
|
|
164
164
|
* Method used to get an array of enabled vendors.
|
|
165
165
|
* @returns: array of enabled vendors.
|
|
166
166
|
* @deprecated use {@link #getUserStatus()} instead. The result of this method
|
|
167
|
-
* has been replaced by getUserStatus().
|
|
167
|
+
* has been replaced by getUserStatus().vendors.consent.enabled.
|
|
168
168
|
*/
|
|
169
|
-
getEnabledVendors: (): Promise<
|
|
169
|
+
getEnabledVendors: (): Promise<Vendor[]> => RNDidomi.getEnabledVendors(),
|
|
170
170
|
|
|
171
171
|
/**
|
|
172
172
|
* Method used to get a set of enabled vendor IDs.
|
|
173
173
|
* @returns: set that contains the IDs of enabled vendors.
|
|
174
174
|
* @deprecated use {@link #getUserStatus()} instead. The result of this method
|
|
175
|
-
* has been replaced by getUserStatus().
|
|
175
|
+
* has been replaced by getUserStatus().vendors.consent.enabled.
|
|
176
176
|
*/
|
|
177
|
-
getEnabledVendorIds: (): Promise<
|
|
177
|
+
getEnabledVendorIds: (): Promise<string[]> => RNDidomi.getEnabledVendorIds(),
|
|
178
178
|
|
|
179
179
|
/**
|
|
180
180
|
* Get JavaScript to embed into a WebView to pass the consent status from the app
|
|
@@ -192,32 +192,32 @@ export const Didomi = {
|
|
|
192
192
|
* @param purposeId: purpose ID used in the search.
|
|
193
193
|
* @returns: purpose found in the array.
|
|
194
194
|
*/
|
|
195
|
-
getPurpose: (purposeId: string): Promise<
|
|
195
|
+
getPurpose: (purposeId: string): Promise<Purpose> => RNDidomi.getPurpose(purposeId),
|
|
196
196
|
|
|
197
197
|
/**
|
|
198
198
|
* Method used to get an array of required purposes.
|
|
199
199
|
*
|
|
200
200
|
* @returns: array of required purposes.
|
|
201
201
|
*/
|
|
202
|
-
getRequiredPurposes: (): Promise<
|
|
202
|
+
getRequiredPurposes: (): Promise<Purpose[]> => RNDidomi.getRequiredPurposes(),
|
|
203
203
|
|
|
204
204
|
/**
|
|
205
205
|
* Get the configured purpose IDs
|
|
206
206
|
* @returns: set of purpose IDs.
|
|
207
207
|
*/
|
|
208
|
-
getRequiredPurposeIds: (): Promise<
|
|
208
|
+
getRequiredPurposeIds: (): Promise<string[]> => RNDidomi.getRequiredPurposeIds(),
|
|
209
209
|
|
|
210
210
|
/**
|
|
211
211
|
* Method used to get an array of required vendors.
|
|
212
212
|
* @returns: array of required vendors.
|
|
213
213
|
*/
|
|
214
|
-
getRequiredVendors: (): Promise<
|
|
214
|
+
getRequiredVendors: (): Promise<Vendor[]> => RNDidomi.getRequiredVendors(),
|
|
215
215
|
|
|
216
216
|
/**
|
|
217
217
|
* Get the configured vendor IDs
|
|
218
218
|
* @returns: set of vendor IDs.
|
|
219
219
|
*/
|
|
220
|
-
getRequiredVendorIds: (): Promise<
|
|
220
|
+
getRequiredVendorIds: (): Promise<string[]> => RNDidomi.getRequiredVendorIds(),
|
|
221
221
|
|
|
222
222
|
/**
|
|
223
223
|
* Method used to get a dictionary/map in the form of { "en": "Key in English", "fr": "Key in French." }
|
|
@@ -255,8 +255,8 @@ export const Didomi = {
|
|
|
255
255
|
* @param purposeId: The purpose ID to check consent for
|
|
256
256
|
* @returns: The user consent status for the specified purpose
|
|
257
257
|
* @deprecated use {@link #getUserStatus()} instead. Search the purposeId in
|
|
258
|
-
|
|
259
|
-
* getUserStatus().
|
|
258
|
+
* getUserStatus().purposes.consent.enabled or
|
|
259
|
+
* getUserStatus().purposes.consent.enabled.
|
|
260
260
|
*/
|
|
261
261
|
getUserConsentStatusForPurpose: (purposeId: string): Promise<boolean> => RNDidomi.getUserConsentStatusForPurpose(purposeId),
|
|
262
262
|
|
|
@@ -265,8 +265,8 @@ export const Didomi = {
|
|
|
265
265
|
* @param vendorId: The vendor ID to check consent for
|
|
266
266
|
* @returns: The user consent status for the specified vendor
|
|
267
267
|
* @deprecated use {@link #getUserStatus()} instead. Search the vendorId in
|
|
268
|
-
* getUserStatus().
|
|
269
|
-
* getUserStatus().
|
|
268
|
+
* getUserStatus().vendors.consent.enabled or
|
|
269
|
+
* getUserStatus().vendors.consent.disabled.
|
|
270
270
|
*/
|
|
271
271
|
getUserConsentStatusForVendor: (vendorId: string): Promise<boolean> => RNDidomi.getUserConsentStatusForVendor(vendorId),
|
|
272
272
|
|
|
@@ -275,8 +275,8 @@ export const Didomi = {
|
|
|
275
275
|
* @param vendorId: The ID of the vendor
|
|
276
276
|
* @returns: The user consent status corresponding to the specified vendor and all its required purposes.
|
|
277
277
|
* @deprecated use {@link #getUserStatus()} instead. The result of this method has been replaced
|
|
278
|
-
* by getUserStatus().
|
|
279
|
-
* getUserStatus().
|
|
278
|
+
* by getUserStatus().vendors.global_consent.enabled or
|
|
279
|
+
* getUserStatus().vendors.global_consent.disabled.
|
|
280
280
|
*/
|
|
281
281
|
getUserConsentStatusForVendorAndRequiredPurposes: (vendorId: string): Promise<boolean> => RNDidomi.getUserConsentStatusForVendorAndRequiredPurposes(vendorId),
|
|
282
282
|
|
|
@@ -285,8 +285,8 @@ export const Didomi = {
|
|
|
285
285
|
* @param purposeId: purpose ID.
|
|
286
286
|
* @returns: LI status of a purpose.
|
|
287
287
|
* @deprecated use {@link #getUserStatus()} instead. Search the purposeId in
|
|
288
|
-
* getUserStatus().
|
|
289
|
-
* getUserStatus().
|
|
288
|
+
* getUserStatus().purposes.consent.enabled or
|
|
289
|
+
* getUserStatus().purposes.consent.enabled.
|
|
290
290
|
*/
|
|
291
291
|
getUserLegitimateInterestStatusForPurpose: (purposeId: string): Promise<boolean> => RNDidomi.getUserLegitimateInterestStatusForPurpose(purposeId),
|
|
292
292
|
|
|
@@ -295,8 +295,8 @@ export const Didomi = {
|
|
|
295
295
|
* @param vendorId: vendor ID.
|
|
296
296
|
* @returns: LI status of a vendor.
|
|
297
297
|
* @deprecated use {@link #getUserStatus()} instead. Search the vendorId in
|
|
298
|
-
* getUserStatus().
|
|
299
|
-
* getUserStatus().
|
|
298
|
+
* getUserStatus().vendors.legitimate_interest.enabled or
|
|
299
|
+
* getUserStatus().vendors.legitimate_interest.disabled.
|
|
300
300
|
*/
|
|
301
301
|
getUserLegitimateInterestForVendor: (vendorId: string): Promise<boolean> => RNDidomi.getUserLegitimateInterestStatusForVendor(vendorId),
|
|
302
302
|
|
|
@@ -305,8 +305,8 @@ export const Didomi = {
|
|
|
305
305
|
* @param vendorId: vendor ID.
|
|
306
306
|
* @returns: The user LI status corresponding to the specified vendor and all its required purposes.
|
|
307
307
|
* @deprecated use {@link #getUserStatus()} instead. Search the purposeId in
|
|
308
|
-
* getUserStatus().
|
|
309
|
-
* getUserStatus().
|
|
308
|
+
* getUserStatus().vendors.global_legitimate_interest.enabled or
|
|
309
|
+
* getUserStatus().vendors.global_legitimate_interest.disabled.
|
|
310
310
|
*/
|
|
311
311
|
getUserLegitimateInterestStatusForVendorAndRequiredPurposes: (vendorId: string): boolean => RNDidomi.getUserLegitimateInterestStatusForVendorAndRequiredPurposes(vendorId),
|
|
312
312
|
|
|
@@ -314,15 +314,15 @@ export const Didomi = {
|
|
|
314
314
|
* Get the user consent status.
|
|
315
315
|
* @returns: status that represents user consent.
|
|
316
316
|
*/
|
|
317
|
-
getUserStatus: (): Promise<
|
|
317
|
+
getUserStatus: (): Promise<UserStatus> => RNDidomi.getUserStatus(),
|
|
318
318
|
|
|
319
319
|
/**
|
|
320
320
|
* Get the user consent and legitimate interest status for a specific vendor.
|
|
321
321
|
* @param vendorId: vendor ID.
|
|
322
322
|
* @returns: status that represents both consent and legitimate interest status of a vendor.
|
|
323
323
|
* @deprecated use {@link #getUserStatus()} instead. Search the vendorId in
|
|
324
|
-
* getUserStatus().
|
|
325
|
-
* getUserStatus().
|
|
324
|
+
* getUserStatus().vendors.global.enabled or
|
|
325
|
+
* getUserStatus().vendors.global.disabled.
|
|
326
326
|
*/
|
|
327
327
|
getUserStatusForVendor: (vendorId: string): Promise<boolean> => RNDidomi.getUserStatusForVendor(vendorId),
|
|
328
328
|
|
|
@@ -331,7 +331,7 @@ export const Didomi = {
|
|
|
331
331
|
* @param vendorId: vendor ID used in the search.
|
|
332
332
|
* @returns: vendor found in the array.
|
|
333
333
|
*/
|
|
334
|
-
getVendor: (vendorId: string): Promise<
|
|
334
|
+
getVendor: (vendorId: string): Promise<Vendor> => RNDidomi.getVendor(vendorId),
|
|
335
335
|
|
|
336
336
|
/**
|
|
337
337
|
* Hide the notice if it is currently displayed
|
package/src/DidomiTypes.ts
CHANGED
|
@@ -37,14 +37,19 @@ export enum DidomiEventType {
|
|
|
37
37
|
|
|
38
38
|
export interface Vendor {
|
|
39
39
|
id: string;
|
|
40
|
+
iabId: string
|
|
40
41
|
name: string;
|
|
41
|
-
|
|
42
|
+
policyUrl: string;
|
|
42
43
|
namespace: string;
|
|
43
44
|
namespaces: VendorNamespaces;
|
|
44
45
|
iabVendor: boolean;
|
|
45
|
-
|
|
46
|
+
purposeIds: string[];
|
|
47
|
+
flexiblePurposeIds: string[];
|
|
48
|
+
specialPurposeIds: string[];
|
|
46
49
|
legIntPurposeIds: string[];
|
|
47
|
-
|
|
50
|
+
specialFeatureIds: string[];
|
|
51
|
+
cookieMaxAgeSeconds: number
|
|
52
|
+
usesNonCookieAccess: boolean;
|
|
48
53
|
}
|
|
49
54
|
|
|
50
55
|
export interface VendorNamespaces {
|
|
@@ -67,11 +72,11 @@ export interface Purpose {
|
|
|
67
72
|
|
|
68
73
|
export interface PurposeCategory {
|
|
69
74
|
id: string;
|
|
70
|
-
|
|
75
|
+
purposeId: string;
|
|
71
76
|
icon: string;
|
|
72
77
|
type: string;
|
|
73
78
|
name: Map<string>;
|
|
74
|
-
|
|
79
|
+
description: Map<string>;
|
|
75
80
|
children: PurposeCategory[];
|
|
76
81
|
}
|
|
77
82
|
|
|
@@ -83,27 +88,27 @@ export interface Map<T> {
|
|
|
83
88
|
export interface UserStatus {
|
|
84
89
|
purposes: UserStatusPurposes;
|
|
85
90
|
vendors: UserStatusVendors;
|
|
86
|
-
|
|
91
|
+
user_id: string;
|
|
87
92
|
created: string;
|
|
88
93
|
updated: string;
|
|
89
|
-
|
|
90
|
-
|
|
94
|
+
consent_string: string;
|
|
95
|
+
additional_consent: string;
|
|
91
96
|
regulation: string;
|
|
92
97
|
}
|
|
93
98
|
|
|
94
99
|
export interface UserStatusPurposes {
|
|
95
100
|
global: UserStatusIds;
|
|
96
101
|
consent: UserStatusIds;
|
|
97
|
-
|
|
102
|
+
legitimate_interest: UserStatusIds;
|
|
98
103
|
essential: UserStatusIds;
|
|
99
104
|
}
|
|
100
105
|
|
|
101
106
|
export interface UserStatusVendors {
|
|
102
107
|
global: UserStatusIds;
|
|
103
|
-
|
|
104
|
-
|
|
108
|
+
global_consent: UserStatusIds;
|
|
109
|
+
global_legitimate_interest: UserStatusIds;
|
|
105
110
|
consent: UserStatusIds;
|
|
106
|
-
|
|
111
|
+
legitimate_interest: UserStatusIds;
|
|
107
112
|
}
|
|
108
113
|
|
|
109
114
|
export interface UserStatusIds {
|