stream-chat 9.1.0 → 9.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.browser.cjs +23 -8
- package/dist/cjs/index.browser.cjs.map +2 -2
- package/dist/cjs/index.node.cjs +23 -8
- package/dist/cjs/index.node.cjs.map +2 -2
- package/dist/esm/index.js +23 -8
- package/dist/esm/index.js.map +2 -2
- package/dist/types/client.d.ts +13 -1
- package/dist/types/types.d.ts +1 -0
- package/package.json +1 -1
- package/src/client.ts +29 -8
- package/src/types.ts +1 -0
package/dist/esm/index.js
CHANGED
|
@@ -13861,18 +13861,16 @@ var StreamChat = class _StreamChat {
|
|
|
13861
13861
|
);
|
|
13862
13862
|
}
|
|
13863
13863
|
/**
|
|
13864
|
-
*
|
|
13864
|
+
* queryChannelsRequest - Queries channels and returns the raw response
|
|
13865
13865
|
*
|
|
13866
13866
|
* @param {ChannelFilters} filterConditions object MongoDB style filters
|
|
13867
13867
|
* @param {ChannelSort} [sort] Sort options, for instance {created_at: -1}.
|
|
13868
13868
|
* When using multiple fields, make sure you use array of objects to guarantee field order, for instance [{last_updated: -1}, {created_at: 1}]
|
|
13869
13869
|
* @param {ChannelOptions} [options] Options object
|
|
13870
|
-
* @param {ChannelStateOptions} [stateOptions] State options object. These options will only be used for state management and won't be sent in the request.
|
|
13871
|
-
* - stateOptions.skipInitialization - Skips the initialization of the state for the channels matching the ids in the list.
|
|
13872
13870
|
*
|
|
13873
|
-
* @return {Promise<
|
|
13871
|
+
* @return {Promise<Array<ChannelAPIResponse>>} search channels response
|
|
13874
13872
|
*/
|
|
13875
|
-
async
|
|
13873
|
+
async queryChannelsRequest(filterConditions, sort = [], options = {}) {
|
|
13876
13874
|
const defaultOptions = {
|
|
13877
13875
|
state: true,
|
|
13878
13876
|
watch: true,
|
|
@@ -13892,14 +13890,31 @@ var StreamChat = class _StreamChat {
|
|
|
13892
13890
|
this.baseURL + "/channels",
|
|
13893
13891
|
payload
|
|
13894
13892
|
);
|
|
13893
|
+
return data.channels;
|
|
13894
|
+
}
|
|
13895
|
+
/**
|
|
13896
|
+
* queryChannels - Query channels
|
|
13897
|
+
*
|
|
13898
|
+
* @param {ChannelFilters} filterConditions object MongoDB style filters
|
|
13899
|
+
* @param {ChannelSort} [sort] Sort options, for instance {created_at: -1}.
|
|
13900
|
+
* When using multiple fields, make sure you use array of objects to guarantee field order, for instance [{last_updated: -1}, {created_at: 1}]
|
|
13901
|
+
* @param {ChannelOptions} [options] Options object
|
|
13902
|
+
* @param {ChannelStateOptions} [stateOptions] State options object. These options will only be used for state management and won't be sent in the request.
|
|
13903
|
+
* - stateOptions.skipInitialization - Skips the initialization of the state for the channels matching the ids in the list.
|
|
13904
|
+
* - stateOptions.skipHydration - Skips returning the channels as instances of the Channel class and rather returns the raw query response.
|
|
13905
|
+
*
|
|
13906
|
+
* @return {Promise<Array<Channel>>} search channels response
|
|
13907
|
+
*/
|
|
13908
|
+
async queryChannels(filterConditions, sort = [], options = {}, stateOptions = {}) {
|
|
13909
|
+
const channels = await this.queryChannelsRequest(filterConditions, sort, options);
|
|
13895
13910
|
this.dispatchEvent({
|
|
13896
13911
|
type: "channels.queried",
|
|
13897
13912
|
queriedChannels: {
|
|
13898
|
-
channels
|
|
13913
|
+
channels,
|
|
13899
13914
|
isLatestMessageSet: true
|
|
13900
13915
|
}
|
|
13901
13916
|
});
|
|
13902
|
-
return this.hydrateActiveChannels(
|
|
13917
|
+
return this.hydrateActiveChannels(channels, stateOptions, options);
|
|
13903
13918
|
}
|
|
13904
13919
|
/**
|
|
13905
13920
|
* queryReactions - Query reactions
|
|
@@ -14846,7 +14861,7 @@ var StreamChat = class _StreamChat {
|
|
|
14846
14861
|
if (this.userAgent) {
|
|
14847
14862
|
return this.userAgent;
|
|
14848
14863
|
}
|
|
14849
|
-
const version = "9.1.
|
|
14864
|
+
const version = "9.1.1";
|
|
14850
14865
|
const clientBundle = "browser-esm";
|
|
14851
14866
|
let userAgentString = "";
|
|
14852
14867
|
if (this.sdkIdentifier) {
|