@didomi/react-native 2.3.0 → 2.5.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.
@@ -1,4 +1,4 @@
1
- import { DidomiEventType, Purpose, Vendor, UserStatus, CurrentUserStatus, VendorStatus } from './DidomiTypes';
1
+ import { DidomiEventType, Purpose, Vendor, UserStatus, CurrentUserStatus, VendorStatus, UserAuthParams } from './DidomiTypes';
2
2
  import { CurrentUserStatusTransaction } from './CurrentUserStatusTransaction';
3
3
  export declare const Didomi: {
4
4
  /**
@@ -13,8 +13,10 @@ export declare const Didomi: {
13
13
  * @param noticeId: Notice id for the remote configuration.
14
14
  * @param androidTvNoticeId: Notice id for the remote configuration when running on Android TV device (ignored on iOS / tvOS). Note that using remote configuration is mandatory for TV devices.
15
15
  * @param androidTvEnabled: Whether to allow Didomi SDK to run on Android TV, default to "false".
16
+ * @param countryCode: Override user country code when determining the privacy regulation to apply. Keep undefined to let the Didomi SDK determine the user country.
17
+ * @param regionCode: Override user region code when determining the privacy regulation to apply. Keep undefined to let the Didomi SDK determine the user region. Ignored if countryCode is not set.
16
18
  */
17
- initialize: (apiKey: string, localConfigurationPath?: string, remoteConfigurationUrl?: string, providerId?: string, disableDidomiRemoteConfig?: boolean, languageCode?: string, noticeId?: string, androidTvNoticeId?: string, androidTvEnabled?: boolean) => Promise<void>;
19
+ initialize: (apiKey: string, localConfigurationPath?: string, remoteConfigurationUrl?: string, providerId?: string, disableDidomiRemoteConfig?: boolean, languageCode?: string, noticeId?: string, androidTvNoticeId?: string, androidTvEnabled?: boolean, countryCode?: string, regionCode?: string) => Promise<void>;
18
20
  /**
19
21
  * Listen to SDK ready state
20
22
  */
@@ -80,57 +82,49 @@ export declare const Didomi: {
80
82
  /**
81
83
  * Method used to get an array of disabled purposes.
82
84
  * @returns: array of disabled purposes.
83
- * @deprecated use {@link #getUserStatus()} instead. The result of this method
84
- * has been replaced by getUserStatus().purposes.consent.disabled.
85
+ * @deprecated use {@link #getCurrentUserStatus()} instead.
85
86
  */
86
87
  getDisabledPurposes: () => Promise<Purpose[]>;
87
88
  /**
88
89
  * Method used to get a set of disabled purpose IDs.
89
90
  * @returns: set that contains the IDs of disabled purposes.
90
- * @deprecated use {@link #getUserStatus()} instead. The result of this method
91
- * has been replaced by getUserStatus().purposes.consent.enabled.
91
+ * @deprecated use {@link #getCurrentUserStatus()} instead.
92
92
  */
93
93
  getDisabledPurposeIds: () => Promise<string[]>;
94
94
  /**
95
95
  * Method used to get an array of disabled vendors.
96
96
  * @returns: array of disabled vendors.
97
- * @deprecated use {@link #getUserStatus()} instead. The result of this method
98
- * has been replaced by getUserStatus().vendors.consent.disabled.
97
+ * @deprecated use {@link #getCurrentUserStatus()} instead.
99
98
  */
100
99
  getDisabledVendors: () => Promise<Vendor[]>;
101
100
  /**
102
101
  * Method used to get a set of disabled vendor IDs.
103
102
  * @returns: set that contains the IDs of disabled vendors.
104
- * @deprecated use {@link #getUserStatus()} instead. The result of this method
105
- * has been replaced by getUserStatus().vendors.consent.disabled.
103
+ * @deprecated use {@link #getCurrentUserStatus()} instead.
106
104
  */
107
105
  getDisabledVendorIds: () => Promise<string[]>;
108
106
  /**
109
107
  * Method used to get an array of enabled purposes.
110
108
  * @returns: array of enabled purposes.
111
- * @deprecated use {@link #getUserStatus()} instead. The result of this method
112
- * has been replaced by getUserStatus().purposes.consent.enabled.
109
+ * @deprecated use {@link #getCurrentUserStatus()} instead.
113
110
  */
114
111
  getEnabledPurposes: () => Promise<Purpose[]>;
115
112
  /**
116
113
  * Method used to get a set of enabled purpose IDs.
117
114
  * @returns: set that contains the IDs of enabled purposes.
118
- * @deprecated use {@link #getUserStatus()} instead. The result of this method
119
- * has been replaced by getUserStatus().purposes.consent.enabled.
115
+ * @deprecated use {@link #getCurrentUserStatus()} instead.
120
116
  */
121
117
  getEnabledPurposeIds: () => Promise<string[]>;
122
118
  /**
123
119
  * Method used to get an array of enabled vendors.
124
120
  * @returns: array of enabled vendors.
125
- * @deprecated use {@link #getUserStatus()} instead. The result of this method
126
- * has been replaced by getUserStatus().vendors.consent.enabled.
121
+ * @deprecated use {@link #getCurrentUserStatus()} instead.
127
122
  */
128
123
  getEnabledVendors: () => Promise<Vendor[]>;
129
124
  /**
130
125
  * Method used to get a set of enabled vendor IDs.
131
126
  * @returns: set that contains the IDs of enabled vendors.
132
- * @deprecated use {@link #getUserStatus()} instead. The result of this method
133
- * has been replaced by getUserStatus().vendors.consent.enabled.
127
+ * @deprecated use {@link #getCurrentUserStatus()} instead.
134
128
  */
135
129
  getEnabledVendorIds: () => Promise<string[]>;
136
130
  /**
@@ -157,6 +151,7 @@ export declare const Didomi: {
157
151
  /**
158
152
  * Get the configured purpose IDs
159
153
  * @returns: set of purpose IDs.
154
+ * @deprecated use {@link #getRequiredPurposes()} instead.
160
155
  */
161
156
  getRequiredPurposeIds: () => Promise<string[]>;
162
157
  /**
@@ -167,6 +162,7 @@ export declare const Didomi: {
167
162
  /**
168
163
  * Get the configured vendor IDs
169
164
  * @returns: set of vendor IDs.
165
+ * @deprecated use {@link #getRequiredVendors()} instead.
170
166
  */
171
167
  getRequiredVendorIds: () => Promise<string[]>;
172
168
  /**
@@ -202,54 +198,42 @@ export declare const Didomi: {
202
198
  * Get the user consent status for a specific purpose
203
199
  * @param purposeId: The purpose ID to check consent for
204
200
  * @returns: The user consent status for the specified purpose
205
- * @deprecated use {@link #getUserStatus()} instead. Search the purposeId in
206
- * getUserStatus().purposes.consent.enabled or
207
- * getUserStatus().purposes.consent.enabled.
201
+ * @deprecated use {@link #getCurrentUserStatus()} instead.
208
202
  */
209
203
  getUserConsentStatusForPurpose: (purposeId: string) => Promise<boolean>;
210
204
  /**
211
205
  * Get the user consent status for a specific vendor
212
206
  * @param vendorId: The vendor ID to check consent for
213
207
  * @returns: The user consent status for the specified vendor
214
- * @deprecated use {@link #getUserStatus()} instead. Search the vendorId in
215
- * getUserStatus().vendors.consent.enabled or
216
- * getUserStatus().vendors.consent.disabled.
208
+ * @deprecated use {@link #getCurrentUserStatus()} instead.
217
209
  */
218
210
  getUserConsentStatusForVendor: (vendorId: string) => Promise<boolean>;
219
211
  /**
220
212
  * Get the user consent status for a specific vendor and all its purposes
221
213
  * @param vendorId: The ID of the vendor
222
214
  * @returns: The user consent status corresponding to the specified vendor and all its required purposes.
223
- * @deprecated use {@link #getUserStatus()} instead. The result of this method has been replaced
224
- * by getUserStatus().vendors.global_consent.enabled or
225
- * getUserStatus().vendors.global_consent.disabled.
215
+ * @deprecated use {@link #getCurrentUserStatus()} instead.
226
216
  */
227
217
  getUserConsentStatusForVendorAndRequiredPurposes: (vendorId: string) => Promise<boolean>;
228
218
  /**
229
219
  * Get the user legitimate interest status for a specific purpose.
230
220
  * @param purposeId: purpose ID.
231
221
  * @returns: LI status of a purpose.
232
- * @deprecated use {@link #getUserStatus()} instead. Search the purposeId in
233
- * getUserStatus().purposes.consent.enabled or
234
- * getUserStatus().purposes.consent.enabled.
222
+ * @deprecated use {@link #getCurrentUserStatus()} instead.
235
223
  */
236
224
  getUserLegitimateInterestStatusForPurpose: (purposeId: string) => Promise<boolean>;
237
225
  /**
238
226
  * Get the user legitimate interest status for a specific vendor.
239
227
  * @param vendorId: vendor ID.
240
228
  * @returns: LI status of a vendor.
241
- * @deprecated use {@link #getUserStatus()} instead. Search the vendorId in
242
- * getUserStatus().vendors.legitimate_interest.enabled or
243
- * getUserStatus().vendors.legitimate_interest.disabled.
229
+ * @deprecated use {@link #getCurrentUserStatus()} instead.
244
230
  */
245
231
  getUserLegitimateInterestForVendor: (vendorId: string) => Promise<boolean>;
246
232
  /**
247
233
  * Get the user LI status for a specific vendor and all its purposes.
248
234
  * @param vendorId: vendor ID.
249
235
  * @returns: The user LI status corresponding to the specified vendor and all its required purposes.
250
- * @deprecated use {@link #getUserStatus()} instead. Search the purposeId in
251
- * getUserStatus().vendors.global_legitimate_interest.enabled or
252
- * getUserStatus().vendors.global_legitimate_interest.disabled.
236
+ * @deprecated use {@link #getCurrentUserStatus()} instead.
253
237
  */
254
238
  getUserLegitimateInterestStatusForVendorAndRequiredPurposes: (vendorId: string) => boolean;
255
239
  /**
@@ -260,6 +244,7 @@ export declare const Didomi: {
260
244
  /**
261
245
  * Get the user consent status.
262
246
  * @returns: status that represents user consent.
247
+ * @deprecated use {@link #getCurrentUserStatus()} instead.
263
248
  */
264
249
  getUserStatus: () => Promise<UserStatus>;
265
250
  /**
@@ -291,6 +276,7 @@ export declare const Didomi: {
291
276
  * - The company is from the EU.
292
277
  * - The user country is unknown and the app has chosen to collect consent when unknown.
293
278
  * @returns: **true** if consent is required, **false** if it is not required.
279
+ * @deprecated use {@link #shouldUserStatusBeCollected()} instead.
294
280
  */
295
281
  isConsentRequired: () => Promise<boolean>;
296
282
  /**
@@ -304,6 +290,7 @@ export declare const Didomi: {
304
290
  /**
305
291
  * Determine if consent information is available for all purposes and vendors that are required
306
292
  * @returns: **true** if consent is required and consent information is available, **false** otherwise.
293
+ * @deprecated use {@link #isUserStatusPartial()} instead.
307
294
  */
308
295
  isUserConsentStatusPartial: () => Promise<boolean>;
309
296
  /**
@@ -351,6 +338,7 @@ export declare const Didomi: {
351
338
  * @param digest Digest of the organization user ID and secret
352
339
  * @param salt Salt used for computing the digest (optional)
353
340
  * @param expiration Expiration date as timestamp (to prevent replay attacks)
341
+ * @deprecated use {@link #setUserWithAuthParams()} instead.
354
342
  */
355
343
  setUserWithHashAuth: (id: string, algorithm: string, secretId: string, digest: string, salt?: string, expiration?: BigInt) => void;
356
344
  /**
@@ -362,6 +350,7 @@ export declare const Didomi: {
362
350
  * @param digest Digest of the organization user ID and secret
363
351
  * @param salt Salt used for computing the digest (optional)
364
352
  * @param expiration Expiration date as timestamp (to prevent replay attacks)
353
+ * @deprecated use {@link #setUserWithAuthParamsAndSetupUI()} instead.
365
354
  */
366
355
  setUserWithHashAuthAndSetupUI: (id: string, algorithm: string, secretId: string, digest: string, salt?: string, expiration?: BigInt) => void;
367
356
  /**
@@ -372,6 +361,7 @@ export declare const Didomi: {
372
361
  * @param secretId ID of the secret used for computing the digest
373
362
  * @param initializationVector Initialization Vector used for computing the user ID
374
363
  * @param expiration Expiration date as timestamp (to prevent replay attacks)
364
+ * @deprecated use {@link #setUserWithAuthParams()} instead.
375
365
  */
376
366
  setUserWithEncryptionAuth: (id: string, algorithm: string, secretId: string, initializationVector: string, expiration?: BigInt) => void;
377
367
  /**
@@ -382,8 +372,23 @@ export declare const Didomi: {
382
372
  * @param secretId ID of the secret used for computing the digest
383
373
  * @param initializationVector Initialization Vector used for computing the user ID
384
374
  * @param expiration Expiration date as timestamp (to prevent replay attacks)
375
+ * @deprecated use {@link #setUserWithAuthParamsAndSetupUI()} instead.
385
376
  */
386
377
  setUserWithEncryptionAuthAndSetupUI: (id: string, algorithm: string, secretId: string, initializationVector: string, expiration?: BigInt) => void;
378
+ /**
379
+ * Set user information with authentication (Hash or Encryption)
380
+ *
381
+ * @param userAuthParams as UserAuthParams (use UserAuthWithEncryptionParams or UserAuthWithHashParams)
382
+ * @param synchronizedUsers as UserAuthParams[] (optional)
383
+ */
384
+ setUserWithAuthParams: (userAuthParams: UserAuthParams, synchronizedUsers?: UserAuthParams[] | undefined) => void;
385
+ /**
386
+ * Set user information with authentication (Hash or Encryption) and check for missing consent
387
+ *
388
+ * @param userAuthParams as UserAuthParams (use UserAuthWithEncryptionParams or UserAuthWithHashParams)
389
+ * @param synchronizedUsers as UserAuthParams[] (optional)
390
+ */
391
+ setUserWithAuthParamsAndSetupUI: (userAuthParams: UserAuthParams, synchronizedUsers?: UserAuthParams[] | undefined) => void;
387
392
  /**
388
393
  * Show the consent notice (if required, not disabled in the config and not already displayed)
389
394
  */
@@ -409,6 +414,7 @@ export declare const Didomi: {
409
414
  * @param enabledVendorIds: set containing **enabled vendor ids**
410
415
  * @param disabledVendorIds: set containing **disabled purpose ids**
411
416
  * @returns: **true** if consent status has been updated, **false** otherwise.
417
+ * @deprecated use {@link #setCurrentUserStatus()} instead.
412
418
  */
413
419
  setUserConsentStatus: (enabledPurposeIds: string[], disabledPurposeIds: string[], enabledVendorIds: string[], disabledVendorIds: string[]) => Promise<boolean>;
414
420
  /**
@@ -441,6 +447,7 @@ export declare const Didomi: {
441
447
  * @param disabledConsentVendorIds: List of vendor IDs to disable for consent.
442
448
  * @param enabledLIVendorIds: List of vendor IDs to enable for LI.
443
449
  * @param disabledLIVendorIds: List of vendor IDs to disable for LI.
450
+ * @deprecated use {@link #setCurrentUserStatus()} instead.
444
451
  */
445
452
  setUserStatusSets: (enabledConsentPurposeIds: string[], disabledConsentPurposeIds: string[], enabledLIPurposeIds: string[], disabledLIPurposeIds: string[], enabledConsentVendorIds: string[], disabledConsentVendorIds: string[], enabledLIVendorIds: string[], disabledLIVendorIds: string[]) => Promise<boolean>;
446
453
  /**
@@ -127,3 +127,16 @@ export interface SyncReadyEvent {
127
127
  statusApplied: boolean;
128
128
  syncAcknowledged: () => Promise<boolean>;
129
129
  }
130
+ export interface UserAuthParams {
131
+ id: string;
132
+ algorithm: string;
133
+ secretId: string;
134
+ expiration?: number;
135
+ }
136
+ export interface UserAuthWithEncryptionParams extends UserAuthParams {
137
+ initializationVector: string;
138
+ }
139
+ export interface UserAuthWithHashParams extends UserAuthParams {
140
+ digest: string;
141
+ salt?: string;
142
+ }
@@ -1,2 +1,2 @@
1
1
  export { Didomi } from './Didomi';
2
- export { DidomiEventType, Vendor, VendorNamespaces, Purpose, UserStatus, UserStatusPurposes, UserStatusVendors, UserStatusIds, CurrentUserStatus, PurposeStatus, VendorStatus } from './DidomiTypes';
2
+ export { DidomiEventType, Vendor, VendorNamespaces, Purpose, UserStatus, UserStatusPurposes, UserStatusVendors, UserStatusIds, CurrentUserStatus, PurposeStatus, VendorStatus, UserAuthWithEncryptionParams, UserAuthWithHashParams } from './DidomiTypes';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@didomi/react-native",
3
- "version": "2.3.0",
3
+ "version": "2.5.0",
4
4
  "description": "Didomi React Native SDK",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -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.6.0"
19
+ s.dependency "Didomi-XCFramework", "2.9.2"
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.3.0"
4
+ export const DIDOMI_VERSION = "2.5.0"
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, Purpose, Vendor, UserStatus, CurrentUserStatus, VendorStatus } from './DidomiTypes';
3
+ import { DidomiEventType, Purpose, Vendor, UserStatus, CurrentUserStatus, VendorStatus, UserAuthParams } from './DidomiTypes';
4
4
  import { DIDOMI_USER_AGENT_NAME, DIDOMI_VERSION } from './Constants';
5
5
  import { CurrentUserStatusTransaction, createCurrentUserStatusTransaction } from './CurrentUserStatusTransaction';
6
6
 
@@ -19,6 +19,8 @@ export const Didomi = {
19
19
  * @param noticeId: Notice id for the remote configuration.
20
20
  * @param androidTvNoticeId: Notice id for the remote configuration when running on Android TV device (ignored on iOS / tvOS). Note that using remote configuration is mandatory for TV devices.
21
21
  * @param androidTvEnabled: Whether to allow Didomi SDK to run on Android TV, default to "false".
22
+ * @param countryCode: Override user country code when determining the privacy regulation to apply. Keep undefined to let the Didomi SDK determine the user country.
23
+ * @param regionCode: Override user region code when determining the privacy regulation to apply. Keep undefined to let the Didomi SDK determine the user region. Ignored if countryCode is not set.
22
24
  */
23
25
  initialize: (
24
26
  apiKey: string,
@@ -29,7 +31,9 @@ export const Didomi = {
29
31
  languageCode?: string,
30
32
  noticeId?: string,
31
33
  androidTvNoticeId?: string,
32
- androidTvEnabled: boolean = false
34
+ androidTvEnabled: boolean = false,
35
+ countryCode?: string,
36
+ regionCode?: string,
33
37
  ): Promise<void> => {
34
38
  // Init listener
35
39
  DidomiListener.init();
@@ -46,7 +50,9 @@ export const Didomi = {
46
50
  languageCode,
47
51
  noticeId,
48
52
  androidTvNoticeId,
49
- androidTvEnabled
53
+ androidTvEnabled,
54
+ countryCode,
55
+ regionCode
50
56
  );
51
57
  },
52
58
 
@@ -147,64 +153,56 @@ export const Didomi = {
147
153
  /**
148
154
  * Method used to get an array of disabled purposes.
149
155
  * @returns: array of disabled purposes.
150
- * @deprecated use {@link #getUserStatus()} instead. The result of this method
151
- * has been replaced by getUserStatus().purposes.consent.disabled.
156
+ * @deprecated use {@link #getCurrentUserStatus()} instead.
152
157
  */
153
158
  getDisabledPurposes: (): Promise<Purpose[]> => RNDidomi.getDisabledPurposes(),
154
159
 
155
160
  /**
156
161
  * Method used to get a set of disabled purpose IDs.
157
162
  * @returns: set that contains the IDs of disabled purposes.
158
- * @deprecated use {@link #getUserStatus()} instead. The result of this method
159
- * has been replaced by getUserStatus().purposes.consent.enabled.
163
+ * @deprecated use {@link #getCurrentUserStatus()} instead.
160
164
  */
161
165
  getDisabledPurposeIds: (): Promise<string[]> => RNDidomi.getDisabledPurposeIds(),
162
166
 
163
167
  /**
164
168
  * Method used to get an array of disabled vendors.
165
169
  * @returns: array of disabled vendors.
166
- * @deprecated use {@link #getUserStatus()} instead. The result of this method
167
- * has been replaced by getUserStatus().vendors.consent.disabled.
170
+ * @deprecated use {@link #getCurrentUserStatus()} instead.
168
171
  */
169
172
  getDisabledVendors: (): Promise<Vendor[]> => RNDidomi.getDisabledVendors(),
170
173
 
171
174
  /**
172
175
  * Method used to get a set of disabled vendor IDs.
173
176
  * @returns: set that contains the IDs of disabled vendors.
174
- * @deprecated use {@link #getUserStatus()} instead. The result of this method
175
- * has been replaced by getUserStatus().vendors.consent.disabled.
177
+ * @deprecated use {@link #getCurrentUserStatus()} instead.
176
178
  */
177
179
  getDisabledVendorIds: (): Promise<string[]> => RNDidomi.getDisabledVendorIds(),
178
180
 
179
181
  /**
180
182
  * Method used to get an array of enabled purposes.
181
183
  * @returns: array of enabled purposes.
182
- * @deprecated use {@link #getUserStatus()} instead. The result of this method
183
- * has been replaced by getUserStatus().purposes.consent.enabled.
184
+ * @deprecated use {@link #getCurrentUserStatus()} instead.
184
185
  */
185
186
  getEnabledPurposes: (): Promise<Purpose[]> => RNDidomi.getEnabledPurposes(),
186
187
 
187
188
  /**
188
189
  * Method used to get a set of enabled purpose IDs.
189
190
  * @returns: set that contains the IDs of enabled purposes.
190
- * @deprecated use {@link #getUserStatus()} instead. The result of this method
191
- * has been replaced by getUserStatus().purposes.consent.enabled.
191
+ * @deprecated use {@link #getCurrentUserStatus()} instead.
192
192
  */
193
193
  getEnabledPurposeIds: (): Promise<string[]> => RNDidomi.getEnabledPurposeIds(),
194
194
 
195
195
  /**
196
196
  * Method used to get an array of enabled vendors.
197
197
  * @returns: array of enabled vendors.
198
- * @deprecated use {@link #getUserStatus()} instead. The result of this method
199
- * has been replaced by getUserStatus().vendors.consent.enabled.
198
+ * @deprecated use {@link #getCurrentUserStatus()} instead.
200
199
  */
201
200
  getEnabledVendors: (): Promise<Vendor[]> => RNDidomi.getEnabledVendors(),
202
201
 
203
202
  /**
204
203
  * Method used to get a set of enabled vendor IDs.
205
204
  * @returns: set that contains the IDs of enabled vendors.
206
- * @deprecated use {@link #getUserStatus()} instead. The result of this method
207
- * has been replaced by getUserStatus().vendors.consent.enabled.
205
+ * @deprecated use {@link #getCurrentUserStatus()} instead.
208
206
  */
209
207
  getEnabledVendorIds: (): Promise<string[]> => RNDidomi.getEnabledVendorIds(),
210
208
 
@@ -236,6 +234,7 @@ export const Didomi = {
236
234
  /**
237
235
  * Get the configured purpose IDs
238
236
  * @returns: set of purpose IDs.
237
+ * @deprecated use {@link #getRequiredPurposes()} instead.
239
238
  */
240
239
  getRequiredPurposeIds: (): Promise<string[]> => RNDidomi.getRequiredPurposeIds(),
241
240
 
@@ -248,6 +247,7 @@ export const Didomi = {
248
247
  /**
249
248
  * Get the configured vendor IDs
250
249
  * @returns: set of vendor IDs.
250
+ * @deprecated use {@link #getRequiredVendors()} instead.
251
251
  */
252
252
  getRequiredVendorIds: (): Promise<string[]> => RNDidomi.getRequiredVendorIds(),
253
253
 
@@ -286,9 +286,7 @@ export const Didomi = {
286
286
  * Get the user consent status for a specific purpose
287
287
  * @param purposeId: The purpose ID to check consent for
288
288
  * @returns: The user consent status for the specified purpose
289
- * @deprecated use {@link #getUserStatus()} instead. Search the purposeId in
290
- * getUserStatus().purposes.consent.enabled or
291
- * getUserStatus().purposes.consent.enabled.
289
+ * @deprecated use {@link #getCurrentUserStatus()} instead.
292
290
  */
293
291
  getUserConsentStatusForPurpose: (purposeId: string): Promise<boolean> => RNDidomi.getUserConsentStatusForPurpose(purposeId),
294
292
 
@@ -296,9 +294,7 @@ export const Didomi = {
296
294
  * Get the user consent status for a specific vendor
297
295
  * @param vendorId: The vendor ID to check consent for
298
296
  * @returns: The user consent status for the specified vendor
299
- * @deprecated use {@link #getUserStatus()} instead. Search the vendorId in
300
- * getUserStatus().vendors.consent.enabled or
301
- * getUserStatus().vendors.consent.disabled.
297
+ * @deprecated use {@link #getCurrentUserStatus()} instead.
302
298
  */
303
299
  getUserConsentStatusForVendor: (vendorId: string): Promise<boolean> => RNDidomi.getUserConsentStatusForVendor(vendorId),
304
300
 
@@ -306,9 +302,7 @@ export const Didomi = {
306
302
  * Get the user consent status for a specific vendor and all its purposes
307
303
  * @param vendorId: The ID of the vendor
308
304
  * @returns: The user consent status corresponding to the specified vendor and all its required purposes.
309
- * @deprecated use {@link #getUserStatus()} instead. The result of this method has been replaced
310
- * by getUserStatus().vendors.global_consent.enabled or
311
- * getUserStatus().vendors.global_consent.disabled.
305
+ * @deprecated use {@link #getCurrentUserStatus()} instead.
312
306
  */
313
307
  getUserConsentStatusForVendorAndRequiredPurposes: (vendorId: string): Promise<boolean> => RNDidomi.getUserConsentStatusForVendorAndRequiredPurposes(vendorId),
314
308
 
@@ -316,9 +310,7 @@ export const Didomi = {
316
310
  * Get the user legitimate interest status for a specific purpose.
317
311
  * @param purposeId: purpose ID.
318
312
  * @returns: LI status of a purpose.
319
- * @deprecated use {@link #getUserStatus()} instead. Search the purposeId in
320
- * getUserStatus().purposes.consent.enabled or
321
- * getUserStatus().purposes.consent.enabled.
313
+ * @deprecated use {@link #getCurrentUserStatus()} instead.
322
314
  */
323
315
  getUserLegitimateInterestStatusForPurpose: (purposeId: string): Promise<boolean> => RNDidomi.getUserLegitimateInterestStatusForPurpose(purposeId),
324
316
 
@@ -326,9 +318,7 @@ export const Didomi = {
326
318
  * Get the user legitimate interest status for a specific vendor.
327
319
  * @param vendorId: vendor ID.
328
320
  * @returns: LI status of a vendor.
329
- * @deprecated use {@link #getUserStatus()} instead. Search the vendorId in
330
- * getUserStatus().vendors.legitimate_interest.enabled or
331
- * getUserStatus().vendors.legitimate_interest.disabled.
321
+ * @deprecated use {@link #getCurrentUserStatus()} instead.
332
322
  */
333
323
  getUserLegitimateInterestForVendor: (vendorId: string): Promise<boolean> => RNDidomi.getUserLegitimateInterestStatusForVendor(vendorId),
334
324
 
@@ -336,9 +326,7 @@ export const Didomi = {
336
326
  * Get the user LI status for a specific vendor and all its purposes.
337
327
  * @param vendorId: vendor ID.
338
328
  * @returns: The user LI status corresponding to the specified vendor and all its required purposes.
339
- * @deprecated use {@link #getUserStatus()} instead. Search the purposeId in
340
- * getUserStatus().vendors.global_legitimate_interest.enabled or
341
- * getUserStatus().vendors.global_legitimate_interest.disabled.
329
+ * @deprecated use {@link #getCurrentUserStatus()} instead.
342
330
  */
343
331
  getUserLegitimateInterestStatusForVendorAndRequiredPurposes: (vendorId: string): boolean => RNDidomi.getUserLegitimateInterestStatusForVendorAndRequiredPurposes(vendorId),
344
332
 
@@ -351,6 +339,7 @@ export const Didomi = {
351
339
  /**
352
340
  * Get the user consent status.
353
341
  * @returns: status that represents user consent.
342
+ * @deprecated use {@link #getCurrentUserStatus()} instead.
354
343
  */
355
344
  getUserStatus: (): Promise<UserStatus> => RNDidomi.getUserStatus(),
356
345
 
@@ -387,6 +376,7 @@ export const Didomi = {
387
376
  * - The company is from the EU.
388
377
  * - The user country is unknown and the app has chosen to collect consent when unknown.
389
378
  * @returns: **true** if consent is required, **false** if it is not required.
379
+ * @deprecated use {@link #shouldUserStatusBeCollected()} instead.
390
380
  */
391
381
  isConsentRequired: (): Promise<boolean> => RNDidomi.isConsentRequired(),
392
382
 
@@ -402,6 +392,7 @@ export const Didomi = {
402
392
  /**
403
393
  * Determine if consent information is available for all purposes and vendors that are required
404
394
  * @returns: **true** if consent is required and consent information is available, **false** otherwise.
395
+ * @deprecated use {@link #isUserStatusPartial()} instead.
405
396
  */
406
397
  isUserConsentStatusPartial: (): Promise<boolean> => RNDidomi.isUserConsentStatusPartial(),
407
398
 
@@ -458,6 +449,7 @@ export const Didomi = {
458
449
  * @param digest Digest of the organization user ID and secret
459
450
  * @param salt Salt used for computing the digest (optional)
460
451
  * @param expiration Expiration date as timestamp (to prevent replay attacks)
452
+ * @deprecated use {@link #setUserWithAuthParams()} instead.
461
453
  */
462
454
  setUserWithHashAuth: (
463
455
  id: string,
@@ -496,6 +488,7 @@ export const Didomi = {
496
488
  * @param digest Digest of the organization user ID and secret
497
489
  * @param salt Salt used for computing the digest (optional)
498
490
  * @param expiration Expiration date as timestamp (to prevent replay attacks)
491
+ * @deprecated use {@link #setUserWithAuthParamsAndSetupUI()} instead.
499
492
  */
500
493
  setUserWithHashAuthAndSetupUI: (
501
494
  id: string,
@@ -533,6 +526,7 @@ export const Didomi = {
533
526
  * @param secretId ID of the secret used for computing the digest
534
527
  * @param initializationVector Initialization Vector used for computing the user ID
535
528
  * @param expiration Expiration date as timestamp (to prevent replay attacks)
529
+ * @deprecated use {@link #setUserWithAuthParams()} instead.
536
530
  */
537
531
  setUserWithEncryptionAuth: (
538
532
  id: string,
@@ -567,6 +561,7 @@ export const Didomi = {
567
561
  * @param secretId ID of the secret used for computing the digest
568
562
  * @param initializationVector Initialization Vector used for computing the user ID
569
563
  * @param expiration Expiration date as timestamp (to prevent replay attacks)
564
+ * @deprecated use {@link #setUserWithAuthParamsAndSetupUI()} instead.
570
565
  */
571
566
  setUserWithEncryptionAuthAndSetupUI: (
572
567
  id: string,
@@ -593,6 +588,28 @@ export const Didomi = {
593
588
  }
594
589
  },
595
590
 
591
+ /**
592
+ * Set user information with authentication (Hash or Encryption)
593
+ *
594
+ * @param userAuthParams as UserAuthParams (use UserAuthWithEncryptionParams or UserAuthWithHashParams)
595
+ * @param synchronizedUsers as UserAuthParams[] (optional)
596
+ */
597
+ setUserWithAuthParams: (
598
+ userAuthParams: UserAuthParams,
599
+ synchronizedUsers?: UserAuthParams[] | undefined
600
+ ): void => RNDidomi.setUserWithAuthParams(JSON.stringify(userAuthParams), JSON.stringify(synchronizedUsers)),
601
+
602
+ /**
603
+ * Set user information with authentication (Hash or Encryption) and check for missing consent
604
+ *
605
+ * @param userAuthParams as UserAuthParams (use UserAuthWithEncryptionParams or UserAuthWithHashParams)
606
+ * @param synchronizedUsers as UserAuthParams[] (optional)
607
+ */
608
+ setUserWithAuthParamsAndSetupUI: (
609
+ userAuthParams: UserAuthParams,
610
+ synchronizedUsers?: UserAuthParams[] | undefined
611
+ ): void => RNDidomi.setUserWithAuthParamsAndSetupUI(JSON.stringify(userAuthParams), JSON.stringify(synchronizedUsers)),
612
+
596
613
  /**
597
614
  * Show the consent notice (if required, not disabled in the config and not already displayed)
598
615
  */
@@ -622,6 +639,7 @@ export const Didomi = {
622
639
  * @param enabledVendorIds: set containing **enabled vendor ids**
623
640
  * @param disabledVendorIds: set containing **disabled purpose ids**
624
641
  * @returns: **true** if consent status has been updated, **false** otherwise.
642
+ * @deprecated use {@link #setCurrentUserStatus()} instead.
625
643
  */
626
644
  setUserConsentStatus: (
627
645
  enabledPurposeIds: string[],
@@ -685,6 +703,7 @@ export const Didomi = {
685
703
  * @param disabledConsentVendorIds: List of vendor IDs to disable for consent.
686
704
  * @param enabledLIVendorIds: List of vendor IDs to enable for LI.
687
705
  * @param disabledLIVendorIds: List of vendor IDs to disable for LI.
706
+ * @deprecated use {@link #setCurrentUserStatus()} instead.
688
707
  */
689
708
  setUserStatusSets: (
690
709
  enabledConsentPurposeIds: string[],
@@ -153,3 +153,19 @@ export interface SyncReadyEvent {
153
153
  statusApplied: boolean;
154
154
  syncAcknowledged: () => Promise<boolean>;
155
155
  }
156
+
157
+ export interface UserAuthParams {
158
+ id: string;
159
+ algorithm: string;
160
+ secretId: string;
161
+ expiration?: number;
162
+ }
163
+
164
+ export interface UserAuthWithEncryptionParams extends UserAuthParams {
165
+ initializationVector: string;
166
+ }
167
+
168
+ export interface UserAuthWithHashParams extends UserAuthParams {
169
+ digest: string;
170
+ salt?: string;
171
+ }
package/src/index.tsx CHANGED
@@ -1,2 +1,16 @@
1
1
  export { Didomi } from './Didomi';
2
- export { DidomiEventType, Vendor, VendorNamespaces, Purpose, UserStatus, UserStatusPurposes, UserStatusVendors, UserStatusIds, CurrentUserStatus, PurposeStatus, VendorStatus } from './DidomiTypes';
2
+ export {
3
+ DidomiEventType,
4
+ Vendor,
5
+ VendorNamespaces,
6
+ Purpose,
7
+ UserStatus,
8
+ UserStatusPurposes,
9
+ UserStatusVendors,
10
+ UserStatusIds,
11
+ CurrentUserStatus,
12
+ PurposeStatus,
13
+ VendorStatus,
14
+ UserAuthWithEncryptionParams,
15
+ UserAuthWithHashParams
16
+ } from './DidomiTypes';