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/index.js CHANGED
@@ -6100,11 +6100,18 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
6100
6100
  /*
6101
6101
  DeleteUserOptions specifies a collection of one or more `user_ids` to be deleted.
6102
6102
 
6103
- `user` soft|hard determines if the user needs to be hard- or soft-deleted, where hard-delete
6104
- implies that all related objects (messages, flags, etc) will be hard-deleted as well.
6105
- `conversations` soft|hard will delete any 1to1 channels that the user was a member of.
6106
- `messages` soft-hard will delete any messages that the user has sent.
6107
- `new_channel_owner_id` any channels owned by the hard-deleted user will be transferred to this user ID
6103
+ `user`:
6104
+ - soft: marks user as deleted and retains all user data
6105
+ - pruning: marks user as deleted and nullifies user information
6106
+ - hard: deletes user completely - this requires hard option for messages and conversation as well
6107
+ `conversations`:
6108
+ - soft: marks all conversation channels as deleted (same effect as Delete Channels with 'hard' option disabled)
6109
+ - hard: deletes channel and all its data completely including messages (same effect as Delete Channels with 'hard' option enabled)
6110
+ `messages`:
6111
+ - soft: marks all user messages as deleted without removing any related message data
6112
+ - pruning: marks all user messages as deleted, nullifies message information and removes some message data such as reactions and flags
6113
+ - hard: deletes messages completely with all related information
6114
+ `new_channel_owner_id`: any channels owned by the hard-deleted user will be transferred to this user ID
6108
6115
  */
6109
6116
  // TODO: add better typing
