@lunora/do 1.0.0-alpha.271 → 1.0.0-alpha.273
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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SubscriptionIdentity, SchemaLike, DatabaseWriterLike, CrossShardReadArgs, CdcChange, FilterClause, ImportConflictMode,
|
|
1
|
+
import { SubscriptionIdentity, SchemaLike, DatabaseWriterLike, CrossShardReadArgs, CdcChange, FilterClause, ImportConflictMode, ImportRow, MigrationDirection, ReadFootprint, DependencyTracker, ReactiveCache, ShapeProbeCounters, GlobalPollCounters, ReactiveCacheOptions, TransactionHeadroomTracker, ShardSocketLike, LifecycleDispatchInfo, MigrationRunResult, SearchBackfillProgress, VectorBackfillProgress, TableIndexInfo, ColumnMeta, AdvisoryFinding, AdvisorProcedure, RlsPoliciesResult, MaskPoliciesResult, StorageRulesResult, StudioFeaturesResult, FlagsResult, QueuesResult, WorkflowsResult, ExportRow, ImportShardResult, RelatedPage, ShardRankPageResult, SubscriptionQuery, ShapeSubscriptionQuery, MutationDelta, KeyRange, ResolvedShape, ShapeRow, TtlSweepSpec, ScheduleOutbox, SchedulerLike, CompanionMemo, TransactionLimits, IndexKeyEntry, SqlExec, CdcChangeKey } from '@lunora/shard-engine';
|
|
2
2
|
export { type AdvisorProcedure, type AdvisoryFinding, type AggregateIndexDefinitionLike, type DataMigrationLike, type DatabaseWriterLike, type ExportRow, type ExternalSourceLike, type FlagsResult, type ImportShardResult, type KeyRange, type MaskPoliciesResult, type MigrationRunResult, type MutationDelta, type QueuesResult, REPROJECTION_MIGRATION_PREFIX, type RankIndexDefinitionLike, type RelatedPage, type RlsPoliciesResult, type SchedulerLike, type SchemaLike, type SearchBackfillProgress, type ShardRankPageResult, type SourceClientLike, type SqlExec, type StorageRulesResult, type StudioFeaturesResult, type SubscriptionIdentity, type SystemReaderStorageLike, type TransactionHeadroomTracker, UNVOUCHABLE_DEP, type ValidatorLike, type VectorBackfillProgress, type WhereInput, type WorkflowsResult, type WriteHook, applyCdcChanges, assertShapeShardable, backfillSearchIndexes, backfillVectorIndexes, buildReprojectionMigration, clearMemoryTables, countLegacyRows, createReadFootprint, createShardCtxDb, exportShardRows, importShardRows, isSourceDue, markUnvouchableReads, pullExternalSourceIncrementalTick, pullExternalSourceTick, reprojectionMigrationId, reprojectionTables, runDataMigration, runShardMigrations, subscriptionListDeltas } from '@lunora/shard-engine';
|
|
3
3
|
import { DatabaseInstrumentation, MetricHistoryOptions, LogEventInput, TraceAnchor, ContextLogLevel, ContextTracer, SqlClientLike, ContextFetch, ContextMetrics } from '@lunora/observability';
|
|
4
4
|
import { SecretValueHost } from '@lunora/platform';
|
|
@@ -546,11 +546,13 @@ interface RunShardExportArgs {
|
|
|
546
546
|
}
|
|
547
547
|
/** Arguments accepted by the `__lunora_admin__:importShard` admin RPC. */
|
|
548
548
|
interface RunShardImportArgs {
|
|
549
|
+
/** Honour rows tagged `op: "delete"`. See `ImportShardArgs.deletes` in `@lunora/shard-engine`. */
|
|
550
|
+
deletes?: boolean;
|
|
549
551
|
/** Check the rows and report their shape errors, writing nothing. See `ImportShardArgs.dryRun` in `@lunora/shard-engine`. */
|
|
550
552
|
dryRun?: boolean;
|
|
551
553
|
/** What a row whose `_id` already exists does. See `ImportConflictMode` in `@lunora/shard-engine`. */
|
|
552
554
|
onConflict?: ImportConflictMode;
|
|
553
|
-
rows: ReadonlyArray<
|
|
555
|
+
rows: ReadonlyArray<ImportRow>;
|
|
554
556
|
startLine?: number;
|
|
555
557
|
}
|
|
556
558
|
/**
|
|
@@ -6538,11 +6540,22 @@ declare abstract class ShardDO {
|
|
|
6538
6540
|
*/
|
|
6539
6541
|
private handleSocketReauth;
|
|
6540
6542
|
/**
|
|
6541
|
-
*
|
|
6542
|
-
*
|
|
6543
|
-
*
|
|
6544
|
-
*
|
|
6545
|
-
*
|
|
6543
|
+
* Re-authenticate a socket that was admitted as admin. The admin credential it was admitted with must still hold
|
|
6544
|
+
* (the shard's own binding check, as on every admin read, so a rotated token fails here) and the worker must have
|
|
6545
|
+
* verified an admin credential on this very request. Failing either closes the socket: a user identity riding
|
|
6546
|
+
* beside it is not enough to keep the socket, since the user may be the one that was revoked. A user who is gone
|
|
6547
|
+
* or changed closes it too, so it reconnects holding only what the admin credential grants; one that is unchanged
|
|
6548
|
+
* is re-authenticated as any user socket.
|
|
6549
|
+
*/
|
|
6550
|
+
private reauthenticateAdminSocket;
|
|
6551
|
+
/**
|
|
6552
|
+
* Move a socket's credential expiry to the refreshed one and restart its
|
|
6553
|
+
* revalidation window, keeping its subscriptions and memos. Refused — and the
|
|
6554
|
+
* socket left to lapse at its old expiry or window — when the credential is
|
|
6555
|
+
* anonymous, already expired, or older than the one the socket holds (a replay).
|
|
6556
|
+
* Different claims close the socket at once with `4005`: the caller's identity
|
|
6557
|
+
* has changed (a role, an `orgId`), so the socket must not deliver another
|
|
6558
|
+
* moment under the old one. The client reconnects and re-seeds under the new one.
|
|
6546
6559
|
*/
|
|
6547
6560
|
private reauthenticateSocket;
|
|
6548
6561
|
private routeNonRpc;
|
|
@@ -6579,18 +6592,19 @@ declare abstract class ShardDO {
|
|
|
6579
6592
|
*/
|
|
6580
6593
|
private refuseRouteUpgrade;
|
|
6581
6594
|
/**
|
|
6582
|
-
*
|
|
6583
|
-
*
|
|
6584
|
-
*
|
|
6585
|
-
*
|
|
6595
|
+
* Drop `ws` when it may no longer receive: its credential lapsed (`TOKEN_EXPIRED` / `4001`, through the
|
|
6596
|
+
* helper `@lunora/agent`'s voice DO shares) or its identity went unrevalidated past its window (`4005`, see
|
|
6597
|
+
* `SocketAttachment.revalidateAt`).
|
|
6598
|
+
* @returns whether the socket was dropped
|
|
6586
6599
|
*/
|
|
6587
|
-
private
|
|
6600
|
+
private dropIfLapsed;
|
|
6588
6601
|
/**
|
|
6589
|
-
*
|
|
6590
|
-
*
|
|
6591
|
-
*
|
|
6602
|
+
* Whether a cursor read under the claims fingerprinted `presented` may be resumed from on this socket: only when
|
|
6603
|
+
* that is the fingerprint of the socket's claims now. A missing fingerprint (an older client) is a mismatch,
|
|
6604
|
+
* so the default is the cold seed.
|
|
6592
6605
|
*/
|
|
6593
|
-
private
|
|
6606
|
+
private resumesUnderCurrentClaims;
|
|
6607
|
+
private dropLapsedSocket;
|
|
6594
6608
|
/**
|
|
6595
6609
|
* The route a route socket was accepted on, when its registration still serves that path under the same function.
|
|
6596
6610
|
* A socket is bound to the function that accepted it: after a deployment reassigns the path, the socket resolves
|
|
@@ -6809,6 +6823,8 @@ declare abstract class ShardDO {
|
|
|
6809
6823
|
private runRelayedRoomEvent;
|
|
6810
6824
|
/** Run one room handler event now. See {@link dispatchRoomEvent}, which queues it. */
|
|
6811
6825
|
private runRoomHandler;
|
|
6826
|
+
/** Whether the sender's credential has lapsed. A local socket is dropped; a relayed event's stand-in has none to close. */
|
|
6827
|
+
private roomSenderLapsed;
|
|
6812
6828
|
/**
|
|
6813
6829
|
* Send a handler's queued broadcasts. A payload that cannot be broadcast (over the cap) is
|
|
6814
6830
|
* logged on its own, so it neither drops the payloads queued after it nor fails the mutation.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SubscriptionIdentity, SchemaLike, DatabaseWriterLike, CrossShardReadArgs, CdcChange, FilterClause, ImportConflictMode,
|
|
1
|
+
import { SubscriptionIdentity, SchemaLike, DatabaseWriterLike, CrossShardReadArgs, CdcChange, FilterClause, ImportConflictMode, ImportRow, MigrationDirection, ReadFootprint, DependencyTracker, ReactiveCache, ShapeProbeCounters, GlobalPollCounters, ReactiveCacheOptions, TransactionHeadroomTracker, ShardSocketLike, LifecycleDispatchInfo, MigrationRunResult, SearchBackfillProgress, VectorBackfillProgress, TableIndexInfo, ColumnMeta, AdvisoryFinding, AdvisorProcedure, RlsPoliciesResult, MaskPoliciesResult, StorageRulesResult, StudioFeaturesResult, FlagsResult, QueuesResult, WorkflowsResult, ExportRow, ImportShardResult, RelatedPage, ShardRankPageResult, SubscriptionQuery, ShapeSubscriptionQuery, MutationDelta, KeyRange, ResolvedShape, ShapeRow, TtlSweepSpec, ScheduleOutbox, SchedulerLike, CompanionMemo, TransactionLimits, IndexKeyEntry, SqlExec, CdcChangeKey } from '@lunora/shard-engine';
|
|
2
2
|
export { type AdvisorProcedure, type AdvisoryFinding, type AggregateIndexDefinitionLike, type DataMigrationLike, type DatabaseWriterLike, type ExportRow, type ExternalSourceLike, type FlagsResult, type ImportShardResult, type KeyRange, type MaskPoliciesResult, type MigrationRunResult, type MutationDelta, type QueuesResult, REPROJECTION_MIGRATION_PREFIX, type RankIndexDefinitionLike, type RelatedPage, type RlsPoliciesResult, type SchedulerLike, type SchemaLike, type SearchBackfillProgress, type ShardRankPageResult, type SourceClientLike, type SqlExec, type StorageRulesResult, type StudioFeaturesResult, type SubscriptionIdentity, type SystemReaderStorageLike, type TransactionHeadroomTracker, UNVOUCHABLE_DEP, type ValidatorLike, type VectorBackfillProgress, type WhereInput, type WorkflowsResult, type WriteHook, applyCdcChanges, assertShapeShardable, backfillSearchIndexes, backfillVectorIndexes, buildReprojectionMigration, clearMemoryTables, countLegacyRows, createReadFootprint, createShardCtxDb, exportShardRows, importShardRows, isSourceDue, markUnvouchableReads, pullExternalSourceIncrementalTick, pullExternalSourceTick, reprojectionMigrationId, reprojectionTables, runDataMigration, runShardMigrations, subscriptionListDeltas } from '@lunora/shard-engine';
|
|
3
3
|
import { DatabaseInstrumentation, MetricHistoryOptions, LogEventInput, TraceAnchor, ContextLogLevel, ContextTracer, SqlClientLike, ContextFetch, ContextMetrics } from '@lunora/observability';
|
|
4
4
|
import { SecretValueHost } from '@lunora/platform';
|
|
@@ -546,11 +546,13 @@ interface RunShardExportArgs {
|
|
|
546
546
|
}
|
|
547
547
|
/** Arguments accepted by the `__lunora_admin__:importShard` admin RPC. */
|
|
548
548
|
interface RunShardImportArgs {
|
|
549
|
+
/** Honour rows tagged `op: "delete"`. See `ImportShardArgs.deletes` in `@lunora/shard-engine`. */
|
|
550
|
+
deletes?: boolean;
|
|
549
551
|
/** Check the rows and report their shape errors, writing nothing. See `ImportShardArgs.dryRun` in `@lunora/shard-engine`. */
|
|
550
552
|
dryRun?: boolean;
|
|
551
553
|
/** What a row whose `_id` already exists does. See `ImportConflictMode` in `@lunora/shard-engine`. */
|
|
552
554
|
onConflict?: ImportConflictMode;
|
|
553
|
-
rows: ReadonlyArray<
|
|
555
|
+
rows: ReadonlyArray<ImportRow>;
|
|
554
556
|
startLine?: number;
|
|
555
557
|
}
|
|
556
558
|
/**
|
|
@@ -6538,11 +6540,22 @@ declare abstract class ShardDO {
|
|
|
6538
6540
|
*/
|
|
6539
6541
|
private handleSocketReauth;
|
|
6540
6542
|
/**
|
|
6541
|
-
*
|
|
6542
|
-
*
|
|
6543
|
-
*
|
|
6544
|
-
*
|
|
6545
|
-
*
|
|
6543
|
+
* Re-authenticate a socket that was admitted as admin. The admin credential it was admitted with must still hold
|
|
6544
|
+
* (the shard's own binding check, as on every admin read, so a rotated token fails here) and the worker must have
|
|
6545
|
+
* verified an admin credential on this very request. Failing either closes the socket: a user identity riding
|
|
6546
|
+
* beside it is not enough to keep the socket, since the user may be the one that was revoked. A user who is gone
|
|
6547
|
+
* or changed closes it too, so it reconnects holding only what the admin credential grants; one that is unchanged
|
|
6548
|
+
* is re-authenticated as any user socket.
|
|
6549
|
+
*/
|
|
6550
|
+
private reauthenticateAdminSocket;
|
|
6551
|
+
/**
|
|
6552
|
+
* Move a socket's credential expiry to the refreshed one and restart its
|
|
6553
|
+
* revalidation window, keeping its subscriptions and memos. Refused — and the
|
|
6554
|
+
* socket left to lapse at its old expiry or window — when the credential is
|
|
6555
|
+
* anonymous, already expired, or older than the one the socket holds (a replay).
|
|
6556
|
+
* Different claims close the socket at once with `4005`: the caller's identity
|
|
6557
|
+
* has changed (a role, an `orgId`), so the socket must not deliver another
|
|
6558
|
+
* moment under the old one. The client reconnects and re-seeds under the new one.
|
|
6546
6559
|
*/
|
|
6547
6560
|
private reauthenticateSocket;
|
|
6548
6561
|
private routeNonRpc;
|
|
@@ -6579,18 +6592,19 @@ declare abstract class ShardDO {
|
|
|
6579
6592
|
*/
|
|
6580
6593
|
private refuseRouteUpgrade;
|
|
6581
6594
|
/**
|
|
6582
|
-
*
|
|
6583
|
-
*
|
|
6584
|
-
*
|
|
6585
|
-
*
|
|
6595
|
+
* Drop `ws` when it may no longer receive: its credential lapsed (`TOKEN_EXPIRED` / `4001`, through the
|
|
6596
|
+
* helper `@lunora/agent`'s voice DO shares) or its identity went unrevalidated past its window (`4005`, see
|
|
6597
|
+
* `SocketAttachment.revalidateAt`).
|
|
6598
|
+
* @returns whether the socket was dropped
|
|
6586
6599
|
*/
|
|
6587
|
-
private
|
|
6600
|
+
private dropIfLapsed;
|
|
6588
6601
|
/**
|
|
6589
|
-
*
|
|
6590
|
-
*
|
|
6591
|
-
*
|
|
6602
|
+
* Whether a cursor read under the claims fingerprinted `presented` may be resumed from on this socket: only when
|
|
6603
|
+
* that is the fingerprint of the socket's claims now. A missing fingerprint (an older client) is a mismatch,
|
|
6604
|
+
* so the default is the cold seed.
|
|
6592
6605
|
*/
|
|
6593
|
-
private
|
|
6606
|
+
private resumesUnderCurrentClaims;
|
|
6607
|
+
private dropLapsedSocket;
|
|
6594
6608
|
/**
|
|
6595
6609
|
* The route a route socket was accepted on, when its registration still serves that path under the same function.
|
|
6596
6610
|
* A socket is bound to the function that accepted it: after a deployment reassigns the path, the socket resolves
|
|
@@ -6809,6 +6823,8 @@ declare abstract class ShardDO {
|
|
|
6809
6823
|
private runRelayedRoomEvent;
|
|
6810
6824
|
/** Run one room handler event now. See {@link dispatchRoomEvent}, which queues it. */
|
|
6811
6825
|
private runRoomHandler;
|
|
6826
|
+
/** Whether the sender's credential has lapsed. A local socket is dropped; a relayed event's stand-in has none to close. */
|
|
6827
|
+
private roomSenderLapsed;
|
|
6812
6828
|
/**
|
|
6813
6829
|
* Send a handler's queued broadcasts. A payload that cannot be broadcast (over the cap) is
|
|
6814
6830
|
* logged on its own, so it neither drops the payloads queued after it nor fails the mutation.
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{installDeliveryFence as a}from"./packem_shared/installDeliveryFence-B6M9KOnb.mjs";import{MERGED_ROLES as o,mergeDurableObjects as c,roleNamespace as S}from"./packem_shared/MERGED_ROLES-C4RToZ16.mjs";import{serveRelationFanout as i}from"./packem_shared/serveRelationFanout-DcSjzAZv.mjs";import{SESSION_DO_TTL_DEFAULT as n,SessionDO as d}from"./packem_shared/SESSION_DO_TTL_DEFAULT-DSvTwRjc.mjs";import{ROOT_DO_SIZE_WARN_BYTES as p,ROOT_SHARD_NAME as m,ShardDO as h}from"./packem_shared/ROOT_DO_SIZE_WARN_BYTES-
|
|
1
|
+
import{installDeliveryFence as a}from"./packem_shared/installDeliveryFence-B6M9KOnb.mjs";import{MERGED_ROLES as o,mergeDurableObjects as c,roleNamespace as S}from"./packem_shared/MERGED_ROLES-C4RToZ16.mjs";import{serveRelationFanout as i}from"./packem_shared/serveRelationFanout-DcSjzAZv.mjs";import{SESSION_DO_TTL_DEFAULT as n,SessionDO as d}from"./packem_shared/SESSION_DO_TTL_DEFAULT-DSvTwRjc.mjs";import{ROOT_DO_SIZE_WARN_BYTES as p,ROOT_SHARD_NAME as m,ShardDO as h}from"./packem_shared/ROOT_DO_SIZE_WARN_BYTES-467RfpXt.mjs";import{SHARD_REGISTRY_DO_NAME as E,ShardRegistryDO as O,hostedShardRegistry as _}from"./packem_shared/SHARD_REGISTRY_DO_NAME-YZZk79QR.mjs";import{createStableIdFactory as u,createStableRandomFactory as b}from"./packem_shared/createStableIdFactory-DPDT_chw.mjs";import{createShardAlarms as T,createShardDirectory as I,createShardHost as g,createShardKvStore as y,createShardPlatform as A,createSocketHost as M,createWorkerPlatform as N}from"@lunora/platform-cloudflare";import{REPROJECTION_MIGRATION_PREFIX as F,UNVOUCHABLE_DEP as L,applyCdcChanges as C,assertShapeShardable as H,backfillSearchIndexes as P,backfillVectorIndexes as j,buildReprojectionMigration as v,clearMemoryTables as U,countLegacyRows as w,createReadFootprint as G,createShardCtxDb as B,exportShardRows as V,importShardRows as W,isSourceDue as Y,markUnvouchableReads as J,pullExternalSourceIncrementalTick as K,pullExternalSourceTick as X,reprojectionMigrationId as Z,reprojectionTables as q,runDataMigration as z,runShardMigrations as Q,subscriptionListDeltas as $}from"@lunora/shard-engine";export{o as MERGED_ROLES,F as REPROJECTION_MIGRATION_PREFIX,p as ROOT_DO_SIZE_WARN_BYTES,m as ROOT_SHARD_NAME,n as SESSION_DO_TTL_DEFAULT,E as SHARD_REGISTRY_DO_NAME,d as SessionDO,h as ShardDO,O as ShardRegistryDO,L as UNVOUCHABLE_DEP,C as applyCdcChanges,H as assertShapeShardable,P as backfillSearchIndexes,j as backfillVectorIndexes,v as buildReprojectionMigration,U as clearMemoryTables,w as countLegacyRows,G as createReadFootprint,T as createShardAlarms,B as createShardCtxDb,I as createShardDirectory,g as createShardHost,y as createShardKvStore,A as createShardPlatform,M as createSocketHost,u as createStableIdFactory,b as createStableRandomFactory,N as createWorkerPlatform,V as exportShardRows,_ as hostedShardRegistry,W as importShardRows,a as installDeliveryFence,Y as isSourceDue,J as markUnvouchableReads,c as mergeDurableObjects,K as pullExternalSourceIncrementalTick,X as pullExternalSourceTick,Z as reprojectionMigrationId,q as reprojectionTables,S as roleNamespace,z as runDataMigration,Q as runShardMigrations,i as serveRelationFanout,$ as subscriptionListDeltas};
|