@palbase/backend 25.0.0 → 25.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist/bin/palbase-backend.cjs +2 -0
  2. package/dist/bin/palbase-backend.cjs.map +1 -1
  3. package/dist/bin/palbase-backend.js +2 -2
  4. package/dist/{chunk-43A3KGWL.js → chunk-34I4GB7D.js} +4 -2
  5. package/dist/{chunk-43A3KGWL.js.map → chunk-34I4GB7D.js.map} +1 -1
  6. package/dist/{chunk-ZQRWW37O.js → chunk-35PNTIRN.js} +5 -1
  7. package/dist/chunk-35PNTIRN.js.map +1 -0
  8. package/dist/{chunk-OEQBHE2Z.js → chunk-7JSEN7UR.js} +20 -4
  9. package/dist/chunk-7JSEN7UR.js.map +1 -0
  10. package/dist/{chunk-5CMLOAEF.js → chunk-YOY5DFQS.js} +2 -2
  11. package/dist/db/env.cjs.map +1 -1
  12. package/dist/db/env.d.cts +2 -1
  13. package/dist/db/env.d.ts +2 -1
  14. package/dist/db/index.cjs +17 -3
  15. package/dist/db/index.cjs.map +1 -1
  16. package/dist/db/index.d.cts +2 -2
  17. package/dist/db/index.d.ts +2 -2
  18. package/dist/db/index.js +1 -1
  19. package/dist/{endpoint-DMwJjEHQ.d.ts → endpoint-CTEHhb7A.d.ts} +19 -8
  20. package/dist/{endpoint-BSGw1pTu.d.cts → endpoint-DYHMo6cC.d.cts} +19 -8
  21. package/dist/engine/index.cjs +2 -0
  22. package/dist/engine/index.cjs.map +1 -1
  23. package/dist/engine/index.d.cts +4 -4
  24. package/dist/engine/index.d.ts +4 -4
  25. package/dist/engine/index.js +2 -2
  26. package/dist/{index-BF1f0DfA.d.ts → index-CUomTA3e.d.ts} +3 -3
  27. package/dist/{index-Ct1iiB4N.d.ts → index-CW21M9Z3.d.ts} +24 -17
  28. package/dist/{index-CoaDN9dL.d.cts → index-ClpDeSos.d.cts} +3 -3
  29. package/dist/{index-CwaWRhyc.d.cts → index-CmBK76nx.d.cts} +24 -17
  30. package/dist/index.cjs +80 -51
  31. package/dist/index.cjs.map +1 -1
  32. package/dist/index.d.cts +13 -11
  33. package/dist/index.d.ts +13 -11
  34. package/dist/index.js +62 -51
  35. package/dist/index.js.map +1 -1
  36. package/dist/openapi/index.cjs +1 -1
  37. package/dist/openapi/index.cjs.map +1 -1
  38. package/dist/openapi/index.d.cts +2 -2
  39. package/dist/openapi/index.d.ts +2 -2
  40. package/dist/openapi/index.js +3 -3
  41. package/dist/openapi/index.js.map +1 -1
  42. package/dist/{registry-CgJvDYUW.d.cts → registry-CC0WBQq6.d.cts} +1 -1
  43. package/dist/{registry-B8pld3fj.d.ts → registry-dZZ5JKYg.d.ts} +1 -1
  44. package/dist/test/index.d.cts +1 -1
  45. package/dist/test/index.d.ts +1 -1
  46. package/docs/README.md +9 -8
  47. package/docs/database.md +2 -2
  48. package/docs/endpoints.md +6 -5
  49. package/docs/getting-started.md +1 -1
  50. package/docs/llms-full.txt +74 -38
  51. package/docs/migrations.md +16 -14
  52. package/docs/schema.md +38 -7
  53. package/docs/services.md +2 -1
  54. package/package.json +1 -1
  55. package/dist/chunk-OEQBHE2Z.js.map +0 -1
  56. package/dist/chunk-ZQRWW37O.js.map +0 -1
  57. /package/dist/{chunk-5CMLOAEF.js.map → chunk-YOY5DFQS.js.map} +0 -0
