Socket
Socket
Sign inDemoInstall

@guardian/libs

Package Overview
Dependencies
Maintainers
6
Versions
225
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@guardian/libs - npm Package Compare versions

Comparing version 0.0.0-canary-20240715101752 to 0.0.0-canary-20240717085735

dist/consent-management-platform/ccpa/api.cjs

6

dist/consent-management-platform/cmp.js
import { getCurrentFramework } from './getCurrentFramework.js';
import { mark } from './lib/mark.js';
import { PRIVACY_MANAGER_AUSTRALIA, PRIVACY_MANAGER_USNAT, PRIVACY_MANAGER_TCFV2 } from './lib/sourcepointConfig.js';
import { PRIVACY_MANAGER_AUSTRALIA, PRIVACY_MANAGER_CCPA, PRIVACY_MANAGER_TCFV2 } from './lib/sourcepointConfig.js';
import { init as init$1, willShowPrivacyMessage as willShowPrivacyMessage$1 } from './sourcepoint.js';

@@ -16,4 +16,4 @@

break;
case "usnat":
window._sp_?.usnat?.loadPrivacyManagerModal?.(PRIVACY_MANAGER_USNAT);
case "ccpa":
window._sp_?.ccpa?.loadPrivacyManagerModal?.(PRIVACY_MANAGER_CCPA);
break;

@@ -20,0 +20,0 @@ case "aus":

@@ -5,3 +5,3 @@ const getFramework = (countryCode) => {

case "US":
framework = "usnat";
framework = "ccpa";
break;

@@ -8,0 +8,0 @@ case "AU":

import { isGuardianDomain } from './domain.js';
const ACCOUNT_ID = 1257;
const PRIVACY_MANAGER_USNAT = 1068329;
const PROPERTY_ID = 7417;
const PROPERTY_ID_AUSTRALIA = 13348;
const PRIVACY_MANAGER_CCPA = 540252;
const PRIVACY_MANAGER_TCFV2 = 106842;

@@ -11,2 +11,2 @@ const PRIVACY_MANAGER_AUSTRALIA = 540341;

export { ACCOUNT_ID, ENDPOINT, PRIVACY_MANAGER_AUSTRALIA, PRIVACY_MANAGER_TCFV2, PRIVACY_MANAGER_USNAT, PROPERTY_ID, PROPERTY_ID_AUSTRALIA };
export { ACCOUNT_ID, ENDPOINT, PRIVACY_MANAGER_AUSTRALIA, PRIVACY_MANAGER_CCPA, PRIVACY_MANAGER_TCFV2, PROPERTY_ID, PROPERTY_ID_AUSTRALIA };
import { getConsentState as getConsentState$3 } from './aus/getConsentState.js';
import { getConsentState as getConsentState$2 } from './ccpa/getConsentState.js';
import { getCurrentFramework } from './getCurrentFramework.js';
import { getGpcSignal } from './lib/signals.js';
import { getConsentState as getConsentState$1 } from './tcfv2/getConsentState.js';
import { getConsentState as getConsentState$2 } from './usnat/getConsentState.js';

@@ -10,5 +10,4 @@ const callBackQueue = [];

const awaitingUserInteractionInTCFv2 = (state) => state.tcfv2?.eventStatus === "cmpuishown";
const awaitingUserInteractionInUSNAT = (state) => state.ccpa?.signalStatus === "not ready";
const invokeCallback = (callback, state) => {
if (awaitingUserInteractionInTCFv2(state) || awaitingUserInteractionInUSNAT(state)) {
if (awaitingUserInteractionInTCFv2(state)) {
return;

@@ -36,12 +35,5 @@ }

canTarget: !consentState.ccpa.doNotSell,
framework: "usnat",
framework: "ccpa",
gpcSignal
};
} else if (consentState.usnat) {
return {
...consentState,
canTarget: !consentState.usnat.doNotSell,
framework: "usnat",
gpcSignal
};
} else if (consentState.aus) {

@@ -68,9 +60,2 @@ return {

return enhanceConsentState({ ccpa: await getConsentState$2() });
case "usnat": {
const usnatConsentState = await getConsentState$2();
return enhanceConsentState({
ccpa: usnatConsentState,
usnat: usnatConsentState
});
}
case "tcfv2":

@@ -88,3 +73,3 @@ return enhanceConsentState({ tcfv2: await getConsentState$1() });

void getConsentState().then((state) => {
if (awaitingUserInteractionInTCFv2(state) || awaitingUserInteractionInUSNAT(state)) {
if (awaitingUserInteractionInTCFv2(state)) {
return;

@@ -91,0 +76,0 @@ }

@@ -32,15 +32,3 @@ import { log } from '../logger/logger.js';

invokeCallbacks();
let frameworkMessageType;
switch (framework) {
case "usnat":
frameworkMessageType = "usnat";
break;
case "aus":
frameworkMessageType = "ccpa";
break;
case "tcfv2":
default:
frameworkMessageType = "gdpr";
break;
}
const frameworkMessageType = framework == "tcfv2" ? "gdpr" : "ccpa";
const isInPropertyIdABTest = window.guardian?.config?.tests?.useSourcepointPropertyIdVariant === "variant";

@@ -147,9 +135,7 @@ log("cmp", `framework: ${framework}`);

break;
case "usnat":
window._sp_.config.usnat = {
case "ccpa":
window._sp_.config.ccpa = {
targetingParams: {
framework
},
includeUspApi: true,
transitionCCPAAuth: true
}
};

@@ -156,0 +142,0 @@ break;

@@ -1,2 +0,1 @@

import { stub_gpp_usnat } from './stub_gpp_usnat.js';
import { stub_tcfv2 } from './stub_tcfv2.js';

@@ -10,4 +9,3 @@ import { stub_uspapi_ccpa } from './stub_uspapi_ccpa.js';

break;
case "usnat":
stub_gpp_usnat();
case "ccpa":
stub_uspapi_ccpa();

@@ -14,0 +12,0 @@ break;

import { CountryCode } from '../../countries/@types/CountryCode.js';
import { VendorName } from '../vendors.js';
import { AUSConsentState } from './aus.js';
import { CCPAConsentState } from './ccpa.js';
import { TCFv2ConsentState } from './tcfv2/index.js';
import { USNATConsentState } from './usnat.js';
type ConsentFramework = 'tcfv2' | 'ccpa' | 'aus' | 'usnat';
type ConsentFramework = 'tcfv2' | 'ccpa' | 'aus';
type CMP = {

@@ -27,5 +27,3 @@ init: InitCMP;

tcfv2?: TCFv2ConsentState;
/** @deprecated CCPA has been deprecated. Please use usnat */
ccpa?: USNATConsentState;
usnat?: USNATConsentState;
ccpa?: CCPAConsentState;
aus?: AUSConsentState;

@@ -32,0 +30,0 @@ gpcSignal?: boolean;

@@ -1,3 +0,3 @@

var version = "0.0.0-canary-20240715101752";
var version = "0.0.0-canary-20240717085735";
export { version };
{
"name": "@guardian/libs",
"version": "0.0.0-canary-20240715101752",
"version": "0.0.0-canary-20240717085735",
"private": false,

@@ -5,0 +5,0 @@ "description": "A collection of JavaScript libraries and TypeScript types for Guardian projects",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc