@protobase/cli 0.49.0 → 0.49.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.
Files changed (59) hide show
  1. package/dist/cli/package.js +1 -1
  2. package/dist/config/build-project.js +18 -8
  3. package/dist/config/config-defaults.js +3 -0
  4. package/dist/config/read-config.js +5 -1
  5. package/dist/db/read-only-db.js +1 -1
  6. package/dist/dev/dev-jobs.js +5 -3
  7. package/dist/dev/entry.js +3 -3
  8. package/dist/migration/load-project.js +1 -1
  9. package/dist/project/load-bundle-project.js +1 -1
  10. package/dist/project-auth.d.ts +2 -0
  11. package/dist/project-auth.js +2 -0
  12. package/dist/serve/app.js +1 -1
  13. package/dist/serve/create-admin.js +1 -1
  14. package/dist/serve/host-modules.js +3 -3
  15. package/dist/serve/lifecycle.js +4 -3
  16. package/dist/supabase/load-phase.js +1 -1
  17. package/dist/users/load-auth.d.ts +10 -0
  18. package/dist/users/load-auth.js +1 -1
  19. package/dist/worker/start-worker.js +3 -2
  20. package/package.json +8 -7
  21. package/skills/protobase/SKILL.md +7 -1
  22. package/skills/protobase/references/features/events-webhooks-and-jobs.md +1 -0
  23. package/skills/protobase/references/features/files-and-images.md +1 -0
  24. package/skills/protobase/references/features/sign-in-and-accounts.md +3 -0
  25. package/skills/protobase/references/features/start-a-project.md +7 -1
  26. package/skills/protobase/references/getting-started.md +13 -13
  27. package/skills/protobase/references/guides/deploy.md +2 -2
  28. package/skills/protobase/references/guides/export-a-list.md +1 -1
  29. package/skills/protobase/references/guides/field-type.md +1 -1
  30. package/skills/protobase/references/guides/first-composed-page.md +1 -1
  31. package/skills/protobase/references/guides/first-plugin.md +1 -1
  32. package/skills/protobase/references/guides/import-records.md +1 -1
  33. package/skills/protobase/references/guides/personal-setting.md +1 -1
  34. package/skills/protobase/references/guides/push-notifications.md +1 -1
  35. package/skills/protobase/references/guides/record-card.md +1 -1
  36. package/skills/protobase/references/guides/remote-resources.md +1 -1
  37. package/skills/protobase/references/guides/theme-an-app.md +1 -1
  38. package/skills/protobase/references/reference/api.md +1 -1
  39. package/skills/protobase/references/reference/architecture.md +4 -4
  40. package/skills/protobase/references/reference/auth.md +36 -4
  41. package/skills/protobase/references/reference/blocks.md +1 -1
  42. package/skills/protobase/references/reference/bottom-bar.md +1 -1
  43. package/skills/protobase/references/reference/cli.md +10 -10
  44. package/skills/protobase/references/reference/client.md +2 -2
  45. package/skills/protobase/references/reference/config/admin-app.md +62 -0
  46. package/skills/protobase/references/reference/config/api.md +164 -0
  47. package/skills/protobase/references/reference/config/app.md +112 -0
  48. package/skills/protobase/references/reference/config/files.md +99 -0
  49. package/skills/protobase/references/reference/config/jobs-and-events.md +267 -0
  50. package/skills/protobase/references/reference/config/sign-in.md +396 -0
  51. package/skills/protobase/references/reference/config.md +89 -70
  52. package/skills/protobase/references/reference/custom-components.md +2 -2
  53. package/skills/protobase/references/reference/data-config.md +2 -2
  54. package/skills/protobase/references/reference/email.md +2 -2
  55. package/skills/protobase/references/reference/files.md +6 -3
  56. package/skills/protobase/references/reference/jobs.md +15 -6
  57. package/skills/protobase/references/reference/sidebar.md +2 -2
  58. package/skills/protobase/references/reference/ui-config.md +5 -5
  59. package/skills/protobase/references/reference/user-menu.md +1 -1
@@ -1,4 +1,4 @@
1
1
  //#region package.json
2
- var version = "0.49.0";
2
+ var version = "0.49.2";
3
3
  //#endregion
4
4
  export { version };
