@didomi/react-native 1.1.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/android/build.gradle +6 -2
- package/android/src/main/AndroidManifest.xml +1 -3
- package/android/src/main/java/com/reactnativedidomi/DidomiModule.kt +52 -21
- package/android/src/main/java/com/reactnativedidomi/EventTypes.kt +2 -0
- package/ios/Didomi.m +7 -11
- package/ios/RNDidomi.swift +46 -22
- package/lib/commonjs/Constants.js +13 -0
- package/lib/commonjs/Constants.js.map +1 -0
- package/lib/commonjs/Didomi.js +35 -6
- package/lib/commonjs/Didomi.js.map +1 -1
- package/lib/commonjs/DidomiTypes.js +2 -0
- package/lib/commonjs/DidomiTypes.js.map +1 -1
- package/lib/module/Constants.js +5 -0
- package/lib/module/Constants.js.map +1 -0
- package/lib/module/Didomi.js +34 -6
- package/lib/module/Didomi.js.map +1 -1
- package/lib/module/DidomiTypes.js +2 -0
- package/lib/module/DidomiTypes.js.map +1 -1
- package/lib/typescript/Constants.d.ts +2 -0
- package/lib/typescript/Didomi.d.ts +31 -5
- package/lib/typescript/DidomiTypes.d.ts +28 -0
- package/package.json +2 -2
- package/react-native-didomi.podspec +1 -1
- package/src/Constants.ts +4 -0
- package/src/Didomi.ts +47 -38
- package/src/DidomiTypes.ts +32 -0
|
@@ -19,6 +19,8 @@ exports.DidomiEventType = DidomiEventType;
|
|
|
19
19
|
DidomiEventType["NOTICE_CLICK_MORE_INFO"] = "on_notice_click_more_info";
|
|
20
20
|
DidomiEventType["NOTICE_CLICK_VIEW_VENDORS"] = "on_notice_click_view_vendors";
|
|
21
21
|
DidomiEventType["NOTICE_CLICK_PRIVACY_POLICY"] = "on_notice_click_privacy_policy";
|
|
22
|
+
DidomiEventType["HIDE_PREFERENCES"] = "on_hide_preferences";
|
|
23
|
+
DidomiEventType["SHOW_PREFERENCES"] = "on_show_preferences";
|
|
22
24
|
DidomiEventType["PREFERENCES_CLICK_AGREE_TO_ALL"] = "on_preferences_click_agree_to_all";
|
|
23
25
|
DidomiEventType["PREFERENCES_CLICK_DISAGREE_TO_ALL"] = "on_preferences_click_disagree_to_all";
|
|
24
26
|
DidomiEventType["PREFERENCES_CLICK_PURPOSE_AGREE"] = "on_preferences_click_purpose_agree";
|
|
@@ -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;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 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"]}
|
|
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"]}
|
|
@@ -0,0 +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"]}
|
package/lib/module/Didomi.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { NativeModules } from 'react-native';
|
|
2
2
|
import { DidomiListener } from './DidomiListener';
|
|
3
|
+
import { DIDOMI_USER_AGENT_NAME, DIDOMI_VERSION } from './Constants';
|
|
3
4
|
const {
|
|
4
5
|
Didomi: RNDidomi
|
|
5
6
|
} = NativeModules;
|
|
@@ -19,22 +20,22 @@ export const Didomi = {
|
|
|
19
20
|
// Init listener
|
|
20
21
|
DidomiListener.init(); // Trigger native SDK init
|
|
21
22
|
|
|
22
|
-
RNDidomi.initialize(apiKey, localConfigurationPath, remoteConfigurationUrl, providerId, disableDidomiRemoteConfig, languageCode, noticeId);
|
|
23
|
+
RNDidomi.initialize(DIDOMI_USER_AGENT_NAME, DIDOMI_VERSION, apiKey, localConfigurationPath, remoteConfigurationUrl, providerId, disableDidomiRemoteConfig, languageCode, noticeId);
|
|
23
24
|
},
|
|
24
25
|
|
|
25
26
|
/**
|
|
26
27
|
* Listen to SDK ready state
|
|
27
|
-
|
|
28
|
+
*/
|
|
28
29
|
onReady: () => DidomiListener.onReady(),
|
|
29
30
|
|
|
30
31
|
/**
|
|
31
32
|
* Listen to SDK errors
|
|
32
|
-
|
|
33
|
+
*/
|
|
33
34
|
onError: () => DidomiListener.onError(),
|
|
34
35
|
|
|
35
36
|
/**
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
* Provide the objects required to display UI elements
|
|
38
|
+
*/
|
|
38
39
|
setupUI: () => RNDidomi.setupUI(),
|
|
39
40
|
|
|
40
41
|
/**
|
|
@@ -134,7 +135,7 @@ export const Didomi = {
|
|
|
134
135
|
* @param extra: Extra JavaScript to inject in the returned code
|
|
135
136
|
* @returns: JavaScript code to inject in a WebView
|
|
136
137
|
*/
|
|
137
|
-
getJavaScriptForWebView:
|
|
138
|
+
getJavaScriptForWebView: extra => RNDidomi.getJavaScriptForWebView(extra),
|
|
138
139
|
getQueryStringForWebView: () => RNDidomi.getQueryStringForWebView(),
|
|
139
140
|
|
|
140
141
|
/**
|
|
@@ -204,6 +205,9 @@ export const Didomi = {
|
|
|
204
205
|
* Get the user consent status for a specific purpose
|
|
205
206
|
* @param purposeId: The purpose ID to check consent for
|
|
206
207
|
* @returns: The user consent status for the specified purpose
|
|
208
|
+
* @deprecated use {@link #getUserStatus()} instead. Search the purposeId in
|
|
209
|
+
* getUserStatus().getPurposes().getConsent().getEnabled() or
|
|
210
|
+
* getUserStatus().getPurposes().getConsent().getDisabled().
|
|
207
211
|
*/
|
|
208
212
|
getUserConsentStatusForPurpose: purposeId => RNDidomi.getUserConsentStatusForPurpose(purposeId),
|
|
209
213
|
|
|
@@ -211,6 +215,9 @@ export const Didomi = {
|
|
|
211
215
|
* Get the user consent status for a specific vendor
|
|
212
216
|
* @param vendorId: The vendor ID to check consent for
|
|
213
217
|
* @returns: The user consent status for the specified vendor
|
|
218
|
+
* @deprecated use {@link #getUserStatus()} instead. Search the vendorId in
|
|
219
|
+
* getUserStatus().getVendors().getConsent().getEnabled() or
|
|
220
|
+
* getUserStatus().getVendors().getConsent().getDisabled().
|
|
214
221
|
*/
|
|
215
222
|
getUserConsentStatusForVendor: vendorId => RNDidomi.getUserConsentStatusForVendor(vendorId),
|
|
216
223
|
|
|
@@ -218,6 +225,9 @@ export const Didomi = {
|
|
|
218
225
|
* Get the user consent status for a specific vendor and all its purposes
|
|
219
226
|
* @param vendorId: The ID of the vendor
|
|
220
227
|
* @returns: The user consent status corresponding to the specified vendor and all its required purposes.
|
|
228
|
+
* @deprecated use {@link #getUserStatus()} instead. The result of this method has been replaced
|
|
229
|
+
* by getUserStatus().getVendors().getGlobalConsent().getEnabled() or
|
|
230
|
+
* getUserStatus().getVendors().getGlobalConsent().getDisabled().
|
|
221
231
|
*/
|
|
222
232
|
getUserConsentStatusForVendorAndRequiredPurposes: vendorId => RNDidomi.getUserConsentStatusForVendorAndRequiredPurposes(vendorId),
|
|
223
233
|
|
|
@@ -225,6 +235,9 @@ export const Didomi = {
|
|
|
225
235
|
* Get the user legitimate interest status for a specific purpose.
|
|
226
236
|
* @param purposeId: purpose ID.
|
|
227
237
|
* @returns: LI status of a purpose.
|
|
238
|
+
* @deprecated use {@link #getUserStatus()} instead. Search the purposeId in
|
|
239
|
+
* getUserStatus().getPurposes().getLegitimateInterest().getEnabled() or
|
|
240
|
+
* getUserStatus().getPurposes().getLegitimateInterest().getDisabled().
|
|
228
241
|
*/
|
|
229
242
|
getUserLegitimateInterestStatusForPurpose: purposeId => RNDidomi.getUserLegitimateInterestStatusForPurpose(purposeId),
|
|
230
243
|
|
|
@@ -232,6 +245,9 @@ export const Didomi = {
|
|
|
232
245
|
* Get the user legitimate interest status for a specific vendor.
|
|
233
246
|
* @param vendorId: vendor ID.
|
|
234
247
|
* @returns: LI status of a vendor.
|
|
248
|
+
* @deprecated use {@link #getUserStatus()} instead. Search the vendorId in
|
|
249
|
+
* getUserStatus().getVendors().getLegitimateInterest().getEnabled() or
|
|
250
|
+
* getUserStatus().getVendors().getLegitimateInterest().getDisabled().
|
|
235
251
|
*/
|
|
236
252
|
getUserLegitimateInterestForVendor: vendorId => RNDidomi.getUserLegitimateInterestStatusForVendor(vendorId),
|
|
237
253
|
|
|
@@ -239,13 +255,25 @@ export const Didomi = {
|
|
|
239
255
|
* Get the user LI status for a specific vendor and all its purposes.
|
|
240
256
|
* @param vendorId: vendor ID.
|
|
241
257
|
* @returns: The user LI status corresponding to the specified vendor and all its required purposes.
|
|
258
|
+
* @deprecated use {@link #getUserStatus()} instead. Search the purposeId in
|
|
259
|
+
* getUserStatus().getVendors().getGlobalLegitimateInterest().getEnabled() or
|
|
260
|
+
* getUserStatus().getVendors().getGlobalLegitimateInterest().getDisabled().
|
|
242
261
|
*/
|
|
243
262
|
getUserLegitimateInterestStatusForVendorAndRequiredPurposes: vendorId => RNDidomi.getUserLegitimateInterestStatusForVendorAndRequiredPurposes(vendorId),
|
|
244
263
|
|
|
264
|
+
/**
|
|
265
|
+
* Get the user consent status.
|
|
266
|
+
* @returns: status that represents user consent.
|
|
267
|
+
*/
|
|
268
|
+
getUserStatus: () => RNDidomi.getUserStatus(),
|
|
269
|
+
|
|
245
270
|
/**
|
|
246
271
|
* Get the user consent and legitimate interest status for a specific vendor.
|
|
247
272
|
* @param vendorId: vendor ID.
|
|
248
273
|
* @returns: status that represents both consent and legitimate interest status of a vendor.
|
|
274
|
+
* @deprecated use {@link #getUserStatus()} instead. Search the vendorId in
|
|
275
|
+
* getUserStatus().getVendors().getGlobal().getEnabled() or
|
|
276
|
+
* getUserStatus().getVendors().getGlobal().getDisabled().
|
|
249
277
|
*/
|
|
250
278
|
getUserStatusForVendor: vendorId => RNDidomi.getUserStatusForVendor(vendorId),
|
|
251
279
|
|
package/lib/module/Didomi.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Didomi.ts"],"names":["NativeModules","DidomiListener","Didomi","RNDidomi","initialize","apiKey","localConfigurationPath","remoteConfigurationUrl","providerId","disableDidomiRemoteConfig","languageCode","noticeId","init","onReady","onError","setupUI","setLogLevel","level","addEventListener","eventType","callback","removeEventListener","removeAllEventListeners","reset","getDisabledPurposes","getDisabledPurposeIds","getDisabledVendors","getDisabledVendorIds","getEnabledPurposes","getEnabledPurposeIds","getEnabledVendors","getEnabledVendorIds","getJavaScriptForWebView","getQueryStringForWebView","getPurpose","purposeId","getRequiredPurposes","getRequiredPurposeIds","getRequiredVendors","getRequiredVendorIds","getText","key","getTranslatedText","getUserConsentStatusForPurpose","getUserConsentStatusForVendor","vendorId","getUserConsentStatusForVendorAndRequiredPurposes","getUserLegitimateInterestStatusForPurpose","getUserLegitimateInterestForVendor","getUserLegitimateInterestStatusForVendor","getUserLegitimateInterestStatusForVendorAndRequiredPurposes","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","updateSelectedLan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,oBAJF,EAKEC,uBALF,EAMEC,wBANF,EAOEC,kBAPF,EAQEC,mBARF,CAzckB;;AAodpB;AACF;AACA;AACA;AACEC,EAAAA,wBAAwB,EAAE,MACxBxF,QAAQ,CAACwF,wBAAT,EAzdkB;;AA2dpB;AACF;AACA;AACA;AACA;AACA;AACEC,EAAAA,sBAAsB,EAAGlF,YAAD,IACtBP,QAAQ,CAACyF,sBAAT,CAAgClF,YAAhC;AAlekB,CAAf","sourcesContent":["import { NativeModules } from 'react-native';\nimport { DidomiListener } from './DidomiListener';\nimport { DidomiEventType } from './DidomiTypes';\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 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: (): Promise<string> =>\n RNDidomi.getJavaScriptForWebView(),\n\n getQueryStringForWebView: (): Promise<string> =>\n 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> =>\n 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> =>\n 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 */\n getUserConsentStatusForPurpose: (purposeId: string): Promise<boolean> =>\n 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 */\n getUserConsentStatusForVendor: (vendorId: string): Promise<boolean> =>\n 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 */\n getUserConsentStatusForVendorAndRequiredPurposes: (\n vendorId: string\n ): Promise<boolean> =>\n 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 */\n getUserLegitimateInterestStatusForPurpose: (\n purposeId: string\n ): Promise<boolean> =>\n 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 */\n getUserLegitimateInterestForVendor: (vendorId: string): Promise<boolean> =>\n 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 */\n getUserLegitimateInterestStatusForVendorAndRequiredPurposes: (\n vendorId: string\n ): boolean =>\n RNDidomi.getUserLegitimateInterestStatusForVendorAndRequiredPurposes(\n vendorId\n ),\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 */\n getUserStatusForVendor: (vendorId: string): Promise<boolean> =>\n 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> =>\n 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> =>\n 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":["NativeModules","DidomiListener","DIDOMI_USER_AGENT_NAME","DIDOMI_VERSION","Didomi","RNDidomi","initialize","apiKey","localConfigurationPath","remoteConfigurationUrl","providerId","disableDidomiRemoteConfig","languageCode","noticeId","init","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,SAASA,aAAT,QAA8B,cAA9B;AACA,SAASC,cAAT,QAA+B,kBAA/B;AAEA,SAASC,sBAAT,EAAiCC,cAAjC,QAAuD,aAAvD;AAEA,MAAM;AAAEC,EAAAA,MAAM,EAAEC;AAAV,IAAuBL,aAA7B;AAEA,OAAO,MAAMI,MAAM,GAAG;AACpB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACEE,EAAA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,EAIEC,oBAJF,EAKEC,uBALF,EAMEC,wBANF,EAOEC,kBAPF,EAQEC,mBARF,CAjdkB;;AA4dpB;AACF;AACA;AACA;AACEC,EAAAA,wBAAwB,EAAE,MACxB1F,QAAQ,CAAC0F,wBAAT,EAjekB;;AAmepB;AACF;AACA;AACA;AACA;AACA;AACEC,EAAAA,sBAAsB,EAAGpF,YAAD,IACtBP,QAAQ,CAAC2F,sBAAT,CAAgCpF,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"]}
|
|
@@ -12,6 +12,8 @@ export let DidomiEventType;
|
|
|
12
12
|
DidomiEventType["NOTICE_CLICK_MORE_INFO"] = "on_notice_click_more_info";
|
|
13
13
|
DidomiEventType["NOTICE_CLICK_VIEW_VENDORS"] = "on_notice_click_view_vendors";
|
|
14
14
|
DidomiEventType["NOTICE_CLICK_PRIVACY_POLICY"] = "on_notice_click_privacy_policy";
|
|
15
|
+
DidomiEventType["HIDE_PREFERENCES"] = "on_hide_preferences";
|
|
16
|
+
DidomiEventType["SHOW_PREFERENCES"] = "on_show_preferences";
|
|
15
17
|
DidomiEventType["PREFERENCES_CLICK_AGREE_TO_ALL"] = "on_preferences_click_agree_to_all";
|
|
16
18
|
DidomiEventType["PREFERENCES_CLICK_DISAGREE_TO_ALL"] = "on_preferences_click_disagree_to_all";
|
|
17
19
|
DidomiEventType["PREFERENCES_CLICK_PURPOSE_AGREE"] = "on_preferences_click_purpose_agree";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["DidomiTypes.ts"],"names":["DidomiEventType"],"mappings":"AAAA;AACA,WAAYA,eAAZ;;WAAYA,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,KAAAA,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 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"]}
|
|
1
|
+
{"version":3,"sources":["DidomiTypes.ts"],"names":["DidomiEventType"],"mappings":"AAAA;AACA,WAAYA,eAAZ;;WAAYA,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,KAAAA,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"]}
|
|
@@ -14,15 +14,15 @@ export declare const Didomi: {
|
|
|
14
14
|
initialize: (apiKey: string, localConfigurationPath?: string | undefined, remoteConfigurationUrl?: string | undefined, providerId?: string | undefined, disableDidomiRemoteConfig?: boolean, languageCode?: string | undefined, noticeId?: string | undefined) => void;
|
|
15
15
|
/**
|
|
16
16
|
* Listen to SDK ready state
|
|
17
|
-
|
|
17
|
+
*/
|
|
18
18
|
onReady: () => Promise<void>;
|
|
19
19
|
/**
|
|
20
20
|
* Listen to SDK errors
|
|
21
|
-
|
|
21
|
+
*/
|
|
22
22
|
onError: () => Promise<any>;
|
|
23
23
|
/**
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
* Provide the objects required to display UI elements
|
|
25
|
+
*/
|
|
26
26
|
setupUI: () => Promise<void>;
|
|
27
27
|
/**
|
|
28
28
|
* Set the minimum level of messages to log
|
|
@@ -109,7 +109,7 @@ export declare const Didomi: {
|
|
|
109
109
|
* @param extra: Extra JavaScript to inject in the returned code
|
|
110
110
|
* @returns: JavaScript code to inject in a WebView
|
|
111
111
|
*/
|
|
112
|
-
getJavaScriptForWebView: () => Promise<string>;
|
|
112
|
+
getJavaScriptForWebView: (extra?: string | null | undefined) => Promise<string>;
|
|
113
113
|
getQueryStringForWebView: () => Promise<string>;
|
|
114
114
|
/**
|
|
115
115
|
* Method used to get a Purpose based on its ID.
|
|
@@ -171,42 +171,68 @@ export declare const Didomi: {
|
|
|
171
171
|
* Get the user consent status for a specific purpose
|
|
172
172
|
* @param purposeId: The purpose ID to check consent for
|
|
173
173
|
* @returns: The user consent status for the specified purpose
|
|
174
|
+
* @deprecated use {@link #getUserStatus()} instead. Search the purposeId in
|
|
175
|
+
* getUserStatus().getPurposes().getConsent().getEnabled() or
|
|
176
|
+
* getUserStatus().getPurposes().getConsent().getDisabled().
|
|
174
177
|
*/
|
|
175
178
|
getUserConsentStatusForPurpose: (purposeId: string) => Promise<boolean>;
|
|
176
179
|
/**
|
|
177
180
|
* Get the user consent status for a specific vendor
|
|
178
181
|
* @param vendorId: The vendor ID to check consent for
|
|
179
182
|
* @returns: The user consent status for the specified vendor
|
|
183
|
+
* @deprecated use {@link #getUserStatus()} instead. Search the vendorId in
|
|
184
|
+
* getUserStatus().getVendors().getConsent().getEnabled() or
|
|
185
|
+
* getUserStatus().getVendors().getConsent().getDisabled().
|
|
180
186
|
*/
|
|
181
187
|
getUserConsentStatusForVendor: (vendorId: string) => Promise<boolean>;
|
|
182
188
|
/**
|
|
183
189
|
* Get the user consent status for a specific vendor and all its purposes
|
|
184
190
|
* @param vendorId: The ID of the vendor
|
|
185
191
|
* @returns: The user consent status corresponding to the specified vendor and all its required purposes.
|
|
192
|
+
* @deprecated use {@link #getUserStatus()} instead. The result of this method has been replaced
|
|
193
|
+
* by getUserStatus().getVendors().getGlobalConsent().getEnabled() or
|
|
194
|
+
* getUserStatus().getVendors().getGlobalConsent().getDisabled().
|
|
186
195
|
*/
|
|
187
196
|
getUserConsentStatusForVendorAndRequiredPurposes: (vendorId: string) => Promise<boolean>;
|
|
188
197
|
/**
|
|
189
198
|
* Get the user legitimate interest status for a specific purpose.
|
|
190
199
|
* @param purposeId: purpose ID.
|
|
191
200
|
* @returns: LI status of a purpose.
|
|
201
|
+
* @deprecated use {@link #getUserStatus()} instead. Search the purposeId in
|
|
202
|
+
* getUserStatus().getPurposes().getLegitimateInterest().getEnabled() or
|
|
203
|
+
* getUserStatus().getPurposes().getLegitimateInterest().getDisabled().
|
|
192
204
|
*/
|
|
193
205
|
getUserLegitimateInterestStatusForPurpose: (purposeId: string) => Promise<boolean>;
|
|
194
206
|
/**
|
|
195
207
|
* Get the user legitimate interest status for a specific vendor.
|
|
196
208
|
* @param vendorId: vendor ID.
|
|
197
209
|
* @returns: LI status of a vendor.
|
|
210
|
+
* @deprecated use {@link #getUserStatus()} instead. Search the vendorId in
|
|
211
|
+
* getUserStatus().getVendors().getLegitimateInterest().getEnabled() or
|
|
212
|
+
* getUserStatus().getVendors().getLegitimateInterest().getDisabled().
|
|
198
213
|
*/
|
|
199
214
|
getUserLegitimateInterestForVendor: (vendorId: string) => Promise<boolean>;
|
|
200
215
|
/**
|
|
201
216
|
* Get the user LI status for a specific vendor and all its purposes.
|
|
202
217
|
* @param vendorId: vendor ID.
|
|
203
218
|
* @returns: The user LI status corresponding to the specified vendor and all its required purposes.
|
|
219
|
+
* @deprecated use {@link #getUserStatus()} instead. Search the purposeId in
|
|
220
|
+
* getUserStatus().getVendors().getGlobalLegitimateInterest().getEnabled() or
|
|
221
|
+
* getUserStatus().getVendors().getGlobalLegitimateInterest().getDisabled().
|
|
204
222
|
*/
|
|
205
223
|
getUserLegitimateInterestStatusForVendorAndRequiredPurposes: (vendorId: string) => boolean;
|
|
224
|
+
/**
|
|
225
|
+
* Get the user consent status.
|
|
226
|
+
* @returns: status that represents user consent.
|
|
227
|
+
*/
|
|
228
|
+
getUserStatus: () => Promise<any>;
|
|
206
229
|
/**
|
|
207
230
|
* Get the user consent and legitimate interest status for a specific vendor.
|
|
208
231
|
* @param vendorId: vendor ID.
|
|
209
232
|
* @returns: status that represents both consent and legitimate interest status of a vendor.
|
|
233
|
+
* @deprecated use {@link #getUserStatus()} instead. Search the vendorId in
|
|
234
|
+
* getUserStatus().getVendors().getGlobal().getEnabled() or
|
|
235
|
+
* getUserStatus().getVendors().getGlobal().getDisabled().
|
|
210
236
|
*/
|
|
211
237
|
getUserStatusForVendor: (vendorId: string) => Promise<boolean>;
|
|
212
238
|
/**
|
|
@@ -9,6 +9,8 @@ export declare enum DidomiEventType {
|
|
|
9
9
|
NOTICE_CLICK_MORE_INFO = "on_notice_click_more_info",
|
|
10
10
|
NOTICE_CLICK_VIEW_VENDORS = "on_notice_click_view_vendors",
|
|
11
11
|
NOTICE_CLICK_PRIVACY_POLICY = "on_notice_click_privacy_policy",
|
|
12
|
+
HIDE_PREFERENCES = "on_hide_preferences",
|
|
13
|
+
SHOW_PREFERENCES = "on_show_preferences",
|
|
12
14
|
PREFERENCES_CLICK_AGREE_TO_ALL = "on_preferences_click_agree_to_all",
|
|
13
15
|
PREFERENCES_CLICK_DISAGREE_TO_ALL = "on_preferences_click_disagree_to_all",
|
|
14
16
|
PREFERENCES_CLICK_PURPOSE_AGREE = "on_preferences_click_purpose_agree",
|
|
@@ -68,3 +70,29 @@ export interface Map<T> {
|
|
|
68
70
|
[index: string]: T;
|
|
69
71
|
[index: number]: T;
|
|
70
72
|
}
|
|
73
|
+
export interface UserStatus {
|
|
74
|
+
purposes: UserStatusPurposes;
|
|
75
|
+
vendors: UserStatusVendors;
|
|
76
|
+
userId: string;
|
|
77
|
+
created: string;
|
|
78
|
+
updated: string;
|
|
79
|
+
consentString: string;
|
|
80
|
+
additionalConsent: string;
|
|
81
|
+
}
|
|
82
|
+
export interface UserStatusPurposes {
|
|
83
|
+
global: UserStatusIds;
|
|
84
|
+
consent: UserStatusIds;
|
|
85
|
+
legitimateInterest: UserStatusIds;
|
|
86
|
+
essential: UserStatusIds;
|
|
87
|
+
}
|
|
88
|
+
export interface UserStatusVendors {
|
|
89
|
+
global: UserStatusIds;
|
|
90
|
+
globalConsent: UserStatusIds;
|
|
91
|
+
globalLegitimateInterest: UserStatusIds;
|
|
92
|
+
consent: UserStatusIds;
|
|
93
|
+
legitimateInterest: UserStatusIds;
|
|
94
|
+
}
|
|
95
|
+
export interface UserStatusIds {
|
|
96
|
+
disabled: string[];
|
|
97
|
+
enabled: string[];
|
|
98
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@didomi/react-native",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "React Native
|
|
3
|
+
"version": "1.5.0",
|
|
4
|
+
"description": "Didomi React Native SDK",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
7
7
|
"types": "lib/typescript/index.d.ts",
|
package/src/Constants.ts
ADDED