1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! Engine-level `{{ expr }}` expression resolution for pipeline node configs.
//!
//! Every string field in a node's `config` object may contain `{{ js_expr }}` placeholders.
//! Before a node executes, the pipeline engine resolves all such expressions in one Deno
//! sandbox trip — giving every node access to `$input`, `$trigger`, and `$nodes`
//! without any per-node implementation required.
//!
//! # Quick reference
//!
//! | Variable | What you get |
//! |------------------|---------------------------------------------------------|
//! | `$input` | The current payload flowing into this node |
//! | `$input.field` | Specific field from upstream output |
//! | `$trigger.body` | The envelope's fields as they arrived (manual or webhook) |
//! | `$trigger.files` | The envelope's FileRefs as they arrived |
//! | `$trigger.auth` | Verified JWT claims from the original request |
//! | `$trigger.params`| URL path params (`:id`, `:slug`, etc.) |
//! | `$trigger.query` | Query string params (`?page=2` etc.) |
//! | `$nodes.id` | Output of a completed upstream node by its graph ID |
//! | `$nodes.id.field`| Specific field from that node's output |
//! # Examples
//!
//! Whole-field expression (preserves native type):
//! ```text
//! --params-expr "{{ [$trigger.auth.sub] }}"
//! --url "{{ $input.endpoint }}"
//! ```
//!
//! Interpolated expression (result stringified):
//! ```text
//! --url "https://api.example.com/users/{{ $trigger.auth.sub }}/profile"
//! ```
//!
//! Accessing previous node output:
//! ```text
//! --url "{{ $nodes.userLookup.rows[0].api_endpoint }}"
//! ```
pub use ;