stream-chat 4.2.0 → 4.3.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/dist/browser.es.js +242 -45
- 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 +242 -45
- package/dist/browser.js.map +1 -1
- package/dist/index.es.js +242 -45
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +242 -45
- package/dist/index.js.map +1 -1
- package/dist/types/channel.d.ts +7 -5
- package/dist/types/channel.d.ts.map +1 -1
- package/dist/types/client.d.ts +65 -11
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/connection.d.ts +0 -1
- package/dist/types/connection.d.ts.map +1 -1
- package/dist/types/types.d.ts +73 -9
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/channel.ts +8 -6
- package/src/client.ts +108 -11
- package/src/connection.ts +6 -11
- package/src/types.ts +96 -9
package/src/types.ts
CHANGED
|
@@ -79,6 +79,7 @@ export type AppSettingsAPIResponse<
|
|
|
79
79
|
url_enrichment?: boolean;
|
|
80
80
|
}
|
|
81
81
|
>;
|
|
82
|
+
async_url_enrich_enabled?: boolean;
|
|
82
83
|
auto_translation_enabled?: boolean;
|
|
83
84
|
before_message_send_hook_url?: string;
|
|
84
85
|
campaign_enabled?: boolean;
|
|
@@ -99,14 +100,17 @@ export type AppSettingsAPIResponse<
|
|
|
99
100
|
version: string;
|
|
100
101
|
apn?: APNConfig;
|
|
101
102
|
firebase?: FirebaseConfig;
|
|
103
|
+
huawei?: HuaweiConfig;
|
|
102
104
|
};
|
|
103
105
|
revoke_tokens_issued_before?: string | null;
|
|
106
|
+
search_backend?: 'disabled' | 'elasticsearch' | 'postgres';
|
|
104
107
|
sqs_key?: string;
|
|
105
108
|
sqs_secret?: string;
|
|
106
109
|
sqs_url?: string;
|
|
107
110
|
suspended?: boolean;
|
|
108
111
|
suspended_explanation?: string;
|
|
109
|
-
user_search_disallowed_roles?: string[];
|
|
112
|
+
user_search_disallowed_roles?: string[] | null;
|
|
113
|
+
webhook_events?: Array<string>;
|
|
110
114
|
webhook_url?: string;
|
|
111
115
|
};
|
|
112
116
|
};
|
|
@@ -191,6 +195,7 @@ export type ChannelResponse<
|
|
|
191
195
|
created_by?: UserResponse<UserType> | null;
|
|
192
196
|
created_by_id?: string;
|
|
193
197
|
deleted_at?: string;
|
|
198
|
+
hidden?: boolean;
|
|
194
199
|
invites?: string[];
|
|
195
200
|
last_message_at?: string;
|
|
196
201
|
member_count?: number;
|
|
@@ -262,6 +267,7 @@ export type CheckPushResponse = APIResponse & {
|
|
|
262
267
|
general_errors?: string[];
|
|
263
268
|
rendered_apn_template?: string;
|
|
264
269
|
rendered_firebase_template?: string;
|
|
270
|
+
rendered_huawei_template?: string;
|
|
265
271
|
};
|
|
266
272
|
|
|
267
273
|
export type CheckSQSResponse = APIResponse & {
|
|
@@ -824,7 +830,7 @@ export type ChannelQueryOptions<
|
|
|
824
830
|
connection_id?: string;
|
|
825
831
|
data?: ChannelResponse<ChannelType, CommandType, UserType>;
|
|
826
832
|
members?: PaginationOptions;
|
|
827
|
-
messages?:
|
|
833
|
+
messages?: MessagePaginationOptions;
|
|
828
834
|
presence?: boolean;
|
|
829
835
|
state?: boolean;
|
|
830
836
|
watch?: boolean;
|
|
@@ -871,9 +877,9 @@ export type CreateCommandOptions<CommandType extends string = LiteralStringForUn
|
|
|
871
877
|
|
|
872
878
|
export type CustomPermissionOptions = {
|
|
873
879
|
action: string;
|
|
880
|
+
condition: object;
|
|
874
881
|
id: string;
|
|
875
882
|
name: string;
|
|
876
|
-
condition?: string;
|
|
877
883
|
description?: string;
|
|
878
884
|
owner?: boolean;
|
|
879
885
|
same_team?: boolean;
|
|
@@ -910,9 +916,15 @@ export type InviteOptions<
|
|
|
910
916
|
user_id?: string;
|
|
911
917
|
};
|
|
912
918
|
|
|
913
|
-
|
|
919
|
+
/** @deprecated use MarkChannelsReadOptions instead */
|
|
920
|
+
export type MarkAllReadOptions<
|
|
921
|
+
UserType = UnknownType
|
|
922
|
+
> = MarkChannelsReadOptions<UserType>;
|
|
923
|
+
|
|
924
|
+
export type MarkChannelsReadOptions<UserType = UnknownType> = {
|
|
914
925
|
client_id?: string;
|
|
915
926
|
connection_id?: string;
|
|
927
|
+
read_by_channel?: Record<string, string>;
|
|
916
928
|
user?: UserResponse<UserType>;
|
|
917
929
|
user_id?: string;
|
|
918
930
|
};
|
|
@@ -950,6 +962,11 @@ export type PaginationOptions = {
|
|
|
950
962
|
offset?: number;
|
|
951
963
|
};
|
|
952
964
|
|
|
965
|
+
export type MessagePaginationOptions = PaginationOptions & {
|
|
966
|
+
created_at_around?: string | Date;
|
|
967
|
+
id_around?: string;
|
|
968
|
+
};
|
|
969
|
+
|
|
953
970
|
export type QueryMembersOptions = {
|
|
954
971
|
limit?: number;
|
|
955
972
|
offset?: number;
|
|
@@ -1442,6 +1459,10 @@ export type UserSort<UserType = UnknownType> =
|
|
|
1442
1459
|
| Sort<UserResponse<UserType>>
|
|
1443
1460
|
| Array<Sort<UserResponse<UserType>>>;
|
|
1444
1461
|
|
|
1462
|
+
export type MemberSort<UserType = UnknownType> =
|
|
1463
|
+
| Sort<Pick<UserResponse<UserType>, 'id' | 'created_at' | 'name'>>
|
|
1464
|
+
| Array<Sort<Pick<UserResponse<UserType>, 'id' | 'created_at' | 'name'>>>;
|
|
1465
|
+
|
|
1445
1466
|
export type SearchMessageSortBase<MessageType = UnknownType> = Sort<MessageType> & {
|
|
1446
1467
|
attachments?: AscDesc;
|
|
1447
1468
|
'attachments.type'?: AscDesc;
|
|
@@ -1509,6 +1530,7 @@ export type AppSettings = {
|
|
|
1509
1530
|
p12_cert?: string;
|
|
1510
1531
|
team_id?: string;
|
|
1511
1532
|
};
|
|
1533
|
+
async_url_enrich_enabled?: boolean;
|
|
1512
1534
|
auto_translation_enabled?: boolean;
|
|
1513
1535
|
custom_action_handler_url?: string;
|
|
1514
1536
|
disable_auth_checks?: boolean;
|
|
@@ -1523,6 +1545,11 @@ export type AppSettings = {
|
|
|
1523
1545
|
server_key?: string;
|
|
1524
1546
|
};
|
|
1525
1547
|
grants?: Record<string, string[]>;
|
|
1548
|
+
huawei_config?: {
|
|
1549
|
+
id: string;
|
|
1550
|
+
secret: string;
|
|
1551
|
+
data_template?: string;
|
|
1552
|
+
};
|
|
1526
1553
|
image_moderation_enabled?: boolean;
|
|
1527
1554
|
image_upload_config?: FileUploadConfig;
|
|
1528
1555
|
multi_tenant_enabled?: boolean;
|
|
@@ -1533,6 +1560,7 @@ export type AppSettings = {
|
|
|
1533
1560
|
sqs_key?: string;
|
|
1534
1561
|
sqs_secret?: string;
|
|
1535
1562
|
sqs_url?: string;
|
|
1563
|
+
webhook_events?: Array<string> | null;
|
|
1536
1564
|
webhook_url?: string;
|
|
1537
1565
|
};
|
|
1538
1566
|
|
|
@@ -1557,6 +1585,19 @@ export type Attachment<T = UnknownType> = T & {
|
|
|
1557
1585
|
type?: string;
|
|
1558
1586
|
};
|
|
1559
1587
|
|
|
1588
|
+
export type OGAttachment = {
|
|
1589
|
+
og_scrape_url: string;
|
|
1590
|
+
asset_url?: string; // og:video | og:audio
|
|
1591
|
+
author_link?: string; // og:site
|
|
1592
|
+
author_name?: string; // og:site_name
|
|
1593
|
+
image_url?: string; // og:image
|
|
1594
|
+
text?: string; // og:description
|
|
1595
|
+
thumb_url?: string; // og:image
|
|
1596
|
+
title?: string; // og:title
|
|
1597
|
+
title_link?: string; // og:url
|
|
1598
|
+
type?: string | 'video' | 'audio' | 'image';
|
|
1599
|
+
};
|
|
1600
|
+
|
|
1560
1601
|
export type BlockList = {
|
|
1561
1602
|
name: string;
|
|
1562
1603
|
words: string[];
|
|
@@ -1653,6 +1694,8 @@ export type CheckPushInput<UserType = UnknownType> = {
|
|
|
1653
1694
|
user_id?: string;
|
|
1654
1695
|
};
|
|
1655
1696
|
|
|
1697
|
+
export type PushProvider = 'apn' | 'firebase' | 'huawei';
|
|
1698
|
+
|
|
1656
1699
|
export type CommandVariants<CommandType extends string = LiteralStringForUnion> =
|
|
1657
1700
|
| 'all'
|
|
1658
1701
|
| 'ban'
|
|
@@ -1695,7 +1738,7 @@ export type Device<UserType = UnknownType> = DeviceFields & {
|
|
|
1695
1738
|
|
|
1696
1739
|
export type BaseDeviceFields = {
|
|
1697
1740
|
id: string;
|
|
1698
|
-
push_provider:
|
|
1741
|
+
push_provider: PushProvider;
|
|
1699
1742
|
};
|
|
1700
1743
|
|
|
1701
1744
|
export type DeviceFields = BaseDeviceFields & {
|
|
@@ -1799,6 +1842,7 @@ export type ExportChannelRequest = {
|
|
|
1799
1842
|
|
|
1800
1843
|
export type ExportChannelOptions = {
|
|
1801
1844
|
clear_deleted_message_text?: boolean;
|
|
1845
|
+
include_truncated_messages?: boolean;
|
|
1802
1846
|
};
|
|
1803
1847
|
|
|
1804
1848
|
export type Field = {
|
|
@@ -1808,10 +1852,10 @@ export type Field = {
|
|
|
1808
1852
|
};
|
|
1809
1853
|
|
|
1810
1854
|
export type FileUploadConfig = {
|
|
1811
|
-
allowed_file_extensions?: string[];
|
|
1812
|
-
allowed_mime_types?: string[];
|
|
1813
|
-
blocked_file_extensions?: string[];
|
|
1814
|
-
blocked_mime_types?: string[];
|
|
1855
|
+
allowed_file_extensions?: string[] | null;
|
|
1856
|
+
allowed_mime_types?: string[] | null;
|
|
1857
|
+
blocked_file_extensions?: string[] | null;
|
|
1858
|
+
blocked_mime_types?: string[] | null;
|
|
1815
1859
|
};
|
|
1816
1860
|
|
|
1817
1861
|
export type FirebaseConfig = {
|
|
@@ -1821,6 +1865,11 @@ export type FirebaseConfig = {
|
|
|
1821
1865
|
notification_template?: string;
|
|
1822
1866
|
};
|
|
1823
1867
|
|
|
1868
|
+
export type HuaweiConfig = {
|
|
1869
|
+
data_template?: string;
|
|
1870
|
+
enabled?: boolean;
|
|
1871
|
+
};
|
|
1872
|
+
|
|
1824
1873
|
export type LiteralStringForUnion = string & {};
|
|
1825
1874
|
|
|
1826
1875
|
export type Logger = (
|
|
@@ -1893,6 +1942,7 @@ export type PartialMessageUpdate<MessageType = UnknownType> = {
|
|
|
1893
1942
|
|
|
1894
1943
|
export type PermissionAPIObject = {
|
|
1895
1944
|
action?: string;
|
|
1945
|
+
condition?: object;
|
|
1896
1946
|
custom?: boolean;
|
|
1897
1947
|
description?: string;
|
|
1898
1948
|
id?: string;
|
|
@@ -1990,6 +2040,7 @@ export type TestPushDataInput = {
|
|
|
1990
2040
|
apnTemplate?: string;
|
|
1991
2041
|
firebaseDataTemplate?: string;
|
|
1992
2042
|
firebaseTemplate?: string;
|
|
2043
|
+
huaweiDataTemplate?: string;
|
|
1993
2044
|
messageID?: string;
|
|
1994
2045
|
skipDevices?: boolean;
|
|
1995
2046
|
};
|
|
@@ -2092,6 +2143,30 @@ export type User<UserType = UnknownType> = UserType & {
|
|
|
2092
2143
|
username?: string;
|
|
2093
2144
|
};
|
|
2094
2145
|
|
|
2146
|
+
export type TaskResponse = {
|
|
2147
|
+
task_id: string;
|
|
2148
|
+
};
|
|
2149
|
+
|
|
2150
|
+
export type DeleteChannelsResponse = {
|
|
2151
|
+
result: Record<string, string>;
|
|
2152
|
+
} & Partial<TaskResponse>;
|
|
2153
|
+
|
|
2154
|
+
export type DeleteType = 'soft' | 'hard';
|
|
2155
|
+
|
|
2156
|
+
/*
|
|
2157
|
+
DeleteUserOptions specifies a collection of one or more `user_ids` to be deleted.
|
|
2158
|
+
|
|
2159
|
+
`user` soft|hard determines if the user needs to be hard- or soft-deleted, where hard-delete
|
|
2160
|
+
implies that all related objects (messages, flags, etc) will be hard-deleted as well.
|
|
2161
|
+
`conversations` soft|hard will delete any 1to1 channels that the user was a member of.
|
|
2162
|
+
`messages` soft-hard will delete any messages that the user has sent.
|
|
2163
|
+
*/
|
|
2164
|
+
export type DeleteUserOptions = {
|
|
2165
|
+
user: DeleteType;
|
|
2166
|
+
conversations?: DeleteType;
|
|
2167
|
+
messages?: DeleteType;
|
|
2168
|
+
};
|
|
2169
|
+
|
|
2095
2170
|
export type SegmentData = {
|
|
2096
2171
|
description: string;
|
|
2097
2172
|
// TODO: define this type in more detail
|
|
@@ -2146,3 +2221,15 @@ export type Campaign = {
|
|
|
2146
2221
|
updated_at: string;
|
|
2147
2222
|
} & CampaignData &
|
|
2148
2223
|
CampaignStatus;
|
|
2224
|
+
|
|
2225
|
+
export type TaskStatus = {
|
|
2226
|
+
created_at: string;
|
|
2227
|
+
status: string;
|
|
2228
|
+
task_id: string;
|
|
2229
|
+
updated_at: string;
|
|
2230
|
+
error?: {
|
|
2231
|
+
description: string;
|
|
2232
|
+
type: string;
|
|
2233
|
+
};
|
|
2234
|
+
result?: UnknownType;
|
|
2235
|
+
};
|