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.es.js CHANGED
@@ -6072,11 +6072,18 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
6072
6072
  /*
6073
6073
  DeleteUserOptions specifies a collection of one or more `user_ids` to be deleted.
6074
6074
 
6075
- `user` soft|hard determines if the user needs to be hard- or soft-deleted, where hard-delete
6076
- implies that all related objects (messages, flags, etc) will be hard-deleted as well.
6077
- `conversations` soft|hard will delete any 1to1 channels that the user was a member of.
6078
- `messages` soft-hard will delete any messages that the user has sent.
6079
- `new_channel_owner_id` any channels owned by the hard-deleted user will be transferred to this user ID
6075
+ `user`:
6076
+ - soft: marks user as deleted and retains all user data
6077
+ - pruning: marks user as deleted and nullifies user information
6078
+ - hard: deletes user completely - this requires hard option for messages and conversation as well
6079
+ `conversations`:
6080
+ - soft: marks all conversation channels as deleted (same effect as Delete Channels with 'hard' option disabled)
6081
+ - hard: deletes channel and all its data completely including messages (same effect as Delete Channels with 'hard' option enabled)
6082
+ `messages`:
6083
+ - soft: marks all user messages as deleted without removing any related message data
6084
+ - pruning: marks all user messages as deleted, nullifies message information and removes some message data such as reactions and flags
6085
+ - hard: deletes messages completely with all related information
6086
+ `new_channel_owner_id`: any channels owned by the hard-deleted user will be transferred to this user ID
6080
6087
  */
6081
6088
  // TODO: add better typing
