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/${"
|
|
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: "
|
|
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 */
|
|
16979
|
-
/* harmony export */ isSupportedWidget: function() { return /* binding */
|
|
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
|
|
16983
|
-
function
|
|
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 `${
|
|
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}${
|
|
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())),
|
|
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(
|
|
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(
|
|
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(
|
|
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
|
|
17036
|
-
n.unshift(String.fromCharCode(parseInt(
|
|
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 (
|
|
17044
|
+
} catch (f) {
|
|
17045
17045
|
if (!i--)
|
|
17046
|
-
throw
|
|
17047
|
-
let
|
|
17048
|
-
if (!
|
|
17049
|
-
throw
|
|
17050
|
-
s.unshift(c.substring(0,
|
|
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
|
|
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,
|
|
17137
|
-
r.push(String(
|
|
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 =
|
|
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),
|
|
17177
|
-
y.set(o, i,
|
|
17176
|
+
const c = y.get(o, i), f = O(c, n);
|
|
17177
|
+
y.set(o, i, f);
|
|
17178
17178
|
}
|
|
17179
|
-
},
|
|
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(...
|
|
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:
|
|
17194
|
+
targetOrigin: f
|
|
17195
17195
|
}) => ({
|
|
17196
17196
|
origin: "contentful.com",
|
|
17197
|
-
href: `${`${
|
|
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
|
-
}),
|
|
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
|
|
17232
|
-
y.set(n, r,
|
|
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
|
|
17246
|
-
y.set(n, r,
|
|
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:
|
|
17266
|
-
assets:
|
|
17267
|
-
mappings:
|
|
17268
|
-
fieldTypes:
|
|
17269
|
-
} = o.extensions.contentSourceMaps, p = o
|
|
17270
|
-
for (const d in
|
|
17271
|
-
const { source:
|
|
17272
|
-
if (!
|
|
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
|
|
17275
|
-
if (!(
|
|
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
|
|
17278
|
-
if (
|
|
17277
|
+
const L = y.get(p, d);
|
|
17278
|
+
if (L !== null) {
|
|
17279
17279
|
const j = I({
|
|
17280
|
-
entityId:
|
|
17281
|
-
entityType:
|
|
17282
|
-
space:
|
|
17283
|
-
environment:
|
|
17284
|
-
field:
|
|
17285
|
-
locale:
|
|
17280
|
+
entityId: A,
|
|
17281
|
+
entityType: b,
|
|
17282
|
+
space: v,
|
|
17283
|
+
environment: w,
|
|
17284
|
+
field: S,
|
|
17285
|
+
locale: E,
|
|
17286
17286
|
editorInterface: T,
|
|
17287
|
-
fieldType:
|
|
17287
|
+
fieldType: P,
|
|
17288
17288
|
targetOrigin: t
|
|
17289
17289
|
});
|
|
17290
|
-
C(
|
|
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
|
-
},
|
|
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],
|
|
17307
|
-
if (
|
|
17308
|
-
|
|
17309
|
-
|
|
17310
|
-
|
|
17311
|
-
|
|
17312
|
-
|
|
17313
|
-
|
|
17314
|
-
|
|
17315
|
-
|
|
17316
|
-
|
|
17317
|
-
|
|
17318
|
-
|
|
17319
|
-
|
|
17320
|
-
|
|
17321
|
-
|
|
17322
|
-
|
|
17323
|
-
|
|
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:
|
|
17341
|
+
locale: S,
|
|
17326
17342
|
editorInterface: d,
|
|
17327
17343
|
fieldType: p,
|
|
17328
17344
|
targetOrigin: n
|
|
17329
17345
|
});
|
|
17330
|
-
C(
|
|
17331
|
-
|
|
17332
|
-
|
|
17333
|
-
|
|
17334
|
-
|
|
17335
|
-
|
|
17336
|
-
|
|
17337
|
-
|
|
17338
|
-
|
|
17339
|
-
|
|
17340
|
-
|
|
17341
|
-
|
|
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((
|
|
17369
|
-
(
|
|
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
|
-
(
|
|
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
|
-
|
|
17379
|
+
$(
|
|
17378
17380
|
n,
|
|
17379
17381
|
n.sys.contentSourceMapsLookup.fieldTypes,
|
|
17380
17382
|
n.sys.contentSourceMapsLookup.editorInterfaces,
|