stream-chat 5.2.0 → 5.6.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 +450 -257
- 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 +450 -257
- package/dist/browser.js.map +1 -1
- package/dist/index.es.js +450 -257
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +450 -257
- package/dist/index.js.map +1 -1
- package/dist/types/channel.d.ts +5 -1
- package/dist/types/channel.d.ts.map +1 -1
- package/dist/types/channel_state.d.ts +7 -4
- package/dist/types/channel_state.d.ts.map +1 -1
- package/dist/types/client.d.ts +57 -2
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/connection.d.ts.map +1 -1
- package/dist/types/connection_fallback.d.ts.map +1 -1
- package/dist/types/events.d.ts +1 -0
- package/dist/types/events.d.ts.map +1 -1
- package/dist/types/types.d.ts +55 -9
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/channel.ts +16 -6
- package/src/channel_state.ts +6 -1
- package/src/client.ts +75 -2
- package/src/connection.ts +3 -1
- package/src/connection_fallback.ts +2 -0
- package/src/events.ts +1 -0
- package/src/types.ts +66 -52
package/src/types.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AxiosRequestConfig } from 'axios';
|
|
2
|
+
import { EVENT_MAP } from './events';
|
|
2
3
|
import { Role } from './permissions';
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -99,6 +100,7 @@ export type AppSettingsAPIResponse<CommandType extends string = LiteralStringFor
|
|
|
99
100
|
apn?: APNConfig;
|
|
100
101
|
firebase?: FirebaseConfig;
|
|
101
102
|
huawei?: HuaweiConfig;
|
|
103
|
+
xiaomi?: XiaomiConfig;
|
|
102
104
|
};
|
|
103
105
|
revoke_tokens_issued_before?: string | null;
|
|
104
106
|
search_backend?: 'disabled' | 'elasticsearch' | 'postgres';
|
|
@@ -160,7 +162,7 @@ export type FlagReport<
|
|
|
160
162
|
message: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
|
|
161
163
|
user: UserResponse<UserType>;
|
|
162
164
|
created_at?: string;
|
|
163
|
-
|
|
165
|
+
details?: Object;
|
|
164
166
|
review_result?: string;
|
|
165
167
|
reviewed_at?: string;
|
|
166
168
|
reviewed_by?: UserResponse<UserType>;
|
|
@@ -286,13 +288,16 @@ export type ChannelMemberResponse<UserType = UR> = {
|
|
|
286
288
|
|
|
287
289
|
export type CheckPushResponse = APIResponse & {
|
|
288
290
|
device_errors?: {
|
|
289
|
-
|
|
290
|
-
|
|
291
|
+
[deviceID: string]: {
|
|
292
|
+
error_message?: string;
|
|
293
|
+
provider?: string;
|
|
294
|
+
};
|
|
291
295
|
};
|
|
292
296
|
general_errors?: string[];
|
|
293
297
|
rendered_apn_template?: string;
|
|
294
298
|
rendered_firebase_template?: string;
|
|
295
|
-
|
|
299
|
+
rendered_message?: {};
|
|
300
|
+
skip_devides?: boolean;
|
|
296
301
|
};
|
|
297
302
|
|
|
298
303
|
export type CheckSQSResponse = APIResponse & {
|
|
@@ -1048,50 +1053,7 @@ export type EventHandler<
|
|
|
1048
1053
|
UserType extends UR = UR
|
|
1049
1054
|
> = (event: Event<AttachmentType, ChannelType, CommandType, EventType, MessageType, ReactionType, UserType>) => void;
|
|
1050
1055
|
|
|
1051
|
-
export type EventTypes =
|
|
1052
|
-
| 'all'
|
|
1053
|
-
| 'channel.created'
|
|
1054
|
-
| 'channel.deleted'
|
|
1055
|
-
| 'channel.hidden'
|
|
1056
|
-
| 'channel.muted'
|
|
1057
|
-
| 'channel.truncated'
|
|
1058
|
-
| 'channel.unmuted'
|
|
1059
|
-
| 'channel.updated'
|
|
1060
|
-
| 'channel.visible'
|
|
1061
|
-
| 'transport.changed' // ws vs longpoll
|
|
1062
|
-
| 'connection.changed'
|
|
1063
|
-
| 'connection.recovered'
|
|
1064
|
-
| 'health.check'
|
|
1065
|
-
| 'member.added'
|
|
1066
|
-
| 'member.removed'
|
|
1067
|
-
| 'member.updated'
|
|
1068
|
-
| 'message.deleted'
|
|
1069
|
-
| 'message.new'
|
|
1070
|
-
| 'message.read'
|
|
1071
|
-
| 'message.updated'
|
|
1072
|
-
| 'notification.added_to_channel'
|
|
1073
|
-
| 'notification.channel_deleted'
|
|
1074
|
-
| 'notification.channel_mutes_updated'
|
|
1075
|
-
| 'notification.channel_truncated'
|
|
1076
|
-
| 'notification.invite_accepted'
|
|
1077
|
-
| 'notification.invite_rejected'
|
|
1078
|
-
| 'notification.invited'
|
|
1079
|
-
| 'notification.mark_read'
|
|
1080
|
-
| 'notification.message_new'
|
|
1081
|
-
| 'notification.mutes_updated'
|
|
1082
|
-
| 'notification.removed_from_channel'
|
|
1083
|
-
| 'reaction.deleted'
|
|
1084
|
-
| 'reaction.new'
|
|
1085
|
-
| 'reaction.updated'
|
|
1086
|
-
| 'typing.start'
|
|
1087
|
-
| 'typing.stop'
|
|
1088
|
-
| 'user.banned'
|
|
1089
|
-
| 'user.deleted'
|
|
1090
|
-
| 'user.presence.changed'
|
|
1091
|
-
| 'user.unbanned'
|
|
1092
|
-
| 'user.updated'
|
|
1093
|
-
| 'user.watching.start'
|
|
1094
|
-
| 'user.watching.stop';
|
|
1056
|
+
export type EventTypes = 'all' | keyof typeof EVENT_MAP;
|
|
1095
1057
|
|
|
1096
1058
|
/**
|
|
1097
1059
|
* Filter Types
|
|
@@ -1127,11 +1089,13 @@ export type MessageFlagsFilters = QueryFilters<
|
|
|
1127
1089
|
>;
|
|
1128
1090
|
|
|
1129
1091
|
export type FlagReportsFiltersOptions = {
|
|
1092
|
+
channel_cid?: string;
|
|
1130
1093
|
is_reviewed?: boolean;
|
|
1131
1094
|
message_id?: string;
|
|
1132
1095
|
report_id?: string;
|
|
1133
1096
|
review_result?: string;
|
|
1134
1097
|
reviewed_by?: string;
|
|
1098
|
+
team?: string;
|
|
1135
1099
|
user_id?: string;
|
|
1136
1100
|
};
|
|
1137
1101
|
|
|
@@ -1156,6 +1120,14 @@ export type FlagReportsFilters = QueryFilters<
|
|
|
1156
1120
|
message_id?:
|
|
1157
1121
|
| RequireOnlyOne<Pick<QueryFilter<FlagReportsFiltersOptions['message_id']>, '$eq' | '$in'>>
|
|
1158
1122
|
| PrimitiveFilter<FlagReportsFiltersOptions['message_id']>;
|
|
1123
|
+
} & {
|
|
1124
|
+
channel_cid?:
|
|
1125
|
+
| RequireOnlyOne<Pick<QueryFilter<FlagReportsFiltersOptions['channel_cid']>, '$eq' | '$in'>>
|
|
1126
|
+
| PrimitiveFilter<FlagReportsFiltersOptions['channel_cid']>;
|
|
1127
|
+
} & {
|
|
1128
|
+
team?:
|
|
1129
|
+
| RequireOnlyOne<Pick<QueryFilter<FlagReportsFiltersOptions['team']>, '$eq' | '$in'>>
|
|
1130
|
+
| PrimitiveFilter<FlagReportsFiltersOptions['team']>;
|
|
1159
1131
|
} & {
|
|
1160
1132
|
[Key in keyof Omit<
|
|
1161
1133
|
FlagReportsFiltersOptions,
|
|
@@ -1443,7 +1415,6 @@ export type AppSettings = {
|
|
|
1443
1415
|
huawei_config?: {
|
|
1444
1416
|
id: string;
|
|
1445
1417
|
secret: string;
|
|
1446
|
-
data_template?: string;
|
|
1447
1418
|
};
|
|
1448
1419
|
image_moderation_enabled?: boolean;
|
|
1449
1420
|
image_upload_config?: FileUploadConfig;
|
|
@@ -1457,6 +1428,10 @@ export type AppSettings = {
|
|
|
1457
1428
|
sqs_url?: string;
|
|
1458
1429
|
webhook_events?: Array<string> | null;
|
|
1459
1430
|
webhook_url?: string;
|
|
1431
|
+
xiaomi_config?: {
|
|
1432
|
+
package_name: string;
|
|
1433
|
+
secret: string;
|
|
1434
|
+
};
|
|
1460
1435
|
};
|
|
1461
1436
|
|
|
1462
1437
|
export type Attachment<T = UR> = T & {
|
|
@@ -1468,9 +1443,11 @@ export type Attachment<T = UR> = T & {
|
|
|
1468
1443
|
color?: string;
|
|
1469
1444
|
fallback?: string;
|
|
1470
1445
|
fields?: Field[];
|
|
1446
|
+
file_size?: number | string;
|
|
1471
1447
|
footer?: string;
|
|
1472
1448
|
footer_icon?: string;
|
|
1473
1449
|
image_url?: string;
|
|
1450
|
+
mime_type?: string;
|
|
1474
1451
|
og_scrape_url?: string;
|
|
1475
1452
|
original_height?: number;
|
|
1476
1453
|
original_width?: number;
|
|
@@ -1588,7 +1565,7 @@ export type CheckPushInput<UserType = UR> = {
|
|
|
1588
1565
|
user_id?: string;
|
|
1589
1566
|
};
|
|
1590
1567
|
|
|
1591
|
-
export type PushProvider = 'apn' | 'firebase' | 'huawei';
|
|
1568
|
+
export type PushProvider = 'apn' | 'firebase' | 'huawei' | 'xiaomi';
|
|
1592
1569
|
|
|
1593
1570
|
export type CommandVariants<CommandType extends string = LiteralStringForUnion> =
|
|
1594
1571
|
| 'all'
|
|
@@ -1765,7 +1742,10 @@ export type FirebaseConfig = {
|
|
|
1765
1742
|
};
|
|
1766
1743
|
|
|
1767
1744
|
export type HuaweiConfig = {
|
|
1768
|
-
|
|
1745
|
+
enabled?: boolean;
|
|
1746
|
+
};
|
|
1747
|
+
|
|
1748
|
+
export type XiaomiConfig = {
|
|
1769
1749
|
enabled?: boolean;
|
|
1770
1750
|
};
|
|
1771
1751
|
|
|
@@ -1926,7 +1906,6 @@ export type TestPushDataInput = {
|
|
|
1926
1906
|
apnTemplate?: string;
|
|
1927
1907
|
firebaseDataTemplate?: string;
|
|
1928
1908
|
firebaseTemplate?: string;
|
|
1929
|
-
huaweiDataTemplate?: string;
|
|
1930
1909
|
messageID?: string;
|
|
1931
1910
|
skipDevices?: boolean;
|
|
1932
1911
|
};
|
|
@@ -2128,3 +2107,38 @@ export type TruncateOptions<AttachmentType, MessageType, UserType> = {
|
|
|
2128
2107
|
skip_push?: boolean;
|
|
2129
2108
|
truncated_at?: Date;
|
|
2130
2109
|
};
|
|
2110
|
+
|
|
2111
|
+
export type CreateImportResponse = {
|
|
2112
|
+
import_task: ImportTask;
|
|
2113
|
+
upload_url: string;
|
|
2114
|
+
};
|
|
2115
|
+
|
|
2116
|
+
export type GetImportResponse = {
|
|
2117
|
+
import_task: ImportTask;
|
|
2118
|
+
};
|
|
2119
|
+
|
|
2120
|
+
export type ListImportsPaginationOptions = {
|
|
2121
|
+
limit?: number;
|
|
2122
|
+
offset?: number;
|
|
2123
|
+
};
|
|
2124
|
+
|
|
2125
|
+
export type ListImportsResponse = {
|
|
2126
|
+
import_tasks: ImportTask[];
|
|
2127
|
+
};
|
|
2128
|
+
|
|
2129
|
+
export type ImportTaskHistory = {
|
|
2130
|
+
created_at: string;
|
|
2131
|
+
next_state: string;
|
|
2132
|
+
prev_state: string;
|
|
2133
|
+
};
|
|
2134
|
+
|
|
2135
|
+
export type ImportTask = {
|
|
2136
|
+
created_at: string;
|
|
2137
|
+
filename: string;
|
|
2138
|
+
history: ImportTaskHistory[];
|
|
2139
|
+
id: string;
|
|
2140
|
+
state: string;
|
|
2141
|
+
updated_at: string;
|
|
2142
|
+
result?: UR;
|
|
2143
|
+
size?: number;
|
|
2144
|
+
};
|