@didomi/react-native 2.3.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 +105 -2
- package/ios/Didomi.m +12 -10
- package/ios/RNDidomi.swift +117 -3
- 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/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/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 +13 -0
- 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/DidomiTypes.ts +16 -0
- package/src/index.tsx +15 -1
|
@@ -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 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"],"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":[]}
|
|
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
|
*/
|
|
@@ -127,3 +127,16 @@ export interface SyncReadyEvent {
|
|
|
127
127
|
statusApplied: boolean;
|
|
128
128
|
syncAcknowledged: () => Promise<boolean>;
|
|
129
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/DidomiTypes.ts
CHANGED
|
@@ -153,3 +153,19 @@ export interface SyncReadyEvent {
|
|
|
153
153
|
statusApplied: boolean;
|
|
154
154
|
syncAcknowledged: () => Promise<boolean>;
|
|
155
155
|
}
|
|
156
|
+
|
|
157
|
+
export interface UserAuthParams {
|
|
158
|
+
id: string;
|
|
159
|
+
algorithm: string;
|
|
160
|
+
secretId: string;
|
|
161
|
+
expiration?: number;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export interface UserAuthWithEncryptionParams extends UserAuthParams {
|
|
165
|
+
initializationVector: string;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export interface UserAuthWithHashParams extends UserAuthParams {
|
|
169
|
+
digest: string;
|
|
170
|
+
salt?: string;
|
|
171
|
+
}
|
package/src/index.tsx
CHANGED
|
@@ -1,2 +1,16 @@
|
|
|
1
1
|
export { Didomi } from './Didomi';
|
|
2
|
-
export {
|
|
2
|
+
export {
|
|
3
|
+
DidomiEventType,
|
|
4
|
+
Vendor,
|
|
5
|
+
VendorNamespaces,
|
|
6
|
+
Purpose,
|
|
7
|
+
UserStatus,
|
|
8
|
+
UserStatusPurposes,
|
|
9
|
+
UserStatusVendors,
|
|
10
|
+
UserStatusIds,
|
|
11
|
+
CurrentUserStatus,
|
|
12
|
+
PurposeStatus,
|
|
13
|
+
VendorStatus,
|
|
14
|
+
UserAuthWithEncryptionParams,
|
|
15
|
+
UserAuthWithHashParams
|
|
16
|
+
} from './DidomiTypes';
|