Mache große IMAP-Fächer, die Paperless-Suche und die interne Markdown-Notiz über die gemeinsamen Schnittstellen benutzbar.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
c3a07cee64
commit
7e39fbb2bd
29 files changed
+6053
-320
No files matched your search
@@ -1,7 +1,7 @@
|
||||
"""Declared source and editor capabilities.
|
||||
|
||||
A common contract does not invent abilities the adapter does not have.
|
||||
Search filters that are false stay unavailable until a later delivery.
|
||||
A filter is offered only when that module implements it.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
@@ -16,13 +16,13 @@ PAPERLESS_CAPABILITIES = {
|
||||
"edit_metadata": False,
|
||||
"search": {
|
||||
"query": True,
|
||||
"title": False,
|
||||
"correspondent": False,
|
||||
"document_type": False,
|
||||
"tags": False,
|
||||
"document_range": False,
|
||||
"sort": False,
|
||||
"continuation": False,
|
||||
"title": True,
|
||||
"correspondent": True,
|
||||
"document_type": True,
|
||||
"tags": True,
|
||||
"document_range": True,
|
||||
"sort": True,
|
||||
"continuation": True,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -94,5 +94,9 @@ def with_capabilities(kind: str, connector_id: str, payload: dict) -> dict:
|
||||
body["connector_id"] = connector_id
|
||||
body["capabilities"] = spec
|
||||
body["unsupported"] = [name for name, enabled in spec["search"].items() if not enabled]
|
||||
body["continuation"] = body.get("next_before") if spec["search"].get("continuation") else None
|
||||
if spec["search"].get("continuation"):
|
||||
body["continuation"] = body.get("next_before") if body.get("next_before") is not None else body.get("next_page")
|
||||
else:
|
||||
body["continuation"] = None
|
||||
body["incomplete"] = bool(body.get("incomplete"))
|
||||
return body
|
||||
Reference in new issue
Block a user