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
73 changes: 0 additions & 73 deletions src/gen/chat/ChatApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import {
GetDraftResponse,
GetManyMessagesResponse,
GetMessageResponse,
GetPushTemplatesResponse,
GetReactionsResponse,
GetRepliesResponse,
GetSegmentResponse,
Expand Down Expand Up @@ -114,10 +113,6 @@ import {
UpdateReminderResponse,
UpdateThreadPartialRequest,
UpdateThreadPartialResponse,
UpsertPushPreferencesRequest,
UpsertPushPreferencesResponse,
UpsertPushTemplateRequest,
UpsertPushTemplateResponse,
WrappedUnreadCountsResponse,
} from '../models';
import { decoders } from '../model-decoders/decoders';
Expand Down Expand Up @@ -1823,74 +1818,6 @@ export class ChatApi {
return { ...response.body, metadata: response.metadata };
}

async updatePushNotificationPreferences(
request: UpsertPushPreferencesRequest,
): Promise<StreamResponse<UpsertPushPreferencesResponse>> {
const body = {
preferences: request?.preferences,
};

const response = await this.apiClient.sendRequest<
StreamResponse<UpsertPushPreferencesResponse>
>(
'POST',
'/api/v2/chat/push_preferences',
undefined,
undefined,
body,
'application/json',
);

decoders.UpsertPushPreferencesResponse?.(response.body);

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

async getPushTemplates(request: {
push_provider_type: string;
push_provider_name?: string;
}): Promise<StreamResponse<GetPushTemplatesResponse>> {
const queryParams = {
push_provider_type: request?.push_provider_type,
push_provider_name: request?.push_provider_name,
};

const response = await this.apiClient.sendRequest<
StreamResponse<GetPushTemplatesResponse>
>('GET', '/api/v2/chat/push_templates', undefined, queryParams);

decoders.GetPushTemplatesResponse?.(response.body);

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

async upsertPushTemplate(
request: UpsertPushTemplateRequest,
): Promise<StreamResponse<UpsertPushTemplateResponse>> {
const body = {
event_type: request?.event_type,
push_provider_type: request?.push_provider_type,
enable_push: request?.enable_push,
push_provider_name: request?.push_provider_name,
template: request?.template,
};

const response = await this.apiClient.sendRequest<
StreamResponse<UpsertPushTemplateResponse>
>(
'POST',
'/api/v2/chat/push_templates',
undefined,
undefined,
body,
'application/json',
);

decoders.UpsertPushTemplateResponse?.(response.body);

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

async queryBannedUsers(request?: {
payload?: QueryBannedUsersPayload;
}): Promise<StreamResponse<QueryBannedUsersResponse>> {
Expand Down
73 changes: 73 additions & 0 deletions src/gen/common/CommonApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import {
GetCustomPermissionResponse,
GetImportResponse,
GetOGResponse,
GetPushTemplatesResponse,
GetRateLimitsResponse,
GetTaskResponse,
ImageUploadRequest,
Expand Down Expand Up @@ -83,8 +84,12 @@ import {
UpdateUsersPartialRequest,
UpdateUsersRequest,
UpdateUsersResponse,
UpsertPushPreferencesRequest,
UpsertPushPreferencesResponse,
UpsertPushProviderRequest,
UpsertPushProviderResponse,
UpsertPushTemplateRequest,
UpsertPushTemplateResponse,
} from '../models';
import { decoders } from '../model-decoders/decoders';

Expand Down Expand Up @@ -987,6 +992,29 @@ export class CommonApi {
return { ...response.body, metadata: response.metadata };
}

async updatePushNotificationPreferences(
request: UpsertPushPreferencesRequest,
): Promise<StreamResponse<UpsertPushPreferencesResponse>> {
const body = {
preferences: request?.preferences,
};

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

decoders.UpsertPushPreferencesResponse?.(response.body);

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

async listPushProviders(): Promise<
StreamResponse<ListPushProvidersResponse>
> {
Expand Down Expand Up @@ -1043,6 +1071,51 @@ export class CommonApi {
return { ...response.body, metadata: response.metadata };
}

async getPushTemplates(request: {
push_provider_type: string;
push_provider_name?: string;
}): Promise<StreamResponse<GetPushTemplatesResponse>> {
const queryParams = {
push_provider_type: request?.push_provider_type,
push_provider_name: request?.push_provider_name,
};

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

decoders.GetPushTemplatesResponse?.(response.body);

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

async upsertPushTemplate(
request: UpsertPushTemplateRequest,
): Promise<StreamResponse<UpsertPushTemplateResponse>> {
const body = {
event_type: request?.event_type,
push_provider_type: request?.push_provider_type,
enable_push: request?.enable_push,
push_provider_name: request?.push_provider_name,
template: request?.template,
};

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

decoders.UpsertPushTemplateResponse?.(response.body);

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

async getRateLimits(request?: {
server_side?: boolean;
android?: boolean;
Expand Down
2 changes: 2 additions & 0 deletions src/gen/model-decoders/decoders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2687,6 +2687,8 @@ decoders.MessageReadEvent = (input?: Record<string, any>) => {

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

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

thread: { type: 'ThreadResponse', isSingle: true },

user: { type: 'UserResponseCommonFields', isSingle: true },
Expand Down
18 changes: 10 additions & 8 deletions src/gen/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2315,6 +2315,8 @@ export interface CallSessionParticipantLeftEvent {
participant: CallParticipantResponse;

type: string;

reason?: string;
}

export interface CallSessionResponse {
Expand Down Expand Up @@ -4507,8 +4509,6 @@ export interface DeleteFeedGroupResponse {
}

export interface DeleteFeedResponse {
delete_feed_task_id: string;

duration: string;

task_id: string;
Expand Down Expand Up @@ -5466,15 +5466,15 @@ export interface FeedsModerationTemplateConfig {
}

export interface FeedsPreferences {
comment?: string;
comment?: 'all' | 'none';

comment_reaction?: string;
comment_reaction?: 'all' | 'none';

follow?: string;
follow?: 'all' | 'none';

mention?: string;
mention?: 'all' | 'none';

reaction?: string;
reaction?: 'all' | 'none';

custom_activity_types?: Record<string, string>;
}
Expand Down Expand Up @@ -7372,6 +7372,8 @@ export interface MessageReadEvent {

team?: string;

channel?: ChannelResponse;

thread?: ThreadResponse;

user?: UserResponseCommonFields;
Expand Down Expand Up @@ -12818,7 +12820,7 @@ export interface UpsertPushPreferencesResponse {

user_channel_preferences: Record<
string,
Record<string, ChannelPushPreferences>
Record<string, ChannelPushPreferences | null>
>;

user_preferences: Record<string, PushPreferences>;
Expand Down
1 change: 1 addition & 0 deletions src/gen/video/VideoApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,7 @@ export class VideoApi {
enable_transcription: request?.enable_transcription,
external_storage: request?.external_storage,
language: request?.language,
speech_segment_config: request?.speech_segment_config,
};

const response = await this.apiClient.sendRequest<
Expand Down