From a7aa3e2ceaf4ac98c45e71bd643294f9c0e4b127 Mon Sep 17 00:00:00 2001 From: skywalker Date: Fri, 23 Aug 2024 00:11:57 +0300 Subject: [PATCH 1/2] feat(countries): use openapi for server side and client side --- client/src/domain/index.ts | 3 +- client/src/generated/.openapi-generator/FILES | 3 + client/src/generated/api.ts | 28 +- client/src/generated/api/add-favorite-api.ts | 242 +++++--------- client/src/generated/api/basic-login-api.ts | 242 +++++--------- .../api/delete-instrument-by-id-api.ts | 235 +++++-------- .../api/get-instrument-basic-materials-api.ts | 215 +++++------- .../generated/api/get-instrument-by-id-api.ts | 238 +++++-------- .../generated/api/get-instrument-types-api.ts | 215 +++++------- .../api/get-instruments-by-criteria-api.ts | 250 +++++--------- ...t-instruments-by-criteria-paginated-api.ts | 314 ++++++------------ .../src/generated/api/get-user-profile-api.ts | 206 +++++------- client/src/generated/api/list-favorite-api.ts | 213 +++++------- .../src/generated/api/remove-favorite-api.ts | 242 +++++--------- .../generated/api/user-registration-api.ts | 241 +++++--------- client/src/generated/base.ts | 59 ++-- client/src/generated/common.ts | 204 +++++------- client/src/generated/configuration.ts | 200 +++++------ client/src/generated/index.ts | 1 + .../model/add-favorite-request-body.ts | 17 +- client/src/generated/model/client-error.ts | 17 +- ...get-instrument-basic-materials-response.ts | 18 +- ...et-instrument-by-criteria-page-response.ts | 78 ++--- .../get-instrument-criteria-request-body.ts | 125 +++---- .../model/get-instrument-types-response.ts | 18 +- .../get-instruments-by-criteria-response.ts | 18 +- client/src/generated/model/index.ts | 36 +- .../model/instrument-basic-material.ts | 17 +- .../src/generated/model/instrument-detail.ts | 101 +++--- client/src/generated/model/instrument-type.ts | 17 +- client/src/generated/model/jwt-response.ts | 17 +- .../model/list-favorite-response-body.ts | 18 +- client/src/generated/model/profile-details.ts | 41 +-- .../generated/model/registration-request.ts | 41 +-- .../model/remove-favorite-request-body.ts | 17 +- client/src/generated/model/server-error.ts | 17 +- .../username-and-password-request-body.ts | 29 +- .../src/pages/create-instrument/api/loader.ts | 21 +- .../src/pages/edit-instrument/api/loader.ts | 22 +- client/src/shared/config/backend.ts | 1 - .../shared/model/parseInstrumentDetails.ts | 14 +- .../catalogue-filter/ui/CountryFilter.tsx | 29 +- openapi/openapi.yml | 48 +++ .../specs/country/GetCountriesEndpoint.yml | 71 ++++ .../muse/rest/country/GetCountriesEndpoint.kt | 21 +- 45 files changed, 1755 insertions(+), 2465 deletions(-) create mode 100644 openapi/specs/country/GetCountriesEndpoint.yml diff --git a/client/src/domain/index.ts b/client/src/domain/index.ts index 43dee426..c8aef455 100644 --- a/client/src/domain/index.ts +++ b/client/src/domain/index.ts @@ -1,7 +1,7 @@ import { Jwt } from "./model/jwt"; import { Role } from "./model/role"; import { InstrumentId } from "./model/instrument-id"; -import type { Country, Countries } from "./model/country"; +import type { Countries } from "./model/country"; import type { InstrumentName } from "./model/instrument-name"; import type { ManufacturerName, @@ -14,7 +14,6 @@ export { Jwt, Role, InstrumentId, - Country, Countries, InstrumentName, ManufacturerName, diff --git a/client/src/generated/.openapi-generator/FILES b/client/src/generated/.openapi-generator/FILES index 830832cc..5b49a97d 100644 --- a/client/src/generated/.openapi-generator/FILES +++ b/client/src/generated/.openapi-generator/FILES @@ -4,6 +4,7 @@ api.ts api/add-favorite-api.ts api/basic-login-api.ts api/delete-instrument-by-id-api.ts +api/get-countries-api.ts api/get-instrument-basic-materials-api.ts api/get-instrument-by-id-api.ts api/get-instrument-types-api.ts @@ -20,6 +21,8 @@ git_push.sh index.ts model/add-favorite-request-body.ts model/client-error.ts +model/country.ts +model/get-countries-response.ts model/get-instrument-basic-materials-response.ts model/get-instrument-by-criteria-page-response.ts model/get-instrument-criteria-request-body.ts diff --git a/client/src/generated/api.ts b/client/src/generated/api.ts index f570a89a..6ac42322 100644 --- a/client/src/generated/api.ts +++ b/client/src/generated/api.ts @@ -12,15 +12,19 @@ * Do not edit the class manually. */ -export * from "./api/add-favorite-api"; -export * from "./api/basic-login-api"; -export * from "./api/delete-instrument-by-id-api"; -export * from "./api/get-instrument-basic-materials-api"; -export * from "./api/get-instrument-by-id-api"; -export * from "./api/get-instrument-types-api"; -export * from "./api/get-instruments-by-criteria-api"; -export * from "./api/get-instruments-by-criteria-paginated-api"; -export * from "./api/get-user-profile-api"; -export * from "./api/list-favorite-api"; -export * from "./api/remove-favorite-api"; -export * from "./api/user-registration-api"; + + +export * from './api/add-favorite-api'; +export * from './api/basic-login-api'; +export * from './api/delete-instrument-by-id-api'; +export * from './api/get-countries-api'; +export * from './api/get-instrument-basic-materials-api'; +export * from './api/get-instrument-by-id-api'; +export * from './api/get-instrument-types-api'; +export * from './api/get-instruments-by-criteria-api'; +export * from './api/get-instruments-by-criteria-paginated-api'; +export * from './api/get-user-profile-api'; +export * from './api/list-favorite-api'; +export * from './api/remove-favorite-api'; +export * from './api/user-registration-api'; + diff --git a/client/src/generated/api/add-favorite-api.ts b/client/src/generated/api/add-favorite-api.ts index 5d272e75..a9db181a 100644 --- a/client/src/generated/api/add-favorite-api.ts +++ b/client/src/generated/api/add-favorite-api.ts @@ -12,171 +12,107 @@ * Do not edit the class manually. */ -import type { Configuration } from "../configuration"; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; -import globalAxios from "axios"; + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore -import { - DUMMY_BASE_URL, - assertParamExists, - setApiKeyToObject, - setBasicAuthToObject, - setBearerAuthToObject, - setOAuthToObject, - setSearchParams, - serializeDataIfNeeded, - toPathString, - createRequestFunction, -} from "../common"; +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { - BASE_PATH, - COLLECTION_FORMATS, - type RequestArgs, - BaseAPI, - RequiredError, - operationServerMap, -} from "../base"; +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore -import type { AddFavoriteRequestBody } from "../model"; +import type { AddFavoriteRequestBody } from '../model'; // @ts-ignore -import type { ClientError } from "../model"; +import type { ClientError } from '../model'; // @ts-ignore -import type { ServerError } from "../model"; +import type { ServerError } from '../model'; /** * AddFavoriteApi - axios parameter creator * @export */ -export const AddFavoriteApiAxiosParamCreator = function ( - configuration?: Configuration, -) { - return { - /** - * Add Favorite - * @summary Add Favorite - * @param {AddFavoriteRequestBody} addFavoriteRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - addFavorite: async ( - addFavoriteRequestBody: AddFavoriteRequestBody, - options: RawAxiosRequestConfig = {}, - ): Promise => { - // verify required parameter 'addFavoriteRequestBody' is not null or undefined - assertParamExists( - "addFavorite", - "addFavoriteRequestBody", - addFavoriteRequestBody, - ); - const localVarPath = `/favorite/add`; - // 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; - } +export const AddFavoriteApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Add Favorite + * @summary Add Favorite + * @param {AddFavoriteRequestBody} addFavoriteRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + addFavorite: async (addFavoriteRequestBody: AddFavoriteRequestBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'addFavoriteRequestBody' is not null or undefined + assertParamExists('addFavorite', 'addFavoriteRequestBody', addFavoriteRequestBody) + const localVarPath = `/favorite/add`; + // 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: "POST", - ...baseOptions, - ...options, - }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; - localVarHeaderParameter["Content-Type"] = "application/json"; - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - localVarRequestOptions.data = serializeDataIfNeeded( - addFavoriteRequestBody, - localVarRequestOptions, - configuration, - ); + + localVarHeaderParameter['Content-Type'] = 'application/json'; - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - }; + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(addFavoriteRequestBody, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } }; /** * AddFavoriteApi - functional programming interface * @export */ -export const AddFavoriteApiFp = function (configuration?: Configuration) { - const localVarAxiosParamCreator = - AddFavoriteApiAxiosParamCreator(configuration); - return { - /** - * Add Favorite - * @summary Add Favorite - * @param {AddFavoriteRequestBody} addFavoriteRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async addFavorite( - addFavoriteRequestBody: AddFavoriteRequestBody, - options?: RawAxiosRequestConfig, - ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.addFavorite( - addFavoriteRequestBody, - options, - ); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = - operationServerMap["AddFavoriteApi.addFavorite"]?.[ - localVarOperationServerIndex - ]?.url; - return (axios, basePath) => - createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration, - )(axios, localVarOperationServerBasePath || basePath); - }, - }; +export const AddFavoriteApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = AddFavoriteApiAxiosParamCreator(configuration) + return { + /** + * Add Favorite + * @summary Add Favorite + * @param {AddFavoriteRequestBody} addFavoriteRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async addFavorite(addFavoriteRequestBody: AddFavoriteRequestBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addFavorite(addFavoriteRequestBody, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['AddFavoriteApi.addFavorite']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } }; /** * AddFavoriteApi - factory interface * @export */ -export const AddFavoriteApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance, -) { - const localVarFp = AddFavoriteApiFp(configuration); - return { - /** - * Add Favorite - * @summary Add Favorite - * @param {AddFavoriteRequestBody} addFavoriteRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - addFavorite( - addFavoriteRequestBody: AddFavoriteRequestBody, - options?: RawAxiosRequestConfig, - ): AxiosPromise { - return localVarFp - .addFavorite(addFavoriteRequestBody, options) - .then((request) => request(axios, basePath)); - }, - }; +export const AddFavoriteApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = AddFavoriteApiFp(configuration) + return { + /** + * Add Favorite + * @summary Add Favorite + * @param {AddFavoriteRequestBody} addFavoriteRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + addFavorite(addFavoriteRequestBody: AddFavoriteRequestBody, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.addFavorite(addFavoriteRequestBody, options).then((request) => request(axios, basePath)); + }, + }; }; /** @@ -186,20 +122,16 @@ export const AddFavoriteApiFactory = function ( * @extends {BaseAPI} */ export class AddFavoriteApi extends BaseAPI { - /** - * Add Favorite - * @summary Add Favorite - * @param {AddFavoriteRequestBody} addFavoriteRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof AddFavoriteApi - */ - public addFavorite( - addFavoriteRequestBody: AddFavoriteRequestBody, - options?: RawAxiosRequestConfig, - ) { - return AddFavoriteApiFp(this.configuration) - .addFavorite(addFavoriteRequestBody, options) - .then((request) => request(this.axios, this.basePath)); - } + /** + * Add Favorite + * @summary Add Favorite + * @param {AddFavoriteRequestBody} addFavoriteRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AddFavoriteApi + */ + public addFavorite(addFavoriteRequestBody: AddFavoriteRequestBody, options?: RawAxiosRequestConfig) { + return AddFavoriteApiFp(this.configuration).addFavorite(addFavoriteRequestBody, options).then((request) => request(this.axios, this.basePath)); + } } + diff --git a/client/src/generated/api/basic-login-api.ts b/client/src/generated/api/basic-login-api.ts index 610c3a84..6823ae68 100644 --- a/client/src/generated/api/basic-login-api.ts +++ b/client/src/generated/api/basic-login-api.ts @@ -12,171 +12,107 @@ * Do not edit the class manually. */ -import type { Configuration } from "../configuration"; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; -import globalAxios from "axios"; + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore -import { - DUMMY_BASE_URL, - assertParamExists, - setApiKeyToObject, - setBasicAuthToObject, - setBearerAuthToObject, - setOAuthToObject, - setSearchParams, - serializeDataIfNeeded, - toPathString, - createRequestFunction, -} from "../common"; +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { - BASE_PATH, - COLLECTION_FORMATS, - type RequestArgs, - BaseAPI, - RequiredError, - operationServerMap, -} from "../base"; +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore -import type { JwtResponse } from "../model"; +import type { JwtResponse } from '../model'; // @ts-ignore -import type { ServerError } from "../model"; +import type { ServerError } from '../model'; // @ts-ignore -import type { UsernameAndPasswordRequestBody } from "../model"; +import type { UsernameAndPasswordRequestBody } from '../model'; /** * BasicLoginApi - axios parameter creator * @export */ -export const BasicLoginApiAxiosParamCreator = function ( - configuration?: Configuration, -) { - return { - /** - * Basic Authentication - * @summary Basic Login - * @param {UsernameAndPasswordRequestBody} usernameAndPasswordRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - basicLogin: async ( - usernameAndPasswordRequestBody: UsernameAndPasswordRequestBody, - options: RawAxiosRequestConfig = {}, - ): Promise => { - // verify required parameter 'usernameAndPasswordRequestBody' is not null or undefined - assertParamExists( - "basicLogin", - "usernameAndPasswordRequestBody", - usernameAndPasswordRequestBody, - ); - const localVarPath = `/auth/login`; - // 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; - } +export const BasicLoginApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Basic Authentication + * @summary Basic Login + * @param {UsernameAndPasswordRequestBody} usernameAndPasswordRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + basicLogin: async (usernameAndPasswordRequestBody: UsernameAndPasswordRequestBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'usernameAndPasswordRequestBody' is not null or undefined + assertParamExists('basicLogin', 'usernameAndPasswordRequestBody', usernameAndPasswordRequestBody) + const localVarPath = `/auth/login`; + // 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: "POST", - ...baseOptions, - ...options, - }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; - localVarHeaderParameter["Content-Type"] = "application/json"; - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - localVarRequestOptions.data = serializeDataIfNeeded( - usernameAndPasswordRequestBody, - localVarRequestOptions, - configuration, - ); + + localVarHeaderParameter['Content-Type'] = 'application/json'; - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - }; + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(usernameAndPasswordRequestBody, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } }; /** * BasicLoginApi - functional programming interface * @export */ -export const BasicLoginApiFp = function (configuration?: Configuration) { - const localVarAxiosParamCreator = - BasicLoginApiAxiosParamCreator(configuration); - return { - /** - * Basic Authentication - * @summary Basic Login - * @param {UsernameAndPasswordRequestBody} usernameAndPasswordRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async basicLogin( - usernameAndPasswordRequestBody: UsernameAndPasswordRequestBody, - options?: RawAxiosRequestConfig, - ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.basicLogin( - usernameAndPasswordRequestBody, - options, - ); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = - operationServerMap["BasicLoginApi.basicLogin"]?.[ - localVarOperationServerIndex - ]?.url; - return (axios, basePath) => - createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration, - )(axios, localVarOperationServerBasePath || basePath); - }, - }; +export const BasicLoginApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = BasicLoginApiAxiosParamCreator(configuration) + return { + /** + * Basic Authentication + * @summary Basic Login + * @param {UsernameAndPasswordRequestBody} usernameAndPasswordRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async basicLogin(usernameAndPasswordRequestBody: UsernameAndPasswordRequestBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.basicLogin(usernameAndPasswordRequestBody, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['BasicLoginApi.basicLogin']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } }; /** * BasicLoginApi - factory interface * @export */ -export const BasicLoginApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance, -) { - const localVarFp = BasicLoginApiFp(configuration); - return { - /** - * Basic Authentication - * @summary Basic Login - * @param {UsernameAndPasswordRequestBody} usernameAndPasswordRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - basicLogin( - usernameAndPasswordRequestBody: UsernameAndPasswordRequestBody, - options?: RawAxiosRequestConfig, - ): AxiosPromise { - return localVarFp - .basicLogin(usernameAndPasswordRequestBody, options) - .then((request) => request(axios, basePath)); - }, - }; +export const BasicLoginApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = BasicLoginApiFp(configuration) + return { + /** + * Basic Authentication + * @summary Basic Login + * @param {UsernameAndPasswordRequestBody} usernameAndPasswordRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + basicLogin(usernameAndPasswordRequestBody: UsernameAndPasswordRequestBody, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.basicLogin(usernameAndPasswordRequestBody, options).then((request) => request(axios, basePath)); + }, + }; }; /** @@ -186,20 +122,16 @@ export const BasicLoginApiFactory = function ( * @extends {BaseAPI} */ export class BasicLoginApi extends BaseAPI { - /** - * Basic Authentication - * @summary Basic Login - * @param {UsernameAndPasswordRequestBody} usernameAndPasswordRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof BasicLoginApi - */ - public basicLogin( - usernameAndPasswordRequestBody: UsernameAndPasswordRequestBody, - options?: RawAxiosRequestConfig, - ) { - return BasicLoginApiFp(this.configuration) - .basicLogin(usernameAndPasswordRequestBody, options) - .then((request) => request(this.axios, this.basePath)); - } + /** + * Basic Authentication + * @summary Basic Login + * @param {UsernameAndPasswordRequestBody} usernameAndPasswordRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof BasicLoginApi + */ + public basicLogin(usernameAndPasswordRequestBody: UsernameAndPasswordRequestBody, options?: RawAxiosRequestConfig) { + return BasicLoginApiFp(this.configuration).basicLogin(usernameAndPasswordRequestBody, options).then((request) => request(this.axios, this.basePath)); + } } + diff --git a/client/src/generated/api/delete-instrument-by-id-api.ts b/client/src/generated/api/delete-instrument-by-id-api.ts index a5d963f7..c1a96ab0 100644 --- a/client/src/generated/api/delete-instrument-by-id-api.ts +++ b/client/src/generated/api/delete-instrument-by-id-api.ts @@ -12,164 +12,103 @@ * Do not edit the class manually. */ -import type { Configuration } from "../configuration"; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; -import globalAxios from "axios"; + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore -import { - DUMMY_BASE_URL, - assertParamExists, - setApiKeyToObject, - setBasicAuthToObject, - setBearerAuthToObject, - setOAuthToObject, - setSearchParams, - serializeDataIfNeeded, - toPathString, - createRequestFunction, -} from "../common"; +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { - BASE_PATH, - COLLECTION_FORMATS, - type RequestArgs, - BaseAPI, - RequiredError, - operationServerMap, -} from "../base"; +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore -import type { ClientError } from "../model"; +import type { ClientError } from '../model'; // @ts-ignore -import type { ServerError } from "../model"; +import type { ServerError } from '../model'; /** * DeleteInstrumentByIdApi - axios parameter creator * @export */ -export const DeleteInstrumentByIdApiAxiosParamCreator = function ( - configuration?: Configuration, -) { - return { - /** - * Get Instrument Types - * @summary Get Instrument Types - * @param {number} instrumentId Instrument ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteInstrumentById: async ( - instrumentId: number, - options: RawAxiosRequestConfig = {}, - ): Promise => { - // verify required parameter 'instrumentId' is not null or undefined - assertParamExists("deleteInstrumentById", "instrumentId", instrumentId); - const localVarPath = `/instrument/{instrumentId}/delete`.replace( - `{${"instrumentId"}}`, - encodeURIComponent(String(instrumentId)), - ); - // 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; - } +export const DeleteInstrumentByIdApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Get Instrument Types + * @summary Get Instrument Types + * @param {number} instrumentId Instrument ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteInstrumentById: async (instrumentId: number, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'instrumentId' is not null or undefined + assertParamExists('deleteInstrumentById', 'instrumentId', instrumentId) + const localVarPath = `/instrument/{instrumentId}/delete` + .replace(`{${"instrumentId"}}`, encodeURIComponent(String(instrumentId))); + // 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; + 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, - }; - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - }; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } }; /** * DeleteInstrumentByIdApi - functional programming interface * @export */ -export const DeleteInstrumentByIdApiFp = function ( - configuration?: Configuration, -) { - const localVarAxiosParamCreator = - DeleteInstrumentByIdApiAxiosParamCreator(configuration); - return { - /** - * Get Instrument Types - * @summary Get Instrument Types - * @param {number} instrumentId Instrument ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async deleteInstrumentById( - instrumentId: number, - options?: RawAxiosRequestConfig, - ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.deleteInstrumentById( - instrumentId, - options, - ); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = - operationServerMap["DeleteInstrumentByIdApi.deleteInstrumentById"]?.[ - localVarOperationServerIndex - ]?.url; - return (axios, basePath) => - createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration, - )(axios, localVarOperationServerBasePath || basePath); - }, - }; +export const DeleteInstrumentByIdApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = DeleteInstrumentByIdApiAxiosParamCreator(configuration) + return { + /** + * Get Instrument Types + * @summary Get Instrument Types + * @param {number} instrumentId Instrument ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteInstrumentById(instrumentId: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteInstrumentById(instrumentId, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['DeleteInstrumentByIdApi.deleteInstrumentById']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } }; /** * DeleteInstrumentByIdApi - factory interface * @export */ -export const DeleteInstrumentByIdApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance, -) { - const localVarFp = DeleteInstrumentByIdApiFp(configuration); - return { - /** - * Get Instrument Types - * @summary Get Instrument Types - * @param {number} instrumentId Instrument ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteInstrumentById( - instrumentId: number, - options?: RawAxiosRequestConfig, - ): AxiosPromise { - return localVarFp - .deleteInstrumentById(instrumentId, options) - .then((request) => request(axios, basePath)); - }, - }; +export const DeleteInstrumentByIdApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = DeleteInstrumentByIdApiFp(configuration) + return { + /** + * Get Instrument Types + * @summary Get Instrument Types + * @param {number} instrumentId Instrument ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteInstrumentById(instrumentId: number, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.deleteInstrumentById(instrumentId, options).then((request) => request(axios, basePath)); + }, + }; }; /** @@ -179,20 +118,16 @@ export const DeleteInstrumentByIdApiFactory = function ( * @extends {BaseAPI} */ export class DeleteInstrumentByIdApi extends BaseAPI { - /** - * Get Instrument Types - * @summary Get Instrument Types - * @param {number} instrumentId Instrument ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof DeleteInstrumentByIdApi - */ - public deleteInstrumentById( - instrumentId: number, - options?: RawAxiosRequestConfig, - ) { - return DeleteInstrumentByIdApiFp(this.configuration) - .deleteInstrumentById(instrumentId, options) - .then((request) => request(this.axios, this.basePath)); - } + /** + * Get Instrument Types + * @summary Get Instrument Types + * @param {number} instrumentId Instrument ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DeleteInstrumentByIdApi + */ + public deleteInstrumentById(instrumentId: number, options?: RawAxiosRequestConfig) { + return DeleteInstrumentByIdApiFp(this.configuration).deleteInstrumentById(instrumentId, options).then((request) => request(this.axios, this.basePath)); + } } + diff --git a/client/src/generated/api/get-instrument-basic-materials-api.ts b/client/src/generated/api/get-instrument-basic-materials-api.ts index 7279b470..4a9ea562 100644 --- a/client/src/generated/api/get-instrument-basic-materials-api.ts +++ b/client/src/generated/api/get-instrument-basic-materials-api.ts @@ -12,155 +12,99 @@ * Do not edit the class manually. */ -import type { Configuration } from "../configuration"; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; -import globalAxios from "axios"; + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore -import { - DUMMY_BASE_URL, - assertParamExists, - setApiKeyToObject, - setBasicAuthToObject, - setBearerAuthToObject, - setOAuthToObject, - setSearchParams, - serializeDataIfNeeded, - toPathString, - createRequestFunction, -} from "../common"; +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { - BASE_PATH, - COLLECTION_FORMATS, - type RequestArgs, - BaseAPI, - RequiredError, - operationServerMap, -} from "../base"; +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore -import type { ClientError } from "../model"; +import type { ClientError } from '../model'; // @ts-ignore -import type { GetInstrumentBasicMaterialsResponse } from "../model"; +import type { GetInstrumentBasicMaterialsResponse } from '../model'; // @ts-ignore -import type { ServerError } from "../model"; +import type { ServerError } from '../model'; /** * GetInstrumentBasicMaterialsApi - axios parameter creator * @export */ -export const GetInstrumentBasicMaterialsApiAxiosParamCreator = function ( - configuration?: Configuration, -) { - return { - /** - * Get Instrument Basic Materials - * @summary Get Instrument Basic Materials - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getInstrumentBasicMaterials: async ( - options: RawAxiosRequestConfig = {}, - ): Promise => { - const localVarPath = `/instrument/materials`; - // 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; - } +export const GetInstrumentBasicMaterialsApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Get Instrument Basic Materials + * @summary Get Instrument Basic Materials + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInstrumentBasicMaterials: async (options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/instrument/materials`; + // 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; + 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, - }; - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - }; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } }; /** * GetInstrumentBasicMaterialsApi - functional programming interface * @export */ -export const GetInstrumentBasicMaterialsApiFp = function ( - configuration?: Configuration, -) { - const localVarAxiosParamCreator = - GetInstrumentBasicMaterialsApiAxiosParamCreator(configuration); - return { - /** - * Get Instrument Basic Materials - * @summary Get Instrument Basic Materials - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getInstrumentBasicMaterials( - options?: RawAxiosRequestConfig, - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string, - ) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.getInstrumentBasicMaterials(options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = - operationServerMap[ - "GetInstrumentBasicMaterialsApi.getInstrumentBasicMaterials" - ]?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => - createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration, - )(axios, localVarOperationServerBasePath || basePath); - }, - }; +export const GetInstrumentBasicMaterialsApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = GetInstrumentBasicMaterialsApiAxiosParamCreator(configuration) + return { + /** + * Get Instrument Basic Materials + * @summary Get Instrument Basic Materials + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getInstrumentBasicMaterials(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getInstrumentBasicMaterials(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['GetInstrumentBasicMaterialsApi.getInstrumentBasicMaterials']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } }; /** * GetInstrumentBasicMaterialsApi - factory interface * @export */ -export const GetInstrumentBasicMaterialsApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance, -) { - const localVarFp = GetInstrumentBasicMaterialsApiFp(configuration); - return { - /** - * Get Instrument Basic Materials - * @summary Get Instrument Basic Materials - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getInstrumentBasicMaterials( - options?: RawAxiosRequestConfig, - ): AxiosPromise { - return localVarFp - .getInstrumentBasicMaterials(options) - .then((request) => request(axios, basePath)); - }, - }; +export const GetInstrumentBasicMaterialsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = GetInstrumentBasicMaterialsApiFp(configuration) + return { + /** + * Get Instrument Basic Materials + * @summary Get Instrument Basic Materials + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInstrumentBasicMaterials(options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getInstrumentBasicMaterials(options).then((request) => request(axios, basePath)); + }, + }; }; /** @@ -170,16 +114,15 @@ export const GetInstrumentBasicMaterialsApiFactory = function ( * @extends {BaseAPI} */ export class GetInstrumentBasicMaterialsApi extends BaseAPI { - /** - * Get Instrument Basic Materials - * @summary Get Instrument Basic Materials - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof GetInstrumentBasicMaterialsApi - */ - public getInstrumentBasicMaterials(options?: RawAxiosRequestConfig) { - return GetInstrumentBasicMaterialsApiFp(this.configuration) - .getInstrumentBasicMaterials(options) - .then((request) => request(this.axios, this.basePath)); - } + /** + * Get Instrument Basic Materials + * @summary Get Instrument Basic Materials + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GetInstrumentBasicMaterialsApi + */ + public getInstrumentBasicMaterials(options?: RawAxiosRequestConfig) { + return GetInstrumentBasicMaterialsApiFp(this.configuration).getInstrumentBasicMaterials(options).then((request) => request(this.axios, this.basePath)); + } } + diff --git a/client/src/generated/api/get-instrument-by-id-api.ts b/client/src/generated/api/get-instrument-by-id-api.ts index 6520a1ce..7f0b1d73 100644 --- a/client/src/generated/api/get-instrument-by-id-api.ts +++ b/client/src/generated/api/get-instrument-by-id-api.ts @@ -12,167 +12,105 @@ * Do not edit the class manually. */ -import type { Configuration } from "../configuration"; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; -import globalAxios from "axios"; + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore -import { - DUMMY_BASE_URL, - assertParamExists, - setApiKeyToObject, - setBasicAuthToObject, - setBearerAuthToObject, - setOAuthToObject, - setSearchParams, - serializeDataIfNeeded, - toPathString, - createRequestFunction, -} from "../common"; +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { - BASE_PATH, - COLLECTION_FORMATS, - type RequestArgs, - BaseAPI, - RequiredError, - operationServerMap, -} from "../base"; +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore -import type { ClientError } from "../model"; +import type { ClientError } from '../model'; // @ts-ignore -import type { InstrumentDetail } from "../model"; +import type { InstrumentDetail } from '../model'; // @ts-ignore -import type { ServerError } from "../model"; +import type { ServerError } from '../model'; /** * GetInstrumentByIdApi - axios parameter creator * @export */ -export const GetInstrumentByIdApiAxiosParamCreator = function ( - configuration?: Configuration, -) { - return { - /** - * Get Instrument by ID - * @summary Get Instrument by ID - * @param {string} instrumentId Instrument ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getInstrumentById: async ( - instrumentId: string, - options: RawAxiosRequestConfig = {}, - ): Promise => { - // verify required parameter 'instrumentId' is not null or undefined - assertParamExists("getInstrumentById", "instrumentId", instrumentId); - const localVarPath = `/instrument/{instrumentId}`.replace( - `{${"instrumentId"}}`, - encodeURIComponent(String(instrumentId)), - ); - // 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; - } +export const GetInstrumentByIdApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Get Instrument by ID + * @summary Get Instrument by ID + * @param {string} instrumentId Instrument ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInstrumentById: async (instrumentId: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'instrumentId' is not null or undefined + assertParamExists('getInstrumentById', 'instrumentId', instrumentId) + const localVarPath = `/instrument/{instrumentId}` + .replace(`{${"instrumentId"}}`, encodeURIComponent(String(instrumentId))); + // 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; + 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, - }; - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - }; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } }; /** * GetInstrumentByIdApi - functional programming interface * @export */ -export const GetInstrumentByIdApiFp = function (configuration?: Configuration) { - const localVarAxiosParamCreator = - GetInstrumentByIdApiAxiosParamCreator(configuration); - return { - /** - * Get Instrument by ID - * @summary Get Instrument by ID - * @param {string} instrumentId Instrument ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getInstrumentById( - instrumentId: string, - options?: RawAxiosRequestConfig, - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string, - ) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.getInstrumentById( - instrumentId, - options, - ); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = - operationServerMap["GetInstrumentByIdApi.getInstrumentById"]?.[ - localVarOperationServerIndex - ]?.url; - return (axios, basePath) => - createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration, - )(axios, localVarOperationServerBasePath || basePath); - }, - }; +export const GetInstrumentByIdApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = GetInstrumentByIdApiAxiosParamCreator(configuration) + return { + /** + * Get Instrument by ID + * @summary Get Instrument by ID + * @param {string} instrumentId Instrument ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getInstrumentById(instrumentId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getInstrumentById(instrumentId, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['GetInstrumentByIdApi.getInstrumentById']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } }; /** * GetInstrumentByIdApi - factory interface * @export */ -export const GetInstrumentByIdApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance, -) { - const localVarFp = GetInstrumentByIdApiFp(configuration); - return { - /** - * Get Instrument by ID - * @summary Get Instrument by ID - * @param {string} instrumentId Instrument ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getInstrumentById( - instrumentId: string, - options?: RawAxiosRequestConfig, - ): AxiosPromise { - return localVarFp - .getInstrumentById(instrumentId, options) - .then((request) => request(axios, basePath)); - }, - }; +export const GetInstrumentByIdApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = GetInstrumentByIdApiFp(configuration) + return { + /** + * Get Instrument by ID + * @summary Get Instrument by ID + * @param {string} instrumentId Instrument ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInstrumentById(instrumentId: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getInstrumentById(instrumentId, options).then((request) => request(axios, basePath)); + }, + }; }; /** @@ -182,20 +120,16 @@ export const GetInstrumentByIdApiFactory = function ( * @extends {BaseAPI} */ export class GetInstrumentByIdApi extends BaseAPI { - /** - * Get Instrument by ID - * @summary Get Instrument by ID - * @param {string} instrumentId Instrument ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof GetInstrumentByIdApi - */ - public getInstrumentById( - instrumentId: string, - options?: RawAxiosRequestConfig, - ) { - return GetInstrumentByIdApiFp(this.configuration) - .getInstrumentById(instrumentId, options) - .then((request) => request(this.axios, this.basePath)); - } + /** + * Get Instrument by ID + * @summary Get Instrument by ID + * @param {string} instrumentId Instrument ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GetInstrumentByIdApi + */ + public getInstrumentById(instrumentId: string, options?: RawAxiosRequestConfig) { + return GetInstrumentByIdApiFp(this.configuration).getInstrumentById(instrumentId, options).then((request) => request(this.axios, this.basePath)); + } } + diff --git a/client/src/generated/api/get-instrument-types-api.ts b/client/src/generated/api/get-instrument-types-api.ts index f15be6ba..30a848b7 100644 --- a/client/src/generated/api/get-instrument-types-api.ts +++ b/client/src/generated/api/get-instrument-types-api.ts @@ -12,155 +12,99 @@ * Do not edit the class manually. */ -import type { Configuration } from "../configuration"; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; -import globalAxios from "axios"; + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore -import { - DUMMY_BASE_URL, - assertParamExists, - setApiKeyToObject, - setBasicAuthToObject, - setBearerAuthToObject, - setOAuthToObject, - setSearchParams, - serializeDataIfNeeded, - toPathString, - createRequestFunction, -} from "../common"; +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { - BASE_PATH, - COLLECTION_FORMATS, - type RequestArgs, - BaseAPI, - RequiredError, - operationServerMap, -} from "../base"; +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore -import type { ClientError } from "../model"; +import type { ClientError } from '../model'; // @ts-ignore -import type { GetInstrumentTypesResponse } from "../model"; +import type { GetInstrumentTypesResponse } from '../model'; // @ts-ignore -import type { ServerError } from "../model"; +import type { ServerError } from '../model'; /** * GetInstrumentTypesApi - axios parameter creator * @export */ -export const GetInstrumentTypesApiAxiosParamCreator = function ( - configuration?: Configuration, -) { - return { - /** - * Get Instrument Types - * @summary Get Instrument Types - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getInstrumentTypes: async ( - options: RawAxiosRequestConfig = {}, - ): Promise => { - const localVarPath = `/instrument/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; - } +export const GetInstrumentTypesApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Get Instrument Types + * @summary Get Instrument Types + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInstrumentTypes: async (options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/instrument/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; + 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, - }; - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - }; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } }; /** * GetInstrumentTypesApi - functional programming interface * @export */ -export const GetInstrumentTypesApiFp = function ( - configuration?: Configuration, -) { - const localVarAxiosParamCreator = - GetInstrumentTypesApiAxiosParamCreator(configuration); - return { - /** - * Get Instrument Types - * @summary Get Instrument Types - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getInstrumentTypes( - options?: RawAxiosRequestConfig, - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string, - ) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.getInstrumentTypes(options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = - operationServerMap["GetInstrumentTypesApi.getInstrumentTypes"]?.[ - localVarOperationServerIndex - ]?.url; - return (axios, basePath) => - createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration, - )(axios, localVarOperationServerBasePath || basePath); - }, - }; +export const GetInstrumentTypesApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = GetInstrumentTypesApiAxiosParamCreator(configuration) + return { + /** + * Get Instrument Types + * @summary Get Instrument Types + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getInstrumentTypes(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getInstrumentTypes(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['GetInstrumentTypesApi.getInstrumentTypes']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } }; /** * GetInstrumentTypesApi - factory interface * @export */ -export const GetInstrumentTypesApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance, -) { - const localVarFp = GetInstrumentTypesApiFp(configuration); - return { - /** - * Get Instrument Types - * @summary Get Instrument Types - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getInstrumentTypes( - options?: RawAxiosRequestConfig, - ): AxiosPromise { - return localVarFp - .getInstrumentTypes(options) - .then((request) => request(axios, basePath)); - }, - }; +export const GetInstrumentTypesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = GetInstrumentTypesApiFp(configuration) + return { + /** + * Get Instrument Types + * @summary Get Instrument Types + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInstrumentTypes(options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getInstrumentTypes(options).then((request) => request(axios, basePath)); + }, + }; }; /** @@ -170,16 +114,15 @@ export const GetInstrumentTypesApiFactory = function ( * @extends {BaseAPI} */ export class GetInstrumentTypesApi extends BaseAPI { - /** - * Get Instrument Types - * @summary Get Instrument Types - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof GetInstrumentTypesApi - */ - public getInstrumentTypes(options?: RawAxiosRequestConfig) { - return GetInstrumentTypesApiFp(this.configuration) - .getInstrumentTypes(options) - .then((request) => request(this.axios, this.basePath)); - } + /** + * Get Instrument Types + * @summary Get Instrument Types + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GetInstrumentTypesApi + */ + public getInstrumentTypes(options?: RawAxiosRequestConfig) { + return GetInstrumentTypesApiFp(this.configuration).getInstrumentTypes(options).then((request) => request(this.axios, this.basePath)); + } } + diff --git a/client/src/generated/api/get-instruments-by-criteria-api.ts b/client/src/generated/api/get-instruments-by-criteria-api.ts index 8d9d1858..8f91e226 100644 --- a/client/src/generated/api/get-instruments-by-criteria-api.ts +++ b/client/src/generated/api/get-instruments-by-criteria-api.ts @@ -12,179 +12,109 @@ * Do not edit the class manually. */ -import type { Configuration } from "../configuration"; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; -import globalAxios from "axios"; + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore -import { - DUMMY_BASE_URL, - assertParamExists, - setApiKeyToObject, - setBasicAuthToObject, - setBearerAuthToObject, - setOAuthToObject, - setSearchParams, - serializeDataIfNeeded, - toPathString, - createRequestFunction, -} from "../common"; +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { - BASE_PATH, - COLLECTION_FORMATS, - type RequestArgs, - BaseAPI, - RequiredError, - operationServerMap, -} from "../base"; +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore -import type { ClientError } from "../model"; +import type { ClientError } from '../model'; // @ts-ignore -import type { GetInstrumentCriteriaRequestBody } from "../model"; +import type { GetInstrumentCriteriaRequestBody } from '../model'; // @ts-ignore -import type { GetInstrumentsByCriteriaResponse } from "../model"; +import type { GetInstrumentsByCriteriaResponse } from '../model'; // @ts-ignore -import type { ServerError } from "../model"; +import type { ServerError } from '../model'; /** * GetInstrumentsByCriteriaApi - axios parameter creator * @export */ -export const GetInstrumentsByCriteriaApiAxiosParamCreator = function ( - configuration?: Configuration, -) { - return { - /** - * Get Instruments by Criteria - * @summary Get Instruments by Criteria - * @param {GetInstrumentCriteriaRequestBody} getInstrumentCriteriaRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getInstrumentsByCriteria: async ( - getInstrumentCriteriaRequestBody: GetInstrumentCriteriaRequestBody, - options: RawAxiosRequestConfig = {}, - ): Promise => { - // verify required parameter 'getInstrumentCriteriaRequestBody' is not null or undefined - assertParamExists( - "getInstrumentsByCriteria", - "getInstrumentCriteriaRequestBody", - getInstrumentCriteriaRequestBody, - ); - const localVarPath = `/instruments`; - // 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; - } +export const GetInstrumentsByCriteriaApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Get Instruments by Criteria + * @summary Get Instruments by Criteria + * @param {GetInstrumentCriteriaRequestBody} getInstrumentCriteriaRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInstrumentsByCriteria: async (getInstrumentCriteriaRequestBody: GetInstrumentCriteriaRequestBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'getInstrumentCriteriaRequestBody' is not null or undefined + assertParamExists('getInstrumentsByCriteria', 'getInstrumentCriteriaRequestBody', getInstrumentCriteriaRequestBody) + const localVarPath = `/instruments`; + // 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: "POST", - ...baseOptions, - ...options, - }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; - localVarHeaderParameter["Content-Type"] = "application/json"; - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - localVarRequestOptions.data = serializeDataIfNeeded( - getInstrumentCriteriaRequestBody, - localVarRequestOptions, - configuration, - ); + + localVarHeaderParameter['Content-Type'] = 'application/json'; - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - }; + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(getInstrumentCriteriaRequestBody, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } }; /** * GetInstrumentsByCriteriaApi - functional programming interface * @export */ -export const GetInstrumentsByCriteriaApiFp = function ( - configuration?: Configuration, -) { - const localVarAxiosParamCreator = - GetInstrumentsByCriteriaApiAxiosParamCreator(configuration); - return { - /** - * Get Instruments by Criteria - * @summary Get Instruments by Criteria - * @param {GetInstrumentCriteriaRequestBody} getInstrumentCriteriaRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getInstrumentsByCriteria( - getInstrumentCriteriaRequestBody: GetInstrumentCriteriaRequestBody, - options?: RawAxiosRequestConfig, - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string, - ) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.getInstrumentsByCriteria( - getInstrumentCriteriaRequestBody, - options, - ); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = - operationServerMap[ - "GetInstrumentsByCriteriaApi.getInstrumentsByCriteria" - ]?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => - createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration, - )(axios, localVarOperationServerBasePath || basePath); - }, - }; +export const GetInstrumentsByCriteriaApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = GetInstrumentsByCriteriaApiAxiosParamCreator(configuration) + return { + /** + * Get Instruments by Criteria + * @summary Get Instruments by Criteria + * @param {GetInstrumentCriteriaRequestBody} getInstrumentCriteriaRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getInstrumentsByCriteria(getInstrumentCriteriaRequestBody: GetInstrumentCriteriaRequestBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getInstrumentsByCriteria(getInstrumentCriteriaRequestBody, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['GetInstrumentsByCriteriaApi.getInstrumentsByCriteria']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } }; /** * GetInstrumentsByCriteriaApi - factory interface * @export */ -export const GetInstrumentsByCriteriaApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance, -) { - const localVarFp = GetInstrumentsByCriteriaApiFp(configuration); - return { - /** - * Get Instruments by Criteria - * @summary Get Instruments by Criteria - * @param {GetInstrumentCriteriaRequestBody} getInstrumentCriteriaRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getInstrumentsByCriteria( - getInstrumentCriteriaRequestBody: GetInstrumentCriteriaRequestBody, - options?: RawAxiosRequestConfig, - ): AxiosPromise { - return localVarFp - .getInstrumentsByCriteria(getInstrumentCriteriaRequestBody, options) - .then((request) => request(axios, basePath)); - }, - }; +export const GetInstrumentsByCriteriaApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = GetInstrumentsByCriteriaApiFp(configuration) + return { + /** + * Get Instruments by Criteria + * @summary Get Instruments by Criteria + * @param {GetInstrumentCriteriaRequestBody} getInstrumentCriteriaRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInstrumentsByCriteria(getInstrumentCriteriaRequestBody: GetInstrumentCriteriaRequestBody, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getInstrumentsByCriteria(getInstrumentCriteriaRequestBody, options).then((request) => request(axios, basePath)); + }, + }; }; /** @@ -194,20 +124,16 @@ export const GetInstrumentsByCriteriaApiFactory = function ( * @extends {BaseAPI} */ export class GetInstrumentsByCriteriaApi extends BaseAPI { - /** - * Get Instruments by Criteria - * @summary Get Instruments by Criteria - * @param {GetInstrumentCriteriaRequestBody} getInstrumentCriteriaRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof GetInstrumentsByCriteriaApi - */ - public getInstrumentsByCriteria( - getInstrumentCriteriaRequestBody: GetInstrumentCriteriaRequestBody, - options?: RawAxiosRequestConfig, - ) { - return GetInstrumentsByCriteriaApiFp(this.configuration) - .getInstrumentsByCriteria(getInstrumentCriteriaRequestBody, options) - .then((request) => request(this.axios, this.basePath)); - } + /** + * Get Instruments by Criteria + * @summary Get Instruments by Criteria + * @param {GetInstrumentCriteriaRequestBody} getInstrumentCriteriaRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GetInstrumentsByCriteriaApi + */ + public getInstrumentsByCriteria(getInstrumentCriteriaRequestBody: GetInstrumentCriteriaRequestBody, options?: RawAxiosRequestConfig) { + return GetInstrumentsByCriteriaApiFp(this.configuration).getInstrumentsByCriteria(getInstrumentCriteriaRequestBody, options).then((request) => request(this.axios, this.basePath)); + } } + diff --git a/client/src/generated/api/get-instruments-by-criteria-paginated-api.ts b/client/src/generated/api/get-instruments-by-criteria-paginated-api.ts index 1f6c7b84..68d40a42 100644 --- a/client/src/generated/api/get-instruments-by-criteria-paginated-api.ts +++ b/client/src/generated/api/get-instruments-by-criteria-paginated-api.ts @@ -12,218 +12,127 @@ * Do not edit the class manually. */ -import type { Configuration } from "../configuration"; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; -import globalAxios from "axios"; + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore -import { - DUMMY_BASE_URL, - assertParamExists, - setApiKeyToObject, - setBasicAuthToObject, - setBearerAuthToObject, - setOAuthToObject, - setSearchParams, - serializeDataIfNeeded, - toPathString, - createRequestFunction, -} from "../common"; +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { - BASE_PATH, - COLLECTION_FORMATS, - type RequestArgs, - BaseAPI, - RequiredError, - operationServerMap, -} from "../base"; +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore -import type { ClientError } from "../model"; +import type { ClientError } from '../model'; // @ts-ignore -import type { GetInstrumentByCriteriaPageResponse } from "../model"; +import type { GetInstrumentByCriteriaPageResponse } from '../model'; // @ts-ignore -import type { GetInstrumentCriteriaRequestBody } from "../model"; +import type { GetInstrumentCriteriaRequestBody } from '../model'; // @ts-ignore -import type { ServerError } from "../model"; +import type { ServerError } from '../model'; /** * GetInstrumentsByCriteriaPaginatedApi - axios parameter creator * @export */ -export const GetInstrumentsByCriteriaPaginatedApiAxiosParamCreator = function ( - configuration?: Configuration, -) { - return { - /** - * Get Instruments by Criteria Paginated - * @summary Get Instruments by Criteria Paginated - * @param {number} pageSize Page Size - * @param {number} pageNumber Page Number (1-based enumeration) - * @param {GetInstrumentCriteriaRequestBody} getInstrumentCriteriaRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getInstrumentsByCriteriaPaginated: async ( - pageSize: number, - pageNumber: number, - getInstrumentCriteriaRequestBody: GetInstrumentCriteriaRequestBody, - options: RawAxiosRequestConfig = {}, - ): Promise => { - // verify required parameter 'pageSize' is not null or undefined - assertParamExists( - "getInstrumentsByCriteriaPaginated", - "pageSize", - pageSize, - ); - // verify required parameter 'pageNumber' is not null or undefined - assertParamExists( - "getInstrumentsByCriteriaPaginated", - "pageNumber", - pageNumber, - ); - // verify required parameter 'getInstrumentCriteriaRequestBody' is not null or undefined - assertParamExists( - "getInstrumentsByCriteriaPaginated", - "getInstrumentCriteriaRequestBody", - getInstrumentCriteriaRequestBody, - ); - const localVarPath = `/instruments/paginated`; - // 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; - } +export const GetInstrumentsByCriteriaPaginatedApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Get Instruments by Criteria Paginated + * @summary Get Instruments by Criteria Paginated + * @param {number} pageSize Page Size + * @param {number} pageNumber Page Number (1-based enumeration) + * @param {GetInstrumentCriteriaRequestBody} getInstrumentCriteriaRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInstrumentsByCriteriaPaginated: async (pageSize: number, pageNumber: number, getInstrumentCriteriaRequestBody: GetInstrumentCriteriaRequestBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'pageSize' is not null or undefined + assertParamExists('getInstrumentsByCriteriaPaginated', 'pageSize', pageSize) + // verify required parameter 'pageNumber' is not null or undefined + assertParamExists('getInstrumentsByCriteriaPaginated', 'pageNumber', pageNumber) + // verify required parameter 'getInstrumentCriteriaRequestBody' is not null or undefined + assertParamExists('getInstrumentsByCriteriaPaginated', 'getInstrumentCriteriaRequestBody', getInstrumentCriteriaRequestBody) + const localVarPath = `/instruments/paginated`; + // 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: "POST", - ...baseOptions, - ...options, - }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; - if (pageSize !== undefined) { - localVarQueryParameter["page_size"] = pageSize; - } + if (pageSize !== undefined) { + localVarQueryParameter['page_size'] = pageSize; + } - if (pageNumber !== undefined) { - localVarQueryParameter["page_number"] = pageNumber; - } + if (pageNumber !== undefined) { + localVarQueryParameter['page_number'] = pageNumber; + } - localVarHeaderParameter["Content-Type"] = "application/json"; - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - localVarRequestOptions.data = serializeDataIfNeeded( - getInstrumentCriteriaRequestBody, - localVarRequestOptions, - configuration, - ); + + localVarHeaderParameter['Content-Type'] = 'application/json'; - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - }; + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(getInstrumentCriteriaRequestBody, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } }; /** * GetInstrumentsByCriteriaPaginatedApi - functional programming interface * @export */ -export const GetInstrumentsByCriteriaPaginatedApiFp = function ( - configuration?: Configuration, -) { - const localVarAxiosParamCreator = - GetInstrumentsByCriteriaPaginatedApiAxiosParamCreator(configuration); - return { - /** - * Get Instruments by Criteria Paginated - * @summary Get Instruments by Criteria Paginated - * @param {number} pageSize Page Size - * @param {number} pageNumber Page Number (1-based enumeration) - * @param {GetInstrumentCriteriaRequestBody} getInstrumentCriteriaRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getInstrumentsByCriteriaPaginated( - pageSize: number, - pageNumber: number, - getInstrumentCriteriaRequestBody: GetInstrumentCriteriaRequestBody, - options?: RawAxiosRequestConfig, - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string, - ) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.getInstrumentsByCriteriaPaginated( - pageSize, - pageNumber, - getInstrumentCriteriaRequestBody, - options, - ); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = - operationServerMap[ - "GetInstrumentsByCriteriaPaginatedApi.getInstrumentsByCriteriaPaginated" - ]?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => - createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration, - )(axios, localVarOperationServerBasePath || basePath); - }, - }; +export const GetInstrumentsByCriteriaPaginatedApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = GetInstrumentsByCriteriaPaginatedApiAxiosParamCreator(configuration) + return { + /** + * Get Instruments by Criteria Paginated + * @summary Get Instruments by Criteria Paginated + * @param {number} pageSize Page Size + * @param {number} pageNumber Page Number (1-based enumeration) + * @param {GetInstrumentCriteriaRequestBody} getInstrumentCriteriaRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getInstrumentsByCriteriaPaginated(pageSize: number, pageNumber: number, getInstrumentCriteriaRequestBody: GetInstrumentCriteriaRequestBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getInstrumentsByCriteriaPaginated(pageSize, pageNumber, getInstrumentCriteriaRequestBody, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['GetInstrumentsByCriteriaPaginatedApi.getInstrumentsByCriteriaPaginated']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } }; /** * GetInstrumentsByCriteriaPaginatedApi - factory interface * @export */ -export const GetInstrumentsByCriteriaPaginatedApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance, -) { - const localVarFp = GetInstrumentsByCriteriaPaginatedApiFp(configuration); - return { - /** - * Get Instruments by Criteria Paginated - * @summary Get Instruments by Criteria Paginated - * @param {number} pageSize Page Size - * @param {number} pageNumber Page Number (1-based enumeration) - * @param {GetInstrumentCriteriaRequestBody} getInstrumentCriteriaRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getInstrumentsByCriteriaPaginated( - pageSize: number, - pageNumber: number, - getInstrumentCriteriaRequestBody: GetInstrumentCriteriaRequestBody, - options?: RawAxiosRequestConfig, - ): AxiosPromise { - return localVarFp - .getInstrumentsByCriteriaPaginated( - pageSize, - pageNumber, - getInstrumentCriteriaRequestBody, - options, - ) - .then((request) => request(axios, basePath)); - }, - }; +export const GetInstrumentsByCriteriaPaginatedApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = GetInstrumentsByCriteriaPaginatedApiFp(configuration) + return { + /** + * Get Instruments by Criteria Paginated + * @summary Get Instruments by Criteria Paginated + * @param {number} pageSize Page Size + * @param {number} pageNumber Page Number (1-based enumeration) + * @param {GetInstrumentCriteriaRequestBody} getInstrumentCriteriaRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInstrumentsByCriteriaPaginated(pageSize: number, pageNumber: number, getInstrumentCriteriaRequestBody: GetInstrumentCriteriaRequestBody, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getInstrumentsByCriteriaPaginated(pageSize, pageNumber, getInstrumentCriteriaRequestBody, options).then((request) => request(axios, basePath)); + }, + }; }; /** @@ -233,29 +142,18 @@ export const GetInstrumentsByCriteriaPaginatedApiFactory = function ( * @extends {BaseAPI} */ export class GetInstrumentsByCriteriaPaginatedApi extends BaseAPI { - /** - * Get Instruments by Criteria Paginated - * @summary Get Instruments by Criteria Paginated - * @param {number} pageSize Page Size - * @param {number} pageNumber Page Number (1-based enumeration) - * @param {GetInstrumentCriteriaRequestBody} getInstrumentCriteriaRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof GetInstrumentsByCriteriaPaginatedApi - */ - public getInstrumentsByCriteriaPaginated( - pageSize: number, - pageNumber: number, - getInstrumentCriteriaRequestBody: GetInstrumentCriteriaRequestBody, - options?: RawAxiosRequestConfig, - ) { - return GetInstrumentsByCriteriaPaginatedApiFp(this.configuration) - .getInstrumentsByCriteriaPaginated( - pageSize, - pageNumber, - getInstrumentCriteriaRequestBody, - options, - ) - .then((request) => request(this.axios, this.basePath)); - } + /** + * Get Instruments by Criteria Paginated + * @summary Get Instruments by Criteria Paginated + * @param {number} pageSize Page Size + * @param {number} pageNumber Page Number (1-based enumeration) + * @param {GetInstrumentCriteriaRequestBody} getInstrumentCriteriaRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GetInstrumentsByCriteriaPaginatedApi + */ + public getInstrumentsByCriteriaPaginated(pageSize: number, pageNumber: number, getInstrumentCriteriaRequestBody: GetInstrumentCriteriaRequestBody, options?: RawAxiosRequestConfig) { + return GetInstrumentsByCriteriaPaginatedApiFp(this.configuration).getInstrumentsByCriteriaPaginated(pageSize, pageNumber, getInstrumentCriteriaRequestBody, options).then((request) => request(this.axios, this.basePath)); + } } + diff --git a/client/src/generated/api/get-user-profile-api.ts b/client/src/generated/api/get-user-profile-api.ts index b571146c..c89fa024 100644 --- a/client/src/generated/api/get-user-profile-api.ts +++ b/client/src/generated/api/get-user-profile-api.ts @@ -12,146 +12,97 @@ * Do not edit the class manually. */ -import type { Configuration } from "../configuration"; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; -import globalAxios from "axios"; + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore -import { - DUMMY_BASE_URL, - assertParamExists, - setApiKeyToObject, - setBasicAuthToObject, - setBearerAuthToObject, - setOAuthToObject, - setSearchParams, - serializeDataIfNeeded, - toPathString, - createRequestFunction, -} from "../common"; +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { - BASE_PATH, - COLLECTION_FORMATS, - type RequestArgs, - BaseAPI, - RequiredError, - operationServerMap, -} from "../base"; +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore -import type { ProfileDetails } from "../model"; +import type { ProfileDetails } from '../model'; // @ts-ignore -import type { ServerError } from "../model"; +import type { ServerError } from '../model'; /** * GetUserProfileApi - axios parameter creator * @export */ -export const GetUserProfileApiAxiosParamCreator = function ( - configuration?: Configuration, -) { - return { - /** - * Get User Profile - * @summary Get Profile Info - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getProfile: async ( - options: RawAxiosRequestConfig = {}, - ): Promise => { - const localVarPath = `/profile`; - // 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; - } +export const GetUserProfileApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Get User Profile + * @summary Get Profile Info + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getProfile: async (options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/profile`; + // 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; + 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, - }; - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - }; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } }; /** * GetUserProfileApi - functional programming interface * @export */ -export const GetUserProfileApiFp = function (configuration?: Configuration) { - const localVarAxiosParamCreator = - GetUserProfileApiAxiosParamCreator(configuration); - return { - /** - * Get User Profile - * @summary Get Profile Info - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getProfile( - options?: RawAxiosRequestConfig, - ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.getProfile(options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = - operationServerMap["GetUserProfileApi.getProfile"]?.[ - localVarOperationServerIndex - ]?.url; - return (axios, basePath) => - createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration, - )(axios, localVarOperationServerBasePath || basePath); - }, - }; +export const GetUserProfileApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = GetUserProfileApiAxiosParamCreator(configuration) + return { + /** + * Get User Profile + * @summary Get Profile Info + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getProfile(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProfile(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['GetUserProfileApi.getProfile']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } }; /** * GetUserProfileApi - factory interface * @export */ -export const GetUserProfileApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance, -) { - const localVarFp = GetUserProfileApiFp(configuration); - return { - /** - * Get User Profile - * @summary Get Profile Info - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getProfile(options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp - .getProfile(options) - .then((request) => request(axios, basePath)); - }, - }; +export const GetUserProfileApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = GetUserProfileApiFp(configuration) + return { + /** + * Get User Profile + * @summary Get Profile Info + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getProfile(options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getProfile(options).then((request) => request(axios, basePath)); + }, + }; }; /** @@ -161,16 +112,15 @@ export const GetUserProfileApiFactory = function ( * @extends {BaseAPI} */ export class GetUserProfileApi extends BaseAPI { - /** - * Get User Profile - * @summary Get Profile Info - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof GetUserProfileApi - */ - public getProfile(options?: RawAxiosRequestConfig) { - return GetUserProfileApiFp(this.configuration) - .getProfile(options) - .then((request) => request(this.axios, this.basePath)); - } + /** + * Get User Profile + * @summary Get Profile Info + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GetUserProfileApi + */ + public getProfile(options?: RawAxiosRequestConfig) { + return GetUserProfileApiFp(this.configuration).getProfile(options).then((request) => request(this.axios, this.basePath)); + } } + diff --git a/client/src/generated/api/list-favorite-api.ts b/client/src/generated/api/list-favorite-api.ts index cc210819..82b7e8a1 100644 --- a/client/src/generated/api/list-favorite-api.ts +++ b/client/src/generated/api/list-favorite-api.ts @@ -12,153 +12,99 @@ * Do not edit the class manually. */ -import type { Configuration } from "../configuration"; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; -import globalAxios from "axios"; + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore -import { - DUMMY_BASE_URL, - assertParamExists, - setApiKeyToObject, - setBasicAuthToObject, - setBearerAuthToObject, - setOAuthToObject, - setSearchParams, - serializeDataIfNeeded, - toPathString, - createRequestFunction, -} from "../common"; +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { - BASE_PATH, - COLLECTION_FORMATS, - type RequestArgs, - BaseAPI, - RequiredError, - operationServerMap, -} from "../base"; +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore -import type { ClientError } from "../model"; +import type { ClientError } from '../model'; // @ts-ignore -import type { ListFavoriteResponseBody } from "../model"; +import type { ListFavoriteResponseBody } from '../model'; // @ts-ignore -import type { ServerError } from "../model"; +import type { ServerError } from '../model'; /** * ListFavoriteApi - axios parameter creator * @export */ -export const ListFavoriteApiAxiosParamCreator = function ( - configuration?: Configuration, -) { - return { - /** - * List Favorite - * @summary List Favorite - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listFavorite: async ( - options: RawAxiosRequestConfig = {}, - ): Promise => { - const localVarPath = `/favorite/list`; - // 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; - } +export const ListFavoriteApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * List Favorite + * @summary List Favorite + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listFavorite: async (options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/favorite/list`; + // 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: "POST", - ...baseOptions, - ...options, - }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; + const localVarRequestOptions = { method: 'POST', ...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, - }; - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - }; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } }; /** * ListFavoriteApi - functional programming interface * @export */ -export const ListFavoriteApiFp = function (configuration?: Configuration) { - const localVarAxiosParamCreator = - ListFavoriteApiAxiosParamCreator(configuration); - return { - /** - * List Favorite - * @summary List Favorite - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async listFavorite( - options?: RawAxiosRequestConfig, - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string, - ) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.listFavorite(options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = - operationServerMap["ListFavoriteApi.listFavorite"]?.[ - localVarOperationServerIndex - ]?.url; - return (axios, basePath) => - createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration, - )(axios, localVarOperationServerBasePath || basePath); - }, - }; +export const ListFavoriteApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = ListFavoriteApiAxiosParamCreator(configuration) + return { + /** + * List Favorite + * @summary List Favorite + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listFavorite(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listFavorite(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ListFavoriteApi.listFavorite']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } }; /** * ListFavoriteApi - factory interface * @export */ -export const ListFavoriteApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance, -) { - const localVarFp = ListFavoriteApiFp(configuration); - return { - /** - * List Favorite - * @summary List Favorite - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listFavorite( - options?: RawAxiosRequestConfig, - ): AxiosPromise { - return localVarFp - .listFavorite(options) - .then((request) => request(axios, basePath)); - }, - }; +export const ListFavoriteApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = ListFavoriteApiFp(configuration) + return { + /** + * List Favorite + * @summary List Favorite + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listFavorite(options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.listFavorite(options).then((request) => request(axios, basePath)); + }, + }; }; /** @@ -168,16 +114,15 @@ export const ListFavoriteApiFactory = function ( * @extends {BaseAPI} */ export class ListFavoriteApi extends BaseAPI { - /** - * List Favorite - * @summary List Favorite - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ListFavoriteApi - */ - public listFavorite(options?: RawAxiosRequestConfig) { - return ListFavoriteApiFp(this.configuration) - .listFavorite(options) - .then((request) => request(this.axios, this.basePath)); - } + /** + * List Favorite + * @summary List Favorite + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ListFavoriteApi + */ + public listFavorite(options?: RawAxiosRequestConfig) { + return ListFavoriteApiFp(this.configuration).listFavorite(options).then((request) => request(this.axios, this.basePath)); + } } + diff --git a/client/src/generated/api/remove-favorite-api.ts b/client/src/generated/api/remove-favorite-api.ts index c561482d..f6c13fb1 100644 --- a/client/src/generated/api/remove-favorite-api.ts +++ b/client/src/generated/api/remove-favorite-api.ts @@ -12,171 +12,107 @@ * Do not edit the class manually. */ -import type { Configuration } from "../configuration"; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; -import globalAxios from "axios"; + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore -import { - DUMMY_BASE_URL, - assertParamExists, - setApiKeyToObject, - setBasicAuthToObject, - setBearerAuthToObject, - setOAuthToObject, - setSearchParams, - serializeDataIfNeeded, - toPathString, - createRequestFunction, -} from "../common"; +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { - BASE_PATH, - COLLECTION_FORMATS, - type RequestArgs, - BaseAPI, - RequiredError, - operationServerMap, -} from "../base"; +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore -import type { ClientError } from "../model"; +import type { ClientError } from '../model'; // @ts-ignore -import type { RemoveFavoriteRequestBody } from "../model"; +import type { RemoveFavoriteRequestBody } from '../model'; // @ts-ignore -import type { ServerError } from "../model"; +import type { ServerError } from '../model'; /** * RemoveFavoriteApi - axios parameter creator * @export */ -export const RemoveFavoriteApiAxiosParamCreator = function ( - configuration?: Configuration, -) { - return { - /** - * Remove Favorite - * @summary Remove Favorite - * @param {RemoveFavoriteRequestBody} removeFavoriteRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - removeFavorite: async ( - removeFavoriteRequestBody: RemoveFavoriteRequestBody, - options: RawAxiosRequestConfig = {}, - ): Promise => { - // verify required parameter 'removeFavoriteRequestBody' is not null or undefined - assertParamExists( - "removeFavorite", - "removeFavoriteRequestBody", - removeFavoriteRequestBody, - ); - const localVarPath = `/favorite/remove`; - // 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; - } +export const RemoveFavoriteApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Remove Favorite + * @summary Remove Favorite + * @param {RemoveFavoriteRequestBody} removeFavoriteRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + removeFavorite: async (removeFavoriteRequestBody: RemoveFavoriteRequestBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'removeFavoriteRequestBody' is not null or undefined + assertParamExists('removeFavorite', 'removeFavoriteRequestBody', removeFavoriteRequestBody) + const localVarPath = `/favorite/remove`; + // 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: "POST", - ...baseOptions, - ...options, - }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; - localVarHeaderParameter["Content-Type"] = "application/json"; - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - localVarRequestOptions.data = serializeDataIfNeeded( - removeFavoriteRequestBody, - localVarRequestOptions, - configuration, - ); + + localVarHeaderParameter['Content-Type'] = 'application/json'; - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - }; + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(removeFavoriteRequestBody, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } }; /** * RemoveFavoriteApi - functional programming interface * @export */ -export const RemoveFavoriteApiFp = function (configuration?: Configuration) { - const localVarAxiosParamCreator = - RemoveFavoriteApiAxiosParamCreator(configuration); - return { - /** - * Remove Favorite - * @summary Remove Favorite - * @param {RemoveFavoriteRequestBody} removeFavoriteRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async removeFavorite( - removeFavoriteRequestBody: RemoveFavoriteRequestBody, - options?: RawAxiosRequestConfig, - ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.removeFavorite( - removeFavoriteRequestBody, - options, - ); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = - operationServerMap["RemoveFavoriteApi.removeFavorite"]?.[ - localVarOperationServerIndex - ]?.url; - return (axios, basePath) => - createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration, - )(axios, localVarOperationServerBasePath || basePath); - }, - }; +export const RemoveFavoriteApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = RemoveFavoriteApiAxiosParamCreator(configuration) + return { + /** + * Remove Favorite + * @summary Remove Favorite + * @param {RemoveFavoriteRequestBody} removeFavoriteRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async removeFavorite(removeFavoriteRequestBody: RemoveFavoriteRequestBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.removeFavorite(removeFavoriteRequestBody, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['RemoveFavoriteApi.removeFavorite']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } }; /** * RemoveFavoriteApi - factory interface * @export */ -export const RemoveFavoriteApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance, -) { - const localVarFp = RemoveFavoriteApiFp(configuration); - return { - /** - * Remove Favorite - * @summary Remove Favorite - * @param {RemoveFavoriteRequestBody} removeFavoriteRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - removeFavorite( - removeFavoriteRequestBody: RemoveFavoriteRequestBody, - options?: RawAxiosRequestConfig, - ): AxiosPromise { - return localVarFp - .removeFavorite(removeFavoriteRequestBody, options) - .then((request) => request(axios, basePath)); - }, - }; +export const RemoveFavoriteApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = RemoveFavoriteApiFp(configuration) + return { + /** + * Remove Favorite + * @summary Remove Favorite + * @param {RemoveFavoriteRequestBody} removeFavoriteRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + removeFavorite(removeFavoriteRequestBody: RemoveFavoriteRequestBody, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.removeFavorite(removeFavoriteRequestBody, options).then((request) => request(axios, basePath)); + }, + }; }; /** @@ -186,20 +122,16 @@ export const RemoveFavoriteApiFactory = function ( * @extends {BaseAPI} */ export class RemoveFavoriteApi extends BaseAPI { - /** - * Remove Favorite - * @summary Remove Favorite - * @param {RemoveFavoriteRequestBody} removeFavoriteRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RemoveFavoriteApi - */ - public removeFavorite( - removeFavoriteRequestBody: RemoveFavoriteRequestBody, - options?: RawAxiosRequestConfig, - ) { - return RemoveFavoriteApiFp(this.configuration) - .removeFavorite(removeFavoriteRequestBody, options) - .then((request) => request(this.axios, this.basePath)); - } + /** + * Remove Favorite + * @summary Remove Favorite + * @param {RemoveFavoriteRequestBody} removeFavoriteRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RemoveFavoriteApi + */ + public removeFavorite(removeFavoriteRequestBody: RemoveFavoriteRequestBody, options?: RawAxiosRequestConfig) { + return RemoveFavoriteApiFp(this.configuration).removeFavorite(removeFavoriteRequestBody, options).then((request) => request(this.axios, this.basePath)); + } } + diff --git a/client/src/generated/api/user-registration-api.ts b/client/src/generated/api/user-registration-api.ts index 0c151b7e..d321fb27 100644 --- a/client/src/generated/api/user-registration-api.ts +++ b/client/src/generated/api/user-registration-api.ts @@ -12,170 +12,105 @@ * Do not edit the class manually. */ -import type { Configuration } from "../configuration"; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; -import globalAxios from "axios"; + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore -import { - DUMMY_BASE_URL, - assertParamExists, - setApiKeyToObject, - setBasicAuthToObject, - setBearerAuthToObject, - setOAuthToObject, - setSearchParams, - serializeDataIfNeeded, - toPathString, - createRequestFunction, -} from "../common"; +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { - BASE_PATH, - COLLECTION_FORMATS, - type RequestArgs, - BaseAPI, - RequiredError, - operationServerMap, -} from "../base"; +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore -import type { RegistrationRequest } from "../model"; +import type { RegistrationRequest } from '../model'; // @ts-ignore -import type { ServerError } from "../model"; +import type { ServerError } from '../model'; /** * UserRegistrationApi - axios parameter creator * @export */ -export const UserRegistrationApiAxiosParamCreator = function ( - configuration?: Configuration, -) { - return { - /** - * Register User - * @summary User Registration - * @param {RegistrationRequest} registrationRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - userRegistration: async ( - registrationRequest: RegistrationRequest, - options: RawAxiosRequestConfig = {}, - ): Promise => { - // verify required parameter 'registrationRequest' is not null or undefined - assertParamExists( - "userRegistration", - "registrationRequest", - registrationRequest, - ); - const localVarPath = `/registration`; - // 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; - } +export const UserRegistrationApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Register User + * @summary User Registration + * @param {RegistrationRequest} registrationRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userRegistration: async (registrationRequest: RegistrationRequest, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'registrationRequest' is not null or undefined + assertParamExists('userRegistration', 'registrationRequest', registrationRequest) + const localVarPath = `/registration`; + // 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: "POST", - ...baseOptions, - ...options, - }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; - localVarHeaderParameter["Content-Type"] = "application/json"; - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - localVarRequestOptions.data = serializeDataIfNeeded( - registrationRequest, - localVarRequestOptions, - configuration, - ); + + localVarHeaderParameter['Content-Type'] = 'application/json'; - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - }; + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(registrationRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } }; /** * UserRegistrationApi - functional programming interface * @export */ -export const UserRegistrationApiFp = function (configuration?: Configuration) { - const localVarAxiosParamCreator = - UserRegistrationApiAxiosParamCreator(configuration); - return { - /** - * Register User - * @summary User Registration - * @param {RegistrationRequest} registrationRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async userRegistration( - registrationRequest: RegistrationRequest, - options?: RawAxiosRequestConfig, - ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.userRegistration( - registrationRequest, - options, - ); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = - operationServerMap["UserRegistrationApi.userRegistration"]?.[ - localVarOperationServerIndex - ]?.url; - return (axios, basePath) => - createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration, - )(axios, localVarOperationServerBasePath || basePath); - }, - }; +export const UserRegistrationApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = UserRegistrationApiAxiosParamCreator(configuration) + return { + /** + * Register User + * @summary User Registration + * @param {RegistrationRequest} registrationRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async userRegistration(registrationRequest: RegistrationRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.userRegistration(registrationRequest, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['UserRegistrationApi.userRegistration']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } }; /** * UserRegistrationApi - factory interface * @export */ -export const UserRegistrationApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance, -) { - const localVarFp = UserRegistrationApiFp(configuration); - return { - /** - * Register User - * @summary User Registration - * @param {RegistrationRequest} registrationRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - userRegistration( - registrationRequest: RegistrationRequest, - options?: RawAxiosRequestConfig, - ): AxiosPromise { - return localVarFp - .userRegistration(registrationRequest, options) - .then((request) => request(axios, basePath)); - }, - }; +export const UserRegistrationApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = UserRegistrationApiFp(configuration) + return { + /** + * Register User + * @summary User Registration + * @param {RegistrationRequest} registrationRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userRegistration(registrationRequest: RegistrationRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.userRegistration(registrationRequest, options).then((request) => request(axios, basePath)); + }, + }; }; /** @@ -185,20 +120,16 @@ export const UserRegistrationApiFactory = function ( * @extends {BaseAPI} */ export class UserRegistrationApi extends BaseAPI { - /** - * Register User - * @summary User Registration - * @param {RegistrationRequest} registrationRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UserRegistrationApi - */ - public userRegistration( - registrationRequest: RegistrationRequest, - options?: RawAxiosRequestConfig, - ) { - return UserRegistrationApiFp(this.configuration) - .userRegistration(registrationRequest, options) - .then((request) => request(this.axios, this.basePath)); - } + /** + * Register User + * @summary User Registration + * @param {RegistrationRequest} registrationRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserRegistrationApi + */ + public userRegistration(registrationRequest: RegistrationRequest, options?: RawAxiosRequestConfig) { + return UserRegistrationApiFp(this.configuration).userRegistration(registrationRequest, options).then((request) => request(this.axios, this.basePath)); + } } + diff --git a/client/src/generated/base.ts b/client/src/generated/base.ts index 15c4c9d8..22fbb303 100644 --- a/client/src/generated/base.ts +++ b/client/src/generated/base.ts @@ -12,11 +12,12 @@ * Do not edit the class manually. */ -import type { Configuration } from "./configuration"; + +import type { Configuration } from './configuration'; // Some imports not used depending on template conditions // @ts-ignore -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; -import globalAxios from "axios"; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; export const BASE_PATH = "http://localhost:8080/api".replace(/\/+$/, ""); @@ -25,10 +26,10 @@ export const BASE_PATH = "http://localhost:8080/api".replace(/\/+$/, ""); * @export */ export const COLLECTION_FORMATS = { - csv: ",", - ssv: " ", - tsv: "\t", - pipes: "|", + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", }; /** @@ -37,8 +38,8 @@ export const COLLECTION_FORMATS = { * @interface RequestArgs */ export interface RequestArgs { - url: string; - options: RawAxiosRequestConfig; + url: string; + options: RawAxiosRequestConfig; } /** @@ -47,19 +48,15 @@ export interface RequestArgs { * @class BaseAPI */ export class BaseAPI { - protected configuration: Configuration | undefined; + protected configuration: Configuration | undefined; - constructor( - configuration?: Configuration, - protected basePath: string = BASE_PATH, - protected axios: AxiosInstance = globalAxios, - ) { - if (configuration) { - this.configuration = configuration; - this.basePath = configuration.basePath ?? basePath; + constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) { + if (configuration) { + this.configuration = configuration; + this.basePath = configuration.basePath ?? basePath; + } } - } -} +}; /** * @@ -68,24 +65,22 @@ export class BaseAPI { * @extends {Error} */ export class RequiredError extends Error { - constructor( - public field: string, - msg?: string, - ) { - super(msg); - this.name = "RequiredError"; - } + constructor(public field: string, msg?: string) { + super(msg); + this.name = "RequiredError" + } } interface ServerMap { - [key: string]: { - url: string; - description: string; - }[]; + [key: string]: { + url: string, + description: string, + }[]; } /** * * @export */ -export const operationServerMap: ServerMap = {}; +export const operationServerMap: ServerMap = { +} diff --git a/client/src/generated/common.ts b/client/src/generated/common.ts index 4b31eed7..6620ffaf 100644 --- a/client/src/generated/common.ts +++ b/client/src/generated/common.ts @@ -12,132 +12,98 @@ * Do not edit the class manually. */ + import type { Configuration } from "./configuration"; import type { RequestArgs } from "./base"; -import type { AxiosInstance, AxiosResponse } from "axios"; +import type { AxiosInstance, AxiosResponse } from 'axios'; import { RequiredError } from "./base"; /** * * @export */ -export const DUMMY_BASE_URL = "https://example.com"; +export const DUMMY_BASE_URL = 'https://example.com' /** * * @throws {RequiredError} * @export */ -export const assertParamExists = function ( - functionName: string, - paramName: string, - paramValue: unknown, -) { - if (paramValue === null || paramValue === undefined) { - throw new RequiredError( - paramName, - `Required parameter ${paramName} was null or undefined when calling ${functionName}.`, - ); - } -}; +export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) { + if (paramValue === null || paramValue === undefined) { + throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`); + } +} /** * * @export */ -export const setApiKeyToObject = async function ( - object: any, - keyParamName: string, - configuration?: Configuration, -) { - if (configuration && configuration.apiKey) { - const localVarApiKeyValue = - typeof configuration.apiKey === "function" - ? await configuration.apiKey(keyParamName) - : await configuration.apiKey; - object[keyParamName] = localVarApiKeyValue; - } -}; +export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) { + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? await configuration.apiKey(keyParamName) + : await configuration.apiKey; + object[keyParamName] = localVarApiKeyValue; + } +} /** * * @export */ -export const setBasicAuthToObject = function ( - object: any, - configuration?: Configuration, -) { - if (configuration && (configuration.username || configuration.password)) { - object["auth"] = { - username: configuration.username, - password: configuration.password, - }; - } -}; +export const setBasicAuthToObject = function (object: any, configuration?: Configuration) { + if (configuration && (configuration.username || configuration.password)) { + object["auth"] = { username: configuration.username, password: configuration.password }; + } +} /** * * @export */ -export const setBearerAuthToObject = async function ( - object: any, - configuration?: Configuration, -) { - if (configuration && configuration.accessToken) { - const accessToken = - typeof configuration.accessToken === "function" - ? await configuration.accessToken() - : await configuration.accessToken; - object["Authorization"] = "Bearer " + accessToken; - } -}; +export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const accessToken = typeof configuration.accessToken === 'function' + ? await configuration.accessToken() + : await configuration.accessToken; + object["Authorization"] = "Bearer " + accessToken; + } +} /** * * @export */ -export const setOAuthToObject = async function ( - object: any, - name: string, - scopes: string[], - configuration?: Configuration, -) { - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = - typeof configuration.accessToken === "function" - ? await configuration.accessToken(name, scopes) - : await configuration.accessToken; - object["Authorization"] = "Bearer " + localVarAccessTokenValue; - } -}; - -function setFlattenedQueryParams( - urlSearchParams: URLSearchParams, - parameter: any, - key: string = "", -): void { - if (parameter == null) return; - if (typeof parameter === "object") { - if (Array.isArray(parameter)) { - (parameter as any[]).forEach((item) => - setFlattenedQueryParams(urlSearchParams, item, key), - ); - } else { - Object.keys(parameter).forEach((currentKey) => - setFlattenedQueryParams( - urlSearchParams, - parameter[currentKey], - `${key}${key !== "" ? "." : ""}${currentKey}`, - ), - ); +export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? await configuration.accessToken(name, scopes) + : await configuration.accessToken; + object["Authorization"] = "Bearer " + localVarAccessTokenValue; } - } else { - if (urlSearchParams.has(key)) { - urlSearchParams.append(key, parameter); - } else { - urlSearchParams.set(key, parameter); +} + +function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void { + if (parameter == null) return; + if (typeof parameter === "object") { + if (Array.isArray(parameter)) { + (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key)); + } + else { + Object.keys(parameter).forEach(currentKey => + setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`) + ); + } + } + else { + if (urlSearchParams.has(key)) { + urlSearchParams.append(key, parameter); + } + else { + urlSearchParams.set(key, parameter); + } } - } } /** @@ -145,58 +111,40 @@ function setFlattenedQueryParams( * @export */ export const setSearchParams = function (url: URL, ...objects: any[]) { - const searchParams = new URLSearchParams(url.search); - setFlattenedQueryParams(searchParams, objects); - url.search = searchParams.toString(); -}; + const searchParams = new URLSearchParams(url.search); + setFlattenedQueryParams(searchParams, objects); + url.search = searchParams.toString(); +} /** * * @export */ -export const serializeDataIfNeeded = function ( - value: any, - requestOptions: any, - configuration?: Configuration, -) { - const nonString = typeof value !== "string"; - const needsSerialization = - nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(requestOptions.headers["Content-Type"]) - : nonString; - return needsSerialization - ? JSON.stringify(value !== undefined ? value : {}) - : value || ""; -}; +export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) { + const nonString = typeof value !== 'string'; + const needsSerialization = nonString && configuration && configuration.isJsonMime + ? configuration.isJsonMime(requestOptions.headers['Content-Type']) + : nonString; + return needsSerialization + ? JSON.stringify(value !== undefined ? value : {}) + : (value || ""); +} /** * * @export */ export const toPathString = function (url: URL) { - return url.pathname + url.search + url.hash; -}; + return url.pathname + url.search + url.hash +} /** * * @export */ -export const createRequestFunction = function ( - axiosArgs: RequestArgs, - globalAxios: AxiosInstance, - BASE_PATH: string, - configuration?: Configuration, -) { - return >( - axios: AxiosInstance = globalAxios, - basePath: string = BASE_PATH, - ) => { - const axiosRequestArgs = { - ...axiosArgs.options, - url: - (axios.defaults.baseURL ? "" : (configuration?.basePath ?? basePath)) + - axiosArgs.url, +export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { + return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url}; + return axios.request(axiosRequestArgs); }; - return axios.request(axiosRequestArgs); - }; -}; +} diff --git a/client/src/generated/configuration.ts b/client/src/generated/configuration.ts index f77a0ed9..4e533bd9 100644 --- a/client/src/generated/configuration.ts +++ b/client/src/generated/configuration.ts @@ -12,121 +12,99 @@ * Do not edit the class manually. */ + export interface ConfigurationParameters { - apiKey?: - | string - | Promise - | ((name: string) => string) - | ((name: string) => Promise); - username?: string; - password?: string; - accessToken?: - | string - | Promise - | ((name?: string, scopes?: string[]) => string) - | ((name?: string, scopes?: string[]) => Promise); - basePath?: string; - serverIndex?: number; - baseOptions?: any; - formDataCtor?: new () => any; + apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); + username?: string; + password?: string; + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); + basePath?: string; + serverIndex?: number; + baseOptions?: any; + formDataCtor?: new () => any; } export class Configuration { - /** - * parameter for apiKey security - * @param name security name - * @memberof Configuration - */ - apiKey?: - | string - | Promise - | ((name: string) => string) - | ((name: string) => Promise); - /** - * parameter for basic security - * - * @type {string} - * @memberof Configuration - */ - username?: string; - /** - * parameter for basic security - * - * @type {string} - * @memberof Configuration - */ - password?: string; - /** - * parameter for oauth2 security - * @param name security name - * @param scopes oauth2 scope - * @memberof Configuration - */ - accessToken?: - | string - | Promise - | ((name?: string, scopes?: string[]) => string) - | ((name?: string, scopes?: string[]) => Promise); - /** - * override base path - * - * @type {string} - * @memberof Configuration - */ - basePath?: string; - /** - * override server index - * - * @type {number} - * @memberof Configuration - */ - serverIndex?: number; - /** - * base options for axios calls - * - * @type {any} - * @memberof Configuration - */ - baseOptions?: any; - /** - * The FormData constructor that will be used to create multipart form data - * requests. You can inject this here so that execution environments that - * do not support the FormData class can still run the generated client. - * - * @type {new () => FormData} - */ - formDataCtor?: new () => any; + /** + * parameter for apiKey security + * @param name security name + * @memberof Configuration + */ + apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + username?: string; + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + password?: string; + /** + * parameter for oauth2 security + * @param name security name + * @param scopes oauth2 scope + * @memberof Configuration + */ + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); + /** + * override base path + * + * @type {string} + * @memberof Configuration + */ + basePath?: string; + /** + * override server index + * + * @type {number} + * @memberof Configuration + */ + serverIndex?: number; + /** + * base options for axios calls + * + * @type {any} + * @memberof Configuration + */ + baseOptions?: any; + /** + * The FormData constructor that will be used to create multipart form data + * requests. You can inject this here so that execution environments that + * do not support the FormData class can still run the generated client. + * + * @type {new () => FormData} + */ + formDataCtor?: new () => any; - constructor(param: ConfigurationParameters = {}) { - this.apiKey = param.apiKey; - this.username = param.username; - this.password = param.password; - this.accessToken = param.accessToken; - this.basePath = param.basePath; - this.serverIndex = param.serverIndex; - this.baseOptions = param.baseOptions; - this.formDataCtor = param.formDataCtor; - } + constructor(param: ConfigurationParameters = {}) { + this.apiKey = param.apiKey; + this.username = param.username; + this.password = param.password; + this.accessToken = param.accessToken; + this.basePath = param.basePath; + this.serverIndex = param.serverIndex; + this.baseOptions = param.baseOptions; + this.formDataCtor = param.formDataCtor; + } - /** - * Check if the given MIME is a JSON MIME. - * JSON MIME examples: - * application/json - * application/json; charset=UTF8 - * APPLICATION/JSON - * application/vnd.company+json - * @param mime - MIME (Multipurpose Internet Mail Extensions) - * @return True if the given MIME is JSON, false otherwise. - */ - public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp( - "^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$", - "i", - ); - return ( - mime !== null && - (jsonMime.test(mime) || - mime.toLowerCase() === "application/json-patch+json") - ); - } + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); + return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } } diff --git a/client/src/generated/index.ts b/client/src/generated/index.ts index 9b106d3e..f096401e 100644 --- a/client/src/generated/index.ts +++ b/client/src/generated/index.ts @@ -12,6 +12,7 @@ * Do not edit the class manually. */ + export * from "./api"; export * from "./configuration"; export * from "./model"; diff --git a/client/src/generated/model/add-favorite-request-body.ts b/client/src/generated/model/add-favorite-request-body.ts index b8d9d386..fd22b036 100644 --- a/client/src/generated/model/add-favorite-request-body.ts +++ b/client/src/generated/model/add-favorite-request-body.ts @@ -12,16 +12,19 @@ * Do not edit the class manually. */ + + /** - * + * * @export * @interface AddFavoriteRequestBody */ export interface AddFavoriteRequestBody { - /** - * - * @type {number} - * @memberof AddFavoriteRequestBody - */ - instrument_id: number; + /** + * + * @type {number} + * @memberof AddFavoriteRequestBody + */ + 'instrument_id': number; } + diff --git a/client/src/generated/model/client-error.ts b/client/src/generated/model/client-error.ts index f19c4775..07ee85ab 100644 --- a/client/src/generated/model/client-error.ts +++ b/client/src/generated/model/client-error.ts @@ -12,16 +12,19 @@ * Do not edit the class manually. */ + + /** - * + * * @export * @interface ClientError */ export interface ClientError { - /** - * Error description - * @type {string} - * @memberof ClientError - */ - message: string; + /** + * Error description + * @type {string} + * @memberof ClientError + */ + 'message': string; } + diff --git a/client/src/generated/model/get-instrument-basic-materials-response.ts b/client/src/generated/model/get-instrument-basic-materials-response.ts index 036e22db..390c5ed2 100644 --- a/client/src/generated/model/get-instrument-basic-materials-response.ts +++ b/client/src/generated/model/get-instrument-basic-materials-response.ts @@ -12,20 +12,22 @@ * Do not edit the class manually. */ + // May contain unused imports in some cases // @ts-ignore -import type { InstrumentBasicMaterial } from "./instrument-basic-material"; +import type { InstrumentBasicMaterial } from './instrument-basic-material'; /** - * + * * @export * @interface GetInstrumentBasicMaterialsResponse */ export interface GetInstrumentBasicMaterialsResponse { - /** - * - * @type {Array} - * @memberof GetInstrumentBasicMaterialsResponse - */ - content: Array; + /** + * + * @type {Array} + * @memberof GetInstrumentBasicMaterialsResponse + */ + 'content': Array; } + diff --git a/client/src/generated/model/get-instrument-by-criteria-page-response.ts b/client/src/generated/model/get-instrument-by-criteria-page-response.ts index 335daef2..4084033a 100644 --- a/client/src/generated/model/get-instrument-by-criteria-page-response.ts +++ b/client/src/generated/model/get-instrument-by-criteria-page-response.ts @@ -12,50 +12,52 @@ * Do not edit the class manually. */ + // May contain unused imports in some cases // @ts-ignore -import type { InstrumentDetail } from "./instrument-detail"; +import type { InstrumentDetail } from './instrument-detail'; /** - * + * * @export * @interface GetInstrumentByCriteriaPageResponse */ export interface GetInstrumentByCriteriaPageResponse { - /** - * - * @type {Array} - * @memberof GetInstrumentByCriteriaPageResponse - */ - content: Array; - /** - * The number of items in the content. - * @type {number} - * @memberof GetInstrumentByCriteriaPageResponse - */ - content_size: number; - /** - * The number of items per page. - * @type {number} - * @memberof GetInstrumentByCriteriaPageResponse - */ - page_size: number; - /** - * The current page number (0-based index). - * @type {number} - * @memberof GetInstrumentByCriteriaPageResponse - */ - page_number: number; - /** - * The total number of elements across all pages. - * @type {number} - * @memberof GetInstrumentByCriteriaPageResponse - */ - total_elements: number; - /** - * The total number of pages. - * @type {number} - * @memberof GetInstrumentByCriteriaPageResponse - */ - total_pages: number; + /** + * + * @type {Array} + * @memberof GetInstrumentByCriteriaPageResponse + */ + 'content': Array; + /** + * The number of items in the content. + * @type {number} + * @memberof GetInstrumentByCriteriaPageResponse + */ + 'content_size': number; + /** + * The number of items per page. + * @type {number} + * @memberof GetInstrumentByCriteriaPageResponse + */ + 'page_size': number; + /** + * The current page number (0-based index). + * @type {number} + * @memberof GetInstrumentByCriteriaPageResponse + */ + 'page_number': number; + /** + * The total number of elements across all pages. + * @type {number} + * @memberof GetInstrumentByCriteriaPageResponse + */ + 'total_elements': number; + /** + * The total number of pages. + * @type {number} + * @memberof GetInstrumentByCriteriaPageResponse + */ + 'total_pages': number; } + diff --git a/client/src/generated/model/get-instrument-criteria-request-body.ts b/client/src/generated/model/get-instrument-criteria-request-body.ts index c45e9bfd..784163be 100644 --- a/client/src/generated/model/get-instrument-criteria-request-body.ts +++ b/client/src/generated/model/get-instrument-criteria-request-body.ts @@ -12,70 +12,73 @@ * Do not edit the class manually. */ + + /** - * + * * @export * @interface GetInstrumentCriteriaRequestBody */ export interface GetInstrumentCriteriaRequestBody { - /** - * - * @type {string} - * @memberof GetInstrumentCriteriaRequestBody - */ - instrument_name?: string; - /** - * - * @type {Array} - * @memberof GetInstrumentCriteriaRequestBody - */ - instrument_types?: Array; - /** - * - * @type {Array} - * @memberof GetInstrumentCriteriaRequestBody - */ - manufacturer_names?: Array; - /** - * - * @type {string} - * @memberof GetInstrumentCriteriaRequestBody - */ - manufacture_date_from?: string; - /** - * - * @type {string} - * @memberof GetInstrumentCriteriaRequestBody - */ - manufacture_date_to?: string; - /** - * - * @type {string} - * @memberof GetInstrumentCriteriaRequestBody - */ - release_date_from?: string; - /** - * - * @type {string} - * @memberof GetInstrumentCriteriaRequestBody - */ - release_date_to?: string; - /** - * - * @type {Array} - * @memberof GetInstrumentCriteriaRequestBody - */ - countries?: Array; - /** - * - * @type {Array} - * @memberof GetInstrumentCriteriaRequestBody - */ - materials?: Array; - /** - * - * @type {Array} - * @memberof GetInstrumentCriteriaRequestBody - */ - instrument_ids?: Array; + /** + * + * @type {string} + * @memberof GetInstrumentCriteriaRequestBody + */ + 'instrument_name'?: string; + /** + * + * @type {Array} + * @memberof GetInstrumentCriteriaRequestBody + */ + 'instrument_types'?: Array; + /** + * + * @type {Array} + * @memberof GetInstrumentCriteriaRequestBody + */ + 'manufacturer_names'?: Array; + /** + * + * @type {string} + * @memberof GetInstrumentCriteriaRequestBody + */ + 'manufacture_date_from'?: string; + /** + * + * @type {string} + * @memberof GetInstrumentCriteriaRequestBody + */ + 'manufacture_date_to'?: string; + /** + * + * @type {string} + * @memberof GetInstrumentCriteriaRequestBody + */ + 'release_date_from'?: string; + /** + * + * @type {string} + * @memberof GetInstrumentCriteriaRequestBody + */ + 'release_date_to'?: string; + /** + * + * @type {Array} + * @memberof GetInstrumentCriteriaRequestBody + */ + 'countries'?: Array; + /** + * + * @type {Array} + * @memberof GetInstrumentCriteriaRequestBody + */ + 'materials'?: Array; + /** + * + * @type {Array} + * @memberof GetInstrumentCriteriaRequestBody + */ + 'instrument_ids'?: Array; } + diff --git a/client/src/generated/model/get-instrument-types-response.ts b/client/src/generated/model/get-instrument-types-response.ts index 7c41fbdd..33532332 100644 --- a/client/src/generated/model/get-instrument-types-response.ts +++ b/client/src/generated/model/get-instrument-types-response.ts @@ -12,20 +12,22 @@ * Do not edit the class manually. */ + // May contain unused imports in some cases // @ts-ignore -import type { InstrumentType } from "./instrument-type"; +import type { InstrumentType } from './instrument-type'; /** - * + * * @export * @interface GetInstrumentTypesResponse */ export interface GetInstrumentTypesResponse { - /** - * - * @type {Array} - * @memberof GetInstrumentTypesResponse - */ - content: Array; + /** + * + * @type {Array} + * @memberof GetInstrumentTypesResponse + */ + 'content': Array; } + diff --git a/client/src/generated/model/get-instruments-by-criteria-response.ts b/client/src/generated/model/get-instruments-by-criteria-response.ts index a89e17d0..cf965e12 100644 --- a/client/src/generated/model/get-instruments-by-criteria-response.ts +++ b/client/src/generated/model/get-instruments-by-criteria-response.ts @@ -12,20 +12,22 @@ * Do not edit the class manually. */ + // May contain unused imports in some cases // @ts-ignore -import type { InstrumentDetail } from "./instrument-detail"; +import type { InstrumentDetail } from './instrument-detail'; /** - * + * * @export * @interface GetInstrumentsByCriteriaResponse */ export interface GetInstrumentsByCriteriaResponse { - /** - * - * @type {Array} - * @memberof GetInstrumentsByCriteriaResponse - */ - content: Array; + /** + * + * @type {Array} + * @memberof GetInstrumentsByCriteriaResponse + */ + 'content': Array; } + diff --git a/client/src/generated/model/index.ts b/client/src/generated/model/index.ts index 9fea743d..4b1c40a1 100644 --- a/client/src/generated/model/index.ts +++ b/client/src/generated/model/index.ts @@ -1,17 +1,19 @@ -export * from "./add-favorite-request-body"; -export * from "./client-error"; -export * from "./get-instrument-basic-materials-response"; -export * from "./get-instrument-by-criteria-page-response"; -export * from "./get-instrument-criteria-request-body"; -export * from "./get-instrument-types-response"; -export * from "./get-instruments-by-criteria-response"; -export * from "./instrument-basic-material"; -export * from "./instrument-detail"; -export * from "./instrument-type"; -export * from "./jwt-response"; -export * from "./list-favorite-response-body"; -export * from "./profile-details"; -export * from "./registration-request"; -export * from "./remove-favorite-request-body"; -export * from "./server-error"; -export * from "./username-and-password-request-body"; +export * from './add-favorite-request-body'; +export * from './client-error'; +export * from './country'; +export * from './get-countries-response'; +export * from './get-instrument-basic-materials-response'; +export * from './get-instrument-by-criteria-page-response'; +export * from './get-instrument-criteria-request-body'; +export * from './get-instrument-types-response'; +export * from './get-instruments-by-criteria-response'; +export * from './instrument-basic-material'; +export * from './instrument-detail'; +export * from './instrument-type'; +export * from './jwt-response'; +export * from './list-favorite-response-body'; +export * from './profile-details'; +export * from './registration-request'; +export * from './remove-favorite-request-body'; +export * from './server-error'; +export * from './username-and-password-request-body'; diff --git a/client/src/generated/model/instrument-basic-material.ts b/client/src/generated/model/instrument-basic-material.ts index f45d49b0..24bb7e18 100644 --- a/client/src/generated/model/instrument-basic-material.ts +++ b/client/src/generated/model/instrument-basic-material.ts @@ -12,16 +12,19 @@ * Do not edit the class manually. */ + + /** - * + * * @export * @interface InstrumentBasicMaterial */ export interface InstrumentBasicMaterial { - /** - * - * @type {string} - * @memberof InstrumentBasicMaterial - */ - basic_material: string; + /** + * + * @type {string} + * @memberof InstrumentBasicMaterial + */ + 'basic_material': string; } + diff --git a/client/src/generated/model/instrument-detail.ts b/client/src/generated/model/instrument-detail.ts index cbb904a5..251e001f 100644 --- a/client/src/generated/model/instrument-detail.ts +++ b/client/src/generated/model/instrument-detail.ts @@ -12,58 +12,61 @@ * Do not edit the class manually. */ + + /** - * + * * @export * @interface InstrumentDetail */ export interface InstrumentDetail { - /** - * - * @type {number} - * @memberof InstrumentDetail - */ - id: number; - /** - * - * @type {string} - * @memberof InstrumentDetail - */ - name: string; - /** - * - * @type {string} - * @memberof InstrumentDetail - */ - type: string; - /** - * - * @type {string} - * @memberof InstrumentDetail - */ - manufacturer: string; - /** - * - * @type {string} - * @memberof InstrumentDetail - */ - manufacturer_date: string; - /** - * - * @type {string} - * @memberof InstrumentDetail - */ - release_date: string; - /** - * - * @type {string} - * @memberof InstrumentDetail - */ - country: string; - /** - * - * @type {Array} - * @memberof InstrumentDetail - */ - basic_materials: Array; + /** + * + * @type {number} + * @memberof InstrumentDetail + */ + 'id': number; + /** + * + * @type {string} + * @memberof InstrumentDetail + */ + 'name': string; + /** + * + * @type {string} + * @memberof InstrumentDetail + */ + 'type': string; + /** + * + * @type {string} + * @memberof InstrumentDetail + */ + 'manufacturer': string; + /** + * + * @type {string} + * @memberof InstrumentDetail + */ + 'manufacturer_date': string; + /** + * + * @type {string} + * @memberof InstrumentDetail + */ + 'release_date': string; + /** + * + * @type {string} + * @memberof InstrumentDetail + */ + 'country': string; + /** + * + * @type {Array} + * @memberof InstrumentDetail + */ + 'basic_materials': Array; } + diff --git a/client/src/generated/model/instrument-type.ts b/client/src/generated/model/instrument-type.ts index affa6d0e..ff65bb2f 100644 --- a/client/src/generated/model/instrument-type.ts +++ b/client/src/generated/model/instrument-type.ts @@ -12,16 +12,19 @@ * Do not edit the class manually. */ + + /** - * + * * @export * @interface InstrumentType */ export interface InstrumentType { - /** - * - * @type {string} - * @memberof InstrumentType - */ - instrument_type?: string; + /** + * + * @type {string} + * @memberof InstrumentType + */ + 'instrument_type'?: string; } + diff --git a/client/src/generated/model/jwt-response.ts b/client/src/generated/model/jwt-response.ts index e2af0f82..e1987d16 100644 --- a/client/src/generated/model/jwt-response.ts +++ b/client/src/generated/model/jwt-response.ts @@ -12,16 +12,19 @@ * Do not edit the class manually. */ + + /** - * + * * @export * @interface JwtResponse */ export interface JwtResponse { - /** - * - * @type {string} - * @memberof JwtResponse - */ - jwt: string; + /** + * + * @type {string} + * @memberof JwtResponse + */ + 'jwt': string; } + diff --git a/client/src/generated/model/list-favorite-response-body.ts b/client/src/generated/model/list-favorite-response-body.ts index 396db813..1719cf94 100644 --- a/client/src/generated/model/list-favorite-response-body.ts +++ b/client/src/generated/model/list-favorite-response-body.ts @@ -12,20 +12,22 @@ * Do not edit the class manually. */ + // May contain unused imports in some cases // @ts-ignore -import type { InstrumentDetail } from "./instrument-detail"; +import type { InstrumentDetail } from './instrument-detail'; /** - * + * * @export * @interface ListFavoriteResponseBody */ export interface ListFavoriteResponseBody { - /** - * - * @type {Array} - * @memberof ListFavoriteResponseBody - */ - content: Array; + /** + * + * @type {Array} + * @memberof ListFavoriteResponseBody + */ + 'content': Array; } + diff --git a/client/src/generated/model/profile-details.ts b/client/src/generated/model/profile-details.ts index 8428adec..53d34886 100644 --- a/client/src/generated/model/profile-details.ts +++ b/client/src/generated/model/profile-details.ts @@ -12,28 +12,31 @@ * Do not edit the class manually. */ + + /** - * + * * @export * @interface ProfileDetails */ export interface ProfileDetails { - /** - * - * @type {string} - * @memberof ProfileDetails - */ - username: string; - /** - * - * @type {string} - * @memberof ProfileDetails - */ - role: string; - /** - * - * @type {string} - * @memberof ProfileDetails - */ - full_name: string; + /** + * + * @type {string} + * @memberof ProfileDetails + */ + 'username': string; + /** + * + * @type {string} + * @memberof ProfileDetails + */ + 'role': string; + /** + * + * @type {string} + * @memberof ProfileDetails + */ + 'full_name': string; } + diff --git a/client/src/generated/model/registration-request.ts b/client/src/generated/model/registration-request.ts index 81d00b96..c2529748 100644 --- a/client/src/generated/model/registration-request.ts +++ b/client/src/generated/model/registration-request.ts @@ -12,28 +12,31 @@ * Do not edit the class manually. */ + + /** - * + * * @export * @interface RegistrationRequest */ export interface RegistrationRequest { - /** - * - * @type {string} - * @memberof RegistrationRequest - */ - full_name: string; - /** - * - * @type {string} - * @memberof RegistrationRequest - */ - login: string; - /** - * - * @type {string} - * @memberof RegistrationRequest - */ - password: string; + /** + * + * @type {string} + * @memberof RegistrationRequest + */ + 'full_name': string; + /** + * + * @type {string} + * @memberof RegistrationRequest + */ + 'login': string; + /** + * + * @type {string} + * @memberof RegistrationRequest + */ + 'password': string; } + diff --git a/client/src/generated/model/remove-favorite-request-body.ts b/client/src/generated/model/remove-favorite-request-body.ts index 27f857cc..5e6b1032 100644 --- a/client/src/generated/model/remove-favorite-request-body.ts +++ b/client/src/generated/model/remove-favorite-request-body.ts @@ -12,16 +12,19 @@ * Do not edit the class manually. */ + + /** - * + * * @export * @interface RemoveFavoriteRequestBody */ export interface RemoveFavoriteRequestBody { - /** - * - * @type {number} - * @memberof RemoveFavoriteRequestBody - */ - instrument_id: number; + /** + * + * @type {number} + * @memberof RemoveFavoriteRequestBody + */ + 'instrument_id': number; } + diff --git a/client/src/generated/model/server-error.ts b/client/src/generated/model/server-error.ts index 55841fe5..e87a186f 100644 --- a/client/src/generated/model/server-error.ts +++ b/client/src/generated/model/server-error.ts @@ -12,16 +12,19 @@ * Do not edit the class manually. */ + + /** - * + * * @export * @interface ServerError */ export interface ServerError { - /** - * A description of the error. - * @type {string} - * @memberof ServerError - */ - message: string; + /** + * A description of the error. + * @type {string} + * @memberof ServerError + */ + 'message': string; } + diff --git a/client/src/generated/model/username-and-password-request-body.ts b/client/src/generated/model/username-and-password-request-body.ts index 9edf989a..db8b19f8 100644 --- a/client/src/generated/model/username-and-password-request-body.ts +++ b/client/src/generated/model/username-and-password-request-body.ts @@ -12,22 +12,25 @@ * Do not edit the class manually. */ + + /** - * + * * @export * @interface UsernameAndPasswordRequestBody */ export interface UsernameAndPasswordRequestBody { - /** - * - * @type {string} - * @memberof UsernameAndPasswordRequestBody - */ - username: string; - /** - * - * @type {string} - * @memberof UsernameAndPasswordRequestBody - */ - password: string; + /** + * + * @type {string} + * @memberof UsernameAndPasswordRequestBody + */ + 'username': string; + /** + * + * @type {string} + * @memberof UsernameAndPasswordRequestBody + */ + 'password': string; } + diff --git a/client/src/pages/create-instrument/api/loader.ts b/client/src/pages/create-instrument/api/loader.ts index df459100..9974b16e 100644 --- a/client/src/pages/create-instrument/api/loader.ts +++ b/client/src/pages/create-instrument/api/loader.ts @@ -1,21 +1,22 @@ import { LoaderFunction } from "react-router-dom"; import { SERVER_URL } from "shared/config"; -import { API_COUNTRIES, API_MANUFACTURERS } from "shared/config/backend"; +import { API_MANUFACTURERS } from "shared/config/backend"; import axios from "axios"; -import { Countries } from "domain/model/country"; import { ManufacturerNames } from "domain/model/manufacturer-name"; import { GetInstrumentTypesApi } from "generated/api/get-instrument-types-api"; -import type { InstrumentBasicMaterial, InstrumentType } from "generated/model"; +import type { Country, InstrumentBasicMaterial, InstrumentType } from "generated/model"; import { GetInstrumentBasicMaterialsApi } from "generated/api/get-instrument-basic-materials-api"; +import { GetCountriesApi } from "generated/api/get-countries-api"; const getInstrumentTypes = new GetInstrumentTypesApi(); const getInstrumentBasicMaterials = new GetInstrumentBasicMaterialsApi(); +const getCountries = new GetCountriesApi(); export interface CreateInstrumentLoader { instrumentTypes: InstrumentType[]; manufacturerNames: ManufacturerNames; materials: InstrumentBasicMaterial[]; - countries: Countries; + countries: Country[]; } export const loader: LoaderFunction = @@ -26,15 +27,7 @@ export const loader: LoaderFunction = const instrumentBasicMaterialsRequest = await getInstrumentBasicMaterials.getInstrumentBasicMaterials(); - let countries: string[] = []; - await axios - .get(`${SERVER_URL}${API_COUNTRIES}`) - .then((data) => { - countries = data.data; - }) - .catch(() => { - throw new Error("Fail to retrieve countries"); - }); + const countriesRequest = await getCountries.getCountries(); let manufacturers: ManufacturerNames = []; await axios @@ -50,6 +43,6 @@ export const loader: LoaderFunction = instrumentTypes: instrumentTypesRequest.data.content, manufacturerNames: manufacturers, materials: instrumentBasicMaterialsRequest.data.content, - countries: countries, + countries: countriesRequest.data.content, }; }; diff --git a/client/src/pages/edit-instrument/api/loader.ts b/client/src/pages/edit-instrument/api/loader.ts index 47717340..6b83e715 100644 --- a/client/src/pages/edit-instrument/api/loader.ts +++ b/client/src/pages/edit-instrument/api/loader.ts @@ -1,28 +1,30 @@ import { ManufacturerNames } from "domain/model/manufacturer-name"; -import { Countries } from "domain/model/country"; import { LoaderFunction } from "react-router-dom"; import axios from "axios"; import { SERVER_URL } from "shared/config"; -import { API_COUNTRIES, API_MANUFACTURERS } from "shared/config/backend"; +import { API_MANUFACTURERS } from "shared/config/backend"; import { GetInstrumentByIdApi } from "generated/api/get-instrument-by-id-api"; import { + Country, InstrumentBasicMaterial, InstrumentDetail, - type InstrumentType, + type InstrumentType } from "generated/model"; import { GetInstrumentTypesApi } from "generated/api/get-instrument-types-api"; import { GetInstrumentBasicMaterialsApi } from "generated/api/get-instrument-basic-materials-api"; +import { GetCountriesApi } from "generated/api/get-countries-api"; const getInstrumentById = new GetInstrumentByIdApi(); const getInstrumentTypes = new GetInstrumentTypesApi(); const getInstrumentBasicMaterials = new GetInstrumentBasicMaterialsApi(); +const getCountries = new GetCountriesApi(); export interface EditInstrumentLoader { instrumentForEdit: InstrumentDetail; instrumentTypes: InstrumentType[]; manufacturerNames: ManufacturerNames; materials: InstrumentBasicMaterial[]; - countries: Countries; + countries: Country[]; } export const loader: LoaderFunction = async ({ @@ -37,15 +39,7 @@ export const loader: LoaderFunction = async ({ const instrumentBasicMaterialsRequest = await getInstrumentBasicMaterials.getInstrumentBasicMaterials(); - let countries: string[] = []; - await axios - .get(`${SERVER_URL}${API_COUNTRIES}`) - .then((data) => { - countries = data.data; - }) - .catch(() => { - throw new Error("Fail to retrieve countries"); - }); + const countriesRequest = await getCountries.getCountries(); let manufacturers: ManufacturerNames = []; await axios @@ -62,6 +56,6 @@ export const loader: LoaderFunction = async ({ instrumentTypes: instrumentTypesRequest.data.content, manufacturerNames: manufacturers, materials: instrumentBasicMaterialsRequest.data.content, - countries: countries, + countries: countriesRequest.data.content, }; }; diff --git a/client/src/shared/config/backend.ts b/client/src/shared/config/backend.ts index a8ddcebb..6ad5d1eb 100644 --- a/client/src/shared/config/backend.ts +++ b/client/src/shared/config/backend.ts @@ -1,6 +1,5 @@ export const SERVER_URL = "http://localhost:8080"; export const API = "/api"; -export const API_COUNTRIES = `${API}/countries`; export const API_CREATE_INSTRUMENT = `${API}/instrument/create`; export const API_MANUFACTURERS = `${API}/manufacturers`; diff --git a/client/src/shared/model/parseInstrumentDetails.ts b/client/src/shared/model/parseInstrumentDetails.ts index 95dfb01d..b68bfe8d 100644 --- a/client/src/shared/model/parseInstrumentDetails.ts +++ b/client/src/shared/model/parseInstrumentDetails.ts @@ -2,10 +2,9 @@ import { InstrumentName } from "domain/model/instrument-name"; import { ManufacturerName } from "domain/model/manufacturer-name"; import { ManufactureDate } from "domain/model/manufacture-date"; import { ReleaseDate } from "domain/model/release-date"; -import { Country } from "domain/model/country"; import { InstrumentId } from "domain/model/instrument-id"; import { InstrumentType } from "generated/model/instrument-type"; -import { InstrumentBasicMaterial } from "generated/model"; +import { Country, InstrumentBasicMaterial } from "generated/model"; export const parseInstrumentDetails = (data: FormData) => { const errors = []; @@ -67,11 +66,14 @@ export const parseInstrumentDetails = (data: FormData) => { errors.push("Release date must be after manufacture date"); } - const country = data.get("country"); + const country = { + country: data.get("country"), + } as Country; + if ( - country === null || - typeof country !== "string" || - manufactureDate === "" + country.country === null || + typeof country.country !== "string" || + country.country === "" ) { errors.push("Type country"); } diff --git a/client/src/widgets/catalogue-filter/ui/CountryFilter.tsx b/client/src/widgets/catalogue-filter/ui/CountryFilter.tsx index ed184eae..1e8e13d5 100644 --- a/client/src/widgets/catalogue-filter/ui/CountryFilter.tsx +++ b/client/src/widgets/catalogue-filter/ui/CountryFilter.tsx @@ -1,26 +1,23 @@ import React, { useEffect, useState } from "react"; import { ManufacturerNames } from "domain/model/manufacturer-name"; -import axios from "axios"; -import { SERVER_URL } from "shared/config"; -import { API_COUNTRIES } from "shared/config/backend"; -import { Countries } from "domain/model/country"; +import { GetCountriesApi } from "generated/api/get-countries-api"; +import { Country } from "generated/model"; interface Props { onValueChange: (names: ManufacturerNames) => void; } +const getCountries = new GetCountriesApi(); + export const CountryFilter = ({ onValueChange }: Props) => { - const [countries, setCountries] = useState([]); + const [countries, setCountries] = useState([]); useEffect(() => { - axios - .get(`${SERVER_URL}${API_COUNTRIES}`) - .then((r) => { - setCountries(r.data); - }) - .catch((e) => { - throw new Error(`Failed to extract countries: '${e}'`); - }); + const fetchCountries = async () => { + const response = await getCountries.getCountries(); + setCountries(response.data.content); + } + fetchCountries(); }, []); function onChange() { @@ -39,15 +36,15 @@ export const CountryFilter = ({ onValueChange }: Props) => {
Country: {countries.map((country) => ( -
+
- +
))}
diff --git a/openapi/openapi.yml b/openapi/openapi.yml index eb049164..8ae4ed07 100644 --- a/openapi/openapi.yml +++ b/openapi/openapi.yml @@ -18,6 +18,9 @@ servers: basePath: default: api tags: + - name: getCountries + description: Get Countries + x-displayName: getCountries - name: addFavorite description: Add Favorite x-displayName: addFavorite @@ -55,6 +58,32 @@ tags: description: User Registration x-displayName: userRegistration paths: + /countries: + get: + description: Get Countries + summary: Get Countries + operationId: getCountries + tags: + - getCountries + responses: + '200': + description: Country + content: + application/json: + schema: + $ref: '#/components/schemas/GetCountriesResponse' + '400': + description: Client Error + content: + application/json: + schema: + $ref: '#/components/schemas/ClientError' + default: + description: Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/ServerError' /favorite/add: post: description: Add Favorite @@ -468,6 +497,22 @@ components: description: A description of the error. example: message: Internal Server Error. Please try again later. + Country: + type: object + required: + - country + properties: + country: + type: string + GetCountriesResponse: + type: object + required: + - content + properties: + content: + type: array + items: + $ref: '#/components/schemas/Country' AddFavoriteRequestBody: type: object required: @@ -659,6 +704,9 @@ components: password: type: string x-tagGroups: + - name: Get Countries + tags: + - getCountries - name: Add Favorite tags: - addFavorite diff --git a/openapi/specs/country/GetCountriesEndpoint.yml b/openapi/specs/country/GetCountriesEndpoint.yml new file mode 100644 index 00000000..a79f2b50 --- /dev/null +++ b/openapi/specs/country/GetCountriesEndpoint.yml @@ -0,0 +1,71 @@ +openapi: "3.0.0" # openApiGenerate gradle task do not support officially 3.1.0 openapi version + +info: + description: Get Countries + version: 1.0.0 + title: Get Countries + contact: + name: Kirill B + email: baskirill.an@gmail.com +servers: + - url: http://localhost:{port}/{basePath} + description: Local server (uses local data) + variables: + port: + default: "8080" + enum: + - "8080" + - "8000" + basePath: + default: "api" + +tags: + - name: getCountries + description: Get Countries + +paths: + /countries: + get: + description: Get Countries + summary: Get Countries + operationId: getCountries + tags: + - getCountries + responses: + "200": + description: Country + content: + application/json: + schema: + $ref: "#/components/schemas/GetCountriesResponse" + "400": + description: Client Error + content: + application/json: + schema: + $ref: "./../common/ClientError.yml#/components/schemas/ClientError" + default: + description: Server Error + content: + application/json: + schema: + $ref: "./../common/ServerError.yml#/components/schemas/ServerError" + +components: + schemas: + Country: + type: object + required: [country] + properties: + country: + type: string + + GetCountriesResponse: + type: object + required: [content] + properties: + content: + type: array + items: + $ref: "#/components/schemas/Country" + diff --git a/server/app/src/main/kotlin/mu/muse/rest/country/GetCountriesEndpoint.kt b/server/app/src/main/kotlin/mu/muse/rest/country/GetCountriesEndpoint.kt index edb6de01..43d76d58 100644 --- a/server/app/src/main/kotlin/mu/muse/rest/country/GetCountriesEndpoint.kt +++ b/server/app/src/main/kotlin/mu/muse/rest/country/GetCountriesEndpoint.kt @@ -1,18 +1,27 @@ package mu.muse.rest.country import mu.muse.domain.instrument.Country -import mu.muse.rest.API_COUNTRIES +import mu.muse.rest.api.GetCountriesApi +import mu.muse.rest.dto.GetCountriesResponse import mu.muse.usecase.GetCountries -import org.springframework.web.bind.annotation.GetMapping +import org.springframework.http.ResponseEntity import org.springframework.web.bind.annotation.RestController @RestController class GetCountriesEndpoint( private val getCountries: GetCountries, -) { +): GetCountriesApi { - @GetMapping(API_COUNTRIES) - fun getCountries(): List { - return getCountries.execute() + override fun getCountries(): ResponseEntity { + val countries = getCountries.execute() + return countries.toResponse() } } + +fun List.toResponse(): ResponseEntity { + return ResponseEntity.ok( + GetCountriesResponse( + content = this.map { mu.muse.rest.dto.Country(it.name) } + ) + ) +} From c9c0ddf4282d4a34e0a0efdf13277514950cd584 Mon Sep 17 00:00:00 2001 From: skywalker Date: Fri, 23 Aug 2024 00:13:44 +0300 Subject: [PATCH 2/2] fix(ci): run local ci checks --- client/src/generated/api.ts | 29 +- client/src/generated/api/add-favorite-api.ts | 242 +++++++++----- client/src/generated/api/basic-login-api.ts | 242 +++++++++----- .../api/delete-instrument-by-id-api.ts | 235 ++++++++----- .../api/get-instrument-basic-materials-api.ts | 215 +++++++----- .../generated/api/get-instrument-by-id-api.ts | 238 ++++++++----- .../generated/api/get-instrument-types-api.ts | 215 +++++++----- .../api/get-instruments-by-criteria-api.ts | 250 +++++++++----- ...t-instruments-by-criteria-paginated-api.ts | 314 ++++++++++++------ .../src/generated/api/get-user-profile-api.ts | 206 +++++++----- client/src/generated/api/list-favorite-api.ts | 213 +++++++----- .../src/generated/api/remove-favorite-api.ts | 242 +++++++++----- .../generated/api/user-registration-api.ts | 241 +++++++++----- client/src/generated/base.ts | 59 ++-- client/src/generated/common.ts | 204 +++++++----- client/src/generated/configuration.ts | 200 ++++++----- client/src/generated/index.ts | 1 - .../model/add-favorite-request-body.ts | 17 +- client/src/generated/model/client-error.ts | 17 +- ...get-instrument-basic-materials-response.ts | 18 +- ...et-instrument-by-criteria-page-response.ts | 78 +++-- .../get-instrument-criteria-request-body.ts | 125 ++++--- .../model/get-instrument-types-response.ts | 18 +- .../get-instruments-by-criteria-response.ts | 18 +- client/src/generated/model/index.ts | 38 +-- .../model/instrument-basic-material.ts | 17 +- .../src/generated/model/instrument-detail.ts | 101 +++--- client/src/generated/model/instrument-type.ts | 17 +- client/src/generated/model/jwt-response.ts | 17 +- .../model/list-favorite-response-body.ts | 18 +- client/src/generated/model/profile-details.ts | 41 ++- .../generated/model/registration-request.ts | 41 ++- .../model/remove-favorite-request-body.ts | 17 +- client/src/generated/model/server-error.ts | 17 +- .../username-and-password-request-body.ts | 29 +- .../src/pages/create-instrument/api/loader.ts | 6 +- .../src/pages/edit-instrument/api/loader.ts | 2 +- .../catalogue-filter/ui/CountryFilter.tsx | 2 +- .../muse/rest/country/GetCountriesEndpoint.kt | 4 +- 39 files changed, 2418 insertions(+), 1586 deletions(-) diff --git a/client/src/generated/api.ts b/client/src/generated/api.ts index 6ac42322..64ccc888 100644 --- a/client/src/generated/api.ts +++ b/client/src/generated/api.ts @@ -12,19 +12,16 @@ * Do not edit the class manually. */ - - -export * from './api/add-favorite-api'; -export * from './api/basic-login-api'; -export * from './api/delete-instrument-by-id-api'; -export * from './api/get-countries-api'; -export * from './api/get-instrument-basic-materials-api'; -export * from './api/get-instrument-by-id-api'; -export * from './api/get-instrument-types-api'; -export * from './api/get-instruments-by-criteria-api'; -export * from './api/get-instruments-by-criteria-paginated-api'; -export * from './api/get-user-profile-api'; -export * from './api/list-favorite-api'; -export * from './api/remove-favorite-api'; -export * from './api/user-registration-api'; - +export * from "./api/add-favorite-api"; +export * from "./api/basic-login-api"; +export * from "./api/delete-instrument-by-id-api"; +export * from "./api/get-countries-api"; +export * from "./api/get-instrument-basic-materials-api"; +export * from "./api/get-instrument-by-id-api"; +export * from "./api/get-instrument-types-api"; +export * from "./api/get-instruments-by-criteria-api"; +export * from "./api/get-instruments-by-criteria-paginated-api"; +export * from "./api/get-user-profile-api"; +export * from "./api/list-favorite-api"; +export * from "./api/remove-favorite-api"; +export * from "./api/user-registration-api"; diff --git a/client/src/generated/api/add-favorite-api.ts b/client/src/generated/api/add-favorite-api.ts index a9db181a..5d272e75 100644 --- a/client/src/generated/api/add-favorite-api.ts +++ b/client/src/generated/api/add-favorite-api.ts @@ -12,107 +12,171 @@ * Do not edit the class manually. */ - -import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; +import type { Configuration } from "../configuration"; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; +import globalAxios from "axios"; // Some imports not used depending on template conditions // @ts-ignore -import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "../common"; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +import { + BASE_PATH, + COLLECTION_FORMATS, + type RequestArgs, + BaseAPI, + RequiredError, + operationServerMap, +} from "../base"; // @ts-ignore -import type { AddFavoriteRequestBody } from '../model'; +import type { AddFavoriteRequestBody } from "../model"; // @ts-ignore -import type { ClientError } from '../model'; +import type { ClientError } from "../model"; // @ts-ignore -import type { ServerError } from '../model'; +import type { ServerError } from "../model"; /** * AddFavoriteApi - axios parameter creator * @export */ -export const AddFavoriteApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Add Favorite - * @summary Add Favorite - * @param {AddFavoriteRequestBody} addFavoriteRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - addFavorite: async (addFavoriteRequestBody: AddFavoriteRequestBody, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'addFavoriteRequestBody' is not null or undefined - assertParamExists('addFavorite', 'addFavoriteRequestBody', addFavoriteRequestBody) - const localVarPath = `/favorite/add`; - // 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: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; +export const AddFavoriteApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + /** + * Add Favorite + * @summary Add Favorite + * @param {AddFavoriteRequestBody} addFavoriteRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + addFavorite: async ( + addFavoriteRequestBody: AddFavoriteRequestBody, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'addFavoriteRequestBody' is not null or undefined + assertParamExists( + "addFavorite", + "addFavoriteRequestBody", + addFavoriteRequestBody, + ); + const localVarPath = `/favorite/add`; + // 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: "POST", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; - - localVarHeaderParameter['Content-Type'] = 'application/json'; + localVarHeaderParameter["Content-Type"] = "application/json"; - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(addFavoriteRequestBody, localVarRequestOptions, configuration) + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + addFavoriteRequestBody, + localVarRequestOptions, + configuration, + ); - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; }; /** * AddFavoriteApi - functional programming interface * @export */ -export const AddFavoriteApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = AddFavoriteApiAxiosParamCreator(configuration) - return { - /** - * Add Favorite - * @summary Add Favorite - * @param {AddFavoriteRequestBody} addFavoriteRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async addFavorite(addFavoriteRequestBody: AddFavoriteRequestBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.addFavorite(addFavoriteRequestBody, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['AddFavoriteApi.addFavorite']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } +export const AddFavoriteApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = + AddFavoriteApiAxiosParamCreator(configuration); + return { + /** + * Add Favorite + * @summary Add Favorite + * @param {AddFavoriteRequestBody} addFavoriteRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async addFavorite( + addFavoriteRequestBody: AddFavoriteRequestBody, + options?: RawAxiosRequestConfig, + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.addFavorite( + addFavoriteRequestBody, + options, + ); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = + operationServerMap["AddFavoriteApi.addFavorite"]?.[ + localVarOperationServerIndex + ]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, localVarOperationServerBasePath || basePath); + }, + }; }; /** * AddFavoriteApi - factory interface * @export */ -export const AddFavoriteApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = AddFavoriteApiFp(configuration) - return { - /** - * Add Favorite - * @summary Add Favorite - * @param {AddFavoriteRequestBody} addFavoriteRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - addFavorite(addFavoriteRequestBody: AddFavoriteRequestBody, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.addFavorite(addFavoriteRequestBody, options).then((request) => request(axios, basePath)); - }, - }; +export const AddFavoriteApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = AddFavoriteApiFp(configuration); + return { + /** + * Add Favorite + * @summary Add Favorite + * @param {AddFavoriteRequestBody} addFavoriteRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + addFavorite( + addFavoriteRequestBody: AddFavoriteRequestBody, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .addFavorite(addFavoriteRequestBody, options) + .then((request) => request(axios, basePath)); + }, + }; }; /** @@ -122,16 +186,20 @@ export const AddFavoriteApiFactory = function (configuration?: Configuration, ba * @extends {BaseAPI} */ export class AddFavoriteApi extends BaseAPI { - /** - * Add Favorite - * @summary Add Favorite - * @param {AddFavoriteRequestBody} addFavoriteRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof AddFavoriteApi - */ - public addFavorite(addFavoriteRequestBody: AddFavoriteRequestBody, options?: RawAxiosRequestConfig) { - return AddFavoriteApiFp(this.configuration).addFavorite(addFavoriteRequestBody, options).then((request) => request(this.axios, this.basePath)); - } + /** + * Add Favorite + * @summary Add Favorite + * @param {AddFavoriteRequestBody} addFavoriteRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AddFavoriteApi + */ + public addFavorite( + addFavoriteRequestBody: AddFavoriteRequestBody, + options?: RawAxiosRequestConfig, + ) { + return AddFavoriteApiFp(this.configuration) + .addFavorite(addFavoriteRequestBody, options) + .then((request) => request(this.axios, this.basePath)); + } } - diff --git a/client/src/generated/api/basic-login-api.ts b/client/src/generated/api/basic-login-api.ts index 6823ae68..610c3a84 100644 --- a/client/src/generated/api/basic-login-api.ts +++ b/client/src/generated/api/basic-login-api.ts @@ -12,107 +12,171 @@ * Do not edit the class manually. */ - -import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; +import type { Configuration } from "../configuration"; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; +import globalAxios from "axios"; // Some imports not used depending on template conditions // @ts-ignore -import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "../common"; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +import { + BASE_PATH, + COLLECTION_FORMATS, + type RequestArgs, + BaseAPI, + RequiredError, + operationServerMap, +} from "../base"; // @ts-ignore -import type { JwtResponse } from '../model'; +import type { JwtResponse } from "../model"; // @ts-ignore -import type { ServerError } from '../model'; +import type { ServerError } from "../model"; // @ts-ignore -import type { UsernameAndPasswordRequestBody } from '../model'; +import type { UsernameAndPasswordRequestBody } from "../model"; /** * BasicLoginApi - axios parameter creator * @export */ -export const BasicLoginApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Basic Authentication - * @summary Basic Login - * @param {UsernameAndPasswordRequestBody} usernameAndPasswordRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - basicLogin: async (usernameAndPasswordRequestBody: UsernameAndPasswordRequestBody, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'usernameAndPasswordRequestBody' is not null or undefined - assertParamExists('basicLogin', 'usernameAndPasswordRequestBody', usernameAndPasswordRequestBody) - const localVarPath = `/auth/login`; - // 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: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; +export const BasicLoginApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + /** + * Basic Authentication + * @summary Basic Login + * @param {UsernameAndPasswordRequestBody} usernameAndPasswordRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + basicLogin: async ( + usernameAndPasswordRequestBody: UsernameAndPasswordRequestBody, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'usernameAndPasswordRequestBody' is not null or undefined + assertParamExists( + "basicLogin", + "usernameAndPasswordRequestBody", + usernameAndPasswordRequestBody, + ); + const localVarPath = `/auth/login`; + // 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: "POST", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; - - localVarHeaderParameter['Content-Type'] = 'application/json'; + localVarHeaderParameter["Content-Type"] = "application/json"; - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(usernameAndPasswordRequestBody, localVarRequestOptions, configuration) + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + usernameAndPasswordRequestBody, + localVarRequestOptions, + configuration, + ); - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; }; /** * BasicLoginApi - functional programming interface * @export */ -export const BasicLoginApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = BasicLoginApiAxiosParamCreator(configuration) - return { - /** - * Basic Authentication - * @summary Basic Login - * @param {UsernameAndPasswordRequestBody} usernameAndPasswordRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async basicLogin(usernameAndPasswordRequestBody: UsernameAndPasswordRequestBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.basicLogin(usernameAndPasswordRequestBody, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['BasicLoginApi.basicLogin']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } +export const BasicLoginApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = + BasicLoginApiAxiosParamCreator(configuration); + return { + /** + * Basic Authentication + * @summary Basic Login + * @param {UsernameAndPasswordRequestBody} usernameAndPasswordRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async basicLogin( + usernameAndPasswordRequestBody: UsernameAndPasswordRequestBody, + options?: RawAxiosRequestConfig, + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.basicLogin( + usernameAndPasswordRequestBody, + options, + ); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = + operationServerMap["BasicLoginApi.basicLogin"]?.[ + localVarOperationServerIndex + ]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, localVarOperationServerBasePath || basePath); + }, + }; }; /** * BasicLoginApi - factory interface * @export */ -export const BasicLoginApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = BasicLoginApiFp(configuration) - return { - /** - * Basic Authentication - * @summary Basic Login - * @param {UsernameAndPasswordRequestBody} usernameAndPasswordRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - basicLogin(usernameAndPasswordRequestBody: UsernameAndPasswordRequestBody, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.basicLogin(usernameAndPasswordRequestBody, options).then((request) => request(axios, basePath)); - }, - }; +export const BasicLoginApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = BasicLoginApiFp(configuration); + return { + /** + * Basic Authentication + * @summary Basic Login + * @param {UsernameAndPasswordRequestBody} usernameAndPasswordRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + basicLogin( + usernameAndPasswordRequestBody: UsernameAndPasswordRequestBody, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .basicLogin(usernameAndPasswordRequestBody, options) + .then((request) => request(axios, basePath)); + }, + }; }; /** @@ -122,16 +186,20 @@ export const BasicLoginApiFactory = function (configuration?: Configuration, bas * @extends {BaseAPI} */ export class BasicLoginApi extends BaseAPI { - /** - * Basic Authentication - * @summary Basic Login - * @param {UsernameAndPasswordRequestBody} usernameAndPasswordRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof BasicLoginApi - */ - public basicLogin(usernameAndPasswordRequestBody: UsernameAndPasswordRequestBody, options?: RawAxiosRequestConfig) { - return BasicLoginApiFp(this.configuration).basicLogin(usernameAndPasswordRequestBody, options).then((request) => request(this.axios, this.basePath)); - } + /** + * Basic Authentication + * @summary Basic Login + * @param {UsernameAndPasswordRequestBody} usernameAndPasswordRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof BasicLoginApi + */ + public basicLogin( + usernameAndPasswordRequestBody: UsernameAndPasswordRequestBody, + options?: RawAxiosRequestConfig, + ) { + return BasicLoginApiFp(this.configuration) + .basicLogin(usernameAndPasswordRequestBody, options) + .then((request) => request(this.axios, this.basePath)); + } } - diff --git a/client/src/generated/api/delete-instrument-by-id-api.ts b/client/src/generated/api/delete-instrument-by-id-api.ts index c1a96ab0..a5d963f7 100644 --- a/client/src/generated/api/delete-instrument-by-id-api.ts +++ b/client/src/generated/api/delete-instrument-by-id-api.ts @@ -12,103 +12,164 @@ * Do not edit the class manually. */ - -import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; +import type { Configuration } from "../configuration"; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; +import globalAxios from "axios"; // Some imports not used depending on template conditions // @ts-ignore -import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "../common"; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +import { + BASE_PATH, + COLLECTION_FORMATS, + type RequestArgs, + BaseAPI, + RequiredError, + operationServerMap, +} from "../base"; // @ts-ignore -import type { ClientError } from '../model'; +import type { ClientError } from "../model"; // @ts-ignore -import type { ServerError } from '../model'; +import type { ServerError } from "../model"; /** * DeleteInstrumentByIdApi - axios parameter creator * @export */ -export const DeleteInstrumentByIdApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Get Instrument Types - * @summary Get Instrument Types - * @param {number} instrumentId Instrument ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteInstrumentById: async (instrumentId: number, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'instrumentId' is not null or undefined - assertParamExists('deleteInstrumentById', 'instrumentId', instrumentId) - const localVarPath = `/instrument/{instrumentId}/delete` - .replace(`{${"instrumentId"}}`, encodeURIComponent(String(instrumentId))); - // 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; +export const DeleteInstrumentByIdApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + /** + * Get Instrument Types + * @summary Get Instrument Types + * @param {number} instrumentId Instrument ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteInstrumentById: async ( + instrumentId: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'instrumentId' is not null or undefined + assertParamExists("deleteInstrumentById", "instrumentId", instrumentId); + const localVarPath = `/instrument/{instrumentId}/delete`.replace( + `{${"instrumentId"}}`, + encodeURIComponent(String(instrumentId)), + ); + // 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}; + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; }; /** * DeleteInstrumentByIdApi - functional programming interface * @export */ -export const DeleteInstrumentByIdApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = DeleteInstrumentByIdApiAxiosParamCreator(configuration) - return { - /** - * Get Instrument Types - * @summary Get Instrument Types - * @param {number} instrumentId Instrument ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async deleteInstrumentById(instrumentId: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.deleteInstrumentById(instrumentId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DeleteInstrumentByIdApi.deleteInstrumentById']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } +export const DeleteInstrumentByIdApiFp = function ( + configuration?: Configuration, +) { + const localVarAxiosParamCreator = + DeleteInstrumentByIdApiAxiosParamCreator(configuration); + return { + /** + * Get Instrument Types + * @summary Get Instrument Types + * @param {number} instrumentId Instrument ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteInstrumentById( + instrumentId: number, + options?: RawAxiosRequestConfig, + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.deleteInstrumentById( + instrumentId, + options, + ); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = + operationServerMap["DeleteInstrumentByIdApi.deleteInstrumentById"]?.[ + localVarOperationServerIndex + ]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, localVarOperationServerBasePath || basePath); + }, + }; }; /** * DeleteInstrumentByIdApi - factory interface * @export */ -export const DeleteInstrumentByIdApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = DeleteInstrumentByIdApiFp(configuration) - return { - /** - * Get Instrument Types - * @summary Get Instrument Types - * @param {number} instrumentId Instrument ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteInstrumentById(instrumentId: number, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.deleteInstrumentById(instrumentId, options).then((request) => request(axios, basePath)); - }, - }; +export const DeleteInstrumentByIdApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = DeleteInstrumentByIdApiFp(configuration); + return { + /** + * Get Instrument Types + * @summary Get Instrument Types + * @param {number} instrumentId Instrument ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteInstrumentById( + instrumentId: number, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .deleteInstrumentById(instrumentId, options) + .then((request) => request(axios, basePath)); + }, + }; }; /** @@ -118,16 +179,20 @@ export const DeleteInstrumentByIdApiFactory = function (configuration?: Configur * @extends {BaseAPI} */ export class DeleteInstrumentByIdApi extends BaseAPI { - /** - * Get Instrument Types - * @summary Get Instrument Types - * @param {number} instrumentId Instrument ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof DeleteInstrumentByIdApi - */ - public deleteInstrumentById(instrumentId: number, options?: RawAxiosRequestConfig) { - return DeleteInstrumentByIdApiFp(this.configuration).deleteInstrumentById(instrumentId, options).then((request) => request(this.axios, this.basePath)); - } + /** + * Get Instrument Types + * @summary Get Instrument Types + * @param {number} instrumentId Instrument ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DeleteInstrumentByIdApi + */ + public deleteInstrumentById( + instrumentId: number, + options?: RawAxiosRequestConfig, + ) { + return DeleteInstrumentByIdApiFp(this.configuration) + .deleteInstrumentById(instrumentId, options) + .then((request) => request(this.axios, this.basePath)); + } } - diff --git a/client/src/generated/api/get-instrument-basic-materials-api.ts b/client/src/generated/api/get-instrument-basic-materials-api.ts index 4a9ea562..7279b470 100644 --- a/client/src/generated/api/get-instrument-basic-materials-api.ts +++ b/client/src/generated/api/get-instrument-basic-materials-api.ts @@ -12,99 +12,155 @@ * Do not edit the class manually. */ - -import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; +import type { Configuration } from "../configuration"; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; +import globalAxios from "axios"; // Some imports not used depending on template conditions // @ts-ignore -import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "../common"; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +import { + BASE_PATH, + COLLECTION_FORMATS, + type RequestArgs, + BaseAPI, + RequiredError, + operationServerMap, +} from "../base"; // @ts-ignore -import type { ClientError } from '../model'; +import type { ClientError } from "../model"; // @ts-ignore -import type { GetInstrumentBasicMaterialsResponse } from '../model'; +import type { GetInstrumentBasicMaterialsResponse } from "../model"; // @ts-ignore -import type { ServerError } from '../model'; +import type { ServerError } from "../model"; /** * GetInstrumentBasicMaterialsApi - axios parameter creator * @export */ -export const GetInstrumentBasicMaterialsApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Get Instrument Basic Materials - * @summary Get Instrument Basic Materials - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getInstrumentBasicMaterials: async (options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/instrument/materials`; - // 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; +export const GetInstrumentBasicMaterialsApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + /** + * Get Instrument Basic Materials + * @summary Get Instrument Basic Materials + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInstrumentBasicMaterials: async ( + options: RawAxiosRequestConfig = {}, + ): Promise => { + const localVarPath = `/instrument/materials`; + // 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}; + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; }; /** * GetInstrumentBasicMaterialsApi - functional programming interface * @export */ -export const GetInstrumentBasicMaterialsApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = GetInstrumentBasicMaterialsApiAxiosParamCreator(configuration) - return { - /** - * Get Instrument Basic Materials - * @summary Get Instrument Basic Materials - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getInstrumentBasicMaterials(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getInstrumentBasicMaterials(options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['GetInstrumentBasicMaterialsApi.getInstrumentBasicMaterials']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } +export const GetInstrumentBasicMaterialsApiFp = function ( + configuration?: Configuration, +) { + const localVarAxiosParamCreator = + GetInstrumentBasicMaterialsApiAxiosParamCreator(configuration); + return { + /** + * Get Instrument Basic Materials + * @summary Get Instrument Basic Materials + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getInstrumentBasicMaterials( + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.getInstrumentBasicMaterials(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = + operationServerMap[ + "GetInstrumentBasicMaterialsApi.getInstrumentBasicMaterials" + ]?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, localVarOperationServerBasePath || basePath); + }, + }; }; /** * GetInstrumentBasicMaterialsApi - factory interface * @export */ -export const GetInstrumentBasicMaterialsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = GetInstrumentBasicMaterialsApiFp(configuration) - return { - /** - * Get Instrument Basic Materials - * @summary Get Instrument Basic Materials - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getInstrumentBasicMaterials(options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getInstrumentBasicMaterials(options).then((request) => request(axios, basePath)); - }, - }; +export const GetInstrumentBasicMaterialsApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = GetInstrumentBasicMaterialsApiFp(configuration); + return { + /** + * Get Instrument Basic Materials + * @summary Get Instrument Basic Materials + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInstrumentBasicMaterials( + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .getInstrumentBasicMaterials(options) + .then((request) => request(axios, basePath)); + }, + }; }; /** @@ -114,15 +170,16 @@ export const GetInstrumentBasicMaterialsApiFactory = function (configuration?: C * @extends {BaseAPI} */ export class GetInstrumentBasicMaterialsApi extends BaseAPI { - /** - * Get Instrument Basic Materials - * @summary Get Instrument Basic Materials - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof GetInstrumentBasicMaterialsApi - */ - public getInstrumentBasicMaterials(options?: RawAxiosRequestConfig) { - return GetInstrumentBasicMaterialsApiFp(this.configuration).getInstrumentBasicMaterials(options).then((request) => request(this.axios, this.basePath)); - } + /** + * Get Instrument Basic Materials + * @summary Get Instrument Basic Materials + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GetInstrumentBasicMaterialsApi + */ + public getInstrumentBasicMaterials(options?: RawAxiosRequestConfig) { + return GetInstrumentBasicMaterialsApiFp(this.configuration) + .getInstrumentBasicMaterials(options) + .then((request) => request(this.axios, this.basePath)); + } } - diff --git a/client/src/generated/api/get-instrument-by-id-api.ts b/client/src/generated/api/get-instrument-by-id-api.ts index 7f0b1d73..6520a1ce 100644 --- a/client/src/generated/api/get-instrument-by-id-api.ts +++ b/client/src/generated/api/get-instrument-by-id-api.ts @@ -12,105 +12,167 @@ * Do not edit the class manually. */ - -import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; +import type { Configuration } from "../configuration"; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; +import globalAxios from "axios"; // Some imports not used depending on template conditions // @ts-ignore -import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "../common"; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +import { + BASE_PATH, + COLLECTION_FORMATS, + type RequestArgs, + BaseAPI, + RequiredError, + operationServerMap, +} from "../base"; // @ts-ignore -import type { ClientError } from '../model'; +import type { ClientError } from "../model"; // @ts-ignore -import type { InstrumentDetail } from '../model'; +import type { InstrumentDetail } from "../model"; // @ts-ignore -import type { ServerError } from '../model'; +import type { ServerError } from "../model"; /** * GetInstrumentByIdApi - axios parameter creator * @export */ -export const GetInstrumentByIdApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Get Instrument by ID - * @summary Get Instrument by ID - * @param {string} instrumentId Instrument ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getInstrumentById: async (instrumentId: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'instrumentId' is not null or undefined - assertParamExists('getInstrumentById', 'instrumentId', instrumentId) - const localVarPath = `/instrument/{instrumentId}` - .replace(`{${"instrumentId"}}`, encodeURIComponent(String(instrumentId))); - // 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; +export const GetInstrumentByIdApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + /** + * Get Instrument by ID + * @summary Get Instrument by ID + * @param {string} instrumentId Instrument ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInstrumentById: async ( + instrumentId: string, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'instrumentId' is not null or undefined + assertParamExists("getInstrumentById", "instrumentId", instrumentId); + const localVarPath = `/instrument/{instrumentId}`.replace( + `{${"instrumentId"}}`, + encodeURIComponent(String(instrumentId)), + ); + // 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}; + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; }; /** * GetInstrumentByIdApi - functional programming interface * @export */ -export const GetInstrumentByIdApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = GetInstrumentByIdApiAxiosParamCreator(configuration) - return { - /** - * Get Instrument by ID - * @summary Get Instrument by ID - * @param {string} instrumentId Instrument ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getInstrumentById(instrumentId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getInstrumentById(instrumentId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['GetInstrumentByIdApi.getInstrumentById']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } +export const GetInstrumentByIdApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = + GetInstrumentByIdApiAxiosParamCreator(configuration); + return { + /** + * Get Instrument by ID + * @summary Get Instrument by ID + * @param {string} instrumentId Instrument ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getInstrumentById( + instrumentId: string, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.getInstrumentById( + instrumentId, + options, + ); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = + operationServerMap["GetInstrumentByIdApi.getInstrumentById"]?.[ + localVarOperationServerIndex + ]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, localVarOperationServerBasePath || basePath); + }, + }; }; /** * GetInstrumentByIdApi - factory interface * @export */ -export const GetInstrumentByIdApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = GetInstrumentByIdApiFp(configuration) - return { - /** - * Get Instrument by ID - * @summary Get Instrument by ID - * @param {string} instrumentId Instrument ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getInstrumentById(instrumentId: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getInstrumentById(instrumentId, options).then((request) => request(axios, basePath)); - }, - }; +export const GetInstrumentByIdApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = GetInstrumentByIdApiFp(configuration); + return { + /** + * Get Instrument by ID + * @summary Get Instrument by ID + * @param {string} instrumentId Instrument ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInstrumentById( + instrumentId: string, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .getInstrumentById(instrumentId, options) + .then((request) => request(axios, basePath)); + }, + }; }; /** @@ -120,16 +182,20 @@ export const GetInstrumentByIdApiFactory = function (configuration?: Configurati * @extends {BaseAPI} */ export class GetInstrumentByIdApi extends BaseAPI { - /** - * Get Instrument by ID - * @summary Get Instrument by ID - * @param {string} instrumentId Instrument ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof GetInstrumentByIdApi - */ - public getInstrumentById(instrumentId: string, options?: RawAxiosRequestConfig) { - return GetInstrumentByIdApiFp(this.configuration).getInstrumentById(instrumentId, options).then((request) => request(this.axios, this.basePath)); - } + /** + * Get Instrument by ID + * @summary Get Instrument by ID + * @param {string} instrumentId Instrument ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GetInstrumentByIdApi + */ + public getInstrumentById( + instrumentId: string, + options?: RawAxiosRequestConfig, + ) { + return GetInstrumentByIdApiFp(this.configuration) + .getInstrumentById(instrumentId, options) + .then((request) => request(this.axios, this.basePath)); + } } - diff --git a/client/src/generated/api/get-instrument-types-api.ts b/client/src/generated/api/get-instrument-types-api.ts index 30a848b7..f15be6ba 100644 --- a/client/src/generated/api/get-instrument-types-api.ts +++ b/client/src/generated/api/get-instrument-types-api.ts @@ -12,99 +12,155 @@ * Do not edit the class manually. */ - -import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; +import type { Configuration } from "../configuration"; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; +import globalAxios from "axios"; // Some imports not used depending on template conditions // @ts-ignore -import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "../common"; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +import { + BASE_PATH, + COLLECTION_FORMATS, + type RequestArgs, + BaseAPI, + RequiredError, + operationServerMap, +} from "../base"; // @ts-ignore -import type { ClientError } from '../model'; +import type { ClientError } from "../model"; // @ts-ignore -import type { GetInstrumentTypesResponse } from '../model'; +import type { GetInstrumentTypesResponse } from "../model"; // @ts-ignore -import type { ServerError } from '../model'; +import type { ServerError } from "../model"; /** * GetInstrumentTypesApi - axios parameter creator * @export */ -export const GetInstrumentTypesApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Get Instrument Types - * @summary Get Instrument Types - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getInstrumentTypes: async (options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/instrument/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; +export const GetInstrumentTypesApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + /** + * Get Instrument Types + * @summary Get Instrument Types + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInstrumentTypes: async ( + options: RawAxiosRequestConfig = {}, + ): Promise => { + const localVarPath = `/instrument/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}; + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; }; /** * GetInstrumentTypesApi - functional programming interface * @export */ -export const GetInstrumentTypesApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = GetInstrumentTypesApiAxiosParamCreator(configuration) - return { - /** - * Get Instrument Types - * @summary Get Instrument Types - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getInstrumentTypes(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getInstrumentTypes(options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['GetInstrumentTypesApi.getInstrumentTypes']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } +export const GetInstrumentTypesApiFp = function ( + configuration?: Configuration, +) { + const localVarAxiosParamCreator = + GetInstrumentTypesApiAxiosParamCreator(configuration); + return { + /** + * Get Instrument Types + * @summary Get Instrument Types + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getInstrumentTypes( + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.getInstrumentTypes(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = + operationServerMap["GetInstrumentTypesApi.getInstrumentTypes"]?.[ + localVarOperationServerIndex + ]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, localVarOperationServerBasePath || basePath); + }, + }; }; /** * GetInstrumentTypesApi - factory interface * @export */ -export const GetInstrumentTypesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = GetInstrumentTypesApiFp(configuration) - return { - /** - * Get Instrument Types - * @summary Get Instrument Types - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getInstrumentTypes(options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getInstrumentTypes(options).then((request) => request(axios, basePath)); - }, - }; +export const GetInstrumentTypesApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = GetInstrumentTypesApiFp(configuration); + return { + /** + * Get Instrument Types + * @summary Get Instrument Types + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInstrumentTypes( + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .getInstrumentTypes(options) + .then((request) => request(axios, basePath)); + }, + }; }; /** @@ -114,15 +170,16 @@ export const GetInstrumentTypesApiFactory = function (configuration?: Configurat * @extends {BaseAPI} */ export class GetInstrumentTypesApi extends BaseAPI { - /** - * Get Instrument Types - * @summary Get Instrument Types - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof GetInstrumentTypesApi - */ - public getInstrumentTypes(options?: RawAxiosRequestConfig) { - return GetInstrumentTypesApiFp(this.configuration).getInstrumentTypes(options).then((request) => request(this.axios, this.basePath)); - } + /** + * Get Instrument Types + * @summary Get Instrument Types + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GetInstrumentTypesApi + */ + public getInstrumentTypes(options?: RawAxiosRequestConfig) { + return GetInstrumentTypesApiFp(this.configuration) + .getInstrumentTypes(options) + .then((request) => request(this.axios, this.basePath)); + } } - diff --git a/client/src/generated/api/get-instruments-by-criteria-api.ts b/client/src/generated/api/get-instruments-by-criteria-api.ts index 8f91e226..8d9d1858 100644 --- a/client/src/generated/api/get-instruments-by-criteria-api.ts +++ b/client/src/generated/api/get-instruments-by-criteria-api.ts @@ -12,109 +12,179 @@ * Do not edit the class manually. */ - -import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; +import type { Configuration } from "../configuration"; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; +import globalAxios from "axios"; // Some imports not used depending on template conditions // @ts-ignore -import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "../common"; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +import { + BASE_PATH, + COLLECTION_FORMATS, + type RequestArgs, + BaseAPI, + RequiredError, + operationServerMap, +} from "../base"; // @ts-ignore -import type { ClientError } from '../model'; +import type { ClientError } from "../model"; // @ts-ignore -import type { GetInstrumentCriteriaRequestBody } from '../model'; +import type { GetInstrumentCriteriaRequestBody } from "../model"; // @ts-ignore -import type { GetInstrumentsByCriteriaResponse } from '../model'; +import type { GetInstrumentsByCriteriaResponse } from "../model"; // @ts-ignore -import type { ServerError } from '../model'; +import type { ServerError } from "../model"; /** * GetInstrumentsByCriteriaApi - axios parameter creator * @export */ -export const GetInstrumentsByCriteriaApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Get Instruments by Criteria - * @summary Get Instruments by Criteria - * @param {GetInstrumentCriteriaRequestBody} getInstrumentCriteriaRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getInstrumentsByCriteria: async (getInstrumentCriteriaRequestBody: GetInstrumentCriteriaRequestBody, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'getInstrumentCriteriaRequestBody' is not null or undefined - assertParamExists('getInstrumentsByCriteria', 'getInstrumentCriteriaRequestBody', getInstrumentCriteriaRequestBody) - const localVarPath = `/instruments`; - // 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: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; +export const GetInstrumentsByCriteriaApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + /** + * Get Instruments by Criteria + * @summary Get Instruments by Criteria + * @param {GetInstrumentCriteriaRequestBody} getInstrumentCriteriaRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInstrumentsByCriteria: async ( + getInstrumentCriteriaRequestBody: GetInstrumentCriteriaRequestBody, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'getInstrumentCriteriaRequestBody' is not null or undefined + assertParamExists( + "getInstrumentsByCriteria", + "getInstrumentCriteriaRequestBody", + getInstrumentCriteriaRequestBody, + ); + const localVarPath = `/instruments`; + // 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: "POST", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; - - localVarHeaderParameter['Content-Type'] = 'application/json'; + localVarHeaderParameter["Content-Type"] = "application/json"; - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(getInstrumentCriteriaRequestBody, localVarRequestOptions, configuration) + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + getInstrumentCriteriaRequestBody, + localVarRequestOptions, + configuration, + ); - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; }; /** * GetInstrumentsByCriteriaApi - functional programming interface * @export */ -export const GetInstrumentsByCriteriaApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = GetInstrumentsByCriteriaApiAxiosParamCreator(configuration) - return { - /** - * Get Instruments by Criteria - * @summary Get Instruments by Criteria - * @param {GetInstrumentCriteriaRequestBody} getInstrumentCriteriaRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getInstrumentsByCriteria(getInstrumentCriteriaRequestBody: GetInstrumentCriteriaRequestBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getInstrumentsByCriteria(getInstrumentCriteriaRequestBody, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['GetInstrumentsByCriteriaApi.getInstrumentsByCriteria']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } +export const GetInstrumentsByCriteriaApiFp = function ( + configuration?: Configuration, +) { + const localVarAxiosParamCreator = + GetInstrumentsByCriteriaApiAxiosParamCreator(configuration); + return { + /** + * Get Instruments by Criteria + * @summary Get Instruments by Criteria + * @param {GetInstrumentCriteriaRequestBody} getInstrumentCriteriaRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getInstrumentsByCriteria( + getInstrumentCriteriaRequestBody: GetInstrumentCriteriaRequestBody, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.getInstrumentsByCriteria( + getInstrumentCriteriaRequestBody, + options, + ); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = + operationServerMap[ + "GetInstrumentsByCriteriaApi.getInstrumentsByCriteria" + ]?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, localVarOperationServerBasePath || basePath); + }, + }; }; /** * GetInstrumentsByCriteriaApi - factory interface * @export */ -export const GetInstrumentsByCriteriaApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = GetInstrumentsByCriteriaApiFp(configuration) - return { - /** - * Get Instruments by Criteria - * @summary Get Instruments by Criteria - * @param {GetInstrumentCriteriaRequestBody} getInstrumentCriteriaRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getInstrumentsByCriteria(getInstrumentCriteriaRequestBody: GetInstrumentCriteriaRequestBody, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getInstrumentsByCriteria(getInstrumentCriteriaRequestBody, options).then((request) => request(axios, basePath)); - }, - }; +export const GetInstrumentsByCriteriaApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = GetInstrumentsByCriteriaApiFp(configuration); + return { + /** + * Get Instruments by Criteria + * @summary Get Instruments by Criteria + * @param {GetInstrumentCriteriaRequestBody} getInstrumentCriteriaRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInstrumentsByCriteria( + getInstrumentCriteriaRequestBody: GetInstrumentCriteriaRequestBody, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .getInstrumentsByCriteria(getInstrumentCriteriaRequestBody, options) + .then((request) => request(axios, basePath)); + }, + }; }; /** @@ -124,16 +194,20 @@ export const GetInstrumentsByCriteriaApiFactory = function (configuration?: Conf * @extends {BaseAPI} */ export class GetInstrumentsByCriteriaApi extends BaseAPI { - /** - * Get Instruments by Criteria - * @summary Get Instruments by Criteria - * @param {GetInstrumentCriteriaRequestBody} getInstrumentCriteriaRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof GetInstrumentsByCriteriaApi - */ - public getInstrumentsByCriteria(getInstrumentCriteriaRequestBody: GetInstrumentCriteriaRequestBody, options?: RawAxiosRequestConfig) { - return GetInstrumentsByCriteriaApiFp(this.configuration).getInstrumentsByCriteria(getInstrumentCriteriaRequestBody, options).then((request) => request(this.axios, this.basePath)); - } + /** + * Get Instruments by Criteria + * @summary Get Instruments by Criteria + * @param {GetInstrumentCriteriaRequestBody} getInstrumentCriteriaRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GetInstrumentsByCriteriaApi + */ + public getInstrumentsByCriteria( + getInstrumentCriteriaRequestBody: GetInstrumentCriteriaRequestBody, + options?: RawAxiosRequestConfig, + ) { + return GetInstrumentsByCriteriaApiFp(this.configuration) + .getInstrumentsByCriteria(getInstrumentCriteriaRequestBody, options) + .then((request) => request(this.axios, this.basePath)); + } } - diff --git a/client/src/generated/api/get-instruments-by-criteria-paginated-api.ts b/client/src/generated/api/get-instruments-by-criteria-paginated-api.ts index 68d40a42..1f6c7b84 100644 --- a/client/src/generated/api/get-instruments-by-criteria-paginated-api.ts +++ b/client/src/generated/api/get-instruments-by-criteria-paginated-api.ts @@ -12,127 +12,218 @@ * Do not edit the class manually. */ - -import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; +import type { Configuration } from "../configuration"; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; +import globalAxios from "axios"; // Some imports not used depending on template conditions // @ts-ignore -import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "../common"; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +import { + BASE_PATH, + COLLECTION_FORMATS, + type RequestArgs, + BaseAPI, + RequiredError, + operationServerMap, +} from "../base"; // @ts-ignore -import type { ClientError } from '../model'; +import type { ClientError } from "../model"; // @ts-ignore -import type { GetInstrumentByCriteriaPageResponse } from '../model'; +import type { GetInstrumentByCriteriaPageResponse } from "../model"; // @ts-ignore -import type { GetInstrumentCriteriaRequestBody } from '../model'; +import type { GetInstrumentCriteriaRequestBody } from "../model"; // @ts-ignore -import type { ServerError } from '../model'; +import type { ServerError } from "../model"; /** * GetInstrumentsByCriteriaPaginatedApi - axios parameter creator * @export */ -export const GetInstrumentsByCriteriaPaginatedApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Get Instruments by Criteria Paginated - * @summary Get Instruments by Criteria Paginated - * @param {number} pageSize Page Size - * @param {number} pageNumber Page Number (1-based enumeration) - * @param {GetInstrumentCriteriaRequestBody} getInstrumentCriteriaRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getInstrumentsByCriteriaPaginated: async (pageSize: number, pageNumber: number, getInstrumentCriteriaRequestBody: GetInstrumentCriteriaRequestBody, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'pageSize' is not null or undefined - assertParamExists('getInstrumentsByCriteriaPaginated', 'pageSize', pageSize) - // verify required parameter 'pageNumber' is not null or undefined - assertParamExists('getInstrumentsByCriteriaPaginated', 'pageNumber', pageNumber) - // verify required parameter 'getInstrumentCriteriaRequestBody' is not null or undefined - assertParamExists('getInstrumentsByCriteriaPaginated', 'getInstrumentCriteriaRequestBody', getInstrumentCriteriaRequestBody) - const localVarPath = `/instruments/paginated`; - // 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: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; +export const GetInstrumentsByCriteriaPaginatedApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + /** + * Get Instruments by Criteria Paginated + * @summary Get Instruments by Criteria Paginated + * @param {number} pageSize Page Size + * @param {number} pageNumber Page Number (1-based enumeration) + * @param {GetInstrumentCriteriaRequestBody} getInstrumentCriteriaRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInstrumentsByCriteriaPaginated: async ( + pageSize: number, + pageNumber: number, + getInstrumentCriteriaRequestBody: GetInstrumentCriteriaRequestBody, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'pageSize' is not null or undefined + assertParamExists( + "getInstrumentsByCriteriaPaginated", + "pageSize", + pageSize, + ); + // verify required parameter 'pageNumber' is not null or undefined + assertParamExists( + "getInstrumentsByCriteriaPaginated", + "pageNumber", + pageNumber, + ); + // verify required parameter 'getInstrumentCriteriaRequestBody' is not null or undefined + assertParamExists( + "getInstrumentsByCriteriaPaginated", + "getInstrumentCriteriaRequestBody", + getInstrumentCriteriaRequestBody, + ); + const localVarPath = `/instruments/paginated`; + // 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; + } - if (pageSize !== undefined) { - localVarQueryParameter['page_size'] = pageSize; - } + const localVarRequestOptions = { + method: "POST", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; - if (pageNumber !== undefined) { - localVarQueryParameter['page_number'] = pageNumber; - } + if (pageSize !== undefined) { + localVarQueryParameter["page_size"] = pageSize; + } + if (pageNumber !== undefined) { + localVarQueryParameter["page_number"] = pageNumber; + } - - localVarHeaderParameter['Content-Type'] = 'application/json'; + localVarHeaderParameter["Content-Type"] = "application/json"; - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(getInstrumentCriteriaRequestBody, localVarRequestOptions, configuration) + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + getInstrumentCriteriaRequestBody, + localVarRequestOptions, + configuration, + ); - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; }; /** * GetInstrumentsByCriteriaPaginatedApi - functional programming interface * @export */ -export const GetInstrumentsByCriteriaPaginatedApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = GetInstrumentsByCriteriaPaginatedApiAxiosParamCreator(configuration) - return { - /** - * Get Instruments by Criteria Paginated - * @summary Get Instruments by Criteria Paginated - * @param {number} pageSize Page Size - * @param {number} pageNumber Page Number (1-based enumeration) - * @param {GetInstrumentCriteriaRequestBody} getInstrumentCriteriaRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getInstrumentsByCriteriaPaginated(pageSize: number, pageNumber: number, getInstrumentCriteriaRequestBody: GetInstrumentCriteriaRequestBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getInstrumentsByCriteriaPaginated(pageSize, pageNumber, getInstrumentCriteriaRequestBody, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['GetInstrumentsByCriteriaPaginatedApi.getInstrumentsByCriteriaPaginated']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } +export const GetInstrumentsByCriteriaPaginatedApiFp = function ( + configuration?: Configuration, +) { + const localVarAxiosParamCreator = + GetInstrumentsByCriteriaPaginatedApiAxiosParamCreator(configuration); + return { + /** + * Get Instruments by Criteria Paginated + * @summary Get Instruments by Criteria Paginated + * @param {number} pageSize Page Size + * @param {number} pageNumber Page Number (1-based enumeration) + * @param {GetInstrumentCriteriaRequestBody} getInstrumentCriteriaRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getInstrumentsByCriteriaPaginated( + pageSize: number, + pageNumber: number, + getInstrumentCriteriaRequestBody: GetInstrumentCriteriaRequestBody, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.getInstrumentsByCriteriaPaginated( + pageSize, + pageNumber, + getInstrumentCriteriaRequestBody, + options, + ); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = + operationServerMap[ + "GetInstrumentsByCriteriaPaginatedApi.getInstrumentsByCriteriaPaginated" + ]?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, localVarOperationServerBasePath || basePath); + }, + }; }; /** * GetInstrumentsByCriteriaPaginatedApi - factory interface * @export */ -export const GetInstrumentsByCriteriaPaginatedApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = GetInstrumentsByCriteriaPaginatedApiFp(configuration) - return { - /** - * Get Instruments by Criteria Paginated - * @summary Get Instruments by Criteria Paginated - * @param {number} pageSize Page Size - * @param {number} pageNumber Page Number (1-based enumeration) - * @param {GetInstrumentCriteriaRequestBody} getInstrumentCriteriaRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getInstrumentsByCriteriaPaginated(pageSize: number, pageNumber: number, getInstrumentCriteriaRequestBody: GetInstrumentCriteriaRequestBody, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getInstrumentsByCriteriaPaginated(pageSize, pageNumber, getInstrumentCriteriaRequestBody, options).then((request) => request(axios, basePath)); - }, - }; +export const GetInstrumentsByCriteriaPaginatedApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = GetInstrumentsByCriteriaPaginatedApiFp(configuration); + return { + /** + * Get Instruments by Criteria Paginated + * @summary Get Instruments by Criteria Paginated + * @param {number} pageSize Page Size + * @param {number} pageNumber Page Number (1-based enumeration) + * @param {GetInstrumentCriteriaRequestBody} getInstrumentCriteriaRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInstrumentsByCriteriaPaginated( + pageSize: number, + pageNumber: number, + getInstrumentCriteriaRequestBody: GetInstrumentCriteriaRequestBody, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .getInstrumentsByCriteriaPaginated( + pageSize, + pageNumber, + getInstrumentCriteriaRequestBody, + options, + ) + .then((request) => request(axios, basePath)); + }, + }; }; /** @@ -142,18 +233,29 @@ export const GetInstrumentsByCriteriaPaginatedApiFactory = function (configurati * @extends {BaseAPI} */ export class GetInstrumentsByCriteriaPaginatedApi extends BaseAPI { - /** - * Get Instruments by Criteria Paginated - * @summary Get Instruments by Criteria Paginated - * @param {number} pageSize Page Size - * @param {number} pageNumber Page Number (1-based enumeration) - * @param {GetInstrumentCriteriaRequestBody} getInstrumentCriteriaRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof GetInstrumentsByCriteriaPaginatedApi - */ - public getInstrumentsByCriteriaPaginated(pageSize: number, pageNumber: number, getInstrumentCriteriaRequestBody: GetInstrumentCriteriaRequestBody, options?: RawAxiosRequestConfig) { - return GetInstrumentsByCriteriaPaginatedApiFp(this.configuration).getInstrumentsByCriteriaPaginated(pageSize, pageNumber, getInstrumentCriteriaRequestBody, options).then((request) => request(this.axios, this.basePath)); - } + /** + * Get Instruments by Criteria Paginated + * @summary Get Instruments by Criteria Paginated + * @param {number} pageSize Page Size + * @param {number} pageNumber Page Number (1-based enumeration) + * @param {GetInstrumentCriteriaRequestBody} getInstrumentCriteriaRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GetInstrumentsByCriteriaPaginatedApi + */ + public getInstrumentsByCriteriaPaginated( + pageSize: number, + pageNumber: number, + getInstrumentCriteriaRequestBody: GetInstrumentCriteriaRequestBody, + options?: RawAxiosRequestConfig, + ) { + return GetInstrumentsByCriteriaPaginatedApiFp(this.configuration) + .getInstrumentsByCriteriaPaginated( + pageSize, + pageNumber, + getInstrumentCriteriaRequestBody, + options, + ) + .then((request) => request(this.axios, this.basePath)); + } } - diff --git a/client/src/generated/api/get-user-profile-api.ts b/client/src/generated/api/get-user-profile-api.ts index c89fa024..b571146c 100644 --- a/client/src/generated/api/get-user-profile-api.ts +++ b/client/src/generated/api/get-user-profile-api.ts @@ -12,97 +12,146 @@ * Do not edit the class manually. */ - -import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; +import type { Configuration } from "../configuration"; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; +import globalAxios from "axios"; // Some imports not used depending on template conditions // @ts-ignore -import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "../common"; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +import { + BASE_PATH, + COLLECTION_FORMATS, + type RequestArgs, + BaseAPI, + RequiredError, + operationServerMap, +} from "../base"; // @ts-ignore -import type { ProfileDetails } from '../model'; +import type { ProfileDetails } from "../model"; // @ts-ignore -import type { ServerError } from '../model'; +import type { ServerError } from "../model"; /** * GetUserProfileApi - axios parameter creator * @export */ -export const GetUserProfileApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Get User Profile - * @summary Get Profile Info - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getProfile: async (options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/profile`; - // 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; +export const GetUserProfileApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + /** + * Get User Profile + * @summary Get Profile Info + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getProfile: async ( + options: RawAxiosRequestConfig = {}, + ): Promise => { + const localVarPath = `/profile`; + // 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}; + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; }; /** * GetUserProfileApi - functional programming interface * @export */ -export const GetUserProfileApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = GetUserProfileApiAxiosParamCreator(configuration) - return { - /** - * Get User Profile - * @summary Get Profile Info - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getProfile(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getProfile(options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['GetUserProfileApi.getProfile']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } +export const GetUserProfileApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = + GetUserProfileApiAxiosParamCreator(configuration); + return { + /** + * Get User Profile + * @summary Get Profile Info + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getProfile( + options?: RawAxiosRequestConfig, + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.getProfile(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = + operationServerMap["GetUserProfileApi.getProfile"]?.[ + localVarOperationServerIndex + ]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, localVarOperationServerBasePath || basePath); + }, + }; }; /** * GetUserProfileApi - factory interface * @export */ -export const GetUserProfileApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = GetUserProfileApiFp(configuration) - return { - /** - * Get User Profile - * @summary Get Profile Info - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getProfile(options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getProfile(options).then((request) => request(axios, basePath)); - }, - }; +export const GetUserProfileApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = GetUserProfileApiFp(configuration); + return { + /** + * Get User Profile + * @summary Get Profile Info + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getProfile(options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp + .getProfile(options) + .then((request) => request(axios, basePath)); + }, + }; }; /** @@ -112,15 +161,16 @@ export const GetUserProfileApiFactory = function (configuration?: Configuration, * @extends {BaseAPI} */ export class GetUserProfileApi extends BaseAPI { - /** - * Get User Profile - * @summary Get Profile Info - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof GetUserProfileApi - */ - public getProfile(options?: RawAxiosRequestConfig) { - return GetUserProfileApiFp(this.configuration).getProfile(options).then((request) => request(this.axios, this.basePath)); - } + /** + * Get User Profile + * @summary Get Profile Info + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GetUserProfileApi + */ + public getProfile(options?: RawAxiosRequestConfig) { + return GetUserProfileApiFp(this.configuration) + .getProfile(options) + .then((request) => request(this.axios, this.basePath)); + } } - diff --git a/client/src/generated/api/list-favorite-api.ts b/client/src/generated/api/list-favorite-api.ts index 82b7e8a1..cc210819 100644 --- a/client/src/generated/api/list-favorite-api.ts +++ b/client/src/generated/api/list-favorite-api.ts @@ -12,99 +12,153 @@ * Do not edit the class manually. */ - -import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; +import type { Configuration } from "../configuration"; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; +import globalAxios from "axios"; // Some imports not used depending on template conditions // @ts-ignore -import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "../common"; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +import { + BASE_PATH, + COLLECTION_FORMATS, + type RequestArgs, + BaseAPI, + RequiredError, + operationServerMap, +} from "../base"; // @ts-ignore -import type { ClientError } from '../model'; +import type { ClientError } from "../model"; // @ts-ignore -import type { ListFavoriteResponseBody } from '../model'; +import type { ListFavoriteResponseBody } from "../model"; // @ts-ignore -import type { ServerError } from '../model'; +import type { ServerError } from "../model"; /** * ListFavoriteApi - axios parameter creator * @export */ -export const ListFavoriteApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * List Favorite - * @summary List Favorite - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listFavorite: async (options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/favorite/list`; - // 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: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; +export const ListFavoriteApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + /** + * List Favorite + * @summary List Favorite + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listFavorite: async ( + options: RawAxiosRequestConfig = {}, + ): Promise => { + const localVarPath = `/favorite/list`; + // 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: "POST", + ...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}; + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; }; /** * ListFavoriteApi - functional programming interface * @export */ -export const ListFavoriteApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = ListFavoriteApiAxiosParamCreator(configuration) - return { - /** - * List Favorite - * @summary List Favorite - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async listFavorite(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.listFavorite(options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ListFavoriteApi.listFavorite']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } +export const ListFavoriteApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = + ListFavoriteApiAxiosParamCreator(configuration); + return { + /** + * List Favorite + * @summary List Favorite + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listFavorite( + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.listFavorite(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = + operationServerMap["ListFavoriteApi.listFavorite"]?.[ + localVarOperationServerIndex + ]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, localVarOperationServerBasePath || basePath); + }, + }; }; /** * ListFavoriteApi - factory interface * @export */ -export const ListFavoriteApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = ListFavoriteApiFp(configuration) - return { - /** - * List Favorite - * @summary List Favorite - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listFavorite(options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.listFavorite(options).then((request) => request(axios, basePath)); - }, - }; +export const ListFavoriteApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = ListFavoriteApiFp(configuration); + return { + /** + * List Favorite + * @summary List Favorite + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listFavorite( + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .listFavorite(options) + .then((request) => request(axios, basePath)); + }, + }; }; /** @@ -114,15 +168,16 @@ export const ListFavoriteApiFactory = function (configuration?: Configuration, b * @extends {BaseAPI} */ export class ListFavoriteApi extends BaseAPI { - /** - * List Favorite - * @summary List Favorite - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ListFavoriteApi - */ - public listFavorite(options?: RawAxiosRequestConfig) { - return ListFavoriteApiFp(this.configuration).listFavorite(options).then((request) => request(this.axios, this.basePath)); - } + /** + * List Favorite + * @summary List Favorite + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ListFavoriteApi + */ + public listFavorite(options?: RawAxiosRequestConfig) { + return ListFavoriteApiFp(this.configuration) + .listFavorite(options) + .then((request) => request(this.axios, this.basePath)); + } } - diff --git a/client/src/generated/api/remove-favorite-api.ts b/client/src/generated/api/remove-favorite-api.ts index f6c13fb1..c561482d 100644 --- a/client/src/generated/api/remove-favorite-api.ts +++ b/client/src/generated/api/remove-favorite-api.ts @@ -12,107 +12,171 @@ * Do not edit the class manually. */ - -import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; +import type { Configuration } from "../configuration"; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; +import globalAxios from "axios"; // Some imports not used depending on template conditions // @ts-ignore -import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "../common"; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +import { + BASE_PATH, + COLLECTION_FORMATS, + type RequestArgs, + BaseAPI, + RequiredError, + operationServerMap, +} from "../base"; // @ts-ignore -import type { ClientError } from '../model'; +import type { ClientError } from "../model"; // @ts-ignore -import type { RemoveFavoriteRequestBody } from '../model'; +import type { RemoveFavoriteRequestBody } from "../model"; // @ts-ignore -import type { ServerError } from '../model'; +import type { ServerError } from "../model"; /** * RemoveFavoriteApi - axios parameter creator * @export */ -export const RemoveFavoriteApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Remove Favorite - * @summary Remove Favorite - * @param {RemoveFavoriteRequestBody} removeFavoriteRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - removeFavorite: async (removeFavoriteRequestBody: RemoveFavoriteRequestBody, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'removeFavoriteRequestBody' is not null or undefined - assertParamExists('removeFavorite', 'removeFavoriteRequestBody', removeFavoriteRequestBody) - const localVarPath = `/favorite/remove`; - // 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: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; +export const RemoveFavoriteApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + /** + * Remove Favorite + * @summary Remove Favorite + * @param {RemoveFavoriteRequestBody} removeFavoriteRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + removeFavorite: async ( + removeFavoriteRequestBody: RemoveFavoriteRequestBody, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'removeFavoriteRequestBody' is not null or undefined + assertParamExists( + "removeFavorite", + "removeFavoriteRequestBody", + removeFavoriteRequestBody, + ); + const localVarPath = `/favorite/remove`; + // 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: "POST", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; - - localVarHeaderParameter['Content-Type'] = 'application/json'; + localVarHeaderParameter["Content-Type"] = "application/json"; - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(removeFavoriteRequestBody, localVarRequestOptions, configuration) + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + removeFavoriteRequestBody, + localVarRequestOptions, + configuration, + ); - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; }; /** * RemoveFavoriteApi - functional programming interface * @export */ -export const RemoveFavoriteApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = RemoveFavoriteApiAxiosParamCreator(configuration) - return { - /** - * Remove Favorite - * @summary Remove Favorite - * @param {RemoveFavoriteRequestBody} removeFavoriteRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async removeFavorite(removeFavoriteRequestBody: RemoveFavoriteRequestBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.removeFavorite(removeFavoriteRequestBody, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['RemoveFavoriteApi.removeFavorite']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } +export const RemoveFavoriteApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = + RemoveFavoriteApiAxiosParamCreator(configuration); + return { + /** + * Remove Favorite + * @summary Remove Favorite + * @param {RemoveFavoriteRequestBody} removeFavoriteRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async removeFavorite( + removeFavoriteRequestBody: RemoveFavoriteRequestBody, + options?: RawAxiosRequestConfig, + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.removeFavorite( + removeFavoriteRequestBody, + options, + ); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = + operationServerMap["RemoveFavoriteApi.removeFavorite"]?.[ + localVarOperationServerIndex + ]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, localVarOperationServerBasePath || basePath); + }, + }; }; /** * RemoveFavoriteApi - factory interface * @export */ -export const RemoveFavoriteApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = RemoveFavoriteApiFp(configuration) - return { - /** - * Remove Favorite - * @summary Remove Favorite - * @param {RemoveFavoriteRequestBody} removeFavoriteRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - removeFavorite(removeFavoriteRequestBody: RemoveFavoriteRequestBody, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.removeFavorite(removeFavoriteRequestBody, options).then((request) => request(axios, basePath)); - }, - }; +export const RemoveFavoriteApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = RemoveFavoriteApiFp(configuration); + return { + /** + * Remove Favorite + * @summary Remove Favorite + * @param {RemoveFavoriteRequestBody} removeFavoriteRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + removeFavorite( + removeFavoriteRequestBody: RemoveFavoriteRequestBody, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .removeFavorite(removeFavoriteRequestBody, options) + .then((request) => request(axios, basePath)); + }, + }; }; /** @@ -122,16 +186,20 @@ export const RemoveFavoriteApiFactory = function (configuration?: Configuration, * @extends {BaseAPI} */ export class RemoveFavoriteApi extends BaseAPI { - /** - * Remove Favorite - * @summary Remove Favorite - * @param {RemoveFavoriteRequestBody} removeFavoriteRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RemoveFavoriteApi - */ - public removeFavorite(removeFavoriteRequestBody: RemoveFavoriteRequestBody, options?: RawAxiosRequestConfig) { - return RemoveFavoriteApiFp(this.configuration).removeFavorite(removeFavoriteRequestBody, options).then((request) => request(this.axios, this.basePath)); - } + /** + * Remove Favorite + * @summary Remove Favorite + * @param {RemoveFavoriteRequestBody} removeFavoriteRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RemoveFavoriteApi + */ + public removeFavorite( + removeFavoriteRequestBody: RemoveFavoriteRequestBody, + options?: RawAxiosRequestConfig, + ) { + return RemoveFavoriteApiFp(this.configuration) + .removeFavorite(removeFavoriteRequestBody, options) + .then((request) => request(this.axios, this.basePath)); + } } - diff --git a/client/src/generated/api/user-registration-api.ts b/client/src/generated/api/user-registration-api.ts index d321fb27..0c151b7e 100644 --- a/client/src/generated/api/user-registration-api.ts +++ b/client/src/generated/api/user-registration-api.ts @@ -12,105 +12,170 @@ * Do not edit the class manually. */ - -import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; +import type { Configuration } from "../configuration"; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; +import globalAxios from "axios"; // Some imports not used depending on template conditions // @ts-ignore -import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "../common"; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +import { + BASE_PATH, + COLLECTION_FORMATS, + type RequestArgs, + BaseAPI, + RequiredError, + operationServerMap, +} from "../base"; // @ts-ignore -import type { RegistrationRequest } from '../model'; +import type { RegistrationRequest } from "../model"; // @ts-ignore -import type { ServerError } from '../model'; +import type { ServerError } from "../model"; /** * UserRegistrationApi - axios parameter creator * @export */ -export const UserRegistrationApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Register User - * @summary User Registration - * @param {RegistrationRequest} registrationRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - userRegistration: async (registrationRequest: RegistrationRequest, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'registrationRequest' is not null or undefined - assertParamExists('userRegistration', 'registrationRequest', registrationRequest) - const localVarPath = `/registration`; - // 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: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; +export const UserRegistrationApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + /** + * Register User + * @summary User Registration + * @param {RegistrationRequest} registrationRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userRegistration: async ( + registrationRequest: RegistrationRequest, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'registrationRequest' is not null or undefined + assertParamExists( + "userRegistration", + "registrationRequest", + registrationRequest, + ); + const localVarPath = `/registration`; + // 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: "POST", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; - - localVarHeaderParameter['Content-Type'] = 'application/json'; + localVarHeaderParameter["Content-Type"] = "application/json"; - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(registrationRequest, localVarRequestOptions, configuration) + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + registrationRequest, + localVarRequestOptions, + configuration, + ); - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; }; /** * UserRegistrationApi - functional programming interface * @export */ -export const UserRegistrationApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = UserRegistrationApiAxiosParamCreator(configuration) - return { - /** - * Register User - * @summary User Registration - * @param {RegistrationRequest} registrationRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async userRegistration(registrationRequest: RegistrationRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.userRegistration(registrationRequest, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['UserRegistrationApi.userRegistration']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } +export const UserRegistrationApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = + UserRegistrationApiAxiosParamCreator(configuration); + return { + /** + * Register User + * @summary User Registration + * @param {RegistrationRequest} registrationRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async userRegistration( + registrationRequest: RegistrationRequest, + options?: RawAxiosRequestConfig, + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.userRegistration( + registrationRequest, + options, + ); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = + operationServerMap["UserRegistrationApi.userRegistration"]?.[ + localVarOperationServerIndex + ]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, localVarOperationServerBasePath || basePath); + }, + }; }; /** * UserRegistrationApi - factory interface * @export */ -export const UserRegistrationApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = UserRegistrationApiFp(configuration) - return { - /** - * Register User - * @summary User Registration - * @param {RegistrationRequest} registrationRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - userRegistration(registrationRequest: RegistrationRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.userRegistration(registrationRequest, options).then((request) => request(axios, basePath)); - }, - }; +export const UserRegistrationApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = UserRegistrationApiFp(configuration); + return { + /** + * Register User + * @summary User Registration + * @param {RegistrationRequest} registrationRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userRegistration( + registrationRequest: RegistrationRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .userRegistration(registrationRequest, options) + .then((request) => request(axios, basePath)); + }, + }; }; /** @@ -120,16 +185,20 @@ export const UserRegistrationApiFactory = function (configuration?: Configuratio * @extends {BaseAPI} */ export class UserRegistrationApi extends BaseAPI { - /** - * Register User - * @summary User Registration - * @param {RegistrationRequest} registrationRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UserRegistrationApi - */ - public userRegistration(registrationRequest: RegistrationRequest, options?: RawAxiosRequestConfig) { - return UserRegistrationApiFp(this.configuration).userRegistration(registrationRequest, options).then((request) => request(this.axios, this.basePath)); - } + /** + * Register User + * @summary User Registration + * @param {RegistrationRequest} registrationRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserRegistrationApi + */ + public userRegistration( + registrationRequest: RegistrationRequest, + options?: RawAxiosRequestConfig, + ) { + return UserRegistrationApiFp(this.configuration) + .userRegistration(registrationRequest, options) + .then((request) => request(this.axios, this.basePath)); + } } - diff --git a/client/src/generated/base.ts b/client/src/generated/base.ts index 22fbb303..15c4c9d8 100644 --- a/client/src/generated/base.ts +++ b/client/src/generated/base.ts @@ -12,12 +12,11 @@ * Do not edit the class manually. */ - -import type { Configuration } from './configuration'; +import type { Configuration } from "./configuration"; // Some imports not used depending on template conditions // @ts-ignore -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; +import globalAxios from "axios"; export const BASE_PATH = "http://localhost:8080/api".replace(/\/+$/, ""); @@ -26,10 +25,10 @@ export const BASE_PATH = "http://localhost:8080/api".replace(/\/+$/, ""); * @export */ export const COLLECTION_FORMATS = { - csv: ",", - ssv: " ", - tsv: "\t", - pipes: "|", + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", }; /** @@ -38,8 +37,8 @@ export const COLLECTION_FORMATS = { * @interface RequestArgs */ export interface RequestArgs { - url: string; - options: RawAxiosRequestConfig; + url: string; + options: RawAxiosRequestConfig; } /** @@ -48,15 +47,19 @@ export interface RequestArgs { * @class BaseAPI */ export class BaseAPI { - protected configuration: Configuration | undefined; + protected configuration: Configuration | undefined; - constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) { - if (configuration) { - this.configuration = configuration; - this.basePath = configuration.basePath ?? basePath; - } + constructor( + configuration?: Configuration, + protected basePath: string = BASE_PATH, + protected axios: AxiosInstance = globalAxios, + ) { + if (configuration) { + this.configuration = configuration; + this.basePath = configuration.basePath ?? basePath; } -}; + } +} /** * @@ -65,22 +68,24 @@ export class BaseAPI { * @extends {Error} */ export class RequiredError extends Error { - constructor(public field: string, msg?: string) { - super(msg); - this.name = "RequiredError" - } + constructor( + public field: string, + msg?: string, + ) { + super(msg); + this.name = "RequiredError"; + } } interface ServerMap { - [key: string]: { - url: string, - description: string, - }[]; + [key: string]: { + url: string; + description: string; + }[]; } /** * * @export */ -export const operationServerMap: ServerMap = { -} +export const operationServerMap: ServerMap = {}; diff --git a/client/src/generated/common.ts b/client/src/generated/common.ts index 6620ffaf..4b31eed7 100644 --- a/client/src/generated/common.ts +++ b/client/src/generated/common.ts @@ -12,98 +12,132 @@ * Do not edit the class manually. */ - import type { Configuration } from "./configuration"; import type { RequestArgs } from "./base"; -import type { AxiosInstance, AxiosResponse } from 'axios'; +import type { AxiosInstance, AxiosResponse } from "axios"; import { RequiredError } from "./base"; /** * * @export */ -export const DUMMY_BASE_URL = 'https://example.com' +export const DUMMY_BASE_URL = "https://example.com"; /** * * @throws {RequiredError} * @export */ -export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) { - if (paramValue === null || paramValue === undefined) { - throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`); - } -} +export const assertParamExists = function ( + functionName: string, + paramName: string, + paramValue: unknown, +) { + if (paramValue === null || paramValue === undefined) { + throw new RequiredError( + paramName, + `Required parameter ${paramName} was null or undefined when calling ${functionName}.`, + ); + } +}; /** * * @export */ -export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) { - if (configuration && configuration.apiKey) { - const localVarApiKeyValue = typeof configuration.apiKey === 'function' - ? await configuration.apiKey(keyParamName) - : await configuration.apiKey; - object[keyParamName] = localVarApiKeyValue; - } -} +export const setApiKeyToObject = async function ( + object: any, + keyParamName: string, + configuration?: Configuration, +) { + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = + typeof configuration.apiKey === "function" + ? await configuration.apiKey(keyParamName) + : await configuration.apiKey; + object[keyParamName] = localVarApiKeyValue; + } +}; /** * * @export */ -export const setBasicAuthToObject = function (object: any, configuration?: Configuration) { - if (configuration && (configuration.username || configuration.password)) { - object["auth"] = { username: configuration.username, password: configuration.password }; - } -} +export const setBasicAuthToObject = function ( + object: any, + configuration?: Configuration, +) { + if (configuration && (configuration.username || configuration.password)) { + object["auth"] = { + username: configuration.username, + password: configuration.password, + }; + } +}; /** * * @export */ -export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) { - if (configuration && configuration.accessToken) { - const accessToken = typeof configuration.accessToken === 'function' - ? await configuration.accessToken() - : await configuration.accessToken; - object["Authorization"] = "Bearer " + accessToken; - } -} +export const setBearerAuthToObject = async function ( + object: any, + configuration?: Configuration, +) { + if (configuration && configuration.accessToken) { + const accessToken = + typeof configuration.accessToken === "function" + ? await configuration.accessToken() + : await configuration.accessToken; + object["Authorization"] = "Bearer " + accessToken; + } +}; /** * * @export */ -export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) { - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken(name, scopes) - : await configuration.accessToken; - object["Authorization"] = "Bearer " + localVarAccessTokenValue; - } -} +export const setOAuthToObject = async function ( + object: any, + name: string, + scopes: string[], + configuration?: Configuration, +) { + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = + typeof configuration.accessToken === "function" + ? await configuration.accessToken(name, scopes) + : await configuration.accessToken; + object["Authorization"] = "Bearer " + localVarAccessTokenValue; + } +}; -function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void { - if (parameter == null) return; - if (typeof parameter === "object") { - if (Array.isArray(parameter)) { - (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key)); - } - else { - Object.keys(parameter).forEach(currentKey => - setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`) - ); - } - } - else { - if (urlSearchParams.has(key)) { - urlSearchParams.append(key, parameter); - } - else { - urlSearchParams.set(key, parameter); - } +function setFlattenedQueryParams( + urlSearchParams: URLSearchParams, + parameter: any, + key: string = "", +): void { + if (parameter == null) return; + if (typeof parameter === "object") { + if (Array.isArray(parameter)) { + (parameter as any[]).forEach((item) => + setFlattenedQueryParams(urlSearchParams, item, key), + ); + } else { + Object.keys(parameter).forEach((currentKey) => + setFlattenedQueryParams( + urlSearchParams, + parameter[currentKey], + `${key}${key !== "" ? "." : ""}${currentKey}`, + ), + ); + } + } else { + if (urlSearchParams.has(key)) { + urlSearchParams.append(key, parameter); + } else { + urlSearchParams.set(key, parameter); } + } } /** @@ -111,40 +145,58 @@ function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: an * @export */ export const setSearchParams = function (url: URL, ...objects: any[]) { - const searchParams = new URLSearchParams(url.search); - setFlattenedQueryParams(searchParams, objects); - url.search = searchParams.toString(); -} + const searchParams = new URLSearchParams(url.search); + setFlattenedQueryParams(searchParams, objects); + url.search = searchParams.toString(); +}; /** * * @export */ -export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) { - const nonString = typeof value !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(requestOptions.headers['Content-Type']) - : nonString; - return needsSerialization - ? JSON.stringify(value !== undefined ? value : {}) - : (value || ""); -} +export const serializeDataIfNeeded = function ( + value: any, + requestOptions: any, + configuration?: Configuration, +) { + const nonString = typeof value !== "string"; + const needsSerialization = + nonString && configuration && configuration.isJsonMime + ? configuration.isJsonMime(requestOptions.headers["Content-Type"]) + : nonString; + return needsSerialization + ? JSON.stringify(value !== undefined ? value : {}) + : value || ""; +}; /** * * @export */ export const toPathString = function (url: URL) { - return url.pathname + url.search + url.hash -} + return url.pathname + url.search + url.hash; +}; /** * * @export */ -export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { - return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url}; - return axios.request(axiosRequestArgs); +export const createRequestFunction = function ( + axiosArgs: RequestArgs, + globalAxios: AxiosInstance, + BASE_PATH: string, + configuration?: Configuration, +) { + return >( + axios: AxiosInstance = globalAxios, + basePath: string = BASE_PATH, + ) => { + const axiosRequestArgs = { + ...axiosArgs.options, + url: + (axios.defaults.baseURL ? "" : (configuration?.basePath ?? basePath)) + + axiosArgs.url, }; -} + return axios.request(axiosRequestArgs); + }; +}; diff --git a/client/src/generated/configuration.ts b/client/src/generated/configuration.ts index 4e533bd9..f77a0ed9 100644 --- a/client/src/generated/configuration.ts +++ b/client/src/generated/configuration.ts @@ -12,99 +12,121 @@ * Do not edit the class manually. */ - export interface ConfigurationParameters { - apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); - username?: string; - password?: string; - accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); - basePath?: string; - serverIndex?: number; - baseOptions?: any; - formDataCtor?: new () => any; + apiKey?: + | string + | Promise + | ((name: string) => string) + | ((name: string) => Promise); + username?: string; + password?: string; + accessToken?: + | string + | Promise + | ((name?: string, scopes?: string[]) => string) + | ((name?: string, scopes?: string[]) => Promise); + basePath?: string; + serverIndex?: number; + baseOptions?: any; + formDataCtor?: new () => any; } export class Configuration { - /** - * parameter for apiKey security - * @param name security name - * @memberof Configuration - */ - apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); - /** - * parameter for basic security - * - * @type {string} - * @memberof Configuration - */ - username?: string; - /** - * parameter for basic security - * - * @type {string} - * @memberof Configuration - */ - password?: string; - /** - * parameter for oauth2 security - * @param name security name - * @param scopes oauth2 scope - * @memberof Configuration - */ - accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); - /** - * override base path - * - * @type {string} - * @memberof Configuration - */ - basePath?: string; - /** - * override server index - * - * @type {number} - * @memberof Configuration - */ - serverIndex?: number; - /** - * base options for axios calls - * - * @type {any} - * @memberof Configuration - */ - baseOptions?: any; - /** - * The FormData constructor that will be used to create multipart form data - * requests. You can inject this here so that execution environments that - * do not support the FormData class can still run the generated client. - * - * @type {new () => FormData} - */ - formDataCtor?: new () => any; + /** + * parameter for apiKey security + * @param name security name + * @memberof Configuration + */ + apiKey?: + | string + | Promise + | ((name: string) => string) + | ((name: string) => Promise); + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + username?: string; + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + password?: string; + /** + * parameter for oauth2 security + * @param name security name + * @param scopes oauth2 scope + * @memberof Configuration + */ + accessToken?: + | string + | Promise + | ((name?: string, scopes?: string[]) => string) + | ((name?: string, scopes?: string[]) => Promise); + /** + * override base path + * + * @type {string} + * @memberof Configuration + */ + basePath?: string; + /** + * override server index + * + * @type {number} + * @memberof Configuration + */ + serverIndex?: number; + /** + * base options for axios calls + * + * @type {any} + * @memberof Configuration + */ + baseOptions?: any; + /** + * The FormData constructor that will be used to create multipart form data + * requests. You can inject this here so that execution environments that + * do not support the FormData class can still run the generated client. + * + * @type {new () => FormData} + */ + formDataCtor?: new () => any; - constructor(param: ConfigurationParameters = {}) { - this.apiKey = param.apiKey; - this.username = param.username; - this.password = param.password; - this.accessToken = param.accessToken; - this.basePath = param.basePath; - this.serverIndex = param.serverIndex; - this.baseOptions = param.baseOptions; - this.formDataCtor = param.formDataCtor; - } + constructor(param: ConfigurationParameters = {}) { + this.apiKey = param.apiKey; + this.username = param.username; + this.password = param.password; + this.accessToken = param.accessToken; + this.basePath = param.basePath; + this.serverIndex = param.serverIndex; + this.baseOptions = param.baseOptions; + this.formDataCtor = param.formDataCtor; + } - /** - * Check if the given MIME is a JSON MIME. - * JSON MIME examples: - * application/json - * application/json; charset=UTF8 - * APPLICATION/JSON - * application/vnd.company+json - * @param mime - MIME (Multipurpose Internet Mail Extensions) - * @return True if the given MIME is JSON, false otherwise. - */ - public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); - } + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp( + "^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$", + "i", + ); + return ( + mime !== null && + (jsonMime.test(mime) || + mime.toLowerCase() === "application/json-patch+json") + ); + } } diff --git a/client/src/generated/index.ts b/client/src/generated/index.ts index f096401e..9b106d3e 100644 --- a/client/src/generated/index.ts +++ b/client/src/generated/index.ts @@ -12,7 +12,6 @@ * Do not edit the class manually. */ - export * from "./api"; export * from "./configuration"; export * from "./model"; diff --git a/client/src/generated/model/add-favorite-request-body.ts b/client/src/generated/model/add-favorite-request-body.ts index fd22b036..b8d9d386 100644 --- a/client/src/generated/model/add-favorite-request-body.ts +++ b/client/src/generated/model/add-favorite-request-body.ts @@ -12,19 +12,16 @@ * Do not edit the class manually. */ - - /** - * + * * @export * @interface AddFavoriteRequestBody */ export interface AddFavoriteRequestBody { - /** - * - * @type {number} - * @memberof AddFavoriteRequestBody - */ - 'instrument_id': number; + /** + * + * @type {number} + * @memberof AddFavoriteRequestBody + */ + instrument_id: number; } - diff --git a/client/src/generated/model/client-error.ts b/client/src/generated/model/client-error.ts index 07ee85ab..f19c4775 100644 --- a/client/src/generated/model/client-error.ts +++ b/client/src/generated/model/client-error.ts @@ -12,19 +12,16 @@ * Do not edit the class manually. */ - - /** - * + * * @export * @interface ClientError */ export interface ClientError { - /** - * Error description - * @type {string} - * @memberof ClientError - */ - 'message': string; + /** + * Error description + * @type {string} + * @memberof ClientError + */ + message: string; } - diff --git a/client/src/generated/model/get-instrument-basic-materials-response.ts b/client/src/generated/model/get-instrument-basic-materials-response.ts index 390c5ed2..036e22db 100644 --- a/client/src/generated/model/get-instrument-basic-materials-response.ts +++ b/client/src/generated/model/get-instrument-basic-materials-response.ts @@ -12,22 +12,20 @@ * Do not edit the class manually. */ - // May contain unused imports in some cases // @ts-ignore -import type { InstrumentBasicMaterial } from './instrument-basic-material'; +import type { InstrumentBasicMaterial } from "./instrument-basic-material"; /** - * + * * @export * @interface GetInstrumentBasicMaterialsResponse */ export interface GetInstrumentBasicMaterialsResponse { - /** - * - * @type {Array} - * @memberof GetInstrumentBasicMaterialsResponse - */ - 'content': Array; + /** + * + * @type {Array} + * @memberof GetInstrumentBasicMaterialsResponse + */ + content: Array; } - diff --git a/client/src/generated/model/get-instrument-by-criteria-page-response.ts b/client/src/generated/model/get-instrument-by-criteria-page-response.ts index 4084033a..335daef2 100644 --- a/client/src/generated/model/get-instrument-by-criteria-page-response.ts +++ b/client/src/generated/model/get-instrument-by-criteria-page-response.ts @@ -12,52 +12,50 @@ * Do not edit the class manually. */ - // May contain unused imports in some cases // @ts-ignore -import type { InstrumentDetail } from './instrument-detail'; +import type { InstrumentDetail } from "./instrument-detail"; /** - * + * * @export * @interface GetInstrumentByCriteriaPageResponse */ export interface GetInstrumentByCriteriaPageResponse { - /** - * - * @type {Array} - * @memberof GetInstrumentByCriteriaPageResponse - */ - 'content': Array; - /** - * The number of items in the content. - * @type {number} - * @memberof GetInstrumentByCriteriaPageResponse - */ - 'content_size': number; - /** - * The number of items per page. - * @type {number} - * @memberof GetInstrumentByCriteriaPageResponse - */ - 'page_size': number; - /** - * The current page number (0-based index). - * @type {number} - * @memberof GetInstrumentByCriteriaPageResponse - */ - 'page_number': number; - /** - * The total number of elements across all pages. - * @type {number} - * @memberof GetInstrumentByCriteriaPageResponse - */ - 'total_elements': number; - /** - * The total number of pages. - * @type {number} - * @memberof GetInstrumentByCriteriaPageResponse - */ - 'total_pages': number; + /** + * + * @type {Array} + * @memberof GetInstrumentByCriteriaPageResponse + */ + content: Array; + /** + * The number of items in the content. + * @type {number} + * @memberof GetInstrumentByCriteriaPageResponse + */ + content_size: number; + /** + * The number of items per page. + * @type {number} + * @memberof GetInstrumentByCriteriaPageResponse + */ + page_size: number; + /** + * The current page number (0-based index). + * @type {number} + * @memberof GetInstrumentByCriteriaPageResponse + */ + page_number: number; + /** + * The total number of elements across all pages. + * @type {number} + * @memberof GetInstrumentByCriteriaPageResponse + */ + total_elements: number; + /** + * The total number of pages. + * @type {number} + * @memberof GetInstrumentByCriteriaPageResponse + */ + total_pages: number; } - diff --git a/client/src/generated/model/get-instrument-criteria-request-body.ts b/client/src/generated/model/get-instrument-criteria-request-body.ts index 784163be..c45e9bfd 100644 --- a/client/src/generated/model/get-instrument-criteria-request-body.ts +++ b/client/src/generated/model/get-instrument-criteria-request-body.ts @@ -12,73 +12,70 @@ * Do not edit the class manually. */ - - /** - * + * * @export * @interface GetInstrumentCriteriaRequestBody */ export interface GetInstrumentCriteriaRequestBody { - /** - * - * @type {string} - * @memberof GetInstrumentCriteriaRequestBody - */ - 'instrument_name'?: string; - /** - * - * @type {Array} - * @memberof GetInstrumentCriteriaRequestBody - */ - 'instrument_types'?: Array; - /** - * - * @type {Array} - * @memberof GetInstrumentCriteriaRequestBody - */ - 'manufacturer_names'?: Array; - /** - * - * @type {string} - * @memberof GetInstrumentCriteriaRequestBody - */ - 'manufacture_date_from'?: string; - /** - * - * @type {string} - * @memberof GetInstrumentCriteriaRequestBody - */ - 'manufacture_date_to'?: string; - /** - * - * @type {string} - * @memberof GetInstrumentCriteriaRequestBody - */ - 'release_date_from'?: string; - /** - * - * @type {string} - * @memberof GetInstrumentCriteriaRequestBody - */ - 'release_date_to'?: string; - /** - * - * @type {Array} - * @memberof GetInstrumentCriteriaRequestBody - */ - 'countries'?: Array; - /** - * - * @type {Array} - * @memberof GetInstrumentCriteriaRequestBody - */ - 'materials'?: Array; - /** - * - * @type {Array} - * @memberof GetInstrumentCriteriaRequestBody - */ - 'instrument_ids'?: Array; + /** + * + * @type {string} + * @memberof GetInstrumentCriteriaRequestBody + */ + instrument_name?: string; + /** + * + * @type {Array} + * @memberof GetInstrumentCriteriaRequestBody + */ + instrument_types?: Array; + /** + * + * @type {Array} + * @memberof GetInstrumentCriteriaRequestBody + */ + manufacturer_names?: Array; + /** + * + * @type {string} + * @memberof GetInstrumentCriteriaRequestBody + */ + manufacture_date_from?: string; + /** + * + * @type {string} + * @memberof GetInstrumentCriteriaRequestBody + */ + manufacture_date_to?: string; + /** + * + * @type {string} + * @memberof GetInstrumentCriteriaRequestBody + */ + release_date_from?: string; + /** + * + * @type {string} + * @memberof GetInstrumentCriteriaRequestBody + */ + release_date_to?: string; + /** + * + * @type {Array} + * @memberof GetInstrumentCriteriaRequestBody + */ + countries?: Array; + /** + * + * @type {Array} + * @memberof GetInstrumentCriteriaRequestBody + */ + materials?: Array; + /** + * + * @type {Array} + * @memberof GetInstrumentCriteriaRequestBody + */ + instrument_ids?: Array; } - diff --git a/client/src/generated/model/get-instrument-types-response.ts b/client/src/generated/model/get-instrument-types-response.ts index 33532332..7c41fbdd 100644 --- a/client/src/generated/model/get-instrument-types-response.ts +++ b/client/src/generated/model/get-instrument-types-response.ts @@ -12,22 +12,20 @@ * Do not edit the class manually. */ - // May contain unused imports in some cases // @ts-ignore -import type { InstrumentType } from './instrument-type'; +import type { InstrumentType } from "./instrument-type"; /** - * + * * @export * @interface GetInstrumentTypesResponse */ export interface GetInstrumentTypesResponse { - /** - * - * @type {Array} - * @memberof GetInstrumentTypesResponse - */ - 'content': Array; + /** + * + * @type {Array} + * @memberof GetInstrumentTypesResponse + */ + content: Array; } - diff --git a/client/src/generated/model/get-instruments-by-criteria-response.ts b/client/src/generated/model/get-instruments-by-criteria-response.ts index cf965e12..a89e17d0 100644 --- a/client/src/generated/model/get-instruments-by-criteria-response.ts +++ b/client/src/generated/model/get-instruments-by-criteria-response.ts @@ -12,22 +12,20 @@ * Do not edit the class manually. */ - // May contain unused imports in some cases // @ts-ignore -import type { InstrumentDetail } from './instrument-detail'; +import type { InstrumentDetail } from "./instrument-detail"; /** - * + * * @export * @interface GetInstrumentsByCriteriaResponse */ export interface GetInstrumentsByCriteriaResponse { - /** - * - * @type {Array} - * @memberof GetInstrumentsByCriteriaResponse - */ - 'content': Array; + /** + * + * @type {Array} + * @memberof GetInstrumentsByCriteriaResponse + */ + content: Array; } - diff --git a/client/src/generated/model/index.ts b/client/src/generated/model/index.ts index 4b1c40a1..ca0abc96 100644 --- a/client/src/generated/model/index.ts +++ b/client/src/generated/model/index.ts @@ -1,19 +1,19 @@ -export * from './add-favorite-request-body'; -export * from './client-error'; -export * from './country'; -export * from './get-countries-response'; -export * from './get-instrument-basic-materials-response'; -export * from './get-instrument-by-criteria-page-response'; -export * from './get-instrument-criteria-request-body'; -export * from './get-instrument-types-response'; -export * from './get-instruments-by-criteria-response'; -export * from './instrument-basic-material'; -export * from './instrument-detail'; -export * from './instrument-type'; -export * from './jwt-response'; -export * from './list-favorite-response-body'; -export * from './profile-details'; -export * from './registration-request'; -export * from './remove-favorite-request-body'; -export * from './server-error'; -export * from './username-and-password-request-body'; +export * from "./add-favorite-request-body"; +export * from "./client-error"; +export * from "./country"; +export * from "./get-countries-response"; +export * from "./get-instrument-basic-materials-response"; +export * from "./get-instrument-by-criteria-page-response"; +export * from "./get-instrument-criteria-request-body"; +export * from "./get-instrument-types-response"; +export * from "./get-instruments-by-criteria-response"; +export * from "./instrument-basic-material"; +export * from "./instrument-detail"; +export * from "./instrument-type"; +export * from "./jwt-response"; +export * from "./list-favorite-response-body"; +export * from "./profile-details"; +export * from "./registration-request"; +export * from "./remove-favorite-request-body"; +export * from "./server-error"; +export * from "./username-and-password-request-body"; diff --git a/client/src/generated/model/instrument-basic-material.ts b/client/src/generated/model/instrument-basic-material.ts index 24bb7e18..f45d49b0 100644 --- a/client/src/generated/model/instrument-basic-material.ts +++ b/client/src/generated/model/instrument-basic-material.ts @@ -12,19 +12,16 @@ * Do not edit the class manually. */ - - /** - * + * * @export * @interface InstrumentBasicMaterial */ export interface InstrumentBasicMaterial { - /** - * - * @type {string} - * @memberof InstrumentBasicMaterial - */ - 'basic_material': string; + /** + * + * @type {string} + * @memberof InstrumentBasicMaterial + */ + basic_material: string; } - diff --git a/client/src/generated/model/instrument-detail.ts b/client/src/generated/model/instrument-detail.ts index 251e001f..cbb904a5 100644 --- a/client/src/generated/model/instrument-detail.ts +++ b/client/src/generated/model/instrument-detail.ts @@ -12,61 +12,58 @@ * Do not edit the class manually. */ - - /** - * + * * @export * @interface InstrumentDetail */ export interface InstrumentDetail { - /** - * - * @type {number} - * @memberof InstrumentDetail - */ - 'id': number; - /** - * - * @type {string} - * @memberof InstrumentDetail - */ - 'name': string; - /** - * - * @type {string} - * @memberof InstrumentDetail - */ - 'type': string; - /** - * - * @type {string} - * @memberof InstrumentDetail - */ - 'manufacturer': string; - /** - * - * @type {string} - * @memberof InstrumentDetail - */ - 'manufacturer_date': string; - /** - * - * @type {string} - * @memberof InstrumentDetail - */ - 'release_date': string; - /** - * - * @type {string} - * @memberof InstrumentDetail - */ - 'country': string; - /** - * - * @type {Array} - * @memberof InstrumentDetail - */ - 'basic_materials': Array; + /** + * + * @type {number} + * @memberof InstrumentDetail + */ + id: number; + /** + * + * @type {string} + * @memberof InstrumentDetail + */ + name: string; + /** + * + * @type {string} + * @memberof InstrumentDetail + */ + type: string; + /** + * + * @type {string} + * @memberof InstrumentDetail + */ + manufacturer: string; + /** + * + * @type {string} + * @memberof InstrumentDetail + */ + manufacturer_date: string; + /** + * + * @type {string} + * @memberof InstrumentDetail + */ + release_date: string; + /** + * + * @type {string} + * @memberof InstrumentDetail + */ + country: string; + /** + * + * @type {Array} + * @memberof InstrumentDetail + */ + basic_materials: Array; } - diff --git a/client/src/generated/model/instrument-type.ts b/client/src/generated/model/instrument-type.ts index ff65bb2f..affa6d0e 100644 --- a/client/src/generated/model/instrument-type.ts +++ b/client/src/generated/model/instrument-type.ts @@ -12,19 +12,16 @@ * Do not edit the class manually. */ - - /** - * + * * @export * @interface InstrumentType */ export interface InstrumentType { - /** - * - * @type {string} - * @memberof InstrumentType - */ - 'instrument_type'?: string; + /** + * + * @type {string} + * @memberof InstrumentType + */ + instrument_type?: string; } - diff --git a/client/src/generated/model/jwt-response.ts b/client/src/generated/model/jwt-response.ts index e1987d16..e2af0f82 100644 --- a/client/src/generated/model/jwt-response.ts +++ b/client/src/generated/model/jwt-response.ts @@ -12,19 +12,16 @@ * Do not edit the class manually. */ - - /** - * + * * @export * @interface JwtResponse */ export interface JwtResponse { - /** - * - * @type {string} - * @memberof JwtResponse - */ - 'jwt': string; + /** + * + * @type {string} + * @memberof JwtResponse + */ + jwt: string; } - diff --git a/client/src/generated/model/list-favorite-response-body.ts b/client/src/generated/model/list-favorite-response-body.ts index 1719cf94..396db813 100644 --- a/client/src/generated/model/list-favorite-response-body.ts +++ b/client/src/generated/model/list-favorite-response-body.ts @@ -12,22 +12,20 @@ * Do not edit the class manually. */ - // May contain unused imports in some cases // @ts-ignore -import type { InstrumentDetail } from './instrument-detail'; +import type { InstrumentDetail } from "./instrument-detail"; /** - * + * * @export * @interface ListFavoriteResponseBody */ export interface ListFavoriteResponseBody { - /** - * - * @type {Array} - * @memberof ListFavoriteResponseBody - */ - 'content': Array; + /** + * + * @type {Array} + * @memberof ListFavoriteResponseBody + */ + content: Array; } - diff --git a/client/src/generated/model/profile-details.ts b/client/src/generated/model/profile-details.ts index 53d34886..8428adec 100644 --- a/client/src/generated/model/profile-details.ts +++ b/client/src/generated/model/profile-details.ts @@ -12,31 +12,28 @@ * Do not edit the class manually. */ - - /** - * + * * @export * @interface ProfileDetails */ export interface ProfileDetails { - /** - * - * @type {string} - * @memberof ProfileDetails - */ - 'username': string; - /** - * - * @type {string} - * @memberof ProfileDetails - */ - 'role': string; - /** - * - * @type {string} - * @memberof ProfileDetails - */ - 'full_name': string; + /** + * + * @type {string} + * @memberof ProfileDetails + */ + username: string; + /** + * + * @type {string} + * @memberof ProfileDetails + */ + role: string; + /** + * + * @type {string} + * @memberof ProfileDetails + */ + full_name: string; } - diff --git a/client/src/generated/model/registration-request.ts b/client/src/generated/model/registration-request.ts index c2529748..81d00b96 100644 --- a/client/src/generated/model/registration-request.ts +++ b/client/src/generated/model/registration-request.ts @@ -12,31 +12,28 @@ * Do not edit the class manually. */ - - /** - * + * * @export * @interface RegistrationRequest */ export interface RegistrationRequest { - /** - * - * @type {string} - * @memberof RegistrationRequest - */ - 'full_name': string; - /** - * - * @type {string} - * @memberof RegistrationRequest - */ - 'login': string; - /** - * - * @type {string} - * @memberof RegistrationRequest - */ - 'password': string; + /** + * + * @type {string} + * @memberof RegistrationRequest + */ + full_name: string; + /** + * + * @type {string} + * @memberof RegistrationRequest + */ + login: string; + /** + * + * @type {string} + * @memberof RegistrationRequest + */ + password: string; } - diff --git a/client/src/generated/model/remove-favorite-request-body.ts b/client/src/generated/model/remove-favorite-request-body.ts index 5e6b1032..27f857cc 100644 --- a/client/src/generated/model/remove-favorite-request-body.ts +++ b/client/src/generated/model/remove-favorite-request-body.ts @@ -12,19 +12,16 @@ * Do not edit the class manually. */ - - /** - * + * * @export * @interface RemoveFavoriteRequestBody */ export interface RemoveFavoriteRequestBody { - /** - * - * @type {number} - * @memberof RemoveFavoriteRequestBody - */ - 'instrument_id': number; + /** + * + * @type {number} + * @memberof RemoveFavoriteRequestBody + */ + instrument_id: number; } - diff --git a/client/src/generated/model/server-error.ts b/client/src/generated/model/server-error.ts index e87a186f..55841fe5 100644 --- a/client/src/generated/model/server-error.ts +++ b/client/src/generated/model/server-error.ts @@ -12,19 +12,16 @@ * Do not edit the class manually. */ - - /** - * + * * @export * @interface ServerError */ export interface ServerError { - /** - * A description of the error. - * @type {string} - * @memberof ServerError - */ - 'message': string; + /** + * A description of the error. + * @type {string} + * @memberof ServerError + */ + message: string; } - diff --git a/client/src/generated/model/username-and-password-request-body.ts b/client/src/generated/model/username-and-password-request-body.ts index db8b19f8..9edf989a 100644 --- a/client/src/generated/model/username-and-password-request-body.ts +++ b/client/src/generated/model/username-and-password-request-body.ts @@ -12,25 +12,22 @@ * Do not edit the class manually. */ - - /** - * + * * @export * @interface UsernameAndPasswordRequestBody */ export interface UsernameAndPasswordRequestBody { - /** - * - * @type {string} - * @memberof UsernameAndPasswordRequestBody - */ - 'username': string; - /** - * - * @type {string} - * @memberof UsernameAndPasswordRequestBody - */ - 'password': string; + /** + * + * @type {string} + * @memberof UsernameAndPasswordRequestBody + */ + username: string; + /** + * + * @type {string} + * @memberof UsernameAndPasswordRequestBody + */ + password: string; } - diff --git a/client/src/pages/create-instrument/api/loader.ts b/client/src/pages/create-instrument/api/loader.ts index 9974b16e..c934acf2 100644 --- a/client/src/pages/create-instrument/api/loader.ts +++ b/client/src/pages/create-instrument/api/loader.ts @@ -4,7 +4,11 @@ import { API_MANUFACTURERS } from "shared/config/backend"; import axios from "axios"; import { ManufacturerNames } from "domain/model/manufacturer-name"; import { GetInstrumentTypesApi } from "generated/api/get-instrument-types-api"; -import type { Country, InstrumentBasicMaterial, InstrumentType } from "generated/model"; +import type { + Country, + InstrumentBasicMaterial, + InstrumentType, +} from "generated/model"; import { GetInstrumentBasicMaterialsApi } from "generated/api/get-instrument-basic-materials-api"; import { GetCountriesApi } from "generated/api/get-countries-api"; diff --git a/client/src/pages/edit-instrument/api/loader.ts b/client/src/pages/edit-instrument/api/loader.ts index 6b83e715..4999464c 100644 --- a/client/src/pages/edit-instrument/api/loader.ts +++ b/client/src/pages/edit-instrument/api/loader.ts @@ -8,7 +8,7 @@ import { Country, InstrumentBasicMaterial, InstrumentDetail, - type InstrumentType + type InstrumentType, } from "generated/model"; import { GetInstrumentTypesApi } from "generated/api/get-instrument-types-api"; import { GetInstrumentBasicMaterialsApi } from "generated/api/get-instrument-basic-materials-api"; diff --git a/client/src/widgets/catalogue-filter/ui/CountryFilter.tsx b/client/src/widgets/catalogue-filter/ui/CountryFilter.tsx index 1e8e13d5..4077f08c 100644 --- a/client/src/widgets/catalogue-filter/ui/CountryFilter.tsx +++ b/client/src/widgets/catalogue-filter/ui/CountryFilter.tsx @@ -16,7 +16,7 @@ export const CountryFilter = ({ onValueChange }: Props) => { const fetchCountries = async () => { const response = await getCountries.getCountries(); setCountries(response.data.content); - } + }; fetchCountries(); }, []); diff --git a/server/app/src/main/kotlin/mu/muse/rest/country/GetCountriesEndpoint.kt b/server/app/src/main/kotlin/mu/muse/rest/country/GetCountriesEndpoint.kt index 43d76d58..3d1eedd0 100644 --- a/server/app/src/main/kotlin/mu/muse/rest/country/GetCountriesEndpoint.kt +++ b/server/app/src/main/kotlin/mu/muse/rest/country/GetCountriesEndpoint.kt @@ -21,7 +21,7 @@ class GetCountriesEndpoint( fun List.toResponse(): ResponseEntity { return ResponseEntity.ok( GetCountriesResponse( - content = this.map { mu.muse.rest.dto.Country(it.name) } - ) + content = this.map { mu.muse.rest.dto.Country(it.name) }, + ), ) }