From 1a7606bac1c93a565a1e774da31af48a505a09ae Mon Sep 17 00:00:00 2001 From: "K. Allagbe" Date: Wed, 4 Dec 2024 22:31:00 -0500 Subject: [PATCH] issue #360: fertiscan backend openapi client --- .gitignore | 2 + src/app/api/extract-label-data/route.ts | 26 +- src/utils/server/backend/api.ts | 22 + src/utils/server/backend/api/home-api.ts | 122 +++++ .../server/backend/api/inspections-api.ts | 457 ++++++++++++++++++ .../server/backend/api/monitoring-api.ts | 124 +++++ src/utils/server/backend/api/pipeline-api.ts | 142 ++++++ src/utils/server/backend/api/users-api.ts | 194 ++++++++ src/utils/server/backend/base.ts | 86 ++++ src/utils/server/backend/client.ts | 17 + src/utils/server/backend/common.ts | 150 ++++++ src/utils/server/backend/configuration.ts | 110 +++++ src/utils/server/backend/index.ts | 18 + .../backend/model/deleted-inspection.ts | 84 ++++ ...metadata-inspection-guaranteed-analysis.ts | 54 +++ .../fertiscan-db-metadata-inspection-value.ts | 48 ++ .../server/backend/model/health-status.ts | 30 ++ .../backend/model/httpvalidation-error.ts | 33 ++ src/utils/server/backend/model/index.ts | 23 + .../server/backend/model/inspection-data.ts | 84 ++++ .../server/backend/model/inspection-update.ts | 84 ++++ src/utils/server/backend/model/inspection.ts | 90 ++++ .../server/backend/model/label-data-input.ts | 171 +++++++ .../server/backend/model/label-data-output.ts | 171 +++++++ src/utils/server/backend/model/metric.ts | 42 ++ src/utils/server/backend/model/metrics.ts | 45 ++ .../server/backend/model/nutrient-value.ts | 42 ++ .../backend/model/organization-information.ts | 54 +++ ...pipeline-inspection-guaranteed-analysis.ts | 45 ++ .../model/pipeline-inspection-value.ts | 36 ++ .../model/product-information-input.ts | 87 ++++ .../model/product-information-output.ts | 87 ++++ src/utils/server/backend/model/sub-label.ts | 36 ++ src/utils/server/backend/model/title.ts | 36 ++ src/utils/server/backend/model/user.ts | 36 ++ .../model/validation-error-loc-inner.ts | 24 + .../server/backend/model/validation-error.ts | 45 ++ 37 files changed, 2946 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..31ad7dd5 --- /dev/null +++ b/src/utils/server/backend/api.ts @@ -0,0 +1,22 @@ +/* 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..d3726dd9 --- /dev/null +++ b/src/utils/server/backend/api/home-api.ts @@ -0,0 +1,122 @@ +/* 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..57bdf3ca --- /dev/null +++ b/src/utils/server/backend/api/inspections-api.ts @@ -0,0 +1,457 @@ +/* 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..1307cad8 --- /dev/null +++ b/src/utils/server/backend/api/monitoring-api.ts @@ -0,0 +1,124 @@ +/* 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'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +// @ts-ignore +import type { 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..74f7e0f1 --- /dev/null +++ b/src/utils/server/backend/api/pipeline-api.ts @@ -0,0 +1,142 @@ +/* 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'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +// @ts-ignore +import type { HTTPValidationError } from '../model'; +// @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..09f79bc2 --- /dev/null +++ b/src/utils/server/backend/api/users-api.ts @@ -0,0 +1,194 @@ +/* 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'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +// @ts-ignore +import type { 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..1f93ec8f --- /dev/null +++ b/src/utils/server/backend/base.ts @@ -0,0 +1,86 @@ +/* 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 { AxiosPromise, 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..87f3b0d3 --- /dev/null +++ b/src/utils/server/backend/common.ts @@ -0,0 +1,150 @@ +/* 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"; +import type { RequestArgs } from "./base"; +import type { AxiosInstance, AxiosResponse } from 'axios'; +import { RequiredError } from "./base"; + +/** + * + * @export + */ +export const DUMMY_BASE_URL = 'https://example.com' + +/** + * + * @throws {RequiredError} + * @export + */ +export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) { + if (paramValue === null || paramValue === undefined) { + throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`); + } +} + +/** + * + * @export + */ +export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) { + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? await configuration.apiKey(keyParamName) + : await configuration.apiKey; + object[keyParamName] = localVarApiKeyValue; + } +} + +/** + * + * @export + */ +export const setBasicAuthToObject = function (object: any, configuration?: Configuration) { + if (configuration && (configuration.username || configuration.password)) { + object["auth"] = { username: configuration.username, password: configuration.password }; + } +} + +/** + * + * @export + */ +export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const accessToken = typeof configuration.accessToken === 'function' + ? await configuration.accessToken() + : await configuration.accessToken; + object["Authorization"] = "Bearer " + accessToken; + } +} + +/** + * + * @export + */ +export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? await configuration.accessToken(name, scopes) + : await configuration.accessToken; + object["Authorization"] = "Bearer " + localVarAccessTokenValue; + } +} + +function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void { + if (parameter == null) return; + if (typeof parameter === "object") { + if (Array.isArray(parameter)) { + (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key)); + } + else { + Object.keys(parameter).forEach(currentKey => + setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`) + ); + } + } + else { + if (urlSearchParams.has(key)) { + urlSearchParams.append(key, parameter); + } + else { + urlSearchParams.set(key, parameter); + } + } +} + +/** + * + * @export + */ +export const setSearchParams = function (url: URL, ...objects: any[]) { + const searchParams = new URLSearchParams(url.search); + setFlattenedQueryParams(searchParams, objects); + url.search = searchParams.toString(); +} + +/** + * + * @export + */ +export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) { + const nonString = typeof value !== 'string'; + const needsSerialization = nonString && configuration && configuration.isJsonMime + ? configuration.isJsonMime(requestOptions.headers['Content-Type']) + : nonString; + return needsSerialization + ? JSON.stringify(value !== undefined ? value : {}) + : (value || ""); +} + +/** + * + * @export + */ +export const toPathString = function (url: URL) { + return url.pathname + url.search + url.hash +} + +/** + * + * @export + */ +export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { + return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url}; + return axios.request(axiosRequestArgs); + }; +} diff --git a/src/utils/server/backend/configuration.ts b/src/utils/server/backend/configuration.ts new file mode 100644 index 00000000..0c49d41d --- /dev/null +++ b/src/utils/server/backend/configuration.ts @@ -0,0 +1,110 @@ +/* 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..a0734b7f --- /dev/null +++ b/src/utils/server/backend/model/deleted-inspection.ts @@ -0,0 +1,84 @@ +/* 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..7bb0a4bf --- /dev/null +++ b/src/utils/server/backend/model/fertiscan-db-metadata-inspection-guaranteed-analysis.ts @@ -0,0 +1,54 @@ +/* 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..2bfc7b33 --- /dev/null +++ b/src/utils/server/backend/model/fertiscan-db-metadata-inspection-value.ts @@ -0,0 +1,48 @@ +/* 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..8d6fe3c8 --- /dev/null +++ b/src/utils/server/backend/model/health-status.ts @@ -0,0 +1,30 @@ +/* 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..9667f592 --- /dev/null +++ b/src/utils/server/backend/model/httpvalidation-error.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. + */ + + +// 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..4f35e200 --- /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 './httpvalidation-error'; +export * from './health-status'; +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..4a07a17a --- /dev/null +++ b/src/utils/server/backend/model/inspection-data.ts @@ -0,0 +1,84 @@ +/* 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..132f67b1 --- /dev/null +++ b/src/utils/server/backend/model/inspection-update.ts @@ -0,0 +1,84 @@ +/* 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..7e4e43cd --- /dev/null +++ b/src/utils/server/backend/model/inspection.ts @@ -0,0 +1,90 @@ +/* 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..d92e3d26 --- /dev/null +++ b/src/utils/server/backend/model/label-data-input.ts @@ -0,0 +1,171 @@ +/* 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..4cad2748 --- /dev/null +++ b/src/utils/server/backend/model/label-data-output.ts @@ -0,0 +1,171 @@ +/* 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..6d997edd --- /dev/null +++ b/src/utils/server/backend/model/metric.ts @@ -0,0 +1,42 @@ +/* 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..7871f127 --- /dev/null +++ b/src/utils/server/backend/model/metrics.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. + */ + + +// 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..54e234cb --- /dev/null +++ b/src/utils/server/backend/model/nutrient-value.ts @@ -0,0 +1,42 @@ +/* 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..821983d1 --- /dev/null +++ b/src/utils/server/backend/model/organization-information.ts @@ -0,0 +1,54 @@ +/* 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..aaafa3a5 --- /dev/null +++ b/src/utils/server/backend/model/pipeline-inspection-guaranteed-analysis.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. + */ + + +// 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..74e0eca5 --- /dev/null +++ b/src/utils/server/backend/model/pipeline-inspection-value.ts @@ -0,0 +1,36 @@ +/* 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..b739c58b --- /dev/null +++ b/src/utils/server/backend/model/product-information-input.ts @@ -0,0 +1,87 @@ +/* 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..ecbd4555 --- /dev/null +++ b/src/utils/server/backend/model/product-information-output.ts @@ -0,0 +1,87 @@ +/* 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..ba54a162 --- /dev/null +++ b/src/utils/server/backend/model/sub-label.ts @@ -0,0 +1,36 @@ +/* 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..877407ab --- /dev/null +++ b/src/utils/server/backend/model/title.ts @@ -0,0 +1,36 @@ +/* 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..b3087abf --- /dev/null +++ b/src/utils/server/backend/model/user.ts @@ -0,0 +1,36 @@ +/* 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..8a161900 --- /dev/null +++ b/src/utils/server/backend/model/validation-error-loc-inner.ts @@ -0,0 +1,24 @@ +/* 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..4d9c09be --- /dev/null +++ b/src/utils/server/backend/model/validation-error.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. + */ + + +// 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; +} +