6110
6117
  var ErrorFromResponse = /*#__PURE__*/function (_Error) {
@@ -7710,7 +7717,7 @@ var StreamChat = /*#__PURE__*/function () {
7710
7717
  }, {
7711
7718
  key: "sendFile",
7712
7719
  value: function sendFile(url, uri, name, contentType, user) {
7713
- var data = addFileToFormData(uri, name, contentType);
7720
+ var data = addFileToFormData(uri, name, contentType || 'multipart/form-data');
7714
7721
  if (user != null) data.append('user', JSON.stringify(user));
7715
7722
  return this.doAxiosRequest('postForm', url, data, {
7716
7723
  headers: data.getHeaders ? data.getHeaders() : {},
@@ -10203,7 +10210,7 @@ var StreamChat = /*#__PURE__*/function () {
10203
10210
  }, {
10204
10211
  key: "getUserAgent",
10205
10212
  value: function getUserAgent() {
10206
- return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.14.3");
10213
+ return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.14.5");
10207
10214
  }
10208
10215
  }, {
10209
10216
  key: "setUserAgent",
@@ -11147,44 +11154,48 @@ var StreamChat = /*#__PURE__*/function () {
11147
11154
  }, {
11148
11155
  key: "deleteUsers",
11149
11156
  value: function () {
11150
- var _deleteUsers = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee75(user_ids, options) {
11157
+ var _deleteUsers = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee75(user_ids) {
11158
+ var options,
11159
+ _args75 = arguments;
11151
11160
  return _regeneratorRuntime__default['default'].wrap(function _callee75$(_context75) {
11152
11161
  while (1) {
11153
11162
  switch (_context75.prev = _context75.next) {
11154
11163
  case 0:
11155
- if (!((options === null || options === void 0 ? void 0 : options.user) !== 'soft' && (options === null || options === void 0 ? void 0 : options.user) !== 'hard')) {
11156
- _context75.next = 2;
11164
+ options = _args75.length > 1 && _args75[1] !== undefined ? _args75[1] : {};
11165
+
11166
+ if (!(typeof options.user !== 'undefined' && !['soft', 'hard', 'pruning'].includes(options.user))) {
11167
+ _context75.next = 3;
11157
11168
  break;
11158
11169
  }
11159
11170
 
11160
- throw new Error('Invalid delete user options. user must be one of [soft hard]');
11171
+ throw new Error('Invalid delete user options. user must be one of [soft hard pruning]');
11161
11172
 
11162
- case 2:
11163
- if (!(options.messages !== undefined && options.messages !== 'soft' && options.messages !== 'hard')) {
11164
- _context75.next = 4;
11173
+ case 3:
11174
+ if (!(typeof options.conversations !== 'undefined' && !['soft', 'hard'].includes(options.conversations))) {
11175
+ _context75.next = 5;
11165
11176
  break;
11166
11177
  }
11167
11178
 
11168
- throw new Error('Invalid delete user options. messages must be one of [soft hard]');
11179
+ throw new Error('Invalid delete user options. conversations must be one of [soft hard]');
11169
11180
 
11170
- case 4:
11171
- if (!(options.conversations !== undefined && options.conversations !== 'soft' && options.conversations !== 'hard')) {
11172
- _context75.next = 6;
11181
+ case 5:
11182
+ if (!(typeof options.messages !== 'undefined' && !['soft', 'hard', 'pruning'].includes(options.messages))) {
11183
+ _context75.next = 7;
11173
11184
  break;
11174
11185
  }
11175
11186
 
11176
- throw new Error('Invalid delete user options. conversations must be one of [soft hard]');
11187
+ throw new Error('Invalid delete user options. messages must be one of [soft hard pruning]');
11177
11188
 
11178
- case 6:
11179
- _context75.next = 8;
11189
+ case 7:
11190
+ _context75.next = 9;
11180
11191
  return this.post(this.baseURL + "/users/delete", _objectSpread({
11181
11192
  user_ids: user_ids
11182
11193
  }, options));
11183
11194
 
11184
- case 8:
11195
+ case 9:
11185
11196
  return _context75.abrupt("return", _context75.sent);
11186
11197
 
11187
- case 9:
11198
+ case 10:
11188
11199
  case "end":
11189
11200
  return _context75.stop();
11190
11201
  }
@@ -11192,7 +11203,7 @@ var StreamChat = /*#__PURE__*/function () {
11192
11203
  }, _callee75, this);
11193
11204
  }));
11194
11205
 
11195
- function deleteUsers(_x99, _x100) {
11206
+ function deleteUsers(_x99) {
11196
11207
  return _deleteUsers.apply(this, arguments);
11197
11208
  }
11198
11209
 
@@ -11234,7 +11245,7 @@ var StreamChat = /*#__PURE__*/function () {
11234
11245
  }, _callee76, this);
11235
11246
  }));
11236
11247
 
11237
- function _createImportURL(_x101) {
11248
+ function _createImportURL(_x100) {
11238
11249
  return _createImportURL2.apply(this, arguments);
11239
11250
  }
11240
11251
 
@@ -11282,7 +11293,7 @@ var StreamChat = /*#__PURE__*/function () {
11282
11293
  }, _callee77, this);
11283
11294
  }));
11284
11295
 
11285
- function _createImport(_x102) {
11296
+ function _createImport(_x101) {
11286
11297
  return _createImport2.apply(this, arguments);
11287
11298
  }
11288
11299
 
@@ -11323,7 +11334,7 @@ var StreamChat = /*#__PURE__*/function () {
11323
11334
  }, _callee78, this);
11324
11335
  }));
11325
11336
 
11326
- function _getImport(_x103) {
11337
+ function _getImport(_x102) {
11327
11338
  return _getImport2.apply(this, arguments);
11328
11339
  }
11329
11340
 
@@ -11364,7 +11375,7 @@ var StreamChat = /*#__PURE__*/function () {
11364
11375
  }, _callee79, this);
11365
11376
  }));
11366
11377
 
11367
- function _listImports(_x104) {
11378
+ function _listImports(_x103) {
11368
11379
  return _listImports2.apply(this, arguments);
11369
11380
  }
11370
11381
 
@@ -11404,7 +11415,7 @@ var StreamChat = /*#__PURE__*/function () {
11404
11415
  }, _callee80, this);
11405
11416
  }));
11406
11417
 
11407
- function upsertPushProvider(_x105) {
11418
+ function upsertPushProvider(_x104) {
11408
11419
  return _upsertPushProvider.apply(this, arguments);
11409
11420
  }
11410
11421
 
@@ -11444,7 +11455,7 @@ var StreamChat = /*#__PURE__*/function () {
11444
11455
  }, _callee81, this);
11445
11456
  }));
11446
11457
 
11447
- function deletePushProvider(_x106) {
11458
+ function deletePushProvider(_x105) {
11448
11459
  return _deletePushProvider.apply(this, arguments);
11449
11460
  }
11450
11461
 
@@ -11524,7 +11535,7 @@ var StreamChat = /*#__PURE__*/function () {
11524
11535
  }, _callee83, this);
11525
11536
  }));
11526
11537
 
11527
- function commitMessage(_x107) {
11538
+ function commitMessage(_x106) {
11528
11539
  return _commitMessage.apply(this, arguments);
11529
11540
  }
11530
11541