@protobase/cli 0.133.7 → 0.133.9

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.133.7";
2
+ var version = "0.133.9";
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.133.7",
3
+ "version": "0.133.9",
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.133.7",
47
- "@protobase/layout": "0.133.7",
48
- "@protobase/query": "0.133.7",
49
- "@protobase/schema": "0.133.7",
50
- "@protobase/server": "0.133.7",
51
- "@protobase/ui": "0.133.7",
52
- "@protobase/workflows": "0.133.7",
46
+ "@protobase/config": "0.133.9",
47
+ "@protobase/layout": "0.133.9",
48
+ "@protobase/query": "0.133.9",
49
+ "@protobase/schema": "0.133.9",
50
+ "@protobase/server": "0.133.9",
51
+ "@protobase/ui": "0.133.9",
52
+ "@protobase/workflows": "0.133.9",
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",
@@ -20,7 +20,7 @@ The changes of each record, comments on it, and pages that refresh as records ch
20
20
  - [Changes in the write-ahead log](../reference/events.md#what-the-write-ahead-log-carries) (in development): A reader of the database's write-ahead log learns who made each change and, when switched on, each schema change, from logical messages in the change's own transaction, and maps each table to its resource from the change model `protobase build` writes into the bundle's manifest.
21
21
  - [Polling, then a socket](../reference/live.md#polling-then-a-socket): Apps and Node scripts poll for changes first and switch to a WebSocket after 30 seconds, or at once, falling back to polling while the socket is down.
22
22
  - [Presence](../reference/channels.md#presence) (beta): Apps see who else has a record open and what each of them tracks, such as online or away, for whoever may read the record.
23
- - [Realtime relay](../reference/realtime-relay.md) (in development): Apps hand their realtime connections to a relay, so they and their database can sleep while people stay connected: the app issues connect tickets for signed-in people and visitors, keeps the relay's channel members in step with its members records, tells each channel's members of every change, and closes a session's sockets when it signs out or expires. `protobase dev` runs a relay for the app by itself, downloading Protobase Realtime from its GitHub release on first use. An app on a platform that runs the relay, Protobase Realtime, picks up its address and keys from PROTOBASE_REALTIME_URL, PROTOBASE_REALTIME_APP, PROTOBASE_REALTIME_API_KEY, PROTOBASE_REALTIME_TICKET_KEY and PROTOBASE_REALTIME_PRESENCE_KEY; a value in the config wins. `protobase build` writes the app's events and presence for the relay's apps file into the bundle's manifest, and the platform's PROTOBASE_REALTIME_ENABLED switch, true or false, says when it moves the app, an app without realtime.relay too: its conversation pages with members become its channels, whose members Protobase keeps in an indexed table of its own.
23
+ - [Realtime relay](../reference/realtime-relay.md) (in development): Apps hand their realtime connections to a relay, so they and their database can sleep while people stay connected. [`protobase dev`](../reference/realtime-relay.md#local-development) runs the relay for the app, and on a platform that runs it the app [moves to it when the platform says so](../reference/realtime-relay.md#from-the-platform), with its build's [manifest](../reference/cli.md#the-manifest) telling the platform what it needs.
24
24
  - [Organization-wide relay channels](../reference/realtime-relay.md#organization-wide-channels) (in development): One channel resource holds channels for the whole organization beside channels for the people they list, such as a chat's public and private channels: a record whose members field is null reaches everyone in its organization, and people who join or leave the organization join or leave its channels on their open sockets.
25
25
  - [Relay presence](../reference/realtime-relay.md#presence) (in development): The relay reports who comes online, goes away and goes offline; the app keeps it in a resource of its own, raises that resource's events, so workflows can act when someone goes offline, and tells the people who share a conversation with them, whose sidebar and members page show them online, away or offline.
26
26
  - [Relay in pages](../reference/realtime-relay.md#pages) (in development): Pages follow the relay on one socket: open views stay current from its notices and read again once after a reconnect, conversations show who types, sidebar groups say "typing…" and count unread messages without reading per message, also of a conversation the person was just added to, all by configuration; `client.relay` gives the same from code.
@@ -56,8 +56,7 @@ The token is a JWE (`dir`, A256GCM), so its holder can neither read nor change i
56
56
 
57
57
  | Claim | |
58
58
  | --- | --- |
59
- | `resource` | The resource read. |
60
- | `where` | What the read keeps to, as [filter](api.md#filters) text on the row alone: the soft delete, the tenant, the access row filter, the parents the caller must read, the caller's own filter, and a record read's key. Left out when nothing is kept out. |
59
+ | `subs` | One subscription, `{ resource, where }`. `resource` is the table read, as `schema.table` outside the public schema; a table or schema whose name holds a dot gets no token, since the change stream never takes one. `where` is what the read keeps to, as a condition on the row's columns alone: the soft delete, the tenant, the access row filter, the parents the caller must read, the caller's own filter, and a record read's key. Left out when nothing is kept out. |
61
60
  | `fields` | The fields the read returned. |
62
61
  | `snapshot` | The read's `pg_current_snapshot()`. The whole read runs in one REPEATABLE READ snapshot, so the token tells exactly which transactions the rows include. |
63
62
  | `sub`, `sid` | The signed-in person and their sign-in session, which the token is bound to. |
@@ -66,9 +65,11 @@ The token is a JWE (`dir`, A256GCM), so its holder can neither read nor change i
66
65
 
67
66
  A signed-in person's token expires when their session ends, after an hour at most. A visitor's token lasts an hour, longer than any cache time of the API, which lets none. An API key, an outside app acting for a person and a caller without a session of the app get no token. The token is sealed with a key derived from the [relay](realtime-relay.md)'s ticket key, so an app without a relay gives none.
68
67
 
69
- Conditions that read other rows are evaluated when the token is issued: a parent the caller must read, a `related()` term and a lookup field become the list of keys they match at that moment, such as `in(project_id, 4, 9)`. A record that starts to match one of them later is not in the token, and a role or membership change does not change a token already issued; [refresh](#refreshing-access) the person's pages instead.
68
+ Conditions that read other rows are evaluated when the token is issued: a parent the caller must read, a `related()` term and a lookup field become the list of keys they match at that moment, such as `{"in": ["project_id", [4, 9]]}`. A record that starts to match one of them later is not in the token, and a role or membership change does not change a token already issued; [refresh](#refreshing-access) the person's pages instead.
70
69
 
71
- The server gives no token, and no `Preference-Applied`, when it cannot write the read as conditions on the row alone. <gap>A read cannot get a live token when a record-level read rule decides it, or when it searches a lookup field, because writing those as conditions on the row alone is not implemented.</gap> <gap>A read cannot get a live token longer than 3,000 bytes, such as one whose parents resolve to many keys, because subscribing to a list of keys that long is not implemented.</gap>
70
+ A condition is JSON of one operator: `{"eq": [column, value]}`, `neq`, `lt`, `lte`, `gt` and `gte` for the filter's comparisons, `{"in": [column, [values]]}`, `{"is_null": column}`, and `and`, `or` and `not`. A value is a string, a number or a boolean, written so the change stream compares it with the column as Postgres does: an integer or decimal as a number, a uuid in lower case, a related key as the type of the key it points at, and an integer too long for a JSON number as its text, for equality only.
71
+
72
+ The server gives no token, and no `Preference-Applied`, when it cannot write the read as conditions on the row alone. <gap>A read cannot get a live token when its filter holds a search, `similar`, `regex`, a text pattern, a JSON field term, `now()`, a date or timestamp, an order on text or booleans, a relation to a key of several parts, or a number written in a form the change stream reads differently, because matching those in the change stream as Postgres does is not implemented.</gap> <gap>A read cannot get a live token when a record-level read rule decides it, or when it searches a lookup field, because writing those as conditions on the row alone is not implemented.</gap> <gap>A read cannot get a live token longer than 3,000 bytes, such as one whose parents resolve to many keys, because subscribing to a list of keys that long is not implemented.</gap>
72
73
 
73
74
  ### Refreshing access
74
75