Expand description
Template CRUD routes: GET /api/templates, GET /api/templates/{name},
POST /api/templates, PUT /api/templates/{name}, DELETE /api/templates/{name}.
Mirrors bhtune-cli’s commands::template behavior exactly (see import_one there):
validate, then check for a name collision, then insert. HTTP-created templates are
always TemplateOrigin::User – the same origin the CLI’s single-template import
path assigns, as opposed to the auto-loaded Builtin/Catalog origins, which only ever
come from the embedded catalog or a user catalog file, never from this endpoint. PUT
is likewise restricted to User-origin rows – see update_template’s doc comment.
Structs§
- Template
Response - The HTTP-facing shape of a stored template: the caller-supplied
DcsTemplatefields flattened alongside the database-assignedid/origin/timestamps. Per this workspace’s established DTO-decoupling convention (seebhtune-cli’scommands::historymodule doc comments),DcsTemplateRowitself deliberately does not deriveSerialize– every JSON-facing consumer builds its own projection rather than the DB row shape leaking straight onto the wire.