contentful 11.5.15 → 11.5.16
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.
|
@@ -27,20 +27,20 @@ var contentful = (function (exports) {
|
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
function
|
|
31
|
-
(
|
|
32
|
-
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
33
|
-
return n;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function _arrayWithoutHoles(r) {
|
|
37
|
-
if (Array.isArray(r)) return _arrayLikeToArray$4(r);
|
|
30
|
+
function _arrayWithHoles(r) {
|
|
31
|
+
if (Array.isArray(r)) return r;
|
|
38
32
|
}
|
|
39
33
|
|
|
40
34
|
function _iterableToArray(r) {
|
|
41
35
|
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
42
36
|
}
|
|
43
37
|
|
|
38
|
+
function _arrayLikeToArray$4(r, a) {
|
|
39
|
+
(null == a || a > r.length) && (a = r.length);
|
|
40
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
41
|
+
return n;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
44
|
function _unsupportedIterableToArray$4(r, a) {
|
|
45
45
|
if (r) {
|
|
46
46
|
if ("string" == typeof r) return _arrayLikeToArray$4(r, a);
|
|
@@ -49,24 +49,24 @@ var contentful = (function (exports) {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
function
|
|
53
|
-
throw new TypeError("Invalid attempt to
|
|
52
|
+
function _nonIterableRest() {
|
|
53
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
function
|
|
57
|
-
return
|
|
56
|
+
function _toArray(r) {
|
|
57
|
+
return _arrayWithHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray$4(r) || _nonIterableRest();
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
function
|
|
61
|
-
if (Array.isArray(r)) return r;
|
|
60
|
+
function _arrayWithoutHoles(r) {
|
|
61
|
+
if (Array.isArray(r)) return _arrayLikeToArray$4(r);
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
function
|
|
65
|
-
throw new TypeError("Invalid attempt to
|
|
64
|
+
function _nonIterableSpread() {
|
|
65
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
function
|
|
69
|
-
return
|
|
68
|
+
function _toConsumableArray$1(r) {
|
|
69
|
+
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray$4(r) || _nonIterableSpread();
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
function _typeof$2(o) {
|
|
@@ -620,6 +620,8 @@ var contentful = (function (exports) {
|
|
|
620
620
|
|
|
621
621
|
var toString = Object.prototype.toString;
|
|
622
622
|
var getPrototypeOf$1 = Object.getPrototypeOf;
|
|
623
|
+
var iterator = Symbol.iterator,
|
|
624
|
+
toStringTag$1 = Symbol.toStringTag;
|
|
623
625
|
var kindOf = function (cache) {
|
|
624
626
|
return function (thing) {
|
|
625
627
|
var str = toString.call(thing);
|
|
@@ -752,7 +754,7 @@ var contentful = (function (exports) {
|
|
|
752
754
|
return false;
|
|
753
755
|
}
|
|
754
756
|
var prototype = getPrototypeOf$1(val);
|
|
755
|
-
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(
|
|
757
|
+
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag$1 in val) && !(iterator in val);
|
|
756
758
|
};
|
|
757
759
|
|
|
758
760
|
/**
|
|
@@ -1104,10 +1106,10 @@ var contentful = (function (exports) {
|
|
|
1104
1106
|
* @returns {void}
|
|
1105
1107
|
*/
|
|
1106
1108
|
var forEachEntry = function forEachEntry(obj, fn) {
|
|
1107
|
-
var generator = obj && obj[
|
|
1108
|
-
var
|
|
1109
|
+
var generator = obj && obj[iterator];
|
|
1110
|
+
var _iterator = generator.call(obj);
|
|
1109
1111
|
var result;
|
|
1110
|
-
while ((result =
|
|
1112
|
+
while ((result = _iterator.next()) && !result.done) {
|
|
1111
1113
|
var pair = result.value;
|
|
1112
1114
|
fn.call(obj, pair[0], pair[1]);
|
|
1113
1115
|
}
|
|
@@ -1214,7 +1216,7 @@ var contentful = (function (exports) {
|
|
|
1214
1216
|
* @returns {boolean}
|
|
1215
1217
|
*/
|
|
1216
1218
|
function isSpecCompliantForm(thing) {
|
|
1217
|
-
return !!(thing && isFunction(thing.append) && thing[
|
|
1219
|
+
return !!(thing && isFunction(thing.append) && thing[toStringTag$1] === 'FormData' && thing[iterator]);
|
|
1218
1220
|
}
|
|
1219
1221
|
var toJSONObject = function toJSONObject(obj) {
|
|
1220
1222
|
var stack = new Array(10);
|
|
@@ -1270,6 +1272,9 @@ var contentful = (function (exports) {
|
|
|
1270
1272
|
|
|
1271
1273
|
// *********************
|
|
1272
1274
|
|
|
1275
|
+
var isIterable = function isIterable(thing) {
|
|
1276
|
+
return thing != null && isFunction(thing[iterator]);
|
|
1277
|
+
};
|
|
1273
1278
|
var utils$1$1 = {
|
|
1274
1279
|
isArray: isArray$7,
|
|
1275
1280
|
isArrayBuffer: isArrayBuffer,
|
|
@@ -1326,7 +1331,8 @@ var contentful = (function (exports) {
|
|
|
1326
1331
|
isAsyncFn: isAsyncFn,
|
|
1327
1332
|
isThenable: isThenable,
|
|
1328
1333
|
setImmediate: _setImmediate,
|
|
1329
|
-
asap: asap
|
|
1334
|
+
asap: asap,
|
|
1335
|
+
isIterable: isIterable
|
|
1330
1336
|
};
|
|
1331
1337
|
|
|
1332
1338
|
/**
|
|
@@ -2154,21 +2160,26 @@ var contentful = (function (exports) {
|
|
|
2154
2160
|
setHeaders(header, valueOrRewrite);
|
|
2155
2161
|
} else if (utils$1$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
2156
2162
|
setHeaders(parseHeaders(header), valueOrRewrite);
|
|
2157
|
-
} else if (utils$1$1.
|
|
2158
|
-
var
|
|
2163
|
+
} else if (utils$1$1.isObject(header) && utils$1$1.isIterable(header)) {
|
|
2164
|
+
var obj = {},
|
|
2165
|
+
dest,
|
|
2166
|
+
key;
|
|
2167
|
+
var _iterator3 = _createForOfIteratorHelper$3(header),
|
|
2159
2168
|
_step2;
|
|
2160
2169
|
try {
|
|
2161
|
-
for (
|
|
2162
|
-
var
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2170
|
+
for (_iterator3.s(); !(_step2 = _iterator3.n()).done;) {
|
|
2171
|
+
var entry = _step2.value;
|
|
2172
|
+
if (!utils$1$1.isArray(entry)) {
|
|
2173
|
+
throw TypeError('Object iterator must return a key-value pair');
|
|
2174
|
+
}
|
|
2175
|
+
obj[key = entry[0]] = (dest = obj[key]) ? utils$1$1.isArray(dest) ? [].concat(_toConsumableArray$1(dest), [entry[1]]) : [dest, entry[1]] : entry[1];
|
|
2166
2176
|
}
|
|
2167
2177
|
} catch (err) {
|
|
2168
|
-
|
|
2178
|
+
_iterator3.e(err);
|
|
2169
2179
|
} finally {
|
|
2170
|
-
|
|
2180
|
+
_iterator3.f();
|
|
2171
2181
|
}
|
|
2182
|
+
setHeaders(obj, valueOrRewrite);
|
|
2172
2183
|
} else {
|
|
2173
2184
|
header != null && setHeader(valueOrRewrite, header, rewrite);
|
|
2174
2185
|
}
|
|
@@ -2299,6 +2310,11 @@ var contentful = (function (exports) {
|
|
|
2299
2310
|
return header + ': ' + value;
|
|
2300
2311
|
}).join('\n');
|
|
2301
2312
|
}
|
|
2313
|
+
}, {
|
|
2314
|
+
key: "getSetCookie",
|
|
2315
|
+
value: function getSetCookie() {
|
|
2316
|
+
return this.get("set-cookie") || [];
|
|
2317
|
+
}
|
|
2302
2318
|
}, {
|
|
2303
2319
|
key: Symbol.toStringTag,
|
|
2304
2320
|
get: function get() {
|
|
@@ -3025,17 +3041,17 @@ var contentful = (function (exports) {
|
|
|
3025
3041
|
});
|
|
3026
3042
|
var readBytes = /*#__PURE__*/function () {
|
|
3027
3043
|
var _ref = _wrapAsyncGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(iterable, chunkSize) {
|
|
3028
|
-
var _iteratorAbruptCompletion, _didIteratorError, _iteratorError,
|
|
3044
|
+
var _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator2, _step, chunk;
|
|
3029
3045
|
return _regeneratorRuntime.wrap(function _callee$(_context2) {
|
|
3030
3046
|
while (1) switch (_context2.prev = _context2.next) {
|
|
3031
3047
|
case 0:
|
|
3032
3048
|
_iteratorAbruptCompletion = false;
|
|
3033
3049
|
_didIteratorError = false;
|
|
3034
3050
|
_context2.prev = 2;
|
|
3035
|
-
|
|
3051
|
+
_iterator2 = _asyncIterator(readStream(iterable));
|
|
3036
3052
|
case 4:
|
|
3037
3053
|
_context2.next = 6;
|
|
3038
|
-
return _awaitAsyncGenerator(
|
|
3054
|
+
return _awaitAsyncGenerator(_iterator2.next());
|
|
3039
3055
|
case 6:
|
|
3040
3056
|
if (!(_iteratorAbruptCompletion = !(_step = _context2.sent).done)) {
|
|
3041
3057
|
_context2.next = 12;
|
|
@@ -3058,12 +3074,12 @@ var contentful = (function (exports) {
|
|
|
3058
3074
|
case 18:
|
|
3059
3075
|
_context2.prev = 18;
|
|
3060
3076
|
_context2.prev = 19;
|
|
3061
|
-
if (!(_iteratorAbruptCompletion &&
|
|
3077
|
+
if (!(_iteratorAbruptCompletion && _iterator2.return != null)) {
|
|
3062
3078
|
_context2.next = 23;
|
|
3063
3079
|
break;
|
|
3064
3080
|
}
|
|
3065
3081
|
_context2.next = 23;
|
|
3066
|
-
return _awaitAsyncGenerator(
|
|
3082
|
+
return _awaitAsyncGenerator(_iterator2.return());
|
|
3067
3083
|
case 23:
|
|
3068
3084
|
_context2.prev = 23;
|
|
3069
3085
|
if (!_didIteratorError) {
|
|
@@ -3436,7 +3452,7 @@ var contentful = (function (exports) {
|
|
|
3436
3452
|
_context8.prev = 33;
|
|
3437
3453
|
_context8.t2 = _context8["catch"](4);
|
|
3438
3454
|
unsubscribe && unsubscribe();
|
|
3439
|
-
if (!(_context8.t2 && _context8.t2.name === 'TypeError' && /fetch/i.test(_context8.t2.message))) {
|
|
3455
|
+
if (!(_context8.t2 && _context8.t2.name === 'TypeError' && /Load failed|fetch/i.test(_context8.t2.message))) {
|
|
3440
3456
|
_context8.next = 38;
|
|
3441
3457
|
break;
|
|
3442
3458
|
}
|
|
@@ -3571,7 +3587,7 @@ var contentful = (function (exports) {
|
|
|
3571
3587
|
return Promise.reject(reason);
|
|
3572
3588
|
});
|
|
3573
3589
|
}
|
|
3574
|
-
var VERSION = "1.
|
|
3590
|
+
var VERSION = "1.9.0";
|
|
3575
3591
|
var validators$1 = {};
|
|
3576
3592
|
|
|
3577
3593
|
// eslint-disable-next-line func-names
|
|
@@ -3665,7 +3681,7 @@ var contentful = (function (exports) {
|
|
|
3665
3681
|
var Axios = /*#__PURE__*/function () {
|
|
3666
3682
|
function Axios(instanceConfig) {
|
|
3667
3683
|
_classCallCheck(this, Axios);
|
|
3668
|
-
this.defaults = instanceConfig;
|
|
3684
|
+
this.defaults = instanceConfig || {};
|
|
3669
3685
|
this.interceptors = {
|
|
3670
3686
|
request: new InterceptorManager$1(),
|
|
3671
3687
|
response: new InterceptorManager$1()
|
|
@@ -10101,7 +10117,7 @@ var contentful = (function (exports) {
|
|
|
10101
10117
|
http.defaults.baseURL = getGlobalOptions().environmentBaseUrl;
|
|
10102
10118
|
}
|
|
10103
10119
|
return {
|
|
10104
|
-
version: "11.5.
|
|
10120
|
+
version: "11.5.16",
|
|
10105
10121
|
getSpace: getSpace,
|
|
10106
10122
|
getContentType: getContentType,
|
|
10107
10123
|
getContentTypes: getContentTypes,
|
|
@@ -10228,7 +10244,7 @@ var contentful = (function (exports) {
|
|
|
10228
10244
|
environment: 'master'
|
|
10229
10245
|
};
|
|
10230
10246
|
var config = Object.assign(Object.assign({}, defaultConfig), params);
|
|
10231
|
-
var userAgentHeader = getUserAgentHeader("contentful.js/".concat("11.5.
|
|
10247
|
+
var userAgentHeader = getUserAgentHeader("contentful.js/".concat("11.5.16"), config.application, config.integration);
|
|
10232
10248
|
config.headers = Object.assign(Object.assign({}, config.headers), {
|
|
10233
10249
|
'Content-Type': 'application/vnd.contentful.delivery.v1+json',
|
|
10234
10250
|
'X-Contentful-User-Agent': userAgentHeader
|