@palbase/backend 39.1.7 → 40.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 (44) hide show
  1. package/dist/bin/palbase-backend.cjs.map +1 -1
  2. package/dist/bin/palbase-backend.js +2 -2
  3. package/dist/{chunk-C525N4OW.js → chunk-AS2HDWVQ.js} +3 -2
  4. package/dist/{chunk-C525N4OW.js.map → chunk-AS2HDWVQ.js.map} +1 -1
  5. package/dist/{chunk-H7EKL6HC.js → chunk-RA7KFELX.js} +88 -2
  6. package/dist/chunk-RA7KFELX.js.map +1 -0
  7. package/dist/db/index.d.cts +1 -1
  8. package/dist/db/index.d.ts +1 -1
  9. package/dist/engine/index.cjs +2 -0
  10. package/dist/engine/index.cjs.map +1 -1
  11. package/dist/engine/index.d.cts +3 -3
  12. package/dist/engine/index.d.ts +3 -3
  13. package/dist/engine/index.js +4 -2
  14. package/dist/{index-fLaf0PN2.d.ts → index-B8zC9oV0.d.ts} +3 -3
  15. package/dist/{index-Db5QHdTa.d.cts → index-BAjRbjnq.d.cts} +3 -3
  16. package/dist/{index-QWN1Ncrv.d.ts → index-Ck2K1TgC.d.ts} +3 -3
  17. package/dist/{index-CCY1h_J2.d.cts → index-t7Ie44mM.d.cts} +3 -3
  18. package/dist/index.cjs +84 -59
  19. package/dist/index.cjs.map +1 -1
  20. package/dist/index.d.cts +20 -18
  21. package/dist/index.d.ts +20 -18
  22. package/dist/index.js +2 -61
  23. package/dist/index.js.map +1 -1
  24. package/dist/openapi/index.d.cts +2 -2
  25. package/dist/openapi/index.d.ts +2 -2
  26. package/dist/{registry-CH6HRR6T.d.cts → registry-C88au7ti.d.cts} +1 -1
  27. package/dist/{registry-C7tCRyPm.d.ts → registry-wwVUGunv.d.ts} +1 -1
  28. package/dist/stack.cjs.map +1 -1
  29. package/dist/stack.d.cts +21 -6
  30. package/dist/stack.d.ts +21 -6
  31. package/dist/test/index.cjs +19 -1
  32. package/dist/test/index.cjs.map +1 -1
  33. package/dist/test/index.d.cts +21 -2
  34. package/dist/test/index.d.ts +21 -2
  35. package/dist/test/index.js +18 -1
  36. package/dist/test/index.js.map +1 -1
  37. package/docs/README.md +6 -6
  38. package/docs/llms-full.txt +6 -6
  39. package/package.json +3 -6
  40. package/template/AGENTS.md +14 -14
  41. package/template/modules/notes/notes.e2e.test.ts +53 -0
  42. package/template/package.json +2 -2
  43. package/dist/chunk-H7EKL6HC.js.map +0 -1
  44. package/template/scripts/test.sh +0 -33
@@ -1,8 +1,8 @@
1
- import '../index-CCY1h_J2.cjs';
2
- export { A as App, g as AuthVerifier, B as BootRefused, h as COMMAND_EXECUTOR_DDL, j as CreateAppOptions, D as DECLARATION_REFUSAL, a as DeclarationRefused, E as EgressPolicy, k as EngineConfig, M as ModuleClients, R as RateLimiter, l as RequestDatabase, m as RouteEntry, n as RuntimeHooks, S as ScrubResult, o as SqlDriver, p as SqlTx, q as buildRouteTable, r as createApp, s as createLazyTransaction, t as createOps, u as createRequestDatabase, v as effectiveAuth, w as hostAllowed, x as installCommandExecutor, y as installEgressFence, i as isDeclarationRefused, z as loadConfig, F as makeMemoryCache, G as matchRoute, H as quoteIdent, I as scrubSecrets, J as setCursorKey, K as withQueryCancellation, L as withTables } from '../index-Db5QHdTa.cjs';
1
+ import '../index-t7Ie44mM.cjs';
2
+ export { A as App, g as AuthVerifier, B as BootRefused, h as COMMAND_EXECUTOR_DDL, j as CreateAppOptions, D as DECLARATION_REFUSAL, k as DatabaseAdmission, l as DatabaseAdmissionOptions, a as DeclarationRefused, E as EgressPolicy, m as EngineConfig, M as ModuleClients, R as RateLimiter, n as RequestDatabase, o as RouteEntry, p as RuntimeHooks, S as ScrubResult, q as SqlDriver, r as SqlTx, s as buildRouteTable, t as createApp, u as createLazyTransaction, v as createOps, w as createRequestDatabase, x as databaseAdmission, y as effectiveAuth, z as hostAllowed, F as installCommandExecutor, G as installEgressFence, i as isDeclarationRefused, H as loadConfig, I as makeMemoryCache, J as matchRoute, K as quoteIdent, L as scrubSecrets, N as setCursorKey, O as withQueryCancellation, P as withTables } from '../index-BAjRbjnq.cjs';
3
3
  import 'zod';
