hysteria
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import { IsString, IsArray, ValidateNested, IsOptional, Min, Max, ArrayMinSize, ArrayMaxSize } from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
|
||||
export class InboundConfigDto {
|
||||
@IsString()
|
||||
type: string;
|
||||
|
||||
@IsOptional()
|
||||
port?: number | 'random';
|
||||
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
sni?: string | 'random';
|
||||
}
|
||||
|
||||
export class CreateSubscriptionDto {
|
||||
@IsString()
|
||||
name: string;
|
||||
|
||||
@IsArray()
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => InboundConfigDto)
|
||||
@ArrayMinSize(1)
|
||||
@ArrayMaxSize(20)
|
||||
@IsOptional()
|
||||
inboundsConfig?: InboundConfigDto[];
|
||||
}
|
||||
Reference in New Issue
Block a user