@@ -2,26 +2,34 @@ import { projectFiles, projectFunctions, projectJobs, projectNotifications, proj
2
2
  import { buildAppAuth, buildAuthenticator } from "@protobase/server/internal";
3
3
  //#region src/config/build-project.ts
4
4
  /**
5
- * The app's sign-in, built from `auth` with the app's URL, secret and name, the hooks of its auth/hooks.ts and the
6
- * mailer of its auth/mailer.ts when it has them; none without `auth`.
5
+ * The app's own mailer, the default export of its auth/mailer.ts: what sign-in and the jobs (`context.mail`) both send
6
+ * with; `undefined` without one, when both send through `PROTOBASE_SMTP_URL`.
7
+ */
8
+ const projectMailer = async (config) => (await config.authFiles?.module("auth/mailer.ts")?.())?.default;
9
+ /**
10
+ * The app's sign-in, built from `auth` with the app's URL, secrets, signing key rotation and name, the hooks of its
11
+ * auth/hooks.ts and the app's mailer when it has them; none without `auth`.
7
12
  */
8
13
  const projectAuth = async (config, { db, pool }) => {
9
14
  if (!config.auth) return void 0;
10
15
  if (!pool) throw new Error("auth needs the app's pool, which its store shares");
11
- const { url, secret, name } = config;
16
+ const { url, secret, previousSecrets, signingKeyDays, signingKeyGraceDays, name } = config;
12
17
  if (!url) throw new Error("Sign-in needs the app's public URL: set PROTOBASE_URL, such as https://admin.example.com, or url in protobase.config.ts");
13
18
  if (!secret) throw new Error("Sign-in needs the app's secret: set PROTOBASE_SECRET to the output of `openssl rand -base64 32`, or secret in protobase.config.ts");
14
- const [hooks, mailer] = await Promise.all(["auth/hooks.ts", "auth/mailer.ts"].map((file) => config.authFiles?.module(file)?.()));
19
+ const [hooks, mailer] = await Promise.all([config.authFiles?.module("auth/hooks.ts")?.(), projectMailer(config)]);
15
20
  return buildAppAuth({
16
21
  ...config.auth || {},
17
22
  baseURL: url,
18
23
  secret,
24
+ ...previousSecrets && { previousSecrets },
25
+ ...signingKeyDays !== void 0 && { signingKeyDays },
26
+ ...signingKeyGraceDays !== void 0 && { signingKeyGraceDays },
19
27
  ...name && { appName: name }
20
28
  }, {
21
29
  pool,
22
30
  db,
23
31
  ...hooks && { hooks },
24
- ...mailer && { mailer: mailer.default }
32
+ ...mailer && { mailer }
25
33
  });
26
34
  };
27
35
  /**
@@ -35,14 +43,15 @@ const projectAuthenticate = async (config, auth) => {
35
43
  };
36
44
  /** The app, built from its merged config over its database: every reference loaded, auth and the authenticator made. */
37
45
  const buildProject = async (config, database) => {
38
- const [resources, functions, files, options, auth, webhooks, notifications] = await Promise.all([
46
+ const [resources, functions, files, options, auth, webhooks, notifications, mailer] = await Promise.all([
39
47
  projectResources(config),
40
48
  projectFunctions(config),
41
49
  projectFiles(config),
42
50
  projectOptions(config),
43
51
  projectAuth(config, database),
44
52
  projectWebhooks(config),
45
- projectNotifications(config)
53
+ projectNotifications(config),
54
+ projectMailer(config)
46
55
  ]);
47
56
  const jobs = projectJobs(config);
48
57
  const identity = config.themeColor || config.backgroundColor ? {
@@ -60,6 +69,7 @@ const buildProject = async (config, database) => {
60
69
  ...config.history && { history: config.history },
61
70
  ...webhooks && { webhooks },
62
71
  ...notifications && { notifications },
72
+ ...mailer && { mailer },
63
73
  ...config.mobile && { mobile: config.mobile },
64
74
  ...config.secret && { secret: config.secret },
65
75
  ...identity && { app: identity },
@@ -67,4 +77,4 @@ const buildProject = async (config, database) => {
67
77
  };
68
78
  };
69
79
  //#endregion
70
- export { buildProject, projectAuth, projectAuthenticate };
80
+ export { buildProject, projectAuth, projectAuthenticate, projectMailer };
@@ -5,6 +5,7 @@ const listOf = (text) => text?.split(",").map((part) => part.trim()).filter(Bool
5
5
  *
6
6
  * - `url`: `PROTOBASE_URL`, or in `protobase dev` the dev server's own address;
7
7
  * - `secret`: `PROTOBASE_SECRET`;
8
+ * - `previousSecrets`: `PROTOBASE_PREVIOUS_SECRETS`, comma separated;
8
9
  * - `auth`: on, with its own defaults, unless it is `false` or `authenticate.jwksUrl` trusts an auth server elsewhere;
9
10
  * - `auth.trustedOrigins`: `PROTOBASE_TRUSTED_ORIGINS`, comma separated.
10
11
  *
@@ -13,6 +14,7 @@ const listOf = (text) => text?.split(",").map((part) => part.trim()).filter(Bool
13
14
  const withDefaults = (config, command, env) => {
14
15
  const url = config.url ?? (env.PROTOBASE_URL?.trim() || void 0) ?? (command === "dev" ? env.PROTOBASE_DEV_URL : void 0);
15
16
  const secret = config.secret ?? (env.PROTOBASE_SECRET?.trim() || void 0);
17
+ const previousSecrets = config.previousSecrets ?? listOf(env.PROTOBASE_PREVIOUS_SECRETS);
16
18
  const authOn = config.auth !== false && (config.auth !== void 0 || !config.authenticate?.jwksUrl);
17
19
  const trustedOrigins = listOf(env.PROTOBASE_TRUSTED_ORIGINS);
18
20
  const { auth: _, ...rest } = config;
@@ -20,6 +22,7 @@ const withDefaults = (config, command, env) => {
20
22
  ...rest,
21
23
  ...url && { url },
22
24
  ...secret && { secret },
25
+ ...previousSecrets?.length && { previousSecrets },
23
26
  ...authOn && { auth: {
24
27
  ...trustedOrigins && { trustedOrigins },
25
28
  ...config.auth || {}
@@ -22,9 +22,13 @@ const typescriptInput = async (file, importModules) => {
22
22
  if (module.default === void 0) throw new Error(`${file} has no default export: export default defineConfig({ ... })`);
23
23
  return module.default;
24
24
  };
25
+ const jsonInput = async (file) => {
26
+ const { $schema: _, ...config } = JSON.parse(await readFile(file, "utf8"));
27
+ return config;
28
+ };
25
29
  /** The config of a config file: a JSON object, or a TypeScript module's default export, called with `configEnv`. */
26
30
  const readConfigFile = async (file, configEnv, importModules) => {
27
- const input = file.endsWith(".json") ? JSON.parse(await readFile(file, "utf8")) : await typescriptInput(file, importModules);
31
+ const input = file.endsWith(".json") ? await jsonInput(file) : await typescriptInput(file, importModules);
28
32
  return calledConfig(input, configEnv, path.basename(file));
29
33
  };
30
34
  //#endregion
@@ -1,5 +1,5 @@
1
- import { Kysely, PostgresDialect } from "kysely";
2
1
  import pg from "pg";
2
+ import { Kysely, PostgresDialect } from "kysely";
3
3
  //#region src/db/read-only-db.ts
4
4
  /** Kysely over one read-only session, for what the query package reads of the database, as the server reads it. */
5
5
  const readOnlyDb = (url) => new Kysely({ dialect: new PostgresDialect({ pool: new pg.Pool({
@@ -2,16 +2,18 @@ import { checkJobsSchema, startJobs } from "@protobase/server";
2
2
  //#region src/dev/dev-jobs.ts
3
3
  const store = globalThis;
4
4
  /**
5
- * Runs the project's jobs in the dev server: started on the first load, once the jobs schema checks out, and given the
6
- * reloaded definitions on every load after it, so an edited job runs its new code from the next job on.
5
+ * Runs the project's jobs in the dev server: started on the first load, once the jobs schema checks out, with the app's
6
+ * own mailer when it has one, and given the reloaded definitions on every load after it, so an edited job runs its new
7
+ * code from the next job on. A mailer added or changed later is the jobs' from the next start.
7
8
  */
8
- const devJobs = async (db, definitions) => {
9
+ const devJobs = async (db, definitions, mailer) => {
9
10
  if (store.__protobaseJobs) return store.__protobaseJobs.update(definitions);
10
11
  if (definitions.length === 0) return;
11
12
  await checkJobsSchema(db);
12
13
  store.__protobaseJobs = await startJobs({
13
14
  db,
14
15
  jobs: definitions,
16
+ ...mailer && { mailer },
15
17
  onError: (error) => console.error(error)
16
18
  });
17
19
  };
package/dist/dev/entry.js CHANGED
@@ -1,14 +1,14 @@
1
+ import { buildProject } from "../config/build-project.js";
1
2
  import { projectIcons } from "../build/app-icons.js";
2
3
  import { projectErrorReporter } from "../project/error-reporter.js";
3
4
  import { projectAdmin } from "../project/project-admin.js";
4
- import { buildProject } from "../config/build-project.js";
5
5
  import { devJobs } from "./dev-jobs.js";
6
6
  import { devDatabase, loadDevConfig } from "./project.js";
7
7
  import { withDevServiceWorker } from "./service-worker-route.js";
8
8
  import { setMissing, supabaseEnv } from "./supabase-env.js";
9
+ import { apiKeySettings, assistantSettings, authSchemaDrift, authStoreTables, checkAi, checkAuthSchema, checkChanges, checkComments, checkComputed, checkNotificationsSchema, checkQueryRunner, checkResourcesOutsideAuthStore, checkWebhooksSchema, configExports, hasUsers } from "@protobase/server";
9
10
  import { upgradeWebSocket } from "@hono/node-server";
10
11
  import { Hono } from "hono";
11
- import { apiKeySettings, assistantSettings, authSchemaDrift, authStoreTables, checkAi, checkAuthSchema, checkChanges, checkComments, checkComputed, checkNotificationsSchema, checkQueryRunner, checkResourcesOutsideAuthStore, checkWebhooksSchema, configExports, hasUsers } from "@protobase/server";
12
12
  //#region src/dev/entry.ts
13
13
  const projectDir = process.env.PROTOBASE_PROJECT;
14
14
  const config = await loadDevConfig(projectDir, JSON.parse(process.env.PROTOBASE_EXTENSIONS ?? "[]"));
@@ -47,7 +47,7 @@ const ui = {
47
47
  icons: projectIcons(projectDir)
48
48
  };
49
49
  const { admin, jobs } = projectAdmin(project, db, ui, reporter, upgradeWebSocket);
50
- await devJobs(db, jobs);
50
+ await devJobs(db, jobs, project.mailer);
51
51
  var entry_default = withDevServiceWorker(new Hono(), Boolean(project.notifications)).route("/", admin);
52
52
  /** Whether the auth store has a user yet, for the banner's sign-in line; undefined without one. */
53
53
  const anyUsers = () => project.auth ? hasUsers(project.auth) : Promise.resolve(void 0);
@@ -3,8 +3,8 @@ import { projectJobs, projectNotifications, projectResources, projectWebhooks }
3
3
  import { projectAuth } from "../config/build-project.js";
4
4
  import { loadSourceConfig } from "../config/source-config.js";
5
5
  import { openAppDatabase } from "../project/pg-db.js";
6
- import { assistantSettings, authStoreTables, configExports } from "@protobase/server";
7
6
  import pg from "pg";
7
+ import { assistantSettings, authStoreTables, configExports } from "@protobase/server";
8
8
  //#region src/migration/load-project.ts
9
9
  /**
10
10
  * The project in `dir` as `protobase dev` merges it, for what its database needs: protobase.config.ts, with the
@@ -6,8 +6,8 @@ import { readManifest } from "../bundle/manifest.js";
6
6
  import { loadBundle } from "../serve/load-bundle.js";
7
7
  import { statSync } from "node:fs";
8
8
  import path from "node:path";
9
- import { configExports } from "@protobase/server";
10
9
  import pg from "pg";
10
+ import { configExports } from "@protobase/server";
11
11
  //#region src/project/load-bundle-project.ts
12
12
  const bundleConfig = async (bundle) => {
13
13
  if (!statSync(bundle).isDirectory()) return loadBundle(bundle, "tool");
@@ -0,0 +1,2 @@
1
+ import { loadProjectAuth } from "./users/load-auth.js";
2
+ export { loadProjectAuth };
@@ -0,0 +1,2 @@
1
+ import { loadProjectAuth } from "./users/load-auth.js";
2
+ export { loadProjectAuth };
package/dist/serve/app.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { isApiPath } from "../bundle/manifest.js";
2
2
  import { serveStaticSite } from "./static-site.js";
3
- import { Hono } from "hono";
4
3
  import { jobsDrainApp, mobileReleaseApp, webauthnPath } from "@protobase/server";
4
+ import { Hono } from "hono";
5
5
  import { logger } from "hono/logger";
6
6
  //#region src/serve/app.ts
7
7
  const createServeApp = ({ admin, requestLog, site, jobs, drainToken, mobile }) => {
@@ -6,8 +6,8 @@ import { usersApi } from "../users/users-api.js";
6
6
  import { checkBundleManifest } from "./bundle-manifest.js";
7
7
  import { loadBundle } from "./load-bundle.js";
8
8
  import { bundleConfigFile } from "../worker/start-worker.js";
9
- import { checkAuthSchema } from "@protobase/server";
10
9
  import pg from "pg";
10
+ import { checkAuthSchema } from "@protobase/server";
11
11
  //#region src/serve/create-admin.ts
12
12
  const createAdminInBundle = async (bundle, email, options, out) => {
13
13
  const file = await bundleConfigFile(bundle);
@@ -1,9 +1,9 @@
1
- import * as nodeServer from "@hono/node-server";
2
- import * as hono from "hono";
1
+ import * as pg$1 from "pg";
3
2
  import * as server from "@protobase/server";
4
3
  import * as layout from "@protobase/layout";
5
4
  import * as kysely from "kysely";
6
- import * as pg$1 from "pg";
5
+ import * as nodeServer from "@hono/node-server";
6
+ import * as hono from "hono";
7
7
  import * as reactEmailRender from "@react-email/render";
8
8
  import * as apiReference from "@scalar/hono-api-reference";
9
9
  import * as aipParsers from "aip-parsers";
@@ -1,16 +1,16 @@
1
1
  import { protobaseVersion } from "../version/version.js";
2
- import { projectAdmin } from "../project/project-admin.js";
3
2
  import { buildProject } from "../config/build-project.js";
4
3
  import { openAppDatabase } from "../project/pg-db.js";
4
+ import { projectAdmin } from "../project/project-admin.js";
5
5
  import { apiWebSocketServer } from "../project/api-websocket-server.js";
6
6
  import { withClientAddress } from "./client-address.js";
7
7
  import { createServeApp } from "./app.js";
8
8
  import { startCleanupTimer } from "./cleanup-timer.js";
9
9
  import { closeSockets } from "./close-sockets.js";
10
10
  import { servedRelease } from "./mobile-release.js";
11
- import { createAdaptorServer, upgradeWebSocket } from "@hono/node-server";
12
- import { assistantSettings, authStoreTables, backgroundSettled, checkAi, checkAuthSchema, checkChanges, checkComments, checkComputed, checkJobsSchema, checkNotificationsSchema, checkQueryRunner, checkResourcesOutsideAuthStore, checkWebhooksSchema, configExports, createFileCleanup, startJobs } from "@protobase/server";
13
11
  import pg from "pg";
12
+ import { assistantSettings, authStoreTables, backgroundSettled, checkAi, checkAuthSchema, checkChanges, checkComments, checkComputed, checkJobsSchema, checkNotificationsSchema, checkQueryRunner, checkResourcesOutsideAuthStore, checkWebhooksSchema, configExports, createFileCleanup, startJobs } from "@protobase/server";
13
+ import { createAdaptorServer, upgradeWebSocket } from "@hono/node-server";
14
14
  //#region src/serve/lifecycle.ts
15
15
  const listen = (server, port) => new Promise((resolve, reject) => {
16
16
  server.once("error", reject);
@@ -47,6 +47,7 @@ const startServe = async ({ config, env, openDb = (url) => openAppDatabase(pg, u
47
47
  db,
48
48
  jobs: definitions,
49
49
  work: env.runJobs,
50
+ ...project.mailer && { mailer: project.mailer },
50
51
  onError: (error) => console.error(error)
51
52
  }) : void 0;
52
53
  const release = project.mobile ? await servedRelease({
@@ -1,3 +1,4 @@
1
+ import { loadProjectAuth } from "../users/load-auth.js";
1
2
  import { writeAuthMigration } from "../auth/write-migration.js";
2
3
  import { connect } from "../db/connect.js";
3
4
  import { runDoctor } from "../doctor/run.js";
@@ -10,7 +11,6 @@ import { loadScript, qualified } from "./load-script.js";
10
11
  import { existingTables, filledTables, otherTables } from "./target-checks.js";
11
12
  import { providerCounts } from "./identity-providers.js";
12
13
  import { accountsMigration } from "./users-migrations.js";
13
- import { loadProjectAuth } from "../users/load-auth.js";
14
14
  import { cronJobFilesInTheWay, writeCronJobs } from "./cron-jobs-write.js";
15
15
  import { importReport } from "./report.js";
16
16
  import { existsSync } from "node:fs";
@@ -0,0 +1,10 @@
1
+ import { AdminAuth } from "@protobase/server";
2
+ //#region src/users/load-auth.d.ts
3
+ /**
4
+ * The sign-in of the project in `projectDir`, built from its config's `auth` over DATABASE_URL, with only the plugins
5
+ * it turns on. With a device or history store of the app's own (notifications/store.ts, notifications/history-store.ts),
6
+ * deleting a user removes their devices or history from it too; the built-in tables go with the user by their foreign
7
+ * keys.
8
+ */
9
+ export declare const loadProjectAuth: (projectDir: string) => Promise<AdminAuth>;
10
+ //#endregion
@@ -3,8 +3,8 @@ import { projectNotifications } from "../config/project-parts.js";
3
3
  import { projectAuth } from "../config/build-project.js";
4
4
  import { loadSourceConfig } from "../config/source-config.js";
5
5
  import { openAppDatabase } from "../project/pg-db.js";
6
- import { removeDevicesWithUsers, removeHistoryWithUsers } from "@protobase/server";
7
6
  import pg from "pg";
7
+ import { removeDevicesWithUsers, removeHistoryWithUsers } from "@protobase/server";
8
8
  //#region src/users/load-auth.ts
9
9
  /**
10
10
  * The sign-in of the project in `projectDir`, built from its config's `auth` over DATABASE_URL, with only the plugins
@@ -1,13 +1,13 @@
1
- import { projectAdmin } from "../project/project-admin.js";
2
1
  import { buildProject } from "../config/build-project.js";
3
2
  import { openAppDatabase } from "../project/pg-db.js";
3
+ import { projectAdmin } from "../project/project-admin.js";
4
4
  import { readManifest } from "../bundle/manifest.js";
5
5
  import { checkBundleManifest } from "../serve/bundle-manifest.js";
6
6
  import { loadBundle } from "../serve/load-bundle.js";
7
7
  import { statSync } from "node:fs";
8
8
  import path from "node:path";
9
- import { checkJobsSchema, configExports, isCaptured, startJobs } from "@protobase/server";
10
9
  import pg from "pg";
10
+ import { checkJobsSchema, configExports, isCaptured, startJobs } from "@protobase/server";
11
11
  //#region src/worker/start-worker.ts
12
12
  const bundleConfigFile = async (bundle) => {
13
13
  if (!statSync(bundle).isDirectory()) return bundle;
@@ -36,6 +36,7 @@ const startWorker = async ({ config, databaseUrl, openDb = (url) => openAppDatab
36
36
  runtime: await startJobs({
37
37
  db,
38
38
  jobs: definitions,
39
+ ...project.mailer && { mailer: project.mailer },
39
40
  onError: (error) => console.error(error)
40
41
  })
41
42
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protobase/cli",
3
- "version": "0.49.0",
3
+ "version": "0.49.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": {
@@ -19,6 +19,7 @@
19
19
  "node": ">=22.12.0"
20
20
  },
21
21
  "exports": {
22
+ "./auth": "./dist/project-auth.js",
22
23
  "./runner": "./dist/runner.js"
23
24
  },
24
25
  "bin": {
@@ -39,12 +40,12 @@
39
40
  "dependencies": {
40
41
  "@better-auth/core": "^1.7.12",
41
42
  "@hono/node-server": "^2.1.3",
42
- "@protobase/config": "0.49.0",
43
- "@protobase/layout": "0.49.0",
44
- "@protobase/query": "0.49.0",
45
- "@protobase/schema": "0.49.0",
46
- "@protobase/server": "0.49.0",
47
- "@protobase/ui": "0.49.0",
43
+ "@protobase/config": "0.49.2",
44
+ "@protobase/layout": "0.49.2",
45
+ "@protobase/query": "0.49.2",
46
+ "@protobase/schema": "0.49.2",
47
+ "@protobase/server": "0.49.2",
48
+ "@protobase/ui": "0.49.2",
48
49
  "@react-email/render": "^2.1.0",
49
50
  "@scalar/hono-api-reference": "^0.12.10",
50
51
  "@tailwindcss/vite": "^4.3.3",
@@ -63,7 +63,13 @@ Guides:
63
63
 
64
64
  Reference:
65
65
 
66
- - When writing `protobase.config.ts`, or looking for where a job's, hook's or other piece of the app's code goes → read [protobase.config.ts](references/reference/config.md)
66
+ - When writing `protobase.config.ts`, or looking for where a job's, hook's or other piece of the app's code goes → read [Configuring Protobase](references/reference/config.md)
67
+ - When setting the app's name, URL, secret, language, time zone or mobile build in the config → read [App options](references/reference/config/app.md)
68
+ - When setting `auth` or `authenticate` in the config → read [Sign-in options](references/reference/config/sign-in.md)
69
+ - When setting the API's keys, CORS, limits, write hooks, MCP tools or remote resources in the config → read [API options](references/reference/config/api.md)
70
+ - When setting the assistant, maps or plugins in the config → read [Admin app options](references/reference/config/admin-app.md)
71
+ - When setting `jobs`, `events`, `history`, `webhooks` or `notifications` in the config → read [Jobs and events options](references/reference/config/jobs-and-events.md)
72
+ - When setting `files` in the config → read [Files options](references/reference/config/files.md)
67
73
  - When defining resources, fields, keys, relations, rollups, formulas and validation → read [Data config](references/reference/data-config.md)
68
74
  - When defining views, columns, filters, charts, related records and actions → read [UI config](references/reference/ui-config.md)
69
75
  - When asking how the packages fit together → read [Architecture](references/reference/architecture.md)
@@ -11,6 +11,7 @@ React to changes, deliver them to other systems, and run work in the background.
11
11
  - [Delivery retries](../reference/webhooks.md#delivery-and-retries): Failed deliveries 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
  - [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.
14
+ - [Typed jobs](../reference/jobs.md#typed-names-and-payloads): Code that queues a job, and the job itself, are checked against the names and arguments the config declares as they compile.
14
15
  - [Retries](../reference/jobs.md#failures): Failed jobs are retried with growing waits, and duplicates can be prevented with a key.
15
16
  - [Ordered groups](../reference/jobs.md#ordered-groups): Jobs in one group run one at a time, in order.
16
17
  - [Recurring jobs](../reference/jobs.md#recurring-jobs): Jobs run on a cron schedule in a chosen time zone.
@@ -7,6 +7,7 @@ Uploaded files and images, where they are kept and how they are served.
7
7
  - [File fields](../reference/files.md#what-the-column-holds): A text column holds an uploaded file, with limits on type and size.
8
8
  - [File storage](../reference/files.md#providers): Files are kept on disk, or in a bucket of your own.
9
9
  - [S3-compatible buckets](../reference/files.md#s3-compatible-buckets) (beta): Files are kept in any bucket that speaks the S3 API, when the app runs on Bun.
10
+ - [Files from a seed](../reference/files.md#writing-files-from-a-seed): A seed or another script writes files into the app's providers, read from its config and environment as the server reads them.
10
11
  - [Type detection](../reference/files.md#how-the-type-is-decided): An upload's type is decided from its content, and a disguised file is refused.
11
12
  - [Signed downloads](../reference/files.md#downloads): Private files open through short-lived links that stop working once the record no longer holds the file.
12
13
  - [Derived fields](../reference/files.md#derived-fields): Width, height, size and type of each upload are written to other fields.
@@ -6,6 +6,7 @@ Sign-in methods, users, roles, organizations and tokens.
6
6
 
7
7
  - [Built-in sign-in](../reference/auth.md): Password sign-in, sessions and short-lived tokens, with no separate identity service.
8
8
  - [First admin](../reference/auth.md#first-run): No account can be made over the web while the app has no users. You create the first admin from the terminal, and the last active admin cannot be deleted, demoted or blocked.
9
+ - [Users from a script](../reference/auth.md#first-run): A seed or another script of the project creates and lists users, and mints their tokens, on the app's own sign-in.
9
10
  - [Versioned sign-in tables](../reference/auth.md#migrations): The sign-in tables come from numbered migrations that ship with Protobase, written as the project's own and recorded in the database, so a deploy checks them without comparing tables. Every feature has its tables from the start, so turning one on or off needs no migration.
10
11
  - [Existing users table](../reference/auth.md#an-existing-users-table): Sign-in can use the users table another system keeps in the same database.
11
12
  - [Users page](../reference/auth.md#users-page): Admins find people, set roles, block them, add accounts and invite people by email.
@@ -25,6 +26,8 @@ Sign-in methods, users, roles, organizations and tokens.
25
26
  - [Organizations](../reference/auth.md#organizations): People work in one organization at a time, see only its records, and are invited with their own roles.
26
27
  - [API tokens](../reference/auth.md#tokens-and-roles): A signed-in session gets short-lived tokens for the API.
27
28
  - [Immediate revocation](../reference/auth.md#when-a-token-stops-working): A ban, removed role or ended session takes effect on the next request.
29
+ - [Signing key rotation](../reference/auth.md#signing-keys): The keys that sign the tokens are replaced every 30 days on their own, and old ones keep verifying the tokens they signed for a week.
30
+ - [Changing the secret](../reference/auth.md#changing-the-secret): The app's secret can change while the signing keys keep signing, by listing the old secret beside the new one.
28
31
  - [Tokens for scripts](../reference/auth.md#tokens-for-scripts-and-curl): A token for an existing user, for scripts and curl.
29
32
  - [Several origins](../reference/auth.md#several-origins): One app works on several domains, such as its own address and a custom domain.
30
33
  - [Sign-in rate limits](../reference/auth.md#client-addresses): Sign-in and code requests are limited per client address, also behind a proxy.
@@ -8,7 +8,13 @@ Start a new app, or an admin over an existing Postgres database, and keep the co
8
8
  - [Example apps](../getting-started.md#run-the-erp-example): Seeded example apps on Postgres: an ERP, real estate property management and a public property portal.
9
9
  - [One config](../reference/config.md): The whole app is one object of data in `protobase.config.ts`, typed with `defineConfig`, with a sensible default for every key.
10
10
  - [Code found by path](../reference/config.md#where-the-code-is): The config names jobs, hooks and providers, and Protobase finds their code by its path, such as `jobs/<name>.ts`.
11
- - [JSON config](../reference/config.md#the-same-config-as-json): The same config works as `protobase.config.json`, with values from the environment written as `$env`.
11
+ - [JSON config](../reference/config.md#the-same-config-as-json): The same config works as `protobase.config.json`, with values from the environment written as `$env`, and a JSON Schema that checks it in the editor.
12
+ - [App options](../reference/config/app.md): The app's name, public URL, secret, language, time zone, install colours and mobile build, each with its type, default and environment variable.
13
+ - [Sign-in options](../reference/config/sign-in.md): Every key of `auth` and `authenticate`, from roles and organizations to sign-in providers and tokens of an auth server elsewhere.
14
+ - [API options](../reference/config/api.md): The REST API's path, keys, CORS, access defaults, query limits, error reporting, write hooks and MCP tools.
15
+ - [Admin app options](../reference/config/admin-app.md): The assistant, the maps and the plugins the admin app loads.
16
+ - [Jobs and events options](../reference/config/jobs-and-events.md): Each job's retries, timeout and schedule, and the settings of events, history, webhooks and notifications.
17
+ - [Files options](../reference/config/files.md): The file providers, retention, signing, the Storage API and the image library.
12
18
  - [Scaffold from a database](../reference/cli.md#scaffold): Reads your Postgres tables and writes the data config for them, with field types, keys, relations, enums, soft delete, tenants and search filled in, and with `--ui` a first view of each.
13
19
  - [Safe re-scaffolding](../reference/cli.md#re-running): Running scaffold again adds only the columns that are not declared yet and leaves your own config code as it is.
14
20
  - [Schema drift report](../reference/cli.md#drift-report): After each scaffold, lists declared fields whose column is gone, whose type changed or whose enum values differ, with a suggested fix.
@@ -36,7 +36,7 @@ For a Postgres database you already have, [Admin over an existing database](guid
36
36
 
37
37
  Every page of these docs is also Markdown at its address plus `.md`: `https://docs.protobase.net/reference/cli/` is also `https://docs.protobase.net/reference/cli.md`. The code a page shows from example files is written out in it, and its live demos are left out, so a coding agent or a chat assistant reads the page whole. In a project, [`protobase skill install`](reference/cli.md#skill) gives coding agents the docs of the installed version.
38
38
 
39
- The rest of this page works in a clone of this repository, on its examples.
39
+ The rest of this page works in a clone of this repository, on its example apps in `tests/apps`.
40
40
 
41
41
  ## Setup
42
42
 
@@ -48,33 +48,33 @@ bun install
48
48
 
49
49
  ## Run the ERP example
50
50
 
51
- `examples/erp` is a sample ERP on a real Postgres database, seeded with three years of history. It needs Docker for the database: `bun run db:up` starts the Postgres container and gives each example its database and a `.env` from its `.env.example`.
51
+ `tests/apps/erp` is a sample ERP on a real Postgres database, seeded with three years of history. It needs Docker for the database: `bun run db:up` starts the Postgres container and gives each example its database and a `.env` from its `.env.example`.
52
52
 
53
53
  ```sh
54
- bun run db:up && bun run --cwd examples/erp db:migrate && bun run --cwd examples/erp db:seed --scale small # the ERP's tables and Better Auth's
55
- bun run --cwd examples/erp protobase users create you@example.com --generate-password
56
- bun run --cwd examples/erp dev # http://localhost:5173
54
+ bun run db:up && bun run --cwd tests/apps/erp db:migrate && bun run --cwd tests/apps/erp db:seed --scale small # the ERP's tables and Better Auth's
55
+ bun run --cwd tests/apps/erp protobase users create you@example.com --generate-password
56
+ bun run --cwd tests/apps/erp dev # http://localhost:5173
57
57
  ```
58
58
 
59
- `PROTOBASE_SECRET` in `examples/erp/.env` signs the session cookies; see [Login with Better Auth](reference/auth.md). `protobase dev` serves the admin app and the API on one port and reloads both on every change ([CLI](reference/cli.md#dev)). Its startup message says how to sign in: while the database has no users, it prints the exact `users create` command for the first admin. It stops with a clear message when another server holds its port; pass `--port 5174` to run a second app beside it.
59
+ `PROTOBASE_SECRET` in `tests/apps/erp/.env` signs the session cookies; see [Login with Better Auth](reference/auth.md). `protobase dev` serves the admin app and the API on one port and reloads both on every change ([CLI](reference/cli.md#dev)). Its startup message says how to sign in: while the database has no users, it prints the exact `users create` command for the first admin. It stops with a clear message when another server holds its port; pass `--port 5174` to run a second app beside it.
60
60
 
61
61
  ## Run the real estate example
62
62
 
63
- `examples/real-estate` is a rental and property management firm: owners, properties and units, leases and tenants, monthly rent, payments and arrears, and maintenance. Its database sits beside the ERP's in the same Postgres container, and it keeps its own `.env`.
63
+ `tests/apps/real-estate` is a rental and property management firm: owners, properties and units, leases and tenants, monthly rent, payments and arrears, and maintenance. Its database sits beside the ERP's in the same Postgres container, and it keeps its own `.env`.
64
64
 
65
65
  ```sh
66
- bun run db:up && bun run --cwd examples/real-estate db:migrate && bun run --cwd examples/real-estate db:seed --scale small
67
- bun run --cwd examples/real-estate protobase users create you@example.com --role admin --generate-password
68
- bun run --cwd examples/real-estate dev # http://localhost:5173
66
+ bun run db:up && bun run --cwd tests/apps/real-estate db:migrate && bun run --cwd tests/apps/real-estate db:seed --scale small
67
+ bun run --cwd tests/apps/real-estate protobase users create you@example.com --role admin --generate-password
68
+ bun run --cwd tests/apps/real-estate dev # http://localhost:5173
69
69
  ```
70
70
 
71
71
  ## Run the property portal example
72
72
 
73
- `examples/property-portal` is a public portal of homes for sale and for rent in the Netherlands and Spain. Visitors browse and filter the listings without signing in, through the [anonymous role](reference/access.md#anonymous-access); members save searches of the listings that mail them new homes, and keep favorites and notes that only they see. The seed makes two members, `anna@portal.example` and `bram@portal.example`, and an admin, `admin@portal.example`, all with the password `property-portal-demo`.
73
+ `tests/apps/property-portal` is a public portal of homes for sale and for rent in the Netherlands and Spain. Visitors browse and filter the listings without signing in, through the [anonymous role](reference/access.md#anonymous-access); members save searches of the listings that mail them new homes, and keep favorites and notes that only they see. The seed makes two members, `anna@portal.example` and `bram@portal.example`, and an admin, `admin@portal.example`, all with the password `property-portal-demo`.
74
74
 
75
75
  ```sh
76
- bun run db:up && bun run --cwd examples/property-portal db:migrate && bun run --cwd examples/property-portal db:seed --scale small
77
- bun run --cwd examples/property-portal dev # http://localhost:5173
76
+ bun run db:up && bun run --cwd tests/apps/property-portal db:migrate && bun run --cwd tests/apps/property-portal db:seed --scale small
77
+ bun run --cwd tests/apps/property-portal dev # http://localhost:5173
78
78
  ```
79
79
 
80
80
  ## Commands
@@ -7,7 +7,7 @@ Ship a project as one bundle folder and run it with the serve runtime.
7
7
  A project ships as one bundle folder; the host runs protobase around it.
8
8
 
9
9
  ```sh
10
- bun run --cwd examples/erp protobase build # the bundle to ship: examples/erp/dist/
10
+ bun run --cwd tests/apps/erp protobase build # the bundle to ship: tests/apps/erp/dist/
11
11
  bun run build:serve # the runtime the host carries: dist/protobase-serve.js
12
12
  bun --no-install /opt/protobase/protobase-serve.js /app/protobase.config.js # on the host: the API
13
13
  ```
@@ -28,7 +28,7 @@ dist/
28
28
  plugins and the app's version
29
29
  ```
30
30
 
31
- The host serves `public/` itself and sends only the manifest's `api` paths to the runtime (`/api` and the two OAuth discovery documents of [MCP clients](../reference/auth.md#oauth-for-mcp-clients), and `/.well-known/webauthn`, for an app on [several origins](../reference/auth.md#several-origins)), so loading the UI never needs a running container. With the UI it sends `X-Frame-Options: DENY` and `Content-Security-Policy: frame-ancestors 'none'`, as `protobase serve` does, so no other site frames the app's pages. The runtime serves the API alone; `protobase serve dist` serves the whole folder the same way, to check a bundle locally. The host passes `DATABASE_URL`, `PORT` (default 8787) and optionally `PROTOBASE_DB_CONNECTIONS` (the connections the app may open, so its functions and jobs leave one to requests, see [`serve`](../reference/cli.md#serve)), `REQUEST_LOG`, `PROTOBASE_SMTP_URL` and `PROTOBASE_MAIL_FROM` (the mail server and sender for [password reset](../reference/auth.md#password-reset) and emailed sign-in codes) `PROTOBASE_APP_NAME` (the app's name in that mail, see [`appName`](../reference/auth.md#configuration)) `PROTOBASE_SIGN_IN_*` (a provider people with an account sign in with, the [platform sign-in provider](../reference/auth.md#platform-sign-in-provider)) `PROTOBASE_OPERATOR_*` (the provider its staff sign in with for [staff sign-in](../reference/auth.md#staff-sign-in)), `PROTOBASE_ORIGINS` and `PROTOBASE_PASSKEY_DOMAIN` (the app's [other origins](../reference/auth.md#several-origins) and its passkey domain) `PROTOBASE_CORS_ORIGINS` (the websites that may call its API, see [CORS](../reference/api.md#cors)), `PROTOBASE_TRUSTED_PROXIES` (the proxies in front of the runtime, whose `X-Forwarded-For` names the client the sign-in limits count, see [Client addresses](../reference/auth.md#client-addresses)) and `PROTOBASE_SENTRY_DSN` (the app's [error tracker](../reference/api.md#error-reporting)), `PROTOBASE_URL` and `PROTOBASE_SECRET` (the app's address and secret, unless its config sets [`url` and `secret`](../reference/config.md#defaults)), plus the project's own settings, which its config reads where it serves. The runtime and the config module are plain JavaScript for Bun: no install, no TypeScript, no writes. The runtime supplies protobase and the dependencies it runs on the server (`pg`, `postgres`, `kysely`, `better-auth`, ...), so the config module carries only the project's code and the other packages it uses. The manifest's `protobase` is the version the project is pinned to, and the host serves the bundle on the runtime of that version (see [Versioning](../reference/versioning.md#bundles-and-runtimes)). The manifest format and the routing rules are in the CLI reference: [`build`](../reference/cli.md#build), [`build-serve`](../reference/cli.md#build-serve) and [`serve`](../reference/cli.md#serve).
31
+ The host serves `public/` itself and sends only the manifest's `api` paths to the runtime (`/api` and the two OAuth discovery documents of [MCP clients](../reference/auth.md#oauth-for-mcp-clients), and `/.well-known/webauthn`, for an app on [several origins](../reference/auth.md#several-origins)), so loading the UI never needs a running container. With the UI it sends `X-Frame-Options: DENY` and `Content-Security-Policy: frame-ancestors 'none'`, as `protobase serve` does, so no other site frames the app's pages. The runtime serves the API alone; `protobase serve dist` serves the whole folder the same way, to check a bundle locally. The host passes `DATABASE_URL`, `PORT` (default 8787) and optionally `PROTOBASE_DB_CONNECTIONS` (the connections the app may open, so its functions and jobs leave one to requests, see [`serve`](../reference/cli.md#serve)), `REQUEST_LOG`, `PROTOBASE_SMTP_URL` and `PROTOBASE_MAIL_FROM` (the mail server and sender for [password reset](../reference/auth.md#password-reset) and emailed sign-in codes) `PROTOBASE_APP_NAME` (the app's name in that mail, see [`appName`](../reference/auth.md#configuration)) `PROTOBASE_SIGN_IN_*` (a provider people with an account sign in with, the [platform sign-in provider](../reference/auth.md#platform-sign-in-provider)) `PROTOBASE_OPERATOR_*` (the provider its staff sign in with for [staff sign-in](../reference/auth.md#staff-sign-in)), `PROTOBASE_ORIGINS` and `PROTOBASE_PASSKEY_DOMAIN` (the app's [other origins](../reference/auth.md#several-origins) and its passkey domain) `PROTOBASE_CORS_ORIGINS` (the websites that may call its API, see [CORS](../reference/api.md#cors)), `PROTOBASE_TRUSTED_PROXIES` (the proxies in front of the runtime, whose `X-Forwarded-For` names the client the sign-in limits count, see [Client addresses](../reference/auth.md#client-addresses)) and `PROTOBASE_SENTRY_DSN` (the app's [error tracker](../reference/api.md#error-reporting)), `PROTOBASE_URL` and `PROTOBASE_SECRET` (the app's address and secret, unless its config sets [`url` and `secret`](../reference/config/app.md)), plus the project's own settings, which its config reads where it serves. The runtime and the config module are plain JavaScript for Bun: no install, no TypeScript, no writes. The runtime supplies protobase and the dependencies it runs on the server (`pg`, `postgres`, `kysely`, `better-auth`, ...), so the config module carries only the project's code and the other packages it uses. The manifest's `protobase` is the version the project is pinned to, and the host serves the bundle on the runtime of that version (see [Versioning](../reference/versioning.md#bundles-and-runtimes)). The manifest format and the routing rules are in the CLI reference: [`build`](../reference/cli.md#build), [`build-serve`](../reference/cli.md#build-serve) and [`serve`](../reference/cli.md#serve).
32
32
 
33
33
  ## Migrations
34
34
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  Let users save a list as an Excel or CSV file, limit how many rows a file holds, or take Export off a list.
6
6
 
7
- Every list in the admin can be saved as a file: Rijnland's finance team wants this month's invoices in Excel, and the warehouse wants a CSV of the stock moves for a supplier. Nothing needs setting up for that; this guide shows what users get, and how a view limits it or takes it away. It uses the ERP example (`examples/erp`).
7
+ Every list in the admin can be saved as a file: Rijnland's finance team wants this month's invoices in Excel, and the warehouse wants a CSV of the stock moves for a supplier. Nothing needs setting up for that; this guide shows what users get, and how a view limits it or takes it away. It uses the ERP example (`tests/apps/erp`).
8
8
 
9
9
  ## 1. Export a list
10
10
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  Show and edit a field your own way everywhere the app shows it, with a field type a plugin registers and a view picks.
6
6
 
7
- An order's status is one of six values, and each order moves through them in turn: draft, confirmed, picking, shipped, delivered. The app shows it as a badge and edits it with a select. Rijnland's warehouse wants to see at a glance how far along an order is, and to move it with one click. That is a field type: a component that shows the value, one that edits it, and the storage types it works for. This guide adds one, `steps`, to the ERP example (`examples/erp`). [Field types](../reference/plugins.md#field-types) has the contract.
7
+ An order's status is one of six values, and each order moves through them in turn: draft, confirmed, picking, shipped, delivered. The app shows it as a badge and edits it with a select. Rijnland's warehouse wants to see at a glance how far along an order is, and to move it with one click. That is a field type: a component that shows the value, one that edits it, and the storage types it works for. This guide adds one, `steps`, to the ERP example (`tests/apps/erp`). [Field types](../reference/plugins.md#field-types) has the contract.
8
8
 
9
9
  ## 1. Show the value
10
10
 
@@ -224,7 +224,7 @@ A `CardRow` shows a few records side by side, and its children are the template
224
224
 
225
225
  There is no endpoint for "biggest unpaid delivery" and no component for "lead card". Every block reads the regular API with Sam's token, so the access rules apply exactly as on the lists. A sales rep with `orders.read.own` sees only their own orders in every count, table and card, and a field they may not read is not on their page at all (see [Access](../reference/layouts.md#access)).
226
226
 
227
- The ERP example carries this page, with a few more blocks, in `examples/erp/config/overview/page.tsx`. Next:
227
+ The ERP example carries this page, with a few more blocks, in `tests/apps/erp/config/overview/page.tsx`. Next:
228
228
 
229
229
  - [A billing page](billing-page.md) adds forms, delete and link actions, and a React component of your own.
230
230
  - [Blocks](../reference/blocks.md) lists every block and its props.
@@ -6,7 +6,7 @@ Build a plugin, serve it, load it into an app and change it without rebuilding t
6
6
 
7
7
  Sam's sales team wants the newest draft orders on their start page, each a link to the order. That is a few lines of React. Written in the app's `protobase.ui.tsx`, it would be that app's alone, shipped with each of its builds. Written as a [plugin](../reference/plugins.md) of its own, it is built once, served on its own, and loaded by every app that lists it when it starts, whatever release the app runs.
8
8
 
9
- This guide builds that plugin, serves it, loads it into an app and changes it without touching the app. It uses the orders of the ERP example (`examples/erp`); any resource of yours works the same.
9
+ This guide builds that plugin, serves it, loads it into an app and changes it without touching the app. It uses the orders of the ERP example (`tests/apps/erp`); any resource of yours works the same.
10
10
 
11
11
  ## 1. A folder for the plugin
12
12
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  Bring a spreadsheet of companies into the admin app with the list's Import, update them from another, and turn Import off where it does not belong.
6
6
 
7
- Rijnland's sales team keeps a spreadsheet of companies they met at a trade fair, and wants them in the ERP example (`examples/erp`) without typing each one. Every list offers **Import** to a user who may create its records, so there is nothing to build: this guide walks through an import, an update from a second file, and turning Import off. The [reference](../reference/ui-config.md#importing-records) has every rule.
7
+ Rijnland's sales team keeps a spreadsheet of companies they met at a trade fair, and wants them in the ERP example (`tests/apps/erp`) without typing each one. Every list offers **Import** to a user who may create its records, so there is nothing to build: this guide walks through an import, an update from a second file, and turning Import off. The [reference](../reference/ui-config.md#importing-records) has every rule.
8
8
 
9
9
  ## 1. Import new records
10
10
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  A choice each person makes for themselves, such as which emails they get, in a tab of the account page, from a table, a resource and roles, with no UI code.
6
6
 
7
- Rijnland's accountants want an email for each invoice that passes its due date; the warehouse would rather get none. That is a choice each person makes for themselves, so it belongs on their [account page](../reference/auth.md#account-page), and the fields the page shows come from a resource like any other. This guide adds it to the ERP example (`examples/erp`) in four steps: a table, a resource, roles and a tab.
7
+ Rijnland's accountants want an email for each invoice that passes its due date; the warehouse would rather get none. That is a choice each person makes for themselves, so it belongs on their [account page](../reference/auth.md#account-page), and the fields the page shows come from a resource like any other. This guide adds it to the ERP example (`tests/apps/erp`) in four steps: a table, a resource, roles and a tab.
8
8
 
9
9
  ## 1. A table with one row per person
10
10