| 1 | import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; |
| 2 | import { schema } |
| 3 | import { IsIn, IsOptional |
| 4 | |
| 5 | export class ForkRepositoryRequestDTO |
| 6 | @ApiProperty() |
| 7 | @IsString() |
| 8 | name: string; |
| 9 | |
| 10 | @ApiPropertyOptional() |
| 11 | @IsString() |
| 12 | @IsOptional() |
| 13 | description?: string |
| 14 | |
| 15 | @ApiProperty({ |
| 16 | enumName: 'RepositoryVisibility', |
| 17 | enum: schema.repositoryVisiblity |
| 18 | }) |
| 19 | @IsIn(schema. |
| 20 | visibility: (typeof |
| 21 | |
| 22 | @ApiPropertyOptional({ |
| 23 | description: |
| 24 | "Slug of the organization to fork into; the requester's own account when omitted. Needs admin in the organization.", |
| 25 | }) |
| 26 | @IsString() |
| 27 | @IsOptional() |
| 28 | organization?: string |
| 29 | } |
| 30 | |
| 31 | export class ForkRepositoryResponseDTO |
| 32 | @ApiProperty() |
| 33 | @IsString() |
| 34 | id: string; |
| 35 | |
| 36 | @ApiProperty() |
| 37 | @IsString() |
| 38 | slug: string; |
| 39 | |
| 40 | @ApiProperty() |
| 41 | @IsString() |
| 42 | username: string; |
| 43 | } |
| 44 | |
| 45 | export class TransferRepositoryRequestDTO |
| 46 | @ApiProperty({ |
| 47 | description: |
| 48 | "The new owner: the requester's own username, or the slug of an organization the requester administers.", |
| 49 | }) |
| 50 | @IsString() |
| 51 | owner: string; |
| 52 | } |
| 53 | |
| 54 | export class TransferRepositoryResponseDTO |
| 55 | @ApiProperty({ |
| 56 | description: |
| 57 | 'True when the recipient has to accept it first; the repository has not moved yet.', |
| 58 | }) |
| 59 | pending: boolean; |
| 60 | } |
| 61 | |
| 62 | export class IncomingTransferRepositoryDTO |
| 63 | @ApiProperty() |
| 64 | owner: string; |
| 65 | |
| 66 | @ApiProperty() |
| 67 | slug: string; |
| 68 | |
| 69 | @ApiProperty() |
| 70 | name: string; |
| 71 | } |
| 72 | |
| 73 | export class IncomingTransferDTO |
| 74 | @ApiProperty() |
| 75 | repositoryId: string; |
| 76 | |
| 77 | @ApiProperty({ type |
| 78 | repository: IncomingTransferRepositoryDTO |
| 79 | |
| 80 | @ApiProperty({ description |
| 81 | to: string; |
| 82 | |
| 83 | @ApiProperty({ type |
| 84 | requestedByUsername: string |
| 85 | |
| 86 | @ApiProperty() |
| 87 | createdAt: string; |
| 88 | } |
| 89 | |
| 90 | export class ListIncomingTransfersResponseDTO |
| 91 | @ApiProperty({ type |
| 92 | transfers: IncomingTransferDTO |
| 93 | } |