@janbox/contentful-marketplace-sdk 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -29,7 +29,7 @@ yarn add @janbox/contentful-marketplace-sdk contentful
29
29
  ```ts
30
30
  import {
31
31
  ContentfulSDK,
32
- listBannerCollections,
32
+ getBannerCollections,
33
33
  } from "@janbox/contentful-marketplace-sdk";
34
34
  import type { CreateClientParams } from "contentful";
35
35
 
@@ -41,7 +41,7 @@ const clientOptions: CreateClientParams = {
41
41
 
42
42
  ContentfulSDK.configure(clientOptions);
43
43
 
44
- const result = await listBannerCollections({
44
+ const result = await getBannerCollections({
45
45
  slot: "home_hero",
46
46
  marketCode: "vn",
47
47
  language: "en",
@@ -75,15 +75,15 @@ Notes:
75
75
 
76
76
  ## API Methods
77
77
 
78
- List methods return `{ page, total, size, items }`.
78
+ Collection methods return `{ page, total, size, items }`.
79
79
  Detail methods return the entry object directly.
80
80
 
81
81
  ### Banner Collection
82
82
 
83
- - `listBannerCollections(options)`
83
+ - `getBannerCollections(options)`
84
84
 
85
85
  ```ts
86
- await listBannerCollections({
86
+ await getBannerCollections({
87
87
  slot: "home_hero",
88
88
  page: 1,
89
89
  size: 20,
@@ -95,11 +95,11 @@ await listBannerCollections({
95
95
 
96
96
  ### Blog
97
97
 
98
- - `listBlogPosts(options?)`
98
+ - `getBlogPosts(options?)`
99
99
  - `getBlogPostDetail({ id } | { slug })`
100
100
 
101
101
  ```ts
102
- const posts = await listBlogPosts({
102
+ const posts = await getBlogPosts({
103
103
  marketCode: "vn",
104
104
  language: "en",
105
105
  page: 1,
@@ -122,13 +122,13 @@ const postById = await getBlogPostDetail({
122
122
 
123
123
  ### Documentation
124
124
 
125
- - `listDocCategories(options?)`
125
+ - `getDocCategories(options?)`
126
126
  - `getDocCategoryDetail({ id } | { slug })`
127
- - `listDocArticles(options?)`
127
+ - `getDocArticles(options?)`
128
128
  - `getDocArticleDetail({ id } | { slug })`
129
129
 
130
130
  ```ts
131
- const categories = await listDocCategories({
131
+ const categories = await getDocCategories({
132
132
  marketCode: "vn",
133
133
  language: "en",
134
134
  page: 1,
@@ -148,14 +148,14 @@ const categoryById = await getDocCategoryDetail({
148
148
  language: "en",
149
149
  });
150
150
 
151
- const articles = await listDocArticles({
151
+ const articles = await getDocArticles({
152
152
  categorySlug: "getting-started",
153
153
  marketCode: "vn",
154
154
  language: "en",
155
155
  page: 1,
156
156
  size: 10,
157
157
  });
158
- // listDocArticles returns summary fields only (no content, no seo)
158
+ // getDocArticles returns summary fields only (no content, no seo)
159
159
 
160
160
  const article = await getDocArticleDetail({
161
161
  slug: "payment-methods",
@@ -172,26 +172,26 @@ const articleById = await getDocArticleDetail({
172
172
 
173
173
  ### Brand / Hyperlink / Keyword Collections
174
174
 
175
- - `listBrandCollections(options?)`
176
- - `listHyperlinkCollections(options?)`
177
- - `listKeywordCollections(options?)`
175
+ - `getBrandCollections(options?)`
176
+ - `getHyperlinkCollections(options?)`
177
+ - `getKeywordCollections(options?)`
178
178
 
179
179
  ```ts
180
- const brands = await listBrandCollections({
180
+ const brands = await getBrandCollections({
181
181
  marketCode: "vn",
182
182
  language: "en",
183
183
  page: 1,
184
184
  size: 20,
185
185
  });
186
186
 
187
- const links = await listHyperlinkCollections({
187
+ const links = await getHyperlinkCollections({
188
188
  page: 1,
189
189
  size: 20,
190
190
  marketCode: "vn",
191
191
  language: "en",
192
192
  });
193
193
 
194
- const keywords = await listKeywordCollections({
194
+ const keywords = await getKeywordCollections({
195
195
  marketCode: "vn",
196
196
  language: "en",
197
197
  page: 1,
@@ -21,18 +21,18 @@ export type BannerCollectionGraphQLItem = {
21
21
  }>;
22
22
  };
23
23
  } & Pick<BannerCollectionEntry["fields"], "name" | "slot" | "platform">;
24
- export type ListBannerCollectionsResponse = {
24
+ export type GetBannerCollectionsResponse = {
25
25
  page: number;
26
26
  total: number;
27
27
  size: number;
28
28
  items: BannerCollectionGraphQLItem[];
29
29
  };
30
- export declare const listBannerCollections: ({ slot, page, size, platform, marketCode, language, }: {
30
+ export declare const getBannerCollections: ({ slot, page, size, platform, marketCode, language, }: {
31
31
  slot: BannerCollectionEntry["fields"]["slot"];
32
32
  page?: number;
33
33
  size?: number;
34
34
  platform?: BannerCollectionEntry["fields"]["platform"][number];
35
35
  marketCode?: string;
36
36
  language?: string;
37
- }) => Promise<ListBannerCollectionsResponse>;
37
+ }) => Promise<GetBannerCollectionsResponse>;
38
38
  export {};
@@ -33,19 +33,19 @@ export interface BlogPostDetailGraphQLItem extends BlogPostGraphQLItem {
33
33
  };
34
34
  seo: GraphQLSeo | null;
35
35
  }
36
- export type ListBlogPostsResponse = {
36
+ export type GetBlogPostsResponse = {
37
37
  page: number;
38
38
  total: number;
39
39
  size: number;
40
40
  items: BlogPostGraphQLItem[];
41
41
  };
42
42
  export type GetBlogPostDetailResponse = BlogPostDetailGraphQLItem;
43
- export declare const listBlogPosts: ({ marketCode, language, page, size, }?: {
43
+ export declare const getBlogPosts: ({ marketCode, language, page, size, }?: {
44
44
  marketCode?: string;
45
45
  language?: string;
46
46
  page?: number;
47
47
  size?: number;
48
- }) => Promise<ListBlogPostsResponse>;
48
+ }) => Promise<GetBlogPostsResponse>;
49
49
  export declare const getBlogPostDetail: ({ id, slug, marketCode, language, }: {
50
50
  id?: string;
51
51
  slug?: string;
@@ -11,16 +11,16 @@ export type BrandCollectionGraphQLItem = {
11
11
  } & Pick<BrandEntry["fields"], "name" | "slug">>;
12
12
  };
13
13
  } & Pick<BrandCollectionEntry["fields"], "name" | "slot">;
14
- export type ListBrandCollectionsResponse = {
14
+ export type GetBrandCollectionsResponse = {
15
15
  page: number;
16
16
  total: number;
17
17
  size: number;
18
18
  items: BrandCollectionGraphQLItem[];
19
19
  };
20
- export declare const listBrandCollections: ({ page, size, marketCode, language, }?: {
20
+ export declare const getBrandCollections: ({ page, size, marketCode, language, }?: {
21
21
  page?: number;
22
22
  size?: number;
23
23
  marketCode?: string;
24
24
  language?: string;
25
- }) => Promise<ListBrandCollectionsResponse>;
25
+ }) => Promise<GetBrandCollectionsResponse>;
26
26
  export {};
@@ -34,39 +34,39 @@ export interface DocArticleDetailGraphQLItem extends DocArticleGraphQLItem {
34
34
  };
35
35
  seo: GraphQLSeo | null;
36
36
  }
37
- export type ListDocCategoriesResponse = {
37
+ export type GetDocCategoriesResponse = {
38
38
  page: number;
39
39
  total: number;
40
40
  size: number;
41
41
  items: DocCategoryGraphQLItem[];
42
42
  };
43
43
  export type GetDocCategoryDetailResponse = DocCategoryGraphQLItem;
44
- export type ListDocArticlesResponse = {
44
+ export type getDocArticlesResponse = {
45
45
  page: number;
46
46
  total: number;
47
47
  size: number;
48
48
  items: DocArticleGraphQLItem[];
49
49
  };
50
50
  export type GetDocArticleDetailResponse = DocArticleDetailGraphQLItem;
51
- export declare const listDocCategories: ({ marketCode, language, page, size, }?: {
51
+ export declare const getDocCategories: ({ marketCode, language, page, size, }?: {
52
52
  marketCode?: string;
53
53
  language?: string;
54
54
  page?: number;
55
55
  size?: number;
56
- }) => Promise<ListDocCategoriesResponse>;
56
+ }) => Promise<GetDocCategoriesResponse>;
57
57
  export declare const getDocCategoryDetail: ({ id, slug, marketCode, language, }: {
58
58
  id?: string;
59
59
  slug?: string;
60
60
  marketCode?: string;
61
61
  language?: string;
62
62
  }) => Promise<GetDocCategoryDetailResponse>;
63
- export declare const listDocArticles: ({ marketCode, language, categorySlug, page, size, }?: {
63
+ export declare const getDocArticles: ({ marketCode, language, categorySlug, page, size, }?: {
64
64
  marketCode?: string;
65
65
  language?: string;
66
66
  categorySlug?: string;
67
67
  page?: number;
68
68
  size?: number;
69
- }) => Promise<ListDocArticlesResponse>;
69
+ }) => Promise<getDocArticlesResponse>;
70
70
  export declare const getDocArticleDetail: ({ id, slug, marketCode, language, }: {
71
71
  id?: string;
72
72
  slug?: string;
@@ -11,16 +11,16 @@ export type HyperlinkCollectionGraphQLItem = {
11
11
  } & Pick<HyperlinkEntry["fields"], "label" | "url" | "target" | 'marketHandling'>>;
12
12
  };
13
13
  } & Pick<HyperlinkCollectionEntry["fields"], "name" | "slot" | "order">;
14
- export type ListHyperlinkCollectionsResponse = {
14
+ export type GetHyperlinkCollectionsResponse = {
15
15
  page: number;
16
16
  total: number;
17
17
  size: number;
18
18
  items: HyperlinkCollectionGraphQLItem[];
19
19
  };
20
- export declare const listHyperlinkCollections: ({ page, size, marketCode, language, }?: {
20
+ export declare const getHyperlinkCollections: ({ page, size, marketCode, language, }?: {
21
21
  page?: number;
22
22
  size?: number;
23
23
  marketCode?: string;
24
24
  language?: string;
25
- }) => Promise<ListHyperlinkCollectionsResponse>;
25
+ }) => Promise<GetHyperlinkCollectionsResponse>;
26
26
  export {};
@@ -5,16 +5,16 @@ type GraphQLEntrySys = Pick<EntrySys, "id">;
5
5
  export type KeywordCollectionGraphQLItem = {
6
6
  sys: GraphQLEntrySys;
7
7
  } & Pick<KeywordCollectionEntry["fields"], "name" | "slot" | "keywords">;
8
- export type ListKeywordCollectionsResponse = {
8
+ export type GetKeywordCollectionsResponse = {
9
9
  page: number;
10
10
  total: number;
11
11
  size: number;
12
12
  items: KeywordCollectionGraphQLItem[];
13
13
  };
14
- export declare const listKeywordCollections: ({ page, size, marketCode, language, }?: {
14
+ export declare const getKeywordCollections: ({ page, size, marketCode, language, }?: {
15
15
  page?: number;
16
16
  size?: number;
17
17
  marketCode?: string;
18
18
  language?: string;
19
- }) => Promise<ListKeywordCollectionsResponse>;
19
+ }) => Promise<GetKeywordCollectionsResponse>;
20
20
  export {};
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var wt=Function.prototype.toString,C=Object.create,St=Object.prototype.toString,Ct=(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 Ct}function At(){return new WeakMap}var jt=typeof WeakMap<"u"?At:Ot;function B(t){if(!t)return C(null);var e=t.constructor;if(e===Object)return t===Object.prototype?{}:C(t);if(e&&~wt.call(e).indexOf("[native code]"))try{return new e}catch{}return C(t)}function kt(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:kt;function at(t){var e=St.call(t);return e.substring(8,e.length-1)}function qt(t){return t[Symbol.toStringTag]||at(t)}var Pt=typeof Symbol<"u"?qt:at,xt=Object.defineProperty,Dt=Object.getOwnPropertyDescriptor,st=Object.getOwnPropertyNames,N=Object.getOwnPropertySymbols,ct=Object.prototype,lt=ct.hasOwnProperty,Rt=ct.propertyIsEnumerable,ut=typeof N=="function";function It(t){return st(t).concat(N(t))}var Mt=ut?It:st;function S(t,e,r){for(var s=Mt(t),a=0,o=s.length,n=void 0,i=void 0;a<o;++a)if(n=s[a],!(n==="callee"||n==="caller")){if(i=Dt(t,n),!i){e[n]=r.copier(t[n],r);continue}!i.get&&!i.set&&(i.value=r.copier(i.value,r));try{xt(e,n,i)}catch{e[n]=i.value}}return e}function zt(t,e){var r=new e.Constructor;e.cache.set(t,r);for(var s=0,a=t.length;s<a;++s)r[s]=e.copier(t[s],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 Bt(t,e){return new e.Constructor(gt(t.buffer))}function Nt(t,e){return new e.Constructor(t.getTime())}function ft(t,e){var r=new e.Constructor;return e.cache.set(t,r),t.forEach(function(s,a){r.set(a,e.copier(s,e))}),r}function Vt(t,e){return S(t,ft(t,e),e)}function Qt(t,e){var r=B(e.prototype);e.cache.set(t,r);for(var s in t)lt.call(t,s)&&(r[s]=e.copier(t[s],e));return r}function Ft(t,e){var r=B(e.prototype);e.cache.set(t,r);for(var s in t)lt.call(t,s)&&(r[s]=e.copier(t[s],e));for(var a=N(t),o=0,n=a.length,i=void 0;o<n;++o)i=a[o],Rt.call(t,i)&&(r[i]=e.copier(t[i],e));return r}var Gt=ut?Ft:Qt;function Ut(t,e){var r=B(e.prototype);return e.cache.set(t,r),S(t,r,e)}function O(t,e){return new e.Constructor(t.valueOf())}function Kt(t,e){var r=new e.Constructor(t.source,_t(t));return r.lastIndex=t.lastIndex,r}function w(t,e){return t}function pt(t,e){var r=new e.Constructor;return e.cache.set(t,r),t.forEach(function(s){r.add(e.copier(s,e))}),r}function Wt(t,e){return S(t,pt(t,e),e)}var Jt=Array.isArray,V=Object.assign,Ht=Object.getPrototypeOf||(function(t){return t.__proto__}),ht={array:zt,arrayBuffer:gt,blob:Lt,dataView:Bt,date:Nt,error:w,map:ft,object:Gt,regExp:Kt,set:pt},Yt=V({},ht,{array:Et,map:Vt,object:Ut,set:Wt});function Xt(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:w,RegExp:t.regExp,Set:t.set,String:O,WeakMap:w,WeakSet:w,Uint8Array:t.arrayBuffer,Uint8ClampedArray:t.arrayBuffer,Uint16Array:t.arrayBuffer,Uint32Array:t.arrayBuffer,Uint64Array:t.arrayBuffer}}function yt(t){var e=V({},ht,t),r=Xt(e),s=r.Array,a=r.Object;function o(n,i){if(i.prototype=i.Constructor=void 0,!n||typeof n!="object")return n;if(i.cache.has(n))return i.cache.get(n);if(i.prototype=Ht(n),i.Constructor=i.prototype&&i.prototype.constructor,!i.Constructor||i.Constructor===Object)return a(n,i);if(Jt(n))return s(n,i);var c=r[Pt(n)];return c?c(n,i):typeof n.then=="function"?n:a(n,i)}return function(i){return o(i,{Constructor:void 0,cache:jt(),copier:o,prototype:void 0})}}function Zt(t){return yt(V({},Yt,t))}Zt({});yt({});var v=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},A={exports:{}},F;function te(){if(F)return A.exports;F=1;var t=A.exports={},e,r;function s(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?e=setTimeout:e=s}catch{e=s}try{typeof clearTimeout=="function"?r=clearTimeout:r=a}catch{r=a}})();function o(p){if(e===setTimeout)return setTimeout(p,0);if((e===s||!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 n(p){if(r===clearTimeout)return clearTimeout(p);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(p);try{return r(p)}catch{try{return r.call(null,p)}catch{return r.call(this,p)}}}var i=[],c=!1,l,u=-1;function g(){!c||!l||(c=!1,l.length?i=l.concat(i):u=-1,i.length&&f())}function f(){if(!c){var p=o(g);c=!0;for(var d=i.length;d;){for(l=i,i=[];++u<d;)l&&l[u].run();u=-1,d=i.length}l=null,c=!1,n(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 y(p,d)),i.length===1&&!c&&o(f)};function y(p,d){this.fun=p,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 h(){}return t.on=h,t.addListener=h,t.once=h,t.off=h,t.removeListener=h,t.removeAllListeners=h,t.emit=h,t.prependListener=h,t.prependOnceListener=h,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},A.exports}te();var j,G;function ee(){if(G)return j;G=1;var t=typeof v=="object"&&v&&v.Object===Object&&v;return j=t,j}var k,U;function re(){if(U)return k;U=1;var t=ee(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return k=r,k}var T,K;function mt(){if(K)return T;K=1;var t=re(),e=t.Symbol;return T=e,T}var _,W;function ne(){if(W)return _;W=1;var t=mt(),e=Object.prototype,r=e.hasOwnProperty,s=e.toString,a=t?t.toStringTag:void 0;function o(n){var i=r.call(n,a),c=n[a];try{n[a]=void 0;var l=!0}catch{}var u=s.call(n);return l&&(i?n[a]=c:delete n[a]),u}return _=o,_}var q,J;function ie(){if(J)return q;J=1;var t=Object.prototype,e=t.toString;function r(s){return e.call(s)}return q=r,q}var P,H;function dt(){if(H)return P;H=1;var t=mt(),e=ne(),r=ie(),s="[object Null]",a="[object Undefined]",o=t?t.toStringTag:void 0;function n(i){return i==null?i===void 0?a:s:o&&o in Object(i)?e(i):r(i)}return P=n,P}var x,Y;function oe(){if(Y)return x;Y=1;var t=Array.isArray;return x=t,x}var D,X;function bt(){if(X)return D;X=1;function t(e){return e!=null&&typeof e=="object"}return D=t,D}var R,Z;function ae(){if(Z)return R;Z=1;var t=dt(),e=oe(),r=bt(),s="[object String]";function a(o){return typeof o=="string"||!e(o)&&r(o)&&t(o)==s}return R=a,R}ae();var I,tt;function se(){if(tt)return I;tt=1;function t(e,r){return function(s){return e(r(s))}}return I=t,I}var M,et;function ce(){if(et)return M;et=1;var t=se(),e=t(Object.getPrototypeOf,Object);return M=e,M}var z,rt;function le(){if(rt)return z;rt=1;var t=dt(),e=ce(),r=bt(),s="[object Object]",a=Function.prototype,o=Object.prototype,n=a.toString,i=o.hasOwnProperty,c=n.call(Object);function l(u){if(!r(u)||t(u)!=s)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&&n.call(f)==c}return z=l,z}le();var vt={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},$t={0:8203,1:8204,2:8205,3:65279};new Array(4).fill(String.fromCodePoint($t[0])).join("");Object.fromEntries(Object.entries($t).map(t=>t.reverse()));Object.fromEntries(Object.entries(vt).map(t=>t.reverse()));`${Object.values(vt).map(t=>`\\u{${t.toString(16)}}`).join("")}`;var E,nt;function ue(){if(nt)return E;nt=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString;return E=function(r,s,a){if(e.call(s)!=="[object Function]")throw new TypeError("iterator must be a function");var o=r.length;if(o===+o)for(var n=0;n<o;n++)s.call(a,r[n],n,r);else for(var i in r)t.call(r,i)&&s.call(a,r[i],i,r)},E}var L,it;function ge(){if(it)return L;it=1;var t=ue();L=e;function e(r,s,a){if(arguments.length===3)return e.set(r,s,a);if(arguments.length===2)return e.get(r,s);var o=e.bind(e,r);for(var n in e)e.hasOwnProperty(n)&&(o[n]=e[n].bind(o,r));return o}return e.get=function(r,s){for(var a=Array.isArray(s)?s:e.parse(s),o=0;o<a.length;++o){var n=a[o];if(!(typeof r=="object"&&n in r))throw new Error("Invalid reference token: "+n);r=r[n]}return r},e.set=function(r,s,a){var o=Array.isArray(s)?s:e.parse(s),n=o[0];if(o.length===0)throw Error("Can not set the root object");for(var i=0;i<o.length-1;++i){var c=o[i];typeof c!="string"&&typeof c!="number"&&(c=String(c)),!(c==="__proto__"||c==="constructor"||c==="prototype")&&(c==="-"&&Array.isArray(r)&&(c=r.length),n=o[i+1],c in r||(n.match(/^(\d+|-)$/)?r[c]=[]:r[c]={}),r=r[c])}return n==="-"&&Array.isArray(r)&&(n=r.length),r[n]=a,this},e.remove=function(r,s){var a=Array.isArray(s)?s:e.parse(s),o=a[a.length-1];if(o===void 0)throw new Error('Invalid JSON pointer for remove: "'+s+'"');var n=e.get(r,a.slice(0,-1));if(Array.isArray(n)){var i=+o;if(o===""&&isNaN(i))throw new Error('Invalid array index: "'+o+'"');Array.prototype.splice.call(n,i,1)}else delete n[o]},e.dict=function(r,s){var a={};return e.walk(r,function(o,n){a[n]=o},s),a},e.walk=function(r,s,a){var o=[];a=a||function(n){var i=Object.prototype.toString.call(n);return i==="[object Object]"||i==="[object Array]"},(function n(i){t(i,function(c,l){o.push(String(l)),a(c)?n(c):s(c,e.compile(o)),o.pop()})})(r)},e.has=function(r,s){try{e.get(r,s)}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("/")},L}ge();var $={exports:{}},ot;function fe(){return ot||(ot=1,(function(t,e){e=t.exports=r,e.getSerialize=s;function r(a,o,n,i){return JSON.stringify(a,s(o,i),n)}function s(a,o){var n=[],i=[];return o==null&&(o=function(c,l){return n[0]===l?"[Circular ~]":"[Circular ~."+i.slice(0,n.indexOf(l)).join(".")+"]"}),function(c,l){if(n.length>0){var u=n.indexOf(this);~u?n.splice(u+1):n.push(this),~u?i.splice(u,1/0,c):i.push(c),~n.indexOf(l)&&(l=o.call(this,c,l))}else n.push(l);return a==null?l:a.call(this,c,l)}}})($,$.exports)),$.exports}fe();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:s,accessToken:a,environment:o="master"}=this.clientParams,n=await fetch(`https://graphql.contentful.com/content/v1/spaces/${s}/environments/${o}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:JSON.stringify({query:e,variables:r})});if(!n.ok){const c=await n.text();throw new Error(`GraphQL request failed: ${n.status} ${n.statusText}
2
- ${c}`)}const i=await n.json();if(i.errors)throw new Error(`GraphQL errors: ${JSON.stringify(i.errors,null,2)}`);return i.data}}const pe=async({slot:t,page:e=1,size:r=20,platform:s,marketCode:a,language:o})=>{const n=Math.max(1,Math.floor(e)),i=Math.max(1,Math.floor(r)),c=["$slot: String!","$limit: Int!","$skip: Int!"],l={slot:t,limit:i,skip:(n-1)*i},u=["{ slot: $slot }"];s&&(c.push("$platform: String!"),l.platform=s,u.push("{ platform_contains_some: [$platform] }")),a&&(c.push("$marketCode: String!"),l.marketCode=a,u.push("{ OR: [{ market_exists: false }, { market: { code: $marketCode } }] }")),o&&(c.push("$language: String!"),l.language=o,u.push("{ OR: [{ language_exists: false }, { language: { code: $language } }] }"));const g=`(${c.join(", ")})`,f=`(
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var we=Function.prototype.toString,C=Object.create,Se=Object.prototype.toString,Ce=(function(){function e(){this._keys=[],this._values=[]}return e.prototype.has=function(t){return!!~this._keys.indexOf(t)},e.prototype.get=function(t){return this._values[this._keys.indexOf(t)]},e.prototype.set=function(t,r){this._keys.push(t),this._values.push(r)},e})();function Oe(){return new Ce}function Ae(){return new WeakMap}var je=typeof WeakMap<"u"?Ae:Oe;function B(e){if(!e)return C(null);var t=e.constructor;if(t===Object)return e===Object.prototype?{}:C(e);if(t&&~we.call(t).indexOf("[native code]"))try{return new t}catch{}return C(e)}function ke(e){var t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}function Te(e){return e.flags}var _e=/test/g.flags==="g"?Te:ke;function ae(e){var t=Se.call(e);return t.substring(8,t.length-1)}function qe(e){return e[Symbol.toStringTag]||ae(e)}var Pe=typeof Symbol<"u"?qe:ae,xe=Object.defineProperty,De=Object.getOwnPropertyDescriptor,se=Object.getOwnPropertyNames,N=Object.getOwnPropertySymbols,ce=Object.prototype,le=ce.hasOwnProperty,Re=ce.propertyIsEnumerable,ue=typeof N=="function";function Ie(e){return se(e).concat(N(e))}var Me=ue?Ie:se;function S(e,t,r){for(var s=Me(e),a=0,o=s.length,n=void 0,i=void 0;a<o;++a)if(n=s[a],!(n==="callee"||n==="caller")){if(i=De(e,n),!i){t[n]=r.copier(e[n],r);continue}!i.get&&!i.set&&(i.value=r.copier(i.value,r));try{xe(t,n,i)}catch{t[n]=i.value}}return t}function ze(e,t){var r=new t.Constructor;t.cache.set(e,r);for(var s=0,a=e.length;s<a;++s)r[s]=t.copier(e[s],t);return r}function Ee(e,t){var r=new t.Constructor;return t.cache.set(e,r),S(e,r,t)}function ge(e,t){return e.slice(0)}function Le(e,t){return e.slice(0,e.size,e.type)}function Be(e,t){return new t.Constructor(ge(e.buffer))}function Ne(e,t){return new t.Constructor(e.getTime())}function fe(e,t){var r=new t.Constructor;return t.cache.set(e,r),e.forEach(function(s,a){r.set(a,t.copier(s,t))}),r}function Ve(e,t){return S(e,fe(e,t),t)}function Qe(e,t){var r=B(t.prototype);t.cache.set(e,r);for(var s in e)le.call(e,s)&&(r[s]=t.copier(e[s],t));return r}function Fe(e,t){var r=B(t.prototype);t.cache.set(e,r);for(var s in e)le.call(e,s)&&(r[s]=t.copier(e[s],t));for(var a=N(e),o=0,n=a.length,i=void 0;o<n;++o)i=a[o],Re.call(e,i)&&(r[i]=t.copier(e[i],t));return r}var Ge=ue?Fe:Qe;function Ue(e,t){var r=B(t.prototype);return t.cache.set(e,r),S(e,r,t)}function O(e,t){return new t.Constructor(e.valueOf())}function Ke(e,t){var r=new t.Constructor(e.source,_e(e));return r.lastIndex=e.lastIndex,r}function w(e,t){return e}function pe(e,t){var r=new t.Constructor;return t.cache.set(e,r),e.forEach(function(s){r.add(t.copier(s,t))}),r}function We(e,t){return S(e,pe(e,t),t)}var Je=Array.isArray,V=Object.assign,He=Object.getPrototypeOf||(function(e){return e.__proto__}),he={array:ze,arrayBuffer:ge,blob:Le,dataView:Be,date:Ne,error:w,map:fe,object:Ge,regExp:Ke,set:pe},Ye=V({},he,{array:Ee,map:Ve,object:Ue,set:We});function Xe(e){return{Arguments:e.object,Array:e.array,ArrayBuffer:e.arrayBuffer,Blob:e.blob,Boolean:O,DataView:e.dataView,Date:e.date,Error:e.error,Float32Array:e.arrayBuffer,Float64Array:e.arrayBuffer,Int8Array:e.arrayBuffer,Int16Array:e.arrayBuffer,Int32Array:e.arrayBuffer,Map:e.map,Number:O,Object:e.object,Promise:w,RegExp:e.regExp,Set:e.set,String:O,WeakMap:w,WeakSet:w,Uint8Array:e.arrayBuffer,Uint8ClampedArray:e.arrayBuffer,Uint16Array:e.arrayBuffer,Uint32Array:e.arrayBuffer,Uint64Array:e.arrayBuffer}}function ye(e){var t=V({},he,e),r=Xe(t),s=r.Array,a=r.Object;function o(n,i){if(i.prototype=i.Constructor=void 0,!n||typeof n!="object")return n;if(i.cache.has(n))return i.cache.get(n);if(i.prototype=He(n),i.Constructor=i.prototype&&i.prototype.constructor,!i.Constructor||i.Constructor===Object)return a(n,i);if(Je(n))return s(n,i);var c=r[Pe(n)];return c?c(n,i):typeof n.then=="function"?n:a(n,i)}return function(i){return o(i,{Constructor:void 0,cache:je(),copier:o,prototype:void 0})}}function Ze(e){return ye(V({},Ye,e))}Ze({});ye({});var v=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},A={exports:{}},F;function et(){if(F)return A.exports;F=1;var e=A.exports={},t,r;function s(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?t=setTimeout:t=s}catch{t=s}try{typeof clearTimeout=="function"?r=clearTimeout:r=a}catch{r=a}})();function o(p){if(t===setTimeout)return setTimeout(p,0);if((t===s||!t)&&setTimeout)return t=setTimeout,setTimeout(p,0);try{return t(p,0)}catch{try{return t.call(null,p,0)}catch{return t.call(this,p,0)}}}function n(p){if(r===clearTimeout)return clearTimeout(p);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(p);try{return r(p)}catch{try{return r.call(null,p)}catch{return r.call(this,p)}}}var i=[],c=!1,l,u=-1;function g(){!c||!l||(c=!1,l.length?i=l.concat(i):u=-1,i.length&&f())}function f(){if(!c){var p=o(g);c=!0;for(var d=i.length;d;){for(l=i,i=[];++u<d;)l&&l[u].run();u=-1,d=i.length}l=null,c=!1,n(p)}}e.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 y(p,d)),i.length===1&&!c&&o(f)};function y(p,d){this.fun=p,this.array=d}y.prototype.run=function(){this.fun.apply(null,this.array)},e.title="browser",e.browser=!0,e.env={},e.argv=[],e.version="",e.versions={};function h(){}return e.on=h,e.addListener=h,e.once=h,e.off=h,e.removeListener=h,e.removeAllListeners=h,e.emit=h,e.prependListener=h,e.prependOnceListener=h,e.listeners=function(p){return[]},e.binding=function(p){throw new Error("process.binding is not supported")},e.cwd=function(){return"/"},e.chdir=function(p){throw new Error("process.chdir is not supported")},e.umask=function(){return 0},A.exports}et();var j,G;function tt(){if(G)return j;G=1;var e=typeof v=="object"&&v&&v.Object===Object&&v;return j=e,j}var k,U;function rt(){if(U)return k;U=1;var e=tt(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return k=r,k}var T,K;function me(){if(K)return T;K=1;var e=rt(),t=e.Symbol;return T=t,T}var _,W;function nt(){if(W)return _;W=1;var e=me(),t=Object.prototype,r=t.hasOwnProperty,s=t.toString,a=e?e.toStringTag:void 0;function o(n){var i=r.call(n,a),c=n[a];try{n[a]=void 0;var l=!0}catch{}var u=s.call(n);return l&&(i?n[a]=c:delete n[a]),u}return _=o,_}var q,J;function it(){if(J)return q;J=1;var e=Object.prototype,t=e.toString;function r(s){return t.call(s)}return q=r,q}var P,H;function de(){if(H)return P;H=1;var e=me(),t=nt(),r=it(),s="[object Null]",a="[object Undefined]",o=e?e.toStringTag:void 0;function n(i){return i==null?i===void 0?a:s:o&&o in Object(i)?t(i):r(i)}return P=n,P}var x,Y;function ot(){if(Y)return x;Y=1;var e=Array.isArray;return x=e,x}var D,X;function be(){if(X)return D;X=1;function e(t){return t!=null&&typeof t=="object"}return D=e,D}var R,Z;function at(){if(Z)return R;Z=1;var e=de(),t=ot(),r=be(),s="[object String]";function a(o){return typeof o=="string"||!t(o)&&r(o)&&e(o)==s}return R=a,R}at();var I,ee;function st(){if(ee)return I;ee=1;function e(t,r){return function(s){return t(r(s))}}return I=e,I}var M,te;function ct(){if(te)return M;te=1;var e=st(),t=e(Object.getPrototypeOf,Object);return M=t,M}var z,re;function lt(){if(re)return z;re=1;var e=de(),t=ct(),r=be(),s="[object Object]",a=Function.prototype,o=Object.prototype,n=a.toString,i=o.hasOwnProperty,c=n.call(Object);function l(u){if(!r(u)||e(u)!=s)return!1;var g=t(u);if(g===null)return!0;var f=i.call(g,"constructor")&&g.constructor;return typeof f=="function"&&f instanceof f&&n.call(f)==c}return z=l,z}lt();var ve={0:8203,1:8204,2:8205,3:8290,4:8291,5:8288,6:65279,7:8289,8:119155,9:119156,a:119157,b:119158,c:119159,d:119160,e:119161,f:119162},$e={0:8203,1:8204,2:8205,3:65279};new Array(4).fill(String.fromCodePoint($e[0])).join("");Object.fromEntries(Object.entries($e).map(e=>e.reverse()));Object.fromEntries(Object.entries(ve).map(e=>e.reverse()));`${Object.values(ve).map(e=>`\\u{${e.toString(16)}}`).join("")}`;var E,ne;function ut(){if(ne)return E;ne=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString;return E=function(r,s,a){if(t.call(s)!=="[object Function]")throw new TypeError("iterator must be a function");var o=r.length;if(o===+o)for(var n=0;n<o;n++)s.call(a,r[n],n,r);else for(var i in r)e.call(r,i)&&s.call(a,r[i],i,r)},E}var L,ie;function gt(){if(ie)return L;ie=1;var e=ut();L=t;function t(r,s,a){if(arguments.length===3)return t.set(r,s,a);if(arguments.length===2)return t.get(r,s);var o=t.bind(t,r);for(var n in t)t.hasOwnProperty(n)&&(o[n]=t[n].bind(o,r));return o}return t.get=function(r,s){for(var a=Array.isArray(s)?s:t.parse(s),o=0;o<a.length;++o){var n=a[o];if(!(typeof r=="object"&&n in r))throw new Error("Invalid reference token: "+n);r=r[n]}return r},t.set=function(r,s,a){var o=Array.isArray(s)?s:t.parse(s),n=o[0];if(o.length===0)throw Error("Can not set the root object");for(var i=0;i<o.length-1;++i){var c=o[i];typeof c!="string"&&typeof c!="number"&&(c=String(c)),!(c==="__proto__"||c==="constructor"||c==="prototype")&&(c==="-"&&Array.isArray(r)&&(c=r.length),n=o[i+1],c in r||(n.match(/^(\d+|-)$/)?r[c]=[]:r[c]={}),r=r[c])}return n==="-"&&Array.isArray(r)&&(n=r.length),r[n]=a,this},t.remove=function(r,s){var a=Array.isArray(s)?s:t.parse(s),o=a[a.length-1];if(o===void 0)throw new Error('Invalid JSON pointer for remove: "'+s+'"');var n=t.get(r,a.slice(0,-1));if(Array.isArray(n)){var i=+o;if(o===""&&isNaN(i))throw new Error('Invalid array index: "'+o+'"');Array.prototype.splice.call(n,i,1)}else delete n[o]},t.dict=function(r,s){var a={};return t.walk(r,function(o,n){a[n]=o},s),a},t.walk=function(r,s,a){var o=[];a=a||function(n){var i=Object.prototype.toString.call(n);return i==="[object Object]"||i==="[object Array]"},(function n(i){e(i,function(c,l){o.push(String(l)),a(c)?n(c):s(c,t.compile(o)),o.pop()})})(r)},t.has=function(r,s){try{t.get(r,s)}catch{return!1}return!0},t.escape=function(r){return r.toString().replace(/~/g,"~0").replace(/\//g,"~1")},t.unescape=function(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")},t.parse=function(r){if(r==="")return[];if(r.charAt(0)!=="/")throw new Error("Invalid JSON pointer: "+r);return r.substring(1).split(/\//).map(t.unescape)},t.compile=function(r){return r.length===0?"":"/"+r.map(t.escape).join("/")},L}gt();var $={exports:{}},oe;function ft(){return oe||(oe=1,(function(e,t){t=e.exports=r,t.getSerialize=s;function r(a,o,n,i){return JSON.stringify(a,s(o,i),n)}function s(a,o){var n=[],i=[];return o==null&&(o=function(c,l){return n[0]===l?"[Circular ~]":"[Circular ~."+i.slice(0,n.indexOf(l)).join(".")+"]"}),function(c,l){if(n.length>0){var u=n.indexOf(this);~u?n.splice(u+1):n.push(this),~u?i.splice(u,1/0,c):i.push(c),~n.indexOf(l)&&(l=o.call(this,c,l))}else n.push(l);return a==null?l:a.call(this,c,l)}}})($,$.exports)),$.exports}ft();class m{static _clientParams;static get clientParams(){if(!this._clientParams)throw new Error("Client is not configured");return this._clientParams}static configure(t){this._clientParams={...t,environment:t.environment??"master"}}static async graphqlQuery(t,r={}){const{space:s,accessToken:a,environment:o="master"}=this.clientParams,n=await fetch(`https://graphql.contentful.com/content/v1/spaces/${s}/environments/${o}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:JSON.stringify({query:t,variables:r})});if(!n.ok){const c=await n.text();throw new Error(`GraphQL request failed: ${n.status} ${n.statusText}
2
+ ${c}`)}const i=await n.json();if(i.errors)throw new Error(`GraphQL errors: ${JSON.stringify(i.errors,null,2)}`);return i.data}}const pt=async({slot:e,page:t=1,size:r=20,platform:s,marketCode:a,language:o})=>{const n=Math.max(1,Math.floor(t)),i=Math.max(1,Math.floor(r)),c=["$slot: String!","$limit: Int!","$skip: Int!"],l={slot:e,limit:i,skip:(n-1)*i},u=["{ slot: $slot }"];s&&(c.push("$platform: String!"),l.platform=s,u.push("{ platform_contains_some: [$platform] }")),a&&(c.push("$marketCode: String!"),l.marketCode=a,u.push("{ OR: [{ market_exists: false }, { market: { code: $marketCode } }] }")),o&&(c.push("$language: String!"),l.language=o,u.push("{ OR: [{ language_exists: false }, { language: { code: $language } }] }"));const g=`(${c.join(", ")})`,f=`(
3
3
  limit: $limit
4
4
  skip: $skip
5
5
  where: {
@@ -45,7 +45,7 @@ query${g} {
45
45
  }
46
46
  }
47
47
  }
48
- `,{bannerCollectionCollection:h}=await m.graphqlQuery(y,{...l});return{page:n,total:h.total,size:i,items:h.items}};class Q extends Response{constructor(...e){super(e[0]??"Not Found",{status:404,...e[1]})}}const he=async({marketCode:t,language:e,page:r=1,size:s=20}={})=>{const a=Math.max(1,Math.floor(r)),o=Math.max(1,Math.floor(s)),n=["$limit: Int!","$skip: Int!"],i={limit:o,skip:(a-1)*o},c=["limit: $limit","skip: $skip"],l=[];t&&(n.push("$marketCode: String!"),i.marketCode=t,l.push("{ OR: [{ market_exists: false }, { market: { code: $marketCode } }] }")),e&&(n.push("$language: String!"),i.language=e,l.push("{ OR: [{ language_exists: false }, { language: { code: $language } }] }")),l.length&&c.push(`where: {
48
+ `,{bannerCollectionCollection:h}=await m.graphqlQuery(y,{...l});return{page:n,total:h.total,size:i,items:h.items}};class Q extends Response{constructor(...t){super(t[0]??"Not Found",{status:404,...t[1]})}}const ht=async({marketCode:e,language:t,page:r=1,size:s=20}={})=>{const a=Math.max(1,Math.floor(r)),o=Math.max(1,Math.floor(s)),n=["$limit: Int!","$skip: Int!"],i={limit:o,skip:(a-1)*o},c=["limit: $limit","skip: $skip"],l=[];e&&(n.push("$marketCode: String!"),i.marketCode=e,l.push("{ OR: [{ market_exists: false }, { market: { code: $marketCode } }] }")),t&&(n.push("$language: String!"),i.language=t,l.push("{ OR: [{ language_exists: false }, { language: { code: $language } }] }")),l.length&&c.push(`where: {
49
49
  AND: [
50
50
  ${l.join(`
51
51
  `)}
@@ -79,7 +79,7 @@ query${u} {
79
79
  }
80
80
  }
81
81
  }
82
- `,{blogPostCollection:y}=await m.graphqlQuery(f,{...i});return{page:a,total:y.total,size:o,items:y.items}},ye=async({id:t,slug:e,marketCode:r,language:s})=>{const a=[],o={},n=[];if(t)a.push("$id: String!"),o.id=t,n.push("{ sys: { id: $id } }");else if(e)a.push("$slug: String!"),o.slug=e,n.push("{ slug: $slug }");else throw new Error("Either id or slug is required.");r&&(a.push("$marketCode: String!"),o.marketCode=r,n.push("{ OR: [{ market_exists: false }, { market: { code: $marketCode } }] }")),s&&(a.push("$language: String!"),o.language=s,n.push("{ OR: [{ language_exists: false }, { language: { code: $language } }] }"));const i=`(${a.join(", ")})`,c=`(
82
+ `,{blogPostCollection:y}=await m.graphqlQuery(f,{...i});return{page:a,total:y.total,size:o,items:y.items}},yt=async({id:e,slug:t,marketCode:r,language:s})=>{const a=[],o={},n=[];if(e)a.push("$id: String!"),o.id=e,n.push("{ sys: { id: $id } }");else if(t)a.push("$slug: String!"),o.slug=t,n.push("{ slug: $slug }");else throw new Error("Either id or slug is required.");r&&(a.push("$marketCode: String!"),o.marketCode=r,n.push("{ OR: [{ market_exists: false }, { market: { code: $marketCode } }] }")),s&&(a.push("$language: String!"),o.language=s,n.push("{ OR: [{ language_exists: false }, { language: { code: $language } }] }"));const i=`(${a.join(", ")})`,c=`(
83
83
  limit: 1
84
84
  where: {
85
85
  AND: [
@@ -130,7 +130,7 @@ query${i} {
130
130
  }
131
131
  }
132
132
  }
133
- `,{blogPostCollection:u}=await m.graphqlQuery(l,{...o}),g=u.items.at(0);if(!g)throw new Q;return g},me=async({page:t=1,size:e=20,marketCode:r,language:s}={})=>{const a=Math.max(1,Math.floor(t)),o=Math.max(1,Math.floor(e)),n=["$limit: Int!","$skip: Int!"],i={limit:o,skip:(a-1)*o},c=[];r&&(n.push("$marketCode: String!"),i.marketCode=r,c.push("{ OR: [{ market_exists: false }, { market: { code: $marketCode } }] }")),s&&(n.push("$language: String!"),i.language=s,c.push("{ OR: [{ language_exists: false }, { language: { code: $language } }] }"));const l=`(${n.join(", ")})`,u=c.length?`(
133
+ `,{blogPostCollection:u}=await m.graphqlQuery(l,{...o}),g=u.items.at(0);if(!g)throw new Q;return g},mt=async({page:e=1,size:t=20,marketCode:r,language:s}={})=>{const a=Math.max(1,Math.floor(e)),o=Math.max(1,Math.floor(t)),n=["$limit: Int!","$skip: Int!"],i={limit:o,skip:(a-1)*o},c=[];r&&(n.push("$marketCode: String!"),i.marketCode=r,c.push("{ OR: [{ market_exists: false }, { market: { code: $marketCode } }] }")),s&&(n.push("$language: String!"),i.language=s,c.push("{ OR: [{ language_exists: false }, { language: { code: $language } }] }"));const l=`(${n.join(", ")})`,u=c.length?`(
134
134
  limit: $limit
135
135
  skip: $skip
136
136
  where: {
@@ -164,7 +164,7 @@ query${l} {
164
164
  }
165
165
  }
166
166
  }
167
- `,{brandCollectionCollection:f}=await m.graphqlQuery(g,{...i});return{page:a,total:f.total,size:o,items:f.items}},de=async({marketCode:t,language:e,page:r=1,size:s=20}={})=>{const a=Math.max(1,Math.floor(r)),o=Math.max(1,Math.floor(s)),n=["$limit: Int!","$skip: Int!"],i={limit:o,skip:(a-1)*o},c=["limit: $limit","skip: $skip"],l=[];t&&(n.push("$marketCode: String!"),i.marketCode=t,l.push("{ OR: [{ market_exists: false }, { market: { code: $marketCode } }] }")),e&&(n.push("$language: String!"),i.language=e,l.push("{ OR: [{ language_exists: false }, { language: { code: $language } }] }")),l.length&&c.push(`where: {
167
+ `,{brandCollectionCollection:f}=await m.graphqlQuery(g,{...i});return{page:a,total:f.total,size:o,items:f.items}},dt=async({marketCode:e,language:t,page:r=1,size:s=20}={})=>{const a=Math.max(1,Math.floor(r)),o=Math.max(1,Math.floor(s)),n=["$limit: Int!","$skip: Int!"],i={limit:o,skip:(a-1)*o},c=["limit: $limit","skip: $skip"],l=[];e&&(n.push("$marketCode: String!"),i.marketCode=e,l.push("{ OR: [{ market_exists: false }, { market: { code: $marketCode } }] }")),t&&(n.push("$language: String!"),i.language=t,l.push("{ OR: [{ language_exists: false }, { language: { code: $language } }] }")),l.length&&c.push(`where: {
168
168
  AND: [
169
169
  ${l.join(`
170
170
  `)}
@@ -195,7 +195,7 @@ query${u} {
195
195
  }
196
196
  }
197
197
  }
198
- `,{documentationCategoryCollection:y}=await m.graphqlQuery(f,{...i});return{page:a,total:y.total,size:o,items:y.items}},be=async({id:t,slug:e,marketCode:r,language:s})=>{const a=[],o={},n=[];if(t)a.push("$id: String!"),o.id=t,n.push("{ sys: { id: $id } }");else if(e)a.push("$slug: String!"),o.slug=e,n.push("{ slug: $slug }");else throw new Error("Either id or slug is required.");r&&(a.push("$marketCode: String!"),o.marketCode=r,n.push("{ OR: [{ market_exists: false }, { market: { code: $marketCode } }] }")),s&&(a.push("$language: String!"),o.language=s,n.push("{ OR: [{ language_exists: false }, { language: { code: $language } }] }"));const i=`(${a.join(", ")})`,c=`(
198
+ `,{documentationCategoryCollection:y}=await m.graphqlQuery(f,{...i});return{page:a,total:y.total,size:o,items:y.items}},bt=async({id:e,slug:t,marketCode:r,language:s})=>{const a=[],o={},n=[];if(e)a.push("$id: String!"),o.id=e,n.push("{ sys: { id: $id } }");else if(t)a.push("$slug: String!"),o.slug=t,n.push("{ slug: $slug }");else throw new Error("Either id or slug is required.");r&&(a.push("$marketCode: String!"),o.marketCode=r,n.push("{ OR: [{ market_exists: false }, { market: { code: $marketCode } }] }")),s&&(a.push("$language: String!"),o.language=s,n.push("{ OR: [{ language_exists: false }, { language: { code: $language } }] }"));const i=`(${a.join(", ")})`,c=`(
199
199
  limit: 1
200
200
  where: {
201
201
  AND: [
@@ -225,7 +225,7 @@ query${i} {
225
225
  }
226
226
  }
227
227
  }
228
- `,{documentationCategoryCollection:u}=await m.graphqlQuery(l,{...o}),g=u.items.at(0);if(!g)throw new Q;return g},ve=async({marketCode:t,language:e,categorySlug:r,page:s=1,size:a=20}={})=>{const o=Math.max(1,Math.floor(s)),n=Math.max(1,Math.floor(a)),i=["$limit: Int!","$skip: Int!"],c={limit:n,skip:(o-1)*n},l=["limit: $limit","skip: $skip"],u=[];t&&(i.push("$marketCode: String!"),c.marketCode=t,u.push("{ OR: [{ market_exists: false }, { market: { code: $marketCode } }] }")),e&&(i.push("$language: String!"),c.language=e,u.push("{ OR: [{ language_exists: false }, { language: { code: $language } }] }")),r&&(i.push("$categorySlug: String!"),c.categorySlug=r,u.push("{ category: { slug: $categorySlug } }")),u.length&&l.push(`where: {
228
+ `,{documentationCategoryCollection:u}=await m.graphqlQuery(l,{...o}),g=u.items.at(0);if(!g)throw new Q;return g},vt=async({marketCode:e,language:t,categorySlug:r,page:s=1,size:a=20}={})=>{const o=Math.max(1,Math.floor(s)),n=Math.max(1,Math.floor(a)),i=["$limit: Int!","$skip: Int!"],c={limit:n,skip:(o-1)*n},l=["limit: $limit","skip: $skip"],u=[];e&&(i.push("$marketCode: String!"),c.marketCode=e,u.push("{ OR: [{ market_exists: false }, { market: { code: $marketCode } }] }")),t&&(i.push("$language: String!"),c.language=t,u.push("{ OR: [{ language_exists: false }, { language: { code: $language } }] }")),r&&(i.push("$categorySlug: String!"),c.categorySlug=r,u.push("{ category: { slug: $categorySlug } }")),u.length&&l.push(`where: {
229
229
  AND: [
230
230
  ${u.join(`
231
231
  `)}
@@ -263,7 +263,7 @@ query${g} {
263
263
  }
264
264
  }
265
265
  }
266
- `,{documentationArticleCollection:h}=await m.graphqlQuery(y,{...c});return{page:o,total:h.total,size:n,items:h.items}},$e=async({id:t,slug:e,marketCode:r,language:s})=>{const a=[],o={},n=[];if(t)a.push("$id: String!"),o.id=t,n.push("{ sys: { id: $id } }");else if(e)a.push("$slug: String!"),o.slug=e,n.push("{ slug: $slug }");else throw new Error("Either id or slug is required.");r&&(a.push("$marketCode: String!"),o.marketCode=r,n.push("{ OR: [{ market_exists: false }, { market: { code: $marketCode } }] }")),s&&(a.push("$language: String!"),o.language=s,n.push("{ OR: [{ language_exists: false }, { language: { code: $language } }] }"));const i=`(${a.join(", ")})`,c=`(
266
+ `,{documentationArticleCollection:h}=await m.graphqlQuery(y,{...c});return{page:o,total:h.total,size:n,items:h.items}},$t=async({id:e,slug:t,marketCode:r,language:s})=>{const a=[],o={},n=[];if(e)a.push("$id: String!"),o.id=e,n.push("{ sys: { id: $id } }");else if(t)a.push("$slug: String!"),o.slug=t,n.push("{ slug: $slug }");else throw new Error("Either id or slug is required.");r&&(a.push("$marketCode: String!"),o.marketCode=r,n.push("{ OR: [{ market_exists: false }, { market: { code: $marketCode } }] }")),s&&(a.push("$language: String!"),o.language=s,n.push("{ OR: [{ language_exists: false }, { language: { code: $language } }] }"));const i=`(${a.join(", ")})`,c=`(
267
267
  limit: 1
268
268
  where: {
269
269
  AND: [
@@ -309,9 +309,10 @@ query${i} {
309
309
  }
310
310
  }
311
311
  }
312
- `,{documentationArticleCollection:u}=await m.graphqlQuery(l,{...o}),g=u.items.at(0);if(!g)throw new Q;return g},we=async({page:t=1,size:e=20,marketCode:r,language:s}={})=>{const a=Math.max(1,Math.floor(t)),o=Math.max(1,Math.floor(e)),n=["$limit: Int!","$skip: Int!"],i={limit:o,skip:(a-1)*o},c=[];r&&(n.push("$marketCode: String!"),i.marketCode=r,c.push("{ OR: [{ market_exists: false }, { market: { code: $marketCode } }] }")),s&&(n.push("$language: String!"),i.language=s,c.push("{ OR: [{ language_exists: false }, { language: { code: $language } }] }"));const l=n.length?`(${n.join(", ")})`:"",u=c.length?`(
312
+ `,{documentationArticleCollection:u}=await m.graphqlQuery(l,{...o}),g=u.items.at(0);if(!g)throw new Q;return g},wt=async({page:e=1,size:t=20,marketCode:r,language:s}={})=>{const a=Math.max(1,Math.floor(e)),o=Math.max(1,Math.floor(t)),n=["$limit: Int!","$skip: Int!"],i={limit:o,skip:(a-1)*o},c=[];r&&(n.push("$marketCode: String!"),i.marketCode=r,c.push("{ OR: [{ market_exists: false }, { market: { code: $marketCode } }] }")),s&&(n.push("$language: String!"),i.language=s,c.push("{ OR: [{ language_exists: false }, { language: { code: $language } }] }"));const l=n.length?`(${n.join(", ")})`:"",u=c.length?`(
313
313
  limit: $limit
314
314
  skip: $skip
315
+ order: order_ASC
315
316
  where: {
316
317
  AND: [
317
318
  ${c.join(`
@@ -321,6 +322,7 @@ query${i} {
321
322
  )`:`(
322
323
  limit: $limit
323
324
  skip: $skip
325
+ order: order_ASC
324
326
  )`,g=`
325
327
  query${l} {
326
328
  hyperlinkCollectionCollection${u} {
@@ -346,7 +348,7 @@ query${l} {
346
348
  }
347
349
  }
348
350
  }
349
- `,{hyperlinkCollectionCollection:f}=await m.graphqlQuery(g,{...i});return{page:a,total:f.total,size:o,items:f.items}},Se=async({page:t=1,size:e=20,marketCode:r,language:s}={})=>{const a=Math.max(1,Math.floor(t)),o=Math.max(1,Math.floor(e)),n=["$limit: Int!","$skip: Int!"],i={limit:o,skip:(a-1)*o},c=[];r&&(n.push("$marketCode: String!"),i.marketCode=r,c.push("{ OR: [{ market_exists: false }, { market: { code: $marketCode } }] }")),s&&(n.push("$language: String!"),i.language=s,c.push("{ OR: [{ language_exists: false }, { language: { code: $language } }] }"));const l=`(${n.join(", ")})`,u=c.length?`(
351
+ `,{hyperlinkCollectionCollection:f}=await m.graphqlQuery(g,{...i});return{page:a,total:f.total,size:o,items:f.items}},St=async({page:e=1,size:t=20,marketCode:r,language:s}={})=>{const a=Math.max(1,Math.floor(e)),o=Math.max(1,Math.floor(t)),n=["$limit: Int!","$skip: Int!"],i={limit:o,skip:(a-1)*o},c=[];r&&(n.push("$marketCode: String!"),i.marketCode=r,c.push("{ OR: [{ market_exists: false }, { market: { code: $marketCode } }] }")),s&&(n.push("$language: String!"),i.language=s,c.push("{ OR: [{ language_exists: false }, { language: { code: $language } }] }"));const l=`(${n.join(", ")})`,u=c.length?`(
350
352
  limit: $limit
351
353
  skip: $skip
352
354
  where: {
@@ -372,4 +374,4 @@ query${l} {
372
374
  }
373
375
  }
374
376
  }
375
- `,{keywordCollectionCollection:f}=await m.graphqlQuery(g,{...i});return{page:a,total:f.total,size:o,items:f.items}};exports.ContentfulSDK=m;exports.getBlogPostDetail=ye;exports.getDocArticleDetail=$e;exports.getDocCategoryDetail=be;exports.listBannerCollections=pe;exports.listBlogPosts=he;exports.listBrandCollections=me;exports.listDocArticles=ve;exports.listDocCategories=de;exports.listHyperlinkCollections=we;exports.listKeywordCollections=Se;
377
+ `,{keywordCollectionCollection:f}=await m.graphqlQuery(g,{...i});return{page:a,total:f.total,size:o,items:f.items}};exports.ContentfulSDK=m;exports.getBannerCollections=pt;exports.getBlogPostDetail=yt;exports.getBlogPosts=ht;exports.getBrandCollections=mt;exports.getDocArticleDetail=$t;exports.getDocArticles=vt;exports.getDocCategories=dt;exports.getDocCategoryDetail=bt;exports.getHyperlinkCollections=wt;exports.getKeywordCollections=St;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- var we = Function.prototype.toString, O = Object.create, Se = Object.prototype.toString, Oe = (
1
+ var we = Function.prototype.toString, C = Object.create, Se = Object.prototype.toString, Ce = (
2
2
  /** @class */
3
3
  (function() {
4
4
  function e() {
@@ -13,25 +13,25 @@ var we = Function.prototype.toString, O = Object.create, Se = Object.prototype.t
13
13
  }, e;
14
14
  })()
15
15
  );
16
- function Ce() {
17
- return new Oe();
16
+ function Oe() {
17
+ return new Ce();
18
18
  }
19
19
  function Ae() {
20
20
  return /* @__PURE__ */ new WeakMap();
21
21
  }
22
- var je = typeof WeakMap < "u" ? Ae : Ce;
22
+ var je = typeof WeakMap < "u" ? Ae : Oe;
23
23
  function N(e) {
24
24
  if (!e)
25
- return O(null);
25
+ return C(null);
26
26
  var t = e.constructor;
27
27
  if (t === Object)
28
- return e === Object.prototype ? {} : O(e);
28
+ return e === Object.prototype ? {} : C(e);
29
29
  if (t && ~we.call(t).indexOf("[native code]"))
30
30
  try {
31
31
  return new t();
32
32
  } catch {
33
33
  }
34
- return O(e);
34
+ return C(e);
35
35
  }
36
36
  function ke(e) {
37
37
  var t = "";
@@ -48,11 +48,11 @@ function ae(e) {
48
48
  function qe(e) {
49
49
  return e[Symbol.toStringTag] || ae(e);
50
50
  }
51
- var Pe = typeof Symbol < "u" ? qe : ae, xe = Object.defineProperty, Re = Object.getOwnPropertyDescriptor, se = Object.getOwnPropertyNames, B = Object.getOwnPropertySymbols, ce = Object.prototype, le = ce.hasOwnProperty, De = ce.propertyIsEnumerable, ue = typeof B == "function";
51
+ var Pe = typeof Symbol < "u" ? qe : ae, xe = Object.defineProperty, Re = Object.getOwnPropertyDescriptor, se = Object.getOwnPropertyNames, B = Object.getOwnPropertySymbols, ce = Object.prototype, ue = ce.hasOwnProperty, De = ce.propertyIsEnumerable, le = typeof B == "function";
52
52
  function Ie(e) {
53
53
  return se(e).concat(B(e));
54
54
  }
55
- var Me = ue ? Ie : se;
55
+ var Me = le ? Ie : se;
56
56
  function S(e, t, r) {
57
57
  for (var s = Me(e), a = 0, o = s.length, n = void 0, i = void 0; a < o; ++a)
58
58
  if (n = s[a], !(n === "callee" || n === "caller")) {
@@ -80,49 +80,49 @@ function Ee(e, t) {
80
80
  var r = new t.Constructor();
81
81
  return t.cache.set(e, r), S(e, r, t);
82
82
  }
83
- function fe(e, t) {
83
+ function ge(e, t) {
84
84
  return e.slice(0);
85
85
  }
86
86
  function Le(e, t) {
87
87
  return e.slice(0, e.size, e.type);
88
88
  }
89
89
  function Ne(e, t) {
90
- return new t.Constructor(fe(e.buffer));
90
+ return new t.Constructor(ge(e.buffer));
91
91
  }
92
92
  function Be(e, t) {
93
93
  return new t.Constructor(e.getTime());
94
94
  }
95
- function ge(e, t) {
95
+ function fe(e, t) {
96
96
  var r = new t.Constructor();
97
97
  return t.cache.set(e, r), e.forEach(function(s, a) {
98
98
  r.set(a, t.copier(s, t));
99
99
  }), r;
100
100
  }
101
101
  function Ve(e, t) {
102
- return S(e, ge(e, t), t);
102
+ return S(e, fe(e, t), t);
103
103
  }
104
104
  function Qe(e, t) {
105
105
  var r = N(t.prototype);
106
106
  t.cache.set(e, r);
107
107
  for (var s in e)
108
- le.call(e, s) && (r[s] = t.copier(e[s], t));
108
+ ue.call(e, s) && (r[s] = t.copier(e[s], t));
109
109
  return r;
110
110
  }
111
111
  function Fe(e, t) {
112
112
  var r = N(t.prototype);
113
113
  t.cache.set(e, r);
114
114
  for (var s in e)
115
- le.call(e, s) && (r[s] = t.copier(e[s], t));
115
+ ue.call(e, s) && (r[s] = t.copier(e[s], t));
116
116
  for (var a = B(e), o = 0, n = a.length, i = void 0; o < n; ++o)
117
117
  i = a[o], De.call(e, i) && (r[i] = t.copier(e[i], t));
118
118
  return r;
119
119
  }
120
- var Ge = ue ? Fe : Qe;
120
+ var Ge = le ? Fe : Qe;
121
121
  function Ue(e, t) {
122
122
  var r = N(t.prototype);
123
123
  return t.cache.set(e, r), S(e, r, t);
124
124
  }
125
- function C(e, t) {
125
+ function O(e, t) {
126
126
  return new t.Constructor(e.valueOf());
127
127
  }
128
128
  function Ke(e, t) {
@@ -145,12 +145,12 @@ var Je = Array.isArray, V = Object.assign, He = Object.getPrototypeOf || (functi
145
145
  return e.__proto__;
146
146
  }), he = {
147
147
  array: ze,
148
- arrayBuffer: fe,
148
+ arrayBuffer: ge,
149
149
  blob: Le,
150
150
  dataView: Ne,
151
151
  date: Be,
152
152
  error: w,
153
- map: ge,
153
+ map: fe,
154
154
  object: Ge,
155
155
  regExp: Ke,
156
156
  set: pe
@@ -166,7 +166,7 @@ function Xe(e) {
166
166
  Array: e.array,
167
167
  ArrayBuffer: e.arrayBuffer,
168
168
  Blob: e.blob,
169
- Boolean: C,
169
+ Boolean: O,
170
170
  DataView: e.dataView,
171
171
  Date: e.date,
172
172
  Error: e.error,
@@ -176,12 +176,12 @@ function Xe(e) {
176
176
  Int16Array: e.arrayBuffer,
177
177
  Int32Array: e.arrayBuffer,
178
178
  Map: e.map,
179
- Number: C,
179
+ Number: O,
180
180
  Object: e.object,
181
181
  Promise: w,
182
182
  RegExp: e.regExp,
183
183
  Set: e.set,
184
- String: C,
184
+ String: O,
185
185
  WeakMap: w,
186
186
  WeakSet: w,
187
187
  Uint8Array: e.arrayBuffer,
@@ -272,20 +272,20 @@ function et() {
272
272
  }
273
273
  }
274
274
  }
275
- var i = [], c = !1, l, u = -1;
276
- function f() {
277
- !c || !l || (c = !1, l.length ? i = l.concat(i) : u = -1, i.length && g());
278
- }
275
+ var i = [], c = !1, u, l = -1;
279
276
  function g() {
277
+ !c || !u || (c = !1, u.length ? i = u.concat(i) : l = -1, i.length && f());
278
+ }
279
+ function f() {
280
280
  if (!c) {
281
- var p = o(f);
281
+ var p = o(g);
282
282
  c = !0;
283
283
  for (var m = i.length; m; ) {
284
- for (l = i, i = []; ++u < m; )
285
- l && l[u].run();
286
- u = -1, m = i.length;
284
+ for (u = i, i = []; ++l < m; )
285
+ u && u[l].run();
286
+ l = -1, m = i.length;
287
287
  }
288
- l = null, c = !1, n(p);
288
+ u = null, c = !1, n(p);
289
289
  }
290
290
  }
291
291
  e.nextTick = function(p) {
@@ -293,7 +293,7 @@ function et() {
293
293
  if (arguments.length > 1)
294
294
  for (var b = 1; b < arguments.length; b++)
295
295
  m[b - 1] = arguments[b];
296
- i.push(new y(p, m)), i.length === 1 && !c && o(g);
296
+ i.push(new y(p, m)), i.length === 1 && !c && o(f);
297
297
  };
298
298
  function y(p, m) {
299
299
  this.fun = p, this.array = m;
@@ -346,11 +346,11 @@ function nt() {
346
346
  var i = r.call(n, a), c = n[a];
347
347
  try {
348
348
  n[a] = void 0;
349
- var l = !0;
349
+ var u = !0;
350
350
  } catch {
351
351
  }
352
- var u = s.call(n);
353
- return l && (i ? n[a] = c : delete n[a]), u;
352
+ var l = s.call(n);
353
+ return u && (i ? n[a] = c : delete n[a]), l;
354
354
  }
355
355
  return _ = o, _;
356
356
  }
@@ -420,29 +420,29 @@ function ct() {
420
420
  return M = t, M;
421
421
  }
422
422
  var z, re;
423
- function lt() {
423
+ function ut() {
424
424
  if (re) return z;
425
425
  re = 1;
426
426
  var e = de(), t = ct(), r = be(), s = "[object Object]", a = Function.prototype, o = Object.prototype, n = a.toString, i = o.hasOwnProperty, c = n.call(Object);
427
- function l(u) {
428
- if (!r(u) || e(u) != s)
427
+ function u(l) {
428
+ if (!r(l) || e(l) != s)
429
429
  return !1;
430
- var f = t(u);
431
- if (f === null)
430
+ var g = t(l);
431
+ if (g === null)
432
432
  return !0;
433
- var g = i.call(f, "constructor") && f.constructor;
434
- return typeof g == "function" && g instanceof g && n.call(g) == c;
433
+ var f = i.call(g, "constructor") && g.constructor;
434
+ return typeof f == "function" && f instanceof f && n.call(f) == c;
435
435
  }
436
- return z = l, z;
436
+ return z = u, z;
437
437
  }
438
- lt();
438
+ ut();
439
439
  var ve = { 0: 8203, 1: 8204, 2: 8205, 3: 8290, 4: 8291, 5: 8288, 6: 65279, 7: 8289, 8: 119155, 9: 119156, a: 119157, b: 119158, c: 119159, d: 119160, e: 119161, f: 119162 }, $e = { 0: 8203, 1: 8204, 2: 8205, 3: 65279 };
440
440
  new Array(4).fill(String.fromCodePoint($e[0])).join("");
441
441
  Object.fromEntries(Object.entries($e).map((e) => e.reverse()));
442
442
  Object.fromEntries(Object.entries(ve).map((e) => e.reverse()));
443
443
  `${Object.values(ve).map((e) => `\\u{${e.toString(16)}}`).join("")}`;
444
444
  var E, ne;
445
- function ut() {
445
+ function lt() {
446
446
  if (ne) return E;
447
447
  ne = 1;
448
448
  var e = Object.prototype.hasOwnProperty, t = Object.prototype.toString;
@@ -459,10 +459,10 @@ function ut() {
459
459
  }, E;
460
460
  }
461
461
  var L, ie;
462
- function ft() {
462
+ function gt() {
463
463
  if (ie) return L;
464
464
  ie = 1;
465
- var e = ut();
465
+ var e = lt();
466
466
  L = t;
467
467
  function t(r, s, a) {
468
468
  if (arguments.length === 3)
@@ -514,8 +514,8 @@ function ft() {
514
514
  var i = Object.prototype.toString.call(n);
515
515
  return i === "[object Object]" || i === "[object Array]";
516
516
  }, (function n(i) {
517
- e(i, function(c, l) {
518
- o.push(String(l)), a(c) ? n(c) : s(c, t.compile(o)), o.pop();
517
+ e(i, function(c, u) {
518
+ o.push(String(u)), a(c) ? n(c) : s(c, t.compile(o)), o.pop();
519
519
  });
520
520
  })(r);
521
521
  }, t.has = function(r, s) {
@@ -539,9 +539,9 @@ function ft() {
539
539
  return r.length === 0 ? "" : "/" + r.map(t.escape).join("/");
540
540
  }, L;
541
541
  }
542
- ft();
542
+ gt();
543
543
  var $ = { exports: {} }, oe;
544
- function gt() {
544
+ function ft() {
545
545
  return oe || (oe = 1, (function(e, t) {
546
546
  t = e.exports = r, t.getSerialize = s;
547
547
  function r(a, o, n, i) {
@@ -549,19 +549,19 @@ function gt() {
549
549
  }
550
550
  function s(a, o) {
551
551
  var n = [], i = [];
552
- return o == null && (o = function(c, l) {
553
- return n[0] === l ? "[Circular ~]" : "[Circular ~." + i.slice(0, n.indexOf(l)).join(".") + "]";
554
- }), function(c, l) {
552
+ return o == null && (o = function(c, u) {
553
+ return n[0] === u ? "[Circular ~]" : "[Circular ~." + i.slice(0, n.indexOf(u)).join(".") + "]";
554
+ }), function(c, u) {
555
555
  if (n.length > 0) {
556
- var u = n.indexOf(this);
557
- ~u ? n.splice(u + 1) : n.push(this), ~u ? i.splice(u, 1 / 0, c) : i.push(c), ~n.indexOf(l) && (l = o.call(this, c, l));
558
- } else n.push(l);
559
- return a == null ? l : a.call(this, c, l);
556
+ var l = n.indexOf(this);
557
+ ~l ? n.splice(l + 1) : n.push(this), ~l ? i.splice(l, 1 / 0, c) : i.push(c), ~n.indexOf(u) && (u = o.call(this, c, u));
558
+ } else n.push(u);
559
+ return a == null ? u : a.call(this, c, u);
560
560
  };
561
561
  }
562
562
  })($, $.exports)), $.exports;
563
563
  }
564
- gt();
564
+ ft();
565
565
  class d {
566
566
  static _clientParams;
567
567
  // static getter
@@ -615,28 +615,28 @@ const pt = async ({
615
615
  "$slot: String!",
616
616
  "$limit: Int!",
617
617
  "$skip: Int!"
618
- ], l = {
618
+ ], u = {
619
619
  slot: e,
620
620
  limit: i,
621
621
  skip: (n - 1) * i
622
- }, u = ["{ slot: $slot }"];
623
- s && (c.push("$platform: String!"), l.platform = s, u.push("{ platform_contains_some: [$platform] }")), a && (c.push("$marketCode: String!"), l.marketCode = a, u.push(
622
+ }, l = ["{ slot: $slot }"];
623
+ s && (c.push("$platform: String!"), u.platform = s, l.push("{ platform_contains_some: [$platform] }")), a && (c.push("$marketCode: String!"), u.marketCode = a, l.push(
624
624
  "{ OR: [{ market_exists: false }, { market: { code: $marketCode } }] }"
625
- )), o && (c.push("$language: String!"), l.language = o, u.push(
625
+ )), o && (c.push("$language: String!"), u.language = o, l.push(
626
626
  "{ OR: [{ language_exists: false }, { language: { code: $language } }] }"
627
627
  ));
628
- const f = `(${c.join(", ")})`, g = `(
628
+ const g = `(${c.join(", ")})`, f = `(
629
629
  limit: $limit
630
630
  skip: $skip
631
631
  where: {
632
632
  AND: [
633
- ${u.join(`
633
+ ${l.join(`
634
634
  `)}
635
635
  ]
636
636
  }
637
637
  )`, y = `
638
- query${f} {
639
- bannerCollectionCollection${g} {
638
+ query${g} {
639
+ bannerCollectionCollection${f} {
640
640
  total
641
641
  items {
642
642
  sys {
@@ -672,7 +672,7 @@ query${f} {
672
672
  }
673
673
  }
674
674
  `, { bannerCollectionCollection: h } = await d.graphqlQuery(y, {
675
- ...l
675
+ ...u
676
676
  });
677
677
  return {
678
678
  page: n,
@@ -698,23 +698,23 @@ const ht = async ({
698
698
  const a = Math.max(1, Math.floor(r)), o = Math.max(1, Math.floor(s)), n = ["$limit: Int!", "$skip: Int!"], i = {
699
699
  limit: o,
700
700
  skip: (a - 1) * o
701
- }, c = ["limit: $limit", "skip: $skip"], l = [];
702
- e && (n.push("$marketCode: String!"), i.marketCode = e, l.push(
701
+ }, c = ["limit: $limit", "skip: $skip"], u = [];
702
+ e && (n.push("$marketCode: String!"), i.marketCode = e, u.push(
703
703
  "{ OR: [{ market_exists: false }, { market: { code: $marketCode } }] }"
704
- )), t && (n.push("$language: String!"), i.language = t, l.push(
704
+ )), t && (n.push("$language: String!"), i.language = t, u.push(
705
705
  "{ OR: [{ language_exists: false }, { language: { code: $language } }] }"
706
- )), l.length && c.push(`where: {
706
+ )), u.length && c.push(`where: {
707
707
  AND: [
708
- ${l.join(`
708
+ ${u.join(`
709
709
  `)}
710
710
  ]
711
711
  }`);
712
- const u = n.length ? `(${n.join(", ")})` : "", f = c.length ? `(
712
+ const l = n.length ? `(${n.join(", ")})` : "", g = c.length ? `(
713
713
  ${c.join(`
714
714
  `)}
715
- )` : "", g = `
716
- query${u} {
717
- blogPostCollection${f} {
715
+ )` : "", f = `
716
+ query${l} {
717
+ blogPostCollection${g} {
718
718
  total
719
719
  items {
720
720
  sys {
@@ -738,7 +738,7 @@ query${u} {
738
738
  }
739
739
  }
740
740
  }
741
- `, { blogPostCollection: y } = await d.graphqlQuery(g, {
741
+ `, { blogPostCollection: y } = await d.graphqlQuery(f, {
742
742
  ...i
743
743
  });
744
744
  return {
@@ -773,7 +773,7 @@ query${u} {
773
773
  `)}
774
774
  ]
775
775
  }
776
- )`, l = `
776
+ )`, u = `
777
777
  query${i} {
778
778
  blogPostCollection${c} {
779
779
  items {
@@ -816,12 +816,12 @@ query${i} {
816
816
  }
817
817
  }
818
818
  }
819
- `, { blogPostCollection: u } = await d.graphqlQuery(l, {
819
+ `, { blogPostCollection: l } = await d.graphqlQuery(u, {
820
820
  ...o
821
- }), f = u.items.at(0);
822
- if (!f)
821
+ }), g = l.items.at(0);
822
+ if (!g)
823
823
  throw new Q();
824
- return f;
824
+ return g;
825
825
  }, mt = async ({
826
826
  page: e = 1,
827
827
  size: t = 20,
@@ -837,7 +837,7 @@ query${i} {
837
837
  )), s && (n.push("$language: String!"), i.language = s, c.push(
838
838
  "{ OR: [{ language_exists: false }, { language: { code: $language } }] }"
839
839
  ));
840
- const l = `(${n.join(", ")})`, u = c.length ? `(
840
+ const u = `(${n.join(", ")})`, l = c.length ? `(
841
841
  limit: $limit
842
842
  skip: $skip
843
843
  where: {
@@ -849,9 +849,9 @@ query${i} {
849
849
  )` : `(
850
850
  limit: $limit
851
851
  skip: $skip
852
- )`, f = `
853
- query${l} {
854
- brandCollectionCollection${u} {
852
+ )`, g = `
853
+ query${u} {
854
+ brandCollectionCollection${l} {
855
855
  total
856
856
  items {
857
857
  sys {
@@ -871,14 +871,14 @@ query${l} {
871
871
  }
872
872
  }
873
873
  }
874
- `, { brandCollectionCollection: g } = await d.graphqlQuery(f, {
874
+ `, { brandCollectionCollection: f } = await d.graphqlQuery(g, {
875
875
  ...i
876
876
  });
877
877
  return {
878
878
  page: a,
879
- total: g.total,
879
+ total: f.total,
880
880
  size: o,
881
- items: g.items
881
+ items: f.items
882
882
  };
883
883
  }, dt = async ({
884
884
  marketCode: e,
@@ -889,23 +889,23 @@ query${l} {
889
889
  const a = Math.max(1, Math.floor(r)), o = Math.max(1, Math.floor(s)), n = ["$limit: Int!", "$skip: Int!"], i = {
890
890
  limit: o,
891
891
  skip: (a - 1) * o
892
- }, c = ["limit: $limit", "skip: $skip"], l = [];
893
- e && (n.push("$marketCode: String!"), i.marketCode = e, l.push(
892
+ }, c = ["limit: $limit", "skip: $skip"], u = [];
893
+ e && (n.push("$marketCode: String!"), i.marketCode = e, u.push(
894
894
  "{ OR: [{ market_exists: false }, { market: { code: $marketCode } }] }"
895
- )), t && (n.push("$language: String!"), i.language = t, l.push(
895
+ )), t && (n.push("$language: String!"), i.language = t, u.push(
896
896
  "{ OR: [{ language_exists: false }, { language: { code: $language } }] }"
897
- )), l.length && c.push(`where: {
897
+ )), u.length && c.push(`where: {
898
898
  AND: [
899
- ${l.join(`
899
+ ${u.join(`
900
900
  `)}
901
901
  ]
902
902
  }`);
903
- const u = n.length ? `(${n.join(", ")})` : "", f = c.length ? `(
903
+ const l = n.length ? `(${n.join(", ")})` : "", g = c.length ? `(
904
904
  ${c.join(`
905
905
  `)}
906
- )` : "", g = `
907
- query${u} {
908
- documentationCategoryCollection${f} {
906
+ )` : "", f = `
907
+ query${l} {
908
+ documentationCategoryCollection${g} {
909
909
  total
910
910
  items {
911
911
  sys {
@@ -926,7 +926,7 @@ query${u} {
926
926
  }
927
927
  }
928
928
  }
929
- `, { documentationCategoryCollection: y } = await d.graphqlQuery(g, {
929
+ `, { documentationCategoryCollection: y } = await d.graphqlQuery(f, {
930
930
  ...i
931
931
  });
932
932
  return {
@@ -961,7 +961,7 @@ query${u} {
961
961
  `)}
962
962
  ]
963
963
  }
964
- )`, l = `
964
+ )`, u = `
965
965
  query${i} {
966
966
  documentationCategoryCollection${c} {
967
967
  items {
@@ -983,12 +983,12 @@ query${i} {
983
983
  }
984
984
  }
985
985
  }
986
- `, { documentationCategoryCollection: u } = await d.graphqlQuery(l, {
986
+ `, { documentationCategoryCollection: l } = await d.graphqlQuery(u, {
987
987
  ...o
988
- }), f = u.items.at(0);
989
- if (!f)
988
+ }), g = l.items.at(0);
989
+ if (!g)
990
990
  throw new Q();
991
- return f;
991
+ return g;
992
992
  }, vt = async ({
993
993
  marketCode: e,
994
994
  language: t,
@@ -999,23 +999,23 @@ query${i} {
999
999
  const o = Math.max(1, Math.floor(s)), n = Math.max(1, Math.floor(a)), i = ["$limit: Int!", "$skip: Int!"], c = {
1000
1000
  limit: n,
1001
1001
  skip: (o - 1) * n
1002
- }, l = ["limit: $limit", "skip: $skip"], u = [];
1003
- e && (i.push("$marketCode: String!"), c.marketCode = e, u.push(
1002
+ }, u = ["limit: $limit", "skip: $skip"], l = [];
1003
+ e && (i.push("$marketCode: String!"), c.marketCode = e, l.push(
1004
1004
  "{ OR: [{ market_exists: false }, { market: { code: $marketCode } }] }"
1005
- )), t && (i.push("$language: String!"), c.language = t, u.push(
1005
+ )), t && (i.push("$language: String!"), c.language = t, l.push(
1006
1006
  "{ OR: [{ language_exists: false }, { language: { code: $language } }] }"
1007
- )), r && (i.push("$categorySlug: String!"), c.categorySlug = r, u.push("{ category: { slug: $categorySlug } }")), u.length && l.push(`where: {
1007
+ )), r && (i.push("$categorySlug: String!"), c.categorySlug = r, l.push("{ category: { slug: $categorySlug } }")), l.length && u.push(`where: {
1008
1008
  AND: [
1009
- ${u.join(`
1009
+ ${l.join(`
1010
1010
  `)}
1011
1011
  ]
1012
1012
  }`);
1013
- const f = i.length ? `(${i.join(", ")})` : "", g = l.length ? `(
1014
- ${l.join(`
1013
+ const g = i.length ? `(${i.join(", ")})` : "", f = u.length ? `(
1014
+ ${u.join(`
1015
1015
  `)}
1016
1016
  )` : "", y = `
1017
- query${f} {
1018
- documentationArticleCollection${g} {
1017
+ query${g} {
1018
+ documentationArticleCollection${f} {
1019
1019
  total
1020
1020
  items {
1021
1021
  sys {
@@ -1078,7 +1078,7 @@ query${f} {
1078
1078
  `)}
1079
1079
  ]
1080
1080
  }
1081
- )`, l = `
1081
+ )`, u = `
1082
1082
  query${i} {
1083
1083
  documentationArticleCollection${c} {
1084
1084
  items {
@@ -1116,12 +1116,12 @@ query${i} {
1116
1116
  }
1117
1117
  }
1118
1118
  }
1119
- `, { documentationArticleCollection: u } = await d.graphqlQuery(l, {
1119
+ `, { documentationArticleCollection: l } = await d.graphqlQuery(u, {
1120
1120
  ...o
1121
- }), f = u.items.at(0);
1122
- if (!f)
1121
+ }), g = l.items.at(0);
1122
+ if (!g)
1123
1123
  throw new Q();
1124
- return f;
1124
+ return g;
1125
1125
  }, wt = async ({
1126
1126
  page: e = 1,
1127
1127
  size: t = 20,
@@ -1137,9 +1137,10 @@ query${i} {
1137
1137
  )), s && (n.push("$language: String!"), i.language = s, c.push(
1138
1138
  "{ OR: [{ language_exists: false }, { language: { code: $language } }] }"
1139
1139
  ));
1140
- const l = n.length ? `(${n.join(", ")})` : "", u = c.length ? `(
1140
+ const u = n.length ? `(${n.join(", ")})` : "", l = c.length ? `(
1141
1141
  limit: $limit
1142
1142
  skip: $skip
1143
+ order: order_ASC
1143
1144
  where: {
1144
1145
  AND: [
1145
1146
  ${c.join(`
@@ -1149,9 +1150,10 @@ query${i} {
1149
1150
  )` : `(
1150
1151
  limit: $limit
1151
1152
  skip: $skip
1152
- )`, f = `
1153
- query${l} {
1154
- hyperlinkCollectionCollection${u} {
1153
+ order: order_ASC
1154
+ )`, g = `
1155
+ query${u} {
1156
+ hyperlinkCollectionCollection${l} {
1155
1157
  total
1156
1158
  items {
1157
1159
  sys {
@@ -1174,17 +1176,17 @@ query${l} {
1174
1176
  }
1175
1177
  }
1176
1178
  }
1177
- `, { hyperlinkCollectionCollection: g } = await d.graphqlQuery(
1178
- f,
1179
+ `, { hyperlinkCollectionCollection: f } = await d.graphqlQuery(
1180
+ g,
1179
1181
  {
1180
1182
  ...i
1181
1183
  }
1182
1184
  );
1183
1185
  return {
1184
1186
  page: a,
1185
- total: g.total,
1187
+ total: f.total,
1186
1188
  size: o,
1187
- items: g.items
1189
+ items: f.items
1188
1190
  };
1189
1191
  }, St = async ({
1190
1192
  page: e = 1,
@@ -1201,7 +1203,7 @@ query${l} {
1201
1203
  )), s && (n.push("$language: String!"), i.language = s, c.push(
1202
1204
  "{ OR: [{ language_exists: false }, { language: { code: $language } }] }"
1203
1205
  ));
1204
- const l = `(${n.join(", ")})`, u = c.length ? `(
1206
+ const u = `(${n.join(", ")})`, l = c.length ? `(
1205
1207
  limit: $limit
1206
1208
  skip: $skip
1207
1209
  where: {
@@ -1213,9 +1215,9 @@ query${l} {
1213
1215
  )` : `(
1214
1216
  limit: $limit
1215
1217
  skip: $skip
1216
- )`, f = `
1217
- query${l} {
1218
- keywordCollectionCollection${u} {
1218
+ )`, g = `
1219
+ query${u} {
1220
+ keywordCollectionCollection${l} {
1219
1221
  total
1220
1222
  items {
1221
1223
  sys {
@@ -1227,26 +1229,26 @@ query${l} {
1227
1229
  }
1228
1230
  }
1229
1231
  }
1230
- `, { keywordCollectionCollection: g } = await d.graphqlQuery(f, {
1232
+ `, { keywordCollectionCollection: f } = await d.graphqlQuery(g, {
1231
1233
  ...i
1232
1234
  });
1233
1235
  return {
1234
1236
  page: a,
1235
- total: g.total,
1237
+ total: f.total,
1236
1238
  size: o,
1237
- items: g.items
1239
+ items: f.items
1238
1240
  };
1239
1241
  };
1240
1242
  export {
1241
1243
  d as ContentfulSDK,
1244
+ pt as getBannerCollections,
1242
1245
  yt as getBlogPostDetail,
1246
+ ht as getBlogPosts,
1247
+ mt as getBrandCollections,
1243
1248
  $t as getDocArticleDetail,
1249
+ vt as getDocArticles,
1250
+ dt as getDocCategories,
1244
1251
  bt as getDocCategoryDetail,
1245
- pt as listBannerCollections,
1246
- ht as listBlogPosts,
1247
- mt as listBrandCollections,
1248
- vt as listDocArticles,
1249
- dt as listDocCategories,
1250
- wt as listHyperlinkCollections,
1251
- St as listKeywordCollections
1252
+ wt as getHyperlinkCollections,
1253
+ St as getKeywordCollections
1252
1254
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@janbox/contentful-marketplace-sdk",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "main": "./dist/index.cjs",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",