contentful 10.11.12 → 11.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.
@@ -5061,7 +5061,7 @@ function createClient(params) {
5061
5061
  environment: 'master',
5062
5062
  };
5063
5063
  const config = Object.assign(Object.assign({}, defaultConfig), params);
5064
- const userAgentHeader = (0,contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__.getUserAgentHeader)(`contentful.js/${"10.11.12"}`, config.application, config.integration);
5064
+ const userAgentHeader = (0,contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__.getUserAgentHeader)(`contentful.js/${"11.0.0"}`, config.application, config.integration);
5065
5065
  config.headers = Object.assign(Object.assign({}, config.headers), { 'Content-Type': 'application/vnd.contentful.delivery.v1+json', 'X-Contentful-User-Agent': userAgentHeader });
5066
5066
  const http = (0,contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__.createHttpClient)(axios__WEBPACK_IMPORTED_MODULE_4__["default"], config);
5067
5067
  if (!http.defaults.baseURL) {
@@ -5407,7 +5407,7 @@ function createContentfulApi({ http, getGlobalOptions }, options) {
5407
5407
  http.defaults.baseURL = getGlobalOptions().environmentBaseUrl;
5408
5408
  }
5409
5409
  return {
5410
- version: "10.11.12",
5410
+ version: "11.0.0",
5411
5411
  getSpace,
5412
5412
  getContentType,
5413
5413
  getContentTypes,
@@ -16975,14 +16975,14 @@ __webpack_require__.r(__webpack_exports__);
16975
16975
  /* harmony export */ encodeField: function() { return /* binding */ C; },
16976
16976
  /* harmony export */ encodeGraphQLResponse: function() { return /* binding */ ie; },
16977
16977
  /* harmony export */ encodeRichTextValue: function() { return /* binding */ ne; },
16978
- /* harmony export */ isBuiltinNamespace: function() { return /* binding */ F; },
16979
- /* harmony export */ isSupportedWidget: function() { return /* binding */ V; },
16978
+ /* harmony export */ isBuiltinNamespace: function() { return /* binding */ V; },
16979
+ /* harmony export */ isSupportedWidget: function() { return /* binding */ W; },
16980
16980
  /* harmony export */ splitEncoding: function() { return /* binding */ ce; }
16981
16981
  /* harmony export */ });
