stream-chat 5.5.0 → 6.1.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.
Files changed (40) hide show
  1. package/README.md +21 -13
  2. package/dist/browser.es.js +424 -366
  3. package/dist/browser.es.js.map +1 -1
  4. package/dist/browser.full-bundle.min.js +1 -1
  5. package/dist/browser.full-bundle.min.js.map +1 -1
  6. package/dist/browser.js +424 -366
  7. package/dist/browser.js.map +1 -1
  8. package/dist/index.es.js +424 -366
  9. package/dist/index.es.js.map +1 -1
  10. package/dist/index.js +424 -366
  11. package/dist/index.js.map +1 -1
  12. package/dist/types/channel.d.ts +124 -124
  13. package/dist/types/channel.d.ts.map +1 -1
  14. package/dist/types/channel_state.d.ts +41 -41
  15. package/dist/types/channel_state.d.ts.map +1 -1
  16. package/dist/types/client.d.ts +176 -169
  17. package/dist/types/client.d.ts.map +1 -1
  18. package/dist/types/client_state.d.ts +6 -6
  19. package/dist/types/client_state.d.ts.map +1 -1
  20. package/dist/types/connection.d.ts +10 -10
  21. package/dist/types/connection.d.ts.map +1 -1
  22. package/dist/types/connection_fallback.d.ts +7 -7
  23. package/dist/types/connection_fallback.d.ts.map +1 -1
  24. package/dist/types/insights.d.ts +2 -2
  25. package/dist/types/token_manager.d.ts +6 -6
  26. package/dist/types/token_manager.d.ts.map +1 -1
  27. package/dist/types/types.d.ts +388 -233
  28. package/dist/types/types.d.ts.map +1 -1
  29. package/dist/types/utils.d.ts +2 -2
  30. package/dist/types/utils.d.ts.map +1 -1
  31. package/package.json +4 -4
  32. package/src/channel.ts +197 -290
  33. package/src/channel_state.ts +54 -219
  34. package/src/client.ts +275 -521
  35. package/src/client_state.ts +6 -6
  36. package/src/connection.ts +7 -22
  37. package/src/connection_fallback.ts +9 -21
  38. package/src/token_manager.ts +6 -6
  39. package/src/types.ts +518 -484
  40. package/src/utils.ts +7 -11
