@palbase/backend 35.0.1 → 36.0.1

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 (70) hide show
  1. package/dist/bin/palbase-backend.cjs +556 -487
  2. package/dist/bin/palbase-backend.cjs.map +1 -1
  3. package/dist/bin/palbase-backend.js +6 -6
  4. package/dist/{chunk-L4R7WXLH.js → chunk-7WAGQ3VR.js} +4 -171
  5. package/dist/chunk-7WAGQ3VR.js.map +1 -0
  6. package/dist/{chunk-UMESJJRS.js → chunk-CS6NQ6PO.js} +2 -1
  7. package/dist/chunk-CS6NQ6PO.js.map +1 -0
  8. package/dist/{chunk-BOD3DT6D.js → chunk-EHKEMHB4.js} +560 -430
  9. package/dist/chunk-EHKEMHB4.js.map +1 -0
  10. package/dist/{chunk-PRH45NZU.js → chunk-FFO36MQQ.js} +2 -45
  11. package/dist/chunk-FFO36MQQ.js.map +1 -0
  12. package/dist/{chunk-P7MGSAFT.js → chunk-LFUNRWUE.js} +1 -40
  13. package/dist/chunk-LFUNRWUE.js.map +1 -0
  14. package/dist/{chunk-RZLY4BOY.js → chunk-PDD55QWN.js} +2 -2
  15. package/dist/{chunk-YO5GYM73.js → chunk-X7UR3VXA.js} +5 -6
  16. package/dist/chunk-X7UR3VXA.js.map +1 -0
  17. package/dist/{chunk-6FEHCEB7.js → chunk-YANGWAIM.js} +3 -3
  18. package/dist/db/index.cjs +1 -232
  19. package/dist/db/index.cjs.map +1 -1
  20. package/dist/db/index.d.cts +3 -46
  21. package/dist/db/index.d.ts +3 -46
  22. package/dist/db/index.js +4 -12
  23. package/dist/engine/index.cjs +556 -487
  24. package/dist/engine/index.cjs.map +1 -1
  25. package/dist/engine/index.d.cts +4 -4
  26. package/dist/engine/index.d.ts +4 -4
  27. package/dist/engine/index.js +6 -6
  28. package/dist/{index-DllNjpTl.d.cts → index-CI7S0Wqv.d.cts} +61 -8
  29. package/dist/{endpoint-BI0yGuEL.d.ts → index-CUy50OLU.d.ts} +6 -82
  30. package/dist/{endpoint-DaGnjt42.d.cts → index-DRx880KY.d.cts} +6 -82
  31. package/dist/{index-E8Sd6NFy.d.ts → index-Ogi30dbt.d.ts} +61 -8
  32. package/dist/index.cjs +5 -237
  33. package/dist/index.cjs.map +1 -1
  34. package/dist/index.d.cts +6 -7
  35. package/dist/index.d.ts +6 -7
  36. package/dist/index.js +7 -15
  37. package/dist/index.js.map +1 -1
  38. package/dist/openapi/index.cjs +1 -0
  39. package/dist/openapi/index.cjs.map +1 -1
  40. package/dist/openapi/index.d.cts +3 -3
  41. package/dist/openapi/index.d.ts +3 -3
  42. package/dist/openapi/index.js +2 -2
  43. package/dist/{registry-BnKvIyve.d.cts → registry-C7UCkQf0.d.cts} +1 -1
  44. package/dist/{registry-zDCj0eOU.d.ts → registry-DJcvbomD.d.ts} +1 -1
  45. package/dist/test/index.cjs +3 -11
  46. package/dist/test/index.cjs.map +1 -1
  47. package/dist/test/index.d.cts +2 -2
  48. package/dist/test/index.d.ts +2 -2
  49. package/dist/test/index.js +2 -9
  50. package/dist/test/index.js.map +1 -1
  51. package/docs/README.md +1 -1
  52. package/docs/database.md +2 -60
  53. package/docs/examples/database-dx.ts +12 -17
  54. package/docs/llms-full.txt +3 -61
  55. package/package.json +1 -1
  56. package/stager/inferred_returns.js +153 -0
  57. package/stager/return_types.js +9 -4
  58. package/stager/stage.js +3 -1
  59. package/template/AGENTS.md +5 -5
  60. package/template/package.json +2 -2
  61. package/dist/chunk-BOD3DT6D.js.map +0 -1
  62. package/dist/chunk-L4R7WXLH.js.map +0 -1
  63. package/dist/chunk-P7MGSAFT.js.map +0 -1
  64. package/dist/chunk-PRH45NZU.js.map +0 -1
  65. package/dist/chunk-UMESJJRS.js.map +0 -1
  66. package/dist/chunk-YO5GYM73.js.map +0 -1
  67. package/docs/examples/check-query-contracts.ts +0 -5
  68. package/docs/examples/database-dx.contract.json +0 -65
  69. /package/dist/{chunk-RZLY4BOY.js.map → chunk-PDD55QWN.js.map} +0 -0
  70. /package/dist/{chunk-6FEHCEB7.js.map → chunk-YANGWAIM.js.map} +0 -0
@@ -1,9 +1,9 @@
1
1
  import { OpenApiGeneratorV31 } from '@asteasolutions/zod-to-openapi';
2
2
  import { ZodTypeAny } from 'zod';
3
- import { A as AuthSpec, R as RateLimitConfig } from '../endpoint-DaGnjt42.cjs';
4
- import { P as ParamMeta, T as ThrowDescriptor, U as UploadConfig, S as SseConfig } from '../registry-BnKvIyve.cjs';
5
- import '../stack.cjs';
3
+ import { A as AuthSpec, R as RateLimitConfig } from '../index-DRx880KY.cjs';
4
+ import { P as ParamMeta, T as ThrowDescriptor, U as UploadConfig, S as SseConfig } from '../registry-C7UCkQf0.cjs';
6
5
  import '../db/env.cjs';
