contentful-management 10.30.1 → 10.31.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 +22 -9
- package/dist/contentful-management.browser.js.map +1 -1
- package/dist/contentful-management.browser.min.js +1 -1
- package/dist/contentful-management.node.js +27 -6
- 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/comment.js +19 -5
- package/dist/es-modules/entities/comment.js +6 -0
- package/dist/es-modules/plain/plain-client-test.js +208 -0
- package/dist/typings/common-types.d.ts +23 -5
- package/dist/typings/create-entry-api.d.ts +3 -3
- package/dist/typings/entities/comment.d.ts +38 -3
- package/dist/typings/plain/common-types.d.ts +7 -3
- package/dist/typings/plain/plain-client-test.d.ts +1 -0
- package/package.json +5 -1
|
@@ -9871,6 +9871,7 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
|
9871
9871
|
|
|
9872
9872
|
|
|
9873
9873
|
|
|
9874
|
+
var BODY_FORMAT_HEADER = 'x-contentful-comment-body-format';
|
|
9874
9875
|
var getSpaceEnvBaseUrl = function getSpaceEnvBaseUrl(params) {
|
|
9875
9876
|
return "/spaces/".concat(params.spaceId, "/environments/").concat(params.environmentId);
|
|
9876
9877
|
};
|
|
@@ -9899,30 +9900,35 @@ var getEntityBaseUrl = function getEntityBaseUrl(params) {
|
|
|
9899
9900
|
return "".concat(getSpaceEnvBaseUrl(params), "/").concat(parentPlural, "/").concat(parentEntityId).concat(versionPath, "/comments");
|
|
9900
9901
|
};
|
|
9901
9902
|
var get = function get(http, params) {
|
|
9902
|
-
return _raw__WEBPACK_IMPORTED_MODULE_1__["get"](http, getEntryCommentUrl(params)
|
|
9903
|
+
return _raw__WEBPACK_IMPORTED_MODULE_1__["get"](http, getEntryCommentUrl(params), {
|
|
9904
|
+
headers: params.bodyFormat === 'rich-text' ? _defineProperty({}, BODY_FORMAT_HEADER, params.bodyFormat) : {}
|
|
9905
|
+
});
|
|
9903
9906
|
};
|
|
9904
9907
|
var getMany = function getMany(http, params) {
|
|
9905
9908
|
return _raw__WEBPACK_IMPORTED_MODULE_1__["get"](http, getEntityBaseUrl(params), {
|
|
9906
|
-
params: Object(_utils__WEBPACK_IMPORTED_MODULE_2__["normalizeSelect"])(params.query)
|
|
9909
|
+
params: Object(_utils__WEBPACK_IMPORTED_MODULE_2__["normalizeSelect"])(params.query),
|
|
9910
|
+
headers: params.bodyFormat === 'rich-text' ? _defineProperty({}, BODY_FORMAT_HEADER, params.bodyFormat) : {}
|
|
9907
9911
|
});
|
|
9908
9912
|
};
|
|
9909
9913
|
var create = function create(http, params, rawData) {
|
|
9910
9914
|
var data = fast_copy__WEBPACK_IMPORTED_MODULE_0___default()(rawData);
|
|
9911
|
-
return _raw__WEBPACK_IMPORTED_MODULE_1__["post"](http, getEntityBaseUrl(params), data
|
|
9915
|
+
return _raw__WEBPACK_IMPORTED_MODULE_1__["post"](http, getEntityBaseUrl(params), data, {
|
|
9916
|
+
headers: typeof rawData.body !== 'string' ? _defineProperty({}, BODY_FORMAT_HEADER, 'rich-text') : {}
|
|
9917
|
+
});
|
|
9912
9918
|
};
|
|
9913
9919
|
var update = function update(http, params, rawData, headers) {
|
|
9914
9920
|
var _rawData$sys$version;
|
|
9915
9921
|
var data = fast_copy__WEBPACK_IMPORTED_MODULE_0___default()(rawData);
|
|
9916
9922
|
delete data.sys;
|
|
9917
9923
|
return _raw__WEBPACK_IMPORTED_MODULE_1__["put"](http, getEntryCommentUrl(params), data, {
|
|
9918
|
-
headers: _objectSpread({
|
|
9924
|
+
headers: _objectSpread(_objectSpread({
|
|
9919
9925
|
'X-Contentful-Version': (_rawData$sys$version = rawData.sys.version) !== null && _rawData$sys$version !== void 0 ? _rawData$sys$version : 0
|
|
9920
|
-
}, headers)
|
|
9926
|
+
}, typeof rawData.body !== 'string' ? _defineProperty({}, BODY_FORMAT_HEADER, 'rich-text') : {}), headers)
|
|
9921
9927
|
});
|
|
9922
9928
|
};
|
|
9923
|
-
var del = function del(http,
|
|
9924
|
-
var version =
|
|
9925
|
-
params = _objectWithoutProperties(
|
|
9929
|
+
var del = function del(http, _ref5) {
|
|
9930
|
+
var version = _ref5.version,
|
|
9931
|
+
params = _objectWithoutProperties(_ref5, _excluded);
|
|
9926
9932
|
return _raw__WEBPACK_IMPORTED_MODULE_1__["del"](http, getEntryCommentUrl(params), {
|
|
9927
9933
|
headers: {
|
|
9928
9934
|
'X-Contentful-Version': version
|
|
@@ -20785,11 +20791,12 @@ function wrapBulkAction(makeRequest, data) {
|
|
|
20785
20791
|
/*!*****************************!*\
|
|
20786
20792
|
!*** ./entities/comment.ts ***!
|
|
20787
20793
|
\*****************************/
|
|
20788
|
-
/*! exports provided: default, wrapComment, wrapCommentCollection */
|
|
20794
|
+
/*! exports provided: CommentNode, default, wrapComment, wrapCommentCollection */
|
|
20789
20795
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
20790
20796
|
|
|
20791
20797
|
"use strict";
|
|
20792
20798
|
__webpack_require__.r(__webpack_exports__);
|
|
20799
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CommentNode", function() { return CommentNode; });
|
|
20793
20800
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return createCommentApi; });
|
|
20794
20801
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapComment", function() { return wrapComment; });
|
|
20795
20802
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapCommentCollection", function() { return wrapCommentCollection; });
|
|
@@ -20808,6 +20815,12 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
|
20808
20815
|
|
|
20809
20816
|
|
|
20810
20817
|
|
|
20818
|
+
var CommentNode;
|
|
20819
|
+
(function (CommentNode) {
|
|
20820
|
+
CommentNode["Document"] = "document";
|
|
20821
|
+
CommentNode["Paragraph"] = "paragraph";
|
|
20822
|
+
CommentNode["Mention"] = "mention";
|
|
20823
|
+
})(CommentNode || (CommentNode = {}));
|
|
20811
20824
|
/**
|
|
20812
20825
|
* @private
|
|
20813
20826
|
*/
|