@@ -477,14 +477,6 @@ export type FormatMessageResponse = Omit<
477
477
updated_at : Date ;
478
478
} ;
479
479
480
- export type GetChannelTypeResponse = APIResponse &
481
- Omit < CreateChannelOptions , 'client_id' | 'connection_id' | 'commands' > & {
482
- created_at : string ;
483
- updated_at : string ;
484
- commands ?: CommandResponse [ ] ;
485
- grants ?: Record < string , string [ ] > ;
486
- } ;
487
-
488
480
export type GetCommandResponse = APIResponse & CreateCommandOptions & CreatedAtUpdatedAt ;
489
481
490
482
export type GetMessageAPIResponse = SendMessageAPIResponse ;
@@ -1004,22 +996,173 @@ export type DeactivateUsersOptions = {
1004
996
1005
997
export type NewMemberPayload = CustomMemberData & Pick < ChannelMemberResponse , 'user_id' | 'channel_role' > ;
1006
998
1007
- export type UpdateChannelOptions = {
1008
- accept_invite ?: boolean ;
1009
- add_members ?: string [ ] ;
1010
- add_moderators ?: string [ ] ;
1011
- client_id ?: string ;
1012
- connection_id ?: string ;
1013
- data ?: Omit < ChannelResponse , 'id' | 'cid' > ;
1014
- demote_moderators ?: string [ ] ;
1015
- invites ?: string [ ] ;
1016
- message ?: MessageResponse ;
1017
- reject_invite ?: boolean ;
1018
- remove_members ?: string [ ] ;
1019
- user ?: UserResponse ;
1020
- user_id ?: string ;
999
+ export type Thresholds = Record < 'explicit' | 'spam' | 'toxic' , { block : number ; flag : number } > ;
1000
+
1001
+ export type BlockListOptions = {
1002
+ behavior : BlocklistBehavior ;
1003
+ blocklist : string ;
1004
+ } ;
1005
+
1006
+ export type PolicyRequest = {
1007
+ action : 'Deny' | 'Allow' | ( string & { } ) ;
1008
+ /**
1009
+ * @description User-friendly policy name
1010
+ */
1011
+ name : string ;
1012
+ /**
1013
+ * @description Whether policy applies to resource owner or not
1014
+ */
1015
+ owner : boolean ;
1016
+ priority : number ;
1017
+ /**
1018
+ * @description List of resources to apply policy to
1019
+ */
1020
+ resources : string [ ] ;
1021
+ /**
1022
+ * @description List of roles to apply policy to
1023
+ */
1024
+ roles : string [ ] ;
1025
+ } ;
1026
+
1027
+ export type Automod = 'disabled' | 'simple' | 'AI' | ( string & { } ) ;
1028
+ export type AutomodBehavior = 'flag' | 'block' | 'shadow_block' | ( string & { } ) ;
1029
+ export type BlocklistBehavior = AutomodBehavior ;
1030
+
1031
+ export type UpdateChannelTypeRequest =
1032
+ // these three properties are required in OpenAPI spec but omitted in some QA tests
1033
+ Partial < {
1034
+ automod : Automod ;
1035
+ automod_behavior : AutomodBehavior ;
1036
+ max_message_length : number ;
1037
+ } > & {
1038
+ allowed_flag_reasons ?: string [ ] ;
1039
+ automod_thresholds ?: Thresholds ;
1040
+ blocklist ?: string ;
1041
+ blocklist_behavior ?: BlocklistBehavior ;
1042
+ blocklists ?: BlockListOptions [ ] ;
1043
+ commands ?: CommandVariants [ ] ;
1044
+ connect_events ?: boolean ;
1045
+ custom_events ?: boolean ;
1046
+ grants ?: Record < string , string [ ] > ;
1047
+ mark_messages_pending ?: boolean ;
1048
+ mutes ?: boolean ;
1049
+ partition_size ?: number ;
1050
+ /**
1051
+ * @example 24h
1052
+ */
1053
+ partition_ttl ?: string | null ;
1054
+ permissions ?: PolicyRequest [ ] ;
1055
+ polls ?: boolean ;
1056
+ push_notifications ?: boolean ;
1057
+ quotes ?: boolean ;
1058
+ reactions ?: boolean ;
1059
+ read_events ?: boolean ;
1060
+ reminders ?: boolean ;
1061
+ replies ?: boolean ;
1062
+ search ?: boolean ;
1063
+ skip_last_msg_update_for_system_msgs ?: boolean ;
1064
+ typing_events ?: boolean ;
1065
+ uploads ?: boolean ;
1066
+ url_enrichment ?: boolean ;
1067
+ } ;
1068
+
1069
+ export type UpdateChannelTypeResponse = {
1070
+ automod : Automod ;
1071
+ automod_behavior : AutomodBehavior ;
1072
+ commands : CommandVariants [ ] ;
1073
+ connect_events : boolean ;
1074
+ created_at : string ;
1075
+ custom_events : boolean ;
1076
+ duration : string ;
1077
+ grants : Record < string , string [ ] > ;
1078
+ mark_messages_pending : boolean ;
1079
+ max_message_length : number ;
1080
+ mutes : boolean ;
1081
+ name : string ;
1082
+ permissions : PolicyRequest [ ] ;
1083
+ polls : boolean ;
1084
+ push_notifications : boolean ;
1085
+ quotes : boolean ;
1086
+ reactions : boolean ;
1087
+ read_events : boolean ;
1088
+ reminders : boolean ;
1089
+ replies : boolean ;
1090
+ search : boolean ;
1091
+ skip_last_msg_update_for_system_msgs : boolean ;
1092
+ typing_events : boolean ;
1093
+ updated_at : string ;
1094
+ uploads : boolean ;
1095
+ url_enrichment : boolean ;
1096
+ allowed_flag_reasons ?: string [ ] ;
1097
+ automod_thresholds ?: Thresholds ;
1098
+ blocklist ?: string ;
1099
+ blocklist_behavior ?: BlocklistBehavior ;
1100
+ blocklists ?: BlockListOptions [ ] ;
1101
+ partition_size ?: number ;
1102
+ partition_ttl ?: string ;
1103
+ } ;
1104
+
1105
+ export type Command = {
1106
+ args : string ;
1107
+ description : string ;
1108
+ name : string ;
1109
+ set : string ;
1110
+ created_at ?: string ;
1111
+ updated_at ?: string ;
1112
+ } ;
1113
+
1114
+ export type GetChannelTypeResponse = {
1115
+ automod : Automod ;
1116
+ automod_behavior : AutomodBehavior ;
1117
+ commands : Command [ ] ;
1118
+ connect_events : boolean ;
1119
+ created_at : string ;
1120
+ custom_events : boolean ;
1121
+ duration : string ;
1122
+ grants : Record < string , string [ ] > ;
1123
+ mark_messages_pending : boolean ;
1124
+ max_message_length : number ;
1125
+ mutes : boolean ;
1126
+ name : string ;
1127
+ permissions : PolicyRequest [ ] ;
1128
+ polls : boolean ;
1129
+ push_notifications : boolean ;
1130
+ quotes : boolean ;
1131
+ reactions : boolean ;
1132
+ read_events : boolean ;
1133
+ reminders : boolean ;
1134
+ replies : boolean ;
1135
+ search : boolean ;
1136
+ skip_last_msg_update_for_system_msgs : boolean ;
1137
+ typing_events : boolean ;
1138
+ updated_at : string ;
1139
+ uploads : boolean ;
1140
+ url_enrichment : boolean ;
1141
+ allowed_flag_reasons ?: string [ ] ;
1142
+ automod_thresholds ?: Thresholds ;
1143
+ blocklist ?: string ;
1144
+ blocklist_behavior ?: BlocklistBehavior ;
1145
+ blocklists ?: BlockListOptions [ ] ;
1146
+ partition_size ?: number ;
1147
+ partition_ttl ?: string ;
1021
1148
} ;
1022
1149
1150
+ export type UpdateChannelOptions = Partial < {
1151
+ accept_invite : boolean ;
1152
+ add_members : string [ ] ;
1153
+ add_moderators : string [ ] ;
1154
+ client_id : string ;
1155
+ connection_id : string ;
1156
+ data : Omit < ChannelResponse , 'id' | 'cid' > ;
1157
+ demote_moderators : string [ ] ;
1158
+ invites : string [ ] ;
1159
+ message : MessageResponse ;
1160
+ reject_invite : boolean ;
1161
+ remove_members : string [ ] ;
1162
+ user : UserResponse ;
1163
+ user_id : string ;
1164
+ } > ;
1165
+
1023
1166
export type MarkChannelsReadOptions = {
1024
1167
client_id ?: string ;
1025
1168
connection_id ?: string ;
@@ -1461,25 +1604,30 @@ export type ReactionFilters = QueryFilters<
1461
1604
1462
1605
export type ChannelFilters = QueryFilters <
1463
1606
ContainsOperator < CustomChannelData > & {
1607
+ archived ?: boolean ;
1608
+ 'member.user.name' ?:
1609
+ | RequireOnlyOne < {
1610
+ $autocomplete ?: string ;
1611
+ $eq ?: string ;
1612
+ } >
1613
+ | string ;
1614
+
1464
1615
members ?:
1465
1616
| RequireOnlyOne < Pick < QueryFilter < string > , '$in' > >
1466
1617
| RequireOnlyOne < Pick < QueryFilter < string [ ] > , '$eq' > >
1467
1618
| PrimitiveFilter < string [ ] > ;
1468
- } & {
1469
1619
name ?:
1470
1620
| RequireOnlyOne <
1471
1621
{
1472
1622
$autocomplete ?: ChannelResponse [ 'name' ] ;
1473
1623
} & QueryFilter < ChannelResponse [ 'name' ] >
1474
1624
>
1475
1625
| PrimitiveFilter < ChannelResponse [ 'name' ] > ;
1626
+ pinned ?: boolean ;
1476
1627
} & {
1477
1628
[ Key in keyof Omit < ChannelResponse , 'name' | 'members' | keyof CustomChannelData > ] :
1478
1629
| RequireOnlyOne < QueryFilter < ChannelResponse [ Key ] > >
1479
1630
| PrimitiveFilter < ChannelResponse [ Key ] > ;
1480
- } & {
1481
- archived ?: boolean ;
1482
- pinned ?: boolean ;
1483
1631
}
1484
1632
> ;
1485
1633
@@ -1591,6 +1739,13 @@ export type ContainsOperator<CustomType = {}> = {
1591
1739
1592
1740
export type MessageFilters = QueryFilters <
1593
1741
ContainsOperator < CustomMessageData > & {
1742
+ 'attachments.type' ?:
1743
+ | RequireOnlyOne < {
1744
+ $eq : PrimitiveFilter < Attachment [ 'type' ] > ;
1745
+ $in : PrimitiveFilter < Attachment [ 'type' ] > [ ] ;
1746
+ } >
1747
+ | PrimitiveFilter < Attachment [ 'type' ] > ;
1748
+ 'mentioned_users.id' ?: RequireOnlyOne < { $contains : PrimitiveFilter < UserResponse [ 'id' ] > } > ;
1594
1749
text ?:
1595
1750
| RequireOnlyOne <
1596
1751
{
@@ -1599,6 +1754,13 @@ export type MessageFilters = QueryFilters<
1599
1754
} & QueryFilter < MessageResponse [ 'text' ] >
1600
1755
>
1601
1756
| PrimitiveFilter < MessageResponse [ 'text' ] > ;
1757
+ 'user.id' ?:
1758
+ | RequireOnlyOne <
1759
+ {
1760
+ $autocomplete ?: UserResponse [ 'id' ] ;
1761
+ } & QueryFilter < UserResponse [ 'id' ] >
1762
+ >
1763
+ | PrimitiveFilter < UserResponse [ 'id' ] > ;
1602
1764
} & {
1603
1765
[ Key in keyof Omit < MessageResponse , 'text' | keyof CustomMessageData > ] ?:
1604
1766
| RequireOnlyOne < QueryFilter < MessageResponse [ Key ] > >
@@ -1693,6 +1855,9 @@ export type MemberFilters = QueryFilters<
1693
1855
} >
1694
1856
| UserResponse [ 'id' ] ;
1695
1857
invite ?: { $eq ?: ChannelMemberResponse [ 'status' ] } | ChannelMemberResponse [ 'status' ] ;
1858
+ is_moderator ?:
1859
+ | RequireOnlyOne < { $eq ?: ChannelMemberResponse [ 'is_moderator' ] } >
1860
+ | ChannelMemberResponse [ 'is_moderator' ] ;
1696
1861
joined ?: { $eq ?: boolean } | boolean ;
1697
1862
last_active ?:
1698
1863
| {
@@ -1711,6 +1876,9 @@ export type MemberFilters = QueryFilters<
1711
1876
$q ?: NonNullable < ChannelMemberResponse [ 'user' ] > [ 'name' ] ;
1712
1877
} >
1713
1878
| PrimitiveFilter < NonNullable < ChannelMemberResponse [ 'user' ] > [ 'name' ] > ;
1879
+ notifications_muted ?:
1880
+ | RequireOnlyOne < { $eq ?: ChannelMemberResponse [ 'notifications_muted' ] } >
1881
+ | ChannelMemberResponse [ 'notifications_muted' ] ;
1714
1882
updated_at ?:
1715
1883
| {
1716
1884
$eq ?: ChannelMemberResponse [ 'updated_at' ] ;
@@ -1732,7 +1900,7 @@ export type MemberFilters = QueryFilters<
1732
1900
$eq ?: ChannelMemberResponse [ 'user_id' ] ;
1733
1901
$in ?: ChannelMemberResponse [ 'user_id' ] [ ] ;
1734
1902
} >
1735
- | PrimitiveFilter < NonNullable < ChannelMemberResponse [ 'user' ] > [ 'id' ] [ ] > ;
1903
+ | PrimitiveFilter < ChannelMemberResponse [ 'user_id' ] > ;
1736
1904
} & {
1737
1905
[ Key in keyof ContainsOperator < CustomMemberData > ] ?:
1738
1906
| RequireOnlyOne < QueryFilter < ContainsOperator < CustomMemberData > [ Key ] > >
@@ -1956,6 +2124,7 @@ export type Attachment = CustomAttachmentData & {
1956
2124
original_height ?: number ;
1957
2125
original_width ?: number ;
1958
2126
pretext ?: string ;
2127
+ stopped_sharing ?: boolean ;
1959
2128
text ?: string ;
1960
2129
thumb_url ?: string ;
1961
2130
title ?: string ;
@@ -1990,15 +2159,13 @@ export type ChannelConfig = ChannelConfigFields &
1990
2159
commands ?: CommandVariants [ ] ;
1991
2160
} ;
1992
2161
1993
- export type ChannelConfigAutomod = '' | ' AI' | 'disabled' | 'simple' ;
2162
+ export type ChannelConfigAutomod = 'AI' | 'disabled' | 'simple' | ( string & { } ) ;
1994
2163
1995
- export type ChannelConfigAutomodBehavior = '' | 'block ' | 'flag' ;
2164
+ export type ChannelConfigAutomodBehavior = 'block ' | 'flag ' | ( string & { } ) ;
1996
2165
1997
- export type ChannelConfigAutomodThresholds = null | {
1998
- explicit ?: { block ?: number ; flag ?: number } ;
1999
- spam ?: { block ?: number ; flag ?: number } ;
2000
- toxic ?: { block ?: number ; flag ?: number } ;
2001
- } ;
2166
+ export type ChannelConfigAutomodThresholds = null | Partial <
2167
+ Record < 'explicit' | 'spam' | 'toxic' , { block ?: number ; flag ?: number } >
2168
+ > ;
2002
2169
2003
2170
export type ChannelConfigFields = {
2004
2171
reminders : boolean ;
@@ -2283,13 +2450,15 @@ export type EndpointName =
2283
2450
| 'ListPushProviders'
2284
2451
| 'CreatePoll' ;
2285
2452
2286
- export type ExportChannelRequest = {
2287
- id : string ;
2288
- type : string ;
2289
- cid ?: string ;
2290
- messages_since ?: Date ;
2291
- messages_until ?: Date ;
2292
- } ;
2453
+ export type ExportChannelRequest = (
2454
+ | {
2455
+ id : string ;
2456
+ type : string ;
2457
+ }
2458
+ | {
2459
+ cid : string ;
2460
+ }
2461
+ ) & { messages_since ?: Date ; messages_until ?: Date } ;
2293
2462
2294
2463
export type ExportChannelOptions = {
2295
2464
clear_deleted_message_text ?: boolean ;
@@ -2628,7 +2797,10 @@ export type ReservedMessageFields =
2628
2797
| 'updated_at'
2629
2798
| 'user' ;
2630
2799
2631
- export type UpdatedMessage = Omit < MessageResponse , 'mentioned_users' > & { mentioned_users ?: string [ ] } ;
2800
+ export type UpdatedMessage = Omit < MessageResponse , 'mentioned_users' | 'type' > & {
2801
+ mentioned_users ?: string [ ] ;
2802
+ type ?: MessageLabel ;
2803
+ } ;
2632
2804
2633
2805
export type User = CustomUserData & {
2634
2806
id : string ;
@@ -2953,6 +3125,7 @@ export type UpdatePollAPIResponse = {
2953
3125
2954
3126
export type PollResponse = CustomPollData &
2955
3127
PollEnrichData & {
3128
+ cid : string ;
2956
3129
created_at : string ;
2957
3130
created_by : UserResponse | null ;
2958
3131
created_by_id : string ;
0 commit comments