/** * 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 { type RequestArgs, BaseAPI } from '../base'; import type { AncestorInfo } from '../models'; import type { CreateBlankDocumentRequest } from '../models'; import type { DeleteMetadataRequest } from '../models'; import type { DocumentInfo } from '../models'; import type { DocumentIntegrityRecord } from '../models'; import type { DocumentPosition } from '../models'; import type { ElementInfo } from '../models'; import type { SearchByMetadataRequest } from '../models'; import type { SearchMetadataRequest } from '../models'; import type { UpdateMetadataRequest } from '../models'; import type { UploadResponse } from '../models'; /** * DocumentControllerApi - axios parameter creator */ export declare const DocumentControllerApiAxiosParamCreator: (configuration?: Configuration) => { /** * Creates a new blank document (Word, Excel, PowerPoint, or Text) from a template in the specified folder. * @summary Create a blank document from template * @param {CreateBlankDocumentRequest} createBlankDocumentRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ createBlankDocument: (createBlankDocumentRequest: CreateBlankDocumentRequest, options?: RawAxiosRequestConfig) => Promise; /** * Deletes specified metadata keys from a document. * @summary Delete specific metadata keys * @param {string} documentId * @param {DeleteMetadataRequest} deleteMetadataRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteDocumentMetadata: (documentId: string, deleteMetadataRequest: DeleteMetadataRequest, options?: RawAxiosRequestConfig) => Promise; /** * Downloads a single file document. * @summary Download a document * @param {string} documentId * @param {*} [options] Override http request option. * @throws {RequiredError} */ downloadDocument: (documentId: string, options?: RawAxiosRequestConfig) => Promise; /** * Internal endpoint for OnlyOffice DocumentServer to fetch document content. Uses token-based authentication. * @summary Download document for OnlyOffice * @param {string} documentId * @param {string} token * @param {string} [versionId] * @param {*} [options] Override http request option. * @throws {RequiredError} */ downloadForOnlyOffice: (documentId: string, token: string, versionId?: string, options?: RawAxiosRequestConfig) => Promise; /** * Downloads multiple documents as a single ZIP file. * @summary Download multiple documents as ZIP * @param {Array} requestBody * @param {*} [options] Override http request option. * @throws {RequiredError} */ downloadMultipleDocumentsAsZip: (requestBody: Array, options?: RawAxiosRequestConfig) => Promise; /** * Retrieves all ancestor folders (parent path) of a document, ordered from root to immediate parent. * @summary Get document ancestors * @param {string} documentId * @param {*} [options] Override http request option. * @throws {RequiredError} */ getDocumentAncestors: (documentId: string, options?: RawAxiosRequestConfig) => Promise; /** * Retrieves information for a document. * @summary Get information of a document * @param {string} documentId * @param {boolean} [withMetadata] if false : only name, type and parentId are sent (when not null) - if true : metadata and size are added in the response * @param {*} [options] Override http request option. * @throws {RequiredError} */ getDocumentInfo: (documentId: string, withMetadata?: boolean, options?: RawAxiosRequestConfig) => Promise; /** * Append-only history of what this document\'s content hashed to, newest first. Unlike the sha256 in metadata, these entries cannot be modified or deleted — a database trigger refuses UPDATE and DELETE on the table. Empty for documents uploaded before the ledger existed, or when openfilz.calculate-checksum is off. * @summary Get a document\'s integrity ledger * @param {string} documentId * @param {*} [options] Override http request option. * @throws {RequiredError} */ getDocumentIntegrity: (documentId: string, options?: RawAxiosRequestConfig) => Promise; /** * Retrieves metadata for a document. Can filter by keys. * @summary Search metadata of a document * @param {string} documentId * @param {SearchMetadataRequest} [searchMetadataRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getDocumentMetadata: (documentId: string, searchMetadataRequest?: SearchMetadataRequest, options?: RawAxiosRequestConfig) => Promise; /** * Retrieves the position of a document within its parent folder, useful for pagination. * @summary Get document position in folder * @param {string} documentId * @param {string} [sortBy] Field to sort by (name, updated_at, created_at, size, type). Defaults to \'name\'. * @param {string} [sortOrder] Sort order (ASC or DESC). Defaults to \'ASC\'. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getDocumentPosition: (documentId: string, sortBy?: string, sortOrder?: string, options?: RawAxiosRequestConfig) => Promise; /** * Replaces the content of an existing file document. * @summary Replace document content * @param {string} documentId * @param {File} file * @param {*} [options] Override http request option. * @throws {RequiredError} */ replaceDocumentContent: (documentId: string, file: File, options?: RawAxiosRequestConfig) => Promise; /** * Replaces all metadata of a document (file or folder). * @summary Replace document metadata * @param {string} documentId * @param {{ [key: string]: any; }} requestBody New metadata map. Replaces all existing metadata. * @param {*} [options] Override http request option. * @throws {RequiredError} */ replaceDocumentMetadata: (documentId: string, requestBody: { [key: string]: any; }, options?: RawAxiosRequestConfig) => Promise; /** * Finds document IDs matching all provided metadata criteria. * @summary Search document IDs by metadata * @param {SearchByMetadataRequest} searchByMetadataRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ searchDocumentIdsByMetadata: (searchByMetadataRequest: SearchByMetadataRequest, options?: RawAxiosRequestConfig) => Promise; /** * Updates or adds specific metadata fields for a document. * @summary Update document metadata * @param {string} documentId * @param {UpdateMetadataRequest} updateMetadataRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateDocumentMetadata: (documentId: string, updateMetadataRequest: UpdateMetadataRequest, options?: RawAxiosRequestConfig) => Promise; /** * Uploads multiple files, optionally with metadata and a parent folder ID. Returns HTTP 200 if all uploads succeed, HTTP 207 (Multi-Status) if some succeed and some fail, or an appropriate error status (404, 409, 403, 500) if all uploads fail. * @summary Upload multiple documents * @param {Array} file * @param {boolean} [allowDuplicateFileNames] When true, the file is stored even if a document of the same name already exists in the target folder (nothing is overwritten). When false (default), a 409 is returned. * @param {boolean} [autoFile] Smart filing: true asks OpenFilz to choose the destination folder of the uploaded file(s) after the upload (a job id comes back in autoFile.jobId); false leaves them where they are; absent = the user\'s own switch. Needs openfilz.ai.auto-file.active. * @param {string} [parametersByFilename] Paste the JSON array here<br>This array provides optional metadata and attributes for the uploaded files<br><section> <h3>Each object in the array must contain:</h3> <table> <thead> <tr> <th>Field</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>filename</code></td> <td><code>String</code></td> <td>Must match the filename of one of the uploaded files. Filenames must be unique in the upload request.</td> </tr> <tr> <td><code>fileAttributes</code></td> <td><code>JSON Object</code></td> <td>Container for metadata and other file-specific attributes.</td> </tr> </tbody> </table> <h4>Inside <code>fileAttributes</code>:</h4> <table> <thead> <tr> <th>Field</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>parentFolderId</code></td> <td><code>UUID</code></td> <td>UUID of the target folder to upload the file (if not provided : the file will be uploaded at the root level)</td> </tr> <tr> <td><code>metadata</code></td> <td><code>Map&lt;String, JSON Object&gt;</code></td> <td>Arbitrary metadata to associate with the file (key/value pairs).</td> </tr> </tbody> </table> <h4>Example of <code>parametersByFilename</code> JSON array :</h4> <pre><code>[ { \\\"filename\\\": \\\"file1.txt\\\", \\\"fileAttributes\\\": { \\\"parentFolderId\\\": \\\"f8c3de3d-1fea-4d7c-a8b0-29f63c4c3454\\\", \\\"metadata\\\": { \\\"country\\\": \\\"UK\\\", \\\"owner\\\": { \\\"name\\\": \\\"Joe\\\", \\\"owner_id\\\": 1234568 } } } }, { \\\"filename\\\": \\\"file2.md\\\", \\\"fileAttributes\\\": { \\\"metadata\\\": { \\\"key1\\\": \\\"value1\\\", \\\"key2\\\": \\\"value2\\\", \\\"key3\\\": \\\"value3\\\" } } } ]</code></pre> </section> * @param {*} [options] Override http request option. * @throws {RequiredError} */ uploadDocument: (file: Array, allowDuplicateFileNames?: boolean, autoFile?: boolean, parametersByFilename?: string, options?: RawAxiosRequestConfig) => Promise; /** * Uploads a single file, optionally with metadata and a parent folder ID. * @summary Upload a single document * @param {File} file * @param {boolean} [allowDuplicateFileNames] When true, the file is stored even if a document of the same name already exists in the target folder (nothing is overwritten). When false (default), a 409 is returned. * @param {boolean} [autoFile] Smart filing: true asks OpenFilz to choose the destination folder of the uploaded file(s) after the upload (a job id comes back in autoFile.jobId); false leaves them where they are; absent = the user\'s own switch. Needs openfilz.ai.auto-file.active. * @param {string} [parentFolderId] Target parent folder ID to store the file; if not sent or null, the file is stored at the root level * @param {string} [metadata] * @param {*} [options] Override http request option. * @throws {RequiredError} */ uploadDocument1: (file: File, allowDuplicateFileNames?: boolean, autoFile?: boolean, parentFolderId?: string, metadata?: string, options?: RawAxiosRequestConfig) => Promise; }; /** * DocumentControllerApi - functional programming interface */ export declare const DocumentControllerApiFp: (configuration?: Configuration) => { /** * Creates a new blank document (Word, Excel, PowerPoint, or Text) from a template in the specified folder. * @summary Create a blank document from template * @param {CreateBlankDocumentRequest} createBlankDocumentRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ createBlankDocument(createBlankDocumentRequest: CreateBlankDocumentRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>; /** * Deletes specified metadata keys from a document. * @summary Delete specific metadata keys * @param {string} documentId * @param {DeleteMetadataRequest} deleteMetadataRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteDocumentMetadata(documentId: string, deleteMetadataRequest: DeleteMetadataRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>; /** * Downloads a single file document. * @summary Download a document * @param {string} documentId * @param {*} [options] Override http request option. * @throws {RequiredError} */ downloadDocument(documentId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>; /** * Internal endpoint for OnlyOffice DocumentServer to fetch document content. Uses token-based authentication. * @summary Download document for OnlyOffice * @param {string} documentId * @param {string} token * @param {string} [versionId] * @param {*} [options] Override http request option. * @throws {RequiredError} */ downloadForOnlyOffice(documentId: string, token: string, versionId?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>; /** * Downloads multiple documents as a single ZIP file. * @summary Download multiple documents as ZIP * @param {Array} requestBody * @param {*} [options] Override http request option. * @throws {RequiredError} */ downloadMultipleDocumentsAsZip(requestBody: Array, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>; /** * Retrieves all ancestor folders (parent path) of a document, ordered from root to immediate parent. * @summary Get document ancestors * @param {string} documentId * @param {*} [options] Override http request option. * @throws {RequiredError} */ getDocumentAncestors(documentId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>>; /** * Retrieves information for a document. * @summary Get information of a document * @param {string} documentId * @param {boolean} [withMetadata] if false : only name, type and parentId are sent (when not null) - if true : metadata and size are added in the response * @param {*} [options] Override http request option. * @throws {RequiredError} */ getDocumentInfo(documentId: string, withMetadata?: boolean, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>; /** * Append-only history of what this document\'s content hashed to, newest first. Unlike the sha256 in metadata, these entries cannot be modified or deleted — a database trigger refuses UPDATE and DELETE on the table. Empty for documents uploaded before the ledger existed, or when openfilz.calculate-checksum is off. * @summary Get a document\'s integrity ledger * @param {string} documentId * @param {*} [options] Override http request option. * @throws {RequiredError} */ getDocumentIntegrity(documentId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>>; /** * Retrieves metadata for a document. Can filter by keys. * @summary Search metadata of a document * @param {string} documentId * @param {SearchMetadataRequest} [searchMetadataRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getDocumentMetadata(documentId: string, searchMetadataRequest?: SearchMetadataRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<{ [key: string]: any; }>>; /** * Retrieves the position of a document within its parent folder, useful for pagination. * @summary Get document position in folder * @param {string} documentId * @param {string} [sortBy] Field to sort by (name, updated_at, created_at, size, type). Defaults to \'name\'. * @param {string} [sortOrder] Sort order (ASC or DESC). Defaults to \'ASC\'. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getDocumentPosition(documentId: string, sortBy?: string, sortOrder?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>; /** * Replaces the content of an existing file document. * @summary Replace document content * @param {string} documentId * @param {File} file * @param {*} [options] Override http request option. * @throws {RequiredError} */ replaceDocumentContent(documentId: string, file: File, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>; /** * Replaces all metadata of a document (file or folder). * @summary Replace document metadata * @param {string} documentId * @param {{ [key: string]: any; }} requestBody New metadata map. Replaces all existing metadata. * @param {*} [options] Override http request option. * @throws {RequiredError} */ replaceDocumentMetadata(documentId: string, requestBody: { [key: string]: any; }, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>; /** * Finds document IDs matching all provided metadata criteria. * @summary Search document IDs by metadata * @param {SearchByMetadataRequest} searchByMetadataRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ searchDocumentIdsByMetadata(searchByMetadataRequest: SearchByMetadataRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>>; /** * Updates or adds specific metadata fields for a document. * @summary Update document metadata * @param {string} documentId * @param {UpdateMetadataRequest} updateMetadataRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateDocumentMetadata(documentId: string, updateMetadataRequest: UpdateMetadataRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>; /** * Uploads multiple files, optionally with metadata and a parent folder ID. Returns HTTP 200 if all uploads succeed, HTTP 207 (Multi-Status) if some succeed and some fail, or an appropriate error status (404, 409, 403, 500) if all uploads fail. * @summary Upload multiple documents * @param {Array} file * @param {boolean} [allowDuplicateFileNames] When true, the file is stored even if a document of the same name already exists in the target folder (nothing is overwritten). When false (default), a 409 is returned. * @param {boolean} [autoFile] Smart filing: true asks OpenFilz to choose the destination folder of the uploaded file(s) after the upload (a job id comes back in autoFile.jobId); false leaves them where they are; absent = the user\'s own switch. Needs openfilz.ai.auto-file.active. * @param {string} [parametersByFilename] Paste the JSON array here<br>This array provides optional metadata and attributes for the uploaded files<br><section> <h3>Each object in the array must contain:</h3> <table> <thead> <tr> <th>Field</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>filename</code></td> <td><code>String</code></td> <td>Must match the filename of one of the uploaded files. Filenames must be unique in the upload request.</td> </tr> <tr> <td><code>fileAttributes</code></td> <td><code>JSON Object</code></td> <td>Container for metadata and other file-specific attributes.</td> </tr> </tbody> </table> <h4>Inside <code>fileAttributes</code>:</h4> <table> <thead> <tr> <th>Field</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>parentFolderId</code></td> <td><code>UUID</code></td> <td>UUID of the target folder to upload the file (if not provided : the file will be uploaded at the root level)</td> </tr> <tr> <td><code>metadata</code></td> <td><code>Map&lt;String, JSON Object&gt;</code></td> <td>Arbitrary metadata to associate with the file (key/value pairs).</td> </tr> </tbody> </table> <h4>Example of <code>parametersByFilename</code> JSON array :</h4> <pre><code>[ { \\\"filename\\\": \\\"file1.txt\\\", \\\"fileAttributes\\\": { \\\"parentFolderId\\\": \\\"f8c3de3d-1fea-4d7c-a8b0-29f63c4c3454\\\", \\\"metadata\\\": { \\\"country\\\": \\\"UK\\\", \\\"owner\\\": { \\\"name\\\": \\\"Joe\\\", \\\"owner_id\\\": 1234568 } } } }, { \\\"filename\\\": \\\"file2.md\\\", \\\"fileAttributes\\\": { \\\"metadata\\\": { \\\"key1\\\": \\\"value1\\\", \\\"key2\\\": \\\"value2\\\", \\\"key3\\\": \\\"value3\\\" } } } ]</code></pre> </section> * @param {*} [options] Override http request option. * @throws {RequiredError} */ uploadDocument(file: Array, allowDuplicateFileNames?: boolean, autoFile?: boolean, parametersByFilename?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>>; /** * Uploads a single file, optionally with metadata and a parent folder ID. * @summary Upload a single document * @param {File} file * @param {boolean} [allowDuplicateFileNames] When true, the file is stored even if a document of the same name already exists in the target folder (nothing is overwritten). When false (default), a 409 is returned. * @param {boolean} [autoFile] Smart filing: true asks OpenFilz to choose the destination folder of the uploaded file(s) after the upload (a job id comes back in autoFile.jobId); false leaves them where they are; absent = the user\'s own switch. Needs openfilz.ai.auto-file.active. * @param {string} [parentFolderId] Target parent folder ID to store the file; if not sent or null, the file is stored at the root level * @param {string} [metadata] * @param {*} [options] Override http request option. * @throws {RequiredError} */ uploadDocument1(file: File, allowDuplicateFileNames?: boolean, autoFile?: boolean, parentFolderId?: string, metadata?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>; }; /** * DocumentControllerApi - factory interface */ export declare const DocumentControllerApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => { /** * Creates a new blank document (Word, Excel, PowerPoint, or Text) from a template in the specified folder. * @summary Create a blank document from template * @param {CreateBlankDocumentRequest} createBlankDocumentRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ createBlankDocument(createBlankDocumentRequest: CreateBlankDocumentRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** * Deletes specified metadata keys from a document. * @summary Delete specific metadata keys * @param {string} documentId * @param {DeleteMetadataRequest} deleteMetadataRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteDocumentMetadata(documentId: string, deleteMetadataRequest: DeleteMetadataRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** * Downloads a single file document. * @summary Download a document * @param {string} documentId * @param {*} [options] Override http request option. * @throws {RequiredError} */ downloadDocument(documentId: string, options?: RawAxiosRequestConfig): AxiosPromise; /** * Internal endpoint for OnlyOffice DocumentServer to fetch document content. Uses token-based authentication. * @summary Download document for OnlyOffice * @param {string} documentId * @param {string} token * @param {string} [versionId] * @param {*} [options] Override http request option. * @throws {RequiredError} */ downloadForOnlyOffice(documentId: string, token: string, versionId?: string, options?: RawAxiosRequestConfig): AxiosPromise; /** * Downloads multiple documents as a single ZIP file. * @summary Download multiple documents as ZIP * @param {Array} requestBody * @param {*} [options] Override http request option. * @throws {RequiredError} */ downloadMultipleDocumentsAsZip(requestBody: Array, options?: RawAxiosRequestConfig): AxiosPromise; /** * Retrieves all ancestor folders (parent path) of a document, ordered from root to immediate parent. * @summary Get document ancestors * @param {string} documentId * @param {*} [options] Override http request option. * @throws {RequiredError} */ getDocumentAncestors(documentId: string, options?: RawAxiosRequestConfig): AxiosPromise>; /** * Retrieves information for a document. * @summary Get information of a document * @param {string} documentId * @param {boolean} [withMetadata] if false : only name, type and parentId are sent (when not null) - if true : metadata and size are added in the response * @param {*} [options] Override http request option. * @throws {RequiredError} */ getDocumentInfo(documentId: string, withMetadata?: boolean, options?: RawAxiosRequestConfig): AxiosPromise; /** * Append-only history of what this document\'s content hashed to, newest first. Unlike the sha256 in metadata, these entries cannot be modified or deleted — a database trigger refuses UPDATE and DELETE on the table. Empty for documents uploaded before the ledger existed, or when openfilz.calculate-checksum is off. * @summary Get a document\'s integrity ledger * @param {string} documentId * @param {*} [options] Override http request option. * @throws {RequiredError} */ getDocumentIntegrity(documentId: string, options?: RawAxiosRequestConfig): AxiosPromise>; /** * Retrieves metadata for a document. Can filter by keys. * @summary Search metadata of a document * @param {string} documentId * @param {SearchMetadataRequest} [searchMetadataRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getDocumentMetadata(documentId: string, searchMetadataRequest?: SearchMetadataRequest, options?: RawAxiosRequestConfig): AxiosPromise<{ [key: string]: any; }>; /** * Retrieves the position of a document within its parent folder, useful for pagination. * @summary Get document position in folder * @param {string} documentId * @param {string} [sortBy] Field to sort by (name, updated_at, created_at, size, type). Defaults to \'name\'. * @param {string} [sortOrder] Sort order (ASC or DESC). Defaults to \'ASC\'. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getDocumentPosition(documentId: string, sortBy?: string, sortOrder?: string, options?: RawAxiosRequestConfig): AxiosPromise; /** * Replaces the content of an existing file document. * @summary Replace document content * @param {string} documentId * @param {File} file * @param {*} [options] Override http request option. * @throws {RequiredError} */ replaceDocumentContent(documentId: string, file: File, options?: RawAxiosRequestConfig): AxiosPromise; /** * Replaces all metadata of a document (file or folder). * @summary Replace document metadata * @param {string} documentId * @param {{ [key: string]: any; }} requestBody New metadata map. Replaces all existing metadata. * @param {*} [options] Override http request option. * @throws {RequiredError} */ replaceDocumentMetadata(documentId: string, requestBody: { [key: string]: any; }, options?: RawAxiosRequestConfig): AxiosPromise; /** * Finds document IDs matching all provided metadata criteria. * @summary Search document IDs by metadata * @param {SearchByMetadataRequest} searchByMetadataRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ searchDocumentIdsByMetadata(searchByMetadataRequest: SearchByMetadataRequest, options?: RawAxiosRequestConfig): AxiosPromise>; /** * Updates or adds specific metadata fields for a document. * @summary Update document metadata * @param {string} documentId * @param {UpdateMetadataRequest} updateMetadataRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateDocumentMetadata(documentId: string, updateMetadataRequest: UpdateMetadataRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** * Uploads multiple files, optionally with metadata and a parent folder ID. Returns HTTP 200 if all uploads succeed, HTTP 207 (Multi-Status) if some succeed and some fail, or an appropriate error status (404, 409, 403, 500) if all uploads fail. * @summary Upload multiple documents * @param {Array} file * @param {boolean} [allowDuplicateFileNames] When true, the file is stored even if a document of the same name already exists in the target folder (nothing is overwritten). When false (default), a 409 is returned. * @param {boolean} [autoFile] Smart filing: true asks OpenFilz to choose the destination folder of the uploaded file(s) after the upload (a job id comes back in autoFile.jobId); false leaves them where they are; absent = the user\'s own switch. Needs openfilz.ai.auto-file.active. * @param {string} [parametersByFilename] Paste the JSON array here<br>This array provides optional metadata and attributes for the uploaded files<br><section> <h3>Each object in the array must contain:</h3> <table> <thead> <tr> <th>Field</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>filename</code></td> <td><code>String</code></td> <td>Must match the filename of one of the uploaded files. Filenames must be unique in the upload request.</td> </tr> <tr> <td><code>fileAttributes</code></td> <td><code>JSON Object</code></td> <td>Container for metadata and other file-specific attributes.</td> </tr> </tbody> </table> <h4>Inside <code>fileAttributes</code>:</h4> <table> <thead> <tr> <th>Field</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>parentFolderId</code></td> <td><code>UUID</code></td> <td>UUID of the target folder to upload the file (if not provided : the file will be uploaded at the root level)</td> </tr> <tr> <td><code>metadata</code></td> <td><code>Map&lt;String, JSON Object&gt;</code></td> <td>Arbitrary metadata to associate with the file (key/value pairs).</td> </tr> </tbody> </table> <h4>Example of <code>parametersByFilename</code> JSON array :</h4> <pre><code>[ { \\\"filename\\\": \\\"file1.txt\\\", \\\"fileAttributes\\\": { \\\"parentFolderId\\\": \\\"f8c3de3d-1fea-4d7c-a8b0-29f63c4c3454\\\", \\\"metadata\\\": { \\\"country\\\": \\\"UK\\\", \\\"owner\\\": { \\\"name\\\": \\\"Joe\\\", \\\"owner_id\\\": 1234568 } } } }, { \\\"filename\\\": \\\"file2.md\\\", \\\"fileAttributes\\\": { \\\"metadata\\\": { \\\"key1\\\": \\\"value1\\\", \\\"key2\\\": \\\"value2\\\", \\\"key3\\\": \\\"value3\\\" } } } ]</code></pre> </section> * @param {*} [options] Override http request option. * @throws {RequiredError} */ uploadDocument(file: Array, allowDuplicateFileNames?: boolean, autoFile?: boolean, parametersByFilename?: string, options?: RawAxiosRequestConfig): AxiosPromise>; /** * Uploads a single file, optionally with metadata and a parent folder ID. * @summary Upload a single document * @param {File} file * @param {boolean} [allowDuplicateFileNames] When true, the file is stored even if a document of the same name already exists in the target folder (nothing is overwritten). When false (default), a 409 is returned. * @param {boolean} [autoFile] Smart filing: true asks OpenFilz to choose the destination folder of the uploaded file(s) after the upload (a job id comes back in autoFile.jobId); false leaves them where they are; absent = the user\'s own switch. Needs openfilz.ai.auto-file.active. * @param {string} [parentFolderId] Target parent folder ID to store the file; if not sent or null, the file is stored at the root level * @param {string} [metadata] * @param {*} [options] Override http request option. * @throws {RequiredError} */ uploadDocument1(file: File, allowDuplicateFileNames?: boolean, autoFile?: boolean, parentFolderId?: string, metadata?: string, options?: RawAxiosRequestConfig): AxiosPromise; }; /** * DocumentControllerApi - object-oriented interface */ export declare class DocumentControllerApi extends BaseAPI { /** * Creates a new blank document (Word, Excel, PowerPoint, or Text) from a template in the specified folder. * @summary Create a blank document from template * @param {CreateBlankDocumentRequest} createBlankDocumentRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ createBlankDocument(createBlankDocumentRequest: CreateBlankDocumentRequest, options?: RawAxiosRequestConfig): Promise>; /** * Deletes specified metadata keys from a document. * @summary Delete specific metadata keys * @param {string} documentId * @param {DeleteMetadataRequest} deleteMetadataRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteDocumentMetadata(documentId: string, deleteMetadataRequest: DeleteMetadataRequest, options?: RawAxiosRequestConfig): Promise>; /** * Downloads a single file document. * @summary Download a document * @param {string} documentId * @param {*} [options] Override http request option. * @throws {RequiredError} */ downloadDocument(documentId: string, options?: RawAxiosRequestConfig): Promise>; /** * Internal endpoint for OnlyOffice DocumentServer to fetch document content. Uses token-based authentication. * @summary Download document for OnlyOffice * @param {string} documentId * @param {string} token * @param {string} [versionId] * @param {*} [options] Override http request option. * @throws {RequiredError} */ downloadForOnlyOffice(documentId: string, token: string, versionId?: string, options?: RawAxiosRequestConfig): Promise>; /** * Downloads multiple documents as a single ZIP file. * @summary Download multiple documents as ZIP * @param {Array} requestBody * @param {*} [options] Override http request option. * @throws {RequiredError} */ downloadMultipleDocumentsAsZip(requestBody: Array, options?: RawAxiosRequestConfig): Promise>; /** * Retrieves all ancestor folders (parent path) of a document, ordered from root to immediate parent. * @summary Get document ancestors * @param {string} documentId * @param {*} [options] Override http request option. * @throws {RequiredError} */ getDocumentAncestors(documentId: string, options?: RawAxiosRequestConfig): Promise>; /** * Retrieves information for a document. * @summary Get information of a document * @param {string} documentId * @param {boolean} [withMetadata] if false : only name, type and parentId are sent (when not null) - if true : metadata and size are added in the response * @param {*} [options] Override http request option. * @throws {RequiredError} */ getDocumentInfo(documentId: string, withMetadata?: boolean, options?: RawAxiosRequestConfig): Promise>; /** * Append-only history of what this document\'s content hashed to, newest first. Unlike the sha256 in metadata, these entries cannot be modified or deleted — a database trigger refuses UPDATE and DELETE on the table. Empty for documents uploaded before the ledger existed, or when openfilz.calculate-checksum is off. * @summary Get a document\'s integrity ledger * @param {string} documentId * @param {*} [options] Override http request option. * @throws {RequiredError} */ getDocumentIntegrity(documentId: string, options?: RawAxiosRequestConfig): Promise>; /** * Retrieves metadata for a document. Can filter by keys. * @summary Search metadata of a document * @param {string} documentId * @param {SearchMetadataRequest} [searchMetadataRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getDocumentMetadata(documentId: string, searchMetadataRequest?: SearchMetadataRequest, options?: RawAxiosRequestConfig): Promise>; /** * Retrieves the position of a document within its parent folder, useful for pagination. * @summary Get document position in folder * @param {string} documentId * @param {string} [sortBy] Field to sort by (name, updated_at, created_at, size, type). Defaults to \'name\'. * @param {string} [sortOrder] Sort order (ASC or DESC). Defaults to \'ASC\'. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getDocumentPosition(documentId: string, sortBy?: string, sortOrder?: string, options?: RawAxiosRequestConfig): Promise>; /** * Replaces the content of an existing file document. * @summary Replace document content * @param {string} documentId * @param {File} file * @param {*} [options] Override http request option. * @throws {RequiredError} */ replaceDocumentContent(documentId: string, file: File, options?: RawAxiosRequestConfig): Promise>; /** * Replaces all metadata of a document (file or folder). * @summary Replace document metadata * @param {string} documentId * @param {{ [key: string]: any; }} requestBody New metadata map. Replaces all existing metadata. * @param {*} [options] Override http request option. * @throws {RequiredError} */ replaceDocumentMetadata(documentId: string, requestBody: { [key: string]: any; }, options?: RawAxiosRequestConfig): Promise>; /** * Finds document IDs matching all provided metadata criteria. * @summary Search document IDs by metadata * @param {SearchByMetadataRequest} searchByMetadataRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ searchDocumentIdsByMetadata(searchByMetadataRequest: SearchByMetadataRequest, options?: RawAxiosRequestConfig): Promise>; /** * Updates or adds specific metadata fields for a document. * @summary Update document metadata * @param {string} documentId * @param {UpdateMetadataRequest} updateMetadataRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateDocumentMetadata(documentId: string, updateMetadataRequest: UpdateMetadataRequest, options?: RawAxiosRequestConfig): Promise>; /** * Uploads multiple files, optionally with metadata and a parent folder ID. Returns HTTP 200 if all uploads succeed, HTTP 207 (Multi-Status) if some succeed and some fail, or an appropriate error status (404, 409, 403, 500) if all uploads fail. * @summary Upload multiple documents * @param {Array} file * @param {boolean} [allowDuplicateFileNames] When true, the file is stored even if a document of the same name already exists in the target folder (nothing is overwritten). When false (default), a 409 is returned. * @param {boolean} [autoFile] Smart filing: true asks OpenFilz to choose the destination folder of the uploaded file(s) after the upload (a job id comes back in autoFile.jobId); false leaves them where they are; absent = the user\'s own switch. Needs openfilz.ai.auto-file.active. * @param {string} [parametersByFilename] Paste the JSON array here<br>This array provides optional metadata and attributes for the uploaded files<br><section> <h3>Each object in the array must contain:</h3> <table> <thead> <tr> <th>Field</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>filename</code></td> <td><code>String</code></td> <td>Must match the filename of one of the uploaded files. Filenames must be unique in the upload request.</td> </tr> <tr> <td><code>fileAttributes</code></td> <td><code>JSON Object</code></td> <td>Container for metadata and other file-specific attributes.</td> </tr> </tbody> </table> <h4>Inside <code>fileAttributes</code>:</h4> <table> <thead> <tr> <th>Field</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>parentFolderId</code></td> <td><code>UUID</code></td> <td>UUID of the target folder to upload the file (if not provided : the file will be uploaded at the root level)</td> </tr> <tr> <td><code>metadata</code></td> <td><code>Map&lt;String, JSON Object&gt;</code></td> <td>Arbitrary metadata to associate with the file (key/value pairs).</td> </tr> </tbody> </table> <h4>Example of <code>parametersByFilename</code> JSON array :</h4> <pre><code>[ { \\\"filename\\\": \\\"file1.txt\\\", \\\"fileAttributes\\\": { \\\"parentFolderId\\\": \\\"f8c3de3d-1fea-4d7c-a8b0-29f63c4c3454\\\", \\\"metadata\\\": { \\\"country\\\": \\\"UK\\\", \\\"owner\\\": { \\\"name\\\": \\\"Joe\\\", \\\"owner_id\\\": 1234568 } } } }, { \\\"filename\\\": \\\"file2.md\\\", \\\"fileAttributes\\\": { \\\"metadata\\\": { \\\"key1\\\": \\\"value1\\\", \\\"key2\\\": \\\"value2\\\", \\\"key3\\\": \\\"value3\\\" } } } ]</code></pre> </section> * @param {*} [options] Override http request option. * @throws {RequiredError} */ uploadDocument(file: Array, allowDuplicateFileNames?: boolean, autoFile?: boolean, parametersByFilename?: string, options?: RawAxiosRequestConfig): Promise>; /** * Uploads a single file, optionally with metadata and a parent folder ID. * @summary Upload a single document * @param {File} file * @param {boolean} [allowDuplicateFileNames] When true, the file is stored even if a document of the same name already exists in the target folder (nothing is overwritten). When false (default), a 409 is returned. * @param {boolean} [autoFile] Smart filing: true asks OpenFilz to choose the destination folder of the uploaded file(s) after the upload (a job id comes back in autoFile.jobId); false leaves them where they are; absent = the user\'s own switch. Needs openfilz.ai.auto-file.active. * @param {string} [parentFolderId] Target parent folder ID to store the file; if not sent or null, the file is stored at the root level * @param {string} [metadata] * @param {*} [options] Override http request option. * @throws {RequiredError} */ uploadDocument1(file: File, allowDuplicateFileNames?: boolean, autoFile?: boolean, parentFolderId?: string, metadata?: string, options?: RawAxiosRequestConfig): Promise>; }