@lunora/client 1.0.0-alpha.226 → 1.0.0-alpha.228

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { U as User, L as LunoraClient } from "../packem_shared/lunora-client.d-D-JShoPP.mjs";
1
+ import { U as User, L as LunoraClient } from "../packem_shared/lunora-client.d-CRPqJc1_.mjs";
2
2
  import '@lunora/errors';
3
3
  import "../packem_shared/function-reference.d-Br_hsKje.mjs";
4
4
  import '@lunora/runtime';
@@ -1,4 +1,4 @@
1
- import { U as User, L as LunoraClient } from "../packem_shared/lunora-client.d-mJDFGG3X.js";
1
+ import { U as User, L as LunoraClient } from "../packem_shared/lunora-client.d-B9efyT52.js";
2
2
  import '@lunora/errors';
3
3
  import "../packem_shared/function-reference.d-Br_hsKje.js";
4
4
  import '@lunora/runtime';
package/dist/index.d.mts CHANGED
@@ -1,8 +1,8 @@
1
- import { R as ReconnectOptions, c as PersistenceAdapter, Q as QueryCacheAdapter, B as BookmarkStorage, C as ConnectionStatus, S as SubscriptionError, H as HttpStreamRef, d as HttpStreamArgsOf, e as HttpStreamChunkOf, f as StreamIterable, O as OfflineQueueOptions, L as LunoraClient } from "./packem_shared/lunora-client.d-D-JShoPP.mjs";
2
- export { type A as ActionCallOptions, type g as BatchSlot, type h as CachedQuery, type i as ClientDebugShard, type j as ClientDebugSnapshot, type k as ClientDebugSubscription, type l as ClientMessage, type m as ClientQueryRef, type n as ClientShapeSubscribeMessage, type o as ClientShapeUnsubscribeMessage, D as DEFAULT_MAX_BUFFER, type F as FunctionArgumentDescriptor, type p as FunctionDescriptor, type G as GlobalFacetResult, type q as GlobalFacetValue, type r as GlobalFilterClause, type s as GlobalTableInfo, type t as GlobalTablePage, type u as HttpStreamCallArgs, type v as LunoraClientError, type w as LunoraClientOptions, type M as MutationCallOptions, type x as MutationSettledEvent, type y as OptimisticLocalStore, type z as OptimisticUpdate, type E as OutboxMutation, type I as OutboxSink, type J as PersistedMutation, type P as Preloaded, type K as ReplayCredential, type N as ReplayIdentityVerdict, type T as RoomRef, type V as RowOp, type W as RpcEnvelope, type X as RpcResponseBody, type Y as ScheduleRecord, type Z as ScheduleRetryPolicy, type _ as SchedulerPoolStatus, type $ as SchedulerStatus, type a0 as ServerMessage, type a1 as ServerPokeEndMessage, type a2 as ServerPokePartMessage, type a3 as ServerPokeStartMessage, type a4 as ShardTrafficEntry, type a5 as ShardTrafficResult, type a6 as StorageListPage, type a7 as StorageObject, type a8 as StoredQuery, type a9 as StreamHandle, type aa as SubscriptionCallback, type b as SubscriptionErrorCallback, ab as SubscriptionRegistry, type ac as SubscriptionState, type ad as SyncWatermark, type a as Unsubscribe, type U as User, type ae as WorkflowInstanceAction, type af as WorkflowInstanceDetail, type ag as WorkflowInstancePage, type ah as WorkflowInstanceStatus, type ai as WorkflowInstanceSummary, type aj as WorkflowStepDetail, type ak as WsTokenProvider, al as createClientQuery, am as createLocalStore, an as createStream } from "./packem_shared/lunora-client.d-D-JShoPP.mjs";
1
+ import { R as ReconnectOptions, c as PersistenceAdapter, Q as QueryCacheAdapter, B as BookmarkStorage, C as ConnectionStatus, S as SubscriptionError, H as HttpStreamRef, d as HttpStreamArgsOf, e as HttpStreamChunkOf, f as StreamIterable, O as OfflineQueueOptions, L as LunoraClient } from "./packem_shared/lunora-client.d-CRPqJc1_.mjs";
2
+ export { type A as ActionCallOptions, type g as BatchSlot, type h as CachedQuery, type i as ClientDebugShard, type j as ClientDebugSnapshot, type k as ClientDebugSubscription, type l as ClientMessage, type m as ClientQueryRef, type n as ClientShapeSubscribeMessage, type o as ClientShapeUnsubscribeMessage, D as DEFAULT_MAX_BUFFER, type F as FunctionArgumentDescriptor, type p as FunctionDescriptor, type G as GlobalFacetResult, type q as GlobalFacetValue, type r as GlobalFilterClause, type s as GlobalTableInfo, type t as GlobalTablePage, type u as HttpStreamCallArgs, type v as LunoraClientError, type w as LunoraClientOptions, type M as MutationCallOptions, type x as MutationSettledEvent, type y as OptimisticLocalStore, type z as OptimisticUpdate, type E as OutboxMutation, type I as OutboxSink, type J as PersistedMutation, type P as Preloaded, type K as ReplayCredential, type N as ReplayIdentityVerdict, type T as RoomRef, type V as RowOp, type W as RpcEnvelope, type X as RpcResponseBody, type Y as ScheduleRecord, type Z as ScheduleRetryPolicy, type _ as SchedulerPoolStatus, type $ as SchedulerStatus, type a0 as ServerMessage, type a1 as ServerPokeEndMessage, type a2 as ServerPokePartMessage, type a3 as ServerPokeStartMessage, type a4 as ShardTrafficEntry, type a5 as ShardTrafficResult, type a6 as StorageListPage, type a7 as StorageObject, type a8 as StoredQuery, type a9 as StreamHandle, type aa as SubscriptionCallback, type b as SubscriptionErrorCallback, ab as SubscriptionRegistry, type ac as SubscriptionState, type ad as SyncWatermark, type a as Unsubscribe, type U as User, type ae as WorkflowInstanceAction, type af as WorkflowInstanceDetail, type ag as WorkflowInstancePage, type ah as WorkflowInstanceStatus, type ai as WorkflowInstanceSummary, type aj as WorkflowStepDetail, type ak as WsTokenProvider, al as createClientQuery, am as createLocalStore, an as createStream } from "./packem_shared/lunora-client.d-CRPqJc1_.mjs";
3
3
  import { LunoraError, LunoraErrorCode } from '@lunora/errors';
