@palbase/backend 22.0.1 → 23.0.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.
Files changed (73) hide show
  1. package/dist/bin/palbase-backend.cjs +764 -25
  2. package/dist/bin/palbase-backend.cjs.map +1 -1
  3. package/dist/bin/palbase-backend.js +4 -4
  4. package/dist/{chunk-POYAFBLF.js → chunk-FSGSB42K.js} +13 -6
  5. package/dist/chunk-FSGSB42K.js.map +1 -0
  6. package/dist/{chunk-SSGAMC26.js → chunk-HAF67F2H.js} +114 -5
  7. package/dist/chunk-HAF67F2H.js.map +1 -0
  8. package/dist/{chunk-QMVK4X3V.js → chunk-OMRTHM4X.js} +98 -98
  9. package/dist/chunk-OMRTHM4X.js.map +1 -0
  10. package/dist/{chunk-QYOHMVUW.js → chunk-REZU6UKT.js} +755 -24
  11. package/dist/chunk-REZU6UKT.js.map +1 -0
  12. package/dist/{chunk-YL4C5NRY.js → chunk-Y5HXVUMP.js} +2 -2
  13. package/dist/{chunk-N32VDWKH.js → chunk-ZC6Q2BRD.js} +4 -59
  14. package/dist/chunk-ZC6Q2BRD.js.map +1 -0
  15. package/dist/db/env.cjs.map +1 -1
  16. package/dist/db/env.d.cts +3 -21
  17. package/dist/db/env.d.ts +3 -21
  18. package/dist/db/index.cjs +117 -6
  19. package/dist/db/index.cjs.map +1 -1
  20. package/dist/db/index.d.cts +3 -2
  21. package/dist/db/index.d.ts +3 -2
  22. package/dist/db/index.js +7 -3
  23. package/dist/{endpoint-B0LpZixz.d.cts → endpoint-BavvbW4P.d.ts} +116 -14
  24. package/dist/{endpoint-B0LpZixz.d.ts → endpoint-i8TTCohk.d.cts} +116 -14
  25. package/dist/engine/index.cjs +764 -25
  26. package/dist/engine/index.cjs.map +1 -1
  27. package/dist/engine/index.d.cts +6 -5
  28. package/dist/engine/index.d.ts +6 -5
  29. package/dist/engine/index.js +3 -3
  30. package/dist/{index-g-EzitI-.d.ts → index-B3jmmItD.d.ts} +203 -7
  31. package/dist/{index-BCNtlG1w.d.ts → index-B7YBEG5w.d.ts} +117 -93
  32. package/dist/{index-BGSCWlUa.d.cts → index-Bmvx1EvJ.d.cts} +203 -7
  33. package/dist/{index-B4W6d2VJ.d.cts → index-E7OscPJT.d.cts} +117 -93
  34. package/dist/index.cjs +509 -1085
  35. package/dist/index.cjs.map +1 -1
  36. package/dist/index.d.cts +203 -1133
  37. package/dist/index.d.ts +203 -1133
  38. package/dist/index.js +288 -900
  39. package/dist/index.js.map +1 -1
  40. package/dist/openapi/index.cjs +3 -57
  41. package/dist/openapi/index.cjs.map +1 -1
  42. package/dist/openapi/index.d.cts +3 -2
  43. package/dist/openapi/index.d.ts +3 -2
  44. package/dist/openapi/index.js +5 -22
  45. package/dist/openapi/index.js.map +1 -1
  46. package/dist/{registry-3BLYv4si.d.ts → registry-C3H2uPeZ.d.cts} +13 -169
  47. package/dist/{registry-Cw0YEYCg.d.cts → registry-DY3d9l1k.d.ts} +13 -169
  48. package/dist/{purchases/keys.cjs → stack.cjs} +4 -4
  49. package/dist/stack.cjs.map +1 -0
  50. package/dist/stack.d.cts +76 -0
  51. package/dist/stack.d.ts +76 -0
  52. package/dist/stack.js +1 -0
  53. package/docs/README.md +7 -6
  54. package/docs/endpoints.md +1 -1
  55. package/docs/errors.md +9 -0
  56. package/docs/llms-full.txt +17 -261
  57. package/docs/llms.txt +0 -2
  58. package/package.json +7 -7
  59. package/template/package.json +1 -1
  60. package/dist/chunk-N32VDWKH.js.map +0 -1
  61. package/dist/chunk-POYAFBLF.js.map +0 -1
  62. package/dist/chunk-QMVK4X3V.js.map +0 -1
  63. package/dist/chunk-QYOHMVUW.js.map +0 -1
  64. package/dist/chunk-SSGAMC26.js.map +0 -1
  65. package/dist/purchases/keys.cjs.map +0 -1
  66. package/dist/purchases/keys.d.cts +0 -42
  67. package/dist/purchases/keys.d.ts +0 -42
  68. package/dist/purchases/keys.js +0 -1
  69. package/docs/config.md +0 -147
  70. package/docs/resources.md +0 -97
  71. package/template/config/secrets.ts +0 -24
  72. /package/dist/{chunk-YL4C5NRY.js.map → chunk-Y5HXVUMP.js.map} +0 -0
  73. /package/dist/{purchases/keys.js.map → stack.js.map} +0 -0
