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.
@@ -6069,11 +6069,18 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
6069
6069
  /*
6070
6070
  DeleteUserOptions specifies a collection of one or more `user_ids` to be deleted.
6071
6071
 
6072
- `user` soft|hard determines if the user needs to be hard- or soft-deleted, where hard-delete
6073
- implies that all related objects (messages, flags, etc) will be hard-deleted as well.
6074
- `conversations` soft|hard will delete any 1to1 channels that the user was a member of.
6075
- `messages` soft-hard will delete any messages that the user has sent.
6076
- `new_channel_owner_id` any channels owned by the hard-deleted user will be transferred to this user ID
6072
+ `user`:
6073
+ - soft: marks user as deleted and retains all user data
6074
+ - pruning: marks user as deleted and nullifies user information
6075
+ - hard: deletes user completely - this requires hard option for messages and conversation as well
6076
+ `conversations`:
6077
+ - soft: marks all conversation channels as deleted (same effect as Delete Channels with 'hard' option disabled)
6078
+ - hard: deletes channel and all its data completely including messages (same effect as Delete Channels with 'hard' option enabled)
6079
+ `messages`:
6080
+ - soft: marks all user messages as deleted without removing any related message data
6081
+ - pruning: marks all user messages as deleted, nullifies message information and removes some message data such as reactions and flags
6082
+ - hard: deletes messages completely with all related information
6083
+ `new_channel_owner_id`: any channels owned by the hard-deleted user will be transferred to this user ID
6077
6084
  */
6078
6085
  // TODO: add better typing
