@lunora/do 1.0.0-alpha.4 → 1.0.0-alpha.6

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/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
  }
@@ -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
  }
@@ -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
- delete: (id: string, expectedTable?: string) => Promise<void>;
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}.
@@ -2223,6 +2292,7 @@ declare const ADMIN_FUNCTIONS: {
2223
2292
  readonly getSettings: "__lunora_admin__:getSettings";
2224
2293
  readonly getWorkflowInstanceStatus: "__lunora_admin__:getWorkflowInstanceStatus";
2225
2294
  readonly importShard: "__lunora_admin__:importShard";
2295
+ readonly listQueues: "__lunora_admin__:listQueues";
2226
2296
  readonly listTables: "__lunora_admin__:listTables";
2227
2297
  readonly listWorkflows: "__lunora_admin__:listWorkflows";
2228
2298
  readonly maskPolicies: "__lunora_admin__:maskPolicies";
@@ -2506,11 +2576,13 @@ interface StudioFeaturesResult {
2506
2576
  mail: boolean;
2507
2577
  /** `@lunora/payment` is used (import or `ctx.payments`) or a declared dependency. */
2508
2578
  payments: boolean;
2579
+ /** `@lunora/queue` / `ctx.queues` is used, the app declares queues, or it is a declared dependency. */
2580
+ queues: boolean;
2509
2581
  /** `@lunora/scheduler` / `ctx.scheduler` is used, the app declares crons, or it is a declared dependency. */
2510
2582
  scheduler: boolean;
2511
2583
  /** `@lunora/storage` / `ctx.storage` is used, the schema declares storage columns/rules, or it is a declared dependency. */
2512
2584
  storage: boolean;
2513
- /** The schema declares vector indexes, `@lunora/vectors` / `ctx.vectors` is used, or it is a declared dependency. */
2585
+ /** The schema declares vector indexes, `@lunora/bindings/vectors` / `ctx.vectors` is used, or it is a declared dependency. */
2514
2586
  vectors: boolean;
2515
2587
  /** `@lunora/workflow` / `ctx.workflows` is used, the app declares workflows, or it is a declared dependency. */
2516
2588
  workflows: boolean;
@@ -2536,6 +2608,28 @@ interface WorkflowsResult {
2536
2608
  workflows: WorkflowMetadata[];
2537
2609
  }
2538
2610
  /**
2611
+ * One declared Cloudflare Queue, surfaced by `__lunora_admin__:listQueues` for
2612
+ * the studio's Queues page. Statically discovered by `@lunora/codegen` from
2613
+ * `lunora/queues.ts` (the codegen subclass overrides the base hook); queues are
2614
+ * not Durable Objects and carry no runtime state in the shard, so this is pure
2615
+ * declaration metadata. `binding` is the generated `QUEUE_*` producer binding,
2616
+ * `name` the deployed `queues.producers[].queue`, `exportName` the
2617
+ * `lunora/queues.ts` export (`ctx.queues.&lt;exportName>`), `mode` whether the
2618
+ * queue is consumed by a worker (`push`) or polled externally (`pull`), and
2619
+ * `deadLetterQueue` the optional DLQ a push consumer dead-letters to.
2620
+ */
2621
+ interface QueueMetadata {
2622
+ binding: string;
2623
+ deadLetterQueue?: string;
2624
+ exportName: string;
2625
+ mode: "pull" | "push";
2626
+ name: string;
2627
+ }
2628
+ /** Payload of a `__lunora_admin__:listQueues` call: every declared queue, sorted by export name. */
2629
+ interface QueuesResult {
2630
+ queues: QueueMetadata[];
2631
+ }
2632
+ /**
2539
2633
  * Lifecycle state of a workflow instance, mirrored from `@lunora/workflow`'s
2540
2634
  * `WorkflowInstanceStatus` so `@lunora/do` carries no dependency on the workflow
2541
2635
  * package. Returned by `getWorkflowInstanceStatus` and `createWorkflowInstance`.
@@ -4408,6 +4502,15 @@ declare abstract class ShardDO {
4408
4502
  */
4409
4503
  protected studioFeatures(): StudioFeaturesResult;
4410
4504
  /**
4505
+ * The Cloudflare Queues declared by this app, surfaced via
4506
+ * `__lunora_admin__:listQueues` for the studio's Queues page. Queues are NOT
4507
+ * Durable Objects and hold no shard state, so this is pure declaration
4508
+ * metadata statically discovered by `@lunora/codegen` from `lunora/queues.ts`
4509
+ * and emitted into the generated subclass, which overrides this. The base
4510
+ * class can't see the user's project, so it reports none.
4511
+ */
4512
+ protected queuesMetadata(): QueuesResult;
4513
+ /**
4411
4514
  * The Cloudflare Workflows declared by this app, surfaced via
4412
4515
  * `__lunora_admin__:listWorkflows` for the studio's Workflows page. Workflows
4413
4516
  * are NOT Durable Objects and hold no shard state, so this is pure
@@ -5586,4 +5689,4 @@ interface WhereSqlStrategy {
5586
5689
  * `undefined` when the input imposes no constraint (empty `where`).
5587
5690
  */
5588
5691
  declare const compileWhereSql: (where: WhereInput | undefined, strategy: WhereSqlStrategy) => SQL | undefined;
5589
- 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, 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, sortColumnName, stableStringify, stringifySearchText, subscriptionListDeltas, throwingScheduler, tokenizeSearch, trimCdcChanges, validateImportRow };
5692
+ 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, type QueueMetadata, type QueuesResult, 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
  }
