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/browser.js CHANGED
@@ -6245,7 +6245,7 @@ var Campaign = /*#__PURE__*/function () {
6245
6245
  case 0:
6246
6246
  this.verifyCampaignId();
6247
6247
  _context4.next = 3;
6248
- return this.client.delete(this.client.baseURL + "/campaigns/".concat(this.id));
6248
+ return this.client.deleteCampaign(this.id);
6249
6249
 
6250
6250
  case 3:
6251
6251
  return _context4.abrupt("return", _context4.sent);
@@ -6273,7 +6273,7 @@ var Campaign = /*#__PURE__*/function () {
6273
6273
  switch (_context5.prev = _context5.next) {
6274
6274
  case 0:
6275
6275
  this.verifyCampaignId();
6276
- return _context5.abrupt("return", this.client.patch(this.client.baseURL + "/campaigns/".concat(this.id, "/stop")));
6276
+ return _context5.abrupt("return", this.client.stopCampaign(this.id));
6277
6277
 
6278
6278
  case 2:
6279
6279
  case "end":
@@ -11139,7 +11139,7 @@ var StreamChat = /*#__PURE__*/function () {
11139
11139
  }, {
11140
11140
  key: "getUserAgent",
11141
11141
  value: function getUserAgent() {
11142
- return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.24.0");
11142
+ return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.25.0");
11143
11143
  }
11144
11144
  }, {
11145
11145
  key: "setUserAgent",
@@ -11439,11 +11439,11 @@ var StreamChat = /*#__PURE__*/function () {
11439
11439
  }, {
11440
11440
  key: "campaign",
11441
11441
  value: function campaign(idOrData, data) {
11442
- if (typeof idOrData === 'string') {
11443
- return new Campaign(this, idOrData, data);
11442
+ if (idOrData && _typeof__default['default'](idOrData) === 'object') {
11443
+ return new Campaign(this, null, idOrData);
11444
11444
  }
11445
11445
 
11446
- return new Campaign(this, null, idOrData);
11446
+ return new Campaign(this, idOrData, data);
11447
11447
  }
11448
11448
  }, {
11449
11449
  key: "segment",
@@ -12054,22 +12054,14 @@ var StreamChat = /*#__PURE__*/function () {
12054
12054
  key: "stopCampaign",
12055
12055
  value: function () {
12056
12056
  var _stopCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee81(id) {
12057
- var _yield$this$patch, campaign;
12058
-
12059
12057
  return _regeneratorRuntime__default['default'].wrap(function _callee81$(_context81) {
12060
12058
  while (1) {
12061
12059
  switch (_context81.prev = _context81.next) {
12062
12060
  case 0:
12063
12061
  this.validateServerSideAuth();
12064
- _context81.next = 3;
12065
- return this.patch(this.baseURL + "/campaigns/".concat(id, "/stop"));
12066
-
12067
- case 3:
12068
- _yield$this$patch = _context81.sent;
12069
- campaign = _yield$this$patch.campaign;
12070
- return _context81.abrupt("return", campaign);
12062
+ return _context81.abrupt("return", this.post(this.baseURL + "/campaigns/".concat(id, "/stop")));
12071
12063
 
12072
- case 6:
12064
+ case 2:
12073
12065
  case "end":
12074
12066
  return _context81.stop();
12075
12067
  }