@janbox/contentful-marketplace-sdk 1.0.13 → 1.0.14

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,3 +1,4 @@
1
+ import { PaginatedResponse } from '../utils';
1
2
  import { GraphQLAsset, TypeBannerCollectionSkeleton } from '../types';
2
3
  import { Entry, EntrySys } from 'contentful';
3
4
  import { HyperlinkEntry } from './hyperlink';
@@ -16,12 +17,7 @@ export type BannerCollectionGraphQLItem = {
16
17
  }>;
17
18
  };
18
19
  } & Pick<BannerCollectionEntry["fields"], "name" | "slot" | "platform">;
19
- export type GetBannerCollectionsResponse = {
20
- page: number;
21
- total: number;
22
- size: number;
23
- items: BannerCollectionGraphQLItem[];
24
- };
20
+ export type GetBannerCollectionsResponse = PaginatedResponse<BannerCollectionGraphQLItem>;
25
21
  export declare const getBannerCollections: ({ slot, page, size, platform, marketCode, locale, }: {
26
22
  slot: BannerCollectionEntry["fields"]["slot"];
27
23
  page?: number;
@@ -1,3 +1,4 @@
1
+ import { PaginatedResponse } from '../utils';
1
2
  import { GraphQLAssetLink, TypeBlogCategorySkeleton } from '../types';
2
3
  import { Entry } from 'contentful';
3
4
  type BlogCategoryEntry = Entry<TypeBlogCategorySkeleton, "WITHOUT_UNRESOLVABLE_LINKS", string>;
@@ -16,12 +17,7 @@ export interface BlogCategoryDetailGraphQLItem extends BlogCategoryGraphQLItem {
16
17
  };
17
18
  } | null;
18
19
  }
19
- export type GetBlogCategoriesResponse = {
20
- page: number;
21
- total: number;
22
- size: number;
23
- items: BlogCategoryGraphQLItem[];
24
- };
20
+ export type GetBlogCategoriesResponse = PaginatedResponse<BlogCategoryGraphQLItem>;
25
21
  export type GetBlogCategoryDetailResponse = BlogCategoryDetailGraphQLItem;
