contentful-management 11.3.0 → 11.5.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.
@@ -1182,7 +1182,10 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
1182
1182
 
1183
1183
 
1184
1184
 
1185
+ var VERSION_HEADER = 'X-Contentful-Version';
1185
1186
  var BODY_FORMAT_HEADER = 'x-contentful-comment-body-format';
1187
+ var PARENT_ENTITY_REFERENCE_HEADER = 'x-contentful-parent-entity-reference';
1188
+ var PARENT_COMMENT_ID_HEADER = 'x-contentful-parent-id';
1186
1189
  var getSpaceEnvBaseUrl = function getSpaceEnvBaseUrl(params) {
1187
1190
  return "/spaces/".concat(params.spaceId, "/environments/").concat(params.environmentId);
1188
1191
  };
@@ -1233,7 +1236,7 @@ var getMany = function getMany(http, params) {
1233
1236
  var create = function create(http, params, rawData) {
1234
1237
  var data = (0,fast_copy__WEBPACK_IMPORTED_MODULE_0__["default"])(rawData);
1235
1238
  return _raw__WEBPACK_IMPORTED_MODULE_1__.post(http, getEntityBaseUrl(params), data, {
1236
- headers: typeof rawData.body !== 'string' ? _defineProperty({}, BODY_FORMAT_HEADER, 'rich-text') : {}
1239
+ headers: _objectSpread(_objectSpread(_objectSpread({}, typeof rawData.body !== 'string' ? _defineProperty({}, BODY_FORMAT_HEADER, 'rich-text') : {}), 'parentEntityReference' in params && params.parentEntityReference ? _defineProperty({}, PARENT_ENTITY_REFERENCE_HEADER, params.parentEntityReference) : {}), params.parentCommentId ? _defineProperty({}, PARENT_COMMENT_ID_HEADER, params.parentCommentId) : {})
1237
1240
  });
1238
1241
  };
1239
1242
  var update = function update(http, params, rawData, headers) {
@@ -1241,18 +1244,14 @@ var update = function update(http, params, rawData, headers) {
1241
1244
  var data = (0,fast_copy__WEBPACK_IMPORTED_MODULE_0__["default"])(rawData);
1242
1245
  delete data.sys;
1243
1246
  return _raw__WEBPACK_IMPORTED_MODULE_1__.put(http, getEntityCommentUrl(params), data, {
1244
- headers: _objectSpread(_objectSpread({
1245
- 'X-Contentful-Version': (_rawData$sys$version = rawData.sys.version) !== null && _rawData$sys$version !== void 0 ? _rawData$sys$version : 0
1246
- }, typeof rawData.body !== 'string' ? _defineProperty({}, BODY_FORMAT_HEADER, 'rich-text') : {}), headers)
1247
+ headers: _objectSpread(_objectSpread(_defineProperty({}, VERSION_HEADER, (_rawData$sys$version = rawData.sys.version) !== null && _rawData$sys$version !== void 0 ? _rawData$sys$version : 0), typeof rawData.body !== 'string' ? _defineProperty({}, BODY_FORMAT_HEADER, 'rich-text') : {}), headers)
1247
1248
  });
1248
1249
  };
1249
- var del = function del(http, _ref5) {
1250
- var version = _ref5.version,
1251
- params = _objectWithoutProperties(_ref5, _excluded);
1250
+ var del = function del(http, _ref7) {
1251
+ var version = _ref7.version,
1252
+ params = _objectWithoutProperties(_ref7, _excluded);
1252
1253
  return _raw__WEBPACK_IMPORTED_MODULE_1__.del(http, getEntityCommentUrl(params), {
1253
- headers: {
1254
- 'X-Contentful-Version': version
1255
- }
1254
+ headers: _defineProperty({}, VERSION_HEADER, version)
1256
1255
  });
1257
1256
  };
1258
1257
 
@@ -3532,12 +3531,15 @@ __webpack_require__.r(__webpack_exports__);
3532
3531
  /* harmony export */ create: () => (/* binding */ create),
3533
3532
  /* harmony export */ createWithId: () => (/* binding */ createWithId),
3534
3533
  /* harmony export */ del: () => (/* binding */ del),
3534
+ /* harmony export */ deleteSigningSecret: () => (/* binding */ deleteSigningSecret),
3535
3535
  /* harmony export */ get: () => (/* binding */ get),
3536
3536
  /* harmony export */ getCallDetails: () => (/* binding */ getCallDetails),
3537
3537
  /* harmony export */ getHealthStatus: () => (/* binding */ getHealthStatus),
3538
3538
  /* harmony export */ getMany: () => (/* binding */ getMany),
3539
3539
  /* harmony export */ getManyCallDetails: () => (/* binding */ getManyCallDetails),
3540
- /* harmony export */ update: () => (/* binding */ update)
3540
+ /* harmony export */ getSigningSecret: () => (/* binding */ getSigningSecret),
3541
+ /* harmony export */ update: () => (/* binding */ update),
3542
+ /* harmony export */ upsertSigningSecret: () => (/* binding */ upsertSigningSecret)
3541
3543
  /* harmony export */ });
3542
3544
  /* harmony import */ var fast_copy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! fast-copy */ "../node_modules/fast-copy/dist/esm/index.mjs");
