@janbox/contentful-marketplace-sdk 1.0.20 → 2.0.0
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/client/index.d.ts +8 -4
- package/dist/entries/blog-category.d.ts +1 -6
- package/dist/entries/blog-post.d.ts +1 -6
- package/dist/entries/documentation.d.ts +1 -6
- package/dist/entries/index.d.ts +1 -0
- package/dist/entries/seo.d.ts +6 -0
- package/dist/index.cjs +70 -70
- package/dist/index.js +377 -948
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,644 +1,73 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
(
|
|
4
|
-
|
|
5
|
-
this._keys = [], this._values = [];
|
|
6
|
-
}
|
|
7
|
-
return t.prototype.has = function(e) {
|
|
8
|
-
return !!~this._keys.indexOf(e);
|
|
9
|
-
}, t.prototype.get = function(e) {
|
|
10
|
-
return this._values[this._keys.indexOf(e)];
|
|
11
|
-
}, t.prototype.set = function(e, r) {
|
|
12
|
-
this._keys.push(e), this._values.push(r);
|
|
13
|
-
}, t;
|
|
14
|
-
})()
|
|
15
|
-
);
|
|
16
|
-
function Tt() {
|
|
17
|
-
return new jt();
|
|
18
|
-
}
|
|
19
|
-
function qt() {
|
|
20
|
-
return /* @__PURE__ */ new WeakMap();
|
|
21
|
-
}
|
|
22
|
-
var _t = typeof WeakMap < "u" ? qt : Tt;
|
|
23
|
-
function Q(t) {
|
|
24
|
-
if (!t)
|
|
25
|
-
return O(null);
|
|
26
|
-
var e = t.constructor;
|
|
27
|
-
if (e === Object)
|
|
28
|
-
return t === Object.prototype ? {} : O(t);
|
|
29
|
-
if (e && ~At.call(e).indexOf("[native code]"))
|
|
30
|
-
try {
|
|
31
|
-
return new e();
|
|
32
|
-
} catch {
|
|
33
|
-
}
|
|
34
|
-
return O(t);
|
|
35
|
-
}
|
|
36
|
-
function Pt(t) {
|
|
37
|
-
var e = "";
|
|
38
|
-
return t.global && (e += "g"), t.ignoreCase && (e += "i"), t.multiline && (e += "m"), t.unicode && (e += "u"), t.sticky && (e += "y"), e;
|
|
39
|
-
}
|
|
40
|
-
function xt(t) {
|
|
41
|
-
return t.flags;
|
|
42
|
-
}
|
|
43
|
-
var It = /test/g.flags === "g" ? xt : Pt;
|
|
44
|
-
function lt(t) {
|
|
45
|
-
var e = Ot.call(t);
|
|
46
|
-
return e.substring(8, e.length - 1);
|
|
47
|
-
}
|
|
48
|
-
function Rt(t) {
|
|
49
|
-
return t[Symbol.toStringTag] || lt(t);
|
|
50
|
-
}
|
|
51
|
-
var Dt = typeof Symbol < "u" ? Rt : lt, Mt = Object.defineProperty, zt = Object.getOwnPropertyDescriptor, ct = Object.getOwnPropertyNames, F = Object.getOwnPropertySymbols, ut = Object.prototype, ft = ut.hasOwnProperty, Et = ut.propertyIsEnumerable, gt = typeof F == "function";
|
|
52
|
-
function Lt(t) {
|
|
53
|
-
return ct(t).concat(F(t));
|
|
54
|
-
}
|
|
55
|
-
var Vt = gt ? Lt : ct;
|
|
56
|
-
function k(t, e, r) {
|
|
57
|
-
for (var a = Vt(t), s = 0, n = a.length, o = void 0, i = void 0; s < n; ++s)
|
|
58
|
-
if (o = a[s], !(o === "callee" || o === "caller")) {
|
|
59
|
-
if (i = zt(t, o), !i) {
|
|
60
|
-
e[o] = r.copier(t[o], r);
|
|
61
|
-
continue;
|
|
62
|
-
}
|
|
63
|
-
!i.get && !i.set && (i.value = r.copier(i.value, r));
|
|
64
|
-
try {
|
|
65
|
-
Mt(e, o, i);
|
|
66
|
-
} catch {
|
|
67
|
-
e[o] = i.value;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return e;
|
|
71
|
-
}
|
|
72
|
-
function Nt(t, e) {
|
|
73
|
-
var r = new e.Constructor();
|
|
74
|
-
e.cache.set(t, r);
|
|
75
|
-
for (var a = 0, s = t.length; a < s; ++a)
|
|
76
|
-
r[a] = e.copier(t[a], e);
|
|
77
|
-
return r;
|
|
78
|
-
}
|
|
79
|
-
function Bt(t, e) {
|
|
80
|
-
var r = new e.Constructor();
|
|
81
|
-
return e.cache.set(t, r), k(t, r, e);
|
|
82
|
-
}
|
|
83
|
-
function ht(t, e) {
|
|
84
|
-
return t.slice(0);
|
|
85
|
-
}
|
|
86
|
-
function Qt(t, e) {
|
|
87
|
-
return t.slice(0, t.size, t.type);
|
|
88
|
-
}
|
|
89
|
-
function Ft(t, e) {
|
|
90
|
-
return new e.Constructor(ht(t.buffer));
|
|
91
|
-
}
|
|
92
|
-
function Gt(t, e) {
|
|
93
|
-
return new e.Constructor(t.getTime());
|
|
94
|
-
}
|
|
95
|
-
function pt(t, e) {
|
|
96
|
-
var r = new e.Constructor();
|
|
97
|
-
return e.cache.set(t, r), t.forEach(function(a, s) {
|
|
98
|
-
r.set(s, e.copier(a, e));
|
|
99
|
-
}), r;
|
|
100
|
-
}
|
|
101
|
-
function Ut(t, e) {
|
|
102
|
-
return k(t, pt(t, e), e);
|
|
103
|
-
}
|
|
104
|
-
function Kt(t, e) {
|
|
105
|
-
var r = Q(e.prototype);
|
|
106
|
-
e.cache.set(t, r);
|
|
107
|
-
for (var a in t)
|
|
108
|
-
ft.call(t, a) && (r[a] = e.copier(t[a], e));
|
|
109
|
-
return r;
|
|
110
|
-
}
|
|
111
|
-
function Wt(t, e) {
|
|
112
|
-
var r = Q(e.prototype);
|
|
113
|
-
e.cache.set(t, r);
|
|
114
|
-
for (var a in t)
|
|
115
|
-
ft.call(t, a) && (r[a] = e.copier(t[a], e));
|
|
116
|
-
for (var s = F(t), n = 0, o = s.length, i = void 0; n < o; ++n)
|
|
117
|
-
i = s[n], Et.call(t, i) && (r[i] = e.copier(t[i], e));
|
|
118
|
-
return r;
|
|
119
|
-
}
|
|
120
|
-
var Jt = gt ? Wt : Kt;
|
|
121
|
-
function Ht(t, e) {
|
|
122
|
-
var r = Q(e.prototype);
|
|
123
|
-
return e.cache.set(t, r), k(t, r, e);
|
|
124
|
-
}
|
|
125
|
-
function j(t, e) {
|
|
126
|
-
return new e.Constructor(t.valueOf());
|
|
127
|
-
}
|
|
128
|
-
function Yt(t, e) {
|
|
129
|
-
var r = new e.Constructor(t.source, It(t));
|
|
130
|
-
return r.lastIndex = t.lastIndex, r;
|
|
131
|
-
}
|
|
132
|
-
function S(t, e) {
|
|
133
|
-
return t;
|
|
134
|
-
}
|
|
135
|
-
function mt(t, e) {
|
|
136
|
-
var r = new e.Constructor();
|
|
137
|
-
return e.cache.set(t, r), t.forEach(function(a) {
|
|
138
|
-
r.add(e.copier(a, e));
|
|
139
|
-
}), r;
|
|
140
|
-
}
|
|
141
|
-
function Xt(t, e) {
|
|
142
|
-
return k(t, mt(t, e), e);
|
|
143
|
-
}
|
|
144
|
-
var Zt = Array.isArray, G = Object.assign, te = Object.getPrototypeOf || (function(t) {
|
|
145
|
-
return t.__proto__;
|
|
146
|
-
}), yt = {
|
|
147
|
-
array: Nt,
|
|
148
|
-
arrayBuffer: ht,
|
|
149
|
-
blob: Qt,
|
|
150
|
-
dataView: Ft,
|
|
151
|
-
date: Gt,
|
|
152
|
-
error: S,
|
|
153
|
-
map: pt,
|
|
154
|
-
object: Jt,
|
|
155
|
-
regExp: Yt,
|
|
156
|
-
set: mt
|
|
157
|
-
}, ee = G({}, yt, {
|
|
158
|
-
array: Bt,
|
|
159
|
-
map: Ut,
|
|
160
|
-
object: Ht,
|
|
161
|
-
set: Xt
|
|
162
|
-
});
|
|
163
|
-
function re(t) {
|
|
164
|
-
return {
|
|
165
|
-
Arguments: t.object,
|
|
166
|
-
Array: t.array,
|
|
167
|
-
ArrayBuffer: t.arrayBuffer,
|
|
168
|
-
Blob: t.blob,
|
|
169
|
-
Boolean: j,
|
|
170
|
-
DataView: t.dataView,
|
|
171
|
-
Date: t.date,
|
|
172
|
-
Error: t.error,
|
|
173
|
-
Float32Array: t.arrayBuffer,
|
|
174
|
-
Float64Array: t.arrayBuffer,
|
|
175
|
-
Int8Array: t.arrayBuffer,
|
|
176
|
-
Int16Array: t.arrayBuffer,
|
|
177
|
-
Int32Array: t.arrayBuffer,
|
|
178
|
-
Map: t.map,
|
|
179
|
-
Number: j,
|
|
180
|
-
Object: t.object,
|
|
181
|
-
Promise: S,
|
|
182
|
-
RegExp: t.regExp,
|
|
183
|
-
Set: t.set,
|
|
184
|
-
String: j,
|
|
185
|
-
WeakMap: S,
|
|
186
|
-
WeakSet: S,
|
|
187
|
-
Uint8Array: t.arrayBuffer,
|
|
188
|
-
Uint8ClampedArray: t.arrayBuffer,
|
|
189
|
-
Uint16Array: t.arrayBuffer,
|
|
190
|
-
Uint32Array: t.arrayBuffer,
|
|
191
|
-
Uint64Array: t.arrayBuffer
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
function dt(t) {
|
|
195
|
-
var e = G({}, yt, t), r = re(e), a = r.Array, s = r.Object;
|
|
196
|
-
function n(o, i) {
|
|
197
|
-
if (i.prototype = i.Constructor = void 0, !o || typeof o != "object")
|
|
198
|
-
return o;
|
|
199
|
-
if (i.cache.has(o))
|
|
200
|
-
return i.cache.get(o);
|
|
201
|
-
if (i.prototype = te(o), i.Constructor = i.prototype && i.prototype.constructor, !i.Constructor || i.Constructor === Object)
|
|
202
|
-
return s(o, i);
|
|
203
|
-
if (Zt(o))
|
|
204
|
-
return a(o, i);
|
|
205
|
-
var l = r[Dt(o)];
|
|
206
|
-
return l ? l(o, i) : typeof o.then == "function" ? o : s(o, i);
|
|
207
|
-
}
|
|
208
|
-
return function(i) {
|
|
209
|
-
return n(i, {
|
|
210
|
-
Constructor: void 0,
|
|
211
|
-
cache: _t(),
|
|
212
|
-
copier: n,
|
|
213
|
-
prototype: void 0
|
|
214
|
-
});
|
|
215
|
-
};
|
|
216
|
-
}
|
|
217
|
-
function oe(t) {
|
|
218
|
-
return dt(G({}, ee, t));
|
|
219
|
-
}
|
|
220
|
-
oe({});
|
|
221
|
-
dt({});
|
|
222
|
-
var C = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, T = { exports: {} }, U;
|
|
223
|
-
function ie() {
|
|
224
|
-
if (U) return T.exports;
|
|
225
|
-
U = 1;
|
|
226
|
-
var t = T.exports = {}, e, r;
|
|
227
|
-
function a() {
|
|
228
|
-
throw new Error("setTimeout has not been defined");
|
|
229
|
-
}
|
|
230
|
-
function s() {
|
|
231
|
-
throw new Error("clearTimeout has not been defined");
|
|
232
|
-
}
|
|
233
|
-
(function() {
|
|
234
|
-
try {
|
|
235
|
-
typeof setTimeout == "function" ? e = setTimeout : e = a;
|
|
236
|
-
} catch {
|
|
237
|
-
e = a;
|
|
238
|
-
}
|
|
239
|
-
try {
|
|
240
|
-
typeof clearTimeout == "function" ? r = clearTimeout : r = s;
|
|
241
|
-
} catch {
|
|
242
|
-
r = s;
|
|
243
|
-
}
|
|
244
|
-
})();
|
|
245
|
-
function n(p) {
|
|
246
|
-
if (e === setTimeout)
|
|
247
|
-
return setTimeout(p, 0);
|
|
248
|
-
if ((e === a || !e) && setTimeout)
|
|
249
|
-
return e = setTimeout, setTimeout(p, 0);
|
|
250
|
-
try {
|
|
251
|
-
return e(p, 0);
|
|
252
|
-
} catch {
|
|
253
|
-
try {
|
|
254
|
-
return e.call(null, p, 0);
|
|
255
|
-
} catch {
|
|
256
|
-
return e.call(this, p, 0);
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
function o(p) {
|
|
261
|
-
if (r === clearTimeout)
|
|
262
|
-
return clearTimeout(p);
|
|
263
|
-
if ((r === s || !r) && clearTimeout)
|
|
264
|
-
return r = clearTimeout, clearTimeout(p);
|
|
265
|
-
try {
|
|
266
|
-
return r(p);
|
|
267
|
-
} catch {
|
|
268
|
-
try {
|
|
269
|
-
return r.call(null, p);
|
|
270
|
-
} catch {
|
|
271
|
-
return r.call(this, p);
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
var i = [], l = !1, c, u = -1;
|
|
276
|
-
function f() {
|
|
277
|
-
!l || !c || (l = !1, c.length ? i = c.concat(i) : u = -1, i.length && g());
|
|
278
|
-
}
|
|
279
|
-
function g() {
|
|
280
|
-
if (!l) {
|
|
281
|
-
var p = n(f);
|
|
282
|
-
l = !0;
|
|
283
|
-
for (var d = i.length; d; ) {
|
|
284
|
-
for (c = i, i = []; ++u < d; )
|
|
285
|
-
c && c[u].run();
|
|
286
|
-
u = -1, d = i.length;
|
|
287
|
-
}
|
|
288
|
-
c = null, l = !1, o(p);
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
t.nextTick = function(p) {
|
|
292
|
-
var d = new Array(arguments.length - 1);
|
|
293
|
-
if (arguments.length > 1)
|
|
294
|
-
for (var $ = 1; $ < arguments.length; $++)
|
|
295
|
-
d[$ - 1] = arguments[$];
|
|
296
|
-
i.push(new m(p, d)), i.length === 1 && !l && n(g);
|
|
297
|
-
};
|
|
298
|
-
function m(p, d) {
|
|
299
|
-
this.fun = p, this.array = d;
|
|
300
|
-
}
|
|
301
|
-
m.prototype.run = function() {
|
|
302
|
-
this.fun.apply(null, this.array);
|
|
303
|
-
}, t.title = "browser", t.browser = !0, t.env = {}, t.argv = [], t.version = "", t.versions = {};
|
|
304
|
-
function h() {
|
|
305
|
-
}
|
|
306
|
-
return t.on = h, t.addListener = h, t.once = h, t.off = h, t.removeListener = h, t.removeAllListeners = h, t.emit = h, t.prependListener = h, t.prependOnceListener = h, t.listeners = function(p) {
|
|
307
|
-
return [];
|
|
308
|
-
}, t.binding = function(p) {
|
|
309
|
-
throw new Error("process.binding is not supported");
|
|
310
|
-
}, t.cwd = function() {
|
|
311
|
-
return "/";
|
|
312
|
-
}, t.chdir = function(p) {
|
|
313
|
-
throw new Error("process.chdir is not supported");
|
|
314
|
-
}, t.umask = function() {
|
|
315
|
-
return 0;
|
|
316
|
-
}, T.exports;
|
|
317
|
-
}
|
|
318
|
-
ie();
|
|
319
|
-
var q, K;
|
|
320
|
-
function ne() {
|
|
321
|
-
if (K) return q;
|
|
322
|
-
K = 1;
|
|
323
|
-
var t = typeof C == "object" && C && C.Object === Object && C;
|
|
324
|
-
return q = t, q;
|
|
325
|
-
}
|
|
326
|
-
var _, W;
|
|
327
|
-
function se() {
|
|
328
|
-
if (W) return _;
|
|
329
|
-
W = 1;
|
|
330
|
-
var t = ne(), e = typeof self == "object" && self && self.Object === Object && self, r = t || e || Function("return this")();
|
|
331
|
-
return _ = r, _;
|
|
332
|
-
}
|
|
333
|
-
var P, J;
|
|
334
|
-
function bt() {
|
|
335
|
-
if (J) return P;
|
|
336
|
-
J = 1;
|
|
337
|
-
var t = se(), e = t.Symbol;
|
|
338
|
-
return P = e, P;
|
|
339
|
-
}
|
|
340
|
-
var x, H;
|
|
341
|
-
function ae() {
|
|
342
|
-
if (H) return x;
|
|
343
|
-
H = 1;
|
|
344
|
-
var t = bt(), e = Object.prototype, r = e.hasOwnProperty, a = e.toString, s = t ? t.toStringTag : void 0;
|
|
345
|
-
function n(o) {
|
|
346
|
-
var i = r.call(o, s), l = o[s];
|
|
347
|
-
try {
|
|
348
|
-
o[s] = void 0;
|
|
349
|
-
var c = !0;
|
|
350
|
-
} catch {
|
|
351
|
-
}
|
|
352
|
-
var u = a.call(o);
|
|
353
|
-
return c && (i ? o[s] = l : delete o[s]), u;
|
|
354
|
-
}
|
|
355
|
-
return x = n, x;
|
|
356
|
-
}
|
|
357
|
-
var I, Y;
|
|
358
|
-
function le() {
|
|
359
|
-
if (Y) return I;
|
|
360
|
-
Y = 1;
|
|
361
|
-
var t = Object.prototype, e = t.toString;
|
|
362
|
-
function r(a) {
|
|
363
|
-
return e.call(a);
|
|
364
|
-
}
|
|
365
|
-
return I = r, I;
|
|
366
|
-
}
|
|
367
|
-
var R, X;
|
|
368
|
-
function $t() {
|
|
369
|
-
if (X) return R;
|
|
370
|
-
X = 1;
|
|
371
|
-
var t = bt(), e = ae(), r = le(), a = "[object Null]", s = "[object Undefined]", n = t ? t.toStringTag : void 0;
|
|
372
|
-
function o(i) {
|
|
373
|
-
return i == null ? i === void 0 ? s : a : n && n in Object(i) ? e(i) : r(i);
|
|
374
|
-
}
|
|
375
|
-
return R = o, R;
|
|
376
|
-
}
|
|
377
|
-
var D, Z;
|
|
378
|
-
function ce() {
|
|
379
|
-
if (Z) return D;
|
|
380
|
-
Z = 1;
|
|
381
|
-
var t = Array.isArray;
|
|
382
|
-
return D = t, D;
|
|
383
|
-
}
|
|
384
|
-
var M, tt;
|
|
385
|
-
function wt() {
|
|
386
|
-
if (tt) return M;
|
|
387
|
-
tt = 1;
|
|
388
|
-
function t(e) {
|
|
389
|
-
return e != null && typeof e == "object";
|
|
390
|
-
}
|
|
391
|
-
return M = t, M;
|
|
392
|
-
}
|
|
393
|
-
var z, et;
|
|
394
|
-
function ue() {
|
|
395
|
-
if (et) return z;
|
|
396
|
-
et = 1;
|
|
397
|
-
var t = $t(), e = ce(), r = wt(), a = "[object String]";
|
|
398
|
-
function s(n) {
|
|
399
|
-
return typeof n == "string" || !e(n) && r(n) && t(n) == a;
|
|
400
|
-
}
|
|
401
|
-
return z = s, z;
|
|
402
|
-
}
|
|
403
|
-
ue();
|
|
404
|
-
var E, rt;
|
|
405
|
-
function fe() {
|
|
406
|
-
if (rt) return E;
|
|
407
|
-
rt = 1;
|
|
408
|
-
function t(e, r) {
|
|
409
|
-
return function(a) {
|
|
410
|
-
return e(r(a));
|
|
411
|
-
};
|
|
412
|
-
}
|
|
413
|
-
return E = t, E;
|
|
414
|
-
}
|
|
415
|
-
var L, ot;
|
|
416
|
-
function ge() {
|
|
417
|
-
if (ot) return L;
|
|
418
|
-
ot = 1;
|
|
419
|
-
var t = fe(), e = t(Object.getPrototypeOf, Object);
|
|
420
|
-
return L = e, L;
|
|
421
|
-
}
|
|
422
|
-
var V, it;
|
|
423
|
-
function he() {
|
|
424
|
-
if (it) return V;
|
|
425
|
-
it = 1;
|
|
426
|
-
var t = $t(), e = ge(), r = wt(), a = "[object Object]", s = Function.prototype, n = Object.prototype, o = s.toString, i = n.hasOwnProperty, l = o.call(Object);
|
|
427
|
-
function c(u) {
|
|
428
|
-
if (!r(u) || t(u) != a)
|
|
429
|
-
return !1;
|
|
430
|
-
var f = e(u);
|
|
431
|
-
if (f === null)
|
|
432
|
-
return !0;
|
|
433
|
-
var g = i.call(f, "constructor") && f.constructor;
|
|
434
|
-
return typeof g == "function" && g instanceof g && o.call(g) == l;
|
|
435
|
-
}
|
|
436
|
-
return V = c, V;
|
|
437
|
-
}
|
|
438
|
-
he();
|
|
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 }, vt = { 0: 8203, 1: 8204, 2: 8205, 3: 65279 };
|
|
440
|
-
new Array(4).fill(String.fromCodePoint(vt[0])).join("");
|
|
441
|
-
Object.fromEntries(Object.entries(vt).map((t) => t.reverse()));
|
|
442
|
-
Object.fromEntries(Object.entries(Ct).map((t) => t.reverse()));
|
|
443
|
-
`${Object.values(Ct).map((t) => `\\u{${t.toString(16)}}`).join("")}`;
|
|
444
|
-
var N, nt;
|
|
445
|
-
function pe() {
|
|
446
|
-
if (nt) return N;
|
|
447
|
-
nt = 1;
|
|
448
|
-
var t = Object.prototype.hasOwnProperty, e = Object.prototype.toString;
|
|
449
|
-
return N = function(r, a, s) {
|
|
450
|
-
if (e.call(a) !== "[object Function]")
|
|
451
|
-
throw new TypeError("iterator must be a function");
|
|
452
|
-
var n = r.length;
|
|
453
|
-
if (n === +n)
|
|
454
|
-
for (var o = 0; o < n; o++)
|
|
455
|
-
a.call(s, r[o], o, r);
|
|
456
|
-
else
|
|
457
|
-
for (var i in r)
|
|
458
|
-
t.call(r, i) && a.call(s, r[i], i, r);
|
|
459
|
-
}, N;
|
|
460
|
-
}
|
|
461
|
-
var B, st;
|
|
462
|
-
function me() {
|
|
463
|
-
if (st) return B;
|
|
464
|
-
st = 1;
|
|
465
|
-
var t = pe();
|
|
466
|
-
B = e;
|
|
467
|
-
function e(r, a, s) {
|
|
468
|
-
if (arguments.length === 3)
|
|
469
|
-
return e.set(r, a, s);
|
|
470
|
-
if (arguments.length === 2)
|
|
471
|
-
return e.get(r, a);
|
|
472
|
-
var n = e.bind(e, r);
|
|
473
|
-
for (var o in e)
|
|
474
|
-
e.hasOwnProperty(o) && (n[o] = e[o].bind(n, r));
|
|
475
|
-
return n;
|
|
476
|
-
}
|
|
477
|
-
return e.get = function(r, a) {
|
|
478
|
-
for (var s = Array.isArray(a) ? a : e.parse(a), n = 0; n < s.length; ++n) {
|
|
479
|
-
var o = s[n];
|
|
480
|
-
if (!(typeof r == "object" && o in r))
|
|
481
|
-
throw new Error("Invalid reference token: " + o);
|
|
482
|
-
r = r[o];
|
|
483
|
-
}
|
|
484
|
-
return r;
|
|
485
|
-
}, e.set = function(r, a, s) {
|
|
486
|
-
var n = Array.isArray(a) ? a : e.parse(a), o = n[0];
|
|
487
|
-
if (n.length === 0)
|
|
488
|
-
throw Error("Can not set the root object");
|
|
489
|
-
for (var i = 0; i < n.length - 1; ++i) {
|
|
490
|
-
var l = n[i];
|
|
491
|
-
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]);
|
|
492
|
-
}
|
|
493
|
-
return o === "-" && Array.isArray(r) && (o = r.length), r[o] = s, this;
|
|
494
|
-
}, e.remove = function(r, a) {
|
|
495
|
-
var s = Array.isArray(a) ? a : e.parse(a), n = s[s.length - 1];
|
|
496
|
-
if (n === void 0)
|
|
497
|
-
throw new Error('Invalid JSON pointer for remove: "' + a + '"');
|
|
498
|
-
var o = e.get(r, s.slice(0, -1));
|
|
499
|
-
if (Array.isArray(o)) {
|
|
500
|
-
var i = +n;
|
|
501
|
-
if (n === "" && isNaN(i))
|
|
502
|
-
throw new Error('Invalid array index: "' + n + '"');
|
|
503
|
-
Array.prototype.splice.call(o, i, 1);
|
|
504
|
-
} else
|
|
505
|
-
delete o[n];
|
|
506
|
-
}, e.dict = function(r, a) {
|
|
507
|
-
var s = {};
|
|
508
|
-
return e.walk(r, function(n, o) {
|
|
509
|
-
s[o] = n;
|
|
510
|
-
}, a), s;
|
|
511
|
-
}, e.walk = function(r, a, s) {
|
|
512
|
-
var n = [];
|
|
513
|
-
s = s || function(o) {
|
|
514
|
-
var i = Object.prototype.toString.call(o);
|
|
515
|
-
return i === "[object Object]" || i === "[object Array]";
|
|
516
|
-
}, (function o(i) {
|
|
517
|
-
t(i, function(l, c) {
|
|
518
|
-
n.push(String(c)), s(l) ? o(l) : a(l, e.compile(n)), n.pop();
|
|
519
|
-
});
|
|
520
|
-
})(r);
|
|
521
|
-
}, e.has = function(r, a) {
|
|
522
|
-
try {
|
|
523
|
-
e.get(r, a);
|
|
524
|
-
} catch {
|
|
525
|
-
return !1;
|
|
526
|
-
}
|
|
527
|
-
return !0;
|
|
528
|
-
}, e.escape = function(r) {
|
|
529
|
-
return r.toString().replace(/~/g, "~0").replace(/\//g, "~1");
|
|
530
|
-
}, e.unescape = function(r) {
|
|
531
|
-
return r.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
532
|
-
}, e.parse = function(r) {
|
|
533
|
-
if (r === "")
|
|
534
|
-
return [];
|
|
535
|
-
if (r.charAt(0) !== "/")
|
|
536
|
-
throw new Error("Invalid JSON pointer: " + r);
|
|
537
|
-
return r.substring(1).split(/\//).map(e.unescape);
|
|
538
|
-
}, e.compile = function(r) {
|
|
539
|
-
return r.length === 0 ? "" : "/" + r.map(e.escape).join("/");
|
|
540
|
-
}, B;
|
|
541
|
-
}
|
|
542
|
-
me();
|
|
543
|
-
var v = { exports: {} }, at;
|
|
544
|
-
function ye() {
|
|
545
|
-
return at || (at = 1, (function(t, e) {
|
|
546
|
-
e = t.exports = r, e.getSerialize = a;
|
|
547
|
-
function r(s, n, o, i) {
|
|
548
|
-
return JSON.stringify(s, a(n, i), o);
|
|
549
|
-
}
|
|
550
|
-
function a(s, n) {
|
|
551
|
-
var o = [], i = [];
|
|
552
|
-
return n == null && (n = function(l, c) {
|
|
553
|
-
return o[0] === c ? "[Circular ~]" : "[Circular ~." + i.slice(0, o.indexOf(c)).join(".") + "]";
|
|
554
|
-
}), function(l, c) {
|
|
555
|
-
if (o.length > 0) {
|
|
556
|
-
var u = o.indexOf(this);
|
|
557
|
-
~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));
|
|
558
|
-
} else o.push(c);
|
|
559
|
-
return s == null ? c : s.call(this, l, c);
|
|
560
|
-
};
|
|
561
|
-
}
|
|
562
|
-
})(v, v.exports)), v.exports;
|
|
563
|
-
}
|
|
564
|
-
ye();
|
|
565
|
-
class y {
|
|
566
|
-
static _clientParams;
|
|
567
|
-
// static getter
|
|
568
|
-
static get clientParams() {
|
|
569
|
-
if (!this._clientParams)
|
|
1
|
+
class d {
|
|
2
|
+
static _config;
|
|
3
|
+
static get config() {
|
|
4
|
+
if (!this._config)
|
|
570
5
|
throw new Error("Client is not configured");
|
|
571
|
-
return this.
|
|
572
|
-
}
|
|
573
|
-
static configure(
|
|
574
|
-
this.
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
},
|
|
588
|
-
body: JSON.stringify({ query: e, variables: r })
|
|
589
|
-
}
|
|
590
|
-
);
|
|
591
|
-
if (!o.ok) {
|
|
592
|
-
const l = await o.text();
|
|
6
|
+
return this._config;
|
|
7
|
+
}
|
|
8
|
+
static configure(l) {
|
|
9
|
+
this._config = l;
|
|
10
|
+
}
|
|
11
|
+
static async graphqlQuery(l, a = {}) {
|
|
12
|
+
const { url: r, method: o = "POST", headers: e = {} } = this.config, t = await fetch(r, {
|
|
13
|
+
method: o,
|
|
14
|
+
headers: {
|
|
15
|
+
"Content-Type": "application/json",
|
|
16
|
+
...e
|
|
17
|
+
},
|
|
18
|
+
body: JSON.stringify({ query: l, variables: a })
|
|
19
|
+
});
|
|
20
|
+
if (!t.ok) {
|
|
21
|
+
const i = await t.text();
|
|
593
22
|
throw new Error(
|
|
594
|
-
`GraphQL request failed: ${
|
|
595
|
-
${
|
|
23
|
+
`GraphQL request failed: ${t.status} ${t.statusText}
|
|
24
|
+
${i}`
|
|
596
25
|
);
|
|
597
26
|
}
|
|
598
|
-
const
|
|
599
|
-
if (
|
|
27
|
+
const s = await t.json();
|
|
28
|
+
if (s.errors)
|
|
600
29
|
throw new Error(
|
|
601
|
-
`GraphQL errors: ${JSON.stringify(
|
|
30
|
+
`GraphQL errors: ${JSON.stringify(s.errors, null, 2)}`
|
|
602
31
|
);
|
|
603
|
-
return
|
|
32
|
+
return s.data;
|
|
604
33
|
}
|
|
605
34
|
}
|
|
606
|
-
class
|
|
35
|
+
class $ {
|
|
607
36
|
page;
|
|
608
37
|
total;
|
|
609
38
|
size;
|
|
610
39
|
items;
|
|
611
40
|
totalPages;
|
|
612
41
|
constructor({
|
|
613
|
-
page:
|
|
614
|
-
total:
|
|
615
|
-
size:
|
|
616
|
-
items:
|
|
42
|
+
page: l,
|
|
43
|
+
total: a,
|
|
44
|
+
size: r,
|
|
45
|
+
items: o
|
|
617
46
|
}) {
|
|
618
|
-
this.page =
|
|
47
|
+
this.page = l, this.total = a, this.size = r, this.items = o, this.totalPages = Math.ceil(this.total / this.size);
|
|
619
48
|
}
|
|
620
49
|
}
|
|
621
|
-
const
|
|
622
|
-
slot:
|
|
623
|
-
page:
|
|
624
|
-
size:
|
|
625
|
-
platform:
|
|
626
|
-
marketCode:
|
|
627
|
-
locale:
|
|
50
|
+
const q = async ({
|
|
51
|
+
slot: c,
|
|
52
|
+
page: l = 1,
|
|
53
|
+
size: a = 20,
|
|
54
|
+
platform: r,
|
|
55
|
+
marketCode: o,
|
|
56
|
+
locale: e
|
|
628
57
|
}) => {
|
|
629
|
-
const
|
|
58
|
+
const t = Math.max(1, Math.floor(l)), s = Math.max(1, Math.floor(a)), i = [
|
|
630
59
|
"$slot: String!",
|
|
631
60
|
"$limit: Int!",
|
|
632
61
|
"$skip: Int!"
|
|
633
|
-
],
|
|
634
|
-
slot:
|
|
635
|
-
limit:
|
|
636
|
-
skip: (
|
|
62
|
+
], n = {
|
|
63
|
+
slot: c,
|
|
64
|
+
limit: s,
|
|
65
|
+
skip: (t - 1) * s
|
|
637
66
|
}, u = ["{ slot: $slot }"];
|
|
638
|
-
|
|
67
|
+
r && (i.push("$platform: String!"), n.platform = r, u.push("{ platform_contains_some: [$platform] }")), o && (i.push("$marketCode: String!"), n.marketCode = o, u.push(
|
|
639
68
|
"{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }"
|
|
640
|
-
)),
|
|
641
|
-
const
|
|
69
|
+
)), e && (i.push("$locale: String!"), n.locale = e, u.push("{ OR: [{ locale_exists: false }, { locale: $locale }] }"));
|
|
70
|
+
const h = `(${i.join(", ")})`, m = `(
|
|
642
71
|
limit: $limit
|
|
643
72
|
skip: $skip
|
|
644
73
|
where: {
|
|
@@ -647,9 +76,9 @@ const de = async ({
|
|
|
647
76
|
`)}
|
|
648
77
|
]
|
|
649
78
|
}
|
|
650
|
-
)`,
|
|
651
|
-
query${
|
|
652
|
-
bannerCollectionCollection${
|
|
79
|
+
)`, g = `
|
|
80
|
+
query${h} {
|
|
81
|
+
bannerCollectionCollection${m} {
|
|
653
82
|
total
|
|
654
83
|
items {
|
|
655
84
|
sys {
|
|
@@ -684,36 +113,36 @@ query${f} {
|
|
|
684
113
|
}
|
|
685
114
|
}
|
|
686
115
|
}
|
|
687
|
-
`, { bannerCollectionCollection:
|
|
688
|
-
...
|
|
116
|
+
`, { bannerCollectionCollection: p } = await d.graphqlQuery(g, {
|
|
117
|
+
...n
|
|
689
118
|
});
|
|
690
|
-
return new
|
|
691
|
-
page:
|
|
692
|
-
total:
|
|
693
|
-
size:
|
|
694
|
-
items:
|
|
119
|
+
return new $({
|
|
120
|
+
page: t,
|
|
121
|
+
total: p.total,
|
|
122
|
+
size: s,
|
|
123
|
+
items: p.items
|
|
695
124
|
});
|
|
696
125
|
};
|
|
697
|
-
class
|
|
698
|
-
constructor(...
|
|
699
|
-
super(
|
|
126
|
+
class y extends Response {
|
|
127
|
+
constructor(...l) {
|
|
128
|
+
super(l[0] ?? "Not Found", {
|
|
700
129
|
status: 404,
|
|
701
|
-
...
|
|
130
|
+
...l[1]
|
|
702
131
|
});
|
|
703
132
|
}
|
|
704
133
|
}
|
|
705
|
-
const
|
|
706
|
-
marketCode:
|
|
707
|
-
locale:
|
|
708
|
-
collectionId:
|
|
709
|
-
categoryId:
|
|
710
|
-
page:
|
|
711
|
-
size:
|
|
712
|
-
skip:
|
|
134
|
+
const S = async ({
|
|
135
|
+
marketCode: c,
|
|
136
|
+
locale: l,
|
|
137
|
+
collectionId: a,
|
|
138
|
+
categoryId: r,
|
|
139
|
+
page: o = 1,
|
|
140
|
+
size: e = 20,
|
|
141
|
+
skip: t = 0
|
|
713
142
|
} = {}) => {
|
|
714
|
-
const
|
|
715
|
-
if (
|
|
716
|
-
const
|
|
143
|
+
const s = Math.max(1, Math.floor(o)), i = Math.max(1, Math.floor(e)), n = Math.max(0, Math.floor(t));
|
|
144
|
+
if (a) {
|
|
145
|
+
const b = `
|
|
717
146
|
query($collectionId: String!, $limit: Int!, $skip: Int!) {
|
|
718
147
|
blogCollectionCollection(limit: 1 where: { sys: { id: $collectionId } }) {
|
|
719
148
|
items {
|
|
@@ -754,38 +183,38 @@ query($collectionId: String!, $limit: Int!, $skip: Int!) {
|
|
|
754
183
|
}
|
|
755
184
|
}
|
|
756
185
|
}
|
|
757
|
-
`, { blogCollectionCollection:
|
|
758
|
-
collectionId:
|
|
759
|
-
limit:
|
|
760
|
-
skip: (
|
|
761
|
-
}),
|
|
762
|
-
if (!
|
|
763
|
-
throw new
|
|
764
|
-
return new
|
|
765
|
-
page:
|
|
766
|
-
total:
|
|
767
|
-
size:
|
|
768
|
-
items:
|
|
186
|
+
`, { blogCollectionCollection: A } = await d.graphqlQuery(b, {
|
|
187
|
+
collectionId: a,
|
|
188
|
+
limit: i,
|
|
189
|
+
skip: (s - 1) * i + n
|
|
190
|
+
}), f = A.items.at(0);
|
|
191
|
+
if (!f)
|
|
192
|
+
throw new y();
|
|
193
|
+
return new $({
|
|
194
|
+
page: s,
|
|
195
|
+
total: f.postsCollection?.total ?? 0,
|
|
196
|
+
size: i,
|
|
197
|
+
items: f.postsCollection?.items ?? []
|
|
769
198
|
});
|
|
770
199
|
}
|
|
771
|
-
const u = ["$limit: Int!", "$skip: Int!"],
|
|
772
|
-
limit:
|
|
773
|
-
skip: (
|
|
774
|
-
},
|
|
775
|
-
|
|
200
|
+
const u = ["$limit: Int!", "$skip: Int!"], h = {
|
|
201
|
+
limit: i,
|
|
202
|
+
skip: (s - 1) * i + n
|
|
203
|
+
}, m = ["limit: $limit", "skip: $skip"], g = [];
|
|
204
|
+
c && (u.push("$marketCode: String!"), h.marketCode = c, g.push(
|
|
776
205
|
"{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }"
|
|
777
|
-
)),
|
|
206
|
+
)), l && (u.push("$locale: String!"), h.locale = l, g.push("{ OR: [{ locale_exists: false }, { locale: $locale }] }")), r && (u.push("$categoryId: String!"), h.categoryId = r, g.push("{ categories: { sys: { id: $categoryId } } }")), g.length && m.push(`where: {
|
|
778
207
|
AND: [
|
|
779
|
-
${
|
|
208
|
+
${g.join(`
|
|
780
209
|
`)}
|
|
781
210
|
]
|
|
782
211
|
}`);
|
|
783
|
-
const
|
|
784
|
-
${
|
|
212
|
+
const p = u.length ? `(${u.join(", ")})` : "", k = m.length ? `(
|
|
213
|
+
${m.join(`
|
|
785
214
|
`)}
|
|
786
|
-
)` : "",
|
|
787
|
-
query${
|
|
788
|
-
blogPostCollection${
|
|
215
|
+
)` : "", w = `
|
|
216
|
+
query${p} {
|
|
217
|
+
blogPostCollection${k} {
|
|
789
218
|
total
|
|
790
219
|
items {
|
|
791
220
|
sys {
|
|
@@ -820,42 +249,42 @@ query${h} {
|
|
|
820
249
|
}
|
|
821
250
|
}
|
|
822
251
|
}
|
|
823
|
-
`, { blogPostCollection:
|
|
824
|
-
...
|
|
252
|
+
`, { blogPostCollection: C } = await d.graphqlQuery(w, {
|
|
253
|
+
...h
|
|
825
254
|
});
|
|
826
|
-
return new
|
|
827
|
-
page:
|
|
828
|
-
total:
|
|
829
|
-
size:
|
|
830
|
-
items:
|
|
255
|
+
return new $({
|
|
256
|
+
page: s,
|
|
257
|
+
total: C.total,
|
|
258
|
+
size: i,
|
|
259
|
+
items: C.items
|
|
831
260
|
});
|
|
832
|
-
},
|
|
833
|
-
id:
|
|
834
|
-
slug:
|
|
835
|
-
marketCode:
|
|
836
|
-
locale:
|
|
261
|
+
}, x = async ({
|
|
262
|
+
id: c,
|
|
263
|
+
slug: l,
|
|
264
|
+
marketCode: a,
|
|
265
|
+
locale: r
|
|
837
266
|
}) => {
|
|
838
|
-
const
|
|
839
|
-
if (
|
|
840
|
-
|
|
841
|
-
else if (
|
|
842
|
-
|
|
267
|
+
const o = [], e = {}, t = [];
|
|
268
|
+
if (c)
|
|
269
|
+
o.push("$id: String!"), e.id = c, t.push("{ sys: { id: $id } }");
|
|
270
|
+
else if (l)
|
|
271
|
+
o.push("$slug: String!"), e.slug = l, t.push("{ slug: $slug }");
|
|
843
272
|
else
|
|
844
273
|
throw new Error("Either id or slug is required.");
|
|
845
|
-
|
|
274
|
+
a && (o.push("$marketCode: String!"), e.marketCode = a, t.push(
|
|
846
275
|
"{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }"
|
|
847
|
-
)),
|
|
848
|
-
const
|
|
276
|
+
)), r && (o.push("$locale: String!"), e.locale = r, t.push("{ OR: [{ locale_exists: false }, { locale: $locale }] }"));
|
|
277
|
+
const s = `(${o.join(", ")})`, i = `(
|
|
849
278
|
limit: 1
|
|
850
279
|
where: {
|
|
851
280
|
AND: [
|
|
852
|
-
${
|
|
281
|
+
${t.join(`
|
|
853
282
|
`)}
|
|
854
283
|
]
|
|
855
284
|
}
|
|
856
|
-
)`,
|
|
857
|
-
query${
|
|
858
|
-
blogPostCollection${
|
|
285
|
+
)`, n = `
|
|
286
|
+
query${s} {
|
|
287
|
+
blogPostCollection${i} {
|
|
859
288
|
items {
|
|
860
289
|
sys {
|
|
861
290
|
id
|
|
@@ -922,36 +351,36 @@ query${i} {
|
|
|
922
351
|
}
|
|
923
352
|
}
|
|
924
353
|
}
|
|
925
|
-
`, { blogPostCollection: u } = await
|
|
926
|
-
...
|
|
927
|
-
}),
|
|
928
|
-
if (!
|
|
929
|
-
throw new
|
|
930
|
-
return
|
|
931
|
-
},
|
|
932
|
-
marketCode:
|
|
933
|
-
locale:
|
|
934
|
-
page:
|
|
935
|
-
size:
|
|
354
|
+
`, { blogPostCollection: u } = await d.graphqlQuery(n, {
|
|
355
|
+
...e
|
|
356
|
+
}), h = u.items.at(0);
|
|
357
|
+
if (!h)
|
|
358
|
+
throw new y();
|
|
359
|
+
return h;
|
|
360
|
+
}, D = async ({
|
|
361
|
+
marketCode: c,
|
|
362
|
+
locale: l,
|
|
363
|
+
page: a = 1,
|
|
364
|
+
size: r = 20
|
|
936
365
|
} = {}) => {
|
|
937
|
-
const
|
|
938
|
-
limit:
|
|
939
|
-
skip: (
|
|
940
|
-
},
|
|
941
|
-
|
|
366
|
+
const o = Math.max(1, Math.floor(a)), e = Math.max(1, Math.floor(r)), t = ["$limit: Int!", "$skip: Int!"], s = {
|
|
367
|
+
limit: e,
|
|
368
|
+
skip: (o - 1) * e
|
|
369
|
+
}, i = ["limit: $limit", "skip: $skip"], n = [];
|
|
370
|
+
c && (t.push("$marketCode: String!"), s.marketCode = c, n.push(
|
|
942
371
|
"{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }"
|
|
943
|
-
)),
|
|
372
|
+
)), l && (t.push("$locale: String!"), s.locale = l, n.push("{ OR: [{ locale_exists: false }, { locale: $locale }] }")), n.length && i.push(`where: {
|
|
944
373
|
AND: [
|
|
945
|
-
${
|
|
374
|
+
${n.join(`
|
|
946
375
|
`)}
|
|
947
376
|
]
|
|
948
377
|
}`);
|
|
949
|
-
const u =
|
|
950
|
-
${
|
|
378
|
+
const u = t.length ? `(${t.join(", ")})` : "", h = i.length ? `(
|
|
379
|
+
${i.join(`
|
|
951
380
|
`)}
|
|
952
|
-
)` : "",
|
|
381
|
+
)` : "", m = `
|
|
953
382
|
query${u} {
|
|
954
|
-
blogCategoryCollection${
|
|
383
|
+
blogCategoryCollection${h} {
|
|
955
384
|
total
|
|
956
385
|
items {
|
|
957
386
|
sys {
|
|
@@ -968,42 +397,42 @@ query${u} {
|
|
|
968
397
|
}
|
|
969
398
|
}
|
|
970
399
|
}
|
|
971
|
-
`, { blogCategoryCollection:
|
|
972
|
-
...
|
|
400
|
+
`, { blogCategoryCollection: g } = await d.graphqlQuery(m, {
|
|
401
|
+
...s
|
|
973
402
|
});
|
|
974
|
-
return new
|
|
975
|
-
page:
|
|
976
|
-
total:
|
|
977
|
-
size:
|
|
978
|
-
items:
|
|
403
|
+
return new $({
|
|
404
|
+
page: o,
|
|
405
|
+
total: g.total,
|
|
406
|
+
size: e,
|
|
407
|
+
items: g.items
|
|
979
408
|
});
|
|
980
|
-
},
|
|
981
|
-
id:
|
|
982
|
-
slug:
|
|
983
|
-
marketCode:
|
|
984
|
-
locale:
|
|
409
|
+
}, z = async ({
|
|
410
|
+
id: c,
|
|
411
|
+
slug: l,
|
|
412
|
+
marketCode: a,
|
|
413
|
+
locale: r
|
|
985
414
|
}) => {
|
|
986
|
-
const
|
|
987
|
-
if (
|
|
988
|
-
|
|
989
|
-
else if (
|
|
990
|
-
|
|
415
|
+
const o = [], e = {}, t = [];
|
|
416
|
+
if (c)
|
|
417
|
+
o.push("$id: String!"), e.id = c, t.push("{ sys: { id: $id } }");
|
|
418
|
+
else if (l)
|
|
419
|
+
o.push("$slug: String!"), e.slug = l, t.push("{ slug: $slug }");
|
|
991
420
|
else
|
|
992
421
|
throw new Error("Either id or slug is required.");
|
|
993
|
-
|
|
422
|
+
a && (o.push("$marketCode: String!"), e.marketCode = a, t.push(
|
|
994
423
|
"{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }"
|
|
995
|
-
)),
|
|
996
|
-
const
|
|
424
|
+
)), r && (o.push("$locale: String!"), e.locale = r, t.push("{ OR: [{ locale_exists: false }, { locale: $locale }] }"));
|
|
425
|
+
const s = `(${o.join(", ")})`, i = `(
|
|
997
426
|
limit: 1
|
|
998
427
|
where: {
|
|
999
428
|
AND: [
|
|
1000
|
-
${
|
|
429
|
+
${t.join(`
|
|
1001
430
|
`)}
|
|
1002
431
|
]
|
|
1003
432
|
}
|
|
1004
|
-
)`,
|
|
1005
|
-
query${
|
|
1006
|
-
blogCategoryCollection${
|
|
433
|
+
)`, n = `
|
|
434
|
+
query${s} {
|
|
435
|
+
blogCategoryCollection${i} {
|
|
1007
436
|
items {
|
|
1008
437
|
sys {
|
|
1009
438
|
id
|
|
@@ -1026,38 +455,38 @@ query${i} {
|
|
|
1026
455
|
}
|
|
1027
456
|
}
|
|
1028
457
|
}
|
|
1029
|
-
`, { blogCategoryCollection: u } = await
|
|
1030
|
-
...
|
|
1031
|
-
}),
|
|
1032
|
-
if (!
|
|
1033
|
-
throw new
|
|
1034
|
-
return
|
|
1035
|
-
},
|
|
1036
|
-
marketCode:
|
|
1037
|
-
locale:
|
|
1038
|
-
page:
|
|
1039
|
-
size:
|
|
458
|
+
`, { blogCategoryCollection: u } = await d.graphqlQuery(n, {
|
|
459
|
+
...e
|
|
460
|
+
}), h = u.items.at(0);
|
|
461
|
+
if (!h)
|
|
462
|
+
throw new y();
|
|
463
|
+
return h;
|
|
464
|
+
}, M = async ({
|
|
465
|
+
marketCode: c,
|
|
466
|
+
locale: l,
|
|
467
|
+
page: a = 1,
|
|
468
|
+
size: r = 20
|
|
1040
469
|
} = {}) => {
|
|
1041
|
-
const
|
|
1042
|
-
limit:
|
|
1043
|
-
skip: (
|
|
1044
|
-
},
|
|
1045
|
-
|
|
470
|
+
const o = Math.max(1, Math.floor(a)), e = Math.max(1, Math.floor(r)), t = ["$limit: Int!", "$skip: Int!"], s = {
|
|
471
|
+
limit: e,
|
|
472
|
+
skip: (o - 1) * e
|
|
473
|
+
}, i = ["limit: $limit", "skip: $skip"], n = [];
|
|
474
|
+
c && (t.push("$marketCode: String!"), s.marketCode = c, n.push(
|
|
1046
475
|
"{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }"
|
|
1047
|
-
)),
|
|
476
|
+
)), l && (t.push("$locale: String!"), s.locale = l, n.push(
|
|
1048
477
|
"{ OR: [{ locale_exists: false }, { locale: $locale }] }"
|
|
1049
|
-
)),
|
|
478
|
+
)), n.length && i.push(`where: {
|
|
1050
479
|
AND: [
|
|
1051
|
-
${
|
|
480
|
+
${n.join(`
|
|
1052
481
|
`)}
|
|
1053
482
|
]
|
|
1054
483
|
}`);
|
|
1055
|
-
const u =
|
|
1056
|
-
${
|
|
484
|
+
const u = t.length ? `(${t.join(", ")})` : "", h = i.length ? `(
|
|
485
|
+
${i.join(`
|
|
1057
486
|
`)}
|
|
1058
|
-
)` : "",
|
|
487
|
+
)` : "", m = `
|
|
1059
488
|
query${u} {
|
|
1060
|
-
blogCollectionCollection${
|
|
489
|
+
blogCollectionCollection${h} {
|
|
1061
490
|
total
|
|
1062
491
|
items {
|
|
1063
492
|
name
|
|
@@ -1082,47 +511,47 @@ query${u} {
|
|
|
1082
511
|
}
|
|
1083
512
|
}
|
|
1084
513
|
}
|
|
1085
|
-
`, { blogCollectionCollection:
|
|
1086
|
-
...
|
|
514
|
+
`, { blogCollectionCollection: g } = await d.graphqlQuery(m, {
|
|
515
|
+
...s
|
|
1087
516
|
});
|
|
1088
|
-
return new
|
|
1089
|
-
page:
|
|
1090
|
-
total:
|
|
1091
|
-
size:
|
|
1092
|
-
items:
|
|
1093
|
-
...
|
|
1094
|
-
category:
|
|
1095
|
-
categoryId:
|
|
1096
|
-
collectionId:
|
|
517
|
+
return new $({
|
|
518
|
+
page: o,
|
|
519
|
+
total: g.total,
|
|
520
|
+
size: e,
|
|
521
|
+
items: g.items.map((p) => ({
|
|
522
|
+
...p,
|
|
523
|
+
category: p.type === "category" ? p.category : null,
|
|
524
|
+
categoryId: p.type === "category" ? p.category?.sys.id ?? null : null,
|
|
525
|
+
collectionId: p.type === "manual" ? p.sys.id : null
|
|
1097
526
|
}))
|
|
1098
527
|
});
|
|
1099
|
-
},
|
|
1100
|
-
page:
|
|
1101
|
-
size:
|
|
1102
|
-
marketCode:
|
|
1103
|
-
locale:
|
|
528
|
+
}, j = async ({
|
|
529
|
+
page: c = 1,
|
|
530
|
+
size: l = 20,
|
|
531
|
+
marketCode: a,
|
|
532
|
+
locale: r
|
|
1104
533
|
} = {}) => {
|
|
1105
|
-
const
|
|
1106
|
-
limit:
|
|
1107
|
-
skip: (
|
|
1108
|
-
},
|
|
1109
|
-
|
|
534
|
+
const o = Math.max(1, Math.floor(c)), e = Math.max(1, Math.floor(l)), t = ["$limit: Int!", "$skip: Int!"], s = {
|
|
535
|
+
limit: e,
|
|
536
|
+
skip: (o - 1) * e
|
|
537
|
+
}, i = [];
|
|
538
|
+
a && (t.push("$marketCode: String!"), s.marketCode = a, i.push(
|
|
1110
539
|
"{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }"
|
|
1111
|
-
)),
|
|
1112
|
-
const
|
|
540
|
+
)), r && (t.push("$locale: String!"), s.locale = r, i.push("{ OR: [{ locale_exists: false }, { locale: $locale }] }"));
|
|
541
|
+
const n = `(${t.join(", ")})`, u = i.length ? `(
|
|
1113
542
|
limit: $limit
|
|
1114
543
|
skip: $skip
|
|
1115
544
|
where: {
|
|
1116
545
|
AND: [
|
|
1117
|
-
${
|
|
546
|
+
${i.join(`
|
|
1118
547
|
`)}
|
|
1119
548
|
]
|
|
1120
549
|
}
|
|
1121
550
|
)` : `(
|
|
1122
551
|
limit: $limit
|
|
1123
552
|
skip: $skip
|
|
1124
|
-
)`,
|
|
1125
|
-
query${
|
|
553
|
+
)`, h = `
|
|
554
|
+
query${n} {
|
|
1126
555
|
brandCollectionCollection${u} {
|
|
1127
556
|
total
|
|
1128
557
|
items {
|
|
@@ -1157,41 +586,41 @@ query${c} {
|
|
|
1157
586
|
}
|
|
1158
587
|
}
|
|
1159
588
|
}
|
|
1160
|
-
`, { brandCollectionCollection:
|
|
1161
|
-
...
|
|
589
|
+
`, { brandCollectionCollection: m } = await d.graphqlQuery(h, {
|
|
590
|
+
...s
|
|
1162
591
|
});
|
|
1163
|
-
return new
|
|
1164
|
-
page:
|
|
1165
|
-
total:
|
|
1166
|
-
size:
|
|
1167
|
-
items:
|
|
592
|
+
return new $({
|
|
593
|
+
page: o,
|
|
594
|
+
total: m.total,
|
|
595
|
+
size: e,
|
|
596
|
+
items: m.items
|
|
1168
597
|
});
|
|
1169
|
-
},
|
|
1170
|
-
marketCode:
|
|
1171
|
-
locale:
|
|
1172
|
-
page:
|
|
1173
|
-
size:
|
|
598
|
+
}, I = async ({
|
|
599
|
+
marketCode: c,
|
|
600
|
+
locale: l,
|
|
601
|
+
page: a = 1,
|
|
602
|
+
size: r = 20
|
|
1174
603
|
} = {}) => {
|
|
1175
|
-
const
|
|
1176
|
-
limit:
|
|
1177
|
-
skip: (
|
|
1178
|
-
},
|
|
1179
|
-
|
|
604
|
+
const o = Math.max(1, Math.floor(a)), e = Math.max(1, Math.floor(r)), t = ["$limit: Int!", "$skip: Int!"], s = {
|
|
605
|
+
limit: e,
|
|
606
|
+
skip: (o - 1) * e
|
|
607
|
+
}, i = ["limit: $limit", "skip: $skip"], n = [];
|
|
608
|
+
c && (t.push("$marketCode: String!"), s.marketCode = c, n.push(
|
|
1180
609
|
"{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }"
|
|
1181
|
-
)),
|
|
610
|
+
)), l && (t.push("$locale: String!"), s.locale = l, n.push(
|
|
1182
611
|
"{ OR: [{ locale_exists: false }, { locale: $locale }] }"
|
|
1183
|
-
)),
|
|
612
|
+
)), n.length && i.push(`where: {
|
|
1184
613
|
AND: [
|
|
1185
|
-
${
|
|
614
|
+
${n.join(`
|
|
1186
615
|
`)}
|
|
1187
616
|
]
|
|
1188
617
|
}`);
|
|
1189
|
-
const u =
|
|
1190
|
-
${
|
|
618
|
+
const u = t.length ? `(${t.join(", ")})` : "", h = i.length ? `(
|
|
619
|
+
${i.join(`
|
|
1191
620
|
`)}
|
|
1192
|
-
)` : "",
|
|
621
|
+
)` : "", m = `
|
|
1193
622
|
query${u} {
|
|
1194
|
-
documentationCategoryCollection${
|
|
623
|
+
documentationCategoryCollection${h} {
|
|
1195
624
|
total
|
|
1196
625
|
items {
|
|
1197
626
|
sys {
|
|
@@ -1212,44 +641,44 @@ query${u} {
|
|
|
1212
641
|
}
|
|
1213
642
|
}
|
|
1214
643
|
}
|
|
1215
|
-
`, { documentationCategoryCollection:
|
|
1216
|
-
...
|
|
644
|
+
`, { documentationCategoryCollection: g } = await d.graphqlQuery(m, {
|
|
645
|
+
...s
|
|
1217
646
|
});
|
|
1218
|
-
return new
|
|
1219
|
-
page:
|
|
1220
|
-
total:
|
|
1221
|
-
size:
|
|
1222
|
-
items:
|
|
647
|
+
return new $({
|
|
648
|
+
page: o,
|
|
649
|
+
total: g.total,
|
|
650
|
+
size: e,
|
|
651
|
+
items: g.items
|
|
1223
652
|
});
|
|
1224
|
-
},
|
|
1225
|
-
id:
|
|
1226
|
-
slug:
|
|
1227
|
-
marketCode:
|
|
1228
|
-
locale:
|
|
653
|
+
}, R = async ({
|
|
654
|
+
id: c,
|
|
655
|
+
slug: l,
|
|
656
|
+
marketCode: a,
|
|
657
|
+
locale: r
|
|
1229
658
|
}) => {
|
|
1230
|
-
const
|
|
1231
|
-
if (
|
|
1232
|
-
|
|
1233
|
-
else if (
|
|
1234
|
-
|
|
659
|
+
const o = [], e = {}, t = [];
|
|
660
|
+
if (c)
|
|
661
|
+
o.push("$id: String!"), e.id = c, t.push("{ sys: { id: $id } }");
|
|
662
|
+
else if (l)
|
|
663
|
+
o.push("$slug: String!"), e.slug = l, t.push("{ slug: $slug }");
|
|
1235
664
|
else
|
|
1236
665
|
throw new Error("Either id or slug is required.");
|
|
1237
|
-
|
|
666
|
+
a && (o.push("$marketCode: String!"), e.marketCode = a, t.push(
|
|
1238
667
|
"{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }"
|
|
1239
|
-
)),
|
|
668
|
+
)), r && (o.push("$locale: String!"), e.locale = r, t.push(
|
|
1240
669
|
"{ OR: [{ locale_exists: false }, { locale: $locale }] }"
|
|
1241
670
|
));
|
|
1242
|
-
const
|
|
671
|
+
const s = `(${o.join(", ")})`, i = `(
|
|
1243
672
|
limit: 1
|
|
1244
673
|
where: {
|
|
1245
674
|
AND: [
|
|
1246
|
-
${
|
|
675
|
+
${t.join(`
|
|
1247
676
|
`)}
|
|
1248
677
|
]
|
|
1249
678
|
}
|
|
1250
|
-
)`,
|
|
1251
|
-
query${
|
|
1252
|
-
documentationCategoryCollection${
|
|
679
|
+
)`, n = `
|
|
680
|
+
query${s} {
|
|
681
|
+
documentationCategoryCollection${i} {
|
|
1253
682
|
items {
|
|
1254
683
|
sys {
|
|
1255
684
|
id
|
|
@@ -1269,39 +698,39 @@ query${i} {
|
|
|
1269
698
|
}
|
|
1270
699
|
}
|
|
1271
700
|
}
|
|
1272
|
-
`, { documentationCategoryCollection: u } = await
|
|
1273
|
-
...
|
|
1274
|
-
}),
|
|
1275
|
-
if (!
|
|
1276
|
-
throw new
|
|
1277
|
-
return
|
|
1278
|
-
},
|
|
1279
|
-
marketCode:
|
|
1280
|
-
locale:
|
|
1281
|
-
categorySlug:
|
|
1282
|
-
page:
|
|
1283
|
-
size:
|
|
701
|
+
`, { documentationCategoryCollection: u } = await d.graphqlQuery(n, {
|
|
702
|
+
...e
|
|
703
|
+
}), h = u.items.at(0);
|
|
704
|
+
if (!h)
|
|
705
|
+
throw new y();
|
|
706
|
+
return h;
|
|
707
|
+
}, _ = async ({
|
|
708
|
+
marketCode: c,
|
|
709
|
+
locale: l,
|
|
710
|
+
categorySlug: a,
|
|
711
|
+
page: r = 1,
|
|
712
|
+
size: o = 20
|
|
1284
713
|
} = {}) => {
|
|
1285
|
-
const
|
|
1286
|
-
limit:
|
|
1287
|
-
skip: (
|
|
1288
|
-
},
|
|
1289
|
-
|
|
714
|
+
const e = Math.max(1, Math.floor(r)), t = Math.max(1, Math.floor(o)), s = ["$limit: Int!", "$skip: Int!"], i = {
|
|
715
|
+
limit: t,
|
|
716
|
+
skip: (e - 1) * t
|
|
717
|
+
}, n = ["limit: $limit", "skip: $skip"], u = [];
|
|
718
|
+
c && (s.push("$marketCode: String!"), i.marketCode = c, u.push(
|
|
1290
719
|
"{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }"
|
|
1291
|
-
)),
|
|
720
|
+
)), l && (s.push("$locale: String!"), i.locale = l, u.push(
|
|
1292
721
|
"{ OR: [{ locale_exists: false }, { locale: $locale }] }"
|
|
1293
|
-
)),
|
|
722
|
+
)), a && (s.push("$categorySlug: String!"), i.categorySlug = a, u.push("{ category: { slug: $categorySlug } }")), u.length && n.push(`where: {
|
|
1294
723
|
AND: [
|
|
1295
724
|
${u.join(`
|
|
1296
725
|
`)}
|
|
1297
726
|
]
|
|
1298
727
|
}`);
|
|
1299
|
-
const
|
|
1300
|
-
${
|
|
728
|
+
const h = s.length ? `(${s.join(", ")})` : "", m = n.length ? `(
|
|
729
|
+
${n.join(`
|
|
1301
730
|
`)}
|
|
1302
|
-
)` : "",
|
|
1303
|
-
query${
|
|
1304
|
-
documentationArticleCollection${
|
|
731
|
+
)` : "", g = `
|
|
732
|
+
query${h} {
|
|
733
|
+
documentationArticleCollection${m} {
|
|
1305
734
|
total
|
|
1306
735
|
items {
|
|
1307
736
|
sys {
|
|
@@ -1329,44 +758,44 @@ query${f} {
|
|
|
1329
758
|
}
|
|
1330
759
|
}
|
|
1331
760
|
}
|
|
1332
|
-
`, { documentationArticleCollection:
|
|
1333
|
-
...
|
|
761
|
+
`, { documentationArticleCollection: p } = await d.graphqlQuery(g, {
|
|
762
|
+
...i
|
|
1334
763
|
});
|
|
1335
|
-
return new
|
|
1336
|
-
page:
|
|
1337
|
-
total:
|
|
1338
|
-
size:
|
|
1339
|
-
items:
|
|
764
|
+
return new $({
|
|
765
|
+
page: e,
|
|
766
|
+
total: p.total,
|
|
767
|
+
size: t,
|
|
768
|
+
items: p.items
|
|
1340
769
|
});
|
|
1341
|
-
},
|
|
1342
|
-
id:
|
|
1343
|
-
slug:
|
|
1344
|
-
marketCode:
|
|
1345
|
-
locale:
|
|
770
|
+
}, O = async ({
|
|
771
|
+
id: c,
|
|
772
|
+
slug: l,
|
|
773
|
+
marketCode: a,
|
|
774
|
+
locale: r
|
|
1346
775
|
}) => {
|
|
1347
|
-
const
|
|
1348
|
-
if (
|
|
1349
|
-
|
|
1350
|
-
else if (
|
|
1351
|
-
|
|
776
|
+
const o = [], e = {}, t = [];
|
|
777
|
+
if (c)
|
|
778
|
+
o.push("$id: String!"), e.id = c, t.push("{ sys: { id: $id } }");
|
|
779
|
+
else if (l)
|
|
780
|
+
o.push("$slug: String!"), e.slug = l, t.push("{ slug: $slug }");
|
|
1352
781
|
else
|
|
1353
782
|
throw new Error("Either id or slug is required.");
|
|
1354
|
-
|
|
783
|
+
a && (o.push("$marketCode: String!"), e.marketCode = a, t.push(
|
|
1355
784
|
"{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }"
|
|
1356
|
-
)),
|
|
785
|
+
)), r && (o.push("$locale: String!"), e.locale = r, t.push(
|
|
1357
786
|
"{ OR: [{ locale_exists: false }, { locale: $locale }] }"
|
|
1358
787
|
));
|
|
1359
|
-
const
|
|
788
|
+
const s = `(${o.join(", ")})`, i = `(
|
|
1360
789
|
limit: 1
|
|
1361
790
|
where: {
|
|
1362
791
|
AND: [
|
|
1363
|
-
${
|
|
792
|
+
${t.join(`
|
|
1364
793
|
`)}
|
|
1365
794
|
]
|
|
1366
795
|
}
|
|
1367
|
-
)`,
|
|
1368
|
-
query${
|
|
1369
|
-
documentationArticleCollection${
|
|
796
|
+
)`, n = `
|
|
797
|
+
query${s} {
|
|
798
|
+
documentationArticleCollection${i} {
|
|
1370
799
|
items {
|
|
1371
800
|
sys {
|
|
1372
801
|
id
|
|
@@ -1417,32 +846,32 @@ query${i} {
|
|
|
1417
846
|
}
|
|
1418
847
|
}
|
|
1419
848
|
}
|
|
1420
|
-
`, { documentationArticleCollection: u } = await
|
|
1421
|
-
...
|
|
1422
|
-
}),
|
|
1423
|
-
if (!
|
|
1424
|
-
throw new
|
|
1425
|
-
return
|
|
1426
|
-
},
|
|
1427
|
-
page:
|
|
1428
|
-
size:
|
|
1429
|
-
marketCode:
|
|
1430
|
-
locale:
|
|
849
|
+
`, { documentationArticleCollection: u } = await d.graphqlQuery(n, {
|
|
850
|
+
...e
|
|
851
|
+
}), h = u.items.at(0);
|
|
852
|
+
if (!h)
|
|
853
|
+
throw new y();
|
|
854
|
+
return h;
|
|
855
|
+
}, P = async ({
|
|
856
|
+
page: c = 1,
|
|
857
|
+
size: l = 20,
|
|
858
|
+
marketCode: a,
|
|
859
|
+
locale: r
|
|
1431
860
|
} = {}) => {
|
|
1432
|
-
const
|
|
1433
|
-
limit:
|
|
1434
|
-
skip: (
|
|
1435
|
-
},
|
|
1436
|
-
|
|
861
|
+
const o = Math.max(1, Math.floor(c)), e = Math.max(1, Math.floor(l)), t = ["$limit: Int!", "$skip: Int!"], s = {
|
|
862
|
+
limit: e,
|
|
863
|
+
skip: (o - 1) * e
|
|
864
|
+
}, i = [];
|
|
865
|
+
a && (t.push("$marketCode: String!"), s.marketCode = a, i.push(
|
|
1437
866
|
"{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }"
|
|
1438
|
-
)),
|
|
1439
|
-
const
|
|
867
|
+
)), r && (t.push("$locale: String!"), s.locale = r, i.push("{ OR: [{ locale_exists: false }, { locale: $locale }] }"));
|
|
868
|
+
const n = t.length ? `(${t.join(", ")})` : "", u = i.length ? `(
|
|
1440
869
|
limit: $limit
|
|
1441
870
|
skip: $skip
|
|
1442
871
|
order: order_ASC
|
|
1443
872
|
where: {
|
|
1444
873
|
AND: [
|
|
1445
|
-
${
|
|
874
|
+
${i.join(`
|
|
1446
875
|
`)}
|
|
1447
876
|
]
|
|
1448
877
|
}
|
|
@@ -1450,8 +879,8 @@ query${i} {
|
|
|
1450
879
|
limit: $limit
|
|
1451
880
|
skip: $skip
|
|
1452
881
|
order: order_ASC
|
|
1453
|
-
)`,
|
|
1454
|
-
query${
|
|
882
|
+
)`, h = `
|
|
883
|
+
query${n} {
|
|
1455
884
|
hyperlinkCollectionCollection${u} {
|
|
1456
885
|
total
|
|
1457
886
|
items {
|
|
@@ -1475,45 +904,45 @@ query${c} {
|
|
|
1475
904
|
}
|
|
1476
905
|
}
|
|
1477
906
|
}
|
|
1478
|
-
`, { hyperlinkCollectionCollection:
|
|
1479
|
-
|
|
907
|
+
`, { hyperlinkCollectionCollection: m } = await d.graphqlQuery(
|
|
908
|
+
h,
|
|
1480
909
|
{
|
|
1481
|
-
...
|
|
910
|
+
...s
|
|
1482
911
|
}
|
|
1483
912
|
);
|
|
1484
|
-
return new
|
|
1485
|
-
page:
|
|
1486
|
-
total:
|
|
1487
|
-
size:
|
|
1488
|
-
items:
|
|
913
|
+
return new $({
|
|
914
|
+
page: o,
|
|
915
|
+
total: m.total,
|
|
916
|
+
size: e,
|
|
917
|
+
items: m.items
|
|
1489
918
|
});
|
|
1490
|
-
},
|
|
1491
|
-
page:
|
|
1492
|
-
size:
|
|
1493
|
-
marketCode:
|
|
1494
|
-
locale:
|
|
919
|
+
}, V = async ({
|
|
920
|
+
page: c = 1,
|
|
921
|
+
size: l = 20,
|
|
922
|
+
marketCode: a,
|
|
923
|
+
locale: r
|
|
1495
924
|
} = {}) => {
|
|
1496
|
-
const
|
|
1497
|
-
limit:
|
|
1498
|
-
skip: (
|
|
1499
|
-
},
|
|
1500
|
-
|
|
925
|
+
const o = Math.max(1, Math.floor(c)), e = Math.max(1, Math.floor(l)), t = ["$limit: Int!", "$skip: Int!"], s = {
|
|
926
|
+
limit: e,
|
|
927
|
+
skip: (o - 1) * e
|
|
928
|
+
}, i = [];
|
|
929
|
+
a && (t.push("$marketCode: String!"), s.marketCode = a, i.push(
|
|
1501
930
|
"{ OR: [{ marketsCollection_exists: false }, { markets: { code: $marketCode } }] }"
|
|
1502
|
-
)),
|
|
1503
|
-
const
|
|
931
|
+
)), r && (t.push("$locale: String!"), s.locale = r, i.push("{ OR: [{ locale_exists: false }, { locale: $locale }] }"));
|
|
932
|
+
const n = `(${t.join(", ")})`, u = i.length ? `(
|
|
1504
933
|
limit: $limit
|
|
1505
934
|
skip: $skip
|
|
1506
935
|
where: {
|
|
1507
936
|
AND: [
|
|
1508
|
-
${
|
|
937
|
+
${i.join(`
|
|
1509
938
|
`)}
|
|
1510
939
|
]
|
|
1511
940
|
}
|
|
1512
941
|
)` : `(
|
|
1513
942
|
limit: $limit
|
|
1514
943
|
skip: $skip
|
|
1515
|
-
)`,
|
|
1516
|
-
query${
|
|
944
|
+
)`, h = `
|
|
945
|
+
query${n} {
|
|
1517
946
|
keywordCollectionCollection${u} {
|
|
1518
947
|
total
|
|
1519
948
|
items {
|
|
@@ -1526,30 +955,30 @@ query${c} {
|
|
|
1526
955
|
}
|
|
1527
956
|
}
|
|
1528
957
|
}
|
|
1529
|
-
`, { keywordCollectionCollection:
|
|
1530
|
-
...
|
|
958
|
+
`, { keywordCollectionCollection: m } = await d.graphqlQuery(h, {
|
|
959
|
+
...s
|
|
1531
960
|
});
|
|
1532
|
-
return new
|
|
1533
|
-
page:
|
|
1534
|
-
total:
|
|
1535
|
-
size:
|
|
1536
|
-
items:
|
|
961
|
+
return new $({
|
|
962
|
+
page: o,
|
|
963
|
+
total: m.total,
|
|
964
|
+
size: e,
|
|
965
|
+
items: m.items
|
|
1537
966
|
});
|
|
1538
967
|
};
|
|
1539
968
|
export {
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
969
|
+
d as ContentfulSDK,
|
|
970
|
+
$ as PaginatedResponse,
|
|
971
|
+
q as getBannerCollections,
|
|
972
|
+
D as getBlogCategories,
|
|
973
|
+
z as getBlogCategoryDetail,
|
|
974
|
+
M as getBlogCollections,
|
|
975
|
+
x as getBlogPostDetail,
|
|
976
|
+
S as getBlogPosts,
|
|
977
|
+
j as getBrandCollections,
|
|
978
|
+
O as getDocArticleDetail,
|
|
979
|
+
_ as getDocArticles,
|
|
980
|
+
I as getDocCategories,
|
|
981
|
+
R as getDocCategoryDetail,
|
|
982
|
+
P as getHyperlinkCollections,
|
|
983
|
+
V as getKeywordCollections
|
|
1555
984
|
};
|