@guardian/consent-management-platform
Advanced tools
Comparing version 0.0.0-beta-20240208154607 to 0.0.0-beta-20240209115205
@@ -6,2 +6,1 @@ import type { CMP } from './types'; | ||
export declare const getConsentFor: import("./types").GetConsentFor; | ||
export { clickAcceptAllCookies } from './consumer-self-test'; |
@@ -816,3 +816,3 @@ import { log, removeCookie, storage } from '@guardian/libs'; | ||
permutive: ['5f369a02b8e05c2f2d546a40'], | ||
prebid: ['5f92a62aa22863685f4daa4c'], | ||
prebidCustom: ['5f22bfd82a6b6c1afd1181a9'], | ||
qm: ['5f295fa4b8e05c76a44c3149'], | ||
@@ -825,2 +825,5 @@ remarketing: ['5ed0eb688a76503f1016578f'], | ||
}; | ||
const MiscVendorID = { | ||
prebid: ['5f92a62aa22863685f4daa4c'], | ||
}; | ||
const AusVendorIDs = { | ||
@@ -832,2 +835,3 @@ redplanet: ['not-tcfv2-vendor'], | ||
...AusVendorIDs, | ||
...MiscVendorID | ||
}; | ||
@@ -986,16 +990,2 @@ | ||
const ELEMENT_ID = { | ||
TCFV2_FIRST_LAYER_ACCEPT_ALL: 'div.message-component.message-row > button.sp_choice_type_11', | ||
CMP_CONTAINER: '[id*="sp_message_iframe"]', | ||
}; | ||
const log_info = (message) => { | ||
console.log(`(cmp monitoring) info: ${message}`); | ||
}; | ||
const clickAcceptAllCookies = async (page, textToPrintToConsole) => { | ||
log_info(`Clicking on "${textToPrintToConsole}" on CMP`); | ||
const acceptAllButton = page.frameLocator(ELEMENT_ID.CMP_CONTAINER).locator(ELEMENT_ID.TCFV2_FIRST_LAYER_ACCEPT_ALL); | ||
await acceptAllButton.click(); | ||
log_info(`Clicked on "${textToPrintToConsole}"`); | ||
}; | ||
if (!isServerSide) { | ||
@@ -1014,5 +1004,5 @@ window.guCmpHotFix ||= {}; | ||
if (window.guCmpHotFix.initialised) { | ||
if (window.guCmpHotFix.cmp?.version !== "0.0.0-beta-20240208154607") | ||
if (window.guCmpHotFix.cmp?.version !== "0.0.0-beta-20240209115205") | ||
console.warn('Two different versions of the CMP are running:', [ | ||
"0.0.0-beta-20240208154607", | ||
"0.0.0-beta-20240209115205", | ||
window.guCmpHotFix.cmp?.version, | ||
@@ -1055,3 +1045,3 @@ ]); | ||
showPrivacyManager, | ||
version: "0.0.0-beta-20240208154607", | ||
version: "0.0.0-beta-20240209115205", | ||
__isDisabled: isDisabled, | ||
@@ -1071,2 +1061,2 @@ __enable: enable, | ||
export { clickAcceptAllCookies, cmp, getConsentFor, onConsent, onConsentChange }; | ||
export { cmp, getConsentFor, onConsent, onConsentChange }; |
@@ -820,3 +820,3 @@ 'use strict'; | ||
permutive: ['5f369a02b8e05c2f2d546a40'], | ||
prebid: ['5f92a62aa22863685f4daa4c'], | ||
prebidCustom: ['5f22bfd82a6b6c1afd1181a9'], | ||
qm: ['5f295fa4b8e05c76a44c3149'], | ||
@@ -829,2 +829,5 @@ remarketing: ['5ed0eb688a76503f1016578f'], | ||
}; | ||
const MiscVendorID = { | ||
prebid: ['5f92a62aa22863685f4daa4c'], | ||
}; | ||
const AusVendorIDs = { | ||
@@ -836,2 +839,3 @@ redplanet: ['not-tcfv2-vendor'], | ||
...AusVendorIDs, | ||
...MiscVendorID | ||
}; | ||
@@ -990,16 +994,2 @@ | ||
const ELEMENT_ID = { | ||
TCFV2_FIRST_LAYER_ACCEPT_ALL: 'div.message-component.message-row > button.sp_choice_type_11', | ||
CMP_CONTAINER: '[id*="sp_message_iframe"]', | ||
}; | ||
const log_info = (message) => { | ||
console.log(`(cmp monitoring) info: ${message}`); | ||
}; | ||
const clickAcceptAllCookies = async (page, textToPrintToConsole) => { | ||
log_info(`Clicking on "${textToPrintToConsole}" on CMP`); | ||
const acceptAllButton = page.frameLocator(ELEMENT_ID.CMP_CONTAINER).locator(ELEMENT_ID.TCFV2_FIRST_LAYER_ACCEPT_ALL); | ||
await acceptAllButton.click(); | ||
log_info(`Clicked on "${textToPrintToConsole}"`); | ||
}; | ||
if (!isServerSide) { | ||
@@ -1018,5 +1008,5 @@ window.guCmpHotFix ||= {}; | ||
if (window.guCmpHotFix.initialised) { | ||
if (window.guCmpHotFix.cmp?.version !== "0.0.0-beta-20240208154607") | ||
if (window.guCmpHotFix.cmp?.version !== "0.0.0-beta-20240209115205") | ||
console.warn('Two different versions of the CMP are running:', [ | ||
"0.0.0-beta-20240208154607", | ||
"0.0.0-beta-20240209115205", | ||
window.guCmpHotFix.cmp?.version, | ||
@@ -1059,3 +1049,3 @@ ]); | ||
showPrivacyManager, | ||
version: "0.0.0-beta-20240208154607", | ||
version: "0.0.0-beta-20240209115205", | ||
__isDisabled: isDisabled, | ||
@@ -1075,3 +1065,2 @@ __enable: enable, | ||
exports.clickAcceptAllCookies = clickAcceptAllCookies; | ||
exports.cmp = cmp; | ||
@@ -1078,0 +1067,0 @@ exports.getConsentFor = getConsentFor; |
@@ -5,2 +5,3 @@ type VendorIDType = { | ||
export declare const TCFV2VendorIDs: VendorIDType; | ||
export declare const MiscVendorID: VendorIDType; | ||
export declare const AusVendorIDs: VendorIDType; | ||
@@ -7,0 +8,0 @@ export declare const VendorIDs: VendorIDType; |
{ | ||
"name": "@guardian/consent-management-platform", | ||
"version": "0.0.0-beta-20240208154607", | ||
"version": "0.0.0-beta-20240209115205", | ||
"description": "Consent management for *.theguardian.com.", | ||
@@ -79,3 +79,2 @@ "homepage": "https://github.com/guardian/consent-management-platform.git", | ||
"npm-run-all": "^4", | ||
"playwright-core": "1.40.1", | ||
"prettier": "^3.2.4", | ||
@@ -96,5 +95,4 @@ "prettier-plugin-svelte": "^3.1.2", | ||
"peerDependencies": { | ||
"playwright-core": "1.40.1", | ||
"@guardian/libs": "^15.0.0 || ^16.0.0" | ||
} | ||
} |
1
50
101870
57
2564