Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@iabtcf/cmpapi

Package Overview
Dependencies
Maintainers
1
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@iabtcf/cmpapi - npm Package Compare versions

Comparing version 1.0.0-beta.10 to 1.0.0-beta.11

2

lib/CmpApiModel.js

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

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var status_1=require("./status"),EventListenerQueue_1=require("./EventListenerQueue"),core_1=require("@iabtcf/core"),CmpApiModel=function(){function t(){}return Object.defineProperty(t,"disabled",{get:function(){return this.disabled_},set:function(t){t&&(this.cmpStatus=status_1.CmpStatus.ERROR),this.disabled_=t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"uiVisible",{get:function(){return this.uiVisible_},set:function(t){t?(this.displayStatus=status_1.DisplayStatus.VISIBLE,this.eventStatus=status_1.EventStatus.CMP_UI_SHOWN):(this.displayStatus=status_1.DisplayStatus.DISABLED,this.eventStatus=status_1.EventStatus.TC_LOADED),this.uiVisible_=t},enumerable:!0,configurable:!0}),t.cacheTCString=function(t){this.tcString_=t},Object.defineProperty(t,"tcString",{get:function(){return this.tcString_},set:function(t){this.tcModel=core_1.TCString.decode(t),this.cacheTCString(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t,"tcModel",{get:function(){return this.tcModel_},set:function(t){if(null===t)this.gdprApplies=!1,this.displayStatus=status_1.DisplayStatus.DISABLED,this.tcModel_=null;else{if(!this.isTCModel(t))throw this.cmpStatus=status_1.CmpStatus.ERROR,new Error("Invalid value ("+t+") passed for tcModel");this.gdprApplies=!0,this.displayStatus=status_1.DisplayStatus.HIDDEN,void 0!==this.tcModel_?this.eventStatus=status_1.EventStatus.USER_ACTION_COMPLETE:this.eventStatus=status_1.EventStatus.TC_LOADED,this.tcModel_=t.clone(),this.tcString_=""}this.cmpStatus=status_1.CmpStatus.LOADED,this.eventQueue.exec()},enumerable:!0,configurable:!0}),t.isPurposeRestrictionVector=function(t){var e=t;return"function"==typeof e.add&&"function"==typeof e.getVendors&&"function"==typeof e.getRestrictionType&&"function"==typeof e.vendorHasRestriction&&"function"==typeof e.getMaxVendorId&&"function"==typeof e.getRestrictions&&"function"==typeof e.getPurposes&&"function"==typeof e.isEmpty&&"function"==typeof e.isEncodable},t.isVector=function(t){var e=t;return"number"==typeof e.maxId&&"function"==typeof e.has&&"function"==typeof e.set&&"function"==typeof e.empty&&"function"==typeof e.forEach&&"number"==typeof e.size&&"function"==typeof e.setAll},t.isTCModel=function(t){var e=t;return"boolean"==typeof e.isServiceSpecific&&"boolean"==typeof e.useNonStandardStacks&&"boolean"==typeof e.purposeOneTreatment&&"string"==typeof e.publisherCountryCode&&this.isVector(e.vendorsAllowed)&&this.isVector(e.vendorsDisclosed)&&this.isVector(e.purposeConsents)&&this.isVector(e.purposeLegitimateInterest)&&this.isVector(e.vendorConsents)&&this.isVector(e.vendorLegitimateInterest)&&this.isVector(e.specialFeatureOptIns)&&this.isVector(e.publisherConsents)&&this.isVector(e.publisherLegitimateInterest)&&this.isVector(e.publisherCustomConsents)&&this.isVector(e.publisherCustomLegitimateInterest)&&this.isPurposeRestrictionVector(e.publisherRestrictions)},t.reset=function(){delete this.tcModel_,delete this.tcString_,delete this.cmpId,delete this.cmpVersion,delete this.gdprApplies,delete this.eventStatus,this.uiVisible_=!1,this.disabled_=!1,this.cmpStatus=status_1.CmpStatus.LOADING,this.displayStatus=status_1.DisplayStatus.HIDDEN,this.eventQueue.clear()},t.apiVersion="2",t.tcfPolicyVersion=2,t.cmpStatus=status_1.CmpStatus.LOADING,t.displayStatus=status_1.DisplayStatus.HIDDEN,t.eventQueue=new EventListenerQueue_1.EventListenerQueue,t.uiVisible_=!1,t.disabled_=!1,t}();exports.CmpApiModel=CmpApiModel;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var status_1=require("./status"),EventListenerQueue_1=require("./EventListenerQueue"),core_1=require("@iabtcf/core"),CmpApiModel=function(){function t(){}return Object.defineProperty(t,"disabled",{get:function(){return this.disabled_},set:function(t){t&&(this.cmpStatus=status_1.CmpStatus.ERROR),this.disabled_=t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"uiVisible",{get:function(){return this.uiVisible_},set:function(t){t?(this.displayStatus=status_1.DisplayStatus.VISIBLE,this.eventStatus=status_1.EventStatus.CMP_UI_SHOWN):(this.displayStatus=status_1.DisplayStatus.DISABLED,this.eventStatus=status_1.EventStatus.TC_LOADED),this.uiVisible_=t},enumerable:!0,configurable:!0}),t.cacheTCString=function(t){this.tcString_=t},Object.defineProperty(t,"tcString",{get:function(){return this.tcString_},set:function(t){this.tcModel=core_1.TCString.decode(t),this.cacheTCString(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t,"tcModel",{get:function(){return this.tcModel_},set:function(t){if(null===t)this.gdprApplies=!1,this.displayStatus=status_1.DisplayStatus.DISABLED,this.tcModel_=null;else{if(!this.isTCModel(t))throw this.cmpStatus=status_1.CmpStatus.ERROR,new Error("Invalid value ("+t+") passed for tcModel");this.gdprApplies=!0,this.displayStatus=status_1.DisplayStatus.HIDDEN,void 0!==this.tcModel_?this.eventStatus=status_1.EventStatus.USER_ACTION_COMPLETE:this.eventStatus=status_1.EventStatus.TC_LOADED,this.tcModel_=t.clone(),this.tcString_=""}this.cmpStatus=status_1.CmpStatus.LOADED,this.eventQueue.exec()},enumerable:!0,configurable:!0}),t.isPurposeRestrictionVector=function(t){var e=t;return"function"==typeof e.add&&"function"==typeof e.getVendors&&"function"==typeof e.getRestrictionType&&"function"==typeof e.vendorHasRestriction&&"function"==typeof e.getMaxVendorId&&"function"==typeof e.getRestrictions&&"function"==typeof e.getPurposes&&"function"==typeof e.isEmpty&&"function"==typeof e.isEncodable},t.isVector=function(t){var e=t;return"number"==typeof e.maxId&&"function"==typeof e.has&&"function"==typeof e.set&&"function"==typeof e.empty&&"function"==typeof e.forEach&&"number"==typeof e.size&&"function"==typeof e.setAll},t.isTCModel=function(t){var e=t;return"boolean"==typeof e.isServiceSpecific&&"boolean"==typeof e.useNonStandardStacks&&"boolean"==typeof e.purposeOneTreatment&&"string"==typeof e.publisherCountryCode&&this.isVector(e.vendorsAllowed)&&this.isVector(e.vendorsDisclosed)&&this.isVector(e.purposeConsents)&&this.isVector(e.purposeLegitimateInterests)&&this.isVector(e.vendorConsents)&&this.isVector(e.vendorLegitimateInterests)&&this.isVector(e.specialFeatureOptIns)&&this.isVector(e.publisherConsents)&&this.isVector(e.publisherLegitimateInterests)&&this.isVector(e.publisherCustomConsents)&&this.isVector(e.publisherCustomLegitimateInterests)&&this.isPurposeRestrictionVector(e.publisherRestrictions)},t.reset=function(){delete this.tcModel_,delete this.tcString_,delete this.cmpId,delete this.cmpVersion,delete this.gdprApplies,delete this.eventStatus,this.uiVisible_=!1,this.disabled_=!1,this.cmpStatus=status_1.CmpStatus.LOADING,this.displayStatus=status_1.DisplayStatus.HIDDEN,this.eventQueue.clear()},t.apiVersion="2",t.tcfPolicyVersion=2,t.cmpStatus=status_1.CmpStatus.LOADING,t.displayStatus=status_1.DisplayStatus.HIDDEN,t.eventQueue=new EventListenerQueue_1.EventListenerQueue,t.uiVisible_=!1,t.disabled_=!1,t}();exports.CmpApiModel=CmpApiModel;
//# sourceMappingURL=CmpApiModel.js.map

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

"use strict";var __extends=this&&this.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),__read=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)s.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s},__spread=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(__read(arguments[t]));return e};Object.defineProperty(exports,"__esModule",{value:!0});var core_1=require("@iabtcf/core"),CmpApiModel_1=require("../CmpApiModel"),Response_1=require("./Response"),TCData=function(e){function t(t,r){var o=e.call(this)||this;if(o.eventStatus=CmpApiModel_1.CmpApiModel.eventStatus,o.cmpStatus=CmpApiModel_1.CmpApiModel.cmpStatus,o.listenerId=r,CmpApiModel_1.CmpApiModel.gdprApplies){var n=CmpApiModel_1.CmpApiModel.tcModel;CmpApiModel_1.CmpApiModel.tcString?o.tcString=CmpApiModel_1.CmpApiModel.tcString:(o.tcString=core_1.TCString.encode(n),CmpApiModel_1.CmpApiModel.cacheTCString(o.tcString)),o.isServiceSpecific=n.isServiceSpecific,o.useNonStandardStacks=n.useNonStandardStacks,o.purposeOneTreatment=n.purposeOneTreatment,o.publisherCC=n.publisherCountryCode,o.outOfBand={allowedVendors:o.createVectorField(n.vendorsAllowed,t),disclosedVendors:o.createVectorField(n.vendorsDisclosed,t)},o.purpose={consents:o.createVectorField(n.purposeConsents),legitimateInterests:o.createVectorField(n.purposeLegitimateInterest)},o.vendor={consents:o.createVectorField(n.vendorConsents,t),legitimateInterests:o.createVectorField(n.vendorLegitimateInterest,t)},o.specialFeatureOptins=o.createVectorField(n.specialFeatureOptIns),o.publisher={consents:o.createVectorField(n.publisherConsents),legitimateInterests:o.createVectorField(n.publisherLegitimateInterest),customPurpose:{consents:o.createVectorField(n.publisherCustomConsents),legitimateInterests:o.createVectorField(n.publisherCustomLegitimateInterest)},restrictions:o.createRestrictions(n.publisherRestrictions)}}return o}return __extends(t,e),t.prototype.createRestrictions=function(e){var t={};if(e.numRestrictions>0)for(var r=e.getMaxVendorId(),o=function(r){var o=r.toString();e.getRestrictions(r).forEach((function(e){var r=e.purposeId.toString();t[r]||(t[r]={}),t[r][o]=e.restrictionType}))},n=1;n<=r;n++)o(n);return t},t.prototype.createVectorField=function(e,t){return t?t.reduce((function(t,r){return t[r+""]=e.has(+r),t}),{}):__spread(e).reduce((function(e,t){return e[t[0].toString(10)]=t[1],e}),{})},t}(Response_1.Response);exports.TCData=TCData;
"use strict";var __extends=this&&this.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),__read=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)s.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s},__spread=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(__read(arguments[t]));return e};Object.defineProperty(exports,"__esModule",{value:!0});var core_1=require("@iabtcf/core"),CmpApiModel_1=require("../CmpApiModel"),Response_1=require("./Response"),TCData=function(e){function t(t,r){var o=e.call(this)||this;if(o.eventStatus=CmpApiModel_1.CmpApiModel.eventStatus,o.cmpStatus=CmpApiModel_1.CmpApiModel.cmpStatus,o.listenerId=r,CmpApiModel_1.CmpApiModel.gdprApplies){var n=CmpApiModel_1.CmpApiModel.tcModel;CmpApiModel_1.CmpApiModel.tcString?o.tcString=CmpApiModel_1.CmpApiModel.tcString:(o.tcString=core_1.TCString.encode(n),CmpApiModel_1.CmpApiModel.cacheTCString(o.tcString)),o.isServiceSpecific=n.isServiceSpecific,o.useNonStandardStacks=n.useNonStandardStacks,o.purposeOneTreatment=n.purposeOneTreatment,o.publisherCC=n.publisherCountryCode,o.outOfBand={allowedVendors:o.createVectorField(n.vendorsAllowed,t),disclosedVendors:o.createVectorField(n.vendorsDisclosed,t)},o.purpose={consents:o.createVectorField(n.purposeConsents),legitimateInterests:o.createVectorField(n.purposeLegitimateInterests)},o.vendor={consents:o.createVectorField(n.vendorConsents,t),legitimateInterests:o.createVectorField(n.vendorLegitimateInterests,t)},o.specialFeatureOptins=o.createVectorField(n.specialFeatureOptIns),o.publisher={consents:o.createVectorField(n.publisherConsents),legitimateInterests:o.createVectorField(n.publisherLegitimateInterests),customPurpose:{consents:o.createVectorField(n.publisherCustomConsents),legitimateInterests:o.createVectorField(n.publisherCustomLegitimateInterests)},restrictions:o.createRestrictions(n.publisherRestrictions)}}return o}return __extends(t,e),t.prototype.createRestrictions=function(e){var t={};if(e.numRestrictions>0)for(var r=e.getMaxVendorId(),o=function(r){var o=r.toString();e.getRestrictions(r).forEach((function(e){var r=e.purposeId.toString();t[r]||(t[r]={}),t[r][o]=e.restrictionType}))},n=1;n<=r;n++)o(n);return t},t.prototype.createVectorField=function(e,t){return t?t.reduce((function(t,r){return t[r+""]=e.has(+r),t}),{}):__spread(e).reduce((function(e,t){return e[t[0].toString(10)]=t[1],e}),{})},t}(Response_1.Response);exports.TCData=TCData;
//# sourceMappingURL=TCData.js.map
{
"name": "@iabtcf/cmpapi",
"version": "1.0.0-beta.10",
"version": "1.0.0-beta.11",
"description": "Ensures other in-page digital marketing technologies have access to CMP transparency and consent information for the iab. Transparency and Consent Framework (TCF).",

@@ -26,8 +26,8 @@ "author": "Chris Paterson <tcf@chrispaterson.io>",

"dependencies": {
"@iabtcf/core": "1.0.0-beta.10",
"@iabtcf/util": "1.0.0-beta.10"
"@iabtcf/core": "1.0.0-beta.11",
"@iabtcf/util": "1.0.0-beta.11"
},
"devDependencies": {
"@iabtcf/stub": "1.0.0-beta.10",
"@iabtcf/testing": "1.0.0-beta.10",
"@iabtcf/stub": "1.0.0-beta.11",
"@iabtcf/testing": "1.0.0-beta.11",
"@istanbuljs/nyc-config-typescript": "^0.1.3",

@@ -34,0 +34,0 @@ "@types/mocha": "^5.2.7",

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