stream-chat 5.5.0 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -13
- package/dist/browser.es.js +424 -366
- package/dist/browser.es.js.map +1 -1
- package/dist/browser.full-bundle.min.js +1 -1
- package/dist/browser.full-bundle.min.js.map +1 -1
- package/dist/browser.js +424 -366
- package/dist/browser.js.map +1 -1
- package/dist/index.es.js +424 -366
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +424 -366
- package/dist/index.js.map +1 -1
- package/dist/types/channel.d.ts +124 -124
- package/dist/types/channel.d.ts.map +1 -1
- package/dist/types/channel_state.d.ts +41 -41
- package/dist/types/channel_state.d.ts.map +1 -1
- package/dist/types/client.d.ts +176 -169
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/client_state.d.ts +6 -6
- package/dist/types/client_state.d.ts.map +1 -1
- package/dist/types/connection.d.ts +10 -10
- package/dist/types/connection.d.ts.map +1 -1
- package/dist/types/connection_fallback.d.ts +7 -7
- package/dist/types/connection_fallback.d.ts.map +1 -1
- package/dist/types/insights.d.ts +2 -2
- package/dist/types/token_manager.d.ts +6 -6
- package/dist/types/token_manager.d.ts.map +1 -1
- package/dist/types/types.d.ts +388 -233
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utils.d.ts +2 -2
- package/dist/types/utils.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/channel.ts +197 -290
- package/src/channel_state.ts +54 -219
- package/src/client.ts +275 -521
- package/src/client_state.ts +6 -6
- package/src/connection.ts +7 -22
- package/src/connection_fallback.ts +9 -21
- package/src/token_manager.ts +6 -6
- package/src/types.ts +518 -484
- package/src/utils.ts +7 -11
package/dist/browser.js
CHANGED
|
@@ -274,7 +274,7 @@ var ChannelState = /*#__PURE__*/function () {
|
|
|
274
274
|
/**
|
|
275
275
|
* addMessageSorted - Add a message to the state
|
|
276
276
|
*
|
|
277
|
-
* @param {MessageResponse<
|
|
277
|
+
* @param {MessageResponse<StreamChatGenerics>} newMessage A new message
|
|
278
278
|
* @param {boolean} timestampChanged Whether updating a message with changed created_at value.
|
|
279
279
|
* @param {boolean} addIfDoesNotExist Add message if it is not in the list, used to prevent out of order updated messages from being added.
|
|
280
280
|
*
|
|
@@ -292,7 +292,7 @@ var ChannelState = /*#__PURE__*/function () {
|
|
|
292
292
|
* formatMessage - Takes the message object. Parses the dates, sets __html
|
|
293
293
|
* and sets the status to received if missing. Returns a message object
|
|
294
294
|
*
|
|
295
|
-
* @param {MessageResponse<
|
|
295
|
+
* @param {MessageResponse<StreamChatGenerics>} message a message object
|
|
296
296
|
*
|
|
297
297
|
*/
|
|
298
298
|
|
|
@@ -314,7 +314,7 @@ var ChannelState = /*#__PURE__*/function () {
|
|
|
314
314
|
/**
|
|
315
315
|
* addMessagesSorted - Add the list of messages to state and resorts the messages
|
|
316
316
|
*
|
|
317
|
-
* @param {Array<MessageResponse<
|
|
317
|
+
* @param {Array<MessageResponse<StreamChatGenerics>>} newMessages A list of messages
|
|
318
318
|
* @param {boolean} timestampChanged Whether updating messages with changed created_at value.
|
|
319
319
|
* @param {boolean} initializing Whether channel is being initialized.
|
|
320
320
|
* @param {boolean} addIfDoesNotExist Add message if it is not in the list, used to prevent out of order updated messages from being added.
|
|
@@ -393,7 +393,7 @@ var ChannelState = /*#__PURE__*/function () {
|
|
|
393
393
|
/**
|
|
394
394
|
* addPinnedMessages - adds messages in pinnedMessages property
|
|
395
395
|
*
|
|
396
|
-
* @param {Array<MessageResponse<
|
|
396
|
+
* @param {Array<MessageResponse<StreamChatGenerics>>} pinnedMessages A list of pinned messages
|
|
397
397
|
*
|
|
398
398
|
*/
|
|
399
399
|
|
|
@@ -407,7 +407,7 @@ var ChannelState = /*#__PURE__*/function () {
|
|
|
407
407
|
/**
|
|
408
408
|
* addPinnedMessage - adds message in pinnedMessages
|
|
409
409
|
*
|
|
410
|
-
* @param {MessageResponse<
|
|
410
|
+
* @param {MessageResponse<StreamChatGenerics>} pinnedMessage message to update
|
|
411
411
|
*
|
|
412
412
|
*/
|
|
413
413
|
|
|
@@ -419,7 +419,7 @@ var ChannelState = /*#__PURE__*/function () {
|
|
|
419
419
|
/**
|
|
420
420
|
* removePinnedMessage - removes pinned message from pinnedMessages
|
|
421
421
|
*
|
|
422
|
-
* @param {MessageResponse<
|
|
422
|
+
* @param {MessageResponse<StreamChatGenerics>} message message to remove
|
|
423
423
|
*
|
|
424
424
|
*/
|
|
425
425
|
|
|
@@ -573,7 +573,7 @@ var ChannelState = /*#__PURE__*/function () {
|
|
|
573
573
|
/**
|
|
574
574
|
* _addToMessageList - Adds a message to a list of messages, tries to update first, appends if message isn't found
|
|
575
575
|
*
|
|
576
|
-
* @param {Array<ReturnType<ChannelState<
|
|
576
|
+
* @param {Array<ReturnType<ChannelState<StreamChatGenerics>['formatMessage']>>} messages A list of messages
|
|
577
577
|
* @param message
|
|
578
578
|
* @param {boolean} timestampChanged Whether updating a message with changed created_at value.
|
|
579
579
|
* @param {string} sortBy field name to use to sort the messages by
|
|
@@ -831,13 +831,14 @@ function isFileWebAPI(uri) {
|
|
|
831
831
|
return typeof window !== 'undefined' && 'File' in window && uri instanceof File;
|
|
832
832
|
}
|
|
833
833
|
|
|
834
|
+
function isOwnUser(user) {
|
|
835
|
+
return (user === null || user === void 0 ? void 0 : user.total_unread_count) !== undefined;
|
|
836
|
+
}
|
|
837
|
+
|
|
834
838
|
function isBlobWebAPI(uri) {
|
|
835
839
|
return typeof window !== 'undefined' && 'Blob' in window && uri instanceof Blob;
|
|
836
840
|
}
|
|
837
841
|
|
|
838
|
-
function isOwnUser(user) {
|
|
839
|
-
return (user === null || user === void 0 ? void 0 : user.total_unread_count) !== undefined;
|
|
840
|
-
}
|
|
841
842
|
function isOwnUserBaseProperty(property) {
|
|
842
843
|
var ownUserBaseProperties = {
|
|
843
844
|
channel_mutes: true,
|
|
@@ -1032,12 +1033,12 @@ var Channel = /*#__PURE__*/function () {
|
|
|
1032
1033
|
/**
|
|
1033
1034
|
* constructor - Create a channel
|
|
1034
1035
|
*
|
|
1035
|
-
* @param {StreamChat<
|
|
1036
|
+
* @param {StreamChat<StreamChatGenerics>} client the chat client
|
|
1036
1037
|
* @param {string} type the type of channel
|
|
1037
1038
|
* @param {string} [id] the id of the chat
|
|
1038
|
-
* @param {ChannelData<
|
|
1039
|
+
* @param {ChannelData<StreamChatGenerics>} data any additional custom params
|
|
1039
1040
|
*
|
|
1040
|
-
* @return {Channel<
|
|
1041
|
+
* @return {Channel<StreamChatGenerics>} Returns a new uninitialized channel
|
|
1041
1042
|
*/
|
|
1042
1043
|
function Channel(client, type, id, data) {
|
|
1043
1044
|
var _this = this;
|
|
@@ -1156,7 +1157,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
1156
1157
|
/**
|
|
1157
1158
|
* getClient - Get the chat client for this channel. If client.disconnect() was called, this function will error
|
|
1158
1159
|
*
|
|
1159
|
-
* @return {StreamChat<
|
|
1160
|
+
* @return {StreamChat<StreamChatGenerics>}
|
|
1160
1161
|
*/
|
|
1161
1162
|
|
|
1162
1163
|
|
|
@@ -1184,11 +1185,11 @@ var Channel = /*#__PURE__*/function () {
|
|
|
1184
1185
|
/**
|
|
1185
1186
|
* sendMessage - Send a message to this channel
|
|
1186
1187
|
*
|
|
1187
|
-
* @param {Message<
|
|
1188
|
+
* @param {Message<StreamChatGenerics>} message The Message object
|
|
1188
1189
|
* @param {boolean} [options.skip_enrich_url] Do not try to enrich the URLs within message
|
|
1189
1190
|
* @param {boolean} [options.skip_push] Skip sending push notifications
|
|
1190
1191
|
*
|
|
1191
|
-
* @return {Promise<SendMessageAPIResponse<
|
|
1192
|
+
* @return {Promise<SendMessageAPIResponse<StreamChatGenerics>>} The Server Response
|
|
1192
1193
|
*/
|
|
1193
1194
|
|
|
1194
1195
|
}, {
|
|
@@ -1252,9 +1253,9 @@ var Channel = /*#__PURE__*/function () {
|
|
|
1252
1253
|
/**
|
|
1253
1254
|
* sendEvent - Send an event on this channel
|
|
1254
1255
|
*
|
|
1255
|
-
* @param {Event<
|
|
1256
|
+
* @param {Event<StreamChatGenerics>} event for example {type: 'message.read'}
|
|
1256
1257
|
*
|
|
1257
|
-
* @return {Promise<EventAPIResponse<
|
|
1258
|
+
* @return {Promise<EventAPIResponse<StreamChatGenerics>>} The Server Response
|
|
1258
1259
|
*/
|
|
1259
1260
|
|
|
1260
1261
|
}, {
|
|
@@ -1292,10 +1293,10 @@ var Channel = /*#__PURE__*/function () {
|
|
|
1292
1293
|
/**
|
|
1293
1294
|
* search - Query messages
|
|
1294
1295
|
*
|
|
1295
|
-
* @param {MessageFilters<
|
|
1296
|
-
* @param {{client_id?: string; connection_id?: string; query?: string; message_filter_conditions?: MessageFilters<
|
|
1296
|
+
* @param {MessageFilters<StreamChatGenerics> | string} query search query or object MongoDB style filters
|
|
1297
|
+
* @param {{client_id?: string; connection_id?: string; query?: string; message_filter_conditions?: MessageFilters<StreamChatGenerics>}} options Option object, {user_id: 'tommaso'}
|
|
1297
1298
|
*
|
|
1298
|
-
* @return {Promise<SearchAPIResponse<
|
|
1299
|
+
* @return {Promise<SearchAPIResponse<StreamChatGenerics>>} search messages response
|
|
1299
1300
|
*/
|
|
1300
1301
|
|
|
1301
1302
|
}, {
|
|
@@ -1380,12 +1381,12 @@ var Channel = /*#__PURE__*/function () {
|
|
|
1380
1381
|
/**
|
|
1381
1382
|
* queryMembers - Query Members
|
|
1382
1383
|
*
|
|
1383
|
-
* @param {UserFilters<
|
|
1384
|
-
* @param {MemberSort<
|
|
1384
|
+
* @param {UserFilters<StreamChatGenerics>} filterConditions object MongoDB style filters
|
|
1385
|
+
* @param {MemberSort<StreamChatGenerics>} [sort] Sort options, for instance [{created_at: -1}].
|
|
1385
1386
|
* When using multiple fields, make sure you use array of objects to guarantee field order, for instance [{name: -1}, {created_at: 1}]
|
|
1386
1387
|
* @param {{ limit?: number; offset?: number }} [options] Option object, {limit: 10, offset:10}
|
|
1387
1388
|
*
|
|
1388
|
-
* @return {Promise<ChannelMemberAPIResponse<
|
|
1389
|
+
* @return {Promise<ChannelMemberAPIResponse<StreamChatGenerics>>} Query Members response
|
|
1389
1390
|
*/
|
|
1390
1391
|
|
|
1391
1392
|
}, {
|
|
@@ -1447,10 +1448,10 @@ var Channel = /*#__PURE__*/function () {
|
|
|
1447
1448
|
* sendReaction - Send a reaction about a message
|
|
1448
1449
|
*
|
|
1449
1450
|
* @param {string} messageID the message id
|
|
1450
|
-
* @param {Reaction<
|
|
1451
|
+
* @param {Reaction<StreamChatGenerics>} reaction the reaction object for instance {type: 'love'}
|
|
1451
1452
|
* @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
|
|
1452
1453
|
*
|
|
1453
|
-
* @return {Promise<ReactionAPIResponse<
|
|
1454
|
+
* @return {Promise<ReactionAPIResponse<StreamChatGenerics>>} The Server Response
|
|
1454
1455
|
*/
|
|
1455
1456
|
|
|
1456
1457
|
}, {
|
|
@@ -1506,7 +1507,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
1506
1507
|
* @param {string} reactionType the type of reaction that should be removed
|
|
1507
1508
|
* @param {string} [user_id] the id of the user (used only for server side request) default null
|
|
1508
1509
|
*
|
|
1509
|
-
* @return {Promise<ReactionAPIResponse<
|
|
1510
|
+
* @return {Promise<ReactionAPIResponse<StreamChatGenerics>>} The Server Response
|
|
1510
1511
|
*/
|
|
1511
1512
|
|
|
1512
1513
|
}, {
|
|
@@ -1531,10 +1532,10 @@ var Channel = /*#__PURE__*/function () {
|
|
|
1531
1532
|
/**
|
|
1532
1533
|
* update - Edit the channel's custom properties
|
|
1533
1534
|
*
|
|
1534
|
-
* @param {ChannelData<
|
|
1535
|
-
* @param {Message<
|
|
1535
|
+
* @param {ChannelData<StreamChatGenerics>} channelData The object to update the custom properties of this channel with
|
|
1536
|
+
* @param {Message<StreamChatGenerics>} [updateMessage] Optional message object for channel members notification
|
|
1536
1537
|
* @param {ChannelUpdateOptions} [options] Option object, configuration to control the behavior while updating
|
|
1537
|
-
* @return {Promise<UpdateChannelAPIResponse<
|
|
1538
|
+
* @return {Promise<UpdateChannelAPIResponse<StreamChatGenerics>>} The server response
|
|
1538
1539
|
*/
|
|
1539
1540
|
|
|
1540
1541
|
}, {
|
|
@@ -1584,9 +1585,9 @@ var Channel = /*#__PURE__*/function () {
|
|
|
1584
1585
|
/**
|
|
1585
1586
|
* updatePartial - partial update channel properties
|
|
1586
1587
|
*
|
|
1587
|
-
* @param {PartialUpdateChannel<
|
|
1588
|
+
* @param {PartialUpdateChannel<StreamChatGenerics>} partial update request
|
|
1588
1589
|
*
|
|
1589
|
-
* @return {Promise<PartialUpdateChannelAPIResponse<
|
|
1590
|
+
* @return {Promise<PartialUpdateChannelAPIResponse<StreamChatGenerics>>}
|
|
1590
1591
|
*/
|
|
1591
1592
|
|
|
1592
1593
|
}, {
|
|
@@ -1621,7 +1622,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
1621
1622
|
* enableSlowMode - enable slow mode
|
|
1622
1623
|
*
|
|
1623
1624
|
* @param {number} coolDownInterval the cooldown interval in seconds
|
|
1624
|
-
* @return {Promise<UpdateChannelAPIResponse<
|
|
1625
|
+
* @return {Promise<UpdateChannelAPIResponse<StreamChatGenerics>>} The server response
|
|
1625
1626
|
*/
|
|
1626
1627
|
|
|
1627
1628
|
}, {
|
|
@@ -1660,7 +1661,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
1660
1661
|
/**
|
|
1661
1662
|
* disableSlowMode - disable slow mode
|
|
1662
1663
|
*
|
|
1663
|
-
* @return {Promise<UpdateChannelAPIResponse<
|
|
1664
|
+
* @return {Promise<UpdateChannelAPIResponse<StreamChatGenerics>>} The server response
|
|
1664
1665
|
*/
|
|
1665
1666
|
|
|
1666
1667
|
}, {
|
|
@@ -1701,7 +1702,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
1701
1702
|
*
|
|
1702
1703
|
* @param {boolean} [options.hard_delete] Defines if the channel is hard deleted or not
|
|
1703
1704
|
*
|
|
1704
|
-
* @return {Promise<DeleteChannelAPIResponse<
|
|
1705
|
+
* @return {Promise<DeleteChannelAPIResponse<StreamChatGenerics>>} The server response
|
|
1705
1706
|
*/
|
|
1706
1707
|
|
|
1707
1708
|
}, {
|
|
@@ -1737,8 +1738,8 @@ var Channel = /*#__PURE__*/function () {
|
|
|
1737
1738
|
}()
|
|
1738
1739
|
/**
|
|
1739
1740
|
* truncate - Removes all messages from the channel
|
|
1740
|
-
* @param {TruncateOptions<
|
|
1741
|
-
* @return {Promise<TruncateChannelAPIResponse<
|
|
1741
|
+
* @param {TruncateOptions<StreamChatGenerics>} [options] Defines truncation options
|
|
1742
|
+
* @return {Promise<TruncateChannelAPIResponse<StreamChatGenerics>>} The server response
|
|
1742
1743
|
*/
|
|
1743
1744
|
|
|
1744
1745
|
}, {
|
|
@@ -1775,9 +1776,9 @@ var Channel = /*#__PURE__*/function () {
|
|
|
1775
1776
|
/**
|
|
1776
1777
|
* acceptInvite - accept invitation to the channel
|
|
1777
1778
|
*
|
|
1778
|
-
* @param {InviteOptions<
|
|
1779
|
+
* @param {InviteOptions<StreamChatGenerics>} [options] The object to update the custom properties of this channel with
|
|
1779
1780
|
*
|
|
1780
|
-
* @return {Promise<UpdateChannelAPIResponse<
|
|
1781
|
+
* @return {Promise<UpdateChannelAPIResponse<StreamChatGenerics>>} The server response
|
|
1781
1782
|
*/
|
|
1782
1783
|
|
|
1783
1784
|
}, {
|
|
@@ -1816,9 +1817,9 @@ var Channel = /*#__PURE__*/function () {
|
|
|
1816
1817
|
/**
|
|
1817
1818
|
* rejectInvite - reject invitation to the channel
|
|
1818
1819
|
*
|
|
1819
|
-
* @param {InviteOptions<
|
|
1820
|
+
* @param {InviteOptions<StreamChatGenerics>} [options] The object to update the custom properties of this channel with
|
|
1820
1821
|
*
|
|
1821
|
-
* @return {Promise<UpdateChannelAPIResponse<
|
|
1822
|
+
* @return {Promise<UpdateChannelAPIResponse<StreamChatGenerics>>} The server response
|
|
1822
1823
|
*/
|
|
1823
1824
|
|
|
1824
1825
|
}, {
|
|
@@ -1858,9 +1859,9 @@ var Channel = /*#__PURE__*/function () {
|
|
|
1858
1859
|
* addMembers - add members to the channel
|
|
1859
1860
|
*
|
|
1860
1861
|
* @param {{user_id: string, channel_role?: Role}[]} members An array of members to add to the channel
|
|
1861
|
-
* @param {Message<
|
|
1862
|
+
* @param {Message<StreamChatGenerics>} [message] Optional message object for channel members notification
|
|
1862
1863
|
* @param {ChannelUpdateOptions} [options] Option object, configuration to control the behavior while updating
|
|
1863
|
-
* @return {Promise<UpdateChannelAPIResponse<
|
|
1864
|
+
* @return {Promise<UpdateChannelAPIResponse<StreamChatGenerics>>} The server response
|
|
1864
1865
|
*/
|
|
1865
1866
|
|
|
1866
1867
|
}, {
|
|
@@ -1901,9 +1902,9 @@ var Channel = /*#__PURE__*/function () {
|
|
|
1901
1902
|
* addModerators - add moderators to the channel
|
|
1902
1903
|
*
|
|
1903
1904
|
* @param {string[]} members An array of member identifiers
|
|
1904
|
-
* @param {Message<
|
|
1905
|
+
* @param {Message<StreamChatGenerics>} [message] Optional message object for channel members notification
|
|
1905
1906
|
* @param {ChannelUpdateOptions} [options] Option object, configuration to control the behavior while updating
|
|
1906
|
-
* @return {Promise<UpdateChannelAPIResponse<
|
|
1907
|
+
* @return {Promise<UpdateChannelAPIResponse<StreamChatGenerics>>} The server response
|
|
1907
1908
|
*/
|
|
1908
1909
|
|
|
1909
1910
|
}, {
|
|
@@ -1944,9 +1945,9 @@ var Channel = /*#__PURE__*/function () {
|
|
|
1944
1945
|
* assignRoles - sets member roles in a channel
|
|
1945
1946
|
*
|
|
1946
1947
|
* @param {{channel_role: Role, user_id: string}[]} roles List of role assignments
|
|
1947
|
-
* @param {Message<
|
|
1948
|
+
* @param {Message<StreamChatGenerics>} [message] Optional message object for channel members notification
|
|
1948
1949
|
* @param {ChannelUpdateOptions} [options] Option object, configuration to control the behavior while updating
|
|
1949
|
-
* @return {Promise<UpdateChannelAPIResponse<
|
|
1950
|
+
* @return {Promise<UpdateChannelAPIResponse<StreamChatGenerics>>} The server response
|
|
1950
1951
|
*/
|
|
1951
1952
|
|
|
1952
1953
|
}, {
|
|
@@ -1987,9 +1988,9 @@ var Channel = /*#__PURE__*/function () {
|
|
|
1987
1988
|
* inviteMembers - invite members to the channel
|
|
1988
1989
|
*
|
|
1989
1990
|
* @param {{user_id: string, channel_role?: Role}[]} members An array of members to invite to the channel
|
|
1990
|
-
* @param {Message<
|
|
1991
|
+
* @param {Message<StreamChatGenerics>} [message] Optional message object for channel members notification
|
|
1991
1992
|
* @param {ChannelUpdateOptions} [options] Option object, configuration to control the behavior while updating
|
|
1992
|
-
* @return {Promise<UpdateChannelAPIResponse<
|
|
1993
|
+
* @return {Promise<UpdateChannelAPIResponse<StreamChatGenerics>>} The server response
|
|
1993
1994
|
*/
|
|
1994
1995
|
|
|
1995
1996
|
}, {
|
|
@@ -2030,9 +2031,9 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2030
2031
|
* removeMembers - remove members from channel
|
|
2031
2032
|
*
|
|
2032
2033
|
* @param {string[]} members An array of member identifiers
|
|
2033
|
-
* @param {Message<
|
|
2034
|
+
* @param {Message<StreamChatGenerics>} [message] Optional message object for channel members notification
|
|
2034
2035
|
* @param {ChannelUpdateOptions} [options] Option object, configuration to control the behavior while updating
|
|
2035
|
-
* @return {Promise<UpdateChannelAPIResponse<
|
|
2036
|
+
* @return {Promise<UpdateChannelAPIResponse<StreamChatGenerics>>} The server response
|
|
2036
2037
|
*/
|
|
2037
2038
|
|
|
2038
2039
|
}, {
|
|
@@ -2073,9 +2074,9 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2073
2074
|
* demoteModerators - remove moderator role from channel members
|
|
2074
2075
|
*
|
|
2075
2076
|
* @param {string[]} members An array of member identifiers
|
|
2076
|
-
* @param {Message<
|
|
2077
|
+
* @param {Message<StreamChatGenerics>} [message] Optional message object for channel members notification
|
|
2077
2078
|
* @param {ChannelUpdateOptions} [options] Option object, configuration to control the behavior while updating
|
|
2078
|
-
* @return {Promise<UpdateChannelAPIResponse<
|
|
2079
|
+
* @return {Promise<UpdateChannelAPIResponse<StreamChatGenerics>>} The server response
|
|
2079
2080
|
*/
|
|
2080
2081
|
|
|
2081
2082
|
}, {
|
|
@@ -2115,7 +2116,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2115
2116
|
/**
|
|
2116
2117
|
* _update - executes channel update request
|
|
2117
2118
|
* @param payload Object Update Channel payload
|
|
2118
|
-
* @return {Promise<UpdateChannelAPIResponse<
|
|
2119
|
+
* @return {Promise<UpdateChannelAPIResponse<StreamChatGenerics>>} The server response
|
|
2119
2120
|
* TODO: introduce new type instead of Object in the next major update
|
|
2120
2121
|
*/
|
|
2121
2122
|
|
|
@@ -2153,7 +2154,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2153
2154
|
/**
|
|
2154
2155
|
* mute - mutes the current channel
|
|
2155
2156
|
* @param {{ user_id?: string, expiration?: string }} opts expiration in minutes or user_id
|
|
2156
|
-
* @return {Promise<MuteChannelAPIResponse<
|
|
2157
|
+
* @return {Promise<MuteChannelAPIResponse<StreamChatGenerics>>} The server response
|
|
2157
2158
|
*
|
|
2158
2159
|
* example with expiration:
|
|
2159
2160
|
* await channel.mute({expiration: moment.duration(2, 'weeks')});
|
|
@@ -2372,7 +2373,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2372
2373
|
/**
|
|
2373
2374
|
* lastMessage - return the last message, takes into account that last few messages might not be perfectly sorted
|
|
2374
2375
|
*
|
|
2375
|
-
* @return {ReturnType<ChannelState<
|
|
2376
|
+
* @return {ReturnType<ChannelState<StreamChatGenerics>['formatMessage']> | undefined} Description
|
|
2376
2377
|
*/
|
|
2377
2378
|
|
|
2378
2379
|
}, {
|
|
@@ -2397,8 +2398,8 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2397
2398
|
/**
|
|
2398
2399
|
* markRead - Send the mark read event for this user, only works if the `read_events` setting is enabled
|
|
2399
2400
|
*
|
|
2400
|
-
* @param {MarkReadOptions<
|
|
2401
|
-
* @return {Promise<EventAPIResponse<
|
|
2401
|
+
* @param {MarkReadOptions<StreamChatGenerics>} data
|
|
2402
|
+
* @return {Promise<EventAPIResponse<StreamChatGenerics> | null>} Description
|
|
2402
2403
|
*/
|
|
2403
2404
|
|
|
2404
2405
|
}, {
|
|
@@ -2466,9 +2467,9 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2466
2467
|
/**
|
|
2467
2468
|
* watch - Loads the initial channel state and watches for changes
|
|
2468
2469
|
*
|
|
2469
|
-
* @param {ChannelQueryOptions<
|
|
2470
|
+
* @param {ChannelQueryOptions<StreamChatGenerics>} options additional options for the query endpoint
|
|
2470
2471
|
*
|
|
2471
|
-
* @return {Promise<ChannelAPIResponse<
|
|
2472
|
+
* @return {Promise<ChannelAPIResponse<StreamChatGenerics>>} The server response
|
|
2472
2473
|
*/
|
|
2473
2474
|
|
|
2474
2475
|
}, {
|
|
@@ -2570,9 +2571,9 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2570
2571
|
* getReplies - List the message replies for a parent message
|
|
2571
2572
|
*
|
|
2572
2573
|
* @param {string} parent_id The message parent id, ie the top of the thread
|
|
2573
|
-
* @param {PaginationOptions & { user?: UserResponse<
|
|
2574
|
+
* @param {PaginationOptions & { user?: UserResponse<StreamChatGenerics>; user_id?: string }} options Pagination params, ie {limit:10, id_lte: 10}
|
|
2574
2575
|
*
|
|
2575
|
-
* @return {Promise<GetRepliesAPIResponse<
|
|
2576
|
+
* @return {Promise<GetRepliesAPIResponse<StreamChatGenerics>>} A response with a list of messages
|
|
2576
2577
|
*/
|
|
2577
2578
|
|
|
2578
2579
|
}, {
|
|
@@ -2614,10 +2615,10 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2614
2615
|
/**
|
|
2615
2616
|
* getPinnedMessages - List list pinned messages of the channel
|
|
2616
2617
|
*
|
|
2617
|
-
* @param {PinnedMessagePaginationOptions & { user?: UserResponse<
|
|
2618
|
+
* @param {PinnedMessagePaginationOptions & { user?: UserResponse<StreamChatGenerics>; user_id?: string }} options Pagination params, ie {limit:10, id_lte: 10}
|
|
2618
2619
|
* @param {PinnedMessagesSort} sort defines sorting direction of pinned messages
|
|
2619
2620
|
*
|
|
2620
|
-
* @return {Promise<GetRepliesAPIResponse<
|
|
2621
|
+
* @return {Promise<GetRepliesAPIResponse<StreamChatGenerics>>} A response with a list of messages
|
|
2621
2622
|
*/
|
|
2622
2623
|
|
|
2623
2624
|
}, {
|
|
@@ -2661,7 +2662,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2661
2662
|
* @param {string} message_id The message id
|
|
2662
2663
|
* @param {{ limit?: number; offset?: number }} options The pagination options
|
|
2663
2664
|
*
|
|
2664
|
-
* @return {Promise<GetReactionsAPIResponse<
|
|
2665
|
+
* @return {Promise<GetReactionsAPIResponse<StreamChatGenerics>>} Server response
|
|
2665
2666
|
*/
|
|
2666
2667
|
|
|
2667
2668
|
}, {
|
|
@@ -2674,7 +2675,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2674
2675
|
*
|
|
2675
2676
|
* @param {string[]} messageIds The ids of the messages to retrieve from this channel
|
|
2676
2677
|
*
|
|
2677
|
-
* @return {Promise<GetMultipleMessagesAPIResponse<
|
|
2678
|
+
* @return {Promise<GetMultipleMessagesAPIResponse<StreamChatGenerics>>} Server response
|
|
2678
2679
|
*/
|
|
2679
2680
|
|
|
2680
2681
|
}, {
|
|
@@ -2704,13 +2705,16 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2704
2705
|
}, {
|
|
2705
2706
|
key: "_countMessageAsUnread",
|
|
2706
2707
|
value: function _countMessageAsUnread(message) {
|
|
2707
|
-
var _message$user, _message$user2;
|
|
2708
|
+
var _message$user, _message$user2, _this$data2, _this$data3;
|
|
2708
2709
|
|
|
2709
2710
|
if (message.shadowed) return false;
|
|
2710
2711
|
if (message.silent) return false;
|
|
2712
|
+
if (message.parent_id && !message.show_in_channel) return false;
|
|
2711
2713
|
if (((_message$user = message.user) === null || _message$user === void 0 ? void 0 : _message$user.id) === this.getClient().userID) return false;
|
|
2712
2714
|
if ((_message$user2 = message.user) !== null && _message$user2 !== void 0 && _message$user2.id && this.getClient().userMuteStatus(message.user.id)) return false;
|
|
2713
|
-
if (message.type === 'system') return false;
|
|
2715
|
+
if (message.type === 'system') return false; // Return false if channel doesn't allow read events.
|
|
2716
|
+
|
|
2717
|
+
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;
|
|
2714
2718
|
if (this.muteStatus().muted) return false;
|
|
2715
2719
|
return true;
|
|
2716
2720
|
}
|
|
@@ -2768,7 +2772,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2768
2772
|
/**
|
|
2769
2773
|
* create - Creates a new channel
|
|
2770
2774
|
*
|
|
2771
|
-
* @return {Promise<ChannelAPIResponse<
|
|
2775
|
+
* @return {Promise<ChannelAPIResponse<StreamChatGenerics>>} The Server Response
|
|
2772
2776
|
*/
|
|
2773
2777
|
|
|
2774
2778
|
}, {
|
|
@@ -2777,9 +2781,9 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2777
2781
|
/**
|
|
2778
2782
|
* query - Query the API, get messages, members or other channel fields
|
|
2779
2783
|
*
|
|
2780
|
-
* @param {ChannelQueryOptions<
|
|
2784
|
+
* @param {ChannelQueryOptions<StreamChatGenerics>} options The query options
|
|
2781
2785
|
*
|
|
2782
|
-
* @return {Promise<ChannelAPIResponse<
|
|
2786
|
+
* @return {Promise<ChannelAPIResponse<StreamChatGenerics>>} Returns a query response
|
|
2783
2787
|
*/
|
|
2784
2788
|
function () {
|
|
2785
2789
|
var _query = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee31(options) {
|
|
@@ -2855,7 +2859,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2855
2859
|
* banUser - Bans a user from a channel
|
|
2856
2860
|
*
|
|
2857
2861
|
* @param {string} targetUserID
|
|
2858
|
-
* @param {BanUserOptions<
|
|
2862
|
+
* @param {BanUserOptions<StreamChatGenerics>} options
|
|
2859
2863
|
* @returns {Promise<APIResponse>}
|
|
2860
2864
|
*/
|
|
2861
2865
|
|
|
@@ -3027,7 +3031,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3027
3031
|
* shadowBan - Shadow bans a user from a channel
|
|
3028
3032
|
*
|
|
3029
3033
|
* @param {string} targetUserID
|
|
3030
|
-
* @param {BanUserOptions<
|
|
3034
|
+
* @param {BanUserOptions<StreamChatGenerics>} options
|
|
3031
3035
|
* @returns {Promise<APIResponse>}
|
|
3032
3036
|
*/
|
|
3033
3037
|
|
|
@@ -3111,8 +3115,8 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3111
3115
|
* or
|
|
3112
3116
|
* channel.on(event => {console.log(event.type)})
|
|
3113
3117
|
*
|
|
3114
|
-
* @param {EventHandler<
|
|
3115
|
-
* @param {EventHandler<
|
|
3118
|
+
* @param {EventHandler<StreamChatGenerics> | EventTypes} callbackOrString The event type to listen for (optional)
|
|
3119
|
+
* @param {EventHandler<StreamChatGenerics>} [callbackOrNothing] The callback to call
|
|
3116
3120
|
*/
|
|
3117
3121
|
|
|
3118
3122
|
}, {
|
|
@@ -3938,7 +3942,6 @@ var StableWSConnection = /*#__PURE__*/function () {
|
|
|
3938
3942
|
_this.isHealthy = healthy;
|
|
3939
3943
|
|
|
3940
3944
|
if (_this.isHealthy) {
|
|
3941
|
-
//@ts-expect-error
|
|
3942
3945
|
_this.client.dispatchEvent({
|
|
3943
3946
|
type: 'connection.changed',
|
|
3944
3947
|
online: _this.isHealthy
|
|
@@ -3949,7 +3952,7 @@ var StableWSConnection = /*#__PURE__*/function () {
|
|
|
3949
3952
|
|
|
3950
3953
|
|
|
3951
3954
|
setTimeout(function () {
|
|
3952
|
-
if (_this.isHealthy) return;
|
|
3955
|
+
if (_this.isHealthy) return;
|
|
3953
3956
|
|
|
3954
3957
|
_this.client.dispatchEvent({
|
|
3955
3958
|
type: 'connection.changed',
|
|
@@ -4917,7 +4920,7 @@ function TokenManager(secret) {
|
|
|
4917
4920
|
* Token provider should return a token string or a promise which resolves to string token.
|
|
4918
4921
|
*
|
|
4919
4922
|
* @param {TokenOrProvider} tokenOrProvider
|
|
4920
|
-
* @param {UserResponse<
|
|
4923
|
+
* @param {UserResponse<StreamChatGenerics>} user
|
|
4921
4924
|
*/
|
|
4922
4925
|
;
|
|
4923
4926
|
|
|
@@ -5305,7 +5308,9 @@ var WSConnectionFallback = /*#__PURE__*/function () {
|
|
|
5305
5308
|
|
|
5306
5309
|
_this._setState(ConnectionState.Connected);
|
|
5307
5310
|
|
|
5308
|
-
_this.connectionID = event.connection_id;
|
|
5311
|
+
_this.connectionID = event.connection_id; // @ts-expect-error
|
|
5312
|
+
|
|
5313
|
+
_this.client.dispatchEvent(event);
|
|
5309
5314
|
|
|
5310
5315
|
_this._poll();
|
|
5311
5316
|
|
|
@@ -5315,20 +5320,20 @@ var WSConnectionFallback = /*#__PURE__*/function () {
|
|
|
5315
5320
|
|
|
5316
5321
|
return _context3.abrupt("return", event);
|
|
5317
5322
|
|
|
5318
|
-
case
|
|
5319
|
-
_context3.prev =
|
|
5323
|
+
case 22:
|
|
5324
|
+
_context3.prev = 22;
|
|
5320
5325
|
_context3.t0 = _context3["catch"](9);
|
|
5321
5326
|
|
|
5322
5327
|
_this._setState(ConnectionState.Closed);
|
|
5323
5328
|
|
|
5324
5329
|
throw _context3.t0;
|
|
5325
5330
|
|
|
5326
|
-
case
|
|
5331
|
+
case 26:
|
|
5327
5332
|
case "end":
|
|
5328
5333
|
return _context3.stop();
|
|
5329
5334
|
}
|
|
5330
5335
|
}
|
|
5331
|
-
}, _callee3, null, [[9,
|
|
5336
|
+
}, _callee3, null, [[9, 22]]);
|
|
5332
5337
|
})));
|
|
5333
5338
|
|
|
5334
5339
|
_defineProperty__default['default'](this, "isHealthy", function () {
|
|
@@ -5407,7 +5412,6 @@ var WSConnectionFallback = /*#__PURE__*/function () {
|
|
|
5407
5412
|
|
|
5408
5413
|
|
|
5409
5414
|
if (this.state === ConnectionState.Connecting && state === ConnectionState.Connected) {
|
|
5410
|
-
//@ts-expect-error
|
|
5411
5415
|
this.client.dispatchEvent({
|
|
5412
5416
|
type: 'connection.changed',
|
|
5413
5417
|
online: true
|
|
@@ -5415,7 +5419,6 @@ var WSConnectionFallback = /*#__PURE__*/function () {
|
|
|
5415
5419
|
}
|
|
5416
5420
|
|
|
5417
5421
|
if (state === ConnectionState.Closed || state === ConnectionState.Disconnected) {
|
|
5418
|
-
//@ts-expect-error
|
|
5419
5422
|
this.client.dispatchEvent({
|
|
5420
5423
|
type: 'connection.changed',
|
|
5421
5424
|
online: false
|
|
@@ -6708,9 +6711,9 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6708
6711
|
/**
|
|
6709
6712
|
* setGuestUser - Setup a temporary guest user
|
|
6710
6713
|
*
|
|
6711
|
-
* @param {UserResponse<
|
|
6714
|
+
* @param {UserResponse<StreamChatGenerics>} user Data about this user. IE {name: "john"}
|
|
6712
6715
|
*
|
|
6713
|
-
* @return {ConnectAPIResponse<
|
|
6716
|
+
* @return {ConnectAPIResponse<StreamChatGenerics>} Returns a promise that resolves when the connection is setup
|
|
6714
6717
|
*/
|
|
6715
6718
|
function () {
|
|
6716
6719
|
var _setGuestUser = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee14(user) {
|
|
@@ -6798,8 +6801,8 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6798
6801
|
* or
|
|
6799
6802
|
* client.on(event => {console.log(event.type)})
|
|
6800
6803
|
*
|
|
6801
|
-
* @param {EventHandler<
|
|
6802
|
-
* @param {EventHandler<
|
|
6804
|
+
* @param {EventHandler<StreamChatGenerics> | string} callbackOrString The event type to listen for (optional)
|
|
6805
|
+
* @param {EventHandler<StreamChatGenerics>} [callbackOrNothing] The callback to call
|
|
6803
6806
|
*
|
|
6804
6807
|
* @return {{ unsubscribe: () => void }} Description
|
|
6805
6808
|
*/
|
|
@@ -7016,6 +7019,13 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7016
7019
|
this.mutedUsers = event.me.mutes;
|
|
7017
7020
|
}
|
|
7018
7021
|
|
|
7022
|
+
if (event.type === 'notification.mark_read') {
|
|
7023
|
+
var activeChannelKeys = Object.keys(this.activeChannels);
|
|
7024
|
+
activeChannelKeys.forEach(function (activeChannelKey) {
|
|
7025
|
+
return _this3.activeChannels[activeChannelKey].state.unreadCount = 0;
|
|
7026
|
+
});
|
|
7027
|
+
}
|
|
7028
|
+
|
|
7019
7029
|
if ((event.type === 'channel.deleted' || event.type === 'notification.channel_deleted') && event.cid) {
|
|
7020
7030
|
var _this$activeChannels$;
|
|
7021
7031
|
|
|
@@ -7134,8 +7144,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7134
7144
|
|
|
7135
7145
|
this.logger('info', 'client:connect() - WS failed, fallback to longpoll', {
|
|
7136
7146
|
tags: ['connection', 'client']
|
|
7137
|
-
});
|
|
7138
|
-
|
|
7147
|
+
});
|
|
7139
7148
|
this.dispatchEvent({
|
|
7140
7149
|
type: 'transport.changed',
|
|
7141
7150
|
mode: 'longpoll'
|
|
@@ -7201,12 +7210,12 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7201
7210
|
/**
|
|
7202
7211
|
* queryUsers - Query users and watch user presence
|
|
7203
7212
|
*
|
|
7204
|
-
* @param {UserFilters<
|
|
7205
|
-
* @param {UserSort<
|
|
7213
|
+
* @param {UserFilters<StreamChatGenerics>} filterConditions MongoDB style filter conditions
|
|
7214
|
+
* @param {UserSort<StreamChatGenerics>} sort Sort options, for instance [{last_active: -1}].
|
|
7206
7215
|
* When using multiple fields, make sure you use array of objects to guarantee field order, for instance [{last_active: -1}, {created_at: 1}]
|
|
7207
7216
|
* @param {UserOptions} options Option object, {presence: true}
|
|
7208
7217
|
*
|
|
7209
|
-
* @return {Promise<
|
|
7218
|
+
* @return {Promise<{ users: Array<UserResponse<StreamChatGenerics>> }>} User Query Response
|
|
7210
7219
|
*/
|
|
7211
7220
|
|
|
7212
7221
|
}, {
|
|
@@ -7271,7 +7280,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7271
7280
|
* @param {BannedUsersSort} sort Sort options [{created_at: 1}].
|
|
7272
7281
|
* @param {BannedUsersPaginationOptions} options Option object, {limit: 10, offset:0}
|
|
7273
7282
|
*
|
|
7274
|
-
* @return {Promise<BannedUsersResponse<
|
|
7283
|
+
* @return {Promise<BannedUsersResponse<StreamChatGenerics>>} Ban Query Response
|
|
7275
7284
|
*/
|
|
7276
7285
|
|
|
7277
7286
|
}, {
|
|
@@ -7320,7 +7329,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7320
7329
|
* @param {MessageFlagsFilters} filterConditions MongoDB style filter conditions
|
|
7321
7330
|
* @param {MessageFlagsPaginationOptions} options Option object, {limit: 10, offset:0}
|
|
7322
7331
|
*
|
|
7323
|
-
* @return {Promise<MessageFlagsResponse<
|
|
7332
|
+
* @return {Promise<MessageFlagsResponse<StreamChatGenerics>>} Message Flags Response
|
|
7324
7333
|
*/
|
|
7325
7334
|
|
|
7326
7335
|
}, {
|
|
@@ -7363,14 +7372,14 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7363
7372
|
/**
|
|
7364
7373
|
* queryChannels - Query channels
|
|
7365
7374
|
*
|
|
7366
|
-
* @param {ChannelFilters<
|
|
7367
|
-
* @param {ChannelSort<
|
|
7375
|
+
* @param {ChannelFilters<StreamChatGenerics>} filterConditions object MongoDB style filters
|
|
7376
|
+
* @param {ChannelSort<StreamChatGenerics>} [sort] Sort options, for instance {created_at: -1}.
|
|
7368
7377
|
* When using multiple fields, make sure you use array of objects to guarantee field order, for instance [{last_updated: -1}, {created_at: 1}]
|
|
7369
7378
|
* @param {ChannelOptions} [options] Options object
|
|
7370
7379
|
* @param {ChannelStateOptions} [stateOptions] State options object. These options will only be used for state management and won't be sent in the request.
|
|
7371
7380
|
* - stateOptions.skipInitialization - Skips the initialization of the state for the channels matching the ids in the list.
|
|
7372
7381
|
*
|
|
7373
|
-
* @return {Promise<
|
|
7382
|
+
* @return {Promise<{ channels: Array<ChannelAPIResponse<AStreamChatGenerics>>}> } search channels response
|
|
7374
7383
|
*/
|
|
7375
7384
|
|
|
7376
7385
|
}, {
|
|
@@ -7486,11 +7495,11 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7486
7495
|
/**
|
|
7487
7496
|
* search - Query messages
|
|
7488
7497
|
*
|
|
7489
|
-
* @param {ChannelFilters<
|
|
7490
|
-
* @param {MessageFilters<
|
|
7491
|
-
* @param {SearchOptions<
|
|
7498
|
+
* @param {ChannelFilters<StreamChatGenerics>} filterConditions MongoDB style filter conditions
|
|
7499
|
+
* @param {MessageFilters<StreamChatGenerics> | string} query search query or object MongoDB style filters
|
|
7500
|
+
* @param {SearchOptions<StreamChatGenerics>} [options] Option object, {user_id: 'tommaso'}
|
|
7492
7501
|
*
|
|
7493
|
-
* @return {Promise<SearchAPIResponse<
|
|
7502
|
+
* @return {Promise<SearchAPIResponse<StreamChatGenerics>>} search messages response
|
|
7494
7503
|
*/
|
|
7495
7504
|
|
|
7496
7505
|
}, {
|
|
@@ -7634,7 +7643,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7634
7643
|
*
|
|
7635
7644
|
* @param {string} [userID] User ID. Only works on serverside
|
|
7636
7645
|
*
|
|
7637
|
-
* @return {
|
|
7646
|
+
* @return {Device<StreamChatGenerics>[]} Array of devices
|
|
7638
7647
|
*/
|
|
7639
7648
|
|
|
7640
7649
|
}, {
|
|
@@ -7762,7 +7771,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7762
7771
|
* await channel.create() to assign an ID to channel
|
|
7763
7772
|
*
|
|
7764
7773
|
* @param {string} channelType The channel type
|
|
7765
|
-
* @param {string | ChannelData<
|
|
7774
|
+
* @param {string | ChannelData<StreamChatGenerics> | null} [channelIDOrCustom] The channel ID, you can leave this out if you want to create a conversation channel
|
|
7766
7775
|
* @param {object} [custom] Custom data to attach to the channel
|
|
7767
7776
|
*
|
|
7768
7777
|
* @return {channel} The channel object, initialize it using channel.watch()
|
|
@@ -7818,10 +7827,10 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7818
7827
|
/**
|
|
7819
7828
|
* partialUpdateUser - Update the given user object
|
|
7820
7829
|
*
|
|
7821
|
-
* @param {PartialUserUpdate<
|
|
7830
|
+
* @param {PartialUserUpdate<StreamChatGenerics>} partialUserObject which should contain id and any of "set" or "unset" params;
|
|
7822
7831
|
* example: {id: "user1", set:{field: value}, unset:["field2"]}
|
|
7823
7832
|
*
|
|
7824
|
-
* @return {Promise<
|
|
7833
|
+
* @return {Promise<{ users: { [key: string]: UserResponse<StreamChatGenerics> } }>} list of updated users
|
|
7825
7834
|
*/
|
|
7826
7835
|
function () {
|
|
7827
7836
|
var _partialUpdateUser = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee25(partialUserObject) {
|
|
@@ -7852,9 +7861,9 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7852
7861
|
/**
|
|
7853
7862
|
* upsertUsers - Batch upsert the list of users
|
|
7854
7863
|
*
|
|
7855
|
-
* @param {UserResponse<
|
|
7864
|
+
* @param {UserResponse<StreamChatGenerics>[]} users list of users
|
|
7856
7865
|
*
|
|
7857
|
-
* @return {Promise<
|
|
7866
|
+
* @return {Promise<{ users: { [key: string]: UserResponse<StreamChatGenerics> } }>}
|
|
7858
7867
|
*/
|
|
7859
7868
|
|
|
7860
7869
|
}, {
|
|
@@ -7940,8 +7949,8 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7940
7949
|
*
|
|
7941
7950
|
* updateUsers - Batch update the list of users
|
|
7942
7951
|
*
|
|
7943
|
-
* @param {UserResponse<
|
|
7944
|
-
* @return {Promise<
|
|
7952
|
+
* @param {UserResponse<StreamChatGenerics>[]} users list of users
|
|
7953
|
+
* @return {Promise<{ users: { [key: string]: UserResponse<StreamChatGenerics> } }>}
|
|
7945
7954
|
*/
|
|
7946
7955
|
|
|
7947
7956
|
}, {
|
|
@@ -7950,9 +7959,9 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7950
7959
|
/**
|
|
7951
7960
|
* upsertUser - Update or Create the given user object
|
|
7952
7961
|
*
|
|
7953
|
-
* @param {UserResponse<
|
|
7962
|
+
* @param {UserResponse<StreamChatGenerics>} userObject user object, the only required field is the user id. IE {id: "myuser"} is valid
|
|
7954
7963
|
*
|
|
7955
|
-
* @return {Promise<
|
|
7964
|
+
* @return {Promise<{ users: { [key: string]: UserResponse<StreamChatGenerics> } }>}
|
|
7956
7965
|
*/
|
|
7957
7966
|
function upsertUser(userObject) {
|
|
7958
7967
|
return this.upsertUsers([userObject]);
|
|
@@ -7962,8 +7971,8 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7962
7971
|
*
|
|
7963
7972
|
* updateUser - Update or Create the given user object
|
|
7964
7973
|
*
|
|
7965
|
-
* @param {UserResponse<
|
|
7966
|
-
* @return {Promise<
|
|
7974
|
+
* @param {UserResponse<StreamChatGenerics>} userObject user object, the only required field is the user id. IE {id: "myuser"} is valid
|
|
7975
|
+
* @return {Promise<{ users: { [key: string]: UserResponse<StreamChatGenerics> } }>}
|
|
7967
7976
|
*/
|
|
7968
7977
|
|
|
7969
7978
|
}, {
|
|
@@ -7972,9 +7981,9 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7972
7981
|
/**
|
|
7973
7982
|
* partialUpdateUsers - Batch partial update of users
|
|
7974
7983
|
*
|
|
7975
|
-
* @param {PartialUserUpdate<
|
|
7984
|
+
* @param {PartialUserUpdate<StreamChatGenerics>[]} users list of partial update requests
|
|
7976
7985
|
*
|
|
7977
|
-
* @return {Promise<
|
|
7986
|
+
* @return {Promise<{ users: { [key: string]: UserResponse<StreamChatGenerics> } }>}
|
|
7978
7987
|
*/
|
|
7979
7988
|
function () {
|
|
7980
7989
|
var _partialUpdateUsers = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee27(users) {
|
|
@@ -8163,7 +8172,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8163
8172
|
/** banUser - bans a user from all channels
|
|
8164
8173
|
*
|
|
8165
8174
|
* @param {string} targetUserID
|
|
8166
|
-
* @param {BanUserOptions<
|
|
8175
|
+
* @param {BanUserOptions<StreamChatGenerics>} [options]
|
|
8167
8176
|
* @returns {Promise<APIResponse>}
|
|
8168
8177
|
*/
|
|
8169
8178
|
|
|
@@ -8237,7 +8246,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8237
8246
|
/** shadowBan - shadow bans a user from all channels
|
|
8238
8247
|
*
|
|
8239
8248
|
* @param {string} targetUserID
|
|
8240
|
-
* @param {BanUserOptions<
|
|
8249
|
+
* @param {BanUserOptions<StreamChatGenerics>} [options]
|
|
8241
8250
|
* @returns {Promise<APIResponse>}
|
|
8242
8251
|
*/
|
|
8243
8252
|
|
|
@@ -8312,8 +8321,8 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8312
8321
|
*
|
|
8313
8322
|
* @param {string} targetID
|
|
8314
8323
|
* @param {string} [userID] Only used with serverside auth
|
|
8315
|
-
* @param {MuteUserOptions<
|
|
8316
|
-
* @returns {Promise<MuteUserResponse<
|
|
8324
|
+
* @param {MuteUserOptions<StreamChatGenerics>} [options]
|
|
8325
|
+
* @returns {Promise<MuteUserResponse<StreamChatGenerics>>}
|
|
8317
8326
|
*/
|
|
8318
8327
|
|
|
8319
8328
|
}, {
|
|
@@ -8570,23 +8579,23 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8570
8579
|
return unflagUser;
|
|
8571
8580
|
}()
|
|
8572
8581
|
/**
|
|
8573
|
-
*
|
|
8582
|
+
* _queryFlags - Query flags.
|
|
8574
8583
|
*
|
|
8575
8584
|
* Note: Do not use this.
|
|
8576
8585
|
* It is present for internal usage only.
|
|
8577
8586
|
* This function can, and will, break and/or be removed at any point in time.
|
|
8578
8587
|
*
|
|
8579
8588
|
* @private
|
|
8580
|
-
* @param {
|
|
8581
|
-
* @param {
|
|
8589
|
+
* @param {FlagsFilters} filterConditions MongoDB style filter conditions
|
|
8590
|
+
* @param {FlagsPaginationOptions} options Option object, {limit: 10, offset:0}
|
|
8582
8591
|
*
|
|
8583
|
-
* @return {Promise<
|
|
8592
|
+
* @return {Promise<FlagsResponse<StreamChatGenerics>>} Flags Response
|
|
8584
8593
|
*/
|
|
8585
8594
|
|
|
8586
8595
|
}, {
|
|
8587
|
-
key: "
|
|
8596
|
+
key: "_queryFlags",
|
|
8588
8597
|
value: function () {
|
|
8589
|
-
var
|
|
8598
|
+
var _queryFlags2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee42() {
|
|
8590
8599
|
var filterConditions,
|
|
8591
8600
|
options,
|
|
8592
8601
|
_args42 = arguments;
|
|
@@ -8597,7 +8606,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8597
8606
|
filterConditions = _args42.length > 0 && _args42[0] !== undefined ? _args42[0] : {};
|
|
8598
8607
|
options = _args42.length > 1 && _args42[1] !== undefined ? _args42[1] : {};
|
|
8599
8608
|
_context42.next = 4;
|
|
8600
|
-
return this.post(this.baseURL + '/moderation/
|
|
8609
|
+
return this.post(this.baseURL + '/moderation/flags', _objectSpread({
|
|
8601
8610
|
filter_conditions: filterConditions
|
|
8602
8611
|
}, options));
|
|
8603
8612
|
|
|
@@ -8612,6 +8621,55 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8612
8621
|
}, _callee42, this);
|
|
8613
8622
|
}));
|
|
8614
8623
|
|
|
8624
|
+
function _queryFlags() {
|
|
8625
|
+
return _queryFlags2.apply(this, arguments);
|
|
8626
|
+
}
|
|
8627
|
+
|
|
8628
|
+
return _queryFlags;
|
|
8629
|
+
}()
|
|
8630
|
+
/**
|
|
8631
|
+
* _queryFlagReports - Query flag reports.
|
|
8632
|
+
*
|
|
8633
|
+
* Note: Do not use this.
|
|
8634
|
+
* It is present for internal usage only.
|
|
8635
|
+
* This function can, and will, break and/or be removed at any point in time.
|
|
8636
|
+
*
|
|
8637
|
+
* @private
|
|
8638
|
+
* @param {FlagReportsFilters} filterConditions MongoDB style filter conditions
|
|
8639
|
+
* @param {FlagReportsPaginationOptions} options Option object, {limit: 10, offset:0}
|
|
8640
|
+
*
|
|
8641
|
+
* @return {Promise<FlagReportsResponse<StreamChatGenerics>>} Flag Reports Response
|
|
8642
|
+
*/
|
|
8643
|
+
|
|
8644
|
+
}, {
|
|
8645
|
+
key: "_queryFlagReports",
|
|
8646
|
+
value: function () {
|
|
8647
|
+
var _queryFlagReports2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee43() {
|
|
8648
|
+
var filterConditions,
|
|
8649
|
+
options,
|
|
8650
|
+
_args43 = arguments;
|
|
8651
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee43$(_context43) {
|
|
8652
|
+
while (1) {
|
|
8653
|
+
switch (_context43.prev = _context43.next) {
|
|
8654
|
+
case 0:
|
|
8655
|
+
filterConditions = _args43.length > 0 && _args43[0] !== undefined ? _args43[0] : {};
|
|
8656
|
+
options = _args43.length > 1 && _args43[1] !== undefined ? _args43[1] : {};
|
|
8657
|
+
_context43.next = 4;
|
|
8658
|
+
return this.post(this.baseURL + '/moderation/reports', _objectSpread({
|
|
8659
|
+
filter_conditions: filterConditions
|
|
8660
|
+
}, options));
|
|
8661
|
+
|
|
8662
|
+
case 4:
|
|
8663
|
+
return _context43.abrupt("return", _context43.sent);
|
|
8664
|
+
|
|
8665
|
+
case 5:
|
|
8666
|
+
case "end":
|
|
8667
|
+
return _context43.stop();
|
|
8668
|
+
}
|
|
8669
|
+
}
|
|
8670
|
+
}, _callee43, this);
|
|
8671
|
+
}));
|
|
8672
|
+
|
|
8615
8673
|
function _queryFlagReports() {
|
|
8616
8674
|
return _queryFlagReports2.apply(this, arguments);
|
|
8617
8675
|
}
|
|
@@ -8636,28 +8694,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8636
8694
|
}, {
|
|
8637
8695
|
key: "_reviewFlagReport",
|
|
8638
8696
|
value: function () {
|
|
8639
|
-
var _reviewFlagReport2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
8697
|
+
var _reviewFlagReport2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee44(id, reviewResult) {
|
|
8640
8698
|
var options,
|
|
8641
|
-
|
|
8642
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
8699
|
+
_args44 = arguments;
|
|
8700
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee44$(_context44) {
|
|
8643
8701
|
while (1) {
|
|
8644
|
-
switch (
|
|
8702
|
+
switch (_context44.prev = _context44.next) {
|
|
8645
8703
|
case 0:
|
|
8646
|
-
options =
|
|
8647
|
-
|
|
8704
|
+
options = _args44.length > 2 && _args44[2] !== undefined ? _args44[2] : {};
|
|
8705
|
+
_context44.next = 3;
|
|
8648
8706
|
return this.patch(this.baseURL + "/moderation/reports/".concat(id), _objectSpread({
|
|
8649
8707
|
review_result: reviewResult
|
|
8650
8708
|
}, options));
|
|
8651
8709
|
|
|
8652
8710
|
case 3:
|
|
8653
|
-
return
|
|
8711
|
+
return _context44.abrupt("return", _context44.sent);
|
|
8654
8712
|
|
|
8655
8713
|
case 4:
|
|
8656
8714
|
case "end":
|
|
8657
|
-
return
|
|
8715
|
+
return _context44.stop();
|
|
8658
8716
|
}
|
|
8659
8717
|
}
|
|
8660
|
-
},
|
|
8718
|
+
}, _callee44, this);
|
|
8661
8719
|
}));
|
|
8662
8720
|
|
|
8663
8721
|
function _reviewFlagReport(_x54, _x55) {
|
|
@@ -8682,28 +8740,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8682
8740
|
}, {
|
|
8683
8741
|
key: "_unblockMessage",
|
|
8684
8742
|
value: function () {
|
|
8685
|
-
var _unblockMessage2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
8743
|
+
var _unblockMessage2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee45(targetMessageID) {
|
|
8686
8744
|
var options,
|
|
8687
|
-
|
|
8688
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
8745
|
+
_args45 = arguments;
|
|
8746
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee45$(_context45) {
|
|
8689
8747
|
while (1) {
|
|
8690
|
-
switch (
|
|
8748
|
+
switch (_context45.prev = _context45.next) {
|
|
8691
8749
|
case 0:
|
|
8692
|
-
options =
|
|
8693
|
-
|
|
8750
|
+
options = _args45.length > 1 && _args45[1] !== undefined ? _args45[1] : {};
|
|
8751
|
+
_context45.next = 3;
|
|
8694
8752
|
return this.post(this.baseURL + '/moderation/unblock_message', _objectSpread({
|
|
8695
8753
|
target_message_id: targetMessageID
|
|
8696
8754
|
}, options));
|
|
8697
8755
|
|
|
8698
8756
|
case 3:
|
|
8699
|
-
return
|
|
8757
|
+
return _context45.abrupt("return", _context45.sent);
|
|
8700
8758
|
|
|
8701
8759
|
case 4:
|
|
8702
8760
|
case "end":
|
|
8703
|
-
return
|
|
8761
|
+
return _context45.stop();
|
|
8704
8762
|
}
|
|
8705
8763
|
}
|
|
8706
|
-
},
|
|
8764
|
+
}, _callee45, this);
|
|
8707
8765
|
}));
|
|
8708
8766
|
|
|
8709
8767
|
function _unblockMessage(_x56) {
|
|
@@ -8716,7 +8774,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8716
8774
|
* @deprecated use markChannelsRead instead
|
|
8717
8775
|
*
|
|
8718
8776
|
* markAllRead - marks all channels for this user as read
|
|
8719
|
-
* @param {MarkAllReadOptions<
|
|
8777
|
+
* @param {MarkAllReadOptions<StreamChatGenerics>} [data]
|
|
8720
8778
|
*
|
|
8721
8779
|
* @return {Promise<APIResponse>}
|
|
8722
8780
|
*/
|
|
@@ -8728,28 +8786,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8728
8786
|
* markChannelsRead - marks channels read -
|
|
8729
8787
|
* it accepts a map of cid:messageid pairs, if messageid is empty, the whole channel will be marked as read
|
|
8730
8788
|
*
|
|
8731
|
-
* @param {MarkChannelsReadOptions <
|
|
8789
|
+
* @param {MarkChannelsReadOptions <StreamChatGenerics>} [data]
|
|
8732
8790
|
*
|
|
8733
8791
|
* @return {Promise<APIResponse>}
|
|
8734
8792
|
*/
|
|
8735
8793
|
function () {
|
|
8736
|
-
var _markChannelsRead = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
8794
|
+
var _markChannelsRead = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee46() {
|
|
8737
8795
|
var data,
|
|
8738
|
-
|
|
8739
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
8796
|
+
_args46 = arguments;
|
|
8797
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee46$(_context46) {
|
|
8740
8798
|
while (1) {
|
|
8741
|
-
switch (
|
|
8799
|
+
switch (_context46.prev = _context46.next) {
|
|
8742
8800
|
case 0:
|
|
8743
|
-
data =
|
|
8744
|
-
|
|
8801
|
+
data = _args46.length > 0 && _args46[0] !== undefined ? _args46[0] : {};
|
|
8802
|
+
_context46.next = 3;
|
|
8745
8803
|
return this.post(this.baseURL + '/channels/read', _objectSpread({}, data));
|
|
8746
8804
|
|
|
8747
8805
|
case 3:
|
|
8748
8806
|
case "end":
|
|
8749
|
-
return
|
|
8807
|
+
return _context46.stop();
|
|
8750
8808
|
}
|
|
8751
8809
|
}
|
|
8752
|
-
},
|
|
8810
|
+
}, _callee46, this);
|
|
8753
8811
|
}));
|
|
8754
8812
|
|
|
8755
8813
|
function markChannelsRead() {
|
|
@@ -8818,31 +8876,31 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8818
8876
|
* @param {string} messageId
|
|
8819
8877
|
* @param {string} language
|
|
8820
8878
|
*
|
|
8821
|
-
* @return {
|
|
8879
|
+
* @return {MessageResponse<StreamChatGenerics>} Response that includes the message
|
|
8822
8880
|
*/
|
|
8823
8881
|
|
|
8824
8882
|
}, {
|
|
8825
8883
|
key: "translateMessage",
|
|
8826
8884
|
value: function () {
|
|
8827
|
-
var _translateMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
8828
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
8885
|
+
var _translateMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee47(messageId, language) {
|
|
8886
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee47$(_context47) {
|
|
8829
8887
|
while (1) {
|
|
8830
|
-
switch (
|
|
8888
|
+
switch (_context47.prev = _context47.next) {
|
|
8831
8889
|
case 0:
|
|
8832
|
-
|
|
8890
|
+
_context47.next = 2;
|
|
8833
8891
|
return this.post(this.baseURL + "/messages/".concat(messageId, "/translate"), {
|
|
8834
8892
|
language: language
|
|
8835
8893
|
});
|
|
8836
8894
|
|
|
8837
8895
|
case 2:
|
|
8838
|
-
return
|
|
8896
|
+
return _context47.abrupt("return", _context47.sent);
|
|
8839
8897
|
|
|
8840
8898
|
case 3:
|
|
8841
8899
|
case "end":
|
|
8842
|
-
return
|
|
8900
|
+
return _context47.stop();
|
|
8843
8901
|
}
|
|
8844
8902
|
}
|
|
8845
|
-
},
|
|
8903
|
+
}, _callee47, this);
|
|
8846
8904
|
}));
|
|
8847
8905
|
|
|
8848
8906
|
function translateMessage(_x57, _x58) {
|
|
@@ -8937,24 +8995,24 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8937
8995
|
/**
|
|
8938
8996
|
* updateMessage - Update the given message
|
|
8939
8997
|
*
|
|
8940
|
-
* @param {Omit<MessageResponse<
|
|
8998
|
+
* @param {Omit<MessageResponse<StreamChatGenerics>, 'mentioned_users'> & { mentioned_users?: string[] }} message object, id needs to be specified
|
|
8941
8999
|
* @param {string | { id: string }} [userId]
|
|
8942
9000
|
* @param {boolean} [options.skip_enrich_url] Do not try to enrich the URLs within message
|
|
8943
9001
|
*
|
|
8944
|
-
* @return {
|
|
9002
|
+
* @return {{ message: MessageResponse<StreamChatGenerics> }} Response that includes the message
|
|
8945
9003
|
*/
|
|
8946
9004
|
|
|
8947
9005
|
}, {
|
|
8948
9006
|
key: "updateMessage",
|
|
8949
9007
|
value: function () {
|
|
8950
|
-
var _updateMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9008
|
+
var _updateMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee48(message, userId, options) {
|
|
8951
9009
|
var clonedMessage, reservedMessageFields;
|
|
8952
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9010
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee48$(_context48) {
|
|
8953
9011
|
while (1) {
|
|
8954
|
-
switch (
|
|
9012
|
+
switch (_context48.prev = _context48.next) {
|
|
8955
9013
|
case 0:
|
|
8956
9014
|
if (message.id) {
|
|
8957
|
-
|
|
9015
|
+
_context48.next = 2;
|
|
8958
9016
|
break;
|
|
8959
9017
|
}
|
|
8960
9018
|
|
|
@@ -8991,20 +9049,20 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8991
9049
|
});
|
|
8992
9050
|
}
|
|
8993
9051
|
|
|
8994
|
-
|
|
9052
|
+
_context48.next = 10;
|
|
8995
9053
|
return this.post(this.baseURL + "/messages/".concat(message.id), _objectSpread({
|
|
8996
9054
|
message: clonedMessage
|
|
8997
9055
|
}, options));
|
|
8998
9056
|
|
|
8999
9057
|
case 10:
|
|
9000
|
-
return
|
|
9058
|
+
return _context48.abrupt("return", _context48.sent);
|
|
9001
9059
|
|
|
9002
9060
|
case 11:
|
|
9003
9061
|
case "end":
|
|
9004
|
-
return
|
|
9062
|
+
return _context48.stop();
|
|
9005
9063
|
}
|
|
9006
9064
|
}
|
|
9007
|
-
},
|
|
9065
|
+
}, _callee48, this);
|
|
9008
9066
|
}));
|
|
9009
9067
|
|
|
9010
9068
|
function updateMessage(_x59, _x60, _x61) {
|
|
@@ -9018,26 +9076,26 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9018
9076
|
*
|
|
9019
9077
|
* @param {string} id the message id
|
|
9020
9078
|
*
|
|
9021
|
-
* @param {PartialUpdateMessage<
|
|
9079
|
+
* @param {PartialUpdateMessage<StreamChatGenerics>} partialMessageObject which should contain id and any of "set" or "unset" params;
|
|
9022
9080
|
* example: {id: "user1", set:{text: "hi"}, unset:["color"]}
|
|
9023
9081
|
* @param {string | { id: string }} [userId]
|
|
9024
9082
|
*
|
|
9025
9083
|
* @param {boolean} [options.skip_enrich_url] Do not try to enrich the URLs within message
|
|
9026
9084
|
*
|
|
9027
|
-
* @return {
|
|
9085
|
+
* @return {{ message: MessageResponse<StreamChatGenerics> }} Response that includes the updated message
|
|
9028
9086
|
*/
|
|
9029
9087
|
|
|
9030
9088
|
}, {
|
|
9031
9089
|
key: "partialUpdateMessage",
|
|
9032
9090
|
value: function () {
|
|
9033
|
-
var _partialUpdateMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9091
|
+
var _partialUpdateMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee49(id, partialMessageObject, userId, options) {
|
|
9034
9092
|
var user;
|
|
9035
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9093
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee49$(_context49) {
|
|
9036
9094
|
while (1) {
|
|
9037
|
-
switch (
|
|
9095
|
+
switch (_context49.prev = _context49.next) {
|
|
9038
9096
|
case 0:
|
|
9039
9097
|
if (id) {
|
|
9040
|
-
|
|
9098
|
+
_context49.next = 2;
|
|
9041
9099
|
break;
|
|
9042
9100
|
}
|
|
9043
9101
|
|
|
@@ -9052,20 +9110,20 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9052
9110
|
};
|
|
9053
9111
|
}
|
|
9054
9112
|
|
|
9055
|
-
|
|
9113
|
+
_context49.next = 6;
|
|
9056
9114
|
return this.put(this.baseURL + "/messages/".concat(id), _objectSpread(_objectSpread(_objectSpread({}, partialMessageObject), options), {}, {
|
|
9057
9115
|
user: user
|
|
9058
9116
|
}));
|
|
9059
9117
|
|
|
9060
9118
|
case 6:
|
|
9061
|
-
return
|
|
9119
|
+
return _context49.abrupt("return", _context49.sent);
|
|
9062
9120
|
|
|
9063
9121
|
case 7:
|
|
9064
9122
|
case "end":
|
|
9065
|
-
return
|
|
9123
|
+
return _context49.stop();
|
|
9066
9124
|
}
|
|
9067
9125
|
}
|
|
9068
|
-
},
|
|
9126
|
+
}, _callee49, this);
|
|
9069
9127
|
}));
|
|
9070
9128
|
|
|
9071
9129
|
function partialUpdateMessage(_x62, _x63, _x64, _x65) {
|
|
@@ -9077,11 +9135,11 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9077
9135
|
}, {
|
|
9078
9136
|
key: "deleteMessage",
|
|
9079
9137
|
value: function () {
|
|
9080
|
-
var _deleteMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9138
|
+
var _deleteMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee50(messageID, hardDelete) {
|
|
9081
9139
|
var params;
|
|
9082
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9140
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee50$(_context50) {
|
|
9083
9141
|
while (1) {
|
|
9084
|
-
switch (
|
|
9142
|
+
switch (_context50.prev = _context50.next) {
|
|
9085
9143
|
case 0:
|
|
9086
9144
|
params = {};
|
|
9087
9145
|
|
|
@@ -9091,18 +9149,18 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9091
9149
|
};
|
|
9092
9150
|
}
|
|
9093
9151
|
|
|
9094
|
-
|
|
9152
|
+
_context50.next = 4;
|
|
9095
9153
|
return this.delete(this.baseURL + "/messages/".concat(messageID), params);
|
|
9096
9154
|
|
|
9097
9155
|
case 4:
|
|
9098
|
-
return
|
|
9156
|
+
return _context50.abrupt("return", _context50.sent);
|
|
9099
9157
|
|
|
9100
9158
|
case 5:
|
|
9101
9159
|
case "end":
|
|
9102
|
-
return
|
|
9160
|
+
return _context50.stop();
|
|
9103
9161
|
}
|
|
9104
9162
|
}
|
|
9105
|
-
},
|
|
9163
|
+
}, _callee50, this);
|
|
9106
9164
|
}));
|
|
9107
9165
|
|
|
9108
9166
|
function deleteMessage(_x66, _x67) {
|
|
@@ -9114,23 +9172,23 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9114
9172
|
}, {
|
|
9115
9173
|
key: "getMessage",
|
|
9116
9174
|
value: function () {
|
|
9117
|
-
var _getMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9118
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9175
|
+
var _getMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee51(messageID) {
|
|
9176
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee51$(_context51) {
|
|
9119
9177
|
while (1) {
|
|
9120
|
-
switch (
|
|
9178
|
+
switch (_context51.prev = _context51.next) {
|
|
9121
9179
|
case 0:
|
|
9122
|
-
|
|
9180
|
+
_context51.next = 2;
|
|
9123
9181
|
return this.get(this.baseURL + "/messages/".concat(messageID));
|
|
9124
9182
|
|
|
9125
9183
|
case 2:
|
|
9126
|
-
return
|
|
9184
|
+
return _context51.abrupt("return", _context51.sent);
|
|
9127
9185
|
|
|
9128
9186
|
case 3:
|
|
9129
9187
|
case "end":
|
|
9130
|
-
return
|
|
9188
|
+
return _context51.stop();
|
|
9131
9189
|
}
|
|
9132
9190
|
}
|
|
9133
|
-
},
|
|
9191
|
+
}, _callee51, this);
|
|
9134
9192
|
}));
|
|
9135
9193
|
|
|
9136
9194
|
function getMessage(_x68) {
|
|
@@ -9142,7 +9200,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9142
9200
|
}, {
|
|
9143
9201
|
key: "getUserAgent",
|
|
9144
9202
|
value: function getUserAgent() {
|
|
9145
|
-
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "
|
|
9203
|
+
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "6.1.0");
|
|
9146
9204
|
}
|
|
9147
9205
|
}, {
|
|
9148
9206
|
key: "setUserAgent",
|
|
@@ -9337,25 +9395,25 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9337
9395
|
}, {
|
|
9338
9396
|
key: "sendUserCustomEvent",
|
|
9339
9397
|
value: function () {
|
|
9340
|
-
var _sendUserCustomEvent = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9341
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9398
|
+
var _sendUserCustomEvent = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee52(targetUserID, event) {
|
|
9399
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee52$(_context52) {
|
|
9342
9400
|
while (1) {
|
|
9343
|
-
switch (
|
|
9401
|
+
switch (_context52.prev = _context52.next) {
|
|
9344
9402
|
case 0:
|
|
9345
|
-
|
|
9403
|
+
_context52.next = 2;
|
|
9346
9404
|
return this.post("".concat(this.baseURL, "/users/").concat(targetUserID, "/event"), {
|
|
9347
9405
|
event: event
|
|
9348
9406
|
});
|
|
9349
9407
|
|
|
9350
9408
|
case 2:
|
|
9351
|
-
return
|
|
9409
|
+
return _context52.abrupt("return", _context52.sent);
|
|
9352
9410
|
|
|
9353
9411
|
case 3:
|
|
9354
9412
|
case "end":
|
|
9355
|
-
return
|
|
9413
|
+
return _context52.stop();
|
|
9356
9414
|
}
|
|
9357
9415
|
}
|
|
9358
|
-
},
|
|
9416
|
+
}, _callee52, this);
|
|
9359
9417
|
}));
|
|
9360
9418
|
|
|
9361
9419
|
function sendUserCustomEvent(_x69, _x70) {
|
|
@@ -9426,29 +9484,29 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9426
9484
|
}, {
|
|
9427
9485
|
key: "createSegment",
|
|
9428
9486
|
value: function () {
|
|
9429
|
-
var _createSegment = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9487
|
+
var _createSegment = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee53(params) {
|
|
9430
9488
|
var _yield$this$post, segment;
|
|
9431
9489
|
|
|
9432
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9490
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee53$(_context53) {
|
|
9433
9491
|
while (1) {
|
|
9434
|
-
switch (
|
|
9492
|
+
switch (_context53.prev = _context53.next) {
|
|
9435
9493
|
case 0:
|
|
9436
|
-
|
|
9494
|
+
_context53.next = 2;
|
|
9437
9495
|
return this.post(this.baseURL + "/segments", {
|
|
9438
9496
|
segment: params
|
|
9439
9497
|
});
|
|
9440
9498
|
|
|
9441
9499
|
case 2:
|
|
9442
|
-
_yield$this$post =
|
|
9500
|
+
_yield$this$post = _context53.sent;
|
|
9443
9501
|
segment = _yield$this$post.segment;
|
|
9444
|
-
return
|
|
9502
|
+
return _context53.abrupt("return", segment);
|
|
9445
9503
|
|
|
9446
9504
|
case 5:
|
|
9447
9505
|
case "end":
|
|
9448
|
-
return
|
|
9506
|
+
return _context53.stop();
|
|
9449
9507
|
}
|
|
9450
9508
|
}
|
|
9451
|
-
},
|
|
9509
|
+
}, _callee53, this);
|
|
9452
9510
|
}));
|
|
9453
9511
|
|
|
9454
9512
|
function createSegment(_x71) {
|
|
@@ -9468,27 +9526,27 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9468
9526
|
}, {
|
|
9469
9527
|
key: "getSegment",
|
|
9470
9528
|
value: function () {
|
|
9471
|
-
var _getSegment = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9529
|
+
var _getSegment = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee54(id) {
|
|
9472
9530
|
var _yield$this$get, segment;
|
|
9473
9531
|
|
|
9474
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9532
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee54$(_context54) {
|
|
9475
9533
|
while (1) {
|
|
9476
|
-
switch (
|
|
9534
|
+
switch (_context54.prev = _context54.next) {
|
|
9477
9535
|
case 0:
|
|
9478
|
-
|
|
9536
|
+
_context54.next = 2;
|
|
9479
9537
|
return this.get(this.baseURL + "/segments/".concat(id));
|
|
9480
9538
|
|
|
9481
9539
|
case 2:
|
|
9482
|
-
_yield$this$get =
|
|
9540
|
+
_yield$this$get = _context54.sent;
|
|
9483
9541
|
segment = _yield$this$get.segment;
|
|
9484
|
-
return
|
|
9542
|
+
return _context54.abrupt("return", segment);
|
|
9485
9543
|
|
|
9486
9544
|
case 5:
|
|
9487
9545
|
case "end":
|
|
9488
|
-
return
|
|
9546
|
+
return _context54.stop();
|
|
9489
9547
|
}
|
|
9490
9548
|
}
|
|
9491
|
-
},
|
|
9549
|
+
}, _callee54, this);
|
|
9492
9550
|
}));
|
|
9493
9551
|
|
|
9494
9552
|
function getSegment(_x72) {
|
|
@@ -9507,27 +9565,27 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9507
9565
|
}, {
|
|
9508
9566
|
key: "listSegments",
|
|
9509
9567
|
value: function () {
|
|
9510
|
-
var _listSegments = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9568
|
+
var _listSegments = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee55(options) {
|
|
9511
9569
|
var _yield$this$get2, segments;
|
|
9512
9570
|
|
|
9513
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9571
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee55$(_context55) {
|
|
9514
9572
|
while (1) {
|
|
9515
|
-
switch (
|
|
9573
|
+
switch (_context55.prev = _context55.next) {
|
|
9516
9574
|
case 0:
|
|
9517
|
-
|
|
9575
|
+
_context55.next = 2;
|
|
9518
9576
|
return this.get(this.baseURL + "/segments", options);
|
|
9519
9577
|
|
|
9520
9578
|
case 2:
|
|
9521
|
-
_yield$this$get2 =
|
|
9579
|
+
_yield$this$get2 = _context55.sent;
|
|
9522
9580
|
segments = _yield$this$get2.segments;
|
|
9523
|
-
return
|
|
9581
|
+
return _context55.abrupt("return", segments);
|
|
9524
9582
|
|
|
9525
9583
|
case 5:
|
|
9526
9584
|
case "end":
|
|
9527
|
-
return
|
|
9585
|
+
return _context55.stop();
|
|
9528
9586
|
}
|
|
9529
9587
|
}
|
|
9530
|
-
},
|
|
9588
|
+
}, _callee55, this);
|
|
9531
9589
|
}));
|
|
9532
9590
|
|
|
9533
9591
|
function listSegments(_x73) {
|
|
@@ -9548,29 +9606,29 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9548
9606
|
}, {
|
|
9549
9607
|
key: "updateSegment",
|
|
9550
9608
|
value: function () {
|
|
9551
|
-
var _updateSegment = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9609
|
+
var _updateSegment = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee56(id, params) {
|
|
9552
9610
|
var _yield$this$put, segment;
|
|
9553
9611
|
|
|
9554
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9612
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee56$(_context56) {
|
|
9555
9613
|
while (1) {
|
|
9556
|
-
switch (
|
|
9614
|
+
switch (_context56.prev = _context56.next) {
|
|
9557
9615
|
case 0:
|
|
9558
|
-
|
|
9616
|
+
_context56.next = 2;
|
|
9559
9617
|
return this.put(this.baseURL + "/segments/".concat(id), {
|
|
9560
9618
|
segment: params
|
|
9561
9619
|
});
|
|
9562
9620
|
|
|
9563
9621
|
case 2:
|
|
9564
|
-
_yield$this$put =
|
|
9622
|
+
_yield$this$put = _context56.sent;
|
|
9565
9623
|
segment = _yield$this$put.segment;
|
|
9566
|
-
return
|
|
9624
|
+
return _context56.abrupt("return", segment);
|
|
9567
9625
|
|
|
9568
9626
|
case 5:
|
|
9569
9627
|
case "end":
|
|
9570
|
-
return
|
|
9628
|
+
return _context56.stop();
|
|
9571
9629
|
}
|
|
9572
9630
|
}
|
|
9573
|
-
},
|
|
9631
|
+
}, _callee56, this);
|
|
9574
9632
|
}));
|
|
9575
9633
|
|
|
9576
9634
|
function updateSegment(_x74, _x75) {
|
|
@@ -9590,19 +9648,19 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9590
9648
|
}, {
|
|
9591
9649
|
key: "deleteSegment",
|
|
9592
9650
|
value: function () {
|
|
9593
|
-
var _deleteSegment = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9594
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9651
|
+
var _deleteSegment = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee57(id) {
|
|
9652
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee57$(_context57) {
|
|
9595
9653
|
while (1) {
|
|
9596
|
-
switch (
|
|
9654
|
+
switch (_context57.prev = _context57.next) {
|
|
9597
9655
|
case 0:
|
|
9598
|
-
return
|
|
9656
|
+
return _context57.abrupt("return", this.delete(this.baseURL + "/segments/".concat(id)));
|
|
9599
9657
|
|
|
9600
9658
|
case 1:
|
|
9601
9659
|
case "end":
|
|
9602
|
-
return
|
|
9660
|
+
return _context57.stop();
|
|
9603
9661
|
}
|
|
9604
9662
|
}
|
|
9605
|
-
},
|
|
9663
|
+
}, _callee57, this);
|
|
9606
9664
|
}));
|
|
9607
9665
|
|
|
9608
9666
|
function deleteSegment(_x76) {
|
|
@@ -9622,29 +9680,29 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9622
9680
|
}, {
|
|
9623
9681
|
key: "createCampaign",
|
|
9624
9682
|
value: function () {
|
|
9625
|
-
var _createCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9683
|
+
var _createCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee58(params) {
|
|
9626
9684
|
var _yield$this$post2, campaign;
|
|
9627
9685
|
|
|
9628
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9686
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee58$(_context58) {
|
|
9629
9687
|
while (1) {
|
|
9630
|
-
switch (
|
|
9688
|
+
switch (_context58.prev = _context58.next) {
|
|
9631
9689
|
case 0:
|
|
9632
|
-
|
|
9690
|
+
_context58.next = 2;
|
|
9633
9691
|
return this.post(this.baseURL + "/campaigns", {
|
|
9634
9692
|
campaign: params
|
|
9635
9693
|
});
|
|
9636
9694
|
|
|
9637
9695
|
case 2:
|
|
9638
|
-
_yield$this$post2 =
|
|
9696
|
+
_yield$this$post2 = _context58.sent;
|
|
9639
9697
|
campaign = _yield$this$post2.campaign;
|
|
9640
|
-
return
|
|
9698
|
+
return _context58.abrupt("return", campaign);
|
|
9641
9699
|
|
|
9642
9700
|
case 5:
|
|
9643
9701
|
case "end":
|
|
9644
|
-
return
|
|
9702
|
+
return _context58.stop();
|
|
9645
9703
|
}
|
|
9646
9704
|
}
|
|
9647
|
-
},
|
|
9705
|
+
}, _callee58, this);
|
|
9648
9706
|
}));
|
|
9649
9707
|
|
|
9650
9708
|
function createCampaign(_x77) {
|
|
@@ -9664,27 +9722,27 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9664
9722
|
}, {
|
|
9665
9723
|
key: "getCampaign",
|
|
9666
9724
|
value: function () {
|
|
9667
|
-
var _getCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9725
|
+
var _getCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee59(id) {
|
|
9668
9726
|
var _yield$this$get3, campaign;
|
|
9669
9727
|
|
|
9670
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9728
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee59$(_context59) {
|
|
9671
9729
|
while (1) {
|
|
9672
|
-
switch (
|
|
9730
|
+
switch (_context59.prev = _context59.next) {
|
|
9673
9731
|
case 0:
|
|
9674
|
-
|
|
9732
|
+
_context59.next = 2;
|
|
9675
9733
|
return this.get(this.baseURL + "/campaigns/".concat(id));
|
|
9676
9734
|
|
|
9677
9735
|
case 2:
|
|
9678
|
-
_yield$this$get3 =
|
|
9736
|
+
_yield$this$get3 = _context59.sent;
|
|
9679
9737
|
campaign = _yield$this$get3.campaign;
|
|
9680
|
-
return
|
|
9738
|
+
return _context59.abrupt("return", campaign);
|
|
9681
9739
|
|
|
9682
9740
|
case 5:
|
|
9683
9741
|
case "end":
|
|
9684
|
-
return
|
|
9742
|
+
return _context59.stop();
|
|
9685
9743
|
}
|
|
9686
9744
|
}
|
|
9687
|
-
},
|
|
9745
|
+
}, _callee59, this);
|
|
9688
9746
|
}));
|
|
9689
9747
|
|
|
9690
9748
|
function getCampaign(_x78) {
|
|
@@ -9703,27 +9761,27 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9703
9761
|
}, {
|
|
9704
9762
|
key: "listCampaigns",
|
|
9705
9763
|
value: function () {
|
|
9706
|
-
var _listCampaigns = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9764
|
+
var _listCampaigns = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee60(options) {
|
|
9707
9765
|
var _yield$this$get4, campaigns;
|
|
9708
9766
|
|
|
9709
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9767
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee60$(_context60) {
|
|
9710
9768
|
while (1) {
|
|
9711
|
-
switch (
|
|
9769
|
+
switch (_context60.prev = _context60.next) {
|
|
9712
9770
|
case 0:
|
|
9713
|
-
|
|
9771
|
+
_context60.next = 2;
|
|
9714
9772
|
return this.get(this.baseURL + "/campaigns", options);
|
|
9715
9773
|
|
|
9716
9774
|
case 2:
|
|
9717
|
-
_yield$this$get4 =
|
|
9775
|
+
_yield$this$get4 = _context60.sent;
|
|
9718
9776
|
campaigns = _yield$this$get4.campaigns;
|
|
9719
|
-
return
|
|
9777
|
+
return _context60.abrupt("return", campaigns);
|
|
9720
9778
|
|
|
9721
9779
|
case 5:
|
|
9722
9780
|
case "end":
|
|
9723
|
-
return
|
|
9781
|
+
return _context60.stop();
|
|
9724
9782
|
}
|
|
9725
9783
|
}
|
|
9726
|
-
},
|
|
9784
|
+
}, _callee60, this);
|
|
9727
9785
|
}));
|
|
9728
9786
|
|
|
9729
9787
|
function listCampaigns(_x79) {
|
|
@@ -9744,29 +9802,29 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9744
9802
|
}, {
|
|
9745
9803
|
key: "updateCampaign",
|
|
9746
9804
|
value: function () {
|
|
9747
|
-
var _updateCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9805
|
+
var _updateCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee61(id, params) {
|
|
9748
9806
|
var _yield$this$put2, campaign;
|
|
9749
9807
|
|
|
9750
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9808
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee61$(_context61) {
|
|
9751
9809
|
while (1) {
|
|
9752
|
-
switch (
|
|
9810
|
+
switch (_context61.prev = _context61.next) {
|
|
9753
9811
|
case 0:
|
|
9754
|
-
|
|
9812
|
+
_context61.next = 2;
|
|
9755
9813
|
return this.put(this.baseURL + "/campaigns/".concat(id), {
|
|
9756
9814
|
campaign: params
|
|
9757
9815
|
});
|
|
9758
9816
|
|
|
9759
9817
|
case 2:
|
|
9760
|
-
_yield$this$put2 =
|
|
9818
|
+
_yield$this$put2 = _context61.sent;
|
|
9761
9819
|
campaign = _yield$this$put2.campaign;
|
|
9762
|
-
return
|
|
9820
|
+
return _context61.abrupt("return", campaign);
|
|
9763
9821
|
|
|
9764
9822
|
case 5:
|
|
9765
9823
|
case "end":
|
|
9766
|
-
return
|
|
9824
|
+
return _context61.stop();
|
|
9767
9825
|
}
|
|
9768
9826
|
}
|
|
9769
|
-
},
|
|
9827
|
+
}, _callee61, this);
|
|
9770
9828
|
}));
|
|
9771
9829
|
|
|
9772
9830
|
function updateCampaign(_x80, _x81) {
|
|
@@ -9786,19 +9844,19 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9786
9844
|
}, {
|
|
9787
9845
|
key: "deleteCampaign",
|
|
9788
9846
|
value: function () {
|
|
9789
|
-
var _deleteCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9790
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9847
|
+
var _deleteCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee62(id) {
|
|
9848
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee62$(_context62) {
|
|
9791
9849
|
while (1) {
|
|
9792
|
-
switch (
|
|
9850
|
+
switch (_context62.prev = _context62.next) {
|
|
9793
9851
|
case 0:
|
|
9794
|
-
return
|
|
9852
|
+
return _context62.abrupt("return", this.delete(this.baseURL + "/campaigns/".concat(id)));
|
|
9795
9853
|
|
|
9796
9854
|
case 1:
|
|
9797
9855
|
case "end":
|
|
9798
|
-
return
|
|
9856
|
+
return _context62.stop();
|
|
9799
9857
|
}
|
|
9800
9858
|
}
|
|
9801
|
-
},
|
|
9859
|
+
}, _callee62, this);
|
|
9802
9860
|
}));
|
|
9803
9861
|
|
|
9804
9862
|
function deleteCampaign(_x82) {
|
|
@@ -9819,30 +9877,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9819
9877
|
}, {
|
|
9820
9878
|
key: "scheduleCampaign",
|
|
9821
9879
|
value: function () {
|
|
9822
|
-
var _scheduleCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9880
|
+
var _scheduleCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee63(id, params) {
|
|
9823
9881
|
var sendAt, _yield$this$patch, campaign;
|
|
9824
9882
|
|
|
9825
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9883
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee63$(_context63) {
|
|
9826
9884
|
while (1) {
|
|
9827
|
-
switch (
|
|
9885
|
+
switch (_context63.prev = _context63.next) {
|
|
9828
9886
|
case 0:
|
|
9829
9887
|
sendAt = params.sendAt;
|
|
9830
|
-
|
|
9888
|
+
_context63.next = 3;
|
|
9831
9889
|
return this.patch(this.baseURL + "/campaigns/".concat(id, "/schedule"), {
|
|
9832
9890
|
send_at: sendAt
|
|
9833
9891
|
});
|
|
9834
9892
|
|
|
9835
9893
|
case 3:
|
|
9836
|
-
_yield$this$patch =
|
|
9894
|
+
_yield$this$patch = _context63.sent;
|
|
9837
9895
|
campaign = _yield$this$patch.campaign;
|
|
9838
|
-
return
|
|
9896
|
+
return _context63.abrupt("return", campaign);
|
|
9839
9897
|
|
|
9840
9898
|
case 6:
|
|
9841
9899
|
case "end":
|
|
9842
|
-
return
|
|
9900
|
+
return _context63.stop();
|
|
9843
9901
|
}
|
|
9844
9902
|
}
|
|
9845
|
-
},
|
|
9903
|
+
}, _callee63, this);
|
|
9846
9904
|
}));
|
|
9847
9905
|
|
|
9848
9906
|
function scheduleCampaign(_x83, _x84) {
|
|
@@ -9862,27 +9920,27 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9862
9920
|
}, {
|
|
9863
9921
|
key: "stopCampaign",
|
|
9864
9922
|
value: function () {
|
|
9865
|
-
var _stopCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9923
|
+
var _stopCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee64(id) {
|
|
9866
9924
|
var _yield$this$patch2, campaign;
|
|
9867
9925
|
|
|
9868
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9926
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee64$(_context64) {
|
|
9869
9927
|
while (1) {
|
|
9870
|
-
switch (
|
|
9928
|
+
switch (_context64.prev = _context64.next) {
|
|
9871
9929
|
case 0:
|
|
9872
|
-
|
|
9930
|
+
_context64.next = 2;
|
|
9873
9931
|
return this.patch(this.baseURL + "/campaigns/".concat(id, "/stop"));
|
|
9874
9932
|
|
|
9875
9933
|
case 2:
|
|
9876
|
-
_yield$this$patch2 =
|
|
9934
|
+
_yield$this$patch2 = _context64.sent;
|
|
9877
9935
|
campaign = _yield$this$patch2.campaign;
|
|
9878
|
-
return
|
|
9936
|
+
return _context64.abrupt("return", campaign);
|
|
9879
9937
|
|
|
9880
9938
|
case 5:
|
|
9881
9939
|
case "end":
|
|
9882
|
-
return
|
|
9940
|
+
return _context64.stop();
|
|
9883
9941
|
}
|
|
9884
9942
|
}
|
|
9885
|
-
},
|
|
9943
|
+
}, _callee64, this);
|
|
9886
9944
|
}));
|
|
9887
9945
|
|
|
9888
9946
|
function stopCampaign(_x85) {
|
|
@@ -9902,27 +9960,27 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9902
9960
|
}, {
|
|
9903
9961
|
key: "resumeCampaign",
|
|
9904
9962
|
value: function () {
|
|
9905
|
-
var _resumeCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9963
|
+
var _resumeCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee65(id) {
|
|
9906
9964
|
var _yield$this$patch3, campaign;
|
|
9907
9965
|
|
|
9908
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9966
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee65$(_context65) {
|
|
9909
9967
|
while (1) {
|
|
9910
|
-
switch (
|
|
9968
|
+
switch (_context65.prev = _context65.next) {
|
|
9911
9969
|
case 0:
|
|
9912
|
-
|
|
9970
|
+
_context65.next = 2;
|
|
9913
9971
|
return this.patch(this.baseURL + "/campaigns/".concat(id, "/resume"));
|
|
9914
9972
|
|
|
9915
9973
|
case 2:
|
|
9916
|
-
_yield$this$patch3 =
|
|
9974
|
+
_yield$this$patch3 = _context65.sent;
|
|
9917
9975
|
campaign = _yield$this$patch3.campaign;
|
|
9918
|
-
return
|
|
9976
|
+
return _context65.abrupt("return", campaign);
|
|
9919
9977
|
|
|
9920
9978
|
case 5:
|
|
9921
9979
|
case "end":
|
|
9922
|
-
return
|
|
9980
|
+
return _context65.stop();
|
|
9923
9981
|
}
|
|
9924
9982
|
}
|
|
9925
|
-
},
|
|
9983
|
+
}, _callee65, this);
|
|
9926
9984
|
}));
|
|
9927
9985
|
|
|
9928
9986
|
function resumeCampaign(_x86) {
|
|
@@ -9942,30 +10000,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9942
10000
|
}, {
|
|
9943
10001
|
key: "testCampaign",
|
|
9944
10002
|
value: function () {
|
|
9945
|
-
var _testCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
10003
|
+
var _testCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee66(id, params) {
|
|
9946
10004
|
var users, _yield$this$post3, campaign;
|
|
9947
10005
|
|
|
9948
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
10006
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee66$(_context66) {
|
|
9949
10007
|
while (1) {
|
|
9950
|
-
switch (
|
|
10008
|
+
switch (_context66.prev = _context66.next) {
|
|
9951
10009
|
case 0:
|
|
9952
10010
|
users = params.users;
|
|
9953
|
-
|
|
10011
|
+
_context66.next = 3;
|
|
9954
10012
|
return this.post(this.baseURL + "/campaigns/".concat(id, "/test"), {
|
|
9955
10013
|
users: users
|
|
9956
10014
|
});
|
|
9957
10015
|
|
|
9958
10016
|
case 3:
|
|
9959
|
-
_yield$this$post3 =
|
|
10017
|
+
_yield$this$post3 = _context66.sent;
|
|
9960
10018
|
campaign = _yield$this$post3.campaign;
|
|
9961
|
-
return
|
|
10019
|
+
return _context66.abrupt("return", campaign);
|
|
9962
10020
|
|
|
9963
10021
|
case 6:
|
|
9964
10022
|
case "end":
|
|
9965
|
-
return
|
|
10023
|
+
return _context66.stop();
|
|
9966
10024
|
}
|
|
9967
10025
|
}
|
|
9968
|
-
},
|
|
10026
|
+
}, _callee66, this);
|
|
9969
10027
|
}));
|
|
9970
10028
|
|
|
9971
10029
|
function testCampaign(_x87, _x88) {
|
|
@@ -9984,21 +10042,21 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9984
10042
|
}, {
|
|
9985
10043
|
key: "enrichURL",
|
|
9986
10044
|
value: function () {
|
|
9987
|
-
var _enrichURL = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9988
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
10045
|
+
var _enrichURL = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee67(url) {
|
|
10046
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee67$(_context67) {
|
|
9989
10047
|
while (1) {
|
|
9990
|
-
switch (
|
|
10048
|
+
switch (_context67.prev = _context67.next) {
|
|
9991
10049
|
case 0:
|
|
9992
|
-
return
|
|
10050
|
+
return _context67.abrupt("return", this.get(this.baseURL + "/og", {
|
|
9993
10051
|
url: url
|
|
9994
10052
|
}));
|
|
9995
10053
|
|
|
9996
10054
|
case 1:
|
|
9997
10055
|
case "end":
|
|
9998
|
-
return
|
|
10056
|
+
return _context67.stop();
|
|
9999
10057
|
}
|
|
10000
10058
|
}
|
|
10001
|
-
},
|
|
10059
|
+
}, _callee67, this);
|
|
10002
10060
|
}));
|
|
10003
10061
|
|
|
10004
10062
|
function enrichURL(_x89) {
|
|
@@ -10018,19 +10076,19 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10018
10076
|
}, {
|
|
10019
10077
|
key: "getTask",
|
|
10020
10078
|
value: function () {
|
|
10021
|
-
var _getTask = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
10022
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
10079
|
+
var _getTask = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee68(id) {
|
|
10080
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee68$(_context68) {
|
|
10023
10081
|
while (1) {
|
|
10024
|
-
switch (
|
|
10082
|
+
switch (_context68.prev = _context68.next) {
|
|
10025
10083
|
case 0:
|
|
10026
|
-
return
|
|
10084
|
+
return _context68.abrupt("return", this.get("".concat(this.baseURL, "/tasks/").concat(id)));
|
|
10027
10085
|
|
|
10028
10086
|
case 1:
|
|
10029
10087
|
case "end":
|
|
10030
|
-
return
|
|
10088
|
+
return _context68.stop();
|
|
10031
10089
|
}
|
|
10032
10090
|
}
|
|
10033
|
-
},
|
|
10091
|
+
}, _callee68, this);
|
|
10034
10092
|
}));
|
|
10035
10093
|
|
|
10036
10094
|
function getTask(_x90) {
|
|
@@ -10051,28 +10109,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10051
10109
|
}, {
|
|
10052
10110
|
key: "deleteChannels",
|
|
10053
10111
|
value: function () {
|
|
10054
|
-
var _deleteChannels = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
10112
|
+
var _deleteChannels = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee69(cids) {
|
|
10055
10113
|
var options,
|
|
10056
|
-
|
|
10057
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
10114
|
+
_args69 = arguments;
|
|
10115
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee69$(_context69) {
|
|
10058
10116
|
while (1) {
|
|
10059
|
-
switch (
|
|
10117
|
+
switch (_context69.prev = _context69.next) {
|
|
10060
10118
|
case 0:
|
|
10061
|
-
options =
|
|
10062
|
-
|
|
10119
|
+
options = _args69.length > 1 && _args69[1] !== undefined ? _args69[1] : {};
|
|
10120
|
+
_context69.next = 3;
|
|
10063
10121
|
return this.post(this.baseURL + "/channels/delete", _objectSpread({
|
|
10064
10122
|
cids: cids
|
|
10065
10123
|
}, options));
|
|
10066
10124
|
|
|
10067
10125
|
case 3:
|
|
10068
|
-
return
|
|
10126
|
+
return _context69.abrupt("return", _context69.sent);
|
|
10069
10127
|
|
|
10070
10128
|
case 4:
|
|
10071
10129
|
case "end":
|
|
10072
|
-
return
|
|
10130
|
+
return _context69.stop();
|
|
10073
10131
|
}
|
|
10074
10132
|
}
|
|
10075
|
-
},
|
|
10133
|
+
}, _callee69, this);
|
|
10076
10134
|
}));
|
|
10077
10135
|
|
|
10078
10136
|
function deleteChannels(_x91) {
|
|
@@ -10093,13 +10151,13 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10093
10151
|
}, {
|
|
10094
10152
|
key: "deleteUsers",
|
|
10095
10153
|
value: function () {
|
|
10096
|
-
var _deleteUsers = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
10097
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
10154
|
+
var _deleteUsers = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee70(user_ids, options) {
|
|
10155
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee70$(_context70) {
|
|
10098
10156
|
while (1) {
|
|
10099
|
-
switch (
|
|
10157
|
+
switch (_context70.prev = _context70.next) {
|
|
10100
10158
|
case 0:
|
|
10101
10159
|
if (!((options === null || options === void 0 ? void 0 : options.user) !== 'soft' && (options === null || options === void 0 ? void 0 : options.user) !== 'hard')) {
|
|
10102
|
-
|
|
10160
|
+
_context70.next = 2;
|
|
10103
10161
|
break;
|
|
10104
10162
|
}
|
|
10105
10163
|
|
|
@@ -10107,7 +10165,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10107
10165
|
|
|
10108
10166
|
case 2:
|
|
10109
10167
|
if (!(options.messages !== undefined && options.messages !== 'soft' && options.messages !== 'hard')) {
|
|
10110
|
-
|
|
10168
|
+
_context70.next = 4;
|
|
10111
10169
|
break;
|
|
10112
10170
|
}
|
|
10113
10171
|
|
|
@@ -10115,27 +10173,27 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10115
10173
|
|
|
10116
10174
|
case 4:
|
|
10117
10175
|
if (!(options.conversations !== undefined && options.conversations !== 'soft' && options.conversations !== 'hard')) {
|
|
10118
|
-
|
|
10176
|
+
_context70.next = 6;
|
|
10119
10177
|
break;
|
|
10120
10178
|
}
|
|
10121
10179
|
|
|
10122
10180
|
throw new Error('Invalid delete user options. conversations must be one of [soft hard]');
|
|
10123
10181
|
|
|
10124
10182
|
case 6:
|
|
10125
|
-
|
|
10183
|
+
_context70.next = 8;
|
|
10126
10184
|
return this.post(this.baseURL + "/users/delete", _objectSpread({
|
|
10127
10185
|
user_ids: user_ids
|
|
10128
10186
|
}, options));
|
|
10129
10187
|
|
|
10130
10188
|
case 8:
|
|
10131
|
-
return
|
|
10189
|
+
return _context70.abrupt("return", _context70.sent);
|
|
10132
10190
|
|
|
10133
10191
|
case 9:
|
|
10134
10192
|
case "end":
|
|
10135
|
-
return
|
|
10193
|
+
return _context70.stop();
|
|
10136
10194
|
}
|
|
10137
10195
|
}
|
|
10138
|
-
},
|
|
10196
|
+
}, _callee70, this);
|
|
10139
10197
|
}));
|
|
10140
10198
|
|
|
10141
10199
|
function deleteUsers(_x92, _x93) {
|
|
@@ -10160,25 +10218,25 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10160
10218
|
}, {
|
|
10161
10219
|
key: "_createImport",
|
|
10162
10220
|
value: function () {
|
|
10163
|
-
var _createImport2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
10164
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
10221
|
+
var _createImport2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee71(filename) {
|
|
10222
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee71$(_context71) {
|
|
10165
10223
|
while (1) {
|
|
10166
|
-
switch (
|
|
10224
|
+
switch (_context71.prev = _context71.next) {
|
|
10167
10225
|
case 0:
|
|
10168
|
-
|
|
10226
|
+
_context71.next = 2;
|
|
10169
10227
|
return this.post(this.baseURL + "/imports", {
|
|
10170
10228
|
filename: filename
|
|
10171
10229
|
});
|
|
10172
10230
|
|
|
10173
10231
|
case 2:
|
|
10174
|
-
return
|
|
10232
|
+
return _context71.abrupt("return", _context71.sent);
|
|
10175
10233
|
|
|
10176
10234
|
case 3:
|
|
10177
10235
|
case "end":
|
|
10178
|
-
return
|
|
10236
|
+
return _context71.stop();
|
|
10179
10237
|
}
|
|
10180
10238
|
}
|
|
10181
|
-
},
|
|
10239
|
+
}, _callee71, this);
|
|
10182
10240
|
}));
|
|
10183
10241
|
|
|
10184
10242
|
function _createImport(_x94) {
|
|
@@ -10203,23 +10261,23 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10203
10261
|
}, {
|
|
10204
10262
|
key: "_getImport",
|
|
10205
10263
|
value: function () {
|
|
10206
|
-
var _getImport2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
10207
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
10264
|
+
var _getImport2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee72(id) {
|
|
10265
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee72$(_context72) {
|
|
10208
10266
|
while (1) {
|
|
10209
|
-
switch (
|
|
10267
|
+
switch (_context72.prev = _context72.next) {
|
|
10210
10268
|
case 0:
|
|
10211
|
-
|
|
10269
|
+
_context72.next = 2;
|
|
10212
10270
|
return this.get(this.baseURL + "/imports/".concat(id));
|
|
10213
10271
|
|
|
10214
10272
|
case 2:
|
|
10215
|
-
return
|
|
10273
|
+
return _context72.abrupt("return", _context72.sent);
|
|
10216
10274
|
|
|
10217
10275
|
case 3:
|
|
10218
10276
|
case "end":
|
|
10219
|
-
return
|
|
10277
|
+
return _context72.stop();
|
|
10220
10278
|
}
|
|
10221
10279
|
}
|
|
10222
|
-
},
|
|
10280
|
+
}, _callee72, this);
|
|
10223
10281
|
}));
|
|
10224
10282
|
|
|
10225
10283
|
function _getImport(_x95) {
|
|
@@ -10244,23 +10302,23 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10244
10302
|
}, {
|
|
10245
10303
|
key: "_listImports",
|
|
10246
10304
|
value: function () {
|
|
10247
|
-
var _listImports2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
10248
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
10305
|
+
var _listImports2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee73(options) {
|
|
10306
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee73$(_context73) {
|
|
10249
10307
|
while (1) {
|
|
10250
|
-
switch (
|
|
10308
|
+
switch (_context73.prev = _context73.next) {
|
|
10251
10309
|
case 0:
|
|
10252
|
-
|
|
10310
|
+
_context73.next = 2;
|
|
10253
10311
|
return this.get(this.baseURL + "/imports", options);
|
|
10254
10312
|
|
|
10255
10313
|
case 2:
|
|
10256
|
-
return
|
|
10314
|
+
return _context73.abrupt("return", _context73.sent);
|
|
10257
10315
|
|
|
10258
10316
|
case 3:
|
|
10259
10317
|
case "end":
|
|
10260
|
-
return
|
|
10318
|
+
return _context73.stop();
|
|
10261
10319
|
}
|
|
10262
10320
|
}
|
|
10263
|
-
},
|
|
10321
|
+
}, _callee73, this);
|
|
10264
10322
|
}));
|
|
10265
10323
|
|
|
10266
10324
|
function _listImports(_x96) {
|