@didomi/react-native 1.5.0 → 1.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.
@@ -8,6 +8,6 @@ exports.DIDOMI_VERSION = exports.DIDOMI_USER_AGENT_NAME = void 0;
8
8
  const DIDOMI_USER_AGENT_NAME = "Didomi React-Native SDK"; // User agent version
9
9
 
10
10
  exports.DIDOMI_USER_AGENT_NAME = DIDOMI_USER_AGENT_NAME;
11
- const DIDOMI_VERSION = "1.5.0";
11
+ const DIDOMI_VERSION = "1.8.0";
12
12
  exports.DIDOMI_VERSION = DIDOMI_VERSION;
13
13
  //# sourceMappingURL=Constants.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["Constants.ts"],"names":["DIDOMI_USER_AGENT_NAME","DIDOMI_VERSION"],"mappings":";;;;;;AAAA;AACO,MAAMA,sBAAsB,GAAG,yBAA/B,C,CACP;;;AACO,MAAMC,cAAc,GAAG,OAAvB","sourcesContent":["// User agent name\nexport const DIDOMI_USER_AGENT_NAME = \"Didomi React-Native SDK\"\n// User agent version\nexport const DIDOMI_VERSION = \"1.5.0\"\n"]}
1
+ {"version":3,"sources":["Constants.ts"],"names":["DIDOMI_USER_AGENT_NAME","DIDOMI_VERSION"],"mappings":";;;;;;AAAA;AACO,MAAMA,sBAAsB,GAAG,yBAA/B,C,CACP;;;AACO,MAAMC,cAAc,GAAG,OAAvB","sourcesContent":["// User agent name\nexport const DIDOMI_USER_AGENT_NAME = \"Didomi React-Native SDK\"\n// User agent version\nexport const DIDOMI_VERSION = \"1.8.0\"\n"]}
@@ -31,7 +31,7 @@ const Didomi = {
31
31
  _DidomiListener.DidomiListener.init(); // Trigger native SDK init
32
32
 
33
33
 
34
- RNDidomi.initialize(_Constants.DIDOMI_USER_AGENT_NAME, _Constants.DIDOMI_VERSION, apiKey, localConfigurationPath, remoteConfigurationUrl, providerId, disableDidomiRemoteConfig, languageCode, noticeId);
34
+ return RNDidomi.initialize(_Constants.DIDOMI_USER_AGENT_NAME, _Constants.DIDOMI_VERSION, apiKey, localConfigurationPath, remoteConfigurationUrl, providerId, disableDidomiRemoteConfig, languageCode, noticeId);
35
35
  },
36
36
 
37
37
  /**
@@ -94,48 +94,64 @@ const Didomi = {
94
94
  /**
95
95
  * Method used to get an array of disabled purposes.
96
96
  * @returns: array of disabled purposes.
97
+ * @deprecated use {@link #getUserStatus()} instead. The result of this method
98
+ * has been replaced by getUserStatus().getPurposes().getConsent().getDisabled().
97
99
  */
98
100
  getDisabledPurposes: () => RNDidomi.getDisabledPurposes(),
99
101
 
100
102
  /**
101
103
  * Method used to get a set of disabled purpose IDs.
102
104
  * @returns: set that contains the IDs of disabled purposes.
105
+ * @deprecated use {@link #getUserStatus()} instead. The result of this method
106
+ * has been replaced by getUserStatus().getPurposes().getConsent().getDisabled().
103
107
  */
104
108
  getDisabledPurposeIds: () => RNDidomi.getDisabledPurposeIds(),
105
109
 
106
110
  /**
107
111
  * Method used to get an array of disabled vendors.
108
112
  * @returns: array of disabled vendors.
113
+ * @deprecated use {@link #getUserStatus()} instead. The result of this method
114
+ * has been replaced by getUserStatus().getVendors().getConsent().getDisabled().
109
115
  */
110
116
  getDisabledVendors: () => RNDidomi.getDisabledVendors(),
111
117
 
112
118
  /**
113
119
  * Method used to get a set of disabled vendor IDs.
114
120
  * @returns: set that contains the IDs of disabled vendors.
121
+ * @deprecated use {@link #getUserStatus()} instead. The result of this method
122
+ * has been replaced by getUserStatus().getVendors().getConsent().getDisabled().
115
123
  */
116
124
  getDisabledVendorIds: () => RNDidomi.getDisabledVendorIds(),
117
125
 
118
126
  /**
119
127
  * Method used to get an array of enabled purposes.
120
128
  * @returns: array of enabled purposes.
129
+ * @deprecated use {@link #getUserStatus()} instead. The result of this method
130
+ * has been replaced by getUserStatus().getPurposes().getConsent().getEnabled().
121
131
  */
122
132
  getEnabledPurposes: () => RNDidomi.getEnabledPurposes(),
123
133
 
124
134
  /**
125
135
  * Method used to get a set of enabled purpose IDs.
126
136
  * @returns: set that contains the IDs of enabled purposes.
137
+ * @deprecated use {@link #getUserStatus()} instead. The result of this method
138
+ * has been replaced by getUserStatus().getPurposes().getConsent().getEnabled().
127
139
  */
128
140
  getEnabledPurposeIds: () => RNDidomi.getEnabledPurposeIds(),
129
141
 
130
142
  /**
131
143
  * Method used to get an array of enabled vendors.
132
144
  * @returns: array of enabled vendors.
145
+ * @deprecated use {@link #getUserStatus()} instead. The result of this method
146
+ * has been replaced by getUserStatus().getVendors().getConsent().getEnabled().
133
147
  */
134
148
  getEnabledVendors: () => RNDidomi.getEnabledVendors(),
135
149
 
136
150
  /**
137
151
  * Method used to get a set of enabled vendor IDs.
138
152
  * @returns: set that contains the IDs of enabled vendors.
153
+ * @deprecated use {@link #getUserStatus()} instead. The result of this method
154
+ * has been replaced by getUserStatus().getVendors().getConsent().getEnabled().
139
155
  */
140
156
  getEnabledVendorIds: () => RNDidomi.getEnabledVendorIds(),
141
157
 
