@protobase/cli 0.119.0 → 0.119.2

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.119.0";
2
+ var version = "0.119.2";
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.119.0",
3
+ "version": "0.119.2",
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.119.0",
47
- "@protobase/layout": "0.119.0",
48
- "@protobase/query": "0.119.0",
49
- "@protobase/schema": "0.119.0",
50
- "@protobase/server": "0.119.0",
51
- "@protobase/ui": "0.119.0",
52
- "@protobase/workflows": "0.119.0",
46
+ "@protobase/config": "0.119.2",
47
+ "@protobase/layout": "0.119.2",
48
+ "@protobase/query": "0.119.2",
49
+ "@protobase/schema": "0.119.2",
50
+ "@protobase/server": "0.119.2",
51
+ "@protobase/ui": "0.119.2",
52
+ "@protobase/workflows": "0.119.2",
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",
@@ -8,7 +8,7 @@ React to changes, deliver them to other systems, and run work in the background.
8
8
  - [Change capture](../reference/events.md#how-changes-are-captured): Every change is captured in the database, in the same transaction, whoever made it.
9
9
  - [Webhooks](../reference/webhooks.md#subscription): Events are sent to a URL, an API function or your own code, filtered by event, condition and tenant.
10
10
  - [Signed webhooks](../reference/webhooks.md#what-a-receiver-gets): Deliveries are signed under the Standard Webhooks spec.
11
- - [Delivery retries](../reference/webhooks.md#delivery-and-retries): Failed deliveries are retried for about three days.
11
+ - [Delivery retries](../reference/webhooks.md#delivery-and-retries): Each delivery is a background job of its own, so a slow receiver never holds back live updates or other deliveries; failed ones are retried for about three days.
12
12
  - [Webhooks in the admin app](../reference/webhooks.md#subscriptions-in-the-admin-app): Users create subscriptions, send test events and resend failures in the app.
13
13
  - [Webhook delivery log](../reference/webhooks.md#subscriptions-in-the-admin-app): Every try of the admin app's subscriptions, successes too, is kept for 30 days with its status and timing, when the app turns it on.
14
14
  - [Background jobs](../reference/jobs.md#enqueueing): Jobs are kept in the app's own Postgres and can be queued in the same transaction as a write, also from SQL.
@@ -38,7 +38,7 @@ Sign-in methods, users, roles, organizations and tokens.
38
38
  - [Staff sign-in](../reference/auth.md#staff-sign-in): The team that runs an app signs in as a person to help them, with a reason and a log entry.
39
39
  - [Roles](../reference/auth.md#roles): A user holds one or more roles and switches between them without signing in again.
40
40
  - [Organizations](../reference/auth.md#organizations): People work in one organization at a time, see only its records, and are invited with their own roles.
41
- - [First organization](../reference/auth.md#first-organization-and-start-address) (beta): People outside any organization name their first one in one step, or join one they are invited to, and land on the start address your app sets. You choose the word your app uses for an organization, such as workspace.
41
+ - [First organization](../reference/auth.md#first-organization-and-start-address) (beta): People outside any organization name their first one, called by your app's word such as workspace, in one step, or join one they are invited to, and land on the start address your app sets. The screen says what it is doing while it creates or joins, and lets them try again after a network failure.
42
42
  - [Status](../reference/status.md) (beta): People set themselves busy or do not disturb, with a text of their own such as "Having lunch" and a time it clears, from the user menu; the people they share an organization with see it beside their name, with your app's online or away mark on the members page and in the sidebar.
43
43
  - [API tokens](../reference/auth.md#tokens-and-roles): A signed-in session gets short-lived tokens for the API.
44
44
  - [Immediate revocation](../reference/auth.md#when-a-token-stops-working): A ban, removed role or ended session takes effect on the next request.
@@ -259,7 +259,7 @@ export default { send: async ({ to, subject, text }) => { /* deliver it */ retur
259
259
 
260
260
  ## Name, password and devices
261
261
 
262
- The signed-in person changes their own name and password, and signs out their other devices, with Better Auth's own endpoints. The client has them in `session.account`, each rejecting with `AuthError`:
262
+ The signed-in person changes their own name and password, and signs out their other devices, with Better Auth's own endpoints. The client has them in `session.account`, each rejecting with `AuthError`, or with `NetworkError` when the server cannot be reached:
263
263
 
264
264
  | Client | Endpoint |
265
265
  | --- | --- |
@@ -761,7 +761,7 @@ The app's own pages are under the profile menu: the switcher, "Manage organizati
761
761
  The start address is the same for everyone in an app; it does not yet remember where each person was last.
762
762
  :::
763
763
 
764
- Someone signed in who works in no organization, such as the first person in a new app, sees one screen before anything else, whatever address they opened: at `/-/first-organization`, with the app's mark and no sidebar entries, they name their first organization in one field and press Create. With invitations waiting for their address, the screen lists those first, each with Join, and "Create a new organization instead" leads to the form at `/-/first-organization/new`. Someone who may not create one (`create: 'admins'`) and has no invitation is told to ask for one. The screen names who is signed in, with Sign out, and for someone with a global role links to every organization. Creating or joining opens the app at its start address. Until they work in one, the shell shows none of the app's resources, on the account pages and the organizations page too.
764
+ Someone signed in who works in no organization, such as the first person in a new app, sees one screen before anything else, whatever address they opened: at `/-/first-organization`, with the app's mark and no sidebar entries, they name their first organization in one field and press Create. With invitations waiting for their address, the screen lists those first, each with Join, and "Create a new organization instead" leads to the form at `/-/first-organization/new`. Someone who may not create one (`create: 'admins'`) and has no invitation is told to ask for one. The screen names who is signed in, with Sign out, and for someone with a global role links to every organization. While it creates or joins, the button says so, such as "Creating workspace…" or "Joining Acme…"; when the server cannot be reached, the screen says so and the button works again. <gap>A request the server takes but never answers keeps the button busy until the browser gives up because a time limit on sign-in and organization calls is not implemented.</gap> Creating or joining opens the app at its start address. Until they work in one, the shell shows none of the app's resources, on the account pages and the organizations page too.
765
765
 
766
766
  The word the screens use for an organization is yours: `names` takes it as a view's names are written, and `createDescription` adds a line under the screen's title. The built-in texts around the word come in English and Dutch, on this screen, the organization pages and the profile menu:
767
767
 
@@ -360,7 +360,7 @@ A component that asks for input looks like the app's own forms when it is built
360
360
  | `Choices` | One of a few options, each a card in a row of its own with a `description`: `name`, `label`, `options`, `value`, `onChange`. A `disabled` option shows and cannot be chosen. |
361
361
  | `RecordPicker` | Records of another resource, picked as the create form picks a relation: type to narrow them by their search fields or title, scroll for more, or use the keyboard. `resource` names the resource, whose model it reads from the app; `value` is the chosen record's key as text and `onChange` gets the new one. With `multiple`, `value` and `onChange` hold several keys, such as the objectives a task serves through a join resource: each shows as a token that can be taken off. |
362
362
  | `Segmented`, `MenuSelect` | A switch between a few short options in a row (`size`, `iconOnly`), and the same options in a menu. |
363
- | `Button`, `buttonClass` | A button (`variant` `primary`, `secondary`, `ghost` or `danger`, `size` `sm`, `md` or `icon`, a square for an icon alone, and `loading`), and its classes for a link that looks like one. |
363
+ | `Button`, `buttonClass` | A button (`variant` `primary`, `secondary`, `ghost` or `danger`, `size` `sm`, `md` or `icon`, a square for an icon alone, `loading`, and `busyLabel`, what it says while loading, as a status a screen reader announces), and its classes for a link that looks like one. |
364
364
  | `Dialog`, `ResponsiveDialog` | A modal with a `title`, `description`, `actions` and a body, which Escape and a click outside close with `onClose`; the responsive one becomes a sheet from the bottom of a phone, which follows a finger dragging it down by its header, or by its content once that is scrolled to its top, and closes when flung or let go past a third of its height. |
365
365
 
366
366
  ```tsx
@@ -81,7 +81,7 @@ Filters use the language of [access rules](access.md) and views, on any field, f
81
81
 
82
82
  `protobase migration` adds a `changes` schema to the database, with:
83
83
 
84
- - **`changes.outbox`**, one row per changed row, written in the writer's transaction, so it commits or rolls back with the change. A dispatch job reads the committed rows and deletes them once their events are delivered or queued.
84
+ - **`changes.outbox`**, one row per changed row, written in the writer's transaction, so it commits or rolls back with the change. A dispatch job reads the committed rows and deletes them in the transaction that queues their deliveries, each a job of its own.
85
85
  - **`changes.capture()`**, the trigger function. It runs as its owner, with a fixed search path, so a role that writes the table needs no rights on `changes`: another service writing as its own role keeps working once a resource has events.
86
86
  - **Two triggers per resource with events, history, [live updates](live.md) or [derived values](derived.md), or read by a derived value**, on its table: `<table>_changes` for inserts and deletes, and `<table>_changes_update` for updates that change the row.
87
87
 
@@ -90,13 +90,13 @@ A function target is called as the subscription's `as`, so `context.caller()` an
90
90
 
91
91
  ## Delivery and retries
92
92
 
93
- - **The first try** goes out from the dispatch job, right after the write: within milliseconds for a write through the API, within two seconds for one from elsewhere.
94
- - **A failed try** becomes a `webhooks.deliver` job, retried on the Standard Webhooks schedule with up to 10% jitter: 5 s, 5 m, 30 m, 2 h, 5 h, 10 h, 14 h, 20 h and 24 h, 10 tries over about three days. A `Retry-After` header makes the wait longer, up to a day.
93
+ - **Every delivery is a job of its own:** the dispatch job queues a `webhooks.deliver` job for each delivery, in the transaction that writes the change's history and live notices, and tries none itself, so a slow receiver never holds back a live update or another delivery. A worker makes the first try right after the write: within milliseconds for a write through the API, within two seconds for one from elsewhere.
94
+ - **A failed try** queues the next `webhooks.deliver` job, retried on the Standard Webhooks schedule with up to 10% jitter: 5 s, 5 m, 30 m, 2 h, 5 h, 10 h, 14 h, 20 h and 24 h, 10 tries over about three days. A `Retry-After` header makes the wait longer, up to a day.
95
95
  - **`410 Gone`** fails the delivery at once.
96
96
  - **After the last try** the job is kept as failed, on the [failed jobs page](jobs.md#failed-jobs-page), where it can be retried.
97
- - **Ordered subscriptions** get no first try from the dispatch job: a `webhooks.deliver-ordered` job delivers a record's events of one dispatch in order, retried with doubling waits from 5 s up to a day, 10 tries. Meanwhile the record's later events to that subscription wait. A retry sends again the events of that job that went through before the one that failed.
97
+ - **Ordered subscriptions** get one `webhooks.deliver-ordered` job instead: it delivers a record's events of one dispatch in order, retried with doubling waits from 5 s up to a day, 10 tries. Meanwhile the record's later events to that subscription wait. A retry sends again the events of that job that went through before the one that failed.
98
98
  - **Every retry and resend follows the subscription as it is now:** its event leaves out fields that became sensitive since it was first made, and a subscription with `as` roles that may no longer read the record gets nothing. <gap>A retry of a thin event cannot check the row rules of `as` roles again because reading the current record for it is not implemented.</gap>
99
- - **At least once:** a process that stops after delivering but before recording it delivers again when the dispatch job is retried, under the same `webhook-id`.
99
+ - **At least once:** a process that stops after delivering but before recording it delivers again when its delivery job is retried, under the same `webhook-id`.
100
100
  - **Event code that throws**, such as a `match` that reads a field it did not expect to be empty, a subscription's `when` or an access rule of its `as` roles, keeps that change as a failed `webhooks.dispatch-change` job on the failed jobs page, naming the event or subscription and the error, and dispatch moves on to later changes. Retry it once the code is fixed to deliver the change's events. An access rule of `as` roles keeps the change as failed for that subscription only: the other subscriptions still receive it, and the retry delivers it to that subscription alone. A database error instead fails the whole dispatch job, which is retried.
101
101
 
102
102
  Every outcome is a line in the server log, such as `webhook newOrdersToSlack orders.created evt_48211_created delivered (200)`.