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.
@@ -6220,7 +6220,7 @@ var Campaign = /*#__PURE__*/function () {
6220
6220
  case 0:
6221
6221
  this.verifyCampaignId();
6222
6222
  _context4.next = 3;
6223
- return this.client.delete(this.client.baseURL + "/campaigns/".concat(this.id));
6223
+ return this.client.deleteCampaign(this.id);
6224
6224
 
6225
6225
  case 3:
6226
6226
  return _context4.abrupt("return", _context4.sent);
@@ -6248,7 +6248,7 @@ var Campaign = /*#__PURE__*/function () {
6248
6248
  switch (_context5.prev = _context5.next) {
6249
6249
  case 0:
6250
6250
  this.verifyCampaignId();
6251
- return _context5.abrupt("return", this.client.patch(this.client.baseURL + "/campaigns/".concat(this.id, "/stop")));
6251
+ return _context5.abrupt("return", this.client.stopCampaign(this.id));
6252
6252
 
6253
6253
  case 2:
6254
6254
  case "end":
@@ -11114,7 +11114,7 @@ var StreamChat = /*#__PURE__*/function () {
11114
11114
  }, {
11115
11115
  key: "getUserAgent",
11116
11116
  value: function getUserAgent() {
11117
- return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.24.0");
11117
+ return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.25.0");
11118
11118
  }
11119
11119
  }, {
11120
11120
  key: "setUserAgent",
@@ -11414,11 +11414,11 @@ var StreamChat = /*#__PURE__*/function () {
11414
11414
  }, {
11415
11415
  key: "campaign",
11416
11416
  value: function campaign(idOrData, data) {
11417
- if (typeof idOrData === 'string') {
11418
- return new Campaign(this, idOrData, data);
11417
+ if (idOrData && _typeof(idOrData) === 'object') {
11418
+ return new Campaign(this, null, idOrData);
11419
11419
  }
11420
11420
 
11421
- return new Campaign(this, null, idOrData);
11421
+ return new Campaign(this, idOrData, data);
11422
11422
  }
11423
11423
  }, {
11424
11424
  key: "segment",
@@ -12029,22 +12029,14 @@ var StreamChat = /*#__PURE__*/function () {
12029
12029
  key: "stopCampaign",
12030
12030
  value: function () {
12031
12031
  var _stopCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee81(id) {
12032
- var _yield$this$patch, campaign;
12033
-
12034
12032
  return _regeneratorRuntime.wrap(function _callee81$(_context81) {
12035
12033
  while (1) {
12036
12034
  switch (_context81.prev = _context81.next) {
12037
12035
  case 0:
12038
12036
  this.validateServerSideAuth();
12039
- _context81.next = 3;
12040
- return this.patch(this.baseURL + "/campaigns/".concat(id, "/stop"));
12041
-
12042
- case 3:
12043
- _yield$this$patch = _context81.sent;
12044
- campaign = _yield$this$patch.campaign;
12045
- return _context81.abrupt("return", campaign);
12037
+ return _context81.abrupt("return", this.post(this.baseURL + "/campaigns/".concat(id, "/stop")));
12046
12038
 
12047
- case 6:
12039
+ case 2:
12048
12040
  case "end":
12049
12041
  return _context81.stop();
12050
12042
  }