stream-chat 6.0.0 → 6.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/README.md +49 -112
- package/dist/browser.es.js +871 -331
- 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 +871 -331
- package/dist/browser.js.map +1 -1
- package/dist/index.es.js +871 -331
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +871 -331
- package/dist/index.js.map +1 -1
- package/dist/types/channel.d.ts +7 -6
- package/dist/types/channel.d.ts.map +1 -1
- package/dist/types/channel_state.d.ts +36 -5
- package/dist/types/channel_state.d.ts.map +1 -1
- package/dist/types/client.d.ts +58 -3
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/types.d.ts +119 -4
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/channel.ts +30 -18
- package/src/channel_state.ts +238 -49
- package/src/client.ts +96 -5
- package/src/types.ts +167 -4
package/src/types.ts
CHANGED
|
@@ -120,6 +120,7 @@ export type AppSettingsAPIResponse<StreamChatGenerics extends ExtendableGenerics
|
|
|
120
120
|
apn?: APNConfig;
|
|
121
121
|
firebase?: FirebaseConfig;
|
|
122
122
|
huawei?: HuaweiConfig;
|
|
123
|
+
providers?: PushProviderConfig[];
|
|
123
124
|
xiaomi?: XiaomiConfig;
|
|
124
125
|
};
|
|
125
126
|
revoke_tokens_issued_before?: string | null;
|
|
@@ -147,6 +148,31 @@ export type ModerationResult = {
|
|
|
147
148
|
moderated_by?: string;
|
|
148
149
|
};
|
|
149
150
|
|
|
151
|
+
export type AutomodDetails = {
|
|
152
|
+
action?: string;
|
|
153
|
+
image_labels?: Array<string>;
|
|
154
|
+
original_message_type?: string;
|
|
155
|
+
result?: ModerationResult;
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
export type FlagDetails = {
|
|
159
|
+
automod?: AutomodDetails;
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
export type Flag<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
|
|
163
|
+
created_at: string;
|
|
164
|
+
created_by_automod: boolean;
|
|
165
|
+
updated_at: string;
|
|
166
|
+
details?: FlagDetails;
|
|
167
|
+
target_message?: MessageResponse<StreamChatGenerics>;
|
|
168
|
+
target_user?: UserResponse<StreamChatGenerics>;
|
|
169
|
+
user?: UserResponse<StreamChatGenerics>;
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
export type FlagsResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
|
|
173
|
+
flags?: Array<Flag<StreamChatGenerics>>;
|
|
174
|
+
};
|
|
175
|
+
|
|
150
176
|
export type MessageFlagsResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
|
|
151
177
|
flags?: Array<{
|
|
152
178
|
message: MessageResponse<StreamChatGenerics>;
|
|
@@ -168,7 +194,7 @@ export type FlagReport<StreamChatGenerics extends ExtendableGenerics = DefaultGe
|
|
|
168
194
|
message: MessageResponse<StreamChatGenerics>;
|
|
169
195
|
user: UserResponse<StreamChatGenerics>;
|
|
170
196
|
created_at?: string;
|
|
171
|
-
details?:
|
|
197
|
+
details?: FlagDetails;
|
|
172
198
|
review_result?: string;
|
|
173
199
|
reviewed_at?: string;
|
|
174
200
|
reviewed_by?: UserResponse<StreamChatGenerics>;
|
|
@@ -632,6 +658,11 @@ export type MessageFlagsPaginationOptions = {
|
|
|
632
658
|
offset?: number;
|
|
633
659
|
};
|
|
634
660
|
|
|
661
|
+
export type FlagsPaginationOptions = {
|
|
662
|
+
limit?: number;
|
|
663
|
+
offset?: number;
|
|
664
|
+
};
|
|
665
|
+
|
|
635
666
|
export type FlagReportsPaginationOptions = {
|
|
636
667
|
limit?: number;
|
|
637
668
|
offset?: number;
|
|
@@ -963,10 +994,48 @@ export type MessageFlagsFilters = QueryFilters<
|
|
|
963
994
|
}
|
|
964
995
|
>;
|
|
965
996
|
|
|
997
|
+
export type FlagsFiltersOptions = {
|
|
998
|
+
channel_cid?: string;
|
|
999
|
+
message_id?: string;
|
|
1000
|
+
message_user_id?: string;
|
|
1001
|
+
reporter_id?: string;
|
|
1002
|
+
team?: string;
|
|
1003
|
+
user_id?: string;
|
|
1004
|
+
};
|
|
1005
|
+
|
|
1006
|
+
export type FlagsFilters = QueryFilters<
|
|
1007
|
+
{
|
|
1008
|
+
user_id?:
|
|
1009
|
+
| RequireOnlyOne<Pick<QueryFilter<FlagsFiltersOptions['user_id']>, '$eq' | '$in'>>
|
|
1010
|
+
| PrimitiveFilter<FlagsFiltersOptions['user_id']>;
|
|
1011
|
+
} & {
|
|
1012
|
+
message_id?:
|
|
1013
|
+
| RequireOnlyOne<Pick<QueryFilter<FlagsFiltersOptions['message_id']>, '$eq' | '$in'>>
|
|
1014
|
+
| PrimitiveFilter<FlagsFiltersOptions['message_id']>;
|
|
1015
|
+
} & {
|
|
1016
|
+
message_user_id?:
|
|
1017
|
+
| RequireOnlyOne<Pick<QueryFilter<FlagsFiltersOptions['message_user_id']>, '$eq' | '$in'>>
|
|
1018
|
+
| PrimitiveFilter<FlagsFiltersOptions['message_user_id']>;
|
|
1019
|
+
} & {
|
|
1020
|
+
channel_cid?:
|
|
1021
|
+
| RequireOnlyOne<Pick<QueryFilter<FlagsFiltersOptions['channel_cid']>, '$eq' | '$in'>>
|
|
1022
|
+
| PrimitiveFilter<FlagsFiltersOptions['channel_cid']>;
|
|
1023
|
+
} & {
|
|
1024
|
+
reporter_id?:
|
|
1025
|
+
| RequireOnlyOne<Pick<QueryFilter<FlagsFiltersOptions['reporter_id']>, '$eq' | '$in'>>
|
|
1026
|
+
| PrimitiveFilter<FlagsFiltersOptions['reporter_id']>;
|
|
1027
|
+
} & {
|
|
1028
|
+
team?:
|
|
1029
|
+
| RequireOnlyOne<Pick<QueryFilter<FlagsFiltersOptions['team']>, '$eq' | '$in'>>
|
|
1030
|
+
| PrimitiveFilter<FlagsFiltersOptions['team']>;
|
|
1031
|
+
}
|
|
1032
|
+
>;
|
|
1033
|
+
|
|
966
1034
|
export type FlagReportsFiltersOptions = {
|
|
967
1035
|
channel_cid?: string;
|
|
968
1036
|
is_reviewed?: boolean;
|
|
969
1037
|
message_id?: string;
|
|
1038
|
+
message_user_id?: string;
|
|
970
1039
|
report_id?: string;
|
|
971
1040
|
review_result?: string;
|
|
972
1041
|
reviewed_by?: string;
|
|
@@ -995,6 +1064,10 @@ export type FlagReportsFilters = QueryFilters<
|
|
|
995
1064
|
message_id?:
|
|
996
1065
|
| RequireOnlyOne<Pick<QueryFilter<FlagReportsFiltersOptions['message_id']>, '$eq' | '$in'>>
|
|
997
1066
|
| PrimitiveFilter<FlagReportsFiltersOptions['message_id']>;
|
|
1067
|
+
} & {
|
|
1068
|
+
message_user_id?:
|
|
1069
|
+
| RequireOnlyOne<Pick<QueryFilter<FlagReportsFiltersOptions['message_user_id']>, '$eq' | '$in'>>
|
|
1070
|
+
| PrimitiveFilter<FlagReportsFiltersOptions['message_user_id']>;
|
|
998
1071
|
} & {
|
|
999
1072
|
channel_cid?:
|
|
1000
1073
|
| RequireOnlyOne<Pick<QueryFilter<FlagReportsFiltersOptions['channel_cid']>, '$eq' | '$in'>>
|
|
@@ -1010,6 +1083,7 @@ export type FlagReportsFilters = QueryFilters<
|
|
|
1010
1083
|
>]: RequireOnlyOne<QueryFilter<FlagReportsFiltersOptions[Key]>> | PrimitiveFilter<FlagReportsFiltersOptions[Key]>;
|
|
1011
1084
|
}
|
|
1012
1085
|
>;
|
|
1086
|
+
|
|
1013
1087
|
export type BannedUsersFilterOptions = {
|
|
1014
1088
|
banned_by_id?: string;
|
|
1015
1089
|
channel_cid?: string;
|
|
@@ -1340,6 +1414,7 @@ export type Action = {
|
|
|
1340
1414
|
export type AnonUserType = {};
|
|
1341
1415
|
|
|
1342
1416
|
export type APNConfig = {
|
|
1417
|
+
auth_key?: string;
|
|
1343
1418
|
auth_type?: string;
|
|
1344
1419
|
bundle_id?: string;
|
|
1345
1420
|
development?: boolean;
|
|
@@ -1347,6 +1422,7 @@ export type APNConfig = {
|
|
|
1347
1422
|
host?: string;
|
|
1348
1423
|
key_id?: string;
|
|
1349
1424
|
notification_template?: string;
|
|
1425
|
+
p12_cert?: string;
|
|
1350
1426
|
team_id?: string;
|
|
1351
1427
|
};
|
|
1352
1428
|
|
|
@@ -1371,7 +1447,7 @@ export type AppSettings = {
|
|
|
1371
1447
|
// all possible file mime types are https://www.iana.org/assignments/media-types/media-types.xhtml
|
|
1372
1448
|
file_upload_config?: FileUploadConfig;
|
|
1373
1449
|
firebase_config?: {
|
|
1374
|
-
credentials_json
|
|
1450
|
+
credentials_json?: string;
|
|
1375
1451
|
data_template?: string;
|
|
1376
1452
|
notification_template?: string;
|
|
1377
1453
|
server_key?: string;
|
|
@@ -1413,6 +1489,7 @@ export type Attachment<
|
|
|
1413
1489
|
file_size?: number | string;
|
|
1414
1490
|
footer?: string;
|
|
1415
1491
|
footer_icon?: string;
|
|
1492
|
+
giphy?: GiphyData;
|
|
1416
1493
|
image_url?: string;
|
|
1417
1494
|
mime_type?: string;
|
|
1418
1495
|
og_scrape_url?: string;
|
|
@@ -1534,6 +1611,54 @@ export type CheckPushInput<StreamChatGenerics extends ExtendableGenerics = Defau
|
|
|
1534
1611
|
|
|
1535
1612
|
export type PushProvider = 'apn' | 'firebase' | 'huawei' | 'xiaomi';
|
|
1536
1613
|
|
|
1614
|
+
export type PushProviderConfig = PushProviderCommon &
|
|
1615
|
+
PushProviderAPN &
|
|
1616
|
+
PushProviderFirebase &
|
|
1617
|
+
PushProviderHuawei &
|
|
1618
|
+
PushProviderXiaomi;
|
|
1619
|
+
|
|
1620
|
+
export type PushProviderID = {
|
|
1621
|
+
name: string;
|
|
1622
|
+
type: PushProvider;
|
|
1623
|
+
};
|
|
1624
|
+
|
|
1625
|
+
export type PushProviderCommon = {
|
|
1626
|
+
created_at: string;
|
|
1627
|
+
updated_at: string;
|
|
1628
|
+
description?: string;
|
|
1629
|
+
disabled_at?: string;
|
|
1630
|
+
disabled_reason?: string;
|
|
1631
|
+
};
|
|
1632
|
+
|
|
1633
|
+
export type PushProviderAPN = {
|
|
1634
|
+
apn_auth_key?: string;
|
|
1635
|
+
apn_auth_type?: 'token' | 'certificate';
|
|
1636
|
+
apn_development?: boolean;
|
|
1637
|
+
apn_host?: string;
|
|
1638
|
+
apn_key_id?: string;
|
|
1639
|
+
apn_notification_template?: string;
|
|
1640
|
+
apn_p12_cert?: string;
|
|
1641
|
+
apn_team_id?: string;
|
|
1642
|
+
apn_topic?: string;
|
|
1643
|
+
};
|
|
1644
|
+
|
|
1645
|
+
export type PushProviderFirebase = {
|
|
1646
|
+
firebase_credentials?: string;
|
|
1647
|
+
firebase_data_template?: string;
|
|
1648
|
+
firebase_notification_template?: string;
|
|
1649
|
+
firebase_server_key?: string;
|
|
1650
|
+
};
|
|
1651
|
+
|
|
1652
|
+
export type PushProviderHuawei = {
|
|
1653
|
+
huawei_app_id?: string;
|
|
1654
|
+
huawei_app_secret?: string;
|
|
1655
|
+
};
|
|
1656
|
+
|
|
1657
|
+
export type PushProviderXiaomi = {
|
|
1658
|
+
xiaomi_package_name?: string;
|
|
1659
|
+
xiaomi_secret?: string;
|
|
1660
|
+
};
|
|
1661
|
+
|
|
1537
1662
|
export type CommandVariants<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> =
|
|
1538
1663
|
| 'all'
|
|
1539
1664
|
| 'ban'
|
|
@@ -1702,14 +1827,38 @@ export type FirebaseConfig = {
|
|
|
1702
1827
|
data_template?: string;
|
|
1703
1828
|
enabled?: boolean;
|
|
1704
1829
|
notification_template?: string;
|
|
1830
|
+
server_key?: string;
|
|
1831
|
+
};
|
|
1832
|
+
|
|
1833
|
+
type GiphyVersionInfo = {
|
|
1834
|
+
height: string;
|
|
1835
|
+
url: string;
|
|
1836
|
+
width: string;
|
|
1837
|
+
};
|
|
1838
|
+
|
|
1839
|
+
type GiphyVersions =
|
|
1840
|
+
| 'original'
|
|
1841
|
+
| 'fixed_height'
|
|
1842
|
+
| 'fixed_height_still'
|
|
1843
|
+
| 'fixed_height_downsampled'
|
|
1844
|
+
| 'fixed_width'
|
|
1845
|
+
| 'fixed_width_still'
|
|
1846
|
+
| 'fixed_width_downsampled';
|
|
1847
|
+
|
|
1848
|
+
type GiphyData = {
|
|
1849
|
+
[key in GiphyVersions]: GiphyVersionInfo;
|
|
1705
1850
|
};
|
|
1706
1851
|
|
|
1707
1852
|
export type HuaweiConfig = {
|
|
1708
1853
|
enabled?: boolean;
|
|
1854
|
+
id?: string;
|
|
1855
|
+
secret?: string;
|
|
1709
1856
|
};
|
|
1710
1857
|
|
|
1711
1858
|
export type XiaomiConfig = {
|
|
1712
1859
|
enabled?: boolean;
|
|
1860
|
+
package_name?: string;
|
|
1861
|
+
secret?: string;
|
|
1713
1862
|
};
|
|
1714
1863
|
|
|
1715
1864
|
export type LiteralStringForUnion = string & {};
|
|
@@ -2057,9 +2206,13 @@ export type TruncateOptions<StreamChatGenerics extends ExtendableGenerics = Defa
|
|
|
2057
2206
|
truncated_at?: Date;
|
|
2058
2207
|
};
|
|
2059
2208
|
|
|
2209
|
+
export type CreateImportURLResponse = {
|
|
2210
|
+
path: string;
|
|
2211
|
+
upload_url: string;
|
|
2212
|
+
};
|
|
2213
|
+
|
|
2060
2214
|
export type CreateImportResponse = {
|
|
2061
2215
|
import_task: ImportTask;
|
|
2062
|
-
upload_url: string;
|
|
2063
2216
|
};
|
|
2064
2217
|
|
|
2065
2218
|
export type GetImportResponse = {
|
|
@@ -2083,11 +2236,21 @@ export type ImportTaskHistory = {
|
|
|
2083
2236
|
|
|
2084
2237
|
export type ImportTask = {
|
|
2085
2238
|
created_at: string;
|
|
2086
|
-
filename: string;
|
|
2087
2239
|
history: ImportTaskHistory[];
|
|
2088
2240
|
id: string;
|
|
2241
|
+
path: string;
|
|
2089
2242
|
state: string;
|
|
2090
2243
|
updated_at: string;
|
|
2091
2244
|
result?: UR;
|
|
2092
2245
|
size?: number;
|
|
2093
2246
|
};
|
|
2247
|
+
|
|
2248
|
+
export type MessageSetType = 'latest' | 'current' | 'new';
|
|
2249
|
+
|
|
2250
|
+
export type PushProviderUpsertResponse = {
|
|
2251
|
+
push_provider: PushProvider;
|
|
2252
|
+
};
|
|
2253
|
+
|
|
2254
|
+
export type PushProviderListResponse = {
|
|
2255
|
+
push_providers: PushProvider[];
|
|
2256
|
+
};
|