Automation definitions: validation, storage and the wire shape.
An automation joins triggers, one prompt, one target and delivery options. The runner owns execution; this namespace never starts a turn. Definitions keep the contract spelling: string keys in snake_case.
Automation definitions: validation, storage and the wire shape. An automation joins triggers, one prompt, one target and delivery options. The runner owns execution; this namespace never starts a turn. Definitions keep the contract spelling: string keys in snake_case.
(->wire {:keys [id definition created_at updated_at webhook_secret
callback_secret]
:as row}
last-run
now)The contract shape of one stored automation. Secrets never appear.
The contract shape of one stored automation. Secrets never appear.
(describe db id now)The wire shape of one automation, or a 404 ex-info.
The wire shape of one automation, or a 404 ex-info.
(limit k)One value of the contract x-vis-limits.
One value of the contract `x-vis-limits`.
(new-secret)A Standard Webhooks secret: whsec_ and 32 random bytes in base64.
A Standard Webhooks secret: `whsec_` and 32 random bytes in base64.
(next-fire trigger anchor from)The first fire time of one schedule trigger strictly after from, or nil.
anchor is the start of an interval schedule.
The first fire time of one schedule trigger strictly after `from`, or nil. `anchor` is the start of an interval schedule.
(next-run-at {:keys [definition created_at]} now)The next scheduled fire time of an enabled automation after now, or nil.
The next scheduled fire time of an enabled automation after `now`, or nil.
(normalize definition)Fill the optional fields of a valid input with their defaults.
Fill the optional fields of a valid input with their defaults.
(rotate-secret! db id kind now)Create or replace one secret and answer it once.
Create or replace one secret and answer it once.
(run-filter {:strs [automation_id status session_id limit]})The run filter of the wire parameters automation_id, status, session_id
and limit. limit defaults to 50 and stays between 1 and 200.
The run filter of the wire parameters `automation_id`, `status`, `session_id` and `limit`. `limit` defaults to 50 and stays between 1 and 200.
(runs db opts)Runs newest first, with the automation names.
Runs newest first, with the automation names.
(update! db id patch now)Replace the given top-level fields and validate the result as a whole.
Replace the given top-level fields and validate the result as a whole.
(validate definition now)Check one complete definition; answer it with defaults. Throws ex-info with
:status 400 and a readable message.
Check one complete definition; answer it with defaults. Throws ex-info with `:status 400` and a readable message.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |