contentful-management 7.22.0 → 7.22.4

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.
Files changed (52) hide show
  1. package/CHANGELOG.md +3 -3
  2. package/dist/contentful-management.browser.js +70 -34
  3. package/dist/contentful-management.browser.js.map +1 -1
  4. package/dist/contentful-management.browser.min.js +1 -1
  5. package/dist/contentful-management.legacy.js +70 -34
  6. package/dist/contentful-management.legacy.js.map +1 -1
  7. package/dist/contentful-management.legacy.min.js +1 -1
  8. package/dist/contentful-management.node.js +43 -20
  9. package/dist/contentful-management.node.js.map +1 -1
  10. package/dist/contentful-management.node.min.js +1 -1
  11. package/dist/es-modules/adapters/REST/endpoints/scheduled-action.js +5 -1
  12. package/dist/es-modules/contentful-management.js +1 -1
  13. package/dist/es-modules/create-environment-api.js +12 -10
  14. package/dist/es-modules/entities/release.js +48 -21
  15. package/dist/es-modules/entities/scheduled-action.js +4 -1
  16. package/dist/typings/common-types.d.ts +1 -1
  17. package/dist/typings/create-environment-api.d.ts +12 -10
  18. package/dist/typings/entities/api-key.d.ts +59 -35
  19. package/dist/typings/entities/app-bundle.d.ts +59 -35
  20. package/dist/typings/entities/app-definition.d.ts +59 -43
  21. package/dist/typings/entities/app-installation.d.ts +59 -35
  22. package/dist/typings/entities/app-upload.d.ts +59 -35
  23. package/dist/typings/entities/asset.d.ts +59 -35
  24. package/dist/typings/entities/content-type.d.ts +59 -35
  25. package/dist/typings/entities/editor-interface.d.ts +59 -35
  26. package/dist/typings/entities/entry.d.ts +59 -35
  27. package/dist/typings/entities/environment-alias.d.ts +59 -35
  28. package/dist/typings/entities/environment.d.ts +59 -35
  29. package/dist/typings/entities/extension.d.ts +59 -107
  30. package/dist/typings/entities/locale.d.ts +59 -35
  31. package/dist/typings/entities/organization-membership.d.ts +59 -35
  32. package/dist/typings/entities/organization.d.ts +59 -35
  33. package/dist/typings/entities/personal-access-token.d.ts +59 -35
  34. package/dist/typings/entities/preview-api-key.d.ts +59 -35
  35. package/dist/typings/entities/release-action.d.ts +59 -35
  36. package/dist/typings/entities/release.d.ts +4 -2
  37. package/dist/typings/entities/role.d.ts +59 -71
  38. package/dist/typings/entities/scheduled-action.d.ts +59 -35
  39. package/dist/typings/entities/snapshot.d.ts +59 -35
  40. package/dist/typings/entities/space-member.d.ts +59 -35
  41. package/dist/typings/entities/space-membership.d.ts +59 -35
  42. package/dist/typings/entities/space.d.ts +59 -35
  43. package/dist/typings/entities/tag.d.ts +59 -35
  44. package/dist/typings/entities/task.d.ts +59 -35
  45. package/dist/typings/entities/team-membership.d.ts +59 -35
  46. package/dist/typings/entities/team-space-membership.d.ts +59 -35
  47. package/dist/typings/entities/team.d.ts +59 -35
  48. package/dist/typings/entities/usage.d.ts +61 -45
  49. package/dist/typings/entities/user.d.ts +59 -35
  50. package/dist/typings/entities/webhook.d.ts +59 -35
  51. package/dist/typings/plain/common-types.d.ts +1 -1
  52. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,9 +1,9 @@
1
- # [7.22.0](https://github.com/contentful/contentful-management.js/compare/v7.21.0...v7.22.0) (2021-05-20)
1
+ ## [7.22.4](https://github.com/contentful/contentful-management.js/compare/v7.22.3...v7.22.4) (2021-05-26)
2
2
 
3
3
 
4
- ### Features
4
+ ### Bug Fixes
5
5
 
