contentful-management 9.2.1 → 10.0.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/README.md +0 -12
- package/dist/contentful-management.browser.js +29 -11
- package/dist/contentful-management.browser.js.map +1 -1
- package/dist/contentful-management.browser.min.js +1 -1
- package/dist/contentful-management.node.js +580 -596
- 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/api-key.js +15 -15
- package/dist/es-modules/adapters/REST/endpoints/app-action-call.js +2 -2
- package/dist/es-modules/adapters/REST/endpoints/app-action.js +7 -11
- package/dist/es-modules/adapters/REST/endpoints/app-bundle.js +10 -14
- package/dist/es-modules/adapters/REST/endpoints/app-definition.js +9 -13
- package/dist/es-modules/adapters/REST/endpoints/app-details.js +6 -6
- package/dist/es-modules/adapters/REST/endpoints/app-installation.js +7 -11
- package/dist/es-modules/adapters/REST/endpoints/app-signed-request.js +2 -2
- package/dist/es-modules/adapters/REST/endpoints/app-signing-secret.js +6 -6
- package/dist/es-modules/adapters/REST/endpoints/app-upload.js +9 -13
- package/dist/es-modules/adapters/REST/endpoints/asset-key.js +18 -56
- package/dist/es-modules/adapters/REST/endpoints/asset.js +110 -121
- package/dist/es-modules/adapters/REST/endpoints/bulk-action.js +8 -8
- package/dist/es-modules/adapters/REST/endpoints/comment.js +14 -22
- package/dist/es-modules/adapters/REST/endpoints/content-type.js +19 -23
- package/dist/es-modules/adapters/REST/endpoints/editor-interface.js +6 -8
- package/dist/es-modules/adapters/REST/endpoints/entry.js +32 -33
- package/dist/es-modules/adapters/REST/endpoints/environment-alias.js +9 -13
- package/dist/es-modules/adapters/REST/endpoints/environment.js +16 -16
- package/dist/es-modules/adapters/REST/endpoints/extension.js +20 -36
- package/dist/es-modules/adapters/REST/endpoints/http.js +24 -18
- package/dist/es-modules/adapters/REST/endpoints/index.js +47 -47
- package/dist/es-modules/adapters/REST/endpoints/locale.js +13 -13
- package/dist/es-modules/adapters/REST/endpoints/organization-invitation.js +6 -6
- package/dist/es-modules/adapters/REST/endpoints/organization-membership.js +9 -13
- package/dist/es-modules/adapters/REST/endpoints/organization.js +6 -8
- package/dist/es-modules/adapters/REST/endpoints/personal-access-token.js +7 -7
- package/dist/es-modules/adapters/REST/endpoints/preview-api-key.js +4 -4
- package/dist/es-modules/adapters/REST/endpoints/raw.js +7 -19
- package/dist/es-modules/adapters/REST/endpoints/release-action.js +4 -4
- package/dist/es-modules/adapters/REST/endpoints/release.js +20 -20
- package/dist/es-modules/adapters/REST/endpoints/role.js +15 -15
- package/dist/es-modules/adapters/REST/endpoints/scheduled-action.js +10 -10
- package/dist/es-modules/adapters/REST/endpoints/snapshot.js +8 -16
- package/dist/es-modules/adapters/REST/endpoints/space-member.js +4 -8
- package/dist/es-modules/adapters/REST/endpoints/space-membership.js +15 -19
- package/dist/es-modules/adapters/REST/endpoints/space.js +10 -16
- package/dist/es-modules/adapters/REST/endpoints/tag.js +13 -21
- package/dist/es-modules/adapters/REST/endpoints/task.js +14 -22
- package/dist/es-modules/adapters/REST/endpoints/team-membership.js +12 -22
- package/dist/es-modules/adapters/REST/endpoints/team-space-membership.js +15 -23
- package/dist/es-modules/adapters/REST/endpoints/team.js +13 -23
- package/dist/es-modules/adapters/REST/endpoints/upload.js +10 -10
- package/dist/es-modules/adapters/REST/endpoints/usage.js +4 -4
- package/dist/es-modules/adapters/REST/endpoints/user.js +11 -13
- package/dist/es-modules/adapters/REST/endpoints/webhook.js +28 -52
- package/dist/es-modules/adapters/REST/endpoints/workflow-definition.js +18 -26
- package/dist/es-modules/adapters/REST/endpoints/workflow.js +18 -26
- package/dist/es-modules/adapters/REST/endpoints/workflows-changelog.js +5 -9
- package/dist/es-modules/adapters/REST/rest-adapter.js +35 -65
- package/dist/es-modules/common-utils.js +8 -24
- package/dist/es-modules/constants/editor-interface-defaults/controls-defaults.js +12 -14
- package/dist/es-modules/constants/editor-interface-defaults/editors-defaults.js +5 -5
- package/dist/es-modules/constants/editor-interface-defaults/index.js +4 -4
- package/dist/es-modules/constants/editor-interface-defaults/sidebar-defaults.js +10 -10
- package/dist/es-modules/constants/editor-interface-defaults/types.js +3 -5
- package/dist/es-modules/contentful-management.js +8 -11
- package/dist/es-modules/create-app-definition-api.js +22 -32
- package/dist/es-modules/create-contentful-api.js +39 -65
- package/dist/es-modules/create-entry-api.js +83 -115
- package/dist/es-modules/create-environment-api.js +266 -372
- package/dist/es-modules/create-organization-api.js +161 -227
- package/dist/es-modules/create-space-api.js +188 -270
- package/dist/es-modules/enhance-with-methods.js +1 -1
- package/dist/es-modules/entities/api-key.js +8 -10
- package/dist/es-modules/entities/app-action-call.js +1 -1
- package/dist/es-modules/entities/app-action.js +11 -13
- package/dist/es-modules/entities/app-bundle.js +10 -12
- package/dist/es-modules/entities/app-definition.js +3 -3
- package/dist/es-modules/entities/app-details.js +8 -10
- package/dist/es-modules/entities/app-installation.js +12 -16
- package/dist/es-modules/entities/app-signed-request.js +1 -1
- package/dist/es-modules/entities/app-signing-secret.js +7 -9
- package/dist/es-modules/entities/app-upload.js +9 -11
- package/dist/es-modules/entities/asset-key.js +1 -1
- package/dist/es-modules/entities/asset.js +27 -41
- package/dist/es-modules/entities/bulk-action.js +23 -57
- package/dist/es-modules/entities/comment.js +14 -18
- package/dist/es-modules/entities/content-type.js +42 -58
- package/dist/es-modules/entities/editor-interface.js +8 -10
- package/dist/es-modules/entities/entry.js +3 -3
- package/dist/es-modules/entities/environment-alias.js +12 -16
- package/dist/es-modules/entities/environment.js +4 -4
- package/dist/es-modules/entities/extension.js +12 -16
- package/dist/es-modules/entities/index.js +44 -44
- package/dist/es-modules/entities/locale.js +13 -17
- package/dist/es-modules/entities/organization-invitation.js +1 -1
- package/dist/es-modules/entities/organization-membership.js +11 -15
- package/dist/es-modules/entities/organization.js +4 -4
- package/dist/es-modules/entities/personal-access-token.js +4 -6
- package/dist/es-modules/entities/preview-api-key.js +3 -3
- package/dist/es-modules/entities/release-action.js +21 -56
- package/dist/es-modules/entities/release.js +77 -173
- package/dist/es-modules/entities/role.js +11 -15
- package/dist/es-modules/entities/scheduled-action.js +31 -56
- package/dist/es-modules/entities/snapshot.js +3 -3
- package/dist/es-modules/entities/space-member.js +2 -2
- package/dist/es-modules/entities/space-membership.js +11 -15
- package/dist/es-modules/entities/space.js +4 -4
- package/dist/es-modules/entities/tag.js +13 -17
- package/dist/es-modules/entities/task.js +14 -18
- package/dist/es-modules/entities/team-membership.js +12 -16
- package/dist/es-modules/entities/team-space-membership.js +11 -15
- package/dist/es-modules/entities/team.js +11 -15
- package/dist/es-modules/entities/upload.js +13 -26
- package/dist/es-modules/entities/usage.js +3 -3
- package/dist/es-modules/entities/user.js +3 -3
- package/dist/es-modules/entities/webhook.js +14 -18
- package/dist/es-modules/entities/workflow-definition.js +35 -18
- package/dist/es-modules/entities/workflow.js +15 -19
- package/dist/es-modules/entities/workflows-changelog-entry.js +3 -3
- package/dist/es-modules/methods/action.js +39 -123
- package/dist/es-modules/methods/bulk-action.js +14 -33
- package/dist/es-modules/methods/content-type.js +11 -13
- package/dist/es-modules/methods/release-action.js +16 -34
- package/dist/es-modules/methods/utils.js +1 -3
- package/dist/es-modules/plain/as-iterator.js +50 -68
- package/dist/es-modules/plain/checks.js +4 -10
- package/dist/es-modules/plain/plain-client.js +119 -141
- package/dist/es-modules/plain/wrappers/wrap.js +17 -19
- package/dist/es-modules/upload-http-client.js +4 -4
- package/dist/typings/common-types.d.ts +0 -4
- package/dist/typings/create-environment-api.d.ts +0 -1
- package/dist/typings/entities/content-type.d.ts +9 -2
- package/dist/typings/entities/entry.d.ts +0 -4
- package/dist/typings/entities/workflow-definition.d.ts +21 -6
- package/dist/typings/export-types.d.ts +1 -1
- package/dist/typings/plain/common-types.d.ts +0 -4
- package/package.json +2 -11
- package/dist/contentful-management.legacy.js +0 -23641
- package/dist/contentful-management.legacy.js.map +0 -1
- package/dist/contentful-management.legacy.min.js +0 -1
package/README.md
CHANGED
|
@@ -29,7 +29,6 @@ Browsers and Node.js:
|
|
|
29
29
|
- Edge
|
|
30
30
|
- Safari
|
|
31
31
|
- node.js (LTS)
|
|
32
|
-
- IE11 (with [legacy version](#legacy-contentful-managementjs) of the library)
|
|
33
32
|
|
|
34
33
|
Other browsers should also work, but at the moment we're only running automated tests on the browsers and Node.js versions specified above.
|
|
35
34
|
|
|
@@ -67,7 +66,6 @@ For browsers, we recommend to download the library via npm or yarn to ensure 100
|
|
|
67
66
|
If you'd like to use a standalone built file you can use the following script tag or download it from [jsDelivr](https://www.jsdelivr.com/package/npm/contentful-management), under the `dist` directory:
|
|
68
67
|
|
|
69
68
|
```html
|
|
70
|
-
<script src="https://cdn.jsdelivr.net/npm/regenerator-runtime@latest/runtime.min.js"></script>
|
|
71
69
|
<script src="https://cdn.jsdelivr.net/npm/contentful-management@latest/dist/contentful-management.browser.min.js"></script>
|
|
72
70
|
```
|
|
73
71
|
|
|
@@ -356,10 +354,6 @@ Read the [Contentful for JavaScript](https://www.contentful.com/developers/docs/
|
|
|
356
354
|
|
|
357
355
|
This library is a wrapper around our Contentful Management REST API. Some more specific details such as search parameters and pagination are better explained on the [REST API reference](https://www.contentful.com/developers/docs/references/content-management-api/), and you can also get a better understanding of how the requests look under the hood.
|
|
358
356
|
|
|
359
|
-
### Legacy contentful-management.js
|
|
360
|
-
|
|
361
|
-
For versions prior to 1.0.0, you can access documentation at [https://github.com/contentful/contentful-management.js/tree/legacy](https://github.com/contentful/contentful.js/tree/legacy)
|
|
362
|
-
|
|
363
357
|
## Versioning
|
|
364
358
|
|
|
365
359
|
This project strictly follows [Semantic Versioning](http://semver.org/) by use of [semantic-release](https://github.com/semantic-release/semantic-release).
|
|
@@ -368,12 +362,6 @@ This means that new versions are released automatically as fixes, features or br
|
|
|
368
362
|
|
|
369
363
|
You can check the changelog on the [releases](https://github.com/contentful/contentful-management.js/releases) page.
|
|
370
364
|
|
|
371
|
-
## Migration from contentful-management.js 3.x
|
|
372
|
-
|
|
373
|
-
The bundle for browsers is now called `contentful-management.browser.min.js` to mark it clearly as browser only bundle. If you need to support IE 11 or other old browsers, you may use the `contentful-management.legacy.min.js`. Node will automatically use the `contentful-management.node.min.js` while bundlers like Webpack will resolve to the new ES-modules version of the library.
|
|
374
|
-
|
|
375
|
-
No changes to the API of the library were made.
|
|
376
|
-
|
|
377
365
|
## Migration from contentful-management.js 1.x and older
|
|
378
366
|
|
|
379
367
|
contentful.js 1.x was a major rewrite, with some API changes. While the base functionality remains the same, some method names have changed, as well as some internal behaviors.
|
|
@@ -7406,9 +7406,8 @@ var references = function references(http, params) {
|
|
|
7406
7406
|
var spaceId = params.spaceId,
|
|
7407
7407
|
environmentId = params.environmentId,
|
|
7408
7408
|
entryId = params.entryId,
|
|
7409
|
-
maxDepth = params.maxDepth,
|
|
7410
7409
|
include = params.include;
|
|
7411
|
-
var level = include ||
|
|
7410
|
+
var level = include || 2;
|
|
7412
7411
|
return _raw__WEBPACK_IMPORTED_MODULE_1__["get"](http, "/spaces/".concat(spaceId, "/environments/").concat(environmentId, "/entries/").concat(entryId, "/references?include=").concat(level));
|
|
7413
7412
|
};
|
|
7414
7413
|
|
|
@@ -10182,7 +10181,7 @@ function createClient(params) {
|
|
|
10182
10181
|
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
10183
10182
|
var sdkMain = opts.type === 'plain' ? 'contentful-management-plain.js' : 'contentful-management.js';
|
|
10184
10183
|
var userAgent = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["getUserAgentHeader"])( // @ts-expect-error
|
|
10185
|
-
"".concat(sdkMain, "/").concat("
|
|
10184
|
+
"".concat(sdkMain, "/").concat("10.0.0"), params.application, params.integration, params.feature);
|
|
10186
10185
|
var adapter = Object(_create_adapter__WEBPACK_IMPORTED_MODULE_1__["createAdapter"])(params); // Parameters<?> and ReturnType<?> only return the types of the last overload
|
|
10187
10186
|
// https://github.com/microsoft/TypeScript/issues/26591
|
|
10188
10187
|
// @ts-expect-error
|
|
@@ -11428,7 +11427,7 @@ function createEntryApi(makeRequest) {
|
|
|
11428
11427
|
spaceId: raw.sys.space.sys.id,
|
|
11429
11428
|
environmentId: raw.sys.environment.sys.id,
|
|
11430
11429
|
entryId: raw.sys.id,
|
|
11431
|
-
|
|
11430
|
+
include: options === null || options === void 0 ? void 0 : options.include
|
|
11432
11431
|
}
|
|
11433
11432
|
}).then(function (response) {
|
|
11434
11433
|
return wrapEntryCollection(makeRequest, response);
|
|
@@ -12270,7 +12269,6 @@ function createEnvironmentApi(makeRequest) {
|
|
|
12270
12269
|
* Get entry references
|
|
12271
12270
|
* @param entryId - Entry ID
|
|
12272
12271
|
* @param {Object} options.include - Level of the entry descendants from 1 up to 10 maximum
|
|
12273
|
-
* @param {Object} options.maxDepth - alias for `include`. Deprecated, please use `include`
|
|
12274
12272
|
* @returns Promise of Entry references
|
|
12275
12273
|
* @example ```javascript
|
|
12276
12274
|
* const contentful = require('contentful-management');
|
|
@@ -12298,11 +12296,7 @@ function createEnvironmentApi(makeRequest) {
|
|
|
12298
12296
|
spaceId: raw.sys.space.sys.id,
|
|
12299
12297
|
environmentId: raw.sys.id,
|
|
12300
12298
|
entryId: entryId,
|
|
12301
|
-
|
|
12302
|
-
/**
|
|
12303
|
-
* @deprecated use `include` instead
|
|
12304
|
-
*/
|
|
12305
|
-
maxDepth: (options === null || options === void 0 ? void 0 : options.include) || (options === null || options === void 0 ? void 0 : options.maxDepth)
|
|
12299
|
+
include: options === null || options === void 0 ? void 0 : options.include
|
|
12306
12300
|
}
|
|
12307
12301
|
}).then(function (response) {
|
|
12308
12302
|
return wrapEntryCollection(makeRequest, response);
|
|
@@ -19809,11 +19803,14 @@ var wrapWebhookCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_2__["w
|
|
|
19809
19803
|
/*!*****************************************!*\
|
|
19810
19804
|
!*** ./entities/workflow-definition.ts ***!
|
|
19811
19805
|
\*****************************************/
|
|
19812
|
-
/*! exports provided: WorkflowStepActionType, default, wrapWorkflowDefinition, wrapWorkflowDefinitionCollection */
|
|
19806
|
+
/*! exports provided: WorkflowStepPermissionType, WorkflowStepPermissionAction, WorkflowStepPermissionEffect, WorkflowStepActionType, default, wrapWorkflowDefinition, wrapWorkflowDefinitionCollection */
|
|
19813
19807
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
19814
19808
|
|
|
19815
19809
|
"use strict";
|
|
19816
19810
|
__webpack_require__.r(__webpack_exports__);
|
|
19811
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkflowStepPermissionType", function() { return WorkflowStepPermissionType; });
|
|
19812
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkflowStepPermissionAction", function() { return WorkflowStepPermissionAction; });
|
|
19813
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkflowStepPermissionEffect", function() { return WorkflowStepPermissionEffect; });
|
|
19817
19814
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkflowStepActionType", function() { return WorkflowStepActionType; });
|
|
19818
19815
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return createWorkflowDefinitionApi; });
|
|
19819
19816
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapWorkflowDefinition", function() { return wrapWorkflowDefinition; });
|
|
@@ -19833,6 +19830,27 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
19833
19830
|
|
|
19834
19831
|
|
|
19835
19832
|
|
|
19833
|
+
/* Workflow Step Permission */
|
|
19834
|
+
|
|
19835
|
+
var WorkflowStepPermissionType;
|
|
19836
|
+
|
|
19837
|
+
(function (WorkflowStepPermissionType) {
|
|
19838
|
+
WorkflowStepPermissionType["EntityPermission"] = "entity_permission";
|
|
19839
|
+
})(WorkflowStepPermissionType || (WorkflowStepPermissionType = {}));
|
|
19840
|
+
|
|
19841
|
+
var WorkflowStepPermissionAction;
|
|
19842
|
+
|
|
19843
|
+
(function (WorkflowStepPermissionAction) {
|
|
19844
|
+
WorkflowStepPermissionAction["Edit"] = "edit";
|
|
19845
|
+
WorkflowStepPermissionAction["Publish"] = "publish";
|
|
19846
|
+
})(WorkflowStepPermissionAction || (WorkflowStepPermissionAction = {}));
|
|
19847
|
+
|
|
19848
|
+
var WorkflowStepPermissionEffect;
|
|
19849
|
+
|
|
19850
|
+
(function (WorkflowStepPermissionEffect) {
|
|
19851
|
+
WorkflowStepPermissionEffect["Allow"] = "allow";
|
|
19852
|
+
WorkflowStepPermissionEffect["Deny"] = "deny";
|
|
19853
|
+
})(WorkflowStepPermissionEffect || (WorkflowStepPermissionEffect = {}));
|
|
19836
19854
|
|
|
19837
19855
|
/* Workflow Step Action */
|
|
19838
19856
|
var WorkflowStepActionType;
|