From 0648c818a747838e94449d6a521296b892ca1dea Mon Sep 17 00:00:00 2001 From: skywalker Date: Wed, 28 Aug 2024 16:00:37 +0300 Subject: [PATCH 1/8] chore(ports): unify ports --- client/src/generated/.gitignore | 4 - client/src/generated/.npmignore | 1 - client/src/generated/.openapi-generator/FILES | 55 ------ .../src/generated/.openapi-generator/VERSION | 1 - client/src/generated/api.ts | 35 ---- client/src/generated/api/add-favorite-api.ts | 137 --------------- client/src/generated/api/basic-login-api.ts | 137 --------------- .../generated/api/create-instrument-api.ts | 137 --------------- .../api/delete-instrument-by-id-api.ts | 133 --------------- .../src/generated/api/edit-instrument-api.ts | 137 --------------- client/src/generated/api/get-countries-api.ts | 128 -------------- .../api/get-instrument-basic-materials-api.ts | 128 -------------- .../generated/api/get-instrument-by-id-api.ts | 135 --------------- .../generated/api/get-instrument-photo-api.ts | 135 --------------- .../generated/api/get-instrument-types-api.ts | 128 -------------- .../api/get-instruments-by-criteria-api.ts | 139 --------------- ...t-instruments-by-criteria-paginated-api.ts | 159 ------------------ .../generated/api/get-manufacturers-api.ts | 128 -------------- .../src/generated/api/get-user-profile-api.ts | 126 -------------- client/src/generated/api/list-favorite-api.ts | 128 -------------- client/src/generated/api/logout-api.ts | 124 -------------- .../src/generated/api/remove-favorite-api.ts | 137 --------------- .../generated/api/user-registration-api.ts | 135 --------------- client/src/generated/base.ts | 86 ---------- client/src/generated/common.ts | 150 ----------------- client/src/generated/configuration.ts | 110 ------------ client/src/generated/git_push.sh | 57 ------- client/src/generated/index.ts | 18 -- client/src/generated/model/index.ts | 28 --- .../application/muse/SecurityConfiguration.kt | 9 +- .../src/main/resources/application.properties | 2 + tools/docker/env/dev.env | 10 +- tools/docker/env/local.env | 10 +- tools/scripts/clean.sh | 8 +- tools/scripts/deploy.sh | 22 +-- tools/scripts/run.sh | 9 +- tools/scripts/stop.sh | 14 +- 37 files changed, 49 insertions(+), 2991 deletions(-) delete mode 100644 client/src/generated/.openapi-generator/FILES delete mode 100644 client/src/generated/.openapi-generator/VERSION delete mode 100644 client/src/generated/api/add-favorite-api.ts delete mode 100644 client/src/generated/api/basic-login-api.ts delete mode 100644 client/src/generated/api/create-instrument-api.ts delete mode 100644 client/src/generated/api/delete-instrument-by-id-api.ts delete mode 100644 client/src/generated/api/edit-instrument-api.ts delete mode 100644 client/src/generated/api/get-countries-api.ts delete mode 100644 client/src/generated/api/get-instrument-basic-materials-api.ts delete mode 100644 client/src/generated/api/get-instrument-by-id-api.ts delete mode 100644 client/src/generated/api/get-instrument-photo-api.ts delete mode 100644 client/src/generated/api/get-instrument-types-api.ts delete mode 100644 client/src/generated/api/get-instruments-by-criteria-api.ts delete mode 100644 client/src/generated/api/get-instruments-by-criteria-paginated-api.ts delete mode 100644 client/src/generated/api/get-manufacturers-api.ts delete mode 100644 client/src/generated/api/get-user-profile-api.ts delete mode 100644 client/src/generated/api/list-favorite-api.ts delete mode 100644 client/src/generated/api/logout-api.ts delete mode 100644 client/src/generated/api/remove-favorite-api.ts delete mode 100644 client/src/generated/api/user-registration-api.ts delete mode 100644 client/src/generated/model/index.ts diff --git a/client/src/generated/.gitignore b/client/src/generated/.gitignore index 149b5765..e69de29b 100644 --- a/client/src/generated/.gitignore +++ b/client/src/generated/.gitignore @@ -1,4 +0,0 @@ -wwwroot/*.js -node_modules -typings -dist diff --git a/client/src/generated/.npmignore b/client/src/generated/.npmignore index 999d88df..e69de29b 100644 --- a/client/src/generated/.npmignore +++ b/client/src/generated/.npmignore @@ -1 +0,0 @@ -# empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm \ No newline at end of file diff --git a/client/src/generated/.openapi-generator/FILES b/client/src/generated/.openapi-generator/FILES deleted file mode 100644 index 8d267068..00000000 --- a/client/src/generated/.openapi-generator/FILES +++ /dev/null @@ -1,55 +0,0 @@ -.gitignore -.npmignore -api.ts -api/add-favorite-api.ts -api/basic-login-api.ts -api/create-instrument-api.ts -api/delete-instrument-by-id-api.ts -api/edit-instrument-api.ts -api/get-countries-api.ts -api/get-instrument-basic-materials-api.ts -api/get-instrument-by-id-api.ts -api/get-instrument-photo-api.ts -api/get-instrument-types-api.ts -api/get-instruments-by-criteria-api.ts -api/get-instruments-by-criteria-paginated-api.ts -api/get-manufacturers-api.ts -api/get-user-profile-api.ts -api/list-favorite-api.ts -api/logout-api.ts -api/remove-favorite-api.ts -api/user-registration-api.ts -base.ts -common.ts -configuration.ts -git_push.sh -index.ts -model/basic-material.ts -model/client-error.ts -model/country.ts -model/create-instrument-request-body.ts -model/edit-instrument-request-body.ts -model/get-countries-response.ts -model/get-instrument-basic-materials-response.ts -model/get-instrument-by-criteria-page-response.ts -model/get-instrument-types-response.ts -model/get-instruments-by-criteria-request-body.ts -model/get-instruments-by-criteria-response.ts -model/get-manufacturers-response.ts -model/index.ts -model/instrument-detail-without-id.ts -model/instrument-detail.ts -model/instrument-id.ts -model/instrument-name.ts -model/instrument-photo.ts -model/instrument-type.ts -model/jwt-response.ts -model/list-favorite-response.ts -model/manufacture-date.ts -model/manufacturer-name.ts -model/manufacturer.ts -model/profile-details.ts -model/registration-request.ts -model/release-date.ts -model/server-error.ts -model/username-and-password-request-body.ts diff --git a/client/src/generated/.openapi-generator/VERSION b/client/src/generated/.openapi-generator/VERSION deleted file mode 100644 index 09a6d308..00000000 --- a/client/src/generated/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.8.0 diff --git a/client/src/generated/api.ts b/client/src/generated/api.ts index 643644cf..e69de29b 100644 --- a/client/src/generated/api.ts +++ b/client/src/generated/api.ts @@ -1,35 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Country - * Basic Material - * - * The version of the OpenAPI document: 1.0.0 - * Contact: baskirill.an@gmail.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - - -export * from './api/add-favorite-api'; -export * from './api/basic-login-api'; -export * from './api/create-instrument-api'; -export * from './api/delete-instrument-by-id-api'; -export * from './api/edit-instrument-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-photo-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-manufacturers-api'; -export * from './api/get-user-profile-api'; -export * from './api/list-favorite-api'; -export * from './api/logout-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 deleted file mode 100644 index 67d7f21a..00000000 --- a/client/src/generated/api/add-favorite-api.ts +++ /dev/null @@ -1,137 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Country - * Basic Material - * - * The version of the OpenAPI document: 1.0.0 - * Contact: baskirill.an@gmail.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -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'; -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; -// @ts-ignore -import type { ClientError } from '../model'; -// @ts-ignore -import type { InstrumentId } from '../model'; -// @ts-ignore -import type { ServerError } from '../model'; -/** - * AddFavoriteApi - axios parameter creator - * @export - */ -export const AddFavoriteApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Add Favorite - * @summary Add Favorite - * @param {InstrumentId} instrumentId - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - addFavorite: async (instrumentId: InstrumentId, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'instrumentId' is not null or undefined - assertParamExists('addFavorite', 'instrumentId', instrumentId) - const localVarPath = `/api/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'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(instrumentId, 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 {InstrumentId} instrumentId - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async addFavorite(instrumentId: InstrumentId, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.addFavorite(instrumentId, 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 {InstrumentId} instrumentId - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - addFavorite(instrumentId: InstrumentId, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.addFavorite(instrumentId, options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * AddFavoriteApi - object-oriented interface - * @export - * @class AddFavoriteApi - * @extends {BaseAPI} - */ -export class AddFavoriteApi extends BaseAPI { - /** - * Add Favorite - * @summary Add Favorite - * @param {InstrumentId} instrumentId - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof AddFavoriteApi - */ - public addFavorite(instrumentId: InstrumentId, options?: RawAxiosRequestConfig) { - return AddFavoriteApiFp(this.configuration).addFavorite(instrumentId, 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 deleted file mode 100644 index 0401f03e..00000000 --- a/client/src/generated/api/basic-login-api.ts +++ /dev/null @@ -1,137 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Country - * Basic Material - * - * The version of the OpenAPI document: 1.0.0 - * Contact: baskirill.an@gmail.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -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'; -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; -// @ts-ignore -import type { JwtResponse } from '../model'; -// @ts-ignore -import type { ServerError } from '../model'; -// @ts-ignore -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 = `/api/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'; - - 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); - }, - } -}; - -/** - * 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)); - }, - }; -}; - -/** - * BasicLoginApi - object-oriented interface - * @export - * @class BasicLoginApi - * @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)); - } -} - diff --git a/client/src/generated/api/create-instrument-api.ts b/client/src/generated/api/create-instrument-api.ts deleted file mode 100644 index 225ba1b3..00000000 --- a/client/src/generated/api/create-instrument-api.ts +++ /dev/null @@ -1,137 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Country - * Basic Material - * - * The version of the OpenAPI document: 1.0.0 - * Contact: baskirill.an@gmail.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -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'; -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; -// @ts-ignore -import type { ClientError } from '../model'; -// @ts-ignore -import type { CreateInstrumentRequestBody } from '../model'; -// @ts-ignore -import type { ServerError } from '../model'; -/** - * CreateInstrumentApi - axios parameter creator - * @export - */ -export const CreateInstrumentApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Create Instrument - * @summary Create Instrument - * @param {CreateInstrumentRequestBody} createInstrumentRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createInstrument: async (createInstrumentRequestBody: CreateInstrumentRequestBody, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'createInstrumentRequestBody' is not null or undefined - assertParamExists('createInstrument', 'createInstrumentRequestBody', createInstrumentRequestBody) - const localVarPath = `/api/instrument/create`; - // 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'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(createInstrumentRequestBody, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * CreateInstrumentApi - functional programming interface - * @export - */ -export const CreateInstrumentApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = CreateInstrumentApiAxiosParamCreator(configuration) - return { - /** - * Create Instrument - * @summary Create Instrument - * @param {CreateInstrumentRequestBody} createInstrumentRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async createInstrument(createInstrumentRequestBody: CreateInstrumentRequestBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.createInstrument(createInstrumentRequestBody, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['CreateInstrumentApi.createInstrument']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } -}; - -/** - * CreateInstrumentApi - factory interface - * @export - */ -export const CreateInstrumentApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = CreateInstrumentApiFp(configuration) - return { - /** - * Create Instrument - * @summary Create Instrument - * @param {CreateInstrumentRequestBody} createInstrumentRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createInstrument(createInstrumentRequestBody: CreateInstrumentRequestBody, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.createInstrument(createInstrumentRequestBody, options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * CreateInstrumentApi - object-oriented interface - * @export - * @class CreateInstrumentApi - * @extends {BaseAPI} - */ -export class CreateInstrumentApi extends BaseAPI { - /** - * Create Instrument - * @summary Create Instrument - * @param {CreateInstrumentRequestBody} createInstrumentRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof CreateInstrumentApi - */ - public createInstrument(createInstrumentRequestBody: CreateInstrumentRequestBody, options?: RawAxiosRequestConfig) { - return CreateInstrumentApiFp(this.configuration).createInstrument(createInstrumentRequestBody, 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 deleted file mode 100644 index 2e9f06b5..00000000 --- a/client/src/generated/api/delete-instrument-by-id-api.ts +++ /dev/null @@ -1,133 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Country - * Basic Material - * - * The version of the OpenAPI document: 1.0.0 - * Contact: baskirill.an@gmail.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -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'; -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; -// @ts-ignore -import type { ClientError } from '../model'; -// @ts-ignore -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 = `/api/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}; - - 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); - }, - } -}; - -/** - * 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)); - }, - }; -}; - -/** - * DeleteInstrumentByIdApi - object-oriented interface - * @export - * @class DeleteInstrumentByIdApi - * @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)); - } -} - diff --git a/client/src/generated/api/edit-instrument-api.ts b/client/src/generated/api/edit-instrument-api.ts deleted file mode 100644 index 17f5ebfd..00000000 --- a/client/src/generated/api/edit-instrument-api.ts +++ /dev/null @@ -1,137 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Country - * Basic Material - * - * The version of the OpenAPI document: 1.0.0 - * Contact: baskirill.an@gmail.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -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'; -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; -// @ts-ignore -import type { ClientError } from '../model'; -// @ts-ignore -import type { EditInstrumentRequestBody } from '../model'; -// @ts-ignore -import type { ServerError } from '../model'; -/** - * EditInstrumentApi - axios parameter creator - * @export - */ -export const EditInstrumentApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Edit Instrument - * @summary Edit Instrument - * @param {EditInstrumentRequestBody} editInstrumentRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - editInstrument: async (editInstrumentRequestBody: EditInstrumentRequestBody, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'editInstrumentRequestBody' is not null or undefined - assertParamExists('editInstrument', 'editInstrumentRequestBody', editInstrumentRequestBody) - const localVarPath = `/api/instrument/edit`; - // 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'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(editInstrumentRequestBody, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * EditInstrumentApi - functional programming interface - * @export - */ -export const EditInstrumentApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = EditInstrumentApiAxiosParamCreator(configuration) - return { - /** - * Edit Instrument - * @summary Edit Instrument - * @param {EditInstrumentRequestBody} editInstrumentRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async editInstrument(editInstrumentRequestBody: EditInstrumentRequestBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.editInstrument(editInstrumentRequestBody, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['EditInstrumentApi.editInstrument']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } -}; - -/** - * EditInstrumentApi - factory interface - * @export - */ -export const EditInstrumentApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = EditInstrumentApiFp(configuration) - return { - /** - * Edit Instrument - * @summary Edit Instrument - * @param {EditInstrumentRequestBody} editInstrumentRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - editInstrument(editInstrumentRequestBody: EditInstrumentRequestBody, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.editInstrument(editInstrumentRequestBody, options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * EditInstrumentApi - object-oriented interface - * @export - * @class EditInstrumentApi - * @extends {BaseAPI} - */ -export class EditInstrumentApi extends BaseAPI { - /** - * Edit Instrument - * @summary Edit Instrument - * @param {EditInstrumentRequestBody} editInstrumentRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof EditInstrumentApi - */ - public editInstrument(editInstrumentRequestBody: EditInstrumentRequestBody, options?: RawAxiosRequestConfig) { - return EditInstrumentApiFp(this.configuration).editInstrument(editInstrumentRequestBody, options).then((request) => request(this.axios, this.basePath)); - } -} - diff --git a/client/src/generated/api/get-countries-api.ts b/client/src/generated/api/get-countries-api.ts deleted file mode 100644 index 2bbd9bb2..00000000 --- a/client/src/generated/api/get-countries-api.ts +++ /dev/null @@ -1,128 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Country - * Basic Material - * - * The version of the OpenAPI document: 1.0.0 - * Contact: baskirill.an@gmail.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -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'; -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; -// @ts-ignore -import type { ClientError } from '../model'; -// @ts-ignore -import type { GetCountriesResponse } from '../model'; -// @ts-ignore -import type { ServerError } from '../model'; -/** - * GetCountriesApi - axios parameter creator - * @export - */ -export const GetCountriesApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Get Countries - * @summary Get Countries - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getCountries: async (options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/countries`; - // 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}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * GetCountriesApi - functional programming interface - * @export - */ -export const GetCountriesApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = GetCountriesApiAxiosParamCreator(configuration) - return { - /** - * Get Countries - * @summary Get Countries - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getCountries(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getCountries(options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['GetCountriesApi.getCountries']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } -}; - -/** - * GetCountriesApi - factory interface - * @export - */ -export const GetCountriesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = GetCountriesApiFp(configuration) - return { - /** - * Get Countries - * @summary Get Countries - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getCountries(options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getCountries(options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * GetCountriesApi - object-oriented interface - * @export - * @class GetCountriesApi - * @extends {BaseAPI} - */ -export class GetCountriesApi extends BaseAPI { - /** - * Get Countries - * @summary Get Countries - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof GetCountriesApi - */ - public getCountries(options?: RawAxiosRequestConfig) { - return GetCountriesApiFp(this.configuration).getCountries(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 deleted file mode 100644 index a880302c..00000000 --- a/client/src/generated/api/get-instrument-basic-materials-api.ts +++ /dev/null @@ -1,128 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Country - * Basic Material - * - * The version of the OpenAPI document: 1.0.0 - * Contact: baskirill.an@gmail.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -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'; -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; -// @ts-ignore -import type { ClientError } from '../model'; -// @ts-ignore -import type { GetInstrumentBasicMaterialsResponse } from '../model'; -// @ts-ignore -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 = `/api/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}; - - 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); - }, - } -}; - -/** - * 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)); - }, - }; -}; - -/** - * GetInstrumentBasicMaterialsApi - object-oriented interface - * @export - * @class GetInstrumentBasicMaterialsApi - * @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)); - } -} - diff --git a/client/src/generated/api/get-instrument-by-id-api.ts b/client/src/generated/api/get-instrument-by-id-api.ts deleted file mode 100644 index 4e3d181b..00000000 --- a/client/src/generated/api/get-instrument-by-id-api.ts +++ /dev/null @@ -1,135 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Country - * Basic Material - * - * The version of the OpenAPI document: 1.0.0 - * Contact: baskirill.an@gmail.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -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'; -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; -// @ts-ignore -import type { ClientError } from '../model'; -// @ts-ignore -import type { InstrumentDetail } from '../model'; -// @ts-ignore -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 {number} instrumentId Instrument ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getInstrumentById: async (instrumentId: number, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'instrumentId' is not null or undefined - assertParamExists('getInstrumentById', 'instrumentId', instrumentId) - const localVarPath = `/api/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}; - - 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 {number} instrumentId Instrument ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getInstrumentById(instrumentId: number, 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 {number} instrumentId Instrument ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getInstrumentById(instrumentId: number, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getInstrumentById(instrumentId, options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * GetInstrumentByIdApi - object-oriented interface - * @export - * @class GetInstrumentByIdApi - * @extends {BaseAPI} - */ -export class GetInstrumentByIdApi extends BaseAPI { - /** - * Get Instrument by ID - * @summary Get Instrument by ID - * @param {number} instrumentId Instrument ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof GetInstrumentByIdApi - */ - public getInstrumentById(instrumentId: number, 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-photo-api.ts b/client/src/generated/api/get-instrument-photo-api.ts deleted file mode 100644 index eb0e10aa..00000000 --- a/client/src/generated/api/get-instrument-photo-api.ts +++ /dev/null @@ -1,135 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Country - * Basic Material - * - * The version of the OpenAPI document: 1.0.0 - * Contact: baskirill.an@gmail.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -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'; -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; -// @ts-ignore -import type { ClientError } from '../model'; -// @ts-ignore -import type { InstrumentPhoto } from '../model'; -// @ts-ignore -import type { ServerError } from '../model'; -/** - * GetInstrumentPhotoApi - axios parameter creator - * @export - */ -export const GetInstrumentPhotoApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Get Instrument Photo - * @summary Get Instrument Photo - * @param {number} instrumentId Instrument ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getInstrumentPhoto: async (instrumentId: number, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'instrumentId' is not null or undefined - assertParamExists('getInstrumentPhoto', 'instrumentId', instrumentId) - const localVarPath = `/api/instrument/photo/{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}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * GetInstrumentPhotoApi - functional programming interface - * @export - */ -export const GetInstrumentPhotoApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = GetInstrumentPhotoApiAxiosParamCreator(configuration) - return { - /** - * Get Instrument Photo - * @summary Get Instrument Photo - * @param {number} instrumentId Instrument ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getInstrumentPhoto(instrumentId: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getInstrumentPhoto(instrumentId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['GetInstrumentPhotoApi.getInstrumentPhoto']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } -}; - -/** - * GetInstrumentPhotoApi - factory interface - * @export - */ -export const GetInstrumentPhotoApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = GetInstrumentPhotoApiFp(configuration) - return { - /** - * Get Instrument Photo - * @summary Get Instrument Photo - * @param {number} instrumentId Instrument ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getInstrumentPhoto(instrumentId: number, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getInstrumentPhoto(instrumentId, options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * GetInstrumentPhotoApi - object-oriented interface - * @export - * @class GetInstrumentPhotoApi - * @extends {BaseAPI} - */ -export class GetInstrumentPhotoApi extends BaseAPI { - /** - * Get Instrument Photo - * @summary Get Instrument Photo - * @param {number} instrumentId Instrument ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof GetInstrumentPhotoApi - */ - public getInstrumentPhoto(instrumentId: number, options?: RawAxiosRequestConfig) { - return GetInstrumentPhotoApiFp(this.configuration).getInstrumentPhoto(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 deleted file mode 100644 index 8e59373b..00000000 --- a/client/src/generated/api/get-instrument-types-api.ts +++ /dev/null @@ -1,128 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Country - * Basic Material - * - * The version of the OpenAPI document: 1.0.0 - * Contact: baskirill.an@gmail.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -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'; -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; -// @ts-ignore -import type { ClientError } from '../model'; -// @ts-ignore -import type { GetInstrumentTypesResponse } from '../model'; -// @ts-ignore -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 = `/api/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}; - - 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); - }, - } -}; - -/** - * 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)); - }, - }; -}; - -/** - * GetInstrumentTypesApi - object-oriented interface - * @export - * @class GetInstrumentTypesApi - * @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)); - } -} - diff --git a/client/src/generated/api/get-instruments-by-criteria-api.ts b/client/src/generated/api/get-instruments-by-criteria-api.ts deleted file mode 100644 index ba63ce3f..00000000 --- a/client/src/generated/api/get-instruments-by-criteria-api.ts +++ /dev/null @@ -1,139 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Country - * Basic Material - * - * The version of the OpenAPI document: 1.0.0 - * Contact: baskirill.an@gmail.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -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'; -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; -// @ts-ignore -import type { ClientError } from '../model'; -// @ts-ignore -import type { GetInstrumentsByCriteriaRequestBody } from '../model'; -// @ts-ignore -import type { GetInstrumentsByCriteriaResponse } from '../model'; -// @ts-ignore -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 {GetInstrumentsByCriteriaRequestBody} getInstrumentsByCriteriaRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getInstrumentsByCriteria: async (getInstrumentsByCriteriaRequestBody: GetInstrumentsByCriteriaRequestBody, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'getInstrumentsByCriteriaRequestBody' is not null or undefined - assertParamExists('getInstrumentsByCriteria', 'getInstrumentsByCriteriaRequestBody', getInstrumentsByCriteriaRequestBody) - const localVarPath = `/api/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'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(getInstrumentsByCriteriaRequestBody, 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 {GetInstrumentsByCriteriaRequestBody} getInstrumentsByCriteriaRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getInstrumentsByCriteria(getInstrumentsByCriteriaRequestBody: GetInstrumentsByCriteriaRequestBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getInstrumentsByCriteria(getInstrumentsByCriteriaRequestBody, 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 {GetInstrumentsByCriteriaRequestBody} getInstrumentsByCriteriaRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getInstrumentsByCriteria(getInstrumentsByCriteriaRequestBody: GetInstrumentsByCriteriaRequestBody, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getInstrumentsByCriteria(getInstrumentsByCriteriaRequestBody, options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * GetInstrumentsByCriteriaApi - object-oriented interface - * @export - * @class GetInstrumentsByCriteriaApi - * @extends {BaseAPI} - */ -export class GetInstrumentsByCriteriaApi extends BaseAPI { - /** - * Get Instruments by Criteria - * @summary Get Instruments by Criteria - * @param {GetInstrumentsByCriteriaRequestBody} getInstrumentsByCriteriaRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof GetInstrumentsByCriteriaApi - */ - public getInstrumentsByCriteria(getInstrumentsByCriteriaRequestBody: GetInstrumentsByCriteriaRequestBody, options?: RawAxiosRequestConfig) { - return GetInstrumentsByCriteriaApiFp(this.configuration).getInstrumentsByCriteria(getInstrumentsByCriteriaRequestBody, 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 deleted file mode 100644 index 70f8125b..00000000 --- a/client/src/generated/api/get-instruments-by-criteria-paginated-api.ts +++ /dev/null @@ -1,159 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Country - * Basic Material - * - * The version of the OpenAPI document: 1.0.0 - * Contact: baskirill.an@gmail.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -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'; -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; -// @ts-ignore -import type { ClientError } from '../model'; -// @ts-ignore -import type { GetInstrumentByCriteriaPageResponse } from '../model'; -// @ts-ignore -import type { GetInstrumentsByCriteriaRequestBody } from '../model'; -// @ts-ignore -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 {GetInstrumentsByCriteriaRequestBody} getInstrumentsByCriteriaRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getInstrumentsByCriteriaPaginated: async (pageSize: number, pageNumber: number, getInstrumentsByCriteriaRequestBody: GetInstrumentsByCriteriaRequestBody, 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 'getInstrumentsByCriteriaRequestBody' is not null or undefined - assertParamExists('getInstrumentsByCriteriaPaginated', 'getInstrumentsByCriteriaRequestBody', getInstrumentsByCriteriaRequestBody) - const localVarPath = `/api/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; - - if (pageSize !== undefined) { - localVarQueryParameter['page_size'] = pageSize; - } - - 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(getInstrumentsByCriteriaRequestBody, 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 {GetInstrumentsByCriteriaRequestBody} getInstrumentsByCriteriaRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getInstrumentsByCriteriaPaginated(pageSize: number, pageNumber: number, getInstrumentsByCriteriaRequestBody: GetInstrumentsByCriteriaRequestBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getInstrumentsByCriteriaPaginated(pageSize, pageNumber, getInstrumentsByCriteriaRequestBody, 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 {GetInstrumentsByCriteriaRequestBody} getInstrumentsByCriteriaRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getInstrumentsByCriteriaPaginated(pageSize: number, pageNumber: number, getInstrumentsByCriteriaRequestBody: GetInstrumentsByCriteriaRequestBody, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getInstrumentsByCriteriaPaginated(pageSize, pageNumber, getInstrumentsByCriteriaRequestBody, options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * GetInstrumentsByCriteriaPaginatedApi - object-oriented interface - * @export - * @class GetInstrumentsByCriteriaPaginatedApi - * @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 {GetInstrumentsByCriteriaRequestBody} getInstrumentsByCriteriaRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof GetInstrumentsByCriteriaPaginatedApi - */ - public getInstrumentsByCriteriaPaginated(pageSize: number, pageNumber: number, getInstrumentsByCriteriaRequestBody: GetInstrumentsByCriteriaRequestBody, options?: RawAxiosRequestConfig) { - return GetInstrumentsByCriteriaPaginatedApiFp(this.configuration).getInstrumentsByCriteriaPaginated(pageSize, pageNumber, getInstrumentsByCriteriaRequestBody, options).then((request) => request(this.axios, this.basePath)); - } -} - diff --git a/client/src/generated/api/get-manufacturers-api.ts b/client/src/generated/api/get-manufacturers-api.ts deleted file mode 100644 index 7effa08a..00000000 --- a/client/src/generated/api/get-manufacturers-api.ts +++ /dev/null @@ -1,128 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Country - * Basic Material - * - * The version of the OpenAPI document: 1.0.0 - * Contact: baskirill.an@gmail.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -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'; -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; -// @ts-ignore -import type { ClientError } from '../model'; -// @ts-ignore -import type { GetManufacturersResponse } from '../model'; -// @ts-ignore -import type { ServerError } from '../model'; -/** - * GetManufacturersApi - axios parameter creator - * @export - */ -export const GetManufacturersApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Get Manufacturers - * @summary Get Manufacturers - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getManufacturers: async (options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/manufacturer`; - // 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}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * GetManufacturersApi - functional programming interface - * @export - */ -export const GetManufacturersApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = GetManufacturersApiAxiosParamCreator(configuration) - return { - /** - * Get Manufacturers - * @summary Get Manufacturers - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getManufacturers(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getManufacturers(options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['GetManufacturersApi.getManufacturers']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } -}; - -/** - * GetManufacturersApi - factory interface - * @export - */ -export const GetManufacturersApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = GetManufacturersApiFp(configuration) - return { - /** - * Get Manufacturers - * @summary Get Manufacturers - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getManufacturers(options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getManufacturers(options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * GetManufacturersApi - object-oriented interface - * @export - * @class GetManufacturersApi - * @extends {BaseAPI} - */ -export class GetManufacturersApi extends BaseAPI { - /** - * Get Manufacturers - * @summary Get Manufacturers - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof GetManufacturersApi - */ - public getManufacturers(options?: RawAxiosRequestConfig) { - return GetManufacturersApiFp(this.configuration).getManufacturers(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 deleted file mode 100644 index feada3ad..00000000 --- a/client/src/generated/api/get-user-profile-api.ts +++ /dev/null @@ -1,126 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Country - * Basic Material - * - * The version of the OpenAPI document: 1.0.0 - * Contact: baskirill.an@gmail.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -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'; -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; -// @ts-ignore -import type { ProfileDetails } from '../model'; -// @ts-ignore -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 = `/api/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}; - - 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); - }, - } -}; - -/** - * 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)); - }, - }; -}; - -/** - * GetUserProfileApi - object-oriented interface - * @export - * @class GetUserProfileApi - * @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)); - } -} - diff --git a/client/src/generated/api/list-favorite-api.ts b/client/src/generated/api/list-favorite-api.ts deleted file mode 100644 index 53088d68..00000000 --- a/client/src/generated/api/list-favorite-api.ts +++ /dev/null @@ -1,128 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Country - * Basic Material - * - * The version of the OpenAPI document: 1.0.0 - * Contact: baskirill.an@gmail.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -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'; -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; -// @ts-ignore -import type { ClientError } from '../model'; -// @ts-ignore -import type { ListFavoriteResponse } from '../model'; -// @ts-ignore -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 = `/api/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: '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, - }; - }, - } -}; - -/** - * 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); - }, - } -}; - -/** - * 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)); - }, - }; -}; - -/** - * ListFavoriteApi - object-oriented interface - * @export - * @class ListFavoriteApi - * @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)); - } -} - diff --git a/client/src/generated/api/logout-api.ts b/client/src/generated/api/logout-api.ts deleted file mode 100644 index ce5f4625..00000000 --- a/client/src/generated/api/logout-api.ts +++ /dev/null @@ -1,124 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Country - * Basic Material - * - * The version of the OpenAPI document: 1.0.0 - * Contact: baskirill.an@gmail.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -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'; -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; -// @ts-ignore -import type { ServerError } from '../model'; -/** - * LogoutApi - axios parameter creator - * @export - */ -export const LogoutApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Logout Endpoint - * @summary Logout Endpoint - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - logout: async (options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/auth/logout`; - // 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}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * LogoutApi - functional programming interface - * @export - */ -export const LogoutApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = LogoutApiAxiosParamCreator(configuration) - return { - /** - * Logout Endpoint - * @summary Logout Endpoint - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async logout(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.logout(options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['LogoutApi.logout']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } -}; - -/** - * LogoutApi - factory interface - * @export - */ -export const LogoutApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = LogoutApiFp(configuration) - return { - /** - * Logout Endpoint - * @summary Logout Endpoint - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - logout(options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.logout(options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * LogoutApi - object-oriented interface - * @export - * @class LogoutApi - * @extends {BaseAPI} - */ -export class LogoutApi extends BaseAPI { - /** - * Logout Endpoint - * @summary Logout Endpoint - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof LogoutApi - */ - public logout(options?: RawAxiosRequestConfig) { - return LogoutApiFp(this.configuration).logout(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 deleted file mode 100644 index f9213e90..00000000 --- a/client/src/generated/api/remove-favorite-api.ts +++ /dev/null @@ -1,137 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Country - * Basic Material - * - * The version of the OpenAPI document: 1.0.0 - * Contact: baskirill.an@gmail.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -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'; -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; -// @ts-ignore -import type { ClientError } from '../model'; -// @ts-ignore -import type { InstrumentId } from '../model'; -// @ts-ignore -import type { ServerError } from '../model'; -/** - * RemoveFavoriteApi - axios parameter creator - * @export - */ -export const RemoveFavoriteApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Remove Favorite - * @summary Remove Favorite - * @param {InstrumentId} instrumentId - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - removeFavorite: async (instrumentId: InstrumentId, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'instrumentId' is not null or undefined - assertParamExists('removeFavorite', 'instrumentId', instrumentId) - const localVarPath = `/api/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'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(instrumentId, 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 {InstrumentId} instrumentId - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async removeFavorite(instrumentId: InstrumentId, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.removeFavorite(instrumentId, 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 {InstrumentId} instrumentId - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - removeFavorite(instrumentId: InstrumentId, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.removeFavorite(instrumentId, options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * RemoveFavoriteApi - object-oriented interface - * @export - * @class RemoveFavoriteApi - * @extends {BaseAPI} - */ -export class RemoveFavoriteApi extends BaseAPI { - /** - * Remove Favorite - * @summary Remove Favorite - * @param {InstrumentId} instrumentId - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RemoveFavoriteApi - */ - public removeFavorite(instrumentId: InstrumentId, options?: RawAxiosRequestConfig) { - return RemoveFavoriteApiFp(this.configuration).removeFavorite(instrumentId, 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 deleted file mode 100644 index 5c70f9f5..00000000 --- a/client/src/generated/api/user-registration-api.ts +++ /dev/null @@ -1,135 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Country - * Basic Material - * - * The version of the OpenAPI document: 1.0.0 - * Contact: baskirill.an@gmail.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -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'; -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; -// @ts-ignore -import type { RegistrationRequest } from '../model'; -// @ts-ignore -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 = `/api/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'; - - 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); - }, - } -}; - -/** - * 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)); - }, - }; -}; - -/** - * UserRegistrationApi - object-oriented interface - * @export - * @class UserRegistrationApi - * @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)); - } -} - diff --git a/client/src/generated/base.ts b/client/src/generated/base.ts index 54eed7d9..e69de29b 100644 --- a/client/src/generated/base.ts +++ b/client/src/generated/base.ts @@ -1,86 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Country - * Basic Material - * - * The version of the OpenAPI document: 1.0.0 - * Contact: baskirill.an@gmail.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -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'; - -export const BASE_PATH = "http://localhost:8080".replace(/\/+$/, ""); - -/** - * - * @export - */ -export const COLLECTION_FORMATS = { - csv: ",", - ssv: " ", - tsv: "\t", - pipes: "|", -}; - -/** - * - * @export - * @interface RequestArgs - */ -export interface RequestArgs { - url: string; - options: RawAxiosRequestConfig; -} - -/** - * - * @export - * @class BaseAPI - */ -export class BaseAPI { - 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; - } - } -}; - -/** - * - * @export - * @class RequiredError - * @extends {Error} - */ -export class RequiredError extends Error { - constructor(public field: string, msg?: string) { - super(msg); - this.name = "RequiredError" - } -} - -interface ServerMap { - [key: string]: { - url: string, - description: string, - }[]; -} - -/** - * - * @export - */ -export const operationServerMap: ServerMap = { -} diff --git a/client/src/generated/common.ts b/client/src/generated/common.ts index 98bf6297..e69de29b 100644 --- a/client/src/generated/common.ts +++ b/client/src/generated/common.ts @@ -1,150 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Country - * Basic Material - * - * The version of the OpenAPI document: 1.0.0 - * Contact: baskirill.an@gmail.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import type { Configuration } from "./configuration"; -import type { RequestArgs } from "./base"; -import type { AxiosInstance, AxiosResponse } from 'axios'; -import { RequiredError } from "./base"; - -/** - * - * @export - */ -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 - */ -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 - */ -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}`) - ); - } - } - else { - if (urlSearchParams.has(key)) { - urlSearchParams.append(key, parameter); - } - else { - urlSearchParams.set(key, parameter); - } - } -} - -/** - * - * @export - */ -export const setSearchParams = function (url: URL, ...objects: any[]) { - 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 - */ -export const toPathString = function (url: URL) { - 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); - }; -} diff --git a/client/src/generated/configuration.ts b/client/src/generated/configuration.ts index 6ca4f951..e69de29b 100644 --- a/client/src/generated/configuration.ts +++ b/client/src/generated/configuration.ts @@ -1,110 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Country - * Basic Material - * - * The version of the OpenAPI document: 1.0.0 - * Contact: baskirill.an@gmail.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * 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; -} - -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; - - 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'); - } -} diff --git a/client/src/generated/git_push.sh b/client/src/generated/git_push.sh index f53a75d4..e69de29b 100644 --- a/client/src/generated/git_push.sh +++ b/client/src/generated/git_push.sh @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/client/src/generated/index.ts b/client/src/generated/index.ts index 939130d1..e69de29b 100644 --- a/client/src/generated/index.ts +++ b/client/src/generated/index.ts @@ -1,18 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Country - * Basic Material - * - * The version of the OpenAPI document: 1.0.0 - * Contact: baskirill.an@gmail.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -export * from "./api"; -export * from "./configuration"; -export * from "./model"; diff --git a/client/src/generated/model/index.ts b/client/src/generated/model/index.ts deleted file mode 100644 index 414b451a..00000000 --- a/client/src/generated/model/index.ts +++ /dev/null @@ -1,28 +0,0 @@ -export * from './basic-material'; -export * from './client-error'; -export * from './country'; -export * from './create-instrument-request-body'; -export * from './edit-instrument-request-body'; -export * from './get-countries-response'; -export * from './get-instrument-basic-materials-response'; -export * from './get-instrument-by-criteria-page-response'; -export * from './get-instrument-types-response'; -export * from './get-instruments-by-criteria-request-body'; -export * from './get-instruments-by-criteria-response'; -export * from './get-manufacturers-response'; -export * from './instrument-detail'; -export * from './instrument-detail-without-id'; -export * from './instrument-id'; -export * from './instrument-name'; -export * from './instrument-photo'; -export * from './instrument-type'; -export * from './jwt-response'; -export * from './list-favorite-response'; -export * from './manufacture-date'; -export * from './manufacturer'; -export * from './manufacturer-name'; -export * from './profile-details'; -export * from './registration-request'; -export * from './release-date'; -export * from './server-error'; -export * from './username-and-password-request-body'; diff --git a/server/app/src/main/kotlin/mu/muse/application/muse/SecurityConfiguration.kt b/server/app/src/main/kotlin/mu/muse/application/muse/SecurityConfiguration.kt index e2ba8019..8cb9786d 100644 --- a/server/app/src/main/kotlin/mu/muse/application/muse/SecurityConfiguration.kt +++ b/server/app/src/main/kotlin/mu/muse/application/muse/SecurityConfiguration.kt @@ -54,10 +54,9 @@ import java.security.Key class SecurityConfiguration( @Value("\${spring.profiles.active}") private val springActiveProfile: String, + @Value("\${muse.client.port}") + private val museClientPort: String, ) { - - - companion object { val logger: Logger = LoggerFactory.getLogger(SecurityConfiguration::class.java) } @@ -73,8 +72,8 @@ class SecurityConfiguration( fun corsConfigurationSource(): CorsConfigurationSource { val configuration = CorsConfiguration() configuration.allowedOrigins = when (springActiveProfile) { - Application.Profile.LOCAL -> listOf("http://localhost:3000") - Application.Profile.DEV -> listOf("http://88.201.171.120:50001") + Application.Profile.LOCAL -> listOf("http://localhost:${museClientPort}") + Application.Profile.DEV -> listOf("http://88.201.171.120:${museClientPort}") else -> throw UnknownDeployStageException(springActiveProfile) } configuration.allowedMethods = listOf("GET", "POST", "PUT", "DELETE", "OPTIONS") diff --git a/server/app/src/main/resources/application.properties b/server/app/src/main/resources/application.properties index 2177e642..5577a1b8 100644 --- a/server/app/src/main/resources/application.properties +++ b/server/app/src/main/resources/application.properties @@ -1,6 +1,8 @@ spring.application.name=muse-server spring.profiles.active=${SERVER_SPRING_PROFILE} +muse.client.port=${CLIENT_PORT} + # https://asecuritysite.com/encryption/plain security.jwt.secret-key=${MUSE_JWT_SECRET_KEY} # 1h in millisecond diff --git a/tools/docker/env/dev.env b/tools/docker/env/dev.env index 27ce88de..0121394e 100644 --- a/tools/docker/env/dev.env +++ b/tools/docker/env/dev.env @@ -1,12 +1,12 @@ -SERVER_PORT=10001 -SERVER_DEBUG_PORT=10002 +SERVER_PORT=50005 +SERVER_DEBUG_PORT=50006 SERVER_SPRING_PROFILE=dev SERVER_API_URL=http://88.201.171.120:10001 -CLIENT_PORT=50001 -CLIENT_DEV_PORT=50002 +CLIENT_PORT=50007 +CLIENT_DEV_PORT=50008 -POSTGRES_PORT=5555 +POSTGRES_PORT=50009 POSTGRES_USER=muse POSTGRES_PASSWORD=muse POSTGRES_DB=muse diff --git a/tools/docker/env/local.env b/tools/docker/env/local.env index ca81fc8a..4486606d 100644 --- a/tools/docker/env/local.env +++ b/tools/docker/env/local.env @@ -1,12 +1,12 @@ -SERVER_PORT=9000 -SERVER_DEBUG_PORT=5005 +SERVER_PORT=50000 +SERVER_DEBUG_PORT=50001 SERVER_SPRING_PROFILE=local SERVER_API_URL=http://localhost:9000 -CLIENT_PORT=3000 -CLIENT_DEV_PORT=3001 +CLIENT_PORT=50002 +CLIENT_DEV_PORT=50003 -POSTGRES_PORT=5432 +POSTGRES_PORT=50004 POSTGRES_USER=muse POSTGRES_PASSWORD=muse POSTGRES_DB=muse diff --git a/tools/scripts/clean.sh b/tools/scripts/clean.sh index 102fc864..010ae1ec 100755 --- a/tools/scripts/clean.sh +++ b/tools/scripts/clean.sh @@ -3,6 +3,12 @@ set -e currentDir=$(cd -P -- "$(dirname -- "$0")" && pwd -P) rootDir="$currentDir/../../" +function finish { + docker context use "${MUSE_DOCKER_DEFAULT_CONTEXT}" +} + +trap 'finish' EXIT + stage=$1 if [ -z "$1" ]; then @@ -17,7 +23,7 @@ if [ -z "$2" ]; then dockerRepository="myshx" fi -docker context use desktop-linux +docker context use "${MUSE_DOCKER_DEFAULT_CONTEXT}" if [ "$stage" != "local" ]; then context_name=muse-deploy-server diff --git a/tools/scripts/deploy.sh b/tools/scripts/deploy.sh index 785026f6..e3fdc1d8 100755 --- a/tools/scripts/deploy.sh +++ b/tools/scripts/deploy.sh @@ -3,6 +3,17 @@ set -e currentDir=$(cd -P -- "$(dirname -- "$0")" && pwd -P) rootDir="$currentDir/../../" +function finish { + docker context use "${MUSE_DOCKER_DEFAULT_CONTEXT}" + + # unstash the unstashed changes if it's exists + if [ "$DIFFS_COUNT" -ne 0 ]; then + git stash pop -q + fi +} + +trap finish EXIT + DIFFS_COUNT=$(git diff --name-only | wc -l) # stash any unstaged changes if it's exists @@ -10,12 +21,6 @@ if [ "$DIFFS_COUNT" -ne 0 ]; then git stash -q --keep-index fi -function finish { - docker context use desktop-linux -} - -trap 'finish' EXIT - stage=$1 if [ -z "$1" ]; then @@ -57,10 +62,5 @@ fi (cd "$rootDir" && exec ./tools/scripts/clean.sh "$stage" "$dockerRepository") (cd "$rootDir" && exec ./tools/scripts/run.sh "$stage") -# unstash the unstashed changes if it's exists -if [ "$DIFFS_COUNT" -ne 0 ]; then - git stash pop -q -fi - echo -e "\033[0;32m[$stage] List of available ports:\n\033[0m" (cd "$rootDir" && exec cat "./tools/docker/env/$stage.env") diff --git a/tools/scripts/run.sh b/tools/scripts/run.sh index 91b838cc..4de9da0e 100755 --- a/tools/scripts/run.sh +++ b/tools/scripts/run.sh @@ -3,6 +3,12 @@ set -e currentDir=$(cd -P -- "$(dirname -- "$0")" && pwd -P) rootDir="$currentDir/../../" +function finish { + docker context use "${MUSE_DOCKER_DEFAULT_CONTEXT}" +} + +trap 'finish' EXIT + stage=$1 if [ -z "$1" ]; then @@ -17,7 +23,8 @@ if [ -z "$2" ]; then dockerRepository="myshx" fi -docker context use desktop-linux +docker context use "${MUSE_DOCKER_DEFAULT_CONTEXT}" + if [ "$stage" != "local" ]; then context_name=muse-$stage if ! docker context ls --format '{{.Name}}' | grep -q "^${context_name}$"; then diff --git a/tools/scripts/stop.sh b/tools/scripts/stop.sh index 00ae92b8..51a8facb 100755 --- a/tools/scripts/stop.sh +++ b/tools/scripts/stop.sh @@ -3,6 +3,12 @@ set -e currentDir=$(cd -P -- "$(dirname -- "$0")" && pwd -P) rootDir="$currentDir/../../" +function finish { + docker context use "${MUSE_DOCKER_DEFAULT_CONTEXT}" +} + +trap 'finish' EXIT + stage=$1 if [ -z "$1" ]; then @@ -17,7 +23,7 @@ if [ -z "$2" ]; then dockerRepository="myshx" fi -docker context use desktop-linux +docker context use "${MUSE_DOCKER_DEFAULT_CONTEXT}" if [ "$stage" != "local" ]; then context_name=muse-$stage @@ -26,12 +32,6 @@ if [ "$stage" != "local" ]; then fi docker context use "$context_name" - - function finish { - docker context use desktop-linux - } - - trap "finish" EXIT fi export DOCKER_REPOSITORY=$dockerRepository From 41ffb46f08cf30b70c53732fa2973094fb4f26fe Mon Sep 17 00:00:00 2001 From: skywalker Date: Wed, 28 Aug 2024 16:01:17 +0300 Subject: [PATCH 2/8] feat(staging): add staging stage --- .../main/kotlin/mu/muse/application/Application.kt | 1 + .../muse/application/muse/SecurityConfiguration.kt | 1 + tools/docker/env/staging.env | 13 +++++++++++++ 3 files changed, 15 insertions(+) create mode 100644 tools/docker/env/staging.env diff --git a/server/app/src/main/kotlin/mu/muse/application/Application.kt b/server/app/src/main/kotlin/mu/muse/application/Application.kt index 073e1c34..2f3a1993 100644 --- a/server/app/src/main/kotlin/mu/muse/application/Application.kt +++ b/server/app/src/main/kotlin/mu/muse/application/Application.kt @@ -35,6 +35,7 @@ class Application : CommandLineRunner { companion object { const val LOCAL = "local" const val DEV = "dev" + const val STAGING = "staging" } } diff --git a/server/app/src/main/kotlin/mu/muse/application/muse/SecurityConfiguration.kt b/server/app/src/main/kotlin/mu/muse/application/muse/SecurityConfiguration.kt index 8cb9786d..4732ac9e 100644 --- a/server/app/src/main/kotlin/mu/muse/application/muse/SecurityConfiguration.kt +++ b/server/app/src/main/kotlin/mu/muse/application/muse/SecurityConfiguration.kt @@ -74,6 +74,7 @@ class SecurityConfiguration( configuration.allowedOrigins = when (springActiveProfile) { Application.Profile.LOCAL -> listOf("http://localhost:${museClientPort}") Application.Profile.DEV -> listOf("http://88.201.171.120:${museClientPort}") + Application.Profile.STAGING -> listOf("http://88.201.171.120:${museClientPort}") else -> throw UnknownDeployStageException(springActiveProfile) } configuration.allowedMethods = listOf("GET", "POST", "PUT", "DELETE", "OPTIONS") diff --git a/tools/docker/env/staging.env b/tools/docker/env/staging.env new file mode 100644 index 00000000..ce2a454d --- /dev/null +++ b/tools/docker/env/staging.env @@ -0,0 +1,13 @@ +SERVER_PORT=50010 +SERVER_DEBUG_PORT=50011 +SERVER_SPRING_PROFILE=local +SERVER_API_URL=http://localhost:50012 + +CLIENT_PORT=50013 +CLIENT_DEV_PORT=50014 + +POSTGRES_PORT=50015 +POSTGRES_USER=muse +POSTGRES_PASSWORD=muse +POSTGRES_DB=muse +POSTGRES_DSN=jdbc:postgresql://muse-postgres:5432/muse From 2f90efc724313ae369ac533134c28932702df11f Mon Sep 17 00:00:00 2001 From: skywalker Date: Wed, 28 Aug 2024 16:07:53 +0300 Subject: [PATCH 3/8] chore(openapi-generator): run generator --- client/src/generated/.gitignore | 4 + client/src/generated/.npmignore | 1 + client/src/generated/api.ts | 35 ++++++ client/src/generated/base.ts | 86 +++++++++++++++ client/src/generated/common.ts | 150 ++++++++++++++++++++++++++ client/src/generated/configuration.ts | 110 +++++++++++++++++++ client/src/generated/git_push.sh | 57 ++++++++++ client/src/generated/index.ts | 18 ++++ 8 files changed, 461 insertions(+) diff --git a/client/src/generated/.gitignore b/client/src/generated/.gitignore index e69de29b..149b5765 100644 --- a/client/src/generated/.gitignore +++ b/client/src/generated/.gitignore @@ -0,0 +1,4 @@ +wwwroot/*.js +node_modules +typings +dist diff --git a/client/src/generated/.npmignore b/client/src/generated/.npmignore index e69de29b..999d88df 100644 --- a/client/src/generated/.npmignore +++ b/client/src/generated/.npmignore @@ -0,0 +1 @@ +# empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm \ No newline at end of file diff --git a/client/src/generated/api.ts b/client/src/generated/api.ts index e69de29b..643644cf 100644 --- a/client/src/generated/api.ts +++ b/client/src/generated/api.ts @@ -0,0 +1,35 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Country + * Basic Material + * + * The version of the OpenAPI document: 1.0.0 + * Contact: baskirill.an@gmail.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +export * from './api/add-favorite-api'; +export * from './api/basic-login-api'; +export * from './api/create-instrument-api'; +export * from './api/delete-instrument-by-id-api'; +export * from './api/edit-instrument-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-photo-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-manufacturers-api'; +export * from './api/get-user-profile-api'; +export * from './api/list-favorite-api'; +export * from './api/logout-api'; +export * from './api/remove-favorite-api'; +export * from './api/user-registration-api'; + diff --git a/client/src/generated/base.ts b/client/src/generated/base.ts index e69de29b..54eed7d9 100644 --- a/client/src/generated/base.ts +++ b/client/src/generated/base.ts @@ -0,0 +1,86 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Country + * Basic Material + * + * The version of the OpenAPI document: 1.0.0 + * Contact: baskirill.an@gmail.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +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'; + +export const BASE_PATH = "http://localhost:8080".replace(/\/+$/, ""); + +/** + * + * @export + */ +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; + +/** + * + * @export + * @interface RequestArgs + */ +export interface RequestArgs { + url: string; + options: RawAxiosRequestConfig; +} + +/** + * + * @export + * @class BaseAPI + */ +export class BaseAPI { + 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; + } + } +}; + +/** + * + * @export + * @class RequiredError + * @extends {Error} + */ +export class RequiredError extends Error { + constructor(public field: string, msg?: string) { + super(msg); + this.name = "RequiredError" + } +} + +interface ServerMap { + [key: string]: { + url: string, + description: string, + }[]; +} + +/** + * + * @export + */ +export const operationServerMap: ServerMap = { +} diff --git a/client/src/generated/common.ts b/client/src/generated/common.ts index e69de29b..98bf6297 100644 --- a/client/src/generated/common.ts +++ b/client/src/generated/common.ts @@ -0,0 +1,150 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Country + * Basic Material + * + * The version of the OpenAPI document: 1.0.0 + * Contact: baskirill.an@gmail.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { Configuration } from "./configuration"; +import type { RequestArgs } from "./base"; +import type { AxiosInstance, AxiosResponse } from 'axios'; +import { RequiredError } from "./base"; + +/** + * + * @export + */ +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 + */ +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 + */ +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}`) + ); + } + } + else { + if (urlSearchParams.has(key)) { + urlSearchParams.append(key, parameter); + } + else { + urlSearchParams.set(key, parameter); + } + } +} + +/** + * + * @export + */ +export const setSearchParams = function (url: URL, ...objects: any[]) { + 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 + */ +export const toPathString = function (url: URL) { + 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); + }; +} diff --git a/client/src/generated/configuration.ts b/client/src/generated/configuration.ts index e69de29b..6ca4f951 100644 --- a/client/src/generated/configuration.ts +++ b/client/src/generated/configuration.ts @@ -0,0 +1,110 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Country + * Basic Material + * + * The version of the OpenAPI document: 1.0.0 + * Contact: baskirill.an@gmail.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * 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; +} + +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; + + 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'); + } +} diff --git a/client/src/generated/git_push.sh b/client/src/generated/git_push.sh index e69de29b..f53a75d4 100644 --- a/client/src/generated/git_push.sh +++ b/client/src/generated/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/client/src/generated/index.ts b/client/src/generated/index.ts index e69de29b..939130d1 100644 --- a/client/src/generated/index.ts +++ b/client/src/generated/index.ts @@ -0,0 +1,18 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Country + * Basic Material + * + * The version of the OpenAPI document: 1.0.0 + * Contact: baskirill.an@gmail.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export * from "./api"; +export * from "./configuration"; +export * from "./model"; From 5df96bea976894663db5744bf6ad69b69d48761e Mon Sep 17 00:00:00 2001 From: skywalker Date: Wed, 28 Aug 2024 16:16:51 +0300 Subject: [PATCH 4/8] chore(unify-port): try to use interpolation to pass environment to another environment --- tools/docker/env/local.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/docker/env/local.env b/tools/docker/env/local.env index 4486606d..3cb57354 100644 --- a/tools/docker/env/local.env +++ b/tools/docker/env/local.env @@ -1,7 +1,7 @@ SERVER_PORT=50000 SERVER_DEBUG_PORT=50001 SERVER_SPRING_PROFILE=local -SERVER_API_URL=http://localhost:9000 +SERVER_API_URL=http://localhost:${SERVER_PORT} CLIENT_PORT=50002 CLIENT_DEV_PORT=50003 From 1b7a5e9e31241885162e64e34ba145d24da239d9 Mon Sep 17 00:00:00 2001 From: skywalker Date: Wed, 28 Aug 2024 16:33:46 +0300 Subject: [PATCH 5/8] chore(env): add `CLIENT_URL`, `SERVER_HOST` and `CLIENT_HOST` envs --- .../main/kotlin/mu/muse/application/Application.kt | 8 -------- .../muse/application/muse/SecurityConfiguration.kt | 13 +++---------- .../app/src/main/resources/application.properties | 2 +- tools/docker/env/dev.env | 7 +++++-- tools/docker/env/local.env | 7 +++++-- tools/docker/env/staging.env | 9 ++++++--- 6 files changed, 20 insertions(+), 26 deletions(-) diff --git a/server/app/src/main/kotlin/mu/muse/application/Application.kt b/server/app/src/main/kotlin/mu/muse/application/Application.kt index 2f3a1993..e51bd43e 100644 --- a/server/app/src/main/kotlin/mu/muse/application/Application.kt +++ b/server/app/src/main/kotlin/mu/muse/application/Application.kt @@ -31,14 +31,6 @@ import java.time.Instant @Import(ApplicationConfiguration::class) class Application : CommandLineRunner { - class Profile { - companion object { - const val LOCAL = "local" - const val DEV = "dev" - const val STAGING = "staging" - } - } - @Autowired lateinit var userIdGenerator: IdGenerator diff --git a/server/app/src/main/kotlin/mu/muse/application/muse/SecurityConfiguration.kt b/server/app/src/main/kotlin/mu/muse/application/muse/SecurityConfiguration.kt index 4732ac9e..2520c083 100644 --- a/server/app/src/main/kotlin/mu/muse/application/muse/SecurityConfiguration.kt +++ b/server/app/src/main/kotlin/mu/muse/application/muse/SecurityConfiguration.kt @@ -23,7 +23,6 @@ import org.slf4j.LoggerFactory import org.springframework.beans.factory.annotation.Value import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration -import org.springframework.context.annotation.Profile import org.springframework.http.HttpMethod import org.springframework.security.authentication.AuthenticationManager import org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration @@ -54,8 +53,8 @@ import java.security.Key class SecurityConfiguration( @Value("\${spring.profiles.active}") private val springActiveProfile: String, - @Value("\${muse.client.port}") - private val museClientPort: String, + @Value("\${muse.client-url}") + private val museClientUrl: String, ) { companion object { val logger: Logger = LoggerFactory.getLogger(SecurityConfiguration::class.java) @@ -71,16 +70,10 @@ class SecurityConfiguration( @Bean fun corsConfigurationSource(): CorsConfigurationSource { val configuration = CorsConfiguration() - configuration.allowedOrigins = when (springActiveProfile) { - Application.Profile.LOCAL -> listOf("http://localhost:${museClientPort}") - Application.Profile.DEV -> listOf("http://88.201.171.120:${museClientPort}") - Application.Profile.STAGING -> listOf("http://88.201.171.120:${museClientPort}") - else -> throw UnknownDeployStageException(springActiveProfile) - } + configuration.allowedOrigins = listOf(museClientUrl) configuration.allowedMethods = listOf("GET", "POST", "PUT", "DELETE", "OPTIONS") configuration.allowedHeaders = listOf("*") configuration.allowCredentials = true - val source = UrlBasedCorsConfigurationSource() source.registerCorsConfiguration("/**", configuration) return source diff --git a/server/app/src/main/resources/application.properties b/server/app/src/main/resources/application.properties index 5577a1b8..31642c01 100644 --- a/server/app/src/main/resources/application.properties +++ b/server/app/src/main/resources/application.properties @@ -1,7 +1,7 @@ spring.application.name=muse-server spring.profiles.active=${SERVER_SPRING_PROFILE} -muse.client.port=${CLIENT_PORT} +muse.client-url=${CLIENT_URL} # https://asecuritysite.com/encryption/plain security.jwt.secret-key=${MUSE_JWT_SECRET_KEY} diff --git a/tools/docker/env/dev.env b/tools/docker/env/dev.env index 0121394e..492a3958 100644 --- a/tools/docker/env/dev.env +++ b/tools/docker/env/dev.env @@ -1,13 +1,16 @@ +SERVER_HOST=88.201.171.120 SERVER_PORT=50005 SERVER_DEBUG_PORT=50006 SERVER_SPRING_PROFILE=dev -SERVER_API_URL=http://88.201.171.120:10001 +SERVER_API_URL=http://${SERVER_HOST}:${SERVER_PORT} +CLIENT_HOST=88.201.171.120 CLIENT_PORT=50007 CLIENT_DEV_PORT=50008 +CLIENT_URL=http://${CLIENT_HOST}:${CLIENT_PORT} POSTGRES_PORT=50009 POSTGRES_USER=muse POSTGRES_PASSWORD=muse POSTGRES_DB=muse -POSTGRES_DSN=jdbc:postgresql://muse-postgres:5432/muse +POSTGRES_DSN=jdbc:postgresql://muse-postgres:5432/${POSTGRES_DB} # used default postgresql port due to bridge driver \ No newline at end of file diff --git a/tools/docker/env/local.env b/tools/docker/env/local.env index 3cb57354..cfdb01bd 100644 --- a/tools/docker/env/local.env +++ b/tools/docker/env/local.env @@ -1,13 +1,16 @@ +SERVER_HOST=localhost SERVER_PORT=50000 SERVER_DEBUG_PORT=50001 SERVER_SPRING_PROFILE=local -SERVER_API_URL=http://localhost:${SERVER_PORT} +SERVER_API_URL=http://${SERVER_HOST}:${SERVER_PORT} +CLIENT_HOST=localhost CLIENT_PORT=50002 CLIENT_DEV_PORT=50003 +CLIENT_URL=http://${CLIENT_HOST}:${CLIENT_PORT} POSTGRES_PORT=50004 POSTGRES_USER=muse POSTGRES_PASSWORD=muse POSTGRES_DB=muse -POSTGRES_DSN=jdbc:postgresql://muse-postgres:5432/muse +POSTGRES_DSN=jdbc:postgresql://muse-postgres:5432/${POSTGRES_DB} # used default postgresql port due to bridge driver diff --git a/tools/docker/env/staging.env b/tools/docker/env/staging.env index ce2a454d..eee27162 100644 --- a/tools/docker/env/staging.env +++ b/tools/docker/env/staging.env @@ -1,13 +1,16 @@ +SERVER_HOST=88.201.171.120 SERVER_PORT=50010 SERVER_DEBUG_PORT=50011 -SERVER_SPRING_PROFILE=local -SERVER_API_URL=http://localhost:50012 +SERVER_SPRING_PROFILE=staging +SERVER_API_URL=http://${SERVER_HOST}:${SERVER_PORT} +CLIENT_HOST=88.201.171.120 CLIENT_PORT=50013 CLIENT_DEV_PORT=50014 +CLIENT_URL=http://${CLIENT_HOST}:${CLIENT_PORT} POSTGRES_PORT=50015 POSTGRES_USER=muse POSTGRES_PASSWORD=muse POSTGRES_DB=muse -POSTGRES_DSN=jdbc:postgresql://muse-postgres:5432/muse +POSTGRES_DSN=jdbc:postgresql://muse-postgres:5432/${POSTGRES_DB} # used default postgresql port due to bridge driver \ No newline at end of file From fc59c56f20a166decd925c83b0fce97b6dd2c0e0 Mon Sep 17 00:00:00 2001 From: skywalker Date: Wed, 28 Aug 2024 16:34:19 +0300 Subject: [PATCH 6/8] refactor(server): remove redundant code --- .../kotlin/mu/muse/application/muse/SecurityConfiguration.kt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/server/app/src/main/kotlin/mu/muse/application/muse/SecurityConfiguration.kt b/server/app/src/main/kotlin/mu/muse/application/muse/SecurityConfiguration.kt index 2520c083..9c1d8c38 100644 --- a/server/app/src/main/kotlin/mu/muse/application/muse/SecurityConfiguration.kt +++ b/server/app/src/main/kotlin/mu/muse/application/muse/SecurityConfiguration.kt @@ -51,8 +51,6 @@ import java.security.Key @EnableMethodSecurity(securedEnabled = true, jsr250Enabled = true) @Suppress("TooManyFunctions") class SecurityConfiguration( - @Value("\${spring.profiles.active}") - private val springActiveProfile: String, @Value("\${muse.client-url}") private val museClientUrl: String, ) { @@ -166,5 +164,3 @@ class SecurityConfiguration( return DelegatingPasswordEncoder(idForEncode, encoders); } } - -class UnknownDeployStageException(private val stage: String) : RuntimeException("Found unknown deploy stage '${stage}") From 478668943896445e218cb742c9bd58d9df1bfc9d Mon Sep 17 00:00:00 2001 From: skywalker Date: Wed, 28 Aug 2024 16:39:43 +0300 Subject: [PATCH 7/8] chore(env): add `CLIENT_URL` to compose config --- tools/docker/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/docker/docker-compose.yml b/tools/docker/docker-compose.yml index e50f4627..8ab9fb61 100644 --- a/tools/docker/docker-compose.yml +++ b/tools/docker/docker-compose.yml @@ -40,7 +40,7 @@ services: environment: - MUSE_JWT_SECRET_KEY - SERVER_SPRING_PROFILE - - CLIENT_PORT + - CLIENT_URL - POSTGRES_USER - POSTGRES_PASSWORD - POSTGRES_DB From 85de15990b78aa8933e4a8fa044cbb0a61a1be5d Mon Sep 17 00:00:00 2001 From: skywalker Date: Wed, 28 Aug 2024 16:52:18 +0300 Subject: [PATCH 8/8] chore(openapi-generator): commit codegen --- client/src/generated/.openapi-generator/FILES | 55 ++++++ .../src/generated/.openapi-generator/VERSION | 1 + client/src/generated/api/add-favorite-api.ts | 137 +++++++++++++++ client/src/generated/api/basic-login-api.ts | 137 +++++++++++++++ .../generated/api/create-instrument-api.ts | 137 +++++++++++++++ .../api/delete-instrument-by-id-api.ts | 133 +++++++++++++++ .../src/generated/api/edit-instrument-api.ts | 137 +++++++++++++++ client/src/generated/api/get-countries-api.ts | 128 ++++++++++++++ .../api/get-instrument-basic-materials-api.ts | 128 ++++++++++++++ .../generated/api/get-instrument-by-id-api.ts | 135 +++++++++++++++ .../generated/api/get-instrument-photo-api.ts | 135 +++++++++++++++ .../generated/api/get-instrument-types-api.ts | 128 ++++++++++++++ .../api/get-instruments-by-criteria-api.ts | 139 +++++++++++++++ ...t-instruments-by-criteria-paginated-api.ts | 159 ++++++++++++++++++ .../generated/api/get-manufacturers-api.ts | 128 ++++++++++++++ .../src/generated/api/get-user-profile-api.ts | 126 ++++++++++++++ client/src/generated/api/list-favorite-api.ts | 128 ++++++++++++++ client/src/generated/api/logout-api.ts | 124 ++++++++++++++ .../src/generated/api/remove-favorite-api.ts | 137 +++++++++++++++ .../generated/api/user-registration-api.ts | 135 +++++++++++++++ client/src/generated/model/index.ts | 28 +++ .../generated/model/list-favorite-response.ts | 33 ++++ .../kotlin/mu/muse/rest/api/AddFavoriteApi.kt | 45 +++++ .../main/kotlin/mu/muse/rest/api/ApiUtil.kt | 19 +++ .../kotlin/mu/muse/rest/api/BasicLoginApi.kt | 45 +++++ .../mu/muse/rest/api/CreateInstrumentApi.kt | 45 +++++ .../muse/rest/api/DeleteInstrumentByIdApi.kt | 43 +++++ .../mu/muse/rest/api/EditInstrumentApi.kt | 45 +++++ .../mu/muse/rest/api/GetCountriesApi.kt | 44 +++++ .../api/GetInstrumentBasicMaterialsApi.kt | 44 +++++ .../mu/muse/rest/api/GetInstrumentByIdApi.kt | 44 +++++ .../mu/muse/rest/api/GetInstrumentPhotoApi.kt | 44 +++++ .../mu/muse/rest/api/GetInstrumentTypesApi.kt | 44 +++++ .../rest/api/GetInstrumentsByCriteriaApi.kt | 46 +++++ .../GetInstrumentsByCriteriaPaginatedApi.kt | 46 +++++ .../mu/muse/rest/api/GetManufacturersApi.kt | 44 +++++ .../mu/muse/rest/api/GetUserProfileApi.kt | 43 +++++ .../mu/muse/rest/api/ListFavoriteApi.kt | 44 +++++ .../main/kotlin/mu/muse/rest/api/LogoutApi.kt | 42 +++++ .../mu/muse/rest/api/RemoveFavoriteApi.kt | 45 +++++ .../mu/muse/rest/api/UserRegistrationApi.kt | 44 +++++ .../kotlin/mu/muse/rest/dto/BasicMaterial.kt | 25 +++ .../kotlin/mu/muse/rest/dto/ClientError.kt | 28 +++ .../main/kotlin/mu/muse/rest/dto/Country.kt | 25 +++ .../rest/dto/CreateInstrumentRequestBody.kt | 32 ++++ .../rest/dto/EditInstrumentRequestBody.kt | 32 ++++ .../mu/muse/rest/dto/GetCountriesResponse.kt | 27 +++ .../GetInstrumentBasicMaterialsResponse.kt | 27 +++ .../GetInstrumentByCriteriaPageResponse.kt | 42 +++++ .../rest/dto/GetInstrumentTypesResponse.kt | 27 +++ .../GetInstrumentsByCriteriaRequestBody.kt | 70 ++++++++ .../dto/GetInstrumentsByCriteriaResponse.kt | 27 +++ .../muse/rest/dto/GetManufacturersResponse.kt | 27 +++ .../mu/muse/rest/dto/InstrumentDetail.kt | 62 +++++++ .../rest/dto/InstrumentDetailWithoutId.kt | 57 +++++++ .../kotlin/mu/muse/rest/dto/InstrumentId.kt | 25 +++ .../kotlin/mu/muse/rest/dto/InstrumentName.kt | 25 +++ .../mu/muse/rest/dto/InstrumentPhoto.kt | 25 +++ .../kotlin/mu/muse/rest/dto/InstrumentType.kt | 25 +++ .../kotlin/mu/muse/rest/dto/JwtResponse.kt | 25 +++ .../mu/muse/rest/dto/ListFavoriteResponse.kt | 27 +++ .../mu/muse/rest/dto/ManufactureDate.kt | 26 +++ .../kotlin/mu/muse/rest/dto/Manufacturer.kt | 25 +++ .../mu/muse/rest/dto/ManufacturerName.kt | 25 +++ .../kotlin/mu/muse/rest/dto/ProfileDetails.kt | 31 ++++ .../mu/muse/rest/dto/RegistrationRequest.kt | 31 ++++ .../kotlin/mu/muse/rest/dto/ReleaseDate.kt | 26 +++ .../kotlin/mu/muse/rest/dto/ServerError.kt | 28 +++ .../dto/UsernameAndPasswordRequestBody.kt | 28 +++ 69 files changed, 4224 insertions(+) create mode 100644 client/src/generated/.openapi-generator/FILES create mode 100644 client/src/generated/.openapi-generator/VERSION create mode 100644 client/src/generated/api/add-favorite-api.ts create mode 100644 client/src/generated/api/basic-login-api.ts create mode 100644 client/src/generated/api/create-instrument-api.ts create mode 100644 client/src/generated/api/delete-instrument-by-id-api.ts create mode 100644 client/src/generated/api/edit-instrument-api.ts create mode 100644 client/src/generated/api/get-countries-api.ts create mode 100644 client/src/generated/api/get-instrument-basic-materials-api.ts create mode 100644 client/src/generated/api/get-instrument-by-id-api.ts create mode 100644 client/src/generated/api/get-instrument-photo-api.ts create mode 100644 client/src/generated/api/get-instrument-types-api.ts create mode 100644 client/src/generated/api/get-instruments-by-criteria-api.ts create mode 100644 client/src/generated/api/get-instruments-by-criteria-paginated-api.ts create mode 100644 client/src/generated/api/get-manufacturers-api.ts create mode 100644 client/src/generated/api/get-user-profile-api.ts create mode 100644 client/src/generated/api/list-favorite-api.ts create mode 100644 client/src/generated/api/logout-api.ts create mode 100644 client/src/generated/api/remove-favorite-api.ts create mode 100644 client/src/generated/api/user-registration-api.ts create mode 100644 client/src/generated/model/index.ts create mode 100644 client/src/generated/model/list-favorite-response.ts create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/AddFavoriteApi.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/ApiUtil.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/BasicLoginApi.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/CreateInstrumentApi.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/DeleteInstrumentByIdApi.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/EditInstrumentApi.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetCountriesApi.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetInstrumentBasicMaterialsApi.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetInstrumentByIdApi.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetInstrumentPhotoApi.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetInstrumentTypesApi.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetInstrumentsByCriteriaApi.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetInstrumentsByCriteriaPaginatedApi.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetManufacturersApi.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetUserProfileApi.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/ListFavoriteApi.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/LogoutApi.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/RemoveFavoriteApi.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/UserRegistrationApi.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/BasicMaterial.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/ClientError.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/Country.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/CreateInstrumentRequestBody.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/EditInstrumentRequestBody.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/GetCountriesResponse.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/GetInstrumentBasicMaterialsResponse.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/GetInstrumentByCriteriaPageResponse.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/GetInstrumentTypesResponse.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/GetInstrumentsByCriteriaRequestBody.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/GetInstrumentsByCriteriaResponse.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/GetManufacturersResponse.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/InstrumentDetail.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/InstrumentDetailWithoutId.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/InstrumentId.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/InstrumentName.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/InstrumentPhoto.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/InstrumentType.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/JwtResponse.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/ListFavoriteResponse.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/ManufactureDate.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/Manufacturer.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/ManufacturerName.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/ProfileDetails.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/RegistrationRequest.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/ReleaseDate.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/ServerError.kt create mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/UsernameAndPasswordRequestBody.kt diff --git a/client/src/generated/.openapi-generator/FILES b/client/src/generated/.openapi-generator/FILES new file mode 100644 index 00000000..8d267068 --- /dev/null +++ b/client/src/generated/.openapi-generator/FILES @@ -0,0 +1,55 @@ +.gitignore +.npmignore +api.ts +api/add-favorite-api.ts +api/basic-login-api.ts +api/create-instrument-api.ts +api/delete-instrument-by-id-api.ts +api/edit-instrument-api.ts +api/get-countries-api.ts +api/get-instrument-basic-materials-api.ts +api/get-instrument-by-id-api.ts +api/get-instrument-photo-api.ts +api/get-instrument-types-api.ts +api/get-instruments-by-criteria-api.ts +api/get-instruments-by-criteria-paginated-api.ts +api/get-manufacturers-api.ts +api/get-user-profile-api.ts +api/list-favorite-api.ts +api/logout-api.ts +api/remove-favorite-api.ts +api/user-registration-api.ts +base.ts +common.ts +configuration.ts +git_push.sh +index.ts +model/basic-material.ts +model/client-error.ts +model/country.ts +model/create-instrument-request-body.ts +model/edit-instrument-request-body.ts +model/get-countries-response.ts +model/get-instrument-basic-materials-response.ts +model/get-instrument-by-criteria-page-response.ts +model/get-instrument-types-response.ts +model/get-instruments-by-criteria-request-body.ts +model/get-instruments-by-criteria-response.ts +model/get-manufacturers-response.ts +model/index.ts +model/instrument-detail-without-id.ts +model/instrument-detail.ts +model/instrument-id.ts +model/instrument-name.ts +model/instrument-photo.ts +model/instrument-type.ts +model/jwt-response.ts +model/list-favorite-response.ts +model/manufacture-date.ts +model/manufacturer-name.ts +model/manufacturer.ts +model/profile-details.ts +model/registration-request.ts +model/release-date.ts +model/server-error.ts +model/username-and-password-request-body.ts diff --git a/client/src/generated/.openapi-generator/VERSION b/client/src/generated/.openapi-generator/VERSION new file mode 100644 index 00000000..09a6d308 --- /dev/null +++ b/client/src/generated/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.8.0 diff --git a/client/src/generated/api/add-favorite-api.ts b/client/src/generated/api/add-favorite-api.ts new file mode 100644 index 00000000..67d7f21a --- /dev/null +++ b/client/src/generated/api/add-favorite-api.ts @@ -0,0 +1,137 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Country + * Basic Material + * + * The version of the OpenAPI document: 1.0.0 + * Contact: baskirill.an@gmail.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +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'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +// @ts-ignore +import type { ClientError } from '../model'; +// @ts-ignore +import type { InstrumentId } from '../model'; +// @ts-ignore +import type { ServerError } from '../model'; +/** + * AddFavoriteApi - axios parameter creator + * @export + */ +export const AddFavoriteApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Add Favorite + * @summary Add Favorite + * @param {InstrumentId} instrumentId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + addFavorite: async (instrumentId: InstrumentId, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'instrumentId' is not null or undefined + assertParamExists('addFavorite', 'instrumentId', instrumentId) + const localVarPath = `/api/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'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(instrumentId, 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 {InstrumentId} instrumentId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async addFavorite(instrumentId: InstrumentId, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addFavorite(instrumentId, 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 {InstrumentId} instrumentId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + addFavorite(instrumentId: InstrumentId, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.addFavorite(instrumentId, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * AddFavoriteApi - object-oriented interface + * @export + * @class AddFavoriteApi + * @extends {BaseAPI} + */ +export class AddFavoriteApi extends BaseAPI { + /** + * Add Favorite + * @summary Add Favorite + * @param {InstrumentId} instrumentId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AddFavoriteApi + */ + public addFavorite(instrumentId: InstrumentId, options?: RawAxiosRequestConfig) { + return AddFavoriteApiFp(this.configuration).addFavorite(instrumentId, 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 new file mode 100644 index 00000000..0401f03e --- /dev/null +++ b/client/src/generated/api/basic-login-api.ts @@ -0,0 +1,137 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Country + * Basic Material + * + * The version of the OpenAPI document: 1.0.0 + * Contact: baskirill.an@gmail.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +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'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +// @ts-ignore +import type { JwtResponse } from '../model'; +// @ts-ignore +import type { ServerError } from '../model'; +// @ts-ignore +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 = `/api/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'; + + 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); + }, + } +}; + +/** + * 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)); + }, + }; +}; + +/** + * BasicLoginApi - object-oriented interface + * @export + * @class BasicLoginApi + * @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)); + } +} + diff --git a/client/src/generated/api/create-instrument-api.ts b/client/src/generated/api/create-instrument-api.ts new file mode 100644 index 00000000..225ba1b3 --- /dev/null +++ b/client/src/generated/api/create-instrument-api.ts @@ -0,0 +1,137 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Country + * Basic Material + * + * The version of the OpenAPI document: 1.0.0 + * Contact: baskirill.an@gmail.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +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'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +// @ts-ignore +import type { ClientError } from '../model'; +// @ts-ignore +import type { CreateInstrumentRequestBody } from '../model'; +// @ts-ignore +import type { ServerError } from '../model'; +/** + * CreateInstrumentApi - axios parameter creator + * @export + */ +export const CreateInstrumentApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Create Instrument + * @summary Create Instrument + * @param {CreateInstrumentRequestBody} createInstrumentRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createInstrument: async (createInstrumentRequestBody: CreateInstrumentRequestBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'createInstrumentRequestBody' is not null or undefined + assertParamExists('createInstrument', 'createInstrumentRequestBody', createInstrumentRequestBody) + const localVarPath = `/api/instrument/create`; + // 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'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(createInstrumentRequestBody, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * CreateInstrumentApi - functional programming interface + * @export + */ +export const CreateInstrumentApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = CreateInstrumentApiAxiosParamCreator(configuration) + return { + /** + * Create Instrument + * @summary Create Instrument + * @param {CreateInstrumentRequestBody} createInstrumentRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createInstrument(createInstrumentRequestBody: CreateInstrumentRequestBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createInstrument(createInstrumentRequestBody, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['CreateInstrumentApi.createInstrument']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } +}; + +/** + * CreateInstrumentApi - factory interface + * @export + */ +export const CreateInstrumentApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = CreateInstrumentApiFp(configuration) + return { + /** + * Create Instrument + * @summary Create Instrument + * @param {CreateInstrumentRequestBody} createInstrumentRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createInstrument(createInstrumentRequestBody: CreateInstrumentRequestBody, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.createInstrument(createInstrumentRequestBody, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * CreateInstrumentApi - object-oriented interface + * @export + * @class CreateInstrumentApi + * @extends {BaseAPI} + */ +export class CreateInstrumentApi extends BaseAPI { + /** + * Create Instrument + * @summary Create Instrument + * @param {CreateInstrumentRequestBody} createInstrumentRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CreateInstrumentApi + */ + public createInstrument(createInstrumentRequestBody: CreateInstrumentRequestBody, options?: RawAxiosRequestConfig) { + return CreateInstrumentApiFp(this.configuration).createInstrument(createInstrumentRequestBody, 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 new file mode 100644 index 00000000..2e9f06b5 --- /dev/null +++ b/client/src/generated/api/delete-instrument-by-id-api.ts @@ -0,0 +1,133 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Country + * Basic Material + * + * The version of the OpenAPI document: 1.0.0 + * Contact: baskirill.an@gmail.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +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'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +// @ts-ignore +import type { ClientError } from '../model'; +// @ts-ignore +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 = `/api/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}; + + 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); + }, + } +}; + +/** + * 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)); + }, + }; +}; + +/** + * DeleteInstrumentByIdApi - object-oriented interface + * @export + * @class DeleteInstrumentByIdApi + * @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)); + } +} + diff --git a/client/src/generated/api/edit-instrument-api.ts b/client/src/generated/api/edit-instrument-api.ts new file mode 100644 index 00000000..17f5ebfd --- /dev/null +++ b/client/src/generated/api/edit-instrument-api.ts @@ -0,0 +1,137 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Country + * Basic Material + * + * The version of the OpenAPI document: 1.0.0 + * Contact: baskirill.an@gmail.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +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'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +// @ts-ignore +import type { ClientError } from '../model'; +// @ts-ignore +import type { EditInstrumentRequestBody } from '../model'; +// @ts-ignore +import type { ServerError } from '../model'; +/** + * EditInstrumentApi - axios parameter creator + * @export + */ +export const EditInstrumentApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Edit Instrument + * @summary Edit Instrument + * @param {EditInstrumentRequestBody} editInstrumentRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + editInstrument: async (editInstrumentRequestBody: EditInstrumentRequestBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'editInstrumentRequestBody' is not null or undefined + assertParamExists('editInstrument', 'editInstrumentRequestBody', editInstrumentRequestBody) + const localVarPath = `/api/instrument/edit`; + // 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'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(editInstrumentRequestBody, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * EditInstrumentApi - functional programming interface + * @export + */ +export const EditInstrumentApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = EditInstrumentApiAxiosParamCreator(configuration) + return { + /** + * Edit Instrument + * @summary Edit Instrument + * @param {EditInstrumentRequestBody} editInstrumentRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async editInstrument(editInstrumentRequestBody: EditInstrumentRequestBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.editInstrument(editInstrumentRequestBody, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['EditInstrumentApi.editInstrument']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } +}; + +/** + * EditInstrumentApi - factory interface + * @export + */ +export const EditInstrumentApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = EditInstrumentApiFp(configuration) + return { + /** + * Edit Instrument + * @summary Edit Instrument + * @param {EditInstrumentRequestBody} editInstrumentRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + editInstrument(editInstrumentRequestBody: EditInstrumentRequestBody, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.editInstrument(editInstrumentRequestBody, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * EditInstrumentApi - object-oriented interface + * @export + * @class EditInstrumentApi + * @extends {BaseAPI} + */ +export class EditInstrumentApi extends BaseAPI { + /** + * Edit Instrument + * @summary Edit Instrument + * @param {EditInstrumentRequestBody} editInstrumentRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof EditInstrumentApi + */ + public editInstrument(editInstrumentRequestBody: EditInstrumentRequestBody, options?: RawAxiosRequestConfig) { + return EditInstrumentApiFp(this.configuration).editInstrument(editInstrumentRequestBody, options).then((request) => request(this.axios, this.basePath)); + } +} + diff --git a/client/src/generated/api/get-countries-api.ts b/client/src/generated/api/get-countries-api.ts new file mode 100644 index 00000000..2bbd9bb2 --- /dev/null +++ b/client/src/generated/api/get-countries-api.ts @@ -0,0 +1,128 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Country + * Basic Material + * + * The version of the OpenAPI document: 1.0.0 + * Contact: baskirill.an@gmail.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +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'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +// @ts-ignore +import type { ClientError } from '../model'; +// @ts-ignore +import type { GetCountriesResponse } from '../model'; +// @ts-ignore +import type { ServerError } from '../model'; +/** + * GetCountriesApi - axios parameter creator + * @export + */ +export const GetCountriesApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Get Countries + * @summary Get Countries + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getCountries: async (options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/api/countries`; + // 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}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * GetCountriesApi - functional programming interface + * @export + */ +export const GetCountriesApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = GetCountriesApiAxiosParamCreator(configuration) + return { + /** + * Get Countries + * @summary Get Countries + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getCountries(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getCountries(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['GetCountriesApi.getCountries']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } +}; + +/** + * GetCountriesApi - factory interface + * @export + */ +export const GetCountriesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = GetCountriesApiFp(configuration) + return { + /** + * Get Countries + * @summary Get Countries + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getCountries(options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getCountries(options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * GetCountriesApi - object-oriented interface + * @export + * @class GetCountriesApi + * @extends {BaseAPI} + */ +export class GetCountriesApi extends BaseAPI { + /** + * Get Countries + * @summary Get Countries + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GetCountriesApi + */ + public getCountries(options?: RawAxiosRequestConfig) { + return GetCountriesApiFp(this.configuration).getCountries(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 new file mode 100644 index 00000000..a880302c --- /dev/null +++ b/client/src/generated/api/get-instrument-basic-materials-api.ts @@ -0,0 +1,128 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Country + * Basic Material + * + * The version of the OpenAPI document: 1.0.0 + * Contact: baskirill.an@gmail.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +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'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +// @ts-ignore +import type { ClientError } from '../model'; +// @ts-ignore +import type { GetInstrumentBasicMaterialsResponse } from '../model'; +// @ts-ignore +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 = `/api/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}; + + 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); + }, + } +}; + +/** + * 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)); + }, + }; +}; + +/** + * GetInstrumentBasicMaterialsApi - object-oriented interface + * @export + * @class GetInstrumentBasicMaterialsApi + * @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)); + } +} + diff --git a/client/src/generated/api/get-instrument-by-id-api.ts b/client/src/generated/api/get-instrument-by-id-api.ts new file mode 100644 index 00000000..4e3d181b --- /dev/null +++ b/client/src/generated/api/get-instrument-by-id-api.ts @@ -0,0 +1,135 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Country + * Basic Material + * + * The version of the OpenAPI document: 1.0.0 + * Contact: baskirill.an@gmail.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +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'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +// @ts-ignore +import type { ClientError } from '../model'; +// @ts-ignore +import type { InstrumentDetail } from '../model'; +// @ts-ignore +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 {number} instrumentId Instrument ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInstrumentById: async (instrumentId: number, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'instrumentId' is not null or undefined + assertParamExists('getInstrumentById', 'instrumentId', instrumentId) + const localVarPath = `/api/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}; + + 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 {number} instrumentId Instrument ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getInstrumentById(instrumentId: number, 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 {number} instrumentId Instrument ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInstrumentById(instrumentId: number, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getInstrumentById(instrumentId, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * GetInstrumentByIdApi - object-oriented interface + * @export + * @class GetInstrumentByIdApi + * @extends {BaseAPI} + */ +export class GetInstrumentByIdApi extends BaseAPI { + /** + * Get Instrument by ID + * @summary Get Instrument by ID + * @param {number} instrumentId Instrument ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GetInstrumentByIdApi + */ + public getInstrumentById(instrumentId: number, 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-photo-api.ts b/client/src/generated/api/get-instrument-photo-api.ts new file mode 100644 index 00000000..eb0e10aa --- /dev/null +++ b/client/src/generated/api/get-instrument-photo-api.ts @@ -0,0 +1,135 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Country + * Basic Material + * + * The version of the OpenAPI document: 1.0.0 + * Contact: baskirill.an@gmail.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +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'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +// @ts-ignore +import type { ClientError } from '../model'; +// @ts-ignore +import type { InstrumentPhoto } from '../model'; +// @ts-ignore +import type { ServerError } from '../model'; +/** + * GetInstrumentPhotoApi - axios parameter creator + * @export + */ +export const GetInstrumentPhotoApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Get Instrument Photo + * @summary Get Instrument Photo + * @param {number} instrumentId Instrument ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInstrumentPhoto: async (instrumentId: number, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'instrumentId' is not null or undefined + assertParamExists('getInstrumentPhoto', 'instrumentId', instrumentId) + const localVarPath = `/api/instrument/photo/{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}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * GetInstrumentPhotoApi - functional programming interface + * @export + */ +export const GetInstrumentPhotoApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = GetInstrumentPhotoApiAxiosParamCreator(configuration) + return { + /** + * Get Instrument Photo + * @summary Get Instrument Photo + * @param {number} instrumentId Instrument ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getInstrumentPhoto(instrumentId: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getInstrumentPhoto(instrumentId, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['GetInstrumentPhotoApi.getInstrumentPhoto']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } +}; + +/** + * GetInstrumentPhotoApi - factory interface + * @export + */ +export const GetInstrumentPhotoApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = GetInstrumentPhotoApiFp(configuration) + return { + /** + * Get Instrument Photo + * @summary Get Instrument Photo + * @param {number} instrumentId Instrument ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInstrumentPhoto(instrumentId: number, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getInstrumentPhoto(instrumentId, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * GetInstrumentPhotoApi - object-oriented interface + * @export + * @class GetInstrumentPhotoApi + * @extends {BaseAPI} + */ +export class GetInstrumentPhotoApi extends BaseAPI { + /** + * Get Instrument Photo + * @summary Get Instrument Photo + * @param {number} instrumentId Instrument ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GetInstrumentPhotoApi + */ + public getInstrumentPhoto(instrumentId: number, options?: RawAxiosRequestConfig) { + return GetInstrumentPhotoApiFp(this.configuration).getInstrumentPhoto(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 new file mode 100644 index 00000000..8e59373b --- /dev/null +++ b/client/src/generated/api/get-instrument-types-api.ts @@ -0,0 +1,128 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Country + * Basic Material + * + * The version of the OpenAPI document: 1.0.0 + * Contact: baskirill.an@gmail.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +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'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +// @ts-ignore +import type { ClientError } from '../model'; +// @ts-ignore +import type { GetInstrumentTypesResponse } from '../model'; +// @ts-ignore +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 = `/api/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}; + + 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); + }, + } +}; + +/** + * 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)); + }, + }; +}; + +/** + * GetInstrumentTypesApi - object-oriented interface + * @export + * @class GetInstrumentTypesApi + * @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)); + } +} + diff --git a/client/src/generated/api/get-instruments-by-criteria-api.ts b/client/src/generated/api/get-instruments-by-criteria-api.ts new file mode 100644 index 00000000..ba63ce3f --- /dev/null +++ b/client/src/generated/api/get-instruments-by-criteria-api.ts @@ -0,0 +1,139 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Country + * Basic Material + * + * The version of the OpenAPI document: 1.0.0 + * Contact: baskirill.an@gmail.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +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'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +// @ts-ignore +import type { ClientError } from '../model'; +// @ts-ignore +import type { GetInstrumentsByCriteriaRequestBody } from '../model'; +// @ts-ignore +import type { GetInstrumentsByCriteriaResponse } from '../model'; +// @ts-ignore +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 {GetInstrumentsByCriteriaRequestBody} getInstrumentsByCriteriaRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInstrumentsByCriteria: async (getInstrumentsByCriteriaRequestBody: GetInstrumentsByCriteriaRequestBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'getInstrumentsByCriteriaRequestBody' is not null or undefined + assertParamExists('getInstrumentsByCriteria', 'getInstrumentsByCriteriaRequestBody', getInstrumentsByCriteriaRequestBody) + const localVarPath = `/api/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'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(getInstrumentsByCriteriaRequestBody, 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 {GetInstrumentsByCriteriaRequestBody} getInstrumentsByCriteriaRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getInstrumentsByCriteria(getInstrumentsByCriteriaRequestBody: GetInstrumentsByCriteriaRequestBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getInstrumentsByCriteria(getInstrumentsByCriteriaRequestBody, 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 {GetInstrumentsByCriteriaRequestBody} getInstrumentsByCriteriaRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInstrumentsByCriteria(getInstrumentsByCriteriaRequestBody: GetInstrumentsByCriteriaRequestBody, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getInstrumentsByCriteria(getInstrumentsByCriteriaRequestBody, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * GetInstrumentsByCriteriaApi - object-oriented interface + * @export + * @class GetInstrumentsByCriteriaApi + * @extends {BaseAPI} + */ +export class GetInstrumentsByCriteriaApi extends BaseAPI { + /** + * Get Instruments by Criteria + * @summary Get Instruments by Criteria + * @param {GetInstrumentsByCriteriaRequestBody} getInstrumentsByCriteriaRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GetInstrumentsByCriteriaApi + */ + public getInstrumentsByCriteria(getInstrumentsByCriteriaRequestBody: GetInstrumentsByCriteriaRequestBody, options?: RawAxiosRequestConfig) { + return GetInstrumentsByCriteriaApiFp(this.configuration).getInstrumentsByCriteria(getInstrumentsByCriteriaRequestBody, 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 new file mode 100644 index 00000000..70f8125b --- /dev/null +++ b/client/src/generated/api/get-instruments-by-criteria-paginated-api.ts @@ -0,0 +1,159 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Country + * Basic Material + * + * The version of the OpenAPI document: 1.0.0 + * Contact: baskirill.an@gmail.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +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'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +// @ts-ignore +import type { ClientError } from '../model'; +// @ts-ignore +import type { GetInstrumentByCriteriaPageResponse } from '../model'; +// @ts-ignore +import type { GetInstrumentsByCriteriaRequestBody } from '../model'; +// @ts-ignore +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 {GetInstrumentsByCriteriaRequestBody} getInstrumentsByCriteriaRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInstrumentsByCriteriaPaginated: async (pageSize: number, pageNumber: number, getInstrumentsByCriteriaRequestBody: GetInstrumentsByCriteriaRequestBody, 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 'getInstrumentsByCriteriaRequestBody' is not null or undefined + assertParamExists('getInstrumentsByCriteriaPaginated', 'getInstrumentsByCriteriaRequestBody', getInstrumentsByCriteriaRequestBody) + const localVarPath = `/api/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; + + if (pageSize !== undefined) { + localVarQueryParameter['page_size'] = pageSize; + } + + 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(getInstrumentsByCriteriaRequestBody, 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 {GetInstrumentsByCriteriaRequestBody} getInstrumentsByCriteriaRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getInstrumentsByCriteriaPaginated(pageSize: number, pageNumber: number, getInstrumentsByCriteriaRequestBody: GetInstrumentsByCriteriaRequestBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getInstrumentsByCriteriaPaginated(pageSize, pageNumber, getInstrumentsByCriteriaRequestBody, 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 {GetInstrumentsByCriteriaRequestBody} getInstrumentsByCriteriaRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInstrumentsByCriteriaPaginated(pageSize: number, pageNumber: number, getInstrumentsByCriteriaRequestBody: GetInstrumentsByCriteriaRequestBody, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getInstrumentsByCriteriaPaginated(pageSize, pageNumber, getInstrumentsByCriteriaRequestBody, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * GetInstrumentsByCriteriaPaginatedApi - object-oriented interface + * @export + * @class GetInstrumentsByCriteriaPaginatedApi + * @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 {GetInstrumentsByCriteriaRequestBody} getInstrumentsByCriteriaRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GetInstrumentsByCriteriaPaginatedApi + */ + public getInstrumentsByCriteriaPaginated(pageSize: number, pageNumber: number, getInstrumentsByCriteriaRequestBody: GetInstrumentsByCriteriaRequestBody, options?: RawAxiosRequestConfig) { + return GetInstrumentsByCriteriaPaginatedApiFp(this.configuration).getInstrumentsByCriteriaPaginated(pageSize, pageNumber, getInstrumentsByCriteriaRequestBody, options).then((request) => request(this.axios, this.basePath)); + } +} + diff --git a/client/src/generated/api/get-manufacturers-api.ts b/client/src/generated/api/get-manufacturers-api.ts new file mode 100644 index 00000000..7effa08a --- /dev/null +++ b/client/src/generated/api/get-manufacturers-api.ts @@ -0,0 +1,128 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Country + * Basic Material + * + * The version of the OpenAPI document: 1.0.0 + * Contact: baskirill.an@gmail.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +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'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +// @ts-ignore +import type { ClientError } from '../model'; +// @ts-ignore +import type { GetManufacturersResponse } from '../model'; +// @ts-ignore +import type { ServerError } from '../model'; +/** + * GetManufacturersApi - axios parameter creator + * @export + */ +export const GetManufacturersApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Get Manufacturers + * @summary Get Manufacturers + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getManufacturers: async (options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/api/manufacturer`; + // 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}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * GetManufacturersApi - functional programming interface + * @export + */ +export const GetManufacturersApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = GetManufacturersApiAxiosParamCreator(configuration) + return { + /** + * Get Manufacturers + * @summary Get Manufacturers + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getManufacturers(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getManufacturers(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['GetManufacturersApi.getManufacturers']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } +}; + +/** + * GetManufacturersApi - factory interface + * @export + */ +export const GetManufacturersApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = GetManufacturersApiFp(configuration) + return { + /** + * Get Manufacturers + * @summary Get Manufacturers + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getManufacturers(options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getManufacturers(options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * GetManufacturersApi - object-oriented interface + * @export + * @class GetManufacturersApi + * @extends {BaseAPI} + */ +export class GetManufacturersApi extends BaseAPI { + /** + * Get Manufacturers + * @summary Get Manufacturers + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GetManufacturersApi + */ + public getManufacturers(options?: RawAxiosRequestConfig) { + return GetManufacturersApiFp(this.configuration).getManufacturers(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 new file mode 100644 index 00000000..feada3ad --- /dev/null +++ b/client/src/generated/api/get-user-profile-api.ts @@ -0,0 +1,126 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Country + * Basic Material + * + * The version of the OpenAPI document: 1.0.0 + * Contact: baskirill.an@gmail.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +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'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +// @ts-ignore +import type { ProfileDetails } from '../model'; +// @ts-ignore +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 = `/api/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}; + + 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); + }, + } +}; + +/** + * 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)); + }, + }; +}; + +/** + * GetUserProfileApi - object-oriented interface + * @export + * @class GetUserProfileApi + * @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)); + } +} + diff --git a/client/src/generated/api/list-favorite-api.ts b/client/src/generated/api/list-favorite-api.ts new file mode 100644 index 00000000..53088d68 --- /dev/null +++ b/client/src/generated/api/list-favorite-api.ts @@ -0,0 +1,128 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Country + * Basic Material + * + * The version of the OpenAPI document: 1.0.0 + * Contact: baskirill.an@gmail.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +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'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +// @ts-ignore +import type { ClientError } from '../model'; +// @ts-ignore +import type { ListFavoriteResponse } from '../model'; +// @ts-ignore +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 = `/api/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: '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, + }; + }, + } +}; + +/** + * 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); + }, + } +}; + +/** + * 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)); + }, + }; +}; + +/** + * ListFavoriteApi - object-oriented interface + * @export + * @class ListFavoriteApi + * @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)); + } +} + diff --git a/client/src/generated/api/logout-api.ts b/client/src/generated/api/logout-api.ts new file mode 100644 index 00000000..ce5f4625 --- /dev/null +++ b/client/src/generated/api/logout-api.ts @@ -0,0 +1,124 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Country + * Basic Material + * + * The version of the OpenAPI document: 1.0.0 + * Contact: baskirill.an@gmail.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +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'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +// @ts-ignore +import type { ServerError } from '../model'; +/** + * LogoutApi - axios parameter creator + * @export + */ +export const LogoutApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Logout Endpoint + * @summary Logout Endpoint + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + logout: async (options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/api/auth/logout`; + // 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}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * LogoutApi - functional programming interface + * @export + */ +export const LogoutApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = LogoutApiAxiosParamCreator(configuration) + return { + /** + * Logout Endpoint + * @summary Logout Endpoint + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async logout(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.logout(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['LogoutApi.logout']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } +}; + +/** + * LogoutApi - factory interface + * @export + */ +export const LogoutApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = LogoutApiFp(configuration) + return { + /** + * Logout Endpoint + * @summary Logout Endpoint + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + logout(options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.logout(options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * LogoutApi - object-oriented interface + * @export + * @class LogoutApi + * @extends {BaseAPI} + */ +export class LogoutApi extends BaseAPI { + /** + * Logout Endpoint + * @summary Logout Endpoint + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LogoutApi + */ + public logout(options?: RawAxiosRequestConfig) { + return LogoutApiFp(this.configuration).logout(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 new file mode 100644 index 00000000..f9213e90 --- /dev/null +++ b/client/src/generated/api/remove-favorite-api.ts @@ -0,0 +1,137 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Country + * Basic Material + * + * The version of the OpenAPI document: 1.0.0 + * Contact: baskirill.an@gmail.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +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'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +// @ts-ignore +import type { ClientError } from '../model'; +// @ts-ignore +import type { InstrumentId } from '../model'; +// @ts-ignore +import type { ServerError } from '../model'; +/** + * RemoveFavoriteApi - axios parameter creator + * @export + */ +export const RemoveFavoriteApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Remove Favorite + * @summary Remove Favorite + * @param {InstrumentId} instrumentId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + removeFavorite: async (instrumentId: InstrumentId, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'instrumentId' is not null or undefined + assertParamExists('removeFavorite', 'instrumentId', instrumentId) + const localVarPath = `/api/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'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(instrumentId, 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 {InstrumentId} instrumentId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async removeFavorite(instrumentId: InstrumentId, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.removeFavorite(instrumentId, 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 {InstrumentId} instrumentId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + removeFavorite(instrumentId: InstrumentId, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.removeFavorite(instrumentId, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * RemoveFavoriteApi - object-oriented interface + * @export + * @class RemoveFavoriteApi + * @extends {BaseAPI} + */ +export class RemoveFavoriteApi extends BaseAPI { + /** + * Remove Favorite + * @summary Remove Favorite + * @param {InstrumentId} instrumentId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RemoveFavoriteApi + */ + public removeFavorite(instrumentId: InstrumentId, options?: RawAxiosRequestConfig) { + return RemoveFavoriteApiFp(this.configuration).removeFavorite(instrumentId, 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 new file mode 100644 index 00000000..5c70f9f5 --- /dev/null +++ b/client/src/generated/api/user-registration-api.ts @@ -0,0 +1,135 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Country + * Basic Material + * + * The version of the OpenAPI document: 1.0.0 + * Contact: baskirill.an@gmail.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +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'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +// @ts-ignore +import type { RegistrationRequest } from '../model'; +// @ts-ignore +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 = `/api/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'; + + 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); + }, + } +}; + +/** + * 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)); + }, + }; +}; + +/** + * UserRegistrationApi - object-oriented interface + * @export + * @class UserRegistrationApi + * @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)); + } +} + diff --git a/client/src/generated/model/index.ts b/client/src/generated/model/index.ts new file mode 100644 index 00000000..414b451a --- /dev/null +++ b/client/src/generated/model/index.ts @@ -0,0 +1,28 @@ +export * from './basic-material'; +export * from './client-error'; +export * from './country'; +export * from './create-instrument-request-body'; +export * from './edit-instrument-request-body'; +export * from './get-countries-response'; +export * from './get-instrument-basic-materials-response'; +export * from './get-instrument-by-criteria-page-response'; +export * from './get-instrument-types-response'; +export * from './get-instruments-by-criteria-request-body'; +export * from './get-instruments-by-criteria-response'; +export * from './get-manufacturers-response'; +export * from './instrument-detail'; +export * from './instrument-detail-without-id'; +export * from './instrument-id'; +export * from './instrument-name'; +export * from './instrument-photo'; +export * from './instrument-type'; +export * from './jwt-response'; +export * from './list-favorite-response'; +export * from './manufacture-date'; +export * from './manufacturer'; +export * from './manufacturer-name'; +export * from './profile-details'; +export * from './registration-request'; +export * from './release-date'; +export * from './server-error'; +export * from './username-and-password-request-body'; diff --git a/client/src/generated/model/list-favorite-response.ts b/client/src/generated/model/list-favorite-response.ts new file mode 100644 index 00000000..6d70a76f --- /dev/null +++ b/client/src/generated/model/list-favorite-response.ts @@ -0,0 +1,33 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Country + * Basic Material + * + * The version of the OpenAPI document: 1.0.0 + * Contact: baskirill.an@gmail.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import type { InstrumentDetail } from './instrument-detail'; + +/** + * + * @export + * @interface ListFavoriteResponse + */ +export interface ListFavoriteResponse { + /** + * + * @type {Array} + * @memberof ListFavoriteResponse + */ + 'content': Array; +} + diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/AddFavoriteApi.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/AddFavoriteApi.kt new file mode 100644 index 00000000..4322f006 --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/AddFavoriteApi.kt @@ -0,0 +1,45 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.8.0). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ +package mu.muse.rest.api + +import mu.muse.rest.dto.ClientError +import mu.muse.rest.dto.InstrumentId +import mu.muse.rest.dto.ServerError +import org.springframework.http.HttpStatus +import org.springframework.http.MediaType +import org.springframework.http.ResponseEntity + +import org.springframework.web.bind.annotation.* +import org.springframework.validation.annotation.Validated +import org.springframework.web.context.request.NativeWebRequest +import org.springframework.beans.factory.annotation.Autowired + +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +import kotlin.collections.List +import kotlin.collections.Map + +@RestController +@Validated +interface AddFavoriteApi { + + + @RequestMapping( + method = [RequestMethod.POST], + value = ["/api/favorite/add"], + produces = ["application/json"], + consumes = ["application/json"] + ) + fun addFavorite( @Valid @RequestBody instrumentId: InstrumentId): ResponseEntity +} diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/ApiUtil.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/ApiUtil.kt new file mode 100644 index 00000000..f288b748 --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/ApiUtil.kt @@ -0,0 +1,19 @@ +package mu.muse.rest.api + +import org.springframework.web.context.request.NativeWebRequest + +import jakarta.servlet.http.HttpServletResponse +import java.io.IOException + +object ApiUtil { + fun setExampleResponse(req: NativeWebRequest, contentType: String, example: String) { + try { + val res = req.getNativeResponse(HttpServletResponse::class.java) + res?.characterEncoding = "UTF-8" + res?.addHeader("Content-Type", contentType) + res?.writer?.print(example) + } catch (e: IOException) { + throw RuntimeException(e) + } + } +} diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/BasicLoginApi.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/BasicLoginApi.kt new file mode 100644 index 00000000..277c8a33 --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/BasicLoginApi.kt @@ -0,0 +1,45 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.8.0). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ +package mu.muse.rest.api + +import mu.muse.rest.dto.JwtResponse +import mu.muse.rest.dto.ServerError +import mu.muse.rest.dto.UsernameAndPasswordRequestBody +import org.springframework.http.HttpStatus +import org.springframework.http.MediaType +import org.springframework.http.ResponseEntity + +import org.springframework.web.bind.annotation.* +import org.springframework.validation.annotation.Validated +import org.springframework.web.context.request.NativeWebRequest +import org.springframework.beans.factory.annotation.Autowired + +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +import kotlin.collections.List +import kotlin.collections.Map + +@RestController +@Validated +interface BasicLoginApi { + + + @RequestMapping( + method = [RequestMethod.POST], + value = ["/api/auth/login"], + produces = ["application/json"], + consumes = ["application/json"] + ) + fun basicLogin( @Valid @RequestBody usernameAndPasswordRequestBody: UsernameAndPasswordRequestBody): ResponseEntity +} diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/CreateInstrumentApi.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/CreateInstrumentApi.kt new file mode 100644 index 00000000..c1b4ec6e --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/CreateInstrumentApi.kt @@ -0,0 +1,45 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.8.0). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ +package mu.muse.rest.api + +import mu.muse.rest.dto.ClientError +import mu.muse.rest.dto.CreateInstrumentRequestBody +import mu.muse.rest.dto.ServerError +import org.springframework.http.HttpStatus +import org.springframework.http.MediaType +import org.springframework.http.ResponseEntity + +import org.springframework.web.bind.annotation.* +import org.springframework.validation.annotation.Validated +import org.springframework.web.context.request.NativeWebRequest +import org.springframework.beans.factory.annotation.Autowired + +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +import kotlin.collections.List +import kotlin.collections.Map + +@RestController +@Validated +interface CreateInstrumentApi { + + + @RequestMapping( + method = [RequestMethod.POST], + value = ["/api/instrument/create"], + produces = ["application/json"], + consumes = ["application/json"] + ) + fun createInstrument( @Valid @RequestBody createInstrumentRequestBody: CreateInstrumentRequestBody): ResponseEntity +} diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/DeleteInstrumentByIdApi.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/DeleteInstrumentByIdApi.kt new file mode 100644 index 00000000..40a18bad --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/DeleteInstrumentByIdApi.kt @@ -0,0 +1,43 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.8.0). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ +package mu.muse.rest.api + +import mu.muse.rest.dto.ClientError +import mu.muse.rest.dto.ServerError +import org.springframework.http.HttpStatus +import org.springframework.http.MediaType +import org.springframework.http.ResponseEntity + +import org.springframework.web.bind.annotation.* +import org.springframework.validation.annotation.Validated +import org.springframework.web.context.request.NativeWebRequest +import org.springframework.beans.factory.annotation.Autowired + +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +import kotlin.collections.List +import kotlin.collections.Map + +@RestController +@Validated +interface DeleteInstrumentByIdApi { + + + @RequestMapping( + method = [RequestMethod.GET], + value = ["/api/instrument/{instrumentId}/delete"], + produces = ["application/json"] + ) + fun deleteInstrumentById( @PathVariable("instrumentId") instrumentId: kotlin.Long): ResponseEntity +} diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/EditInstrumentApi.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/EditInstrumentApi.kt new file mode 100644 index 00000000..4b3c2687 --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/EditInstrumentApi.kt @@ -0,0 +1,45 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.8.0). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ +package mu.muse.rest.api + +import mu.muse.rest.dto.ClientError +import mu.muse.rest.dto.EditInstrumentRequestBody +import mu.muse.rest.dto.ServerError +import org.springframework.http.HttpStatus +import org.springframework.http.MediaType +import org.springframework.http.ResponseEntity + +import org.springframework.web.bind.annotation.* +import org.springframework.validation.annotation.Validated +import org.springframework.web.context.request.NativeWebRequest +import org.springframework.beans.factory.annotation.Autowired + +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +import kotlin.collections.List +import kotlin.collections.Map + +@RestController +@Validated +interface EditInstrumentApi { + + + @RequestMapping( + method = [RequestMethod.POST], + value = ["/api/instrument/edit"], + produces = ["application/json"], + consumes = ["application/json"] + ) + fun editInstrument( @Valid @RequestBody editInstrumentRequestBody: EditInstrumentRequestBody): ResponseEntity +} diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetCountriesApi.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetCountriesApi.kt new file mode 100644 index 00000000..d1ca6fc5 --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetCountriesApi.kt @@ -0,0 +1,44 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.8.0). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ +package mu.muse.rest.api + +import mu.muse.rest.dto.ClientError +import mu.muse.rest.dto.GetCountriesResponse +import mu.muse.rest.dto.ServerError +import org.springframework.http.HttpStatus +import org.springframework.http.MediaType +import org.springframework.http.ResponseEntity + +import org.springframework.web.bind.annotation.* +import org.springframework.validation.annotation.Validated +import org.springframework.web.context.request.NativeWebRequest +import org.springframework.beans.factory.annotation.Autowired + +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +import kotlin.collections.List +import kotlin.collections.Map + +@RestController +@Validated +interface GetCountriesApi { + + + @RequestMapping( + method = [RequestMethod.GET], + value = ["/api/countries"], + produces = ["application/json"] + ) + fun getCountries(): ResponseEntity +} diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetInstrumentBasicMaterialsApi.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetInstrumentBasicMaterialsApi.kt new file mode 100644 index 00000000..26c6970b --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetInstrumentBasicMaterialsApi.kt @@ -0,0 +1,44 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.8.0). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ +package mu.muse.rest.api + +import mu.muse.rest.dto.ClientError +import mu.muse.rest.dto.GetInstrumentBasicMaterialsResponse +import mu.muse.rest.dto.ServerError +import org.springframework.http.HttpStatus +import org.springframework.http.MediaType +import org.springframework.http.ResponseEntity + +import org.springframework.web.bind.annotation.* +import org.springframework.validation.annotation.Validated +import org.springframework.web.context.request.NativeWebRequest +import org.springframework.beans.factory.annotation.Autowired + +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +import kotlin.collections.List +import kotlin.collections.Map + +@RestController +@Validated +interface GetInstrumentBasicMaterialsApi { + + + @RequestMapping( + method = [RequestMethod.GET], + value = ["/api/instrument/materials"], + produces = ["application/json"] + ) + fun getInstrumentBasicMaterials(): ResponseEntity +} diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetInstrumentByIdApi.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetInstrumentByIdApi.kt new file mode 100644 index 00000000..23bc016d --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetInstrumentByIdApi.kt @@ -0,0 +1,44 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.8.0). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ +package mu.muse.rest.api + +import mu.muse.rest.dto.ClientError +import mu.muse.rest.dto.InstrumentDetail +import mu.muse.rest.dto.ServerError +import org.springframework.http.HttpStatus +import org.springframework.http.MediaType +import org.springframework.http.ResponseEntity + +import org.springframework.web.bind.annotation.* +import org.springframework.validation.annotation.Validated +import org.springframework.web.context.request.NativeWebRequest +import org.springframework.beans.factory.annotation.Autowired + +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +import kotlin.collections.List +import kotlin.collections.Map + +@RestController +@Validated +interface GetInstrumentByIdApi { + + + @RequestMapping( + method = [RequestMethod.GET], + value = ["/api/instrument/{instrumentId}"], + produces = ["application/json"] + ) + fun getInstrumentById( @PathVariable("instrumentId") instrumentId: kotlin.Long): ResponseEntity +} diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetInstrumentPhotoApi.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetInstrumentPhotoApi.kt new file mode 100644 index 00000000..7a8d3c61 --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetInstrumentPhotoApi.kt @@ -0,0 +1,44 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.8.0). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ +package mu.muse.rest.api + +import mu.muse.rest.dto.ClientError +import mu.muse.rest.dto.InstrumentPhoto +import mu.muse.rest.dto.ServerError +import org.springframework.http.HttpStatus +import org.springframework.http.MediaType +import org.springframework.http.ResponseEntity + +import org.springframework.web.bind.annotation.* +import org.springframework.validation.annotation.Validated +import org.springframework.web.context.request.NativeWebRequest +import org.springframework.beans.factory.annotation.Autowired + +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +import kotlin.collections.List +import kotlin.collections.Map + +@RestController +@Validated +interface GetInstrumentPhotoApi { + + + @RequestMapping( + method = [RequestMethod.GET], + value = ["/api/instrument/photo/{instrumentId}"], + produces = ["image/*", "application/json"] + ) + fun getInstrumentPhoto( @PathVariable("instrumentId") instrumentId: kotlin.Long): ResponseEntity +} diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetInstrumentTypesApi.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetInstrumentTypesApi.kt new file mode 100644 index 00000000..a0ce59b8 --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetInstrumentTypesApi.kt @@ -0,0 +1,44 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.8.0). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ +package mu.muse.rest.api + +import mu.muse.rest.dto.ClientError +import mu.muse.rest.dto.GetInstrumentTypesResponse +import mu.muse.rest.dto.ServerError +import org.springframework.http.HttpStatus +import org.springframework.http.MediaType +import org.springframework.http.ResponseEntity + +import org.springframework.web.bind.annotation.* +import org.springframework.validation.annotation.Validated +import org.springframework.web.context.request.NativeWebRequest +import org.springframework.beans.factory.annotation.Autowired + +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +import kotlin.collections.List +import kotlin.collections.Map + +@RestController +@Validated +interface GetInstrumentTypesApi { + + + @RequestMapping( + method = [RequestMethod.GET], + value = ["/api/instrument/types"], + produces = ["application/json"] + ) + fun getInstrumentTypes(): ResponseEntity +} diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetInstrumentsByCriteriaApi.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetInstrumentsByCriteriaApi.kt new file mode 100644 index 00000000..f18fe70e --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetInstrumentsByCriteriaApi.kt @@ -0,0 +1,46 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.8.0). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ +package mu.muse.rest.api + +import mu.muse.rest.dto.ClientError +import mu.muse.rest.dto.GetInstrumentsByCriteriaRequestBody +import mu.muse.rest.dto.GetInstrumentsByCriteriaResponse +import mu.muse.rest.dto.ServerError +import org.springframework.http.HttpStatus +import org.springframework.http.MediaType +import org.springframework.http.ResponseEntity + +import org.springframework.web.bind.annotation.* +import org.springframework.validation.annotation.Validated +import org.springframework.web.context.request.NativeWebRequest +import org.springframework.beans.factory.annotation.Autowired + +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +import kotlin.collections.List +import kotlin.collections.Map + +@RestController +@Validated +interface GetInstrumentsByCriteriaApi { + + + @RequestMapping( + method = [RequestMethod.POST], + value = ["/api/instruments"], + produces = ["application/json"], + consumes = ["application/json"] + ) + fun getInstrumentsByCriteria( @Valid @RequestBody getInstrumentsByCriteriaRequestBody: GetInstrumentsByCriteriaRequestBody): ResponseEntity +} diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetInstrumentsByCriteriaPaginatedApi.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetInstrumentsByCriteriaPaginatedApi.kt new file mode 100644 index 00000000..9b1130c5 --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetInstrumentsByCriteriaPaginatedApi.kt @@ -0,0 +1,46 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.8.0). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ +package mu.muse.rest.api + +import mu.muse.rest.dto.ClientError +import mu.muse.rest.dto.GetInstrumentByCriteriaPageResponse +import mu.muse.rest.dto.GetInstrumentsByCriteriaRequestBody +import mu.muse.rest.dto.ServerError +import org.springframework.http.HttpStatus +import org.springframework.http.MediaType +import org.springframework.http.ResponseEntity + +import org.springframework.web.bind.annotation.* +import org.springframework.validation.annotation.Validated +import org.springframework.web.context.request.NativeWebRequest +import org.springframework.beans.factory.annotation.Autowired + +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +import kotlin.collections.List +import kotlin.collections.Map + +@RestController +@Validated +interface GetInstrumentsByCriteriaPaginatedApi { + + + @RequestMapping( + method = [RequestMethod.POST], + value = ["/api/instruments/paginated"], + produces = ["application/json"], + consumes = ["application/json"] + ) + fun getInstrumentsByCriteriaPaginated(@NotNull @Valid @RequestParam(value = "page_size", required = true) pageSize: kotlin.Int,@NotNull @Valid @RequestParam(value = "page_number", required = true) pageNumber: kotlin.Int, @Valid @RequestBody getInstrumentsByCriteriaRequestBody: GetInstrumentsByCriteriaRequestBody): ResponseEntity +} diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetManufacturersApi.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetManufacturersApi.kt new file mode 100644 index 00000000..871fce63 --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetManufacturersApi.kt @@ -0,0 +1,44 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.8.0). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ +package mu.muse.rest.api + +import mu.muse.rest.dto.ClientError +import mu.muse.rest.dto.GetManufacturersResponse +import mu.muse.rest.dto.ServerError +import org.springframework.http.HttpStatus +import org.springframework.http.MediaType +import org.springframework.http.ResponseEntity + +import org.springframework.web.bind.annotation.* +import org.springframework.validation.annotation.Validated +import org.springframework.web.context.request.NativeWebRequest +import org.springframework.beans.factory.annotation.Autowired + +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +import kotlin.collections.List +import kotlin.collections.Map + +@RestController +@Validated +interface GetManufacturersApi { + + + @RequestMapping( + method = [RequestMethod.GET], + value = ["/api/manufacturer"], + produces = ["application/json"] + ) + fun getManufacturers(): ResponseEntity +} diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetUserProfileApi.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetUserProfileApi.kt new file mode 100644 index 00000000..b676cb06 --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetUserProfileApi.kt @@ -0,0 +1,43 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.8.0). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ +package mu.muse.rest.api + +import mu.muse.rest.dto.ProfileDetails +import mu.muse.rest.dto.ServerError +import org.springframework.http.HttpStatus +import org.springframework.http.MediaType +import org.springframework.http.ResponseEntity + +import org.springframework.web.bind.annotation.* +import org.springframework.validation.annotation.Validated +import org.springframework.web.context.request.NativeWebRequest +import org.springframework.beans.factory.annotation.Autowired + +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +import kotlin.collections.List +import kotlin.collections.Map + +@RestController +@Validated +interface GetUserProfileApi { + + + @RequestMapping( + method = [RequestMethod.GET], + value = ["/api/profile"], + produces = ["application/json"] + ) + fun getProfile(): ResponseEntity +} diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/ListFavoriteApi.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/ListFavoriteApi.kt new file mode 100644 index 00000000..de90f7e7 --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/ListFavoriteApi.kt @@ -0,0 +1,44 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.8.0). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ +package mu.muse.rest.api + +import mu.muse.rest.dto.ClientError +import mu.muse.rest.dto.ListFavoriteResponse +import mu.muse.rest.dto.ServerError +import org.springframework.http.HttpStatus +import org.springframework.http.MediaType +import org.springframework.http.ResponseEntity + +import org.springframework.web.bind.annotation.* +import org.springframework.validation.annotation.Validated +import org.springframework.web.context.request.NativeWebRequest +import org.springframework.beans.factory.annotation.Autowired + +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +import kotlin.collections.List +import kotlin.collections.Map + +@RestController +@Validated +interface ListFavoriteApi { + + + @RequestMapping( + method = [RequestMethod.GET], + value = ["/api/favorite/list"], + produces = ["application/json"] + ) + fun listFavorite(): ResponseEntity +} diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/LogoutApi.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/LogoutApi.kt new file mode 100644 index 00000000..4a9ce587 --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/LogoutApi.kt @@ -0,0 +1,42 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.8.0). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ +package mu.muse.rest.api + +import mu.muse.rest.dto.ServerError +import org.springframework.http.HttpStatus +import org.springframework.http.MediaType +import org.springframework.http.ResponseEntity + +import org.springframework.web.bind.annotation.* +import org.springframework.validation.annotation.Validated +import org.springframework.web.context.request.NativeWebRequest +import org.springframework.beans.factory.annotation.Autowired + +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +import kotlin.collections.List +import kotlin.collections.Map + +@RestController +@Validated +interface LogoutApi { + + + @RequestMapping( + method = [RequestMethod.POST], + value = ["/api/auth/logout"], + produces = ["application/json"] + ) + fun logout(): ResponseEntity +} diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/RemoveFavoriteApi.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/RemoveFavoriteApi.kt new file mode 100644 index 00000000..5163e2f7 --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/RemoveFavoriteApi.kt @@ -0,0 +1,45 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.8.0). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ +package mu.muse.rest.api + +import mu.muse.rest.dto.ClientError +import mu.muse.rest.dto.InstrumentId +import mu.muse.rest.dto.ServerError +import org.springframework.http.HttpStatus +import org.springframework.http.MediaType +import org.springframework.http.ResponseEntity + +import org.springframework.web.bind.annotation.* +import org.springframework.validation.annotation.Validated +import org.springframework.web.context.request.NativeWebRequest +import org.springframework.beans.factory.annotation.Autowired + +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +import kotlin.collections.List +import kotlin.collections.Map + +@RestController +@Validated +interface RemoveFavoriteApi { + + + @RequestMapping( + method = [RequestMethod.POST], + value = ["/api/favorite/remove"], + produces = ["application/json"], + consumes = ["application/json"] + ) + fun removeFavorite( @Valid @RequestBody instrumentId: InstrumentId): ResponseEntity +} diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/UserRegistrationApi.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/UserRegistrationApi.kt new file mode 100644 index 00000000..a7e9d16a --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/UserRegistrationApi.kt @@ -0,0 +1,44 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.8.0). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ +package mu.muse.rest.api + +import mu.muse.rest.dto.RegistrationRequest +import mu.muse.rest.dto.ServerError +import org.springframework.http.HttpStatus +import org.springframework.http.MediaType +import org.springframework.http.ResponseEntity + +import org.springframework.web.bind.annotation.* +import org.springframework.validation.annotation.Validated +import org.springframework.web.context.request.NativeWebRequest +import org.springframework.beans.factory.annotation.Autowired + +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +import kotlin.collections.List +import kotlin.collections.Map + +@RestController +@Validated +interface UserRegistrationApi { + + + @RequestMapping( + method = [RequestMethod.POST], + value = ["/api/registration"], + produces = ["application/json"], + consumes = ["application/json"] + ) + fun userRegistration( @Valid @RequestBody registrationRequest: RegistrationRequest): ResponseEntity +} diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/BasicMaterial.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/BasicMaterial.kt new file mode 100644 index 00000000..b27bed2e --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/BasicMaterial.kt @@ -0,0 +1,25 @@ +package mu.muse.rest.dto + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonProperty +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +/** + * + * @param basicMaterial + */ +data class BasicMaterial( + + @get:JsonProperty("basic_material", required = true) val basicMaterial: kotlin.String + ) { + +} + diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/ClientError.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/ClientError.kt new file mode 100644 index 00000000..bc2f0e86 --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/ClientError.kt @@ -0,0 +1,28 @@ +package mu.muse.rest.dto + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonProperty +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +/** + * + * @param message Error description + * @param cause Exception stack trace + */ +data class ClientError( + + @get:JsonProperty("message", required = true) val message: kotlin.String, + + @get:JsonProperty("cause") val cause: kotlin.String? = null + ) { + +} + diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/Country.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/Country.kt new file mode 100644 index 00000000..5ba386c6 --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/Country.kt @@ -0,0 +1,25 @@ +package mu.muse.rest.dto + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonProperty +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +/** + * + * @param country + */ +data class Country( + + @get:JsonProperty("country", required = true) val country: kotlin.String + ) { + +} + diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/CreateInstrumentRequestBody.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/CreateInstrumentRequestBody.kt new file mode 100644 index 00000000..2ac68b03 --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/CreateInstrumentRequestBody.kt @@ -0,0 +1,32 @@ +package mu.muse.rest.dto + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonProperty +import mu.muse.rest.dto.InstrumentDetailWithoutId +import mu.muse.rest.dto.InstrumentPhoto +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +/** + * + * @param instrumentDetail + * @param instrumentPhoto + */ +data class CreateInstrumentRequestBody( + + @field:Valid + @get:JsonProperty("instrument_detail", required = true) val instrumentDetail: InstrumentDetailWithoutId, + + @field:Valid + @get:JsonProperty("instrument_photo", required = true) val instrumentPhoto: InstrumentPhoto + ) { + +} + diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/EditInstrumentRequestBody.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/EditInstrumentRequestBody.kt new file mode 100644 index 00000000..c767b3d7 --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/EditInstrumentRequestBody.kt @@ -0,0 +1,32 @@ +package mu.muse.rest.dto + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonProperty +import mu.muse.rest.dto.InstrumentDetail +import mu.muse.rest.dto.InstrumentPhoto +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +/** + * + * @param instrumentDetail + * @param instrumentPhoto + */ +data class EditInstrumentRequestBody( + + @field:Valid + @get:JsonProperty("instrument_detail", required = true) val instrumentDetail: InstrumentDetail, + + @field:Valid + @get:JsonProperty("instrument_photo", required = true) val instrumentPhoto: InstrumentPhoto + ) { + +} + diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/GetCountriesResponse.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/GetCountriesResponse.kt new file mode 100644 index 00000000..a93f13ae --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/GetCountriesResponse.kt @@ -0,0 +1,27 @@ +package mu.muse.rest.dto + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonProperty +import mu.muse.rest.dto.Country +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +/** + * + * @param content + */ +data class GetCountriesResponse( + + @field:Valid + @get:JsonProperty("content", required = true) val content: kotlin.collections.List + ) { + +} + diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/GetInstrumentBasicMaterialsResponse.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/GetInstrumentBasicMaterialsResponse.kt new file mode 100644 index 00000000..a4614262 --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/GetInstrumentBasicMaterialsResponse.kt @@ -0,0 +1,27 @@ +package mu.muse.rest.dto + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonProperty +import mu.muse.rest.dto.BasicMaterial +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +/** + * + * @param content + */ +data class GetInstrumentBasicMaterialsResponse( + + @field:Valid + @get:JsonProperty("content", required = true) val content: kotlin.collections.List + ) { + +} + diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/GetInstrumentByCriteriaPageResponse.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/GetInstrumentByCriteriaPageResponse.kt new file mode 100644 index 00000000..06b24f4d --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/GetInstrumentByCriteriaPageResponse.kt @@ -0,0 +1,42 @@ +package mu.muse.rest.dto + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonProperty +import mu.muse.rest.dto.InstrumentDetail +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +/** + * + * @param content + * @param contentSize The number of items in the content. + * @param pageSize The number of items per page. + * @param pageNumber The current page number (0-based index). + * @param totalElements The total number of elements across all pages. + * @param totalPages The total number of pages. + */ +data class GetInstrumentByCriteriaPageResponse( + + @field:Valid + @get:JsonProperty("content", required = true) val content: kotlin.collections.List, + + @get:JsonProperty("content_size", required = true) val contentSize: kotlin.Long, + + @get:JsonProperty("page_size", required = true) val pageSize: kotlin.Long, + + @get:JsonProperty("page_number", required = true) val pageNumber: kotlin.Long, + + @get:JsonProperty("total_elements", required = true) val totalElements: kotlin.Long, + + @get:JsonProperty("total_pages", required = true) val totalPages: kotlin.Long + ) { + +} + diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/GetInstrumentTypesResponse.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/GetInstrumentTypesResponse.kt new file mode 100644 index 00000000..2cb9b5d2 --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/GetInstrumentTypesResponse.kt @@ -0,0 +1,27 @@ +package mu.muse.rest.dto + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonProperty +import mu.muse.rest.dto.InstrumentType +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +/** + * + * @param content + */ +data class GetInstrumentTypesResponse( + + @field:Valid + @get:JsonProperty("content", required = true) val content: kotlin.collections.List + ) { + +} + diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/GetInstrumentsByCriteriaRequestBody.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/GetInstrumentsByCriteriaRequestBody.kt new file mode 100644 index 00000000..3e08c9b7 --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/GetInstrumentsByCriteriaRequestBody.kt @@ -0,0 +1,70 @@ +package mu.muse.rest.dto + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonProperty +import mu.muse.rest.dto.BasicMaterial +import mu.muse.rest.dto.Country +import mu.muse.rest.dto.InstrumentId +import mu.muse.rest.dto.InstrumentName +import mu.muse.rest.dto.InstrumentType +import mu.muse.rest.dto.ManufactureDate +import mu.muse.rest.dto.ManufacturerName +import mu.muse.rest.dto.ReleaseDate +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +/** + * + * @param instrumentName + * @param instrumentTypes + * @param manufacturerNames + * @param manufactureDateFrom + * @param manufactureDateTo + * @param releaseDateFrom + * @param releaseDateTo + * @param countries + * @param materials + * @param instrumentIds + */ +data class GetInstrumentsByCriteriaRequestBody( + + @field:Valid + @get:JsonProperty("instrument_name") val instrumentName: InstrumentName? = null, + + @field:Valid + @get:JsonProperty("instrument_types") val instrumentTypes: kotlin.collections.List? = null, + + @field:Valid + @get:JsonProperty("manufacturer_names") val manufacturerNames: kotlin.collections.List? = null, + + @field:Valid + @get:JsonProperty("manufacture_date_from") val manufactureDateFrom: ManufactureDate? = null, + + @field:Valid + @get:JsonProperty("manufacture_date_to") val manufactureDateTo: ManufactureDate? = null, + + @field:Valid + @get:JsonProperty("release_date_from") val releaseDateFrom: ReleaseDate? = null, + + @field:Valid + @get:JsonProperty("release_date_to") val releaseDateTo: ReleaseDate? = null, + + @field:Valid + @get:JsonProperty("countries") val countries: kotlin.collections.List? = null, + + @field:Valid + @get:JsonProperty("materials") val materials: kotlin.collections.List? = null, + + @field:Valid + @get:JsonProperty("instrument_ids") val instrumentIds: kotlin.collections.List? = null + ) { + +} + diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/GetInstrumentsByCriteriaResponse.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/GetInstrumentsByCriteriaResponse.kt new file mode 100644 index 00000000..213fac08 --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/GetInstrumentsByCriteriaResponse.kt @@ -0,0 +1,27 @@ +package mu.muse.rest.dto + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonProperty +import mu.muse.rest.dto.InstrumentDetail +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +/** + * + * @param content + */ +data class GetInstrumentsByCriteriaResponse( + + @field:Valid + @get:JsonProperty("content", required = true) val content: kotlin.collections.List + ) { + +} + diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/GetManufacturersResponse.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/GetManufacturersResponse.kt new file mode 100644 index 00000000..46ebcaea --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/GetManufacturersResponse.kt @@ -0,0 +1,27 @@ +package mu.muse.rest.dto + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonProperty +import mu.muse.rest.dto.Manufacturer +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +/** + * + * @param content + */ +data class GetManufacturersResponse( + + @field:Valid + @get:JsonProperty("content", required = true) val content: kotlin.collections.List + ) { + +} + diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/InstrumentDetail.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/InstrumentDetail.kt new file mode 100644 index 00000000..287bc6ea --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/InstrumentDetail.kt @@ -0,0 +1,62 @@ +package mu.muse.rest.dto + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonProperty +import mu.muse.rest.dto.BasicMaterial +import mu.muse.rest.dto.Country +import mu.muse.rest.dto.InstrumentId +import mu.muse.rest.dto.InstrumentName +import mu.muse.rest.dto.InstrumentType +import mu.muse.rest.dto.ManufactureDate +import mu.muse.rest.dto.ManufacturerName +import mu.muse.rest.dto.ReleaseDate +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +/** + * + * @param instrumentId + * @param instrumentName + * @param instrumentType + * @param manufacturerName + * @param manufacturerDate + * @param releaseDate + * @param country + * @param basicMaterials + */ +data class InstrumentDetail( + + @field:Valid + @get:JsonProperty("instrument_id", required = true) val instrumentId: InstrumentId, + + @field:Valid + @get:JsonProperty("instrument_name", required = true) val instrumentName: InstrumentName, + + @field:Valid + @get:JsonProperty("instrument_type", required = true) val instrumentType: InstrumentType, + + @field:Valid + @get:JsonProperty("manufacturer_name", required = true) val manufacturerName: ManufacturerName, + + @field:Valid + @get:JsonProperty("manufacturer_date", required = true) val manufacturerDate: ManufactureDate, + + @field:Valid + @get:JsonProperty("release_date", required = true) val releaseDate: ReleaseDate, + + @field:Valid + @get:JsonProperty("country", required = true) val country: Country, + + @field:Valid + @get:JsonProperty("basic_materials", required = true) val basicMaterials: kotlin.collections.List + ) { + +} + diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/InstrumentDetailWithoutId.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/InstrumentDetailWithoutId.kt new file mode 100644 index 00000000..c097bd06 --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/InstrumentDetailWithoutId.kt @@ -0,0 +1,57 @@ +package mu.muse.rest.dto + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonProperty +import mu.muse.rest.dto.BasicMaterial +import mu.muse.rest.dto.Country +import mu.muse.rest.dto.InstrumentName +import mu.muse.rest.dto.InstrumentType +import mu.muse.rest.dto.ManufactureDate +import mu.muse.rest.dto.ManufacturerName +import mu.muse.rest.dto.ReleaseDate +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +/** + * + * @param instrumentName + * @param instrumentType + * @param manufacturerName + * @param manufacturerDate + * @param releaseDate + * @param country + * @param basicMaterials + */ +data class InstrumentDetailWithoutId( + + @field:Valid + @get:JsonProperty("instrument_name", required = true) val instrumentName: InstrumentName, + + @field:Valid + @get:JsonProperty("instrument_type", required = true) val instrumentType: InstrumentType, + + @field:Valid + @get:JsonProperty("manufacturer_name", required = true) val manufacturerName: ManufacturerName, + + @field:Valid + @get:JsonProperty("manufacturer_date", required = true) val manufacturerDate: ManufactureDate, + + @field:Valid + @get:JsonProperty("release_date", required = true) val releaseDate: ReleaseDate, + + @field:Valid + @get:JsonProperty("country", required = true) val country: Country, + + @field:Valid + @get:JsonProperty("basic_materials", required = true) val basicMaterials: kotlin.collections.List + ) { + +} + diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/InstrumentId.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/InstrumentId.kt new file mode 100644 index 00000000..2f3b6933 --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/InstrumentId.kt @@ -0,0 +1,25 @@ +package mu.muse.rest.dto + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonProperty +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +/** + * + * @param instrumentId + */ +data class InstrumentId( + + @get:JsonProperty("instrument_id", required = true) val instrumentId: kotlin.Long + ) { + +} + diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/InstrumentName.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/InstrumentName.kt new file mode 100644 index 00000000..a5ed63e3 --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/InstrumentName.kt @@ -0,0 +1,25 @@ +package mu.muse.rest.dto + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonProperty +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +/** + * + * @param instrumentName + */ +data class InstrumentName( + + @get:JsonProperty("instrument_name", required = true) val instrumentName: kotlin.String + ) { + +} + diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/InstrumentPhoto.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/InstrumentPhoto.kt new file mode 100644 index 00000000..2e20c9af --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/InstrumentPhoto.kt @@ -0,0 +1,25 @@ +package mu.muse.rest.dto + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonProperty +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +/** + * + * @param photo + */ +data class InstrumentPhoto( + + @get:JsonProperty("photo", required = true) val photo: kotlin.String + ) { + +} + diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/InstrumentType.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/InstrumentType.kt new file mode 100644 index 00000000..5453bca6 --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/InstrumentType.kt @@ -0,0 +1,25 @@ +package mu.muse.rest.dto + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonProperty +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +/** + * + * @param instrumentType + */ +data class InstrumentType( + + @get:JsonProperty("instrument_type", required = true) val instrumentType: kotlin.String + ) { + +} + diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/JwtResponse.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/JwtResponse.kt new file mode 100644 index 00000000..dc6fd35d --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/JwtResponse.kt @@ -0,0 +1,25 @@ +package mu.muse.rest.dto + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonProperty +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +/** + * + * @param jwt + */ +data class JwtResponse( + + @get:JsonProperty("jwt", required = true) val jwt: kotlin.String + ) { + +} + diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/ListFavoriteResponse.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/ListFavoriteResponse.kt new file mode 100644 index 00000000..be1c35cd --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/ListFavoriteResponse.kt @@ -0,0 +1,27 @@ +package mu.muse.rest.dto + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonProperty +import mu.muse.rest.dto.InstrumentDetail +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +/** + * + * @param content + */ +data class ListFavoriteResponse( + + @field:Valid + @get:JsonProperty("content", required = true) val content: kotlin.collections.List + ) { + +} + diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/ManufactureDate.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/ManufactureDate.kt new file mode 100644 index 00000000..70a22bcb --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/ManufactureDate.kt @@ -0,0 +1,26 @@ +package mu.muse.rest.dto + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonProperty +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +/** + * + * @param manufactureDate + */ +data class ManufactureDate( + + @field:Valid + @get:JsonProperty("manufacture_date", required = true) val manufactureDate: java.time.LocalDate + ) { + +} + diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/Manufacturer.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/Manufacturer.kt new file mode 100644 index 00000000..49efd8f0 --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/Manufacturer.kt @@ -0,0 +1,25 @@ +package mu.muse.rest.dto + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonProperty +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +/** + * + * @param manufacturer + */ +data class Manufacturer( + + @get:JsonProperty("manufacturer", required = true) val manufacturer: kotlin.String + ) { + +} + diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/ManufacturerName.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/ManufacturerName.kt new file mode 100644 index 00000000..36ed5dfc --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/ManufacturerName.kt @@ -0,0 +1,25 @@ +package mu.muse.rest.dto + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonProperty +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +/** + * + * @param manufacturerName + */ +data class ManufacturerName( + + @get:JsonProperty("manufacturer_name", required = true) val manufacturerName: kotlin.String + ) { + +} + diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/ProfileDetails.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/ProfileDetails.kt new file mode 100644 index 00000000..84864b75 --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/ProfileDetails.kt @@ -0,0 +1,31 @@ +package mu.muse.rest.dto + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonProperty +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +/** + * + * @param username + * @param role + * @param fullName + */ +data class ProfileDetails( + + @get:JsonProperty("username", required = true) val username: kotlin.String, + + @get:JsonProperty("role", required = true) val role: kotlin.String, + + @get:JsonProperty("full_name", required = true) val fullName: kotlin.String + ) { + +} + diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/RegistrationRequest.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/RegistrationRequest.kt new file mode 100644 index 00000000..1c1e084d --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/RegistrationRequest.kt @@ -0,0 +1,31 @@ +package mu.muse.rest.dto + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonProperty +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +/** + * + * @param fullName + * @param login + * @param password + */ +data class RegistrationRequest( + + @get:JsonProperty("full_name", required = true) val fullName: kotlin.String, + + @get:JsonProperty("login", required = true) val login: kotlin.String, + + @get:JsonProperty("password", required = true) val password: kotlin.String + ) { + +} + diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/ReleaseDate.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/ReleaseDate.kt new file mode 100644 index 00000000..2b114c68 --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/ReleaseDate.kt @@ -0,0 +1,26 @@ +package mu.muse.rest.dto + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonProperty +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +/** + * + * @param releaseDate + */ +data class ReleaseDate( + + @field:Valid + @get:JsonProperty("release_date", required = true) val releaseDate: java.time.LocalDate + ) { + +} + diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/ServerError.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/ServerError.kt new file mode 100644 index 00000000..298c619e --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/ServerError.kt @@ -0,0 +1,28 @@ +package mu.muse.rest.dto + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonProperty +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +/** + * + * @param message A description of the error + * @param cause Exception stack trace + */ +data class ServerError( + + @get:JsonProperty("message") val message: kotlin.String? = null, + + @get:JsonProperty("cause") val cause: kotlin.String? = null + ) { + +} + diff --git a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/UsernameAndPasswordRequestBody.kt b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/UsernameAndPasswordRequestBody.kt new file mode 100644 index 00000000..2374de55 --- /dev/null +++ b/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/UsernameAndPasswordRequestBody.kt @@ -0,0 +1,28 @@ +package mu.muse.rest.dto + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonProperty +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +/** + * + * @param username + * @param password + */ +data class UsernameAndPasswordRequestBody( + + @get:JsonProperty("username", required = true) val username: kotlin.String, + + @get:JsonProperty("password", required = true) val password: kotlin.String + ) { + +} +