| 1 | import { |
| 2 | Controller, |
| 3 | Delete, |
| 4 | HttpCode, |
| 5 | HttpStatus, |
| 6 | Param, |
| 7 | UseFilters, |
| 8 | } from '@nestjs/common'; |
| 9 | import { ApiOperation, ApiTags |
| 10 | import { AllowAnonymous } |
| 11 | |
| 12 | import type { GithubViewer |
| 13 | import { Viewer } |
| 14 | import { GithubRestFilter } |
| 15 | import { GithubGitService } |
| 16 | |
| 17 | @Controller('v3/repos/:owner/:repo/git/refs') |
| 18 | @ApiTags('GitHub compatibility') |
| 19 | @AllowAnonymous() |
| 20 | @UseFilters(GithubRestFilter) |
| 21 | export class GithubGitController |
| 22 | constructor(private readonly |
| 23 | |
| 24 | /** gh escapes the slash after the namespace, which arrives decoded within one segment, so the segments are joined back. */ |
| 25 | @Delete('*ref' |
| 26 | @HttpCode(HttpStatus. |
| 27 | @ApiOperation({ summary |
| 28 | delete( |
| 29 | @Param('owner' |
| 30 | @Param('repo' |
| 31 | @Param('ref' |
| 32 | @Viewer() viewer |
| 33 | ) { |
| 34 | return this.git |
| 35 | } |
| 36 | } |