@financial-times/cmp-client 4.2.0-beta.1 → 5.0.1
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/dist/index.cjs +164 -50
- package/dist/index.js +164 -50
- package/dist/scripts/cmp-static.js +2 -1
- package/dist/src/client.d.ts +1 -1
- package/dist/src/client.d.ts.map +1 -1
- package/dist/src/consent-parsers/__fixtures__/gpp.d.ts +20 -0
- package/dist/src/consent-parsers/__fixtures__/gpp.d.ts.map +1 -0
- package/dist/src/consent-parsers/__tests__/index.test.d.ts +2 -0
- package/dist/src/consent-parsers/__tests__/index.test.d.ts.map +1 -0
- package/dist/src/consent-parsers/gpp/__tests__/parse-gpp-consent.test.d.ts +2 -0
- package/dist/src/consent-parsers/gpp/__tests__/parse-gpp-consent.test.d.ts.map +1 -0
- package/dist/src/consent-parsers/gpp/index.d.ts +3 -0
- package/dist/src/consent-parsers/gpp/index.d.ts.map +1 -0
- package/dist/src/consent-parsers/index.d.ts +6 -0
- package/dist/src/consent-parsers/index.d.ts.map +1 -0
- package/dist/src/consent-parsers/tcfv2/__tests__/check-consent.test.d.ts.map +1 -0
- package/dist/src/{consent-ready/utils/get-parsed-consent.d.ts → consent-parsers/tcfv2/index.d.ts} +2 -7
- package/dist/src/consent-parsers/tcfv2/index.d.ts.map +1 -0
- package/dist/src/consent-ready/index.d.ts.map +1 -1
- package/dist/src/html/cmp-scripts.d.ts +2 -2
- package/dist/src/html/cmp-scripts.d.ts.map +1 -1
- package/dist/src/lib/configurators/ft-dot-com.d.ts +7 -0
- package/dist/src/lib/configurators/ft-dot-com.d.ts.map +1 -0
- package/dist/src/lib/configurators/index.d.ts +14 -0
- package/dist/src/lib/configurators/index.d.ts.map +1 -0
- package/dist/src/lib/constants.d.ts +0 -4
- package/dist/src/lib/constants.d.ts.map +1 -1
- package/dist/src/lib/properties.d.ts +1 -12
- package/dist/src/lib/properties.d.ts.map +1 -1
- package/dist/src/utils/url.d.ts +1 -12
- package/dist/src/utils/url.d.ts.map +1 -1
- package/package.json +1 -1
- package/typings/globals.d.ts +2 -1
- package/typings/types.d.ts +81 -4
- package/dist/src/consent-ready/utils/__tests__/check-consent.test.d.ts.map +0 -1
- package/dist/src/consent-ready/utils/__tests__/get-parsed-consent.test.d.ts +0 -2
- package/dist/src/consent-ready/utils/__tests__/get-parsed-consent.test.d.ts.map +0 -1
- package/dist/src/consent-ready/utils/get-parsed-consent.d.ts.map +0 -1
- /package/dist/src/{consent-ready/utils → consent-parsers/tcfv2}/__tests__/check-consent.test.d.ts +0 -0
|
@@ -1 +1,2 @@
|
|
|
1
|
-
(function(){"use strict";var M,P;const D=(e,{credentials:t="omit"}={})=>fetch(`https://session-next.ft.com${e}`,{credentials:t,useCorsProxy:!0}).then(n=>n.ok?n.json():n.text().then(o=>{throw new Error(`Next session responded with "${o}" (${n.status})`)})).catch(n=>{document.body.dispatchEvent(new CustomEvent("oErrors.log",{bubbles:!0,detail:{error:n,info:{component:"next-session-client"}}}))});let l={};const v=(e,t)=>{if(typeof e=="object"){l=e;return}if(typeof e=="string"&&typeof t=="string"){l[e]=t;return}if(typeof e=="string"&&typeof t>"u")return l[e]||null;if(typeof e>"u"&&typeof t>"u")return l;throw new Error("Invalid arguments")};v.clear=()=>{l={}};const m={},A=()=>{const[,e]=/FTSession_s=([^;]+)/.exec(document.cookie)||[];return e},R=()=>{const e=v("uuid");if(e)return Promise.resolve({uuid:e});const t=A();return t?(m.uuid||(m.uuid=D(`/sessions/s/${t}`).then(({uuid:n}={})=>(delete m.uuid,n&&v("uuid",n),{uuid:n}))),m.uuid):Promise.resolve({uuid:void 0})},I="sourcepoint-cmp",F="FTPINK",V="FTConsent",j="sourcepointCmp/VngD.XycZut.595cp9fWdp5XYP9vlFvk",H=".ft.com",x="https://consent.ft.com",w={permutiveAds:{purposes:[2,4,8,9],iabVendors:[361],customVendors:[],specialFeatures:[]},demographicAds:{purposes:[7,9,10],iabVendors:[],customVendors:[],specialFeatures:[]},behaviouralAds:{purposes:[2,4,8,9],iabVendors:[],customVendors:[],specialFeatures:[]},programmaticAds:{purposes:[2],iabVendors:[],customVendors:[],specialFeatures:[]},personalisedMarketing:{purposes:[2,7,8,9,10],iabVendors:[],customVendors:[],specialFeatures:[]}},E=Object.keys(w),d={joinHref:!0,gdpr:{},ccpa:{}},O={...d,accountId:1906,baseEndpoint:"https://consent-manager.ft.com",propertyHref:"https://local.ft.com",_clientOptions:{privacyManagerId:827767,manageCookiesLinkOverride:"ft.com/preferences/manage-cookies"}},_={...d,accountId:1906,baseEndpoint:"https://consent-manager.ft.com",propertyId:31642,_clientOptions:{privacyManagerId:827767,usnatPrivacyManagerId:944881,ccpaPrivacyManagerId:944882,manageCookiesLinkOverride:"ft.com/preferences/manage-cookies",rootDomain:"ft.com"}},U={...d,accountId:1906,baseEndpoint:"https://consent-manager.pwmnet.com",propertyId:33414,_clientOptions:{rootDomain:"pwmnet.com"}},q={...d,accountId:1906,baseEndpoint:"https://consent-manager.fdiintelligence.com",propertyId:34061,_clientOptions:{rootDomain:"fdiintelligence.com"}},$={...d,accountId:1906,baseEndpoint:"https://consent-manager.thebanker.com",propertyId:34060,_clientOptions:{rootDomain:"thebanker.com"}},G={...d,accountId:1906,baseEndpoint:"https://consent-manager.bankingriskandregulation.com",propertyId:34059,_clientOptions:{rootDomain:"bankingriskandregulation.com"}},W={...d,accountId:1906,baseEndpoint:"https://consent-manager.sustainableviews.com",propertyId:34058,_clientOptions:{rootDomain:"sustainableviews.com"}},K={...d,accountId:1906,baseEndpoint:"https://consent-manager.ftadviser.com",propertyId:33416,_clientOptions:{rootDomain:"ftadviser.com"}},B={...d,accountId:1906,baseEndpoint:"https://consent-manager.investorschronicle.co.uk",propertyId:33415,_clientOptions:{rootDomain:"investorschronicle.co.uk"}},J={...d,accountId:1906,baseEndpoint:"https://cdn.privacy-mgmt.com",propertyId:33947,_clientOptions:{rootDomain:"ignitesasia.com"}},X={...d,accountId:1906,baseEndpoint:"https://cdn.privacy-mgmt.com",propertyId:33946,_clientOptions:{rootDomain:"igniteseurope.com"}},Y={...d,accountId:1906,baseEndpoint:"https://consent-manager.mandatewire.com",propertyId:35490,_clientOptions:{rootDomain:"mandatewire.com"}},z=Object.freeze(Object.defineProperty({__proto__:null,FT_DOTCOM_PROD:_,FT_DOTCOM_TEST:O,MM_IGNITES_ASIA:J,MM_IGNITES_EUROPE:X,SP_BANKING_RR:G,SP_FDI_INTELLIGENCE:q,SP_FT_ADVISER:K,SP_INVESTORS_CHRONICLE:B,SP_MANDATE_WIRE:Y,SP_PWMNET:U,SP_SUSTAINABLE_VIEWS:W,SP_THE_BANKER:$},Symbol.toStringTag,{value:"Module"}));function S(e,t){const n=document.createElement("script");return n.dataset.cmpScript=e,n.innerHTML=t,n}function Z(e){const t=document.createElement("script");return t.src=e,t}const Q={cmpFrames:"https://consent-manager.ft.com/unified/wrapperMessagingWithoutDetection.js"},k={tcfStub:'"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(){var t=function(){var t,e,o=[],n=window,r=n;for(;r;){try{if(r.frames.__tcfapiLocator){t=r;break}}catch(t){}if(r===n.top)break;r=r.parent}t||(!function t(){var e=n.document,o=!!n.frames.__tcfapiLocator;if(!o)if(e.body){var r=e.createElement("iframe");r.style.cssText="display:none",r.name="__tcfapiLocator",r.title = "__tcfapiLocator",e.body.appendChild(r)}else setTimeout(t,5);return!o}(),n.__tcfapi=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return o;"setGdprApplies"===n[0]?n.length>3&&2===parseInt(n[1],10)&&"boolean"==typeof n[3]&&(e=n[3],"function"==typeof n[2]&&n[2]("set",!0)):"ping"===n[0]?"function"==typeof n[2]&&n[2]({gdprApplies:e,cmpLoaded:!1,cmpStatus:"stub"}):o.push(n)},n.addEventListener("message",(function(t){var e="string"==typeof t.data,o={};if(e)try{o=JSON.parse(t.data)}catch(t){}else o=t.data;var n="object"===_typeof(o)&&null!==o?o.__tcfapiCall:null;n&&window.__tcfapi(n.command,n.version,(function(o,r){var a={__tcfapiReturn:{returnValue:o,success:r,callId:n.callId}};t&&t.source&&t.source.postMessage&&t.source.postMessage(e?JSON.stringify(a):a,"*")}),n.parameter)}),!1))};"undefined"!=typeof module?module.exports=t:t()}();',uspStub:'"use strict";(function () { var e = false; var c = window; var t = document; function r() { if (!c.frames["__uspapiLocator"]) { if (t.body) { var a = t.body; var e = t.createElement("iframe"); e.style.cssText = "display:none"; e.name = "__uspapiLocator"; e.title = "__uspapiLocator";a.appendChild(e) } else { setTimeout(r, 5) } } } r(); function p() { var a = arguments; __uspapi.a = __uspapi.a || []; if (!a.length) { return __uspapi.a } else if (a[0] === "ping") { a[2]({ gdprAppliesGlobally: e, cmpLoaded: false }, true) } else { __uspapi.a.push([].slice.apply(a)) } } function l(t) { var r = typeof t.data === "string"; try { var a = r ? JSON.parse(t.data) : t.data; if (a.__cmpCall) { var n = a.__cmpCall; c.__uspapi(n.command, n.parameter, function (a, e) { var c = { __cmpReturn: { returnValue: a, success: e, callId: n.callId } }; t.source.postMessage(r ? JSON.stringify(c) : c, "*") }) } } catch (a) { } } if (typeof __uspapi !== "function") { c.__uspapi = p; __uspapi.msgHandler = l; c.addEventListener("message", l, false) } })();'};function ee(){const e=document.createDocumentFragment();return e.appendChild(S("tcf",k.tcfStub)),e.appendChild(S("usp",k.uspStub)),e.appendChild(Z(Q.cmpFrames)),e}function te(e){const{_clientOptions:t,...n}=e;window._sp_={config:n},window._sp_queue??(window._sp_queue=[]),document.head.appendChild(ee())}function ne(e,t,{formOfWordsId:n,cookieDomain:o}){const a=Object.keys(e).reduce((i,u)=>(i[u]={onsite:{status:e[u],lbi:!1,source:I,fow:n}},i),{});return t?{setConsentCookie:!0,formOfWordsId:n,consentSource:I,cookieDomain:o,data:a}:{data:a,cookieDomain:o}}function oe(e,{purpose:t,vendor:n,specialFeatureOptins:o}){const s=w[e],a=s.purposes.every(r=>(t==null?void 0:t.consents[r])||(t==null?void 0:t.legitimateInterests[r])),i=s.iabVendors.every(r=>(n==null?void 0:n.consents[r])||(n==null?void 0:n.legitimateInterests[r])),u=s.specialFeatures.every(r=>(o==null?void 0:o[r])===!0);return a&&i&&u}function se(e){const t=(e==null?void 0:e[2])==="N",n={};for(const o of E)n[o]=t;return n}async function ce(){const e=await new Promise((n,o)=>{var s;try{(s=window.__tcfapi)==null||s.call(window,"addEventListener",2,n)}catch(a){o(a)}}),t={};for(const n of E)t[n]=oe(n,e);return t}async function ae(e,t){return e==="ccpa"?se(t):await ce()}function re(){const t=Object.fromEntries(document.cookie.split("; ").map(o=>o.split("=")))[V];if(!t)return{};const n=decodeURIComponent(t);return Object.fromEntries(n.split(",").map(o=>{const[s,a]=o.split(":");return[s,a==="on"]}))}function ie(e,t){return Object.keys(e).some(o=>{const s=`${o.toLowerCase()}Onsite`;return e[o]!==t[s]})}function ue({userId:e,useConsentStore:t}){return!!e&&t===!0}function de(e,t){return e?`${t.consentProxyHost}/__consent/consent-record/${F}/${t.userId}`:`${t.consentProxyHost}/__consent/consent-record-cookie?cookieDomain=${t.cookieDomain}`}async function pe(e,t){try{const n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),credentials:"include"});n.ok||console.error("Unable to save consent preferences",n.status)}catch(n){console.error("An error occurred while saving consent",n)}}function le(e){return async function(n,o,s,a){if(e.disableFTCookies)return;const i=a.applies?n:"gdpr";if(i!==n||!s)return;const u=await ae(i,s);if(!ie(u,re()))return;const c=ue(e),f=de(c,e),y=ne(u,c,e);await pe(f,y),document.dispatchEvent(new CustomEvent("oCookieMessage.act",{bubbles:!0}))}}const C="cookie-message",fe="manage-cookies";let b=Object.freeze({activeComponent:C,messageId:0,privacyManagerId:0});function me(e){return typeof e=="object"&&e!==null&&e.constructor===Object&&Object.prototype.toString.call(e)==="[object Object]"}const _e=()=>({...b}),h=e=>{if(!me(e)){console.error("Invalid state changes");return}b={...b,...e}},ge=["adsDisableInternalCMP","pwm.cmp","messageSlotBottom"];function ye(e,t){const n=ve(e.flags);window._sp_queue=window._sp_queue??[],window._sp_queue.push(()=>{var o,s;for(const[a,i]of Object.entries(be))(s=(o=window._sp_).addEventListener)==null||s.call(o,a,i({...e,flags:n}))}),he({...e,flags:n},t)}function ve(e){const t={};return typeof e=="object"&&ge.forEach(n=>{Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}),t}function Ce(e){if(!e)return;const t=document.body,n=new CustomEvent("oTracking.event",{bubbles:!0,cancelable:!0,detail:e.detail});t.dispatchEvent(n)}function g({trackingProps:e,action:t,triggerAction:n}){let o;const s=_e(),{product:a,app:i,flags:u}=e;s.activeComponent===C?o=s.messageId:o=s.privacyManagerId;const r={detail:{component:{id:o,name:s.activeComponent,type:"overlay",subtype:"cmp"},category:"component",action:t,...n&&{trigger_action:n},...a&&{product:a},...i&&{app:i},custom:[{cookie_toggle_flag:u}],url:window.document.location.href||null}};Ce(r)}const be={onMessageChoiceSelect:e=>(t,n,o)=>{const a={11:"accept_all",12:"manage_cookies",13:"reject_all"}[o];a&&g({trackingProps:e,action:"click",triggerAction:a})},onMessageReady:e=>()=>{g({trackingProps:e,action:"view"})},onMessageReceiveData:()=>(e,t)=>{const{messageId:n}=t;n&&h({messageId:n})},onError:e=>(t,n)=>{g({trackingProps:e,action:"error",triggerAction:n})},onPMCancel:()=>()=>{h({activeComponent:C})}};function he(e,t){window.addEventListener("message",function(n){if(n.origin!==t)return;const o={1:"save_and_close",11:"accept_all",13:"reject_all"},{data:{fromPM:s,actionType:a,messageId:i="0"}={}}=n;s&&(+i&&h({activeComponent:fe,privacyManagerId:+i}),!(!a||!o[a])&&g({trackingProps:e,action:"click",triggerAction:o[a]}))},!1)}const Ie="4.2.0-beta.1";async function we({propertyConfig:e=_,userId:t,useFTSession:n=!0,consentProxyHost:o=x,cookieDomain:s=H,formOfWordsId:a=j,useConsentStore:i=!0,trackingContext:u={},disableFTCookies:r=!1}={}){if(typeof window>"u"){console.error("The CMP client can only be initialised in a browser context");return}if(window.FT_CMP_CLIENT_VERSION=Ie,!t&&n)try{const c=await R();t=c==null?void 0:c.uuid}catch(c){console.error(c)}if(!(e!=null&&e.accountId))throw new Error("Please pass a valid property config");t&&(e.authId=t),e.events&&(console.warn("[cmp-client] Passing an events map in the config is not supported and will be ignored. Please use window._sp_.addEventListener() to listen for events"),delete e.events),te(e),window._sp_queue.push(()=>{var c,f;(f=(c=window._sp_)==null?void 0:c.addEventListener)==null||f.call(c,"onConsentReady",le({userId:t,consentProxyHost:o,cookieDomain:s,formOfWordsId:a,useConsentStore:i,disableFTCookies:r}))}),ye(u,e.baseEndpoint)}function T(e,t,n,o,s,a){const{text:i,onClick:u}=o[t],r=document.querySelectorAll(`a[href*="${a}"]`);for(const c of r)(n||e)&&(s.has(c)&&c.removeEventListener("click",s.get(c)),c.innerText=i,c.addEventListener("click",u),s.set(c,u))}function Ee({_clientOptions:e}=_){const{privacyManagerId:t,ccpaPrivacyManagerId:n,usnatPrivacyManagerId:o,manageCookiesLinkOverride:s}=e??_._clientOptions,a={usnat:{text:"Do not sell my data",onClick:r=>{var c;r.preventDefault(),(c=window._sp_.usnat)==null||c.loadPrivacyManagerModal(o)}},ccpa:{text:"Do not sell my data",onClick:r=>{var c;r.preventDefault(),(c=window._sp_.ccpa)==null||c.loadPrivacyManagerModal(n)}},gdpr:{text:"Manage cookies",onClick:r=>{var c;r.preventDefault(),(c=window._sp_.gdpr)==null||c.loadPrivacyManagerModal(t)}}},i=new Map,u=function(r,c,f,y){console.log("handler called"),T(!1,r,y.applies,a,i,s),y.applies&&window._sp_queue.push(()=>{var N,L;(L=(N=window._sp_).removeEventListener)==null||L.call(N,"onConsentReady",u)})};T(!0,"gdpr",!1,a,i,s),window._sp_queue.push(()=>{var r,c;(c=(r=window._sp_).addEventListener)==null||c.call(r,"onConsentReady",u)})}function Oe(e,t){if(!t||Number.isFinite(parseFloat(t))||!e.endsWith(t))return!1;const n=e.indexOf(t),o=e[n-1];return o==="."||o===void 0}function Se(e){if(!e)throw new Error("Invalid hostname provided");let n=Object.values(z).find(o=>{var a;const s=(a=o._clientOptions)==null?void 0:a.rootDomain;return s&&Oe(e,s)});return n??(n=O),n}const ke=new URL(window.location.href).hostname,p=Se(ke);we({propertyConfig:p}),(M=p==null?void 0:p._clientOptions)!=null&&M.privacyManagerId&&((P=p==null?void 0:p._clientOptions)!=null&&P.manageCookiesLinkOverride)&&Ee(p)})();
|
|
1
|
+
(function(){"use strict";var M,L;const R=(e,{credentials:n="omit"}={})=>fetch(`https://session-next.ft.com${e}`,{credentials:n,useCorsProxy:!0}).then(t=>t.ok?t.json():t.text().then(o=>{throw new Error(`Next session responded with "${o}" (${t.status})`)})).catch(t=>{document.body.dispatchEvent(new CustomEvent("oErrors.log",{bubbles:!0,detail:{error:t,info:{component:"next-session-client"}}}))});let _={};const I=(e,n)=>{if(typeof e=="object"){_=e;return}if(typeof e=="string"&&typeof n=="string"){_[e]=n;return}if(typeof e=="string"&&typeof n>"u")return _[e]||null;if(typeof e>"u"&&typeof n>"u")return _;throw new Error("Invalid arguments")};I.clear=()=>{_={}};const v={},F=()=>{const[,e]=/FTSession_s=([^;]+)/.exec(document.cookie)||[];return e},U=()=>{const e=I("uuid");if(e)return Promise.resolve({uuid:e});const n=F();return n?(v.uuid||(v.uuid=R(`/sessions/s/${n}`).then(({uuid:t}={})=>(delete v.uuid,t&&I("uuid",t),{uuid:t}))),v.uuid):Promise.resolve({uuid:void 0})},O="sourcepoint-cmp",V="FTPINK",x="FTConsent",j="sourcepointCmp/VngD.XycZut.595cp9fWdp5XYP9vlFvk",H=".ft.com",q="https://consent.ft.com",E={permutiveAds:{purposes:[2,4,8,9],iabVendors:[361],customVendors:[],specialFeatures:[]},demographicAds:{purposes:[7,9,10],iabVendors:[],customVendors:[],specialFeatures:[]},behaviouralAds:{purposes:[2,4,8,9],iabVendors:[],customVendors:[],specialFeatures:[]},programmaticAds:{purposes:[2],iabVendors:[],customVendors:[],specialFeatures:[]},personalisedMarketing:{purposes:[2,7,8,9,10],iabVendors:[],customVendors:[],specialFeatures:[]}},C=Object.keys(E),d={joinHref:!0,gdpr:{}},T={...d,accountId:1906,baseEndpoint:"https://consent-manager.ft.com",propertyHref:"https://local.ft.com",_clientOptions:{privacyManagerId:827767,manageCookiesLinkOverride:"ft.com/preferences/manage-cookies",rootDomain:"ft.com"}},y={...d,accountId:1906,baseEndpoint:"https://consent-manager.ft.com",propertyId:31642,_clientOptions:{privacyManagerId:827767,usnatPrivacyManagerId:944881,ccpaPrivacyManagerId:944882,manageCookiesLinkOverride:"ft.com/preferences/manage-cookies",rootDomain:"ft.com"}},G={...d,accountId:1906,baseEndpoint:"https://consent-manager.pwmnet.com",propertyId:33414,_clientOptions:{rootDomain:"pwmnet.com"}},$={...d,accountId:1906,baseEndpoint:"https://consent-manager.fdiintelligence.com",propertyId:34061,_clientOptions:{rootDomain:"fdiintelligence.com"}},W={...d,accountId:1906,baseEndpoint:"https://consent-manager.thebanker.com",propertyId:34060,_clientOptions:{rootDomain:"thebanker.com"}},K={...d,accountId:1906,baseEndpoint:"https://consent-manager.bankingriskandregulation.com",propertyId:34059,_clientOptions:{rootDomain:"bankingriskandregulation.com"}},J={...d,accountId:1906,baseEndpoint:"https://consent-manager.sustainableviews.com",propertyId:34058,_clientOptions:{rootDomain:"sustainableviews.com"}},B={...d,accountId:1906,baseEndpoint:"https://consent-manager.ftadviser.com",propertyId:33416,_clientOptions:{rootDomain:"ftadviser.com"}},X={...d,accountId:1906,baseEndpoint:"https://consent-manager.investorschronicle.co.uk",propertyId:33415,_clientOptions:{rootDomain:"investorschronicle.co.uk"}},Y={...d,accountId:1906,baseEndpoint:"https://cdn.privacy-mgmt.com",propertyId:33947,_clientOptions:{rootDomain:"ignitesasia.com"}},z={...d,accountId:1906,baseEndpoint:"https://cdn.privacy-mgmt.com",propertyId:33946,_clientOptions:{rootDomain:"igniteseurope.com"}},Z={...d,accountId:1906,baseEndpoint:"https://consent-manager.mandatewire.com",propertyId:35490,_clientOptions:{rootDomain:"mandatewire.com"}},Q=Object.freeze(Object.defineProperty({__proto__:null,FT_DOTCOM_PROD:y,FT_DOTCOM_TEST:T,MM_IGNITES_ASIA:Y,MM_IGNITES_EUROPE:z,SP_BANKING_RR:K,SP_FDI_INTELLIGENCE:$,SP_FT_ADVISER:B,SP_INVESTORS_CHRONICLE:X,SP_MANDATE_WIRE:Z,SP_PWMNET:G,SP_SUSTAINABLE_VIEWS:J,SP_THE_BANKER:W},Symbol.toStringTag,{value:"Module"}));function k(e,n){const t=document.createElement("script");return t.dataset.cmpScript=e,t.innerHTML=n,t}function ee(e){const n=document.createElement("script");return n.src=e,n}const te={cmpFrames:"https://consent-manager.ft.com/unified/wrapperMessagingWithoutDetection.js"},N={tcfStub:'"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(){var t=function(){var t,e,o=[],n=window,r=n;for(;r;){try{if(r.frames.__tcfapiLocator){t=r;break}}catch(t){}if(r===n.top)break;r=r.parent}t||(!function t(){var e=n.document,o=!!n.frames.__tcfapiLocator;if(!o)if(e.body){var r=e.createElement("iframe");r.style.cssText="display:none",r.name="__tcfapiLocator",r.title = "__tcfapiLocator",e.body.appendChild(r)}else setTimeout(t,5);return!o}(),n.__tcfapi=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return o;"setGdprApplies"===n[0]?n.length>3&&2===parseInt(n[1],10)&&"boolean"==typeof n[3]&&(e=n[3],"function"==typeof n[2]&&n[2]("set",!0)):"ping"===n[0]?"function"==typeof n[2]&&n[2]({gdprApplies:e,cmpLoaded:!1,cmpStatus:"stub"}):o.push(n)},n.addEventListener("message",(function(t){var e="string"==typeof t.data,o={};if(e)try{o=JSON.parse(t.data)}catch(t){}else o=t.data;var n="object"===_typeof(o)&&null!==o?o.__tcfapiCall:null;n&&window.__tcfapi(n.command,n.version,(function(o,r){var a={__tcfapiReturn:{returnValue:o,success:r,callId:n.callId}};t&&t.source&&t.source.postMessage&&t.source.postMessage(e?JSON.stringify(a):a,"*")}),n.parameter)}),!1))};"undefined"!=typeof module?module.exports=t:t()}();',gppStub:`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,s=e.length>2?e[2]:null;if("ping"===t)p({gppVersion:"1.1",cmpStatus:"stub",cmpDisplayStatus:"hidden",signalStatus:"not ready",supportedAPIs:["2:tcfeuv2","5:tcfcav1","6:uspv1","7:usnatv1","8:uscav1","9:usvav1","10:uscov1","11:usutv1","12:usctv1"],cmpId:0,sectionList:[],applicableSections:[],gppString:"",parsedSections:{}},!0);else if("addEventListener"===t){"lastId"in __gpp||(__gpp.lastId=0),__gpp.lastId++;var n=__gpp.lastId;__gpp.events.push({id:n,callback:p,parameter:s}),p({eventName:"listenerRegistered",listenerId:n,data:!0,pingData:{gppVersion:"1.1",cmpStatus:"stub",cmpDisplayStatus:"hidden",signalStatus:"not ready",supportedAPIs:["2:tcfeuv2","5:tcfcav1","6:uspv1","7:usnatv1","8:uscav1","9:usvav1","10:uscov1","11:usutv1","12:usctv1"],cmpId:0,sectionList:[],applicableSections:[],gppString:"",parsedSections:{}}},!0)}else if("removeEventListener"===t){for(var a=!1,i=0;i<__gpp.events.length;i++)if(__gpp.events[i].id==s){__gpp.events.splice(i,1),a=!0;break}p({eventName:"listenerRemoved",listenerId:s,data:a,pingData:{gppVersion:"1.1",cmpStatus:"stub",cmpDisplayStatus:"hidden",signalStatus:"not ready",supportedAPIs:["2:tcfeuv2","5:tcfcav1","6:uspv1","7:usnatv1","8:uscav1","9:usvav1","10:uscov1","11:usutv1","12:usctv1"],cmpId:0,sectionList:[],applicableSections:[],gppString:"",parsedSections:{}}},!0)}else"hasSection"===t?p(!1,!0):"getSection"===t||"getField"===t?p(null,!0):__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 s=p.__gppCall;window.__gpp(s.command,(function(p,n){var a={__gppReturn:{returnValue:p,success:n,callId:s.callId}};e.source.postMessage(t?JSON.stringify(a):a,"*")}),"parameter"in s?s.parameter:null,"version"in s?s.version:"1.1")}},"__gpp"in window&&"function"==typeof window.__gpp||(window.__gpp=window.__gpp_stub,window.addEventListener("message",window.__gpp_msghandler,!1),window.__gpp_addFrame("__gppLocator"));
|
|
2
|
+
`};function ne(e){const n=document.createDocumentFragment();return n.appendChild(k("tcf",N.tcfStub)),e.includeUsNat&&n.appendChild(k("gpp",N.gppStub)),n.appendChild(ee(te.cmpFrames)),n}function oe(e,n){const{userId:t,includeUsNat:o}=n;return t&&(e.authId=t),o&&(e.usnat=e.usnat||{}),e}function se(e,n){const{_clientOptions:t,...o}=e,s=oe(o,n);window._sp_={config:s},window._sp_queue??(window._sp_queue=[]),document.head.appendChild(ne(n))}function re(e,n,{formOfWordsId:t,cookieDomain:o}){const r=Object.keys(e).reduce((i,c)=>(i[c]={onsite:{status:e[c],lbi:!1,source:O,fow:t}},i),{});return n?{setConsentCookie:!0,formOfWordsId:t,consentSource:O,cookieDomain:o,data:r}:{data:r,cookieDomain:o}}const m={CALIFORNIA:"uscav1",US_NATIONAL:"usnatv1"},P={[m.CALIFORNIA]:{excludedCategories:{personalisedMarketing:!0}},[m.US_NATIONAL]:{excludedCategories:{personalisedMarketing:!0}}};function ie(e){const{applicableSections:n,supportedAPIs:t}=e,o=n[0];if(o===-1||typeof o>"u")return;const s=t.find(i=>i.startsWith(`${o}:`));return s==null?void 0:s.split(":")[1]}function ce(e){const{SaleOptOut:n,SharingOptOut:t,Gpc:o}=e,{excludedCategories:s}=P[m.CALIFORNIA],r=n!==1&&t!==1&&!o,i={};for(const c of C){if(c in s){i[c]=!0;continue}i[c]=r}return i}function ae(e){const{SaleOptOut:n,SharingOptOut:t,TargetedAdvertisingOptOut:o}=e,{excludedCategories:s}=P[m.US_NATIONAL],r=n!==1&&t!==1&&o!==1,i={};for(const c of C){if(c in s){i[c]=!0;continue}i[c]=r}return i}const pe={[m.CALIFORNIA]:ce,[m.US_NATIONAL]:ae};async function ue(){const e=await new Promise((i,c)=>{try{window.__gpp?window.__gpp("ping",i):c(new Error("GPP API is not available on page"))}catch(a){c(a)}}),{parsedSections:n}=e,t=ie(e);if(!t||!n[t])throw new Error("GPP parser was called without an applicable section");const o=n[t],s=pe[t];if(!s||typeof s!="function")throw new Error(`No parser found for applicable GPP section: ${t}`);return s(o)}function de(e,{purpose:n,vendor:t,specialFeatureOptins:o}){const s=E[e],r=s.purposes.every(a=>(n==null?void 0:n.consents[a])||(n==null?void 0:n.legitimateInterests[a])),i=s.iabVendors.every(a=>(t==null?void 0:t.consents[a])||(t==null?void 0:t.legitimateInterests[a])),c=s.specialFeatures.every(a=>(o==null?void 0:o[a])===!0);return r&&i&&c}async function le(){const e=await new Promise((t,o)=>{try{window.__tcfapi?window.__tcfapi("addEventListener",2,t):o(new Error("TCF API is not available on page"))}catch(s){o(s)}}),n={};for(const t of C)n[t]=de(t,e);return n}async function fe(e){const t={gdpr:le,usnat:ue}[e];if(!t)throw new Error("Unable to update user consent. Unsupported consent legislation.");return t()}function ge(){const n=Object.fromEntries(document.cookie.split("; ").map(o=>o.split("=")))[x];if(!n)return{};const t=decodeURIComponent(n);return Object.fromEntries(t.split(",").map(o=>{const[s,r]=o.split(":");return[s,r==="on"]}))}function me(e,n){return Object.keys(e).some(o=>{const s=`${o.toLowerCase()}Onsite`;return e[o]!==n[s]})}function _e({userId:e,useConsentStore:n}){return!!e&&n===!0}function ve(e,n){return e?`${n.consentProxyHost}/__consent/consent-record/${V}/${n.userId}`:`${n.consentProxyHost}/__consent/consent-record-cookie?cookieDomain=${n.cookieDomain}`}async function ye(e,n){try{const t=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n),credentials:"include"});t.ok||console.error("Unable to save consent preferences",t.status)}catch(t){console.error("An error occurred while saving consent",t)}}function we(e){return async function(t,o,s,r){if(e.disableFTCookies||!e.includeUsNat&&t==="usnat")return;const i=r.applies?t:"gdpr";if(i!==t||!s)return;let c;try{c=await fe(i)}catch(g){console.error(g)}if(!c||!me(c,ge()))return;const p=_e(e),f=ve(p,e),u=re(c,p,e);await ye(f,u),document.dispatchEvent(new CustomEvent("oCookieMessage.act",{bubbles:!0}))}}const b="cookie-message",Ie="manage-cookies";let h=Object.freeze({activeComponent:b,messageId:0,privacyManagerId:0});function Ce(e){return typeof e=="object"&&e!==null&&e.constructor===Object&&Object.prototype.toString.call(e)==="[object Object]"}const be=()=>({...h}),S=e=>{if(!Ce(e)){console.error("Invalid state changes");return}h={...h,...e}},he=["adsDisableInternalCMP","pwm.cmp","messageSlotBottom"];function Se(e,n){const t=Oe(e.flags);window._sp_queue=window._sp_queue??[],window._sp_queue.push(()=>{var o,s;for(const[r,i]of Object.entries(Te))(s=(o=window._sp_).addEventListener)==null||s.call(o,r,i({...e,flags:t}))}),ke({...e,flags:t},n)}function Oe(e){const n={};return typeof e=="object"&&he.forEach(t=>{Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])}),n}function Ee(e){if(!e)return;const n=document.body,t=new CustomEvent("oTracking.event",{bubbles:!0,cancelable:!0,detail:e.detail});n.dispatchEvent(t)}function w({trackingProps:e,action:n,triggerAction:t}){let o;const s=be(),{product:r,app:i,flags:c}=e;s.activeComponent===b?o=s.messageId:o=s.privacyManagerId;const a={detail:{component:{id:o,name:s.activeComponent,type:"overlay",subtype:"cmp"},category:"component",action:n,...t&&{trigger_action:t},...r&&{product:r},...i&&{app:i},custom:[{cookie_toggle_flag:c}],url:window.document.location.href||null}};Ee(a)}const Te={onMessageChoiceSelect:e=>(n,t,o)=>{const r={11:"accept_all",12:"manage_cookies",13:"reject_all"}[o];r&&w({trackingProps:e,action:"click",triggerAction:r})},onMessageReady:e=>()=>{w({trackingProps:e,action:"view"})},onMessageReceiveData:()=>(e,n)=>{const{messageId:t}=n;t&&S({messageId:t})},onError:e=>(n,t)=>{w({trackingProps:e,action:"error",triggerAction:t})},onPMCancel:()=>()=>{S({activeComponent:b})}};function ke(e,n){window.addEventListener("message",function(t){if(t.origin!==n)return;const o={1:"save_and_close",11:"accept_all",13:"reject_all"},{data:{fromPM:s,actionType:r,messageId:i="0"}={}}=t;s&&(+i&&S({activeComponent:Ie,privacyManagerId:+i}),!(!r||!o[r])&&w({trackingProps:e,action:"click",triggerAction:o[r]}))},!1)}const Ne="5.0.1";async function Pe(e){const{useFTSession:n=!0,consentProxyHost:t=q,cookieDomain:o=H,formOfWordsId:s=j,useConsentStore:r=!0,trackingContext:i={},disableFTCookies:c=!1,includeUsNat:a=!1}=e||{};let{propertyConfig:p=y,userId:f}=e||{};if(typeof window>"u"){console.error("The CMP client can only be initialised in a browser context");return}if(window.FT_CMP_CLIENT_VERSION=Ne,!f&&n)try{const u=await U();f=u==null?void 0:u.uuid}catch(u){console.error(u)}p=Ae(p),se(p,{userId:f,includeUsNat:a}),window._sp_queue.push(()=>{var u,g;(g=(u=window._sp_)==null?void 0:u.addEventListener)==null||g.call(u,"onConsentReady",we({userId:f,consentProxyHost:t,cookieDomain:o,formOfWordsId:s,useConsentStore:r,disableFTCookies:c,includeUsNat:a}))}),Se(i,p.baseEndpoint)}function Ae(e){if(!(e!=null&&e.accountId))throw new Error("Please pass a valid property config");return e.events&&(console.warn("[cmp-client] Passing an events map in the config is not supported and will be ignored. Please use window._sp_.addEventListener() to listen for events"),delete e.events),e}function A(e,n,t,o,s,r){const{text:i,onClick:c}=o[n],a=document.querySelectorAll(`a[href*="${r}"]`);for(const p of a)(t||e)&&(s.has(p)&&p.removeEventListener("click",s.get(p)),p.innerText=i,p.addEventListener("click",c),s.set(p,c))}function Me({_clientOptions:e}=y){const{privacyManagerId:n,ccpaPrivacyManagerId:t,usnatPrivacyManagerId:o,manageCookiesLinkOverride:s}=e??y._clientOptions,r={usnat:{text:"Do not sell my data",onClick:a=>{var p;a.preventDefault(),(p=window._sp_.usnat)==null||p.loadPrivacyManagerModal(o)}},ccpa:{text:"Do not sell my data",onClick:a=>{var p;a.preventDefault(),(p=window._sp_.ccpa)==null||p.loadPrivacyManagerModal(t)}},gdpr:{text:"Manage Cookies",onClick:a=>{var p;a.preventDefault(),(p=window._sp_.gdpr)==null||p.loadPrivacyManagerModal(n)}}},i=new Map,c=function(a,p,f,u){A(!1,a,u.applies,r,i,s),u.applies&&window._sp_queue.push(()=>{var g,D;(D=(g=window._sp_).removeEventListener)==null||D.call(g,"onConsentReady",c)})};A(!0,"gdpr",!1,r,i,s),window._sp_queue??(window._sp_queue=[]),window._sp_queue.push(()=>{var a,p;(p=(a=window._sp_).addEventListener)==null||p.call(a,"onConsentReady",c)})}function Le(e){const n=document.querySelector(e);return n?JSON.parse(n.textContent||"{}"):{}}function De(){return{flags:Le("script#page-kit-flags-embed")}}function Re(e){const{includeUsNat:n}=e._clientOptions||{},{flags:t}=De();return t!=null&&t.adsEnableGpp||n?{includeUsNat:!0}:{}}const Fe={"ft.com":Re};function Ue(e){const{rootDomain:n}=e._clientOptions||{};if(!n)return{};const t=Fe[n];return!t||typeof t!="function"?{}:t(e)}function Ve(e,n){if(!n||Number.isFinite(parseFloat(n))||!e.endsWith(n))return!1;const t=e.indexOf(n),o=e[t-1];return o==="."||o===void 0}function xe(e){if(!e)throw new Error("Invalid hostname provided");let t=Object.values(Q).find(o=>{var r;if(o.propertyHref)return!1;const s=(r=o._clientOptions)==null?void 0:r.rootDomain;return s&&Ve(e,s)});return t??(t=T),t}const je=new URL(window.location.href).hostname,l=xe(je),He=Ue(l);Pe({propertyConfig:l,...He}),(M=l==null?void 0:l._clientOptions)!=null&&M.privacyManagerId&&((L=l==null?void 0:l._clientOptions)!=null&&L.manageCookiesLinkOverride)&&Me(l)})();
|
package/dist/src/client.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { CMPInitOptions } from "../typings/types.d.ts";
|
|
2
|
-
export declare function initSourcepointCmp(
|
|
2
|
+
export declare function initSourcepointCmp(options: CMPInitOptions): Promise<void>;
|
|
3
3
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/src/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAY,MAAM,uBAAuB,CAAC;AAWtE,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,cAAc,iBAiD/D"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { DeepPartial, GPP } from "../../../typings/types";
|
|
2
|
+
export declare function stubGppPingData(overrideMockData: DeepPartial<GPP.PingData>): void;
|
|
3
|
+
export declare function applyAndStubCaliforniaSection(overrides: Partial<GPP.CaliforniaSection>): void;
|
|
4
|
+
export declare function applyAndStubUsNatSection(overrides: Partial<GPP.UsNatSection>): void;
|
|
5
|
+
export declare function stubGppWithColorado(): void;
|
|
6
|
+
export declare const OPT_IN_CONSENT: {
|
|
7
|
+
permutiveAds: boolean;
|
|
8
|
+
demographicAds: boolean;
|
|
9
|
+
behaviouralAds: boolean;
|
|
10
|
+
programmaticAds: boolean;
|
|
11
|
+
personalisedMarketing: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare const OPT_OUT_CONSENT: {
|
|
14
|
+
permutiveAds: boolean;
|
|
15
|
+
demographicAds: boolean;
|
|
16
|
+
behaviouralAds: boolean;
|
|
17
|
+
programmaticAds: boolean;
|
|
18
|
+
personalisedMarketing: boolean;
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=gpp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gpp.d.ts","sourceRoot":"","sources":["../../../../src/consent-parsers/__fixtures__/gpp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAkD/D,wBAAgB,eAAe,CAAC,gBAAgB,EAAE,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,QAkB1E;AAED,wBAAgB,6BAA6B,CAAC,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,QAetF;AAED,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,QAe5E;AAED,wBAAgB,mBAAmB,SAIlC;AACD,eAAO,MAAM,cAAc;;;;;;CAM1B,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;CAM3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../../src/consent-parsers/__tests__/index.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-gpp-consent.test.d.ts","sourceRoot":"","sources":["../../../../../src/consent-parsers/gpp/__tests__/parse-gpp-consent.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/consent-parsers/gpp/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAO,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AA+EtE,wBAAsB,eAAe,gCA4BpC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Legislation, ParsedConsentState } from "../../typings/types";
|
|
2
|
+
/**
|
|
3
|
+
* Return a dictionary of booleans keyed by IAB category name.
|
|
4
|
+
*/
|
|
5
|
+
export declare function getParsedConsent(activeLegislation: Legislation): Promise<ParsedConsentState>;
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/consent-parsers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAItE;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,iBAAiB,EAAE,WAAW,+BAUpE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-consent.test.d.ts","sourceRoot":"","sources":["../../../../../src/consent-parsers/tcfv2/__tests__/check-consent.test.ts"],"names":[],"mappings":""}
|
package/dist/src/{consent-ready/utils/get-parsed-consent.d.ts → consent-parsers/tcfv2/index.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IabCustomCategoryName, ParsedConsentState, TCData } from "../../../typings/types";
|
|
2
2
|
/**
|
|
3
3
|
* Checks the consent for a specific custom purpose.
|
|
4
4
|
* @param categoryName - The custom IAB category identifier to check.
|
|
@@ -6,10 +6,5 @@ import type { TCData, ParsedConsentState, IabCustomCategoryName, Legislation } f
|
|
|
6
6
|
* @returns {boolean} - Returns true if consent is granted, otherwise false.
|
|
7
7
|
*/
|
|
8
8
|
export declare function checkConsentFor(categoryName: IabCustomCategoryName, { purpose, vendor, specialFeatureOptins }: Partial<TCData>): boolean;
|
|
9
|
-
export declare function parseCCPAConsent(ccpa: string | null): ParsedConsentState;
|
|
10
9
|
export declare function parseGDPRConsent(): Promise<ParsedConsentState>;
|
|
11
|
-
|
|
12
|
-
* Return a dictionary of booleans keyed by IAB category name.
|
|
13
|
-
*/
|
|
14
|
-
export declare function getParsedConsent(activeLegislation: Legislation, consentString: string): Promise<ParsedConsentState>;
|
|
15
|
-
//# sourceMappingURL=get-parsed-consent.d.ts.map
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/consent-parsers/tcfv2/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAGhG;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,YAAY,EAAE,qBAAqB,EACnC,EAAE,OAAO,EAAE,MAAM,EAAE,oBAAoB,EAAE,EAAE,OAAO,CAAC,MAAM,CAAC,GACzD,OAAO,CAmBT;AAED,wBAAsB,gBAAgB,gCAqBrC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/consent-ready/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AA8B/E,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,iBAAiB,iBAE7C,MAAM,gBACL,MAAM,iBACL,MAAM,eACR;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/consent-ready/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AA8B/E,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,iBAAiB,iBAE7C,MAAM,gBACL,MAAM,iBACL,MAAM,eACR;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,mBAwCrC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { SPConfig } from "../../typings/types";
|
|
1
|
+
import type { CMPInitOptions, SPConfig } from "../../typings/types";
|
|
2
2
|
/**
|
|
3
3
|
* Set up the config and event handlers for the CMP
|
|
4
4
|
* Then add the vendor scripts to the head of the document
|
|
5
5
|
*/
|
|
6
|
-
export declare function bootstrapCmp(config: SPConfig): void;
|
|
6
|
+
export declare function bootstrapCmp(config: SPConfig, options: CMPInitOptions): void;
|
|
7
7
|
//# sourceMappingURL=cmp-scripts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmp-scripts.d.ts","sourceRoot":"","sources":["../../../src/html/cmp-scripts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"cmp-scripts.d.ts","sourceRoot":"","sources":["../../../src/html/cmp-scripts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAsCpE;;;GAGG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,QAOrE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ft-dot-com.d.ts","sourceRoot":"","sources":["../../../../src/lib/configurators/ft-dot-com.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AA2BvD,wBAAgB,kBAAkB,CAAC,cAAc,EAAE,QAAQ;;;;EAS1D"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SPConfig } from "../../../typings/types";
|
|
2
|
+
export declare function getRuntimeOptions(activeProperty: SPConfig): Partial<{
|
|
3
|
+
propertyConfig: SPConfig;
|
|
4
|
+
userId: string;
|
|
5
|
+
useFTSession: boolean;
|
|
6
|
+
consentProxyHost: string;
|
|
7
|
+
cookieDomain: string;
|
|
8
|
+
formOfWordsId: string;
|
|
9
|
+
useConsentStore: boolean;
|
|
10
|
+
trackingContext: import("../../../typings/types").TrackingContext;
|
|
11
|
+
disableFTCookies: boolean;
|
|
12
|
+
includeUsNat: boolean;
|
|
13
|
+
}>;
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/configurators/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAWlE,wBAAgB,iBAAiB,CAAC,cAAc,EAAE,QAAQ;;;;;;;;;;;GAYzD"}
|
|
@@ -4,10 +4,6 @@ export declare const CONSENT_COOKIE_NAME = "FTConsent";
|
|
|
4
4
|
export declare const SOURCEPOINT_FOW_ID = "sourcepointCmp/VngD.XycZut.595cp9fWdp5XYP9vlFvk";
|
|
5
5
|
export declare const FT_COOKIE_DOMAIN = ".ft.com";
|
|
6
6
|
export declare const FT_CONSENT_PROXY_HOST = "https://consent.ft.com";
|
|
7
|
-
export declare const legislation: {
|
|
8
|
-
CCPA: string;
|
|
9
|
-
GDPR: string;
|
|
10
|
-
};
|
|
11
7
|
export declare const iabCustomCategories: {
|
|
12
8
|
readonly permutiveAds: {
|
|
13
9
|
readonly purposes: readonly [2, 4, 8, 9];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/lib/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,0BAA0B,oBAAoB,CAAC;AAC5D,eAAO,MAAM,qBAAqB,WAAW,CAAC;AAC9C,eAAO,MAAM,mBAAmB,cAAc,CAAC;AAE/C,eAAO,MAAM,kBAAkB,oDAAoD,CAAC;AACpF,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAC1C,eAAO,MAAM,qBAAqB,2BAA2B,CAAC;AAE9D,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/lib/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,0BAA0B,oBAAoB,CAAC;AAC5D,eAAO,MAAM,qBAAqB,WAAW,CAAC;AAC9C,eAAO,MAAM,mBAAmB,cAAc,CAAC;AAE/C,eAAO,MAAM,kBAAkB,oDAAoD,CAAC;AACpF,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAC1C,eAAO,MAAM,qBAAqB,2BAA2B,CAAC;AAE9D,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BtB,CAAC;AAEX,eAAO,MAAM,gBAAgB,wGAA8D,CAAC"}
|
|
@@ -10,10 +10,10 @@ export declare const FT_DOTCOM_TEST: {
|
|
|
10
10
|
_clientOptions: {
|
|
11
11
|
privacyManagerId: number;
|
|
12
12
|
manageCookiesLinkOverride: string;
|
|
13
|
+
rootDomain: string;
|
|
13
14
|
};
|
|
14
15
|
joinHref: boolean;
|
|
15
16
|
gdpr: {};
|
|
16
|
-
ccpa: {};
|
|
17
17
|
};
|
|
18
18
|
export declare const FT_DOTCOM_PROD: {
|
|
19
19
|
accountId: number;
|
|
@@ -28,7 +28,6 @@ export declare const FT_DOTCOM_PROD: {
|
|
|
28
28
|
};
|
|
29
29
|
joinHref: boolean;
|
|
30
30
|
gdpr: {};
|
|
31
|
-
ccpa: {};
|
|
32
31
|
};
|
|
33
32
|
export declare const SP_PWMNET: {
|
|
34
33
|
accountId: number;
|
|
@@ -39,7 +38,6 @@ export declare const SP_PWMNET: {
|
|
|
39
38
|
};
|
|
40
39
|
joinHref: boolean;
|
|
41
40
|
gdpr: {};
|
|
42
|
-
ccpa: {};
|
|
43
41
|
};
|
|
44
42
|
export declare const SP_FDI_INTELLIGENCE: {
|
|
45
43
|
accountId: number;
|
|
@@ -50,7 +48,6 @@ export declare const SP_FDI_INTELLIGENCE: {
|
|
|
50
48
|
};
|
|
51
49
|
joinHref: boolean;
|
|
52
50
|
gdpr: {};
|
|
53
|
-
ccpa: {};
|
|
54
51
|
};
|
|
55
52
|
export declare const SP_THE_BANKER: {
|
|
56
53
|
accountId: number;
|
|
@@ -61,7 +58,6 @@ export declare const SP_THE_BANKER: {
|
|
|
61
58
|
};
|
|
62
59
|
joinHref: boolean;
|
|
63
60
|
gdpr: {};
|
|
64
|
-
ccpa: {};
|
|
65
61
|
};
|
|
66
62
|
export declare const SP_BANKING_RR: {
|
|
67
63
|
accountId: number;
|
|
@@ -72,7 +68,6 @@ export declare const SP_BANKING_RR: {
|
|
|
72
68
|
};
|
|
73
69
|
joinHref: boolean;
|
|
74
70
|
gdpr: {};
|
|
75
|
-
ccpa: {};
|
|
76
71
|
};
|
|
77
72
|
export declare const SP_SUSTAINABLE_VIEWS: {
|
|
78
73
|
accountId: number;
|
|
@@ -83,7 +78,6 @@ export declare const SP_SUSTAINABLE_VIEWS: {
|
|
|
83
78
|
};
|
|
84
79
|
joinHref: boolean;
|
|
85
80
|
gdpr: {};
|
|
86
|
-
ccpa: {};
|
|
87
81
|
};
|
|
88
82
|
export declare const SP_FT_ADVISER: {
|
|
89
83
|
accountId: number;
|
|
@@ -94,7 +88,6 @@ export declare const SP_FT_ADVISER: {
|
|
|
94
88
|
};
|
|
95
89
|
joinHref: boolean;
|
|
96
90
|
gdpr: {};
|
|
97
|
-
ccpa: {};
|
|
98
91
|
};
|
|
99
92
|
export declare const SP_INVESTORS_CHRONICLE: {
|
|
100
93
|
accountId: number;
|
|
@@ -105,7 +98,6 @@ export declare const SP_INVESTORS_CHRONICLE: {
|
|
|
105
98
|
};
|
|
106
99
|
joinHref: boolean;
|
|
107
100
|
gdpr: {};
|
|
108
|
-
ccpa: {};
|
|
109
101
|
};
|
|
110
102
|
export declare const MM_IGNITES_ASIA: {
|
|
111
103
|
accountId: number;
|
|
@@ -116,7 +108,6 @@ export declare const MM_IGNITES_ASIA: {
|
|
|
116
108
|
};
|
|
117
109
|
joinHref: boolean;
|
|
118
110
|
gdpr: {};
|
|
119
|
-
ccpa: {};
|
|
120
111
|
};
|
|
121
112
|
export declare const MM_IGNITES_EUROPE: {
|
|
122
113
|
accountId: number;
|
|
@@ -127,7 +118,6 @@ export declare const MM_IGNITES_EUROPE: {
|
|
|
127
118
|
};
|
|
128
119
|
joinHref: boolean;
|
|
129
120
|
gdpr: {};
|
|
130
|
-
ccpa: {};
|
|
131
121
|
};
|
|
132
122
|
export declare const SP_MANDATE_WIRE: {
|
|
133
123
|
accountId: number;
|
|
@@ -138,6 +128,5 @@ export declare const SP_MANDATE_WIRE: {
|
|
|
138
128
|
};
|
|
139
129
|
joinHref: boolean;
|
|
140
130
|
gdpr: {};
|
|
141
|
-
ccpa: {};
|
|
142
131
|
};
|
|
143
132
|
//# sourceMappingURL=properties.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"properties.d.ts","sourceRoot":"","sources":["../../../src/lib/properties.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"properties.d.ts","sourceRoot":"","sources":["../../../src/lib/properties.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;CAU1B,CAAC;AAEF,eAAO,MAAM,cAAc;;;;;;;;;;;;;CAY1B,CAAC;AAEF,eAAO,MAAM,SAAS;;;;;;;;;CAQrB,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;CAQ/B,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;CAQzB,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;CAQzB,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;;;;;;;CAQhC,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;CAQzB,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;CAQlC,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;CAQ3B,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;CAQ7B,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;CAQ3B,CAAC"}
|
package/dist/src/utils/url.d.ts
CHANGED
|
@@ -16,10 +16,10 @@ export declare function getPropertyConfigByHostname(hostname: string): {
|
|
|
16
16
|
_clientOptions: {
|
|
17
17
|
privacyManagerId: number;
|
|
18
18
|
manageCookiesLinkOverride: string;
|
|
19
|
+
rootDomain: string;
|
|
19
20
|
};
|
|
20
21
|
joinHref: boolean;
|
|
21
22
|
gdpr: {};
|
|
22
|
-
ccpa: {};
|
|
23
23
|
} | {
|
|
24
24
|
accountId: number;
|
|
25
25
|
baseEndpoint: string;
|
|
@@ -33,7 +33,6 @@ export declare function getPropertyConfigByHostname(hostname: string): {
|
|
|
33
33
|
};
|
|
34
34
|
joinHref: boolean;
|
|
35
35
|
gdpr: {};
|
|
36
|
-
ccpa: {};
|
|
37
36
|
} | {
|
|
38
37
|
accountId: number;
|
|
39
38
|
baseEndpoint: string;
|
|
@@ -43,7 +42,6 @@ export declare function getPropertyConfigByHostname(hostname: string): {
|
|
|
43
42
|
};
|
|
44
43
|
joinHref: boolean;
|
|
45
44
|
gdpr: {};
|
|
46
|
-
ccpa: {};
|
|
47
45
|
} | {
|
|
48
46
|
accountId: number;
|
|
49
47
|
baseEndpoint: string;
|
|
@@ -53,7 +51,6 @@ export declare function getPropertyConfigByHostname(hostname: string): {
|
|
|
53
51
|
};
|
|
54
52
|
joinHref: boolean;
|
|
55
53
|
gdpr: {};
|
|
56
|
-
ccpa: {};
|
|
57
54
|
} | {
|
|
58
55
|
accountId: number;
|
|
59
56
|
baseEndpoint: string;
|
|
@@ -63,7 +60,6 @@ export declare function getPropertyConfigByHostname(hostname: string): {
|
|
|
63
60
|
};
|
|
64
61
|
joinHref: boolean;
|
|
65
62
|
gdpr: {};
|
|
66
|
-
ccpa: {};
|
|
67
63
|
} | {
|
|
68
64
|
accountId: number;
|
|
69
65
|
baseEndpoint: string;
|
|
@@ -73,7 +69,6 @@ export declare function getPropertyConfigByHostname(hostname: string): {
|
|
|
73
69
|
};
|
|
74
70
|
joinHref: boolean;
|
|
75
71
|
gdpr: {};
|
|
76
|
-
ccpa: {};
|
|
77
72
|
} | {
|
|
78
73
|
accountId: number;
|
|
79
74
|
baseEndpoint: string;
|
|
@@ -83,7 +78,6 @@ export declare function getPropertyConfigByHostname(hostname: string): {
|
|
|
83
78
|
};
|
|
84
79
|
joinHref: boolean;
|
|
85
80
|
gdpr: {};
|
|
86
|
-
ccpa: {};
|
|
87
81
|
} | {
|
|
88
82
|
accountId: number;
|
|
89
83
|
baseEndpoint: string;
|
|
@@ -93,7 +87,6 @@ export declare function getPropertyConfigByHostname(hostname: string): {
|
|
|
93
87
|
};
|
|
94
88
|
joinHref: boolean;
|
|
95
89
|
gdpr: {};
|
|
96
|
-
ccpa: {};
|
|
97
90
|
} | {
|
|
98
91
|
accountId: number;
|
|
99
92
|
baseEndpoint: string;
|
|
@@ -103,7 +96,6 @@ export declare function getPropertyConfigByHostname(hostname: string): {
|
|
|
103
96
|
};
|
|
104
97
|
joinHref: boolean;
|
|
105
98
|
gdpr: {};
|
|
106
|
-
ccpa: {};
|
|
107
99
|
} | {
|
|
108
100
|
accountId: number;
|
|
109
101
|
baseEndpoint: string;
|
|
@@ -113,7 +105,6 @@ export declare function getPropertyConfigByHostname(hostname: string): {
|
|
|
113
105
|
};
|
|
114
106
|
joinHref: boolean;
|
|
115
107
|
gdpr: {};
|
|
116
|
-
ccpa: {};
|
|
117
108
|
} | {
|
|
118
109
|
accountId: number;
|
|
119
110
|
baseEndpoint: string;
|
|
@@ -123,7 +114,6 @@ export declare function getPropertyConfigByHostname(hostname: string): {
|
|
|
123
114
|
};
|
|
124
115
|
joinHref: boolean;
|
|
125
116
|
gdpr: {};
|
|
126
|
-
ccpa: {};
|
|
127
117
|
} | {
|
|
128
118
|
accountId: number;
|
|
129
119
|
baseEndpoint: string;
|
|
@@ -133,6 +123,5 @@ export declare function getPropertyConfigByHostname(hostname: string): {
|
|
|
133
123
|
};
|
|
134
124
|
joinHref: boolean;
|
|
135
125
|
gdpr: {};
|
|
136
|
-
ccpa: {};
|
|
137
126
|
};
|
|
138
127
|
//# sourceMappingURL=url.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../src/utils/url.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAWtE;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../src/utils/url.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAWtE;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiB3D"}
|
package/package.json
CHANGED
package/typings/globals.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TCData } from "./types";
|
|
1
|
+
import { GPP, TCData } from "./types";
|
|
2
2
|
|
|
3
3
|
export {};
|
|
4
4
|
|
|
@@ -15,5 +15,6 @@ declare global {
|
|
|
15
15
|
};
|
|
16
16
|
_sp_queue: (() => void)[];
|
|
17
17
|
__tcfapi: (key: string, n: number, callback: (resp: TCData) => void) => void;
|
|
18
|
+
__gpp: (key: string, callback: (resp: GPP.PingData) => void) => void;
|
|
18
19
|
}
|
|
19
20
|
}
|
package/typings/types.d.ts
CHANGED
|
@@ -12,13 +12,13 @@ export type SPConfigClientOptions = {
|
|
|
12
12
|
ccpaPrivacyManagerId?: number;
|
|
13
13
|
manageCookiesLinkOverride?: string;
|
|
14
14
|
rootDomain?: string;
|
|
15
|
+
includeUsNat?: boolean;
|
|
15
16
|
};
|
|
16
17
|
|
|
17
18
|
export interface SPConfig {
|
|
18
19
|
accountId: number;
|
|
19
20
|
baseEndpoint: string;
|
|
20
21
|
gdpr: Record<string, unknown>;
|
|
21
|
-
ccpa: Record<string, unknown>;
|
|
22
22
|
usnat?: Record<string, unknown>;
|
|
23
23
|
propertyHref?: string;
|
|
24
24
|
propertyId?: number;
|
|
@@ -37,14 +37,15 @@ export type SPEventCallback = (
|
|
|
37
37
|
|
|
38
38
|
export type CMPInitOptions = Partial<{
|
|
39
39
|
propertyConfig: SPConfig;
|
|
40
|
-
userId
|
|
40
|
+
userId: string;
|
|
41
41
|
useFTSession: boolean;
|
|
42
42
|
consentProxyHost: string;
|
|
43
43
|
cookieDomain: string;
|
|
44
44
|
formOfWordsId: string;
|
|
45
45
|
useConsentStore: boolean;
|
|
46
|
-
trackingContext
|
|
46
|
+
trackingContext: TrackingContext;
|
|
47
47
|
disableFTCookies: boolean;
|
|
48
|
+
includeUsNat: boolean;
|
|
48
49
|
}>;
|
|
49
50
|
|
|
50
51
|
export interface ConsentPayloadOptions {
|
|
@@ -90,7 +91,7 @@ export interface IabCustomCategory {
|
|
|
90
91
|
|
|
91
92
|
export type IabCustomCategoryName = keyof typeof iabCustomCategories;
|
|
92
93
|
|
|
93
|
-
export type Legislation = "gdpr" | "
|
|
94
|
+
export type Legislation = "gdpr" | "usnat";
|
|
94
95
|
|
|
95
96
|
export interface RawConsentState {
|
|
96
97
|
gdpr: string | null;
|
|
@@ -201,3 +202,79 @@ export interface PrivacyManagerRegionId {
|
|
|
201
202
|
export interface regionConfig {
|
|
202
203
|
[key: string]: PrivacyManagerRegionId;
|
|
203
204
|
}
|
|
205
|
+
|
|
206
|
+
export namespace GPP {
|
|
207
|
+
/**
|
|
208
|
+
* https://github.com/InteractiveAdvertisingBureau/Global-Privacy-Platform/blob/main/Sections/US-National/IAB%20Privacy%E2%80%99s%20National%20Privacy%20Technical%20Specification.md#section-encoding
|
|
209
|
+
*/
|
|
210
|
+
export interface UsNatSection {
|
|
211
|
+
Version: number;
|
|
212
|
+
SharingNotice: 0 | 1 | 2;
|
|
213
|
+
SaleOptOutNotice: 0 | 1 | 2;
|
|
214
|
+
SharingOptOutNotice: 0 | 1 | 2;
|
|
215
|
+
TargetedAdvertisingOptOutNotice: 0 | 1 | 2;
|
|
216
|
+
SensitiveDataProcessingOptOutNotice: 0 | 1 | 2;
|
|
217
|
+
SensitiveDataLimitUseNotice: 0 | 1 | 2;
|
|
218
|
+
SaleOptOut: 0 | 1 | 2;
|
|
219
|
+
SharingOptOut: 0 | 1 | 2;
|
|
220
|
+
TargetedAdvertisingOptOut: 0 | 1 | 2;
|
|
221
|
+
SensitiveDataProcessing: Array<0 | 1 | 2>;
|
|
222
|
+
KnownChildSensitiveDataConsents: Array<0 | 1 | 2>;
|
|
223
|
+
PersonalDataConsents: 0 | 1 | 2;
|
|
224
|
+
MspaCoveredTransaction: 1 | 2;
|
|
225
|
+
MspaOptOutOptionMode: 0 | 1 | 2;
|
|
226
|
+
MspaServiceProviderMode: 0 | 1 | 2;
|
|
227
|
+
Gpc: boolean;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* https://github.com/InteractiveAdvertisingBureau/Global-Privacy-Platform/blob/main/Sections/US-States/CA/GPP%20Extension%3A%20IAB%20Privacy%E2%80%99s%20California%20Privacy%20Technical%20Specification.md
|
|
232
|
+
*/
|
|
233
|
+
export interface CaliforniaSection {
|
|
234
|
+
Version: number;
|
|
235
|
+
SaleOptOutNotice: 0 | 1 | 2;
|
|
236
|
+
SharingOptOutNotice: 0 | 1 | 2;
|
|
237
|
+
SensitiveDataLimitUseNotice: 0 | 1 | 2;
|
|
238
|
+
SaleOptOut: 0 | 1 | 2;
|
|
239
|
+
SharingOptOut: 0 | 1 | 2;
|
|
240
|
+
SensitiveDataProcessing: Array<0 | 1 | 2>;
|
|
241
|
+
KnownChildSensitiveDataConsents: Array<0 | 1 | 2>;
|
|
242
|
+
PersonalDataConsents: 0 | 1 | 2;
|
|
243
|
+
MspaCoveredTransaction: 1 | 2;
|
|
244
|
+
MspaOptOutOptionMode: 0 | 1 | 2;
|
|
245
|
+
MspaServiceProviderMode: 0 | 1 | 2;
|
|
246
|
+
Gpc: boolean;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
export interface ParsedSections {
|
|
250
|
+
uscav1: CaliforniaSection;
|
|
251
|
+
usnatv1: UsNatSection;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export type PingData = {
|
|
255
|
+
gppVersion: string;
|
|
256
|
+
cmpStatus: string;
|
|
257
|
+
cmpDisplayStatus: string;
|
|
258
|
+
signalStatus: string;
|
|
259
|
+
supportedAPIs: string[];
|
|
260
|
+
cmpId: number;
|
|
261
|
+
sectionList: number[];
|
|
262
|
+
applicableSections: number[];
|
|
263
|
+
gppString: string;
|
|
264
|
+
parsedSections: ParsedSections;
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
export type ParsedSectionKey = keyof ParsedSections;
|
|
268
|
+
|
|
269
|
+
export type ParsedSection = ParsedSections[ParsedSectionKey];
|
|
270
|
+
|
|
271
|
+
export interface ParseFunction {
|
|
272
|
+
(sectionData: ParsedSections[ParsedSectionKey]): ParsedConsentState;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
export type DeepPartial<T> = T extends object
|
|
277
|
+
? {
|
|
278
|
+
[P in keyof T]?: DeepPartial<T[P]>;
|
|
279
|
+
}
|
|
280
|
+
: T;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"check-consent.test.d.ts","sourceRoot":"","sources":["../../../../../src/consent-ready/utils/__tests__/check-consent.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-parsed-consent.test.d.ts","sourceRoot":"","sources":["../../../../../src/consent-ready/utils/__tests__/get-parsed-consent.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-parsed-consent.d.ts","sourceRoot":"","sources":["../../../../src/consent-ready/utils/get-parsed-consent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EACN,kBAAkB,EAClB,qBAAqB,EACrB,WAAW,EACZ,MAAM,wBAAwB,CAAC;AAIhC;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,YAAY,EAAE,qBAAqB,EACnC,EAAE,OAAO,EAAE,MAAM,EAAE,oBAAoB,EAAE,EAAE,OAAO,CAAC,MAAM,CAAC,GACzD,OAAO,CAmBT;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,sBAQnD;AAED,wBAAsB,gBAAgB,gCAerC;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,iBAAiB,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,+BAE3F"}
|
/package/dist/src/{consent-ready/utils → consent-parsers/tcfv2}/__tests__/check-consent.test.d.ts
RENAMED
|
File without changes
|