stream-chat 8.14.3 → 8.14.5

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
@@ -6094,11 +6094,18 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
6094
6094
  /*
6095
6095
  DeleteUserOptions specifies a collection of one or more `user_ids` to be deleted.
6096
6096
 
6097
- `user` soft|hard determines if the user needs to be hard- or soft-deleted, where hard-delete
6098
- implies that all related objects (messages, flags, etc) will be hard-deleted as well.
6099
- `conversations` soft|hard will delete any 1to1 channels that the user was a member of.
6100
- `messages` soft-hard will delete any messages that the user has sent.
6101
- `new_channel_owner_id` any channels owned by the hard-deleted user will be transferred to this user ID
6097
+ `user`:
6098
+ - soft: marks user as deleted and retains all user data
6099
+ - pruning: marks user as deleted and nullifies user information
6100
+ - hard: deletes user completely - this requires hard option for messages and conversation as well
6101
+ `conversations`:
6102
+ - soft: marks all conversation channels as deleted (same effect as Delete Channels with 'hard' option disabled)
6103
+ - hard: deletes channel and all its data completely including messages (same effect as Delete Channels with 'hard' option enabled)
6104
+ `messages`:
6105
+ - soft: marks all user messages as deleted without removing any related message data
6106
+ - pruning: marks all user messages as deleted, nullifies message information and removes some message data such as reactions and flags
6107
+ - hard: deletes messages completely with all related information
6108
+ `new_channel_owner_id`: any channels owned by the hard-deleted user will be transferred to this user ID
6102
6109
  */
6103
6110
  // TODO: add better typing
