contentful 10.9.3 → 10.10.0
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 +40 -9
- package/dist/contentful.browser.js.map +1 -1
- package/dist/contentful.browser.min.js +1 -1
- package/dist/contentful.node.js +40 -9
- package/dist/contentful.node.js.map +1 -1
- package/dist/contentful.node.min.js +1 -1
- package/dist/types/utils/query-selection-set.d.ts +1 -0
- package/package.json +1 -1
|
@@ -5077,7 +5077,7 @@ function createClient(params) {
|
|
|
5077
5077
|
environment: 'master',
|
|
5078
5078
|
};
|
|
5079
5079
|
const config = Object.assign(Object.assign({}, defaultConfig), params);
|
|
5080
|
-
const userAgentHeader = (0,contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__.getUserAgentHeader)(`contentful.js/${"10.
|
|
5080
|
+
const userAgentHeader = (0,contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__.getUserAgentHeader)(`contentful.js/${"10.10.0"}`, config.application, config.integration);
|
|
5081
5081
|
config.headers = Object.assign(Object.assign({}, config.headers), { 'Content-Type': 'application/vnd.contentful.delivery.v1+json', 'X-Contentful-User-Agent': userAgentHeader });
|
|
5082
5082
|
const http = (0,contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__.createHttpClient)(axios__WEBPACK_IMPORTED_MODULE_4__["default"], config);
|
|
5083
5083
|
if (!http.defaults.baseURL) {
|
|
@@ -5119,6 +5119,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5119
5119
|
/* harmony import */ var _utils_validate_params__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/validate-params */ "./utils/validate-params.ts");
|
|
5120
5120
|
/* harmony import */ var _utils_validate_search_parameters__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/validate-search-parameters */ "./utils/validate-search-parameters.ts");
|
|
5121
5121
|
/* harmony import */ var _utils_validate_timestamp__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils/validate-timestamp */ "./utils/validate-timestamp.ts");
|
|
5122
|
+
/* harmony import */ var _utils_query_selection_set__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils/query-selection-set */ "./utils/query-selection-set.ts");
|
|
5122
5123
|
/**
|
|
5123
5124
|
* Contentful Delivery API Client. Contains methods which allow access to the
|
|
5124
5125
|
* different kinds of entities present in Contentful (Entries, Assets, etc).
|
|
@@ -5131,6 +5132,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5131
5132
|
|
|
5132
5133
|
|
|
5133
5134
|
|
|
5135
|
+
|
|
5134
5136
|
const ASSET_KEY_MAX_LIFETIME = 48 * 60 * 60;
|
|
5135
5137
|
class NotFoundError extends Error {
|
|
5136
5138
|
constructor(id, environment, space) {
|
|
@@ -5168,6 +5170,12 @@ function createContentfulApi({ http, getGlobalOptions }, options) {
|
|
|
5168
5170
|
const areAllowed = (0,_utils_validate_params__WEBPACK_IMPORTED_MODULE_5__.checkIncludeContentSourceMapsParamIsAllowed)(host, alphaFeatures);
|
|
5169
5171
|
if (areAllowed) {
|
|
5170
5172
|
query.includeContentSourceMaps = true;
|
|
5173
|
+
// Ensure that content source maps and required attributes are selected
|
|
5174
|
+
if (query.select) {
|
|
5175
|
+
const selection = (0,_utils_query_selection_set__WEBPACK_IMPORTED_MODULE_8__["default"])(query);
|
|
5176
|
+
selection.add('sys');
|
|
5177
|
+
query.select = Array.from(selection).join(',');
|
|
5178
|
+
}
|
|
5171
5179
|
}
|
|
5172
5180
|
return query;
|
|
5173
5181
|
}
|
|
@@ -5405,7 +5413,7 @@ function createContentfulApi({ http, getGlobalOptions }, options) {
|
|
|
5405
5413
|
http.defaults.baseURL = getGlobalOptions().environmentBaseUrl;
|
|
5406
5414
|
}
|
|
5407
5415
|
return {
|
|
5408
|
-
version: "10.
|
|
5416
|
+
version: "10.10.0",
|
|
5409
5417
|
getSpace,
|
|
5410
5418
|
getContentType,
|
|
5411
5419
|
getContentTypes,
|
|
@@ -6122,6 +6130,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6122
6130
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6123
6131
|
/* harmony export */ "default": function() { return /* binding */ normalizeSelect; }
|
|
6124
6132
|
/* harmony export */ });
|
|
6133
|
+
/* harmony import */ var _query_selection_set__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./query-selection-set */ "./utils/query-selection-set.ts");
|
|
6134
|
+
|
|
6125
6135
|
/*
|
|
6126
6136
|
* sdk relies heavily on sys metadata
|
|
6127
6137
|
* so we cannot omit the sys property on sdk level entirely
|
|
@@ -6131,13 +6141,7 @@ function normalizeSelect(query) {
|
|
|
6131
6141
|
if (!query.select) {
|
|
6132
6142
|
return query;
|
|
6133
6143
|
}
|
|
6134
|
-
|
|
6135
|
-
// Get the different parts that are listed for selection
|
|
6136
|
-
const allSelects = Array.isArray(query.select)
|
|
6137
|
-
? query.select
|
|
6138
|
-
: query.select.split(',').map((q) => q.trim());
|
|
6139
|
-
// Move the parts into a set for easy access and deduplication
|
|
6140
|
-
const selectedSet = new Set(allSelects);
|
|
6144
|
+
const selectedSet = (0,_query_selection_set__WEBPACK_IMPORTED_MODULE_0__["default"])(query);
|
|
6141
6145
|
// If we already select all of `sys` we can just return
|
|
6142
6146
|
// since we're anyway fetching everything that is needed
|
|
6143
6147
|
if (selectedSet.has('sys')) {
|
|
@@ -6151,6 +6155,33 @@ function normalizeSelect(query) {
|
|
|
6151
6155
|
}
|
|
6152
6156
|
|
|
6153
6157
|
|
|
6158
|
+
/***/ }),
|
|
6159
|
+
|
|
6160
|
+
/***/ "./utils/query-selection-set.ts":
|
|
6161
|
+
/*!**************************************!*\
|
|
6162
|
+
!*** ./utils/query-selection-set.ts ***!
|
|
6163
|
+
\**************************************/
|
|
6164
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6165
|
+
|
|
6166
|
+
"use strict";
|
|
6167
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6168
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6169
|
+
/* harmony export */ "default": function() { return /* binding */ getQuerySelectionSet; }
|
|
6170
|
+
/* harmony export */ });
|
|
6171
|
+
function getQuerySelectionSet(query) {
|
|
6172
|
+
if (!query.select) {
|
|
6173
|
+
return new Set();
|
|
6174
|
+
}
|
|
6175
|
+
// The selection of fields for the query is limited
|
|
6176
|
+
// Get the different parts that are listed for selection
|
|
6177
|
+
const allSelects = Array.isArray(query.select)
|
|
6178
|
+
? query.select
|
|
6179
|
+
: query.select.split(',').map((q) => q.trim());
|
|
6180
|
+
// Move the parts into a set for easy access and deduplication
|
|
6181
|
+
return new Set(allSelects);
|
|
6182
|
+
}
|
|
6183
|
+
|
|
6184
|
+
|
|
6154
6185
|
/***/ }),
|
|
6155
6186
|
|
|
6156
6187
|
/***/ "./utils/resolve-circular.ts":
|