/* 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 { MergeRequest } from '../models'; // @ts-ignore import type { OrganizeRequest } from '../models'; // @ts-ignore import type { PdfInfo } from '../models'; // @ts-ignore import type { PdfOperationResponse } from '../models'; // @ts-ignore import type { RotateRequest } from '../models'; // @ts-ignore import type { SplitRequest } from '../models'; /** * PDFToolsApi - axios parameter creator */ export const PDFToolsApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Page count and geometry, bookmarks, and whether the file is password-protected or digitally signed. * @summary Describe a stored PDF * @param {string} documentId PDF document id * @param {*} [options] Override http request option. * @throws {RequiredError} */ info: async (documentId: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'documentId' is not null or undefined assertParamExists('info', 'documentId', documentId) const localVarPath = `/api/v1/pdf/{documentId}/info` .replace('{documentId}', encodeURIComponent(String(documentId))); // 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, }; }, /** * Concatenate several PDFs (or page selections of them) into one document, in the given order, optionally with one bookmark per source. Default output: a new document next to the first source. * @summary Merge PDFs * @param {MergeRequest} mergeRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ merge: async (mergeRequest: MergeRequest, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'mergeRequest' is not null or undefined assertParamExists('merge', 'mergeRequest', mergeRequest) const localVarPath = `/api/v1/pdf/merge`; // 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(mergeRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * The result is exactly the listed pages, in order: reorder, delete, duplicate, rotate individual pages, extract a selection, or insert pages from other PDFs. Default output: a new version of the main document. * @summary Reorganise the pages of a PDF * @param {OrganizeRequest} organizeRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ organize: async (organizeRequest: OrganizeRequest, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'organizeRequest' is not null or undefined assertParamExists('organize', 'organizeRequest', organizeRequest) const localVarPath = `/api/v1/pdf/organize`; // 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(organizeRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Rotate all or selected pages of one or several PDFs by 90, 180 or 270 degrees, one output per document. Default output: a new version of each document. * @summary Rotate pages * @param {RotateRequest} rotateRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ rotate: async (rotateRequest: RotateRequest, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'rotateRequest' is not null or undefined assertParamExists('rotate', 'rotateRequest', rotateRequest) const localVarPath = `/api/v1/pdf/rotate`; // 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(rotateRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Cut one PDF into several new documents: every N pages, at given pages, by explicit page ranges, one document per page, or at bookmarks. Names follow a pattern ({name}, {index}, {first}, {last}, {title}). * @summary Split a PDF * @param {SplitRequest} splitRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ split: async (splitRequest: SplitRequest, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'splitRequest' is not null or undefined assertParamExists('split', 'splitRequest', splitRequest) const localVarPath = `/api/v1/pdf/split`; // 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(splitRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * PDFToolsApi - functional programming interface */ export const PDFToolsApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = PDFToolsApiAxiosParamCreator(configuration) return { /** * Page count and geometry, bookmarks, and whether the file is password-protected or digitally signed. * @summary Describe a stored PDF * @param {string} documentId PDF document id * @param {*} [options] Override http request option. * @throws {RequiredError} */ async info(documentId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.info(documentId, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['PDFToolsApi.info']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Concatenate several PDFs (or page selections of them) into one document, in the given order, optionally with one bookmark per source. Default output: a new document next to the first source. * @summary Merge PDFs * @param {MergeRequest} mergeRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ async merge(mergeRequest: MergeRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.merge(mergeRequest, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['PDFToolsApi.merge']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * The result is exactly the listed pages, in order: reorder, delete, duplicate, rotate individual pages, extract a selection, or insert pages from other PDFs. Default output: a new version of the main document. * @summary Reorganise the pages of a PDF * @param {OrganizeRequest} organizeRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ async organize(organizeRequest: OrganizeRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.organize(organizeRequest, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['PDFToolsApi.organize']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Rotate all or selected pages of one or several PDFs by 90, 180 or 270 degrees, one output per document. Default output: a new version of each document. * @summary Rotate pages * @param {RotateRequest} rotateRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ async rotate(rotateRequest: RotateRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.rotate(rotateRequest, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['PDFToolsApi.rotate']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Cut one PDF into several new documents: every N pages, at given pages, by explicit page ranges, one document per page, or at bookmarks. Names follow a pattern ({name}, {index}, {first}, {last}, {title}). * @summary Split a PDF * @param {SplitRequest} splitRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ async split(splitRequest: SplitRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.split(splitRequest, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['PDFToolsApi.split']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; /** * PDFToolsApi - factory interface */ export const PDFToolsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = PDFToolsApiFp(configuration) return { /** * Page count and geometry, bookmarks, and whether the file is password-protected or digitally signed. * @summary Describe a stored PDF * @param {string} documentId PDF document id * @param {*} [options] Override http request option. * @throws {RequiredError} */ info(documentId: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.info(documentId, options).then((request) => request(axios, basePath)); }, /** * Concatenate several PDFs (or page selections of them) into one document, in the given order, optionally with one bookmark per source. Default output: a new document next to the first source. * @summary Merge PDFs * @param {MergeRequest} mergeRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ merge(mergeRequest: MergeRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.merge(mergeRequest, options).then((request) => request(axios, basePath)); }, /** * The result is exactly the listed pages, in order: reorder, delete, duplicate, rotate individual pages, extract a selection, or insert pages from other PDFs. Default output: a new version of the main document. * @summary Reorganise the pages of a PDF * @param {OrganizeRequest} organizeRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ organize(organizeRequest: OrganizeRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.organize(organizeRequest, options).then((request) => request(axios, basePath)); }, /** * Rotate all or selected pages of one or several PDFs by 90, 180 or 270 degrees, one output per document. Default output: a new version of each document. * @summary Rotate pages * @param {RotateRequest} rotateRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ rotate(rotateRequest: RotateRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.rotate(rotateRequest, options).then((request) => request(axios, basePath)); }, /** * Cut one PDF into several new documents: every N pages, at given pages, by explicit page ranges, one document per page, or at bookmarks. Names follow a pattern ({name}, {index}, {first}, {last}, {title}). * @summary Split a PDF * @param {SplitRequest} splitRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ split(splitRequest: SplitRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.split(splitRequest, options).then((request) => request(axios, basePath)); }, }; }; /** * PDFToolsApi - object-oriented interface */ export class PDFToolsApi extends BaseAPI { /** * Page count and geometry, bookmarks, and whether the file is password-protected or digitally signed. * @summary Describe a stored PDF * @param {string} documentId PDF document id * @param {*} [options] Override http request option. * @throws {RequiredError} */ public info(documentId: string, options?: RawAxiosRequestConfig) { return PDFToolsApiFp(this.configuration).info(documentId, options).then((request) => request(this.axios, this.basePath)); } /** * Concatenate several PDFs (or page selections of them) into one document, in the given order, optionally with one bookmark per source. Default output: a new document next to the first source. * @summary Merge PDFs * @param {MergeRequest} mergeRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ public merge(mergeRequest: MergeRequest, options?: RawAxiosRequestConfig) { return PDFToolsApiFp(this.configuration).merge(mergeRequest, options).then((request) => request(this.axios, this.basePath)); } /** * The result is exactly the listed pages, in order: reorder, delete, duplicate, rotate individual pages, extract a selection, or insert pages from other PDFs. Default output: a new version of the main document. * @summary Reorganise the pages of a PDF * @param {OrganizeRequest} organizeRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ public organize(organizeRequest: OrganizeRequest, options?: RawAxiosRequestConfig) { return PDFToolsApiFp(this.configuration).organize(organizeRequest, options).then((request) => request(this.axios, this.basePath)); } /** * Rotate all or selected pages of one or several PDFs by 90, 180 or 270 degrees, one output per document. Default output: a new version of each document. * @summary Rotate pages * @param {RotateRequest} rotateRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ public rotate(rotateRequest: RotateRequest, options?: RawAxiosRequestConfig) { return PDFToolsApiFp(this.configuration).rotate(rotateRequest, options).then((request) => request(this.axios, this.basePath)); } /** * Cut one PDF into several new documents: every N pages, at given pages, by explicit page ranges, one document per page, or at bookmarks. Names follow a pattern ({name}, {index}, {first}, {last}, {title}). * @summary Split a PDF * @param {SplitRequest} splitRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ public split(splitRequest: SplitRequest, options?: RawAxiosRequestConfig) { return PDFToolsApiFp(this.configuration).split(splitRequest, options).then((request) => request(this.axios, this.basePath)); } }