From ec1a2a66b0d27ce0049653cfde1a9c36b9de2f10 Mon Sep 17 00:00:00 2001 From: Roy Jeong Date: Wed, 27 Nov 2024 17:07:05 -0800 Subject: [PATCH 1/8] VDYP-500, functionality to download the API response zip file containing projection results --- .../ReportInfo.vue | 3 + .../model-param-selection-panes/SiteInfo.vue | 2 + .../SpeciesInfo.vue | 3 + .../StandDensity.vue | 2 + frontend/src/constants/constants.ts | 4 ++ frontend/src/constants/message.ts | 10 +++ frontend/src/services/apiActions.ts | 13 +++- frontend/src/services/apiClient.ts | 11 ++- .../vdyp-api/apis/help-endpoint-api.ts | 2 +- .../vdyp-api/apis/projection-endpoint-api.ts | 8 +-- .../vdyp-api/apis/root-endpoint-api.ts | 15 ++-- .../src/services/vdyp-api/models/index.ts | 2 + frontend/src/services/vdyp-api/models/link.ts | 5 ++ .../services/vdyp-api/models/root-resource.ts | 5 ++ .../input-model-parameters/FileUpload.vue | 68 +++++++++++-------- 15 files changed, 111 insertions(+), 42 deletions(-) create mode 100644 frontend/src/services/vdyp-api/models/link.ts create mode 100644 frontend/src/services/vdyp-api/models/root-resource.ts diff --git a/frontend/src/components/model-param-selection-panes/ReportInfo.vue b/frontend/src/components/model-param-selection-panes/ReportInfo.vue index c5172e19a..adbd064c1 100644 --- a/frontend/src/components/model-param-selection-panes/ReportInfo.vue +++ b/frontend/src/components/model-param-selection-panes/ReportInfo.vue @@ -287,7 +287,10 @@ const onConfirm = () => { if (validateComparison() && validateRange()) { if (form.value) { form.value.validate() + } else { + console.warn('Form reference is null. Validation skipped.') } + // this panel is not in a confirmed state if (!isConfirmed.value) { modelParameterStore.confirmPanel(panelName) diff --git a/frontend/src/components/model-param-selection-panes/SiteInfo.vue b/frontend/src/components/model-param-selection-panes/SiteInfo.vue index f3f0c035d..6856a7dad 100644 --- a/frontend/src/components/model-param-selection-panes/SiteInfo.vue +++ b/frontend/src/components/model-param-selection-panes/SiteInfo.vue @@ -394,6 +394,8 @@ const onConfirm = () => { if (validateRequiredFields() && validateRange()) { if (form.value) { form.value.validate() + } else { + console.warn('Form reference is null. Validation skipped.') } formattingValues() diff --git a/frontend/src/components/model-param-selection-panes/SpeciesInfo.vue b/frontend/src/components/model-param-selection-panes/SpeciesInfo.vue index cfdc2124c..874542baf 100644 --- a/frontend/src/components/model-param-selection-panes/SpeciesInfo.vue +++ b/frontend/src/components/model-param-selection-panes/SpeciesInfo.vue @@ -486,7 +486,10 @@ const onConfirm = () => { ) { if (form.value) { form.value.validate() + } else { + console.warn('Form reference is null. Validation skipped.') } + // this panel is not in a confirmed state if (!isConfirmed.value) { modelParameterStore.confirmPanel(panelName) diff --git a/frontend/src/components/model-param-selection-panes/StandDensity.vue b/frontend/src/components/model-param-selection-panes/StandDensity.vue index f385b69fd..3db705161 100644 --- a/frontend/src/components/model-param-selection-panes/StandDensity.vue +++ b/frontend/src/components/model-param-selection-panes/StandDensity.vue @@ -138,6 +138,8 @@ const onConfirm = async () => { if (form.value) { form.value.validate() + } else { + console.warn('Form reference is null. Validation skipped.') } // this panel is not in a confirmed state diff --git a/frontend/src/constants/constants.ts b/frontend/src/constants/constants.ts index 09c1ee1d8..2e2667233 100644 --- a/frontend/src/constants/constants.ts +++ b/frontend/src/constants/constants.ts @@ -114,3 +114,7 @@ export const MODEL_PARAM_TAB_NAME = Object.freeze({ VIEW_LOG_FILE: 'View Log File', VIEW_ERROR_MESSAGES: 'View Error Messages', }) + +export const DOWNLOAD_FILE_NAME = Object.freeze({ + MULTI_POLYGON_OUTPUT: 'vdyp-output.zip', +}) diff --git a/frontend/src/constants/message.ts b/frontend/src/constants/message.ts index c736fd1c6..f1f9bec22 100644 --- a/frontend/src/constants/message.ts +++ b/frontend/src/constants/message.ts @@ -101,4 +101,14 @@ export const FILE_UPLOAD_ERR = Object.freeze({ 'The response is missing one or more required files. Please contact support or try again later.', INVALID_RESPONSED_FILE: 'The response contains invalid or corrupted files. Please contact support or try again later.', + FAIL_RUN_MODEL: 'Failed to run Model', +}) + +export const PROGRESS_MSG = Object.freeze({ + RUNNING_MODEL: 'Running Model...', +}) + +export const SUCESS_MSG = Object.freeze({ + FILE_UPLOAD_RUN_MODEL_RESULT: + 'The output file has been successfully downloaded.', }) diff --git a/frontend/src/services/apiActions.ts b/frontend/src/services/apiActions.ts index 5ff63fc7d..559752a7d 100644 --- a/frontend/src/services/apiActions.ts +++ b/frontend/src/services/apiActions.ts @@ -1,6 +1,11 @@ import apiClient from '@/services/apiClient' +import type { + ProjectionHcsvPostRequest, + ParameterDetailsMessage, + RootResource, +} from '@/services/vdyp-api' -export const helpGet = async (): Promise => { +export const helpGet = async (): Promise => { try { const response = await apiClient.helpGet() return response.data @@ -10,7 +15,9 @@ export const helpGet = async (): Promise => { } } -export const projectionHcsvPost = async (body: any): Promise => { +export const projectionHcsvPost = async ( + body: ProjectionHcsvPostRequest, +): Promise => { try { const response = await apiClient.projectionHcsvPost(body) return response.data @@ -20,7 +27,7 @@ export const projectionHcsvPost = async (body: any): Promise => { } } -export const rootGet = async (): Promise => { +export const rootGet = async (): Promise => { try { const response = await apiClient.rootGet() return response.data diff --git a/frontend/src/services/apiClient.ts b/frontend/src/services/apiClient.ts index 0727ae10b..f1780fa94 100644 --- a/frontend/src/services/apiClient.ts +++ b/frontend/src/services/apiClient.ts @@ -4,6 +4,8 @@ import { RootEndpointApi, } from '@/services/vdyp-api/' import axiosInstance from '@/services/axiosInstance' +import type { ProjectionHcsvPostRequest } from '@/services/vdyp-api' +import type { AxiosRequestConfig } from 'axios' const helpApiInstance = new HelpEndpointApi(undefined, undefined, axiosInstance) const projectionApiInstance = new ProjectionEndpointApi( @@ -14,15 +16,18 @@ const projectionApiInstance = new ProjectionEndpointApi( const rootApiInstance = new RootEndpointApi(undefined, undefined, axiosInstance) export const apiClient = { - helpGet: (options?: any) => { + helpGet: (options?: AxiosRequestConfig) => { return helpApiInstance.v8HelpGet(options) }, - projectionHcsvPost: (body?: any, options?: any) => { + projectionHcsvPost: ( + body?: ProjectionHcsvPostRequest, + options?: AxiosRequestConfig, + ) => { return projectionApiInstance.v8ProjectionHcsvPost(body, options) }, - rootGet: (options?: any) => { + rootGet: (options?: AxiosRequestConfig) => { return rootApiInstance.v8Get(options) }, } diff --git a/frontend/src/services/vdyp-api/apis/help-endpoint-api.ts b/frontend/src/services/vdyp-api/apis/help-endpoint-api.ts index 994f64b1d..d8de97958 100644 --- a/frontend/src/services/vdyp-api/apis/help-endpoint-api.ts +++ b/frontend/src/services/vdyp-api/apis/help-endpoint-api.ts @@ -5,7 +5,7 @@ import type { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios' import { Configuration } from '../configuration' // Some imports not used depending on template conditions // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError } from '../base' +import { BASE_PATH, BaseAPI, RequiredError } from '../base' import type { RequestArgs } from '../base' import type { ParameterDetailsMessage } from '../models' diff --git a/frontend/src/services/vdyp-api/apis/projection-endpoint-api.ts b/frontend/src/services/vdyp-api/apis/projection-endpoint-api.ts index 24aa183ae..134f2221d 100644 --- a/frontend/src/services/vdyp-api/apis/projection-endpoint-api.ts +++ b/frontend/src/services/vdyp-api/apis/projection-endpoint-api.ts @@ -5,7 +5,7 @@ import type { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios' import { Configuration } from '../configuration' // Some imports not used depending on template conditions // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError } from '../base' +import { BASE_PATH, BaseAPI, RequiredError } from '../base' import type { RequestArgs } from '../base' import type { ProjectionDcsvPostRequest, @@ -68,7 +68,7 @@ export const ProjectionEndpointApiAxiosParamCreator = function ( (localVarRequestOptions.headers && localVarRequestOptions.headers['Content-Type'] === 'application/json') localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) + ? JSON.stringify(body ?? {}) : body || '' return { @@ -125,7 +125,7 @@ export const ProjectionEndpointApiAxiosParamCreator = function ( (localVarRequestOptions.headers && localVarRequestOptions.headers['Content-Type'] === 'application/json') localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) + ? JSON.stringify(body ?? {}) : body || '' return { @@ -181,7 +181,7 @@ export const ProjectionEndpointApiAxiosParamCreator = function ( (localVarRequestOptions.headers && localVarRequestOptions.headers['Content-Type'] === 'application/json') localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) + ? JSON.stringify(body ?? {}) : body || '' return { diff --git a/frontend/src/services/vdyp-api/apis/root-endpoint-api.ts b/frontend/src/services/vdyp-api/apis/root-endpoint-api.ts index 874bd6460..18475feef 100644 --- a/frontend/src/services/vdyp-api/apis/root-endpoint-api.ts +++ b/frontend/src/services/vdyp-api/apis/root-endpoint-api.ts @@ -5,8 +5,10 @@ import type { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios' import { Configuration } from '../configuration' // Some imports not used depending on template conditions // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError } from '../base' +import { BASE_PATH, BaseAPI, RequiredError } from '../base' import type { RequestArgs } from '../base' +import type { RootResource } from '../models' + /** * RootEndpointApi - axios parameter creator * @export @@ -75,7 +77,10 @@ export const RootEndpointApiFp = function (configuration?: Configuration) { async v8Get( options?: AxiosRequestConfig, ): Promise< - (axios?: AxiosInstance, basePath?: string) => Promise> + ( + axios?: AxiosInstance, + basePath?: string, + ) => Promise> > { const localVarAxiosArgs = await RootEndpointApiAxiosParamCreator(configuration).v8Get(options) @@ -108,7 +113,9 @@ export const RootEndpointApiFactory = function ( * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async v8Get(options?: AxiosRequestConfig): Promise> { + async v8Get( + options?: AxiosRequestConfig, + ): Promise> { return RootEndpointApiFp(configuration) .v8Get(options) .then((request) => request(axios /* edited */)) @@ -131,7 +138,7 @@ export class RootEndpointApi extends BaseAPI { */ public async v8Get( options?: AxiosRequestConfig, - ): Promise> { + ): Promise> { return RootEndpointApiFp(this.configuration) .v8Get(options) .then((request) => request(this.axios /* edited */)) diff --git a/frontend/src/services/vdyp-api/models/index.ts b/frontend/src/services/vdyp-api/models/index.ts index e0c0ac108..83d234401 100644 --- a/frontend/src/services/vdyp-api/models/index.ts +++ b/frontend/src/services/vdyp-api/models/index.ts @@ -1,5 +1,6 @@ export * from './combine-age-year-range-enum' export * from './filters' +export * from './link' /* added */ export * from './metadata-to-output-enum' export * from './output-format-enum' export * from './parameters' @@ -9,6 +10,7 @@ export * from './parameters-utils-inner' export * from './projection-dcsv-post-request' export * from './projection-hcsv-post-request' export * from './projection-scsv-post-request' +export * from './root-resource' /* added */ export * from './selected-debug-options-enum' export * from './selected-execution-options-enum' export * from './value-enum' diff --git a/frontend/src/services/vdyp-api/models/link.ts b/frontend/src/services/vdyp-api/models/link.ts new file mode 100644 index 000000000..52381da81 --- /dev/null +++ b/frontend/src/services/vdyp-api/models/link.ts @@ -0,0 +1,5 @@ +export interface Link { + href: string + method: string + rel: string +} diff --git a/frontend/src/services/vdyp-api/models/root-resource.ts b/frontend/src/services/vdyp-api/models/root-resource.ts new file mode 100644 index 000000000..973925cea --- /dev/null +++ b/frontend/src/services/vdyp-api/models/root-resource.ts @@ -0,0 +1,5 @@ +import type { Link } from './link' + +export interface RootResource { + links: Array +} diff --git a/frontend/src/views/input-model-parameters/FileUpload.vue b/frontend/src/views/input-model-parameters/FileUpload.vue index 4463a45d0..ad8c37347 100644 --- a/frontend/src/views/input-model-parameters/FileUpload.vue +++ b/frontend/src/views/input-model-parameters/FileUpload.vue @@ -180,25 +180,33 @@ From 74da2baac9210c2444d39f5d17ce1c33690a9b43 Mon Sep 17 00:00:00 2001 From: Roy Jeong Date: Wed, 11 Dec 2024 09:21:07 -0800 Subject: [PATCH 2/8] Re-config proxy --- frontend/Caddyfile | 12 +++++------- frontend/vite.config.ts | 1 - 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/frontend/Caddyfile b/frontend/Caddyfile index 37222e810..d64479f16 100644 --- a/frontend/Caddyfile +++ b/frontend/Caddyfile @@ -31,13 +31,11 @@ } rewrite @spa_router {http.matchers.file.relative} # Proxy requests to API service - handle_path /api/* { - reverse_proxy {$VITE_API_URL} { - header_up Host {http.reverse_proxy.upstream.hostport} - header_up X-Real-IP {remote_host} - header_up X-Forwarded-For {remote_host} - } - } + reverse_proxy /api/* {$VITE_API_URL} { + header_up Host {http.reverse_proxy.upstream.hostport} + header_up X-Real-IP {remote_host} + header_up X-Forwarded-For {remote_host} + } header { X-Frame-Options "SAMEORIGIN" X-XSS-Protection "1;mode=block" diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index bc71fcdf0..556ed4d42 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -44,7 +44,6 @@ export default defineConfig(({ mode }) => { '/api': { target: process.env.VITE_API_URL, changeOrigin: true, - rewrite: (path) => path.replace(/^\/api/, ''), }, }, }, From cbf25b625a25990b142d8ee70811e743ca94f250 Mon Sep 17 00:00:00 2001 From: Roy Jeong Date: Wed, 11 Dec 2024 09:44:22 -0800 Subject: [PATCH 3/8] new client-lib --- frontend/src/constants/message.ts | 5 +- frontend/src/router/routes.ts | 6 + frontend/src/services/apiActions.ts | 11 +- frontend/src/services/apiClient.ts | 28 +- frontend/src/services/vdyp-api/api.ts | 8 +- .../{help-endpoint-api.ts => get-help-api.ts} | 54 ++- .../{root-endpoint-api.ts => get-root-api.ts} | 52 +-- .../vdyp-api/apis/projection-endpoint-api.ts | 395 ------------------ .../vdyp-api/apis/run-dcsvprojection-api.ts | 152 +++++++ .../vdyp-api/apis/run-hcsvprojection-api.ts | 170 ++++++++ .../vdyp-api/apis/run-scsvprojection-api.ts | 302 +++++++++++++ frontend/src/services/vdyp-api/base.ts | 3 +- .../services/vdyp-api/models/enum-value.ts | 7 + .../services/vdyp-api/models/file-upload.ts | 3 + .../src/services/vdyp-api/models/index.ts | 18 +- frontend/src/services/vdyp-api/models/link.ts | 2 +- .../models/parameters-progress-frequency.ts | 3 - .../services/vdyp-api/models/parameters.ts | 30 +- .../vdyp-api/models/progress-frequency.ts | 16 + .../vdyp-api/models/projection-dcsv-body.ts | 17 + .../models/projection-dcsv-post-request.ts | 16 - .../vdyp-api/models/projection-hcsv-body.ts | 23 + .../models/projection-hcsv-post-request.ts | 22 - .../vdyp-api/models/projection-scsv-body.ts | 59 +++ .../models/projection-scsv-post-request.ts | 58 --- .../services/vdyp-api/models/root-resource.ts | 2 +- .../models/selected-execution-options-enum.ts | 3 + ...tils-inner.ts => utilization-parameter.ts} | 6 +- .../input-model-parameters/FileUpload.vue | 34 +- frontend/src/views/test/ParameterDetail.vue | 67 +++ 30 files changed, 949 insertions(+), 623 deletions(-) rename frontend/src/services/vdyp-api/apis/{help-endpoint-api.ts => get-help-api.ts} (71%) rename frontend/src/services/vdyp-api/apis/{root-endpoint-api.ts => get-root-api.ts} (71%) delete mode 100644 frontend/src/services/vdyp-api/apis/projection-endpoint-api.ts create mode 100644 frontend/src/services/vdyp-api/apis/run-dcsvprojection-api.ts create mode 100644 frontend/src/services/vdyp-api/apis/run-hcsvprojection-api.ts create mode 100644 frontend/src/services/vdyp-api/apis/run-scsvprojection-api.ts create mode 100644 frontend/src/services/vdyp-api/models/enum-value.ts create mode 100644 frontend/src/services/vdyp-api/models/file-upload.ts delete mode 100644 frontend/src/services/vdyp-api/models/parameters-progress-frequency.ts create mode 100644 frontend/src/services/vdyp-api/models/progress-frequency.ts create mode 100644 frontend/src/services/vdyp-api/models/projection-dcsv-body.ts delete mode 100644 frontend/src/services/vdyp-api/models/projection-dcsv-post-request.ts create mode 100644 frontend/src/services/vdyp-api/models/projection-hcsv-body.ts delete mode 100644 frontend/src/services/vdyp-api/models/projection-hcsv-post-request.ts create mode 100644 frontend/src/services/vdyp-api/models/projection-scsv-body.ts delete mode 100644 frontend/src/services/vdyp-api/models/projection-scsv-post-request.ts rename frontend/src/services/vdyp-api/models/{parameters-utils-inner.ts => utilization-parameter.ts} (63%) create mode 100644 frontend/src/views/test/ParameterDetail.vue diff --git a/frontend/src/constants/message.ts b/frontend/src/constants/message.ts index f1f9bec22..1b678fe8f 100644 --- a/frontend/src/constants/message.ts +++ b/frontend/src/constants/message.ts @@ -101,7 +101,7 @@ export const FILE_UPLOAD_ERR = Object.freeze({ 'The response is missing one or more required files. Please contact support or try again later.', INVALID_RESPONSED_FILE: 'The response contains invalid or corrupted files. Please contact support or try again later.', - FAIL_RUN_MODEL: 'Failed to run Model', + FAIL_RUN_MODEL: 'Failed to run the projection model.', }) export const PROGRESS_MSG = Object.freeze({ @@ -109,6 +109,5 @@ export const PROGRESS_MSG = Object.freeze({ }) export const SUCESS_MSG = Object.freeze({ - FILE_UPLOAD_RUN_MODEL_RESULT: - 'The output file has been successfully downloaded.', + FILE_UPLOAD_RUN_MODEL_RESULT: 'File successfully downloaded.', }) diff --git a/frontend/src/router/routes.ts b/frontend/src/router/routes.ts index 2b247b1cc..ce55cde9e 100644 --- a/frontend/src/router/routes.ts +++ b/frontend/src/router/routes.ts @@ -2,6 +2,7 @@ import type { RouteRecordRaw } from 'vue-router' import ModelParameterInput from '@/views/input-model-parameters/ModelParameterInput.vue' import PageNotFound from '@/views/PageNotFound.vue' import AuthInfo from '@/views/test/AuthInfo.vue' +import ParameterDetail from '@/views/test/ParameterDetail.vue' export const routes: Array = [ { @@ -14,5 +15,10 @@ export const routes: Array = [ name: 'AuthInfo', component: AuthInfo, }, + { + path: '/param-detail', + name: 'ParameterDetail', + component: ParameterDetail, + }, { path: '/:pathMatch(.*)*', name: 'NotFound', component: PageNotFound }, ] diff --git a/frontend/src/services/apiActions.ts b/frontend/src/services/apiActions.ts index 559752a7d..8ecf4e3b3 100644 --- a/frontend/src/services/apiActions.ts +++ b/frontend/src/services/apiActions.ts @@ -1,9 +1,5 @@ import apiClient from '@/services/apiClient' -import type { - ProjectionHcsvPostRequest, - ParameterDetailsMessage, - RootResource, -} from '@/services/vdyp-api' +import type { ParameterDetailsMessage, RootResource } from '@/services/vdyp-api' export const helpGet = async (): Promise => { try { @@ -16,10 +12,11 @@ export const helpGet = async (): Promise => { } export const projectionHcsvPost = async ( - body: ProjectionHcsvPostRequest, + formData: FormData, + trialRun: boolean = false, ): Promise => { try { - const response = await apiClient.projectionHcsvPost(body) + const response = await apiClient.projectionHcsvPost(formData, trialRun) return response.data } catch (error) { console.error('Error running projection:', error) diff --git a/frontend/src/services/apiClient.ts b/frontend/src/services/apiClient.ts index f1780fa94..a7ea9b486 100644 --- a/frontend/src/services/apiClient.ts +++ b/frontend/src/services/apiClient.ts @@ -1,34 +1,40 @@ import { - HelpEndpointApi, - ProjectionEndpointApi, - RootEndpointApi, + GetHelpApi, + GetRootApi, + RunHCSVProjectionApi, } from '@/services/vdyp-api/' import axiosInstance from '@/services/axiosInstance' -import type { ProjectionHcsvPostRequest } from '@/services/vdyp-api' import type { AxiosRequestConfig } from 'axios' -const helpApiInstance = new HelpEndpointApi(undefined, undefined, axiosInstance) -const projectionApiInstance = new ProjectionEndpointApi( +const helpApiInstance = new GetHelpApi(undefined, undefined, axiosInstance) +const rootApiInstance = new GetRootApi(undefined, undefined, axiosInstance) +const projectionApiInstance = new RunHCSVProjectionApi( undefined, undefined, axiosInstance, ) -const rootApiInstance = new RootEndpointApi(undefined, undefined, axiosInstance) export const apiClient = { helpGet: (options?: AxiosRequestConfig) => { - return helpApiInstance.v8HelpGet(options) + return helpApiInstance.helpGet(options) }, projectionHcsvPost: ( - body?: ProjectionHcsvPostRequest, + formData: FormData, + trialRun: boolean, options?: AxiosRequestConfig, ) => { - return projectionApiInstance.v8ProjectionHcsvPost(body, options) + return projectionApiInstance.projectionHcsvPostForm( + formData.get('polygonInputData') as File, + formData.get('layersInputData') as File, + formData.get('projectionParameters') as any, + trialRun, + options, + ) }, rootGet: (options?: AxiosRequestConfig) => { - return rootApiInstance.v8Get(options) + return rootApiInstance.rootGet(options) }, } diff --git a/frontend/src/services/vdyp-api/api.ts b/frontend/src/services/vdyp-api/api.ts index 97f4bc0c5..8f5ab3fdd 100644 --- a/frontend/src/services/vdyp-api/api.ts +++ b/frontend/src/services/vdyp-api/api.ts @@ -1,5 +1,7 @@ /* tslint:disable */ /* eslint-disable */ -export * from './apis/help-endpoint-api' -export * from './apis/projection-endpoint-api' -export * from './apis/root-endpoint-api' +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/help-endpoint-api.ts b/frontend/src/services/vdyp-api/apis/get-help-api.ts similarity index 71% rename from frontend/src/services/vdyp-api/apis/help-endpoint-api.ts rename to frontend/src/services/vdyp-api/apis/get-help-api.ts index d8de97958..9ff57c03a 100644 --- a/frontend/src/services/vdyp-api/apis/help-endpoint-api.ts +++ b/frontend/src/services/vdyp-api/apis/get-help-api.ts @@ -8,12 +8,11 @@ import { Configuration } from '../configuration' import { BASE_PATH, BaseAPI, RequiredError } from '../base' import type { RequestArgs } from '../base' import type { ParameterDetailsMessage } from '../models' - /** - * HelpEndpointApi - axios parameter creator + * GetHelpApi - axios parameter creator * @export */ -export const HelpEndpointApiAxiosParamCreator = function ( +export const GetHelpApiAxiosParamCreator = function ( configuration?: Configuration, ) { return { @@ -22,10 +21,8 @@ export const HelpEndpointApiAxiosParamCreator = function ( * @param {*} [options] Override http request option. * @throws {RequiredError} */ - v8HelpGet: async ( - options: AxiosRequestConfig = {}, - ): Promise => { - const localVarPath = `/api/v8/help` /* edited */ + 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') let baseOptions @@ -36,7 +33,6 @@ export const HelpEndpointApiAxiosParamCreator = function ( method: 'GET', ...baseOptions, ...options, - responseType: 'json' /* edited */, } const localVarHeaderParameter = {} as any const localVarQueryParameter = {} as any @@ -67,17 +63,17 @@ export const HelpEndpointApiAxiosParamCreator = function ( } /** - * HelpEndpointApi - functional programming interface + * GetHelpApi - functional programming interface * @export */ -export const HelpEndpointApiFp = function (configuration?: Configuration) { +export const GetHelpApiFp = function (configuration?: Configuration) { return { /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async v8HelpGet( + async helpGet( options?: AxiosRequestConfig, ): Promise< ( @@ -86,28 +82,26 @@ export const HelpEndpointApiFp = function (configuration?: Configuration) { ) => Promise> > { const localVarAxiosArgs = - await HelpEndpointApiAxiosParamCreator(configuration).v8HelpGet(options) + await GetHelpApiAxiosParamCreator(configuration).helpGet(options) return ( axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH, ) => { const axiosRequestArgs: AxiosRequestConfig = { ...localVarAxiosArgs.options, - url: /* edited */ localVarAxiosArgs.url, + url: basePath + localVarAxiosArgs.url, } - return axios.request( - axiosRequestArgs, - ) + return axios.request(axiosRequestArgs) } }, } } /** - * HelpEndpointApi - factory interface + * GetHelpApi - factory interface * @export */ -export const HelpEndpointApiFactory = function ( +export const GetHelpApiFactory = function ( configuration?: Configuration, basePath?: string, axios?: AxiosInstance, @@ -118,34 +112,34 @@ export const HelpEndpointApiFactory = function ( * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async v8HelpGet( + async helpGet( options?: AxiosRequestConfig, ): Promise> { - return HelpEndpointApiFp(configuration) - .v8HelpGet(options) - .then((request) => request(axios /* edited */)) + return GetHelpApiFp(configuration) + .helpGet(options) + .then((request) => request(axios, basePath)) }, } } /** - * HelpEndpointApi - object-oriented interface + * GetHelpApi - object-oriented interface * @export - * @class HelpEndpointApi + * @class GetHelpApi * @extends {BaseAPI} */ -export class HelpEndpointApi extends BaseAPI { +export class GetHelpApi extends BaseAPI { /** * * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof HelpEndpointApi + * @memberof GetHelpApi */ - public async v8HelpGet( + public async helpGet( options?: AxiosRequestConfig, ): Promise> { - return HelpEndpointApiFp(this.configuration) - .v8HelpGet(options) - .then((request) => request(this.axios /* edited */)) + return GetHelpApiFp(this.configuration) + .helpGet(options) + .then((request) => request(this.axios, this.basePath)) } } diff --git a/frontend/src/services/vdyp-api/apis/root-endpoint-api.ts b/frontend/src/services/vdyp-api/apis/get-root-api.ts similarity index 71% rename from frontend/src/services/vdyp-api/apis/root-endpoint-api.ts rename to frontend/src/services/vdyp-api/apis/get-root-api.ts index 18475feef..1e15de511 100644 --- a/frontend/src/services/vdyp-api/apis/root-endpoint-api.ts +++ b/frontend/src/services/vdyp-api/apis/get-root-api.ts @@ -10,10 +10,10 @@ import type { RequestArgs } from '../base' import type { RootResource } from '../models' /** - * RootEndpointApi - axios parameter creator + * GetRootApi - axios parameter creator * @export */ -export const RootEndpointApiAxiosParamCreator = function ( +export const GetRootApiAxiosParamCreator = function ( configuration?: Configuration, ) { return { @@ -22,8 +22,8 @@ export const RootEndpointApiAxiosParamCreator = function ( * @param {*} [options] Override http request option. * @throws {RequiredError} */ - v8Get: async (options: AxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/v8` /* edited */ + 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') let baseOptions @@ -64,33 +64,33 @@ export const RootEndpointApiAxiosParamCreator = function ( } /** - * RootEndpointApi - functional programming interface + * GetRootApi - functional programming interface * @export */ -export const RootEndpointApiFp = function (configuration?: Configuration) { +export const GetRootApiFp = function (configuration?: Configuration) { return { /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async v8Get( + async rootGet( options?: AxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, - ) => Promise> + ) => Promise> /* edited */ > { const localVarAxiosArgs = - await RootEndpointApiAxiosParamCreator(configuration).v8Get(options) + await GetRootApiAxiosParamCreator(configuration).rootGet(options) return ( axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH, ) => { const axiosRequestArgs: AxiosRequestConfig = { ...localVarAxiosArgs.options, - url: /* edited */ localVarAxiosArgs.url, + url: basePath + localVarAxiosArgs.url, } return axios.request(axiosRequestArgs) } @@ -99,10 +99,10 @@ export const RootEndpointApiFp = function (configuration?: Configuration) { } /** - * RootEndpointApi - factory interface + * GetRootApi - factory interface * @export */ -export const RootEndpointApiFactory = function ( +export const GetRootApiFactory = function ( configuration?: Configuration, basePath?: string, axios?: AxiosInstance, @@ -113,34 +113,34 @@ export const RootEndpointApiFactory = function ( * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async v8Get( + async rootGet( options?: AxiosRequestConfig, - ): Promise> { - return RootEndpointApiFp(configuration) - .v8Get(options) - .then((request) => request(axios /* edited */)) + ): Promise> /* edited */ { + return GetRootApiFp(configuration) + .rootGet(options) + .then((request) => request(axios, basePath)) }, } } /** - * RootEndpointApi - object-oriented interface + * GetRootApi - object-oriented interface * @export - * @class RootEndpointApi + * @class GetRootApi * @extends {BaseAPI} */ -export class RootEndpointApi extends BaseAPI { +export class GetRootApi extends BaseAPI { /** * * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof RootEndpointApi + * @memberof GetRootApi */ - public async v8Get( + public async rootGet( options?: AxiosRequestConfig, - ): Promise> { - return RootEndpointApiFp(this.configuration) - .v8Get(options) - .then((request) => request(this.axios /* edited */)) + ): Promise> /* edited */ { + return GetRootApiFp(this.configuration) + .rootGet(options) + .then((request) => request(this.axios, this.basePath)) } } diff --git a/frontend/src/services/vdyp-api/apis/projection-endpoint-api.ts b/frontend/src/services/vdyp-api/apis/projection-endpoint-api.ts deleted file mode 100644 index 134f2221d..000000000 --- a/frontend/src/services/vdyp-api/apis/projection-endpoint-api.ts +++ /dev/null @@ -1,395 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -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 type { RequestArgs } from '../base' -import type { - ProjectionDcsvPostRequest, - ProjectionHcsvPostRequest, - ProjectionScsvPostRequest, -} from '../models' - -/** - * ProjectionEndpointApi - axios parameter creator - * @export - */ -export const ProjectionEndpointApiAxiosParamCreator = function ( - configuration?: Configuration, -) { - return { - /** - * - * @param {ProjectionDcsvPostRequest} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - v8ProjectionDcsvPost: async ( - body?: ProjectionDcsvPostRequest, - options: AxiosRequestConfig = {}, - ): Promise => { - const localVarPath = `/v8/projection/dcsv` - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com') - let baseOptions - if (configuration) { - baseOptions = configuration.baseOptions - } - const localVarRequestOptions: AxiosRequestConfig = { - method: 'POST', - ...baseOptions, - ...options, - } - const localVarHeaderParameter = {} as any - const localVarQueryParameter = {} as any - - localVarHeaderParameter['Content-Type'] = 'application/json' - - 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() - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {} - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - } - const needsSerialization = - typeof body !== 'string' || - (localVarRequestOptions.headers && - localVarRequestOptions.headers['Content-Type'] === 'application/json') - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body ?? {}) - : body || '' - - return { - url: - localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, - options: localVarRequestOptions, - } - }, - /** - * - * @param {ProjectionHcsvPostRequest} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - v8ProjectionHcsvPost: async ( - body?: ProjectionHcsvPostRequest, - options: AxiosRequestConfig = {}, - ): Promise => { - const localVarPath = `/api/v8/projection/hcsv` /* edited */ - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com') - let baseOptions - if (configuration) { - baseOptions = configuration.baseOptions - } - const localVarRequestOptions: AxiosRequestConfig = { - method: 'POST', - ...baseOptions, - ...options, - responseType: 'blob' /* edited */, - } - const localVarHeaderParameter = {} as any - const localVarQueryParameter = {} as any - - localVarHeaderParameter['Content-Type'] = 'application/json' - - 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() - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {} - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - } - const needsSerialization = - typeof body !== 'string' || - (localVarRequestOptions.headers && - localVarRequestOptions.headers['Content-Type'] === 'application/json') - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body ?? {}) - : body || '' - - return { - url: - localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, - options: localVarRequestOptions, - } - }, - /** - * - * @param {ProjectionScsvPostRequest} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - v8ProjectionScsvPost: async ( - body?: ProjectionScsvPostRequest, - options: AxiosRequestConfig = {}, - ): Promise => { - const localVarPath = `/v8/projection/scsv` - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com') - let baseOptions - if (configuration) { - baseOptions = configuration.baseOptions - } - const localVarRequestOptions: AxiosRequestConfig = { - method: 'POST', - ...baseOptions, - ...options, - } - const localVarHeaderParameter = {} as any - const localVarQueryParameter = {} as any - - localVarHeaderParameter['Content-Type'] = 'application/json' - - 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() - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {} - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - } - const needsSerialization = - typeof body !== 'string' || - (localVarRequestOptions.headers && - localVarRequestOptions.headers['Content-Type'] === 'application/json') - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body ?? {}) - : body || '' - - return { - url: - localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, - options: localVarRequestOptions, - } - }, - } -} - -/** - * ProjectionEndpointApi - functional programming interface - * @export - */ -export const ProjectionEndpointApiFp = function ( - configuration?: Configuration, -) { - return { - /** - * - * @param {ProjectionDcsvPostRequest} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async v8ProjectionDcsvPost( - body?: ProjectionDcsvPostRequest, - options?: AxiosRequestConfig, - ): Promise< - (axios?: AxiosInstance, basePath?: string) => Promise> - > { - const localVarAxiosArgs = await ProjectionEndpointApiAxiosParamCreator( - configuration, - ).v8ProjectionDcsvPost(body, options) - return ( - axios: AxiosInstance = globalAxios, - basePath: string = BASE_PATH, - ) => { - const axiosRequestArgs: AxiosRequestConfig = { - ...localVarAxiosArgs.options, - url: basePath + localVarAxiosArgs.url, - } - return axios.request(axiosRequestArgs) - } - }, - /** - * - * @param {ProjectionHcsvPostRequest} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async v8ProjectionHcsvPost( - body?: ProjectionHcsvPostRequest, - options?: AxiosRequestConfig, - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string, - ) => Promise> /* edited */ - > { - const localVarAxiosArgs = await ProjectionEndpointApiAxiosParamCreator( - configuration, - ).v8ProjectionHcsvPost(body, options) - return ( - axios: AxiosInstance = globalAxios, - basePath: string = BASE_PATH, - ) => { - const axiosRequestArgs: AxiosRequestConfig = { - ...localVarAxiosArgs.options, - url: /* edited */ localVarAxiosArgs.url, - } - return axios.request(axiosRequestArgs) - } - }, - /** - * - * @param {ProjectionScsvPostRequest} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async v8ProjectionScsvPost( - body?: ProjectionScsvPostRequest, - options?: AxiosRequestConfig, - ): Promise< - (axios?: AxiosInstance, basePath?: string) => Promise> - > { - const localVarAxiosArgs = await ProjectionEndpointApiAxiosParamCreator( - configuration, - ).v8ProjectionScsvPost(body, options) - return ( - axios: AxiosInstance = globalAxios, - basePath: string = BASE_PATH, - ) => { - const axiosRequestArgs: AxiosRequestConfig = { - ...localVarAxiosArgs.options, - url: basePath + localVarAxiosArgs.url, - } - return axios.request(axiosRequestArgs) - } - }, - } -} - -/** - * ProjectionEndpointApi - factory interface - * @export - */ -export const ProjectionEndpointApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance, -) { - return { - /** - * - * @param {ProjectionDcsvPostRequest} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async v8ProjectionDcsvPost( - body?: ProjectionDcsvPostRequest, - options?: AxiosRequestConfig, - ): Promise> { - return ProjectionEndpointApiFp(configuration) - .v8ProjectionDcsvPost(body, options) - .then((request) => request(axios, basePath)) - }, - /** - * - * @param {ProjectionHcsvPostRequest} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async v8ProjectionHcsvPost( - body?: ProjectionHcsvPostRequest, - options?: AxiosRequestConfig, - ): Promise> { - return ProjectionEndpointApiFp(configuration) - .v8ProjectionHcsvPost(body, options) - .then((request) => request(axios /* edited */)) - }, - /** - * - * @param {ProjectionScsvPostRequest} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async v8ProjectionScsvPost( - body?: ProjectionScsvPostRequest, - options?: AxiosRequestConfig, - ): Promise> { - return ProjectionEndpointApiFp(configuration) - .v8ProjectionScsvPost(body, options) - .then((request) => request(axios, basePath)) - }, - } -} - -/** - * ProjectionEndpointApi - object-oriented interface - * @export - * @class ProjectionEndpointApi - * @extends {BaseAPI} - */ -export class ProjectionEndpointApi extends BaseAPI { - /** - * - * @param {ProjectionDcsvPostRequest} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ProjectionEndpointApi - */ - public async v8ProjectionDcsvPost( - body?: ProjectionDcsvPostRequest, - options?: AxiosRequestConfig, - ): Promise> { - return ProjectionEndpointApiFp(this.configuration) - .v8ProjectionDcsvPost(body, options) - .then((request) => request(this.axios, this.basePath)) - } - /** - * - * @param {ProjectionHcsvPostRequest} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ProjectionEndpointApi - */ - public async v8ProjectionHcsvPost( - body?: ProjectionHcsvPostRequest, - options?: AxiosRequestConfig, - ): Promise> /* edited */ { - return ProjectionEndpointApiFp(this.configuration) - .v8ProjectionHcsvPost(body, options) - .then((request) => request(this.axios /* edited */)) - } - /** - * - * @param {ProjectionScsvPostRequest} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ProjectionEndpointApi - */ - public async v8ProjectionScsvPost( - body?: ProjectionScsvPostRequest, - options?: AxiosRequestConfig, - ): Promise> { - return ProjectionEndpointApiFp(this.configuration) - .v8ProjectionScsvPost(body, options) - .then((request) => request(this.axios, this.basePath)) - } -} diff --git a/frontend/src/services/vdyp-api/apis/run-dcsvprojection-api.ts b/frontend/src/services/vdyp-api/apis/run-dcsvprojection-api.ts new file mode 100644 index 000000000..61c6383d8 --- /dev/null +++ b/frontend/src/services/vdyp-api/apis/run-dcsvprojection-api.ts @@ -0,0 +1,152 @@ +/* tslint:disable */ +/* eslint-disable */ +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 type { RequestArgs } from '../base' +import type { FileUpload, Parameters } from '../models' + +export const RunDCSVProjectionApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + projectionDcsvPostForm: async ( + dcsvInputData?: FileUpload, + projectionParameters?: Parameters, + trialRun?: boolean, + 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') + 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() + let 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-hcsvprojection-api.ts b/frontend/src/services/vdyp-api/apis/run-hcsvprojection-api.ts new file mode 100644 index 000000000..b7b489de0 --- /dev/null +++ b/frontend/src/services/vdyp-api/apis/run-hcsvprojection-api.ts @@ -0,0 +1,170 @@ +/* tslint:disable */ +/* eslint-disable */ +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 type { RequestArgs } from '../base' +import type { FileUpload, Parameters } from '../models' + +export const RunHCSVProjectionApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + projectionHcsvPostForm: async ( + polygonInputData?: FileUpload, + layersInputData?: FileUpload, + projectionParameters?: Parameters, + trialRun?: boolean, + options: AxiosRequestConfig = {}, + ): Promise => { + const localVarPath = `/api/v8/projection/hcsv` + const localVarUrlObj = new URL(localVarPath, 'https://example.com') + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + const localVarRequestOptions: AxiosRequestConfig = { + method: 'POST', + headers: { + Accept: 'application/octet-stream', + 'Content-Type': 'multipart/form-data', + } /* edited */, + ...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 (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() + let 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 RunHCSVProjectionApiFp = function (configuration?: Configuration) { + return { + async projectionHcsvPostForm( + polygonInputData?: FileUpload, + layersInputData?: FileUpload, + projectionParameters?: Parameters, + trialRun?: boolean, + options?: AxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => Promise> /* edited */ + > { + const localVarAxiosArgs = await RunHCSVProjectionApiAxiosParamCreator( + configuration, + ).projectionHcsvPostForm( + polygonInputData, + layersInputData, + projectionParameters, + trialRun, + options, + ) + return ( + axios: AxiosInstance = globalAxios, + basePath: string = BASE_PATH, + ) => { + const axiosRequestArgs: AxiosRequestConfig = { + ...localVarAxiosArgs.options, + url: localVarAxiosArgs.url, + responseType: 'blob' /* edited */, + } + return axios.request(axiosRequestArgs) + } + }, + } +} + +export const RunHCSVProjectionApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + return { + async projectionHcsvPostForm( + polygonInputData?: FileUpload, + layersInputData?: FileUpload, + projectionParameters?: Parameters, + trialRun?: boolean, + options?: AxiosRequestConfig, + ): Promise> /* edited */ { + return RunHCSVProjectionApiFp(configuration) + .projectionHcsvPostForm( + polygonInputData, + layersInputData, + projectionParameters, + trialRun, + options, + ) + .then((request) => request(axios)) + }, + } +} + +export class RunHCSVProjectionApi extends BaseAPI { + public async projectionHcsvPostForm( + polygonInputData?: FileUpload, + layersInputData?: FileUpload, + projectionParameters?: Parameters, + trialRun?: boolean, + options?: AxiosRequestConfig, + ): Promise> /* edited */ { + return RunHCSVProjectionApiFp(this.configuration) + .projectionHcsvPostForm( + polygonInputData, + layersInputData, + projectionParameters, + trialRun, + options, + ) + .then((request) => request(this.axios)) + } +} diff --git a/frontend/src/services/vdyp-api/apis/run-scsvprojection-api.ts b/frontend/src/services/vdyp-api/apis/run-scsvprojection-api.ts new file mode 100644 index 000000000..ab680d931 --- /dev/null +++ b/frontend/src/services/vdyp-api/apis/run-scsvprojection-api.ts @@ -0,0 +1,302 @@ +/* tslint:disable */ +/* eslint-disable */ +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 type { RequestArgs } from '../base' +import type { FileUpload, Parameters } from '../models' + +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, + 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` + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com') + 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() + let 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 { + /** + * + * @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, + 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 { + /** + * + * @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, + 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 { + /** + * + * @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, + 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/base.ts b/frontend/src/services/vdyp-api/base.ts index 94cb189a0..ce0ac357c 100644 --- a/frontend/src/services/vdyp-api/base.ts +++ b/frontend/src/services/vdyp-api/base.ts @@ -5,9 +5,8 @@ import { Configuration } from './configuration' // @ts-ignore import globalAxios from 'axios' import type { AxiosRequestConfig, AxiosInstance } from 'axios' -import { env } from '@/env' -export const BASE_PATH = env.VITE_API_URL.replace(/\/+$/, '') +export const BASE_PATH = '' /** * diff --git a/frontend/src/services/vdyp-api/models/enum-value.ts b/frontend/src/services/vdyp-api/models/enum-value.ts new file mode 100644 index 000000000..611294447 --- /dev/null +++ b/frontend/src/services/vdyp-api/models/enum-value.ts @@ -0,0 +1,7 @@ +/* tslint:disable */ +/* eslint-disable */ +export enum EnumValue { + Never = 'never', + Polygon = 'polygon', + Mapsheet = 'mapsheet', +} diff --git a/frontend/src/services/vdyp-api/models/file-upload.ts b/frontend/src/services/vdyp-api/models/file-upload.ts new file mode 100644 index 000000000..553c6650a --- /dev/null +++ b/frontend/src/services/vdyp-api/models/file-upload.ts @@ -0,0 +1,3 @@ +/* tslint:disable */ +/* eslint-disable */ +export interface FileUpload {} diff --git a/frontend/src/services/vdyp-api/models/index.ts b/frontend/src/services/vdyp-api/models/index.ts index 83d234401..39bb2fa79 100644 --- a/frontend/src/services/vdyp-api/models/index.ts +++ b/frontend/src/services/vdyp-api/models/index.ts @@ -1,16 +1,18 @@ export * from './combine-age-year-range-enum' +export * from './enum-value' +export * from './file-upload' export * from './filters' -export * from './link' /* added */ +export * from './link' export * from './metadata-to-output-enum' export * from './output-format-enum' export * from './parameters' -export * from './parameter-details-message' /* added */ -export * from './parameters-progress-frequency' -export * from './parameters-utils-inner' -export * from './projection-dcsv-post-request' -export * from './projection-hcsv-post-request' -export * from './projection-scsv-post-request' -export * from './root-resource' /* added */ +export * from './parameter-details-message' +export * from './progress-frequency' +export * from './projection-dcsv-body' +export * from './projection-hcsv-body' +export * from './projection-scsv-body' +export * from './root-resource' export * from './selected-debug-options-enum' export * from './selected-execution-options-enum' +export * from './utilization-parameter' export * from './value-enum' diff --git a/frontend/src/services/vdyp-api/models/link.ts b/frontend/src/services/vdyp-api/models/link.ts index 52381da81..524a16a56 100644 --- a/frontend/src/services/vdyp-api/models/link.ts +++ b/frontend/src/services/vdyp-api/models/link.ts @@ -1,5 +1,5 @@ export interface Link { + rel: string href: string method: string - rel: string } diff --git a/frontend/src/services/vdyp-api/models/parameters-progress-frequency.ts b/frontend/src/services/vdyp-api/models/parameters-progress-frequency.ts deleted file mode 100644 index 63164dd78..000000000 --- a/frontend/src/services/vdyp-api/models/parameters-progress-frequency.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -export interface ParametersProgressFrequency {} diff --git a/frontend/src/services/vdyp-api/models/parameters.ts b/frontend/src/services/vdyp-api/models/parameters.ts index c6d83bde6..115f579f0 100644 --- a/frontend/src/services/vdyp-api/models/parameters.ts +++ b/frontend/src/services/vdyp-api/models/parameters.ts @@ -4,10 +4,10 @@ import { CombineAgeYearRangeEnum } from './combine-age-year-range-enum' import type { Filters } from './filters' import { MetadataToOutputEnum } from './metadata-to-output-enum' import { OutputFormatEnum } from './output-format-enum' -import type { ParametersProgressFrequency } from './parameters-progress-frequency' -import type { ParametersUtilsInner } from './parameters-utils-inner' +import type { ProgressFrequency } from './progress-frequency' 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} @@ -21,24 +21,6 @@ export interface Parameters { */ selectedExecutionOptions?: Array - /** - * @type {boolean} - * @memberof Parameters - */ - doEnableProgressLogging?: boolean - - /** - * @type {boolean} - * @memberof Parameters - */ - doEnableErrorLogging?: boolean - - /** - * @type {boolean} - * @memberof Parameters - */ - doEnableDebugLogging?: boolean - /** * @type {Array} * @memberof Parameters @@ -124,10 +106,10 @@ export interface Parameters { combineAgeYearRange?: CombineAgeYearRangeEnum /** - * @type {ParametersProgressFrequency} + * @type {ProgressFrequency} * @memberof Parameters */ - progressFrequency?: ParametersProgressFrequency + progressFrequency?: ProgressFrequency /** * @type {MetadataToOutputEnum} @@ -142,8 +124,8 @@ export interface Parameters { filters?: Filters /** - * @type {Array} + * @type {Array} * @memberof Parameters */ - utils?: Array + utils?: Array } diff --git a/frontend/src/services/vdyp-api/models/progress-frequency.ts b/frontend/src/services/vdyp-api/models/progress-frequency.ts new file mode 100644 index 000000000..acc65cc04 --- /dev/null +++ b/frontend/src/services/vdyp-api/models/progress-frequency.ts @@ -0,0 +1,16 @@ +/* tslint:disable */ +/* eslint-disable */ +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 new file mode 100644 index 000000000..dae5ae7ea --- /dev/null +++ b/frontend/src/services/vdyp-api/models/projection-dcsv-body.ts @@ -0,0 +1,17 @@ +/* tslint:disable */ +/* eslint-disable */ +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-dcsv-post-request.ts b/frontend/src/services/vdyp-api/models/projection-dcsv-post-request.ts deleted file mode 100644 index 856435343..000000000 --- a/frontend/src/services/vdyp-api/models/projection-dcsv-post-request.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -import type { Parameters } from './parameters' -export interface ProjectionDcsvPostRequest { - /** - * @type {Parameters} - * @memberof ProjectionDcsvPostRequest - */ - projectionParameters?: Parameters - - /** - * @type {Blob} - * @memberof ProjectionDcsvPostRequest - */ - inputData?: Blob -} diff --git a/frontend/src/services/vdyp-api/models/projection-hcsv-body.ts b/frontend/src/services/vdyp-api/models/projection-hcsv-body.ts new file mode 100644 index 000000000..26cbca087 --- /dev/null +++ b/frontend/src/services/vdyp-api/models/projection-hcsv-body.ts @@ -0,0 +1,23 @@ +/* tslint:disable */ +/* eslint-disable */ +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-hcsv-post-request.ts b/frontend/src/services/vdyp-api/models/projection-hcsv-post-request.ts deleted file mode 100644 index 6fb9d22e0..000000000 --- a/frontend/src/services/vdyp-api/models/projection-hcsv-post-request.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -import type { Parameters } from './parameters' -export interface ProjectionHcsvPostRequest { - /** - * @type {Parameters} - * @memberof ProjectionHcsvPostRequest - */ - projectionParameters?: Parameters - - /** - * @type {Blob} - * @memberof ProjectionHcsvPostRequest - */ - polygonInputData?: Blob - - /** - * @type {Blob} - * @memberof ProjectionHcsvPostRequest - */ - layerInputData?: Blob -} diff --git a/frontend/src/services/vdyp-api/models/projection-scsv-body.ts b/frontend/src/services/vdyp-api/models/projection-scsv-body.ts new file mode 100644 index 000000000..7187ad4e9 --- /dev/null +++ b/frontend/src/services/vdyp-api/models/projection-scsv-body.ts @@ -0,0 +1,59 @@ +/* tslint:disable */ +/* eslint-disable */ +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/projection-scsv-post-request.ts b/frontend/src/services/vdyp-api/models/projection-scsv-post-request.ts deleted file mode 100644 index 1756c2bbc..000000000 --- a/frontend/src/services/vdyp-api/models/projection-scsv-post-request.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -import type { Parameters } from './parameters' -export interface ProjectionScsvPostRequest { - /** - * @type {Parameters} - * @memberof ProjectionScsvPostRequest - */ - projectionParameters?: Parameters - - /** - * @type {Blob} - * @memberof ProjectionScsvPostRequest - */ - polygonInputData?: Blob - - /** - * @type {Blob} - * @memberof ProjectionScsvPostRequest - */ - layerInputData?: Blob - - /** - * @type {Blob} - * @memberof ProjectionScsvPostRequest - */ - historyInputData?: Blob - - /** - * @type {Blob} - * @memberof ProjectionScsvPostRequest - */ - nonVegetationInputData?: Blob - - /** - * @type {Blob} - * @memberof ProjectionScsvPostRequest - */ - otherVegetationInputData?: Blob - - /** - * @type {Blob} - * @memberof ProjectionScsvPostRequest - */ - polygonIdInputData?: Blob - - /** - * @type {Blob} - * @memberof ProjectionScsvPostRequest - */ - speciesInputData?: Blob - - /** - * @type {Blob} - * @memberof ProjectionScsvPostRequest - */ - vriAdjustInputData?: Blob -} diff --git a/frontend/src/services/vdyp-api/models/root-resource.ts b/frontend/src/services/vdyp-api/models/root-resource.ts index 973925cea..28185298b 100644 --- a/frontend/src/services/vdyp-api/models/root-resource.ts +++ b/frontend/src/services/vdyp-api/models/root-resource.ts @@ -1,5 +1,5 @@ import type { Link } from './link' export interface RootResource { - links: Array + links: Link[] } 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 a0563bb96..a125b1da4 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 @@ -21,4 +21,7 @@ export enum SelectedExecutionOptionsEnum { DoIncludeColumnHeadersInYieldTable = 'doIncludeColumnHeadersInYieldTable', DoAllowBasalAreaAndTreesPerHectareValueSubstitution = 'doAllowBasalAreaAndTreesPerHectareValueSubstitution', DoIncludeSecondarySpeciesDominantHeightInYieldTable = 'doIncludeSecondarySpeciesDominantHeightInYieldTable', + DoEnableProgressLogging = 'doEnableProgressLogging', + DoEnableErrorLogging = 'doEnableErrorLogging', + DoEnableDebugLogging = 'doEnableDebugLogging', } diff --git a/frontend/src/services/vdyp-api/models/parameters-utils-inner.ts b/frontend/src/services/vdyp-api/models/utilization-parameter.ts similarity index 63% rename from frontend/src/services/vdyp-api/models/parameters-utils-inner.ts rename to frontend/src/services/vdyp-api/models/utilization-parameter.ts index 9ba95556b..f54408f4e 100644 --- a/frontend/src/services/vdyp-api/models/parameters-utils-inner.ts +++ b/frontend/src/services/vdyp-api/models/utilization-parameter.ts @@ -1,16 +1,16 @@ /* tslint:disable */ /* eslint-disable */ import { ValueEnum } from './value-enum' -export interface ParametersUtilsInner { +export interface UtilizationParameter { /** * @type {string} - * @memberof ParametersUtilsInner + * @memberof UtilizationParameter */ speciesName?: string /** * @type {ValueEnum} - * @memberof ParametersUtilsInner + * @memberof UtilizationParameter */ value?: ValueEnum } diff --git a/frontend/src/views/input-model-parameters/FileUpload.vue b/frontend/src/views/input-model-parameters/FileUpload.vue index ad8c37347..7aa3c1da7 100644 --- a/frontend/src/views/input-model-parameters/FileUpload.vue +++ b/frontend/src/views/input-model-parameters/FileUpload.vue @@ -180,7 +180,7 @@ + From 775e96be426bd1f16a213e3de51d0230e324a3ab Mon Sep 17 00:00:00 2001 From: Roy Jeong Date: Wed, 11 Dec 2024 11:25:32 -0800 Subject: [PATCH 4/8] Change fileUploadRunModel process --- .../input-model-parameters/FileUpload.vue | 84 ++++++++++--------- 1 file changed, 43 insertions(+), 41 deletions(-) diff --git a/frontend/src/views/input-model-parameters/FileUpload.vue b/frontend/src/views/input-model-parameters/FileUpload.vue index 7aa3c1da7..88e910c81 100644 --- a/frontend/src/views/input-model-parameters/FileUpload.vue +++ b/frontend/src/views/input-model-parameters/FileUpload.vue @@ -339,59 +339,61 @@ const validateRequiredFields = (): boolean => { } const fileUploadRunModel = async () => { - progressCircularStore.showProgress(PROGRESS_MSG.RUNNING_MODEL) - try { - await Util.delay(1000) - - if ( + const isValidationSuccessful = validateRequiredFields() && validateComparison() && validateRange() && (await validateFiles()) - ) { - if (form.value) { - form.value.validate() - } else { - console.warn('Form reference is null. Validation skipped.') - } - const formData = new FormData() - - const selectedExecutionOptions = [ - SelectedExecutionOptionsEnum.DoEnableProgressLogging, - SelectedExecutionOptionsEnum.DoEnableErrorLogging, - SelectedExecutionOptionsEnum.DoEnableDebugLogging, - ] + if (!isValidationSuccessful) { + return + } - const projectionParameters = { - ageStart: startingAge.value, - ageEnd: finishingAge.value, - ageIncrement: ageIncrement.value, - selectedExecutionOptions: selectedExecutionOptions, - } + if (form.value) { + form.value.validate() + } else { + console.warn('Form reference is null. Validation skipped.') + } - formData.append( - 'projectionParameters', - new Blob([JSON.stringify(projectionParameters)], { - type: 'application/json', - }), - ) - formData.append('polygonInputData', polygonFile.value as Blob) - formData.append('layersInputData', layerFile.value as Blob) + progressCircularStore.showProgress(PROGRESS_MSG.RUNNING_MODEL) + await Util.delay(1000) - const result = await projectionHcsvPost(formData, false) + const formData = new FormData() - const url = window.URL.createObjectURL(new Blob([result])) - const link = document.createElement('a') - link.href = url - link.setAttribute('download', DOWNLOAD_FILE_NAME.MULTI_POLYGON_OUTPUT) - document.body.appendChild(link) - link.click() - link.remove() + const selectedExecutionOptions = [ + SelectedExecutionOptionsEnum.DoEnableProgressLogging, + SelectedExecutionOptionsEnum.DoEnableErrorLogging, + SelectedExecutionOptionsEnum.DoEnableDebugLogging, + ] - logSuccessMessage(SUCESS_MSG.FILE_UPLOAD_RUN_MODEL_RESULT) + const projectionParameters = { + ageStart: startingAge.value, + ageEnd: finishingAge.value, + ageIncrement: ageIncrement.value, + selectedExecutionOptions: selectedExecutionOptions, } + + formData.append( + 'projectionParameters', + new Blob([JSON.stringify(projectionParameters)], { + type: 'application/json', + }), + ) + formData.append('polygonInputData', polygonFile.value as Blob) + formData.append('layersInputData', layerFile.value as Blob) + + const result = await projectionHcsvPost(formData, false) + + const url = window.URL.createObjectURL(new Blob([result])) + const link = document.createElement('a') + link.href = url + link.setAttribute('download', DOWNLOAD_FILE_NAME.MULTI_POLYGON_OUTPUT) + document.body.appendChild(link) + link.click() + link.remove() + + logSuccessMessage(SUCESS_MSG.FILE_UPLOAD_RUN_MODEL_RESULT) } catch (error) { handleApiError(error, FILE_UPLOAD_ERR.FAIL_RUN_MODEL) } finally { From b5a1d17ad4952e1ab6c0474f44931ac995fd3714 Mon Sep 17 00:00:00 2001 From: Roy Jeong Date: Wed, 11 Dec 2024 20:24:34 -0800 Subject: [PATCH 5/8] 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 8f5ab3fdd..9996851f7 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 9ff57c03a..d72479557 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 1e15de511..4bf7bdfc7 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 61c6383d8..e25ce2fc0 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 b7b489de0..0e9385962 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 ab680d931..30556c298 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 ce0ac357c..05a4843ef 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 d146482ee..b38e4d4b8 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 5e6ba1006..0ea45f557 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 a5fcd834e..887b6e7f6 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 611294447..282698f5c 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 553c6650a..d0a3ad2b3 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 e31a18a7e..5a4482764 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 331614ba3..39a030869 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 a7baa29aa..223a178ef 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 29a6d71e9..f2b3198af 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 115f579f0..e113bfd13 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 acc65cc04..efde3509f 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 dae5ae7ea..7735943be 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 26cbca087..730c59464 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 7187ad4e9..e75f6adf9 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 3b5dc889d..f380e66e2 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 a125b1da4..b68b43945 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 f54408f4e..ae36d9a80 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 67388f166..6296ade65 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 6/8] 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 f3d8d3941..9061cb9c6 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 d72479557..6204f2ad9 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 4bf7bdfc7..d8b2ade4d 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 e25ce2fc0..51d8d3c08 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 0e9385962..63b93c6ea 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 30556c298..e96181532 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 05a4843ef..f8d884323 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 b38e4d4b8..f9e99b704 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 5a4482764..5c85fcee2 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 f2b3198af..52eae2496 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 e113bfd13..a88fdc04a 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 efde3509f..4f9bcbf0f 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 7735943be..5e9ff102c 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 730c59464..87f5cf7c2 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 e75f6adf9..b2dda55f9 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 ae36d9a80..e9b34272b 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 7/8] 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 9996851f7..3f974b977 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 51d8d3c08..000000000 --- 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 e96181532..000000000 --- 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 28185298b..170a461d6 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 8/8] 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 6204f2ad9..bf100bcc2 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 d8b2ade4d..a6eaefe0e 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 63b93c6ea..f49bd306a 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,