| 1 | import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; |
| 2 | import { IsBoolean, IsIn |
| 3 | |
| 4 | /** GitHub's create-repository body; every field gh may send is declared so the global whitelist keeps it. */ |
| 5 | export class GithubCreateRepositoryDTO |
| 6 | @ApiProperty({ example |
| 7 | @IsString() |
| 8 | name: string; |
| 9 | |
| 10 | @ApiPropertyOptional() |
| 11 | @IsOptional() |
| 12 | @IsString() |
| 13 | description?: string |
| 14 | |
| 15 | @ApiPropertyOptional({ description |
| 16 | @IsOptional() |
| 17 | @IsBoolean() |
| 18 | private?: boolean |
| 19 | |
| 20 | @ApiPropertyOptional({ enum |
| 21 | @IsOptional() |
| 22 | @IsIn(['public' |
| 23 | visibility?: 'public |
| 24 | |
| 25 | @ApiPropertyOptional({ |
| 26 | description: |
| 27 | 'Accepted and ignored: Ghost cannot write an initial commit from the API yet.', |
| 28 | }) |
| 29 | @IsOptional() |
| 30 | @IsBoolean() |
| 31 | auto_init?: boolean |
| 32 | |
| 33 | @ApiPropertyOptional({ description |
| 34 | @IsOptional() |
| 35 | @IsString() |
| 36 | gitignore_template?: string |
| 37 | |
| 38 | @ApiPropertyOptional({ description |
| 39 | @IsOptional() |
| 40 | @IsString() |
| 41 | license_template?: string |
| 42 | } |