contentful 11.5.5 → 11.5.7

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.
@@ -2741,7 +2741,7 @@ var contentful = (function (exports) {
2741
2741
  headers = newConfig.headers,
2742
2742
  auth = newConfig.auth;
2743
2743
  newConfig.headers = headers = AxiosHeaders$1.from(headers);
2744
- newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config.params, config.paramsSerializer);
2744
+ newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
2745
2745
 
2746
2746
  // HTTP basic authentication
2747
2747
  if (auth) {
@@ -3571,7 +3571,7 @@ var contentful = (function (exports) {
3571
3571
  return Promise.reject(reason);
3572
3572
  });
3573
3573
  }
3574
- var VERSION = "1.8.2";
3574
+ var VERSION = "1.8.3";
3575
3575
  var validators$1 = {};
3576
3576
 
3577
3577
  // eslint-disable-next-line func-names
@@ -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
- // Obscure the Management token
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.5",
10101
+ version: "11.5.7",
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.5"), config.application, config.integration);
10228
+ var userAgentHeader = getUserAgentHeader("contentful.js/".concat("11.5.7"), 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