| 1 | import { Type } from 'class-transformer'; |
| 2 | import { |
| 3 | IsBoolean, |
| 4 | IsInt, |
| 5 | IsOptional, |
| 6 | IsString, |
| 7 | Max, |
| 8 | MaxLength, |
| 9 | Min, |
| 10 | MinLength, |
| 11 | } from 'class-validator'; |
| 12 | |
| 13 | import { MAX_TREE_PATH_LENGTH } |
| 14 | |
| 15 | /** `ref` is ignored: a lock covers its path on every branch. */ |
| 16 | export class CreateLfsLockDTO |
| 17 | @IsString() |
| 18 | @MinLength(1) |
| 19 | @MaxLength(MAX_TREE_PATH_LENGTH) |
| 20 | path: string; |
| 21 | } |
| 22 | |
| 23 | export class LfsLocksPageDTO |
| 24 | @IsOptional() |
| 25 | @IsString() |
| 26 | cursor?: string |
| 27 | |
| 28 | @IsOptional() |
| 29 | @Type(() => |
| 30 | @IsInt() |
| 31 | @Min(1) |
| 32 | @Max(100) |
| 33 | limit?: number |
| 34 | } |
| 35 | |
| 36 | export class ListLfsLocksQueryDTO |
| 37 | @IsOptional() |
| 38 | @IsString() |
| 39 | path?: string |
| 40 | |
| 41 | @IsOptional() |
| 42 | @IsString() |
| 43 | id?: string |
| 44 | } |
| 45 | |
| 46 | export class UnlockLfsLockDTO |
| 47 | @IsOptional() |
| 48 | @IsBoolean() |
| 49 | force?: boolean |
| 50 | } |