stream-chat 8.24.0 → 8.25.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/index.js CHANGED
@@ -6251,7 +6251,7 @@ var Campaign = /*#__PURE__*/function () {
6251
6251
  case 0:
6252
6252
  this.verifyCampaignId();
6253
6253
  _context4.next = 3;
6254
- return this.client.delete(this.client.baseURL + "/campaigns/".concat(this.id));
6254
+ return this.client.deleteCampaign(this.id);
6255
6255
 
6256
6256
  case 3:
6257
6257
  return _context4.abrupt("return", _context4.sent);
@@ -6279,7 +6279,7 @@ var Campaign = /*#__PURE__*/function () {
6279
6279
  switch (_context5.prev = _context5.next) {
6280
6280
  case 0:
6281
6281
  this.verifyCampaignId();
6282
- return _context5.abrupt("return", this.client.patch(this.client.baseURL + "/campaigns/".concat(this.id, "/stop")));
6282
+ return _context5.abrupt("return", this.client.stopCampaign(this.id));
6283
6283
 
6284
6284
  case 2:
6285
6285
  case "end":
@@ -11145,7 +11145,7 @@ var StreamChat = /*#__PURE__*/function () {
11145
11145
  }, {
11146
11146
  key: "getUserAgent",
11147
11147
  value: function getUserAgent() {
11148
- return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.24.0");
11148
+ return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.25.0");
11149
11149
  }
11150
11150
  }, {
11151
11151
  key: "setUserAgent",
@@ -11445,11 +11445,11 @@ var StreamChat = /*#__PURE__*/function () {
11445
11445
  }, {
11446
11446
  key: "campaign",
11447
11447
  value: function campaign(idOrData, data) {
11448
- if (typeof idOrData === 'string') {
11449
- return new Campaign(this, idOrData, data);
11448
+ if (idOrData && _typeof__default['default'](idOrData) === 'object') {
11449
+ return new Campaign(this, null, idOrData);
11450
11450
  }
11451
11451
 
11452
- return new Campaign(this, null, idOrData);
11452
+ return new Campaign(this, idOrData, data);
11453
11453
  }
11454
11454
  }, {
11455
11455
  key: "segment",
@@ -12060,22 +12060,14 @@ var StreamChat = /*#__PURE__*/function () {
12060
12060
  key: "stopCampaign",
12061
12061
  value: function () {
12062
12062
  var _stopCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee81(id) {
12063
- var _yield$this$patch, campaign;
12064
-
12065
12063
  return _regeneratorRuntime__default['default'].wrap(function _callee81$(_context81) {
12066
12064
  while (1) {
12067
12065
  switch (_context81.prev = _context81.next) {
12068
12066
  case 0:
12069
12067
  this.validateServerSideAuth();
12070
- _context81.next = 3;
12071
- return this.patch(this.baseURL + "/campaigns/".concat(id, "/stop"));
12072
-
12073
- case 3:
12074
- _yield$this$patch = _context81.sent;
12075
- campaign = _yield$this$patch.campaign;
12076
- return _context81.abrupt("return", campaign);
12068
+ return _context81.abrupt("return", this.post(this.baseURL + "/campaigns/".concat(id, "/stop")));
12077
12069
 
12078
- case 6:
12070
+ case 2:
12079
12071
  case "end":
12080
12072
  return _context81.stop();
12081
12073
  }