@palbase/backend 23.1.0 → 24.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 (73) hide show
  1. package/dist/bin/palbase-backend.cjs +400 -47
  2. package/dist/bin/palbase-backend.cjs.map +1 -1
  3. package/dist/bin/palbase-backend.js +4 -5
  4. package/dist/bin/palbase-backend.js.map +1 -1
  5. package/dist/{chunk-OHALWEOG.js → chunk-7Z6MGMXQ.js} +57 -2
  6. package/dist/chunk-7Z6MGMXQ.js.map +1 -0
  7. package/dist/{chunk-RCLNBJCM.js → chunk-H3JAISUY.js} +136 -1
  8. package/dist/chunk-H3JAISUY.js.map +1 -0
  9. package/dist/{chunk-PY7YJDCT.js → chunk-LCL7TUAI.js} +32 -3
  10. package/dist/chunk-LCL7TUAI.js.map +1 -0
  11. package/dist/{chunk-NS5V43YQ.js → chunk-P2Q27SGP.js} +19 -3
  12. package/dist/chunk-P2Q27SGP.js.map +1 -0
  13. package/dist/{chunk-R3KN6RHD.js → chunk-T5IOSOE5.js} +7 -2
  14. package/dist/chunk-T5IOSOE5.js.map +1 -0
  15. package/dist/{chunk-M5MCBWJI.js → chunk-YSQBC2VL.js} +275 -31
  16. package/dist/chunk-YSQBC2VL.js.map +1 -0
  17. package/dist/db/index.cjs +48 -3
  18. package/dist/db/index.cjs.map +1 -1
  19. package/dist/db/index.d.cts +2 -2
  20. package/dist/db/index.d.ts +2 -2
  21. package/dist/db/index.js +2 -2
  22. package/dist/{endpoint-CVWXh6oG.d.ts → endpoint-0_DGBajf.d.ts} +100 -3
  23. package/dist/{endpoint-c9h5jriX.d.cts → endpoint-CcQ1a36a.d.cts} +100 -3
  24. package/dist/engine/index.cjs +389 -34
  25. package/dist/engine/index.cjs.map +1 -1
  26. package/dist/engine/index.d.cts +4 -4
  27. package/dist/engine/index.d.ts +4 -4
  28. package/dist/engine/index.js +4 -4
  29. package/dist/{index-CwAJ7HEe.d.ts → index-BOS_rFBO.d.ts} +125 -21
  30. package/dist/{index-CxeQSfJP.d.cts → index-C84bLgeO.d.cts} +134 -9
  31. package/dist/{index-By8Dle5U.d.cts → index-MoQ31B6M.d.cts} +125 -21
  32. package/dist/{index-BZrJXnVh.d.ts → index-dJNhDZ7j.d.ts} +134 -9
  33. package/dist/index.cjs +166 -5
  34. package/dist/index.cjs.map +1 -1
  35. package/dist/index.d.cts +54 -12
  36. package/dist/index.d.ts +54 -12
  37. package/dist/index.js +28 -11
  38. package/dist/index.js.map +1 -1
  39. package/dist/openapi/index.cjs +16 -1
  40. package/dist/openapi/index.cjs.map +1 -1
  41. package/dist/openapi/index.d.cts +6 -4
  42. package/dist/openapi/index.d.ts +6 -4
  43. package/dist/openapi/index.js +6 -7
  44. package/dist/openapi/index.js.map +1 -1
  45. package/dist/{registry-CqPK2Qby.d.cts → registry-1X-skBNu.d.cts} +1 -1
  46. package/dist/{registry-B3niOVYp.d.ts → registry-CEod_5sz.d.ts} +1 -1
  47. package/dist/test/index.cjs +27 -0
  48. package/dist/test/index.cjs.map +1 -1
  49. package/dist/test/index.d.cts +1 -1
  50. package/dist/test/index.d.ts +1 -1
  51. package/dist/test/index.js +27 -0
  52. package/dist/test/index.js.map +1 -1
  53. package/docs/README.md +4 -4
  54. package/docs/database.md +115 -11
  55. package/docs/getting-started.md +5 -4
  56. package/docs/llms-full.txt +385 -89
  57. package/docs/migrations.md +81 -59
  58. package/docs/schema.md +82 -2
  59. package/docs/services.md +98 -9
  60. package/package.json +2 -2
  61. package/template/AGENTS.md +121 -41
  62. package/template/controllers/notes.controller.ts +64 -0
  63. package/template/package.json +1 -1
  64. package/template/services/note.service.ts +74 -0
  65. package/template/tsconfig.json +11 -1
  66. package/dist/chunk-HQRJDARQ.js +0 -90
  67. package/dist/chunk-HQRJDARQ.js.map +0 -1
  68. package/dist/chunk-M5MCBWJI.js.map +0 -1
  69. package/dist/chunk-NS5V43YQ.js.map +0 -1
  70. package/dist/chunk-OHALWEOG.js.map +0 -1
  71. package/dist/chunk-PY7YJDCT.js.map +0 -1
  72. package/dist/chunk-R3KN6RHD.js.map +0 -1
  73. package/dist/chunk-RCLNBJCM.js.map +0 -1
