@palbase/backend 24.1.1 → 24.3.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.
@@ -1,8 +1,8 @@
1
- export { A as App, m as AuthVerifier, B as BootRefused, n as CreateAppOptions, E as EgressPolicy, p as EngineConfig, M as ModuleClients, q as RateLimiter, r as RequestDatabase, s as RouteEntry, t as RuntimeHooks, u as ScrubResult, v as SqlDriver, w as SqlTx, x as buildRouteTable, y as createApp, z as createLazyTransaction, G as createOps, H as createRequestDatabase, I as effectiveAuth, J as hostAllowed, K as installEgressFence, O as loadConfig, P as makeMemoryCache, Q as matchRoute, T as quoteIdent, U as scrubSecrets, V as withTables } from '../index-DAwHMppB.cjs';
1
+ export { A as App, m as AuthVerifier, B as BootRefused, n as CreateAppOptions, E as EgressPolicy, p as EngineConfig, M as ModuleClients, q as RateLimiter, r as RequestDatabase, s as RouteEntry, t as RuntimeHooks, u as ScrubResult, v as SqlDriver, w as SqlTx, x as buildRouteTable, y as createApp, z as createLazyTransaction, G as createOps, H as createRequestDatabase, I as effectiveAuth, J as hostAllowed, K as installEgressFence, O as loadConfig, P as makeMemoryCache, Q as matchRoute, T as quoteIdent, U as scrubSecrets, V as withTables } from '../index-C-ALG22n.cjs';
2
2
  import '../endpoint-BSGw1pTu.cjs';
3
3
  import '../stack.cjs';
4
4
  import 'node:async_hooks';
5
- import '../index-D4rts8T7.cjs';
5
+ import '../index-BLAbr9ZH.cjs';
6
6
  import '../db/env.cjs';
7
7
  import '../registry-CgJvDYUW.cjs';
8
8
  import 'zod';
@@ -1,8 +1,8 @@
1
- export { A as App, m as AuthVerifier, B as BootRefused, n as CreateAppOptions, E as EgressPolicy, p as EngineConfig, M as ModuleClients, q as RateLimiter, r as RequestDatabase, s as RouteEntry, t as RuntimeHooks, u as ScrubResult, v as SqlDriver, w as SqlTx, x as buildRouteTable, y as createApp, z as createLazyTransaction, G as createOps, H as createRequestDatabase, I as effectiveAuth, J as hostAllowed, K as installEgressFence, O as loadConfig, P as makeMemoryCache, Q as matchRoute, T as quoteIdent, U as scrubSecrets, V as withTables } from '../index-C0PMn5jl.js';
1
+ export { A as App, m as AuthVerifier, B as BootRefused, n as CreateAppOptions, E as EgressPolicy, p as EngineConfig, M as ModuleClients, q as RateLimiter, r as RequestDatabase, s as RouteEntry, t as RuntimeHooks, u as ScrubResult, v as SqlDriver, w as SqlTx, x as buildRouteTable, y as createApp, z as createLazyTransaction, G as createOps, H as createRequestDatabase, I as effectiveAuth, J as hostAllowed, K as installEgressFence, O as loadConfig, P as makeMemoryCache, Q as matchRoute, T as quoteIdent, U as scrubSecrets, V as withTables } from '../index-DEneI8Mn.js';
2
2
  import '../endpoint-DMwJjEHQ.js';
3
3
  import '../stack.js';
4
4
  import 'node:async_hooks';
5
- import '../index-ByBMibIJ.js';
5
+ import '../index-BTMYod_l.js';
6
6
  import '../db/env.js';
7
7
  import '../registry-B8pld3fj.js';
8
8
  import 'zod';
@@ -16,7 +16,7 @@ import {
16
16
  quoteIdent,
17
17
  scrubSecrets,
18
18
  withTables
19
- } from "../chunk-2A62DDVO.js";
19
+ } from "../chunk-EIXCY4SS.js";
20
20
  import "../chunk-7Z6MGMXQ.js";
21
21
  import "../chunk-XABBC7JP.js";
22
22
  import "../chunk-P2Q27SGP.js";
