contentful-management 10.12.1 → 10.14.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-management.browser.js +46 -2
- package/dist/contentful-management.browser.js.map +1 -1
- package/dist/contentful-management.browser.min.js +2 -2
- package/dist/contentful-management.node.js +43 -2
- package/dist/contentful-management.node.js.map +1 -1
- package/dist/contentful-management.node.min.js +1 -1
- package/dist/es-modules/adapters/REST/endpoints/entry.js +6 -0
- package/dist/es-modules/contentful-management.js +1 -1
- package/dist/es-modules/create-environment-api.js +33 -0
- package/dist/es-modules/plain/plain-client.js +1 -0
- package/dist/typings/adapters/REST/endpoints/entry.d.ts +1 -0
- package/dist/typings/common-types.d.ts +5 -0
- package/dist/typings/create-environment-api.d.ts +19 -0
- package/dist/typings/entities/entry.d.ts +9 -0
- package/dist/typings/export-types.d.ts +1 -1
- package/dist/typings/plain/common-types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -9724,12 +9724,13 @@ var update = function update(http, params, rawData, headers) {
|
|
|
9724
9724
|
/*!******************************************!*\
|
|
9725
9725
|
!*** ./adapters/REST/endpoints/entry.ts ***!
|
|
9726
9726
|
\******************************************/
|
|
9727
|
-
/*! exports provided: get, getMany, patch, update, del, publish, unpublish, archive, unarchive, create, createWithId, references */
|
|
9727
|
+
/*! exports provided: get, getPublished, getMany, patch, update, del, publish, unpublish, archive, unarchive, create, createWithId, references */
|
|
9728
9728
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
9729
9729
|
|
|
9730
9730
|
"use strict";
|
|
9731
9731
|
__webpack_require__.r(__webpack_exports__);
|
|
9732
9732
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "get", function() { return get; });
|
|
9733
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getPublished", function() { return getPublished; });
|
|
9733
9734
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMany", function() { return getMany; });
|
|
9734
9735
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "patch", function() { return patch; });
|
|
9735
9736
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "update", function() { return update; });
|
|
@@ -9760,6 +9761,12 @@ var get = function get(http, params, rawData, headers) {
|
|
|
9760
9761
|
headers: _objectSpread({}, headers)
|
|
9761
9762
|
});
|
|
9762
9763
|
};
|
|
9764
|
+
var getPublished = function getPublished(http, params, rawData, headers) {
|
|
9765
|
+
return _raw__WEBPACK_IMPORTED_MODULE_1__["get"](http, "/spaces/".concat(params.spaceId, "/environments/").concat(params.environmentId, "/public/entries"), {
|
|
9766
|
+
params: Object(_utils__WEBPACK_IMPORTED_MODULE_2__["normalizeSelect"])(params.query),
|
|
9767
|
+
headers: _objectSpread({}, headers)
|
|
9768
|
+
});
|
|
9769
|
+
};
|
|
9763
9770
|
var getMany = function getMany(http, params, rawData, headers) {
|
|
9764
9771
|
return _raw__WEBPACK_IMPORTED_MODULE_1__["get"](http, "/spaces/".concat(params.spaceId, "/environments/").concat(params.environmentId, "/entries"), {
|
|
9765
9772
|
params: Object(_utils__WEBPACK_IMPORTED_MODULE_2__["normalizeSelect"])(params.query),
|
|
@@ -12705,7 +12712,7 @@ function createClient(params) {
|
|
|
12705
12712
|
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
12706
12713
|
var sdkMain = opts.type === 'plain' ? 'contentful-management-plain.js' : 'contentful-management.js';
|
|
12707
12714
|
var userAgent = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["getUserAgentHeader"])( // @ts-expect-error
|
|
12708
|
-
"".concat(sdkMain, "/").concat("10.
|
|
12715
|
+
"".concat(sdkMain, "/").concat("10.14.0"), params.application, params.integration, params.feature);
|
|
12709
12716
|
var adapter = Object(_create_adapter__WEBPACK_IMPORTED_MODULE_1__["createAdapter"])(params); // Parameters<?> and ReturnType<?> only return the types of the last overload
|
|
12710
12717
|
// https://github.com/microsoft/TypeScript/issues/26591
|
|
12711
12718
|
// @ts-expect-error
|
|
@@ -14776,6 +14783,42 @@ function createEnvironmentApi(makeRequest) {
|
|
|
14776
14783
|
});
|
|
14777
14784
|
},
|
|
14778
14785
|
|
|
14786
|
+
/**
|
|
14787
|
+
* Gets a collection of published Entries
|
|
14788
|
+
* @param query - Object with search parameters. Check the <a href="https://www.contentful.com/developers/docs/javascript/tutorials/using-js-cda-sdk/#retrieving-entries-with-search-parameters">JS SDK tutorial</a> and the <a href="https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters">REST API reference</a> for more details.
|
|
14789
|
+
* @return Promise for a collection of published Entries
|
|
14790
|
+
* @example ```javascript
|
|
14791
|
+
* const contentful = require('contentful-management')
|
|
14792
|
+
*
|
|
14793
|
+
* const client = contentful.createClient({
|
|
14794
|
+
* accessToken: '<content_management_api_key>'
|
|
14795
|
+
* })
|
|
14796
|
+
*
|
|
14797
|
+
* client.getSpace('<space_id>')
|
|
14798
|
+
* .then((space) => space.getEnvironment('<environment-id>'))
|
|
14799
|
+
* .then((environment) => environment.getPublishedEntries({'content_type': 'foo'})) // you can add more queries as 'key': 'value'
|
|
14800
|
+
* .then((response) => console.log(response.items))
|
|
14801
|
+
* .catch(console.error)
|
|
14802
|
+
* ```
|
|
14803
|
+
*/
|
|
14804
|
+
getPublishedEntries: function getPublishedEntries() {
|
|
14805
|
+
var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
14806
|
+
var raw = this.toPlainObject();
|
|
14807
|
+
return makeRequest({
|
|
14808
|
+
entityType: 'Entry',
|
|
14809
|
+
action: 'getPublished',
|
|
14810
|
+
params: {
|
|
14811
|
+
spaceId: raw.sys.space.sys.id,
|
|
14812
|
+
environmentId: raw.sys.id,
|
|
14813
|
+
query: Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["createRequestConfig"])({
|
|
14814
|
+
query: query
|
|
14815
|
+
}).params
|
|
14816
|
+
}
|
|
14817
|
+
}).then(function (data) {
|
|
14818
|
+
return wrapEntryCollection(makeRequest, data);
|
|
14819
|
+
});
|
|
14820
|
+
},
|
|
14821
|
+
|
|
14779
14822
|
/**
|
|
14780
14823
|
* Creates a Entry
|
|
14781
14824
|
* @param contentTypeId - The Content Type ID of the newly created Entry
|
|
@@ -23468,6 +23511,7 @@ var createPlainClient = function createPlainClient(makeRequest, defaults, alphaF
|
|
|
23468
23511
|
delete: Object(_wrappers_wrap__WEBPACK_IMPORTED_MODULE_2__["wrap"])(wrapParams, 'Task', 'delete')
|
|
23469
23512
|
},
|
|
23470
23513
|
entry: {
|
|
23514
|
+
getPublished: Object(_wrappers_wrap__WEBPACK_IMPORTED_MODULE_2__["wrap"])(wrapParams, 'Entry', 'getPublished'),
|
|
23471
23515
|
getMany: Object(_wrappers_wrap__WEBPACK_IMPORTED_MODULE_2__["wrap"])(wrapParams, 'Entry', 'getMany'),
|
|
23472
23516
|
get: Object(_wrappers_wrap__WEBPACK_IMPORTED_MODULE_2__["wrap"])(wrapParams, 'Entry', 'get'),
|
|
23473
23517
|
update: Object(_wrappers_wrap__WEBPACK_IMPORTED_MODULE_2__["wrap"])(wrapParams, 'Entry', 'update'),
|