@iabtcf/cmpapi
Advanced tools
Comparing version 1.2.1-0 to 1.2.1-1
@@ -1,1 +0,1 @@ | ||
"use strict";var __read=this&&this.__read||function(o,n){var e="function"==typeof Symbol&&o[Symbol.iterator];if(!e)return o;var a,t,i=e.call(o),m=[];try{for(;(void 0===n||n-- >0)&&!(a=i.next()).done;)m.push(a.value)}catch(o){t={error:o}}finally{try{a&&!a.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}return m},__spread=this&&this.__spread||function(){for(var o=[],n=0;n<arguments.length;n++)o=o.concat(__read(arguments[n]));return o};Object.defineProperty(exports,"__esModule",{value:!0});var command_1=require("./command"),CommandMap_1=require("./command/CommandMap"),CmpApiModel_1=require("./CmpApiModel"),Disabled_1=require("./response/Disabled"),SupportedVersions_1=require("./SupportedVersions");exports.API_KEY="__tcfapi";var CallResponder=function(){function o(o){var n,e;if(o){var a=command_1.TCFCommand.ADD_EVENT_LISTENER;if(null===(n=o)||void 0===n?void 0:n[a])throw new Error("Built-In Custom Commmand for "+a+" not allowed: Use "+command_1.TCFCommand.GET_TC_DATA+" instead");if(a=command_1.TCFCommand.REMOVE_EVENT_LISTENER,null===(e=o)||void 0===e?void 0:e[a])throw new Error("Built-In Custom Commmand for "+a+" not allowed");this.customCommands=o}try{this.callQueue=window[exports.API_KEY]()||[]}catch(o){this.callQueue=[]}finally{window[exports.API_KEY]=this.apiCall.bind(this),this.purgeQueuedCalls()}}return o.prototype.apiCall=function(o,n,e){for(var a,t=[],i=3;i<arguments.length;i++)t[i-3]=arguments[i];if("string"!=typeof o)e(null,!1);else if(SupportedVersions_1.SupportedVersions.has(n)){if("function"!=typeof e)throw new Error("invalid callback function");CmpApiModel_1.CmpApiModel.disabled?e(new Disabled_1.Disabled,!1):this.isCustomCommand(o)||this.isBuiltInCommand(o)?this.isCustomCommand(o)&&!this.isBuiltInCommand(o)?(a=this.customCommands)[o].apply(a,__spread([e],t)):o===command_1.TCFCommand.PING?this.isCustomCommand(o)?new CommandMap_1.CommandMap[o](this.customCommands[o],t[0],null,e):new CommandMap_1.CommandMap[o](e,t[0]):void 0===CmpApiModel_1.CmpApiModel.tcModel?this.callQueue.push(__spread([o,n,e],t)):this.isCustomCommand(o)&&this.isBuiltInCommand(o)?new CommandMap_1.CommandMap[o](this.customCommands[o],t[0],null,e):new CommandMap_1.CommandMap[o](e,t[0]):e(null,!1)}else e(null,!1)},o.prototype.purgeQueuedCalls=function(){var o=this.callQueue;this.callQueue=[],o.forEach((function(o){window[exports.API_KEY].apply(window,__spread(o))}))},o.prototype.isCustomCommand=function(o){return this.customCommands&&"function"==typeof this.customCommands[o]},o.prototype.isBuiltInCommand=function(o){return void 0!==CommandMap_1.CommandMap[o]},o}();exports.CallResponder=CallResponder; | ||
"use strict";var __read=this&&this.__read||function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var a,e,t=m.call(o),i=[];try{for(;(void 0===n||n-- >0)&&!(a=t.next()).done;)i.push(a.value)}catch(o){e={error:o}}finally{try{a&&!a.done&&(m=t.return)&&m.call(t)}finally{if(e)throw e.error}}return i},__spread=this&&this.__spread||function(){for(var o=[],n=0;n<arguments.length;n++)o=o.concat(__read(arguments[n]));return o};Object.defineProperty(exports,"__esModule",{value:!0});var command_1=require("./command"),CommandMap_1=require("./command/CommandMap"),CmpApiModel_1=require("./CmpApiModel"),Disabled_1=require("./response/Disabled"),SupportedVersions_1=require("./SupportedVersions");exports.API_KEY="__tcfapi";var CallResponder=function(){function o(o){var n,m,a;if(o){var e=command_1.TCFCommand.ADD_EVENT_LISTENER;if(null===(n=o)||void 0===n?void 0:n[e])throw new Error("Built-In Custom Commmand for "+e+" not allowed: Use "+command_1.TCFCommand.GET_TC_DATA+" instead");if(e=command_1.TCFCommand.REMOVE_EVENT_LISTENER,null===(m=o)||void 0===m?void 0:m[e])throw new Error("Built-In Custom Commmand for "+e+" not allowed");(null===(a=o)||void 0===a?void 0:a[command_1.TCFCommand.GET_TC_DATA])&&(o[command_1.TCFCommand.ADD_EVENT_LISTENER]=o[command_1.TCFCommand.GET_TC_DATA],o[command_1.TCFCommand.REMOVE_EVENT_LISTENER]=o[command_1.TCFCommand.GET_TC_DATA]),this.customCommands=o}try{this.callQueue=window[exports.API_KEY]()||[]}catch(o){this.callQueue=[]}finally{window[exports.API_KEY]=this.apiCall.bind(this),this.purgeQueuedCalls()}}return o.prototype.apiCall=function(o,n,m){for(var a,e=[],t=3;t<arguments.length;t++)e[t-3]=arguments[t];if("string"!=typeof o)m(null,!1);else if(SupportedVersions_1.SupportedVersions.has(n)){if("function"!=typeof m)throw new Error("invalid callback function");CmpApiModel_1.CmpApiModel.disabled?m(new Disabled_1.Disabled,!1):this.isCustomCommand(o)||this.isBuiltInCommand(o)?this.isCustomCommand(o)&&!this.isBuiltInCommand(o)?(a=this.customCommands)[o].apply(a,__spread([m],e)):o===command_1.TCFCommand.PING?this.isCustomCommand(o)?new CommandMap_1.CommandMap[o](this.customCommands[o],e[0],null,m):new CommandMap_1.CommandMap[o](m,e[0]):void 0===CmpApiModel_1.CmpApiModel.tcModel?this.callQueue.push(__spread([o,n,m],e)):this.isCustomCommand(o)&&this.isBuiltInCommand(o)?new CommandMap_1.CommandMap[o](this.customCommands[o],e[0],null,m):new CommandMap_1.CommandMap[o](m,e[0]):m(null,!1)}else m(null,!1)},o.prototype.purgeQueuedCalls=function(){var o=this.callQueue;this.callQueue=[],o.forEach((function(o){window[exports.API_KEY].apply(window,__spread(o))}))},o.prototype.isCustomCommand=function(o){return this.customCommands&&"function"==typeof this.customCommands[o]},o.prototype.isBuiltInCommand=function(o){return void 0!==CommandMap_1.CommandMap[o]},o}();exports.CallResponder=CallResponder; |
{ | ||
"name": "@iabtcf/cmpapi", | ||
"version": "1.2.1-0", | ||
"version": "1.2.1-1", | ||
"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,4 +26,4 @@ "author": "Chris Paterson <tcf@chrispaterson.io>", | ||
"devDependencies": { | ||
"@iabtcf/stub": "1.2.1-0", | ||
"@iabtcf/testing": "1.2.1-0", | ||
"@iabtcf/stub": "1.2.1-1", | ||
"@iabtcf/testing": "1.2.1-1", | ||
"@istanbuljs/nyc-config-typescript": "^0.1.3", | ||
@@ -30,0 +30,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
58563