From 359f4ed69a7155e1572666d9cd977a91ebadc818 Mon Sep 17 00:00:00 2001 From: skywalker Date: Wed, 28 Aug 2024 17:04:04 +0300 Subject: [PATCH 1/7] chore(script): add env verification --- 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/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 ---- tools/scripts/clean.sh | 2 + tools/scripts/deploy.sh | 16 +- tools/scripts/run.sh | 3 + tools/scripts/stop.sh | 2 + 19 files changed, 16 insertions(+), 1076 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/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/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/tools/scripts/clean.sh b/tools/scripts/clean.sh index 010ae1ec..4370e599 100755 --- a/tools/scripts/clean.sh +++ b/tools/scripts/clean.sh @@ -3,6 +3,8 @@ set -e currentDir=$(cd -P -- "$(dirname -- "$0")" && pwd -P) rootDir="$currentDir/../../" +[[ -z "${MUSE_DOCKER_DEFAULT_CONTEXT}" ]] && { echo "'MUSE_DOCKER_DEFAULT_CONTEXT' is not set. Exiting."; exit 1; } + function finish { docker context use "${MUSE_DOCKER_DEFAULT_CONTEXT}" } diff --git a/tools/scripts/deploy.sh b/tools/scripts/deploy.sh index e3fdc1d8..1bbb635e 100755 --- a/tools/scripts/deploy.sh +++ b/tools/scripts/deploy.sh @@ -3,6 +3,9 @@ set -e currentDir=$(cd -P -- "$(dirname -- "$0")" && pwd -P) rootDir="$currentDir/../../" +[[ -z "${MUSE_DOCKER_DEFAULT_CONTEXT}" ]] && { echo "'MUSE_DOCKER_DEFAULT_CONTEXT' is not set. Exiting."; exit 1; } +[[ -z "${MUSE_JWT_SECRET_KEY}" ]] && { echo "'MUSE_JWT_SECRET_KEY' is not set. Exiting."; exit 1; } + function finish { docker context use "${MUSE_DOCKER_DEFAULT_CONTEXT}" @@ -18,6 +21,11 @@ DIFFS_COUNT=$(git diff --name-only | wc -l) # stash any unstaged changes if it's exists if [ "$DIFFS_COUNT" -ne 0 ]; then + echo "\033[0;31mGit diff not empty. Commit it before deploying. Exiting.\033[0m"; + exit 1; +fi + +if [ "$DIFFS_COUNT" -eq 0 ]; then git stash -q --keep-index fi @@ -41,7 +49,7 @@ fi (cd "$rootDir" && exec ./tools/scripts/buildAndPush.sh "$stage" "$dockerRepository") -docker context use desktop-linux +docker context use "${MUSE_DOCKER_DEFAULT_CONTEXT}" if [ "$stage" != "local" ]; then context_name=muse-$stage @@ -50,12 +58,6 @@ if [ "$stage" != "local" ]; then fi docker context use "$context_name" - - function finish { - docker context use desktop-linux - } - - trap "finish" EXIT fi (cd "$rootDir" && exec ./tools/scripts/stop.sh "$stage" "$dockerRepository") diff --git a/tools/scripts/run.sh b/tools/scripts/run.sh index 4de9da0e..10fdb4b6 100755 --- a/tools/scripts/run.sh +++ b/tools/scripts/run.sh @@ -3,6 +3,9 @@ set -e currentDir=$(cd -P -- "$(dirname -- "$0")" && pwd -P) rootDir="$currentDir/../../" +[[ -z "${MUSE_DOCKER_DEFAULT_CONTEXT}" ]] && { echo "'MUSE_DOCKER_DEFAULT_CONTEXT' is not set. Exiting."; exit 1; } +[[ -z "${MUSE_JWT_SECRET_KEY}" ]] && { echo "'MUSE_JWT_SECRET_KEY' is not set. Exiting."; exit 1; } + function finish { docker context use "${MUSE_DOCKER_DEFAULT_CONTEXT}" } diff --git a/tools/scripts/stop.sh b/tools/scripts/stop.sh index 51a8facb..77711dc2 100755 --- a/tools/scripts/stop.sh +++ b/tools/scripts/stop.sh @@ -3,6 +3,8 @@ set -e currentDir=$(cd -P -- "$(dirname -- "$0")" && pwd -P) rootDir="$currentDir/../../" +[[ -z "${MUSE_DOCKER_DEFAULT_CONTEXT}" ]] && { echo "'MUSE_DOCKER_DEFAULT_CONTEXT' is not set. Exiting."; exit 1; } + function finish { docker context use "${MUSE_DOCKER_DEFAULT_CONTEXT}" } From 70bffd67485b74bdbee3e391066e7cd0f25ec35f Mon Sep 17 00:00:00 2001 From: skywalker Date: Wed, 28 Aug 2024 17:05:56 +0300 Subject: [PATCH 2/7] chore(script): one line gracefull shutdown --- 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 ++++ tools/scripts/clean.sh | 6 +- tools/scripts/deploy.sh | 18 +--- tools/scripts/run.sh | 6 +- tools/scripts/stop.sh | 6 +- 12 files changed, 466 insertions(+), 31 deletions(-) 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"; diff --git a/tools/scripts/clean.sh b/tools/scripts/clean.sh index 4370e599..6783ab41 100755 --- a/tools/scripts/clean.sh +++ b/tools/scripts/clean.sh @@ -5,11 +5,7 @@ rootDir="$currentDir/../../" [[ -z "${MUSE_DOCKER_DEFAULT_CONTEXT}" ]] && { echo "'MUSE_DOCKER_DEFAULT_CONTEXT' is not set. Exiting."; exit 1; } -function finish { - docker context use "${MUSE_DOCKER_DEFAULT_CONTEXT}" -} - -trap 'finish' EXIT +trap 'docker context use "${MUSE_DOCKER_DEFAULT_CONTEXT}"' EXIT stage=$1 diff --git a/tools/scripts/deploy.sh b/tools/scripts/deploy.sh index 1bbb635e..acd60b74 100755 --- a/tools/scripts/deploy.sh +++ b/tools/scripts/deploy.sh @@ -6,29 +6,15 @@ rootDir="$currentDir/../../" [[ -z "${MUSE_DOCKER_DEFAULT_CONTEXT}" ]] && { echo "'MUSE_DOCKER_DEFAULT_CONTEXT' is not set. Exiting."; exit 1; } [[ -z "${MUSE_JWT_SECRET_KEY}" ]] && { echo "'MUSE_JWT_SECRET_KEY' is not set. Exiting."; exit 1; } -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 +trap 'docker context use "${MUSE_DOCKER_DEFAULT_CONTEXT}"' EXIT DIFFS_COUNT=$(git diff --name-only | wc -l) -# stash any unstaged changes if it's exists if [ "$DIFFS_COUNT" -ne 0 ]; then - echo "\033[0;31mGit diff not empty. Commit it before deploying. Exiting.\033[0m"; + echo -e "\033[0;31mGit diff not empty. Commit it before deploying. Exiting.\033[0m"; exit 1; fi -if [ "$DIFFS_COUNT" -eq 0 ]; then - git stash -q --keep-index -fi - stage=$1 if [ -z "$1" ]; then diff --git a/tools/scripts/run.sh b/tools/scripts/run.sh index 10fdb4b6..449b7158 100755 --- a/tools/scripts/run.sh +++ b/tools/scripts/run.sh @@ -6,11 +6,7 @@ rootDir="$currentDir/../../" [[ -z "${MUSE_DOCKER_DEFAULT_CONTEXT}" ]] && { echo "'MUSE_DOCKER_DEFAULT_CONTEXT' is not set. Exiting."; exit 1; } [[ -z "${MUSE_JWT_SECRET_KEY}" ]] && { echo "'MUSE_JWT_SECRET_KEY' is not set. Exiting."; exit 1; } -function finish { - docker context use "${MUSE_DOCKER_DEFAULT_CONTEXT}" -} - -trap 'finish' EXIT +trap 'docker context use "${MUSE_DOCKER_DEFAULT_CONTEXT}"' EXIT stage=$1 diff --git a/tools/scripts/stop.sh b/tools/scripts/stop.sh index 77711dc2..fabad891 100755 --- a/tools/scripts/stop.sh +++ b/tools/scripts/stop.sh @@ -5,11 +5,7 @@ rootDir="$currentDir/../../" [[ -z "${MUSE_DOCKER_DEFAULT_CONTEXT}" ]] && { echo "'MUSE_DOCKER_DEFAULT_CONTEXT' is not set. Exiting."; exit 1; } -function finish { - docker context use "${MUSE_DOCKER_DEFAULT_CONTEXT}" -} - -trap 'finish' EXIT +trap 'docker context use "${MUSE_DOCKER_DEFAULT_CONTEXT}"' EXIT stage=$1 From f8a463cc09498fc60b6102f351a97c4eff906349 Mon Sep 17 00:00:00 2001 From: skywalker Date: Wed, 28 Aug 2024 17:11:08 +0300 Subject: [PATCH 3/7] refactor(deploy): remove redundant variables --- .../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 -------- tools/scripts/buildAndPush.sh | 11 +-- tools/scripts/deploy.sh | 17 +---- 49 files changed, 4 insertions(+), 1720 deletions(-) delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/AddFavoriteApi.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/ApiUtil.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/BasicLoginApi.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/CreateInstrumentApi.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/DeleteInstrumentByIdApi.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/EditInstrumentApi.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetCountriesApi.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetInstrumentBasicMaterialsApi.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetInstrumentByIdApi.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetInstrumentPhotoApi.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetInstrumentTypesApi.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetInstrumentsByCriteriaApi.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetInstrumentsByCriteriaPaginatedApi.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetManufacturersApi.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetUserProfileApi.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/ListFavoriteApi.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/LogoutApi.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/RemoveFavoriteApi.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/UserRegistrationApi.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/BasicMaterial.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/ClientError.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/Country.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/CreateInstrumentRequestBody.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/EditInstrumentRequestBody.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/GetCountriesResponse.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/GetInstrumentBasicMaterialsResponse.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/GetInstrumentByCriteriaPageResponse.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/GetInstrumentTypesResponse.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/GetInstrumentsByCriteriaRequestBody.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/GetInstrumentsByCriteriaResponse.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/GetManufacturersResponse.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/InstrumentDetail.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/InstrumentDetailWithoutId.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/InstrumentId.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/InstrumentName.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/InstrumentPhoto.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/InstrumentType.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/JwtResponse.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/ListFavoriteResponse.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/ManufactureDate.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/Manufacturer.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/ManufacturerName.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/ProfileDetails.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/RegistrationRequest.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/ReleaseDate.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/ServerError.kt delete mode 100644 server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/UsernameAndPasswordRequestBody.kt 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 deleted file mode 100644 index 4322f006..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/AddFavoriteApi.kt +++ /dev/null @@ -1,45 +0,0 @@ -/** - * 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 deleted file mode 100644 index f288b748..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/ApiUtil.kt +++ /dev/null @@ -1,19 +0,0 @@ -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 deleted file mode 100644 index 277c8a33..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/BasicLoginApi.kt +++ /dev/null @@ -1,45 +0,0 @@ -/** - * 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 deleted file mode 100644 index c1b4ec6e..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/CreateInstrumentApi.kt +++ /dev/null @@ -1,45 +0,0 @@ -/** - * 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 deleted file mode 100644 index 40a18bad..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/DeleteInstrumentByIdApi.kt +++ /dev/null @@ -1,43 +0,0 @@ -/** - * 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 deleted file mode 100644 index 4b3c2687..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/EditInstrumentApi.kt +++ /dev/null @@ -1,45 +0,0 @@ -/** - * 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 deleted file mode 100644 index d1ca6fc5..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetCountriesApi.kt +++ /dev/null @@ -1,44 +0,0 @@ -/** - * 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 deleted file mode 100644 index 26c6970b..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetInstrumentBasicMaterialsApi.kt +++ /dev/null @@ -1,44 +0,0 @@ -/** - * 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 deleted file mode 100644 index 23bc016d..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetInstrumentByIdApi.kt +++ /dev/null @@ -1,44 +0,0 @@ -/** - * 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 deleted file mode 100644 index 7a8d3c61..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetInstrumentPhotoApi.kt +++ /dev/null @@ -1,44 +0,0 @@ -/** - * 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 deleted file mode 100644 index a0ce59b8..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetInstrumentTypesApi.kt +++ /dev/null @@ -1,44 +0,0 @@ -/** - * 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 deleted file mode 100644 index f18fe70e..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetInstrumentsByCriteriaApi.kt +++ /dev/null @@ -1,46 +0,0 @@ -/** - * 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 deleted file mode 100644 index 9b1130c5..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetInstrumentsByCriteriaPaginatedApi.kt +++ /dev/null @@ -1,46 +0,0 @@ -/** - * 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 deleted file mode 100644 index 871fce63..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetManufacturersApi.kt +++ /dev/null @@ -1,44 +0,0 @@ -/** - * 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 deleted file mode 100644 index b676cb06..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/GetUserProfileApi.kt +++ /dev/null @@ -1,43 +0,0 @@ -/** - * 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 deleted file mode 100644 index de90f7e7..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/ListFavoriteApi.kt +++ /dev/null @@ -1,44 +0,0 @@ -/** - * 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 deleted file mode 100644 index 4a9ce587..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/LogoutApi.kt +++ /dev/null @@ -1,42 +0,0 @@ -/** - * 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 deleted file mode 100644 index 5163e2f7..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/RemoveFavoriteApi.kt +++ /dev/null @@ -1,45 +0,0 @@ -/** - * 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 deleted file mode 100644 index a7e9d16a..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/api/UserRegistrationApi.kt +++ /dev/null @@ -1,44 +0,0 @@ -/** - * 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 deleted file mode 100644 index b27bed2e..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/BasicMaterial.kt +++ /dev/null @@ -1,25 +0,0 @@ -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 deleted file mode 100644 index bc2f0e86..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/ClientError.kt +++ /dev/null @@ -1,28 +0,0 @@ -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 deleted file mode 100644 index 5ba386c6..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/Country.kt +++ /dev/null @@ -1,25 +0,0 @@ -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 deleted file mode 100644 index 2ac68b03..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/CreateInstrumentRequestBody.kt +++ /dev/null @@ -1,32 +0,0 @@ -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 deleted file mode 100644 index c767b3d7..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/EditInstrumentRequestBody.kt +++ /dev/null @@ -1,32 +0,0 @@ -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 deleted file mode 100644 index a93f13ae..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/GetCountriesResponse.kt +++ /dev/null @@ -1,27 +0,0 @@ -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 deleted file mode 100644 index a4614262..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/GetInstrumentBasicMaterialsResponse.kt +++ /dev/null @@ -1,27 +0,0 @@ -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 deleted file mode 100644 index 06b24f4d..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/GetInstrumentByCriteriaPageResponse.kt +++ /dev/null @@ -1,42 +0,0 @@ -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 deleted file mode 100644 index 2cb9b5d2..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/GetInstrumentTypesResponse.kt +++ /dev/null @@ -1,27 +0,0 @@ -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 deleted file mode 100644 index 3e08c9b7..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/GetInstrumentsByCriteriaRequestBody.kt +++ /dev/null @@ -1,70 +0,0 @@ -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 deleted file mode 100644 index 213fac08..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/GetInstrumentsByCriteriaResponse.kt +++ /dev/null @@ -1,27 +0,0 @@ -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 deleted file mode 100644 index 46ebcaea..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/GetManufacturersResponse.kt +++ /dev/null @@ -1,27 +0,0 @@ -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 deleted file mode 100644 index 287bc6ea..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/InstrumentDetail.kt +++ /dev/null @@ -1,62 +0,0 @@ -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 deleted file mode 100644 index c097bd06..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/InstrumentDetailWithoutId.kt +++ /dev/null @@ -1,57 +0,0 @@ -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 deleted file mode 100644 index 2f3b6933..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/InstrumentId.kt +++ /dev/null @@ -1,25 +0,0 @@ -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 deleted file mode 100644 index a5ed63e3..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/InstrumentName.kt +++ /dev/null @@ -1,25 +0,0 @@ -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 deleted file mode 100644 index 2e20c9af..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/InstrumentPhoto.kt +++ /dev/null @@ -1,25 +0,0 @@ -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 deleted file mode 100644 index 5453bca6..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/InstrumentType.kt +++ /dev/null @@ -1,25 +0,0 @@ -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 deleted file mode 100644 index dc6fd35d..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/JwtResponse.kt +++ /dev/null @@ -1,25 +0,0 @@ -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 deleted file mode 100644 index be1c35cd..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/ListFavoriteResponse.kt +++ /dev/null @@ -1,27 +0,0 @@ -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 deleted file mode 100644 index 70a22bcb..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/ManufactureDate.kt +++ /dev/null @@ -1,26 +0,0 @@ -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 deleted file mode 100644 index 49efd8f0..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/Manufacturer.kt +++ /dev/null @@ -1,25 +0,0 @@ -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 deleted file mode 100644 index 36ed5dfc..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/ManufacturerName.kt +++ /dev/null @@ -1,25 +0,0 @@ -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 deleted file mode 100644 index 84864b75..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/ProfileDetails.kt +++ /dev/null @@ -1,31 +0,0 @@ -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 deleted file mode 100644 index 1c1e084d..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/RegistrationRequest.kt +++ /dev/null @@ -1,31 +0,0 @@ -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 deleted file mode 100644 index 2b114c68..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/ReleaseDate.kt +++ /dev/null @@ -1,26 +0,0 @@ -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 deleted file mode 100644 index 298c619e..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/ServerError.kt +++ /dev/null @@ -1,28 +0,0 @@ -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 deleted file mode 100644 index 2374de55..00000000 --- a/server/app/build/openapi/src/main/kotlin/mu/muse/rest/dto/UsernameAndPasswordRequestBody.kt +++ /dev/null @@ -1,28 +0,0 @@ -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 - ) { - -} - diff --git a/tools/scripts/buildAndPush.sh b/tools/scripts/buildAndPush.sh index caa809c6..0afbd9cf 100755 --- a/tools/scripts/buildAndPush.sh +++ b/tools/scripts/buildAndPush.sh @@ -12,19 +12,14 @@ fi dockerRepository=$2 -if [ -z "$2" ] - then - echo -e "\033[0;33m[$stage] No Docker Hub username provided. 'myshx' will be used.\033[0m" - dockerRepository="myshx" +if [ -z "$2" ]; then + echo -e "\033[0;33m[$stage] No Docker Hub username provided. 'myshx' will be used.\033[0m" + dockerRepository="myshx" fi -(cd "$rootDir" && ./tools/scripts/openapi/regenerateOpenApi.sh) - (cd "$rootDir" && exec ./tools/scripts/server/buildJar.sh) -echo "[DEBUG]: Repo: '$dockerRepository'" (cd "$rootDir" && exec ./tools/scripts/server/buildImage.sh "$stage" "$dockerRepository") (cd "$rootDir" && exec ./tools/scripts/client/build.sh "$stage") - (cd "$rootDir" && exec ./tools/scripts/client/buildDevImage.sh "$stage" "$dockerRepository") (cd "$rootDir" && exec ./tools/scripts/client/buildImage.sh "$stage" "$dockerRepository" ) diff --git a/tools/scripts/deploy.sh b/tools/scripts/deploy.sh index acd60b74..c2412a78 100755 --- a/tools/scripts/deploy.sh +++ b/tools/scripts/deploy.sh @@ -28,24 +28,9 @@ if [ -z "$2" ]; then echo -e "\033[0;33m[$stage] No Docker Hub username provided. 'myshx' will be used.\033[0m" dockerRepository="myshx" fi -# -## Stop local containers -#(cd "$rootDir" && exec ./tools/scripts/stop.sh "local" "$dockerRepository") -#(cd "$rootDir" && exec ./tools/scripts/clean.sh "local" "$dockerRepository") +(cd "$rootDir" && exec ./tools/scripts/openapi/regenerateOpenApi.sh) (cd "$rootDir" && exec ./tools/scripts/buildAndPush.sh "$stage" "$dockerRepository") - -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 - docker context create "${context_name}" --description "[MUSE] '$stage' Deploy Server" --docker "host=ssh://kiryuxa@88.201.171.120" - fi - - docker context use "$context_name" -fi - (cd "$rootDir" && exec ./tools/scripts/stop.sh "$stage" "$dockerRepository") (cd "$rootDir" && exec ./tools/scripts/clean.sh "$stage" "$dockerRepository") (cd "$rootDir" && exec ./tools/scripts/run.sh "$stage") From eb4152f9021dcee7222b18fb99db029362d4500b Mon Sep 17 00:00:00 2001 From: skywalker Date: Wed, 28 Aug 2024 17:15:00 +0300 Subject: [PATCH 4/7] chore(openapi-generator): commit touching files --- tools/scripts/openapi/regenerateOpenApi.sh | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tools/scripts/openapi/regenerateOpenApi.sh b/tools/scripts/openapi/regenerateOpenApi.sh index b1dc8991..7f41f7f6 100755 --- a/tools/scripts/openapi/regenerateOpenApi.sh +++ b/tools/scripts/openapi/regenerateOpenApi.sh @@ -5,18 +5,18 @@ rootDir="$currentDir/../../../" (cd "$rootDir" && exec ./tools/scripts/openapi/bundle.sh) (cd "$rootDir/client" && rm -rf ./src/generated) -(cd "$rootDir/client" && - mkdir -p ./src/generated && - touch ./src/generated/index.ts && - touch ./src/generated/base.ts && - touch ./src/generated/common.ts && - touch ./src/generated/api.ts && - touch ./src/generated/configuration.ts && - touch ./src/generated/git_push.sh && - touch ./src/generated/.gitignore && - touch ./src/generated/.npmignore && - touch ./src/generated/.openapi-generator-ignore -) +#(cd "$rootDir/client" && +# mkdir -p ./src/generated && +# touch ./src/generated/index.ts && +# touch ./src/generated/base.ts && +# touch ./src/generated/common.ts && +# touch ./src/generated/api.ts && +# touch ./src/generated/configuration.ts && +# touch ./src/generated/git_push.sh && +# touch ./src/generated/.gitignore && +# touch ./src/generated/.npmignore && +# touch ./src/generated/.openapi-generator-ignore +#) (cd "$rootDir" && exec docker run \ --rm \ -v "${PWD}/openapi:/local/openapi" \ From fd7f670a0ae2788f79473605845f8f5fd00e4de5 Mon Sep 17 00:00:00 2001 From: skywalker Date: Wed, 28 Aug 2024 17:16:10 +0300 Subject: [PATCH 5/7] chore(openapi-generator): delete touching files --- .../src/generated/.openapi-generator-ignore | 23 +++ client/src/generated/.openapi-generator/FILES | 56 +++++++ .../src/generated/.openapi-generator/VERSION | 1 + 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 ++++ tools/scripts/openapi/regenerateOpenApi.sh | 12 -- 9 files changed, 632 insertions(+), 12 deletions(-) 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/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 diff --git a/client/src/generated/.openapi-generator-ignore b/client/src/generated/.openapi-generator-ignore index e69de29b..7484ee59 100644 --- a/client/src/generated/.openapi-generator-ignore +++ b/client/src/generated/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/client/src/generated/.openapi-generator/FILES b/client/src/generated/.openapi-generator/FILES new file mode 100644 index 00000000..7638c354 --- /dev/null +++ b/client/src/generated/.openapi-generator/FILES @@ -0,0 +1,56 @@ +.gitignore +.npmignore +.openapi-generator-ignore +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/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/tools/scripts/openapi/regenerateOpenApi.sh b/tools/scripts/openapi/regenerateOpenApi.sh index 7f41f7f6..76afd66f 100755 --- a/tools/scripts/openapi/regenerateOpenApi.sh +++ b/tools/scripts/openapi/regenerateOpenApi.sh @@ -5,18 +5,6 @@ rootDir="$currentDir/../../../" (cd "$rootDir" && exec ./tools/scripts/openapi/bundle.sh) (cd "$rootDir/client" && rm -rf ./src/generated) -#(cd "$rootDir/client" && -# mkdir -p ./src/generated && -# touch ./src/generated/index.ts && -# touch ./src/generated/base.ts && -# touch ./src/generated/common.ts && -# touch ./src/generated/api.ts && -# touch ./src/generated/configuration.ts && -# touch ./src/generated/git_push.sh && -# touch ./src/generated/.gitignore && -# touch ./src/generated/.npmignore && -# touch ./src/generated/.openapi-generator-ignore -#) (cd "$rootDir" && exec docker run \ --rm \ -v "${PWD}/openapi:/local/openapi" \ From 40b4d36073ff838ca512f4f090a1053a5277fb53 Mon Sep 17 00:00:00 2001 From: skywalker Date: Wed, 28 Aug 2024 17:20:24 +0300 Subject: [PATCH 6/7] chore(linter): run linter --- .github/workflows/cicd.yml | 1 - client/public/config.js | 2 +- client/src/generated/api.ts | 39 +-- client/src/generated/api/add-favorite-api.ts | 238 ++++++++----- client/src/generated/api/basic-login-api.ts | 242 +++++++++----- .../generated/api/create-instrument-api.ts | 243 +++++++++----- .../api/delete-instrument-by-id-api.ts | 235 ++++++++----- .../src/generated/api/edit-instrument-api.ts | 242 +++++++++----- client/src/generated/api/get-countries-api.ts | 213 +++++++----- .../api/get-instrument-basic-materials-api.ts | 215 +++++++----- .../generated/api/get-instrument-by-id-api.ts | 238 ++++++++----- .../generated/api/get-instrument-photo-api.ts | 240 ++++++++----- .../generated/api/get-instrument-types-api.ts | 215 +++++++----- .../api/get-instruments-by-criteria-api.ts | 250 +++++++++----- ...t-instruments-by-criteria-paginated-api.ts | 314 ++++++++++++------ .../generated/api/get-manufacturers-api.ts | 213 +++++++----- .../src/generated/api/get-user-profile-api.ts | 206 +++++++----- client/src/generated/api/list-favorite-api.ts | 213 +++++++----- client/src/generated/api/logout-api.ts | 201 ++++++----- .../src/generated/api/remove-favorite-api.ts | 238 ++++++++----- .../generated/api/user-registration-api.ts | 241 +++++++++----- client/src/generated/base.ts | 59 ++-- client/src/generated/common.ts | 204 +++++++----- client/src/generated/configuration.ts | 200 ++++++----- client/src/generated/index.ts | 1 - client/src/generated/model/basic-material.ts | 17 +- client/src/generated/model/client-error.ts | 29 +- client/src/generated/model/country.ts | 17 +- .../model/create-instrument-request-body.ts | 32 +- .../model/edit-instrument-request-body.ts | 32 +- .../generated/model/get-countries-response.ts | 18 +- ...get-instrument-basic-materials-response.ts | 18 +- ...et-instrument-by-criteria-page-response.ts | 78 +++-- .../model/get-instrument-types-response.ts | 18 +- ...et-instruments-by-criteria-request-body.ts | 140 ++++---- .../get-instruments-by-criteria-response.ts | 18 +- .../model/get-manufacturers-response.ts | 18 +- client/src/generated/model/index.ts | 56 ++-- .../model/instrument-detail-without-id.ts | 102 +++--- .../src/generated/model/instrument-detail.ts | 116 ++++--- client/src/generated/model/instrument-id.ts | 17 +- client/src/generated/model/instrument-name.ts | 17 +- .../src/generated/model/instrument-photo.ts | 17 +- client/src/generated/model/instrument-type.ts | 17 +- client/src/generated/model/jwt-response.ts | 17 +- .../generated/model/list-favorite-response.ts | 18 +- .../src/generated/model/manufacture-date.ts | 17 +- .../src/generated/model/manufacturer-name.ts | 17 +- client/src/generated/model/manufacturer.ts | 17 +- client/src/generated/model/profile-details.ts | 41 ++- .../generated/model/registration-request.ts | 41 ++- client/src/generated/model/release-date.ts | 17 +- client/src/generated/model/server-error.ts | 29 +- .../username-and-password-request-body.ts | 29 +- .../src/pages/create-instrument/api/loader.ts | 4 +- .../src/pages/edit-instrument/api/loader.ts | 4 +- openapi/openapi.yml | 254 +++++++------- .../instrument/CreateInstrumentEndpoint.yml | 21 +- .../DeleteInstrumentByIdEndpoint.yml | 2 +- .../instrument/EditInstrumentEndpoint.yml | 2 +- .../instrument/GetInstrumentByIdEndpoint.yml | 2 +- tools/docker/docker-compose.yml | 4 +- tools/scripts/client/runLinter.sh | 3 +- 63 files changed, 3589 insertions(+), 2430 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 586c8f39..c0deb33e 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -180,7 +180,6 @@ jobs: SSH_PORT: ${{ secrets.DEV_SSH_PORT }} SSH_USER: ${{ secrets.DEV_SSH_USER }} SSH_PASS: ${{ secrets.DEV_SHH_PASS }} - # deploy-staging: # name: "[SERVER] Deploy to Staging" # if: github.event.ref == 'refs/heads/main' diff --git a/client/public/config.js b/client/public/config.js index 9c87368a..6dc7bcff 100644 --- a/client/public/config.js +++ b/client/public/config.js @@ -1,3 +1,3 @@ window._env_ = { - SERVER_API_URL: "default_value", // Placeholder, will be replaced by a script + SERVER_API_URL: "default_value", // Placeholder, will be replaced by a script }; diff --git a/client/src/generated/api.ts b/client/src/generated/api.ts index 643644cf..a7e279d7 100644 --- a/client/src/generated/api.ts +++ b/client/src/generated/api.ts @@ -12,24 +12,21 @@ * 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'; - +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 index 67d7f21a..074e9c5a 100644 --- a/client/src/generated/api/add-favorite-api.ts +++ b/client/src/generated/api/add-favorite-api.ts @@ -12,107 +12,167 @@ * Do not edit the class manually. */ - -import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; +import type { Configuration } from "../configuration"; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; +import globalAxios from "axios"; // Some imports not used depending on template conditions // @ts-ignore -import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "../common"; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +import { + BASE_PATH, + COLLECTION_FORMATS, + type RequestArgs, + BaseAPI, + RequiredError, + operationServerMap, +} from "../base"; // @ts-ignore -import type { ClientError } from '../model'; +import type { ClientError } from "../model"; // @ts-ignore -import type { InstrumentId } from '../model'; +import type { InstrumentId } from "../model"; // @ts-ignore -import type { ServerError } from '../model'; +import type { ServerError } from "../model"; /** * AddFavoriteApi - axios parameter creator * @export */ -export const AddFavoriteApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Add Favorite - * @summary Add Favorite - * @param {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; +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'; + 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) + 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, - }; - }, - } + 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); - }, - } +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)); - }, - }; +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)); + }, + }; }; /** @@ -122,16 +182,20 @@ export const AddFavoriteApiFactory = function (configuration?: Configuration, ba * @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)); - } + /** + * 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 index 0401f03e..33ec49bd 100644 --- a/client/src/generated/api/basic-login-api.ts +++ b/client/src/generated/api/basic-login-api.ts @@ -12,107 +12,171 @@ * Do not edit the class manually. */ - -import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; +import type { Configuration } from "../configuration"; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; +import globalAxios from "axios"; // Some imports not used depending on template conditions // @ts-ignore -import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "../common"; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +import { + BASE_PATH, + COLLECTION_FORMATS, + type RequestArgs, + BaseAPI, + RequiredError, + operationServerMap, +} from "../base"; // @ts-ignore -import type { JwtResponse } from '../model'; +import type { JwtResponse } from "../model"; // @ts-ignore -import type { ServerError } from '../model'; +import type { ServerError } from "../model"; // @ts-ignore -import type { UsernameAndPasswordRequestBody } from '../model'; +import type { UsernameAndPasswordRequestBody } from "../model"; /** * BasicLoginApi - axios parameter creator * @export */ -export const BasicLoginApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Basic Authentication - * @summary Basic Login - * @param {UsernameAndPasswordRequestBody} usernameAndPasswordRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - basicLogin: async (usernameAndPasswordRequestBody: UsernameAndPasswordRequestBody, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'usernameAndPasswordRequestBody' is not null or undefined - assertParamExists('basicLogin', 'usernameAndPasswordRequestBody', usernameAndPasswordRequestBody) - const localVarPath = `/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; +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'; + localVarHeaderParameter["Content-Type"] = "application/json"; - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(usernameAndPasswordRequestBody, localVarRequestOptions, configuration) + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + usernameAndPasswordRequestBody, + localVarRequestOptions, + configuration, + ); - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; }; /** * BasicLoginApi - functional programming interface * @export */ -export const BasicLoginApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = BasicLoginApiAxiosParamCreator(configuration) - return { - /** - * Basic Authentication - * @summary Basic Login - * @param {UsernameAndPasswordRequestBody} usernameAndPasswordRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async basicLogin(usernameAndPasswordRequestBody: UsernameAndPasswordRequestBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.basicLogin(usernameAndPasswordRequestBody, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['BasicLoginApi.basicLogin']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } +export const BasicLoginApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = + BasicLoginApiAxiosParamCreator(configuration); + return { + /** + * Basic Authentication + * @summary Basic Login + * @param {UsernameAndPasswordRequestBody} usernameAndPasswordRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async basicLogin( + usernameAndPasswordRequestBody: UsernameAndPasswordRequestBody, + options?: RawAxiosRequestConfig, + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.basicLogin( + usernameAndPasswordRequestBody, + options, + ); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = + operationServerMap["BasicLoginApi.basicLogin"]?.[ + localVarOperationServerIndex + ]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, localVarOperationServerBasePath || basePath); + }, + }; }; /** * BasicLoginApi - factory interface * @export */ -export const BasicLoginApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = BasicLoginApiFp(configuration) - return { - /** - * Basic Authentication - * @summary Basic Login - * @param {UsernameAndPasswordRequestBody} usernameAndPasswordRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - basicLogin(usernameAndPasswordRequestBody: UsernameAndPasswordRequestBody, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.basicLogin(usernameAndPasswordRequestBody, options).then((request) => request(axios, basePath)); - }, - }; +export const BasicLoginApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = BasicLoginApiFp(configuration); + return { + /** + * Basic Authentication + * @summary Basic Login + * @param {UsernameAndPasswordRequestBody} usernameAndPasswordRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + basicLogin( + usernameAndPasswordRequestBody: UsernameAndPasswordRequestBody, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .basicLogin(usernameAndPasswordRequestBody, options) + .then((request) => request(axios, basePath)); + }, + }; }; /** @@ -122,16 +186,20 @@ export const BasicLoginApiFactory = function (configuration?: Configuration, bas * @extends {BaseAPI} */ export class BasicLoginApi extends BaseAPI { - /** - * Basic Authentication - * @summary Basic Login - * @param {UsernameAndPasswordRequestBody} usernameAndPasswordRequestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof BasicLoginApi - */ - public basicLogin(usernameAndPasswordRequestBody: UsernameAndPasswordRequestBody, options?: RawAxiosRequestConfig) { - return BasicLoginApiFp(this.configuration).basicLogin(usernameAndPasswordRequestBody, options).then((request) => request(this.axios, this.basePath)); - } + /** + * Basic Authentication + * @summary Basic Login + * @param {UsernameAndPasswordRequestBody} usernameAndPasswordRequestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof BasicLoginApi + */ + public basicLogin( + usernameAndPasswordRequestBody: UsernameAndPasswordRequestBody, + options?: RawAxiosRequestConfig, + ) { + return BasicLoginApiFp(this.configuration) + .basicLogin(usernameAndPasswordRequestBody, options) + .then((request) => request(this.axios, this.basePath)); + } } - diff --git a/client/src/generated/api/create-instrument-api.ts b/client/src/generated/api/create-instrument-api.ts index 225ba1b3..7744af87 100644 --- a/client/src/generated/api/create-instrument-api.ts +++ b/client/src/generated/api/create-instrument-api.ts @@ -12,107 +12,172 @@ * Do not edit the class manually. */ - -import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; +import type { Configuration } from "../configuration"; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; +import globalAxios from "axios"; // Some imports not used depending on template conditions // @ts-ignore -import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "../common"; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +import { + BASE_PATH, + COLLECTION_FORMATS, + type RequestArgs, + BaseAPI, + RequiredError, + operationServerMap, +} from "../base"; // @ts-ignore -import type { ClientError } from '../model'; +import type { ClientError } from "../model"; // @ts-ignore -import type { CreateInstrumentRequestBody } from '../model'; +import type { CreateInstrumentRequestBody } from "../model"; // @ts-ignore -import type { ServerError } from '../model'; +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; +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'; + 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) + 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, - }; - }, - } + 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); - }, - } +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)); - }, - }; +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)); + }, + }; }; /** @@ -122,16 +187,20 @@ export const CreateInstrumentApiFactory = function (configuration?: Configuratio * @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)); - } + /** + * 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 index 2e9f06b5..0375c534 100644 --- a/client/src/generated/api/delete-instrument-by-id-api.ts +++ b/client/src/generated/api/delete-instrument-by-id-api.ts @@ -12,103 +12,164 @@ * Do not edit the class manually. */ - -import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; +import type { Configuration } from "../configuration"; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; +import globalAxios from "axios"; // Some imports not used depending on template conditions // @ts-ignore -import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "../common"; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +import { + BASE_PATH, + COLLECTION_FORMATS, + type RequestArgs, + BaseAPI, + RequiredError, + operationServerMap, +} from "../base"; // @ts-ignore -import type { ClientError } from '../model'; +import type { ClientError } from "../model"; // @ts-ignore -import type { ServerError } from '../model'; +import type { ServerError } from "../model"; /** * DeleteInstrumentByIdApi - axios parameter creator * @export */ -export const DeleteInstrumentByIdApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Get Instrument Types - * @summary Get Instrument Types - * @param {number} instrumentId Instrument ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteInstrumentById: async (instrumentId: number, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'instrumentId' is not null or undefined - assertParamExists('deleteInstrumentById', 'instrumentId', instrumentId) - const localVarPath = `/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; +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}; + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; }; /** * DeleteInstrumentByIdApi - functional programming interface * @export */ -export const DeleteInstrumentByIdApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = DeleteInstrumentByIdApiAxiosParamCreator(configuration) - return { - /** - * Get Instrument Types - * @summary Get Instrument Types - * @param {number} instrumentId Instrument ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async deleteInstrumentById(instrumentId: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.deleteInstrumentById(instrumentId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DeleteInstrumentByIdApi.deleteInstrumentById']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } +export const DeleteInstrumentByIdApiFp = function ( + configuration?: Configuration, +) { + const localVarAxiosParamCreator = + DeleteInstrumentByIdApiAxiosParamCreator(configuration); + return { + /** + * Get Instrument Types + * @summary Get Instrument Types + * @param {number} instrumentId Instrument ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteInstrumentById( + instrumentId: number, + options?: RawAxiosRequestConfig, + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.deleteInstrumentById( + instrumentId, + options, + ); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = + operationServerMap["DeleteInstrumentByIdApi.deleteInstrumentById"]?.[ + localVarOperationServerIndex + ]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, localVarOperationServerBasePath || basePath); + }, + }; }; /** * DeleteInstrumentByIdApi - factory interface * @export */ -export const DeleteInstrumentByIdApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = DeleteInstrumentByIdApiFp(configuration) - return { - /** - * Get Instrument Types - * @summary Get Instrument Types - * @param {number} instrumentId Instrument ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteInstrumentById(instrumentId: number, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.deleteInstrumentById(instrumentId, options).then((request) => request(axios, basePath)); - }, - }; +export const DeleteInstrumentByIdApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = DeleteInstrumentByIdApiFp(configuration); + return { + /** + * Get Instrument Types + * @summary Get Instrument Types + * @param {number} instrumentId Instrument ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteInstrumentById( + instrumentId: number, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .deleteInstrumentById(instrumentId, options) + .then((request) => request(axios, basePath)); + }, + }; }; /** @@ -118,16 +179,20 @@ export const DeleteInstrumentByIdApiFactory = function (configuration?: Configur * @extends {BaseAPI} */ export class DeleteInstrumentByIdApi extends BaseAPI { - /** - * Get Instrument Types - * @summary Get Instrument Types - * @param {number} instrumentId Instrument ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof DeleteInstrumentByIdApi - */ - public deleteInstrumentById(instrumentId: number, options?: RawAxiosRequestConfig) { - return DeleteInstrumentByIdApiFp(this.configuration).deleteInstrumentById(instrumentId, options).then((request) => request(this.axios, this.basePath)); - } + /** + * Get Instrument Types + * @summary Get Instrument Types + * @param {number} instrumentId Instrument ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DeleteInstrumentByIdApi + */ + public deleteInstrumentById( + instrumentId: number, + options?: RawAxiosRequestConfig, + ) { + return DeleteInstrumentByIdApiFp(this.configuration) + .deleteInstrumentById(instrumentId, options) + .then((request) => request(this.axios, this.basePath)); + } } - diff --git a/client/src/generated/api/edit-instrument-api.ts b/client/src/generated/api/edit-instrument-api.ts index 17f5ebfd..94cceeca 100644 --- a/client/src/generated/api/edit-instrument-api.ts +++ b/client/src/generated/api/edit-instrument-api.ts @@ -12,107 +12,171 @@ * Do not edit the class manually. */ - -import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; +import type { Configuration } from "../configuration"; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; +import globalAxios from "axios"; // Some imports not used depending on template conditions // @ts-ignore -import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "../common"; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +import { + BASE_PATH, + COLLECTION_FORMATS, + type RequestArgs, + BaseAPI, + RequiredError, + operationServerMap, +} from "../base"; // @ts-ignore -import type { ClientError } from '../model'; +import type { ClientError } from "../model"; // @ts-ignore -import type { EditInstrumentRequestBody } from '../model'; +import type { EditInstrumentRequestBody } from "../model"; // @ts-ignore -import type { ServerError } from '../model'; +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; +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'; + 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) + 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, - }; - }, - } + 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); - }, - } +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)); - }, - }; +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)); + }, + }; }; /** @@ -122,16 +186,20 @@ export const EditInstrumentApiFactory = function (configuration?: Configuration, * @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)); - } + /** + * 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 index 2bbd9bb2..9e35be91 100644 --- a/client/src/generated/api/get-countries-api.ts +++ b/client/src/generated/api/get-countries-api.ts @@ -12,99 +12,153 @@ * Do not edit the class manually. */ - -import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; +import type { Configuration } from "../configuration"; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; +import globalAxios from "axios"; // Some imports not used depending on template conditions // @ts-ignore -import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "../common"; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +import { + BASE_PATH, + COLLECTION_FORMATS, + type RequestArgs, + BaseAPI, + RequiredError, + operationServerMap, +} from "../base"; // @ts-ignore -import type { ClientError } from '../model'; +import type { ClientError } from "../model"; // @ts-ignore -import type { GetCountriesResponse } from '../model'; +import type { GetCountriesResponse } from "../model"; // @ts-ignore -import type { ServerError } from '../model'; +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; +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}; + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; }; /** * 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); - }, - } +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)); - }, - }; +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)); + }, + }; }; /** @@ -114,15 +168,16 @@ export const GetCountriesApiFactory = function (configuration?: Configuration, b * @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)); - } + /** + * 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 index a880302c..dacf6a6e 100644 --- a/client/src/generated/api/get-instrument-basic-materials-api.ts +++ b/client/src/generated/api/get-instrument-basic-materials-api.ts @@ -12,99 +12,155 @@ * Do not edit the class manually. */ - -import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; +import type { Configuration } from "../configuration"; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; +import globalAxios from "axios"; // Some imports not used depending on template conditions // @ts-ignore -import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "../common"; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +import { + BASE_PATH, + COLLECTION_FORMATS, + type RequestArgs, + BaseAPI, + RequiredError, + operationServerMap, +} from "../base"; // @ts-ignore -import type { ClientError } from '../model'; +import type { ClientError } from "../model"; // @ts-ignore -import type { GetInstrumentBasicMaterialsResponse } from '../model'; +import type { GetInstrumentBasicMaterialsResponse } from "../model"; // @ts-ignore -import type { ServerError } from '../model'; +import type { ServerError } from "../model"; /** * GetInstrumentBasicMaterialsApi - axios parameter creator * @export */ -export const GetInstrumentBasicMaterialsApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Get Instrument Basic Materials - * @summary Get Instrument Basic Materials - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getInstrumentBasicMaterials: async (options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/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; +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}; + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; }; /** * GetInstrumentBasicMaterialsApi - functional programming interface * @export */ -export const GetInstrumentBasicMaterialsApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = GetInstrumentBasicMaterialsApiAxiosParamCreator(configuration) - return { - /** - * Get Instrument Basic Materials - * @summary Get Instrument Basic Materials - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getInstrumentBasicMaterials(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getInstrumentBasicMaterials(options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['GetInstrumentBasicMaterialsApi.getInstrumentBasicMaterials']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } +export const GetInstrumentBasicMaterialsApiFp = function ( + configuration?: Configuration, +) { + const localVarAxiosParamCreator = + GetInstrumentBasicMaterialsApiAxiosParamCreator(configuration); + return { + /** + * Get Instrument Basic Materials + * @summary Get Instrument Basic Materials + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getInstrumentBasicMaterials( + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.getInstrumentBasicMaterials(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = + operationServerMap[ + "GetInstrumentBasicMaterialsApi.getInstrumentBasicMaterials" + ]?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, localVarOperationServerBasePath || basePath); + }, + }; }; /** * GetInstrumentBasicMaterialsApi - factory interface * @export */ -export const GetInstrumentBasicMaterialsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = GetInstrumentBasicMaterialsApiFp(configuration) - return { - /** - * Get Instrument Basic Materials - * @summary Get Instrument Basic Materials - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getInstrumentBasicMaterials(options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getInstrumentBasicMaterials(options).then((request) => request(axios, basePath)); - }, - }; +export const GetInstrumentBasicMaterialsApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = GetInstrumentBasicMaterialsApiFp(configuration); + return { + /** + * Get Instrument Basic Materials + * @summary Get Instrument Basic Materials + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInstrumentBasicMaterials( + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .getInstrumentBasicMaterials(options) + .then((request) => request(axios, basePath)); + }, + }; }; /** @@ -114,15 +170,16 @@ export const GetInstrumentBasicMaterialsApiFactory = function (configuration?: C * @extends {BaseAPI} */ export class GetInstrumentBasicMaterialsApi extends BaseAPI { - /** - * Get Instrument Basic Materials - * @summary Get Instrument Basic Materials - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof GetInstrumentBasicMaterialsApi - */ - public getInstrumentBasicMaterials(options?: RawAxiosRequestConfig) { - return GetInstrumentBasicMaterialsApiFp(this.configuration).getInstrumentBasicMaterials(options).then((request) => request(this.axios, this.basePath)); - } + /** + * Get Instrument Basic Materials + * @summary Get Instrument Basic Materials + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GetInstrumentBasicMaterialsApi + */ + public getInstrumentBasicMaterials(options?: RawAxiosRequestConfig) { + return GetInstrumentBasicMaterialsApiFp(this.configuration) + .getInstrumentBasicMaterials(options) + .then((request) => request(this.axios, this.basePath)); + } } - diff --git a/client/src/generated/api/get-instrument-by-id-api.ts b/client/src/generated/api/get-instrument-by-id-api.ts index 4e3d181b..4f17f44d 100644 --- a/client/src/generated/api/get-instrument-by-id-api.ts +++ b/client/src/generated/api/get-instrument-by-id-api.ts @@ -12,105 +12,167 @@ * Do not edit the class manually. */ - -import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; +import type { Configuration } from "../configuration"; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; +import globalAxios from "axios"; // Some imports not used depending on template conditions // @ts-ignore -import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "../common"; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +import { + BASE_PATH, + COLLECTION_FORMATS, + type RequestArgs, + BaseAPI, + RequiredError, + operationServerMap, +} from "../base"; // @ts-ignore -import type { ClientError } from '../model'; +import type { ClientError } from "../model"; // @ts-ignore -import type { InstrumentDetail } from '../model'; +import type { InstrumentDetail } from "../model"; // @ts-ignore -import type { ServerError } from '../model'; +import type { ServerError } from "../model"; /** * GetInstrumentByIdApi - axios parameter creator * @export */ -export const GetInstrumentByIdApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Get Instrument by ID - * @summary Get Instrument by ID - * @param {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; +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}; + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; }; /** * GetInstrumentByIdApi - functional programming interface * @export */ -export const GetInstrumentByIdApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = GetInstrumentByIdApiAxiosParamCreator(configuration) - return { - /** - * Get Instrument by ID - * @summary Get Instrument by ID - * @param {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); - }, - } +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)); - }, - }; +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)); + }, + }; }; /** @@ -120,16 +182,20 @@ export const GetInstrumentByIdApiFactory = function (configuration?: Configurati * @extends {BaseAPI} */ export class GetInstrumentByIdApi extends BaseAPI { - /** - * Get Instrument by ID - * @summary Get Instrument by ID - * @param {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)); - } + /** + * 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 index eb0e10aa..6cd7942b 100644 --- a/client/src/generated/api/get-instrument-photo-api.ts +++ b/client/src/generated/api/get-instrument-photo-api.ts @@ -12,105 +12,169 @@ * Do not edit the class manually. */ - -import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; +import type { Configuration } from "../configuration"; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; +import globalAxios from "axios"; // Some imports not used depending on template conditions // @ts-ignore -import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "../common"; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +import { + BASE_PATH, + COLLECTION_FORMATS, + type RequestArgs, + BaseAPI, + RequiredError, + operationServerMap, +} from "../base"; // @ts-ignore -import type { ClientError } from '../model'; +import type { ClientError } from "../model"; // @ts-ignore -import type { InstrumentPhoto } from '../model'; +import type { InstrumentPhoto } from "../model"; // @ts-ignore -import type { ServerError } from '../model'; +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; +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}; + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; }; /** * 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); - }, - } +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)); - }, - }; +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)); + }, + }; }; /** @@ -120,16 +184,20 @@ export const GetInstrumentPhotoApiFactory = function (configuration?: Configurat * @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)); - } + /** + * 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 index 8e59373b..44966f03 100644 --- a/client/src/generated/api/get-instrument-types-api.ts +++ b/client/src/generated/api/get-instrument-types-api.ts @@ -12,99 +12,155 @@ * Do not edit the class manually. */ - -import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; +import type { Configuration } from "../configuration"; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; +import globalAxios from "axios"; // Some imports not used depending on template conditions // @ts-ignore -import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "../common"; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +import { + BASE_PATH, + COLLECTION_FORMATS, + type RequestArgs, + BaseAPI, + RequiredError, + operationServerMap, +} from "../base"; // @ts-ignore -import type { ClientError } from '../model'; +import type { ClientError } from "../model"; // @ts-ignore -import type { GetInstrumentTypesResponse } from '../model'; +import type { GetInstrumentTypesResponse } from "../model"; // @ts-ignore -import type { ServerError } from '../model'; +import type { ServerError } from "../model"; /** * GetInstrumentTypesApi - axios parameter creator * @export */ -export const GetInstrumentTypesApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Get Instrument Types - * @summary Get Instrument Types - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getInstrumentTypes: async (options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/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; +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}; + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; }; /** * GetInstrumentTypesApi - functional programming interface * @export */ -export const GetInstrumentTypesApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = GetInstrumentTypesApiAxiosParamCreator(configuration) - return { - /** - * Get Instrument Types - * @summary Get Instrument Types - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getInstrumentTypes(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getInstrumentTypes(options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['GetInstrumentTypesApi.getInstrumentTypes']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } +export const GetInstrumentTypesApiFp = function ( + configuration?: Configuration, +) { + const localVarAxiosParamCreator = + GetInstrumentTypesApiAxiosParamCreator(configuration); + return { + /** + * Get Instrument Types + * @summary Get Instrument Types + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getInstrumentTypes( + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.getInstrumentTypes(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = + operationServerMap["GetInstrumentTypesApi.getInstrumentTypes"]?.[ + localVarOperationServerIndex + ]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, localVarOperationServerBasePath || basePath); + }, + }; }; /** * GetInstrumentTypesApi - factory interface * @export */ -export const GetInstrumentTypesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = GetInstrumentTypesApiFp(configuration) - return { - /** - * Get Instrument Types - * @summary Get Instrument Types - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getInstrumentTypes(options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getInstrumentTypes(options).then((request) => request(axios, basePath)); - }, - }; +export const GetInstrumentTypesApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = GetInstrumentTypesApiFp(configuration); + return { + /** + * Get Instrument Types + * @summary Get Instrument Types + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInstrumentTypes( + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .getInstrumentTypes(options) + .then((request) => request(axios, basePath)); + }, + }; }; /** @@ -114,15 +170,16 @@ export const GetInstrumentTypesApiFactory = function (configuration?: Configurat * @extends {BaseAPI} */ export class GetInstrumentTypesApi extends BaseAPI { - /** - * Get Instrument Types - * @summary Get Instrument Types - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof GetInstrumentTypesApi - */ - public getInstrumentTypes(options?: RawAxiosRequestConfig) { - return GetInstrumentTypesApiFp(this.configuration).getInstrumentTypes(options).then((request) => request(this.axios, this.basePath)); - } + /** + * Get Instrument Types + * @summary Get Instrument Types + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GetInstrumentTypesApi + */ + public getInstrumentTypes(options?: RawAxiosRequestConfig) { + return GetInstrumentTypesApiFp(this.configuration) + .getInstrumentTypes(options) + .then((request) => request(this.axios, this.basePath)); + } } - diff --git a/client/src/generated/api/get-instruments-by-criteria-api.ts b/client/src/generated/api/get-instruments-by-criteria-api.ts index ba63ce3f..5c640b61 100644 --- a/client/src/generated/api/get-instruments-by-criteria-api.ts +++ b/client/src/generated/api/get-instruments-by-criteria-api.ts @@ -12,109 +12,179 @@ * Do not edit the class manually. */ - -import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; +import type { Configuration } from "../configuration"; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; +import globalAxios from "axios"; // Some imports not used depending on template conditions // @ts-ignore -import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "../common"; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +import { + BASE_PATH, + COLLECTION_FORMATS, + type RequestArgs, + BaseAPI, + RequiredError, + operationServerMap, +} from "../base"; // @ts-ignore -import type { ClientError } from '../model'; +import type { ClientError } from "../model"; // @ts-ignore -import type { GetInstrumentsByCriteriaRequestBody } from '../model'; +import type { GetInstrumentsByCriteriaRequestBody } from "../model"; // @ts-ignore -import type { GetInstrumentsByCriteriaResponse } from '../model'; +import type { GetInstrumentsByCriteriaResponse } from "../model"; // @ts-ignore -import type { ServerError } from '../model'; +import type { ServerError } from "../model"; /** * GetInstrumentsByCriteriaApi - axios parameter creator * @export */ -export const GetInstrumentsByCriteriaApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Get Instruments by Criteria - * @summary Get Instruments by Criteria - * @param {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; +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'; + 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) + 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, - }; - }, - } + 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); - }, - } +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)); - }, - }; +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)); + }, + }; }; /** @@ -124,16 +194,20 @@ export const GetInstrumentsByCriteriaApiFactory = function (configuration?: Conf * @extends {BaseAPI} */ export class GetInstrumentsByCriteriaApi extends BaseAPI { - /** - * Get Instruments by Criteria - * @summary Get Instruments by Criteria - * @param {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)); - } + /** + * 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 index 70f8125b..6675f52b 100644 --- a/client/src/generated/api/get-instruments-by-criteria-paginated-api.ts +++ b/client/src/generated/api/get-instruments-by-criteria-paginated-api.ts @@ -12,127 +12,218 @@ * Do not edit the class manually. */ - -import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; +import type { Configuration } from "../configuration"; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; +import globalAxios from "axios"; // Some imports not used depending on template conditions // @ts-ignore -import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "../common"; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +import { + BASE_PATH, + COLLECTION_FORMATS, + type RequestArgs, + BaseAPI, + RequiredError, + operationServerMap, +} from "../base"; // @ts-ignore -import type { ClientError } from '../model'; +import type { ClientError } from "../model"; // @ts-ignore -import type { GetInstrumentByCriteriaPageResponse } from '../model'; +import type { GetInstrumentByCriteriaPageResponse } from "../model"; // @ts-ignore -import type { GetInstrumentsByCriteriaRequestBody } from '../model'; +import type { GetInstrumentsByCriteriaRequestBody } from "../model"; // @ts-ignore -import type { ServerError } from '../model'; +import type { ServerError } from "../model"; /** * GetInstrumentsByCriteriaPaginatedApi - axios parameter creator * @export */ -export const GetInstrumentsByCriteriaPaginatedApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Get Instruments by Criteria Paginated - * @summary Get Instruments by Criteria Paginated - * @param {number} pageSize Page Size - * @param {number} pageNumber Page Number (1-based enumeration) - * @param {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; +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; + } - if (pageSize !== undefined) { - localVarQueryParameter['page_size'] = pageSize; - } + const localVarRequestOptions = { + method: "POST", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; - if (pageNumber !== undefined) { - localVarQueryParameter['page_number'] = pageNumber; - } + if (pageSize !== undefined) { + localVarQueryParameter["page_size"] = pageSize; + } + if (pageNumber !== undefined) { + localVarQueryParameter["page_number"] = pageNumber; + } - - localVarHeaderParameter['Content-Type'] = 'application/json'; + localVarHeaderParameter["Content-Type"] = "application/json"; - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(getInstrumentsByCriteriaRequestBody, localVarRequestOptions, configuration) + 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, - }; - }, - } + 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); - }, - } +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)); - }, - }; +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)); + }, + }; }; /** @@ -142,18 +233,29 @@ export const GetInstrumentsByCriteriaPaginatedApiFactory = function (configurati * @extends {BaseAPI} */ export class GetInstrumentsByCriteriaPaginatedApi extends BaseAPI { - /** - * Get Instruments by Criteria Paginated - * @summary Get Instruments by Criteria Paginated - * @param {number} pageSize Page Size - * @param {number} pageNumber Page Number (1-based enumeration) - * @param {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)); - } + /** + * 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 index 7effa08a..2ffbec49 100644 --- a/client/src/generated/api/get-manufacturers-api.ts +++ b/client/src/generated/api/get-manufacturers-api.ts @@ -12,99 +12,153 @@ * Do not edit the class manually. */ - -import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; +import type { Configuration } from "../configuration"; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; +import globalAxios from "axios"; // Some imports not used depending on template conditions // @ts-ignore -import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "../common"; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +import { + BASE_PATH, + COLLECTION_FORMATS, + type RequestArgs, + BaseAPI, + RequiredError, + operationServerMap, +} from "../base"; // @ts-ignore -import type { ClientError } from '../model'; +import type { ClientError } from "../model"; // @ts-ignore -import type { GetManufacturersResponse } from '../model'; +import type { GetManufacturersResponse } from "../model"; // @ts-ignore -import type { ServerError } from '../model'; +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; +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}; + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; }; /** * 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); - }, - } +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)); - }, - }; +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)); + }, + }; }; /** @@ -114,15 +168,16 @@ export const GetManufacturersApiFactory = function (configuration?: Configuratio * @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)); - } + /** + * 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 index feada3ad..797a0da0 100644 --- a/client/src/generated/api/get-user-profile-api.ts +++ b/client/src/generated/api/get-user-profile-api.ts @@ -12,97 +12,146 @@ * Do not edit the class manually. */ - -import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; +import type { Configuration } from "../configuration"; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; +import globalAxios from "axios"; // Some imports not used depending on template conditions // @ts-ignore -import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "../common"; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +import { + BASE_PATH, + COLLECTION_FORMATS, + type RequestArgs, + BaseAPI, + RequiredError, + operationServerMap, +} from "../base"; // @ts-ignore -import type { ProfileDetails } from '../model'; +import type { ProfileDetails } from "../model"; // @ts-ignore -import type { ServerError } from '../model'; +import type { ServerError } from "../model"; /** * GetUserProfileApi - axios parameter creator * @export */ -export const GetUserProfileApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Get User Profile - * @summary Get Profile Info - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getProfile: async (options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/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; +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}; + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; }; /** * GetUserProfileApi - functional programming interface * @export */ -export const GetUserProfileApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = GetUserProfileApiAxiosParamCreator(configuration) - return { - /** - * Get User Profile - * @summary Get Profile Info - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getProfile(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getProfile(options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['GetUserProfileApi.getProfile']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } +export const GetUserProfileApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = + GetUserProfileApiAxiosParamCreator(configuration); + return { + /** + * Get User Profile + * @summary Get Profile Info + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getProfile( + options?: RawAxiosRequestConfig, + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.getProfile(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = + operationServerMap["GetUserProfileApi.getProfile"]?.[ + localVarOperationServerIndex + ]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, localVarOperationServerBasePath || basePath); + }, + }; }; /** * GetUserProfileApi - factory interface * @export */ -export const GetUserProfileApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = GetUserProfileApiFp(configuration) - return { - /** - * Get User Profile - * @summary Get Profile Info - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getProfile(options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getProfile(options).then((request) => request(axios, basePath)); - }, - }; +export const GetUserProfileApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = GetUserProfileApiFp(configuration); + return { + /** + * Get User Profile + * @summary Get Profile Info + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getProfile(options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp + .getProfile(options) + .then((request) => request(axios, basePath)); + }, + }; }; /** @@ -112,15 +161,16 @@ export const GetUserProfileApiFactory = function (configuration?: Configuration, * @extends {BaseAPI} */ export class GetUserProfileApi extends BaseAPI { - /** - * Get User Profile - * @summary Get Profile Info - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof GetUserProfileApi - */ - public getProfile(options?: RawAxiosRequestConfig) { - return GetUserProfileApiFp(this.configuration).getProfile(options).then((request) => request(this.axios, this.basePath)); - } + /** + * Get User Profile + * @summary Get Profile Info + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GetUserProfileApi + */ + public getProfile(options?: RawAxiosRequestConfig) { + return GetUserProfileApiFp(this.configuration) + .getProfile(options) + .then((request) => request(this.axios, this.basePath)); + } } - diff --git a/client/src/generated/api/list-favorite-api.ts b/client/src/generated/api/list-favorite-api.ts index 53088d68..2e12e9ab 100644 --- a/client/src/generated/api/list-favorite-api.ts +++ b/client/src/generated/api/list-favorite-api.ts @@ -12,99 +12,153 @@ * Do not edit the class manually. */ - -import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; +import type { Configuration } from "../configuration"; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; +import globalAxios from "axios"; // Some imports not used depending on template conditions // @ts-ignore -import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "../common"; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +import { + BASE_PATH, + COLLECTION_FORMATS, + type RequestArgs, + BaseAPI, + RequiredError, + operationServerMap, +} from "../base"; // @ts-ignore -import type { ClientError } from '../model'; +import type { ClientError } from "../model"; // @ts-ignore -import type { ListFavoriteResponse } from '../model'; +import type { ListFavoriteResponse } from "../model"; // @ts-ignore -import type { ServerError } from '../model'; +import type { ServerError } from "../model"; /** * ListFavoriteApi - axios parameter creator * @export */ -export const ListFavoriteApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * List Favorite - * @summary List Favorite - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listFavorite: async (options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/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; +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}; + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; }; /** * ListFavoriteApi - functional programming interface * @export */ -export const ListFavoriteApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = ListFavoriteApiAxiosParamCreator(configuration) - return { - /** - * List Favorite - * @summary List Favorite - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async listFavorite(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.listFavorite(options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ListFavoriteApi.listFavorite']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } +export const ListFavoriteApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = + ListFavoriteApiAxiosParamCreator(configuration); + return { + /** + * List Favorite + * @summary List Favorite + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listFavorite( + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.listFavorite(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = + operationServerMap["ListFavoriteApi.listFavorite"]?.[ + localVarOperationServerIndex + ]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, localVarOperationServerBasePath || basePath); + }, + }; }; /** * ListFavoriteApi - factory interface * @export */ -export const ListFavoriteApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = ListFavoriteApiFp(configuration) - return { - /** - * List Favorite - * @summary List Favorite - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listFavorite(options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.listFavorite(options).then((request) => request(axios, basePath)); - }, - }; +export const ListFavoriteApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = ListFavoriteApiFp(configuration); + return { + /** + * List Favorite + * @summary List Favorite + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listFavorite( + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .listFavorite(options) + .then((request) => request(axios, basePath)); + }, + }; }; /** @@ -114,15 +168,16 @@ export const ListFavoriteApiFactory = function (configuration?: Configuration, b * @extends {BaseAPI} */ export class ListFavoriteApi extends BaseAPI { - /** - * List Favorite - * @summary List Favorite - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ListFavoriteApi - */ - public listFavorite(options?: RawAxiosRequestConfig) { - return ListFavoriteApiFp(this.configuration).listFavorite(options).then((request) => request(this.axios, this.basePath)); - } + /** + * List Favorite + * @summary List Favorite + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ListFavoriteApi + */ + public listFavorite(options?: RawAxiosRequestConfig) { + return ListFavoriteApiFp(this.configuration) + .listFavorite(options) + .then((request) => request(this.axios, this.basePath)); + } } - diff --git a/client/src/generated/api/logout-api.ts b/client/src/generated/api/logout-api.ts index ce5f4625..1c6c45d1 100644 --- a/client/src/generated/api/logout-api.ts +++ b/client/src/generated/api/logout-api.ts @@ -12,95 +12,141 @@ * Do not edit the class manually. */ - -import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; +import type { Configuration } from "../configuration"; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; +import globalAxios from "axios"; // Some imports not used depending on template conditions // @ts-ignore -import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "../common"; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +import { + BASE_PATH, + COLLECTION_FORMATS, + type RequestArgs, + BaseAPI, + RequiredError, + operationServerMap, +} from "../base"; // @ts-ignore -import type { ServerError } from '../model'; +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; +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}; + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; }; /** * 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); - }, - } +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)); - }, - }; +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)); + }, + }; }; /** @@ -110,15 +156,16 @@ export const LogoutApiFactory = function (configuration?: Configuration, basePat * @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)); - } + /** + * 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 index f9213e90..b35a34a5 100644 --- a/client/src/generated/api/remove-favorite-api.ts +++ b/client/src/generated/api/remove-favorite-api.ts @@ -12,107 +12,167 @@ * Do not edit the class manually. */ - -import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; +import type { Configuration } from "../configuration"; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; +import globalAxios from "axios"; // Some imports not used depending on template conditions // @ts-ignore -import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "../common"; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +import { + BASE_PATH, + COLLECTION_FORMATS, + type RequestArgs, + BaseAPI, + RequiredError, + operationServerMap, +} from "../base"; // @ts-ignore -import type { ClientError } from '../model'; +import type { ClientError } from "../model"; // @ts-ignore -import type { InstrumentId } from '../model'; +import type { InstrumentId } from "../model"; // @ts-ignore -import type { ServerError } from '../model'; +import type { ServerError } from "../model"; /** * RemoveFavoriteApi - axios parameter creator * @export */ -export const RemoveFavoriteApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Remove Favorite - * @summary Remove Favorite - * @param {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; +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'; + 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) + 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, - }; - }, - } + 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); - }, - } +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)); - }, - }; +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)); + }, + }; }; /** @@ -122,16 +182,20 @@ export const RemoveFavoriteApiFactory = function (configuration?: Configuration, * @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)); - } + /** + * 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 index 5c70f9f5..705cacf2 100644 --- a/client/src/generated/api/user-registration-api.ts +++ b/client/src/generated/api/user-registration-api.ts @@ -12,105 +12,170 @@ * Do not edit the class manually. */ - -import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; +import type { Configuration } from "../configuration"; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; +import globalAxios from "axios"; // Some imports not used depending on template conditions // @ts-ignore -import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "../common"; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +import { + BASE_PATH, + COLLECTION_FORMATS, + type RequestArgs, + BaseAPI, + RequiredError, + operationServerMap, +} from "../base"; // @ts-ignore -import type { RegistrationRequest } from '../model'; +import type { RegistrationRequest } from "../model"; // @ts-ignore -import type { ServerError } from '../model'; +import type { ServerError } from "../model"; /** * UserRegistrationApi - axios parameter creator * @export */ -export const UserRegistrationApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Register User - * @summary User Registration - * @param {RegistrationRequest} registrationRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - userRegistration: async (registrationRequest: RegistrationRequest, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'registrationRequest' is not null or undefined - assertParamExists('userRegistration', 'registrationRequest', registrationRequest) - const localVarPath = `/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; +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'; + localVarHeaderParameter["Content-Type"] = "application/json"; - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(registrationRequest, localVarRequestOptions, configuration) + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + registrationRequest, + localVarRequestOptions, + configuration, + ); - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; }; /** * UserRegistrationApi - functional programming interface * @export */ -export const UserRegistrationApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = UserRegistrationApiAxiosParamCreator(configuration) - return { - /** - * Register User - * @summary User Registration - * @param {RegistrationRequest} registrationRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async userRegistration(registrationRequest: RegistrationRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.userRegistration(registrationRequest, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['UserRegistrationApi.userRegistration']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } +export const UserRegistrationApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = + UserRegistrationApiAxiosParamCreator(configuration); + return { + /** + * Register User + * @summary User Registration + * @param {RegistrationRequest} registrationRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async userRegistration( + registrationRequest: RegistrationRequest, + options?: RawAxiosRequestConfig, + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.userRegistration( + registrationRequest, + options, + ); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = + operationServerMap["UserRegistrationApi.userRegistration"]?.[ + localVarOperationServerIndex + ]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, localVarOperationServerBasePath || basePath); + }, + }; }; /** * UserRegistrationApi - factory interface * @export */ -export const UserRegistrationApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = UserRegistrationApiFp(configuration) - return { - /** - * Register User - * @summary User Registration - * @param {RegistrationRequest} registrationRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - userRegistration(registrationRequest: RegistrationRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.userRegistration(registrationRequest, options).then((request) => request(axios, basePath)); - }, - }; +export const UserRegistrationApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = UserRegistrationApiFp(configuration); + return { + /** + * Register User + * @summary User Registration + * @param {RegistrationRequest} registrationRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userRegistration( + registrationRequest: RegistrationRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .userRegistration(registrationRequest, options) + .then((request) => request(axios, basePath)); + }, + }; }; /** @@ -120,16 +185,20 @@ export const UserRegistrationApiFactory = function (configuration?: Configuratio * @extends {BaseAPI} */ export class UserRegistrationApi extends BaseAPI { - /** - * Register User - * @summary User Registration - * @param {RegistrationRequest} registrationRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UserRegistrationApi - */ - public userRegistration(registrationRequest: RegistrationRequest, options?: RawAxiosRequestConfig) { - return UserRegistrationApiFp(this.configuration).userRegistration(registrationRequest, options).then((request) => request(this.axios, this.basePath)); - } + /** + * Register User + * @summary User Registration + * @param {RegistrationRequest} registrationRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserRegistrationApi + */ + public userRegistration( + registrationRequest: RegistrationRequest, + options?: RawAxiosRequestConfig, + ) { + return UserRegistrationApiFp(this.configuration) + .userRegistration(registrationRequest, options) + .then((request) => request(this.axios, this.basePath)); + } } - diff --git a/client/src/generated/base.ts b/client/src/generated/base.ts index 54eed7d9..9a867fc8 100644 --- a/client/src/generated/base.ts +++ b/client/src/generated/base.ts @@ -12,12 +12,11 @@ * Do not edit the class manually. */ - -import type { Configuration } from './configuration'; +import type { Configuration } from "./configuration"; // Some imports not used depending on template conditions // @ts-ignore -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; +import globalAxios from "axios"; export const BASE_PATH = "http://localhost:8080".replace(/\/+$/, ""); @@ -26,10 +25,10 @@ export const BASE_PATH = "http://localhost:8080".replace(/\/+$/, ""); * @export */ export const COLLECTION_FORMATS = { - csv: ",", - ssv: " ", - tsv: "\t", - pipes: "|", + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", }; /** @@ -38,8 +37,8 @@ export const COLLECTION_FORMATS = { * @interface RequestArgs */ export interface RequestArgs { - url: string; - options: RawAxiosRequestConfig; + url: string; + options: RawAxiosRequestConfig; } /** @@ -48,15 +47,19 @@ export interface RequestArgs { * @class BaseAPI */ export class BaseAPI { - protected configuration: Configuration | undefined; + protected configuration: Configuration | undefined; - constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) { - if (configuration) { - this.configuration = configuration; - this.basePath = configuration.basePath ?? basePath; - } + constructor( + configuration?: Configuration, + protected basePath: string = BASE_PATH, + protected axios: AxiosInstance = globalAxios, + ) { + if (configuration) { + this.configuration = configuration; + this.basePath = configuration.basePath ?? basePath; } -}; + } +} /** * @@ -65,22 +68,24 @@ export class BaseAPI { * @extends {Error} */ export class RequiredError extends Error { - constructor(public field: string, msg?: string) { - super(msg); - this.name = "RequiredError" - } + constructor( + public field: string, + msg?: string, + ) { + super(msg); + this.name = "RequiredError"; + } } interface ServerMap { - [key: string]: { - url: string, - description: string, - }[]; + [key: string]: { + url: string; + description: string; + }[]; } /** * * @export */ -export const operationServerMap: ServerMap = { -} +export const operationServerMap: ServerMap = {}; diff --git a/client/src/generated/common.ts b/client/src/generated/common.ts index 98bf6297..94df3f8f 100644 --- a/client/src/generated/common.ts +++ b/client/src/generated/common.ts @@ -12,98 +12,132 @@ * Do not edit the class manually. */ - import type { Configuration } from "./configuration"; import type { RequestArgs } from "./base"; -import type { AxiosInstance, AxiosResponse } from 'axios'; +import type { AxiosInstance, AxiosResponse } from "axios"; import { RequiredError } from "./base"; /** * * @export */ -export const DUMMY_BASE_URL = 'https://example.com' +export const DUMMY_BASE_URL = "https://example.com"; /** * * @throws {RequiredError} * @export */ -export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) { - if (paramValue === null || paramValue === undefined) { - throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`); - } -} +export const assertParamExists = function ( + functionName: string, + paramName: string, + paramValue: unknown, +) { + if (paramValue === null || paramValue === undefined) { + throw new RequiredError( + paramName, + `Required parameter ${paramName} was null or undefined when calling ${functionName}.`, + ); + } +}; /** * * @export */ -export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) { - if (configuration && configuration.apiKey) { - const localVarApiKeyValue = typeof configuration.apiKey === 'function' - ? await configuration.apiKey(keyParamName) - : await configuration.apiKey; - object[keyParamName] = localVarApiKeyValue; - } -} +export const setApiKeyToObject = async function ( + object: any, + keyParamName: string, + configuration?: Configuration, +) { + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = + typeof configuration.apiKey === "function" + ? await configuration.apiKey(keyParamName) + : await configuration.apiKey; + object[keyParamName] = localVarApiKeyValue; + } +}; /** * * @export */ -export const setBasicAuthToObject = function (object: any, configuration?: Configuration) { - if (configuration && (configuration.username || configuration.password)) { - object["auth"] = { username: configuration.username, password: configuration.password }; - } -} +export const setBasicAuthToObject = function ( + object: any, + configuration?: Configuration, +) { + if (configuration && (configuration.username || configuration.password)) { + object["auth"] = { + username: configuration.username, + password: configuration.password, + }; + } +}; /** * * @export */ -export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) { - if (configuration && configuration.accessToken) { - const accessToken = typeof configuration.accessToken === 'function' - ? await configuration.accessToken() - : await configuration.accessToken; - object["Authorization"] = "Bearer " + accessToken; - } -} +export const setBearerAuthToObject = async function ( + object: any, + configuration?: Configuration, +) { + if (configuration && configuration.accessToken) { + const accessToken = + typeof configuration.accessToken === "function" + ? await configuration.accessToken() + : await configuration.accessToken; + object["Authorization"] = "Bearer " + accessToken; + } +}; /** * * @export */ -export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) { - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken(name, scopes) - : await configuration.accessToken; - object["Authorization"] = "Bearer " + localVarAccessTokenValue; - } -} +export const setOAuthToObject = async function ( + object: any, + name: string, + scopes: string[], + configuration?: Configuration, +) { + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = + typeof configuration.accessToken === "function" + ? await configuration.accessToken(name, scopes) + : await configuration.accessToken; + object["Authorization"] = "Bearer " + localVarAccessTokenValue; + } +}; -function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void { - if (parameter == null) return; - if (typeof parameter === "object") { - if (Array.isArray(parameter)) { - (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key)); - } - else { - Object.keys(parameter).forEach(currentKey => - setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`) - ); - } - } - else { - if (urlSearchParams.has(key)) { - urlSearchParams.append(key, parameter); - } - else { - urlSearchParams.set(key, parameter); - } +function setFlattenedQueryParams( + urlSearchParams: URLSearchParams, + parameter: any, + key: string = "", +): void { + if (parameter == null) return; + if (typeof parameter === "object") { + if (Array.isArray(parameter)) { + (parameter as any[]).forEach((item) => + setFlattenedQueryParams(urlSearchParams, item, key), + ); + } else { + Object.keys(parameter).forEach((currentKey) => + setFlattenedQueryParams( + urlSearchParams, + parameter[currentKey], + `${key}${key !== "" ? "." : ""}${currentKey}`, + ), + ); + } + } else { + if (urlSearchParams.has(key)) { + urlSearchParams.append(key, parameter); + } else { + urlSearchParams.set(key, parameter); } + } } /** @@ -111,40 +145,58 @@ function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: an * @export */ export const setSearchParams = function (url: URL, ...objects: any[]) { - const searchParams = new URLSearchParams(url.search); - setFlattenedQueryParams(searchParams, objects); - url.search = searchParams.toString(); -} + const searchParams = new URLSearchParams(url.search); + setFlattenedQueryParams(searchParams, objects); + url.search = searchParams.toString(); +}; /** * * @export */ -export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) { - const nonString = typeof value !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(requestOptions.headers['Content-Type']) - : nonString; - return needsSerialization - ? JSON.stringify(value !== undefined ? value : {}) - : (value || ""); -} +export const serializeDataIfNeeded = function ( + value: any, + requestOptions: any, + configuration?: Configuration, +) { + const nonString = typeof value !== "string"; + const needsSerialization = + nonString && configuration && configuration.isJsonMime + ? configuration.isJsonMime(requestOptions.headers["Content-Type"]) + : nonString; + return needsSerialization + ? JSON.stringify(value !== undefined ? value : {}) + : value || ""; +}; /** * * @export */ export const toPathString = function (url: URL) { - return url.pathname + url.search + url.hash -} + return url.pathname + url.search + url.hash; +}; /** * * @export */ -export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { - return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url}; - return axios.request(axiosRequestArgs); +export const createRequestFunction = function ( + axiosArgs: RequestArgs, + globalAxios: AxiosInstance, + BASE_PATH: string, + configuration?: Configuration, +) { + return >( + axios: AxiosInstance = globalAxios, + basePath: string = BASE_PATH, + ) => { + const axiosRequestArgs = { + ...axiosArgs.options, + url: + (axios.defaults.baseURL ? "" : (configuration?.basePath ?? basePath)) + + axiosArgs.url, }; -} + return axios.request(axiosRequestArgs); + }; +}; diff --git a/client/src/generated/configuration.ts b/client/src/generated/configuration.ts index 6ca4f951..48415d50 100644 --- a/client/src/generated/configuration.ts +++ b/client/src/generated/configuration.ts @@ -12,99 +12,121 @@ * Do not edit the class manually. */ - export interface ConfigurationParameters { - apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); - username?: string; - password?: string; - accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); - basePath?: string; - serverIndex?: number; - baseOptions?: any; - formDataCtor?: new () => any; + apiKey?: + | string + | Promise + | ((name: string) => string) + | ((name: string) => Promise); + username?: string; + password?: string; + accessToken?: + | string + | Promise + | ((name?: string, scopes?: string[]) => string) + | ((name?: string, scopes?: string[]) => Promise); + basePath?: string; + serverIndex?: number; + baseOptions?: any; + formDataCtor?: new () => any; } export class Configuration { - /** - * parameter for apiKey security - * @param name security name - * @memberof Configuration - */ - apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); - /** - * parameter for basic security - * - * @type {string} - * @memberof Configuration - */ - username?: string; - /** - * parameter for basic security - * - * @type {string} - * @memberof Configuration - */ - password?: string; - /** - * parameter for oauth2 security - * @param name security name - * @param scopes oauth2 scope - * @memberof Configuration - */ - accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); - /** - * override base path - * - * @type {string} - * @memberof Configuration - */ - basePath?: string; - /** - * override server index - * - * @type {number} - * @memberof Configuration - */ - serverIndex?: number; - /** - * base options for axios calls - * - * @type {any} - * @memberof Configuration - */ - baseOptions?: any; - /** - * The FormData constructor that will be used to create multipart form data - * requests. You can inject this here so that execution environments that - * do not support the FormData class can still run the generated client. - * - * @type {new () => FormData} - */ - formDataCtor?: new () => any; + /** + * parameter for apiKey security + * @param name security name + * @memberof Configuration + */ + apiKey?: + | string + | Promise + | ((name: string) => string) + | ((name: string) => Promise); + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + username?: string; + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + password?: string; + /** + * parameter for oauth2 security + * @param name security name + * @param scopes oauth2 scope + * @memberof Configuration + */ + accessToken?: + | string + | Promise + | ((name?: string, scopes?: string[]) => string) + | ((name?: string, scopes?: string[]) => Promise); + /** + * override base path + * + * @type {string} + * @memberof Configuration + */ + basePath?: string; + /** + * override server index + * + * @type {number} + * @memberof Configuration + */ + serverIndex?: number; + /** + * base options for axios calls + * + * @type {any} + * @memberof Configuration + */ + baseOptions?: any; + /** + * The FormData constructor that will be used to create multipart form data + * requests. You can inject this here so that execution environments that + * do not support the FormData class can still run the generated client. + * + * @type {new () => FormData} + */ + formDataCtor?: new () => any; - constructor(param: ConfigurationParameters = {}) { - this.apiKey = param.apiKey; - this.username = param.username; - this.password = param.password; - this.accessToken = param.accessToken; - this.basePath = param.basePath; - this.serverIndex = param.serverIndex; - this.baseOptions = param.baseOptions; - this.formDataCtor = param.formDataCtor; - } + constructor(param: ConfigurationParameters = {}) { + this.apiKey = param.apiKey; + this.username = param.username; + this.password = param.password; + this.accessToken = param.accessToken; + this.basePath = param.basePath; + this.serverIndex = param.serverIndex; + this.baseOptions = param.baseOptions; + this.formDataCtor = param.formDataCtor; + } - /** - * Check if the given MIME is a JSON MIME. - * JSON MIME examples: - * application/json - * application/json; charset=UTF8 - * APPLICATION/JSON - * application/vnd.company+json - * @param mime - MIME (Multipurpose Internet Mail Extensions) - * @return True if the given MIME is JSON, false otherwise. - */ - public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); - } + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp( + "^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$", + "i", + ); + return ( + mime !== null && + (jsonMime.test(mime) || + mime.toLowerCase() === "application/json-patch+json") + ); + } } diff --git a/client/src/generated/index.ts b/client/src/generated/index.ts index 939130d1..da6703df 100644 --- a/client/src/generated/index.ts +++ b/client/src/generated/index.ts @@ -12,7 +12,6 @@ * Do not edit the class manually. */ - export * from "./api"; export * from "./configuration"; export * from "./model"; diff --git a/client/src/generated/model/basic-material.ts b/client/src/generated/model/basic-material.ts index 5ef08d21..b3df3d7f 100644 --- a/client/src/generated/model/basic-material.ts +++ b/client/src/generated/model/basic-material.ts @@ -12,19 +12,16 @@ * Do not edit the class manually. */ - - /** - * + * * @export * @interface BasicMaterial */ export interface BasicMaterial { - /** - * - * @type {string} - * @memberof BasicMaterial - */ - 'basic_material': string; + /** + * + * @type {string} + * @memberof BasicMaterial + */ + basic_material: string; } - diff --git a/client/src/generated/model/client-error.ts b/client/src/generated/model/client-error.ts index 00a74ee7..46a4da70 100644 --- a/client/src/generated/model/client-error.ts +++ b/client/src/generated/model/client-error.ts @@ -12,25 +12,22 @@ * Do not edit the class manually. */ - - /** - * + * * @export * @interface ClientError */ export interface ClientError { - /** - * Error description - * @type {string} - * @memberof ClientError - */ - 'message': string; - /** - * Exception stack trace - * @type {string} - * @memberof ClientError - */ - 'cause'?: string; + /** + * Error description + * @type {string} + * @memberof ClientError + */ + message: string; + /** + * Exception stack trace + * @type {string} + * @memberof ClientError + */ + cause?: string; } - diff --git a/client/src/generated/model/country.ts b/client/src/generated/model/country.ts index 233ac79f..be09f105 100644 --- a/client/src/generated/model/country.ts +++ b/client/src/generated/model/country.ts @@ -12,19 +12,16 @@ * Do not edit the class manually. */ - - /** - * + * * @export * @interface Country */ export interface Country { - /** - * - * @type {string} - * @memberof Country - */ - 'country': string; + /** + * + * @type {string} + * @memberof Country + */ + country: string; } - diff --git a/client/src/generated/model/create-instrument-request-body.ts b/client/src/generated/model/create-instrument-request-body.ts index b8669886..0fe3181f 100644 --- a/client/src/generated/model/create-instrument-request-body.ts +++ b/client/src/generated/model/create-instrument-request-body.ts @@ -12,31 +12,29 @@ * Do not edit the class manually. */ - // May contain unused imports in some cases // @ts-ignore -import type { InstrumentDetailWithoutId } from './instrument-detail-without-id'; +import type { InstrumentDetailWithoutId } from "./instrument-detail-without-id"; // May contain unused imports in some cases // @ts-ignore -import type { InstrumentPhoto } from './instrument-photo'; +import type { InstrumentPhoto } from "./instrument-photo"; /** - * + * * @export * @interface CreateInstrumentRequestBody */ export interface CreateInstrumentRequestBody { - /** - * - * @type {InstrumentDetailWithoutId} - * @memberof CreateInstrumentRequestBody - */ - 'instrument_detail': InstrumentDetailWithoutId; - /** - * - * @type {InstrumentPhoto} - * @memberof CreateInstrumentRequestBody - */ - 'instrument_photo': InstrumentPhoto; + /** + * + * @type {InstrumentDetailWithoutId} + * @memberof CreateInstrumentRequestBody + */ + instrument_detail: InstrumentDetailWithoutId; + /** + * + * @type {InstrumentPhoto} + * @memberof CreateInstrumentRequestBody + */ + instrument_photo: InstrumentPhoto; } - diff --git a/client/src/generated/model/edit-instrument-request-body.ts b/client/src/generated/model/edit-instrument-request-body.ts index 27dc3b59..83379b48 100644 --- a/client/src/generated/model/edit-instrument-request-body.ts +++ b/client/src/generated/model/edit-instrument-request-body.ts @@ -12,31 +12,29 @@ * Do not edit the class manually. */ - // May contain unused imports in some cases // @ts-ignore -import type { InstrumentDetail } from './instrument-detail'; +import type { InstrumentDetail } from "./instrument-detail"; // May contain unused imports in some cases // @ts-ignore -import type { InstrumentPhoto } from './instrument-photo'; +import type { InstrumentPhoto } from "./instrument-photo"; /** - * + * * @export * @interface EditInstrumentRequestBody */ export interface EditInstrumentRequestBody { - /** - * - * @type {InstrumentDetail} - * @memberof EditInstrumentRequestBody - */ - 'instrument_detail': InstrumentDetail; - /** - * - * @type {InstrumentPhoto} - * @memberof EditInstrumentRequestBody - */ - 'instrument_photo': InstrumentPhoto; + /** + * + * @type {InstrumentDetail} + * @memberof EditInstrumentRequestBody + */ + instrument_detail: InstrumentDetail; + /** + * + * @type {InstrumentPhoto} + * @memberof EditInstrumentRequestBody + */ + instrument_photo: InstrumentPhoto; } - diff --git a/client/src/generated/model/get-countries-response.ts b/client/src/generated/model/get-countries-response.ts index 1f4c4320..3dc7b9bf 100644 --- a/client/src/generated/model/get-countries-response.ts +++ b/client/src/generated/model/get-countries-response.ts @@ -12,22 +12,20 @@ * Do not edit the class manually. */ - // May contain unused imports in some cases // @ts-ignore -import type { Country } from './country'; +import type { Country } from "./country"; /** - * + * * @export * @interface GetCountriesResponse */ export interface GetCountriesResponse { - /** - * - * @type {Array} - * @memberof GetCountriesResponse - */ - 'content': Array; + /** + * + * @type {Array} + * @memberof GetCountriesResponse + */ + content: Array; } - diff --git a/client/src/generated/model/get-instrument-basic-materials-response.ts b/client/src/generated/model/get-instrument-basic-materials-response.ts index f13547bd..1bc90b4f 100644 --- a/client/src/generated/model/get-instrument-basic-materials-response.ts +++ b/client/src/generated/model/get-instrument-basic-materials-response.ts @@ -12,22 +12,20 @@ * Do not edit the class manually. */ - // May contain unused imports in some cases // @ts-ignore -import type { BasicMaterial } from './basic-material'; +import type { BasicMaterial } from "./basic-material"; /** - * + * * @export * @interface GetInstrumentBasicMaterialsResponse */ export interface GetInstrumentBasicMaterialsResponse { - /** - * - * @type {Array} - * @memberof GetInstrumentBasicMaterialsResponse - */ - 'content': Array; + /** + * + * @type {Array} + * @memberof GetInstrumentBasicMaterialsResponse + */ + content: Array; } - diff --git a/client/src/generated/model/get-instrument-by-criteria-page-response.ts b/client/src/generated/model/get-instrument-by-criteria-page-response.ts index c8b9b3b4..c0d97270 100644 --- a/client/src/generated/model/get-instrument-by-criteria-page-response.ts +++ b/client/src/generated/model/get-instrument-by-criteria-page-response.ts @@ -12,52 +12,50 @@ * Do not edit the class manually. */ - // May contain unused imports in some cases // @ts-ignore -import type { InstrumentDetail } from './instrument-detail'; +import type { InstrumentDetail } from "./instrument-detail"; /** - * + * * @export * @interface GetInstrumentByCriteriaPageResponse */ export interface GetInstrumentByCriteriaPageResponse { - /** - * - * @type {Array} - * @memberof GetInstrumentByCriteriaPageResponse - */ - 'content': Array; - /** - * The number of items in the content. - * @type {number} - * @memberof GetInstrumentByCriteriaPageResponse - */ - 'content_size': number; - /** - * The number of items per page. - * @type {number} - * @memberof GetInstrumentByCriteriaPageResponse - */ - 'page_size': number; - /** - * The current page number (0-based index). - * @type {number} - * @memberof GetInstrumentByCriteriaPageResponse - */ - 'page_number': number; - /** - * The total number of elements across all pages. - * @type {number} - * @memberof GetInstrumentByCriteriaPageResponse - */ - 'total_elements': number; - /** - * The total number of pages. - * @type {number} - * @memberof GetInstrumentByCriteriaPageResponse - */ - 'total_pages': number; + /** + * + * @type {Array} + * @memberof GetInstrumentByCriteriaPageResponse + */ + content: Array; + /** + * The number of items in the content. + * @type {number} + * @memberof GetInstrumentByCriteriaPageResponse + */ + content_size: number; + /** + * The number of items per page. + * @type {number} + * @memberof GetInstrumentByCriteriaPageResponse + */ + page_size: number; + /** + * The current page number (0-based index). + * @type {number} + * @memberof GetInstrumentByCriteriaPageResponse + */ + page_number: number; + /** + * The total number of elements across all pages. + * @type {number} + * @memberof GetInstrumentByCriteriaPageResponse + */ + total_elements: number; + /** + * The total number of pages. + * @type {number} + * @memberof GetInstrumentByCriteriaPageResponse + */ + total_pages: number; } - diff --git a/client/src/generated/model/get-instrument-types-response.ts b/client/src/generated/model/get-instrument-types-response.ts index 70d546a0..3f6ab90f 100644 --- a/client/src/generated/model/get-instrument-types-response.ts +++ b/client/src/generated/model/get-instrument-types-response.ts @@ -12,22 +12,20 @@ * Do not edit the class manually. */ - // May contain unused imports in some cases // @ts-ignore -import type { InstrumentType } from './instrument-type'; +import type { InstrumentType } from "./instrument-type"; /** - * + * * @export * @interface GetInstrumentTypesResponse */ export interface GetInstrumentTypesResponse { - /** - * - * @type {Array} - * @memberof GetInstrumentTypesResponse - */ - 'content': Array; + /** + * + * @type {Array} + * @memberof GetInstrumentTypesResponse + */ + content: Array; } - diff --git a/client/src/generated/model/get-instruments-by-criteria-request-body.ts b/client/src/generated/model/get-instruments-by-criteria-request-body.ts index 8bc4d84d..6f0c0172 100644 --- a/client/src/generated/model/get-instruments-by-criteria-request-body.ts +++ b/client/src/generated/model/get-instruments-by-criteria-request-body.ts @@ -12,97 +12,95 @@ * Do not edit the class manually. */ - // May contain unused imports in some cases // @ts-ignore -import type { BasicMaterial } from './basic-material'; +import type { BasicMaterial } from "./basic-material"; // May contain unused imports in some cases // @ts-ignore -import type { Country } from './country'; +import type { Country } from "./country"; // May contain unused imports in some cases // @ts-ignore -import type { InstrumentId } from './instrument-id'; +import type { InstrumentId } from "./instrument-id"; // May contain unused imports in some cases // @ts-ignore -import type { InstrumentName } from './instrument-name'; +import type { InstrumentName } from "./instrument-name"; // May contain unused imports in some cases // @ts-ignore -import type { InstrumentType } from './instrument-type'; +import type { InstrumentType } from "./instrument-type"; // May contain unused imports in some cases // @ts-ignore -import type { ManufactureDate } from './manufacture-date'; +import type { ManufactureDate } from "./manufacture-date"; // May contain unused imports in some cases // @ts-ignore -import type { ManufacturerName } from './manufacturer-name'; +import type { ManufacturerName } from "./manufacturer-name"; // May contain unused imports in some cases // @ts-ignore -import type { ReleaseDate } from './release-date'; +import type { ReleaseDate } from "./release-date"; /** - * + * * @export * @interface GetInstrumentsByCriteriaRequestBody */ export interface GetInstrumentsByCriteriaRequestBody { - /** - * - * @type {InstrumentName} - * @memberof GetInstrumentsByCriteriaRequestBody - */ - 'instrument_name'?: InstrumentName | null; - /** - * - * @type {Array} - * @memberof GetInstrumentsByCriteriaRequestBody - */ - 'instrument_types'?: Array | null; - /** - * - * @type {Array} - * @memberof GetInstrumentsByCriteriaRequestBody - */ - 'manufacturer_names'?: Array | null; - /** - * - * @type {ManufactureDate} - * @memberof GetInstrumentsByCriteriaRequestBody - */ - 'manufacture_date_from'?: ManufactureDate | null; - /** - * - * @type {ManufactureDate} - * @memberof GetInstrumentsByCriteriaRequestBody - */ - 'manufacture_date_to'?: ManufactureDate | null; - /** - * - * @type {ReleaseDate} - * @memberof GetInstrumentsByCriteriaRequestBody - */ - 'release_date_from'?: ReleaseDate | null; - /** - * - * @type {ReleaseDate} - * @memberof GetInstrumentsByCriteriaRequestBody - */ - 'release_date_to'?: ReleaseDate | null; - /** - * - * @type {Array} - * @memberof GetInstrumentsByCriteriaRequestBody - */ - 'countries'?: Array | null; - /** - * - * @type {Array} - * @memberof GetInstrumentsByCriteriaRequestBody - */ - 'materials'?: Array | null; - /** - * - * @type {Array} - * @memberof GetInstrumentsByCriteriaRequestBody - */ - 'instrument_ids'?: Array | null; + /** + * + * @type {InstrumentName} + * @memberof GetInstrumentsByCriteriaRequestBody + */ + instrument_name?: InstrumentName | null; + /** + * + * @type {Array} + * @memberof GetInstrumentsByCriteriaRequestBody + */ + instrument_types?: Array | null; + /** + * + * @type {Array} + * @memberof GetInstrumentsByCriteriaRequestBody + */ + manufacturer_names?: Array | null; + /** + * + * @type {ManufactureDate} + * @memberof GetInstrumentsByCriteriaRequestBody + */ + manufacture_date_from?: ManufactureDate | null; + /** + * + * @type {ManufactureDate} + * @memberof GetInstrumentsByCriteriaRequestBody + */ + manufacture_date_to?: ManufactureDate | null; + /** + * + * @type {ReleaseDate} + * @memberof GetInstrumentsByCriteriaRequestBody + */ + release_date_from?: ReleaseDate | null; + /** + * + * @type {ReleaseDate} + * @memberof GetInstrumentsByCriteriaRequestBody + */ + release_date_to?: ReleaseDate | null; + /** + * + * @type {Array} + * @memberof GetInstrumentsByCriteriaRequestBody + */ + countries?: Array | null; + /** + * + * @type {Array} + * @memberof GetInstrumentsByCriteriaRequestBody + */ + materials?: Array | null; + /** + * + * @type {Array} + * @memberof GetInstrumentsByCriteriaRequestBody + */ + instrument_ids?: Array | null; } - diff --git a/client/src/generated/model/get-instruments-by-criteria-response.ts b/client/src/generated/model/get-instruments-by-criteria-response.ts index 65fcebca..cd935e4e 100644 --- a/client/src/generated/model/get-instruments-by-criteria-response.ts +++ b/client/src/generated/model/get-instruments-by-criteria-response.ts @@ -12,22 +12,20 @@ * Do not edit the class manually. */ - // May contain unused imports in some cases // @ts-ignore -import type { InstrumentDetail } from './instrument-detail'; +import type { InstrumentDetail } from "./instrument-detail"; /** - * + * * @export * @interface GetInstrumentsByCriteriaResponse */ export interface GetInstrumentsByCriteriaResponse { - /** - * - * @type {Array} - * @memberof GetInstrumentsByCriteriaResponse - */ - 'content': Array; + /** + * + * @type {Array} + * @memberof GetInstrumentsByCriteriaResponse + */ + content: Array; } - diff --git a/client/src/generated/model/get-manufacturers-response.ts b/client/src/generated/model/get-manufacturers-response.ts index 63551326..225b73b6 100644 --- a/client/src/generated/model/get-manufacturers-response.ts +++ b/client/src/generated/model/get-manufacturers-response.ts @@ -12,22 +12,20 @@ * Do not edit the class manually. */ - // May contain unused imports in some cases // @ts-ignore -import type { Manufacturer } from './manufacturer'; +import type { Manufacturer } from "./manufacturer"; /** - * + * * @export * @interface GetManufacturersResponse */ export interface GetManufacturersResponse { - /** - * - * @type {Array} - * @memberof GetManufacturersResponse - */ - 'content': Array; + /** + * + * @type {Array} + * @memberof GetManufacturersResponse + */ + content: Array; } - diff --git a/client/src/generated/model/index.ts b/client/src/generated/model/index.ts index 414b451a..0b0ad53d 100644 --- a/client/src/generated/model/index.ts +++ b/client/src/generated/model/index.ts @@ -1,28 +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'; +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/instrument-detail-without-id.ts b/client/src/generated/model/instrument-detail-without-id.ts index 34c5e19f..673af7bc 100644 --- a/client/src/generated/model/instrument-detail-without-id.ts +++ b/client/src/generated/model/instrument-detail-without-id.ts @@ -12,76 +12,74 @@ * Do not edit the class manually. */ - // May contain unused imports in some cases // @ts-ignore -import type { BasicMaterial } from './basic-material'; +import type { BasicMaterial } from "./basic-material"; // May contain unused imports in some cases // @ts-ignore -import type { Country } from './country'; +import type { Country } from "./country"; // May contain unused imports in some cases // @ts-ignore -import type { InstrumentName } from './instrument-name'; +import type { InstrumentName } from "./instrument-name"; // May contain unused imports in some cases // @ts-ignore -import type { InstrumentType } from './instrument-type'; +import type { InstrumentType } from "./instrument-type"; // May contain unused imports in some cases // @ts-ignore -import type { ManufactureDate } from './manufacture-date'; +import type { ManufactureDate } from "./manufacture-date"; // May contain unused imports in some cases // @ts-ignore -import type { ManufacturerName } from './manufacturer-name'; +import type { ManufacturerName } from "./manufacturer-name"; // May contain unused imports in some cases // @ts-ignore -import type { ReleaseDate } from './release-date'; +import type { ReleaseDate } from "./release-date"; /** - * + * * @export * @interface InstrumentDetailWithoutId */ export interface InstrumentDetailWithoutId { - /** - * - * @type {InstrumentName} - * @memberof InstrumentDetailWithoutId - */ - 'instrument_name': InstrumentName; - /** - * - * @type {InstrumentType} - * @memberof InstrumentDetailWithoutId - */ - 'instrument_type': InstrumentType; - /** - * - * @type {ManufacturerName} - * @memberof InstrumentDetailWithoutId - */ - 'manufacturer_name': ManufacturerName; - /** - * - * @type {ManufactureDate} - * @memberof InstrumentDetailWithoutId - */ - 'manufacturer_date': ManufactureDate; - /** - * - * @type {ReleaseDate} - * @memberof InstrumentDetailWithoutId - */ - 'release_date': ReleaseDate; - /** - * - * @type {Country} - * @memberof InstrumentDetailWithoutId - */ - 'country': Country; - /** - * - * @type {Array} - * @memberof InstrumentDetailWithoutId - */ - 'basic_materials': Array; + /** + * + * @type {InstrumentName} + * @memberof InstrumentDetailWithoutId + */ + instrument_name: InstrumentName; + /** + * + * @type {InstrumentType} + * @memberof InstrumentDetailWithoutId + */ + instrument_type: InstrumentType; + /** + * + * @type {ManufacturerName} + * @memberof InstrumentDetailWithoutId + */ + manufacturer_name: ManufacturerName; + /** + * + * @type {ManufactureDate} + * @memberof InstrumentDetailWithoutId + */ + manufacturer_date: ManufactureDate; + /** + * + * @type {ReleaseDate} + * @memberof InstrumentDetailWithoutId + */ + release_date: ReleaseDate; + /** + * + * @type {Country} + * @memberof InstrumentDetailWithoutId + */ + country: Country; + /** + * + * @type {Array} + * @memberof InstrumentDetailWithoutId + */ + basic_materials: Array; } - diff --git a/client/src/generated/model/instrument-detail.ts b/client/src/generated/model/instrument-detail.ts index e5d366fe..4cecebcd 100644 --- a/client/src/generated/model/instrument-detail.ts +++ b/client/src/generated/model/instrument-detail.ts @@ -12,85 +12,83 @@ * Do not edit the class manually. */ - // May contain unused imports in some cases // @ts-ignore -import type { BasicMaterial } from './basic-material'; +import type { BasicMaterial } from "./basic-material"; // May contain unused imports in some cases // @ts-ignore -import type { Country } from './country'; +import type { Country } from "./country"; // May contain unused imports in some cases // @ts-ignore -import type { InstrumentId } from './instrument-id'; +import type { InstrumentId } from "./instrument-id"; // May contain unused imports in some cases // @ts-ignore -import type { InstrumentName } from './instrument-name'; +import type { InstrumentName } from "./instrument-name"; // May contain unused imports in some cases // @ts-ignore -import type { InstrumentType } from './instrument-type'; +import type { InstrumentType } from "./instrument-type"; // May contain unused imports in some cases // @ts-ignore -import type { ManufactureDate } from './manufacture-date'; +import type { ManufactureDate } from "./manufacture-date"; // May contain unused imports in some cases // @ts-ignore -import type { ManufacturerName } from './manufacturer-name'; +import type { ManufacturerName } from "./manufacturer-name"; // May contain unused imports in some cases // @ts-ignore -import type { ReleaseDate } from './release-date'; +import type { ReleaseDate } from "./release-date"; /** - * + * * @export * @interface InstrumentDetail */ export interface InstrumentDetail { - /** - * - * @type {InstrumentId} - * @memberof InstrumentDetail - */ - 'instrument_id': InstrumentId; - /** - * - * @type {InstrumentName} - * @memberof InstrumentDetail - */ - 'instrument_name': InstrumentName; - /** - * - * @type {InstrumentType} - * @memberof InstrumentDetail - */ - 'instrument_type': InstrumentType; - /** - * - * @type {ManufacturerName} - * @memberof InstrumentDetail - */ - 'manufacturer_name': ManufacturerName; - /** - * - * @type {ManufactureDate} - * @memberof InstrumentDetail - */ - 'manufacturer_date': ManufactureDate; - /** - * - * @type {ReleaseDate} - * @memberof InstrumentDetail - */ - 'release_date': ReleaseDate; - /** - * - * @type {Country} - * @memberof InstrumentDetail - */ - 'country': Country; - /** - * - * @type {Array} - * @memberof InstrumentDetail - */ - 'basic_materials': Array; + /** + * + * @type {InstrumentId} + * @memberof InstrumentDetail + */ + instrument_id: InstrumentId; + /** + * + * @type {InstrumentName} + * @memberof InstrumentDetail + */ + instrument_name: InstrumentName; + /** + * + * @type {InstrumentType} + * @memberof InstrumentDetail + */ + instrument_type: InstrumentType; + /** + * + * @type {ManufacturerName} + * @memberof InstrumentDetail + */ + manufacturer_name: ManufacturerName; + /** + * + * @type {ManufactureDate} + * @memberof InstrumentDetail + */ + manufacturer_date: ManufactureDate; + /** + * + * @type {ReleaseDate} + * @memberof InstrumentDetail + */ + release_date: ReleaseDate; + /** + * + * @type {Country} + * @memberof InstrumentDetail + */ + country: Country; + /** + * + * @type {Array} + * @memberof InstrumentDetail + */ + basic_materials: Array; } - diff --git a/client/src/generated/model/instrument-id.ts b/client/src/generated/model/instrument-id.ts index 7d959a92..316ae6a4 100644 --- a/client/src/generated/model/instrument-id.ts +++ b/client/src/generated/model/instrument-id.ts @@ -12,19 +12,16 @@ * Do not edit the class manually. */ - - /** - * + * * @export * @interface InstrumentId */ export interface InstrumentId { - /** - * - * @type {number} - * @memberof InstrumentId - */ - 'instrument_id': number; + /** + * + * @type {number} + * @memberof InstrumentId + */ + instrument_id: number; } - diff --git a/client/src/generated/model/instrument-name.ts b/client/src/generated/model/instrument-name.ts index 834c471d..3c2d867f 100644 --- a/client/src/generated/model/instrument-name.ts +++ b/client/src/generated/model/instrument-name.ts @@ -12,19 +12,16 @@ * Do not edit the class manually. */ - - /** - * + * * @export * @interface InstrumentName */ export interface InstrumentName { - /** - * - * @type {string} - * @memberof InstrumentName - */ - 'instrument_name': string; + /** + * + * @type {string} + * @memberof InstrumentName + */ + instrument_name: string; } - diff --git a/client/src/generated/model/instrument-photo.ts b/client/src/generated/model/instrument-photo.ts index 3319e164..d90176c5 100644 --- a/client/src/generated/model/instrument-photo.ts +++ b/client/src/generated/model/instrument-photo.ts @@ -12,19 +12,16 @@ * Do not edit the class manually. */ - - /** - * + * * @export * @interface InstrumentPhoto */ export interface InstrumentPhoto { - /** - * - * @type {string} - * @memberof InstrumentPhoto - */ - 'photo': string; + /** + * + * @type {string} + * @memberof InstrumentPhoto + */ + photo: string; } - diff --git a/client/src/generated/model/instrument-type.ts b/client/src/generated/model/instrument-type.ts index 28f7f450..edbd5b2e 100644 --- a/client/src/generated/model/instrument-type.ts +++ b/client/src/generated/model/instrument-type.ts @@ -12,19 +12,16 @@ * Do not edit the class manually. */ - - /** - * + * * @export * @interface InstrumentType */ export interface InstrumentType { - /** - * - * @type {string} - * @memberof InstrumentType - */ - 'instrument_type': string; + /** + * + * @type {string} + * @memberof InstrumentType + */ + instrument_type: string; } - diff --git a/client/src/generated/model/jwt-response.ts b/client/src/generated/model/jwt-response.ts index b6736eb4..26a7bd55 100644 --- a/client/src/generated/model/jwt-response.ts +++ b/client/src/generated/model/jwt-response.ts @@ -12,19 +12,16 @@ * Do not edit the class manually. */ - - /** - * + * * @export * @interface JwtResponse */ export interface JwtResponse { - /** - * - * @type {string} - * @memberof JwtResponse - */ - 'jwt': string; + /** + * + * @type {string} + * @memberof JwtResponse + */ + jwt: string; } - diff --git a/client/src/generated/model/list-favorite-response.ts b/client/src/generated/model/list-favorite-response.ts index 6d70a76f..43c831e0 100644 --- a/client/src/generated/model/list-favorite-response.ts +++ b/client/src/generated/model/list-favorite-response.ts @@ -12,22 +12,20 @@ * Do not edit the class manually. */ - // May contain unused imports in some cases // @ts-ignore -import type { InstrumentDetail } from './instrument-detail'; +import type { InstrumentDetail } from "./instrument-detail"; /** - * + * * @export * @interface ListFavoriteResponse */ export interface ListFavoriteResponse { - /** - * - * @type {Array} - * @memberof ListFavoriteResponse - */ - 'content': Array; + /** + * + * @type {Array} + * @memberof ListFavoriteResponse + */ + content: Array; } - diff --git a/client/src/generated/model/manufacture-date.ts b/client/src/generated/model/manufacture-date.ts index 18e02201..7cb47e3e 100644 --- a/client/src/generated/model/manufacture-date.ts +++ b/client/src/generated/model/manufacture-date.ts @@ -12,19 +12,16 @@ * Do not edit the class manually. */ - - /** - * + * * @export * @interface ManufactureDate */ export interface ManufactureDate { - /** - * - * @type {string} - * @memberof ManufactureDate - */ - 'manufacture_date': string; + /** + * + * @type {string} + * @memberof ManufactureDate + */ + manufacture_date: string; } - diff --git a/client/src/generated/model/manufacturer-name.ts b/client/src/generated/model/manufacturer-name.ts index 1bdfe751..3907cf53 100644 --- a/client/src/generated/model/manufacturer-name.ts +++ b/client/src/generated/model/manufacturer-name.ts @@ -12,19 +12,16 @@ * Do not edit the class manually. */ - - /** - * + * * @export * @interface ManufacturerName */ export interface ManufacturerName { - /** - * - * @type {string} - * @memberof ManufacturerName - */ - 'manufacturer_name': string; + /** + * + * @type {string} + * @memberof ManufacturerName + */ + manufacturer_name: string; } - diff --git a/client/src/generated/model/manufacturer.ts b/client/src/generated/model/manufacturer.ts index 1b8ed8bc..b6e5b236 100644 --- a/client/src/generated/model/manufacturer.ts +++ b/client/src/generated/model/manufacturer.ts @@ -12,19 +12,16 @@ * Do not edit the class manually. */ - - /** - * + * * @export * @interface Manufacturer */ export interface Manufacturer { - /** - * - * @type {string} - * @memberof Manufacturer - */ - 'manufacturer': string; + /** + * + * @type {string} + * @memberof Manufacturer + */ + manufacturer: string; } - diff --git a/client/src/generated/model/profile-details.ts b/client/src/generated/model/profile-details.ts index 2b7ce67e..f2b06f9c 100644 --- a/client/src/generated/model/profile-details.ts +++ b/client/src/generated/model/profile-details.ts @@ -12,31 +12,28 @@ * Do not edit the class manually. */ - - /** - * + * * @export * @interface ProfileDetails */ export interface ProfileDetails { - /** - * - * @type {string} - * @memberof ProfileDetails - */ - 'username': string; - /** - * - * @type {string} - * @memberof ProfileDetails - */ - 'role': string; - /** - * - * @type {string} - * @memberof ProfileDetails - */ - 'full_name': string; + /** + * + * @type {string} + * @memberof ProfileDetails + */ + username: string; + /** + * + * @type {string} + * @memberof ProfileDetails + */ + role: string; + /** + * + * @type {string} + * @memberof ProfileDetails + */ + full_name: string; } - diff --git a/client/src/generated/model/registration-request.ts b/client/src/generated/model/registration-request.ts index 8b0b3a84..c950674a 100644 --- a/client/src/generated/model/registration-request.ts +++ b/client/src/generated/model/registration-request.ts @@ -12,31 +12,28 @@ * Do not edit the class manually. */ - - /** - * + * * @export * @interface RegistrationRequest */ export interface RegistrationRequest { - /** - * - * @type {string} - * @memberof RegistrationRequest - */ - 'full_name': string; - /** - * - * @type {string} - * @memberof RegistrationRequest - */ - 'login': string; - /** - * - * @type {string} - * @memberof RegistrationRequest - */ - 'password': string; + /** + * + * @type {string} + * @memberof RegistrationRequest + */ + full_name: string; + /** + * + * @type {string} + * @memberof RegistrationRequest + */ + login: string; + /** + * + * @type {string} + * @memberof RegistrationRequest + */ + password: string; } - diff --git a/client/src/generated/model/release-date.ts b/client/src/generated/model/release-date.ts index 67015ab4..91560f8b 100644 --- a/client/src/generated/model/release-date.ts +++ b/client/src/generated/model/release-date.ts @@ -12,19 +12,16 @@ * Do not edit the class manually. */ - - /** - * + * * @export * @interface ReleaseDate */ export interface ReleaseDate { - /** - * - * @type {string} - * @memberof ReleaseDate - */ - 'release_date': string; + /** + * + * @type {string} + * @memberof ReleaseDate + */ + release_date: string; } - diff --git a/client/src/generated/model/server-error.ts b/client/src/generated/model/server-error.ts index 89e21d00..bad8ada1 100644 --- a/client/src/generated/model/server-error.ts +++ b/client/src/generated/model/server-error.ts @@ -12,25 +12,22 @@ * Do not edit the class manually. */ - - /** - * + * * @export * @interface ServerError */ export interface ServerError { - /** - * A description of the error - * @type {string} - * @memberof ServerError - */ - 'message'?: string; - /** - * Exception stack trace - * @type {string} - * @memberof ServerError - */ - 'cause'?: string; + /** + * A description of the error + * @type {string} + * @memberof ServerError + */ + message?: string; + /** + * Exception stack trace + * @type {string} + * @memberof ServerError + */ + cause?: string; } - diff --git a/client/src/generated/model/username-and-password-request-body.ts b/client/src/generated/model/username-and-password-request-body.ts index 4e627cb0..4e9cf8a7 100644 --- a/client/src/generated/model/username-and-password-request-body.ts +++ b/client/src/generated/model/username-and-password-request-body.ts @@ -12,25 +12,22 @@ * Do not edit the class manually. */ - - /** - * + * * @export * @interface UsernameAndPasswordRequestBody */ export interface UsernameAndPasswordRequestBody { - /** - * - * @type {string} - * @memberof UsernameAndPasswordRequestBody - */ - 'username': string; - /** - * - * @type {string} - * @memberof UsernameAndPasswordRequestBody - */ - 'password': string; + /** + * + * @type {string} + * @memberof UsernameAndPasswordRequestBody + */ + username: string; + /** + * + * @type {string} + * @memberof UsernameAndPasswordRequestBody + */ + password: string; } - diff --git a/client/src/pages/create-instrument/api/loader.ts b/client/src/pages/create-instrument/api/loader.ts index 5cf03cba..85e3108d 100644 --- a/client/src/pages/create-instrument/api/loader.ts +++ b/client/src/pages/create-instrument/api/loader.ts @@ -12,7 +12,9 @@ import { GetManufacturersApi } from "generated/api"; import { apiConfig } from "shared/config/api"; const getInstrumentTypes = new GetInstrumentTypesApi(apiConfig); -const getInstrumentBasicMaterials = new GetInstrumentBasicMaterialsApi(apiConfig); +const getInstrumentBasicMaterials = new GetInstrumentBasicMaterialsApi( + apiConfig, +); const getCountries = new GetCountriesApi(apiConfig); const getManufacturers = new GetManufacturersApi(apiConfig); diff --git a/client/src/pages/edit-instrument/api/loader.ts b/client/src/pages/edit-instrument/api/loader.ts index ae466ccd..f4f56b0d 100644 --- a/client/src/pages/edit-instrument/api/loader.ts +++ b/client/src/pages/edit-instrument/api/loader.ts @@ -17,7 +17,9 @@ import { apiConfig } from "shared/config/api"; const getInstrumentById = new GetInstrumentByIdApi(apiConfig); const getInstrumentTypes = new GetInstrumentTypesApi(apiConfig); -const getInstrumentBasicMaterials = new GetInstrumentBasicMaterialsApi(apiConfig); +const getInstrumentBasicMaterials = new GetInstrumentBasicMaterialsApi( + apiConfig, +); const getCountries = new GetCountriesApi(apiConfig); const getManufacturers = new GetManufacturersApi(apiConfig); const getInstrumentPhoto = new GetInstrumentPhotoApi(apiConfig); diff --git a/openapi/openapi.yml b/openapi/openapi.yml index d5ca3414..d789a70a 100644 --- a/openapi/openapi.yml +++ b/openapi/openapi.yml @@ -11,10 +11,10 @@ servers: description: Local server (uses local data) variables: port: - default: '8080' + default: "8080" enum: - - '8080' - - '8000' + - "8080" + - "8000" tags: - name: getCountries description: Get Countries @@ -79,24 +79,24 @@ paths: tags: - getCountries responses: - '200': + "200": description: Country content: application/json: schema: - $ref: '#/components/schemas/GetCountriesResponse' - '400': + $ref: "#/components/schemas/GetCountriesResponse" + "400": description: Client Error content: application/json: schema: - $ref: '#/components/schemas/ClientError' + $ref: "#/components/schemas/ClientError" default: description: Server Error content: application/json: schema: - $ref: '#/components/schemas/ServerError' + $ref: "#/components/schemas/ServerError" /api/favorite/add: post: description: Add Favorite @@ -108,27 +108,27 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/InstrumentId' + $ref: "#/components/schemas/InstrumentId" required: true responses: - '200': + "200": description: Instrument Details content: application/json: schema: type: object - '400': + "400": description: Client Error content: application/json: schema: - $ref: '#/components/schemas/ClientError' + $ref: "#/components/schemas/ClientError" default: description: server error content: application/json: schema: - $ref: '#/components/schemas/ServerError' + $ref: "#/components/schemas/ServerError" /api/favorite/list: get: description: List Favorite @@ -137,24 +137,24 @@ paths: tags: - listFavorite responses: - '200': + "200": description: Instrument Details content: application/json: schema: - $ref: '#/components/schemas/ListFavoriteResponse' - '400': + $ref: "#/components/schemas/ListFavoriteResponse" + "400": description: Client Error content: application/json: schema: - $ref: '#/components/schemas/ClientError' + $ref: "#/components/schemas/ClientError" default: description: server error content: application/json: schema: - $ref: '#/components/schemas/ServerError' + $ref: "#/components/schemas/ServerError" /api/favorite/remove: post: description: Remove Favorite @@ -166,27 +166,27 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/InstrumentId' + $ref: "#/components/schemas/InstrumentId" required: true responses: - '200': + "200": description: Instrument Details content: application/json: schema: type: object - '400': + "400": description: Client Error content: application/json: schema: - $ref: '#/components/schemas/ClientError' + $ref: "#/components/schemas/ClientError" default: description: server error content: application/json: schema: - $ref: '#/components/schemas/ServerError' + $ref: "#/components/schemas/ServerError" /api/instrument/create: post: description: Create Instrument @@ -198,27 +198,27 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/CreateInstrumentRequestBody' + $ref: "#/components/schemas/CreateInstrumentRequestBody" required: true responses: - '200': + "200": description: Instrument Types content: application/json: schema: type: object - '400': + "400": description: Client Error content: application/json: schema: - $ref: '#/components/schemas/ClientError' + $ref: "#/components/schemas/ClientError" default: description: Server Error content: application/json: schema: - $ref: '#/components/schemas/ServerError' + $ref: "#/components/schemas/ServerError" /api/instrument/{instrumentId}/delete: get: description: Get Instrument Types @@ -227,26 +227,26 @@ paths: tags: - deleteInstrumentById parameters: - - $ref: '#/components/parameters/instrumentId' + - $ref: "#/components/parameters/instrumentId" responses: - '200': + "200": description: Instrument Types content: application/json: schema: type: object - '400': + "400": description: Client Error content: application/json: schema: - $ref: '#/components/schemas/ClientError' + $ref: "#/components/schemas/ClientError" default: description: Server Error content: application/json: schema: - $ref: '#/components/schemas/ServerError' + $ref: "#/components/schemas/ServerError" /api/instrument/edit: post: description: Edit Instrument @@ -258,27 +258,27 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EditInstrumentRequestBody' + $ref: "#/components/schemas/EditInstrumentRequestBody" required: true responses: - '200': + "200": description: Instrument Types content: application/json: schema: type: object - '400': + "400": description: Client Error content: application/json: schema: - $ref: '#/components/schemas/ClientError' + $ref: "#/components/schemas/ClientError" default: description: Server Error content: application/json: schema: - $ref: '#/components/schemas/ServerError' + $ref: "#/components/schemas/ServerError" /api/instrument/materials: get: description: Get Instrument Basic Materials @@ -287,24 +287,24 @@ paths: tags: - getInstrumentBasicMaterials responses: - '200': + "200": description: Instrument Basic Materials content: application/json: schema: - $ref: '#/components/schemas/GetInstrumentBasicMaterialsResponse' - '400': + $ref: "#/components/schemas/GetInstrumentBasicMaterialsResponse" + "400": description: Client Error content: application/json: schema: - $ref: '#/components/schemas/ClientError' + $ref: "#/components/schemas/ClientError" default: description: Server Error content: application/json: schema: - $ref: '#/components/schemas/ServerError' + $ref: "#/components/schemas/ServerError" /api/instrument/{instrumentId}: get: description: Get Instrument by ID @@ -313,26 +313,26 @@ paths: tags: - getInstrumentById parameters: - - $ref: '#/components/parameters/instrumentId' + - $ref: "#/components/parameters/instrumentId" responses: - '200': + "200": description: Instrument Detail content: application/json: schema: - $ref: '#/components/schemas/InstrumentDetail' - '400': + $ref: "#/components/schemas/InstrumentDetail" + "400": description: Client Error content: application/json: schema: - $ref: '#/components/schemas/ClientError' + $ref: "#/components/schemas/ClientError" default: description: server error content: application/json: schema: - $ref: '#/components/schemas/ServerError' + $ref: "#/components/schemas/ServerError" /api/instrument/photo/{instrumentId}: get: description: Get Instrument Photo @@ -341,26 +341,26 @@ paths: tags: - getInstrumentPhoto parameters: - - $ref: '#/components/parameters/instrumentId' + - $ref: "#/components/parameters/instrumentId" responses: - '200': + "200": description: Instrument Types content: image/*: schema: - $ref: '#/components/schemas/InstrumentPhoto' - '400': + $ref: "#/components/schemas/InstrumentPhoto" + "400": description: Client Error content: application/json: schema: - $ref: '#/components/schemas/ClientError' + $ref: "#/components/schemas/ClientError" default: description: Server Error content: application/json: schema: - $ref: '#/components/schemas/ServerError' + $ref: "#/components/schemas/ServerError" /api/instrument/types: get: description: Get Instrument Types @@ -369,24 +369,24 @@ paths: tags: - getInstrumentTypes responses: - '200': + "200": description: Instrument Types content: application/json: schema: - $ref: '#/components/schemas/GetInstrumentTypesResponse' - '400': + $ref: "#/components/schemas/GetInstrumentTypesResponse" + "400": description: Client Error content: application/json: schema: - $ref: '#/components/schemas/ClientError' + $ref: "#/components/schemas/ClientError" default: description: Server Error content: application/json: schema: - $ref: '#/components/schemas/ServerError' + $ref: "#/components/schemas/ServerError" /api/instruments: post: description: Get Instruments by Criteria @@ -398,27 +398,27 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/GetInstrumentsByCriteriaRequestBody' + $ref: "#/components/schemas/GetInstrumentsByCriteriaRequestBody" required: true responses: - '200': + "200": description: Instrument Details content: application/json: schema: - $ref: '#/components/schemas/GetInstrumentsByCriteriaResponse' - '400': + $ref: "#/components/schemas/GetInstrumentsByCriteriaResponse" + "400": description: Client Error content: application/json: schema: - $ref: '#/components/schemas/ClientError' + $ref: "#/components/schemas/ClientError" default: description: server error content: application/json: schema: - $ref: '#/components/schemas/ServerError' + $ref: "#/components/schemas/ServerError" /api/instruments/paginated: post: description: Get Instruments by Criteria Paginated @@ -445,27 +445,27 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/GetInstrumentsByCriteriaRequestBody' + $ref: "#/components/schemas/GetInstrumentsByCriteriaRequestBody" required: true responses: - '200': + "200": description: Instrument Details content: application/json: schema: - $ref: '#/components/schemas/GetInstrumentByCriteriaPageResponse' - '400': + $ref: "#/components/schemas/GetInstrumentByCriteriaPageResponse" + "400": description: Client Error content: application/json: schema: - $ref: '#/components/schemas/ClientError' + $ref: "#/components/schemas/ClientError" default: description: server error content: application/json: schema: - $ref: '#/components/schemas/ServerError' + $ref: "#/components/schemas/ServerError" /api/auth/login: post: description: Basic Authentication @@ -477,21 +477,21 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UsernameAndPasswordRequestBody' + $ref: "#/components/schemas/UsernameAndPasswordRequestBody" required: true responses: - '200': + "200": description: Profile Details content: application/json: schema: - $ref: '#/components/schemas/JwtResponse' + $ref: "#/components/schemas/JwtResponse" default: description: server error content: application/json: schema: - $ref: '#/components/schemas/ServerError' + $ref: "#/components/schemas/ServerError" /api/auth/logout: post: description: Logout Endpoint @@ -500,7 +500,7 @@ paths: tags: - logout responses: - '200': + "200": description: Profile Details content: application/json: @@ -511,7 +511,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ServerError' + $ref: "#/components/schemas/ServerError" /api/manufacturer: get: description: Get Manufacturers @@ -520,24 +520,24 @@ paths: tags: - getManufacturers responses: - '200': + "200": description: Manufacturers content: application/json: schema: - $ref: '#/components/schemas/GetManufacturersResponse' - '400': + $ref: "#/components/schemas/GetManufacturersResponse" + "400": description: Client Error content: application/json: schema: - $ref: '#/components/schemas/ClientError' + $ref: "#/components/schemas/ClientError" default: description: Server Error content: application/json: schema: - $ref: '#/components/schemas/ServerError' + $ref: "#/components/schemas/ServerError" /api/profile: get: description: Get User Profile @@ -546,18 +546,18 @@ paths: tags: - getUserProfile responses: - '200': + "200": description: Profile Details content: application/json: schema: - $ref: '#/components/schemas/ProfileDetails' + $ref: "#/components/schemas/ProfileDetails" default: description: server error content: application/json: schema: - $ref: '#/components/schemas/ServerError' + $ref: "#/components/schemas/ServerError" /api/registration: post: description: Register User @@ -569,10 +569,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RegistrationRequest' + $ref: "#/components/schemas/RegistrationRequest" required: true responses: - '200': + "200": description: User Registration content: application/json: @@ -583,7 +583,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ServerError' + $ref: "#/components/schemas/ServerError" components: schemas: BasicMaterial: @@ -629,23 +629,23 @@ components: - basic_materials properties: instrument_id: - $ref: '#/components/schemas/InstrumentId' + $ref: "#/components/schemas/InstrumentId" instrument_name: - $ref: '#/components/schemas/InstrumentName' + $ref: "#/components/schemas/InstrumentName" instrument_type: - $ref: '#/components/schemas/InstrumentType' + $ref: "#/components/schemas/InstrumentType" manufacturer_name: - $ref: '#/components/schemas/ManufacturerName' + $ref: "#/components/schemas/ManufacturerName" manufacturer_date: - $ref: '#/components/schemas/ManufactureDate' + $ref: "#/components/schemas/ManufactureDate" release_date: - $ref: '#/components/schemas/ReleaseDate' + $ref: "#/components/schemas/ReleaseDate" country: - $ref: '#/components/schemas/Country' + $ref: "#/components/schemas/Country" basic_materials: type: array items: - $ref: '#/components/schemas/BasicMaterial' + $ref: "#/components/schemas/BasicMaterial" InstrumentId: type: object required: @@ -687,7 +687,7 @@ components: manufacture_date: type: string format: date - example: '1998-01-01' + example: "1998-01-01" ReleaseDate: type: object required: @@ -696,7 +696,7 @@ components: release_date: type: string format: date - example: '1998-01-01' + example: "1998-01-01" InstrumentPhoto: type: object required: @@ -725,7 +725,7 @@ components: content: type: array items: - $ref: '#/components/schemas/Country' + $ref: "#/components/schemas/Country" ListFavoriteResponse: type: object required: @@ -734,7 +734,7 @@ components: content: type: array items: - $ref: '#/components/schemas/InstrumentDetail' + $ref: "#/components/schemas/InstrumentDetail" InstrumentDetailWithoutId: type: object required: @@ -747,21 +747,21 @@ components: - basic_materials properties: instrument_name: - $ref: '#/components/schemas/InstrumentName' + $ref: "#/components/schemas/InstrumentName" instrument_type: - $ref: '#/components/schemas/InstrumentType' + $ref: "#/components/schemas/InstrumentType" manufacturer_name: - $ref: '#/components/schemas/ManufacturerName' + $ref: "#/components/schemas/ManufacturerName" manufacturer_date: - $ref: '#/components/schemas/ManufactureDate' + $ref: "#/components/schemas/ManufactureDate" release_date: - $ref: '#/components/schemas/ReleaseDate' + $ref: "#/components/schemas/ReleaseDate" country: - $ref: '#/components/schemas/Country' + $ref: "#/components/schemas/Country" basic_materials: type: array items: - $ref: '#/components/schemas/BasicMaterial' + $ref: "#/components/schemas/BasicMaterial" CreateInstrumentRequestBody: type: object required: @@ -769,9 +769,9 @@ components: - instrument_photo properties: instrument_detail: - $ref: '#/components/schemas/InstrumentDetailWithoutId' + $ref: "#/components/schemas/InstrumentDetailWithoutId" instrument_photo: - $ref: '#/components/schemas/InstrumentPhoto' + $ref: "#/components/schemas/InstrumentPhoto" EditInstrumentRequestBody: type: object required: @@ -779,9 +779,9 @@ components: - instrument_photo properties: instrument_detail: - $ref: '#/components/schemas/InstrumentDetail' + $ref: "#/components/schemas/InstrumentDetail" instrument_photo: - $ref: '#/components/schemas/InstrumentPhoto' + $ref: "#/components/schemas/InstrumentPhoto" GetInstrumentBasicMaterialsResponse: type: object required: @@ -790,7 +790,7 @@ components: content: type: array items: - $ref: '#/components/schemas/BasicMaterial' + $ref: "#/components/schemas/BasicMaterial" GetInstrumentTypesResponse: type: object required: @@ -799,7 +799,7 @@ components: content: type: array items: - $ref: '#/components/schemas/InstrumentType' + $ref: "#/components/schemas/InstrumentType" GetInstrumentsByCriteriaResponse: type: object required: @@ -808,55 +808,55 @@ components: content: type: array items: - $ref: '#/components/schemas/InstrumentDetail' + $ref: "#/components/schemas/InstrumentDetail" GetInstrumentsByCriteriaRequestBody: type: object properties: instrument_name: nullable: true allOf: - - $ref: '#/components/schemas/InstrumentName' + - $ref: "#/components/schemas/InstrumentName" instrument_types: nullable: true type: array items: - $ref: '#/components/schemas/InstrumentType' + $ref: "#/components/schemas/InstrumentType" manufacturer_names: nullable: true type: array items: - $ref: '#/components/schemas/ManufacturerName' + $ref: "#/components/schemas/ManufacturerName" manufacture_date_from: nullable: true allOf: - - $ref: '#/components/schemas/ManufactureDate' + - $ref: "#/components/schemas/ManufactureDate" manufacture_date_to: nullable: true allOf: - - $ref: '#/components/schemas/ManufactureDate' + - $ref: "#/components/schemas/ManufactureDate" release_date_from: nullable: true allOf: - - $ref: '#/components/schemas/ReleaseDate' + - $ref: "#/components/schemas/ReleaseDate" release_date_to: nullable: true allOf: - - $ref: '#/components/schemas/ReleaseDate' + - $ref: "#/components/schemas/ReleaseDate" countries: nullable: true type: array items: - $ref: '#/components/schemas/Country' + $ref: "#/components/schemas/Country" materials: nullable: true type: array items: - $ref: '#/components/schemas/BasicMaterial' + $ref: "#/components/schemas/BasicMaterial" instrument_ids: nullable: true type: array items: - $ref: '#/components/schemas/InstrumentId' + $ref: "#/components/schemas/InstrumentId" GetInstrumentByCriteriaPageResponse: type: object required: @@ -870,7 +870,7 @@ components: content: type: array items: - $ref: '#/components/schemas/InstrumentDetail' + $ref: "#/components/schemas/InstrumentDetail" content_size: type: integer format: int64 @@ -923,7 +923,7 @@ components: content: type: array items: - $ref: '#/components/schemas/Manufacturer' + $ref: "#/components/schemas/Manufacturer" ProfileDetails: type: object required: diff --git a/openapi/specs/instrument/CreateInstrumentEndpoint.yml b/openapi/specs/instrument/CreateInstrumentEndpoint.yml index 7a4e8e62..1b1a0dcd 100644 --- a/openapi/specs/instrument/CreateInstrumentEndpoint.yml +++ b/openapi/specs/instrument/CreateInstrumentEndpoint.yml @@ -59,15 +59,16 @@ components: schemas: InstrumentDetailWithoutId: type: object - required: [ - instrument_name, - instrument_type, - manufacturer_name, - manufacturer_date, - release_date, - country, - basic_materials, - ] + required: + [ + instrument_name, + instrument_type, + manufacturer_name, + manufacturer_date, + release_date, + country, + basic_materials, + ] properties: instrument_name: $ref: "./../common/InstrumentName.yml#/components/schemas/InstrumentName" @@ -88,7 +89,7 @@ components: CreateInstrumentRequestBody: type: object - required: [ instrument_detail, instrument_photo ] + required: [instrument_detail, instrument_photo] properties: instrument_detail: $ref: "#/components/schemas/InstrumentDetailWithoutId" diff --git a/openapi/specs/instrument/DeleteInstrumentByIdEndpoint.yml b/openapi/specs/instrument/DeleteInstrumentByIdEndpoint.yml index d3055326..0f7147c4 100644 --- a/openapi/specs/instrument/DeleteInstrumentByIdEndpoint.yml +++ b/openapi/specs/instrument/DeleteInstrumentByIdEndpoint.yml @@ -30,7 +30,7 @@ paths: tags: - deleteInstrumentById parameters: - - $ref: './../common/InstrumentId.yml#/components/parameters/instrumentId' + - $ref: "./../common/InstrumentId.yml#/components/parameters/instrumentId" responses: "200": description: Instrument Types diff --git a/openapi/specs/instrument/EditInstrumentEndpoint.yml b/openapi/specs/instrument/EditInstrumentEndpoint.yml index c4ca7e80..6d3210dc 100644 --- a/openapi/specs/instrument/EditInstrumentEndpoint.yml +++ b/openapi/specs/instrument/EditInstrumentEndpoint.yml @@ -33,7 +33,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EditInstrumentRequestBody' + $ref: "#/components/schemas/EditInstrumentRequestBody" required: true responses: "200": diff --git a/openapi/specs/instrument/GetInstrumentByIdEndpoint.yml b/openapi/specs/instrument/GetInstrumentByIdEndpoint.yml index 24d76a5a..c6a67fe3 100644 --- a/openapi/specs/instrument/GetInstrumentByIdEndpoint.yml +++ b/openapi/specs/instrument/GetInstrumentByIdEndpoint.yml @@ -30,7 +30,7 @@ paths: tags: - getInstrumentById parameters: - - $ref: './../common/InstrumentId.yml#/components/parameters/instrumentId' + - $ref: "./../common/InstrumentId.yml#/components/parameters/instrumentId" responses: "200": description: Instrument Detail diff --git a/tools/docker/docker-compose.yml b/tools/docker/docker-compose.yml index 8ab9fb61..5f983e26 100644 --- a/tools/docker/docker-compose.yml +++ b/tools/docker/docker-compose.yml @@ -2,7 +2,6 @@ networks: muse: driver: bridge - services: muse-postgres: image: postgres:16.4 @@ -20,7 +19,7 @@ services: networks: - muse healthcheck: - test: [ "CMD-SHELL", "pg_isready -U postgres" ] + test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 5s timeout: 5s retries: 5 @@ -86,7 +85,6 @@ services: - muse profiles: - local - # portainer: # image: portainer/portainer-ce:linux-amd64-2.20.3-alpine # container_name: portainer diff --git a/tools/scripts/client/runLinter.sh b/tools/scripts/client/runLinter.sh index 85509603..82cf1156 100755 --- a/tools/scripts/client/runLinter.sh +++ b/tools/scripts/client/runLinter.sh @@ -3,4 +3,5 @@ set -e currentDir=$(cd -P -- "$(dirname -- "$0")" && pwd -P) rootDir="$currentDir/../../../" -(cd "$rootDir/client" && exec npx prettier . --check) +(cd "$rootDir" && npx prettier . --check) +(cd "$rootDir" && npx prettier . --write) From e2b8a14a864868f89edcc87f814e5b6eaa56f85e Mon Sep 17 00:00:00 2001 From: skywalker Date: Wed, 28 Aug 2024 17:22:54 +0300 Subject: [PATCH 7/7] chore(linter): run linter --- client/src/shared/config/api.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/client/src/shared/config/api.ts b/client/src/shared/config/api.ts index a3192842..d38d0d6c 100644 --- a/client/src/shared/config/api.ts +++ b/client/src/shared/config/api.ts @@ -1,12 +1,6 @@ import { Configuration } from "generated/configuration"; -interface Window { - _env_: { - SERVER_API_URL: string; - }; -} - -// @ts-ignore +// @ts-expect-error there is will be no error if env was set up const apiUrl = window._env_.SERVER_API_URL; export const apiConfig = new Configuration({ basePath: apiUrl,