@janbox/contentful-marketplace-sdk 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -10
- package/dist/entries/banner-collection.d.ts +7 -3
- package/dist/entries/blog.d.ts +8 -7
- package/dist/entries/brand-collection.d.ts +7 -3
- package/dist/entries/documentation.d.ts +16 -14
- package/dist/entries/hyperlink-collection.d.ts +7 -2
- package/dist/entries/keyword-collection.d.ts +7 -3
- package/dist/index.cjs +69 -52
- package/dist/index.js +442 -386
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var we = Function.prototype.toString, C = Object.create, Se = Object.prototype.toString, Ce = (
|
|
2
2
|
/** @class */
|
|
3
3
|
(function() {
|
|
4
4
|
function e() {
|
|
@@ -13,83 +13,83 @@ var $e = Function.prototype.toString, C = Object.create, Ce = Object.prototype.t
|
|
|
13
13
|
}, e;
|
|
14
14
|
})()
|
|
15
15
|
);
|
|
16
|
-
function
|
|
17
|
-
return new
|
|
16
|
+
function Oe() {
|
|
17
|
+
return new Ce();
|
|
18
18
|
}
|
|
19
19
|
function je() {
|
|
20
20
|
return /* @__PURE__ */ new WeakMap();
|
|
21
21
|
}
|
|
22
|
-
var
|
|
23
|
-
function
|
|
22
|
+
var ke = typeof WeakMap < "u" ? je : Oe;
|
|
23
|
+
function N(e) {
|
|
24
24
|
if (!e)
|
|
25
25
|
return C(null);
|
|
26
26
|
var t = e.constructor;
|
|
27
27
|
if (t === Object)
|
|
28
28
|
return e === Object.prototype ? {} : C(e);
|
|
29
|
-
if (t &&
|
|
29
|
+
if (t && ~we.call(t).indexOf("[native code]"))
|
|
30
30
|
try {
|
|
31
31
|
return new t();
|
|
32
32
|
} catch {
|
|
33
33
|
}
|
|
34
34
|
return C(e);
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function Ae(e) {
|
|
37
37
|
var t = "";
|
|
38
38
|
return e.global && (t += "g"), e.ignoreCase && (t += "i"), e.multiline && (t += "m"), e.unicode && (t += "u"), e.sticky && (t += "y"), t;
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function Te(e) {
|
|
41
41
|
return e.flags;
|
|
42
42
|
}
|
|
43
|
-
var
|
|
43
|
+
var _e = /test/g.flags === "g" ? Te : Ae;
|
|
44
44
|
function ae(e) {
|
|
45
|
-
var t =
|
|
45
|
+
var t = Se.call(e);
|
|
46
46
|
return t.substring(8, t.length - 1);
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function qe(e) {
|
|
49
49
|
return e[Symbol.toStringTag] || ae(e);
|
|
50
50
|
}
|
|
51
|
-
var Pe = typeof Symbol < "u" ?
|
|
51
|
+
var Pe = typeof Symbol < "u" ? qe : ae, xe = Object.defineProperty, Re = Object.getOwnPropertyDescriptor, se = Object.getOwnPropertyNames, B = Object.getOwnPropertySymbols, ce = Object.prototype, le = ce.hasOwnProperty, De = ce.propertyIsEnumerable, ue = typeof B == "function";
|
|
52
52
|
function Ie(e) {
|
|
53
|
-
return se(e).concat(
|
|
53
|
+
return se(e).concat(B(e));
|
|
54
54
|
}
|
|
55
|
-
var
|
|
56
|
-
function
|
|
57
|
-
for (var s =
|
|
55
|
+
var Me = ue ? Ie : se;
|
|
56
|
+
function S(e, t, r) {
|
|
57
|
+
for (var s = Me(e), a = 0, o = s.length, n = void 0, i = void 0; a < o; ++a)
|
|
58
58
|
if (n = s[a], !(n === "callee" || n === "caller")) {
|
|
59
|
-
if (
|
|
59
|
+
if (i = Re(e, n), !i) {
|
|
60
60
|
t[n] = r.copier(e[n], r);
|
|
61
61
|
continue;
|
|
62
62
|
}
|
|
63
|
-
!
|
|
63
|
+
!i.get && !i.set && (i.value = r.copier(i.value, r));
|
|
64
64
|
try {
|
|
65
|
-
|
|
65
|
+
xe(t, n, i);
|
|
66
66
|
} catch {
|
|
67
|
-
t[n] =
|
|
67
|
+
t[n] = i.value;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
return t;
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function ze(e, t) {
|
|
73
73
|
var r = new t.Constructor();
|
|
74
74
|
t.cache.set(e, r);
|
|
75
75
|
for (var s = 0, a = e.length; s < a; ++s)
|
|
76
76
|
r[s] = t.copier(e[s], t);
|
|
77
77
|
return r;
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function Ee(e, t) {
|
|
80
80
|
var r = new t.Constructor();
|
|
81
|
-
return t.cache.set(e, r),
|
|
81
|
+
return t.cache.set(e, r), S(e, r, t);
|
|
82
82
|
}
|
|
83
83
|
function fe(e, t) {
|
|
84
84
|
return e.slice(0);
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function Le(e, t) {
|
|
87
87
|
return e.slice(0, e.size, e.type);
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function Ne(e, t) {
|
|
90
90
|
return new t.Constructor(fe(e.buffer));
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function Be(e, t) {
|
|
93
93
|
return new t.Constructor(e.getTime());
|
|
94
94
|
}
|
|
95
95
|
function ge(e, t) {
|
|
@@ -98,35 +98,35 @@ function ge(e, t) {
|
|
|
98
98
|
r.set(a, t.copier(s, t));
|
|
99
99
|
}), r;
|
|
100
100
|
}
|
|
101
|
-
function
|
|
102
|
-
return
|
|
101
|
+
function Ve(e, t) {
|
|
102
|
+
return S(e, ge(e, t), t);
|
|
103
103
|
}
|
|
104
|
-
function
|
|
105
|
-
var r =
|
|
104
|
+
function Qe(e, t) {
|
|
105
|
+
var r = N(t.prototype);
|
|
106
106
|
t.cache.set(e, r);
|
|
107
107
|
for (var s in e)
|
|
108
|
-
|
|
108
|
+
le.call(e, s) && (r[s] = t.copier(e[s], t));
|
|
109
109
|
return r;
|
|
110
110
|
}
|
|
111
|
-
function
|
|
112
|
-
var r =
|
|
111
|
+
function Fe(e, t) {
|
|
112
|
+
var r = N(t.prototype);
|
|
113
113
|
t.cache.set(e, r);
|
|
114
114
|
for (var s in e)
|
|
115
|
-
|
|
116
|
-
for (var a =
|
|
117
|
-
|
|
115
|
+
le.call(e, s) && (r[s] = t.copier(e[s], t));
|
|
116
|
+
for (var a = B(e), o = 0, n = a.length, i = void 0; o < n; ++o)
|
|
117
|
+
i = a[o], De.call(e, i) && (r[i] = t.copier(e[i], t));
|
|
118
118
|
return r;
|
|
119
119
|
}
|
|
120
|
-
var
|
|
121
|
-
function
|
|
122
|
-
var r =
|
|
123
|
-
return t.cache.set(e, r),
|
|
120
|
+
var Ge = ue ? Fe : Qe;
|
|
121
|
+
function Ue(e, t) {
|
|
122
|
+
var r = N(t.prototype);
|
|
123
|
+
return t.cache.set(e, r), S(e, r, t);
|
|
124
124
|
}
|
|
125
125
|
function O(e, t) {
|
|
126
126
|
return new t.Constructor(e.valueOf());
|
|
127
127
|
}
|
|
128
|
-
function
|
|
129
|
-
var r = new t.Constructor(e.source,
|
|
128
|
+
function Ke(e, t) {
|
|
129
|
+
var r = new t.Constructor(e.source, _e(e));
|
|
130
130
|
return r.lastIndex = e.lastIndex, r;
|
|
131
131
|
}
|
|
132
132
|
function w(e, t) {
|
|
@@ -138,27 +138,27 @@ function pe(e, t) {
|
|
|
138
138
|
r.add(t.copier(s, t));
|
|
139
139
|
}), r;
|
|
140
140
|
}
|
|
141
|
-
function
|
|
142
|
-
return
|
|
141
|
+
function We(e, t) {
|
|
142
|
+
return S(e, pe(e, t), t);
|
|
143
143
|
}
|
|
144
|
-
var Je = Array.isArray,
|
|
144
|
+
var Je = Array.isArray, V = Object.assign, He = Object.getPrototypeOf || (function(e) {
|
|
145
145
|
return e.__proto__;
|
|
146
146
|
}), he = {
|
|
147
|
-
array:
|
|
147
|
+
array: ze,
|
|
148
148
|
arrayBuffer: fe,
|
|
149
|
-
blob:
|
|
150
|
-
dataView:
|
|
151
|
-
date:
|
|
149
|
+
blob: Le,
|
|
150
|
+
dataView: Ne,
|
|
151
|
+
date: Be,
|
|
152
152
|
error: w,
|
|
153
153
|
map: ge,
|
|
154
|
-
object:
|
|
155
|
-
regExp:
|
|
154
|
+
object: Ge,
|
|
155
|
+
regExp: Ke,
|
|
156
156
|
set: pe
|
|
157
|
-
}, Ye =
|
|
158
|
-
array:
|
|
159
|
-
map:
|
|
160
|
-
object:
|
|
161
|
-
set:
|
|
157
|
+
}, Ye = V({}, he, {
|
|
158
|
+
array: Ee,
|
|
159
|
+
map: Ve,
|
|
160
|
+
object: Ue,
|
|
161
|
+
set: We
|
|
162
162
|
});
|
|
163
163
|
function Xe(e) {
|
|
164
164
|
return {
|
|
@@ -192,38 +192,38 @@ function Xe(e) {
|
|
|
192
192
|
};
|
|
193
193
|
}
|
|
194
194
|
function ye(e) {
|
|
195
|
-
var t =
|
|
196
|
-
function
|
|
197
|
-
if (
|
|
195
|
+
var t = V({}, he, e), r = Xe(t), s = r.Array, a = r.Object;
|
|
196
|
+
function o(n, i) {
|
|
197
|
+
if (i.prototype = i.Constructor = void 0, !n || typeof n != "object")
|
|
198
198
|
return n;
|
|
199
|
-
if (
|
|
200
|
-
return
|
|
201
|
-
if (
|
|
202
|
-
return a(n,
|
|
199
|
+
if (i.cache.has(n))
|
|
200
|
+
return i.cache.get(n);
|
|
201
|
+
if (i.prototype = He(n), i.Constructor = i.prototype && i.prototype.constructor, !i.Constructor || i.Constructor === Object)
|
|
202
|
+
return a(n, i);
|
|
203
203
|
if (Je(n))
|
|
204
|
-
return s(n,
|
|
204
|
+
return s(n, i);
|
|
205
205
|
var c = r[Pe(n)];
|
|
206
|
-
return c ? c(n,
|
|
206
|
+
return c ? c(n, i) : typeof n.then == "function" ? n : a(n, i);
|
|
207
207
|
}
|
|
208
|
-
return function(
|
|
209
|
-
return i
|
|
208
|
+
return function(i) {
|
|
209
|
+
return o(i, {
|
|
210
210
|
Constructor: void 0,
|
|
211
|
-
cache:
|
|
212
|
-
copier:
|
|
211
|
+
cache: ke(),
|
|
212
|
+
copier: o,
|
|
213
213
|
prototype: void 0
|
|
214
214
|
});
|
|
215
215
|
};
|
|
216
216
|
}
|
|
217
217
|
function Ze(e) {
|
|
218
|
-
return ye(
|
|
218
|
+
return ye(V({}, Ye, e));
|
|
219
219
|
}
|
|
220
220
|
Ze({});
|
|
221
221
|
ye({});
|
|
222
|
-
var
|
|
222
|
+
var v = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, j = { exports: {} }, F;
|
|
223
223
|
function et() {
|
|
224
|
-
if (
|
|
225
|
-
|
|
226
|
-
var e =
|
|
224
|
+
if (F) return j.exports;
|
|
225
|
+
F = 1;
|
|
226
|
+
var e = j.exports = {}, t, r;
|
|
227
227
|
function s() {
|
|
228
228
|
throw new Error("setTimeout has not been defined");
|
|
229
229
|
}
|
|
@@ -242,117 +242,117 @@ function et() {
|
|
|
242
242
|
r = a;
|
|
243
243
|
}
|
|
244
244
|
})();
|
|
245
|
-
function
|
|
245
|
+
function o(p) {
|
|
246
246
|
if (t === setTimeout)
|
|
247
|
-
return setTimeout(
|
|
247
|
+
return setTimeout(p, 0);
|
|
248
248
|
if ((t === s || !t) && setTimeout)
|
|
249
|
-
return t = setTimeout, setTimeout(
|
|
249
|
+
return t = setTimeout, setTimeout(p, 0);
|
|
250
250
|
try {
|
|
251
|
-
return t(
|
|
251
|
+
return t(p, 0);
|
|
252
252
|
} catch {
|
|
253
253
|
try {
|
|
254
|
-
return t.call(null,
|
|
254
|
+
return t.call(null, p, 0);
|
|
255
255
|
} catch {
|
|
256
|
-
return t.call(this,
|
|
256
|
+
return t.call(this, p, 0);
|
|
257
257
|
}
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
|
-
function n(
|
|
260
|
+
function n(p) {
|
|
261
261
|
if (r === clearTimeout)
|
|
262
|
-
return clearTimeout(
|
|
262
|
+
return clearTimeout(p);
|
|
263
263
|
if ((r === a || !r) && clearTimeout)
|
|
264
|
-
return r = clearTimeout, clearTimeout(
|
|
264
|
+
return r = clearTimeout, clearTimeout(p);
|
|
265
265
|
try {
|
|
266
|
-
return r(
|
|
266
|
+
return r(p);
|
|
267
267
|
} catch {
|
|
268
268
|
try {
|
|
269
|
-
return r.call(null,
|
|
269
|
+
return r.call(null, p);
|
|
270
270
|
} catch {
|
|
271
|
-
return r.call(this,
|
|
271
|
+
return r.call(this, p);
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
|
-
var
|
|
275
|
+
var i = [], c = !1, l, u = -1;
|
|
276
276
|
function f() {
|
|
277
|
-
!c || !
|
|
277
|
+
!c || !l || (c = !1, l.length ? i = l.concat(i) : u = -1, i.length && g());
|
|
278
278
|
}
|
|
279
|
-
function
|
|
279
|
+
function g() {
|
|
280
280
|
if (!c) {
|
|
281
|
-
var
|
|
281
|
+
var p = o(f);
|
|
282
282
|
c = !0;
|
|
283
|
-
for (var
|
|
284
|
-
for (
|
|
285
|
-
|
|
286
|
-
|
|
283
|
+
for (var m = i.length; m; ) {
|
|
284
|
+
for (l = i, i = []; ++u < m; )
|
|
285
|
+
l && l[u].run();
|
|
286
|
+
u = -1, m = i.length;
|
|
287
287
|
}
|
|
288
|
-
|
|
288
|
+
l = null, c = !1, n(p);
|
|
289
289
|
}
|
|
290
290
|
}
|
|
291
|
-
e.nextTick = function(
|
|
292
|
-
var
|
|
291
|
+
e.nextTick = function(p) {
|
|
292
|
+
var m = new Array(arguments.length - 1);
|
|
293
293
|
if (arguments.length > 1)
|
|
294
|
-
for (var
|
|
295
|
-
|
|
296
|
-
|
|
294
|
+
for (var b = 1; b < arguments.length; b++)
|
|
295
|
+
m[b - 1] = arguments[b];
|
|
296
|
+
i.push(new y(p, m)), i.length === 1 && !c && o(g);
|
|
297
297
|
};
|
|
298
|
-
function
|
|
299
|
-
this.fun =
|
|
298
|
+
function y(p, m) {
|
|
299
|
+
this.fun = p, this.array = m;
|
|
300
300
|
}
|
|
301
|
-
|
|
301
|
+
y.prototype.run = function() {
|
|
302
302
|
this.fun.apply(null, this.array);
|
|
303
303
|
}, e.title = "browser", e.browser = !0, e.env = {}, e.argv = [], e.version = "", e.versions = {};
|
|
304
|
-
function
|
|
304
|
+
function h() {
|
|
305
305
|
}
|
|
306
|
-
return e.on =
|
|
306
|
+
return e.on = h, e.addListener = h, e.once = h, e.off = h, e.removeListener = h, e.removeAllListeners = h, e.emit = h, e.prependListener = h, e.prependOnceListener = h, e.listeners = function(p) {
|
|
307
307
|
return [];
|
|
308
|
-
}, e.binding = function(
|
|
308
|
+
}, e.binding = function(p) {
|
|
309
309
|
throw new Error("process.binding is not supported");
|
|
310
310
|
}, e.cwd = function() {
|
|
311
311
|
return "/";
|
|
312
|
-
}, e.chdir = function(
|
|
312
|
+
}, e.chdir = function(p) {
|
|
313
313
|
throw new Error("process.chdir is not supported");
|
|
314
314
|
}, e.umask = function() {
|
|
315
315
|
return 0;
|
|
316
|
-
},
|
|
316
|
+
}, j.exports;
|
|
317
317
|
}
|
|
318
318
|
et();
|
|
319
|
-
var
|
|
319
|
+
var k, G;
|
|
320
320
|
function tt() {
|
|
321
|
-
if (
|
|
322
|
-
|
|
323
|
-
var e = typeof
|
|
324
|
-
return
|
|
321
|
+
if (G) return k;
|
|
322
|
+
G = 1;
|
|
323
|
+
var e = typeof v == "object" && v && v.Object === Object && v;
|
|
324
|
+
return k = e, k;
|
|
325
325
|
}
|
|
326
|
-
var A,
|
|
326
|
+
var A, U;
|
|
327
327
|
function rt() {
|
|
328
|
-
if (
|
|
329
|
-
|
|
328
|
+
if (U) return A;
|
|
329
|
+
U = 1;
|
|
330
330
|
var e = tt(), t = typeof self == "object" && self && self.Object === Object && self, r = e || t || Function("return this")();
|
|
331
331
|
return A = r, A;
|
|
332
332
|
}
|
|
333
|
-
var T,
|
|
334
|
-
function
|
|
335
|
-
if (
|
|
336
|
-
|
|
333
|
+
var T, K;
|
|
334
|
+
function me() {
|
|
335
|
+
if (K) return T;
|
|
336
|
+
K = 1;
|
|
337
337
|
var e = rt(), t = e.Symbol;
|
|
338
338
|
return T = t, T;
|
|
339
339
|
}
|
|
340
|
-
var _,
|
|
340
|
+
var _, W;
|
|
341
341
|
function nt() {
|
|
342
|
-
if (
|
|
343
|
-
|
|
344
|
-
var e =
|
|
345
|
-
function
|
|
346
|
-
var
|
|
342
|
+
if (W) return _;
|
|
343
|
+
W = 1;
|
|
344
|
+
var e = me(), t = Object.prototype, r = t.hasOwnProperty, s = t.toString, a = e ? e.toStringTag : void 0;
|
|
345
|
+
function o(n) {
|
|
346
|
+
var i = r.call(n, a), c = n[a];
|
|
347
347
|
try {
|
|
348
348
|
n[a] = void 0;
|
|
349
|
-
var
|
|
349
|
+
var l = !0;
|
|
350
350
|
} catch {
|
|
351
351
|
}
|
|
352
|
-
var
|
|
353
|
-
return
|
|
352
|
+
var u = s.call(n);
|
|
353
|
+
return l && (i ? n[a] = c : delete n[a]), u;
|
|
354
354
|
}
|
|
355
|
-
return _ =
|
|
355
|
+
return _ = o, _;
|
|
356
356
|
}
|
|
357
357
|
var q, J;
|
|
358
358
|
function it() {
|
|
@@ -364,22 +364,22 @@ function it() {
|
|
|
364
364
|
}
|
|
365
365
|
return q = r, q;
|
|
366
366
|
}
|
|
367
|
-
var
|
|
368
|
-
function
|
|
369
|
-
if (H) return
|
|
367
|
+
var P, H;
|
|
368
|
+
function de() {
|
|
369
|
+
if (H) return P;
|
|
370
370
|
H = 1;
|
|
371
|
-
var e =
|
|
372
|
-
function n(
|
|
373
|
-
return
|
|
371
|
+
var e = me(), t = nt(), r = it(), s = "[object Null]", a = "[object Undefined]", o = e ? e.toStringTag : void 0;
|
|
372
|
+
function n(i) {
|
|
373
|
+
return i == null ? i === void 0 ? a : s : o && o in Object(i) ? t(i) : r(i);
|
|
374
374
|
}
|
|
375
|
-
return
|
|
375
|
+
return P = n, P;
|
|
376
376
|
}
|
|
377
|
-
var
|
|
377
|
+
var x, Y;
|
|
378
378
|
function ot() {
|
|
379
|
-
if (Y) return
|
|
379
|
+
if (Y) return x;
|
|
380
380
|
Y = 1;
|
|
381
381
|
var e = Array.isArray;
|
|
382
|
-
return
|
|
382
|
+
return x = e, x;
|
|
383
383
|
}
|
|
384
384
|
var R, X;
|
|
385
385
|
function be() {
|
|
@@ -394,128 +394,128 @@ var D, Z;
|
|
|
394
394
|
function at() {
|
|
395
395
|
if (Z) return D;
|
|
396
396
|
Z = 1;
|
|
397
|
-
var e =
|
|
398
|
-
function a(
|
|
399
|
-
return typeof
|
|
397
|
+
var e = de(), t = ot(), r = be(), s = "[object String]";
|
|
398
|
+
function a(o) {
|
|
399
|
+
return typeof o == "string" || !t(o) && r(o) && e(o) == s;
|
|
400
400
|
}
|
|
401
401
|
return D = a, D;
|
|
402
402
|
}
|
|
403
403
|
at();
|
|
404
|
-
var
|
|
404
|
+
var I, ee;
|
|
405
405
|
function st() {
|
|
406
|
-
if (ee) return
|
|
406
|
+
if (ee) return I;
|
|
407
407
|
ee = 1;
|
|
408
408
|
function e(t, r) {
|
|
409
409
|
return function(s) {
|
|
410
410
|
return t(r(s));
|
|
411
411
|
};
|
|
412
412
|
}
|
|
413
|
-
return
|
|
413
|
+
return I = e, I;
|
|
414
414
|
}
|
|
415
|
-
var
|
|
415
|
+
var M, te;
|
|
416
416
|
function ct() {
|
|
417
|
-
if (te) return
|
|
417
|
+
if (te) return M;
|
|
418
418
|
te = 1;
|
|
419
419
|
var e = st(), t = e(Object.getPrototypeOf, Object);
|
|
420
|
-
return
|
|
420
|
+
return M = t, M;
|
|
421
421
|
}
|
|
422
|
-
var
|
|
423
|
-
function
|
|
424
|
-
if (re) return
|
|
422
|
+
var z, re;
|
|
423
|
+
function lt() {
|
|
424
|
+
if (re) return z;
|
|
425
425
|
re = 1;
|
|
426
|
-
var e =
|
|
427
|
-
function u
|
|
428
|
-
if (!r(
|
|
426
|
+
var e = de(), t = ct(), r = be(), s = "[object Object]", a = Function.prototype, o = Object.prototype, n = a.toString, i = o.hasOwnProperty, c = n.call(Object);
|
|
427
|
+
function l(u) {
|
|
428
|
+
if (!r(u) || e(u) != s)
|
|
429
429
|
return !1;
|
|
430
|
-
var f = t(
|
|
430
|
+
var f = t(u);
|
|
431
431
|
if (f === null)
|
|
432
432
|
return !0;
|
|
433
|
-
var
|
|
434
|
-
return typeof
|
|
433
|
+
var g = i.call(f, "constructor") && f.constructor;
|
|
434
|
+
return typeof g == "function" && g instanceof g && n.call(g) == c;
|
|
435
435
|
}
|
|
436
|
-
return
|
|
436
|
+
return z = l, z;
|
|
437
437
|
}
|
|
438
|
-
|
|
439
|
-
var ve = { 0: 8203, 1: 8204, 2: 8205, 3: 8290, 4: 8291, 5: 8288, 6: 65279, 7: 8289, 8: 119155, 9: 119156, a: 119157, b: 119158, c: 119159, d: 119160, e: 119161, f: 119162 },
|
|
440
|
-
new Array(4).fill(String.fromCodePoint(
|
|
441
|
-
Object.fromEntries(Object.entries(
|
|
438
|
+
lt();
|
|
439
|
+
var ve = { 0: 8203, 1: 8204, 2: 8205, 3: 8290, 4: 8291, 5: 8288, 6: 65279, 7: 8289, 8: 119155, 9: 119156, a: 119157, b: 119158, c: 119159, d: 119160, e: 119161, f: 119162 }, $e = { 0: 8203, 1: 8204, 2: 8205, 3: 65279 };
|
|
440
|
+
new Array(4).fill(String.fromCodePoint($e[0])).join("");
|
|
441
|
+
Object.fromEntries(Object.entries($e).map((e) => e.reverse()));
|
|
442
442
|
Object.fromEntries(Object.entries(ve).map((e) => e.reverse()));
|
|
443
443
|
`${Object.values(ve).map((e) => `\\u{${e.toString(16)}}`).join("")}`;
|
|
444
|
-
var
|
|
445
|
-
function
|
|
446
|
-
if (ne) return
|
|
444
|
+
var E, ne;
|
|
445
|
+
function ut() {
|
|
446
|
+
if (ne) return E;
|
|
447
447
|
ne = 1;
|
|
448
448
|
var e = Object.prototype.hasOwnProperty, t = Object.prototype.toString;
|
|
449
|
-
return
|
|
449
|
+
return E = function(r, s, a) {
|
|
450
450
|
if (t.call(s) !== "[object Function]")
|
|
451
451
|
throw new TypeError("iterator must be a function");
|
|
452
|
-
var
|
|
453
|
-
if (
|
|
454
|
-
for (var n = 0; n <
|
|
452
|
+
var o = r.length;
|
|
453
|
+
if (o === +o)
|
|
454
|
+
for (var n = 0; n < o; n++)
|
|
455
455
|
s.call(a, r[n], n, r);
|
|
456
456
|
else
|
|
457
|
-
for (var
|
|
458
|
-
e.call(r,
|
|
459
|
-
},
|
|
457
|
+
for (var i in r)
|
|
458
|
+
e.call(r, i) && s.call(a, r[i], i, r);
|
|
459
|
+
}, E;
|
|
460
460
|
}
|
|
461
|
-
var
|
|
461
|
+
var L, ie;
|
|
462
462
|
function ft() {
|
|
463
|
-
if (ie) return
|
|
463
|
+
if (ie) return L;
|
|
464
464
|
ie = 1;
|
|
465
|
-
var e =
|
|
466
|
-
|
|
465
|
+
var e = ut();
|
|
466
|
+
L = t;
|
|
467
467
|
function t(r, s, a) {
|
|
468
468
|
if (arguments.length === 3)
|
|
469
469
|
return t.set(r, s, a);
|
|
470
470
|
if (arguments.length === 2)
|
|
471
471
|
return t.get(r, s);
|
|
472
|
-
var
|
|
472
|
+
var o = t.bind(t, r);
|
|
473
473
|
for (var n in t)
|
|
474
|
-
t.hasOwnProperty(n) && (
|
|
475
|
-
return
|
|
474
|
+
t.hasOwnProperty(n) && (o[n] = t[n].bind(o, r));
|
|
475
|
+
return o;
|
|
476
476
|
}
|
|
477
477
|
return t.get = function(r, s) {
|
|
478
|
-
for (var a = Array.isArray(s) ? s : t.parse(s),
|
|
479
|
-
var n = a[
|
|
478
|
+
for (var a = Array.isArray(s) ? s : t.parse(s), o = 0; o < a.length; ++o) {
|
|
479
|
+
var n = a[o];
|
|
480
480
|
if (!(typeof r == "object" && n in r))
|
|
481
481
|
throw new Error("Invalid reference token: " + n);
|
|
482
482
|
r = r[n];
|
|
483
483
|
}
|
|
484
484
|
return r;
|
|
485
485
|
}, t.set = function(r, s, a) {
|
|
486
|
-
var
|
|
487
|
-
if (
|
|
486
|
+
var o = Array.isArray(s) ? s : t.parse(s), n = o[0];
|
|
487
|
+
if (o.length === 0)
|
|
488
488
|
throw Error("Can not set the root object");
|
|
489
|
-
for (var
|
|
490
|
-
var c = i
|
|
491
|
-
typeof c != "string" && typeof c != "number" && (c = String(c)), !(c === "__proto__" || c === "constructor" || c === "prototype") && (c === "-" && Array.isArray(r) && (c = r.length), n = i
|
|
489
|
+
for (var i = 0; i < o.length - 1; ++i) {
|
|
490
|
+
var c = o[i];
|
|
491
|
+
typeof c != "string" && typeof c != "number" && (c = String(c)), !(c === "__proto__" || c === "constructor" || c === "prototype") && (c === "-" && Array.isArray(r) && (c = r.length), n = o[i + 1], c in r || (n.match(/^(\d+|-)$/) ? r[c] = [] : r[c] = {}), r = r[c]);
|
|
492
492
|
}
|
|
493
493
|
return n === "-" && Array.isArray(r) && (n = r.length), r[n] = a, this;
|
|
494
494
|
}, t.remove = function(r, s) {
|
|
495
|
-
var a = Array.isArray(s) ? s : t.parse(s),
|
|
496
|
-
if (
|
|
495
|
+
var a = Array.isArray(s) ? s : t.parse(s), o = a[a.length - 1];
|
|
496
|
+
if (o === void 0)
|
|
497
497
|
throw new Error('Invalid JSON pointer for remove: "' + s + '"');
|
|
498
498
|
var n = t.get(r, a.slice(0, -1));
|
|
499
499
|
if (Array.isArray(n)) {
|
|
500
|
-
var
|
|
501
|
-
if (
|
|
502
|
-
throw new Error('Invalid array index: "' +
|
|
503
|
-
Array.prototype.splice.call(n,
|
|
500
|
+
var i = +o;
|
|
501
|
+
if (o === "" && isNaN(i))
|
|
502
|
+
throw new Error('Invalid array index: "' + o + '"');
|
|
503
|
+
Array.prototype.splice.call(n, i, 1);
|
|
504
504
|
} else
|
|
505
|
-
delete n[
|
|
505
|
+
delete n[o];
|
|
506
506
|
}, t.dict = function(r, s) {
|
|
507
507
|
var a = {};
|
|
508
|
-
return t.walk(r, function(
|
|
509
|
-
a[n] =
|
|
508
|
+
return t.walk(r, function(o, n) {
|
|
509
|
+
a[n] = o;
|
|
510
510
|
}, s), a;
|
|
511
511
|
}, t.walk = function(r, s, a) {
|
|
512
|
-
var
|
|
512
|
+
var o = [];
|
|
513
513
|
a = a || function(n) {
|
|
514
|
-
var
|
|
515
|
-
return
|
|
516
|
-
}, (function n(
|
|
517
|
-
e(
|
|
518
|
-
|
|
514
|
+
var i = Object.prototype.toString.call(n);
|
|
515
|
+
return i === "[object Object]" || i === "[object Array]";
|
|
516
|
+
}, (function n(i) {
|
|
517
|
+
e(i, function(c, l) {
|
|
518
|
+
o.push(String(l)), a(c) ? n(c) : s(c, t.compile(o)), o.pop();
|
|
519
519
|
});
|
|
520
520
|
})(r);
|
|
521
521
|
}, t.has = function(r, s) {
|
|
@@ -537,32 +537,32 @@ function ft() {
|
|
|
537
537
|
return r.substring(1).split(/\//).map(t.unescape);
|
|
538
538
|
}, t.compile = function(r) {
|
|
539
539
|
return r.length === 0 ? "" : "/" + r.map(t.escape).join("/");
|
|
540
|
-
},
|
|
540
|
+
}, L;
|
|
541
541
|
}
|
|
542
542
|
ft();
|
|
543
|
-
var
|
|
543
|
+
var $ = { exports: {} }, oe;
|
|
544
544
|
function gt() {
|
|
545
545
|
return oe || (oe = 1, (function(e, t) {
|
|
546
546
|
t = e.exports = r, t.getSerialize = s;
|
|
547
|
-
function r(a,
|
|
548
|
-
return JSON.stringify(a, s(
|
|
547
|
+
function r(a, o, n, i) {
|
|
548
|
+
return JSON.stringify(a, s(o, i), n);
|
|
549
549
|
}
|
|
550
|
-
function s(a,
|
|
551
|
-
var n = [],
|
|
552
|
-
return
|
|
553
|
-
return n[0] ===
|
|
554
|
-
}), function(c,
|
|
550
|
+
function s(a, o) {
|
|
551
|
+
var n = [], i = [];
|
|
552
|
+
return o == null && (o = function(c, l) {
|
|
553
|
+
return n[0] === l ? "[Circular ~]" : "[Circular ~." + i.slice(0, n.indexOf(l)).join(".") + "]";
|
|
554
|
+
}), function(c, l) {
|
|
555
555
|
if (n.length > 0) {
|
|
556
|
-
var
|
|
557
|
-
~
|
|
558
|
-
} else n.push(
|
|
559
|
-
return a == null ?
|
|
556
|
+
var u = n.indexOf(this);
|
|
557
|
+
~u ? n.splice(u + 1) : n.push(this), ~u ? i.splice(u, 1 / 0, c) : i.push(c), ~n.indexOf(l) && (l = o.call(this, c, l));
|
|
558
|
+
} else n.push(l);
|
|
559
|
+
return a == null ? l : a.call(this, c, l);
|
|
560
560
|
};
|
|
561
561
|
}
|
|
562
|
-
})(
|
|
562
|
+
})($, $.exports)), $.exports;
|
|
563
563
|
}
|
|
564
564
|
gt();
|
|
565
|
-
class
|
|
565
|
+
class d {
|
|
566
566
|
static _clientParams;
|
|
567
567
|
// static getter
|
|
568
568
|
static get clientParams() {
|
|
@@ -577,8 +577,8 @@ class h {
|
|
|
577
577
|
};
|
|
578
578
|
}
|
|
579
579
|
static async graphqlQuery(t, r = {}) {
|
|
580
|
-
const { space: s, accessToken: a, environment:
|
|
581
|
-
`https://graphql.contentful.com/content/v1/spaces/${s}/environments/${
|
|
580
|
+
const { space: s, accessToken: a, environment: o = "master" } = this.clientParams, n = await fetch(
|
|
581
|
+
`https://graphql.contentful.com/content/v1/spaces/${s}/environments/${o}`,
|
|
582
582
|
{
|
|
583
583
|
method: "POST",
|
|
584
584
|
headers: {
|
|
@@ -595,41 +595,49 @@ class h {
|
|
|
595
595
|
${c}`
|
|
596
596
|
);
|
|
597
597
|
}
|
|
598
|
-
const
|
|
599
|
-
if (
|
|
598
|
+
const i = await n.json();
|
|
599
|
+
if (i.errors)
|
|
600
600
|
throw new Error(
|
|
601
|
-
`GraphQL errors: ${JSON.stringify(
|
|
601
|
+
`GraphQL errors: ${JSON.stringify(i.errors, null, 2)}`
|
|
602
602
|
);
|
|
603
|
-
return
|
|
603
|
+
return i.data;
|
|
604
604
|
}
|
|
605
605
|
}
|
|
606
606
|
const pt = async ({
|
|
607
607
|
slot: e,
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
608
|
+
page: t = 1,
|
|
609
|
+
size: r = 20,
|
|
610
|
+
platform: s,
|
|
611
|
+
marketCode: a,
|
|
612
|
+
language: o
|
|
612
613
|
}) => {
|
|
613
|
-
const
|
|
614
|
+
const n = Math.max(1, Math.floor(t)), i = Math.max(1, Math.floor(r)), c = [
|
|
615
|
+
"$slot: String!",
|
|
616
|
+
"$limit: Int!",
|
|
617
|
+
"$skip: Int!"
|
|
618
|
+
], l = {
|
|
614
619
|
slot: e,
|
|
615
|
-
limit:
|
|
616
|
-
|
|
617
|
-
|
|
620
|
+
limit: i,
|
|
621
|
+
skip: (n - 1) * i
|
|
622
|
+
}, u = ["{ slot: $slot }"];
|
|
623
|
+
s && (c.push("$platform: String!"), l.platform = s, u.push("{ platform_contains_some: [$platform] }")), a && (c.push("$marketCode: String!"), l.marketCode = a, u.push(
|
|
618
624
|
"{ OR: [{ market_exists: false }, { market: { code: $marketCode } }] }"
|
|
619
|
-
)),
|
|
625
|
+
)), o && (c.push("$language: String!"), l.language = o, u.push(
|
|
620
626
|
"{ OR: [{ language_exists: false }, { language: { code: $language } }] }"
|
|
621
627
|
));
|
|
622
|
-
const
|
|
628
|
+
const f = `(${c.join(", ")})`, g = `(
|
|
623
629
|
limit: $limit
|
|
630
|
+
skip: $skip
|
|
624
631
|
where: {
|
|
625
632
|
AND: [
|
|
626
|
-
${
|
|
633
|
+
${u.join(`
|
|
627
634
|
`)}
|
|
628
635
|
]
|
|
629
636
|
}
|
|
630
|
-
)`,
|
|
631
|
-
query${
|
|
632
|
-
bannerCollectionCollection${
|
|
637
|
+
)`, y = `
|
|
638
|
+
query${f} {
|
|
639
|
+
bannerCollectionCollection${g} {
|
|
640
|
+
total
|
|
633
641
|
items {
|
|
634
642
|
sys {
|
|
635
643
|
id
|
|
@@ -663,14 +671,17 @@ query${c} {
|
|
|
663
671
|
}
|
|
664
672
|
}
|
|
665
673
|
}
|
|
666
|
-
`, { bannerCollectionCollection:
|
|
667
|
-
...
|
|
674
|
+
`, { bannerCollectionCollection: h } = await d.graphqlQuery(y, {
|
|
675
|
+
...l
|
|
668
676
|
});
|
|
669
677
|
return {
|
|
670
|
-
|
|
678
|
+
page: n,
|
|
679
|
+
total: h.total,
|
|
680
|
+
size: i,
|
|
681
|
+
items: h.items
|
|
671
682
|
};
|
|
672
683
|
};
|
|
673
|
-
class
|
|
684
|
+
class Q extends Response {
|
|
674
685
|
constructor(...t) {
|
|
675
686
|
super(t[0] ?? "Not Found", {
|
|
676
687
|
status: 404,
|
|
@@ -681,26 +692,30 @@ class F extends Response {
|
|
|
681
692
|
const ht = async ({
|
|
682
693
|
marketCode: e,
|
|
683
694
|
language: t,
|
|
684
|
-
|
|
685
|
-
|
|
695
|
+
page: r = 1,
|
|
696
|
+
size: s = 20
|
|
686
697
|
} = {}) => {
|
|
687
|
-
const a =
|
|
688
|
-
|
|
698
|
+
const a = Math.max(1, Math.floor(r)), o = Math.max(1, Math.floor(s)), n = ["$limit: Int!", "$skip: Int!"], i = {
|
|
699
|
+
limit: o,
|
|
700
|
+
skip: (a - 1) * o
|
|
701
|
+
}, c = ["limit: $limit", "skip: $skip"], l = [];
|
|
702
|
+
e && (n.push("$marketCode: String!"), i.marketCode = e, l.push(
|
|
689
703
|
"{ OR: [{ market_exists: false }, { market: { code: $marketCode } }] }"
|
|
690
|
-
)), t && (
|
|
704
|
+
)), t && (n.push("$language: String!"), i.language = t, l.push(
|
|
691
705
|
"{ OR: [{ language_exists: false }, { language: { code: $language } }] }"
|
|
692
|
-
)),
|
|
706
|
+
)), l.length && c.push(`where: {
|
|
693
707
|
AND: [
|
|
694
|
-
${
|
|
708
|
+
${l.join(`
|
|
695
709
|
`)}
|
|
696
710
|
]
|
|
697
711
|
}`);
|
|
698
|
-
const
|
|
699
|
-
${
|
|
712
|
+
const u = n.length ? `(${n.join(", ")})` : "", f = c.length ? `(
|
|
713
|
+
${c.join(`
|
|
700
714
|
`)}
|
|
701
|
-
)` : "",
|
|
702
|
-
query${
|
|
703
|
-
blogPostCollection${
|
|
715
|
+
)` : "", g = `
|
|
716
|
+
query${u} {
|
|
717
|
+
blogPostCollection${f} {
|
|
718
|
+
total
|
|
704
719
|
items {
|
|
705
720
|
sys {
|
|
706
721
|
id
|
|
@@ -723,11 +738,14 @@ query${c} {
|
|
|
723
738
|
}
|
|
724
739
|
}
|
|
725
740
|
}
|
|
726
|
-
`, { blogPostCollection:
|
|
741
|
+
`, { blogPostCollection: y } = await d.graphqlQuery(g, {
|
|
727
742
|
...i
|
|
728
743
|
});
|
|
729
744
|
return {
|
|
730
|
-
|
|
745
|
+
page: a,
|
|
746
|
+
total: y.total,
|
|
747
|
+
size: o,
|
|
748
|
+
items: y.items
|
|
731
749
|
};
|
|
732
750
|
}, yt = async ({
|
|
733
751
|
id: e,
|
|
@@ -735,19 +753,19 @@ query${c} {
|
|
|
735
753
|
marketCode: r,
|
|
736
754
|
language: s
|
|
737
755
|
}) => {
|
|
738
|
-
const a = [],
|
|
756
|
+
const a = [], o = {}, n = [];
|
|
739
757
|
if (e)
|
|
740
|
-
a.push("$id: String!"),
|
|
758
|
+
a.push("$id: String!"), o.id = e, n.push("{ sys: { id: $id } }");
|
|
741
759
|
else if (t)
|
|
742
|
-
a.push("$slug: String!"),
|
|
760
|
+
a.push("$slug: String!"), o.slug = t, n.push("{ slug: $slug }");
|
|
743
761
|
else
|
|
744
762
|
throw new Error("Either id or slug is required.");
|
|
745
|
-
r && (a.push("$marketCode: String!"),
|
|
763
|
+
r && (a.push("$marketCode: String!"), o.marketCode = r, n.push(
|
|
746
764
|
"{ OR: [{ market_exists: false }, { market: { code: $marketCode } }] }"
|
|
747
|
-
)), s && (a.push("$language: String!"),
|
|
765
|
+
)), s && (a.push("$language: String!"), o.language = s, n.push(
|
|
748
766
|
"{ OR: [{ language_exists: false }, { language: { code: $language } }] }"
|
|
749
767
|
));
|
|
750
|
-
const
|
|
768
|
+
const i = `(${a.join(", ")})`, c = `(
|
|
751
769
|
limit: 1
|
|
752
770
|
where: {
|
|
753
771
|
AND: [
|
|
@@ -755,8 +773,8 @@ query${c} {
|
|
|
755
773
|
`)}
|
|
756
774
|
]
|
|
757
775
|
}
|
|
758
|
-
)`,
|
|
759
|
-
query${
|
|
776
|
+
)`, l = `
|
|
777
|
+
query${i} {
|
|
760
778
|
blogPostCollection${c} {
|
|
761
779
|
items {
|
|
762
780
|
sys {
|
|
@@ -798,40 +816,43 @@ query${o} {
|
|
|
798
816
|
}
|
|
799
817
|
}
|
|
800
818
|
}
|
|
801
|
-
`, { blogPostCollection:
|
|
802
|
-
...
|
|
803
|
-
}), f =
|
|
819
|
+
`, { blogPostCollection: u } = await d.graphqlQuery(l, {
|
|
820
|
+
...o
|
|
821
|
+
}), f = u.items.at(0);
|
|
804
822
|
if (!f)
|
|
805
|
-
throw new
|
|
806
|
-
return
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
language: r
|
|
823
|
+
throw new Q();
|
|
824
|
+
return f;
|
|
825
|
+
}, mt = async ({
|
|
826
|
+
page: e = 1,
|
|
827
|
+
size: t = 20,
|
|
828
|
+
marketCode: r,
|
|
829
|
+
language: s
|
|
813
830
|
} = {}) => {
|
|
814
|
-
const
|
|
815
|
-
limit:
|
|
816
|
-
|
|
817
|
-
|
|
831
|
+
const a = Math.max(1, Math.floor(e)), o = Math.max(1, Math.floor(t)), n = ["$limit: Int!", "$skip: Int!"], i = {
|
|
832
|
+
limit: o,
|
|
833
|
+
skip: (a - 1) * o
|
|
834
|
+
}, c = [];
|
|
835
|
+
r && (n.push("$marketCode: String!"), i.marketCode = r, c.push(
|
|
818
836
|
"{ OR: [{ market_exists: false }, { market: { code: $marketCode } }] }"
|
|
819
|
-
)),
|
|
837
|
+
)), s && (n.push("$language: String!"), i.language = s, c.push(
|
|
820
838
|
"{ OR: [{ language_exists: false }, { language: { code: $language } }] }"
|
|
821
839
|
));
|
|
822
|
-
const
|
|
840
|
+
const l = `(${n.join(", ")})`, u = c.length ? `(
|
|
823
841
|
limit: $limit
|
|
842
|
+
skip: $skip
|
|
824
843
|
where: {
|
|
825
844
|
AND: [
|
|
826
|
-
${
|
|
845
|
+
${c.join(`
|
|
827
846
|
`)}
|
|
828
847
|
]
|
|
829
848
|
}
|
|
830
849
|
)` : `(
|
|
831
850
|
limit: $limit
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
851
|
+
skip: $skip
|
|
852
|
+
)`, f = `
|
|
853
|
+
query${l} {
|
|
854
|
+
brandCollectionCollection${u} {
|
|
855
|
+
total
|
|
835
856
|
items {
|
|
836
857
|
sys {
|
|
837
858
|
id
|
|
@@ -850,35 +871,42 @@ query${n} {
|
|
|
850
871
|
}
|
|
851
872
|
}
|
|
852
873
|
}
|
|
853
|
-
`, { brandCollectionCollection:
|
|
854
|
-
...
|
|
874
|
+
`, { brandCollectionCollection: g } = await d.graphqlQuery(f, {
|
|
875
|
+
...i
|
|
855
876
|
});
|
|
856
877
|
return {
|
|
857
|
-
|
|
878
|
+
page: a,
|
|
879
|
+
total: g.total,
|
|
880
|
+
size: o,
|
|
881
|
+
items: g.items
|
|
858
882
|
};
|
|
859
|
-
},
|
|
883
|
+
}, dt = async ({
|
|
860
884
|
marketCode: e,
|
|
861
885
|
language: t,
|
|
862
|
-
|
|
863
|
-
|
|
886
|
+
page: r = 1,
|
|
887
|
+
size: s = 20
|
|
864
888
|
} = {}) => {
|
|
865
|
-
const a =
|
|
866
|
-
|
|
889
|
+
const a = Math.max(1, Math.floor(r)), o = Math.max(1, Math.floor(s)), n = ["$limit: Int!", "$skip: Int!"], i = {
|
|
890
|
+
limit: o,
|
|
891
|
+
skip: (a - 1) * o
|
|
892
|
+
}, c = ["limit: $limit", "skip: $skip"], l = [];
|
|
893
|
+
e && (n.push("$marketCode: String!"), i.marketCode = e, l.push(
|
|
867
894
|
"{ OR: [{ market_exists: false }, { market: { code: $marketCode } }] }"
|
|
868
|
-
)), t && (
|
|
895
|
+
)), t && (n.push("$language: String!"), i.language = t, l.push(
|
|
869
896
|
"{ OR: [{ language_exists: false }, { language: { code: $language } }] }"
|
|
870
|
-
)),
|
|
897
|
+
)), l.length && c.push(`where: {
|
|
871
898
|
AND: [
|
|
872
|
-
${
|
|
899
|
+
${l.join(`
|
|
873
900
|
`)}
|
|
874
901
|
]
|
|
875
902
|
}`);
|
|
876
|
-
const
|
|
877
|
-
${
|
|
903
|
+
const u = n.length ? `(${n.join(", ")})` : "", f = c.length ? `(
|
|
904
|
+
${c.join(`
|
|
878
905
|
`)}
|
|
879
|
-
)` : "",
|
|
880
|
-
query${
|
|
881
|
-
documentationCategoryCollection${
|
|
906
|
+
)` : "", g = `
|
|
907
|
+
query${u} {
|
|
908
|
+
documentationCategoryCollection${f} {
|
|
909
|
+
total
|
|
882
910
|
items {
|
|
883
911
|
sys {
|
|
884
912
|
id
|
|
@@ -898,11 +926,14 @@ query${c} {
|
|
|
898
926
|
}
|
|
899
927
|
}
|
|
900
928
|
}
|
|
901
|
-
`, { documentationCategoryCollection:
|
|
929
|
+
`, { documentationCategoryCollection: y } = await d.graphqlQuery(g, {
|
|
902
930
|
...i
|
|
903
931
|
});
|
|
904
932
|
return {
|
|
905
|
-
|
|
933
|
+
page: a,
|
|
934
|
+
total: y.total,
|
|
935
|
+
size: o,
|
|
936
|
+
items: y.items
|
|
906
937
|
};
|
|
907
938
|
}, bt = async ({
|
|
908
939
|
id: e,
|
|
@@ -910,19 +941,19 @@ query${c} {
|
|
|
910
941
|
marketCode: r,
|
|
911
942
|
language: s
|
|
912
943
|
}) => {
|
|
913
|
-
const a = [],
|
|
944
|
+
const a = [], o = {}, n = [];
|
|
914
945
|
if (e)
|
|
915
|
-
a.push("$id: String!"),
|
|
946
|
+
a.push("$id: String!"), o.id = e, n.push("{ sys: { id: $id } }");
|
|
916
947
|
else if (t)
|
|
917
|
-
a.push("$slug: String!"),
|
|
948
|
+
a.push("$slug: String!"), o.slug = t, n.push("{ slug: $slug }");
|
|
918
949
|
else
|
|
919
950
|
throw new Error("Either id or slug is required.");
|
|
920
|
-
r && (a.push("$marketCode: String!"),
|
|
951
|
+
r && (a.push("$marketCode: String!"), o.marketCode = r, n.push(
|
|
921
952
|
"{ OR: [{ market_exists: false }, { market: { code: $marketCode } }] }"
|
|
922
|
-
)), s && (a.push("$language: String!"),
|
|
953
|
+
)), s && (a.push("$language: String!"), o.language = s, n.push(
|
|
923
954
|
"{ OR: [{ language_exists: false }, { language: { code: $language } }] }"
|
|
924
955
|
));
|
|
925
|
-
const
|
|
956
|
+
const i = `(${a.join(", ")})`, c = `(
|
|
926
957
|
limit: 1
|
|
927
958
|
where: {
|
|
928
959
|
AND: [
|
|
@@ -930,8 +961,8 @@ query${c} {
|
|
|
930
961
|
`)}
|
|
931
962
|
]
|
|
932
963
|
}
|
|
933
|
-
)`,
|
|
934
|
-
query${
|
|
964
|
+
)`, l = `
|
|
965
|
+
query${i} {
|
|
935
966
|
documentationCategoryCollection${c} {
|
|
936
967
|
items {
|
|
937
968
|
sys {
|
|
@@ -952,38 +983,40 @@ query${o} {
|
|
|
952
983
|
}
|
|
953
984
|
}
|
|
954
985
|
}
|
|
955
|
-
`, { documentationCategoryCollection:
|
|
956
|
-
...
|
|
957
|
-
}), f =
|
|
986
|
+
`, { documentationCategoryCollection: u } = await d.graphqlQuery(l, {
|
|
987
|
+
...o
|
|
988
|
+
}), f = u.items.at(0);
|
|
958
989
|
if (!f)
|
|
959
|
-
throw new
|
|
960
|
-
return
|
|
961
|
-
data: f
|
|
962
|
-
};
|
|
990
|
+
throw new Q();
|
|
991
|
+
return f;
|
|
963
992
|
}, vt = async ({
|
|
964
993
|
marketCode: e,
|
|
965
994
|
language: t,
|
|
966
995
|
categorySlug: r,
|
|
967
|
-
|
|
968
|
-
|
|
996
|
+
page: s = 1,
|
|
997
|
+
size: a = 20
|
|
969
998
|
} = {}) => {
|
|
970
|
-
const
|
|
971
|
-
|
|
999
|
+
const o = Math.max(1, Math.floor(s)), n = Math.max(1, Math.floor(a)), i = ["$limit: Int!", "$skip: Int!"], c = {
|
|
1000
|
+
limit: n,
|
|
1001
|
+
skip: (o - 1) * n
|
|
1002
|
+
}, l = ["limit: $limit", "skip: $skip"], u = [];
|
|
1003
|
+
e && (i.push("$marketCode: String!"), c.marketCode = e, u.push(
|
|
972
1004
|
"{ OR: [{ market_exists: false }, { market: { code: $marketCode } }] }"
|
|
973
|
-
)), t && (i.push("$language: String!"),
|
|
1005
|
+
)), t && (i.push("$language: String!"), c.language = t, u.push(
|
|
974
1006
|
"{ OR: [{ language_exists: false }, { language: { code: $language } }] }"
|
|
975
|
-
)), r && (i.push("$categorySlug: String!"),
|
|
1007
|
+
)), r && (i.push("$categorySlug: String!"), c.categorySlug = r, u.push("{ category: { slug: $categorySlug } }")), u.length && l.push(`where: {
|
|
976
1008
|
AND: [
|
|
977
|
-
${
|
|
1009
|
+
${u.join(`
|
|
978
1010
|
`)}
|
|
979
1011
|
]
|
|
980
1012
|
}`);
|
|
981
|
-
const
|
|
982
|
-
${
|
|
1013
|
+
const f = i.length ? `(${i.join(", ")})` : "", g = l.length ? `(
|
|
1014
|
+
${l.join(`
|
|
983
1015
|
`)}
|
|
984
|
-
)` : "",
|
|
985
|
-
query${
|
|
986
|
-
documentationArticleCollection${
|
|
1016
|
+
)` : "", y = `
|
|
1017
|
+
query${f} {
|
|
1018
|
+
documentationArticleCollection${g} {
|
|
1019
|
+
total
|
|
987
1020
|
items {
|
|
988
1021
|
sys {
|
|
989
1022
|
id
|
|
@@ -1010,31 +1043,34 @@ query${u} {
|
|
|
1010
1043
|
}
|
|
1011
1044
|
}
|
|
1012
1045
|
}
|
|
1013
|
-
`, { documentationArticleCollection:
|
|
1014
|
-
...
|
|
1046
|
+
`, { documentationArticleCollection: h } = await d.graphqlQuery(y, {
|
|
1047
|
+
...c
|
|
1015
1048
|
});
|
|
1016
1049
|
return {
|
|
1017
|
-
|
|
1050
|
+
page: o,
|
|
1051
|
+
total: h.total,
|
|
1052
|
+
size: n,
|
|
1053
|
+
items: h.items
|
|
1018
1054
|
};
|
|
1019
|
-
},
|
|
1055
|
+
}, $t = async ({
|
|
1020
1056
|
id: e,
|
|
1021
1057
|
slug: t,
|
|
1022
1058
|
marketCode: r,
|
|
1023
1059
|
language: s
|
|
1024
1060
|
}) => {
|
|
1025
|
-
const a = [],
|
|
1061
|
+
const a = [], o = {}, n = [];
|
|
1026
1062
|
if (e)
|
|
1027
|
-
a.push("$id: String!"),
|
|
1063
|
+
a.push("$id: String!"), o.id = e, n.push("{ sys: { id: $id } }");
|
|
1028
1064
|
else if (t)
|
|
1029
|
-
a.push("$slug: String!"),
|
|
1065
|
+
a.push("$slug: String!"), o.slug = t, n.push("{ slug: $slug }");
|
|
1030
1066
|
else
|
|
1031
1067
|
throw new Error("Either id or slug is required.");
|
|
1032
|
-
r && (a.push("$marketCode: String!"),
|
|
1068
|
+
r && (a.push("$marketCode: String!"), o.marketCode = r, n.push(
|
|
1033
1069
|
"{ OR: [{ market_exists: false }, { market: { code: $marketCode } }] }"
|
|
1034
|
-
)), s && (a.push("$language: String!"),
|
|
1070
|
+
)), s && (a.push("$language: String!"), o.language = s, n.push(
|
|
1035
1071
|
"{ OR: [{ language_exists: false }, { language: { code: $language } }] }"
|
|
1036
1072
|
));
|
|
1037
|
-
const
|
|
1073
|
+
const i = `(${a.join(", ")})`, c = `(
|
|
1038
1074
|
limit: 1
|
|
1039
1075
|
where: {
|
|
1040
1076
|
AND: [
|
|
@@ -1042,8 +1078,8 @@ query${u} {
|
|
|
1042
1078
|
`)}
|
|
1043
1079
|
]
|
|
1044
1080
|
}
|
|
1045
|
-
)`,
|
|
1046
|
-
query${
|
|
1081
|
+
)`, l = `
|
|
1082
|
+
query${i} {
|
|
1047
1083
|
documentationArticleCollection${c} {
|
|
1048
1084
|
items {
|
|
1049
1085
|
sys {
|
|
@@ -1080,34 +1116,43 @@ query${o} {
|
|
|
1080
1116
|
}
|
|
1081
1117
|
}
|
|
1082
1118
|
}
|
|
1083
|
-
`, { documentationArticleCollection:
|
|
1084
|
-
...
|
|
1085
|
-
}), f =
|
|
1119
|
+
`, { documentationArticleCollection: u } = await d.graphqlQuery(l, {
|
|
1120
|
+
...o
|
|
1121
|
+
}), f = u.items.at(0);
|
|
1086
1122
|
if (!f)
|
|
1087
|
-
throw new
|
|
1088
|
-
return
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
marketCode:
|
|
1093
|
-
language:
|
|
1123
|
+
throw new Q();
|
|
1124
|
+
return f;
|
|
1125
|
+
}, wt = async ({
|
|
1126
|
+
page: e = 1,
|
|
1127
|
+
size: t = 20,
|
|
1128
|
+
marketCode: r,
|
|
1129
|
+
language: s
|
|
1094
1130
|
} = {}) => {
|
|
1095
|
-
const
|
|
1096
|
-
|
|
1131
|
+
const a = Math.max(1, Math.floor(e)), o = Math.max(1, Math.floor(t)), n = ["$limit: Int!", "$skip: Int!"], i = {
|
|
1132
|
+
limit: o,
|
|
1133
|
+
skip: (a - 1) * o
|
|
1134
|
+
}, c = [];
|
|
1135
|
+
r && (n.push("$marketCode: String!"), i.marketCode = r, c.push(
|
|
1097
1136
|
"{ OR: [{ market_exists: false }, { market: { code: $marketCode } }] }"
|
|
1098
|
-
)),
|
|
1137
|
+
)), s && (n.push("$language: String!"), i.language = s, c.push(
|
|
1099
1138
|
"{ OR: [{ language_exists: false }, { language: { code: $language } }] }"
|
|
1100
1139
|
));
|
|
1101
|
-
const
|
|
1140
|
+
const l = n.length ? `(${n.join(", ")})` : "", u = c.length ? `(
|
|
1141
|
+
limit: $limit
|
|
1142
|
+
skip: $skip
|
|
1102
1143
|
where: {
|
|
1103
1144
|
AND: [
|
|
1104
|
-
${
|
|
1145
|
+
${c.join(`
|
|
1105
1146
|
`)}
|
|
1106
1147
|
]
|
|
1107
1148
|
}
|
|
1108
|
-
)` :
|
|
1109
|
-
|
|
1110
|
-
|
|
1149
|
+
)` : `(
|
|
1150
|
+
limit: $limit
|
|
1151
|
+
skip: $skip
|
|
1152
|
+
)`, f = `
|
|
1153
|
+
query${l} {
|
|
1154
|
+
hyperlinkCollectionCollection${u} {
|
|
1155
|
+
total
|
|
1111
1156
|
items {
|
|
1112
1157
|
sys {
|
|
1113
1158
|
id
|
|
@@ -1129,41 +1174,49 @@ query${i} {
|
|
|
1129
1174
|
}
|
|
1130
1175
|
}
|
|
1131
1176
|
}
|
|
1132
|
-
`, { hyperlinkCollectionCollection:
|
|
1133
|
-
|
|
1177
|
+
`, { hyperlinkCollectionCollection: g } = await d.graphqlQuery(
|
|
1178
|
+
f,
|
|
1134
1179
|
{
|
|
1135
|
-
...
|
|
1180
|
+
...i
|
|
1136
1181
|
}
|
|
1137
1182
|
);
|
|
1138
1183
|
return {
|
|
1139
|
-
|
|
1184
|
+
page: a,
|
|
1185
|
+
total: g.total,
|
|
1186
|
+
size: o,
|
|
1187
|
+
items: g.items
|
|
1140
1188
|
};
|
|
1141
|
-
},
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1189
|
+
}, St = async ({
|
|
1190
|
+
page: e = 1,
|
|
1191
|
+
size: t = 20,
|
|
1192
|
+
marketCode: r,
|
|
1193
|
+
language: s
|
|
1145
1194
|
} = {}) => {
|
|
1146
|
-
const
|
|
1147
|
-
limit:
|
|
1148
|
-
|
|
1149
|
-
|
|
1195
|
+
const a = Math.max(1, Math.floor(e)), o = Math.max(1, Math.floor(t)), n = ["$limit: Int!", "$skip: Int!"], i = {
|
|
1196
|
+
limit: o,
|
|
1197
|
+
skip: (a - 1) * o
|
|
1198
|
+
}, c = [];
|
|
1199
|
+
r && (n.push("$marketCode: String!"), i.marketCode = r, c.push(
|
|
1150
1200
|
"{ OR: [{ market_exists: false }, { market: { code: $marketCode } }] }"
|
|
1151
|
-
)),
|
|
1201
|
+
)), s && (n.push("$language: String!"), i.language = s, c.push(
|
|
1152
1202
|
"{ OR: [{ language_exists: false }, { language: { code: $language } }] }"
|
|
1153
1203
|
));
|
|
1154
|
-
const
|
|
1204
|
+
const l = `(${n.join(", ")})`, u = c.length ? `(
|
|
1155
1205
|
limit: $limit
|
|
1206
|
+
skip: $skip
|
|
1156
1207
|
where: {
|
|
1157
1208
|
AND: [
|
|
1158
|
-
${
|
|
1209
|
+
${c.join(`
|
|
1159
1210
|
`)}
|
|
1160
1211
|
]
|
|
1161
1212
|
}
|
|
1162
1213
|
)` : `(
|
|
1163
1214
|
limit: $limit
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1215
|
+
skip: $skip
|
|
1216
|
+
)`, f = `
|
|
1217
|
+
query${l} {
|
|
1218
|
+
keywordCollectionCollection${u} {
|
|
1219
|
+
total
|
|
1167
1220
|
items {
|
|
1168
1221
|
sys {
|
|
1169
1222
|
id
|
|
@@ -1174,23 +1227,26 @@ query${n} {
|
|
|
1174
1227
|
}
|
|
1175
1228
|
}
|
|
1176
1229
|
}
|
|
1177
|
-
`, { keywordCollectionCollection:
|
|
1178
|
-
...
|
|
1230
|
+
`, { keywordCollectionCollection: g } = await d.graphqlQuery(f, {
|
|
1231
|
+
...i
|
|
1179
1232
|
});
|
|
1180
1233
|
return {
|
|
1181
|
-
|
|
1234
|
+
page: a,
|
|
1235
|
+
total: g.total,
|
|
1236
|
+
size: o,
|
|
1237
|
+
items: g.items
|
|
1182
1238
|
};
|
|
1183
1239
|
};
|
|
1184
1240
|
export {
|
|
1185
|
-
|
|
1241
|
+
d as ContentfulSDK,
|
|
1186
1242
|
yt as getBlogPostDetail,
|
|
1187
|
-
|
|
1243
|
+
$t as getDocArticleDetail,
|
|
1188
1244
|
bt as getDocCategoryDetail,
|
|
1189
1245
|
pt as listBannerCollections,
|
|
1190
1246
|
ht as listBlogPosts,
|
|
1191
|
-
|
|
1247
|
+
mt as listBrandCollections,
|
|
1192
1248
|
vt as listDocArticles,
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1249
|
+
dt as listDocCategories,
|
|
1250
|
+
wt as listHyperlinkCollections,
|
|
1251
|
+
St as listKeywordCollections
|
|
1196
1252
|
};
|