contentstack
Advanced tools
Comparing version 3.12.1 to 3.12.2
### Version: 3.12.2 | ||
#### Date: Feb-19-2021 | ||
##### API timeout: | ||
- updated timeout to min 30 sec | ||
##### Enhancement Typescript: | ||
- boolean value support added: | ||
- [Query] - where, equalTo, notEqualTo | ||
### Version: 3.12.1 | ||
@@ -3,0 +12,0 @@ #### Date: Jan-22-2021 |
@@ -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()}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=8)}([function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n="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=function(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")}}},t._type=function(e){var t=void 0===e?"undefined":n(e);switch(t){case"object":t,Array.isArray(e)&&(t="array");break;default:t}return t},t.mergeDeep=function(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},t.merge=u,t.isBrowser=function(){return"undefined"!=typeof window&&"object"===(void 0===e?"undefined":n(e))&&"browser"===e.title},t.parseQueryFromParams=c,t.getHash=a,t.generateHash=f,t.resultWrapper=l,t.spreadResult=y,t.sendRequest=function(e,t){var r=e.environment_uid;r?e._query.environment_uid=r:(e._query||(e._query={}),e._query.environment=e.environment);var i=e,s=void 0!==i.queryCachePolicy?i.queryCachePolicy:i.cachePolicy,f=void 0!==i.tojson&&i.tojson,h=!!(i.entry_uid||i.singleEntry||i.asset_uid),d=a(c(i,h,f));if(e&&e.requestParams&&e.requestParams.body&&e.requestParams.body.query){var p=JSON.parse(JSON.stringify(e.requestParams.body.query));"object"!==(void 0===p?"undefined":n(p))&&(p=JSON.parse(p)),delete e.requestParams.body.query,e.requestParams.body=u(e.requestParams.body,p)}var v=function(){return function(e,t){return new Promise((function(r,n){try{if(e)throw e;f||(t=l(t)),r(y(t))}catch(e){n(e)}}))}},_=function(r,n,u){r&&(0,o.default)(e.requestParams,t).then(function(t){try{i.entry_uid=i.asset_uid=i.tojson=i.queryCachePolicy=void 0;var r={},o={};if(e.singleEntry)if(e.singleEntry=!1,t.schema&&(r.schema=t.schema),t.content_type&&(r.content_type=t.content_type,delete r.schema),t.entries&&t.entries.length)r.entry=t.entries[0];else{if(!t.assets||!t.assets.length)return 2!==s||null===i.provider?u({error_code:141,error_message:"The requested entry doesn't exist."}):void i.provider.get(d,v());r.assets=t.assets[0]}else t.items?o={items:t.items,pagination_token:t.pagination_token,sync_token:t.sync_token,total_count:t.total_count}:r=t;return-1!==s&&null!==i.provider?(i.provider.set(d,r,(function(e){try{if(e)throw e;return f||(r=l(r)),n(y(r))}catch(e){return u(e)}})),n(y(r))):Object.keys(o).length?n(o):(f||(r=l(r)),n(y(r)))}catch(e){return u({message:e.message})}}.bind(i)).catch((function(e){if(2!==s||null===i.provider)return u(e);i.provider.get(d,v())}))};switch(s){case 1:return new Promise((function(e,t){null!==i.provider?i.provider.get(d,(function(r,n){try{if(!r&&n)return f||(n=l(n)),e(y(n));_(!0,e,t)}catch(e){return t(e)}})):_(!0,e,t)}));case 2:case 0:case void 0:case-1:return new Promise((function(e,t){_(!0,e,t)}))}if(3===s){return new Promise((function(e,t){null!==i.provider&&i.provider.get(d,(function(r,n){try{r||!n?t(r):(f||(n=l(n)),e(y(n)))}catch(e){t(e)}}))})).then((function(){return new Promise((function(e,t){_(!0,e,t)}))})).catch((function(e){return new Promise((function(e,t){_(!0,e,t)}))}))}};var o=s(r(2)),i=s(r(14));function s(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(e&&t)for(var r in t)e[r]=t[r];return e}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 a(e){try{var t=f(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 f(e){var t,r=0,n=void 0;if(0===e.length)return r;for(n=0,t=e.length;n<t;n++)r=(r<<5)-r+e.charCodeAt(n),r|=0;return r<-1?-1*r:r}function l(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,i.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,i.default)(e.assets[n]);else e.assets=[];else e&&void 0!==e.entry?e.entry=(0,i.default)(e.entry):e&&void 0!==e.asset?e.asset=(0,i.default)(e.asset):e&&void 0!==e.items&&(e.items=(0,i.default)(e.items).toJSON());return e}function y(e){var t=[];return e&&Object.keys(e).length&&(void 0!==e.entries&&(t.push(e.entries),e.content_type&&(t.schema=e.content_type)),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,e.schema&&(t.schema=e.schema),e.content_type&&(t.content_type=e.content_type)),void 0!==e.asset&&(t=e.asset),void 0!==e.items&&t.push(e)),t}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(this,r(3))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="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},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=h(r(9)),s=y(r(0)),u=h(r(4)),c=h(r(15)),a=h(r(5)),f=h(r(2)),l=(y(r(6)),h(r(7)));function y(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 h(e){return e&&e.__esModule?e:{default:e}}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var p=[408,429],v=function(){function e(){d(this,e),this.fetchOptions={retryLimit:5,retryCondition:function(e){return!!p.includes(e.status)}},this.config=Object.assign({},i.default);for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];switch(r[0].region&&void 0!==r[0].region&&"us"!==r[0].region&&(this.config.host=r[0].region+"-cdn.contentstack.com"),r[0].fetchOptions&&void 0!==r[0].fetchOptions&&(this.fetchOptions=Object.assign(this.fetchOptions,r[0].fetchOptions)),this.cachePolicy=l.default.policies.IGNORE_CACHE,this.provider=l.default.providers("localstorage"),r.length){case 1:if("object"===n(r[0])&&"string"==typeof r[0].api_key&&"string"==typeof r[0].delivery_token&&"string"==typeof r[0].environment)return this.headers={api_key:r[0].api_key,access_token:r[0].delivery_token},this.environment=r[0].environment,this;console.error("Kindly provide valid object parameters. The specified API Key, Delivery Token, or Environment Name is invalid.");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.");case 4:return"string"==typeof r[0]&&"string"==typeof r[1]&&"string"==typeof r[2]?(this.headers={api_key:r[0],access_token:r[1]},this.environment=r[2]):console.error("Kindly provide valid string parameters."),r[3]&&("string"==typeof r[3]&&void 0!==r[3]&&"us"!==r[3]?this.config.host=r[3]+"-cdn.contentstack.com":"object"===n(r[3])&&(this.fetchOptions=Object.assign(this.fetchOptions,r[3]))),this;case 5:return"string"==typeof r[0]&&"string"==typeof r[1]&&"string"==typeof r[2]?(this.headers={api_key:r[0],access_token:r[1]},this.environment=r[2]):console.error("Kindly provide valid string parameters."),r[3]&&("string"==typeof r[3]&&void 0!==r[3]&&"us"!==r[3]?this.config.host=r[3]+"-cdn.contentstack.com":"object"===n(r[3])&&(this.fetchOptions=Object.assign(this.fetchOptions,r[3]))),r[4]&&"object"===n(r[4])&&(this.fetchOptions=Object.assign(this.fetchOptions,r[4])),this;default:console.error("Kindly provide valid parameters to initialize the Contentstack javascript-SDK Stack.")}}return o(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":n(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 u.default;return e&&"string"==typeof e&&(t.entry_uid=e),s.merge(t,this)}},{key:"fetch",value:function(e){var t={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}},r=Object.assign({},this.fetchOptions,e);return(0,f.default)(t,r)}},{key:"Assets",value:function(e){if(this.type="asset",e&&"string"==typeof e){var t=new c.default;return t.asset_uid=e,s.merge(t,this)}return this}},{key:"Query",value:function(){var e=new a.default;return s.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,f.default)(e,this.fetchOptions)}},{key:"getContentTypes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={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}};if(e&&void 0!==e)for(var r in e)t.body[r]=e[r];return(0,f.default)(t,this.fetchOptions)}},{key:"sync",value:function(e,t){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}};var r=Object.assign({},this.fetchOptions,t);return s.sendRequest(this,r)}},{key:"imageTransform",value:function(e,t){if(e&&"string"==typeof e&&"object"===(void 0===t?"undefined":n(t))&&void 0===t.length){var r=[];for(var o in t)r.push(o+"="+t[o]);e+=e.indexOf("?")<=-1?"?"+r.join("&"):"&"+r.join("&")}return e}}]),e}();t.default=v},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="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=function(e,t){return new Promise((function(r,o){var i=void 0,c=e.url,a=e.headers;return a["Content-Type"]="application/json; charset=UTF-8",a["X-User-Agent"]="contentstack-web/3.12.1",e.body&&"object"===n(e.body)&&(delete e.body._method,"object"===n(e.body.query)&&0===Object.keys(e.body.query).length&&delete e.body.query,i=function e(t,r){var o=[],i=void 0;if("object"===(void 0===t?"undefined":n(t))&&void 0!==t.length)for(var s=0,u=t.length;s<u;s++)o.push(r+"[]="+t[s]);else for(i in t){var c=r?r+"["+i+"]":i,a=t[i];o.push(null!==a&&"object"===(void 0===a?"undefined":n(a))&&"query"!==i?e(a,c):c+"="+encodeURIComponent("query"!==i?a:JSON.stringify(a)))}return o.join("&")}(e.body)),function e(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5,i=arguments[4],c=arguments[5],a=arguments[6],f=Object.assign({method:"GET",headers:r,timeout:3e3},i);function l(s){if(0===o)a(s);else{var f=n;o-=1;var l=i.retryLimit-o;i.retryDelayOptions&&(i.retryDelayOptions.base?f=i.retryDelayOptions.base*l:i.retryDelayOptions.customBackoff&&(f=i.retryDelayOptions.customBackoff(l,s))),u(f).then((function(){return e(t,r,n,o,i,c,a)}))}}(0,s.default)(t,f).then((function(e){var t=e.json();e.ok&&200===e.status?c(t):t.then((function(t){i.retryCondition&&i.retryCondition(e)?l(t):a(t)})).catch((function(){a({status:e.status,statusText:e.statusText})}))})).catch((function(e){a(e)}))}(c+"?"+i,a,t.retryDelay,t.retryLimit,t,r,o)}))};!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}(r(0));var o,i=r(10),s=(o=i)&&o.__esModule?o:{default:o};function u(e){return new Promise((function(t){setTimeout(t,e)}))}},function(e,t,r){"use strict";var n,o,i=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function c(e){if(n===setTimeout)return setTimeout(e,0);if((n===s||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:s}catch(e){n=s}try{o="function"==typeof clearTimeout?clearTimeout:u}catch(e){o=u}}();var a,f=[],l=!1,y=-1;function h(){l&&a&&(l=!1,a.length?f=a.concat(f):y=-1,f.length&&d())}function d(){if(!l){var e=c(h);l=!0;for(var t=f.length;t;){for(a=f,f=[];++y<t;)a&&a[y].run();y=-1,t=f.length}a=null,l=!1,function(e){if(o===clearTimeout)return clearTimeout(e);if((o===u||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(e);try{o(e)}catch(t){try{return o.call(null,e)}catch(t){return o.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function v(){}i.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];f.push(new p(e,t)),1!==f.length||l||c(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});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},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=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}(r(0)),u=r(1);(n=u)&&n.__esModule;var c=function(){function e(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._query={},this.only=s.transform("only"),this.except=s.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:"includeFallback",value:function(){return this._query.include_fallback=!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(e){if(this.entry_uid){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}};var t=Object.assign({},this.fetchOptions,e);return s.sendRequest(this,t)}console.error("Kindly provide an entry uid. e.g. .Entry('bltsomething123')")}}]),e}();t.default=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=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}}(),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=(u(r(2)),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}(r(0))),s=u(r(4));function u(e){return e&&e.__esModule?e:{default:e}}var c=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.")}},a=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.")}},f=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.")}},l=function(e){return function(){for(var t=[],r=0,n=arguments.length;r<n;r++)arguments[r]instanceof d&&arguments[r]._query.query?t.push(arguments[r]._query.query):"object"===o(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}},y=function(e){return function(t){if(t&&"string"==typeof t)return this._query[e]=t,this;console.error("Argument should be a string.")}},h=function(e){return function(t){if("number"==typeof t)return this._query[e]=t,this;console.error("Argument should be a number.")}},d=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e._query=e._query||{},e._query.query=e._query.query||{},e.lessThan=c("$lt"),e.lessThanOrEqualTo=c("$lte"),e.greaterThan=c("$gt"),e.greaterThanOrEqualTo=c("$gte"),e.notEqualTo=c("$ne"),e.containedIn=a(!0),e.notContainedIn=a(!1),e.exists=f(!0),e.notExists=f(!1),e.ascending=y("asc"),e.descending=y("desc"),e.beforeUid=y("before_uid"),e.afterUid=y("after_uid"),e.skip=h("skip"),e.limit=h("limit"),e.or=l("$or"),e.and=l("$and"),e}return function(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)}(t,e),n(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":o(e)))return this._query.query=i.mergeDeep(this._query.query,e),this;console.error("Kindly provide valid parameters")}},{key:"referenceIn",value:function(e,r){var n={};return r instanceof t&&r._query.query?n.$in_query=r._query.query:"object"===(void 0===r?"undefined":o(r))&&(n.$in_query=r),this._query.query[e]?this._query.query[e]=this._query.query[e].concat(n):this._query.query[e]=n,this}},{key:"referenceNotIn",value:function(e,r){var n={};return r instanceof t&&r._query.query?n.$nin_query=r._query.query:"object"===(void 0===r?"undefined":o(r))&&(n.$nin_query=r),this._query.query[e]?this._query.query[e]=this._query.query[e].concat(n):this._query.query[e]=n,this}},{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(e){var t=this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version,r=this.type&&"asset"===this.type?t+this.config.urls.assets:t+this.config.urls.content_types+this.content_type_uid+this.config.urls.entries;this.requestParams={method:"POST",headers:this.headers,url:r,body:{_method:"GET",query:this._query}};var n=Object.assign({},this.fetchOptions,e);return i.sendRequest(this,n)}},{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;this.singleEntry=!0,this._query.limit=1,this.requestParams={method:"POST",headers:this.headers,url:t,body:{_method:"GET",query:this._query}};var r=Object.assign({},this.fetchOptions);return i.sendRequest(this,r)}}]),t}(s.default);t.default=d},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="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=function(e){var t=s.default.getItem(e);try{t=JSON.parse(t)}catch(e){return t}return t||null},t.set=function(e,t){try{"object"===(void 0===t?"undefined":n(t))?s.default.setItem(e,JSON.stringify(t)):s.default.setItem(e,t)}catch(e){}},t.getStorage=function(){return s.default||null},t.getKeys=function(){return s.default?Object.keys(s.default):[]};!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}(r(0));var o,i=r(16),s=(o=i)&&o.__esModule?o:{default:o}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,o=r(17),i=(n=o)&&n.__esModule?n:{default:n};var s={providers:function(e){if(e)return i.default;console.error("Kindly provide valid provider.")},policies:{IGNORE_CACHE:-1,ONLY_NETWORK:0,CACHE_ELSE_NETWORK:1,NETWORK_ELSE_CACHE:2,CACHE_THEN_NETWORK:3}};t.default=s},function(e,t,r){"use strict";var n=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}}(),o=u(r(1)),i=u(r(7)),s=u(r(18));function u(e){return e&&e.__esModule?e:{default:e}}var c=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.CachePolicy=i.default.policies,this.Region=s.default}return n(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(o.default,[null].concat(t)))}}]),e}();e.exports=new c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={protocol:"https",host:"cdn.contentstack.io",port:443,version:"v3",urls:{sync:"/stacks/sync",content_types:"/content_types/",entries:"/entries/",assets:"/assets/",environments:"/environments/"}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(r(11)),o=i(r(13));function i(e){return e&&e.__esModule?e:{default:e}}n.default.polyfill(),t.default=o.default},function(e,t,r){"use strict";(function(n,o){var i,s,u,c="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()}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=8)}([function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n="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=function(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")}}},t._type=function(e){var t=void 0===e?"undefined":n(e);switch(t){case"object":t,Array.isArray(e)&&(t="array");break;default:t}return t},t.mergeDeep=function(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},t.merge=u,t.isBrowser=function(){return"undefined"!=typeof window&&"object"===(void 0===e?"undefined":n(e))&&"browser"===e.title},t.parseQueryFromParams=c,t.getHash=a,t.generateHash=f,t.resultWrapper=l,t.spreadResult=y,t.sendRequest=function(e,t){var r=e.environment_uid;r?e._query.environment_uid=r:(e._query||(e._query={}),e._query.environment=e.environment);var i=e,s=void 0!==i.queryCachePolicy?i.queryCachePolicy:i.cachePolicy,f=void 0!==i.tojson&&i.tojson,h=!!(i.entry_uid||i.singleEntry||i.asset_uid),d=a(c(i,h,f));if(e&&e.requestParams&&e.requestParams.body&&e.requestParams.body.query){var p=JSON.parse(JSON.stringify(e.requestParams.body.query));"object"!==(void 0===p?"undefined":n(p))&&(p=JSON.parse(p)),delete e.requestParams.body.query,e.requestParams.body=u(e.requestParams.body,p)}var v=function(){return function(e,t){return new Promise((function(r,n){try{if(e)throw e;f||(t=l(t)),r(y(t))}catch(e){n(e)}}))}},_=function(r,n,u){r&&(0,o.default)(e.requestParams,t).then(function(t){try{i.entry_uid=i.asset_uid=i.tojson=i.queryCachePolicy=void 0;var r={},o={};if(e.singleEntry)if(e.singleEntry=!1,t.schema&&(r.schema=t.schema),t.content_type&&(r.content_type=t.content_type,delete r.schema),t.entries&&t.entries.length)r.entry=t.entries[0];else{if(!t.assets||!t.assets.length)return 2!==s||null===i.provider?u({error_code:141,error_message:"The requested entry doesn't exist."}):void i.provider.get(d,v());r.assets=t.assets[0]}else t.items?o={items:t.items,pagination_token:t.pagination_token,sync_token:t.sync_token,total_count:t.total_count}:r=t;return-1!==s&&null!==i.provider?(i.provider.set(d,r,(function(e){try{if(e)throw e;return f||(r=l(r)),n(y(r))}catch(e){return u(e)}})),n(y(r))):Object.keys(o).length?n(o):(f||(r=l(r)),n(y(r)))}catch(e){return u({message:e.message})}}.bind(i)).catch((function(e){if(2!==s||null===i.provider)return u(e);i.provider.get(d,v())}))};switch(s){case 1:return new Promise((function(e,t){null!==i.provider?i.provider.get(d,(function(r,n){try{if(!r&&n)return f||(n=l(n)),e(y(n));_(!0,e,t)}catch(e){return t(e)}})):_(!0,e,t)}));case 2:case 0:case void 0:case-1:return new Promise((function(e,t){_(!0,e,t)}))}if(3===s){return new Promise((function(e,t){null!==i.provider&&i.provider.get(d,(function(r,n){try{r||!n?t(r):(f||(n=l(n)),e(y(n)))}catch(e){t(e)}}))})).then((function(){return new Promise((function(e,t){_(!0,e,t)}))})).catch((function(e){return new Promise((function(e,t){_(!0,e,t)}))}))}};var o=s(r(2)),i=s(r(14));function s(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(e&&t)for(var r in t)e[r]=t[r];return e}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 a(e){try{var t=f(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 f(e){var t,r=0,n=void 0;if(0===e.length)return r;for(n=0,t=e.length;n<t;n++)r=(r<<5)-r+e.charCodeAt(n),r|=0;return r<-1?-1*r:r}function l(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,i.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,i.default)(e.assets[n]);else e.assets=[];else e&&void 0!==e.entry?e.entry=(0,i.default)(e.entry):e&&void 0!==e.asset?e.asset=(0,i.default)(e.asset):e&&void 0!==e.items&&(e.items=(0,i.default)(e.items).toJSON());return e}function y(e){var t=[];return e&&Object.keys(e).length&&(void 0!==e.entries&&(t.push(e.entries),e.content_type&&(t.schema=e.content_type)),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,e.schema&&(t.schema=e.schema),e.content_type&&(t.content_type=e.content_type)),void 0!==e.asset&&(t=e.asset),void 0!==e.items&&t.push(e)),t}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(this,r(3))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="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},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=h(r(9)),s=y(r(0)),u=h(r(4)),c=h(r(15)),a=h(r(5)),f=h(r(2)),l=(y(r(6)),h(r(7)));function y(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 h(e){return e&&e.__esModule?e:{default:e}}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var p=[408,429],v=function(){function e(){d(this,e),this.fetchOptions={retryLimit:5,retryCondition:function(e){return!!p.includes(e.status)}},this.config=Object.assign({},i.default);for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];switch(r[0].region&&void 0!==r[0].region&&"us"!==r[0].region&&(this.config.host=r[0].region+"-cdn.contentstack.com"),r[0].fetchOptions&&void 0!==r[0].fetchOptions&&(this.fetchOptions=Object.assign(this.fetchOptions,r[0].fetchOptions)),this.cachePolicy=l.default.policies.IGNORE_CACHE,this.provider=l.default.providers("localstorage"),r.length){case 1:if("object"===n(r[0])&&"string"==typeof r[0].api_key&&"string"==typeof r[0].delivery_token&&"string"==typeof r[0].environment)return this.headers={api_key:r[0].api_key,access_token:r[0].delivery_token},this.environment=r[0].environment,this;console.error("Kindly provide valid object parameters. The specified API Key, Delivery Token, or Environment Name is invalid.");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.");case 4:return"string"==typeof r[0]&&"string"==typeof r[1]&&"string"==typeof r[2]?(this.headers={api_key:r[0],access_token:r[1]},this.environment=r[2]):console.error("Kindly provide valid string parameters."),r[3]&&("string"==typeof r[3]&&void 0!==r[3]&&"us"!==r[3]?this.config.host=r[3]+"-cdn.contentstack.com":"object"===n(r[3])&&(this.fetchOptions=Object.assign(this.fetchOptions,r[3]))),this;case 5:return"string"==typeof r[0]&&"string"==typeof r[1]&&"string"==typeof r[2]?(this.headers={api_key:r[0],access_token:r[1]},this.environment=r[2]):console.error("Kindly provide valid string parameters."),r[3]&&("string"==typeof r[3]&&void 0!==r[3]&&"us"!==r[3]?this.config.host=r[3]+"-cdn.contentstack.com":"object"===n(r[3])&&(this.fetchOptions=Object.assign(this.fetchOptions,r[3]))),r[4]&&"object"===n(r[4])&&(this.fetchOptions=Object.assign(this.fetchOptions,r[4])),this;default:console.error("Kindly provide valid parameters to initialize the Contentstack javascript-SDK Stack.")}}return o(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":n(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 u.default;return e&&"string"==typeof e&&(t.entry_uid=e),s.merge(t,this)}},{key:"fetch",value:function(e){var t={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}},r=Object.assign({},this.fetchOptions,e);return(0,f.default)(t,r)}},{key:"Assets",value:function(e){if(this.type="asset",e&&"string"==typeof e){var t=new c.default;return t.asset_uid=e,s.merge(t,this)}return this}},{key:"Query",value:function(){var e=new a.default;return s.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,f.default)(e,this.fetchOptions)}},{key:"getContentTypes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={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}};if(e&&void 0!==e)for(var r in e)t.body[r]=e[r];return(0,f.default)(t,this.fetchOptions)}},{key:"sync",value:function(e,t){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}};var r=Object.assign({},this.fetchOptions,t);return s.sendRequest(this,r)}},{key:"imageTransform",value:function(e,t){if(e&&"string"==typeof e&&"object"===(void 0===t?"undefined":n(t))&&void 0===t.length){var r=[];for(var o in t)r.push(o+"="+t[o]);e+=e.indexOf("?")<=-1?"?"+r.join("&"):"&"+r.join("&")}return e}}]),e}();t.default=v},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="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=function(e,t){return new Promise((function(r,o){var i=void 0,c=e.url,a=e.headers;return a["Content-Type"]="application/json; charset=UTF-8",a["X-User-Agent"]="contentstack-web/3.12.2",e.body&&"object"===n(e.body)&&(delete e.body._method,"object"===n(e.body.query)&&0===Object.keys(e.body.query).length&&delete e.body.query,i=function e(t,r){var o=[],i=void 0;if("object"===(void 0===t?"undefined":n(t))&&void 0!==t.length)for(var s=0,u=t.length;s<u;s++)o.push(r+"[]="+t[s]);else for(i in t){var c=r?r+"["+i+"]":i,a=t[i];o.push(null!==a&&"object"===(void 0===a?"undefined":n(a))&&"query"!==i?e(a,c):c+"="+encodeURIComponent("query"!==i?a:JSON.stringify(a)))}return o.join("&")}(e.body)),function e(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5,i=arguments[4],c=arguments[5],a=arguments[6],f=Object.assign({method:"GET",headers:r,timeout:3e4},i);function l(s){if(0===o)a(s);else{var f=n;o-=1;var l=i.retryLimit-o;i.retryDelayOptions&&(i.retryDelayOptions.base?f=i.retryDelayOptions.base*l:i.retryDelayOptions.customBackoff&&(f=i.retryDelayOptions.customBackoff(l,s))),u(f).then((function(){return e(t,r,n,o,i,c,a)}))}}(0,s.default)(t,f).then((function(e){var t=e.json();e.ok&&200===e.status?c(t):t.then((function(t){i.retryCondition&&i.retryCondition(e)?l(t):a(t)})).catch((function(){a({status:e.status,statusText:e.statusText})}))})).catch((function(e){a(e)}))}(c+"?"+i,a,t.retryDelay,t.retryLimit,t,r,o)}))};!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}(r(0));var o,i=r(10),s=(o=i)&&o.__esModule?o:{default:o};function u(e){return new Promise((function(t){setTimeout(t,e)}))}},function(e,t,r){"use strict";var n,o,i=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function c(e){if(n===setTimeout)return setTimeout(e,0);if((n===s||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:s}catch(e){n=s}try{o="function"==typeof clearTimeout?clearTimeout:u}catch(e){o=u}}();var a,f=[],l=!1,y=-1;function h(){l&&a&&(l=!1,a.length?f=a.concat(f):y=-1,f.length&&d())}function d(){if(!l){var e=c(h);l=!0;for(var t=f.length;t;){for(a=f,f=[];++y<t;)a&&a[y].run();y=-1,t=f.length}a=null,l=!1,function(e){if(o===clearTimeout)return clearTimeout(e);if((o===u||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(e);try{o(e)}catch(t){try{return o.call(null,e)}catch(t){return o.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function v(){}i.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];f.push(new p(e,t)),1!==f.length||l||c(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});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},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=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}(r(0)),u=r(1);(n=u)&&n.__esModule;var c=function(){function e(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._query={},this.only=s.transform("only"),this.except=s.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:"includeFallback",value:function(){return this._query.include_fallback=!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(e){if(this.entry_uid){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}};var t=Object.assign({},this.fetchOptions,e);return s.sendRequest(this,t)}console.error("Kindly provide an entry uid. e.g. .Entry('bltsomething123')")}}]),e}();t.default=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=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}}(),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=(u(r(2)),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}(r(0))),s=u(r(4));function u(e){return e&&e.__esModule?e:{default:e}}var c=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.")}},a=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.")}},f=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.")}},l=function(e){return function(){for(var t=[],r=0,n=arguments.length;r<n;r++)arguments[r]instanceof d&&arguments[r]._query.query?t.push(arguments[r]._query.query):"object"===o(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}},y=function(e){return function(t){if(t&&"string"==typeof t)return this._query[e]=t,this;console.error("Argument should be a string.")}},h=function(e){return function(t){if("number"==typeof t)return this._query[e]=t,this;console.error("Argument should be a number.")}},d=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e._query=e._query||{},e._query.query=e._query.query||{},e.lessThan=c("$lt"),e.lessThanOrEqualTo=c("$lte"),e.greaterThan=c("$gt"),e.greaterThanOrEqualTo=c("$gte"),e.notEqualTo=c("$ne"),e.containedIn=a(!0),e.notContainedIn=a(!1),e.exists=f(!0),e.notExists=f(!1),e.ascending=y("asc"),e.descending=y("desc"),e.beforeUid=y("before_uid"),e.afterUid=y("after_uid"),e.skip=h("skip"),e.limit=h("limit"),e.or=l("$or"),e.and=l("$and"),e}return function(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)}(t,e),n(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":o(e)))return this._query.query=i.mergeDeep(this._query.query,e),this;console.error("Kindly provide valid parameters")}},{key:"referenceIn",value:function(e,r){var n={};return r instanceof t&&r._query.query?n.$in_query=r._query.query:"object"===(void 0===r?"undefined":o(r))&&(n.$in_query=r),this._query.query[e]?this._query.query[e]=this._query.query[e].concat(n):this._query.query[e]=n,this}},{key:"referenceNotIn",value:function(e,r){var n={};return r instanceof t&&r._query.query?n.$nin_query=r._query.query:"object"===(void 0===r?"undefined":o(r))&&(n.$nin_query=r),this._query.query[e]?this._query.query[e]=this._query.query[e].concat(n):this._query.query[e]=n,this}},{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(e){var t=this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version,r=this.type&&"asset"===this.type?t+this.config.urls.assets:t+this.config.urls.content_types+this.content_type_uid+this.config.urls.entries;this.requestParams={method:"POST",headers:this.headers,url:r,body:{_method:"GET",query:this._query}};var n=Object.assign({},this.fetchOptions,e);return i.sendRequest(this,n)}},{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;this.singleEntry=!0,this._query.limit=1,this.requestParams={method:"POST",headers:this.headers,url:t,body:{_method:"GET",query:this._query}};var r=Object.assign({},this.fetchOptions);return i.sendRequest(this,r)}}]),t}(s.default);t.default=d},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="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=function(e){var t=s.default.getItem(e);try{t=JSON.parse(t)}catch(e){return t}return t||null},t.set=function(e,t){try{"object"===(void 0===t?"undefined":n(t))?s.default.setItem(e,JSON.stringify(t)):s.default.setItem(e,t)}catch(e){}},t.getStorage=function(){return s.default||null},t.getKeys=function(){return s.default?Object.keys(s.default):[]};!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}(r(0));var o,i=r(16),s=(o=i)&&o.__esModule?o:{default:o}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,o=r(17),i=(n=o)&&n.__esModule?n:{default:n};var s={providers:function(e){if(e)return i.default;console.error("Kindly provide valid provider.")},policies:{IGNORE_CACHE:-1,ONLY_NETWORK:0,CACHE_ELSE_NETWORK:1,NETWORK_ELSE_CACHE:2,CACHE_THEN_NETWORK:3}};t.default=s},function(e,t,r){"use strict";var n=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}}(),o=u(r(1)),i=u(r(7)),s=u(r(18));function u(e){return e&&e.__esModule?e:{default:e}}var c=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.CachePolicy=i.default.policies,this.Region=s.default}return n(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(o.default,[null].concat(t)))}}]),e}();e.exports=new c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={protocol:"https",host:"cdn.contentstack.io",port:443,version:"v3",urls:{sync:"/stacks/sync",content_types:"/content_types/",entries:"/entries/",assets:"/assets/",environments:"/environments/"}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(r(11)),o=i(r(13));function i(e){return e&&e.__esModule?e:{default:e}}n.default.polyfill(),t.default=o.default},function(e,t,r){"use strict";(function(n,o){var i,s,u,c="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}; | ||
/*! | ||
@@ -3,0 +3,0 @@ * @overview es6-promise - a tiny implementation of Promises/A+. |
@@ -1,2 +0,2 @@ | ||
// Type definitions for contentstack 3.12.0 | ||
// Type definitions for contentstack 3.12.2 | ||
// Project: https://www.contentstack.com/ | ||
@@ -169,5 +169,5 @@ // Definitions by: Contentstack <https://github.com/contentstack> | ||
where(key: string, value: (string | number)): Query; | ||
equalTo(key: string, value: (string | number)): Query; | ||
notEqualTo(key: string, value: (string | number)): Query; | ||
where(key: string, value: (string | number | boolean)): Query; | ||
equalTo(key: string, value: (string | number | boolean)): Query; | ||
notEqualTo(key: string, value: (string | number | boolean)): Query; | ||
@@ -174,0 +174,0 @@ lessThan(key: string, value: (string | number)): Query; |
{ | ||
"name": "contentstack", | ||
"version": "3.12.1", | ||
"version": "3.12.2", | ||
"description": "Contentstack Javascript SDK", | ||
@@ -13,6 +13,6 @@ "homepage": "https://www.contentstack.com/", | ||
"types": "./index.d.ts", | ||
"_id": "contentstack@3.12.0", | ||
"_id": "contentstack@3.12.2", | ||
"scripts": { | ||
"test": "npm run test:e2e && npm run test:typescript", | ||
"test:e2e": "tape test/index.js | tap-html --out ./tap-html.html", | ||
"test:e2e": "istanbul cover tape test/index.js | tap-html --out ./tap-html.html", | ||
"test:typescript": "jest --testPathPattern=test/typescript", | ||
@@ -55,10 +55,10 @@ "automate": "node test.js", | ||
"shasum": "a328ed07240476a26b31a23261355dc929e1da63", | ||
"tarball": "https://registry.npmjs.org/contentstack/-/contentstack-3.12.0.tgz" | ||
"tarball": "https://registry.npmjs.org/contentstack/-/contentstack-3.12.2.tgz" | ||
}, | ||
"license": "MIT", | ||
"directories": {}, | ||
"_resolved": "https://registry.npmjs.org/contentstack/-/contentstack-3.12.0.tgz", | ||
"_resolved": "https://registry.npmjs.org/contentstack/-/contentstack-3.12.2.tgz", | ||
"_npmOperationalInternal": { | ||
"host": "packages-18-east.internal.npmjs.com", | ||
"tmp": "tmp/contentstack-3.12.0.tgz_1477830884275_0.9869455888401717" | ||
"tmp": "tmp/contentstack-3.12.2.tgz_1477830884275_0.9869455888401717" | ||
}, | ||
@@ -79,2 +79,3 @@ "devDependencies": { | ||
"http-proxy-agent": "^3.0.0", | ||
"istanbul": "^0.4.5", | ||
"jest": "^26.4.2", | ||
@@ -81,0 +82,0 @@ "jest-html-reporters": "^2.0.3", |
@@ -190,3 +190,3 @@ [![Contentstack](https://www.contentstack.com/docs/static/images/contentstack.png)](https://www.contentstack.com/) | ||
[JavaScript API Reference Doc](https://contentstack.com/docs/platforms/javascript-browser/api-reference/) | ||
[JavaScript API Reference Doc](https://www.contentstack.com/docs/developers/javascript-browser/api-reference/) | ||
@@ -197,3 +197,3 @@ ### Working with Images | ||
For example, if you want to crop an image (with width as 300 and height as 400), you simply need to append query parameters at the end of the image URL, such as, https://images.contentstack.io/v3/assets/blteae40eb499811073/bltc5064f36b5855343/59e0c41ac0eddd140d5a8e3e/download?crop=300,400. There are several more parameters that you can use for your images. | ||
For example, if you want to crop an image (with width as 300 and height as 400), you simply need to append query parameters at the end of the image URL, such as, https://images.contentstack.io/v3/assets/blteae40eb499811073/bltc5064f36b5855343/59e0c41ac0eddd140d5a8e3e/owl.jpg?crop=300,400. There are several more parameters that you can use for your images. | ||
@@ -200,0 +200,0 @@ [Read Image Delivery API documentation](https://www.contentstack.com/docs/apis/image-delivery-api/). |
@@ -67,3 +67,3 @@ import * as Utils from "./utils.js"; | ||
headers: headers, | ||
timeout: 3000, | ||
timeout: 30000, | ||
}, | ||
@@ -70,0 +70,0 @@ fetchOptions); |
@@ -32,9 +32,9 @@ import * as Utils from "../lib/utils"; | ||
* Stack.ContentType('contentTypeUid').Query().only('title').toJSON().find() | ||
* | ||
* @example | ||
* <caption> The only function with an array of field_uids will include multiple fields for each entry and exclude the data of all other fields.</caption> | ||
* Stack.ContentType('contentTypeUid').Query().only(['title','description']).toJSON().find() | ||
* | ||
* @example | ||
* <caption> In only, we have the only with a reference parameter, where you need to enter the UID of the reference field in place of "reference_field_uid", and the second parameter to include the data of only the specified field_uid for each entry and exclude the data of all other fields.</caption> | ||
* Stack.ContentType('contentTypeUid').Query().includeReference('reference_field_uid').only('reference_field_uid','title').toJSON().find() | ||
* | ||
* @example | ||
* <caption> In only, we have the only with a reference parameter with an array, where you need to enter the UID of the reference field in place of "reference_field_uid", and the second parameter with an array of fields to include the data of only the specified array of field_uids for each entry and exclude the data of all other fields.</caption> | ||
@@ -41,0 +41,0 @@ * Stack.ContentType('contentTypeUid').Query().includeReference('reference_field_uid').only('reference_field_uid', ['title', 'description']).toJSON().find() |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1573930
36
32