@janbox/contentful-marketplace-sdk 1.0.8 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +10 -10
- package/dist/index.js +21 -21
- package/dist/types/content-model.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var we=Function.prototype.toString,C=Object.create,Se=Object.prototype.toString,Ce=(function(){function e(){this._keys=[],this._values=[]}return e.prototype.has=function(t){return!!~this._keys.indexOf(t)},e.prototype.get=function(t){return this._values[this._keys.indexOf(t)]},e.prototype.set=function(t,r){this._keys.push(t),this._values.push(r)},e})();function Oe(){return new Ce}function Ae(){return new WeakMap}var ke=typeof WeakMap<"u"?Ae:Oe;function B(e){if(!e)return C(null);var t=e.constructor;if(t===Object)return e===Object.prototype?{}:C(e);if(t&&~we.call(t).indexOf("[native code]"))try{return new t}catch{}return C(e)}function je(e){var t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}function Te(e){return e.flags}var _e=/test/g.flags==="g"?Te:je;function ae(e){var t=Se.call(e);return t.substring(8,t.length-1)}function qe(e){return e[Symbol.toStringTag]||ae(e)}var Pe=typeof Symbol<"u"?qe:ae,xe=Object.defineProperty,De=Object.getOwnPropertyDescriptor,se=Object.getOwnPropertyNames,N=Object.getOwnPropertySymbols,ce=Object.prototype,le=ce.hasOwnProperty,Re=ce.propertyIsEnumerable,ue=typeof N=="function";function Ie(e){return se(e).concat(N(e))}var Me=ue?Ie:se;function S(e,t,r){for(var s=Me(e),a=0,o=s.length,n=void 0,i=void 0;a<o;++a)if(n=s[a],!(n==="callee"||n==="caller")){if(i=De(e,n),!i){t[n]=r.copier(e[n],r);continue}!i.get&&!i.set&&(i.value=r.copier(i.value,r));try{xe(t,n,i)}catch{t[n]=i.value}}return t}function ze(e,t){var r=new t.Constructor;t.cache.set(e,r);for(var s=0,a=e.length;s<a;++s)r[s]=t.copier(e[s],t);return r}function Ee(e,t){var r=new t.Constructor;return t.cache.set(e,r),S(e,r,t)}function ge(e,t){return e.slice(0)}function Le(e,t){return e.slice(0,e.size,e.type)}function Be(e,t){return new t.Constructor(ge(e.buffer))}function Ne(e,t){return new t.Constructor(e.getTime())}function fe(e,t){var r=new t.Constructor;return t.cache.set(e,r),e.forEach(function(s,a){r.set(a,t.copier(s,t))}),r}function Ve(e,t){return S(e,fe(e,t),t)}function Qe(e,t){var r=B(t.prototype);t.cache.set(e,r);for(var s in e)le.call(e,s)&&(r[s]=t.copier(e[s],t));return r}function Fe(e,t){var r=B(t.prototype);t.cache.set(e,r);for(var s in e)le.call(e,s)&&(r[s]=t.copier(e[s],t));for(var a=N(e),o=0,n=a.length,i=void 0;o<n;++o)i=a[o],Re.call(e,i)&&(r[i]=t.copier(e[i],t));return r}var Ge=ue?Fe:Qe;function Ue(e,t){var r=B(t.prototype);return t.cache.set(e,r),S(e,r,t)}function O(e,t){return new t.Constructor(e.valueOf())}function Ke(e,t){var r=new t.Constructor(e.source,_e(e));return r.lastIndex=e.lastIndex,r}function w(e,t){return e}function pe(e,t){var r=new t.Constructor;return t.cache.set(e,r),e.forEach(function(s){r.add(t.copier(s,t))}),r}function We(e,t){return S(e,pe(e,t),t)}var He=Array.isArray,V=Object.assign,Je=Object.getPrototypeOf||(function(e){return e.__proto__}),he={array:ze,arrayBuffer:ge,blob:Le,dataView:Be,date:Ne,error:w,map:fe,object:Ge,regExp:Ke,set:pe},Ye=V({},he,{array:Ee,map:Ve,object:Ue,set:We});function Xe(e){return{Arguments:e.object,Array:e.array,ArrayBuffer:e.arrayBuffer,Blob:e.blob,Boolean:O,DataView:e.dataView,Date:e.date,Error:e.error,Float32Array:e.arrayBuffer,Float64Array:e.arrayBuffer,Int8Array:e.arrayBuffer,Int16Array:e.arrayBuffer,Int32Array:e.arrayBuffer,Map:e.map,Number:O,Object:e.object,Promise:w,RegExp:e.regExp,Set:e.set,String:O,WeakMap:w,WeakSet:w,Uint8Array:e.arrayBuffer,Uint8ClampedArray:e.arrayBuffer,Uint16Array:e.arrayBuffer,Uint32Array:e.arrayBuffer,Uint64Array:e.arrayBuffer}}function ye(e){var t=V({},he,e),r=Xe(t),s=r.Array,a=r.Object;function o(n,i){if(i.prototype=i.Constructor=void 0,!n||typeof n!="object")return n;if(i.cache.has(n))return i.cache.get(n);if(i.prototype=Je(n),i.Constructor=i.prototype&&i.prototype.constructor,!i.Constructor||i.Constructor===Object)return a(n,i);if(He(n))return s(n,i);var c=r[Pe(n)];return c?c(n,i):typeof n.then=="function"?n:a(n,i)}return function(i){return o(i,{Constructor:void 0,cache:ke(),copier:o,prototype:void 0})}}function Ze(e){return ye(V({},Ye,e))}Ze({});ye({});var v=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},A={exports:{}},F;function et(){if(F)return A.exports;F=1;var e=A.exports={},t,r;function s(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?t=setTimeout:t=s}catch{t=s}try{typeof clearTimeout=="function"?r=clearTimeout:r=a}catch{r=a}})();function o(p){if(t===setTimeout)return setTimeout(p,0);if((t===s||!t)&&setTimeout)return t=setTimeout,setTimeout(p,0);try{return t(p,0)}catch{try{return t.call(null,p,0)}catch{return t.call(this,p,0)}}}function n(p){if(r===clearTimeout)return clearTimeout(p);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(p);try{return r(p)}catch{try{return r.call(null,p)}catch{return r.call(this,p)}}}var i=[],c=!1,l,u=-1;function g(){!c||!l||(c=!1,l.length?i=l.concat(i):u=-1,i.length&&f())}function f(){if(!c){var p=o(g);c=!0;for(var m=i.length;m;){for(l=i,i=[];++u<m;)l&&l[u].run();u=-1,m=i.length}l=null,c=!1,n(p)}}e.nextTick=function(p){var m=new Array(arguments.length-1);if(arguments.length>1)for(var b=1;b<arguments.length;b++)m[b-1]=arguments[b];i.push(new y(p,m)),i.length===1&&!c&&o(f)};function y(p,m){this.fun=p,this.array=m}y.prototype.run=function(){this.fun.apply(null,this.array)},e.title="browser",e.browser=!0,e.env={},e.argv=[],e.version="",e.versions={};function h(){}return e.on=h,e.addListener=h,e.once=h,e.off=h,e.removeListener=h,e.removeAllListeners=h,e.emit=h,e.prependListener=h,e.prependOnceListener=h,e.listeners=function(p){return[]},e.binding=function(p){throw new Error("process.binding is not supported")},e.cwd=function(){return"/"},e.chdir=function(p){throw new Error("process.chdir is not supported")},e.umask=function(){return 0},A.exports}et();var k,G;function tt(){if(G)return k;G=1;var e=typeof v=="object"&&v&&v.Object===Object&&v;return k=e,k}var j,U;function rt(){if(U)return j;U=1;var e=tt(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return j=r,j}var T,K;function de(){if(K)return T;K=1;var e=rt(),t=e.Symbol;return T=t,T}var _,W;function nt(){if(W)return _;W=1;var e=de(),t=Object.prototype,r=t.hasOwnProperty,s=t.toString,a=e?e.toStringTag:void 0;function o(n){var i=r.call(n,a),c=n[a];try{n[a]=void 0;var l=!0}catch{}var u=s.call(n);return l&&(i?n[a]=c:delete n[a]),u}return _=o,_}var q,H;function it(){if(H)return q;H=1;var e=Object.prototype,t=e.toString;function r(s){return t.call(s)}return q=r,q}var P,J;function me(){if(J)return P;J=1;var e=de(),t=nt(),r=it(),s="[object Null]",a="[object Undefined]",o=e?e.toStringTag:void 0;function n(i){return i==null?i===void 0?a:s:o&&o in Object(i)?t(i):r(i)}return P=n,P}var x,Y;function ot(){if(Y)return x;Y=1;var e=Array.isArray;return x=e,x}var D,X;function be(){if(X)return D;X=1;function e(t){return t!=null&&typeof t=="object"}return D=e,D}var R,Z;function at(){if(Z)return R;Z=1;var e=me(),t=ot(),r=be(),s="[object String]";function a(o){return typeof o=="string"||!t(o)&&r(o)&&e(o)==s}return R=a,R}at();var I,ee;function st(){if(ee)return I;ee=1;function e(t,r){return function(s){return t(r(s))}}return I=e,I}var M,te;function ct(){if(te)return M;te=1;var e=st(),t=e(Object.getPrototypeOf,Object);return M=t,M}var z,re;function lt(){if(re)return z;re=1;var e=me(),t=ct(),r=be(),s="[object Object]",a=Function.prototype,o=Object.prototype,n=a.toString,i=o.hasOwnProperty,c=n.call(Object);function l(u){if(!r(u)||e(u)!=s)return!1;var g=t(u);if(g===null)return!0;var f=i.call(g,"constructor")&&g.constructor;return typeof f=="function"&&f instanceof f&&n.call(f)==c}return z=l,z}lt();var ve={0:8203,1:8204,2:8205,3:8290,4:8291,5:8288,6:65279,7:8289,8:119155,9:119156,a:119157,b:119158,c:119159,d:119160,e:119161,f:119162},$e={0:8203,1:8204,2:8205,3:65279};new Array(4).fill(String.fromCodePoint($e[0])).join("");Object.fromEntries(Object.entries($e).map(e=>e.reverse()));Object.fromEntries(Object.entries(ve).map(e=>e.reverse()));`${Object.values(ve).map(e=>`\\u{${e.toString(16)}}`).join("")}`;var E,ne;function ut(){if(ne)return E;ne=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString;return E=function(r,s,a){if(t.call(s)!=="[object Function]")throw new TypeError("iterator must be a function");var o=r.length;if(o===+o)for(var n=0;n<o;n++)s.call(a,r[n],n,r);else for(var i in r)e.call(r,i)&&s.call(a,r[i],i,r)},E}var L,ie;function gt(){if(ie)return L;ie=1;var e=ut();L=t;function t(r,s,a){if(arguments.length===3)return t.set(r,s,a);if(arguments.length===2)return t.get(r,s);var o=t.bind(t,r);for(var n in t)t.hasOwnProperty(n)&&(o[n]=t[n].bind(o,r));return o}return t.get=function(r,s){for(var a=Array.isArray(s)?s:t.parse(s),o=0;o<a.length;++o){var n=a[o];if(!(typeof r=="object"&&n in r))throw new Error("Invalid reference token: "+n);r=r[n]}return r},t.set=function(r,s,a){var o=Array.isArray(s)?s:t.parse(s),n=o[0];if(o.length===0)throw Error("Can not set the root object");for(var i=0;i<o.length-1;++i){var c=o[i];typeof c!="string"&&typeof c!="number"&&(c=String(c)),!(c==="__proto__"||c==="constructor"||c==="prototype")&&(c==="-"&&Array.isArray(r)&&(c=r.length),n=o[i+1],c in r||(n.match(/^(\d+|-)$/)?r[c]=[]:r[c]={}),r=r[c])}return n==="-"&&Array.isArray(r)&&(n=r.length),r[n]=a,this},t.remove=function(r,s){var a=Array.isArray(s)?s:t.parse(s),o=a[a.length-1];if(o===void 0)throw new Error('Invalid JSON pointer for remove: "'+s+'"');var n=t.get(r,a.slice(0,-1));if(Array.isArray(n)){var i=+o;if(o===""&&isNaN(i))throw new Error('Invalid array index: "'+o+'"');Array.prototype.splice.call(n,i,1)}else delete n[o]},t.dict=function(r,s){var a={};return t.walk(r,function(o,n){a[n]=o},s),a},t.walk=function(r,s,a){var o=[];a=a||function(n){var i=Object.prototype.toString.call(n);return i==="[object Object]"||i==="[object Array]"},(function n(i){e(i,function(c,l){o.push(String(l)),a(c)?n(c):s(c,t.compile(o)),o.pop()})})(r)},t.has=function(r,s){try{t.get(r,s)}catch{return!1}return!0},t.escape=function(r){return r.toString().replace(/~/g,"~0").replace(/\//g,"~1")},t.unescape=function(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")},t.parse=function(r){if(r==="")return[];if(r.charAt(0)!=="/")throw new Error("Invalid JSON pointer: "+r);return r.substring(1).split(/\//).map(t.unescape)},t.compile=function(r){return r.length===0?"":"/"+r.map(t.escape).join("/")},L}gt();var $={exports:{}},oe;function ft(){return oe||(oe=1,(function(e,t){t=e.exports=r,t.getSerialize=s;function r(a,o,n,i){return JSON.stringify(a,s(o,i),n)}function s(a,o){var n=[],i=[];return o==null&&(o=function(c,l){return n[0]===l?"[Circular ~]":"[Circular ~."+i.slice(0,n.indexOf(l)).join(".")+"]"}),function(c,l){if(n.length>0){var u=n.indexOf(this);~u?n.splice(u+1):n.push(this),~u?i.splice(u,1/0,c):i.push(c),~n.indexOf(l)&&(l=o.call(this,c,l))}else n.push(l);return a==null?l:a.call(this,c,l)}}})($,$.exports)),$.exports}ft();class d{static _clientParams;static get clientParams(){if(!this._clientParams)throw new Error("Client is not configured");return this._clientParams}static configure(t){this._clientParams={...t,environment:t.environment??"master"}}static async graphqlQuery(t,r={}){const{space:s,accessToken:a,environment:o="master"}=this.clientParams,n=await fetch(`https://graphql.contentful.com/content/v1/spaces/${s}/environments/${o}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:JSON.stringify({query:t,variables:r})});if(!n.ok){const c=await n.text();throw new Error(`GraphQL request failed: ${n.status} ${n.statusText}
|
|
2
|
-
${c}`)}const i=await n.json();if(i.errors)throw new Error(`GraphQL errors: ${JSON.stringify(i.errors,null,2)}`);return i.data}}const pt=async({slot:e,page:t=1,size:r=20,platform:s,marketCode:a,language:o})=>{const n=Math.max(1,Math.floor(t)),i=Math.max(1,Math.floor(r)),c=["$slot: String!","$limit: Int!","$skip: Int!"],l={slot:e,limit:i,skip:(n-1)*i},u=["{ slot: $slot }"];s&&(c.push("$platform: String!"),l.platform=s,u.push("{ platform_contains_some: [$platform] }")),a&&(c.push("$marketCode: String!"),l.marketCode=a,u.push("{ OR: [{
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var we=Function.prototype.toString,S=Object.create,Ce=Object.prototype.toString,Se=(function(){function e(){this._keys=[],this._values=[]}return e.prototype.has=function(t){return!!~this._keys.indexOf(t)},e.prototype.get=function(t){return this._values[this._keys.indexOf(t)]},e.prototype.set=function(t,r){this._keys.push(t),this._values.push(r)},e})();function Oe(){return new Se}function Ae(){return new WeakMap}var ke=typeof WeakMap<"u"?Ae:Oe;function B(e){if(!e)return S(null);var t=e.constructor;if(t===Object)return e===Object.prototype?{}:S(e);if(t&&~we.call(t).indexOf("[native code]"))try{return new t}catch{}return S(e)}function je(e){var t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}function Te(e){return e.flags}var _e=/test/g.flags==="g"?Te:je;function ae(e){var t=Ce.call(e);return t.substring(8,t.length-1)}function qe(e){return e[Symbol.toStringTag]||ae(e)}var Pe=typeof Symbol<"u"?qe:ae,xe=Object.defineProperty,De=Object.getOwnPropertyDescriptor,se=Object.getOwnPropertyNames,N=Object.getOwnPropertySymbols,ce=Object.prototype,le=ce.hasOwnProperty,Re=ce.propertyIsEnumerable,ue=typeof N=="function";function Ie(e){return se(e).concat(N(e))}var Me=ue?Ie:se;function C(e,t,r){for(var s=Me(e),a=0,o=s.length,n=void 0,i=void 0;a<o;++a)if(n=s[a],!(n==="callee"||n==="caller")){if(i=De(e,n),!i){t[n]=r.copier(e[n],r);continue}!i.get&&!i.set&&(i.value=r.copier(i.value,r));try{xe(t,n,i)}catch{t[n]=i.value}}return t}function ze(e,t){var r=new t.Constructor;t.cache.set(e,r);for(var s=0,a=e.length;s<a;++s)r[s]=t.copier(e[s],t);return r}function Ee(e,t){var r=new t.Constructor;return t.cache.set(e,r),C(e,r,t)}function ge(e,t){return e.slice(0)}function Le(e,t){return e.slice(0,e.size,e.type)}function Be(e,t){return new t.Constructor(ge(e.buffer))}function Ne(e,t){return new t.Constructor(e.getTime())}function fe(e,t){var r=new t.Constructor;return t.cache.set(e,r),e.forEach(function(s,a){r.set(a,t.copier(s,t))}),r}function Ve(e,t){return C(e,fe(e,t),t)}function Qe(e,t){var r=B(t.prototype);t.cache.set(e,r);for(var s in e)le.call(e,s)&&(r[s]=t.copier(e[s],t));return r}function Fe(e,t){var r=B(t.prototype);t.cache.set(e,r);for(var s in e)le.call(e,s)&&(r[s]=t.copier(e[s],t));for(var a=N(e),o=0,n=a.length,i=void 0;o<n;++o)i=a[o],Re.call(e,i)&&(r[i]=t.copier(e[i],t));return r}var Ge=ue?Fe:Qe;function Ue(e,t){var r=B(t.prototype);return t.cache.set(e,r),C(e,r,t)}function O(e,t){return new t.Constructor(e.valueOf())}function Ke(e,t){var r=new t.Constructor(e.source,_e(e));return r.lastIndex=e.lastIndex,r}function w(e,t){return e}function pe(e,t){var r=new t.Constructor;return t.cache.set(e,r),e.forEach(function(s){r.add(t.copier(s,t))}),r}function We(e,t){return C(e,pe(e,t),t)}var He=Array.isArray,V=Object.assign,Je=Object.getPrototypeOf||(function(e){return e.__proto__}),he={array:ze,arrayBuffer:ge,blob:Le,dataView:Be,date:Ne,error:w,map:fe,object:Ge,regExp:Ke,set:pe},Ye=V({},he,{array:Ee,map:Ve,object:Ue,set:We});function Xe(e){return{Arguments:e.object,Array:e.array,ArrayBuffer:e.arrayBuffer,Blob:e.blob,Boolean:O,DataView:e.dataView,Date:e.date,Error:e.error,Float32Array:e.arrayBuffer,Float64Array:e.arrayBuffer,Int8Array:e.arrayBuffer,Int16Array:e.arrayBuffer,Int32Array:e.arrayBuffer,Map:e.map,Number:O,Object:e.object,Promise:w,RegExp:e.regExp,Set:e.set,String:O,WeakMap:w,WeakSet:w,Uint8Array:e.arrayBuffer,Uint8ClampedArray:e.arrayBuffer,Uint16Array:e.arrayBuffer,Uint32Array:e.arrayBuffer,Uint64Array:e.arrayBuffer}}function ye(e){var t=V({},he,e),r=Xe(t),s=r.Array,a=r.Object;function o(n,i){if(i.prototype=i.Constructor=void 0,!n||typeof n!="object")return n;if(i.cache.has(n))return i.cache.get(n);if(i.prototype=Je(n),i.Constructor=i.prototype&&i.prototype.constructor,!i.Constructor||i.Constructor===Object)return a(n,i);if(He(n))return s(n,i);var c=r[Pe(n)];return c?c(n,i):typeof n.then=="function"?n:a(n,i)}return function(i){return o(i,{Constructor:void 0,cache:ke(),copier:o,prototype:void 0})}}function Ze(e){return ye(V({},Ye,e))}Ze({});ye({});var v=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},A={exports:{}},F;function et(){if(F)return A.exports;F=1;var e=A.exports={},t,r;function s(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?t=setTimeout:t=s}catch{t=s}try{typeof clearTimeout=="function"?r=clearTimeout:r=a}catch{r=a}})();function o(p){if(t===setTimeout)return setTimeout(p,0);if((t===s||!t)&&setTimeout)return t=setTimeout,setTimeout(p,0);try{return t(p,0)}catch{try{return t.call(null,p,0)}catch{return t.call(this,p,0)}}}function n(p){if(r===clearTimeout)return clearTimeout(p);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(p);try{return r(p)}catch{try{return r.call(null,p)}catch{return r.call(this,p)}}}var i=[],c=!1,l,u=-1;function g(){!c||!l||(c=!1,l.length?i=l.concat(i):u=-1,i.length&&f())}function f(){if(!c){var p=o(g);c=!0;for(var m=i.length;m;){for(l=i,i=[];++u<m;)l&&l[u].run();u=-1,m=i.length}l=null,c=!1,n(p)}}e.nextTick=function(p){var m=new Array(arguments.length-1);if(arguments.length>1)for(var b=1;b<arguments.length;b++)m[b-1]=arguments[b];i.push(new y(p,m)),i.length===1&&!c&&o(f)};function y(p,m){this.fun=p,this.array=m}y.prototype.run=function(){this.fun.apply(null,this.array)},e.title="browser",e.browser=!0,e.env={},e.argv=[],e.version="",e.versions={};function h(){}return e.on=h,e.addListener=h,e.once=h,e.off=h,e.removeListener=h,e.removeAllListeners=h,e.emit=h,e.prependListener=h,e.prependOnceListener=h,e.listeners=function(p){return[]},e.binding=function(p){throw new Error("process.binding is not supported")},e.cwd=function(){return"/"},e.chdir=function(p){throw new Error("process.chdir is not supported")},e.umask=function(){return 0},A.exports}et();var k,G;function tt(){if(G)return k;G=1;var e=typeof v=="object"&&v&&v.Object===Object&&v;return k=e,k}var j,U;function rt(){if(U)return j;U=1;var e=tt(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return j=r,j}var T,K;function de(){if(K)return T;K=1;var e=rt(),t=e.Symbol;return T=t,T}var _,W;function nt(){if(W)return _;W=1;var e=de(),t=Object.prototype,r=t.hasOwnProperty,s=t.toString,a=e?e.toStringTag:void 0;function o(n){var i=r.call(n,a),c=n[a];try{n[a]=void 0;var l=!0}catch{}var u=s.call(n);return l&&(i?n[a]=c:delete n[a]),u}return _=o,_}var q,H;function it(){if(H)return q;H=1;var e=Object.prototype,t=e.toString;function r(s){return t.call(s)}return q=r,q}var P,J;function me(){if(J)return P;J=1;var e=de(),t=nt(),r=it(),s="[object Null]",a="[object Undefined]",o=e?e.toStringTag:void 0;function n(i){return i==null?i===void 0?a:s:o&&o in Object(i)?t(i):r(i)}return P=n,P}var x,Y;function ot(){if(Y)return x;Y=1;var e=Array.isArray;return x=e,x}var D,X;function be(){if(X)return D;X=1;function e(t){return t!=null&&typeof t=="object"}return D=e,D}var R,Z;function at(){if(Z)return R;Z=1;var e=me(),t=ot(),r=be(),s="[object String]";function a(o){return typeof o=="string"||!t(o)&&r(o)&&e(o)==s}return R=a,R}at();var I,ee;function st(){if(ee)return I;ee=1;function e(t,r){return function(s){return t(r(s))}}return I=e,I}var M,te;function ct(){if(te)return M;te=1;var e=st(),t=e(Object.getPrototypeOf,Object);return M=t,M}var z,re;function lt(){if(re)return z;re=1;var e=me(),t=ct(),r=be(),s="[object Object]",a=Function.prototype,o=Object.prototype,n=a.toString,i=o.hasOwnProperty,c=n.call(Object);function l(u){if(!r(u)||e(u)!=s)return!1;var g=t(u);if(g===null)return!0;var f=i.call(g,"constructor")&&g.constructor;return typeof f=="function"&&f instanceof f&&n.call(f)==c}return z=l,z}lt();var ve={0:8203,1:8204,2:8205,3:8290,4:8291,5:8288,6:65279,7:8289,8:119155,9:119156,a:119157,b:119158,c:119159,d:119160,e:119161,f:119162},$e={0:8203,1:8204,2:8205,3:65279};new Array(4).fill(String.fromCodePoint($e[0])).join("");Object.fromEntries(Object.entries($e).map(e=>e.reverse()));Object.fromEntries(Object.entries(ve).map(e=>e.reverse()));`${Object.values(ve).map(e=>`\\u{${e.toString(16)}}`).join("")}`;var E,ne;function ut(){if(ne)return E;ne=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString;return E=function(r,s,a){if(t.call(s)!=="[object Function]")throw new TypeError("iterator must be a function");var o=r.length;if(o===+o)for(var n=0;n<o;n++)s.call(a,r[n],n,r);else for(var i in r)e.call(r,i)&&s.call(a,r[i],i,r)},E}var L,ie;function gt(){if(ie)return L;ie=1;var e=ut();L=t;function t(r,s,a){if(arguments.length===3)return t.set(r,s,a);if(arguments.length===2)return t.get(r,s);var o=t.bind(t,r);for(var n in t)t.hasOwnProperty(n)&&(o[n]=t[n].bind(o,r));return o}return t.get=function(r,s){for(var a=Array.isArray(s)?s:t.parse(s),o=0;o<a.length;++o){var n=a[o];if(!(typeof r=="object"&&n in r))throw new Error("Invalid reference token: "+n);r=r[n]}return r},t.set=function(r,s,a){var o=Array.isArray(s)?s:t.parse(s),n=o[0];if(o.length===0)throw Error("Can not set the root object");for(var i=0;i<o.length-1;++i){var c=o[i];typeof c!="string"&&typeof c!="number"&&(c=String(c)),!(c==="__proto__"||c==="constructor"||c==="prototype")&&(c==="-"&&Array.isArray(r)&&(c=r.length),n=o[i+1],c in r||(n.match(/^(\d+|-)$/)?r[c]=[]:r[c]={}),r=r[c])}return n==="-"&&Array.isArray(r)&&(n=r.length),r[n]=a,this},t.remove=function(r,s){var a=Array.isArray(s)?s:t.parse(s),o=a[a.length-1];if(o===void 0)throw new Error('Invalid JSON pointer for remove: "'+s+'"');var n=t.get(r,a.slice(0,-1));if(Array.isArray(n)){var i=+o;if(o===""&&isNaN(i))throw new Error('Invalid array index: "'+o+'"');Array.prototype.splice.call(n,i,1)}else delete n[o]},t.dict=function(r,s){var a={};return t.walk(r,function(o,n){a[n]=o},s),a},t.walk=function(r,s,a){var o=[];a=a||function(n){var i=Object.prototype.toString.call(n);return i==="[object Object]"||i==="[object Array]"},(function n(i){e(i,function(c,l){o.push(String(l)),a(c)?n(c):s(c,t.compile(o)),o.pop()})})(r)},t.has=function(r,s){try{t.get(r,s)}catch{return!1}return!0},t.escape=function(r){return r.toString().replace(/~/g,"~0").replace(/\//g,"~1")},t.unescape=function(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")},t.parse=function(r){if(r==="")return[];if(r.charAt(0)!=="/")throw new Error("Invalid JSON pointer: "+r);return r.substring(1).split(/\//).map(t.unescape)},t.compile=function(r){return r.length===0?"":"/"+r.map(t.escape).join("/")},L}gt();var $={exports:{}},oe;function ft(){return oe||(oe=1,(function(e,t){t=e.exports=r,t.getSerialize=s;function r(a,o,n,i){return JSON.stringify(a,s(o,i),n)}function s(a,o){var n=[],i=[];return o==null&&(o=function(c,l){return n[0]===l?"[Circular ~]":"[Circular ~."+i.slice(0,n.indexOf(l)).join(".")+"]"}),function(c,l){if(n.length>0){var u=n.indexOf(this);~u?n.splice(u+1):n.push(this),~u?i.splice(u,1/0,c):i.push(c),~n.indexOf(l)&&(l=o.call(this,c,l))}else n.push(l);return a==null?l:a.call(this,c,l)}}})($,$.exports)),$.exports}ft();class d{static _clientParams;static get clientParams(){if(!this._clientParams)throw new Error("Client is not configured");return this._clientParams}static configure(t){this._clientParams={...t,environment:t.environment??"master"}}static async graphqlQuery(t,r={}){const{space:s,accessToken:a,environment:o="master"}=this.clientParams,n=await fetch(`https://graphql.contentful.com/content/v1/spaces/${s}/environments/${o}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:JSON.stringify({query:t,variables:r})});if(!n.ok){const c=await n.text();throw new Error(`GraphQL request failed: ${n.status} ${n.statusText}
|
|
2
|
+
${c}`)}const i=await n.json();if(i.errors)throw new Error(`GraphQL errors: ${JSON.stringify(i.errors,null,2)}`);return i.data}}const pt=async({slot:e,page:t=1,size:r=20,platform:s,marketCode:a,language:o})=>{const n=Math.max(1,Math.floor(t)),i=Math.max(1,Math.floor(r)),c=["$slot: String!","$limit: Int!","$skip: Int!"],l={slot:e,limit:i,skip:(n-1)*i},u=["{ slot: $slot }"];s&&(c.push("$platform: String!"),l.platform=s,u.push("{ platform_contains_some: [$platform] }")),a&&(c.push("$marketCode: String!"),l.marketCode=a,u.push("{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }")),o&&(c.push("$language: String!"),l.language=o,u.push("{ OR: [{ language_exists: false }, { language: { code: $language } }] }"));const g=`(${c.join(", ")})`,f=`(
|
|
3
3
|
limit: $limit
|
|
4
4
|
skip: $skip
|
|
5
5
|
where: {
|
|
@@ -145,7 +145,7 @@ query${i} {
|
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
|
-
`,{blogPostCollection:u}=await d.graphqlQuery(l,{...o}),g=u.items.at(0);if(!g)throw new Q;return g},dt=async({page:e=1,size:t=20,marketCode:r,language:s}={})=>{const a=Math.max(1,Math.floor(e)),o=Math.max(1,Math.floor(t)),n=["$limit: Int!","$skip: Int!"],i={limit:o,skip:(a-1)*o},c=[];r&&(n.push("$marketCode: String!"),i.marketCode=r,c.push("{ OR: [{
|
|
148
|
+
`,{blogPostCollection:u}=await d.graphqlQuery(l,{...o}),g=u.items.at(0);if(!g)throw new Q;return g},dt=async({page:e=1,size:t=20,marketCode:r,language:s}={})=>{const a=Math.max(1,Math.floor(e)),o=Math.max(1,Math.floor(t)),n=["$limit: Int!","$skip: Int!"],i={limit:o,skip:(a-1)*o},c=[];r&&(n.push("$marketCode: String!"),i.marketCode=r,c.push("{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }")),s&&(n.push("$language: String!"),i.language=s,c.push("{ OR: [{ language_exists: false }, { language: { code: $language } }] }"));const l=`(${n.join(", ")})`,u=c.length?`(
|
|
149
149
|
limit: $limit
|
|
150
150
|
skip: $skip
|
|
151
151
|
where: {
|
|
@@ -193,7 +193,7 @@ query${l} {
|
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
|
-
`,{brandCollectionCollection:f}=await d.graphqlQuery(g,{...i});return{page:a,total:f.total,size:o,items:f.items}},mt=async({marketCode:e,language:t,page:r=1,size:s=20}={})=>{const a=Math.max(1,Math.floor(r)),o=Math.max(1,Math.floor(s)),n=["$limit: Int!","$skip: Int!"],i={limit:o,skip:(a-1)*o},c=["limit: $limit","skip: $skip"],l=[];e&&(n.push("$marketCode: String!"),i.marketCode=e,l.push("{ OR: [{
|
|
196
|
+
`,{brandCollectionCollection:f}=await d.graphqlQuery(g,{...i});return{page:a,total:f.total,size:o,items:f.items}},mt=async({marketCode:e,language:t,page:r=1,size:s=20}={})=>{const a=Math.max(1,Math.floor(r)),o=Math.max(1,Math.floor(s)),n=["$limit: Int!","$skip: Int!"],i={limit:o,skip:(a-1)*o},c=["limit: $limit","skip: $skip"],l=[];e&&(n.push("$marketCode: String!"),i.marketCode=e,l.push("{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }")),t&&(n.push("$language: String!"),i.language=t,l.push("{ OR: [{ language_exists: false }, { language: { code: $language } }] }")),l.length&&c.push(`where: {
|
|
197
197
|
AND: [
|
|
198
198
|
${l.join(`
|
|
199
199
|
`)}
|
|
@@ -224,7 +224,7 @@ query${u} {
|
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
|
-
`,{documentationCategoryCollection:y}=await d.graphqlQuery(f,{...i});return{page:a,total:y.total,size:o,items:y.items}},bt=async({id:e,slug:t,marketCode:r,language:s})=>{const a=[],o={},n=[];if(e)a.push("$id: String!"),o.id=e,n.push("{ sys: { id: $id } }");else if(t)a.push("$slug: String!"),o.slug=t,n.push("{ slug: $slug }");else throw new Error("Either id or slug is required.");r&&(a.push("$marketCode: String!"),o.marketCode=r,n.push("{ OR: [{
|
|
227
|
+
`,{documentationCategoryCollection:y}=await d.graphqlQuery(f,{...i});return{page:a,total:y.total,size:o,items:y.items}},bt=async({id:e,slug:t,marketCode:r,language:s})=>{const a=[],o={},n=[];if(e)a.push("$id: String!"),o.id=e,n.push("{ sys: { id: $id } }");else if(t)a.push("$slug: String!"),o.slug=t,n.push("{ slug: $slug }");else throw new Error("Either id or slug is required.");r&&(a.push("$marketCode: String!"),o.marketCode=r,n.push("{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }")),s&&(a.push("$language: String!"),o.language=s,n.push("{ OR: [{ language_exists: false }, { language: { code: $language } }] }"));const i=`(${a.join(", ")})`,c=`(
|
|
228
228
|
limit: 1
|
|
229
229
|
where: {
|
|
230
230
|
AND: [
|
|
@@ -254,7 +254,7 @@ query${i} {
|
|
|
254
254
|
}
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
|
-
`,{documentationCategoryCollection:u}=await d.graphqlQuery(l,{...o}),g=u.items.at(0);if(!g)throw new Q;return g},vt=async({marketCode:e,language:t,categorySlug:r,page:s=1,size:a=20}={})=>{const o=Math.max(1,Math.floor(s)),n=Math.max(1,Math.floor(a)),i=["$limit: Int!","$skip: Int!"],c={limit:n,skip:(o-1)*n},l=["limit: $limit","skip: $skip"],u=[];e&&(i.push("$marketCode: String!"),c.marketCode=e,u.push("{ OR: [{
|
|
257
|
+
`,{documentationCategoryCollection:u}=await d.graphqlQuery(l,{...o}),g=u.items.at(0);if(!g)throw new Q;return g},vt=async({marketCode:e,language:t,categorySlug:r,page:s=1,size:a=20}={})=>{const o=Math.max(1,Math.floor(s)),n=Math.max(1,Math.floor(a)),i=["$limit: Int!","$skip: Int!"],c={limit:n,skip:(o-1)*n},l=["limit: $limit","skip: $skip"],u=[];e&&(i.push("$marketCode: String!"),c.marketCode=e,u.push("{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }")),t&&(i.push("$language: String!"),c.language=t,u.push("{ OR: [{ language_exists: false }, { language: { code: $language } }] }")),r&&(i.push("$categorySlug: String!"),c.categorySlug=r,u.push("{ category: { slug: $categorySlug } }")),u.length&&l.push(`where: {
|
|
258
258
|
AND: [
|
|
259
259
|
${u.join(`
|
|
260
260
|
`)}
|
|
@@ -292,7 +292,7 @@ query${g} {
|
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
|
-
`,{documentationArticleCollection:h}=await d.graphqlQuery(y,{...c});return{page:o,total:h.total,size:n,items:h.items}},$t=async({id:e,slug:t,marketCode:r,language:s})=>{const a=[],o={},n=[];if(e)a.push("$id: String!"),o.id=e,n.push("{ sys: { id: $id } }");else if(t)a.push("$slug: String!"),o.slug=t,n.push("{ slug: $slug }");else throw new Error("Either id or slug is required.");r&&(a.push("$marketCode: String!"),o.marketCode=r,n.push("{ OR: [{
|
|
295
|
+
`,{documentationArticleCollection:h}=await d.graphqlQuery(y,{...c});return{page:o,total:h.total,size:n,items:h.items}},$t=async({id:e,slug:t,marketCode:r,language:s})=>{const a=[],o={},n=[];if(e)a.push("$id: String!"),o.id=e,n.push("{ sys: { id: $id } }");else if(t)a.push("$slug: String!"),o.slug=t,n.push("{ slug: $slug }");else throw new Error("Either id or slug is required.");r&&(a.push("$marketCode: String!"),o.marketCode=r,n.push("{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }")),s&&(a.push("$language: String!"),o.language=s,n.push("{ OR: [{ language_exists: false }, { language: { code: $language } }] }"));const i=`(${a.join(", ")})`,c=`(
|
|
296
296
|
limit: 1
|
|
297
297
|
where: {
|
|
298
298
|
AND: [
|
|
@@ -353,7 +353,7 @@ query${i} {
|
|
|
353
353
|
}
|
|
354
354
|
}
|
|
355
355
|
}
|
|
356
|
-
`,{documentationArticleCollection:u}=await d.graphqlQuery(l,{...o}),g=u.items.at(0);if(!g)throw new Q;return g},wt=async({page:e=1,size:t=20,marketCode:r,language:s}={})=>{const a=Math.max(1,Math.floor(e)),o=Math.max(1,Math.floor(t)),n=["$limit: Int!","$skip: Int!"],i={limit:o,skip:(a-1)*o},c=[];r&&(n.push("$marketCode: String!"),i.marketCode=r,c.push("{ OR: [{
|
|
356
|
+
`,{documentationArticleCollection:u}=await d.graphqlQuery(l,{...o}),g=u.items.at(0);if(!g)throw new Q;return g},wt=async({page:e=1,size:t=20,marketCode:r,language:s}={})=>{const a=Math.max(1,Math.floor(e)),o=Math.max(1,Math.floor(t)),n=["$limit: Int!","$skip: Int!"],i={limit:o,skip:(a-1)*o},c=[];r&&(n.push("$marketCode: String!"),i.marketCode=r,c.push("{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }")),s&&(n.push("$language: String!"),i.language=s,c.push("{ OR: [{ language_exists: false }, { language: { code: $language } }] }"));const l=n.length?`(${n.join(", ")})`:"",u=c.length?`(
|
|
357
357
|
limit: $limit
|
|
358
358
|
skip: $skip
|
|
359
359
|
order: order_ASC
|
|
@@ -392,7 +392,7 @@ query${l} {
|
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
394
|
}
|
|
395
|
-
`,{hyperlinkCollectionCollection:f}=await d.graphqlQuery(g,{...i});return{page:a,total:f.total,size:o,items:f.items}},
|
|
395
|
+
`,{hyperlinkCollectionCollection:f}=await d.graphqlQuery(g,{...i});return{page:a,total:f.total,size:o,items:f.items}},Ct=async({page:e=1,size:t=20,marketCode:r,language:s}={})=>{const a=Math.max(1,Math.floor(e)),o=Math.max(1,Math.floor(t)),n=["$limit: Int!","$skip: Int!"],i={limit:o,skip:(a-1)*o},c=[];r&&(n.push("$marketCode: String!"),i.marketCode=r,c.push("{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }")),s&&(n.push("$language: String!"),i.language=s,c.push("{ OR: [{ language_exists: false }, { language: { code: $language } }] }"));const l=`(${n.join(", ")})`,u=c.length?`(
|
|
396
396
|
limit: $limit
|
|
397
397
|
skip: $skip
|
|
398
398
|
where: {
|
|
@@ -418,4 +418,4 @@ query${l} {
|
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
420
|
}
|
|
421
|
-
`,{keywordCollectionCollection:f}=await d.graphqlQuery(g,{...i});return{page:a,total:f.total,size:o,items:f.items}};exports.ContentfulSDK=d;exports.getBannerCollections=pt;exports.getBlogPostDetail=yt;exports.getBlogPosts=ht;exports.getBrandCollections=dt;exports.getDocArticleDetail=$t;exports.getDocArticles=vt;exports.getDocCategories=mt;exports.getDocCategoryDetail=bt;exports.getHyperlinkCollections=wt;exports.getKeywordCollections=
|
|
421
|
+
`,{keywordCollectionCollection:f}=await d.graphqlQuery(g,{...i});return{page:a,total:f.total,size:o,items:f.items}};exports.ContentfulSDK=d;exports.getBannerCollections=pt;exports.getBlogPostDetail=yt;exports.getBlogPosts=ht;exports.getBrandCollections=dt;exports.getDocArticleDetail=$t;exports.getDocArticles=vt;exports.getDocCategories=mt;exports.getDocCategoryDetail=bt;exports.getHyperlinkCollections=wt;exports.getKeywordCollections=Ct;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var we = Function.prototype.toString,
|
|
1
|
+
var we = Function.prototype.toString, S = Object.create, Ce = Object.prototype.toString, Se = (
|
|
2
2
|
/** @class */
|
|
3
3
|
(function() {
|
|
4
4
|
function e() {
|
|
@@ -14,7 +14,7 @@ var we = Function.prototype.toString, C = Object.create, Se = Object.prototype.t
|
|
|
14
14
|
})()
|
|
15
15
|
);
|
|
16
16
|
function Oe() {
|
|
17
|
-
return new
|
|
17
|
+
return new Se();
|
|
18
18
|
}
|
|
19
19
|
function Ae() {
|
|
20
20
|
return /* @__PURE__ */ new WeakMap();
|
|
@@ -22,16 +22,16 @@ function Ae() {
|
|
|
22
22
|
var ke = typeof WeakMap < "u" ? Ae : Oe;
|
|
23
23
|
function N(e) {
|
|
24
24
|
if (!e)
|
|
25
|
-
return
|
|
25
|
+
return S(null);
|
|
26
26
|
var t = e.constructor;
|
|
27
27
|
if (t === Object)
|
|
28
|
-
return e === Object.prototype ? {} :
|
|
28
|
+
return e === Object.prototype ? {} : S(e);
|
|
29
29
|
if (t && ~we.call(t).indexOf("[native code]"))
|
|
30
30
|
try {
|
|
31
31
|
return new t();
|
|
32
32
|
} catch {
|
|
33
33
|
}
|
|
34
|
-
return
|
|
34
|
+
return S(e);
|
|
35
35
|
}
|
|
36
36
|
function je(e) {
|
|
37
37
|
var t = "";
|
|
@@ -42,7 +42,7 @@ function Te(e) {
|
|
|
42
42
|
}
|
|
43
43
|
var _e = /test/g.flags === "g" ? Te : je;
|
|
44
44
|
function ae(e) {
|
|
45
|
-
var t =
|
|
45
|
+
var t = Ce.call(e);
|
|
46
46
|
return t.substring(8, t.length - 1);
|
|
47
47
|
}
|
|
48
48
|
function qe(e) {
|
|
@@ -53,7 +53,7 @@ function Ie(e) {
|
|
|
53
53
|
return se(e).concat(B(e));
|
|
54
54
|
}
|
|
55
55
|
var Me = ue ? Ie : se;
|
|
56
|
-
function
|
|
56
|
+
function C(e, t, r) {
|
|
57
57
|
for (var s = Me(e), a = 0, o = s.length, n = void 0, i = void 0; a < o; ++a)
|
|
58
58
|
if (n = s[a], !(n === "callee" || n === "caller")) {
|
|
59
59
|
if (i = Re(e, n), !i) {
|
|
@@ -78,7 +78,7 @@ function ze(e, t) {
|
|
|
78
78
|
}
|
|
79
79
|
function Ee(e, t) {
|
|
80
80
|
var r = new t.Constructor();
|
|
81
|
-
return t.cache.set(e, r),
|
|
81
|
+
return t.cache.set(e, r), C(e, r, t);
|
|
82
82
|
}
|
|
83
83
|
function ge(e, t) {
|
|
84
84
|
return e.slice(0);
|
|
@@ -99,7 +99,7 @@ function fe(e, t) {
|
|
|
99
99
|
}), r;
|
|
100
100
|
}
|
|
101
101
|
function Ve(e, t) {
|
|
102
|
-
return
|
|
102
|
+
return C(e, fe(e, t), t);
|
|
103
103
|
}
|
|
104
104
|
function Qe(e, t) {
|
|
105
105
|
var r = N(t.prototype);
|
|
@@ -120,7 +120,7 @@ function Fe(e, t) {
|
|
|
120
120
|
var Ge = ue ? Fe : Qe;
|
|
121
121
|
function Ue(e, t) {
|
|
122
122
|
var r = N(t.prototype);
|
|
123
|
-
return t.cache.set(e, r),
|
|
123
|
+
return t.cache.set(e, r), C(e, r, t);
|
|
124
124
|
}
|
|
125
125
|
function O(e, t) {
|
|
126
126
|
return new t.Constructor(e.valueOf());
|
|
@@ -139,7 +139,7 @@ function pe(e, t) {
|
|
|
139
139
|
}), r;
|
|
140
140
|
}
|
|
141
141
|
function We(e, t) {
|
|
142
|
-
return
|
|
142
|
+
return C(e, pe(e, t), t);
|
|
143
143
|
}
|
|
144
144
|
var Je = Array.isArray, V = Object.assign, He = Object.getPrototypeOf || (function(e) {
|
|
145
145
|
return e.__proto__;
|
|
@@ -621,7 +621,7 @@ const pt = async ({
|
|
|
621
621
|
skip: (n - 1) * i
|
|
622
622
|
}, u = ["{ slot: $slot }"];
|
|
623
623
|
s && (c.push("$platform: String!"), l.platform = s, u.push("{ platform_contains_some: [$platform] }")), a && (c.push("$marketCode: String!"), l.marketCode = a, u.push(
|
|
624
|
-
"{ OR: [{
|
|
624
|
+
"{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }"
|
|
625
625
|
)), o && (c.push("$language: String!"), l.language = o, u.push(
|
|
626
626
|
"{ OR: [{ language_exists: false }, { language: { code: $language } }] }"
|
|
627
627
|
));
|
|
@@ -848,7 +848,7 @@ query${i} {
|
|
|
848
848
|
skip: (a - 1) * o
|
|
849
849
|
}, c = [];
|
|
850
850
|
r && (n.push("$marketCode: String!"), i.marketCode = r, c.push(
|
|
851
|
-
"{ OR: [{
|
|
851
|
+
"{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }"
|
|
852
852
|
)), s && (n.push("$language: String!"), i.language = s, c.push(
|
|
853
853
|
"{ OR: [{ language_exists: false }, { language: { code: $language } }] }"
|
|
854
854
|
));
|
|
@@ -920,7 +920,7 @@ query${l} {
|
|
|
920
920
|
skip: (a - 1) * o
|
|
921
921
|
}, c = ["limit: $limit", "skip: $skip"], l = [];
|
|
922
922
|
e && (n.push("$marketCode: String!"), i.marketCode = e, l.push(
|
|
923
|
-
"{ OR: [{
|
|
923
|
+
"{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }"
|
|
924
924
|
)), t && (n.push("$language: String!"), i.language = t, l.push(
|
|
925
925
|
"{ OR: [{ language_exists: false }, { language: { code: $language } }] }"
|
|
926
926
|
)), l.length && c.push(`where: {
|
|
@@ -978,7 +978,7 @@ query${u} {
|
|
|
978
978
|
else
|
|
979
979
|
throw new Error("Either id or slug is required.");
|
|
980
980
|
r && (a.push("$marketCode: String!"), o.marketCode = r, n.push(
|
|
981
|
-
"{ OR: [{
|
|
981
|
+
"{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }"
|
|
982
982
|
)), s && (a.push("$language: String!"), o.language = s, n.push(
|
|
983
983
|
"{ OR: [{ language_exists: false }, { language: { code: $language } }] }"
|
|
984
984
|
));
|
|
@@ -1030,7 +1030,7 @@ query${i} {
|
|
|
1030
1030
|
skip: (o - 1) * n
|
|
1031
1031
|
}, l = ["limit: $limit", "skip: $skip"], u = [];
|
|
1032
1032
|
e && (i.push("$marketCode: String!"), c.marketCode = e, u.push(
|
|
1033
|
-
"{ OR: [{
|
|
1033
|
+
"{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }"
|
|
1034
1034
|
)), t && (i.push("$language: String!"), c.language = t, u.push(
|
|
1035
1035
|
"{ OR: [{ language_exists: false }, { language: { code: $language } }] }"
|
|
1036
1036
|
)), r && (i.push("$categorySlug: String!"), c.categorySlug = r, u.push("{ category: { slug: $categorySlug } }")), u.length && l.push(`where: {
|
|
@@ -1095,7 +1095,7 @@ query${g} {
|
|
|
1095
1095
|
else
|
|
1096
1096
|
throw new Error("Either id or slug is required.");
|
|
1097
1097
|
r && (a.push("$marketCode: String!"), o.marketCode = r, n.push(
|
|
1098
|
-
"{ OR: [{
|
|
1098
|
+
"{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }"
|
|
1099
1099
|
)), s && (a.push("$language: String!"), o.language = s, n.push(
|
|
1100
1100
|
"{ OR: [{ language_exists: false }, { language: { code: $language } }] }"
|
|
1101
1101
|
));
|
|
@@ -1177,7 +1177,7 @@ query${i} {
|
|
|
1177
1177
|
skip: (a - 1) * o
|
|
1178
1178
|
}, c = [];
|
|
1179
1179
|
r && (n.push("$marketCode: String!"), i.marketCode = r, c.push(
|
|
1180
|
-
"{ OR: [{
|
|
1180
|
+
"{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }"
|
|
1181
1181
|
)), s && (n.push("$language: String!"), i.language = s, c.push(
|
|
1182
1182
|
"{ OR: [{ language_exists: false }, { language: { code: $language } }] }"
|
|
1183
1183
|
));
|
|
@@ -1232,7 +1232,7 @@ query${l} {
|
|
|
1232
1232
|
size: o,
|
|
1233
1233
|
items: f.items
|
|
1234
1234
|
};
|
|
1235
|
-
},
|
|
1235
|
+
}, Ct = async ({
|
|
1236
1236
|
page: e = 1,
|
|
1237
1237
|
size: t = 20,
|
|
1238
1238
|
marketCode: r,
|
|
@@ -1243,7 +1243,7 @@ query${l} {
|
|
|
1243
1243
|
skip: (a - 1) * o
|
|
1244
1244
|
}, c = [];
|
|
1245
1245
|
r && (n.push("$marketCode: String!"), i.marketCode = r, c.push(
|
|
1246
|
-
"{ OR: [{
|
|
1246
|
+
"{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }"
|
|
1247
1247
|
)), s && (n.push("$language: String!"), i.language = s, c.push(
|
|
1248
1248
|
"{ OR: [{ language_exists: false }, { language: { code: $language } }] }"
|
|
1249
1249
|
));
|
|
@@ -1294,5 +1294,5 @@ export {
|
|
|
1294
1294
|
mt as getDocCategories,
|
|
1295
1295
|
bt as getDocCategoryDetail,
|
|
1296
1296
|
wt as getHyperlinkCollections,
|
|
1297
|
-
|
|
1297
|
+
Ct as getKeywordCollections
|
|
1298
1298
|
};
|
|
@@ -78,6 +78,7 @@ export interface TypeDocumentationArticleFields {
|
|
|
78
78
|
market?: EntryFieldTypes.EntryLink<TypeMarketSkeleton>;
|
|
79
79
|
language?: EntryFieldTypes.EntryLink<TypeLanguageSkeleton>;
|
|
80
80
|
seo?: EntryFieldTypes.EntryLink<TypeSeoSkeleton>;
|
|
81
|
+
markets?: EntryFieldTypes.Array<EntryFieldTypes.EntryLink<TypeMarketSkeleton>>;
|
|
81
82
|
}
|
|
82
83
|
export type TypeDocumentationArticleSkeleton = EntrySkeletonType<TypeDocumentationArticleFields, "documentationArticle">;
|
|
83
84
|
export type TypeDocumentationArticle<Modifiers extends ChainModifiers, Locales extends LocaleCode = LocaleCode> = Entry<TypeDocumentationArticleSkeleton, Modifiers, Locales>;
|