@@ -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
  }
@@ -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
- delete: (id: string, expectedTable?: string) => Promise<void>;
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}.
@@ -2223,6 +2292,7 @@ declare const ADMIN_FUNCTIONS: {
2223
2292
  readonly getSettings: "__lunora_admin__:getSettings";
2224
2293
  readonly getWorkflowInstanceStatus: "__lunora_admin__:getWorkflowInstanceStatus";
2225
2294
  readonly importShard: "__lunora_admin__:importShard";
2295
+ readonly listQueues: "__lunora_admin__:listQueues";
2226
2296
  readonly listTables: "__lunora_admin__:listTables";
2227
2297
  readonly listWorkflows: "__lunora_admin__:listWorkflows";
2228
2298
  readonly maskPolicies: "__lunora_admin__:maskPolicies";
@@ -2506,11 +2576,13 @@ interface StudioFeaturesResult {
2506
2576
  mail: boolean;
2507
2577
  /** `@lunora/payment` is used (import or `ctx.payments`) or a declared dependency. */
2508
2578
  payments: boolean;
2579
+ /** `@lunora/queue` / `ctx.queues` is used, the app declares queues, or it is a declared dependency. */
2580
+ queues: boolean;
2509
2581
  /** `@lunora/scheduler` / `ctx.scheduler` is used, the app declares crons, or it is a declared dependency. */
2510
2582
  scheduler: boolean;
2511
2583
  /** `@lunora/storage` / `ctx.storage` is used, the schema declares storage columns/rules, or it is a declared dependency. */
2512
2584
  storage: boolean;
2513
- /** The schema declares vector indexes, `@lunora/vectors` / `ctx.vectors` is used, or it is a declared dependency. */
2585
+ /** The schema declares vector indexes, `@lunora/bindings/vectors` / `ctx.vectors` is used, or it is a declared dependency. */
2514
2586
  vectors: boolean;
2515
2587
  /** `@lunora/workflow` / `ctx.workflows` is used, the app declares workflows, or it is a declared dependency. */
2516
2588
  workflows: boolean;
@@ -2536,6 +2608,28 @@ interface WorkflowsResult {
2536
2608
  workflows: WorkflowMetadata[];
2537
2609
  }
2538
2610
  /**
2611
+ * One declared Cloudflare Queue, surfaced by `__lunora_admin__:listQueues` for
2612
+ * the studio's Queues page. Statically discovered by `@lunora/codegen` from
2613
+ * `lunora/queues.ts` (the codegen subclass overrides the base hook); queues are
2614
+ * not Durable Objects and carry no runtime state in the shard, so this is pure
2615
+ * declaration metadata. `binding` is the generated `QUEUE_*` producer binding,
2616
+ * `name` the deployed `queues.producers[].queue`, `exportName` the
2617
+ * `lunora/queues.ts` export (`ctx.queues.&lt;exportName>`), `mode` whether the
2618
+ * queue is consumed by a worker (`push`) or polled externally (`pull`), and
2619
+ * `deadLetterQueue` the optional DLQ a push consumer dead-letters to.
2620
+ */
2621
+ interface QueueMetadata {
2622
+ binding: string;
2623
+ deadLetterQueue?: string;
2624
+ exportName: string;
2625
+ mode: "pull" | "push";
2626
+ name: string;
2627
+ }
2628
+ /** Payload of a `__lunora_admin__:listQueues` call: every declared queue, sorted by export name. */
2629
+ interface QueuesResult {
2630
+ queues: QueueMetadata[];
2631
+ }
2632
+ /**
2539
2633
  * Lifecycle state of a workflow instance, mirrored from `@lunora/workflow`'s
2540
2634
  * `WorkflowInstanceStatus` so `@lunora/do` carries no dependency on the workflow
2541
2635
  * package. Returned by `getWorkflowInstanceStatus` and `createWorkflowInstance`.
@@ -4408,6 +4502,15 @@ declare abstract class ShardDO {
4408
4502
  */
4409
4503
  protected studioFeatures(): StudioFeaturesResult;
4410
4504
  /**
4505
+ * The Cloudflare Queues declared by this app, surfaced via
4506
+ * `__lunora_admin__:listQueues` for the studio's Queues page. Queues are NOT
4507
+ * Durable Objects and hold no shard state, so this is pure declaration
4508
+ * metadata statically discovered by `@lunora/codegen` from `lunora/queues.ts`
4509
+ * and emitted into the generated subclass, which overrides this. The base
4510
+ * class can't see the user's project, so it reports none.
4511
+ */
4512
+ protected queuesMetadata(): QueuesResult;
4513
+ /**
4411
4514
  * The Cloudflare Workflows declared by this app, surfaced via
4412
4515
  * `__lunora_admin__:listWorkflows` for the studio's Workflows page. Workflows
4413
4516
  * are NOT Durable Objects and hold no shard state, so this is pure
@@ -5586,4 +5689,4 @@ interface WhereSqlStrategy {
5586
5689
  * `undefined` when the input imposes no constraint (empty `where`).
5587
5690
  */
5588
5691
  declare const compileWhereSql: (where: WhereInput | undefined, strategy: WhereSqlStrategy) => SQL | undefined;
5589
- 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, 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, sortColumnName, stableStringify, stringifySearchText, subscriptionListDeltas, throwingScheduler, tokenizeSearch, trimCdcChanges, validateImportRow };
5692
+ 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, type QueueMetadata, type QueuesResult, 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
@@ -3,27 +3,27 @@ export { AGGREGATE_SQL_FUNCTION, aggregateSqlFunction, matchesStaticWhere, norma
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
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-B6tzuDmM.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
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';
11
+ export { ADMIN_FUNCTIONS, ADMIN_FUNCTION_PREFIX, RELATION_FUNCTION_PREFIX, facetColumn, listTables, readTablePage, selectMatchingIds } from './packem_shared/ADMIN_FUNCTIONS-CHcC8fKV.mjs';
12
12
  export { LogBuffer } from './packem_shared/LogBuffer-B_Ezju_N.mjs';
13
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/buildSeekWhere-lVsNXSLy.mjs';
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-CFBKWJ8Q.mjs';
20
- export { DEFAULT_MAX_RELATION_KEYS, assertFlatPredicate, containsRelationPredicate, isRelationPredicate, resolveRelationPredicates } from './packem_shared/DEFAULT_MAX_RELATION_KEYS-DyVYReuT.mjs';
21
- export { applyOnDelete, resolveWith, runRowValidators } from './packem_shared/applyOnDelete-CMif2RKw.mjs';
22
- export { RLS_UNWRAP_SYMBOL, RlsRequiredError, guardWriter } from './packem_shared/RLS_UNWRAP_SYMBOL-u3UlnCH5.mjs';
19
+ export { serveRelationFanout } from './packem_shared/serveRelationFanout-oxaM6_WL.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
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-3lZ2yigq.mjs';
26
+ export { ROOT_DO_SIZE_WARN_BYTES, ROOT_SHARD_NAME, ShardDO, subscriptionListDeltas } from './packem_shared/ROOT_DO_SIZE_WARN_BYTES-DfwcxW8F.mjs';
27
27
  export { SHARD_REGISTRY_DO_NAME, ShardRegistryDO } from './packem_shared/SHARD_REGISTRY_DO_NAME-BsAbi5Mn.mjs';
28
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';
@@ -27,6 +27,7 @@ const ADMIN_FUNCTIONS = {
27
27
  // eslint-disable-next-line no-secrets/no-secrets -- reserved admin RPC path constant, not a credential
28
28
  getWorkflowInstanceStatus: "__lunora_admin__:getWorkflowInstanceStatus",
29
29
  importShard: "__lunora_admin__:importShard",
30
+ listQueues: "__lunora_admin__:listQueues",
30
31
  listTables: "__lunora_admin__:listTables",
31
32
  listWorkflows: "__lunora_admin__:listWorkflows",
32
33
  maskPolicies: "__lunora_admin__:maskPolicies",
@@ -1,4 +1,4 @@
1
- import { distinctValues } from './applyOnDelete-CMif2RKw.mjs';
1
+ import { distinctValues } from './applyOnDelete-sA7o1CqD.mjs';
2
2
 
3
3
  const RELATION_EXISTS_KEY = "__relationExists";
4
4