@baruchiro/paperless-mcp
Version:
Model Context Protocol (MCP) server for interacting with Paperless-NGX document management system. Enables AI assistants to manage documents, tags, correspondents, and document types through the Paperless-NGX API.
12 lines (11 loc) • 918 B
TypeScript
import { PaperlessAPI } from "../../api/PaperlessAPI";
import { CustomField, CustomFieldInstanceRequest, CustomFieldValue } from "../../api/types";
/**
* Encoding Paperless expects for a select value: `update_document` takes the
* option index; `bulk_edit` writes `value_select` directly so it needs the
* stored form (option id on 2.17+, index on pre-2.17 string options).
*/
export type SelectValueEncoding = "index" | "stored";
/** Translates a select value (label, option id, or index) to the `encoding` Paperless expects; throws on no match. */
export declare function resolveSelectCustomFieldValue(field: CustomField, value: CustomFieldValue, encoding?: SelectValueEncoding): CustomFieldValue;
export declare function resolveSelectCustomFieldValues(api: PaperlessAPI, customFields: CustomFieldInstanceRequest[] | undefined, encoding?: SelectValueEncoding): Promise<CustomFieldInstanceRequest[] | undefined>;