contentful-management 7.7.0 → 7.8.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/CHANGELOG.md +2 -2
- package/dist/contentful-management.browser.js +29 -1
- package/dist/contentful-management.browser.js.map +1 -1
- package/dist/contentful-management.browser.min.js +1 -1
- package/dist/contentful-management.legacy.js +29 -1
- package/dist/contentful-management.legacy.js.map +1 -1
- package/dist/contentful-management.legacy.min.js +1 -1
- package/dist/contentful-management.node.js +29 -1
- package/dist/contentful-management.node.js.map +1 -1
- package/dist/contentful-management.node.min.js +1 -1
- package/dist/es-modules/create-cma-http-client.js +1 -1
- package/dist/es-modules/create-environment-api.js +28 -0
- package/dist/typings/create-environment-api.d.ts +19 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# [7.
|
|
1
|
+
# [7.8.0](https://github.com/contentful/contentful-management.js/compare/v7.7.0...v7.8.0) (2021-02-09)
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
### Features
|
|
5
5
|
|
|
6
|
-
*
|
|
6
|
+
* be able to directly delete an entry by its Id ([#610](https://github.com/contentful/contentful-management.js/issues/610)) ([99f8c40](https://github.com/contentful/contentful-management.js/commit/99f8c40a1893f1f76fc3329cc88f2c239d984333))
|
|
@@ -4364,7 +4364,7 @@ function createCMAHttpClient(params) {
|
|
|
4364
4364
|
var plainClient = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
4365
4365
|
var sdkMain = plainClient ? 'contentful-management-plain.js' : 'contentful-management.js';
|
|
4366
4366
|
var userAgentHeader = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["getUserAgentHeader"])( // @ts-expect-error
|
|
4367
|
-
"".concat(sdkMain, "/").concat("7.
|
|
4367
|
+
"".concat(sdkMain, "/").concat("7.8.0"), params.application, params.integration, params.feature);
|
|
4368
4368
|
var requiredHeaders = {
|
|
4369
4369
|
'Content-Type': 'application/vnd.contentful.management.v1+json',
|
|
4370
4370
|
'X-Contentful-User-Agent': userAgentHeader
|
|
@@ -5134,6 +5134,34 @@ function createEnvironmentApi(_ref) {
|
|
|
5134
5134
|
});
|
|
5135
5135
|
},
|
|
5136
5136
|
|
|
5137
|
+
/**
|
|
5138
|
+
* Deletes an Entry of this environement
|
|
5139
|
+
* @param id - Entry ID
|
|
5140
|
+
* @return Promise for the deletion. It contains no data, but the Promise error case should be handled.
|
|
5141
|
+
* @example ```javascript
|
|
5142
|
+
* const contentful = require('contentful-management')
|
|
5143
|
+
*
|
|
5144
|
+
* const client = contentful.createClient({
|
|
5145
|
+
* accessToken: '<content_management_api_key>'
|
|
5146
|
+
* })
|
|
5147
|
+
*
|
|
5148
|
+
* client.getSpace('<space_id>')
|
|
5149
|
+
* .then((space) => space.getEnvironment('<environment-id>'))
|
|
5150
|
+
* .then((environment) => environment.deleteEntry("4bmLXiuviAZH3jkj5DLRWE"))
|
|
5151
|
+
* .then(() => console.log('Entry deleted.'))
|
|
5152
|
+
* .catch(console.error)
|
|
5153
|
+
* ```
|
|
5154
|
+
*/
|
|
5155
|
+
deleteEntry: function deleteEntry(id) {
|
|
5156
|
+
var raw = this.toPlainObject();
|
|
5157
|
+
return _plain_endpoints__WEBPACK_IMPORTED_MODULE_2__["entry"].del(http, {
|
|
5158
|
+
spaceId: raw.sys.space.sys.id,
|
|
5159
|
+
environmentId: raw.sys.id,
|
|
5160
|
+
entryId: id
|
|
5161
|
+
}).then(function () {// noop
|
|
5162
|
+
});
|
|
5163
|
+
},
|
|
5164
|
+
|
|
5137
5165
|
/**
|
|
5138
5166
|
* Gets a collection of Entries
|
|
5139
5167
|
* Warning: if you are using the select operator, when saving, any field that was not selected will be removed
|