Skip to content

Commit 6244941

Browse files
committed
chore: newest schema (v205.1.0-4-g965f446553)
1 parent d4b739f commit 6244941

File tree

5 files changed

+527
-119
lines changed

5 files changed

+527
-119
lines changed

src/gen/chat/ChatApi.ts

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ import {
3636
ListChannelTypesResponse,
3737
ListCommandsResponse,
3838
MarkChannelsReadRequest,
39+
MarkDeliveredRequest,
40+
MarkDeliveredResponse,
3941
MarkReadRequest,
4042
MarkReadResponse,
4143
MarkUnreadRequest,
@@ -62,10 +64,10 @@ import {
6264
QueryReactionsResponse,
6365
QueryRemindersRequest,
6466
QueryRemindersResponse,
65-
QuerySegmentsRequest,
66-
QuerySegmentsResponse,
6767
QuerySegmentTargetsRequest,
6868
QuerySegmentTargetsResponse,
69+
QuerySegmentsRequest,
70+
QuerySegmentsResponse,
6971
QueryThreadsRequest,
7072
QueryThreadsResponse,
7173
ReminderResponseData,
@@ -278,6 +280,32 @@ export class ChatApi {
278280
return { ...response.body, metadata: response.metadata };
279281
}
280282

283+
async markDelivered(
284+
request?: MarkDeliveredRequest & { user_id?: string },
285+
): Promise<StreamResponse<MarkDeliveredResponse>> {
286+
const queryParams = {
287+
user_id: request?.user_id,
288+
};
289+
const body = {
290+
latest_delivered_messages: request?.latest_delivered_messages,
291+
};
292+
293+
const response = await this.apiClient.sendRequest<
294+
StreamResponse<MarkDeliveredResponse>
295+
>(
296+
'POST',
297+
'/api/v2/chat/channels/delivered',
298+
undefined,
299+
queryParams,
300+
body,
301+
'application/json',
302+
);
303+
304+
decoders.MarkDeliveredResponse?.(response.body);
305+
306+
return { ...response.body, metadata: response.metadata };
307+
}
308+
281309
async markChannelsRead(
282310
request?: MarkChannelsReadRequest,
283311
): Promise<StreamResponse<MarkReadResponse>> {
@@ -398,14 +426,17 @@ export class ChatApi {
398426
accept_invite: request?.accept_invite,
399427
cooldown: request?.cooldown,
400428
hide_history: request?.hide_history,
429+
hide_history_before: request?.hide_history_before,
401430
reject_invite: request?.reject_invite,
402431
skip_push: request?.skip_push,
403432
user_id: request?.user_id,
433+
add_filter_tags: request?.add_filter_tags,
404434
add_members: request?.add_members,
405435
add_moderators: request?.add_moderators,
406436
assign_roles: request?.assign_roles,
407437
demote_moderators: request?.demote_moderators,
408438
invites: request?.invites,
439+
remove_filter_tags: request?.remove_filter_tags,
409440
remove_members: request?.remove_members,
410441
data: request?.data,
411442
message: request?.message,
@@ -875,6 +906,7 @@ export class ChatApi {
875906
};
876907
const body = {
877908
message_id: request?.message_id,
909+
message_timestamp: request?.message_timestamp,
878910
thread_id: request?.thread_id,
879911
user_id: request?.user_id,
880912
user: request?.user,
@@ -2122,10 +2154,16 @@ export class ChatApi {
21222154
return { ...response.body, metadata: response.metadata };
21232155
}
21242156

2125-
async unreadCounts(): Promise<StreamResponse<WrappedUnreadCountsResponse>> {
2157+
async unreadCounts(request?: {
2158+
user_id?: string;
2159+
}): Promise<StreamResponse<WrappedUnreadCountsResponse>> {
2160+
const queryParams = {
2161+
user_id: request?.user_id,
2162+
};
2163+
21262164
const response = await this.apiClient.sendRequest<
21272165
StreamResponse<WrappedUnreadCountsResponse>
2128-
>('GET', '/api/v2/chat/unread', undefined, undefined);
2166+
>('GET', '/api/v2/chat/unread', undefined, queryParams);
21292167

21302168
decoders.WrappedUnreadCountsResponse?.(response.body);
21312169

src/gen/common/CommonApi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ import {
3737
FileUploadRequest,
3838
FileUploadResponse,
3939
GetApplicationResponse,
40-
GetBlockedUsersResponse,
4140
GetBlockListResponse,
41+
GetBlockedUsersResponse,
4242
GetCustomPermissionResponse,
4343
GetImportResponse,
4444
GetOGResponse,

src/gen/model-decoders/decoders.ts

Lines changed: 97 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,8 @@ decoders.BookmarkFolderResponse = (input?: Record<string, any>) => {
533533
created_at: { type: 'DatetimeType', isSingle: true },
534534

535535
updated_at: { type: 'DatetimeType', isSingle: true },
536+
537+
user: { type: 'UserResponseCommonFields', isSingle: true },
536538
};
537539
return decode(typeMappings, input);
538540
};
@@ -558,7 +560,7 @@ decoders.BookmarkResponse = (input?: Record<string, any>) => {
558560

559561
activity: { type: 'ActivityResponse', isSingle: true },
560562

561-
user: { type: 'UserResponse', isSingle: true },
563+
user: { type: 'UserResponseCommonFields', isSingle: true },
562564

563565
folder: { type: 'BookmarkFolderResponse', isSingle: true },
564566
};
@@ -1258,14 +1260,12 @@ decoders.ChannelHiddenEvent = (input?: Record<string, any>) => {
12581260

12591261
decoders.ChannelMember = (input?: Record<string, any>) => {
12601262
const typeMappings: TypeMapping = {
1261-
created_at: { type: 'DatetimeType', isSingle: true },
1262-
1263-
updated_at: { type: 'DatetimeType', isSingle: true },
1264-
12651263
archived_at: { type: 'DatetimeType', isSingle: true },
12661264

12671265
ban_expires: { type: 'DatetimeType', isSingle: true },
12681266

1267+
created_at: { type: 'DatetimeType', isSingle: true },
1268+
12691269
deleted_at: { type: 'DatetimeType', isSingle: true },
12701270

12711271
invite_accepted_at: { type: 'DatetimeType', isSingle: true },
@@ -1274,6 +1274,8 @@ decoders.ChannelMember = (input?: Record<string, any>) => {
12741274

12751275
pinned_at: { type: 'DatetimeType', isSingle: true },
12761276

1277+
updated_at: { type: 'DatetimeType', isSingle: true },
1278+
12771279
user: { type: 'User', isSingle: true },
12781280
};
12791281
return decode(typeMappings, input);
@@ -1335,7 +1337,7 @@ decoders.ChannelMutedEvent = (input?: Record<string, any>) => {
13351337
return decode(typeMappings, input);
13361338
};
13371339

1338-
decoders.ChannelPushPreferences = (input?: Record<string, any>) => {
1340+
decoders.ChannelPushPreferencesResponse = (input?: Record<string, any>) => {
13391341
const typeMappings: TypeMapping = {
13401342
disabled_until: { type: 'DatetimeType', isSingle: true },
13411343
};
@@ -1398,7 +1400,10 @@ decoders.ChannelStateResponse = (input?: Record<string, any>) => {
13981400

13991401
membership: { type: 'ChannelMemberResponse', isSingle: true },
14001402

1401-
push_preferences: { type: 'ChannelPushPreferences', isSingle: true },
1403+
push_preferences: {
1404+
type: 'ChannelPushPreferencesResponse',
1405+
isSingle: true,
1406+
},
14021407
};
14031408
return decode(typeMappings, input);
14041409
};
@@ -1432,7 +1437,10 @@ decoders.ChannelStateResponseFields = (input?: Record<string, any>) => {
14321437

14331438
membership: { type: 'ChannelMemberResponse', isSingle: true },
14341439

1435-
push_preferences: { type: 'ChannelPushPreferences', isSingle: true },
1440+
push_preferences: {
1441+
type: 'ChannelPushPreferencesResponse',
1442+
isSingle: true,
1443+
},
14361444
};
14371445
return decode(typeMappings, input);
14381446
};
@@ -1745,6 +1753,13 @@ decoders.CreateRoleResponse = (input?: Record<string, any>) => {
17451753
return decode(typeMappings, input);
17461754
};
17471755

1756+
decoders.CreateSIPTrunkResponse = (input?: Record<string, any>) => {
1757+
const typeMappings: TypeMapping = {
1758+
sip_trunk: { type: 'SIPTrunkResponse', isSingle: true },
1759+
};
1760+
return decode(typeMappings, input);
1761+
};
1762+
17481763
decoders.CustomCheckResponse = (input?: Record<string, any>) => {
17491764
const typeMappings: TypeMapping = {
17501765
item: { type: 'ReviewQueueItemResponse', isSingle: true },
@@ -2460,7 +2475,7 @@ decoders.GetPushTemplatesResponse = (input?: Record<string, any>) => {
24602475

24612476
decoders.GetReactionsResponse = (input?: Record<string, any>) => {
24622477
const typeMappings: TypeMapping = {
2463-
reactions: { type: 'Reaction', isSingle: false },
2478+
reactions: { type: 'ReactionResponse', isSingle: false },
24642479
};
24652480
return decode(typeMappings, input);
24662481
};
@@ -2615,6 +2630,23 @@ decoders.ListRolesResponse = (input?: Record<string, any>) => {
26152630
return decode(typeMappings, input);
26162631
};
26172632

2633+
decoders.ListSIPInboundRoutingRuleResponse = (input?: Record<string, any>) => {
2634+
const typeMappings: TypeMapping = {
2635+
sip_inbound_routing_rules: {
2636+
type: 'SIPInboundRoutingRuleResponse',
2637+
isSingle: false,
2638+
},
2639+
};
2640+
return decode(typeMappings, input);
2641+
};
2642+
2643+
decoders.ListSIPTrunksResponse = (input?: Record<string, any>) => {
2644+
const typeMappings: TypeMapping = {
2645+
sip_trunks: { type: 'SIPTrunkResponse', isSingle: false },
2646+
};
2647+
return decode(typeMappings, input);
2648+
};
2649+
26182650
decoders.ListTranscriptionsResponse = (input?: Record<string, any>) => {
26192651
const typeMappings: TypeMapping = {
26202652
transcriptions: { type: 'CallTranscription', isSingle: false },
@@ -3151,7 +3183,7 @@ decoders.OwnUserResponse = (input?: Record<string, any>) => {
31513183

31523184
revoke_tokens_issued_before: { type: 'DatetimeType', isSingle: true },
31533185

3154-
push_preferences: { type: 'PushPreferences', isSingle: true },
3186+
push_preferences: { type: 'PushPreferencesResponse', isSingle: true },
31553187
};
31563188
return decode(typeMappings, input);
31573189
};
@@ -3317,6 +3349,13 @@ decoders.PushPreferences = (input?: Record<string, any>) => {
33173349
return decode(typeMappings, input);
33183350
};
33193351

3352+
decoders.PushPreferencesResponse = (input?: Record<string, any>) => {
3353+
const typeMappings: TypeMapping = {
3354+
disabled_until: { type: 'DatetimeType', isSingle: true },
3355+
};
3356+
return decode(typeMappings, input);
3357+
};
3358+
33203359
decoders.PushProvider = (input?: Record<string, any>) => {
33213360
const typeMappings: TypeMapping = {
33223361
created_at: { type: 'DatetimeType', isSingle: true },
@@ -3583,13 +3622,6 @@ decoders.QueryRemindersResponse = (input?: Record<string, any>) => {
35833622
return decode(typeMappings, input);
35843623
};
35853624

3586-
decoders.QueryReviewQueueResponse = (input?: Record<string, any>) => {
3587-
const typeMappings: TypeMapping = {
3588-
items: { type: 'ReviewQueueItemResponse', isSingle: false },
3589-
};
3590-
return decode(typeMappings, input);
3591-
};
3592-
35933625
decoders.QuerySegmentTargetsResponse = (input?: Record<string, any>) => {
35943626
const typeMappings: TypeMapping = {
35953627
targets: { type: 'SegmentTargetResponse', isSingle: false },
@@ -3774,9 +3806,9 @@ decoders.ReminderResponseData = (input?: Record<string, any>) => {
37743806

37753807
channel: { type: 'ChannelResponse', isSingle: true },
37763808

3777-
message: { type: 'Message', isSingle: true },
3809+
message: { type: 'MessageResponse', isSingle: true },
37783810

3779-
user: { type: 'User', isSingle: true },
3811+
user: { type: 'UserResponse', isSingle: true },
37803812
};
37813813
return decode(typeMappings, input);
37823814
};
@@ -3792,6 +3824,15 @@ decoders.ReminderUpdatedEvent = (input?: Record<string, any>) => {
37923824
return decode(typeMappings, input);
37933825
};
37943826

3827+
decoders.ResolveSipInboundResponse = (input?: Record<string, any>) => {
3828+
const typeMappings: TypeMapping = {
3829+
sip_routing_rule: { type: 'SIPInboundRoutingRuleResponse', isSingle: true },
3830+
3831+
sip_trunk: { type: 'SIPTrunkResponse', isSingle: true },
3832+
};
3833+
return decode(typeMappings, input);
3834+
};
3835+
37953836
decoders.ReviewQueueItemNewEvent = (input?: Record<string, any>) => {
37963837
const typeMappings: TypeMapping = {
37973838
created_at: { type: 'DatetimeType', isSingle: true },
@@ -3866,6 +3907,24 @@ decoders.Role = (input?: Record<string, any>) => {
38663907
return decode(typeMappings, input);
38673908
};
38683909

3910+
decoders.SIPInboundRoutingRuleResponse = (input?: Record<string, any>) => {
3911+
const typeMappings: TypeMapping = {
3912+
created_at: { type: 'DatetimeType', isSingle: true },
3913+
3914+
updated_at: { type: 'DatetimeType', isSingle: true },
3915+
};
3916+
return decode(typeMappings, input);
3917+
};
3918+
3919+
decoders.SIPTrunkResponse = (input?: Record<string, any>) => {
3920+
const typeMappings: TypeMapping = {
3921+
created_at: { type: 'DatetimeType', isSingle: true },
3922+
3923+
updated_at: { type: 'DatetimeType', isSingle: true },
3924+
};
3925+
return decode(typeMappings, input);
3926+
};
3927+
38693928
decoders.SearchResult = (input?: Record<string, any>) => {
38703929
const typeMappings: TypeMapping = {
38713930
message: { type: 'SearchResultMessage', isSingle: true },
@@ -3965,15 +4024,7 @@ decoders.SendReactionResponse = (input?: Record<string, any>) => {
39654024

39664025
decoders.SharedLocation = (input?: Record<string, any>) => {
39674026
const typeMappings: TypeMapping = {
3968-
created_at: { type: 'DatetimeType', isSingle: true },
3969-
3970-
updated_at: { type: 'DatetimeType', isSingle: true },
3971-
39724027
end_at: { type: 'DatetimeType', isSingle: true },
3973-
3974-
channel: { type: 'Channel', isSingle: true },
3975-
3976-
message: { type: 'Message', isSingle: true },
39774028
};
39784029
return decode(typeMappings, input);
39794030
};
@@ -4405,6 +4456,25 @@ decoders.UpdateReminderResponse = (input?: Record<string, any>) => {
44054456
return decode(typeMappings, input);
44064457
};
44074458

4459+
decoders.UpdateSIPInboundRoutingRuleResponse = (
4460+
input?: Record<string, any>,
4461+
) => {
4462+
const typeMappings: TypeMapping = {
4463+
sip_inbound_routing_rule: {
4464+
type: 'SIPInboundRoutingRuleResponse',
4465+
isSingle: true,
4466+
},
4467+
};
4468+
return decode(typeMappings, input);
4469+
};
4470+
4471+
decoders.UpdateSIPTrunkResponse = (input?: Record<string, any>) => {
4472+
const typeMappings: TypeMapping = {
4473+
sip_trunk: { type: 'SIPTrunkResponse', isSingle: true },
4474+
};
4475+
return decode(typeMappings, input);
4476+
};
4477+
44084478
decoders.UpdateThreadPartialResponse = (input?: Record<string, any>) => {
44094479
const typeMappings: TypeMapping = {
44104480
thread: { type: 'ThreadResponse', isSingle: true },
@@ -4490,19 +4560,7 @@ decoders.User = (input?: Record<string, any>) => {
44904560
const typeMappings: TypeMapping = {
44914561
ban_expires: { type: 'DatetimeType', isSingle: true },
44924562

4493-
created_at: { type: 'DatetimeType', isSingle: true },
4494-
4495-
deactivated_at: { type: 'DatetimeType', isSingle: true },
4496-
4497-
deleted_at: { type: 'DatetimeType', isSingle: true },
4498-
4499-
last_active: { type: 'DatetimeType', isSingle: true },
4500-
4501-
last_engaged_at: { type: 'DatetimeType', isSingle: true },
4502-
45034563
revoke_tokens_issued_before: { type: 'DatetimeType', isSingle: true },
4504-
4505-
updated_at: { type: 'DatetimeType', isSingle: true },
45064564
};
45074565
return decode(typeMappings, input);
45084566
};

0 commit comments

Comments
 (0)