@@ -32,6 +32,19 @@ interface ColumnDef {
32
32
  * declared. Without it, renaming a column loses its data.
33
33
  */
34
34
  renamedFrom?: string;
35
+ /**
36
+ * This release's PROMISE that it does not reference this column — neither
37
+ * reads it nor writes it, and never names it in a filter, a sort or a SET.
38
+ *
39
+ * The contraction gate reads it and nothing else does: dropping a column is
40
+ * refused while the RUNNING release's declaration still lacks this mark, so
41
+ * removing a column is two deploys — mark it, ship, then drop it.
42
+ *
43
+ * The word is `ignored` and not `deprecated` deliberately: RFC 9745 defines
44
+ * deprecation as changing NO behaviour, and this changes what a deploy will
45
+ * accept. Rails calls the same thing `ignored_columns`.
46
+ */
47
+ ignored?: boolean;
35
48
  onDeleteAction?: OnDeleteAction;
36
49
  enumName?: string;
37
50
  enumValues?: string[];
@@ -141,6 +154,23 @@ declare class ColumnBuilder<K extends ColumnType = ColumnType, N extends boolean
141
154
  * longer there to rename), so it can be deleted at your leisure.
142
155
  */
143
156
  renamedFrom(previous: string): ColumnBuilder<K, N, D, E, P, T>;
157
+ /**
158
+ * See {@link ColumnDef.ignored}.
159
+ *
160
+ * COPIES the def rather than mutating it. The constructor takes an existing
161
+ * def BY REFERENCE, so every builder derived from another shares one object —
162
+ * `const a = slug.unique()` leaves `a._def === slug._def`. An in-place
163
+ * `ignored = true` therefore marks every column sharing that def, including
164
+ * one another table actively reads, and the gate would let THAT column be
165
+ * dropped. Measured before this copy existed.
166
+ *
167
+ * The aliasing is older than this method and other fields leak through it too.
168
+ * The reason this one cannot wait: every other leak produces a VISIBLE schema
169
+ * difference — the plan shows it, the DDL shows it. This one is invisible by
170
+ * design (no DDL, no diff, no plan line), so its only effect is to disarm a
171
+ * safety gate in silence.
172
+ */
173
+ ignored(): ColumnBuilder<K, N, D, E, P, T>;
144
174
  references(table: string, column: string): ColumnBuilder<K, N, D, E, P, T>;
145
175
  /**
146
176
  * Add a real DB-level foreign key to the built-in auth users
@@ -32,6 +32,19 @@ interface ColumnDef {
32
32
  * declared. Without it, renaming a column loses its data.
33
33
  */
34
34
  renamedFrom?: string;
35
+ /**
36
+ * This release's PROMISE that it does not reference this column — neither
37
+ * reads it nor writes it, and never names it in a filter, a sort or a SET.
38
+ *
39
+ * The contraction gate reads it and nothing else does: dropping a column is
40
+ * refused while the RUNNING release's declaration still lacks this mark, so
41
+ * removing a column is two deploys — mark it, ship, then drop it.
42
+ *
43
+ * The word is `ignored` and not `deprecated` deliberately: RFC 9745 defines
44
+ * deprecation as changing NO behaviour, and this changes what a deploy will
45
+ * accept. Rails calls the same thing `ignored_columns`.
46
+ */
47
+ ignored?: boolean;
35
48
  onDeleteAction?: OnDeleteAction;
36
49
  enumName?: string;
37
50
  enumValues?: string[];
@@ -141,6 +154,23 @@ declare class ColumnBuilder<K extends ColumnType = ColumnType, N extends boolean
141
154
  * longer there to rename), so it can be deleted at your leisure.
142
155
  */
143
156
  renamedFrom(previous: string): ColumnBuilder<K, N, D, E, P, T>;
157
+ /**
158
+ * See {@link ColumnDef.ignored}.
159
+ *
160
+ * COPIES the def rather than mutating it. The constructor takes an existing
161
+ * def BY REFERENCE, so every builder derived from another shares one object —
162
+ * `const a = slug.unique()` leaves `a._def === slug._def`. An in-place
163
+ * `ignored = true` therefore marks every column sharing that def, including
164
+ * one another table actively reads, and the gate would let THAT column be
165
+ * dropped. Measured before this copy existed.
166
+ *
167
+ * The aliasing is older than this method and other fields leak through it too.
168
+ * The reason this one cannot wait: every other leak produces a VISIBLE schema
169
+ * difference — the plan shows it, the DDL shows it. This one is invisible by
170
+ * design (no DDL, no diff, no plan line), so its only effect is to disarm a
171
+ * safety gate in silence.
172
+ */
173
+ ignored(): ColumnBuilder<K, N, D, E, P, T>;
144
174
  references(table: string, column: string): ColumnBuilder<K, N, D, E, P, T>;
