@rebasepro/cli 0.33.2 → 0.34.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/{agent-setup-Cg_zBWoW.js → agent-setup-CGeAuP0Q.js} +2 -2
- package/dist/{agent-setup-Cg_zBWoW.js.map → agent-setup-CGeAuP0Q.js.map} +1 -1
- package/dist/{api-keys-fPQ55DCm.js → api-keys-DaWN8dyI.js} +3 -3
- package/dist/{api-keys-fPQ55DCm.js.map → api-keys-DaWN8dyI.js.map} +1 -1
- package/dist/{api-TbmW33D7.js → api-zx1wSK5a.js} +2 -2
- package/dist/{api-TbmW33D7.js.map → api-zx1wSK5a.js.map} +1 -1
- package/dist/{apps-DBTRoOeP.js → apps-D6vtDrkJ.js} +3 -3
- package/dist/{apps-DBTRoOeP.js.map → apps-D6vtDrkJ.js.map} +1 -1
- package/dist/{auth-BpyYLEFY.js → auth-DY7kU0z-.js} +8 -8
- package/dist/{auth-BpyYLEFY.js.map → auth-DY7kU0z-.js.map} +1 -1
- package/dist/{auth-session-B6aT0Dyj.js → auth-session-DCG96UGH.js} +4 -4
- package/dist/{auth-session-B6aT0Dyj.js.map → auth-session-DCG96UGH.js.map} +1 -1
- package/dist/{build-E5hfEWKj.js → build-D0egCUfU.js} +4 -4
- package/dist/{build-E5hfEWKj.js.map → build-D0egCUfU.js.map} +1 -1
- package/dist/{bundle-CIiKGrte.js → bundle-DhdhtD8K.js} +3 -3
- package/dist/{bundle-CIiKGrte.js.map → bundle-DhdhtD8K.js.map} +1 -1
- package/dist/{cloud-DNJyUU0T.js → cloud-DOR7bxDw.js} +218 -27
- package/dist/cloud-DOR7bxDw.js.map +1 -0
- package/dist/{command-Bks5xkrQ.js → command-BzSP5gBh.js} +2 -2
- package/dist/{command-Bks5xkrQ.js.map → command-BzSP5gBh.js.map} +1 -1
- package/dist/commands/cloud/db-connect.d.ts +31 -1
- package/dist/commands/cloud/db-query.d.ts +16 -0
- package/dist/commands/cloud/index.d.ts +1 -0
- package/dist/commands/cloud/resources.d.ts +19 -1
- package/dist/commands/dev.d.ts +15 -0
- package/dist/commands/users.d.ts +1 -0
- package/dist/{context-BOMEoKxn.js → context-xt20FMFA.js} +5 -1
- package/dist/{context-BOMEoKxn.js.map → context-xt20FMFA.js.map} +1 -1
- package/dist/{cron-CpUsQ739.js → cron-BGkXIB1N.js} +4 -4
- package/dist/{cron-CpUsQ739.js.map → cron-BGkXIB1N.js.map} +1 -1
- package/dist/{cron-ZRXsla0v.js → cron-CJ6Xk42E.js} +3 -3
- package/dist/{cron-ZRXsla0v.js.map → cron-CJ6Xk42E.js.map} +1 -1
- package/dist/{data-BJ9AZFUC.js → data-BpkvtCUe.js} +3 -3
- package/dist/{data-BJ9AZFUC.js.map → data-BpkvtCUe.js.map} +1 -1
- package/dist/{debug-nNbbxAeo.js → debug-C7Ss34XB.js} +2 -2
- package/dist/{debug-nNbbxAeo.js.map → debug-C7Ss34XB.js.map} +1 -1
- package/dist/{derive-Mky_u59_.js → derive-ChP6vgfi.js} +2 -2
- package/dist/{derive-Mky_u59_.js.map → derive-ChP6vgfi.js.map} +1 -1
- package/dist/{dev-bj6dEeSQ.js → dev-C7n36E6f.js} +23 -2
- package/dist/dev-C7n36E6f.js.map +1 -0
- package/dist/{doctor-FaBObSlb.js → doctor-D0o54XSQ.js} +2 -2
- package/dist/{doctor-FaBObSlb.js.map → doctor-D0o54XSQ.js.map} +1 -1
- package/dist/{fold-static-2t3UUX4z.js → fold-static-DTpaqbB0.js} +2 -2
- package/dist/{fold-static-2t3UUX4z.js.map → fold-static-DTpaqbB0.js.map} +1 -1
- package/dist/{function-portability-BIvlvR9q.js → function-portability-Dppl6uqg.js} +24 -5
- package/dist/{function-portability-BIvlvR9q.js.map → function-portability-Dppl6uqg.js.map} +1 -1
- package/dist/function-portability.d.ts +9 -0
- package/dist/{functions-B4JR6EZL.js → functions-DLuuldt2.js} +4 -4
- package/dist/{functions-B4JR6EZL.js.map → functions-DLuuldt2.js.map} +1 -1
- package/dist/{generate_sdk-ByD-gTsK.js → generate_sdk-UT1lwwRT.js} +2 -2
- package/dist/{generate_sdk-ByD-gTsK.js.map → generate_sdk-UT1lwwRT.js.map} +1 -1
- package/dist/index.es.js +39 -39
- package/dist/{init-DHCe5mJ5.js → init-u5Xmr1Ct.js} +4 -4
- package/dist/{init-DHCe5mJ5.js.map → init-u5Xmr1Ct.js.map} +1 -1
- package/dist/{logs-DpuMukJe.js → logs-DBYRSs6W.js} +4 -4
- package/dist/{logs-DpuMukJe.js.map → logs-DBYRSs6W.js.map} +1 -1
- package/dist/{migrate-CSY9ZDKy.js → migrate-Cw1FkvUK.js} +3 -3
- package/dist/{migrate-CSY9ZDKy.js.map → migrate-Cw1FkvUK.js.map} +1 -1
- package/dist/{normalize-imports-P86NVfpo.js → normalize-imports-E4yA1HfW.js} +2 -2
- package/dist/{normalize-imports-P86NVfpo.js.map → normalize-imports-E4yA1HfW.js.map} +1 -1
- package/dist/{project-command-Cl9EZzjr.js → project-command-7EGMemEy.js} +5 -5
- package/dist/{project-command-Cl9EZzjr.js.map → project-command-7EGMemEy.js.map} +1 -1
- package/dist/{resources-Db3USuPO.js → resources-CE6BeL94.js} +2 -2
- package/dist/{resources-Db3USuPO.js.map → resources-CE6BeL94.js.map} +1 -1
- package/dist/{rls-BxrQ0P50.js → rls-BxWLfEKl.js} +3 -3
- package/dist/{rls-BxrQ0P50.js.map → rls-BxWLfEKl.js.map} +1 -1
- package/dist/{schema-_FzZEoB8.js → schema-D8xFSBbN.js} +7 -6
- package/dist/{schema-_FzZEoB8.js.map → schema-D8xFSBbN.js.map} +1 -1
- package/dist/schema-reconcile-D_wvZY91.js +2 -0
- package/dist/{schema-show-h72UJ9zH.js → schema-show-C7bY7SgE.js} +3 -3
- package/dist/{schema-show-h72UJ9zH.js.map → schema-show-C7bY7SgE.js.map} +1 -1
- package/dist/{skills-DQ2bZGkj.js → skills-C8WdRTFg.js} +4 -4
- package/dist/{skills-DQ2bZGkj.js.map → skills-C8WdRTFg.js.map} +1 -1
- package/dist/{start-Cjx4W0bJ.js → start-CN_9C205.js} +2 -2
- package/dist/{start-Cjx4W0bJ.js.map → start-CN_9C205.js.map} +1 -1
- package/dist/{status-CDBk25VO.js → status-HWlZbY1E.js} +2 -2
- package/dist/{status-CDBk25VO.js.map → status-HWlZbY1E.js.map} +1 -1
- package/dist/{storage-Clc8dLG8.js → storage-DBE8lgH-.js} +9 -9
- package/dist/{storage-Clc8dLG8.js.map → storage-DBE8lgH-.js.map} +1 -1
- package/dist/{storage-objects-CfRKlTDe.js → storage-objects-ljDmtuH7.js} +3 -3
- package/dist/{storage-objects-CfRKlTDe.js.map → storage-objects-ljDmtuH7.js.map} +1 -1
- package/dist/{users-5PkqBY6R.js → users-DrJEtL9k.js} +9 -6
- package/dist/users-DrJEtL9k.js.map +1 -0
- package/package.json +10 -10
- package/templates/template/.cursorrules +2 -1
- package/templates/template/.github/copilot-instructions.md +2 -1
- package/templates/template/.windsurfrules +2 -1
- package/templates/template/AGENTS.md +2 -1
- package/templates/template/CLAUDE.md +2 -1
- package/templates/template/ai-instructions.md +5 -2
- package/templates/template/frontend/src/index.css +13 -0
- package/dist/cloud-DNJyUU0T.js.map +0 -1
- package/dist/dev-bj6dEeSQ.js.map +0 -1
- package/dist/schema-reconcile-DV14XY4o.js +0 -2
- package/dist/users-5PkqBY6R.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as unknownCommand } from "./unknown-command-DnZ2uhGs.js";
|
|
2
2
|
import { a as wantsHelp, n as parseCommandArgs, t as UsageError } from "./args-DHyrshtI.js";
|
|
3
|
-
import { a as projectTarget, c as requestJson, d as PROJECT_TARGET_FLAGS, i as printProjectHelp, l as startProjectCommand, n as isRecord, o as recordsOf, r as parsedLine, t as cellText, u as stringOf } from "./project-command-
|
|
4
|
-
import { M as note, ct as warn, k as keyValues, l as confirmDestructive, m as emit, st as success, v as fail } from "./context-
|
|
3
|
+
import { a as projectTarget, c as requestJson, d as PROJECT_TARGET_FLAGS, i as printProjectHelp, l as startProjectCommand, n as isRecord, o as recordsOf, r as parsedLine, t as cellText, u as stringOf } from "./project-command-7EGMemEy.js";
|
|
4
|
+
import { M as note, ct as warn, k as keyValues, l as confirmDestructive, m as emit, st as success, v as fail } from "./context-xt20FMFA.js";
|
|
5
5
|
import chalk from "chalk";
|
|
6
6
|
//#region src/commands/users.ts
|
|
7
7
|
/** Everything the switch below dispatches, for the did-you-mean. */
|
|
@@ -157,7 +157,8 @@ var CREATE_USER_FLAGS = {
|
|
|
157
157
|
"--name": String,
|
|
158
158
|
"--role": [String],
|
|
159
159
|
"--password": String,
|
|
160
|
-
"--skip-password-policy": Boolean
|
|
160
|
+
"--skip-password-policy": Boolean,
|
|
161
|
+
"--no-invite": Boolean
|
|
161
162
|
};
|
|
162
163
|
async function createUser(rawArgs) {
|
|
163
164
|
const { flags, positionals } = parsedLine(() => parseCommandArgs({
|
|
@@ -181,7 +182,8 @@ async function createUser(rawArgs) {
|
|
|
181
182
|
...flags["--name"] ? { displayName: flags["--name"] } : {},
|
|
182
183
|
...flags["--password"] ? { password: flags["--password"] } : {},
|
|
183
184
|
...roles ? { roles } : {},
|
|
184
|
-
...flags["--skip-password-policy"] ? { skipPasswordPolicy: true } : {}
|
|
185
|
+
...flags["--skip-password-policy"] ? { skipPasswordPolicy: true } : {},
|
|
186
|
+
...flags["--no-invite"] ? { invite: false } : {}
|
|
185
187
|
}
|
|
186
188
|
});
|
|
187
189
|
const user = userOf(body);
|
|
@@ -497,7 +499,8 @@ var USERS_ACTIONS = [
|
|
|
497
499
|
["--name <name>", "Display name"],
|
|
498
500
|
["--role <role>", "A role to give it (repeatable, or a,b)"],
|
|
499
501
|
["--password <password>", "Set this password instead of inviting"],
|
|
500
|
-
["--skip-password-policy", "Accept a password the policy would refuse (imports)"]
|
|
502
|
+
["--skip-password-policy", "Accept a password the policy would refuse (imports)"],
|
|
503
|
+
["--no-invite", "No password and no email: for an app that signs in by magic link, code or provider"]
|
|
501
504
|
]
|
|
502
505
|
},
|
|
503
506
|
{
|
|
@@ -558,4 +561,4 @@ function printUsersHelp() {
|
|
|
558
561
|
//#endregion
|
|
559
562
|
export { USERS_SUBCOMMANDS, usersCommand };
|
|
560
563
|
|
|
561
|
-
//# sourceMappingURL=users-
|
|
564
|
+
//# sourceMappingURL=users-DrJEtL9k.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"users-DrJEtL9k.js","names":[],"sources":["../src/commands/users.ts"],"sourcesContent":["/**\n * CLI command: rebase users <action>\n *\n * The accounts of a running app, through its `/api/admin/users`, `/roles` and\n * `/guests` routes — the ones the admin panel's user screen uses. The same\n * target and credential every project command resolves; the service key holds\n * `users:read` and `users:write`, and the server refuses to let any caller\n * grant a role above its own or act on an account that outranks it.\n *\n * Roles are declared in code (the auth table's `auth.roles`); `users roles`\n * lists them and `users update --role` assigns them.\n */\nimport type arg from \"arg\";\nimport chalk from \"chalk\";\n\nimport { parseCommandArgs, UsageError, wantsHelp } from \"../utils/args\";\nimport { unknownCommand } from \"../utils/unknown-command\";\nimport { PROJECT_TARGET_FLAGS, type ProjectTarget } from \"../utils/project-target\";\nimport {\n cellText,\n emit,\n fail,\n isRecord,\n parsedLine,\n printProjectHelp,\n projectTarget,\n recordsOf,\n requestJson,\n startProjectCommand,\n stringOf,\n type HelpAction\n} from \"../utils/project-command\";\nimport { confirmDestructive, keyValues, note, success, warn } from \"./cloud/context\";\n\n/** Everything the switch below dispatches, for the did-you-mean. */\nexport const USERS_SUBCOMMANDS = [\n \"list\", \"get\", \"create\", \"update\", \"delete\", \"reset-password\", \"mfa-reset\", \"roles\", \"guests\"\n] as const;\n\nexport async function usersCommand(subcommand: string | undefined, rawArgs: string[]): Promise<void> {\n startProjectCommand(rawArgs);\n if (!subcommand || subcommand === \"--help\" || wantsHelp(rawArgs)) {\n printUsersHelp();\n return;\n }\n switch (subcommand) {\n case \"list\":\n await listUsers(rawArgs);\n break;\n case \"get\":\n await getUser(rawArgs);\n break;\n case \"create\":\n await createUser(rawArgs);\n break;\n case \"update\":\n await updateUser(rawArgs);\n break;\n case \"delete\":\n await deleteUser(rawArgs);\n break;\n case \"reset-password\":\n await resetPassword(rawArgs, \"users reset-password\");\n break;\n case \"mfa-reset\":\n await resetMfa(rawArgs);\n break;\n case \"roles\":\n await listRoles(rawArgs);\n break;\n case \"guests\":\n await guests(rawArgs);\n break;\n default:\n unknownCommand(subcommand, USERS_SUBCOMMANDS, \"users\");\n }\n}\n\n/* ═══════════════════════════════════════════════════════════════\n Shared\n ═══════════════════════════════════════════════════════════════ */\n\nconst ADMIN = \"/api/admin\";\n\nfunction describeUser(user: Record<string, unknown>): Array<[string, string]> {\n const roles = Array.isArray(user.roles) ? user.roles.map(String).join(\", \") : \"\";\n const rows: Array<[string, string]> = [\n [\"uid\", stringOf(user.uid ?? user.id) ?? \"\"],\n [\"email\", stringOf(user.email) ?? \"\"],\n [\"name\", stringOf(user.displayName) ?? \"\"],\n [\"roles\", roles || chalk.gray(\"none\")]\n ];\n if (user.disabled === true) rows.push([\"status\", chalk.red(\"disabled\")]);\n if (user.isAnonymous === true) rows.push([\"kind\", \"guest\"]);\n if (user.createdAt) rows.push([\"created\", cellText(user.createdAt)]);\n if (user.lastSignInAt ?? user.lastLoginAt) rows.push([\"last sign-in\", cellText(user.lastSignInAt ?? user.lastLoginAt)]);\n return rows;\n}\n\nfunction userOf(body: unknown): Record<string, unknown> | undefined {\n if (isRecord(body) && isRecord(body.user)) return body.user;\n return isRecord(body) ? body : undefined;\n}\n\n/**\n * An account by uid, or by email when the argument holds an `@` — an exact,\n * case-insensitive match among the search results, never the first fuzzy hit:\n * `/admin/users?search=` matches email or display name with ILIKE, and the\n * first match for `bob@x.com` can be `bob@x.com.au`.\n */\nasync function resolveUid(target: ProjectTarget, ref: string): Promise<string> {\n if (!ref.includes(\"@\")) return ref;\n const body = await requestJson(target, `${ADMIN}/users`, `Failed to look up ${ref}`, { query: { search: ref, limit: \"50\" } });\n const users = recordsOf(isRecord(body) ? body.users : undefined);\n const wanted = ref.toLowerCase();\n const match = users.find(user => stringOf(user.email)?.toLowerCase() === wanted);\n const uid = match ? stringOf(match.uid ?? match.id) : undefined;\n if (!uid) {\n fail(`No account has the email ${ref} on ${target.label}.`, \"`rebase users list --search <text>` searches by email and name.\", \"not_found\");\n }\n return uid;\n}\n\n/** `--role a --role b` or `--role a,b`, deduplicated. */\nfunction rolesOf(values: readonly string[] | undefined): string[] | undefined {\n if (!values) return undefined;\n return [...new Set(values.flatMap(value => value.split(\",\")).map(role => role.trim()).filter(Boolean))];\n}\n\n/* ═══════════════════════════════════════════════════════════════\n list / get\n ═══════════════════════════════════════════════════════════════ */\n\nexport const LIST_USERS_FLAGS = {\n ...PROJECT_TARGET_FLAGS,\n \"--search\": String,\n \"-s\": \"--search\",\n \"--role\": String,\n \"--limit\": Number,\n \"-n\": \"--limit\",\n \"--offset\": Number\n} satisfies arg.Spec;\n\nasync function listUsers(rawArgs: string[]): Promise<void> {\n const { flags } = parsedLine(() => parseCommandArgs({\n spec: LIST_USERS_FLAGS,\n rawArgs,\n commandWords: 2,\n command: \"users list\",\n maxPositionals: 0\n }));\n const target = await projectTarget(flags, { command: \"users list\" });\n const body = await requestJson(target, `${ADMIN}/users`, \"Failed to list users\", {\n query: {\n search: flags[\"--search\"],\n role: flags[\"--role\"],\n limit: flags[\"--limit\"]?.toString(),\n offset: flags[\"--offset\"]?.toString()\n }\n });\n const users = recordsOf(isRecord(body) ? body.users : undefined);\n const total = isRecord(body) && typeof body.total === \"number\" ? body.total : users.length;\n emit(() => {\n if (users.length === 0) return note(\"No users match.\");\n for (const user of users) {\n const roles = Array.isArray(user.roles) ? user.roles.map(String).join(\", \") : \"\";\n const flagsText = [user.disabled === true ? chalk.red(\"disabled\") : \"\", user.isAnonymous === true ? chalk.gray(\"guest\") : \"\"].filter(Boolean).join(\" \");\n console.log(` ${chalk.bold(stringOf(user.email) ?? stringOf(user.uid) ?? \"?\")} ${chalk.gray(stringOf(user.uid ?? user.id) ?? \"\")} ${roles ? chalk.cyan(roles) : \"\"} ${flagsText}`.trimEnd());\n }\n if (total > users.length) note(chalk.gray(`${users.length} of ${total}; --offset ${(flags[\"--offset\"] ?? 0) + users.length} for the next page.`));\n }, body);\n}\n\nexport const GET_USER_FLAGS = { ...PROJECT_TARGET_FLAGS } satisfies arg.Spec;\n\nasync function getUser(rawArgs: string[]): Promise<void> {\n const { flags, positionals } = parsedLine(() => parseCommandArgs({\n spec: GET_USER_FLAGS,\n rawArgs,\n commandWords: 2,\n command: \"users get\",\n maxPositionals: 1\n }));\n const ref = parsedLine(() => {\n if (!positionals[0]) throw new UsageError(\"rebase users get needs a uid or an email: rebase users get <uid|email>.\");\n return positionals[0];\n });\n const target = await projectTarget(flags, { command: \"users get\" });\n const uid = await resolveUid(target, ref);\n const body = await requestJson(target, `${ADMIN}/users/${encodeURIComponent(uid)}`, `Failed to read ${ref}`);\n const user = userOf(body);\n emit(() => keyValues(user ? describeUser(user) : []), user ?? body);\n}\n\n/* ═══════════════════════════════════════════════════════════════\n create / update / delete\n ═══════════════════════════════════════════════════════════════ */\n\nexport const CREATE_USER_FLAGS = {\n ...PROJECT_TARGET_FLAGS,\n \"--email\": String,\n \"-e\": \"--email\",\n \"--name\": String,\n \"--role\": [String],\n \"--password\": String,\n \"--skip-password-policy\": Boolean,\n \"--no-invite\": Boolean\n} satisfies arg.Spec;\n\nasync function createUser(rawArgs: string[]): Promise<void> {\n const { flags, positionals } = parsedLine(() => parseCommandArgs({\n spec: CREATE_USER_FLAGS,\n rawArgs,\n commandWords: 2,\n command: \"users create\",\n maxPositionals: 1\n }));\n const email = parsedLine(() => {\n const value = flags[\"--email\"] ?? positionals[0];\n if (!value || !value.includes(\"@\")) throw new UsageError(\"rebase users create needs an email: rebase users create <email> [--role admin].\");\n return value.trim();\n });\n const target = await projectTarget(flags, { command: \"users create\" });\n const roles = rolesOf(flags[\"--role\"]);\n const body = await requestJson(target, `${ADMIN}/users`, `Failed to create ${email}`, {\n method: \"POST\",\n json: {\n email,\n ...(flags[\"--name\"] ? { displayName: flags[\"--name\"] } : {}),\n ...(flags[\"--password\"] ? { password: flags[\"--password\"] } : {}),\n ...(roles ? { roles } : {}),\n ...(flags[\"--skip-password-policy\"] ? { skipPasswordPolicy: true } : {}),\n ...(flags[\"--no-invite\"] ? { invite: false } : {})\n }\n });\n const user = userOf(body);\n const temporary = isRecord(body) ? stringOf(body.temporaryPassword) : undefined;\n emit(() => {\n success(`Created ${email}${roles?.length ? ` (${roles.join(\", \")})` : \"\"} on ${target.label}.`);\n if (user) keyValues(describeUser(user));\n if (isRecord(body) && body.invitationSent === true) note(\"An invitation was emailed.\");\n if (temporary) {\n warn(\"No invitation could be sent, so the server set a temporary password. It is shown this once:\", temporary);\n }\n }, body);\n}\n\nexport const UPDATE_USER_FLAGS = {\n ...PROJECT_TARGET_FLAGS,\n \"--email\": String,\n \"--name\": String,\n \"--role\": [String],\n \"--add-role\": [String],\n \"--remove-role\": [String],\n \"--disable\": Boolean,\n \"--enable\": Boolean\n} satisfies arg.Spec;\n\nasync function updateUser(rawArgs: string[]): Promise<void> {\n const { flags, positionals } = parsedLine(() => parseCommandArgs({\n spec: UPDATE_USER_FLAGS,\n rawArgs,\n commandWords: 2,\n command: \"users update\",\n maxPositionals: 1\n }));\n const ref = parsedLine(() => {\n if (!positionals[0]) throw new UsageError(\"rebase users update needs a uid or an email: rebase users update <uid|email> --role admin.\");\n if (flags[\"--disable\"] && flags[\"--enable\"]) throw new UsageError(\"--disable and --enable contradict each other.\");\n if (flags[\"--role\"] && (flags[\"--add-role\"] || flags[\"--remove-role\"])) {\n throw new UsageError(\"--role sets the whole list; --add-role and --remove-role change it. Use one or the other.\");\n }\n return positionals[0];\n });\n const target = await projectTarget(flags, { command: \"users update\" });\n const uid = await resolveUid(target, ref);\n\n let roles = rolesOf(flags[\"--role\"]);\n const adding = rolesOf(flags[\"--add-role\"]);\n const removing = rolesOf(flags[\"--remove-role\"]);\n let before: string[] | undefined;\n if (adding || removing || roles) {\n const current = userOf(await requestJson(target, `${ADMIN}/users/${encodeURIComponent(uid)}`, `Failed to read ${ref}`));\n before = Array.isArray(current?.roles) ? current.roles.map(String) : [];\n if (adding || removing) {\n roles = [...new Set([...before, ...(adding ?? [])])].filter(role => !(removing ?? []).includes(role));\n }\n }\n const change: Record<string, unknown> = {\n ...(flags[\"--email\"] ? { email: flags[\"--email\"] } : {}),\n ...(flags[\"--name\"] !== undefined ? { displayName: flags[\"--name\"] } : {}),\n ...(roles ? { roles } : {}),\n ...(flags[\"--disable\"] ? { disabled: true } : {}),\n ...(flags[\"--enable\"] ? { disabled: false } : {})\n };\n if (Object.keys(change).length === 0) {\n parsedLine(() => {\n throw new UsageError(\"Nothing to change: pass --role, --add-role, --remove-role, --name, --email, --disable or --enable.\");\n });\n }\n // Granting a role hands out what that role may do; disabling locks\n // somebody out. Both say what they are about to do and wait.\n const granted = roles && before ? roles.filter(role => !before?.includes(role)) : [];\n if (granted.length > 0 || flags[\"--disable\"]) {\n const what = [granted.length ? `grant ${granted.join(\", \")}` : \"\", flags[\"--disable\"] ? \"disable the account\" : \"\"].filter(Boolean).join(\" and \");\n await confirmDestructive({ yes: flags[\"--yes\"] === true, prompt: `${what[0].toUpperCase()}${what.slice(1)} for ${ref} on ${target.label}?` });\n }\n const body = await requestJson(target, `${ADMIN}/users/${encodeURIComponent(uid)}`, `Failed to update ${ref}`, { method: \"PUT\", json: change });\n const user = userOf(body);\n emit(() => {\n success(`Updated ${ref}.`);\n if (user) keyValues(describeUser(user));\n }, body);\n}\n\nexport const DELETE_USER_FLAGS = { ...PROJECT_TARGET_FLAGS } satisfies arg.Spec;\n\nasync function deleteUser(rawArgs: string[]): Promise<void> {\n const { flags, positionals } = parsedLine(() => parseCommandArgs({\n spec: DELETE_USER_FLAGS,\n rawArgs,\n commandWords: 2,\n command: \"users delete\",\n maxPositionals: 1\n }));\n const ref = parsedLine(() => {\n if (!positionals[0]) throw new UsageError(\"rebase users delete needs a uid or an email: rebase users delete <uid|email>.\");\n return positionals[0];\n });\n const target = await projectTarget(flags, { command: \"users delete\" });\n const uid = await resolveUid(target, ref);\n await confirmDestructive({ yes: flags[\"--yes\"] === true, prompt: `Delete the account ${ref} on ${target.label}? This cannot be undone.` });\n await requestJson(target, `${ADMIN}/users/${encodeURIComponent(uid)}`, `Failed to delete ${ref}`, { method: \"DELETE\" });\n emit(() => success(`Deleted ${ref}.`), { uid, deleted: true });\n}\n\n/* ═══════════════════════════════════════════════════════════════\n reset-password / mfa-reset\n ═══════════════════════════════════════════════════════════════ */\n\nexport const RESET_PASSWORD_FLAGS = {\n ...PROJECT_TARGET_FLAGS,\n \"--email\": String,\n \"-e\": \"--email\",\n \"--password\": String\n} satisfies arg.Spec;\n\n/**\n * Reset an account's password: an emailed reset invitation, or — with\n * `--password`, or when no email can be sent — a password set now. Exported\n * for `rebase auth reset-password`, the older spelling, which keeps its\n * direct-database fallback for a server that is not running.\n */\nexport async function resetPassword(rawArgs: string[], command: \"users reset-password\"): Promise<void> {\n const { flags, positionals } = parsedLine(() => parseCommandArgs({\n spec: RESET_PASSWORD_FLAGS,\n rawArgs,\n commandWords: 2,\n command: \"users reset-password\",\n maxPositionals: 1\n }));\n const ref = parsedLine(() => {\n const value = flags[\"--email\"] ?? positionals[0];\n if (!value) throw new UsageError(`rebase ${command} needs an email or uid: rebase ${command} <email|uid> [--password <new>].`);\n return value;\n });\n const target = await projectTarget(flags, { command });\n const uid = await resolveUid(target, ref);\n const body = await requestJson(target, `${ADMIN}/users/${encodeURIComponent(uid)}/reset-password`, `Failed to reset the password of ${ref}`, {\n method: \"POST\",\n ...(flags[\"--password\"] ? { json: { password: flags[\"--password\"] } } : {})\n });\n const temporary = isRecord(body) ? stringOf(body.temporaryPassword) : undefined;\n emit(() => {\n if (flags[\"--password\"]) success(`Set a new password for ${ref}.`);\n else if (isRecord(body) && body.invitationSent === true) success(`Emailed a reset link to ${ref}.`);\n else success(`Reset the password of ${ref}.`);\n if (temporary) warn(\"No email could be sent, so the server set a temporary password. It is shown this once:\", temporary);\n }, body);\n}\n\nexport const MFA_RESET_FLAGS = { ...PROJECT_TARGET_FLAGS } satisfies arg.Spec;\n\nasync function resetMfa(rawArgs: string[]): Promise<void> {\n const { flags, positionals } = parsedLine(() => parseCommandArgs({\n spec: MFA_RESET_FLAGS,\n rawArgs,\n commandWords: 2,\n command: \"users mfa-reset\",\n maxPositionals: 1\n }));\n const ref = parsedLine(() => {\n if (!positionals[0]) throw new UsageError(\"rebase users mfa-reset needs a uid or an email.\");\n return positionals[0];\n });\n const target = await projectTarget(flags, { command: \"users mfa-reset\" });\n const uid = await resolveUid(target, ref);\n await confirmDestructive({ yes: flags[\"--yes\"] === true, prompt: `Remove every second factor and recovery code of ${ref}, and sign them out everywhere?` });\n const body = await requestJson(target, `${ADMIN}/users/${encodeURIComponent(uid)}/mfa`, `Failed to reset the second factors of ${ref}`, { method: \"DELETE\" });\n const removed = isRecord(body) && typeof body.removedFactors === \"number\" ? body.removedFactors : undefined;\n emit(() => success(`Removed ${removed ?? \"the\"} second factor(s) of ${ref}; their sessions are ended.`), body);\n}\n\n/* ═══════════════════════════════════════════════════════════════\n roles\n ═══════════════════════════════════════════════════════════════ */\n\nexport const ROLES_FLAGS = { ...PROJECT_TARGET_FLAGS } satisfies arg.Spec;\n\nasync function listRoles(rawArgs: string[]): Promise<void> {\n const { flags } = parsedLine(() => parseCommandArgs({\n spec: ROLES_FLAGS,\n rawArgs,\n commandWords: 2,\n command: \"users roles\",\n maxPositionals: 0\n }));\n const target = await projectTarget(flags, { command: \"users roles\" });\n const body = await requestJson(target, `${ADMIN}/roles`, \"Failed to list roles\");\n const roles = recordsOf(isRecord(body) ? body.roles : undefined);\n emit(() => {\n if (roles.length === 0) return note(\"No roles are declared (the auth table's auth.roles).\");\n for (const role of roles) {\n const scopes = Array.isArray(role.scopes) ? role.scopes.map(String).join(\", \") : \"\";\n console.log(` ${chalk.bold(stringOf(role.id ?? role.name) ?? \"?\")}${role.name && role.id && role.name !== role.id ? ` ${chalk.gray(String(role.name))}` : \"\"}`);\n if (scopes) console.log(chalk.gray(` ${scopes}`));\n }\n }, body);\n}\n\n/* ═══════════════════════════════════════════════════════════════\n guests\n ═══════════════════════════════════════════════════════════════ */\n\nexport const GUESTS_FLAGS = {\n ...PROJECT_TARGET_FLAGS,\n \"--older-than\": String,\n \"--limit\": Number,\n \"-n\": \"--limit\"\n} satisfies arg.Spec;\n\n/** `30d`, `12h`, `2w`, or a bare number of days, as a date that far in the past. Exported for tests. */\nexport function olderThan(value: string, now: Date = new Date()): Date {\n const match = /^(\\d+)\\s*([hdw]?)$/i.exec(value.trim());\n if (!match) throw new UsageError(`--older-than takes an age like 30d, 12h or 2w (got \"${value}\").`);\n const amount = Number(match[1]);\n const unit = (match[2] || \"d\").toLowerCase();\n const hours = unit === \"h\" ? amount : unit === \"w\" ? amount * 24 * 7 : amount * 24;\n return new Date(now.getTime() - hours * 3_600_000);\n}\n\n/**\n * Guest accounts — the ones anonymous sign-in leaves behind: `users guests`\n * lists them (the oldest first), `users guests delete <uid>` deletes one, and\n * `users guests prune --older-than 30d` deletes every guest not seen since,\n * a batch at a time; without --yes it only says how many it would delete.\n */\nasync function guests(rawArgs: string[]): Promise<void> {\n const { flags, positionals } = parsedLine(() => parseCommandArgs({\n spec: GUESTS_FLAGS,\n rawArgs,\n commandWords: 2,\n command: \"users guests\",\n maxPositionals: 2\n }));\n const action = positionals[0] ?? \"list\";\n if (![\"list\", \"delete\", \"prune\"].includes(action)) {\n unknownCommand(action, [\"list\", \"delete\", \"prune\"], \"users guests\");\n }\n const target = await projectTarget(flags, { command: \"users guests\" });\n const before = flags[\"--older-than\"] ? parsedLine(() => olderThan(flags[\"--older-than\"] ?? \"\")) : undefined;\n\n if (action === \"delete\") {\n const uid = parsedLine(() => {\n if (!positionals[1]) throw new UsageError(\"rebase users guests delete needs the guest's uid.\");\n return positionals[1];\n });\n await confirmDestructive({ yes: flags[\"--yes\"] === true, prompt: `Delete the guest ${uid} on ${target.label}?` });\n await requestJson(target, `${ADMIN}/guests/${encodeURIComponent(uid)}`, `Failed to delete guest ${uid}`, { method: \"DELETE\" });\n emit(() => success(`Deleted guest ${uid}.`), { uid, deleted: true });\n return;\n }\n\n if (action === \"prune\") {\n if (!before) parsedLine(() => {\n throw new UsageError(\"rebase users guests prune needs --older-than <age> (e.g. 30d): the guests not seen since then are deleted.\");\n });\n const cutoff = before ?? new Date();\n const listed = await requestJson(target, `${ADMIN}/guests`, \"Failed to count guests\", { query: { lastSeenBefore: cutoff.toISOString(), limit: \"1\" } });\n const total = isRecord(listed) && typeof listed.total === \"number\" ? listed.total : undefined;\n if (!flags[\"--yes\"]) {\n emit(\n () => note(`${total ?? \"Some\"} guest(s) were last seen before ${cutoff.toISOString()}. Re-run with --yes to delete them.`),\n { lastSeenBefore: cutoff.toISOString(), wouldDelete: total ?? null, deleted: 0 }\n );\n return;\n }\n let deleted = 0;\n let offset = 0;\n for (;;) {\n const body = await requestJson(target, `${ADMIN}/guests`, \"Failed to delete guests\", {\n method: \"DELETE\",\n query: { lastSeenBefore: cutoff.toISOString(), ...(offset ? { offset: String(offset) } : {}) }\n });\n const batch = isRecord(body) && typeof body.deleted === \"number\" ? body.deleted : 0;\n const skipped = isRecord(body) && typeof body.skipped === \"number\" ? body.skipped : 0;\n const remaining = isRecord(body) && typeof body.remaining === \"number\" ? body.remaining : 0;\n deleted += batch;\n offset += skipped;\n if (remaining === 0 || (batch === 0 && skipped === 0)) break;\n }\n emit(() => success(`Deleted ${deleted} guest(s) last seen before ${cutoff.toISOString()}.`), { lastSeenBefore: cutoff.toISOString(), deleted });\n return;\n }\n\n const body = await requestJson(target, `${ADMIN}/guests`, \"Failed to list guests\", {\n query: { lastSeenBefore: before?.toISOString(), limit: flags[\"--limit\"]?.toString() }\n });\n const list = recordsOf(isRecord(body) ? body.guests : undefined);\n const total = isRecord(body) && typeof body.total === \"number\" ? body.total : list.length;\n emit(() => {\n note(`${total} guest account(s)${before ? ` last seen before ${before.toISOString()}` : \"\"}.`);\n for (const guest of list) {\n console.log(` ${stringOf(guest.uid ?? guest.id) ?? \"?\"} ${chalk.gray(`last seen ${cellText(guest.lastSeenAt ?? guest.lastSignInAt ?? guest.createdAt)}`)}`);\n }\n }, body);\n}\n\n/* ═══════════════════════════════════════════════════════════════\n Help\n ═══════════════════════════════════════════════════════════════ */\n\nexport const USERS_ACTIONS: HelpAction[] = [\n { action: \"list\", description: \"The accounts, newest first\", flags: [[\"--search, -s <text>\", \"Match email or name\"], [\"--role <role>\", \"Only accounts holding this role\"], [\"--limit, -n <n>\", \"Page size\"], [\"--offset <n>\", \"Skip this many\"]] },\n { action: \"get\", args: \"<uid|email>\", description: \"One account\" },\n {\n action: \"create\",\n args: \"<email>\",\n description: \"Create an account; it is emailed an invitation, or shown a temporary password\",\n flags: [[\"--email, -e <email>\", \"The email (or as the argument)\"], [\"--name <name>\", \"Display name\"], [\"--role <role>\", \"A role to give it (repeatable, or a,b)\"], [\"--password <password>\", \"Set this password instead of inviting\"], [\"--skip-password-policy\", \"Accept a password the policy would refuse (imports)\"], [\"--no-invite\", \"No password and no email: for an app that signs in by magic link, code or provider\"]]\n },\n {\n action: \"update\",\n args: \"<uid|email>\",\n description: \"Change roles, name, email, or switch the account off (confirms grants and --disable)\",\n flags: [[\"--role <role>\", \"Set the whole role list (repeatable, or a,b)\"], [\"--add-role <role>\", \"Add a role\"], [\"--remove-role <role>\", \"Remove a role\"], [\"--name <name>\", \"Display name\"], [\"--email <email>\", \"Email\"], [\"--disable\", \"No sign-in, every token refused at once\"], [\"--enable\", \"Switch it back on\"]]\n },\n { action: \"delete\", args: \"<uid|email>\", description: \"Delete an account (confirms)\" },\n { action: \"reset-password\", args: \"<email|uid>\", description: \"Email a reset link, or set a password now\", flags: [[\"--email, -e <email>\", \"The account (or as the argument)\"], [\"--password <password>\", \"Set this password instead of emailing a link\"]] },\n { action: \"mfa-reset\", args: \"<uid|email>\", description: \"Remove every second factor and recovery code, end the sessions (confirms)\" },\n { action: \"roles\", description: \"The roles the app declares, and their scopes\" },\n {\n action: \"guests\",\n args: \"[list|delete <uid>|prune]\",\n description: \"Anonymous sign-in's guest accounts: list, delete one, delete the stale ones\",\n flags: [[\"--older-than <age>\", \"30d, 12h, 2w: only guests not seen since\"], [\"--limit, -n <n>\", \"At most this many listed\"]]\n }\n];\n\nfunction printUsersHelp(): void {\n printProjectHelp({\n command: \"users\",\n title: \"The accounts of a running app: list, create, roles, resets\",\n actions: USERS_ACTIONS,\n notes: [\n \"Examples:\",\n \" rebase users create ada@example.com --role admin\",\n \" rebase users update bob@example.com --add-role editor\",\n \" rebase users guests prune --older-than 30d --yes\",\n \"No caller may grant a role above its own, or act on an account that outranks it — the server refuses both.\"\n ]\n });\n}\n"],"mappings":";;;;;;;AAmCA,IAAa,oBAAoB;CAC7B;CAAQ;CAAO;CAAU;CAAU;CAAU;CAAkB;CAAa;CAAS;AACzF;AAEA,eAAsB,aAAa,YAAgC,SAAkC;CACjG,oBAAoB,OAAO;CAC3B,IAAI,CAAC,cAAc,eAAe,YAAY,UAAU,OAAO,GAAG;EAC9D,eAAe;EACf;CACJ;CACA,QAAQ,YAAR;EACI,KAAK;GACD,MAAM,UAAU,OAAO;GACvB;EACJ,KAAK;GACD,MAAM,QAAQ,OAAO;GACrB;EACJ,KAAK;GACD,MAAM,WAAW,OAAO;GACxB;EACJ,KAAK;GACD,MAAM,WAAW,OAAO;GACxB;EACJ,KAAK;GACD,MAAM,WAAW,OAAO;GACxB;EACJ,KAAK;GACD,MAAM,cAAc,SAAS,sBAAsB;GACnD;EACJ,KAAK;GACD,MAAM,SAAS,OAAO;GACtB;EACJ,KAAK;GACD,MAAM,UAAU,OAAO;GACvB;EACJ,KAAK;GACD,MAAM,OAAO,OAAO;GACpB;EACJ,SACI,eAAe,YAAY,mBAAmB,OAAO;CAC7D;AACJ;AAMA,IAAM,QAAQ;AAEd,SAAS,aAAa,M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;EACN,aAAa;EACb,OAAO,CAAC,CAAC,sBAAsB,0CAA0C,GAAG,CAAC,mBAAmB,0BAA0B,CAAC;CAC/H;AACJ;AAEA,SAAS,iBAAuB;CAC5B,iBAAiB;EACb,SAAS;EACT,OAAO;EACP,SAAS;EACT,OAAO;GACH;GACA;GACA;GACA;GACA;EACJ;CACJ,CAAC;AACL"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rebasepro/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.34.0",
|
|
4
4
|
"description": "Developer tools for Rebase projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -45,15 +45,15 @@
|
|
|
45
45
|
"jiti": "^2.7.0",
|
|
46
46
|
"pg": "^8.22.0",
|
|
47
47
|
"ts-morph": "28.0.0",
|
|
48
|
-
"@rebasepro/
|
|
49
|
-
"@rebasepro/
|
|
50
|
-
"@rebasepro/
|
|
51
|
-
"@rebasepro/
|
|
52
|
-
"@rebasepro/
|
|
53
|
-
"@rebasepro/
|
|
54
|
-
"@rebasepro/
|
|
55
|
-
"@rebasepro/
|
|
56
|
-
"@rebasepro/
|
|
48
|
+
"@rebasepro/agent-skills": "0.34.0",
|
|
49
|
+
"@rebasepro/codegen": "0.34.0",
|
|
50
|
+
"@rebasepro/server": "0.34.0",
|
|
51
|
+
"@rebasepro/rls-check": "0.34.0",
|
|
52
|
+
"@rebasepro/server-postgres": "0.34.0",
|
|
53
|
+
"@rebasepro/client": "0.34.0",
|
|
54
|
+
"@rebasepro/types": "0.34.0",
|
|
55
|
+
"@rebasepro/utils": "0.34.0",
|
|
56
|
+
"@rebasepro/common": "0.34.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@types/node": "^26.1.2",
|
|
@@ -9,5 +9,6 @@ These hold before you have opened ai-instructions.md, and in every session:
|
|
|
9
9
|
- **A table is a file in `backend/schema/`.** Declare it with `defineTable` from `@rebasepro/server/schema` — columns, relations and a required `rls` — export it from `backend/schema/index.ts`, and `pnpm dev` creates it. How it looks in the admin panel is a separate, optional file: `frontend/src/cms/<table>.tsx` with `customizeTable`, which imports the table as a type only. Never `CREATE TABLE`, `ALTER TABLE` or `CREATE INDEX` in code, and never SQL as the database owner against an application table: `rebase.sql()` skips row-level security, validation and hooks, so keep it for server work that needs every row and for reading a column marked `.private()`. When the SDK cannot express a query, run it as the caller with `getSql(c)` — the same row-level security as the SDK, read-only unless `{ write: true }`, every value in `params`. A table that already exists gets its file from `pnpm schema:introspect`. With no `backend/schema/` (a headless project) the database is the schema instead: ai-instructions.md says how to serve a table.
|
|
10
10
|
- **Data goes through the SDK:** `rebase.dataAsAdmin.<table>` in functions and crons, `getDriver(c)` to act as the caller.
|
|
11
11
|
- **A route in `backend/functions/` is public until you guard it** with `requireAuth` or `requireAdmin` from `@rebasepro/server/functions`.
|
|
12
|
-
- **Never deploy, never edit
|
|
12
|
+
- **Never deploy, never edit generated files** (`backend/src/schema.generated.ts`, `rebase.resources.json`). In `.env`, change only a local setting the task needs (`AUTH_MAGIC_LINK`, `FRONTEND_URL`, `REBASE_FUNCTIONS_TIMEOUT_MS` and the like), one line at a time, and say which; never rewrite, print or rotate its secrets (`DATABASE_URL`, `JWT_SECRET`, `REBASE_SERVICE_KEY`).
|
|
13
|
+
- **An admin, back-office or internal tool is built in the Rebase admin, never as a new app.** A dashboard, a review queue, a staff screen or a settings page is a custom view, the home page, a record tab or an action in `frontend/` (ai-instructions.md, "Admin UI", says how). A separate app is only for what the project's own users see.
|
|
13
14
|
- **When Rebase cannot do what the task needs, tell the human** what is missing instead of working around it.
|
|
@@ -9,5 +9,6 @@ These hold before you have opened ai-instructions.md, and in every session:
|
|
|
9
9
|
- **A table is a file in `backend/schema/`.** Declare it with `defineTable` from `@rebasepro/server/schema` — columns, relations and a required `rls` — export it from `backend/schema/index.ts`, and `pnpm dev` creates it. How it looks in the admin panel is a separate, optional file: `frontend/src/cms/<table>.tsx` with `customizeTable`, which imports the table as a type only. Never `CREATE TABLE`, `ALTER TABLE` or `CREATE INDEX` in code, and never SQL as the database owner against an application table: `rebase.sql()` skips row-level security, validation and hooks, so keep it for server work that needs every row and for reading a column marked `.private()`. When the SDK cannot express a query, run it as the caller with `getSql(c)` — the same row-level security as the SDK, read-only unless `{ write: true }`, every value in `params`. A table that already exists gets its file from `pnpm schema:introspect`. With no `backend/schema/` (a headless project) the database is the schema instead: ai-instructions.md says how to serve a table.
|
|
10
10
|
- **Data goes through the SDK:** `rebase.dataAsAdmin.<table>` in functions and crons, `getDriver(c)` to act as the caller.
|
|
11
11
|
- **A route in `backend/functions/` is public until you guard it** with `requireAuth` or `requireAdmin` from `@rebasepro/server/functions`.
|
|
12
|
-
- **Never deploy, never edit
|
|
12
|
+
- **Never deploy, never edit generated files** (`backend/src/schema.generated.ts`, `rebase.resources.json`). In `.env`, change only a local setting the task needs (`AUTH_MAGIC_LINK`, `FRONTEND_URL`, `REBASE_FUNCTIONS_TIMEOUT_MS` and the like), one line at a time, and say which; never rewrite, print or rotate its secrets (`DATABASE_URL`, `JWT_SECRET`, `REBASE_SERVICE_KEY`).
|
|
13
|
+
- **An admin, back-office or internal tool is built in the Rebase admin, never as a new app.** A dashboard, a review queue, a staff screen or a settings page is a custom view, the home page, a record tab or an action in `frontend/` (ai-instructions.md, "Admin UI", says how). A separate app is only for what the project's own users see.
|
|
13
14
|
- **When Rebase cannot do what the task needs, tell the human** what is missing instead of working around it.
|
|
@@ -9,5 +9,6 @@ These hold before you have opened ai-instructions.md, and in every session:
|
|
|
9
9
|
- **A table is a file in `backend/schema/`.** Declare it with `defineTable` from `@rebasepro/server/schema` — columns, relations and a required `rls` — export it from `backend/schema/index.ts`, and `pnpm dev` creates it. How it looks in the admin panel is a separate, optional file: `frontend/src/cms/<table>.tsx` with `customizeTable`, which imports the table as a type only. Never `CREATE TABLE`, `ALTER TABLE` or `CREATE INDEX` in code, and never SQL as the database owner against an application table: `rebase.sql()` skips row-level security, validation and hooks, so keep it for server work that needs every row and for reading a column marked `.private()`. When the SDK cannot express a query, run it as the caller with `getSql(c)` — the same row-level security as the SDK, read-only unless `{ write: true }`, every value in `params`. A table that already exists gets its file from `pnpm schema:introspect`. With no `backend/schema/` (a headless project) the database is the schema instead: ai-instructions.md says how to serve a table.
|
|
10
10
|
- **Data goes through the SDK:** `rebase.dataAsAdmin.<table>` in functions and crons, `getDriver(c)` to act as the caller.
|
|
11
11
|
- **A route in `backend/functions/` is public until you guard it** with `requireAuth` or `requireAdmin` from `@rebasepro/server/functions`.
|
|
12
|
-
- **Never deploy, never edit
|
|
12
|
+
- **Never deploy, never edit generated files** (`backend/src/schema.generated.ts`, `rebase.resources.json`). In `.env`, change only a local setting the task needs (`AUTH_MAGIC_LINK`, `FRONTEND_URL`, `REBASE_FUNCTIONS_TIMEOUT_MS` and the like), one line at a time, and say which; never rewrite, print or rotate its secrets (`DATABASE_URL`, `JWT_SECRET`, `REBASE_SERVICE_KEY`).
|
|
13
|
+
- **An admin, back-office or internal tool is built in the Rebase admin, never as a new app.** A dashboard, a review queue, a staff screen or a settings page is a custom view, the home page, a record tab or an action in `frontend/` (ai-instructions.md, "Admin UI", says how). A separate app is only for what the project's own users see.
|
|
13
14
|
- **When Rebase cannot do what the task needs, tell the human** what is missing instead of working around it.
|
|
@@ -9,5 +9,6 @@ These hold before you have opened ai-instructions.md, and in every session:
|
|
|
9
9
|
- **A table is a file in `backend/schema/`.** Declare it with `defineTable` from `@rebasepro/server/schema` — columns, relations and a required `rls` — export it from `backend/schema/index.ts`, and `pnpm dev` creates it. How it looks in the admin panel is a separate, optional file: `frontend/src/cms/<table>.tsx` with `customizeTable`, which imports the table as a type only. Never `CREATE TABLE`, `ALTER TABLE` or `CREATE INDEX` in code, and never SQL as the database owner against an application table: `rebase.sql()` skips row-level security, validation and hooks, so keep it for server work that needs every row and for reading a column marked `.private()`. When the SDK cannot express a query, run it as the caller with `getSql(c)` — the same row-level security as the SDK, read-only unless `{ write: true }`, every value in `params`. A table that already exists gets its file from `pnpm schema:introspect`. With no `backend/schema/` (a headless project) the database is the schema instead: ai-instructions.md says how to serve a table.
|
|
10
10
|
- **Data goes through the SDK:** `rebase.dataAsAdmin.<table>` in functions and crons, `getDriver(c)` to act as the caller.
|
|
11
11
|
- **A route in `backend/functions/` is public until you guard it** with `requireAuth` or `requireAdmin` from `@rebasepro/server/functions`.
|
|
12
|
-
- **Never deploy, never edit
|
|
12
|
+
- **Never deploy, never edit generated files** (`backend/src/schema.generated.ts`, `rebase.resources.json`). In `.env`, change only a local setting the task needs (`AUTH_MAGIC_LINK`, `FRONTEND_URL`, `REBASE_FUNCTIONS_TIMEOUT_MS` and the like), one line at a time, and say which; never rewrite, print or rotate its secrets (`DATABASE_URL`, `JWT_SECRET`, `REBASE_SERVICE_KEY`).
|
|
13
|
+
- **An admin, back-office or internal tool is built in the Rebase admin, never as a new app.** A dashboard, a review queue, a staff screen or a settings page is a custom view, the home page, a record tab or an action in `frontend/` (ai-instructions.md, "Admin UI", says how). A separate app is only for what the project's own users see.
|
|
13
14
|
- **When Rebase cannot do what the task needs, tell the human** what is missing instead of working around it.
|
|
@@ -9,5 +9,6 @@ These hold before you have opened ai-instructions.md, and in every session:
|
|
|
9
9
|
- **A table is a file in `backend/schema/`.** Declare it with `defineTable` from `@rebasepro/server/schema` — columns, relations and a required `rls` — export it from `backend/schema/index.ts`, and `pnpm dev` creates it. How it looks in the admin panel is a separate, optional file: `frontend/src/cms/<table>.tsx` with `customizeTable`, which imports the table as a type only. Never `CREATE TABLE`, `ALTER TABLE` or `CREATE INDEX` in code, and never SQL as the database owner against an application table: `rebase.sql()` skips row-level security, validation and hooks, so keep it for server work that needs every row and for reading a column marked `.private()`. When the SDK cannot express a query, run it as the caller with `getSql(c)` — the same row-level security as the SDK, read-only unless `{ write: true }`, every value in `params`. A table that already exists gets its file from `pnpm schema:introspect`. With no `backend/schema/` (a headless project) the database is the schema instead: ai-instructions.md says how to serve a table.
|
|
10
10
|
- **Data goes through the SDK:** `rebase.dataAsAdmin.<table>` in functions and crons, `getDriver(c)` to act as the caller.
|
|
11
11
|
- **A route in `backend/functions/` is public until you guard it** with `requireAuth` or `requireAdmin` from `@rebasepro/server/functions`.
|
|
12
|
-
- **Never deploy, never edit
|
|
12
|
+
- **Never deploy, never edit generated files** (`backend/src/schema.generated.ts`, `rebase.resources.json`). In `.env`, change only a local setting the task needs (`AUTH_MAGIC_LINK`, `FRONTEND_URL`, `REBASE_FUNCTIONS_TIMEOUT_MS` and the like), one line at a time, and say which; never rewrite, print or rotate its secrets (`DATABASE_URL`, `JWT_SECRET`, `REBASE_SERVICE_KEY`).
|
|
13
|
+
- **An admin, back-office or internal tool is built in the Rebase admin, never as a new app.** A dashboard, a review queue, a staff screen or a settings page is a custom view, the home page, a record tab or an action in `frontend/` (ai-instructions.md, "Admin UI", says how). A separate app is only for what the project's own users see.
|
|
13
14
|
- **When Rebase cannot do what the task needs, tell the human** what is missing instead of working around it.
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
- **Never create or change a table in code, and never write SQL as the database owner against application tables.** A table is a file in `backend/schema/` (core rule 1), and one that already exists gets its file from `pnpm schema:introspect`. `rebase.sql()` runs as the owner — no row-level security, validation or hooks — so it is for server work that genuinely needs every row, and for reading a column marked `.private()`, which the API never returns; it logs a warning naming the fix when it is used to create, alter, drop or index a table. Prefer the SDK where it fits: `aggregate()` with `countDistinct`, `mode`, `percentile`, `distinct` and groups by `lower(…)`, `day(…)` or `unnest(tags)`; `fingerprint()` instead of hashing a table; `updateMany` with a value per row and `createMany` (one statement for the batch); `array-contains-all` / `array-contained-by` filters; a `defineView(...)` in `backend/schema/` for a query worth naming. For anything else, write the SQL **as the caller**: `getSql(c)` in a function runs one statement in the caller's transaction under the same row-level security as the SDK, read-only unless `{ write: true }`. The query text is yours and every value goes in `params` (`$1`, `$2`, …) — never interpolate into the string. Columns the caller may not read (`.private()`, `.access({ read })`) are dropped from what it returns when the query names them plainly, not when it computes from them; read hooks, validation and save hooks do not run.
|
|
26
26
|
- **Never deploy.** `pnpm deploy`, `rebase cloud deploy`, `firebase deploy`, `gcloud run deploy` — print the command and let the human run it, even when the task list ends in "deploy" and the tests are green.
|
|
27
|
-
-
|
|
27
|
+
- **`.env` is yours to change only for local settings.** It holds generated secrets and the connection string, and it is the only file the backend reads its settings from (there is no `.env.local`). Change a local switch the task needs (`AUTH_MAGIC_LINK=true`, `FRONTEND_URL`, `REBASE_FUNCTIONS_TIMEOUT_MS`) one line at a time and say which; never rewrite, print or rotate `DATABASE_URL`, `JWT_SECRET` or `REBASE_SERVICE_KEY`. Document a new variable in `.env.example`.
|
|
28
28
|
- **Never edit `backend/src/schema.generated.ts`.** It is overwritten by `pnpm schema:generate`; `backend/schema/` is the source.
|
|
29
29
|
- **Never edit `rebase.resources.json`.** It is generated from `backend/resources.ts` — declare there, then `rebase resources --write`.
|
|
30
30
|
- **Never pass `--allow-destructive`** to anything pointed at a database that is not the local development one. It drops columns and tables.
|
|
@@ -53,10 +53,13 @@
|
|
|
53
53
|
- **Configuration:** the human sets variables with `rebase cloud env set NAME=value` (`--secret` makes a value write-only). A change applies at the next deploy. Read variables inside the handler, with `requireEnv(c, "NAME")`.
|
|
54
54
|
- **Generated files** (audio, images, exports) go to storage: `rebase.storage.putObject({ file, key })`. A key under `public/` is served to anyone at `/api/storage/file/<key>`. Any other key needs a download token. The project needs `rebase cloud storage create` once, plus a `storageAuthorize` hook that allows the write.
|
|
55
55
|
|
|
56
|
-
## Admin UI
|
|
56
|
+
## Admin UI
|
|
57
|
+
|
|
58
|
+
The Rebase admin is this project's admin. When the task is an admin, a back-office, an internal tool or a screen for staff (a dashboard, a review or approval queue, a dispatch board, a settings page, a bulk action), build it inside the admin: a custom view (`rebase generate view <name>`), the home page, a record tab (`entityViews` in `customizeTable`), or a record or toolbar action. Never scaffold a separate app or a second admin for it, and never rebuild in it what the admin already gives every table (lists, filters, forms, history, users and roles). If the admin cannot do what the task needs, tell the human what is missing.
|
|
57
59
|
|
|
58
60
|
These rules apply to views inside the Rebase admin panel: custom views, home pages, dashboards and entity tabs. A public site or a static app this project serves (an `apps` entry with `"type": "static"`) is not the admin panel. Style it the way that app is already styled. It does not need `@rebasepro/ui`.
|
|
59
61
|
|
|
60
62
|
- **Build admin UI from the kit, never from scratch**: every one of those views is composed from `@rebasepro/ui` components (`Card`, `Typography`, `Button`, `Chip`, `Alert`, …) and the theme's tokens. Backgrounds and borders take a surface by role — `bg-surface-frame`, `bg-surface-sheet`, `bg-surface-card`, `bg-surface-raised`, `bg-surface-field`, `bg-surface-well`, `border-hairline` — and those switch with the theme on their own, so they need no `dark:` pair; text takes `<Typography>` or `text-text-primary dark:text-text-primary-dark`. Do **not** invent a palette, a type scale, or hand-written CSS: a hardcoded colour like `#111` is invisible in one of the two themes and nothing will catch it. The roles and their reasoning are in `@rebasepro/ui/theme.css` in your `node_modules`; the live reference is `import { UIReferenceView } from "@rebasepro/app/debug"` — mount it on a route and look before building a view. See [Styling Custom UI](https://rebase.pro/docs/frontend/styling).
|
|
63
|
+
- **Rebranding the admin is tokens, not components.** Brand colour, fonts and corners are a `@theme { --color-primary: …; --font-sans: …; --radius-lg: … }` block in `frontend/src/index.css` (there is a commented one to start from); light and dark backgrounds are `--surface-*` variables under `:root` and `.dark`; the logo and name are `<RebaseShell title logo logoDark>`, and the same logo reaches the sign-in screen. Never restyle by overriding components or writing the brand colour as a literal: a filled control is `bg-primary text-on-primary`, so a light brand still gets readable labels. See [Theming & Branding](https://rebase.pro/docs/frontend/theming).
|
|
61
64
|
- **The admin panel shows every table with no code; `frontend/src/cms/<table>.tsx` changes how one looks.** `export const postsCms = customizeTable<typeof posts>("posts", { icon, fields: { … } })` from `@rebasepro/cms`, with `import type { posts } from "../../../backend/schema/posts"` — a type import only: a value import from `backend/` would put server code in the browser bundle, and `check:templates` refuses it. List it in `App.tsx`: `<RebaseCMS tableCustomizations={[postsCms]} />`. Labels, enum colours, icons, markdown and custom `Field` components live there, never in `backend/schema/`.
|
|
62
65
|
- **Set `span` on every field you customize, from what it holds.** The admin form puts every field at full width unless the property says otherwise, pairing only two neighbouring fields with the same small editor (two numbers, two switches, two dates, two short selects); it never pairs free text and never looks at the title. Pair two short values that belong together (`2` + `2`: start / end date, provider / region; `1` for numbers, booleans and short codes beside their siblings), keep anything that reads long at `4` (names, URLs, emails, ids, descriptions, markdown, files), make each row add up to 4, and declare pairs next to each other. It goes in `fields: { <column>: { span } }` of the table's `customizeTable`.
|
|
@@ -5,6 +5,19 @@
|
|
|
5
5
|
|
|
6
6
|
@custom-variant dark (&:where(.dark, .dark *));
|
|
7
7
|
|
|
8
|
+
/* Your brand. Uncomment and edit: every part of the admin follows these
|
|
9
|
+
tokens, in both themes, and button labels switch to black or white to
|
|
10
|
+
stay readable on the colour you pick. Fonts, surfaces, dark mode and the
|
|
11
|
+
logo: https://rebase.pro/docs/frontend/theming
|
|
12
|
+
|
|
13
|
+
@theme {
|
|
14
|
+
--color-primary: #0070F4;
|
|
15
|
+
--font-sans: "Inter Variable", ui-sans-serif, system-ui, sans-serif;
|
|
16
|
+
--radius-lg: 9px;
|
|
17
|
+
--radius-xl: 13px;
|
|
18
|
+
}
|
|
19
|
+
*/
|
|
20
|
+
|
|
8
21
|
@layer utilities {
|
|
9
22
|
body {
|
|
10
23
|
@apply w-full min-h-screen bg-surface-50 dark:bg-surface-900 flex flex-col items-center justify-center;
|