@@ -1,7 +1,8 @@
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-B0LpZixz.cjs';
4
- import { P as ParamMeta, T as ThrowDescriptor, U as UploadConfig } from '../registry-Cw0YEYCg.cjs';
3
+ import { A as AuthSpec, R as RateLimitConfig } from '../endpoint-i8TTCohk.cjs';
4
+ import { P as ParamMeta, T as ThrowDescriptor, U as UploadConfig } from '../registry-C3H2uPeZ.cjs';
5
+ import '../stack.cjs';
5
6
 
6
7
  /** A controller class (constructor). Kept loose — the only contract is that it
7
8
  * is a `@Controller`-decorated class, asserted via {@link isController}. */
@@ -1,7 +1,8 @@
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-B0LpZixz.js';
4
- import { P as ParamMeta, T as ThrowDescriptor, U as UploadConfig } from '../registry-3BLYv4si.js';
3
+ import { A as AuthSpec, R as RateLimitConfig } from '../endpoint-BavvbW4P.js';
4
+ import { P as ParamMeta, T as ThrowDescriptor, U as UploadConfig } from '../registry-DY3d9l1k.js';
5
+ import '../stack.js';
5
6
 
6
7
  /** A controller class (constructor). Kept loose — the only contract is that it
7
8
  * is a `@Controller`-decorated class, asserted via {@link isController}. */
@@ -1,15 +1,13 @@
1
1
  import {
2
- entitlementFor,
3
- getErrorRegistry,
4
- spendFor
5
- } from "../chunk-N32VDWKH.js";
2
+ getErrorRegistry
3
+ } from "../chunk-ZC6Q2BRD.js";
6
4
  import {
7
5
  isController,
8
6
  resolveController
9
- } from "../chunk-YL4C5NRY.js";
7
+ } from "../chunk-Y5HXVUMP.js";
10
8
  import {
11
9
  getRoutes
12
- } from "../chunk-QMVK4X3V.js";
10
+ } from "../chunk-OMRTHM4X.js";
13
11
  import {
14
12
  __commonJS,
15
13
  __require,
@@ -5792,19 +5790,6 @@ var import_fast_glob = __toESM(require_out4(), 1);
5792
5790
  import path from "path";
5793
5791
  import { pathToFileURL } from "url";
5794
5792
 
5795
- // src/purchases/openapi.ts
5796
- function purchaseThrows(ctor, fnName) {
5797
- const out = [];
5798
- if (entitlementFor(ctor, fnName) !== void 0) {
5799
- out.push({ name: "EntitlementRequired", code: "entitlement_required" });
5800
- }
5801
- if (spendFor(ctor, fnName) !== void 0) {
5802
- out.push({ name: "QuotaExceeded", code: "quota_exceeded" });
5803
- out.push({ name: "CreditInsufficient", code: "credit_insufficient" });
5804
- }
5805
- return out;
5806
- }
5807
-
5808
5793
  // src/openapi/discover.ts
5809
5794
  function capitalizeSegment(s) {
5810
5795
  if (s.length === 0) return s;
@@ -5875,11 +5860,9 @@ function flattenController(controller) {
5875
5860
  break;
5876
5861
  }
5877
5862
  }
5878
- const purchases = purchaseThrows(controller, route.fnName);
5879
5863
  const seen = new Set((route.throws ?? []).map((t) => t.code));
5880
5864
  const allThrows = [
5881
- ...route.throws ?? [],
5882
- ...purchases.filter((t) => !seen.has(t.code))
5865
+ ...route.throws ?? []
5883
5866
  ];
5884
5867
  out.push({
5885
5868
  method: route.method,