From b5a1d17ad4952e1ab6c0474f44931ac995fd3714 Mon Sep 17 00:00:00 2001 From: Roy Jeong Date: Wed, 11 Dec 2024 20:24:34 -0800 Subject: [PATCH 1/4] Remove tslint/eslint disable --- frontend/src/services/vdyp-api/api.ts | 2 -- frontend/src/services/vdyp-api/apis/get-help-api.ts | 4 +--- frontend/src/services/vdyp-api/apis/get-root-api.ts | 4 +--- frontend/src/services/vdyp-api/apis/run-dcsvprojection-api.ts | 4 +--- frontend/src/services/vdyp-api/apis/run-hcsvprojection-api.ts | 4 +--- frontend/src/services/vdyp-api/apis/run-scsvprojection-api.ts | 4 +--- frontend/src/services/vdyp-api/base.ts | 2 -- frontend/src/services/vdyp-api/configuration.ts | 2 -- frontend/src/services/vdyp-api/index.ts | 2 -- .../services/vdyp-api/models/combine-age-year-range-enum.ts | 2 -- frontend/src/services/vdyp-api/models/enum-value.ts | 2 -- frontend/src/services/vdyp-api/models/file-upload.ts | 2 -- frontend/src/services/vdyp-api/models/filters.ts | 2 -- .../src/services/vdyp-api/models/metadata-to-output-enum.ts | 2 -- frontend/src/services/vdyp-api/models/output-format-enum.ts | 2 -- .../src/services/vdyp-api/models/parameter-details-message.ts | 2 -- frontend/src/services/vdyp-api/models/parameters.ts | 2 -- frontend/src/services/vdyp-api/models/progress-frequency.ts | 2 -- frontend/src/services/vdyp-api/models/projection-dcsv-body.ts | 2 -- frontend/src/services/vdyp-api/models/projection-hcsv-body.ts | 2 -- frontend/src/services/vdyp-api/models/projection-scsv-body.ts | 2 -- .../services/vdyp-api/models/selected-debug-options-enum.ts | 2 -- .../vdyp-api/models/selected-execution-options-enum.ts | 2 -- .../src/services/vdyp-api/models/utilization-parameter.ts | 2 -- frontend/src/services/vdyp-api/models/value-enum.ts | 2 -- 25 files changed, 5 insertions(+), 55 deletions(-) diff --git a/frontend/src/services/vdyp-api/api.ts b/frontend/src/services/vdyp-api/api.ts index 8f5ab3fd..9996851f 100644 --- a/frontend/src/services/vdyp-api/api.ts +++ b/frontend/src/services/vdyp-api/api.ts @@ -1,5 +1,3 @@ -/* tslint:disable */ -/* eslint-disable */ export * from './apis/get-help-api' export * from './apis/get-root-api' export * from './apis/run-dcsvprojection-api' diff --git a/frontend/src/services/vdyp-api/apis/get-help-api.ts b/frontend/src/services/vdyp-api/apis/get-help-api.ts index 9ff57c03..d7247955 100644 --- a/frontend/src/services/vdyp-api/apis/get-help-api.ts +++ b/frontend/src/services/vdyp-api/apis/get-help-api.ts @@ -1,5 +1,3 @@ -/* tslint:disable */ -/* eslint-disable */ import globalAxios from 'axios' import type { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios' import { Configuration } from '../configuration' @@ -45,7 +43,7 @@ export const GetHelpApiAxiosParamCreator = function ( query.set(key, options.params[key]) } localVarUrlObj.search = new URLSearchParams(query).toString() - let headersFromBaseOptions = + const headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {} localVarRequestOptions.headers = { ...localVarHeaderParameter, diff --git a/frontend/src/services/vdyp-api/apis/get-root-api.ts b/frontend/src/services/vdyp-api/apis/get-root-api.ts index 1e15de51..4bf7bdfc 100644 --- a/frontend/src/services/vdyp-api/apis/get-root-api.ts +++ b/frontend/src/services/vdyp-api/apis/get-root-api.ts @@ -1,5 +1,3 @@ -/* tslint:disable */ -/* eslint-disable */ import globalAxios from 'axios' import type { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios' import { Configuration } from '../configuration' @@ -46,7 +44,7 @@ export const GetRootApiAxiosParamCreator = function ( query.set(key, options.params[key]) } localVarUrlObj.search = new URLSearchParams(query).toString() - let headersFromBaseOptions = + const headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {} localVarRequestOptions.headers = { ...localVarHeaderParameter, diff --git a/frontend/src/services/vdyp-api/apis/run-dcsvprojection-api.ts b/frontend/src/services/vdyp-api/apis/run-dcsvprojection-api.ts index 61c6383d..e25ce2fc 100644 --- a/frontend/src/services/vdyp-api/apis/run-dcsvprojection-api.ts +++ b/frontend/src/services/vdyp-api/apis/run-dcsvprojection-api.ts @@ -1,5 +1,3 @@ -/* tslint:disable */ -/* eslint-disable */ import globalAxios from 'axios' import type { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios' import { Configuration } from '../configuration' @@ -59,7 +57,7 @@ export const RunDCSVProjectionApiAxiosParamCreator = function ( query.set(key, options.params[key]) } localVarUrlObj.search = new URLSearchParams(query).toString() - let headersFromBaseOptions = + const headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {} localVarRequestOptions.headers = { ...localVarHeaderParameter, diff --git a/frontend/src/services/vdyp-api/apis/run-hcsvprojection-api.ts b/frontend/src/services/vdyp-api/apis/run-hcsvprojection-api.ts index b7b489de..0e938596 100644 --- a/frontend/src/services/vdyp-api/apis/run-hcsvprojection-api.ts +++ b/frontend/src/services/vdyp-api/apis/run-hcsvprojection-api.ts @@ -1,5 +1,3 @@ -/* tslint:disable */ -/* eslint-disable */ import globalAxios from 'axios' import type { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios' import { Configuration } from '../configuration' @@ -67,7 +65,7 @@ export const RunHCSVProjectionApiAxiosParamCreator = function ( query.set(key, options.params[key]) } localVarUrlObj.search = new URLSearchParams(query).toString() - let headersFromBaseOptions = + const headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {} localVarRequestOptions.headers = { ...localVarHeaderParameter, diff --git a/frontend/src/services/vdyp-api/apis/run-scsvprojection-api.ts b/frontend/src/services/vdyp-api/apis/run-scsvprojection-api.ts index ab680d93..30556c29 100644 --- a/frontend/src/services/vdyp-api/apis/run-scsvprojection-api.ts +++ b/frontend/src/services/vdyp-api/apis/run-scsvprojection-api.ts @@ -1,5 +1,3 @@ -/* tslint:disable */ -/* eslint-disable */ import globalAxios from 'axios' import type { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios' import { Configuration } from '../configuration' @@ -121,7 +119,7 @@ export const RunSCSVProjectionApiAxiosParamCreator = function ( query.set(key, options.params[key]) } localVarUrlObj.search = new URLSearchParams(query).toString() - let headersFromBaseOptions = + const headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {} localVarRequestOptions.headers = { ...localVarHeaderParameter, diff --git a/frontend/src/services/vdyp-api/base.ts b/frontend/src/services/vdyp-api/base.ts index ce0ac357..05a4843e 100644 --- a/frontend/src/services/vdyp-api/base.ts +++ b/frontend/src/services/vdyp-api/base.ts @@ -1,5 +1,3 @@ -/* tslint:disable */ -/* eslint-disable */ import { Configuration } from './configuration' // Some imports not used depending on template conditions // @ts-ignore diff --git a/frontend/src/services/vdyp-api/configuration.ts b/frontend/src/services/vdyp-api/configuration.ts index d146482e..b38e4d4b 100644 --- a/frontend/src/services/vdyp-api/configuration.ts +++ b/frontend/src/services/vdyp-api/configuration.ts @@ -1,5 +1,3 @@ -/* tslint:disable */ -/* eslint-disable */ export interface ConfigurationParameters { apiKey?: | string diff --git a/frontend/src/services/vdyp-api/index.ts b/frontend/src/services/vdyp-api/index.ts index 5e6ba100..0ea45f55 100644 --- a/frontend/src/services/vdyp-api/index.ts +++ b/frontend/src/services/vdyp-api/index.ts @@ -1,5 +1,3 @@ -/* tslint:disable */ -/* eslint-disable */ export * from './api' export * from './configuration' export * from './models' diff --git a/frontend/src/services/vdyp-api/models/combine-age-year-range-enum.ts b/frontend/src/services/vdyp-api/models/combine-age-year-range-enum.ts index a5fcd834..887b6e7f 100644 --- a/frontend/src/services/vdyp-api/models/combine-age-year-range-enum.ts +++ b/frontend/src/services/vdyp-api/models/combine-age-year-range-enum.ts @@ -1,5 +1,3 @@ -/* tslint:disable */ -/* eslint-disable */ export enum CombineAgeYearRangeEnum { Union = 'union', Intersect = 'intersect', diff --git a/frontend/src/services/vdyp-api/models/enum-value.ts b/frontend/src/services/vdyp-api/models/enum-value.ts index 61129444..282698f5 100644 --- a/frontend/src/services/vdyp-api/models/enum-value.ts +++ b/frontend/src/services/vdyp-api/models/enum-value.ts @@ -1,5 +1,3 @@ -/* tslint:disable */ -/* eslint-disable */ export enum EnumValue { Never = 'never', Polygon = 'polygon', diff --git a/frontend/src/services/vdyp-api/models/file-upload.ts b/frontend/src/services/vdyp-api/models/file-upload.ts index 553c6650..d0a3ad2b 100644 --- a/frontend/src/services/vdyp-api/models/file-upload.ts +++ b/frontend/src/services/vdyp-api/models/file-upload.ts @@ -1,3 +1 @@ -/* tslint:disable */ -/* eslint-disable */ export interface FileUpload {} diff --git a/frontend/src/services/vdyp-api/models/filters.ts b/frontend/src/services/vdyp-api/models/filters.ts index e31a18a7..5a448276 100644 --- a/frontend/src/services/vdyp-api/models/filters.ts +++ b/frontend/src/services/vdyp-api/models/filters.ts @@ -1,5 +1,3 @@ -/* tslint:disable */ -/* eslint-disable */ export interface Filters { /** * @type {string} diff --git a/frontend/src/services/vdyp-api/models/metadata-to-output-enum.ts b/frontend/src/services/vdyp-api/models/metadata-to-output-enum.ts index 331614ba..39a03086 100644 --- a/frontend/src/services/vdyp-api/models/metadata-to-output-enum.ts +++ b/frontend/src/services/vdyp-api/models/metadata-to-output-enum.ts @@ -1,5 +1,3 @@ -/* tslint:disable */ -/* eslint-disable */ export enum MetadataToOutputEnum { ALL = 'ALL', MAIN = 'MAIN', diff --git a/frontend/src/services/vdyp-api/models/output-format-enum.ts b/frontend/src/services/vdyp-api/models/output-format-enum.ts index a7baa29a..223a178e 100644 --- a/frontend/src/services/vdyp-api/models/output-format-enum.ts +++ b/frontend/src/services/vdyp-api/models/output-format-enum.ts @@ -1,5 +1,3 @@ -/* tslint:disable */ -/* eslint-disable */ export enum OutputFormatEnum { YieldTable = 'YieldTable', CSVYieldTable = 'CSVYieldTable', diff --git a/frontend/src/services/vdyp-api/models/parameter-details-message.ts b/frontend/src/services/vdyp-api/models/parameter-details-message.ts index 29a6d71e..f2b3198a 100644 --- a/frontend/src/services/vdyp-api/models/parameter-details-message.ts +++ b/frontend/src/services/vdyp-api/models/parameter-details-message.ts @@ -1,5 +1,3 @@ -/* tslint:disable */ -/* eslint-disable */ export interface ParameterDetailsMessage { /** * the parameter name diff --git a/frontend/src/services/vdyp-api/models/parameters.ts b/frontend/src/services/vdyp-api/models/parameters.ts index 115f579f..e113bfd1 100644 --- a/frontend/src/services/vdyp-api/models/parameters.ts +++ b/frontend/src/services/vdyp-api/models/parameters.ts @@ -1,5 +1,3 @@ -/* tslint:disable */ -/* eslint-disable */ import { CombineAgeYearRangeEnum } from './combine-age-year-range-enum' import type { Filters } from './filters' import { MetadataToOutputEnum } from './metadata-to-output-enum' diff --git a/frontend/src/services/vdyp-api/models/progress-frequency.ts b/frontend/src/services/vdyp-api/models/progress-frequency.ts index acc65cc0..efde3509 100644 --- a/frontend/src/services/vdyp-api/models/progress-frequency.ts +++ b/frontend/src/services/vdyp-api/models/progress-frequency.ts @@ -1,5 +1,3 @@ -/* tslint:disable */ -/* eslint-disable */ import { EnumValue } from './enum-value' export interface ProgressFrequency { /** diff --git a/frontend/src/services/vdyp-api/models/projection-dcsv-body.ts b/frontend/src/services/vdyp-api/models/projection-dcsv-body.ts index dae5ae7e..7735943b 100644 --- a/frontend/src/services/vdyp-api/models/projection-dcsv-body.ts +++ b/frontend/src/services/vdyp-api/models/projection-dcsv-body.ts @@ -1,5 +1,3 @@ -/* tslint:disable */ -/* eslint-disable */ import type { FileUpload } from './file-upload' import type { Parameters } from './parameters' export interface ProjectionDcsvBody { diff --git a/frontend/src/services/vdyp-api/models/projection-hcsv-body.ts b/frontend/src/services/vdyp-api/models/projection-hcsv-body.ts index 26cbca08..730c5946 100644 --- a/frontend/src/services/vdyp-api/models/projection-hcsv-body.ts +++ b/frontend/src/services/vdyp-api/models/projection-hcsv-body.ts @@ -1,5 +1,3 @@ -/* tslint:disable */ -/* eslint-disable */ import type { FileUpload } from './file-upload' import type { Parameters } from './parameters' export interface ProjectionHcsvBody { diff --git a/frontend/src/services/vdyp-api/models/projection-scsv-body.ts b/frontend/src/services/vdyp-api/models/projection-scsv-body.ts index 7187ad4e..e75f6adf 100644 --- a/frontend/src/services/vdyp-api/models/projection-scsv-body.ts +++ b/frontend/src/services/vdyp-api/models/projection-scsv-body.ts @@ -1,5 +1,3 @@ -/* tslint:disable */ -/* eslint-disable */ import type { FileUpload } from './file-upload' import type { Parameters } from './parameters' export interface ProjectionScsvBody { diff --git a/frontend/src/services/vdyp-api/models/selected-debug-options-enum.ts b/frontend/src/services/vdyp-api/models/selected-debug-options-enum.ts index 3b5dc889..f380e66e 100644 --- a/frontend/src/services/vdyp-api/models/selected-debug-options-enum.ts +++ b/frontend/src/services/vdyp-api/models/selected-debug-options-enum.ts @@ -1,5 +1,3 @@ -/* tslint:disable */ -/* eslint-disable */ export enum SelectedDebugOptionsEnum { DoIncludeDebugTimestamps = 'doIncludeDebugTimestamps', DoIncludeDebugRoutineNames = 'doIncludeDebugRoutineNames', diff --git a/frontend/src/services/vdyp-api/models/selected-execution-options-enum.ts b/frontend/src/services/vdyp-api/models/selected-execution-options-enum.ts index a125b1da..b68b4394 100644 --- a/frontend/src/services/vdyp-api/models/selected-execution-options-enum.ts +++ b/frontend/src/services/vdyp-api/models/selected-execution-options-enum.ts @@ -1,5 +1,3 @@ -/* tslint:disable */ -/* eslint-disable */ export enum SelectedExecutionOptionsEnum { BackGrowEnabled = 'backGrowEnabled', ForwardGrowEnabled = 'forwardGrowEnabled', diff --git a/frontend/src/services/vdyp-api/models/utilization-parameter.ts b/frontend/src/services/vdyp-api/models/utilization-parameter.ts index f54408f4..ae36d9a8 100644 --- a/frontend/src/services/vdyp-api/models/utilization-parameter.ts +++ b/frontend/src/services/vdyp-api/models/utilization-parameter.ts @@ -1,5 +1,3 @@ -/* tslint:disable */ -/* eslint-disable */ import { ValueEnum } from './value-enum' export interface UtilizationParameter { /** diff --git a/frontend/src/services/vdyp-api/models/value-enum.ts b/frontend/src/services/vdyp-api/models/value-enum.ts index 67388f16..6296ade6 100644 --- a/frontend/src/services/vdyp-api/models/value-enum.ts +++ b/frontend/src/services/vdyp-api/models/value-enum.ts @@ -1,5 +1,3 @@ -/* tslint:disable */ -/* eslint-disable */ export enum ValueEnum { Excl = 'Excl', _40 = '4.0', From 9d5b4ee78c7c4871ae5b23221ea29f3bda2fe54e Mon Sep 17 00:00:00 2001 From: Roy Jeong Date: Wed, 11 Dec 2024 21:11:10 -0800 Subject: [PATCH 2/4] Delete unnecessary comments and unused import class --- frontend/src/env.ts | 1 - .../services/vdyp-api/apis/get-help-api.ts | 48 +-------- .../services/vdyp-api/apis/get-root-api.ts | 47 +-------- .../vdyp-api/apis/run-dcsvprojection-api.ts | 8 +- .../vdyp-api/apis/run-hcsvprojection-api.ts | 9 +- .../vdyp-api/apis/run-scsvprojection-api.ts | 69 +------------ frontend/src/services/vdyp-api/base.ts | 22 ----- .../src/services/vdyp-api/configuration.ts | 37 ------- .../src/services/vdyp-api/models/filters.ts | 19 ---- .../models/parameter-details-message.ts | 34 ------- .../services/vdyp-api/models/parameters.ts | 99 ------------------- .../vdyp-api/models/progress-frequency.ts | 9 -- .../vdyp-api/models/projection-dcsv-body.ts | 9 -- .../vdyp-api/models/projection-hcsv-body.ts | 14 --- .../vdyp-api/models/projection-scsv-body.ts | 44 --------- .../vdyp-api/models/utilization-parameter.ts | 9 -- 16 files changed, 17 insertions(+), 461 deletions(-) diff --git a/frontend/src/env.ts b/frontend/src/env.ts index f3d8d394..9061cb9c 100644 --- a/frontend/src/env.ts +++ b/frontend/src/env.ts @@ -1,5 +1,4 @@ declare global { - // eslint-disable-next-line no-unused-vars interface Window { config: any } diff --git a/frontend/src/services/vdyp-api/apis/get-help-api.ts b/frontend/src/services/vdyp-api/apis/get-help-api.ts index d7247955..6204f2ad 100644 --- a/frontend/src/services/vdyp-api/apis/get-help-api.ts +++ b/frontend/src/services/vdyp-api/apis/get-help-api.ts @@ -1,28 +1,18 @@ import globalAxios from 'axios' import type { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios' import { Configuration } from '../configuration' -// Some imports not used depending on template conditions -// @ts-ignore -import { BASE_PATH, BaseAPI, RequiredError } from '../base' +import { BASE_PATH, BaseAPI } from '../base' import type { RequestArgs } from '../base' import type { ParameterDetailsMessage } from '../models' -/** - * GetHelpApi - axios parameter creator - * @export - */ +import { env } from '@/env' + export const GetHelpApiAxiosParamCreator = function ( configuration?: Configuration, ) { return { - /** - * - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ helpGet: async (options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v8/help` - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com') + const localVarUrlObj = new URL(localVarPath, env.VITE_API_URL) let baseOptions if (configuration) { baseOptions = configuration.baseOptions @@ -60,17 +50,8 @@ export const GetHelpApiAxiosParamCreator = function ( } } -/** - * GetHelpApi - functional programming interface - * @export - */ export const GetHelpApiFp = function (configuration?: Configuration) { return { - /** - * - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ async helpGet( options?: AxiosRequestConfig, ): Promise< @@ -95,21 +76,12 @@ export const GetHelpApiFp = function (configuration?: Configuration) { } } -/** - * GetHelpApi - factory interface - * @export - */ export const GetHelpApiFactory = function ( configuration?: Configuration, basePath?: string, axios?: AxiosInstance, ) { return { - /** - * - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ async helpGet( options?: AxiosRequestConfig, ): Promise> { @@ -120,19 +92,7 @@ export const GetHelpApiFactory = function ( } } -/** - * GetHelpApi - object-oriented interface - * @export - * @class GetHelpApi - * @extends {BaseAPI} - */ export class GetHelpApi extends BaseAPI { - /** - * - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof GetHelpApi - */ public async helpGet( options?: AxiosRequestConfig, ): Promise> { diff --git a/frontend/src/services/vdyp-api/apis/get-root-api.ts b/frontend/src/services/vdyp-api/apis/get-root-api.ts index 4bf7bdfc..d8b2ade4 100644 --- a/frontend/src/services/vdyp-api/apis/get-root-api.ts +++ b/frontend/src/services/vdyp-api/apis/get-root-api.ts @@ -1,29 +1,18 @@ import globalAxios from 'axios' import type { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios' import { Configuration } from '../configuration' -// Some imports not used depending on template conditions -// @ts-ignore -import { BASE_PATH, BaseAPI, RequiredError } from '../base' +import { BASE_PATH, BaseAPI } from '../base' import type { RequestArgs } from '../base' import type { RootResource } from '../models' +import { env } from '@/env' -/** - * GetRootApi - axios parameter creator - * @export - */ export const GetRootApiAxiosParamCreator = function ( configuration?: Configuration, ) { return { - /** - * - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ rootGet: async (options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v8` - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com') + const localVarUrlObj = new URL(localVarPath, env.VITE_API_URL) let baseOptions if (configuration) { baseOptions = configuration.baseOptions @@ -61,17 +50,8 @@ export const GetRootApiAxiosParamCreator = function ( } } -/** - * GetRootApi - functional programming interface - * @export - */ export const GetRootApiFp = function (configuration?: Configuration) { return { - /** - * - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ async rootGet( options?: AxiosRequestConfig, ): Promise< @@ -96,21 +76,12 @@ export const GetRootApiFp = function (configuration?: Configuration) { } } -/** - * GetRootApi - factory interface - * @export - */ export const GetRootApiFactory = function ( configuration?: Configuration, basePath?: string, axios?: AxiosInstance, ) { return { - /** - * - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ async rootGet( options?: AxiosRequestConfig, ): Promise> /* edited */ { @@ -121,19 +92,7 @@ export const GetRootApiFactory = function ( } } -/** - * GetRootApi - object-oriented interface - * @export - * @class GetRootApi - * @extends {BaseAPI} - */ export class GetRootApi extends BaseAPI { - /** - * - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof GetRootApi - */ public async rootGet( options?: AxiosRequestConfig, ): Promise> /* edited */ { diff --git a/frontend/src/services/vdyp-api/apis/run-dcsvprojection-api.ts b/frontend/src/services/vdyp-api/apis/run-dcsvprojection-api.ts index e25ce2fc..51d8d3c0 100644 --- a/frontend/src/services/vdyp-api/apis/run-dcsvprojection-api.ts +++ b/frontend/src/services/vdyp-api/apis/run-dcsvprojection-api.ts @@ -1,11 +1,10 @@ import globalAxios from 'axios' import type { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios' import { Configuration } from '../configuration' -// Some imports not used depending on template conditions -// @ts-ignore -import { BASE_PATH, BaseAPI, RequiredError } from '../base' +import { BASE_PATH, BaseAPI } from '../base' import type { RequestArgs } from '../base' import type { FileUpload, Parameters } from '../models' +import { env } from '@/env' export const RunDCSVProjectionApiAxiosParamCreator = function ( configuration?: Configuration, @@ -18,8 +17,7 @@ export const RunDCSVProjectionApiAxiosParamCreator = function ( options: AxiosRequestConfig = {}, ): Promise => { const localVarPath = `/api/v8/projection/dcsv` - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com') + const localVarUrlObj = new URL(localVarPath, env.VITE_API_URL) let baseOptions if (configuration) { baseOptions = configuration.baseOptions diff --git a/frontend/src/services/vdyp-api/apis/run-hcsvprojection-api.ts b/frontend/src/services/vdyp-api/apis/run-hcsvprojection-api.ts index 0e938596..63b93c6e 100644 --- a/frontend/src/services/vdyp-api/apis/run-hcsvprojection-api.ts +++ b/frontend/src/services/vdyp-api/apis/run-hcsvprojection-api.ts @@ -1,11 +1,10 @@ import globalAxios from 'axios' import type { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios' import { Configuration } from '../configuration' -// Some imports not used depending on template conditions -// @ts-ignore -import { BASE_PATH, BaseAPI, RequiredError } from '../base' +import { BASE_PATH, BaseAPI } from '../base' import type { RequestArgs } from '../base' import type { FileUpload, Parameters } from '../models' +import { env } from '@/env' export const RunHCSVProjectionApiAxiosParamCreator = function ( configuration?: Configuration, @@ -19,7 +18,7 @@ export const RunHCSVProjectionApiAxiosParamCreator = function ( options: AxiosRequestConfig = {}, ): Promise => { const localVarPath = `/api/v8/projection/hcsv` - const localVarUrlObj = new URL(localVarPath, 'https://example.com') + const localVarUrlObj = new URL(localVarPath, env.VITE_API_URL) let baseOptions if (configuration) { baseOptions = configuration.baseOptions @@ -112,7 +111,7 @@ export const RunHCSVProjectionApiFp = function (configuration?: Configuration) { ) => { const axiosRequestArgs: AxiosRequestConfig = { ...localVarAxiosArgs.options, - url: localVarAxiosArgs.url, + url: basePath + localVarAxiosArgs.url, responseType: 'blob' /* edited */, } return axios.request(axiosRequestArgs) diff --git a/frontend/src/services/vdyp-api/apis/run-scsvprojection-api.ts b/frontend/src/services/vdyp-api/apis/run-scsvprojection-api.ts index 30556c29..e9618153 100644 --- a/frontend/src/services/vdyp-api/apis/run-scsvprojection-api.ts +++ b/frontend/src/services/vdyp-api/apis/run-scsvprojection-api.ts @@ -1,31 +1,15 @@ import globalAxios from 'axios' import type { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios' import { Configuration } from '../configuration' -// Some imports not used depending on template conditions -// @ts-ignore -import { BASE_PATH, BaseAPI, RequiredError } from '../base' +import { BASE_PATH, BaseAPI } from '../base' import type { RequestArgs } from '../base' import type { FileUpload, Parameters } from '../models' +import { env } from '@/env' export const RunSCSVProjectionApiAxiosParamCreator = function ( configuration?: Configuration, ) { return { - /** - * - * @param {FileUpload} [polygonInputData] - * @param {FileUpload} [layersInputData] - * @param {FileUpload} [historyInputData] - * @param {FileUpload} [nonVegetationInputData] - * @param {FileUpload} [otherVegetationInputData] - * @param {FileUpload} [polygonIdInputData] - * @param {FileUpload} [speciesInputData] - * @param {FileUpload} [vriAdjustInputData] - * @param {Parameters} [projectionParameters] - * @param {boolean} [trialRun] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ projectionScsvPostForm: async ( polygonInputData?: FileUpload, layersInputData?: FileUpload, @@ -40,8 +24,7 @@ export const RunSCSVProjectionApiAxiosParamCreator = function ( options: AxiosRequestConfig = {}, ): Promise => { const localVarPath = `/api/v8/projection/scsv` - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com') + const localVarUrlObj = new URL(localVarPath, env.VITE_API_URL) let baseOptions if (configuration) { baseOptions = configuration.baseOptions @@ -139,21 +122,6 @@ export const RunSCSVProjectionApiAxiosParamCreator = function ( export const RunSCSVProjectionApiFp = function (configuration?: Configuration) { return { - /** - * - * @param {FileUpload} [polygonInputData] - * @param {FileUpload} [layersInputData] - * @param {FileUpload} [historyInputData] - * @param {FileUpload} [nonVegetationInputData] - * @param {FileUpload} [otherVegetationInputData] - * @param {FileUpload} [polygonIdInputData] - * @param {FileUpload} [speciesInputData] - * @param {FileUpload} [vriAdjustInputData] - * @param {Parameters} [projectionParameters] - * @param {boolean} [trialRun] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ async projectionScsvPostForm( polygonInputData?: FileUpload, layersInputData?: FileUpload, @@ -204,21 +172,6 @@ export const RunSCSVProjectionApiFactory = function ( axios?: AxiosInstance, ) { return { - /** - * - * @param {FileUpload} [polygonInputData] - * @param {FileUpload} [layersInputData] - * @param {FileUpload} [historyInputData] - * @param {FileUpload} [nonVegetationInputData] - * @param {FileUpload} [otherVegetationInputData] - * @param {FileUpload} [polygonIdInputData] - * @param {FileUpload} [speciesInputData] - * @param {FileUpload} [vriAdjustInputData] - * @param {Parameters} [projectionParameters] - * @param {boolean} [trialRun] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ async projectionScsvPostForm( polygonInputData?: FileUpload, layersInputData?: FileUpload, @@ -252,22 +205,6 @@ export const RunSCSVProjectionApiFactory = function ( } export class RunSCSVProjectionApi extends BaseAPI { - /** - * - * @param {FileUpload} [polygonInputData] - * @param {FileUpload} [layersInputData] - * @param {FileUpload} [historyInputData] - * @param {FileUpload} [nonVegetationInputData] - * @param {FileUpload} [otherVegetationInputData] - * @param {FileUpload} [polygonIdInputData] - * @param {FileUpload} [speciesInputData] - * @param {FileUpload} [vriAdjustInputData] - * @param {Parameters} [projectionParameters] - * @param {boolean} [trialRun] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RunSCSVProjectionApi - */ public async projectionScsvPostForm( polygonInputData?: FileUpload, layersInputData?: FileUpload, diff --git a/frontend/src/services/vdyp-api/base.ts b/frontend/src/services/vdyp-api/base.ts index 05a4843e..f8d88432 100644 --- a/frontend/src/services/vdyp-api/base.ts +++ b/frontend/src/services/vdyp-api/base.ts @@ -1,15 +1,9 @@ import { Configuration } from './configuration' -// Some imports not used depending on template conditions -// @ts-ignore import globalAxios from 'axios' import type { AxiosRequestConfig, AxiosInstance } from 'axios' export const BASE_PATH = '' -/** - * - * @export - */ export const COLLECTION_FORMATS = { csv: ',', ssv: ' ', @@ -17,21 +11,11 @@ export const COLLECTION_FORMATS = { pipes: '|', } -/** - * - * @export - * @interface RequestArgs - */ export interface RequestArgs { url: string options: AxiosRequestConfig } -/** - * - * @export - * @class BaseAPI - */ export class BaseAPI { protected configuration: Configuration | undefined @@ -47,12 +31,6 @@ export class BaseAPI { } } -/** - * - * @export - * @class RequiredError - * @extends {Error} - */ export class RequiredError extends Error { name: 'RequiredError' = 'RequiredError' constructor( diff --git a/frontend/src/services/vdyp-api/configuration.ts b/frontend/src/services/vdyp-api/configuration.ts index b38e4d4b..f9e99b70 100644 --- a/frontend/src/services/vdyp-api/configuration.ts +++ b/frontend/src/services/vdyp-api/configuration.ts @@ -16,61 +16,24 @@ export interface ConfigurationParameters { } 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 - /** - * base options for axios calls - * - * @type {any} - * @memberof Configuration - */ baseOptions?: any constructor(param: ConfigurationParameters = {}) { diff --git a/frontend/src/services/vdyp-api/models/filters.ts b/frontend/src/services/vdyp-api/models/filters.ts index 5a448276..5c85fcee 100644 --- a/frontend/src/services/vdyp-api/models/filters.ts +++ b/frontend/src/services/vdyp-api/models/filters.ts @@ -1,25 +1,6 @@ export interface Filters { - /** - * @type {string} - * @memberof Filters - */ maintainer?: string - - /** - * @type {string} - * @memberof Filters - */ mapsheet?: string - - /** - * @type {string} - * @memberof Filters - */ polygon?: string - - /** - * @type {string} - * @memberof Filters - */ polygonId?: string } diff --git a/frontend/src/services/vdyp-api/models/parameter-details-message.ts b/frontend/src/services/vdyp-api/models/parameter-details-message.ts index f2b3198a..52eae249 100644 --- a/frontend/src/services/vdyp-api/models/parameter-details-message.ts +++ b/frontend/src/services/vdyp-api/models/parameter-details-message.ts @@ -1,41 +1,7 @@ export interface ParameterDetailsMessage { - /** - * the parameter name - * - * @type {string} - * @memberof ParameterDetailsMessage - */ field?: string - - /** - * a brief description of the parameter's purpose - * - * @type {string} - * @memberof ParameterDetailsMessage - */ shortDescription?: string - - /** - * if the parameter has a value, a description of the value - * - * @type {string} - * @memberof ParameterDetailsMessage - */ parameterValue?: string - - /** - * a description of the parameter - * - * @type {string} - * @memberof ParameterDetailsMessage - */ longDescription?: string - - /** - * the default value used if the parameter is not specified - * - * @type {string} - * @memberof ParameterDetailsMessage - */ defaultValue?: string } diff --git a/frontend/src/services/vdyp-api/models/parameters.ts b/frontend/src/services/vdyp-api/models/parameters.ts index e113bfd1..a88fdc04 100644 --- a/frontend/src/services/vdyp-api/models/parameters.ts +++ b/frontend/src/services/vdyp-api/models/parameters.ts @@ -7,123 +7,24 @@ import { SelectedDebugOptionsEnum } from './selected-debug-options-enum' import { SelectedExecutionOptionsEnum } from './selected-execution-options-enum' import type { UtilizationParameter } from './utilization-parameter' export interface Parameters { - /** - * @type {OutputFormatEnum} - * @memberof Parameters - */ outputFormat?: OutputFormatEnum - - /** - * @type {Array} - * @memberof Parameters - */ selectedExecutionOptions?: Array - - /** - * @type {Array} - * @memberof Parameters - */ selectedDebugOptions?: Array - - /** - * @type {number} - * @memberof Parameters - */ ageStart?: number - - /** - * @type {number} - * @memberof Parameters - */ minAgeStart?: number - - /** - * @type {number} - * @memberof Parameters - */ maxAgeStart?: number - - /** - * @type {number} - * @memberof Parameters - */ ageEnd?: number - - /** - * @type {number} - * @memberof Parameters - */ minAgeEnd?: number - - /** - * @type {number} - * @memberof Parameters - */ maxAgeEnd?: number - - /** - * @type {number} - * @memberof Parameters - */ yearStart?: number - - /** - * @type {number} - * @memberof Parameters - */ yearEnd?: number - - /** - * @type {number} - * @memberof Parameters - */ forceYear?: number - - /** - * @type {number} - * @memberof Parameters - */ ageIncrement?: number - - /** - * @type {number} - * @memberof Parameters - */ minAgeIncrement?: number - - /** - * @type {number} - * @memberof Parameters - */ maxAgeIncrement?: number - - /** - * @type {CombineAgeYearRangeEnum} - * @memberof Parameters - */ combineAgeYearRange?: CombineAgeYearRangeEnum - - /** - * @type {ProgressFrequency} - * @memberof Parameters - */ progressFrequency?: ProgressFrequency - - /** - * @type {MetadataToOutputEnum} - * @memberof Parameters - */ metadataToOutput?: MetadataToOutputEnum - - /** - * @type {Filters} - * @memberof Parameters - */ filters?: Filters - - /** - * @type {Array} - * @memberof Parameters - */ utils?: Array } diff --git a/frontend/src/services/vdyp-api/models/progress-frequency.ts b/frontend/src/services/vdyp-api/models/progress-frequency.ts index efde3509..4f9bcbf0 100644 --- a/frontend/src/services/vdyp-api/models/progress-frequency.ts +++ b/frontend/src/services/vdyp-api/models/progress-frequency.ts @@ -1,14 +1,5 @@ import { EnumValue } from './enum-value' export interface ProgressFrequency { - /** - * @type {number} - * @memberof ProgressFrequency - */ intValue?: number - - /** - * @type {EnumValue} - * @memberof ProgressFrequency - */ enumValue?: EnumValue } diff --git a/frontend/src/services/vdyp-api/models/projection-dcsv-body.ts b/frontend/src/services/vdyp-api/models/projection-dcsv-body.ts index 7735943b..5e9ff102 100644 --- a/frontend/src/services/vdyp-api/models/projection-dcsv-body.ts +++ b/frontend/src/services/vdyp-api/models/projection-dcsv-body.ts @@ -1,15 +1,6 @@ import type { FileUpload } from './file-upload' import type { Parameters } from './parameters' export interface ProjectionDcsvBody { - /** - * @type {FileUpload} - * @memberof ProjectionDcsvBody - */ dcsvInputData?: FileUpload - - /** - * @type {Parameters} - * @memberof ProjectionDcsvBody - */ projectionParameters?: Parameters } diff --git a/frontend/src/services/vdyp-api/models/projection-hcsv-body.ts b/frontend/src/services/vdyp-api/models/projection-hcsv-body.ts index 730c5946..87f5cf7c 100644 --- a/frontend/src/services/vdyp-api/models/projection-hcsv-body.ts +++ b/frontend/src/services/vdyp-api/models/projection-hcsv-body.ts @@ -1,21 +1,7 @@ import type { FileUpload } from './file-upload' import type { Parameters } from './parameters' export interface ProjectionHcsvBody { - /** - * @type {FileUpload} - * @memberof ProjectionHcsvBody - */ polygonInputData?: FileUpload - - /** - * @type {FileUpload} - * @memberof ProjectionHcsvBody - */ layersInputData?: FileUpload - - /** - * @type {Parameters} - * @memberof ProjectionHcsvBody - */ projectionParameters?: Parameters } diff --git a/frontend/src/services/vdyp-api/models/projection-scsv-body.ts b/frontend/src/services/vdyp-api/models/projection-scsv-body.ts index e75f6adf..b2dda55f 100644 --- a/frontend/src/services/vdyp-api/models/projection-scsv-body.ts +++ b/frontend/src/services/vdyp-api/models/projection-scsv-body.ts @@ -1,57 +1,13 @@ import type { FileUpload } from './file-upload' import type { Parameters } from './parameters' export interface ProjectionScsvBody { - /** - * @type {FileUpload} - * @memberof ProjectionScsvBody - */ polygonInputData?: FileUpload - - /** - * @type {FileUpload} - * @memberof ProjectionScsvBody - */ layersInputData?: FileUpload - - /** - * @type {FileUpload} - * @memberof ProjectionScsvBody - */ historyInputData?: FileUpload - - /** - * @type {FileUpload} - * @memberof ProjectionScsvBody - */ nonVegetationInputData?: FileUpload - - /** - * @type {FileUpload} - * @memberof ProjectionScsvBody - */ otherVegetationInputData?: FileUpload - - /** - * @type {FileUpload} - * @memberof ProjectionScsvBody - */ polygonIdInputData?: FileUpload - - /** - * @type {FileUpload} - * @memberof ProjectionScsvBody - */ speciesInputData?: FileUpload - - /** - * @type {FileUpload} - * @memberof ProjectionScsvBody - */ vriAdjustInputData?: FileUpload - - /** - * @type {Parameters} - * @memberof ProjectionScsvBody - */ projectionParameters?: Parameters } diff --git a/frontend/src/services/vdyp-api/models/utilization-parameter.ts b/frontend/src/services/vdyp-api/models/utilization-parameter.ts index ae36d9a8..e9b34272 100644 --- a/frontend/src/services/vdyp-api/models/utilization-parameter.ts +++ b/frontend/src/services/vdyp-api/models/utilization-parameter.ts @@ -1,14 +1,5 @@ import { ValueEnum } from './value-enum' export interface UtilizationParameter { - /** - * @type {string} - * @memberof UtilizationParameter - */ speciesName?: string - - /** - * @type {ValueEnum} - * @memberof UtilizationParameter - */ value?: ValueEnum } From 107ffc3f7b745a8d09b3dd577cc986a69b647216 Mon Sep 17 00:00:00 2001 From: Roy Jeong Date: Wed, 11 Dec 2024 21:57:24 -0800 Subject: [PATCH 3/4] Delete unused dcsvprojection/scsvprojection api client libraries --- frontend/src/services/vdyp-api/api.ts | 2 - .../vdyp-api/apis/run-dcsvprojection-api.ts | 148 ----------- .../vdyp-api/apis/run-scsvprojection-api.ts | 237 ------------------ .../services/vdyp-api/models/root-resource.ts | 1 - 4 files changed, 388 deletions(-) delete mode 100644 frontend/src/services/vdyp-api/apis/run-dcsvprojection-api.ts delete mode 100644 frontend/src/services/vdyp-api/apis/run-scsvprojection-api.ts diff --git a/frontend/src/services/vdyp-api/api.ts b/frontend/src/services/vdyp-api/api.ts index 9996851f..3f974b97 100644 --- a/frontend/src/services/vdyp-api/api.ts +++ b/frontend/src/services/vdyp-api/api.ts @@ -1,5 +1,3 @@ export * from './apis/get-help-api' export * from './apis/get-root-api' -export * from './apis/run-dcsvprojection-api' export * from './apis/run-hcsvprojection-api' -export * from './apis/run-scsvprojection-api' diff --git a/frontend/src/services/vdyp-api/apis/run-dcsvprojection-api.ts b/frontend/src/services/vdyp-api/apis/run-dcsvprojection-api.ts deleted file mode 100644 index 51d8d3c0..00000000 --- a/frontend/src/services/vdyp-api/apis/run-dcsvprojection-api.ts +++ /dev/null @@ -1,148 +0,0 @@ -import globalAxios from 'axios' -import type { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios' -import { Configuration } from '../configuration' -import { BASE_PATH, BaseAPI } from '../base' -import type { RequestArgs } from '../base' -import type { FileUpload, Parameters } from '../models' -import { env } from '@/env' - -export const RunDCSVProjectionApiAxiosParamCreator = function ( - configuration?: Configuration, -) { - return { - projectionDcsvPostForm: async ( - dcsvInputData?: FileUpload, - projectionParameters?: Parameters, - trialRun?: boolean, - options: AxiosRequestConfig = {}, - ): Promise => { - const localVarPath = `/api/v8/projection/dcsv` - const localVarUrlObj = new URL(localVarPath, env.VITE_API_URL) - let baseOptions - if (configuration) { - baseOptions = configuration.baseOptions - } - const localVarRequestOptions: AxiosRequestConfig = { - method: 'POST', - ...baseOptions, - ...options, - } - const localVarHeaderParameter = {} as any - const localVarQueryParameter = {} as any - const localVarFormParams = new FormData() - - if (trialRun !== undefined) { - localVarQueryParameter['trialRun'] = trialRun - } - - if (dcsvInputData !== undefined) { - localVarFormParams.append('dcsvInputData', dcsvInputData as any) - } - - if (projectionParameters !== undefined) { - localVarFormParams.append( - 'projectionParameters', - projectionParameters as any, - ) - } - - localVarHeaderParameter['Content-Type'] = 'multipart/form-data' - const query = new URLSearchParams(localVarUrlObj.search) - for (const key in localVarQueryParameter) { - query.set(key, localVarQueryParameter[key]) - } - for (const key in options.params) { - query.set(key, options.params[key]) - } - localVarUrlObj.search = new URLSearchParams(query).toString() - const headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {} - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - } - localVarRequestOptions.data = localVarFormParams - - return { - url: - localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, - options: localVarRequestOptions, - } - }, - } -} - -export const RunDCSVProjectionApiFp = function (configuration?: Configuration) { - return { - async projectionDcsvPostForm( - dcsvInputData?: FileUpload, - projectionParameters?: Parameters, - trialRun?: boolean, - options?: AxiosRequestConfig, - ): Promise< - (axios?: AxiosInstance, basePath?: string) => Promise> - > { - const localVarAxiosArgs = await RunDCSVProjectionApiAxiosParamCreator( - configuration, - ).projectionDcsvPostForm( - dcsvInputData, - projectionParameters, - trialRun, - options, - ) - return ( - axios: AxiosInstance = globalAxios, - basePath: string = BASE_PATH, - ) => { - const axiosRequestArgs: AxiosRequestConfig = { - ...localVarAxiosArgs.options, - url: basePath + localVarAxiosArgs.url, - } - return axios.request(axiosRequestArgs) - } - }, - } -} - -export const RunDCSVProjectionApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance, -) { - return { - async projectionDcsvPostForm( - dcsvInputData?: FileUpload, - projectionParameters?: Parameters, - trialRun?: boolean, - options?: AxiosRequestConfig, - ): Promise> { - return RunDCSVProjectionApiFp(configuration) - .projectionDcsvPostForm( - dcsvInputData, - projectionParameters, - trialRun, - options, - ) - .then((request) => request(axios, basePath)) - }, - } -} - -export class RunDCSVProjectionApi extends BaseAPI { - public async projectionDcsvPostForm( - dcsvInputData?: FileUpload, - projectionParameters?: Parameters, - trialRun?: boolean, - options?: AxiosRequestConfig, - ): Promise> { - return RunDCSVProjectionApiFp(this.configuration) - .projectionDcsvPostForm( - dcsvInputData, - projectionParameters, - trialRun, - options, - ) - .then((request) => request(this.axios, this.basePath)) - } -} diff --git a/frontend/src/services/vdyp-api/apis/run-scsvprojection-api.ts b/frontend/src/services/vdyp-api/apis/run-scsvprojection-api.ts deleted file mode 100644 index e9618153..00000000 --- a/frontend/src/services/vdyp-api/apis/run-scsvprojection-api.ts +++ /dev/null @@ -1,237 +0,0 @@ -import globalAxios from 'axios' -import type { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios' -import { Configuration } from '../configuration' -import { BASE_PATH, BaseAPI } from '../base' -import type { RequestArgs } from '../base' -import type { FileUpload, Parameters } from '../models' -import { env } from '@/env' - -export const RunSCSVProjectionApiAxiosParamCreator = function ( - configuration?: Configuration, -) { - return { - projectionScsvPostForm: async ( - polygonInputData?: FileUpload, - layersInputData?: FileUpload, - historyInputData?: FileUpload, - nonVegetationInputData?: FileUpload, - otherVegetationInputData?: FileUpload, - polygonIdInputData?: FileUpload, - speciesInputData?: FileUpload, - vriAdjustInputData?: FileUpload, - projectionParameters?: Parameters, - trialRun?: boolean, - options: AxiosRequestConfig = {}, - ): Promise => { - const localVarPath = `/api/v8/projection/scsv` - const localVarUrlObj = new URL(localVarPath, env.VITE_API_URL) - let baseOptions - if (configuration) { - baseOptions = configuration.baseOptions - } - const localVarRequestOptions: AxiosRequestConfig = { - method: 'POST', - ...baseOptions, - ...options, - } - const localVarHeaderParameter = {} as any - const localVarQueryParameter = {} as any - const localVarFormParams = new FormData() - - if (trialRun !== undefined) { - localVarQueryParameter['trialRun'] = trialRun - } - - if (polygonInputData !== undefined) { - localVarFormParams.append('polygonInputData', polygonInputData as any) - } - - if (layersInputData !== undefined) { - localVarFormParams.append('layersInputData', layersInputData as any) - } - - if (historyInputData !== undefined) { - localVarFormParams.append('historyInputData', historyInputData as any) - } - - if (nonVegetationInputData !== undefined) { - localVarFormParams.append( - 'nonVegetationInputData', - nonVegetationInputData as any, - ) - } - - if (otherVegetationInputData !== undefined) { - localVarFormParams.append( - 'otherVegetationInputData', - otherVegetationInputData as any, - ) - } - - if (polygonIdInputData !== undefined) { - localVarFormParams.append( - 'polygonIdInputData', - polygonIdInputData as any, - ) - } - - if (speciesInputData !== undefined) { - localVarFormParams.append('speciesInputData', speciesInputData as any) - } - - if (vriAdjustInputData !== undefined) { - localVarFormParams.append( - 'vriAdjustInputData', - vriAdjustInputData as any, - ) - } - - if (projectionParameters !== undefined) { - localVarFormParams.append( - 'projectionParameters', - projectionParameters as any, - ) - } - - localVarHeaderParameter['Content-Type'] = 'multipart/form-data' - const query = new URLSearchParams(localVarUrlObj.search) - for (const key in localVarQueryParameter) { - query.set(key, localVarQueryParameter[key]) - } - for (const key in options.params) { - query.set(key, options.params[key]) - } - localVarUrlObj.search = new URLSearchParams(query).toString() - const headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {} - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - } - localVarRequestOptions.data = localVarFormParams - - return { - url: - localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, - options: localVarRequestOptions, - } - }, - } -} - -export const RunSCSVProjectionApiFp = function (configuration?: Configuration) { - return { - async projectionScsvPostForm( - polygonInputData?: FileUpload, - layersInputData?: FileUpload, - historyInputData?: FileUpload, - nonVegetationInputData?: FileUpload, - otherVegetationInputData?: FileUpload, - polygonIdInputData?: FileUpload, - speciesInputData?: FileUpload, - vriAdjustInputData?: FileUpload, - projectionParameters?: Parameters, - trialRun?: boolean, - options?: AxiosRequestConfig, - ): Promise< - (axios?: AxiosInstance, basePath?: string) => Promise> - > { - const localVarAxiosArgs = await RunSCSVProjectionApiAxiosParamCreator( - configuration, - ).projectionScsvPostForm( - polygonInputData, - layersInputData, - historyInputData, - nonVegetationInputData, - otherVegetationInputData, - polygonIdInputData, - speciesInputData, - vriAdjustInputData, - projectionParameters, - trialRun, - options, - ) - return ( - axios: AxiosInstance = globalAxios, - basePath: string = BASE_PATH, - ) => { - const axiosRequestArgs: AxiosRequestConfig = { - ...localVarAxiosArgs.options, - url: basePath + localVarAxiosArgs.url, - } - return axios.request(axiosRequestArgs) - } - }, - } -} - -export const RunSCSVProjectionApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance, -) { - return { - async projectionScsvPostForm( - polygonInputData?: FileUpload, - layersInputData?: FileUpload, - historyInputData?: FileUpload, - nonVegetationInputData?: FileUpload, - otherVegetationInputData?: FileUpload, - polygonIdInputData?: FileUpload, - speciesInputData?: FileUpload, - vriAdjustInputData?: FileUpload, - projectionParameters?: Parameters, - trialRun?: boolean, - options?: AxiosRequestConfig, - ): Promise> { - return RunSCSVProjectionApiFp(configuration) - .projectionScsvPostForm( - polygonInputData, - layersInputData, - historyInputData, - nonVegetationInputData, - otherVegetationInputData, - polygonIdInputData, - speciesInputData, - vriAdjustInputData, - projectionParameters, - trialRun, - options, - ) - .then((request) => request(axios, basePath)) - }, - } -} - -export class RunSCSVProjectionApi extends BaseAPI { - public async projectionScsvPostForm( - polygonInputData?: FileUpload, - layersInputData?: FileUpload, - historyInputData?: FileUpload, - nonVegetationInputData?: FileUpload, - otherVegetationInputData?: FileUpload, - polygonIdInputData?: FileUpload, - speciesInputData?: FileUpload, - vriAdjustInputData?: FileUpload, - projectionParameters?: Parameters, - trialRun?: boolean, - options?: AxiosRequestConfig, - ): Promise> { - return RunSCSVProjectionApiFp(this.configuration) - .projectionScsvPostForm( - polygonInputData, - layersInputData, - historyInputData, - nonVegetationInputData, - otherVegetationInputData, - polygonIdInputData, - speciesInputData, - vriAdjustInputData, - projectionParameters, - trialRun, - options, - ) - .then((request) => request(this.axios, this.basePath)) - } -} diff --git a/frontend/src/services/vdyp-api/models/root-resource.ts b/frontend/src/services/vdyp-api/models/root-resource.ts index 28185298..170a461d 100644 --- a/frontend/src/services/vdyp-api/models/root-resource.ts +++ b/frontend/src/services/vdyp-api/models/root-resource.ts @@ -1,5 +1,4 @@ import type { Link } from './link' - export interface RootResource { links: Link[] } From 9ae9fd697ea92d0c9103fbab50954e7511554ce1 Mon Sep 17 00:00:00 2001 From: Roy Jeong Date: Wed, 11 Dec 2024 22:00:30 -0800 Subject: [PATCH 4/4] Delete unnecessary comments --- frontend/src/services/vdyp-api/apis/get-help-api.ts | 6 +++--- frontend/src/services/vdyp-api/apis/get-root-api.ts | 6 +++--- .../vdyp-api/apis/run-hcsvprojection-api.ts | 13 +++++-------- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/frontend/src/services/vdyp-api/apis/get-help-api.ts b/frontend/src/services/vdyp-api/apis/get-help-api.ts index 6204f2ad..bf100bcc 100644 --- a/frontend/src/services/vdyp-api/apis/get-help-api.ts +++ b/frontend/src/services/vdyp-api/apis/get-help-api.ts @@ -58,7 +58,7 @@ export const GetHelpApiFp = function (configuration?: Configuration) { ( axios?: AxiosInstance, basePath?: string, - ) => Promise> + ) => Promise> > { const localVarAxiosArgs = await GetHelpApiAxiosParamCreator(configuration).helpGet(options) @@ -84,7 +84,7 @@ export const GetHelpApiFactory = function ( return { async helpGet( options?: AxiosRequestConfig, - ): Promise> { + ): Promise> { return GetHelpApiFp(configuration) .helpGet(options) .then((request) => request(axios, basePath)) @@ -95,7 +95,7 @@ export const GetHelpApiFactory = function ( export class GetHelpApi extends BaseAPI { public async helpGet( options?: AxiosRequestConfig, - ): Promise> { + ): Promise> { return GetHelpApiFp(this.configuration) .helpGet(options) .then((request) => request(this.axios, this.basePath)) diff --git a/frontend/src/services/vdyp-api/apis/get-root-api.ts b/frontend/src/services/vdyp-api/apis/get-root-api.ts index d8b2ade4..a6eaefe0 100644 --- a/frontend/src/services/vdyp-api/apis/get-root-api.ts +++ b/frontend/src/services/vdyp-api/apis/get-root-api.ts @@ -58,7 +58,7 @@ export const GetRootApiFp = function (configuration?: Configuration) { ( axios?: AxiosInstance, basePath?: string, - ) => Promise> /* edited */ + ) => Promise> > { const localVarAxiosArgs = await GetRootApiAxiosParamCreator(configuration).rootGet(options) @@ -84,7 +84,7 @@ export const GetRootApiFactory = function ( return { async rootGet( options?: AxiosRequestConfig, - ): Promise> /* edited */ { + ): Promise> { return GetRootApiFp(configuration) .rootGet(options) .then((request) => request(axios, basePath)) @@ -95,7 +95,7 @@ export const GetRootApiFactory = function ( export class GetRootApi extends BaseAPI { public async rootGet( options?: AxiosRequestConfig, - ): Promise> /* edited */ { + ): Promise> { return GetRootApiFp(this.configuration) .rootGet(options) .then((request) => request(this.axios, this.basePath)) diff --git a/frontend/src/services/vdyp-api/apis/run-hcsvprojection-api.ts b/frontend/src/services/vdyp-api/apis/run-hcsvprojection-api.ts index 63b93c6e..f49bd306 100644 --- a/frontend/src/services/vdyp-api/apis/run-hcsvprojection-api.ts +++ b/frontend/src/services/vdyp-api/apis/run-hcsvprojection-api.ts @@ -28,7 +28,7 @@ export const RunHCSVProjectionApiAxiosParamCreator = function ( headers: { Accept: 'application/octet-stream', 'Content-Type': 'multipart/form-data', - } /* edited */, + }, ...baseOptions, ...options, } @@ -91,10 +91,7 @@ export const RunHCSVProjectionApiFp = function (configuration?: Configuration) { trialRun?: boolean, options?: AxiosRequestConfig, ): Promise< - ( - axios?: AxiosInstance, - basePath?: string, - ) => Promise> /* edited */ + (axios?: AxiosInstance, basePath?: string) => Promise> > { const localVarAxiosArgs = await RunHCSVProjectionApiAxiosParamCreator( configuration, @@ -112,7 +109,7 @@ export const RunHCSVProjectionApiFp = function (configuration?: Configuration) { const axiosRequestArgs: AxiosRequestConfig = { ...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url, - responseType: 'blob' /* edited */, + responseType: 'blob', } return axios.request(axiosRequestArgs) } @@ -132,7 +129,7 @@ export const RunHCSVProjectionApiFactory = function ( projectionParameters?: Parameters, trialRun?: boolean, options?: AxiosRequestConfig, - ): Promise> /* edited */ { + ): Promise> { return RunHCSVProjectionApiFp(configuration) .projectionHcsvPostForm( polygonInputData, @@ -153,7 +150,7 @@ export class RunHCSVProjectionApi extends BaseAPI { projectionParameters?: Parameters, trialRun?: boolean, options?: AxiosRequestConfig, - ): Promise> /* edited */ { + ): Promise> { return RunHCSVProjectionApiFp(this.configuration) .projectionHcsvPostForm( polygonInputData,