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

contentstack

Package Overview
Dependencies
Maintainers
3
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

contentstack - npm Package Compare versions

Comparing version 3.6.0 to 3.7.0

dist/.DS_Store

4

dist/web/contentstack.js

@@ -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,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):e&&void 0!==e.items&&(e.items=(0,b.default)(e.items).toJSON());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),void 0!==e.items&&t.push(e)),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={},c={};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||null===r.provider?u({error_code:141,error_message:"The requested entry doesn't exist."}):void r.provider.get(s,l());a.assets=t.assets[0]}else t.items?c={items:t.items,pagination_token:t.pagination_token,sync_token:t.sync_token,total_count:t.total_count}:a=t;return-1!==n&&null!==r.provider?(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))):Object.keys(c).length?i(c):(o||(a=y(a)),i(h(a)))}catch(e){return u({message:e.message})}}.bind(r)).catch(function(e){if(2!==n||null===r.provider)return u(e);r.provider.get(s,l())})};switch(n){case 1:return new Promise(function(e,t){null!==r.provider?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)}}):d(!0,e,t)});case 2:case 0:case void 0:case-1:return new Promise(function(e,t){d(!0,e,t)})}if(3===n){return new Promise(function(e,t){null!==r.provider&&r.provider.get(s,function(r,n){try{r||!n?t(r):(o||(n=y(n)),e(h(n)))}catch(e){t(e)}})}).then(function(){return new Promise(function(e,t){d(!0,e,t)})}).catch(function(e){return new Promise(function(e,t){d(!0,e,t)})})}}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:"fetch",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+this.content_type_uid,body:{_method:"GET",environment:this.environment}};return(0,b.default)(e)}},{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:"getContentTypes",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",environment:this.environment}};return(0,b.default)(e)}},{key:"sync",value:function(e){return this._query={},this._query=Object.assign(this._query,e),this.requestParams={method:"POST",headers:this.headers,url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.sync,body:{_method:"GET",query:this._query}},l.sendRequest(this)}},{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.5.2"},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){try{"object"===(void 0===t?"undefined":u(t))?f.default.setItem(e,JSON.stringify(t)):f.default.setItem(e,t)}catch(e){}}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:{sync:"/stacks/sync",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):e&&void 0!==e.items&&(e.items=(0,b.default)(e.items).toJSON());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),void 0!==e.items&&t.push(e)),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={},c={};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||null===r.provider?u({error_code:141,error_message:"The requested entry doesn't exist."}):void r.provider.get(s,l());a.assets=t.assets[0]}else t.items?c={items:t.items,pagination_token:t.pagination_token,sync_token:t.sync_token,total_count:t.total_count}:a=t;return-1!==n&&null!==r.provider?(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))):Object.keys(c).length?i(c):(o||(a=y(a)),i(h(a)))}catch(e){return u({message:e.message})}}.bind(r)).catch(function(e){if(2!==n||null===r.provider)return u(e);r.provider.get(s,l())})};switch(n){case 1:return new Promise(function(e,t){null!==r.provider?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)}}):d(!0,e,t)});case 2:case 0:case void 0:case-1:return new Promise(function(e,t){d(!0,e,t)})}if(3===n){return new Promise(function(e,t){null!==r.provider&&r.provider.get(s,function(r,n){try{r||!n?t(r):(o||(n=y(n)),e(h(n)))}catch(e){t(e)}})}).then(function(){return new Promise(function(e,t){d(!0,e,t)})}).catch(function(e){return new Promise(function(e,t){d(!0,e,t)})})}}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:"fetch",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+this.content_type_uid,body:{_method:"GET",environment:this.environment}};return(0,b.default)(e)}},{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:"getContentTypes",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",environment:this.environment}};return(0,b.default)(e)}},{key:"sync",value:function(e){return this._query={},this._query=Object.assign(this._query,e),this.requestParams={method:"POST",headers:this.headers,url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.sync,body:{_method:"GET",query:this._query}},l.sendRequest(this)}},{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.7.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){try{"object"===(void 0===t?"undefined":u(t))?f.default.setItem(e,JSON.stringify(t)):f.default.setItem(e,t)}catch(e){}}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:"includeReferenceContentTypeUID",value:function(){return this._query.include_reference_content_type_uid=!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:"includeReferenceContentTypeUID",value:function(){return this._query.include_reference_content_type_uid=!0,this}},{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:{sync:"/stacks/sync",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!==J?function(){J(f)}:c()}function c(){var e=setTimeout;return function(){return e(f,1)}}function f(){for(var e=0;e<G;e+=2){(0,Z[e])(Z[e+1]),Z[e]=void 0,Z[e+1]=void 0}G=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 A(i,o,e,n._result)})}():T(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):T(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),j(e)}function P(e,t){e._state===re&&(e._result=t,e._state=ne,0!==e._subscribers.length&&Q(j,e))}function O(e,t){e._state===re&&(e._state=oe,e._result=t,Q(q,e))}function T(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(j,e)}function j(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?A(r,n,o,i):o(i);e._subscribers.length=0}}function S(){this.error=null}function E(e,t){try{return e(t)}catch(e){return se.error=e,se}}function A(e,r,n,o){var i=t(n),s=void 0,u=void 0,a=void 0,c=void 0;if(i){if(s=E(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 K(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,G=0,J=void 0,$=void 0,Q=function(e,t){Z[G]=e,Z[G+1]=t,2===(G+=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 J=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;T(e,void 0,function(e){return r._settledAt(ne,t,e)},function(e){return r._settledAt(oe,t,e)})},I.all=R,I.race=K,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 n(e){return e&&DataView.prototype.isPrototypeOf(e)}function o(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 i(e){return"string"!=typeof e&&(e=String(e)),e}function s(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return w.iterable&&(t[Symbol.iterator]=function(){return t}),t}function u(e){this.map={},e instanceof u?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 a(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function c(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function f(e){var t=new FileReader,r=c(t);return t.readAsArrayBuffer(e),r}function l(e){var t=new FileReader,r=c(t);return t.readAsText(e),r}function y(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 h(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function d(){return this.bodyUsed=!1,this._initBody=function(e){this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:w.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:w.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:w.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():w.arrayBuffer&&w.blob&&n(e)?(this._bodyArrayBuffer=h(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):w.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||P(e))?this._bodyArrayBuffer=h(e):this._bodyText=e=Object.prototype.toString.call(e):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):w.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},w.blob&&(this.blob=function(){var e=a(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?a(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(f)}),this.text=function(){var e=a(this);if(e)return e;if(this._bodyBlob)return l(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(y(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},w.formData&&(this.formData=function(){return this.text().then(_)}),this.json=function(){return this.text().then(JSON.parse)},this}function p(e){var t=e.toUpperCase();return O.indexOf(t)>-1?t:e}function v(e,t){t=t||{};var r=t.body;if(e instanceof v){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new u(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,r||null==e._bodyInit||(r=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new u(t.headers)),this.method=p(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,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 _(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 m(e){var t=new u;return e.replace(/\r?\n[\t ]+/g," ").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 b(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new u(t.headers),this.url=t.url||"",this._initBody(e)}function g(e,t){return new Promise(function(r,n){function o(){s.abort()}var i=new v(e,t);if(i.signal&&i.signal.aborted)return n(new j("Aborted","AbortError"));var s=new XMLHttpRequest;s.onload=function(){var e={status:s.status,statusText:s.statusText,headers:m(s.getAllResponseHeaders()||"")};e.url="responseURL"in s?s.responseURL:e.headers.get("X-Request-URL");var t="response"in s?s.response:s.responseText;r(new b(t,e))},s.onerror=function(){n(new TypeError("Network request failed"))},s.ontimeout=function(){n(new TypeError("Network request failed"))},s.onabort=function(){n(new j("Aborted","AbortError"))},s.open(i.method,i.url,!0),"include"===i.credentials?s.withCredentials=!0:"omit"===i.credentials&&(s.withCredentials=!1),"responseType"in s&&w.blob&&(s.responseType="blob"),i.headers.forEach(function(e,t){s.setRequestHeader(t,e)}),i.signal&&(i.signal.addEventListener("abort",o),s.onreadystatechange=function(){4===s.readyState&&i.signal.removeEventListener("abort",o)}),s.send(void 0===i._bodyInit?null:i._bodyInit)})}Object.defineProperty(t,"__esModule",{value:!0}),t.Headers=u,t.Request=v,t.Response=b,t.fetch=g;var w={searchParams:"URLSearchParams"in self,iterable:"Symbol"in self&&"iterator"in Symbol,blob:"FileReader"in self&&"Blob"in self&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in self,arrayBuffer:"ArrayBuffer"in self};if(w.arrayBuffer)var q=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],P=ArrayBuffer.isView||function(e){return e&&q.indexOf(Object.prototype.toString.call(e))>-1};u.prototype.append=function(e,t){e=o(e),t=i(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},u.prototype.delete=function(e){delete this.map[o(e)]},u.prototype.get=function(e){return e=o(e),this.has(e)?this.map[e]:null},u.prototype.has=function(e){return this.map.hasOwnProperty(o(e))},u.prototype.set=function(e,t){this.map[o(e)]=i(t)},u.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},u.prototype.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),s(e)},u.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),s(e)},u.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),s(e)},w.iterable&&(u.prototype[Symbol.iterator]=u.prototype.entries);var O=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},d.call(v.prototype),d.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new u(this.headers),url:this.url})},b.error=function(){var e=new b(null,{status:0,statusText:""});return e.type="error",e};var T=[301,302,303,307,308];b.redirect=function(e,t){if(-1===T.indexOf(t))throw new RangeError("Invalid status code");return new b(null,{status:t,headers:{location:e}})};var j=t.DOMException=self.DOMException;try{new j}catch(e){t.DOMException=j=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},j.prototype=Object.create(Error.prototype),j.prototype.constructor=j}g.polyfill=!0,self.fetch||(self.fetch=g,self.Headers=u,self.Request=v,self.Response=b)},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=function(){try{return window.localStorage}catch(e){return null}}()}])});
!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!==J?function(){J(f)}:c()}function c(){var e=setTimeout;return function(){return e(f,1)}}function f(){for(var e=0;e<G;e+=2){(0,Z[e])(Z[e+1]),Z[e]=void 0,Z[e+1]=void 0}G=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)})}():T(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):T(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),j(e)}function P(e,t){e._state===re&&(e._result=t,e._state=ne,0!==e._subscribers.length&&Q(j,e))}function O(e,t){e._state===re&&(e._state=oe,e._result=t,Q(q,e))}function T(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(j,e)}function j(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 k(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=k(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 A(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 D(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function N(){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&&D(),this instanceof I?A(this,e):N())}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,G=0,J=void 0,$=void 0,Q=function(e,t){Z[G]=e,Z[G+1]=t,2===(G+=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 J=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;T(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 n(e){return e&&DataView.prototype.isPrototypeOf(e)}function o(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 i(e){return"string"!=typeof e&&(e=String(e)),e}function s(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return w.iterable&&(t[Symbol.iterator]=function(){return t}),t}function u(e){this.map={},e instanceof u?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 a(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function c(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function f(e){var t=new FileReader,r=c(t);return t.readAsArrayBuffer(e),r}function l(e){var t=new FileReader,r=c(t);return t.readAsText(e),r}function y(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 h(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function d(){return this.bodyUsed=!1,this._initBody=function(e){this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:w.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:w.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:w.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():w.arrayBuffer&&w.blob&&n(e)?(this._bodyArrayBuffer=h(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):w.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||P(e))?this._bodyArrayBuffer=h(e):this._bodyText=e=Object.prototype.toString.call(e):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):w.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},w.blob&&(this.blob=function(){var e=a(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?a(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(f)}),this.text=function(){var e=a(this);if(e)return e;if(this._bodyBlob)return l(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(y(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},w.formData&&(this.formData=function(){return this.text().then(_)}),this.json=function(){return this.text().then(JSON.parse)},this}function p(e){var t=e.toUpperCase();return O.indexOf(t)>-1?t:e}function v(e,t){t=t||{};var r=t.body;if(e instanceof v){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new u(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,r||null==e._bodyInit||(r=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new u(t.headers)),this.method=p(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,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 _(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 m(e){var t=new u;return e.replace(/\r?\n[\t ]+/g," ").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 b(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new u(t.headers),this.url=t.url||"",this._initBody(e)}function g(e,t){return new Promise(function(r,n){function o(){s.abort()}var i=new v(e,t);if(i.signal&&i.signal.aborted)return n(new j("Aborted","AbortError"));var s=new XMLHttpRequest;s.onload=function(){var e={status:s.status,statusText:s.statusText,headers:m(s.getAllResponseHeaders()||"")};e.url="responseURL"in s?s.responseURL:e.headers.get("X-Request-URL");var t="response"in s?s.response:s.responseText;r(new b(t,e))},s.onerror=function(){n(new TypeError("Network request failed"))},s.ontimeout=function(){n(new TypeError("Network request failed"))},s.onabort=function(){n(new j("Aborted","AbortError"))},s.open(i.method,i.url,!0),"include"===i.credentials?s.withCredentials=!0:"omit"===i.credentials&&(s.withCredentials=!1),"responseType"in s&&w.blob&&(s.responseType="blob"),i.headers.forEach(function(e,t){s.setRequestHeader(t,e)}),i.signal&&(i.signal.addEventListener("abort",o),s.onreadystatechange=function(){4===s.readyState&&i.signal.removeEventListener("abort",o)}),s.send(void 0===i._bodyInit?null:i._bodyInit)})}Object.defineProperty(t,"__esModule",{value:!0}),t.Headers=u,t.Request=v,t.Response=b,t.fetch=g;var w={searchParams:"URLSearchParams"in self,iterable:"Symbol"in self&&"iterator"in Symbol,blob:"FileReader"in self&&"Blob"in self&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in self,arrayBuffer:"ArrayBuffer"in self};if(w.arrayBuffer)var q=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],P=ArrayBuffer.isView||function(e){return e&&q.indexOf(Object.prototype.toString.call(e))>-1};u.prototype.append=function(e,t){e=o(e),t=i(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},u.prototype.delete=function(e){delete this.map[o(e)]},u.prototype.get=function(e){return e=o(e),this.has(e)?this.map[e]:null},u.prototype.has=function(e){return this.map.hasOwnProperty(o(e))},u.prototype.set=function(e,t){this.map[o(e)]=i(t)},u.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},u.prototype.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),s(e)},u.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),s(e)},u.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),s(e)},w.iterable&&(u.prototype[Symbol.iterator]=u.prototype.entries);var O=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},d.call(v.prototype),d.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new u(this.headers),url:this.url})},b.error=function(){var e=new b(null,{status:0,statusText:""});return e.type="error",e};var T=[301,302,303,307,308];b.redirect=function(e,t){if(-1===T.indexOf(t))throw new RangeError("Invalid status code");return new b(null,{status:t,headers:{location:e}})};var j=t.DOMException=self.DOMException;try{new j}catch(e){t.DOMException=j=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},j.prototype=Object.create(Error.prototype),j.prototype.constructor=j}g.polyfill=!0,self.fetch||(self.fetch=g,self.Headers=u,self.Request=v,self.Response=b)},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=function(){try{return window.localStorage}catch(e){return null}}()}])});
{
"name": "contentstack",
"version": "3.6.0",
"version": "3.7.0",
"description": "Contentstack Javascript SDK",

@@ -5,0 +5,0 @@ "homepage": "https://www.contentstack.com/",

@@ -9,3 +9,3 @@ import * as Utils from '../lib/utils';

* @summary Creates an instance of `Assets`.
* @description Retrieves the asset based on the specified UID
* @description Retrieves all assets of a stack by default. To retrieve a single asset, specify its UID.
* @param {String} uid - uid of asset you want to retrieve

@@ -20,2 +20,10 @@ * @example

* })
* @example
* let data = Stack.Assets().toJSON().find()
* data
* .then(function(result) {
* // ‘result’ will display all assets present in stack
* }, function(error) {
* // error function
* })
* @returns {Assets}

@@ -22,0 +30,0 @@ * @instance

@@ -197,2 +197,25 @@ import * as Utils from "../lib/utils";

/**
* @method includeReferenceContentTypeUid
* @memberOf Entry
* @description This method also includes the content type UIDs of the referenced entries returned in the response.
* @example Stack.ContentType("contentType_uid").Entry("entry_uid").includeReferenceContentTypeUID().fetch()
* @example
* Query = Stack.ContentType("contentType_uid").Entry("entry_uid").includeReferenceContentTypeUID().fetch()
* Query
* .toJSON()
* .then(function (result) {
* let value = result.get(field_uid)
* },function (error) {
* // error function
* })
* @returns {Entry}
* @instance
*/
includeReferenceContentTypeUID() {
this._query['include_reference_content_type_uid'] = true;
return this;
}
/**
* @method includeContentType

@@ -199,0 +222,0 @@ * @memberOf Entry

@@ -501,2 +501,24 @@ import Request from '../lib/request';

/**
* @method includeReferenceContentTypeUid
* @memberOf Query
* @description This method also includes the content type UIDs of the referenced entries returned in the response.
* @example Stack.ContentType("contentType_uid").Query().includeReferenceContentTypeUID().find()
* @example
* let blogQuery = Stack.ContentType("contentType_uid").Query();
* let data = blogQuery.includeReferenceContentTypeUID().find()
* data.then(function(result) {
* // ‘result’ contains a list of entries in which content type UIDs is present.
* },function (error) {
* // error function
* })
* @returns {Query}
* @instance
*/
includeReferenceContentTypeUID() {
this._query['include_reference_content_type_uid'] = true;
return this;
}
/**
* @method includeCount

@@ -534,3 +556,2 @@ * @memberOf Query

*/
addParam(key, value) {

@@ -600,3 +621,3 @@ if (key && value && typeof key === 'string' && typeof value === 'string') {

* @instance
*/
*/
search(value) {

@@ -669,2 +690,3 @@ if (value && typeof value === 'string') {

};
return Utils.sendRequest(this);

@@ -671,0 +693,0 @@ }

@@ -285,3 +285,19 @@ import config from '../../config';

* @param {String} uid - uid of the asset
* @description Retrieves the asset based on the specified UID
* @description Retrieves all assets of a stack by default. To retrieve a single asset, specify its UID.
* @example
* let data = Stack.Assets('bltsomething123').toJSON().fetch()
* data
* .then(function(result) {
* // ‘result’ is a single asset object of specified uid
* }, function(error) {
* // error function
* })
* @example
* let data = Stack.Assets().toJSON().find()
* data
* .then(function(result) {
* // ‘result’ will display all assets present in stack
* }, function(error) {
* // error function
* })
* @returns {Assets}

@@ -288,0 +304,0 @@ * @instance

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc