| 1 | import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; |
| 2 | import { IsInt, IsOptional |
| 3 | |
| 4 | export class GetRepositoryReadmeQueryDTO |
| 5 | @ApiPropertyOptional({ |
| 6 | description: |
| 7 | 'Branch, tag-free ref or commit sha to read from. Accepts `main`, `refs/heads/main` or a commit sha. Omit for the default branch.', |
| 8 | example: 'main', |
| 9 | }) |
| 10 | @IsString() |
| 11 | @IsOptional() |
| 12 | ref?: string |
| 13 | |
| 14 | @ApiPropertyOptional({ |
| 15 | description: 'Directory to look in. Omit for the root of the repository.', |
| 16 | example: 'packages/db', |
| 17 | }) |
| 18 | @IsString() |
| 19 | @IsOptional() |
| 20 | path?: string |
| 21 | } |
| 22 | |
| 23 | export class GetRepositoryReadmeResponseDTO |
| 24 | @ApiProperty({ |
| 25 | description: 'Ref that was read, always fully qualified.', |
| 26 | example: 'refs/heads/main', |
| 27 | }) |
| 28 | @IsString() |
| 29 | ref: string; |
| 30 | |
| 31 | @ApiProperty({ |
| 32 | type: String, |
| 33 | nullable: true, |
| 34 | description: |
| 35 | 'Path of the README that was found, `null` when the repository has none.', |
| 36 | example: 'README.md', |
| 37 | }) |
| 38 | @IsString() |
| 39 | @IsOptional() |
| 40 | path: string |
| 41 | |
| 42 | @ApiProperty({ description |
| 43 | @IsInt() |
| 44 | size: number; |
| 45 | |
| 46 | @ApiProperty({ |
| 47 | type: String, |
| 48 | nullable: true, |
| 49 | description: |
| 50 | 'Markdown source. `null` when there is no README, when it is past the inline size limit, or when it is not valid UTF-8 text.', |
| 51 | }) |
| 52 | @IsString() |
| 53 | @IsOptional() |
| 54 | content: string |
| 55 | } |