6104
6111
  var ErrorFromResponse = /*#__PURE__*/function (_Error) {
@@ -7704,7 +7711,7 @@ var StreamChat = /*#__PURE__*/function () {
7704
7711
  }, {
7705
7712
  key: "sendFile",
7706
7713
  value: function sendFile(url, uri, name, contentType, user) {
7707
- var data = addFileToFormData(uri, name, contentType);
7714
+ var data = addFileToFormData(uri, name, contentType || 'multipart/form-data');
7708
7715
  if (user != null) data.append('user', JSON.stringify(user));
7709
7716
  return this.doAxiosRequest('postForm', url, data, {
7710
7717
  headers: data.getHeaders ? data.getHeaders() : {},
@@ -10197,7 +10204,7 @@ var StreamChat = /*#__PURE__*/function () {
10197
10204
  }, {
10198
10205
  key: "getUserAgent",
10199
10206
  value: function getUserAgent() {
10200
- return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.14.3");
10207
+ return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.14.5");
10201
10208
  }
10202
10209
  }, {
10203
10210
  key: "setUserAgent",
@@ -11141,44 +11148,48 @@ var StreamChat = /*#__PURE__*/function () {
11141
11148
  }, {
11142
11149
  key: "deleteUsers",
11143
11150
  value: function () {
11144
- var _deleteUsers = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee75(user_ids, options) {
11151
+ var _deleteUsers = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee75(user_ids) {
11152
+ var options,
11153
+ _args75 = arguments;
11145
11154
  return _regeneratorRuntime__default['default'].wrap(function _callee75$(_context75) {
11146
11155
  while (1) {
11147
11156
  switch (_context75.prev = _context75.next) {
11148
11157
  case 0:
11149
- if (!((options === null || options === void 0 ? void 0 : options.user) !== 'soft' && (options === null || options === void 0 ? void 0 : options.user) !== 'hard')) {
11150
- _context75.next = 2;
11158
+ options = _args75.length > 1 && _args75[1] !== undefined ? _args75[1] : {};
11159
+
11160
+ if (!(typeof options.user !== 'undefined' && !['soft', 'hard', 'pruning'].includes(options.user))) {
11161
+ _context75.next = 3;
11151
11162
  break;
11152
11163
  }
11153
11164
 
11154
- throw new Error('Invalid delete user options. user must be one of [soft hard]');
11165
+ throw new Error('Invalid delete user options. user must be one of [soft hard pruning]');
11155
11166
 
11156
- case 2:
11157
- if (!(options.messages !== undefined && options.messages !== 'soft' && options.messages !== 'hard')) {
11158
- _context75.next = 4;
11167
+ case 3:
11168
+ if (!(typeof options.conversations !== 'undefined' && !['soft', 'hard'].includes(options.conversations))) {
11169
+ _context75.next = 5;
11159
11170
  break;
11160
11171
  }
11161
11172
 
11162
- throw new Error('Invalid delete user options. messages must be one of [soft hard]');
11173
+ throw new Error('Invalid delete user options. conversations must be one of [soft hard]');
11163
11174
 
11164
- case 4:
11165
- if (!(options.conversations !== undefined && options.conversations !== 'soft' && options.conversations !== 'hard')) {
11166
- _context75.next = 6;
11175
+ case 5:
11176
+ if (!(typeof options.messages !== 'undefined' && !['soft', 'hard', 'pruning'].includes(options.messages))) {
11177
+ _context75.next = 7;
11167
11178
  break;
11168
11179
  }
11169
11180
 
11170
- throw new Error('Invalid delete user options. conversations must be one of [soft hard]');
11181
+ throw new Error('Invalid delete user options. messages must be one of [soft hard pruning]');
11171
11182
 
11172
- case 6:
11173
- _context75.next = 8;
11183
+ case 7:
11184
+ _context75.next = 9;
11174
11185
  return this.post(this.baseURL + "/users/delete", _objectSpread({
11175
11186
  user_ids: user_ids
11176
11187
  }, options));
11177
11188
 
11178
- case 8:
11189
+ case 9:
11179
11190
  return _context75.abrupt("return", _context75.sent);
11180
11191
 
11181
- case 9:
11192
+ case 10:
11182
11193
  case "end":
11183
11194
  return _context75.stop();
11184
11195
  }
@@ -11186,7 +11197,7 @@ var StreamChat = /*#__PURE__*/function () {
11186
11197
  }, _callee75, this);
11187
11198
  }));
11188
11199
 
11189
- function deleteUsers(_x99, _x100) {
11200
+ function deleteUsers(_x99) {
11190
11201
  return _deleteUsers.apply(this, arguments);
11191
11202
  }
11192
11203
 
@@ -11228,7 +11239,7 @@ var StreamChat = /*#__PURE__*/function () {
11228
11239
  }, _callee76, this);
11229
11240
  }));
11230
11241
 
11231
- function _createImportURL(_x101) {
11242
+ function _createImportURL(_x100) {
11232
11243
  return _createImportURL2.apply(this, arguments);
11233
11244
  }
11234
11245
 
@@ -11276,7 +11287,7 @@ var StreamChat = /*#__PURE__*/function () {
11276
11287
  }, _callee77, this);
11277
11288
  }));
11278
11289
 
11279
- function _createImport(_x102) {
11290
+ function _createImport(_x101) {
11280
11291
  return _createImport2.apply(this, arguments);
11281
11292
  }
11282
11293
 
@@ -11317,7 +11328,7 @@ var StreamChat = /*#__PURE__*/function () {
11317
11328
  }, _callee78, this);
11318
11329
  }));
11319
11330
 
11320
- function _getImport(_x103) {
11331
+ function _getImport(_x102) {
11321
11332
  return _getImport2.apply(this, arguments);
11322
11333
  }
11323
11334
 
@@ -11358,7 +11369,7 @@ var StreamChat = /*#__PURE__*/function () {
11358
11369
  }, _callee79, this);
11359
11370
  }));
11360
11371
 
11361
- function _listImports(_x104) {
11372
+ function _listImports(_x103) {
11362
11373
  return _listImports2.apply(this, arguments);
11363
11374
  }
11364
11375
 
@@ -11398,7 +11409,7 @@ var StreamChat = /*#__PURE__*/function () {
11398
11409
  }, _callee80, this);
11399
11410
  }));
11400
11411
 
11401
- function upsertPushProvider(_x105) {
11412
+ function upsertPushProvider(_x104) {
11402
11413
  return _upsertPushProvider.apply(this, arguments);
11403
11414
  }
11404
11415
 
@@ -11438,7 +11449,7 @@ var StreamChat = /*#__PURE__*/function () {
11438
11449
  }, _callee81, this);
11439
11450
  }));
11440
11451
 
11441
- function deletePushProvider(_x106) {
11452
+ function deletePushProvider(_x105) {
11442
11453
  return _deletePushProvider.apply(this, arguments);
11443
11454
  }
11444
11455
 
@@ -11518,7 +11529,7 @@ var StreamChat = /*#__PURE__*/function () {
11518
11529
  }, _callee83, this);
11519
11530
  }));
11520
11531
 
11521
- function commitMessage(_x107) {
11532
+ function commitMessage(_x106) {
11522
11533
  return _commitMessage.apply(this, arguments);
11523
11534
  }
11524
11535