@lunora/do 1.0.0-alpha.237 → 1.0.0-alpha.239
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
|
@@ -2568,7 +2568,7 @@ declare abstract class ShardDO {
|
|
|
2568
2568
|
* subclasses; wrap your work in `runInTransaction` and use `this.db`
|
|
2569
2569
|
* inside the handler instead.
|
|
2570
2570
|
*/
|
|
2571
|
-
protected get db(): DrizzleSqliteDODatabase
|
|
2571
|
+
protected get db(): DrizzleSqliteDODatabase;
|
|
2572
2572
|
/**
|
|
2573
2573
|
* Run `handler` inside a SQLite transaction. Commits if it resolves;
|
|
2574
2574
|
* rolls back if it throws. The `ConflictError` re-throw lets the
|
|
@@ -6753,4 +6753,18 @@ declare class ShardRegistryDO {
|
|
|
6753
6753
|
* never share an id sequence for the same key.
|
|
6754
6754
|
*/
|
|
6755
6755
|
declare const createStableIdFactory: (mutationId: string | undefined, scope: string) => (() => string);
|
|
6756
|
-
|
|
6756
|
+
/**
|
|
6757
|
+
* The `ctx.random` for one handler run: a number in `[0, 1)` for each call, in the
|
|
6758
|
+
* run's sequence, like {@link createStableIdFactory}. The hashed text carries its own
|
|
6759
|
+
* domain tag, so random value N is not a function of the id N that shares its input.
|
|
6760
|
+
*
|
|
6761
|
+
* The values are DERIVED, not random: anyone who knows the scope and the replay key
|
|
6762
|
+
* can compute them. Use `crypto.getRandomValues` for anything an attacker must not
|
|
6763
|
+
* guess. Without a replay key this is `Math.random`: queries, actions themselves and
|
|
6764
|
+
* unkeyed calls are not replay-stable. A mutation composed from a keyed action or
|
|
6765
|
+
* mutation draws from its caller's keyed sequence.
|
|
6766
|
+
* @param mutationId the call's replay key, or `undefined` when there is none.
|
|
6767
|
+
* @param scope the same scope string {@link createStableIdFactory} takes.
|
|
6768
|
+
*/
|
|
6769
|
+
declare const createStableRandomFactory: (mutationId: string | undefined, scope: string) => (() => number);
|
|
6770
|
+
export { type DeliveryAuthorization, type DeliveryAuthorizationRequest, type DeliveryPermit, type DispatchBookmark, type DurableObjectHandlers, type HibernatableWebSocket, MERGED_ROLES, type MergedDurableObject, type MergedRole, type MergedRoles, type QueryReadScope, ROOT_DO_SIZE_WARN_BYTES, ROOT_SHARD_NAME, type RoleClass, type RoleNamespaceTarget, type RunShardApplyCdcArgs, type RunShardApplyCdcResult, type RunShardBulkRowArgs, type RunShardBulkRowResult, type RunShardExportArgs, type RunShardFindRelatedArgs, type RunShardImportArgs, type RunShardMigrationArgs, type RunShardRankBeforeArgs, type RunShardRankPageArgs, type RunShardWriteArgs, type RunShardWriteResult, SESSION_DO_TTL_DEFAULT, SHARD_REGISTRY_DO_NAME, type SensitiveScope, SessionDO, type SessionRecord, ShardDO, type ShardDOOptions, type ShardDOState, ShardRegistryDO, type SubscriptionOutcome, type TelemetrySink, type TraceRefLike, createStableIdFactory, createStableRandomFactory, installDeliveryFence, mergeDurableObjects, roleNamespace, serveRelationFanout };
|
package/dist/index.d.ts
CHANGED
|
@@ -2568,7 +2568,7 @@ declare abstract class ShardDO {
|
|
|
2568
2568
|
* subclasses; wrap your work in `runInTransaction` and use `this.db`
|
|
2569
2569
|
* inside the handler instead.
|
|
2570
2570
|
*/
|
|
2571
|
-
protected get db(): DrizzleSqliteDODatabase
|
|
2571
|
+
protected get db(): DrizzleSqliteDODatabase;
|
|
2572
2572
|
/**
|
|
2573
2573
|
* Run `handler` inside a SQLite transaction. Commits if it resolves;
|
|
2574
2574
|
* rolls back if it throws. The `ConflictError` re-throw lets the
|
|
@@ -6753,4 +6753,18 @@ declare class ShardRegistryDO {
|
|
|
6753
6753
|
* never share an id sequence for the same key.
|
|
6754
6754
|
*/
|
|
6755
6755
|
declare const createStableIdFactory: (mutationId: string | undefined, scope: string) => (() => string);
|
|
6756
|
-
|
|
6756
|
+
/**
|
|
6757
|
+
* The `ctx.random` for one handler run: a number in `[0, 1)` for each call, in the
|
|
6758
|
+
* run's sequence, like {@link createStableIdFactory}. The hashed text carries its own
|
|
6759
|
+
* domain tag, so random value N is not a function of the id N that shares its input.
|
|
6760
|
+
*
|
|
6761
|
+
* The values are DERIVED, not random: anyone who knows the scope and the replay key
|
|
6762
|
+
* can compute them. Use `crypto.getRandomValues` for anything an attacker must not
|
|
6763
|
+
* guess. Without a replay key this is `Math.random`: queries, actions themselves and
|
|
6764
|
+
* unkeyed calls are not replay-stable. A mutation composed from a keyed action or
|
|
6765
|
+
* mutation draws from its caller's keyed sequence.
|
|
6766
|
+
* @param mutationId the call's replay key, or `undefined` when there is none.
|
|
6767
|
+
* @param scope the same scope string {@link createStableIdFactory} takes.
|
|
6768
|
+
*/
|
|
6769
|
+
declare const createStableRandomFactory: (mutationId: string | undefined, scope: string) => (() => number);
|
|
6770
|
+
export { type DeliveryAuthorization, type DeliveryAuthorizationRequest, type DeliveryPermit, type DispatchBookmark, type DurableObjectHandlers, type HibernatableWebSocket, MERGED_ROLES, type MergedDurableObject, type MergedRole, type MergedRoles, type QueryReadScope, ROOT_DO_SIZE_WARN_BYTES, ROOT_SHARD_NAME, type RoleClass, type RoleNamespaceTarget, type RunShardApplyCdcArgs, type RunShardApplyCdcResult, type RunShardBulkRowArgs, type RunShardBulkRowResult, type RunShardExportArgs, type RunShardFindRelatedArgs, type RunShardImportArgs, type RunShardMigrationArgs, type RunShardRankBeforeArgs, type RunShardRankPageArgs, type RunShardWriteArgs, type RunShardWriteResult, SESSION_DO_TTL_DEFAULT, SHARD_REGISTRY_DO_NAME, type SensitiveScope, SessionDO, type SessionRecord, ShardDO, type ShardDOOptions, type ShardDOState, ShardRegistryDO, type SubscriptionOutcome, type TelemetrySink, type TraceRefLike, createStableIdFactory, createStableRandomFactory, installDeliveryFence, mergeDurableObjects, roleNamespace, serveRelationFanout };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{installDeliveryFence as a}from"./packem_shared/installDeliveryFence-B6M9KOnb.mjs";import{MERGED_ROLES as t,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 p}from"./packem_shared/SESSION_DO_TTL_DEFAULT-DSvTwRjc.mjs";import{ROOT_DO_SIZE_WARN_BYTES as d,ROOT_SHARD_NAME as m,ShardDO as D}from"./packem_shared/ROOT_DO_SIZE_WARN_BYTES-Ddq11_jA.mjs";import{SHARD_REGISTRY_DO_NAME as O,ShardRegistryDO as h}from"./packem_shared/SHARD_REGISTRY_DO_NAME-DRIFt2FK.mjs";import{createStableIdFactory as x}from"./packem_shared/createStableIdFactory-
|
|
1
|
+
import{installDeliveryFence as a}from"./packem_shared/installDeliveryFence-B6M9KOnb.mjs";import{MERGED_ROLES as t,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 p}from"./packem_shared/SESSION_DO_TTL_DEFAULT-DSvTwRjc.mjs";import{ROOT_DO_SIZE_WARN_BYTES as d,ROOT_SHARD_NAME as m,ShardDO as D}from"./packem_shared/ROOT_DO_SIZE_WARN_BYTES-Ddq11_jA.mjs";import{SHARD_REGISTRY_DO_NAME as O,ShardRegistryDO as h}from"./packem_shared/SHARD_REGISTRY_DO_NAME-DRIFt2FK.mjs";import{createStableIdFactory as x,createStableRandomFactory as u}from"./packem_shared/createStableIdFactory-DPDT_chw.mjs";import{createShardAlarms as f,createShardDirectory as T,createShardHost as I,createShardKvStore as A,createShardPlatform as M,createSocketHost as g,createWorkerPlatform as y}from"@lunora/platform-cloudflare";import{REPROJECTION_MIGRATION_PREFIX as k,UNVOUCHABLE_DEP as F,applyCdcChanges as L,assertShapeShardable as C,backfillSearchIndexes as H,backfillVectorIndexes as P,buildReprojectionMigration as j,clearMemoryTables as v,countLegacyRows as U,createReadFootprint as w,createShardCtxDb as G,exportShardRows as B,importShardRows as V,isSourceDue as W,markUnvouchableReads as Y,pullExternalSourceIncrementalTick as J,pullExternalSourceTick as K,reprojectionMigrationId as X,reprojectionTables as Z,runDataMigration as q,runShardMigrations as z,subscriptionListDeltas as Q}from"@lunora/shard-engine";export{t as MERGED_ROLES,k as REPROJECTION_MIGRATION_PREFIX,d as ROOT_DO_SIZE_WARN_BYTES,m as ROOT_SHARD_NAME,n as SESSION_DO_TTL_DEFAULT,O as SHARD_REGISTRY_DO_NAME,p as SessionDO,D as ShardDO,h as ShardRegistryDO,F as UNVOUCHABLE_DEP,L as applyCdcChanges,C as assertShapeShardable,H as backfillSearchIndexes,P as backfillVectorIndexes,j as buildReprojectionMigration,v as clearMemoryTables,U as countLegacyRows,w as createReadFootprint,f as createShardAlarms,G as createShardCtxDb,T as createShardDirectory,I as createShardHost,A as createShardKvStore,M as createShardPlatform,g as createSocketHost,x as createStableIdFactory,u as createStableRandomFactory,y as createWorkerPlatform,B as exportShardRows,V as importShardRows,a as installDeliveryFence,W as isSourceDue,Y as markUnvouchableReads,c as mergeDurableObjects,J as pullExternalSourceIncrementalTick,K as pullExternalSourceTick,X as reprojectionMigrationId,Z as reprojectionTables,S as roleNamespace,q as runDataMigration,z as runShardMigrations,i as serveRelationFanout,Q as subscriptionListDeltas};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cyrb53 as n}from"@lunora/values";const s=[0,2654435769,2246822507,3266489909],a=e=>{const r=s.map(c=>(n(e,c)%4294967296).toString(16).padStart(8,"0")).join(""),t=`8${r.slice(13,16)}`,o=`${(Number.parseInt(r[16]??"0",16)&3|8).toString(16)}${r.slice(17,20)}`;return`${r.slice(0,8)}-${r.slice(8,12)}-${t}-${o}-${r.slice(20,32)}`},l=(e,r)=>{if(e===void 0||e.length===0)return()=>crypto.randomUUID();let t=0;return()=>(t+=1,a(`${r}\0${e}\0${t.toString()}`))},S=(e,r)=>{if(e===void 0||e.length===0)return()=>Math.random();let t=0;return()=>(t+=1,n(`random\0${r}\0${e}\0${t.toString()}`)/2**53)};export{l as createStableIdFactory,S as createStableRandomFactory};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/do",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.239",
|
|
4
4
|
"description": "Lunora Durable Objects: ShardDO (SQLite, OCC, hibernated WebSocket subscriptions) and SessionDO",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -47,13 +47,13 @@
|
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@lunora/errors": ">=1.0.0-alpha.51 <2.0.0-0",
|
|
50
|
-
"@lunora/observability": "1.0.0-alpha.
|
|
51
|
-
"@lunora/platform": "1.0.0-alpha.
|
|
52
|
-
"@lunora/platform-cloudflare": "1.0.0-alpha.
|
|
53
|
-
"@lunora/shard-engine": "1.0.0-alpha.
|
|
50
|
+
"@lunora/observability": "1.0.0-alpha.163",
|
|
51
|
+
"@lunora/platform": "1.0.0-alpha.74",
|
|
52
|
+
"@lunora/platform-cloudflare": "1.0.0-alpha.105",
|
|
53
|
+
"@lunora/shard-engine": "1.0.0-alpha.152",
|
|
54
54
|
"@lunora/values": "1.0.0-alpha.78",
|
|
55
55
|
"@lunora/wire": "1.0.0-alpha.2",
|
|
56
|
-
"drizzle-orm": "
|
|
56
|
+
"drizzle-orm": "1.0.0-rc.5"
|
|
57
57
|
},
|
|
58
58
|
"engines": {
|
|
59
59
|
"node": "^22.15.0 || >=24.11.0"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{cyrb53 as c}from"@lunora/values";const s=[0,2654435769,2246822507,3266489909],i=r=>{const t=s.map(o=>(c(r,o)%4294967296).toString(16).padStart(8,"0")).join(""),e=`8${t.slice(13,16)}`,n=`${(Number.parseInt(t[16]??"0",16)&3|8).toString(16)}${t.slice(17,20)}`;return`${t.slice(0,8)}-${t.slice(8,12)}-${e}-${n}-${t.slice(20,32)}`},l=(r,t)=>{if(r===void 0||r.length===0)return()=>crypto.randomUUID();let e=0;return()=>(e+=1,i(`${t}\0${r}\0${e.toString()}`))};export{l as createStableIdFactory};
|