$ show czottmann/obsidian-actions-uri
This is an Obsidian plugin that extends the built-in `obsidian://` URI scheme with additional `x-callback-url` endpoints for automation. It provides a modular routing system with endpoints for notes (CRUD, append/prepend, search/replace, touch), files, folders, vault info, commands, search, Dataview queries, Omnisearch, tags, and note properties. The architecture is modular: each route is defined in its own file under `src/routes/`, with Zod schemas for parameter validation and handler functions that return standardized success/failure objects. The main entry point is `src/main.ts`, which registers URI handlers and manages plugin lifecycle. Incoming URIs are matched to routes, parameters are validated and transformed (e.g., resolving file paths, UIDs, periodic notes), and the handler executes the requested action, sending callbacks via `x-success`/`x-error` URLs. External dependencies include the Obsidian API, Zod, `obsidian-daily-notes-interface`, `obsidian-dataview`, and `filter-obj`. The plugin also relies on third-party plugins (Templater, Periodic Notes, Dataview, Omnisearch) for certain routes. The codebase is well-structured with TypeScript, esbuild bundling, Jest E2E tests using a custom callback server, and comprehensive documentation.
The LLM identified 4 files worth highlighting for reuse:
Defines custom Zod schemas for file paths, JSON properties, and template paths. These schemas are used across multiple routes to validate and transform incoming parameters. The pattern is self-contained and could be extracted to validate URI parameters in any Obsidian plugin or similar application.
Implements functions to send x-callback-url success and error responses. It handles URL construction, debug-mode logging, and optional UI notice suppression. This is a clean, isolated pattern that could be reused in any plugin or app that uses the x-callback-url protocol.
Provides standardized success and failure response objects (`ResultObject`, `ErrorObject`) with fixed error codes. All route handlers use these to return consistent results. The pattern is self-contained and could be extracted to enforce uniform API responses in any project.
A lightweight HTTP server that listens for x-callback-url callbacks during E2E tests. It captures success/error responses and makes them available for assertions. This is a reusable test utility for any plugin or application that uses x-callback-urls, and demonstrates a clean pattern for testing URI-based workflows.