WeKnora/internal/datasource/connector/ima
wizardchen 8d5540e26d feat(datasource/ima): sync IMA notes via the note OpenAPI
Notes (media_type=11) were skipped as "unsupported by wiki OpenAPI". The wiki
namespace indeed never exposes a note body, but IMA reads it from a second
namespace: get_media_info reports a notebook_id, which
/openapi/note/v1/get_doc_content turns into the note text. The connector
already parsed that notebook_id into item metadata and then dropped the
record, so this wires up the one call that was missing.

Note bodies arrive as plain text and are ingested as Markdown, since IMA notes
are authored as rich text and the export keeps its heading and list markers.
An unreadable note now takes the same retry path as a failed download instead
of being recorded as synced; empty notes are skipped.

AI sessions (12) and video parses (16) stay skipped, as those genuinely have
no read endpoint, and the connector description now names them specifically
rather than implying notes are unsupported.

Also accept the {retcode, errmsg} spelling of the response envelope alongside
{code, msg}. The reference MCP implementation confirms {code, msg} is correct,
but several published IMA references disagree, and under the wrong spelling
the status code would decode as 0 and turn every API error into a silent
success.
2026-08-12 14:56:25 +08:00
..
client.go feat(datasource/ima): sync IMA notes via the note OpenAPI 2026-08-12 14:56:25 +08:00
connector.go feat(datasource/ima): sync IMA notes via the note OpenAPI 2026-08-12 14:56:25 +08:00
connector_test.go feat(datasource/ima): sync IMA notes via the note OpenAPI 2026-08-12 14:56:25 +08:00
fake_ima_test.go feat(datasource/ima): sync IMA notes via the note OpenAPI 2026-08-12 14:56:25 +08:00
types.go feat(datasource/ima): sync IMA notes via the note OpenAPI 2026-08-12 14:56:25 +08:00
types_test.go feat(datasource/ima): sync IMA notes via the note OpenAPI 2026-08-12 14:56:25 +08:00