@janbox/contentful-marketplace-sdk 1.0.12 → 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.
- package/dist/entries/banner-collection.d.ts +2 -6
- package/dist/entries/blog-category.d.ts +2 -6
- package/dist/entries/blog-collection.d.ts +7 -6
- package/dist/entries/blog.d.ts +5 -8
- package/dist/entries/brand-collection.d.ts +2 -6
- package/dist/entries/documentation.d.ts +4 -13
- package/dist/entries/hyperlink-collection.d.ts +2 -6
- package/dist/entries/keyword-collection.d.ts +2 -6
- package/dist/index.cjs +77 -44
- package/dist/index.d.ts +1 -0
- package/dist/index.js +500 -442
- package/dist/utils/index.d.ts +13 -0
- package/package.json +1 -1
|
@@ -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,7 +1,11 @@
|
|
|
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 = {
|
|
6
|
+
sys: {
|
|
7
|
+
id: string;
|
|
8
|
+
};
|
|
5
9
|
title: string;
|
|
6
10
|
slug: string;
|
|
7
11
|
};
|
|
@@ -11,13 +15,10 @@ export type BlogCollectionGraphQLItem = {
|
|
|
11
15
|
};
|
|
12
16
|
category: BlogCollectionCategoryGraphQLItem | null;
|
|
13
17
|
featuredImage: GraphQLAsset | null;
|
|
18
|
+
categoryId: string | null;
|
|
19
|
+
collectionId: string | null;
|
|
14
20
|
} & Pick<BlogCollectionEntry["fields"], "name" | "type" | "order">;
|
|
15
|
-
export type GetBlogCollectionsResponse =
|
|
16
|
-
page: number;
|
|
17
|
-
total: number;
|
|
18
|
-
size: number;
|
|
19
|
-
items: BlogCollectionGraphQLItem[];
|
|
20
|
-
};
|
|
21
|
+
export type GetBlogCollectionsResponse = PaginatedResponse<BlogCollectionGraphQLItem>;
|
|
21
22
|
export declare const getBlogCollections: ({ marketCode, locale, page, size, }?: {
|
|
22
23
|
marketCode?: string;
|
|
23
24
|
locale?: string;
|
package/dist/entries/blog.d.ts
CHANGED
|
@@ -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,15 +12,16 @@ 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;
|
|
17
19
|
featuredImage: GraphQLAsset | null;
|
|
18
|
-
} & Pick<BlogPostEntry["fields"], "title" | "shortDescription" | "slug">;
|
|
19
|
-
export interface BlogPostDetailGraphQLItem extends BlogPostGraphQLItem {
|
|
20
20
|
categoriesCollection: {
|
|
21
21
|
items: BlogPostCategoryGraphQLItem[];
|
|
22
22
|
} | null;
|
|
23
|
+
} & Pick<BlogPostEntry["fields"], "title" | "shortDescription" | "slug">;
|
|
24
|
+
export interface BlogPostDetailGraphQLItem extends BlogPostGraphQLItem {
|
|
23
25
|
author: {
|
|
24
26
|
name: string;
|
|
25
27
|
avatar: GraphQLAsset | null;
|
|
@@ -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
|
|
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<
|
|
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
|
|
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
|
-
)`,
|
|
12
|
-
query${
|
|
13
|
-
bannerCollectionCollection${
|
|
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:
|
|
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 {
|
|
@@ -60,6 +60,18 @@ query($collectionId: String!, $limit: Int!, $skip: Int!) {
|
|
|
60
60
|
title
|
|
61
61
|
shortDescription
|
|
62
62
|
slug
|
|
63
|
+
categoriesCollection {
|
|
64
|
+
items {
|
|
65
|
+
title
|
|
66
|
+
slug
|
|
67
|
+
featuredImage {
|
|
68
|
+
url
|
|
69
|
+
width
|
|
70
|
+
height
|
|
71
|
+
contentType
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
63
75
|
featuredImage {
|
|
64
76
|
url
|
|
65
77
|
width
|
|
@@ -71,17 +83,17 @@ query($collectionId: String!, $limit: Int!, $skip: Int!) {
|
|
|
71
83
|
}
|
|
72
84
|
}
|
|
73
85
|
}
|
|
74
|
-
`,{blogCollectionCollection
|
|
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: {
|
|
75
87
|
AND: [
|
|
76
|
-
${
|
|
88
|
+
${g.join(`
|
|
77
89
|
`)}
|
|
78
90
|
]
|
|
79
|
-
}`);const
|
|
91
|
+
}`);const f=l.length?`(${l.join(", ")})`:"",y=u.length?`(
|
|
80
92
|
${u.join(`
|
|
81
93
|
`)}
|
|
82
|
-
)`:"",
|
|
83
|
-
query${
|
|
84
|
-
blogPostCollection${
|
|
94
|
+
)`:"",p=`
|
|
95
|
+
query${f} {
|
|
96
|
+
blogPostCollection${y} {
|
|
85
97
|
total
|
|
86
98
|
items {
|
|
87
99
|
sys {
|
|
@@ -92,6 +104,18 @@ query${g} {
|
|
|
92
104
|
title
|
|
93
105
|
shortDescription
|
|
94
106
|
slug
|
|
107
|
+
categoriesCollection {
|
|
108
|
+
items {
|
|
109
|
+
title
|
|
110
|
+
slug
|
|
111
|
+
featuredImage {
|
|
112
|
+
url
|
|
113
|
+
width
|
|
114
|
+
height
|
|
115
|
+
contentType
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
95
119
|
featuredImage {
|
|
96
120
|
url
|
|
97
121
|
width
|
|
@@ -101,7 +125,7 @@ query${g} {
|
|
|
101
125
|
}
|
|
102
126
|
}
|
|
103
127
|
}
|
|
104
|
-
`,{blogPostCollection:
|
|
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=`(
|
|
105
129
|
limit: 1
|
|
106
130
|
where: {
|
|
107
131
|
AND: [
|
|
@@ -110,7 +134,7 @@ query${g} {
|
|
|
110
134
|
]
|
|
111
135
|
}
|
|
112
136
|
)`,c=`
|
|
113
|
-
query${
|
|
137
|
+
query${n} {
|
|
114
138
|
blogPostCollection${l} {
|
|
115
139
|
items {
|
|
116
140
|
sys {
|
|
@@ -125,6 +149,12 @@ query${i} {
|
|
|
125
149
|
items {
|
|
126
150
|
title
|
|
127
151
|
slug
|
|
152
|
+
featuredImage {
|
|
153
|
+
url
|
|
154
|
+
width
|
|
155
|
+
height
|
|
156
|
+
contentType
|
|
157
|
+
}
|
|
128
158
|
}
|
|
129
159
|
}
|
|
130
160
|
featuredImage {
|
|
@@ -169,17 +199,17 @@ query${i} {
|
|
|
169
199
|
}
|
|
170
200
|
}
|
|
171
201
|
}
|
|
172
|
-
`,{blogPostCollection:u}=await
|
|
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: {
|
|
173
203
|
AND: [
|
|
174
204
|
${c.join(`
|
|
175
205
|
`)}
|
|
176
206
|
]
|
|
177
|
-
}`);const u=o.length?`(${o.join(", ")})`:"",
|
|
207
|
+
}`);const u=o.length?`(${o.join(", ")})`:"",g=l.length?`(
|
|
178
208
|
${l.join(`
|
|
179
209
|
`)}
|
|
180
|
-
)`:"",
|
|
210
|
+
)`:"",f=`
|
|
181
211
|
query${u} {
|
|
182
|
-
blogCategoryCollection${
|
|
212
|
+
blogCategoryCollection${g} {
|
|
183
213
|
total
|
|
184
214
|
items {
|
|
185
215
|
sys {
|
|
@@ -190,7 +220,7 @@ query${u} {
|
|
|
190
220
|
}
|
|
191
221
|
}
|
|
192
222
|
}
|
|
193
|
-
`,{blogCategoryCollection:
|
|
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=`(
|
|
194
224
|
limit: 1
|
|
195
225
|
where: {
|
|
196
226
|
AND: [
|
|
@@ -199,7 +229,7 @@ query${u} {
|
|
|
199
229
|
]
|
|
200
230
|
}
|
|
201
231
|
)`,c=`
|
|
202
|
-
query${
|
|
232
|
+
query${n} {
|
|
203
233
|
blogCategoryCollection${l} {
|
|
204
234
|
items {
|
|
205
235
|
sys {
|
|
@@ -228,17 +258,17 @@ query${i} {
|
|
|
228
258
|
}
|
|
229
259
|
}
|
|
230
260
|
}
|
|
231
|
-
`,{blogCategoryCollection:u}=await
|
|
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: {
|
|
232
262
|
AND: [
|
|
233
263
|
${c.join(`
|
|
234
264
|
`)}
|
|
235
265
|
]
|
|
236
|
-
}`);const u=o.length?`(${o.join(", ")})`:"",
|
|
266
|
+
}`);const u=o.length?`(${o.join(", ")})`:"",g=l.length?`(
|
|
237
267
|
${l.join(`
|
|
238
268
|
`)}
|
|
239
|
-
)`:"",
|
|
269
|
+
)`:"",f=`
|
|
240
270
|
query${u} {
|
|
241
|
-
blogCollectionCollection${
|
|
271
|
+
blogCollectionCollection${g} {
|
|
242
272
|
total
|
|
243
273
|
items {
|
|
244
274
|
name
|
|
@@ -248,6 +278,9 @@ query${u} {
|
|
|
248
278
|
id
|
|
249
279
|
}
|
|
250
280
|
category {
|
|
281
|
+
sys {
|
|
282
|
+
id
|
|
283
|
+
}
|
|
251
284
|
title
|
|
252
285
|
slug
|
|
253
286
|
}
|
|
@@ -260,7 +293,7 @@ query${u} {
|
|
|
260
293
|
}
|
|
261
294
|
}
|
|
262
295
|
}
|
|
263
|
-
`,{blogCollectionCollection:
|
|
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?`(
|
|
264
297
|
limit: $limit
|
|
265
298
|
skip: $skip
|
|
266
299
|
where: {
|
|
@@ -272,7 +305,7 @@ query${u} {
|
|
|
272
305
|
)`:`(
|
|
273
306
|
limit: $limit
|
|
274
307
|
skip: $skip
|
|
275
|
-
)`,
|
|
308
|
+
)`,g=`
|
|
276
309
|
query${c} {
|
|
277
310
|
brandCollectionCollection${u} {
|
|
278
311
|
total
|
|
@@ -308,17 +341,17 @@ query${c} {
|
|
|
308
341
|
}
|
|
309
342
|
}
|
|
310
343
|
}
|
|
311
|
-
`,{brandCollectionCollection:
|
|
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: {
|
|
312
345
|
AND: [
|
|
313
346
|
${c.join(`
|
|
314
347
|
`)}
|
|
315
348
|
]
|
|
316
|
-
}`);const u=o.length?`(${o.join(", ")})`:"",
|
|
349
|
+
}`);const u=o.length?`(${o.join(", ")})`:"",g=l.length?`(
|
|
317
350
|
${l.join(`
|
|
318
351
|
`)}
|
|
319
|
-
)`:"",
|
|
352
|
+
)`:"",f=`
|
|
320
353
|
query${u} {
|
|
321
|
-
documentationCategoryCollection${
|
|
354
|
+
documentationCategoryCollection${g} {
|
|
322
355
|
total
|
|
323
356
|
items {
|
|
324
357
|
sys {
|
|
@@ -339,7 +372,7 @@ query${u} {
|
|
|
339
372
|
}
|
|
340
373
|
}
|
|
341
374
|
}
|
|
342
|
-
`,{documentationCategoryCollection:
|
|
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=`(
|
|
343
376
|
limit: 1
|
|
344
377
|
where: {
|
|
345
378
|
AND: [
|
|
@@ -348,7 +381,7 @@ query${u} {
|
|
|
348
381
|
]
|
|
349
382
|
}
|
|
350
383
|
)`,c=`
|
|
351
|
-
query${
|
|
384
|
+
query${n} {
|
|
352
385
|
documentationCategoryCollection${l} {
|
|
353
386
|
items {
|
|
354
387
|
sys {
|
|
@@ -369,17 +402,17 @@ query${i} {
|
|
|
369
402
|
}
|
|
370
403
|
}
|
|
371
404
|
}
|
|
372
|
-
`,{documentationCategoryCollection:u}=await
|
|
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: {
|
|
373
406
|
AND: [
|
|
374
407
|
${u.join(`
|
|
375
408
|
`)}
|
|
376
409
|
]
|
|
377
|
-
}`);const
|
|
410
|
+
}`);const g=n.length?`(${n.join(", ")})`:"",f=c.length?`(
|
|
378
411
|
${c.join(`
|
|
379
412
|
`)}
|
|
380
|
-
)`:"",
|
|
381
|
-
query${
|
|
382
|
-
documentationArticleCollection${
|
|
413
|
+
)`:"",y=`
|
|
414
|
+
query${g} {
|
|
415
|
+
documentationArticleCollection${f} {
|
|
383
416
|
total
|
|
384
417
|
items {
|
|
385
418
|
sys {
|
|
@@ -407,7 +440,7 @@ query${f} {
|
|
|
407
440
|
}
|
|
408
441
|
}
|
|
409
442
|
}
|
|
410
|
-
`,{documentationArticleCollection:
|
|
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=`(
|
|
411
444
|
limit: 1
|
|
412
445
|
where: {
|
|
413
446
|
AND: [
|
|
@@ -416,7 +449,7 @@ query${f} {
|
|
|
416
449
|
]
|
|
417
450
|
}
|
|
418
451
|
)`,c=`
|
|
419
|
-
query${
|
|
452
|
+
query${n} {
|
|
420
453
|
documentationArticleCollection${l} {
|
|
421
454
|
items {
|
|
422
455
|
sys {
|
|
@@ -468,7 +501,7 @@ query${i} {
|
|
|
468
501
|
}
|
|
469
502
|
}
|
|
470
503
|
}
|
|
471
|
-
`,{documentationArticleCollection:u}=await
|
|
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?`(
|
|
472
505
|
limit: $limit
|
|
473
506
|
skip: $skip
|
|
474
507
|
order: order_ASC
|
|
@@ -482,7 +515,7 @@ query${i} {
|
|
|
482
515
|
limit: $limit
|
|
483
516
|
skip: $skip
|
|
484
517
|
order: order_ASC
|
|
485
|
-
)`,
|
|
518
|
+
)`,g=`
|
|
486
519
|
query${c} {
|
|
487
520
|
hyperlinkCollectionCollection${u} {
|
|
488
521
|
total
|
|
@@ -507,7 +540,7 @@ query${c} {
|
|
|
507
540
|
}
|
|
508
541
|
}
|
|
509
542
|
}
|
|
510
|
-
`,{hyperlinkCollectionCollection:
|
|
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?`(
|
|
511
544
|
limit: $limit
|
|
512
545
|
skip: $skip
|
|
513
546
|
where: {
|
|
@@ -519,7 +552,7 @@ query${c} {
|
|
|
519
552
|
)`:`(
|
|
520
553
|
limit: $limit
|
|
521
554
|
skip: $skip
|
|
522
|
-
)`,
|
|
555
|
+
)`,g=`
|
|
523
556
|
query${c} {
|
|
524
557
|
keywordCollectionCollection${u} {
|
|
525
558
|
total
|
|
@@ -533,4 +566,4 @@ query${c} {
|
|
|
533
566
|
}
|
|
534
567
|
}
|
|
535
568
|
}
|
|
536
|
-
`,{keywordCollectionCollection:
|
|
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