@protobase/cli 0.83.0 → 0.84.0
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 +1 -1
- package/package.json +8 -8
- package/skills/protobase/references/reference/api.md +2 -2
- package/skills/protobase/references/reference/config/jobs-and-events.md +1 -1
- package/skills/protobase/references/reference/workflow-plugins.md +1 -1
- package/skills/protobase/references/reference/workflows.md +4 -4
package/dist/cli/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@protobase/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.84.0",
|
|
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.
|
|
47
|
-
"@protobase/layout": "0.
|
|
48
|
-
"@protobase/query": "0.
|
|
49
|
-
"@protobase/schema": "0.
|
|
50
|
-
"@protobase/server": "0.
|
|
51
|
-
"@protobase/ui": "0.
|
|
52
|
-
"@protobase/workflows": "0.
|
|
46
|
+
"@protobase/config": "0.84.0",
|
|
47
|
+
"@protobase/layout": "0.84.0",
|
|
48
|
+
"@protobase/query": "0.84.0",
|
|
49
|
+
"@protobase/schema": "0.84.0",
|
|
50
|
+
"@protobase/server": "0.84.0",
|
|
51
|
+
"@protobase/ui": "0.84.0",
|
|
52
|
+
"@protobase/workflows": "0.84.0",
|
|
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",
|
|
@@ -214,8 +214,8 @@ The rules behind these steps are described under [Access](#access).
|
|
|
214
214
|
- **Keys** are the URL text (`a,b` when composite), a number, a list of parts, or a reference.
|
|
215
215
|
- **`$ref`**: `ref: 'invoice'` on a create names the record; later operations use `{ "$ref": "invoice" }` as a key, a key part, or a value in `data` (it stands for that record's key, or with `{ "$ref": "invoice", "field": "number" }` a readable field's value). A ref must come after its create.
|
|
216
216
|
- **`reorder`** sets `field` to `start`, `start` + 1, ... in the order of `keys`, so a long list sends only the stretch that moved, and writes only the records whose value changes, each as an ordinary update (so each needs its `etags` entry, and hooks see each). To work with a non-deferrable unique index such as `(invoice_id, position)`, the changing records are first moved out of the range in use, in the same transaction and without touching their ETags: above the highest value of the column, or, when a check constraint refuses that (checked with a savepoint), below the lowest one. Then they get their final values, which collide with nothing. The field must be an integer the caller may write; the keys must all exist and be visible to the caller. When it is the resource's [position with `after`](ui-config.md#ranked-after-what-they-depend-on), a reorder that puts a record at or above a record it depends on, or one of those at or below it, fails with `409` and the type `ranks-above-dependency`, naming both keys in `record` and `dependsOn`; pairs out of order before it do not count.
|
|
217
|
-
- **`move`** puts the record `key` just after `after`, or first when it is `null`, in the list `filter` reads (as a list's `filter` does) ordered by `field`. It is anchored to that place rather than to ETags: it saves while the record after `after` there, leaving out the moved one, is still `before` (`null`: none), whatever else changed in the list or in the records, and fails with `412` otherwise, so the caller reads the list again. Leave `before` out when the caller did not load the record after `after`; then only `after` is checked. The server reads the list in its current order and renumbers the shortest stretch that saves the move, written as a `reorder` writes it, so the same field rules, unique index handling and `ranks-above-dependency` check apply. Moves of the same resource's `field` run one at a time. A filter needs indexes as a list's does.
|
|
218
|
-
- **Result**: `{ results: [...] }`, one entry per operation in order: `create` and `update` give `record` and `etag`, `delete` gives `deleted: true`, `reorder` gives `records` (every key in order, with its etag), and `move` the records it numbered, in order, with their etags.
|
|
217
|
+
- **`move`** puts the record `key` just after `after`, or first when it is `null`, in the list `filter` reads (as a list's `filter` does) ordered by `field`. It is anchored to that place rather than to ETags: it saves while the record after `after` there, leaving out the moved one, is still `before` (`null`: none), whatever else changed in the list or in the records, and fails with `412` otherwise, so the caller reads the list again. Leave `before` out when the caller did not load the record after `after`; then only `after` is checked. The server reads the list in its current order and renumbers the shortest stretch that saves the move, written as a `reorder` writes it, so the same field rules, unique index handling and `ranks-above-dependency` check apply. Moves and reorders of the same resource's `field` run one at a time, and a record of the stretch renumbered by another write between the move's read and its write refuses it with `412` too. A filter needs indexes as a list's does.
|
|
218
|
+
- **Result**: `{ results: [...] }`, one entry per operation in order: `create` and `update` give `record` and `etag`, `delete` gives `deleted: true`, `reorder` gives `records` (every key in order, with its etag), and `move` the records it numbered, in order, with their etags. Each of those records comes with `previous`, its value of `field` before the operation, which an undo puts back.
|
|
219
219
|
- **Failure**: nothing is written. The problem is the failing operation's own (`400`, `403`, `404`, `409`, `412`, `428`, ...) with `operation` (its index), `op` and `resource` added. A stale ETag anywhere is a `412` for the whole batch.
|
|
220
220
|
|
|
221
221
|
## Authentication
|
|
@@ -269,7 +269,7 @@ export default defineConfig({ workflows: { plugins: ['@acme/workflow-plugin'] }
|
|
|
269
269
|
- **Type:** `{ root?: string; endpoints?: string[] }`
|
|
270
270
|
- **Default:** off
|
|
271
271
|
|
|
272
|
-
Turns on [storage configurations](../workflows.md#storing-files), the named places workflows store files in. `root` is the one folder local configurations live inside, such as a mounted file share; it must not overlap a file provider's folder. Without it, only S3-compatible configurations are taken. `endpoints` are the `https://` origins an S3-compatible configuration may name; without them,
|
|
272
|
+
Turns on [storage configurations](../workflows.md#storing-files), the named places workflows store files in. `root` is the one folder local configurations live inside, such as a mounted file share; it must not overlap a file provider's folder. Without it, only S3-compatible configurations are taken. `endpoints` are the `https://` origins an S3-compatible configuration may name; without them, none are taken. S3-compatible configurations cannot be used while the server's environment sets `S3_ENDPOINT`, `AWS_ENDPOINT`, `S3_REGION`, `AWS_REGION`, `S3_SESSION_TOKEN` or `AWS_SESSION_TOKEN`, since the S3 client would sign their requests with them. The configurations' keys are encrypted, so the app needs `PROTOBASE_ENCRYPTION_KEY`.
|
|
273
273
|
|
|
274
274
|
```ts
|
|
275
275
|
export default defineConfig({ workflows: { storage: { root: './data/workflow-storage', endpoints: ['https://storage.example.com'] } } })
|
|
@@ -78,7 +78,7 @@ What `run` gets, and nothing more:
|
|
|
78
78
|
| `fetch(url, init)` | The only way a plugin should send a request: see [Sending requests](#sending-requests). |
|
|
79
79
|
| `records` | `create`, `createMany`, `update`, `get` and `list` of the app's records, through the API as the user who saved the version the run runs, with the roles they hold now: their access rules, tenant, validation and write hooks apply. A refusal fails the step with `Records.Refused`. |
|
|
80
80
|
| `files` | `keep(bytes, name, type)` stores a file of the run and returns its file value; `read(value, field)` reads one the run kept. No other file of the app is reachable. |
|
|
81
|
-
| `storage` | `put(configuration, path, stream, { name, type })` streams a file into a [storage configuration](workflows.md#storing-files) and returns the stored file; `read(file, field)` gives a stored file's bytes as a stream. Both read the configuration as the user who saved the version, and fail with `Storage.NotFound` for one they may not read, a file that is gone, or an app with storage off. |
|
|
81
|
+
| `storage` | `put(configuration, path, stream, { name, type })` streams a file into a [storage configuration](workflows.md#storing-files) and returns the stored file, cancelling the stream when it fails; `open(configuration, path)` checks both before there is a stream, and its `put(stream, { name, type })` stores one there, for a step that should not fetch a file it cannot store; `read(file, field)` gives a stored file's bytes as a stream. Both read the configuration as the user who saved the version, and fail with `Storage.NotFound` for one they may not read, a file that is gone, or an app with storage off. |
|
|
82
82
|
| `mail` | `send(message)` from the app's own sender; `undefined` when the app sends no mail. |
|
|
83
83
|
| `connection` | `accessToken()` of the connection the step declares, or `undefined`. |
|
|
84
84
|
| `mailbox` | `send(message)` from the [own mailbox](email.md#from-someones-own-mailbox) of the person who turned on the version the run runs, signed in as themselves, while they may still change the workflow; otherwise it fails `not_linked` and sends nothing. `undefined` when the app links no mailboxes. |
|
|
@@ -350,8 +350,8 @@ A configuration is a record of `storage_configurations`, which you create and ch
|
|
|
350
350
|
| `name` | What workflows name it by: a lowercase letter, then lowercase letters, digits and `_`. Unique in the tenant. |
|
|
351
351
|
| `kind` | `local`, a folder under `root`, or `s3`, a bucket. |
|
|
352
352
|
| `dir` | For `local`: a folder inside `root`, such as `invoices/2026`. A path that would leave it, through `..` or a symlink, is refused. Without `root`, only `s3` configurations are taken. |
|
|
353
|
-
| `bucket`, `region` | For `s3`: the bucket and its region. |
|
|
354
|
-
| `endpoint` | For `s3
|
|
353
|
+
| `bucket`, `region` | For `s3`: the bucket and its region, both required. |
|
|
354
|
+
| `endpoint` | For `s3`, required: one of the `endpoints` the app lists. Its host must resolve to public addresses, which every step checks again. |
|
|
355
355
|
| `access_key_id`, `secret_access_key` | For `s3`: the bucket's keys, both required before a step can use it. They are stored encrypted, and nobody can read them again once saved, not even you; set new ones to change them. |
|
|
356
356
|
|
|
357
357
|
You set the keys with the API or the MCP `update_record` tool: `PATCH /api/v1/storage_configurations/<id>` with its `If-Match` and `{ "access_key_id": "...", "secret_access_key": "..." }`. <gap>An S3 configuration's keys cannot be set in the admin app's form because its editor for write-only fields is not implemented.</gap>
|
|
@@ -377,12 +377,12 @@ A stored file is `{ configuration, node, path, name, type, size }`: the configur
|
|
|
377
377
|
}
|
|
378
378
|
```
|
|
379
379
|
|
|
380
|
-
A step reads the configuration it names afresh each time, as the user who saved the run's version, with the roles they hold now. It fails with:
|
|
380
|
+
A step reads the configuration it names afresh each time, as the user who saved the run's version, with the roles they hold now. `app:http` with `store` checks the configuration and path before it sends the request, so one it cannot store to fails without a request. It fails with:
|
|
381
381
|
|
|
382
382
|
| Error | |
|
|
383
383
|
| --- | --- |
|
|
384
384
|
| `Storage.NotFound` | No configuration of that name the workflow's last editor may read, which says nothing of one in another tenant or one they may not read; or the file is gone, which a `Catch` can take. |
|
|
385
|
-
| `Storage.Unavailable` | The configuration cannot be used as it is, such as an S3 one without keys
|
|
385
|
+
| `Storage.Unavailable` | The configuration cannot be used as it is, such as an S3 one without keys, with keys that no longer decrypt, or on a server whose environment sets an S3 endpoint, region or session token. |
|
|
386
386
|
| `Storage.Failed` | The store failed; the cause names its error code only. |
|
|
387
387
|
| `Storage.Full` | The store has no room left. |
|
|
388
388
|
| `Storage.TooLarge` | `app:storage.get` of a file over 10 MiB. |
|