@protobase/cli 0.100.22 → 0.100.23
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.23",
|
|
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.23",
|
|
47
|
+
"@protobase/layout": "0.100.23",
|
|
48
|
+
"@protobase/query": "0.100.23",
|
|
49
|
+
"@protobase/schema": "0.100.23",
|
|
50
|
+
"@protobase/server": "0.100.23",
|
|
51
|
+
"@protobase/ui": "0.100.23",
|
|
52
|
+
"@protobase/workflows": "0.100.23",
|
|
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,6 +11,7 @@ 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 Less, And, Or 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.
|
|
14
15
|
- [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.
|
|
15
16
|
- [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.
|
|
16
17
|
- [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
|
+
| `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. |
|
|
113
114
|
|
|
114
115
|
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`.
|
|
115
116
|
|
|
@@ -122,7 +123,7 @@ No run reads it, so a save that changes only the layout makes no new version and
|
|
|
122
123
|
### Execution order from the data
|
|
123
124
|
|
|
124
125
|
:::caution[Beta]
|
|
125
|
-
A step skipped in a run is not in its trace yet
|
|
126
|
+
A step skipped in a run is not in its trace yet.
|
|
126
127
|
:::
|
|
127
128
|
|
|
128
129
|
With `execution_order` `data`, the state machine has no `StartAt` and its states no `Next` or `End`: a state runs once every state it reads from has ended, and states that read nothing of each other run at once, at most 20 of a run at a time.
|
|
@@ -390,10 +391,11 @@ The bar under the breadcrumb holds what is live, the version shown, *Add step*,
|
|
|
390
391
|
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.
|
|
391
392
|
|
|
392
393
|
- **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.
|
|
393
|
-
- **Moving nodes by hand.** Dragging a node, a step, the trigger, a Break or a
|
|
394
|
+
- **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>
|
|
394
395
|
- **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.
|
|
395
396
|
- **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*.
|
|
396
397
|
- **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.
|
|
398
|
+
- **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, *And*, *Or* and *Not* join conditions. Each side 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 And's, an Or'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 a side of an And, an Or or a Not that holds a value, 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 side what it holds with nothing wired, `''` for a Comparison's, `true` for an And's and `false` for an Or's or a Not's; removing the one at Only when removes the Condition.
|
|
397
399
|
- **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.
|
|
398
400
|
- **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.
|
|
399
401
|
- **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*.
|