@lunora/do 1.0.0-alpha.3 → 1.0.0-alpha.5
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.
- package/__assets__/package-og.svg +1 -1
- package/dist/index.d.mts +91 -32
- package/dist/index.d.ts +91 -32
- package/dist/index.mjs +18 -18
- package/dist/packem_shared/{assertFlatPredicate-DyVYReuT.mjs → DEFAULT_MAX_RELATION_KEYS-Dou2PWdO.mjs} +1 -1
- package/dist/packem_shared/{assertValidClientId-CBZ1zC96.mjs → NotUniqueError-h_thNFSZ.mjs} +96 -32
- package/dist/packem_shared/{guardWriter-u3UlnCH5.mjs → RLS_UNWRAP_SYMBOL-EtGQdC9d.mjs} +6 -2
- package/dist/packem_shared/{ROOT_DO_SIZE_WARN_BYTES-DQkmGiCS.mjs → ROOT_DO_SIZE_WARN_BYTES-3lZ2yigq.mjs} +10 -16
- package/dist/packem_shared/{applyOnDelete-CMif2RKw.mjs → applyOnDelete-sA7o1CqD.mjs} +6 -2
- package/dist/packem_shared/{buildSeekWhere-lVsNXSLy.mjs → applySelect-BvZdFUBT.mjs} +18 -1
- package/dist/packem_shared/{backfillAggregateIndexes-BF5eL7kW.mjs → backfillAggregateIndexes-BbVPvciS.mjs} +1 -1
- package/dist/packem_shared/{runShardMigrations-C3bn5r93.mjs → runShardMigrations-PabobOjF.mjs} +2 -2
- package/dist/packem_shared/{serveRelationFanout-Clr1a05L.mjs → serveRelationFanout-CFBKWJ8Q.mjs} +1 -1
- package/package.json +1 -1
- /package/dist/packem_shared/{ADMIN_FUNCTION_PREFIX-Dzdqq5J2.mjs → ADMIN_FUNCTIONS-Dzdqq5J2.mjs} +0 -0
- /package/dist/packem_shared/{matchesStaticWhere-CFk6adSu.mjs → AGGREGATE_SQL_FUNCTION-CFk6adSu.mjs} +0 -0
- /package/dist/packem_shared/{AUTH_METRICS_BUCKET_MS-CiHHYeJi.mjs → AUTH_METRICS_BUCKETS_TABLE-CiHHYeJi.mjs} +0 -0
- /package/dist/packem_shared/{applyCdcChanges-Ctdmxmrv.mjs → CDC_LOG_TABLE-Ctdmxmrv.mjs} +0 -0
- /package/dist/packem_shared/{ensureFunctionMetricsTables-UDNVD7FS.mjs → FUNCTION_METRICS_BUCKETS_TABLE-UDNVD7FS.mjs} +0 -0
- /package/dist/packem_shared/{clearCapturedMail-CPpgl-dX.mjs → MAIL_RETENTION-CPpgl-dX.mjs} +0 -0
- /package/dist/packem_shared/{assertReadonly-dDcFE1YZ.mjs → MAX_SQL_ROWS-dDcFE1YZ.mjs} +0 -0
- /package/dist/packem_shared/{buildSecurityAudit-CCAvoFlr.mjs → MIN_ADMIN_TOKEN_LENGTH-CCAvoFlr.mjs} +0 -0
- /package/dist/packem_shared/{encodePartitionKey-C6blLR5K.mjs → RANK_TIEBREAK-C6blLR5K.mjs} +0 -0
- /package/dist/packem_shared/{ftsTableName-BLEMawrp.mjs → buildFtsMatch-BLEMawrp.mjs} +0 -0
- /package/dist/packem_shared/{runTriggers-5N6_Fx0A.mjs → hasTrigger-5N6_Fx0A.mjs} +0 -0
package/dist/index.d.mts
CHANGED
|
@@ -195,10 +195,17 @@ interface RelationDefinitionLike {
|
|
|
195
195
|
readonly references: string;
|
|
196
196
|
readonly table: string;
|
|
197
197
|
}
|
|
198
|
-
/** Per-relation refinements: filter / order / cap / recurse into the children. */
|
|
198
|
+
/** Per-relation refinements: filter / order / cap / project / recurse into the children. */
|
|
199
199
|
interface NestedWith {
|
|
200
200
|
limit?: number;
|
|
201
201
|
orderBy?: OrderByInput[];
|
|
202
|
+
/**
|
|
203
|
+
* Project each loaded child down to these fields (like the top-level
|
|
204
|
+
* `findMany` `select`). Applied AFTER grouping, so the join key stays
|
|
205
|
+
* available to map children to parents; `_id`/`_creationTime` and any deeper
|
|
206
|
+
* `with` relations are always retained.
|
|
207
|
+
*/
|
|
208
|
+
select?: ReadonlyArray<string>;
|
|
202
209
|
where?: WhereInput;
|
|
203
210
|
with?: WithInput;
|
|
204
211
|
}
|
|
@@ -289,9 +296,9 @@ declare const applyOnDelete: (options: ApplyOnDeleteOptions) => Promise<void>;
|
|
|
289
296
|
* fakes (which never carry a runtime parser) keep working.
|
|
290
297
|
*/
|
|
291
298
|
declare const runRowValidators: (definition: TableDefinitionLike, document: Record<string, unknown>) => void;
|
|
292
|
-
type SortDirection
|
|
299
|
+
type SortDirection = "asc" | "desc";
|
|
293
300
|
/** A single `{ field: "asc" | "desc" }` entry; `orderBy` is an ordered list of these. */
|
|
294
|
-
type OrderByInput = Record<string, SortDirection
|
|
301
|
+
type OrderByInput = Record<string, SortDirection>;
|
|
295
302
|
interface QueryArgs {
|
|
296
303
|
/**
|
|
297
304
|
* Predicate injected by the runtime (e.g. by `@lunora/server`'s RLS
|
|
@@ -304,6 +311,12 @@ interface QueryArgs {
|
|
|
304
311
|
*/
|
|
305
312
|
baseWhere?: WhereInput;
|
|
306
313
|
cursor?: null | string;
|
|
314
|
+
/**
|
|
315
|
+
* Opt a list read OUT of soft-delete scoping: when `true`, rows whose
|
|
316
|
+
* soft-delete column is set are INCLUDED. Has no effect on a table without
|
|
317
|
+
* `.softDelete()`. Default (absent/false) hides soft-deleted rows.
|
|
318
|
+
*/
|
|
319
|
+
includeDeleted?: boolean;
|
|
307
320
|
limit?: number;
|
|
308
321
|
orderBy?: OrderByInput[];
|
|
309
322
|
/**
|
|
@@ -324,6 +337,15 @@ interface QueryArgs {
|
|
|
324
337
|
* reads (`findMany`/`findFirst`) — this flag specifically guards `count`.
|
|
325
338
|
*/
|
|
326
339
|
restrictsCounts?: boolean;
|
|
340
|
+
/**
|
|
341
|
+
* Project each returned row down to these fields. The system fields `_id` and
|
|
342
|
+
* `_creationTime` are always retained (cursors + by-id reuse depend on them),
|
|
343
|
+
* and any relations attached via `with` (their relation keys and `_count`)
|
|
344
|
+
* survive the trim. Applied AFTER the rows are read and relations resolved, so
|
|
345
|
+
* read-dependency tracking and cursor encoding see the full row — only the
|
|
346
|
+
* payload returned to the caller is narrowed. Omit for the full document.
|
|
347
|
+
*/
|
|
348
|
+
select?: ReadonlyArray<string>;
|
|
327
349
|
where?: WhereInput;
|
|
328
350
|
with?: WithInput;
|
|
329
351
|
}
|
|
@@ -341,7 +363,7 @@ interface QueryPage {
|
|
|
341
363
|
splitCursor?: null | string;
|
|
342
364
|
}
|
|
343
365
|
interface OrderKey {
|
|
344
|
-
direction: SortDirection
|
|
366
|
+
direction: SortDirection;
|
|
345
367
|
field: string;
|
|
346
368
|
}
|
|
347
369
|
/**
|
|
@@ -376,6 +398,26 @@ declare const buildSeekWhere: (keys: OrderKey[], cursorValues: unknown[]) => Whe
|
|
|
376
398
|
* the page it terminates. Reactive pagination uses this for a page's fixed end
|
|
377
399
|
* cursor; the shared compiler renders it per dialect.
|
|
378
400
|
*/
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* Project `page` rows down to `select` — plus the always-kept system fields and
|
|
404
|
+
* the relation/`_count` keys attached by a `with` load (passed as `withInput`,
|
|
405
|
+
* the same object handed to `findMany`). Returns the page unchanged when
|
|
406
|
+
* `select` is undefined. Pure; callers apply it AFTER relation resolution +
|
|
407
|
+
* cursor encoding so only the returned payload is trimmed (dependency tracking +
|
|
408
|
+
* the cursor still see the full row).
|
|
409
|
+
*/
|
|
410
|
+
declare const applySelect: (page: Record<string, unknown>[], select: ReadonlyArray<string> | undefined, withInput?: Record<string, unknown>) => Record<string, unknown>[];
|
|
411
|
+
/**
|
|
412
|
+
* The read-scope predicate that hides soft-deleted rows — `{ [field]: { isNull:
|
|
413
|
+
* true } }` matching the live rows whose soft-delete column is null/absent — or
|
|
414
|
+
* `undefined` when the table isn't `.softDelete()` or the read opted in via
|
|
415
|
+
* `includeDeleted`. AND-merge it into a list read's `where` (the by-id path
|
|
416
|
+
* never calls this, so `get`/`patch`/`replace`/`restore` still address the row).
|
|
417
|
+
*/
|
|
418
|
+
declare const softDeleteScope: (softDeleteMode: {
|
|
419
|
+
field: string;
|
|
420
|
+
} | undefined, includeDeleted: boolean | undefined) => undefined | WhereInput;
|
|
379
421
|
type RankDirection = "asc" | "desc";
|
|
380
422
|
interface RankSortKeyLike {
|
|
381
423
|
readonly direction: RankDirection;
|
|
@@ -1233,6 +1275,16 @@ interface TableDefinitionLike {
|
|
|
1233
1275
|
field?: string;
|
|
1234
1276
|
kind: "global" | "root" | "shardBy";
|
|
1235
1277
|
};
|
|
1278
|
+
/**
|
|
1279
|
+
* Mirror of `@lunora/server`'s `TableDefinition.softDeleteMode` (set by
|
|
1280
|
+
* `.softDelete()`). When present, `delete()` flips the `field` column to a
|
|
1281
|
+
* timestamp instead of physically removing the row (cascading as a soft
|
|
1282
|
+
* delete), and list reads scope out rows whose `field` is set unless
|
|
1283
|
+
* `includeDeleted` is passed. By-id reads/writes are unaffected.
|
|
1284
|
+
*/
|
|
1285
|
+
readonly softDeleteMode?: {
|
|
1286
|
+
field: string;
|
|
1287
|
+
};
|
|
1236
1288
|
readonly triggerMap?: Record<string, TriggerDefinitionLike>;
|
|
1237
1289
|
}
|
|
1238
1290
|
interface IndexDefinitionLike {
|
|
@@ -1525,7 +1577,16 @@ interface DatabaseWriterLike {
|
|
|
1525
1577
|
* RLS-aware ctx seam from §3.2).
|
|
1526
1578
|
*/
|
|
1527
1579
|
count: (tableName: string, where?: RestrictableQueryOptions | WhereInput) => Promise<number>;
|
|
1528
|
-
|
|
1580
|
+
/**
|
|
1581
|
+
* Delete a row by id. On a `.softDelete()` table this flips the marker column
|
|
1582
|
+
* (cascading as a soft delete) instead of removing the row; pass
|
|
1583
|
+
* `options.hard` to force a physical removal (which cascades as a physical
|
|
1584
|
+
* delete, reaching already-soft-deleted children too). Non-soft tables ignore
|
|
1585
|
+
* `options.hard` — they always delete physically.
|
|
1586
|
+
*/
|
|
1587
|
+
delete: (id: string, expectedTable?: string, options?: {
|
|
1588
|
+
hard?: boolean;
|
|
1589
|
+
}) => Promise<void>;
|
|
1529
1590
|
/**
|
|
1530
1591
|
* Delete many rows by id in one call (a loop over `delete()`). The returned
|
|
1531
1592
|
* `deleted` is the number of ids **requested**, not rows actually removed (an
|
|
@@ -1702,6 +1763,14 @@ interface DatabaseWriterLike {
|
|
|
1702
1763
|
rankPageRows?: (tableName: string, indexName: string, options?: RankPageOptions) => Promise<ShardRankPageResult>;
|
|
1703
1764
|
replace: (id: string, document: Record<string, unknown>, expectedTable?: string) => Promise<void>;
|
|
1704
1765
|
/**
|
|
1766
|
+
* Un-soft-delete a row: clears the `.softDelete()` marker column (a by-id
|
|
1767
|
+
* UPDATE, so it works on a row that list reads currently hide). Throws when
|
|
1768
|
+
* the row's table isn't `.softDelete()`. Optional on the interface — the DO
|
|
1769
|
+
* writer implements it; the `.global()` twin does too, so a restore on a
|
|
1770
|
+
* global table routes through the DO writer's global fallback.
|
|
1771
|
+
*/
|
|
1772
|
+
restore?: (id: string, expectedTable?: string) => Promise<void>;
|
|
1773
|
+
/**
|
|
1705
1774
|
* Best-effort, read-only reader over Lunora's system tables
|
|
1706
1775
|
* (`_scheduled_functions`, `_storage`). Eventually consistent and **not**
|
|
1707
1776
|
* part of the shard's transaction snapshot — see {@link SystemDatabaseReader}.
|
|
@@ -1918,6 +1987,22 @@ declare const readAggregateValue: (op: string, row: {
|
|
|
1918
1987
|
* string.
|
|
1919
1988
|
*/
|
|
1920
1989
|
declare const encodeAggregateKey: (by: ReadonlyArray<string>, source: Record<string, unknown>) => string;
|
|
1990
|
+
/** One recorded admin operation, in monotonic `seq` order. */
|
|
1991
|
+
interface AuditEntry {
|
|
1992
|
+
/** JSON-decoded extra context (the acting user, op-specific counts, …); absent when none was recorded. */
|
|
1993
|
+
detail?: Record<string, unknown>;
|
|
1994
|
+
/** Primary key of the affected row, when the op targets one. */
|
|
1995
|
+
id?: string;
|
|
1996
|
+
/** Short op identifier, e.g. `writeRow` or `runMigration`. */
|
|
1997
|
+
op: string;
|
|
1998
|
+
/** Monotonic per-shard cursor — strictly increasing, never reused. */
|
|
1999
|
+
seq: number;
|
|
2000
|
+
/** Affected table, when the op targets one. */
|
|
2001
|
+
table?: string;
|
|
2002
|
+
/** Wall-clock millis when the op was recorded. */
|
|
2003
|
+
ts: number;
|
|
2004
|
+
}
|
|
2005
|
+
/** Fields accepted when appending one audit entry; `seq` is assigned by the table. */
|
|
1921
2006
|
/** Reserved single-row auth accumulator table. Auto-hidden from the data browser by the `__lunora` prefix. */
|
|
1922
2007
|
declare const AUTH_METRICS_TABLE = "__lunora_auth_metrics";
|
|
1923
2008
|
/** Reserved coarse time-series table: app-wide auth attempt/failure counts bucketed by a fixed window. */
|
|
@@ -2234,30 +2319,6 @@ interface TableInfo {
|
|
|
2234
2319
|
name: string;
|
|
2235
2320
|
rowCount: number;
|
|
2236
2321
|
}
|
|
2237
|
-
/**
|
|
2238
|
-
* One recorded admin operation served by `__lunora_admin__:getAuditLog`, sourced
|
|
2239
|
-
* from the reserved `__lunora_audit__` table (see `audit-log.ts`). Unlike the
|
|
2240
|
-
* in-memory `getMetrics`/`getFunctionStats` counters, the audit log is durable —
|
|
2241
|
-
* it survives hibernation/restart and is bounded only by a retention cap. `seq`
|
|
2242
|
-
* is a monotonic per-shard cursor the studio pages through; `op` is the short
|
|
2243
|
-
* op name (`writeRow`, `runMigration`, `importShard`, `applyCdc`); `table`/`id`
|
|
2244
|
-
* are present when the op targets one; `detail` carries op-specific context
|
|
2245
|
-
* (notably the acting `userId`).
|
|
2246
|
-
*/
|
|
2247
|
-
interface AuditEntry {
|
|
2248
|
-
/** JSON extra context (acting user, op-specific counts, …); absent when none was recorded. */
|
|
2249
|
-
detail?: Record<string, unknown>;
|
|
2250
|
-
/** Primary key of the affected row, when the op targets one. */
|
|
2251
|
-
id?: string;
|
|
2252
|
-
/** Short op identifier, e.g. `writeRow`. */
|
|
2253
|
-
op: string;
|
|
2254
|
-
/** Monotonic per-shard cursor — strictly increasing, never reused. */
|
|
2255
|
-
seq: number;
|
|
2256
|
-
/** Affected table, when the op targets one. */
|
|
2257
|
-
table?: string;
|
|
2258
|
-
/** Epoch-ms the op was recorded. */
|
|
2259
|
-
ts: number;
|
|
2260
|
-
}
|
|
2261
2322
|
/** Payload of a `__lunora_admin__:getAuditLog` call: the recorded entries, newest first. */
|
|
2262
2323
|
interface AuditLogResult {
|
|
2263
2324
|
entries: AuditEntry[];
|
|
@@ -2633,8 +2694,6 @@ interface FilterClause {
|
|
|
2633
2694
|
operator: FilterOperator;
|
|
2634
2695
|
value?: unknown;
|
|
2635
2696
|
}
|
|
2636
|
-
/** Sort direction for an {@link OrderByClause}. */
|
|
2637
|
-
type SortDirection = "asc" | "desc";
|
|
2638
2697
|
/**
|
|
2639
2698
|
* A server-side sort over one displayed column. `column` resolves the same way a
|
|
2640
2699
|
* {@link FilterClause}'s does — a physical/meta column orders by its identifier, a
|
|
@@ -5596,4 +5655,4 @@ interface WhereSqlStrategy {
|
|
|
5596
5655
|
* `undefined` when the input imposes no constraint (empty `where`).
|
|
5597
5656
|
*/
|
|
5598
5657
|
declare const compileWhereSql: (where: WhereInput | undefined, strategy: WhereSqlStrategy) => SQL | undefined;
|
|
5599
|
-
export { ADMIN_FUNCTIONS, ADMIN_FUNCTION_PREFIX, AGGREGATE_SQL_FUNCTION, AUTH_METRICS_BUCKETS_TABLE, AUTH_METRICS_BUCKET_MS, AUTH_METRICS_BUCKET_RETENTION, AUTH_METRICS_TABLE, type AdvisoriesResult, type AdvisoryFinding, type AggregateIndexDefinitionLike, type AggregateOp, type AggregateOptions, type AggregateResult, type AggregateTally, type ApplyOnDeleteOptions, type AuditEntry, type AuditLogResult, type AuthMetrics, type AuthMetricsBucket, type BroadcastDelta, CDC_LOG_TABLE, type CacheEntry, type CapturedMailRow, type CdcChange, type Clock, type ColumnMeta, type ColumnMetaLike, ConflictError, type CountArgs, CountRlsUnsupportedError, type CtxDbOptions, DATA_MIGRATION_STATE_TABLE, DEFAULT_MAX_RELATION_KEYS, type DataMigrationDocument, type DataMigrationLike, type DataMigrationTransform, type DatabaseWriterLike, type DependencyTracker, type DeployInfo, type ExportRow, type ExportShardAdminArgs, type ExportShardArgs, FUNCTION_METRICS_BUCKETS_TABLE, FUNCTION_METRICS_BUCKET_MS, FUNCTION_METRICS_BUCKET_RETENTION, FUNCTION_METRICS_INDEX_TABLE, FUNCTION_METRICS_TABLE, type FacetColumnOptions, type FacetColumnResult, type FacetValue, type FieldOperators, type FunctionCallStat, type FunctionMetricBucket, type FunctionMetricIndexHit, type FunctionStatsResult, type GroupByEntry, type GroupByOptions, type HibernatableWebSocket, type IdGenerator, type ImportError, type ImportShardAdminArgs, type ImportShardArgs, type ImportShardResult, type IndexDefinitionLike, type IndexRangeBuilderLike, LogBuffer, type LogEntry, type LogEventInput, type LogLevel, type LogSink, MAIL_RETENTION, MAIL_TABLE, MAX_SQL_ROWS, MIN_ADMIN_TOKEN_LENGTH, MIN_AUTH_SECRET_LENGTH, type MaskColumnMetadata, type MaskPoliciesResult, type MigrationDirection, type MigrationRunResult, type MigrationStatus, type MigrationStatusRow, type MutationDelta, type NestedWith, NotFoundError, NotUniqueError, type OnDeleteActionLike, type OrderByInput, type OrderKey, type PaginationOptions, type PitrBookmarkResult, type PitrRestoreArgs, type PitrRestoreResult, type PitrStorage, type QueryArgs, type QueryPage, RANK_TIEBREAK, RELATION_FUNCTION_PREFIX, RLS_UNWRAP_SYMBOL, ROOT_DO_SIZE_WARN_BYTES, ROOT_SHARD_NAME, type RankDirection, type RankIndexDefinitionLike, type RankOptions, type RankPage, type RankPageOptions, type RankPageRow, type RankPageRowKey, type RankResult, type RankSortKeyLike, ReactiveCache, type ReactiveCacheOptions, type ReadHook, type ReadTablePageOptions, type RecordAuthEventInput, type RecordFunctionMetricInput, type RecordMailInput, type RelationDefinitionLike, type RenderedSql, type ResolveRelationPredicatesOptions, type ResolveWithOptions, type RestrictableQueryOptions, type RlsPoliciesResult, type RlsPolicyMetadata, RlsRequiredError, type RlsRoleMetadata, type RpcRequest, type RunDataMigrationOptions, type RunShardApplyCdcArgs, type RunShardApplyCdcResult, type RunShardBulkDeleteArgs, type RunShardBulkDeleteResult, type RunShardExportArgs, type RunShardImportArgs, type RunShardMigrationArgs, type RunShardRankBeforeArgs, type RunShardRankPageArgs, type RunShardWriteArgs, type RunShardWriteResult, type RunTriggersOptions, SCAN_DEP, SESSION_DO_TTL_DEFAULT, SHARD_REGISTRY_DO_NAME, type ScheduledFunctionDoc, type SchedulerLike, type SchemaLike, type SearchFilterBuilderLike, type SecurityAuditResult, type SecurityFinding, type SecurityFindingKind, type SecurityFindingLevel, type SelectMatchingIdsOptions, type ServerDefaultContextLike, SessionDO, type SessionRecord, type SettingEntry, type SettingKind, type SettingsResult, ShardDO, type ShardDOOptions, type ShardDOState, type ShardRankPageResult, ShardRegistryDO, type SocketAttachment, type SortDirection
|
|
5658
|
+
export { ADMIN_FUNCTIONS, ADMIN_FUNCTION_PREFIX, AGGREGATE_SQL_FUNCTION, AUTH_METRICS_BUCKETS_TABLE, AUTH_METRICS_BUCKET_MS, AUTH_METRICS_BUCKET_RETENTION, AUTH_METRICS_TABLE, type AdvisoriesResult, type AdvisoryFinding, type AggregateIndexDefinitionLike, type AggregateOp, type AggregateOptions, type AggregateResult, type AggregateTally, type ApplyOnDeleteOptions, type AuditEntry, type AuditLogResult, type AuthMetrics, type AuthMetricsBucket, type BroadcastDelta, CDC_LOG_TABLE, type CacheEntry, type CapturedMailRow, type CdcChange, type Clock, type ColumnMeta, type ColumnMetaLike, ConflictError, type CountArgs, CountRlsUnsupportedError, type CtxDbOptions, DATA_MIGRATION_STATE_TABLE, DEFAULT_MAX_RELATION_KEYS, type DataMigrationDocument, type DataMigrationLike, type DataMigrationTransform, type DatabaseWriterLike, type DependencyTracker, type DeployInfo, type ExportRow, type ExportShardAdminArgs, type ExportShardArgs, FUNCTION_METRICS_BUCKETS_TABLE, FUNCTION_METRICS_BUCKET_MS, FUNCTION_METRICS_BUCKET_RETENTION, FUNCTION_METRICS_INDEX_TABLE, FUNCTION_METRICS_TABLE, type FacetColumnOptions, type FacetColumnResult, type FacetValue, type FieldOperators, type FunctionCallStat, type FunctionMetricBucket, type FunctionMetricIndexHit, type FunctionStatsResult, type GroupByEntry, type GroupByOptions, type HibernatableWebSocket, type IdGenerator, type ImportError, type ImportShardAdminArgs, type ImportShardArgs, type ImportShardResult, type IndexDefinitionLike, type IndexRangeBuilderLike, LogBuffer, type LogEntry, type LogEventInput, type LogLevel, type LogSink, MAIL_RETENTION, MAIL_TABLE, MAX_SQL_ROWS, MIN_ADMIN_TOKEN_LENGTH, MIN_AUTH_SECRET_LENGTH, type MaskColumnMetadata, type MaskPoliciesResult, type MigrationDirection, type MigrationRunResult, type MigrationStatus, type MigrationStatusRow, type MutationDelta, type NestedWith, NotFoundError, NotUniqueError, type OnDeleteActionLike, type OrderByInput, type OrderKey, type PaginationOptions, type PitrBookmarkResult, type PitrRestoreArgs, type PitrRestoreResult, type PitrStorage, type QueryArgs, type QueryPage, RANK_TIEBREAK, RELATION_FUNCTION_PREFIX, RLS_UNWRAP_SYMBOL, ROOT_DO_SIZE_WARN_BYTES, ROOT_SHARD_NAME, type RankDirection, type RankIndexDefinitionLike, type RankOptions, type RankPage, type RankPageOptions, type RankPageRow, type RankPageRowKey, type RankResult, type RankSortKeyLike, ReactiveCache, type ReactiveCacheOptions, type ReadHook, type ReadTablePageOptions, type RecordAuthEventInput, type RecordFunctionMetricInput, type RecordMailInput, type RelationDefinitionLike, type RenderedSql, type ResolveRelationPredicatesOptions, type ResolveWithOptions, type RestrictableQueryOptions, type RlsPoliciesResult, type RlsPolicyMetadata, RlsRequiredError, type RlsRoleMetadata, type RpcRequest, type RunDataMigrationOptions, type RunShardApplyCdcArgs, type RunShardApplyCdcResult, type RunShardBulkDeleteArgs, type RunShardBulkDeleteResult, type RunShardExportArgs, type RunShardImportArgs, type RunShardMigrationArgs, type RunShardRankBeforeArgs, type RunShardRankPageArgs, type RunShardWriteArgs, type RunShardWriteResult, type RunTriggersOptions, SCAN_DEP, SESSION_DO_TTL_DEFAULT, SHARD_REGISTRY_DO_NAME, type ScheduledFunctionDoc, type SchedulerLike, type SchemaLike, type SearchFilterBuilderLike, type SecurityAuditResult, type SecurityFinding, type SecurityFindingKind, type SecurityFindingLevel, type SelectMatchingIdsOptions, type ServerDefaultContextLike, SessionDO, type SessionRecord, type SettingEntry, type SettingKind, type SettingsResult, ShardDO, type ShardDOOptions, type ShardDOState, type ShardRankPageResult, ShardRegistryDO, type SocketAttachment, type SortDirection, type SqlConsoleResult, type SqlCursor, type SqlEngine, type SqlExec, type StorageRuleMetadata, type StorageRulesResult, type StudioFeaturesResult, type SubscriptionEnvelope, type SubscriptionOutcome, type SubscriptionQuery, type SystemDatabaseReader, type SystemDoc, type SystemQuery, type SystemReaderOptions, type SystemReaderSchedulerLike, type SystemReaderStorageLike, type SystemTableName, type TableColumnsResult, type TableDefinitionLike, type TableIndexInfo, type TableIndexesResult, type TableInfo, type TablePage, type TableReaderLike, type TablesColumnsResult, type TransactionSqlLike, type TriggerContextLike, type TriggerDefinitionLike, type TriggerEventLike, type TriggerOpLike, type TriggerTimingLike, type ValidatorLike, type WhereInput, type WhereSqlStrategy, type WithInput, type WorkflowMetadata, type WorkflowsResult, type WriteEvent, type WriteHook, aggregateSqlFunction, aggregateTableName, applyCdcChanges, applyOnDelete, applySelect, armRestore, assertFlatPredicate, assertReadonly, assertValidClientId, backfillAggregateIndexes, backfillRankIndexes, buildFtsMatch, buildSecurityAudit, buildSeekWhere, clearCapturedMail, coerceAggregateNumber, compileWhereSql, containsRelationPredicate, createDependencyTracker, createShardCtxDb, createSystemReader, decodeCursor, depKey, encodeAggregateKey, encodeCursor, encodePartitionKey, ensureAuthMetricsTables, ensureFunctionMetricsTables, ensureMailTable, exportShardRows, exportShardTable, facetColumn, foldAggregateTally, ftsTableName, guardWriter, hasTrigger, importShardRows, isRelationPredicate, listTables, matchesRankStaticWhere, matchesStaticWhere, mergeWhere, normalizeCountArgument, normalizeIdStructurally, normalizeOrderKeys, parseExportShardArgs, parseImportShardArgs, planAggregateLookup, rankTableName, reactiveCacheKey, readAggregateValue, readAuthMetrics, readBookmark, readCapturedMail, readCdcChanges, readFunctionMetricBuckets, readFunctionMetricIndexHits, readFunctionMetrics, readFunctionMetricsTotals, readMigrationStatus, readTablePage, recordAuthEvent, recordCapturedMail, recordFunctionMetric, renderSql, resolveRankPartition, resolveRelationPredicates, resolveWith, runDataMigration, runReadonlySql, runRowValidators, runShardMigrations, runTriggers, scoreDocument, selectExportTables, selectIndexForAggregate, selectIndexForCount, selectIndexForGroupBy, selectMatchingIds, serveRelationFanout, softDeleteScope, sortColumnName, stableStringify, stringifySearchText, subscriptionListDeltas, throwingScheduler, tokenizeSearch, trimCdcChanges, validateImportRow };
|
package/dist/index.d.ts
CHANGED
|
@@ -195,10 +195,17 @@ interface RelationDefinitionLike {
|
|
|
195
195
|
readonly references: string;
|
|
196
196
|
readonly table: string;
|
|
197
197
|
}
|
|
198
|
-
/** Per-relation refinements: filter / order / cap / recurse into the children. */
|
|
198
|
+
/** Per-relation refinements: filter / order / cap / project / recurse into the children. */
|
|
199
199
|
interface NestedWith {
|
|
200
200
|
limit?: number;
|
|
201
201
|
orderBy?: OrderByInput[];
|
|
202
|
+
/**
|
|
203
|
+
* Project each loaded child down to these fields (like the top-level
|
|
204
|
+
* `findMany` `select`). Applied AFTER grouping, so the join key stays
|
|
205
|
+
* available to map children to parents; `_id`/`_creationTime` and any deeper
|
|
206
|
+
* `with` relations are always retained.
|
|
207
|
+
*/
|
|
208
|
+
select?: ReadonlyArray<string>;
|
|
202
209
|
where?: WhereInput;
|
|
203
210
|
with?: WithInput;
|
|
204
211
|
}
|
|
@@ -289,9 +296,9 @@ declare const applyOnDelete: (options: ApplyOnDeleteOptions) => Promise<void>;
|
|
|
289
296
|
* fakes (which never carry a runtime parser) keep working.
|
|
290
297
|
*/
|
|
291
298
|
declare const runRowValidators: (definition: TableDefinitionLike, document: Record<string, unknown>) => void;
|
|
292
|
-
type SortDirection
|
|
299
|
+
type SortDirection = "asc" | "desc";
|
|
293
300
|
/** A single `{ field: "asc" | "desc" }` entry; `orderBy` is an ordered list of these. */
|
|
294
|
-
type OrderByInput = Record<string, SortDirection
|
|
301
|
+
type OrderByInput = Record<string, SortDirection>;
|
|
295
302
|
interface QueryArgs {
|
|
296
303
|
/**
|
|
297
304
|
* Predicate injected by the runtime (e.g. by `@lunora/server`'s RLS
|
|
@@ -304,6 +311,12 @@ interface QueryArgs {
|
|
|
304
311
|
*/
|
|
305
312
|
baseWhere?: WhereInput;
|
|
306
313
|
cursor?: null | string;
|
|
314
|
+
/**
|
|
315
|
+
* Opt a list read OUT of soft-delete scoping: when `true`, rows whose
|
|
316
|
+
* soft-delete column is set are INCLUDED. Has no effect on a table without
|
|
317
|
+
* `.softDelete()`. Default (absent/false) hides soft-deleted rows.
|
|
318
|
+
*/
|
|
319
|
+
includeDeleted?: boolean;
|
|
307
320
|
limit?: number;
|
|
308
321
|
orderBy?: OrderByInput[];
|
|
309
322
|
/**
|
|
@@ -324,6 +337,15 @@ interface QueryArgs {
|
|
|
324
337
|
* reads (`findMany`/`findFirst`) — this flag specifically guards `count`.
|
|
325
338
|
*/
|
|
326
339
|
restrictsCounts?: boolean;
|
|
340
|
+
/**
|
|
341
|
+
* Project each returned row down to these fields. The system fields `_id` and
|
|
342
|
+
* `_creationTime` are always retained (cursors + by-id reuse depend on them),
|
|
343
|
+
* and any relations attached via `with` (their relation keys and `_count`)
|
|
344
|
+
* survive the trim. Applied AFTER the rows are read and relations resolved, so
|
|
345
|
+
* read-dependency tracking and cursor encoding see the full row — only the
|
|
346
|
+
* payload returned to the caller is narrowed. Omit for the full document.
|
|
347
|
+
*/
|
|
348
|
+
select?: ReadonlyArray<string>;
|
|
327
349
|
where?: WhereInput;
|
|
328
350
|
with?: WithInput;
|
|
329
351
|
}
|
|
@@ -341,7 +363,7 @@ interface QueryPage {
|
|
|
341
363
|
splitCursor?: null | string;
|
|
342
364
|
}
|
|
343
365
|
interface OrderKey {
|
|
344
|
-
direction: SortDirection
|
|
366
|
+
direction: SortDirection;
|
|
345
367
|
field: string;
|
|
346
368
|
}
|
|
347
369
|
/**
|
|
@@ -376,6 +398,26 @@ declare const buildSeekWhere: (keys: OrderKey[], cursorValues: unknown[]) => Whe
|
|
|
376
398
|
* the page it terminates. Reactive pagination uses this for a page's fixed end
|
|
377
399
|
* cursor; the shared compiler renders it per dialect.
|
|
378
400
|
*/
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* Project `page` rows down to `select` — plus the always-kept system fields and
|
|
404
|
+
* the relation/`_count` keys attached by a `with` load (passed as `withInput`,
|
|
405
|
+
* the same object handed to `findMany`). Returns the page unchanged when
|
|
406
|
+
* `select` is undefined. Pure; callers apply it AFTER relation resolution +
|
|
407
|
+
* cursor encoding so only the returned payload is trimmed (dependency tracking +
|
|
408
|
+
* the cursor still see the full row).
|
|
409
|
+
*/
|
|
410
|
+
declare const applySelect: (page: Record<string, unknown>[], select: ReadonlyArray<string> | undefined, withInput?: Record<string, unknown>) => Record<string, unknown>[];
|
|
411
|
+
/**
|
|
412
|
+
* The read-scope predicate that hides soft-deleted rows — `{ [field]: { isNull:
|
|
413
|
+
* true } }` matching the live rows whose soft-delete column is null/absent — or
|
|
414
|
+
* `undefined` when the table isn't `.softDelete()` or the read opted in via
|
|
415
|
+
* `includeDeleted`. AND-merge it into a list read's `where` (the by-id path
|
|
416
|
+
* never calls this, so `get`/`patch`/`replace`/`restore` still address the row).
|
|
417
|
+
*/
|
|
418
|
+
declare const softDeleteScope: (softDeleteMode: {
|
|
419
|
+
field: string;
|
|
420
|
+
} | undefined, includeDeleted: boolean | undefined) => undefined | WhereInput;
|
|
379
421
|
type RankDirection = "asc" | "desc";
|
|
380
422
|
interface RankSortKeyLike {
|
|
381
423
|
readonly direction: RankDirection;
|
|
@@ -1233,6 +1275,16 @@ interface TableDefinitionLike {
|
|
|
1233
1275
|
field?: string;
|
|
1234
1276
|
kind: "global" | "root" | "shardBy";
|
|
1235
1277
|
};
|
|
1278
|
+
/**
|
|
1279
|
+
* Mirror of `@lunora/server`'s `TableDefinition.softDeleteMode` (set by
|
|
1280
|
+
* `.softDelete()`). When present, `delete()` flips the `field` column to a
|
|
1281
|
+
* timestamp instead of physically removing the row (cascading as a soft
|
|
1282
|
+
* delete), and list reads scope out rows whose `field` is set unless
|
|
1283
|
+
* `includeDeleted` is passed. By-id reads/writes are unaffected.
|
|
1284
|
+
*/
|
|
1285
|
+
readonly softDeleteMode?: {
|
|
1286
|
+
field: string;
|
|
1287
|
+
};
|
|
1236
1288
|
readonly triggerMap?: Record<string, TriggerDefinitionLike>;
|
|
1237
1289
|
}
|
|
1238
1290
|
interface IndexDefinitionLike {
|
|
@@ -1525,7 +1577,16 @@ interface DatabaseWriterLike {
|
|
|
1525
1577
|
* RLS-aware ctx seam from §3.2).
|
|
1526
1578
|
*/
|
|
1527
1579
|
count: (tableName: string, where?: RestrictableQueryOptions | WhereInput) => Promise<number>;
|
|
1528
|
-
|
|
1580
|
+
/**
|
|
1581
|
+
* Delete a row by id. On a `.softDelete()` table this flips the marker column
|
|
1582
|
+
* (cascading as a soft delete) instead of removing the row; pass
|
|
1583
|
+
* `options.hard` to force a physical removal (which cascades as a physical
|
|
1584
|
+
* delete, reaching already-soft-deleted children too). Non-soft tables ignore
|
|
1585
|
+
* `options.hard` — they always delete physically.
|
|
1586
|
+
*/
|
|
1587
|
+
delete: (id: string, expectedTable?: string, options?: {
|
|
1588
|
+
hard?: boolean;
|
|
1589
|
+
}) => Promise<void>;
|
|
1529
1590
|
/**
|
|
1530
1591
|
* Delete many rows by id in one call (a loop over `delete()`). The returned
|
|
1531
1592
|
* `deleted` is the number of ids **requested**, not rows actually removed (an
|
|
@@ -1702,6 +1763,14 @@ interface DatabaseWriterLike {
|
|
|
1702
1763
|
rankPageRows?: (tableName: string, indexName: string, options?: RankPageOptions) => Promise<ShardRankPageResult>;
|
|
1703
1764
|
replace: (id: string, document: Record<string, unknown>, expectedTable?: string) => Promise<void>;
|
|
1704
1765
|
/**
|
|
1766
|
+
* Un-soft-delete a row: clears the `.softDelete()` marker column (a by-id
|
|
1767
|
+
* UPDATE, so it works on a row that list reads currently hide). Throws when
|
|
1768
|
+
* the row's table isn't `.softDelete()`. Optional on the interface — the DO
|
|
1769
|
+
* writer implements it; the `.global()` twin does too, so a restore on a
|
|
1770
|
+
* global table routes through the DO writer's global fallback.
|
|
1771
|
+
*/
|
|
1772
|
+
restore?: (id: string, expectedTable?: string) => Promise<void>;
|
|
1773
|
+
/**
|
|
1705
1774
|
* Best-effort, read-only reader over Lunora's system tables
|
|
1706
1775
|
* (`_scheduled_functions`, `_storage`). Eventually consistent and **not**
|
|
1707
1776
|
* part of the shard's transaction snapshot — see {@link SystemDatabaseReader}.
|
|
@@ -1918,6 +1987,22 @@ declare const readAggregateValue: (op: string, row: {
|
|
|
1918
1987
|
* string.
|
|
1919
1988
|
*/
|
|
1920
1989
|
declare const encodeAggregateKey: (by: ReadonlyArray<string>, source: Record<string, unknown>) => string;
|
|
1990
|
+
/** One recorded admin operation, in monotonic `seq` order. */
|
|
1991
|
+
interface AuditEntry {
|
|
1992
|
+
/** JSON-decoded extra context (the acting user, op-specific counts, …); absent when none was recorded. */
|
|
1993
|
+
detail?: Record<string, unknown>;
|
|
1994
|
+
/** Primary key of the affected row, when the op targets one. */
|
|
1995
|
+
id?: string;
|
|
1996
|
+
/** Short op identifier, e.g. `writeRow` or `runMigration`. */
|
|
1997
|
+
op: string;
|
|
1998
|
+
/** Monotonic per-shard cursor — strictly increasing, never reused. */
|
|
1999
|
+
seq: number;
|
|
2000
|
+
/** Affected table, when the op targets one. */
|
|
2001
|
+
table?: string;
|
|
2002
|
+
/** Wall-clock millis when the op was recorded. */
|
|
2003
|
+
ts: number;
|
|
2004
|
+
}
|
|
2005
|
+
/** Fields accepted when appending one audit entry; `seq` is assigned by the table. */
|
|
1921
2006
|
/** Reserved single-row auth accumulator table. Auto-hidden from the data browser by the `__lunora` prefix. */
|
|
1922
2007
|
declare const AUTH_METRICS_TABLE = "__lunora_auth_metrics";
|
|
1923
2008
|
/** Reserved coarse time-series table: app-wide auth attempt/failure counts bucketed by a fixed window. */
|
|
@@ -2234,30 +2319,6 @@ interface TableInfo {
|
|
|
2234
2319
|
name: string;
|
|
2235
2320
|
rowCount: number;
|
|
2236
2321
|
}
|
|
2237
|
-
/**
|
|
2238
|
-
* One recorded admin operation served by `__lunora_admin__:getAuditLog`, sourced
|
|
2239
|
-
* from the reserved `__lunora_audit__` table (see `audit-log.ts`). Unlike the
|
|
2240
|
-
* in-memory `getMetrics`/`getFunctionStats` counters, the audit log is durable —
|
|
2241
|
-
* it survives hibernation/restart and is bounded only by a retention cap. `seq`
|
|
2242
|
-
* is a monotonic per-shard cursor the studio pages through; `op` is the short
|
|
2243
|
-
* op name (`writeRow`, `runMigration`, `importShard`, `applyCdc`); `table`/`id`
|
|
2244
|
-
* are present when the op targets one; `detail` carries op-specific context
|
|
2245
|
-
* (notably the acting `userId`).
|
|
2246
|
-
*/
|
|
2247
|
-
interface AuditEntry {
|
|
2248
|
-
/** JSON extra context (acting user, op-specific counts, …); absent when none was recorded. */
|
|
2249
|
-
detail?: Record<string, unknown>;
|
|
2250
|
-
/** Primary key of the affected row, when the op targets one. */
|
|
2251
|
-
id?: string;
|
|
2252
|
-
/** Short op identifier, e.g. `writeRow`. */
|
|
2253
|
-
op: string;
|
|
2254
|
-
/** Monotonic per-shard cursor — strictly increasing, never reused. */
|
|
2255
|
-
seq: number;
|
|
2256
|
-
/** Affected table, when the op targets one. */
|
|
2257
|
-
table?: string;
|
|
2258
|
-
/** Epoch-ms the op was recorded. */
|
|
2259
|
-
ts: number;
|
|
2260
|
-
}
|
|
2261
2322
|
/** Payload of a `__lunora_admin__:getAuditLog` call: the recorded entries, newest first. */
|
|
2262
2323
|
interface AuditLogResult {
|
|
2263
2324
|
entries: AuditEntry[];
|
|
@@ -2633,8 +2694,6 @@ interface FilterClause {
|
|
|
2633
2694
|
operator: FilterOperator;
|
|
2634
2695
|
value?: unknown;
|
|
2635
2696
|
}
|
|
2636
|
-
/** Sort direction for an {@link OrderByClause}. */
|
|
2637
|
-
type SortDirection = "asc" | "desc";
|
|
2638
2697
|
/**
|
|
2639
2698
|
* A server-side sort over one displayed column. `column` resolves the same way a
|
|
2640
2699
|
* {@link FilterClause}'s does — a physical/meta column orders by its identifier, a
|
|
@@ -5596,4 +5655,4 @@ interface WhereSqlStrategy {
|
|
|
5596
5655
|
* `undefined` when the input imposes no constraint (empty `where`).
|
|
5597
5656
|
*/
|
|
5598
5657
|
declare const compileWhereSql: (where: WhereInput | undefined, strategy: WhereSqlStrategy) => SQL | undefined;
|
|
5599
|
-
export { ADMIN_FUNCTIONS, ADMIN_FUNCTION_PREFIX, AGGREGATE_SQL_FUNCTION, AUTH_METRICS_BUCKETS_TABLE, AUTH_METRICS_BUCKET_MS, AUTH_METRICS_BUCKET_RETENTION, AUTH_METRICS_TABLE, type AdvisoriesResult, type AdvisoryFinding, type AggregateIndexDefinitionLike, type AggregateOp, type AggregateOptions, type AggregateResult, type AggregateTally, type ApplyOnDeleteOptions, type AuditEntry, type AuditLogResult, type AuthMetrics, type AuthMetricsBucket, type BroadcastDelta, CDC_LOG_TABLE, type CacheEntry, type CapturedMailRow, type CdcChange, type Clock, type ColumnMeta, type ColumnMetaLike, ConflictError, type CountArgs, CountRlsUnsupportedError, type CtxDbOptions, DATA_MIGRATION_STATE_TABLE, DEFAULT_MAX_RELATION_KEYS, type DataMigrationDocument, type DataMigrationLike, type DataMigrationTransform, type DatabaseWriterLike, type DependencyTracker, type DeployInfo, type ExportRow, type ExportShardAdminArgs, type ExportShardArgs, FUNCTION_METRICS_BUCKETS_TABLE, FUNCTION_METRICS_BUCKET_MS, FUNCTION_METRICS_BUCKET_RETENTION, FUNCTION_METRICS_INDEX_TABLE, FUNCTION_METRICS_TABLE, type FacetColumnOptions, type FacetColumnResult, type FacetValue, type FieldOperators, type FunctionCallStat, type FunctionMetricBucket, type FunctionMetricIndexHit, type FunctionStatsResult, type GroupByEntry, type GroupByOptions, type HibernatableWebSocket, type IdGenerator, type ImportError, type ImportShardAdminArgs, type ImportShardArgs, type ImportShardResult, type IndexDefinitionLike, type IndexRangeBuilderLike, LogBuffer, type LogEntry, type LogEventInput, type LogLevel, type LogSink, MAIL_RETENTION, MAIL_TABLE, MAX_SQL_ROWS, MIN_ADMIN_TOKEN_LENGTH, MIN_AUTH_SECRET_LENGTH, type MaskColumnMetadata, type MaskPoliciesResult, type MigrationDirection, type MigrationRunResult, type MigrationStatus, type MigrationStatusRow, type MutationDelta, type NestedWith, NotFoundError, NotUniqueError, type OnDeleteActionLike, type OrderByInput, type OrderKey, type PaginationOptions, type PitrBookmarkResult, type PitrRestoreArgs, type PitrRestoreResult, type PitrStorage, type QueryArgs, type QueryPage, RANK_TIEBREAK, RELATION_FUNCTION_PREFIX, RLS_UNWRAP_SYMBOL, ROOT_DO_SIZE_WARN_BYTES, ROOT_SHARD_NAME, type RankDirection, type RankIndexDefinitionLike, type RankOptions, type RankPage, type RankPageOptions, type RankPageRow, type RankPageRowKey, type RankResult, type RankSortKeyLike, ReactiveCache, type ReactiveCacheOptions, type ReadHook, type ReadTablePageOptions, type RecordAuthEventInput, type RecordFunctionMetricInput, type RecordMailInput, type RelationDefinitionLike, type RenderedSql, type ResolveRelationPredicatesOptions, type ResolveWithOptions, type RestrictableQueryOptions, type RlsPoliciesResult, type RlsPolicyMetadata, RlsRequiredError, type RlsRoleMetadata, type RpcRequest, type RunDataMigrationOptions, type RunShardApplyCdcArgs, type RunShardApplyCdcResult, type RunShardBulkDeleteArgs, type RunShardBulkDeleteResult, type RunShardExportArgs, type RunShardImportArgs, type RunShardMigrationArgs, type RunShardRankBeforeArgs, type RunShardRankPageArgs, type RunShardWriteArgs, type RunShardWriteResult, type RunTriggersOptions, SCAN_DEP, SESSION_DO_TTL_DEFAULT, SHARD_REGISTRY_DO_NAME, type ScheduledFunctionDoc, type SchedulerLike, type SchemaLike, type SearchFilterBuilderLike, type SecurityAuditResult, type SecurityFinding, type SecurityFindingKind, type SecurityFindingLevel, type SelectMatchingIdsOptions, type ServerDefaultContextLike, SessionDO, type SessionRecord, type SettingEntry, type SettingKind, type SettingsResult, ShardDO, type ShardDOOptions, type ShardDOState, type ShardRankPageResult, ShardRegistryDO, type SocketAttachment, type SortDirection
|
|
5658
|
+
export { ADMIN_FUNCTIONS, ADMIN_FUNCTION_PREFIX, AGGREGATE_SQL_FUNCTION, AUTH_METRICS_BUCKETS_TABLE, AUTH_METRICS_BUCKET_MS, AUTH_METRICS_BUCKET_RETENTION, AUTH_METRICS_TABLE, type AdvisoriesResult, type AdvisoryFinding, type AggregateIndexDefinitionLike, type AggregateOp, type AggregateOptions, type AggregateResult, type AggregateTally, type ApplyOnDeleteOptions, type AuditEntry, type AuditLogResult, type AuthMetrics, type AuthMetricsBucket, type BroadcastDelta, CDC_LOG_TABLE, type CacheEntry, type CapturedMailRow, type CdcChange, type Clock, type ColumnMeta, type ColumnMetaLike, ConflictError, type CountArgs, CountRlsUnsupportedError, type CtxDbOptions, DATA_MIGRATION_STATE_TABLE, DEFAULT_MAX_RELATION_KEYS, type DataMigrationDocument, type DataMigrationLike, type DataMigrationTransform, type DatabaseWriterLike, type DependencyTracker, type DeployInfo, type ExportRow, type ExportShardAdminArgs, type ExportShardArgs, FUNCTION_METRICS_BUCKETS_TABLE, FUNCTION_METRICS_BUCKET_MS, FUNCTION_METRICS_BUCKET_RETENTION, FUNCTION_METRICS_INDEX_TABLE, FUNCTION_METRICS_TABLE, type FacetColumnOptions, type FacetColumnResult, type FacetValue, type FieldOperators, type FunctionCallStat, type FunctionMetricBucket, type FunctionMetricIndexHit, type FunctionStatsResult, type GroupByEntry, type GroupByOptions, type HibernatableWebSocket, type IdGenerator, type ImportError, type ImportShardAdminArgs, type ImportShardArgs, type ImportShardResult, type IndexDefinitionLike, type IndexRangeBuilderLike, LogBuffer, type LogEntry, type LogEventInput, type LogLevel, type LogSink, MAIL_RETENTION, MAIL_TABLE, MAX_SQL_ROWS, MIN_ADMIN_TOKEN_LENGTH, MIN_AUTH_SECRET_LENGTH, type MaskColumnMetadata, type MaskPoliciesResult, type MigrationDirection, type MigrationRunResult, type MigrationStatus, type MigrationStatusRow, type MutationDelta, type NestedWith, NotFoundError, NotUniqueError, type OnDeleteActionLike, type OrderByInput, type OrderKey, type PaginationOptions, type PitrBookmarkResult, type PitrRestoreArgs, type PitrRestoreResult, type PitrStorage, type QueryArgs, type QueryPage, RANK_TIEBREAK, RELATION_FUNCTION_PREFIX, RLS_UNWRAP_SYMBOL, ROOT_DO_SIZE_WARN_BYTES, ROOT_SHARD_NAME, type RankDirection, type RankIndexDefinitionLike, type RankOptions, type RankPage, type RankPageOptions, type RankPageRow, type RankPageRowKey, type RankResult, type RankSortKeyLike, ReactiveCache, type ReactiveCacheOptions, type ReadHook, type ReadTablePageOptions, type RecordAuthEventInput, type RecordFunctionMetricInput, type RecordMailInput, type RelationDefinitionLike, type RenderedSql, type ResolveRelationPredicatesOptions, type ResolveWithOptions, type RestrictableQueryOptions, type RlsPoliciesResult, type RlsPolicyMetadata, RlsRequiredError, type RlsRoleMetadata, type RpcRequest, type RunDataMigrationOptions, type RunShardApplyCdcArgs, type RunShardApplyCdcResult, type RunShardBulkDeleteArgs, type RunShardBulkDeleteResult, type RunShardExportArgs, type RunShardImportArgs, type RunShardMigrationArgs, type RunShardRankBeforeArgs, type RunShardRankPageArgs, type RunShardWriteArgs, type RunShardWriteResult, type RunTriggersOptions, SCAN_DEP, SESSION_DO_TTL_DEFAULT, SHARD_REGISTRY_DO_NAME, type ScheduledFunctionDoc, type SchedulerLike, type SchemaLike, type SearchFilterBuilderLike, type SecurityAuditResult, type SecurityFinding, type SecurityFindingKind, type SecurityFindingLevel, type SelectMatchingIdsOptions, type ServerDefaultContextLike, SessionDO, type SessionRecord, type SettingEntry, type SettingKind, type SettingsResult, ShardDO, type ShardDOOptions, type ShardDOState, type ShardRankPageResult, ShardRegistryDO, type SocketAttachment, type SortDirection, type SqlConsoleResult, type SqlCursor, type SqlEngine, type SqlExec, type StorageRuleMetadata, type StorageRulesResult, type StudioFeaturesResult, type SubscriptionEnvelope, type SubscriptionOutcome, type SubscriptionQuery, type SystemDatabaseReader, type SystemDoc, type SystemQuery, type SystemReaderOptions, type SystemReaderSchedulerLike, type SystemReaderStorageLike, type SystemTableName, type TableColumnsResult, type TableDefinitionLike, type TableIndexInfo, type TableIndexesResult, type TableInfo, type TablePage, type TableReaderLike, type TablesColumnsResult, type TransactionSqlLike, type TriggerContextLike, type TriggerDefinitionLike, type TriggerEventLike, type TriggerOpLike, type TriggerTimingLike, type ValidatorLike, type WhereInput, type WhereSqlStrategy, type WithInput, type WorkflowMetadata, type WorkflowsResult, type WriteEvent, type WriteHook, aggregateSqlFunction, aggregateTableName, applyCdcChanges, applyOnDelete, applySelect, armRestore, assertFlatPredicate, assertReadonly, assertValidClientId, backfillAggregateIndexes, backfillRankIndexes, buildFtsMatch, buildSecurityAudit, buildSeekWhere, clearCapturedMail, coerceAggregateNumber, compileWhereSql, containsRelationPredicate, createDependencyTracker, createShardCtxDb, createSystemReader, decodeCursor, depKey, encodeAggregateKey, encodeCursor, encodePartitionKey, ensureAuthMetricsTables, ensureFunctionMetricsTables, ensureMailTable, exportShardRows, exportShardTable, facetColumn, foldAggregateTally, ftsTableName, guardWriter, hasTrigger, importShardRows, isRelationPredicate, listTables, matchesRankStaticWhere, matchesStaticWhere, mergeWhere, normalizeCountArgument, normalizeIdStructurally, normalizeOrderKeys, parseExportShardArgs, parseImportShardArgs, planAggregateLookup, rankTableName, reactiveCacheKey, readAggregateValue, readAuthMetrics, readBookmark, readCapturedMail, readCdcChanges, readFunctionMetricBuckets, readFunctionMetricIndexHits, readFunctionMetrics, readFunctionMetricsTotals, readMigrationStatus, readTablePage, recordAuthEvent, recordCapturedMail, recordFunctionMetric, renderSql, resolveRankPartition, resolveRelationPredicates, resolveWith, runDataMigration, runReadonlySql, runRowValidators, runShardMigrations, runTriggers, scoreDocument, selectExportTables, selectIndexForAggregate, selectIndexForCount, selectIndexForGroupBy, selectMatchingIds, serveRelationFanout, softDeleteScope, sortColumnName, stableStringify, stringifySearchText, subscriptionListDeltas, throwingScheduler, tokenizeSearch, trimCdcChanges, validateImportRow };
|
package/dist/index.mjs
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
export { exportShardRows, exportShardTable, importShardRows, parseExportShardArgs, parseImportShardArgs, selectExportTables, validateImportRow } from './packem_shared/exportShardRows-DZEhUeyI.mjs';
|
|
2
|
-
export { AGGREGATE_SQL_FUNCTION, aggregateSqlFunction, matchesStaticWhere, normalizeCountArgument, throwingScheduler } from './packem_shared/
|
|
2
|
+
export { AGGREGATE_SQL_FUNCTION, aggregateSqlFunction, matchesStaticWhere, normalizeCountArgument, throwingScheduler } from './packem_shared/AGGREGATE_SQL_FUNCTION-CFk6adSu.mjs';
|
|
3
3
|
export { aggregateTableName, coerceAggregateNumber, encodeAggregateKey, foldAggregateTally, readAggregateValue } from './packem_shared/aggregateTableName-CxNqY1Sl.mjs';
|
|
4
4
|
export { CountRlsUnsupportedError, mergeWhere, planAggregateLookup, selectIndexForAggregate, selectIndexForCount, selectIndexForGroupBy } from './packem_shared/CountRlsUnsupportedError-28ZvvwKS.mjs';
|
|
5
|
-
export { AUTH_METRICS_BUCKETS_TABLE, AUTH_METRICS_BUCKET_MS, AUTH_METRICS_BUCKET_RETENTION, AUTH_METRICS_TABLE, ensureAuthMetricsTables, readAuthMetrics, recordAuthEvent } from './packem_shared/
|
|
6
|
-
export { NotUniqueError, assertValidClientId, createShardCtxDb, normalizeIdStructurally } from './packem_shared/
|
|
5
|
+
export { AUTH_METRICS_BUCKETS_TABLE, AUTH_METRICS_BUCKET_MS, AUTH_METRICS_BUCKET_RETENTION, AUTH_METRICS_TABLE, ensureAuthMetricsTables, readAuthMetrics, recordAuthEvent } from './packem_shared/AUTH_METRICS_BUCKETS_TABLE-CiHHYeJi.mjs';
|
|
6
|
+
export { NotUniqueError, assertValidClientId, createShardCtxDb, normalizeIdStructurally } from './packem_shared/NotUniqueError-h_thNFSZ.mjs';
|
|
7
7
|
export { DATA_MIGRATION_STATE_TABLE, readMigrationStatus, runDataMigration } from './packem_shared/DATA_MIGRATION_STATE_TABLE-PTtTiQ7U.mjs';
|
|
8
8
|
export { SCAN_DEP, createDependencyTracker, depKey } from './packem_shared/SCAN_DEP-DLJF8dsj.mjs';
|
|
9
9
|
export { renderSql } from './packem_shared/renderSql-D6eUcn2N.mjs';
|
|
10
|
-
export { FUNCTION_METRICS_BUCKETS_TABLE, FUNCTION_METRICS_BUCKET_MS, FUNCTION_METRICS_BUCKET_RETENTION, FUNCTION_METRICS_INDEX_TABLE, FUNCTION_METRICS_TABLE, ensureFunctionMetricsTables, readFunctionMetricBuckets, readFunctionMetricIndexHits, readFunctionMetrics, readFunctionMetricsTotals, recordFunctionMetric } from './packem_shared/
|
|
11
|
-
export { ADMIN_FUNCTIONS, ADMIN_FUNCTION_PREFIX, RELATION_FUNCTION_PREFIX, facetColumn, listTables, readTablePage, selectMatchingIds } from './packem_shared/
|
|
10
|
+
export { FUNCTION_METRICS_BUCKETS_TABLE, FUNCTION_METRICS_BUCKET_MS, FUNCTION_METRICS_BUCKET_RETENTION, FUNCTION_METRICS_INDEX_TABLE, FUNCTION_METRICS_TABLE, ensureFunctionMetricsTables, readFunctionMetricBuckets, readFunctionMetricIndexHits, readFunctionMetrics, readFunctionMetricsTotals, recordFunctionMetric } from './packem_shared/FUNCTION_METRICS_BUCKETS_TABLE-UDNVD7FS.mjs';
|
|
11
|
+
export { ADMIN_FUNCTIONS, ADMIN_FUNCTION_PREFIX, RELATION_FUNCTION_PREFIX, facetColumn, listTables, readTablePage, selectMatchingIds } from './packem_shared/ADMIN_FUNCTIONS-Dzdqq5J2.mjs';
|
|
12
12
|
export { LogBuffer } from './packem_shared/LogBuffer-B_Ezju_N.mjs';
|
|
13
|
-
export { MAIL_RETENTION, MAIL_TABLE, clearCapturedMail, ensureMailTable, readCapturedMail, recordCapturedMail } from './packem_shared/
|
|
13
|
+
export { MAIL_RETENTION, MAIL_TABLE, clearCapturedMail, ensureMailTable, readCapturedMail, recordCapturedMail } from './packem_shared/MAIL_RETENTION-CPpgl-dX.mjs';
|
|
14
14
|
export { default as NotFoundError } from './packem_shared/NotFoundError-CMuMZt81.mjs';
|
|
15
15
|
export { armRestore, readBookmark } from './packem_shared/armRestore-BJk53Ro8.mjs';
|
|
16
|
-
export { buildSeekWhere, decodeCursor, encodeCursor, normalizeOrderKeys } from './packem_shared/
|
|
16
|
+
export { applySelect, buildSeekWhere, decodeCursor, encodeCursor, normalizeOrderKeys, softDeleteScope } from './packem_shared/applySelect-BvZdFUBT.mjs';
|
|
17
17
|
export { R as RANK_TIEBREAK, e as encodePartitionKey, m as matchesRankStaticWhere, r as rankTableName, a as resolveRankPartition, s as sortColumnName } from './packem_shared/rank-CrkEIpF4.mjs';
|
|
18
18
|
export { ReactiveCache, reactiveCacheKey, stableStringify } from './packem_shared/ReactiveCache-ByVzgH3d.mjs';
|
|
19
|
-
export { serveRelationFanout } from './packem_shared/serveRelationFanout-
|
|
20
|
-
export { DEFAULT_MAX_RELATION_KEYS, assertFlatPredicate, containsRelationPredicate, isRelationPredicate, resolveRelationPredicates } from './packem_shared/
|
|
21
|
-
export { applyOnDelete, resolveWith, runRowValidators } from './packem_shared/applyOnDelete-
|
|
22
|
-
export { RLS_UNWRAP_SYMBOL, RlsRequiredError, guardWriter } from './packem_shared/
|
|
23
|
-
export { buildFtsMatch, ftsTableName, scoreDocument, stringifySearchText, tokenizeSearch } from './packem_shared/
|
|
19
|
+
export { serveRelationFanout } from './packem_shared/serveRelationFanout-CFBKWJ8Q.mjs';
|
|
20
|
+
export { DEFAULT_MAX_RELATION_KEYS, assertFlatPredicate, containsRelationPredicate, isRelationPredicate, resolveRelationPredicates } from './packem_shared/DEFAULT_MAX_RELATION_KEYS-Dou2PWdO.mjs';
|
|
21
|
+
export { applyOnDelete, resolveWith, runRowValidators } from './packem_shared/applyOnDelete-sA7o1CqD.mjs';
|
|
22
|
+
export { RLS_UNWRAP_SYMBOL, RlsRequiredError, guardWriter } from './packem_shared/RLS_UNWRAP_SYMBOL-EtGQdC9d.mjs';
|
|
23
|
+
export { buildFtsMatch, ftsTableName, scoreDocument, stringifySearchText, tokenizeSearch } from './packem_shared/buildFtsMatch-BLEMawrp.mjs';
|
|
24
24
|
export { M as MIN_ADMIN_TOKEN_LENGTH, a as MIN_AUTH_SECRET_LENGTH, b as buildSecurityAudit } from './packem_shared/security-audit-CucgBice.mjs';
|
|
25
25
|
export { SESSION_DO_TTL_DEFAULT, SessionDO } from './packem_shared/SESSION_DO_TTL_DEFAULT-ilPZsVwu.mjs';
|
|
26
|
-
export { ROOT_DO_SIZE_WARN_BYTES, ROOT_SHARD_NAME, ShardDO, subscriptionListDeltas } from './packem_shared/ROOT_DO_SIZE_WARN_BYTES-
|
|
26
|
+
export { ROOT_DO_SIZE_WARN_BYTES, ROOT_SHARD_NAME, ShardDO, subscriptionListDeltas } from './packem_shared/ROOT_DO_SIZE_WARN_BYTES-3lZ2yigq.mjs';
|
|
27
27
|
export { SHARD_REGISTRY_DO_NAME, ShardRegistryDO } from './packem_shared/SHARD_REGISTRY_DO_NAME-BsAbi5Mn.mjs';
|
|
28
|
-
export { MAX_SQL_ROWS, assertReadonly, runReadonlySql } from './packem_shared/
|
|
28
|
+
export { MAX_SQL_ROWS, assertReadonly, runReadonlySql } from './packem_shared/MAX_SQL_ROWS-dDcFE1YZ.mjs';
|
|
29
29
|
export { createSystemReader } from './packem_shared/createSystemReader-8CzSZP9V.mjs';
|
|
30
30
|
export { ConflictError } from './packem_shared/ConflictError-C0STs6bU.mjs';
|
|
31
|
-
export { hasTrigger, runTriggers } from './packem_shared/
|
|
31
|
+
export { hasTrigger, runTriggers } from './packem_shared/hasTrigger-5N6_Fx0A.mjs';
|
|
32
32
|
export { compileWhereSql } from './packem_shared/compileWhereSql-CXrhFA3G.mjs';
|
|
33
|
-
export { CDC_LOG_TABLE, applyCdcChanges, readCdcChanges, trimCdcChanges } from './packem_shared/
|
|
34
|
-
export { backfillAggregateIndexes, backfillRankIndexes } from './packem_shared/backfillAggregateIndexes-
|
|
35
|
-
export { runShardMigrations } from './packem_shared/runShardMigrations-
|
|
33
|
+
export { CDC_LOG_TABLE, applyCdcChanges, readCdcChanges, trimCdcChanges } from './packem_shared/CDC_LOG_TABLE-Ctdmxmrv.mjs';
|
|
34
|
+
export { backfillAggregateIndexes, backfillRankIndexes } from './packem_shared/backfillAggregateIndexes-BbVPvciS.mjs';
|
|
35
|
+
export { runShardMigrations } from './packem_shared/runShardMigrations-PabobOjF.mjs';
|