stream-chat 5.6.0 → 6.2.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 +59 -114
  2. package/dist/browser.es.js +464 -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 +464 -366
  7. package/dist/browser.js.map +1 -1
  8. package/dist/index.es.js +464 -366
  9. package/dist/index.es.js.map +1 -1
  10. package/dist/index.js +464 -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 +190 -163
  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 +404 -236
  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 +2 -2
  32. package/src/channel.ts +196 -290
  33. package/src/channel_state.ts +54 -219
  34. package/src/client.ts +297 -524
  35. package/src/client_state.ts +6 -6
  36. package/src/connection.ts +7 -22
  37. package/src/connection_fallback.ts +7 -21
  38. package/src/token_manager.ts +6 -6
  39. package/src/types.ts +540 -487
  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,14 +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;
2691
2692
  if (message.parent_id && !message.show_in_channel) return false;
2692
2693
  if (((_message$user = message.user) === null || _message$user === void 0 ? void 0 : _message$user.id) === this.getClient().userID) return false;
2693
2694
  if ((_message$user2 = message.user) !== null && _message$user2 !== void 0 && _message$user2.id && this.getClient().userMuteStatus(message.user.id)) return false;
2694
- 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;
2695
2698
  if (this.muteStatus().muted) return false;
2696
2699
  return true;
2697
2700
  }
