@protobase/cli 0.100.2 → 0.100.3

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.
@@ -1,4 +1,4 @@
1
1
  //#region package.json
2
- var version = "0.100.2";
2
+ var version = "0.100.3";
3
3
  //#endregion
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protobase/cli",
3
- "version": "0.100.2",
3
+ "version": "0.100.3",
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.2",
47
- "@protobase/layout": "0.100.2",
48
- "@protobase/query": "0.100.2",
49
- "@protobase/schema": "0.100.2",
50
- "@protobase/server": "0.100.2",
51
- "@protobase/ui": "0.100.2",
52
- "@protobase/workflows": "0.100.2",
46
+ "@protobase/config": "0.100.3",
47
+ "@protobase/layout": "0.100.3",
48
+ "@protobase/query": "0.100.3",
49
+ "@protobase/schema": "0.100.3",
50
+ "@protobase/server": "0.100.3",
51
+ "@protobase/ui": "0.100.3",
52
+ "@protobase/workflows": "0.100.3",
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",
@@ -16,7 +16,7 @@ Apps written for other systems that keep working on Protobase, and moving their
16
16
 
17
17
  ## AWS Step Functions
18
18
 
19
- - [Step Functions import](../reference/workflows.md#importing-from-step-functions) (beta): A JSONata state machine exported from AWS Step Functions saves and runs as a workflow as it is, and what does not run here, its service tasks included, is refused by name.
19
+ - [Step Functions import](../reference/workflows.md#importing-from-step-functions) (beta): A JSONata state machine exported from AWS Step Functions saves and runs as a workflow, its HTTP tasks as `app:http` steps that send the same request and give the same result, and what does not run here exactly, its other service tasks included, is refused by name.
20
20
  - [Task callbacks](../reference/workflows.md#waiting-for-an-outside-result) (beta): A step that waits for an outside result takes the SendTaskSuccess, SendTaskFailure and SendTaskHeartbeat calls a caller written for AWS Step Functions sends, unchanged.
21
21
 
22
22
  ## Template paths
@@ -107,11 +107,11 @@ In an app with [workflows](workflows.md), the endpoint also offers tools to find
107
107
  | `list_workflow_types` | The step types a Task names as its `Resource` and the triggers a definition holds, built-in and [plugin](workflow-plugins.md) ones alike, each by id with its label, description, input as JSON Schema and, when the type declares one, its output, the errors a step fails with, and whether the app can run it. |
108
108
  | `list_workflows` | A page of the workflows the person may read, newest change first, without their definitions: `filter` on `name`, `page_size` (20 by default, at most 100) and `page_token`. |
109
109
  | `get_workflow` | One workflow with its whole definition and its ETag. |
110
- | `validate_workflow` | Checks a `definition`, or a workflow's `id` with an `edit` of its saved definition, as a save checks it, and saves nothing: `{ valid: true }`, or `{ valid: false, problems }`. A valid one may come with `warnings` in the same shape, which a save goes through with, such as a [Wait after a Block](workflows.md#blocks); `create_workflow` and `update_workflow` return them with what they saved. A record trigger is checked against the resources and fields the person may read, so a resource they cannot read is not a resource of the app. |
110
+ | `validate_workflow` | Checks a `state_machine`, with its `trigger` and `execution_order`, or a workflow's `id` with an `edit` of its saved definition, as a save checks it, and saves nothing: `{ valid: true }`, or `{ valid: false, problems }`. A valid one may come with `warnings` in the same shape, which a save goes through with, such as a [Wait after a Block](workflows.md#blocks); `create_workflow` and `update_workflow` return them with what they saved. A record trigger is checked against the resources and fields the person may read, so a resource they cannot read is not a resource of the app. |
111
111
  | `get_workflow_run` | A run's status, input, output, error and cause, with its steps in the order they ran, each with its state, scope, try, status, input, output, assigned variables, logs, error and cause; `state` reads one state's steps, a page of 20 by default. |
112
112
  | `list_connections` | The person's own [connected accounts](workflows.md#connecting-an-account), by each connection the app's plugins declare: its key and label, and each account's `id`, scopes and `needs_sign_in`. A definition's `connections` binds an account by its `id`. It returns no token, and no one else's accounts. |
113
- | `create_workflow` | Creates a workflow from its `name`, `description` and `definition`, and returns its `id`, `version` and ETag. |
114
- | `update_workflow` | Changes a workflow's definition by an `edit` or whole, as `definition`, and its `name` or `description`, and returns its `id`, new `version` and ETag. With the `etag` that `get_workflow` gave, it fails when someone changed the workflow since; an edit without one is saved against the version it was applied to. |
113
+ | `create_workflow` | Creates a workflow from its `name`, `description` and `state_machine`, with its `trigger` and `execution_order`, and returns its `id`, `version` and ETag. A state machine from Step Functions [imports](workflows.md#importing-from-step-functions) its HTTP tasks as `app:http` steps, with `connection_headers` naming each connection's header; `update_workflow` and `validate_workflow` import one the same way. |
114
+ | `update_workflow` | Changes a workflow's definition by an `edit` or whole, as `state_machine`, `trigger` and `execution_order`, and its `name` or `description`, and returns its `id`, new `version` and ETag. With the `etag` that `get_workflow` gave, it fails when someone changed the workflow since; an edit without one is saved against the version it was applied to. |
115
115
  | `run_workflow` | Starts a run of a workflow's version saved last, or of the `version` it names, with an `input`, and returns its `run_id` and `status`. With `rerun_of`, a failed run's id, it [re-runs](workflows.md#re-running-a-failed-run) that run from its last checkpoint instead, on its input, and with `rerun_from` any ended run that kept its trace from that state; with `replay: true` too, it [replays](workflows.md#replaying-a-run) any ended run of the workflow on its current version, with that run's input, sending none of its outside writes. |
116
116
  | `enable_workflow` | Publishes the saved `version` it names (`enabled: true`), which puts the workflow's trigger on it, or turns the workflow off, and returns its `enabled_version`. A save never goes live by itself. One that uses a [connected account](workflows.md#connecting-an-account) is turned on only by the account's owner in the admin app: the tool answers `own-sign-in-only` and says so. |
117
117
  | `new_webhook_url` | Issues a new URL and secret for a workflow that starts from a [webhook trigger](workflows.md#appwebhook), keeping a `secret` the sender makes when given one, and returns `{ url, secret }`, shown this once; the old URL stops. |
@@ -132,10 +132,23 @@ A workflow switches order in the editor (see [The editor](#the-editor)), or by s
132
132
 
133
133
  :::caution[Beta]
134
134
  - <gap>A JSONPath state machine cannot import because converting JSONPath to JSONata is not implemented.</gap>
135
- - <gap>A state machine with a service task, the HTTP task (`arn:aws:states:::http:invoke`) included, a `Parallel` or a distributed Map cannot import because running them, or turning an HTTP task into an `app:http` step, is not implemented: write such a task with one of this app's step types, such as `app:http`.</gap>
135
+ - <gap>A state machine with a service task other than the HTTP task, a `Parallel` or a distributed Map cannot import because running them is not implemented: write such a task with one of this app's step types.</gap>
136
+ - <gap>An HTTP task's connection cannot send more than one header, or a token it fetches itself, because importing a connection's other parameters and OAuth sign-in is not implemented: its other headers, query and body parameters go in the task's own `Headers`, `QueryParameters` and `RequestBody`.</gap>
137
+ - <gap>An HTTP task that waits for a task token (`http:invoke.waitForTaskToken`) cannot import because turning it into an `app:http.waitForTaskToken` step is not implemented: write it as one.</gap>
136
138
  :::
137
139
 
138
- A JSONata state machine exported from AWS Step Functions saves and runs as it is, in sequence order: `create_workflow` over MCP takes it as `state_machine`, with a manual trigger unless one is given. Refused, each by name: a JSONPath state machine (`QueryLanguage` missing or `JSONPath`, or a state with `InputPath`, `Parameters`, `ResultSelector`, `ResultPath`, `OutputPath` or `ItemsPath`), every service task (`arn:aws:...`, the HTTP task, `.sync` and `.waitForTaskToken` included), Parallel, a distributed Map, `Credentials` and a whole-run `TimeoutSeconds`.
140
+ A JSONata state machine exported from AWS Step Functions saves and runs as a workflow, in sequence order: `create_workflow` over MCP takes it as `state_machine`, with a manual trigger unless one is given, and `update_workflow` and `validate_workflow` import a state machine, or an edit of a saved one, the same way. Refused, each by name: a JSONPath state machine (`QueryLanguage` missing or `JSONPath`, or a state with `InputPath`, `Parameters`, `ResultSelector`, `ResultPath`, `OutputPath` or `ItemsPath`), every service task but the HTTP task (`arn:aws:...`, `.sync` and `.waitForTaskToken` included), Parallel, a distributed Map, `Credentials` and a whole-run `TimeoutSeconds`.
141
+
142
+ An HTTP task (`arn:aws:states:::http:invoke`), in a Map or a Block too, imports as an [`app:http`](#apphttp) step that sends the same request and gives the same result, or is refused by name:
143
+
144
+ | HTTP task | Imports as |
145
+ | --- | --- |
146
+ | `ApiEndpoint`, `Method`, `Headers`, `QueryParameters` | `url`, `method`, `headers`, `query` |
147
+ | `RequestBody` | `body`, with `body_encoding: "json"`, as Step Functions sends it as JSON whatever it holds |
148
+ | `Authentication` or `InvocationConfig` | the header `connection_headers` names for its `ConnectionArn`, holding a [secret](#secrets) |
149
+ | `$states.result` in `Output` and `Assign` | the HTTP task's result, `{ StatusCode, StatusText, Headers, ResponseBody }`, each header's values as a list; without `Output`, that is the step's output, so later states and variables read what they read in Step Functions |
150
+
151
+ A connection's credentials stay with Step Functions, so the call names, for each connection's ARN, the header it sends and a secret holding the header's whole value: `"connection_headers": { "arn:aws:events:...:connection/tickets/...": { "header": "Authorization", "secret": "TICKETS_TOKEN" } }`, with `TICKETS_TOKEN` such as `Bearer ...` and listed in `workflows.secrets`; `null` sends no header. The header takes the place of one of the same name in `Headers`, as a connection's does. Refused: `Arguments` written as one expression, any other argument (`Transform`, which encodes the body as a form, among them), headers or query values that are lists, `HEAD` and `OPTIONS`, which `app:http` does not send, a `GET` with a `RequestBody`, a connection with no header given or with more than its `ConnectionArn`, an `Output` or `Assign` that reads `$states.result` in a form the import does not rewrite, such as `$states . result`, or `$states` as a whole, and a retrier or catcher of `States.Http.StatusCode.<code>`, `States.Http.Socket`, `Events.ConnectionResource.*` or `States.TaskFailed`: `app:http` fails with `Http.Status` for every status outside 2xx and `Http.Network` when no answer comes, and `States.TaskFailed` here matches only an error a step type does not name. A method written as an expression is checked when the step runs.
139
152
 
140
153
  ### Triggers
141
154
 
@@ -409,12 +422,12 @@ One request to a URL built at run time:
409
422
  | `method` | `GET` (default), `POST`, `PUT`, `PATCH` or `DELETE`. |
410
423
  | `headers`, `query` | Objects of text values; `query` is added to the URL's query. |
411
424
  | `body` | Text is sent as it is, a file value as its bytes with its type, any other value as JSON; a `GET` sends none. |
412
- | `body_encoding` | `json` sends the body as JSON whatever it holds, a text as a JSON string, with `Content-Type: application/json` unless the headers give one. |
425
+ | `body_encoding` | `json` sends the body as JSON whatever it holds, a text as a JSON string, with `Content-Type: application/json` unless the headers give one; a `GET` with a body then fails with `Http.InvalidArguments` rather than leaving the body out. |
413
426
  | `response` | How the answer's body is read: `json`, parsed (empty is `null`), `text`, or `file`, kept as a file of the run. Without it, by the answer's `Content-Type`: JSON for `application/json` and any `+json` type, text for `text/*` and other textual types (XML, JavaScript, YAML, TOML, NDJSON, form data), a file for any other type or none, and `null` for an empty body. |
414
427
  | `body_schema` | The JSON Schema of the answer's body as it is read, such as `{ "type": "object", "properties": { "ip": { "type": "string" } } }`: a body that does not fit it fails the step with `Http.InvalidBody`, and the editor offers the body's fields by it. |
415
428
  | `store` | `{ configuration, path? }`: streams the answer's body, of any size, into a [storage configuration](#storing-files), and gives the stored file as `body`. Takes no `response` or `body_schema`. |
416
429
 
417
- A `GET` only reads; every other method is recorded. The result is `{ status, headers, body }`, without the cookies the answer sets. A status outside 2xx fails the step with `Http.Status`, whose cause names the status and holds at most the first 200 characters of the body, secrets blanked out first; a redirect is never followed. `Http.Network` is a request that got no answer. The step resolves the URL's host when it runs and refuses it with `Http.AddressRefused` unless every address is public, then connects to the very address it checked, so a URL built from a webhook's payload cannot reach the app's own network. It reads at most 10 MiB of the answer's body: a larger one fails the step with `Http.ResponseTooLarge`, rather than being cut short. With `store`, the body streams straight into the store, so its size is limited only by what the store takes, and the step is recorded, a `GET` too: a run taken up again keeps the stored file and does not fetch it again, from a link that may have expired by then.
430
+ A `GET` only reads; every other method is recorded. The result is `{ status, status_text, headers, body }`, `status_text` the reason phrase the server sent (empty when it sent none), without the cookies the answer sets. A status outside 2xx fails the step with `Http.Status`, whose cause names the status and holds at most the first 200 characters of the body, secrets blanked out first; a redirect is never followed. `Http.Network` is a request that got no answer. The step resolves the URL's host when it runs and refuses it with `Http.AddressRefused` unless every address is public, then connects to the very address it checked, so a URL built from a webhook's payload cannot reach the app's own network. It reads at most 10 MiB of the answer's body: a larger one fails the step with `Http.ResponseTooLarge`, rather than being cut short. With `store`, the body streams straight into the store, so its size is limited only by what the store takes, and the step is recorded, a `GET` too: a run taken up again keeps the stored file and does not fetch it again, from a link that may have expired by then.
418
431
 
419
432
  ### app:records
420
433
 
@@ -483,7 +496,7 @@ Steps store and read files with:
483
496
  | --- | --- | --- |
484
497
  | `app:storage.put` | `configuration`, `file`: a file of the run or a stored file, optional `path` | the stored file |
485
498
  | `app:storage.get` | `file`: a stored file | a file of the run, up to 10 MiB, for steps that take one, such as mail attachments |
486
- | `app:http` with `store` | `store: { configuration, path? }` | `{ status, headers, body }`, `body` the stored file |
499
+ | `app:http` with `store` | `store: { configuration, path? }` | `{ status, status_text, headers, body }`, `body` the stored file |
487
500
 
488
501
  A stored file is `{ configuration, node, path, name, type, size }`: the configuration, the server that holds it for a local one, and its path there, never a folder, bucket or key. A `path` is relative: letters, digits, `.`, `_` and `-` in segments split by `/`, none starting with `.`; any other fails the step with `Storage.InvalidArguments` before anything is stored. Without a `path`, a step stores under a path of its own in its run, the same each time the step is tried, so a step a crash made run again replaces its file rather than leaving a second one. A put is recorded; a get only reads.
489
502
 
@@ -568,6 +581,8 @@ Each workflow has a status from its last 10 ended runs, so you see which ones ne
568
581
 
569
582
  :::caution[Beta]
570
583
  A re-run from a step needs the earlier run's trace, and a re-run from the failed step keeps in its trace only the steps it ran, so it cannot itself be re-run from a state before them.
584
+
585
+ <gap>A re-run from the failed step cannot apply an `Assign` of a step's whole result added since to a state that already ran because keeping each step's result in the checkpoints is not implemented: it goes on with the variables as they ran, and a re-run from that state applies it.</gap>
571
586
  :::
572
587
 
573
588
  A failed run keeps its [checkpoints](#how-a-run-is-run). `POST /api/v1/workflow_runs` with `{ "workflow_id": "...", "rerun_of": "..." }` starts a run that: