@iabtcf/cmpapi
Advanced tools
Comparing version 1.0.0-beta.31 to 1.0.0-beta.32
@@ -23,10 +23,2 @@ import { CustomCommands } from './CustomCommands'; | ||
/** | ||
* throwMaybe - checks to make sure the value is null or an encoded string is | ||
* passed with a publisher TC segment which is required in the CMP API. It | ||
* also checks to see if the we are disabled | ||
* | ||
* @param {string} str - value to check | ||
*/ | ||
private throwMaybe; | ||
/** | ||
* update - When the state of a CMP changes this function should be called | ||
@@ -33,0 +25,0 @@ * with the updated tc string and whether or not the UI is visible or not |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var CmpApiModel_1=require("./CmpApiModel"),status_1=require("./status"),CallResponder_1=require("./CallResponder"),core_1=require("@iabtcf/core"),CmpApi=function(){function e(e,p,t,i){void 0===t&&(t=!1),this.throwIfInvalidInt(e,"cmpId",2),this.throwIfInvalidInt(p,"cmpVersion",0),CmpApiModel_1.CmpApiModel.cmpId=e,CmpApiModel_1.CmpApiModel.cmpVersion=p,this.isServiceSpecific=!!t,this.callResponder=new CallResponder_1.CallResponder(i)}return Object.defineProperty(e.prototype,"tcModel",{set:function(e){console.error("@iabtcf/cmpapi: As of v1.0.0-beta.21 setting tcModel via CmpApi.tcModel is deprecated. Use cmpApi.update(tcString, uiVisible) instead"),console.log(" see: https://github.com/InteractiveAdvertisingBureau/iabtcf-es/tree/master/modules/cmpapi#cmpapi-examples")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tcString",{set:function(e){console.error("@iabtcf/cmpapi: As of v1.0.0-beta.21 setting tcString via CmpApi.tcString is deprecated. Use cmpApi.update(tcString, uiVisible) instead"),console.log(" see: https://github.com/InteractiveAdvertisingBureau/iabtcf-es/tree/master/modules/cmpapi#cmpapi-examples")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"uiVisible",{set:function(e){console.error("@iabtcf/cmpapi: As of v1.0.0-beta.21 setting uiVisible via CmpApi.uiVisible is deprecated. Use cmpApi.update(tcString, uiVisible) instead"),console.log(" see: https://github.com/InteractiveAdvertisingBureau/iabtcf-es/tree/master/modules/cmpapi#cmpapi-examples")},enumerable:!0,configurable:!0}),e.prototype.throwIfInvalidInt=function(e,p,t){if(!("number"==typeof e&&Number.isInteger(e)&&e>=t))throw new Error("Invalid "+p+": "+e)},e.prototype.throwMaybe=function(e){var p=null===e||""===e;if(CmpApiModel_1.CmpApiModel.disabled)throw new Error("CmpApi Disabled");if(!p&&"string"==typeof e&&~e.indexOf(".")){var t=e.split("."),i=!1;t.forEach((function(e){if(!i){var p=parseInt(core_1.Base64Url.decode(e.charAt(0)).substr(0,3),2);i=p===core_1.SegmentIDs.KEY_TO_ID[core_1.Segment.PUBLISHER_TC]}})),p=i}if(!p)throw CmpApiModel_1.CmpApiModel.cmpStatus=status_1.CmpStatus.ERROR,new Error("Invalid string: "+e+"! If encoded with @iabtcf/core, please make sure the it is encoded with TCString.encode(tcModel, {isForVendors:true}) encoding option")},e.prototype.update=function(e,p){void 0===p&&(p=!1),this.throwMaybe(e),CmpApiModel_1.CmpApiModel.cmpStatus=status_1.CmpStatus.LOADED,p?(CmpApiModel_1.CmpApiModel.displayStatus=status_1.DisplayStatus.VISIBLE,CmpApiModel_1.CmpApiModel.eventStatus=status_1.EventStatus.CMP_UI_SHOWN):void 0===CmpApiModel_1.CmpApiModel.tcModel?(CmpApiModel_1.CmpApiModel.displayStatus=status_1.DisplayStatus.DISABLED,CmpApiModel_1.CmpApiModel.eventStatus=status_1.EventStatus.TC_LOADED):(CmpApiModel_1.CmpApiModel.displayStatus=status_1.DisplayStatus.HIDDEN,CmpApiModel_1.CmpApiModel.eventStatus=status_1.EventStatus.USER_ACTION_COMPLETE),null===e?(CmpApiModel_1.CmpApiModel.gdprApplies=!1,CmpApiModel_1.CmpApiModel.tcModel=null):(CmpApiModel_1.CmpApiModel.gdprApplies=!0,""===e?(CmpApiModel_1.CmpApiModel.tcModel=new core_1.TCModel,CmpApiModel_1.CmpApiModel.tcModel.cmpId=CmpApiModel_1.CmpApiModel.cmpId,CmpApiModel_1.CmpApiModel.tcModel.cmpVersion=CmpApiModel_1.CmpApiModel.cmpVersion):CmpApiModel_1.CmpApiModel.tcModel=core_1.TCString.decode(e),CmpApiModel_1.CmpApiModel.tcModel.isServiceSpecific=this.isServiceSpecific,CmpApiModel_1.CmpApiModel.tcString=e),CmpApiModel_1.CmpApiModel.eventQueue.exec(),this.callResponder.purgeQueuedCalls()},e.prototype.disable=function(){CmpApiModel_1.CmpApiModel.disabled=!0,CmpApiModel_1.CmpApiModel.cmpStatus=status_1.CmpStatus.ERROR},e}();exports.CmpApi=CmpApi; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var CmpApiModel_1=require("./CmpApiModel"),status_1=require("./status"),CallResponder_1=require("./CallResponder"),core_1=require("@iabtcf/core"),CmpApi=function(){function e(e,p,i,t){void 0===i&&(i=!1),this.throwIfInvalidInt(e,"cmpId",2),this.throwIfInvalidInt(p,"cmpVersion",0),CmpApiModel_1.CmpApiModel.cmpId=e,CmpApiModel_1.CmpApiModel.cmpVersion=p,this.isServiceSpecific=!!i,this.callResponder=new CallResponder_1.CallResponder(t)}return Object.defineProperty(e.prototype,"tcModel",{set:function(e){console.error("@iabtcf/cmpapi: As of v1.0.0-beta.21 setting tcModel via CmpApi.tcModel is deprecated. Use cmpApi.update(tcString, uiVisible) instead"),console.log(" see: https://github.com/InteractiveAdvertisingBureau/iabtcf-es/tree/master/modules/cmpapi#cmpapi-examples")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tcString",{set:function(e){console.error("@iabtcf/cmpapi: As of v1.0.0-beta.21 setting tcString via CmpApi.tcString is deprecated. Use cmpApi.update(tcString, uiVisible) instead"),console.log(" see: https://github.com/InteractiveAdvertisingBureau/iabtcf-es/tree/master/modules/cmpapi#cmpapi-examples")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"uiVisible",{set:function(e){console.error("@iabtcf/cmpapi: As of v1.0.0-beta.21 setting uiVisible via CmpApi.uiVisible is deprecated. Use cmpApi.update(tcString, uiVisible) instead"),console.log(" see: https://github.com/InteractiveAdvertisingBureau/iabtcf-es/tree/master/modules/cmpapi#cmpapi-examples")},enumerable:!0,configurable:!0}),e.prototype.throwIfInvalidInt=function(e,p,i){if(!("number"==typeof e&&Number.isInteger(e)&&e>=i))throw new Error("Invalid "+p+": "+e)},e.prototype.update=function(e,p){if(void 0===p&&(p=!1),CmpApiModel_1.CmpApiModel.disabled)throw new Error("CmpApi Disabled");CmpApiModel_1.CmpApiModel.cmpStatus=status_1.CmpStatus.LOADED,p?(CmpApiModel_1.CmpApiModel.displayStatus=status_1.DisplayStatus.VISIBLE,CmpApiModel_1.CmpApiModel.eventStatus=status_1.EventStatus.CMP_UI_SHOWN):void 0===CmpApiModel_1.CmpApiModel.tcModel?(CmpApiModel_1.CmpApiModel.displayStatus=status_1.DisplayStatus.DISABLED,CmpApiModel_1.CmpApiModel.eventStatus=status_1.EventStatus.TC_LOADED):(CmpApiModel_1.CmpApiModel.displayStatus=status_1.DisplayStatus.HIDDEN,CmpApiModel_1.CmpApiModel.eventStatus=status_1.EventStatus.USER_ACTION_COMPLETE),null===e?(CmpApiModel_1.CmpApiModel.gdprApplies=!1,CmpApiModel_1.CmpApiModel.tcModel=null):(CmpApiModel_1.CmpApiModel.gdprApplies=!0,""===e?(CmpApiModel_1.CmpApiModel.tcModel=new core_1.TCModel,CmpApiModel_1.CmpApiModel.tcModel.cmpId=CmpApiModel_1.CmpApiModel.cmpId,CmpApiModel_1.CmpApiModel.tcModel.cmpVersion=CmpApiModel_1.CmpApiModel.cmpVersion):CmpApiModel_1.CmpApiModel.tcModel=core_1.TCString.decode(e),CmpApiModel_1.CmpApiModel.tcModel.isServiceSpecific=this.isServiceSpecific,CmpApiModel_1.CmpApiModel.tcString=e),CmpApiModel_1.CmpApiModel.eventQueue.exec(),this.callResponder.purgeQueuedCalls()},e.prototype.disable=function(){CmpApiModel_1.CmpApiModel.disabled=!0,CmpApiModel_1.CmpApiModel.cmpStatus=status_1.CmpStatus.ERROR},e}();exports.CmpApi=CmpApi; |
{ | ||
"name": "@iabtcf/cmpapi", | ||
"version": "1.0.0-beta.31", | ||
"version": "1.0.0-beta.32", | ||
"description": "Ensures other in-page digital marketing technologies have access to CMP transparency and consent information for the iab. Transparency and Consent Framework (TCF).", | ||
@@ -24,7 +24,7 @@ "author": "Chris Paterson <tcf@chrispaterson.io>", | ||
"peerDependencies": { | ||
"@iabtcf/core": "1.0.0-beta.31" | ||
"@iabtcf/core": "1.0.0-beta.32" | ||
}, | ||
"devDependencies": { | ||
"@iabtcf/stub": "1.0.0-beta.31", | ||
"@iabtcf/testing": "1.0.0-beta.31", | ||
"@iabtcf/stub": "1.0.0-beta.32", | ||
"@iabtcf/testing": "1.0.0-beta.32", | ||
"@istanbuljs/nyc-config-typescript": "^0.1.3", | ||
@@ -31,0 +31,0 @@ "@types/mocha": "^5.2.7", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
71367
431