6
+ import '../stack.cjs';
7
7
  import 'node:async_hooks';
8
8
 
9
9
  /** A controller class (constructor). Kept loose — the only contract is that it
@@ -1,9 +1,9 @@
1
1
  import { OpenApiGeneratorV31 } from '@asteasolutions/zod-to-openapi';
2
2
  import { ZodTypeAny } from 'zod';
3
- import { A as AuthSpec, R as RateLimitConfig } from '../endpoint-BI0yGuEL.js';
4
- import { P as ParamMeta, T as ThrowDescriptor, U as UploadConfig, S as SseConfig } from '../registry-zDCj0eOU.js';
5
- import '../stack.js';
3
+ import { A as AuthSpec, R as RateLimitConfig } from '../index-CUy50OLU.js';
4
+ import { P as ParamMeta, T as ThrowDescriptor, U as UploadConfig, S as SseConfig } from '../registry-DJcvbomD.js';
6
5
  import '../db/env.js';
6
+ import '../stack.js';
7
7
  import 'node:async_hooks';
8
8
 
9
9
  /** A controller class (constructor). Kept loose — the only contract is that it
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getErrorRegistry
3
- } from "../chunk-RZLY4BOY.js";
3
+ } from "../chunk-PDD55QWN.js";
4
4
  import {
5
5
  getRoom,
6
6
  getRoutes,
@@ -8,7 +8,7 @@ import {
8
8
  resolveController,
9
9
  resolveEffectiveAuth
10
10
  } from "../chunk-JJW3L62T.js";
11
- import "../chunk-UMESJJRS.js";
11
+ import "../chunk-CS6NQ6PO.js";
12
12
  import {
13
13
  __commonJS,
14
14
  __name,
@@ -1,4 +1,4 @@
1
- import { D as DatabaseBudget, A as AuthSpec, R as RateLimitConfig } from './endpoint-DaGnjt42.cjs';
1
+ import { D as DatabaseBudget, A as AuthSpec, R as RateLimitConfig } from './index-DRx880KY.cjs';
2
2
  import { ZodTypeAny } from 'zod';
3
3
  import { PalbaseBucketName } from './stack.cjs';
4
4
 
@@ -1,4 +1,4 @@
1
- import { D as DatabaseBudget, A as AuthSpec, R as RateLimitConfig } from './endpoint-BI0yGuEL.js';
1
+ import { D as DatabaseBudget, A as AuthSpec, R as RateLimitConfig } from './index-CUy50OLU.js';
2
2
  import { ZodTypeAny } from 'zod';
3
3
  import { PalbaseBucketName } from './stack.js';
4
4
 
@@ -2292,13 +2292,6 @@ function createMockDB() {
2292
2292
  __name(resolveInsertValues, "resolveInsertValues");
2293
2293
  const ops = {
2294
2294
  diagnostics: /* @__PURE__ */ __name(() => null, "diagnostics"),
2295
- readQuery: /* @__PURE__ */ __name((query) => ops.findMany(query.table, query.where, query.options), "readQuery"),
2296
- compileQuery() {
2297
- throw new Error("MockDB cannot compile PostgreSQL query plans; use the real engine to inspect SQL");
2298
- },
2299
- async explainQuery() {
2300
- throw new Error("MockDB cannot EXPLAIN PostgreSQL plans; use a PostgreSQL integration test");
2301
- },
2302
2295
  // The bulk ops and count run against the SAME in-memory store the direct
2303
2296
  // ops write to, so a test that writes three rows and counts them gets 3 —
2304
2297
  // a mock that answered 0 would make the surface look broken in exactly the
@@ -3005,7 +2998,9 @@ function makeTableProxy(ops, prefix) {
3005
2998
  // Older than this run, but the run rewrote this proxy for
3006
2999
  // `Database.schema(name).tables.*` and would have carried the gap onto
3007
3000
  // the new surface too.
3008
- updateMany: /* @__PURE__ */ __name((q) => ops().updateMany(name, q.where, q.set), "updateMany"),
3001
+ updateMany: /* @__PURE__ */ __name((q) => ops().updateMany(name, q.where, q.set, q.returning === void 0 ? void 0 : {
3002
+ returning: q.returning
3003
+ }), "updateMany"),
3009
3004
  deleteMany: /* @__PURE__ */ __name((q) => ops().deleteMany(name, q.where), "deleteMany"),
3010
3005
  count: /* @__PURE__ */ __name((q) => ops().count(name, q?.where), "count"),
3011
3006
  search: /* @__PURE__ */ __name((params) => ops().search(name, params), "search"),
@@ -3025,9 +3020,6 @@ function makeTypedSurface(raw) {
3025
3020
  const ops = {
3026
3021
  $query: /* @__PURE__ */ __name((sql, params) => raw.query(sql, params), "$query"),
3027
3022
  $diagnostics: /* @__PURE__ */ __name(() => raw.diagnostics(), "$diagnostics"),
3028
- $readQuery: /* @__PURE__ */ __name((query) => raw.readQuery(query), "$readQuery"),
3029
- $compileQuery: /* @__PURE__ */ __name((query) => raw.compileQuery(query), "$compileQuery"),
3030
- $explainQuery: /* @__PURE__ */ __name((query) => raw.explainQuery(query), "$explainQuery"),
3031
3023
  $insert: /* @__PURE__ */ __name((table, data) => raw.insert(table, data), "$insert"),
3032
3024
  $update: /* @__PURE__ */ __name((table, id, data) => raw.update(table, id, data), "$update"),
3033
3025
  $delete: /* @__PURE__ */ __name((table, id) => raw.delete(table, id), "$delete"),