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}" }