4
4
  export type { LunoraErrorCode } from '@lunora/errors';
5
- export { p as preloadQuery, a as preloadedQueryResult } from "./packem_shared/preload.d-CpCgMBl4.mjs";
5
+ export { p as preloadQuery, a as preloadedQueryResult } from "./packem_shared/preload.d-BSwDmNsZ.mjs";
6
6
  import { F as FunctionReference } from "./packem_shared/function-reference.d-Br_hsKje.mjs";
7
7
  export type { A as ArgsOf, R as ReturnOf } from "./packem_shared/function-reference.d-Br_hsKje.mjs";
8
8
  export type { AuthCapabilities, AuthConfigInfo, AuthImpersonation, AuthPage, AuthSession, AuthUser, AuthUserFieldSpec, CronJobInfo, KvKeyEntry, KvKeyListResult, KvNamespaceSummary, KvValueResult, PipelineLogColumnMap, PipelineLogCursor, PipelineLogField, PipelineLogPage, PipelineLogQuery, PipelineLogRow, VectorIndexSummary, VectorQueryMatch } from '@lunora/runtime';
@@ -665,6 +665,28 @@ interface LiveStream {
665
665
  * @param url the `connect` route URL (its sibling `control` route is derived)
666
666
  */
667
667
  declare const connectLiveStream: (url: string, options?: ConnectLiveStreamOptions) => LiveStream;
668
+ /** Options for {@link subscribeLiveTopic}. */
669
+ interface SubscribeLiveTopicOptions extends Omit<ConnectLiveStreamOptions, "fetch"> {
670
+ /** Called when the shard refuses this subscription (403, 409, 429 and similar). */
671
+ onError?: (error: LiveStreamSubscribeError) => void;
672
+ /** Called for every event on `topic`. */
673
+ onEvent?: (payload: unknown) => void;
674
+ /**
675
+ * Partitions the shared connection. A cookie-authenticated stream is bound to the session that opened it, so
676
+ * pass something that changes when the signed-in user does (a user id): a new value opens a new connection
677
+ * and the old one closes once its subscribers have moved. It is never sent to the server.
678
+ */
679
+ sessionKey?: string;
680
+ /** The topic to follow. */
681
+ topic: string;
682
+ /** The `connect` route URL of a `defineLiveStream`. */
683
+ url: string;
684
+ }
685
+ /**
686
+ * Follow `topic` on the shared connection for `url`.
687
+ * @returns an unsubscribe handle; the last one out closes the connection
688
+ */
689
+ declare const subscribeLiveTopic: (options: SubscribeLiveTopicOptions) => (() => void);
668
690
  /**
669
691
  * The structural surface of a TanStack `Transaction` a bound custom mutator
670
692
  * returns — its `isPersisted.promise` resolves once the write is persisted and
@@ -1018,4 +1040,4 @@ declare const createIndexedDbQueryCache: (options?: IndexedDbQueryCacheOptions)
1018
1040
  * ```
1019
1041
  */
1020
1042
  declare const createSnapshotPrecondition: (client: LunoraClient, functionRef: FunctionReference, args: Record<string, unknown>, shardKey?: string) => (() => boolean);
1021
- export { type AsyncStorageLike, type AsyncStoragePersistenceOptions, type AsyncStorageQueryCacheOptions, type BookmarkStorage, CONFLICT_ERROR_CODE, type ConnectLiveStreamOptions, type ConnectionStatus, type FunctionReference, type HttpStreamArgsOf, type HttpStreamChunkOf, type HttpStreamOptions, type HttpStreamRef, type IndexedDbPersistenceOptions, type IndexedDbQueryCacheOptions, type LiveStream, type LiveStreamEvent, type LiveStreamSubscribeOptions, LunoraClient, type MutationDelta, type MutatorHandle, type MutatorRunnerSinks, type MutatorTransaction, OfflineQueue, type OfflineQueueOptions, type OptimisticMessage, type PersistenceAdapter, type QueryCacheAdapter, type QueuedMutation, RETIRE_AFTER_DURABLE_SEQ_ADVANCE, type ReconcileDurableMessage, type ReconnectCalculator, type ReconnectOptions, type StreamIterable, type SubscriptionError, TabCoordinator, TransportError, applyDelta, connectLiveStream, createAsyncStoragePersistence, createAsyncStorageQueryCache, createCallRunner, createInMemoryBookmarkStorage, createInMemoryPersistence, createInMemoryQueryCache, createIndexedDbPersistence, createIndexedDbQueryCache, createMutatorRunner, createReconnect, createSnapshotPrecondition, getErrorCode, getRetryAfterMs, httpStream, isAuthReplayFailure, isConflictError, isForbiddenError, isMutationDelta, isRateLimitedError, isUnauthorizedError, maxSeq, queryCacheKey, reconcileOptimistic };
1043
+ export { type AsyncStorageLike, type AsyncStoragePersistenceOptions, type AsyncStorageQueryCacheOptions, type BookmarkStorage, CONFLICT_ERROR_CODE, type ConnectLiveStreamOptions, type ConnectionStatus, type FunctionReference, type HttpStreamArgsOf, type HttpStreamChunkOf, type HttpStreamOptions, type HttpStreamRef, type IndexedDbPersistenceOptions, type IndexedDbQueryCacheOptions, type LiveStream, type LiveStreamEvent, type LiveStreamSubscribeError, type LiveStreamSubscribeOptions, LunoraClient, type MutationDelta, type MutatorHandle, type MutatorRunnerSinks, type MutatorTransaction, OfflineQueue, type OfflineQueueOptions, type OptimisticMessage, type PersistenceAdapter, type QueryCacheAdapter, type QueuedMutation, RETIRE_AFTER_DURABLE_SEQ_ADVANCE, type ReconcileDurableMessage, type ReconnectCalculator, type ReconnectOptions, type StreamIterable, type SubscribeLiveTopicOptions, type SubscriptionError, TabCoordinator, TransportError, applyDelta, connectLiveStream, createAsyncStoragePersistence, createAsyncStorageQueryCache, createCallRunner, createInMemoryBookmarkStorage, createInMemoryPersistence, createInMemoryQueryCache, createIndexedDbPersistence, createIndexedDbQueryCache, createMutatorRunner, createReconnect, createSnapshotPrecondition, getErrorCode, getRetryAfterMs, httpStream, isAuthReplayFailure, isConflictError, isForbiddenError, isMutationDelta, isRateLimitedError, isUnauthorizedError, maxSeq, queryCacheKey, reconcileOptimistic, subscribeLiveTopic };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { R as ReconnectOptions, c as PersistenceAdapter, Q as QueryCacheAdapter, B as BookmarkStorage, C as ConnectionStatus, S as SubscriptionError, H as HttpStreamRef, d as HttpStreamArgsOf, e as HttpStreamChunkOf, f as StreamIterable, O as OfflineQueueOptions, L as LunoraClient } from "./packem_shared/lunora-client.d-mJDFGG3X.js";
2
- export { type A as ActionCallOptions, type g as BatchSlot, type h as CachedQuery, type i as ClientDebugShard, type j as ClientDebugSnapshot, type k as ClientDebugSubscription, type l as ClientMessage, type m as ClientQueryRef, type n as ClientShapeSubscribeMessage, type o as ClientShapeUnsubscribeMessage, D as DEFAULT_MAX_BUFFER, type F as FunctionArgumentDescriptor, type p as FunctionDescriptor, type G as GlobalFacetResult, type q as GlobalFacetValue, type r as GlobalFilterClause, type s as GlobalTableInfo, type t as GlobalTablePage, type u as HttpStreamCallArgs, type v as LunoraClientError, type w as LunoraClientOptions, type M as MutationCallOptions, type x as MutationSettledEvent, type y as OptimisticLocalStore, type z as OptimisticUpdate, type E as OutboxMutation, type I as OutboxSink, type J as PersistedMutation, type P as Preloaded, type K as ReplayCredential, type N as ReplayIdentityVerdict, type T as RoomRef, type V as RowOp, type W as RpcEnvelope, type X as RpcResponseBody, type Y as ScheduleRecord, type Z as ScheduleRetryPolicy, type _ as SchedulerPoolStatus, type $ as SchedulerStatus, type a0 as ServerMessage, type a1 as ServerPokeEndMessage, type a2 as ServerPokePartMessage, type a3 as ServerPokeStartMessage, type a4 as ShardTrafficEntry, type a5 as ShardTrafficResult, type a6 as StorageListPage, type a7 as StorageObject, type a8 as StoredQuery, type a9 as StreamHandle, type aa as SubscriptionCallback, type b as SubscriptionErrorCallback, ab as SubscriptionRegistry, type ac as SubscriptionState, type ad as SyncWatermark, type a as Unsubscribe, type U as User, type ae as WorkflowInstanceAction, type af as WorkflowInstanceDetail, type ag as WorkflowInstancePage, type ah as WorkflowInstanceStatus, type ai as WorkflowInstanceSummary, type aj as WorkflowStepDetail, type ak as WsTokenProvider, al as createClientQuery, am as createLocalStore, an as createStream } from "./packem_shared/lunora-client.d-mJDFGG3X.js";
1
+ import { R as ReconnectOptions, c as PersistenceAdapter, Q as QueryCacheAdapter, B as BookmarkStorage, C as ConnectionStatus, S as SubscriptionError, H as HttpStreamRef, d as HttpStreamArgsOf, e as HttpStreamChunkOf, f as StreamIterable, O as OfflineQueueOptions, L as LunoraClient } from "./packem_shared/lunora-client.d-B9efyT52.js";
2
+ export { type A as ActionCallOptions, type g as BatchSlot, type h as CachedQuery, type i as ClientDebugShard, type j as ClientDebugSnapshot, type k as ClientDebugSubscription, type l as ClientMessage, type m as ClientQueryRef, type n as ClientShapeSubscribeMessage, type o as ClientShapeUnsubscribeMessage, D as DEFAULT_MAX_BUFFER, type F as FunctionArgumentDescriptor, type p as FunctionDescriptor, type G as GlobalFacetResult, type q as GlobalFacetValue, type r as GlobalFilterClause, type s as GlobalTableInfo, type t as GlobalTablePage, type u as HttpStreamCallArgs, type v as LunoraClientError, type w as LunoraClientOptions, type M as MutationCallOptions, type x as MutationSettledEvent, type y as OptimisticLocalStore, type z as OptimisticUpdate, type E as OutboxMutation, type I as OutboxSink, type J as PersistedMutation, type P as Preloaded, type K as ReplayCredential, type N as ReplayIdentityVerdict, type T as RoomRef, type V as RowOp, type W as RpcEnvelope, type X as RpcResponseBody, type Y as ScheduleRecord, type Z as ScheduleRetryPolicy, type _ as SchedulerPoolStatus, type $ as SchedulerStatus, type a0 as ServerMessage, type a1 as ServerPokeEndMessage, type a2 as ServerPokePartMessage, type a3 as ServerPokeStartMessage, type a4 as ShardTrafficEntry, type a5 as ShardTrafficResult, type a6 as StorageListPage, type a7 as StorageObject, type a8 as StoredQuery, type a9 as StreamHandle, type aa as SubscriptionCallback, type b as SubscriptionErrorCallback, ab as SubscriptionRegistry, type ac as SubscriptionState, type ad as SyncWatermark, type a as Unsubscribe, type U as User, type ae as WorkflowInstanceAction, type af as WorkflowInstanceDetail, type ag as WorkflowInstancePage, type ah as WorkflowInstanceStatus, type ai as WorkflowInstanceSummary, type aj as WorkflowStepDetail, type ak as WsTokenProvider, al as createClientQuery, am as createLocalStore, an as createStream } from "./packem_shared/lunora-client.d-B9efyT52.js";
3
3
  import { LunoraError, LunoraErrorCode } from '@lunora/errors';
4
4
  export type { LunoraErrorCode } from '@lunora/errors';
5
- export { p as preloadQuery, a as preloadedQueryResult } from "./packem_shared/preload.d-BtiKlK6Y.js";
5
+ export { p as preloadQuery, a as preloadedQueryResult } from "./packem_shared/preload.d-CYzGQBaA.js";
6
6
  import { F as FunctionReference } from "./packem_shared/function-reference.d-Br_hsKje.js";
7
7
  export type { A as ArgsOf, R as ReturnOf } from "./packem_shared/function-reference.d-Br_hsKje.js";
8
8
  export type { AuthCapabilities, AuthConfigInfo, AuthImpersonation, AuthPage, AuthSession, AuthUser, AuthUserFieldSpec, CronJobInfo, KvKeyEntry, KvKeyListResult, KvNamespaceSummary, KvValueResult, PipelineLogColumnMap, PipelineLogCursor, PipelineLogField, PipelineLogPage, PipelineLogQuery, PipelineLogRow, VectorIndexSummary, VectorQueryMatch } from '@lunora/runtime';
@@ -665,6 +665,28 @@ interface LiveStream {
665
665
  * @param url the `connect` route URL (its sibling `control` route is derived)
666
666
  */
667
667
  declare const connectLiveStream: (url: string, options?: ConnectLiveStreamOptions) => LiveStream;
668
+ /** Options for {@link subscribeLiveTopic}. */
669
+ interface SubscribeLiveTopicOptions extends Omit<ConnectLiveStreamOptions, "fetch"> {
670
+ /** Called when the shard refuses this subscription (403, 409, 429 and similar). */
671
+ onError?: (error: LiveStreamSubscribeError) => void;
672
+ /** Called for every event on `topic`. */
673
+ onEvent?: (payload: unknown) => void;
674
+ /**
675
+ * Partitions the shared connection. A cookie-authenticated stream is bound to the session that opened it, so
676
+ * pass something that changes when the signed-in user does (a user id): a new value opens a new connection
677
+ * and the old one closes once its subscribers have moved. It is never sent to the server.
678
+ */
679
+ sessionKey?: string;
680
+ /** The topic to follow. */
681
+ topic: string;
682
+ /** The `connect` route URL of a `defineLiveStream`. */
683
+ url: string;
684
+ }
685
+ /**
686
+ * Follow `topic` on the shared connection for `url`.
687
+ * @returns an unsubscribe handle; the last one out closes the connection
688
+ */
689
+ declare const subscribeLiveTopic: (options: SubscribeLiveTopicOptions) => (() => void);
668
690
  /**
669
691
  * The structural surface of a TanStack `Transaction` a bound custom mutator
670
692
  * returns — its `isPersisted.promise` resolves once the write is persisted and
@@ -1018,4 +1040,4 @@ declare const createIndexedDbQueryCache: (options?: IndexedDbQueryCacheOptions)
1018
1040
  * ```
1019
1041
  */
1020
1042
  declare const createSnapshotPrecondition: (client: LunoraClient, functionRef: FunctionReference, args: Record<string, unknown>, shardKey?: string) => (() => boolean);
1021
- export { type AsyncStorageLike, type AsyncStoragePersistenceOptions, type AsyncStorageQueryCacheOptions, type BookmarkStorage, CONFLICT_ERROR_CODE, type ConnectLiveStreamOptions, type ConnectionStatus, type FunctionReference, type HttpStreamArgsOf, type HttpStreamChunkOf, type HttpStreamOptions, type HttpStreamRef, type IndexedDbPersistenceOptions, type IndexedDbQueryCacheOptions, type LiveStream, type LiveStreamEvent, type LiveStreamSubscribeOptions, LunoraClient, type MutationDelta, type MutatorHandle, type MutatorRunnerSinks, type MutatorTransaction, OfflineQueue, type OfflineQueueOptions, type OptimisticMessage, type PersistenceAdapter, type QueryCacheAdapter, type QueuedMutation, RETIRE_AFTER_DURABLE_SEQ_ADVANCE, type ReconcileDurableMessage, type ReconnectCalculator, type ReconnectOptions, type StreamIterable, type SubscriptionError, TabCoordinator, TransportError, applyDelta, connectLiveStream, createAsyncStoragePersistence, createAsyncStorageQueryCache, createCallRunner, createInMemoryBookmarkStorage, createInMemoryPersistence, createInMemoryQueryCache, createIndexedDbPersistence, createIndexedDbQueryCache, createMutatorRunner, createReconnect, createSnapshotPrecondition, getErrorCode, getRetryAfterMs, httpStream, isAuthReplayFailure, isConflictError, isForbiddenError, isMutationDelta, isRateLimitedError, isUnauthorizedError, maxSeq, queryCacheKey, reconcileOptimistic };
1043
+ export { type AsyncStorageLike, type AsyncStoragePersistenceOptions, type AsyncStorageQueryCacheOptions, type BookmarkStorage, CONFLICT_ERROR_CODE, type ConnectLiveStreamOptions, type ConnectionStatus, type FunctionReference, type HttpStreamArgsOf, type HttpStreamChunkOf, type HttpStreamOptions, type HttpStreamRef, type IndexedDbPersistenceOptions, type IndexedDbQueryCacheOptions, type LiveStream, type LiveStreamEvent, type LiveStreamSubscribeError, type LiveStreamSubscribeOptions, LunoraClient, type MutationDelta, type MutatorHandle, type MutatorRunnerSinks, type MutatorTransaction, OfflineQueue, type OfflineQueueOptions, type OptimisticMessage, type PersistenceAdapter, type QueryCacheAdapter, type QueuedMutation, RETIRE_AFTER_DURABLE_SEQ_ADVANCE, type ReconcileDurableMessage, type ReconnectCalculator, type ReconnectOptions, type StreamIterable, type SubscribeLiveTopicOptions, type SubscriptionError, TabCoordinator, TransportError, applyDelta, connectLiveStream, createAsyncStoragePersistence, createAsyncStorageQueryCache, createCallRunner, createInMemoryBookmarkStorage, createInMemoryPersistence, createInMemoryQueryCache, createIndexedDbPersistence, createIndexedDbQueryCache, createMutatorRunner, createReconnect, createSnapshotPrecondition, getErrorCode, getRetryAfterMs, httpStream, isAuthReplayFailure, isConflictError, isForbiddenError, isMutationDelta, isRateLimitedError, isUnauthorizedError, maxSeq, queryCacheKey, reconcileOptimistic, subscribeLiveTopic };
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{RETIRE_AFTER_DURABLE_SEQ_ADVANCE as o,maxSeq as t,reconcileOptimistic as a}from"./packem_shared/RETIRE_AFTER_DURABLE_SEQ_ADVANCE-DoEHtuR8.mjs";import{createAsyncStoragePersistence as n}from"./packem_shared/createAsyncStoragePersistence-6FCvqc6C.mjs";import{createAsyncStorageQueryCache as p}from"./packem_shared/createAsyncStorageQueryCache-f5023fdB.mjs";import{default as f}from"./packem_shared/createInMemoryBookmarkStorage-BooZhW0n.mjs";import{createCallRunner as x}from"./packem_shared/createCallRunner-Bwcrfh76.mjs";import{createClientQuery as l}from"./packem_shared/createClientQuery-B8Nfj-7o.mjs";import{TabCoordinator as d}from"./packem_shared/TabCoordinator-CXD7vulJ.mjs";import{a as R,i as C}from"./packem_shared/delta-merge-Ls3DED4g.mjs";import{CONFLICT_ERROR_CODE as A,TransportError as h,getErrorCode as D,getRetryAfterMs as Q,isAuthReplayFailure as _,isConflictError as F,isForbiddenError as I,isRateLimitedError as L,isUnauthorizedError as M}from"./packem_shared/CONFLICT_ERROR_CODE-B7qNZMMk.mjs";import{httpStream as O}from"./packem_shared/httpStream-BhSpxRWB.mjs";import{connectLiveStream as b}from"./packem_shared/connectLiveStream-2grXejmG.mjs";import{c as U}from"./packem_shared/local-store-fqWV2n_Z.mjs";import{LunoraClient as k}from"./packem_shared/LunoraClient-CJCINRHw.mjs";import{createMutatorRunner as N}from"./packem_shared/createMutatorRunner-CuMRJpUx.mjs";import{O as z}from"./packem_shared/offline-queue-D_fr-uQ3.mjs";import{createInMemoryPersistence as V,createIndexedDbPersistence as X}from"./packem_shared/createInMemoryPersistence-Cz2W6XVj.mjs";import{preloadQuery as w,preloadedQueryResult as G}from"./packem_shared/preloadQuery-uFy24PCR.mjs";import{createInMemoryQueryCache as J,createIndexedDbQueryCache as W,queryCacheKey as Y}from"./packem_shared/createInMemoryQueryCache-D2uNHLfM.mjs";import{createReconnect as $}from"./packem_shared/createReconnect-CjTmjJDH.mjs";import{default as re}from"./packem_shared/createSnapshotPrecondition-CLkxVeN1.mjs";import{DEFAULT_MAX_BUFFER as te,createStream as ae}from"./packem_shared/DEFAULT_MAX_BUFFER-Bd-_iyiV.mjs";import{SubscriptionRegistry as ne}from"./packem_shared/SubscriptionRegistry-DKIXE7M7.mjs";export{A as CONFLICT_ERROR_CODE,te as DEFAULT_MAX_BUFFER,k as LunoraClient,z as OfflineQueue,o as RETIRE_AFTER_DURABLE_SEQ_ADVANCE,ne as SubscriptionRegistry,d as TabCoordinator,h as TransportError,R as applyDelta,b as connectLiveStream,n as createAsyncStoragePersistence,p as createAsyncStorageQueryCache,x as createCallRunner,l as createClientQuery,f as createInMemoryBookmarkStorage,V as createInMemoryPersistence,J as createInMemoryQueryCache,X as createIndexedDbPersistence,W as createIndexedDbQueryCache,U as createLocalStore,N as createMutatorRunner,$ as createReconnect,re as createSnapshotPrecondition,ae as createStream,D as getErrorCode,Q as getRetryAfterMs,O as httpStream,_ as isAuthReplayFailure,F as isConflictError,I as isForbiddenError,C as isMutationDelta,L as isRateLimitedError,M as isUnauthorizedError,t as maxSeq,w as preloadQuery,G as preloadedQueryResult,Y as queryCacheKey,a as reconcileOptimistic};
1
+ import{RETIRE_AFTER_DURABLE_SEQ_ADVANCE as o,maxSeq as t,reconcileOptimistic as a}from"./packem_shared/RETIRE_AFTER_DURABLE_SEQ_ADVANCE-DoEHtuR8.mjs";import{createAsyncStoragePersistence as i}from"./packem_shared/createAsyncStoragePersistence-6FCvqc6C.mjs";import{createAsyncStorageQueryCache as m}from"./packem_shared/createAsyncStorageQueryCache-f5023fdB.mjs";import{default as f}from"./packem_shared/createInMemoryBookmarkStorage-BooZhW0n.mjs";import{createCallRunner as x}from"./packem_shared/createCallRunner-Bwcrfh76.mjs";import{createClientQuery as l}from"./packem_shared/createClientQuery-B8Nfj-7o.mjs";import{TabCoordinator as d}from"./packem_shared/TabCoordinator-CXD7vulJ.mjs";import{a as R,i as C}from"./packem_shared/delta-merge-Ls3DED4g.mjs";import{CONFLICT_ERROR_CODE as A,TransportError as h,getErrorCode as D,getRetryAfterMs as L,isAuthReplayFailure as Q,isConflictError as _,isForbiddenError as b,isRateLimitedError as F,isUnauthorizedError as I}from"./packem_shared/CONFLICT_ERROR_CODE-B7qNZMMk.mjs";import{httpStream as T}from"./packem_shared/httpStream-BhSpxRWB.mjs";import{connectLiveStream as O}from"./packem_shared/connectLiveStream-2grXejmG.mjs";import{subscribeLiveTopic as U}from"./packem_shared/subscribeLiveTopic-CKVb3Txs.mjs";import{c as k}from"./packem_shared/local-store-fqWV2n_Z.mjs";import{LunoraClient as v}from"./packem_shared/LunoraClient-CJCINRHw.mjs";import{createMutatorRunner as z}from"./packem_shared/createMutatorRunner-CuMRJpUx.mjs";import{O as V}from"./packem_shared/offline-queue-D_fr-uQ3.mjs";import{createInMemoryPersistence as j,createIndexedDbPersistence as w}from"./packem_shared/createInMemoryPersistence-Cz2W6XVj.mjs";import{preloadQuery as H,preloadedQueryResult as J}from"./packem_shared/preloadQuery-uFy24PCR.mjs";import{createInMemoryQueryCache as Y,createIndexedDbQueryCache as Z,queryCacheKey as $}from"./packem_shared/createInMemoryQueryCache-D2uNHLfM.mjs";import{createReconnect as re}from"./packem_shared/createReconnect-CjTmjJDH.mjs";import{default as te}from"./packem_shared/createSnapshotPrecondition-CLkxVeN1.mjs";import{DEFAULT_MAX_BUFFER as ce,createStream as ie}from"./packem_shared/DEFAULT_MAX_BUFFER-Bd-_iyiV.mjs";import{SubscriptionRegistry as me}from"./packem_shared/SubscriptionRegistry-DKIXE7M7.mjs";export{A as CONFLICT_ERROR_CODE,ce as DEFAULT_MAX_BUFFER,v as LunoraClient,V as OfflineQueue,o as RETIRE_AFTER_DURABLE_SEQ_ADVANCE,me as SubscriptionRegistry,d as TabCoordinator,h as TransportError,R as applyDelta,O as connectLiveStream,i as createAsyncStoragePersistence,m as createAsyncStorageQueryCache,x as createCallRunner,l as createClientQuery,f as createInMemoryBookmarkStorage,j as createInMemoryPersistence,Y as createInMemoryQueryCache,w as createIndexedDbPersistence,Z as createIndexedDbQueryCache,k as createLocalStore,z as createMutatorRunner,re as createReconnect,te as createSnapshotPrecondition,ie as createStream,D as getErrorCode,L as getRetryAfterMs,T as httpStream,Q as isAuthReplayFailure,_ as isConflictError,b as isForbiddenError,C as isMutationDelta,F as isRateLimitedError,I as isUnauthorizedError,t as maxSeq,H as preloadQuery,J as preloadedQueryResult,$ as queryCacheKey,a as reconcileOptimistic,U as subscribeLiveTopic};
@@ -1173,9 +1173,9 @@ interface GlobalFacetResult {
1173
1173
  /** A nullable timestamp field as better-auth serializes it: epoch-ms, ISO string, or null. */
1174
1174
  type NullableTimestamp = null | number | string;
1175
1175
  /** A workflow instance's lifecycle status. Mirrors Cloudflare's `InstanceStatus`. */
1176
- type WorkflowInstanceStatus = "complete" | "errored" | "paused" | "queued" | "running" | "terminated" | "unknown" | "waiting" | "waitingForPause";
1176
+ type WorkflowInstanceStatus = "complete" | "errored" | "paused" | "queued" | "rollingBack" | "running" | "terminated" | "unknown" | "waiting" | "waitingForPause";
1177
1177
  /** The lifecycle mutations the status endpoint accepts. */
1178
- type WorkflowInstanceAction = "pause" | "resume" | "terminate";
1178
+ type WorkflowInstanceAction = "pause" | "restart" | "resume" | "terminate";
1179
1179
  /** One row of the workflow-instances list. */
1180
1180
  interface WorkflowInstanceSummary {
1181
1181
  createdOn?: string;
@@ -2999,7 +2999,7 @@ declare class LunoraClient {
2999
2999
  id: string;
3000
3000
  name: string;
3001
3001
  }): Promise<WorkflowInstanceDetail>;
3002
- /** Pause / resume / terminate a workflow instance (`/_lunora/admin/workflows/status`). Needs an Edit-scoped Cloudflare token. */
3002
+ /** Pause / resume / restart / terminate a workflow instance (`/_lunora/admin/workflows/status`). Needs an Edit-scoped Cloudflare token. */
3003
3003
  setWorkflowInstanceStatus(options: {
3004
3004
  action: WorkflowInstanceAction;
3005
3005
  id: string;
@@ -1173,9 +1173,9 @@ interface GlobalFacetResult {
1173
1173
  /** A nullable timestamp field as better-auth serializes it: epoch-ms, ISO string, or null. */
1174
1174
  type NullableTimestamp = null | number | string;
1175
1175
  /** A workflow instance's lifecycle status. Mirrors Cloudflare's `InstanceStatus`. */
1176
- type WorkflowInstanceStatus = "complete" | "errored" | "paused" | "queued" | "running" | "terminated" | "unknown" | "waiting" | "waitingForPause";
1176
+ type WorkflowInstanceStatus = "complete" | "errored" | "paused" | "queued" | "rollingBack" | "running" | "terminated" | "unknown" | "waiting" | "waitingForPause";
1177
1177
  /** The lifecycle mutations the status endpoint accepts. */
1178
- type WorkflowInstanceAction = "pause" | "resume" | "terminate";
1178
+ type WorkflowInstanceAction = "pause" | "restart" | "resume" | "terminate";
1179
1179
  /** One row of the workflow-instances list. */
1180
1180
  interface WorkflowInstanceSummary {
1181
1181
  createdOn?: string;
@@ -2999,7 +2999,7 @@ declare class LunoraClient {
2999
2999
  id: string;
3000
3000
  name: string;
3001
3001
  }): Promise<WorkflowInstanceDetail>;
3002
- /** Pause / resume / terminate a workflow instance (`/_lunora/admin/workflows/status`). Needs an Edit-scoped Cloudflare token. */
3002
+ /** Pause / resume / restart / terminate a workflow instance (`/_lunora/admin/workflows/status`). Needs an Edit-scoped Cloudflare token. */
3003
3003
  setWorkflowInstanceStatus(options: {
3004
3004
  action: WorkflowInstanceAction;
3005
3005
  id: string;
@@ -1,4 +1,4 @@
1
- import { L as LunoraClient, P as Preloaded } from "./lunora-client.d-D-JShoPP.mjs";
1
+ import { L as LunoraClient, P as Preloaded } from "./lunora-client.d-CRPqJc1_.mjs";
2
2
  import { F as FunctionReference, A as ArgsOf, R as ReturnOf } from "./function-reference.d-Br_hsKje.mjs";
3
3
  /**
4
4
  * Run a query once on the server (during SSR) and capture its result in a
@@ -1,4 +1,4 @@
1
- import { L as LunoraClient, P as Preloaded } from "./lunora-client.d-mJDFGG3X.js";
1
+ import { L as LunoraClient, P as Preloaded } from "./lunora-client.d-B9efyT52.js";
2
2
  import { F as FunctionReference, A as ArgsOf, R as ReturnOf } from "./function-reference.d-Br_hsKje.js";
3
3
  /**
4
4
  * Run a query once on the server (during SSR) and capture its result in a
@@ -0,0 +1 @@
1
+ import{connectLiveStream as d}from"./connectLiveStream-2grXejmG.mjs";const c=new Map,u=e=>JSON.stringify([e.url,e.sessionKey,e.withCredentials===!0,e.retryDelay,e.maxDelayMs,Object.entries(e.headers??{}).toSorted(([t],[r])=>t.localeCompare(r))]),f=e=>{const t=u(e);let r=c.get(t);if(r===void 0){const{headers:i,maxDelayMs:m,retryDelay:o,withCredentials:n}=e;r={closeTimer:void 0,refs:0,stream:d(e.url,{headers:i,maxDelayMs:m,retryDelay:o,withCredentials:n})},c.set(t,r)}clearTimeout(r.closeTimer),r.closeTimer=void 0,r.refs+=1;const s=r,a=s.stream.subscribe({id:e.topic,onError:e.onError,onEvent:e.onEvent,topic:e.topic});let l=!1;return()=>{l||(l=!0,a(),s.refs-=1,s.refs===0&&(s.closeTimer=setTimeout(()=>{c.delete(t),s.stream.close()},0)))}};export{f as subscribeLiveTopic};
@@ -1,4 +1,4 @@
1
- import { S as SubscriptionError, L as LunoraClient, a as Unsubscribe } from "../packem_shared/lunora-client.d-D-JShoPP.mjs";
1
+ import { S as SubscriptionError, L as LunoraClient, a as Unsubscribe } from "../packem_shared/lunora-client.d-CRPqJc1_.mjs";
2
2
  export type {
3
3
  /**
4
4
  * `@lunora/client/query` — the framework-neutral live-query state machine shared
@@ -10,7 +10,7 @@ export type {
10
10
  * framework — each adapter supplies thin sinks that write into its own ref /
11
11
  * store / signal / cache.
12
12
  */
13
- b as SubscriptionErrorCallback } from "../packem_shared/lunora-client.d-D-JShoPP.mjs";
13
+ b as SubscriptionErrorCallback } from "../packem_shared/lunora-client.d-CRPqJc1_.mjs";
14
14
  import { F as FunctionReference, A as ArgsOf, R as ReturnOf } from "../packem_shared/function-reference.d-Br_hsKje.mjs";
15
15
  import '@lunora/errors';
16
16
  import '@lunora/runtime';
@@ -1,4 +1,4 @@
1
- import { S as SubscriptionError, L as LunoraClient, a as Unsubscribe } from "../packem_shared/lunora-client.d-mJDFGG3X.js";
1
+ import { S as SubscriptionError, L as LunoraClient, a as Unsubscribe } from "../packem_shared/lunora-client.d-B9efyT52.js";
2
2
  export type {
3
3
  /**
4
4
  * `@lunora/client/query` — the framework-neutral live-query state machine shared
@@ -10,7 +10,7 @@ export type {
10
10
  * framework — each adapter supplies thin sinks that write into its own ref /
11
11
  * store / signal / cache.
12
12
  */
13
- b as SubscriptionErrorCallback } from "../packem_shared/lunora-client.d-mJDFGG3X.js";
13
+ b as SubscriptionErrorCallback } from "../packem_shared/lunora-client.d-B9efyT52.js";
14
14
  import { F as FunctionReference, A as ArgsOf, R as ReturnOf } from "../packem_shared/function-reference.d-Br_hsKje.js";
15
15
  import '@lunora/errors';
16
16
  import '@lunora/runtime';
@@ -1,4 +1,4 @@
1
- import { P as Preloaded, L as LunoraClient } from "../packem_shared/lunora-client.d-D-JShoPP.mjs";
1
+ import { P as Preloaded, L as LunoraClient } from "../packem_shared/lunora-client.d-CRPqJc1_.mjs";
2
2
  export type { A as ArgsOf, F as FunctionReference, R as ReturnOf } from "../packem_shared/function-reference.d-Br_hsKje.mjs";
3
3
  export {
4
4
  /**
@@ -20,7 +20,7 @@ p as preloadQuery,
20
20
  * WebSocket or touches a UI framework, so it is safe to import from any SSR
21
21
  * loader.
22
22
  */
23
- a as preloadedQueryResult } from "../packem_shared/preload.d-CpCgMBl4.mjs";
23
+ a as preloadedQueryResult } from "../packem_shared/preload.d-BSwDmNsZ.mjs";
24
24
  import '@lunora/errors';
25
25
  import '@lunora/runtime';
26
26
  /**
@@ -1,4 +1,4 @@
1
- import { P as Preloaded, L as LunoraClient } from "../packem_shared/lunora-client.d-mJDFGG3X.js";
1
+ import { P as Preloaded, L as LunoraClient } from "../packem_shared/lunora-client.d-B9efyT52.js";
2
2
  export type { A as ArgsOf, F as FunctionReference, R as ReturnOf } from "../packem_shared/function-reference.d-Br_hsKje.js";
3
3
  export {
4
4
  /**
@@ -20,7 +20,7 @@ p as preloadQuery,
20
20
  * WebSocket or touches a UI framework, so it is safe to import from any SSR
21
21
  * loader.
22
22
  */
23
- a as preloadedQueryResult } from "../packem_shared/preload.d-BtiKlK6Y.js";
23
+ a as preloadedQueryResult } from "../packem_shared/preload.d-CYzGQBaA.js";
24
24
  import '@lunora/errors';
25
25
  import '@lunora/runtime';
26
26
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/client",
3
- "version": "1.0.0-alpha.226",
3
+ "version": "1.0.0-alpha.228",
4
4
  "description": "Lunora browser SDK: WebSocket transport, optimistic updates, and an offline mutation queue",
5
5
  "keywords": [
6
6
  "cloudflare",