@protobase/cli 0.100.4 → 0.100.6
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.6",
|
|
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.6",
|
|
47
|
+
"@protobase/layout": "0.100.6",
|
|
48
|
+
"@protobase/query": "0.100.6",
|
|
49
|
+
"@protobase/schema": "0.100.6",
|
|
50
|
+
"@protobase/server": "0.100.6",
|
|
51
|
+
"@protobase/ui": "0.100.6",
|
|
52
|
+
"@protobase/workflows": "0.100.6",
|
|
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",
|
|
@@ -14,6 +14,7 @@ The API every resource gets, with filters, writes, errors and the typed client.
|
|
|
14
14
|
- [Map queries](../reference/api.md#maps): The records inside a map's view, or counts per area when there are many.
|
|
15
15
|
- [Related names and photos](../reference/api.md#related-names): A list response can carry the names of related records and each record's first photos.
|
|
16
16
|
- [ETags](../reference/api.md#writes): Every record has a version, and a write based on an old version is refused.
|
|
17
|
+
- [Lists without ETags](../reference/api.md#writes): A list can leave out each record's version, so it reads only the fields it asks for.
|
|
17
18
|
- [Minimal responses](../reference/api.md#writes): A create or update can answer without the record, to save the transfer.
|
|
18
19
|
- [Batch writes](../reference/api.md#batch-writes): Up to 500 creates, updates, deletes, reorders and moves across resources in one transaction.
|
|
19
20
|
- [Record permissions](../reference/api.md#record-permissions): Responses say which records and fields the caller may change.
|
|
@@ -33,7 +33,7 @@ Under `/api/v1`:
|
|
|
33
33
|
|
|
34
34
|
| Route | |
|
|
35
35
|
| --- | --- |
|
|
36
|
-
| `GET /{resource}` | list: `filter`, `order_by`, `page_size` (50, max 500), `page_token`, `fields`, `labels`, `photos`, `photos_order_by`, `count=exact`, [`limit_per`](#first-rows-per-value) |
|
|
36
|
+
| `GET /{resource}` | list: `filter`, `order_by`, `page_size` (50, max 500), `page_token`, `fields`, `labels`, `photos`, `photos_order_by`, `count=exact`, [`limit_per`](#first-rows-per-value), [`etag=false`](#writes) |
|
|
37
37
|
| `POST /{resource}:search` | same parameters as a JSON body (`fields` and `labels` arrays), for long filters |
|
|
38
38
|
| `GET /{parent}/{key}/{resource}` | the list of `resource` that belongs to one record, see [Lists under a record](#lists-under-a-record) |
|
|
39
39
|
| `GET /{resource}/{key}` | one record, with `ETag`; composite keys are `part,part`, each part percent-encoded |
|
|
@@ -221,7 +221,7 @@ Create, update and delete share one pipeline (`write-pipeline.ts`):
|
|
|
221
221
|
|
|
222
222
|
**ETag**: the `version` or `updated_at` column when the resource has a read-only one (bumped on every update, so no trigger is needed; the ETag keeps the column's full microsecond text), otherwise a hash of the exposed fields. It is computed from the row itself, so lists need no extra query.
|
|
223
223
|
|
|
224
|
-
**`etag` property**: every record in a get, list, `:search`, create or update response carries its current version as `etag` (the value of the `ETag` header, [AIP-154](https://google.aip.dev/154)), so a grid row can be updated or deleted without a get. It survives `fields` selection. A resource cannot have a field named `etag` (startup error); a body containing `etag` is a `400` that points at `If-Match`.
|
|
224
|
+
**`etag` property**: every record in a get, list, `:search`, create or update response carries its current version as `etag` (the value of the `ETag` header, [AIP-154](https://google.aip.dev/154)), so a grid row can be updated or deleted without a get. It survives `fields` selection. `etag=false` on a list, `:search` or `:seek` (`true`, the default, keeps it; any other value is a `400`) leaves it out of every item, so a list that only shows records reads only its `fields` from the database, where a resource without a version column otherwise reads every field it may read to hash its ETags. A resource cannot have a field named `etag` (startup error); a body containing `etag` is a `400` that points at `If-Match`.
|
|
225
225
|
|
|
226
226
|
**If-Match** is required on PATCH (`428` without it). On DELETE it is optional: without it the current version is deleted. When sent it must match, otherwise `412`; `*` matches whatever the current version is (RFC 9110).
|
|
227
227
|
|
|
@@ -167,7 +167,7 @@ On the web, a `Table`, `Thread`, `Chart`, `RecordCards` and `RecordRow` still re
|
|
|
167
167
|
The build compiles each page into a read plan: one ordinary API read per data block, each known before any record is read, so all of them start together when the page opens and none waits for another's rows. There is no combined page query: each read is a request of its own. `/api/meta` sends each user the plan of the page as they see it, so it holds no read of a resource they cannot read and no field they cannot read.
|
|
168
168
|
|
|
169
169
|
- **One read per block.** `Stat`, `RecordCard`, `Table`, `CardRow`, `RecordRow`, `RecordCards`, `Thread`, `Chart`, `Timeline`, `ReferenceManyField`, `ReferenceArrayField` and `ReferenceField` each make one list, count or `:aggregate` read. A `Thread`'s tool calls, the row a `Table`'s or the bar a `Timeline`'s `select` chose and each `<resource>.count` a condition names are reads of their own. A block under `Show` or `Match` is read anyway: the condition decides only what is drawn.
|
|
170
|
-
- **Fields are derived.** You never write `fields`. Each read asks for its key and every field drawn in its scope: by `Field`s, [field components](#field-values), `{{path}}`s, conditions and table columns, and the fields a nested list ties itself by. A block whose view decides what it draws, such as a `Table` without `columns` or a `RecordRow`, reads every field. So does a read whose records an `Action` or an edit form changes, since it asks for each record's ETag and an ETag covers the whole record. The other reads ask for no ETag.
|
|
170
|
+
- **Fields are derived.** You never write `fields`. Each read asks for its key and every field drawn in its scope: by `Field`s, [field components](#field-values), `{{path}}`s, conditions and table columns, and the fields a nested list ties itself by. A block whose view decides what it draws, such as a `Table` without `columns` or a `RecordRow`, reads every field. So does a read whose records an `Action` or an edit form changes, since it asks for each record's ETag and an ETag covers the whole record. The other reads ask for no ETag (`etag=false`), so the database reads only their fields.
|
|
171
171
|
- **A nested read carries the read around it.** A block inside the records of another ties itself to them by a field: a `ReferenceManyField`'s `target`, a `ReferenceField`'s or `ReferenceArrayField`'s `source`, or `task_id = {{id}}` as a top-level `AND` term of a filter. Its read takes that as a [`related()`](api.md#filtering-through-related-records) term holding the outer read's own filter, order and page size, such as `related(task_id, tasks.id, (status = "open"), "id desc", 10)`, never the values of records read first. A `ReferenceArrayField` ties itself by the JSON list of keys the same way, `related(id, tasks.waits, …)`. Terms nest for a list two levels deep.
|
|
172
172
|
- **Per record, in one read.** Inside a repeated record, such as a `CardRow` or a `RecordsIterator`, a list reads its `perPage` (or `limit`) for each record with [`limit_per`](api.md#first-rows-per-value), and a `Stat` count is one `:aggregate` grouped by the field it ties itself by. Each nested read holds at most 500 records in all, the API's largest page, and the build warns when the records around it times its page are more, as some records would show fewer. A `ReferenceArrayField` there reads one page for all the records around it, of up to `perPage` records for each of them, since one record can sit in several lists. A `RecordRow` there needs a `limit`.
|
|
173
173
|
- **The page's own record.** A field of it that the address does not hold, `{{@root.project_id}}`, becomes `related()` on that record by its key, so the page's record is not read first. Page parameters and the page record's key stay `{{…}}` slots in the plan, which the address fills.
|
|
@@ -179,7 +179,7 @@ Each read in the plan (`page.reads.reads`) names its block by a JSON Pointer int
|
|
|
179
179
|
|
|
180
180
|
A [custom component](custom-components.md#reads) is planned when it declares its reads: the page starts them with the others, each of several a part of its own named by its resource prop (`/children/0#edges`), and the component draws from them. One that declares none is outside the plan (`page.reads.outside`): whatever it reads, it reads by itself once it draws, and `protobase doctor` lists it.
|
|
181
181
|
|
|
182
|
-
<gap>A `Table`, `Thread`, `Chart`, `RecordCards` or `RecordRow` cannot start its read when the page opens because drawing those blocks from their planned read is not implemented; each still reads once it draws, under a `Show` or `Match` once its condition holds.</gap> <gap>A
|
|
182
|
+
<gap>A `Table`, `Thread`, `Chart`, `RecordCards` or `RecordRow` cannot start its read when the page opens because drawing those blocks from their planned read is not implemented; each still reads once it draws, under a `Show` or `Match` once its condition holds.</gap> <gap>A `Chart` cannot sit inside a repeated record because grouping a chart per record is not implemented.</gap>
|
|
183
183
|
|
|
184
184
|
## Field values
|
|
185
185
|
|