@didomi/react-native 2.8.0 → 2.10.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.
@@ -11,6 +11,9 @@ export enum DidomiEventType {
11
11
  NOTICE_CLICK_AGREE = "on_notice_click_agree",
12
12
  NOTICE_CLICK_DISAGREE = "on_notice_click_disagree",
13
13
  NOTICE_CLICK_VIEW_VENDORS = "on_notice_click_view_vendors",
14
+ /**
15
+ * @deprecated SPI purposes are now displayed in preferences screen, use {@link #NOTICE_CLICK_MORE_INFO} instead.
16
+ */
14
17
  NOTICE_CLICK_VIEW_SPI_PURPOSES = "on_notice_click_view_spi_purposes",
15
18
  NOTICE_CLICK_MORE_INFO = "on_notice_click_more_info",
16
19
  NOTICE_CLICK_PRIVACY_POLICY = "on_notice_click_privacy_policy",
@@ -20,6 +23,9 @@ export enum DidomiEventType {
20
23
  // Preferences - Views
21
24
  PREFERENCES_CLICK_VIEW_PURPOSES = "on_preferences_click_view_purposes",
22
25
  PREFERENCES_CLICK_VIEW_VENDORS = "on_preferences_click_view_vendors",
26
+ /**
27
+ * @deprecated SPI purposes are now displayed in preferences screen.
28
+ */
23
29
  PREFERENCES_CLICK_VIEW_SPI_PURPOSES = "on_preferences_click_view_spi_purposes",
24
30
  // Preferences - Purpose
25
31
  PREFERENCES_CLICK_AGREE_TO_ALL = "on_preferences_click_agree_to_all",
@@ -38,16 +44,33 @@ export enum DidomiEventType {
38
44
  PREFERENCES_CLICK_VENDOR_AGREE = "on_preferences_click_vendor_agree",
39
45
  PREFERENCES_CLICK_VENDOR_DISAGREE = "on_preferences_click_vendor_disagree",
40
46
  PREFERENCES_CLICK_VENDOR_SAVE_CHOICES = "on_preferences_click_vendor_save_choices",
41
- // Preferences - Sensitive Personal Information
47
+ // Preferences - Sensitive Personal Information (deprecated)
48
+ /**
49
+ * @deprecated SPI purposes are now treated as other purposes, use {@link #PREFERENCES_CLICK_PURPOSE_AGREE} instead.
50
+ */
42
51
  PREFERENCES_CLICK_SPI_PURPOSE_AGREE = "on_preferences_click_spi_purpose_agree",
52
+ /**
53
+ * @deprecated SPI purposes are now treated as other purposes, use {@link #PREFERENCES_CLICK_PURPOSE_DISAGREE} instead.
54
+ */
43
55
  PREFERENCES_CLICK_SPI_PURPOSE_DISAGREE = "on_preferences_click_spi_purpose_disagree",
56
+ /**
57
+ * @deprecated SPI purposes are now treated as other purposes, use {@link #PREFERENCES_CLICK_CATEGORY_AGREE} instead.
58
+ */
44
59
  PREFERENCES_CLICK_SPI_CATEGORY_AGREE = "on_preferences_click_spi_category_agree",
60
+ /**
61
+ * @deprecated SPI purposes are now treated as other purposes, use {@link #PREFERENCES_CLICK_CATEGORY_DISAGREE} instead.
62
+ */
45
63
  PREFERENCES_CLICK_SPI_CATEGORY_DISAGREE = "on_preferences_click_spi_category_disagree",
64
+ /**
65
+ * @deprecated SPI purposes are now displayed in preferences screen, use {@link #PREFERENCES_CLICK_SAVE_CHOICES} instead.
66
+ */
46
67
  PREFERENCES_CLICK_SPI_PURPOSE_SAVE_CHOICES = "on_preferences_click_spi_purpose_save_choices",
47
68
  // Sync
48
69
  SYNC_READY = "on_sync_ready",
49
70
  SYNC_ERROR = "on_sync_error",
50
- // @deprecated use {@link #SYNC_READY} instead.
71
+ /**
72
+ * @deprecated use {@link #SYNC_READY} instead.
73
+ */
51
74
  SYNC_DONE = "on_sync_done",
52
75
  // Language
53
76
  LANGUAGE_UPDATED = "on_language_updated",
@@ -155,8 +178,11 @@ export interface SyncReadyEvent {
155
178
  syncAcknowledged: () => Promise<boolean>;
156
179
  }
157
180
 
158
- export interface UserAuthParams {
181
+ export interface UserAuth {
159
182
  id: string;
183
+ }
184
+
185
+ export interface UserAuthParams extends UserAuth {
160
186
  algorithm: string;
161
187
  secretId: string;
162
188
  expiration?: number;
@@ -170,3 +196,120 @@ export interface UserAuthWithHashParams extends UserAuthParams {
170
196
  digest: string;
171
197
  salt?: string;
172
198
  }
199
+
200
+ /**
201
+ * Initialization parameters for Didomi SDK
202
+ * @interface
203
+ */
204
+ export interface DidomiInitializeParameters {
205
+ /**
206
+ * Public API key of the organization from the Didomi Console.
207
+ * @property
208
+ */
209
+ apiKey: string;
210
+ /**
211
+ * Path to your local config file. Defaults to didomi_config.json if nil.
212
+ * @property
213
+ */
214
+ localConfigurationPath?: string;
215
+ /**
216
+ * URL to a remote configuration file to load during initialization. This parameter is not used yet. Set it to nil for now.
217
+ * @property
218
+ */
219
+ remoteConfigurationUrl?: string;
220
+ /**
221
+ * The provider ID (if any).
222
+ * @property
223
+ */
224
+ providerId?: string;
225
+ /**
226
+ * Whether to disable loading the remove configuration from the Didomi config. Keep this to `false` for loading configuration from the Didomi Console.
227
+ * @property
228
+ * @deprecated In the future, it will be mandatory to create your notice from the console (see https://developers.didomi.io/cmp/mobile-sdk/android/setup#from-the-console-recommended for more information).
229
+ */
230
+ disableDidomiRemoteConfig?: boolean;
231
+ /**
232
+ * Language in which the consent UI should be displayed. By default, the consent UI is displayed in the language configured in the device settings.
233
+ * This property allows you to override the default setting and specify a language to display the UI in. String containing the language code e.g.: "es", "fr", etc.
234
+ * @property
235
+ */
236
+ languageCode?: string;
237
+ /**
238
+ * ID of the notice configuration to load from the Didomi Console.
239
+ * @property
240
+ */
241
+ noticeId?: string;
242
+ /**
243
+ * ID of the notice to display on Android TV
244
+ * @property
245
+ */
246
+ androidTvNoticeId?: string;
247
+ /**
248
+ * Enable/disable Android TV specific features
249
+ * @property
250
+ */
251
+ androidTvEnabled?: boolean;
252
+ /**
253
+ * Override user country code when determining the privacy regulation to apply.
254
+ * Keep `undefined` to let the Didomi SDK determine the user country.
255
+ * @property
256
+ */
257
+ countryCode?: string;
258
+ /**
259
+ * Override user region code when determining the privacy regulation to apply.
260
+ * Keep `undefined` to let the Didomi SDK determine the user region.
261
+ * Ignored if `countryCode` is not set.
262
+ * @property
263
+ */
264
+ regionCode?: string;
265
+ /**
266
+ * If set to `true`, the SDK will only display the underage notice (`false` by default).
267
+ * @property
268
+ */
269
+ isUnderage?: boolean;
270
+ }
271
+
272
+ /**
273
+ * Object that contains the parameters for the setUser method.
274
+ * @interface
275
+ */
276
+ export interface DidomiUserParameters {
277
+ /**
278
+ * @property
279
+ */
280
+ userId?: string;
281
+ /**
282
+ * Main user authentication
283
+ * - [UserAuthWithEncryptionParams] (encryption)
284
+ * - [UserAuthWithHashParams] (hash)
285
+ * - [UserAuthWithoutParams] (ID only)
286
+ * @property
287
+ */
288
+ userAuth?: UserAuth;
289
+ /**
290
+ * User authentication for Didomi Consent String
291
+ * - [UserAuthWithEncryptionParams] (encryption)
292
+ * - [UserAuthWithHashParams] (hash)
293
+ * @property
294
+ */
295
+ dcsUserAuth?: UserAuthParams;
296
+ /**
297
+ * If the user is underage (undefined will keep the previous setting)
298
+ * @property
299
+ */
300
+ isUnderage?: boolean;
301
+ }
302
+
303
+ /**
304
+ * Object that contains the parameters for the setUser method including synchronized users.
305
+ * @interface
306
+ */
307
+ export interface DidomiMultiUserParameters extends DidomiUserParameters {
308
+ /**
309
+ * Synchronized user list
310
+ * - [UserAuthWithEncryptionParams] (encryption)
311
+ * - [UserAuthWithHashParams] (hash)
312
+ * @property
313
+ */
314
+ synchronizedUsers?: UserAuthParams[];
315
+ }
package/src/index.tsx CHANGED
@@ -12,5 +12,6 @@ export {
12
12
  PurposeStatus,
13
13
  VendorStatus,
14
14
  UserAuthWithEncryptionParams,
15
- UserAuthWithHashParams
15
+ UserAuthWithHashParams,
16
+ DidomiInitializeParameters
16
17
  } from './DidomiTypes';