28 lines
689 B
TypeScript
Raw Normal View History

2022-08-30 21:26:35 +02:00
import { SuccessResponse } from './base';
import { ValidateConstructor } from '../utils';
import { IsBoolean, IsNotEmpty, IsString } from 'class-validator';
2022-08-28 17:37:09 +02:00
@ValidateConstructor
export class UserInfoResponse extends SuccessResponse {
2022-08-30 21:26:35 +02:00
constructor(name: string, gitlab: boolean, tfaEnabled: boolean) {
super();
this.name = name;
this.gitlab = gitlab;
this.tfaEnabled = tfaEnabled;
}
2022-08-28 17:37:09 +02:00
2022-08-30 21:26:35 +02:00
@IsNotEmpty()
@IsString()
name: string;
2022-08-28 17:37:09 +02:00
2022-08-30 21:26:35 +02:00
@IsBoolean()
gitlab: boolean;
2022-08-28 17:37:09 +02:00
2022-08-30 21:26:35 +02:00
@IsBoolean()
tfaEnabled: boolean;
2022-08-28 17:37:09 +02:00
}
export class DeleteUserResponse extends SuccessResponse {}
export class ChangePasswordResponse extends SuccessResponse {}
export class LogoutAllResponse extends SuccessResponse {}