@janbox/contentful-marketplace-sdk 1.0.15 → 1.0.17
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.
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
import { PaginatedResponse } from '../utils';
|
|
2
|
-
import {
|
|
2
|
+
import { GraphQLAsset, TypeBlogCategorySkeleton } from '../types';
|
|
3
3
|
import { Entry } from 'contentful';
|
|
4
4
|
type BlogCategoryEntry = Entry<TypeBlogCategorySkeleton, "WITHOUT_UNRESOLVABLE_LINKS", string>;
|
|
5
5
|
export type BlogCategoryGraphQLItem = {
|
|
6
6
|
sys: {
|
|
7
7
|
id: string;
|
|
8
8
|
};
|
|
9
|
+
featuredImage: GraphQLAsset | null;
|
|
9
10
|
} & Pick<BlogCategoryEntry["fields"], "title" | "slug">;
|
|
10
11
|
export interface BlogCategoryDetailGraphQLItem extends BlogCategoryGraphQLItem {
|
|
11
|
-
description:
|
|
12
|
-
json: NonNullable<BlogCategoryEntry["fields"]["description"]>;
|
|
13
|
-
links: {
|
|
14
|
-
assets: {
|
|
15
|
-
block: GraphQLAssetLink[];
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
} | null;
|
|
12
|
+
description: string | null;
|
|
19
13
|
}
|
|
20
14
|
export type GetBlogCategoriesResponse = PaginatedResponse<BlogCategoryGraphQLItem>;
|
|
21
15
|
export type GetBlogCategoryDetailResponse = BlogCategoryDetailGraphQLItem;
|
|
@@ -10,9 +10,9 @@ type GraphQLSeo = {
|
|
|
10
10
|
metaRobots: string[] | null;
|
|
11
11
|
};
|
|
12
12
|
type BlogPostCategoryGraphQLItem = {
|
|
13
|
+
sys: Pick<GraphQLEntrySys, "id">;
|
|
13
14
|
title: string;
|
|
14
15
|
slug: string;
|
|
15
|
-
featuredImage: GraphQLAsset | null;
|
|
16
16
|
};
|
|
17
17
|
export type BlogPostGraphQLItem = {
|
|
18
18
|
sys: GraphQLEntrySys;
|
package/dist/entries/index.d.ts
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var St=Function.prototype.toString,O=Object.create,kt=Object.prototype.toString,At=(function(){function t(){this._keys=[],this._values=[]}return t.prototype.has=function(e){return!!~this._keys.indexOf(e)},t.prototype.get=function(e){return this._values[this._keys.indexOf(e)]},t.prototype.set=function(e,r){this._keys.push(e),this._values.push(r)},t})();function Ot(){return new At}function jt(){return new WeakMap}var Tt=typeof WeakMap<"u"?jt:Ot;function Q(t){if(!t)return O(null);var e=t.constructor;if(e===Object)return t===Object.prototype?{}:O(t);if(e&&~St.call(e).indexOf("[native code]"))try{return new e}catch{}return O(t)}function qt(t){var e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}function _t(t){return t.flags}var Pt=/test/g.flags==="g"?_t:qt;function lt(t){var e=kt.call(t);return e.substring(8,e.length-1)}function xt(t){return t[Symbol.toStringTag]||lt(t)}var Dt=typeof Symbol<"u"?xt:lt,It=Object.defineProperty,Rt=Object.getOwnPropertyDescriptor,ct=Object.getOwnPropertyNames,F=Object.getOwnPropertySymbols,ut=Object.prototype,gt=ut.hasOwnProperty,Mt=ut.propertyIsEnumerable,ft=typeof F=="function";function zt(t){return ct(t).concat(F(t))}var Bt=ft?zt:ct;function k(t,e,r){for(var a=Bt(t),s=0,i=a.length,o=void 0,n=void 0;s<i;++s)if(o=a[s],!(o==="callee"||o==="caller")){if(n=Rt(t,o),!n){e[o]=r.copier(t[o],r);continue}!n.get&&!n.set&&(n.value=r.copier(n.value,r));try{It(e,o,n)}catch{e[o]=n.value}}return e}function Et(t,e){var r=new e.Constructor;e.cache.set(t,r);for(var a=0,s=t.length;a<s;++a)r[a]=e.copier(t[a],e);return r}function Lt(t,e){var r=new e.Constructor;return e.cache.set(t,r),k(t,r,e)}function pt(t,e){return t.slice(0)}function Vt(t,e){return t.slice(0,t.size,t.type)}function Nt(t,e){return new e.Constructor(pt(t.buffer))}function Qt(t,e){return new e.Constructor(t.getTime())}function ht(t,e){var r=new e.Constructor;return e.cache.set(t,r),t.forEach(function(a,s){r.set(s,e.copier(a,e))}),r}function Ft(t,e){return k(t,ht(t,e),e)}function Gt(t,e){var r=Q(e.prototype);e.cache.set(t,r);for(var a in t)gt.call(t,a)&&(r[a]=e.copier(t[a],e));return r}function Ut(t,e){var r=Q(e.prototype);e.cache.set(t,r);for(var a in t)gt.call(t,a)&&(r[a]=e.copier(t[a],e));for(var s=F(t),i=0,o=s.length,n=void 0;i<o;++i)n=s[i],Mt.call(t,n)&&(r[n]=e.copier(t[n],e));return r}var Kt=ft?Ut:Gt;function Wt(t,e){var r=Q(e.prototype);return e.cache.set(t,r),k(t,r,e)}function j(t,e){return new e.Constructor(t.valueOf())}function Ht(t,e){var r=new e.Constructor(t.source,Pt(t));return r.lastIndex=t.lastIndex,r}function S(t,e){return t}function yt(t,e){var r=new e.Constructor;return e.cache.set(t,r),t.forEach(function(a){r.add(e.copier(a,e))}),r}function Jt(t,e){return k(t,yt(t,e),e)}var Yt=Array.isArray,G=Object.assign,Xt=Object.getPrototypeOf||(function(t){return t.__proto__}),mt={array:Et,arrayBuffer:pt,blob:Vt,dataView:Nt,date:Qt,error:S,map:ht,object:Kt,regExp:Ht,set:yt},Zt=G({},mt,{array:Lt,map:Ft,object:Wt,set:Jt});function te(t){return{Arguments:t.object,Array:t.array,ArrayBuffer:t.arrayBuffer,Blob:t.blob,Boolean:j,DataView:t.dataView,Date:t.date,Error:t.error,Float32Array:t.arrayBuffer,Float64Array:t.arrayBuffer,Int8Array:t.arrayBuffer,Int16Array:t.arrayBuffer,Int32Array:t.arrayBuffer,Map:t.map,Number:j,Object:t.object,Promise:S,RegExp:t.regExp,Set:t.set,String:j,WeakMap:S,WeakSet:S,Uint8Array:t.arrayBuffer,Uint8ClampedArray:t.arrayBuffer,Uint16Array:t.arrayBuffer,Uint32Array:t.arrayBuffer,Uint64Array:t.arrayBuffer}}function dt(t){var e=G({},mt,t),r=te(e),a=r.Array,s=r.Object;function i(o,n){if(n.prototype=n.Constructor=void 0,!o||typeof o!="object")return o;if(n.cache.has(o))return n.cache.get(o);if(n.prototype=Xt(o),n.Constructor=n.prototype&&n.prototype.constructor,!n.Constructor||n.Constructor===Object)return s(o,n);if(Yt(o))return a(o,n);var l=r[Dt(o)];return l?l(o,n):typeof o.then=="function"?o:s(o,n)}return function(n){return i(n,{Constructor:void 0,cache:Tt(),copier:i,prototype:void 0})}}function ee(t){return dt(G({},Zt,t))}ee({});dt({});var C=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},T={exports:{}},U;function re(){if(U)return T.exports;U=1;var t=T.exports={},e,r;function a(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?e=setTimeout:e=a}catch{e=a}try{typeof clearTimeout=="function"?r=clearTimeout:r=s}catch{r=s}})();function i(h){if(e===setTimeout)return setTimeout(h,0);if((e===a||!e)&&setTimeout)return e=setTimeout,setTimeout(h,0);try{return e(h,0)}catch{try{return e.call(null,h,0)}catch{return e.call(this,h,0)}}}function o(h){if(r===clearTimeout)return clearTimeout(h);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(h);try{return r(h)}catch{try{return r.call(null,h)}catch{return r.call(this,h)}}}var n=[],l=!1,c,u=-1;function g(){!l||!c||(l=!1,c.length?n=c.concat(n):u=-1,n.length&&f())}function f(){if(!l){var h=i(g);l=!0;for(var d=n.length;d;){for(c=n,n=[];++u<d;)c&&c[u].run();u=-1,d=n.length}c=null,l=!1,o(h)}}t.nextTick=function(h){var d=new Array(arguments.length-1);if(arguments.length>1)for(var $=1;$<arguments.length;$++)d[$-1]=arguments[$];n.push(new y(h,d)),n.length===1&&!l&&i(f)};function y(h,d){this.fun=h,this.array=d}y.prototype.run=function(){this.fun.apply(null,this.array)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={};function p(){}return t.on=p,t.addListener=p,t.once=p,t.off=p,t.removeListener=p,t.removeAllListeners=p,t.emit=p,t.prependListener=p,t.prependOnceListener=p,t.listeners=function(h){return[]},t.binding=function(h){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(h){throw new Error("process.chdir is not supported")},t.umask=function(){return 0},T.exports}re();var q,K;function oe(){if(K)return q;K=1;var t=typeof C=="object"&&C&&C.Object===Object&&C;return q=t,q}var _,W;function ne(){if(W)return _;W=1;var t=oe(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return _=r,_}var P,H;function bt(){if(H)return P;H=1;var t=ne(),e=t.Symbol;return P=e,P}var x,J;function ie(){if(J)return x;J=1;var t=bt(),e=Object.prototype,r=e.hasOwnProperty,a=e.toString,s=t?t.toStringTag:void 0;function i(o){var n=r.call(o,s),l=o[s];try{o[s]=void 0;var c=!0}catch{}var u=a.call(o);return c&&(n?o[s]=l:delete o[s]),u}return x=i,x}var D,Y;function se(){if(Y)return D;Y=1;var t=Object.prototype,e=t.toString;function r(a){return e.call(a)}return D=r,D}var I,X;function $t(){if(X)return I;X=1;var t=bt(),e=ie(),r=se(),a="[object Null]",s="[object Undefined]",i=t?t.toStringTag:void 0;function o(n){return n==null?n===void 0?s:a:i&&i in Object(n)?e(n):r(n)}return I=o,I}var R,Z;function ae(){if(Z)return R;Z=1;var t=Array.isArray;return R=t,R}var M,tt;function wt(){if(tt)return M;tt=1;function t(e){return e!=null&&typeof e=="object"}return M=t,M}var z,et;function le(){if(et)return z;et=1;var t=$t(),e=ae(),r=wt(),a="[object String]";function s(i){return typeof i=="string"||!e(i)&&r(i)&&t(i)==a}return z=s,z}le();var B,rt;function ce(){if(rt)return B;rt=1;function t(e,r){return function(a){return e(r(a))}}return B=t,B}var E,ot;function ue(){if(ot)return E;ot=1;var t=ce(),e=t(Object.getPrototypeOf,Object);return E=e,E}var L,nt;function ge(){if(nt)return L;nt=1;var t=$t(),e=ue(),r=wt(),a="[object Object]",s=Function.prototype,i=Object.prototype,o=s.toString,n=i.hasOwnProperty,l=o.call(Object);function c(u){if(!r(u)||t(u)!=a)return!1;var g=e(u);if(g===null)return!0;var f=n.call(g,"constructor")&&g.constructor;return typeof f=="function"&&f instanceof f&&o.call(f)==l}return L=c,L}ge();var Ct={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},vt={0:8203,1:8204,2:8205,3:65279};new Array(4).fill(String.fromCodePoint(vt[0])).join("");Object.fromEntries(Object.entries(vt).map(t=>t.reverse()));Object.fromEntries(Object.entries(Ct).map(t=>t.reverse()));`${Object.values(Ct).map(t=>`\\u{${t.toString(16)}}`).join("")}`;var V,it;function fe(){if(it)return V;it=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString;return V=function(r,a,s){if(e.call(a)!=="[object Function]")throw new TypeError("iterator must be a function");var i=r.length;if(i===+i)for(var o=0;o<i;o++)a.call(s,r[o],o,r);else for(var n in r)t.call(r,n)&&a.call(s,r[n],n,r)},V}var N,st;function pe(){if(st)return N;st=1;var t=fe();N=e;function e(r,a,s){if(arguments.length===3)return e.set(r,a,s);if(arguments.length===2)return e.get(r,a);var i=e.bind(e,r);for(var o in e)e.hasOwnProperty(o)&&(i[o]=e[o].bind(i,r));return i}return e.get=function(r,a){for(var s=Array.isArray(a)?a:e.parse(a),i=0;i<s.length;++i){var o=s[i];if(!(typeof r=="object"&&o in r))throw new Error("Invalid reference token: "+o);r=r[o]}return r},e.set=function(r,a,s){var i=Array.isArray(a)?a:e.parse(a),o=i[0];if(i.length===0)throw Error("Can not set the root object");for(var n=0;n<i.length-1;++n){var l=i[n];typeof l!="string"&&typeof l!="number"&&(l=String(l)),!(l==="__proto__"||l==="constructor"||l==="prototype")&&(l==="-"&&Array.isArray(r)&&(l=r.length),o=i[n+1],l in r||(o.match(/^(\d+|-)$/)?r[l]=[]:r[l]={}),r=r[l])}return o==="-"&&Array.isArray(r)&&(o=r.length),r[o]=s,this},e.remove=function(r,a){var s=Array.isArray(a)?a:e.parse(a),i=s[s.length-1];if(i===void 0)throw new Error('Invalid JSON pointer for remove: "'+a+'"');var o=e.get(r,s.slice(0,-1));if(Array.isArray(o)){var n=+i;if(i===""&&isNaN(n))throw new Error('Invalid array index: "'+i+'"');Array.prototype.splice.call(o,n,1)}else delete o[i]},e.dict=function(r,a){var s={};return e.walk(r,function(i,o){s[o]=i},a),s},e.walk=function(r,a,s){var i=[];s=s||function(o){var n=Object.prototype.toString.call(o);return n==="[object Object]"||n==="[object Array]"},(function o(n){t(n,function(l,c){i.push(String(c)),s(l)?o(l):a(l,e.compile(i)),i.pop()})})(r)},e.has=function(r,a){try{e.get(r,a)}catch{return!1}return!0},e.escape=function(r){return r.toString().replace(/~/g,"~0").replace(/\//g,"~1")},e.unescape=function(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")},e.parse=function(r){if(r==="")return[];if(r.charAt(0)!=="/")throw new Error("Invalid JSON pointer: "+r);return r.substring(1).split(/\//).map(e.unescape)},e.compile=function(r){return r.length===0?"":"/"+r.map(e.escape).join("/")},N}pe();var v={exports:{}},at;function he(){return at||(at=1,(function(t,e){e=t.exports=r,e.getSerialize=a;function r(s,i,o,n){return JSON.stringify(s,a(i,n),o)}function a(s,i){var o=[],n=[];return i==null&&(i=function(l,c){return o[0]===c?"[Circular ~]":"[Circular ~."+n.slice(0,o.indexOf(c)).join(".")+"]"}),function(l,c){if(o.length>0){var u=o.indexOf(this);~u?o.splice(u+1):o.push(this),~u?n.splice(u,1/0,l):n.push(l),~o.indexOf(c)&&(c=i.call(this,l,c))}else o.push(c);return s==null?c:s.call(this,l,c)}}})(v,v.exports)),v.exports}he();class m{static _clientParams;static get clientParams(){if(!this._clientParams)throw new Error("Client is not configured");return this._clientParams}static configure(e){this._clientParams={...e,environment:e.environment??"master"}}static async graphqlQuery(e,r={}){const{space:a,accessToken:s,environment:i="master"}=this.clientParams,o=await fetch(`https://graphql.contentful.com/content/v1/spaces/${a}/environments/${i}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${s}`},body:JSON.stringify({query:e,variables:r})});if(!o.ok){const l=await o.text();throw new Error(`GraphQL request failed: ${o.status} ${o.statusText}
|
|
2
|
-
${l}`)}const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var St=Function.prototype.toString,O=Object.create,kt=Object.prototype.toString,At=(function(){function t(){this._keys=[],this._values=[]}return t.prototype.has=function(e){return!!~this._keys.indexOf(e)},t.prototype.get=function(e){return this._values[this._keys.indexOf(e)]},t.prototype.set=function(e,r){this._keys.push(e),this._values.push(r)},t})();function Ot(){return new At}function jt(){return new WeakMap}var Tt=typeof WeakMap<"u"?jt:Ot;function Q(t){if(!t)return O(null);var e=t.constructor;if(e===Object)return t===Object.prototype?{}:O(t);if(e&&~St.call(e).indexOf("[native code]"))try{return new e}catch{}return O(t)}function qt(t){var e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}function _t(t){return t.flags}var Pt=/test/g.flags==="g"?_t:qt;function lt(t){var e=kt.call(t);return e.substring(8,e.length-1)}function xt(t){return t[Symbol.toStringTag]||lt(t)}var It=typeof Symbol<"u"?xt:lt,Dt=Object.defineProperty,Rt=Object.getOwnPropertyDescriptor,ct=Object.getOwnPropertyNames,F=Object.getOwnPropertySymbols,ut=Object.prototype,gt=ut.hasOwnProperty,Mt=ut.propertyIsEnumerable,ft=typeof F=="function";function zt(t){return ct(t).concat(F(t))}var Bt=ft?zt:ct;function k(t,e,r){for(var a=Bt(t),s=0,n=a.length,o=void 0,i=void 0;s<n;++s)if(o=a[s],!(o==="callee"||o==="caller")){if(i=Rt(t,o),!i){e[o]=r.copier(t[o],r);continue}!i.get&&!i.set&&(i.value=r.copier(i.value,r));try{Dt(e,o,i)}catch{e[o]=i.value}}return e}function Et(t,e){var r=new e.Constructor;e.cache.set(t,r);for(var a=0,s=t.length;a<s;++a)r[a]=e.copier(t[a],e);return r}function Lt(t,e){var r=new e.Constructor;return e.cache.set(t,r),k(t,r,e)}function pt(t,e){return t.slice(0)}function Vt(t,e){return t.slice(0,t.size,t.type)}function Nt(t,e){return new e.Constructor(pt(t.buffer))}function Qt(t,e){return new e.Constructor(t.getTime())}function ht(t,e){var r=new e.Constructor;return e.cache.set(t,r),t.forEach(function(a,s){r.set(s,e.copier(a,e))}),r}function Ft(t,e){return k(t,ht(t,e),e)}function Gt(t,e){var r=Q(e.prototype);e.cache.set(t,r);for(var a in t)gt.call(t,a)&&(r[a]=e.copier(t[a],e));return r}function Ut(t,e){var r=Q(e.prototype);e.cache.set(t,r);for(var a in t)gt.call(t,a)&&(r[a]=e.copier(t[a],e));for(var s=F(t),n=0,o=s.length,i=void 0;n<o;++n)i=s[n],Mt.call(t,i)&&(r[i]=e.copier(t[i],e));return r}var Kt=ft?Ut:Gt;function Wt(t,e){var r=Q(e.prototype);return e.cache.set(t,r),k(t,r,e)}function j(t,e){return new e.Constructor(t.valueOf())}function Ht(t,e){var r=new e.Constructor(t.source,Pt(t));return r.lastIndex=t.lastIndex,r}function S(t,e){return t}function yt(t,e){var r=new e.Constructor;return e.cache.set(t,r),t.forEach(function(a){r.add(e.copier(a,e))}),r}function Jt(t,e){return k(t,yt(t,e),e)}var Yt=Array.isArray,G=Object.assign,Xt=Object.getPrototypeOf||(function(t){return t.__proto__}),mt={array:Et,arrayBuffer:pt,blob:Vt,dataView:Nt,date:Qt,error:S,map:ht,object:Kt,regExp:Ht,set:yt},Zt=G({},mt,{array:Lt,map:Ft,object:Wt,set:Jt});function te(t){return{Arguments:t.object,Array:t.array,ArrayBuffer:t.arrayBuffer,Blob:t.blob,Boolean:j,DataView:t.dataView,Date:t.date,Error:t.error,Float32Array:t.arrayBuffer,Float64Array:t.arrayBuffer,Int8Array:t.arrayBuffer,Int16Array:t.arrayBuffer,Int32Array:t.arrayBuffer,Map:t.map,Number:j,Object:t.object,Promise:S,RegExp:t.regExp,Set:t.set,String:j,WeakMap:S,WeakSet:S,Uint8Array:t.arrayBuffer,Uint8ClampedArray:t.arrayBuffer,Uint16Array:t.arrayBuffer,Uint32Array:t.arrayBuffer,Uint64Array:t.arrayBuffer}}function dt(t){var e=G({},mt,t),r=te(e),a=r.Array,s=r.Object;function n(o,i){if(i.prototype=i.Constructor=void 0,!o||typeof o!="object")return o;if(i.cache.has(o))return i.cache.get(o);if(i.prototype=Xt(o),i.Constructor=i.prototype&&i.prototype.constructor,!i.Constructor||i.Constructor===Object)return s(o,i);if(Yt(o))return a(o,i);var l=r[It(o)];return l?l(o,i):typeof o.then=="function"?o:s(o,i)}return function(i){return n(i,{Constructor:void 0,cache:Tt(),copier:n,prototype:void 0})}}function ee(t){return dt(G({},Zt,t))}ee({});dt({});var C=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},T={exports:{}},U;function re(){if(U)return T.exports;U=1;var t=T.exports={},e,r;function a(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?e=setTimeout:e=a}catch{e=a}try{typeof clearTimeout=="function"?r=clearTimeout:r=s}catch{r=s}})();function n(h){if(e===setTimeout)return setTimeout(h,0);if((e===a||!e)&&setTimeout)return e=setTimeout,setTimeout(h,0);try{return e(h,0)}catch{try{return e.call(null,h,0)}catch{return e.call(this,h,0)}}}function o(h){if(r===clearTimeout)return clearTimeout(h);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(h);try{return r(h)}catch{try{return r.call(null,h)}catch{return r.call(this,h)}}}var i=[],l=!1,c,u=-1;function g(){!l||!c||(l=!1,c.length?i=c.concat(i):u=-1,i.length&&f())}function f(){if(!l){var h=n(g);l=!0;for(var d=i.length;d;){for(c=i,i=[];++u<d;)c&&c[u].run();u=-1,d=i.length}c=null,l=!1,o(h)}}t.nextTick=function(h){var d=new Array(arguments.length-1);if(arguments.length>1)for(var $=1;$<arguments.length;$++)d[$-1]=arguments[$];i.push(new y(h,d)),i.length===1&&!l&&n(f)};function y(h,d){this.fun=h,this.array=d}y.prototype.run=function(){this.fun.apply(null,this.array)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={};function p(){}return t.on=p,t.addListener=p,t.once=p,t.off=p,t.removeListener=p,t.removeAllListeners=p,t.emit=p,t.prependListener=p,t.prependOnceListener=p,t.listeners=function(h){return[]},t.binding=function(h){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(h){throw new Error("process.chdir is not supported")},t.umask=function(){return 0},T.exports}re();var q,K;function oe(){if(K)return q;K=1;var t=typeof C=="object"&&C&&C.Object===Object&&C;return q=t,q}var _,W;function ie(){if(W)return _;W=1;var t=oe(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return _=r,_}var P,H;function bt(){if(H)return P;H=1;var t=ie(),e=t.Symbol;return P=e,P}var x,J;function ne(){if(J)return x;J=1;var t=bt(),e=Object.prototype,r=e.hasOwnProperty,a=e.toString,s=t?t.toStringTag:void 0;function n(o){var i=r.call(o,s),l=o[s];try{o[s]=void 0;var c=!0}catch{}var u=a.call(o);return c&&(i?o[s]=l:delete o[s]),u}return x=n,x}var I,Y;function se(){if(Y)return I;Y=1;var t=Object.prototype,e=t.toString;function r(a){return e.call(a)}return I=r,I}var D,X;function $t(){if(X)return D;X=1;var t=bt(),e=ne(),r=se(),a="[object Null]",s="[object Undefined]",n=t?t.toStringTag:void 0;function o(i){return i==null?i===void 0?s:a:n&&n in Object(i)?e(i):r(i)}return D=o,D}var R,Z;function ae(){if(Z)return R;Z=1;var t=Array.isArray;return R=t,R}var M,tt;function wt(){if(tt)return M;tt=1;function t(e){return e!=null&&typeof e=="object"}return M=t,M}var z,et;function le(){if(et)return z;et=1;var t=$t(),e=ae(),r=wt(),a="[object String]";function s(n){return typeof n=="string"||!e(n)&&r(n)&&t(n)==a}return z=s,z}le();var B,rt;function ce(){if(rt)return B;rt=1;function t(e,r){return function(a){return e(r(a))}}return B=t,B}var E,ot;function ue(){if(ot)return E;ot=1;var t=ce(),e=t(Object.getPrototypeOf,Object);return E=e,E}var L,it;function ge(){if(it)return L;it=1;var t=$t(),e=ue(),r=wt(),a="[object Object]",s=Function.prototype,n=Object.prototype,o=s.toString,i=n.hasOwnProperty,l=o.call(Object);function c(u){if(!r(u)||t(u)!=a)return!1;var g=e(u);if(g===null)return!0;var f=i.call(g,"constructor")&&g.constructor;return typeof f=="function"&&f instanceof f&&o.call(f)==l}return L=c,L}ge();var Ct={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},vt={0:8203,1:8204,2:8205,3:65279};new Array(4).fill(String.fromCodePoint(vt[0])).join("");Object.fromEntries(Object.entries(vt).map(t=>t.reverse()));Object.fromEntries(Object.entries(Ct).map(t=>t.reverse()));`${Object.values(Ct).map(t=>`\\u{${t.toString(16)}}`).join("")}`;var V,nt;function fe(){if(nt)return V;nt=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString;return V=function(r,a,s){if(e.call(a)!=="[object Function]")throw new TypeError("iterator must be a function");var n=r.length;if(n===+n)for(var o=0;o<n;o++)a.call(s,r[o],o,r);else for(var i in r)t.call(r,i)&&a.call(s,r[i],i,r)},V}var N,st;function pe(){if(st)return N;st=1;var t=fe();N=e;function e(r,a,s){if(arguments.length===3)return e.set(r,a,s);if(arguments.length===2)return e.get(r,a);var n=e.bind(e,r);for(var o in e)e.hasOwnProperty(o)&&(n[o]=e[o].bind(n,r));return n}return e.get=function(r,a){for(var s=Array.isArray(a)?a:e.parse(a),n=0;n<s.length;++n){var o=s[n];if(!(typeof r=="object"&&o in r))throw new Error("Invalid reference token: "+o);r=r[o]}return r},e.set=function(r,a,s){var n=Array.isArray(a)?a:e.parse(a),o=n[0];if(n.length===0)throw Error("Can not set the root object");for(var i=0;i<n.length-1;++i){var l=n[i];typeof l!="string"&&typeof l!="number"&&(l=String(l)),!(l==="__proto__"||l==="constructor"||l==="prototype")&&(l==="-"&&Array.isArray(r)&&(l=r.length),o=n[i+1],l in r||(o.match(/^(\d+|-)$/)?r[l]=[]:r[l]={}),r=r[l])}return o==="-"&&Array.isArray(r)&&(o=r.length),r[o]=s,this},e.remove=function(r,a){var s=Array.isArray(a)?a:e.parse(a),n=s[s.length-1];if(n===void 0)throw new Error('Invalid JSON pointer for remove: "'+a+'"');var o=e.get(r,s.slice(0,-1));if(Array.isArray(o)){var i=+n;if(n===""&&isNaN(i))throw new Error('Invalid array index: "'+n+'"');Array.prototype.splice.call(o,i,1)}else delete o[n]},e.dict=function(r,a){var s={};return e.walk(r,function(n,o){s[o]=n},a),s},e.walk=function(r,a,s){var n=[];s=s||function(o){var i=Object.prototype.toString.call(o);return i==="[object Object]"||i==="[object Array]"},(function o(i){t(i,function(l,c){n.push(String(c)),s(l)?o(l):a(l,e.compile(n)),n.pop()})})(r)},e.has=function(r,a){try{e.get(r,a)}catch{return!1}return!0},e.escape=function(r){return r.toString().replace(/~/g,"~0").replace(/\//g,"~1")},e.unescape=function(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")},e.parse=function(r){if(r==="")return[];if(r.charAt(0)!=="/")throw new Error("Invalid JSON pointer: "+r);return r.substring(1).split(/\//).map(e.unescape)},e.compile=function(r){return r.length===0?"":"/"+r.map(e.escape).join("/")},N}pe();var v={exports:{}},at;function he(){return at||(at=1,(function(t,e){e=t.exports=r,e.getSerialize=a;function r(s,n,o,i){return JSON.stringify(s,a(n,i),o)}function a(s,n){var o=[],i=[];return n==null&&(n=function(l,c){return o[0]===c?"[Circular ~]":"[Circular ~."+i.slice(0,o.indexOf(c)).join(".")+"]"}),function(l,c){if(o.length>0){var u=o.indexOf(this);~u?o.splice(u+1):o.push(this),~u?i.splice(u,1/0,l):i.push(l),~o.indexOf(c)&&(c=n.call(this,l,c))}else o.push(c);return s==null?c:s.call(this,l,c)}}})(v,v.exports)),v.exports}he();class m{static _clientParams;static get clientParams(){if(!this._clientParams)throw new Error("Client is not configured");return this._clientParams}static configure(e){this._clientParams={...e,environment:e.environment??"master"}}static async graphqlQuery(e,r={}){const{space:a,accessToken:s,environment:n="master"}=this.clientParams,o=await fetch(`https://graphql.contentful.com/content/v1/spaces/${a}/environments/${n}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${s}`},body:JSON.stringify({query:e,variables:r})});if(!o.ok){const l=await o.text();throw new Error(`GraphQL request failed: ${o.status} ${o.statusText}
|
|
2
|
+
${l}`)}const i=await o.json();if(i.errors)throw new Error(`GraphQL errors: ${JSON.stringify(i.errors,null,2)}`);return i.data}}class b{page;total;size;items;constructor({page:e,total:r,size:a,items:s}){this.page=e,this.total=r,this.size=a,this.items=s}get totalPages(){return Math.ceil(this.total/this.size)}}const ye=async({slot:t,page:e=1,size:r=20,platform:a,marketCode:s,locale:n})=>{const o=Math.max(1,Math.floor(e)),i=Math.max(1,Math.floor(r)),l=["$slot: String!","$limit: Int!","$skip: Int!"],c={slot:t,limit:i,skip:(o-1)*i},u=["{ slot: $slot }"];a&&(l.push("$platform: String!"),c.platform=a,u.push("{ platform_contains_some: [$platform] }")),s&&(l.push("$marketCode: String!"),c.marketCode=s,u.push("{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }")),n&&(l.push("$locale: String!"),c.locale=n,u.push("{ OR: [{ locale_exists: false }, { locale: $locale }] }"));const g=`(${l.join(", ")})`,f=`(
|
|
3
3
|
limit: $limit
|
|
4
4
|
skip: $skip
|
|
5
5
|
where: {
|
|
@@ -45,7 +45,7 @@ query${g} {
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
`,{bannerCollectionCollection:p}=await m.graphqlQuery(y,{...c});return new b({page:o,total:p.total,size:
|
|
48
|
+
`,{bannerCollectionCollection:p}=await m.graphqlQuery(y,{...c});return new b({page:o,total:p.total,size:i,items:p.items})};class w extends Response{constructor(...e){super(e[0]??"Not Found",{status:404,...e[1]})}}const me=async({marketCode:t,locale:e,collectionId:r,categoryId:a,page:s=1,size:n=20}={})=>{const o=Math.max(1,Math.floor(s)),i=Math.max(1,Math.floor(n));if(r){const d=`
|
|
49
49
|
query($collectionId: String!, $limit: Int!, $skip: Int!) {
|
|
50
50
|
blogCollectionCollection(limit: 1 where: { sys: { id: $collectionId } }) {
|
|
51
51
|
items {
|
|
@@ -62,6 +62,9 @@ query($collectionId: String!, $limit: Int!, $skip: Int!) {
|
|
|
62
62
|
slug
|
|
63
63
|
categoriesCollection {
|
|
64
64
|
items {
|
|
65
|
+
sys {
|
|
66
|
+
id
|
|
67
|
+
}
|
|
65
68
|
title
|
|
66
69
|
slug
|
|
67
70
|
featuredImage {
|
|
@@ -83,7 +86,7 @@ query($collectionId: String!, $limit: Int!, $skip: Int!) {
|
|
|
83
86
|
}
|
|
84
87
|
}
|
|
85
88
|
}
|
|
86
|
-
`,{blogCollectionCollection:$}=await m.graphqlQuery(d,{collectionId:r,limit:
|
|
89
|
+
`,{blogCollectionCollection:$}=await m.graphqlQuery(d,{collectionId:r,limit:i,skip:(o-1)*i}),A=$.items.at(0);if(!A)throw new w;return new b({page:o,total:A.postsCollection?.total??0,size:i,items:A.postsCollection?.items??[]})}const l=["$limit: Int!","$skip: Int!"],c={limit:i,skip:(o-1)*i},u=["limit: $limit","skip: $skip"],g=[];t&&(l.push("$marketCode: String!"),c.marketCode=t,g.push("{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }")),e&&(l.push("$locale: String!"),c.locale=e,g.push("{ OR: [{ locale_exists: false }, { locale: $locale }] }")),a&&(l.push("$categoryId: String!"),c.categoryId=a,g.push("{ categories: { sys: { id: $categoryId } } }")),g.length&&u.push(`where: {
|
|
87
90
|
AND: [
|
|
88
91
|
${g.join(`
|
|
89
92
|
`)}
|
|
@@ -106,6 +109,9 @@ query${f} {
|
|
|
106
109
|
slug
|
|
107
110
|
categoriesCollection {
|
|
108
111
|
items {
|
|
112
|
+
sys {
|
|
113
|
+
id
|
|
114
|
+
}
|
|
109
115
|
title
|
|
110
116
|
slug
|
|
111
117
|
featuredImage {
|
|
@@ -125,7 +131,7 @@ query${f} {
|
|
|
125
131
|
}
|
|
126
132
|
}
|
|
127
133
|
}
|
|
128
|
-
`,{blogPostCollection:h}=await m.graphqlQuery(p,{...c});return new b({page:o,total:h.total,size:
|
|
134
|
+
`,{blogPostCollection:h}=await m.graphqlQuery(p,{...c});return new b({page:o,total:h.total,size:i,items:h.items})},de=async({id:t,slug:e,marketCode:r,locale:a})=>{const s=[],n={},o=[];if(t)s.push("$id: String!"),n.id=t,o.push("{ sys: { id: $id } }");else if(e)s.push("$slug: String!"),n.slug=e,o.push("{ slug: $slug }");else throw new Error("Either id or slug is required.");r&&(s.push("$marketCode: String!"),n.marketCode=r,o.push("{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }")),a&&(s.push("$locale: String!"),n.locale=a,o.push("{ OR: [{ locale_exists: false }, { locale: $locale }] }"));const i=`(${s.join(", ")})`,l=`(
|
|
129
135
|
limit: 1
|
|
130
136
|
where: {
|
|
131
137
|
AND: [
|
|
@@ -134,7 +140,7 @@ query${f} {
|
|
|
134
140
|
]
|
|
135
141
|
}
|
|
136
142
|
)`,c=`
|
|
137
|
-
query${
|
|
143
|
+
query${i} {
|
|
138
144
|
blogPostCollection${l} {
|
|
139
145
|
items {
|
|
140
146
|
sys {
|
|
@@ -147,6 +153,9 @@ query${n} {
|
|
|
147
153
|
slug
|
|
148
154
|
categoriesCollection {
|
|
149
155
|
items {
|
|
156
|
+
sys {
|
|
157
|
+
id
|
|
158
|
+
}
|
|
150
159
|
title
|
|
151
160
|
slug
|
|
152
161
|
featuredImage {
|
|
@@ -199,7 +208,7 @@ query${n} {
|
|
|
199
208
|
}
|
|
200
209
|
}
|
|
201
210
|
}
|
|
202
|
-
`,{blogPostCollection:u}=await m.graphqlQuery(c,{...
|
|
211
|
+
`,{blogPostCollection:u}=await m.graphqlQuery(c,{...n}),g=u.items.at(0);if(!g)throw new w;return g},be=async({marketCode:t,locale:e,page:r=1,size:a=20}={})=>{const s=Math.max(1,Math.floor(r)),n=Math.max(1,Math.floor(a)),o=["$limit: Int!","$skip: Int!"],i={limit:n,skip:(s-1)*n},l=["limit: $limit","skip: $skip"],c=[];t&&(o.push("$marketCode: String!"),i.marketCode=t,c.push("{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }")),e&&(o.push("$locale: String!"),i.locale=e,c.push("{ OR: [{ locale_exists: false }, { locale: $locale }] }")),c.length&&l.push(`where: {
|
|
203
212
|
AND: [
|
|
204
213
|
${c.join(`
|
|
205
214
|
`)}
|
|
@@ -217,10 +226,16 @@ query${u} {
|
|
|
217
226
|
}
|
|
218
227
|
title
|
|
219
228
|
slug
|
|
229
|
+
featuredImage {
|
|
230
|
+
url
|
|
231
|
+
width
|
|
232
|
+
height
|
|
233
|
+
contentType
|
|
234
|
+
}
|
|
220
235
|
}
|
|
221
236
|
}
|
|
222
237
|
}
|
|
223
|
-
`,{blogCategoryCollection:y}=await m.graphqlQuery(f,{...
|
|
238
|
+
`,{blogCategoryCollection:y}=await m.graphqlQuery(f,{...i});return new b({page:s,total:y.total,size:n,items:y.items})},$e=async({id:t,slug:e,marketCode:r,locale:a})=>{const s=[],n={},o=[];if(t)s.push("$id: String!"),n.id=t,o.push("{ sys: { id: $id } }");else if(e)s.push("$slug: String!"),n.slug=e,o.push("{ slug: $slug }");else throw new Error("Either id or slug is required.");r&&(s.push("$marketCode: String!"),n.marketCode=r,o.push("{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }")),a&&(s.push("$locale: String!"),n.locale=a,o.push("{ OR: [{ locale_exists: false }, { locale: $locale }] }"));const i=`(${s.join(", ")})`,l=`(
|
|
224
239
|
limit: 1
|
|
225
240
|
where: {
|
|
226
241
|
AND: [
|
|
@@ -229,7 +244,7 @@ query${u} {
|
|
|
229
244
|
]
|
|
230
245
|
}
|
|
231
246
|
)`,c=`
|
|
232
|
-
query${
|
|
247
|
+
query${i} {
|
|
233
248
|
blogCategoryCollection${l} {
|
|
234
249
|
items {
|
|
235
250
|
sys {
|
|
@@ -237,28 +252,17 @@ query${n} {
|
|
|
237
252
|
}
|
|
238
253
|
title
|
|
239
254
|
slug
|
|
240
|
-
description
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
id
|
|
247
|
-
}
|
|
248
|
-
url
|
|
249
|
-
width
|
|
250
|
-
height
|
|
251
|
-
contentType
|
|
252
|
-
title
|
|
253
|
-
description
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
}
|
|
255
|
+
description
|
|
256
|
+
featuredImage {
|
|
257
|
+
url
|
|
258
|
+
width
|
|
259
|
+
height
|
|
260
|
+
contentType
|
|
257
261
|
}
|
|
258
262
|
}
|
|
259
263
|
}
|
|
260
264
|
}
|
|
261
|
-
`,{blogCategoryCollection:u}=await m.graphqlQuery(c,{...
|
|
265
|
+
`,{blogCategoryCollection:u}=await m.graphqlQuery(c,{...n}),g=u.items.at(0);if(!g)throw new w;return g},we=async({marketCode:t,locale:e,page:r=1,size:a=20}={})=>{const s=Math.max(1,Math.floor(r)),n=Math.max(1,Math.floor(a)),o=["$limit: Int!","$skip: Int!"],i={limit:n,skip:(s-1)*n},l=["limit: $limit","skip: $skip"],c=[];t&&(o.push("$marketCode: String!"),i.marketCode=t,c.push("{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }")),e&&(o.push("$locale: String!"),i.locale=e,c.push("{ OR: [{ locale_exists: false }, { locale: $locale }] }")),c.length&&l.push(`where: {
|
|
262
266
|
AND: [
|
|
263
267
|
${c.join(`
|
|
264
268
|
`)}
|
|
@@ -293,7 +297,7 @@ query${u} {
|
|
|
293
297
|
}
|
|
294
298
|
}
|
|
295
299
|
}
|
|
296
|
-
`,{blogCollectionCollection:y}=await m.graphqlQuery(f,{...
|
|
300
|
+
`,{blogCollectionCollection:y}=await m.graphqlQuery(f,{...i});return new b({page:s,total:y.total,size:n,items:y.items.map(p=>({...p,category:p.type==="category"?p.category:null,categoryId:p.type==="category"?p.category?.sys.id??null:null,collectionId:p.type==="manual"?p.sys.id:null}))})},Ce=async({page:t=1,size:e=20,marketCode:r,locale:a}={})=>{const s=Math.max(1,Math.floor(t)),n=Math.max(1,Math.floor(e)),o=["$limit: Int!","$skip: Int!"],i={limit:n,skip:(s-1)*n},l=[];r&&(o.push("$marketCode: String!"),i.marketCode=r,l.push("{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }")),a&&(o.push("$locale: String!"),i.locale=a,l.push("{ OR: [{ locale_exists: false }, { locale: $locale }] }"));const c=`(${o.join(", ")})`,u=l.length?`(
|
|
297
301
|
limit: $limit
|
|
298
302
|
skip: $skip
|
|
299
303
|
where: {
|
|
@@ -341,7 +345,7 @@ query${c} {
|
|
|
341
345
|
}
|
|
342
346
|
}
|
|
343
347
|
}
|
|
344
|
-
`,{brandCollectionCollection:f}=await m.graphqlQuery(g,{...
|
|
348
|
+
`,{brandCollectionCollection:f}=await m.graphqlQuery(g,{...i});return new b({page:s,total:f.total,size:n,items:f.items})},ve=async({marketCode:t,locale:e,page:r=1,size:a=20}={})=>{const s=Math.max(1,Math.floor(r)),n=Math.max(1,Math.floor(a)),o=["$limit: Int!","$skip: Int!"],i={limit:n,skip:(s-1)*n},l=["limit: $limit","skip: $skip"],c=[];t&&(o.push("$marketCode: String!"),i.marketCode=t,c.push("{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }")),e&&(o.push("$locale: String!"),i.locale=e,c.push("{ OR: [{ locale_exists: false }, { locale: $locale }] }")),c.length&&l.push(`where: {
|
|
345
349
|
AND: [
|
|
346
350
|
${c.join(`
|
|
347
351
|
`)}
|
|
@@ -372,7 +376,7 @@ query${u} {
|
|
|
372
376
|
}
|
|
373
377
|
}
|
|
374
378
|
}
|
|
375
|
-
`,{documentationCategoryCollection:y}=await m.graphqlQuery(f,{...
|
|
379
|
+
`,{documentationCategoryCollection:y}=await m.graphqlQuery(f,{...i});return new b({page:s,total:y.total,size:n,items:y.items})},Se=async({id:t,slug:e,marketCode:r,locale:a})=>{const s=[],n={},o=[];if(t)s.push("$id: String!"),n.id=t,o.push("{ sys: { id: $id } }");else if(e)s.push("$slug: String!"),n.slug=e,o.push("{ slug: $slug }");else throw new Error("Either id or slug is required.");r&&(s.push("$marketCode: String!"),n.marketCode=r,o.push("{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }")),a&&(s.push("$locale: String!"),n.locale=a,o.push("{ OR: [{ locale_exists: false }, { locale: $locale }] }"));const i=`(${s.join(", ")})`,l=`(
|
|
376
380
|
limit: 1
|
|
377
381
|
where: {
|
|
378
382
|
AND: [
|
|
@@ -381,7 +385,7 @@ query${u} {
|
|
|
381
385
|
]
|
|
382
386
|
}
|
|
383
387
|
)`,c=`
|
|
384
|
-
query${
|
|
388
|
+
query${i} {
|
|
385
389
|
documentationCategoryCollection${l} {
|
|
386
390
|
items {
|
|
387
391
|
sys {
|
|
@@ -402,12 +406,12 @@ query${n} {
|
|
|
402
406
|
}
|
|
403
407
|
}
|
|
404
408
|
}
|
|
405
|
-
`,{documentationCategoryCollection:u}=await m.graphqlQuery(c,{...
|
|
409
|
+
`,{documentationCategoryCollection:u}=await m.graphqlQuery(c,{...n}),g=u.items.at(0);if(!g)throw new w;return g},ke=async({marketCode:t,locale:e,categorySlug:r,page:a=1,size:s=20}={})=>{const n=Math.max(1,Math.floor(a)),o=Math.max(1,Math.floor(s)),i=["$limit: Int!","$skip: Int!"],l={limit:o,skip:(n-1)*o},c=["limit: $limit","skip: $skip"],u=[];t&&(i.push("$marketCode: String!"),l.marketCode=t,u.push("{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }")),e&&(i.push("$locale: String!"),l.locale=e,u.push("{ OR: [{ locale_exists: false }, { locale: $locale }] }")),r&&(i.push("$categorySlug: String!"),l.categorySlug=r,u.push("{ category: { slug: $categorySlug } }")),u.length&&c.push(`where: {
|
|
406
410
|
AND: [
|
|
407
411
|
${u.join(`
|
|
408
412
|
`)}
|
|
409
413
|
]
|
|
410
|
-
}`);const g=
|
|
414
|
+
}`);const g=i.length?`(${i.join(", ")})`:"",f=c.length?`(
|
|
411
415
|
${c.join(`
|
|
412
416
|
`)}
|
|
413
417
|
)`:"",y=`
|
|
@@ -440,7 +444,7 @@ query${g} {
|
|
|
440
444
|
}
|
|
441
445
|
}
|
|
442
446
|
}
|
|
443
|
-
`,{documentationArticleCollection:p}=await m.graphqlQuery(y,{...l});return new b({page:
|
|
447
|
+
`,{documentationArticleCollection:p}=await m.graphqlQuery(y,{...l});return new b({page:n,total:p.total,size:o,items:p.items})},Ae=async({id:t,slug:e,marketCode:r,locale:a})=>{const s=[],n={},o=[];if(t)s.push("$id: String!"),n.id=t,o.push("{ sys: { id: $id } }");else if(e)s.push("$slug: String!"),n.slug=e,o.push("{ slug: $slug }");else throw new Error("Either id or slug is required.");r&&(s.push("$marketCode: String!"),n.marketCode=r,o.push("{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }")),a&&(s.push("$locale: String!"),n.locale=a,o.push("{ OR: [{ locale_exists: false }, { locale: $locale }] }"));const i=`(${s.join(", ")})`,l=`(
|
|
444
448
|
limit: 1
|
|
445
449
|
where: {
|
|
446
450
|
AND: [
|
|
@@ -449,7 +453,7 @@ query${g} {
|
|
|
449
453
|
]
|
|
450
454
|
}
|
|
451
455
|
)`,c=`
|
|
452
|
-
query${
|
|
456
|
+
query${i} {
|
|
453
457
|
documentationArticleCollection${l} {
|
|
454
458
|
items {
|
|
455
459
|
sys {
|
|
@@ -501,7 +505,7 @@ query${n} {
|
|
|
501
505
|
}
|
|
502
506
|
}
|
|
503
507
|
}
|
|
504
|
-
`,{documentationArticleCollection:u}=await m.graphqlQuery(c,{...
|
|
508
|
+
`,{documentationArticleCollection:u}=await m.graphqlQuery(c,{...n}),g=u.items.at(0);if(!g)throw new w;return g},Oe=async({page:t=1,size:e=20,marketCode:r,locale:a}={})=>{const s=Math.max(1,Math.floor(t)),n=Math.max(1,Math.floor(e)),o=["$limit: Int!","$skip: Int!"],i={limit:n,skip:(s-1)*n},l=[];r&&(o.push("$marketCode: String!"),i.marketCode=r,l.push("{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }")),a&&(o.push("$locale: String!"),i.locale=a,l.push("{ OR: [{ locale_exists: false }, { locale: $locale }] }"));const c=o.length?`(${o.join(", ")})`:"",u=l.length?`(
|
|
505
509
|
limit: $limit
|
|
506
510
|
skip: $skip
|
|
507
511
|
order: order_ASC
|
|
@@ -540,7 +544,7 @@ query${c} {
|
|
|
540
544
|
}
|
|
541
545
|
}
|
|
542
546
|
}
|
|
543
|
-
`,{hyperlinkCollectionCollection:f}=await m.graphqlQuery(g,{...
|
|
547
|
+
`,{hyperlinkCollectionCollection:f}=await m.graphqlQuery(g,{...i});return new b({page:s,total:f.total,size:n,items:f.items})},je=async({page:t=1,size:e=20,marketCode:r,locale:a}={})=>{const s=Math.max(1,Math.floor(t)),n=Math.max(1,Math.floor(e)),o=["$limit: Int!","$skip: Int!"],i={limit:n,skip:(s-1)*n},l=[];r&&(o.push("$marketCode: String!"),i.marketCode=r,l.push("{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }")),a&&(o.push("$locale: String!"),i.locale=a,l.push("{ OR: [{ locale_exists: false }, { locale: $locale }] }"));const c=`(${o.join(", ")})`,u=l.length?`(
|
|
544
548
|
limit: $limit
|
|
545
549
|
skip: $skip
|
|
546
550
|
where: {
|
|
@@ -566,4 +570,4 @@ query${c} {
|
|
|
566
570
|
}
|
|
567
571
|
}
|
|
568
572
|
}
|
|
569
|
-
`,{keywordCollectionCollection:f}=await m.graphqlQuery(g,{...
|
|
573
|
+
`,{keywordCollectionCollection:f}=await m.graphqlQuery(g,{...i});return new b({page:s,total:f.total,size:n,items:f.items})};exports.ContentfulSDK=m;exports.PaginatedResponse=b;exports.getBannerCollections=ye;exports.getBlogCategories=be;exports.getBlogCategoryDetail=$e;exports.getBlogCollections=we;exports.getBlogPostDetail=de;exports.getBlogPosts=me;exports.getBrandCollections=Ce;exports.getDocArticleDetail=Ae;exports.getDocArticles=ke;exports.getDocCategories=ve;exports.getDocCategoryDetail=Se;exports.getHyperlinkCollections=Oe;exports.getKeywordCollections=je;
|