@palbase/backend 25.0.4 → 25.1.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.
@@ -16,7 +16,7 @@ import {
16
16
  quoteIdent,
17
17
  scrubSecrets,
18
18
  withTables
19
- } from "../chunk-AILPKEK5.js";
19
+ } from "../chunk-VDF2T4AS.js";
20
20
  import "../chunk-CRQKCRGF.js";
21
21
  import "../chunk-XABBC7JP.js";
22
22
  import "../chunk-CJSKYY76.js";
package/docs/README.md CHANGED
@@ -133,8 +133,9 @@ export class TodoService {
133
133
 
134
134
  /** The wired instance. Controllers import THIS, never the class. It is also the
135
135
  * ONLY supported way to hold a dependency: a controller, job, hook or webhook is
136
- * constructed with no arguments, and one that declares a constructor parameter
137
- * is refused at build with the class named. */
136
+ * constructed with no arguments, and one that declares a constructor parameter is
137
+ * refused with the class named — at decoration time for jobs/hooks/webhooks, and
138
+ * when the route table is built at boot for a controller. */
138
139
  export const todoService = new TodoService(Database.tables.todos);
139
140
  ```
140
141
 
@@ -150,7 +151,7 @@ import { CreateTodoBody } from "../models/todos/create.js";
150
151
  export default class TodosController {
151
152
  // The service arrives as an IMPORTED SINGLETON, not a constructor parameter:
152
153
  // the runtime constructs this class with no arguments, and one that declares a
153
- // parameter is refused at build with the class named.
154
+ // parameter is refused when the route table is built at boot, with the class named.
154
155
 
155
156
  @Get("") // GET /todos → operationId todos.list
156
157
  async list(@User() user: UserT): Promise<TodoSchema[]> { // return type → 200 response schema
@@ -141,8 +141,9 @@ export class TodoService {
141
141
 
142
142
  /** The wired instance. Controllers import THIS, never the class. It is also the
143
143
  * ONLY supported way to hold a dependency: a controller, job, hook or webhook is
144
- * constructed with no arguments, and one that declares a constructor parameter
145
- * is refused at build with the class named. */
144
+ * constructed with no arguments, and one that declares a constructor parameter is
145
+ * refused with the class named — at decoration time for jobs/hooks/webhooks, and
146
+ * when the route table is built at boot for a controller. */
146
147
  export const todoService = new TodoService(Database.tables.todos);
147
148
  ```
148
149
 
@@ -158,7 +159,7 @@ import { CreateTodoBody } from "../models/todos/create.js";
158
159
  export default class TodosController {
159
160
  // The service arrives as an IMPORTED SINGLETON, not a constructor parameter:
160
161
  // the runtime constructs this class with no arguments, and one that declares a
161
- // parameter is refused at build with the class named.
162
+ // parameter is refused when the route table is built at boot, with the class named.
162
163
 
163
164
  @Get("") // GET /todos → operationId todos.list
164
165
  async list(@User() user: UserT): Promise<TodoSchema[]> { // return type → 200 response schema
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@palbase/backend",
3
- "version": "25.0.4",
3
+ "version": "25.1.0",
4
4
  "description": "Palbase Backend SDK — class controllers (@Controller/@Get/@Post + @Body/@QueryParams/@Param), error classes, schema DSL",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -58,7 +58,9 @@ wrong in this runtime:
58
58
  - **A DI container, or injection via decorators** — the only supported way to hold
59
59
  a dependency is a module-level singleton. A controller, job, hook or webhook is
60
60
  constructed with **no arguments**; one that declares a constructor parameter is
61
- refused at build with the class named.
61
+ refused with the class named — at decoration time for `jobs/`, `hooks/` and
62
+ `webhooks/`, and when the route table is built at boot for a controller. The
63
+ release never serves either way.
62
64
  - **`middleware/`** — nothing mounts it and the engine has no middleware pipeline.
63
65
  Code written against it deploys, never runs, and nothing reports it. Put
64
66
  cross-cutting work in a service; use route options for auth and rate limits.
@@ -18,8 +18,8 @@ import { noteService } from "../services/note.service";
18
18
  //
19
19
  // The dependency is a MODULE-LEVEL SINGLETON, imported. It is not a constructor
20
20
  // parameter: the runtime constructs this class with no arguments, and a
21
- // controller that declares one is refused at build with the class named rather
22
- // than handed `undefined` in production.
21
+ // controller that declares one is refused when the route table is built at boot,
22
+ // with the class named — rather than handed `undefined` in production.
23
23
 
24
24
  // The schemas are in `models/notes/create.ts`. A controller with one endpoint
25
25
  // can keep them beside the routes; the moment there are two, they go to
@@ -16,9 +16,11 @@ import type { Tables } from "@palbase/backend/env";
16
16
  // is what a controller imports. That module-level singleton is also the
17
17
  // supported way to hold a dependency ANYWHERE in this runtime: a controller,
18
18
  // hook, job or webhook is constructed with no arguments, and one that declares
19
- // a constructor parameter is refused at build with the class named — there is
20
- // no injector to fill it, so the field would simply be `undefined` in
21
- // production.
19
+ // a constructor parameter is REFUSED, with the class named — there is no
20
+ // injector to fill it, so the field would otherwise be `undefined` in
21
+ // production. The refusal fires at decoration time for a job, hook or webhook,
22
+ // and when the route table is built at boot for a controller; either way the
23
+ // release never serves.
22
24
  //
23
25
  // `Database.tables.notes` is typed from `db/public.ts` through the generated
24
26
  // `palbase-env.d.ts`, which `palbase build` writes. Before the first build that