4
4
  import '../db/env.cjs';
5
5
  import '../stack.cjs';
6
6
  import 'node:async_hooks';
7
7
  import '../module-Dl1KFVtc.cjs';
8
- import '../registry-CH6HRR6T.cjs';
8
+ import '../registry-C88au7ti.cjs';
@@ -1,8 +1,8 @@
1
- import '../index-fLaf0PN2.js';
2
- export { A as App, g as AuthVerifier, B as BootRefused, h as COMMAND_EXECUTOR_DDL, j as CreateAppOptions, D as DECLARATION_REFUSAL, a as DeclarationRefused, E as EgressPolicy, k as EngineConfig, M as ModuleClients, R as RateLimiter, l as RequestDatabase, m as RouteEntry, n as RuntimeHooks, S as ScrubResult, o as SqlDriver, p as SqlTx, q as buildRouteTable, r as createApp, s as createLazyTransaction, t as createOps, u as createRequestDatabase, v as effectiveAuth, w as hostAllowed, x as installCommandExecutor, y as installEgressFence, i as isDeclarationRefused, z as loadConfig, F as makeMemoryCache, G as matchRoute, H as quoteIdent, I as scrubSecrets, J as setCursorKey, K as withQueryCancellation, L as withTables } from '../index-QWN1Ncrv.js';
1
+ import '../index-B8zC9oV0.js';
2
+ export { A as App, g as AuthVerifier, B as BootRefused, h as COMMAND_EXECUTOR_DDL, j as CreateAppOptions, D as DECLARATION_REFUSAL, k as DatabaseAdmission, l as DatabaseAdmissionOptions, a as DeclarationRefused, E as EgressPolicy, m as EngineConfig, M as ModuleClients, R as RateLimiter, n as RequestDatabase, o as RouteEntry, p as RuntimeHooks, S as ScrubResult, q as SqlDriver, r as SqlTx, s as buildRouteTable, t as createApp, u as createLazyTransaction, v as createOps, w as createRequestDatabase, x as databaseAdmission, y as effectiveAuth, z as hostAllowed, F as installCommandExecutor, G as installEgressFence, i as isDeclarationRefused, H as loadConfig, I as makeMemoryCache, J as matchRoute, K as quoteIdent, L as scrubSecrets, N as setCursorKey, O as withQueryCancellation, P as withTables } from '../index-Ck2K1TgC.js';
3
3
  import 'zod';
4
4
  import '../db/env.js';
5
5
  import '../stack.js';
6
6
  import 'node:async_hooks';
7
7
  import '../module-Dl1KFVtc.js';
8
- import '../registry-C7tCRyPm.js';
8
+ import '../registry-wwVUGunv.js';
@@ -8,6 +8,7 @@ import {
8
8
  createLazyTransaction,
9
9
  createOps,
10
10
  createRequestDatabase,
11
+ databaseAdmission,
11
12
  effectiveAuth,
12
13
  hostAllowed,
13
14
  installCommandExecutor,
@@ -20,12 +21,12 @@ import {
20
21
  setCursorKey,
21
22
  withQueryCancellation,
22
23
  withTables
23
- } from "../chunk-C525N4OW.js";
24
+ } from "../chunk-AS2HDWVQ.js";
24
25
  import {
25
26
  DECLARATION_REFUSAL,
26
27
  DeclarationRefused,
27
28
  isDeclarationRefused
28
- } from "../chunk-H7EKL6HC.js";
29
+ } from "../chunk-RA7KFELX.js";
29
30
  import "../chunk-GHNC2UHS.js";
30
31
  import "../chunk-XZWOMPD3.js";
31
32
  import "../chunk-FFO36MQQ.js";
