Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 20 additions & 16 deletions src/gen/chat/ChannelApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@ import {
ChannelStateResponse,
DeleteChannelResponse,
EventResponse,
FileUploadRequest,
FileUploadResponse,
GetDraftResponse,
GetManyMessagesResponse,
HideChannelRequest,
HideChannelResponse,
ImageUploadRequest,
ImageUploadResponse,
MarkReadRequest,
MarkReadResponse,
MarkUnreadRequest,
Expand All @@ -29,6 +25,10 @@ import {
UpdateChannelResponse,
UpdateMemberPartialRequest,
UpdateMemberPartialResponse,
UploadChannelFileRequest,
UploadChannelFileResponse,
UploadChannelRequest,
UploadChannelResponse,
} from '../models';

export class ChannelApi {
Expand Down Expand Up @@ -126,30 +126,32 @@ export class ChannelApi {
return this.chatApi.sendEvent({ id: this.id, type: this.type, ...request });
}

deleteFile(request?: { url?: string }): Promise<StreamResponse<Response>> {
deleteChannelFile(request?: {
url?: string;
}): Promise<StreamResponse<Response>> {
if (!this.id) {
throw new Error(
`Channel isn't yet created, call getOrCreateDistinctChannel() before this operation`,
);
}

return this.chatApi.deleteFile({
return this.chatApi.deleteChannelFile({
id: this.id,
type: this.type,
...request,
});
}

uploadFile(
request?: FileUploadRequest,
): Promise<StreamResponse<FileUploadResponse>> {
uploadChannelFile(
request?: UploadChannelFileRequest,
): Promise<StreamResponse<UploadChannelFileResponse>> {
if (!this.id) {
throw new Error(
`Channel isn't yet created, call getOrCreateDistinctChannel() before this operation`,
);
}

return this.chatApi.uploadFile({
return this.chatApi.uploadChannelFile({
id: this.id,
type: this.type,
...request,
Expand All @@ -172,30 +174,32 @@ export class ChannelApi {
});
}

deleteImage(request?: { url?: string }): Promise<StreamResponse<Response>> {
deleteChannelImage(request?: {
url?: string;
}): Promise<StreamResponse<Response>> {
if (!this.id) {
throw new Error(
`Channel isn't yet created, call getOrCreateDistinctChannel() before this operation`,
);
}

return this.chatApi.deleteImage({
return this.chatApi.deleteChannelImage({
id: this.id,
type: this.type,
...request,
});
}

uploadImage(
request?: ImageUploadRequest,
): Promise<StreamResponse<ImageUploadResponse>> {
uploadChannelImage(
request?: UploadChannelRequest,
): Promise<StreamResponse<UploadChannelResponse>> {
if (!this.id) {
throw new Error(
`Channel isn't yet created, call getOrCreateDistinctChannel() before this operation`,
);
}

return this.chatApi.uploadImage({
return this.chatApi.uploadChannelImage({
id: this.id,
type: this.type,
...request,
Expand Down
47 changes: 19 additions & 28 deletions src/gen/chat/ChatApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ import {
EventResponse,
ExportChannelsRequest,
ExportChannelsResponse,
FileUploadRequest,
FileUploadResponse,
GetCampaignResponse,
GetChannelTypeResponse,
GetCommandResponse,
Expand All @@ -35,8 +33,6 @@ import {
GetThreadResponse,
HideChannelRequest,
HideChannelResponse,
ImageUploadRequest,
ImageUploadResponse,
ListChannelTypesResponse,
ListCommandsResponse,
MarkChannelsReadRequest,
Expand Down Expand Up @@ -113,6 +109,10 @@ import {
UpdateReminderResponse,
UpdateThreadPartialRequest,
UpdateThreadPartialResponse,
UploadChannelFileRequest,
UploadChannelFileResponse,
UploadChannelRequest,
UploadChannelResponse,
WrappedUnreadCountsResponse,
} from '../models';
import { decoders } from '../model-decoders/decoders';
Expand Down Expand Up @@ -511,7 +511,7 @@ export class ChatApi {
return { ...response.body, metadata: response.metadata };
}

async deleteFile(request: {
async deleteChannelFile(request: {
type: string;
id: string;
url?: string;
Expand All @@ -536,9 +536,9 @@ export class ChatApi {
return { ...response.body, metadata: response.metadata };
}

async uploadFile(
request: FileUploadRequest & { type: string; id: string },
): Promise<StreamResponse<FileUploadResponse>> {
async uploadChannelFile(
request: UploadChannelFileRequest & { type: string; id: string },
): Promise<StreamResponse<UploadChannelFileResponse>> {
const pathParams = {
type: request?.type,
id: request?.id,
Expand All @@ -549,7 +549,7 @@ export class ChatApi {
};

const response = await this.apiClient.sendRequest<
StreamResponse<FileUploadResponse>
StreamResponse<UploadChannelFileResponse>
>(
'POST',
'/api/v2/chat/channels/{type}/{id}/file',
Expand All @@ -559,7 +559,7 @@ export class ChatApi {
'multipart/form-data',
);

decoders.FileUploadResponse?.(response.body);
decoders.UploadChannelFileResponse?.(response.body);

return { ...response.body, metadata: response.metadata };
}
Expand Down Expand Up @@ -593,7 +593,7 @@ export class ChatApi {
return { ...response.body, metadata: response.metadata };
}

async deleteImage(request: {
async deleteChannelImage(request: {
type: string;
id: string;
url?: string;
Expand All @@ -618,9 +618,9 @@ export class ChatApi {
return { ...response.body, metadata: response.metadata };
}

async uploadImage(
request: ImageUploadRequest & { type: string; id: string },
): Promise<StreamResponse<ImageUploadResponse>> {
async uploadChannelImage(
request: UploadChannelRequest & { type: string; id: string },
): Promise<StreamResponse<UploadChannelResponse>> {
const pathParams = {
type: request?.type,
id: request?.id,
Expand All @@ -632,7 +632,7 @@ export class ChatApi {
};

const response = await this.apiClient.sendRequest<
StreamResponse<ImageUploadResponse>
StreamResponse<UploadChannelResponse>
>(
'POST',
'/api/v2/chat/channels/{type}/{id}/image',
Expand All @@ -642,7 +642,7 @@ export class ChatApi {
'multipart/form-data',
);

decoders.ImageUploadResponse?.(response.body);
decoders.UploadChannelResponse?.(response.body);

return { ...response.body, metadata: response.metadata };
}
Expand Down Expand Up @@ -915,7 +915,9 @@ export class ChatApi {
blocklist: request?.blocklist,
blocklist_behavior: request?.blocklist_behavior,
connect_events: request?.connect_events,
count_messages: request?.count_messages,
custom_events: request?.custom_events,
delivery_events: request?.delivery_events,
mark_messages_pending: request?.mark_messages_pending,
message_retention: request?.message_retention,
mutes: request?.mutes,
Expand Down Expand Up @@ -1006,6 +1008,7 @@ export class ChatApi {
connect_events: request?.connect_events,
count_messages: request?.count_messages,
custom_events: request?.custom_events,
delivery_events: request?.delivery_events,
mark_messages_pending: request?.mark_messages_pending,
mutes: request?.mutes,
partition_size: request?.partition_size,
Expand Down Expand Up @@ -1734,32 +1737,20 @@ export class ChatApi {
async getReplies(request: {
parent_id: string;
limit?: number;
offset?: number;
id_gte?: string;
id_gt?: string;
id_lte?: string;
id_lt?: string;
created_at_after_or_equal?: Date;
created_at_after?: Date;
created_at_before_or_equal?: Date;
created_at_before?: Date;
id_around?: string;
created_at_around?: Date;
sort?: SortParamRequest[];
}): Promise<StreamResponse<GetRepliesResponse>> {
const queryParams = {
limit: request?.limit,
offset: request?.offset,
id_gte: request?.id_gte,
id_gt: request?.id_gt,
id_lte: request?.id_lte,
id_lt: request?.id_lt,
created_at_after_or_equal: request?.created_at_after_or_equal,
created_at_after: request?.created_at_after,
created_at_before_or_equal: request?.created_at_before_or_equal,
created_at_before: request?.created_at_before,
id_around: request?.id_around,
created_at_around: request?.created_at_around,
sort: request?.sort,
};
const pathParams = {
Expand Down
4 changes: 4 additions & 0 deletions src/gen/common/CommonApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ export class CommonApi {
const body = {
name: request?.name,
words: request?.words,
is_leet_check_enabled: request?.is_leet_check_enabled,
is_plural_check_enabled: request?.is_plural_check_enabled,
team: request?.team,
type: request?.type,
};
Expand Down Expand Up @@ -267,6 +269,8 @@ export class CommonApi {
name: request?.name,
};
const body = {
is_leet_check_enabled: request?.is_leet_check_enabled,
is_plural_check_enabled: request?.is_plural_check_enabled,
team: request?.team,
words: request?.words,
};
Expand Down
53 changes: 53 additions & 0 deletions src/gen/feeds/FeedsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import {
GetFeedGroupResponse,
GetFeedViewResponse,
GetFeedVisibilityResponse,
GetFeedsRateLimitsResponse,
GetFollowSuggestionsResponse,
GetOrCreateFeedGroupRequest,
GetOrCreateFeedGroupResponse,
Expand All @@ -61,6 +62,8 @@ import {
ListFeedViewsResponse,
ListFeedVisibilitiesResponse,
MarkActivityRequest,
OwnCapabilitiesBatchRequest,
OwnCapabilitiesBatchResponse,
PinActivityRequest,
PinActivityResponse,
PollVoteResponse,
Expand Down Expand Up @@ -1019,6 +1022,7 @@ export class FeedsApi {
const queryParams = {
include_soft_deleted: request?.include_soft_deleted,
};

const response = await this.apiClient.sendRequest<
StreamResponse<ListFeedGroupsResponse>
>('GET', '/api/v2/feeds/feed_groups', undefined, queryParams);
Expand Down Expand Up @@ -1720,6 +1724,31 @@ export class FeedsApi {
return { ...response.body, metadata: response.metadata };
}

async ownCapabilitiesBatch(
request: OwnCapabilitiesBatchRequest,
): Promise<StreamResponse<OwnCapabilitiesBatchResponse>> {
const body = {
feeds: request?.feeds,
user_id: request?.user_id,
user: request?.user,
};

const response = await this.apiClient.sendRequest<
StreamResponse<OwnCapabilitiesBatchResponse>
>(
'POST',
'/api/v2/feeds/feeds/own_capabilities/batch',
undefined,
undefined,
body,
'application/json',
);

decoders.OwnCapabilitiesBatchResponse?.(response.body);

return { ...response.body, metadata: response.metadata };
}

protected async _queryFeeds(
request?: QueryFeedsRequest,
): Promise<StreamResponse<QueryFeedsResponse>> {
Expand Down Expand Up @@ -1748,6 +1777,30 @@ export class FeedsApi {
return { ...response.body, metadata: response.metadata };
}

async getFeedsRateLimits(request?: {
endpoints?: string;
android?: boolean;
ios?: boolean;
web?: boolean;
server_side?: boolean;
}): Promise<StreamResponse<GetFeedsRateLimitsResponse>> {
const queryParams = {
endpoints: request?.endpoints,
android: request?.android,
ios: request?.ios,
web: request?.web,
server_side: request?.server_side,
};

const response = await this.apiClient.sendRequest<
StreamResponse<GetFeedsRateLimitsResponse>
>('GET', '/api/v2/feeds/feeds/rate_limits', undefined, queryParams);

decoders.GetFeedsRateLimitsResponse?.(response.body);

return { ...response.body, metadata: response.metadata };
}

async updateFollow(
request: UpdateFollowRequest,
): Promise<StreamResponse<UpdateFollowResponse>> {
Expand Down
Loading
Loading