From ca69cc7bcd8551679b8f14b9b94daaf29c77e41b Mon Sep 17 00:00:00 2001 From: "K. Allagbe" Date: Wed, 4 Dec 2024 17:40:02 -0500 Subject: [PATCH 1/2] issue #360: extract data api route --- .env.template | 1 + package-lock.json | 38 ++++++++++++++++++++ package.json | 1 + src/app/api/extract-label-data/route.ts | 46 +++++++++++++++++++++++++ src/app/page.tsx | 40 +++++++++++++++++++-- src/utils/server/constants.ts | 1 + 6 files changed, 125 insertions(+), 2 deletions(-) create mode 100644 src/app/api/extract-label-data/route.ts create mode 100644 src/utils/server/constants.ts diff --git a/.env.template b/.env.template index 38986c0c..5fe2c5e6 100644 --- a/.env.template +++ b/.env.template @@ -3,3 +3,4 @@ NEXT_PUBLIC_DEBUG=true # if link change dont forget to chage the test for sideNav to check if the link is correct NEXT_PUBLIC_REPORT_ISSUE_URL="https://forms.office.com/Pages/ResponsePage.aspx?id=7aW1GIYd00GUoLwn2uMqsn9SKTgKSYtCg4t0B9x4uyJURE5HSkFCTkZHUEQyWkxJVElMODdFQ09HUCQlQCN0PWcu&r5a19e9d47d9f4ac497fb974c192da4b3=%22Fertiscan%22" NEXT_PUBLIC_ALERT_BANNER_AUTO_DISMISS_TIME=5000 +BACKEND_URL=http://localhost:5000 diff --git a/package-lock.json b/package-lock.json index 1db9e248..7ae54af8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,7 @@ "@mui/icons-material": "^6.1.4", "@mui/material": "^6.1.8", "@mui/material-nextjs": "^6.1.4", + "axios": "^1.7.9", "dotenv": "^16.4.5", "i18next": "^23.16.5", "i18next-browser-languagedetector": "^8.0.0", @@ -3107,6 +3108,17 @@ "node": ">=4" } }, + "node_modules/axios": { + "version": "1.7.9", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.9.tgz", + "integrity": "sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw==", + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, "node_modules/axobject-query": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.1.0.tgz", @@ -5084,6 +5096,26 @@ "dev": true, "license": "ISC" }, + "node_modules/follow-redirects": { + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", + "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, "node_modules/for-each": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", @@ -8610,6 +8642,12 @@ "react-is": "^16.13.1" } }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "license": "MIT" + }, "node_modules/psl": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", diff --git a/package.json b/package.json index eac52543..491c4261 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "@mui/icons-material": "^6.1.4", "@mui/material": "^6.1.8", "@mui/material-nextjs": "^6.1.4", + "axios": "^1.7.9", "dotenv": "^16.4.5", "i18next": "^23.16.5", "i18next-browser-languagedetector": "^8.0.0", diff --git a/src/app/api/extract-label-data/route.ts b/src/app/api/extract-label-data/route.ts new file mode 100644 index 00000000..60da4313 --- /dev/null +++ b/src/app/api/extract-label-data/route.ts @@ -0,0 +1,46 @@ +import { BACKEND_URL } from "@/utils/server/constants"; +import axios from "axios"; + +export async function POST(request: Request) { + const formData = await request.formData(); + + const authHeader = request.headers.get("Authorization"); + if (!authHeader) { + return new Response( + JSON.stringify({ error: "Missing Authorization header" }), + { + status: 401, + }, + ); + } + + return axios + .post(`${BACKEND_URL}/analyze`, formData, { + headers: { Authorization: authHeader }, + }) + .then((analyzeResponse) => { + formData.set("label_data", JSON.stringify(analyzeResponse.data)); + + return axios.post(`${BACKEND_URL}/inspections`, formData, { + headers: { Authorization: authHeader }, + }); + }) + .then((inspectionsResponse) => { + return Response.json(inspectionsResponse.data); + }) + .catch((error) => { + if (error.response) { + console.error( + "Error response:", + JSON.stringify(error.response.data, null, 2), + ); + } else if (error.request) { + console.error("Error request:", error.request); + } else { + console.error("Error message:", error.message); + } + return new Response(JSON.stringify({ error: error.message }), { + status: 500, + }); + }); +} diff --git a/src/app/page.tsx b/src/app/page.tsx index 42619cd6..5b9b4eb7 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -2,14 +2,16 @@ import FileUploaded from "@/classe/File"; import Dropzone from "@/components/Dropzone"; import FileList from "@/components/FileList"; +import useAlertStore from "@/stores/alertStore"; import type { DropzoneState } from "@/types/types"; import { Box, Button, Grid2, Tooltip } from "@mui/material"; -import { useState } from "react"; -import React, { Suspense } from "react"; +import axios from "axios"; +import { Suspense, useState } from "react"; import { useTranslation } from "react-i18next"; function HomePage() { const { t } = useTranslation("homePage"); + const { showAlert } = useAlertStore(); const [dropzoneState, setDropzoneState] = useState({ visible: false, @@ -18,6 +20,39 @@ function HomePage() { }); const [uploadedFiles, setUploadedFiles] = useState([]); + const sendFiles = async () => { + const formData = new FormData(); + + uploadedFiles.forEach((fileUploaded) => { + const file = fileUploaded.getFile(); + formData.append("files", file); + }); + + const username = ""; + const password = ""; + const authHeader = "Basic " + btoa(`${username}:${password}`); + + axios + .post("/api/extract-label-data", formData, { + headers: { Authorization: authHeader }, + }) + .then((response) => { + console.log("Server Response:", response.data); + }) + .catch((error) => { + if (error.response) { + console.error("Error response:", error.response.data); + showAlert(error.response.data.error, "error"); + } else if (error.request) { + console.error("Error request:", error.request); + showAlert(error.request, "error"); + } else { + console.error("Error message:", error.message); + showAlert(error.message, "error"); + } + }); + }; + return ( @@ -73,6 +108,7 @@ function HomePage() { color="secondary" disabled={uploadedFiles.length === 0} fullWidth + onClick={sendFiles} > {t("submit_button")} diff --git a/src/utils/server/constants.ts b/src/utils/server/constants.ts new file mode 100644 index 00000000..57e9a414 --- /dev/null +++ b/src/utils/server/constants.ts @@ -0,0 +1 @@ +export const BACKEND_URL = process.env.BACKEND_URL || "http://localhost:5000"; From 32d347eb3c965692fa2717996079aa4b54232ad2 Mon Sep 17 00:00:00 2001 From: "K. Allagbe" Date: Wed, 4 Dec 2024 22:31:00 -0500 Subject: [PATCH 2/2] issue #360: fertiscan backend openapi client --- .gitignore | 2 + src/app/api/extract-label-data/route.ts | 26 +- src/utils/server/backend/api.ts | 19 + src/utils/server/backend/api/home-api.ts | 163 +++++ .../server/backend/api/inspections-api.ts | 692 ++++++++++++++++++ .../server/backend/api/monitoring-api.ts | 169 +++++ src/utils/server/backend/api/pipeline-api.ts | 200 +++++ src/utils/server/backend/api/users-api.ts | 264 +++++++ src/utils/server/backend/base.ts | 91 +++ src/utils/server/backend/client.ts | 17 + src/utils/server/backend/common.ts | 202 +++++ src/utils/server/backend/configuration.ts | 132 ++++ src/utils/server/backend/index.ts | 18 + .../backend/model/deleted-inspection.ts | 81 ++ ...metadata-inspection-guaranteed-analysis.ts | 52 ++ .../fertiscan-db-metadata-inspection-value.ts | 45 ++ .../server/backend/model/health-status.ts | 27 + .../backend/model/httpvalidation-error.ts | 31 + src/utils/server/backend/model/index.ts | 23 + .../server/backend/model/inspection-data.ts | 81 ++ .../server/backend/model/inspection-update.ts | 82 +++ src/utils/server/backend/model/inspection.ts | 88 +++ .../server/backend/model/label-data-input.ts | 169 +++++ .../server/backend/model/label-data-output.ts | 169 +++++ src/utils/server/backend/model/metric.ts | 39 + src/utils/server/backend/model/metrics.ts | 43 ++ .../server/backend/model/nutrient-value.ts | 39 + .../backend/model/organization-information.ts | 51 ++ ...pipeline-inspection-guaranteed-analysis.ts | 43 ++ .../model/pipeline-inspection-value.ts | 33 + .../model/product-information-input.ts | 85 +++ .../model/product-information-output.ts | 85 +++ src/utils/server/backend/model/sub-label.ts | 33 + src/utils/server/backend/model/title.ts | 33 + src/utils/server/backend/model/user.ts | 33 + .../model/validation-error-loc-inner.ts | 20 + .../server/backend/model/validation-error.ts | 43 ++ 37 files changed, 3412 insertions(+), 11 deletions(-) create mode 100644 src/utils/server/backend/api.ts create mode 100644 src/utils/server/backend/api/home-api.ts create mode 100644 src/utils/server/backend/api/inspections-api.ts create mode 100644 src/utils/server/backend/api/monitoring-api.ts create mode 100644 src/utils/server/backend/api/pipeline-api.ts create mode 100644 src/utils/server/backend/api/users-api.ts create mode 100644 src/utils/server/backend/base.ts create mode 100644 src/utils/server/backend/client.ts create mode 100644 src/utils/server/backend/common.ts create mode 100644 src/utils/server/backend/configuration.ts create mode 100644 src/utils/server/backend/index.ts create mode 100644 src/utils/server/backend/model/deleted-inspection.ts create mode 100644 src/utils/server/backend/model/fertiscan-db-metadata-inspection-guaranteed-analysis.ts create mode 100644 src/utils/server/backend/model/fertiscan-db-metadata-inspection-value.ts create mode 100644 src/utils/server/backend/model/health-status.ts create mode 100644 src/utils/server/backend/model/httpvalidation-error.ts create mode 100644 src/utils/server/backend/model/index.ts create mode 100644 src/utils/server/backend/model/inspection-data.ts create mode 100644 src/utils/server/backend/model/inspection-update.ts create mode 100644 src/utils/server/backend/model/inspection.ts create mode 100644 src/utils/server/backend/model/label-data-input.ts create mode 100644 src/utils/server/backend/model/label-data-output.ts create mode 100644 src/utils/server/backend/model/metric.ts create mode 100644 src/utils/server/backend/model/metrics.ts create mode 100644 src/utils/server/backend/model/nutrient-value.ts create mode 100644 src/utils/server/backend/model/organization-information.ts create mode 100644 src/utils/server/backend/model/pipeline-inspection-guaranteed-analysis.ts create mode 100644 src/utils/server/backend/model/pipeline-inspection-value.ts create mode 100644 src/utils/server/backend/model/product-information-input.ts create mode 100644 src/utils/server/backend/model/product-information-output.ts create mode 100644 src/utils/server/backend/model/sub-label.ts create mode 100644 src/utils/server/backend/model/title.ts create mode 100644 src/utils/server/backend/model/user.ts create mode 100644 src/utils/server/backend/model/validation-error-loc-inner.ts create mode 100644 src/utils/server/backend/model/validation-error.ts diff --git a/.gitignore b/.gitignore index 4b2412b3..dda68d39 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,5 @@ yarn-error.log* # typescript *.tsbuildinfo next-env.d.ts + +/backend-openapi diff --git a/src/app/api/extract-label-data/route.ts b/src/app/api/extract-label-data/route.ts index 60da4313..7f1756d8 100644 --- a/src/app/api/extract-label-data/route.ts +++ b/src/app/api/extract-label-data/route.ts @@ -1,8 +1,8 @@ -import { BACKEND_URL } from "@/utils/server/constants"; -import axios from "axios"; +import { inspectionsApi, pipelineApi } from "@/utils/server/backend"; export async function POST(request: Request) { const formData = await request.formData(); + const files = formData.getAll("files") as File[]; const authHeader = request.headers.get("Authorization"); if (!authHeader) { @@ -14,16 +14,20 @@ export async function POST(request: Request) { ); } - return axios - .post(`${BACKEND_URL}/analyze`, formData, { - headers: { Authorization: authHeader }, - }) + return pipelineApi + .analyzeDocumentAnalyzePost(files) .then((analyzeResponse) => { - formData.set("label_data", JSON.stringify(analyzeResponse.data)); - - return axios.post(`${BACKEND_URL}/inspections`, formData, { - headers: { Authorization: authHeader }, - }); + console.log( + "Analyze response:", + JSON.stringify(analyzeResponse.data, null, 2), + ); + return inspectionsApi.postInspectionInspectionsPost( + analyzeResponse.data, + files, + { + headers: { Authorization: authHeader }, + }, + ); }) .then((inspectionsResponse) => { return Response.json(inspectionsResponse.data); diff --git a/src/utils/server/backend/api.ts b/src/utils/server/backend/api.ts new file mode 100644 index 00000000..406333ca --- /dev/null +++ b/src/utils/server/backend/api.ts @@ -0,0 +1,19 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +export * from "./api/home-api"; +export * from "./api/inspections-api"; +export * from "./api/monitoring-api"; +export * from "./api/pipeline-api"; +export * from "./api/users-api"; diff --git a/src/utils/server/backend/api/home-api.ts b/src/utils/server/backend/api/home-api.ts new file mode 100644 index 00000000..2fce01fd --- /dev/null +++ b/src/utils/server/backend/api/home-api.ts @@ -0,0 +1,163 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { AxiosInstance, AxiosPromise, RawAxiosRequestConfig } from "axios"; +import globalAxios from "axios"; +import type { Configuration } from "../configuration"; +// Some imports not used depending on template conditions +// @ts-ignore +import { + DUMMY_BASE_URL, + createRequestFunction, + setSearchParams, + toPathString, +} from "../common"; +// @ts-ignore +import { + BASE_PATH, + BaseAPI, + RequiredError, + operationServerMap, + type RequestArgs, +} from "../base"; +/** + * HomeApi - axios parameter creator + * @export + */ +export const HomeApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + /** + * + * @summary Home + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + homeGet: async ( + options: RawAxiosRequestConfig = {}, + ): Promise => { + const localVarPath = `/`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * HomeApi - functional programming interface + * @export + */ +export const HomeApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = HomeApiAxiosParamCreator(configuration); + return { + /** + * + * @summary Home + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async homeGet( + options?: RawAxiosRequestConfig, + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.homeGet(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = + operationServerMap["HomeApi.homeGet"]?.[localVarOperationServerIndex] + ?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, localVarOperationServerBasePath || basePath); + }, + }; +}; + +/** + * HomeApi - factory interface + * @export + */ +export const HomeApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = HomeApiFp(configuration); + return { + /** + * + * @summary Home + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + homeGet(options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp + .homeGet(options) + .then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * HomeApi - object-oriented interface + * @export + * @class HomeApi + * @extends {BaseAPI} + */ +export class HomeApi extends BaseAPI { + /** + * + * @summary Home + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof HomeApi + */ + public homeGet(options?: RawAxiosRequestConfig) { + return HomeApiFp(this.configuration) + .homeGet(options) + .then((request) => request(this.axios, this.basePath)); + } +} diff --git a/src/utils/server/backend/api/inspections-api.ts b/src/utils/server/backend/api/inspections-api.ts new file mode 100644 index 00000000..d3b9d2c1 --- /dev/null +++ b/src/utils/server/backend/api/inspections-api.ts @@ -0,0 +1,692 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { AxiosInstance, AxiosPromise, RawAxiosRequestConfig } from "axios"; +import globalAxios from "axios"; +import type { Configuration } from "../configuration"; +// Some imports not used depending on template conditions +// @ts-ignore +import { + DUMMY_BASE_URL, + assertParamExists, + createRequestFunction, + serializeDataIfNeeded, + setBasicAuthToObject, + setSearchParams, + toPathString, +} from "../common"; +// @ts-ignore +import { + BASE_PATH, + BaseAPI, + RequiredError, + operationServerMap, + type RequestArgs, +} from "../base"; +// @ts-ignore +import type { DeletedInspection } from "../model"; +// @ts-ignore +// @ts-ignore +import type { Inspection } from "../model"; +// @ts-ignore +import type { InspectionData } from "../model"; +// @ts-ignore +import type { InspectionUpdate } from "../model"; +// @ts-ignore +import type { LabelDataInput } from "../model"; +/** + * InspectionsApi - axios parameter creator + * @export + */ +export const InspectionsApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + /** + * + * @summary Delete Inspection + * @param {string} id + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteInspectionInspectionsIdDelete: async ( + id: string, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("deleteInspectionInspectionsIdDelete", "id", id); + const localVarPath = `/inspections/{id}`.replace( + `{${"id"}}`, + encodeURIComponent(String(id)), + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "DELETE", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication HTTPBasic required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Get Inspection + * @param {string} id + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInspectionInspectionsIdGet: async ( + id: string, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("getInspectionInspectionsIdGet", "id", id); + const localVarPath = `/inspections/{id}`.replace( + `{${"id"}}`, + encodeURIComponent(String(id)), + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication HTTPBasic required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Get Inspections + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInspectionsInspectionsGet: async ( + options: RawAxiosRequestConfig = {}, + ): Promise => { + const localVarPath = `/inspections`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication HTTPBasic required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Post Inspection + * @param {LabelDataInput} labelData + * @param {Array} files + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + postInspectionInspectionsPost: async ( + labelData: LabelDataInput, + files: Array, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'labelData' is not null or undefined + assertParamExists( + "postInspectionInspectionsPost", + "labelData", + labelData, + ); + // verify required parameter 'files' is not null or undefined + assertParamExists("postInspectionInspectionsPost", "files", files); + const localVarPath = `/inspections`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "POST", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + const localVarFormParams = new ((configuration && + configuration.formDataCtor) || + FormData)(); + + // authentication HTTPBasic required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + if (labelData !== undefined) { + localVarFormParams.append("label_data", JSON.stringify(labelData)); + } + if (files) { + files.forEach((element) => { + localVarFormParams.append("files", element as any); + }); + } + + localVarHeaderParameter["Content-Type"] = "multipart/form-data"; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = localVarFormParams; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Put Inspection + * @param {string} id + * @param {InspectionUpdate} inspectionUpdate + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + putInspectionInspectionsIdPut: async ( + id: string, + inspectionUpdate: InspectionUpdate, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("putInspectionInspectionsIdPut", "id", id); + // verify required parameter 'inspectionUpdate' is not null or undefined + assertParamExists( + "putInspectionInspectionsIdPut", + "inspectionUpdate", + inspectionUpdate, + ); + const localVarPath = `/inspections/{id}`.replace( + `{${"id"}}`, + encodeURIComponent(String(id)), + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "PUT", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication HTTPBasic required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + localVarHeaderParameter["Content-Type"] = "application/json"; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + inspectionUpdate, + localVarRequestOptions, + configuration, + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * InspectionsApi - functional programming interface + * @export + */ +export const InspectionsApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = + InspectionsApiAxiosParamCreator(configuration); + return { + /** + * + * @summary Delete Inspection + * @param {string} id + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteInspectionInspectionsIdDelete( + id: string, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.deleteInspectionInspectionsIdDelete( + id, + options, + ); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = + operationServerMap[ + "InspectionsApi.deleteInspectionInspectionsIdDelete" + ]?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Get Inspection + * @param {string} id + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getInspectionInspectionsIdGet( + id: string, + options?: RawAxiosRequestConfig, + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.getInspectionInspectionsIdGet( + id, + options, + ); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = + operationServerMap["InspectionsApi.getInspectionInspectionsIdGet"]?.[ + localVarOperationServerIndex + ]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Get Inspections + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getInspectionsInspectionsGet( + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise> + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.getInspectionsInspectionsGet(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = + operationServerMap["InspectionsApi.getInspectionsInspectionsGet"]?.[ + localVarOperationServerIndex + ]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Post Inspection + * @param {LabelDataInput} labelData + * @param {Array} files + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async postInspectionInspectionsPost( + labelData: LabelDataInput, + files: Array, + options?: RawAxiosRequestConfig, + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.postInspectionInspectionsPost( + labelData, + files, + options, + ); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = + operationServerMap["InspectionsApi.postInspectionInspectionsPost"]?.[ + localVarOperationServerIndex + ]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Put Inspection + * @param {string} id + * @param {InspectionUpdate} inspectionUpdate + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async putInspectionInspectionsIdPut( + id: string, + inspectionUpdate: InspectionUpdate, + options?: RawAxiosRequestConfig, + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.putInspectionInspectionsIdPut( + id, + inspectionUpdate, + options, + ); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = + operationServerMap["InspectionsApi.putInspectionInspectionsIdPut"]?.[ + localVarOperationServerIndex + ]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, localVarOperationServerBasePath || basePath); + }, + }; +}; + +/** + * InspectionsApi - factory interface + * @export + */ +export const InspectionsApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = InspectionsApiFp(configuration); + return { + /** + * + * @summary Delete Inspection + * @param {string} id + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteInspectionInspectionsIdDelete( + id: string, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .deleteInspectionInspectionsIdDelete(id, options) + .then((request) => request(axios, basePath)); + }, + /** + * + * @summary Get Inspection + * @param {string} id + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInspectionInspectionsIdGet( + id: string, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .getInspectionInspectionsIdGet(id, options) + .then((request) => request(axios, basePath)); + }, + /** + * + * @summary Get Inspections + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInspectionsInspectionsGet( + options?: RawAxiosRequestConfig, + ): AxiosPromise> { + return localVarFp + .getInspectionsInspectionsGet(options) + .then((request) => request(axios, basePath)); + }, + /** + * + * @summary Post Inspection + * @param {LabelDataInput} labelData + * @param {Array} files + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + postInspectionInspectionsPost( + labelData: LabelDataInput, + files: Array, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .postInspectionInspectionsPost(labelData, files, options) + .then((request) => request(axios, basePath)); + }, + /** + * + * @summary Put Inspection + * @param {string} id + * @param {InspectionUpdate} inspectionUpdate + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + putInspectionInspectionsIdPut( + id: string, + inspectionUpdate: InspectionUpdate, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .putInspectionInspectionsIdPut(id, inspectionUpdate, options) + .then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * InspectionsApi - object-oriented interface + * @export + * @class InspectionsApi + * @extends {BaseAPI} + */ +export class InspectionsApi extends BaseAPI { + /** + * + * @summary Delete Inspection + * @param {string} id + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof InspectionsApi + */ + public deleteInspectionInspectionsIdDelete( + id: string, + options?: RawAxiosRequestConfig, + ) { + return InspectionsApiFp(this.configuration) + .deleteInspectionInspectionsIdDelete(id, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Get Inspection + * @param {string} id + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof InspectionsApi + */ + public getInspectionInspectionsIdGet( + id: string, + options?: RawAxiosRequestConfig, + ) { + return InspectionsApiFp(this.configuration) + .getInspectionInspectionsIdGet(id, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Get Inspections + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof InspectionsApi + */ + public getInspectionsInspectionsGet(options?: RawAxiosRequestConfig) { + return InspectionsApiFp(this.configuration) + .getInspectionsInspectionsGet(options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Post Inspection + * @param {LabelDataInput} labelData + * @param {Array} files + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof InspectionsApi + */ + public postInspectionInspectionsPost( + labelData: LabelDataInput, + files: Array, + options?: RawAxiosRequestConfig, + ) { + return InspectionsApiFp(this.configuration) + .postInspectionInspectionsPost(labelData, files, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Put Inspection + * @param {string} id + * @param {InspectionUpdate} inspectionUpdate + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof InspectionsApi + */ + public putInspectionInspectionsIdPut( + id: string, + inspectionUpdate: InspectionUpdate, + options?: RawAxiosRequestConfig, + ) { + return InspectionsApiFp(this.configuration) + .putInspectionInspectionsIdPut(id, inspectionUpdate, options) + .then((request) => request(this.axios, this.basePath)); + } +} diff --git a/src/utils/server/backend/api/monitoring-api.ts b/src/utils/server/backend/api/monitoring-api.ts new file mode 100644 index 00000000..25371969 --- /dev/null +++ b/src/utils/server/backend/api/monitoring-api.ts @@ -0,0 +1,169 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { AxiosInstance, AxiosPromise, RawAxiosRequestConfig } from "axios"; +import globalAxios from "axios"; +import type { Configuration } from "../configuration"; +// Some imports not used depending on template conditions +// @ts-ignore +import { + DUMMY_BASE_URL, + createRequestFunction, + setSearchParams, + toPathString, +} from "../common"; +// @ts-ignore +import { + BASE_PATH, + BaseAPI, + RequiredError, + operationServerMap, + type RequestArgs, +} from "../base"; +// @ts-ignore +import type { HealthStatus } from "../model"; +/** + * MonitoringApi - axios parameter creator + * @export + */ +export const MonitoringApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + /** + * + * @summary Health Check + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + healthCheckHealthGet: async ( + options: RawAxiosRequestConfig = {}, + ): Promise => { + const localVarPath = `/health`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * MonitoringApi - functional programming interface + * @export + */ +export const MonitoringApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = + MonitoringApiAxiosParamCreator(configuration); + return { + /** + * + * @summary Health Check + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async healthCheckHealthGet( + options?: RawAxiosRequestConfig, + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.healthCheckHealthGet(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = + operationServerMap["MonitoringApi.healthCheckHealthGet"]?.[ + localVarOperationServerIndex + ]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, localVarOperationServerBasePath || basePath); + }, + }; +}; + +/** + * MonitoringApi - factory interface + * @export + */ +export const MonitoringApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = MonitoringApiFp(configuration); + return { + /** + * + * @summary Health Check + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + healthCheckHealthGet( + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .healthCheckHealthGet(options) + .then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * MonitoringApi - object-oriented interface + * @export + * @class MonitoringApi + * @extends {BaseAPI} + */ +export class MonitoringApi extends BaseAPI { + /** + * + * @summary Health Check + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof MonitoringApi + */ + public healthCheckHealthGet(options?: RawAxiosRequestConfig) { + return MonitoringApiFp(this.configuration) + .healthCheckHealthGet(options) + .then((request) => request(this.axios, this.basePath)); + } +} diff --git a/src/utils/server/backend/api/pipeline-api.ts b/src/utils/server/backend/api/pipeline-api.ts new file mode 100644 index 00000000..a34b2282 --- /dev/null +++ b/src/utils/server/backend/api/pipeline-api.ts @@ -0,0 +1,200 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { AxiosInstance, AxiosPromise, RawAxiosRequestConfig } from "axios"; +import globalAxios from "axios"; +import type { Configuration } from "../configuration"; +// Some imports not used depending on template conditions +// @ts-ignore +import { + DUMMY_BASE_URL, + assertParamExists, + createRequestFunction, + setSearchParams, + toPathString, +} from "../common"; +// @ts-ignore +import { + BASE_PATH, + BaseAPI, + RequiredError, + operationServerMap, + type RequestArgs, +} from "../base"; +// @ts-ignore +// @ts-ignore +import type { LabelDataOutput } from "../model"; +/** + * PipelineApi - axios parameter creator + * @export + */ +export const PipelineApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + /** + * + * @summary Analyze Document + * @param {Array} files + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + analyzeDocumentAnalyzePost: async ( + files: Array, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'files' is not null or undefined + assertParamExists("analyzeDocumentAnalyzePost", "files", files); + const localVarPath = `/analyze`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "POST", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + const localVarFormParams = new ((configuration && + configuration.formDataCtor) || + FormData)(); + + if (files) { + files.forEach((element) => { + localVarFormParams.append("files", element as any); + }); + } + + localVarHeaderParameter["Content-Type"] = "multipart/form-data"; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = localVarFormParams; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * PipelineApi - functional programming interface + * @export + */ +export const PipelineApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = PipelineApiAxiosParamCreator(configuration); + return { + /** + * + * @summary Analyze Document + * @param {Array} files + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async analyzeDocumentAnalyzePost( + files: Array, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.analyzeDocumentAnalyzePost( + files, + options, + ); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = + operationServerMap["PipelineApi.analyzeDocumentAnalyzePost"]?.[ + localVarOperationServerIndex + ]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, localVarOperationServerBasePath || basePath); + }, + }; +}; + +/** + * PipelineApi - factory interface + * @export + */ +export const PipelineApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = PipelineApiFp(configuration); + return { + /** + * + * @summary Analyze Document + * @param {Array} files + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + analyzeDocumentAnalyzePost( + files: Array, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .analyzeDocumentAnalyzePost(files, options) + .then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * PipelineApi - object-oriented interface + * @export + * @class PipelineApi + * @extends {BaseAPI} + */ +export class PipelineApi extends BaseAPI { + /** + * + * @summary Analyze Document + * @param {Array} files + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PipelineApi + */ + public analyzeDocumentAnalyzePost( + files: Array, + options?: RawAxiosRequestConfig, + ) { + return PipelineApiFp(this.configuration) + .analyzeDocumentAnalyzePost(files, options) + .then((request) => request(this.axios, this.basePath)); + } +} diff --git a/src/utils/server/backend/api/users-api.ts b/src/utils/server/backend/api/users-api.ts new file mode 100644 index 00000000..5c2d5e1b --- /dev/null +++ b/src/utils/server/backend/api/users-api.ts @@ -0,0 +1,264 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { AxiosInstance, AxiosPromise, RawAxiosRequestConfig } from "axios"; +import globalAxios from "axios"; +import type { Configuration } from "../configuration"; +// Some imports not used depending on template conditions +// @ts-ignore +import { + DUMMY_BASE_URL, + createRequestFunction, + setBasicAuthToObject, + setSearchParams, + toPathString, +} from "../common"; +// @ts-ignore +import { + BASE_PATH, + BaseAPI, + RequiredError, + operationServerMap, + type RequestArgs, +} from "../base"; +// @ts-ignore +import type { User } from "../model"; +/** + * UsersApi - axios parameter creator + * @export + */ +export const UsersApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + /** + * + * @summary Login + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + loginLoginPost: async ( + options: RawAxiosRequestConfig = {}, + ): Promise => { + const localVarPath = `/login`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "POST", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication HTTPBasic required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Signup + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + signupSignupPost: async ( + options: RawAxiosRequestConfig = {}, + ): Promise => { + const localVarPath = `/signup`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "POST", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication HTTPBasic required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * UsersApi - functional programming interface + * @export + */ +export const UsersApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = UsersApiAxiosParamCreator(configuration); + return { + /** + * + * @summary Login + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async loginLoginPost( + options?: RawAxiosRequestConfig, + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.loginLoginPost(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = + operationServerMap["UsersApi.loginLoginPost"]?.[ + localVarOperationServerIndex + ]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Signup + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async signupSignupPost( + options?: RawAxiosRequestConfig, + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.signupSignupPost(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = + operationServerMap["UsersApi.signupSignupPost"]?.[ + localVarOperationServerIndex + ]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, localVarOperationServerBasePath || basePath); + }, + }; +}; + +/** + * UsersApi - factory interface + * @export + */ +export const UsersApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = UsersApiFp(configuration); + return { + /** + * + * @summary Login + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + loginLoginPost(options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp + .loginLoginPost(options) + .then((request) => request(axios, basePath)); + }, + /** + * + * @summary Signup + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + signupSignupPost(options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp + .signupSignupPost(options) + .then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * UsersApi - object-oriented interface + * @export + * @class UsersApi + * @extends {BaseAPI} + */ +export class UsersApi extends BaseAPI { + /** + * + * @summary Login + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UsersApi + */ + public loginLoginPost(options?: RawAxiosRequestConfig) { + return UsersApiFp(this.configuration) + .loginLoginPost(options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Signup + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UsersApi + */ + public signupSignupPost(options?: RawAxiosRequestConfig) { + return UsersApiFp(this.configuration) + .signupSignupPost(options) + .then((request) => request(this.axios, this.basePath)); + } +} diff --git a/src/utils/server/backend/base.ts b/src/utils/server/backend/base.ts new file mode 100644 index 00000000..633db358 --- /dev/null +++ b/src/utils/server/backend/base.ts @@ -0,0 +1,91 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { Configuration } from "./configuration"; +// Some imports not used depending on template conditions +// @ts-ignore +import type { AxiosInstance, RawAxiosRequestConfig } from "axios"; +import globalAxios from "axios"; + +export const BASE_PATH = "http://localhost".replace(/\/+$/, ""); + +/** + * + * @export + */ +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; + +/** + * + * @export + * @interface RequestArgs + */ +export interface RequestArgs { + url: string; + options: RawAxiosRequestConfig; +} + +/** + * + * @export + * @class BaseAPI + */ +export class BaseAPI { + protected configuration: Configuration | undefined; + + constructor( + configuration?: Configuration, + protected basePath: string = BASE_PATH, + protected axios: AxiosInstance = globalAxios, + ) { + if (configuration) { + this.configuration = configuration; + this.basePath = configuration.basePath ?? basePath; + } + } +} + +/** + * + * @export + * @class RequiredError + * @extends {Error} + */ +export class RequiredError extends Error { + constructor( + public field: string, + msg?: string, + ) { + super(msg); + this.name = "RequiredError"; + } +} + +interface ServerMap { + [key: string]: { + url: string; + description: string; + }[]; +} + +/** + * + * @export + */ +export const operationServerMap: ServerMap = {}; diff --git a/src/utils/server/backend/client.ts b/src/utils/server/backend/client.ts new file mode 100644 index 00000000..f07e22bf --- /dev/null +++ b/src/utils/server/backend/client.ts @@ -0,0 +1,17 @@ +import { BACKEND_URL } from "../constants"; +import { + InspectionsApiFactory, + MonitoringApiFactory, + PipelineApiFactory, + UsersApiFactory, +} from "./api"; +import { Configuration } from "./configuration"; + +const config = new Configuration({ + basePath: BACKEND_URL, +}); + +export const inspectionsApi = InspectionsApiFactory(config); +export const monitoringApi = MonitoringApiFactory(config); +export const pipelineApi = PipelineApiFactory(config); +export const usersApi = UsersApiFactory(config); diff --git a/src/utils/server/backend/common.ts b/src/utils/server/backend/common.ts new file mode 100644 index 00000000..8798327c --- /dev/null +++ b/src/utils/server/backend/common.ts @@ -0,0 +1,202 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { AxiosInstance, AxiosResponse } from "axios"; +import type { RequestArgs } from "./base"; +import { RequiredError } from "./base"; +import type { Configuration } from "./configuration"; + +/** + * + * @export + */ +export const DUMMY_BASE_URL = "https://example.com"; + +/** + * + * @throws {RequiredError} + * @export + */ +export const assertParamExists = function ( + functionName: string, + paramName: string, + paramValue: unknown, +) { + if (paramValue === null || paramValue === undefined) { + throw new RequiredError( + paramName, + `Required parameter ${paramName} was null or undefined when calling ${functionName}.`, + ); + } +}; + +/** + * + * @export + */ +export const setApiKeyToObject = async function ( + object: any, + keyParamName: string, + configuration?: Configuration, +) { + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = + typeof configuration.apiKey === "function" + ? await configuration.apiKey(keyParamName) + : await configuration.apiKey; + object[keyParamName] = localVarApiKeyValue; + } +}; + +/** + * + * @export + */ +export const setBasicAuthToObject = function ( + object: any, + configuration?: Configuration, +) { + if (configuration && (configuration.username || configuration.password)) { + object["auth"] = { + username: configuration.username, + password: configuration.password, + }; + } +}; + +/** + * + * @export + */ +export const setBearerAuthToObject = async function ( + object: any, + configuration?: Configuration, +) { + if (configuration && configuration.accessToken) { + const accessToken = + typeof configuration.accessToken === "function" + ? await configuration.accessToken() + : await configuration.accessToken; + object["Authorization"] = "Bearer " + accessToken; + } +}; + +/** + * + * @export + */ +export const setOAuthToObject = async function ( + object: any, + name: string, + scopes: string[], + configuration?: Configuration, +) { + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = + typeof configuration.accessToken === "function" + ? await configuration.accessToken(name, scopes) + : await configuration.accessToken; + object["Authorization"] = "Bearer " + localVarAccessTokenValue; + } +}; + +function setFlattenedQueryParams( + urlSearchParams: URLSearchParams, + parameter: any, + key: string = "", +): void { + if (parameter == null) return; + if (typeof parameter === "object") { + if (Array.isArray(parameter)) { + (parameter as any[]).forEach((item) => + setFlattenedQueryParams(urlSearchParams, item, key), + ); + } else { + Object.keys(parameter).forEach((currentKey) => + setFlattenedQueryParams( + urlSearchParams, + parameter[currentKey], + `${key}${key !== "" ? "." : ""}${currentKey}`, + ), + ); + } + } else { + if (urlSearchParams.has(key)) { + urlSearchParams.append(key, parameter); + } else { + urlSearchParams.set(key, parameter); + } + } +} + +/** + * + * @export + */ +export const setSearchParams = function (url: URL, ...objects: any[]) { + const searchParams = new URLSearchParams(url.search); + setFlattenedQueryParams(searchParams, objects); + url.search = searchParams.toString(); +}; + +/** + * + * @export + */ +export const serializeDataIfNeeded = function ( + value: any, + requestOptions: any, + configuration?: Configuration, +) { + const nonString = typeof value !== "string"; + const needsSerialization = + nonString && configuration && configuration.isJsonMime + ? configuration.isJsonMime(requestOptions.headers["Content-Type"]) + : nonString; + return needsSerialization + ? JSON.stringify(value !== undefined ? value : {}) + : value || ""; +}; + +/** + * + * @export + */ +export const toPathString = function (url: URL) { + return url.pathname + url.search + url.hash; +}; + +/** + * + * @export + */ +export const createRequestFunction = function ( + axiosArgs: RequestArgs, + globalAxios: AxiosInstance, + BASE_PATH: string, + configuration?: Configuration, +) { + return >( + axios: AxiosInstance = globalAxios, + basePath: string = BASE_PATH, + ) => { + const axiosRequestArgs = { + ...axiosArgs.options, + url: + (axios.defaults.baseURL ? "" : (configuration?.basePath ?? basePath)) + + axiosArgs.url, + }; + return axios.request(axiosRequestArgs); + }; +}; diff --git a/src/utils/server/backend/configuration.ts b/src/utils/server/backend/configuration.ts new file mode 100644 index 00000000..097111e7 --- /dev/null +++ b/src/utils/server/backend/configuration.ts @@ -0,0 +1,132 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +export interface ConfigurationParameters { + apiKey?: + | string + | Promise + | ((name: string) => string) + | ((name: string) => Promise); + username?: string; + password?: string; + accessToken?: + | string + | Promise + | ((name?: string, scopes?: string[]) => string) + | ((name?: string, scopes?: string[]) => Promise); + basePath?: string; + serverIndex?: number; + baseOptions?: any; + formDataCtor?: new () => any; +} + +export class Configuration { + /** + * parameter for apiKey security + * @param name security name + * @memberof Configuration + */ + apiKey?: + | string + | Promise + | ((name: string) => string) + | ((name: string) => Promise); + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + username?: string; + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + password?: string; + /** + * parameter for oauth2 security + * @param name security name + * @param scopes oauth2 scope + * @memberof Configuration + */ + accessToken?: + | string + | Promise + | ((name?: string, scopes?: string[]) => string) + | ((name?: string, scopes?: string[]) => Promise); + /** + * override base path + * + * @type {string} + * @memberof Configuration + */ + basePath?: string; + /** + * override server index + * + * @type {number} + * @memberof Configuration + */ + serverIndex?: number; + /** + * base options for axios calls + * + * @type {any} + * @memberof Configuration + */ + baseOptions?: any; + /** + * The FormData constructor that will be used to create multipart form data + * requests. You can inject this here so that execution environments that + * do not support the FormData class can still run the generated client. + * + * @type {new () => FormData} + */ + formDataCtor?: new () => any; + + constructor(param: ConfigurationParameters = {}) { + this.apiKey = param.apiKey; + this.username = param.username; + this.password = param.password; + this.accessToken = param.accessToken; + this.basePath = param.basePath; + this.serverIndex = param.serverIndex; + this.baseOptions = param.baseOptions; + this.formDataCtor = param.formDataCtor; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp( + "^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$", + "i", + ); + return ( + mime !== null && + (jsonMime.test(mime) || + mime.toLowerCase() === "application/json-patch+json") + ); + } +} diff --git a/src/utils/server/backend/index.ts b/src/utils/server/backend/index.ts new file mode 100644 index 00000000..dd428070 --- /dev/null +++ b/src/utils/server/backend/index.ts @@ -0,0 +1,18 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +export * from "./api"; +export * from "./client"; +export * from "./configuration"; +export * from "./model"; diff --git a/src/utils/server/backend/model/deleted-inspection.ts b/src/utils/server/backend/model/deleted-inspection.ts new file mode 100644 index 00000000..fcce8b09 --- /dev/null +++ b/src/utils/server/backend/model/deleted-inspection.ts @@ -0,0 +1,81 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + * @interface DeletedInspection + */ +export interface DeletedInspection { + /** + * + * @type {string} + * @memberof DeletedInspection + */ + id: string; + /** + * + * @type {boolean} + * @memberof DeletedInspection + */ + verified?: boolean; + /** + * + * @type {string} + * @memberof DeletedInspection + */ + upload_date?: string | null; + /** + * + * @type {string} + * @memberof DeletedInspection + */ + updated_at?: string | null; + /** + * + * @type {string} + * @memberof DeletedInspection + */ + inspector_id?: string | null; + /** + * + * @type {string} + * @memberof DeletedInspection + */ + label_info_id?: string | null; + /** + * + * @type {string} + * @memberof DeletedInspection + */ + sample_id?: string | null; + /** + * + * @type {string} + * @memberof DeletedInspection + */ + picture_set_id?: string | null; + /** + * + * @type {string} + * @memberof DeletedInspection + */ + inspection_comment?: string | null; + /** + * + * @type {boolean} + * @memberof DeletedInspection + */ + deleted?: boolean; +} diff --git a/src/utils/server/backend/model/fertiscan-db-metadata-inspection-guaranteed-analysis.ts b/src/utils/server/backend/model/fertiscan-db-metadata-inspection-guaranteed-analysis.ts new file mode 100644 index 00000000..caa0cb31 --- /dev/null +++ b/src/utils/server/backend/model/fertiscan-db-metadata-inspection-guaranteed-analysis.ts @@ -0,0 +1,52 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +// May contain unused imports in some cases +// @ts-ignore +import type { FertiscanDbMetadataInspectionValue } from "./fertiscan-db-metadata-inspection-value"; +// May contain unused imports in some cases +// @ts-ignore +import type { Title } from "./title"; + +/** + * + * @export + * @interface FertiscanDbMetadataInspectionGuaranteedAnalysis + */ +export interface FertiscanDbMetadataInspectionGuaranteedAnalysis { + /** + * + * @type {Title} + * @memberof FertiscanDbMetadataInspectionGuaranteedAnalysis + */ + title?: Title | null; + /** + * + * @type {boolean} + * @memberof FertiscanDbMetadataInspectionGuaranteedAnalysis + */ + is_minimal?: boolean | null; + /** + * + * @type {Array} + * @memberof FertiscanDbMetadataInspectionGuaranteedAnalysis + */ + en?: Array; + /** + * + * @type {Array} + * @memberof FertiscanDbMetadataInspectionGuaranteedAnalysis + */ + fr?: Array; +} diff --git a/src/utils/server/backend/model/fertiscan-db-metadata-inspection-value.ts b/src/utils/server/backend/model/fertiscan-db-metadata-inspection-value.ts new file mode 100644 index 00000000..12985c39 --- /dev/null +++ b/src/utils/server/backend/model/fertiscan-db-metadata-inspection-value.ts @@ -0,0 +1,45 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + * @interface FertiscanDbMetadataInspectionValue + */ +export interface FertiscanDbMetadataInspectionValue { + /** + * + * @type {number} + * @memberof FertiscanDbMetadataInspectionValue + */ + value?: number | null; + /** + * + * @type {string} + * @memberof FertiscanDbMetadataInspectionValue + */ + unit?: string | null; + /** + * + * @type {string} + * @memberof FertiscanDbMetadataInspectionValue + */ + name?: string | null; + /** + * + * @type {boolean} + * @memberof FertiscanDbMetadataInspectionValue + */ + edited?: boolean | null; +} diff --git a/src/utils/server/backend/model/health-status.ts b/src/utils/server/backend/model/health-status.ts new file mode 100644 index 00000000..c980c32a --- /dev/null +++ b/src/utils/server/backend/model/health-status.ts @@ -0,0 +1,27 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + * @interface HealthStatus + */ +export interface HealthStatus { + /** + * + * @type {string} + * @memberof HealthStatus + */ + status?: string; +} diff --git a/src/utils/server/backend/model/httpvalidation-error.ts b/src/utils/server/backend/model/httpvalidation-error.ts new file mode 100644 index 00000000..4bb8fdf4 --- /dev/null +++ b/src/utils/server/backend/model/httpvalidation-error.ts @@ -0,0 +1,31 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +// May contain unused imports in some cases +// @ts-ignore +import type { ValidationError } from "./validation-error"; + +/** + * + * @export + * @interface HTTPValidationError + */ +export interface HTTPValidationError { + /** + * + * @type {Array} + * @memberof HTTPValidationError + */ + detail?: Array; +} diff --git a/src/utils/server/backend/model/index.ts b/src/utils/server/backend/model/index.ts new file mode 100644 index 00000000..3fb3f318 --- /dev/null +++ b/src/utils/server/backend/model/index.ts @@ -0,0 +1,23 @@ +export * from "./deleted-inspection"; +export * from "./fertiscan-db-metadata-inspection-guaranteed-analysis"; +export * from "./fertiscan-db-metadata-inspection-value"; +export * from "./health-status"; +export * from "./httpvalidation-error"; +export * from "./inspection"; +export * from "./inspection-data"; +export * from "./inspection-update"; +export * from "./label-data-input"; +export * from "./label-data-output"; +export * from "./metric"; +export * from "./metrics"; +export * from "./nutrient-value"; +export * from "./organization-information"; +export * from "./pipeline-inspection-guaranteed-analysis"; +export * from "./pipeline-inspection-value"; +export * from "./product-information-input"; +export * from "./product-information-output"; +export * from "./sub-label"; +export * from "./title"; +export * from "./user"; +export * from "./validation-error"; +export * from "./validation-error-loc-inner"; diff --git a/src/utils/server/backend/model/inspection-data.ts b/src/utils/server/backend/model/inspection-data.ts new file mode 100644 index 00000000..78666ab9 --- /dev/null +++ b/src/utils/server/backend/model/inspection-data.ts @@ -0,0 +1,81 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + * @interface InspectionData + */ +export interface InspectionData { + /** + * + * @type {string} + * @memberof InspectionData + */ + id: string; + /** + * + * @type {string} + * @memberof InspectionData + */ + upload_date: string; + /** + * + * @type {string} + * @memberof InspectionData + */ + updated_at?: string | null; + /** + * + * @type {string} + * @memberof InspectionData + */ + sample_id?: string | null; + /** + * + * @type {string} + * @memberof InspectionData + */ + picture_set_id?: string | null; + /** + * + * @type {string} + * @memberof InspectionData + */ + label_info_id: string; + /** + * + * @type {string} + * @memberof InspectionData + */ + product_name?: string | null; + /** + * + * @type {string} + * @memberof InspectionData + */ + manufacturer_info_id?: string | null; + /** + * + * @type {string} + * @memberof InspectionData + */ + company_info_id?: string | null; + /** + * + * @type {string} + * @memberof InspectionData + */ + company_name?: string | null; +} diff --git a/src/utils/server/backend/model/inspection-update.ts b/src/utils/server/backend/model/inspection-update.ts new file mode 100644 index 00000000..67842fe2 --- /dev/null +++ b/src/utils/server/backend/model/inspection-update.ts @@ -0,0 +1,82 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +// May contain unused imports in some cases +// @ts-ignore +import type { FertiscanDbMetadataInspectionGuaranteedAnalysis } from "./fertiscan-db-metadata-inspection-guaranteed-analysis"; +// May contain unused imports in some cases +// @ts-ignore +import type { OrganizationInformation } from "./organization-information"; +// May contain unused imports in some cases +// @ts-ignore +import type { ProductInformationInput } from "./product-information-input"; +// May contain unused imports in some cases +// @ts-ignore +import type { SubLabel } from "./sub-label"; + +/** + * + * @export + * @interface InspectionUpdate + */ +export interface InspectionUpdate { + /** + * + * @type {string} + * @memberof InspectionUpdate + */ + inspection_comment?: string | null; + /** + * + * @type {boolean} + * @memberof InspectionUpdate + */ + verified?: boolean | null; + /** + * + * @type {OrganizationInformation} + * @memberof InspectionUpdate + */ + company?: OrganizationInformation | null; + /** + * + * @type {OrganizationInformation} + * @memberof InspectionUpdate + */ + manufacturer?: OrganizationInformation | null; + /** + * + * @type {ProductInformationInput} + * @memberof InspectionUpdate + */ + product: ProductInformationInput; + /** + * + * @type {SubLabel} + * @memberof InspectionUpdate + */ + cautions: SubLabel; + /** + * + * @type {SubLabel} + * @memberof InspectionUpdate + */ + instructions: SubLabel; + /** + * + * @type {FertiscanDbMetadataInspectionGuaranteedAnalysis} + * @memberof InspectionUpdate + */ + guaranteed_analysis: FertiscanDbMetadataInspectionGuaranteedAnalysis; +} diff --git a/src/utils/server/backend/model/inspection.ts b/src/utils/server/backend/model/inspection.ts new file mode 100644 index 00000000..40a191b8 --- /dev/null +++ b/src/utils/server/backend/model/inspection.ts @@ -0,0 +1,88 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +// May contain unused imports in some cases +// @ts-ignore +import type { FertiscanDbMetadataInspectionGuaranteedAnalysis } from "./fertiscan-db-metadata-inspection-guaranteed-analysis"; +// May contain unused imports in some cases +// @ts-ignore +import type { OrganizationInformation } from "./organization-information"; +// May contain unused imports in some cases +// @ts-ignore +import type { ProductInformationOutput } from "./product-information-output"; +// May contain unused imports in some cases +// @ts-ignore +import type { SubLabel } from "./sub-label"; + +/** + * + * @export + * @interface Inspection + */ +export interface Inspection { + /** + * + * @type {string} + * @memberof Inspection + */ + inspection_comment?: string | null; + /** + * + * @type {boolean} + * @memberof Inspection + */ + verified?: boolean | null; + /** + * + * @type {OrganizationInformation} + * @memberof Inspection + */ + company?: OrganizationInformation | null; + /** + * + * @type {OrganizationInformation} + * @memberof Inspection + */ + manufacturer?: OrganizationInformation | null; + /** + * + * @type {ProductInformationOutput} + * @memberof Inspection + */ + product: ProductInformationOutput; + /** + * + * @type {SubLabel} + * @memberof Inspection + */ + cautions: SubLabel; + /** + * + * @type {SubLabel} + * @memberof Inspection + */ + instructions: SubLabel; + /** + * + * @type {FertiscanDbMetadataInspectionGuaranteedAnalysis} + * @memberof Inspection + */ + guaranteed_analysis: FertiscanDbMetadataInspectionGuaranteedAnalysis; + /** + * + * @type {string} + * @memberof Inspection + */ + inspection_id: string; +} diff --git a/src/utils/server/backend/model/label-data-input.ts b/src/utils/server/backend/model/label-data-input.ts new file mode 100644 index 00000000..a408129a --- /dev/null +++ b/src/utils/server/backend/model/label-data-input.ts @@ -0,0 +1,169 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +// May contain unused imports in some cases +// @ts-ignore +import type { NutrientValue } from "./nutrient-value"; +// May contain unused imports in some cases +// @ts-ignore +import type { PipelineInspectionGuaranteedAnalysis } from "./pipeline-inspection-guaranteed-analysis"; +// May contain unused imports in some cases +// @ts-ignore +import type { PipelineInspectionValue } from "./pipeline-inspection-value"; + +/** + * + * @export + * @interface LabelDataInput + */ +export interface LabelDataInput { + /** + * + * @type {string} + * @memberof LabelDataInput + */ + company_name?: string | null; + /** + * + * @type {string} + * @memberof LabelDataInput + */ + company_address?: string | null; + /** + * + * @type {string} + * @memberof LabelDataInput + */ + company_website?: string | null; + /** + * + * @type {string} + * @memberof LabelDataInput + */ + company_phone_number?: string | null; + /** + * + * @type {string} + * @memberof LabelDataInput + */ + manufacturer_name?: string | null; + /** + * + * @type {string} + * @memberof LabelDataInput + */ + manufacturer_address?: string | null; + /** + * + * @type {string} + * @memberof LabelDataInput + */ + manufacturer_website?: string | null; + /** + * + * @type {string} + * @memberof LabelDataInput + */ + manufacturer_phone_number?: string | null; + /** + * + * @type {string} + * @memberof LabelDataInput + */ + fertiliser_name?: string | null; + /** + * + * @type {string} + * @memberof LabelDataInput + */ + registration_number?: string | null; + /** + * + * @type {string} + * @memberof LabelDataInput + */ + lot_number?: string | null; + /** + * + * @type {Array} + * @memberof LabelDataInput + */ + weight?: Array; + /** + * + * @type {PipelineInspectionValue} + * @memberof LabelDataInput + */ + density?: PipelineInspectionValue | null; + /** + * + * @type {PipelineInspectionValue} + * @memberof LabelDataInput + */ + volume?: PipelineInspectionValue | null; + /** + * + * @type {string} + * @memberof LabelDataInput + */ + npk?: string | null; + /** + * + * @type {PipelineInspectionGuaranteedAnalysis} + * @memberof LabelDataInput + */ + guaranteed_analysis_en?: PipelineInspectionGuaranteedAnalysis | null; + /** + * + * @type {PipelineInspectionGuaranteedAnalysis} + * @memberof LabelDataInput + */ + guaranteed_analysis_fr?: PipelineInspectionGuaranteedAnalysis | null; + /** + * + * @type {Array} + * @memberof LabelDataInput + */ + cautions_en?: Array; + /** + * + * @type {Array} + * @memberof LabelDataInput + */ + cautions_fr?: Array; + /** + * + * @type {Array} + * @memberof LabelDataInput + */ + instructions_en?: Array; + /** + * + * @type {Array} + * @memberof LabelDataInput + */ + instructions_fr?: Array; + /** + * + * @type {Array} + * @memberof LabelDataInput + */ + ingredients_en?: Array; + /** + * + * @type {Array} + * @memberof LabelDataInput + */ + ingredients_fr?: Array; +} diff --git a/src/utils/server/backend/model/label-data-output.ts b/src/utils/server/backend/model/label-data-output.ts new file mode 100644 index 00000000..720e5ddb --- /dev/null +++ b/src/utils/server/backend/model/label-data-output.ts @@ -0,0 +1,169 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +// May contain unused imports in some cases +// @ts-ignore +import type { NutrientValue } from "./nutrient-value"; +// May contain unused imports in some cases +// @ts-ignore +import type { PipelineInspectionGuaranteedAnalysis } from "./pipeline-inspection-guaranteed-analysis"; +// May contain unused imports in some cases +// @ts-ignore +import type { PipelineInspectionValue } from "./pipeline-inspection-value"; + +/** + * + * @export + * @interface LabelDataOutput + */ +export interface LabelDataOutput { + /** + * + * @type {string} + * @memberof LabelDataOutput + */ + company_name?: string | null; + /** + * + * @type {string} + * @memberof LabelDataOutput + */ + company_address?: string | null; + /** + * + * @type {string} + * @memberof LabelDataOutput + */ + company_website?: string | null; + /** + * + * @type {string} + * @memberof LabelDataOutput + */ + company_phone_number?: string | null; + /** + * + * @type {string} + * @memberof LabelDataOutput + */ + manufacturer_name?: string | null; + /** + * + * @type {string} + * @memberof LabelDataOutput + */ + manufacturer_address?: string | null; + /** + * + * @type {string} + * @memberof LabelDataOutput + */ + manufacturer_website?: string | null; + /** + * + * @type {string} + * @memberof LabelDataOutput + */ + manufacturer_phone_number?: string | null; + /** + * + * @type {string} + * @memberof LabelDataOutput + */ + fertiliser_name?: string | null; + /** + * + * @type {string} + * @memberof LabelDataOutput + */ + registration_number?: string | null; + /** + * + * @type {string} + * @memberof LabelDataOutput + */ + lot_number?: string | null; + /** + * + * @type {Array} + * @memberof LabelDataOutput + */ + weight?: Array; + /** + * + * @type {PipelineInspectionValue} + * @memberof LabelDataOutput + */ + density?: PipelineInspectionValue | null; + /** + * + * @type {PipelineInspectionValue} + * @memberof LabelDataOutput + */ + volume?: PipelineInspectionValue | null; + /** + * + * @type {string} + * @memberof LabelDataOutput + */ + npk?: string | null; + /** + * + * @type {PipelineInspectionGuaranteedAnalysis} + * @memberof LabelDataOutput + */ + guaranteed_analysis_en?: PipelineInspectionGuaranteedAnalysis | null; + /** + * + * @type {PipelineInspectionGuaranteedAnalysis} + * @memberof LabelDataOutput + */ + guaranteed_analysis_fr?: PipelineInspectionGuaranteedAnalysis | null; + /** + * + * @type {Array} + * @memberof LabelDataOutput + */ + cautions_en?: Array; + /** + * + * @type {Array} + * @memberof LabelDataOutput + */ + cautions_fr?: Array; + /** + * + * @type {Array} + * @memberof LabelDataOutput + */ + instructions_en?: Array; + /** + * + * @type {Array} + * @memberof LabelDataOutput + */ + instructions_fr?: Array; + /** + * + * @type {Array} + * @memberof LabelDataOutput + */ + ingredients_en?: Array; + /** + * + * @type {Array} + * @memberof LabelDataOutput + */ + ingredients_fr?: Array; +} diff --git a/src/utils/server/backend/model/metric.ts b/src/utils/server/backend/model/metric.ts new file mode 100644 index 00000000..c3a6c33e --- /dev/null +++ b/src/utils/server/backend/model/metric.ts @@ -0,0 +1,39 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + * @interface Metric + */ +export interface Metric { + /** + * + * @type {number} + * @memberof Metric + */ + value?: number | null; + /** + * + * @type {string} + * @memberof Metric + */ + unit?: string | null; + /** + * + * @type {boolean} + * @memberof Metric + */ + edited?: boolean | null; +} diff --git a/src/utils/server/backend/model/metrics.ts b/src/utils/server/backend/model/metrics.ts new file mode 100644 index 00000000..632e2a2b --- /dev/null +++ b/src/utils/server/backend/model/metrics.ts @@ -0,0 +1,43 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +// May contain unused imports in some cases +// @ts-ignore +import type { Metric } from "./metric"; + +/** + * + * @export + * @interface Metrics + */ +export interface Metrics { + /** + * + * @type {Array} + * @memberof Metrics + */ + weight?: Array | null; + /** + * + * @type {Metric} + * @memberof Metrics + */ + volume?: Metric | null; + /** + * + * @type {Metric} + * @memberof Metrics + */ + density?: Metric | null; +} diff --git a/src/utils/server/backend/model/nutrient-value.ts b/src/utils/server/backend/model/nutrient-value.ts new file mode 100644 index 00000000..4f023ea7 --- /dev/null +++ b/src/utils/server/backend/model/nutrient-value.ts @@ -0,0 +1,39 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + * @interface NutrientValue + */ +export interface NutrientValue { + /** + * + * @type {string} + * @memberof NutrientValue + */ + nutrient: string; + /** + * + * @type {number} + * @memberof NutrientValue + */ + value?: number | null; + /** + * + * @type {string} + * @memberof NutrientValue + */ + unit?: string | null; +} diff --git a/src/utils/server/backend/model/organization-information.ts b/src/utils/server/backend/model/organization-information.ts new file mode 100644 index 00000000..435a9961 --- /dev/null +++ b/src/utils/server/backend/model/organization-information.ts @@ -0,0 +1,51 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + * @interface OrganizationInformation + */ +export interface OrganizationInformation { + /** + * + * @type {string} + * @memberof OrganizationInformation + */ + id?: string | null; + /** + * + * @type {string} + * @memberof OrganizationInformation + */ + name?: string | null; + /** + * + * @type {string} + * @memberof OrganizationInformation + */ + address?: string | null; + /** + * + * @type {string} + * @memberof OrganizationInformation + */ + website?: string | null; + /** + * + * @type {string} + * @memberof OrganizationInformation + */ + phone_number?: string | null; +} diff --git a/src/utils/server/backend/model/pipeline-inspection-guaranteed-analysis.ts b/src/utils/server/backend/model/pipeline-inspection-guaranteed-analysis.ts new file mode 100644 index 00000000..20da28a7 --- /dev/null +++ b/src/utils/server/backend/model/pipeline-inspection-guaranteed-analysis.ts @@ -0,0 +1,43 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +// May contain unused imports in some cases +// @ts-ignore +import type { NutrientValue } from "./nutrient-value"; + +/** + * + * @export + * @interface PipelineInspectionGuaranteedAnalysis + */ +export interface PipelineInspectionGuaranteedAnalysis { + /** + * + * @type {string} + * @memberof PipelineInspectionGuaranteedAnalysis + */ + title?: string | null; + /** + * + * @type {Array} + * @memberof PipelineInspectionGuaranteedAnalysis + */ + nutrients?: Array; + /** + * + * @type {boolean} + * @memberof PipelineInspectionGuaranteedAnalysis + */ + is_minimal?: boolean | null; +} diff --git a/src/utils/server/backend/model/pipeline-inspection-value.ts b/src/utils/server/backend/model/pipeline-inspection-value.ts new file mode 100644 index 00000000..0a83f899 --- /dev/null +++ b/src/utils/server/backend/model/pipeline-inspection-value.ts @@ -0,0 +1,33 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + * @interface PipelineInspectionValue + */ +export interface PipelineInspectionValue { + /** + * + * @type {number} + * @memberof PipelineInspectionValue + */ + value: number | null; + /** + * + * @type {string} + * @memberof PipelineInspectionValue + */ + unit: string | null; +} diff --git a/src/utils/server/backend/model/product-information-input.ts b/src/utils/server/backend/model/product-information-input.ts new file mode 100644 index 00000000..ae1981f9 --- /dev/null +++ b/src/utils/server/backend/model/product-information-input.ts @@ -0,0 +1,85 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +// May contain unused imports in some cases +// @ts-ignore +import type { Metrics } from "./metrics"; + +/** + * + * @export + * @interface ProductInformationInput + */ +export interface ProductInformationInput { + /** + * + * @type {string} + * @memberof ProductInformationInput + */ + name?: string | null; + /** + * + * @type {string} + * @memberof ProductInformationInput + */ + label_id?: string | null; + /** + * + * @type {string} + * @memberof ProductInformationInput + */ + registration_number?: string | null; + /** + * + * @type {string} + * @memberof ProductInformationInput + */ + lot_number?: string | null; + /** + * + * @type {Metrics} + * @memberof ProductInformationInput + */ + metrics?: Metrics | null; + /** + * + * @type {string} + * @memberof ProductInformationInput + */ + npk?: string | null; + /** + * + * @type {string} + * @memberof ProductInformationInput + */ + warranty?: string | null; + /** + * + * @type {number} + * @memberof ProductInformationInput + */ + n?: number | null; + /** + * + * @type {number} + * @memberof ProductInformationInput + */ + p?: number | null; + /** + * + * @type {number} + * @memberof ProductInformationInput + */ + k?: number | null; +} diff --git a/src/utils/server/backend/model/product-information-output.ts b/src/utils/server/backend/model/product-information-output.ts new file mode 100644 index 00000000..3580969d --- /dev/null +++ b/src/utils/server/backend/model/product-information-output.ts @@ -0,0 +1,85 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +// May contain unused imports in some cases +// @ts-ignore +import type { Metrics } from "./metrics"; + +/** + * + * @export + * @interface ProductInformationOutput + */ +export interface ProductInformationOutput { + /** + * + * @type {string} + * @memberof ProductInformationOutput + */ + name?: string | null; + /** + * + * @type {string} + * @memberof ProductInformationOutput + */ + label_id?: string | null; + /** + * + * @type {string} + * @memberof ProductInformationOutput + */ + registration_number?: string | null; + /** + * + * @type {string} + * @memberof ProductInformationOutput + */ + lot_number?: string | null; + /** + * + * @type {Metrics} + * @memberof ProductInformationOutput + */ + metrics?: Metrics | null; + /** + * + * @type {string} + * @memberof ProductInformationOutput + */ + npk?: string | null; + /** + * + * @type {string} + * @memberof ProductInformationOutput + */ + warranty?: string | null; + /** + * + * @type {number} + * @memberof ProductInformationOutput + */ + n?: number | null; + /** + * + * @type {number} + * @memberof ProductInformationOutput + */ + p?: number | null; + /** + * + * @type {number} + * @memberof ProductInformationOutput + */ + k?: number | null; +} diff --git a/src/utils/server/backend/model/sub-label.ts b/src/utils/server/backend/model/sub-label.ts new file mode 100644 index 00000000..c2102f23 --- /dev/null +++ b/src/utils/server/backend/model/sub-label.ts @@ -0,0 +1,33 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + * @interface SubLabel + */ +export interface SubLabel { + /** + * + * @type {Array} + * @memberof SubLabel + */ + en?: Array; + /** + * + * @type {Array} + * @memberof SubLabel + */ + fr?: Array; +} diff --git a/src/utils/server/backend/model/title.ts b/src/utils/server/backend/model/title.ts new file mode 100644 index 00000000..8440274e --- /dev/null +++ b/src/utils/server/backend/model/title.ts @@ -0,0 +1,33 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + * @interface Title + */ +export interface Title { + /** + * + * @type {string} + * @memberof Title + */ + en?: string | null; + /** + * + * @type {string} + * @memberof Title + */ + fr?: string | null; +} diff --git a/src/utils/server/backend/model/user.ts b/src/utils/server/backend/model/user.ts new file mode 100644 index 00000000..b4ba9aa7 --- /dev/null +++ b/src/utils/server/backend/model/user.ts @@ -0,0 +1,33 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + * @interface User + */ +export interface User { + /** + * + * @type {string} + * @memberof User + */ + id?: string | null; + /** + * + * @type {string} + * @memberof User + */ + username?: string | null; +} diff --git a/src/utils/server/backend/model/validation-error-loc-inner.ts b/src/utils/server/backend/model/validation-error-loc-inner.ts new file mode 100644 index 00000000..cb90baa7 --- /dev/null +++ b/src/utils/server/backend/model/validation-error-loc-inner.ts @@ -0,0 +1,20 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + * @interface ValidationErrorLocInner + */ +export interface ValidationErrorLocInner {} diff --git a/src/utils/server/backend/model/validation-error.ts b/src/utils/server/backend/model/validation-error.ts new file mode 100644 index 00000000..9ceea7eb --- /dev/null +++ b/src/utils/server/backend/model/validation-error.ts @@ -0,0 +1,43 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +// May contain unused imports in some cases +// @ts-ignore +import type { ValidationErrorLocInner } from "./validation-error-loc-inner"; + +/** + * + * @export + * @interface ValidationError + */ +export interface ValidationError { + /** + * + * @type {Array} + * @memberof ValidationError + */ + loc: Array; + /** + * + * @type {string} + * @memberof ValidationError + */ + msg: string; + /** + * + * @type {string} + * @memberof ValidationError + */ + type: string; +}