notify flows: GET returns a schema of the events, fields, node kinds and limits
This commit is contained in:
parent
627964f72d
commit
d5802d16a0
5 changed files with 281 additions and 26 deletions
|
|
@ -89,6 +89,22 @@ document, and gets 409 when the stored revision is another. Swarm UI's
|
|||
[`/notifications`](ui.md#notification-flows) page shows the document and
|
||||
switches built-ins.
|
||||
|
||||
**The schema.** `GET /api/notify/flows` also returns a `schema` object, built
|
||||
from the constants the check reads, so an editor offers only what a `PUT`
|
||||
accepts:
|
||||
|
||||
- `source_events`: `[{name, description}]`, the source events.
|
||||
- `fields`: `[{name, description}]`, the condition and recipient fields, and
|
||||
the `{field}` placeholders.
|
||||
- `node_kinds`: `[{kind, description, fields}]` for `source`, `match` and
|
||||
`todo`; each field is `{name, description, required, values}`, and `values`
|
||||
lists the accepted `{name, description}` pairs (the `upsert` and `clear` of a
|
||||
todo's `op`), empty for other fields.
|
||||
- `limits`: `{max_nodes, max_depth, max_flows}`.
|
||||
|
||||
A controller that predates `schema` leaves it out of the answer; a client reads
|
||||
it as optional.
|
||||
|
||||
**What the router runs.** It reads the key at most every 10 seconds, when an
|
||||
event arrives, and runs the built-ins you left on, then the custom flows that
|
||||
are on and pass the tree check. It logs a custom flow that fails the check,
|
||||
|
|
|
|||
Loading…
Reference in a new issue