stream-chat 5.6.0 → 6.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -114
- package/dist/browser.es.js +464 -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 +464 -366
- package/dist/browser.js.map +1 -1
- package/dist/index.es.js +464 -366
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +464 -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 +190 -163
- 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 +404 -236
- 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 +2 -2
- package/src/channel.ts +196 -290
- package/src/channel_state.ts +54 -219
- package/src/client.ts +297 -524
- package/src/client_state.ts +6 -6
- package/src/connection.ts +7 -22
- package/src/connection_fallback.ts +7 -21
- package/src/token_manager.ts +6 -6
- package/src/types.ts +540 -487
- package/src/utils.ts +7 -11
package/src/utils.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import FormData from 'form-data';
|
|
2
|
-
import { AscDesc,
|
|
2
|
+
import { AscDesc, ExtendableGenerics, DefaultGenerics, OwnUserBase, OwnUserResponse, UserResponse } from './types';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* logChatPromiseExecution - utility function for logging the execution of a promise..
|
|
@@ -54,18 +54,14 @@ function isFileWebAPI(uri: unknown): uri is File {
|
|
|
54
54
|
return typeof window !== 'undefined' && 'File' in window && uri instanceof File;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
function
|
|
58
|
-
|
|
57
|
+
export function isOwnUser<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics>(
|
|
58
|
+
user?: OwnUserResponse<StreamChatGenerics> | UserResponse<StreamChatGenerics>,
|
|
59
|
+
): user is OwnUserResponse<StreamChatGenerics> {
|
|
60
|
+
return (user as OwnUserResponse<StreamChatGenerics>)?.total_unread_count !== undefined;
|
|
59
61
|
}
|
|
60
62
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
CommandType extends string = LiteralStringForUnion,
|
|
64
|
-
UserType extends UR = UR
|
|
65
|
-
>(
|
|
66
|
-
user?: OwnUserResponse<ChannelType, CommandType, UserType> | UserResponse<UserType>,
|
|
67
|
-
): user is OwnUserResponse<ChannelType, CommandType, UserType> {
|
|
68
|
-
return (user as OwnUserResponse<ChannelType, CommandType, UserType>)?.total_unread_count !== undefined;
|
|
63
|
+
function isBlobWebAPI(uri: unknown): uri is Blob {
|
|
64
|
+
return typeof window !== 'undefined' && 'Blob' in window && uri instanceof Blob;
|
|
69
65
|
}
|
|
70
66
|
|
|
71
67
|
export function isOwnUserBaseProperty(property: string) {
|