contentful 11.5.0 → 11.5.1
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.
|
@@ -1205,23 +1205,6 @@ var contentful = (function (exports) {
|
|
|
1205
1205
|
var toFiniteNumber = function toFiniteNumber(value, defaultValue) {
|
|
1206
1206
|
return value != null && Number.isFinite(value = +value) ? value : defaultValue;
|
|
1207
1207
|
};
|
|
1208
|
-
var ALPHA = 'abcdefghijklmnopqrstuvwxyz';
|
|
1209
|
-
var DIGIT = '0123456789';
|
|
1210
|
-
var ALPHABET = {
|
|
1211
|
-
DIGIT: DIGIT,
|
|
1212
|
-
ALPHA: ALPHA,
|
|
1213
|
-
ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
|
|
1214
|
-
};
|
|
1215
|
-
var generateString = function generateString() {
|
|
1216
|
-
var size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 16;
|
|
1217
|
-
var alphabet = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ALPHABET.ALPHA_DIGIT;
|
|
1218
|
-
var str = '';
|
|
1219
|
-
var length = alphabet.length;
|
|
1220
|
-
while (size--) {
|
|
1221
|
-
str += alphabet[Math.random() * length | 0];
|
|
1222
|
-
}
|
|
1223
|
-
return str;
|
|
1224
|
-
};
|
|
1225
1208
|
|
|
1226
1209
|
/**
|
|
1227
1210
|
* If the thing is a FormData object, return true, otherwise return false.
|
|
@@ -1338,8 +1321,6 @@ var contentful = (function (exports) {
|
|
|
1338
1321
|
findKey: findKey,
|
|
1339
1322
|
global: _global,
|
|
1340
1323
|
isContextDefined: isContextDefined,
|
|
1341
|
-
ALPHABET: ALPHABET,
|
|
1342
|
-
generateString: generateString,
|
|
1343
1324
|
isSpecCompliantForm: isSpecCompliantForm,
|
|
1344
1325
|
toJSONObject: toJSONObject,
|
|
1345
1326
|
isAsyncFn: isAsyncFn,
|
|
@@ -2641,8 +2622,9 @@ var contentful = (function (exports) {
|
|
|
2641
2622
|
*
|
|
2642
2623
|
* @returns {string} The combined full path
|
|
2643
2624
|
*/
|
|
2644
|
-
function buildFullPath(baseURL, requestedURL) {
|
|
2645
|
-
|
|
2625
|
+
function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
|
|
2626
|
+
var isRelativeUrl = !isAbsoluteURL(requestedURL);
|
|
2627
|
+
if (baseURL && isRelativeUrl || allowAbsoluteUrls == false) {
|
|
2646
2628
|
return combineURLs(baseURL, requestedURL);
|
|
2647
2629
|
}
|
|
2648
2630
|
return requestedURL;
|
|
@@ -3589,7 +3571,7 @@ var contentful = (function (exports) {
|
|
|
3589
3571
|
return Promise.reject(reason);
|
|
3590
3572
|
});
|
|
3591
3573
|
}
|
|
3592
|
-
var VERSION = "1.
|
|
3574
|
+
var VERSION = "1.8.1";
|
|
3593
3575
|
var validators$1 = {};
|
|
3594
3576
|
|
|
3595
3577
|
// eslint-disable-next-line func-names
|
|
@@ -3778,6 +3760,13 @@ var contentful = (function (exports) {
|
|
|
3778
3760
|
}, true);
|
|
3779
3761
|
}
|
|
3780
3762
|
}
|
|
3763
|
+
|
|
3764
|
+
// Set config.allowAbsoluteUrls
|
|
3765
|
+
if (config.allowAbsoluteUrls !== undefined) ;else if (this.defaults.allowAbsoluteUrls !== undefined) {
|
|
3766
|
+
config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
|
|
3767
|
+
} else {
|
|
3768
|
+
config.allowAbsoluteUrls = true;
|
|
3769
|
+
}
|
|
3781
3770
|
validator.assertOptions(config, {
|
|
3782
3771
|
baseUrl: validators.spelling('baseURL'),
|
|
3783
3772
|
withXsrfToken: validators.spelling('withXSRFToken')
|
|
@@ -3850,7 +3839,7 @@ var contentful = (function (exports) {
|
|
|
3850
3839
|
key: "getUri",
|
|
3851
3840
|
value: function getUri(config) {
|
|
3852
3841
|
config = mergeConfig(this.defaults, config);
|
|
3853
|
-
var fullPath = buildFullPath(config.baseURL, config.url);
|
|
3842
|
+
var fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
|
|
3854
3843
|
return buildURL(fullPath, config.params, config.paramsSerializer);
|
|
3855
3844
|
}
|
|
3856
3845
|
}]);
|
|
@@ -10100,7 +10089,7 @@ var contentful = (function (exports) {
|
|
|
10100
10089
|
http.defaults.baseURL = getGlobalOptions().environmentBaseUrl;
|
|
10101
10090
|
}
|
|
10102
10091
|
return {
|
|
10103
|
-
version: "11.5.
|
|
10092
|
+
version: "11.5.1",
|
|
10104
10093
|
getSpace: getSpace,
|
|
10105
10094
|
getContentType: getContentType,
|
|
10106
10095
|
getContentTypes: getContentTypes,
|
|
@@ -10227,7 +10216,7 @@ var contentful = (function (exports) {
|
|
|
10227
10216
|
environment: 'master'
|
|
10228
10217
|
};
|
|
10229
10218
|
var config = Object.assign(Object.assign({}, defaultConfig), params);
|
|
10230
|
-
var userAgentHeader = getUserAgentHeader("contentful.js/".concat("11.5.
|
|
10219
|
+
var userAgentHeader = getUserAgentHeader("contentful.js/".concat("11.5.1"), config.application, config.integration);
|
|
10231
10220
|
config.headers = Object.assign(Object.assign({}, config.headers), {
|
|
10232
10221
|
'Content-Type': 'application/vnd.contentful.delivery.v1+json',
|
|
10233
10222
|
'X-Contentful-User-Agent': userAgentHeader
|