mirror of
				https://github.com/immich-app/immich.git
				synced 2025-11-01 02:17:43 +09:00 
			
		
		
		
	refactor: move /server-info endpoints to /server (#10677)
This commit is contained in:
		
							
								
								
									
										200
									
								
								e2e/src/api/specs/server.e2e-spec.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										200
									
								
								e2e/src/api/specs/server.e2e-spec.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,200 @@ | |||||||
|  | import { LoginResponseDto } from '@immich/sdk'; | ||||||
|  | import { createUserDto } from 'src/fixtures'; | ||||||
|  | import { errorDto } from 'src/responses'; | ||||||
|  | import { app, utils } from 'src/utils'; | ||||||
|  | import request from 'supertest'; | ||||||
|  | import { beforeAll, describe, expect, it } from 'vitest'; | ||||||
|  |  | ||||||
|  | describe('/server', () => { | ||||||
|  |   let admin: LoginResponseDto; | ||||||
|  |   let nonAdmin: LoginResponseDto; | ||||||
|  |  | ||||||
|  |   beforeAll(async () => { | ||||||
|  |     await utils.resetDatabase(); | ||||||
|  |     admin = await utils.adminSetup({ onboarding: false }); | ||||||
|  |     nonAdmin = await utils.userSetup(admin.accessToken, createUserDto.user1); | ||||||
|  |   }); | ||||||
|  |  | ||||||
|  |   describe('GET /server/about', () => { | ||||||
|  |     it('should require authentication', async () => { | ||||||
|  |       const { status, body } = await request(app).get('/server/about'); | ||||||
|  |       expect(status).toBe(401); | ||||||
|  |       expect(body).toEqual(errorDto.unauthorized); | ||||||
|  |     }); | ||||||
|  |  | ||||||
|  |     it('should return about information', async () => { | ||||||
|  |       const { status, body } = await request(app) | ||||||
|  |         .get('/server/about') | ||||||
|  |         .set('Authorization', `Bearer ${admin.accessToken}`); | ||||||
|  |       expect(status).toBe(200); | ||||||
|  |       expect(body).toEqual({ | ||||||
|  |         version: expect.any(String), | ||||||
|  |         versionUrl: expect.any(String), | ||||||
|  |         repository: 'immich-app/immich', | ||||||
|  |         repositoryUrl: 'https://github.com/immich-app/immich', | ||||||
|  |         build: '1234567890', | ||||||
|  |         buildUrl: 'https://github.com/immich-app/immich/actions/runs/1234567890', | ||||||
|  |         buildImage: 'e2e', | ||||||
|  |         buildImageUrl: 'https://github.com/immich-app/immich/pkgs/container/immich-server', | ||||||
|  |         sourceRef: 'e2e', | ||||||
|  |         sourceCommit: 'e2eeeeeeeeeeeeeeeeee', | ||||||
|  |         sourceUrl: 'https://github.com/immich-app/immich/commit/e2eeeeeeeeeeeeeeeeee', | ||||||
|  |         nodejs: expect.any(String), | ||||||
|  |         ffmpeg: expect.any(String), | ||||||
|  |         imagemagick: expect.any(String), | ||||||
|  |         libvips: expect.any(String), | ||||||
|  |         exiftool: expect.any(String), | ||||||
|  |       }); | ||||||
|  |     }); | ||||||
|  |   }); | ||||||
|  |  | ||||||
|  |   describe('GET /server/storage', () => { | ||||||
|  |     it('should require authentication', async () => { | ||||||
|  |       const { status, body } = await request(app).get('/server/storage'); | ||||||
|  |       expect(status).toBe(401); | ||||||
|  |       expect(body).toEqual(errorDto.unauthorized); | ||||||
|  |     }); | ||||||
|  |  | ||||||
|  |     it('should return the disk information', async () => { | ||||||
|  |       const { status, body } = await request(app) | ||||||
|  |         .get('/server/storage') | ||||||
|  |         .set('Authorization', `Bearer ${admin.accessToken}`); | ||||||
|  |       expect(status).toBe(200); | ||||||
|  |       expect(body).toEqual({ | ||||||
|  |         diskAvailable: expect.any(String), | ||||||
|  |         diskAvailableRaw: expect.any(Number), | ||||||
|  |         diskSize: expect.any(String), | ||||||
|  |         diskSizeRaw: expect.any(Number), | ||||||
|  |         diskUsagePercentage: expect.any(Number), | ||||||
|  |         diskUse: expect.any(String), | ||||||
|  |         diskUseRaw: expect.any(Number), | ||||||
|  |       }); | ||||||
|  |     }); | ||||||
|  |   }); | ||||||
|  |  | ||||||
|  |   describe('GET /server/ping', () => { | ||||||
|  |     it('should respond with pong', async () => { | ||||||
|  |       const { status, body } = await request(app).get('/server/ping'); | ||||||
|  |       expect(status).toBe(200); | ||||||
|  |       expect(body).toEqual({ res: 'pong' }); | ||||||
|  |     }); | ||||||
|  |   }); | ||||||
|  |  | ||||||
|  |   describe('GET /server/version', () => { | ||||||
|  |     it('should respond with the server version', async () => { | ||||||
|  |       const { status, body } = await request(app).get('/server/version'); | ||||||
|  |       expect(status).toBe(200); | ||||||
|  |       expect(body).toEqual({ | ||||||
|  |         major: expect.any(Number), | ||||||
|  |         minor: expect.any(Number), | ||||||
|  |         patch: expect.any(Number), | ||||||
|  |       }); | ||||||
|  |     }); | ||||||
|  |   }); | ||||||
|  |  | ||||||
|  |   describe('GET /server/features', () => { | ||||||
|  |     it('should respond with the server features', async () => { | ||||||
|  |       const { status, body } = await request(app).get('/server/features'); | ||||||
|  |       expect(status).toBe(200); | ||||||
|  |       expect(body).toEqual({ | ||||||
|  |         smartSearch: false, | ||||||
|  |         configFile: false, | ||||||
|  |         duplicateDetection: false, | ||||||
|  |         facialRecognition: false, | ||||||
|  |         map: true, | ||||||
|  |         reverseGeocoding: true, | ||||||
|  |         oauth: false, | ||||||
|  |         oauthAutoLaunch: false, | ||||||
|  |         passwordLogin: true, | ||||||
|  |         search: true, | ||||||
|  |         sidecar: true, | ||||||
|  |         trash: true, | ||||||
|  |         email: false, | ||||||
|  |       }); | ||||||
|  |     }); | ||||||
|  |   }); | ||||||
|  |  | ||||||
|  |   describe('GET /server/config', () => { | ||||||
|  |     it('should respond with the server configuration', async () => { | ||||||
|  |       const { status, body } = await request(app).get('/server/config'); | ||||||
|  |       expect(status).toBe(200); | ||||||
|  |       expect(body).toEqual({ | ||||||
|  |         loginPageMessage: '', | ||||||
|  |         oauthButtonText: 'Login with OAuth', | ||||||
|  |         trashDays: 30, | ||||||
|  |         userDeleteDelay: 7, | ||||||
|  |         isInitialized: true, | ||||||
|  |         externalDomain: '', | ||||||
|  |         isOnboarded: false, | ||||||
|  |       }); | ||||||
|  |     }); | ||||||
|  |   }); | ||||||
|  |  | ||||||
|  |   describe('GET /server/statistics', () => { | ||||||
|  |     it('should require authentication', async () => { | ||||||
|  |       const { status, body } = await request(app).get('/server/statistics'); | ||||||
|  |       expect(status).toBe(401); | ||||||
|  |       expect(body).toEqual(errorDto.unauthorized); | ||||||
|  |     }); | ||||||
|  |  | ||||||
|  |     it('should only work for admins', async () => { | ||||||
|  |       const { status, body } = await request(app) | ||||||
|  |         .get('/server/statistics') | ||||||
|  |         .set('Authorization', `Bearer ${nonAdmin.accessToken}`); | ||||||
|  |       expect(status).toBe(403); | ||||||
|  |       expect(body).toEqual(errorDto.forbidden); | ||||||
|  |     }); | ||||||
|  |  | ||||||
|  |     it('should return the server stats', async () => { | ||||||
|  |       const { status, body } = await request(app) | ||||||
|  |         .get('/server/statistics') | ||||||
|  |         .set('Authorization', `Bearer ${admin.accessToken}`); | ||||||
|  |       expect(status).toBe(200); | ||||||
|  |       expect(body).toEqual({ | ||||||
|  |         photos: 0, | ||||||
|  |         usage: 0, | ||||||
|  |         usageByUser: [ | ||||||
|  |           { | ||||||
|  |             quotaSizeInBytes: null, | ||||||
|  |             photos: 0, | ||||||
|  |             usage: 0, | ||||||
|  |             userName: 'Immich Admin', | ||||||
|  |             userId: admin.userId, | ||||||
|  |             videos: 0, | ||||||
|  |           }, | ||||||
|  |           { | ||||||
|  |             quotaSizeInBytes: null, | ||||||
|  |             photos: 0, | ||||||
|  |             usage: 0, | ||||||
|  |             userName: 'User 1', | ||||||
|  |             userId: nonAdmin.userId, | ||||||
|  |             videos: 0, | ||||||
|  |           }, | ||||||
|  |         ], | ||||||
|  |         videos: 0, | ||||||
|  |       }); | ||||||
|  |     }); | ||||||
|  |   }); | ||||||
|  |  | ||||||
|  |   describe('GET /server/media-types', () => { | ||||||
|  |     it('should return accepted media types', async () => { | ||||||
|  |       const { status, body } = await request(app).get('/server/media-types'); | ||||||
|  |       expect(status).toBe(200); | ||||||
|  |       expect(body).toEqual({ | ||||||
|  |         sidecar: ['.xmp'], | ||||||
|  |         image: expect.any(Array), | ||||||
|  |         video: expect.any(Array), | ||||||
|  |       }); | ||||||
|  |     }); | ||||||
|  |   }); | ||||||
|  |  | ||||||
|  |   describe('GET /server/theme', () => { | ||||||
|  |     it('should respond with the server theme', async () => { | ||||||
|  |       const { status, body } = await request(app).get('/server/theme'); | ||||||
|  |       expect(status).toBe(200); | ||||||
|  |       expect(body).toEqual({ | ||||||
|  |         customCss: '', | ||||||
|  |       }); | ||||||
|  |     }); | ||||||
|  |   }); | ||||||
|  | }); | ||||||
							
								
								
									
										9
									
								
								mobile/openapi/README.md
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										9
									
								
								mobile/openapi/README.md
									
									
									
										generated
									
									
									
								
							| @@ -116,6 +116,15 @@ Class | Method | HTTP request | Description | |||||||
| *AuthenticationApi* | [**logout**](doc//AuthenticationApi.md#logout) | **POST** /auth/logout |  | *AuthenticationApi* | [**logout**](doc//AuthenticationApi.md#logout) | **POST** /auth/logout |  | ||||||
| *AuthenticationApi* | [**signUpAdmin**](doc//AuthenticationApi.md#signupadmin) | **POST** /auth/admin-sign-up |  | *AuthenticationApi* | [**signUpAdmin**](doc//AuthenticationApi.md#signupadmin) | **POST** /auth/admin-sign-up |  | ||||||
| *AuthenticationApi* | [**validateAccessToken**](doc//AuthenticationApi.md#validateaccesstoken) | **POST** /auth/validateToken |  | *AuthenticationApi* | [**validateAccessToken**](doc//AuthenticationApi.md#validateaccesstoken) | **POST** /auth/validateToken |  | ||||||
|  | *DeprecatedApi* | [**getAboutInfo**](doc//DeprecatedApi.md#getaboutinfo) | **GET** /server-info/about |  | ||||||
|  | *DeprecatedApi* | [**getServerConfig**](doc//DeprecatedApi.md#getserverconfig) | **GET** /server-info/config |  | ||||||
|  | *DeprecatedApi* | [**getServerFeatures**](doc//DeprecatedApi.md#getserverfeatures) | **GET** /server-info/features |  | ||||||
|  | *DeprecatedApi* | [**getServerStatistics**](doc//DeprecatedApi.md#getserverstatistics) | **GET** /server-info/statistics |  | ||||||
|  | *DeprecatedApi* | [**getServerVersion**](doc//DeprecatedApi.md#getserverversion) | **GET** /server-info/version |  | ||||||
|  | *DeprecatedApi* | [**getStorage**](doc//DeprecatedApi.md#getstorage) | **GET** /server-info/storage |  | ||||||
|  | *DeprecatedApi* | [**getSupportedMediaTypes**](doc//DeprecatedApi.md#getsupportedmediatypes) | **GET** /server-info/media-types |  | ||||||
|  | *DeprecatedApi* | [**getTheme**](doc//DeprecatedApi.md#gettheme) | **GET** /server-info/theme |  | ||||||
|  | *DeprecatedApi* | [**pingServer**](doc//DeprecatedApi.md#pingserver) | **GET** /server-info/ping |  | ||||||
| *DownloadApi* | [**downloadArchive**](doc//DownloadApi.md#downloadarchive) | **POST** /download/archive |  | *DownloadApi* | [**downloadArchive**](doc//DownloadApi.md#downloadarchive) | **POST** /download/archive |  | ||||||
| *DownloadApi* | [**getDownloadInfo**](doc//DownloadApi.md#getdownloadinfo) | **POST** /download/info |  | *DownloadApi* | [**getDownloadInfo**](doc//DownloadApi.md#getdownloadinfo) | **POST** /download/info |  | ||||||
| *DuplicatesApi* | [**getAssetDuplicates**](doc//DuplicatesApi.md#getassetduplicates) | **GET** /duplicates |  | *DuplicatesApi* | [**getAssetDuplicates**](doc//DuplicatesApi.md#getassetduplicates) | **GET** /duplicates |  | ||||||
|   | |||||||
							
								
								
									
										1
									
								
								mobile/openapi/lib/api.dart
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										1
									
								
								mobile/openapi/lib/api.dart
									
									
									
										generated
									
									
									
								
							| @@ -35,6 +35,7 @@ part 'api/albums_api.dart'; | |||||||
| part 'api/assets_api.dart'; | part 'api/assets_api.dart'; | ||||||
| part 'api/audit_api.dart'; | part 'api/audit_api.dart'; | ||||||
| part 'api/authentication_api.dart'; | part 'api/authentication_api.dart'; | ||||||
|  | part 'api/deprecated_api.dart'; | ||||||
| part 'api/download_api.dart'; | part 'api/download_api.dart'; | ||||||
| part 'api/duplicates_api.dart'; | part 'api/duplicates_api.dart'; | ||||||
| part 'api/faces_api.dart'; | part 'api/faces_api.dart'; | ||||||
|   | |||||||
							
								
								
									
										414
									
								
								mobile/openapi/lib/api/deprecated_api.dart
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										414
									
								
								mobile/openapi/lib/api/deprecated_api.dart
									
									
									
										generated
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,414 @@ | |||||||
|  | // | ||||||
|  | // AUTO-GENERATED FILE, DO NOT MODIFY! | ||||||
|  | // | ||||||
|  | // @dart=2.18 | ||||||
|  | 
 | ||||||
|  | // ignore_for_file: unused_element, unused_import | ||||||
|  | // ignore_for_file: always_put_required_named_parameters_first | ||||||
|  | // ignore_for_file: constant_identifier_names | ||||||
|  | // ignore_for_file: lines_longer_than_80_chars | ||||||
|  | 
 | ||||||
|  | part of openapi.api; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | class DeprecatedApi { | ||||||
|  |   DeprecatedApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; | ||||||
|  | 
 | ||||||
|  |   final ApiClient apiClient; | ||||||
|  | 
 | ||||||
|  |   /// This property was deprecated in v1.107.0 | ||||||
|  |   /// | ||||||
|  |   /// Note: This method returns the HTTP [Response]. | ||||||
|  |   Future<Response> getAboutInfoWithHttpInfo() async { | ||||||
|  |     // ignore: prefer_const_declarations | ||||||
|  |     final path = r'/server-info/about'; | ||||||
|  | 
 | ||||||
|  |     // ignore: prefer_final_locals | ||||||
|  |     Object? postBody; | ||||||
|  | 
 | ||||||
|  |     final queryParams = <QueryParam>[]; | ||||||
|  |     final headerParams = <String, String>{}; | ||||||
|  |     final formParams = <String, String>{}; | ||||||
|  | 
 | ||||||
|  |     const contentTypes = <String>[]; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     return apiClient.invokeAPI( | ||||||
|  |       path, | ||||||
|  |       'GET', | ||||||
|  |       queryParams, | ||||||
|  |       postBody, | ||||||
|  |       headerParams, | ||||||
|  |       formParams, | ||||||
|  |       contentTypes.isEmpty ? null : contentTypes.first, | ||||||
|  |     ); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /// This property was deprecated in v1.107.0 | ||||||
|  |   Future<ServerAboutResponseDto?> getAboutInfo() async { | ||||||
|  |     final response = await getAboutInfoWithHttpInfo(); | ||||||
|  |     if (response.statusCode >= HttpStatus.badRequest) { | ||||||
|  |       throw ApiException(response.statusCode, await _decodeBodyBytes(response)); | ||||||
|  |     } | ||||||
|  |     // When a remote server returns no body with a status of 204, we shall not decode it. | ||||||
|  |     // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" | ||||||
|  |     // FormatException when trying to decode an empty string. | ||||||
|  |     if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { | ||||||
|  |       return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ServerAboutResponseDto',) as ServerAboutResponseDto; | ||||||
|  |      | ||||||
|  |     } | ||||||
|  |     return null; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /// This property was deprecated in v1.107.0 | ||||||
|  |   /// | ||||||
|  |   /// Note: This method returns the HTTP [Response]. | ||||||
|  |   Future<Response> getServerConfigWithHttpInfo() async { | ||||||
|  |     // ignore: prefer_const_declarations | ||||||
|  |     final path = r'/server-info/config'; | ||||||
|  | 
 | ||||||
|  |     // ignore: prefer_final_locals | ||||||
|  |     Object? postBody; | ||||||
|  | 
 | ||||||
|  |     final queryParams = <QueryParam>[]; | ||||||
|  |     final headerParams = <String, String>{}; | ||||||
|  |     final formParams = <String, String>{}; | ||||||
|  | 
 | ||||||
|  |     const contentTypes = <String>[]; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     return apiClient.invokeAPI( | ||||||
|  |       path, | ||||||
|  |       'GET', | ||||||
|  |       queryParams, | ||||||
|  |       postBody, | ||||||
|  |       headerParams, | ||||||
|  |       formParams, | ||||||
|  |       contentTypes.isEmpty ? null : contentTypes.first, | ||||||
|  |     ); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /// This property was deprecated in v1.107.0 | ||||||
|  |   Future<ServerConfigDto?> getServerConfig() async { | ||||||
|  |     final response = await getServerConfigWithHttpInfo(); | ||||||
|  |     if (response.statusCode >= HttpStatus.badRequest) { | ||||||
|  |       throw ApiException(response.statusCode, await _decodeBodyBytes(response)); | ||||||
|  |     } | ||||||
|  |     // When a remote server returns no body with a status of 204, we shall not decode it. | ||||||
|  |     // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" | ||||||
|  |     // FormatException when trying to decode an empty string. | ||||||
|  |     if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { | ||||||
|  |       return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ServerConfigDto',) as ServerConfigDto; | ||||||
|  |      | ||||||
|  |     } | ||||||
|  |     return null; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /// This property was deprecated in v1.107.0 | ||||||
|  |   /// | ||||||
|  |   /// Note: This method returns the HTTP [Response]. | ||||||
|  |   Future<Response> getServerFeaturesWithHttpInfo() async { | ||||||
|  |     // ignore: prefer_const_declarations | ||||||
|  |     final path = r'/server-info/features'; | ||||||
|  | 
 | ||||||
|  |     // ignore: prefer_final_locals | ||||||
|  |     Object? postBody; | ||||||
|  | 
 | ||||||
|  |     final queryParams = <QueryParam>[]; | ||||||
|  |     final headerParams = <String, String>{}; | ||||||
|  |     final formParams = <String, String>{}; | ||||||
|  | 
 | ||||||
|  |     const contentTypes = <String>[]; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     return apiClient.invokeAPI( | ||||||
|  |       path, | ||||||
|  |       'GET', | ||||||
|  |       queryParams, | ||||||
|  |       postBody, | ||||||
|  |       headerParams, | ||||||
|  |       formParams, | ||||||
|  |       contentTypes.isEmpty ? null : contentTypes.first, | ||||||
|  |     ); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /// This property was deprecated in v1.107.0 | ||||||
|  |   Future<ServerFeaturesDto?> getServerFeatures() async { | ||||||
|  |     final response = await getServerFeaturesWithHttpInfo(); | ||||||
|  |     if (response.statusCode >= HttpStatus.badRequest) { | ||||||
|  |       throw ApiException(response.statusCode, await _decodeBodyBytes(response)); | ||||||
|  |     } | ||||||
|  |     // When a remote server returns no body with a status of 204, we shall not decode it. | ||||||
|  |     // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" | ||||||
|  |     // FormatException when trying to decode an empty string. | ||||||
|  |     if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { | ||||||
|  |       return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ServerFeaturesDto',) as ServerFeaturesDto; | ||||||
|  |      | ||||||
|  |     } | ||||||
|  |     return null; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /// This property was deprecated in v1.107.0 | ||||||
|  |   /// | ||||||
|  |   /// Note: This method returns the HTTP [Response]. | ||||||
|  |   Future<Response> getServerStatisticsWithHttpInfo() async { | ||||||
|  |     // ignore: prefer_const_declarations | ||||||
|  |     final path = r'/server-info/statistics'; | ||||||
|  | 
 | ||||||
|  |     // ignore: prefer_final_locals | ||||||
|  |     Object? postBody; | ||||||
|  | 
 | ||||||
|  |     final queryParams = <QueryParam>[]; | ||||||
|  |     final headerParams = <String, String>{}; | ||||||
|  |     final formParams = <String, String>{}; | ||||||
|  | 
 | ||||||
|  |     const contentTypes = <String>[]; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     return apiClient.invokeAPI( | ||||||
|  |       path, | ||||||
|  |       'GET', | ||||||
|  |       queryParams, | ||||||
|  |       postBody, | ||||||
|  |       headerParams, | ||||||
|  |       formParams, | ||||||
|  |       contentTypes.isEmpty ? null : contentTypes.first, | ||||||
|  |     ); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /// This property was deprecated in v1.107.0 | ||||||
|  |   Future<ServerStatsResponseDto?> getServerStatistics() async { | ||||||
|  |     final response = await getServerStatisticsWithHttpInfo(); | ||||||
|  |     if (response.statusCode >= HttpStatus.badRequest) { | ||||||
|  |       throw ApiException(response.statusCode, await _decodeBodyBytes(response)); | ||||||
|  |     } | ||||||
|  |     // When a remote server returns no body with a status of 204, we shall not decode it. | ||||||
|  |     // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" | ||||||
|  |     // FormatException when trying to decode an empty string. | ||||||
|  |     if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { | ||||||
|  |       return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ServerStatsResponseDto',) as ServerStatsResponseDto; | ||||||
|  |      | ||||||
|  |     } | ||||||
|  |     return null; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /// This property was deprecated in v1.107.0 | ||||||
|  |   /// | ||||||
|  |   /// Note: This method returns the HTTP [Response]. | ||||||
|  |   Future<Response> getServerVersionWithHttpInfo() async { | ||||||
|  |     // ignore: prefer_const_declarations | ||||||
|  |     final path = r'/server-info/version'; | ||||||
|  | 
 | ||||||
|  |     // ignore: prefer_final_locals | ||||||
|  |     Object? postBody; | ||||||
|  | 
 | ||||||
|  |     final queryParams = <QueryParam>[]; | ||||||
|  |     final headerParams = <String, String>{}; | ||||||
|  |     final formParams = <String, String>{}; | ||||||
|  | 
 | ||||||
|  |     const contentTypes = <String>[]; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     return apiClient.invokeAPI( | ||||||
|  |       path, | ||||||
|  |       'GET', | ||||||
|  |       queryParams, | ||||||
|  |       postBody, | ||||||
|  |       headerParams, | ||||||
|  |       formParams, | ||||||
|  |       contentTypes.isEmpty ? null : contentTypes.first, | ||||||
|  |     ); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /// This property was deprecated in v1.107.0 | ||||||
|  |   Future<ServerVersionResponseDto?> getServerVersion() async { | ||||||
|  |     final response = await getServerVersionWithHttpInfo(); | ||||||
|  |     if (response.statusCode >= HttpStatus.badRequest) { | ||||||
|  |       throw ApiException(response.statusCode, await _decodeBodyBytes(response)); | ||||||
|  |     } | ||||||
|  |     // When a remote server returns no body with a status of 204, we shall not decode it. | ||||||
|  |     // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" | ||||||
|  |     // FormatException when trying to decode an empty string. | ||||||
|  |     if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { | ||||||
|  |       return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ServerVersionResponseDto',) as ServerVersionResponseDto; | ||||||
|  |      | ||||||
|  |     } | ||||||
|  |     return null; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /// This property was deprecated in v1.107.0 | ||||||
|  |   /// | ||||||
|  |   /// Note: This method returns the HTTP [Response]. | ||||||
|  |   Future<Response> getStorageWithHttpInfo() async { | ||||||
|  |     // ignore: prefer_const_declarations | ||||||
|  |     final path = r'/server-info/storage'; | ||||||
|  | 
 | ||||||
|  |     // ignore: prefer_final_locals | ||||||
|  |     Object? postBody; | ||||||
|  | 
 | ||||||
|  |     final queryParams = <QueryParam>[]; | ||||||
|  |     final headerParams = <String, String>{}; | ||||||
|  |     final formParams = <String, String>{}; | ||||||
|  | 
 | ||||||
|  |     const contentTypes = <String>[]; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     return apiClient.invokeAPI( | ||||||
|  |       path, | ||||||
|  |       'GET', | ||||||
|  |       queryParams, | ||||||
|  |       postBody, | ||||||
|  |       headerParams, | ||||||
|  |       formParams, | ||||||
|  |       contentTypes.isEmpty ? null : contentTypes.first, | ||||||
|  |     ); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /// This property was deprecated in v1.107.0 | ||||||
|  |   Future<ServerStorageResponseDto?> getStorage() async { | ||||||
|  |     final response = await getStorageWithHttpInfo(); | ||||||
|  |     if (response.statusCode >= HttpStatus.badRequest) { | ||||||
|  |       throw ApiException(response.statusCode, await _decodeBodyBytes(response)); | ||||||
|  |     } | ||||||
|  |     // When a remote server returns no body with a status of 204, we shall not decode it. | ||||||
|  |     // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" | ||||||
|  |     // FormatException when trying to decode an empty string. | ||||||
|  |     if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { | ||||||
|  |       return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ServerStorageResponseDto',) as ServerStorageResponseDto; | ||||||
|  |      | ||||||
|  |     } | ||||||
|  |     return null; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /// This property was deprecated in v1.107.0 | ||||||
|  |   /// | ||||||
|  |   /// Note: This method returns the HTTP [Response]. | ||||||
|  |   Future<Response> getSupportedMediaTypesWithHttpInfo() async { | ||||||
|  |     // ignore: prefer_const_declarations | ||||||
|  |     final path = r'/server-info/media-types'; | ||||||
|  | 
 | ||||||
|  |     // ignore: prefer_final_locals | ||||||
|  |     Object? postBody; | ||||||
|  | 
 | ||||||
|  |     final queryParams = <QueryParam>[]; | ||||||
|  |     final headerParams = <String, String>{}; | ||||||
|  |     final formParams = <String, String>{}; | ||||||
|  | 
 | ||||||
|  |     const contentTypes = <String>[]; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     return apiClient.invokeAPI( | ||||||
|  |       path, | ||||||
|  |       'GET', | ||||||
|  |       queryParams, | ||||||
|  |       postBody, | ||||||
|  |       headerParams, | ||||||
|  |       formParams, | ||||||
|  |       contentTypes.isEmpty ? null : contentTypes.first, | ||||||
|  |     ); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /// This property was deprecated in v1.107.0 | ||||||
|  |   Future<ServerMediaTypesResponseDto?> getSupportedMediaTypes() async { | ||||||
|  |     final response = await getSupportedMediaTypesWithHttpInfo(); | ||||||
|  |     if (response.statusCode >= HttpStatus.badRequest) { | ||||||
|  |       throw ApiException(response.statusCode, await _decodeBodyBytes(response)); | ||||||
|  |     } | ||||||
|  |     // When a remote server returns no body with a status of 204, we shall not decode it. | ||||||
|  |     // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" | ||||||
|  |     // FormatException when trying to decode an empty string. | ||||||
|  |     if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { | ||||||
|  |       return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ServerMediaTypesResponseDto',) as ServerMediaTypesResponseDto; | ||||||
|  |      | ||||||
|  |     } | ||||||
|  |     return null; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /// This property was deprecated in v1.107.0 | ||||||
|  |   /// | ||||||
|  |   /// Note: This method returns the HTTP [Response]. | ||||||
|  |   Future<Response> getThemeWithHttpInfo() async { | ||||||
|  |     // ignore: prefer_const_declarations | ||||||
|  |     final path = r'/server-info/theme'; | ||||||
|  | 
 | ||||||
|  |     // ignore: prefer_final_locals | ||||||
|  |     Object? postBody; | ||||||
|  | 
 | ||||||
|  |     final queryParams = <QueryParam>[]; | ||||||
|  |     final headerParams = <String, String>{}; | ||||||
|  |     final formParams = <String, String>{}; | ||||||
|  | 
 | ||||||
|  |     const contentTypes = <String>[]; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     return apiClient.invokeAPI( | ||||||
|  |       path, | ||||||
|  |       'GET', | ||||||
|  |       queryParams, | ||||||
|  |       postBody, | ||||||
|  |       headerParams, | ||||||
|  |       formParams, | ||||||
|  |       contentTypes.isEmpty ? null : contentTypes.first, | ||||||
|  |     ); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /// This property was deprecated in v1.107.0 | ||||||
|  |   Future<ServerThemeDto?> getTheme() async { | ||||||
|  |     final response = await getThemeWithHttpInfo(); | ||||||
|  |     if (response.statusCode >= HttpStatus.badRequest) { | ||||||
|  |       throw ApiException(response.statusCode, await _decodeBodyBytes(response)); | ||||||
|  |     } | ||||||
|  |     // When a remote server returns no body with a status of 204, we shall not decode it. | ||||||
|  |     // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" | ||||||
|  |     // FormatException when trying to decode an empty string. | ||||||
|  |     if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { | ||||||
|  |       return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ServerThemeDto',) as ServerThemeDto; | ||||||
|  |      | ||||||
|  |     } | ||||||
|  |     return null; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /// This property was deprecated in v1.107.0 | ||||||
|  |   /// | ||||||
|  |   /// Note: This method returns the HTTP [Response]. | ||||||
|  |   Future<Response> pingServerWithHttpInfo() async { | ||||||
|  |     // ignore: prefer_const_declarations | ||||||
|  |     final path = r'/server-info/ping'; | ||||||
|  | 
 | ||||||
|  |     // ignore: prefer_final_locals | ||||||
|  |     Object? postBody; | ||||||
|  | 
 | ||||||
|  |     final queryParams = <QueryParam>[]; | ||||||
|  |     final headerParams = <String, String>{}; | ||||||
|  |     final formParams = <String, String>{}; | ||||||
|  | 
 | ||||||
|  |     const contentTypes = <String>[]; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     return apiClient.invokeAPI( | ||||||
|  |       path, | ||||||
|  |       'GET', | ||||||
|  |       queryParams, | ||||||
|  |       postBody, | ||||||
|  |       headerParams, | ||||||
|  |       formParams, | ||||||
|  |       contentTypes.isEmpty ? null : contentTypes.first, | ||||||
|  |     ); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /// This property was deprecated in v1.107.0 | ||||||
|  |   Future<ServerPingResponse?> pingServer() async { | ||||||
|  |     final response = await pingServerWithHttpInfo(); | ||||||
|  |     if (response.statusCode >= HttpStatus.badRequest) { | ||||||
|  |       throw ApiException(response.statusCode, await _decodeBodyBytes(response)); | ||||||
|  |     } | ||||||
|  |     // When a remote server returns no body with a status of 204, we shall not decode it. | ||||||
|  |     // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" | ||||||
|  |     // FormatException when trying to decode an empty string. | ||||||
|  |     if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { | ||||||
|  |       return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ServerPingResponse',) as ServerPingResponse; | ||||||
|  |      | ||||||
|  |     } | ||||||
|  |     return null; | ||||||
|  |   } | ||||||
|  | } | ||||||
							
								
								
									
										45
									
								
								mobile/openapi/lib/api/server_info_api.dart
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										45
									
								
								mobile/openapi/lib/api/server_info_api.dart
									
									
									
										generated
									
									
									
								
							| @@ -16,7 +16,9 @@ class ServerInfoApi { | |||||||
| 
 | 
 | ||||||
|   final ApiClient apiClient; |   final ApiClient apiClient; | ||||||
| 
 | 
 | ||||||
|   /// Performs an HTTP 'GET /server-info/about' operation and returns the [Response]. |   /// This property was deprecated in v1.107.0 | ||||||
|  |   /// | ||||||
|  |   /// Note: This method returns the HTTP [Response]. | ||||||
|   Future<Response> getAboutInfoWithHttpInfo() async { |   Future<Response> getAboutInfoWithHttpInfo() async { | ||||||
|     // ignore: prefer_const_declarations |     // ignore: prefer_const_declarations | ||||||
|     final path = r'/server-info/about'; |     final path = r'/server-info/about'; | ||||||
| @@ -42,6 +44,7 @@ class ServerInfoApi { | |||||||
|     ); |     ); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  |   /// This property was deprecated in v1.107.0 | ||||||
|   Future<ServerAboutResponseDto?> getAboutInfo() async { |   Future<ServerAboutResponseDto?> getAboutInfo() async { | ||||||
|     final response = await getAboutInfoWithHttpInfo(); |     final response = await getAboutInfoWithHttpInfo(); | ||||||
|     if (response.statusCode >= HttpStatus.badRequest) { |     if (response.statusCode >= HttpStatus.badRequest) { | ||||||
| @@ -57,7 +60,9 @@ class ServerInfoApi { | |||||||
|     return null; |     return null; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   /// Performs an HTTP 'GET /server-info/config' operation and returns the [Response]. |   /// This property was deprecated in v1.107.0 | ||||||
|  |   /// | ||||||
|  |   /// Note: This method returns the HTTP [Response]. | ||||||
|   Future<Response> getServerConfigWithHttpInfo() async { |   Future<Response> getServerConfigWithHttpInfo() async { | ||||||
|     // ignore: prefer_const_declarations |     // ignore: prefer_const_declarations | ||||||
|     final path = r'/server-info/config'; |     final path = r'/server-info/config'; | ||||||
| @@ -83,6 +88,7 @@ class ServerInfoApi { | |||||||
|     ); |     ); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  |   /// This property was deprecated in v1.107.0 | ||||||
|   Future<ServerConfigDto?> getServerConfig() async { |   Future<ServerConfigDto?> getServerConfig() async { | ||||||
|     final response = await getServerConfigWithHttpInfo(); |     final response = await getServerConfigWithHttpInfo(); | ||||||
|     if (response.statusCode >= HttpStatus.badRequest) { |     if (response.statusCode >= HttpStatus.badRequest) { | ||||||
| @@ -98,7 +104,9 @@ class ServerInfoApi { | |||||||
|     return null; |     return null; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   /// Performs an HTTP 'GET /server-info/features' operation and returns the [Response]. |   /// This property was deprecated in v1.107.0 | ||||||
|  |   /// | ||||||
|  |   /// Note: This method returns the HTTP [Response]. | ||||||
|   Future<Response> getServerFeaturesWithHttpInfo() async { |   Future<Response> getServerFeaturesWithHttpInfo() async { | ||||||
|     // ignore: prefer_const_declarations |     // ignore: prefer_const_declarations | ||||||
|     final path = r'/server-info/features'; |     final path = r'/server-info/features'; | ||||||
| @@ -124,6 +132,7 @@ class ServerInfoApi { | |||||||
|     ); |     ); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  |   /// This property was deprecated in v1.107.0 | ||||||
|   Future<ServerFeaturesDto?> getServerFeatures() async { |   Future<ServerFeaturesDto?> getServerFeatures() async { | ||||||
|     final response = await getServerFeaturesWithHttpInfo(); |     final response = await getServerFeaturesWithHttpInfo(); | ||||||
|     if (response.statusCode >= HttpStatus.badRequest) { |     if (response.statusCode >= HttpStatus.badRequest) { | ||||||
| @@ -139,7 +148,9 @@ class ServerInfoApi { | |||||||
|     return null; |     return null; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   /// Performs an HTTP 'GET /server-info/statistics' operation and returns the [Response]. |   /// This property was deprecated in v1.107.0 | ||||||
|  |   /// | ||||||
|  |   /// Note: This method returns the HTTP [Response]. | ||||||
|   Future<Response> getServerStatisticsWithHttpInfo() async { |   Future<Response> getServerStatisticsWithHttpInfo() async { | ||||||
|     // ignore: prefer_const_declarations |     // ignore: prefer_const_declarations | ||||||
|     final path = r'/server-info/statistics'; |     final path = r'/server-info/statistics'; | ||||||
| @@ -165,6 +176,7 @@ class ServerInfoApi { | |||||||
|     ); |     ); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  |   /// This property was deprecated in v1.107.0 | ||||||
|   Future<ServerStatsResponseDto?> getServerStatistics() async { |   Future<ServerStatsResponseDto?> getServerStatistics() async { | ||||||
|     final response = await getServerStatisticsWithHttpInfo(); |     final response = await getServerStatisticsWithHttpInfo(); | ||||||
|     if (response.statusCode >= HttpStatus.badRequest) { |     if (response.statusCode >= HttpStatus.badRequest) { | ||||||
| @@ -180,7 +192,9 @@ class ServerInfoApi { | |||||||
|     return null; |     return null; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   /// Performs an HTTP 'GET /server-info/version' operation and returns the [Response]. |   /// This property was deprecated in v1.107.0 | ||||||
|  |   /// | ||||||
|  |   /// Note: This method returns the HTTP [Response]. | ||||||
|   Future<Response> getServerVersionWithHttpInfo() async { |   Future<Response> getServerVersionWithHttpInfo() async { | ||||||
|     // ignore: prefer_const_declarations |     // ignore: prefer_const_declarations | ||||||
|     final path = r'/server-info/version'; |     final path = r'/server-info/version'; | ||||||
| @@ -206,6 +220,7 @@ class ServerInfoApi { | |||||||
|     ); |     ); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  |   /// This property was deprecated in v1.107.0 | ||||||
|   Future<ServerVersionResponseDto?> getServerVersion() async { |   Future<ServerVersionResponseDto?> getServerVersion() async { | ||||||
|     final response = await getServerVersionWithHttpInfo(); |     final response = await getServerVersionWithHttpInfo(); | ||||||
|     if (response.statusCode >= HttpStatus.badRequest) { |     if (response.statusCode >= HttpStatus.badRequest) { | ||||||
| @@ -221,7 +236,9 @@ class ServerInfoApi { | |||||||
|     return null; |     return null; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   /// Performs an HTTP 'GET /server-info/storage' operation and returns the [Response]. |   /// This property was deprecated in v1.107.0 | ||||||
|  |   /// | ||||||
|  |   /// Note: This method returns the HTTP [Response]. | ||||||
|   Future<Response> getStorageWithHttpInfo() async { |   Future<Response> getStorageWithHttpInfo() async { | ||||||
|     // ignore: prefer_const_declarations |     // ignore: prefer_const_declarations | ||||||
|     final path = r'/server-info/storage'; |     final path = r'/server-info/storage'; | ||||||
| @@ -247,6 +264,7 @@ class ServerInfoApi { | |||||||
|     ); |     ); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  |   /// This property was deprecated in v1.107.0 | ||||||
|   Future<ServerStorageResponseDto?> getStorage() async { |   Future<ServerStorageResponseDto?> getStorage() async { | ||||||
|     final response = await getStorageWithHttpInfo(); |     final response = await getStorageWithHttpInfo(); | ||||||
|     if (response.statusCode >= HttpStatus.badRequest) { |     if (response.statusCode >= HttpStatus.badRequest) { | ||||||
| @@ -262,7 +280,9 @@ class ServerInfoApi { | |||||||
|     return null; |     return null; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   /// Performs an HTTP 'GET /server-info/media-types' operation and returns the [Response]. |   /// This property was deprecated in v1.107.0 | ||||||
|  |   /// | ||||||
|  |   /// Note: This method returns the HTTP [Response]. | ||||||
|   Future<Response> getSupportedMediaTypesWithHttpInfo() async { |   Future<Response> getSupportedMediaTypesWithHttpInfo() async { | ||||||
|     // ignore: prefer_const_declarations |     // ignore: prefer_const_declarations | ||||||
|     final path = r'/server-info/media-types'; |     final path = r'/server-info/media-types'; | ||||||
| @@ -288,6 +308,7 @@ class ServerInfoApi { | |||||||
|     ); |     ); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  |   /// This property was deprecated in v1.107.0 | ||||||
|   Future<ServerMediaTypesResponseDto?> getSupportedMediaTypes() async { |   Future<ServerMediaTypesResponseDto?> getSupportedMediaTypes() async { | ||||||
|     final response = await getSupportedMediaTypesWithHttpInfo(); |     final response = await getSupportedMediaTypesWithHttpInfo(); | ||||||
|     if (response.statusCode >= HttpStatus.badRequest) { |     if (response.statusCode >= HttpStatus.badRequest) { | ||||||
| @@ -303,7 +324,9 @@ class ServerInfoApi { | |||||||
|     return null; |     return null; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   /// Performs an HTTP 'GET /server-info/theme' operation and returns the [Response]. |   /// This property was deprecated in v1.107.0 | ||||||
|  |   /// | ||||||
|  |   /// Note: This method returns the HTTP [Response]. | ||||||
|   Future<Response> getThemeWithHttpInfo() async { |   Future<Response> getThemeWithHttpInfo() async { | ||||||
|     // ignore: prefer_const_declarations |     // ignore: prefer_const_declarations | ||||||
|     final path = r'/server-info/theme'; |     final path = r'/server-info/theme'; | ||||||
| @@ -329,6 +352,7 @@ class ServerInfoApi { | |||||||
|     ); |     ); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  |   /// This property was deprecated in v1.107.0 | ||||||
|   Future<ServerThemeDto?> getTheme() async { |   Future<ServerThemeDto?> getTheme() async { | ||||||
|     final response = await getThemeWithHttpInfo(); |     final response = await getThemeWithHttpInfo(); | ||||||
|     if (response.statusCode >= HttpStatus.badRequest) { |     if (response.statusCode >= HttpStatus.badRequest) { | ||||||
| @@ -344,7 +368,9 @@ class ServerInfoApi { | |||||||
|     return null; |     return null; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   /// Performs an HTTP 'GET /server-info/ping' operation and returns the [Response]. |   /// This property was deprecated in v1.107.0 | ||||||
|  |   /// | ||||||
|  |   /// Note: This method returns the HTTP [Response]. | ||||||
|   Future<Response> pingServerWithHttpInfo() async { |   Future<Response> pingServerWithHttpInfo() async { | ||||||
|     // ignore: prefer_const_declarations |     // ignore: prefer_const_declarations | ||||||
|     final path = r'/server-info/ping'; |     final path = r'/server-info/ping'; | ||||||
| @@ -370,6 +396,7 @@ class ServerInfoApi { | |||||||
|     ); |     ); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  |   /// This property was deprecated in v1.107.0 | ||||||
|   Future<ServerPingResponse?> pingServer() async { |   Future<ServerPingResponse?> pingServer() async { | ||||||
|     final response = await pingServerWithHttpInfo(); |     final response = await pingServerWithHttpInfo(); | ||||||
|     if (response.statusCode >= HttpStatus.badRequest) { |     if (response.statusCode >= HttpStatus.badRequest) { | ||||||
|   | |||||||
| @@ -4720,6 +4720,8 @@ | |||||||
|     }, |     }, | ||||||
|     "/server-info/about": { |     "/server-info/about": { | ||||||
|       "get": { |       "get": { | ||||||
|  |         "deprecated": true, | ||||||
|  |         "description": "This property was deprecated in v1.107.0", | ||||||
|         "operationId": "getAboutInfo", |         "operationId": "getAboutInfo", | ||||||
|         "parameters": [], |         "parameters": [], | ||||||
|         "responses": { |         "responses": { | ||||||
| @@ -4746,12 +4748,18 @@ | |||||||
|           } |           } | ||||||
|         ], |         ], | ||||||
|         "tags": [ |         "tags": [ | ||||||
|           "Server Info" |           "Server Info", | ||||||
|         ] |           "Deprecated" | ||||||
|  |         ], | ||||||
|  |         "x-immich-lifecycle": { | ||||||
|  |           "deprecatedAt": "v1.107.0" | ||||||
|  |         } | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "/server-info/config": { |     "/server-info/config": { | ||||||
|       "get": { |       "get": { | ||||||
|  |         "deprecated": true, | ||||||
|  |         "description": "This property was deprecated in v1.107.0", | ||||||
|         "operationId": "getServerConfig", |         "operationId": "getServerConfig", | ||||||
|         "parameters": [], |         "parameters": [], | ||||||
|         "responses": { |         "responses": { | ||||||
| @@ -4767,12 +4775,18 @@ | |||||||
|           } |           } | ||||||
|         }, |         }, | ||||||
|         "tags": [ |         "tags": [ | ||||||
|           "Server Info" |           "Server Info", | ||||||
|         ] |           "Deprecated" | ||||||
|  |         ], | ||||||
|  |         "x-immich-lifecycle": { | ||||||
|  |           "deprecatedAt": "v1.107.0" | ||||||
|  |         } | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "/server-info/features": { |     "/server-info/features": { | ||||||
|       "get": { |       "get": { | ||||||
|  |         "deprecated": true, | ||||||
|  |         "description": "This property was deprecated in v1.107.0", | ||||||
|         "operationId": "getServerFeatures", |         "operationId": "getServerFeatures", | ||||||
|         "parameters": [], |         "parameters": [], | ||||||
|         "responses": { |         "responses": { | ||||||
| @@ -4788,12 +4802,18 @@ | |||||||
|           } |           } | ||||||
|         }, |         }, | ||||||
|         "tags": [ |         "tags": [ | ||||||
|           "Server Info" |           "Server Info", | ||||||
|         ] |           "Deprecated" | ||||||
|  |         ], | ||||||
|  |         "x-immich-lifecycle": { | ||||||
|  |           "deprecatedAt": "v1.107.0" | ||||||
|  |         } | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "/server-info/media-types": { |     "/server-info/media-types": { | ||||||
|       "get": { |       "get": { | ||||||
|  |         "deprecated": true, | ||||||
|  |         "description": "This property was deprecated in v1.107.0", | ||||||
|         "operationId": "getSupportedMediaTypes", |         "operationId": "getSupportedMediaTypes", | ||||||
|         "parameters": [], |         "parameters": [], | ||||||
|         "responses": { |         "responses": { | ||||||
| @@ -4809,12 +4829,18 @@ | |||||||
|           } |           } | ||||||
|         }, |         }, | ||||||
|         "tags": [ |         "tags": [ | ||||||
|           "Server Info" |           "Server Info", | ||||||
|         ] |           "Deprecated" | ||||||
|  |         ], | ||||||
|  |         "x-immich-lifecycle": { | ||||||
|  |           "deprecatedAt": "v1.107.0" | ||||||
|  |         } | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "/server-info/ping": { |     "/server-info/ping": { | ||||||
|       "get": { |       "get": { | ||||||
|  |         "deprecated": true, | ||||||
|  |         "description": "This property was deprecated in v1.107.0", | ||||||
|         "operationId": "pingServer", |         "operationId": "pingServer", | ||||||
|         "parameters": [], |         "parameters": [], | ||||||
|         "responses": { |         "responses": { | ||||||
| @@ -4830,12 +4856,18 @@ | |||||||
|           } |           } | ||||||
|         }, |         }, | ||||||
|         "tags": [ |         "tags": [ | ||||||
|           "Server Info" |           "Server Info", | ||||||
|         ] |           "Deprecated" | ||||||
|  |         ], | ||||||
|  |         "x-immich-lifecycle": { | ||||||
|  |           "deprecatedAt": "v1.107.0" | ||||||
|  |         } | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "/server-info/statistics": { |     "/server-info/statistics": { | ||||||
|       "get": { |       "get": { | ||||||
|  |         "deprecated": true, | ||||||
|  |         "description": "This property was deprecated in v1.107.0", | ||||||
|         "operationId": "getServerStatistics", |         "operationId": "getServerStatistics", | ||||||
|         "parameters": [], |         "parameters": [], | ||||||
|         "responses": { |         "responses": { | ||||||
| @@ -4862,12 +4894,18 @@ | |||||||
|           } |           } | ||||||
|         ], |         ], | ||||||
|         "tags": [ |         "tags": [ | ||||||
|           "Server Info" |           "Server Info", | ||||||
|         ] |           "Deprecated" | ||||||
|  |         ], | ||||||
|  |         "x-immich-lifecycle": { | ||||||
|  |           "deprecatedAt": "v1.107.0" | ||||||
|  |         } | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "/server-info/storage": { |     "/server-info/storage": { | ||||||
|       "get": { |       "get": { | ||||||
|  |         "deprecated": true, | ||||||
|  |         "description": "This property was deprecated in v1.107.0", | ||||||
|         "operationId": "getStorage", |         "operationId": "getStorage", | ||||||
|         "parameters": [], |         "parameters": [], | ||||||
|         "responses": { |         "responses": { | ||||||
| @@ -4894,12 +4932,18 @@ | |||||||
|           } |           } | ||||||
|         ], |         ], | ||||||
|         "tags": [ |         "tags": [ | ||||||
|           "Server Info" |           "Server Info", | ||||||
|         ] |           "Deprecated" | ||||||
|  |         ], | ||||||
|  |         "x-immich-lifecycle": { | ||||||
|  |           "deprecatedAt": "v1.107.0" | ||||||
|  |         } | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "/server-info/theme": { |     "/server-info/theme": { | ||||||
|       "get": { |       "get": { | ||||||
|  |         "deprecated": true, | ||||||
|  |         "description": "This property was deprecated in v1.107.0", | ||||||
|         "operationId": "getTheme", |         "operationId": "getTheme", | ||||||
|         "parameters": [], |         "parameters": [], | ||||||
|         "responses": { |         "responses": { | ||||||
| @@ -4915,12 +4959,18 @@ | |||||||
|           } |           } | ||||||
|         }, |         }, | ||||||
|         "tags": [ |         "tags": [ | ||||||
|           "Server Info" |           "Server Info", | ||||||
|         ] |           "Deprecated" | ||||||
|  |         ], | ||||||
|  |         "x-immich-lifecycle": { | ||||||
|  |           "deprecatedAt": "v1.107.0" | ||||||
|  |         } | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "/server-info/version": { |     "/server-info/version": { | ||||||
|       "get": { |       "get": { | ||||||
|  |         "deprecated": true, | ||||||
|  |         "description": "This property was deprecated in v1.107.0", | ||||||
|         "operationId": "getServerVersion", |         "operationId": "getServerVersion", | ||||||
|         "parameters": [], |         "parameters": [], | ||||||
|         "responses": { |         "responses": { | ||||||
| @@ -4936,8 +4986,12 @@ | |||||||
|           } |           } | ||||||
|         }, |         }, | ||||||
|         "tags": [ |         "tags": [ | ||||||
|           "Server Info" |           "Server Info", | ||||||
|         ] |           "Deprecated" | ||||||
|  |         ], | ||||||
|  |         "x-immich-lifecycle": { | ||||||
|  |           "deprecatedAt": "v1.107.0" | ||||||
|  |         } | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "/sessions": { |     "/sessions": { | ||||||
|   | |||||||
| @@ -2385,6 +2385,9 @@ export function getSearchSuggestions({ country, make, model, state, $type }: { | |||||||
|         ...opts |         ...opts | ||||||
|     })); |     })); | ||||||
| } | } | ||||||
|  | /** | ||||||
|  |  * This property was deprecated in v1.107.0 | ||||||
|  |  */ | ||||||
| export function getAboutInfo(opts?: Oazapfts.RequestOpts) { | export function getAboutInfo(opts?: Oazapfts.RequestOpts) { | ||||||
|     return oazapfts.ok(oazapfts.fetchJson<{ |     return oazapfts.ok(oazapfts.fetchJson<{ | ||||||
|         status: 200; |         status: 200; | ||||||
| @@ -2393,6 +2396,9 @@ export function getAboutInfo(opts?: Oazapfts.RequestOpts) { | |||||||
|         ...opts |         ...opts | ||||||
|     })); |     })); | ||||||
| } | } | ||||||
|  | /** | ||||||
|  |  * This property was deprecated in v1.107.0 | ||||||
|  |  */ | ||||||
| export function getServerConfig(opts?: Oazapfts.RequestOpts) { | export function getServerConfig(opts?: Oazapfts.RequestOpts) { | ||||||
|     return oazapfts.ok(oazapfts.fetchJson<{ |     return oazapfts.ok(oazapfts.fetchJson<{ | ||||||
|         status: 200; |         status: 200; | ||||||
| @@ -2401,6 +2407,9 @@ export function getServerConfig(opts?: Oazapfts.RequestOpts) { | |||||||
|         ...opts |         ...opts | ||||||
|     })); |     })); | ||||||
| } | } | ||||||
|  | /** | ||||||
|  |  * This property was deprecated in v1.107.0 | ||||||
|  |  */ | ||||||
| export function getServerFeatures(opts?: Oazapfts.RequestOpts) { | export function getServerFeatures(opts?: Oazapfts.RequestOpts) { | ||||||
|     return oazapfts.ok(oazapfts.fetchJson<{ |     return oazapfts.ok(oazapfts.fetchJson<{ | ||||||
|         status: 200; |         status: 200; | ||||||
| @@ -2409,6 +2418,9 @@ export function getServerFeatures(opts?: Oazapfts.RequestOpts) { | |||||||
|         ...opts |         ...opts | ||||||
|     })); |     })); | ||||||
| } | } | ||||||
|  | /** | ||||||
|  |  * This property was deprecated in v1.107.0 | ||||||
|  |  */ | ||||||
| export function getSupportedMediaTypes(opts?: Oazapfts.RequestOpts) { | export function getSupportedMediaTypes(opts?: Oazapfts.RequestOpts) { | ||||||
|     return oazapfts.ok(oazapfts.fetchJson<{ |     return oazapfts.ok(oazapfts.fetchJson<{ | ||||||
|         status: 200; |         status: 200; | ||||||
| @@ -2417,6 +2429,9 @@ export function getSupportedMediaTypes(opts?: Oazapfts.RequestOpts) { | |||||||
|         ...opts |         ...opts | ||||||
|     })); |     })); | ||||||
| } | } | ||||||
|  | /** | ||||||
|  |  * This property was deprecated in v1.107.0 | ||||||
|  |  */ | ||||||
| export function pingServer(opts?: Oazapfts.RequestOpts) { | export function pingServer(opts?: Oazapfts.RequestOpts) { | ||||||
|     return oazapfts.ok(oazapfts.fetchJson<{ |     return oazapfts.ok(oazapfts.fetchJson<{ | ||||||
|         status: 200; |         status: 200; | ||||||
| @@ -2425,6 +2440,9 @@ export function pingServer(opts?: Oazapfts.RequestOpts) { | |||||||
|         ...opts |         ...opts | ||||||
|     })); |     })); | ||||||
| } | } | ||||||
|  | /** | ||||||
|  |  * This property was deprecated in v1.107.0 | ||||||
|  |  */ | ||||||
| export function getServerStatistics(opts?: Oazapfts.RequestOpts) { | export function getServerStatistics(opts?: Oazapfts.RequestOpts) { | ||||||
|     return oazapfts.ok(oazapfts.fetchJson<{ |     return oazapfts.ok(oazapfts.fetchJson<{ | ||||||
|         status: 200; |         status: 200; | ||||||
| @@ -2433,6 +2451,9 @@ export function getServerStatistics(opts?: Oazapfts.RequestOpts) { | |||||||
|         ...opts |         ...opts | ||||||
|     })); |     })); | ||||||
| } | } | ||||||
|  | /** | ||||||
|  |  * This property was deprecated in v1.107.0 | ||||||
|  |  */ | ||||||
| export function getStorage(opts?: Oazapfts.RequestOpts) { | export function getStorage(opts?: Oazapfts.RequestOpts) { | ||||||
|     return oazapfts.ok(oazapfts.fetchJson<{ |     return oazapfts.ok(oazapfts.fetchJson<{ | ||||||
|         status: 200; |         status: 200; | ||||||
| @@ -2441,6 +2462,9 @@ export function getStorage(opts?: Oazapfts.RequestOpts) { | |||||||
|         ...opts |         ...opts | ||||||
|     })); |     })); | ||||||
| } | } | ||||||
|  | /** | ||||||
|  |  * This property was deprecated in v1.107.0 | ||||||
|  |  */ | ||||||
| export function getTheme(opts?: Oazapfts.RequestOpts) { | export function getTheme(opts?: Oazapfts.RequestOpts) { | ||||||
|     return oazapfts.ok(oazapfts.fetchJson<{ |     return oazapfts.ok(oazapfts.fetchJson<{ | ||||||
|         status: 200; |         status: 200; | ||||||
| @@ -2449,6 +2473,9 @@ export function getTheme(opts?: Oazapfts.RequestOpts) { | |||||||
|         ...opts |         ...opts | ||||||
|     })); |     })); | ||||||
| } | } | ||||||
|  | /** | ||||||
|  |  * This property was deprecated in v1.107.0 | ||||||
|  |  */ | ||||||
| export function getServerVersion(opts?: Oazapfts.RequestOpts) { | export function getServerVersion(opts?: Oazapfts.RequestOpts) { | ||||||
|     return oazapfts.ok(oazapfts.fetchJson<{ |     return oazapfts.ok(oazapfts.fetchJson<{ | ||||||
|         status: 200; |         status: 200; | ||||||
|   | |||||||
| @@ -20,6 +20,7 @@ import { PartnerController } from 'src/controllers/partner.controller'; | |||||||
| import { PersonController } from 'src/controllers/person.controller'; | import { PersonController } from 'src/controllers/person.controller'; | ||||||
| import { SearchController } from 'src/controllers/search.controller'; | import { SearchController } from 'src/controllers/search.controller'; | ||||||
| import { ServerInfoController } from 'src/controllers/server-info.controller'; | import { ServerInfoController } from 'src/controllers/server-info.controller'; | ||||||
|  | import { ServerController } from 'src/controllers/server.controller'; | ||||||
| import { SessionController } from 'src/controllers/session.controller'; | import { SessionController } from 'src/controllers/session.controller'; | ||||||
| import { SharedLinkController } from 'src/controllers/shared-link.controller'; | import { SharedLinkController } from 'src/controllers/shared-link.controller'; | ||||||
| import { SyncController } from 'src/controllers/sync.controller'; | import { SyncController } from 'src/controllers/sync.controller'; | ||||||
| @@ -53,6 +54,7 @@ export const controllers = [ | |||||||
|   PersonController, |   PersonController, | ||||||
|   ReportController, |   ReportController, | ||||||
|   SearchController, |   SearchController, | ||||||
|  |   ServerController, | ||||||
|   ServerInfoController, |   ServerInfoController, | ||||||
|   SessionController, |   SessionController, | ||||||
|   SharedLinkController, |   SharedLinkController, | ||||||
|   | |||||||
| @@ -1,5 +1,6 @@ | |||||||
| import { Controller, Get } from '@nestjs/common'; | import { Controller, Get } from '@nestjs/common'; | ||||||
| import { ApiTags } from '@nestjs/swagger'; | import { ApiTags } from '@nestjs/swagger'; | ||||||
|  | import { EndpointLifecycle } from 'src/decorators'; | ||||||
| import { | import { | ||||||
|   ServerAboutResponseDto, |   ServerAboutResponseDto, | ||||||
|   ServerConfigDto, |   ServerConfigDto, | ||||||
| @@ -10,63 +11,72 @@ import { | |||||||
|   ServerStorageResponseDto, |   ServerStorageResponseDto, | ||||||
|   ServerThemeDto, |   ServerThemeDto, | ||||||
|   ServerVersionResponseDto, |   ServerVersionResponseDto, | ||||||
| } from 'src/dtos/server-info.dto'; | } from 'src/dtos/server.dto'; | ||||||
| import { Authenticated } from 'src/middleware/auth.guard'; | import { Authenticated } from 'src/middleware/auth.guard'; | ||||||
| import { ServerInfoService } from 'src/services/server-info.service'; | import { ServerService } from 'src/services/server.service'; | ||||||
| import { VersionService } from 'src/services/version.service'; | import { VersionService } from 'src/services/version.service'; | ||||||
|  |  | ||||||
| @ApiTags('Server Info') | @ApiTags('Server Info') | ||||||
| @Controller('server-info') | @Controller('server-info') | ||||||
| export class ServerInfoController { | export class ServerInfoController { | ||||||
|   constructor( |   constructor( | ||||||
|     private service: ServerInfoService, |     private service: ServerService, | ||||||
|     private versionService: VersionService, |     private versionService: VersionService, | ||||||
|   ) {} |   ) {} | ||||||
|  |  | ||||||
|   @Get('about') |   @Get('about') | ||||||
|  |   @EndpointLifecycle({ deprecatedAt: 'v1.107.0' }) | ||||||
|   @Authenticated() |   @Authenticated() | ||||||
|   getAboutInfo(): Promise<ServerAboutResponseDto> { |   getAboutInfo(): Promise<ServerAboutResponseDto> { | ||||||
|     return this.service.getAboutInfo(); |     return this.service.getAboutInfo(); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   @Get('storage') |   @Get('storage') | ||||||
|  |   @EndpointLifecycle({ deprecatedAt: 'v1.107.0' }) | ||||||
|   @Authenticated() |   @Authenticated() | ||||||
|   getStorage(): Promise<ServerStorageResponseDto> { |   getStorage(): Promise<ServerStorageResponseDto> { | ||||||
|     return this.service.getStorage(); |     return this.service.getStorage(); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   @Get('ping') |   @Get('ping') | ||||||
|  |   @EndpointLifecycle({ deprecatedAt: 'v1.107.0' }) | ||||||
|   pingServer(): ServerPingResponse { |   pingServer(): ServerPingResponse { | ||||||
|     return this.service.ping(); |     return this.service.ping(); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   @Get('version') |   @Get('version') | ||||||
|  |   @EndpointLifecycle({ deprecatedAt: 'v1.107.0' }) | ||||||
|   getServerVersion(): ServerVersionResponseDto { |   getServerVersion(): ServerVersionResponseDto { | ||||||
|     return this.versionService.getVersion(); |     return this.versionService.getVersion(); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   @Get('features') |   @Get('features') | ||||||
|  |   @EndpointLifecycle({ deprecatedAt: 'v1.107.0' }) | ||||||
|   getServerFeatures(): Promise<ServerFeaturesDto> { |   getServerFeatures(): Promise<ServerFeaturesDto> { | ||||||
|     return this.service.getFeatures(); |     return this.service.getFeatures(); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   @Get('theme') |   @Get('theme') | ||||||
|  |   @EndpointLifecycle({ deprecatedAt: 'v1.107.0' }) | ||||||
|   getTheme(): Promise<ServerThemeDto> { |   getTheme(): Promise<ServerThemeDto> { | ||||||
|     return this.service.getTheme(); |     return this.service.getTheme(); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   @Get('config') |   @Get('config') | ||||||
|  |   @EndpointLifecycle({ deprecatedAt: 'v1.107.0' }) | ||||||
|   getServerConfig(): Promise<ServerConfigDto> { |   getServerConfig(): Promise<ServerConfigDto> { | ||||||
|     return this.service.getConfig(); |     return this.service.getConfig(); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   @Authenticated({ admin: true }) |   @Authenticated({ admin: true }) | ||||||
|  |   @EndpointLifecycle({ deprecatedAt: 'v1.107.0' }) | ||||||
|   @Get('statistics') |   @Get('statistics') | ||||||
|   getServerStatistics(): Promise<ServerStatsResponseDto> { |   getServerStatistics(): Promise<ServerStatsResponseDto> { | ||||||
|     return this.service.getStatistics(); |     return this.service.getStatistics(); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   @Get('media-types') |   @Get('media-types') | ||||||
|  |   @EndpointLifecycle({ deprecatedAt: 'v1.107.0' }) | ||||||
|   getSupportedMediaTypes(): ServerMediaTypesResponseDto { |   getSupportedMediaTypes(): ServerMediaTypesResponseDto { | ||||||
|     return this.service.getSupportedMediaTypes(); |     return this.service.getSupportedMediaTypes(); | ||||||
|   } |   } | ||||||
|   | |||||||
							
								
								
									
										82
									
								
								server/src/controllers/server.controller.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										82
									
								
								server/src/controllers/server.controller.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,82 @@ | |||||||
|  | import { Controller, Get } from '@nestjs/common'; | ||||||
|  | import { ApiExcludeEndpoint, ApiTags } from '@nestjs/swagger'; | ||||||
|  | import { | ||||||
|  |   ServerAboutResponseDto, | ||||||
|  |   ServerConfigDto, | ||||||
|  |   ServerFeaturesDto, | ||||||
|  |   ServerMediaTypesResponseDto, | ||||||
|  |   ServerPingResponse, | ||||||
|  |   ServerStatsResponseDto, | ||||||
|  |   ServerStorageResponseDto, | ||||||
|  |   ServerThemeDto, | ||||||
|  |   ServerVersionResponseDto, | ||||||
|  | } from 'src/dtos/server.dto'; | ||||||
|  | import { Authenticated } from 'src/middleware/auth.guard'; | ||||||
|  | import { ServerService } from 'src/services/server.service'; | ||||||
|  | import { VersionService } from 'src/services/version.service'; | ||||||
|  |  | ||||||
|  | @ApiTags('Server') | ||||||
|  | @Controller('server') | ||||||
|  | export class ServerController { | ||||||
|  |   constructor( | ||||||
|  |     private service: ServerService, | ||||||
|  |     private versionService: VersionService, | ||||||
|  |   ) {} | ||||||
|  |  | ||||||
|  |   @Get('about') | ||||||
|  |   @Authenticated() | ||||||
|  |   @ApiExcludeEndpoint() | ||||||
|  |   getAboutInfo(): Promise<ServerAboutResponseDto> { | ||||||
|  |     return this.service.getAboutInfo(); | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   @Get('storage') | ||||||
|  |   @Authenticated() | ||||||
|  |   @ApiExcludeEndpoint() | ||||||
|  |   getStorage(): Promise<ServerStorageResponseDto> { | ||||||
|  |     return this.service.getStorage(); | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   @Get('ping') | ||||||
|  |   @ApiExcludeEndpoint() | ||||||
|  |   pingServer(): ServerPingResponse { | ||||||
|  |     return this.service.ping(); | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   @Get('version') | ||||||
|  |   @ApiExcludeEndpoint() | ||||||
|  |   getServerVersion(): ServerVersionResponseDto { | ||||||
|  |     return this.versionService.getVersion(); | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   @Get('features') | ||||||
|  |   @ApiExcludeEndpoint() | ||||||
|  |   getServerFeatures(): Promise<ServerFeaturesDto> { | ||||||
|  |     return this.service.getFeatures(); | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   @Get('theme') | ||||||
|  |   @ApiExcludeEndpoint() | ||||||
|  |   getTheme(): Promise<ServerThemeDto> { | ||||||
|  |     return this.service.getTheme(); | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   @Get('config') | ||||||
|  |   @ApiExcludeEndpoint() | ||||||
|  |   getServerConfig(): Promise<ServerConfigDto> { | ||||||
|  |     return this.service.getConfig(); | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   @Authenticated({ admin: true }) | ||||||
|  |   @Get('statistics') | ||||||
|  |   @ApiExcludeEndpoint() | ||||||
|  |   getServerStatistics(): Promise<ServerStatsResponseDto> { | ||||||
|  |     return this.service.getStatistics(); | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   @Get('media-types') | ||||||
|  |   @ApiExcludeEndpoint() | ||||||
|  |   getSupportedMediaTypes(): ServerMediaTypesResponseDto { | ||||||
|  |     return this.service.getSupportedMediaTypes(); | ||||||
|  |   } | ||||||
|  | } | ||||||
| @@ -1,6 +1,6 @@ | |||||||
| import { SystemConfig } from 'src/config'; | import { SystemConfig } from 'src/config'; | ||||||
| import { AssetResponseDto } from 'src/dtos/asset-response.dto'; | import { AssetResponseDto } from 'src/dtos/asset-response.dto'; | ||||||
| import { ReleaseNotification, ServerVersionResponseDto } from 'src/dtos/server-info.dto'; | import { ReleaseNotification, ServerVersionResponseDto } from 'src/dtos/server.dto'; | ||||||
|  |  | ||||||
| export const IEventRepository = 'IEventRepository'; | export const IEventRepository = 'IEventRepository'; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -21,7 +21,7 @@ import { NotificationService } from 'src/services/notification.service'; | |||||||
| import { PartnerService } from 'src/services/partner.service'; | import { PartnerService } from 'src/services/partner.service'; | ||||||
| import { PersonService } from 'src/services/person.service'; | import { PersonService } from 'src/services/person.service'; | ||||||
| import { SearchService } from 'src/services/search.service'; | import { SearchService } from 'src/services/search.service'; | ||||||
| import { ServerInfoService } from 'src/services/server-info.service'; | import { ServerService } from 'src/services/server.service'; | ||||||
| import { SessionService } from 'src/services/session.service'; | import { SessionService } from 'src/services/session.service'; | ||||||
| import { SharedLinkService } from 'src/services/shared-link.service'; | import { SharedLinkService } from 'src/services/shared-link.service'; | ||||||
| import { SmartInfoService } from 'src/services/smart-info.service'; | import { SmartInfoService } from 'src/services/smart-info.service'; | ||||||
| @@ -61,7 +61,7 @@ export const services = [ | |||||||
|   PartnerService, |   PartnerService, | ||||||
|   PersonService, |   PersonService, | ||||||
|   SearchService, |   SearchService, | ||||||
|   ServerInfoService, |   ServerService, | ||||||
|   SessionService, |   SessionService, | ||||||
|   SharedLinkService, |   SharedLinkService, | ||||||
|   SmartInfoService, |   SmartInfoService, | ||||||
|   | |||||||
| @@ -3,7 +3,7 @@ import { IServerInfoRepository } from 'src/interfaces/server-info.interface'; | |||||||
| import { IStorageRepository } from 'src/interfaces/storage.interface'; | import { IStorageRepository } from 'src/interfaces/storage.interface'; | ||||||
| import { ISystemMetadataRepository } from 'src/interfaces/system-metadata.interface'; | import { ISystemMetadataRepository } from 'src/interfaces/system-metadata.interface'; | ||||||
| import { IUserRepository } from 'src/interfaces/user.interface'; | import { IUserRepository } from 'src/interfaces/user.interface'; | ||||||
| import { ServerInfoService } from 'src/services/server-info.service'; | import { ServerService } from 'src/services/server.service'; | ||||||
| import { newLoggerRepositoryMock } from 'test/repositories/logger.repository.mock'; | import { newLoggerRepositoryMock } from 'test/repositories/logger.repository.mock'; | ||||||
| import { newServerInfoRepositoryMock } from 'test/repositories/server-info.repository.mock'; | import { newServerInfoRepositoryMock } from 'test/repositories/server-info.repository.mock'; | ||||||
| import { newStorageRepositoryMock } from 'test/repositories/storage.repository.mock'; | import { newStorageRepositoryMock } from 'test/repositories/storage.repository.mock'; | ||||||
| @@ -11,8 +11,8 @@ import { newSystemMetadataRepositoryMock } from 'test/repositories/system-metada | |||||||
| import { newUserRepositoryMock } from 'test/repositories/user.repository.mock'; | import { newUserRepositoryMock } from 'test/repositories/user.repository.mock'; | ||||||
| import { Mocked } from 'vitest'; | import { Mocked } from 'vitest'; | ||||||
| 
 | 
 | ||||||
| describe(ServerInfoService.name, () => { | describe(ServerService.name, () => { | ||||||
|   let sut: ServerInfoService; |   let sut: ServerService; | ||||||
|   let storageMock: Mocked<IStorageRepository>; |   let storageMock: Mocked<IStorageRepository>; | ||||||
|   let userMock: Mocked<IUserRepository>; |   let userMock: Mocked<IUserRepository>; | ||||||
|   let serverInfoMock: Mocked<IServerInfoRepository>; |   let serverInfoMock: Mocked<IServerInfoRepository>; | ||||||
| @@ -26,7 +26,7 @@ describe(ServerInfoService.name, () => { | |||||||
|     systemMock = newSystemMetadataRepositoryMock(); |     systemMock = newSystemMetadataRepositoryMock(); | ||||||
|     loggerMock = newLoggerRepositoryMock(); |     loggerMock = newLoggerRepositoryMock(); | ||||||
| 
 | 
 | ||||||
|     sut = new ServerInfoService(userMock, storageMock, systemMock, serverInfoMock, loggerMock); |     sut = new ServerService(userMock, storageMock, systemMock, serverInfoMock, loggerMock); | ||||||
|   }); |   }); | ||||||
| 
 | 
 | ||||||
|   it('should work', () => { |   it('should work', () => { | ||||||
| @@ -12,7 +12,7 @@ import { | |||||||
|   ServerStatsResponseDto, |   ServerStatsResponseDto, | ||||||
|   ServerStorageResponseDto, |   ServerStorageResponseDto, | ||||||
|   UsageByUserDto, |   UsageByUserDto, | ||||||
| } from 'src/dtos/server-info.dto'; | } from 'src/dtos/server.dto'; | ||||||
| import { SystemMetadataKey } from 'src/entities/system-metadata.entity'; | import { SystemMetadataKey } from 'src/entities/system-metadata.entity'; | ||||||
| import { OnEvents } from 'src/interfaces/event.interface'; | import { OnEvents } from 'src/interfaces/event.interface'; | ||||||
| import { ILoggerRepository } from 'src/interfaces/logger.interface'; | import { ILoggerRepository } from 'src/interfaces/logger.interface'; | ||||||
| @@ -25,7 +25,7 @@ import { mimeTypes } from 'src/utils/mime-types'; | |||||||
| import { isDuplicateDetectionEnabled, isFacialRecognitionEnabled, isSmartSearchEnabled } from 'src/utils/misc'; | import { isDuplicateDetectionEnabled, isFacialRecognitionEnabled, isSmartSearchEnabled } from 'src/utils/misc'; | ||||||
| 
 | 
 | ||||||
| @Injectable() | @Injectable() | ||||||
| export class ServerInfoService implements OnEvents { | export class ServerService implements OnEvents { | ||||||
|   private configCore: SystemConfigCore; |   private configCore: SystemConfigCore; | ||||||
| 
 | 
 | ||||||
|   constructor( |   constructor( | ||||||
| @@ -35,7 +35,7 @@ export class ServerInfoService implements OnEvents { | |||||||
|     @Inject(IServerInfoRepository) private serverInfoRepository: IServerInfoRepository, |     @Inject(IServerInfoRepository) private serverInfoRepository: IServerInfoRepository, | ||||||
|     @Inject(ILoggerRepository) private logger: ILoggerRepository, |     @Inject(ILoggerRepository) private logger: ILoggerRepository, | ||||||
|   ) { |   ) { | ||||||
|     this.logger.setContext(ServerInfoService.name); |     this.logger.setContext(ServerService.name); | ||||||
|     this.configCore = SystemConfigCore.create(systemMetadataRepository, this.logger); |     this.configCore = SystemConfigCore.create(systemMetadataRepository, this.logger); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
| @@ -4,7 +4,7 @@ import semver, { SemVer } from 'semver'; | |||||||
| import { isDev, serverVersion } from 'src/constants'; | import { isDev, serverVersion } from 'src/constants'; | ||||||
| import { SystemConfigCore } from 'src/cores/system-config.core'; | import { SystemConfigCore } from 'src/cores/system-config.core'; | ||||||
| import { OnServerEvent } from 'src/decorators'; | import { OnServerEvent } from 'src/decorators'; | ||||||
| import { ReleaseNotification, ServerVersionResponseDto } from 'src/dtos/server-info.dto'; | import { ReleaseNotification, ServerVersionResponseDto } from 'src/dtos/server.dto'; | ||||||
| import { SystemMetadataKey, VersionCheckMetadata } from 'src/entities/system-metadata.entity'; | import { SystemMetadataKey, VersionCheckMetadata } from 'src/entities/system-metadata.entity'; | ||||||
| import { ClientEvent, IEventRepository, OnEvents, ServerEvent, ServerEventMap } from 'src/interfaces/event.interface'; | import { ClientEvent, IEventRepository, OnEvents, ServerEvent, ServerEventMap } from 'src/interfaces/event.interface'; | ||||||
| import { IJobRepository, JobName, JobStatus } from 'src/interfaces/job.interface'; | import { IJobRepository, JobName, JobStatus } from 'src/interfaces/job.interface'; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user