145
175
  /**
146
176
  * Add a real DB-level foreign key to the built-in auth users
@@ -1,7 +1,7 @@
1
1
  import { Buckets, BucketTypes } from './stack.cjs';
2
2
  import { AsyncLocalStorage } from 'node:async_hooks';
3
3
  import { C as CacheClient, P as PalbaseDocsClient, a as PalbaseFlagsClient, L as Logger, b as PalbaseNotificationsClient, c as PalbaseRealtimeClient, D as DBClient, S as SecretsService, d as PalbaseStorageClient, e as PalbaseBucketClient, f as DBOps, T as TxPlanBody, g as TxPlanResponse, A as AuthSpec } from './endpoint-BSGw1pTu.cjs';
4
- import { E as EnvTypedDatabase } from './index-D4rts8T7.cjs';
4
+ import { E as EnvTypedDatabase } from './index-BLAbr9ZH.cjs';
5
5
  import { R as RouteMeta } from './registry-CgJvDYUW.cjs';
6
6
 
7
7
  /**
@@ -1,7 +1,7 @@
1
1
  import { Buckets, BucketTypes } from './stack.js';
2
2
  import { AsyncLocalStorage } from 'node:async_hooks';
3
3
  import { C as CacheClient, P as PalbaseDocsClient, a as PalbaseFlagsClient, L as Logger, b as PalbaseNotificationsClient, c as PalbaseRealtimeClient, D as DBClient, S as SecretsService, d as PalbaseStorageClient, e as PalbaseBucketClient, f as DBOps, T as TxPlanBody, g as TxPlanResponse, A as AuthSpec } from './endpoint-DMwJjEHQ.js';
4
- import { E as EnvTypedDatabase } from './index-ByBMibIJ.js';
4
+ import { E as EnvTypedDatabase } from './index-BTMYod_l.js';
5
5
  import { R as RouteMeta } from './registry-B8pld3fj.js';
6
6
 
7
7
  /**
package/dist/index.cjs CHANGED
@@ -1876,6 +1876,7 @@ function columnToJSON(column) {
1876
1876
  if (def.defaultRandom === true) out.defaultRandom = true;
1877
1877
  if (def.defaultNow === true) out.defaultNow = true;
1878
1878
  if (def.renamedFrom !== void 0) out.renamedFrom = def.renamedFrom;
1879
+ if (def.ignored === true) out.ignored = true;
1879
1880
  if (def.references !== void 0) {
1880
1881
  out.references = { table: def.references.table, column: def.references.column };
1881
1882
  }
@@ -2199,6 +2200,28 @@ var ColumnBuilder = class _ColumnBuilder {
2199
2200
  this._def.renamedFrom = previous;
2200
2201
  return this;
2201
2202
  }
2203
+ /**
2204
+ * See {@link ColumnDef.ignored}.
2205
+ *
2206
+ * COPIES the def rather than mutating it. The constructor takes an existing
2207
+ * def BY REFERENCE, so every builder derived from another shares one object —
2208
+ * `const a = slug.unique()` leaves `a._def === slug._def`. An in-place
2209
+ * `ignored = true` therefore marks every column sharing that def, including
2210
+ * one another table actively reads, and the gate would let THAT column be
2211
+ * dropped. Measured before this copy existed.
2212
+ *
2213
+ * The aliasing is older than this method and other fields leak through it too.
2214
+ * The reason this one cannot wait: every other leak produces a VISIBLE schema
2215
+ * difference — the plan shows it, the DDL shows it. This one is invisible by
2216
+ * design (no DDL, no diff, no plan line), so its only effect is to disarm a
2217
+ * safety gate in silence.
2218
+ */
2219
+ ignored() {
2220
+ return new _ColumnBuilder(this._def.type, {
2221
+ ...this._def,
2222
+ ignored: true
2223
+ });
2224
+ }
2202
2225
  references(table, column) {
2203
2226
  refuseOnVector(this._def, "references");
2204
2227
  this._def.references = { table, column };