3543
3545
  /* harmony import */ var _raw__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./raw */ "./adapters/REST/endpoints/raw.ts");
@@ -3572,6 +3574,12 @@ var getWebhookCallDetailsUrl = function getWebhookCallDetailsUrl(params) {
3572
3574
  var getWebhookHealthUrl = function getWebhookHealthUrl(params) {
3573
3575
  return "".concat(getWebhookCallBaseUrl(params), "/").concat(params.webhookDefinitionId, "/health");
3574
3576
  };
3577
+ var getWebhookSettingsUrl = function getWebhookSettingsUrl(params) {
3578
+ return "/spaces/".concat(params.spaceId, "/webhook_settings");
3579
+ };
3580
+ var getWebhookSigningSecretUrl = function getWebhookSigningSecretUrl(params) {
3581
+ return "".concat(getWebhookSettingsUrl(params), "/signing_secret");
3582
+ };
3575
3583
  var get = function get(http, params) {
3576
3584
  return _raw__WEBPACK_IMPORTED_MODULE_1__.get(http, getWebhookUrl(params));
3577
3585
  };
@@ -3591,6 +3599,9 @@ var getMany = function getMany(http, params) {
3591
3599
  params: (0,_utils__WEBPACK_IMPORTED_MODULE_2__.normalizeSelect)(params.query)
3592
3600
  });
3593
3601
  };
3602
+ var getSigningSecret = function getSigningSecret(http, params) {
3603
+ return _raw__WEBPACK_IMPORTED_MODULE_1__.get(http, getWebhookSigningSecretUrl(params));
3604
+ };
3594
3605
  var create = function create(http, params, rawData, headers) {
3595
3606
  var data = (0,fast_copy__WEBPACK_IMPORTED_MODULE_0__["default"])(rawData);
3596
3607
  return _raw__WEBPACK_IMPORTED_MODULE_1__.post(http, getBaseUrl(params), data, {
@@ -3627,9 +3638,43 @@ var update = /*#__PURE__*/function () {
3627
3638
  return _ref.apply(this, arguments);
3628
3639
  };
3629
3640
  }();
3641
+ var upsertSigningSecret = /*#__PURE__*/function () {
3642
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(http, params, rawData) {
3643
+ var data;
3644
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
3645
+ while (1) switch (_context2.prev = _context2.next) {
3646
+ case 0:
3647
+ data = (0,fast_copy__WEBPACK_IMPORTED_MODULE_0__["default"])(rawData);
3648
+ return _context2.abrupt("return", _raw__WEBPACK_IMPORTED_MODULE_1__.put(http, getWebhookSigningSecretUrl(params), data));
3649
+ case 2:
3650
+ case "end":
3651
+ return _context2.stop();
3652
+ }
3653
+ }, _callee2);
3654
+ }));
3655
+ return function upsertSigningSecret(_x5, _x6, _x7) {
3656
+ return _ref2.apply(this, arguments);
3657
+ };
3658
+ }();
3630
3659
  var del = function del(http, params) {
3631
3660
  return _raw__WEBPACK_IMPORTED_MODULE_1__.del(http, getWebhookUrl(params));
3632
3661
  };
3662
+ var deleteSigningSecret = /*#__PURE__*/function () {
3663
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(http, params) {
3664
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
3665
+ while (1) switch (_context3.prev = _context3.next) {
3666
+ case 0:
3667
+ return _context3.abrupt("return", _raw__WEBPACK_IMPORTED_MODULE_1__.del(http, getWebhookSigningSecretUrl(params)));
3668
+ case 1:
3669
+ case "end":
3670
+ return _context3.stop();
3671
+ }
3672
+ }, _callee3);
3673
+ }));
3674
+ return function deleteSigningSecret(_x8, _x9) {
3675
+ return _ref3.apply(this, arguments);
3676
+ };
3677
+ }();
3633
3678
 