26
22
  export declare const getBlogCategories: ({ marketCode, locale, page, size, }?: {
27
23
  marketCode?: string;
@@ -1,4 +1,5 @@
1
1
  import { TypeBlogCollectionSkeleton, GraphQLAsset } from '../types';
2
+ import { PaginatedResponse } from '../utils';
2
3
  import { Entry } from 'contentful';
3
4
  type BlogCollectionEntry = Entry<TypeBlogCollectionSkeleton, "WITHOUT_UNRESOLVABLE_LINKS", string>;
4
5
  type BlogCollectionCategoryGraphQLItem = {
@@ -14,13 +15,10 @@ export type BlogCollectionGraphQLItem = {
14
15
  };
15
16
  category: BlogCollectionCategoryGraphQLItem | null;
16
17
  featuredImage: GraphQLAsset | null;
18
+ categoryId: string | null;
19
+ collectionId: string | null;
17
20
  } & Pick<BlogCollectionEntry["fields"], "name" | "type" | "order">;
18
- export type GetBlogCollectionsResponse = {
19
- page: number;
20
- total: number;
21
- size: number;
22
- items: BlogCollectionGraphQLItem[];
23
- };
21
+ export type GetBlogCollectionsResponse = PaginatedResponse<BlogCollectionGraphQLItem>;
24
22
  export declare const getBlogCollections: ({ marketCode, locale, page, size, }?: {
25
23
  marketCode?: string;
26
24
  locale?: string;
@@ -1,4 +1,5 @@
1
1
  import { GraphQLAsset, GraphQLAssetLink, TypeBlogPostSkeleton } from '../types';
2
+ import { PaginatedResponse } from '../utils';
2
3
  import { Entry, EntrySys } from 'contentful';
3
4
  type BlogPostEntry = Entry<TypeBlogPostSkeleton, "WITHOUT_UNRESOLVABLE_LINKS", string>;
4
5
  type GraphQLEntrySys = Pick<EntrySys, "id" | "createdAt" | "updatedAt">;
@@ -11,6 +12,7 @@ type GraphQLSeo = {
11
12
  type BlogPostCategoryGraphQLItem = {
12
13
  title: string;
13
14
  slug: string;
15
+ featuredImage: GraphQLAsset | null;
14
16
  };
15
17
  export type BlogPostGraphQLItem = {
16
18
  sys: GraphQLEntrySys;
@@ -34,12 +36,7 @@ export interface BlogPostDetailGraphQLItem extends BlogPostGraphQLItem {
34
36
  };
35
37
  seo: GraphQLSeo | null;
36
38
  }
37
- export type GetBlogPostsResponse = {
38
- page: number;
39
- total: number;
40
- size: number;
41
- items: BlogPostGraphQLItem[];
42
- };
39
+ export type GetBlogPostsResponse = PaginatedResponse<BlogPostGraphQLItem>;
43
40
  export type GetBlogPostDetailResponse = BlogPostDetailGraphQLItem;
44
41
  export declare const getBlogPosts: ({ marketCode, locale, collectionId, categoryId, page, size, }?: {
45
42
  marketCode?: string;
@@ -1,3 +1,4 @@
1
+ import { PaginatedResponse } from '../utils';
1
2
  import { GraphQLAsset, TypeBrandCollectionSkeleton, TypeBrandSkeleton } from '../types';
2
3
  import { Entry, EntrySys } from 'contentful';
3
4
  import { HyperlinkEntry } from './hyperlink';
@@ -16,12 +17,7 @@ export type BrandCollectionGraphQLItem = {
16
17
  } & Pick<BrandEntry["fields"], "name">>;
17
18
  };
18
19
  } & Pick<BrandCollectionEntry["fields"], "name" | "slot">;
19
- export type GetBrandCollectionsResponse = {
20
- page: number;
21
- total: number;
22
- size: number;
23
- items: BrandCollectionGraphQLItem[];
24
- };
20
+ export type GetBrandCollectionsResponse = PaginatedResponse<BrandCollectionGraphQLItem>;
25
21
  export declare const getBrandCollections: ({ page, size, marketCode, locale, }?: {
26
22
  page?: number;
27
23
  size?: number;
@@ -1,4 +1,5 @@
1
1
  import { GraphQLAsset, GraphQLAssetLink, TypeDocumentationArticleSkeleton, TypeDocumentationCategorySkeleton } from '../types';
2
+ import { PaginatedResponse } from '../utils';
2
3
  import { Entry, EntrySys } from 'contentful';
3
4
  export type DocCategoryEntry = Entry<TypeDocumentationCategorySkeleton, "WITHOUT_UNRESOLVABLE_LINKS", string>;
4
5
  export type DocArticleEntry = Entry<TypeDocumentationArticleSkeleton, "WITHOUT_UNRESOLVABLE_LINKS", string>;
@@ -33,19 +34,9 @@ export interface DocArticleDetailGraphQLItem extends DocArticleGraphQLItem {
33
34
  };
34
35
  seo: GraphQLSeo | null;
35
36
  }
36
- export type GetDocCategoriesResponse = {
37
- page: number;
38
- total: number;
39
- size: number;
40
- items: DocCategoryGraphQLItem[];
41
- };
37
+ export type GetDocCategoriesResponse = PaginatedResponse<DocCategoryGraphQLItem>;
42
38
  export type GetDocCategoryDetailResponse = DocCategoryGraphQLItem;
43
- export type getDocArticlesResponse = {
44
- page: number;
45
- total: number;
46
- size: number;
47
- items: DocArticleGraphQLItem[];
48
- };
39
+ export type GetDocArticlesResponse = PaginatedResponse<DocArticleGraphQLItem>;
49
40
  export type GetDocArticleDetailResponse = DocArticleDetailGraphQLItem;
50
41
  export declare const getDocCategories: ({ marketCode, locale, page, size, }?: {
51
42
  marketCode?: string;
@@ -65,7 +56,7 @@ export declare const getDocArticles: ({ marketCode, locale, categorySlug, page,
65
56
  categorySlug?: string;
66
57
  page?: number;
67
58
  size?: number;
68
- }) => Promise<getDocArticlesResponse>;
59
+ }) => Promise<GetDocArticlesResponse>;
69
60
  export declare const getDocArticleDetail: ({ id, slug, marketCode, locale, }: {
70
61
  id?: string;
71
62
  slug?: string;
@@ -1,3 +1,4 @@
1
+ import { PaginatedResponse } from '../utils';
1
2
  import { TypeHyperlinkCollectionSkeleton } from '../types';
2
3
  import { Entry, EntrySys } from 'contentful';
3
4
  import { HyperlinkEntry } from './hyperlink';
@@ -11,12 +12,7 @@ export type HyperlinkCollectionGraphQLItem = {
11
12
  } & Pick<HyperlinkEntry["fields"], "label" | "url" | "target" | 'marketHandling'>>;
12
13
  };
13
14
  } & Pick<HyperlinkCollectionEntry["fields"], "name" | "slot" | "order">;
14
- export type GetHyperlinkCollectionsResponse = {
15
- page: number;
16
- total: number;
17
- size: number;
18
- items: HyperlinkCollectionGraphQLItem[];
19
- };
15
+ export type GetHyperlinkCollectionsResponse = PaginatedResponse<HyperlinkCollectionGraphQLItem>;
20
16
  export declare const getHyperlinkCollections: ({ page, size, marketCode, locale, }?: {
21
17
  page?: number;
22
18
  size?: number;
@@ -1,3 +1,4 @@
1
+ import { PaginatedResponse } from '../utils';
1
2
  import { TypeKeywordCollectionSkeleton } from '../types';
2
3
  import { Entry, EntrySys } from 'contentful';
3
4
  type KeywordCollectionEntry = Entry<TypeKeywordCollectionSkeleton, "WITHOUT_UNRESOLVABLE_LINKS", string>;
@@ -5,12 +6,7 @@ type GraphQLEntrySys = Pick<EntrySys, "id">;
5
6
  export type KeywordCollectionGraphQLItem = {
6
7
  sys: GraphQLEntrySys;
7
8
  } & Pick<KeywordCollectionEntry["fields"], "name" | "slot" | "keywords">;
8
- export type GetKeywordCollectionsResponse = {
9
- page: number;
10
- total: number;
11
- size: number;
12
- items: KeywordCollectionGraphQLItem[];
13
- };
9
+ export type GetKeywordCollectionsResponse = PaginatedResponse<KeywordCollectionGraphQLItem>;
14
10
  export declare const getKeywordCollections: ({ page, size, marketCode, locale, }?: {
15
11
  page?: number;
16
12
  size?: number;
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var vt=Function.prototype.toString,A=Object.create,St=Object.prototype.toString,kt=(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 At(){return new kt}function Ot(){return new WeakMap}var jt=typeof WeakMap<"u"?Ot:At;function N(t){if(!t)return A(null);var e=t.constructor;if(e===Object)return t===Object.prototype?{}:A(t);if(e&&~vt.call(e).indexOf("[native code]"))try{return new e}catch{}return A(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 Tt(t){return t.flags}var _t=/test/g.flags==="g"?Tt:qt;function at(t){var e=St.call(t);return e.substring(8,e.length-1)}function Pt(t){return t[Symbol.toStringTag]||at(t)}var xt=typeof Symbol<"u"?Pt:at,Dt=Object.defineProperty,Rt=Object.getOwnPropertyDescriptor,lt=Object.getOwnPropertyNames,Q=Object.getOwnPropertySymbols,ct=Object.prototype,ut=ct.hasOwnProperty,It=ct.propertyIsEnumerable,ft=typeof Q=="function";function Mt(t){return lt(t).concat(Q(t))}var zt=ft?Mt:lt;function S(t,e,r){for(var a=zt(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 Bt(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 Et(t,e){var r=new e.Constructor;return e.cache.set(t,r),S(t,r,e)}function gt(t,e){return t.slice(0)}function Lt(t,e){return t.slice(0,t.size,t.type)}function Vt(t,e){return new e.Constructor(gt(t.buffer))}function Nt(t,e){return new e.Constructor(t.getTime())}function pt(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 Qt(t,e){return S(t,pt(t,e),e)}function Ft(t,e){var r=N(e.prototype);e.cache.set(t,r);for(var a in t)ut.call(t,a)&&(r[a]=e.copier(t[a],e));return r}function Gt(t,e){var r=N(e.prototype);e.cache.set(t,r);for(var a in t)ut.call(t,a)&&(r[a]=e.copier(t[a],e));for(var s=Q(t),n=0,o=s.length,i=void 0;n<o;++n)i=s[n],It.call(t,i)&&(r[i]=e.copier(t[i],e));return r}var Ut=ft?Gt:Ft;function Kt(t,e){var r=N(e.prototype);return e.cache.set(t,r),S(t,r,e)}function O(t,e){return new e.Constructor(t.valueOf())}function Wt(t,e){var r=new e.Constructor(t.source,_t(t));return r.lastIndex=t.lastIndex,r}function v(t,e){return t}function ht(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 Ht(t,e){return S(t,ht(t,e),e)}var Jt=Array.isArray,F=Object.assign,Yt=Object.getPrototypeOf||(function(t){return t.__proto__}),mt={array:Bt,arrayBuffer:gt,blob:Lt,dataView:Vt,date:Nt,error:v,map:pt,object:Ut,regExp:Wt,set:ht},Xt=F({},mt,{array:Et,map:Qt,object:Kt,set:Ht});function Zt(t){return{Arguments:t.object,Array:t.array,ArrayBuffer:t.arrayBuffer,Blob:t.blob,Boolean:O,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:O,Object:t.object,Promise:v,RegExp:t.regExp,Set:t.set,String:O,WeakMap:v,WeakSet:v,Uint8Array:t.arrayBuffer,Uint8ClampedArray:t.arrayBuffer,Uint16Array:t.arrayBuffer,Uint32Array:t.arrayBuffer,Uint64Array:t.arrayBuffer}}function yt(t){var e=F({},mt,t),r=Zt(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=Yt(o),i.Constructor=i.prototype&&i.prototype.constructor,!i.Constructor||i.Constructor===Object)return s(o,i);if(Jt(o))return a(o,i);var l=r[xt(o)];return l?l(o,i):typeof o.then=="function"?o:s(o,i)}return function(i){return n(i,{Constructor:void 0,cache:jt(),copier:n,prototype:void 0})}}function te(t){return yt(F({},Xt,t))}te({});yt({});var C=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},j={exports:{}},G;function ee(){if(G)return j.exports;G=1;var t=j.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(p){if(e===setTimeout)return setTimeout(p,0);if((e===a||!e)&&setTimeout)return e=setTimeout,setTimeout(p,0);try{return e(p,0)}catch{try{return e.call(null,p,0)}catch{return e.call(this,p,0)}}}function o(p){if(r===clearTimeout)return clearTimeout(p);if((r===s||!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=[],l=!1,c,u=-1;function f(){!l||!c||(l=!1,c.length?i=c.concat(i):u=-1,i.length&&g())}function g(){if(!l){var p=n(f);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(p)}}t.nextTick=function(p){var d=new Array(arguments.length-1);if(arguments.length>1)for(var b=1;b<arguments.length;b++)d[b-1]=arguments[b];i.push(new h(p,d)),i.length===1&&!l&&n(g)};function h(p,d){this.fun=p,this.array=d}h.prototype.run=function(){this.fun.apply(null,this.array)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={};function m(){}return t.on=m,t.addListener=m,t.once=m,t.off=m,t.removeListener=m,t.removeAllListeners=m,t.emit=m,t.prependListener=m,t.prependOnceListener=m,t.listeners=function(p){return[]},t.binding=function(p){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(p){throw new Error("process.chdir is not supported")},t.umask=function(){return 0},j.exports}ee();var q,U;function re(){if(U)return q;U=1;var t=typeof C=="object"&&C&&C.Object===Object&&C;return q=t,q}var T,K;function oe(){if(K)return T;K=1;var t=re(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return T=r,T}var _,W;function dt(){if(W)return _;W=1;var t=oe(),e=t.Symbol;return _=e,_}var P,H;function ie(){if(H)return P;H=1;var t=dt(),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 P=n,P}var x,J;function ne(){if(J)return x;J=1;var t=Object.prototype,e=t.toString;function r(a){return e.call(a)}return x=r,x}var D,Y;function bt(){if(Y)return D;Y=1;var t=dt(),e=ie(),r=ne(),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,X;function se(){if(X)return R;X=1;var t=Array.isArray;return R=t,R}var I,Z;function $t(){if(Z)return I;Z=1;function t(e){return e!=null&&typeof e=="object"}return I=t,I}var M,tt;function ae(){if(tt)return M;tt=1;var t=bt(),e=se(),r=$t(),a="[object String]";function s(n){return typeof n=="string"||!e(n)&&r(n)&&t(n)==a}return M=s,M}ae();var z,et;function le(){if(et)return z;et=1;function t(e,r){return function(a){return e(r(a))}}return z=t,z}var B,rt;function ce(){if(rt)return B;rt=1;var t=le(),e=t(Object.getPrototypeOf,Object);return B=e,B}var E,ot;function ue(){if(ot)return E;ot=1;var t=bt(),e=ce(),r=$t(),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 f=e(u);if(f===null)return!0;var g=i.call(f,"constructor")&&f.constructor;return typeof g=="function"&&g instanceof g&&o.call(g)==l}return E=c,E}ue();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},wt={0:8203,1:8204,2:8205,3:65279};new Array(4).fill(String.fromCodePoint(wt[0])).join("");Object.fromEntries(Object.entries(wt).map(t=>t.reverse()));Object.fromEntries(Object.entries(Ct).map(t=>t.reverse()));`${Object.values(Ct).map(t=>`\\u{${t.toString(16)}}`).join("")}`;var L,it;function fe(){if(it)return L;it=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString;return L=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)},L}var V,nt;function ge(){if(nt)return V;nt=1;var t=fe();V=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("/")},V}ge();var w={exports:{}},st;function pe(){return st||(st=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)}}})(w,w.exports)),w.exports}pe();class y{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}}const he=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 f=`(${l.join(", ")})`,g=`(
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 n=await o.json();if(n.errors)throw new Error(`GraphQL errors: ${JSON.stringify(n.errors,null,2)}`);return n.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:i})=>{const o=Math.max(1,Math.floor(e)),n=Math.max(1,Math.floor(r)),l=["$slot: String!","$limit: Int!","$skip: Int!"],c={slot:t,limit:n,skip:(o-1)*n},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 } }] }")),i&&(l.push("$locale: String!"),c.locale=i,u.push("{ OR: [{ locale_exists: false }, { locale: $locale }] }"));const g=`(${l.join(", ")})`,f=`(
3
3
  limit: $limit
4
4
  skip: $skip
5
5
  where: {
@@ -8,9 +8,9 @@ ${l}`)}const i=await o.json();if(i.errors)throw new Error(`GraphQL errors: ${JSO
8
8
  `)}
9
9
  ]
10
10
  }
11
- )`,h=`
12
- query${f} {
13
- bannerCollectionCollection${g} {
11
+ )`,y=`
12
+ query${g} {
13
+ bannerCollectionCollection${f} {
14
14
  total
15
15
  items {
16
16
  sys {
@@ -45,7 +45,7 @@ query${f} {
45
45
  }
46
46
  }
47
47
  }
48
- `,{bannerCollectionCollection:m}=await y.graphqlQuery(h,{...c});return{page:o,total:m.total,size:i,items:m.items}};class $ 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=`
48
+ `,{bannerCollectionCollection:p}=await m.graphqlQuery(y,{...c});return new b({page:o,total:p.total,size:n,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:i=20}={})=>{const o=Math.max(1,Math.floor(s)),n=Math.max(1,Math.floor(i));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 {
@@ -64,6 +64,12 @@ query($collectionId: String!, $limit: Int!, $skip: Int!) {
64
64
  items {
65
65
  title
66
66
  slug
67
+ featuredImage {
68
+ url
69
+ width
70
+ height
71
+ contentType
72
+ }
67
73
  }
68
74
  }
69
75
  featuredImage {
@@ -77,17 +83,17 @@ query($collectionId: String!, $limit: Int!, $skip: Int!) {
77
83
  }
78
84
  }
79
85
  }
80
- `,{blogCollectionCollection:b}=await y.graphqlQuery(d,{collectionId:r,limit:i,skip:(o-1)*i}),k=b.items.at(0);if(!k)throw new $;return{page:o,total:k.postsCollection?.total??0,size:i,items:k.postsCollection?.items??[]}}const l=["$limit: Int!","$skip: Int!"],c={limit:i,skip:(o-1)*i},u=["limit: $limit","skip: $skip"],f=[];t&&(l.push("$marketCode: String!"),c.marketCode=t,f.push("{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }")),e&&(l.push("$locale: String!"),c.locale=e,f.push("{ OR: [{ locale_exists: false }, { locale: $locale }] }")),a&&(l.push("$categoryId: String!"),c.categoryId=a,f.push("{ categories: { sys: { id: $categoryId } } }")),f.length&&u.push(`where: {
86
+ `,{blogCollectionCollection:$}=await m.graphqlQuery(d,{collectionId:r,limit:n,skip:(o-1)*n}),A=$.items.at(0);if(!A)throw new w;return new b({page:o,total:A.postsCollection?.total??0,size:n,items:A.postsCollection?.items??[]})}const l=["$limit: Int!","$skip: Int!"],c={limit:n,skip:(o-1)*n},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: {
81
87
  AND: [
82
- ${f.join(`
88
+ ${g.join(`
83
89
  `)}
84
90
  ]
85
- }`);const g=l.length?`(${l.join(", ")})`:"",h=u.length?`(
91
+ }`);const f=l.length?`(${l.join(", ")})`:"",y=u.length?`(
86
92
  ${u.join(`
87
93
  `)}
88
- )`:"",m=`
89
- query${g} {
90
- blogPostCollection${h} {
94
+ )`:"",p=`
95
+ query${f} {
96
+ blogPostCollection${y} {
91
97
  total
92
98
  items {
93
99
  sys {
@@ -102,6 +108,12 @@ query${g} {
102
108
  items {
103
109
  title
104
110
  slug
111
+ featuredImage {
112
+ url
113
+ width
114
+ height
115
+ contentType
116
+ }
105
117
  }
106
118
  }
107
119
  featuredImage {
@@ -113,7 +125,7 @@ query${g} {
113
125
  }
114
126
  }
115
127
  }
116
- `,{blogPostCollection:p}=await y.graphqlQuery(m,{...c});return{page:o,total:p.total,size:i,items:p.items}},ye=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=`(
128
+ `,{blogPostCollection:h}=await m.graphqlQuery(p,{...c});return new b({page:o,total:h.total,size:n,items:h.items})},de=async({id:t,slug:e,marketCode:r,locale:a})=>{const s=[],i={},o=[];if(t)s.push("$id: String!"),i.id=t,o.push("{ sys: { id: $id } }");else if(e)s.push("$slug: String!"),i.slug=e,o.push("{ slug: $slug }");else throw new Error("Either id or slug is required.");r&&(s.push("$marketCode: String!"),i.marketCode=r,o.push("{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }")),a&&(s.push("$locale: String!"),i.locale=a,o.push("{ OR: [{ locale_exists: false }, { locale: $locale }] }"));const n=`(${s.join(", ")})`,l=`(
117
129
  limit: 1
118
130
  where: {
119
131
  AND: [
@@ -122,7 +134,7 @@ query${g} {
122
134
  ]
123
135
  }
124
136
  )`,c=`
125
- query${i} {
137
+ query${n} {
126
138
  blogPostCollection${l} {
127
139
  items {
128
140
  sys {
@@ -137,6 +149,12 @@ query${i} {
137
149
  items {
138
150
  title
139
151
  slug
152
+ featuredImage {
153
+ url
154
+ width
155
+ height
156
+ contentType
157
+ }
140
158
  }
141
159
  }
142
160
  featuredImage {
@@ -181,17 +199,17 @@ query${i} {
181
199
  }
182
200
  }
183
201
  }
184
- `,{blogPostCollection:u}=await y.graphqlQuery(c,{...n}),f=u.items.at(0);if(!f)throw new $;return f},de=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: {
202
+ `,{blogPostCollection:u}=await m.graphqlQuery(c,{...i}),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)),i=Math.max(1,Math.floor(a)),o=["$limit: Int!","$skip: Int!"],n={limit:i,skip:(s-1)*i},l=["limit: $limit","skip: $skip"],c=[];t&&(o.push("$marketCode: String!"),n.marketCode=t,c.push("{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }")),e&&(o.push("$locale: String!"),n.locale=e,c.push("{ OR: [{ locale_exists: false }, { locale: $locale }] }")),c.length&&l.push(`where: {
185
203
  AND: [
186
204
  ${c.join(`
187
205
  `)}
188
206
  ]
189
- }`);const u=o.length?`(${o.join(", ")})`:"",f=l.length?`(
207
+ }`);const u=o.length?`(${o.join(", ")})`:"",g=l.length?`(
190
208
  ${l.join(`
191
209
  `)}
192
- )`:"",g=`
210
+ )`:"",f=`
193
211
  query${u} {
194
- blogCategoryCollection${f} {
212
+ blogCategoryCollection${g} {
195
213
  total
196
214
  items {
197
215
  sys {
@@ -202,7 +220,7 @@ query${u} {
202
220
  }
203
221
  }
204
222
  }
205
- `,{blogCategoryCollection:h}=await y.graphqlQuery(g,{...i});return{page:s,total:h.total,size:n,items:h.items}},be=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=`(
223
+ `,{blogCategoryCollection:y}=await m.graphqlQuery(f,{...n});return new b({page:s,total:y.total,size:i,items:y.items})},$e=async({id:t,slug:e,marketCode:r,locale:a})=>{const s=[],i={},o=[];if(t)s.push("$id: String!"),i.id=t,o.push("{ sys: { id: $id } }");else if(e)s.push("$slug: String!"),i.slug=e,o.push("{ slug: $slug }");else throw new Error("Either id or slug is required.");r&&(s.push("$marketCode: String!"),i.marketCode=r,o.push("{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }")),a&&(s.push("$locale: String!"),i.locale=a,o.push("{ OR: [{ locale_exists: false }, { locale: $locale }] }"));const n=`(${s.join(", ")})`,l=`(
206
224
  limit: 1
207
225
  where: {
208
226
  AND: [
@@ -211,7 +229,7 @@ query${u} {
211
229
  ]
212
230
  }
213
231
  )`,c=`
214
- query${i} {
232
+ query${n} {
215
233
  blogCategoryCollection${l} {
216
234
  items {
217
235
  sys {
@@ -240,17 +258,17 @@ query${i} {
240
258
  }
241
259
  }
242
260
  }
243
- `,{blogCategoryCollection:u}=await y.graphqlQuery(c,{...n}),f=u.items.at(0);if(!f)throw new $;return f},$e=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: {
261
+ `,{blogCategoryCollection:u}=await m.graphqlQuery(c,{...i}),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)),i=Math.max(1,Math.floor(a)),o=["$limit: Int!","$skip: Int!"],n={limit:i,skip:(s-1)*i},l=["limit: $limit","skip: $skip"],c=[];t&&(o.push("$marketCode: String!"),n.marketCode=t,c.push("{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }")),e&&(o.push("$locale: String!"),n.locale=e,c.push("{ OR: [{ locale_exists: false }, { locale: $locale }] }")),c.length&&l.push(`where: {
244
262
  AND: [
245
263
  ${c.join(`
246
264
  `)}
247
265
  ]
248
- }`);const u=o.length?`(${o.join(", ")})`:"",f=l.length?`(
266
+ }`);const u=o.length?`(${o.join(", ")})`:"",g=l.length?`(
249
267
  ${l.join(`
250
268
  `)}
251
- )`:"",g=`
269
+ )`:"",f=`
252
270
  query${u} {
253
- blogCollectionCollection${f} {
271
+ blogCollectionCollection${g} {
254
272
  total
255
273
  items {
256
274
  name
@@ -275,7 +293,7 @@ query${u} {
275
293
  }
276
294
  }
277
295
  }
278
- `,{blogCollectionCollection:h}=await y.graphqlQuery(g,{...i});return{page:s,total:h.total,size:n,items:h.items}},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?`(
296
+ `,{blogCollectionCollection:y}=await m.graphqlQuery(f,{...n});return new b({page:s,total:y.total,size:i,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)),i=Math.max(1,Math.floor(e)),o=["$limit: Int!","$skip: Int!"],n={limit:i,skip:(s-1)*i},l=[];r&&(o.push("$marketCode: String!"),n.marketCode=r,l.push("{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }")),a&&(o.push("$locale: String!"),n.locale=a,l.push("{ OR: [{ locale_exists: false }, { locale: $locale }] }"));const c=`(${o.join(", ")})`,u=l.length?`(
279
297
  limit: $limit
280
298
  skip: $skip
281
299
  where: {
@@ -287,7 +305,7 @@ query${u} {
287
305
  )`:`(
288
306
  limit: $limit
289
307
  skip: $skip
290
- )`,f=`
308
+ )`,g=`
291
309
  query${c} {
292
310
  brandCollectionCollection${u} {
293
311
  total
@@ -323,17 +341,17 @@ query${c} {
323
341
  }
324
342
  }
325
343
  }
326
- `,{brandCollectionCollection:g}=await y.graphqlQuery(f,{...i});return{page:s,total:g.total,size:n,items:g.items}},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: {
344
+ `,{brandCollectionCollection:f}=await m.graphqlQuery(g,{...n});return new b({page:s,total:f.total,size:i,items:f.items})},ve=async({marketCode:t,locale:e,page:r=1,size:a=20}={})=>{const s=Math.max(1,Math.floor(r)),i=Math.max(1,Math.floor(a)),o=["$limit: Int!","$skip: Int!"],n={limit:i,skip:(s-1)*i},l=["limit: $limit","skip: $skip"],c=[];t&&(o.push("$marketCode: String!"),n.marketCode=t,c.push("{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }")),e&&(o.push("$locale: String!"),n.locale=e,c.push("{ OR: [{ locale_exists: false }, { locale: $locale }] }")),c.length&&l.push(`where: {
327
345
  AND: [
328
346
  ${c.join(`
329
347
  `)}
330
348
  ]
331
- }`);const u=o.length?`(${o.join(", ")})`:"",f=l.length?`(
349
+ }`);const u=o.length?`(${o.join(", ")})`:"",g=l.length?`(
332
350
  ${l.join(`
333
351
  `)}
334
- )`:"",g=`
352
+ )`:"",f=`
335
353
  query${u} {
336
- documentationCategoryCollection${f} {
354
+ documentationCategoryCollection${g} {
337
355
  total
338
356
  items {
339
357
  sys {
@@ -354,7 +372,7 @@ query${u} {
354
372
  }
355
373
  }
356
374
  }
357
- `,{documentationCategoryCollection:h}=await y.graphqlQuery(g,{...i});return{page:s,total:h.total,size:n,items:h.items}},ve=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=`(
375
+ `,{documentationCategoryCollection:y}=await m.graphqlQuery(f,{...n});return new b({page:s,total:y.total,size:i,items:y.items})},Se=async({id:t,slug:e,marketCode:r,locale:a})=>{const s=[],i={},o=[];if(t)s.push("$id: String!"),i.id=t,o.push("{ sys: { id: $id } }");else if(e)s.push("$slug: String!"),i.slug=e,o.push("{ slug: $slug }");else throw new Error("Either id or slug is required.");r&&(s.push("$marketCode: String!"),i.marketCode=r,o.push("{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }")),a&&(s.push("$locale: String!"),i.locale=a,o.push("{ OR: [{ locale_exists: false }, { locale: $locale }] }"));const n=`(${s.join(", ")})`,l=`(
358
376
  limit: 1
359
377
  where: {
360
378
  AND: [
@@ -363,7 +381,7 @@ query${u} {
363
381
  ]
364
382
  }
365
383
  )`,c=`
366
- query${i} {
384
+ query${n} {
367
385
  documentationCategoryCollection${l} {
368
386
  items {
369
387
  sys {
@@ -384,17 +402,17 @@ query${i} {
384
402
  }
385
403
  }
386
404
  }
387
- `,{documentationCategoryCollection:u}=await y.graphqlQuery(c,{...n}),f=u.items.at(0);if(!f)throw new $;return f},Se=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: {
405
+ `,{documentationCategoryCollection:u}=await m.graphqlQuery(c,{...i}),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 i=Math.max(1,Math.floor(a)),o=Math.max(1,Math.floor(s)),n=["$limit: Int!","$skip: Int!"],l={limit:o,skip:(i-1)*o},c=["limit: $limit","skip: $skip"],u=[];t&&(n.push("$marketCode: String!"),l.marketCode=t,u.push("{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }")),e&&(n.push("$locale: String!"),l.locale=e,u.push("{ OR: [{ locale_exists: false }, { locale: $locale }] }")),r&&(n.push("$categorySlug: String!"),l.categorySlug=r,u.push("{ category: { slug: $categorySlug } }")),u.length&&c.push(`where: {
388
406
  AND: [
389
407
  ${u.join(`
390
408
  `)}
391
409
  ]
392
- }`);const f=i.length?`(${i.join(", ")})`:"",g=c.length?`(
410
+ }`);const g=n.length?`(${n.join(", ")})`:"",f=c.length?`(
393
411
  ${c.join(`
394
412
  `)}
395
- )`:"",h=`
396
- query${f} {
397
- documentationArticleCollection${g} {
413
+ )`:"",y=`
414
+ query${g} {
415
+ documentationArticleCollection${f} {
398
416
  total
399
417
  items {
400
418
  sys {
@@ -422,7 +440,7 @@ query${f} {
422
440
  }
423
441
  }
424
442
  }
425
- `,{documentationArticleCollection:m}=await y.graphqlQuery(h,{...l});return{page:n,total:m.total,size:o,items:m.items}},ke=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=`(
443
+ `,{documentationArticleCollection:p}=await m.graphqlQuery(y,{...l});return new b({page:i,total:p.total,size:o,items:p.items})},Ae=async({id:t,slug:e,marketCode:r,locale:a})=>{const s=[],i={},o=[];if(t)s.push("$id: String!"),i.id=t,o.push("{ sys: { id: $id } }");else if(e)s.push("$slug: String!"),i.slug=e,o.push("{ slug: $slug }");else throw new Error("Either id or slug is required.");r&&(s.push("$marketCode: String!"),i.marketCode=r,o.push("{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }")),a&&(s.push("$locale: String!"),i.locale=a,o.push("{ OR: [{ locale_exists: false }, { locale: $locale }] }"));const n=`(${s.join(", ")})`,l=`(
426
444
  limit: 1
427
445
  where: {
428
446
  AND: [
@@ -431,7 +449,7 @@ query${f} {
431
449
  ]
432
450
  }
433
451
  )`,c=`
434
- query${i} {
452
+ query${n} {
435
453
  documentationArticleCollection${l} {
436
454
  items {
437
455
  sys {
@@ -483,7 +501,7 @@ query${i} {
483
501
  }
484
502
  }
485
503
  }
486
- `,{documentationArticleCollection:u}=await y.graphqlQuery(c,{...n}),f=u.items.at(0);if(!f)throw new $;return f},Ae=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?`(
504
+ `,{documentationArticleCollection:u}=await m.graphqlQuery(c,{...i}),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)),i=Math.max(1,Math.floor(e)),o=["$limit: Int!","$skip: Int!"],n={limit:i,skip:(s-1)*i},l=[];r&&(o.push("$marketCode: String!"),n.marketCode=r,l.push("{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }")),a&&(o.push("$locale: String!"),n.locale=a,l.push("{ OR: [{ locale_exists: false }, { locale: $locale }] }"));const c=o.length?`(${o.join(", ")})`:"",u=l.length?`(
487
505
  limit: $limit
488
506
  skip: $skip
489
507
  order: order_ASC
@@ -497,7 +515,7 @@ query${i} {
497
515
  limit: $limit
498
516
  skip: $skip
499
517
  order: order_ASC
500
- )`,f=`
518
+ )`,g=`
501
519
  query${c} {
502
520
  hyperlinkCollectionCollection${u} {
503
521
  total
@@ -522,7 +540,7 @@ query${c} {
522
540
  }
523
541
  }
524
542
  }
525
- `,{hyperlinkCollectionCollection:g}=await y.graphqlQuery(f,{...i});return{page:s,total:g.total,size:n,items:g.items}},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.join(", ")})`,u=l.length?`(
543
+ `,{hyperlinkCollectionCollection:f}=await m.graphqlQuery(g,{...n});return new b({page:s,total:f.total,size:i,items:f.items})},je=async({page:t=1,size:e=20,marketCode:r,locale:a}={})=>{const s=Math.max(1,Math.floor(t)),i=Math.max(1,Math.floor(e)),o=["$limit: Int!","$skip: Int!"],n={limit:i,skip:(s-1)*i},l=[];r&&(o.push("$marketCode: String!"),n.marketCode=r,l.push("{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }")),a&&(o.push("$locale: String!"),n.locale=a,l.push("{ OR: [{ locale_exists: false }, { locale: $locale }] }"));const c=`(${o.join(", ")})`,u=l.length?`(
526
544
  limit: $limit
527
545
  skip: $skip
528
546
  where: {
@@ -534,7 +552,7 @@ query${c} {
534
552
  )`:`(
535
553
  limit: $limit
536
554
  skip: $skip
537
- )`,f=`
555
+ )`,g=`
538
556
  query${c} {
539
557
  keywordCollectionCollection${u} {
540
558
  total
@@ -548,4 +566,4 @@ query${c} {
548
566
  }
549
567
  }
550
568
  }
551
- `,{keywordCollectionCollection:g}=await y.graphqlQuery(f,{...i});return{page:s,total:g.total,size:n,items:g.items}};exports.ContentfulSDK=y;exports.getBannerCollections=he;exports.getBlogCategories=de;exports.getBlogCategoryDetail=be;exports.getBlogCollections=$e;exports.getBlogPostDetail=ye;exports.getBlogPosts=me;exports.getBrandCollections=Ce;exports.getDocArticleDetail=ke;exports.getDocArticles=Se;exports.getDocCategories=we;exports.getDocCategoryDetail=ve;exports.getHyperlinkCollections=Ae;exports.getKeywordCollections=Oe;
569
+ `,{keywordCollectionCollection:f}=await m.graphqlQuery(g,{...n});return new b({page:s,total:f.total,size:i,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;
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './client';
2
2
  export * from './entries';
3
3
  export * from './types';
4
+ export * from './utils';