mirror of
https://github.com/immich-app/immich.git
synced 2025-12-25 17:24:58 +03:00
feat: endpoint versioning (#23858)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { Body, Controller, Get, HttpCode, HttpStatus, Post } from '@nestjs/common';
|
||||
import { ApiOperation, ApiTags } from '@nestjs/swagger';
|
||||
import { ApiTags } from '@nestjs/swagger';
|
||||
import { Endpoint, HistoryBuilder } from 'src/decorators';
|
||||
import {
|
||||
AdminOnboardingUpdateDto,
|
||||
ReverseGeocodingStateResponseDto,
|
||||
@@ -16,9 +17,10 @@ export class SystemMetadataController {
|
||||
|
||||
@Get('admin-onboarding')
|
||||
@Authenticated({ permission: Permission.SystemMetadataRead, admin: true })
|
||||
@ApiOperation({
|
||||
@Endpoint({
|
||||
summary: 'Retrieve admin onboarding',
|
||||
description: 'Retrieve the current admin onboarding status.',
|
||||
history: new HistoryBuilder().added('v1').beta('v1').stable('v2'),
|
||||
})
|
||||
getAdminOnboarding(): Promise<AdminOnboardingUpdateDto> {
|
||||
return this.service.getAdminOnboarding();
|
||||
@@ -27,9 +29,10 @@ export class SystemMetadataController {
|
||||
@Post('admin-onboarding')
|
||||
@Authenticated({ permission: Permission.SystemMetadataUpdate, admin: true })
|
||||
@HttpCode(HttpStatus.NO_CONTENT)
|
||||
@ApiOperation({
|
||||
@Endpoint({
|
||||
summary: 'Update admin onboarding',
|
||||
description: 'Update the admin onboarding status.',
|
||||
history: new HistoryBuilder().added('v1').beta('v1').stable('v2'),
|
||||
})
|
||||
updateAdminOnboarding(@Body() dto: AdminOnboardingUpdateDto): Promise<void> {
|
||||
return this.service.updateAdminOnboarding(dto);
|
||||
@@ -37,9 +40,10 @@ export class SystemMetadataController {
|
||||
|
||||
@Get('reverse-geocoding-state')
|
||||
@Authenticated({ permission: Permission.SystemMetadataRead, admin: true })
|
||||
@ApiOperation({
|
||||
@Endpoint({
|
||||
summary: 'Retrieve reverse geocoding state',
|
||||
description: 'Retrieve the current state of the reverse geocoding import.',
|
||||
history: new HistoryBuilder().added('v1').beta('v1').stable('v2'),
|
||||
})
|
||||
getReverseGeocodingState(): Promise<ReverseGeocodingStateResponseDto> {
|
||||
return this.service.getReverseGeocodingState();
|
||||
@@ -47,9 +51,10 @@ export class SystemMetadataController {
|
||||
|
||||
@Get('version-check-state')
|
||||
@Authenticated({ permission: Permission.SystemMetadataRead, admin: true })
|
||||
@ApiOperation({
|
||||
@Endpoint({
|
||||
summary: 'Retrieve version check state',
|
||||
description: 'Retrieve the current state of the version check process.',
|
||||
history: new HistoryBuilder().added('v1').beta('v1').stable('v2'),
|
||||
})
|
||||
getVersionCheckState(): Promise<VersionCheckStateResponseDto> {
|
||||
return this.service.getVersionCheckState();
|
||||
|
||||
Reference in New Issue
Block a user