contentful 11.5.5 → 11.5.6
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.
|
@@ -7778,6 +7778,19 @@ var contentful = (function (exports) {
|
|
|
7778
7778
|
var isPlainObject_1 = isPlainObject;
|
|
7779
7779
|
var isPlainObject$1 = /*@__PURE__*/getDefaultExportFromCjs(isPlainObject_1);
|
|
7780
7780
|
|
|
7781
|
+
function obscureHeaders(config) {
|
|
7782
|
+
var _config$headers, _config$headers2;
|
|
7783
|
+
// Management, Delivery and Preview API tokens
|
|
7784
|
+
if (config !== null && config !== void 0 && (_config$headers = config.headers) !== null && _config$headers !== void 0 && _config$headers['Authorization']) {
|
|
7785
|
+
var token = "...".concat(config.headers['Authorization'].toString().substr(-5));
|
|
7786
|
+
config.headers['Authorization'] = "Bearer ".concat(token);
|
|
7787
|
+
}
|
|
7788
|
+
// Encoded Delivery or Preview token map for Cross-Space References
|
|
7789
|
+
if (config !== null && config !== void 0 && (_config$headers2 = config.headers) !== null && _config$headers2 !== void 0 && _config$headers2['X-Contentful-Resource-Resolution']) {
|
|
7790
|
+
var _token = "...".concat(config.headers['X-Contentful-Resource-Resolution'].toString().substr(-5));
|
|
7791
|
+
config.headers['X-Contentful-Resource-Resolution'] = _token;
|
|
7792
|
+
}
|
|
7793
|
+
}
|
|
7781
7794
|
/**
|
|
7782
7795
|
* Handles errors received from the server. Parses the error into a more useful
|
|
7783
7796
|
* format, places it in an exception and throws it.
|
|
@@ -7790,11 +7803,7 @@ var contentful = (function (exports) {
|
|
|
7790
7803
|
var config = errorResponse.config,
|
|
7791
7804
|
response = errorResponse.response;
|
|
7792
7805
|
var errorName;
|
|
7793
|
-
|
|
7794
|
-
if (config && config.headers && config.headers['Authorization']) {
|
|
7795
|
-
var token = "...".concat(config.headers['Authorization'].toString().substr(-5));
|
|
7796
|
-
config.headers['Authorization'] = "Bearer ".concat(token);
|
|
7797
|
-
}
|
|
7806
|
+
obscureHeaders(config);
|
|
7798
7807
|
if (!isPlainObject$1(response) || !isPlainObject$1(config)) {
|
|
7799
7808
|
throw errorResponse;
|
|
7800
7809
|
}
|
|
@@ -10089,7 +10098,7 @@ var contentful = (function (exports) {
|
|
|
10089
10098
|
http.defaults.baseURL = getGlobalOptions().environmentBaseUrl;
|
|
10090
10099
|
}
|
|
10091
10100
|
return {
|
|
10092
|
-
version: "11.5.
|
|
10101
|
+
version: "11.5.6",
|
|
10093
10102
|
getSpace: getSpace,
|
|
10094
10103
|
getContentType: getContentType,
|
|
10095
10104
|
getContentTypes: getContentTypes,
|
|
@@ -10216,7 +10225,7 @@ var contentful = (function (exports) {
|
|
|
10216
10225
|
environment: 'master'
|
|
10217
10226
|
};
|
|
10218
10227
|
var config = Object.assign(Object.assign({}, defaultConfig), params);
|
|
10219
|
-
var userAgentHeader = getUserAgentHeader("contentful.js/".concat("11.5.
|
|
10228
|
+
var userAgentHeader = getUserAgentHeader("contentful.js/".concat("11.5.6"), config.application, config.integration);
|
|
10220
10229
|
config.headers = Object.assign(Object.assign({}, config.headers), {
|
|
10221
10230
|
'Content-Type': 'application/vnd.contentful.delivery.v1+json',
|
|
10222
10231
|
'X-Contentful-User-Agent': userAgentHeader
|