@protobase/cli 0.100.24 → 0.100.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@protobase/cli",
|
|
3
|
-
"version": "0.100.
|
|
3
|
+
"version": "0.100.25",
|
|
4
4
|
"description": "The protobase command: scaffold, doctor, dev, build and serve a Protobase project.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -43,13 +43,13 @@
|
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@better-auth/core": "^1.7.12",
|
|
45
45
|
"@hono/node-server": "^2.1.3",
|
|
46
|
-
"@protobase/config": "0.100.
|
|
47
|
-
"@protobase/layout": "0.100.
|
|
48
|
-
"@protobase/query": "0.100.
|
|
49
|
-
"@protobase/schema": "0.100.
|
|
50
|
-
"@protobase/server": "0.100.
|
|
51
|
-
"@protobase/ui": "0.100.
|
|
52
|
-
"@protobase/workflows": "0.100.
|
|
46
|
+
"@protobase/config": "0.100.25",
|
|
47
|
+
"@protobase/layout": "0.100.25",
|
|
48
|
+
"@protobase/query": "0.100.25",
|
|
49
|
+
"@protobase/schema": "0.100.25",
|
|
50
|
+
"@protobase/server": "0.100.25",
|
|
51
|
+
"@protobase/ui": "0.100.25",
|
|
52
|
+
"@protobase/workflows": "0.100.25",
|
|
53
53
|
"@react-email/render": "^2.1.0",
|
|
54
54
|
"@scalar/hono-api-reference": "^0.12.10",
|
|
55
55
|
"@sentry/vite-plugin": "^11.10.0",
|
|
@@ -11,7 +11,8 @@ Graphs of steps the server runs along their edges, written in a language a model
|
|
|
11
11
|
- [One page per workflow](../reference/workflows.md#the-workflows-page) (beta): A workflow's focus page is its graph, with Add step, Test run, Runs and Publish beside it in a panel, so you build, test and debug without leaving it; in the sidebar, Workflows lists the workflows.
|
|
12
12
|
- [Pins and wires](../reference/workflows.md#the-workflows-page) (beta): A step's inputs and the values it gives are pins coloured by type; drag an output pin to an input to read that value there, and a wire that does not fit is refused, saying why.
|
|
13
13
|
- [Break and Make](../reference/workflows.md#the-workflows-page) (beta): Take an object apart into a pin for each field, such as a record's fields, or build one from a pin per field, with no extra step to run.
|
|
14
|
-
- [Condition nodes](../reference/workflows.md#the-workflows-page) (beta): In data order, build when a step runs from Equals, Not equals, Greater and
|
|
14
|
+
- [Condition nodes](../reference/workflows.md#the-workflows-page) (beta): In data order, build when a step runs from Equals, Not equals, Greater, Less and Matches, All of, Any of and Not on the graph, or drop a step's status on another step's Only when pin to run it once the first succeeded; any other condition is one Expression node, kept as you wrote it.
|
|
15
|
+
- [Select](../reference/workflows.md#the-workflows-page) (beta): Choose an argument by another value on the graph, such as a mail's address by a form's topic, a value per case and one otherwise.
|
|
15
16
|
- [Move nodes by hand](../reference/workflows.md#the-workflows-page) (beta): Drag a node of the graph where you want it; it stays there, marked, for everyone who edits the workflow, and the rest lays itself out around it until you unpin it or tidy up. Pins and Simple each keep their own places, and moving nodes makes no new version.
|
|
16
17
|
- [Pins or Simple](../reference/workflows.md#the-workflows-page) (beta): Draw the graph with every pin and wire, or with only the steps and the lines between them, and switch at any time; nothing saved changes.
|
|
17
18
|
- [Build on the graph](../reference/workflows.md#the-workflows-page) (beta): Click a step's handle to add a step right there, or drag from it to another step to connect them; the wheel and a pinch zoom the graph, and dragging pans it.
|
|
@@ -110,6 +110,7 @@ A workflow's `layout`, a field beside its definition, keeps only where nodes of
|
|
|
110
110
|
| `$trigger` | The trigger. |
|
|
111
111
|
| `Save.record` | In `pins` only: a Break of `record` in what `Save` gives; `Save.#break` one of the whole of it, `$trigger.customer` one of the run's input, and `Save.#status` one of `Save`'s status in data order. |
|
|
112
112
|
| `Save.#make.data` | In `pins` only: a Make of `Save`'s argument `data`. |
|
|
113
|
+
| `Notify.#select.to` | In `pins` only: a Select of `Notify`'s argument `to`. |
|
|
113
114
|
| `Tell.#when` | In `pins` only, in data order: the condition node wired to `Tell`'s Only when pin; `Tell.#when.1` the one at its second side, `Tell.#when.1.0` the one at that node's first. |
|
|
114
115
|
|
|
115
116
|
In a state's name or a field, `%`, `.` and a leading `#` or `$` are written `%25`, `%2E`, `%23` and `%24`, so the state `Step.1` is `Step%2E1`.
|
|
@@ -393,11 +394,12 @@ The bar under the breadcrumb holds what is live, the version shown, *Add step*,
|
|
|
393
394
|
A user who may read a workflow but not change it gets the same page, its fields and graph locked, without Save or Publish. On a mobile screen the bar holds what is live, *Runs* and *Test run*, or *Save* with unsaved changes, and the rest behind "..."; a step's form can be changed, and steps are added on a wider screen.
|
|
394
395
|
|
|
395
396
|
- **The graph lays itself out.** The trigger is on the left, each state is a box, a Map is a box around the states it runs for each item, and each edge is drawn from the field that names it: a state's `Next`, a Choice's rules (labelled with their condition) and its `Default` ("Otherwise"), and a Task's or Map's catchers ("On error", dashed). The graph is laid out in layers, from left to right, each time a state, an edge, a pin or a wire is added, removed or renamed; the document keeps no positions, so the graph a person sees is the one a model or the API wrote, and the one they edit is what a model reads back. The canvas zooms with the wheel, a pinch and its buttons, and pans by dragging the empty canvas.
|
|
396
|
-
- **Moving nodes by hand.** Dragging a node, a step, the trigger, a Break, a Make or a condition node, puts it where it is let go, as do the arrow keys on the chosen node. It stays there, marked with a pin, and the nodes not moved are laid out around it, also as steps and connections change: one the layout would put under it goes below it, and a Map or Block grows around a node moved inside it. *Pins* and *Simple* each keep their own places, so a node moved in one view stays where the layout puts it in the other. The pin's *Unpin* hands the node back to the layout, and *Tidy up*, above the graph, lays the view shown out again, forgetting every node moved in it and leaving the other view's. Where nodes were moved is the workflow's [layout](#layout), shared with everyone who edits it and saved by *Save*; it makes no new version and needs no publish. An older version opens with the layout it was saved with, which cannot be changed. <gap>A step renamed in the editor cannot keep the place it was moved to because carrying its layout key over to its new name is not implemented.</gap>
|
|
397
|
+
- **Moving nodes by hand.** Dragging a node, a step, the trigger, a Break, a Make or a condition node, puts it where it is let go, as do the arrow keys on the chosen node. Shift-click adds a node to the choice or takes it out, and Shift-drag on the empty canvas chooses every node its box covers; the nodes chosen move together, and Delete removes them all. A step's form opens only on a plain click on it, never while a choice is made with Shift or a box. It stays there, marked with a pin, and the nodes not moved are laid out around it, also as steps and connections change: one the layout would put under it goes below it, and a Map or Block grows around a node moved inside it. *Pins* and *Simple* each keep their own places, so a node moved in one view stays where the layout puts it in the other. The pin's *Unpin* hands the node back to the layout, and *Tidy up*, above the graph, lays the view shown out again, forgetting every node moved in it and leaving the other view's. Where nodes were moved is the workflow's [layout](#layout), shared with everyone who edits it and saved by *Save*; it makes no new version and needs no publish. An older version opens with the layout it was saved with, which cannot be changed. <gap>A step renamed in the editor cannot keep the place it was moved to because carrying its layout key over to its new name is not implemented.</gap>
|
|
397
398
|
- **Adding a step.** *Add step* opens a searchable picker in the panel: every step type the app can run, its plugins' included, each with what it does, then Choice, For each item, Wait, Set values, Succeed and Fail. Search finds other words too, such as *email* for Send mail. It says where the step lands, and choosing a step on the graph changes that. Clicking or tapping one of a step's handles, which grows into a plus under the pointer, opens the same picker for a step right there: at the bottom handle after the step, at a Choice's *When* as a new rule and at its *Otherwise* as its `Default`, at *On error* on the path of every error, and at the trigger's as the first step. Where the handle led to a step already, the new one goes in between and goes on to that step, such as between the trigger and the first step; a Succeed or Fail there stays unconnected. A new step is named `Step 1`, `Step 2` and so on, and goes after the chosen step, taking over where it went on to, or after the last step; into the Map chosen; or first, with the trigger chosen. After a Choice or a step that ends the run it stays unconnected, and so does a Succeed or Fail that would cut off the steps after it, such as one added between two steps or first in a workflow that has steps.
|
|
398
|
-
- **Pins and wires.** Execution runs along the square handles in a box's header, and data along round pins below it, coloured by type: each argument of a Task's step type is a pin on the left, with its type on hover, and each value a step returns, or the trigger gives the run, is a pin on the right, such as an HTTP request's *Status*, *Headers* and *Body* and a record trigger's *Record*. A record, an HTTP body with a `body_schema`, headers and any other object with a title are one pin each. Dragging an output pin to an input pin wires them: the input reads that value by name, the step it comes from gets a variable keeping its result when it has none, and taking the wire away empties the input. A wire is refused over a pin that does not take it, saying why, such as *Whole number does not fit Text*, or that the step does not run before. An input no wire reads shows its value on its row, to type there where it is text, a number, true or false or a choice; an expression shows as ƒ and an object as {…}, both edited in the step's form. Inputs a type does not need and that hold nothing fold away behind *N more inputs*.
|
|
399
|
-
- **Break and Make.** Letting go of a wire from an object pin on the empty canvas offers *Break <Type>*, a node with a pin for each field of the object, such as a record's fields; from an object input, *Make <Type>*, which builds it from a pin per field, such as the fields a records step writes. They are the editor's own: they run no step and leave no trace, the inputs that use them read `$fetch.body.ip` and hold `{ "name": "{% $fetch.body.ip %}" }`, and opening a workflow draws a Break for each object a read goes into and a Make for each argument written as an object whose fields read values. One that nothing reads yet goes with a reload.
|
|
400
|
-
- **
|
|
399
|
+
- **Pins and wires.** Execution runs along the square handles in a box's header, and data along round pins below it, coloured by type: each argument of a Task's step type is a pin on the left, with its type on hover, and each value a step returns, or the trigger gives the run, is a pin on the right, such as an HTTP request's *Status*, *Headers* and *Body* and a record trigger's *Record*. A record, an HTTP body with a `body_schema`, headers and any other object with a title are one pin each. Dragging an output pin to an input pin wires them: the input reads that value by name, the step it comes from gets a variable keeping its result when it has none, and taking the wire away empties the input. A wire is refused over a pin that does not take it, saying why, such as *Whole number does not fit Text*, or that the step does not run before. An input no wire reads shows its value on its row, to type there where it is text, a number, true or false or a choice; an expression shows as ƒ and an object as {…}, both edited in the step's form. Inputs a type does not need and that hold nothing fold away behind *N more inputs*. The layout orders the nodes by where their wires meet their pins, so wires cross as little as they can, and in data order puts each node just before what reads it, so a Break, a condition node or a Select stands beside its step.
|
|
400
|
+
- **Break and Make.** Letting go of a wire from an object pin on the empty canvas offers *Break <Type>*, a node with a pin for each field of the object, such as a record's fields; from an object input, *Make <Type>*, which builds it from a pin per field, such as the fields a records step writes. They are the editor's own: they run no step and leave no trace, the inputs that use them read `$fetch.body.ip` and hold `{ "name": "{% $fetch.body.ip %}" }`, and opening a workflow draws a Break for each object a read goes into and a Make for each argument written as an object whose fields read values. One that nothing reads yet goes with a reload. A Break shows only the fields something reads, through a wire or an expression, and *N more fields* opens the rest; one that nothing reads yet shows them all.
|
|
401
|
+
- **Select.** An argument chosen by another value is drawn as a *Select* node between them: its one input is the value it looks at, a row per case gives a value of its own when that value is one of its own, and *Otherwise* gives one for any other, all typed on the node; *Add case* adds one. It is the editor's own: it writes a chain of conditionals, `{% $states.context.Execution.Input.body.topic = 'sales' ? 'sales@example.com' : 'support@example.com' %}`, and one written that way, spaced as the node writes it, opens as the node, as it was saved. Letting go of a wire from an input of a value, empty or holding one of its own, on the empty canvas offers *Select*, whose one case and Otherwise give what the input held. Its position is kept under `Notify.#select.to`. Removing it removes the argument.
|
|
402
|
+
- **Condition nodes.** In data order, a step's Condition is drawn as the nodes it is made of, wired to its Only when pin: *Equals*, *Not equals*, *Greater* and *Less* compare two values, *Matches* tests text against a pattern (`$contains($contact.email, /^[^@\s]+@[^@\s]+$/)`), the pattern written on the node, and *All of*, *Any of* and *Not* join conditions. All of and Any of take any number: each has an empty input after its last, and a wire or a node there adds one more, so `a and b and c` is one All of of three and opens as one; removing one of three or more takes its input away. Each input is wired to a pin or holds a value of its own; one compared with a step's Step status pin is a choice of *Succeeded*, *Failed*, *Timed out*, *Aborted* and *Skipped*, and an All of's, an Any of's or a Not's is true or false. Dropping a step's Step status pin on another step's Only when pin makes that step run once the first succeeded: `{% $states.context.Steps.Save.Status = 'SUCCEEDED' %}`, an Equals of `Save`'s status and *Succeeded*. Letting go of a wire from an empty Only when pin on the empty canvas offers each node, and *Expression*; from an input of an All of, an Any of or a Not that holds a value or none, each node again, there. Any other Condition, such as `{% $count($tickets) > 0 %}`, or one spaced or bracketed otherwise than the nodes write it, is one *Expression* node, its text edited inside it, with a pin for each value it reads. The nodes are the editor's own: they write the Condition as JSONata, and one opened and saved unchanged stays as it was, byte for byte. Removing a node leaves its input what it holds with nothing wired, `''` for a Comparison's or a Matches node's text, `true` for an All of's and `false` for an Any of's or a Not's, or takes the input away from an All of or Any of of three or more; removing the one at Only when removes the Condition.
|
|
401
403
|
- **Execution order.** "Run the steps from the data" or "in sequence" under "..." switches the draft's order. To data, each `Next` becomes what the state it names runs after, by its data or, where it reads none of it, by a Condition on the earlier state's status, so the states run in the same order; refused with a Choice, an error path to another state or a variable two states assign. To sequence, the states form one chain in an order every dependency keeps; refused with a Condition or a catcher without `Next`. In data order the graph has no execution handles: in Pins the wires order the steps, each step has an Only when pin (its Condition) first and a Step status pin last, and in Simple an arrow joins each pair of steps where one reads the other, dashed where it reads only the other's status; a step with a Condition shows an "only when" badge.
|
|
402
404
|
- **Pins or Simple.** *Pins* and *Simple* above the graph switch how it is drawn: Simple shows the steps and the lines between them alone, with every input edited in the step's form, where a wire made in Pins shows as the read it wrote. Both draw the same document, so switching changes nothing saved; the browser remembers the choice, Pins by default.
|
|
403
405
|
- **Connecting steps.** Drag from a step's execution handle to another step; a click or tap without a drag adds a step there instead. The first handle sets `Next`, a Choice's *When* handle adds a rule and its *Otherwise* handle sets `Default`, a Task's or Map's *On error* handle adds a catcher of `States.ALL`, and the trigger's handle sets `StartAt`. A step leads only to steps of its own machine, so an edge into or out of a Map is refused. The chosen step's form sets the same edges with menus: *Goes on to*, each rule's and catcher's *Then goes to*, and *Otherwise goes to*.
|
|
@@ -21,7 +21,7 @@ state, step type and trigger, is in [the workflows reference](references/referen
|
|
|
21
21
|
- `"execution_order": "data"`: no `StartAt`, no `Next`, no `End`, no `Choice`. A state runs once every state it reads
|
|
22
22
|
from has ended, and states that read nothing of each other run at once. Use it when steps are mostly independent,
|
|
23
23
|
or to branch per step with a `Condition`; the editor draws a Condition as nodes (Equals, Not equals, Greater, Less,
|
|
24
|
-
|
|
24
|
+
Matches, All of, Any of, Not), any other expression as one Expression node.
|
|
25
25
|
|
|
26
26
|
Data order's rules, each checked against the save or a run:
|
|
27
27
|
|
|
@@ -70,8 +70,8 @@ A test run does what its steps do: it sends the mail and writes the records.
|
|
|
70
70
|
## Examples
|
|
71
71
|
|
|
72
72
|
A website contact form, in data order: the sender becomes a lead contact with the message as a note, sales or support
|
|
73
|
-
is mailed by the topic, and the sender gets an auto-reply when the address looks valid. The routing Conditions
|
|
74
|
-
Equals and Not equals nodes
|
|
73
|
+
is mailed by the topic, and the sender gets an auto-reply when the stored address looks valid. The routing Conditions
|
|
74
|
+
show as Equals and Not equals nodes, the address check as a Matches node.
|
|
75
75
|
|
|
76
76
|
```json
|
|
77
77
|
{
|
|
@@ -108,8 +108,8 @@ Equals and Not equals nodes; the address check, a regular expression, as an Expr
|
|
|
108
108
|
"AutoReply": {
|
|
109
109
|
"Type": "Task",
|
|
110
110
|
"Resource": "app:mail.send",
|
|
111
|
-
"Condition": "{% $
|
|
112
|
-
"Arguments": { "to": "{% $
|
|
111
|
+
"Condition": "{% $contains($contact.email, /^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$/) %}",
|
|
112
|
+
"Arguments": { "to": "{% $contact.email %}", "subject": "We received your message", "text": "{% 'Hi ' & $contact.name & ',\n\nThanks for getting in touch; we will answer within one working day.' %}" }
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
}
|