contensis-delivery-api
Advanced tools
Comparing version 1.4.1 to 1.5.0
@@ -0,13 +1,18 @@ | ||
import { AssetSys } from './AssetSys'; | ||
import { Image } from './EntryFields'; | ||
import { EntrySys } from './EntrySys'; | ||
export interface Entry { | ||
sys: EntrySys; | ||
[key: string]: any; | ||
entryTitle?: string; | ||
interface BaseEntryFields { | ||
entryTitle: string; | ||
entryDescription?: string; | ||
entryThumbnail?: EntryThumbnail; | ||
entryThumbnail?: Image; | ||
} | ||
export interface EntryThumbnail { | ||
altText?: string; | ||
caption?: string; | ||
asset?: Entry; | ||
export interface Entry extends StrictEntry { | ||
[key: string]: any; | ||
} | ||
export interface EntryAsset extends BaseEntryFields { | ||
sys: AssetSys; | ||
} | ||
export interface StrictEntry extends BaseEntryFields { | ||
sys: EntrySys; | ||
} | ||
export {}; |
@@ -1,24 +0,9 @@ | ||
import { VersionInfo } from 'contensis-core-api'; | ||
import { Workflow } from './Workflow'; | ||
export interface EntrySys { | ||
import { BaseSys } from './BaseSys'; | ||
import { EntryMetadata } from './EntryMetadata'; | ||
export interface EntrySys extends BaseSys<'entry'> { | ||
allUris: string[]; | ||
availableLanguages?: string[]; | ||
contentTypeId: string; | ||
dataFormat: string; | ||
id: string; | ||
isPublished?: boolean; | ||
language: string; | ||
owner?: string; | ||
projectId?: string; | ||
properties?: { | ||
metadata: EntryMetadata; | ||
properties: { | ||
[key: string]: any; | ||
width?: number; | ||
height?: number; | ||
fileSize?: number; | ||
}; | ||
slug?: string; | ||
uri: string; | ||
version?: VersionInfo; | ||
versionStatus: 'published' | 'latest'; | ||
workflow?: Workflow; | ||
} |
@@ -0,1 +1,3 @@ | ||
export * from './AssetSys'; | ||
export * from './BaseSys'; | ||
export * from './ClientConfigFactory'; | ||
@@ -7,4 +9,7 @@ export * from './ClientStatic'; | ||
export * from './Entry'; | ||
export * from './EntryFields'; | ||
export * from './EntryGetOptions'; | ||
export * from './EntryListOptions'; | ||
export * from './EntryMetadata'; | ||
export * from './EntryMetadataClassic'; | ||
export * from './EntrySys'; | ||
@@ -11,0 +16,0 @@ export * from './IContentTypeOperations'; |
import { VersionInfo } from 'contensis-core-api'; | ||
import { Entry } from './Entry'; | ||
import { Entry as LooseEntry, StrictEntry } from './Entry'; | ||
export declare type NodeVersionInfo = Pick<VersionInfo, 'versionNo'>; | ||
export interface Node { | ||
export interface Node<TEntry extends StrictEntry = LooseEntry> { | ||
id: string; | ||
@@ -14,8 +14,6 @@ parentId?: string; | ||
children?: Node[]; | ||
entry?: Entry; | ||
entry?: TEntry; | ||
isCanonical: boolean; | ||
version: NodeVersionInfo; | ||
includeInMenu: boolean; | ||
title: string; | ||
entryId?: string; | ||
} |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.WHATWGFetch={})}(this,function(a){"use strict";var e="URLSearchParams"in self,r="Symbol"in self&&"iterator"in Symbol,h="FileReader"in self&&"Blob"in self&&function(){try{return new Blob,!0}catch(t){return!1}}(),o="FormData"in self,n="ArrayBuffer"in self;if(n)var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],s=ArrayBuffer.isView||function(t){return t&&-1<i.indexOf(Object.prototype.toString.call(t))};function u(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function f(t){return"string"!=typeof t&&(t=String(t)),t}function t(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r&&(t[Symbol.iterator]=function(){return t}),t}function d(e){this.map={},e instanceof d?e.forEach(function(t,e){this.append(e,t)},this):Array.isArray(e)?e.forEach(function(t){this.append(t[0],t[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function c(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function p(r){return new Promise(function(t,e){r.onload=function(){t(r.result)},r.onerror=function(){e(r.error)}})}function y(t){var e=new FileReader,r=p(e);return e.readAsArrayBuffer(t),r}function l(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function b(){return this.bodyUsed=!1,this._initBody=function(t){(this._bodyInit=t)?"string"==typeof t?this._bodyText=t:h&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:o&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:e&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():n&&h&&function(t){return t&&DataView.prototype.isPrototypeOf(t)}(t)?(this._bodyArrayBuffer=l(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):n&&(ArrayBuffer.prototype.isPrototypeOf(t)||s(t))?this._bodyArrayBuffer=l(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):e&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},h&&(this.blob=function(){var t=c(this);if(t)return t;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?c(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(y)}),this.text=function(){var t=c(this);if(t)return t;if(this._bodyBlob)return function(t){var e=new FileReader,r=p(e);return e.readAsText(t),r}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),o=0;o<e.length;o++)r[o]=String.fromCharCode(e[o]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o&&(this.formData=function(){return this.text().then(v)}),this.json=function(){return this.text().then(JSON.parse)},this}d.prototype.append=function(t,e){t=u(t),e=f(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},d.prototype.delete=function(t){delete this.map[u(t)]},d.prototype.get=function(t){return t=u(t),this.has(t)?this.map[t]:null},d.prototype.has=function(t){return this.map.hasOwnProperty(u(t))},d.prototype.set=function(t,e){this.map[u(t)]=f(e)},d.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},d.prototype.keys=function(){var r=[];return this.forEach(function(t,e){r.push(e)}),t(r)},d.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),t(e)},d.prototype.entries=function(){var r=[];return this.forEach(function(t,e){r.push([e,t])}),t(r)},r&&(d.prototype[Symbol.iterator]=d.prototype.entries);var m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function w(t,e){var r=(e=e||{}).body;if(t instanceof w){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new d(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,r||null==t._bodyInit||(r=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new d(e.headers)),this.method=function(t){var e=t.toUpperCase();return-1<m.indexOf(e)?e:t}(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.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 v(t){var n=new FormData;return t.trim().split("&").forEach(function(t){if(t){var e=t.split("="),r=e.shift().replace(/\+/g," "),o=e.join("=").replace(/\+/g," ");n.append(decodeURIComponent(r),decodeURIComponent(o))}}),n}function E(t,e){e=e||{},this.type="default",this.status=void 0===e.status?200:e.status,this.ok=200<=this.status&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new d(e.headers),this.url=e.url||"",this._initBody(t)}w.prototype.clone=function(){return new w(this,{body:this._bodyInit})},b.call(w.prototype),b.call(E.prototype),E.prototype.clone=function(){return new E(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},E.error=function(){var t=new E(null,{status:0,statusText:""});return t.type="error",t};var A=[301,302,303,307,308];E.redirect=function(t,e){if(-1===A.indexOf(e))throw new RangeError("Invalid status code");return new E(null,{status:e,headers:{location:t}})},a.DOMException=self.DOMException;try{new a.DOMException}catch(t){a.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function _(i,s){return new Promise(function(r,t){var e=new w(i,s);if(e.signal&&e.signal.aborted)return t(new a.DOMException("Aborted","AbortError"));var o=new XMLHttpRequest;function n(){o.abort()}o.onload=function(){var t={status:o.status,statusText:o.statusText,headers:function(t){var n=new d;return t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(t){var e=t.split(":"),r=e.shift().trim();if(r){var o=e.join(":").trim();n.append(r,o)}}),n}(o.getAllResponseHeaders()||"")};t.url="responseURL"in o?o.responseURL:t.headers.get("X-Request-URL");var e="response"in o?o.response:o.responseText;r(new E(e,t))},o.onerror=function(){t(new TypeError("Network request failed"))},o.ontimeout=function(){t(new TypeError("Network request failed"))},o.onabort=function(){t(new a.DOMException("Aborted","AbortError"))},o.open(e.method,e.url,!0),"include"===e.credentials?o.withCredentials=!0:"omit"===e.credentials&&(o.withCredentials=!1),"responseType"in o&&h&&(o.responseType="blob"),e.headers.forEach(function(t,e){o.setRequestHeader(e,t)}),e.signal&&(e.signal.addEventListener("abort",n),o.onreadystatechange=function(){4===o.readyState&&e.signal.removeEventListener("abort",n)}),o.send(void 0===e._bodyInit?null:e._bodyInit)})}_.polyfill=!0,self.fetch||(self.fetch=_,self.Headers=d,self.Request=w,self.Response=E),a.Headers=d,a.Request=w,a.Response=E,a.fetch=_,Object.defineProperty(a,"__esModule",{value:!0})}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.WHATWGFetch={})}(this,function(u){"use strict";var h="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||"undefined"!=typeof global&&global||{},e="URLSearchParams"in h,r="Symbol"in h&&"iterator"in Symbol,f="FileReader"in h&&"Blob"in h&&function(){try{return new Blob,!0}catch(t){return!1}}(),o="FormData"in h,c="ArrayBuffer"in h;if(c)var n=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],i=ArrayBuffer.isView||function(t){return t&&-1<n.indexOf(Object.prototype.toString.call(t))};function d(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)throw new TypeError('Invalid character in header field name: "'+t+'"');return t.toLowerCase()}function y(t){return"string"!=typeof t&&(t=String(t)),t}function t(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r&&(t[Symbol.iterator]=function(){return t}),t}function l(e){this.map={},e instanceof l?e.forEach(function(t,e){this.append(e,t)},this):Array.isArray(e)?e.forEach(function(t){if(2!=t.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function s(t){if(!t._noBody)return t.bodyUsed?Promise.reject(new TypeError("Already read")):void(t.bodyUsed=!0)}function a(r){return new Promise(function(t,e){r.onload=function(){t(r.result)},r.onerror=function(){e(r.error)}})}function p(t){var e=new FileReader,r=a(e);return e.readAsArrayBuffer(t),r}function b(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(t){this.bodyUsed=this.bodyUsed,(this._bodyInit=t)?"string"==typeof t?this._bodyText=t:f&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:o&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:e&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():c&&f&&function(t){return t&&DataView.prototype.isPrototypeOf(t)}(t)?(this._bodyArrayBuffer=b(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):c&&(ArrayBuffer.prototype.isPrototypeOf(t)||i(t))?this._bodyArrayBuffer=b(t):this._bodyText=t=Object.prototype.toString.call(t):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):e&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},f&&(this.blob=function(){var t=s(this);if(t)return t;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(){if(this._bodyArrayBuffer){var t=s(this);return t||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}if(f)return this.blob().then(p);throw new Error("could not read as ArrayBuffer")},this.text=function(){var t=s(this);if(t)return t;if(this._bodyBlob)return function(t){var e=new FileReader,r=a(e),o=/charset=([A-Za-z0-9_-]+)/.exec(t.type),n=o?o[1]:"utf-8";return e.readAsText(t,n),r}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),o=0;o<e.length;o++)r[o]=String.fromCharCode(e[o]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o&&(this.formData=function(){return this.text().then(E)}),this.json=function(){return this.text().then(JSON.parse)},this}l.prototype.append=function(t,e){t=d(t),e=y(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},l.prototype.delete=function(t){delete this.map[d(t)]},l.prototype.get=function(t){return t=d(t),this.has(t)?this.map[t]:null},l.prototype.has=function(t){return this.map.hasOwnProperty(d(t))},l.prototype.set=function(t,e){this.map[d(t)]=y(e)},l.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},l.prototype.keys=function(){var r=[];return this.forEach(function(t,e){r.push(e)}),t(r)},l.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),t(e)},l.prototype.entries=function(){var r=[];return this.forEach(function(t,e){r.push([e,t])}),t(r)},r&&(l.prototype[Symbol.iterator]=l.prototype.entries);var w=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function v(t,e){if(!(this instanceof v))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var r=(e=e||{}).body;if(t instanceof v){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new l(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,r||null==t._bodyInit||(r=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new l(e.headers)),this.method=function(t){var e=t.toUpperCase();return-1<w.indexOf(e)?e:t}(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal||function(){if("AbortController"in h)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(r),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==e.cache&&"no-cache"!==e.cache)){var o=/([?&])_=[^&]*/;if(o.test(this.url))this.url=this.url.replace(o,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function E(t){var n=new FormData;return t.trim().split("&").forEach(function(t){if(t){var e=t.split("="),r=e.shift().replace(/\+/g," "),o=e.join("=").replace(/\+/g," ");n.append(decodeURIComponent(r),decodeURIComponent(o))}}),n}function A(t,e){if(!(this instanceof A))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(e=e||{},this.type="default",this.status=void 0===e.status?200:e.status,this.status<200||599<this.status)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=200<=this.status&&this.status<300,this.statusText=void 0===e.statusText?"":""+e.statusText,this.headers=new l(e.headers),this.url=e.url||"",this._initBody(t)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},m.call(v.prototype),m.call(A.prototype),A.prototype.clone=function(){return new A(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},A.error=function(){var t=new A(null,{status:200,statusText:""});return t.ok=!1,t.status=0,t.type="error",t};var g=[301,302,303,307,308];A.redirect=function(t,e){if(-1===g.indexOf(e))throw new RangeError("Invalid status code");return new A(null,{status:e,headers:{location:t}})},u.DOMException=h.DOMException;try{new u.DOMException}catch(t){u.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},u.DOMException.prototype=Object.create(Error.prototype),u.DOMException.prototype.constructor=u.DOMException}function T(s,a){return new Promise(function(r,t){var o=new v(s,a);if(o.signal&&o.signal.aborted)return t(new u.DOMException("Aborted","AbortError"));var n=new XMLHttpRequest;function e(){n.abort()}if(n.onload=function(){var t={statusText:n.statusText,headers:function(t){var n=new l;return t.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(t){return 0===t.indexOf("\n")?t.substr(1,t.length):t}).forEach(function(t){var e=t.split(":"),r=e.shift().trim();if(r){var o=e.join(":").trim();try{n.append(r,o)}catch(t){console.warn("Response "+t.message)}}}),n}(n.getAllResponseHeaders()||"")};0===o.url.indexOf("file://")&&(n.status<200||599<n.status)?t.status=200:t.status=n.status,t.url="responseURL"in n?n.responseURL:t.headers.get("X-Request-URL");var e="response"in n?n.response:n.responseText;setTimeout(function(){r(new A(e,t))},0)},n.onerror=function(){setTimeout(function(){t(new TypeError("Network request failed"))},0)},n.ontimeout=function(){setTimeout(function(){t(new TypeError("Network request timed out"))},0)},n.onabort=function(){setTimeout(function(){t(new u.DOMException("Aborted","AbortError"))},0)},n.open(o.method,function(e){try{return""===e&&h.location.href?h.location.href:e}catch(t){return e}}(o.url),!0),"include"===o.credentials?n.withCredentials=!0:"omit"===o.credentials&&(n.withCredentials=!1),"responseType"in n&&(f?n.responseType="blob":c&&(n.responseType="arraybuffer")),a&&"object"==typeof a.headers&&!(a.headers instanceof l||h.Headers&&a.headers instanceof h.Headers)){var i=[];Object.getOwnPropertyNames(a.headers).forEach(function(t){i.push(d(t)),n.setRequestHeader(t,y(a.headers[t]))}),o.headers.forEach(function(t,e){-1===i.indexOf(e)&&n.setRequestHeader(e,t)})}else o.headers.forEach(function(t,e){n.setRequestHeader(e,t)});o.signal&&(o.signal.addEventListener("abort",e),n.onreadystatechange=function(){4===n.readyState&&o.signal.removeEventListener("abort",e)}),n.send(void 0===o._bodyInit?null:o._bodyInit)})}T.polyfill=!0,h.fetch||(h.fetch=T,h.Headers=l,h.Request=v,h.Response=A),u.Headers=l,u.Request=v,u.Response=A,u.fetch=T,Object.defineProperty(u,"__esModule",{value:!0})}); |
var Zengenti=Zengenti||{};Zengenti.Contensis=function(e){function __webpack_require__(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,__webpack_require__),n.l=!0,n.exports}var t={};return __webpack_require__.m=e,__webpack_require__.c=t,__webpack_require__.d=function(e,t,r){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="/bundle/",__webpack_require__(__webpack_require__.s=8)}([function(e,t,r){"use strict";function __extends(e,t){function __(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}function __rest(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function __decorate(e,t,r,n){var i,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o}function __param(e,t){return function(r,n){t(r,n,e)}}function __metadata(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function __awaiter(e,t,r,n){return new(r||(r=Promise))(function(i,s){function fulfilled(e){try{step(n.next(e))}catch(e){s(e)}}function rejected(e){try{step(n.throw(e))}catch(e){s(e)}}function step(e){e.done?i(e.value):new r(function(t){t(e.value)}).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())})}function __generator(e,t){function verb(e){return function(t){return step([e,t])}}function step(s){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(i=o.trys,!(i=i.length>0&&i[i.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}var r,n,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s}function __exportStar(e,t){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}function __values(e){var t="function"==typeof Symbol&&e[Symbol.iterator],r=0;return t?t.call(e):{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}function __read(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return o}function __spread(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(__read(arguments[t]));return e}function __spreadArrays(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),i=0,t=0;t<r;t++)for(var s=arguments[t],o=0,a=s.length;o<a;o++,i++)n[i]=s[o];return n}function __await(e){return this instanceof __await?(this.v=e,this):new __await(e)}function __asyncGenerator(e,t,r){function verb(e){i[e]&&(n[e]=function(t){return new Promise(function(r,n){s.push([e,t,r,n])>1||resume(e,t)})})}function resume(e,t){try{step(i[e](t))}catch(e){settle(s[0][3],e)}}function step(e){e.value instanceof __await?Promise.resolve(e.value.v).then(fulfill,reject):settle(s[0][2],e)}function fulfill(e){resume("next",e)}function reject(e){resume("throw",e)}function settle(e,t){e(t),s.shift(),s.length&&resume(s[0][0],s[0][1])}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,i=r.apply(e,t||[]),s=[];return n={},verb("next"),verb("throw"),verb("return"),n[Symbol.asyncIterator]=function(){return this},n}function __asyncDelegator(e){function verb(n,i){t[n]=e[n]?function(t){return(r=!r)?{value:__await(e[n](t)),done:"return"===n}:i?i(t):t}:i}var t,r;return t={},verb("next"),verb("throw",function(e){throw e}),verb("return"),t[Symbol.iterator]=function(){return this},t}function __asyncValues(e){function verb(r){t[r]=e[r]&&function(t){return new Promise(function(n,i){t=e[r](t),settle(n,i,t.done,t.value)})}}function settle(e,t,r,n){Promise.resolve(n).then(function(t){e({value:t,done:r})},t)}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},verb("next"),verb("throw"),verb("return"),t[Symbol.asyncIterator]=function(){return this},t)}function __makeTemplateObject(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function __importStar(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function __importDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.__extends=__extends,r.d(t,"__assign",function(){return i}),t.__rest=__rest,t.__decorate=__decorate,t.__param=__param,t.__metadata=__metadata,t.__awaiter=__awaiter,t.__generator=__generator,t.__exportStar=__exportStar,t.__values=__values,t.__read=__read,t.__spread=__spread,t.__spreadArrays=__spreadArrays,t.__await=__await,t.__asyncGenerator=__asyncGenerator,t.__asyncDelegator=__asyncDelegator,t.__asyncValues=__asyncValues,t.__makeTemplateObject=__makeTemplateObject,t.__importStar=__importStar,t.__importDefault=__importDefault;var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},i=function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},i.apply(this,arguments)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0);n.__exportStar(r(9),t),n.__exportStar(r(5),t),n.__exportStar(r(3),t)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),i=r(5),s=r(6),o=function(){function ExpressionBase(e,t,r,n){void 0===t&&(t=[]),this.fieldName=e,this.values=t,this.operatorName=r,this.valueType=n,this._weight=0}return ExpressionBase.prototype.addValue=function(e){return this.values[this.values.length]=e,this},ExpressionBase.prototype.weight=function(e){return this._weight=e,this},ExpressionBase.prototype.toJSON=function(){var e={};return this.fieldName&&(e.field=this.fieldName),this.valueType===i.ExpressionValueTypeEnum.Single?e[this.operatorName]=this.values[0]:this.valueType===i.ExpressionValueTypeEnum.Array?e[this.operatorName]=this.values:this.values&&1===this.values.length?e[this.operatorName]=this.values[0]:e[this.operatorName]=this.values,this._weight&&this._weight>1&&(e.weight=this._weight),e},ExpressionBase}();t.ExpressionBase=o;var a=function(e){function LogicalExpression(t,r,n){return void 0===t&&(t=[]),e.call(this,null,t,r,i.ExpressionValueTypeEnum.Array)||this}return n.__extends(LogicalExpression,e),LogicalExpression.prototype.getItem=function(e){return this.values[e]},LogicalExpression.prototype.setItem=function(e,t){return this.values[e]=t,this},LogicalExpression.prototype.add=function(e){return this.values[this.values.length]=e,this},LogicalExpression.prototype.addRange=function(e){return Array.prototype.push.apply(this.values,e),this},LogicalExpression.prototype.indexOf=function(e){return this.values.indexOf(e)},LogicalExpression.prototype.insert=function(e,t){return this.values.splice(e,0,t),this},LogicalExpression.prototype.remove=function(e){var t=this.indexOf(e);return t>=0&&(this.removeAt(t),!0)},LogicalExpression.prototype.removeAt=function(e){return this.values.splice(e,1),this},LogicalExpression.prototype.clear=function(){return this.values.length=0,this},LogicalExpression.prototype.contains=function(e){return this.indexOf(e)>=0},LogicalExpression.prototype.count=function(){return this.values.length},LogicalExpression}(o);t.LogicalExpression=a;var u=function(e){function AndExpression(t){return e.call(this,t,i.OperatorTypeEnum.And,i.ExpressionValueTypeEnum.Array)||this}return n.__extends(AndExpression,e),AndExpression}(a),l=function(e){function BetweenExpression(t,r,n){return e.call(this,t,[r,n],i.OperatorTypeEnum.Between,i.ExpressionValueTypeEnum.Array)||this}return n.__extends(BetweenExpression,e),BetweenExpression}(o),c=function(e){function ContainsExpression(t,r){return e.call(this,t,[r],i.OperatorTypeEnum.Contains,i.ExpressionValueTypeEnum.Single)||this}return n.__extends(ContainsExpression,e),ContainsExpression}(o),p=function(e){function DistanceWithinExpression(t,r){return e.call(this,t,[r],i.OperatorTypeEnum.DistanceWithin,i.ExpressionValueTypeEnum.Single)||this}return n.__extends(DistanceWithinExpression,e),DistanceWithinExpression}(o),h=function(e){function EndsWithExpression(t,r){return e.call(this,t,[r],i.OperatorTypeEnum.EndsWith,i.ExpressionValueTypeEnum.Single)||this}return n.__extends(EndsWithExpression,e),EndsWithExpression}(o),d=function(e){function EqualToExpression(t,r){return e.call(this,t,[r],i.OperatorTypeEnum.EqualTo,i.ExpressionValueTypeEnum.Single)||this}return n.__extends(EqualToExpression,e),EqualToExpression}(o),f=function(e){function ExistsExpression(t,r){return e.call(this,t,[r],i.OperatorTypeEnum.Exists,i.ExpressionValueTypeEnum.Single)||this}return n.__extends(ExistsExpression,e),ExistsExpression}(o),y=function(e){function FreeTextExpression(t,r){return e.call(this,t,[r],i.OperatorTypeEnum.FreeText,i.ExpressionValueTypeEnum.Single)||this}return n.__extends(FreeTextExpression,e),FreeTextExpression}(o),g=function(e){function GreaterThanExpression(t,r){return e.call(this,t,[r],i.OperatorTypeEnum.GreaterThan,i.ExpressionValueTypeEnum.Single)||this}return n.__extends(GreaterThanExpression,e),GreaterThanExpression}(o),v=function(e){function GreaterThanOrEqualToExpression(t,r){return e.call(this,t,[r],i.OperatorTypeEnum.GreaterThanOrEqualTo,i.ExpressionValueTypeEnum.Single)||this}return n.__extends(GreaterThanOrEqualToExpression,e),GreaterThanOrEqualToExpression}(o),_=function(e){function InExpression(t,r){return e.call(this,t,r,i.OperatorTypeEnum.In,i.ExpressionValueTypeEnum.Array)||this}return n.__extends(InExpression,e),InExpression}(o),m=function(e){function LessThanExpression(t,r){return e.call(this,t,[r],i.OperatorTypeEnum.LessThan,i.ExpressionValueTypeEnum.Single)||this}return n.__extends(LessThanExpression,e),LessThanExpression}(o),E=function(e){function LessThanOrEqualToExpression(t,r){return e.call(this,t,[r],i.OperatorTypeEnum.LessThanOrEqualTo,i.ExpressionValueTypeEnum.Single)||this}return n.__extends(LessThanOrEqualToExpression,e),LessThanOrEqualToExpression}(o),O=function(e){function NotExpression(t){return e.call(this,[t],i.OperatorTypeEnum.Not,i.ExpressionValueTypeEnum.Single)||this}return n.__extends(NotExpression,e),NotExpression}(a),b=function(e){function OrExpression(t){return e.call(this,t,i.OperatorTypeEnum.Or,i.ExpressionValueTypeEnum.Array)||this}return n.__extends(OrExpression,e),OrExpression}(a),x=function(e){function StartsWithExpression(t,r){return e.call(this,t,[r],i.OperatorTypeEnum.StartsWith,i.ExpressionValueTypeEnum.Single)||this}return n.__extends(StartsWithExpression,e),StartsWithExpression}(o),w=function(e){function WhereExpression(t){return void 0===t&&(t=[]),e.call(this,t,i.OperatorTypeEnum.Where,i.ExpressionValueTypeEnum.Array)||this}return n.__extends(WhereExpression,e),WhereExpression.prototype.toJSON=function(){return e.prototype.toJSON.call(this)[i.OperatorTypeEnum.Where]},WhereExpression}(a);t.WhereExpression=w;var T=function(){function Operators(){}return Operators.prototype.and=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return new u(e)},Operators.prototype.between=function(e,t,r){return new l(e,t,r)},Operators.prototype.contains=function(e,t){return new c(e,t)},Operators.prototype.distanceWithin=function(e,t,r,n){return new p(e,{lat:t,lon:r,distance:n})},Operators.prototype.endsWith=function(e,t){return new h(e,t)},Operators.prototype.equalTo=function(e,t){return new d(e,t)},Operators.prototype.exists=function(e,t){return new f(e,t)},Operators.prototype.freeText=function(e,t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=s.FreeTextSearchOperatorTypeEnum.And),new y(e,{term:t,fuzzy:r,operator:n})},Operators.prototype.greaterThan=function(e,t){return new g(e,t)},Operators.prototype.greaterThanOrEqualTo=function(e,t){return new v(e,t)},Operators.prototype.in=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return new _(e,t)},Operators.prototype.lessThan=function(e,t){return new m(e,t)},Operators.prototype.lessThanOrEqualTo=function(e,t){return new E(e,t)},Operators.prototype.not=function(e){return new O(e)},Operators.prototype.or=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return new b(e)},Operators.prototype.startsWith=function(e,t){return new x(e,t)},Operators}();t.Operators=T},function(e,t,r){"use strict";function hasProp(e,t){return!!e&&void 0!==e[t]}function toQuery(e,t){void 0===t&&(t=!1);var r=Object.keys(e).filter(function(t){return t&&null!==e[t]&&""!==e[t]&&(!Array.isArray(e[t])||e[t].length>0)});t||r.sort();var n=r.map(function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])});return n.length>0?"?"+n.join("&"):""}function isString(e){return"string"==typeof e||e instanceof String}function isBrowser(){return"undefined"!=typeof window}function isIE(){var e;return!!(e=window&&window.document&&window.document.documentMode?window.document.documentMode:null)&&e<=11}function isNodejs(){return n}Object.defineProperty(t,"__esModule",{value:!0});var n=r(11);t.hasProp=hasProp,t.toQuery=toQuery,t.isString=isString,t.isBrowser=isBrowser,t.isIE=isIE,t.isNodejs=isNodejs,t.defaultMapperForLanguage=function(e,t,r){return!e&&r?r.language:e},t.defaultMapperForPublishedVersionStatus=function(e,t,r){return"published"===e?null:e},t.defaultMapperForLatestVersionStatus=function(e,t,r){return"latest"===e?null:e}},function(e,t,r){"use strict";function toOrderByDto(e){var t;if(!e)return null;if("string"==typeof e){var r=e.substring(0,1);if("+"===r||"-"===r){var n="-"===r?"desc":"asc";return t={},t[n]=e.substring(1),t}return{asc:e}}return e}function serializeOrder(e){if(!e)return[];if("string"==typeof e){var t=toOrderByDto(e);return t?[t]:[]}if(Array.isArray(e))return e.map(toOrderByDto).filter(function(e){return!!e});var r=e instanceof s.Ordering?e:null;return null===r?[]:r.toArray()}Object.defineProperty(t,"__esModule",{value:!0});var n=r(2),i=r(17),s=r(7);t.Op=new n.Operators,t.OrderBy=new i.OrderByFactory,t.serializeOrder=serializeOrder},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0);n.__exportStar(r(13),t),n.__exportStar(r(14),t)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FreeTextSearchOperatorTypeEnum={And:"and",Or:"or"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function Ordering(){this._items=[]}return Ordering.prototype.asc=function(e){return this._items.push({asc:e}),this},Ordering.prototype.desc=function(e){return this._items.push({desc:e}),this},Ordering.prototype.toArray=function(){return this._items},Ordering}();t.Ordering=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1);r.n(n);r.o(n,"Op")&&r.d(t,"Op",function(){return n.Op}),r.o(n,"OrderBy")&&r.d(t,"OrderBy",function(){return n.OrderBy}),r.o(n,"Query")&&r.d(t,"Query",function(){return n.Query}),r.o(n,"ZenqlQuery")&&r.d(t,"ZenqlQuery",function(){return n.ZenqlQuery});var i=r(22);r.d(t,"Client",function(){return i.a})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0);n.__exportStar(r(10),t),n.__exportStar(r(12),t)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(3),i=function(){function HttpClient(e,t){this.paramsProvider=e,this.fetchFn=t}return HttpClient.prototype.request=function(e,t){void 0===t&&(t={});var r=this.paramsProvider.getParams(),i=!r.rootUrl||"/"===r.rootUrl;if(!n.isBrowser()&&i)throw new Error("You cannot specify a relative root url if not in a browser context.");t.method=t.method||(t.body?"POST":"GET"),i||(t.mode="cors"),t.headers=t.headers||{};var s=t.headers;if(!s.accessToken&&r.accessToken&&(s.accessToken=r.accessToken),"none"===r.clientType&&!s.accessToken)throw new Error('If the property clientType is set to "'+r.clientType+'" then the property accessToken must be provided.');if("client_credentials"===r.clientType&&!r.clientDetails)throw new Error('If the property client type is set to "'+r.clientType+'" then the property clientDetails must be set to a ClientCredentialsGrant value.');if(r.defaultHeaders){Object.keys(r.defaultHeaders).forEach(function(e){!s[e]&&r.defaultHeaders[e]&&(s[e]=r.defaultHeaders[e])})}var o=i?""+e:""+r.rootUrl+e;return this.fetchFn(o,t).then(function(e){var t=null;r.responseHandler&&(r.responseHandler["*"]&&(t=r.responseHandler["*"]),r.responseHandler[e.status]&&(t=r.responseHandler[e.status]));var n={status:e.status,statusText:e.statusText,url:e.url,data:null};return e.text().then(function(e){return e&&e.length&&e.length>0?JSON.parse(e):{}}).then(function(r){return n.data=r,e.ok?(t&&t(e,n),r):t?t(e,n):Promise.reject(n)},function(r){return n.data=r,t?t(e,n):Promise.reject(n)})}).then(function(e){return e})},HttpClient}();t.HttpClient=i},function(e,t){e.exports=!1},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),i=r(3),s=function(){function UrlBuilder(e,t){this.url=e,this.query=t,this.paramMatcher=/(:\b\D\w*)/g,this.options={},this.mappers={}}return UrlBuilder.create=function(e,t){return void 0===t&&(t=null),new UrlBuilder(e,t)},UrlBuilder.prototype.addOptions=function(e,t){return void 0===t&&(t=null),i.isString(e)&&t?this.options[t]=e:this.options=n.__assign({},this.options,e),this},UrlBuilder.prototype.setParams=function(e){return this.clientParams=e,this},UrlBuilder.prototype.addMappers=function(e){var t=this;return e&&Object.keys(e).forEach(function(r){t.mappers[r]=e[r]}),this},UrlBuilder.prototype.toUrl=function(){var e=this,t={},r="function"==typeof this.url?this.url(this.options,this.clientParams):this.url,s=r.match(this.paramMatcher);s&&s.forEach(function(r){var n=r.substring(1),s=null;i.hasProp(e.options,n)&&null!==e.options[n]?s=e.options[n]:i.hasProp(e.clientParams,n)&&null!==e.clientParams[n]&&(s=e.clientParams[n]);var o=null;e.mappers[r]&&(o=e.mappers[r](s,e.options,e.clientParams)),t[r]=null!==o?o:s});var o={};return this.query&&(o=n.__assign({},this.query),Object.keys(this.query).forEach(function(t){var r=o[t];i.hasProp(e.options,t)&&null!==e.options[t]?r=e.options[t]:i.hasProp(e.clientParams,t)&&null!==e.clientParams[t]&&(r=e.clientParams[t]),o[t]=e.mappers[t]?e.mappers[t](r,e.options,e.clientParams):r})),""+Object.keys(t).reduce(function(e,r){return e.replace(r,t[r])},r)+i.toQuery(o)},UrlBuilder}();t.UrlBuilder=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),i=function(e){function ContensisApplicationError(t){var r=this.constructor,n=e.call(this,t)||this;return n.name="ContensisApplicationError",Object.setPrototypeOf(n,r.prototype),n}return n.__extends(ContensisApplicationError,e),ContensisApplicationError}(Error);t.ContensisApplicationError=i;var s=function(e){function ContensisAuthenticationError(t){var r=this.constructor,n=e.call(this,t)||this;return n.name="ContensisAuthenticationError",Object.setPrototypeOf(n,r.prototype),n}return n.__extends(ContensisAuthenticationError,e),ContensisAuthenticationError}(Error);t.ContensisAuthenticationError=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0);n.__exportStar(r(15),t),n.__exportStar(r(6),t),n.__exportStar(r(16),t),n.__exportStar(r(18),t),n.__exportStar(r(2),t),n.__exportStar(r(19),t),n.__exportStar(r(20),t),n.__exportStar(r(4),t),n.__exportStar(r(21),t)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExpressionValueTypeEnum={Single:"single",Array:"array",Unknown:"unknown"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2),i=r(4),s=function(){function ManagementQuery(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.where=new n.WhereExpression,this.orderBy=[],this.pageIndex=0,this.pageSize=20,this.includeArchived=!1,this.includeDeleted=!1,e&&this.where.addRange(e)}return ManagementQuery.prototype.toJSON=function(){var e={};e.pageIndex=this.pageIndex,e.pageSize=this.pageSize;var t=i.serializeOrder(this.orderBy);return t&&t.length>0&&(e.orderBy=t),e.where=this.where,e.includeArchived=this.includeArchived,e.includeDeleted=this.includeDeleted,e},ManagementQuery}();t.ManagementQuery=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(7),i=function(){function OrderByFactory(){}return OrderByFactory.prototype.asc=function(e){return(new n.Ordering).asc(e)},OrderByFactory.prototype.desc=function(e){return(new n.Ordering).desc(e)},OrderByFactory}();t.OrderByFactory=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function ManagementZenqlQuery(e){this.zenql="",this.pageIndex=0,this.pageSize=20,this.includeArchived=!1,this.includeDeleted=!1,this.zenql=e}return ManagementZenqlQuery.prototype.toJSON=function(){var e={};return e.pageIndex=this.pageIndex,e.pageSize=this.pageSize,e.zenql=this.zenql,e.includeArchived=this.includeArchived,e.includeDeleted=this.includeDeleted,e},ManagementZenqlQuery}();t.ManagementZenqlQuery=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OperatorTypeEnum={And:"and",Between:"between",Contains:"contains",EndsWith:"endsWith",EqualTo:"equalTo",Exists:"exists",FreeText:"freeText",GreaterThan:"greaterThan",GreaterThanOrEqualTo:"greaterThanOrEqualTo",In:"in",LessThan:"lessThan",LessThanOrEqualTo:"lessThanOrEqualTo",Not:"not",Or:"or",StartsWith:"startsWith",Where:"where",DistanceWithin:"distanceWithin"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2),i=r(4),s=function(){function Query(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.where=new n.WhereExpression,this.orderBy=[],this.pageIndex=0,this.pageSize=20,this.fieldLinkDepths={},this.fields=[],e&&this.where.addRange(e)}return Query.prototype.toJSON=function(){var e={};e.pageIndex=this.pageIndex,e.pageSize=this.pageSize;var t=i.serializeOrder(this.orderBy);return t&&t.length>0&&(e.orderBy=t),e.where=this.where,this.fields&&this.fields.length>0&&(e.fields=this.fields),this.fieldLinkDepths&&Object.keys(this.fieldLinkDepths).length>0&&(e.fieldLinkDepths=this.fieldLinkDepths),e},Query}();t.Query=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function ZenqlQuery(e){this.zenql="",this.pageIndex=0,this.pageSize=20,this.fieldLinkDepths={},this.fields=[],this.zenql=e}return ZenqlQuery.prototype.toJSON=function(){var e={};return e.pageIndex=this.pageIndex,e.pageSize=this.pageSize,e.zenql=this.zenql,this.fields&&this.fields.length>0&&(e.fields=this.fields),this.fieldLinkDepths&&Object.keys(this.fieldLinkDepths).length>0&&(e.fieldLinkDepths=this.fieldLinkDepths),e},ZenqlQuery}();t.ZenqlQuery=n},function(e,t,r){"use strict";r.d(t,"a",function(){return f});var n=r(0),i=r(23),s=r(28),o=r(29),a=r(30),u=r(31),l=r(32),c=r(1),p=(r.n(c),r(33)),h=r(34),d=r.n(h),f=function(){function Client(e){void 0===e&&(e=null),this.clientConfig=null,this.clientConfig=new u.a(e,Client.defaultClientConfig),this.fetchFn=this.clientConfig.fetchFn?this.clientConfig.fetchFn:d.a,this.httpClient=new c.HttpClient(this,this.fetchFn),this.entries=new i.a(this.httpClient,this),this.project=new o.a(this.httpClient,this),this.contentTypes=new s.a(this.httpClient,this),this.nodes=new l.a(this.httpClient,this),this.taxonomy=new a.a(this.httpClient,this)}return Client.create=function(e){return void 0===e&&(e=null),new Client(e)},Client.configure=function(e){Client.defaultClientConfig=new u.a(e,Client.defaultClientConfig)},Client.prototype.getParams=function(){return this.clientConfig.toParams()},Client.prototype.getHeaders=function(e){void 0===e&&(e="application/json");var t={Accept:"application/json"};return e&&(t["Content-Type"]=e),this.clientConfig.accessToken||(t.Authorization="Bearer "+this.bearerToken),t},Client.prototype.isBearerTokenExpired=function(){if(this.bearerToken&&this.bearerTokenExpiryDate){if(new Date((new Date).getTime()+6e4)<this.bearerTokenExpiryDate)return!1}return!0},Client.prototype.isRefreshTokenExpired=function(){if(this.refreshToken&&this.refreshTokenExpiryDate){if(new Date((new Date).getTime()+6e4)<this.refreshTokenExpiryDate)return!1}return!0},Client.prototype.ensureIsAuthorized=function(){var e=this;return this.clientConfig.accessToken?Promise.resolve(""):this.isBearerTokenExpired()?this.authenticate().then(function(){return e.bearerToken}).catch(function(e){if(e instanceof c.ContensisAuthenticationError)throw e;throw new c.ContensisApplicationError(e.message)}):Promise.resolve(this.bearerToken)},Client.prototype.authenticate=function(){var e=this,t=this.getAuthenticatePayload(),r=Object.keys(t).map(function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])}).join("&"),i=this.clientConfig.rootUrl?this.clientConfig.rootUrl:"";return this.fetchFn(i+"/authenticate/connect/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},body:r}).then(function(t){return n.__awaiter(e,void 0,void 0,function(){var e;return n.__generator(this,function(r){switch(r.label){case 0:return[4,t.json()];case 1:return e=r.sent(),[2,{response:t,responseData:e}]}})})}).then(function(t){var r=t.response,n=t.responseData;if(!r.ok)throw new c.ContensisAuthenticationError(n.error?n.error:JSON.stringify(n));e.bearerToken=n.access_token;var i=n.expires_in,s=new Date;e.bearerTokenExpiryDate=new Date(s.getTime()+1e3*i),n.refresh_token?(e.refreshToken=n.refresh_token,e.refreshTokenExpiryDate=new Date(s.getTime()+1296e6)):(e.refreshToken=null,e.refreshTokenExpiryDate=null),r.headers&&r.headers.has("x-contensis-classic-token")?e.contensisClassicToken=r.headers.get("x-contensis-classic-token"):e.contensisClassicToken=null})},Client.prototype.getAuthenticatePayload=function(){var e={scope:"client_credentials"===this.clientConfig.clientType?p.b():p.a()};if("none"!==this.clientConfig.clientType&&(e.grant_type=this.clientConfig.clientType),"client_credentials"===this.clientConfig.clientType){var t=this.clientConfig.clientDetails;e.client_id=t.clientId,e.client_secret=t.clientSecret}else if("contensis_classic"===this.clientConfig.clientType){var t=this.clientConfig.clientDetails;e.username=t.username,e.password=t.password}else if("contensis_classic_refresh_token"===this.clientConfig.clientType){var t=this.clientConfig.clientDetails;e.refresh_token=t.refreshToken}return e},Client.defaultClientConfig=null,Client}()},function(e,t,r){"use strict";r.d(t,"a",function(){return c});var n=r(0),i=r(24),s=r(1),o=(r.n(s),function(e,t){return e.contentTypeId?"/api/delivery/projects/:projectId/contentTypes/:contentTypeId/entries":"/api/delivery/projects/:projectId/entries"}),a={language:s.defaultMapperForLanguage,versionStatus:s.defaultMapperForPublishedVersionStatus,fields:function(e){return e&&e.length>0?e:null},linkDepth:function(e){return e&&e>0?e:null},fieldLinkDepths:function(e){return Object.keys(e||{}).length>0?JSON.stringify(e):null}},u=n.__assign({},a,{order:function(e){return e&&e.length>0?e:null},pageIndex:function(e,t,r){return t&&t.pageOptions&&t.pageOptions.pageIndex||r.pageIndex},pageSize:function(e,t,r){return t&&t.pageOptions&&t.pageOptions.pageSize||r.pageSize}}),l={linkDepth:function(e){return e&&e>0?e:null},fieldLinkDepths:function(e){return Object.keys(e||{}).length>0?JSON.stringify(e):null}},c=function(){function EntryOperations(e,t){this.httpClient=e,this.contensisClient=t}return EntryOperations.prototype.get=function(e){var t=this,r=s.UrlBuilder.create("/api/delivery/projects/:projectId/entries/:id",{language:null,versionStatus:null,linkDepth:null,fieldLinkDepths:null,fields:null}).addOptions(e,"id").setParams(this.contensisClient.getParams()).addMappers(a).toUrl();return this.contensisClient.ensureIsAuthorized().then(function(){return t.httpClient.request(r,{headers:t.contensisClient.getHeaders()})})},EntryOperations.prototype.list=function(e){var t=this,r=s.UrlBuilder.create(o,{language:null,versionStatus:null,linkDepth:null,order:null,fieldLinkDepths:null,fields:null,pageIndex:null,pageSize:null}).addOptions(e,"contentTypeId").setParams(this.contensisClient.getParams()).addMappers(u).toUrl();return this.contensisClient.ensureIsAuthorized().then(function(){return t.httpClient.request(r,{headers:t.contensisClient.getHeaders()})})},EntryOperations.prototype.search=function(e,t){var r=this;if(void 0===t&&(t=0),!e)return new Promise(function(e){e(null)});var i=e instanceof s.Query?e:null;if(null!==i||e.where||e.orderBy)return this.searchUsingQuery(i||e,t);var o=e instanceof s.ZenqlQuery?e:null;if(null===o){if("string"!=typeof e)throw new Error("A valid query needs to be specified.");o=new s.ZenqlQuery(e)}var a=this.contensisClient.getParams(),u=a.pageSize||25,c=a.pageIndex||0,p=[],h={};u=o.pageSize||u,c=o.pageIndex||c,p=o.fields||p,h=o.fieldLinkDepths||h;var d=(a.accessToken,a.projectId),f=(a.language,a.responseHandler,a.rootUrl,a.versionStatus,n.__rest(a,["accessToken","projectId","language","responseHandler","rootUrl","versionStatus"])),y=n.__assign({},f,{fieldLinkDepths:h,linkDepth:t,pageSize:u,pageIndex:c,zenql:o.zenql});p&&p.length>0&&(y.fields=p);var g=s.UrlBuilder.create("/api/delivery/projects/:projectId/entries",n.__assign({},y)).setParams(n.__assign({},y,{projectId:d})).addMappers(l).toUrl();return this.contensisClient.ensureIsAuthorized().then(function(){return r.httpClient.request(g,{method:"GET",headers:r.contensisClient.getHeaders("application/json; charset=utf-8")})})},EntryOperations.prototype.resolve=function(e,t){var r=this;void 0===t&&(t=null);var n=this.contensisClient.getParams();return new i.a(e,t,n.versionStatus,function(e){return r.search(e)}).resolve()},EntryOperations.prototype.searchUsingQuery=function(e,t){var r=this;if(void 0===t&&(t=0),!e)return new Promise(function(e){e(null)});var i=e,o=this.contensisClient.getParams(),a=o.pageSize||25,u=o.pageIndex||0,c=[],p={};a=i.pageSize||a,u=i.pageIndex||u,c=i.fields||c,p=i.fieldLinkDepths||p;var h=i.orderBy&&(i.orderBy._items||i.orderBy),d=(o.accessToken,o.projectId),f=(o.language,o.responseHandler,o.rootUrl,o.versionStatus,n.__rest(o,["accessToken","projectId","language","responseHandler","rootUrl","versionStatus"])),y=n.__assign({},f,{fieldLinkDepths:p,linkDepth:t,pageSize:a,pageIndex:u,where:JSON.stringify(i.where)});c&&c.length>0&&(y.fields=c),i.orderBy&&(!Array.isArray(i.orderBy)||i.orderBy.length>0)&&(y.orderBy=JSON.stringify(h));var g=s.UrlBuilder.create("/api/delivery/projects/:projectId/entries/search",n.__assign({},y)).setParams(n.__assign({},y,{projectId:d})).addMappers(l).toUrl();return g.length>8e3||Object(s.isBrowser)()&&Object(s.isIE)()&&g.length>2083?this.searchUsingPost(e,t):this.contensisClient.ensureIsAuthorized().then(function(){return r.httpClient.request(g,{method:"GET",headers:r.contensisClient.getHeaders("application/json; charset=utf-8")})})},EntryOperations.prototype.searchUsingPost=function(e,t){var r=this;if(void 0===t&&(t=0),!e)return new Promise(function(e){e(null)});var n=this.contensisClient.getParams();e.pageSize=e.pageSize||n.pageSize,e.pageIndex=e.pageIndex||0;var i=s.UrlBuilder.create("/api/delivery/projects/:projectId/entries/search",{linkDepth:t,fieldLinkDepths:e.fieldLinkDepths}).setParams(this.contensisClient.getParams()).addMappers(l).toUrl();return this.contensisClient.ensureIsAuthorized().then(function(){var t=Object.assign(Object.create(Object.getPrototypeOf(e)),e);return delete t.fieldLinkDepths,r.httpClient.request(i,{method:"POST",headers:r.contensisClient.getHeaders("application/json; charset=utf-8"),body:JSON.stringify(t)})})},EntryOperations}()},function(e,t,r){"use strict";r.d(t,"a",function(){return i});var n=r(25),i=function(){function LinkResolver(e,t,r,n){this.entryOrList=e,this.paths=t,this.versionStatus=r,this.search=n}return LinkResolver.prototype.resolve=function(){var e=this,t=this.getEntries(),r=Promise.resolve([]);if(t.length>0){r=new n.a(t,this.paths,this.versionStatus,this.search).resolve()}return r.then(function(){return e.entryOrList})},LinkResolver.prototype.getEntries=function(){var e=this.entryOrList;return e?Array.isArray(e)?e:e.items&&Array.isArray(e.items)?e.items:[e]:[]},LinkResolver}()},function(e,t,r){"use strict";r.d(t,"a",function(){return o});var n=r(1),i=(r.n(n),r(26)),s=r(27),o=function(){function ListResolver(e,t,r,n){this.entries=e,this.paths=t,this.versionStatus=r,this.search=n,this.deferredEntries=[]}return ListResolver.prototype.resolve=function(){var e=this;this.deferredEntries=[];var t=this.entries.map(function(t){return new s.a(t,e.paths,function(t,r){return e.getEntry(t,r)}).resolve()});return this.nestedSearch().then(function(r){return Promise.all(t).then(function(t){return e.entries})})},ListResolver.prototype.getEntry=function(e,t){var r=new i.a({id:e,language:t},this.versionStatus);return this.deferredEntries.push(r),r.promise},ListResolver.prototype.nestedSearch=function(){var e=this,t=this.deferredEntries.map(function(e){return e.expression}),r=new n.Query(n.Op.or.apply(n.Op,t));return r.pageIndex=0,r.pageSize=t.length,this.search(r).then(function(t){var r=e.deferredEntries;e.deferredEntries=[];for(var n=[],i=0,s=t.items;i<s.length;i++){var o=s[i];!function(e){for(var t=r.filter(function(t){return t.is(e.sys)}),i=0,s=t;i<s.length;i++){var o=s[i];o.resolve(e),n.push(o.promise)}}(o)}if(0===n.length){for(var a=0,u=r;a<u.length;a++){u[a].resolve(null)}return Promise.resolve(t)}return Promise.all(n).then(function(){return Promise.resolve(t)})}).then(function(t){return e.deferredEntries.length>0?e.nestedSearch():t})},ListResolver}()},function(e,t,r){"use strict";r.d(t,"a",function(){return i});var n=r(1),i=(r.n(n),function(){function DeferredEntry(e,t){var r=this;this.sys=e,this.versionStatus=t,this.promise=new Promise(function(e,t){r.resolve=e,r.reject=t}),this.expression=n.Op.and(n.Op.equalTo("sys.id",e.id),n.Op.equalTo("sys.language",e.language),n.Op.equalTo("sys.versionStatus",this.versionStatus))}return DeferredEntry.prototype.is=function(e){return!!(e&&e.id&&e.language&&e.id===this.sys.id&&e.language===this.sys.language)},DeferredEntry}())},function(e,t,r){"use strict";function isUnresolvedEntry(e){if(e&&e.sys&&e.sys.id){return 1===Object.keys(e).length}return!1}function isUnresolvedImage(e){if(e&&e.asset){return Object.keys(e).length<=2&&isUnresolvedEntry(e.asset)}return!1}function isComposer(e){return!!(Array.isArray(e)&&e.length>0)&&isComposerItem(e[0])}function isComposerItem(e){if(e&&e.type&&e.value){return 2===Object.keys(e).length}return!1}r.d(t,"a",function(){return i});var n=r(0),i=function(){function EntryResolver(e,t,r){this.entry=e,this.paths=t,this.getEntry=r}return EntryResolver.prototype.resolve=function(){var e=this,t=this.paths||Object.keys(this.entry),r=t.map(function(t){var r=t.split("."),n=r.shift(),i=null,s=e.entry[n];if(s&&!(i=e.resolveField(s))&&isComposer(s)){var o=r.length>0?r.shift():null;i=e.resolveComposerField(s,o)}return i=i?i.then(function(t){return e.entry[n]=t.value,t}):Promise.resolve(null),i.then(function(t){return e.next(t,r.join("."))})});return Promise.all(r).then(function(t){return e.entry})},EntryResolver.prototype.next=function(e,t){var r=this;if(!t||!e||!e.entries||e.entries.length<=0)return Promise.resolve(e);var n=e.entries.map(function(e){return new EntryResolver(e,[t],function(e,t){return r.getEntry(e,t)}).resolve()});return Promise.all(n)},EntryResolver.prototype.resolveField=function(e){var t=this;if(isUnresolvedEntry(e))return this.resolveEntry(e);if(isUnresolvedImage(e))return this.resolveImage(e);if(Array.isArray(e)){var r=!1,n=e.map(function(e){return isUnresolvedEntry(e)?(r=!0,t.resolveEntry(e)):isUnresolvedImage(e)?(r=!0,t.resolveImage(e)):Promise.resolve({entries:[],value:e})});if(r)return Promise.all(n).then(function(e){for(var t=[],r=[],n=0,i=e;n<i.length;n++){var s=i[n];t.push(s.value),r=r.concat(s.entries)}return{entries:r,value:t}})}return null},EntryResolver.prototype.resolveComposerField=function(e,t){var r=this;if(Array.isArray(e)){var n=!1,i=e.map(function(e){if(isComposerItem(e)&&(!t||t===e.type)){var i=r.resolveField(e.value);if(i)return n=!0,i.then(function(t){return e.value=t,e})}return Promise.resolve({entries:[],value:e})});if(n)return Promise.all(i).then(function(e){for(var t=[],r=[],n=0,i=e;n<i.length;n++){var s=i[n];t.push(s.value),r=r.concat(s.entries)}return{entries:r,value:t}})}return null},EntryResolver.prototype.resolveEntry=function(e){return n.__awaiter(this,void 0,void 0,function(){var t,r;return n.__generator(this,function(n){switch(n.label){case 0:return e&&e.sys&&e.sys.id?(t=e.sys.language||this.entry.sys.language,[4,this.getEntry(e.sys.id,t)]):[3,2];case 1:return r=n.sent(),[2,{entries:[r],value:r}];case 2:return[2,Promise.resolve({entries:[],value:e})]}})})},EntryResolver.prototype.resolveImage=function(e){if(e&&e.asset&&e.asset.sys&&e.asset.sys.id){var t=e.asset.sys.language||this.entry.sys.language;return this.getEntry(e.asset.sys.id,t).then(function(t){return e.asset=t,{entries:[t],value:e}})}return Promise.resolve({entries:[],value:e})},EntryResolver}()},function(e,t,r){"use strict";r.d(t,"a",function(){return i});var n=r(1),i=(r.n(n),function(){function ContentTypeOperations(e,t){this.httpClient=e,this.contensisClient=t}return ContentTypeOperations.prototype.get=function(e){var t=this,r=n.UrlBuilder.create("/api/delivery/projects/:projectId/contentTypes/:contentTypeId").addOptions(e,"contentTypeId").setParams(this.contensisClient.getParams()).toUrl();return this.contensisClient.ensureIsAuthorized().then(function(){return t.httpClient.request(r,{headers:t.contensisClient.getHeaders()})})},ContentTypeOperations}())},function(e,t,r){"use strict";r.d(t,"a",function(){return i});var n=r(1),i=(r.n(n),function(){function ProjectOperations(e,t){this.httpClient=e,this.contensisClient=t}return ProjectOperations.prototype.get=function(){var e=this,t=n.UrlBuilder.create("/api/delivery/projects/:projectId").setParams(this.contensisClient.getParams()).toUrl();return this.contensisClient.ensureIsAuthorized().then(function(){return e.httpClient.request(t,{headers:e.contensisClient.getHeaders()})})},ProjectOperations}())},function(e,t,r){"use strict";r.d(t,"a",function(){return o});var n=r(0),i=r(1),s=(r.n(i),{order:function(e){return"defined"===e?e:null}}),o=function(){function TaxonomyOperations(e,t){this.httpClient=e,this.contensisClient=t}return TaxonomyOperations.prototype.getNodeByKey=function(e){var t=this,r=i.UrlBuilder.create("/api/delivery/projects/:projectId/taxonomy/nodes/:key",{order:null,childDepth:null,language:null}).addOptions(e,"key").setParams(this.contensisClient.getParams()).addMappers(s).toUrl();return this.contensisClient.ensureIsAuthorized().then(function(){return t.httpClient.request(r,{headers:t.contensisClient.getHeaders()})})},TaxonomyOperations.prototype.getNodeByPath=function(e){var t=this,r=i.UrlBuilder.create("/api/delivery/projects/:projectId/taxonomy/nodes",{order:null,childDepth:null,language:null,path:null}).addOptions(e,"path").setParams(this.contensisClient.getParams()).addMappers(s).toUrl();return this.contensisClient.ensureIsAuthorized().then(function(){return t.httpClient.request(r,{headers:t.contensisClient.getHeaders()})})},TaxonomyOperations.prototype.resolveChildren=function(e){var t=e,r=null,i={childDepth:1};return t.node?(r=t.node,i={childDepth:t.childDepth||1,order:t.order,language:t.language}):t.key?e.path?r=e:(r=t.key,i={childDepth:t.childDepth||1,order:t.order,language:t.language}):r=e,"string"==typeof r?this.getNodeByKey(n.__assign({},i,{key:r})):r.hasChildren?r.children&&r.children.length>0?Promise.resolve(n.__assign({},r)):this.getNodeByKey(n.__assign({},i,{key:r.key})):Promise.resolve(n.__assign({},r,{children:[]}))},TaxonomyOperations}()},function(e,t,r){"use strict";r.d(t,"a",function(){return n});var n=function(){function ClientConfig(e,t){for(this.currentConfig=e,this.previousConfig=t,this.rootUrl=null,this.accessToken=null,this.clientType=null,this.clientDetails=null,this.defaultHeaders=null,this.projectId=null,this.language=null,this.versionStatus="published",this.pageSize=25,this.responseHandler=null,this.fetchFn=null,this.rootUrl=this.getValue(function(e){return e.rootUrl}),this.accessToken=this.getValue(function(e){return e.accessToken}),this.clientType=this.getValue(function(e){return e.clientType}),this.clientDetails=this.getValue(function(e){return e.clientDetails}),this.defaultHeaders=this.getValue(function(e){return e.defaultHeaders}),this.projectId=this.getValue(function(e){return e.projectId}),this.language=this.getValue(function(e){return e.language}),this.versionStatus=this.getValue(function(e){return e.versionStatus}),this.pageSize=this.getValue(function(e){return e.pageSize}),this.responseHandler=this.getValue(function(e){return e.responseHandler}),this.fetchFn=this.getValue(function(e){return e.fetchFn});this.rootUrl&&"/"===this.rootUrl.substr(this.rootUrl.length-1,1);)this.rootUrl=this.rootUrl.substr(0,this.rootUrl.length-1)}return ClientConfig.prototype.toParams=function(){return{rootUrl:this.rootUrl,accessToken:this.accessToken,clientType:this.clientType,clientDetails:this.clientDetails,defaultHeaders:this.defaultHeaders,language:this.language,versionStatus:this.versionStatus,projectId:this.projectId,pageIndex:0,pageSize:this.pageSize,responseHandler:this.responseHandler}},ClientConfig.prototype.getValue=function(e){var t=null;return this.currentConfig&&(t=e(this.currentConfig)),this.previousConfig&&!t&&(t=e(this.previousConfig)),t||e(this)},ClientConfig}()},function(e,t,r){"use strict";r.d(t,"a",function(){return p});var n=r(0),i=r(1),s=(r.n(i),{language:i.defaultMapperForLanguage,versionStatus:i.defaultMapperForPublishedVersionStatus,entryFields:function(e){return e&&e.length>0?e:null},entryLinkDepth:function(e){return e&&e>0?e:null},entryFieldLinkDepths:function(e){return Object.keys(e||{}).length>0?JSON.stringify(e):null}}),o=n.__assign({},s,{depth:function(e){return e&&e>0?e:null}}),a=n.__assign({},o,{allowPartialMatch:function(e){return!!e||null}}),u=n.__assign({},s,{entryId:function(e){return e||null}}),l=n.__assign({},o,{startLevel:function(e){return e&&e>0?e:null}}),c=n.__assign({},s,{startLevel:function(e){return e&&e>0?e:null}}),p=function(){function NodeOperations(e,t){if(this.httpClient=e,this.contensisClient=t,!this.httpClient||!this.contensisClient)throw new Error("The class was not initialised correctly.")}return NodeOperations.prototype.getRoot=function(e){var t=this,r=i.UrlBuilder.create("/api/delivery/projects/:projectId/nodes/root",{language:null,depth:null,versionStatus:null,entryFields:null,entryLinkDepth:null,entryFieldLinkDepths:null}).addOptions(e).setParams(this.contensisClient.getParams()).addMappers(o).toUrl();return this.contensisClient.ensureIsAuthorized().then(function(){return t.httpClient.request(r,{headers:t.contensisClient.getHeaders()})})},NodeOperations.prototype.get=function(e){var t=this;if(Object(i.isString)(e)&&!e||"object"==typeof e&&(null===e||!e.id&&!e.path))throw new Error("A valid node id or path needs to be specified.");var r=Object(i.isString)(e)&&e.startsWith("/")||!!e&&!!e.path,n=r?"/api/delivery/projects/:projectId/nodes:path":"/api/delivery/projects/:projectId/nodes/:id",s=i.UrlBuilder.create(n,{language:null,depth:null,versionStatus:null,entryFields:null,entryLinkDepth:null,entryFieldLinkDepths:null,allowPartialMatch:null}).addOptions(e,r?"path":"id").setParams(this.contensisClient.getParams()).addMappers(a).toUrl();return this.contensisClient.ensureIsAuthorized().then(function(){return t.httpClient.request(s,{headers:t.contensisClient.getHeaders()})})},NodeOperations.prototype.getByEntry=function(e){var t=this,r="A valid entry id needs to be specified.";if(Object(i.isString)(e)&&!e)throw new Error(r);if("object"==typeof e){if(null===e)throw new Error(r);if(!(e.entryId||e.entry&&e.entry.sys&&e.entry.sys.id||e.sys&&e.sys.id))throw new Error(r)}var n=null;Object(i.isString)(e)?n=e:"object"==typeof e&&(e.sys&&(n=e.sys.id),e.entry&&e.entry.sys&&(n=e.entry.sys.id));var s=i.UrlBuilder.create("/api/delivery/projects/:projectId/nodes/",{entryId:null,language:null,versionStatus:null,entryFields:null,entryLinkDepth:null,entryFieldLinkDepths:null}).addOptions(n,"entryId").addOptions(e).setParams(this.contensisClient.getParams()).addMappers(u).toUrl();return this.contensisClient.ensureIsAuthorized().then(function(){return t.httpClient.request(s,{headers:t.contensisClient.getHeaders()})})},NodeOperations.prototype.getChildren=function(e){var t=this;this.validateNodeId(e);var r=this.getNodeIdFromOptions(e),n=i.UrlBuilder.create("/api/delivery/projects/:projectId/nodes/:id/children",{language:null,versionStatus:null,entryFields:null,entryLinkDepth:null,entryFieldLinkDepths:null}).addOptions(r,"id").addOptions(e).setParams(this.contensisClient.getParams()).addMappers(s).toUrl();return this.contensisClient.ensureIsAuthorized().then(function(){return t.httpClient.request(n,{headers:t.contensisClient.getHeaders()})})},NodeOperations.prototype.getParent=function(e){var t=this;this.validateNodeId(e);var r=this.getNodeIdFromOptions(e),n=i.UrlBuilder.create("/api/delivery/projects/:projectId/nodes/:id/parent",{language:null,depth:null,versionStatus:null,entryFields:null,entryLinkDepth:null,entryFieldLinkDepths:null}).addOptions(r,"id").addOptions(e).setParams(this.contensisClient.getParams()).addMappers(o).toUrl();return this.contensisClient.ensureIsAuthorized().then(function(){return t.httpClient.request(n,{headers:t.contensisClient.getHeaders()})})},NodeOperations.prototype.getAncestorAtLevel=function(e){var t=this;this.validateNodeId(e);var r=this.getNodeIdFromOptions(e),n=i.UrlBuilder.create("/api/delivery/projects/:projectId/nodes/:id/ancestors",{language:null,startLevel:null,depth:null,versionStatus:null,entryFields:null,entryLinkDepth:null,entryFieldLinkDepths:null}).addOptions(r,"id").addOptions(e).setParams(this.contensisClient.getParams()).addMappers(l).toUrl();return this.contensisClient.ensureIsAuthorized().then(function(){return t.httpClient.request(n,{headers:t.contensisClient.getHeaders()})})},NodeOperations.prototype.getAncestors=function(e){var t=this;this.validateNodeId(e);var r=this.getNodeIdFromOptions(e),n=i.UrlBuilder.create("/api/delivery/projects/:projectId/nodes/:id/ancestors",{language:null,startLevel:null,versionStatus:null,entryFields:null,entryLinkDepth:null,entryFieldLinkDepths:null}).addOptions(r,"id").addOptions(e).setParams(this.contensisClient.getParams()).addMappers(c).toUrl();return this.contensisClient.ensureIsAuthorized().then(function(){return t.httpClient.request(n,{headers:t.contensisClient.getHeaders()})})},NodeOperations.prototype.getSiblings=function(e){var t=this;this.validateNodeId(e);var r=this.getNodeIdFromOptions(e),n=i.UrlBuilder.create("/api/delivery/projects/:projectId/nodes/:id/siblings",{language:null,versionStatus:null,entryFields:null,entryLinkDepth:null,entryFieldLinkDepths:null}).addOptions(r,"id").addOptions(e).setParams(this.contensisClient.getParams()).addMappers(s).toUrl();return this.contensisClient.ensureIsAuthorized().then(function(){return t.httpClient.request(n,{headers:t.contensisClient.getHeaders()})})},NodeOperations.prototype.validateNodeId=function(e){var t="A valid node id needs to be specified.";if(Object(i.isString)(e)&&!e)throw new Error(t);if("object"==typeof e){if(null===e)throw new Error(t);if(!(e.id||e.node&&e.node.id))throw new Error(t)}},NodeOperations.prototype.getNodeIdFromOptions=function(e){var t=null;return Object(i.isString)(e)?t=e:"object"==typeof e&&(e.id?t=e.id:e.node&&(t=e.node.id)),t},NodeOperations}()},function(e,t,r){"use strict";function getAllScopes(){return[s,i].concat(n).join(" ")}function getResourcesScopes(){return n.join(" ")}t.a=getAllScopes,t.b=getResourcesScopes;var n=["Security_Administrator","ContentType_Read","ContentType_Write","ContentType_Delete","Entry_Read","Entry_Write","Entry_Delete","Project_Read","Project_Write","Project_Delete","Workflow_Administrator"],i="offline_access",s="openid"},function(e,t){var r="undefined"!=typeof self?self:this,n=function(){function F(){this.fetch=!1,this.DOMException=r.DOMException}return F.prototype=r,new F}();!function(e){!function(t){function isDataView(e){return e&&DataView.prototype.isPrototypeOf(e)}function normalizeName(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 normalizeValue(e){return"string"!=typeof e&&(e=String(e)),e}function iteratorFor(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r.iterable&&(t[Symbol.iterator]=function(){return t}),t}function Headers(e){this.map={},e instanceof Headers?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 consumed(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function fileReaderReady(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function readBlobAsArrayBuffer(e){var t=new FileReader,r=fileReaderReady(t);return t.readAsArrayBuffer(e),r}function readBlobAsText(e){var t=new FileReader,r=fileReaderReady(t);return t.readAsText(e),r}function readArrayBufferAsText(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 bufferClone(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function Body(){return this.bodyUsed=!1,this._initBody=function(e){this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:r.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:r.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():r.arrayBuffer&&r.blob&&isDataView(e)?(this._bodyArrayBuffer=bufferClone(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):r.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||i(e))?this._bodyArrayBuffer=bufferClone(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):r.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r.blob&&(this.blob=function(){var e=consumed(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?consumed(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(readBlobAsArrayBuffer)}),this.text=function(){var e=consumed(this);if(e)return e;if(this._bodyBlob)return readBlobAsText(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},r.formData&&(this.formData=function(){return this.text().then(decode)}),this.json=function(){return this.text().then(JSON.parse)},this}function normalizeMethod(e){var t=e.toUpperCase();return s.indexOf(t)>-1?t:e}function Request(e,t){t=t||{};var r=t.body;if(e instanceof Request){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new Headers(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 Headers(t.headers)),this.method=normalizeMethod(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 decode(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}}),t}function parseHeaders(e){var t=new Headers;return e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}}),t}function Response(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 Headers(t.headers),this.url=t.url||"",this._initBody(e)}function fetch(e,n){return new Promise(function(i,s){function abortXhr(){a.abort()}var o=new Request(e,n);if(o.signal&&o.signal.aborted)return s(new t.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;a.onload=function(){var e={status:a.status,statusText:a.statusText,headers:parseHeaders(a.getAllResponseHeaders()||"")};e.url="responseURL"in a?a.responseURL:e.headers.get("X-Request-URL");var t="response"in a?a.response:a.responseText;i(new Response(t,e))},a.onerror=function(){s(new TypeError("Network request failed"))},a.ontimeout=function(){s(new TypeError("Network request failed"))},a.onabort=function(){s(new t.DOMException("Aborted","AbortError"))},a.open(o.method,o.url,!0),"include"===o.credentials?a.withCredentials=!0:"omit"===o.credentials&&(a.withCredentials=!1),"responseType"in a&&r.blob&&(a.responseType="blob"),o.headers.forEach(function(e,t){a.setRequestHeader(t,e)}),o.signal&&(o.signal.addEventListener("abort",abortXhr),a.onreadystatechange=function(){4===a.readyState&&o.signal.removeEventListener("abort",abortXhr)}),a.send(void 0===o._bodyInit?null:o._bodyInit)})}var r={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(r.arrayBuffer)var n=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],i=ArrayBuffer.isView||function(e){return e&&n.indexOf(Object.prototype.toString.call(e))>-1};Headers.prototype.append=function(e,t){e=normalizeName(e),t=normalizeValue(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},Headers.prototype.delete=function(e){delete this.map[normalizeName(e)]},Headers.prototype.get=function(e){return e=normalizeName(e),this.has(e)?this.map[e]:null},Headers.prototype.has=function(e){return this.map.hasOwnProperty(normalizeName(e))},Headers.prototype.set=function(e,t){this.map[normalizeName(e)]=normalizeValue(t)},Headers.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},Headers.prototype.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),iteratorFor(e)},Headers.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),iteratorFor(e)},Headers.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),iteratorFor(e)},r.iterable&&(Headers.prototype[Symbol.iterator]=Headers.prototype.entries);var s=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];Request.prototype.clone=function(){return new Request(this,{body:this._bodyInit})},Body.call(Request.prototype),Body.call(Response.prototype),Response.prototype.clone=function(){return new Response(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Headers(this.headers),url:this.url})},Response.error=function(){var e=new Response(null,{status:0,statusText:""});return e.type="error",e};var o=[301,302,303,307,308];Response.redirect=function(e,t){if(-1===o.indexOf(t))throw new RangeError("Invalid status code");return new Response(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}fetch.polyfill=!0,e.fetch||(e.fetch=fetch,e.Headers=Headers,e.Request=Request,e.Response=Response),t.Headers=Headers,t.Request=Request,t.Response=Response,t.fetch=fetch,Object.defineProperty(t,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;t=i.fetch,t.default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t}]); | ||
//# sourceMappingURL=zengenti.contensis-client.js.map |
@@ -7,2 +7,10 @@ # Changelog | ||
## [1.5.0] - 2024-10-10 | ||
### Added | ||
- added additional *Entry* types | ||
### Changed | ||
- refactor various *Entry* types based on PS usage | ||
- updated project README | ||
## [1.4.1] - 2024-04-26 | ||
@@ -9,0 +17,0 @@ ### Fixed |
@@ -0,13 +1,18 @@ | ||
import { AssetSys } from './AssetSys'; | ||
import { Image } from './EntryFields'; | ||
import { EntrySys } from './EntrySys'; | ||
export interface Entry { | ||
sys: EntrySys; | ||
[key: string]: any; | ||
entryTitle?: string; | ||
interface BaseEntryFields { | ||
entryTitle: string; | ||
entryDescription?: string; | ||
entryThumbnail?: EntryThumbnail; | ||
entryThumbnail?: Image; | ||
} | ||
export interface EntryThumbnail { | ||
altText?: string; | ||
caption?: string; | ||
asset?: Entry; | ||
export interface Entry extends StrictEntry { | ||
[key: string]: any; | ||
} | ||
export interface EntryAsset extends BaseEntryFields { | ||
sys: AssetSys; | ||
} | ||
export interface StrictEntry extends BaseEntryFields { | ||
sys: EntrySys; | ||
} | ||
export {}; |
@@ -1,24 +0,9 @@ | ||
import { VersionInfo } from 'contensis-core-api'; | ||
import { Workflow } from './Workflow'; | ||
export interface EntrySys { | ||
import { BaseSys } from './BaseSys'; | ||
import { EntryMetadata } from './EntryMetadata'; | ||
export interface EntrySys extends BaseSys<'entry'> { | ||
allUris: string[]; | ||
availableLanguages?: string[]; | ||
contentTypeId: string; | ||
dataFormat: string; | ||
id: string; | ||
isPublished?: boolean; | ||
language: string; | ||
owner?: string; | ||
projectId?: string; | ||
properties?: { | ||
metadata: EntryMetadata; | ||
properties: { | ||
[key: string]: any; | ||
width?: number; | ||
height?: number; | ||
fileSize?: number; | ||
}; | ||
slug?: string; | ||
uri: string; | ||
version?: VersionInfo; | ||
versionStatus: 'published' | 'latest'; | ||
workflow?: Workflow; | ||
} |
@@ -0,1 +1,3 @@ | ||
export * from './AssetSys'; | ||
export * from './BaseSys'; | ||
export * from './ClientConfigFactory'; | ||
@@ -7,4 +9,7 @@ export * from './ClientStatic'; | ||
export * from './Entry'; | ||
export * from './EntryFields'; | ||
export * from './EntryGetOptions'; | ||
export * from './EntryListOptions'; | ||
export * from './EntryMetadata'; | ||
export * from './EntryMetadataClassic'; | ||
export * from './EntrySys'; | ||
@@ -11,0 +16,0 @@ export * from './IContentTypeOperations'; |
import { VersionInfo } from 'contensis-core-api'; | ||
import { Entry } from './Entry'; | ||
import { Entry as LooseEntry, StrictEntry } from './Entry'; | ||
export declare type NodeVersionInfo = Pick<VersionInfo, 'versionNo'>; | ||
export interface Node { | ||
export interface Node<TEntry extends StrictEntry = LooseEntry> { | ||
id: string; | ||
@@ -14,8 +14,6 @@ parentId?: string; | ||
children?: Node[]; | ||
entry?: Entry; | ||
entry?: TEntry; | ||
isCanonical: boolean; | ||
version: NodeVersionInfo; | ||
includeInMenu: boolean; | ||
title: string; | ||
entryId?: string; | ||
} |
{ | ||
"name": "contensis-delivery-api", | ||
"version": "1.4.1", | ||
"description": "Contensis Javascript Delivery API", | ||
"version": "1.5.0", | ||
"description": "Client for retrieving content using the read-only Contensis Delivery API", | ||
"engines": { | ||
@@ -31,3 +31,3 @@ "node": ">=14" | ||
}, | ||
"homepage": "https://github.com/contensis/contensis-delivery-api#readme", | ||
"homepage": "https://www.contensis.com/help-and-docs/apis/delivery-js", | ||
"devDependencies": { | ||
@@ -55,3 +55,3 @@ "@types/jasmine": "3.6.2", | ||
"dependencies": { | ||
"contensis-core-api": "1.1.0", | ||
"contensis-core-api": "^1.1.2", | ||
"cross-fetch": "^3.1.5", | ||
@@ -67,5 +67,11 @@ "es6-promise": "^4.2.6", | ||
"contensis", | ||
"cms", | ||
"dxp", | ||
"content", | ||
"delivery", | ||
"api" | ||
"api", | ||
"js", | ||
"library", | ||
"client" | ||
] | ||
} |
218
README.md
@@ -1,78 +0,143 @@ | ||
# contensis-delivery-api [![NPM version](https://img.shields.io/npm/v/contensis-delivery-api.svg?style=flat)](https://www.npmjs.com/package/contensis-delivery-api) | ||
Contensis JavaScript Delivery API implementation written in TypeScript. | ||
# [![Contensis](https://github.com/contensis/cli/raw/refs/heads/main/assets/contensis-logo--tiny.svg)](https://www.contensis.com) contensis-delivery-api [![TypeScript](https://img.shields.io/badge/TypeScript-007ACC?style=flat&logo=typescript&logoColor=white)](https://www.typescriptlang.org/) [![NPM version](https://img.shields.io/npm/v/contensis-delivery-api.svg?style=flat)](https://www.npmjs.com/package/contensis-delivery-api) | ||
This allows the querying and retrieval of entries, content types and projects in JavaScript. | ||
[![JavaScript](https://img.shields.io/badge/JavaScript-323330?style=for-the-badge&logo=javascript&logoColor=F7DF1E)](https://developer.mozilla.org/en-US/docs/Web/JavaScript) | ||
[![TypeScript](https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge&logo=typescript&logoColor=white)](https://www.typescriptlang.org/) | ||
[![Node.js](https://img.shields.io/badge/Node%20js-339933?style=for-the-badge&logo=nodedotjs&logoColor=white)](https://nodejs.org/en) | ||
It can be used in any ES5 compatible project. | ||
* JavaScript/TypeScript code running in a browser | ||
* JavaScript/TypeScript code running in Node.js | ||
* Angular | ||
* React | ||
* React Native | ||
* NativeScript | ||
* Node.js | ||
* Express | ||
[![Angular](https://img.shields.io/badge/Angular-DD0031?style=for-the-badge&logo=angular&logoColor=white)](https://angular.dev/) [![Electron](https://img.shields.io/badge/Electron-2B2E3A?style=for-the-badge&logo=electron&logoColor=9FEAF9)](https://electronjs.org/) [![Express.js](https://img.shields.io/badge/Express%20js-000000?style=for-the-badge&logo=express&logoColor=white)](https://expressjs.com/) [![React](https://img.shields.io/badge/React-20232A?style=for-the-badge&logo=react&logoColor=61DAFB)](https://react.dev/) [![React Native](https://img.shields.io/badge/React_Native-20232A?style=for-the-badge&logo=react&logoColor=61DAFB)](https://reactnative.dev/) [![Vue.js](https://img.shields.io/badge/Vue%20js-35495E?style=for-the-badge&logo=vuedotjs&logoColor=4FC08D)](https://vuejs.org/) | ||
The *[contensis-delivery-api-examples](https://github.com/contensis/contensis-delivery-api-examples)* repo contains Express, React and Angular test applications, as well as a Node.js nodes api extended example. | ||
[![Contensis](https://img.shields.io/badge/Contensis-00304d?style=for-the-badge&logoColor=white&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ii02IDAgNjIgNjIiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiPjxwYXRoIGZpbGw9IiMzN0JGQTciIGQ9Im00Ny43NjIgMTguNDk0LTMuNjEyLTIuMDZjLjM1OCAxLjY1NS42MzEgMy4yOS43OTkgNC44NTkuMTQ0IDEuMzUzLjM1OCA0LjMwOS4zNTggNC40NXYxOS45NzVjMCAuNDI3LS41MTggMS4zMTEtLjg5MiAxLjUyNkwyNi44OTMgNTcuMjNjLS4xMDkuMDYxLS40NDguMTYtLjg5MS4xNi0uNDQ1IDAtLjc4NC0uMDk5LS44OTItLjE2TDcuNTg2IDQ3LjI0NGMtLjM3Ni0uMjE1LS44OTItMS4wOTktLjg5Mi0xLjUyNlYyNS43NDRjMC0uNDI4LjUxOC0xLjMxMy44OTItMS41MjVsOS43MzEtNS41NDZjMS4xMzQtMS41NDUgMi40MzMtMy4xODkgMy44MjctNC45NTEgMS41NDYtMS45NTUgMy4xODgtNC4wMzYgNC44MzMtNi4yNTgtMS41NDIuMDAzLTMuMDM3LjM3NC00LjIxNiAxLjA0NUw0LjIzOCAxOC40OTdDMS43ODMgMTkuODk1IDAgMjIuOTQ1IDAgMjUuNzQ0djE5Ljk3NGMwIDIuNzk5IDEuNzgzIDUuODQ5IDQuMjM4IDcuMjQ5bDE3LjUyMyA5Ljk4OGMxLjE4Mi42NzUgMi42ODggMS4wNDUgNC4yNCAxLjA0NSAxLjU1IDAgMy4wNTQtLjM3IDQuMjM4LTEuMDQ2bDE3LjUyMy05Ljk4N2MyLjQ1Ni0xLjQgNC4yMzgtNC40NSA0LjIzOC03LjI0OFYyNS43NDRjMC0yLjgtMS43ODItNS44NDgtNC4yMzgtNy4yNVoiLz48cGF0aCBmaWxsPSIjMzdCRkE3IiBkPSJNMjEuNTcxIDUyLjcxM2M1LjA5NC03LjQzOCA3Ljg2Mi0xOC43MDkgOS4xODQtMjUuNzc2LTMuMzQ4IDYuMTYtOS4yMjkgMTUuNjY2LTE2LjQgMjEuNjc4LS4wMzgtLjA2My0uMDYyLS4wMzkgNy4yMTYgNC4wOThaIi8+PHBhdGggZmlsbD0iIzM3QkZBNyIgZD0iTTMzLjIwMi40MTFDMjUuNzQ1IDEzLjAyIDE1LjcyMyAyMS43MjIgMTUuMDkxIDI3LjQ5Yy0uNTkgNS4zODggMS4zNiA5LjgzNyA0LjU1NCAxMi42MDRhODEuMDg2IDgxLjA4NiAwIDAgMCAzLjYxNC00Ljg4Yy0uMDU4LTEuMTE0LS40ODItOS44MTUuNDQtMTIuMjY0LjUyNyAzLjc3OCAxLjYxNiA3LjI2NSAyLjAyIDguNDgzYTExMy45NDggMTEzLjk0OCAwIDAgMCAyLjc0Ni00LjY4NWMtLjA4My0yLjIxMy0uMzEzLTEwLjAwOC40Ni0xMS43OTQuMjA1IDIuNTc1IDEuMTYzIDUuODUyIDEuNzM4IDcuNjM3Ljc2NC0xLjUyMyAxLjE4My0yLjQ1IDEuMTkzLTIuNDcybDIuNzA1LTYuMDE2LS43MSA2LjU0NWMtLjAwNC4wMzQtLjI0MiAyLjE5My0uODIgNS40NzggMS41ODYtMS4yODkgNC4xMDQtMy40NTcgNS4zMjgtNS4xNi4xMDUgMi4wNTQtNC40NDQgNy41NTYtNi4xOTMgOS41OTQtLjE4My44NDktLjM4MiAxLjczLS42IDIuNjM1LS4xNTQuNjQtLjMxMiAxLjI3LS40NzMgMS44OSAxLjUxNy0uODQyIDQuOTkyLTIuODYgNi45MzItNC42OTctLjI5NCAyLjA5NS02LjQ2IDcuNDE5LTguMDkgOC43OTRhODAuMTYxIDgwLjE2MSAwIDAgMS0xLjMzNiAzLjk4YzMuNzQ0LS4yMTMgNy42NzYtMi4xIDEwLjk2OC02LjEzNkM0OS40MDcgMjQuOTYgMzUuNjcyLTMuNzY1IDMzLjIwMi40MTFaIi8+PC9zdmc+)](https://www.contensis.com) | ||
[![Contensis Slack](https://img.shields.io/badge/Slack-4A154B?style=for-the-badge&logo=slack&logoColor=white)](https://contensis.slack.com) | ||
Create a Contensis client that allows you to query and retrieve entries, site view nodes, content types and projects. It can be used in all your JavaScript / TypeScript projects, whether it runs in a browser, Node.js app, or both. | ||
[**Explore the docs on contensis.com**](https://www.contensis.com/help-and-docs/apis/delivery-js) and the [contensis-delivery-api-examples](https://github.com/contensis/contensis-delivery-api-examples) repository containing Express.js, React and Angular test applications, as well as an extended example using nodes api in a Node.js project. | ||
Use with Contensis version 12.0 and above. For Contensis 11.3 support use [this version](https://github.com/contensis/contensis-delivery-api/tree/release/1.0) | [npm](https://www.npmjs.com/package/contensis-delivery-api/v/1.0.0). This library requires Node.js 14 or above. | ||
## Installation | ||
The Contensis JavaScript Delivery API can be installed using npm. | ||
Install the package to your project `dependencies` using npm, or your preferred Node.js package manager. | ||
**npm install contensis-delivery-api** | ||
```shell | ||
npm install --save contensis-delivery-api | ||
``` | ||
## Contensis support | ||
This version supports Contensis releases from 12.0 and above. For Contensis 11.3 support use [this version](https://github.com/contensis/contensis-delivery-api/tree/release/1.0) . | ||
## Usage | ||
## Examples | ||
Follow the examples with the preferred coding style that best suits your project | ||
Using ES2015 async/await | ||
### Create a client | ||
```js | ||
import { Client } from 'contensis-delivery-api'; | ||
All of the delivery methods are available under the `client` instance returned by `Client.create(...)` | ||
let contensisConfig = { | ||
rootUrl: 'https://my-cms.com', | ||
accessToken: 'MY_DELIVERY_API_ACCESS_TOKEN', | ||
projectId: 'MY_PROJECT_ID', | ||
language: 'en-GB', | ||
versionStatus: 'published', | ||
pageSize: 50 | ||
Use the provided intellisense to guide you where it is available | ||
```typescript | ||
// Using TypeScript, or ES Module syntax | ||
import { Client } from "contensis-delivery-api"; | ||
const client = Client.create({ | ||
rootUrl: "https://my-cms.com", | ||
accessToken: "DELIVERY_API_ACCESS_TOKEN", | ||
projectId: "website", | ||
language: "en-GB", | ||
versionStatus: "published", | ||
}); | ||
``` | ||
```cjs | ||
// Using Common JS syntax | ||
const Client = require("contensis-delivery-api").Client; | ||
const client = Client.create({ | ||
rootUrl: "https://my-cms.com", | ||
accessToken: "DELIVERY_API_ACCESS_TOKEN", | ||
projectId: "website", | ||
language: "en-GB", | ||
versionStatus: "published", | ||
}); | ||
``` | ||
### Get a list of entries | ||
Reusing the `client` instance we created above | ||
```typescript | ||
// Using TypeScript, or ES Module syntax | ||
const loadMovies = async () => { | ||
const movieList = await client.entries.list({ | ||
contentTypeId: "movie", | ||
pageOptions: { pageIndex: 0, pageSize: 10 }, | ||
order: ["-releaseDate"], | ||
}); | ||
for (const movie of movieList.items) { | ||
console.log(movie); | ||
} | ||
}; | ||
async function loadMovies() { | ||
let client = Client.create(contensisConfig); | ||
let movieList = await client.entries.list({ | ||
contentTypeId: 'movie', | ||
pageOptions: { pageIndex: 0, pageSize: 10 }, | ||
orderBy: ['-releaseDate'] | ||
}); | ||
console.log(movieList.items); | ||
} | ||
loadMovies(); | ||
``` | ||
### Create a client config and get a list of entries | ||
Keep a common client configuration and create the delivery client when you need it | ||
```typescript | ||
// Using async / await syntax (avoiding callbacks) | ||
// Import the additional "Config" type when using TypeScript | ||
import { Client, Config } from "contensis-delivery-api"; | ||
// Remove ": Config" annotation when NOT using TypeScript | ||
const contensisConfig: Config = { | ||
rootUrl: "https://my-cms.com", | ||
accessToken: "DELIVERY_API_ACCESS_TOKEN", | ||
projectId: "website", | ||
language: "en-GB", | ||
versionStatus: "published", | ||
}; | ||
const loadMovies = async () => { | ||
const client = Client.create(contensisConfig); | ||
const movieList = await client.entries.list({ | ||
contentTypeId: "movie", | ||
pageOptions: { pageIndex: 0, pageSize: 10 }, | ||
order: ["-releaseDate"], | ||
}); | ||
for (const movie of movieList.items) { | ||
console.log(movie); | ||
} | ||
}; | ||
loadMovies(); | ||
``` | ||
Using Promises | ||
```js | ||
import { Client } from 'contensis-delivery-api'; | ||
```typescript | ||
// Using Promises and callbacks | ||
let contensisConfig = { | ||
rootUrl: 'https://my-cms.com', | ||
accessToken: 'MY_DELIVERY_API_ACCESS_TOKEN', | ||
projectId: 'MY_PROJECT_ID', | ||
language: 'en-GB', | ||
versionStatus: 'published', | ||
pageSize: 50 | ||
import { Client } from "contensis-delivery-api"; | ||
const contensisConfig = { | ||
rootUrl: "https://my-cms.com", | ||
accessToken: "DELIVERY_API_ACCESS_TOKEN", | ||
projectId: "website", | ||
language: "en-GB", | ||
versionStatus: "published", | ||
}; | ||
function loadMovies() { | ||
let client = Client.create(contensisConfig); | ||
client.entries.list({ | ||
contentTypeId: 'movie', | ||
pageOptions: { pageIndex: 0, pageSize: 10 }, | ||
orderBy: ['-releaseDate'] | ||
}).then(movieList => { | ||
console.log(movieList.items); | ||
}); | ||
const client = Client.create(contensisConfig); | ||
client.entries | ||
.list({ | ||
contentTypeId: "movie", | ||
pageOptions: { pageIndex: 0, pageSize: 10 }, | ||
order: ["-releaseDate"], | ||
}) | ||
.then((movieList) => { | ||
console.log(movieList.items); | ||
}); | ||
} | ||
@@ -83,15 +148,38 @@ | ||
## Documentation | ||
_For more examples refer to our [documentation on contensis.com](https://www.contensis.com/help-and-docs/apis/delivery-js)_ | ||
Read our [documentation on the Contensis Javascript Delivery API](https://developer.zengenti.com/contensis/api/delivery/js/) to learn of all it's features. | ||
## Fetch API | ||
## Browser support | ||
This library relies on the *fetch API* being available at runtime. In modern browsers *fetch* is available natively, and a polyfill is provided for older browsers. | ||
The library build that targets browsers can be found in the *bundle* folder. | ||
This library uses the `fetch` API and relies on it being available at runtime. | ||
## Node.js support | ||
The library supports Node.js 8 and above. | ||
When using this library in Node.js you need to add the *node-fetch* npm package as a dependecy and ensure *fetch* is registered as a global function: | ||
```js | ||
global.fetch = require("node-fetch"); | ||
### Browser support | ||
In modern browsers `fetch` is available natively, a polyfill is provided for older browsers. | ||
The build of the library that targets browsers can be found in the `bundle` folder. | ||
### Node.js support | ||
When using this library in Node.js the `fetch` API is already polyfilled with [`cross-fetch`](https://www.npmjs.com/package/cross-fetch) package (which uses [`node-fetch`](https://www.npmjs.com/package/node-fetch) when used with a Node.js runtime). | ||
Node.js [version 16](https://nodejs.org/docs/latest-v16.x/api/globals.html#fetch) introduced experimental support for a native global `fetch` API and shipped as standard with Node.js versions [18](https://nodejs.org/docs/latest-v18.x/api/globals.html#fetch) and [20](https://nodejs.org/docs/latest-v20.x/api/globals.html#fetch). The global `fetch` support in Node.js [version 21](https://nodejs.org/docs/latest-v21.x/api/globals.html#fetch) and greater is marked as stable. | ||
### Use your own fetch | ||
You can override the built-in fetch API by providing your own `fetchFn` method when creating the Client. | ||
Method calls that require fetch invoked from this client instance will be made using your chosen API. | ||
```typescript | ||
import { Client } from "contensis-delivery-api"; | ||
import enterpriseFetch from "enterprise-fetch"; | ||
const client = Client.create({ | ||
rootUrl: "https://my-cms.com", | ||
accessToken: "DELIVERY_API_ACCESS_TOKEN", | ||
projectId: "website", | ||
language: "en-GB", | ||
versionStatus: "published", | ||
fetchFn: enterpriseFetch, | ||
}); | ||
``` |
@@ -0,16 +1,22 @@ | ||
import { AssetSys } from './AssetSys'; | ||
import { Image } from './EntryFields'; | ||
import { EntrySys } from './EntrySys'; | ||
export interface Entry { | ||
sys: EntrySys; | ||
interface BaseEntryFields { | ||
entryTitle: string; | ||
entryDescription?: string; | ||
entryThumbnail?: Image; | ||
} | ||
export interface Entry extends StrictEntry { | ||
[key: string]: any; | ||
} | ||
entryTitle?: string; | ||
entryDescription?: string; | ||
entryThumbnail?: EntryThumbnail; | ||
export interface EntryAsset extends BaseEntryFields { | ||
sys: AssetSys; | ||
} | ||
export interface EntryThumbnail { | ||
altText?: string; | ||
caption?: string; | ||
asset?: Entry; | ||
export interface StrictEntry extends BaseEntryFields { | ||
sys: EntrySys; | ||
} | ||
@@ -1,25 +0,8 @@ | ||
import { VersionInfo } from 'contensis-core-api'; | ||
import { Workflow } from './Workflow'; | ||
import { BaseSys } from './BaseSys'; | ||
import { EntryMetadata } from './EntryMetadata'; | ||
export interface EntrySys { | ||
export interface EntrySys extends BaseSys<'entry'> { | ||
allUris: string[]; | ||
availableLanguages?: string[]; | ||
contentTypeId: string; | ||
dataFormat: string; | ||
id: string; | ||
isPublished?: boolean; | ||
language: string; | ||
owner?: string; | ||
projectId?: string; | ||
properties?: { | ||
[key: string]: any; | ||
width?: number; | ||
height?: number; | ||
fileSize?: number; | ||
}; | ||
slug?: string; | ||
uri: string; | ||
version?: VersionInfo; | ||
versionStatus: 'published' | 'latest'; | ||
workflow?: Workflow; | ||
metadata: EntryMetadata; | ||
properties: { [key: string]: any }; | ||
} |
@@ -0,1 +1,3 @@ | ||
export * from './AssetSys'; | ||
export * from './BaseSys'; | ||
export * from './ClientConfigFactory'; | ||
@@ -7,4 +9,7 @@ export * from './ClientStatic'; | ||
export * from './Entry'; | ||
export * from './EntryFields'; | ||
export * from './EntryGetOptions'; | ||
export * from './EntryListOptions'; | ||
export * from './EntryMetadata'; | ||
export * from './EntryMetadataClassic'; | ||
export * from './EntrySys'; | ||
@@ -11,0 +16,0 @@ export * from './IContentTypeOperations'; |
import { VersionInfo } from 'contensis-core-api'; | ||
import { Entry } from './Entry'; | ||
import { Entry as LooseEntry, StrictEntry } from './Entry'; | ||
export type NodeVersionInfo = Pick<VersionInfo, 'versionNo'>; | ||
export interface Node { | ||
export interface Node<TEntry extends StrictEntry = LooseEntry> { | ||
id: string; | ||
@@ -16,10 +16,6 @@ parentId?: string; | ||
children?: Node[]; | ||
entry?: Entry; | ||
entry?: TEntry; | ||
isCanonical: boolean; | ||
version: NodeVersionInfo; | ||
includeInMenu: boolean; | ||
// these are management api elements | ||
title: string; | ||
entryId?: string; | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
1068717
336
14062
185
+ Addedcontensis-core-api@1.1.2(transitive)
- Removedcontensis-core-api@1.1.0(transitive)
Updatedcontensis-core-api@^1.1.2