| 1 | import { Controller, Get, UseFilters } from '@nestjs/common'; |
| 2 | import { ApiOperation, ApiTags |
| 3 | import { AllowAnonymous } |
| 4 | |
| 5 | import { GithubRestFilter } |
| 6 | import { MetaService } |
| 7 | |
| 8 | @Controller('v3') |
| 9 | @ApiTags('GitHub compatibility') |
| 10 | @AllowAnonymous() |
| 11 | @UseFilters(GithubRestFilter) |
| 12 | export class MetaController |
| 13 | constructor(private readonly |
| 14 | |
| 15 | @Get() |
| 16 | @ApiOperation({ |
| 17 | summary: 'GitHub API root; gh reads the X-OAuth-Scopes header it carries', |
| 18 | }) |
| 19 | root() { |
| 20 | return this.metadata |
| 21 | } |
| 22 | |
| 23 | @Get('meta' |
| 24 | @ApiOperation({ |
| 25 | summary: |
| 26 | 'GitHub Enterprise meta; installed_version decides which search syntax gh uses', |
| 27 | }) |
| 28 | meta() { |
| 29 | return this.metadata |
| 30 | } |
| 31 | } |