@guardian/consent-management-platform
Advanced tools
Comparing version 13.8.0 to 13.9.0
@@ -254,129 +254,3 @@ import { log, removeCookie, storage } from '@guardian/libs'; | ||
/* istanbul ignore file */ | ||
// Reference : https://docs.sourcepoint.com/hc/en-us/articles/18007731422099-Enable-GPP-Multi-State-Privacy-String-MSPS-with-U-S-Privacy-CCPA-solution | ||
const stub_gpp_ccpa = () => { | ||
(window.__gpp_addFrame = function (e) { | ||
if (!window.frames[e]) { | ||
if (document.body) { | ||
var t = document.createElement('iframe'); | ||
(t.style.cssText = 'display:none'), | ||
(t.name = e), | ||
document.body.appendChild(t); | ||
} else window.setTimeout(window.__gpp_addFrame, 10, e); | ||
} | ||
}), | ||
(window.__gpp_stub = function () { | ||
var e = arguments; | ||
if ( | ||
((__gpp.queue = __gpp.queue || []), | ||
(__gpp.events = __gpp.events || []), | ||
!e.length || (1 == e.length && 'queue' == e[0])) | ||
) { | ||
return __gpp.queue; | ||
} | ||
if (1 == e.length && 'events' == e[0]) return __gpp.events; | ||
var t = e[0], | ||
p = e.length > 1 ? e[1] : null, | ||
n = e.length > 2 ? e[2] : null; | ||
if ('ping' === t) { | ||
return { | ||
gppVersion: '1.0', | ||
cmpStatus: 'stub', | ||
cmpDisplayStatus: 'hidden', | ||
supportedAPIs: ['tcfeuv2', 'tcfcav2', 'uspv1'], | ||
cmpId: 31, | ||
}; | ||
} | ||
if ('addEventListener' === t) { | ||
'lastId' in __gpp || (__gpp.lastId = 0), __gpp.lastId++; | ||
var a = __gpp.lastId; | ||
return ( | ||
__gpp.events.push({ id: a, callback: p, parameter: n }), | ||
{ | ||
eventName: 'listenerRegistered', | ||
listenerId: a, | ||
data: !0, | ||
pingData: { | ||
gppVersion: '1.0', | ||
cmpStatus: 'stub', | ||
cmpDisplayStatus: 'hidden', | ||
supportedAPIs: ['tcfeuv2', 'tcfva', 'usnat'], | ||
cmpId: 31, | ||
}, | ||
} | ||
); | ||
} | ||
if ('removeEventListener' === t) { | ||
for (var s = !1, i = 0; i < __gpp.events.length; i++) { | ||
if (__gpp.events[i].id == n) { | ||
__gpp.events.splice(i, 1), (s = !0); | ||
break; | ||
} | ||
} | ||
return { | ||
eventName: 'listenerRemoved', | ||
listenerId: n, | ||
data: s, | ||
pingData: { | ||
gppVersion: '1.0', | ||
cmpStatus: 'stub', | ||
cmpDisplayStatus: 'hidden', | ||
supportedAPIs: ['tcfeuv2', 'tcfva', 'usnat'], | ||
cmpId: 31, | ||
}, | ||
}; | ||
} | ||
return 'getGPPData' === t | ||
? { | ||
sectionId: 3, | ||
gppVersion: 1, | ||
sectionList: [], | ||
applicableSections: [0], | ||
gppString: '', | ||
pingData: { | ||
gppVersion: '1.0', | ||
cmpStatus: 'stub', | ||
cmpDisplayStatus: 'hidden', | ||
supportedAPIs: ['tcfeuv2', 'tcfva', 'usnat'], | ||
cmpId: 31, | ||
}, | ||
} | ||
: 'hasSection' === t || 'getSection' === t || 'getField' === t | ||
? null | ||
: void __gpp.queue.push([].slice.apply(e)); | ||
}), | ||
(window.__gpp_msghandler = function (e) { | ||
var t = 'string' == typeof e.data; | ||
try { | ||
var p = t ? JSON.parse(e.data) : e.data; | ||
} catch (e) { | ||
p = null; | ||
} | ||
if ('object' == typeof p && null !== p && '__gppCall' in p) { | ||
var n = p.__gppCall; | ||
window.__gpp( | ||
n.command, | ||
function (p, a) { | ||
var s = { | ||
__gppReturn: { | ||
returnValue: p, | ||
success: a, | ||
callId: n.callId, | ||
}, | ||
}; | ||
e.source.postMessage(t ? JSON.stringify(s) : s, '*'); | ||
}, | ||
'parameter' in n ? n.parameter : null, | ||
'version' in n ? n.version : 1, | ||
); | ||
} | ||
}), | ||
('__gpp' in window && 'function' == typeof window.__gpp) || | ||
((window.__gpp = window.__gpp_stub), | ||
window.addEventListener('message', window.__gpp_msghandler, !1), | ||
window.__gpp_addFrame('__gppLocator')); | ||
}; | ||
/* eslint-disable -- this is third party code */ | ||
/* istanbul ignore file */ | ||
/* | ||
@@ -761,3 +635,2 @@ This code is the TCFv2 stub made available by Sourcepoint. | ||
stub_uspapi_ccpa(); | ||
stub_gpp_ccpa(); | ||
break; | ||
@@ -876,3 +749,2 @@ case 'aus': | ||
window._sp_.config.ccpa = { | ||
includeGppApi: true, | ||
targetingParams: { | ||
@@ -1127,5 +999,5 @@ framework, | ||
if (window.guCmpHotFix.initialised) { | ||
if (window.guCmpHotFix.cmp?.version !== "13.8.0") | ||
if (window.guCmpHotFix.cmp?.version !== "13.9.0") | ||
console.warn('Two different versions of the CMP are running:', [ | ||
"13.8.0", | ||
"13.9.0", | ||
window.guCmpHotFix.cmp?.version, | ||
@@ -1168,3 +1040,3 @@ ]); | ||
showPrivacyManager, | ||
version: "13.8.0", | ||
version: "13.9.0", | ||
__isDisabled: isDisabled, | ||
@@ -1171,0 +1043,0 @@ __enable: enable, |
@@ -258,129 +258,3 @@ 'use strict'; | ||
/* istanbul ignore file */ | ||
// Reference : https://docs.sourcepoint.com/hc/en-us/articles/18007731422099-Enable-GPP-Multi-State-Privacy-String-MSPS-with-U-S-Privacy-CCPA-solution | ||
const stub_gpp_ccpa = () => { | ||
(window.__gpp_addFrame = function (e) { | ||
if (!window.frames[e]) { | ||
if (document.body) { | ||
var t = document.createElement('iframe'); | ||
(t.style.cssText = 'display:none'), | ||
(t.name = e), | ||
document.body.appendChild(t); | ||
} else window.setTimeout(window.__gpp_addFrame, 10, e); | ||
} | ||
}), | ||
(window.__gpp_stub = function () { | ||
var e = arguments; | ||
if ( | ||
((__gpp.queue = __gpp.queue || []), | ||
(__gpp.events = __gpp.events || []), | ||
!e.length || (1 == e.length && 'queue' == e[0])) | ||
) { | ||
return __gpp.queue; | ||
} | ||
if (1 == e.length && 'events' == e[0]) return __gpp.events; | ||
var t = e[0], | ||
p = e.length > 1 ? e[1] : null, | ||
n = e.length > 2 ? e[2] : null; | ||
if ('ping' === t) { | ||
return { | ||
gppVersion: '1.0', | ||
cmpStatus: 'stub', | ||
cmpDisplayStatus: 'hidden', | ||
supportedAPIs: ['tcfeuv2', 'tcfcav2', 'uspv1'], | ||
cmpId: 31, | ||
}; | ||
} | ||
if ('addEventListener' === t) { | ||
'lastId' in __gpp || (__gpp.lastId = 0), __gpp.lastId++; | ||
var a = __gpp.lastId; | ||
return ( | ||
__gpp.events.push({ id: a, callback: p, parameter: n }), | ||
{ | ||
eventName: 'listenerRegistered', | ||
listenerId: a, | ||
data: !0, | ||
pingData: { | ||
gppVersion: '1.0', | ||
cmpStatus: 'stub', | ||
cmpDisplayStatus: 'hidden', | ||
supportedAPIs: ['tcfeuv2', 'tcfva', 'usnat'], | ||
cmpId: 31, | ||
}, | ||
} | ||
); | ||
} | ||
if ('removeEventListener' === t) { | ||
for (var s = !1, i = 0; i < __gpp.events.length; i++) { | ||
if (__gpp.events[i].id == n) { | ||
__gpp.events.splice(i, 1), (s = !0); | ||
break; | ||
} | ||
} | ||
return { | ||
eventName: 'listenerRemoved', | ||
listenerId: n, | ||
data: s, | ||
pingData: { | ||
gppVersion: '1.0', | ||
cmpStatus: 'stub', | ||
cmpDisplayStatus: 'hidden', | ||
supportedAPIs: ['tcfeuv2', 'tcfva', 'usnat'], | ||
cmpId: 31, | ||
}, | ||
}; | ||
} | ||
return 'getGPPData' === t | ||
? { | ||
sectionId: 3, | ||
gppVersion: 1, | ||
sectionList: [], | ||
applicableSections: [0], | ||
gppString: '', | ||
pingData: { | ||
gppVersion: '1.0', | ||
cmpStatus: 'stub', | ||
cmpDisplayStatus: 'hidden', | ||
supportedAPIs: ['tcfeuv2', 'tcfva', 'usnat'], | ||
cmpId: 31, | ||
}, | ||
} | ||
: 'hasSection' === t || 'getSection' === t || 'getField' === t | ||
? null | ||
: void __gpp.queue.push([].slice.apply(e)); | ||
}), | ||
(window.__gpp_msghandler = function (e) { | ||
var t = 'string' == typeof e.data; | ||
try { | ||
var p = t ? JSON.parse(e.data) : e.data; | ||
} catch (e) { | ||
p = null; | ||
} | ||
if ('object' == typeof p && null !== p && '__gppCall' in p) { | ||
var n = p.__gppCall; | ||
window.__gpp( | ||
n.command, | ||
function (p, a) { | ||
var s = { | ||
__gppReturn: { | ||
returnValue: p, | ||
success: a, | ||
callId: n.callId, | ||
}, | ||
}; | ||
e.source.postMessage(t ? JSON.stringify(s) : s, '*'); | ||
}, | ||
'parameter' in n ? n.parameter : null, | ||
'version' in n ? n.version : 1, | ||
); | ||
} | ||
}), | ||
('__gpp' in window && 'function' == typeof window.__gpp) || | ||
((window.__gpp = window.__gpp_stub), | ||
window.addEventListener('message', window.__gpp_msghandler, !1), | ||
window.__gpp_addFrame('__gppLocator')); | ||
}; | ||
/* eslint-disable -- this is third party code */ | ||
/* istanbul ignore file */ | ||
/* | ||
@@ -765,3 +639,2 @@ This code is the TCFv2 stub made available by Sourcepoint. | ||
stub_uspapi_ccpa(); | ||
stub_gpp_ccpa(); | ||
break; | ||
@@ -880,3 +753,2 @@ case 'aus': | ||
window._sp_.config.ccpa = { | ||
includeGppApi: true, | ||
targetingParams: { | ||
@@ -1131,5 +1003,5 @@ framework, | ||
if (window.guCmpHotFix.initialised) { | ||
if (window.guCmpHotFix.cmp?.version !== "13.8.0") | ||
if (window.guCmpHotFix.cmp?.version !== "13.9.0") | ||
console.warn('Two different versions of the CMP are running:', [ | ||
"13.8.0", | ||
"13.9.0", | ||
window.guCmpHotFix.cmp?.version, | ||
@@ -1172,3 +1044,3 @@ ]); | ||
showPrivacyManager, | ||
version: "13.8.0", | ||
version: "13.9.0", | ||
__isDisabled: isDisabled, | ||
@@ -1175,0 +1047,0 @@ __enable: enable, |
@@ -8,5 +8,1 @@ export interface CCPAConsentState { | ||
} | ||
export interface GPPData { | ||
gppVersion: number; | ||
gppString: string; | ||
} |
{ | ||
"name": "@guardian/consent-management-platform", | ||
"version": "13.8.0", | ||
"version": "13.9.0", | ||
"description": "Consent management for *.theguardian.com.", | ||
@@ -42,56 +42,56 @@ "homepage": "https://github.com/guardian/consent-management-platform.git", | ||
"devDependencies": { | ||
"@babel/core": "^7.23.2", | ||
"@babel/core": "^7.23.9", | ||
"@babel/plugin-proposal-class-properties": "^7", | ||
"@babel/plugin-transform-runtime": "~7.23.2", | ||
"@babel/preset-env": "^7.23.2", | ||
"@babel/preset-typescript": "^7.23.2", | ||
"@babel/runtime": "^7.23.2", | ||
"@changesets/cli": "^2.26.2", | ||
"@guardian/eslint-config-typescript": "^7.0.0", | ||
"@guardian/libs": "15.0.0", | ||
"@guardian/prettier": "^4.0.0", | ||
"@babel/plugin-transform-runtime": "~7.23.9", | ||
"@babel/preset-env": "^7.23.9", | ||
"@babel/preset-typescript": "^7.23.3", | ||
"@babel/runtime": "^7.23.9", | ||
"@changesets/cli": "^2.27.1", | ||
"@guardian/eslint-config-typescript": "^9.0.2", | ||
"@guardian/libs": "16.0.1", | ||
"@guardian/prettier": "^8.0.0", | ||
"@guardian/tsconfig": "^0.2.0", | ||
"@rollup/plugin-babel": "^6.0.3", | ||
"@rollup/plugin-commonjs": "^25.0.1", | ||
"@rollup/plugin-html": "^1.0.2", | ||
"@rollup/plugin-node-resolve": "^15.1.0", | ||
"@rollup/plugin-replace": "^5.0.2", | ||
"@rollup/plugin-strip": "^3.0.2", | ||
"@rollup/plugin-terser": "^0.4.3", | ||
"@rollup/plugin-typescript": "^11.1.1", | ||
"@types/jest": "^29.5.2", | ||
"@types/mime": "^3.0.1", | ||
"@types/node": "^20.3.3", | ||
"axios": "^1.6.3", | ||
"conventional-changelog-conventionalcommits": "^6.0.0", | ||
"cypress": "^12.14.0", | ||
"@rollup/plugin-babel": "^6.0.4", | ||
"@rollup/plugin-commonjs": "^25.0.7", | ||
"@rollup/plugin-html": "^1.0.3", | ||
"@rollup/plugin-node-resolve": "^15.2.3", | ||
"@rollup/plugin-replace": "^5.0.5", | ||
"@rollup/plugin-strip": "^3.0.4", | ||
"@rollup/plugin-terser": "^0.4.4", | ||
"@rollup/plugin-typescript": "^11.1.6", | ||
"@types/jest": "^29.5.11", | ||
"@types/mime": "^3.0.4", | ||
"@types/node": "^20.11.8", | ||
"axios": "^1.6.7", | ||
"conventional-changelog-conventionalcommits": "^7.0.2", | ||
"cypress": "^13.6.3", | ||
"cypress-wait-until": "^3.0.1", | ||
"eslint": "^8.44.0", | ||
"eslint-plugin-cypress": "^2.13.3", | ||
"eslint": "^8.56.0", | ||
"eslint-plugin-cypress": "^2.15.1", | ||
"eslint-plugin-svelte3": "^4.0.0", | ||
"gh-pages": "^5.0.0", | ||
"husky": "^8.0.3", | ||
"jest": "^29.5.0", | ||
"gh-pages": "^6.1.1", | ||
"husky": "^9.0.6", | ||
"jest": "^29.7.0", | ||
"jest-environment-jsdom": "^29.5.0", | ||
"locate-character": "^2", | ||
"locate-character": "^3.0.0", | ||
"markdown-toc": "^1", | ||
"np": "^8.0.4", | ||
"np": "^9.2.0", | ||
"npm-run-all": "^4", | ||
"prettier": "^2.8.8", | ||
"prettier-plugin-svelte": "^2.10.1", | ||
"prettier": "^3.2.4", | ||
"prettier-plugin-svelte": "^3.1.2", | ||
"rollup": "^2.70.1", | ||
"rollup-plugin-css-only": "^4.3.0", | ||
"rollup-plugin-css-only": "^4.5.2", | ||
"rollup-plugin-livereload": "^2", | ||
"rollup-plugin-serve": "^2.0.2", | ||
"rollup-plugin-svelte": "^7.1.5", | ||
"serve": "^14.2.0", | ||
"start-server-and-test": "~2.0.0", | ||
"rollup-plugin-svelte": "^7.1.6", | ||
"serve": "^14.2.1", | ||
"start-server-and-test": "~2.0.3", | ||
"svelte": "~3.59.1", | ||
"tslib": "^2.5.3", | ||
"typescript": "~5.1.3", | ||
"tslib": "^2.6.2", | ||
"typescript": "~5.3.3", | ||
"wait-for-expect": "^3" | ||
}, | ||
"peerDependencies": { | ||
"@guardian/libs": "^15.0.0" | ||
"@guardian/libs": "^15.0.0 || ^16.0.0" | ||
} | ||
} |
101500
2555