Skip to content

Commit 8c60c67

Browse files
committed
feat: add feed_visibility methods
1 parent 77c9c9b commit 8c60c67

File tree

6 files changed

+252
-97
lines changed

6 files changed

+252
-97
lines changed

src/gen/chat/ChatApi.ts

Lines changed: 30 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import {
2929
GetDraftResponse,
3030
GetManyMessagesResponse,
3131
GetMessageResponse,
32-
GetPushTemplatesResponse,
3332
GetReactionsResponse,
3433
GetRepliesResponse,
3534
GetSegmentResponse,
@@ -114,10 +113,6 @@ import {
114113
UpdateReminderResponse,
115114
UpdateThreadPartialRequest,
116115
UpdateThreadPartialResponse,
117-
UpsertPushPreferencesRequest,
118-
UpsertPushPreferencesResponse,
119-
UpsertPushTemplateRequest,
120-
UpsertPushTemplateResponse,
121116
WrappedUnreadCountsResponse,
122117
} from '../models';
123118
import { decoders } from '../model-decoders/decoders';
@@ -1404,6 +1399,36 @@ export class ChatApi {
14041399
return { ...response.body, metadata: response.metadata };
14051400
}
14061401

1402+
async ephemeralMessageUpdate(
1403+
request: UpdateMessagePartialRequest & { id: string },
1404+
): Promise<StreamResponse<UpdateMessagePartialResponse>> {
1405+
const pathParams = {
1406+
id: request?.id,
1407+
};
1408+
const body = {
1409+
skip_enrich_url: request?.skip_enrich_url,
1410+
user_id: request?.user_id,
1411+
unset: request?.unset,
1412+
set: request?.set,
1413+
user: request?.user,
1414+
};
1415+
1416+
const response = await this.apiClient.sendRequest<
1417+
StreamResponse<UpdateMessagePartialResponse>
1418+
>(
1419+
'PATCH',
1420+
'/api/v2/chat/messages/{id}/ephemeral',
1421+
pathParams,
1422+
undefined,
1423+
body,
1424+
'application/json',
1425+
);
1426+
1427+
decoders.UpdateMessagePartialResponse?.(response.body);
1428+
1429+
return { ...response.body, metadata: response.metadata };
1430+
}
1431+
14071432
async sendReaction(
14081433
request: SendReactionRequest & { id: string },
14091434
): Promise<StreamResponse<SendReactionResponse>> {
@@ -1823,74 +1848,6 @@ export class ChatApi {
18231848
return { ...response.body, metadata: response.metadata };
18241849
}
18251850

1826-
async updatePushNotificationPreferences(
1827-
request: UpsertPushPreferencesRequest,
1828-
): Promise<StreamResponse<UpsertPushPreferencesResponse>> {
1829-
const body = {
1830-
preferences: request?.preferences,
1831-
};
1832-
1833-
const response = await this.apiClient.sendRequest<
1834-
StreamResponse<UpsertPushPreferencesResponse>
1835-
>(
1836-
'POST',
1837-
'/api/v2/chat/push_preferences',
1838-
undefined,
1839-
undefined,
1840-
body,
1841-
'application/json',
1842-
);
1843-
1844-
decoders.UpsertPushPreferencesResponse?.(response.body);
1845-
1846-
return { ...response.body, metadata: response.metadata };
1847-
}
1848-
1849-
async getPushTemplates(request: {
1850-
push_provider_type: string;
1851-
push_provider_name?: string;
1852-
}): Promise<StreamResponse<GetPushTemplatesResponse>> {
1853-
const queryParams = {
1854-
push_provider_type: request?.push_provider_type,
1855-
push_provider_name: request?.push_provider_name,
1856-
};
1857-
1858-
const response = await this.apiClient.sendRequest<
1859-
StreamResponse<GetPushTemplatesResponse>
1860-
>('GET', '/api/v2/chat/push_templates', undefined, queryParams);
1861-
1862-
decoders.GetPushTemplatesResponse?.(response.body);
1863-
1864-
return { ...response.body, metadata: response.metadata };
1865-
}
1866-
1867-
async upsertPushTemplate(
1868-
request: UpsertPushTemplateRequest,
1869-
): Promise<StreamResponse<UpsertPushTemplateResponse>> {
1870-
const body = {
1871-
event_type: request?.event_type,
1872-
push_provider_type: request?.push_provider_type,
1873-
enable_push: request?.enable_push,
1874-
push_provider_name: request?.push_provider_name,
1875-
template: request?.template,
1876-
};
1877-
1878-
const response = await this.apiClient.sendRequest<
1879-
StreamResponse<UpsertPushTemplateResponse>
1880-
>(
1881-
'POST',
1882-
'/api/v2/chat/push_templates',
1883-
undefined,
1884-
undefined,
1885-
body,
1886-
'application/json',
1887-
);
1888-
1889-
decoders.UpsertPushTemplateResponse?.(response.body);
1890-
1891-
return { ...response.body, metadata: response.metadata };
1892-
}
1893-
18941851
async queryBannedUsers(request?: {
18951852
payload?: QueryBannedUsersPayload;
18961853
}): Promise<StreamResponse<QueryBannedUsersResponse>> {

src/gen/common/CommonApi.ts

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ import {
4242
GetCustomPermissionResponse,
4343
GetImportResponse,
4444
GetOGResponse,
45+
GetPushTemplatesResponse,
4546
GetRateLimitsResponse,
4647
GetTaskResponse,
4748
ImageUploadRequest,
@@ -83,8 +84,12 @@ import {
8384
UpdateUsersPartialRequest,
8485
UpdateUsersRequest,
8586
UpdateUsersResponse,
87+
UpsertPushPreferencesRequest,
88+
UpsertPushPreferencesResponse,
8689
UpsertPushProviderRequest,
8790
UpsertPushProviderResponse,
91+
UpsertPushTemplateRequest,
92+
UpsertPushTemplateResponse,
8893
} from '../models';
8994
import { decoders } from '../model-decoders/decoders';
9095

@@ -987,6 +992,29 @@ export class CommonApi {
987992
return { ...response.body, metadata: response.metadata };
988993
}
989994

995+
async updatePushNotificationPreferences(
996+
request: UpsertPushPreferencesRequest,
997+
): Promise<StreamResponse<UpsertPushPreferencesResponse>> {
998+
const body = {
999+
preferences: request?.preferences,
1000+
};
1001+
1002+
const response = await this.apiClient.sendRequest<
1003+
StreamResponse<UpsertPushPreferencesResponse>
1004+
>(
1005+
'POST',
1006+
'/api/v2/push_preferences',
1007+
undefined,
1008+
undefined,
1009+
body,
1010+
'application/json',
1011+
);
1012+
1013+
decoders.UpsertPushPreferencesResponse?.(response.body);
1014+
1015+
return { ...response.body, metadata: response.metadata };
1016+
}
1017+
9901018
async listPushProviders(): Promise<
9911019
StreamResponse<ListPushProvidersResponse>
9921020
> {
@@ -1043,6 +1071,51 @@ export class CommonApi {
10431071
return { ...response.body, metadata: response.metadata };
10441072
}
10451073

1074+
async getPushTemplates(request: {
1075+
push_provider_type: string;
1076+
push_provider_name?: string;
1077+
}): Promise<StreamResponse<GetPushTemplatesResponse>> {
1078+
const queryParams = {
1079+
push_provider_type: request?.push_provider_type,
1080+
push_provider_name: request?.push_provider_name,
1081+
};
1082+
1083+
const response = await this.apiClient.sendRequest<
1084+
StreamResponse<GetPushTemplatesResponse>
1085+
>('GET', '/api/v2/push_templates', undefined, queryParams);
1086+
1087+
decoders.GetPushTemplatesResponse?.(response.body);
1088+
1089+
return { ...response.body, metadata: response.metadata };
1090+
}
1091+
1092+
async upsertPushTemplate(
1093+
request: UpsertPushTemplateRequest,
1094+
): Promise<StreamResponse<UpsertPushTemplateResponse>> {
1095+
const body = {
1096+
event_type: request?.event_type,
1097+
push_provider_type: request?.push_provider_type,
1098+
enable_push: request?.enable_push,
1099+
push_provider_name: request?.push_provider_name,
1100+
template: request?.template,
1101+
};
1102+
1103+
const response = await this.apiClient.sendRequest<
1104+
StreamResponse<UpsertPushTemplateResponse>
1105+
>(
1106+
'POST',
1107+
'/api/v2/push_templates',
1108+
undefined,
1109+
undefined,
1110+
body,
1111+
'application/json',
1112+
);
1113+
1114+
decoders.UpsertPushTemplateResponse?.(response.body);
1115+
1116+
return { ...response.body, metadata: response.metadata };
1117+
}
1118+
10461119
async getRateLimits(request?: {
10471120
server_side?: boolean;
10481121
android?: boolean;

src/gen/feeds/FeedsApi.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ import {
4949
GetCommentsResponse,
5050
GetFeedGroupResponse,
5151
GetFeedViewResponse,
52+
GetFeedVisibilityResponse,
5253
GetFollowSuggestionsResponse,
5354
GetOrCreateFeedGroupRequest,
5455
GetOrCreateFeedGroupResponse,
@@ -58,6 +59,7 @@ import {
5859
GetOrCreateFeedViewResponse,
5960
ListFeedGroupsResponse,
6061
ListFeedViewsResponse,
62+
ListFeedVisibilitiesResponse,
6163
MarkActivityRequest,
6264
PinActivityRequest,
6365
PinActivityResponse,
@@ -581,6 +583,7 @@ export class FeedsApi {
581583
user_id: request?.user_id,
582584
visibility: request?.visibility,
583585
attachments: request?.attachments,
586+
feeds: request?.feeds,
584587
filter_tags: request?.filter_tags,
585588
interest_tags: request?.interest_tags,
586589
custom: request?.custom,
@@ -1621,6 +1624,34 @@ export class FeedsApi {
16211624
return { ...response.body, metadata: response.metadata };
16221625
}
16231626

1627+
async listFeedVisibilities(): Promise<
1628+
StreamResponse<ListFeedVisibilitiesResponse>
1629+
> {
1630+
const response = await this.apiClient.sendRequest<
1631+
StreamResponse<ListFeedVisibilitiesResponse>
1632+
>('GET', '/api/v2/feeds/feed_visibilities', undefined, undefined);
1633+
1634+
decoders.ListFeedVisibilitiesResponse?.(response.body);
1635+
1636+
return { ...response.body, metadata: response.metadata };
1637+
}
1638+
1639+
async getFeedVisibility(request: {
1640+
name: string;
1641+
}): Promise<StreamResponse<GetFeedVisibilityResponse>> {
1642+
const pathParams = {
1643+
name: request?.name,
1644+
};
1645+
1646+
const response = await this.apiClient.sendRequest<
1647+
StreamResponse<GetFeedVisibilityResponse>
1648+
>('GET', '/api/v2/feeds/feed_visibilities/{name}', pathParams, undefined);
1649+
1650+
decoders.GetFeedVisibilityResponse?.(response.body);
1651+
1652+
return { ...response.body, metadata: response.metadata };
1653+
}
1654+
16241655
async createFeedsBatch(
16251656
request: CreateFeedsBatchRequest,
16261657
): Promise<StreamResponse<CreateFeedsBatchResponse>> {

src/gen/model-decoders/decoders.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,6 +1157,8 @@ decoders.Channel = (input?: Record<string, any>) => {
11571157

11581158
created_by: { type: 'User', isSingle: true },
11591159

1160+
members_lookup: { type: 'ChannelMemberLookup', isSingle: false },
1161+
11601162
truncated_by: { type: 'User', isSingle: true },
11611163
};
11621164
return decode(typeMappings, input);
@@ -1239,6 +1241,17 @@ decoders.ChannelMember = (input?: Record<string, any>) => {
12391241
return decode(typeMappings, input);
12401242
};
12411243

1244+
decoders.ChannelMemberLookup = (input?: Record<string, any>) => {
1245+
const typeMappings: TypeMapping = {
1246+
archived_at: { type: 'DatetimeType', isSingle: true },
1247+
1248+
ban_expires: { type: 'DatetimeType', isSingle: true },
1249+
1250+
pinned_at: { type: 'DatetimeType', isSingle: true },
1251+
};
1252+
return decode(typeMappings, input);
1253+
};
1254+
12421255
decoders.ChannelMute = (input?: Record<string, any>) => {
12431256
const typeMappings: TypeMapping = {
12441257
created_at: { type: 'DatetimeType', isSingle: true },
@@ -1717,6 +1730,13 @@ decoders.DeleteCommentReactionResponse = (input?: Record<string, any>) => {
17171730
return decode(typeMappings, input);
17181731
};
17191732

1733+
decoders.DeleteCommentResponse = (input?: Record<string, any>) => {
1734+
const typeMappings: TypeMapping = {
1735+
comment: { type: 'CommentResponse', isSingle: true },
1736+
};
1737+
return decode(typeMappings, input);
1738+
};
1739+
17201740
decoders.DeleteMessageResponse = (input?: Record<string, any>) => {
17211741
const typeMappings: TypeMapping = {
17221742
message: { type: 'MessageResponse', isSingle: true },
@@ -2141,6 +2161,8 @@ decoders.GetCallReportResponse = (input?: Record<string, any>) => {
21412161
video_reactions: { type: 'VideoReactionsResponse', isSingle: false },
21422162

21432163
chat_activity: { type: 'ChatActivityStatsResponse', isSingle: true },
2164+
2165+
session: { type: 'CallSessionResponse', isSingle: true },
21442166
};
21452167
return decode(typeMappings, input);
21462168
};
@@ -2687,6 +2709,8 @@ decoders.MessageReadEvent = (input?: Record<string, any>) => {
26872709

26882710
channel_last_message_at: { type: 'DatetimeType', isSingle: true },
26892711

2712+
channel: { type: 'ChannelResponse', isSingle: true },
2713+
26902714
thread: { type: 'ThreadResponse', isSingle: true },
26912715

26922716
user: { type: 'UserResponseCommonFields', isSingle: true },

0 commit comments

Comments
 (0)