@@ -45,6 +46,7 @@ export {
45
46
  createLazyTransaction,
46
47
  createOps,
47
48
  createRequestDatabase,
49
+ databaseAdmission,
48
50
  effectiveAuth,
49
51
  hostAllowed,
50
52
  installCommandExecutor,
@@ -1,6 +1,6 @@
1
1
  import { z, ZodSchema } from 'zod';
2
2
  import { Schemas, Tables, TableTypes } from './db/env.js';
3
- import { PalbaseFlagKey, Buckets, BucketTypes, PalbaseSecretName } from './stack.js';
3
+ import { PalbaseRoleName, PalbaseFlagKey, Buckets, BucketTypes, PalbaseSecretName } from './stack.js';
4
4
  import { AsyncLocalStorage } from 'node:async_hooks';
5
5
 
6
6
  interface CommandOptions {
@@ -179,7 +179,7 @@ interface User {
179
179
  * already gone here. An empty array for a caller who holds none, never null:
180
180
  * `user.roles.includes("agent")` needs no guard.
181
181
  */
182
- roles: string[];
182
+ roles: PalbaseRoleName[];
183
183
  metadata: Record<string, unknown>;
184
184
  /**
185
185
  * Reserved, server-owned verified device claim. `null` on an authenticated
@@ -201,7 +201,7 @@ interface AuthConfig {
201
201
  * of whenever the token happens to expire.
202
202
  *
203
203
  * Not signed in → 401; signed in without the role → 403. */
204
- role?: string;
204
+ role?: PalbaseRoleName;
205
205
  /** Required permission for access, as `resource.action` (e.g. "posts.delete_any").
206
206
  *
207
207
  * Resolved through `auth.has_permission(...)`, which answers from the roles
@@ -1,6 +1,6 @@
1
- import { c as DatabaseDiagnosticsOptions, d as DatabaseDiagnostics, a as DBClient, T as TransactionIsolation, e as DBOps, f as RawPageOptions, P as Page, g as TxPlanBody, C as CommandOptions, h as TxPlanResponse, A as AuthSpec, i as CacheClient, b as RuntimeServices, _ as __runWithRuntime, j as __requestALS } from './index-CCY1h_J2.cjs';
1
+ import { c as DatabaseDiagnosticsOptions, d as DatabaseDiagnostics, a as DBClient, T as TransactionIsolation, e as DBOps, f as RawPageOptions, P as Page, g as TxPlanBody, C as CommandOptions, h as TxPlanResponse, A as AuthSpec, i as CacheClient, b as RuntimeServices, _ as __runWithRuntime, j as __requestALS } from './index-t7Ie44mM.cjs';
2
2
  import { T as Token } from './module-Dl1KFVtc.cjs';
3
- import { R as RouteMeta } from './registry-CH6HRR6T.cjs';
3
+ import { R as RouteMeta } from './registry-C88au7ti.cjs';
4
4
 
5
5
  interface AdmissionLease {
6
6
  queueMs: number;
@@ -1191,4 +1191,4 @@ interface App {
1191
1191
  }
1192
1192
  declare function createApp(opts: CreateAppOptions): Promise<App>;
1193
1193
 
1194
- export { type App as A, BootRefused as B, type Container as C, DECLARATION_REFUSAL as D, type EgressPolicy as E, makeMemoryCache as F, matchRoute as G, quoteIdent as H, scrubSecrets as I, setCursorKey as J, withQueryCancellation as K, withTables as L, type ModuleClients as M, RateLimiter as R, type ScrubResult as S, DeclarationRefused as a, DiError as b, type DiKind as c, type ModulePressure as d, assertNoOrphanEntryPoints as e, buildContainer as f, AuthVerifier as g, COMMAND_EXECUTOR_DDL as h, isDeclarationRefused as i, type CreateAppOptions as j, type EngineConfig as k, type RequestDatabase as l, type RouteEntry as m, type RuntimeHooks as n, type SqlDriver as o, type SqlTx as p, buildRouteTable as q, createApp as r, createLazyTransaction as s, createOps as t, createRequestDatabase as u, effectiveAuth as v, hostAllowed as w, installCommandExecutor as x, installEgressFence as y, loadConfig as z };
1194
+ export { type App as A, BootRefused as B, type Container as C, DECLARATION_REFUSAL as D, type EgressPolicy as E, installCommandExecutor as F, installEgressFence as G, loadConfig as H, makeMemoryCache as I, matchRoute as J, quoteIdent as K, scrubSecrets as L, type ModuleClients as M, setCursorKey as N, withQueryCancellation as O, withTables as P, RateLimiter as R, type ScrubResult as S, DeclarationRefused as a, DiError as b, type DiKind as c, type ModulePressure as d, assertNoOrphanEntryPoints as e, buildContainer as f, AuthVerifier as g, COMMAND_EXECUTOR_DDL as h, isDeclarationRefused as i, type CreateAppOptions as j, DatabaseAdmission as k, type DatabaseAdmissionOptions as l, type EngineConfig as m, type RequestDatabase as n, type RouteEntry as o, type RuntimeHooks as p, type SqlDriver as q, type SqlTx as r, buildRouteTable as s, createApp as t, createLazyTransaction as u, createOps as v, createRequestDatabase as w, databaseAdmission as x, effectiveAuth as y, hostAllowed as z };
@@ -1,6 +1,6 @@
1
- import { c as DatabaseDiagnosticsOptions, d as DatabaseDiagnostics, a as DBClient, T as TransactionIsolation, e as DBOps, f as RawPageOptions, P as Page, g as TxPlanBody, C as CommandOptions, h as TxPlanResponse, A as AuthSpec, i as CacheClient, b as RuntimeServices, _ as __runWithRuntime, j as __requestALS } from './index-fLaf0PN2.js';
1
+ import { c as DatabaseDiagnosticsOptions, d as DatabaseDiagnostics, a as DBClient, T as TransactionIsolation, e as DBOps, f as RawPageOptions, P as Page, g as TxPlanBody, C as CommandOptions, h as TxPlanResponse, A as AuthSpec, i as CacheClient, b as RuntimeServices, _ as __runWithRuntime, j as __requestALS } from './index-B8zC9oV0.js';
2
2
  import { T as Token } from './module-Dl1KFVtc.js';
3
- import { R as RouteMeta } from './registry-C7tCRyPm.js';
3
+ import { R as RouteMeta } from './registry-wwVUGunv.js';
4
4
 
5
5
  interface AdmissionLease {
6
6
  queueMs: number;
@@ -1191,4 +1191,4 @@ interface App {
1191
1191
  }
1192
1192
  declare function createApp(opts: CreateAppOptions): Promise<App>;
1193
1193
 
1194
- export { type App as A, BootRefused as B, type Container as C, DECLARATION_REFUSAL as D, type EgressPolicy as E, makeMemoryCache as F, matchRoute as G, quoteIdent as H, scrubSecrets as I, setCursorKey as J, withQueryCancellation as K, withTables as L, type ModuleClients as M, RateLimiter as R, type ScrubResult as S, DeclarationRefused as a, DiError as b, type DiKind as c, type ModulePressure as d, assertNoOrphanEntryPoints as e, buildContainer as f, AuthVerifier as g, COMMAND_EXECUTOR_DDL as h, isDeclarationRefused as i, type CreateAppOptions as j, type EngineConfig as k, type RequestDatabase as l, type RouteEntry as m, type RuntimeHooks as n, type SqlDriver as o, type SqlTx as p, buildRouteTable as q, createApp as r, createLazyTransaction as s, createOps as t, createRequestDatabase as u, effectiveAuth as v, hostAllowed as w, installCommandExecutor as x, installEgressFence as y, loadConfig as z };
1194
+ export { type App as A, BootRefused as B, type Container as C, DECLARATION_REFUSAL as D, type EgressPolicy as E, installCommandExecutor as F, installEgressFence as G, loadConfig as H, makeMemoryCache as I, matchRoute as J, quoteIdent as K, scrubSecrets as L, type ModuleClients as M, setCursorKey as N, withQueryCancellation as O, withTables as P, RateLimiter as R, type ScrubResult as S, DeclarationRefused as a, DiError as b, type DiKind as c, type ModulePressure as d, assertNoOrphanEntryPoints as e, buildContainer as f, AuthVerifier as g, COMMAND_EXECUTOR_DDL as h, isDeclarationRefused as i, type CreateAppOptions as j, DatabaseAdmission as k, type DatabaseAdmissionOptions as l, type EngineConfig as m, type RequestDatabase as n, type RouteEntry as o, type RuntimeHooks as p, type SqlDriver as q, type SqlTx as r, buildRouteTable as s, createApp as t, createLazyTransaction as u, createOps as v, createRequestDatabase as w, databaseAdmission as x, effectiveAuth as y, hostAllowed as z };
@@ -1,6 +1,6 @@
1
1
  import { z, ZodSchema } from 'zod';
2
2
  import { Schemas, Tables, TableTypes } from './db/env.cjs';
3
- import { PalbaseFlagKey, Buckets, BucketTypes, PalbaseSecretName } from './stack.cjs';
3
+ import { PalbaseRoleName, PalbaseFlagKey, Buckets, BucketTypes, PalbaseSecretName } from './stack.cjs';
4
4
  import { AsyncLocalStorage } from 'node:async_hooks';
5
5
 
6
6
  interface CommandOptions {
@@ -179,7 +179,7 @@ interface User {
179
179
  * already gone here. An empty array for a caller who holds none, never null:
180
180
  * `user.roles.includes("agent")` needs no guard.
181
181
  */
182
- roles: string[];
182
+ roles: PalbaseRoleName[];
183
183
  metadata: Record<string, unknown>;
184
184
  /**
185
185
  * Reserved, server-owned verified device claim. `null` on an authenticated
@@ -201,7 +201,7 @@ interface AuthConfig {
201
201
  * of whenever the token happens to expire.
202
202
  *
203
203
  * Not signed in → 401; signed in without the role → 403. */
204
- role?: string;
204
+ role?: PalbaseRoleName;
205
205
  /** Required permission for access, as `resource.action` (e.g. "posts.delete_any").
206
206
  *
207
207
  * Resolved through `auth.has_permission(...)`, which answers from the roles
package/dist/index.cjs CHANGED
@@ -4529,6 +4529,73 @@ function isDeclarationRefused(e) {
4529
4529
  }
4530
4530
  __name(isDeclarationRefused, "isDeclarationRefused");
4531
4531
 
4532
+ // src/stack-gen.ts
4533
+ function liveNames(names) {
4534
+ return [
4535
+ ...new Set(names)
4536
+ ].sort();
4537
+ }
4538
+ __name(liveNames, "liveNames");
4539
+ function memberName(name) {
4540
+ return /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(name) ? name : JSON.stringify(name);
4541
+ }
4542
+ __name(memberName, "memberName");
4543
+ function members(names) {
4544
+ if (names.length === 0) return "";
4545
+ return `
4546
+ ${names.map((n) => ` ${memberName(n)}: true;`).join("\n")}
4547
+ `;
4548
+ }
4549
+ __name(members, "members");
4550
+ function bucketMembers(buckets) {
4551
+ const normalized = buckets.map((b) => typeof b === "string" ? {
4552
+ name: b,
4553
+ variants: []
4554
+ } : b);
4555
+ const byName = /* @__PURE__ */ new Map();
4556
+ for (const b of normalized) byName.set(b.name, b.variants);
4557
+ const names = [
4558
+ ...byName.keys()
4559
+ ].sort();
4560
+ if (names.length === 0) return "";
4561
+ const rows = names.map((name) => {
4562
+ const variants = [
4563
+ ...new Set(byName.get(name) ?? [])
4564
+ ].sort();
4565
+ const union = variants.length === 0 ? "never" : variants.map((v) => JSON.stringify(v)).join(" | ");
4566
+ return ` ${memberName(name)}: { variants: ${union} };`;
4567
+ });
4568
+ return `
4569
+ ${rows.join("\n")}
4570
+ `;
4571
+ }
4572
+ __name(bucketMembers, "bucketMembers");
4573
+ function stackInterfaceBody(names) {
4574
+ const secrets = liveNames(names.secrets);
4575
+ const flags = liveNames(names.flags);
4576
+ const roles = liveNames(names.roles ?? []);
4577
+ return ` interface Secrets {${members(secrets)}}
4578
+
4579
+ interface Flags {${members(flags)}}
4580
+
4581
+ interface Buckets {${bucketMembers(names.buckets)}}
4582
+
4583
+ interface Roles {${members(roles)}}`;
4584
+ }
4585
+ __name(stackInterfaceBody, "stackInterfaceBody");
4586
+ function makeStackDts(names) {
4587
+ return `// palbase-stack.d.ts \u2014 GENERATED by @palbase/backend. Do not edit.
4588
+ // Source: the linked environment's stack.
4589
+
4590
+ declare module "@palbase/backend/stack" {
4591
+ ${stackInterfaceBody(names)}
4592
+ }
4593
+
4594
+ export {};
4595
+ `;
4596
+ }
4597
+ __name(makeStackDts, "makeStackDts");
4598
+
4532
4599
  // src/db/unique.ts
4533
4600
  function uniqueKeysOf(table) {
4534
4601
  const columns = table.columns ?? {};
@@ -4766,7 +4833,17 @@ function refuseFreeFormTransforms(schemas) {
4766
4833
  }
4767
4834
  }
4768
4835
  __name(refuseFreeFormTransforms, "refuseFreeFormTransforms");
4769
- function makeEnvDts(schemas) {
4836
+ var ENV_BLOCK_START = "// palbase:env:begin";
4837
+ var ENV_BLOCK_END = "// palbase:env:end";
4838
+ var STACK_BLOCK_START = "// palbase:stack:begin";
4839
+ var STACK_BLOCK_END = "// palbase:stack:end";
4840
+ var EMPTY_STACK_NAMES = {
4841
+ secrets: [],
4842
+ flags: [],
4843
+ buckets: [],
4844
+ roles: []
4845
+ };
4846
+ function makeEnvDts(schemas, names) {
4770
4847
  refuseFreeFormTransforms(schemas);
4771
4848
  const relations = buildRelations(schemas);
4772
4849
  const publicSchema = schemas.find((s) => s.name === "public");
@@ -4809,75 +4886,23 @@ type Pg<T, N extends string> = T & { readonly __pg?: N };
4809
4886
  */
4810
4887
  type Json = string | number | boolean | null | undefined | Json[] | { [k: string]: Json };
4811
4888
 
4889
+ ${ENV_BLOCK_START}
4812
4890
  declare module "@palbase/backend/env" {
4813
4891
  interface Tables {${body}}
4814
4892
  interface Schemas {${schemasBody}}
4815
4893
  }
4894
+ ${ENV_BLOCK_END}
4816
4895
 
4817
- export {};
4818
- `;
4819
- }
4820
- __name(makeEnvDts, "makeEnvDts");
4821
-
4822
- // src/stack-gen.ts
4823
- function liveNames(names) {
4824
- return [
4825
- ...new Set(names)
4826
- ].sort();
4827
- }
4828
- __name(liveNames, "liveNames");
4829
- function memberName(name) {
4830
- return /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(name) ? name : JSON.stringify(name);
4831
- }
4832
- __name(memberName, "memberName");
4833
- function members(names) {
4834
- if (names.length === 0) return "";
4835
- return `
4836
- ${names.map((n) => ` ${memberName(n)}: true;`).join("\n")}
4837
- `;
4838
- }
4839
- __name(members, "members");
4840
- function bucketMembers(buckets) {
4841
- const normalized = buckets.map((b) => typeof b === "string" ? {
4842
- name: b,
4843
- variants: []
4844
- } : b);
4845
- const byName = /* @__PURE__ */ new Map();
4846
- for (const b of normalized) byName.set(b.name, b.variants);
4847
- const names = [
4848
- ...byName.keys()
4849
- ].sort();
4850
- if (names.length === 0) return "";
4851
- const rows = names.map((name) => {
4852
- const variants = [
4853
- ...new Set(byName.get(name) ?? [])
4854
- ].sort();
4855
- const union = variants.length === 0 ? "never" : variants.map((v) => JSON.stringify(v)).join(" | ");
4856
- return ` ${memberName(name)}: { variants: ${union} };`;
4857
- });
4858
- return `
4859
- ${rows.join("\n")}
4860
- `;
4861
- }
4862
- __name(bucketMembers, "bucketMembers");
4863
- function makeStackDts(names) {
4864
- const secrets = liveNames(names.secrets);
4865
- const flags = liveNames(names.flags);
4866
- return `// palbase-stack.d.ts \u2014 GENERATED by @palbase/backend. Do not edit.
4867
- // Source: the linked environment's stack.
4868
-
4896
+ ${STACK_BLOCK_START}
4869
4897
  declare module "@palbase/backend/stack" {
4870
- interface Secrets {${members(secrets)}}
4871
-
4872
- interface Flags {${members(flags)}}
4873
-
4874
- interface Buckets {${bucketMembers(names.buckets)}}
4898
+ ${stackInterfaceBody(names ?? EMPTY_STACK_NAMES)}
4875
4899
  }
4900
+ ${STACK_BLOCK_END}
4876
4901
 
4877
4902
  export {};
4878
4903
  `;
4879
4904
  }
4880
- __name(makeStackDts, "makeStackDts");
4905
+ __name(makeEnvDts, "makeEnvDts");
4881
4906
 
4882
4907
  // src/decorators/registry.ts
4883
4908
  var ROUTES = /* @__PURE__ */ Symbol.for("palbase.backend.routes");