All checks were successful
ci/woodpecker/push/ci Pipeline was successful
Co-authored-by: Jason Woltje <jason@diversecanvas.com> Co-committed-by: Jason Woltje <jason@diversecanvas.com>
72 lines
1.1 KiB
TypeScript
72 lines
1.1 KiB
TypeScript
import { Type } from "class-transformer";
|
|
import { IsArray, IsOptional, IsString, IsUrl, MinLength, ValidateNested } from "class-validator";
|
|
|
|
export class CreateBreakglassDto {
|
|
@IsString()
|
|
@MinLength(3)
|
|
username!: string;
|
|
|
|
@IsString()
|
|
@MinLength(8)
|
|
password!: string;
|
|
}
|
|
|
|
export class ConfigureOidcDto {
|
|
@IsString()
|
|
@IsUrl({ require_tld: false })
|
|
issuerUrl!: string;
|
|
|
|
@IsString()
|
|
clientId!: string;
|
|
|
|
@IsString()
|
|
clientSecret!: string;
|
|
}
|
|
|
|
export class ProviderModelDto {
|
|
@IsString()
|
|
id!: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
name?: string;
|
|
}
|
|
|
|
export class AddProviderDto {
|
|
@IsString()
|
|
name!: string;
|
|
|
|
@IsString()
|
|
displayName!: string;
|
|
|
|
@IsString()
|
|
type!: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
baseUrl?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
apiKey?: string;
|
|
|
|
@IsOptional()
|
|
@IsArray()
|
|
@ValidateNested({ each: true })
|
|
@Type(() => ProviderModelDto)
|
|
models?: ProviderModelDto[];
|
|
}
|
|
|
|
export class TestProviderDto {
|
|
@IsString()
|
|
type!: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
baseUrl?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
apiKey?: string;
|
|
}
|