6082
6089
  var ErrorFromResponse = /*#__PURE__*/function (_Error) {
@@ -7682,7 +7689,7 @@ var StreamChat = /*#__PURE__*/function () {
7682
7689
  }, {
7683
7690
  key: "sendFile",
7684
7691
  value: function sendFile(url, uri, name, contentType, user) {
7685
- var data = addFileToFormData(uri, name, contentType);
7692
+ var data = addFileToFormData(uri, name, contentType || 'multipart/form-data');
7686
7693
  if (user != null) data.append('user', JSON.stringify(user));
7687
7694
  return this.doAxiosRequest('postForm', url, data, {
7688
7695
  headers: data.getHeaders ? data.getHeaders() : {},
@@ -10175,7 +10182,7 @@ var StreamChat = /*#__PURE__*/function () {
10175
10182
  }, {
10176
10183
  key: "getUserAgent",
10177
10184
  value: function getUserAgent() {
10178
- return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.14.3");
10185
+ return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.14.5");
10179
10186
  }
10180
10187
  }, {
10181
10188
  key: "setUserAgent",
@@ -11119,44 +11126,48 @@ var StreamChat = /*#__PURE__*/function () {
11119
11126
  }, {
11120
11127
  key: "deleteUsers",
11121
11128
  value: function () {
11122
- var _deleteUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee75(user_ids, options) {
11129
+ var _deleteUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee75(user_ids) {
11130
+ var options,
11131
+ _args75 = arguments;
11123
11132
  return _regeneratorRuntime.wrap(function _callee75$(_context75) {
11124
11133
  while (1) {
11125
11134
  switch (_context75.prev = _context75.next) {
11126
11135
  case 0:
11127
- if (!((options === null || options === void 0 ? void 0 : options.user) !== 'soft' && (options === null || options === void 0 ? void 0 : options.user) !== 'hard')) {
11128
- _context75.next = 2;
11136
+ options = _args75.length > 1 && _args75[1] !== undefined ? _args75[1] : {};
11137
+
11138
+ if (!(typeof options.user !== 'undefined' && !['soft', 'hard', 'pruning'].includes(options.user))) {
11139
+ _context75.next = 3;
11129
11140
  break;
11130
11141
  }
11131
11142
 
11132
- throw new Error('Invalid delete user options. user must be one of [soft hard]');
11143
+ throw new Error('Invalid delete user options. user must be one of [soft hard pruning]');
11133
11144
 
11134
- case 2:
11135
- if (!(options.messages !== undefined && options.messages !== 'soft' && options.messages !== 'hard')) {
11136
- _context75.next = 4;
11145
+ case 3:
11146
+ if (!(typeof options.conversations !== 'undefined' && !['soft', 'hard'].includes(options.conversations))) {
11147
+ _context75.next = 5;
11137
11148
  break;
11138
11149
  }
11139
11150
 
11140
- throw new Error('Invalid delete user options. messages must be one of [soft hard]');
11151
+ throw new Error('Invalid delete user options. conversations must be one of [soft hard]');
11141
11152
 
11142
- case 4:
11143
- if (!(options.conversations !== undefined && options.conversations !== 'soft' && options.conversations !== 'hard')) {
11144
- _context75.next = 6;
11153
+ case 5:
11154
+ if (!(typeof options.messages !== 'undefined' && !['soft', 'hard', 'pruning'].includes(options.messages))) {
11155
+ _context75.next = 7;
11145
11156
  break;
11146
11157
  }
11147
11158
 
11148
- throw new Error('Invalid delete user options. conversations must be one of [soft hard]');
11159
+ throw new Error('Invalid delete user options. messages must be one of [soft hard pruning]');
11149
11160
 
11150
- case 6:
11151
- _context75.next = 8;
11161
+ case 7:
11162
+ _context75.next = 9;
11152
11163
  return this.post(this.baseURL + "/users/delete", _objectSpread({
11153
11164
  user_ids: user_ids
11154
11165
  }, options));
11155
11166
 
11156
- case 8:
11167
+ case 9:
11157
11168
  return _context75.abrupt("return", _context75.sent);
11158
11169
 
11159
- case 9:
11170
+ case 10:
11160
11171
  case "end":
11161
11172
  return _context75.stop();
11162
11173
  }
@@ -11164,7 +11175,7 @@ var StreamChat = /*#__PURE__*/function () {
11164
11175
  }, _callee75, this);
11165
11176
  }));
11166
11177
 
11167
- function deleteUsers(_x99, _x100) {
11178
+ function deleteUsers(_x99) {
11168
11179
  return _deleteUsers.apply(this, arguments);
11169
11180
  }
11170
11181
 
@@ -11206,7 +11217,7 @@ var StreamChat = /*#__PURE__*/function () {
11206
11217
  }, _callee76, this);
11207
11218
  }));
11208
11219
 
11209
- function _createImportURL(_x101) {
11220
+ function _createImportURL(_x100) {
11210
11221
  return _createImportURL2.apply(this, arguments);
11211
11222
  }
11212
11223
 
@@ -11254,7 +11265,7 @@ var StreamChat = /*#__PURE__*/function () {
11254
11265
  }, _callee77, this);
11255
11266
  }));
11256
11267
 
11257
- function _createImport(_x102) {
11268
+ function _createImport(_x101) {
11258
11269
  return _createImport2.apply(this, arguments);
11259
11270
  }
11260
11271
 
@@ -11295,7 +11306,7 @@ var StreamChat = /*#__PURE__*/function () {
11295
11306
  }, _callee78, this);
11296
11307
  }));
11297
11308
 
11298
- function _getImport(_x103) {
11309
+ function _getImport(_x102) {
11299
11310
  return _getImport2.apply(this, arguments);
11300
11311
  }
11301
11312
 
@@ -11336,7 +11347,7 @@ var StreamChat = /*#__PURE__*/function () {
11336
11347
  }, _callee79, this);
11337
11348
  }));
11338
11349
 
11339
- function _listImports(_x104) {
11350
+ function _listImports(_x103) {
11340
11351
  return _listImports2.apply(this, arguments);
11341
11352
  }
11342
11353
 
@@ -11376,7 +11387,7 @@ var StreamChat = /*#__PURE__*/function () {
11376
11387
  }, _callee80, this);
11377
11388
  }));
11378
11389
 
11379
- function upsertPushProvider(_x105) {
11390
+ function upsertPushProvider(_x104) {
11380
11391
  return _upsertPushProvider.apply(this, arguments);
11381
11392
  }
11382
11393
 
@@ -11416,7 +11427,7 @@ var StreamChat = /*#__PURE__*/function () {
11416
11427
  }, _callee81, this);
11417
11428
  }));
11418
11429
 
11419
- function deletePushProvider(_x106) {
11430
+ function deletePushProvider(_x105) {
11420
11431
  return _deletePushProvider.apply(this, arguments);
11421
11432
  }
11422
11433
 
@@ -11496,7 +11507,7 @@ var StreamChat = /*#__PURE__*/function () {
11496
11507
  }, _callee83, this);
11497
11508
  }));
11498
11509
 
11499
- function commitMessage(_x107) {
11510
+ function commitMessage(_x106) {
11500
11511
  return _commitMessage.apply(this, arguments);
11501
11512
  }
11502
11513