6
- * add editor interface defaults ([#857](https://github.com/contentful/contentful-management.js/issues/857)) ([7e7aa76](https://github.com/contentful/contentful-management.js/commit/7e7aa76656c3eadf7559c1f2e8a7ddf490ae8ccc))
6
+ * **deps:** downgrade type-fest ([#867](https://github.com/contentful/contentful-management.js/issues/867)) ([405710b](https://github.com/contentful/contentful-management.js/commit/405710bdeb05eb5338d5d4f14f16aa4cd2c76152))
7
7
 
8
8
  # CHANGELOG
9
9
 
@@ -7279,7 +7279,11 @@ var create = function create(http, params, data) {
7279
7279
  return _raw__WEBPACK_IMPORTED_MODULE_0__["post"](http, "/spaces/".concat(params.spaceId, "/scheduled_actions"), data);
7280
7280
  };
7281
7281
  var del = function del(http, params) {
7282
- return _raw__WEBPACK_IMPORTED_MODULE_0__["del"](http, "/spaces/".concat(params.spaceId, "/scheduled_actions/").concat(params.scheduledActionId));
7282
+ return _raw__WEBPACK_IMPORTED_MODULE_0__["del"](http, "/spaces/".concat(params.spaceId, "/scheduled_actions/").concat(params.scheduledActionId), {
7283
+ params: {
7284
+ 'environment.sys.id': params.environmentId
7285
+ }
7286
+ });
7283
7287
  };
7284
7288
 
7285
7289
  /***/ }),
@@ -8788,7 +8792,7 @@ function createClient(params) {
8788
8792
  var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
8789
8793
  var sdkMain = opts.type === 'plain' ? 'contentful-management-plain.js' : 'contentful-management.js';
8790
8794
  var userAgent = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["getUserAgentHeader"])( // @ts-expect-error
8791
- "".concat(sdkMain, "/").concat("7.22.0"), params.application, params.integration, params.feature);
8795
+ "".concat(sdkMain, "/").concat("7.22.4"), params.application, params.integration, params.feature);
8792
8796
  var adapter = Object(_create_adapter__WEBPACK_IMPORTED_MODULE_1__["createAdapter"])(params); // Parameters<?> and ReturnType<?> only return the types of the last overload
8793
8797
  // https://github.com/microsoft/TypeScript/issues/26591
8794
8798
  // @ts-expect-error
@@ -11629,7 +11633,7 @@ function createEnvironmentApi(makeRequest) {
11629
11633
  *
11630
11634
  * client.getSpace('<space_id>')
11631
11635
  * .then((space) => space.getEnvironment('<environment-id>'))
11632
- * .then((environment) => environment.getReleases({ 'entities.sys.id': '<asset_id>,<entry_id>' }))
11636
+ * .then((environment) => environment.getReleases({ 'entities.sys.id[in]': '<asset_id>,<entry_id>' }))
11633
11637
  * .then((releases) => console.log(releases))
11634
11638
  * .catch(console.error)
11635
11639
  * ```
@@ -11665,7 +11669,7 @@ function createEnvironmentApi(makeRequest) {
11665
11669
  * entities: {
11666
11670
  * sys: { type: 'Array' },
11667
11671
  * items: [
11668
- * { linkType: 'Entry', type: 'Link', id: '<entry_id>' }
11672
+ * { sys: { linkType: 'Entry', type: 'Link', id: '<entry_id>' } }
11669
11673
  * ]
11670
11674
  * }
11671
11675
  * }
@@ -11698,8 +11702,8 @@ function createEnvironmentApi(makeRequest) {
11698
11702
  * @param options.releaseId the ID of the release
11699
11703
  * @param options.payload the payload to be updated in the Release
11700
11704
  * @param options.version Release sys.version that to be updated
11701
- *
11702
11705
  * @returns Promise containing a wrapped Release, that has helper methods within.
11706
+ *
11703
11707
  * @example ```javascript
11704
11708
  * const contentful = require('contentful-management')
11705
11709
  *
@@ -11713,7 +11717,7 @@ function createEnvironmentApi(makeRequest) {
11713
11717
  * entities: {
11714
11718
  * sys: { type: 'Array' },
11715
11719
  * items: [
11716
- * { linkType: 'Entry', type: 'Link', id: '<entry_id>' }
11720
+ * { sys: { linkType: 'Entry', type: 'Link', id: '<entry_id>' } }
11717
11721
  * ]
11718
11722
  * }
11719
11723
  * }
@@ -11780,8 +11784,8 @@ function createEnvironmentApi(makeRequest) {
11780
11784
  * Publishes all Entities contained in a Release.
11781
11785
  * @param options.releaseId the ID of the release
11782
11786
  * @param options.version the version of the release that is to be published
11783
- *
11784
11787
  * @returns Promise containing a wrapped Release, that has helper methods within.
11788
+ *
11785
11789
  * @example ```javascript
11786
11790
  * const contentful = require('contentful-management')
11787
11791
  *
@@ -11791,7 +11795,7 @@ function createEnvironmentApi(makeRequest) {
11791
11795
  *
11792
11796
  * client.getSpace('<space_id>')
11793
11797
  * .then((space) => space.getEnvironment('<environment-id>'))
11794
- * .then((environment) => environment.publishRelease({ releaseId: '<release_id>', version: 1 })
11798
+ * .then((environment) => environment.publishRelease({ releaseId: '<release_id>', version: 1 }))
11795
11799
  * .catch(console.error)
11796
11800
  * ```
11797
11801
  */
@@ -11817,8 +11821,8 @@ function createEnvironmentApi(makeRequest) {
11817
11821
  * Unpublishes all Entities contained in a Release.
11818
11822
  * @param options.releaseId the ID of the release
11819
11823
  * @param options.version the version of the release that is to be published
11820
- *
11821
11824
  * @returns Promise containing a wrapped Release, that has helper methods within.
11825
+ *
11822
11826
  * @example ```javascript
11823
11827
  * const contentful = require('contentful-management')
11824
11828
  *
@@ -11828,7 +11832,7 @@ function createEnvironmentApi(makeRequest) {
11828
11832
  *
11829
11833
  * client.getSpace('<space_id>')
11830
11834
  * .then((space) => space.getEnvironment('<environment-id>'))
11831
- * .then((environment) => environment.unpublishRelease({ releaseId: '<release_id>', version: 1 })
11835
+ * .then((environment) => environment.unpublishRelease({ releaseId: '<release_id>', version: 1 }))
11832
11836
  * .catch(console.error)
11833
11837
  * ```
11834
11838
  */
@@ -11856,6 +11860,7 @@ function createEnvironmentApi(makeRequest) {
11856
11860
  * @param options.payload (optional) the type of action to be validated against
11857
11861
  *
11858
11862
  * @returns Promise containing a wrapped Release, that has helper methods within.
11863
+ *
11859
11864
  * @example ```javascript
11860
11865
  * const contentful = require('contentful-management')
11861
11866
  *
@@ -11865,7 +11870,7 @@ function createEnvironmentApi(makeRequest) {
11865
11870
  *
11866
11871
  * client.getSpace('<space_id>')
11867
11872
  * .then((space) => space.getEnvironment('<environment-id>'))
11868
- * .then((environment) => environment.validateRelease({ releaseId: '<release_id>', payload: { action: 'unpublish' } })
11873
+ * .then((environment) => environment.validateRelease({ releaseId: '<release_id>', payload: { action: 'unpublish' } }))
11869
11874
  * .catch(console.error)
11870
11875
  * ```
11871
11876
  */
@@ -11929,6 +11934,7 @@ function createEnvironmentApi(makeRequest) {
11929
11934
  * @param {string} params.releaseId ID of the Release to fetch the actions from
11930
11935
  * @param {ReleaseQueryOptions} params.query filtering options for the collection result
11931
11936
  * @returns Promise containing a wrapped ReleaseAction Collection
11937
+ *
11932
11938
  * @example ```javascript
11933
11939
  * const contentful = require('contentful-management')
11934
11940
  *
@@ -11938,7 +11944,7 @@ function createEnvironmentApi(makeRequest) {
11938
11944
  *
11939
11945
  * client.getSpace('<space_id>')
11940
11946
  * .then((space) => space.getEnvironment('<environment-id>'))
11941
- * .then((environment) => environment.getReleaseActions({ releaseId: '<release_id>', query: { 'sys.id': '<id_1>,<id_2>' } }))
11947
+ * .then((environment) => environment.getReleaseActions({ releaseId: '<release_id>', query: { 'sys.id[in]': '<id_1>,<id_2>' } }))
11942
11948
  * .then((releaseActions) => console.log(releaseActions))
11943
11949
  * .catch(console.error)
11944
11950
  * ```
@@ -15752,7 +15758,7 @@ function createReleaseApi(makeRequest) {
15752
15758
  };
15753
15759
 
15754
15760
  return {
15755
- delete: function _delete() {
15761
+ update: function update(payload) {
15756
15762
  var _this = this;
15757
15763
 
15758
15764
  return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
@@ -15762,14 +15768,16 @@ function createReleaseApi(makeRequest) {
15762
15768
  switch (_context.prev = _context.next) {
15763
15769
  case 0:
15764
15770
  params = getParams(_this);
15765
- _context.next = 3;
15766
- return makeRequest({
15771
+ return _context.abrupt("return", makeRequest({
15767
15772
  entityType: 'Release',
15768
- action: 'delete',
15769
- params: params
15770
- });
15773
+ action: 'update',
15774
+ params: params,
15775
+ payload: payload
15776
+ }).then(function (release) {
15777
+ return wrapRelease(makeRequest, release);
15778
+ }));
15771
15779
 
15772
- case 3:
15780
+ case 2:
15773
15781
  case "end":
15774
15782
  return _context.stop();
15775
15783
  }
@@ -15777,7 +15785,7 @@ function createReleaseApi(makeRequest) {
15777
15785
  }, _callee);
15778
15786
  }))();
15779
15787
  },
15780
- publish: function publish(options) {
15788
+ delete: function _delete() {
15781
15789
  var _this2 = this;
15782
15790
 
15783
15791
  return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
@@ -15787,17 +15795,14 @@ function createReleaseApi(makeRequest) {
15787
15795
  switch (_context2.prev = _context2.next) {
15788
15796
  case 0:
15789
15797
  params = getParams(_this2);
15790
- return _context2.abrupt("return", makeRequest({
15798
+ _context2.next = 3;
15799
+ return makeRequest({
15791
15800
  entityType: 'Release',
15792
- action: 'publish',
15801
+ action: 'delete',
15793
15802
  params: params
15794
- }).then(function (data) {
15795
- return Object(_release_action__WEBPACK_IMPORTED_MODULE_4__["wrapReleaseAction"])(makeRequest, data);
15796
- }).then(function (action) {
15797
- return action.waitProcessing(options);
15798
- }));
15803
+ });
15799
15804
 
15800
- case 2:
15805
+ case 3:
15801
15806
  case "end":
15802
15807
  return _context2.stop();
15803
15808
  }
@@ -15805,7 +15810,7 @@ function createReleaseApi(makeRequest) {
15805
15810
  }, _callee2);
15806
15811
  }))();
15807
15812
  },
15808
- unpublish: function unpublish(options) {
15813
+ publish: function publish(options) {
15809
15814
  var _this3 = this;
15810
15815
 
15811
15816
  return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
@@ -15817,7 +15822,7 @@ function createReleaseApi(makeRequest) {
15817
15822
  params = getParams(_this3);
15818
15823
  return _context3.abrupt("return", makeRequest({
15819
15824
  entityType: 'Release',
15820
- action: 'unpublish',
15825
+ action: 'publish',
15821
15826
  params: params
15822
15827
  }).then(function (data) {
15823
15828
  return Object(_release_action__WEBPACK_IMPORTED_MODULE_4__["wrapReleaseAction"])(makeRequest, data);
@@ -15833,7 +15838,7 @@ function createReleaseApi(makeRequest) {
15833
15838
  }, _callee3);
15834
15839
  }))();
15835
15840
  },
15836
- validate: function validate(options) {
15841
+ unpublish: function unpublish(options) {
15837
15842
  var _this4 = this;
15838
15843
 
15839
15844
  return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {
@@ -15844,6 +15849,34 @@ function createReleaseApi(makeRequest) {
15844
15849
  case 0:
15845
15850
  params = getParams(_this4);
15846
15851
  return _context4.abrupt("return", makeRequest({
15852
+ entityType: 'Release',
15853
+ action: 'unpublish',
15854
+ params: params
15855
+ }).then(function (data) {
15856
+ return Object(_release_action__WEBPACK_IMPORTED_MODULE_4__["wrapReleaseAction"])(makeRequest, data);
15857
+ }).then(function (action) {
15858
+ return action.waitProcessing(options);
15859
+ }));
15860
+
15861
+ case 2:
15862
+ case "end":
15863
+ return _context4.stop();
15864
+ }
15865
+ }
15866
+ }, _callee4);
15867
+ }))();
15868
+ },
15869
+ validate: function validate(options) {
15870
+ var _this5 = this;
15871
+
15872
+ return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
15873
+ var params;
15874
+ return regeneratorRuntime.wrap(function _callee5$(_context5) {
15875
+ while (1) {
15876
+ switch (_context5.prev = _context5.next) {
15877
+ case 0:
15878
+ params = getParams(_this5);
15879
+ return _context5.abrupt("return", makeRequest({
15847
15880
  entityType: 'Release',
15848
15881
  action: 'validate',
15849
15882
  params: params,
@@ -15856,10 +15889,10 @@ function createReleaseApi(makeRequest) {
15856
15889
 
15857
15890
  case 2:
15858
15891
  case "end":
15859
- return _context4.stop();
15892
+ return _context5.stop();
15860
15893
  }
15861
15894
  }
15862
- }, _callee4);
15895
+ }, _callee5);
15863
15896
  }))();
15864
15897
  }
15865
15898
  };
@@ -15990,13 +16023,16 @@ var ScheduledActionStatus;
15990
16023
 
15991
16024
  function createDeleteScheduledAction(makeRequest) {
15992
16025
  return function () {
16026
+ var _data$environment;
16027
+
15993
16028
  var data = this.toPlainObject();
15994
16029
  return makeRequest({
15995
16030
  entityType: 'ScheduledAction',
15996
16031
  action: 'delete',
15997
16032
  params: {
15998
16033
  spaceId: data.sys.space.sys.id,
15999
- scheduledActionId: data.sys.id
16034
+ scheduledActionId: data.sys.id,
16035
+ environmentId: (_data$environment = data.environment) === null || _data$environment === void 0 ? void 0 : _data$environment.sys.id
16000
16036
  }
16001
16037
  }).then(function (data) {
16002
16038
  return wrapScheduledAction(makeRequest, data);