@@ -1,5 +1,5 @@
1
- export { A as AnyColumn, C as ColumnBuilder, a as ColumnDef, b as ColumnMap, c as ColumnType, d as EXTENSION_DEPENDENCIES, e as EmbeddingModelRef, g as EnvServiceDatabase, E as EnvTypedDatabase, I as InsertShape, O as OnDeleteAction, P as PALBASE_EXTENSIONS, j as PalbaseExtension, k as PolicyBuilder, l as PolicyCommand, m as PolicyDef, n as PolicyMode, R as RawConstraintDef, o as RowShape, S as SchemaDef, p as SchemaInput, T as TABLE_META, q as TableDef, r as TableHandle, s as TableInput, t as TxPlan, u as TxTables, v as TypedDB, w as TypedTable, x as TypedTx, y as bigint, z as boolean, B as defineSchema, D as defineTable, F as enumType, G as installationRef, H as integer, J as isPalbaseExtension, K as jsonb, L as makeTypedDB, N as openai, Q as ownedByUser, U as policy, V as raw, W as text, X as timestamp, Y as userRef, Z as uuid, _ as vector } from '../index-CwaWRhyc.cjs';
2
- export { M as Materialized, b1 as Ref, b3 as TxColumnExpr, b4 as TxInsertShape, b6 as TxNow, T as TxPlanBody, b7 as TxPlanError, b8 as TxPlanHandle, b9 as TxPlanOpResult, ba as TxPlanRejection, g as TxPlanResponse, bb as TxRefError, bc as TxRow, bd as TxRows, be as TxSelectOptions, bf as TxSetShape, bh as TxTable, bi as TxWhere, bs as dec, bu as inc, bv as now } from '../endpoint-BSGw1pTu.cjs';
1
+ export { A as AnyColumn, C as ColumnBuilder, a as ColumnDef, b as ColumnMap, c as ColumnType, d as EXTENSION_DEPENDENCIES, e as EmbeddingModelRef, g as EnvServiceDatabase, E as EnvTypedDatabase, I as InsertShape, O as OnDeleteAction, P as PALBASE_EXTENSIONS, j as PalbaseExtension, k as PolicyBuilder, l as PolicyCommand, m as PolicyDef, n as PolicyMode, R as RawConstraintDef, o as RowShape, S as SchemaDef, T as TABLE_META, p as TableDef, q as TableHandle, r as TableInput, s as TxPlan, t as TxTables, u as TypedDB, v as TypedTable, w as TypedTx, x as bigint, y as boolean, z as defineSchema, B as defineTable, D as enumType, F as installationRef, G as integer, H as isPalbaseExtension, J as jsonb, K as makeTypedDB, M as openai, N as ownedByUser, Q as policy, U as raw, V as text, W as timestamp, X as userRef, Y as uuid, Z as vector } from '../index-CmBK76nx.cjs';
2
+ export { M as Materialized, b1 as Ref, b3 as TxColumnExpr, b4 as TxInsertShape, b6 as TxNow, T as TxPlanBody, b7 as TxPlanError, b8 as TxPlanHandle, b9 as TxPlanOpResult, ba as TxPlanRejection, g as TxPlanResponse, bb as TxRefError, bc as TxRow, bd as TxRows, be as TxSelectOptions, bf as TxSetShape, bh as TxTable, bi as TxWhere, bs as dec, bu as inc, bv as now } from '../endpoint-DYHMo6cC.cjs';
3
3
  import './env.cjs';
4
4
  import '../stack.cjs';
5
5
  import 'zod';