@@ -339,15 +355,97 @@ const Didomi = {
339
355
  isReady: () => RNDidomi.isReady(),
340
356
 
341
357
  /**
342
- * Set user information with authentication
358
+ * Clear user information
359
+ */
360
+ clearUser: () => RNDidomi.clearUser(),
361
+
362
+ /**
363
+ * Set user information without authentication
364
+ *
365
+ * @param id Organization user ID
366
+ * @param algorithm Deprecated. To set user with authentication, use setUserWithHashAuth or setUserWithEncryptionAuth.
367
+ * @param secretId Deprecated. To set user with authentication, use setUserWithHashAuth or setUserWithEncryptionAuth.
368
+ * @param salt Deprecated. To set user with authentication, use setUserWithHashAuth or setUserWithEncryptionAuth.
369
+ * @param digest Deprecated. To set user with authentication, use setUserWithHashAuth or setUserWithEncryptionAuth.
370
+ */
371
+ setUser: (id, algorithm, secretId, salt, digest) => RNDidomi.setUser(id, algorithm, secretId, salt, digest),
372
+
373
+ /**
374
+ * Set user information without authentication and check for missing consent
375
+ *
376
+ * @param id Organization user ID
377
+ */
378
+ setUserAndSetupUI: id => RNDidomi.setUserAndSetupUI(id),
379
+
380
+ /**
381
+ * Set user information with Hash authentication
343
382
  *
344
383
  * @param id Organization user ID
345
384
  * @param algorithm Algorithm used for computing the digest
346
385
  * @param secretId ID of the secret used for computing the digest
386
+ * @param digest Digest of the organization user ID and secret
347
387
  * @param salt Salt used for computing the digest (optional)
388
+ * @param expiration Expiration date as timestamp (to prevent replay attacks)
389
+ */
390
+ setUserWithHashAuth: (id, algorithm, secretId, digest, salt, expiration) => {
391
+ if (expiration === undefined) {
392
+ RNDidomi.setUserWithHashAuth(id, algorithm, secretId, digest, salt);
393
+ } else {
394
+ RNDidomi.setUserWithHashAuthWithExpiration(id, algorithm, secretId, digest, salt, expiration);
395
+ }
396
+ },
397
+
398
+ /**
399
+ * Set user information with Hash authentication and check for missing consent
400
+ *
401
+ * @param id Organization user ID
402
+ * @param algorithm Algorithm used for computing the digest
403
+ * @param secretId ID of the secret used for computing the digest
348
404
  * @param digest Digest of the organization user ID and secret
349
- */
350
- setUser: (organizationUserId, organizationUserIdAuthAlgorithm, organizationUserIdAuthSid, organizationUserIdAuthSalt, organizationUserIdAuthDigest) => RNDidomi.setUser(organizationUserId, organizationUserIdAuthAlgorithm, organizationUserIdAuthSid, organizationUserIdAuthSalt, organizationUserIdAuthDigest),
405
+ * @param salt Salt used for computing the digest (optional)
406
+ * @param expiration Expiration date as timestamp (to prevent replay attacks)
407
+ */
408
+ setUserWithHashAuthAndSetupUI: (id, algorithm, secretId, digest, salt, expiration) => {
409
+ if (expiration === undefined) {
410
+ RNDidomi.setUserWithHashAuthAndSetupUI(id, algorithm, secretId, digest, salt);
411
+ } else {
412
+ RNDidomi.setUserWithHashAuthWithExpirationAndSetupUI(id, algorithm, secretId, digest, salt, expiration);
413
+ }
414
+ },
415
+
416
+ /**
417
+ * Set user information with Encryption authentication
418
+ *
419
+ * @param id Organization user ID
420
+ * @param algorithm Algorithm used for computing the digest
421
+ * @param secretId ID of the secret used for computing the digest
422
+ * @param initializationVector Initialization Vector used for computing the user ID
423
+ * @param expiration Expiration date as timestamp (to prevent replay attacks)
424
+ */
425
+ setUserWithEncryptionAuth: (id, algorithm, secretId, initializationVector, expiration) => {
426
+ if (expiration === undefined) {
427
+ RNDidomi.setUserWithEncryptionAuth(id, algorithm, secretId, initializationVector);
428
+ } else {
429
+ RNDidomi.setUserWithEncryptionAuthWithExpiration(id, algorithm, secretId, initializationVector, expiration);
430
+ }
431
+ },
432
+
433
+ /**
434
+ * Set user information with Encryption authentication and check for missing consent
435
+ *
436
+ * @param id Organization user ID
437
+ * @param algorithm Algorithm used for computing the digest
438
+ * @param secretId ID of the secret used for computing the digest
439
+ * @param initializationVector Initialization Vector used for computing the user ID
440
+ * @param expiration Expiration date as timestamp (to prevent replay attacks)
441
+ */
442
+ setUserWithEncryptionAuthAndSetupUI: (id, algorithm, secretId, initializationVector, expiration) => {
443
+ if (expiration === undefined) {
444
+ RNDidomi.setUserWithEncryptionAuthAndSetupUI(id, algorithm, secretId, initializationVector);
445
+ } else {
446
+ RNDidomi.setUserWithEncryptionAuthWithExpirationAndSetupUI(id, algorithm, secretId, initializationVector, expiration);
447
+ }
448
+ },
351
449
 
352
450
  /**
353
451
  * Show the consent notice (if required, not disabled in the config and not already displayed)
@@ -1 +1 @@
1
- {"version":3,"sources":["Didomi.ts"],"names":["Didomi","RNDidomi","NativeModules","initialize","apiKey","localConfigurationPath","remoteConfigurationUrl","providerId","disableDidomiRemoteConfig","languageCode","noticeId","DidomiListener","init","DIDOMI_USER_AGENT_NAME","DIDOMI_VERSION","onReady","onError","setupUI","setLogLevel","level","addEventListener","eventType","callback","removeEventListener","removeAllEventListeners","reset","getDisabledPurposes","getDisabledPurposeIds","getDisabledVendors","getDisabledVendorIds","getEnabledPurposes","getEnabledPurposeIds","getEnabledVendors","getEnabledVendorIds","getJavaScriptForWebView","extra","getQueryStringForWebView","getPurpose","purposeId","getRequiredPurposes","getRequiredPurposeIds","getRequiredVendors","getRequiredVendorIds","getText","key","getTranslatedText","getUserConsentStatusForPurpose","getUserConsentStatusForVendor","vendorId","getUserConsentStatusForVendorAndRequiredPurposes","getUserLegitimateInterestStatusForPurpose","getUserLegitimateInterestForVendor","getUserLegitimateInterestStatusForVendor","getUserLegitimateInterestStatusForVendorAndRequiredPurposes","getUserStatus","getUserStatusForVendor","getVendor","hideNotice","hidePreferences","isConsentRequired","isUserConsentStatusPartial","isNoticeVisible","isPreferencesVisible","isError","isReady","setUser","organizationUserId","organizationUserIdAuthAlgorithm","organizationUserIdAuthSid","organizationUserIdAuthSalt","organizationUserIdAuthDigest","showNotice","showPreferences","view","setUserAgreeToAll","setUserConsentStatus","enabledPurposeIds","disabledPurposeIds","enabledVendorIds","disabledVendorIds","setUserDisagreeToAll","setUserStatus","purposesConsentStatus","purposesLIStatus","vendorsConsentStatus","vendorsLIStatus","setUserStatusSets","enabledConsentPurposeIds","disabledConsentPurposeIds","enabledLIPurposeIds","disabledLIPurposeIds","enabledConsentVendorIds","disabledConsentVendorIds","enabledLIVendorIds","disabledLIVendorIds","shouldConsentBeCollected","updateSelectedLanguage"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AAEA,MAAM;AAAEA,EAAAA,MAAM,EAAEC;AAAV,IAAuBC,0BAA7B;AAEO,MAAMF,MAAM,GAAG;AACpB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACEG,EAAAA,UAAU,EAAE,CACVC,MADU,EAEVC,sBAFU,EAGVC,sBAHU,EAIVC,UAJU,EAKVC,yBAAkC,GAAG,KAL3B,EAMVC,YANU,EAOVC,QAPU,KAQP;AACH;AACAC,mCAAeC,IAAf,GAFG,CAIH;;;AACAX,IAAAA,QAAQ,CAACE,UAAT,CACEU,iCADF,EAEEC,yBAFF,EAGEV,MAHF,EAIEC,sBAJF,EAKEC,sBALF,EAMEC,UANF,EAOEC,yBAPF,EAQEC,YARF,EASEC,QATF;AAWD,GApCmB;;AAsCpB;AACF;AACA;AACEK,EAAAA,OAAO,EAAE,MAAqBJ,+BAAeI,OAAf,EAzCV;;AA2CpB;A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AACA;AACA;AACEC,EAAAA,oBAAoB,EAAE,CACpBC,iBADoB,EAEpBC,kBAFoB,EAGpBC,gBAHoB,EAIpBC,iBAJoB,KAMpB9E,QAAQ,CAAC0E,oBAAT,CACEC,iBADF,EAEEC,kBAFF,EAGEC,gBAHF,EAIEC,iBAJF,CA1ZkB;;AAiapB;AACF;AACA;AACA;AACEC,EAAAA,oBAAoB,EAAE,MAAwB/E,QAAQ,CAAC+E,oBAAT,EAra1B;;AAuapB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACEC,EAAAA,aAAa,EAAE,CACbC,qBADa,EAEbC,gBAFa,EAGbC,oBAHa,EAIbC,eAJa,KAMbpF,QAAQ,CAACgF,aAAT,CACEC,qBADF,EAEEC,gBAFF,EAGEC,oBAHF,EAIEC,eAJF,CArbkB;;AA4bpB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACEC,EAAAA,iBAAiB,EAAE,CACjBC,wBADiB,EAEjBC,yBAFiB,EAGjBC,mBAHiB,EAIjBC,oBAJiB,EAKjBC,uBALiB,EAMjBC,wBANiB,EAOjBC,kBAPiB,EAQjBC,mBARiB,KAUjB7F,QAAQ,CAACqF,iBAAT,CACEC,wBADF,EAEEC,yBAFF,EAGEC,mBAHF,EAIEC,oBAJF,EAKEC,uBALF,EAMEC,wBANF,EAOEC,kBAPF,EAQEC,mBARF,CAjdkB;;AA4dpB;AACF;AACA;AACA;AACEC,EAAAA,wBAAwB,EAAE,MACxB9F,QAAQ,CAAC8F,wBAAT,EAjekB;;AAmepB;AACF;AACA;AACA;AACA;AACA;AACEC,EAAAA,sBAAsB,EAAGvF,YAAD,IACtBR,QAAQ,CAAC+F,sBAAT,CAAgCvF,YAAhC;AA1ekB,CAAf","sourcesContent":["import { NativeModules } from 'react-native';\nimport { DidomiListener } from './DidomiListener';\nimport { DidomiEventType } from './DidomiTypes';\nimport { DIDOMI_USER_AGENT_NAME, DIDOMI_VERSION } from './Constants';\n\nconst { Didomi: RNDidomi } = NativeModules;\n\nexport const Didomi = {\n /**\n * Initialize the Didomi SDK\n *\n * @param apiKey: Public API key of the organization from the Didomi Console.\n * @param localConfigurationPath: Path to your local config file. Defaults to didomi_config.json if null.\n * @param remoteConfigurationURL: URL to a remote configuration file to load during initialization. This parameter is not used yet. Set it to null for now.\n * @param providerId: Your provider ID (if any).\n * @param disableDidomiRemoteConfig: Whether to disable loading the remove configuration from the Didomi config. Keep this to \"false\" for loading configuration from the Didomi Console.\n * @param languageCode: Language in which the consent UI should be displayed. By default, the consent UI is displayed in the language configured in the device settings. 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.\n * @param noticeId: Notice id for the remote configuration.\n */\n initialize: (\n apiKey: string,\n localConfigurationPath?: string,\n remoteConfigurationUrl?: string,\n providerId?: string,\n disableDidomiRemoteConfig: boolean = false,\n languageCode?: string,\n noticeId?: string\n ) => {\n // Init listener\n DidomiListener.init();\n\n // Trigger native SDK init\n RNDidomi.initialize(\n DIDOMI_USER_AGENT_NAME,\n DIDOMI_VERSION,\n apiKey,\n localConfigurationPath,\n remoteConfigurationUrl,\n providerId,\n disableDidomiRemoteConfig,\n languageCode,\n noticeId\n );\n },\n\n /**\n * Listen to SDK ready state\n */\n onReady: (): Promise<void> => DidomiListener.onReady(),\n\n /**\n * Listen to SDK errors\n */\n onError: (): Promise<any> => DidomiListener.onError(),\n\n /**\n * Provide the objects required to display UI elements\n */\n setupUI: (): Promise<void> => RNDidomi.setupUI(),\n\n /**\n * Set the minimum level of messages to log\n * You can decide what level of messages should be logged by the SDK by calling the setLogLevel function before initialize\n *\n * Messages with a level below `minLevel` will not be logged.\n *\n * For iOS:\n * Levels are standard levels from `OSLogType` (https://developer.apple.com/documentation/os/logging/choosing_the_log_level_for_a_message):\n * - OSLogType.info (1)\n * - OSLogType.debug (2)\n * - OSLogType.error (16)\n * - OSLogType.fault (17)\n *\n * We recommend setting `OSLogType.error` (16) in production\n *\n * For Android:\n * Use the standard log levels supported by android.util.Log: VERBOSE, DEBUG, INFO, WARN and ERROR.\n * (https://developer.android.com/reference/android/util/Log#constants_1)\n *\n * We recommend setting `Log.INFO` (4) in production\n *\n * @param minLevel: Minimum level of messages to log\n */\n setLogLevel: (level: number): Promise<number> => RNDidomi.setLogLevel(level),\n\n /**\n * Add an event listener\n * @param listener:\n */\n addEventListener: (\n eventType: DidomiEventType,\n callback: (data: any) => void\n ) => DidomiListener.addEventListener(eventType, callback),\n\n /**\n * Remove an event listener\n * @param listener:\n */\n removeEventListener: (\n eventType: DidomiEventType,\n callback: (data: any) => void\n ) => DidomiListener.removeEventListener(eventType, callback),\n\n /**\n * Remove all event listeners\n */\n removeAllEventListeners: () => DidomiListener.reset(),\n\n /**\n * Method used to get an array of disabled purposes.\n * @returns: array of disabled purposes.\n */\n getDisabledPurposes: (): Promise<any[]> => RNDidomi.getDisabledPurposes(),\n\n /**\n * Method used to get a set of disabled purpose IDs.\n * @returns: set that contains the IDs of disabled purposes.\n */\n getDisabledPurposeIds: (): Promise<any[]> => RNDidomi.getDisabledPurposeIds(),\n\n /**\n * Method used to get an array of disabled vendors.\n * @returns: array of disabled vendors.\n */\n getDisabledVendors: (): Promise<any[]> => RNDidomi.getDisabledVendors(),\n\n /**\n * Method used to get a set of disabled vendor IDs.\n * @returns: set that contains the IDs of disabled vendors.\n */\n getDisabledVendorIds: (): Promise<any[]> => RNDidomi.getDisabledVendorIds(),\n\n /**\n * Method used to get an array of enabled purposes.\n * @returns: array of enabled purposes.\n */\n getEnabledPurposes: (): Promise<any[]> => RNDidomi.getEnabledPurposes(),\n\n /**\n * Method used to get a set of enabled purpose IDs.\n * @returns: set that contains the IDs of enabled purposes.\n */\n getEnabledPurposeIds: (): Promise<any[]> => RNDidomi.getEnabledPurposeIds(),\n\n /**\n * Method used to get an array of enabled vendors.\n * @returns: array of enabled vendors.\n */\n getEnabledVendors: (): Promise<any[]> => RNDidomi.getEnabledVendors(),\n\n /**\n * Method used to get a set of enabled vendor IDs.\n * @returns: set that contains the IDs of enabled vendors.\n */\n getEnabledVendorIds: (): Promise<any[]> => RNDidomi.getEnabledVendorIds(),\n\n /**\n * Get JavaScript to embed into a WebView to pass the consent status from the app\n * to the Didomi Web SDK embedded into the WebView\n * Inject the returned JavaScript into a WebView\n * @param extra: Extra JavaScript to inject in the returned code\n * @returns: JavaScript code to inject in a WebView\n */\n getJavaScriptForWebView: (extra?: string | null): Promise<string> => RNDidomi.getJavaScriptForWebView(extra),\n\n getQueryStringForWebView: (): Promise<string> => RNDidomi.getQueryStringForWebView(),\n\n /**\n * Method used to get a Purpose based on its ID.\n * @param purposeId: purpose ID used in the search.\n * @returns: purpose found in the array.\n */\n getPurpose: (purposeId: string): Promise<any> => RNDidomi.getPurpose(purposeId),\n\n /**\n * Method used to get an array of required purposes.\n *\n * @returns: array of required purposes.\n */\n getRequiredPurposes: (): Promise<any[]> => RNDidomi.getRequiredPurposes(),\n\n /**\n * Get the configured purpose IDs\n * @returns: set of purpose IDs.\n */\n getRequiredPurposeIds: (): Promise<any[]> => RNDidomi.getRequiredPurposeIds(),\n\n /**\n * Method used to get an array of required vendors.\n * @returns: array of required vendors.\n */\n getRequiredVendors: (): Promise<any[]> => RNDidomi.getRequiredVendors(),\n\n /**\n * Get the configured vendor IDs\n * @returns: set of vendor IDs.\n */\n getRequiredVendorIds: (): Promise<any[]> => RNDidomi.getRequiredVendorIds(),\n\n /**\n * Method used to get a dictionary/map in the form of { \"en\": \"Key in English\", \"fr\": \"Key in French.\" }\n * for a given key.\n * @param key: used to find its corresponding value in the dictionary/map.\n * @returns: dictionary containing the different translations for a given key.\n */\n getText: (key: string): Promise<any[]> => RNDidomi.getText(key),\n\n /**\n * Method used to get a translated text based on the key being passed.\n * The language and the source of this translated text will depend on the availability of the translation for the specific key.\n * The language being used will be either the selected language of the SDK (based on device Locale and other parameters) or the language specified by app developers as the default language being used by the SDK. The source can be either the `didomi_config.json` file which can be either local or remote, or the `didomi_master_config.json` file which is bundled within the SDK.\n *\n * These are the attempts performed by the SDK to try to find a translation for the specific key:\n * - Get translated value in user locale (selected language) from `didomi_config.json` (either local or remote).\n * - Get translated value in default locale (from the config) from `didomi_config.json` (either local or remote).\n * - Get translated value in user locale (selected language) from `didomi_master_config.json` (bundled within the Didomi SDK).\n * - Get translated value in default locale (from the config) from `didomi_master_config.json` (bundled within the Didomi SDK).\n *\n * If no translation can be found after these 4 attempts, the key will be returned.\n *\n * App developers can provide these translated texts through the `didomi_config.json` file (locally or remotely) in 3 different ways:\n * - Custom texts for the consent notice: https://developers.didomi.io/cmp/mobile-sdk/consent-notice/customize-the-notice#texts\n * - Custom texts for the preferences: https://developers.didomi.io/cmp/mobile-sdk/consent-notice/customize-the-preferences-popup#text\n * - Custom texts for custom notices: https://developers.didomi.io/cmp/mobile-sdk/consent-notice/customize-the-theme#translatable-texts-for-custom-notices\n *\n * @param key: used to find its corresponding value in one of the different sources.\n * @returns: a translated string if a translation was found, the same key that was passed otherwise.\n */\n getTranslatedText: (key: string): Promise<string> => RNDidomi.getTranslatedText(key),\n\n /**\n * Get the user consent status for a specific purpose\n * @param purposeId: The purpose ID to check consent for\n * @returns: The user consent status for the specified purpose\n * @deprecated use {@link #getUserStatus()} instead. Search the purposeId in\n * getUserStatus().getPurposes().getConsent().getEnabled() or\n * getUserStatus().getPurposes().getConsent().getDisabled().\n */\n getUserConsentStatusForPurpose: (purposeId: string): Promise<boolean> => RNDidomi.getUserConsentStatusForPurpose(purposeId),\n\n /**\n * Get the user consent status for a specific vendor\n * @param vendorId: The vendor ID to check consent for\n * @returns: The user consent status for the specified vendor\n * @deprecated use {@link #getUserStatus()} instead. Search the vendorId in\n * getUserStatus().getVendors().getConsent().getEnabled() or\n * getUserStatus().getVendors().getConsent().getDisabled().\n */\n getUserConsentStatusForVendor: (vendorId: string): Promise<boolean> => RNDidomi.getUserConsentStatusForVendor(vendorId),\n\n /**\n * Get the user consent status for a specific vendor and all its purposes\n * @param vendorId: The ID of the vendor\n * @returns: The user consent status corresponding to the specified vendor and all its required purposes.\n * @deprecated use {@link #getUserStatus()} instead. The result of this method has been replaced\n * by getUserStatus().getVendors().getGlobalConsent().getEnabled() or\n * getUserStatus().getVendors().getGlobalConsent().getDisabled().\n */\n getUserConsentStatusForVendorAndRequiredPurposes: (vendorId: string): Promise<boolean> => RNDidomi.getUserConsentStatusForVendorAndRequiredPurposes(vendorId),\n\n /**\n * Get the user legitimate interest status for a specific purpose.\n * @param purposeId: purpose ID.\n * @returns: LI status of a purpose.\n * @deprecated use {@link #getUserStatus()} instead. Search the purposeId in\n * getUserStatus().getPurposes().getLegitimateInterest().getEnabled() or\n * getUserStatus().getPurposes().getLegitimateInterest().getDisabled().\n */\n getUserLegitimateInterestStatusForPurpose: (purposeId: string): Promise<boolean> => RNDidomi.getUserLegitimateInterestStatusForPurpose(purposeId),\n\n /**\n * Get the user legitimate interest status for a specific vendor.\n * @param vendorId: vendor ID.\n * @returns: LI status of a vendor.\n * @deprecated use {@link #getUserStatus()} instead. Search the vendorId in\n * getUserStatus().getVendors().getLegitimateInterest().getEnabled() or\n * getUserStatus().getVendors().getLegitimateInterest().getDisabled().\n */\n getUserLegitimateInterestForVendor: (vendorId: string): Promise<boolean> => RNDidomi.getUserLegitimateInterestStatusForVendor(vendorId),\n\n /**\n * Get the user LI status for a specific vendor and all its purposes.\n * @param vendorId: vendor ID.\n * @returns: The user LI status corresponding to the specified vendor and all its required purposes.\n * @deprecated use {@link #getUserStatus()} instead. Search the purposeId in\n * getUserStatus().getVendors().getGlobalLegitimateInterest().getEnabled() or\n * getUserStatus().getVendors().getGlobalLegitimateInterest().getDisabled().\n */\n getUserLegitimateInterestStatusForVendorAndRequiredPurposes: (vendorId: string): boolean => RNDidomi.getUserLegitimateInterestStatusForVendorAndRequiredPurposes(vendorId),\n\n /**\n * Get the user consent status.\n * @returns: status that represents user consent.\n */\n getUserStatus: (): Promise<any> => RNDidomi.getUserStatus(),\n\n /**\n * Get the user consent and legitimate interest status for a specific vendor.\n * @param vendorId: vendor ID.\n * @returns: status that represents both consent and legitimate interest status of a vendor.\n * @deprecated use {@link #getUserStatus()} instead. Search the vendorId in\n * getUserStatus().getVendors().getGlobal().getEnabled() or\n * getUserStatus().getVendors().getGlobal().getDisabled().\n */\n getUserStatusForVendor: (vendorId: string): Promise<boolean> => RNDidomi.getUserStatusForVendor(vendorId),\n\n /**\n * Method used to get a Vendor based on its ID.\n * @param vendorId: vendor ID used in the search.\n * @returns: vendor found in the array.\n */\n getVendor: (vendorId: string): Promise<any> => RNDidomi.getVendor(vendorId),\n\n /**\n * Hide the notice if it is currently displayed\n */\n hideNotice: (): Promise<void> => RNDidomi.hideNotice(),\n\n /**\n * Hide the preferences popup for purposes\n */\n hidePreferences: (): Promise<void> => RNDidomi.hidePreferences(),\n\n /**\n * Determine if consent is required for the user. The rules are (OR):\n * - The user country is in the EU.\n * - The company is from the EU.\n * - The user country is unknown and the app has chosen to collect consent when unknown.\n * @returns: **true** if consent is required, **false** if it is not required.\n */\n isConsentRequired: (): Promise<boolean> => RNDidomi.isConsentRequired(),\n\n /**\n * Determine if consent information is available for all purposes and vendors that are required\n * @returns: **true** if consent is required and consent information is available, **false** otherwise.\n */\n isUserConsentStatusPartial: (): Promise<boolean> => RNDidomi.isUserConsentStatusPartial(),\n\n /**\n * Check if the consent notice is currently displayed\n * @returns: **true** if the notice is displayed, **false** if is not.\n */\n isNoticeVisible: (): Promise<boolean> => RNDidomi.isNoticeVisible(),\n\n /**\n * Method used to check if the Preferences view is visible.\n * @returns: **true** if Preferences view is visible, **false** otherwise.\n */\n isPreferencesVisible: (): Promise<boolean> => RNDidomi.isPreferencesVisible(),\n\n isError: (): Promise<boolean> => RNDidomi.isError(),\n\n /**\n * Is the Didomi SDK ready?\n */\n isReady: (): Promise<boolean> => RNDidomi.isReady(),\n\n /**\n * Set user information with authentication\n *\n * @param id Organization user ID\n * @param algorithm Algorithm used for computing the digest\n * @param secretId ID of the secret used for computing the digest\n * @param salt Salt used for computing the digest (optional)\n * @param digest Digest of the organization user ID and secret\n */\n setUser: (\n organizationUserId: string,\n organizationUserIdAuthAlgorithm: string,\n organizationUserIdAuthSid: string,\n organizationUserIdAuthSalt: string,\n organizationUserIdAuthDigest: string\n ): Promise<void> =>\n RNDidomi.setUser(\n organizationUserId,\n organizationUserIdAuthAlgorithm,\n organizationUserIdAuthSid,\n organizationUserIdAuthSalt,\n organizationUserIdAuthDigest\n ),\n\n /**\n * Show the consent notice (if required, not disabled in the config and not already displayed)\n */\n showNotice: (): Promise<void> => RNDidomi.showNotice(),\n\n /**\n * Show the preferences screen when/if the SDK is ready. By default the purposes list will be displayed.\n * @param view: It can be `purposes` or `vendors`\n */\n showPreferences: (view?: string): Promise<void> => RNDidomi.showPreferences(view),\n\n /**\n * Remove all consents for the user\n */\n reset: (): Promise<void> => RNDidomi.reset(),\n\n /**\n * Method that allows to enable consent and legitimate interest for all the required purposes.\n * @returns: **true** if consent status has been updated, **false** otherwise.\n */\n setUserAgreeToAll: (): Promise<boolean> => RNDidomi.setUserAgreeToAll(),\n\n /**\n * Set the user consent status.\n * @param enabledPurposeIds: set containing **enabled purpose ids**\n * @param disabledPurposeIds: set containing **disabled purpose ids**\n * @param enabledVendorIds: set containing **enabled vendor ids**\n * @param disabledVendorIds: set containing **disabled purpose ids**\n * @returns: **true** if consent status has been updated, **false** otherwise.\n */\n setUserConsentStatus: (\n enabledPurposeIds: string[],\n disabledPurposeIds: string[],\n enabledVendorIds: string[],\n disabledVendorIds: string[]\n ): Promise<boolean> =>\n RNDidomi.setUserConsentStatus(\n enabledPurposeIds,\n disabledPurposeIds,\n enabledVendorIds,\n disabledVendorIds\n ),\n\n /**\n * Method that allows to disable consent and legitimate interest for all the required purposes and vendors.\n * @returns: **true** if consent status has been updated, **false** otherwise.\n */\n setUserDisagreeToAll: (): Promise<boolean> => RNDidomi.setUserDisagreeToAll(),\n\n /**\n * Set the user status for purposes and vendors for consent and legitimate interest.\n * @param purposesConsentStatus: boolean used to determine if consent will be enabled or disabled for all purposes.\n * @param purposesLIStatus: boolean used to determine if legitimate interest will be enabled or disabled for all purposes.\n * @param vendorsConsentStatus: boolean used to determine if consent will be enabled or disabled for all vendors.\n * @param vendorsLIStatus: boolean used to determine if legitimate interest will be enabled or disabled for all vendors.\n * @returns: **true** if consent status has been updated, **false** otherwise.\n */\n setUserStatus: (\n purposesConsentStatus: boolean,\n purposesLIStatus: boolean,\n vendorsConsentStatus: boolean,\n vendorsLIStatus: boolean\n ): Promise<boolean> =>\n RNDidomi.setUserStatus(\n purposesConsentStatus,\n purposesLIStatus,\n vendorsConsentStatus,\n vendorsLIStatus\n ),\n\n /**\n * Set the user status for purposes and vendors for consent and legitimate interest.\n * @param enabledConsentPurposeIds: List of purpose IDs to enable for consent.\n * @param disabledConsentPurposeIds: List of purpose IDs to disable for consent.\n * @param enabledLIPurposeIds: List of purpose IDs to enable for LI.\n * @param disabledLIPurposeIds: List of purpose IDs to disable for LI.\n * @param enabledConsentVendorIds: List of vendor IDs to enable for consent.\n * @param disabledConsentVendorIds: List of vendor IDs to disable for consent.\n * @param enabledLIVendorIds: List of vendor IDs to enable for LI.\n * @param disabledLIVendorIds: List of vendor IDs to disable for LI.\n */\n setUserStatusSets: (\n enabledConsentPurposeIds: string[],\n disabledConsentPurposeIds: string[],\n enabledLIPurposeIds: string[],\n disabledLIPurposeIds: string[],\n enabledConsentVendorIds: string[],\n disabledConsentVendorIds: string[],\n enabledLIVendorIds: string[],\n disabledLIVendorIds: string[]\n ): Promise<boolean> =>\n RNDidomi.setUserStatusSets(\n enabledConsentPurposeIds,\n disabledConsentPurposeIds,\n enabledLIPurposeIds,\n disabledLIPurposeIds,\n enabledConsentVendorIds,\n disabledConsentVendorIds,\n enabledLIVendorIds,\n disabledLIVendorIds\n ),\n\n /**\n * Check if the consent should be collected depending on if we have any consents or if we have some consents but the number of days before displaying the notice again has not expired yet\n * @returns: A boolean depending if the consent should be collected or not\n */\n shouldConsentBeCollected: (): Promise<boolean> =>\n RNDidomi.shouldConsentBeCollected(),\n\n /**\n * Method used to update the selected language of the Didomi SDK and any property that depends on it.\n * In most cases this method doesn't need to be called. It would only be required for those apps that allow language change on-the-fly, i.e.: from within the app rather than from the device settings.\n * In order to update the language of the views displayed by the Didomi SDK, this method needs to be called before these views are displayed.\n * @param languageCode: string containing the language code e.g.: \"es\", \"fr\", etc.\n */\n updateSelectedLanguage: (languageCode: string): Promise<void> =>\n RNDidomi.updateSelectedLanguage(languageCode),\n};\n"]}
1
+ {"version":3,"sources":["Didomi.ts"],"names":["Didomi","RNDidomi","NativeModules","initialize","apiKey","localConfigurationPath","remoteConfigurationUrl","providerId","disableDidomiRemoteConfig","languageCode","noticeId","DidomiListener","init","DIDOMI_USER_AGENT_NAME","DIDOMI_VERSION","onReady","onError","setupUI","setLogLevel","level","addEventListener","eventType","callback","removeEventListener","removeAllEventListeners","reset","getDisabledPurposes","getDisabledPurposeIds","getDisabledVendors","getDisabledVendorIds","getEnabledPurposes","getEnabledPurposeIds","getEnabledVendors","getEnabledVendorIds","getJavaScriptForWebView","extra","getQueryStringForWebView","getPurpose","purposeId","getRequiredPurposes","getRequiredPurposeIds","getRequiredVendors","getRequiredVendorIds","getText","key","getTranslatedText","getUserConsentStatusForPurpose","getUserConsentStatusForVendor","vendorId","getUserConsentStatusForVendorAndRequiredPurposes","getUserLegitimateInterestStatusForPurpose","getUserLegitimateInterestForVendor","getUserLegitimateInterestStatusForVendor","getUserLegitimateInterestStatusForVendorAndRequiredPurposes","getUserStatus","getUserStatusForVendor","getVendor","hideNotice","hidePreferences","isConsentRequired","isUserConsentStatusPartial","isNoticeVisible","isPreferencesVisible","isError","isReady","clearUser","setUser","id","algorithm","secretId","salt","digest","setUserAndSetupUI","setUserWithHashAuth","expiration","undefined","setUserWithHashAuthWithExpiration","setUserWithHashAuthAndSetupUI","setUserWithHashAuthWithExpirationAndSetupUI","setUserWithEncryptionAuth","initializationVector","setUserWithEncryptionAuthWithExpiration","setUserWithEncryptionAuthAndSetupUI","setUserWithEncryptionAuthWithExpirationAndSetupUI","showNotice","showPreferences","view","setUserAgreeToAll","setUserConsentStatus","enabledPurposeIds","disabledPurposeIds","enabledVendorIds","disabledVendorIds","setUserDisagreeToAll","setUserStatus","purposesConsentStatus","purposesLIStatus","vendorsConsentStatus","vendorsLIStatus","setUserStatusSets","enabledConsentPurposeIds","disabledConsentPurposeIds","enabledLIPurposeIds","disabledLIPurposeIds","enabledConsentVendorIds","disabledConsentVendorIds","enabledLIVendorIds","disabledLIVendorIds","shouldConsentBeCollected","updateSelectedLanguage"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AAEA,MAAM;AAAEA,EAAAA,MAAM,EAAEC;AAAV,IAAuBC,0BAA7B;AAEO,MAAMF,MAAM,GAAG;AACpB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACEG,EAAAA,UAAU,EAAE,CACVC,MADU,EAEVC,sBAFU,EAGVC,sBAHU,EAIVC,UAJU,EAKVC,yBAAkC,GAAG,KAL3B,EAMVC,YANU,EAOVC,QAPU,KAQQ;AAClB;AACAC,mCAAeC,IAAf,GAFkB,CAIlB;;;AACA,WAAOX,QAAQ,CAACE,UAAT,CACLU,iCADK,EAELC,yBAFK,EAGLV,MAHK,EAILC,sBAJK,EAKLC,sBALK,EAMLC,UANK,EAOLC,yBAPK,EAQLC,YARK,EASLC,QATK,CAAP;AAWD,GApCmB;;AAsCpB;AACF;AACA;AACEK,EAAAA,OAAO,EAAE,MAAqBJ,+BAAeI,OAAf,EAzCV;;AA2CpB;AACF;AACA;AACEC,EAAAA,OAAO,EAAE,MAAoBL,+BAAeK,OAAf,EA9CT;;AAgDpB;AACF;AACA;AACEC,EAAAA,OAAO,EAAE,MAAqBhB,QAAQ,CAACgB,OAAT,EAnDV;;AAqDpB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACEC,EAAAA,WAAW,EAA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EAMjBC,wBANiB,EAOjBC,kBAPiB,EAQjBC,mBARiB,KAUjB1G,QAAQ,CAACkG,iBAAT,CACEC,wBADF,EAEEC,yBAFF,EAGEC,mBAHF,EAIEC,oBAJF,EAKEC,uBALF,EAMEC,wBANF,EAOEC,kBAPF,EAQEC,mBARF,CA7nBkB;;AAwoBpB;AACF;AACA;AACA;AACEC,EAAAA,wBAAwB,EAAE,MACxB3G,QAAQ,CAAC2G,wBAAT,EA7oBkB;;AA+oBpB;AACF;AACA;AACA;AACA;AACA;AACEC,EAAAA,sBAAsB,EAAGpG,YAAD,IACtBR,QAAQ,CAAC4G,sBAAT,CAAgCpG,YAAhC;AAtpBkB,CAAf","sourcesContent":["import { NativeModules } from 'react-native';\nimport { DidomiListener } from './DidomiListener';\nimport { DidomiEventType } from './DidomiTypes';\nimport { DIDOMI_USER_AGENT_NAME, DIDOMI_VERSION } from './Constants';\n\nconst { Didomi: RNDidomi } = NativeModules;\n\nexport const Didomi = {\n /**\n * Initialize the Didomi SDK\n *\n * @param apiKey: Public API key of the organization from the Didomi Console.\n * @param localConfigurationPath: Path to your local config file. Defaults to didomi_config.json if null.\n * @param remoteConfigurationURL: URL to a remote configuration file to load during initialization. This parameter is not used yet. Set it to null for now.\n * @param providerId: Your provider ID (if any).\n * @param disableDidomiRemoteConfig: Whether to disable loading the remove configuration from the Didomi config. Keep this to \"false\" for loading configuration from the Didomi Console.\n * @param languageCode: Language in which the consent UI should be displayed. By default, the consent UI is displayed in the language configured in the device settings. 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.\n * @param noticeId: Notice id for the remote configuration.\n */\n initialize: (\n apiKey: string,\n localConfigurationPath?: string,\n remoteConfigurationUrl?: string,\n providerId?: string,\n disableDidomiRemoteConfig: boolean = false,\n languageCode?: string,\n noticeId?: string\n ): Promise<void> => {\n // Init listener\n DidomiListener.init();\n\n // Trigger native SDK init\n return RNDidomi.initialize(\n DIDOMI_USER_AGENT_NAME,\n DIDOMI_VERSION,\n apiKey,\n localConfigurationPath,\n remoteConfigurationUrl,\n providerId,\n disableDidomiRemoteConfig,\n languageCode,\n noticeId\n );\n },\n\n /**\n * Listen to SDK ready state\n */\n onReady: (): Promise<void> => DidomiListener.onReady(),\n\n /**\n * Listen to SDK errors\n */\n onError: (): Promise<any> => DidomiListener.onError(),\n\n /**\n * Provide the objects required to display UI elements\n */\n setupUI: (): Promise<void> => RNDidomi.setupUI(),\n\n /**\n * Set the minimum level of messages to log\n * You can decide what level of messages should be logged by the SDK by calling the setLogLevel function before initialize\n *\n * Messages with a level below `minLevel` will not be logged.\n *\n * For iOS:\n * Levels are standard levels from `OSLogType` (https://developer.apple.com/documentation/os/logging/choosing_the_log_level_for_a_message):\n * - OSLogType.info (1)\n * - OSLogType.debug (2)\n * - OSLogType.error (16)\n * - OSLogType.fault (17)\n *\n * We recommend setting `OSLogType.error` (16) in production\n *\n * For Android:\n * Use the standard log levels supported by android.util.Log: VERBOSE, DEBUG, INFO, WARN and ERROR.\n * (https://developer.android.com/reference/android/util/Log#constants_1)\n *\n * We recommend setting `Log.INFO` (4) in production\n *\n * @param minLevel: Minimum level of messages to log\n */\n setLogLevel: (level: number): Promise<void> => RNDidomi.setLogLevel(level),\n\n /**\n * Add an event listener\n * @param listener:\n */\n addEventListener: (\n eventType: DidomiEventType,\n callback: (data: any) => void\n ) => DidomiListener.addEventListener(eventType, callback),\n\n /**\n * Remove an event listener\n * @param listener:\n */\n removeEventListener: (\n eventType: DidomiEventType,\n callback: (data: any) => void\n ) => DidomiListener.removeEventListener(eventType, callback),\n\n /**\n * Remove all event listeners\n */\n removeAllEventListeners: () => DidomiListener.reset(),\n\n /**\n * Method used to get an array of disabled purposes.\n * @returns: array of disabled purposes.\n * @deprecated use {@link #getUserStatus()} instead. The result of this method\n * has been replaced by getUserStatus().getPurposes().getConsent().getDisabled().\n */\n getDisabledPurposes: (): Promise<any[]> => RNDidomi.getDisabledPurposes(),\n\n /**\n * Method used to get a set of disabled purpose IDs.\n * @returns: set that contains the IDs of disabled purposes.\n * @deprecated use {@link #getUserStatus()} instead. The result of this method\n * has been replaced by getUserStatus().getPurposes().getConsent().getDisabled().\n */\n getDisabledPurposeIds: (): Promise<any[]> => RNDidomi.getDisabledPurposeIds(),\n\n /**\n * Method used to get an array of disabled vendors.\n * @returns: array of disabled vendors.\n * @deprecated use {@link #getUserStatus()} instead. The result of this method\n * has been replaced by getUserStatus().getVendors().getConsent().getDisabled().\n */\n getDisabledVendors: (): Promise<any[]> => RNDidomi.getDisabledVendors(),\n\n /**\n * Method used to get a set of disabled vendor IDs.\n * @returns: set that contains the IDs of disabled vendors.\n * @deprecated use {@link #getUserStatus()} instead. The result of this method\n * has been replaced by getUserStatus().getVendors().getConsent().getDisabled().\n */\n getDisabledVendorIds: (): Promise<any[]> => RNDidomi.getDisabledVendorIds(),\n\n /**\n * Method used to get an array of enabled purposes.\n * @returns: array of enabled purposes.\n * @deprecated use {@link #getUserStatus()} instead. The result of this method\n * has been replaced by getUserStatus().getPurposes().getConsent().getEnabled().\n */\n getEnabledPurposes: (): Promise<any[]> => RNDidomi.getEnabledPurposes(),\n\n /**\n * Method used to get a set of enabled purpose IDs.\n * @returns: set that contains the IDs of enabled purposes.\n * @deprecated use {@link #getUserStatus()} instead. The result of this method\n * has been replaced by getUserStatus().getPurposes().getConsent().getEnabled().\n */\n getEnabledPurposeIds: (): Promise<any[]> => RNDidomi.getEnabledPurposeIds(),\n\n /**\n * Method used to get an array of enabled vendors.\n * @returns: array of enabled vendors.\n * @deprecated use {@link #getUserStatus()} instead. The result of this method\n * has been replaced by getUserStatus().getVendors().getConsent().getEnabled().\n */\n getEnabledVendors: (): Promise<any[]> => RNDidomi.getEnabledVendors(),\n\n /**\n * Method used to get a set of enabled vendor IDs.\n * @returns: set that contains the IDs of enabled vendors.\n * @deprecated use {@link #getUserStatus()} instead. The result of this method\n * has been replaced by getUserStatus().getVendors().getConsent().getEnabled().\n */\n getEnabledVendorIds: (): Promise<any[]> => RNDidomi.getEnabledVendorIds(),\n\n /**\n * Get JavaScript to embed into a WebView to pass the consent status from the app\n * to the Didomi Web SDK embedded into the WebView\n * Inject the returned JavaScript into a WebView\n * @param extra: Extra JavaScript to inject in the returned code\n * @returns: JavaScript code to inject in a WebView\n */\n getJavaScriptForWebView: (extra?: string | null): Promise<string> => RNDidomi.getJavaScriptForWebView(extra),\n\n getQueryStringForWebView: (): Promise<string> => RNDidomi.getQueryStringForWebView(),\n\n /**\n * Method used to get a Purpose based on its ID.\n * @param purposeId: purpose ID used in the search.\n * @returns: purpose found in the array.\n */\n getPurpose: (purposeId: string): Promise<any> => RNDidomi.getPurpose(purposeId),\n\n /**\n * Method used to get an array of required purposes.\n *\n * @returns: array of required purposes.\n */\n getRequiredPurposes: (): Promise<any[]> => RNDidomi.getRequiredPurposes(),\n\n /**\n * Get the configured purpose IDs\n * @returns: set of purpose IDs.\n */\n getRequiredPurposeIds: (): Promise<any[]> => RNDidomi.getRequiredPurposeIds(),\n\n /**\n * Method used to get an array of required vendors.\n * @returns: array of required vendors.\n */\n getRequiredVendors: (): Promise<any[]> => RNDidomi.getRequiredVendors(),\n\n /**\n * Get the configured vendor IDs\n * @returns: set of vendor IDs.\n */\n getRequiredVendorIds: (): Promise<any[]> => RNDidomi.getRequiredVendorIds(),\n\n /**\n * Method used to get a dictionary/map in the form of { \"en\": \"Key in English\", \"fr\": \"Key in French.\" }\n * for a given key.\n * @param key: used to find its corresponding value in the dictionary/map.\n * @returns: dictionary containing the different translations for a given key.\n */\n getText: (key: string): Promise<any[]> => RNDidomi.getText(key),\n\n /**\n * Method used to get a translated text based on the key being passed.\n * The language and the source of this translated text will depend on the availability of the translation for the specific key.\n * The language being used will be either the selected language of the SDK (based on device Locale and other parameters) or the language specified by app developers as the default language being used by the SDK. The source can be either the `didomi_config.json` file which can be either local or remote, or the `didomi_master_config.json` file which is bundled within the SDK.\n *\n * These are the attempts performed by the SDK to try to find a translation for the specific key:\n * - Get translated value in user locale (selected language) from `didomi_config.json` (either local or remote).\n * - Get translated value in default locale (from the config) from `didomi_config.json` (either local or remote).\n * - Get translated value in user locale (selected language) from `didomi_master_config.json` (bundled within the Didomi SDK).\n * - Get translated value in default locale (from the config) from `didomi_master_config.json` (bundled within the Didomi SDK).\n *\n * If no translation can be found after these 4 attempts, the key will be returned.\n *\n * App developers can provide these translated texts through the `didomi_config.json` file (locally or remotely) in 3 different ways:\n * - Custom texts for the consent notice: https://developers.didomi.io/cmp/mobile-sdk/consent-notice/customize-the-notice#texts\n * - Custom texts for the preferences: https://developers.didomi.io/cmp/mobile-sdk/consent-notice/customize-the-preferences-popup#text\n * - Custom texts for custom notices: https://developers.didomi.io/cmp/mobile-sdk/consent-notice/customize-the-theme#translatable-texts-for-custom-notices\n *\n * @param key: used to find its corresponding value in one of the different sources.\n * @returns: a translated string if a translation was found, the same key that was passed otherwise.\n */\n getTranslatedText: (key: string): Promise<string> => RNDidomi.getTranslatedText(key),\n\n /**\n * Get the user consent status for a specific purpose\n * @param purposeId: The purpose ID to check consent for\n * @returns: The user consent status for the specified purpose\n * @deprecated use {@link #getUserStatus()} instead. Search the purposeId in\n * getUserStatus().getPurposes().getConsent().getEnabled() or\n * getUserStatus().getPurposes().getConsent().getDisabled().\n */\n getUserConsentStatusForPurpose: (purposeId: string): Promise<boolean> => RNDidomi.getUserConsentStatusForPurpose(purposeId),\n\n /**\n * Get the user consent status for a specific vendor\n * @param vendorId: The vendor ID to check consent for\n * @returns: The user consent status for the specified vendor\n * @deprecated use {@link #getUserStatus()} instead. Search the vendorId in\n * getUserStatus().getVendors().getConsent().getEnabled() or\n * getUserStatus().getVendors().getConsent().getDisabled().\n */\n getUserConsentStatusForVendor: (vendorId: string): Promise<boolean> => RNDidomi.getUserConsentStatusForVendor(vendorId),\n\n /**\n * Get the user consent status for a specific vendor and all its purposes\n * @param vendorId: The ID of the vendor\n * @returns: The user consent status corresponding to the specified vendor and all its required purposes.\n * @deprecated use {@link #getUserStatus()} instead. The result of this method has been replaced\n * by getUserStatus().getVendors().getGlobalConsent().getEnabled() or\n * getUserStatus().getVendors().getGlobalConsent().getDisabled().\n */\n getUserConsentStatusForVendorAndRequiredPurposes: (vendorId: string): Promise<boolean> => RNDidomi.getUserConsentStatusForVendorAndRequiredPurposes(vendorId),\n\n /**\n * Get the user legitimate interest status for a specific purpose.\n * @param purposeId: purpose ID.\n * @returns: LI status of a purpose.\n * @deprecated use {@link #getUserStatus()} instead. Search the purposeId in\n * getUserStatus().getPurposes().getLegitimateInterest().getEnabled() or\n * getUserStatus().getPurposes().getLegitimateInterest().getDisabled().\n */\n getUserLegitimateInterestStatusForPurpose: (purposeId: string): Promise<boolean> => RNDidomi.getUserLegitimateInterestStatusForPurpose(purposeId),\n\n /**\n * Get the user legitimate interest status for a specific vendor.\n * @param vendorId: vendor ID.\n * @returns: LI status of a vendor.\n * @deprecated use {@link #getUserStatus()} instead. Search the vendorId in\n * getUserStatus().getVendors().getLegitimateInterest().getEnabled() or\n * getUserStatus().getVendors().getLegitimateInterest().getDisabled().\n */\n getUserLegitimateInterestForVendor: (vendorId: string): Promise<boolean> => RNDidomi.getUserLegitimateInterestStatusForVendor(vendorId),\n\n /**\n * Get the user LI status for a specific vendor and all its purposes.\n * @param vendorId: vendor ID.\n * @returns: The user LI status corresponding to the specified vendor and all its required purposes.\n * @deprecated use {@link #getUserStatus()} instead. Search the purposeId in\n * getUserStatus().getVendors().getGlobalLegitimateInterest().getEnabled() or\n * getUserStatus().getVendors().getGlobalLegitimateInterest().getDisabled().\n */\n getUserLegitimateInterestStatusForVendorAndRequiredPurposes: (vendorId: string): boolean => RNDidomi.getUserLegitimateInterestStatusForVendorAndRequiredPurposes(vendorId),\n\n /**\n * Get the user consent status.\n * @returns: status that represents user consent.\n */\n getUserStatus: (): Promise<any> => RNDidomi.getUserStatus(),\n\n /**\n * Get the user consent and legitimate interest status for a specific vendor.\n * @param vendorId: vendor ID.\n * @returns: status that represents both consent and legitimate interest status of a vendor.\n * @deprecated use {@link #getUserStatus()} instead. Search the vendorId in\n * getUserStatus().getVendors().getGlobal().getEnabled() or\n * getUserStatus().getVendors().getGlobal().getDisabled().\n */\n getUserStatusForVendor: (vendorId: string): Promise<boolean> => RNDidomi.getUserStatusForVendor(vendorId),\n\n /**\n * Method used to get a Vendor based on its ID.\n * @param vendorId: vendor ID used in the search.\n * @returns: vendor found in the array.\n */\n getVendor: (vendorId: string): Promise<any> => RNDidomi.getVendor(vendorId),\n\n /**\n * Hide the notice if it is currently displayed\n */\n hideNotice: (): Promise<void> => RNDidomi.hideNotice(),\n\n /**\n * Hide the preferences popup for purposes\n */\n hidePreferences: (): Promise<void> => RNDidomi.hidePreferences(),\n\n /**\n * Determine if consent is required for the user. The rules are (OR):\n * - The user country is in the EU.\n * - The company is from the EU.\n * - The user country is unknown and the app has chosen to collect consent when unknown.\n * @returns: **true** if consent is required, **false** if it is not required.\n */\n isConsentRequired: (): Promise<boolean> => RNDidomi.isConsentRequired(),\n\n /**\n * Determine if consent information is available for all purposes and vendors that are required\n * @returns: **true** if consent is required and consent information is available, **false** otherwise.\n */\n isUserConsentStatusPartial: (): Promise<boolean> => RNDidomi.isUserConsentStatusPartial(),\n\n /**\n * Check if the consent notice is currently displayed\n * @returns: **true** if the notice is displayed, **false** if is not.\n */\n isNoticeVisible: (): Promise<boolean> => RNDidomi.isNoticeVisible(),\n\n /**\n * Method used to check if the Preferences view is visible.\n * @returns: **true** if Preferences view is visible, **false** otherwise.\n */\n isPreferencesVisible: (): Promise<boolean> => RNDidomi.isPreferencesVisible(),\n\n isError: (): Promise<boolean> => RNDidomi.isError(),\n\n /**\n * Is the Didomi SDK ready?\n */\n isReady: (): Promise<boolean> => RNDidomi.isReady(),\n\n /**\n * Clear user information\n */\n clearUser: (): Promise<void> => RNDidomi.clearUser(),\n\n /**\n * Set user information without authentication\n *\n * @param id Organization user ID\n * @param algorithm Deprecated. To set user with authentication, use setUserWithHashAuth or setUserWithEncryptionAuth.\n * @param secretId Deprecated. To set user with authentication, use setUserWithHashAuth or setUserWithEncryptionAuth.\n * @param salt Deprecated. To set user with authentication, use setUserWithHashAuth or setUserWithEncryptionAuth.\n * @param digest Deprecated. To set user with authentication, use setUserWithHashAuth or setUserWithEncryptionAuth.\n */\n setUser: (\n id: string,\n algorithm?: string,\n secretId?: string,\n salt?: string,\n digest?: string\n ): Promise<void> =>\n RNDidomi.setUser(\n id,\n algorithm,\n secretId,\n salt,\n digest\n ),\n\n /**\n * Set user information without authentication and check for missing consent\n *\n * @param id Organization user ID\n */\n setUserAndSetupUI: (id: string): Promise<void> => RNDidomi.setUserAndSetupUI(id),\n\n /**\n * Set user information with Hash authentication\n *\n * @param id Organization user ID\n * @param algorithm Algorithm used for computing the digest\n * @param secretId ID of the secret used for computing the digest\n * @param digest Digest of the organization user ID and secret\n * @param salt Salt used for computing the digest (optional)\n * @param expiration Expiration date as timestamp (to prevent replay attacks)\n */\n setUserWithHashAuth: (\n id: string,\n algorithm: string,\n secretId: string,\n digest: string,\n salt?: string,\n expiration?: BigInt\n ): void => {\n if (expiration === undefined) {\n RNDidomi.setUserWithHashAuth(\n id,\n algorithm,\n secretId,\n digest,\n salt\n );\n } else {\n RNDidomi.setUserWithHashAuthWithExpiration(\n id,\n algorithm,\n secretId,\n digest,\n salt,\n expiration\n );\n }\n },\n\n /**\n * Set user information with Hash authentication and check for missing consent\n *\n * @param id Organization user ID\n * @param algorithm Algorithm used for computing the digest\n * @param secretId ID of the secret used for computing the digest\n * @param digest Digest of the organization user ID and secret\n * @param salt Salt used for computing the digest (optional)\n * @param expiration Expiration date as timestamp (to prevent replay attacks)\n */\n setUserWithHashAuthAndSetupUI: (\n id: string,\n algorithm: string,\n secretId: string,\n digest: string,\n salt?: string,\n expiration?: BigInt\n ): void => {\n if (expiration === undefined) {\n RNDidomi.setUserWithHashAuthAndSetupUI(\n id,\n algorithm,\n secretId,\n digest,\n salt\n );\n } else {\n RNDidomi.setUserWithHashAuthWithExpirationAndSetupUI(\n id,\n algorithm,\n secretId,\n digest,\n salt,\n expiration\n );\n }\n },\n\n /**\n * Set user information with Encryption authentication\n *\n * @param id Organization user ID\n * @param algorithm Algorithm used for computing the digest\n * @param secretId ID of the secret used for computing the digest\n * @param initializationVector Initialization Vector used for computing the user ID\n * @param expiration Expiration date as timestamp (to prevent replay attacks)\n */\n setUserWithEncryptionAuth: (\n id: string,\n algorithm: string,\n secretId: string,\n initializationVector: string,\n expiration?: BigInt\n ): void => {\n if (expiration === undefined) {\n RNDidomi.setUserWithEncryptionAuth(\n id,\n algorithm,\n secretId,\n initializationVector\n );\n } else {\n RNDidomi.setUserWithEncryptionAuthWithExpiration(\n id,\n algorithm,\n secretId,\n initializationVector,\n expiration\n );\n }\n },\n\n /**\n * Set user information with Encryption authentication and check for missing consent\n *\n * @param id Organization user ID\n * @param algorithm Algorithm used for computing the digest\n * @param secretId ID of the secret used for computing the digest\n * @param initializationVector Initialization Vector used for computing the user ID\n * @param expiration Expiration date as timestamp (to prevent replay attacks)\n */\n setUserWithEncryptionAuthAndSetupUI: (\n id: string,\n algorithm: string,\n secretId: string,\n initializationVector: string,\n expiration?: BigInt\n ): void => {\n if (expiration === undefined) {\n RNDidomi.setUserWithEncryptionAuthAndSetupUI(\n id,\n algorithm,\n secretId,\n initializationVector\n );\n } else {\n RNDidomi.setUserWithEncryptionAuthWithExpirationAndSetupUI(\n id,\n algorithm,\n secretId,\n initializationVector,\n expiration\n );\n }\n },\n\n /**\n * Show the consent notice (if required, not disabled in the config and not already displayed)\n */\n showNotice: (): Promise<void> => RNDidomi.showNotice(),\n\n /**\n * Show the preferences screen when/if the SDK is ready. By default the purposes list will be displayed.\n * @param view: It can be `purposes` or `vendors`\n */\n showPreferences: (view?: string): Promise<void> => RNDidomi.showPreferences(view),\n\n /**\n * Remove all consents for the user\n */\n reset: (): Promise<void> => RNDidomi.reset(),\n\n /**\n * Method that allows to enable consent and legitimate interest for all the required purposes.\n * @returns: **true** if consent status has been updated, **false** otherwise.\n */\n setUserAgreeToAll: (): Promise<boolean> => RNDidomi.setUserAgreeToAll(),\n\n /**\n * Set the user consent status.\n * @param enabledPurposeIds: set containing **enabled purpose ids**\n * @param disabledPurposeIds: set containing **disabled purpose ids**\n * @param enabledVendorIds: set containing **enabled vendor ids**\n * @param disabledVendorIds: set containing **disabled purpose ids**\n * @returns: **true** if consent status has been updated, **false** otherwise.\n */\n setUserConsentStatus: (\n enabledPurposeIds: string[],\n disabledPurposeIds: string[],\n enabledVendorIds: string[],\n disabledVendorIds: string[]\n ): Promise<boolean> =>\n RNDidomi.setUserConsentStatus(\n enabledPurposeIds,\n disabledPurposeIds,\n enabledVendorIds,\n disabledVendorIds\n ),\n\n /**\n * Method that allows to disable consent and legitimate interest for all the required purposes and vendors.\n * @returns: **true** if consent status has been updated, **false** otherwise.\n */\n setUserDisagreeToAll: (): Promise<boolean> => RNDidomi.setUserDisagreeToAll(),\n\n /**\n * Set the user status for purposes and vendors for consent and legitimate interest.\n * @param purposesConsentStatus: boolean used to determine if consent will be enabled or disabled for all purposes.\n * @param purposesLIStatus: boolean used to determine if legitimate interest will be enabled or disabled for all purposes.\n * @param vendorsConsentStatus: boolean used to determine if consent will be enabled or disabled for all vendors.\n * @param vendorsLIStatus: boolean used to determine if legitimate interest will be enabled or disabled for all vendors.\n * @returns: **true** if consent status has been updated, **false** otherwise.\n */\n setUserStatus: (\n purposesConsentStatus: boolean,\n purposesLIStatus: boolean,\n vendorsConsentStatus: boolean,\n vendorsLIStatus: boolean\n ): Promise<boolean> =>\n RNDidomi.setUserStatus(\n purposesConsentStatus,\n purposesLIStatus,\n vendorsConsentStatus,\n vendorsLIStatus\n ),\n\n /**\n * Set the user status for purposes and vendors for consent and legitimate interest.\n * @param enabledConsentPurposeIds: List of purpose IDs to enable for consent.\n * @param disabledConsentPurposeIds: List of purpose IDs to disable for consent.\n * @param enabledLIPurposeIds: List of purpose IDs to enable for LI.\n * @param disabledLIPurposeIds: List of purpose IDs to disable for LI.\n * @param enabledConsentVendorIds: List of vendor IDs to enable for consent.\n * @param disabledConsentVendorIds: List of vendor IDs to disable for consent.\n * @param enabledLIVendorIds: List of vendor IDs to enable for LI.\n * @param disabledLIVendorIds: List of vendor IDs to disable for LI.\n */\n setUserStatusSets: (\n enabledConsentPurposeIds: string[],\n disabledConsentPurposeIds: string[],\n enabledLIPurposeIds: string[],\n disabledLIPurposeIds: string[],\n enabledConsentVendorIds: string[],\n disabledConsentVendorIds: string[],\n enabledLIVendorIds: string[],\n disabledLIVendorIds: string[]\n ): Promise<boolean> =>\n RNDidomi.setUserStatusSets(\n enabledConsentPurposeIds,\n disabledConsentPurposeIds,\n enabledLIPurposeIds,\n disabledLIPurposeIds,\n enabledConsentVendorIds,\n disabledConsentVendorIds,\n enabledLIVendorIds,\n disabledLIVendorIds\n ),\n\n /**\n * Check if the consent should be collected depending on if we have any consents or if we have some consents but the number of days before displaying the notice again has not expired yet\n * @returns: A boolean depending if the consent should be collected or not\n */\n shouldConsentBeCollected: (): Promise<boolean> =>\n RNDidomi.shouldConsentBeCollected(),\n\n /**\n * Method used to update the selected language of the Didomi SDK and any property that depends on it.\n * In most cases this method doesn't need to be called. It would only be required for those apps that allow language change on-the-fly, i.e.: from within the app rather than from the device settings.\n * In order to update the language of the views displayed by the Didomi SDK, this method needs to be called before these views are displayed.\n * @param languageCode: string containing the language code e.g.: \"es\", \"fr\", etc.\n */\n updateSelectedLanguage: (languageCode: string): Promise<void> =>\n RNDidomi.updateSelectedLanguage(languageCode),\n};\n"]}
@@ -25,6 +25,8 @@ const DidomiListener = {
25
25
  init: () => {
26
26
  // Register all native event listeners
27
27
  Object.values(_DidomiTypes.DidomiEventType).forEach(eventTypeValue => {
28
+ // Remove previous listeners, as init() can be called several times in some configs
29
+ DidomiListener.eventEmitter.removeAllListeners(eventTypeValue);
28
30
  DidomiListener.eventEmitter.addListener(eventTypeValue, _event => {
29
31
  let events = DidomiListener.listeners.get(eventTypeValue);
30
32
 
@@ -1 +1 @@
1
- {"version":3,"sources":["DidomiListener.ts"],"names":["Didomi","RNDidomi","NativeModules","InternalEventType","DidomiListener","listeners","Map","eventEmitter","NativeEventEmitter","init","Object","values","DidomiEventType","forEach","eventTypeValue","addListener","_event","events","get","el","reset","addEventListener","eventType","callback","set","push","removeEventListener","index","indexOf","splice","onReady","Promise","resolve","listener","removeListener","READY_CALLBACK","onError","ERROR_CALLBACK"],"mappings":";;;;;;;AAAA;;AACA;;AAEA,MAAM;AAAEA,EAAAA,MAAM,EAAEC;AAAV,IAAuBC,0BAA7B;IAEKC,iB;;WAAAA,iB;AAAAA,EAAAA,iB;AAAAA,EAAAA,iB;GAAAA,iB,KAAAA,iB;;AAKE,MAAMC,cAAc,GAAG;AAC5BC,EAAAA,SAAS,EAAE,IAAIC,GAAJ,EADiB;AAE5BC,EAAAA,YAAY,EAAE,IAAIC,+BAAJ,CAAuBP,QAAvB,CAFc;AAI5BQ,EAAAA,IAAI,EAAE,MAAM;AACV;AACAC,IAAAA,MAAM,CAACC,MAAP,CAAcC,4BAAd,EAA+BC,OAA/B,CAAwCC,cAAD,IAAoB;AACzDV,MAAAA,cAAc,CAACG,YAAf,CAA4BQ,WAA5B,CAAwCD,cAAxC,EAAyDE,MAAD,IAAiB;AACvE,YAAIC,MAAM,GAAGb,cAAc,CAACC,SAAf,CAAyBa,GAAzB,CAA6BJ,cAA7B,CAAb;;AACA,YAAIG,MAAJ,EAAY;AACVA,UAAAA,MAAM,CAACJ,OAAP,CAAgBM,EAAD,IAAa;AAC1BA,YAAAA,EAAE,CAACH,MAAD,CAAF;AACD,WAFD;AAGD;AACF,OAPD;AAQD,KATD;AAUD,GAhB2B;AAkB5BI,EAAAA,KAAK,EAAE,MAAM;AACX;AACAhB,IAAAA,cAAc,CAACC,SAAf,GAA2B,IAAIC,GAAJ,EAA3B;AACD,GArB2B;AAuB5Be,EAAAA,gBAAgB,EAAE,CAChBC,SADgB,EAEhBC,QAFgB,KAGb;AACH,QAAIN,MAAM,GAAGb,cAAc,CAACC,SAAf,CAAyBa,GAAzB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,OAND;;AAOA7B,MAAAA,cAAc,CAACG,YAAf,CAA4BQ,WAA5B,CACEZ,iBAAiB,CAACkC,cADpB,EAEEJ,QAFF;AAID,KAZM,CAAP;AAaD;AA9E2B,CAAvB","sourcesContent":["import { NativeModules, NativeEventEmitter } from 'react-native';\nimport { DidomiEventType } from './DidomiTypes';\n\nconst { Didomi: RNDidomi } = NativeModules;\n\nenum InternalEventType {\n READY_CALLBACK = 'on_ready_callback',\n ERROR_CALLBACK = 'on_error_callback',\n}\n\nexport const DidomiListener = {\n listeners: new Map(),\n eventEmitter: new NativeEventEmitter(RNDidomi),\n\n init: () => {\n // Register all native event listeners\n Object.values(DidomiEventType).forEach((eventTypeValue) => {\n DidomiListener.eventEmitter.addListener(eventTypeValue, (_event: any) => {\n let events = DidomiListener.listeners.get(eventTypeValue);\n if (events) {\n events.forEach((el: any) => {\n el(_event);\n });\n }\n });\n });\n },\n\n reset: () => {\n // Reset listeners\n DidomiListener.listeners = new Map();\n },\n\n addEventListener: (\n eventType: DidomiEventType,\n callback: (data: any) => void\n ) => {\n let events = DidomiListener.listeners.get(eventType);\n if (!events) {\n events = [];\n DidomiListener.listeners.set(eventType, events);\n }\n events.push(callback);\n },\n\n removeEventListener: (\n eventType: DidomiEventType,\n callback: (data: any) => void\n ) => {\n let events = DidomiListener.listeners.get(eventType);\n if (events) {\n var index = events.indexOf(callback);\n if (index !== -1) {\n events.splice(index, 1);\n }\n }\n },\n\n onReady: (): Promise<void> => {\n return new Promise<void>((resolve) => {\n const listener = (_event: any) => {\n resolve();\n DidomiListener.eventEmitter.removeListener(\n InternalEventType.READY_CALLBACK,\n listener\n );\n };\n DidomiListener.eventEmitter.addListener(\n InternalEventType.READY_CALLBACK,\n listener\n );\n });\n },\n\n onError: (): Promise<any> => {\n return new Promise<any>((resolve) => {\n const listener = (_event: any) => {\n resolve(_event);\n DidomiListener.eventEmitter.removeListener(\n InternalEventType.ERROR_CALLBACK,\n listener\n );\n };\n DidomiListener.eventEmitter.addListener(\n InternalEventType.ERROR_CALLBACK,\n listener\n );\n });\n },\n};\n"]}
1
+ {"version":3,"sources":["DidomiListener.ts"],"names":["Didomi","RNDidomi","NativeModules","InternalEventType","DidomiListener","listeners","Map","eventEmitter","NativeEventEmitter","init","Object","values","DidomiEventType","forEach","eventTypeValue","removeAllListeners","addListener","_event","events","get","el","reset","addEventListener","eventType","callback","set","push","removeEventListener","index","indexOf","splice","onReady","Promise","resolve","listener","removeListener","READY_CALLBACK","onError","ERROR_CALLBACK"],"mappings":";;;;;;;AAAA;;AACA;;AAEA,MAAM;AAAEA,EAAAA,MAAM,EAAEC;AAAV,IAAuBC,0BAA7B;IAEKC,iB;;WAAAA,iB;AAAAA,EAAAA,iB;AAAAA,EAAAA,iB;GAAAA,iB,KAAAA,iB;;AAKE,MAAMC,cAAc,GAAG;AAC5BC,EAAAA,SAAS,EAAE,IAAIC,GAAJ,EADiB;AAE5BC,EAAAA,YAAY,EAAE,IAAIC,+BAAJ,CAAuBP,QAAvB,CAFc;AAI5BQ,EAAAA,IAAI,EAAE,MAAM;AACV;AACAC,IAAAA,MAAM,CAACC,MAAP,CAAcC,4BAAd,EAA+BC,OAA/B,CAAwCC,cAAD,IAAoB;AACzD;AACAV,MAAAA,cAAc,CAACG,YAAf,CAA4BQ,kBAA5B,CAA+CD,cAA/C;AACAV,MAAAA,cAAc,CAACG,YAAf,CAA4BS,WAA5B,CAAwCF,cAAxC,EAAyDG,MAAD,IAAiB;AACvE,YAAIC,MAAM,GAAGd,cAAc,CAACC,SAAf,CAAyBc,GAAzB,CAA6BL,cAA7B,CAAb;;AACA,YAAII,MAAJ,EAAY;AACVA,UAAAA,MAAM,CAACL,OAAP,CAAgBO,EAAD,IAAa;AAC1BA,YAAAA,EAAE,CAACH,MAAD,CAAF;AACD,WAFD;AAGD;AACF,OAPD;AAQD,KAXD;AAYD,GAlB2B;AAoB5BI,EAAAA,KAAK,EAAE,MAAM;AACX;AACAjB,IAAAA,cAAc,CAACC,SAAf,GAA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,GAAIjB,MAAD,IAAiB;AAChCgB,QAAAA,OAAO,CAAChB,MAAD,CAAP;AACAb,QAAAA,cAAc,CAACG,YAAf,CAA4B4B,cAA5B,CACEhC,iBAAiB,CAACmC,cADpB,EAEEJ,QAFF;AAID,OAND;;AAOA9B,MAAAA,cAAc,CAACG,YAAf,CAA4BS,WAA5B,CACEb,iBAAiB,CAACmC,cADpB,EAEEJ,QAFF;AAID,KAZM,CAAP;AAaD;AAhF2B,CAAvB","sourcesContent":["import { NativeModules, NativeEventEmitter } from 'react-native';\nimport { DidomiEventType } from './DidomiTypes';\n\nconst { Didomi: RNDidomi } = NativeModules;\n\nenum InternalEventType {\n READY_CALLBACK = 'on_ready_callback',\n ERROR_CALLBACK = 'on_error_callback',\n}\n\nexport const DidomiListener = {\n listeners: new Map(),\n eventEmitter: new NativeEventEmitter(RNDidomi),\n\n init: () => {\n // Register all native event listeners\n Object.values(DidomiEventType).forEach((eventTypeValue) => {\n // Remove previous listeners, as init() can be called several times in some configs\n DidomiListener.eventEmitter.removeAllListeners(eventTypeValue);\n DidomiListener.eventEmitter.addListener(eventTypeValue, (_event: any) => {\n let events = DidomiListener.listeners.get(eventTypeValue);\n if (events) {\n events.forEach((el: any) => {\n el(_event);\n });\n }\n });\n });\n },\n\n reset: () => {\n // Reset listeners\n DidomiListener.listeners = new Map();\n },\n\n addEventListener: (\n eventType: DidomiEventType,\n callback: (data: any) => void\n ) => {\n let events = DidomiListener.listeners.get(eventType);\n if (!events) {\n events = [];\n DidomiListener.listeners.set(eventType, events);\n }\n events.push(callback);\n },\n\n removeEventListener: (\n eventType: DidomiEventType,\n callback: (data: any) => void\n ) => {\n let events = DidomiListener.listeners.get(eventType);\n if (events) {\n var index = events.indexOf(callback);\n if (index !== -1) {\n events.splice(index, 1);\n }\n }\n },\n\n onReady: (): Promise<void> => {\n return new Promise<void>((resolve) => {\n const listener = (_event: any) => {\n resolve();\n DidomiListener.eventEmitter.removeListener(\n InternalEventType.READY_CALLBACK,\n listener\n );\n };\n DidomiListener.eventEmitter.addListener(\n InternalEventType.READY_CALLBACK,\n listener\n );\n });\n },\n\n onError: (): Promise<any> => {\n return new Promise<any>((resolve) => {\n const listener = (_event: any) => {\n resolve(_event);\n DidomiListener.eventEmitter.removeListener(\n InternalEventType.ERROR_CALLBACK,\n listener\n );\n };\n DidomiListener.eventEmitter.addListener(\n InternalEventType.ERROR_CALLBACK,\n listener\n );\n });\n },\n};\n"]}
@@ -39,5 +39,8 @@ exports.DidomiEventType = DidomiEventType;
39
39
  DidomiEventType["PREFERENCES_CLICK_DISAGREE_TO_ALL_PURPOSES"] = "on_preferences_click_disagree_to_all_purposes";
40
40
  DidomiEventType["PREFERENCES_CLICK_RESET_ALL_PURPOSES"] = "on_preferences_click_reset_all_purposes";
41
41
  DidomiEventType["SYNC_DONE"] = "on_sync_done";
42
+ DidomiEventType["SYNC_ERROR"] = "on_sync_error";
43
+ DidomiEventType["LANGUAGE_UPDATED"] = "on_language_updated";
44
+ DidomiEventType["LANGUAGE_UPDATE_FAILED"] = "on_language_update_failed";
42
45
  })(DidomiEventType || (exports.DidomiEventType = DidomiEventType = {}));
43
46
  //# sourceMappingURL=DidomiTypes.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["DidomiTypes.ts"],"names":["DidomiEventType"],"mappings":";;;;;;AAAA;IACYA,e;;;WAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;GAAAA,e,+BAAAA,e","sourcesContent":["// TODO\nexport enum DidomiEventType {\n READY = 'on_ready',\n ERROR = 'on_error',\n CONSENT_CHANGED = 'on_consent_changed',\n HIDE_NOTICE = 'on_hide_notice',\n SHOW_NOTICE = 'on_show_notice',\n NOTICE_CLICK_AGREE = 'on_notice_click_agree',\n NOTICE_CLICK_DISAGREE = 'on_notice_click_disagree',\n NOTICE_CLICK_MORE_INFO = 'on_notice_click_more_info',\n NOTICE_CLICK_VIEW_VENDORS = 'on_notice_click_view_vendors',\n NOTICE_CLICK_PRIVACY_POLICY = 'on_notice_click_privacy_policy',\n HIDE_PREFERENCES = 'on_hide_preferences',\n SHOW_PREFERENCES = 'on_show_preferences',\n PREFERENCES_CLICK_AGREE_TO_ALL = 'on_preferences_click_agree_to_all',\n PREFERENCES_CLICK_DISAGREE_TO_ALL = 'on_preferences_click_disagree_to_all',\n PREFERENCES_CLICK_PURPOSE_AGREE = 'on_preferences_click_purpose_agree',\n PREFERENCES_CLICK_PURPOSE_DISAGREE = 'on_preferences_click_purpose_disagree',\n PREFERENCES_CLICK_VIEW_VENDORS = 'on_preferences_click_view_vendors',\n PREFERENCES_CLICK_SAVE_CHOICES = 'on_preferences_click_save_choices',\n PREFERENCES_CLICK_VENDOR_AGREE = 'on_preferences_click_vendor_agree',\n PREFERENCES_CLICK_VENDOR_DISAGREE = 'on_preferences_click_vendor_disagree',\n PREFERENCES_CLICK_CATEGORY_AGREE = 'on_preferences_click_category_agree',\n PREFERENCES_CLICK_CATEGORY_DISAGREE = 'on_preferences_click_category_disagree',\n PREFERENCES_CLICK_AGREE_TO_ALL_VENDORS = 'on_preferences_click_agree_to_all_vendors',\n PREFERENCES_CLICK_DISAGREE_TO_ALL_VENDORS = 'on_preferences_click_disagree_to_all_vendors',\n PREFERENCES_CLICK_VENDOR_SAVE_CHOICES = 'on_preferences_click_vendor_save_choices',\n PREFERENCES_CLICK_VIEW_PURPOSES = 'on_preferences_click_view_purposes',\n PREFERENCES_CLICK_AGREE_TO_ALL_PURPOSES = 'on_preferences_click_agree_to_all_purposes',\n PREFERENCES_CLICK_DISAGREE_TO_ALL_PURPOSES = 'on_preferences_click_disagree_to_all_purposes',\n PREFERENCES_CLICK_RESET_ALL_PURPOSES = 'on_preferences_click_reset_all_purposes',\n SYNC_DONE = 'on_sync_done',\n}\n\nexport interface Vendor {\n id: string;\n name: string;\n privacyPolicyUrl: string;\n namespace: string;\n namespaces: VendorNamespaces;\n iabVendor: boolean;\n purposeId: string[];\n legIntPurposeIds: string[];\n essentialPurposeIds: string[];\n}\n\nexport interface VendorNamespaces {\n iab2: string;\n}\n\nexport interface Purpose {\n id: string;\n iAbId: string;\n name: string;\n description: string;\n descriptionLegal: string;\n custom: boolean;\n essential: boolean;\n specialFeature: boolean;\n legitimateInterest: boolean;\n consent: boolean;\n category: PurposeCategory;\n}\n\nexport interface PurposeCategory {\n id: string;\n idpurposeId: string;\n icon: string;\n type: string;\n name: Map<string>;\n namedescription: Map<string>;\n children: PurposeCategory[];\n}\n\nexport interface Map<T> {\n [index: string]: T;\n [index: number]: T;\n}\n\nexport interface UserStatus {\n purposes: UserStatusPurposes;\n vendors: UserStatusVendors;\n userId: string;\n created: string;\n updated: string;\n consentString: string;\n additionalConsent: string;\n}\n\nexport interface UserStatusPurposes {\n global: UserStatusIds;\n consent: UserStatusIds;\n legitimateInterest: UserStatusIds;\n essential: UserStatusIds;\n}\n\nexport interface UserStatusVendors {\n global: UserStatusIds;\n globalConsent: UserStatusIds;\n globalLegitimateInterest: UserStatusIds;\n consent: UserStatusIds;\n legitimateInterest: UserStatusIds;\n}\n\nexport interface UserStatusIds {\n disabled: string[];\n enabled: string[];\n}\n"]}
1
+ {"version":3,"sources":["DidomiTypes.ts"],"names":["DidomiEventType"],"mappings":";;;;;;AAAA;IACYA,e;;;WAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;GAAAA,e,+BAAAA,e","sourcesContent":["// TODO\nexport enum DidomiEventType {\n READY = 'on_ready',\n ERROR = 'on_error',\n CONSENT_CHANGED = 'on_consent_changed',\n HIDE_NOTICE = 'on_hide_notice',\n SHOW_NOTICE = 'on_show_notice',\n NOTICE_CLICK_AGREE = 'on_notice_click_agree',\n NOTICE_CLICK_DISAGREE = 'on_notice_click_disagree',\n NOTICE_CLICK_MORE_INFO = 'on_notice_click_more_info',\n NOTICE_CLICK_VIEW_VENDORS = 'on_notice_click_view_vendors',\n NOTICE_CLICK_PRIVACY_POLICY = 'on_notice_click_privacy_policy',\n HIDE_PREFERENCES = 'on_hide_preferences',\n SHOW_PREFERENCES = 'on_show_preferences',\n PREFERENCES_CLICK_AGREE_TO_ALL = 'on_preferences_click_agree_to_all',\n PREFERENCES_CLICK_DISAGREE_TO_ALL = 'on_preferences_click_disagree_to_all',\n PREFERENCES_CLICK_PURPOSE_AGREE = 'on_preferences_click_purpose_agree',\n PREFERENCES_CLICK_PURPOSE_DISAGREE = 'on_preferences_click_purpose_disagree',\n PREFERENCES_CLICK_VIEW_VENDORS = 'on_preferences_click_view_vendors',\n PREFERENCES_CLICK_SAVE_CHOICES = 'on_preferences_click_save_choices',\n PREFERENCES_CLICK_VENDOR_AGREE = 'on_preferences_click_vendor_agree',\n PREFERENCES_CLICK_VENDOR_DISAGREE = 'on_preferences_click_vendor_disagree',\n PREFERENCES_CLICK_CATEGORY_AGREE = 'on_preferences_click_category_agree',\n PREFERENCES_CLICK_CATEGORY_DISAGREE = 'on_preferences_click_category_disagree',\n PREFERENCES_CLICK_AGREE_TO_ALL_VENDORS = 'on_preferences_click_agree_to_all_vendors',\n PREFERENCES_CLICK_DISAGREE_TO_ALL_VENDORS = 'on_preferences_click_disagree_to_all_vendors',\n PREFERENCES_CLICK_VENDOR_SAVE_CHOICES = 'on_preferences_click_vendor_save_choices',\n PREFERENCES_CLICK_VIEW_PURPOSES = 'on_preferences_click_view_purposes',\n PREFERENCES_CLICK_AGREE_TO_ALL_PURPOSES = 'on_preferences_click_agree_to_all_purposes',\n PREFERENCES_CLICK_DISAGREE_TO_ALL_PURPOSES = 'on_preferences_click_disagree_to_all_purposes',\n PREFERENCES_CLICK_RESET_ALL_PURPOSES = 'on_preferences_click_reset_all_purposes',\n SYNC_DONE = 'on_sync_done',\n SYNC_ERROR = 'on_sync_error',\n LANGUAGE_UPDATED = \"on_language_updated\",\n LANGUAGE_UPDATE_FAILED = \"on_language_update_failed\",\n}\n\nexport interface Vendor {\n id: string;\n name: string;\n privacyPolicyUrl: string;\n namespace: string;\n namespaces: VendorNamespaces;\n iabVendor: boolean;\n purposeId: string[];\n legIntPurposeIds: string[];\n essentialPurposeIds: string[];\n}\n\nexport interface VendorNamespaces {\n iab2: string;\n}\n\nexport interface Purpose {\n id: string;\n iabId: string;\n name: string;\n description: string;\n descriptionLegal: string;\n custom: boolean;\n essential: boolean;\n specialFeature: boolean;\n legitimateInterest: boolean;\n consent: boolean;\n category: PurposeCategory;\n}\n\nexport interface PurposeCategory {\n id: string;\n idpurposeId: string;\n icon: string;\n type: string;\n name: Map<string>;\n namedescription: Map<string>;\n children: PurposeCategory[];\n}\n\nexport interface Map<T> {\n [index: string]: T;\n [index: number]: T;\n}\n\nexport interface UserStatus {\n purposes: UserStatusPurposes;\n vendors: UserStatusVendors;\n userId: string;\n created: string;\n updated: string;\n consentString: string;\n additionalConsent: string;\n regulation: string;\n}\n\nexport interface UserStatusPurposes {\n global: UserStatusIds;\n consent: UserStatusIds;\n legitimateInterest: UserStatusIds;\n essential: UserStatusIds;\n}\n\nexport interface UserStatusVendors {\n global: UserStatusIds;\n globalConsent: UserStatusIds;\n globalLegitimateInterest: UserStatusIds;\n consent: UserStatusIds;\n legitimateInterest: UserStatusIds;\n}\n\nexport interface UserStatusIds {\n disabled: string[];\n enabled: string[];\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  // User agent name
2
2
  export const DIDOMI_USER_AGENT_NAME = "Didomi React-Native SDK"; // User agent version
3
3
 
4
- export const DIDOMI_VERSION = "1.5.0";
4
+ export const DIDOMI_VERSION = "1.8.0";
5
5
  //# sourceMappingURL=Constants.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["Constants.ts"],"names":["DIDOMI_USER_AGENT_NAME","DIDOMI_VERSION"],"mappings":"AAAA;AACA,OAAO,MAAMA,sBAAsB,GAAG,yBAA/B,C,CACP;;AACA,OAAO,MAAMC,cAAc,GAAG,OAAvB","sourcesContent":["// User agent name\nexport const DIDOMI_USER_AGENT_NAME = \"Didomi React-Native SDK\"\n// User agent version\nexport const DIDOMI_VERSION = \"1.5.0\"\n"]}
1
+ {"version":3,"sources":["Constants.ts"],"names":["DIDOMI_USER_AGENT_NAME","DIDOMI_VERSION"],"mappings":"AAAA;AACA,OAAO,MAAMA,sBAAsB,GAAG,yBAA/B,C,CACP;;AACA,OAAO,MAAMC,cAAc,GAAG,OAAvB","sourcesContent":["// User agent name\nexport const DIDOMI_USER_AGENT_NAME = \"Didomi React-Native SDK\"\n// User agent version\nexport const DIDOMI_VERSION = \"1.8.0\"\n"]}
@@ -20,7 +20,7 @@ export const Didomi = {
20
20
  // Init listener
21
21
  DidomiListener.init(); // Trigger native SDK init
22
22
 
23
- RNDidomi.initialize(DIDOMI_USER_AGENT_NAME, DIDOMI_VERSION, apiKey, localConfigurationPath, remoteConfigurationUrl, providerId, disableDidomiRemoteConfig, languageCode, noticeId);
23
+ return RNDidomi.initialize(DIDOMI_USER_AGENT_NAME, DIDOMI_VERSION, apiKey, localConfigurationPath, remoteConfigurationUrl, providerId, disableDidomiRemoteConfig, languageCode, noticeId);
24
24
  },
25
25
 
26
26
  /**
@@ -83,48 +83,64 @@ export const Didomi = {
83
83
  /**
84
84
  * Method used to get an array of disabled purposes.
85
85
  * @returns: array of disabled purposes.
86
+ * @deprecated use {@link #getUserStatus()} instead. The result of this method
87
+ * has been replaced by getUserStatus().getPurposes().getConsent().getDisabled().
86
88
  */
87
89
  getDisabledPurposes: () => RNDidomi.getDisabledPurposes(),
88
90
 
89
91
  /**
90
92
  * Method used to get a set of disabled purpose IDs.
91
93
  * @returns: set that contains the IDs of disabled purposes.
94
+ * @deprecated use {@link #getUserStatus()} instead. The result of this method
95
+ * has been replaced by getUserStatus().getPurposes().getConsent().getDisabled().
92
96
  */
93
97
  getDisabledPurposeIds: () => RNDidomi.getDisabledPurposeIds(),
94
98
 
95
99
  /**
96
100
  * Method used to get an array of disabled vendors.
97
101
  * @returns: array of disabled vendors.
102
+ * @deprecated use {@link #getUserStatus()} instead. The result of this method
103
+ * has been replaced by getUserStatus().getVendors().getConsent().getDisabled().
98
104
  */
99
105
  getDisabledVendors: () => RNDidomi.getDisabledVendors(),
100
106
 
101
107
  /**
102
108
  * Method used to get a set of disabled vendor IDs.
103
109
  * @returns: set that contains the IDs of disabled vendors.
110
+ * @deprecated use {@link #getUserStatus()} instead. The result of this method
111
+ * has been replaced by getUserStatus().getVendors().getConsent().getDisabled().
104
112
  */
105
113
  getDisabledVendorIds: () => RNDidomi.getDisabledVendorIds(),
106
114
 
107
115
  /**
108
116
  * Method used to get an array of enabled purposes.
109
117
  * @returns: array of enabled purposes.
118
+ * @deprecated use {@link #getUserStatus()} instead. The result of this method
119
+ * has been replaced by getUserStatus().getPurposes().getConsent().getEnabled().
110
120
  */
111
121
  getEnabledPurposes: () => RNDidomi.getEnabledPurposes(),
112
122
 
113
123
  /**
114
124
  * Method used to get a set of enabled purpose IDs.
115
125
  * @returns: set that contains the IDs of enabled purposes.
126
+ * @deprecated use {@link #getUserStatus()} instead. The result of this method
127
+ * has been replaced by getUserStatus().getPurposes().getConsent().getEnabled().
116
128
  */
117
129
  getEnabledPurposeIds: () => RNDidomi.getEnabledPurposeIds(),
118
130
 
119
131
  /**
120
132
  * Method used to get an array of enabled vendors.
121
133
  * @returns: array of enabled vendors.
134
+ * @deprecated use {@link #getUserStatus()} instead. The result of this method
135
+ * has been replaced by getUserStatus().getVendors().getConsent().getEnabled().
122
136
  */
123
137
  getEnabledVendors: () => RNDidomi.getEnabledVendors(),
124
138
 
125
139
  /**
126
140
  * Method used to get a set of enabled vendor IDs.
127
141
  * @returns: set that contains the IDs of enabled vendors.
142
+ * @deprecated use {@link #getUserStatus()} instead. The result of this method
143
+ * has been replaced by getUserStatus().getVendors().getConsent().getEnabled().
128
144
  */
129
145
  getEnabledVendorIds: () => RNDidomi.getEnabledVendorIds(),
130
146
 
@@ -328,15 +344,97 @@ export const Didomi = {
328
344
  isReady: () => RNDidomi.isReady(),
329
345
 
330
346
  /**
331
- * Set user information with authentication
347
+ * Clear user information
348
+ */
349
+ clearUser: () => RNDidomi.clearUser(),
350
+
351
+ /**
352
+ * Set user information without authentication
353
+ *
354
+ * @param id Organization user ID
355
+ * @param algorithm Deprecated. To set user with authentication, use setUserWithHashAuth or setUserWithEncryptionAuth.
356
+ * @param secretId Deprecated. To set user with authentication, use setUserWithHashAuth or setUserWithEncryptionAuth.
357
+ * @param salt Deprecated. To set user with authentication, use setUserWithHashAuth or setUserWithEncryptionAuth.
358
+ * @param digest Deprecated. To set user with authentication, use setUserWithHashAuth or setUserWithEncryptionAuth.
359
+ */
360
+ setUser: (id, algorithm, secretId, salt, digest) => RNDidomi.setUser(id, algorithm, secretId, salt, digest),
361
+
362
+ /**
363
+ * Set user information without authentication and check for missing consent
364
+ *
365
+ * @param id Organization user ID
366
+ */
367
+ setUserAndSetupUI: id => RNDidomi.setUserAndSetupUI(id),
368
+
369
+ /**
370
+ * Set user information with Hash authentication
332
371
  *
333
372
  * @param id Organization user ID
334
373
  * @param algorithm Algorithm used for computing the digest
335
374
  * @param secretId ID of the secret used for computing the digest
375
+ * @param digest Digest of the organization user ID and secret
336
376
  * @param salt Salt used for computing the digest (optional)
377
+ * @param expiration Expiration date as timestamp (to prevent replay attacks)
378
+ */
379
+ setUserWithHashAuth: (id, algorithm, secretId, digest, salt, expiration) => {
380
+ if (expiration === undefined) {
381
+ RNDidomi.setUserWithHashAuth(id, algorithm, secretId, digest, salt);
382
+ } else {
383
+ RNDidomi.setUserWithHashAuthWithExpiration(id, algorithm, secretId, digest, salt, expiration);
384
+ }
385
+ },
386
+
387
+ /**
388
+ * Set user information with Hash authentication and check for missing consent
389
+ *
390
+ * @param id Organization user ID
391
+ * @param algorithm Algorithm used for computing the digest
392
+ * @param secretId ID of the secret used for computing the digest
337
393
  * @param digest Digest of the organization user ID and secret
338
- */
339
- setUser: (organizationUserId, organizationUserIdAuthAlgorithm, organizationUserIdAuthSid, organizationUserIdAuthSalt, organizationUserIdAuthDigest) => RNDidomi.setUser(organizationUserId, organizationUserIdAuthAlgorithm, organizationUserIdAuthSid, organizationUserIdAuthSalt, organizationUserIdAuthDigest),
394
+ * @param salt Salt used for computing the digest (optional)
395
+ * @param expiration Expiration date as timestamp (to prevent replay attacks)
396
+ */
397
+ setUserWithHashAuthAndSetupUI: (id, algorithm, secretId, digest, salt, expiration) => {
398
+ if (expiration === undefined) {
399
+ RNDidomi.setUserWithHashAuthAndSetupUI(id, algorithm, secretId, digest, salt);
400
+ } else {
401
+ RNDidomi.setUserWithHashAuthWithExpirationAndSetupUI(id, algorithm, secretId, digest, salt, expiration);
402
+ }
403
+ },
404
+
405
+ /**
406
+ * Set user information with Encryption authentication
407
+ *
408
+ * @param id Organization user ID
409
+ * @param algorithm Algorithm used for computing the digest
410
+ * @param secretId ID of the secret used for computing the digest
411
+ * @param initializationVector Initialization Vector used for computing the user ID
412
+ * @param expiration Expiration date as timestamp (to prevent replay attacks)
413
+ */
414
+ setUserWithEncryptionAuth: (id, algorithm, secretId, initializationVector, expiration) => {
415
+ if (expiration === undefined) {
416
+ RNDidomi.setUserWithEncryptionAuth(id, algorithm, secretId, initializationVector);
417
+ } else {
418
+ RNDidomi.setUserWithEncryptionAuthWithExpiration(id, algorithm, secretId, initializationVector, expiration);
419
+ }
420
+ },
421
+
422
+ /**
423
+ * Set user information with Encryption authentication and check for missing consent
424
+ *
425
+ * @param id Organization user ID
426
+ * @param algorithm Algorithm used for computing the digest
427
+ * @param secretId ID of the secret used for computing the digest
428
+ * @param initializationVector Initialization Vector used for computing the user ID
429
+ * @param expiration Expiration date as timestamp (to prevent replay attacks)
430
+ */
431
+ setUserWithEncryptionAuthAndSetupUI: (id, algorithm, secretId, initializationVector, expiration) => {
432
+ if (expiration === undefined) {
433
+ RNDidomi.setUserWithEncryptionAuthAndSetupUI(id, algorithm, secretId, initializationVector);
434
+ } else {
435
+ RNDidomi.setUserWithEncryptionAuthWithExpirationAndSetupUI(id, algorithm, secretId, initializationVector, expiration);
436
+ }
437
+ },
340
438
 
341
439
  /**
342
440
  * Show the consent notice (if required, not disabled in the config and not already displayed)