@@ -254,7 +254,7 @@ var ChannelState = /*#__PURE__*/function () {
254
254
  /**
255
255
  * addMessageSorted - Add a message to the state
256
256
  *
257
- * @param {MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>} newMessage A new message
257
+ * @param {MessageResponse<StreamChatGenerics>} newMessage A new message
258
258
  * @param {boolean} timestampChanged Whether updating a message with changed created_at value.
259
259
  * @param {boolean} addIfDoesNotExist Add message if it is not in the list, used to prevent out of order updated messages from being added.
260
260
  *
@@ -272,7 +272,7 @@ var ChannelState = /*#__PURE__*/function () {
272
272
  * formatMessage - Takes the message object. Parses the dates, sets __html
273
273
  * and sets the status to received if missing. Returns a message object
274
274
  *
275
- * @param {MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>} message a message object
275
+ * @param {MessageResponse<StreamChatGenerics>} message a message object
276
276
  *
277
277
  */
278
278
 
@@ -294,7 +294,7 @@ var ChannelState = /*#__PURE__*/function () {
294
294
  /**
295
295
  * addMessagesSorted - Add the list of messages to state and resorts the messages
296
296
  *
297
- * @param {Array<MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>>} newMessages A list of messages
297
+ * @param {Array<MessageResponse<StreamChatGenerics>>} newMessages A list of messages
298
298
  * @param {boolean} timestampChanged Whether updating messages with changed created_at value.
299
299
  * @param {boolean} initializing Whether channel is being initialized.
300
300
  * @param {boolean} addIfDoesNotExist Add message if it is not in the list, used to prevent out of order updated messages from being added.
@@ -373,7 +373,7 @@ var ChannelState = /*#__PURE__*/function () {
373
373
  /**
374
374
  * addPinnedMessages - adds messages in pinnedMessages property
375
375
  *
376
- * @param {Array<MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>>} pinnedMessages A list of pinned messages
376
+ * @param {Array<MessageResponse<StreamChatGenerics>>} pinnedMessages A list of pinned messages
377
377
  *
378
378
  */
379
379
 
@@ -387,7 +387,7 @@ var ChannelState = /*#__PURE__*/function () {
387
387
  /**
388
388
  * addPinnedMessage - adds message in pinnedMessages
389
389
  *
390
- * @param {MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>} pinnedMessage message to update
390
+ * @param {MessageResponse<StreamChatGenerics>} pinnedMessage message to update
391
391
  *
392
392
  */
393
393
 
@@ -399,7 +399,7 @@ var ChannelState = /*#__PURE__*/function () {
399
399
  /**
400
400
  * removePinnedMessage - removes pinned message from pinnedMessages
401
401
  *
402
- * @param {MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>} message message to remove
402
+ * @param {MessageResponse<StreamChatGenerics>} message message to remove
403
403
  *
404
404
  */
405
405
 
@@ -553,7 +553,7 @@ var ChannelState = /*#__PURE__*/function () {
553
553
  /**
554
554
  * _addToMessageList - Adds a message to a list of messages, tries to update first, appends if message isn't found
555
555
  *
556
- * @param {Array<ReturnType<ChannelState<AttachmentType, ChannelType, CommandType, EventType, MessageType, ReactionType, UserType>['formatMessage']>>} messages A list of messages
556
+ * @param {Array<ReturnType<ChannelState<StreamChatGenerics>['formatMessage']>>} messages A list of messages
557
557
  * @param message
558
558
  * @param {boolean} timestampChanged Whether updating a message with changed created_at value.
559
559
  * @param {string} sortBy field name to use to sort the messages by
@@ -811,13 +811,14 @@ function isFileWebAPI(uri) {
811
811
  return typeof window !== 'undefined' && 'File' in window && uri instanceof File;
812
812
  }
813
813
 
814
+ function isOwnUser(user) {
815
+ return (user === null || user === void 0 ? void 0 : user.total_unread_count) !== undefined;
816
+ }
817
+
814
818
  function isBlobWebAPI(uri) {
815
819
  return typeof window !== 'undefined' && 'Blob' in window && uri instanceof Blob;
816
820
  }
817
821
 
818
- function isOwnUser(user) {
819
- return (user === null || user === void 0 ? void 0 : user.total_unread_count) !== undefined;
820
- }
821
822
  function isOwnUserBaseProperty(property) {
822
823
  var ownUserBaseProperties = {
823
824
  channel_mutes: true,
@@ -1012,12 +1013,12 @@ var Channel = /*#__PURE__*/function () {
1012
1013
  /**
1013
1014
  * constructor - Create a channel
1014
1015
  *
1015
- * @param {StreamChat<AttachmentType, ChannelType, CommandType, EventType, MessageType, ReactionType, UserType>} client the chat client
1016
+ * @param {StreamChat<StreamChatGenerics>} client the chat client
1016
1017
  * @param {string} type the type of channel
1017
1018
  * @param {string} [id] the id of the chat
1018
- * @param {ChannelData<ChannelType>} data any additional custom params
1019
+ * @param {ChannelData<StreamChatGenerics>} data any additional custom params
1019
1020
  *
1020
- * @return {Channel<AttachmentType, ChannelType, CommandType, EventType, MessageType, ReactionType, UserType>} Returns a new uninitialized channel
1021
+ * @return {Channel<StreamChatGenerics>} Returns a new uninitialized channel
1021
1022
  */
1022
1023
  function Channel(client, type, id, data) {
1023
1024
  var _this = this;
@@ -1136,7 +1137,7 @@ var Channel = /*#__PURE__*/function () {
1136
1137
  /**
1137
1138
  * getClient - Get the chat client for this channel. If client.disconnect() was called, this function will error
1138
1139
  *
1139
- * @return {StreamChat<AttachmentType, ChannelType, CommandType, EventType, MessageType, ReactionType, UserType>}
1140
+ * @return {StreamChat<StreamChatGenerics>}
1140
1141
  */
1141
1142
 
1142
1143
 
@@ -1164,11 +1165,11 @@ var Channel = /*#__PURE__*/function () {
1164
1165
  /**
1165
1166
  * sendMessage - Send a message to this channel
1166
1167
  *
1167
- * @param {Message<AttachmentType, MessageType, UserType>} message The Message object
1168
+ * @param {Message<StreamChatGenerics>} message The Message object
1168
1169
  * @param {boolean} [options.skip_enrich_url] Do not try to enrich the URLs within message
1169
1170
  * @param {boolean} [options.skip_push] Skip sending push notifications
1170
1171
  *
1171
- * @return {Promise<SendMessageAPIResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>>} The Server Response
1172
+ * @return {Promise<SendMessageAPIResponse<StreamChatGenerics>>} The Server Response
1172
1173
  */
1173
1174
 
1174
1175
  }, {
@@ -1232,9 +1233,9 @@ var Channel = /*#__PURE__*/function () {
1232
1233
  /**
1233
1234
  * sendEvent - Send an event on this channel
1234
1235
  *
1235
- * @param {Event<AttachmentType, ChannelType, CommandType, EventType, MessageType, ReactionType, UserType>} event for example {type: 'message.read'}
1236
+ * @param {Event<StreamChatGenerics>} event for example {type: 'message.read'}
1236
1237
  *
1237
- * @return {Promise<EventAPIResponse<AttachmentType, ChannelType, CommandType, EventType, MessageType, ReactionType, UserType>>} The Server Response
1238
+ * @return {Promise<EventAPIResponse<StreamChatGenerics>>} The Server Response
1238
1239
  */
1239
1240
 
1240
1241
  }, {
@@ -1272,10 +1273,10 @@ var Channel = /*#__PURE__*/function () {
1272
1273
  /**
1273
1274
  * search - Query messages
1274
1275
  *
1275
- * @param {MessageFilters<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType> | string} query search query or object MongoDB style filters
1276
- * @param {{client_id?: string; connection_id?: string; query?: string; message_filter_conditions?: MessageFilters<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>}} options Option object, {user_id: 'tommaso'}
1276
+ * @param {MessageFilters<StreamChatGenerics> | string} query search query or object MongoDB style filters
1277
+ * @param {{client_id?: string; connection_id?: string; query?: string; message_filter_conditions?: MessageFilters<StreamChatGenerics>}} options Option object, {user_id: 'tommaso'}
1277
1278
  *
1278
- * @return {Promise<SearchAPIResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>>} search messages response
1279
+ * @return {Promise<SearchAPIResponse<StreamChatGenerics>>} search messages response
1279
1280
  */
1280
1281
 
1281
1282
  }, {
@@ -1360,12 +1361,12 @@ var Channel = /*#__PURE__*/function () {
1360
1361
  /**
1361
1362
  * queryMembers - Query Members
1362
1363
  *
1363
- * @param {UserFilters<UserType>} filterConditions object MongoDB style filters
1364
- * @param {MemberSort<UserType>} [sort] Sort options, for instance [{created_at: -1}].
1364
+ * @param {UserFilters<StreamChatGenerics>} filterConditions object MongoDB style filters
1365
+ * @param {MemberSort<StreamChatGenerics>} [sort] Sort options, for instance [{created_at: -1}].
1365
1366
  * When using multiple fields, make sure you use array of objects to guarantee field order, for instance [{name: -1}, {created_at: 1}]
1366
1367
  * @param {{ limit?: number; offset?: number }} [options] Option object, {limit: 10, offset:10}
1367
1368
  *
1368
- * @return {Promise<ChannelMemberAPIResponse<UserType>>} Query Members response
1369
+ * @return {Promise<ChannelMemberAPIResponse<StreamChatGenerics>>} Query Members response
1369
1370
  */
1370
1371
 
1371
1372
  }, {
@@ -1427,10 +1428,10 @@ var Channel = /*#__PURE__*/function () {
1427
1428
  * sendReaction - Send a reaction about a message
1428
1429
  *
1429
1430
  * @param {string} messageID the message id
1430
- * @param {Reaction<ReactionType, UserType>} reaction the reaction object for instance {type: 'love'}
1431
+ * @param {Reaction<StreamChatGenerics>} reaction the reaction object for instance {type: 'love'}
1431
1432
  * @param {{ enforce_unique?: boolean, skip_push?: boolean }} [options] Option object, {enforce_unique: true, skip_push: true} to override any existing reaction or skip sending push notifications
1432
1433
  *
1433
- * @return {Promise<ReactionAPIResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>>} The Server Response
1434
+ * @return {Promise<ReactionAPIResponse<StreamChatGenerics>>} The Server Response
1434
1435
  */
1435
1436
 
1436
1437
  }, {
@@ -1486,7 +1487,7 @@ var Channel = /*#__PURE__*/function () {
1486
1487
  * @param {string} reactionType the type of reaction that should be removed
1487
1488
  * @param {string} [user_id] the id of the user (used only for server side request) default null
1488
1489
  *
1489
- * @return {Promise<ReactionAPIResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>>} The Server Response
1490
+ * @return {Promise<ReactionAPIResponse<StreamChatGenerics>>} The Server Response
1490
1491
  */
1491
1492
 
1492
1493
  }, {
@@ -1511,10 +1512,10 @@ var Channel = /*#__PURE__*/function () {
1511
1512
  /**
1512
1513
  * update - Edit the channel's custom properties
1513
1514
  *
1514
- * @param {ChannelData<ChannelType>} channelData The object to update the custom properties of this channel with
1515
- * @param {Message<AttachmentType, MessageType, UserType>} [updateMessage] Optional message object for channel members notification
1515
+ * @param {ChannelData<StreamChatGenerics>} channelData The object to update the custom properties of this channel with
1516
+ * @param {Message<StreamChatGenerics>} [updateMessage] Optional message object for channel members notification
1516
1517
  * @param {ChannelUpdateOptions} [options] Option object, configuration to control the behavior while updating
1517
- * @return {Promise<UpdateChannelAPIResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>>} The server response
1518
+ * @return {Promise<UpdateChannelAPIResponse<StreamChatGenerics>>} The server response
1518
1519
  */
1519
1520
 
1520
1521
  }, {
@@ -1564,9 +1565,9 @@ var Channel = /*#__PURE__*/function () {
1564
1565
  /**
1565
1566
  * updatePartial - partial update channel properties
1566
1567
  *
1567
- * @param {PartialUpdateChannel<ChannelType>} partial update request
1568
+ * @param {PartialUpdateChannel<StreamChatGenerics>} partial update request
1568
1569
  *
1569
- * @return {Promise<PartialUpdateChannelAPIResponse<ChannelType,CommandType, UserType>>}
1570
+ * @return {Promise<PartialUpdateChannelAPIResponse<StreamChatGenerics>>}
1570
1571
  */
1571
1572
 
1572
1573
  }, {
@@ -1601,7 +1602,7 @@ var Channel = /*#__PURE__*/function () {
1601
1602
  * enableSlowMode - enable slow mode
1602
1603
  *
1603
1604
  * @param {number} coolDownInterval the cooldown interval in seconds
1604
- * @return {Promise<UpdateChannelAPIResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>>} The server response
1605
+ * @return {Promise<UpdateChannelAPIResponse<StreamChatGenerics>>} The server response
1605
1606
  */
1606
1607
 
1607
1608
  }, {
@@ -1640,7 +1641,7 @@ var Channel = /*#__PURE__*/function () {
1640
1641
  /**
1641
1642
  * disableSlowMode - disable slow mode
1642
1643
  *
1643
- * @return {Promise<UpdateChannelAPIResponse<ChannelType, AttachmentType, MessageType, ReactionType, UserType>>} The server response
1644
+ * @return {Promise<UpdateChannelAPIResponse<StreamChatGenerics>>} The server response
1644
1645
  */
1645
1646
 
1646
1647
  }, {
@@ -1681,7 +1682,7 @@ var Channel = /*#__PURE__*/function () {
1681
1682
  *
1682
1683
  * @param {boolean} [options.hard_delete] Defines if the channel is hard deleted or not
1683
1684
  *
1684
- * @return {Promise<DeleteChannelAPIResponse<ChannelType, CommandType, UserType>>} The server response
1685
+ * @return {Promise<DeleteChannelAPIResponse<StreamChatGenerics>>} The server response
1685
1686
  */
1686
1687
 
1687
1688
  }, {
@@ -1717,8 +1718,8 @@ var Channel = /*#__PURE__*/function () {
1717
1718
  }()
1718
1719
  /**
1719
1720
  * truncate - Removes all messages from the channel
1720
- * @param {TruncateOptions<AttachmentType, MessageType, UserType>} [options] Defines truncation options
1721
- * @return {Promise<TruncateChannelAPIResponse<ChannelType, CommandType, UserType, MessageType, ReactionType>>} The server response
1721
+ * @param {TruncateOptions<StreamChatGenerics>} [options] Defines truncation options
1722
+ * @return {Promise<TruncateChannelAPIResponse<StreamChatGenerics>>} The server response
1722
1723
  */
1723
1724
 
1724
1725
  }, {
@@ -1755,9 +1756,9 @@ var Channel = /*#__PURE__*/function () {
1755
1756
  /**
1756
1757
  * acceptInvite - accept invitation to the channel
1757
1758
  *
1758
- * @param {InviteOptions<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>} [options] The object to update the custom properties of this channel with
1759
+ * @param {InviteOptions<StreamChatGenerics>} [options] The object to update the custom properties of this channel with
1759
1760
  *
1760
- * @return {Promise<UpdateChannelAPIResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>>} The server response
1761
+ * @return {Promise<UpdateChannelAPIResponse<StreamChatGenerics>>} The server response
1761
1762
  */
1762
1763
 
1763
1764
  }, {
@@ -1796,9 +1797,9 @@ var Channel = /*#__PURE__*/function () {
1796
1797
  /**
1797
1798
  * rejectInvite - reject invitation to the channel
1798
1799
  *
1799
- * @param {InviteOptions<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>} [options] The object to update the custom properties of this channel with
1800
+ * @param {InviteOptions<StreamChatGenerics>} [options] The object to update the custom properties of this channel with
1800
1801
  *
1801
- * @return {Promise<UpdateChannelAPIResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>>} The server response
1802
+ * @return {Promise<UpdateChannelAPIResponse<StreamChatGenerics>>} The server response
1802
1803
  */
1803
1804
 
1804
1805
  }, {
@@ -1838,9 +1839,9 @@ var Channel = /*#__PURE__*/function () {
1838
1839
  * addMembers - add members to the channel
1839
1840
  *
1840
1841
  * @param {{user_id: string, channel_role?: Role}[]} members An array of members to add to the channel
1841
- * @param {Message<AttachmentType, MessageType, UserType>} [message] Optional message object for channel members notification
1842
+ * @param {Message<StreamChatGenerics>} [message] Optional message object for channel members notification
1842
1843
  * @param {ChannelUpdateOptions} [options] Option object, configuration to control the behavior while updating
1843
- * @return {Promise<UpdateChannelAPIResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>>} The server response
1844
+ * @return {Promise<UpdateChannelAPIResponse<StreamChatGenerics>>} The server response
1844
1845
  */
1845
1846
 
1846
1847
  }, {
@@ -1881,9 +1882,9 @@ var Channel = /*#__PURE__*/function () {
1881
1882
  * addModerators - add moderators to the channel
1882
1883
  *
1883
1884
  * @param {string[]} members An array of member identifiers
1884
- * @param {Message<AttachmentType, MessageType, UserType>} [message] Optional message object for channel members notification
1885
+ * @param {Message<StreamChatGenerics>} [message] Optional message object for channel members notification
1885
1886
  * @param {ChannelUpdateOptions} [options] Option object, configuration to control the behavior while updating
1886
- * @return {Promise<UpdateChannelAPIResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>>} The server response
1887
+ * @return {Promise<UpdateChannelAPIResponse<StreamChatGenerics>>} The server response
1887
1888
  */
1888
1889
 
1889
1890
  }, {
@@ -1924,9 +1925,9 @@ var Channel = /*#__PURE__*/function () {
1924
1925
  * assignRoles - sets member roles in a channel
1925
1926
  *
1926
1927
  * @param {{channel_role: Role, user_id: string}[]} roles List of role assignments
1927
- * @param {Message<AttachmentType, MessageType, UserType>} [message] Optional message object for channel members notification
1928
+ * @param {Message<StreamChatGenerics>} [message] Optional message object for channel members notification
1928
1929
  * @param {ChannelUpdateOptions} [options] Option object, configuration to control the behavior while updating
1929
- * @return {Promise<UpdateChannelAPIResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>>} The server response
1930
+ * @return {Promise<UpdateChannelAPIResponse<StreamChatGenerics>>} The server response
1930
1931
  */
1931
1932
 
1932
1933
  }, {
@@ -1967,9 +1968,9 @@ var Channel = /*#__PURE__*/function () {
1967
1968
  * inviteMembers - invite members to the channel
1968
1969
  *
1969
1970
  * @param {{user_id: string, channel_role?: Role}[]} members An array of members to invite to the channel
1970
- * @param {Message<AttachmentType, MessageType, UserType>} [message] Optional message object for channel members notification
1971
+ * @param {Message<StreamChatGenerics>} [message] Optional message object for channel members notification
1971
1972
  * @param {ChannelUpdateOptions} [options] Option object, configuration to control the behavior while updating
1972
- * @return {Promise<UpdateChannelAPIResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>>} The server response
1973
+ * @return {Promise<UpdateChannelAPIResponse<StreamChatGenerics>>} The server response
1973
1974
  */
1974
1975
 
1975
1976
  }, {
@@ -2010,9 +2011,9 @@ var Channel = /*#__PURE__*/function () {
2010
2011
  * removeMembers - remove members from channel
2011
2012
  *
2012
2013
  * @param {string[]} members An array of member identifiers
2013
- * @param {Message<AttachmentType, MessageType, UserType>} [message] Optional message object for channel members notification
2014
+ * @param {Message<StreamChatGenerics>} [message] Optional message object for channel members notification
2014
2015
  * @param {ChannelUpdateOptions} [options] Option object, configuration to control the behavior while updating
2015
- * @return {Promise<UpdateChannelAPIResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>>} The server response
2016
+ * @return {Promise<UpdateChannelAPIResponse<StreamChatGenerics>>} The server response
2016
2017
  */
2017
2018
 
2018
2019
  }, {
@@ -2053,9 +2054,9 @@ var Channel = /*#__PURE__*/function () {
2053
2054
  * demoteModerators - remove moderator role from channel members
2054
2055
  *
2055
2056
  * @param {string[]} members An array of member identifiers
2056
- * @param {Message<AttachmentType, MessageType, UserType>} [message] Optional message object for channel members notification
2057
+ * @param {Message<StreamChatGenerics>} [message] Optional message object for channel members notification
2057
2058
  * @param {ChannelUpdateOptions} [options] Option object, configuration to control the behavior while updating
2058
- * @return {Promise<UpdateChannelAPIResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>>} The server response
2059
+ * @return {Promise<UpdateChannelAPIResponse<StreamChatGenerics>>} The server response
2059
2060
  */
2060
2061
 
2061
2062
  }, {
@@ -2095,7 +2096,7 @@ var Channel = /*#__PURE__*/function () {
2095
2096
  /**
2096
2097
  * _update - executes channel update request
2097
2098
  * @param payload Object Update Channel payload
2098
- * @return {Promise<UpdateChannelAPIResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>>} The server response
2099
+ * @return {Promise<UpdateChannelAPIResponse<StreamChatGenerics>>} The server response
2099
2100
  * TODO: introduce new type instead of Object in the next major update
2100
2101
  */
2101
2102
 
@@ -2133,7 +2134,7 @@ var Channel = /*#__PURE__*/function () {
2133
2134
  /**
2134
2135
  * mute - mutes the current channel
2135
2136
  * @param {{ user_id?: string, expiration?: string }} opts expiration in minutes or user_id
2136
- * @return {Promise<MuteChannelAPIResponse<ChannelType, CommandType, UserType>>} The server response
2137
+ * @return {Promise<MuteChannelAPIResponse<StreamChatGenerics>>} The server response
2137
2138
  *
2138
2139
  * example with expiration:
2139
2140
  * await channel.mute({expiration: moment.duration(2, 'weeks')});
@@ -2352,7 +2353,7 @@ var Channel = /*#__PURE__*/function () {
2352
2353
  /**
2353
2354
  * lastMessage - return the last message, takes into account that last few messages might not be perfectly sorted
2354
2355
  *
2355
- * @return {ReturnType<ChannelState<AttachmentType, ChannelType, CommandType, EventType, MessageType, ReactionType, UserType>['formatMessage']> | undefined} Description
2356
+ * @return {ReturnType<ChannelState<StreamChatGenerics>['formatMessage']> | undefined} Description
2356
2357
  */
2357
2358
 
2358
2359
  }, {
@@ -2377,8 +2378,8 @@ var Channel = /*#__PURE__*/function () {
2377
2378
  /**
2378
2379
  * markRead - Send the mark read event for this user, only works if the `read_events` setting is enabled
2379
2380
  *
2380
- * @param {MarkReadOptions<UserType>} data
2381
- * @return {Promise<EventAPIResponse<AttachmentType, ChannelType, CommandType, EventType, MessageType, ReactionType, UserType> | null>} Description
2381
+ * @param {MarkReadOptions<StreamChatGenerics>} data
2382
+ * @return {Promise<EventAPIResponse<StreamChatGenerics> | null>} Description
2382
2383
  */
2383
2384
 
2384
2385
  }, {
@@ -2446,9 +2447,9 @@ var Channel = /*#__PURE__*/function () {
2446
2447
  /**
2447
2448
  * watch - Loads the initial channel state and watches for changes
2448
2449
  *
2449
- * @param {ChannelQueryOptions<ChannelType, CommandType, UserType>} options additional options for the query endpoint
2450
+ * @param {ChannelQueryOptions<StreamChatGenerics>} options additional options for the query endpoint
2450
2451
  *
2451
- * @return {Promise<ChannelAPIResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>>} The server response
2452
+ * @return {Promise<ChannelAPIResponse<StreamChatGenerics>>} The server response
2452
2453
  */
2453
2454
 
2454
2455
  }, {
@@ -2550,9 +2551,9 @@ var Channel = /*#__PURE__*/function () {
2550
2551
  * getReplies - List the message replies for a parent message
2551
2552
  *
2552
2553
  * @param {string} parent_id The message parent id, ie the top of the thread
2553
- * @param {PaginationOptions & { user?: UserResponse<UserType>; user_id?: string }} options Pagination params, ie {limit:10, id_lte: 10}
2554
+ * @param {PaginationOptions & { user?: UserResponse<StreamChatGenerics>; user_id?: string }} options Pagination params, ie {limit:10, id_lte: 10}
2554
2555
  *
2555
- * @return {Promise<GetRepliesAPIResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>>} A response with a list of messages
2556
+ * @return {Promise<GetRepliesAPIResponse<StreamChatGenerics>>} A response with a list of messages
2556
2557
  */
2557
2558
 
2558
2559
  }, {
@@ -2594,10 +2595,10 @@ var Channel = /*#__PURE__*/function () {
2594
2595
  /**
2595
2596
  * getPinnedMessages - List list pinned messages of the channel
2596
2597
  *
2597
- * @param {PinnedMessagePaginationOptions & { user?: UserResponse<UserType>; user_id?: string }} options Pagination params, ie {limit:10, id_lte: 10}
2598
+ * @param {PinnedMessagePaginationOptions & { user?: UserResponse<StreamChatGenerics>; user_id?: string }} options Pagination params, ie {limit:10, id_lte: 10}
2598
2599
  * @param {PinnedMessagesSort} sort defines sorting direction of pinned messages
2599
2600
  *
2600
- * @return {Promise<GetRepliesAPIResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>>} A response with a list of messages
2601
+ * @return {Promise<GetRepliesAPIResponse<StreamChatGenerics>>} A response with a list of messages
2601
2602
  */
2602
2603
 
2603
2604
  }, {
@@ -2641,7 +2642,7 @@ var Channel = /*#__PURE__*/function () {
2641
2642
  * @param {string} message_id The message id
2642
2643
  * @param {{ limit?: number; offset?: number }} options The pagination options
2643
2644
  *
2644
- * @return {Promise<GetReactionsAPIResponse<ReactionType, UserType>>} Server response
2645
+ * @return {Promise<GetReactionsAPIResponse<StreamChatGenerics>>} Server response
2645
2646
  */
2646
2647
 
2647
2648
  }, {
@@ -2654,7 +2655,7 @@ var Channel = /*#__PURE__*/function () {
2654
2655
  *
2655
2656
  * @param {string[]} messageIds The ids of the messages to retrieve from this channel
2656
2657
  *
2657
- * @return {Promise<GetMultipleMessagesAPIResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>>} Server response
2658
+ * @return {Promise<GetMultipleMessagesAPIResponse<StreamChatGenerics>>} Server response
2658
2659
  */
2659
2660
 
2660
2661
  }, {
@@ -2684,13 +2685,16 @@ var Channel = /*#__PURE__*/function () {
2684
2685
  }, {
2685
2686
  key: "_countMessageAsUnread",
2686
2687
  value: function _countMessageAsUnread(message) {
2687
- var _message$user, _message$user2;
2688
+ var _message$user, _message$user2, _this$data2, _this$data3;
2688
2689
 
2689
2690
  if (message.shadowed) return false;
2690
2691
  if (message.silent) return false;
2692
+ if (message.parent_id && !message.show_in_channel) return false;
2691
2693
  if (((_message$user = message.user) === null || _message$user === void 0 ? void 0 : _message$user.id) === this.getClient().userID) return false;
2692
2694
  if ((_message$user2 = message.user) !== null && _message$user2 !== void 0 && _message$user2.id && this.getClient().userMuteStatus(message.user.id)) return false;
2693
- if (message.type === 'system') return false;
2695
+ if (message.type === 'system') return false; // Return false if channel doesn't allow read events.
2696
+
2697
+ if (Array.isArray((_this$data2 = this.data) === null || _this$data2 === void 0 ? void 0 : _this$data2.own_capabilities) && !((_this$data3 = this.data) !== null && _this$data3 !== void 0 && _this$data3.own_capabilities.includes('read-events'))) return false;
2694
2698
  if (this.muteStatus().muted) return false;
2695
2699
  return true;
2696
2700
  }
@@ -2748,7 +2752,7 @@ var Channel = /*#__PURE__*/function () {
2748
2752
  /**
2749
2753
  * create - Creates a new channel
2750
2754
  *
2751
- * @return {Promise<ChannelAPIResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>>} The Server Response
2755
+ * @return {Promise<ChannelAPIResponse<StreamChatGenerics>>} The Server Response
2752
2756
  */
2753
2757
 
2754
2758
  }, {
@@ -2757,9 +2761,9 @@ var Channel = /*#__PURE__*/function () {
2757
2761
  /**
2758
2762
  * query - Query the API, get messages, members or other channel fields
2759
2763
  *
2760
- * @param {ChannelQueryOptions<ChannelType, CommandType, UserType>} options The query options
2764
+ * @param {ChannelQueryOptions<StreamChatGenerics>} options The query options
2761
2765
  *
2762
- * @return {Promise<ChannelAPIResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>>} Returns a query response
2766
+ * @return {Promise<ChannelAPIResponse<StreamChatGenerics>>} Returns a query response
2763
2767
  */
2764
2768
  function () {
2765
2769
  var _query = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee31(options) {
@@ -2835,7 +2839,7 @@ var Channel = /*#__PURE__*/function () {
2835
2839
  * banUser - Bans a user from a channel
2836
2840
  *
2837
2841
  * @param {string} targetUserID
2838
- * @param {BanUserOptions<UserType>} options
2842
+ * @param {BanUserOptions<StreamChatGenerics>} options
2839
2843
  * @returns {Promise<APIResponse>}
2840
2844
  */
2841
2845
 
@@ -3007,7 +3011,7 @@ var Channel = /*#__PURE__*/function () {
3007
3011
  * shadowBan - Shadow bans a user from a channel
3008
3012
  *
3009
3013
  * @param {string} targetUserID
3010
- * @param {BanUserOptions<UserType>} options
3014
+ * @param {BanUserOptions<StreamChatGenerics>} options
3011
3015
  * @returns {Promise<APIResponse>}
3012
3016
  */
3013
3017
 
@@ -3091,8 +3095,8 @@ var Channel = /*#__PURE__*/function () {
3091
3095
  * or
3092
3096
  * channel.on(event => {console.log(event.type)})
3093
3097
  *
3094
- * @param {EventHandler<AttachmentType, ChannelType, CommandType, EventType, MessageType, ReactionType, UserType> | EventTypes} callbackOrString The event type to listen for (optional)
3095
- * @param {EventHandler<AttachmentType, ChannelType, CommandType, EventType, MessageType, ReactionType, UserType>} [callbackOrNothing] The callback to call
3098
+ * @param {EventHandler<StreamChatGenerics> | EventTypes} callbackOrString The event type to listen for (optional)
3099
+ * @param {EventHandler<StreamChatGenerics>} [callbackOrNothing] The callback to call
3096
3100
  */
3097
3101
 
3098
3102
  }, {
@@ -3918,7 +3922,6 @@ var StableWSConnection = /*#__PURE__*/function () {
3918
3922
  _this.isHealthy = healthy;
3919
3923
 
3920
3924
  if (_this.isHealthy) {
3921
- //@ts-expect-error
3922
3925
  _this.client.dispatchEvent({
3923
3926
  type: 'connection.changed',
3924
3927
  online: _this.isHealthy
@@ -3929,7 +3932,7 @@ var StableWSConnection = /*#__PURE__*/function () {
3929
3932
 
3930
3933
 
3931
3934
  setTimeout(function () {
3932
- if (_this.isHealthy) return; //@ts-expect-error
3935
+ if (_this.isHealthy) return;
3933
3936
 
3934
3937
  _this.client.dispatchEvent({
3935
3938
  type: 'connection.changed',
@@ -4897,7 +4900,7 @@ function TokenManager(secret) {
4897
4900
  * Token provider should return a token string or a promise which resolves to string token.
4898
4901
  *
4899
4902
  * @param {TokenOrProvider} tokenOrProvider
4900
- * @param {UserResponse<UserType>} user
4903
+ * @param {UserResponse<StreamChatGenerics>} user
4901
4904
  */
4902
4905
  ;
4903
4906
 
@@ -5285,7 +5288,9 @@ var WSConnectionFallback = /*#__PURE__*/function () {
5285
5288
 
5286
5289
  _this._setState(ConnectionState.Connected);
5287
5290
 
5288
- _this.connectionID = event.connection_id;
5291
+ _this.connectionID = event.connection_id; // @ts-expect-error
5292
+
5293
+ _this.client.dispatchEvent(event);
5289
5294
 
5290
5295
  _this._poll();
5291
5296
 
@@ -5295,20 +5300,20 @@ var WSConnectionFallback = /*#__PURE__*/function () {
5295
5300
 
5296
5301
  return _context3.abrupt("return", event);
5297
5302
 
5298
- case 21:
5299
- _context3.prev = 21;
5303
+ case 22:
5304
+ _context3.prev = 22;
5300
5305
  _context3.t0 = _context3["catch"](9);
5301
5306
 
5302
5307
  _this._setState(ConnectionState.Closed);
5303
5308
 
5304
5309
  throw _context3.t0;
5305
5310
 
5306
- case 25:
5311
+ case 26:
5307
5312
  case "end":
5308
5313
  return _context3.stop();
5309
5314
  }
5310
5315
  }
5311
- }, _callee3, null, [[9, 21]]);
5316
+ }, _callee3, null, [[9, 22]]);
5312
5317
  })));
5313
5318
 
5314
5319
  _defineProperty(this, "isHealthy", function () {
@@ -5387,7 +5392,6 @@ var WSConnectionFallback = /*#__PURE__*/function () {
5387
5392
 
5388
5393
 
5389
5394
  if (this.state === ConnectionState.Connecting && state === ConnectionState.Connected) {
5390
- //@ts-expect-error
5391
5395
  this.client.dispatchEvent({
5392
5396
  type: 'connection.changed',
5393
5397
  online: true
@@ -5395,7 +5399,6 @@ var WSConnectionFallback = /*#__PURE__*/function () {
5395
5399
  }
5396
5400
 
5397
5401
  if (state === ConnectionState.Closed || state === ConnectionState.Disconnected) {
5398
- //@ts-expect-error
5399
5402
  this.client.dispatchEvent({
5400
5403
  type: 'connection.changed',
5401
5404
  online: false
@@ -6688,9 +6691,9 @@ var StreamChat = /*#__PURE__*/function () {
6688
6691
  /**
6689
6692
  * setGuestUser - Setup a temporary guest user
6690
6693
  *
6691
- * @param {UserResponse<UserType>} user Data about this user. IE {name: "john"}
6694
+ * @param {UserResponse<StreamChatGenerics>} user Data about this user. IE {name: "john"}
6692
6695
  *
6693
- * @return {ConnectAPIResponse<ChannelType, CommandType, UserType>} Returns a promise that resolves when the connection is setup
6696
+ * @return {ConnectAPIResponse<StreamChatGenerics>} Returns a promise that resolves when the connection is setup
6694
6697
  */
6695
6698
  function () {
6696
6699
  var _setGuestUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(user) {
@@ -6778,8 +6781,8 @@ var StreamChat = /*#__PURE__*/function () {
6778
6781
  * or
6779
6782
  * client.on(event => {console.log(event.type)})
6780
6783
  *
6781
- * @param {EventHandler<AttachmentType, ChannelType, CommandType, EventType, MessageType, ReactionType, UserType> | string} callbackOrString The event type to listen for (optional)
6782
- * @param {EventHandler<AttachmentType, ChannelType, CommandType, EventType, MessageType, ReactionType, UserType>} [callbackOrNothing] The callback to call
6784
+ * @param {EventHandler<StreamChatGenerics> | string} callbackOrString The event type to listen for (optional)
6785
+ * @param {EventHandler<StreamChatGenerics>} [callbackOrNothing] The callback to call
6783
6786
  *
6784
6787
  * @return {{ unsubscribe: () => void }} Description
6785
6788
  */
@@ -6996,6 +6999,13 @@ var StreamChat = /*#__PURE__*/function () {
6996
6999
  this.mutedUsers = event.me.mutes;
6997
7000
  }
6998
7001
 
7002
+ if (event.type === 'notification.mark_read') {
7003
+ var activeChannelKeys = Object.keys(this.activeChannels);
7004
+ activeChannelKeys.forEach(function (activeChannelKey) {
7005
+ return _this3.activeChannels[activeChannelKey].state.unreadCount = 0;
7006
+ });
7007
+ }
7008
+
6999
7009
  if ((event.type === 'channel.deleted' || event.type === 'notification.channel_deleted') && event.cid) {
7000
7010
  var _this$activeChannels$;
7001
7011
 
@@ -7114,8 +7124,7 @@ var StreamChat = /*#__PURE__*/function () {
7114
7124
 
7115
7125
  this.logger('info', 'client:connect() - WS failed, fallback to longpoll', {
7116
7126
  tags: ['connection', 'client']
7117
- }); // @ts-expect-error
7118
-
7127
+ });
7119
7128
  this.dispatchEvent({
7120
7129
  type: 'transport.changed',
7121
7130
  mode: 'longpoll'
@@ -7181,12 +7190,12 @@ var StreamChat = /*#__PURE__*/function () {
7181
7190
  /**
7182
7191
  * queryUsers - Query users and watch user presence
7183
7192
  *
7184
- * @param {UserFilters<UserType>} filterConditions MongoDB style filter conditions
7185
- * @param {UserSort<UserType>} sort Sort options, for instance [{last_active: -1}].
7193
+ * @param {UserFilters<StreamChatGenerics>} filterConditions MongoDB style filter conditions
7194
+ * @param {UserSort<StreamChatGenerics>} sort Sort options, for instance [{last_active: -1}].
7186
7195
  * When using multiple fields, make sure you use array of objects to guarantee field order, for instance [{last_active: -1}, {created_at: 1}]
7187
7196
  * @param {UserOptions} options Option object, {presence: true}
7188
7197
  *
7189
- * @return {Promise<APIResponse & { users: Array<UserResponse<UserType>> }>} User Query Response
7198
+ * @return {Promise<{ users: Array<UserResponse<StreamChatGenerics>> }>} User Query Response
7190
7199
  */
7191
7200
 
7192
7201
  }, {
@@ -7251,7 +7260,7 @@ var StreamChat = /*#__PURE__*/function () {
7251
7260
  * @param {BannedUsersSort} sort Sort options [{created_at: 1}].
7252
7261
  * @param {BannedUsersPaginationOptions} options Option object, {limit: 10, offset:0}
7253
7262
  *
7254
- * @return {Promise<BannedUsersResponse<ChannelType, CommandType, UserType>>} Ban Query Response
7263
+ * @return {Promise<BannedUsersResponse<StreamChatGenerics>>} Ban Query Response
7255
7264
  */
7256
7265
 
7257
7266
  }, {
@@ -7300,7 +7309,7 @@ var StreamChat = /*#__PURE__*/function () {
7300
7309
  * @param {MessageFlagsFilters} filterConditions MongoDB style filter conditions
7301
7310
  * @param {MessageFlagsPaginationOptions} options Option object, {limit: 10, offset:0}
7302
7311
  *
7303
- * @return {Promise<MessageFlagsResponse<ChannelType, CommandType, UserType>>} Message Flags Response
7312
+ * @return {Promise<MessageFlagsResponse<StreamChatGenerics>>} Message Flags Response
7304
7313
  */
7305
7314
 
7306
7315
  }, {
@@ -7343,14 +7352,14 @@ var StreamChat = /*#__PURE__*/function () {
7343
7352
  /**
7344
7353
  * queryChannels - Query channels
7345
7354
  *
7346
- * @param {ChannelFilters<ChannelType, CommandType, UserType>} filterConditions object MongoDB style filters
7347
- * @param {ChannelSort<ChannelType>} [sort] Sort options, for instance {created_at: -1}.
7355
+ * @param {ChannelFilters<StreamChatGenerics>} filterConditions object MongoDB style filters
7356
+ * @param {ChannelSort<StreamChatGenerics>} [sort] Sort options, for instance {created_at: -1}.
7348
7357
  * When using multiple fields, make sure you use array of objects to guarantee field order, for instance [{last_updated: -1}, {created_at: 1}]
7349
7358
  * @param {ChannelOptions} [options] Options object
7350
7359
  * @param {ChannelStateOptions} [stateOptions] State options object. These options will only be used for state management and won't be sent in the request.
7351
7360
  * - stateOptions.skipInitialization - Skips the initialization of the state for the channels matching the ids in the list.
7352
7361
  *
7353
- * @return {Promise<APIResponse & { channels: Array<ChannelAPIResponse<AttachmentType,ChannelType,CommandType,MessageType,ReactionType,UserType>>}> } search channels response
7362
+ * @return {Promise<{ channels: Array<ChannelAPIResponse<AStreamChatGenerics>>}> } search channels response
7354
7363
  */
7355
7364
 
7356
7365
  }, {
@@ -7466,11 +7475,11 @@ var StreamChat = /*#__PURE__*/function () {
7466
7475
  /**
7467
7476
  * search - Query messages
7468
7477
  *
7469
- * @param {ChannelFilters<ChannelType, CommandType, UserType>} filterConditions MongoDB style filter conditions
7470
- * @param {MessageFilters<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType> | string} query search query or object MongoDB style filters
7471
- * @param {SearchOptions<MessageType>} [options] Option object, {user_id: 'tommaso'}
7478
+ * @param {ChannelFilters<StreamChatGenerics>} filterConditions MongoDB style filter conditions
7479
+ * @param {MessageFilters<StreamChatGenerics> | string} query search query or object MongoDB style filters
7480
+ * @param {SearchOptions<StreamChatGenerics>} [options] Option object, {user_id: 'tommaso'}
7472
7481
  *
7473
- * @return {Promise<SearchAPIResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>>} search messages response
7482
+ * @return {Promise<SearchAPIResponse<StreamChatGenerics>>} search messages response
7474
7483
  */
7475
7484
 
7476
7485
  }, {
@@ -7614,7 +7623,7 @@ var StreamChat = /*#__PURE__*/function () {
7614
7623
  *
7615
7624
  * @param {string} [userID] User ID. Only works on serverside
7616
7625
  *
7617
- * @return {APIResponse & Device<UserType>[]} Array of devices
7626
+ * @return {Device<StreamChatGenerics>[]} Array of devices
7618
7627
  */
7619
7628
 
7620
7629
  }, {
@@ -7742,7 +7751,7 @@ var StreamChat = /*#__PURE__*/function () {
7742
7751
  * await channel.create() to assign an ID to channel
7743
7752
  *
7744
7753
  * @param {string} channelType The channel type
7745
- * @param {string | ChannelData<ChannelType> | null} [channelIDOrCustom] The channel ID, you can leave this out if you want to create a conversation channel
7754
+ * @param {string | ChannelData<StreamChatGenerics> | null} [channelIDOrCustom] The channel ID, you can leave this out if you want to create a conversation channel
7746
7755
  * @param {object} [custom] Custom data to attach to the channel
7747
7756
  *
7748
7757
  * @return {channel} The channel object, initialize it using channel.watch()
@@ -7798,10 +7807,10 @@ var StreamChat = /*#__PURE__*/function () {
7798
7807
  /**
7799
7808
  * partialUpdateUser - Update the given user object
7800
7809
  *
7801
- * @param {PartialUserUpdate<UserType>} partialUserObject which should contain id and any of "set" or "unset" params;
7810
+ * @param {PartialUserUpdate<StreamChatGenerics>} partialUserObject which should contain id and any of "set" or "unset" params;
7802
7811
  * example: {id: "user1", set:{field: value}, unset:["field2"]}
7803
7812
  *
7804
- * @return {Promise<APIResponse & { users: { [key: string]: UserResponse<UserType> } }>} list of updated users
7813
+ * @return {Promise<{ users: { [key: string]: UserResponse<StreamChatGenerics> } }>} list of updated users
7805
7814
  */
7806
7815
  function () {
7807
7816
  var _partialUpdateUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee25(partialUserObject) {
@@ -7832,9 +7841,9 @@ var StreamChat = /*#__PURE__*/function () {
7832
7841
  /**
7833
7842
  * upsertUsers - Batch upsert the list of users
7834
7843
  *
7835
- * @param {UserResponse<UserType>[]} users list of users
7844
+ * @param {UserResponse<StreamChatGenerics>[]} users list of users
7836
7845
  *
7837
- * @return {Promise<APIResponse & { users: { [key: string]: UserResponse<UserType> } }>}
7846
+ * @return {Promise<{ users: { [key: string]: UserResponse<StreamChatGenerics> } }>}
7838
7847
  */
7839
7848
 
7840
7849
  }, {
@@ -7920,8 +7929,8 @@ var StreamChat = /*#__PURE__*/function () {
7920
7929
  *
7921
7930
  * updateUsers - Batch update the list of users
7922
7931
  *
7923
- * @param {UserResponse<UserType>[]} users list of users
7924
- * @return {Promise<APIResponse & { users: { [key: string]: UserResponse<UserType> } }>}
7932
+ * @param {UserResponse<StreamChatGenerics>[]} users list of users
7933
+ * @return {Promise<{ users: { [key: string]: UserResponse<StreamChatGenerics> } }>}
7925
7934
  */
7926
7935
 
7927
7936
  }, {
@@ -7930,9 +7939,9 @@ var StreamChat = /*#__PURE__*/function () {
7930
7939
  /**
7931
7940
  * upsertUser - Update or Create the given user object
7932
7941
  *
7933
- * @param {UserResponse<UserType>} userObject user object, the only required field is the user id. IE {id: "myuser"} is valid
7942
+ * @param {UserResponse<StreamChatGenerics>} userObject user object, the only required field is the user id. IE {id: "myuser"} is valid
7934
7943
  *
7935
- * @return {Promise<APIResponse & { users: { [key: string]: UserResponse<UserType> } }>}
7944
+ * @return {Promise<{ users: { [key: string]: UserResponse<StreamChatGenerics> } }>}
7936
7945
  */
7937
7946
  function upsertUser(userObject) {
7938
7947
  return this.upsertUsers([userObject]);
@@ -7942,8 +7951,8 @@ var StreamChat = /*#__PURE__*/function () {
7942
7951
  *
7943
7952
  * updateUser - Update or Create the given user object
7944
7953
  *
7945
- * @param {UserResponse<UserType>} userObject user object, the only required field is the user id. IE {id: "myuser"} is valid
7946
- * @return {Promise<APIResponse & { users: { [key: string]: UserResponse<UserType> } }>}
7954
+ * @param {UserResponse<StreamChatGenerics>} userObject user object, the only required field is the user id. IE {id: "myuser"} is valid
7955
+ * @return {Promise<{ users: { [key: string]: UserResponse<StreamChatGenerics> } }>}
7947
7956
  */
7948
7957
 
7949
7958
  }, {
@@ -7952,9 +7961,9 @@ var StreamChat = /*#__PURE__*/function () {
7952
7961
  /**
7953
7962
  * partialUpdateUsers - Batch partial update of users
7954
7963
  *
7955
- * @param {PartialUserUpdate<UserType>[]} users list of partial update requests
7964
+ * @param {PartialUserUpdate<StreamChatGenerics>[]} users list of partial update requests
7956
7965
  *
7957
- * @return {Promise<APIResponse & { users: { [key: string]: UserResponse<UserType> } }>}
7966
+ * @return {Promise<{ users: { [key: string]: UserResponse<StreamChatGenerics> } }>}
7958
7967
  */
7959
7968
  function () {
7960
7969
  var _partialUpdateUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee27(users) {
@@ -8143,7 +8152,7 @@ var StreamChat = /*#__PURE__*/function () {
8143
8152
  /** banUser - bans a user from all channels
8144
8153
  *
8145
8154
  * @param {string} targetUserID
8146
- * @param {BanUserOptions<UserType>} [options]
8155
+ * @param {BanUserOptions<StreamChatGenerics>} [options]
8147
8156
  * @returns {Promise<APIResponse>}
8148
8157
  */
8149
8158
 
@@ -8217,7 +8226,7 @@ var StreamChat = /*#__PURE__*/function () {
8217
8226
  /** shadowBan - shadow bans a user from all channels
8218
8227
  *
8219
8228
  * @param {string} targetUserID
8220
- * @param {BanUserOptions<UserType>} [options]
8229
+ * @param {BanUserOptions<StreamChatGenerics>} [options]
8221
8230
  * @returns {Promise<APIResponse>}
8222
8231
  */
8223
8232
 
@@ -8292,8 +8301,8 @@ var StreamChat = /*#__PURE__*/function () {
8292
8301
  *
8293
8302
  * @param {string} targetID
8294
8303
  * @param {string} [userID] Only used with serverside auth
8295
- * @param {MuteUserOptions<UserType>} [options]
8296
- * @returns {Promise<MuteUserResponse<ChannelType, CommandType, UserType>>}
8304
+ * @param {MuteUserOptions<StreamChatGenerics>} [options]
8305
+ * @returns {Promise<MuteUserResponse<StreamChatGenerics>>}
8297
8306
  */
8298
8307
 
8299
8308
  }, {
@@ -8550,23 +8559,23 @@ var StreamChat = /*#__PURE__*/function () {
8550
8559
  return unflagUser;
8551
8560
  }()
8552
8561
  /**
8553
- * _queryFlagReports - Query flag reports.
8562
+ * _queryFlags - Query flags.
8554
8563
  *
8555
8564
  * Note: Do not use this.
8556
8565
  * It is present for internal usage only.
8557
8566
  * This function can, and will, break and/or be removed at any point in time.
8558
8567
  *
8559
8568
  * @private
8560
- * @param {FlagReportsFilters} filterConditions MongoDB style filter conditions
8561
- * @param {FlagReportsPaginationOptions} options Option object, {limit: 10, offset:0}
8569
+ * @param {FlagsFilters} filterConditions MongoDB style filter conditions
8570
+ * @param {FlagsPaginationOptions} options Option object, {limit: 10, offset:0}
8562
8571
  *
8563
- * @return {Promise<FlagReportsResponse<ChannelType, CommandType, UserType>>} Flag Reports Response
8572
+ * @return {Promise<FlagsResponse<StreamChatGenerics>>} Flags Response
8564
8573
  */
8565
8574
 
8566
8575
  }, {
8567
- key: "_queryFlagReports",
8576
+ key: "_queryFlags",
8568
8577
  value: function () {
8569
- var _queryFlagReports2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee42() {
8578
+ var _queryFlags2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee42() {
8570
8579
  var filterConditions,
8571
8580
  options,
8572
8581
  _args42 = arguments;
@@ -8577,7 +8586,7 @@ var StreamChat = /*#__PURE__*/function () {
8577
8586
  filterConditions = _args42.length > 0 && _args42[0] !== undefined ? _args42[0] : {};
8578
8587
  options = _args42.length > 1 && _args42[1] !== undefined ? _args42[1] : {};
8579
8588
  _context42.next = 4;
8580
- return this.post(this.baseURL + '/moderation/reports', _objectSpread({
8589
+ return this.post(this.baseURL + '/moderation/flags', _objectSpread({
8581
8590
  filter_conditions: filterConditions
8582
8591
  }, options));
8583
8592
 
@@ -8592,6 +8601,55 @@ var StreamChat = /*#__PURE__*/function () {
8592
8601
  }, _callee42, this);
8593
8602
  }));
8594
8603
 
8604
+ function _queryFlags() {
8605
+ return _queryFlags2.apply(this, arguments);
8606
+ }
8607
+
8608
+ return _queryFlags;
8609
+ }()
8610
+ /**
8611
+ * _queryFlagReports - Query flag reports.
8612
+ *
8613
+ * Note: Do not use this.
8614
+ * It is present for internal usage only.
8615
+ * This function can, and will, break and/or be removed at any point in time.
8616
+ *
8617
+ * @private
8618
+ * @param {FlagReportsFilters} filterConditions MongoDB style filter conditions
8619
+ * @param {FlagReportsPaginationOptions} options Option object, {limit: 10, offset:0}
8620
+ *
8621
+ * @return {Promise<FlagReportsResponse<StreamChatGenerics>>} Flag Reports Response
8622
+ */
8623
+
8624
+ }, {
8625
+ key: "_queryFlagReports",
8626
+ value: function () {
8627
+ var _queryFlagReports2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee43() {
8628
+ var filterConditions,
8629
+ options,
8630
+ _args43 = arguments;
8631
+ return _regeneratorRuntime.wrap(function _callee43$(_context43) {
8632
+ while (1) {
8633
+ switch (_context43.prev = _context43.next) {
8634
+ case 0:
8635
+ filterConditions = _args43.length > 0 && _args43[0] !== undefined ? _args43[0] : {};
8636
+ options = _args43.length > 1 && _args43[1] !== undefined ? _args43[1] : {};
8637
+ _context43.next = 4;
8638
+ return this.post(this.baseURL + '/moderation/reports', _objectSpread({
8639
+ filter_conditions: filterConditions
8640
+ }, options));
8641
+
8642
+ case 4:
8643
+ return _context43.abrupt("return", _context43.sent);
8644
+
8645
+ case 5:
8646
+ case "end":
8647
+ return _context43.stop();
8648
+ }
8649
+ }
8650
+ }, _callee43, this);
8651
+ }));
8652
+
8595
8653
  function _queryFlagReports() {
8596
8654
  return _queryFlagReports2.apply(this, arguments);
8597
8655
  }
@@ -8616,28 +8674,28 @@ var StreamChat = /*#__PURE__*/function () {
8616
8674
  }, {
8617
8675
  key: "_reviewFlagReport",
8618
8676
  value: function () {
8619
- var _reviewFlagReport2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee43(id, reviewResult) {
8677
+ var _reviewFlagReport2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee44(id, reviewResult) {
8620
8678
  var options,
8621
- _args43 = arguments;
8622
- return _regeneratorRuntime.wrap(function _callee43$(_context43) {
8679
+ _args44 = arguments;
8680
+ return _regeneratorRuntime.wrap(function _callee44$(_context44) {
8623
8681
  while (1) {
8624
- switch (_context43.prev = _context43.next) {
8682
+ switch (_context44.prev = _context44.next) {
8625
8683
  case 0:
8626
- options = _args43.length > 2 && _args43[2] !== undefined ? _args43[2] : {};
8627
- _context43.next = 3;
8684
+ options = _args44.length > 2 && _args44[2] !== undefined ? _args44[2] : {};
8685
+ _context44.next = 3;
8628
8686
  return this.patch(this.baseURL + "/moderation/reports/".concat(id), _objectSpread({
8629
8687
  review_result: reviewResult
8630
8688
  }, options));
8631
8689
 
8632
8690
  case 3:
8633
- return _context43.abrupt("return", _context43.sent);
8691
+ return _context44.abrupt("return", _context44.sent);
8634
8692
 
8635
8693
  case 4:
8636
8694
  case "end":
8637
- return _context43.stop();
8695
+ return _context44.stop();
8638
8696
  }
8639
8697
  }
8640
- }, _callee43, this);
8698
+ }, _callee44, this);
8641
8699
  }));
8642
8700
 
8643
8701
  function _reviewFlagReport(_x54, _x55) {
@@ -8662,28 +8720,28 @@ var StreamChat = /*#__PURE__*/function () {
8662
8720
  }, {
8663
8721
  key: "_unblockMessage",
8664
8722
  value: function () {
8665
- var _unblockMessage2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee44(targetMessageID) {
8723
+ var _unblockMessage2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee45(targetMessageID) {
8666
8724
  var options,
8667
- _args44 = arguments;
8668
- return _regeneratorRuntime.wrap(function _callee44$(_context44) {
8725
+ _args45 = arguments;
8726
+ return _regeneratorRuntime.wrap(function _callee45$(_context45) {
8669
8727
  while (1) {
8670
- switch (_context44.prev = _context44.next) {
8728
+ switch (_context45.prev = _context45.next) {
8671
8729
  case 0:
8672
- options = _args44.length > 1 && _args44[1] !== undefined ? _args44[1] : {};
8673
- _context44.next = 3;
8730
+ options = _args45.length > 1 && _args45[1] !== undefined ? _args45[1] : {};
8731
+ _context45.next = 3;
8674
8732
  return this.post(this.baseURL + '/moderation/unblock_message', _objectSpread({
8675
8733
  target_message_id: targetMessageID
8676
8734
  }, options));
8677
8735
 
8678
8736
  case 3:
8679
- return _context44.abrupt("return", _context44.sent);
8737
+ return _context45.abrupt("return", _context45.sent);
8680
8738
 
8681
8739
  case 4:
8682
8740
  case "end":
8683
- return _context44.stop();
8741
+ return _context45.stop();
8684
8742
  }
8685
8743
  }
8686
- }, _callee44, this);
8744
+ }, _callee45, this);
8687
8745
  }));
8688
8746
 
8689
8747
  function _unblockMessage(_x56) {
@@ -8696,7 +8754,7 @@ var StreamChat = /*#__PURE__*/function () {
8696
8754
  * @deprecated use markChannelsRead instead
8697
8755
  *
8698
8756
  * markAllRead - marks all channels for this user as read
8699
- * @param {MarkAllReadOptions<UserType>} [data]
8757
+ * @param {MarkAllReadOptions<StreamChatGenerics>} [data]
8700
8758
  *
8701
8759
  * @return {Promise<APIResponse>}
8702
8760
  */
@@ -8708,28 +8766,28 @@ var StreamChat = /*#__PURE__*/function () {
8708
8766
  * markChannelsRead - marks channels read -
8709
8767
  * it accepts a map of cid:messageid pairs, if messageid is empty, the whole channel will be marked as read
8710
8768
  *
8711
- * @param {MarkChannelsReadOptions <UserType>} [data]
8769
+ * @param {MarkChannelsReadOptions <StreamChatGenerics>} [data]
8712
8770
  *
8713
8771
  * @return {Promise<APIResponse>}
8714
8772
  */
8715
8773
  function () {
8716
- var _markChannelsRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee45() {
8774
+ var _markChannelsRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee46() {
8717
8775
  var data,
8718
- _args45 = arguments;
8719
- return _regeneratorRuntime.wrap(function _callee45$(_context45) {
8776
+ _args46 = arguments;
8777
+ return _regeneratorRuntime.wrap(function _callee46$(_context46) {
8720
8778
  while (1) {
8721
- switch (_context45.prev = _context45.next) {
8779
+ switch (_context46.prev = _context46.next) {
8722
8780
  case 0:
8723
- data = _args45.length > 0 && _args45[0] !== undefined ? _args45[0] : {};
8724
- _context45.next = 3;
8781
+ data = _args46.length > 0 && _args46[0] !== undefined ? _args46[0] : {};
8782
+ _context46.next = 3;
8725
8783
  return this.post(this.baseURL + '/channels/read', _objectSpread({}, data));
8726
8784
 
8727
8785
  case 3:
8728
8786
  case "end":
8729
- return _context45.stop();
8787
+ return _context46.stop();
8730
8788
  }
8731
8789
  }
8732
- }, _callee45, this);
8790
+ }, _callee46, this);
8733
8791
  }));
8734
8792
 
8735
8793
  function markChannelsRead() {
@@ -8798,31 +8856,31 @@ var StreamChat = /*#__PURE__*/function () {
8798
8856
  * @param {string} messageId
8799
8857
  * @param {string} language
8800
8858
  *
8801
- * @return {APIResponse & MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>} Response that includes the message
8859
+ * @return {MessageResponse<StreamChatGenerics>} Response that includes the message
8802
8860
  */
8803
8861
 
8804
8862
  }, {
8805
8863
  key: "translateMessage",
8806
8864
  value: function () {
8807
- var _translateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee46(messageId, language) {
8808
- return _regeneratorRuntime.wrap(function _callee46$(_context46) {
8865
+ var _translateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee47(messageId, language) {
8866
+ return _regeneratorRuntime.wrap(function _callee47$(_context47) {
8809
8867
  while (1) {
8810
- switch (_context46.prev = _context46.next) {
8868
+ switch (_context47.prev = _context47.next) {
8811
8869
  case 0:
8812
- _context46.next = 2;
8870
+ _context47.next = 2;
8813
8871
  return this.post(this.baseURL + "/messages/".concat(messageId, "/translate"), {
8814
8872
  language: language
8815
8873
  });
8816
8874
 
8817
8875
  case 2:
8818
- return _context46.abrupt("return", _context46.sent);
8876
+ return _context47.abrupt("return", _context47.sent);
8819
8877
 
8820
8878
  case 3:
8821
8879
  case "end":
8822
- return _context46.stop();
8880
+ return _context47.stop();
8823
8881
  }
8824
8882
  }
8825
- }, _callee46, this);
8883
+ }, _callee47, this);
8826
8884
  }));
8827
8885
 
8828
8886
  function translateMessage(_x57, _x58) {
@@ -8917,24 +8975,24 @@ var StreamChat = /*#__PURE__*/function () {
8917
8975
  /**
8918
8976
  * updateMessage - Update the given message
8919
8977
  *
8920
- * @param {Omit<MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>, 'mentioned_users'> & { mentioned_users?: string[] }} message object, id needs to be specified
8978
+ * @param {Omit<MessageResponse<StreamChatGenerics>, 'mentioned_users'> & { mentioned_users?: string[] }} message object, id needs to be specified
8921
8979
  * @param {string | { id: string }} [userId]
8922
8980
  * @param {boolean} [options.skip_enrich_url] Do not try to enrich the URLs within message
8923
8981
  *
8924
- * @return {APIResponse & { message: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType> }} Response that includes the message
8982
+ * @return {{ message: MessageResponse<StreamChatGenerics> }} Response that includes the message
8925
8983
  */
8926
8984
 
8927
8985
  }, {
8928
8986
  key: "updateMessage",
8929
8987
  value: function () {
8930
- var _updateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee47(message, userId, options) {
8988
+ var _updateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee48(message, userId, options) {
8931
8989
  var clonedMessage, reservedMessageFields;
8932
- return _regeneratorRuntime.wrap(function _callee47$(_context47) {
8990
+ return _regeneratorRuntime.wrap(function _callee48$(_context48) {
8933
8991
  while (1) {
8934
- switch (_context47.prev = _context47.next) {
8992
+ switch (_context48.prev = _context48.next) {
8935
8993
  case 0:
8936
8994
  if (message.id) {
8937
- _context47.next = 2;
8995
+ _context48.next = 2;
8938
8996
  break;
8939
8997
  }
8940
8998
 
@@ -8971,20 +9029,20 @@ var StreamChat = /*#__PURE__*/function () {
8971
9029
  });
8972
9030
  }
8973
9031
 
8974
- _context47.next = 10;
9032
+ _context48.next = 10;
8975
9033
  return this.post(this.baseURL + "/messages/".concat(message.id), _objectSpread({
8976
9034
  message: clonedMessage
8977
9035
  }, options));
8978
9036
 
8979
9037
  case 10:
8980
- return _context47.abrupt("return", _context47.sent);
9038
+ return _context48.abrupt("return", _context48.sent);
8981
9039
 
8982
9040
  case 11:
8983
9041
  case "end":
8984
- return _context47.stop();
9042
+ return _context48.stop();
8985
9043
  }
8986
9044
  }
8987
- }, _callee47, this);
9045
+ }, _callee48, this);
8988
9046
  }));
8989
9047
 
8990
9048
  function updateMessage(_x59, _x60, _x61) {
@@ -8998,26 +9056,26 @@ var StreamChat = /*#__PURE__*/function () {
8998
9056
  *
8999
9057
  * @param {string} id the message id
9000
9058
  *
9001
- * @param {PartialUpdateMessage<MessageType>} partialMessageObject which should contain id and any of "set" or "unset" params;
9059
+ * @param {PartialUpdateMessage<StreamChatGenerics>} partialMessageObject which should contain id and any of "set" or "unset" params;
9002
9060
  * example: {id: "user1", set:{text: "hi"}, unset:["color"]}
9003
9061
  * @param {string | { id: string }} [userId]
9004
9062
  *
9005
9063
  * @param {boolean} [options.skip_enrich_url] Do not try to enrich the URLs within message
9006
9064
  *
9007
- * @return {APIResponse & { message: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType> }} Response that includes the updated message
9065
+ * @return {{ message: MessageResponse<StreamChatGenerics> }} Response that includes the updated message
9008
9066
  */
9009
9067
 
9010
9068
  }, {
9011
9069
  key: "partialUpdateMessage",
9012
9070
  value: function () {
9013
- var _partialUpdateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee48(id, partialMessageObject, userId, options) {
9071
+ var _partialUpdateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee49(id, partialMessageObject, userId, options) {
9014
9072
  var user;
9015
- return _regeneratorRuntime.wrap(function _callee48$(_context48) {
9073
+ return _regeneratorRuntime.wrap(function _callee49$(_context49) {
9016
9074
  while (1) {
9017
- switch (_context48.prev = _context48.next) {
9075
+ switch (_context49.prev = _context49.next) {
9018
9076
  case 0:
9019
9077
  if (id) {
9020
- _context48.next = 2;
9078
+ _context49.next = 2;
9021
9079
  break;
9022
9080
  }
9023
9081
 
@@ -9032,20 +9090,20 @@ var StreamChat = /*#__PURE__*/function () {
9032
9090
  };
9033
9091
  }
9034
9092
 
9035
- _context48.next = 6;
9093
+ _context49.next = 6;
9036
9094
  return this.put(this.baseURL + "/messages/".concat(id), _objectSpread(_objectSpread(_objectSpread({}, partialMessageObject), options), {}, {
9037
9095
  user: user
9038
9096
  }));
9039
9097
 
9040
9098
  case 6:
9041
- return _context48.abrupt("return", _context48.sent);
9099
+ return _context49.abrupt("return", _context49.sent);
9042
9100
 
9043
9101
  case 7:
9044
9102
  case "end":
9045
- return _context48.stop();
9103
+ return _context49.stop();
9046
9104
  }
9047
9105
  }
9048
- }, _callee48, this);
9106
+ }, _callee49, this);
9049
9107
  }));
9050
9108
 
9051
9109
  function partialUpdateMessage(_x62, _x63, _x64, _x65) {
@@ -9057,11 +9115,11 @@ var StreamChat = /*#__PURE__*/function () {
9057
9115
  }, {
9058
9116
  key: "deleteMessage",
9059
9117
  value: function () {
9060
- var _deleteMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee49(messageID, hardDelete) {
9118
+ var _deleteMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee50(messageID, hardDelete) {
9061
9119
  var params;
9062
- return _regeneratorRuntime.wrap(function _callee49$(_context49) {
9120
+ return _regeneratorRuntime.wrap(function _callee50$(_context50) {
9063
9121
  while (1) {
9064
- switch (_context49.prev = _context49.next) {
9122
+ switch (_context50.prev = _context50.next) {
9065
9123
  case 0:
9066
9124
  params = {};
9067
9125
 
@@ -9071,18 +9129,18 @@ var StreamChat = /*#__PURE__*/function () {
9071
9129
  };
9072
9130
  }
9073
9131
 
9074
- _context49.next = 4;
9132
+ _context50.next = 4;
9075
9133
  return this.delete(this.baseURL + "/messages/".concat(messageID), params);
9076
9134
 
9077
9135
  case 4:
9078
- return _context49.abrupt("return", _context49.sent);
9136
+ return _context50.abrupt("return", _context50.sent);
9079
9137
 
9080
9138
  case 5:
9081
9139
  case "end":
9082
- return _context49.stop();
9140
+ return _context50.stop();
9083
9141
  }
9084
9142
  }
9085
- }, _callee49, this);
9143
+ }, _callee50, this);
9086
9144
  }));
9087
9145
 
9088
9146
  function deleteMessage(_x66, _x67) {
@@ -9094,23 +9152,23 @@ var StreamChat = /*#__PURE__*/function () {
9094
9152
  }, {
9095
9153
  key: "getMessage",
9096
9154
  value: function () {
9097
- var _getMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee50(messageID) {
9098
- return _regeneratorRuntime.wrap(function _callee50$(_context50) {
9155
+ var _getMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee51(messageID) {
9156
+ return _regeneratorRuntime.wrap(function _callee51$(_context51) {
9099
9157
  while (1) {
9100
- switch (_context50.prev = _context50.next) {
9158
+ switch (_context51.prev = _context51.next) {
9101
9159
  case 0:
9102
- _context50.next = 2;
9160
+ _context51.next = 2;
9103
9161
  return this.get(this.baseURL + "/messages/".concat(messageID));
9104
9162
 
9105
9163
  case 2:
9106
- return _context50.abrupt("return", _context50.sent);
9164
+ return _context51.abrupt("return", _context51.sent);
9107
9165
 
9108
9166
  case 3:
9109
9167
  case "end":
9110
- return _context50.stop();
9168
+ return _context51.stop();
9111
9169
  }
9112
9170
  }
9113
- }, _callee50, this);
9171
+ }, _callee51, this);
9114
9172
  }));
9115
9173
 
9116
9174
  function getMessage(_x68) {
@@ -9122,7 +9180,7 @@ var StreamChat = /*#__PURE__*/function () {
9122
9180
  }, {
9123
9181
  key: "getUserAgent",
9124
9182
  value: function getUserAgent() {
9125
- return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "5.5.0");
9183
+ return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "6.1.0");
9126
9184
  }
9127
9185
  }, {
9128
9186
  key: "setUserAgent",
@@ -9317,25 +9375,25 @@ var StreamChat = /*#__PURE__*/function () {
9317
9375
  }, {
9318
9376
  key: "sendUserCustomEvent",
9319
9377
  value: function () {
9320
- var _sendUserCustomEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee51(targetUserID, event) {
9321
- return _regeneratorRuntime.wrap(function _callee51$(_context51) {
9378
+ var _sendUserCustomEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee52(targetUserID, event) {
9379
+ return _regeneratorRuntime.wrap(function _callee52$(_context52) {
9322
9380
  while (1) {
9323
- switch (_context51.prev = _context51.next) {
9381
+ switch (_context52.prev = _context52.next) {
9324
9382
  case 0:
9325
- _context51.next = 2;
9383
+ _context52.next = 2;
9326
9384
  return this.post("".concat(this.baseURL, "/users/").concat(targetUserID, "/event"), {
9327
9385
  event: event
9328
9386
  });
9329
9387
 
9330
9388
  case 2:
9331
- return _context51.abrupt("return", _context51.sent);
9389
+ return _context52.abrupt("return", _context52.sent);
9332
9390
 
9333
9391
  case 3:
9334
9392
  case "end":
9335
- return _context51.stop();
9393
+ return _context52.stop();
9336
9394
  }
9337
9395
  }
9338
- }, _callee51, this);
9396
+ }, _callee52, this);
9339
9397
  }));
9340
9398
 
9341
9399
  function sendUserCustomEvent(_x69, _x70) {
@@ -9406,29 +9464,29 @@ var StreamChat = /*#__PURE__*/function () {
9406
9464
  }, {
9407
9465
  key: "createSegment",
9408
9466
  value: function () {
9409
- var _createSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee52(params) {
9467
+ var _createSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee53(params) {
9410
9468
  var _yield$this$post, segment;
9411
9469
 
9412
- return _regeneratorRuntime.wrap(function _callee52$(_context52) {
9470
+ return _regeneratorRuntime.wrap(function _callee53$(_context53) {
9413
9471
  while (1) {
9414
- switch (_context52.prev = _context52.next) {
9472
+ switch (_context53.prev = _context53.next) {
9415
9473
  case 0:
9416
- _context52.next = 2;
9474
+ _context53.next = 2;
9417
9475
  return this.post(this.baseURL + "/segments", {
9418
9476
  segment: params
9419
9477
  });
9420
9478
 
9421
9479
  case 2:
9422
- _yield$this$post = _context52.sent;
9480
+ _yield$this$post = _context53.sent;
9423
9481
  segment = _yield$this$post.segment;
9424
- return _context52.abrupt("return", segment);
9482
+ return _context53.abrupt("return", segment);
9425
9483
 
9426
9484
  case 5:
9427
9485
  case "end":
9428
- return _context52.stop();
9486
+ return _context53.stop();
9429
9487
  }
9430
9488
  }
9431
- }, _callee52, this);
9489
+ }, _callee53, this);
9432
9490
  }));
9433
9491
 
9434
9492
  function createSegment(_x71) {
@@ -9448,27 +9506,27 @@ var StreamChat = /*#__PURE__*/function () {
9448
9506
  }, {
9449
9507
  key: "getSegment",
9450
9508
  value: function () {
9451
- var _getSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee53(id) {
9509
+ var _getSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee54(id) {
9452
9510
  var _yield$this$get, segment;
9453
9511
 
9454
- return _regeneratorRuntime.wrap(function _callee53$(_context53) {
9512
+ return _regeneratorRuntime.wrap(function _callee54$(_context54) {
9455
9513
  while (1) {
9456
- switch (_context53.prev = _context53.next) {
9514
+ switch (_context54.prev = _context54.next) {
9457
9515
  case 0:
9458
- _context53.next = 2;
9516
+ _context54.next = 2;
9459
9517
  return this.get(this.baseURL + "/segments/".concat(id));
9460
9518
 
9461
9519
  case 2:
9462
- _yield$this$get = _context53.sent;
9520
+ _yield$this$get = _context54.sent;
9463
9521
  segment = _yield$this$get.segment;
9464
- return _context53.abrupt("return", segment);
9522
+ return _context54.abrupt("return", segment);
9465
9523
 
9466
9524
  case 5:
9467
9525
  case "end":
9468
- return _context53.stop();
9526
+ return _context54.stop();
9469
9527
  }
9470
9528
  }
9471
- }, _callee53, this);
9529
+ }, _callee54, this);
9472
9530
  }));
9473
9531
 
9474
9532
  function getSegment(_x72) {
@@ -9487,27 +9545,27 @@ var StreamChat = /*#__PURE__*/function () {
9487
9545
  }, {
9488
9546
  key: "listSegments",
9489
9547
  value: function () {
9490
- var _listSegments = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee54(options) {
9548
+ var _listSegments = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee55(options) {
9491
9549
  var _yield$this$get2, segments;
9492
9550
 
9493
- return _regeneratorRuntime.wrap(function _callee54$(_context54) {
9551
+ return _regeneratorRuntime.wrap(function _callee55$(_context55) {
9494
9552
  while (1) {
9495
- switch (_context54.prev = _context54.next) {
9553
+ switch (_context55.prev = _context55.next) {
9496
9554
  case 0:
9497
- _context54.next = 2;
9555
+ _context55.next = 2;
9498
9556
  return this.get(this.baseURL + "/segments", options);
9499
9557
 
9500
9558
  case 2:
9501
- _yield$this$get2 = _context54.sent;
9559
+ _yield$this$get2 = _context55.sent;
9502
9560
  segments = _yield$this$get2.segments;
9503
- return _context54.abrupt("return", segments);
9561
+ return _context55.abrupt("return", segments);
9504
9562
 
9505
9563
  case 5:
9506
9564
  case "end":
9507
- return _context54.stop();
9565
+ return _context55.stop();
9508
9566
  }
9509
9567
  }
9510
- }, _callee54, this);
9568
+ }, _callee55, this);
9511
9569
  }));
9512
9570
 
9513
9571
  function listSegments(_x73) {
@@ -9528,29 +9586,29 @@ var StreamChat = /*#__PURE__*/function () {
9528
9586
  }, {
9529
9587
  key: "updateSegment",
9530
9588
  value: function () {
9531
- var _updateSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee55(id, params) {
9589
+ var _updateSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee56(id, params) {
9532
9590
  var _yield$this$put, segment;
9533
9591
 
9534
- return _regeneratorRuntime.wrap(function _callee55$(_context55) {
9592
+ return _regeneratorRuntime.wrap(function _callee56$(_context56) {
9535
9593
  while (1) {
9536
- switch (_context55.prev = _context55.next) {
9594
+ switch (_context56.prev = _context56.next) {
9537
9595
  case 0:
9538
- _context55.next = 2;
9596
+ _context56.next = 2;
9539
9597
  return this.put(this.baseURL + "/segments/".concat(id), {
9540
9598
  segment: params
9541
9599
  });
9542
9600
 
9543
9601
  case 2:
9544
- _yield$this$put = _context55.sent;
9602
+ _yield$this$put = _context56.sent;
9545
9603
  segment = _yield$this$put.segment;
9546
- return _context55.abrupt("return", segment);
9604
+ return _context56.abrupt("return", segment);
9547
9605
 
9548
9606
  case 5:
9549
9607
  case "end":
9550
- return _context55.stop();
9608
+ return _context56.stop();
9551
9609
  }
9552
9610
  }
9553
- }, _callee55, this);
9611
+ }, _callee56, this);
9554
9612
  }));
9555
9613
 
9556
9614
  function updateSegment(_x74, _x75) {
@@ -9570,19 +9628,19 @@ var StreamChat = /*#__PURE__*/function () {
9570
9628
  }, {
9571
9629
  key: "deleteSegment",
9572
9630
  value: function () {
9573
- var _deleteSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee56(id) {
9574
- return _regeneratorRuntime.wrap(function _callee56$(_context56) {
9631
+ var _deleteSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee57(id) {
9632
+ return _regeneratorRuntime.wrap(function _callee57$(_context57) {
9575
9633
  while (1) {
9576
- switch (_context56.prev = _context56.next) {
9634
+ switch (_context57.prev = _context57.next) {
9577
9635
  case 0:
9578
- return _context56.abrupt("return", this.delete(this.baseURL + "/segments/".concat(id)));
9636
+ return _context57.abrupt("return", this.delete(this.baseURL + "/segments/".concat(id)));
9579
9637
 
9580
9638
  case 1:
9581
9639
  case "end":
9582
- return _context56.stop();
9640
+ return _context57.stop();
9583
9641
  }
9584
9642
  }
9585
- }, _callee56, this);
9643
+ }, _callee57, this);
9586
9644
  }));
9587
9645
 
9588
9646
  function deleteSegment(_x76) {
@@ -9602,29 +9660,29 @@ var StreamChat = /*#__PURE__*/function () {
9602
9660
  }, {
9603
9661
  key: "createCampaign",
9604
9662
  value: function () {
9605
- var _createCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee57(params) {
9663
+ var _createCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee58(params) {
9606
9664
  var _yield$this$post2, campaign;
9607
9665
 
9608
- return _regeneratorRuntime.wrap(function _callee57$(_context57) {
9666
+ return _regeneratorRuntime.wrap(function _callee58$(_context58) {
9609
9667
  while (1) {
9610
- switch (_context57.prev = _context57.next) {
9668
+ switch (_context58.prev = _context58.next) {
9611
9669
  case 0:
9612
- _context57.next = 2;
9670
+ _context58.next = 2;
9613
9671
  return this.post(this.baseURL + "/campaigns", {
9614
9672
  campaign: params
9615
9673
  });
9616
9674
 
9617
9675
  case 2:
9618
- _yield$this$post2 = _context57.sent;
9676
+ _yield$this$post2 = _context58.sent;
9619
9677
  campaign = _yield$this$post2.campaign;
9620
- return _context57.abrupt("return", campaign);
9678
+ return _context58.abrupt("return", campaign);
9621
9679
 
9622
9680
  case 5:
9623
9681
  case "end":
9624
- return _context57.stop();
9682
+ return _context58.stop();
9625
9683
  }
9626
9684
  }
9627
- }, _callee57, this);
9685
+ }, _callee58, this);
9628
9686
  }));
9629
9687
 
9630
9688
  function createCampaign(_x77) {
@@ -9644,27 +9702,27 @@ var StreamChat = /*#__PURE__*/function () {
9644
9702
  }, {
9645
9703
  key: "getCampaign",
9646
9704
  value: function () {
9647
- var _getCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee58(id) {
9705
+ var _getCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee59(id) {
9648
9706
  var _yield$this$get3, campaign;
9649
9707
 
9650
- return _regeneratorRuntime.wrap(function _callee58$(_context58) {
9708
+ return _regeneratorRuntime.wrap(function _callee59$(_context59) {
9651
9709
  while (1) {
9652
- switch (_context58.prev = _context58.next) {
9710
+ switch (_context59.prev = _context59.next) {
9653
9711
  case 0:
9654
- _context58.next = 2;
9712
+ _context59.next = 2;
9655
9713
  return this.get(this.baseURL + "/campaigns/".concat(id));
9656
9714
 
9657
9715
  case 2:
9658
- _yield$this$get3 = _context58.sent;
9716
+ _yield$this$get3 = _context59.sent;
9659
9717
  campaign = _yield$this$get3.campaign;
9660
- return _context58.abrupt("return", campaign);
9718
+ return _context59.abrupt("return", campaign);
9661
9719
 
9662
9720
  case 5:
9663
9721
  case "end":
9664
- return _context58.stop();
9722
+ return _context59.stop();
9665
9723
  }
9666
9724
  }
9667
- }, _callee58, this);
9725
+ }, _callee59, this);
9668
9726
  }));
9669
9727
 
9670
9728
  function getCampaign(_x78) {
@@ -9683,27 +9741,27 @@ var StreamChat = /*#__PURE__*/function () {
9683
9741
  }, {
9684
9742
  key: "listCampaigns",
9685
9743
  value: function () {
9686
- var _listCampaigns = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee59(options) {
9744
+ var _listCampaigns = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee60(options) {
9687
9745
  var _yield$this$get4, campaigns;
9688
9746
 
9689
- return _regeneratorRuntime.wrap(function _callee59$(_context59) {
9747
+ return _regeneratorRuntime.wrap(function _callee60$(_context60) {
9690
9748
  while (1) {
9691
- switch (_context59.prev = _context59.next) {
9749
+ switch (_context60.prev = _context60.next) {
9692
9750
  case 0:
9693
- _context59.next = 2;
9751
+ _context60.next = 2;
9694
9752
  return this.get(this.baseURL + "/campaigns", options);
9695
9753
 
9696
9754
  case 2:
9697
- _yield$this$get4 = _context59.sent;
9755
+ _yield$this$get4 = _context60.sent;
9698
9756
  campaigns = _yield$this$get4.campaigns;
9699
- return _context59.abrupt("return", campaigns);
9757
+ return _context60.abrupt("return", campaigns);
9700
9758
 
9701
9759
  case 5:
9702
9760
  case "end":
9703
- return _context59.stop();
9761
+ return _context60.stop();
9704
9762
  }
9705
9763
  }
9706
- }, _callee59, this);
9764
+ }, _callee60, this);
9707
9765
  }));
9708
9766
 
9709
9767
  function listCampaigns(_x79) {
@@ -9724,29 +9782,29 @@ var StreamChat = /*#__PURE__*/function () {
9724
9782
  }, {
9725
9783
  key: "updateCampaign",
9726
9784
  value: function () {
9727
- var _updateCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee60(id, params) {
9785
+ var _updateCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee61(id, params) {
9728
9786
  var _yield$this$put2, campaign;
9729
9787
 
9730
- return _regeneratorRuntime.wrap(function _callee60$(_context60) {
9788
+ return _regeneratorRuntime.wrap(function _callee61$(_context61) {
9731
9789
  while (1) {
9732
- switch (_context60.prev = _context60.next) {
9790
+ switch (_context61.prev = _context61.next) {
9733
9791
  case 0:
9734
- _context60.next = 2;
9792
+ _context61.next = 2;
9735
9793
  return this.put(this.baseURL + "/campaigns/".concat(id), {
9736
9794
  campaign: params
9737
9795
  });
9738
9796
 
9739
9797
  case 2:
9740
- _yield$this$put2 = _context60.sent;
9798
+ _yield$this$put2 = _context61.sent;
9741
9799
  campaign = _yield$this$put2.campaign;
9742
- return _context60.abrupt("return", campaign);
9800
+ return _context61.abrupt("return", campaign);
9743
9801
 
9744
9802
  case 5:
9745
9803
  case "end":
9746
- return _context60.stop();
9804
+ return _context61.stop();
9747
9805
  }
9748
9806
  }
9749
- }, _callee60, this);
9807
+ }, _callee61, this);
9750
9808
  }));
9751
9809
 
9752
9810
  function updateCampaign(_x80, _x81) {
@@ -9766,19 +9824,19 @@ var StreamChat = /*#__PURE__*/function () {
9766
9824
  }, {
9767
9825
  key: "deleteCampaign",
9768
9826
  value: function () {
9769
- var _deleteCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee61(id) {
9770
- return _regeneratorRuntime.wrap(function _callee61$(_context61) {
9827
+ var _deleteCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee62(id) {
9828
+ return _regeneratorRuntime.wrap(function _callee62$(_context62) {
9771
9829
  while (1) {
9772
- switch (_context61.prev = _context61.next) {
9830
+ switch (_context62.prev = _context62.next) {
9773
9831
  case 0:
9774
- return _context61.abrupt("return", this.delete(this.baseURL + "/campaigns/".concat(id)));
9832
+ return _context62.abrupt("return", this.delete(this.baseURL + "/campaigns/".concat(id)));
9775
9833
 
9776
9834
  case 1:
9777
9835
  case "end":
9778
- return _context61.stop();
9836
+ return _context62.stop();
9779
9837
  }
9780
9838
  }
9781
- }, _callee61, this);
9839
+ }, _callee62, this);
9782
9840
  }));
9783
9841
 
9784
9842
  function deleteCampaign(_x82) {
@@ -9799,30 +9857,30 @@ var StreamChat = /*#__PURE__*/function () {
9799
9857
  }, {
9800
9858
  key: "scheduleCampaign",
9801
9859
  value: function () {
9802
- var _scheduleCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee62(id, params) {
9860
+ var _scheduleCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee63(id, params) {
9803
9861
  var sendAt, _yield$this$patch, campaign;
9804
9862
 
9805
- return _regeneratorRuntime.wrap(function _callee62$(_context62) {
9863
+ return _regeneratorRuntime.wrap(function _callee63$(_context63) {
9806
9864
  while (1) {
9807
- switch (_context62.prev = _context62.next) {
9865
+ switch (_context63.prev = _context63.next) {
9808
9866
  case 0:
9809
9867
  sendAt = params.sendAt;
9810
- _context62.next = 3;
9868
+ _context63.next = 3;
9811
9869
  return this.patch(this.baseURL + "/campaigns/".concat(id, "/schedule"), {
9812
9870
  send_at: sendAt
9813
9871
  });
9814
9872
 
9815
9873
  case 3:
9816
- _yield$this$patch = _context62.sent;
9874
+ _yield$this$patch = _context63.sent;
9817
9875
  campaign = _yield$this$patch.campaign;
9818
- return _context62.abrupt("return", campaign);
9876
+ return _context63.abrupt("return", campaign);
9819
9877
 
9820
9878
  case 6:
9821
9879
  case "end":
9822
- return _context62.stop();
9880
+ return _context63.stop();
9823
9881
  }
9824
9882
  }
9825
- }, _callee62, this);
9883
+ }, _callee63, this);
9826
9884
  }));
9827
9885
 
9828
9886
  function scheduleCampaign(_x83, _x84) {
@@ -9842,27 +9900,27 @@ var StreamChat = /*#__PURE__*/function () {
9842
9900
  }, {
9843
9901
  key: "stopCampaign",
9844
9902
  value: function () {
9845
- var _stopCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee63(id) {
9903
+ var _stopCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee64(id) {
9846
9904
  var _yield$this$patch2, campaign;
9847
9905
 
9848
- return _regeneratorRuntime.wrap(function _callee63$(_context63) {
9906
+ return _regeneratorRuntime.wrap(function _callee64$(_context64) {
9849
9907
  while (1) {
9850
- switch (_context63.prev = _context63.next) {
9908
+ switch (_context64.prev = _context64.next) {
9851
9909
  case 0:
9852
- _context63.next = 2;
9910
+ _context64.next = 2;
9853
9911
  return this.patch(this.baseURL + "/campaigns/".concat(id, "/stop"));
9854
9912
 
9855
9913
  case 2:
9856
- _yield$this$patch2 = _context63.sent;
9914
+ _yield$this$patch2 = _context64.sent;
9857
9915
  campaign = _yield$this$patch2.campaign;
9858
- return _context63.abrupt("return", campaign);
9916
+ return _context64.abrupt("return", campaign);
9859
9917
 
9860
9918
  case 5:
9861
9919
  case "end":
9862
- return _context63.stop();
9920
+ return _context64.stop();
9863
9921
  }
9864
9922
  }
9865
- }, _callee63, this);
9923
+ }, _callee64, this);
9866
9924
  }));
9867
9925
 
9868
9926
  function stopCampaign(_x85) {
@@ -9882,27 +9940,27 @@ var StreamChat = /*#__PURE__*/function () {
9882
9940
  }, {
9883
9941
  key: "resumeCampaign",
9884
9942
  value: function () {
9885
- var _resumeCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee64(id) {
9943
+ var _resumeCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee65(id) {
9886
9944
  var _yield$this$patch3, campaign;
9887
9945
 
9888
- return _regeneratorRuntime.wrap(function _callee64$(_context64) {
9946
+ return _regeneratorRuntime.wrap(function _callee65$(_context65) {
9889
9947
  while (1) {
9890
- switch (_context64.prev = _context64.next) {
9948
+ switch (_context65.prev = _context65.next) {
9891
9949
  case 0:
9892
- _context64.next = 2;
9950
+ _context65.next = 2;
9893
9951
  return this.patch(this.baseURL + "/campaigns/".concat(id, "/resume"));
9894
9952
 
9895
9953
  case 2:
9896
- _yield$this$patch3 = _context64.sent;
9954
+ _yield$this$patch3 = _context65.sent;
9897
9955
  campaign = _yield$this$patch3.campaign;
9898
- return _context64.abrupt("return", campaign);
9956
+ return _context65.abrupt("return", campaign);
9899
9957
 
9900
9958
  case 5:
9901
9959
  case "end":
9902
- return _context64.stop();
9960
+ return _context65.stop();
9903
9961
  }
9904
9962
  }
9905
- }, _callee64, this);
9963
+ }, _callee65, this);
9906
9964
  }));
9907
9965
 
9908
9966
  function resumeCampaign(_x86) {
@@ -9922,30 +9980,30 @@ var StreamChat = /*#__PURE__*/function () {
9922
9980
  }, {
9923
9981
  key: "testCampaign",
9924
9982
  value: function () {
9925
- var _testCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee65(id, params) {
9983
+ var _testCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee66(id, params) {
9926
9984
  var users, _yield$this$post3, campaign;
9927
9985
 
9928
- return _regeneratorRuntime.wrap(function _callee65$(_context65) {
9986
+ return _regeneratorRuntime.wrap(function _callee66$(_context66) {
9929
9987
  while (1) {
9930
- switch (_context65.prev = _context65.next) {
9988
+ switch (_context66.prev = _context66.next) {
9931
9989
  case 0:
9932
9990
  users = params.users;
9933
- _context65.next = 3;
9991
+ _context66.next = 3;
9934
9992
  return this.post(this.baseURL + "/campaigns/".concat(id, "/test"), {
9935
9993
  users: users
9936
9994
  });
9937
9995
 
9938
9996
  case 3:
9939
- _yield$this$post3 = _context65.sent;
9997
+ _yield$this$post3 = _context66.sent;
9940
9998
  campaign = _yield$this$post3.campaign;
9941
- return _context65.abrupt("return", campaign);
9999
+ return _context66.abrupt("return", campaign);
9942
10000
 
9943
10001
  case 6:
9944
10002
  case "end":
9945
- return _context65.stop();
10003
+ return _context66.stop();
9946
10004
  }
9947
10005
  }
9948
- }, _callee65, this);
10006
+ }, _callee66, this);
9949
10007
  }));
9950
10008
 
9951
10009
  function testCampaign(_x87, _x88) {
@@ -9964,21 +10022,21 @@ var StreamChat = /*#__PURE__*/function () {
9964
10022
  }, {
9965
10023
  key: "enrichURL",
9966
10024
  value: function () {
9967
- var _enrichURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee66(url) {
9968
- return _regeneratorRuntime.wrap(function _callee66$(_context66) {
10025
+ var _enrichURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee67(url) {
10026
+ return _regeneratorRuntime.wrap(function _callee67$(_context67) {
9969
10027
  while (1) {
9970
- switch (_context66.prev = _context66.next) {
10028
+ switch (_context67.prev = _context67.next) {
9971
10029
  case 0:
9972
- return _context66.abrupt("return", this.get(this.baseURL + "/og", {
10030
+ return _context67.abrupt("return", this.get(this.baseURL + "/og", {
9973
10031
  url: url
9974
10032
  }));
9975
10033
 
9976
10034
  case 1:
9977
10035
  case "end":
9978
- return _context66.stop();
10036
+ return _context67.stop();
9979
10037
  }
9980
10038
  }
9981
- }, _callee66, this);
10039
+ }, _callee67, this);
9982
10040
  }));
9983
10041
 
9984
10042
  function enrichURL(_x89) {
@@ -9998,19 +10056,19 @@ var StreamChat = /*#__PURE__*/function () {
9998
10056
  }, {
9999
10057
  key: "getTask",
10000
10058
  value: function () {
10001
- var _getTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee67(id) {
10002
- return _regeneratorRuntime.wrap(function _callee67$(_context67) {
10059
+ var _getTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee68(id) {
10060
+ return _regeneratorRuntime.wrap(function _callee68$(_context68) {
10003
10061
  while (1) {
10004
- switch (_context67.prev = _context67.next) {
10062
+ switch (_context68.prev = _context68.next) {
10005
10063
  case 0:
10006
- return _context67.abrupt("return", this.get("".concat(this.baseURL, "/tasks/").concat(id)));
10064
+ return _context68.abrupt("return", this.get("".concat(this.baseURL, "/tasks/").concat(id)));
10007
10065
 
10008
10066
  case 1:
10009
10067
  case "end":
10010
- return _context67.stop();
10068
+ return _context68.stop();
10011
10069
  }
10012
10070
  }
10013
- }, _callee67, this);
10071
+ }, _callee68, this);
10014
10072
  }));
10015
10073
 
10016
10074
  function getTask(_x90) {
@@ -10031,28 +10089,28 @@ var StreamChat = /*#__PURE__*/function () {
10031
10089
  }, {
10032
10090
  key: "deleteChannels",
10033
10091
  value: function () {
10034
- var _deleteChannels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee68(cids) {
10092
+ var _deleteChannels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee69(cids) {
10035
10093
  var options,
10036
- _args68 = arguments;
10037
- return _regeneratorRuntime.wrap(function _callee68$(_context68) {
10094
+ _args69 = arguments;
10095
+ return _regeneratorRuntime.wrap(function _callee69$(_context69) {
10038
10096
  while (1) {
10039
- switch (_context68.prev = _context68.next) {
10097
+ switch (_context69.prev = _context69.next) {
10040
10098
  case 0:
10041
- options = _args68.length > 1 && _args68[1] !== undefined ? _args68[1] : {};
10042
- _context68.next = 3;
10099
+ options = _args69.length > 1 && _args69[1] !== undefined ? _args69[1] : {};
10100
+ _context69.next = 3;
10043
10101
  return this.post(this.baseURL + "/channels/delete", _objectSpread({
10044
10102
  cids: cids
10045
10103
  }, options));
10046
10104
 
10047
10105
  case 3:
10048
- return _context68.abrupt("return", _context68.sent);
10106
+ return _context69.abrupt("return", _context69.sent);
10049
10107
 
10050
10108
  case 4:
10051
10109
  case "end":
10052
- return _context68.stop();
10110
+ return _context69.stop();
10053
10111
  }
10054
10112
  }
10055
- }, _callee68, this);
10113
+ }, _callee69, this);
10056
10114
  }));
10057
10115
 
10058
10116
  function deleteChannels(_x91) {
@@ -10073,13 +10131,13 @@ var StreamChat = /*#__PURE__*/function () {
10073
10131
  }, {
10074
10132
  key: "deleteUsers",
10075
10133
  value: function () {
10076
- var _deleteUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee69(user_ids, options) {
10077
- return _regeneratorRuntime.wrap(function _callee69$(_context69) {
10134
+ var _deleteUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee70(user_ids, options) {
10135
+ return _regeneratorRuntime.wrap(function _callee70$(_context70) {
10078
10136
  while (1) {
10079
- switch (_context69.prev = _context69.next) {
10137
+ switch (_context70.prev = _context70.next) {
10080
10138
  case 0:
10081
10139
  if (!((options === null || options === void 0 ? void 0 : options.user) !== 'soft' && (options === null || options === void 0 ? void 0 : options.user) !== 'hard')) {
10082
- _context69.next = 2;
10140
+ _context70.next = 2;
10083
10141
  break;
10084
10142
  }
10085
10143
 
@@ -10087,7 +10145,7 @@ var StreamChat = /*#__PURE__*/function () {
10087
10145
 
10088
10146
  case 2:
10089
10147
  if (!(options.messages !== undefined && options.messages !== 'soft' && options.messages !== 'hard')) {
10090
- _context69.next = 4;
10148
+ _context70.next = 4;
10091
10149
  break;
10092
10150
  }
10093
10151
 
@@ -10095,27 +10153,27 @@ var StreamChat = /*#__PURE__*/function () {
10095
10153
 
10096
10154
  case 4:
10097
10155
  if (!(options.conversations !== undefined && options.conversations !== 'soft' && options.conversations !== 'hard')) {
10098
- _context69.next = 6;
10156
+ _context70.next = 6;
10099
10157
  break;
10100
10158
  }
10101
10159
 
10102
10160
  throw new Error('Invalid delete user options. conversations must be one of [soft hard]');
10103
10161
 
10104
10162
  case 6:
10105
- _context69.next = 8;
10163
+ _context70.next = 8;
10106
10164
  return this.post(this.baseURL + "/users/delete", _objectSpread({
10107
10165
  user_ids: user_ids
10108
10166
  }, options));
10109
10167
 
10110
10168
  case 8:
10111
- return _context69.abrupt("return", _context69.sent);
10169
+ return _context70.abrupt("return", _context70.sent);
10112
10170
 
10113
10171
  case 9:
10114
10172
  case "end":
10115
- return _context69.stop();
10173
+ return _context70.stop();
10116
10174
  }
10117
10175
  }
10118
- }, _callee69, this);
10176
+ }, _callee70, this);
10119
10177
  }));
10120
10178
 
10121
10179
  function deleteUsers(_x92, _x93) {
@@ -10140,25 +10198,25 @@ var StreamChat = /*#__PURE__*/function () {
10140
10198
  }, {
10141
10199
  key: "_createImport",
10142
10200
  value: function () {
10143
- var _createImport2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee70(filename) {
10144
- return _regeneratorRuntime.wrap(function _callee70$(_context70) {
10201
+ var _createImport2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee71(filename) {
10202
+ return _regeneratorRuntime.wrap(function _callee71$(_context71) {
10145
10203
  while (1) {
10146
- switch (_context70.prev = _context70.next) {
10204
+ switch (_context71.prev = _context71.next) {
10147
10205
  case 0:
10148
- _context70.next = 2;
10206
+ _context71.next = 2;
10149
10207
  return this.post(this.baseURL + "/imports", {
10150
10208
  filename: filename
10151
10209
  });
10152
10210
 
10153
10211
  case 2:
10154
- return _context70.abrupt("return", _context70.sent);
10212
+ return _context71.abrupt("return", _context71.sent);
10155
10213
 
10156
10214
  case 3:
10157
10215
  case "end":
10158
- return _context70.stop();
10216
+ return _context71.stop();
10159
10217
  }
10160
10218
  }
10161
- }, _callee70, this);
10219
+ }, _callee71, this);
10162
10220
  }));
10163
10221
 
10164
10222
  function _createImport(_x94) {
@@ -10183,23 +10241,23 @@ var StreamChat = /*#__PURE__*/function () {
10183
10241
  }, {
10184
10242
  key: "_getImport",
10185
10243
  value: function () {
10186
- var _getImport2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee71(id) {
10187
- return _regeneratorRuntime.wrap(function _callee71$(_context71) {
10244
+ var _getImport2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee72(id) {
10245
+ return _regeneratorRuntime.wrap(function _callee72$(_context72) {
10188
10246
  while (1) {
10189
- switch (_context71.prev = _context71.next) {
10247
+ switch (_context72.prev = _context72.next) {
10190
10248
  case 0:
10191
- _context71.next = 2;
10249
+ _context72.next = 2;
10192
10250
  return this.get(this.baseURL + "/imports/".concat(id));
10193
10251
 
10194
10252
  case 2:
10195
- return _context71.abrupt("return", _context71.sent);
10253
+ return _context72.abrupt("return", _context72.sent);
10196
10254
 
10197
10255
  case 3:
10198
10256
  case "end":
10199
- return _context71.stop();
10257
+ return _context72.stop();
10200
10258
  }
10201
10259
  }
10202
- }, _callee71, this);
10260
+ }, _callee72, this);
10203
10261
  }));
10204
10262
 
10205
10263
  function _getImport(_x95) {
@@ -10224,23 +10282,23 @@ var StreamChat = /*#__PURE__*/function () {
10224
10282
  }, {
10225
10283
  key: "_listImports",
10226
10284
  value: function () {
10227
- var _listImports2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee72(options) {
10228
- return _regeneratorRuntime.wrap(function _callee72$(_context72) {
10285
+ var _listImports2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee73(options) {
10286
+ return _regeneratorRuntime.wrap(function _callee73$(_context73) {
10229
10287
  while (1) {
10230
- switch (_context72.prev = _context72.next) {
10288
+ switch (_context73.prev = _context73.next) {
10231
10289
  case 0:
10232
- _context72.next = 2;
10290
+ _context73.next = 2;
10233
10291
  return this.get(this.baseURL + "/imports", options);
10234
10292
 
10235
10293
  case 2:
10236
- return _context72.abrupt("return", _context72.sent);
10294
+ return _context73.abrupt("return", _context73.sent);
10237
10295
 
10238
10296
  case 3:
10239
10297
  case "end":
10240
- return _context72.stop();
10298
+ return _context73.stop();
10241
10299
  }
10242
10300
  }
10243
- }, _callee72, this);
10301
+ }, _callee73, this);
10244
10302
  }));
10245
10303
 
10246
10304
  function _listImports(_x96) {