@rebasepro/server 0.31.0-canary.g902a0ce → 0.31.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/{access-CCsVee6z.js → access-D1CTJSLK.js} +3 -1
- package/dist/access-D1CTJSLK.js.map +1 -0
- package/dist/{access-CSfmyM87.js → access-Dtu87BMj.js} +2 -2
- package/dist/{access-CSfmyM87.js.map → access-Dtu87BMj.js.map} +1 -1
- package/dist/{auth-Blo1R8rc.js → auth-BOz84vIr.js} +3 -3
- package/dist/{auth-Blo1R8rc.js.map → auth-BOz84vIr.js.map} +1 -1
- package/dist/auth-secrets-BZUH9916.js +60 -0
- package/dist/auth-secrets-BZUH9916.js.map +1 -0
- package/dist/{contract-routes-WwMWHWS9.js → contract-routes-o5oqNhfc.js} +2 -2
- package/dist/{contract-routes-WwMWHWS9.js.map → contract-routes-o5oqNhfc.js.map} +1 -1
- package/dist/{cron-routes-Cqm5wQsK.js → cron-routes-BOu-bY7I.js} +2 -2
- package/dist/{cron-routes-Cqm5wQsK.js.map → cron-routes-BOu-bY7I.js.map} +1 -1
- package/dist/{dist-CDIqWaSr.js → dist-fBcYxf4h.js} +2 -2
- package/dist/{dist-CDIqWaSr.js.map → dist-fBcYxf4h.js.map} +1 -1
- package/dist/index.es.js +21 -21
- package/dist/{load-schema-CtyLeq-H.js → load-schema-Cv5XLVjW.js} +2 -37
- package/dist/load-schema-Cv5XLVjW.js.map +1 -0
- package/dist/{openapi-generator-mn6hsEmw.js → openapi-generator-CoAFACMx.js} +2 -2
- package/dist/{openapi-generator-mn6hsEmw.js.map → openapi-generator-CoAFACMx.js.map} +1 -1
- package/dist/{query-parser-CkKSbs1s.js → query-parser-D9Uf8aha.js} +2 -2
- package/dist/{query-parser-CkKSbs1s.js.map → query-parser-D9Uf8aha.js.map} +1 -1
- package/dist/{rls-simulator-routes-BxzeNXmI.js → rls-simulator-routes-BvH6wI64.js} +2 -2
- package/dist/{rls-simulator-routes-BxzeNXmI.js.map → rls-simulator-routes-BvH6wI64.js.map} +1 -1
- package/dist/{schema-editor-routes-mPCyks4X.js → schema-editor-routes-CzITcAgt.js} +2 -2
- package/dist/{schema-editor-routes-mPCyks4X.js.map → schema-editor-routes-CzITcAgt.js.map} +1 -1
- package/dist/{schema-tables-D4MEBZFi.js → schema-tables-lJHnyqj4.js} +2 -2
- package/dist/{schema-tables-D4MEBZFi.js.map → schema-tables-lJHnyqj4.js.map} +1 -1
- package/dist/{schema-tables-routes-D3iLb5XU.js → schema-tables-routes-Uss-ljon.js} +3 -3
- package/dist/{schema-tables-routes-D3iLb5XU.js.map → schema-tables-routes-Uss-ljon.js.map} +1 -1
- package/dist/{table-source-editor-xvccIOH1.js → table-source-editor-qmyi5vxX.js} +2 -2
- package/dist/{table-source-editor-xvccIOH1.js.map → table-source-editor-qmyi5vxX.js.map} +1 -1
- package/package.json +5 -5
- package/dist/access-CCsVee6z.js.map +0 -1
- package/dist/load-schema-CtyLeq-H.js.map +0 -1
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { createRequire as __rebaseCreateRequire } from "module";
|
|
2
|
+
import __rebaseProcess from "process";
|
|
3
|
+
globalThis.process ??= __rebaseProcess;
|
|
4
|
+
__rebaseCreateRequire(import.meta.url);
|
|
5
|
+
//#region ../common/src/collections/auth-secrets.ts
|
|
6
|
+
/** Is this collection the one the auth subsystem stores users in? */
|
|
7
|
+
function isAuthCollection(collection) {
|
|
8
|
+
const auth = collection.auth;
|
|
9
|
+
if (auth === true) return true;
|
|
10
|
+
return typeof auth === "object" && auth !== null && "enabled" in auth && auth.enabled === true;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The secrets of the built-in user store, in both spellings: the key and the
|
|
14
|
+
* column. A redeclaration is free to rename the key — one project's copy says
|
|
15
|
+
* `password_hash` where the default says `passwordHash` — and the column is the
|
|
16
|
+
* same either way. The auth adapter writes these columns
|
|
17
|
+
* (`builtin-auth-adapter`), and no caller may read or set them — an admin
|
|
18
|
+
* included: nobody has a use for a hash.
|
|
19
|
+
*
|
|
20
|
+
* The class, not a list of the columns someone noticed: every credential or
|
|
21
|
+
* token auth keeps on the user row, and every hash of one. The password hash;
|
|
22
|
+
* the email-verification token; the hash of a pending email-change link. A
|
|
23
|
+
* bookkeeping stamp beside them (`tokens_valid_after`, `email_change_sent_at`,
|
|
24
|
+
* `pending_email`) is not a secret and is served like any column. The other
|
|
25
|
+
* credentials auth keeps — refresh, reset and magic-link tokens, MFA secrets,
|
|
26
|
+
* recovery codes, provider identities — live in its own side tables, which no
|
|
27
|
+
* door serves.
|
|
28
|
+
*
|
|
29
|
+
* A name here is withheld whether or not the table declares the column: the
|
|
30
|
+
* runtime reads every physical column, and auth creates these on any auth
|
|
31
|
+
* table (`ensureAuthTablesExist`), so a table that never mentions
|
|
32
|
+
* `email_change_token` still has one. See `restrictedKeys` / `apiHiddenKeys`.
|
|
33
|
+
*/
|
|
34
|
+
var AUTH_SECRET_NAMES = /* @__PURE__ */ new Set([
|
|
35
|
+
"passwordHash",
|
|
36
|
+
"password_hash",
|
|
37
|
+
"emailVerificationToken",
|
|
38
|
+
"email_verification_token",
|
|
39
|
+
"emailChangeToken",
|
|
40
|
+
"email_change_token"
|
|
41
|
+
]);
|
|
42
|
+
/**
|
|
43
|
+
* The keys of the properties on `collection` that hold an auth secret and do not
|
|
44
|
+
* carry `excludeFromApi`. Empty for any collection that is not the user store: a
|
|
45
|
+
* `password_hash` column elsewhere — a CRM importing hashes, say — is that
|
|
46
|
+
* project's data, not this rule's business.
|
|
47
|
+
*/
|
|
48
|
+
function authSecretsMissingExclusion(collection) {
|
|
49
|
+
if (!collection.properties || !isAuthCollection(collection)) return [];
|
|
50
|
+
const missing = [];
|
|
51
|
+
for (const [key, property] of Object.entries(collection.properties)) {
|
|
52
|
+
if (!property || property.excludeFromApi) continue;
|
|
53
|
+
if (AUTH_SECRET_NAMES.has(key) || AUTH_SECRET_NAMES.has(property.columnName ?? key)) missing.push(key);
|
|
54
|
+
}
|
|
55
|
+
return missing;
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
58
|
+
export { authSecretsMissingExclusion as n, AUTH_SECRET_NAMES as t };
|
|
59
|
+
|
|
60
|
+
//# sourceMappingURL=auth-secrets-BZUH9916.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-secrets-BZUH9916.js","names":[],"sources":["../../common/src/collections/auth-secrets.ts"],"sourcesContent":["/**\n * Which columns of the user store are the server's alone, and which properties\n * of a given auth collection hold one without saying so.\n *\n * `users` is the one collection a project is expected to redeclare: it is\n * scaffolded into `config/collections/users.ts` so the panel can present it, and\n * the declaration replaces the default outright rather than merging with it. The\n * flag that goes missing unnoticed in that copy is `excludeFromApi` — the\n * neighbouring `admin.hideFromCollection` and `admin.disabled.hidden` keep the\n * field off the screen and look like they did the job.\n *\n * The rule has two readers and they must agree. The server restores the flag so\n * a read does not serve the scrypt hash and a write cannot set it. The panel\n * needs it just as much: a form opens with a value for every property that is\n * not excluded, and submits that baseline, so a panel that does not know sends\n * `passwordHash: null` with every new user and the server refuses the create.\n */\n\n/**\n * What the rule reads off a collection. A `CollectionConfig` is one; so is a\n * collection a server has loaded and not yet validated.\n */\nexport interface AuthSecretCandidate {\n auth?: unknown;\n properties?: Record<string, { excludeFromApi?: boolean; columnName?: string } | undefined>;\n}\n\n/** Is this collection the one the auth subsystem stores users in? */\nfunction isAuthCollection(collection: AuthSecretCandidate): boolean {\n const auth = collection.auth;\n if (auth === true) return true;\n return typeof auth === \"object\" && auth !== null && \"enabled\" in auth && auth.enabled === true;\n}\n\n/**\n * The secrets of the built-in user store, in both spellings: the key and the\n * column. A redeclaration is free to rename the key — one project's copy says\n * `password_hash` where the default says `passwordHash` — and the column is the\n * same either way. The auth adapter writes these columns\n * (`builtin-auth-adapter`), and no caller may read or set them — an admin\n * included: nobody has a use for a hash.\n *\n * The class, not a list of the columns someone noticed: every credential or\n * token auth keeps on the user row, and every hash of one. The password hash;\n * the email-verification token; the hash of a pending email-change link. A\n * bookkeeping stamp beside them (`tokens_valid_after`, `email_change_sent_at`,\n * `pending_email`) is not a secret and is served like any column. The other\n * credentials auth keeps — refresh, reset and magic-link tokens, MFA secrets,\n * recovery codes, provider identities — live in its own side tables, which no\n * door serves.\n *\n * A name here is withheld whether or not the table declares the column: the\n * runtime reads every physical column, and auth creates these on any auth\n * table (`ensureAuthTablesExist`), so a table that never mentions\n * `email_change_token` still has one. See `restrictedKeys` / `apiHiddenKeys`.\n */\nexport const AUTH_SECRET_NAMES: ReadonlySet<string> = new Set([\n \"passwordHash\", \"password_hash\",\n \"emailVerificationToken\", \"email_verification_token\",\n \"emailChangeToken\", \"email_change_token\"\n]);\n\n/**\n * The keys of the properties on `collection` that hold an auth secret and do not\n * carry `excludeFromApi`. Empty for any collection that is not the user store: a\n * `password_hash` column elsewhere — a CRM importing hashes, say — is that\n * project's data, not this rule's business.\n */\nexport function authSecretsMissingExclusion(collection: AuthSecretCandidate): string[] {\n if (!collection.properties || !isAuthCollection(collection)) return [];\n\n const missing: string[] = [];\n for (const [key, property] of Object.entries(collection.properties)) {\n if (!property || property.excludeFromApi) continue;\n if (AUTH_SECRET_NAMES.has(key) || AUTH_SECRET_NAMES.has(property.columnName ?? key)) missing.push(key);\n }\n return missing;\n}\n"],"mappings":";;;;;;AA4BA,SAAS,iBAAiB,YAA0C;CAChE,MAAM,OAAO,WAAW;CACxB,IAAI,SAAS,MAAM,OAAO;CAC1B,OAAO,OAAO,SAAS,YAAY,SAAS,QAAQ,aAAa,QAAQ,KAAK,YAAY;AAC9F;;;;;;;;;;;;;;;;;;;;;;;AAwBA,IAAa,oCAAyC,IAAI,IAAI;CAC1D;CAAgB;CAChB;CAA0B;CAC1B;CAAoB;AACxB,CAAC;;;;;;;AAQD,SAAgB,4BAA4B,YAA2C;CACnF,IAAI,CAAC,WAAW,cAAc,CAAC,iBAAiB,UAAU,GAAG,OAAO,CAAC;CAErE,MAAM,UAAoB,CAAC;CAC3B,KAAK,MAAM,CAAC,KAAK,aAAa,OAAO,QAAQ,WAAW,UAAU,GAAG;EACjE,IAAI,CAAC,YAAY,SAAS,gBAAgB;EAC1C,IAAI,kBAAkB,IAAI,GAAG,KAAK,kBAAkB,IAAI,SAAS,cAAc,GAAG,GAAG,QAAQ,KAAK,GAAG;CACzG;CACA,OAAO;AACX"}
|
|
@@ -4,7 +4,7 @@ globalThis.process ??= __rebaseProcess;
|
|
|
4
4
|
__rebaseCreateRequire(import.meta.url);
|
|
5
5
|
import { Pn as __exportAll, Q as SCHEMA_VERSION_HEADER } from "./src-DLIb1O9l.js";
|
|
6
6
|
import { a as logger } from "./logger-SigQ2oZJ.js";
|
|
7
|
-
import { t as ADMIN_SCHEMA_VIEW } from "./schema-tables-
|
|
7
|
+
import { t as ADMIN_SCHEMA_VIEW } from "./schema-tables-lJHnyqj4.js";
|
|
8
8
|
import { Hono } from "hono";
|
|
9
9
|
//#region src/api/contract-routes.ts
|
|
10
10
|
var contract_routes_exports = /* @__PURE__ */ __exportAll({ createContractRoutes: () => createContractRoutes });
|
|
@@ -58,4 +58,4 @@ function createContractRoutes(config) {
|
|
|
58
58
|
//#endregion
|
|
59
59
|
export { createContractRoutes as n, contract_routes_exports as t };
|
|
60
60
|
|
|
61
|
-
//# sourceMappingURL=contract-routes-
|
|
61
|
+
//# sourceMappingURL=contract-routes-o5oqNhfc.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract-routes-
|
|
1
|
+
{"version":3,"file":"contract-routes-o5oqNhfc.js","names":[],"sources":["../src/api/contract-routes.ts"],"sourcesContent":["import { Hono } from \"hono\";\nimport {\n RUNTIME_CONTRACT_VERSION,\n SCHEMA_VERSION_HEADER,\n type RebaseProjectContract\n} from \"@rebasepro/types\";\nimport type { HonoEnv } from \"./types\";\nimport { logger } from \"../utils/logger\";\nimport { ADMIN_SCHEMA_VIEW } from \"./schema-tables\";\nimport type { SchemaTablesService } from \"./schema-tables-routes\";\n\n/**\n * The project contract endpoint.\n *\n * This is what makes a repository able to build against a project it does not\n * contain. Without it, a typed client can only be generated from local schema\n * *source*, which means every frontend must live in the same repository as\n * the backend. Serving the contract turns that around: an app asks the\n * project what its shape is, so a web app, a second web app and a mobile app\n * can each live wherever they like and none of them needs to know about the\n * others.\n *\n * `{ schemaVersion, runtime, tables }`: `tables` is what\n * `GET /api/schema/tables` serves an administrator — the same serializer, so\n * the two cannot disagree — with hooks as presence flags and private columns\n * absent. Gated on `schema:read` by the caller (see create-backend): it maps\n * every table, column, relation and policy in the project, including ones no\n * security rule would ever expose.\n */\n\nexport interface ContractRoutesConfig {\n /**\n * The tables and the schema version, cached per registry revision — the\n * same service `GET /api/schema/tables` reads, so a live change to the\n * registry reaches both.\n */\n schemaTables: SchemaTablesService;\n /** Runtime package version, surfaced so a client can report what it built against. */\n runtimeVersion?: string;\n}\n\nexport function createContractRoutes(config: ContractRoutesConfig): Hono<HonoEnv> {\n const router = new Hono<HonoEnv>();\n\n // `/schema-version` is deliberately unauthenticated and meant to be\n // polled; the service computes the version once per registry revision,\n // so polling it costs nothing.\n const schemaVersionOf = (): string => config.schemaTables.version();\n\n router.get(\"/contract\", (c) => {\n const schemaVersion = schemaVersionOf();\n const contract: RebaseProjectContract = {\n schemaVersion,\n runtime: {\n version: config.runtimeVersion ?? \"unknown\",\n contract: RUNTIME_CONTRACT_VERSION\n },\n tables: config.schemaTables.tablesFor(ADMIN_SCHEMA_VIEW)\n };\n\n c.header(SCHEMA_VERSION_HEADER, schemaVersion);\n return c.json(contract);\n });\n\n /**\n * Cheap drift check.\n *\n * Deliberately unauthenticated and deliberately tiny: two version stamps\n * and nothing else. A CI job that only wants to know whether its generated\n * SDK is stale should not need admin credentials, and a version stamp\n * reveals nothing about the schema it stands for.\n *\n * `runtime` is here as well as on `/contract` because the two answer\n * different questions and only one of them was reachable. Which runtime a\n * project is on decides whether a client's wire format is understood at\n * all, and it was published solely on the admin-gated route — so a CLI or\n * an SDK, the two callers that actually need to know, could not ask. That\n * is the same shape as the header this route echoes: a documented signal\n * with no reachable sender. `contract` is the number that matters for\n * compatibility; `version` names the release a human should quote.\n */\n router.get(\"/schema-version\", (c) => {\n const schemaVersion = schemaVersionOf();\n c.header(SCHEMA_VERSION_HEADER, schemaVersion);\n return c.json({\n schemaVersion,\n runtime: {\n version: config.runtimeVersion ?? \"unknown\",\n contract: RUNTIME_CONTRACT_VERSION\n }\n });\n });\n\n logger.debug(\"Contract routes mounted\");\n return router;\n}\n"],"mappings":";;;;;;;;;;AAyCA,SAAgB,qBAAqB,QAA6C;CAC9E,MAAM,SAAS,IAAI,KAAc;CAKjC,MAAM,wBAAgC,OAAO,aAAa,QAAQ;CAElE,OAAO,IAAI,cAAc,MAAM;EAC3B,MAAM,gBAAgB,gBAAgB;EACtC,MAAM,WAAkC;GACpC;GACA,SAAS;IACL,SAAS,OAAO,kBAAkB;IAClC,UAAA;GACJ;GACA,QAAQ,OAAO,aAAa,UAAU,iBAAiB;EAC3D;EAEA,EAAE,OAAO,uBAAuB,aAAa;EAC7C,OAAO,EAAE,KAAK,QAAQ;CAC1B,CAAC;;;;;;;;;;;;;;;;;;CAmBD,OAAO,IAAI,oBAAoB,MAAM;EACjC,MAAM,gBAAgB,gBAAgB;EACtC,EAAE,OAAO,uBAAuB,aAAa;EAC7C,OAAO,EAAE,KAAK;GACV;GACA,SAAS;IACL,SAAS,OAAO,kBAAkB;IAClC,UAAA;GACJ;EACJ,CAAC;CACL,CAAC;CAED,OAAO,MAAM,yBAAyB;CACtC,OAAO;AACX"}
|
|
@@ -4,7 +4,7 @@ globalThis.process ??= __rebaseProcess;
|
|
|
4
4
|
__rebaseCreateRequire(import.meta.url);
|
|
5
5
|
import { Pn as __exportAll } from "./src-DLIb1O9l.js";
|
|
6
6
|
import { a as logger } from "./logger-SigQ2oZJ.js";
|
|
7
|
-
import { o as resolveListLimitParam } from "./query-parser-
|
|
7
|
+
import { o as resolveListLimitParam } from "./query-parser-D9Uf8aha.js";
|
|
8
8
|
import { i as errorHandler, t as ApiError } from "./errors-DpTMfX77.js";
|
|
9
9
|
import { r as isAlreadyExecutingSkip } from "./cron-scheduler-DgrsqyQQ.js";
|
|
10
10
|
import { Hono } from "hono";
|
|
@@ -116,4 +116,4 @@ function createCronRoutes(scheduler, skipped = 0) {
|
|
|
116
116
|
//#endregion
|
|
117
117
|
export { cron_routes_exports as n, createCronRoutes as t };
|
|
118
118
|
|
|
119
|
-
//# sourceMappingURL=cron-routes-
|
|
119
|
+
//# sourceMappingURL=cron-routes-BOu-bY7I.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cron-routes-Cqm5wQsK.js","names":[],"sources":["../src/cron/cron-routes.ts"],"sourcesContent":["import { Hono } from \"hono\";\nimport type { Context } from \"hono\";\nimport type { HonoEnv } from \"../api/types\";\nimport { isAlreadyExecutingSkip, type CronScheduler } from \"./cron-scheduler\";\nimport { ApiError, errorHandler } from \"../api/errors\";\nimport { resolveListLimitParam } from \"../api/rest/query-parser\";\nimport { logger } from \"../utils/logger.js\";\n\n/** Who made a change, as `cron_job_state.updated_by` records it. */\nfunction actorOf(c: Context<HonoEnv>): string | undefined {\n const user = c.get(\"user\");\n if (typeof user === \"object\" && user !== null && typeof user.uid === \"string\") return user.uid;\n const apiKey = c.get(\"apiKey\");\n return apiKey ? `api-key:${apiKey.id}` : undefined;\n}\n\n/**\n * The manual trigger's `?async` switch. Absent means synchronous, as it always\n * was; anything other than a plain yes or no is refused rather than read as\n * one, so `?async=yes-please` does not quietly hold the request open.\n */\nfunction readAsyncFlag(raw: string | undefined): boolean {\n if (raw === undefined) return false;\n const value = raw.trim().toLowerCase();\n if (value === \"1\" || value === \"true\") return true;\n if (value === \"\" || value === \"0\" || value === \"false\") return false;\n throw ApiError.badRequest(`?async must be 1, true, 0 or false — got \"${raw}\"`);\n}\n\n/**\n * Create admin REST routes for managing cron jobs.\n *\n * Routes:\n * GET / → list all cron jobs\n * GET /:id → get a single job's status\n * POST /:id/trigger → manually trigger a job (`?async=1`: 202 once it has started)\n * GET /:id/logs → get execution logs for a job\n * PUT /:id → update job (enable/disable, or `null` to follow the code)\n *\n * Every answer about a job's state is read from the store, not from this\n * process's memory: the process serving these routes is often not the one\n * running the jobs (the `api` role never starts its scheduler), and is only\n * ever one replica of several.\n */\nexport function createCronRoutes(scheduler: CronScheduler, skipped = 0): Hono<HonoEnv> {\n const router = new Hono<HonoEnv>();\n // Hono's onError does NOT propagate from parent to child routers, so this\n // child router registers its own handler to format thrown ApiErrors.\n router.onError(errorHandler);\n\n // List all jobs\n router.get(\"/\", async (c) => {\n const jobs = await scheduler.fetchJobs();\n // A file that failed to load is not a job, so it appears nowhere in\n // this list — and \"my job is missing\" and \"my job is not scheduled\"\n // look identical from here. Say how many were dropped, as the\n // functions listing does, so the Studio panel and anyone with curl can\n // see it without boot-log access.\n //\n // Two ways to be dropped, counted together and reported apart. A file\n // the loader could not read has only a count: the failure happened\n // before there was a job to name. A schedule the scheduler refused has a\n // name and a reason — most often \"Expected 5 fields, got 6\", from an\n // expression copied out of a tool that supports seconds — and quoting it\n // here turns a job that silently never fires into a one-line fix.\n const rejected = scheduler.listRejectedJobs();\n const total = skipped + rejected.length;\n return c.json({\n jobs,\n ...(total > 0 && {\n skipped: total,\n ...(rejected.length > 0 && { rejected }),\n note: [\n skipped > 0 ? `${skipped} cron file(s) failed to load` : undefined,\n // Not \"an invalid schedule\": a job is also refused for an\n // unknown timezone or a timeout that is not a positive\n // number, and `rejected` says which.\n rejected.length > 0 ? `${rejected.length} job(s) were refused` : undefined\n ].filter(Boolean).join(\" and \") +\n \" — NOT scheduled. \" +\n (rejected.length > 0\n ? \"See `rejected` for the reason; \"\n : \"\") +\n \"the server log has the rest.\"\n })\n });\n });\n\n // Get single job\n router.get(\"/:id\", async (c) => {\n const id = c.req.param(\"id\");\n const job = await scheduler.fetchJob(id);\n if (!job) {\n throw ApiError.notFound(`Cron job \"${id}\" not found`);\n }\n return c.json({ job });\n });\n\n // Trigger a job manually\n router.post(\"/:id/trigger\", async (c) => {\n const id = c.req.param(\"id\");\n const asyncRun = readAsyncFlag(c.req.query(\"async\"));\n const job = scheduler.getJob(id);\n if (!job) {\n throw ApiError.notFound(`Cron job \"${id}\" not found`);\n }\n\n // `?async=1`: answer once the run has started rather than when it\n // ends. A long job's synchronous answer is cut by any proxy with a\n // shorter timeout than the job (60 s is common) while the run carries\n // on; this one is not. The outcome is in `GET /:id/logs`, as the entry\n // with `manual: true` and this `startedAt`.\n if (asyncRun) {\n const outcome = await scheduler.startJob(id);\n if (!outcome) throw ApiError.notFound(`Cron job \"${id}\" not found`);\n if (!outcome.started) {\n throw ApiError.conflict(\n `Cron job \"${id}\" is already executing — try again when that run has finished`,\n \"CRON_JOB_ALREADY_EXECUTING\",\n { log: outcome.log }\n );\n }\n return c.json({\n accepted: true,\n startedAt: outcome.startedAt,\n job: await scheduler.fetchJob(id)\n }, 202);\n }\n\n const log = await scheduler.triggerJob(id);\n // Nothing ran, so this is not a success: the job is executing already —\n // on this process, or on whichever one holds its run lease (the worker,\n // seen from the api role). The skip is in the run history either way;\n // `details.log` carries it, and its line names the process.\n if (log && isAlreadyExecutingSkip(log)) {\n throw ApiError.conflict(\n `Cron job \"${id}\" is already executing — try again when that run has finished`,\n \"CRON_JOB_ALREADY_EXECUTING\",\n { log }\n );\n }\n return c.json({ log,\njob: await scheduler.fetchJob(id) });\n });\n\n // Get job logs\n router.get(\"/:id/logs\", async (c) => {\n const id = c.req.param(\"id\");\n // Validated, not `parseInt`-ed. `?limit=abc` used to reach the store as\n // `NaN`, where Postgres refused `LIMIT NaN`, the store swallowed the\n // error and returned `[]` — a 200 with an empty list, which reads as\n // \"this job has never run\". The data plane answers 400 for the same\n // input; so does this now.\n const limit = resolveListLimitParam(c.req.query(\"limit\") ?? null, { defaultLimit: 50 });\n\n const job = scheduler.getJob(id);\n if (!job) {\n throw ApiError.notFound(`Cron job \"${id}\" not found`);\n }\n\n const logs = await scheduler.getJobLogsFromDb(id, limit).catch((err: unknown) => {\n // Not an empty 200: Studio shows that as \"No executions yet\".\n logger.error(`[cron] Could not read the run history of \"${id}\"`, { error: err });\n throw ApiError.serviceUnavailable(\n `The run history of cron job \"${id}\" could not be read. The server log has the reason.`\n );\n });\n return c.json({ logs });\n });\n\n // Enable/disable a job — for every process, and across redeploys\n router.put(\"/:id\", async (c) => {\n const id = c.req.param(\"id\");\n const body: unknown = await c.req.json().catch(() => ({}));\n const enabled = typeof body === \"object\" && body !== null && \"enabled\" in body ? body.enabled : undefined;\n\n if (typeof enabled !== \"boolean\" && enabled !== null) {\n throw ApiError.badRequest(\n \"Missing 'enabled' in body: true or false to override the job's code, or null to follow it again\"\n );\n }\n\n if (!scheduler.getJob(id)) {\n throw ApiError.notFound(`Cron job \"${id}\" not found`);\n }\n\n try {\n await scheduler.persistJobEnabled(id, enabled, actorOf(c));\n } catch (err) {\n logger.error(`[cron] Could not save the enabled state of \"${id}\"`, { error: err });\n throw ApiError.serviceUnavailable(\n `The change to cron job \"${id}\" could not be saved, so no process was changed. ` +\n \"The server log has the reason.\"\n );\n }\n\n return c.json({ job: await scheduler.fetchJob(id) });\n });\n\n return router;\n}\n"],"mappings":";;;;;;;;;;;;;AASA,SAAS,QAAQ,GAAyC;CACtD,MAAM,OAAO,EAAE,IAAI,MAAM;CACzB,IAAI,OAAO,SAAS,YAAY,SAAS,QAAQ,OAAO,KAAK,QAAQ,UAAU,OAAO,KAAK;CAC3F,MAAM,SAAS,EAAE,IAAI,QAAQ;CAC7B,OAAO,SAAS,WAAW,OAAO,OAAO,KAAA;AAC7C;;;;;;AAOA,SAAS,cAAc,KAAkC;CACrD,IAAI,QAAQ,KAAA,GAAW,OAAO;CAC9B,MAAM,QAAQ,IAAI,KAAK,CAAC,CAAC,YAAY;CACrC,IAAI,UAAU,OAAO,UAAU,QAAQ,OAAO;CAC9C,IAAI,UAAU,MAAM,UAAU,OAAO,UAAU,SAAS,OAAO;CAC/D,MAAM,SAAS,WAAW,6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AC,UAAU,OAAO,EAAE,GACpB,MAAM,SAAS,SAAS,aAAa,GAAG,YAAY;EAGxD,IAAI;GACA,MAAM,UAAU,kBAAkB,IAAI,SAAS,QAAQ,CAAC,CAAC;EAC7D,SAAS,KAAK;GACV,OAAO,MAAM,+CAA+C,GAAG,IAAI,EAAE,OAAO,IAAI,CAAC;GACjF,MAAM,SAAS,mBACX,2BAA2B,GAAG,gFAElC;EACJ;EAEA,OAAO,EAAE,KAAK,EAAE,KAAK,MAAM,UAAU,SAAS,EAAE,EAAE,CAAC;CACvD,CAAC;CAED,OAAO;AACX"}
|
|
1
|
+
{"version":3,"file":"cron-routes-BOu-bY7I.js","names":[],"sources":["../src/cron/cron-routes.ts"],"sourcesContent":["import { Hono } from \"hono\";\nimport type { Context } from \"hono\";\nimport type { HonoEnv } from \"../api/types\";\nimport { isAlreadyExecutingSkip, type CronScheduler } from \"./cron-scheduler\";\nimport { ApiError, errorHandler } from \"../api/errors\";\nimport { resolveListLimitParam } from \"../api/rest/query-parser\";\nimport { logger } from \"../utils/logger.js\";\n\n/** Who made a change, as `cron_job_state.updated_by` records it. */\nfunction actorOf(c: Context<HonoEnv>): string | undefined {\n const user = c.get(\"user\");\n if (typeof user === \"object\" && user !== null && typeof user.uid === \"string\") return user.uid;\n const apiKey = c.get(\"apiKey\");\n return apiKey ? `api-key:${apiKey.id}` : undefined;\n}\n\n/**\n * The manual trigger's `?async` switch. Absent means synchronous, as it always\n * was; anything other than a plain yes or no is refused rather than read as\n * one, so `?async=yes-please` does not quietly hold the request open.\n */\nfunction readAsyncFlag(raw: string | undefined): boolean {\n if (raw === undefined) return false;\n const value = raw.trim().toLowerCase();\n if (value === \"1\" || value === \"true\") return true;\n if (value === \"\" || value === \"0\" || value === \"false\") return false;\n throw ApiError.badRequest(`?async must be 1, true, 0 or false — got \"${raw}\"`);\n}\n\n/**\n * Create admin REST routes for managing cron jobs.\n *\n * Routes:\n * GET / → list all cron jobs\n * GET /:id → get a single job's status\n * POST /:id/trigger → manually trigger a job (`?async=1`: 202 once it has started)\n * GET /:id/logs → get execution logs for a job\n * PUT /:id → update job (enable/disable, or `null` to follow the code)\n *\n * Every answer about a job's state is read from the store, not from this\n * process's memory: the process serving these routes is often not the one\n * running the jobs (the `api` role never starts its scheduler), and is only\n * ever one replica of several.\n */\nexport function createCronRoutes(scheduler: CronScheduler, skipped = 0): Hono<HonoEnv> {\n const router = new Hono<HonoEnv>();\n // Hono's onError does NOT propagate from parent to child routers, so this\n // child router registers its own handler to format thrown ApiErrors.\n router.onError(errorHandler);\n\n // List all jobs\n router.get(\"/\", async (c) => {\n const jobs = await scheduler.fetchJobs();\n // A file that failed to load is not a job, so it appears nowhere in\n // this list — and \"my job is missing\" and \"my job is not scheduled\"\n // look identical from here. Say how many were dropped, as the\n // functions listing does, so the Studio panel and anyone with curl can\n // see it without boot-log access.\n //\n // Two ways to be dropped, counted together and reported apart. A file\n // the loader could not read has only a count: the failure happened\n // before there was a job to name. A schedule the scheduler refused has a\n // name and a reason — most often \"Expected 5 fields, got 6\", from an\n // expression copied out of a tool that supports seconds — and quoting it\n // here turns a job that silently never fires into a one-line fix.\n const rejected = scheduler.listRejectedJobs();\n const total = skipped + rejected.length;\n return c.json({\n jobs,\n ...(total > 0 && {\n skipped: total,\n ...(rejected.length > 0 && { rejected }),\n note: [\n skipped > 0 ? `${skipped} cron file(s) failed to load` : undefined,\n // Not \"an invalid schedule\": a job is also refused for an\n // unknown timezone or a timeout that is not a positive\n // number, and `rejected` says which.\n rejected.length > 0 ? `${rejected.length} job(s) were refused` : undefined\n ].filter(Boolean).join(\" and \") +\n \" — NOT scheduled. \" +\n (rejected.length > 0\n ? \"See `rejected` for the reason; \"\n : \"\") +\n \"the server log has the rest.\"\n })\n });\n });\n\n // Get single job\n router.get(\"/:id\", async (c) => {\n const id = c.req.param(\"id\");\n const job = await scheduler.fetchJob(id);\n if (!job) {\n throw ApiError.notFound(`Cron job \"${id}\" not found`);\n }\n return c.json({ job });\n });\n\n // Trigger a job manually\n router.post(\"/:id/trigger\", async (c) => {\n const id = c.req.param(\"id\");\n const asyncRun = readAsyncFlag(c.req.query(\"async\"));\n const job = scheduler.getJob(id);\n if (!job) {\n throw ApiError.notFound(`Cron job \"${id}\" not found`);\n }\n\n // `?async=1`: answer once the run has started rather than when it\n // ends. A long job's synchronous answer is cut by any proxy with a\n // shorter timeout than the job (60 s is common) while the run carries\n // on; this one is not. The outcome is in `GET /:id/logs`, as the entry\n // with `manual: true` and this `startedAt`.\n if (asyncRun) {\n const outcome = await scheduler.startJob(id);\n if (!outcome) throw ApiError.notFound(`Cron job \"${id}\" not found`);\n if (!outcome.started) {\n throw ApiError.conflict(\n `Cron job \"${id}\" is already executing — try again when that run has finished`,\n \"CRON_JOB_ALREADY_EXECUTING\",\n { log: outcome.log }\n );\n }\n return c.json({\n accepted: true,\n startedAt: outcome.startedAt,\n job: await scheduler.fetchJob(id)\n }, 202);\n }\n\n const log = await scheduler.triggerJob(id);\n // Nothing ran, so this is not a success: the job is executing already —\n // on this process, or on whichever one holds its run lease (the worker,\n // seen from the api role). The skip is in the run history either way;\n // `details.log` carries it, and its line names the process.\n if (log && isAlreadyExecutingSkip(log)) {\n throw ApiError.conflict(\n `Cron job \"${id}\" is already executing — try again when that run has finished`,\n \"CRON_JOB_ALREADY_EXECUTING\",\n { log }\n );\n }\n return c.json({ log,\njob: await scheduler.fetchJob(id) });\n });\n\n // Get job logs\n router.get(\"/:id/logs\", async (c) => {\n const id = c.req.param(\"id\");\n // Validated, not `parseInt`-ed. `?limit=abc` used to reach the store as\n // `NaN`, where Postgres refused `LIMIT NaN`, the store swallowed the\n // error and returned `[]` — a 200 with an empty list, which reads as\n // \"this job has never run\". The data plane answers 400 for the same\n // input; so does this now.\n const limit = resolveListLimitParam(c.req.query(\"limit\") ?? null, { defaultLimit: 50 });\n\n const job = scheduler.getJob(id);\n if (!job) {\n throw ApiError.notFound(`Cron job \"${id}\" not found`);\n }\n\n const logs = await scheduler.getJobLogsFromDb(id, limit).catch((err: unknown) => {\n // Not an empty 200: Studio shows that as \"No executions yet\".\n logger.error(`[cron] Could not read the run history of \"${id}\"`, { error: err });\n throw ApiError.serviceUnavailable(\n `The run history of cron job \"${id}\" could not be read. The server log has the reason.`\n );\n });\n return c.json({ logs });\n });\n\n // Enable/disable a job — for every process, and across redeploys\n router.put(\"/:id\", async (c) => {\n const id = c.req.param(\"id\");\n const body: unknown = await c.req.json().catch(() => ({}));\n const enabled = typeof body === \"object\" && body !== null && \"enabled\" in body ? body.enabled : undefined;\n\n if (typeof enabled !== \"boolean\" && enabled !== null) {\n throw ApiError.badRequest(\n \"Missing 'enabled' in body: true or false to override the job's code, or null to follow it again\"\n );\n }\n\n if (!scheduler.getJob(id)) {\n throw ApiError.notFound(`Cron job \"${id}\" not found`);\n }\n\n try {\n await scheduler.persistJobEnabled(id, enabled, actorOf(c));\n } catch (err) {\n logger.error(`[cron] Could not save the enabled state of \"${id}\"`, { error: err });\n throw ApiError.serviceUnavailable(\n `The change to cron job \"${id}\" could not be saved, so no process was changed. ` +\n \"The server log has the reason.\"\n );\n }\n\n return c.json({ job: await scheduler.fetchJob(id) });\n });\n\n return router;\n}\n"],"mappings":";;;;;;;;;;;;;AASA,SAAS,QAAQ,GAAyC;CACtD,MAAM,OAAO,EAAE,IAAI,MAAM;CACzB,IAAI,OAAO,SAAS,YAAY,SAAS,QAAQ,OAAO,KAAK,QAAQ,UAAU,OAAO,KAAK;CAC3F,MAAM,SAAS,EAAE,IAAI,QAAQ;CAC7B,OAAO,SAAS,WAAW,OAAO,OAAO,KAAA;AAC7C;;;;;;AAOA,SAAS,cAAc,KAAkC;CACrD,IAAI,QAAQ,KAAA,GAAW,OAAO;CAC9B,MAAM,QAAQ,IAAI,KAAK,CAAC,CAAC,YAAY;CACrC,IAAI,UAAU,OAAO,UAAU,QAAQ,OAAO;CAC9C,IAAI,UAAU,MAAM,UAAU,OAAO,UAAU,SAAS,OAAO;CAC/D,MAAM,SAAS,WAAW,6CAA6C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