16982
- var J = { 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 }, x = { 0: 8203, 1: 8204, 2: 8205, 3: 65279 }, R = new Array(4).fill(String.fromCodePoint(x[0])).join(""), L = "\0";
16983
- function k(e) {
16982
+ var R = { 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 }, x = { 0: 8203, 1: 8204, 2: 8205, 3: 65279 }, k = new Array(4).fill(String.fromCodePoint(x[0])).join(""), M = "\0";
16983
+ function _(e) {
16984
16984
  let t = JSON.stringify(e);
16985
- return `${R}${Array.from(t).map((o) => {
16985
+ return `${k}${Array.from(t).map((o) => {
16986
16986
  let n = o.charCodeAt(0);
16987
16987
  if (n > 255)
16988
16988
  throw new Error(`Only ASCII edit info can be encoded. Error attempting to encode ${t} on character ${o} (${n})`);
@@ -17001,9 +17001,9 @@ function D(e) {
17001
17001
  return !0;
17002
17002
  }
17003
17003
  function Q(e, t, o = "auto") {
17004
- return o === !0 || o === "auto" && (B(e) || D(e)) ? e : `${e}${k(t)}`;
17004
+ return o === !0 || o === "auto" && (B(e) || D(e)) ? e : `${e}${_(t)}`;
17005
17005
  }
17006
- var z = Object.fromEntries(Object.entries(x).map((e) => e.reverse())), M = Object.fromEntries(Object.entries(J).map((e) => e.reverse())), G = `${Object.values(J).map((e) => `\\u{${e.toString(16)}}`).join("")}`, N = new RegExp(`[${G}]{4,}`, "gu");
17006
+ var z = Object.fromEntries(Object.entries(x).map((e) => e.reverse())), J = Object.fromEntries(Object.entries(R).map((e) => e.reverse())), G = `${Object.values(R).map((e) => `\\u{${e.toString(16)}}`).join("")}`, N = new RegExp(`[${G}]{4,}`, "gu");
17007
17007
  function Z(e) {
17008
17008
  let t = e.match(N);
17009
17009
  if (t)
@@ -17012,7 +17012,7 @@ function Z(e) {
17012
17012
  function H(e, t = !1) {
17013
17013
  let o = Array.from(e);
17014
17014
  if (o.length % 2 === 0) {
17015
- if (o.length % 4 || !e.startsWith(R))
17015
+ if (o.length % 4 || !e.startsWith(k))
17016
17016
  return K(o, t);
17017
17017
  } else
17018
17018
  throw new Error("Encoded data has invalid length");
@@ -17023,17 +17023,17 @@ function H(e, t = !1) {
17023
17023
  }
17024
17024
  if (t) {
17025
17025
  n.shift();
17026
- let r = n.indexOf(L);
17026
+ let r = n.indexOf(M);
17027
17027
  return r === -1 && (r = n.length), [JSON.parse(n.slice(0, r).join(""))];
17028
17028
  }
17029
- return n.join("").split(L).filter(Boolean).map((r) => JSON.parse(r));
17029
+ return n.join("").split(M).filter(Boolean).map((r) => JSON.parse(r));
17030
17030
  }
17031
17031
  function K(e, t) {
17032
17032
  var o;
17033
17033
  let n = [];
17034
17034
  for (let c = e.length * 0.5; c--; ) {
17035
- let u = `${M[e[c * 2].codePointAt(0)]}${M[e[c * 2 + 1].codePointAt(0)]}`;
17036
- n.unshift(String.fromCharCode(parseInt(u, 16)));
17035
+ let f = `${J[e[c * 2].codePointAt(0)]}${J[e[c * 2 + 1].codePointAt(0)]}`;
17036
+ n.unshift(String.fromCharCode(parseInt(f, 16)));
17037
17037
  }
17038
17038
  let r = [], s = [n.join("")], i = 10;
17039
17039
  for (; s.length; ) {
@@ -17041,13 +17041,13 @@ function K(e, t) {
17041
17041
  try {
17042
17042
  if (r.push(JSON.parse(c)), t)
17043
17043
  return r;
17044
- } catch (u) {
17044
+ } catch (f) {
17045
17045
  if (!i--)
17046
- throw u;
17047
- let f = +((o = u.message.match(/\sposition\s(\d+)$/)) == null ? void 0 : o[1]);
17048
- if (!f)
17049
- throw u;
17050
- s.unshift(c.substring(0, f), c.substring(f));
17046
+ throw f;
17047
+ let l = +((o = f.message.match(/\sposition\s(\d+)$/)) == null ? void 0 : o[1]);
17048
+ if (!l)
17049
+ throw f;
17050
+ s.unshift(c.substring(0, l), c.substring(l));
17051
17051
  }
17052
17052
  }
17053
17053
  return r;
@@ -17060,7 +17060,7 @@ function O(e, t) {
17060
17060
  return Q(e, t);
17061
17061
  }
17062
17062
  function oe(e) {
17063
- return k(e);
17063
+ return _(e);
17064
17064
  }
17065
17065
  function se(e) {
17066
17066
  return Z(e);
@@ -17133,8 +17133,8 @@ a.walk = function(t, o, n) {
17133
17133
  var i = Object.prototype.toString.call(s);
17134
17134
  return i === "[object Object]" || i === "[object Array]";
17135
17135
  }, function s(i) {
17136
- te(i, function(c, u) {
17137
- r.push(String(u)), n(c) ? s(c) : o(c, a.compile(r)), r.pop();
17136
+ te(i, function(c, f) {
17137
+ r.push(String(f)), n(c) ? s(c) : o(c, a.compile(r)), r.pop();
17138
17138
  });
17139
17139
  }(t);
17140
17140
  };
@@ -17170,17 +17170,17 @@ const ne = ({
17170
17170
  }) => {
17171
17171
  const r = t[e];
17172
17172
  delete t[e];
17173
- const s = _(o, e);
17173
+ const s = F(o, e);
17174
17174
  for (const i of s) {
17175
17175
  t[i] = r;
17176
- const c = y.get(o, i), u = O(c, n);
17177
- y.set(o, i, u);
17176
+ const c = y.get(o, i), f = O(c, n);
17177
+ y.set(o, i, f);
17178
17178
  }
17179
- }, _ = (e, t = "") => {
17179
+ }, F = (e, t = "") => {
17180
17180
  const o = [], n = y.get(e, t);
17181
17181
  if (n.content)
17182
17182
  for (let r = 0; r < n.content.length; r++)
17183
- n.content[r].nodeType === "text" ? o.push(`${t}/content/${r}/value`) : o.push(..._(e, `${t}/content/${r}`));
17183
+ n.content[r].nodeType === "text" ? o.push(`${t}/content/${r}/value`) : o.push(...F(e, `${t}/content/${r}`));
17184
17184
  return o;
17185
17185
  }, I = ({
17186
17186
  entityId: e,
@@ -17191,10 +17191,10 @@ const ne = ({
17191
17191
  locale: s,
17192
17192
  editorInterface: i,
17193
17193
  fieldType: c,
17194
- targetOrigin: u
17194
+ targetOrigin: f
17195
17195
  }) => ({
17196
17196
  origin: "contentful.com",
17197
- href: `${`${u || "https://app.contentful.com"}/spaces/${o}/environments/${n}`}/${t === "Entry" ? "entries" : "assets"}/${e}/?focusedField=${r}&focusedLocale=${s}`,
17197
+ href: `${`${f || "https://app.contentful.com"}/spaces/${o}/environments/${n}`}/${t === "Entry" ? "entries" : "assets"}/${e}/?focusedField=${r}&focusedLocale=${s}`,
17198
17198
  contentful: {
17199
17199
  space: o,
17200
17200
  environment: n,
@@ -17205,7 +17205,7 @@ const ne = ({
17205
17205
  editorInterface: i,
17206
17206
  fieldType: c
17207
17207
  }
17208
- }), F = (e) => ["builtin", "sidebar-builtin", "editor-builtin"].includes(e), V = (e) => re.includes(e);
17208
+ }), V = (e) => ["builtin", "sidebar-builtin", "editor-builtin"].includes(e), W = (e) => re.includes(e);
17209
17209
  function U(e) {
17210
17210
  if (typeof structuredClone == "function")
17211
17211
  return structuredClone(e);
@@ -17228,8 +17228,8 @@ function C(e, t, o, n, r, s, i) {
17228
17228
  const c = i ? t[i] : t;
17229
17229
  switch (e) {
17230
17230
  case "Symbol": {
17231
- const u = O(c, o);
17232
- y.set(n, r, u);
17231
+ const f = O(c, o);
17232
+ y.set(n, r, f);
17233
17233
  break;
17234
17234
  }
17235
17235
  case "RichText": {
@@ -17242,8 +17242,8 @@ function C(e, t, o, n, r, s, i) {
17242
17242
  break;
17243
17243
  }
17244
17244
  case "Array": {
17245
- const u = c.map((f) => typeof f == "string" ? O(f, o) : f);
17246
- y.set(n, r, u);
17245
+ const f = c.map((l) => typeof l == "string" ? O(l, o) : l);
17246
+ y.set(n, r, f);
17247
17247
  break;
17248
17248
  }
17249
17249
  }
@@ -17262,38 +17262,38 @@ const ie = (e, t) => {
17262
17262
  editorInterfaces: s,
17263
17263
  fields: i,
17264
17264
  locales: c,
17265
- entries: u,
17266
- assets: f,
17267
- mappings: h,
17268
- fieldTypes: m
17269
- } = o.extensions.contentSourceMaps, p = o.data;
17270
- for (const d in h) {
17271
- const { source: l } = h[d], g = "entry" in l ? u[l.entry] : f[l.asset], v = "entry" in l ? "Entry" : "Asset";
17272
- if (!g)
17265
+ entries: f,
17266
+ assets: l,
17267
+ mappings: m,
17268
+ fieldTypes: g
17269
+ } = o.extensions.contentSourceMaps, p = o;
17270
+ for (const d in m) {
17271
+ const { source: u } = m[d], h = "entry" in u ? f[u.entry] : l[u.asset], b = "entry" in u ? "Entry" : "Asset";
17272
+ if (!h)
17273
17273
  return o;
17274
- const w = n[g.space], A = r[g.environment], S = g.id, $ = i[l.field], W = c[l.locale], T = s[l.editorInterface], b = m[l.fieldType];
17275
- if (!(F(T.widgetNamespace) && !V(T.widgetId)))
17274
+ const v = n[h.space], w = r[h.environment], A = h.id, S = i[u.field], E = c[u.locale], T = s[u.editorInterface], P = g[u.fieldType];
17275
+ if (!(V(T.widgetNamespace) && !W(T.widgetId)))
17276
17276
  if (y.has(p, d)) {
17277
- const P = y.get(p, d);
17278
- if (P !== null) {
17277
+ const L = y.get(p, d);
17278
+ if (L !== null) {
17279
17279
  const j = I({
17280
- entityId: S,
17281
- entityType: v,
17282
- space: w,
17283
- environment: A,
17284
- field: $,
17285
- locale: W,
17280
+ entityId: A,
17281
+ entityType: b,
17282
+ space: v,
17283
+ environment: w,
17284
+ field: S,
17285
+ locale: E,
17286
17286
  editorInterface: T,
17287
- fieldType: b,
17287
+ fieldType: P,
17288
17288
  targetOrigin: t
17289
17289
  });
17290
- C(b, P, j, p, d, h);
17290
+ C(P, L, j, p, d, m);
17291
17291
  }
17292
17292
  } else
17293
17293
  console.error(`Pointer ${d} not found in GraphQL data or href could not be generated.`);
17294
17294
  }
17295
17295
  return o;
17296
- }, E = (e, t, o, n) => {
17296
+ }, $ = (e, t, o, n) => {
17297
17297
  if (!e.fields)
17298
17298
  return;
17299
17299
  const { contentSourceMaps: r } = e.sys;
@@ -17303,56 +17303,58 @@ const ie = (e, t) => {
17303
17303
  }
17304
17304
  const { mappings: s } = r;
17305
17305
  for (const i in s) {
17306
- const { source: c } = s[i], u = e.sys.space.sys.id, f = e.sys.environment.sys.id, h = e.sys.id, m = e.sys.type, p = t[c.fieldType], d = o[c.editorInterface];
17307
- if (!(F(d.widgetNamespace) && !V(d.widgetId)))
17308
- if (y.has(e, i)) {
17309
- const l = y.get(e, i);
17310
- if (l === null)
17311
- return;
17312
- const v = i.split("/").pop();
17313
- if (!v) {
17314
- console.error("Field name could not be extracted from the pointer", i);
17315
- return;
17316
- }
17317
- const w = e.sys.locale;
17318
- if (w) {
17319
- const A = I({
17320
- entityId: h,
17321
- entityType: m,
17322
- space: u,
17323
- environment: f,
17306
+ const { source: c } = s[i], f = e.sys.space.sys.id, l = e.sys.environment.sys.id, m = e.sys.id, g = e.sys.type, p = t[c.fieldType], d = o[c.editorInterface];
17307
+ if (V(d.widgetNamespace) && !W(d.widgetId))
17308
+ continue;
17309
+ const u = i.startsWith("/") ? i : `/${i}`;
17310
+ if (y.has(e, u)) {
17311
+ const h = y.get(e, u);
17312
+ if (h === null)
17313
+ return;
17314
+ const v = u.split("/").pop();
17315
+ if (!v) {
17316
+ console.error("Field name could not be extracted from the pointer", u);
17317
+ return;
17318
+ }
17319
+ const w = e.sys.locale;
17320
+ if (w) {
17321
+ const A = I({
17322
+ entityId: m,
17323
+ entityType: g,
17324
+ space: f,
17325
+ environment: l,
17326
+ field: v,
17327
+ locale: w,
17328
+ editorInterface: d,
17329
+ fieldType: p,
17330
+ targetOrigin: n
17331
+ });
17332
+ C(p, h, A, e, u, s);
17333
+ } else
17334
+ Object.keys(h).forEach((S) => {
17335
+ const E = I({
17336
+ entityId: m,
17337
+ entityType: g,
17338
+ space: f,
17339
+ environment: l,
17324
17340
  field: v,
17325
- locale: w,
17341
+ locale: S,
17326
17342
  editorInterface: d,
17327
17343
  fieldType: p,
17328
17344
  targetOrigin: n
17329
17345
  });
17330
- C(p, l, A, e, i, s);
17331
- } else
17332
- Object.keys(l).forEach((S) => {
17333
- const $ = I({
17334
- entityId: h,
17335
- entityType: m,
17336
- space: u,
17337
- environment: f,
17338
- field: v,
17339
- locale: S,
17340
- editorInterface: d,
17341
- fieldType: p,
17342
- targetOrigin: n
17343
- });
17344
- C(
17345
- p,
17346
- l,
17347
- $,
17348
- e,
17349
- `${i}/${S}`,
17350
- s,
17351
- S
17352
- );
17353
- });
17354
- } else
17355
- console.error("Pointer not found in the target", i, e);
17346
+ C(
17347
+ p,
17348
+ h,
17349
+ E,
17350
+ e,
17351
+ `${u}/${S}`,
17352
+ s,
17353
+ S
17354
+ );
17355
+ });
17356
+ } else
17357
+ console.error("Pointer not found in the target", i, e);
17356
17358
  }
17357
17359
  }, ae = (e, t) => {
17358
17360
  const o = U(
@@ -17365,16 +17367,16 @@ const ie = (e, t) => {
17365
17367
  const {
17366
17368
  contentSourceMapsLookup: { fieldTypes: r, editorInterfaces: s }
17367
17369
  } = n.sys, { items: i, includes: c } = n;
17368
- i.forEach((u) => E(u, r, s, t)), c && c.Entry && c.Entry.forEach(
17369
- (u) => E(u, r, s, t)
17370
+ i.forEach((f) => $(f, r, s, t)), c && c.Entry && c.Entry.forEach(
17371
+ (f) => $(f, r, s, t)
17370
17372
  ), c && c.Asset && c.Asset.forEach(
17371
- (u) => E(u, r, s, t)
17373
+ (f) => $(f, r, s, t)
17372
17374
  );
17373
17375
  } else {
17374
17376
  const n = o;
17375
17377
  if (!n.sys.contentSourceMapsLookup)
17376
17378
  return console.error("Content source maps lookup data is missing"), n;
17377
- E(
17379
+ $(
17378
17380
  n,
17379
17381
  n.sys.contentSourceMapsLookup.fieldTypes,
17380
17382
  n.sys.contentSourceMapsLookup.editorInterfaces,