@protobase/cli 0.51.1 → 0.51.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.
package/dist/cli/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@protobase/cli",
|
|
3
|
-
"version": "0.51.
|
|
3
|
+
"version": "0.51.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": {
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@better-auth/core": "^1.7.12",
|
|
44
44
|
"@hono/node-server": "^2.1.3",
|
|
45
|
-
"@protobase/config": "0.51.
|
|
46
|
-
"@protobase/layout": "0.51.
|
|
47
|
-
"@protobase/query": "0.51.
|
|
48
|
-
"@protobase/schema": "0.51.
|
|
49
|
-
"@protobase/server": "0.51.
|
|
50
|
-
"@protobase/ui": "0.51.
|
|
45
|
+
"@protobase/config": "0.51.2",
|
|
46
|
+
"@protobase/layout": "0.51.2",
|
|
47
|
+
"@protobase/query": "0.51.2",
|
|
48
|
+
"@protobase/schema": "0.51.2",
|
|
49
|
+
"@protobase/server": "0.51.2",
|
|
50
|
+
"@protobase/ui": "0.51.2",
|
|
51
51
|
"@react-email/render": "^2.1.0",
|
|
52
52
|
"@scalar/hono-api-reference": "^0.12.10",
|
|
53
53
|
"@tailwindcss/vite": "^4.3.3",
|
|
@@ -10,5 +10,5 @@ Apps written for other systems that keep working on Protobase, and moving their
|
|
|
10
10
|
- [Supabase client API](../reference/supabase-rest.md): supabase-js `from()` and `rpc()` calls keep working, under the tables' RLS policies.
|
|
11
11
|
- [Supabase Auth](../reference/auth.md#supabase-js-and-supabasessr): `supabase.auth` and `@supabase/ssr` calls keep working.
|
|
12
12
|
- [Supabase Storage](../reference/supabase-storage.md): supabase-js storage calls keep working, over the app's file storage.
|
|
13
|
-
- [Supabase Realtime](../reference/supabase-realtime.md): Database changes, broadcast and presence through supabase-js channels, private ones authorized by the policies on `realtime.messages
|
|
13
|
+
- [Supabase Realtime](../reference/supabase-realtime.md): Database changes, broadcast and presence through supabase-js channels, private ones authorized by the policies on `realtime.messages`, and broadcasts sent from a server without joining a channel.
|
|
14
14
|
- [Edge Functions](../guides/api-functions.md#functions-moved-from-supabase): Functions moved from Supabase answer at their old addresses.
|
|
@@ -28,7 +28,7 @@ A channel may listen to the tables of the resources with [`.live()`](live.md), b
|
|
|
28
28
|
|
|
29
29
|
## Broadcast and presence
|
|
30
30
|
|
|
31
|
-
Channels on the same topic exchange broadcasts and see each other's presence, as on Supabase:
|
|
31
|
+
Channels on the same topic exchange broadcasts and see each other's presence, as on Supabase, private channels among themselves and public ones among themselves:
|
|
32
32
|
|
|
33
33
|
```ts
|
|
34
34
|
const room = supabase.channel('room', { config: { broadcast: { self: false, ack: true }, presence: { key: 'alice' } } })
|
|
@@ -46,7 +46,19 @@ A broadcast reaches the topic's other channels, and the sender's own with `self`
|
|
|
46
46
|
|
|
47
47
|
Limits, near Supabase's Free plan, apply per socket and per topic. A socket sends at most 100 broadcast and presence messages a second, joins at most 100 times a second and holds at most 100 channels; on each channel it sends at most 5 presence updates in 30 seconds, also counted across a rejoin. A topic takes 100 broadcasts a second, whoever sends them, so one busy sender can use up a topic's budget. A topic is at most 255 bytes, and a tracked presence at most 10 000 bytes of JSON. A message over a limit gets an error reply and goes to no one, where Supabase would close the channel. A frame over 256 KiB closes the socket with 1009. It closes with 1008 when the client leaves more than 4 MiB unread, or sends more than 300 messages or 4 MiB while earlier ones wait, such as behind a token check.
|
|
48
48
|
|
|
49
|
-
Broadcasts and presence go between the channels of one serving process, which is how a cloud app runs; <gap>Several processes behind one address do not reach each other's channels, because broadcasts and presence are not shared between processes.</gap>
|
|
49
|
+
Broadcasts and presence go between the channels of one serving process, which is how a cloud app runs; <gap>Several processes behind one address do not reach each other's channels, because broadcasts and presence are not shared between processes.</gap>
|
|
50
|
+
|
|
51
|
+
### Broadcast without a channel
|
|
52
|
+
|
|
53
|
+
A backend or an edge function broadcasts without joining a channel, as on Supabase: supabase-js's `httpSend()`, and `send()` on a channel that has not joined, send it over `POST /api/sb/realtime/v1/api/broadcast`. The request carries the app's key in `apikey` and, for a user, their token in its bearer, as the socket does, and is answered `202`; one without a key of the app is refused with `401`.
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
const room = supabase.channel('room')
|
|
57
|
+
await room.httpSend('cursor', { x: 1, y: 2 })
|
|
58
|
+
await supabase.removeChannel(room)
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
`POST /api/sb/realtime/v1/api/broadcast` takes Supabase's batch, `{ "messages": [{ "topic": "room", "event": "cursor", "payload": { "x": 1 }, "private": false }] }`, of at most 100 messages, each with an object payload. `httpSend()` sends one message to `POST /api/sb/realtime/v1/api/broadcast/<topic>/events/<event>`, `?private=true` for a private one, with a JSON object or, as `application/octet-stream`, binary bytes. A message reaches the channels joined on its topic in this process, under a broadcast's limits: a body is at most 256 KiB, a topic and an event at most 255 bytes each, and a request that would take a topic over its 100 broadcasts a second is refused with `429` and reaches no one. A public message reaches the topic's public channels; a private one reaches only its private channels that may receive broadcasts, and only when the caller may send broadcasts there by the [policies on `realtime.messages`](#private-channels): a batch drops one it may not send, as Supabase does, and `httpSend()` is refused with `403`. <gap>A policy cannot read a broadcast request's headers in `request.headers` because passing them to the checks is not implemented.</gap>
|
|
50
62
|
|
|
51
63
|
## Private channels
|
|
52
64
|
|