Comparing version 1.1.2 to 1.1.3
@@ -67,3 +67,3 @@ var Butter = | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 12); | ||
/******/ return __webpack_require__(__webpack_require__.s = 11); | ||
/******/ }) | ||
@@ -330,7 +330,7 @@ /************************************************************************/ | ||
var utils = __webpack_require__(0); | ||
var buildURL = __webpack_require__(19); | ||
var parseHeaders = __webpack_require__(24); | ||
var buildURL = __webpack_require__(18); | ||
var parseHeaders = __webpack_require__(23); | ||
var transformData = __webpack_require__(2); | ||
var isURLSameOrigin = __webpack_require__(23); | ||
var btoa = window.btoa || __webpack_require__(18); | ||
var isURLSameOrigin = __webpack_require__(22); | ||
var btoa = window.btoa || __webpack_require__(17); | ||
@@ -410,3 +410,3 @@ module.exports = function xhrAdapter(resolve, reject, config) { | ||
if (utils.isStandardBrowserEnv()) { | ||
var cookies = __webpack_require__(21); | ||
var cookies = __webpack_require__(20); | ||
@@ -657,12 +657,6 @@ // Add xsrf header | ||
module.exports = __webpack_require__(13); | ||
module.exports = __webpack_require__(12); | ||
/***/ }), | ||
/* 11 */ | ||
/***/ (function(module, exports) { | ||
module.exports = {"name":"buttercms","version":"1.1.2","description":"ButterCMS API Client","keywords":["buttercms","butter","cms","api"],"engines":{"node":">=0.10.32"},"scripts":{"build":"webpack && uglifyjs ./dist/butter.js -c -m -o ./dist/butter.min.js"},"homepage":"https://github.com/buttercms/buttercms-js","author":"ButterCMS <support@buttercms.com>","repository":{"type":"git","url":"git://github.com/buttercms/buttercms-js.git"},"main":"lib/butter.js","types":"lib/butter.d.ts","dependencies":{"axios":"0.9.1"},"license":"MIT","devDependencies":{"uglify-js":"^2.8.22","webpack":"^2.5.0"}} | ||
/***/ }), | ||
/* 12 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
@@ -673,4 +667,5 @@ | ||
var BUTTER_CLIENT_VERSION = '1.1.3'; | ||
var axios = __webpack_require__(10); | ||
var config = __webpack_require__(11); | ||
@@ -721,3 +716,3 @@ var resources = { | ||
timeout: timeout, | ||
headers: {'X-Butter-Client': 'JS/' + config.version} | ||
headers: {'X-Butter-Client': 'JS/' + BUTTER_CLIENT_VERSION} | ||
}); | ||
@@ -745,3 +740,3 @@ | ||
/***/ }), | ||
/* 13 */ | ||
/* 12 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
@@ -752,9 +747,9 @@ | ||
var defaults = __webpack_require__(16); | ||
var defaults = __webpack_require__(15); | ||
var utils = __webpack_require__(0); | ||
var dispatchRequest = __webpack_require__(15); | ||
var InterceptorManager = __webpack_require__(14); | ||
var isAbsoluteURL = __webpack_require__(22); | ||
var combineURLs = __webpack_require__(20); | ||
var bind = __webpack_require__(17); | ||
var dispatchRequest = __webpack_require__(14); | ||
var InterceptorManager = __webpack_require__(13); | ||
var isAbsoluteURL = __webpack_require__(21); | ||
var combineURLs = __webpack_require__(19); | ||
var bind = __webpack_require__(16); | ||
var transformData = __webpack_require__(2); | ||
@@ -843,3 +838,3 @@ | ||
}; | ||
axios.spread = __webpack_require__(25); | ||
axios.spread = __webpack_require__(24); | ||
@@ -875,3 +870,3 @@ // Expose interceptors | ||
/***/ }), | ||
/* 14 */ | ||
/* 13 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
@@ -935,3 +930,3 @@ | ||
/***/ }), | ||
/* 15 */ | ||
/* 14 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
@@ -975,6 +970,6 @@ | ||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(26))) | ||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(25))) | ||
/***/ }), | ||
/* 16 */ | ||
/* 15 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
@@ -1049,3 +1044,3 @@ | ||
/***/ }), | ||
/* 17 */ | ||
/* 16 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
@@ -1068,3 +1063,3 @@ | ||
/***/ }), | ||
/* 18 */ | ||
/* 17 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
@@ -1112,3 +1107,3 @@ | ||
/***/ }), | ||
/* 19 */ | ||
/* 18 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
@@ -1187,3 +1182,3 @@ | ||
/***/ }), | ||
/* 20 */ | ||
/* 19 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
@@ -1207,3 +1202,3 @@ | ||
/***/ }), | ||
/* 21 */ | ||
/* 20 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
@@ -1268,3 +1263,3 @@ | ||
/***/ }), | ||
/* 22 */ | ||
/* 21 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
@@ -1290,3 +1285,3 @@ | ||
/***/ }), | ||
/* 23 */ | ||
/* 22 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
@@ -1366,3 +1361,3 @@ | ||
/***/ }), | ||
/* 24 */ | ||
/* 23 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
@@ -1411,3 +1406,3 @@ | ||
/***/ }), | ||
/* 25 */ | ||
/* 24 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
@@ -1446,3 +1441,3 @@ | ||
/***/ }), | ||
/* 26 */ | ||
/* 25 */ | ||
/***/ (function(module, exports) { | ||
@@ -1449,0 +1444,0 @@ |
@@ -1,1 +0,1 @@ | ||
var Butter=function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var r={};return e.m=t,e.c=r,e.i=function(t){return t},e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=12)}([function(t,e,r){"use strict";function n(t){return"[object Array]"===v.call(t)}function o(t){return"[object ArrayBuffer]"===v.call(t)}function i(t){return"[object FormData]"===v.call(t)}function s(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer}function u(t){return"string"==typeof t}function c(t){return"number"==typeof t}function a(t){return void 0===t}function f(t){return null!==t&&"object"==typeof t}function p(t){return"[object Date]"===v.call(t)}function l(t){return"[object File]"===v.call(t)}function h(t){return"[object Blob]"===v.call(t)}function d(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")}function m(){return"undefined"!=typeof window&&"undefined"!=typeof document&&"function"==typeof document.createElement}function y(t,e){if(null!==t&&void 0!==t)if("object"==typeof t||n(t)||(t=[t]),n(t))for(var r=0,o=t.length;r<o;r++)e.call(null,t[r],r,t);else for(var i in t)t.hasOwnProperty(i)&&e.call(null,t[i],i,t)}function g(){function t(t,r){"object"==typeof e[r]&&"object"==typeof t?e[r]=g(e[r],t):e[r]=t}for(var e={},r=0,n=arguments.length;r<n;r++)y(arguments[r],t);return e}var v=Object.prototype.toString;t.exports={isArray:n,isArrayBuffer:o,isFormData:i,isArrayBufferView:s,isString:u,isNumber:c,isObject:f,isUndefined:a,isDate:p,isFile:l,isBlob:h,isStandardBrowserEnv:m,forEach:y,merge:g,trim:d}},function(t,e,r){"use strict";var n=r(0),o=r(19),i=r(24),s=r(2),u=r(23),c=window.btoa||r(18);t.exports=function(t,e,a){var f=a.data,p=a.headers;n.isFormData(f)&&delete p["Content-Type"];var l=new XMLHttpRequest;if(!window.XDomainRequest||"withCredentials"in l||u(a.url)||(l=new window.XDomainRequest),a.auth){var h=a.auth.username||"",d=a.auth.password||"";p.Authorization="Basic "+c(h+":"+d)}if(l.open(a.method.toUpperCase(),o(a.url,a.params,a.paramsSerializer),!0),l.timeout=a.timeout,l.onload=function(){if(l){var r="getAllResponseHeaders"in l?i(l.getAllResponseHeaders()):null,n=-1!==["text",""].indexOf(a.responseType||"")?l.responseText:l.response,o={data:s(n,r,a.transformResponse),status:1223===l.status?204:l.status,statusText:1223===l.status?"No Content":l.statusText,headers:r,config:a};(o.status>=200&&o.status<300||!("status"in l)&&o.responseText?t:e)(o),l=null}},l.onerror=function(){e(new Error("Network Error")),l=null},n.isStandardBrowserEnv()){var m=r(21),y=a.withCredentials||u(a.url)?m.read(a.xsrfCookieName):void 0;y&&(p[a.xsrfHeaderName]=y)}if("setRequestHeader"in l&&n.forEach(p,function(t,e){void 0===f&&"content-type"===e.toLowerCase()?delete p[e]:l.setRequestHeader(e,t)}),a.withCredentials&&(l.withCredentials=!0),a.responseType)try{l.responseType=a.responseType}catch(t){if("json"!==l.responseType)throw t}n.isArrayBuffer(f)&&(f=new DataView(f)),l.send(f)}},function(t,e,r){"use strict";var n=r(0);t.exports=function(t,e,r){return n.forEach(r,function(r){t=r(t,e)}),t}},function(t,e,r){"use strict";function n(t){this._conn=t}n.prototype={list:function(t){return this._conn.get("authors/",t)},retrieve:function(t,e){return this._conn.get("authors/"+t+"/",e)}},t.exports=n},function(t,e,r){"use strict";function n(t){this._conn=t}n.prototype={list:function(t){return this._conn.get("categories/",t)},retrieve:function(t,e){return this._conn.get("categories/"+t+"/",e)}},t.exports=n},function(t,e,r){"use strict";function n(t){this._conn=t}n.prototype={retrieve:function(t,e){var t=t||[],e=e||{},r=Object.assign({keys:t.join()},e);return this._conn.get("content/",r)}},t.exports=n},function(t,e,r){"use strict";function n(t){this._conn=t}n.prototype={retrieve:function(t,e){return this._conn.get("feeds/"+t+"/",e)}},t.exports=n},function(t,e,r){"use strict";function n(t){this._conn=t}n.prototype={list:function(t,e){return this._conn.get("pages/"+t+"/",e)},retrieve:function(t,e,r){return this._conn.get("pages/"+t+"/"+e+"/",r)}},t.exports=n},function(t,e,r){"use strict";function n(t){this._conn=t}n.prototype={list:function(t){return this._conn.get("posts/",t)},retrieve:function(t,e){return this._conn.get("posts/"+t+"/",e)},search:function(t,e){var e=e||{};return e.query=t||"",this._conn.get("search/",e)}},t.exports=n},function(t,e,r){"use strict";function n(t){this._conn=t}n.prototype={list:function(t){return this._conn.get("tags/",t)},retrieve:function(t,e){return this._conn.get("tags/"+t+"/",e)}},t.exports=n},function(t,e,r){t.exports=r(13)},function(t,e){t.exports={name:"buttercms",version:"1.1.2",description:"ButterCMS API Client",keywords:["buttercms","butter","cms","api"],engines:{node:">=0.10.32"},scripts:{build:"webpack && uglifyjs ./dist/butter.js -c -m -o ./dist/butter.min.js"},homepage:"https://github.com/buttercms/buttercms-js",author:"ButterCMS <support@buttercms.com>",repository:{type:"git",url:"git://github.com/buttercms/buttercms-js.git"},main:"lib/butter.js",types:"lib/butter.d.ts",dependencies:{axios:"0.9.1"},license:"MIT",devDependencies:{"uglify-js":"^2.8.22",webpack:"^2.5.0"}}},function(t,e,r){"use strict";function n(t,e,r){if(!(this instanceof n))return new n(t,e,r);if(!t)throw"ButterCMS API token not set";var e=e||!1,r=r||3e3,o=this._prepMethods(t,e,r);this._prepResources(o)}var o=r(10),i=r(11),s={Post:r(8),Category:r(4),Tag:r(9),Author:r(3),Feed:r(6),Content:r(5),Page:r(7)};n.prototype={_prepResources:function(t){for(var e in s)this[e[0].toLowerCase()+e.substring(1)]=new s[e](t)},_prepMethods:function(t,e,r){return{get:function(n,s){var u=o.create({baseURL:"https://api.buttercms.com/v2",timeout:r,headers:{"X-Butter-Client":"JS/"+i.version}}),s=s||{};return s.auth_token=t,e&&(s.test=1),u.get(n,{params:s})}}}},t.exports=n},function(t,e,r){"use strict";function n(t){this.defaults=i.merge({},t),this.interceptors={request:new u,response:new u}}var o=r(16),i=r(0),s=r(15),u=r(14),c=r(22),a=r(20),f=r(17),p=r(2);n.prototype.request=function(t){"string"==typeof t&&(t=i.merge({url:arguments[0]},arguments[1])),t=i.merge(o,this.defaults,{method:"get"},t),t.baseURL&&!c(t.url)&&(t.url=a(t.baseURL,t.url)),t.withCredentials=t.withCredentials||this.defaults.withCredentials,t.data=p(t.data,t.headers,t.transformRequest),t.headers=i.merge(t.headers.common||{},t.headers[t.method]||{},t.headers||{}),i.forEach(["delete","get","head","post","put","patch","common"],function(e){delete t.headers[e]});var e=[s,void 0],r=Promise.resolve(t);for(this.interceptors.request.forEach(function(t){e.unshift(t.fulfilled,t.rejected)}),this.interceptors.response.forEach(function(t){e.push(t.fulfilled,t.rejected)});e.length;)r=r.then(e.shift(),e.shift());return r};var l=new n(o),h=t.exports=f(n.prototype.request,l);h.create=function(t){return new n(t)},h.defaults=l.defaults,h.all=function(t){return Promise.all(t)},h.spread=r(25),h.interceptors=l.interceptors,i.forEach(["delete","get","head"],function(t){n.prototype[t]=function(e,r){return this.request(i.merge(r||{},{method:t,url:e}))},h[t]=f(n.prototype[t],l)}),i.forEach(["post","put","patch"],function(t){n.prototype[t]=function(e,r,n){return this.request(i.merge(n||{},{method:t,url:e,data:r}))},h[t]=f(n.prototype[t],l)})},function(t,e,r){"use strict";function n(){this.handlers=[]}var o=r(0);n.prototype.use=function(t,e){return this.handlers.push({fulfilled:t,rejected:e}),this.handlers.length-1},n.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},n.prototype.forEach=function(t){o.forEach(this.handlers,function(e){null!==e&&t(e)})},t.exports=n},function(t,e,r){"use strict";(function(e){t.exports=function(t){return new Promise(function(n,o){try{var i;"function"==typeof t.adapter?i=t.adapter:"undefined"!=typeof XMLHttpRequest?i=r(1):void 0!==e&&(i=r(1)),"function"==typeof i&&i(n,o,t)}catch(t){o(t)}})}}).call(e,r(26))},function(t,e,r){"use strict";var n=r(0),o=/^\)\]\}',?\n/,i={"Content-Type":"application/x-www-form-urlencoded"};t.exports={transformRequest:[function(t,e){return n.isFormData(t)?t:n.isArrayBuffer(t)?t:n.isArrayBufferView(t)?t.buffer:!n.isObject(t)||n.isFile(t)||n.isBlob(t)?t:(n.isUndefined(e)||(n.forEach(e,function(t,r){"content-type"===r.toLowerCase()&&(e["Content-Type"]=t)}),n.isUndefined(e["Content-Type"])&&(e["Content-Type"]="application/json;charset=utf-8")),JSON.stringify(t))}],transformResponse:[function(t){if("string"==typeof t){t=t.replace(o,"");try{t=JSON.parse(t)}catch(t){}}return t}],headers:{common:{Accept:"application/json, text/plain, */*"},patch:n.merge(i),post:n.merge(i),put:n.merge(i)},timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN"}},function(t,e,r){"use strict";t.exports=function(t,e){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return t.apply(e,r)}}},function(t,e,r){"use strict";function n(t){this.message=t}function o(t){for(var e,r,o=String(t),s="",u=0,c=i;o.charAt(0|u)||(c="=",u%1);s+=c.charAt(63&e>>8-u%1*8)){if((r=o.charCodeAt(u+=.75))>255)throw new n("INVALID_CHARACTER_ERR: DOM Exception 5");e=e<<8|r}return s}var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";n.prototype=new Error,n.prototype.code=5,n.prototype.name="InvalidCharacterError",t.exports=o},function(t,e,r){"use strict";function n(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var o=r(0);t.exports=function(t,e,r){if(!e)return t;var i;if(r)i=r(e);else{var s=[];o.forEach(e,function(t,e){null!==t&&void 0!==t&&(o.isArray(t)&&(e+="[]"),o.isArray(t)||(t=[t]),o.forEach(t,function(t){o.isDate(t)?t=t.toISOString():o.isObject(t)&&(t=JSON.stringify(t)),s.push(n(e)+"="+n(t))}))}),i=s.join("&")}return i&&(t+=(-1===t.indexOf("?")?"?":"&")+i),t}},function(t,e,r){"use strict";t.exports=function(t,e){return t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,"")}},function(t,e,r){"use strict";var n=r(0);t.exports=n.isStandardBrowserEnv()?function(){return{write:function(t,e,r,o,i,s){var u=[];u.push(t+"="+encodeURIComponent(e)),n.isNumber(r)&&u.push("expires="+new Date(r).toGMTString()),n.isString(o)&&u.push("path="+o),n.isString(i)&&u.push("domain="+i),!0===s&&u.push("secure"),document.cookie=u.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},function(t,e,r){"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},function(t,e,r){"use strict";var n=r(0);t.exports=n.isStandardBrowserEnv()?function(){function t(t){var e=t;return r&&(o.setAttribute("href",e),e=o.href),o.setAttribute("href",e),{href:o.href,protocol:o.protocol?o.protocol.replace(/:$/,""):"",host:o.host,search:o.search?o.search.replace(/^\?/,""):"",hash:o.hash?o.hash.replace(/^#/,""):"",hostname:o.hostname,port:o.port,pathname:"/"===o.pathname.charAt(0)?o.pathname:"/"+o.pathname}}var e,r=/(msie|trident)/i.test(navigator.userAgent),o=document.createElement("a");return e=t(window.location.href),function(r){var o=n.isString(r)?t(r):r;return o.protocol===e.protocol&&o.host===e.host}}():function(){return function(){return!0}}()},function(t,e,r){"use strict";var n=r(0);t.exports=function(t){var e,r,o,i={};return t?(n.forEach(t.split("\n"),function(t){o=t.indexOf(":"),e=n.trim(t.substr(0,o)).toLowerCase(),r=n.trim(t.substr(o+1)),e&&(i[e]=i[e]?i[e]+", "+r:r)}),i):i}},function(t,e,r){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},function(t,e){function r(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function o(t){if(f===setTimeout)return setTimeout(t,0);if((f===r||!f)&&setTimeout)return f=setTimeout,setTimeout(t,0);try{return f(t,0)}catch(e){try{return f.call(null,t,0)}catch(e){return f.call(this,t,0)}}}function i(t){if(p===clearTimeout)return clearTimeout(t);if((p===n||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(t);try{return p(t)}catch(e){try{return p.call(null,t)}catch(e){return p.call(this,t)}}}function s(){m&&h&&(m=!1,h.length?d=h.concat(d):y=-1,d.length&&u())}function u(){if(!m){var t=o(s);m=!0;for(var e=d.length;e;){for(h=d,d=[];++y<e;)h&&h[y].run();y=-1,e=d.length}h=null,m=!1,i(t)}}function c(t,e){this.fun=t,this.array=e}function a(){}var f,p,l=t.exports={};!function(){try{f="function"==typeof setTimeout?setTimeout:r}catch(t){f=r}try{p="function"==typeof clearTimeout?clearTimeout:n}catch(t){p=n}}();var h,d=[],m=!1,y=-1;l.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];d.push(new c(t,e)),1!==d.length||m||o(u)},c.prototype.run=function(){this.fun.apply(null,this.array)},l.title="browser",l.browser=!0,l.env={},l.argv=[],l.version="",l.versions={},l.on=a,l.addListener=a,l.once=a,l.off=a,l.removeListener=a,l.removeAllListeners=a,l.emit=a,l.prependListener=a,l.prependOnceListener=a,l.listeners=function(t){return[]},l.binding=function(t){throw new Error("process.binding is not supported")},l.cwd=function(){return"/"},l.chdir=function(t){throw new Error("process.chdir is not supported")},l.umask=function(){return 0}}]); | ||
var Butter=function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var r={};return e.m=t,e.c=r,e.i=function(t){return t},e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=11)}([function(t,e,r){"use strict";function n(t){return"[object Array]"===v.call(t)}function o(t){return"[object ArrayBuffer]"===v.call(t)}function i(t){return"[object FormData]"===v.call(t)}function s(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer}function u(t){return"string"==typeof t}function c(t){return"number"==typeof t}function a(t){return void 0===t}function f(t){return null!==t&&"object"==typeof t}function p(t){return"[object Date]"===v.call(t)}function l(t){return"[object File]"===v.call(t)}function h(t){return"[object Blob]"===v.call(t)}function d(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")}function m(){return"undefined"!=typeof window&&"undefined"!=typeof document&&"function"==typeof document.createElement}function y(t,e){if(null!==t&&void 0!==t)if("object"==typeof t||n(t)||(t=[t]),n(t))for(var r=0,o=t.length;r<o;r++)e.call(null,t[r],r,t);else for(var i in t)t.hasOwnProperty(i)&&e.call(null,t[i],i,t)}function g(){function t(t,r){"object"==typeof e[r]&&"object"==typeof t?e[r]=g(e[r],t):e[r]=t}for(var e={},r=0,n=arguments.length;r<n;r++)y(arguments[r],t);return e}var v=Object.prototype.toString;t.exports={isArray:n,isArrayBuffer:o,isFormData:i,isArrayBufferView:s,isString:u,isNumber:c,isObject:f,isUndefined:a,isDate:p,isFile:l,isBlob:h,isStandardBrowserEnv:m,forEach:y,merge:g,trim:d}},function(t,e,r){"use strict";var n=r(0),o=r(18),i=r(23),s=r(2),u=r(22),c=window.btoa||r(17);t.exports=function(t,e,a){var f=a.data,p=a.headers;n.isFormData(f)&&delete p["Content-Type"];var l=new XMLHttpRequest;if(!window.XDomainRequest||"withCredentials"in l||u(a.url)||(l=new window.XDomainRequest),a.auth){var h=a.auth.username||"",d=a.auth.password||"";p.Authorization="Basic "+c(h+":"+d)}if(l.open(a.method.toUpperCase(),o(a.url,a.params,a.paramsSerializer),!0),l.timeout=a.timeout,l.onload=function(){if(l){var r="getAllResponseHeaders"in l?i(l.getAllResponseHeaders()):null,n=-1!==["text",""].indexOf(a.responseType||"")?l.responseText:l.response,o={data:s(n,r,a.transformResponse),status:1223===l.status?204:l.status,statusText:1223===l.status?"No Content":l.statusText,headers:r,config:a};(o.status>=200&&o.status<300||!("status"in l)&&o.responseText?t:e)(o),l=null}},l.onerror=function(){e(new Error("Network Error")),l=null},n.isStandardBrowserEnv()){var m=r(20),y=a.withCredentials||u(a.url)?m.read(a.xsrfCookieName):void 0;y&&(p[a.xsrfHeaderName]=y)}if("setRequestHeader"in l&&n.forEach(p,function(t,e){void 0===f&&"content-type"===e.toLowerCase()?delete p[e]:l.setRequestHeader(e,t)}),a.withCredentials&&(l.withCredentials=!0),a.responseType)try{l.responseType=a.responseType}catch(t){if("json"!==l.responseType)throw t}n.isArrayBuffer(f)&&(f=new DataView(f)),l.send(f)}},function(t,e,r){"use strict";var n=r(0);t.exports=function(t,e,r){return n.forEach(r,function(r){t=r(t,e)}),t}},function(t,e,r){"use strict";function n(t){this._conn=t}n.prototype={list:function(t){return this._conn.get("authors/",t)},retrieve:function(t,e){return this._conn.get("authors/"+t+"/",e)}},t.exports=n},function(t,e,r){"use strict";function n(t){this._conn=t}n.prototype={list:function(t){return this._conn.get("categories/",t)},retrieve:function(t,e){return this._conn.get("categories/"+t+"/",e)}},t.exports=n},function(t,e,r){"use strict";function n(t){this._conn=t}n.prototype={retrieve:function(t,e){var t=t||[],e=e||{},r=Object.assign({keys:t.join()},e);return this._conn.get("content/",r)}},t.exports=n},function(t,e,r){"use strict";function n(t){this._conn=t}n.prototype={retrieve:function(t,e){return this._conn.get("feeds/"+t+"/",e)}},t.exports=n},function(t,e,r){"use strict";function n(t){this._conn=t}n.prototype={list:function(t,e){return this._conn.get("pages/"+t+"/",e)},retrieve:function(t,e,r){return this._conn.get("pages/"+t+"/"+e+"/",r)}},t.exports=n},function(t,e,r){"use strict";function n(t){this._conn=t}n.prototype={list:function(t){return this._conn.get("posts/",t)},retrieve:function(t,e){return this._conn.get("posts/"+t+"/",e)},search:function(t,e){var e=e||{};return e.query=t||"",this._conn.get("search/",e)}},t.exports=n},function(t,e,r){"use strict";function n(t){this._conn=t}n.prototype={list:function(t){return this._conn.get("tags/",t)},retrieve:function(t,e){return this._conn.get("tags/"+t+"/",e)}},t.exports=n},function(t,e,r){t.exports=r(12)},function(t,e,r){"use strict";function n(t,e,r){if(!(this instanceof n))return new n(t,e,r);if(!t)throw"ButterCMS API token not set";var e=e||!1,r=r||3e3,o=this._prepMethods(t,e,r);this._prepResources(o)}var o=r(10),i={Post:r(8),Category:r(4),Tag:r(9),Author:r(3),Feed:r(6),Content:r(5),Page:r(7)};n.prototype={_prepResources:function(t){for(var e in i)this[e[0].toLowerCase()+e.substring(1)]=new i[e](t)},_prepMethods:function(t,e,r){return{get:function(n,i){var s=o.create({baseURL:"https://api.buttercms.com/v2",timeout:r,headers:{"X-Butter-Client":"JS/1.1.3"}}),i=i||{};return i.auth_token=t,e&&(i.test=1),s.get(n,{params:i})}}}},t.exports=n},function(t,e,r){"use strict";function n(t){this.defaults=i.merge({},t),this.interceptors={request:new u,response:new u}}var o=r(15),i=r(0),s=r(14),u=r(13),c=r(21),a=r(19),f=r(16),p=r(2);n.prototype.request=function(t){"string"==typeof t&&(t=i.merge({url:arguments[0]},arguments[1])),t=i.merge(o,this.defaults,{method:"get"},t),t.baseURL&&!c(t.url)&&(t.url=a(t.baseURL,t.url)),t.withCredentials=t.withCredentials||this.defaults.withCredentials,t.data=p(t.data,t.headers,t.transformRequest),t.headers=i.merge(t.headers.common||{},t.headers[t.method]||{},t.headers||{}),i.forEach(["delete","get","head","post","put","patch","common"],function(e){delete t.headers[e]});var e=[s,void 0],r=Promise.resolve(t);for(this.interceptors.request.forEach(function(t){e.unshift(t.fulfilled,t.rejected)}),this.interceptors.response.forEach(function(t){e.push(t.fulfilled,t.rejected)});e.length;)r=r.then(e.shift(),e.shift());return r};var l=new n(o),h=t.exports=f(n.prototype.request,l);h.create=function(t){return new n(t)},h.defaults=l.defaults,h.all=function(t){return Promise.all(t)},h.spread=r(24),h.interceptors=l.interceptors,i.forEach(["delete","get","head"],function(t){n.prototype[t]=function(e,r){return this.request(i.merge(r||{},{method:t,url:e}))},h[t]=f(n.prototype[t],l)}),i.forEach(["post","put","patch"],function(t){n.prototype[t]=function(e,r,n){return this.request(i.merge(n||{},{method:t,url:e,data:r}))},h[t]=f(n.prototype[t],l)})},function(t,e,r){"use strict";function n(){this.handlers=[]}var o=r(0);n.prototype.use=function(t,e){return this.handlers.push({fulfilled:t,rejected:e}),this.handlers.length-1},n.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},n.prototype.forEach=function(t){o.forEach(this.handlers,function(e){null!==e&&t(e)})},t.exports=n},function(t,e,r){"use strict";(function(e){t.exports=function(t){return new Promise(function(n,o){try{var i;"function"==typeof t.adapter?i=t.adapter:"undefined"!=typeof XMLHttpRequest?i=r(1):void 0!==e&&(i=r(1)),"function"==typeof i&&i(n,o,t)}catch(t){o(t)}})}}).call(e,r(25))},function(t,e,r){"use strict";var n=r(0),o=/^\)\]\}',?\n/,i={"Content-Type":"application/x-www-form-urlencoded"};t.exports={transformRequest:[function(t,e){return n.isFormData(t)?t:n.isArrayBuffer(t)?t:n.isArrayBufferView(t)?t.buffer:!n.isObject(t)||n.isFile(t)||n.isBlob(t)?t:(n.isUndefined(e)||(n.forEach(e,function(t,r){"content-type"===r.toLowerCase()&&(e["Content-Type"]=t)}),n.isUndefined(e["Content-Type"])&&(e["Content-Type"]="application/json;charset=utf-8")),JSON.stringify(t))}],transformResponse:[function(t){if("string"==typeof t){t=t.replace(o,"");try{t=JSON.parse(t)}catch(t){}}return t}],headers:{common:{Accept:"application/json, text/plain, */*"},patch:n.merge(i),post:n.merge(i),put:n.merge(i)},timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN"}},function(t,e,r){"use strict";t.exports=function(t,e){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return t.apply(e,r)}}},function(t,e,r){"use strict";function n(t){this.message=t}function o(t){for(var e,r,o=String(t),s="",u=0,c=i;o.charAt(0|u)||(c="=",u%1);s+=c.charAt(63&e>>8-u%1*8)){if((r=o.charCodeAt(u+=.75))>255)throw new n("INVALID_CHARACTER_ERR: DOM Exception 5");e=e<<8|r}return s}var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";n.prototype=new Error,n.prototype.code=5,n.prototype.name="InvalidCharacterError",t.exports=o},function(t,e,r){"use strict";function n(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var o=r(0);t.exports=function(t,e,r){if(!e)return t;var i;if(r)i=r(e);else{var s=[];o.forEach(e,function(t,e){null!==t&&void 0!==t&&(o.isArray(t)&&(e+="[]"),o.isArray(t)||(t=[t]),o.forEach(t,function(t){o.isDate(t)?t=t.toISOString():o.isObject(t)&&(t=JSON.stringify(t)),s.push(n(e)+"="+n(t))}))}),i=s.join("&")}return i&&(t+=(-1===t.indexOf("?")?"?":"&")+i),t}},function(t,e,r){"use strict";t.exports=function(t,e){return t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,"")}},function(t,e,r){"use strict";var n=r(0);t.exports=n.isStandardBrowserEnv()?function(){return{write:function(t,e,r,o,i,s){var u=[];u.push(t+"="+encodeURIComponent(e)),n.isNumber(r)&&u.push("expires="+new Date(r).toGMTString()),n.isString(o)&&u.push("path="+o),n.isString(i)&&u.push("domain="+i),!0===s&&u.push("secure"),document.cookie=u.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},function(t,e,r){"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},function(t,e,r){"use strict";var n=r(0);t.exports=n.isStandardBrowserEnv()?function(){function t(t){var e=t;return r&&(o.setAttribute("href",e),e=o.href),o.setAttribute("href",e),{href:o.href,protocol:o.protocol?o.protocol.replace(/:$/,""):"",host:o.host,search:o.search?o.search.replace(/^\?/,""):"",hash:o.hash?o.hash.replace(/^#/,""):"",hostname:o.hostname,port:o.port,pathname:"/"===o.pathname.charAt(0)?o.pathname:"/"+o.pathname}}var e,r=/(msie|trident)/i.test(navigator.userAgent),o=document.createElement("a");return e=t(window.location.href),function(r){var o=n.isString(r)?t(r):r;return o.protocol===e.protocol&&o.host===e.host}}():function(){return function(){return!0}}()},function(t,e,r){"use strict";var n=r(0);t.exports=function(t){var e,r,o,i={};return t?(n.forEach(t.split("\n"),function(t){o=t.indexOf(":"),e=n.trim(t.substr(0,o)).toLowerCase(),r=n.trim(t.substr(o+1)),e&&(i[e]=i[e]?i[e]+", "+r:r)}),i):i}},function(t,e,r){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},function(t,e){function r(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function o(t){if(f===setTimeout)return setTimeout(t,0);if((f===r||!f)&&setTimeout)return f=setTimeout,setTimeout(t,0);try{return f(t,0)}catch(e){try{return f.call(null,t,0)}catch(e){return f.call(this,t,0)}}}function i(t){if(p===clearTimeout)return clearTimeout(t);if((p===n||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(t);try{return p(t)}catch(e){try{return p.call(null,t)}catch(e){return p.call(this,t)}}}function s(){m&&h&&(m=!1,h.length?d=h.concat(d):y=-1,d.length&&u())}function u(){if(!m){var t=o(s);m=!0;for(var e=d.length;e;){for(h=d,d=[];++y<e;)h&&h[y].run();y=-1,e=d.length}h=null,m=!1,i(t)}}function c(t,e){this.fun=t,this.array=e}function a(){}var f,p,l=t.exports={};!function(){try{f="function"==typeof setTimeout?setTimeout:r}catch(t){f=r}try{p="function"==typeof clearTimeout?clearTimeout:n}catch(t){p=n}}();var h,d=[],m=!1,y=-1;l.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];d.push(new c(t,e)),1!==d.length||m||o(u)},c.prototype.run=function(){this.fun.apply(null,this.array)},l.title="browser",l.browser=!0,l.env={},l.argv=[],l.version="",l.versions={},l.on=a,l.addListener=a,l.once=a,l.off=a,l.removeListener=a,l.removeAllListeners=a,l.emit=a,l.prependListener=a,l.prependOnceListener=a,l.listeners=function(t){return[]},l.binding=function(t){throw new Error("process.binding is not supported")},l.cwd=function(){return"/"},l.chdir=function(t){throw new Error("process.chdir is not supported")},l.umask=function(){return 0}}]); |
'use strict'; | ||
var BUTTER_CLIENT_VERSION = '1.1.3'; | ||
var axios = require('axios'); | ||
var config = require('../package.json'); | ||
@@ -50,3 +51,3 @@ var resources = { | ||
timeout: timeout, | ||
headers: {'X-Butter-Client': 'JS/' + config.version} | ||
headers: {'X-Butter-Client': 'JS/' + BUTTER_CLIENT_VERSION} | ||
}); | ||
@@ -53,0 +54,0 @@ |
{ | ||
"name": "buttercms", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "ButterCMS API Client", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -20,3 +20,3 @@ # ButterCMS JS client | ||
```html | ||
<script src="https://cdnjs.buttercms.com/buttercms-1.1.1.min.js"></script> | ||
<script src="https://cdnjs.buttercms.com/buttercms-1.1.3.min.js"></script> | ||
``` | ||
@@ -23,0 +23,0 @@ |
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
64909
1524