/* tslint:disable */ /* eslint-disable */ /** * openfilz-api * API for Document Management System * * The version of the OpenAPI document: 1.0.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, replaceWithSerializableTypeIfNeeded } from '../common'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import type { AiConnectionTestResult } from '../models'; // @ts-ignore import type { AiModelsResponse } from '../models'; // @ts-ignore import type { AiSettingsResponse } from '../models'; // @ts-ignore import type { ListAiModelsRequest } from '../models'; // @ts-ignore import type { SaveAiSettingsRequest } from '../models'; /** * AISettingsApi - axios parameter creator */ export const AISettingsApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Remove my chat-LLM override and go back to the server default model. * @summary Reset my AI settings * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteSettings: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/settings/ai`; // 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 keycloak_auth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Current user\'s chat-LLM override. The API key is never returned — only hasApiKey and its last characters. * @summary Get my AI settings * @param {*} [options] Override http request option. * @throws {RequiredError} */ getSettings: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/settings/ai`; // 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 keycloak_auth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) localVarHeaderParameter['Accept'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Ask the provider which chat models this key can use, so the picker reflects what exists today rather than a list baked into a release. Falls back to a built-in list (source=FALLBACK) when the provider cannot be reached. POST rather than GET because the key travels in the body, never in a query string; omit apiKey to use the stored key. * @summary List the provider\'s chat models * @param {ListAiModelsRequest} listAiModelsRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ listModels: async (listAiModelsRequest: ListAiModelsRequest, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'listAiModelsRequest' is not null or undefined assertParamExists('listModels', 'listAiModelsRequest', listAiModelsRequest) const localVarPath = `/api/v1/settings/ai/models`; // 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 keycloak_auth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; localVarHeaderParameter['Accept'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(listAiModelsRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Set the chat LLM to use for my conversations. Omit apiKey to keep the previously stored key. * @summary Save my AI settings * @param {SaveAiSettingsRequest} saveAiSettingsRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ saveSettings: async (saveAiSettingsRequest: SaveAiSettingsRequest, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'saveAiSettingsRequest' is not null or undefined assertParamExists('saveSettings', 'saveAiSettingsRequest', saveAiSettingsRequest) const localVarPath = `/api/v1/settings/ai`; // 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 keycloak_auth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; localVarHeaderParameter['Accept'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(saveAiSettingsRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Send a minimal completion request with the submitted settings (falls back to the stored key when apiKey is omitted). * @summary Test AI provider connection * @param {SaveAiSettingsRequest} saveAiSettingsRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ testConnection: async (saveAiSettingsRequest: SaveAiSettingsRequest, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'saveAiSettingsRequest' is not null or undefined assertParamExists('testConnection', 'saveAiSettingsRequest', saveAiSettingsRequest) const localVarPath = `/api/v1/settings/ai/test`; // 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 keycloak_auth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; localVarHeaderParameter['Accept'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(saveAiSettingsRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * AISettingsApi - functional programming interface */ export const AISettingsApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = AISettingsApiAxiosParamCreator(configuration) return { /** * Remove my chat-LLM override and go back to the server default model. * @summary Reset my AI settings * @param {*} [options] Override http request option. * @throws {RequiredError} */ async deleteSettings(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteSettings(options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['AISettingsApi.deleteSettings']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Current user\'s chat-LLM override. The API key is never returned — only hasApiKey and its last characters. * @summary Get my AI settings * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getSettings(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getSettings(options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['AISettingsApi.getSettings']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Ask the provider which chat models this key can use, so the picker reflects what exists today rather than a list baked into a release. Falls back to a built-in list (source=FALLBACK) when the provider cannot be reached. POST rather than GET because the key travels in the body, never in a query string; omit apiKey to use the stored key. * @summary List the provider\'s chat models * @param {ListAiModelsRequest} listAiModelsRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ async listModels(listAiModelsRequest: ListAiModelsRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.listModels(listAiModelsRequest, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['AISettingsApi.listModels']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Set the chat LLM to use for my conversations. Omit apiKey to keep the previously stored key. * @summary Save my AI settings * @param {SaveAiSettingsRequest} saveAiSettingsRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ async saveSettings(saveAiSettingsRequest: SaveAiSettingsRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.saveSettings(saveAiSettingsRequest, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['AISettingsApi.saveSettings']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Send a minimal completion request with the submitted settings (falls back to the stored key when apiKey is omitted). * @summary Test AI provider connection * @param {SaveAiSettingsRequest} saveAiSettingsRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ async testConnection(saveAiSettingsRequest: SaveAiSettingsRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.testConnection(saveAiSettingsRequest, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['AISettingsApi.testConnection']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; /** * AISettingsApi - factory interface */ export const AISettingsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = AISettingsApiFp(configuration) return { /** * Remove my chat-LLM override and go back to the server default model. * @summary Reset my AI settings * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteSettings(options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deleteSettings(options).then((request) => request(axios, basePath)); }, /** * Current user\'s chat-LLM override. The API key is never returned — only hasApiKey and its last characters. * @summary Get my AI settings * @param {*} [options] Override http request option. * @throws {RequiredError} */ getSettings(options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getSettings(options).then((request) => request(axios, basePath)); }, /** * Ask the provider which chat models this key can use, so the picker reflects what exists today rather than a list baked into a release. Falls back to a built-in list (source=FALLBACK) when the provider cannot be reached. POST rather than GET because the key travels in the body, never in a query string; omit apiKey to use the stored key. * @summary List the provider\'s chat models * @param {ListAiModelsRequest} listAiModelsRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ listModels(listAiModelsRequest: ListAiModelsRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.listModels(listAiModelsRequest, options).then((request) => request(axios, basePath)); }, /** * Set the chat LLM to use for my conversations. Omit apiKey to keep the previously stored key. * @summary Save my AI settings * @param {SaveAiSettingsRequest} saveAiSettingsRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ saveSettings(saveAiSettingsRequest: SaveAiSettingsRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.saveSettings(saveAiSettingsRequest, options).then((request) => request(axios, basePath)); }, /** * Send a minimal completion request with the submitted settings (falls back to the stored key when apiKey is omitted). * @summary Test AI provider connection * @param {SaveAiSettingsRequest} saveAiSettingsRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ testConnection(saveAiSettingsRequest: SaveAiSettingsRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testConnection(saveAiSettingsRequest, options).then((request) => request(axios, basePath)); }, }; }; /** * AISettingsApi - object-oriented interface */ export class AISettingsApi extends BaseAPI { /** * Remove my chat-LLM override and go back to the server default model. * @summary Reset my AI settings * @param {*} [options] Override http request option. * @throws {RequiredError} */ public deleteSettings(options?: RawAxiosRequestConfig) { return AISettingsApiFp(this.configuration).deleteSettings(options).then((request) => request(this.axios, this.basePath)); } /** * Current user\'s chat-LLM override. The API key is never returned — only hasApiKey and its last characters. * @summary Get my AI settings * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getSettings(options?: RawAxiosRequestConfig) { return AISettingsApiFp(this.configuration).getSettings(options).then((request) => request(this.axios, this.basePath)); } /** * Ask the provider which chat models this key can use, so the picker reflects what exists today rather than a list baked into a release. Falls back to a built-in list (source=FALLBACK) when the provider cannot be reached. POST rather than GET because the key travels in the body, never in a query string; omit apiKey to use the stored key. * @summary List the provider\'s chat models * @param {ListAiModelsRequest} listAiModelsRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ public listModels(listAiModelsRequest: ListAiModelsRequest, options?: RawAxiosRequestConfig) { return AISettingsApiFp(this.configuration).listModels(listAiModelsRequest, options).then((request) => request(this.axios, this.basePath)); } /** * Set the chat LLM to use for my conversations. Omit apiKey to keep the previously stored key. * @summary Save my AI settings * @param {SaveAiSettingsRequest} saveAiSettingsRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ public saveSettings(saveAiSettingsRequest: SaveAiSettingsRequest, options?: RawAxiosRequestConfig) { return AISettingsApiFp(this.configuration).saveSettings(saveAiSettingsRequest, options).then((request) => request(this.axios, this.basePath)); } /** * Send a minimal completion request with the submitted settings (falls back to the stored key when apiKey is omitted). * @summary Test AI provider connection * @param {SaveAiSettingsRequest} saveAiSettingsRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ public testConnection(saveAiSettingsRequest: SaveAiSettingsRequest, options?: RawAxiosRequestConfig) { return AISettingsApiFp(this.configuration).testConnection(saveAiSettingsRequest, options).then((request) => request(this.axios, this.basePath)); } }