@janbox/contentful-marketplace-sdk 1.0.11 → 1.0.13
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/blog-collection.d.ts +5 -1
- package/dist/entries/blog.d.ts +2 -2
- package/dist/index.cjs +21 -0
- package/dist/index.js +262 -241
- package/dist/types/content-model.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { TypeBlogCollectionSkeleton } from '../types';
|
|
1
|
+
import { TypeBlogCollectionSkeleton, GraphQLAsset } from '../types';
|
|
2
2
|
import { Entry } from 'contentful';
|
|
3
3
|
type BlogCollectionEntry = Entry<TypeBlogCollectionSkeleton, "WITHOUT_UNRESOLVABLE_LINKS", string>;
|
|
4
4
|
type BlogCollectionCategoryGraphQLItem = {
|
|
5
|
+
sys: {
|
|
6
|
+
id: string;
|
|
7
|
+
};
|
|
5
8
|
title: string;
|
|
6
9
|
slug: string;
|
|
7
10
|
};
|
|
@@ -10,6 +13,7 @@ export type BlogCollectionGraphQLItem = {
|
|
|
10
13
|
id: string;
|
|
11
14
|
};
|
|
12
15
|
category: BlogCollectionCategoryGraphQLItem | null;
|
|
16
|
+
featuredImage: GraphQLAsset | null;
|
|
13
17
|
} & Pick<BlogCollectionEntry["fields"], "name" | "type" | "order">;
|
|
14
18
|
export type GetBlogCollectionsResponse = {
|
|
15
19
|
page: number;
|
package/dist/entries/blog.d.ts
CHANGED
|
@@ -15,11 +15,11 @@ type BlogPostCategoryGraphQLItem = {
|
|
|
15
15
|
export type BlogPostGraphQLItem = {
|
|
16
16
|
sys: GraphQLEntrySys;
|
|
17
17
|
featuredImage: GraphQLAsset | null;
|
|
18
|
-
} & Pick<BlogPostEntry["fields"], "title" | "shortDescription" | "slug">;
|
|
19
|
-
export interface BlogPostDetailGraphQLItem extends BlogPostGraphQLItem {
|
|
20
18
|
categoriesCollection: {
|
|
21
19
|
items: BlogPostCategoryGraphQLItem[];
|
|
22
20
|
} | null;
|
|
21
|
+
} & Pick<BlogPostEntry["fields"], "title" | "shortDescription" | "slug">;
|
|
22
|
+
export interface BlogPostDetailGraphQLItem extends BlogPostGraphQLItem {
|
|
23
23
|
author: {
|
|
24
24
|
name: string;
|
|
25
25
|
avatar: GraphQLAsset | null;
|
package/dist/index.cjs
CHANGED
|
@@ -60,6 +60,12 @@ 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
|
+
}
|
|
68
|
+
}
|
|
63
69
|
featuredImage {
|
|
64
70
|
url
|
|
65
71
|
width
|
|
@@ -92,6 +98,12 @@ query${g} {
|
|
|
92
98
|
title
|
|
93
99
|
shortDescription
|
|
94
100
|
slug
|
|
101
|
+
categoriesCollection {
|
|
102
|
+
items {
|
|
103
|
+
title
|
|
104
|
+
slug
|
|
105
|
+
}
|
|
106
|
+
}
|
|
95
107
|
featuredImage {
|
|
96
108
|
url
|
|
97
109
|
width
|
|
@@ -248,9 +260,18 @@ query${u} {
|
|
|
248
260
|
id
|
|
249
261
|
}
|
|
250
262
|
category {
|
|
263
|
+
sys {
|
|
264
|
+
id
|
|
265
|
+
}
|
|
251
266
|
title
|
|
252
267
|
slug
|
|
253
268
|
}
|
|
269
|
+
featuredImage {
|
|
270
|
+
url
|
|
271
|
+
width
|
|
272
|
+
height
|
|
273
|
+
contentType
|
|
274
|
+
}
|
|
254
275
|
}
|
|
255
276
|
}
|
|
256
277
|
}
|
package/dist/index.js
CHANGED
|
@@ -54,17 +54,17 @@ function Mt(t) {
|
|
|
54
54
|
}
|
|
55
55
|
var zt = ft ? Mt : lt;
|
|
56
56
|
function S(t, e, r) {
|
|
57
|
-
for (var a = zt(t), s = 0,
|
|
58
|
-
if (
|
|
59
|
-
if (
|
|
60
|
-
e[
|
|
57
|
+
for (var a = zt(t), s = 0, n = a.length, i = void 0, o = void 0; s < n; ++s)
|
|
58
|
+
if (i = a[s], !(i === "callee" || i === "caller")) {
|
|
59
|
+
if (o = It(t, i), !o) {
|
|
60
|
+
e[i] = r.copier(t[i], r);
|
|
61
61
|
continue;
|
|
62
62
|
}
|
|
63
|
-
!
|
|
63
|
+
!o.get && !o.set && (o.value = r.copier(o.value, r));
|
|
64
64
|
try {
|
|
65
|
-
Rt(e,
|
|
65
|
+
Rt(e, i, o);
|
|
66
66
|
} catch {
|
|
67
|
-
e[
|
|
67
|
+
e[i] = o.value;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
return e;
|
|
@@ -113,8 +113,8 @@ function Gt(t, e) {
|
|
|
113
113
|
e.cache.set(t, r);
|
|
114
114
|
for (var a in t)
|
|
115
115
|
ut.call(t, a) && (r[a] = e.copier(t[a], e));
|
|
116
|
-
for (var s = Q(t),
|
|
117
|
-
|
|
116
|
+
for (var s = Q(t), n = 0, i = s.length, o = void 0; n < i; ++n)
|
|
117
|
+
o = s[n], Dt.call(t, o) && (r[o] = e.copier(t[o], e));
|
|
118
118
|
return r;
|
|
119
119
|
}
|
|
120
120
|
var Ut = ft ? Gt : Ft;
|
|
@@ -193,23 +193,23 @@ function Zt(t) {
|
|
|
193
193
|
}
|
|
194
194
|
function yt(t) {
|
|
195
195
|
var e = F({}, mt, t), r = Zt(e), a = r.Array, s = r.Object;
|
|
196
|
-
function i
|
|
197
|
-
if (
|
|
198
|
-
return
|
|
199
|
-
if (
|
|
200
|
-
return
|
|
201
|
-
if (
|
|
202
|
-
return s(
|
|
203
|
-
if (Ht(
|
|
204
|
-
return a(
|
|
205
|
-
var l = r[xt(
|
|
206
|
-
return l ? l(
|
|
196
|
+
function n(i, o) {
|
|
197
|
+
if (o.prototype = o.Constructor = void 0, !i || typeof i != "object")
|
|
198
|
+
return i;
|
|
199
|
+
if (o.cache.has(i))
|
|
200
|
+
return o.cache.get(i);
|
|
201
|
+
if (o.prototype = Yt(i), o.Constructor = o.prototype && o.prototype.constructor, !o.Constructor || o.Constructor === Object)
|
|
202
|
+
return s(i, o);
|
|
203
|
+
if (Ht(i))
|
|
204
|
+
return a(i, o);
|
|
205
|
+
var l = r[xt(i)];
|
|
206
|
+
return l ? l(i, o) : typeof i.then == "function" ? i : s(i, o);
|
|
207
207
|
}
|
|
208
|
-
return function(
|
|
209
|
-
return
|
|
208
|
+
return function(o) {
|
|
209
|
+
return n(o, {
|
|
210
210
|
Constructor: void 0,
|
|
211
211
|
cache: jt(),
|
|
212
|
-
copier:
|
|
212
|
+
copier: n,
|
|
213
213
|
prototype: void 0
|
|
214
214
|
});
|
|
215
215
|
};
|
|
@@ -219,7 +219,7 @@ function te(t) {
|
|
|
219
219
|
}
|
|
220
220
|
te({});
|
|
221
221
|
yt({});
|
|
222
|
-
var
|
|
222
|
+
var C = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, j = { exports: {} }, G;
|
|
223
223
|
function ee() {
|
|
224
224
|
if (G) return j.exports;
|
|
225
225
|
G = 1;
|
|
@@ -242,7 +242,7 @@ function ee() {
|
|
|
242
242
|
r = s;
|
|
243
243
|
}
|
|
244
244
|
})();
|
|
245
|
-
function
|
|
245
|
+
function n(p) {
|
|
246
246
|
if (e === setTimeout)
|
|
247
247
|
return setTimeout(p, 0);
|
|
248
248
|
if ((e === a || !e) && setTimeout)
|
|
@@ -257,7 +257,7 @@ function ee() {
|
|
|
257
257
|
}
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
|
-
function
|
|
260
|
+
function i(p) {
|
|
261
261
|
if (r === clearTimeout)
|
|
262
262
|
return clearTimeout(p);
|
|
263
263
|
if ((r === s || !r) && clearTimeout)
|
|
@@ -272,20 +272,20 @@ function ee() {
|
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
|
-
var
|
|
275
|
+
var o = [], l = !1, c, u = -1;
|
|
276
276
|
function f() {
|
|
277
|
-
!l || !c || (l = !1, c.length ?
|
|
277
|
+
!l || !c || (l = !1, c.length ? o = c.concat(o) : u = -1, o.length && g());
|
|
278
278
|
}
|
|
279
279
|
function g() {
|
|
280
280
|
if (!l) {
|
|
281
|
-
var p =
|
|
281
|
+
var p = n(f);
|
|
282
282
|
l = !0;
|
|
283
|
-
for (var d =
|
|
284
|
-
for (c =
|
|
283
|
+
for (var d = o.length; d; ) {
|
|
284
|
+
for (c = o, o = []; ++u < d; )
|
|
285
285
|
c && c[u].run();
|
|
286
|
-
u = -1, d =
|
|
286
|
+
u = -1, d = o.length;
|
|
287
287
|
}
|
|
288
|
-
c = null, l = !1,
|
|
288
|
+
c = null, l = !1, i(p);
|
|
289
289
|
}
|
|
290
290
|
}
|
|
291
291
|
t.nextTick = function(p) {
|
|
@@ -293,7 +293,7 @@ function ee() {
|
|
|
293
293
|
if (arguments.length > 1)
|
|
294
294
|
for (var b = 1; b < arguments.length; b++)
|
|
295
295
|
d[b - 1] = arguments[b];
|
|
296
|
-
|
|
296
|
+
o.push(new h(p, d)), o.length === 1 && !l && n(g);
|
|
297
297
|
};
|
|
298
298
|
function h(p, d) {
|
|
299
299
|
this.fun = p, this.array = d;
|
|
@@ -320,11 +320,11 @@ var q, U;
|
|
|
320
320
|
function re() {
|
|
321
321
|
if (U) return q;
|
|
322
322
|
U = 1;
|
|
323
|
-
var t = typeof
|
|
323
|
+
var t = typeof C == "object" && C && C.Object === Object && C;
|
|
324
324
|
return q = t, q;
|
|
325
325
|
}
|
|
326
326
|
var T, K;
|
|
327
|
-
function
|
|
327
|
+
function ie() {
|
|
328
328
|
if (K) return T;
|
|
329
329
|
K = 1;
|
|
330
330
|
var t = re(), e = typeof self == "object" && self && self.Object === Object && self, r = t || e || Function("return this")();
|
|
@@ -334,28 +334,28 @@ var _, W;
|
|
|
334
334
|
function dt() {
|
|
335
335
|
if (W) return _;
|
|
336
336
|
W = 1;
|
|
337
|
-
var t =
|
|
337
|
+
var t = ie(), e = t.Symbol;
|
|
338
338
|
return _ = e, _;
|
|
339
339
|
}
|
|
340
340
|
var P, J;
|
|
341
|
-
function
|
|
341
|
+
function oe() {
|
|
342
342
|
if (J) return P;
|
|
343
343
|
J = 1;
|
|
344
344
|
var t = dt(), e = Object.prototype, r = e.hasOwnProperty, a = e.toString, s = t ? t.toStringTag : void 0;
|
|
345
|
-
function i
|
|
346
|
-
var
|
|
345
|
+
function n(i) {
|
|
346
|
+
var o = r.call(i, s), l = i[s];
|
|
347
347
|
try {
|
|
348
|
-
|
|
348
|
+
i[s] = void 0;
|
|
349
349
|
var c = !0;
|
|
350
350
|
} catch {
|
|
351
351
|
}
|
|
352
|
-
var u = a.call(
|
|
353
|
-
return c && (
|
|
352
|
+
var u = a.call(i);
|
|
353
|
+
return c && (o ? i[s] = l : delete i[s]), u;
|
|
354
354
|
}
|
|
355
|
-
return P =
|
|
355
|
+
return P = n, P;
|
|
356
356
|
}
|
|
357
357
|
var x, H;
|
|
358
|
-
function
|
|
358
|
+
function ne() {
|
|
359
359
|
if (H) return x;
|
|
360
360
|
H = 1;
|
|
361
361
|
var t = Object.prototype, e = t.toString;
|
|
@@ -368,11 +368,11 @@ var R, Y;
|
|
|
368
368
|
function bt() {
|
|
369
369
|
if (Y) return R;
|
|
370
370
|
Y = 1;
|
|
371
|
-
var t = dt(), e =
|
|
372
|
-
function o
|
|
373
|
-
return
|
|
371
|
+
var t = dt(), e = oe(), r = ne(), a = "[object Null]", s = "[object Undefined]", n = t ? t.toStringTag : void 0;
|
|
372
|
+
function i(o) {
|
|
373
|
+
return o == null ? o === void 0 ? s : a : n && n in Object(o) ? e(o) : r(o);
|
|
374
374
|
}
|
|
375
|
-
return R =
|
|
375
|
+
return R = i, R;
|
|
376
376
|
}
|
|
377
377
|
var I, X;
|
|
378
378
|
function se() {
|
|
@@ -395,8 +395,8 @@ function ae() {
|
|
|
395
395
|
if (tt) return M;
|
|
396
396
|
tt = 1;
|
|
397
397
|
var t = bt(), e = se(), r = $t(), a = "[object String]";
|
|
398
|
-
function s(
|
|
399
|
-
return typeof
|
|
398
|
+
function s(n) {
|
|
399
|
+
return typeof n == "string" || !e(n) && r(n) && t(n) == a;
|
|
400
400
|
}
|
|
401
401
|
return M = s, M;
|
|
402
402
|
}
|
|
@@ -419,49 +419,49 @@ function ce() {
|
|
|
419
419
|
var t = le(), e = t(Object.getPrototypeOf, Object);
|
|
420
420
|
return E = e, E;
|
|
421
421
|
}
|
|
422
|
-
var L,
|
|
422
|
+
var L, it;
|
|
423
423
|
function ue() {
|
|
424
|
-
if (
|
|
425
|
-
|
|
426
|
-
var t = bt(), e = ce(), r = $t(), a = "[object Object]", s = Function.prototype,
|
|
424
|
+
if (it) return L;
|
|
425
|
+
it = 1;
|
|
426
|
+
var t = bt(), e = ce(), r = $t(), a = "[object Object]", s = Function.prototype, n = Object.prototype, i = s.toString, o = n.hasOwnProperty, l = i.call(Object);
|
|
427
427
|
function c(u) {
|
|
428
428
|
if (!r(u) || t(u) != a)
|
|
429
429
|
return !1;
|
|
430
430
|
var f = e(u);
|
|
431
431
|
if (f === null)
|
|
432
432
|
return !0;
|
|
433
|
-
var g =
|
|
434
|
-
return typeof g == "function" && g instanceof g &&
|
|
433
|
+
var g = o.call(f, "constructor") && f.constructor;
|
|
434
|
+
return typeof g == "function" && g instanceof g && i.call(g) == l;
|
|
435
435
|
}
|
|
436
436
|
return L = c, L;
|
|
437
437
|
}
|
|
438
438
|
ue();
|
|
439
|
-
var
|
|
440
|
-
new Array(4).fill(String.fromCodePoint(
|
|
441
|
-
Object.fromEntries(Object.entries(Ct).map((t) => t.reverse()));
|
|
439
|
+
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 };
|
|
440
|
+
new Array(4).fill(String.fromCodePoint(wt[0])).join("");
|
|
442
441
|
Object.fromEntries(Object.entries(wt).map((t) => t.reverse()));
|
|
443
|
-
|
|
444
|
-
|
|
442
|
+
Object.fromEntries(Object.entries(Ct).map((t) => t.reverse()));
|
|
443
|
+
`${Object.values(Ct).map((t) => `\\u{${t.toString(16)}}`).join("")}`;
|
|
444
|
+
var V, ot;
|
|
445
445
|
function fe() {
|
|
446
|
-
if (
|
|
447
|
-
|
|
446
|
+
if (ot) return V;
|
|
447
|
+
ot = 1;
|
|
448
448
|
var t = Object.prototype.hasOwnProperty, e = Object.prototype.toString;
|
|
449
449
|
return V = function(r, a, s) {
|
|
450
450
|
if (e.call(a) !== "[object Function]")
|
|
451
451
|
throw new TypeError("iterator must be a function");
|
|
452
|
-
var
|
|
453
|
-
if (
|
|
454
|
-
for (var
|
|
455
|
-
a.call(s, r[
|
|
452
|
+
var n = r.length;
|
|
453
|
+
if (n === +n)
|
|
454
|
+
for (var i = 0; i < n; i++)
|
|
455
|
+
a.call(s, r[i], i, r);
|
|
456
456
|
else
|
|
457
|
-
for (var
|
|
458
|
-
t.call(r,
|
|
457
|
+
for (var o in r)
|
|
458
|
+
t.call(r, o) && a.call(s, r[o], o, r);
|
|
459
459
|
}, V;
|
|
460
460
|
}
|
|
461
|
-
var N,
|
|
461
|
+
var N, nt;
|
|
462
462
|
function ge() {
|
|
463
|
-
if (
|
|
464
|
-
|
|
463
|
+
if (nt) return N;
|
|
464
|
+
nt = 1;
|
|
465
465
|
var t = fe();
|
|
466
466
|
N = e;
|
|
467
467
|
function e(r, a, s) {
|
|
@@ -469,53 +469,53 @@ function ge() {
|
|
|
469
469
|
return e.set(r, a, s);
|
|
470
470
|
if (arguments.length === 2)
|
|
471
471
|
return e.get(r, a);
|
|
472
|
-
var
|
|
473
|
-
for (var
|
|
474
|
-
e.hasOwnProperty(
|
|
475
|
-
return
|
|
472
|
+
var n = e.bind(e, r);
|
|
473
|
+
for (var i in e)
|
|
474
|
+
e.hasOwnProperty(i) && (n[i] = e[i].bind(n, r));
|
|
475
|
+
return n;
|
|
476
476
|
}
|
|
477
477
|
return e.get = function(r, a) {
|
|
478
|
-
for (var s = Array.isArray(a) ? a : e.parse(a),
|
|
479
|
-
var
|
|
480
|
-
if (!(typeof r == "object" &&
|
|
481
|
-
throw new Error("Invalid reference token: " +
|
|
482
|
-
r = r[
|
|
478
|
+
for (var s = Array.isArray(a) ? a : e.parse(a), n = 0; n < s.length; ++n) {
|
|
479
|
+
var i = s[n];
|
|
480
|
+
if (!(typeof r == "object" && i in r))
|
|
481
|
+
throw new Error("Invalid reference token: " + i);
|
|
482
|
+
r = r[i];
|
|
483
483
|
}
|
|
484
484
|
return r;
|
|
485
485
|
}, e.set = function(r, a, s) {
|
|
486
|
-
var
|
|
487
|
-
if (
|
|
486
|
+
var n = Array.isArray(a) ? a : e.parse(a), i = n[0];
|
|
487
|
+
if (n.length === 0)
|
|
488
488
|
throw Error("Can not set the root object");
|
|
489
|
-
for (var
|
|
490
|
-
var l =
|
|
491
|
-
typeof l != "string" && typeof l != "number" && (l = String(l)), !(l === "__proto__" || l === "constructor" || l === "prototype") && (l === "-" && Array.isArray(r) && (l = r.length),
|
|
489
|
+
for (var o = 0; o < n.length - 1; ++o) {
|
|
490
|
+
var l = n[o];
|
|
491
|
+
typeof l != "string" && typeof l != "number" && (l = String(l)), !(l === "__proto__" || l === "constructor" || l === "prototype") && (l === "-" && Array.isArray(r) && (l = r.length), i = n[o + 1], l in r || (i.match(/^(\d+|-)$/) ? r[l] = [] : r[l] = {}), r = r[l]);
|
|
492
492
|
}
|
|
493
|
-
return
|
|
493
|
+
return i === "-" && Array.isArray(r) && (i = r.length), r[i] = s, this;
|
|
494
494
|
}, e.remove = function(r, a) {
|
|
495
|
-
var s = Array.isArray(a) ? a : e.parse(a),
|
|
496
|
-
if (
|
|
495
|
+
var s = Array.isArray(a) ? a : e.parse(a), n = s[s.length - 1];
|
|
496
|
+
if (n === void 0)
|
|
497
497
|
throw new Error('Invalid JSON pointer for remove: "' + a + '"');
|
|
498
|
-
var
|
|
499
|
-
if (Array.isArray(
|
|
500
|
-
var
|
|
501
|
-
if (
|
|
502
|
-
throw new Error('Invalid array index: "' +
|
|
503
|
-
Array.prototype.splice.call(
|
|
498
|
+
var i = e.get(r, s.slice(0, -1));
|
|
499
|
+
if (Array.isArray(i)) {
|
|
500
|
+
var o = +n;
|
|
501
|
+
if (n === "" && isNaN(o))
|
|
502
|
+
throw new Error('Invalid array index: "' + n + '"');
|
|
503
|
+
Array.prototype.splice.call(i, o, 1);
|
|
504
504
|
} else
|
|
505
|
-
delete
|
|
505
|
+
delete i[n];
|
|
506
506
|
}, e.dict = function(r, a) {
|
|
507
507
|
var s = {};
|
|
508
|
-
return e.walk(r, function(
|
|
509
|
-
s[
|
|
508
|
+
return e.walk(r, function(n, i) {
|
|
509
|
+
s[i] = n;
|
|
510
510
|
}, a), s;
|
|
511
511
|
}, e.walk = function(r, a, s) {
|
|
512
|
-
var
|
|
513
|
-
s = s || function(
|
|
514
|
-
var
|
|
515
|
-
return
|
|
516
|
-
}, (function o
|
|
517
|
-
t(
|
|
518
|
-
|
|
512
|
+
var n = [];
|
|
513
|
+
s = s || function(i) {
|
|
514
|
+
var o = Object.prototype.toString.call(i);
|
|
515
|
+
return o === "[object Object]" || o === "[object Array]";
|
|
516
|
+
}, (function i(o) {
|
|
517
|
+
t(o, function(l, c) {
|
|
518
|
+
n.push(String(c)), s(l) ? i(l) : a(l, e.compile(n)), n.pop();
|
|
519
519
|
});
|
|
520
520
|
})(r);
|
|
521
521
|
}, e.has = function(r, a) {
|
|
@@ -540,26 +540,26 @@ function ge() {
|
|
|
540
540
|
}, N;
|
|
541
541
|
}
|
|
542
542
|
ge();
|
|
543
|
-
var
|
|
543
|
+
var w = { exports: {} }, st;
|
|
544
544
|
function pe() {
|
|
545
545
|
return st || (st = 1, (function(t, e) {
|
|
546
546
|
e = t.exports = r, e.getSerialize = a;
|
|
547
|
-
function r(s, i, o
|
|
548
|
-
return JSON.stringify(s, a(
|
|
547
|
+
function r(s, n, i, o) {
|
|
548
|
+
return JSON.stringify(s, a(n, o), i);
|
|
549
549
|
}
|
|
550
|
-
function a(s,
|
|
551
|
-
var
|
|
552
|
-
return
|
|
553
|
-
return
|
|
550
|
+
function a(s, n) {
|
|
551
|
+
var i = [], o = [];
|
|
552
|
+
return n == null && (n = function(l, c) {
|
|
553
|
+
return i[0] === c ? "[Circular ~]" : "[Circular ~." + o.slice(0, i.indexOf(c)).join(".") + "]";
|
|
554
554
|
}), function(l, c) {
|
|
555
|
-
if (
|
|
556
|
-
var u =
|
|
557
|
-
~u ?
|
|
558
|
-
} else
|
|
555
|
+
if (i.length > 0) {
|
|
556
|
+
var u = i.indexOf(this);
|
|
557
|
+
~u ? i.splice(u + 1) : i.push(this), ~u ? o.splice(u, 1 / 0, l) : o.push(l), ~i.indexOf(c) && (c = n.call(this, l, c));
|
|
558
|
+
} else i.push(c);
|
|
559
559
|
return s == null ? c : s.call(this, l, c);
|
|
560
560
|
};
|
|
561
561
|
}
|
|
562
|
-
})(
|
|
562
|
+
})(w, w.exports)), w.exports;
|
|
563
563
|
}
|
|
564
564
|
pe();
|
|
565
565
|
class y {
|
|
@@ -577,8 +577,8 @@ class y {
|
|
|
577
577
|
};
|
|
578
578
|
}
|
|
579
579
|
static async graphqlQuery(e, r = {}) {
|
|
580
|
-
const { space: a, accessToken: s, environment:
|
|
581
|
-
`https://graphql.contentful.com/content/v1/spaces/${a}/environments/${
|
|
580
|
+
const { space: a, accessToken: s, environment: n = "master" } = this.clientParams, i = await fetch(
|
|
581
|
+
`https://graphql.contentful.com/content/v1/spaces/${a}/environments/${n}`,
|
|
582
582
|
{
|
|
583
583
|
method: "POST",
|
|
584
584
|
headers: {
|
|
@@ -588,19 +588,19 @@ class y {
|
|
|
588
588
|
body: JSON.stringify({ query: e, variables: r })
|
|
589
589
|
}
|
|
590
590
|
);
|
|
591
|
-
if (!
|
|
592
|
-
const l = await
|
|
591
|
+
if (!i.ok) {
|
|
592
|
+
const l = await i.text();
|
|
593
593
|
throw new Error(
|
|
594
|
-
`GraphQL request failed: ${
|
|
594
|
+
`GraphQL request failed: ${i.status} ${i.statusText}
|
|
595
595
|
${l}`
|
|
596
596
|
);
|
|
597
597
|
}
|
|
598
|
-
const
|
|
599
|
-
if (
|
|
598
|
+
const o = await i.json();
|
|
599
|
+
if (o.errors)
|
|
600
600
|
throw new Error(
|
|
601
|
-
`GraphQL errors: ${JSON.stringify(
|
|
601
|
+
`GraphQL errors: ${JSON.stringify(o.errors, null, 2)}`
|
|
602
602
|
);
|
|
603
|
-
return
|
|
603
|
+
return o.data;
|
|
604
604
|
}
|
|
605
605
|
}
|
|
606
606
|
const he = async ({
|
|
@@ -609,20 +609,20 @@ const he = async ({
|
|
|
609
609
|
size: r = 20,
|
|
610
610
|
platform: a,
|
|
611
611
|
marketCode: s,
|
|
612
|
-
locale:
|
|
612
|
+
locale: n
|
|
613
613
|
}) => {
|
|
614
|
-
const
|
|
614
|
+
const i = Math.max(1, Math.floor(e)), o = Math.max(1, Math.floor(r)), l = [
|
|
615
615
|
"$slot: String!",
|
|
616
616
|
"$limit: Int!",
|
|
617
617
|
"$skip: Int!"
|
|
618
618
|
], c = {
|
|
619
619
|
slot: t,
|
|
620
|
-
limit:
|
|
621
|
-
skip: (
|
|
620
|
+
limit: o,
|
|
621
|
+
skip: (i - 1) * o
|
|
622
622
|
}, u = ["{ slot: $slot }"];
|
|
623
623
|
a && (l.push("$platform: String!"), c.platform = a, u.push("{ platform_contains_some: [$platform] }")), s && (l.push("$marketCode: String!"), c.marketCode = s, u.push(
|
|
624
624
|
"{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }"
|
|
625
|
-
)),
|
|
625
|
+
)), n && (l.push("$locale: String!"), c.locale = n, u.push("{ OR: [{ locale_exists: false }, { locale: $locale }] }"));
|
|
626
626
|
const f = `(${l.join(", ")})`, g = `(
|
|
627
627
|
limit: $limit
|
|
628
628
|
skip: $skip
|
|
@@ -673,9 +673,9 @@ query${f} {
|
|
|
673
673
|
...c
|
|
674
674
|
});
|
|
675
675
|
return {
|
|
676
|
-
page:
|
|
676
|
+
page: i,
|
|
677
677
|
total: m.total,
|
|
678
|
-
size:
|
|
678
|
+
size: o,
|
|
679
679
|
items: m.items
|
|
680
680
|
};
|
|
681
681
|
};
|
|
@@ -693,9 +693,9 @@ const me = async ({
|
|
|
693
693
|
collectionId: r,
|
|
694
694
|
categoryId: a,
|
|
695
695
|
page: s = 1,
|
|
696
|
-
size:
|
|
696
|
+
size: n = 20
|
|
697
697
|
} = {}) => {
|
|
698
|
-
const
|
|
698
|
+
const i = Math.max(1, Math.floor(s)), o = Math.max(1, Math.floor(n));
|
|
699
699
|
if (r) {
|
|
700
700
|
const d = `
|
|
701
701
|
query($collectionId: String!, $limit: Int!, $skip: Int!) {
|
|
@@ -712,6 +712,12 @@ query($collectionId: String!, $limit: Int!, $skip: Int!) {
|
|
|
712
712
|
title
|
|
713
713
|
shortDescription
|
|
714
714
|
slug
|
|
715
|
+
categoriesCollection {
|
|
716
|
+
items {
|
|
717
|
+
title
|
|
718
|
+
slug
|
|
719
|
+
}
|
|
720
|
+
}
|
|
715
721
|
featuredImage {
|
|
716
722
|
url
|
|
717
723
|
width
|
|
@@ -725,21 +731,21 @@ query($collectionId: String!, $limit: Int!, $skip: Int!) {
|
|
|
725
731
|
}
|
|
726
732
|
`, { blogCollectionCollection: b } = await y.graphqlQuery(d, {
|
|
727
733
|
collectionId: r,
|
|
728
|
-
limit:
|
|
729
|
-
skip: (
|
|
734
|
+
limit: o,
|
|
735
|
+
skip: (i - 1) * o
|
|
730
736
|
}), k = b.items.at(0);
|
|
731
737
|
if (!k)
|
|
732
738
|
throw new $();
|
|
733
739
|
return {
|
|
734
|
-
page:
|
|
740
|
+
page: i,
|
|
735
741
|
total: k.postsCollection?.total ?? 0,
|
|
736
|
-
size:
|
|
742
|
+
size: o,
|
|
737
743
|
items: k.postsCollection?.items ?? []
|
|
738
744
|
};
|
|
739
745
|
}
|
|
740
746
|
const l = ["$limit: Int!", "$skip: Int!"], c = {
|
|
741
|
-
limit:
|
|
742
|
-
skip: (
|
|
747
|
+
limit: o,
|
|
748
|
+
skip: (i - 1) * o
|
|
743
749
|
}, u = ["limit: $limit", "skip: $skip"], f = [];
|
|
744
750
|
t && (l.push("$marketCode: String!"), c.marketCode = t, f.push(
|
|
745
751
|
"{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }"
|
|
@@ -765,6 +771,12 @@ query${g} {
|
|
|
765
771
|
title
|
|
766
772
|
shortDescription
|
|
767
773
|
slug
|
|
774
|
+
categoriesCollection {
|
|
775
|
+
items {
|
|
776
|
+
title
|
|
777
|
+
slug
|
|
778
|
+
}
|
|
779
|
+
}
|
|
768
780
|
featuredImage {
|
|
769
781
|
url
|
|
770
782
|
width
|
|
@@ -778,9 +790,9 @@ query${g} {
|
|
|
778
790
|
...c
|
|
779
791
|
});
|
|
780
792
|
return {
|
|
781
|
-
page:
|
|
793
|
+
page: i,
|
|
782
794
|
total: p.total,
|
|
783
|
-
size:
|
|
795
|
+
size: o,
|
|
784
796
|
items: p.items
|
|
785
797
|
};
|
|
786
798
|
}, ye = async ({
|
|
@@ -789,26 +801,26 @@ query${g} {
|
|
|
789
801
|
marketCode: r,
|
|
790
802
|
locale: a
|
|
791
803
|
}) => {
|
|
792
|
-
const s = [],
|
|
804
|
+
const s = [], n = {}, i = [];
|
|
793
805
|
if (t)
|
|
794
|
-
s.push("$id: String!"),
|
|
806
|
+
s.push("$id: String!"), n.id = t, i.push("{ sys: { id: $id } }");
|
|
795
807
|
else if (e)
|
|
796
|
-
s.push("$slug: String!"),
|
|
808
|
+
s.push("$slug: String!"), n.slug = e, i.push("{ slug: $slug }");
|
|
797
809
|
else
|
|
798
810
|
throw new Error("Either id or slug is required.");
|
|
799
|
-
r && (s.push("$marketCode: String!"),
|
|
811
|
+
r && (s.push("$marketCode: String!"), n.marketCode = r, i.push(
|
|
800
812
|
"{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }"
|
|
801
|
-
)), a && (s.push("$locale: String!"),
|
|
802
|
-
const
|
|
813
|
+
)), a && (s.push("$locale: String!"), n.locale = a, i.push("{ OR: [{ locale_exists: false }, { locale: $locale }] }"));
|
|
814
|
+
const o = `(${s.join(", ")})`, l = `(
|
|
803
815
|
limit: 1
|
|
804
816
|
where: {
|
|
805
817
|
AND: [
|
|
806
|
-
${
|
|
818
|
+
${i.join(`
|
|
807
819
|
`)}
|
|
808
820
|
]
|
|
809
821
|
}
|
|
810
822
|
)`, c = `
|
|
811
|
-
query${
|
|
823
|
+
query${o} {
|
|
812
824
|
blogPostCollection${l} {
|
|
813
825
|
items {
|
|
814
826
|
sys {
|
|
@@ -868,7 +880,7 @@ query${n} {
|
|
|
868
880
|
}
|
|
869
881
|
}
|
|
870
882
|
`, { blogPostCollection: u } = await y.graphqlQuery(c, {
|
|
871
|
-
...
|
|
883
|
+
...n
|
|
872
884
|
}), f = u.items.at(0);
|
|
873
885
|
if (!f)
|
|
874
886
|
throw new $();
|
|
@@ -879,19 +891,19 @@ query${n} {
|
|
|
879
891
|
page: r = 1,
|
|
880
892
|
size: a = 20
|
|
881
893
|
} = {}) => {
|
|
882
|
-
const s = Math.max(1, Math.floor(r)),
|
|
883
|
-
limit:
|
|
884
|
-
skip: (s - 1) *
|
|
894
|
+
const s = Math.max(1, Math.floor(r)), n = Math.max(1, Math.floor(a)), i = ["$limit: Int!", "$skip: Int!"], o = {
|
|
895
|
+
limit: n,
|
|
896
|
+
skip: (s - 1) * n
|
|
885
897
|
}, l = ["limit: $limit", "skip: $skip"], c = [];
|
|
886
|
-
t && (
|
|
898
|
+
t && (i.push("$marketCode: String!"), o.marketCode = t, c.push(
|
|
887
899
|
"{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }"
|
|
888
|
-
)), e && (
|
|
900
|
+
)), e && (i.push("$locale: String!"), o.locale = e, c.push("{ OR: [{ locale_exists: false }, { locale: $locale }] }")), c.length && l.push(`where: {
|
|
889
901
|
AND: [
|
|
890
902
|
${c.join(`
|
|
891
903
|
`)}
|
|
892
904
|
]
|
|
893
905
|
}`);
|
|
894
|
-
const u =
|
|
906
|
+
const u = i.length ? `(${i.join(", ")})` : "", f = l.length ? `(
|
|
895
907
|
${l.join(`
|
|
896
908
|
`)}
|
|
897
909
|
)` : "", g = `
|
|
@@ -908,12 +920,12 @@ query${u} {
|
|
|
908
920
|
}
|
|
909
921
|
}
|
|
910
922
|
`, { blogCategoryCollection: h } = await y.graphqlQuery(g, {
|
|
911
|
-
...
|
|
923
|
+
...o
|
|
912
924
|
});
|
|
913
925
|
return {
|
|
914
926
|
page: s,
|
|
915
927
|
total: h.total,
|
|
916
|
-
size:
|
|
928
|
+
size: n,
|
|
917
929
|
items: h.items
|
|
918
930
|
};
|
|
919
931
|
}, be = async ({
|
|
@@ -922,26 +934,26 @@ query${u} {
|
|
|
922
934
|
marketCode: r,
|
|
923
935
|
locale: a
|
|
924
936
|
}) => {
|
|
925
|
-
const s = [],
|
|
937
|
+
const s = [], n = {}, i = [];
|
|
926
938
|
if (t)
|
|
927
|
-
s.push("$id: String!"),
|
|
939
|
+
s.push("$id: String!"), n.id = t, i.push("{ sys: { id: $id } }");
|
|
928
940
|
else if (e)
|
|
929
|
-
s.push("$slug: String!"),
|
|
941
|
+
s.push("$slug: String!"), n.slug = e, i.push("{ slug: $slug }");
|
|
930
942
|
else
|
|
931
943
|
throw new Error("Either id or slug is required.");
|
|
932
|
-
r && (s.push("$marketCode: String!"),
|
|
944
|
+
r && (s.push("$marketCode: String!"), n.marketCode = r, i.push(
|
|
933
945
|
"{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }"
|
|
934
|
-
)), a && (s.push("$locale: String!"),
|
|
935
|
-
const
|
|
946
|
+
)), a && (s.push("$locale: String!"), n.locale = a, i.push("{ OR: [{ locale_exists: false }, { locale: $locale }] }"));
|
|
947
|
+
const o = `(${s.join(", ")})`, l = `(
|
|
936
948
|
limit: 1
|
|
937
949
|
where: {
|
|
938
950
|
AND: [
|
|
939
|
-
${
|
|
951
|
+
${i.join(`
|
|
940
952
|
`)}
|
|
941
953
|
]
|
|
942
954
|
}
|
|
943
955
|
)`, c = `
|
|
944
|
-
query${
|
|
956
|
+
query${o} {
|
|
945
957
|
blogCategoryCollection${l} {
|
|
946
958
|
items {
|
|
947
959
|
sys {
|
|
@@ -971,7 +983,7 @@ query${n} {
|
|
|
971
983
|
}
|
|
972
984
|
}
|
|
973
985
|
`, { blogCategoryCollection: u } = await y.graphqlQuery(c, {
|
|
974
|
-
...
|
|
986
|
+
...n
|
|
975
987
|
}), f = u.items.at(0);
|
|
976
988
|
if (!f)
|
|
977
989
|
throw new $();
|
|
@@ -982,19 +994,19 @@ query${n} {
|
|
|
982
994
|
page: r = 1,
|
|
983
995
|
size: a = 20
|
|
984
996
|
} = {}) => {
|
|
985
|
-
const s = Math.max(1, Math.floor(r)),
|
|
986
|
-
limit:
|
|
987
|
-
skip: (s - 1) *
|
|
997
|
+
const s = Math.max(1, Math.floor(r)), n = Math.max(1, Math.floor(a)), i = ["$limit: Int!", "$skip: Int!"], o = {
|
|
998
|
+
limit: n,
|
|
999
|
+
skip: (s - 1) * n
|
|
988
1000
|
}, l = ["limit: $limit", "skip: $skip"], c = [];
|
|
989
|
-
t && (
|
|
1001
|
+
t && (i.push("$marketCode: String!"), o.marketCode = t, c.push(
|
|
990
1002
|
"{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }"
|
|
991
|
-
)), e && (
|
|
1003
|
+
)), e && (i.push("$locale: String!"), o.locale = e, c.push("{ OR: [{ locale_exists: false }, { locale: $locale }] }")), c.length && l.push(`where: {
|
|
992
1004
|
AND: [
|
|
993
1005
|
${c.join(`
|
|
994
1006
|
`)}
|
|
995
1007
|
]
|
|
996
1008
|
}`);
|
|
997
|
-
const u =
|
|
1009
|
+
const u = i.length ? `(${i.join(", ")})` : "", f = l.length ? `(
|
|
998
1010
|
${l.join(`
|
|
999
1011
|
`)}
|
|
1000
1012
|
)` : "", g = `
|
|
@@ -1009,35 +1021,44 @@ query${u} {
|
|
|
1009
1021
|
id
|
|
1010
1022
|
}
|
|
1011
1023
|
category {
|
|
1024
|
+
sys {
|
|
1025
|
+
id
|
|
1026
|
+
}
|
|
1012
1027
|
title
|
|
1013
1028
|
slug
|
|
1014
1029
|
}
|
|
1030
|
+
featuredImage {
|
|
1031
|
+
url
|
|
1032
|
+
width
|
|
1033
|
+
height
|
|
1034
|
+
contentType
|
|
1035
|
+
}
|
|
1015
1036
|
}
|
|
1016
1037
|
}
|
|
1017
1038
|
}
|
|
1018
1039
|
`, { blogCollectionCollection: h } = await y.graphqlQuery(g, {
|
|
1019
|
-
...
|
|
1040
|
+
...o
|
|
1020
1041
|
});
|
|
1021
1042
|
return {
|
|
1022
1043
|
page: s,
|
|
1023
1044
|
total: h.total,
|
|
1024
|
-
size:
|
|
1045
|
+
size: n,
|
|
1025
1046
|
items: h.items
|
|
1026
1047
|
};
|
|
1027
|
-
},
|
|
1048
|
+
}, Ce = async ({
|
|
1028
1049
|
page: t = 1,
|
|
1029
1050
|
size: e = 20,
|
|
1030
1051
|
marketCode: r,
|
|
1031
1052
|
locale: a
|
|
1032
1053
|
} = {}) => {
|
|
1033
|
-
const s = Math.max(1, Math.floor(t)),
|
|
1034
|
-
limit:
|
|
1035
|
-
skip: (s - 1) *
|
|
1054
|
+
const s = Math.max(1, Math.floor(t)), n = Math.max(1, Math.floor(e)), i = ["$limit: Int!", "$skip: Int!"], o = {
|
|
1055
|
+
limit: n,
|
|
1056
|
+
skip: (s - 1) * n
|
|
1036
1057
|
}, l = [];
|
|
1037
|
-
r && (
|
|
1058
|
+
r && (i.push("$marketCode: String!"), o.marketCode = r, l.push(
|
|
1038
1059
|
"{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }"
|
|
1039
|
-
)), a && (
|
|
1040
|
-
const c = `(${
|
|
1060
|
+
)), a && (i.push("$locale: String!"), o.locale = a, l.push("{ OR: [{ locale_exists: false }, { locale: $locale }] }"));
|
|
1061
|
+
const c = `(${i.join(", ")})`, u = l.length ? `(
|
|
1041
1062
|
limit: $limit
|
|
1042
1063
|
skip: $skip
|
|
1043
1064
|
where: {
|
|
@@ -1086,27 +1107,27 @@ query${c} {
|
|
|
1086
1107
|
}
|
|
1087
1108
|
}
|
|
1088
1109
|
`, { brandCollectionCollection: g } = await y.graphqlQuery(f, {
|
|
1089
|
-
...
|
|
1110
|
+
...o
|
|
1090
1111
|
});
|
|
1091
1112
|
return {
|
|
1092
1113
|
page: s,
|
|
1093
1114
|
total: g.total,
|
|
1094
|
-
size:
|
|
1115
|
+
size: n,
|
|
1095
1116
|
items: g.items
|
|
1096
1117
|
};
|
|
1097
|
-
},
|
|
1118
|
+
}, we = async ({
|
|
1098
1119
|
marketCode: t,
|
|
1099
1120
|
locale: e,
|
|
1100
1121
|
page: r = 1,
|
|
1101
1122
|
size: a = 20
|
|
1102
1123
|
} = {}) => {
|
|
1103
|
-
const s = Math.max(1, Math.floor(r)),
|
|
1104
|
-
limit:
|
|
1105
|
-
skip: (s - 1) *
|
|
1124
|
+
const s = Math.max(1, Math.floor(r)), n = Math.max(1, Math.floor(a)), i = ["$limit: Int!", "$skip: Int!"], o = {
|
|
1125
|
+
limit: n,
|
|
1126
|
+
skip: (s - 1) * n
|
|
1106
1127
|
}, l = ["limit: $limit", "skip: $skip"], c = [];
|
|
1107
|
-
t && (
|
|
1128
|
+
t && (i.push("$marketCode: String!"), o.marketCode = t, c.push(
|
|
1108
1129
|
"{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }"
|
|
1109
|
-
)), e && (
|
|
1130
|
+
)), e && (i.push("$locale: String!"), o.locale = e, c.push(
|
|
1110
1131
|
"{ OR: [{ locale_exists: false }, { locale: $locale }] }"
|
|
1111
1132
|
)), c.length && l.push(`where: {
|
|
1112
1133
|
AND: [
|
|
@@ -1114,7 +1135,7 @@ query${c} {
|
|
|
1114
1135
|
`)}
|
|
1115
1136
|
]
|
|
1116
1137
|
}`);
|
|
1117
|
-
const u =
|
|
1138
|
+
const u = i.length ? `(${i.join(", ")})` : "", f = l.length ? `(
|
|
1118
1139
|
${l.join(`
|
|
1119
1140
|
`)}
|
|
1120
1141
|
)` : "", g = `
|
|
@@ -1141,12 +1162,12 @@ query${u} {
|
|
|
1141
1162
|
}
|
|
1142
1163
|
}
|
|
1143
1164
|
`, { documentationCategoryCollection: h } = await y.graphqlQuery(g, {
|
|
1144
|
-
...
|
|
1165
|
+
...o
|
|
1145
1166
|
});
|
|
1146
1167
|
return {
|
|
1147
1168
|
page: s,
|
|
1148
1169
|
total: h.total,
|
|
1149
|
-
size:
|
|
1170
|
+
size: n,
|
|
1150
1171
|
items: h.items
|
|
1151
1172
|
};
|
|
1152
1173
|
}, ve = async ({
|
|
@@ -1155,28 +1176,28 @@ query${u} {
|
|
|
1155
1176
|
marketCode: r,
|
|
1156
1177
|
locale: a
|
|
1157
1178
|
}) => {
|
|
1158
|
-
const s = [],
|
|
1179
|
+
const s = [], n = {}, i = [];
|
|
1159
1180
|
if (t)
|
|
1160
|
-
s.push("$id: String!"),
|
|
1181
|
+
s.push("$id: String!"), n.id = t, i.push("{ sys: { id: $id } }");
|
|
1161
1182
|
else if (e)
|
|
1162
|
-
s.push("$slug: String!"),
|
|
1183
|
+
s.push("$slug: String!"), n.slug = e, i.push("{ slug: $slug }");
|
|
1163
1184
|
else
|
|
1164
1185
|
throw new Error("Either id or slug is required.");
|
|
1165
|
-
r && (s.push("$marketCode: String!"),
|
|
1186
|
+
r && (s.push("$marketCode: String!"), n.marketCode = r, i.push(
|
|
1166
1187
|
"{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }"
|
|
1167
|
-
)), a && (s.push("$locale: String!"),
|
|
1188
|
+
)), a && (s.push("$locale: String!"), n.locale = a, i.push(
|
|
1168
1189
|
"{ OR: [{ locale_exists: false }, { locale: $locale }] }"
|
|
1169
1190
|
));
|
|
1170
|
-
const
|
|
1191
|
+
const o = `(${s.join(", ")})`, l = `(
|
|
1171
1192
|
limit: 1
|
|
1172
1193
|
where: {
|
|
1173
1194
|
AND: [
|
|
1174
|
-
${
|
|
1195
|
+
${i.join(`
|
|
1175
1196
|
`)}
|
|
1176
1197
|
]
|
|
1177
1198
|
}
|
|
1178
1199
|
)`, c = `
|
|
1179
|
-
query${
|
|
1200
|
+
query${o} {
|
|
1180
1201
|
documentationCategoryCollection${l} {
|
|
1181
1202
|
items {
|
|
1182
1203
|
sys {
|
|
@@ -1198,7 +1219,7 @@ query${n} {
|
|
|
1198
1219
|
}
|
|
1199
1220
|
}
|
|
1200
1221
|
`, { documentationCategoryCollection: u } = await y.graphqlQuery(c, {
|
|
1201
|
-
...
|
|
1222
|
+
...n
|
|
1202
1223
|
}), f = u.items.at(0);
|
|
1203
1224
|
if (!f)
|
|
1204
1225
|
throw new $();
|
|
@@ -1210,21 +1231,21 @@ query${n} {
|
|
|
1210
1231
|
page: a = 1,
|
|
1211
1232
|
size: s = 20
|
|
1212
1233
|
} = {}) => {
|
|
1213
|
-
const
|
|
1214
|
-
limit:
|
|
1215
|
-
skip: (
|
|
1234
|
+
const n = Math.max(1, Math.floor(a)), i = Math.max(1, Math.floor(s)), o = ["$limit: Int!", "$skip: Int!"], l = {
|
|
1235
|
+
limit: i,
|
|
1236
|
+
skip: (n - 1) * i
|
|
1216
1237
|
}, c = ["limit: $limit", "skip: $skip"], u = [];
|
|
1217
|
-
t && (
|
|
1238
|
+
t && (o.push("$marketCode: String!"), l.marketCode = t, u.push(
|
|
1218
1239
|
"{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }"
|
|
1219
|
-
)), e && (
|
|
1240
|
+
)), e && (o.push("$locale: String!"), l.locale = e, u.push(
|
|
1220
1241
|
"{ OR: [{ locale_exists: false }, { locale: $locale }] }"
|
|
1221
|
-
)), r && (
|
|
1242
|
+
)), r && (o.push("$categorySlug: String!"), l.categorySlug = r, u.push("{ category: { slug: $categorySlug } }")), u.length && c.push(`where: {
|
|
1222
1243
|
AND: [
|
|
1223
1244
|
${u.join(`
|
|
1224
1245
|
`)}
|
|
1225
1246
|
]
|
|
1226
1247
|
}`);
|
|
1227
|
-
const f =
|
|
1248
|
+
const f = o.length ? `(${o.join(", ")})` : "", g = c.length ? `(
|
|
1228
1249
|
${c.join(`
|
|
1229
1250
|
`)}
|
|
1230
1251
|
)` : "", h = `
|
|
@@ -1261,9 +1282,9 @@ query${f} {
|
|
|
1261
1282
|
...l
|
|
1262
1283
|
});
|
|
1263
1284
|
return {
|
|
1264
|
-
page:
|
|
1285
|
+
page: n,
|
|
1265
1286
|
total: m.total,
|
|
1266
|
-
size:
|
|
1287
|
+
size: i,
|
|
1267
1288
|
items: m.items
|
|
1268
1289
|
};
|
|
1269
1290
|
}, ke = async ({
|
|
@@ -1272,28 +1293,28 @@ query${f} {
|
|
|
1272
1293
|
marketCode: r,
|
|
1273
1294
|
locale: a
|
|
1274
1295
|
}) => {
|
|
1275
|
-
const s = [],
|
|
1296
|
+
const s = [], n = {}, i = [];
|
|
1276
1297
|
if (t)
|
|
1277
|
-
s.push("$id: String!"),
|
|
1298
|
+
s.push("$id: String!"), n.id = t, i.push("{ sys: { id: $id } }");
|
|
1278
1299
|
else if (e)
|
|
1279
|
-
s.push("$slug: String!"),
|
|
1300
|
+
s.push("$slug: String!"), n.slug = e, i.push("{ slug: $slug }");
|
|
1280
1301
|
else
|
|
1281
1302
|
throw new Error("Either id or slug is required.");
|
|
1282
|
-
r && (s.push("$marketCode: String!"),
|
|
1303
|
+
r && (s.push("$marketCode: String!"), n.marketCode = r, i.push(
|
|
1283
1304
|
"{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }"
|
|
1284
|
-
)), a && (s.push("$locale: String!"),
|
|
1305
|
+
)), a && (s.push("$locale: String!"), n.locale = a, i.push(
|
|
1285
1306
|
"{ OR: [{ locale_exists: false }, { locale: $locale }] }"
|
|
1286
1307
|
));
|
|
1287
|
-
const
|
|
1308
|
+
const o = `(${s.join(", ")})`, l = `(
|
|
1288
1309
|
limit: 1
|
|
1289
1310
|
where: {
|
|
1290
1311
|
AND: [
|
|
1291
|
-
${
|
|
1312
|
+
${i.join(`
|
|
1292
1313
|
`)}
|
|
1293
1314
|
]
|
|
1294
1315
|
}
|
|
1295
1316
|
)`, c = `
|
|
1296
|
-
query${
|
|
1317
|
+
query${o} {
|
|
1297
1318
|
documentationArticleCollection${l} {
|
|
1298
1319
|
items {
|
|
1299
1320
|
sys {
|
|
@@ -1346,7 +1367,7 @@ query${n} {
|
|
|
1346
1367
|
}
|
|
1347
1368
|
}
|
|
1348
1369
|
`, { documentationArticleCollection: u } = await y.graphqlQuery(c, {
|
|
1349
|
-
...
|
|
1370
|
+
...n
|
|
1350
1371
|
}), f = u.items.at(0);
|
|
1351
1372
|
if (!f)
|
|
1352
1373
|
throw new $();
|
|
@@ -1357,14 +1378,14 @@ query${n} {
|
|
|
1357
1378
|
marketCode: r,
|
|
1358
1379
|
locale: a
|
|
1359
1380
|
} = {}) => {
|
|
1360
|
-
const s = Math.max(1, Math.floor(t)),
|
|
1361
|
-
limit:
|
|
1362
|
-
skip: (s - 1) *
|
|
1381
|
+
const s = Math.max(1, Math.floor(t)), n = Math.max(1, Math.floor(e)), i = ["$limit: Int!", "$skip: Int!"], o = {
|
|
1382
|
+
limit: n,
|
|
1383
|
+
skip: (s - 1) * n
|
|
1363
1384
|
}, l = [];
|
|
1364
|
-
r && (
|
|
1385
|
+
r && (i.push("$marketCode: String!"), o.marketCode = r, l.push(
|
|
1365
1386
|
"{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }"
|
|
1366
|
-
)), a && (
|
|
1367
|
-
const c =
|
|
1387
|
+
)), a && (i.push("$locale: String!"), o.locale = a, l.push("{ OR: [{ locale_exists: false }, { locale: $locale }] }"));
|
|
1388
|
+
const c = i.length ? `(${i.join(", ")})` : "", u = l.length ? `(
|
|
1368
1389
|
limit: $limit
|
|
1369
1390
|
skip: $skip
|
|
1370
1391
|
order: order_ASC
|
|
@@ -1406,13 +1427,13 @@ query${c} {
|
|
|
1406
1427
|
`, { hyperlinkCollectionCollection: g } = await y.graphqlQuery(
|
|
1407
1428
|
f,
|
|
1408
1429
|
{
|
|
1409
|
-
...
|
|
1430
|
+
...o
|
|
1410
1431
|
}
|
|
1411
1432
|
);
|
|
1412
1433
|
return {
|
|
1413
1434
|
page: s,
|
|
1414
1435
|
total: g.total,
|
|
1415
|
-
size:
|
|
1436
|
+
size: n,
|
|
1416
1437
|
items: g.items
|
|
1417
1438
|
};
|
|
1418
1439
|
}, Oe = async ({
|
|
@@ -1421,14 +1442,14 @@ query${c} {
|
|
|
1421
1442
|
marketCode: r,
|
|
1422
1443
|
locale: a
|
|
1423
1444
|
} = {}) => {
|
|
1424
|
-
const s = Math.max(1, Math.floor(t)),
|
|
1425
|
-
limit:
|
|
1426
|
-
skip: (s - 1) *
|
|
1445
|
+
const s = Math.max(1, Math.floor(t)), n = Math.max(1, Math.floor(e)), i = ["$limit: Int!", "$skip: Int!"], o = {
|
|
1446
|
+
limit: n,
|
|
1447
|
+
skip: (s - 1) * n
|
|
1427
1448
|
}, l = [];
|
|
1428
|
-
r && (
|
|
1449
|
+
r && (i.push("$marketCode: String!"), o.marketCode = r, l.push(
|
|
1429
1450
|
"{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }"
|
|
1430
|
-
)), a && (
|
|
1431
|
-
const c = `(${
|
|
1451
|
+
)), a && (i.push("$locale: String!"), o.locale = a, l.push("{ OR: [{ locale_exists: false }, { locale: $locale }] }"));
|
|
1452
|
+
const c = `(${i.join(", ")})`, u = l.length ? `(
|
|
1432
1453
|
limit: $limit
|
|
1433
1454
|
skip: $skip
|
|
1434
1455
|
where: {
|
|
@@ -1455,12 +1476,12 @@ query${c} {
|
|
|
1455
1476
|
}
|
|
1456
1477
|
}
|
|
1457
1478
|
`, { keywordCollectionCollection: g } = await y.graphqlQuery(f, {
|
|
1458
|
-
...
|
|
1479
|
+
...o
|
|
1459
1480
|
});
|
|
1460
1481
|
return {
|
|
1461
1482
|
page: s,
|
|
1462
1483
|
total: g.total,
|
|
1463
|
-
size:
|
|
1484
|
+
size: n,
|
|
1464
1485
|
items: g.items
|
|
1465
1486
|
};
|
|
1466
1487
|
};
|
|
@@ -1472,10 +1493,10 @@ export {
|
|
|
1472
1493
|
$e as getBlogCollections,
|
|
1473
1494
|
ye as getBlogPostDetail,
|
|
1474
1495
|
me as getBlogPosts,
|
|
1475
|
-
|
|
1496
|
+
Ce as getBrandCollections,
|
|
1476
1497
|
ke as getDocArticleDetail,
|
|
1477
1498
|
Se as getDocArticles,
|
|
1478
|
-
|
|
1499
|
+
we as getDocCategories,
|
|
1479
1500
|
ve as getDocCategoryDetail,
|
|
1480
1501
|
Ae as getHyperlinkCollections,
|
|
1481
1502
|
Oe as getKeywordCollections
|
|
@@ -37,6 +37,7 @@ export type TypeBlogCategory<Modifiers extends ChainModifiers, Locales extends L
|
|
|
37
37
|
export interface TypeBlogCollectionFields {
|
|
38
38
|
name: EntryFieldTypes.Symbol;
|
|
39
39
|
type: EntryFieldTypes.Symbol<"category" | "manual">;
|
|
40
|
+
featuredImage?: EntryFieldTypes.AssetLink;
|
|
40
41
|
posts?: EntryFieldTypes.Array<EntryFieldTypes.EntryLink<TypeBlogPostSkeleton>>;
|
|
41
42
|
category?: EntryFieldTypes.EntryLink<TypeBlogCategorySkeleton>;
|
|
42
43
|
markets?: EntryFieldTypes.Array<EntryFieldTypes.EntryLink<TypeMarketSkeleton>>;
|