@protobase/cli 0.58.7 → 0.59.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/dist/dev/api-websockets.js +1 -1
- package/dist/dev/entry.js +4 -1
- package/dist/migration/load-project.js +4 -1
- package/dist/serve/lifecycle.js +4 -1
- package/dist/supabase/auth-config.js +6 -3
- package/package.json +7 -7
- package/skills/protobase/SKILL.md +1 -0
- package/skills/protobase/references/features/access.md +1 -1
- package/skills/protobase/references/features/actions.md +1 -1
- package/skills/protobase/references/features/ai.md +1 -1
- package/skills/protobase/references/features/api-functions.md +1 -1
- package/skills/protobase/references/features/build-and-run.md +1 -1
- package/skills/protobase/references/features/calls.md +1 -1
- package/skills/protobase/references/features/compatibility.md +1 -1
- package/skills/protobase/references/features/composed-pages.md +1 -1
- package/skills/protobase/references/features/data-model.md +1 -1
- package/skills/protobase/references/features/email-and-public-forms.md +1 -1
- package/skills/protobase/references/features/events-webhooks-and-jobs.md +1 -1
- package/skills/protobase/references/features/files-and-images.md +1 -1
- package/skills/protobase/references/features/history-comments-and-live-updates.md +3 -1
- package/skills/protobase/references/features/list-displays.md +1 -1
- package/skills/protobase/references/features/lists.md +1 -1
- package/skills/protobase/references/features/look-and-language.md +1 -1
- package/skills/protobase/references/features/navigation.md +1 -1
- package/skills/protobase/references/features/notifications.md +1 -1
- package/skills/protobase/references/features/record-pages.md +1 -1
- package/skills/protobase/references/features/releases.md +1 -1
- package/skills/protobase/references/features/rest-api.md +1 -1
- package/skills/protobase/references/features/several-apps.md +1 -1
- package/skills/protobase/references/features/sign-in-and-accounts.md +1 -1
- package/skills/protobase/references/features/start-a-project.md +1 -1
- package/skills/protobase/references/features/your-own-code.md +1 -1
- package/skills/protobase/references/features.md +1 -1
- package/skills/protobase/references/getting-started.md +2 -2
- package/skills/protobase/references/guides/api-functions.md +3 -2
- package/skills/protobase/references/guides/billing-page.md +1 -1
- package/skills/protobase/references/guides/create-page.md +1 -1
- package/skills/protobase/references/guides/deploy.md +1 -1
- package/skills/protobase/references/guides/existing-database.md +1 -1
- package/skills/protobase/references/guides/export-a-list.md +1 -1
- package/skills/protobase/references/guides/field-type.md +1 -1
- package/skills/protobase/references/guides/first-composed-page.md +1 -1
- package/skills/protobase/references/guides/first-plugin.md +1 -1
- package/skills/protobase/references/guides/import-records.md +1 -1
- package/skills/protobase/references/guides/mobile-app.md +1 -1
- package/skills/protobase/references/guides/personal-setting.md +1 -1
- package/skills/protobase/references/guides/plugin-build.md +1 -1
- package/skills/protobase/references/guides/push-notifications.md +1 -1
- package/skills/protobase/references/guides/record-card.md +1 -1
- package/skills/protobase/references/guides/remote-resources.md +1 -1
- package/skills/protobase/references/guides/table-to-admin.md +1 -1
- package/skills/protobase/references/guides/theme-an-app.md +1 -1
- package/skills/protobase/references/reference/access.md +1 -1
- package/skills/protobase/references/reference/ai.md +1 -1
- package/skills/protobase/references/reference/api.md +1 -1
- package/skills/protobase/references/reference/app-identity.md +1 -1
- package/skills/protobase/references/reference/architecture.md +3 -3
- package/skills/protobase/references/reference/assistant.md +1 -1
- package/skills/protobase/references/reference/auth.md +5 -4
- package/skills/protobase/references/reference/blocks.md +1 -1
- package/skills/protobase/references/reference/bottom-bar.md +1 -1
- package/skills/protobase/references/reference/calls.md +1 -1
- package/skills/protobase/references/reference/channels.md +93 -0
- package/skills/protobase/references/reference/cli.md +2 -2
- package/skills/protobase/references/reference/client.md +2 -2
- package/skills/protobase/references/reference/comments.md +1 -1
- package/skills/protobase/references/reference/config/admin-app.md +1 -1
- package/skills/protobase/references/reference/config/api.md +2 -2
- package/skills/protobase/references/reference/config/app.md +1 -1
- package/skills/protobase/references/reference/config/files.md +1 -1
- package/skills/protobase/references/reference/config/jobs-and-events.md +1 -1
- package/skills/protobase/references/reference/config/sign-in.md +4 -4
- package/skills/protobase/references/reference/config.md +1 -1
- package/skills/protobase/references/reference/custom-components.md +1 -1
- package/skills/protobase/references/reference/data-config.md +1 -1
- package/skills/protobase/references/reference/email.md +1 -1
- package/skills/protobase/references/reference/events.md +1 -1
- package/skills/protobase/references/reference/files.md +1 -1
- package/skills/protobase/references/reference/forms.md +1 -1
- package/skills/protobase/references/reference/history.md +1 -1
- package/skills/protobase/references/reference/installable-app.md +1 -1
- package/skills/protobase/references/reference/jobs.md +1 -1
- package/skills/protobase/references/reference/languages.md +1 -1
- package/skills/protobase/references/reference/layouts.md +1 -1
- package/skills/protobase/references/reference/live.md +4 -2
- package/skills/protobase/references/reference/mcp.md +1 -1
- package/skills/protobase/references/reference/notifications.md +1 -1
- package/skills/protobase/references/reference/plugins.md +1 -1
- package/skills/protobase/references/reference/remote-resources.md +1 -1
- package/skills/protobase/references/reference/sidebar.md +1 -1
- package/skills/protobase/references/reference/supabase-realtime.md +2 -2
- package/skills/protobase/references/reference/supabase-rest.md +1 -1
- package/skills/protobase/references/reference/supabase-storage.md +1 -1
- package/skills/protobase/references/reference/theme.md +1 -1
- package/skills/protobase/references/reference/ui-config.md +1 -1
- package/skills/protobase/references/reference/user-menu.md +1 -1
- package/skills/protobase/references/reference/versioning.md +1 -1
- package/skills/protobase/references/reference/webhooks.md +1 -1
package/dist/cli/package.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isAllowedHost } from "./allowed-host.js";
|
|
2
2
|
//#region src/dev/api-websockets.ts
|
|
3
|
-
const isApiWebSocket = (url) => /^\/api\/sb\/realtime\/v1\/websocket(\?|$)/.test(url) || /^\/api\/functions\/[^/?#]+(\/|\?|$)/.test(url);
|
|
3
|
+
const isApiWebSocket = (url) => /^\/api\/sb\/realtime\/v1\/websocket(\?|$)/.test(url) || /^\/api\/channels(\?|$)/.test(url) || /^\/api\/functions\/[^/?#]+(\/|\?|$)/.test(url);
|
|
4
4
|
/**
|
|
5
5
|
* The listener for Vite's `upgrade` event: an API socket goes to `forward` once its Host passes Vite's host check, as
|
|
6
6
|
* every other dev request does, and is refused with 403 otherwise; any other upgrade is left to Vite.
|
package/dist/dev/entry.js
CHANGED
|
@@ -26,7 +26,10 @@ if (project.auth) await checkResourcesOutsideAuthStore(db, resources.map((resour
|
|
|
26
26
|
await checkChanges(db, resources.map((resource) => resource.toModel()), project.events);
|
|
27
27
|
await checkComments(db, resources.map((resource) => resource.toModel()));
|
|
28
28
|
await checkComputed(db, resources.map((resource) => resource.toModel()));
|
|
29
|
-
if (assistantSettings(project.options?.assistant, process.env)?.kind === "built-in") await checkQueryRunner(db, project.auth ? authStoreTables(project.auth) :
|
|
29
|
+
if (assistantSettings(project.options?.assistant, process.env)?.kind === "built-in") await checkQueryRunner(db, project.auth ? authStoreTables(project.auth) : {
|
|
30
|
+
tables: [],
|
|
31
|
+
schemas: []
|
|
32
|
+
});
|
|
30
33
|
checkAi({
|
|
31
34
|
models: resources.map((resource) => resource.toModel()),
|
|
32
35
|
views: views.map((source) => source.toModel()),
|
|
@@ -42,7 +42,10 @@ const migrationProject = async (config, url) => {
|
|
|
42
42
|
...notifications && { notifications },
|
|
43
43
|
jobs,
|
|
44
44
|
readOnlyQueries: assistantSettings(config.assistant, process.env)?.kind === "built-in",
|
|
45
|
-
authTables: auth ? authStoreTables(auth) :
|
|
45
|
+
authTables: auth ? authStoreTables(auth) : {
|
|
46
|
+
tables: [],
|
|
47
|
+
schemas: []
|
|
48
|
+
},
|
|
46
49
|
close: async () => {
|
|
47
50
|
await database.db.destroy();
|
|
48
51
|
}
|
package/dist/serve/lifecycle.js
CHANGED
|
@@ -32,7 +32,10 @@ const startServe = async ({ config, env, openDb = (url) => openAppDatabase(pg, u
|
|
|
32
32
|
if (env.startupChecks) await checkChanges(db, resources.map((resource) => resource.toModel()), project.events);
|
|
33
33
|
if (env.startupChecks) await checkComments(db, resources.map((resource) => resource.toModel()));
|
|
34
34
|
if (env.startupChecks) await checkComputed(db, resources.map((resource) => resource.toModel()));
|
|
35
|
-
if (env.startupChecks && assistantSettings(project.options?.assistant, process.env)?.kind === "built-in") await checkQueryRunner(db, project.auth ? authStoreTables(project.auth) :
|
|
35
|
+
if (env.startupChecks && assistantSettings(project.options?.assistant, process.env)?.kind === "built-in") await checkQueryRunner(db, project.auth ? authStoreTables(project.auth) : {
|
|
36
|
+
tables: [],
|
|
37
|
+
schemas: []
|
|
38
|
+
});
|
|
36
39
|
if (env.startupChecks) checkAi({
|
|
37
40
|
models: resources.map((resource) => resource.toModel()),
|
|
38
41
|
views: views.map((source) => source.toModel()),
|
|
@@ -9,7 +9,8 @@ const supabaseUsers = {
|
|
|
9
9
|
users: {
|
|
10
10
|
table: "users",
|
|
11
11
|
columns: { role: "app_role" },
|
|
12
|
-
metadata: "raw_user_meta_data"
|
|
12
|
+
metadata: "raw_user_meta_data",
|
|
13
|
+
guardedSchemas: ["auth"]
|
|
13
14
|
},
|
|
14
15
|
passwordHashes: ["bcrypt"],
|
|
15
16
|
generateUserId: "uuid"
|
|
@@ -34,7 +35,8 @@ const importedUsersConfig = {
|
|
|
34
35
|
comment: [
|
|
35
36
|
"Supabase's own auth.users as the app's user table, written by `protobase import supabase`: every foreign key,",
|
|
36
37
|
"trigger and policy naming it keeps working. Its passwords are bcrypt hashes, its ids UUIDs, and its `role` the",
|
|
37
|
-
"Postgres role, so the app's roles go to a column of their own."
|
|
38
|
+
"Postgres role, so the app's roles go to a column of their own. No resource may be over a table of auth, where",
|
|
39
|
+
"Supabase Auth keeps its sessions, tokens and secrets, and the assistant never reads one."
|
|
38
40
|
]
|
|
39
41
|
};
|
|
40
42
|
const sharedUsersConfig = {
|
|
@@ -43,7 +45,8 @@ const sharedUsersConfig = {
|
|
|
43
45
|
`Supabase's users, read through the view ${sharedUsersSchema}.users over auth.users, written by \`create protobase\`: the app`,
|
|
44
46
|
`keeps only its own sign-in data, in ${sharedUsersSchema}, and Supabase's auth schema stays as Supabase set it up. Their`,
|
|
45
47
|
"passwords are bcrypt hashes, their ids UUIDs, and `role` in auth.users the Postgres role, so the app's roles go to a",
|
|
46
|
-
"column of their own."
|
|
48
|
+
"column of their own. No resource may be over a table of auth, where Supabase Auth keeps its sessions, tokens and",
|
|
49
|
+
"secrets, and the assistant never reads one."
|
|
47
50
|
]
|
|
48
51
|
};
|
|
49
52
|
const literal = (value) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@protobase/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.59.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": {
|
|
@@ -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.
|
|
46
|
-
"@protobase/layout": "0.
|
|
47
|
-
"@protobase/query": "0.
|
|
48
|
-
"@protobase/schema": "0.
|
|
49
|
-
"@protobase/server": "0.
|
|
50
|
-
"@protobase/ui": "0.
|
|
45
|
+
"@protobase/config": "0.59.0",
|
|
46
|
+
"@protobase/layout": "0.59.0",
|
|
47
|
+
"@protobase/query": "0.59.0",
|
|
48
|
+
"@protobase/schema": "0.59.0",
|
|
49
|
+
"@protobase/server": "0.59.0",
|
|
50
|
+
"@protobase/ui": "0.59.0",
|
|
51
51
|
"@react-email/render": "^2.1.0",
|
|
52
52
|
"@scalar/hono-api-reference": "^0.12.10",
|
|
53
53
|
"@tailwindcss/vite": "^4.3.3",
|
|
@@ -82,6 +82,7 @@ Reference:
|
|
|
82
82
|
- When keeping or showing the changes of records → read [Record history](references/reference/history.md)
|
|
83
83
|
- When adding comments to records → read [Record comments](references/reference/comments.md)
|
|
84
84
|
- When open pages should refresh as records change → read [Live updates](references/reference/live.md)
|
|
85
|
+
- When pages on a record should see who else is there or send each other short-lived events (presence, broadcast) → read [Channels](references/reference/channels.md)
|
|
85
86
|
- When an app uses supabase-js Realtime (`postgres_changes` under RLS, broadcast, presence) → read [Supabase Realtime](references/reference/supabase-realtime.md)
|
|
86
87
|
- When filling fields with a model → read [AI fields and actions](references/reference/ai.md)
|
|
87
88
|
- When letting people without an account create records → read [Public forms](references/reference/forms.md)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/features/access.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/features/access.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# Access
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/features/actions.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/features/actions.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# Actions
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/features/ai.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/features/ai.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# AI
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/features/api-functions.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/features/api-functions.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# API functions
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/features/build-and-run.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/features/build-and-run.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# Build and run
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/features/calls.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/features/calls.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# Calls
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/features/compatibility.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/features/compatibility.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# Compatibility and moving from other systems
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/features/composed-pages.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/features/composed-pages.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# Composed pages
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/features/data-model.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/features/data-model.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# Data model
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/features/email-and-public-forms.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/features/email-and-public-forms.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# Email and public forms
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/features/events-webhooks-and-jobs.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/features/events-webhooks-and-jobs.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# Events, webhooks and jobs
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/features/files-and-images.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/features/files-and-images.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# Files and images
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/features/history-comments-and-live-updates.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/features/history-comments-and-live-updates.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# History, comments and live updates
|
|
4
4
|
|
|
@@ -12,3 +12,5 @@ The changes of each record, comments on it, and pages that refresh as records ch
|
|
|
12
12
|
- [Comment moderation](../reference/comments.md#moderation): Admins find and delete comments across the app.
|
|
13
13
|
- [Live updates](../reference/live.md#what-a-page-hears): Open lists and record pages refresh within seconds when a record changes, including changes made outside the API.
|
|
14
14
|
- [Change stream](../reference/live.md#the-stream): Apps follow record changes over a stream that catches up after a reconnect.
|
|
15
|
+
- [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.
|
|
16
|
+
- [Broadcasts](../reference/channels.md#broadcasts) (beta): Apps on a record send each other short-lived events, such as typing, which are never stored; the app's own code sends them too.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/features/list-displays.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/features/list-displays.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# List displays
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/features/lists.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/features/lists.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# Lists
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/features/look-and-language.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/features/look-and-language.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# Look and language
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/features/navigation.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/features/navigation.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# Navigation
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/features/notifications.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/features/notifications.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# Notifications
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/features/record-pages.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/features/record-pages.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# Record pages
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/features/releases.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/features/releases.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# Releases
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/features/rest-api.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/features/rest-api.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# REST API
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/features/several-apps.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/features/several-apps.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# Several apps
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/features/sign-in-and-accounts.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/features/sign-in-and-accounts.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# Sign-in and accounts
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/features/start-a-project.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/features/start-a-project.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# Start a project
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/features/your-own-code.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/features/your-own-code.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# Your own code
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/features.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/features.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# Features
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/getting-started.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/getting-started.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# Getting started
|
|
4
4
|
|
|
@@ -143,7 +143,7 @@ bun run --cwd tests/apps/property-portal dev # http://localhost:517
|
|
|
143
143
|
| `bun run screenshots` / `bun run screenshots:dark` | screenshots of the stories tagged `website`, in light into `screenshots/`, in dark into `screenshots/dark/` |
|
|
144
144
|
| `bun run build:serve` | the serve runtime, `dist/protobase-serve.js` (see [Deploy](guides/deploy.md)) |
|
|
145
145
|
| `bun run docs:dev` | this site on port 4321 |
|
|
146
|
-
| `bun run docs:build` | this site, built into `website/dist/`; fails on broken links |
|
|
146
|
+
| `bun run docs:build` | this site, built into `docs/website/dist/`; fails on broken links |
|
|
147
147
|
| `bun run release --dry-run` | the next version and its changelog, from the commits since the last release (see [Versioning](reference/versioning.md)) |
|
|
148
148
|
| `bun run docs:check` | opens every page of the built site in Chromium and fails on console errors and failed requests; `BASE=https://docs.protobase.net` checks the live site |
|
|
149
149
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/guides/api-functions.mdx: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/guides/api-functions.mdx: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# Your own API functions
|
|
4
4
|
|
|
@@ -53,9 +53,10 @@ The second argument of a handler (`c.env` in a [Hono app](#hono-apps)):
|
|
|
53
53
|
| `decryptField(resource, key, field)` | An [encrypted field](../reference/data-config.md#reading-in-jobs-and-functions)'s value, skipping access rules like `db`; each read is audited, naming the function and the caller. |
|
|
54
54
|
| `acceptWebSocket(events)` | Answers a WebSocket upgrade with a socket; return its response. See [WebSockets](#websockets). |
|
|
55
55
|
| `calls.join(member)` | The events of a member's socket in a call, for `acceptWebSocket`. See [Calls](../reference/calls.md). |
|
|
56
|
+
| `channels` | `channels.broadcast({ resource, key, event, payload })` sends to whoever is on a record's [channel](../reference/channels.md#from-the-server), as the server. |
|
|
56
57
|
| `name` | The function's name. |
|
|
57
58
|
|
|
58
|
-
A [public function](#public-functions-and-webhooks) has only `db`, `caller()`, `acceptWebSocket`, `calls` and `name`.
|
|
59
|
+
A [public function](#public-functions-and-webhooks) has only `db`, `caller()`, `acceptWebSocket`, `calls`, `channels` and `name`.
|
|
59
60
|
|
|
60
61
|
## Reading and writing records as the caller
|
|
61
62
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/guides/billing-page.mdx: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/guides/billing-page.mdx: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# A billing page
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/guides/create-page.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/guides/create-page.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# A create page of your own
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/guides/deploy.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/guides/deploy.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# Deploy
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/guides/existing-database.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/guides/existing-database.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# Admin over an existing database
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/guides/export-a-list.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/guides/export-a-list.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# Exporting a list
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/guides/field-type.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/guides/field-type.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# Adding a field type
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/guides/first-composed-page.mdx: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/guides/first-composed-page.mdx: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# Your first composed page
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/guides/first-plugin.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/guides/first-plugin.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# Your first plugin
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/guides/import-records.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/guides/import-records.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# Importing records from a spreadsheet
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/guides/mobile-app.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/guides/mobile-app.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# A mobile app
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/guides/personal-setting.mdx: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/guides/personal-setting.mdx: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# Add a personal setting
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/guides/plugin-build.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/guides/plugin-build.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# Moving onto the plugin build
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/guides/push-notifications.mdx: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/guides/push-notifications.mdx: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# Send notifications
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/guides/record-card.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/guides/record-card.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# A custom record card
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/guides/remote-resources.mdx: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/guides/remote-resources.mdx: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# Showing another app's records
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/guides/table-to-admin.mdx: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/guides/table-to-admin.mdx: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# From a table to an admin
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/guides/theme-an-app.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/guides/theme-an-app.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# Theming an app
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/reference/access.mdx: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/reference/access.mdx: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# Access
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/reference/ai.mdx: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/reference/ai.mdx: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# AI fields and actions
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/reference/api.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/reference/api.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# REST API
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/reference/app-identity.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/reference/app-identity.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# App identity
|
|
4
4
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/reference/architecture.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/reference/architecture.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# Architecture
|
|
4
4
|
|
|
5
5
|
How the packages are laid out, which package may import which, and where tests and stories live.
|
|
6
6
|
|
|
7
|
-
A Bun workspace of npm packages under the `@protobase` scope, in `packages/<name>`, all released together at one version. `tests/apps/*`, the example apps the tests run on and the presets are written from, are workspace members that consume the packages; `website` is this documentation site (Astro with Starlight), also a workspace member. The workspace root is private and is not published.
|
|
7
|
+
A Bun workspace of npm packages under the `@protobase` scope, in `packages/<name>`, all released together at one version. `tests/apps/*`, the example apps the tests run on and the presets are written from, are workspace members that consume the packages; `docs/website` is this documentation site (Astro with Starlight), also a workspace member. The workspace root is private and is not published.
|
|
8
8
|
|
|
9
9
|
## Packages
|
|
10
10
|
|
|
@@ -63,6 +63,6 @@ Filters are Google AIP-160 text. Parsing, printing, `order_by` and the generic c
|
|
|
63
63
|
|
|
64
64
|
## Documentation
|
|
65
65
|
|
|
66
|
-
`website/` is this site. `bun run docs:dev` serves it on port 4321; `bun run docs:build` writes `website/dist/` and fails on a broken internal link or anchor, so CI runs it on every pull request, followed by `bun run docs:check`, which opens every page in Chromium and fails on a console error or a failed request. Pages are Markdown or MDX in `website/src/content/docs/`, and the sidebar is listed in `website/sidebar.mjs`.
|
|
66
|
+
`docs/website/` is this site. `bun run docs:dev` serves it on port 4321; `bun run docs:build` writes `docs/website/dist/` and fails on a broken internal link or anchor, so CI runs it on every pull request, followed by `bun run docs:check`, which opens every page in Chromium and fails on a console error or a failed request. Pages are Markdown or MDX in `docs/website/src/content/docs/`, and the sidebar is listed in `docs/website/sidebar.mjs`.
|
|
67
67
|
|
|
68
68
|
Every push to `main` builds the site and deploys it, and so does running the workflow by hand (`gh workflow run docs.yml`); either way it deploys to the Cloudflare Pages project `protobase-docs`, served at `docs.protobase.net` (`.github/workflows/docs.yml`). The workflow reads the Cloudflare account id from the repository variable `CLOUDFLARE_ACCOUNT_ID` and a token with Cloudflare Pages edit permission from the repository secret `CLOUDFLARE_API_TOKEN`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/reference/assistant.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/reference/assistant.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# Assistant
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/reference/auth.md: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/reference/auth.md: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# Login with Better Auth
|
|
4
4
|
|
|
@@ -52,13 +52,14 @@ The store can use a users table another system made, such as Supabase's `auth.us
|
|
|
52
52
|
|
|
53
53
|
```ts
|
|
54
54
|
auth: {
|
|
55
|
-
users: { table: 'users', columns: { role: 'app_role' }, metadata: 'raw_user_meta_data' },
|
|
55
|
+
users: { table: 'users', columns: { role: 'app_role' }, metadata: 'raw_user_meta_data', guardedSchemas: ['auth'] },
|
|
56
56
|
passwordHashes: ['bcrypt'],
|
|
57
57
|
generateUserId: 'uuid',
|
|
58
58
|
}
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
- `users.table` names the table, default `user`. `users.columns` maps a column, by the name Protobase gives it (`name`, `email`, `email_verified`, `email_confirmed_at`, `image`, `created_at`, `updated_at`, `role`, `banned`, `ban_reason`, `ban_expires`, `two_factor_enabled`, `last_role`, `last_organization_id`), to the table's own; here the app's roles go to `app_role`, since Supabase's `role` holds the Postgres role. The other tables keep their names and point at this one.
|
|
62
|
+
- `users.guardedSchemas` names the schemas where the other system keeps the rest of its sign-in data, such as Supabase Auth's `auth`, with its identities, sessions, refresh tokens and two-factor secrets. Every table in them, including one the other system adds later, counts among the store's tables: no resource may be over it and the assistant's queries never read it. Name only a schema that holds none of the app's own tables.
|
|
62
63
|
- `users.metadata` names a JSON column for each user's metadata, which the migrations add as `jsonb` when the table lacks it: `createUser(auth, { ..., metadata: { full_name: 'Carol' } })` writes it, so a trigger that reads `raw_user_meta_data->>'full_name'` sees it.
|
|
63
64
|
- `passwordHashes: ['bcrypt']` also verifies bcrypt hashes (`$2a$`, `$2b$`, `$2y$`), and stores the password again as Better Auth's own scrypt after its first sign-in. The 12-character minimum holds for new passwords only, so a shorter existing one still signs in.
|
|
64
65
|
- `generateUserId: 'uuid'` makes each new user's id a random UUID in the server, for a table whose `id` is a `uuid` without a default, and makes every id column of the other tables a `uuid` too.
|
|
@@ -72,13 +73,13 @@ Where the app may not change the other system's users table, as on a Supabase da
|
|
|
72
73
|
```ts
|
|
73
74
|
auth: {
|
|
74
75
|
schema: 'app_auth',
|
|
75
|
-
users: { table: 'users', keyTable: { schema: 'auth', table: 'users' }, columns: { role: 'app_role' }, metadata: 'raw_user_meta_data' },
|
|
76
|
+
users: { table: 'users', keyTable: { schema: 'auth', table: 'users' }, guardedSchemas: ['auth'], columns: { role: 'app_role' }, metadata: 'raw_user_meta_data' },
|
|
76
77
|
passwordHashes: ['bcrypt'],
|
|
77
78
|
generateUserId: 'uuid',
|
|
78
79
|
}
|
|
79
80
|
```
|
|
80
81
|
|
|
81
|
-
The store's migrations then make nothing of the user table, which a migration of the project's own makes as a view with an `instead of` trigger for Better Auth's writes, and every foreign key points at the key table. `protobase dev` compares the view's columns with what Better Auth needs, rather than reporting it as a missing table. The key table counts among the store's tables, so no resource may be over it and the assistant's queries never read it, since it holds the other system's password hashes. On a Supabase database, [`npm create protobase`](../getting-started.md#on-an-existing-database) writes these settings and the view.
|
|
82
|
+
The store's migrations then make nothing of the user table, which a migration of the project's own makes as a view with an `instead of` trigger for Better Auth's writes, and every foreign key points at the key table. `protobase dev` compares the view's columns with what Better Auth needs, rather than reporting it as a missing table. The key table counts among the store's tables, so no resource may be over it and the assistant's queries never read it, since it holds the other system's password hashes. The key table's schema is not guarded on its own, since it may hold the app's tables; `users.guardedSchemas` guards the other system's other tables, here Supabase Auth's whole `auth` schema. On a Supabase database, [`npm create protobase`](../getting-started.md#on-an-existing-database) writes these settings and the view.
|
|
82
83
|
|
|
83
84
|
## Configuration
|
|
84
85
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/protobase-skill.ts from website/src/content/docs/reference/blocks.mdx: run `bun run docs:skill`, do not edit. -->
|
|
1
|
+
<!-- Generated by scripts/protobase-skill.ts from docs/website/src/content/docs/reference/blocks.mdx: run `bun run docs:skill`, do not edit. -->
|
|
2
2
|
|
|
3
3
|
# Blocks
|
|
4
4
|
|