| 1 | import { Controller, Get, Param, Session } from '@nestjs/common'; |
| 2 | import { |
| 3 | ApiNotFoundResponse, |
| 4 | ApiOkResponse, |
| 5 | ApiOperation, |
| 6 | ApiTags, |
| 7 | } from '@nestjs/swagger'; |
| 8 | import type { UserSession |
| 9 | |
| 10 | import { ErrorResponseDTO } |
| 11 | import { StorageUsageDTO } |
| 12 | import { StorageService } |
| 13 | |
| 14 | @Controller('storage') |
| 15 | @ApiTags('Storage') |
| 16 | export class StorageController |
| 17 | constructor(private readonly |
| 18 | |
| 19 | @Get(':owner' |
| 20 | @ApiOperation({ |
| 21 | summary: 'Storage usage of an account', |
| 22 | description: |
| 23 | "Bytes the signed-in user's own account, or an organization they belong to, keeps in release assets, against this instance's quota.", |
| 24 | }) |
| 25 | @ApiOkResponse({ type |
| 26 | @ApiNotFoundResponse({ type |
| 27 | getStorageUsage( |
| 28 | @Param('owner' |
| 29 | @Session() session |
| 30 | ): Promise<StorageUsageDTO |
| 31 | return this.storage |
| 32 | } |
| 33 | } |