61 lines
1.1 KiB
TypeScript
61 lines
1.1 KiB
TypeScript
import { ApiProperty } from '@nestjs/swagger';
|
|
|
|
class AuthResponseMetaDto {
|
|
@ApiProperty({ type: String, nullable: true })
|
|
cachedAt!: string | null;
|
|
|
|
@ApiProperty()
|
|
fromCache!: boolean;
|
|
}
|
|
|
|
class AuthUserDto {
|
|
@ApiProperty()
|
|
id!: number;
|
|
|
|
@ApiProperty()
|
|
email!: string;
|
|
|
|
@ApiProperty({ type: String, nullable: true })
|
|
name!: string | null;
|
|
|
|
@ApiProperty()
|
|
role!: string;
|
|
}
|
|
|
|
class AuthTokenDataDto {
|
|
@ApiProperty({ type: AuthUserDto })
|
|
user!: AuthUserDto;
|
|
|
|
@ApiProperty()
|
|
accessToken!: string;
|
|
}
|
|
|
|
class LogoutDataDto {
|
|
@ApiProperty()
|
|
message!: string;
|
|
}
|
|
|
|
export class AuthTokenResponseDto {
|
|
@ApiProperty({ type: AuthTokenDataDto })
|
|
data!: AuthTokenDataDto;
|
|
|
|
@ApiProperty({ type: AuthResponseMetaDto })
|
|
meta!: AuthResponseMetaDto;
|
|
}
|
|
|
|
export class AuthProfileResponseDto {
|
|
@ApiProperty({ type: AuthUserDto })
|
|
data!: AuthUserDto;
|
|
|
|
@ApiProperty({ type: AuthResponseMetaDto })
|
|
meta!: AuthResponseMetaDto;
|
|
}
|
|
|
|
export class AuthLogoutResponseDto {
|
|
@ApiProperty({ type: LogoutDataDto })
|
|
data!: LogoutDataDto;
|
|
|
|
@ApiProperty({ type: AuthResponseMetaDto })
|
|
meta!: AuthResponseMetaDto;
|
|
}
|