contentful 9.1.8 → 9.1.9
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/contentful.browser.js +23 -14
- package/dist/contentful.browser.js.map +1 -1
- package/dist/contentful.browser.min.js +1 -1
- package/dist/contentful.node.js +105 -36
- package/dist/contentful.node.js.map +1 -1
- package/dist/contentful.node.min.js +1 -1
- package/dist/es-modules/contentful.js +1 -1
- package/dist/es-modules/create-contentful-api.js +1 -1
- package/package.json +3 -3
|
@@ -615,14 +615,18 @@ function Axios(instanceConfig) {
|
|
|
615
615
|
*
|
|
616
616
|
* @param {Object} config The config specific for this request (merged with this.defaults)
|
|
617
617
|
*/
|
|
618
|
-
Axios.prototype.request = function request(config) {
|
|
618
|
+
Axios.prototype.request = function request(configOrUrl, config) {
|
|
619
619
|
/*eslint no-param-reassign:0*/
|
|
620
620
|
// Allow for axios('example/url'[, config]) a la fetch API
|
|
621
|
-
if (typeof
|
|
622
|
-
config = arguments[1] || {};
|
|
623
|
-
config.url = arguments[0];
|
|
624
|
-
} else {
|
|
621
|
+
if (typeof configOrUrl === 'string') {
|
|
625
622
|
config = config || {};
|
|
623
|
+
config.url = configOrUrl;
|
|
624
|
+
} else {
|
|
625
|
+
config = configOrUrl || {};
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
if (!config.url) {
|
|
629
|
+
throw new Error('Provided config url is not valid');
|
|
626
630
|
}
|
|
627
631
|
|
|
628
632
|
config = mergeConfig(this.defaults, config);
|
|
@@ -707,6 +711,9 @@ Axios.prototype.request = function request(config) {
|
|
|
707
711
|
};
|
|
708
712
|
|
|
709
713
|
Axios.prototype.getUri = function getUri(config) {
|
|
714
|
+
if (!config.url) {
|
|
715
|
+
throw new Error('Provided config url is not valid');
|
|
716
|
+
}
|
|
710
717
|
config = mergeConfig(this.defaults, config);
|
|
711
718
|
return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, '');
|
|
712
719
|
};
|
|
@@ -1358,7 +1365,7 @@ module.exports = defaults;
|
|
|
1358
1365
|
/***/ (function(module, exports) {
|
|
1359
1366
|
|
|
1360
1367
|
module.exports = {
|
|
1361
|
-
"version": "0.
|
|
1368
|
+
"version": "0.25.0"
|
|
1362
1369
|
};
|
|
1363
1370
|
|
|
1364
1371
|
/***/ }),
|
|
@@ -1579,7 +1586,7 @@ module.exports = function isAbsoluteURL(url) {
|
|
|
1579
1586
|
// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
|
|
1580
1587
|
// RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
|
|
1581
1588
|
// by any combination of letters, digits, plus, period, or hyphen.
|
|
1582
|
-
return /^([a-z][a-z\d
|
|
1589
|
+
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
|
|
1583
1590
|
};
|
|
1584
1591
|
|
|
1585
1592
|
|
|
@@ -1595,6 +1602,8 @@ module.exports = function isAbsoluteURL(url) {
|
|
|
1595
1602
|
"use strict";
|
|
1596
1603
|
|
|
1597
1604
|
|
|
1605
|
+
var utils = __webpack_require__(/*! ./../utils */ "../node_modules/axios/lib/utils.js");
|
|
1606
|
+
|
|
1598
1607
|
/**
|
|
1599
1608
|
* Determines whether the payload is an error thrown by Axios
|
|
1600
1609
|
*
|
|
@@ -1602,7 +1611,7 @@ module.exports = function isAbsoluteURL(url) {
|
|
|
1602
1611
|
* @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
|
|
1603
1612
|
*/
|
|
1604
1613
|
module.exports = function isAxiosError(payload) {
|
|
1605
|
-
return (
|
|
1614
|
+
return utils.isObject(payload) && (payload.isAxiosError === true);
|
|
1606
1615
|
};
|
|
1607
1616
|
|
|
1608
1617
|
|
|
@@ -1933,7 +1942,7 @@ var toString = Object.prototype.toString;
|
|
|
1933
1942
|
* @returns {boolean} True if value is an Array, otherwise false
|
|
1934
1943
|
*/
|
|
1935
1944
|
function isArray(val) {
|
|
1936
|
-
return
|
|
1945
|
+
return Array.isArray(val);
|
|
1937
1946
|
}
|
|
1938
1947
|
|
|
1939
1948
|
/**
|
|
@@ -1974,7 +1983,7 @@ function isArrayBuffer(val) {
|
|
|
1974
1983
|
* @returns {boolean} True if value is an FormData, otherwise false
|
|
1975
1984
|
*/
|
|
1976
1985
|
function isFormData(val) {
|
|
1977
|
-
return (
|
|
1986
|
+
return toString.call(val) === '[object FormData]';
|
|
1978
1987
|
}
|
|
1979
1988
|
|
|
1980
1989
|
/**
|
|
@@ -1988,7 +1997,7 @@ function isArrayBufferView(val) {
|
|
|
1988
1997
|
if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
|
|
1989
1998
|
result = ArrayBuffer.isView(val);
|
|
1990
1999
|
} else {
|
|
1991
|
-
result = (val) && (val.buffer) && (val.buffer
|
|
2000
|
+
result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));
|
|
1992
2001
|
}
|
|
1993
2002
|
return result;
|
|
1994
2003
|
}
|
|
@@ -2095,7 +2104,7 @@ function isStream(val) {
|
|
|
2095
2104
|
* @returns {boolean} True if value is a URLSearchParams object, otherwise false
|
|
2096
2105
|
*/
|
|
2097
2106
|
function isURLSearchParams(val) {
|
|
2098
|
-
return
|
|
2107
|
+
return toString.call(val) === '[object URLSearchParams]';
|
|
2099
2108
|
}
|
|
2100
2109
|
|
|
2101
2110
|
/**
|
|
@@ -6516,7 +6525,7 @@ function createClient(params) {
|
|
|
6516
6525
|
|
|
6517
6526
|
const config = _objectSpread(_objectSpread({}, defaultConfig), params);
|
|
6518
6527
|
|
|
6519
|
-
const userAgentHeader = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["getUserAgentHeader"])(`contentful.js/${"9.1.
|
|
6528
|
+
const userAgentHeader = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["getUserAgentHeader"])(`contentful.js/${"9.1.9"}`, config.application, config.integration);
|
|
6520
6529
|
config.headers = _objectSpread(_objectSpread({}, config.headers), {}, {
|
|
6521
6530
|
'Content-Type': 'application/vnd.contentful.delivery.v1+json',
|
|
6522
6531
|
'X-Contentful-User-Agent': userAgentHeader
|
|
@@ -6692,7 +6701,7 @@ function createContentfulApi(_ref) {
|
|
|
6692
6701
|
switchToSpace(http);
|
|
6693
6702
|
|
|
6694
6703
|
try {
|
|
6695
|
-
const response = await http.get('');
|
|
6704
|
+
const response = await http.get('/');
|
|
6696
6705
|
return wrapSpace(response.data);
|
|
6697
6706
|
} catch (error) {
|
|
6698
6707
|
Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["errorHandler"])(error);
|