global update and global fix
This commit is contained in:
101
apps/api-gateway/src/dto/bot.dto.ts
Normal file
101
apps/api-gateway/src/dto/bot.dto.ts
Normal file
@@ -0,0 +1,101 @@
|
||||
import { IsBoolean, IsInt, IsOptional, IsString, IsUrl, Max, Min, MinLength } from 'class-validator';
|
||||
|
||||
export class CreateBotDto {
|
||||
@IsString()
|
||||
@MinLength(2, { message: 'Название бота должно содержать минимум 2 символа' })
|
||||
name!: string;
|
||||
|
||||
@IsString()
|
||||
@MinLength(5, { message: 'Username бота должен содержать минимум 5 символов' })
|
||||
username!: string;
|
||||
}
|
||||
|
||||
export class UpdateBotDto {
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@MinLength(2, { message: 'Название бота должно содержать минимум 2 символа' })
|
||||
name?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@MinLength(5, { message: 'Username бота должен содержать минимум 5 символов' })
|
||||
username?: string;
|
||||
}
|
||||
|
||||
export class SetBotWebAppDto {
|
||||
@IsOptional()
|
||||
@IsUrl({}, { message: 'Укажите корректный URL Mini App' })
|
||||
webAppUrl?: string;
|
||||
}
|
||||
|
||||
export class UpdateBotProfileDto {
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
description?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
aboutText?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
botPicUrl?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
menuButtonJson?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
menuButtonUrl?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
menuButtonText?: string;
|
||||
}
|
||||
|
||||
export class SetBotActiveDto {
|
||||
@IsBoolean()
|
||||
isActive!: boolean;
|
||||
}
|
||||
|
||||
export class ListAdminBotsQueryDto {
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
search?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
page?: number;
|
||||
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
@Max(100)
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
export class ValidateWebAppInitDataDto {
|
||||
@IsString()
|
||||
initData!: string;
|
||||
|
||||
@IsString()
|
||||
botToken!: string;
|
||||
}
|
||||
|
||||
export class SubmitBotMessageDto {
|
||||
@IsString()
|
||||
@MinLength(1, { message: 'Текст сообщения не может быть пустым' })
|
||||
text!: string;
|
||||
}
|
||||
|
||||
export class SubmitBotCallbackDto {
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
messageId!: number;
|
||||
|
||||
@IsString()
|
||||
@MinLength(1, { message: 'callbackData не может быть пустым' })
|
||||
callbackData!: string;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { IsArray, IsBoolean, IsIn, IsOptional, IsString, MinLength } from 'class-validator';
|
||||
import { ArrayNotEmpty, IsArray, IsBoolean, IsIn, IsOptional, IsString, MinLength } from 'class-validator';
|
||||
|
||||
export class CreateChatRoomDto {
|
||||
@IsString()
|
||||
@@ -11,6 +11,11 @@ export class CreateChatRoomDto {
|
||||
memberUserIds?: string[];
|
||||
}
|
||||
|
||||
export class CreateE2EChatRoomDto {
|
||||
@IsString()
|
||||
peerUserId!: string;
|
||||
}
|
||||
|
||||
export class UpdateChatRoomDto {
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@@ -54,6 +59,10 @@ export class SendChatMessageDto {
|
||||
allowsMultiple?: boolean;
|
||||
isAnonymous?: boolean;
|
||||
};
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
isEncrypted?: boolean;
|
||||
}
|
||||
|
||||
export class VotePollDto {
|
||||
@@ -83,3 +92,16 @@ export class MarkRoomReadDto {
|
||||
@IsString()
|
||||
lastMessageId?: string;
|
||||
}
|
||||
|
||||
export class ToggleMessageReactionDto {
|
||||
@IsString()
|
||||
@MinLength(1)
|
||||
emoji!: string;
|
||||
}
|
||||
|
||||
export class ForwardMessagesDto {
|
||||
@IsArray()
|
||||
@ArrayNotEmpty()
|
||||
@IsString({ each: true })
|
||||
messageIds!: string[];
|
||||
}
|
||||
|
||||
@@ -153,3 +153,10 @@ export class RespondFamilyInviteDto {
|
||||
@IsBoolean({ message: 'Укажите accept: true или false' })
|
||||
accept!: boolean;
|
||||
}
|
||||
|
||||
export class AddBotToFamilyDto {
|
||||
@ApiProperty({ description: 'ID бота для добавления в семью' })
|
||||
@IsString({ message: 'ID бота должен быть строкой' })
|
||||
@IsNotEmpty({ message: 'Укажите ID бота' })
|
||||
botId!: string;
|
||||
}
|
||||
|
||||
133
apps/api-gateway/src/dto/oauth.dto.ts
Normal file
133
apps/api-gateway/src/dto/oauth.dto.ts
Normal file
@@ -0,0 +1,133 @@
|
||||
import { ApiPropertyOptional } from '@nestjs/swagger';
|
||||
import { IsOptional, IsString } from 'class-validator';
|
||||
|
||||
export class OAuthAuthorizeIncomingDto {
|
||||
@ApiPropertyOptional({ description: 'ID пользователя (legacy camelCase)' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
userId?: string;
|
||||
|
||||
@ApiPropertyOptional({ description: 'ID пользователя (OIDC legacy alias)' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
user_id?: string;
|
||||
|
||||
@ApiPropertyOptional({ description: 'OAuth client_id (legacy camelCase)' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
clientId?: string;
|
||||
|
||||
@ApiPropertyOptional({ description: 'OAuth client_id (RFC 6749)' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
client_id?: string;
|
||||
|
||||
@ApiPropertyOptional({ description: 'redirect_uri (legacy camelCase)' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
redirectUri?: string;
|
||||
|
||||
@ApiPropertyOptional({ description: 'redirect_uri (RFC 6749)' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
redirect_uri?: string;
|
||||
|
||||
@ApiPropertyOptional({ description: 'Scopes через пробел', example: 'openid profile email' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
scope?: string;
|
||||
|
||||
@ApiPropertyOptional({ description: 'OAuth state' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
state?: string;
|
||||
|
||||
@ApiPropertyOptional({ description: 'OAuth response_type', example: 'code' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
response_type?: string;
|
||||
|
||||
@ApiPropertyOptional({ description: 'Legacy camelCase alias response_type' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
responseType?: string;
|
||||
|
||||
@ApiPropertyOptional({ description: 'PKCE code_challenge' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
code_challenge?: string;
|
||||
|
||||
@ApiPropertyOptional({ description: 'Legacy camelCase alias code_challenge' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
codeChallenge?: string;
|
||||
|
||||
@ApiPropertyOptional({ description: 'PKCE code_challenge_method', example: 'S256' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
code_challenge_method?: string;
|
||||
|
||||
@ApiPropertyOptional({ description: 'Legacy camelCase alias code_challenge_method' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
codeChallengeMethod?: string;
|
||||
|
||||
@ApiPropertyOptional({ description: 'OpenID Connect nonce' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
nonce?: string;
|
||||
}
|
||||
|
||||
export class OAuthTokenIncomingDto {
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
grantType?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
grant_type?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
code?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
refreshToken?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
refresh_token?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
clientId?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
client_id?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
clientSecret?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
client_secret?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
redirectUri?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
redirect_uri?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
codeVerifier?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
code_verifier?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user