@@ -1,7 +1,7 @@
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-c9h5jriX.cjs';
4
- import { P as ParamMeta, T as ThrowDescriptor, U as UploadConfig, S as SseConfig } from '../registry-CqPK2Qby.cjs';
3
+ import { A as AuthSpec, R as RateLimitConfig } from '../endpoint-CcQ1a36a.cjs';
4
+ import { P as ParamMeta, T as ThrowDescriptor, U as UploadConfig, S as SseConfig } from '../registry-1X-skBNu.cjs';
5
5
  import '../stack.cjs';
6
6
 
7
7
  /** A controller class (constructor). Kept loose — the only contract is that it
@@ -39,7 +39,8 @@ interface FlatRoute {
39
39
  * (MembersController → "members"). "" when the derivation is empty — the
40
40
  * operationId then falls back to the flat verb-prefixed form. */
41
41
  controllerName: string;
42
- /** Resolved auth: route option ?? controller default ?? true (secure). */
42
+ /** Resolved auth: route option ?? controller default ?? application default
43
+ * ?? true (secure) — the cascade lives in `resolveEffectiveAuth`. */
43
44
  effectiveAuth: AuthSpec;
44
45
  /** All parameter metas for this route (ordered by index). */
45
46
  params: ParamMeta[];
@@ -68,7 +69,8 @@ interface FlatRoute {
68
69
  * `<controllerName>.<fnName>` id (PlacesController.importNearby →
69
70
  * places.importNearby) — matching the Go runtime (extract_meta.js derives the
70
71
  * namespace from the class name; generator.go joins). Effective auth resolves
71
- * the cascade (route ?? controller default ?? secure-by-default).
72
+ * the cascade (route ?? controller default ?? application default ??
73
+ * secure-by-default) through the one resolver the route table asks too.
72
74
  */
73
75
  declare function flattenController(controller: ControllerClass): FlatRoute[];
74
76
  /** The operationId for a route — exposed so callers (convert/aggregate)
@@ -1,7 +1,7 @@
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-CVWXh6oG.js';
4
- import { P as ParamMeta, T as ThrowDescriptor, U as UploadConfig, S as SseConfig } from '../registry-B3niOVYp.js';
3
+ import { A as AuthSpec, R as RateLimitConfig } from '../endpoint-0_DGBajf.js';
4
+ import { P as ParamMeta, T as ThrowDescriptor, U as UploadConfig, S as SseConfig } from '../registry-CEod_5sz.js';
5
5
  import '../stack.js';
6
6
 
7
7
  /** A controller class (constructor). Kept loose — the only contract is that it
@@ -39,7 +39,8 @@ interface FlatRoute {
39
39
  * (MembersController → "members"). "" when the derivation is empty — the
40
40
  * operationId then falls back to the flat verb-prefixed form. */
41
41
  controllerName: string;
42
- /** Resolved auth: route option ?? controller default ?? true (secure). */
42
+ /** Resolved auth: route option ?? controller default ?? application default
43
+ * ?? true (secure) — the cascade lives in `resolveEffectiveAuth`. */
43
44
  effectiveAuth: AuthSpec;
44
45
  /** All parameter metas for this route (ordered by index). */
45
46
  params: ParamMeta[];
@@ -68,7 +69,8 @@ interface FlatRoute {
68
69
  * `<controllerName>.<fnName>` id (PlacesController.importNearby →
69
70
  * places.importNearby) — matching the Go runtime (extract_meta.js derives the
70
71
  * namespace from the class name; generator.go joins). Effective auth resolves
71
- * the cascade (route ?? controller default ?? secure-by-default).
72
+ * the cascade (route ?? controller default ?? application default ??
73
+ * secure-by-default) through the one resolver the route table asks too.
72
74
  */
73
75
  declare function flattenController(controller: ControllerClass): FlatRoute[];
74
76
  /** The operationId for a route — exposed so callers (convert/aggregate)
@@ -1,13 +1,12 @@
1
1
  import {
2
2
  getErrorRegistry
3
- } from "../chunk-R3KN6RHD.js";
3
+ } from "../chunk-T5IOSOE5.js";
4
4
  import {
5
+ getRoutes,
5
6
  isController,
6
- resolveController
7
- } from "../chunk-HQRJDARQ.js";
8
- import {
9
- getRoutes
10
- } from "../chunk-RCLNBJCM.js";
7
+ resolveController,
8
+ resolveEffectiveAuth
9
+ } from "../chunk-H3JAISUY.js";
11
10
  import {
12
11
  __commonJS,
13
12
  __require,
@@ -5853,7 +5852,7 @@ function flattenController(controller) {
5853
5852
  const out = [];
5854
5853
  for (const route of routes) {
5855
5854
  const fullPath = joinControllerPath(meta.basePath, route.subpath);
5856
- const effectiveAuth = route.options.auth ?? meta.defaultAuth ?? true;
5855
+ const effectiveAuth = resolveEffectiveAuth(route.options.auth, meta.defaultAuth);
5857
5856
  const inputSchemas = {};
5858
5857
  const pathParams = [];
5859
5858
  for (const p of route.params) {