3634
3679
  /***/ }),
3635
3680
 
@@ -10199,6 +10244,32 @@ function createSpaceApi(makeRequest) {
10199
10244
  return wrapWebhookCollection(makeRequest, data);
10200
10245
  });
10201
10246
  },
10247
+ /**
10248
+ * Fetch a webhook signing secret
10249
+ * @returns Promise for the redacted webhook signing secret in this space
10250
+ * @example ```javascript
10251
+ * const contentful = require('contentful-management')
10252
+ *
10253
+ * const client = contentful.createClient({
10254
+ * accessToken: '<content_management_api_key>'
10255
+ * })
10256
+ *
10257
+ * client.getSpace('<space_id>')
10258
+ * .then((space) => space.getWebhookSigningSecret())
10259
+ * .then((response) => console.log(response.redactedValue))
10260
+ * .catch(console.error)
10261
+ * ```
10262
+ */
10263
+ getWebhookSigningSecret: function getSigningSecret() {
10264
+ var raw = this.toPlainObject();
10265
+ return makeRequest({
10266
+ entityType: 'Webhook',
10267
+ action: 'getSigningSecret',
10268
+ params: {
10269
+ spaceId: raw.sys.id
10270
+ }
10271
+ });
10272
+ },
10202
10273
  /**
10203
10274
  * Creates a Webhook
10204
10275
  * @param data - Object representation of the Webhook to be created
@@ -10271,6 +10342,63 @@ function createSpaceApi(makeRequest) {
10271
10342
  return wrapWebhook(makeRequest, data);
10272
10343
  });
10273
10344
  },
10345
+ /**
10346
+ * Create or update the webhook signing secret for this space
10347
+ * @param data 64 character string that will be used to sign the webhook calls
10348
+ * @returns Promise for the redacted webhook signing secret that was created or updated
10349
+ * @example ```javascript
10350
+ * const contentful = require('contentful-management')
10351
+ * const crypto = require('crypto')
10352
+ *
10353
+ * const client = contentful.createClient({
10354
+ * accessToken: '<content_management_api_key>'
10355
+ * })
10356
+ *
10357
+ * const signingSecret = client.getSpace('<space_id>')
10358
+ * .then((space) => space.upsertWebhookSigningSecret({
10359
+ * value: crypto.randomBytes(32).toString('hex')
10360
+ * }))
10361
+ * .then((response) => console.log(response.redactedValue))
10362
+ * .catch(console.error)
10363
+ * ```
10364
+ */
10365
+ upsertWebhookSigningSecret: function getSigningSecret(data) {
10366
+ var raw = this.toPlainObject();
10367
+ return makeRequest({
10368
+ entityType: 'Webhook',
10369
+ action: 'upsertSigningSecret',
10370
+ params: {
10371
+ spaceId: raw.sys.id
10372
+ },
10373
+ payload: data
10374
+ });
10375
+ },
10376
+ /**
10377
+ * Delete the webhook signing secret for this space
10378
+ * @returns Promise<void>
10379
+ * @example ```javascript
10380
+ * const contentful = require('contentful-management')
10381
+ *
10382
+ * const client = contentful.createClient({
10383
+ * accessToken: '<content_management_api_key>'
10384
+ * })
10385
+ *
10386
+ * client.getSpace('<space_id>')
10387
+ * .then((space) => space.deleteWebhookSigningSecret())
10388
+ * .then(() => console.log("success"))
10389
+ * .catch(console.error)
10390
+ * ```
10391
+ */
10392
+ deleteWebhookSigningSecret: function getSigningSecret() {
10393
+ var raw = this.toPlainObject();
10394
+ return makeRequest({
10395
+ entityType: 'Webhook',
10396
+ action: 'deleteSigningSecret',
10397
+ params: {
10398
+ spaceId: raw.sys.id
10399
+ }
10400
+ });
10401
+ },
10274
10402
  /**
10275
10403
  * Gets a Role
10276
10404
  * @param id - Role ID
@@ -12704,10 +12832,16 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
12704
12832
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
12705
12833
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
12706
12834
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
12835
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
12836
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
12837
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
12838
+
12707
12839
 
12708
12840
 
12709
12841
 
12710
12842
 
12843
+ // PROPS //
12844
+
12711
12845
  // Remove and replace with BLOCKS as soon as rich-text-types supports mentions
12712
12846
  var CommentNode = /*#__PURE__*/function (CommentNode) {
12713
12847
  CommentNode["Document"] = "document";
@@ -12720,8 +12854,9 @@ var CommentNode = /*#__PURE__*/function (CommentNode) {
12720
12854
 
12721
12855
  // Add "extends Document" as soon as rich-text-types supports mentions.
12722
12856
 
12857
+ // PARAMS //
12723
12858
  // We keep this type as explicit as possible until we open up the comments entity further
12724
-
12859
+ // NESTED CLIENT //
12725
12860
  /**
12726
12861
  * @private
12727
12862
  */
@@ -12735,29 +12870,60 @@ function createCommentApi(makeRequest) {
12735
12870
  };
12736
12871
  };
12737
12872
  return {
12738
- update: function update() {
12739
- var raw = this.toPlainObject();
12740
- return makeRequest({
12741
- entityType: 'Comment',
12742
- action: 'update',
12743
- params: getParams(raw),
12744
- payload: raw
12745
- }).then(function (data) {
12746
- return wrapComment(makeRequest, data);
12747
- });
12748
- },
12749
- delete: function _delete() {
12750
- var raw = this.toPlainObject();
12751
- return makeRequest({
12752
- entityType: 'Comment',
12753
- action: 'delete',
12754
- params: _objectSpread(_objectSpread({}, getParams(raw)), {}, {
12755
- version: raw.sys.version
12756
- })
12757
- }).then(function () {
12758
- // noop
12759
- });
12760
- }
12873
+ update: function () {
12874
+ var _update = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
12875
+ var raw, data;
12876
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
12877
+ while (1) switch (_context.prev = _context.next) {
12878
+ case 0:
12879
+ raw = this.toPlainObject();
12880
+ _context.next = 3;
12881
+ return makeRequest({
12882
+ entityType: 'Comment',
12883
+ action: 'update',
12884
+ params: getParams(raw),
12885
+ payload: raw
12886
+ });
12887
+ case 3:
12888
+ data = _context.sent;
12889
+ return _context.abrupt("return", wrapComment(makeRequest, data));
12890
+ case 5:
12891
+ case "end":
12892
+ return _context.stop();
12893
+ }
12894
+ }, _callee, this);
12895
+ }));
12896
+ function update() {
12897
+ return _update.apply(this, arguments);
12898
+ }
12899
+ return update;
12900
+ }(),
12901
+ delete: function () {
12902
+ var _delete2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
12903
+ var raw;
12904
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
12905
+ while (1) switch (_context2.prev = _context2.next) {
12906
+ case 0:
12907
+ raw = this.toPlainObject();
12908
+ _context2.next = 3;
12909
+ return makeRequest({
12910
+ entityType: 'Comment',
12911
+ action: 'delete',
12912
+ params: _objectSpread(_objectSpread({}, getParams(raw)), {}, {
12913
+ version: raw.sys.version
12914
+ })
12915
+ });
12916
+ case 3:
12917
+ case "end":
12918
+ return _context2.stop();
12919
+ }
12920
+ }, _callee2, this);
12921
+ }));
12922
+ function _delete() {
12923
+ return _delete2.apply(this, arguments);
12924
+ }
12925
+ return _delete;
12926
+ }()
12761
12927
  };
12762
12928
  }
12763
12929
 
@@ -16215,10 +16381,13 @@ var createPlainClient = function createPlainClient(makeRequest, defaults) {
16215
16381
  getMany: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'Webhook', 'getMany'),
16216
16382
  getHealthStatus: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'Webhook', 'getHealthStatus'),
16217
16383
  getCallDetails: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'Webhook', 'getCallDetails'),
16384
+ getSigningSecret: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'Webhook', 'getSigningSecret'),
16218
16385
  getManyCallDetails: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'Webhook', 'getManyCallDetails'),
16219
16386
  create: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'Webhook', 'create'),
16220
16387
  update: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'Webhook', 'update'),
16221
- delete: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'Webhook', 'delete')
16388
+ upsertSigningSecret: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'Webhook', 'upsertSigningSecret'),
16389
+ delete: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'Webhook', 'delete'),
16390
+ deleteSigningSecret: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'Webhook', 'deleteSigningSecret')
16222
16391
  },
16223
16392
  snapshot: {
16224
16393
  getManyForEntry: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'Snapshot', 'getManyForEntry'),