@@ -1,5 +1,5 @@
1
- export { A as AnyColumn, C as ColumnBuilder, a as ColumnDef, b as ColumnMap, c as ColumnType, d as EXTENSION_DEPENDENCIES, e as EmbeddingModelRef, g as EnvServiceDatabase, E as EnvTypedDatabase, I as InsertShape, O as OnDeleteAction, P as PALBASE_EXTENSIONS, j as PalbaseExtension, k as PolicyBuilder, l as PolicyCommand, m as PolicyDef, n as PolicyMode, R as RawConstraintDef, o as RowShape, S as SchemaDef, p as SchemaInput, T as TABLE_META, q as TableDef, r as TableHandle, s as TableInput, t as TxPlan, u as TxTables, v as TypedDB, w as TypedTable, x as TypedTx, y as bigint, z as boolean, B as defineSchema, D as defineTable, F as enumType, G as installationRef, H as integer, J as isPalbaseExtension, K as jsonb, L as makeTypedDB, N as openai, Q as ownedByUser, U as policy, V as raw, W as text, X as timestamp, Y as userRef, Z as uuid, _ as vector } from '../index-Ct1iiB4N.js';
2
- export { M as Materialized, b1 as Ref, b3 as TxColumnExpr, b4 as TxInsertShape, b6 as TxNow, T as TxPlanBody, b7 as TxPlanError, b8 as TxPlanHandle, b9 as TxPlanOpResult, ba as TxPlanRejection, g as TxPlanResponse, bb as TxRefError, bc as TxRow, bd as TxRows, be as TxSelectOptions, bf as TxSetShape, bh as TxTable, bi as TxWhere, bs as dec, bu as inc, bv as now } from '../endpoint-DMwJjEHQ.js';
1
+ export { A as AnyColumn, C as ColumnBuilder, a as ColumnDef, b as ColumnMap, c as ColumnType, d as EXTENSION_DEPENDENCIES, e as EmbeddingModelRef, g as EnvServiceDatabase, E as EnvTypedDatabase, I as InsertShape, O as OnDeleteAction, P as PALBASE_EXTENSIONS, j as PalbaseExtension, k as PolicyBuilder, l as PolicyCommand, m as PolicyDef, n as PolicyMode, R as RawConstraintDef, o as RowShape, S as SchemaDef, T as TABLE_META, p as TableDef, q as TableHandle, r as TableInput, s as TxPlan, t as TxTables, u as TypedDB, v as TypedTable, w as TypedTx, x as bigint, y as boolean, z as defineSchema, B as defineTable, D as enumType, F as installationRef, G as integer, H as isPalbaseExtension, J as jsonb, K as makeTypedDB, M as openai, N as ownedByUser, Q as policy, U as raw, V as text, W as timestamp, X as userRef, Y as uuid, Z as vector } from '../index-CW21M9Z3.js';
2
+ export { M as Materialized, b1 as Ref, b3 as TxColumnExpr, b4 as TxInsertShape, b6 as TxNow, T as TxPlanBody, b7 as TxPlanError, b8 as TxPlanHandle, b9 as TxPlanOpResult, ba as TxPlanRejection, g as TxPlanResponse, bb as TxRefError, bc as TxRow, bd as TxRows, be as TxSelectOptions, bf as TxSetShape, bh as TxTable, bi as TxWhere, bs as dec, bu as inc, bv as now } from '../endpoint-CTEHhb7A.js';
3
3
  import './env.js';
4
4
  import '../stack.js';
5
5
  import 'zod';
