contentstack
Advanced tools
Comparing version 3.3.0 to 3.4.0
@@ -0,0 +0,0 @@ const config = { |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Contentstack=t():e.Contentstack=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=14)}([function(e,t,r){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}function o(e){return function(){switch(this._query[e]=this._query[e]||{},arguments.length){case 1:if(Array.isArray(arguments[0])||"string"==typeof arguments[0]){var t=this._query[e].BASE||[];return t=t.concat(arguments[0]),this._query[e].BASE=t,this}console.error("Kindly provide valid parameters");break;case 2:if("string"==typeof arguments[0]&&(Array.isArray(arguments[1])||"string"==typeof arguments[1])){var r=this._query[e][arguments[0]]||[];return r=r.concat(arguments[1]),this._query[e][arguments[0]]=r,this}console.error("Kindly provide valid parameters");break;default:console.error("Kindly provide valid parameters")}}}function i(e){var t=void 0===e?"undefined":p(e);switch(t){case"object":t,Array.isArray(e)&&(t="array");break;default:t}return t}function s(e,t){var r=this;return function e(t,n){for(var o in n)"object"==r._type(n[o])&&r._type(t[o])==r._type(n[o])?e(t[o],n[o]):"array"==r._type(n[o])&&r._type(t[o])==r._type(n[o])?t[o]=t[o].concat(n[o]):t[o]=n[o]}(e,t),e}function u(e,t){if(e&&t)for(var r in t)e[r]=t[r];return e}function a(){return"undefined"!=typeof window&&"object"===(void 0===e?"undefined":p(e))&&"browser"===e.title}function c(e,t,r){if(e&&e.requestParams){var n=u({},e.requestParams.body?e.requestParams.body.query||{}:{});return n.environment_uid&&(delete n.environment_uid,n.environment=e.environment),n.environment=e.environment,{content_type_uid:e.content_type_uid,locale:n.locale||"en-us",query:n,entry_uid:e.entry_uid,asset_uid:e.asset_uid,single:t||"false",toJSON:r||"false",api_key:e.requestParams.headers?e.requestParams.headers.api_key:""}}}function f(e){try{var t=l(JSON.stringify(e)),r=[];return r.push(e.content_type_uid),r.push(e.locale),e.entry_uid&&r.push(e.entry_uid),e.asset_uid&&r.push(e.asset_uid),r.push(t),r.join(".")}catch(e){}}function l(e){var t=0,r=void 0,n=void 0,o=void 0;if(0===e.length)return t;for(r=0,o=e.length;r<o;r++)n=e.charCodeAt(r),t=(t<<5)-t+n,t|=0;return t<-1?-1*t:t}function y(e){if(e&&void 0!==e.entries)if(e.entries&&e.entries.length)for(var t=0,r=e.entries.length;t<r;t++)e.entries[t]=(0,m.default)(e.entries[t]);else e.entries=[];else if(e&&e.assets&&void 0!==e.assets)if(e.assets&&e.assets.length)for(var n=0,o=e.assets.length;n<o;n++)e.assets[n]=(0,m.default)(e.assets[n]);else e.assets=[];else e&&void 0!==e.entry?e.entry=(0,m.default)(e.entry):e&&void 0!==e.asset&&(e.asset=(0,m.default)(e.asset));return e}function h(e){var t=[];return e&&Object.keys(e).length&&(void 0!==e.entries&&t.push(e.entries),void 0!==e.assets&&t.push(e.assets),void 0===e.content_type&&void 0===e.schema||t.push(e.content_type||e.schema),void 0!==e.count&&t.push(e.count),void 0!==e.entry&&(t=e.entry),void 0!==e.asset&&(t=e.asset)),t}function d(e){var t=e.environment_uid;t?e._query.environment_uid=t:e._query?e._query.environment=e.environment:(e._query={},e._query.environment=e.environment);var r=e,n=void 0!==r.queryCachePolicy?r.queryCachePolicy:r.cachePolicy,o=void 0!==r.tojson&&r.tojson,i=!!(r.entry_uid||r.singleEntry||r.asset_uid),s=f(c(r,i,o));if(e&&e.requestParams&&e.requestParams.body&&e.requestParams.body.query){var a=JSON.parse(JSON.stringify(e.requestParams.body.query));"object"!==(void 0===a?"undefined":p(a))&&(a=JSON.parse(a)),delete e.requestParams.body.query,e.requestParams.body=u(e.requestParams.body,a)}var l=function(){return function(e,t){return new Promise(function(r,n){try{if(e)throw e;o||(t=y(t)),r(h(t))}catch(e){n(e)}})}},d=function(t,i,u){t&&(0,_.default)(e.requestParams).then(function(t){try{r.entry_uid=r.asset_uid=r.tojson=r.queryCachePolicy=void 0;var a={};if(e.singleEntry)if(e.singleEntry=!1,t.schema&&(a.schema=t.schema),t.content_type&&(a.content_type=t.content_type,delete a.schema),t.entries&&t.entries.length)a.entry=t.entries[0];else{if(!t.assets||!t.assets.length)return 2!==n?u({error_code:141,error_message:"The requested entry doesn't exist."}):void r.provider.get(s,l());a.assets=t.assets[0]}else a=t;return-1!==n?(r.provider.set(s,a,function(e){try{if(e)throw e;return o||(a=y(a)),i(h(a))}catch(e){return u(e)}}),i(h(a))):(o||(a=y(a)),i(h(a)))}catch(e){return u({message:e.message})}}.bind(r)).catch(function(e){if(2!==n)return u(e);r.provider.get(s,l())})};switch(n){case 1:return new Promise(function(e,t){r.provider.get(s,function(r,n){try{if(!r&&n)return o||(n=y(n)),e(h(n));d(!0,e,t)}catch(e){return t(e)}})});case 2:case 0:case void 0:case-1:return new Promise(function(e,t){d(!0,e,t)})}if(3===n)return{cache:function(){return new Promise(function(e,t){r.provider.get(s,function(r,n){try{r?t(r):(o||(n=y(n)),e(h(n)))}catch(e){t(e)}})})}(),network:function(){return new Promise(function(e,t){d(!0,e,t)})}(),both:function(t){r.provider.get(s,function(e,r){o||(r=y(r)),t(e,h(r))}),(0,_.default)(e.requestParams).then(function(n){try{r.entry_uid=r.tojson=r.queryCachePolicy=void 0;var i={},s=null;e.singleEntry?(e.singleEntry=!1,n.schema&&(i.schema=n.schema),n.content_type&&(i.content_type=n.content_type,delete i.schema),n.entries&&n.entries.length?i.entry=n.entries[0]:n.assets&&n.assets.length?i.assets=n.assets[0]:s={error_code:141,error_message:"The requested entry doesn't exist."}):i=n,o||(i=y(i)),t(s,h(i))}catch(e){t(e)}}.bind(r)).catch(function(e){t(e)})}}}Object.defineProperty(t,"__esModule",{value:!0});var p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.transform=o,t._type=i,t.mergeDeep=s,t.merge=u,t.isBrowser=a,t.parseQueryFromParams=c,t.getHash=f,t.generateHash=l,t.resultWrapper=y,t.spreadResult=h,t.sendRequest=d;var v=r(2),_=n(v),b=r(16),m=n(b);!function(){Promise.prototype.spread||(Promise.prototype.spread=function(e,t){return t=t||function(e){},this.then(function(t){return e.apply(e,t)}).catch(function(e){t(e)})})}()}).call(t,r(4))},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=r(8),c=o(a),f=r(0),l=n(f),y=r(6),h=o(y),d=r(15),p=o(d),v=r(7),_=o(v),b=r(2),m=o(b),g=r(5),w=(n(g),r(3)),q=o(w),P=function(){function e(){i(this,e),this.config=c.default,this.cachePolicy=q.default.policies.IGNORE_CACHE,this.provider=q.default.providers("localstorage");for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];switch(r.length){case 1:if("object"===s(r[0])&&"string"==typeof r[0].api_key&&"string"==typeof r[0].access_token&&"string"==typeof r[0].environment)return this.headers={api_key:r[0].api_key,access_token:r[0].access_token},this.environment=r[0].environment,this;console.error("Kindly provide valid object parameters.");case 3:if("string"==typeof r[0]&&"string"==typeof r[1]&&"string"==typeof r[2])return this.headers={api_key:r[0],access_token:r[1]},this.environment=r[2],this;console.error("Kindly provide valid string parameters.");default:console.error("Kindly provide valid parameters to initialize the Built.io Contentstack javascript-SDK Stack.")}}return u(e,[{key:"setPort",value:function(e){return"number"==typeof e&&(this.config.port=e),this}},{key:"setProtocol",value:function(e){return"string"==typeof e&&~["https","http"].indexOf(e)&&(this.config.protocol=e),this}},{key:"setHost",value:function(e){return"string"==typeof e&&e&&(this.config.host=e),this}},{key:"setCachePolicy",value:function(e){return"number"==typeof e&&e>=-1&&e<4?this._query?this.queryCachePolicy=e:this.cachePolicy=e:console.error("Kindly provide the valid policy"),this}},{key:"setCacheProvider",value:function(e){return e&&"object"===(void 0===e?"undefined":s(e))&&(this.provider=e),this}},{key:"clearByQuery",value:function(){if(this.provider&&"function"==typeof this.provider.clearByQuery)return this.provider.clearByQuery.apply(this.provider,arguments)}},{key:"clearByContentType",value:function(){if(this.provider&&"function"==typeof this.provider.clearByContentType)return this.provider.clearByContentType.apply(this.provider,arguments)}},{key:"clearAll",value:function(){if(this.provider&&"function"==typeof this.provider.clearAll)return this.provider.clearAll.apply(this.provider,arguments)}},{key:"getCacheProvider",value:function(){return this.provider}},{key:"ContentType",value:function(e){return e&&"string"==typeof e&&(this.content_type_uid=e,this.type="contentType"),this}},{key:"Entry",value:function(e){var t=new h.default;return e&&"string"==typeof e&&(t.entry_uid=e),l.merge(t,this)}},{key:"Assets",value:function(e){var t=new p.default;return this.type="asset",e&&"string"==typeof e&&(t.asset_uid=e),l.merge(t,this)}},{key:"Query",value:function(){var e=new _.default;return l.merge(e,this)}},{key:"getLastActivities",value:function(){var e={method:"POST",headers:this.headers,url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.content_types,body:{_method:"GET",only_last_activity:!0,environment:this.environment}};return(0,m.default)(e)}},{key:"imageTransform",value:function(e,t){if(e&&"string"==typeof e&&"object"===(void 0===t?"undefined":s(t))&&void 0===t.length){var r=[];for(var n in t)r.push(n+"="+t[n]);e+=e.indexOf("?")<=-1?"?"+r.join("&"):"&"+r.join("&")}return e}}]),e}();t.default=P},function(e,t,r){"use strict";function n(e){return new Promise(function(t,r){var n=void 0,i=e.url,s=e.headers;s["Content-Type"]="application/json; charset=UTF-8",s["X-User-Agent"]="contentstack-web/"+a,e.body&&"object"===o(e.body)&&(delete e.body._method,"object"===o(e.body.query)&&0===Object.keys(e.body.query).length&&delete e.body.query,n=function e(t,r){var n=[],i=void 0;if("object"===(void 0===t?"undefined":o(t))&&void 0!==t.length)for(var s=0,u=t.length;s<u;s++)n.push(r+"[]="+t[s]);else for(i in t){var a=r?r+"["+i+"]":i,c=t[i];n.push(null!==c&&"object"===(void 0===c?"undefined":o(c))&&"query"!==i?e(c,a):a+"="+("query"!==i?encodeURIComponent(c):JSON.stringify(c)))}return n.join("&")}(e.body)),(0,u.default)(i+"?"+n,{method:"GET",headers:s}).then(function(e){if(e.ok&&200===e.status){var n=e.json();t(n)}else r(e.statusText)}).catch(function(e){console.log("Error: ",e),r(e)})})}Object.defineProperty(t,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.default=n;var i=r(0),s=(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);t.default=e}(i),r(17)),u=function(e){return e&&e.__esModule?e:{default:e}}(s),a="3.3.0"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(13),o=function(e){return e&&e.__esModule?e:{default:e}}(n),i={};i.providers=function(e){if(e)return o.default;console.error("Kindly provide valid provider.")},i.policies={IGNORE_CACHE:-1,ONLY_NETWORK:0,CACHE_ELSE_NETWORK:1,NETWORK_ELSE_CACHE:2,CACHE_THEN_NETWORK:3},t.default=i},function(e,t,r){"use strict";function n(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(l===setTimeout)return setTimeout(e,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(t){try{return l.call(null,e,0)}catch(t){return l.call(this,e,0)}}}function s(e){if(y===clearTimeout)return clearTimeout(e);if((y===o||!y)&&clearTimeout)return y=clearTimeout,clearTimeout(e);try{return y(e)}catch(t){try{return y.call(null,e)}catch(t){return y.call(this,e)}}}function u(){v&&d&&(v=!1,d.length?p=d.concat(p):_=-1,p.length&&a())}function a(){if(!v){var e=i(u);v=!0;for(var t=p.length;t;){for(d=p,p=[];++_<t;)d&&d[_].run();_=-1,t=p.length}d=null,v=!1,s(e)}}function c(e,t){this.fun=e,this.array=t}function f(){}var l,y,h=e.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:n}catch(e){l=n}try{y="function"==typeof clearTimeout?clearTimeout:o}catch(e){y=o}}();var d,p=[],v=!1,_=-1;h.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];p.push(new c(e,t)),1!==p.length||v||i(a)},c.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=f,h.addListener=f,h.once=f,h.off=f,h.removeListener=f,h.removeAllListeners=f,h.emit=f,h.prependListener=f,h.prependOnceListener=f,h.listeners=function(e){return[]},h.binding=function(e){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(e){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},function(e,t,r){"use strict";function n(e){var t=f.default.getItem(e);try{t=JSON.parse(t)}catch(e){return t}return t||null}function o(e,t){"object"===(void 0===t?"undefined":u(t))?f.default.setItem(e,JSON.stringify(t)):f.default.setItem(e,t)}function i(){return f.default||null}function s(){return f.default?Object.keys(f.default):[]}Object.defineProperty(t,"__esModule",{value:!0});var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.get=n,t.set=o,t.getStorage=i,t.getKeys=s;var a=r(0),c=(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);t.default=e}(a),r(18)),f=function(e){return e&&e.__esModule?e:{default:e}}(c)},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=r(0),u=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(s),a=r(1),c=(function(e){e&&e.__esModule}(a),function(){function e(){return n(this,e),this._query={},this.only=u.transform("only"),this.except=u.transform("except"),this}return i(e,[{key:"setCacheProvider",value:function(e){return e&&"object"===(void 0===e?"undefined":o(e))&&(this.provider=e),this}},{key:"setCachePolicy",value:function(e){return"number"==typeof e&&e>=-1&&e<4?this._query?this.queryCachePolicy=e:this.cachePolicy=e:console.error("Kindly provide the valid policy"),this}},{key:"includeReference",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];if(Array.isArray(t)||"string"==typeof t){if(arguments.length)for(var n=0;n<arguments.length;n++)this._query.include=this._query.include||[],this._query.include=this._query.include.concat(arguments[n]);return this}console.error("Argument should be a String or an Array.")}},{key:"language",value:function(e){if(e&&"string"==typeof e)return this._query.locale=e,this;console.error("Argument should be a String.")}},{key:"addQuery",value:function(e,t){if(e&&t&&"string"==typeof e)return this._query[e]=t,this;console.error("First argument should be a String.")}},{key:"includeSchema",value:function(){return this._query.include_schema=!0,this}},{key:"includeContentType",value:function(){return this._query.include_content_type=!0,this}},{key:"includeOwner",value:function(){return this._query.include_owner=!0,this}},{key:"toJSON",value:function(){return this.tojson=!0,this}},{key:"fetch",value:function(){if(this.entry_uid)return this.requestParams={method:"POST",headers:this.headers,url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.content_types+this.content_type_uid+this.config.urls.entries+this.entry_uid,body:{_method:"GET",query:this._query}},u.sendRequest(this);console.error("Kindly provide an entry uid. e.g. .Entry('bltsomething123')")}}]),e}());t.default=c},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c=r(2),f=(n(c),r(0)),l=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(f),y=r(6),h=n(y),d={compare:function(e){return function(t,r){if(t&&r&&"string"==typeof t&&void 0!==r)return this._query.query[t]=this._query.query.file_size||{},this._query.query[t][e]=r,this;console.error("Kindly provide valid parameters.")}},contained:function(e){var t=e?"$in":"$nin";return function(e,r){if(e&&r&&"string"==typeof e&&Array.isArray(r))return this._query.query[e]=this._query.query[e]||{},this._query.query[e][t]=this._query.query[e][t]||[],this._query.query[e][t]=this._query.query[e][t].concat(r),this;console.error("Kindly provide valid parameters.")}},exists:function(e){return function(t){if(t&&"string"==typeof t)return this._query.query[t]=this._query.query[t]||{},this._query.query[t].$exists=e,this;console.error("Kindly provide valid parameters.")}},logical:function(e){return function(){for(var t=[],r=0,n=arguments.length;r<n;r++)arguments[r]instanceof p&&arguments[r]._query.query?t.push(arguments[r]._query.query):"object"===a(arguments[r])&&t.push(arguments[r]);return this._query.query[e]?this._query.query[e]=this._query.query[e].concat(t):this._query.query[e]=t,this}},sort:function(e){return function(t){if(t&&"string"==typeof t)return this._query[e]=t,this;console.error("Argument should be a string.")}},pagination:function(e){return function(t){if("number"==typeof t)return this._query[e]=t,this;console.error("Argument should be a number.")}}},p=function(e){function t(){o(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e._query=e._query||{},e._query.query=e._query.query||{},e.lessThan=d.compare("$lt"),e.lessThanOrEqualTo=d.compare("$lte"),e.greaterThan=d.compare("$gt"),e.greaterThanOrEqualTo=d.compare("$gte"),e.notEqualTo=d.compare("$ne"),e.containedIn=d.contained(!0),e.notContainedIn=d.contained(!1),e.exists=d.exists(!0),e.notExists=d.exists(!1),e.ascending=d.sort("asc"),e.descending=d.sort("desc"),e.beforeUid=d.sort("before_uid"),e.afterUid=d.sort("after_uid"),e.skip=d.pagination("skip"),e.limit=d.pagination("limit"),e.or=d.logical("$or"),e.and=d.logical("$and"),e}return s(t,e),u(t,[{key:"equalTo",value:function(e,t){if(e&&"string"==typeof e)return this._query.query[e]=t,this;console.error("Kindly provide valid parameters.")}},{key:"where",value:function(e,t){if(e&&"string"==typeof e)return this._query.query[e]=t,this;console.error("Kindly provide valid parameters.")}},{key:"count",value:function(){var e=this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version,t=this.type&&"asset"===this.type?e+this.config.urls.assets:e+this.config.urls.content_types+this.content_type_uid+this.config.urls.entries;return this._query.count=!0,this.requestParams={method:"POST",headers:this.headers,url:t,body:{_method:"GET",query:this._query}},this}},{key:"query",value:function(e){if("object"===(void 0===e?"undefined":a(e)))return this._query.query=l.mergeDeep(this._query.query,e),this;console.error("Kindly provide valid parameters")}},{key:"tags",value:function(e){if(Array.isArray(e))return this._query.tags=e,this;console.error("Kindly provide valid parameters")}},{key:"includeCount",value:function(){return this._query.include_count=!0,this}},{key:"getQuery",value:function(){return this._query.query||{}}},{key:"regex",value:function(e,t,r){if(e&&t&&"string"==typeof e&&"string"==typeof t)return this._query.query[e]={$regex:t},r&&(this._query.query[e].$options=r),this;console.error("Kindly provide valid parameters.")}},{key:"search",value:function(e){if(e&&"string"==typeof e)return this._query.typeahead=e,this;console.error("Kindly provide valid parameters.")}},{key:"find",value:function(){var e=this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version,t=this.type&&"asset"===this.type?e+this.config.urls.assets:e+this.config.urls.content_types+this.content_type_uid+this.config.urls.entries;return this.requestParams={method:"POST",headers:this.headers,url:t,body:{_method:"GET",query:this._query}},l.sendRequest(this)}},{key:"findOne",value:function(){var e=this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version,t=this.type&&"asset"===this.type?e+this.config.urls.assets:e+this.config.urls.content_types+this.content_type_uid+this.config.urls.entries;return this.singleEntry=!0,this._query.limit=1,this.requestParams={method:"POST",headers:this.headers,url:t,body:{_method:"GET",query:this._query}},l.sendRequest(this)}}]),t}(h.default);t.default=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={protocol:"https",host:"cdn.contentstack.io",port:443,version:"v3",urls:{content_types:"/content_types/",entries:"/entries/",assets:"/assets/",environments:"/environments/"}};t.default=n},function(e,t,r){"use strict";(function(n,o){var i,s,u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};/*! | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Contentstack=t():e.Contentstack=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=14)}([function(e,t,r){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}function o(e){return function(){switch(this._query[e]=this._query[e]||{},arguments.length){case 1:if(Array.isArray(arguments[0])||"string"==typeof arguments[0]){var t=this._query[e].BASE||[];return t=t.concat(arguments[0]),this._query[e].BASE=t,this}console.error("Kindly provide valid parameters");break;case 2:if("string"==typeof arguments[0]&&(Array.isArray(arguments[1])||"string"==typeof arguments[1])){var r=this._query[e][arguments[0]]||[];return r=r.concat(arguments[1]),this._query[e][arguments[0]]=r,this}console.error("Kindly provide valid parameters");break;default:console.error("Kindly provide valid parameters")}}}function i(e){var t=void 0===e?"undefined":p(e);switch(t){case"object":t,Array.isArray(e)&&(t="array");break;default:t}return t}function s(e,t){var r=this;return function e(t,n){for(var o in n)"object"==r._type(n[o])&&r._type(t[o])==r._type(n[o])?e(t[o],n[o]):"array"==r._type(n[o])&&r._type(t[o])==r._type(n[o])?t[o]=t[o].concat(n[o]):t[o]=n[o]}(e,t),e}function u(e,t){if(e&&t)for(var r in t)e[r]=t[r];return e}function a(){return"undefined"!=typeof window&&"object"===(void 0===e?"undefined":p(e))&&"browser"===e.title}function c(e,t,r){if(e&&e.requestParams){var n=u({},e.requestParams.body?e.requestParams.body.query||{}:{});return n.environment_uid&&(delete n.environment_uid,n.environment=e.environment),n.environment=e.environment,{content_type_uid:e.content_type_uid,locale:n.locale||"en-us",query:n,entry_uid:e.entry_uid,asset_uid:e.asset_uid,single:t||"false",toJSON:r||"false",api_key:e.requestParams.headers?e.requestParams.headers.api_key:""}}}function f(e){try{var t=l(JSON.stringify(e)),r=[];return r.push(e.content_type_uid),r.push(e.locale),e.entry_uid&&r.push(e.entry_uid),e.asset_uid&&r.push(e.asset_uid),r.push(t),r.join(".")}catch(e){}}function l(e){var t=0,r=void 0,n=void 0,o=void 0;if(0===e.length)return t;for(r=0,o=e.length;r<o;r++)n=e.charCodeAt(r),t=(t<<5)-t+n,t|=0;return t<-1?-1*t:t}function y(e){if(e&&void 0!==e.entries)if(e.entries&&e.entries.length)for(var t=0,r=e.entries.length;t<r;t++)e.entries[t]=(0,b.default)(e.entries[t]);else e.entries=[];else if(e&&e.assets&&void 0!==e.assets)if(e.assets&&e.assets.length)for(var n=0,o=e.assets.length;n<o;n++)e.assets[n]=(0,b.default)(e.assets[n]);else e.assets=[];else e&&void 0!==e.entry?e.entry=(0,b.default)(e.entry):e&&void 0!==e.asset&&(e.asset=(0,b.default)(e.asset));return e}function h(e){var t=[];return e&&Object.keys(e).length&&(void 0!==e.entries&&t.push(e.entries),void 0!==e.assets&&t.push(e.assets),void 0===e.content_type&&void 0===e.schema||t.push(e.content_type||e.schema),void 0!==e.count&&t.push(e.count),void 0!==e.entry&&(t=e.entry),void 0!==e.asset&&(t=e.asset)),t}function d(e){var t=e.environment_uid;t?e._query.environment_uid=t:e._query?e._query.environment=e.environment:(e._query={},e._query.environment=e.environment);var r=e,n=void 0!==r.queryCachePolicy?r.queryCachePolicy:r.cachePolicy,o=void 0!==r.tojson&&r.tojson,i=!!(r.entry_uid||r.singleEntry||r.asset_uid),s=f(c(r,i,o));if(e&&e.requestParams&&e.requestParams.body&&e.requestParams.body.query){var a=JSON.parse(JSON.stringify(e.requestParams.body.query));"object"!==(void 0===a?"undefined":p(a))&&(a=JSON.parse(a)),delete e.requestParams.body.query,e.requestParams.body=u(e.requestParams.body,a)}var l=function(){return function(e,t){return new Promise(function(r,n){try{if(e)throw e;o||(t=y(t)),r(h(t))}catch(e){n(e)}})}},d=function(t,i,u){t&&(0,_.default)(e.requestParams).then(function(t){try{r.entry_uid=r.asset_uid=r.tojson=r.queryCachePolicy=void 0;var a={};if(e.singleEntry)if(e.singleEntry=!1,t.schema&&(a.schema=t.schema),t.content_type&&(a.content_type=t.content_type,delete a.schema),t.entries&&t.entries.length)a.entry=t.entries[0];else{if(!t.assets||!t.assets.length)return 2!==n?u({error_code:141,error_message:"The requested entry doesn't exist."}):void r.provider.get(s,l());a.assets=t.assets[0]}else a=t;return-1!==n?(r.provider.set(s,a,function(e){try{if(e)throw e;return o||(a=y(a)),i(h(a))}catch(e){return u(e)}}),i(h(a))):(o||(a=y(a)),i(h(a)))}catch(e){return u({message:e.message})}}.bind(r)).catch(function(e){if(2!==n)return u(e);r.provider.get(s,l())})};switch(n){case 1:return new Promise(function(e,t){r.provider.get(s,function(r,n){try{if(!r&&n)return o||(n=y(n)),e(h(n));d(!0,e,t)}catch(e){return t(e)}})});case 2:case 0:case void 0:case-1:return new Promise(function(e,t){d(!0,e,t)})}if(3===n)return{cache:function(){return new Promise(function(e,t){r.provider.get(s,function(r,n){try{r?t(r):(o||(n=y(n)),e(h(n)))}catch(e){t(e)}})})}(),network:function(){return new Promise(function(e,t){d(!0,e,t)})}(),both:function(t){r.provider.get(s,function(e,r){o||(r=y(r)),t(e,h(r))}),(0,_.default)(e.requestParams).then(function(n){try{r.entry_uid=r.tojson=r.queryCachePolicy=void 0;var i={},s=null;e.singleEntry?(e.singleEntry=!1,n.schema&&(i.schema=n.schema),n.content_type&&(i.content_type=n.content_type,delete i.schema),n.entries&&n.entries.length?i.entry=n.entries[0]:n.assets&&n.assets.length?i.assets=n.assets[0]:s={error_code:141,error_message:"The requested entry doesn't exist."}):i=n,o||(i=y(i)),t(s,h(i))}catch(e){t(e)}}.bind(r)).catch(function(e){t(e)})}}}Object.defineProperty(t,"__esModule",{value:!0});var p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.transform=o,t._type=i,t.mergeDeep=s,t.merge=u,t.isBrowser=a,t.parseQueryFromParams=c,t.getHash=f,t.generateHash=l,t.resultWrapper=y,t.spreadResult=h,t.sendRequest=d;var v=r(2),_=n(v),m=r(16),b=n(m);!function(){Promise.prototype.spread||(Promise.prototype.spread=function(e,t){return t=t||function(e){},this.then(function(t){return e.apply(e,t)}).catch(function(e){t(e)})})}()}).call(t,r(4))},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=r(8),c=o(a),f=r(0),l=n(f),y=r(6),h=o(y),d=r(15),p=o(d),v=r(7),_=o(v),m=r(2),b=o(m),g=r(5),w=(n(g),r(3)),q=o(w),P=function(){function e(){i(this,e),this.config=c.default,this.cachePolicy=q.default.policies.IGNORE_CACHE,this.provider=q.default.providers("localstorage");for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];switch(r.length){case 1:if("object"===s(r[0])&&"string"==typeof r[0].api_key&&"string"==typeof r[0].access_token&&"string"==typeof r[0].environment)return this.headers={api_key:r[0].api_key,access_token:r[0].access_token},this.environment=r[0].environment,this;console.error("Kindly provide valid object parameters.");case 3:if("string"==typeof r[0]&&"string"==typeof r[1]&&"string"==typeof r[2])return this.headers={api_key:r[0],access_token:r[1]},this.environment=r[2],this;console.error("Kindly provide valid string parameters.");default:console.error("Kindly provide valid parameters to initialize the Built.io Contentstack javascript-SDK Stack.")}}return u(e,[{key:"setPort",value:function(e){return"number"==typeof e&&(this.config.port=e),this}},{key:"setProtocol",value:function(e){return"string"==typeof e&&~["https","http"].indexOf(e)&&(this.config.protocol=e),this}},{key:"setHost",value:function(e){return"string"==typeof e&&e&&(this.config.host=e),this}},{key:"setCachePolicy",value:function(e){return"number"==typeof e&&e>=-1&&e<4?this._query?this.queryCachePolicy=e:this.cachePolicy=e:console.error("Kindly provide the valid policy"),this}},{key:"setCacheProvider",value:function(e){return e&&"object"===(void 0===e?"undefined":s(e))&&(this.provider=e),this}},{key:"clearByQuery",value:function(){if(this.provider&&"function"==typeof this.provider.clearByQuery)return this.provider.clearByQuery.apply(this.provider,arguments)}},{key:"clearByContentType",value:function(){if(this.provider&&"function"==typeof this.provider.clearByContentType)return this.provider.clearByContentType.apply(this.provider,arguments)}},{key:"clearAll",value:function(){if(this.provider&&"function"==typeof this.provider.clearAll)return this.provider.clearAll.apply(this.provider,arguments)}},{key:"getCacheProvider",value:function(){return this.provider}},{key:"ContentType",value:function(e){return e&&"string"==typeof e&&(this.content_type_uid=e,this.type="contentType"),this}},{key:"Entry",value:function(e){var t=new h.default;return e&&"string"==typeof e&&(t.entry_uid=e),l.merge(t,this)}},{key:"Assets",value:function(e){if(this.type="asset",e&&"string"==typeof e){var t=new p.default;return t.asset_uid=e,l.merge(t,this)}return this}},{key:"Query",value:function(){var e=new _.default;return l.merge(e,this)}},{key:"getLastActivities",value:function(){var e={method:"POST",headers:this.headers,url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.content_types,body:{_method:"GET",only_last_activity:!0,environment:this.environment}};return(0,b.default)(e)}},{key:"imageTransform",value:function(e,t){if(e&&"string"==typeof e&&"object"===(void 0===t?"undefined":s(t))&&void 0===t.length){var r=[];for(var n in t)r.push(n+"="+t[n]);e+=e.indexOf("?")<=-1?"?"+r.join("&"):"&"+r.join("&")}return e}}]),e}();t.default=P},function(e,t,r){"use strict";function n(e){return new Promise(function(t,r){var n=void 0,i=e.url,s=e.headers;s["Content-Type"]="application/json; charset=UTF-8",s["X-User-Agent"]="contentstack-web/"+a,e.body&&"object"===o(e.body)&&(delete e.body._method,"object"===o(e.body.query)&&0===Object.keys(e.body.query).length&&delete e.body.query,n=function e(t,r){var n=[],i=void 0;if("object"===(void 0===t?"undefined":o(t))&&void 0!==t.length)for(var s=0,u=t.length;s<u;s++)n.push(r+"[]="+t[s]);else for(i in t){var a=r?r+"["+i+"]":i,c=t[i];n.push(null!==c&&"object"===(void 0===c?"undefined":o(c))&&"query"!==i?e(c,a):a+"="+encodeURIComponent("query"!==i?c:JSON.stringify(c)))}return n.join("&")}(e.body)),(0,u.default)(i+"?"+n,{method:"GET",headers:s}).then(function(e){if(e.ok&&200===e.status){var n=e.json();t(n)}else r(e.statusText)}).catch(function(e){console.log("Error: ",e),r(e)})})}Object.defineProperty(t,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.default=n;var i=r(0),s=(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);t.default=e}(i),r(17)),u=function(e){return e&&e.__esModule?e:{default:e}}(s),a="3.3.0"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(13),o=function(e){return e&&e.__esModule?e:{default:e}}(n),i={};i.providers=function(e){if(e)return o.default;console.error("Kindly provide valid provider.")},i.policies={IGNORE_CACHE:-1,ONLY_NETWORK:0,CACHE_ELSE_NETWORK:1,NETWORK_ELSE_CACHE:2,CACHE_THEN_NETWORK:3},t.default=i},function(e,t,r){"use strict";function n(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(l===setTimeout)return setTimeout(e,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(t){try{return l.call(null,e,0)}catch(t){return l.call(this,e,0)}}}function s(e){if(y===clearTimeout)return clearTimeout(e);if((y===o||!y)&&clearTimeout)return y=clearTimeout,clearTimeout(e);try{return y(e)}catch(t){try{return y.call(null,e)}catch(t){return y.call(this,e)}}}function u(){v&&d&&(v=!1,d.length?p=d.concat(p):_=-1,p.length&&a())}function a(){if(!v){var e=i(u);v=!0;for(var t=p.length;t;){for(d=p,p=[];++_<t;)d&&d[_].run();_=-1,t=p.length}d=null,v=!1,s(e)}}function c(e,t){this.fun=e,this.array=t}function f(){}var l,y,h=e.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:n}catch(e){l=n}try{y="function"==typeof clearTimeout?clearTimeout:o}catch(e){y=o}}();var d,p=[],v=!1,_=-1;h.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];p.push(new c(e,t)),1!==p.length||v||i(a)},c.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=f,h.addListener=f,h.once=f,h.off=f,h.removeListener=f,h.removeAllListeners=f,h.emit=f,h.prependListener=f,h.prependOnceListener=f,h.listeners=function(e){return[]},h.binding=function(e){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(e){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},function(e,t,r){"use strict";function n(e){var t=f.default.getItem(e);try{t=JSON.parse(t)}catch(e){return t}return t||null}function o(e,t){"object"===(void 0===t?"undefined":u(t))?f.default.setItem(e,JSON.stringify(t)):f.default.setItem(e,t)}function i(){return f.default||null}function s(){return f.default?Object.keys(f.default):[]}Object.defineProperty(t,"__esModule",{value:!0});var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.get=n,t.set=o,t.getStorage=i,t.getKeys=s;var a=r(0),c=(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);t.default=e}(a),r(18)),f=function(e){return e&&e.__esModule?e:{default:e}}(c)},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=r(0),u=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(s),a=r(1),c=(function(e){e&&e.__esModule}(a),function(){function e(){return n(this,e),this._query={},this.only=u.transform("only"),this.except=u.transform("except"),this}return i(e,[{key:"setCacheProvider",value:function(e){return e&&"object"===(void 0===e?"undefined":o(e))&&(this.provider=e),this}},{key:"setCachePolicy",value:function(e){return"number"==typeof e&&e>=-1&&e<4?this._query?this.queryCachePolicy=e:this.cachePolicy=e:console.error("Kindly provide the valid policy"),this}},{key:"includeReference",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];if(Array.isArray(t)||"string"==typeof t){if(arguments.length)for(var n=0;n<arguments.length;n++)this._query.include=this._query.include||[],this._query.include=this._query.include.concat(arguments[n]);return this}console.error("Argument should be a String or an Array.")}},{key:"language",value:function(e){if(e&&"string"==typeof e)return this._query.locale=e,this;console.error("Argument should be a String.")}},{key:"addQuery",value:function(e,t){if(e&&t&&"string"==typeof e)return this._query[e]=t,this;console.error("First argument should be a String.")}},{key:"includeSchema",value:function(){return this._query.include_schema=!0,this}},{key:"includeContentType",value:function(){return this._query.include_content_type=!0,this}},{key:"includeOwner",value:function(){return this._query.include_owner=!0,this}},{key:"toJSON",value:function(){return this.tojson=!0,this}},{key:"addParam",value:function(e,t){if(e&&t&&"string"==typeof e&&"string"==typeof t)return this._query[e]=t,this;console.error("Kindly provide valid parameters.")}},{key:"fetch",value:function(){if(this.entry_uid)return this.requestParams={method:"POST",headers:this.headers,url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.content_types+this.content_type_uid+this.config.urls.entries+this.entry_uid,body:{_method:"GET",query:this._query}},u.sendRequest(this);console.error("Kindly provide an entry uid. e.g. .Entry('bltsomething123')")}}]),e}());t.default=c},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c=r(2),f=(n(c),r(0)),l=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(f),y=r(6),h=n(y),d={compare:function(e){return function(t,r){if(t&&r&&"string"==typeof t&&void 0!==r)return this._query.query[t]=this._query.query.file_size||{},this._query.query[t][e]=r,this;console.error("Kindly provide valid parameters.")}},contained:function(e){var t=e?"$in":"$nin";return function(e,r){if(e&&r&&"string"==typeof e&&Array.isArray(r))return this._query.query[e]=this._query.query[e]||{},this._query.query[e][t]=this._query.query[e][t]||[],this._query.query[e][t]=this._query.query[e][t].concat(r),this;console.error("Kindly provide valid parameters.")}},exists:function(e){return function(t){if(t&&"string"==typeof t)return this._query.query[t]=this._query.query[t]||{},this._query.query[t].$exists=e,this;console.error("Kindly provide valid parameters.")}},logical:function(e){return function(){for(var t=[],r=0,n=arguments.length;r<n;r++)arguments[r]instanceof p&&arguments[r]._query.query?t.push(arguments[r]._query.query):"object"===a(arguments[r])&&t.push(arguments[r]);return this._query.query[e]?this._query.query[e]=this._query.query[e].concat(t):this._query.query[e]=t,this}},sort:function(e){return function(t){if(t&&"string"==typeof t)return this._query[e]=t,this;console.error("Argument should be a string.")}},pagination:function(e){return function(t){if("number"==typeof t)return this._query[e]=t,this;console.error("Argument should be a number.")}}},p=function(e){function t(){o(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e._query=e._query||{},e._query.query=e._query.query||{},e.lessThan=d.compare("$lt"),e.lessThanOrEqualTo=d.compare("$lte"),e.greaterThan=d.compare("$gt"),e.greaterThanOrEqualTo=d.compare("$gte"),e.notEqualTo=d.compare("$ne"),e.containedIn=d.contained(!0),e.notContainedIn=d.contained(!1),e.exists=d.exists(!0),e.notExists=d.exists(!1),e.ascending=d.sort("asc"),e.descending=d.sort("desc"),e.beforeUid=d.sort("before_uid"),e.afterUid=d.sort("after_uid"),e.skip=d.pagination("skip"),e.limit=d.pagination("limit"),e.or=d.logical("$or"),e.and=d.logical("$and"),e}return s(t,e),u(t,[{key:"equalTo",value:function(e,t){if(e&&"string"==typeof e)return this._query.query[e]=t,this;console.error("Kindly provide valid parameters.")}},{key:"where",value:function(e,t){if(e&&"string"==typeof e)return this._query.query[e]=t,this;console.error("Kindly provide valid parameters.")}},{key:"count",value:function(){var e=this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version,t=this.type&&"asset"===this.type?e+this.config.urls.assets:e+this.config.urls.content_types+this.content_type_uid+this.config.urls.entries;return this._query.count=!0,this.requestParams={method:"POST",headers:this.headers,url:t,body:{_method:"GET",query:this._query}},this}},{key:"query",value:function(e){if("object"===(void 0===e?"undefined":a(e)))return this._query.query=l.mergeDeep(this._query.query,e),this;console.error("Kindly provide valid parameters")}},{key:"tags",value:function(e){if(Array.isArray(e))return this._query.tags=e,this;console.error("Kindly provide valid parameters")}},{key:"includeCount",value:function(){return this._query.include_count=!0,this}},{key:"addParam",value:function(e,t){if(e&&t&&"string"==typeof e&&"string"==typeof t)return this._query[e]=t,this;console.error("Kindly provide valid parameters.")}},{key:"getQuery",value:function(){return this._query.query||{}}},{key:"regex",value:function(e,t,r){if(e&&t&&"string"==typeof e&&"string"==typeof t)return this._query.query[e]={$regex:t},r&&(this._query.query[e].$options=r),this;console.error("Kindly provide valid parameters.")}},{key:"search",value:function(e){if(e&&"string"==typeof e)return this._query.typeahead=e,this;console.error("Kindly provide valid parameters.")}},{key:"find",value:function(){var e=this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version,t=this.type&&"asset"===this.type?e+this.config.urls.assets:e+this.config.urls.content_types+this.content_type_uid+this.config.urls.entries;return this.requestParams={method:"POST",headers:this.headers,url:t,body:{_method:"GET",query:this._query}},l.sendRequest(this)}},{key:"findOne",value:function(){var e=this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version,t=this.type&&"asset"===this.type?e+this.config.urls.assets:e+this.config.urls.content_types+this.content_type_uid+this.config.urls.entries;return this.singleEntry=!0,this._query.limit=1,this.requestParams={method:"POST",headers:this.headers,url:t,body:{_method:"GET",query:this._query}},l.sendRequest(this)}}]),t}(h.default);t.default=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={protocol:"https",host:"cdn.contentstack.io",port:443,version:"v3",urls:{content_types:"/content_types/",entries:"/entries/",assets:"/assets/",environments:"/environments/"}};t.default=n},function(e,t,r){"use strict";(function(n,o){var i,s,u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};/*! | ||
* @overview es6-promise - a tiny implementation of Promises/A+. | ||
@@ -8,2 +8,2 @@ * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) | ||
*/ | ||
!function(n,o){"object"===u(t)&&void 0!==e?e.exports=o():(i=o,void 0!==(s="function"==typeof i?i.call(t,r,t,e):i)&&(e.exports=s))}(0,function(){function e(e){var t=void 0===e?"undefined":u(e);return null!==e&&("object"===t||"function"===t)}function t(e){return"function"==typeof e}function i(e){$=e}function s(e){Q=e}function a(){return void 0!==G?function(){G(f)}:c()}function c(){var e=setTimeout;return function(){return e(f,1)}}function f(){for(var e=0;e<J;e+=2){(0,Z[e])(Z[e+1]),Z[e]=void 0,Z[e+1]=void 0}J=0}function l(e,t){var r=arguments,n=this,o=new this.constructor(h);void 0===o[te]&&C(o);var i=n._state;return i?function(){var e=r[i-1];Q(function(){return E(i,o,e,n._result)})}():j(n,o,e,t),o}function y(e){var t=this;if(e&&"object"===(void 0===e?"undefined":u(e))&&e.constructor===t)return e;var r=new t(h);return w(r,e),r}function h(){}function d(){return new TypeError("You cannot resolve a promise with itself")}function p(){return new TypeError("A promises callback cannot return that same promise.")}function v(e){try{return e.then}catch(e){return ie.error=e,ie}}function _(e,t,r,n){try{e.call(t,r,n)}catch(e){return e}}function b(e,t,r){Q(function(e){var n=!1,o=_(r,t,function(r){n||(n=!0,t!==r?w(e,r):P(e,r))},function(t){n||(n=!0,O(e,t))},"Settle: "+(e._label||" unknown promise"));!n&&o&&(n=!0,O(e,o))},e)}function m(e,t){t._state===ne?P(e,t._result):t._state===oe?O(e,t._result):j(t,void 0,function(t){return w(e,t)},function(t){return O(e,t)})}function g(e,r,n){r.constructor===e.constructor&&n===l&&r.constructor.resolve===y?m(e,r):n===ie?(O(e,ie.error),ie.error=null):void 0===n?P(e,r):t(n)?b(e,r,n):P(e,r)}function w(t,r){t===r?O(t,d()):e(r)?g(t,r,v(r)):P(t,r)}function q(e){e._onerror&&e._onerror(e._result),T(e)}function P(e,t){e._state===re&&(e._result=t,e._state=ne,0!==e._subscribers.length&&Q(T,e))}function O(e,t){e._state===re&&(e._state=oe,e._result=t,Q(q,e))}function j(e,t,r,n){var o=e._subscribers,i=o.length;e._onerror=null,o[i]=t,o[i+ne]=r,o[i+oe]=n,0===i&&e._state&&Q(T,e)}function T(e){var t=e._subscribers,r=e._state;if(0!==t.length){for(var n=void 0,o=void 0,i=e._result,s=0;s<t.length;s+=3)n=t[s],o=t[s+r],n?E(r,n,o,i):o(i);e._subscribers.length=0}}function S(){this.error=null}function A(e,t){try{return e(t)}catch(e){return se.error=e,se}}function E(e,r,n,o){var i=t(n),s=void 0,u=void 0,a=void 0,c=void 0;if(i){if(s=A(n,o),s===se?(c=!0,u=s.error,s.error=null):a=!0,r===s)return void O(r,p())}else s=o,a=!0;r._state!==re||(i&&a?w(r,s):c?O(r,u):e===ne?P(r,s):e===oe&&O(r,s))}function k(e,t){try{t(function(t){w(e,t)},function(t){O(e,t)})}catch(t){O(e,t)}}function x(){return ue++}function C(e){e[te]=ue++,e._state=void 0,e._result=void 0,e._subscribers=[]}function B(e,t){this._instanceConstructor=e,this.promise=new e(h),this.promise[te]||C(this.promise),H(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?P(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&P(this.promise,this._result))):O(this.promise,M())}function M(){return new Error("Array Methods must be provided an Array")}function R(e){return new B(this,e).promise}function U(e){var t=this;return new t(H(e)?function(r,n){for(var o=e.length,i=0;i<o;i++)t.resolve(e[i]).then(r,n)}:function(e,t){return t(new TypeError("You must pass an array to race."))})}function K(e){var t=this,r=new t(h);return O(r,e),r}function N(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function D(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function I(e){this[te]=x(),this._result=this._state=void 0,this._subscribers=[],h!==e&&("function"!=typeof e&&N(),this instanceof I?k(this,e):D())}function F(){var e=void 0;if(void 0!==o)e=o;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var r=null;try{r=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===r&&!t.cast)return}e.Promise=I}var L=void 0;L=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var H=L,J=0,G=void 0,$=void 0,Q=function(e,t){Z[J]=e,Z[J+1]=t,2===(J+=2)&&($?$(f):ee())},W="undefined"!=typeof window?window:void 0,Y=W||{},z=Y.MutationObserver||Y.WebKitMutationObserver,X="undefined"==typeof self&&void 0!==n&&"[object process]"==={}.toString.call(n),V="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,Z=new Array(1e3),ee=void 0;ee=X?function(){return function(){return n.nextTick(f)}}():z?function(){var e=0,t=new z(f),r=document.createTextNode("");return t.observe(r,{characterData:!0}),function(){r.data=e=++e%2}}():V?function(){var e=new MessageChannel;return e.port1.onmessage=f,function(){return e.port2.postMessage(0)}}():void 0===W?function(){try{var e=r(!function(){var e=new Error('Cannot find module "vertx"');throw e.code="MODULE_NOT_FOUND",e}());return G=e.runOnLoop||e.runOnContext,a()}catch(e){return c()}}():c();var te=Math.random().toString(36).substring(16),re=void 0,ne=1,oe=2,ie=new S,se=new S,ue=0;return B.prototype._enumerate=function(e){for(var t=0;this._state===re&&t<e.length;t++)this._eachEntry(e[t],t)},B.prototype._eachEntry=function(e,t){var r=this._instanceConstructor,n=r.resolve;if(n===y){var o=v(e);if(o===l&&e._state!==re)this._settledAt(e._state,t,e._result);else if("function"!=typeof o)this._remaining--,this._result[t]=e;else if(r===I){var i=new r(h);g(i,e,o),this._willSettleAt(i,t)}else this._willSettleAt(new r(function(t){return t(e)}),t)}else this._willSettleAt(n(e),t)},B.prototype._settledAt=function(e,t,r){var n=this.promise;n._state===re&&(this._remaining--,e===oe?O(n,r):this._result[t]=r),0===this._remaining&&P(n,this._result)},B.prototype._willSettleAt=function(e,t){var r=this;j(e,void 0,function(e){return r._settledAt(ne,t,e)},function(e){return r._settledAt(oe,t,e)})},I.all=R,I.race=U,I.resolve=y,I.reject=K,I._setScheduler=i,I._setAsap=s,I._asap=Q,I.prototype={constructor:I,then:l,catch:function(e){return this.then(null,e)}},I.polyfill=F,I.Promise=I,I})}).call(t,r(4),r(11))},function(e,t,r){"use strict";r(12),e.exports=self.fetch.bind(self)},function(e,t,r){"use strict";var n,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"===("undefined"==typeof window?"undefined":o(window))&&(n=window)}e.exports=n},function(e,t,r){"use strict";!function(e){function t(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function r(e){return"string"!=typeof e&&(e=String(e)),e}function n(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return _.iterable&&(t[Symbol.iterator]=function(){return t}),t}function o(e){this.map={},e instanceof o?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function i(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function s(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function u(e){var t=new FileReader,r=s(t);return t.readAsArrayBuffer(e),r}function a(e){var t=new FileReader,r=s(t);return t.readAsText(e),r}function c(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}function f(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function l(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e)if("string"==typeof e)this._bodyText=e;else if(_.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(_.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(_.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(_.arrayBuffer&&_.blob&&m(e))this._bodyArrayBuffer=f(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!_.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e)&&!g(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=f(e)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):_.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},_.blob&&(this.blob=function(){var e=i(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?i(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(u)}),this.text=function(){var e=i(this);if(e)return e;if(this._bodyBlob)return a(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(c(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},_.formData&&(this.formData=function(){return this.text().then(d)}),this.json=function(){return this.text().then(JSON.parse)},this}function y(e){var t=e.toUpperCase();return w.indexOf(t)>-1?t:e}function h(e,t){t=t||{};var r=t.body;if(e instanceof h){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new o(e.headers)),this.method=e.method,this.mode=e.mode,r||null==e._bodyInit||(r=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new o(t.headers)),this.method=y(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function d(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(o))}}),t}function p(e){var t=new o;return e.split(/\r?\n/).forEach(function(e){var r=e.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();t.append(n,o)}}),t}function v(e,t){t||(t={}),this.type="default",this.status="status"in t?t.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new o(t.headers),this.url=t.url||"",this._initBody(e)}if(!e.fetch){var _={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(_.arrayBuffer)var b=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],m=function(e){return e&&DataView.prototype.isPrototypeOf(e)},g=ArrayBuffer.isView||function(e){return e&&b.indexOf(Object.prototype.toString.call(e))>-1};o.prototype.append=function(e,n){e=t(e),n=r(n);var o=this.map[e];this.map[e]=o?o+","+n:n},o.prototype.delete=function(e){delete this.map[t(e)]},o.prototype.get=function(e){return e=t(e),this.has(e)?this.map[e]:null},o.prototype.has=function(e){return this.map.hasOwnProperty(t(e))},o.prototype.set=function(e,n){this.map[t(e)]=r(n)},o.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},o.prototype.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),n(e)},o.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),n(e)},o.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),n(e)},_.iterable&&(o.prototype[Symbol.iterator]=o.prototype.entries);var w=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];h.prototype.clone=function(){return new h(this,{body:this._bodyInit})},l.call(h.prototype),l.call(v.prototype),v.prototype.clone=function(){return new v(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new o(this.headers),url:this.url})},v.error=function(){var e=new v(null,{status:0,statusText:""});return e.type="error",e};var q=[301,302,303,307,308];v.redirect=function(e,t){if(-1===q.indexOf(t))throw new RangeError("Invalid status code");return new v(null,{status:t,headers:{location:e}})},e.Headers=o,e.Request=h,e.Response=v,e.fetch=function(e,t){return new Promise(function(r,n){var o=new h(e,t),i=new XMLHttpRequest;i.onload=function(){var e={status:i.status,statusText:i.statusText,headers:p(i.getAllResponseHeaders()||"")};e.url="responseURL"in i?i.responseURL:e.headers.get("X-Request-URL");var t="response"in i?i.response:i.responseText;r(new v(t,e))},i.onerror=function(){n(new TypeError("Network request failed"))},i.ontimeout=function(){n(new TypeError("Network request failed"))},i.open(o.method,o.url,!0),"include"===o.credentials&&(i.withCredentials=!0),"responseType"in i&&_.blob&&(i.responseType="blob"),o.headers.forEach(function(e,t){i.setRequestHeader(t,e)}),i.send(void 0===o._bodyInit?null:o._bodyInit)})},e.fetch.polyfill=!0}}("undefined"!=typeof self?self:void 0)},function(e,t,r){"use strict";function n(e,t){!t&&e&&e.length&&e.push("");var r=void 0,n=i.getKeys(),o=i.getStorage();if(e&&e.length){r=e.join(".");for(var s=0,u=n.length;s<u;s++)n[s]&&0===n[s].indexOf(r)&&delete o[n[s]]}else for(var a=0,c=n.length;a<c;a++)delete o[n[a]]}Object.defineProperty(t,"__esModule",{value:!0});var o=r(5),i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(o),s={};s.get=function(e,t){try{t(null,i.get(e))}catch(e){t(e)}},s.set=function(e,t,r){try{e&&t&&i.set(e,t),r()}catch(e){r(e)}},s.clearByContentType=function(){try{if(2===arguments.length||3===arguments.length){var e=Array.prototype.slice.call(arguments),t=e.splice(-1,1).pop(),r=[];r.push.apply(r,e),n(r),t()}}catch(e){callback(e)}},s.clearByQuery=function(e,t){try{for(var r=i.getKeys(),n=i.getStorage(),o=0,s=r.length;o<s;o++)r[o]&&~r[o].indexOf(e)&&delete n[r[o]];t()}catch(e){t(e)}},s.clearAll=function(e){try{n(),e()}catch(t){e(t)}},t.default=s},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=r(1),u=n(s),a=r(3),c=n(a),f=function(){function e(){o(this,e),this.CachePolicy=c.default.policies}return i(e,[{key:"Stack",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return new(Function.prototype.bind.apply(u.default,[null].concat(t)))}}]),e}();e.exports=new f},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=r(0),u=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(s),a=r(1),c=(n(a),r(7)),f=n(c),l=function(){function e(){return o(this,e),this.only=u.transform("only"),this}return i(e,[{key:"Query",value:function(){var e=new f.default;return u.merge(e,this)}},{key:"toJSON",value:function(){return this.tojson=!0,this}},{key:"fetch",value:function(){if(this.asset_uid)return this.requestParams={method:"POST",headers:this.headers,url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.assets+this.asset_uid,body:{_method:"GET",query:this._query}},u.sendRequest(this);console.error("Kindly provide an asset uid. e.g. .Assets('bltsomething123')")}}]),e}();t.default=l},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(0),s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(i),u=function(){function e(t){return n(this,e),t&&(this.object=function(){return t}),this}return o(e,[{key:"toJSON",value:function(){return this.object()?s.mergeDeep(JSON.parse(JSON.stringify({})),this.object()):null}},{key:"get",value:function(e){if(this.object()&&e){return e.split(".").reduce(function(e,t){return e[t]},this.object())}}},{key:"getDownloadUrl",value:function(e){if(this.object()){var t=this.object().url?this.object().url:null,r=e&&"string"==typeof e?e:"attachment";return t?t+"?disposition="+r:null}}}]),e}();e.exports=function(e){return new u(e)}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=r(9),i=n(o),s=r(10),u=n(s);i.default.polyfill(),t.default=u.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=window.localStorage}])}); | ||
!function(n,o){"object"===u(t)&&void 0!==e?e.exports=o():(i=o,void 0!==(s="function"==typeof i?i.call(t,r,t,e):i)&&(e.exports=s))}(0,function(){function e(e){var t=void 0===e?"undefined":u(e);return null!==e&&("object"===t||"function"===t)}function t(e){return"function"==typeof e}function i(e){$=e}function s(e){Q=e}function a(){return void 0!==G?function(){G(f)}:c()}function c(){var e=setTimeout;return function(){return e(f,1)}}function f(){for(var e=0;e<J;e+=2){(0,Z[e])(Z[e+1]),Z[e]=void 0,Z[e+1]=void 0}J=0}function l(e,t){var r=arguments,n=this,o=new this.constructor(h);void 0===o[te]&&C(o);var i=n._state;return i?function(){var e=r[i-1];Q(function(){return E(i,o,e,n._result)})}():j(n,o,e,t),o}function y(e){var t=this;if(e&&"object"===(void 0===e?"undefined":u(e))&&e.constructor===t)return e;var r=new t(h);return w(r,e),r}function h(){}function d(){return new TypeError("You cannot resolve a promise with itself")}function p(){return new TypeError("A promises callback cannot return that same promise.")}function v(e){try{return e.then}catch(e){return ie.error=e,ie}}function _(e,t,r,n){try{e.call(t,r,n)}catch(e){return e}}function m(e,t,r){Q(function(e){var n=!1,o=_(r,t,function(r){n||(n=!0,t!==r?w(e,r):P(e,r))},function(t){n||(n=!0,O(e,t))},"Settle: "+(e._label||" unknown promise"));!n&&o&&(n=!0,O(e,o))},e)}function b(e,t){t._state===ne?P(e,t._result):t._state===oe?O(e,t._result):j(t,void 0,function(t){return w(e,t)},function(t){return O(e,t)})}function g(e,r,n){r.constructor===e.constructor&&n===l&&r.constructor.resolve===y?b(e,r):n===ie?(O(e,ie.error),ie.error=null):void 0===n?P(e,r):t(n)?m(e,r,n):P(e,r)}function w(t,r){t===r?O(t,d()):e(r)?g(t,r,v(r)):P(t,r)}function q(e){e._onerror&&e._onerror(e._result),T(e)}function P(e,t){e._state===re&&(e._result=t,e._state=ne,0!==e._subscribers.length&&Q(T,e))}function O(e,t){e._state===re&&(e._state=oe,e._result=t,Q(q,e))}function j(e,t,r,n){var o=e._subscribers,i=o.length;e._onerror=null,o[i]=t,o[i+ne]=r,o[i+oe]=n,0===i&&e._state&&Q(T,e)}function T(e){var t=e._subscribers,r=e._state;if(0!==t.length){for(var n=void 0,o=void 0,i=e._result,s=0;s<t.length;s+=3)n=t[s],o=t[s+r],n?E(r,n,o,i):o(i);e._subscribers.length=0}}function S(){this.error=null}function A(e,t){try{return e(t)}catch(e){return se.error=e,se}}function E(e,r,n,o){var i=t(n),s=void 0,u=void 0,a=void 0,c=void 0;if(i){if(s=A(n,o),s===se?(c=!0,u=s.error,s.error=null):a=!0,r===s)return void O(r,p())}else s=o,a=!0;r._state!==re||(i&&a?w(r,s):c?O(r,u):e===ne?P(r,s):e===oe&&O(r,s))}function k(e,t){try{t(function(t){w(e,t)},function(t){O(e,t)})}catch(t){O(e,t)}}function x(){return ue++}function C(e){e[te]=ue++,e._state=void 0,e._result=void 0,e._subscribers=[]}function B(e,t){this._instanceConstructor=e,this.promise=new e(h),this.promise[te]||C(this.promise),H(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?P(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&P(this.promise,this._result))):O(this.promise,M())}function M(){return new Error("Array Methods must be provided an Array")}function K(e){return new B(this,e).promise}function R(e){var t=this;return new t(H(e)?function(r,n){for(var o=e.length,i=0;i<o;i++)t.resolve(e[i]).then(r,n)}:function(e,t){return t(new TypeError("You must pass an array to race."))})}function U(e){var t=this,r=new t(h);return O(r,e),r}function N(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function D(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function I(e){this[te]=x(),this._result=this._state=void 0,this._subscribers=[],h!==e&&("function"!=typeof e&&N(),this instanceof I?k(this,e):D())}function F(){var e=void 0;if(void 0!==o)e=o;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var r=null;try{r=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===r&&!t.cast)return}e.Promise=I}var L=void 0;L=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var H=L,J=0,G=void 0,$=void 0,Q=function(e,t){Z[J]=e,Z[J+1]=t,2===(J+=2)&&($?$(f):ee())},W="undefined"!=typeof window?window:void 0,Y=W||{},z=Y.MutationObserver||Y.WebKitMutationObserver,X="undefined"==typeof self&&void 0!==n&&"[object process]"==={}.toString.call(n),V="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,Z=new Array(1e3),ee=void 0;ee=X?function(){return function(){return n.nextTick(f)}}():z?function(){var e=0,t=new z(f),r=document.createTextNode("");return t.observe(r,{characterData:!0}),function(){r.data=e=++e%2}}():V?function(){var e=new MessageChannel;return e.port1.onmessage=f,function(){return e.port2.postMessage(0)}}():void 0===W?function(){try{var e=r(!function(){var e=new Error('Cannot find module "vertx"');throw e.code="MODULE_NOT_FOUND",e}());return G=e.runOnLoop||e.runOnContext,a()}catch(e){return c()}}():c();var te=Math.random().toString(36).substring(16),re=void 0,ne=1,oe=2,ie=new S,se=new S,ue=0;return B.prototype._enumerate=function(e){for(var t=0;this._state===re&&t<e.length;t++)this._eachEntry(e[t],t)},B.prototype._eachEntry=function(e,t){var r=this._instanceConstructor,n=r.resolve;if(n===y){var o=v(e);if(o===l&&e._state!==re)this._settledAt(e._state,t,e._result);else if("function"!=typeof o)this._remaining--,this._result[t]=e;else if(r===I){var i=new r(h);g(i,e,o),this._willSettleAt(i,t)}else this._willSettleAt(new r(function(t){return t(e)}),t)}else this._willSettleAt(n(e),t)},B.prototype._settledAt=function(e,t,r){var n=this.promise;n._state===re&&(this._remaining--,e===oe?O(n,r):this._result[t]=r),0===this._remaining&&P(n,this._result)},B.prototype._willSettleAt=function(e,t){var r=this;j(e,void 0,function(e){return r._settledAt(ne,t,e)},function(e){return r._settledAt(oe,t,e)})},I.all=K,I.race=R,I.resolve=y,I.reject=U,I._setScheduler=i,I._setAsap=s,I._asap=Q,I.prototype={constructor:I,then:l,catch:function(e){return this.then(null,e)}},I.polyfill=F,I.Promise=I,I})}).call(t,r(4),r(11))},function(e,t,r){"use strict";r(12),e.exports=self.fetch.bind(self)},function(e,t,r){"use strict";var n,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"===("undefined"==typeof window?"undefined":o(window))&&(n=window)}e.exports=n},function(e,t,r){"use strict";!function(e){function t(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function r(e){return"string"!=typeof e&&(e=String(e)),e}function n(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return _.iterable&&(t[Symbol.iterator]=function(){return t}),t}function o(e){this.map={},e instanceof o?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function i(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function s(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function u(e){var t=new FileReader,r=s(t);return t.readAsArrayBuffer(e),r}function a(e){var t=new FileReader,r=s(t);return t.readAsText(e),r}function c(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}function f(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function l(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e)if("string"==typeof e)this._bodyText=e;else if(_.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(_.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(_.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(_.arrayBuffer&&_.blob&&b(e))this._bodyArrayBuffer=f(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!_.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e)&&!g(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=f(e)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):_.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},_.blob&&(this.blob=function(){var e=i(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?i(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(u)}),this.text=function(){var e=i(this);if(e)return e;if(this._bodyBlob)return a(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(c(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},_.formData&&(this.formData=function(){return this.text().then(d)}),this.json=function(){return this.text().then(JSON.parse)},this}function y(e){var t=e.toUpperCase();return w.indexOf(t)>-1?t:e}function h(e,t){t=t||{};var r=t.body;if(e instanceof h){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new o(e.headers)),this.method=e.method,this.mode=e.mode,r||null==e._bodyInit||(r=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new o(t.headers)),this.method=y(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function d(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(o))}}),t}function p(e){var t=new o;return e.split(/\r?\n/).forEach(function(e){var r=e.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();t.append(n,o)}}),t}function v(e,t){t||(t={}),this.type="default",this.status="status"in t?t.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new o(t.headers),this.url=t.url||"",this._initBody(e)}if(!e.fetch){var _={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(_.arrayBuffer)var m=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],b=function(e){return e&&DataView.prototype.isPrototypeOf(e)},g=ArrayBuffer.isView||function(e){return e&&m.indexOf(Object.prototype.toString.call(e))>-1};o.prototype.append=function(e,n){e=t(e),n=r(n);var o=this.map[e];this.map[e]=o?o+","+n:n},o.prototype.delete=function(e){delete this.map[t(e)]},o.prototype.get=function(e){return e=t(e),this.has(e)?this.map[e]:null},o.prototype.has=function(e){return this.map.hasOwnProperty(t(e))},o.prototype.set=function(e,n){this.map[t(e)]=r(n)},o.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},o.prototype.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),n(e)},o.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),n(e)},o.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),n(e)},_.iterable&&(o.prototype[Symbol.iterator]=o.prototype.entries);var w=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];h.prototype.clone=function(){return new h(this,{body:this._bodyInit})},l.call(h.prototype),l.call(v.prototype),v.prototype.clone=function(){return new v(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new o(this.headers),url:this.url})},v.error=function(){var e=new v(null,{status:0,statusText:""});return e.type="error",e};var q=[301,302,303,307,308];v.redirect=function(e,t){if(-1===q.indexOf(t))throw new RangeError("Invalid status code");return new v(null,{status:t,headers:{location:e}})},e.Headers=o,e.Request=h,e.Response=v,e.fetch=function(e,t){return new Promise(function(r,n){var o=new h(e,t),i=new XMLHttpRequest;i.onload=function(){var e={status:i.status,statusText:i.statusText,headers:p(i.getAllResponseHeaders()||"")};e.url="responseURL"in i?i.responseURL:e.headers.get("X-Request-URL");var t="response"in i?i.response:i.responseText;r(new v(t,e))},i.onerror=function(){n(new TypeError("Network request failed"))},i.ontimeout=function(){n(new TypeError("Network request failed"))},i.open(o.method,o.url,!0),"include"===o.credentials&&(i.withCredentials=!0),"responseType"in i&&_.blob&&(i.responseType="blob"),o.headers.forEach(function(e,t){i.setRequestHeader(t,e)}),i.send(void 0===o._bodyInit?null:o._bodyInit)})},e.fetch.polyfill=!0}}("undefined"!=typeof self?self:void 0)},function(e,t,r){"use strict";function n(e,t){!t&&e&&e.length&&e.push("");var r=void 0,n=i.getKeys(),o=i.getStorage();if(e&&e.length){r=e.join(".");for(var s=0,u=n.length;s<u;s++)n[s]&&0===n[s].indexOf(r)&&delete o[n[s]]}else for(var a=0,c=n.length;a<c;a++)delete o[n[a]]}Object.defineProperty(t,"__esModule",{value:!0});var o=r(5),i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(o),s={};s.get=function(e,t){try{t(null,i.get(e))}catch(e){t(e)}},s.set=function(e,t,r){try{e&&t&&i.set(e,t),r()}catch(e){r(e)}},s.clearByContentType=function(){try{if(2===arguments.length||3===arguments.length){var e=Array.prototype.slice.call(arguments),t=e.splice(-1,1).pop(),r=[];r.push.apply(r,e),n(r),t()}}catch(e){callback(e)}},s.clearByQuery=function(e,t){try{for(var r=i.getKeys(),n=i.getStorage(),o=0,s=r.length;o<s;o++)r[o]&&~r[o].indexOf(e)&&delete n[r[o]];t()}catch(e){t(e)}},s.clearAll=function(e){try{n(),e()}catch(t){e(t)}},t.default=s},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=r(1),u=n(s),a=r(3),c=n(a),f=function(){function e(){o(this,e),this.CachePolicy=c.default.policies}return i(e,[{key:"Stack",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return new(Function.prototype.bind.apply(u.default,[null].concat(t)))}}]),e}();e.exports=new f},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=r(0),u=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(s),a=r(1),c=(n(a),r(7)),f=(n(c),function(){function e(){return o(this,e),this._query={},this.only=u.transform("only"),this}return i(e,[{key:"toJSON",value:function(){return this.tojson=!0,this}},{key:"addParam",value:function(e,t){if(e&&"string"==typeof e&&t&&"string"==typeof t)return this._query[e]=t,this;console.error("Kindly provide a valid parameters.")}},{key:"fetch",value:function(){if(this.asset_uid)return this.requestParams={method:"POST",headers:this.headers,url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.assets+this.asset_uid,body:{_method:"GET",query:this._query}},u.sendRequest(this);console.error("Kindly provide an asset uid. e.g. .Assets('bltsomething123')")}}]),e}());t.default=f},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(0),s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(i),u=function(){function e(t){return n(this,e),t&&(this.object=function(){return t}),this}return o(e,[{key:"toJSON",value:function(){return this.object()?s.mergeDeep(JSON.parse(JSON.stringify({})),this.object()):null}},{key:"get",value:function(e){if(this.object()&&e){return e.split(".").reduce(function(e,t){return e[t]},this.object())}}},{key:"getDownloadUrl",value:function(e){if(this.object()){var t=this.object().url?this.object().url:null,r=e&&"string"==typeof e?e:"attachment";return t?t+"?disposition="+r:null}}}]),e}();e.exports=function(e){return new u(e)}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=r(9),i=n(o),s=r(10),u=n(s);i.default.polyfill(),t.default=u.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=window.localStorage}])}); |
@@ -0,0 +0,0 @@ The MIT License (MIT) |
{ | ||
"name": "contentstack", | ||
"version": "3.3.0", | ||
"version": "3.4.0", | ||
"description": "Contentstack Javascript SDK", | ||
@@ -18,3 +18,4 @@ "homepage": "https://www.contentstack.com/", | ||
"buildreactnative": "webpack --config webpack/webpack.react-native.js", | ||
"buildall": "npm run buildnode&npm run buildweb&npm run buildreactnative", | ||
"buildnativescript": "webpack --config webpack/webpack.native-script.js", | ||
"buildall": "npm run buildnode&npm run buildweb&npm run buildreactnative&npm run buildnativescript", | ||
"generate-docs": "node_modules/.bin/jsdoc --configure docs-config.json --verbose" | ||
@@ -21,0 +22,0 @@ }, |
@@ -0,0 +0,0 @@ [![Contentstack](https://www.contentstack.com/docs/static/images/contentstack.png)](https://www.contentstack.com/) |
@@ -0,0 +0,0 @@ import localstorage from './localstorage'; |
@@ -0,0 +0,0 @@ import * as cache from './../cache'; |
@@ -0,0 +0,0 @@ import * as Utils from "./lib/utils.js"; |
@@ -0,0 +0,0 @@ import Stack from "./stack"; |
@@ -11,2 +11,3 @@ import * as Utils from "./utils.js"; | ||
let serialize = function(obj, prefix) { | ||
let str = [], | ||
@@ -24,3 +25,3 @@ p; | ||
serialize(v, k) : | ||
k + "=" + (p !== 'query' ? encodeURIComponent(v) : JSON.stringify(v))); | ||
k + "=" + encodeURIComponent(p !== 'query' ? v : JSON.stringify(v))); | ||
} | ||
@@ -27,0 +28,0 @@ } |
@@ -0,0 +0,0 @@ import Request from './request'; |
@@ -16,2 +16,3 @@ import * as Utils from '../lib/utils'; | ||
constructor() { | ||
this._query = {}; | ||
/** | ||
@@ -38,13 +39,2 @@ * @method only | ||
/** | ||
* @method Query | ||
* @description Query instance to provide support for all search queries. | ||
* @example Assets().Query() | ||
* @returns {Query} | ||
*/ | ||
Query() { | ||
let query = new Query(); | ||
return Utils.merge(query, this); | ||
} | ||
/** | ||
* @method toJSON | ||
@@ -67,2 +57,15 @@ * @description This method is used to convert the result in to plain javascript object. | ||
/** | ||
* @method AddParam | ||
* @description This method includes query parameter in query. | ||
* @example Stack.Assets('bltsomething123').addParam('include_dimension', 'true').fetch() | ||
*/ | ||
addParam(key, value) { | ||
if (key && typeof key === 'string' && value && typeof value === 'string') { | ||
this._query[key] = value; | ||
return this; | ||
} else { | ||
console.error("Kindly provide a valid parameters."); | ||
} | ||
} | ||
@@ -86,2 +89,3 @@ /** | ||
} | ||
return Utils.sendRequest(this); | ||
@@ -88,0 +92,0 @@ } else { |
@@ -195,2 +195,17 @@ import * as Utils from "../lib/utils"; | ||
/** | ||
* @method AddParam | ||
* @description This method includes query parameter in query. | ||
* @example blogQuery.addParam('include_count', 'true').fetch() | ||
*/ | ||
addParam(key, value) { | ||
if (key && value && typeof key === 'string' && typeof value === 'string') { | ||
this._query[key] = value; | ||
return this; | ||
} else { | ||
console.error("Kindly provide valid parameters."); | ||
} | ||
} | ||
/** | ||
* @method fetch | ||
@@ -197,0 +212,0 @@ * @description fetch entry of requested content_type of defined query if present. |
@@ -93,2 +93,3 @@ import Request from '../lib/request'; | ||
export default class Query extends Entry { | ||
constructor() { | ||
@@ -98,3 +99,2 @@ super(); | ||
this._query['query'] = this._query['query'] || {}; | ||
/** | ||
@@ -372,2 +372,17 @@ * @method lessThan | ||
/** | ||
* @method AddParam | ||
* @description This method includes query parameter in query. | ||
* @example blogQuery.addParam('include_count', 'true') | ||
* @returns {Query} | ||
*/ | ||
addParam(key, value) { | ||
if (key && value && typeof key === 'string' && typeof value === 'string') { | ||
this._query[key] = value; | ||
return this; | ||
} else { | ||
console.error("Kindly provide valid parameters."); | ||
} | ||
} | ||
/** | ||
* @method getQuery | ||
@@ -374,0 +389,0 @@ * @summary returns the raw query which can be used for futher calls(.and/.or). |
@@ -0,0 +0,0 @@ import * as Utils from '../lib/utils' |
@@ -212,12 +212,13 @@ import config from '../../config'; | ||
* @param {String} uid - asset_uid | ||
* @example Stack.Assets('blt1234567890abcef') | ||
* @example Stack.Assets('blt1234567890abcef').fetch | ||
* @returns {Assets} | ||
*/ | ||
Assets(uid) { | ||
let asset = new Assets(); | ||
this.type = 'asset'; | ||
if (uid && typeof uid === "string") { | ||
let asset = new Assets(); | ||
asset.asset_uid = uid; | ||
return Utils.merge(asset, this); | ||
} | ||
return Utils.merge(asset, this); | ||
return this; | ||
} | ||
@@ -224,0 +225,0 @@ |
@@ -0,0 +0,0 @@ import ES6Promise from 'es6-promise'; |
import localStorage from 'localStorage'; | ||
export default localStorage; |
export default fetch; | ||
import localStorage from 'localStorage'; | ||
export default localStorage; |
@@ -0,0 +0,0 @@ import ES6Promise from 'es6-promise'; |
export default window.localStorage; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
799916
34
13792
12