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/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..1b678fe8f 100644 --- a/frontend/src/constants/message.ts +++ b/frontend/src/constants/message.ts @@ -101,4 +101,13 @@ 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 the projection model.', +}) + +export const PROGRESS_MSG = Object.freeze({ + RUNNING_MODEL: 'Running Model...', +}) + +export const SUCESS_MSG = Object.freeze({ + FILE_UPLOAD_RUN_MODEL_RESULT: 'File successfully downloaded.', }) 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/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 5ff63fc7d..8ecf4e3b3 100644 --- a/frontend/src/services/apiActions.ts +++ b/frontend/src/services/apiActions.ts @@ -1,6 +1,7 @@ import apiClient from '@/services/apiClient' +import type { 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,9 +11,12 @@ export const helpGet = async (): Promise => { } } -export const projectionHcsvPost = async (body: any): Promise => { +export const projectionHcsvPost = async ( + 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) @@ -20,7 +24,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..a7ea9b486 100644 --- a/frontend/src/services/apiClient.ts +++ b/frontend/src/services/apiClient.ts @@ -1,29 +1,40 @@ import { - HelpEndpointApi, - ProjectionEndpointApi, - RootEndpointApi, + GetHelpApi, + GetRootApi, + RunHCSVProjectionApi, } from '@/services/vdyp-api/' import axiosInstance from '@/services/axiosInstance' +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?: any) => { - return helpApiInstance.v8HelpGet(options) + helpGet: (options?: AxiosRequestConfig) => { + return helpApiInstance.helpGet(options) }, - projectionHcsvPost: (body?: any, options?: any) => { - return projectionApiInstance.v8ProjectionHcsvPost(body, options) + projectionHcsvPost: ( + formData: FormData, + trialRun: boolean, + options?: AxiosRequestConfig, + ) => { + return projectionApiInstance.projectionHcsvPostForm( + formData.get('polygonInputData') as File, + formData.get('layersInputData') as File, + formData.get('projectionParameters') as any, + trialRun, + options, + ) }, - rootGet: (options?: any) => { - return rootApiInstance.v8Get(options) + rootGet: (options?: AxiosRequestConfig) => { + return rootApiInstance.rootGet(options) }, } diff --git a/frontend/src/services/vdyp-api/api.ts b/frontend/src/services/vdyp-api/api.ts index 97f4bc0c5..3f974b977 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/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-hcsvprojection-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 new file mode 100644 index 000000000..bf100bcc2 --- /dev/null +++ b/frontend/src/services/vdyp-api/apis/get-help-api.ts @@ -0,0 +1,103 @@ +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 { ParameterDetailsMessage } from '../models' +import { env } from '@/env' + +export const GetHelpApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + helpGet: async (options: AxiosRequestConfig = {}): Promise => { + const localVarPath = `/api/v8/help` + const localVarUrlObj = new URL(localVarPath, env.VITE_API_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + const localVarRequestOptions: AxiosRequestConfig = { + method: 'GET', + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + 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, + } + + return { + url: + localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + options: localVarRequestOptions, + } + }, + } +} + +export const GetHelpApiFp = function (configuration?: Configuration) { + return { + async helpGet( + options?: AxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => Promise> + > { + const localVarAxiosArgs = + await GetHelpApiAxiosParamCreator(configuration).helpGet(options) + return ( + axios: AxiosInstance = globalAxios, + basePath: string = BASE_PATH, + ) => { + const axiosRequestArgs: AxiosRequestConfig = { + ...localVarAxiosArgs.options, + url: basePath + localVarAxiosArgs.url, + } + return axios.request(axiosRequestArgs) + } + }, + } +} + +export const GetHelpApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + return { + async helpGet( + options?: AxiosRequestConfig, + ): Promise> { + return GetHelpApiFp(configuration) + .helpGet(options) + .then((request) => request(axios, basePath)) + }, + } +} + +export class GetHelpApi extends BaseAPI { + public async helpGet( + options?: AxiosRequestConfig, + ): 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 new file mode 100644 index 000000000..a6eaefe0e --- /dev/null +++ b/frontend/src/services/vdyp-api/apis/get-root-api.ts @@ -0,0 +1,103 @@ +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 { RootResource } from '../models' +import { env } from '@/env' + +export const GetRootApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + rootGet: async (options: AxiosRequestConfig = {}): Promise => { + const localVarPath = `/api/v8` + const localVarUrlObj = new URL(localVarPath, env.VITE_API_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + const localVarRequestOptions: AxiosRequestConfig = { + method: 'GET', + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + 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, + } + + return { + url: + localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + options: localVarRequestOptions, + } + }, + } +} + +export const GetRootApiFp = function (configuration?: Configuration) { + return { + async rootGet( + options?: AxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => Promise> + > { + const localVarAxiosArgs = + await GetRootApiAxiosParamCreator(configuration).rootGet(options) + return ( + axios: AxiosInstance = globalAxios, + basePath: string = BASE_PATH, + ) => { + const axiosRequestArgs: AxiosRequestConfig = { + ...localVarAxiosArgs.options, + url: basePath + localVarAxiosArgs.url, + } + return axios.request(axiosRequestArgs) + } + }, + } +} + +export const GetRootApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + return { + async rootGet( + options?: AxiosRequestConfig, + ): Promise> { + return GetRootApiFp(configuration) + .rootGet(options) + .then((request) => request(axios, basePath)) + }, + } +} + +export class GetRootApi extends BaseAPI { + public async rootGet( + options?: AxiosRequestConfig, + ): Promise> { + return GetRootApiFp(this.configuration) + .rootGet(options) + .then((request) => request(this.axios, this.basePath)) + } +} diff --git a/frontend/src/services/vdyp-api/apis/help-endpoint-api.ts b/frontend/src/services/vdyp-api/apis/help-endpoint-api.ts deleted file mode 100644 index 994f64b1d..000000000 --- a/frontend/src/services/vdyp-api/apis/help-endpoint-api.ts +++ /dev/null @@ -1,151 +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, COLLECTION_FORMATS, BaseAPI, RequiredError } from '../base' -import type { RequestArgs } from '../base' -import type { ParameterDetailsMessage } from '../models' - -/** - * HelpEndpointApi - axios parameter creator - * @export - */ -export const HelpEndpointApiAxiosParamCreator = function ( - configuration?: Configuration, -) { - return { - /** - * - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - v8HelpGet: async ( - options: AxiosRequestConfig = {}, - ): Promise => { - const localVarPath = `/api/v8/help` /* 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: 'GET', - ...baseOptions, - ...options, - responseType: 'json' /* edited */, - } - const localVarHeaderParameter = {} as any - const localVarQueryParameter = {} as any - - 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, - } - - return { - url: - localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, - options: localVarRequestOptions, - } - }, - } -} - -/** - * HelpEndpointApi - functional programming interface - * @export - */ -export const HelpEndpointApiFp = function (configuration?: Configuration) { - return { - /** - * - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async v8HelpGet( - options?: AxiosRequestConfig, - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string, - ) => Promise> - > { - const localVarAxiosArgs = - await HelpEndpointApiAxiosParamCreator(configuration).v8HelpGet(options) - return ( - axios: AxiosInstance = globalAxios, - basePath: string = BASE_PATH, - ) => { - const axiosRequestArgs: AxiosRequestConfig = { - ...localVarAxiosArgs.options, - url: /* edited */ localVarAxiosArgs.url, - } - return axios.request( - axiosRequestArgs, - ) - } - }, - } -} - -/** - * HelpEndpointApi - factory interface - * @export - */ -export const HelpEndpointApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance, -) { - return { - /** - * - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async v8HelpGet( - options?: AxiosRequestConfig, - ): Promise> { - return HelpEndpointApiFp(configuration) - .v8HelpGet(options) - .then((request) => request(axios /* edited */)) - }, - } -} - -/** - * HelpEndpointApi - object-oriented interface - * @export - * @class HelpEndpointApi - * @extends {BaseAPI} - */ -export class HelpEndpointApi extends BaseAPI { - /** - * - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof HelpEndpointApi - */ - public async v8HelpGet( - options?: AxiosRequestConfig, - ): Promise> { - return HelpEndpointApiFp(this.configuration) - .v8HelpGet(options) - .then((request) => request(this.axios /* edited */)) - } -} 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 24aa183ae..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, COLLECTION_FORMATS, 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 !== undefined ? 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 !== undefined ? 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 !== undefined ? 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/root-endpoint-api.ts b/frontend/src/services/vdyp-api/apis/root-endpoint-api.ts deleted file mode 100644 index 874bd6460..000000000 --- a/frontend/src/services/vdyp-api/apis/root-endpoint-api.ts +++ /dev/null @@ -1,139 +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, COLLECTION_FORMATS, BaseAPI, RequiredError } from '../base' -import type { RequestArgs } from '../base' -/** - * RootEndpointApi - axios parameter creator - * @export - */ -export const RootEndpointApiAxiosParamCreator = function ( - configuration?: Configuration, -) { - return { - /** - * - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - v8Get: async (options: AxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/v8` /* 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: 'GET', - ...baseOptions, - ...options, - } - const localVarHeaderParameter = {} as any - const localVarQueryParameter = {} as any - - 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, - } - - return { - url: - localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, - options: localVarRequestOptions, - } - }, - } -} - -/** - * RootEndpointApi - functional programming interface - * @export - */ -export const RootEndpointApiFp = function (configuration?: Configuration) { - return { - /** - * - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async v8Get( - options?: AxiosRequestConfig, - ): Promise< - (axios?: AxiosInstance, basePath?: string) => Promise> - > { - const localVarAxiosArgs = - await RootEndpointApiAxiosParamCreator(configuration).v8Get(options) - return ( - axios: AxiosInstance = globalAxios, - basePath: string = BASE_PATH, - ) => { - const axiosRequestArgs: AxiosRequestConfig = { - ...localVarAxiosArgs.options, - url: /* edited */ localVarAxiosArgs.url, - } - return axios.request(axiosRequestArgs) - } - }, - } -} - -/** - * RootEndpointApi - factory interface - * @export - */ -export const RootEndpointApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance, -) { - return { - /** - * - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async v8Get(options?: AxiosRequestConfig): Promise> { - return RootEndpointApiFp(configuration) - .v8Get(options) - .then((request) => request(axios /* edited */)) - }, - } -} - -/** - * RootEndpointApi - object-oriented interface - * @export - * @class RootEndpointApi - * @extends {BaseAPI} - */ -export class RootEndpointApi extends BaseAPI { - /** - * - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RootEndpointApi - */ - public async v8Get( - options?: AxiosRequestConfig, - ): Promise> { - return RootEndpointApiFp(this.configuration) - .v8Get(options) - .then((request) => request(this.axios /* edited */)) - } -} 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..f49bd306a --- /dev/null +++ b/frontend/src/services/vdyp-api/apis/run-hcsvprojection-api.ts @@ -0,0 +1,164 @@ +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 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, env.VITE_API_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + const localVarRequestOptions: AxiosRequestConfig = { + method: 'POST', + headers: { + Accept: 'application/octet-stream', + 'Content-Type': 'multipart/form-data', + }, + ...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() + 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 RunHCSVProjectionApiFp = function (configuration?: Configuration) { + return { + async projectionHcsvPostForm( + polygonInputData?: FileUpload, + layersInputData?: FileUpload, + projectionParameters?: Parameters, + trialRun?: boolean, + options?: AxiosRequestConfig, + ): Promise< + (axios?: AxiosInstance, basePath?: string) => Promise> + > { + 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: basePath + localVarAxiosArgs.url, + responseType: 'blob', + } + 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> { + 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> { + return RunHCSVProjectionApiFp(this.configuration) + .projectionHcsvPostForm( + polygonInputData, + layersInputData, + projectionParameters, + trialRun, + options, + ) + .then((request) => request(this.axios)) + } +} diff --git a/frontend/src/services/vdyp-api/base.ts b/frontend/src/services/vdyp-api/base.ts index 94cb189a0..f8d884323 100644 --- a/frontend/src/services/vdyp-api/base.ts +++ b/frontend/src/services/vdyp-api/base.ts @@ -1,18 +1,9 @@ -/* tslint:disable */ -/* eslint-disable */ import { Configuration } from './configuration' -// Some imports not used depending on template conditions -// @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 = '' -/** - * - * @export - */ export const COLLECTION_FORMATS = { csv: ',', ssv: ' ', @@ -20,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 @@ -50,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 d146482ee..f9e99b704 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 @@ -18,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/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 new file mode 100644 index 000000000..282698f5c --- /dev/null +++ b/frontend/src/services/vdyp-api/models/enum-value.ts @@ -0,0 +1,5 @@ +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..d0a3ad2b3 --- /dev/null +++ b/frontend/src/services/vdyp-api/models/file-upload.ts @@ -0,0 +1 @@ +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..5c85fcee2 100644 --- a/frontend/src/services/vdyp-api/models/filters.ts +++ b/frontend/src/services/vdyp-api/models/filters.ts @@ -1,27 +1,6 @@ -/* tslint:disable */ -/* eslint-disable */ 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/index.ts b/frontend/src/services/vdyp-api/models/index.ts index e0c0ac108..39bb2fa79 100644 --- a/frontend/src/services/vdyp-api/models/index.ts +++ b/frontend/src/services/vdyp-api/models/index.ts @@ -1,14 +1,18 @@ export * from './combine-age-year-range-enum' +export * from './enum-value' +export * from './file-upload' export * from './filters' +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 './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 new file mode 100644 index 000000000..524a16a56 --- /dev/null +++ b/frontend/src/services/vdyp-api/models/link.ts @@ -0,0 +1,5 @@ +export interface Link { + rel: string + href: string + method: 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..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,43 +1,7 @@ -/* tslint:disable */ -/* eslint-disable */ 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-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-utils-inner.ts b/frontend/src/services/vdyp-api/models/parameters-utils-inner.ts deleted file mode 100644 index 9ba95556b..000000000 --- a/frontend/src/services/vdyp-api/models/parameters-utils-inner.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -import { ValueEnum } from './value-enum' -export interface ParametersUtilsInner { - /** - * @type {string} - * @memberof ParametersUtilsInner - */ - speciesName?: string - - /** - * @type {ValueEnum} - * @memberof ParametersUtilsInner - */ - value?: ValueEnum -} diff --git a/frontend/src/services/vdyp-api/models/parameters.ts b/frontend/src/services/vdyp-api/models/parameters.ts index c6d83bde6..a88fdc04a 100644 --- a/frontend/src/services/vdyp-api/models/parameters.ts +++ b/frontend/src/services/vdyp-api/models/parameters.ts @@ -1,149 +1,30 @@ -/* tslint:disable */ -/* eslint-disable */ 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} - * @memberof Parameters - */ outputFormat?: OutputFormatEnum - - /** - * @type {Array} - * @memberof 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 - */ 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 {ParametersProgressFrequency} - * @memberof Parameters - */ - progressFrequency?: ParametersProgressFrequency - - /** - * @type {MetadataToOutputEnum} - * @memberof Parameters - */ + progressFrequency?: ProgressFrequency metadataToOutput?: MetadataToOutputEnum - - /** - * @type {Filters} - * @memberof Parameters - */ filters?: Filters - - /** - * @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..4f9bcbf0f --- /dev/null +++ b/frontend/src/services/vdyp-api/models/progress-frequency.ts @@ -0,0 +1,5 @@ +import { EnumValue } from './enum-value' +export interface ProgressFrequency { + intValue?: number + 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..5e9ff102c --- /dev/null +++ b/frontend/src/services/vdyp-api/models/projection-dcsv-body.ts @@ -0,0 +1,6 @@ +import type { FileUpload } from './file-upload' +import type { Parameters } from './parameters' +export interface ProjectionDcsvBody { + dcsvInputData?: FileUpload + 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..87f5cf7c2 --- /dev/null +++ b/frontend/src/services/vdyp-api/models/projection-hcsv-body.ts @@ -0,0 +1,7 @@ +import type { FileUpload } from './file-upload' +import type { Parameters } from './parameters' +export interface ProjectionHcsvBody { + polygonInputData?: FileUpload + layersInputData?: FileUpload + 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..b2dda55f9 --- /dev/null +++ b/frontend/src/services/vdyp-api/models/projection-scsv-body.ts @@ -0,0 +1,13 @@ +import type { FileUpload } from './file-upload' +import type { Parameters } from './parameters' +export interface ProjectionScsvBody { + polygonInputData?: FileUpload + layersInputData?: FileUpload + historyInputData?: FileUpload + nonVegetationInputData?: FileUpload + otherVegetationInputData?: FileUpload + polygonIdInputData?: FileUpload + speciesInputData?: FileUpload + vriAdjustInputData?: FileUpload + 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 new file mode 100644 index 000000000..170a461d6 --- /dev/null +++ b/frontend/src/services/vdyp-api/models/root-resource.ts @@ -0,0 +1,4 @@ +import type { Link } from './link' +export interface RootResource { + links: Link[] +} 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 a0563bb96..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', @@ -21,4 +19,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/utilization-parameter.ts b/frontend/src/services/vdyp-api/models/utilization-parameter.ts new file mode 100644 index 000000000..e9b34272b --- /dev/null +++ b/frontend/src/services/vdyp-api/models/utilization-parameter.ts @@ -0,0 +1,5 @@ +import { ValueEnum } from './value-enum' +export interface UtilizationParameter { + speciesName?: string + value?: ValueEnum +} 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', diff --git a/frontend/src/views/input-model-parameters/FileUpload.vue b/frontend/src/views/input-model-parameters/FileUpload.vue index 4463a45d0..88e910c81 100644 --- a/frontend/src/views/input-model-parameters/FileUpload.vue +++ b/frontend/src/views/input-model-parameters/FileUpload.vue @@ -180,25 +180,33 @@ diff --git a/frontend/src/views/test/ParameterDetail.vue b/frontend/src/views/test/ParameterDetail.vue new file mode 100644 index 000000000..562967808 --- /dev/null +++ b/frontend/src/views/test/ParameterDetail.vue @@ -0,0 +1,67 @@ + + + + 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/, ''), }, }, },