contentful 11.8.6 → 11.8.8
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.
|
@@ -616,6 +616,14 @@ var contentful = (function (exports) {
|
|
|
616
616
|
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
617
617
|
function _asyncIterator(r) { var n, t, o, e = 2; for ("undefined" != typeof Symbol && (t = Symbol.asyncIterator, o = Symbol.iterator); e--;) { if (t && null != (n = r[t])) return n.call(r); if (o && null != (n = r[o])) return new AsyncFromSyncIterator(n.call(r)); t = "@@asyncIterator", o = "@@iterator"; } throw new TypeError("Object is not async iterable"); }
|
|
618
618
|
function AsyncFromSyncIterator(r) { function AsyncFromSyncIteratorContinuation(r) { if (Object(r) !== r) return Promise.reject(new TypeError(r + " is not an object.")); var n = r.done; return Promise.resolve(r.value).then(function (r) { return { value: r, done: n }; }); } return AsyncFromSyncIterator = function AsyncFromSyncIterator(r) { this.s = r, this.n = r.next; }, AsyncFromSyncIterator.prototype = { s: null, n: null, next: function next() { return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); }, return: function _return(r) { var n = this.s.return; return void 0 === n ? Promise.resolve({ value: r, done: true }) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); }, throw: function _throw(r) { var n = this.s.return; return void 0 === n ? Promise.reject(r) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); } }, new AsyncFromSyncIterator(r); }
|
|
619
|
+
|
|
620
|
+
/**
|
|
621
|
+
* Create a bound version of a function with a specified `this` context
|
|
622
|
+
*
|
|
623
|
+
* @param {Function} fn - The function to bind
|
|
624
|
+
* @param {*} thisArg - The value to be passed as the `this` parameter
|
|
625
|
+
* @returns {Function} A new function that will call the original function with the specified `this` context
|
|
626
|
+
*/
|
|
619
627
|
function bind$1(fn, thisArg) {
|
|
620
628
|
return function wrap() {
|
|
621
629
|
return fn.apply(thisArg, arguments);
|
|
@@ -1778,7 +1786,7 @@ var contentful = (function (exports) {
|
|
|
1778
1786
|
*
|
|
1779
1787
|
* @param {Number} id The ID that was returned by `use`
|
|
1780
1788
|
*
|
|
1781
|
-
* @returns {
|
|
1789
|
+
* @returns {void}
|
|
1782
1790
|
*/
|
|
1783
1791
|
}, {
|
|
1784
1792
|
key: "eject",
|
|
@@ -2632,20 +2640,33 @@ var contentful = (function (exports) {
|
|
|
2632
2640
|
var cookies = platform.hasStandardBrowserEnv ?
|
|
2633
2641
|
// Standard browser envs support document.cookie
|
|
2634
2642
|
{
|
|
2635
|
-
write: function write(name, value, expires, path, domain, secure) {
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
utils$1$1.
|
|
2639
|
-
|
|
2640
|
-
|
|
2643
|
+
write: function write(name, value, expires, path, domain, secure, sameSite) {
|
|
2644
|
+
if (typeof document === 'undefined') return;
|
|
2645
|
+
var cookie = ["".concat(name, "=").concat(encodeURIComponent(value))];
|
|
2646
|
+
if (utils$1$1.isNumber(expires)) {
|
|
2647
|
+
cookie.push("expires=".concat(new Date(expires).toUTCString()));
|
|
2648
|
+
}
|
|
2649
|
+
if (utils$1$1.isString(path)) {
|
|
2650
|
+
cookie.push("path=".concat(path));
|
|
2651
|
+
}
|
|
2652
|
+
if (utils$1$1.isString(domain)) {
|
|
2653
|
+
cookie.push("domain=".concat(domain));
|
|
2654
|
+
}
|
|
2655
|
+
if (secure === true) {
|
|
2656
|
+
cookie.push('secure');
|
|
2657
|
+
}
|
|
2658
|
+
if (utils$1$1.isString(sameSite)) {
|
|
2659
|
+
cookie.push("SameSite=".concat(sameSite));
|
|
2660
|
+
}
|
|
2641
2661
|
document.cookie = cookie.join('; ');
|
|
2642
2662
|
},
|
|
2643
2663
|
read: function read(name) {
|
|
2644
|
-
|
|
2645
|
-
|
|
2664
|
+
if (typeof document === 'undefined') return null;
|
|
2665
|
+
var match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));
|
|
2666
|
+
return match ? decodeURIComponent(match[1]) : null;
|
|
2646
2667
|
},
|
|
2647
2668
|
remove: function remove(name) {
|
|
2648
|
-
this.write(name, '', Date.now() - 86400000);
|
|
2669
|
+
this.write(name, '', Date.now() - 86400000, '/');
|
|
2649
2670
|
}
|
|
2650
2671
|
} :
|
|
2651
2672
|
// Non-standard browser env (web workers, react-native) lack needed support.
|
|
@@ -3563,7 +3584,7 @@ var contentful = (function (exports) {
|
|
|
3563
3584
|
};
|
|
3564
3585
|
var seedCache = new Map();
|
|
3565
3586
|
var getFetch = function getFetch(config) {
|
|
3566
|
-
var env = config
|
|
3587
|
+
var env = config && config.env || {};
|
|
3567
3588
|
var fetch = env.fetch,
|
|
3568
3589
|
Request = env.Request,
|
|
3569
3590
|
Response = env.Response;
|
|
@@ -3582,6 +3603,16 @@ var contentful = (function (exports) {
|
|
|
3582
3603
|
return target;
|
|
3583
3604
|
};
|
|
3584
3605
|
getFetch();
|
|
3606
|
+
|
|
3607
|
+
/**
|
|
3608
|
+
* Known adapters mapping.
|
|
3609
|
+
* Provides environment-specific adapters for Axios:
|
|
3610
|
+
* - `http` for Node.js
|
|
3611
|
+
* - `xhr` for browsers
|
|
3612
|
+
* - `fetch` for fetch API-based requests
|
|
3613
|
+
*
|
|
3614
|
+
* @type {Object<string, Function|Object>}
|
|
3615
|
+
*/
|
|
3585
3616
|
var knownAdapters = {
|
|
3586
3617
|
http: httpAdapter,
|
|
3587
3618
|
xhr: xhrAdapter,
|
|
@@ -3589,6 +3620,8 @@ var contentful = (function (exports) {
|
|
|
3589
3620
|
get: getFetch
|
|
3590
3621
|
}
|
|
3591
3622
|
};
|
|
3623
|
+
|
|
3624
|
+
// Assign adapter names for easier debugging and identification
|
|
3592
3625
|
utils$1$1.forEach(knownAdapters, function (fn, value) {
|
|
3593
3626
|
if (fn) {
|
|
3594
3627
|
try {
|
|
@@ -3603,47 +3636,85 @@ var contentful = (function (exports) {
|
|
|
3603
3636
|
});
|
|
3604
3637
|
}
|
|
3605
3638
|
});
|
|
3639
|
+
|
|
3640
|
+
/**
|
|
3641
|
+
* Render a rejection reason string for unknown or unsupported adapters
|
|
3642
|
+
*
|
|
3643
|
+
* @param {string} reason
|
|
3644
|
+
* @returns {string}
|
|
3645
|
+
*/
|
|
3606
3646
|
var renderReason = function renderReason(reason) {
|
|
3607
3647
|
return "- ".concat(reason);
|
|
3608
3648
|
};
|
|
3649
|
+
|
|
3650
|
+
/**
|
|
3651
|
+
* Check if the adapter is resolved (function, null, or false)
|
|
3652
|
+
*
|
|
3653
|
+
* @param {Function|null|false} adapter
|
|
3654
|
+
* @returns {boolean}
|
|
3655
|
+
*/
|
|
3609
3656
|
var isResolvedHandle = function isResolvedHandle(adapter) {
|
|
3610
3657
|
return utils$1$1.isFunction(adapter) || adapter === null || adapter === false;
|
|
3611
3658
|
};
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3659
|
+
|
|
3660
|
+
/**
|
|
3661
|
+
* Get the first suitable adapter from the provided list.
|
|
3662
|
+
* Tries each adapter in order until a supported one is found.
|
|
3663
|
+
* Throws an AxiosError if no adapter is suitable.
|
|
3664
|
+
*
|
|
3665
|
+
* @param {Array<string|Function>|string|Function} adapters - Adapter(s) by name or function.
|
|
3666
|
+
* @param {Object} config - Axios request configuration
|
|
3667
|
+
* @throws {AxiosError} If no suitable adapter is available
|
|
3668
|
+
* @returns {Function} The resolved adapter function
|
|
3669
|
+
*/
|
|
3670
|
+
function getAdapter(adapters, config) {
|
|
3671
|
+
adapters = utils$1$1.isArray(adapters) ? adapters : [adapters];
|
|
3672
|
+
var _adapters = adapters,
|
|
3673
|
+
length = _adapters.length;
|
|
3674
|
+
var nameOrAdapter;
|
|
3675
|
+
var adapter;
|
|
3676
|
+
var rejectedReasons = {};
|
|
3677
|
+
for (var i = 0; i < length; i++) {
|
|
3678
|
+
nameOrAdapter = adapters[i];
|
|
3679
|
+
var id = void 0;
|
|
3680
|
+
adapter = nameOrAdapter;
|
|
3681
|
+
if (!isResolvedHandle(nameOrAdapter)) {
|
|
3682
|
+
adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
|
|
3683
|
+
if (adapter === undefined) {
|
|
3684
|
+
throw new AxiosError("Unknown adapter '".concat(id, "'"));
|
|
3632
3685
|
}
|
|
3633
|
-
rejectedReasons[id || '#' + i] = adapter;
|
|
3634
|
-
}
|
|
3635
|
-
if (!adapter) {
|
|
3636
|
-
var reasons = Object.entries(rejectedReasons).map(function (_ref20) {
|
|
3637
|
-
var _ref21 = _slicedToArray$1(_ref20, 2),
|
|
3638
|
-
id = _ref21[0],
|
|
3639
|
-
state = _ref21[1];
|
|
3640
|
-
return "adapter ".concat(id, " ") + (state === false ? 'is not supported by the environment' : 'is not available in the build');
|
|
3641
|
-
});
|
|
3642
|
-
var s = length ? reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0]) : 'as no adapter specified';
|
|
3643
|
-
throw new AxiosError("There is no suitable adapter to dispatch the request " + s, 'ERR_NOT_SUPPORT');
|
|
3644
3686
|
}
|
|
3645
|
-
|
|
3646
|
-
|
|
3687
|
+
if (adapter && (utils$1$1.isFunction(adapter) || (adapter = adapter.get(config)))) {
|
|
3688
|
+
break;
|
|
3689
|
+
}
|
|
3690
|
+
rejectedReasons[id || '#' + i] = adapter;
|
|
3691
|
+
}
|
|
3692
|
+
if (!adapter) {
|
|
3693
|
+
var reasons = Object.entries(rejectedReasons).map(function (_ref20) {
|
|
3694
|
+
var _ref21 = _slicedToArray$1(_ref20, 2),
|
|
3695
|
+
id = _ref21[0],
|
|
3696
|
+
state = _ref21[1];
|
|
3697
|
+
return "adapter ".concat(id, " ") + (state === false ? 'is not supported by the environment' : 'is not available in the build');
|
|
3698
|
+
});
|
|
3699
|
+
var s = length ? reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0]) : 'as no adapter specified';
|
|
3700
|
+
throw new AxiosError("There is no suitable adapter to dispatch the request " + s, 'ERR_NOT_SUPPORT');
|
|
3701
|
+
}
|
|
3702
|
+
return adapter;
|
|
3703
|
+
}
|
|
3704
|
+
|
|
3705
|
+
/**
|
|
3706
|
+
* Exports Axios adapters and utility to resolve an adapter
|
|
3707
|
+
*/
|
|
3708
|
+
var adapters = {
|
|
3709
|
+
/**
|
|
3710
|
+
* Resolve an adapter from a list of adapter names or functions.
|
|
3711
|
+
* @type {Function}
|
|
3712
|
+
*/
|
|
3713
|
+
getAdapter: getAdapter,
|
|
3714
|
+
/**
|
|
3715
|
+
* Exposes all known adapters
|
|
3716
|
+
* @type {Object<string, Function|Object>}
|
|
3717
|
+
*/
|
|
3647
3718
|
adapters: knownAdapters
|
|
3648
3719
|
};
|
|
3649
3720
|
|
|
@@ -3700,7 +3771,7 @@ var contentful = (function (exports) {
|
|
|
3700
3771
|
return Promise.reject(reason);
|
|
3701
3772
|
});
|
|
3702
3773
|
}
|
|
3703
|
-
var VERSION = "1.
|
|
3774
|
+
var VERSION = "1.13.0";
|
|
3704
3775
|
var validators$1 = {};
|
|
3705
3776
|
|
|
3706
3777
|
// eslint-disable-next-line func-names
|
|
@@ -4231,7 +4302,13 @@ var contentful = (function (exports) {
|
|
|
4231
4302
|
InsufficientStorage: 507,
|
|
4232
4303
|
LoopDetected: 508,
|
|
4233
4304
|
NotExtended: 510,
|
|
4234
|
-
NetworkAuthenticationRequired: 511
|
|
4305
|
+
NetworkAuthenticationRequired: 511,
|
|
4306
|
+
WebServerIsDown: 521,
|
|
4307
|
+
ConnectionTimedOut: 522,
|
|
4308
|
+
OriginIsUnreachable: 523,
|
|
4309
|
+
TimeoutOccurred: 524,
|
|
4310
|
+
SslHandshakeFailed: 525,
|
|
4311
|
+
InvalidSslCertificate: 526
|
|
4235
4312
|
};
|
|
4236
4313
|
Object.entries(HttpStatusCode).forEach(function (_ref22) {
|
|
4237
4314
|
var _ref23 = _slicedToArray$1(_ref22, 2),
|
|
@@ -10224,7 +10301,7 @@ var contentful = (function (exports) {
|
|
|
10224
10301
|
http.defaults.baseURL = getGlobalOptions().environmentBaseUrl;
|
|
10225
10302
|
}
|
|
10226
10303
|
return {
|
|
10227
|
-
version: "11.8.
|
|
10304
|
+
version: "11.8.8",
|
|
10228
10305
|
getSpace: getSpace,
|
|
10229
10306
|
getContentType: getContentType,
|
|
10230
10307
|
getContentTypes: getContentTypes,
|
|
@@ -10353,7 +10430,7 @@ var contentful = (function (exports) {
|
|
|
10353
10430
|
environment: 'master'
|
|
10354
10431
|
};
|
|
10355
10432
|
var config = Object.assign(Object.assign({}, defaultConfig), params);
|
|
10356
|
-
var userAgentHeader = getUserAgentHeader("contentful.js/".concat("11.8.
|
|
10433
|
+
var userAgentHeader = getUserAgentHeader("contentful.js/".concat("11.8.8"), config.application, config.integration);
|
|
10357
10434
|
config.headers = Object.assign(Object.assign({}, config.headers), {
|
|
10358
10435
|
'Content-Type': 'application/vnd.contentful.delivery.v1+json',
|
|
10359
10436
|
'X-Contentful-User-Agent': userAgentHeader
|