@financial-times/ads-personalised-consent
Advanced tools
Comparing version 5.0.1 to 5.1.0-beta.1
import { fetchLegislation } from '@financial-times/privacy-legislation-client'; | ||
/** @typedef {import("$typings/personalised-consent")} PersonalisedConsentTyping */ | ||
/** @type {PersonalisedConsentTyping.PersonalisedConsent} */ | ||
/** | ||
* @typedef {import("..").RegionalCompliance} RegionalCompliance | ||
* @typedef {import("..").ConsentInfo} ConsentInfo | ||
* @typedef {import("..").Legislation} Legislation | ||
* @typedef {import("..").Region} Region | ||
*/ | ||
class PersonalisedConsent { | ||
constructor() { | ||
this.privacyLegislation = { | ||
legislation: undefined, | ||
region: undefined | ||
}; | ||
this.gpcValue = false; | ||
this.consentCookie = { | ||
behavioral: false, | ||
demographic: false, | ||
programmatic: false | ||
}; | ||
} // existing legislation policies | ||
gpcValue = false; | ||
/** @type {RegionalCompliance} */ | ||
privacyLegislation = { | ||
legislation: undefined, | ||
region: undefined | ||
}; | ||
consentCookie = { | ||
behavioral: false, | ||
demographic: false, | ||
programmatic: false | ||
}; // existing legislation policies | ||
@@ -45,3 +47,3 @@ static legislationPolicy = { | ||
* by calling the 'fetchLegislation' function in package 'privacy-legislation-client' | ||
* @returns {Promise<PersonalisedConsentTyping.PrivacyLegislation>} | ||
* @returns {Promise<RegionalCompliance>} | ||
*/ | ||
@@ -81,3 +83,3 @@ | ||
* updateConsentCookie method updates the consent settings from `FTConsent` cookie | ||
* @returns {PersonalisedConsentTyping.ConsentInfo} | ||
* @returns {ConsentInfo} | ||
*/ | ||
@@ -137,3 +139,3 @@ | ||
* Otherwise, that type of personalised ads is allowed | ||
* @returns {PersonalisedConsentTyping.ConsentInfo} | ||
* @returns {ConsentInfo} | ||
*/ | ||
@@ -152,3 +154,3 @@ | ||
* getLegislation method returns the legislation policies which the user is subject to | ||
* @returns {PersonalisedConsentTyping.Legislation} | ||
* @returns {Legislation} | ||
*/ | ||
@@ -162,3 +164,3 @@ | ||
* getRegion method returns the region which the user is in | ||
* @returns {PersonalisedConsentTyping.Region} | ||
* @returns {Region} | ||
*/ | ||
@@ -182,3 +184,3 @@ | ||
* (i.e. personalised ads consent choices in 'FTConsent' cookie) | ||
* @returns {PersonalisedConsentTyping.ConsentInfo} | ||
* @returns {ConsentInfo} | ||
*/ | ||
@@ -194,6 +196,5 @@ | ||
* getPersonalisedConsent is a helper function that creates a new instance of PersonalisedConsent, and then returns it with all properties updated | ||
* @returns {Promise<PersonalisedConsentTyping.PersonalisedConsent>} | ||
* @returns {Promise<PersonalisedConsent>} | ||
*/ | ||
const getPersonalisedConsent = async () => { | ||
@@ -200,0 +201,0 @@ const pc = new PersonalisedConsent(); |
@@ -5,3 +5,11 @@ { | ||
"type": "module", | ||
"main": "dist/ads-personalised-consent.js", | ||
"typings": "./types.d.ts", | ||
"files": [ | ||
"dist/", | ||
"types.d.ts" | ||
], | ||
"exports": { | ||
".": "./dist/ads-personalised-consent.js" | ||
}, | ||
"main": "./dist/ads-personalised-consent.js", | ||
"dependencies": { | ||
@@ -15,3 +23,3 @@ "@financial-times/privacy-legislation-client": "^1.0.0" | ||
}, | ||
"version": "5.0.1" | ||
"version": "5.1.0-beta.1" | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
12629
4
179
2
1