From c254a04aec87784df2d76bc6ec54aaa5f2291328 Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 15 Jul 2023 20:24:46 -0500 Subject: [PATCH] feat(server): add endpoint to get supported media types on the server (#3284) * feat(server): add endpoint to get supported media types on the server * api generation * remove xmp format * change dto * openapi * dev --- cli/src/api/open-api/api.ts | 81 ++++++++++++ mobile/openapi/.openapi-generator/FILES | 3 + mobile/openapi/README.md | 2 + mobile/openapi/doc/ServerInfoApi.md | 38 ++++++ .../doc/ServerMediaTypesResponseDto.md | 17 +++ mobile/openapi/lib/api.dart | 1 + mobile/openapi/lib/api/server_info_api.dart | 41 ++++++ mobile/openapi/lib/api_client.dart | 2 + .../server_media_types_response_dto.dart | 120 ++++++++++++++++++ mobile/openapi/test/server_info_api_test.dart | 5 + .../server_media_types_response_dto_test.dart | 37 ++++++ server/immich-openapi-specs.json | 49 +++++++ .../response-dto/server-stats-response.dto.ts | 6 + .../domain/server-info/server-info.service.ts | 18 ++- .../controllers/server-info.controller.ts | 7 + web/src/api/open-api/api.ts | 81 ++++++++++++ 16 files changed, 506 insertions(+), 2 deletions(-) create mode 100644 mobile/openapi/doc/ServerMediaTypesResponseDto.md create mode 100644 mobile/openapi/lib/model/server_media_types_response_dto.dart create mode 100644 mobile/openapi/test/server_media_types_response_dto_test.dart diff --git a/cli/src/api/open-api/api.ts b/cli/src/api/open-api/api.ts index b0bf9a8f2f..f6a1127a58 100644 --- a/cli/src/api/open-api/api.ts +++ b/cli/src/api/open-api/api.ts @@ -2085,6 +2085,31 @@ export interface ServerInfoResponseDto { */ 'diskAvailable': string; } +/** + * + * @export + * @interface ServerMediaTypesResponseDto + */ +export interface ServerMediaTypesResponseDto { + /** + * + * @type {Array} + * @memberof ServerMediaTypesResponseDto + */ + 'video': Array; + /** + * + * @type {Array} + * @memberof ServerMediaTypesResponseDto + */ + 'image': Array; + /** + * + * @type {Array} + * @memberof ServerMediaTypesResponseDto + */ + 'sidecar': Array; +} /** * * @export @@ -9711,6 +9736,35 @@ export const ServerInfoApiAxiosParamCreator = function (configuration?: Configur + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getSupportedMediaTypes: async (options: AxiosRequestConfig = {}): Promise => { + const localVarPath = `/server-info/media-types`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; @@ -9786,6 +9840,15 @@ export const ServerInfoApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getStats(options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getSupportedMediaTypes(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getSupportedMediaTypes(options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, /** * * @param {*} [options] Override http request option. @@ -9829,6 +9892,14 @@ export const ServerInfoApiFactory = function (configuration?: Configuration, bas getStats(options?: AxiosRequestConfig): AxiosPromise { return localVarFp.getStats(options).then((request) => request(axios, basePath)); }, + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getSupportedMediaTypes(options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.getSupportedMediaTypes(options).then((request) => request(axios, basePath)); + }, /** * * @param {*} [options] Override http request option. @@ -9877,6 +9948,16 @@ export class ServerInfoApi extends BaseAPI { return ServerInfoApiFp(this.configuration).getStats(options).then((request) => request(this.axios, this.basePath)); } + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ServerInfoApi + */ + public getSupportedMediaTypes(options?: AxiosRequestConfig) { + return ServerInfoApiFp(this.configuration).getSupportedMediaTypes(options).then((request) => request(this.axios, this.basePath)); + } + /** * * @param {*} [options] Override http request option. diff --git a/mobile/openapi/.openapi-generator/FILES b/mobile/openapi/.openapi-generator/FILES index f098bf4ffe..5c610108b5 100644 --- a/mobile/openapi/.openapi-generator/FILES +++ b/mobile/openapi/.openapi-generator/FILES @@ -88,6 +88,7 @@ doc/SearchFacetResponseDto.md doc/SearchResponseDto.md doc/ServerInfoApi.md doc/ServerInfoResponseDto.md +doc/ServerMediaTypesResponseDto.md doc/ServerPingResponse.md doc/ServerStatsResponseDto.md doc/ServerVersionReponseDto.md @@ -221,6 +222,7 @@ lib/model/search_facet_count_response_dto.dart lib/model/search_facet_response_dto.dart lib/model/search_response_dto.dart lib/model/server_info_response_dto.dart +lib/model/server_media_types_response_dto.dart lib/model/server_ping_response.dart lib/model/server_stats_response_dto.dart lib/model/server_version_reponse_dto.dart @@ -337,6 +339,7 @@ test/search_facet_response_dto_test.dart test/search_response_dto_test.dart test/server_info_api_test.dart test/server_info_response_dto_test.dart +test/server_media_types_response_dto_test.dart test/server_ping_response_test.dart test/server_stats_response_dto_test.dart test/server_version_reponse_dto_test.dart diff --git a/mobile/openapi/README.md b/mobile/openapi/README.md index 3d9dc92110..b8fa7a4d24 100644 --- a/mobile/openapi/README.md +++ b/mobile/openapi/README.md @@ -141,6 +141,7 @@ Class | Method | HTTP request | Description *ServerInfoApi* | [**getServerInfo**](doc//ServerInfoApi.md#getserverinfo) | **GET** /server-info | *ServerInfoApi* | [**getServerVersion**](doc//ServerInfoApi.md#getserverversion) | **GET** /server-info/version | *ServerInfoApi* | [**getStats**](doc//ServerInfoApi.md#getstats) | **GET** /server-info/stats | +*ServerInfoApi* | [**getSupportedMediaTypes**](doc//ServerInfoApi.md#getsupportedmediatypes) | **GET** /server-info/media-types | *ServerInfoApi* | [**pingServer**](doc//ServerInfoApi.md#pingserver) | **GET** /server-info/ping | *SharedLinkApi* | [**addSharedLinkAssets**](doc//SharedLinkApi.md#addsharedlinkassets) | **PUT** /shared-link/{id}/assets | *SharedLinkApi* | [**createSharedLink**](doc//SharedLinkApi.md#createsharedlink) | **POST** /shared-link | @@ -251,6 +252,7 @@ Class | Method | HTTP request | Description - [SearchFacetResponseDto](doc//SearchFacetResponseDto.md) - [SearchResponseDto](doc//SearchResponseDto.md) - [ServerInfoResponseDto](doc//ServerInfoResponseDto.md) + - [ServerMediaTypesResponseDto](doc//ServerMediaTypesResponseDto.md) - [ServerPingResponse](doc//ServerPingResponse.md) - [ServerStatsResponseDto](doc//ServerStatsResponseDto.md) - [ServerVersionReponseDto](doc//ServerVersionReponseDto.md) diff --git a/mobile/openapi/doc/ServerInfoApi.md b/mobile/openapi/doc/ServerInfoApi.md index 3b39ef93ee..0666c7d414 100644 --- a/mobile/openapi/doc/ServerInfoApi.md +++ b/mobile/openapi/doc/ServerInfoApi.md @@ -12,6 +12,7 @@ Method | HTTP request | Description [**getServerInfo**](ServerInfoApi.md#getserverinfo) | **GET** /server-info | [**getServerVersion**](ServerInfoApi.md#getserverversion) | **GET** /server-info/version | [**getStats**](ServerInfoApi.md#getstats) | **GET** /server-info/stats | +[**getSupportedMediaTypes**](ServerInfoApi.md#getsupportedmediatypes) | **GET** /server-info/media-types | [**pingServer**](ServerInfoApi.md#pingserver) | **GET** /server-info/ping | @@ -154,6 +155,43 @@ This endpoint does not need any parameter. [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **getSupportedMediaTypes** +> ServerMediaTypesResponseDto getSupportedMediaTypes() + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api_instance = ServerInfoApi(); + +try { + final result = api_instance.getSupportedMediaTypes(); + print(result); +} catch (e) { + print('Exception when calling ServerInfoApi->getSupportedMediaTypes: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**ServerMediaTypesResponseDto**](ServerMediaTypesResponseDto.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **pingServer** > ServerPingResponse pingServer() diff --git a/mobile/openapi/doc/ServerMediaTypesResponseDto.md b/mobile/openapi/doc/ServerMediaTypesResponseDto.md new file mode 100644 index 0000000000..78253e27f7 --- /dev/null +++ b/mobile/openapi/doc/ServerMediaTypesResponseDto.md @@ -0,0 +1,17 @@ +# openapi.model.ServerMediaTypesResponseDto + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**video** | **List** | | [default to const []] +**image** | **List** | | [default to const []] +**sidecar** | **List** | | [default to const []] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/mobile/openapi/lib/api.dart b/mobile/openapi/lib/api.dart index ef9544c856..32420b9c29 100644 --- a/mobile/openapi/lib/api.dart +++ b/mobile/openapi/lib/api.dart @@ -118,6 +118,7 @@ part 'model/search_facet_count_response_dto.dart'; part 'model/search_facet_response_dto.dart'; part 'model/search_response_dto.dart'; part 'model/server_info_response_dto.dart'; +part 'model/server_media_types_response_dto.dart'; part 'model/server_ping_response.dart'; part 'model/server_stats_response_dto.dart'; part 'model/server_version_reponse_dto.dart'; diff --git a/mobile/openapi/lib/api/server_info_api.dart b/mobile/openapi/lib/api/server_info_api.dart index 8cc3460c9b..fb34e09ce8 100644 --- a/mobile/openapi/lib/api/server_info_api.dart +++ b/mobile/openapi/lib/api/server_info_api.dart @@ -139,6 +139,47 @@ class ServerInfoApi { return null; } + /// Performs an HTTP 'GET /server-info/media-types' operation and returns the [Response]. + Future getSupportedMediaTypesWithHttpInfo() async { + // ignore: prefer_const_declarations + final path = r'/server-info/media-types'; + + // ignore: prefer_final_locals + Object? postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + const contentTypes = []; + + + return apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + Future 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; + } + /// Performs an HTTP 'GET /server-info/ping' operation and returns the [Response]. Future pingServerWithHttpInfo() async { // ignore: prefer_const_declarations diff --git a/mobile/openapi/lib/api_client.dart b/mobile/openapi/lib/api_client.dart index 824d4c9eb4..b2208df562 100644 --- a/mobile/openapi/lib/api_client.dart +++ b/mobile/openapi/lib/api_client.dart @@ -331,6 +331,8 @@ class ApiClient { return SearchResponseDto.fromJson(value); case 'ServerInfoResponseDto': return ServerInfoResponseDto.fromJson(value); + case 'ServerMediaTypesResponseDto': + return ServerMediaTypesResponseDto.fromJson(value); case 'ServerPingResponse': return ServerPingResponse.fromJson(value); case 'ServerStatsResponseDto': diff --git a/mobile/openapi/lib/model/server_media_types_response_dto.dart b/mobile/openapi/lib/model/server_media_types_response_dto.dart new file mode 100644 index 0000000000..2cba41363d --- /dev/null +++ b/mobile/openapi/lib/model/server_media_types_response_dto.dart @@ -0,0 +1,120 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// 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 ServerMediaTypesResponseDto { + /// Returns a new [ServerMediaTypesResponseDto] instance. + ServerMediaTypesResponseDto({ + this.video = const [], + this.image = const [], + this.sidecar = const [], + }); + + List video; + + List image; + + List sidecar; + + @override + bool operator ==(Object other) => identical(this, other) || other is ServerMediaTypesResponseDto && + other.video == video && + other.image == image && + other.sidecar == sidecar; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (video.hashCode) + + (image.hashCode) + + (sidecar.hashCode); + + @override + String toString() => 'ServerMediaTypesResponseDto[video=$video, image=$image, sidecar=$sidecar]'; + + Map toJson() { + final json = {}; + json[r'video'] = this.video; + json[r'image'] = this.image; + json[r'sidecar'] = this.sidecar; + return json; + } + + /// Returns a new [ServerMediaTypesResponseDto] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static ServerMediaTypesResponseDto? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + return ServerMediaTypesResponseDto( + video: json[r'video'] is Iterable + ? (json[r'video'] as Iterable).cast().toList(growable: false) + : const [], + image: json[r'image'] is Iterable + ? (json[r'image'] as Iterable).cast().toList(growable: false) + : const [], + sidecar: json[r'sidecar'] is Iterable + ? (json[r'sidecar'] as Iterable).cast().toList(growable: false) + : const [], + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = ServerMediaTypesResponseDto.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = ServerMediaTypesResponseDto.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of ServerMediaTypesResponseDto-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = ServerMediaTypesResponseDto.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + 'video', + 'image', + 'sidecar', + }; +} + diff --git a/mobile/openapi/test/server_info_api_test.dart b/mobile/openapi/test/server_info_api_test.dart index b662587eef..4fee682a25 100644 --- a/mobile/openapi/test/server_info_api_test.dart +++ b/mobile/openapi/test/server_info_api_test.dart @@ -32,6 +32,11 @@ void main() { // TODO }); + //Future getSupportedMediaTypes() async + test('test getSupportedMediaTypes', () async { + // TODO + }); + //Future pingServer() async test('test pingServer', () async { // TODO diff --git a/mobile/openapi/test/server_media_types_response_dto_test.dart b/mobile/openapi/test/server_media_types_response_dto_test.dart new file mode 100644 index 0000000000..041e646805 --- /dev/null +++ b/mobile/openapi/test/server_media_types_response_dto_test.dart @@ -0,0 +1,37 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// 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 + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ServerMediaTypesResponseDto +void main() { + // final instance = ServerMediaTypesResponseDto(); + + group('test ServerMediaTypesResponseDto', () { + // List video (default value: const []) + test('to test the property `video`', () async { + // TODO + }); + + // List image (default value: const []) + test('to test the property `image`', () async { + // TODO + }); + + // List sidecar (default value: const []) + test('to test the property `sidecar`', () async { + // TODO + }); + + + }); + +} diff --git a/server/immich-openapi-specs.json b/server/immich-openapi-specs.json index c2c006744c..877ea38673 100644 --- a/server/immich-openapi-specs.json +++ b/server/immich-openapi-specs.json @@ -3040,6 +3040,27 @@ ] } }, + "/server-info/media-types": { + "get": { + "operationId": "getSupportedMediaTypes", + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServerMediaTypesResponseDto" + } + } + } + } + }, + "tags": [ + "Server Info" + ] + } + }, "/server-info/ping": { "get": { "operationId": "pingServer", @@ -6118,6 +6139,34 @@ "diskAvailable" ] }, + "ServerMediaTypesResponseDto": { + "type": "object", + "properties": { + "video": { + "type": "array", + "items": { + "type": "string" + } + }, + "image": { + "type": "array", + "items": { + "type": "string" + } + }, + "sidecar": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "video", + "image", + "sidecar" + ] + }, "ServerPingResponse": { "type": "object", "properties": { diff --git a/server/src/domain/server-info/response-dto/server-stats-response.dto.ts b/server/src/domain/server-info/response-dto/server-stats-response.dto.ts index ed7a071769..1459ba452a 100644 --- a/server/src/domain/server-info/response-dto/server-stats-response.dto.ts +++ b/server/src/domain/server-info/response-dto/server-stats-response.dto.ts @@ -25,3 +25,9 @@ export class ServerStatsResponseDto { }) usageByUser: UsageByUserDto[] = []; } + +export class ServerMediaTypesResponseDto { + video!: string[]; + image!: string[]; + sidecar!: string[]; +} diff --git a/server/src/domain/server-info/server-info.service.ts b/server/src/domain/server-info/server-info.service.ts index 9d36f1b66d..ceeb85e295 100644 --- a/server/src/domain/server-info/server-info.service.ts +++ b/server/src/domain/server-info/server-info.service.ts @@ -1,9 +1,15 @@ import { Inject, Injectable } from '@nestjs/common'; -import { serverVersion } from '../domain.constant'; +import { mimeTypes, serverVersion } from '../domain.constant'; import { asHumanReadable } from '../domain.util'; import { IStorageRepository, StorageCore, StorageFolder } from '../storage'; import { IUserRepository, UserStatsQueryResponse } from '../user'; -import { ServerInfoResponseDto, ServerPingResponse, ServerStatsResponseDto, UsageByUserDto } from './response-dto'; +import { + ServerInfoResponseDto, + ServerMediaTypesResponseDto, + ServerPingResponse, + ServerStatsResponseDto, + UsageByUserDto, +} from './response-dto'; @Injectable() export class ServerInfoService { @@ -60,4 +66,12 @@ export class ServerInfoService { return serverStats; } + + getSupportedMediaTypes(): ServerMediaTypesResponseDto { + return { + video: [...Object.keys(mimeTypes.video)], + image: [...Object.keys(mimeTypes.image)], + sidecar: [...Object.keys(mimeTypes.sidecar)], + }; + } } diff --git a/server/src/immich/controllers/server-info.controller.ts b/server/src/immich/controllers/server-info.controller.ts index e98485cbe8..59b6351787 100644 --- a/server/src/immich/controllers/server-info.controller.ts +++ b/server/src/immich/controllers/server-info.controller.ts @@ -1,6 +1,7 @@ import { ServerInfoResponseDto, ServerInfoService, + ServerMediaTypesResponseDto, ServerPingResponse, ServerStatsResponseDto, ServerVersionReponseDto, @@ -39,4 +40,10 @@ export class ServerInfoController { getStats(): Promise { return this.service.getStats(); } + + @PublicRoute() + @Get('/media-types') + getSupportedMediaTypes(): ServerMediaTypesResponseDto { + return this.service.getSupportedMediaTypes(); + } } diff --git a/web/src/api/open-api/api.ts b/web/src/api/open-api/api.ts index 66c717c814..414f7b147d 100644 --- a/web/src/api/open-api/api.ts +++ b/web/src/api/open-api/api.ts @@ -2085,6 +2085,31 @@ export interface ServerInfoResponseDto { */ 'diskAvailable': string; } +/** + * + * @export + * @interface ServerMediaTypesResponseDto + */ +export interface ServerMediaTypesResponseDto { + /** + * + * @type {Array} + * @memberof ServerMediaTypesResponseDto + */ + 'video': Array; + /** + * + * @type {Array} + * @memberof ServerMediaTypesResponseDto + */ + 'image': Array; + /** + * + * @type {Array} + * @memberof ServerMediaTypesResponseDto + */ + 'sidecar': Array; +} /** * * @export @@ -9771,6 +9796,35 @@ export const ServerInfoApiAxiosParamCreator = function (configuration?: Configur + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getSupportedMediaTypes: async (options: AxiosRequestConfig = {}): Promise => { + const localVarPath = `/server-info/media-types`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; @@ -9846,6 +9900,15 @@ export const ServerInfoApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getStats(options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getSupportedMediaTypes(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getSupportedMediaTypes(options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, /** * * @param {*} [options] Override http request option. @@ -9889,6 +9952,14 @@ export const ServerInfoApiFactory = function (configuration?: Configuration, bas getStats(options?: any): AxiosPromise { return localVarFp.getStats(options).then((request) => request(axios, basePath)); }, + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getSupportedMediaTypes(options?: any): AxiosPromise { + return localVarFp.getSupportedMediaTypes(options).then((request) => request(axios, basePath)); + }, /** * * @param {*} [options] Override http request option. @@ -9937,6 +10008,16 @@ export class ServerInfoApi extends BaseAPI { return ServerInfoApiFp(this.configuration).getStats(options).then((request) => request(this.axios, this.basePath)); } + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ServerInfoApi + */ + public getSupportedMediaTypes(options?: AxiosRequestConfig) { + return ServerInfoApiFp(this.configuration).getSupportedMediaTypes(options).then((request) => request(this.axios, this.basePath)); + } + /** * * @param {*} [options] Override http request option.