@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/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- var $e = Function.prototype.toString, C = Object.create, Ce = Object.prototype.toString, Oe = (
1
+ var we = Function.prototype.toString, C = Object.create, Se = Object.prototype.toString, Ce = (
2
2
  /** @class */
3
3
  (function() {
4
4
  function e() {
@@ -13,83 +13,83 @@ var $e = Function.prototype.toString, C = Object.create, Ce = Object.prototype.t
13
13
  }, e;
14
14
  })()
15
15
  );
16
- function Se() {
17
- return new Oe();
16
+ function Oe() {
17
+ return new Ce();
18
18
  }
19
19
  function je() {
20
20
  return /* @__PURE__ */ new WeakMap();
21
21
  }
22
- var Ae = typeof WeakMap < "u" ? je : Se;
23
- function B(e) {
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 && ~$e.call(t).indexOf("[native code]"))
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 Te(e) {
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 _e(e) {
40
+ function Te(e) {
41
41
  return e.flags;
42
42
  }
43
- var qe = /test/g.flags === "g" ? _e : Te;
43
+ var _e = /test/g.flags === "g" ? Te : Ae;
44
44
  function ae(e) {
45
- var t = Ce.call(e);
45
+ var t = Se.call(e);
46
46
  return t.substring(8, t.length - 1);
47
47
  }
48
- function ke(e) {
48
+ function qe(e) {
49
49
  return e[Symbol.toStringTag] || ae(e);
50
50
  }
51
- var Pe = typeof Symbol < "u" ? ke : ae, Re = Object.defineProperty, De = Object.getOwnPropertyDescriptor, se = Object.getOwnPropertyNames, V = Object.getOwnPropertySymbols, ce = Object.prototype, ue = ce.hasOwnProperty, xe = ce.propertyIsEnumerable, le = typeof V == "function";
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(V(e));
53
+ return se(e).concat(B(e));
54
54
  }
55
- var Ee = le ? Ie : se;
56
- function $(e, t, r) {
57
- for (var s = Ee(e), a = 0, i = s.length, n = void 0, o = void 0; a < i; ++a)
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 (o = De(e, n), !o) {
59
+ if (i = Re(e, n), !i) {
60
60
  t[n] = r.copier(e[n], r);
61
61
  continue;
62
62
  }
63
- !o.get && !o.set && (o.value = r.copier(o.value, r));
63
+ !i.get && !i.set && (i.value = r.copier(i.value, r));
64
64
  try {
65
- Re(t, n, o);
65
+ xe(t, n, i);
66
66
  } catch {
67
- t[n] = o.value;
67
+ t[n] = i.value;
68
68
  }
69
69
  }
70
70
  return t;
71
71
  }
72
- function Le(e, t) {
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 Ne(e, t) {
79
+ function Ee(e, t) {
80
80
  var r = new t.Constructor();
81
- return t.cache.set(e, r), $(e, r, t);
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 Be(e, t) {
86
+ function Le(e, t) {
87
87
  return e.slice(0, e.size, e.type);
88
88
  }
89
- function Ve(e, t) {
89
+ function Ne(e, t) {
90
90
  return new t.Constructor(fe(e.buffer));
91
91
  }
92
- function Qe(e, t) {
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 Fe(e, t) {
102
- return $(e, ge(e, t), t);
101
+ function Ve(e, t) {
102
+ return S(e, ge(e, t), t);
103
103
  }
104
- function Ge(e, t) {
105
- var r = B(t.prototype);
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
- ue.call(e, s) && (r[s] = t.copier(e[s], t));
108
+ le.call(e, s) && (r[s] = t.copier(e[s], t));
109
109
  return r;
110
110
  }
111
- function Me(e, t) {
112
- var r = B(t.prototype);
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
- ue.call(e, s) && (r[s] = t.copier(e[s], t));
116
- for (var a = V(e), i = 0, n = a.length, o = void 0; i < n; ++i)
117
- o = a[i], xe.call(e, o) && (r[o] = t.copier(e[o], t));
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 Ue = le ? Me : Ge;
121
- function Ke(e, t) {
122
- var r = B(t.prototype);
123
- return t.cache.set(e, r), $(e, r, t);
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 We(e, t) {
129
- var r = new t.Constructor(e.source, qe(e));
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 ze(e, t) {
142
- return $(e, pe(e, t), t);
141
+ function We(e, t) {
142
+ return S(e, pe(e, t), t);
143
143
  }
144
- var Je = Array.isArray, Q = Object.assign, He = Object.getPrototypeOf || (function(e) {
144
+ var Je = Array.isArray, V = Object.assign, He = Object.getPrototypeOf || (function(e) {
145
145
  return e.__proto__;
146
146
  }), he = {
147
- array: Le,
147
+ array: ze,
148
148
  arrayBuffer: fe,
149
- blob: Be,
150
- dataView: Ve,
151
- date: Qe,
149
+ blob: Le,
150
+ dataView: Ne,
151
+ date: Be,
152
152
  error: w,
153
153
  map: ge,
154
- object: Ue,
155
- regExp: We,
154
+ object: Ge,
155
+ regExp: Ke,
156
156
  set: pe
157
- }, Ye = Q({}, he, {
158
- array: Ne,
159
- map: Fe,
160
- object: Ke,
161
- set: ze
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 = Q({}, he, e), r = Xe(t), s = r.Array, a = r.Object;
196
- function i(n, o) {
197
- if (o.prototype = o.Constructor = void 0, !n || typeof n != "object")
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 (o.cache.has(n))
200
- return o.cache.get(n);
201
- if (o.prototype = He(n), o.Constructor = o.prototype && o.prototype.constructor, !o.Constructor || o.Constructor === Object)
202
- return a(n, o);
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, o);
204
+ return s(n, i);
205
205
  var c = r[Pe(n)];
206
- return c ? c(n, o) : typeof n.then == "function" ? n : a(n, o);
206
+ return c ? c(n, i) : typeof n.then == "function" ? n : a(n, i);
207
207
  }
208
- return function(o) {
209
- return i(o, {
208
+ return function(i) {
209
+ return o(i, {
210
210
  Constructor: void 0,
211
- cache: Ae(),
212
- copier: i,
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(Q({}, Ye, e));
218
+ return ye(V({}, Ye, e));
219
219
  }
220
220
  Ze({});
221
221
  ye({});
222
- var b = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, S = { exports: {} }, M;
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 (M) return S.exports;
225
- M = 1;
226
- var e = S.exports = {}, t, r;
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 i(g) {
245
+ function o(p) {
246
246
  if (t === setTimeout)
247
- return setTimeout(g, 0);
247
+ return setTimeout(p, 0);
248
248
  if ((t === s || !t) && setTimeout)
249
- return t = setTimeout, setTimeout(g, 0);
249
+ return t = setTimeout, setTimeout(p, 0);
250
250
  try {
251
- return t(g, 0);
251
+ return t(p, 0);
252
252
  } catch {
253
253
  try {
254
- return t.call(null, g, 0);
254
+ return t.call(null, p, 0);
255
255
  } catch {
256
- return t.call(this, g, 0);
256
+ return t.call(this, p, 0);
257
257
  }
258
258
  }
259
259
  }
260
- function n(g) {
260
+ function n(p) {
261
261
  if (r === clearTimeout)
262
- return clearTimeout(g);
262
+ return clearTimeout(p);
263
263
  if ((r === a || !r) && clearTimeout)
264
- return r = clearTimeout, clearTimeout(g);
264
+ return r = clearTimeout, clearTimeout(p);
265
265
  try {
266
- return r(g);
266
+ return r(p);
267
267
  } catch {
268
268
  try {
269
- return r.call(null, g);
269
+ return r.call(null, p);
270
270
  } catch {
271
- return r.call(this, g);
271
+ return r.call(this, p);
272
272
  }
273
273
  }
274
274
  }
275
- var o = [], c = !1, u, l = -1;
275
+ var i = [], c = !1, l, u = -1;
276
276
  function f() {
277
- !c || !u || (c = !1, u.length ? o = u.concat(o) : l = -1, o.length && y());
277
+ !c || !l || (c = !1, l.length ? i = l.concat(i) : u = -1, i.length && g());
278
278
  }
279
- function y() {
279
+ function g() {
280
280
  if (!c) {
281
- var g = i(f);
281
+ var p = o(f);
282
282
  c = !0;
283
- for (var p = o.length; p; ) {
284
- for (u = o, o = []; ++l < p; )
285
- u && u[l].run();
286
- l = -1, p = o.length;
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
- u = null, c = !1, n(g);
288
+ l = null, c = !1, n(p);
289
289
  }
290
290
  }
291
- e.nextTick = function(g) {
292
- var p = new Array(arguments.length - 1);
291
+ e.nextTick = function(p) {
292
+ var m = new Array(arguments.length - 1);
293
293
  if (arguments.length > 1)
294
- for (var m = 1; m < arguments.length; m++)
295
- p[m - 1] = arguments[m];
296
- o.push(new G(g, p)), o.length === 1 && !c && i(y);
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 G(g, p) {
299
- this.fun = g, this.array = p;
298
+ function y(p, m) {
299
+ this.fun = p, this.array = m;
300
300
  }
301
- G.prototype.run = function() {
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 d() {
304
+ function h() {
305
305
  }
306
- return e.on = d, e.addListener = d, e.once = d, e.off = d, e.removeListener = d, e.removeAllListeners = d, e.emit = d, e.prependListener = d, e.prependOnceListener = d, e.listeners = function(g) {
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(g) {
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(g) {
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
- }, S.exports;
316
+ }, j.exports;
317
317
  }
318
318
  et();
319
- var j, U;
319
+ var k, G;
320
320
  function tt() {
321
- if (U) return j;
322
- U = 1;
323
- var e = typeof b == "object" && b && b.Object === Object && b;
324
- return j = e, j;
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, K;
326
+ var A, U;
327
327
  function rt() {
328
- if (K) return A;
329
- K = 1;
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, W;
334
- function de() {
335
- if (W) return T;
336
- W = 1;
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 _, z;
340
+ var _, W;
341
341
  function nt() {
342
- if (z) return _;
343
- z = 1;
344
- var e = de(), t = Object.prototype, r = t.hasOwnProperty, s = t.toString, a = e ? e.toStringTag : void 0;
345
- function i(n) {
346
- var o = r.call(n, a), c = n[a];
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 u = !0;
349
+ var l = !0;
350
350
  } catch {
351
351
  }
352
- var l = s.call(n);
353
- return u && (o ? n[a] = c : delete n[a]), l;
352
+ var u = s.call(n);
353
+ return l && (i ? n[a] = c : delete n[a]), u;
354
354
  }
355
- return _ = i, _;
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 k, H;
368
- function me() {
369
- if (H) return k;
367
+ var P, H;
368
+ function de() {
369
+ if (H) return P;
370
370
  H = 1;
371
- var e = de(), t = nt(), r = it(), s = "[object Null]", a = "[object Undefined]", i = e ? e.toStringTag : void 0;
372
- function n(o) {
373
- return o == null ? o === void 0 ? a : s : i && i in Object(o) ? t(o) : r(o);
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 k = n, k;
375
+ return P = n, P;
376
376
  }
377
- var P, Y;
377
+ var x, Y;
378
378
  function ot() {
379
- if (Y) return P;
379
+ if (Y) return x;
380
380
  Y = 1;
381
381
  var e = Array.isArray;
382
- return P = e, P;
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 = me(), t = ot(), r = be(), s = "[object String]";
398
- function a(i) {
399
- return typeof i == "string" || !t(i) && r(i) && e(i) == s;
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 x, ee;
404
+ var I, ee;
405
405
  function st() {
406
- if (ee) return x;
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 x = e, x;
413
+ return I = e, I;
414
414
  }
415
- var I, te;
415
+ var M, te;
416
416
  function ct() {
417
- if (te) return I;
417
+ if (te) return M;
418
418
  te = 1;
419
419
  var e = st(), t = e(Object.getPrototypeOf, Object);
420
- return I = t, I;
420
+ return M = t, M;
421
421
  }
422
- var E, re;
423
- function ut() {
424
- if (re) return E;
422
+ var z, re;
423
+ function lt() {
424
+ if (re) return z;
425
425
  re = 1;
426
- var e = me(), t = ct(), r = be(), s = "[object Object]", a = Function.prototype, i = Object.prototype, n = a.toString, o = i.hasOwnProperty, c = n.call(Object);
427
- function u(l) {
428
- if (!r(l) || e(l) != s)
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(l);
430
+ var f = t(u);
431
431
  if (f === null)
432
432
  return !0;
433
- var y = o.call(f, "constructor") && f.constructor;
434
- return typeof y == "function" && y instanceof y && n.call(y) == c;
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 E = u, E;
436
+ return z = l, z;
437
437
  }
438
- ut();
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 }, we = { 0: 8203, 1: 8204, 2: 8205, 3: 65279 };
440
- new Array(4).fill(String.fromCodePoint(we[0])).join("");
441
- Object.fromEntries(Object.entries(we).map((e) => e.reverse()));
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 L, ne;
445
- function lt() {
446
- if (ne) return L;
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 L = function(r, s, a) {
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 i = r.length;
453
- if (i === +i)
454
- for (var n = 0; n < i; 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 o in r)
458
- e.call(r, o) && s.call(a, r[o], o, r);
459
- }, L;
457
+ for (var i in r)
458
+ e.call(r, i) && s.call(a, r[i], i, r);
459
+ }, E;
460
460
  }
461
- var N, ie;
461
+ var L, ie;
462
462
  function ft() {
463
- if (ie) return N;
463
+ if (ie) return L;
464
464
  ie = 1;
465
- var e = lt();
466
- N = t;
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 i = t.bind(t, r);
472
+ var o = t.bind(t, r);
473
473
  for (var n in t)
474
- t.hasOwnProperty(n) && (i[n] = t[n].bind(i, r));
475
- return i;
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), i = 0; i < a.length; ++i) {
479
- var n = a[i];
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 i = Array.isArray(s) ? s : t.parse(s), n = i[0];
487
- if (i.length === 0)
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 o = 0; o < i.length - 1; ++o) {
490
- var c = i[o];
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[o + 1], c in r || (n.match(/^(\d+|-)$/) ? r[c] = [] : r[c] = {}), r = r[c]);
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), i = a[a.length - 1];
496
- if (i === void 0)
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 o = +i;
501
- if (i === "" && isNaN(o))
502
- throw new Error('Invalid array index: "' + i + '"');
503
- Array.prototype.splice.call(n, o, 1);
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[i];
505
+ delete n[o];
506
506
  }, t.dict = function(r, s) {
507
507
  var a = {};
508
- return t.walk(r, function(i, n) {
509
- a[n] = i;
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 i = [];
512
+ var o = [];
513
513
  a = a || function(n) {
514
- var o = Object.prototype.toString.call(n);
515
- return o === "[object Object]" || o === "[object Array]";
516
- }, (function n(o) {
517
- e(o, function(c, u) {
518
- i.push(String(u)), a(c) ? n(c) : s(c, t.compile(i)), i.pop();
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
- }, N;
540
+ }, L;
541
541
  }
542
542
  ft();
543
- var v = { exports: {} }, oe;
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, i, n, o) {
548
- return JSON.stringify(a, s(i, o), n);
547
+ function r(a, o, n, i) {
548
+ return JSON.stringify(a, s(o, i), n);
549
549
  }
550
- function s(a, i) {
551
- var n = [], o = [];
552
- return i == null && (i = function(c, u) {
553
- return n[0] === u ? "[Circular ~]" : "[Circular ~." + o.slice(0, n.indexOf(u)).join(".") + "]";
554
- }), function(c, u) {
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 l = n.indexOf(this);
557
- ~l ? n.splice(l + 1) : n.push(this), ~l ? o.splice(l, 1 / 0, c) : o.push(c), ~n.indexOf(u) && (u = i.call(this, c, u));
558
- } else n.push(u);
559
- return a == null ? u : a.call(this, c, u);
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
- })(v, v.exports)), v.exports;
562
+ })($, $.exports)), $.exports;
563
563
  }
564
564
  gt();
565
- class h {
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: i = "master" } = this.clientParams, n = await fetch(
581
- `https://graphql.contentful.com/content/v1/spaces/${s}/environments/${i}`,
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 o = await n.json();
599
- if (o.errors)
598
+ const i = await n.json();
599
+ if (i.errors)
600
600
  throw new Error(
601
- `GraphQL errors: ${JSON.stringify(o.errors, null, 2)}`
601
+ `GraphQL errors: ${JSON.stringify(i.errors, null, 2)}`
602
602
  );
603
- return o.data;
603
+ return i.data;
604
604
  }
605
605
  }
606
606
  const pt = async ({
607
607
  slot: e,
608
- limit: t = 20,
609
- platform: r,
610
- marketCode: s,
611
- language: a
608
+ page: t = 1,
609
+ size: r = 20,
610
+ platform: s,
611
+ marketCode: a,
612
+ language: o
612
613
  }) => {
613
- const i = ["$slot: String!", "$limit: Int!"], n = {
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: t
616
- }, o = ["{ slot: $slot }"];
617
- r && (i.push("$platform: String!"), n.platform = r, o.push("{ platform_contains_some: [$platform] }")), s && (i.push("$marketCode: String!"), n.marketCode = s, o.push(
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
- )), a && (i.push("$language: String!"), n.language = a, o.push(
625
+ )), o && (c.push("$language: String!"), l.language = o, u.push(
620
626
  "{ OR: [{ language_exists: false }, { language: { code: $language } }] }"
621
627
  ));
622
- const c = `(${i.join(", ")})`, u = `(
628
+ const f = `(${c.join(", ")})`, g = `(
623
629
  limit: $limit
630
+ skip: $skip
624
631
  where: {
625
632
  AND: [
626
- ${o.join(`
633
+ ${u.join(`
627
634
  `)}
628
635
  ]
629
636
  }
630
- )`, l = `
631
- query${c} {
632
- bannerCollectionCollection${u} {
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: f } = await h.graphqlQuery(l, {
667
- ...n
674
+ `, { bannerCollectionCollection: h } = await d.graphqlQuery(y, {
675
+ ...l
668
676
  });
669
677
  return {
670
- data: f.items
678
+ page: n,
679
+ total: h.total,
680
+ size: i,
681
+ items: h.items
671
682
  };
672
683
  };
673
- class F extends Response {
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
- limit: r,
685
- skip: s
695
+ page: r = 1,
696
+ size: s = 20
686
697
  } = {}) => {
687
- const a = [], i = {}, n = [], o = [];
688
- e && (a.push("$marketCode: String!"), i.marketCode = e, o.push(
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 && (a.push("$language: String!"), i.language = t, o.push(
704
+ )), t && (n.push("$language: String!"), i.language = t, l.push(
691
705
  "{ OR: [{ language_exists: false }, { language: { code: $language } }] }"
692
- )), typeof r == "number" && (a.push("$limit: Int!"), i.limit = r, n.push("limit: $limit")), typeof s == "number" && (a.push("$skip: Int!"), i.skip = s, n.push("skip: $skip")), o.length && n.push(`where: {
706
+ )), l.length && c.push(`where: {
693
707
  AND: [
694
- ${o.join(`
708
+ ${l.join(`
695
709
  `)}
696
710
  ]
697
711
  }`);
698
- const c = a.length ? `(${a.join(", ")})` : "", u = n.length ? `(
699
- ${n.join(`
712
+ const u = n.length ? `(${n.join(", ")})` : "", f = c.length ? `(
713
+ ${c.join(`
700
714
  `)}
701
- )` : "", l = `
702
- query${c} {
703
- blogPostCollection${u} {
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: f } = await h.graphqlQuery(l, {
741
+ `, { blogPostCollection: y } = await d.graphqlQuery(g, {
727
742
  ...i
728
743
  });
729
744
  return {
730
- data: f.items
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 = [], i = {}, n = [];
756
+ const a = [], o = {}, n = [];
739
757
  if (e)
740
- a.push("$id: String!"), i.id = e, n.push("{ sys: { id: $id } }");
758
+ a.push("$id: String!"), o.id = e, n.push("{ sys: { id: $id } }");
741
759
  else if (t)
742
- a.push("$slug: String!"), i.slug = t, n.push("{ slug: $slug }");
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!"), i.marketCode = r, n.push(
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!"), i.language = s, n.push(
765
+ )), s && (a.push("$language: String!"), o.language = s, n.push(
748
766
  "{ OR: [{ language_exists: false }, { language: { code: $language } }] }"
749
767
  ));
750
- const o = `(${a.join(", ")})`, c = `(
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
- )`, u = `
759
- query${o} {
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: l } = await h.graphqlQuery(u, {
802
- ...i
803
- }), f = l.items.at(0);
819
+ `, { blogPostCollection: u } = await d.graphqlQuery(l, {
820
+ ...o
821
+ }), f = u.items.at(0);
804
822
  if (!f)
805
- throw new F();
806
- return {
807
- data: f
808
- };
809
- }, dt = async ({
810
- limit: e = 20,
811
- marketCode: t,
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 s = ["$limit: Int!"], a = {
815
- limit: e
816
- }, i = [];
817
- t && (s.push("$marketCode: String!"), a.marketCode = t, i.push(
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
- )), r && (s.push("$language: String!"), a.language = r, i.push(
837
+ )), s && (n.push("$language: String!"), i.language = s, c.push(
820
838
  "{ OR: [{ language_exists: false }, { language: { code: $language } }] }"
821
839
  ));
822
- const n = `(${s.join(", ")})`, o = i.length ? `(
840
+ const l = `(${n.join(", ")})`, u = c.length ? `(
823
841
  limit: $limit
842
+ skip: $skip
824
843
  where: {
825
844
  AND: [
826
- ${i.join(`
845
+ ${c.join(`
827
846
  `)}
828
847
  ]
829
848
  }
830
849
  )` : `(
831
850
  limit: $limit
832
- )`, c = `
833
- query${n} {
834
- brandCollectionCollection${o} {
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: u } = await h.graphqlQuery(c, {
854
- ...a
874
+ `, { brandCollectionCollection: g } = await d.graphqlQuery(f, {
875
+ ...i
855
876
  });
856
877
  return {
857
- data: u.items
878
+ page: a,
879
+ total: g.total,
880
+ size: o,
881
+ items: g.items
858
882
  };
859
- }, mt = async ({
883
+ }, dt = async ({
860
884
  marketCode: e,
861
885
  language: t,
862
- limit: r,
863
- skip: s
886
+ page: r = 1,
887
+ size: s = 20
864
888
  } = {}) => {
865
- const a = [], i = {}, n = [], o = [];
866
- e && (a.push("$marketCode: String!"), i.marketCode = e, o.push(
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 && (a.push("$language: String!"), i.language = t, o.push(
895
+ )), t && (n.push("$language: String!"), i.language = t, l.push(
869
896
  "{ OR: [{ language_exists: false }, { language: { code: $language } }] }"
870
- )), typeof r == "number" && (a.push("$limit: Int!"), i.limit = r, n.push("limit: $limit")), typeof s == "number" && (a.push("$skip: Int!"), i.skip = s, n.push("skip: $skip")), o.length && n.push(`where: {
897
+ )), l.length && c.push(`where: {
871
898
  AND: [
872
- ${o.join(`
899
+ ${l.join(`
873
900
  `)}
874
901
  ]
875
902
  }`);
876
- const c = a.length ? `(${a.join(", ")})` : "", u = n.length ? `(
877
- ${n.join(`
903
+ const u = n.length ? `(${n.join(", ")})` : "", f = c.length ? `(
904
+ ${c.join(`
878
905
  `)}
879
- )` : "", l = `
880
- query${c} {
881
- documentationCategoryCollection${u} {
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: f } = await h.graphqlQuery(l, {
929
+ `, { documentationCategoryCollection: y } = await d.graphqlQuery(g, {
902
930
  ...i
903
931
  });
904
932
  return {
905
- data: f.items
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 = [], i = {}, n = [];
944
+ const a = [], o = {}, n = [];
914
945
  if (e)
915
- a.push("$id: String!"), i.id = e, n.push("{ sys: { id: $id } }");
946
+ a.push("$id: String!"), o.id = e, n.push("{ sys: { id: $id } }");
916
947
  else if (t)
917
- a.push("$slug: String!"), i.slug = t, n.push("{ slug: $slug }");
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!"), i.marketCode = r, n.push(
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!"), i.language = s, n.push(
953
+ )), s && (a.push("$language: String!"), o.language = s, n.push(
923
954
  "{ OR: [{ language_exists: false }, { language: { code: $language } }] }"
924
955
  ));
925
- const o = `(${a.join(", ")})`, c = `(
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
- )`, u = `
934
- query${o} {
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: l } = await h.graphqlQuery(u, {
956
- ...i
957
- }), f = l.items.at(0);
986
+ `, { documentationCategoryCollection: u } = await d.graphqlQuery(l, {
987
+ ...o
988
+ }), f = u.items.at(0);
958
989
  if (!f)
959
- throw new F();
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
- limit: s,
968
- skip: a
996
+ page: s = 1,
997
+ size: a = 20
969
998
  } = {}) => {
970
- const i = [], n = {}, o = [], c = [];
971
- e && (i.push("$marketCode: String!"), n.marketCode = e, c.push(
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!"), n.language = t, c.push(
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!"), n.categorySlug = r, c.push("{ category: { slug: $categorySlug } }")), typeof s == "number" && (i.push("$limit: Int!"), n.limit = s, o.push("limit: $limit")), typeof a == "number" && (i.push("$skip: Int!"), n.skip = a, o.push("skip: $skip")), c.length && o.push(`where: {
1007
+ )), r && (i.push("$categorySlug: String!"), c.categorySlug = r, u.push("{ category: { slug: $categorySlug } }")), u.length && l.push(`where: {
976
1008
  AND: [
977
- ${c.join(`
1009
+ ${u.join(`
978
1010
  `)}
979
1011
  ]
980
1012
  }`);
981
- const u = i.length ? `(${i.join(", ")})` : "", l = o.length ? `(
982
- ${o.join(`
1013
+ const f = i.length ? `(${i.join(", ")})` : "", g = l.length ? `(
1014
+ ${l.join(`
983
1015
  `)}
984
- )` : "", f = `
985
- query${u} {
986
- documentationArticleCollection${l} {
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: y } = await h.graphqlQuery(f, {
1014
- ...n
1046
+ `, { documentationArticleCollection: h } = await d.graphqlQuery(y, {
1047
+ ...c
1015
1048
  });
1016
1049
  return {
1017
- data: y.items
1050
+ page: o,
1051
+ total: h.total,
1052
+ size: n,
1053
+ items: h.items
1018
1054
  };
1019
- }, wt = async ({
1055
+ }, $t = async ({
1020
1056
  id: e,
1021
1057
  slug: t,
1022
1058
  marketCode: r,
1023
1059
  language: s
1024
1060
  }) => {
1025
- const a = [], i = {}, n = [];
1061
+ const a = [], o = {}, n = [];
1026
1062
  if (e)
1027
- a.push("$id: String!"), i.id = e, n.push("{ sys: { id: $id } }");
1063
+ a.push("$id: String!"), o.id = e, n.push("{ sys: { id: $id } }");
1028
1064
  else if (t)
1029
- a.push("$slug: String!"), i.slug = t, n.push("{ slug: $slug }");
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!"), i.marketCode = r, n.push(
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!"), i.language = s, n.push(
1070
+ )), s && (a.push("$language: String!"), o.language = s, n.push(
1035
1071
  "{ OR: [{ language_exists: false }, { language: { code: $language } }] }"
1036
1072
  ));
1037
- const o = `(${a.join(", ")})`, c = `(
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
- )`, u = `
1046
- query${o} {
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: l } = await h.graphqlQuery(u, {
1084
- ...i
1085
- }), f = l.items.at(0);
1119
+ `, { documentationArticleCollection: u } = await d.graphqlQuery(l, {
1120
+ ...o
1121
+ }), f = u.items.at(0);
1086
1122
  if (!f)
1087
- throw new F();
1088
- return {
1089
- data: f
1090
- };
1091
- }, $t = async ({
1092
- marketCode: e,
1093
- language: t
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 r = [], s = {}, a = [];
1096
- e && (r.push("$marketCode: String!"), s.marketCode = e, a.push(
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
- )), t && (r.push("$language: String!"), s.language = t, a.push(
1137
+ )), s && (n.push("$language: String!"), i.language = s, c.push(
1099
1138
  "{ OR: [{ language_exists: false }, { language: { code: $language } }] }"
1100
1139
  ));
1101
- const i = r.length ? `(${r.join(", ")})` : "", n = a.length ? `(
1140
+ const l = n.length ? `(${n.join(", ")})` : "", u = c.length ? `(
1141
+ limit: $limit
1142
+ skip: $skip
1102
1143
  where: {
1103
1144
  AND: [
1104
- ${a.join(`
1145
+ ${c.join(`
1105
1146
  `)}
1106
1147
  ]
1107
1148
  }
1108
- )` : "", o = `
1109
- query${i} {
1110
- hyperlinkCollectionCollection${n} {
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: c } = await h.graphqlQuery(
1133
- o,
1177
+ `, { hyperlinkCollectionCollection: g } = await d.graphqlQuery(
1178
+ f,
1134
1179
  {
1135
- ...s
1180
+ ...i
1136
1181
  }
1137
1182
  );
1138
1183
  return {
1139
- data: c.items
1184
+ page: a,
1185
+ total: g.total,
1186
+ size: o,
1187
+ items: g.items
1140
1188
  };
1141
- }, Ct = async ({
1142
- limit: e = 20,
1143
- marketCode: t,
1144
- language: r
1189
+ }, St = async ({
1190
+ page: e = 1,
1191
+ size: t = 20,
1192
+ marketCode: r,
1193
+ language: s
1145
1194
  } = {}) => {
1146
- const s = ["$limit: Int!"], a = {
1147
- limit: e
1148
- }, i = [];
1149
- t && (s.push("$marketCode: String!"), a.marketCode = t, i.push(
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
- )), r && (s.push("$language: String!"), a.language = r, i.push(
1201
+ )), s && (n.push("$language: String!"), i.language = s, c.push(
1152
1202
  "{ OR: [{ language_exists: false }, { language: { code: $language } }] }"
1153
1203
  ));
1154
- const n = `(${s.join(", ")})`, o = i.length ? `(
1204
+ const l = `(${n.join(", ")})`, u = c.length ? `(
1155
1205
  limit: $limit
1206
+ skip: $skip
1156
1207
  where: {
1157
1208
  AND: [
1158
- ${i.join(`
1209
+ ${c.join(`
1159
1210
  `)}
1160
1211
  ]
1161
1212
  }
1162
1213
  )` : `(
1163
1214
  limit: $limit
1164
- )`, c = `
1165
- query${n} {
1166
- keywordCollectionCollection${o} {
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: u } = await h.graphqlQuery(c, {
1178
- ...a
1230
+ `, { keywordCollectionCollection: g } = await d.graphqlQuery(f, {
1231
+ ...i
1179
1232
  });
1180
1233
  return {
1181
- data: u.items
1234
+ page: a,
1235
+ total: g.total,
1236
+ size: o,
1237
+ items: g.items
1182
1238
  };
1183
1239
  };
1184
1240
  export {
1185
- h as ContentfulSDK,
1241
+ d as ContentfulSDK,
1186
1242
  yt as getBlogPostDetail,
1187
- wt as getDocArticleDetail,
1243
+ $t as getDocArticleDetail,
1188
1244
  bt as getDocCategoryDetail,
1189
1245
  pt as listBannerCollections,
1190
1246
  ht as listBlogPosts,
1191
- dt as listBrandCollections,
1247
+ mt as listBrandCollections,
1192
1248
  vt as listDocArticles,
1193
- mt as listDocCategories,
1194
- $t as listHyperlinkCollections,
1195
- Ct as listKeywordCollections
1249
+ dt as listDocCategories,
1250
+ wt as listHyperlinkCollections,
1251
+ St as listKeywordCollections
1196
1252
  };