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