package/dist/db/index.js CHANGED
@@ -22,7 +22,7 @@ import {
22
22
  userRef,
23
23
  uuid,
24
24
  vector
25
- } from "../chunk-OEQBHE2Z.js";
25
+ } from "../chunk-7JSEN7UR.js";
26
26
  import {
27
27
  TxPlanError,
28
28
  TxRefError,
@@ -77,17 +77,28 @@ interface MiddlewareContext extends PalbaseModuleClients {
77
77
  /** Middleware function signature — receives context and next function. */
78
78
  type MiddlewareHandler = (ctx: MiddlewareContext, next: () => Promise<void>) => Promise<void>;
79
79
  /**
80
- * Define a middleware function for use in the middleware/ directory or
81
- * as endpoint-specific middleware.
80
+ * REMOVED IN BEHAVIOUR, KEPT IN NAME.
82
81
  *
83
- * Middleware runs before the handler. Call `next()` to pass control
84
- * to the next middleware or handler. If `next()` is not called, the
85
- * handler will not execute.
82
+ * There is no middleware pipeline in this runtime. No bundler reads a
83
+ * `middleware/` directory, the engine never calls a handler defined here, and
84
+ * measured on 2026-08-31 this function had no caller anywhere in the runtime or
85
+ * the CLI. It returned its argument unchanged, so code written against it
86
+ * compiled, deployed, and then never ran — with nothing reporting that.
86
87
  *
87
- * Errors thrown in middleware are caught by the pipeline and returned
88
- * as error responses.
88
+ * A silent shell is the worst version of a retired feature: it lets a user (or a
89
+ * coding assistant, which is how this surfaced) ship a request logger, an auth
90
+ * check or a rate limiter that simply does not exist in production. So the call
91
+ * refuses, and says where the work belongs.
92
+ *
93
+ * The SYMBOL survives because removing a published export costs a major and
94
+ * 25.0.1 had just shipped. Deleting it is a proposal for the next one; the types
95
+ * below stay either way, so a file that only annotates with them still compiles.
96
+ *
97
+ * This is the shape the SDK already uses for a retired surface: `@Query(schema)`
98
+ * on a parameter throws at decoration time with a message naming its
99
+ * replacement.
89
100
  */
90
- declare function defineMiddleware(fn: MiddlewareHandler): MiddlewareHandler;
101
+ declare function defineMiddleware(_fn: MiddlewareHandler): never;
91
102
 
92
103
  /**
93
104
  * tx-plan.ts — `Database.transaction()` as a PLAN, not a pinned session.
@@ -77,17 +77,28 @@ interface MiddlewareContext extends PalbaseModuleClients {
77
77
  /** Middleware function signature — receives context and next function. */
78
78
  type MiddlewareHandler = (ctx: MiddlewareContext, next: () => Promise<void>) => Promise<void>;
79
79
  /**
80
- * Define a middleware function for use in the middleware/ directory or
81
- * as endpoint-specific middleware.
80
+ * REMOVED IN BEHAVIOUR, KEPT IN NAME.
82
81
  *
83
- * Middleware runs before the handler. Call `next()` to pass control
84
- * to the next middleware or handler. If `next()` is not called, the
85
- * handler will not execute.
82
+ * There is no middleware pipeline in this runtime. No bundler reads a
83
+ * `middleware/` directory, the engine never calls a handler defined here, and
84
+ * measured on 2026-08-31 this function had no caller anywhere in the runtime or
85
+ * the CLI. It returned its argument unchanged, so code written against it
86
+ * compiled, deployed, and then never ran — with nothing reporting that.
86
87
  *
87
- * Errors thrown in middleware are caught by the pipeline and returned
88
- * as error responses.
88
+ * A silent shell is the worst version of a retired feature: it lets a user (or a
89
+ * coding assistant, which is how this surfaced) ship a request logger, an auth
90
+ * check or a rate limiter that simply does not exist in production. So the call
91
+ * refuses, and says where the work belongs.
92
+ *
93
+ * The SYMBOL survives because removing a published export costs a major and
94
+ * 25.0.1 had just shipped. Deleting it is a proposal for the next one; the types
95
+ * below stay either way, so a file that only annotates with them still compiles.
96
+ *
97
+ * This is the shape the SDK already uses for a retired surface: `@Query(schema)`
98
+ * on a parameter throws at decoration time with a message naming its
99
+ * replacement.
89
100
  */
90
- declare function defineMiddleware(fn: MiddlewareHandler): MiddlewareHandler;
101
+ declare function defineMiddleware(_fn: MiddlewareHandler): never;
91
102
 
92
103
  /**
93
104
  * tx-plan.ts — `Database.transaction()` as a PLAN, not a pinned session.
@@ -2610,6 +2610,7 @@ function assertZeroArgConstructor(Ctrl, kind) {
2610
2610
  }
2611
2611
 
2612
2612
  // src/engine/router.ts
2613
+ var ROOM_META = /* @__PURE__ */ Symbol.for("palbase.backend.room");
2613
2614
  var CONTROLLER_META = /* @__PURE__ */ Symbol.for("palbase.backend.controllerMeta");
2614
2615
  function toSegments(path) {
2615
2616
  return path.split("/").filter(Boolean).map((s) => s.startsWith("{") && s.endsWith("}") ? `:${s.slice(1, -1)}` : s);
@@ -2617,6 +2618,7 @@ function toSegments(path) {
2617
2618
  function buildRouteTable(controllers) {
2618
2619
  const table = [];
2619
2620
  for (const Ctrl of controllers) {
2621
+ if (Ctrl[ROOM_META] !== void 0) continue;
2620
2622
  const ctor = Ctrl;
2621
2623
  const meta = ctor[CONTROLLER_META];
2622
2624
  const basePath = meta?.basePath ?? "";