@didomi/react-native 1.2.0 → 1.3.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 +3 -1
- package/android/src/main/java/com/reactnativedidomi/DidomiModule.kt +21 -2
- package/android/src/main/java/com/reactnativedidomi/EventTypes.kt +2 -0
- package/ios/Didomi.m +3 -0
- package/ios/RNDidomi.swift +22 -5
- package/lib/commonjs/Didomi.js +27 -0
- 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/Didomi.js +27 -0
- 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/Didomi.d.ts +26 -0
- package/lib/typescript/DidomiTypes.d.ts +28 -0
- package/package.json +1 -1
- package/react-native-didomi.podspec +1 -1
- package/src/Didomi.ts +27 -0
- package/src/DidomiTypes.ts +32 -0
package/README.md
CHANGED
|
@@ -54,7 +54,7 @@ Didomi.addEventListener(DidomiEventType.SHOW_NOTICE, () => {
|
|
|
54
54
|
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
For a complete overview of available methods and events, have a look at the [online documentation](https://developers.didomi.io/cmp/react-native).
|
|
57
|
+
For a complete overview of available methods and events, have a look at the [online documentation](https://developers.didomi.io/cmp/mobile-sdk/react-native).
|
|
58
58
|
|
|
59
59
|
## Configuration with local file
|
|
60
60
|
|
package/android/build.gradle
CHANGED
|
@@ -34,6 +34,8 @@ android {
|
|
|
34
34
|
versionCode 1
|
|
35
35
|
versionName "1.0"
|
|
36
36
|
|
|
37
|
+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
|
38
|
+
multiDexEnabled = true
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
buildTypes {
|
|
@@ -128,5 +130,5 @@ dependencies {
|
|
|
128
130
|
api "com.facebook.react:react-native:+"
|
|
129
131
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
130
132
|
|
|
131
|
-
implementation "io.didomi.sdk:android:1.
|
|
133
|
+
implementation "io.didomi.sdk:android:1.51.2"
|
|
132
134
|
}
|
|
@@ -36,12 +36,12 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
36
36
|
override fun consentChanged(event: ConsentChangedEvent) = prepareEvent(EventTypes.CONSENT_CHANGED.event, null)
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
|
-
* The notice is being hidden
|
|
39
|
+
* The notice screen is being hidden
|
|
40
40
|
*/
|
|
41
41
|
override fun hideNotice(event: HideNoticeEvent) = prepareEvent(EventTypes.HIDE_NOTICE.event, null)
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
|
-
* The notice is being shown
|
|
44
|
+
* The notice screen is being shown
|
|
45
45
|
*/
|
|
46
46
|
override fun showNotice(event: ShowNoticeEvent) = prepareEvent(EventTypes.SHOW_NOTICE.event, null)
|
|
47
47
|
|
|
@@ -70,6 +70,16 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
70
70
|
*/
|
|
71
71
|
override fun noticeClickPrivacyPolicy(event: NoticeClickPrivacyPolicyEvent) = prepareEvent(EventTypes.NOTICE_CLICK_PRIVACY_POLICY.event, null)
|
|
72
72
|
|
|
73
|
+
/**
|
|
74
|
+
* The preferences screen is being hidden
|
|
75
|
+
*/
|
|
76
|
+
override fun hidePreferences(event: HidePreferencesEvent) = prepareEvent(EventTypes.HIDE_PREFERENCES.event, null)
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* The preferences screen is being shown
|
|
80
|
+
*/
|
|
81
|
+
override fun showPreferences(event: ShowPreferencesEvent) = prepareEvent(EventTypes.SHOW_PREFERENCES.event, null)
|
|
82
|
+
|
|
73
83
|
/**
|
|
74
84
|
* Click on agree to all on preferences popup
|
|
75
85
|
*/
|
|
@@ -499,6 +509,15 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
499
509
|
}
|
|
500
510
|
}
|
|
501
511
|
|
|
512
|
+
@ReactMethod
|
|
513
|
+
fun getUserStatus(promise: Promise) {
|
|
514
|
+
try {
|
|
515
|
+
promise.resolve(objectToWritableMap(Didomi.getInstance().getUserStatus()))
|
|
516
|
+
} catch (e: DidomiNotReadyException) {
|
|
517
|
+
promise.reject(e)
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
|
|
502
521
|
@ReactMethod
|
|
503
522
|
fun getUserStatusForVendor(vendorId: String, promise: Promise) {
|
|
504
523
|
try {
|
|
@@ -13,6 +13,8 @@ enum class EventTypes(val event: String) {
|
|
|
13
13
|
NOTICE_CLICK_MORE_INFO("on_notice_click_more_info"),
|
|
14
14
|
NOTICE_CLICK_VIEW_VENDORS("on_notice_click_view_vendors"),
|
|
15
15
|
NOTICE_CLICK_PRIVACY_POLICY("on_notice_click_privacy_policy"),
|
|
16
|
+
HIDE_PREFERENCES("on_hide_preferences"),
|
|
17
|
+
SHOW_PREFERENCES("on_show_preferences"),
|
|
16
18
|
PREFERENCES_CLICK_AGREE_TO_ALL("on_preferences_click_agree_to_all"),
|
|
17
19
|
PREFERENCES_CLICK_DISAGREE_TO_ALL("on_preferences_click_disagree_to_all"),
|
|
18
20
|
PREFERENCES_CLICK_PURPOSE_AGREE("on_preferences_click_purpose_agree"),
|
package/ios/Didomi.m
CHANGED
|
@@ -52,6 +52,9 @@ RCT_EXTERN_METHOD(getUserLegitimateInterestStatusForPurpose:(NSString *)purposeI
|
|
|
52
52
|
resolve:(RCTPromiseResolveBlock)resolve
|
|
53
53
|
reject:(RCTPromiseRejectBlock)reject)
|
|
54
54
|
|
|
55
|
+
RCT_EXTERN_METHOD(getUserStatus:(RCTPromiseResolveBlock)resolve
|
|
56
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
57
|
+
|
|
55
58
|
RCT_EXTERN_METHOD(getUserStatusForVendor:(NSString *)vendorId
|
|
56
59
|
resolve:(RCTPromiseResolveBlock)resolve
|
|
57
60
|
reject:(RCTPromiseRejectBlock)reject)
|
package/ios/RNDidomi.swift
CHANGED
|
@@ -78,6 +78,13 @@ class RNDidomi: RCTEventEmitter {
|
|
|
78
78
|
resolve(consentStatus.rawValue.consentStatusBool)
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
+
@objc(getUserStatus:reject:)
|
|
82
|
+
func getUserStatus(resolve:RCTPromiseResolveBlock,reject:RCTPromiseRejectBlock) {
|
|
83
|
+
let encoder = JSONEncoder()
|
|
84
|
+
let userStatus = try? JSONSerialization.jsonObject(with: encoder.encode(Didomi.shared.getUserStatus())) as? [String: Any]
|
|
85
|
+
resolve(userStatus)
|
|
86
|
+
}
|
|
87
|
+
|
|
81
88
|
@objc(getUserStatusForVendor:resolve:reject:)
|
|
82
89
|
func getUserStatusForVendor(vendorId: String, resolve:RCTPromiseResolveBlock,reject:RCTPromiseRejectBlock) {
|
|
83
90
|
let userStatus = Didomi.shared.getUserStatusForVendor(vendorId: vendorId)
|
|
@@ -449,15 +456,17 @@ extension RNDidomi {
|
|
|
449
456
|
return ["on_ready_callback",
|
|
450
457
|
"on_error_callback",
|
|
451
458
|
"on_consent_changed",
|
|
452
|
-
"on_hide_notice",
|
|
453
459
|
"on_ready",
|
|
454
460
|
"on_error",
|
|
461
|
+
"on_hide_notice",
|
|
455
462
|
"on_show_notice",
|
|
456
463
|
"on_notice_click_agree",
|
|
457
464
|
"on_notice_click_disagree",
|
|
458
465
|
"on_notice_click_more_info",
|
|
459
466
|
"on_notice_click_view_vendors",
|
|
460
467
|
"on_notice_click_privacy_policy",
|
|
468
|
+
"on_hide_preferences",
|
|
469
|
+
"on_show_preferences",
|
|
461
470
|
"on_preferences_click_agree_to_all",
|
|
462
471
|
"on_preferences_click_disagree_to_all",
|
|
463
472
|
"on_preferences_click_agree_to_all_purposes",
|
|
@@ -486,10 +495,6 @@ extension RNDidomi {
|
|
|
486
495
|
self.sendEvent(withName: "on_consent_changed", body:"")
|
|
487
496
|
}
|
|
488
497
|
|
|
489
|
-
didomiEventListener.onHideNotice = { event in
|
|
490
|
-
self.sendEvent(withName: "on_hide_notice", body: "")
|
|
491
|
-
}
|
|
492
|
-
|
|
493
498
|
didomiEventListener.onReady = { event in
|
|
494
499
|
self.sendEvent(withName: "on_ready", body: "")
|
|
495
500
|
}
|
|
@@ -502,6 +507,10 @@ extension RNDidomi {
|
|
|
502
507
|
self.sendEvent(withName: "on_show_notice", body: "")
|
|
503
508
|
}
|
|
504
509
|
|
|
510
|
+
didomiEventListener.onHideNotice = { event in
|
|
511
|
+
self.sendEvent(withName: "on_hide_notice", body: "")
|
|
512
|
+
}
|
|
513
|
+
|
|
505
514
|
didomiEventListener.onNoticeClickAgree = { event in
|
|
506
515
|
self.sendEvent(withName: "on_notice_click_agree", body: "")
|
|
507
516
|
}
|
|
@@ -522,6 +531,14 @@ extension RNDidomi {
|
|
|
522
531
|
self.sendEvent(withName: "on_notice_click_privacy_policy", body: "")
|
|
523
532
|
}
|
|
524
533
|
|
|
534
|
+
didomiEventListener.onShowPreferences = { event in
|
|
535
|
+
self.sendEvent(withName: "on_show_preferences", body: "")
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
didomiEventListener.onHidePreferences = { event in
|
|
539
|
+
self.sendEvent(withName: "on_hide_preferences", body: "")
|
|
540
|
+
}
|
|
541
|
+
|
|
525
542
|
didomiEventListener.onPreferencesClickAgreeToAll = { event in
|
|
526
543
|
self.sendEvent(withName: "on_preferences_click_agree_to_all", body: "")
|
|
527
544
|
}
|
package/lib/commonjs/Didomi.js
CHANGED
|
@@ -214,6 +214,9 @@ const Didomi = {
|
|
|
214
214
|
* Get the user consent status for a specific purpose
|
|
215
215
|
* @param purposeId: The purpose ID to check consent for
|
|
216
216
|
* @returns: The user consent status for the specified purpose
|
|
217
|
+
* @deprecated use {@link #getUserStatus()} instead. Search the purposeId in
|
|
218
|
+
* getUserStatus().getPurposes().getConsent().getEnabled() or
|
|
219
|
+
* getUserStatus().getPurposes().getConsent().getDisabled().
|
|
217
220
|
*/
|
|
218
221
|
getUserConsentStatusForPurpose: purposeId => RNDidomi.getUserConsentStatusForPurpose(purposeId),
|
|
219
222
|
|
|
@@ -221,6 +224,9 @@ const Didomi = {
|
|
|
221
224
|
* Get the user consent status for a specific vendor
|
|
222
225
|
* @param vendorId: The vendor ID to check consent for
|
|
223
226
|
* @returns: The user consent status for the specified vendor
|
|
227
|
+
* @deprecated use {@link #getUserStatus()} instead. Search the vendorId in
|
|
228
|
+
* getUserStatus().getVendors().getConsent().getEnabled() or
|
|
229
|
+
* getUserStatus().getVendors().getConsent().getDisabled().
|
|
224
230
|
*/
|
|
225
231
|
getUserConsentStatusForVendor: vendorId => RNDidomi.getUserConsentStatusForVendor(vendorId),
|
|
226
232
|
|
|
@@ -228,6 +234,9 @@ const Didomi = {
|
|
|
228
234
|
* Get the user consent status for a specific vendor and all its purposes
|
|
229
235
|
* @param vendorId: The ID of the vendor
|
|
230
236
|
* @returns: The user consent status corresponding to the specified vendor and all its required purposes.
|
|
237
|
+
* @deprecated use {@link #getUserStatus()} instead. The result of this method has been replaced
|
|
238
|
+
* by getUserStatus().getVendors().getGlobalConsent().getEnabled() or
|
|
239
|
+
* getUserStatus().getVendors().getGlobalConsent().getDisabled().
|
|
231
240
|
*/
|
|
232
241
|
getUserConsentStatusForVendorAndRequiredPurposes: vendorId => RNDidomi.getUserConsentStatusForVendorAndRequiredPurposes(vendorId),
|
|
233
242
|
|
|
@@ -235,6 +244,9 @@ const Didomi = {
|
|
|
235
244
|
* Get the user legitimate interest status for a specific purpose.
|
|
236
245
|
* @param purposeId: purpose ID.
|
|
237
246
|
* @returns: LI status of a purpose.
|
|
247
|
+
* @deprecated use {@link #getUserStatus()} instead. Search the purposeId in
|
|
248
|
+
* getUserStatus().getPurposes().getLegitimateInterest().getEnabled() or
|
|
249
|
+
* getUserStatus().getPurposes().getLegitimateInterest().getDisabled().
|
|
238
250
|
*/
|
|
239
251
|
getUserLegitimateInterestStatusForPurpose: purposeId => RNDidomi.getUserLegitimateInterestStatusForPurpose(purposeId),
|
|
240
252
|
|
|
@@ -242,6 +254,9 @@ const Didomi = {
|
|
|
242
254
|
* Get the user legitimate interest status for a specific vendor.
|
|
243
255
|
* @param vendorId: vendor ID.
|
|
244
256
|
* @returns: LI status of a vendor.
|
|
257
|
+
* @deprecated use {@link #getUserStatus()} instead. Search the vendorId in
|
|
258
|
+
* getUserStatus().getVendors().getLegitimateInterest().getEnabled() or
|
|
259
|
+
* getUserStatus().getVendors().getLegitimateInterest().getDisabled().
|
|
245
260
|
*/
|
|
246
261
|
getUserLegitimateInterestForVendor: vendorId => RNDidomi.getUserLegitimateInterestStatusForVendor(vendorId),
|
|
247
262
|
|
|
@@ -249,13 +264,25 @@ const Didomi = {
|
|
|
249
264
|
* Get the user LI status for a specific vendor and all its purposes.
|
|
250
265
|
* @param vendorId: vendor ID.
|
|
251
266
|
* @returns: The user LI status corresponding to the specified vendor and all its required purposes.
|
|
267
|
+
* @deprecated use {@link #getUserStatus()} instead. Search the purposeId in
|
|
268
|
+
* getUserStatus().getVendors().getGlobalLegitimateInterest().getEnabled() or
|
|
269
|
+
* getUserStatus().getVendors().getGlobalLegitimateInterest().getDisabled().
|
|
252
270
|
*/
|
|
253
271
|
getUserLegitimateInterestStatusForVendorAndRequiredPurposes: vendorId => RNDidomi.getUserLegitimateInterestStatusForVendorAndRequiredPurposes(vendorId),
|
|
254
272
|
|
|
273
|
+
/**
|
|
274
|
+
* Get the user consent status.
|
|
275
|
+
* @returns: status that represents user consent.
|
|
276
|
+
*/
|
|
277
|
+
getUserStatus: () => RNDidomi.getUserStatus(),
|
|
278
|
+
|
|
255
279
|
/**
|
|
256
280
|
* Get the user consent and legitimate interest status for a specific vendor.
|
|
257
281
|
* @param vendorId: vendor ID.
|
|
258
282
|
* @returns: status that represents both consent and legitimate interest status of a vendor.
|
|
283
|
+
* @deprecated use {@link #getUserStatus()} instead. Search the vendorId in
|
|
284
|
+
* getUserStatus().getVendors().getGlobal().getEnabled() or
|
|
285
|
+
* getUserStatus().getVendors().getGlobal().getDisabled().
|
|
259
286
|
*/
|
|
260
287
|
getUserStatusForVendor: vendorId => RNDidomi.getUserStatusForVendor(vendorId),
|
|
261
288
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Didomi.ts"],"names":["Didomi","RNDidomi","NativeModules","initialize","apiKey","localConfigurationPath","remoteConfigurationUrl","providerId","disableDidomiRemoteConfig","languageCode","noticeId","DidomiListener","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","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;;AAGA,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,CACEC,MADF,EAEEC,sBAFF,EAGEC,sBAHF,EAIEC,UAJF,EAKEC,yBALF,EAMEC,YANF,EAOEC,QAPF;AASD,GAlCmB;;AAoCpB;AACF;AACA;AACEG,EAAAA,OAAO,EAAE,MAAqBF,+BAAeE,OAAf,EAvCV;;AAyCpB;AACF;AACA;AACEC,EAAAA,OAAO,EAAE,MAAoBH,+BAAeG,OAAf,EA5CT;;AA8CpB;AACF;AACA;AACEC,EAAAA,OAAO,EAAE,MAAqBd,QAAQ,CAACc,OAAT,EAjDV;;AAmDpB;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,EAAGC,KAAD,IAAoChB,QAAQ,CAACe,WAAT,CAAqBC,KAArB,CA1E7B;;AA4EpB;AACF;AACA;AACA;AACEC,EAAAA,gBAAgB,EAAE,CAChBC,SADgB,EAEhBC,QAFgB,KAGbT,+BAAeO,gBAAf,CAAgCC,SAAhC,EAA2CC,QAA3C,CAnFe;;AAqFpB;AACF;AACA;AACA;AACEC,EAAAA,mBAAmB,EAAE,CACnBF,SADmB,EAEnBC,QAFmB,KAGhBT,+BA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AFF,EAGEC,mBAHF,EAIEC,oBAJF,EAKEC,uBALF,EAMEC,wBANF,EAOEC,kBAPF,EAQEC,mBARF,CAzckB;;AAodpB;AACF;AACA;AACA;AACEC,EAAAA,wBAAwB,EAAE,MACxB3F,QAAQ,CAAC2F,wBAAT,EAzdkB;;AA2dpB;AACF;AACA;AACA;AACA;AACA;AACEC,EAAAA,sBAAsB,EAAGpF,YAAD,IACtBR,QAAQ,CAAC4F,sBAAT,CAAgCpF,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: (extra?: string | null): Promise<string> =>\n RNDidomi.getJavaScriptForWebView(extra),\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":["Didomi","RNDidomi","NativeModules","initialize","apiKey","localConfigurationPath","remoteConfigurationUrl","providerId","disableDidomiRemoteConfig","languageCode","noticeId","DidomiListener","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;;AACA;;AAGA,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,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ApfkB;;AAsfpB;AACF;AACA;AACA;AACA;AACA;AACEC,EAAAA,sBAAsB,EAAGrF,YAAD,IACtBR,QAAQ,CAAC6F,sBAAT,CAAgCrF,YAAhC;AA7fkB,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: (extra?: string | null): Promise<string> =>\n RNDidomi.getJavaScriptForWebView(extra),\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 * @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> =>\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 * @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> =>\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 * @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: (\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 * @deprecated use {@link #getUserStatus()} instead. Search the purposeId in\n * getUserStatus().getPurposes().getLegitimateInterest().getEnabled() or\n * getUserStatus().getPurposes().getLegitimateInterest().getDisabled().\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 * @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> =>\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 * @deprecated use {@link #getUserStatus()} instead. Search the purposeId in\n * getUserStatus().getVendors().getGlobalLegitimateInterest().getEnabled() or\n * getUserStatus().getVendors().getGlobalLegitimateInterest().getDisabled().\n */\n getUserLegitimateInterestStatusForVendorAndRequiredPurposes: (\n vendorId: string\n ): boolean =>\n RNDidomi.getUserLegitimateInterestStatusForVendorAndRequiredPurposes(\n vendorId\n ),\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> =>\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"]}
|
|
@@ -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"]}
|
package/lib/module/Didomi.js
CHANGED
|
@@ -204,6 +204,9 @@ export const Didomi = {
|
|
|
204
204
|
* Get the user consent status for a specific purpose
|
|
205
205
|
* @param purposeId: The purpose ID to check consent for
|
|
206
206
|
* @returns: The user consent status for the specified purpose
|
|
207
|
+
* @deprecated use {@link #getUserStatus()} instead. Search the purposeId in
|
|
208
|
+
* getUserStatus().getPurposes().getConsent().getEnabled() or
|
|
209
|
+
* getUserStatus().getPurposes().getConsent().getDisabled().
|
|
207
210
|
*/
|
|
208
211
|
getUserConsentStatusForPurpose: purposeId => RNDidomi.getUserConsentStatusForPurpose(purposeId),
|
|
209
212
|
|
|
@@ -211,6 +214,9 @@ export const Didomi = {
|
|
|
211
214
|
* Get the user consent status for a specific vendor
|
|
212
215
|
* @param vendorId: The vendor ID to check consent for
|
|
213
216
|
* @returns: The user consent status for the specified vendor
|
|
217
|
+
* @deprecated use {@link #getUserStatus()} instead. Search the vendorId in
|
|
218
|
+
* getUserStatus().getVendors().getConsent().getEnabled() or
|
|
219
|
+
* getUserStatus().getVendors().getConsent().getDisabled().
|
|
214
220
|
*/
|
|
215
221
|
getUserConsentStatusForVendor: vendorId => RNDidomi.getUserConsentStatusForVendor(vendorId),
|
|
216
222
|
|
|
@@ -218,6 +224,9 @@ export const Didomi = {
|
|
|
218
224
|
* Get the user consent status for a specific vendor and all its purposes
|
|
219
225
|
* @param vendorId: The ID of the vendor
|
|
220
226
|
* @returns: The user consent status corresponding to the specified vendor and all its required purposes.
|
|
227
|
+
* @deprecated use {@link #getUserStatus()} instead. The result of this method has been replaced
|
|
228
|
+
* by getUserStatus().getVendors().getGlobalConsent().getEnabled() or
|
|
229
|
+
* getUserStatus().getVendors().getGlobalConsent().getDisabled().
|
|
221
230
|
*/
|
|
222
231
|
getUserConsentStatusForVendorAndRequiredPurposes: vendorId => RNDidomi.getUserConsentStatusForVendorAndRequiredPurposes(vendorId),
|
|
223
232
|
|
|
@@ -225,6 +234,9 @@ export const Didomi = {
|
|
|
225
234
|
* Get the user legitimate interest status for a specific purpose.
|
|
226
235
|
* @param purposeId: purpose ID.
|
|
227
236
|
* @returns: LI status of a purpose.
|
|
237
|
+
* @deprecated use {@link #getUserStatus()} instead. Search the purposeId in
|
|
238
|
+
* getUserStatus().getPurposes().getLegitimateInterest().getEnabled() or
|
|
239
|
+
* getUserStatus().getPurposes().getLegitimateInterest().getDisabled().
|
|
228
240
|
*/
|
|
229
241
|
getUserLegitimateInterestStatusForPurpose: purposeId => RNDidomi.getUserLegitimateInterestStatusForPurpose(purposeId),
|
|
230
242
|
|
|
@@ -232,6 +244,9 @@ export const Didomi = {
|
|
|
232
244
|
* Get the user legitimate interest status for a specific vendor.
|
|
233
245
|
* @param vendorId: vendor ID.
|
|
234
246
|
* @returns: LI status of a vendor.
|
|
247
|
+
* @deprecated use {@link #getUserStatus()} instead. Search the vendorId in
|
|
248
|
+
* getUserStatus().getVendors().getLegitimateInterest().getEnabled() or
|
|
249
|
+
* getUserStatus().getVendors().getLegitimateInterest().getDisabled().
|
|
235
250
|
*/
|
|
236
251
|
getUserLegitimateInterestForVendor: vendorId => RNDidomi.getUserLegitimateInterestStatusForVendor(vendorId),
|
|
237
252
|
|
|
@@ -239,13 +254,25 @@ export const Didomi = {
|
|
|
239
254
|
* Get the user LI status for a specific vendor and all its purposes.
|
|
240
255
|
* @param vendorId: vendor ID.
|
|
241
256
|
* @returns: The user LI status corresponding to the specified vendor and all its required purposes.
|
|
257
|
+
* @deprecated use {@link #getUserStatus()} instead. Search the purposeId in
|
|
258
|
+
* getUserStatus().getVendors().getGlobalLegitimateInterest().getEnabled() or
|
|
259
|
+
* getUserStatus().getVendors().getGlobalLegitimateInterest().getDisabled().
|
|
242
260
|
*/
|
|
243
261
|
getUserLegitimateInterestStatusForVendorAndRequiredPurposes: vendorId => RNDidomi.getUserLegitimateInterestStatusForVendorAndRequiredPurposes(vendorId),
|
|
244
262
|
|
|
263
|
+
/**
|
|
264
|
+
* Get the user consent status.
|
|
265
|
+
* @returns: status that represents user consent.
|
|
266
|
+
*/
|
|
267
|
+
getUserStatus: () => RNDidomi.getUserStatus(),
|
|
268
|
+
|
|
245
269
|
/**
|
|
246
270
|
* Get the user consent and legitimate interest status for a specific vendor.
|
|
247
271
|
* @param vendorId: vendor ID.
|
|
248
272
|
* @returns: status that represents both consent and legitimate interest status of a vendor.
|
|
273
|
+
* @deprecated use {@link #getUserStatus()} instead. Search the vendorId in
|
|
274
|
+
* getUserStatus().getVendors().getGlobal().getEnabled() or
|
|
275
|
+
* getUserStatus().getVendors().getGlobal().getDisabled().
|
|
249
276
|
*/
|
|
250
277
|
getUserStatusForVendor: vendorId => RNDidomi.getUserStatusForVendor(vendorId),
|
|
251
278
|
|
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","extra","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","updateSelectedLanguage"],"mappings":"AAAA,SAASA,aAAT,QAA8B,cAA9B;AACA,SAASC,cAAT,QAA+B,kBAA/B;AAGA,MAAM;AAAEC,EAAAA,MAAM,EAAEC;AAAV,IAAuBH,aAA7B;AAEA,OAAO,MAAME,MAAM,GAAG;AACpB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACEE,EAAAA,UAAU,EAAE,CACVC,MADU,EAEVC,sBAFU,EAGVC,sBAHU,EAIVC,UAJU,EAKVC,yBAAkC,GAAG,KAL3B,EAMVC,YANU,EAOVC,QAPU,KAQP;AACH;AACAV,IAAAA,cAAc,CAACW,IAAf,GAFG,CAIH;;AACAT,IAAAA,QAAQ,CAACC,UAAT,CACEC,MADF,EAEEC,sBAFF,EAGEC,sBAHF,EAIEC,UAJF,EAKEC,yBALF,EAMEC,YANF,EAOEC,QAPF;AASD,GAlCmB;;AAoCpB;AACF;AACA;AACEE,EAAAA,OAAO,EAAE,MAAqBZ,cAA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EAEEC,kBAFF,EAGEC,gBAHF,EAIEC,iBAJF,CAlZkB;;AAyZpB;AACF;AACA;AACA;AACEC,EAAAA,oBAAoB,EAAE,MAAwB1E,QAAQ,CAAC0E,oBAAT,EA7Z1B;;AA+ZpB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACEC,EAAAA,aAAa,EAAE,CACbC,qBADa,EAEbC,gBAFa,EAGbC,oBAHa,EAIbC,eAJa,KAMb/E,QAAQ,CAAC2E,aAAT,CACEC,qBADF,EAEEC,gBAFF,EAGEC,oBAHF,EAIEC,eAJF,CA7akB;;AAobpB;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,KAUjBxF,QAAQ,CAACgF,iBAAT,CACEC,wBADF,EAEEC,yBAFF,EAGEC,mBAHF,EAIEC,oBAJF,EAKEC,uBALF,EAMEC,wBANF,EAOEC,kBAPF,EAQEC,mBARF,CAzckB;;AAodpB;AACF;AACA;AACA;AACEC,EAAAA,wBAAwB,EAAE,MACxBzF,QAAQ,CAACyF,wBAAT,EAzdkB;;AA2dpB;AACF;AACA;AACA;AACA;AACA;AACEC,EAAAA,sBAAsB,EAAGnF,YAAD,IACtBP,QAAQ,CAAC0F,sBAAT,CAAgCnF,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: (extra?: string | null): Promise<string> =>\n RNDidomi.getJavaScriptForWebView(extra),\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","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;AAGA,MAAM;AAAEC,EAAAA,MAAM,EAAEC;AAAV,IAAuBH,aAA7B;AAEA,OAAO,MAAME,MAAM,GAAG;AACpB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACEE,EAAAA,UAAU,EAAE,CACVC,MADU,EAEVC,sBAFU,EAGVC,sBAHU,EAIVC,UAJU,EAKVC,yBAAkC,GAAG,KAL3B,EAMVC,YANU,EAOVC,QAPU,KAQP;AACH;AACAV,IAAAA,cAAc,CAACW,IAAf,GAFG,CAIH;;AACAT,IAAAA,QAAQ,CAACC,UAAT,CACEC,MADF,EAEEC,sBAFF,EAGEC,sBAHF,EAIEC,UAJF,EAKEC,yBALF,EAMEC,YANF,EAOEC,QAPF;AASD,GAlCmB;;AAoCpB;AACF;AACA;AACEE,EAAAA,OAAO,EAAE,MAAqBZ,cAAc,CAACY,OAAf,EAvCV;;AAyCpB;AACF;AACA;AACEC,EAAAA,OAAO,EAAE,MAAoBb,cAAc,CAACa,OAAf,EA5CT;;AA8CpB;AACF;AACA;AACEC,EAAAA,OAAO,EAAE,MAAqBZ,QAAQ,CAACY,OAAT,EAjDV;;AAmDpB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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oB,EAAE,MAAwB3E,QAAQ,CAAC2E,oBAAT,EAxb1B;;AA0bpB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACEC,EAAAA,aAAa,EAAE,CACbC,qBADa,EAEbC,gBAFa,EAGbC,oBAHa,EAIbC,eAJa,KAMbhF,QAAQ,CAAC4E,aAAT,CACEC,qBADF,EAEEC,gBAFF,EAGEC,oBAHF,EAIEC,eAJF,CAxckB;;AA+cpB;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,KAUjBzF,QAAQ,CAACiF,iBAAT,CACEC,wBADF,EAEEC,yBAFF,EAGEC,mBAHF,EAIEC,oBAJF,EAKEC,uBALF,EAMEC,wBANF,EAOEC,kBAPF,EAQEC,mBARF,CApekB;;AA+epB;AACF;AACA;AACA;AACEC,EAAAA,wBAAwB,EAAE,MACxB1F,QAAQ,CAAC0F,wBAAT,EApfkB;;AAsfpB;AACF;AACA;AACA;AACA;AACA;AACEC,EAAAA,sBAAsB,EAAGpF,YAAD,IACtBP,QAAQ,CAAC2F,sBAAT,CAAgCpF,YAAhC;AA7fkB,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: (extra?: string | null): Promise<string> =>\n RNDidomi.getJavaScriptForWebView(extra),\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 * @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> =>\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 * @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> =>\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 * @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: (\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 * @deprecated use {@link #getUserStatus()} instead. Search the purposeId in\n * getUserStatus().getPurposes().getLegitimateInterest().getEnabled() or\n * getUserStatus().getPurposes().getLegitimateInterest().getDisabled().\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 * @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> =>\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 * @deprecated use {@link #getUserStatus()} instead. Search the purposeId in\n * getUserStatus().getVendors().getGlobalLegitimateInterest().getEnabled() or\n * getUserStatus().getVendors().getGlobalLegitimateInterest().getDisabled().\n */\n getUserLegitimateInterestStatusForVendorAndRequiredPurposes: (\n vendorId: string\n ): boolean =>\n RNDidomi.getUserLegitimateInterestStatusForVendorAndRequiredPurposes(\n vendorId\n ),\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> =>\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"]}
|
|
@@ -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"]}
|
|
@@ -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
package/src/Didomi.ts
CHANGED
|
@@ -233,6 +233,9 @@ export const Didomi = {
|
|
|
233
233
|
* Get the user consent status for a specific purpose
|
|
234
234
|
* @param purposeId: The purpose ID to check consent for
|
|
235
235
|
* @returns: The user consent status for the specified purpose
|
|
236
|
+
* @deprecated use {@link #getUserStatus()} instead. Search the purposeId in
|
|
237
|
+
* getUserStatus().getPurposes().getConsent().getEnabled() or
|
|
238
|
+
* getUserStatus().getPurposes().getConsent().getDisabled().
|
|
236
239
|
*/
|
|
237
240
|
getUserConsentStatusForPurpose: (purposeId: string): Promise<boolean> =>
|
|
238
241
|
RNDidomi.getUserConsentStatusForPurpose(purposeId),
|
|
@@ -241,6 +244,9 @@ export const Didomi = {
|
|
|
241
244
|
* Get the user consent status for a specific vendor
|
|
242
245
|
* @param vendorId: The vendor ID to check consent for
|
|
243
246
|
* @returns: The user consent status for the specified vendor
|
|
247
|
+
* @deprecated use {@link #getUserStatus()} instead. Search the vendorId in
|
|
248
|
+
* getUserStatus().getVendors().getConsent().getEnabled() or
|
|
249
|
+
* getUserStatus().getVendors().getConsent().getDisabled().
|
|
244
250
|
*/
|
|
245
251
|
getUserConsentStatusForVendor: (vendorId: string): Promise<boolean> =>
|
|
246
252
|
RNDidomi.getUserConsentStatusForVendor(vendorId),
|
|
@@ -249,6 +255,9 @@ export const Didomi = {
|
|
|
249
255
|
* Get the user consent status for a specific vendor and all its purposes
|
|
250
256
|
* @param vendorId: The ID of the vendor
|
|
251
257
|
* @returns: The user consent status corresponding to the specified vendor and all its required purposes.
|
|
258
|
+
* @deprecated use {@link #getUserStatus()} instead. The result of this method has been replaced
|
|
259
|
+
* by getUserStatus().getVendors().getGlobalConsent().getEnabled() or
|
|
260
|
+
* getUserStatus().getVendors().getGlobalConsent().getDisabled().
|
|
252
261
|
*/
|
|
253
262
|
getUserConsentStatusForVendorAndRequiredPurposes: (
|
|
254
263
|
vendorId: string
|
|
@@ -259,6 +268,9 @@ export const Didomi = {
|
|
|
259
268
|
* Get the user legitimate interest status for a specific purpose.
|
|
260
269
|
* @param purposeId: purpose ID.
|
|
261
270
|
* @returns: LI status of a purpose.
|
|
271
|
+
* @deprecated use {@link #getUserStatus()} instead. Search the purposeId in
|
|
272
|
+
* getUserStatus().getPurposes().getLegitimateInterest().getEnabled() or
|
|
273
|
+
* getUserStatus().getPurposes().getLegitimateInterest().getDisabled().
|
|
262
274
|
*/
|
|
263
275
|
getUserLegitimateInterestStatusForPurpose: (
|
|
264
276
|
purposeId: string
|
|
@@ -269,6 +281,9 @@ export const Didomi = {
|
|
|
269
281
|
* Get the user legitimate interest status for a specific vendor.
|
|
270
282
|
* @param vendorId: vendor ID.
|
|
271
283
|
* @returns: LI status of a vendor.
|
|
284
|
+
* @deprecated use {@link #getUserStatus()} instead. Search the vendorId in
|
|
285
|
+
* getUserStatus().getVendors().getLegitimateInterest().getEnabled() or
|
|
286
|
+
* getUserStatus().getVendors().getLegitimateInterest().getDisabled().
|
|
272
287
|
*/
|
|
273
288
|
getUserLegitimateInterestForVendor: (vendorId: string): Promise<boolean> =>
|
|
274
289
|
RNDidomi.getUserLegitimateInterestStatusForVendor(vendorId),
|
|
@@ -277,6 +292,9 @@ export const Didomi = {
|
|
|
277
292
|
* Get the user LI status for a specific vendor and all its purposes.
|
|
278
293
|
* @param vendorId: vendor ID.
|
|
279
294
|
* @returns: The user LI status corresponding to the specified vendor and all its required purposes.
|
|
295
|
+
* @deprecated use {@link #getUserStatus()} instead. Search the purposeId in
|
|
296
|
+
* getUserStatus().getVendors().getGlobalLegitimateInterest().getEnabled() or
|
|
297
|
+
* getUserStatus().getVendors().getGlobalLegitimateInterest().getDisabled().
|
|
280
298
|
*/
|
|
281
299
|
getUserLegitimateInterestStatusForVendorAndRequiredPurposes: (
|
|
282
300
|
vendorId: string
|
|
@@ -285,10 +303,19 @@ export const Didomi = {
|
|
|
285
303
|
vendorId
|
|
286
304
|
),
|
|
287
305
|
|
|
306
|
+
/**
|
|
307
|
+
* Get the user consent status.
|
|
308
|
+
* @returns: status that represents user consent.
|
|
309
|
+
*/
|
|
310
|
+
getUserStatus: (): Promise<any> => RNDidomi.getUserStatus(),
|
|
311
|
+
|
|
288
312
|
/**
|
|
289
313
|
* Get the user consent and legitimate interest status for a specific vendor.
|
|
290
314
|
* @param vendorId: vendor ID.
|
|
291
315
|
* @returns: status that represents both consent and legitimate interest status of a vendor.
|
|
316
|
+
* @deprecated use {@link #getUserStatus()} instead. Search the vendorId in
|
|
317
|
+
* getUserStatus().getVendors().getGlobal().getEnabled() or
|
|
318
|
+
* getUserStatus().getVendors().getGlobal().getDisabled().
|
|
292
319
|
*/
|
|
293
320
|
getUserStatusForVendor: (vendorId: string): Promise<boolean> =>
|
|
294
321
|
RNDidomi.getUserStatusForVendor(vendorId),
|
package/src/DidomiTypes.ts
CHANGED
|
@@ -10,6 +10,8 @@ export enum DidomiEventType {
|
|
|
10
10
|
NOTICE_CLICK_MORE_INFO = 'on_notice_click_more_info',
|
|
11
11
|
NOTICE_CLICK_VIEW_VENDORS = 'on_notice_click_view_vendors',
|
|
12
12
|
NOTICE_CLICK_PRIVACY_POLICY = 'on_notice_click_privacy_policy',
|
|
13
|
+
HIDE_PREFERENCES = 'on_hide_preferences',
|
|
14
|
+
SHOW_PREFERENCES = 'on_show_preferences',
|
|
13
15
|
PREFERENCES_CLICK_AGREE_TO_ALL = 'on_preferences_click_agree_to_all',
|
|
14
16
|
PREFERENCES_CLICK_DISAGREE_TO_ALL = 'on_preferences_click_disagree_to_all',
|
|
15
17
|
PREFERENCES_CLICK_PURPOSE_AGREE = 'on_preferences_click_purpose_agree',
|
|
@@ -74,3 +76,33 @@ export interface Map<T> {
|
|
|
74
76
|
[index: string]: T;
|
|
75
77
|
[index: number]: T;
|
|
76
78
|
}
|
|
79
|
+
|
|
80
|
+
export interface UserStatus {
|
|
81
|
+
purposes: UserStatusPurposes;
|
|
82
|
+
vendors: UserStatusVendors;
|
|
83
|
+
userId: string;
|
|
84
|
+
created: string;
|
|
85
|
+
updated: string;
|
|
86
|
+
consentString: string;
|
|
87
|
+
additionalConsent: string;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface UserStatusPurposes {
|
|
91
|
+
global: UserStatusIds;
|
|
92
|
+
consent: UserStatusIds;
|
|
93
|
+
legitimateInterest: UserStatusIds;
|
|
94
|
+
essential: UserStatusIds;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export interface UserStatusVendors {
|
|
98
|
+
global: UserStatusIds;
|
|
99
|
+
globalConsent: UserStatusIds;
|
|
100
|
+
globalLegitimateInterest: UserStatusIds;
|
|
101
|
+
consent: UserStatusIds;
|
|
102
|
+
legitimateInterest: UserStatusIds;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export interface UserStatusIds {
|
|
106
|
+
disabled: string[];
|
|
107
|
+
enabled: string[];
|
|
108
|
+
}
|