@@ -2749,7 +2752,7 @@ var Channel = /*#__PURE__*/function () {
2749
2752
  /**
2750
2753
  * create - Creates a new channel
2751
2754
  *
2752
- * @return {Promise<ChannelAPIResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>>} The Server Response
2755
+ * @return {Promise<ChannelAPIResponse<StreamChatGenerics>>} The Server Response
2753
2756
  */
2754
2757
 
2755
2758
  }, {
@@ -2758,9 +2761,9 @@ var Channel = /*#__PURE__*/function () {
2758
2761
  /**
2759
2762
  * query - Query the API, get messages, members or other channel fields
2760
2763
  *
2761
- * @param {ChannelQueryOptions<ChannelType, CommandType, UserType>} options The query options
2764
+ * @param {ChannelQueryOptions<StreamChatGenerics>} options The query options
2762
2765
  *
2763
- * @return {Promise<ChannelAPIResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>>} Returns a query response
2766
+ * @return {Promise<ChannelAPIResponse<StreamChatGenerics>>} Returns a query response
2764
2767
  */
2765
2768
  function () {
2766
2769
  var _query = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee31(options) {
@@ -2836,7 +2839,7 @@ var Channel = /*#__PURE__*/function () {
2836
2839
  * banUser - Bans a user from a channel
2837
2840
  *
2838
2841
  * @param {string} targetUserID
2839
- * @param {BanUserOptions<UserType>} options
2842
+ * @param {BanUserOptions<StreamChatGenerics>} options
2840
2843
  * @returns {Promise<APIResponse>}
2841
2844
  */
2842
2845
 
@@ -3008,7 +3011,7 @@ var Channel = /*#__PURE__*/function () {
3008
3011
  * shadowBan - Shadow bans a user from a channel
3009
3012
  *
3010
3013
  * @param {string} targetUserID
3011
- * @param {BanUserOptions<UserType>} options
3014
+ * @param {BanUserOptions<StreamChatGenerics>} options
3012
3015
  * @returns {Promise<APIResponse>}
3013
3016
  */
3014
3017
 
@@ -3092,8 +3095,8 @@ var Channel = /*#__PURE__*/function () {
3092
3095
  * or
3093
3096
  * channel.on(event => {console.log(event.type)})
3094
3097
  *
3095
- * @param {EventHandler<AttachmentType, ChannelType, CommandType, EventType, MessageType, ReactionType, UserType> | EventTypes} callbackOrString The event type to listen for (optional)
3096
- * @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
3097
3100
  */
3098
3101
 
3099
3102
  }, {
@@ -3919,7 +3922,6 @@ var StableWSConnection = /*#__PURE__*/function () {
3919
3922
  _this.isHealthy = healthy;
3920
3923
 
3921
3924
  if (_this.isHealthy) {
3922
- //@ts-expect-error
3923
3925
  _this.client.dispatchEvent({
3924
3926
  type: 'connection.changed',
3925
3927
  online: _this.isHealthy
@@ -3930,7 +3932,7 @@ var StableWSConnection = /*#__PURE__*/function () {
3930
3932
 
3931
3933
 
3932
3934
  setTimeout(function () {
3933
- if (_this.isHealthy) return; //@ts-expect-error
3935
+ if (_this.isHealthy) return;
3934
3936
 
3935
3937
  _this.client.dispatchEvent({
3936
3938
  type: 'connection.changed',
@@ -4898,7 +4900,7 @@ function TokenManager(secret) {
4898
4900
  * Token provider should return a token string or a promise which resolves to string token.
4899
4901
  *
4900
4902
  * @param {TokenOrProvider} tokenOrProvider
4901
- * @param {UserResponse<UserType>} user
4903
+ * @param {UserResponse<StreamChatGenerics>} user
4902
4904
  */
4903
4905
  ;
4904
4906
 
@@ -5390,7 +5392,6 @@ var WSConnectionFallback = /*#__PURE__*/function () {
5390
5392
 
5391
5393
 
5392
5394
  if (this.state === ConnectionState.Connecting && state === ConnectionState.Connected) {
5393
- //@ts-expect-error
5394
5395
  this.client.dispatchEvent({
5395
5396
  type: 'connection.changed',
5396
5397
  online: true
@@ -5398,7 +5399,6 @@ var WSConnectionFallback = /*#__PURE__*/function () {
5398
5399
  }
5399
5400
 
5400
5401
  if (state === ConnectionState.Closed || state === ConnectionState.Disconnected) {
5401
- //@ts-expect-error
5402
5402
  this.client.dispatchEvent({
5403
5403
  type: 'connection.changed',
5404
5404
  online: false
@@ -6691,9 +6691,9 @@ var StreamChat = /*#__PURE__*/function () {
6691
6691
  /**
6692
6692
  * setGuestUser - Setup a temporary guest user
6693
6693
  *
6694
- * @param {UserResponse<UserType>} user Data about this user. IE {name: "john"}
6694
+ * @param {UserResponse<StreamChatGenerics>} user Data about this user. IE {name: "john"}
6695
6695
  *
6696
- * @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
6697
6697
  */
6698
6698
  function () {
6699
6699
  var _setGuestUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(user) {
@@ -6781,8 +6781,8 @@ var StreamChat = /*#__PURE__*/function () {
6781
6781
  * or
6782
6782
  * client.on(event => {console.log(event.type)})
6783
6783
  *
6784
- * @param {EventHandler<AttachmentType, ChannelType, CommandType, EventType, MessageType, ReactionType, UserType> | string} callbackOrString The event type to listen for (optional)
6785
- * @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
6786
6786
  *
6787
6787
  * @return {{ unsubscribe: () => void }} Description
6788
6788
  */
@@ -6999,6 +6999,13 @@ var StreamChat = /*#__PURE__*/function () {
6999
6999
  this.mutedUsers = event.me.mutes;
7000
7000
  }
7001
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
+
7002
7009
  if ((event.type === 'channel.deleted' || event.type === 'notification.channel_deleted') && event.cid) {
7003
7010
  var _this$activeChannels$;
7004
7011
 
@@ -7117,8 +7124,7 @@ var StreamChat = /*#__PURE__*/function () {
7117
7124
 
7118
7125
  this.logger('info', 'client:connect() - WS failed, fallback to longpoll', {
7119
7126
  tags: ['connection', 'client']
7120
- }); // @ts-expect-error
7121
-
7127
+ });
7122
7128
  this.dispatchEvent({
7123
7129
  type: 'transport.changed',
7124
7130
  mode: 'longpoll'
@@ -7184,12 +7190,12 @@ var StreamChat = /*#__PURE__*/function () {
7184
7190
  /**
7185
7191
  * queryUsers - Query users and watch user presence
7186
7192
  *
7187
- * @param {UserFilters<UserType>} filterConditions MongoDB style filter conditions
7188
- * @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}].
7189
7195
  * When using multiple fields, make sure you use array of objects to guarantee field order, for instance [{last_active: -1}, {created_at: 1}]
7190
7196
  * @param {UserOptions} options Option object, {presence: true}
7191
7197
  *
7192
- * @return {Promise<APIResponse & { users: Array<UserResponse<UserType>> }>} User Query Response
7198
+ * @return {Promise<{ users: Array<UserResponse<StreamChatGenerics>> }>} User Query Response
7193
7199
  */
7194
7200
 
7195
7201
  }, {
@@ -7254,7 +7260,7 @@ var StreamChat = /*#__PURE__*/function () {
7254
7260
  * @param {BannedUsersSort} sort Sort options [{created_at: 1}].
7255
7261
  * @param {BannedUsersPaginationOptions} options Option object, {limit: 10, offset:0}
7256
7262
  *
7257
- * @return {Promise<BannedUsersResponse<ChannelType, CommandType, UserType>>} Ban Query Response
7263
+ * @return {Promise<BannedUsersResponse<StreamChatGenerics>>} Ban Query Response
7258
7264
  */
7259
7265
 
7260
7266
  }, {
@@ -7303,7 +7309,7 @@ var StreamChat = /*#__PURE__*/function () {
7303
7309
  * @param {MessageFlagsFilters} filterConditions MongoDB style filter conditions
7304
7310
  * @param {MessageFlagsPaginationOptions} options Option object, {limit: 10, offset:0}
7305
7311
  *
7306
- * @return {Promise<MessageFlagsResponse<ChannelType, CommandType, UserType>>} Message Flags Response
7312
+ * @return {Promise<MessageFlagsResponse<StreamChatGenerics>>} Message Flags Response
7307
7313
  */
7308
7314
 
7309
7315
  }, {
@@ -7346,14 +7352,14 @@ var StreamChat = /*#__PURE__*/function () {
7346
7352
  /**
7347
7353
  * queryChannels - Query channels
7348
7354
  *
7349
- * @param {ChannelFilters<ChannelType, CommandType, UserType>} filterConditions object MongoDB style filters
7350
- * @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}.
7351
7357
  * When using multiple fields, make sure you use array of objects to guarantee field order, for instance [{last_updated: -1}, {created_at: 1}]
7352
7358
  * @param {ChannelOptions} [options] Options object
7353
7359
  * @param {ChannelStateOptions} [stateOptions] State options object. These options will only be used for state management and won't be sent in the request.
7354
7360
  * - stateOptions.skipInitialization - Skips the initialization of the state for the channels matching the ids in the list.
7355
7361
  *
7356
- * @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
7357
7363
  */
7358
7364
 
7359
7365
  }, {
@@ -7469,11 +7475,11 @@ var StreamChat = /*#__PURE__*/function () {
7469
7475
  /**
7470
7476
  * search - Query messages
7471
7477
  *
7472
- * @param {ChannelFilters<ChannelType, CommandType, UserType>} filterConditions MongoDB style filter conditions
7473
- * @param {MessageFilters<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType> | string} query search query or object MongoDB style filters
7474
- * @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'}
7475
7481
  *
7476
- * @return {Promise<SearchAPIResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>>} search messages response
7482
+ * @return {Promise<SearchAPIResponse<StreamChatGenerics>>} search messages response
7477
7483
  */
7478
7484
 
7479
7485
  }, {
@@ -7617,7 +7623,7 @@ var StreamChat = /*#__PURE__*/function () {
7617
7623
  *
7618
7624
  * @param {string} [userID] User ID. Only works on serverside
7619
7625
  *
7620
- * @return {APIResponse & Device<UserType>[]} Array of devices
7626
+ * @return {Device<StreamChatGenerics>[]} Array of devices
7621
7627
  */
7622
7628
 
7623
7629
  }, {
@@ -7745,7 +7751,7 @@ var StreamChat = /*#__PURE__*/function () {
7745
7751
  * await channel.create() to assign an ID to channel
7746
7752
  *
7747
7753
  * @param {string} channelType The channel type
7748
- * @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
7749
7755
  * @param {object} [custom] Custom data to attach to the channel
7750
7756
  *
7751
7757
  * @return {channel} The channel object, initialize it using channel.watch()
@@ -7801,10 +7807,10 @@ var StreamChat = /*#__PURE__*/function () {
7801
7807
  /**
7802
7808
  * partialUpdateUser - Update the given user object
7803
7809
  *
7804
- * @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;
7805
7811
  * example: {id: "user1", set:{field: value}, unset:["field2"]}
7806
7812
  *
7807
- * @return {Promise<APIResponse & { users: { [key: string]: UserResponse<UserType> } }>} list of updated users
7813
+ * @return {Promise<{ users: { [key: string]: UserResponse<StreamChatGenerics> } }>} list of updated users
7808
7814
  */
7809
7815
  function () {
7810
7816
  var _partialUpdateUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee25(partialUserObject) {
@@ -7835,9 +7841,9 @@ var StreamChat = /*#__PURE__*/function () {
7835
7841
  /**
7836
7842
  * upsertUsers - Batch upsert the list of users
7837
7843
  *
7838
- * @param {UserResponse<UserType>[]} users list of users
7844
+ * @param {UserResponse<StreamChatGenerics>[]} users list of users
7839
7845
  *
7840
- * @return {Promise<APIResponse & { users: { [key: string]: UserResponse<UserType> } }>}
7846
+ * @return {Promise<{ users: { [key: string]: UserResponse<StreamChatGenerics> } }>}
7841
7847
  */
7842
7848
 
7843
7849
  }, {
@@ -7923,8 +7929,8 @@ var StreamChat = /*#__PURE__*/function () {
7923
7929
  *
7924
7930
  * updateUsers - Batch update the list of users
7925
7931
  *
7926
- * @param {UserResponse<UserType>[]} users list of users
7927
- * @return {Promise<APIResponse & { users: { [key: string]: UserResponse<UserType> } }>}
7932
+ * @param {UserResponse<StreamChatGenerics>[]} users list of users
7933
+ * @return {Promise<{ users: { [key: string]: UserResponse<StreamChatGenerics> } }>}
7928
7934
  */
7929
7935
 
7930
7936
  }, {
@@ -7933,9 +7939,9 @@ var StreamChat = /*#__PURE__*/function () {
7933
7939
  /**
7934
7940
  * upsertUser - Update or Create the given user object
7935
7941
  *
7936
- * @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
7937
7943
  *
7938
- * @return {Promise<APIResponse & { users: { [key: string]: UserResponse<UserType> } }>}
7944
+ * @return {Promise<{ users: { [key: string]: UserResponse<StreamChatGenerics> } }>}
7939
7945
  */
7940
7946
  function upsertUser(userObject) {
7941
7947
  return this.upsertUsers([userObject]);
@@ -7945,8 +7951,8 @@ var StreamChat = /*#__PURE__*/function () {
7945
7951
  *
7946
7952
  * updateUser - Update or Create the given user object
7947
7953
  *
7948
- * @param {UserResponse<UserType>} userObject user object, the only required field is the user id. IE {id: "myuser"} is valid
7949
- * @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> } }>}
7950
7956
  */
7951
7957
 
7952
7958
  }, {
@@ -7955,9 +7961,9 @@ var StreamChat = /*#__PURE__*/function () {
7955
7961
  /**
7956
7962
  * partialUpdateUsers - Batch partial update of users
7957
7963
  *
7958
- * @param {PartialUserUpdate<UserType>[]} users list of partial update requests
7964
+ * @param {PartialUserUpdate<StreamChatGenerics>[]} users list of partial update requests
7959
7965
  *
7960
- * @return {Promise<APIResponse & { users: { [key: string]: UserResponse<UserType> } }>}
7966
+ * @return {Promise<{ users: { [key: string]: UserResponse<StreamChatGenerics> } }>}
7961
7967
  */
7962
7968
  function () {
7963
7969
  var _partialUpdateUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee27(users) {
@@ -8146,7 +8152,7 @@ var StreamChat = /*#__PURE__*/function () {
8146
8152
  /** banUser - bans a user from all channels
8147
8153
  *
8148
8154
  * @param {string} targetUserID
8149
- * @param {BanUserOptions<UserType>} [options]
8155
+ * @param {BanUserOptions<StreamChatGenerics>} [options]
8150
8156
  * @returns {Promise<APIResponse>}
8151
8157
  */
8152
8158
 
@@ -8220,7 +8226,7 @@ var StreamChat = /*#__PURE__*/function () {
8220
8226
  /** shadowBan - shadow bans a user from all channels
8221
8227
  *
8222
8228
  * @param {string} targetUserID
8223
- * @param {BanUserOptions<UserType>} [options]
8229
+ * @param {BanUserOptions<StreamChatGenerics>} [options]
8224
8230
  * @returns {Promise<APIResponse>}
8225
8231
  */
8226
8232
 
@@ -8295,8 +8301,8 @@ var StreamChat = /*#__PURE__*/function () {
8295
8301
  *
8296
8302
  * @param {string} targetID
8297
8303
  * @param {string} [userID] Only used with serverside auth
8298
- * @param {MuteUserOptions<UserType>} [options]
8299
- * @returns {Promise<MuteUserResponse<ChannelType, CommandType, UserType>>}
8304
+ * @param {MuteUserOptions<StreamChatGenerics>} [options]
8305
+ * @returns {Promise<MuteUserResponse<StreamChatGenerics>>}
8300
8306
  */
8301
8307
 
8302
8308
  }, {
@@ -8553,23 +8559,23 @@ var StreamChat = /*#__PURE__*/function () {
8553
8559
  return unflagUser;
8554
8560
  }()
8555
8561
  /**
8556
- * _queryFlagReports - Query flag reports.
8562
+ * _queryFlags - Query flags.
8557
8563
  *
8558
8564
  * Note: Do not use this.
8559
8565
  * It is present for internal usage only.
8560
8566
  * This function can, and will, break and/or be removed at any point in time.
8561
8567
  *
8562
8568
  * @private
8563
- * @param {FlagReportsFilters} filterConditions MongoDB style filter conditions
8564
- * @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}
8565
8571
  *
8566
- * @return {Promise<FlagReportsResponse<ChannelType, CommandType, UserType>>} Flag Reports Response
8572
+ * @return {Promise<FlagsResponse<StreamChatGenerics>>} Flags Response
8567
8573
  */
8568
8574
 
8569
8575
  }, {
8570
- key: "_queryFlagReports",
8576
+ key: "_queryFlags",
8571
8577
  value: function () {
8572
- var _queryFlagReports2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee42() {
8578
+ var _queryFlags2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee42() {
8573
8579
  var filterConditions,
8574
8580
  options,
8575
8581
  _args42 = arguments;
@@ -8580,7 +8586,7 @@ var StreamChat = /*#__PURE__*/function () {
8580
8586
  filterConditions = _args42.length > 0 && _args42[0] !== undefined ? _args42[0] : {};
8581
8587
  options = _args42.length > 1 && _args42[1] !== undefined ? _args42[1] : {};
8582
8588
  _context42.next = 4;
8583
- return this.post(this.baseURL + '/moderation/reports', _objectSpread({
8589
+ return this.post(this.baseURL + '/moderation/flags', _objectSpread({
8584
8590
  filter_conditions: filterConditions
8585
8591
  }, options));
8586
8592
 
@@ -8595,6 +8601,55 @@ var StreamChat = /*#__PURE__*/function () {
8595
8601
  }, _callee42, this);
8596
8602
  }));
8597
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
+
8598
8653
  function _queryFlagReports() {
8599
8654
  return _queryFlagReports2.apply(this, arguments);
8600
8655
  }
@@ -8619,28 +8674,28 @@ var StreamChat = /*#__PURE__*/function () {
8619
8674
  }, {
8620
8675
  key: "_reviewFlagReport",
8621
8676
  value: function () {
8622
- var _reviewFlagReport2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee43(id, reviewResult) {
8677
+ var _reviewFlagReport2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee44(id, reviewResult) {
8623
8678
  var options,
8624
- _args43 = arguments;
8625
- return _regeneratorRuntime.wrap(function _callee43$(_context43) {
8679
+ _args44 = arguments;
8680
+ return _regeneratorRuntime.wrap(function _callee44$(_context44) {
8626
8681
  while (1) {
8627
- switch (_context43.prev = _context43.next) {
8682
+ switch (_context44.prev = _context44.next) {
8628
8683
  case 0:
8629
- options = _args43.length > 2 && _args43[2] !== undefined ? _args43[2] : {};
8630
- _context43.next = 3;
8684
+ options = _args44.length > 2 && _args44[2] !== undefined ? _args44[2] : {};
8685
+ _context44.next = 3;
8631
8686
  return this.patch(this.baseURL + "/moderation/reports/".concat(id), _objectSpread({
8632
8687
  review_result: reviewResult
8633
8688
  }, options));
8634
8689
 
8635
8690
  case 3:
8636
- return _context43.abrupt("return", _context43.sent);
8691
+ return _context44.abrupt("return", _context44.sent);
8637
8692
 
8638
8693
  case 4:
8639
8694
  case "end":
8640
- return _context43.stop();
8695
+ return _context44.stop();
8641
8696
  }
8642
8697
  }
8643
- }, _callee43, this);
8698
+ }, _callee44, this);
8644
8699
  }));
8645
8700
 
8646
8701
  function _reviewFlagReport(_x54, _x55) {
@@ -8665,28 +8720,28 @@ var StreamChat = /*#__PURE__*/function () {
8665
8720
  }, {
8666
8721
  key: "_unblockMessage",
8667
8722
  value: function () {
8668
- var _unblockMessage2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee44(targetMessageID) {
8723
+ var _unblockMessage2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee45(targetMessageID) {
8669
8724
  var options,
8670
- _args44 = arguments;
8671
- return _regeneratorRuntime.wrap(function _callee44$(_context44) {
8725
+ _args45 = arguments;
8726
+ return _regeneratorRuntime.wrap(function _callee45$(_context45) {
8672
8727
  while (1) {
8673
- switch (_context44.prev = _context44.next) {
8728
+ switch (_context45.prev = _context45.next) {
8674
8729
  case 0:
8675
- options = _args44.length > 1 && _args44[1] !== undefined ? _args44[1] : {};
8676
- _context44.next = 3;
8730
+ options = _args45.length > 1 && _args45[1] !== undefined ? _args45[1] : {};
8731
+ _context45.next = 3;
8677
8732
  return this.post(this.baseURL + '/moderation/unblock_message', _objectSpread({
8678
8733
  target_message_id: targetMessageID
8679
8734
  }, options));
8680
8735
 
8681
8736
  case 3:
8682
- return _context44.abrupt("return", _context44.sent);
8737
+ return _context45.abrupt("return", _context45.sent);
8683
8738
 
8684
8739
  case 4:
8685
8740
  case "end":
8686
- return _context44.stop();
8741
+ return _context45.stop();
8687
8742
  }
8688
8743
  }
8689
- }, _callee44, this);
8744
+ }, _callee45, this);
8690
8745
  }));
8691
8746
 
8692
8747
  function _unblockMessage(_x56) {
@@ -8699,7 +8754,7 @@ var StreamChat = /*#__PURE__*/function () {
8699
8754
  * @deprecated use markChannelsRead instead
8700
8755
  *
8701
8756
  * markAllRead - marks all channels for this user as read
8702
- * @param {MarkAllReadOptions<UserType>} [data]
8757
+ * @param {MarkAllReadOptions<StreamChatGenerics>} [data]
8703
8758
  *
8704
8759
  * @return {Promise<APIResponse>}
8705
8760
  */
@@ -8711,28 +8766,28 @@ var StreamChat = /*#__PURE__*/function () {
8711
8766
  * markChannelsRead - marks channels read -
8712
8767
  * it accepts a map of cid:messageid pairs, if messageid is empty, the whole channel will be marked as read
8713
8768
  *
8714
- * @param {MarkChannelsReadOptions <UserType>} [data]
8769
+ * @param {MarkChannelsReadOptions <StreamChatGenerics>} [data]
8715
8770
  *
8716
8771
  * @return {Promise<APIResponse>}
8717
8772
  */
8718
8773
  function () {
8719
- var _markChannelsRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee45() {
8774
+ var _markChannelsRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee46() {
8720
8775
  var data,
8721
- _args45 = arguments;
8722
- return _regeneratorRuntime.wrap(function _callee45$(_context45) {
8776
+ _args46 = arguments;
8777
+ return _regeneratorRuntime.wrap(function _callee46$(_context46) {
8723
8778
  while (1) {
8724
- switch (_context45.prev = _context45.next) {
8779
+ switch (_context46.prev = _context46.next) {
8725
8780
  case 0:
8726
- data = _args45.length > 0 && _args45[0] !== undefined ? _args45[0] : {};
8727
- _context45.next = 3;
8781
+ data = _args46.length > 0 && _args46[0] !== undefined ? _args46[0] : {};
8782
+ _context46.next = 3;
8728
8783
  return this.post(this.baseURL + '/channels/read', _objectSpread({}, data));
8729
8784
 
8730
8785
  case 3:
8731
8786
  case "end":
8732
- return _context45.stop();
8787
+ return _context46.stop();
8733
8788
  }
8734
8789
  }
8735
- }, _callee45, this);
8790
+ }, _callee46, this);
8736
8791
  }));
8737
8792
 
8738
8793
  function markChannelsRead() {
@@ -8801,31 +8856,31 @@ var StreamChat = /*#__PURE__*/function () {
8801
8856
  * @param {string} messageId
8802
8857
  * @param {string} language
8803
8858
  *
8804
- * @return {APIResponse & MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>} Response that includes the message
8859
+ * @return {MessageResponse<StreamChatGenerics>} Response that includes the message
8805
8860
  */
8806
8861
 
8807
8862
  }, {
8808
8863
  key: "translateMessage",
8809
8864
  value: function () {
8810
- var _translateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee46(messageId, language) {
8811
- return _regeneratorRuntime.wrap(function _callee46$(_context46) {
8865
+ var _translateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee47(messageId, language) {
8866
+ return _regeneratorRuntime.wrap(function _callee47$(_context47) {
8812
8867
  while (1) {
8813
- switch (_context46.prev = _context46.next) {
8868
+ switch (_context47.prev = _context47.next) {
8814
8869
  case 0:
8815
- _context46.next = 2;
8870
+ _context47.next = 2;
8816
8871
  return this.post(this.baseURL + "/messages/".concat(messageId, "/translate"), {
8817
8872
  language: language
8818
8873
  });
8819
8874
 
8820
8875
  case 2:
8821
- return _context46.abrupt("return", _context46.sent);
8876
+ return _context47.abrupt("return", _context47.sent);
8822
8877
 
8823
8878
  case 3:
8824
8879
  case "end":
8825
- return _context46.stop();
8880
+ return _context47.stop();
8826
8881
  }
8827
8882
  }
8828
- }, _callee46, this);
8883
+ }, _callee47, this);
8829
8884
  }));
8830
8885
 
8831
8886
  function translateMessage(_x57, _x58) {
@@ -8920,24 +8975,24 @@ var StreamChat = /*#__PURE__*/function () {
8920
8975
  /**
8921
8976
  * updateMessage - Update the given message
8922
8977
  *
8923
- * @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
8924
8979
  * @param {string | { id: string }} [userId]
8925
8980
  * @param {boolean} [options.skip_enrich_url] Do not try to enrich the URLs within message
8926
8981
  *
8927
- * @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
8928
8983
  */
8929
8984
 
8930
8985
  }, {
8931
8986
  key: "updateMessage",
8932
8987
  value: function () {
8933
- var _updateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee47(message, userId, options) {
8988
+ var _updateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee48(message, userId, options) {
8934
8989
  var clonedMessage, reservedMessageFields;
8935
- return _regeneratorRuntime.wrap(function _callee47$(_context47) {
8990
+ return _regeneratorRuntime.wrap(function _callee48$(_context48) {
8936
8991
  while (1) {
8937
- switch (_context47.prev = _context47.next) {
8992
+ switch (_context48.prev = _context48.next) {
8938
8993
  case 0:
8939
8994
  if (message.id) {
8940
- _context47.next = 2;
8995
+ _context48.next = 2;
8941
8996
  break;
8942
8997
  }
8943
8998
 
@@ -8974,20 +9029,20 @@ var StreamChat = /*#__PURE__*/function () {
8974
9029
  });
8975
9030
  }
8976
9031
 
8977
- _context47.next = 10;
9032
+ _context48.next = 10;
8978
9033
  return this.post(this.baseURL + "/messages/".concat(message.id), _objectSpread({
8979
9034
  message: clonedMessage
8980
9035
  }, options));
8981
9036
 
8982
9037
  case 10:
8983
- return _context47.abrupt("return", _context47.sent);
9038
+ return _context48.abrupt("return", _context48.sent);
8984
9039
 
8985
9040
  case 11:
8986
9041
  case "end":
8987
- return _context47.stop();
9042
+ return _context48.stop();
8988
9043
  }
8989
9044
  }
8990
- }, _callee47, this);
9045
+ }, _callee48, this);
8991
9046
  }));
8992
9047
 
8993
9048
  function updateMessage(_x59, _x60, _x61) {
@@ -9001,26 +9056,26 @@ var StreamChat = /*#__PURE__*/function () {
9001
9056
  *
9002
9057
  * @param {string} id the message id
9003
9058
  *
9004
- * @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;
9005
9060
  * example: {id: "user1", set:{text: "hi"}, unset:["color"]}
9006
9061
  * @param {string | { id: string }} [userId]
9007
9062
  *
9008
9063
  * @param {boolean} [options.skip_enrich_url] Do not try to enrich the URLs within message
9009
9064
  *
9010
- * @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
9011
9066
  */
9012
9067
 
9013
9068
  }, {
9014
9069
  key: "partialUpdateMessage",
9015
9070
  value: function () {
9016
- 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) {
9017
9072
  var user;
9018
- return _regeneratorRuntime.wrap(function _callee48$(_context48) {
9073
+ return _regeneratorRuntime.wrap(function _callee49$(_context49) {
9019
9074
  while (1) {
9020
- switch (_context48.prev = _context48.next) {
9075
+ switch (_context49.prev = _context49.next) {
9021
9076
  case 0:
9022
9077
  if (id) {
9023
- _context48.next = 2;
9078
+ _context49.next = 2;
9024
9079
  break;
9025
9080
  }
9026
9081
 
@@ -9035,20 +9090,20 @@ var StreamChat = /*#__PURE__*/function () {
9035
9090
  };
9036
9091
  }
9037
9092
 
9038
- _context48.next = 6;
9093
+ _context49.next = 6;
9039
9094
  return this.put(this.baseURL + "/messages/".concat(id), _objectSpread(_objectSpread(_objectSpread({}, partialMessageObject), options), {}, {
9040
9095
  user: user
9041
9096
  }));
9042
9097
 
9043
9098
  case 6:
9044
- return _context48.abrupt("return", _context48.sent);
9099
+ return _context49.abrupt("return", _context49.sent);
9045
9100
 
9046
9101
  case 7:
9047
9102
  case "end":
9048
- return _context48.stop();
9103
+ return _context49.stop();
9049
9104
  }
9050
9105
  }
9051
- }, _callee48, this);
9106
+ }, _callee49, this);
9052
9107
  }));
9053
9108
 
9054
9109
  function partialUpdateMessage(_x62, _x63, _x64, _x65) {
@@ -9060,11 +9115,11 @@ var StreamChat = /*#__PURE__*/function () {
9060
9115
  }, {
9061
9116
  key: "deleteMessage",
9062
9117
  value: function () {
9063
- var _deleteMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee49(messageID, hardDelete) {
9118
+ var _deleteMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee50(messageID, hardDelete) {
9064
9119
  var params;
9065
- return _regeneratorRuntime.wrap(function _callee49$(_context49) {
9120
+ return _regeneratorRuntime.wrap(function _callee50$(_context50) {
9066
9121
  while (1) {
9067
- switch (_context49.prev = _context49.next) {
9122
+ switch (_context50.prev = _context50.next) {
9068
9123
  case 0:
9069
9124
  params = {};
9070
9125
 
@@ -9074,18 +9129,18 @@ var StreamChat = /*#__PURE__*/function () {
9074
9129
  };
9075
9130
  }
9076
9131
 
9077
- _context49.next = 4;
9132
+ _context50.next = 4;
9078
9133
  return this.delete(this.baseURL + "/messages/".concat(messageID), params);
9079
9134
 
9080
9135
  case 4:
9081
- return _context49.abrupt("return", _context49.sent);
9136
+ return _context50.abrupt("return", _context50.sent);
9082
9137
 
9083
9138
  case 5:
9084
9139
  case "end":
9085
- return _context49.stop();
9140
+ return _context50.stop();
9086
9141
  }
9087
9142
  }
9088
- }, _callee49, this);
9143
+ }, _callee50, this);
9089
9144
  }));
9090
9145
 
9091
9146
  function deleteMessage(_x66, _x67) {
@@ -9097,23 +9152,23 @@ var StreamChat = /*#__PURE__*/function () {
9097
9152
  }, {
9098
9153
  key: "getMessage",
9099
9154
  value: function () {
9100
- var _getMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee50(messageID) {
9101
- return _regeneratorRuntime.wrap(function _callee50$(_context50) {
9155
+ var _getMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee51(messageID) {
9156
+ return _regeneratorRuntime.wrap(function _callee51$(_context51) {
9102
9157
  while (1) {
9103
- switch (_context50.prev = _context50.next) {
9158
+ switch (_context51.prev = _context51.next) {
9104
9159
  case 0:
9105
- _context50.next = 2;
9160
+ _context51.next = 2;
9106
9161
  return this.get(this.baseURL + "/messages/".concat(messageID));
9107
9162
 
9108
9163
  case 2:
9109
- return _context50.abrupt("return", _context50.sent);
9164
+ return _context51.abrupt("return", _context51.sent);
9110
9165
 
9111
9166
  case 3:
9112
9167
  case "end":
9113
- return _context50.stop();
9168
+ return _context51.stop();
9114
9169
  }
9115
9170
  }
9116
- }, _callee50, this);
9171
+ }, _callee51, this);
9117
9172
  }));
9118
9173
 
9119
9174
  function getMessage(_x68) {
@@ -9125,7 +9180,7 @@ var StreamChat = /*#__PURE__*/function () {
9125
9180
  }, {
9126
9181
  key: "getUserAgent",
9127
9182
  value: function getUserAgent() {
9128
- return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "5.6.0");
9183
+ return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "6.2.0");
9129
9184
  }
9130
9185
  }, {
9131
9186
  key: "setUserAgent",
@@ -9320,25 +9375,25 @@ var StreamChat = /*#__PURE__*/function () {
9320
9375
  }, {
9321
9376
  key: "sendUserCustomEvent",
9322
9377
  value: function () {
9323
- var _sendUserCustomEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee51(targetUserID, event) {
9324
- return _regeneratorRuntime.wrap(function _callee51$(_context51) {
9378
+ var _sendUserCustomEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee52(targetUserID, event) {
9379
+ return _regeneratorRuntime.wrap(function _callee52$(_context52) {
9325
9380
  while (1) {
9326
- switch (_context51.prev = _context51.next) {
9381
+ switch (_context52.prev = _context52.next) {
9327
9382
  case 0:
9328
- _context51.next = 2;
9383
+ _context52.next = 2;
9329
9384
  return this.post("".concat(this.baseURL, "/users/").concat(targetUserID, "/event"), {
9330
9385
  event: event
9331
9386
  });
9332
9387
 
9333
9388
  case 2:
9334
- return _context51.abrupt("return", _context51.sent);
9389
+ return _context52.abrupt("return", _context52.sent);
9335
9390
 
9336
9391
  case 3:
9337
9392
  case "end":
9338
- return _context51.stop();
9393
+ return _context52.stop();
9339
9394
  }
9340
9395
  }
9341
- }, _callee51, this);
9396
+ }, _callee52, this);
9342
9397
  }));
9343
9398
 
9344
9399
  function sendUserCustomEvent(_x69, _x70) {
@@ -9409,29 +9464,29 @@ var StreamChat = /*#__PURE__*/function () {
9409
9464
  }, {
9410
9465
  key: "createSegment",
9411
9466
  value: function () {
9412
- var _createSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee52(params) {
9467
+ var _createSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee53(params) {
9413
9468
  var _yield$this$post, segment;
9414
9469
 
9415
- return _regeneratorRuntime.wrap(function _callee52$(_context52) {
9470
+ return _regeneratorRuntime.wrap(function _callee53$(_context53) {
9416
9471
  while (1) {
9417
- switch (_context52.prev = _context52.next) {
9472
+ switch (_context53.prev = _context53.next) {
9418
9473
  case 0:
9419
- _context52.next = 2;
9474
+ _context53.next = 2;
9420
9475
  return this.post(this.baseURL + "/segments", {
9421
9476
  segment: params
9422
9477
  });
9423
9478
 
9424
9479
  case 2:
9425
- _yield$this$post = _context52.sent;
9480
+ _yield$this$post = _context53.sent;
9426
9481
  segment = _yield$this$post.segment;
9427
- return _context52.abrupt("return", segment);
9482
+ return _context53.abrupt("return", segment);
9428
9483
 
9429
9484
  case 5:
9430
9485
  case "end":
9431
- return _context52.stop();
9486
+ return _context53.stop();
9432
9487
  }
9433
9488
  }
9434
- }, _callee52, this);
9489
+ }, _callee53, this);
9435
9490
  }));
9436
9491
 
9437
9492
  function createSegment(_x71) {
@@ -9451,27 +9506,27 @@ var StreamChat = /*#__PURE__*/function () {
9451
9506
  }, {
9452
9507
  key: "getSegment",
9453
9508
  value: function () {
9454
- var _getSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee53(id) {
9509
+ var _getSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee54(id) {
9455
9510
  var _yield$this$get, segment;
9456
9511
 
9457
- return _regeneratorRuntime.wrap(function _callee53$(_context53) {
9512
+ return _regeneratorRuntime.wrap(function _callee54$(_context54) {
9458
9513
  while (1) {
9459
- switch (_context53.prev = _context53.next) {
9514
+ switch (_context54.prev = _context54.next) {
9460
9515
  case 0:
9461
- _context53.next = 2;
9516
+ _context54.next = 2;
9462
9517
  return this.get(this.baseURL + "/segments/".concat(id));
9463
9518
 
9464
9519
  case 2:
9465
- _yield$this$get = _context53.sent;
9520
+ _yield$this$get = _context54.sent;
9466
9521
  segment = _yield$this$get.segment;
9467
- return _context53.abrupt("return", segment);
9522
+ return _context54.abrupt("return", segment);
9468
9523
 
9469
9524
  case 5:
9470
9525
  case "end":
9471
- return _context53.stop();
9526
+ return _context54.stop();
9472
9527
  }
9473
9528
  }
9474
- }, _callee53, this);
9529
+ }, _callee54, this);
9475
9530
  }));
9476
9531
 
9477
9532
  function getSegment(_x72) {
@@ -9490,27 +9545,27 @@ var StreamChat = /*#__PURE__*/function () {
9490
9545
  }, {
9491
9546
  key: "listSegments",
9492
9547
  value: function () {
9493
- var _listSegments = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee54(options) {
9548
+ var _listSegments = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee55(options) {
9494
9549
  var _yield$this$get2, segments;
9495
9550
 
9496
- return _regeneratorRuntime.wrap(function _callee54$(_context54) {
9551
+ return _regeneratorRuntime.wrap(function _callee55$(_context55) {
9497
9552
  while (1) {
9498
- switch (_context54.prev = _context54.next) {
9553
+ switch (_context55.prev = _context55.next) {
9499
9554
  case 0:
9500
- _context54.next = 2;
9555
+ _context55.next = 2;
9501
9556
  return this.get(this.baseURL + "/segments", options);
9502
9557
 
9503
9558
  case 2:
9504
- _yield$this$get2 = _context54.sent;
9559
+ _yield$this$get2 = _context55.sent;
9505
9560
  segments = _yield$this$get2.segments;
9506
- return _context54.abrupt("return", segments);
9561
+ return _context55.abrupt("return", segments);
9507
9562
 
9508
9563
  case 5:
9509
9564
  case "end":
9510
- return _context54.stop();
9565
+ return _context55.stop();
9511
9566
  }
9512
9567
  }
9513
- }, _callee54, this);
9568
+ }, _callee55, this);
9514
9569
  }));
9515
9570
 
9516
9571
  function listSegments(_x73) {
@@ -9531,29 +9586,29 @@ var StreamChat = /*#__PURE__*/function () {
9531
9586
  }, {
9532
9587
  key: "updateSegment",
9533
9588
  value: function () {
9534
- var _updateSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee55(id, params) {
9589
+ var _updateSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee56(id, params) {
9535
9590
  var _yield$this$put, segment;
9536
9591
 
9537
- return _regeneratorRuntime.wrap(function _callee55$(_context55) {
9592
+ return _regeneratorRuntime.wrap(function _callee56$(_context56) {
9538
9593
  while (1) {
9539
- switch (_context55.prev = _context55.next) {
9594
+ switch (_context56.prev = _context56.next) {
9540
9595
  case 0:
9541
- _context55.next = 2;
9596
+ _context56.next = 2;
9542
9597
  return this.put(this.baseURL + "/segments/".concat(id), {
9543
9598
  segment: params
9544
9599
  });
9545
9600
 
9546
9601
  case 2:
9547
- _yield$this$put = _context55.sent;
9602
+ _yield$this$put = _context56.sent;
9548
9603
  segment = _yield$this$put.segment;
9549
- return _context55.abrupt("return", segment);
9604
+ return _context56.abrupt("return", segment);
9550
9605
 
9551
9606
  case 5:
9552
9607
  case "end":
9553
- return _context55.stop();
9608
+ return _context56.stop();
9554
9609
  }
9555
9610
  }
9556
- }, _callee55, this);
9611
+ }, _callee56, this);
9557
9612
  }));
9558
9613
 
9559
9614
  function updateSegment(_x74, _x75) {
@@ -9573,19 +9628,19 @@ var StreamChat = /*#__PURE__*/function () {
9573
9628
  }, {
9574
9629
  key: "deleteSegment",
9575
9630
  value: function () {
9576
- var _deleteSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee56(id) {
9577
- return _regeneratorRuntime.wrap(function _callee56$(_context56) {
9631
+ var _deleteSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee57(id) {
9632
+ return _regeneratorRuntime.wrap(function _callee57$(_context57) {
9578
9633
  while (1) {
9579
- switch (_context56.prev = _context56.next) {
9634
+ switch (_context57.prev = _context57.next) {
9580
9635
  case 0:
9581
- return _context56.abrupt("return", this.delete(this.baseURL + "/segments/".concat(id)));
9636
+ return _context57.abrupt("return", this.delete(this.baseURL + "/segments/".concat(id)));
9582
9637
 
9583
9638
  case 1:
9584
9639
  case "end":
9585
- return _context56.stop();
9640
+ return _context57.stop();
9586
9641
  }
9587
9642
  }
9588
- }, _callee56, this);
9643
+ }, _callee57, this);
9589
9644
  }));
9590
9645
 
9591
9646
  function deleteSegment(_x76) {
@@ -9605,29 +9660,29 @@ var StreamChat = /*#__PURE__*/function () {
9605
9660
  }, {
9606
9661
  key: "createCampaign",
9607
9662
  value: function () {
9608
- var _createCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee57(params) {
9663
+ var _createCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee58(params) {
9609
9664
  var _yield$this$post2, campaign;
9610
9665
 
9611
- return _regeneratorRuntime.wrap(function _callee57$(_context57) {
9666
+ return _regeneratorRuntime.wrap(function _callee58$(_context58) {
9612
9667
  while (1) {
9613
- switch (_context57.prev = _context57.next) {
9668
+ switch (_context58.prev = _context58.next) {
9614
9669
  case 0:
9615
- _context57.next = 2;
9670
+ _context58.next = 2;
9616
9671
  return this.post(this.baseURL + "/campaigns", {
9617
9672
  campaign: params
9618
9673
  });
9619
9674
 
9620
9675
  case 2:
9621
- _yield$this$post2 = _context57.sent;
9676
+ _yield$this$post2 = _context58.sent;
9622
9677
  campaign = _yield$this$post2.campaign;
9623
- return _context57.abrupt("return", campaign);
9678
+ return _context58.abrupt("return", campaign);
9624
9679
 
9625
9680
  case 5:
9626
9681
  case "end":
9627
- return _context57.stop();
9682
+ return _context58.stop();
9628
9683
  }
9629
9684
  }
9630
- }, _callee57, this);
9685
+ }, _callee58, this);
9631
9686
  }));
9632
9687
 
9633
9688
  function createCampaign(_x77) {
@@ -9647,27 +9702,27 @@ var StreamChat = /*#__PURE__*/function () {
9647
9702
  }, {
9648
9703
  key: "getCampaign",
9649
9704
  value: function () {
9650
- var _getCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee58(id) {
9705
+ var _getCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee59(id) {
9651
9706
  var _yield$this$get3, campaign;
9652
9707
 
9653
- return _regeneratorRuntime.wrap(function _callee58$(_context58) {
9708
+ return _regeneratorRuntime.wrap(function _callee59$(_context59) {
9654
9709
  while (1) {
9655
- switch (_context58.prev = _context58.next) {
9710
+ switch (_context59.prev = _context59.next) {
9656
9711
  case 0:
9657
- _context58.next = 2;
9712
+ _context59.next = 2;
9658
9713
  return this.get(this.baseURL + "/campaigns/".concat(id));
9659
9714
 
9660
9715
  case 2:
9661
- _yield$this$get3 = _context58.sent;
9716
+ _yield$this$get3 = _context59.sent;
9662
9717
  campaign = _yield$this$get3.campaign;
9663
- return _context58.abrupt("return", campaign);
9718
+ return _context59.abrupt("return", campaign);
9664
9719
 
9665
9720
  case 5:
9666
9721
  case "end":
9667
- return _context58.stop();
9722
+ return _context59.stop();
9668
9723
  }
9669
9724
  }
9670
- }, _callee58, this);
9725
+ }, _callee59, this);
9671
9726
  }));
9672
9727
 
9673
9728
  function getCampaign(_x78) {
@@ -9686,27 +9741,27 @@ var StreamChat = /*#__PURE__*/function () {
9686
9741
  }, {
9687
9742
  key: "listCampaigns",
9688
9743
  value: function () {
9689
- var _listCampaigns = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee59(options) {
9744
+ var _listCampaigns = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee60(options) {
9690
9745
  var _yield$this$get4, campaigns;
9691
9746
 
9692
- return _regeneratorRuntime.wrap(function _callee59$(_context59) {
9747
+ return _regeneratorRuntime.wrap(function _callee60$(_context60) {
9693
9748
  while (1) {
9694
- switch (_context59.prev = _context59.next) {
9749
+ switch (_context60.prev = _context60.next) {
9695
9750
  case 0:
9696
- _context59.next = 2;
9751
+ _context60.next = 2;
9697
9752
  return this.get(this.baseURL + "/campaigns", options);
9698
9753
 
9699
9754
  case 2:
9700
- _yield$this$get4 = _context59.sent;
9755
+ _yield$this$get4 = _context60.sent;
9701
9756
  campaigns = _yield$this$get4.campaigns;
9702
- return _context59.abrupt("return", campaigns);
9757
+ return _context60.abrupt("return", campaigns);
9703
9758
 
9704
9759
  case 5:
9705
9760
  case "end":
9706
- return _context59.stop();
9761
+ return _context60.stop();
9707
9762
  }
9708
9763
  }
9709
- }, _callee59, this);
9764
+ }, _callee60, this);
9710
9765
  }));
9711
9766
 
9712
9767
  function listCampaigns(_x79) {
@@ -9727,29 +9782,29 @@ var StreamChat = /*#__PURE__*/function () {
9727
9782
  }, {
9728
9783
  key: "updateCampaign",
9729
9784
  value: function () {
9730
- var _updateCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee60(id, params) {
9785
+ var _updateCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee61(id, params) {
9731
9786
  var _yield$this$put2, campaign;
9732
9787
 
9733
- return _regeneratorRuntime.wrap(function _callee60$(_context60) {
9788
+ return _regeneratorRuntime.wrap(function _callee61$(_context61) {
9734
9789
  while (1) {
9735
- switch (_context60.prev = _context60.next) {
9790
+ switch (_context61.prev = _context61.next) {
9736
9791
  case 0:
9737
- _context60.next = 2;
9792
+ _context61.next = 2;
9738
9793
  return this.put(this.baseURL + "/campaigns/".concat(id), {
9739
9794
  campaign: params
9740
9795
  });
9741
9796
 
9742
9797
  case 2:
9743
- _yield$this$put2 = _context60.sent;
9798
+ _yield$this$put2 = _context61.sent;
9744
9799
  campaign = _yield$this$put2.campaign;
9745
- return _context60.abrupt("return", campaign);
9800
+ return _context61.abrupt("return", campaign);
9746
9801
 
9747
9802
  case 5:
9748
9803
  case "end":
9749
- return _context60.stop();
9804
+ return _context61.stop();
9750
9805
  }
9751
9806
  }
9752
- }, _callee60, this);
9807
+ }, _callee61, this);
9753
9808
  }));
9754
9809
 
9755
9810
  function updateCampaign(_x80, _x81) {
@@ -9769,19 +9824,19 @@ var StreamChat = /*#__PURE__*/function () {
9769
9824
  }, {
9770
9825
  key: "deleteCampaign",
9771
9826
  value: function () {
9772
- var _deleteCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee61(id) {
9773
- return _regeneratorRuntime.wrap(function _callee61$(_context61) {
9827
+ var _deleteCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee62(id) {
9828
+ return _regeneratorRuntime.wrap(function _callee62$(_context62) {
9774
9829
  while (1) {
9775
- switch (_context61.prev = _context61.next) {
9830
+ switch (_context62.prev = _context62.next) {
9776
9831
  case 0:
9777
- return _context61.abrupt("return", this.delete(this.baseURL + "/campaigns/".concat(id)));
9832
+ return _context62.abrupt("return", this.delete(this.baseURL + "/campaigns/".concat(id)));
9778
9833
 
9779
9834
  case 1:
9780
9835
  case "end":
9781
- return _context61.stop();
9836
+ return _context62.stop();
9782
9837
  }
9783
9838
  }
9784
- }, _callee61, this);
9839
+ }, _callee62, this);
9785
9840
  }));
9786
9841
 
9787
9842
  function deleteCampaign(_x82) {
@@ -9802,30 +9857,30 @@ var StreamChat = /*#__PURE__*/function () {
9802
9857
  }, {
9803
9858
  key: "scheduleCampaign",
9804
9859
  value: function () {
9805
- var _scheduleCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee62(id, params) {
9860
+ var _scheduleCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee63(id, params) {
9806
9861
  var sendAt, _yield$this$patch, campaign;
9807
9862
 
9808
- return _regeneratorRuntime.wrap(function _callee62$(_context62) {
9863
+ return _regeneratorRuntime.wrap(function _callee63$(_context63) {
9809
9864
  while (1) {
9810
- switch (_context62.prev = _context62.next) {
9865
+ switch (_context63.prev = _context63.next) {
9811
9866
  case 0:
9812
9867
  sendAt = params.sendAt;
9813
- _context62.next = 3;
9868
+ _context63.next = 3;
9814
9869
  return this.patch(this.baseURL + "/campaigns/".concat(id, "/schedule"), {
9815
9870
  send_at: sendAt
9816
9871
  });
9817
9872
 
9818
9873
  case 3:
9819
- _yield$this$patch = _context62.sent;
9874
+ _yield$this$patch = _context63.sent;
9820
9875
  campaign = _yield$this$patch.campaign;
9821
- return _context62.abrupt("return", campaign);
9876
+ return _context63.abrupt("return", campaign);
9822
9877
 
9823
9878
  case 6:
9824
9879
  case "end":
9825
- return _context62.stop();
9880
+ return _context63.stop();
9826
9881
  }
9827
9882
  }
9828
- }, _callee62, this);
9883
+ }, _callee63, this);
9829
9884
  }));
9830
9885
 
9831
9886
  function scheduleCampaign(_x83, _x84) {
@@ -9845,27 +9900,27 @@ var StreamChat = /*#__PURE__*/function () {
9845
9900
  }, {
9846
9901
  key: "stopCampaign",
9847
9902
  value: function () {
9848
- var _stopCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee63(id) {
9903
+ var _stopCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee64(id) {
9849
9904
  var _yield$this$patch2, campaign;
9850
9905
 
9851
- return _regeneratorRuntime.wrap(function _callee63$(_context63) {
9906
+ return _regeneratorRuntime.wrap(function _callee64$(_context64) {
9852
9907
  while (1) {
9853
- switch (_context63.prev = _context63.next) {
9908
+ switch (_context64.prev = _context64.next) {
9854
9909
  case 0:
9855
- _context63.next = 2;
9910
+ _context64.next = 2;
9856
9911
  return this.patch(this.baseURL + "/campaigns/".concat(id, "/stop"));
9857
9912
 
9858
9913
  case 2:
9859
- _yield$this$patch2 = _context63.sent;
9914
+ _yield$this$patch2 = _context64.sent;
9860
9915
  campaign = _yield$this$patch2.campaign;
9861
- return _context63.abrupt("return", campaign);
9916
+ return _context64.abrupt("return", campaign);
9862
9917
 
9863
9918
  case 5:
9864
9919
  case "end":
9865
- return _context63.stop();
9920
+ return _context64.stop();
9866
9921
  }
9867
9922
  }
9868
- }, _callee63, this);
9923
+ }, _callee64, this);
9869
9924
  }));
9870
9925
 
9871
9926
  function stopCampaign(_x85) {
@@ -9885,27 +9940,27 @@ var StreamChat = /*#__PURE__*/function () {
9885
9940
  }, {
9886
9941
  key: "resumeCampaign",
9887
9942
  value: function () {
9888
- var _resumeCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee64(id) {
9943
+ var _resumeCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee65(id) {
9889
9944
  var _yield$this$patch3, campaign;
9890
9945
 
9891
- return _regeneratorRuntime.wrap(function _callee64$(_context64) {
9946
+ return _regeneratorRuntime.wrap(function _callee65$(_context65) {
9892
9947
  while (1) {
9893
- switch (_context64.prev = _context64.next) {
9948
+ switch (_context65.prev = _context65.next) {
9894
9949
  case 0:
9895
- _context64.next = 2;
9950
+ _context65.next = 2;
9896
9951
  return this.patch(this.baseURL + "/campaigns/".concat(id, "/resume"));
9897
9952
 
9898
9953
  case 2:
9899
- _yield$this$patch3 = _context64.sent;
9954
+ _yield$this$patch3 = _context65.sent;
9900
9955
  campaign = _yield$this$patch3.campaign;
9901
- return _context64.abrupt("return", campaign);
9956
+ return _context65.abrupt("return", campaign);
9902
9957
 
9903
9958
  case 5:
9904
9959
  case "end":
9905
- return _context64.stop();
9960
+ return _context65.stop();
9906
9961
  }
9907
9962
  }
9908
- }, _callee64, this);
9963
+ }, _callee65, this);
9909
9964
  }));
9910
9965
 
9911
9966
  function resumeCampaign(_x86) {
@@ -9925,30 +9980,30 @@ var StreamChat = /*#__PURE__*/function () {
9925
9980
  }, {
9926
9981
  key: "testCampaign",
9927
9982
  value: function () {
9928
- var _testCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee65(id, params) {
9983
+ var _testCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee66(id, params) {
9929
9984
  var users, _yield$this$post3, campaign;
9930
9985
 
9931
- return _regeneratorRuntime.wrap(function _callee65$(_context65) {
9986
+ return _regeneratorRuntime.wrap(function _callee66$(_context66) {
9932
9987
  while (1) {
9933
- switch (_context65.prev = _context65.next) {
9988
+ switch (_context66.prev = _context66.next) {
9934
9989
  case 0:
9935
9990
  users = params.users;
9936
- _context65.next = 3;
9991
+ _context66.next = 3;
9937
9992
  return this.post(this.baseURL + "/campaigns/".concat(id, "/test"), {
9938
9993
  users: users
9939
9994
  });
9940
9995
 
9941
9996
  case 3:
9942
- _yield$this$post3 = _context65.sent;
9997
+ _yield$this$post3 = _context66.sent;
9943
9998
  campaign = _yield$this$post3.campaign;
9944
- return _context65.abrupt("return", campaign);
9999
+ return _context66.abrupt("return", campaign);
9945
10000
 
9946
10001
  case 6:
9947
10002
  case "end":
9948
- return _context65.stop();
10003
+ return _context66.stop();
9949
10004
  }
9950
10005
  }
9951
- }, _callee65, this);
10006
+ }, _callee66, this);
9952
10007
  }));
9953
10008
 
9954
10009
  function testCampaign(_x87, _x88) {
@@ -9967,21 +10022,21 @@ var StreamChat = /*#__PURE__*/function () {
9967
10022
  }, {
9968
10023
  key: "enrichURL",
9969
10024
  value: function () {
9970
- var _enrichURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee66(url) {
9971
- return _regeneratorRuntime.wrap(function _callee66$(_context66) {
10025
+ var _enrichURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee67(url) {
10026
+ return _regeneratorRuntime.wrap(function _callee67$(_context67) {
9972
10027
  while (1) {
9973
- switch (_context66.prev = _context66.next) {
10028
+ switch (_context67.prev = _context67.next) {
9974
10029
  case 0:
9975
- return _context66.abrupt("return", this.get(this.baseURL + "/og", {
10030
+ return _context67.abrupt("return", this.get(this.baseURL + "/og", {
9976
10031
  url: url
9977
10032
  }));
9978
10033
 
9979
10034
  case 1:
9980
10035
  case "end":
9981
- return _context66.stop();
10036
+ return _context67.stop();
9982
10037
  }
9983
10038
  }
9984
- }, _callee66, this);
10039
+ }, _callee67, this);
9985
10040
  }));
9986
10041
 
9987
10042
  function enrichURL(_x89) {
@@ -10001,19 +10056,19 @@ var StreamChat = /*#__PURE__*/function () {
10001
10056
  }, {
10002
10057
  key: "getTask",
10003
10058
  value: function () {
10004
- var _getTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee67(id) {
10005
- return _regeneratorRuntime.wrap(function _callee67$(_context67) {
10059
+ var _getTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee68(id) {
10060
+ return _regeneratorRuntime.wrap(function _callee68$(_context68) {
10006
10061
  while (1) {
10007
- switch (_context67.prev = _context67.next) {
10062
+ switch (_context68.prev = _context68.next) {
10008
10063
  case 0:
10009
- 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)));
10010
10065
 
10011
10066
  case 1:
10012
10067
  case "end":
10013
- return _context67.stop();
10068
+ return _context68.stop();
10014
10069
  }
10015
10070
  }
10016
- }, _callee67, this);
10071
+ }, _callee68, this);
10017
10072
  }));
10018
10073
 
10019
10074
  function getTask(_x90) {
@@ -10034,28 +10089,28 @@ var StreamChat = /*#__PURE__*/function () {
10034
10089
  }, {
10035
10090
  key: "deleteChannels",
10036
10091
  value: function () {
10037
- var _deleteChannels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee68(cids) {
10092
+ var _deleteChannels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee69(cids) {
10038
10093
  var options,
10039
- _args68 = arguments;
10040
- return _regeneratorRuntime.wrap(function _callee68$(_context68) {
10094
+ _args69 = arguments;
10095
+ return _regeneratorRuntime.wrap(function _callee69$(_context69) {
10041
10096
  while (1) {
10042
- switch (_context68.prev = _context68.next) {
10097
+ switch (_context69.prev = _context69.next) {
10043
10098
  case 0:
10044
- options = _args68.length > 1 && _args68[1] !== undefined ? _args68[1] : {};
10045
- _context68.next = 3;
10099
+ options = _args69.length > 1 && _args69[1] !== undefined ? _args69[1] : {};
10100
+ _context69.next = 3;
10046
10101
  return this.post(this.baseURL + "/channels/delete", _objectSpread({
10047
10102
  cids: cids
10048
10103
  }, options));
10049
10104
 
10050
10105
  case 3:
10051
- return _context68.abrupt("return", _context68.sent);
10106
+ return _context69.abrupt("return", _context69.sent);
10052
10107
 
10053
10108
  case 4:
10054
10109
  case "end":
10055
- return _context68.stop();
10110
+ return _context69.stop();
10056
10111
  }
10057
10112
  }
10058
- }, _callee68, this);
10113
+ }, _callee69, this);
10059
10114
  }));
10060
10115
 
10061
10116
  function deleteChannels(_x91) {
@@ -10076,13 +10131,13 @@ var StreamChat = /*#__PURE__*/function () {
10076
10131
  }, {
10077
10132
  key: "deleteUsers",
10078
10133
  value: function () {
10079
- var _deleteUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee69(user_ids, options) {
10080
- 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) {
10081
10136
  while (1) {
10082
- switch (_context69.prev = _context69.next) {
10137
+ switch (_context70.prev = _context70.next) {
10083
10138
  case 0:
10084
10139
  if (!((options === null || options === void 0 ? void 0 : options.user) !== 'soft' && (options === null || options === void 0 ? void 0 : options.user) !== 'hard')) {
10085
- _context69.next = 2;
10140
+ _context70.next = 2;
10086
10141
  break;
10087
10142
  }
10088
10143
 
@@ -10090,7 +10145,7 @@ var StreamChat = /*#__PURE__*/function () {
10090
10145
 
10091
10146
  case 2:
10092
10147
  if (!(options.messages !== undefined && options.messages !== 'soft' && options.messages !== 'hard')) {
10093
- _context69.next = 4;
10148
+ _context70.next = 4;
10094
10149
  break;
10095
10150
  }
10096
10151
 
@@ -10098,27 +10153,27 @@ var StreamChat = /*#__PURE__*/function () {
10098
10153
 
10099
10154
  case 4:
10100
10155
  if (!(options.conversations !== undefined && options.conversations !== 'soft' && options.conversations !== 'hard')) {
10101
- _context69.next = 6;
10156
+ _context70.next = 6;
10102
10157
  break;
10103
10158
  }
10104
10159
 
10105
10160
  throw new Error('Invalid delete user options. conversations must be one of [soft hard]');
10106
10161
 
10107
10162
  case 6:
10108
- _context69.next = 8;
10163
+ _context70.next = 8;
10109
10164
  return this.post(this.baseURL + "/users/delete", _objectSpread({
10110
10165
  user_ids: user_ids
10111
10166
  }, options));
10112
10167
 
10113
10168
  case 8:
10114
- return _context69.abrupt("return", _context69.sent);
10169
+ return _context70.abrupt("return", _context70.sent);
10115
10170
 
10116
10171
  case 9:
10117
10172
  case "end":
10118
- return _context69.stop();
10173
+ return _context70.stop();
10119
10174
  }
10120
10175
  }
10121
- }, _callee69, this);
10176
+ }, _callee70, this);
10122
10177
  }));
10123
10178
 
10124
10179
  function deleteUsers(_x92, _x93) {
@@ -10128,7 +10183,7 @@ var StreamChat = /*#__PURE__*/function () {
10128
10183
  return deleteUsers;
10129
10184
  }()
10130
10185
  /**
10131
- * _createImport - Create an Import Task.
10186
+ * _createImportURL - Create an Import upload url.
10132
10187
  *
10133
10188
  * Note: Do not use this.
10134
10189
  * It is present for internal usage only.
@@ -10140,31 +10195,74 @@ var StreamChat = /*#__PURE__*/function () {
10140
10195
  * @return {APIResponse & CreateImportResponse} An ImportTask
10141
10196
  */
10142
10197
 
10198
+ }, {
10199
+ key: "_createImportURL",
10200
+ value: function () {
10201
+ var _createImportURL2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee71(filename) {
10202
+ return _regeneratorRuntime.wrap(function _callee71$(_context71) {
10203
+ while (1) {
10204
+ switch (_context71.prev = _context71.next) {
10205
+ case 0:
10206
+ _context71.next = 2;
10207
+ return this.post(this.baseURL + "/import_urls", {
10208
+ filename: filename
10209
+ });
10210
+
10211
+ case 2:
10212
+ return _context71.abrupt("return", _context71.sent);
10213
+
10214
+ case 3:
10215
+ case "end":
10216
+ return _context71.stop();
10217
+ }
10218
+ }
10219
+ }, _callee71, this);
10220
+ }));
10221
+
10222
+ function _createImportURL(_x94) {
10223
+ return _createImportURL2.apply(this, arguments);
10224
+ }
10225
+
10226
+ return _createImportURL;
10227
+ }()
10228
+ /**
10229
+ * _createImport - Create an Import Task.
10230
+ *
10231
+ * Note: Do not use this.
10232
+ * It is present for internal usage only.
10233
+ * This function can, and will, break and/or be removed at any point in time.
10234
+ *
10235
+ * @private
10236
+ * @param {string} path path of uploaded data
10237
+ *
10238
+ * @return {APIResponse & CreateImportResponse} An ImportTask
10239
+ */
10240
+
10143
10241
  }, {
10144
10242
  key: "_createImport",
10145
10243
  value: function () {
10146
- var _createImport2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee70(filename) {
10147
- return _regeneratorRuntime.wrap(function _callee70$(_context70) {
10244
+ var _createImport2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee72(path) {
10245
+ return _regeneratorRuntime.wrap(function _callee72$(_context72) {
10148
10246
  while (1) {
10149
- switch (_context70.prev = _context70.next) {
10247
+ switch (_context72.prev = _context72.next) {
10150
10248
  case 0:
10151
- _context70.next = 2;
10249
+ _context72.next = 2;
10152
10250
  return this.post(this.baseURL + "/imports", {
10153
- filename: filename
10251
+ path: path
10154
10252
  });
10155
10253
 
10156
10254
  case 2:
10157
- return _context70.abrupt("return", _context70.sent);
10255
+ return _context72.abrupt("return", _context72.sent);
10158
10256
 
10159
10257
  case 3:
10160
10258
  case "end":
10161
- return _context70.stop();
10259
+ return _context72.stop();
10162
10260
  }
10163
10261
  }
10164
- }, _callee70, this);
10262
+ }, _callee72, this);
10165
10263
  }));
10166
10264
 
10167
- function _createImport(_x94) {
10265
+ function _createImport(_x95) {
10168
10266
  return _createImport2.apply(this, arguments);
10169
10267
  }
10170
10268
 
@@ -10186,26 +10284,26 @@ var StreamChat = /*#__PURE__*/function () {
10186
10284
  }, {
10187
10285
  key: "_getImport",
10188
10286
  value: function () {
10189
- var _getImport2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee71(id) {
10190
- return _regeneratorRuntime.wrap(function _callee71$(_context71) {
10287
+ var _getImport2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee73(id) {
10288
+ return _regeneratorRuntime.wrap(function _callee73$(_context73) {
10191
10289
  while (1) {
10192
- switch (_context71.prev = _context71.next) {
10290
+ switch (_context73.prev = _context73.next) {
10193
10291
  case 0:
10194
- _context71.next = 2;
10292
+ _context73.next = 2;
10195
10293
  return this.get(this.baseURL + "/imports/".concat(id));
10196
10294
 
10197
10295
  case 2:
10198
- return _context71.abrupt("return", _context71.sent);
10296
+ return _context73.abrupt("return", _context73.sent);
10199
10297
 
10200
10298
  case 3:
10201
10299
  case "end":
10202
- return _context71.stop();
10300
+ return _context73.stop();
10203
10301
  }
10204
10302
  }
10205
- }, _callee71, this);
10303
+ }, _callee73, this);
10206
10304
  }));
10207
10305
 
10208
- function _getImport(_x95) {
10306
+ function _getImport(_x96) {
10209
10307
  return _getImport2.apply(this, arguments);
10210
10308
  }
10211
10309
 
@@ -10227,26 +10325,26 @@ var StreamChat = /*#__PURE__*/function () {
10227
10325
  }, {
10228
10326
  key: "_listImports",
10229
10327
  value: function () {
10230
- var _listImports2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee72(options) {
10231
- return _regeneratorRuntime.wrap(function _callee72$(_context72) {
10328
+ var _listImports2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee74(options) {
10329
+ return _regeneratorRuntime.wrap(function _callee74$(_context74) {
10232
10330
  while (1) {
10233
- switch (_context72.prev = _context72.next) {
10331
+ switch (_context74.prev = _context74.next) {
10234
10332
  case 0:
10235
- _context72.next = 2;
10333
+ _context74.next = 2;
10236
10334
  return this.get(this.baseURL + "/imports", options);
10237
10335
 
10238
10336
  case 2:
10239
- return _context72.abrupt("return", _context72.sent);
10337
+ return _context74.abrupt("return", _context74.sent);
10240
10338
 
10241
10339
  case 3:
10242
10340
  case "end":
10243
- return _context72.stop();
10341
+ return _context74.stop();
10244
10342
  }
10245
10343
  }
10246
- }, _callee72, this);
10344
+ }, _callee74, this);
10247
10345
  }));
10248
10346
 
10249
- function _listImports(_x96) {
10347
+ function _listImports(_x97) {
10250
10348
  return _listImports2.apply(this, arguments);
10251
10349
  }
10252
10350