@didomi/react-native 2.2.0 → 2.4.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/android/build.gradle +1 -1
- package/android/src/main/java/com/reactnativedidomi/DidomiModule.kt +153 -11
- package/android/src/main/java/com/reactnativedidomi/EventTypes.kt +1 -0
- package/ios/Didomi.m +20 -10
- package/ios/RNDidomi.swift +156 -4
- package/lib/commonjs/Constants.js +1 -1
- package/lib/commonjs/Constants.js.map +1 -1
- package/lib/commonjs/Didomi.js +22 -2
- package/lib/commonjs/Didomi.js.map +1 -1
- package/lib/commonjs/DidomiListener.js +12 -1
- package/lib/commonjs/DidomiListener.js.map +1 -1
- package/lib/commonjs/DidomiTypes.js +2 -1
- package/lib/commonjs/DidomiTypes.js.map +1 -1
- package/lib/commonjs/index.js +12 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/Constants.js +1 -1
- package/lib/module/Constants.js.map +1 -1
- package/lib/module/Didomi.js +22 -2
- package/lib/module/Didomi.js.map +1 -1
- package/lib/module/DidomiListener.js +12 -1
- package/lib/module/DidomiListener.js.map +1 -1
- package/lib/module/DidomiTypes.js +2 -1
- package/lib/module/DidomiTypes.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/Constants.d.ts +1 -1
- package/lib/typescript/Didomi.d.ts +22 -2
- package/lib/typescript/DidomiTypes.d.ts +19 -1
- package/lib/typescript/index.d.ts +1 -1
- package/package.json +1 -1
- package/react-native-didomi.podspec +1 -1
- package/src/Constants.ts +1 -1
- package/src/Didomi.ts +35 -3
- package/src/DidomiListener.ts +11 -1
- package/src/DidomiTypes.ts +24 -1
- package/src/index.tsx +15 -1
package/lib/module/Didomi.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeModules","DidomiListener","DIDOMI_USER_AGENT_NAME","DIDOMI_VERSION","createCurrentUserStatusTransaction","Didomi","RNDidomi","initialize","apiKey","localConfigurationPath","remoteConfigurationUrl","providerId","disableDidomiRemoteConfig","languageCode","noticeId","androidTvNoticeId","androidTvEnabled","init","onReady","promise","setOnReadyListener","onError","setOnErrorListener","setupUI","setLogLevel","level","addEventListener","eventType","callback","addVendorStatusListener","vendorId","listenToVendorStatus","removeVendorStatusListener","stopListeningToVendorStatus","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","getUserConsentStatusForVendorAndRequiredPurposes","getUserLegitimateInterestStatusForPurpose","getUserLegitimateInterestForVendor","getUserLegitimateInterestStatusForVendor","getUserLegitimateInterestStatusForVendorAndRequiredPurposes","getCurrentUserStatus","getUserStatus","getUserStatusForVendor","getVendor","hideNotice","hidePreferences","isConsentRequired","shouldUserStatusBeCollected","isUserConsentStatusPartial","isUserStatusPartial","isNoticeVisible","isPreferencesVisible","isError","isReady","clearUser","setUser","id","setUserAndSetupUI","setUserWithHashAuth","algorithm","secretId","digest","salt","expiration","undefined","setUserWithHashAuthWithExpiration","setUserWithHashAuthAndSetupUI","setUserWithHashAuthWithExpirationAndSetupUI","setUserWithEncryptionAuth","initializationVector","setUserWithEncryptionAuthWithExpiration","setUserWithEncryptionAuthAndSetupUI","setUserWithEncryptionAuthWithExpirationAndSetupUI","showNotice","showPreferences","view","setUserAgreeToAll","setUserConsentStatus","enabledPurposeIds","disabledPurposeIds","enabledVendorIds","disabledVendorIds","setUserDisagreeToAll","setCurrentUserStatus","currentUserStatus","jsonString","JSON","stringify","setUserStatus","purposesConsentStatus","purposesLIStatus","vendorsConsentStatus","vendorsLIStatus","setUserStatusSets","enabledConsentPurposeIds","disabledConsentPurposeIds","enabledLIPurposeIds","disabledLIPurposeIds","enabledConsentVendorIds","disabledConsentVendorIds","enabledLIVendorIds","disabledLIVendorIds","shouldConsentBeCollected","updateSelectedLanguage","openCurrentUserStatusTransaction","commitCurrentUserStatusTransaction"],"sources":["Didomi.ts"],"sourcesContent":["import { NativeModules } from 'react-native';\nimport { DidomiListener } from './DidomiListener';\nimport { DidomiEventType, Purpose, Vendor, UserStatus, CurrentUserStatus, VendorStatus } from './DidomiTypes';\nimport { DIDOMI_USER_AGENT_NAME, DIDOMI_VERSION } from './Constants';\nimport { CurrentUserStatusTransaction, createCurrentUserStatusTransaction } from './CurrentUserStatusTransaction';\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 remote 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 * @param androidTvNoticeId: Notice id for the remote configuration when running on Android TV device (ignored on iOS / tvOS). Note that using remote configuration is mandatory for TV devices.\n * @param androidTvEnabled: Whether to allow Didomi SDK to run on Android TV, default to \"false\".\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 androidTvNoticeId?: string,\n androidTvEnabled: boolean = false\n ): Promise<void> => {\n // Init listener\n DidomiListener.init();\n\n // Trigger native SDK init\n return RNDidomi.initialize(\n DIDOMI_USER_AGENT_NAME,\n DIDOMI_VERSION,\n apiKey,\n localConfigurationPath,\n remoteConfigurationUrl,\n providerId,\n disableDidomiRemoteConfig,\n languageCode,\n noticeId,\n androidTvNoticeId,\n androidTvEnabled\n );\n },\n\n /**\n * Listen to SDK ready state\n */\n onReady: (): Promise<void> => {\n var promise = DidomiListener.setOnReadyListener();\n RNDidomi.onReady();\n return promise;\n },\n\n /**\n * Listen to SDK errors\n */\n onError: (): Promise<void> => {\n var promise = DidomiListener.setOnErrorListener();\n RNDidomi.onError();\n return promise;\n },\n\n /**\n * Provide the objects required to display UI elements\n */\n setupUI: (): Promise<void> => RNDidomi.setupUI(),\n\n /**\n * Set the minimum level of messages to log\n * You can decide what level of messages should be logged by the SDK by calling the setLogLevel function before initialize\n *\n * Messages with a level below `minLevel` will not be logged.\n *\n * For iOS:\n * Levels are standard levels from `OSLogType` (https://developer.apple.com/documentation/os/logging/choosing_the_log_level_for_a_message):\n * - OSLogType.info (1)\n * - OSLogType.debug (2)\n * - OSLogType.error (16)\n * - OSLogType.fault (17)\n *\n * We recommend setting `OSLogType.error` (16) in production\n *\n * For Android:\n * Use the standard log levels supported by android.util.Log: VERBOSE, DEBUG, INFO, WARN and ERROR.\n * (https://developer.android.com/reference/android/util/Log#constants_1)\n *\n * We recommend setting `Log.INFO` (4) in production\n *\n * @param minLevel: Minimum level of messages to log\n */\n setLogLevel: (level: number): Promise<void> => RNDidomi.setLogLevel(level),\n\n /**\n * Add an event listener\n * @param listener:\n */\n addEventListener: (\n eventType: DidomiEventType,\n callback: (data: any) => void\n ) => DidomiListener.addEventListener(eventType, callback),\n\n /**\n * Add a listener to be triggered when the user status for the selected vendor changes\n * The callback will be registered after the SDK is ready\n * @param vendorId: the id of the vendor\n * @param callback: the callback to trigger when the user status for the selected vendor changes\n */\n addVendorStatusListener: (\n vendorId: string,\n callback: (vendorStatus: VendorStatus) => void\n ) => {\n RNDidomi.listenToVendorStatus(vendorId)\n DidomiListener.addVendorStatusListener(vendorId, callback);\n },\n\n /**\n * Remove one or multiple previously added vendor status listeners\n * @param vendorId the id of the vendor\n */\n removeVendorStatusListener: (vendorId: string) => {\n RNDidomi.stopListeningToVendorStatus(vendorId)\n DidomiListener.removeVendorStatusListener(vendorId);\n },\n\n /**\n * Remove an event listener\n * @param listener:\n */\n removeEventListener: (\n eventType: DidomiEventType,\n callback: (data: any) => void\n ) => DidomiListener.removeEventListener(eventType, callback),\n\n /**\n * Remove all event listeners\n */\n removeAllEventListeners: () => DidomiListener.reset(),\n\n /**\n * Method used to get an array of disabled purposes.\n * @returns: array of disabled purposes.\n * @deprecated use {@link #getUserStatus()} instead. The result of this method\n * has been replaced by getUserStatus().purposes.consent.disabled.\n */\n getDisabledPurposes: (): Promise<Purpose[]> => RNDidomi.getDisabledPurposes(),\n\n /**\n * Method used to get a set of disabled purpose IDs.\n * @returns: set that contains the IDs of disabled purposes.\n * @deprecated use {@link #getUserStatus()} instead. The result of this method\n * has been replaced by getUserStatus().purposes.consent.enabled.\n */\n getDisabledPurposeIds: (): Promise<string[]> => RNDidomi.getDisabledPurposeIds(),\n\n /**\n * Method used to get an array of disabled vendors.\n * @returns: array of disabled vendors.\n * @deprecated use {@link #getUserStatus()} instead. The result of this method\n * has been replaced by getUserStatus().vendors.consent.disabled.\n */\n getDisabledVendors: (): Promise<Vendor[]> => RNDidomi.getDisabledVendors(),\n\n /**\n * Method used to get a set of disabled vendor IDs.\n * @returns: set that contains the IDs of disabled vendors.\n * @deprecated use {@link #getUserStatus()} instead. The result of this method\n * has been replaced by getUserStatus().vendors.consent.disabled.\n */\n getDisabledVendorIds: (): Promise<string[]> => RNDidomi.getDisabledVendorIds(),\n\n /**\n * Method used to get an array of enabled purposes.\n * @returns: array of enabled purposes.\n * @deprecated use {@link #getUserStatus()} instead. The result of this method\n * has been replaced by getUserStatus().purposes.consent.enabled.\n */\n getEnabledPurposes: (): Promise<Purpose[]> => RNDidomi.getEnabledPurposes(),\n\n /**\n * Method used to get a set of enabled purpose IDs.\n * @returns: set that contains the IDs of enabled purposes.\n * @deprecated use {@link #getUserStatus()} instead. The result of this method\n * has been replaced by getUserStatus().purposes.consent.enabled.\n */\n getEnabledPurposeIds: (): Promise<string[]> => RNDidomi.getEnabledPurposeIds(),\n\n /**\n * Method used to get an array of enabled vendors.\n * @returns: array of enabled vendors.\n * @deprecated use {@link #getUserStatus()} instead. The result of this method\n * has been replaced by getUserStatus().vendors.consent.enabled.\n */\n getEnabledVendors: (): Promise<Vendor[]> => RNDidomi.getEnabledVendors(),\n\n /**\n * Method used to get a set of enabled vendor IDs.\n * @returns: set that contains the IDs of enabled vendors.\n * @deprecated use {@link #getUserStatus()} instead. The result of this method\n * has been replaced by getUserStatus().vendors.consent.enabled.\n */\n getEnabledVendorIds: (): Promise<string[]> => RNDidomi.getEnabledVendorIds(),\n\n /**\n * Get JavaScript to embed into a WebView to pass the consent status from the app\n * to the Didomi Web SDK embedded into the WebView\n * Inject the returned JavaScript into a WebView\n * @param extra: Extra JavaScript to inject in the returned code\n * @returns: JavaScript code to inject in a WebView\n */\n getJavaScriptForWebView: (extra?: string | null): Promise<string> => RNDidomi.getJavaScriptForWebView(extra),\n\n getQueryStringForWebView: (): Promise<string> => RNDidomi.getQueryStringForWebView(),\n\n /**\n * Method used to get a Purpose based on its ID.\n * @param purposeId: purpose ID used in the search.\n * @returns: purpose found in the array.\n */\n getPurpose: (purposeId: string): Promise<Purpose> => 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<Purpose[]> => RNDidomi.getRequiredPurposes(),\n\n /**\n * Get the configured purpose IDs\n * @returns: set of purpose IDs.\n */\n getRequiredPurposeIds: (): Promise<string[]> => RNDidomi.getRequiredPurposeIds(),\n\n /**\n * Method used to get an array of required vendors.\n * @returns: array of required vendors.\n */\n getRequiredVendors: (): Promise<Vendor[]> => RNDidomi.getRequiredVendors(),\n\n /**\n * Get the configured vendor IDs\n * @returns: set of vendor IDs.\n */\n getRequiredVendorIds: (): Promise<string[]> => RNDidomi.getRequiredVendorIds(),\n\n /**\n * Method used to get a dictionary/map in the form of { \"en\": \"Key in English\", \"fr\": \"Key in French.\" }\n * for a given key.\n * @param key: used to find its corresponding value in the dictionary/map.\n * @returns: dictionary containing the different translations for a given key.\n */\n getText: (key: string): Promise<any[]> => RNDidomi.getText(key),\n\n /**\n * Method used to get a translated text based on the key being passed.\n * The language and the source of this translated text will depend on the availability of the translation for the specific key.\n * The language being used will be either the selected language of the SDK (based on device Locale and other parameters) or the language specified by app developers as the default language being used by the SDK. The source can be either the `didomi_config.json` file which can be either local or remote, or the `didomi_master_config.json` file which is bundled within the SDK.\n *\n * These are the attempts performed by the SDK to try to find a translation for the specific key:\n * - Get translated value in user locale (selected language) from `didomi_config.json` (either local or remote).\n * - Get translated value in default locale (from the config) from `didomi_config.json` (either local or remote).\n * - Get translated value in user locale (selected language) from `didomi_master_config.json` (bundled within the Didomi SDK).\n * - Get translated value in default locale (from the config) from `didomi_master_config.json` (bundled within the Didomi SDK).\n *\n * If no translation can be found after these 4 attempts, the key will be returned.\n *\n * App developers can provide these translated texts through the `didomi_config.json` file (locally or remotely) in 3 different ways:\n * - Custom texts for the consent notice: https://developers.didomi.io/cmp/mobile-sdk/consent-notice/customize-the-notice#texts\n * - Custom texts for the preferences: https://developers.didomi.io/cmp/mobile-sdk/consent-notice/customize-the-preferences-popup#text\n * - Custom texts for custom notices: https://developers.didomi.io/cmp/mobile-sdk/consent-notice/customize-the-theme#translatable-texts-for-custom-notices\n *\n * @param key: used to find its corresponding value in one of the different sources.\n * @returns: a translated string if a translation was found, the same key that was passed otherwise.\n */\n getTranslatedText: (key: string): Promise<string> => RNDidomi.getTranslatedText(key),\n\n /**\n * Get the user consent status for a specific purpose\n * @param purposeId: The purpose ID to check consent for\n * @returns: The user consent status for the specified purpose\n * @deprecated use {@link #getUserStatus()} instead. Search the purposeId in\n * getUserStatus().purposes.consent.enabled or\n * getUserStatus().purposes.consent.enabled.\n */\n getUserConsentStatusForPurpose: (purposeId: string): Promise<boolean> => RNDidomi.getUserConsentStatusForPurpose(purposeId),\n\n /**\n * Get the user consent status for a specific vendor\n * @param vendorId: The vendor ID to check consent for\n * @returns: The user consent status for the specified vendor\n * @deprecated use {@link #getUserStatus()} instead. Search the vendorId in\n * getUserStatus().vendors.consent.enabled or\n * getUserStatus().vendors.consent.disabled.\n */\n getUserConsentStatusForVendor: (vendorId: string): Promise<boolean> => RNDidomi.getUserConsentStatusForVendor(vendorId),\n\n /**\n * Get the user consent status for a specific vendor and all its purposes\n * @param vendorId: The ID of the vendor\n * @returns: The user consent status corresponding to the specified vendor and all its required purposes.\n * @deprecated use {@link #getUserStatus()} instead. The result of this method has been replaced\n * by getUserStatus().vendors.global_consent.enabled or\n * getUserStatus().vendors.global_consent.disabled.\n */\n getUserConsentStatusForVendorAndRequiredPurposes: (vendorId: string): Promise<boolean> => RNDidomi.getUserConsentStatusForVendorAndRequiredPurposes(vendorId),\n\n /**\n * Get the user legitimate interest status for a specific purpose.\n * @param purposeId: purpose ID.\n * @returns: LI status of a purpose.\n * @deprecated use {@link #getUserStatus()} instead. Search the purposeId in\n * getUserStatus().purposes.consent.enabled or\n * getUserStatus().purposes.consent.enabled.\n */\n getUserLegitimateInterestStatusForPurpose: (purposeId: string): Promise<boolean> => RNDidomi.getUserLegitimateInterestStatusForPurpose(purposeId),\n\n /**\n * Get the user legitimate interest status for a specific vendor.\n * @param vendorId: vendor ID.\n * @returns: LI status of a vendor.\n * @deprecated use {@link #getUserStatus()} instead. Search the vendorId in\n * getUserStatus().vendors.legitimate_interest.enabled or\n * getUserStatus().vendors.legitimate_interest.disabled.\n */\n getUserLegitimateInterestForVendor: (vendorId: string): Promise<boolean> => RNDidomi.getUserLegitimateInterestStatusForVendor(vendorId),\n\n /**\n * Get the user LI status for a specific vendor and all its purposes.\n * @param vendorId: vendor ID.\n * @returns: The user LI status corresponding to the specified vendor and all its required purposes.\n * @deprecated use {@link #getUserStatus()} instead. Search the purposeId in\n * getUserStatus().vendors.global_legitimate_interest.enabled or\n * getUserStatus().vendors.global_legitimate_interest.disabled.\n */\n getUserLegitimateInterestStatusForVendorAndRequiredPurposes: (vendorId: string): boolean => RNDidomi.getUserLegitimateInterestStatusForVendorAndRequiredPurposes(vendorId),\n\n /**\n * Get the current user consent status.\n * @returns: status that represents current user consent.\n */\n getCurrentUserStatus: (): Promise<CurrentUserStatus> => RNDidomi.getCurrentUserStatus(),\n\n /**\n * Get the user consent status.\n * @returns: status that represents user consent.\n */\n getUserStatus: (): Promise<UserStatus> => 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().vendors.global.enabled or\n * getUserStatus().vendors.global.disabled.\n */\n getUserStatusForVendor: (vendorId: string): Promise<boolean> => RNDidomi.getUserStatusForVendor(vendorId),\n\n /**\n * Method used to get a Vendor based on its ID.\n * @param vendorId: vendor ID used in the search.\n * @returns: vendor found in the array.\n */\n getVendor: (vendorId: string): Promise<Vendor> => 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 user status should be collected for the user.\n * Returns **true** if user status is required for the current user and regulation, and one of the following two conditions is met:\n * - User status has never been collected for this user yet\n * - New user status should be collected (as new vendors have been added) AND the number of days before recollecting them has exceeded\n * @returns: **true** if user status should be collected according to these rules, **false** otherwise.\n */\n shouldUserStatusBeCollected: (): Promise<boolean> => RNDidomi.shouldUserStatusBeCollected(),\n\n /**\n * Determine if consent information is available for all purposes and vendors that are required\n * @returns: **true** if consent is required and consent information is available, **false** otherwise.\n */\n isUserConsentStatusPartial: (): Promise<boolean> => RNDidomi.isUserConsentStatusPartial(),\n\n /**\n * Determine if user did not express a choice for any purpose or vendor that is required\n * @returns: **true** if user choice is required and a choice is not expressed, **false** otherwise.\n */\n isUserStatusPartial: (): Promise<boolean> => RNDidomi.isUserStatusPartial(),\n\n /**\n * Check if the consent notice is currently displayed\n * @returns: **true** if the notice is displayed, **false** if is not.\n */\n isNoticeVisible: (): Promise<boolean> => RNDidomi.isNoticeVisible(),\n\n /**\n * Method used to check if the Preferences view is visible.\n * @returns: **true** if Preferences view is visible, **false** otherwise.\n */\n isPreferencesVisible: (): Promise<boolean> => RNDidomi.isPreferencesVisible(),\n\n isError: (): Promise<boolean> => RNDidomi.isError(),\n\n /**\n * Is the Didomi SDK ready?\n */\n isReady: (): Promise<boolean> => RNDidomi.isReady(),\n\n /**\n * Clear user information\n */\n clearUser: (): Promise<void> => RNDidomi.clearUser(),\n\n /**\n * Set user information without authentication\n *\n * @param id Organization user ID\n */\n setUser: (id: string): Promise<void> => RNDidomi.setUser(id),\n\n /**\n * Set user information without authentication and check for missing consent\n *\n * @param id Organization user ID\n */\n setUserAndSetupUI: (id: string): Promise<void> => RNDidomi.setUserAndSetupUI(id),\n\n /**\n * Set user information with Hash authentication\n *\n * @param id Organization user ID\n * @param algorithm Algorithm used for computing the digest\n * @param secretId ID of the secret used for computing the digest\n * @param digest Digest of the organization user ID and secret\n * @param salt Salt used for computing the digest (optional)\n * @param expiration Expiration date as timestamp (to prevent replay attacks)\n */\n setUserWithHashAuth: (\n id: string,\n algorithm: string,\n secretId: string,\n digest: string,\n salt?: string,\n expiration?: BigInt\n ): void => {\n if (expiration === undefined) {\n RNDidomi.setUserWithHashAuth(\n id,\n algorithm,\n secretId,\n digest,\n salt\n );\n } else {\n RNDidomi.setUserWithHashAuthWithExpiration(\n id,\n algorithm,\n secretId,\n digest,\n salt,\n expiration\n );\n }\n },\n\n /**\n * Set user information with Hash authentication and check for missing consent\n *\n * @param id Organization user ID\n * @param algorithm Algorithm used for computing the digest\n * @param secretId ID of the secret used for computing the digest\n * @param digest Digest of the organization user ID and secret\n * @param salt Salt used for computing the digest (optional)\n * @param expiration Expiration date as timestamp (to prevent replay attacks)\n */\n setUserWithHashAuthAndSetupUI: (\n id: string,\n algorithm: string,\n secretId: string,\n digest: string,\n salt?: string,\n expiration?: BigInt\n ): void => {\n if (expiration === undefined) {\n RNDidomi.setUserWithHashAuthAndSetupUI(\n id,\n algorithm,\n secretId,\n digest,\n salt\n );\n } else {\n RNDidomi.setUserWithHashAuthWithExpirationAndSetupUI(\n id,\n algorithm,\n secretId,\n digest,\n salt,\n expiration\n );\n }\n },\n\n /**\n * Set user information with Encryption authentication\n *\n * @param id Organization user ID\n * @param algorithm Algorithm used for computing the digest\n * @param secretId ID of the secret used for computing the digest\n * @param initializationVector Initialization Vector used for computing the user ID\n * @param expiration Expiration date as timestamp (to prevent replay attacks)\n */\n setUserWithEncryptionAuth: (\n id: string,\n algorithm: string,\n secretId: string,\n initializationVector: string,\n expiration?: BigInt\n ): void => {\n if (expiration === undefined) {\n RNDidomi.setUserWithEncryptionAuth(\n id,\n algorithm,\n secretId,\n initializationVector\n );\n } else {\n RNDidomi.setUserWithEncryptionAuthWithExpiration(\n id,\n algorithm,\n secretId,\n initializationVector,\n expiration\n );\n }\n },\n\n /**\n * Set user information with Encryption authentication and check for missing consent\n *\n * @param id Organization user ID\n * @param algorithm Algorithm used for computing the digest\n * @param secretId ID of the secret used for computing the digest\n * @param initializationVector Initialization Vector used for computing the user ID\n * @param expiration Expiration date as timestamp (to prevent replay attacks)\n */\n setUserWithEncryptionAuthAndSetupUI: (\n id: string,\n algorithm: string,\n secretId: string,\n initializationVector: string,\n expiration?: BigInt\n ): void => {\n if (expiration === undefined) {\n RNDidomi.setUserWithEncryptionAuthAndSetupUI(\n id,\n algorithm,\n secretId,\n initializationVector\n );\n } else {\n RNDidomi.setUserWithEncryptionAuthWithExpirationAndSetupUI(\n id,\n algorithm,\n secretId,\n initializationVector,\n expiration\n );\n }\n },\n\n /**\n * Show the consent notice (if required, not disabled in the config and not already displayed)\n */\n showNotice: (): Promise<void> => RNDidomi.showNotice(),\n\n /**\n * Show the preferences screen when/if the SDK is ready. By default the purposes list will be displayed.\n * @param view: It can be `purposes`, `vendors` or `senstive-personal-information`.\n */\n showPreferences: (view?: string): Promise<void> => RNDidomi.showPreferences(view),\n\n /**\n * Remove all consents for the user\n */\n reset: (): Promise<void> => RNDidomi.reset(),\n\n /**\n * Method that allows to enable consent and legitimate interest for all the required purposes.\n * @returns: **true** if consent status has been updated, **false** otherwise.\n */\n setUserAgreeToAll: (): Promise<boolean> => RNDidomi.setUserAgreeToAll(),\n\n /**\n * Set the user consent status.\n * @param enabledPurposeIds: set containing **enabled purpose ids**\n * @param disabledPurposeIds: set containing **disabled purpose ids**\n * @param enabledVendorIds: set containing **enabled vendor ids**\n * @param disabledVendorIds: set containing **disabled purpose ids**\n * @returns: **true** if consent status has been updated, **false** otherwise.\n */\n setUserConsentStatus: (\n enabledPurposeIds: string[],\n disabledPurposeIds: string[],\n enabledVendorIds: string[],\n disabledVendorIds: string[]\n ): Promise<boolean> =>\n RNDidomi.setUserConsentStatus(\n enabledPurposeIds,\n disabledPurposeIds,\n enabledVendorIds,\n disabledVendorIds\n ),\n\n /**\n * Method that allows to disable consent and legitimate interest for all the required purposes and vendors.\n * @returns: **true** if consent status has been updated, **false** otherwise.\n */\n setUserDisagreeToAll: (): Promise<boolean> => RNDidomi.setUserDisagreeToAll(),\n\n /**\n * Set user's choices for purposes and vendors for the current regulation.\n * @param currentUserStatus: instance of CurrentUserStatus containing the user's choices.\n * @returns: **true** if user status has been updated, **false** otherwise.\n */\n setCurrentUserStatus: (\n currentUserStatus: CurrentUserStatus\n ): Promise<boolean> => {\n const jsonString = JSON.stringify(currentUserStatus);\n return RNDidomi.setCurrentUserStatus(jsonString)\n },\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 * @deprecated use {@link #shouldUserStatusBeCollected()} instead.\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 /**\n * Creates a `CurrentUserStatusTransaction` object.\n * This object provides mechanisms to stage updates to the user status regarding purposes and vendors, allowing for batch operations. \n * Updates made through its methods are queued and applied simultaneously to the user status only once the commit method of the returned object is called.\n * @returns A new `CurrentUserStatusTransaction` object.\n */\n openCurrentUserStatusTransaction: (): CurrentUserStatusTransaction => createCurrentUserStatusTransaction(RNDidomi.commitCurrentUserStatusTransaction),\n};\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,cAAc;AAC5C,SAASC,cAAc,QAAQ,kBAAkB;AAEjD,SAASC,sBAAsB,EAAEC,cAAc,QAAQ,aAAa;AACpE,SAAuCC,kCAAkC,QAAQ,gCAAgC;AAEjH,MAAM;EAAEC,MAAM,EAAEC;AAAS,CAAC,GAAGN,aAAa;AAE1C,OAAO,MAAMK,MAAM,GAAG;EACpB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEE,UAAU,EAAEA,CACVC,MAAc,EACdC,sBAA+B,EAC/BC,sBAA+B,EAC/BC,UAAmB,EACnBC,yBAAkC,GAAG,KAAK,EAC1CC,YAAqB,EACrBC,QAAiB,EACjBC,iBAA0B,EAC1BC,g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ACA;AACA;EACEC,iBAAiB,EAAEA,CACjBC,wBAAkC,EAClCC,yBAAmC,EACnCC,mBAA6B,EAC7BC,oBAA8B,EAC9BC,uBAAiC,EACjCC,wBAAkC,EAClCC,kBAA4B,EAC5BC,mBAA6B,KAE7BvH,QAAQ,CAAC+G,iBAAiB,CACxBC,wBAAwB,EACxBC,yBAAyB,EACzBC,mBAAmB,EACnBC,oBAAoB,EACpBC,uBAAuB,EACvBC,wBAAwB,EACxBC,kBAAkB,EAClBC,mBACF,CAAC;EAEH;AACF;AACA;AACA;AACA;EACEC,wBAAwB,EAAEA,CAAA,KACxBxH,QAAQ,CAACwH,wBAAwB,CAAC,CAAC;EAErC;AACF;AACA;AACA;AACA;AACA;EACEC,sBAAsB,EAAGlH,YAAoB,IAC3CP,QAAQ,CAACyH,sBAAsB,CAAClH,YAAY,CAAC;EAE/C;AACF;AACA;AACA;AACA;AACA;EACEmH,gCAAgC,EAAEA,CAAA,KAAoC5H,kCAAkC,CAACE,QAAQ,CAAC2H,kCAAkC;AACtJ,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["NativeModules","DidomiListener","DIDOMI_USER_AGENT_NAME","DIDOMI_VERSION","createCurrentUserStatusTransaction","Didomi","RNDidomi","initialize","apiKey","localConfigurationPath","remoteConfigurationUrl","providerId","disableDidomiRemoteConfig","languageCode","noticeId","androidTvNoticeId","androidTvEnabled","countryCode","regionCode","init","onReady","promise","setOnReadyListener","onError","setOnErrorListener","setupUI","setLogLevel","level","addEventListener","eventType","callback","addVendorStatusListener","vendorId","listenToVendorStatus","removeVendorStatusListener","stopListeningToVendorStatus","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","getUserConsentStatusForVendorAndRequiredPurposes","getUserLegitimateInterestStatusForPurpose","getUserLegitimateInterestForVendor","getUserLegitimateInterestStatusForVendor","getUserLegitimateInterestStatusForVendorAndRequiredPurposes","getCurrentUserStatus","getUserStatus","getUserStatusForVendor","getVendor","hideNotice","hidePreferences","isConsentRequired","shouldUserStatusBeCollected","isUserConsentStatusPartial","isUserStatusPartial","isNoticeVisible","isPreferencesVisible","isError","isReady","clearUser","setUser","id","setUserAndSetupUI","setUserWithHashAuth","algorithm","secretId","digest","salt","expiration","undefined","setUserWithHashAuthWithExpiration","setUserWithHashAuthAndSetupUI","setUserWithHashAuthWithExpirationAndSetupUI","setUserWithEncryptionAuth","initializationVector","setUserWithEncryptionAuthWithExpiration","setUserWithEncryptionAuthAndSetupUI","setUserWithEncryptionAuthWithExpirationAndSetupUI","setUserWithAuthParams","userAuthParams","synchronizedUsers","JSON","stringify","setUserWithAuthParamsAndSetupUI","showNotice","showPreferences","view","setUserAgreeToAll","setUserConsentStatus","enabledPurposeIds","disabledPurposeIds","enabledVendorIds","disabledVendorIds","setUserDisagreeToAll","setCurrentUserStatus","currentUserStatus","jsonString","setUserStatus","purposesConsentStatus","purposesLIStatus","vendorsConsentStatus","vendorsLIStatus","setUserStatusSets","enabledConsentPurposeIds","disabledConsentPurposeIds","enabledLIPurposeIds","disabledLIPurposeIds","enabledConsentVendorIds","disabledConsentVendorIds","enabledLIVendorIds","disabledLIVendorIds","shouldConsentBeCollected","updateSelectedLanguage","openCurrentUserStatusTransaction","commitCurrentUserStatusTransaction"],"sources":["Didomi.ts"],"sourcesContent":["import { NativeModules } from 'react-native';\nimport { DidomiListener } from './DidomiListener';\nimport { DidomiEventType, Purpose, Vendor, UserStatus, CurrentUserStatus, VendorStatus, UserAuthParams } from './DidomiTypes';\nimport { DIDOMI_USER_AGENT_NAME, DIDOMI_VERSION } from './Constants';\nimport { CurrentUserStatusTransaction, createCurrentUserStatusTransaction } from './CurrentUserStatusTransaction';\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 remote 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 * @param androidTvNoticeId: Notice id for the remote configuration when running on Android TV device (ignored on iOS / tvOS). Note that using remote configuration is mandatory for TV devices.\n * @param androidTvEnabled: Whether to allow Didomi SDK to run on Android TV, default to \"false\".\n * @param countryCode: Override user country code when determining the privacy regulation to apply. Keep undefined to let the Didomi SDK determine the user country.\n * @param regionCode: Override user region code when determining the privacy regulation to apply. Keep undefined to let the Didomi SDK determine the user region. Ignored if countryCode is not set.\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 androidTvNoticeId?: string,\n androidTvEnabled: boolean = false,\n countryCode?: string,\n regionCode?: string,\n ): Promise<void> => {\n // Init listener\n DidomiListener.init();\n\n // Trigger native SDK init\n return RNDidomi.initialize(\n DIDOMI_USER_AGENT_NAME,\n DIDOMI_VERSION,\n apiKey,\n localConfigurationPath,\n remoteConfigurationUrl,\n providerId,\n disableDidomiRemoteConfig,\n languageCode,\n noticeId,\n androidTvNoticeId,\n androidTvEnabled,\n countryCode,\n regionCode\n );\n },\n\n /**\n * Listen to SDK ready state\n */\n onReady: (): Promise<void> => {\n var promise = DidomiListener.setOnReadyListener();\n RNDidomi.onReady();\n return promise;\n },\n\n /**\n * Listen to SDK errors\n */\n onError: (): Promise<void> => {\n var promise = DidomiListener.setOnErrorListener();\n RNDidomi.onError();\n return promise;\n },\n\n /**\n * Provide the objects required to display UI elements\n */\n setupUI: (): Promise<void> => RNDidomi.setupUI(),\n\n /**\n * Set the minimum level of messages to log\n * You can decide what level of messages should be logged by the SDK by calling the setLogLevel function before initialize\n *\n * Messages with a level below `minLevel` will not be logged.\n *\n * For iOS:\n * Levels are standard levels from `OSLogType` (https://developer.apple.com/documentation/os/logging/choosing_the_log_level_for_a_message):\n * - OSLogType.info (1)\n * - OSLogType.debug (2)\n * - OSLogType.error (16)\n * - OSLogType.fault (17)\n *\n * We recommend setting `OSLogType.error` (16) in production\n *\n * For Android:\n * Use the standard log levels supported by android.util.Log: VERBOSE, DEBUG, INFO, WARN and ERROR.\n * (https://developer.android.com/reference/android/util/Log#constants_1)\n *\n * We recommend setting `Log.INFO` (4) in production\n *\n * @param minLevel: Minimum level of messages to log\n */\n setLogLevel: (level: number): Promise<void> => RNDidomi.setLogLevel(level),\n\n /**\n * Add an event listener\n * @param listener:\n */\n addEventListener: (\n eventType: DidomiEventType,\n callback: (data: any) => void\n ) => DidomiListener.addEventListener(eventType, callback),\n\n /**\n * Add a listener to be triggered when the user status for the selected vendor changes\n * The callback will be registered after the SDK is ready\n * @param vendorId: the id of the vendor\n * @param callback: the callback to trigger when the user status for the selected vendor changes\n */\n addVendorStatusListener: (\n vendorId: string,\n callback: (vendorStatus: VendorStatus) => void\n ) => {\n RNDidomi.listenToVendorStatus(vendorId)\n DidomiListener.addVendorStatusListener(vendorId, callback);\n },\n\n /**\n * Remove one or multiple previously added vendor status listeners\n * @param vendorId the id of the vendor\n */\n removeVendorStatusListener: (vendorId: string) => {\n RNDidomi.stopListeningToVendorStatus(vendorId)\n DidomiListener.removeVendorStatusListener(vendorId);\n },\n\n /**\n * Remove an event listener\n * @param listener:\n */\n removeEventListener: (\n eventType: DidomiEventType,\n callback: (data: any) => void\n ) => DidomiListener.removeEventListener(eventType, callback),\n\n /**\n * Remove all event listeners\n */\n removeAllEventListeners: () => DidomiListener.reset(),\n\n /**\n * Method used to get an array of disabled purposes.\n * @returns: array of disabled purposes.\n * @deprecated use {@link #getUserStatus()} instead. The result of this method\n * has been replaced by getUserStatus().purposes.consent.disabled.\n */\n getDisabledPurposes: (): Promise<Purpose[]> => RNDidomi.getDisabledPurposes(),\n\n /**\n * Method used to get a set of disabled purpose IDs.\n * @returns: set that contains the IDs of disabled purposes.\n * @deprecated use {@link #getUserStatus()} instead. The result of this method\n * has been replaced by getUserStatus().purposes.consent.enabled.\n */\n getDisabledPurposeIds: (): Promise<string[]> => RNDidomi.getDisabledPurposeIds(),\n\n /**\n * Method used to get an array of disabled vendors.\n * @returns: array of disabled vendors.\n * @deprecated use {@link #getUserStatus()} instead. The result of this method\n * has been replaced by getUserStatus().vendors.consent.disabled.\n */\n getDisabledVendors: (): Promise<Vendor[]> => RNDidomi.getDisabledVendors(),\n\n /**\n * Method used to get a set of disabled vendor IDs.\n * @returns: set that contains the IDs of disabled vendors.\n * @deprecated use {@link #getUserStatus()} instead. The result of this method\n * has been replaced by getUserStatus().vendors.consent.disabled.\n */\n getDisabledVendorIds: (): Promise<string[]> => RNDidomi.getDisabledVendorIds(),\n\n /**\n * Method used to get an array of enabled purposes.\n * @returns: array of enabled purposes.\n * @deprecated use {@link #getUserStatus()} instead. The result of this method\n * has been replaced by getUserStatus().purposes.consent.enabled.\n */\n getEnabledPurposes: (): Promise<Purpose[]> => RNDidomi.getEnabledPurposes(),\n\n /**\n * Method used to get a set of enabled purpose IDs.\n * @returns: set that contains the IDs of enabled purposes.\n * @deprecated use {@link #getUserStatus()} instead. The result of this method\n * has been replaced by getUserStatus().purposes.consent.enabled.\n */\n getEnabledPurposeIds: (): Promise<string[]> => RNDidomi.getEnabledPurposeIds(),\n\n /**\n * Method used to get an array of enabled vendors.\n * @returns: array of enabled vendors.\n * @deprecated use {@link #getUserStatus()} instead. The result of this method\n * has been replaced by getUserStatus().vendors.consent.enabled.\n */\n getEnabledVendors: (): Promise<Vendor[]> => RNDidomi.getEnabledVendors(),\n\n /**\n * Method used to get a set of enabled vendor IDs.\n * @returns: set that contains the IDs of enabled vendors.\n * @deprecated use {@link #getUserStatus()} instead. The result of this method\n * has been replaced by getUserStatus().vendors.consent.enabled.\n */\n getEnabledVendorIds: (): Promise<string[]> => RNDidomi.getEnabledVendorIds(),\n\n /**\n * Get JavaScript to embed into a WebView to pass the consent status from the app\n * to the Didomi Web SDK embedded into the WebView\n * Inject the returned JavaScript into a WebView\n * @param extra: Extra JavaScript to inject in the returned code\n * @returns: JavaScript code to inject in a WebView\n */\n getJavaScriptForWebView: (extra?: string | null): Promise<string> => RNDidomi.getJavaScriptForWebView(extra),\n\n getQueryStringForWebView: (): Promise<string> => RNDidomi.getQueryStringForWebView(),\n\n /**\n * Method used to get a Purpose based on its ID.\n * @param purposeId: purpose ID used in the search.\n * @returns: purpose found in the array.\n */\n getPurpose: (purposeId: string): Promise<Purpose> => 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<Purpose[]> => RNDidomi.getRequiredPurposes(),\n\n /**\n * Get the configured purpose IDs\n * @returns: set of purpose IDs.\n */\n getRequiredPurposeIds: (): Promise<string[]> => RNDidomi.getRequiredPurposeIds(),\n\n /**\n * Method used to get an array of required vendors.\n * @returns: array of required vendors.\n */\n getRequiredVendors: (): Promise<Vendor[]> => RNDidomi.getRequiredVendors(),\n\n /**\n * Get the configured vendor IDs\n * @returns: set of vendor IDs.\n */\n getRequiredVendorIds: (): Promise<string[]> => RNDidomi.getRequiredVendorIds(),\n\n /**\n * Method used to get a dictionary/map in the form of { \"en\": \"Key in English\", \"fr\": \"Key in French.\" }\n * for a given key.\n * @param key: used to find its corresponding value in the dictionary/map.\n * @returns: dictionary containing the different translations for a given key.\n */\n getText: (key: string): Promise<any[]> => RNDidomi.getText(key),\n\n /**\n * Method used to get a translated text based on the key being passed.\n * The language and the source of this translated text will depend on the availability of the translation for the specific key.\n * The language being used will be either the selected language of the SDK (based on device Locale and other parameters) or the language specified by app developers as the default language being used by the SDK. The source can be either the `didomi_config.json` file which can be either local or remote, or the `didomi_master_config.json` file which is bundled within the SDK.\n *\n * These are the attempts performed by the SDK to try to find a translation for the specific key:\n * - Get translated value in user locale (selected language) from `didomi_config.json` (either local or remote).\n * - Get translated value in default locale (from the config) from `didomi_config.json` (either local or remote).\n * - Get translated value in user locale (selected language) from `didomi_master_config.json` (bundled within the Didomi SDK).\n * - Get translated value in default locale (from the config) from `didomi_master_config.json` (bundled within the Didomi SDK).\n *\n * If no translation can be found after these 4 attempts, the key will be returned.\n *\n * App developers can provide these translated texts through the `didomi_config.json` file (locally or remotely) in 3 different ways:\n * - Custom texts for the consent notice: https://developers.didomi.io/cmp/mobile-sdk/consent-notice/customize-the-notice#texts\n * - Custom texts for the preferences: https://developers.didomi.io/cmp/mobile-sdk/consent-notice/customize-the-preferences-popup#text\n * - Custom texts for custom notices: https://developers.didomi.io/cmp/mobile-sdk/consent-notice/customize-the-theme#translatable-texts-for-custom-notices\n *\n * @param key: used to find its corresponding value in one of the different sources.\n * @returns: a translated string if a translation was found, the same key that was passed otherwise.\n */\n getTranslatedText: (key: string): Promise<string> => RNDidomi.getTranslatedText(key),\n\n /**\n * Get the user consent status for a specific purpose\n * @param purposeId: The purpose ID to check consent for\n * @returns: The user consent status for the specified purpose\n * @deprecated use {@link #getUserStatus()} instead. Search the purposeId in\n * getUserStatus().purposes.consent.enabled or\n * getUserStatus().purposes.consent.enabled.\n */\n getUserConsentStatusForPurpose: (purposeId: string): Promise<boolean> => RNDidomi.getUserConsentStatusForPurpose(purposeId),\n\n /**\n * Get the user consent status for a specific vendor\n * @param vendorId: The vendor ID to check consent for\n * @returns: The user consent status for the specified vendor\n * @deprecated use {@link #getUserStatus()} instead. Search the vendorId in\n * getUserStatus().vendors.consent.enabled or\n * getUserStatus().vendors.consent.disabled.\n */\n getUserConsentStatusForVendor: (vendorId: string): Promise<boolean> => RNDidomi.getUserConsentStatusForVendor(vendorId),\n\n /**\n * Get the user consent status for a specific vendor and all its purposes\n * @param vendorId: The ID of the vendor\n * @returns: The user consent status corresponding to the specified vendor and all its required purposes.\n * @deprecated use {@link #getUserStatus()} instead. The result of this method has been replaced\n * by getUserStatus().vendors.global_consent.enabled or\n * getUserStatus().vendors.global_consent.disabled.\n */\n getUserConsentStatusForVendorAndRequiredPurposes: (vendorId: string): Promise<boolean> => RNDidomi.getUserConsentStatusForVendorAndRequiredPurposes(vendorId),\n\n /**\n * Get the user legitimate interest status for a specific purpose.\n * @param purposeId: purpose ID.\n * @returns: LI status of a purpose.\n * @deprecated use {@link #getUserStatus()} instead. Search the purposeId in\n * getUserStatus().purposes.consent.enabled or\n * getUserStatus().purposes.consent.enabled.\n */\n getUserLegitimateInterestStatusForPurpose: (purposeId: string): Promise<boolean> => RNDidomi.getUserLegitimateInterestStatusForPurpose(purposeId),\n\n /**\n * Get the user legitimate interest status for a specific vendor.\n * @param vendorId: vendor ID.\n * @returns: LI status of a vendor.\n * @deprecated use {@link #getUserStatus()} instead. Search the vendorId in\n * getUserStatus().vendors.legitimate_interest.enabled or\n * getUserStatus().vendors.legitimate_interest.disabled.\n */\n getUserLegitimateInterestForVendor: (vendorId: string): Promise<boolean> => RNDidomi.getUserLegitimateInterestStatusForVendor(vendorId),\n\n /**\n * Get the user LI status for a specific vendor and all its purposes.\n * @param vendorId: vendor ID.\n * @returns: The user LI status corresponding to the specified vendor and all its required purposes.\n * @deprecated use {@link #getUserStatus()} instead. Search the purposeId in\n * getUserStatus().vendors.global_legitimate_interest.enabled or\n * getUserStatus().vendors.global_legitimate_interest.disabled.\n */\n getUserLegitimateInterestStatusForVendorAndRequiredPurposes: (vendorId: string): boolean => RNDidomi.getUserLegitimateInterestStatusForVendorAndRequiredPurposes(vendorId),\n\n /**\n * Get the current user consent status.\n * @returns: status that represents current user consent.\n */\n getCurrentUserStatus: (): Promise<CurrentUserStatus> => RNDidomi.getCurrentUserStatus(),\n\n /**\n * Get the user consent status.\n * @returns: status that represents user consent.\n */\n getUserStatus: (): Promise<UserStatus> => 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().vendors.global.enabled or\n * getUserStatus().vendors.global.disabled.\n */\n getUserStatusForVendor: (vendorId: string): Promise<boolean> => RNDidomi.getUserStatusForVendor(vendorId),\n\n /**\n * Method used to get a Vendor based on its ID.\n * @param vendorId: vendor ID used in the search.\n * @returns: vendor found in the array.\n */\n getVendor: (vendorId: string): Promise<Vendor> => 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 user status should be collected for the user.\n * Returns **true** if user status is required for the current user and regulation, and one of the following two conditions is met:\n * - User status has never been collected for this user yet\n * - New user status should be collected (as new vendors have been added) AND the number of days before recollecting them has exceeded\n * @returns: **true** if user status should be collected according to these rules, **false** otherwise.\n */\n shouldUserStatusBeCollected: (): Promise<boolean> => RNDidomi.shouldUserStatusBeCollected(),\n\n /**\n * Determine if consent information is available for all purposes and vendors that are required\n * @returns: **true** if consent is required and consent information is available, **false** otherwise.\n */\n isUserConsentStatusPartial: (): Promise<boolean> => RNDidomi.isUserConsentStatusPartial(),\n\n /**\n * Determine if user did not express a choice for any purpose or vendor that is required\n * @returns: **true** if user choice is required and a choice is not expressed, **false** otherwise.\n */\n isUserStatusPartial: (): Promise<boolean> => RNDidomi.isUserStatusPartial(),\n\n /**\n * Check if the consent notice is currently displayed\n * @returns: **true** if the notice is displayed, **false** if is not.\n */\n isNoticeVisible: (): Promise<boolean> => RNDidomi.isNoticeVisible(),\n\n /**\n * Method used to check if the Preferences view is visible.\n * @returns: **true** if Preferences view is visible, **false** otherwise.\n */\n isPreferencesVisible: (): Promise<boolean> => RNDidomi.isPreferencesVisible(),\n\n isError: (): Promise<boolean> => RNDidomi.isError(),\n\n /**\n * Is the Didomi SDK ready?\n */\n isReady: (): Promise<boolean> => RNDidomi.isReady(),\n\n /**\n * Clear user information\n */\n clearUser: (): Promise<void> => RNDidomi.clearUser(),\n\n /**\n * Set user information without authentication\n *\n * @param id Organization user ID\n */\n setUser: (id: string): Promise<void> => RNDidomi.setUser(id),\n\n /**\n * Set user information without authentication and check for missing consent\n *\n * @param id Organization user ID\n */\n setUserAndSetupUI: (id: string): Promise<void> => RNDidomi.setUserAndSetupUI(id),\n\n /**\n * Set user information with Hash authentication\n *\n * @param id Organization user ID\n * @param algorithm Algorithm used for computing the digest\n * @param secretId ID of the secret used for computing the digest\n * @param digest Digest of the organization user ID and secret\n * @param salt Salt used for computing the digest (optional)\n * @param expiration Expiration date as timestamp (to prevent replay attacks)\n * @deprecated use {@link #setUserWithAuthParams()} instead.\n */\n setUserWithHashAuth: (\n id: string,\n algorithm: string,\n secretId: string,\n digest: string,\n salt?: string,\n expiration?: BigInt\n ): void => {\n if (expiration === undefined) {\n RNDidomi.setUserWithHashAuth(\n id,\n algorithm,\n secretId,\n digest,\n salt\n );\n } else {\n RNDidomi.setUserWithHashAuthWithExpiration(\n id,\n algorithm,\n secretId,\n digest,\n salt,\n expiration\n );\n }\n },\n\n /**\n * Set user information with Hash authentication and check for missing consent\n *\n * @param id Organization user ID\n * @param algorithm Algorithm used for computing the digest\n * @param secretId ID of the secret used for computing the digest\n * @param digest Digest of the organization user ID and secret\n * @param salt Salt used for computing the digest (optional)\n * @param expiration Expiration date as timestamp (to prevent replay attacks)\n * @deprecated use {@link #setUserWithAuthParamsAndSetupUI()} instead.\n */\n setUserWithHashAuthAndSetupUI: (\n id: string,\n algorithm: string,\n secretId: string,\n digest: string,\n salt?: string,\n expiration?: BigInt\n ): void => {\n if (expiration === undefined) {\n RNDidomi.setUserWithHashAuthAndSetupUI(\n id,\n algorithm,\n secretId,\n digest,\n salt\n );\n } else {\n RNDidomi.setUserWithHashAuthWithExpirationAndSetupUI(\n id,\n algorithm,\n secretId,\n digest,\n salt,\n expiration\n );\n }\n },\n\n /**\n * Set user information with Encryption authentication\n *\n * @param id Organization user ID\n * @param algorithm Algorithm used for computing the digest\n * @param secretId ID of the secret used for computing the digest\n * @param initializationVector Initialization Vector used for computing the user ID\n * @param expiration Expiration date as timestamp (to prevent replay attacks)\n * @deprecated use {@link #setUserWithAuthParams()} instead.\n */\n setUserWithEncryptionAuth: (\n id: string,\n algorithm: string,\n secretId: string,\n initializationVector: string,\n expiration?: BigInt\n ): void => {\n if (expiration === undefined) {\n RNDidomi.setUserWithEncryptionAuth(\n id,\n algorithm,\n secretId,\n initializationVector\n );\n } else {\n RNDidomi.setUserWithEncryptionAuthWithExpiration(\n id,\n algorithm,\n secretId,\n initializationVector,\n expiration\n );\n }\n },\n\n /**\n * Set user information with Encryption authentication and check for missing consent\n *\n * @param id Organization user ID\n * @param algorithm Algorithm used for computing the digest\n * @param secretId ID of the secret used for computing the digest\n * @param initializationVector Initialization Vector used for computing the user ID\n * @param expiration Expiration date as timestamp (to prevent replay attacks)\n * @deprecated use {@link #setUserWithAuthParamsAndSetupUI()} instead.\n */\n setUserWithEncryptionAuthAndSetupUI: (\n id: string,\n algorithm: string,\n secretId: string,\n initializationVector: string,\n expiration?: BigInt\n ): void => {\n if (expiration === undefined) {\n RNDidomi.setUserWithEncryptionAuthAndSetupUI(\n id,\n algorithm,\n secretId,\n initializationVector\n );\n } else {\n RNDidomi.setUserWithEncryptionAuthWithExpirationAndSetupUI(\n id,\n algorithm,\n secretId,\n initializationVector,\n expiration\n );\n }\n },\n\n /**\n * Set user information with authentication (Hash or Encryption)\n *\n * @param userAuthParams as UserAuthParams (use UserAuthWithEncryptionParams or UserAuthWithHashParams)\n * @param synchronizedUsers as UserAuthParams[] (optional)\n */\n setUserWithAuthParams: (\n userAuthParams: UserAuthParams,\n synchronizedUsers?: UserAuthParams[] | undefined\n ): void => RNDidomi.setUserWithAuthParams(JSON.stringify(userAuthParams), JSON.stringify(synchronizedUsers)),\n\n /**\n * Set user information with authentication (Hash or Encryption) and check for missing consent\n *\n * @param userAuthParams as UserAuthParams (use UserAuthWithEncryptionParams or UserAuthWithHashParams)\n * @param synchronizedUsers as UserAuthParams[] (optional)\n */\n setUserWithAuthParamsAndSetupUI: (\n userAuthParams: UserAuthParams,\n synchronizedUsers?: UserAuthParams[] | undefined\n ): void => RNDidomi.setUserWithAuthParamsAndSetupUI(JSON.stringify(userAuthParams), JSON.stringify(synchronizedUsers)),\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`, `vendors` or `senstive-personal-information`.\n */\n showPreferences: (view?: string): Promise<void> => RNDidomi.showPreferences(view),\n\n /**\n * Remove all consents for the user\n */\n reset: (): Promise<void> => RNDidomi.reset(),\n\n /**\n * Method that allows to enable consent and legitimate interest for all the required purposes.\n * @returns: **true** if consent status has been updated, **false** otherwise.\n */\n setUserAgreeToAll: (): Promise<boolean> => RNDidomi.setUserAgreeToAll(),\n\n /**\n * Set the user consent status.\n * @param enabledPurposeIds: set containing **enabled purpose ids**\n * @param disabledPurposeIds: set containing **disabled purpose ids**\n * @param enabledVendorIds: set containing **enabled vendor ids**\n * @param disabledVendorIds: set containing **disabled purpose ids**\n * @returns: **true** if consent status has been updated, **false** otherwise.\n */\n setUserConsentStatus: (\n enabledPurposeIds: string[],\n disabledPurposeIds: string[],\n enabledVendorIds: string[],\n disabledVendorIds: string[]\n ): Promise<boolean> =>\n RNDidomi.setUserConsentStatus(\n enabledPurposeIds,\n disabledPurposeIds,\n enabledVendorIds,\n disabledVendorIds\n ),\n\n /**\n * Method that allows to disable consent and legitimate interest for all the required purposes and vendors.\n * @returns: **true** if consent status has been updated, **false** otherwise.\n */\n setUserDisagreeToAll: (): Promise<boolean> => RNDidomi.setUserDisagreeToAll(),\n\n /**\n * Set user's choices for purposes and vendors for the current regulation.\n * @param currentUserStatus: instance of CurrentUserStatus containing the user's choices.\n * @returns: **true** if user status has been updated, **false** otherwise.\n */\n setCurrentUserStatus: (\n currentUserStatus: CurrentUserStatus\n ): Promise<boolean> => {\n const jsonString = JSON.stringify(currentUserStatus);\n return RNDidomi.setCurrentUserStatus(jsonString)\n },\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 * @deprecated use {@link #shouldUserStatusBeCollected()} instead.\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 /**\n * Creates a `CurrentUserStatusTransaction` object.\n * This object provides mechanisms to stage updates to the user status regarding purposes and vendors, allowing for batch operations. \n * Updates made through its methods are queued and applied simultaneously to the user status only once the commit method of the returned object is called.\n * @returns A new `CurrentUserStatusTransaction` object.\n */\n openCurrentUserStatusTransaction: (): CurrentUserStatusTransaction => createCurrentUserStatusTransaction(RNDid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AAyB,EACzBC,mBAAmB,EACnBC,oBAAoB,EACpBC,uBAAuB,EACvBC,wBAAwB,EACxBC,kBAAkB,EAClBC,mBACF,CAAC;EAEH;AACF;AACA;AACA;AACA;EACEC,wBAAwB,EAAEA,CAAA,KACxB9H,QAAQ,CAAC8H,wBAAwB,CAAC,CAAC;EAErC;AACF;AACA;AACA;AACA;AACA;EACEC,sBAAsB,EAAGxH,YAAoB,IAC3CP,QAAQ,CAAC+H,sBAAsB,CAACxH,YAAY,CAAC;EAE/C;AACF;AACA;AACA;AACA;AACA;EACEyH,gCAAgC,EAAEA,CAAA,KAAoClI,kCAAkC,CAACE,QAAQ,CAACiI,kCAAkC;AACtJ,CAAC","ignoreList":[]}
|
|
@@ -20,10 +20,21 @@ export const DidomiListener = {
|
|
|
20
20
|
DidomiListener.eventEmitter.removeAllListeners(eventTypeValue);
|
|
21
21
|
DidomiListener.eventEmitter.addListener(eventTypeValue, _event => {
|
|
22
22
|
let events = DidomiListener.listeners.get(eventTypeValue);
|
|
23
|
-
if (events) {
|
|
23
|
+
if (events && events.length > 0) {
|
|
24
|
+
if (eventTypeValue == "on_sync_ready") {
|
|
25
|
+
_event.syncAcknowledged = () => {
|
|
26
|
+
return RNDidomi.syncAcknowledged(_event.syncAcknowledgedIndex);
|
|
27
|
+
};
|
|
28
|
+
}
|
|
24
29
|
events.forEach(el => {
|
|
25
30
|
el(_event);
|
|
26
31
|
});
|
|
32
|
+
} else {
|
|
33
|
+
// No listener for this event type
|
|
34
|
+
if (eventTypeValue == "on_sync_ready") {
|
|
35
|
+
// We can remove syncAcknowledgedCallback as it will never be called
|
|
36
|
+
RNDidomi.removeSyncAcknowledgedCallback(_event.syncAcknowledgedIndex);
|
|
37
|
+
}
|
|
27
38
|
}
|
|
28
39
|
});
|
|
29
40
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeModules","NativeEventEmitter","DidomiEventType","Didomi","RNDidomi","InternalEventType","DidomiListener","listeners","Map","vendorStatusListeners","eventEmitter","init","Object","values","forEach","eventTypeValue","removeAllListeners","addListener","_event","events","get","el","reset","addEventListener","eventType","callback","set","push","removeEventListener","index","indexOf","splice","setOnReadyListener","Promise","resolve","subscription","listener","remove","removeListener","READY_CALLBACK","setOnErrorListener","ERROR_CALLBACK","addVendorStatusListener","vendorId","VENDOR_STATUS_CHANGE_PREFIX","removeVendorStatusListener","undefined"],"sources":["DidomiListener.ts"],"sourcesContent":["import { NativeModules, NativeEventEmitter, EmitterSubscription } from 'react-native';\nimport { DidomiEventType, VendorStatus } from './DidomiTypes';\n\nconst { Didomi: RNDidomi } = NativeModules;\n\nenum InternalEventType {\n READY_CALLBACK = 'on_ready_callback',\n ERROR_CALLBACK = 'on_error_callback',\n VENDOR_STATUS_CHANGE_PREFIX = 'on_vendor_status_change_',\n}\n\nexport const DidomiListener = {\n listeners: new Map(),\n vendorStatusListeners: new Map(),\n eventEmitter: new NativeEventEmitter(RNDidomi),\n\n init: () => {\n // Register all native event listeners\n Object.values(DidomiEventType).forEach((eventTypeValue) => {\n // Remove previous listeners, as init() can be called several times in some configs\n DidomiListener.eventEmitter.removeAllListeners(eventTypeValue);\n DidomiListener.eventEmitter.addListener(eventTypeValue, (_event: any) => {\n let events = DidomiListener.listeners.get(eventTypeValue);\n if (events) {\n events.forEach((el: any) => {\n el(_event);\n });\n }\n });\n });\n },\n\n reset: () => {\n // Reset listeners\n DidomiListener.listeners = new Map();\n },\n\n addEventListener: (\n eventType: DidomiEventType,\n callback: (data: any) => void\n ) => {\n let events = DidomiListener.listeners.get(eventType);\n if (!events) {\n events = [];\n DidomiListener.listeners.set(eventType, events);\n }\n events.push(callback);\n },\n\n removeEventListener: (\n eventType: DidomiEventType,\n callback: (data: any) => void\n ) => {\n let events = DidomiListener.listeners.get(eventType);\n if (events) {\n var index = events.indexOf(callback);\n if (index !== -1) {\n events.splice(index, 1);\n }\n }\n },\n\n setOnReadyListener: (): Promise<void> => {\n return new Promise<void>((resolve) => {\n let subscription: EmitterSubscription;\n const listener = (_event: any) => {\n resolve();\n if (subscription) {\n subscription.remove();\n } else if ('removeListener' in DidomiListener.eventEmitter) {\n DidomiListener.eventEmitter.removeListener(\n InternalEventType.READY_CALLBACK,\n listener\n );\n }\n };\n subscription = DidomiListener.eventEmitter.addListener(\n InternalEventType.READY_CALLBACK,\n listener\n );\n });\n },\n\n setOnErrorListener: (): Promise<void> => {\n return new Promise<void>((resolve) => {\n let subscription: EmitterSubscription;\n const listener = (_event: any) => {\n resolve(_event);\n if (subscription) {\n subscription.remove();\n } else if ('removeListener' in DidomiListener.eventEmitter) {\n DidomiListener.eventEmitter.removeListener(\n InternalEventType.ERROR_CALLBACK,\n listener\n );\n }\n };\n subscription = DidomiListener.eventEmitter.addListener(\n InternalEventType.ERROR_CALLBACK,\n listener\n );\n });\n },\n\n addVendorStatusListener: (\n vendorId: string,\n callback: (vendorStatus: VendorStatus) => void\n ) => {\n let events = DidomiListener.vendorStatusListeners.get(vendorId);\n if (!events) {\n events = [];\n DidomiListener.vendorStatusListeners.set(vendorId, events);\n\n DidomiListener.eventEmitter.addListener(InternalEventType.VENDOR_STATUS_CHANGE_PREFIX + vendorId, (_event: any) => {\n let events = DidomiListener.vendorStatusListeners.get(vendorId);\n if (events) {\n events.forEach((el: any) => {\n el(_event);\n });\n }\n });\n }\n events.push(callback);\n },\n\n removeVendorStatusListener: (vendorId: string) => {\n let events = DidomiListener.vendorStatusListeners.get(vendorId);\n if (events) {\n DidomiListener.eventEmitter.removeAllListeners(InternalEventType.VENDOR_STATUS_CHANGE_PREFIX + vendorId);\n DidomiListener.vendorStatusListeners.set(vendorId, undefined);\n }\n },\n};\n"],"mappings":"AAAA,SAASA,aAAa,EAAEC,kBAAkB,QAA6B,cAAc;AACrF,SAASC,eAAe,QAAsB,eAAe;AAE7D,MAAM;EAAEC,MAAM,EAAEC;AAAS,CAAC,GAAGJ,aAAa;AAAC,IAEtCK,iBAAiB,0BAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA,EAAjBA,iBAAiB;AAMtB,OAAO,MAAMC,cAAc,GAAG;EAC5BC,SAAS,EAAE,IAAIC,GAAG,CAAC,CAAC;EACpBC,qBAAqB,EAAE,IAAID,GAAG,CAAC,CAAC;EAChCE,YAAY,EAAE,IAAIT,kBAAkB,CAACG,QAAQ,CAAC;EAE9CO,IAAI,EAAEA,CAAA,KAAM;IACV;IACAC,MAAM,CAACC,MAAM,CAACX,eAAe,CAAC,CAACY,OAAO,CAAEC,cAAc,IAAK;MACzD;MACAT,cAAc,CAACI,YAAY,CAACM,kBAAkB,CAACD,cAAc,CAAC;MAC9DT,cAAc,CAACI,YAAY,CAACO,WAAW,CAACF,cAAc,EAAGG,MAAW,IAAK;QACvE,IAAIC,MAAM,GAAGb,cAAc,CAACC,SAAS,CAACa,GAAG,CAACL,cAAc,CAAC;QACzD,IAAII,MAAM,EAAE;
|
|
1
|
+
{"version":3,"names":["NativeModules","NativeEventEmitter","DidomiEventType","Didomi","RNDidomi","InternalEventType","DidomiListener","listeners","Map","vendorStatusListeners","eventEmitter","init","Object","values","forEach","eventTypeValue","removeAllListeners","addListener","_event","events","get","length","syncAcknowledged","syncAcknowledgedIndex","el","removeSyncAcknowledgedCallback","reset","addEventListener","eventType","callback","set","push","removeEventListener","index","indexOf","splice","setOnReadyListener","Promise","resolve","subscription","listener","remove","removeListener","READY_CALLBACK","setOnErrorListener","ERROR_CALLBACK","addVendorStatusListener","vendorId","VENDOR_STATUS_CHANGE_PREFIX","removeVendorStatusListener","undefined"],"sources":["DidomiListener.ts"],"sourcesContent":["import { NativeModules, NativeEventEmitter, EmitterSubscription } from 'react-native';\nimport { DidomiEventType, VendorStatus } from './DidomiTypes';\n\nconst { Didomi: RNDidomi } = NativeModules;\n\nenum InternalEventType {\n READY_CALLBACK = 'on_ready_callback',\n ERROR_CALLBACK = 'on_error_callback',\n VENDOR_STATUS_CHANGE_PREFIX = 'on_vendor_status_change_',\n}\n\nexport const DidomiListener = {\n listeners: new Map(),\n vendorStatusListeners: new Map(),\n eventEmitter: new NativeEventEmitter(RNDidomi),\n\n init: () => {\n // Register all native event listeners\n Object.values(DidomiEventType).forEach((eventTypeValue) => {\n // Remove previous listeners, as init() can be called several times in some configs\n DidomiListener.eventEmitter.removeAllListeners(eventTypeValue);\n DidomiListener.eventEmitter.addListener(eventTypeValue, (_event: any) => {\n let events = DidomiListener.listeners.get(eventTypeValue);\n if (events && events.length > 0) {\n if (eventTypeValue == \"on_sync_ready\") {\n _event.syncAcknowledged = (): Promise<boolean> => { \n return RNDidomi.syncAcknowledged(_event.syncAcknowledgedIndex)\n }\n }\n events.forEach((el: any) => {\n el(_event);\n });\n } else { // No listener for this event type\n if (eventTypeValue == \"on_sync_ready\") { \n // We can remove syncAcknowledgedCallback as it will never be called\n RNDidomi.removeSyncAcknowledgedCallback(_event.syncAcknowledgedIndex);\n }\n }\n });\n });\n },\n\n reset: () => {\n // Reset listeners\n DidomiListener.listeners = new Map();\n },\n\n addEventListener: (\n eventType: DidomiEventType,\n callback: (data: any) => void\n ) => {\n let events = DidomiListener.listeners.get(eventType);\n if (!events) {\n events = [];\n DidomiListener.listeners.set(eventType, events);\n }\n events.push(callback);\n },\n\n removeEventListener: (\n eventType: DidomiEventType,\n callback: (data: any) => void\n ) => {\n let events = DidomiListener.listeners.get(eventType);\n if (events) {\n var index = events.indexOf(callback);\n if (index !== -1) {\n events.splice(index, 1);\n }\n }\n },\n\n setOnReadyListener: (): Promise<void> => {\n return new Promise<void>((resolve) => {\n let subscription: EmitterSubscription;\n const listener = (_event: any) => {\n resolve();\n if (subscription) {\n subscription.remove();\n } else if ('removeListener' in DidomiListener.eventEmitter) {\n DidomiListener.eventEmitter.removeListener(\n InternalEventType.READY_CALLBACK,\n listener\n );\n }\n };\n subscription = DidomiListener.eventEmitter.addListener(\n InternalEventType.READY_CALLBACK,\n listener\n );\n });\n },\n\n setOnErrorListener: (): Promise<void> => {\n return new Promise<void>((resolve) => {\n let subscription: EmitterSubscription;\n const listener = (_event: any) => {\n resolve(_event);\n if (subscription) {\n subscription.remove();\n } else if ('removeListener' in DidomiListener.eventEmitter) {\n DidomiListener.eventEmitter.removeListener(\n InternalEventType.ERROR_CALLBACK,\n listener\n );\n }\n };\n subscription = DidomiListener.eventEmitter.addListener(\n InternalEventType.ERROR_CALLBACK,\n listener\n );\n });\n },\n\n addVendorStatusListener: (\n vendorId: string,\n callback: (vendorStatus: VendorStatus) => void\n ) => {\n let events = DidomiListener.vendorStatusListeners.get(vendorId);\n if (!events) {\n events = [];\n DidomiListener.vendorStatusListeners.set(vendorId, events);\n\n DidomiListener.eventEmitter.addListener(InternalEventType.VENDOR_STATUS_CHANGE_PREFIX + vendorId, (_event: any) => {\n let events = DidomiListener.vendorStatusListeners.get(vendorId);\n if (events) {\n events.forEach((el: any) => {\n el(_event);\n });\n }\n });\n }\n events.push(callback);\n },\n\n removeVendorStatusListener: (vendorId: string) => {\n let events = DidomiListener.vendorStatusListeners.get(vendorId);\n if (events) {\n DidomiListener.eventEmitter.removeAllListeners(InternalEventType.VENDOR_STATUS_CHANGE_PREFIX + vendorId);\n DidomiListener.vendorStatusListeners.set(vendorId, undefined);\n }\n },\n};\n"],"mappings":"AAAA,SAASA,aAAa,EAAEC,kBAAkB,QAA6B,cAAc;AACrF,SAASC,eAAe,QAAsB,eAAe;AAE7D,MAAM;EAAEC,MAAM,EAAEC;AAAS,CAAC,GAAGJ,aAAa;AAAC,IAEtCK,iBAAiB,0BAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA,EAAjBA,iBAAiB;AAMtB,OAAO,MAAMC,cAAc,GAAG;EAC5BC,SAAS,EAAE,IAAIC,GAAG,CAAC,CAAC;EACpBC,qBAAqB,EAAE,IAAID,GAAG,CAAC,CAAC;EAChCE,YAAY,EAAE,IAAIT,kBAAkB,CAACG,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9 @@ export let DidomiEventType = /*#__PURE__*/function (DidomiEventType) {
|
|
|
36
36
|
DidomiEventType["PREFERENCES_CLICK_SPI_CATEGORY_AGREE"] = "on_preferences_click_spi_category_agree";
|
|
37
37
|
DidomiEventType["PREFERENCES_CLICK_SPI_CATEGORY_DISAGREE"] = "on_preferences_click_spi_category_disagree";
|
|
38
38
|
DidomiEventType["PREFERENCES_CLICK_SPI_PURPOSE_SAVE_CHOICES"] = "on_preferences_click_spi_purpose_save_choices";
|
|
39
|
-
DidomiEventType["
|
|
39
|
+
DidomiEventType["SYNC_READY"] = "on_sync_ready";
|
|
40
40
|
DidomiEventType["SYNC_ERROR"] = "on_sync_error";
|
|
41
|
+
DidomiEventType["SYNC_DONE"] = "on_sync_done";
|
|
41
42
|
DidomiEventType["LANGUAGE_UPDATED"] = "on_language_updated";
|
|
42
43
|
DidomiEventType["LANGUAGE_UPDATE_FAILED"] = "on_language_update_failed";
|
|
43
44
|
return DidomiEventType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DidomiEventType"],"sources":["DidomiTypes.ts"],"sourcesContent":["// TODO\nexport enum DidomiEventType {\n // Consent\n CONSENT_CHANGED = \"on_consent_changed\",\n // SDK lifecycle events\n ERROR = \"on_error\",\n READY = \"on_ready\",\n // Notice\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_VIEW_VENDORS = \"on_notice_click_view_vendors\",\n NOTICE_CLICK_VIEW_SPI_PURPOSES = \"on_notice_click_view_spi_purposes\",\n NOTICE_CLICK_MORE_INFO = \"on_notice_click_more_info\",\n NOTICE_CLICK_PRIVACY_POLICY = \"on_notice_click_privacy_policy\",\n // Preferences\n HIDE_PREFERENCES = \"on_hide_preferences\",\n SHOW_PREFERENCES = \"on_show_preferences\",\n // Preferences - Views\n PREFERENCES_CLICK_VIEW_PURPOSES = \"on_preferences_click_view_purposes\",\n PREFERENCES_CLICK_VIEW_VENDORS = \"on_preferences_click_view_vendors\",\n PREFERENCES_CLICK_VIEW_SPI_PURPOSES = \"on_preferences_click_view_spi_purposes\",\n // Preferences - Purpose\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_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 PREFERENCES_CLICK_PURPOSE_AGREE = \"on_preferences_click_purpose_agree\",\n PREFERENCES_CLICK_PURPOSE_DISAGREE = \"on_preferences_click_purpose_disagree\",\n PREFERENCES_CLICK_CATEGORY_AGREE = \"on_preferences_click_category_agree\",\n PREFERENCES_CLICK_CATEGORY_DISAGREE = \"on_preferences_click_category_disagree\",\n PREFERENCES_CLICK_SAVE_CHOICES = \"on_preferences_click_save_choices\",\n // Preferences - Vendor\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_AGREE = \"on_preferences_click_vendor_agree\",\n PREFERENCES_CLICK_VENDOR_DISAGREE = \"on_preferences_click_vendor_disagree\",\n PREFERENCES_CLICK_VENDOR_SAVE_CHOICES = \"on_preferences_click_vendor_save_choices\",\n // Preferences - Sensitive Personal Information\n PREFERENCES_CLICK_SPI_PURPOSE_AGREE = \"on_preferences_click_spi_purpose_agree\",\n PREFERENCES_CLICK_SPI_PURPOSE_DISAGREE = \"on_preferences_click_spi_purpose_disagree\",\n PREFERENCES_CLICK_SPI_CATEGORY_AGREE = \"on_preferences_click_spi_category_agree\",\n PREFERENCES_CLICK_SPI_CATEGORY_DISAGREE = \"on_preferences_click_spi_category_disagree\",\n PREFERENCES_CLICK_SPI_PURPOSE_SAVE_CHOICES = \"on_preferences_click_spi_purpose_save_choices\",\n // Sync\n
|
|
1
|
+
{"version":3,"names":["DidomiEventType"],"sources":["DidomiTypes.ts"],"sourcesContent":["// TODO\nexport enum DidomiEventType {\n // Consent\n CONSENT_CHANGED = \"on_consent_changed\",\n // SDK lifecycle events\n ERROR = \"on_error\",\n READY = \"on_ready\",\n // Notice\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_VIEW_VENDORS = \"on_notice_click_view_vendors\",\n NOTICE_CLICK_VIEW_SPI_PURPOSES = \"on_notice_click_view_spi_purposes\",\n NOTICE_CLICK_MORE_INFO = \"on_notice_click_more_info\",\n NOTICE_CLICK_PRIVACY_POLICY = \"on_notice_click_privacy_policy\",\n // Preferences\n HIDE_PREFERENCES = \"on_hide_preferences\",\n SHOW_PREFERENCES = \"on_show_preferences\",\n // Preferences - Views\n PREFERENCES_CLICK_VIEW_PURPOSES = \"on_preferences_click_view_purposes\",\n PREFERENCES_CLICK_VIEW_VENDORS = \"on_preferences_click_view_vendors\",\n PREFERENCES_CLICK_VIEW_SPI_PURPOSES = \"on_preferences_click_view_spi_purposes\",\n // Preferences - Purpose\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_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 PREFERENCES_CLICK_PURPOSE_AGREE = \"on_preferences_click_purpose_agree\",\n PREFERENCES_CLICK_PURPOSE_DISAGREE = \"on_preferences_click_purpose_disagree\",\n PREFERENCES_CLICK_CATEGORY_AGREE = \"on_preferences_click_category_agree\",\n PREFERENCES_CLICK_CATEGORY_DISAGREE = \"on_preferences_click_category_disagree\",\n PREFERENCES_CLICK_SAVE_CHOICES = \"on_preferences_click_save_choices\",\n // Preferences - Vendor\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_AGREE = \"on_preferences_click_vendor_agree\",\n PREFERENCES_CLICK_VENDOR_DISAGREE = \"on_preferences_click_vendor_disagree\",\n PREFERENCES_CLICK_VENDOR_SAVE_CHOICES = \"on_preferences_click_vendor_save_choices\",\n // Preferences - Sensitive Personal Information\n PREFERENCES_CLICK_SPI_PURPOSE_AGREE = \"on_preferences_click_spi_purpose_agree\",\n PREFERENCES_CLICK_SPI_PURPOSE_DISAGREE = \"on_preferences_click_spi_purpose_disagree\",\n PREFERENCES_CLICK_SPI_CATEGORY_AGREE = \"on_preferences_click_spi_category_agree\",\n PREFERENCES_CLICK_SPI_CATEGORY_DISAGREE = \"on_preferences_click_spi_category_disagree\",\n PREFERENCES_CLICK_SPI_PURPOSE_SAVE_CHOICES = \"on_preferences_click_spi_purpose_save_choices\",\n // Sync\n SYNC_READY = \"on_sync_ready\",\n SYNC_ERROR = \"on_sync_error\",\n // @deprecated use {@link #SYNC_READY} instead.\n SYNC_DONE = \"on_sync_done\",\n // Language\n LANGUAGE_UPDATED = \"on_language_updated\",\n LANGUAGE_UPDATE_FAILED = \"on_language_update_failed\",\n}\n\nexport interface Vendor {\n id: string;\n name: string;\n namespaces: VendorNamespaces;\n policyUrl: string;\n purposeIds: string[];\n flexibleIds: string[];\n legIntPurposeIds: string[];\n flexiblePurposeIds: string[];\n specialFeatureIds: string[];\n specialPurposeIds: string[];\n urls: VendorUrls[];\n}\n\nexport interface VendorNamespaces {\n iab2: string;\n}\n\nexport interface VendorUrls {\n privacy: string;\n legIntClaim: string;\n langId: string;\n}\n\nexport interface VendorDataRetention {\n stdRetention: number;\n purposes: Map<number>;\n specialPurposes: Map<number>;\n}\n\nexport interface Purpose {\n id: string;\n name: string;\n description: string;\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 user_id: string;\n created: string;\n updated: string;\n consent_string: string;\n additional_consent: string;\n didomi_dcs: string;\n regulation: string;\n}\n\nexport interface UserStatusPurposes {\n global: UserStatusIds;\n consent: UserStatusIds;\n legitimate_interest: UserStatusIds;\n essential: UserStatusIds;\n}\n\nexport interface UserStatusVendors {\n global: UserStatusIds;\n global_consent: UserStatusIds;\n global_legitimate_interest: UserStatusIds;\n consent: UserStatusIds;\n legitimate_interest: UserStatusIds;\n}\n\nexport interface UserStatusIds {\n disabled: string[];\n enabled: string[];\n}\n\nexport interface CurrentUserStatus {\n purposes: Map<PurposeStatus>;\n vendors: Map<VendorStatus>;\n user_id: string;\n created: string;\n updated: string;\n consent_string: string;\n addtl_consent: string;\n didomi_dcs: string;\n regulation: string;\n}\n\nexport interface PurposeStatus {\n id: string;\n enabled: boolean;\n}\n\nexport interface VendorStatus {\n id: string;\n enabled: boolean;\n}\n\nexport interface SyncReadyEvent {\n statusApplied: boolean;\n syncAcknowledged: () => Promise<boolean>;\n}\n\nexport interface UserAuthParams {\n id: string;\n algorithm: string;\n secretId: string;\n expiration?: number;\n}\n\nexport interface UserAuthWithEncryptionParams extends UserAuthParams {\n initializationVector: string;\n}\n\nexport interface UserAuthWithHashParams extends UserAuthParams {\n digest: string;\n salt?: string;\n}\n"],"mappings":"AAAA;AACA,WAAYA,eAAe,0BAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAA,OAAfA,eAAe;AAAA","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { Didomi } from './Didomi';
|
|
2
|
-
export { DidomiEventType, Vendor, VendorNamespaces, Purpose, UserStatus, UserStatusPurposes, UserStatusVendors, UserStatusIds, CurrentUserStatus, PurposeStatus, VendorStatus } from './DidomiTypes';
|
|
2
|
+
export { DidomiEventType, Vendor, VendorNamespaces, Purpose, UserStatus, UserStatusPurposes, UserStatusVendors, UserStatusIds, CurrentUserStatus, PurposeStatus, VendorStatus, UserAuthWithEncryptionParams, UserAuthWithHashParams } from './DidomiTypes';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Didomi","DidomiEventType","Vendor","VendorNamespaces","Purpose","UserStatus","UserStatusPurposes","UserStatusVendors","UserStatusIds","CurrentUserStatus","PurposeStatus","VendorStatus"],"sources":["index.tsx"],"sourcesContent":["export { Didomi } from './Didomi';\nexport {
|
|
1
|
+
{"version":3,"names":["Didomi","DidomiEventType","Vendor","VendorNamespaces","Purpose","UserStatus","UserStatusPurposes","UserStatusVendors","UserStatusIds","CurrentUserStatus","PurposeStatus","VendorStatus","UserAuthWithEncryptionParams","UserAuthWithHashParams"],"sources":["index.tsx"],"sourcesContent":["export { Didomi } from './Didomi';\nexport {\n DidomiEventType,\n Vendor,\n VendorNamespaces,\n Purpose,\n UserStatus,\n UserStatusPurposes,\n UserStatusVendors,\n UserStatusIds,\n CurrentUserStatus,\n PurposeStatus,\n VendorStatus,\n UserAuthWithEncryptionParams,\n UserAuthWithHashParams\n} from './DidomiTypes';\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,UAAU;AACjC,SACIC,eAAe,EACfC,MAAM,EACNC,gBAAgB,EAChBC,OAAO,EACPC,UAAU,EACVC,kBAAkB,EAClBC,iBAAiB,EACjBC,aAAa,EACbC,iBAAiB,EACjBC,aAAa,EACbC,YAAY,EACZC,4BAA4B,EAC5BC,sBAAsB,QACnB,eAAe","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const DIDOMI_USER_AGENT_NAME = "Didomi React-Native SDK";
|
|
2
|
-
export declare const DIDOMI_VERSION = "2.
|
|
2
|
+
export declare const DIDOMI_VERSION = "2.4.0";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DidomiEventType, Purpose, Vendor, UserStatus, CurrentUserStatus, VendorStatus } from './DidomiTypes';
|
|
1
|
+
import { DidomiEventType, Purpose, Vendor, UserStatus, CurrentUserStatus, VendorStatus, UserAuthParams } from './DidomiTypes';
|
|
2
2
|
import { CurrentUserStatusTransaction } from './CurrentUserStatusTransaction';
|
|
3
3
|
export declare const Didomi: {
|
|
4
4
|
/**
|
|
@@ -13,8 +13,10 @@ export declare const Didomi: {
|
|
|
13
13
|
* @param noticeId: Notice id for the remote configuration.
|
|
14
14
|
* @param androidTvNoticeId: Notice id for the remote configuration when running on Android TV device (ignored on iOS / tvOS). Note that using remote configuration is mandatory for TV devices.
|
|
15
15
|
* @param androidTvEnabled: Whether to allow Didomi SDK to run on Android TV, default to "false".
|
|
16
|
+
* @param countryCode: Override user country code when determining the privacy regulation to apply. Keep undefined to let the Didomi SDK determine the user country.
|
|
17
|
+
* @param regionCode: Override user region code when determining the privacy regulation to apply. Keep undefined to let the Didomi SDK determine the user region. Ignored if countryCode is not set.
|
|
16
18
|
*/
|
|
17
|
-
initialize: (apiKey: string, localConfigurationPath?: string, remoteConfigurationUrl?: string, providerId?: string, disableDidomiRemoteConfig?: boolean, languageCode?: string, noticeId?: string, androidTvNoticeId?: string, androidTvEnabled?: boolean) => Promise<void>;
|
|
19
|
+
initialize: (apiKey: string, localConfigurationPath?: string, remoteConfigurationUrl?: string, providerId?: string, disableDidomiRemoteConfig?: boolean, languageCode?: string, noticeId?: string, androidTvNoticeId?: string, androidTvEnabled?: boolean, countryCode?: string, regionCode?: string) => Promise<void>;
|
|
18
20
|
/**
|
|
19
21
|
* Listen to SDK ready state
|
|
20
22
|
*/
|
|
@@ -351,6 +353,7 @@ export declare const Didomi: {
|
|
|
351
353
|
* @param digest Digest of the organization user ID and secret
|
|
352
354
|
* @param salt Salt used for computing the digest (optional)
|
|
353
355
|
* @param expiration Expiration date as timestamp (to prevent replay attacks)
|
|
356
|
+
* @deprecated use {@link #setUserWithAuthParams()} instead.
|
|
354
357
|
*/
|
|
355
358
|
setUserWithHashAuth: (id: string, algorithm: string, secretId: string, digest: string, salt?: string, expiration?: BigInt) => void;
|
|
356
359
|
/**
|
|
@@ -362,6 +365,7 @@ export declare const Didomi: {
|
|
|
362
365
|
* @param digest Digest of the organization user ID and secret
|
|
363
366
|
* @param salt Salt used for computing the digest (optional)
|
|
364
367
|
* @param expiration Expiration date as timestamp (to prevent replay attacks)
|
|
368
|
+
* @deprecated use {@link #setUserWithAuthParamsAndSetupUI()} instead.
|
|
365
369
|
*/
|
|
366
370
|
setUserWithHashAuthAndSetupUI: (id: string, algorithm: string, secretId: string, digest: string, salt?: string, expiration?: BigInt) => void;
|
|
367
371
|
/**
|
|
@@ -372,6 +376,7 @@ export declare const Didomi: {
|
|
|
372
376
|
* @param secretId ID of the secret used for computing the digest
|
|
373
377
|
* @param initializationVector Initialization Vector used for computing the user ID
|
|
374
378
|
* @param expiration Expiration date as timestamp (to prevent replay attacks)
|
|
379
|
+
* @deprecated use {@link #setUserWithAuthParams()} instead.
|
|
375
380
|
*/
|
|
376
381
|
setUserWithEncryptionAuth: (id: string, algorithm: string, secretId: string, initializationVector: string, expiration?: BigInt) => void;
|
|
377
382
|
/**
|
|
@@ -382,8 +387,23 @@ export declare const Didomi: {
|
|
|
382
387
|
* @param secretId ID of the secret used for computing the digest
|
|
383
388
|
* @param initializationVector Initialization Vector used for computing the user ID
|
|
384
389
|
* @param expiration Expiration date as timestamp (to prevent replay attacks)
|
|
390
|
+
* @deprecated use {@link #setUserWithAuthParamsAndSetupUI()} instead.
|
|
385
391
|
*/
|
|
386
392
|
setUserWithEncryptionAuthAndSetupUI: (id: string, algorithm: string, secretId: string, initializationVector: string, expiration?: BigInt) => void;
|
|
393
|
+
/**
|
|
394
|
+
* Set user information with authentication (Hash or Encryption)
|
|
395
|
+
*
|
|
396
|
+
* @param userAuthParams as UserAuthParams (use UserAuthWithEncryptionParams or UserAuthWithHashParams)
|
|
397
|
+
* @param synchronizedUsers as UserAuthParams[] (optional)
|
|
398
|
+
*/
|
|
399
|
+
setUserWithAuthParams: (userAuthParams: UserAuthParams, synchronizedUsers?: UserAuthParams[] | undefined) => void;
|
|
400
|
+
/**
|
|
401
|
+
* Set user information with authentication (Hash or Encryption) and check for missing consent
|
|
402
|
+
*
|
|
403
|
+
* @param userAuthParams as UserAuthParams (use UserAuthWithEncryptionParams or UserAuthWithHashParams)
|
|
404
|
+
* @param synchronizedUsers as UserAuthParams[] (optional)
|
|
405
|
+
*/
|
|
406
|
+
setUserWithAuthParamsAndSetupUI: (userAuthParams: UserAuthParams, synchronizedUsers?: UserAuthParams[] | undefined) => void;
|
|
387
407
|
/**
|
|
388
408
|
* Show the consent notice (if required, not disabled in the config and not already displayed)
|
|
389
409
|
*/
|
|
@@ -35,8 +35,9 @@ export declare enum DidomiEventType {
|
|
|
35
35
|
PREFERENCES_CLICK_SPI_CATEGORY_AGREE = "on_preferences_click_spi_category_agree",
|
|
36
36
|
PREFERENCES_CLICK_SPI_CATEGORY_DISAGREE = "on_preferences_click_spi_category_disagree",
|
|
37
37
|
PREFERENCES_CLICK_SPI_PURPOSE_SAVE_CHOICES = "on_preferences_click_spi_purpose_save_choices",
|
|
38
|
-
|
|
38
|
+
SYNC_READY = "on_sync_ready",
|
|
39
39
|
SYNC_ERROR = "on_sync_error",
|
|
40
|
+
SYNC_DONE = "on_sync_done",
|
|
40
41
|
LANGUAGE_UPDATED = "on_language_updated",
|
|
41
42
|
LANGUAGE_UPDATE_FAILED = "on_language_update_failed"
|
|
42
43
|
}
|
|
@@ -122,3 +123,20 @@ export interface VendorStatus {
|
|
|
122
123
|
id: string;
|
|
123
124
|
enabled: boolean;
|
|
124
125
|
}
|
|
126
|
+
export interface SyncReadyEvent {
|
|
127
|
+
statusApplied: boolean;
|
|
128
|
+
syncAcknowledged: () => Promise<boolean>;
|
|
129
|
+
}
|
|
130
|
+
export interface UserAuthParams {
|
|
131
|
+
id: string;
|
|
132
|
+
algorithm: string;
|
|
133
|
+
secretId: string;
|
|
134
|
+
expiration?: number;
|
|
135
|
+
}
|
|
136
|
+
export interface UserAuthWithEncryptionParams extends UserAuthParams {
|
|
137
|
+
initializationVector: string;
|
|
138
|
+
}
|
|
139
|
+
export interface UserAuthWithHashParams extends UserAuthParams {
|
|
140
|
+
digest: string;
|
|
141
|
+
salt?: string;
|
|
142
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Didomi } from './Didomi';
|
|
2
|
-
export { DidomiEventType, Vendor, VendorNamespaces, Purpose, UserStatus, UserStatusPurposes, UserStatusVendors, UserStatusIds, CurrentUserStatus, PurposeStatus, VendorStatus } from './DidomiTypes';
|
|
2
|
+
export { DidomiEventType, Vendor, VendorNamespaces, Purpose, UserStatus, UserStatusPurposes, UserStatusVendors, UserStatusIds, CurrentUserStatus, PurposeStatus, VendorStatus, UserAuthWithEncryptionParams, UserAuthWithHashParams } from './DidomiTypes';
|
package/package.json
CHANGED
package/src/Constants.ts
CHANGED
package/src/Didomi.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NativeModules } from 'react-native';
|
|
2
2
|
import { DidomiListener } from './DidomiListener';
|
|
3
|
-
import { DidomiEventType, Purpose, Vendor, UserStatus, CurrentUserStatus, VendorStatus } from './DidomiTypes';
|
|
3
|
+
import { DidomiEventType, Purpose, Vendor, UserStatus, CurrentUserStatus, VendorStatus, UserAuthParams } from './DidomiTypes';
|
|
4
4
|
import { DIDOMI_USER_AGENT_NAME, DIDOMI_VERSION } from './Constants';
|
|
5
5
|
import { CurrentUserStatusTransaction, createCurrentUserStatusTransaction } from './CurrentUserStatusTransaction';
|
|
6
6
|
|
|
@@ -19,6 +19,8 @@ export const Didomi = {
|
|
|
19
19
|
* @param noticeId: Notice id for the remote configuration.
|
|
20
20
|
* @param androidTvNoticeId: Notice id for the remote configuration when running on Android TV device (ignored on iOS / tvOS). Note that using remote configuration is mandatory for TV devices.
|
|
21
21
|
* @param androidTvEnabled: Whether to allow Didomi SDK to run on Android TV, default to "false".
|
|
22
|
+
* @param countryCode: Override user country code when determining the privacy regulation to apply. Keep undefined to let the Didomi SDK determine the user country.
|
|
23
|
+
* @param regionCode: Override user region code when determining the privacy regulation to apply. Keep undefined to let the Didomi SDK determine the user region. Ignored if countryCode is not set.
|
|
22
24
|
*/
|
|
23
25
|
initialize: (
|
|
24
26
|
apiKey: string,
|
|
@@ -29,7 +31,9 @@ export const Didomi = {
|
|
|
29
31
|
languageCode?: string,
|
|
30
32
|
noticeId?: string,
|
|
31
33
|
androidTvNoticeId?: string,
|
|
32
|
-
androidTvEnabled: boolean = false
|
|
34
|
+
androidTvEnabled: boolean = false,
|
|
35
|
+
countryCode?: string,
|
|
36
|
+
regionCode?: string,
|
|
33
37
|
): Promise<void> => {
|
|
34
38
|
// Init listener
|
|
35
39
|
DidomiListener.init();
|
|
@@ -46,7 +50,9 @@ export const Didomi = {
|
|
|
46
50
|
languageCode,
|
|
47
51
|
noticeId,
|
|
48
52
|
androidTvNoticeId,
|
|
49
|
-
androidTvEnabled
|
|
53
|
+
androidTvEnabled,
|
|
54
|
+
countryCode,
|
|
55
|
+
regionCode
|
|
50
56
|
);
|
|
51
57
|
},
|
|
52
58
|
|
|
@@ -458,6 +464,7 @@ export const Didomi = {
|
|
|
458
464
|
* @param digest Digest of the organization user ID and secret
|
|
459
465
|
* @param salt Salt used for computing the digest (optional)
|
|
460
466
|
* @param expiration Expiration date as timestamp (to prevent replay attacks)
|
|
467
|
+
* @deprecated use {@link #setUserWithAuthParams()} instead.
|
|
461
468
|
*/
|
|
462
469
|
setUserWithHashAuth: (
|
|
463
470
|
id: string,
|
|
@@ -496,6 +503,7 @@ export const Didomi = {
|
|
|
496
503
|
* @param digest Digest of the organization user ID and secret
|
|
497
504
|
* @param salt Salt used for computing the digest (optional)
|
|
498
505
|
* @param expiration Expiration date as timestamp (to prevent replay attacks)
|
|
506
|
+
* @deprecated use {@link #setUserWithAuthParamsAndSetupUI()} instead.
|
|
499
507
|
*/
|
|
500
508
|
setUserWithHashAuthAndSetupUI: (
|
|
501
509
|
id: string,
|
|
@@ -533,6 +541,7 @@ export const Didomi = {
|
|
|
533
541
|
* @param secretId ID of the secret used for computing the digest
|
|
534
542
|
* @param initializationVector Initialization Vector used for computing the user ID
|
|
535
543
|
* @param expiration Expiration date as timestamp (to prevent replay attacks)
|
|
544
|
+
* @deprecated use {@link #setUserWithAuthParams()} instead.
|
|
536
545
|
*/
|
|
537
546
|
setUserWithEncryptionAuth: (
|
|
538
547
|
id: string,
|
|
@@ -567,6 +576,7 @@ export const Didomi = {
|
|
|
567
576
|
* @param secretId ID of the secret used for computing the digest
|
|
568
577
|
* @param initializationVector Initialization Vector used for computing the user ID
|
|
569
578
|
* @param expiration Expiration date as timestamp (to prevent replay attacks)
|
|
579
|
+
* @deprecated use {@link #setUserWithAuthParamsAndSetupUI()} instead.
|
|
570
580
|
*/
|
|
571
581
|
setUserWithEncryptionAuthAndSetupUI: (
|
|
572
582
|
id: string,
|
|
@@ -593,6 +603,28 @@ export const Didomi = {
|
|
|
593
603
|
}
|
|
594
604
|
},
|
|
595
605
|
|
|
606
|
+
/**
|
|
607
|
+
* Set user information with authentication (Hash or Encryption)
|
|
608
|
+
*
|
|
609
|
+
* @param userAuthParams as UserAuthParams (use UserAuthWithEncryptionParams or UserAuthWithHashParams)
|
|
610
|
+
* @param synchronizedUsers as UserAuthParams[] (optional)
|
|
611
|
+
*/
|
|
612
|
+
setUserWithAuthParams: (
|
|
613
|
+
userAuthParams: UserAuthParams,
|
|
614
|
+
synchronizedUsers?: UserAuthParams[] | undefined
|
|
615
|
+
): void => RNDidomi.setUserWithAuthParams(JSON.stringify(userAuthParams), JSON.stringify(synchronizedUsers)),
|
|
616
|
+
|
|
617
|
+
/**
|
|
618
|
+
* Set user information with authentication (Hash or Encryption) and check for missing consent
|
|
619
|
+
*
|
|
620
|
+
* @param userAuthParams as UserAuthParams (use UserAuthWithEncryptionParams or UserAuthWithHashParams)
|
|
621
|
+
* @param synchronizedUsers as UserAuthParams[] (optional)
|
|
622
|
+
*/
|
|
623
|
+
setUserWithAuthParamsAndSetupUI: (
|
|
624
|
+
userAuthParams: UserAuthParams,
|
|
625
|
+
synchronizedUsers?: UserAuthParams[] | undefined
|
|
626
|
+
): void => RNDidomi.setUserWithAuthParamsAndSetupUI(JSON.stringify(userAuthParams), JSON.stringify(synchronizedUsers)),
|
|
627
|
+
|
|
596
628
|
/**
|
|
597
629
|
* Show the consent notice (if required, not disabled in the config and not already displayed)
|
|
598
630
|
*/
|
package/src/DidomiListener.ts
CHANGED
|
@@ -21,10 +21,20 @@ export const DidomiListener = {
|
|
|
21
21
|
DidomiListener.eventEmitter.removeAllListeners(eventTypeValue);
|
|
22
22
|
DidomiListener.eventEmitter.addListener(eventTypeValue, (_event: any) => {
|
|
23
23
|
let events = DidomiListener.listeners.get(eventTypeValue);
|
|
24
|
-
if (events) {
|
|
24
|
+
if (events && events.length > 0) {
|
|
25
|
+
if (eventTypeValue == "on_sync_ready") {
|
|
26
|
+
_event.syncAcknowledged = (): Promise<boolean> => {
|
|
27
|
+
return RNDidomi.syncAcknowledged(_event.syncAcknowledgedIndex)
|
|
28
|
+
}
|
|
29
|
+
}
|
|
25
30
|
events.forEach((el: any) => {
|
|
26
31
|
el(_event);
|
|
27
32
|
});
|
|
33
|
+
} else { // No listener for this event type
|
|
34
|
+
if (eventTypeValue == "on_sync_ready") {
|
|
35
|
+
// We can remove syncAcknowledgedCallback as it will never be called
|
|
36
|
+
RNDidomi.removeSyncAcknowledgedCallback(_event.syncAcknowledgedIndex);
|
|
37
|
+
}
|
|
28
38
|
}
|
|
29
39
|
});
|
|
30
40
|
});
|