6079
6086
  var ErrorFromResponse = /*#__PURE__*/function (_Error) {
@@ -7679,7 +7686,7 @@ var StreamChat = /*#__PURE__*/function () {
7679
7686
  }, {
7680
7687
  key: "sendFile",
7681
7688
  value: function sendFile(url, uri, name, contentType, user) {
7682
- var data = addFileToFormData(uri, name, contentType);
7689
+ var data = addFileToFormData(uri, name, contentType || 'multipart/form-data');
7683
7690
  if (user != null) data.append('user', JSON.stringify(user));
7684
7691
  return this.doAxiosRequest('postForm', url, data, {
7685
7692
  headers: data.getHeaders ? data.getHeaders() : {},
@@ -10172,7 +10179,7 @@ var StreamChat = /*#__PURE__*/function () {
10172
10179
  }, {
10173
10180
  key: "getUserAgent",
10174
10181
  value: function getUserAgent() {
10175
- return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.14.3");
10182
+ return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.14.5");
10176
10183
  }
10177
10184
  }, {
10178
10185
  key: "setUserAgent",
@@ -11116,44 +11123,48 @@ var StreamChat = /*#__PURE__*/function () {
11116
11123
  }, {
11117
11124
  key: "deleteUsers",
11118
11125
  value: function () {
11119
- var _deleteUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee75(user_ids, options) {
11126
+ var _deleteUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee75(user_ids) {
11127
+ var options,
11128
+ _args75 = arguments;
11120
11129
  return _regeneratorRuntime.wrap(function _callee75$(_context75) {
11121
11130
  while (1) {
11122
11131
  switch (_context75.prev = _context75.next) {
11123
11132
  case 0:
11124
- if (!((options === null || options === void 0 ? void 0 : options.user) !== 'soft' && (options === null || options === void 0 ? void 0 : options.user) !== 'hard')) {
11125
- _context75.next = 2;
11133
+ options = _args75.length > 1 && _args75[1] !== undefined ? _args75[1] : {};
11134
+
11135
+ if (!(typeof options.user !== 'undefined' && !['soft', 'hard', 'pruning'].includes(options.user))) {
11136
+ _context75.next = 3;
11126
11137
  break;
11127
11138
  }
11128
11139
 
11129
- throw new Error('Invalid delete user options. user must be one of [soft hard]');
11140
+ throw new Error('Invalid delete user options. user must be one of [soft hard pruning]');
11130
11141
 
11131
- case 2:
11132
- if (!(options.messages !== undefined && options.messages !== 'soft' && options.messages !== 'hard')) {
11133
- _context75.next = 4;
11142
+ case 3:
11143
+ if (!(typeof options.conversations !== 'undefined' && !['soft', 'hard'].includes(options.conversations))) {
11144
+ _context75.next = 5;
11134
11145
  break;
11135
11146
  }
11136
11147
 
11137
- throw new Error('Invalid delete user options. messages must be one of [soft hard]');
11148
+ throw new Error('Invalid delete user options. conversations must be one of [soft hard]');
11138
11149
 
11139
- case 4:
11140
- if (!(options.conversations !== undefined && options.conversations !== 'soft' && options.conversations !== 'hard')) {
11141
- _context75.next = 6;
11150
+ case 5:
11151
+ if (!(typeof options.messages !== 'undefined' && !['soft', 'hard', 'pruning'].includes(options.messages))) {
11152
+ _context75.next = 7;
11142
11153
  break;
11143
11154
  }
11144
11155
 
11145
- throw new Error('Invalid delete user options. conversations must be one of [soft hard]');
11156
+ throw new Error('Invalid delete user options. messages must be one of [soft hard pruning]');
11146
11157
 
11147
- case 6:
11148
- _context75.next = 8;
11158
+ case 7:
11159
+ _context75.next = 9;
11149
11160
  return this.post(this.baseURL + "/users/delete", _objectSpread({
11150
11161
  user_ids: user_ids
11151
11162
  }, options));
11152
11163
 
11153
- case 8:
11164
+ case 9:
11154
11165
  return _context75.abrupt("return", _context75.sent);
11155
11166
 
11156
- case 9:
11167
+ case 10:
11157
11168
  case "end":
11158
11169
  return _context75.stop();
11159
11170
  }
@@ -11161,7 +11172,7 @@ var StreamChat = /*#__PURE__*/function () {
11161
11172
  }, _callee75, this);
11162
11173
  }));
11163
11174
 
11164
- function deleteUsers(_x99, _x100) {
11175
+ function deleteUsers(_x99) {
11165
11176
  return _deleteUsers.apply(this, arguments);
11166
11177
  }
11167
11178
 
@@ -11203,7 +11214,7 @@ var StreamChat = /*#__PURE__*/function () {
11203
11214
  }, _callee76, this);
11204
11215
  }));
11205
11216
 
11206
- function _createImportURL(_x101) {
11217
+ function _createImportURL(_x100) {
11207
11218
  return _createImportURL2.apply(this, arguments);
11208
11219
  }
11209
11220
 
@@ -11251,7 +11262,7 @@ var StreamChat = /*#__PURE__*/function () {
11251
11262
  }, _callee77, this);
11252
11263
  }));
11253
11264
 
11254
- function _createImport(_x102) {
11265
+ function _createImport(_x101) {
11255
11266
  return _createImport2.apply(this, arguments);
11256
11267
  }
11257
11268
 
@@ -11292,7 +11303,7 @@ var StreamChat = /*#__PURE__*/function () {
11292
11303
  }, _callee78, this);
11293
11304
  }));
11294
11305
 
11295
- function _getImport(_x103) {
11306
+ function _getImport(_x102) {
11296
11307
  return _getImport2.apply(this, arguments);
11297
11308
  }
11298
11309
 
@@ -11333,7 +11344,7 @@ var StreamChat = /*#__PURE__*/function () {
11333
11344
  }, _callee79, this);
11334
11345
  }));
11335
11346
 
11336
- function _listImports(_x104) {
11347
+ function _listImports(_x103) {
11337
11348
  return _listImports2.apply(this, arguments);
11338
11349
  }
11339
11350
 
@@ -11373,7 +11384,7 @@ var StreamChat = /*#__PURE__*/function () {
11373
11384
  }, _callee80, this);
11374
11385
  }));
11375
11386
 
11376
- function upsertPushProvider(_x105) {
11387
+ function upsertPushProvider(_x104) {
11377
11388
  return _upsertPushProvider.apply(this, arguments);
11378
11389
  }
11379
11390
 
@@ -11413,7 +11424,7 @@ var StreamChat = /*#__PURE__*/function () {
11413
11424
  }, _callee81, this);
11414
11425
  }));
11415
11426
 
11416
- function deletePushProvider(_x106) {
11427
+ function deletePushProvider(_x105) {
11417
11428
  return _deletePushProvider.apply(this, arguments);
11418
11429
  }
11419
11430
 
@@ -11493,7 +11504,7 @@ var StreamChat = /*#__PURE__*/function () {
11493
11504
  }, _callee83, this);
11494
11505
  }));
11495
11506
 
11496
- function commitMessage(_x107) {
11507
+ function commitMessage(_x106) {
11497
11508
  return _commitMessage.apply(this, arguments);
11498
11509
  }
11499
11510