@lunora/client 1.0.0-alpha.194 → 1.0.0-alpha.196
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/auth/index.d.mts +1 -1
- package/dist/auth/index.d.ts +1 -1
- package/dist/index.d.mts +18 -18
- package/dist/index.d.ts +18 -18
- package/dist/index.mjs +1 -1
- package/dist/packem_shared/LunoraClient-DljhwSYY.mjs +1 -0
- package/dist/packem_shared/SubscriptionRegistry-5CHmk3d8.mjs +1 -0
- package/dist/packem_shared/applyDelta-UuKQOPo1.mjs +1 -0
- package/dist/packem_shared/createLocalStore-CriEK0Fm.mjs +1 -0
- package/dist/packem_shared/{createServerClient-HdISrPXa.mjs → createServerClient-pcVZisrR.mjs} +1 -1
- package/dist/packem_shared/delta-merge-CDCNlktH.mjs +1 -0
- package/dist/packem_shared/local-store-CtP_1rJj.mjs +1 -0
- package/dist/packem_shared/{lunora-client.d-DDVPWV7D.d.mts → lunora-client.d-BZq8UjLD.d.mts} +86 -170
- package/dist/packem_shared/{lunora-client.d-C6lZEDyl.d.ts → lunora-client.d-DEWqB37M.d.ts} +86 -170
- package/dist/packem_shared/{preload.d-Cf8tiYKi.d.mts → preload.d-CcbcPzGc.d.mts} +1 -1
- package/dist/packem_shared/{preload.d-CdYylQeH.d.ts → preload.d-CrPi7Ft1.d.ts} +1 -1
- package/dist/packem_shared/wire-errors-CYMmnEcW.mjs +1 -0
- package/dist/query/index.d.mts +2 -2
- package/dist/query/index.d.ts +2 -2
- package/dist/service.mjs +1 -1
- package/dist/ssr/index.d.mts +2 -2
- package/dist/ssr/index.d.ts +2 -2
- package/dist/ssr/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/packem_shared/LunoraClient-sL0hnKnB.mjs +0 -1
- package/dist/packem_shared/SubscriptionRegistry-CxKugiaA.mjs +0 -1
- package/dist/packem_shared/applyDelta-CK4TguD-.mjs +0 -1
- package/dist/packem_shared/createLocalStore-Di9RGozS.mjs +0 -1
- package/dist/packem_shared/delta-merge-BCAy1Q0H.mjs +0 -1
- package/dist/packem_shared/local-store-C9mvzb5T.mjs +0 -1
- package/dist/packem_shared/replay-CXXDZ1_h.mjs +0 -1
package/dist/packem_shared/{lunora-client.d-DDVPWV7D.d.mts → lunora-client.d-BZq8UjLD.d.mts}
RENAMED
|
@@ -1,41 +1,6 @@
|
|
|
1
1
|
import { LunoraErrorCodeInput, LunoraErrorCode } from '@lunora/errors';
|
|
2
2
|
import { F as FunctionReference, A as ArgsOf, R as ReturnOf } from "./function-reference.d-Br_hsKje.mjs";
|
|
3
3
|
import { CronJobInfo, VectorIndexSummary, VectorQueryMatch, PipelineLogQuery, PipelineLogPage, KvNamespaceSummary, KvKeyListResult, KvValueResult, AuthUser, AuthPage, AuthImpersonation, AuthCapabilities, AuthConfigInfo, AuthSession } from '@lunora/runtime';
|
|
4
|
-
/**
|
|
5
|
-
* Reactive key-value store for local-only client state.
|
|
6
|
-
*
|
|
7
|
-
* Unlike a server {@link SubscriptionState} (which tracks a live WS connection,
|
|
8
|
-
* an `acked` flag, `serverBase`, optimistic layers, and the full subscription
|
|
9
|
-
* machinery), a `ClientQueryRef` is purely local — no server round-trip, no
|
|
10
|
-
* WebSocket, no persistence. It exists so framework adapters can offer a
|
|
11
|
-
* `useClientQuery` hook whose values survive component remounts and are shared
|
|
12
|
-
* across every consumer of the same ref, with none of the ceremony or coupling
|
|
13
|
-
* of a dedicated context provider.
|
|
14
|
-
*
|
|
15
|
-
* The store lives inside `LunoraClient` (a private field) and is surfaced through
|
|
16
|
-
* `client.getClientQuery(ref)` / `setClientQuery(ref, value)` /
|
|
17
|
-
* `subscribeClientQuery(ref, callback)`.
|
|
18
|
-
*/
|
|
19
|
-
/** Opaque handle for a typed client-local query slot. */
|
|
20
|
-
interface ClientQueryRef<T = unknown> {
|
|
21
|
-
/** Default value when no value has been set explicitly. */
|
|
22
|
-
readonly defaultValue: T;
|
|
23
|
-
/** Stable identity for the slot. Must be unique within a client instance. */
|
|
24
|
-
readonly key: string;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Create a typed {@link ClientQueryRef}. Call once per slot at module scope
|
|
28
|
-
* (or inside a component module) — the ref object is the stable identity.
|
|
29
|
-
* @example
|
|
30
|
-
* ```ts
|
|
31
|
-
* // lunora/client-queries.ts
|
|
32
|
-
* import { createClientQuery } from "@lunora/client";
|
|
33
|
-
*
|
|
34
|
-
* export const sidebarOpen = createClientQuery("sidebarOpen", true);
|
|
35
|
-
* export const selectedMessageId = createClientQuery("selectedMessageId", undefined as string | undefined);
|
|
36
|
-
* ```
|
|
37
|
-
*/
|
|
38
|
-
declare const createClientQuery: <T>(key: string, defaultValue: T) => ClientQueryRef<T>;
|
|
39
4
|
/**
|
|
40
5
|
* Typed reference to an HTTP-SSE stream route (`httpRoute.<verb>(path).stream()`)
|
|
41
6
|
* emitted by `@lunora/codegen` as `httpStreams.<namespace>.<name>`.
|
|
@@ -1397,6 +1362,80 @@ declare class SubscriptionRegistry {
|
|
|
1397
1362
|
*/
|
|
1398
1363
|
clear(): void;
|
|
1399
1364
|
}
|
|
1365
|
+
/**
|
|
1366
|
+
* An `Error` carrying the server's machine-readable `code` and (for a
|
|
1367
|
+
* `LunoraError`) structured `data`, plus an optional actionable `hint` (Markdown)
|
|
1368
|
+
* and `docsUrl` resolved from the central error catalog. The client's public
|
|
1369
|
+
* error contract for RPC/batch failures — a UI can render `hint`/`docsUrl` to
|
|
1370
|
+
* tell the user how to fix the error. The `(string & {})` arm keeps
|
|
1371
|
+
* forward-compat/unknown server codes assignable without losing autocomplete on
|
|
1372
|
+
* the known `LunoraErrorCode` union.
|
|
1373
|
+
*/
|
|
1374
|
+
type LunoraClientError = Error & {
|
|
1375
|
+
code?: LunoraErrorCode | (string & {});
|
|
1376
|
+
data?: unknown;
|
|
1377
|
+
docsUrl?: string;
|
|
1378
|
+
hint?: string | string[];
|
|
1379
|
+
};
|
|
1380
|
+
/** One demuxed result slot of a `LunoraClient.batch` call. */
|
|
1381
|
+
type BatchSlot = {
|
|
1382
|
+
error: LunoraClientError;
|
|
1383
|
+
ok: false;
|
|
1384
|
+
} | {
|
|
1385
|
+
ok: true;
|
|
1386
|
+
value: unknown;
|
|
1387
|
+
};
|
|
1388
|
+
/**
|
|
1389
|
+
* Reactive key-value store for local-only client state.
|
|
1390
|
+
*
|
|
1391
|
+
* Unlike a server {@link SubscriptionState} (which tracks a live WS connection,
|
|
1392
|
+
* an `acked` flag, `serverBase`, optimistic layers, and the full subscription
|
|
1393
|
+
* machinery), a `ClientQueryRef` is purely local — no server round-trip, no
|
|
1394
|
+
* WebSocket, no persistence. It exists so framework adapters can offer a
|
|
1395
|
+
* `useClientQuery` hook whose values survive component remounts and are shared
|
|
1396
|
+
* across every consumer of the same ref, with none of the ceremony or coupling
|
|
1397
|
+
* of a dedicated context provider.
|
|
1398
|
+
*
|
|
1399
|
+
* The store lives inside `LunoraClient` (a private field) and is surfaced through
|
|
1400
|
+
* `client.getClientQuery(ref)` / `setClientQuery(ref, value)` /
|
|
1401
|
+
* `subscribeClientQuery(ref, callback)`.
|
|
1402
|
+
*/
|
|
1403
|
+
/** Opaque handle for a typed client-local query slot. */
|
|
1404
|
+
interface ClientQueryRef<T = unknown> {
|
|
1405
|
+
/** Default value when no value has been set explicitly. */
|
|
1406
|
+
readonly defaultValue: T;
|
|
1407
|
+
/** Stable identity for the slot. Must be unique within a client instance. */
|
|
1408
|
+
readonly key: string;
|
|
1409
|
+
}
|
|
1410
|
+
/**
|
|
1411
|
+
* Create a typed {@link ClientQueryRef}. Call once per slot at module scope
|
|
1412
|
+
* (or inside a component module) — the ref object is the stable identity.
|
|
1413
|
+
* @example
|
|
1414
|
+
* ```ts
|
|
1415
|
+
* // lunora/client-queries.ts
|
|
1416
|
+
* import { createClientQuery } from "@lunora/client";
|
|
1417
|
+
*
|
|
1418
|
+
* export const sidebarOpen = createClientQuery("sidebarOpen", true);
|
|
1419
|
+
* export const selectedMessageId = createClientQuery("selectedMessageId", undefined as string | undefined);
|
|
1420
|
+
* ```
|
|
1421
|
+
*/
|
|
1422
|
+
declare const createClientQuery: <T>(key: string, defaultValue: T) => ClientQueryRef<T>;
|
|
1423
|
+
type WSState = "idle" | "connecting" | "open" | "closed";
|
|
1424
|
+
/**
|
|
1425
|
+
* Aggregate live-socket health across every shard connection, for a UI status
|
|
1426
|
+
* indicator. `idle` = no socket opened yet; `connecting` = at least one socket
|
|
1427
|
+
* is (re)connecting and none is open; `connected` = at least one socket is open;
|
|
1428
|
+
* `polling` = no socket would open, so live queries are being refreshed over HTTP
|
|
1429
|
+
* instead (see `polling-fallback.ts` — live but slower, and shapes
|
|
1430
|
+
* / streams / whispers are dark; mutations go over HTTP as they do while
|
|
1431
|
+
* connected); `offline` = sockets exist but all are down (between reconnect
|
|
1432
|
+
* attempts), and a poll could not reach the origin either.
|
|
1433
|
+
*
|
|
1434
|
+
* `polling` outranks `connecting`: while the fallback is running a reconnect is
|
|
1435
|
+
* still armed in the background, and reporting that attempt would flicker the
|
|
1436
|
+
* indicator between two states while data is in fact arriving on the slow path.
|
|
1437
|
+
*/
|
|
1438
|
+
type ConnectionStatus = "connected" | "connecting" | "idle" | "offline" | "polling";
|
|
1400
1439
|
/**
|
|
1401
1440
|
* Read/write handle over the client's live query cache, handed to a mutation's
|
|
1402
1441
|
* `withOptimisticUpdate` callback so a single mutation can optimistically patch
|
|
@@ -1450,6 +1489,8 @@ declare const createLocalStore: (subscriptions: SubscriptionRegistry, shardKey:
|
|
|
1450
1489
|
rollbacks: (() => void)[];
|
|
1451
1490
|
store: OptimisticLocalStore;
|
|
1452
1491
|
};
|
|
1492
|
+
/** Callback a shape subscription invokes with its materialized rowset on every applied poke. */
|
|
1493
|
+
type ShapeCallback = (rows: Record<string, unknown>[]) => void;
|
|
1453
1494
|
declare const DEFAULT_MAX_BUFFER = 1024;
|
|
1454
1495
|
interface StreamHandle<T = unknown> {
|
|
1455
1496
|
/** Mark the stream complete (no more chunks); resolves any pending consumer to `done:true`. */
|
|
@@ -1482,22 +1523,6 @@ declare const createStream: <T>(options: {
|
|
|
1482
1523
|
handle: StreamHandle<T>;
|
|
1483
1524
|
iterable: StreamIterable<T>;
|
|
1484
1525
|
};
|
|
1485
|
-
type WSState = "idle" | "connecting" | "open" | "closed";
|
|
1486
|
-
/**
|
|
1487
|
-
* Aggregate live-socket health across every shard connection, for a UI status
|
|
1488
|
-
* indicator. `idle` = no socket opened yet; `connecting` = at least one socket
|
|
1489
|
-
* is (re)connecting and none is open; `connected` = at least one socket is open;
|
|
1490
|
-
* `polling` = no socket would open, so live queries are being refreshed over HTTP
|
|
1491
|
-
* instead (see {@link file://./polling-fallback.ts} — live but slower, and shapes
|
|
1492
|
-
* / streams / whispers are dark; mutations go over HTTP as they do while
|
|
1493
|
-
* connected); `offline` = sockets exist but all are down (between reconnect
|
|
1494
|
-
* attempts), and a poll could not reach the origin either.
|
|
1495
|
-
*
|
|
1496
|
-
* `polling` outranks `connecting`: while the fallback is running a reconnect is
|
|
1497
|
-
* still armed in the background, and reporting that attempt would flicker the
|
|
1498
|
-
* indicator between two states while data is in fact arriving on the slow path.
|
|
1499
|
-
*/
|
|
1500
|
-
type ConnectionStatus = "connected" | "connecting" | "idle" | "offline" | "polling";
|
|
1501
1526
|
/** One shard's socket + watermark state in a {@link LunoraClient.debug} snapshot. */
|
|
1502
1527
|
interface ClientDebugShard {
|
|
1503
1528
|
/**
|
|
@@ -1702,31 +1727,6 @@ type ReplayIdentityVerdict = {
|
|
|
1702
1727
|
} | {
|
|
1703
1728
|
verdict: "unknown";
|
|
1704
1729
|
};
|
|
1705
|
-
/** Callback a shape subscription invokes with its materialized rowset on every applied poke. */
|
|
1706
|
-
type ShapeCallback = (rows: Record<string, unknown>[]) => void;
|
|
1707
|
-
/**
|
|
1708
|
-
* An `Error` carrying the server's machine-readable `code` and (for a
|
|
1709
|
-
* `LunoraError`) structured `data`, plus an optional actionable `hint` (Markdown)
|
|
1710
|
-
* and `docsUrl` resolved from the central error catalog. The client's public
|
|
1711
|
-
* error contract for RPC/batch failures — a UI can render `hint`/`docsUrl` to
|
|
1712
|
-
* tell the user how to fix the error. The `(string & {})` arm keeps
|
|
1713
|
-
* forward-compat/unknown server codes assignable without losing autocomplete on
|
|
1714
|
-
* the known {@link LunoraErrorCode} union.
|
|
1715
|
-
*/
|
|
1716
|
-
type LunoraClientError = Error & {
|
|
1717
|
-
code?: LunoraErrorCode | (string & {});
|
|
1718
|
-
data?: unknown;
|
|
1719
|
-
docsUrl?: string;
|
|
1720
|
-
hint?: string | string[];
|
|
1721
|
-
};
|
|
1722
|
-
/** One demuxed result slot of a {@link LunoraClient.batch} call (plan 088). */
|
|
1723
|
-
type BatchSlot = {
|
|
1724
|
-
error: LunoraClientError;
|
|
1725
|
-
ok: false;
|
|
1726
|
-
} | {
|
|
1727
|
-
ok: true;
|
|
1728
|
-
value: unknown;
|
|
1729
|
-
};
|
|
1730
1730
|
/**
|
|
1731
1731
|
* Lunora browser/edge client. Talks RPC over HTTP and real-time deltas over
|
|
1732
1732
|
* a single multiplexed WebSocket.
|
|
@@ -1748,6 +1748,8 @@ declare class LunoraClient {
|
|
|
1748
1748
|
static createClientQuery<T>(key: string, defaultValue: T): ClientQueryRef<T>;
|
|
1749
1749
|
readonly url: string;
|
|
1750
1750
|
readonly wsUrl: string;
|
|
1751
|
+
/** The admin modules reach the client only through this host. The arrows read `this` when called, so spies and overrides installed after construction still take effect. */
|
|
1752
|
+
private readonly adminHost;
|
|
1751
1753
|
/** Local reactive store for {@link ClientQueryRef} values — no server round-trip. Private; reach it via `getClientQuery` / `setClientQuery` / `subscribeClientQuery`. */
|
|
1752
1754
|
private readonly clientQueryStore;
|
|
1753
1755
|
private wsToken;
|
|
@@ -1761,6 +1763,8 @@ declare class LunoraClient {
|
|
|
1761
1763
|
private readonly connectTimeoutMs;
|
|
1762
1764
|
/** Keepalive cadence (ms); `0` disables the heartbeat. See {@link LunoraClientOptions.heartbeatIntervalMs}. */
|
|
1763
1765
|
private readonly heartbeatIntervalMs;
|
|
1766
|
+
/** The socket-lifecycle inputs, built once after the constructor assigns them (none is reassigned later). */
|
|
1767
|
+
private readonly managedSocketOptions;
|
|
1764
1768
|
/** Failed-open run that engages the HTTP polling fallback; `0` disables it. */
|
|
1765
1769
|
private readonly pollingFallbackAfterFailedAttempts;
|
|
1766
1770
|
/** Polling-fallback cadence (ms); `0` disables it. See {@link LunoraClientOptions.pollingFallback}. */
|
|
@@ -1879,15 +1883,7 @@ declare class LunoraClient {
|
|
|
1879
1883
|
* leader (becomes leader itself, or the leader changes), so a stale
|
|
1880
1884
|
* mirror from a previous leader never survives a leadership change.
|
|
1881
1885
|
*/
|
|
1882
|
-
private
|
|
1883
|
-
/**
|
|
1884
|
-
* Sticky "has the mirrored leader status ever reported `connected`" flag —
|
|
1885
|
-
* the follower's counterpart to {@link ShardConnection.wasEverConnected},
|
|
1886
|
-
* since a follower has no `ShardConnection` of its own. Feeds the
|
|
1887
|
-
* offline-queue gate (see `mutation`) exactly like the real per-shard flag
|
|
1888
|
-
* does on the leader/single-tab path.
|
|
1889
|
-
*/
|
|
1890
|
-
private leaderWasEverConnected;
|
|
1886
|
+
private readonly leader;
|
|
1891
1887
|
/** One {@link ShardConnection} per shard key (keyed by `shardKey ?? ""`). */
|
|
1892
1888
|
private readonly connections;
|
|
1893
1889
|
/**
|
|
@@ -2112,18 +2108,8 @@ declare class LunoraClient {
|
|
|
2112
2108
|
/** Pending rate-limit retry flushes, keyed by {@link connectionKey}, so `close()` can cancel them. */
|
|
2113
2109
|
private readonly replayRetryTimers;
|
|
2114
2110
|
private readonly shapeSubscriptions;
|
|
2115
|
-
/**
|
|
2116
|
-
|
|
2117
|
-
* `<connectionKey>\u0000<pokeId>`.
|
|
2118
|
-
*
|
|
2119
|
-
* The connection has to be in the key: `pokeId` is a per-DO counter that also
|
|
2120
|
-
* resets on eviction, so a multi-shard client — one socket per shard, one map
|
|
2121
|
-
* here — sees two shards mint `poke-1` concurrently. Keyed by `pokeId` alone
|
|
2122
|
-
* their frames interleave into a single buffer: one shard applies the other's
|
|
2123
|
-
* epoch (spurious fork → view wiped) and the other finds no buffer for its
|
|
2124
|
-
* parts at all, silently dropping rows while the server's memo advances.
|
|
2125
|
-
*/
|
|
2126
|
-
private readonly pokeBuffers;
|
|
2111
|
+
/** In-flight pokes, keyed by connection and `pokeId`. The key rule is in shape-state.ts. */
|
|
2112
|
+
private readonly pokeAssembler;
|
|
2127
2113
|
private nextShapeId;
|
|
2128
2114
|
constructor(options: LunoraClientOptions);
|
|
2129
2115
|
/**
|
|
@@ -3841,7 +3827,7 @@ declare class LunoraClient {
|
|
|
3841
3827
|
* the real `ShardConnection`'s state (byte-identical to the pre-cross-tab
|
|
3842
3828
|
* behavior). A follower has no `ShardConnection` of its own (see
|
|
3843
3829
|
* `ensureSocket`), so it derives the same triple from the mirrored
|
|
3844
|
-
* `
|
|
3830
|
+
* `leader.status`/`leader.wasEverConnected` instead: `"connected"` maps to
|
|
3845
3831
|
* `"open"` (queue-eligible once `wasEverConnected`), `"connecting"` stays
|
|
3846
3832
|
* `"connecting"` (the mid-reconnect queue branch), anything else is
|
|
3847
3833
|
* `"idle"`. `hasSocket` is always `false` for a follower — it never has
|
|
@@ -3921,26 +3907,6 @@ declare class LunoraClient {
|
|
|
3921
3907
|
* a silent tokenless socket the admin gate would reject.
|
|
3922
3908
|
*/
|
|
3923
3909
|
private openSocketWithProvidedToken;
|
|
3924
|
-
/**
|
|
3925
|
-
* Construct one WebSocket connection attempt and wire the shared
|
|
3926
|
-
* lifecycle guarantees around it — the fail-fast connect-timeout, the
|
|
3927
|
-
* identity guard that stops a superseded attempt's late `open`/`message`/
|
|
3928
|
-
* `close`/`error` from touching a connection a newer attempt already
|
|
3929
|
-
* owns, and (once open) the keepalive heartbeat with its half-open
|
|
3930
|
-
* watchdog (plan 217). One call opens ONE attempt; the caller owns
|
|
3931
|
-
* reconnect scheduling from `onClose` — mirrors the shard's existing
|
|
3932
|
-
* `ensureSocket` / `handleDisconnect` split, now shared with
|
|
3933
|
-
* `subscribeScheduledJobs` so it stops re-living the bug that split
|
|
3934
|
-
* already fixed once (CLIENT-05).
|
|
3935
|
-
*
|
|
3936
|
-
* The identity guard is `conn.socket !== socket`, re-checked before every
|
|
3937
|
-
* action below. `conn.socket` is reassigned to a new attempt's socket
|
|
3938
|
-
* synchronously — right here, before `open` ever fires — so an older
|
|
3939
|
-
* attempt's guard trips the instant it's superseded, even if its
|
|
3940
|
-
* underlying socket only fires its real `close`/`error` much later. This
|
|
3941
|
-
* ordering is load-bearing: preserve it exactly.
|
|
3942
|
-
*/
|
|
3943
|
-
private openManagedSocket;
|
|
3944
3910
|
/** Construct the shard socket and wire its lifecycle handlers. The connection must already be in the `connecting` state. */
|
|
3945
3911
|
private openSocket;
|
|
3946
3912
|
/**
|
|
@@ -3949,27 +3915,6 @@ declare class LunoraClient {
|
|
|
3949
3915
|
*/
|
|
3950
3916
|
private cancelStream;
|
|
3951
3917
|
private handleDisconnect;
|
|
3952
|
-
/**
|
|
3953
|
-
* Begin the keepalive heartbeat on an open connection attempt — the only
|
|
3954
|
-
* caller is {@link openManagedSocket}'s own `open` handler, so both the
|
|
3955
|
-
* shard socket and `subscribeScheduledJobs` share this one implementation
|
|
3956
|
-
* instead of each hand-rolling their own (plan 217, generalized).
|
|
3957
|
-
*
|
|
3958
|
-
* Each tick first checks the half-open watchdog (see
|
|
3959
|
-
* {@link ManagedSocketState.lastFrameAt}): if no frame at all has arrived
|
|
3960
|
-
* within `heartbeatIntervalMs * 2.5`, the far end has gone quiet without
|
|
3961
|
-
* the socket ever firing `close` — force it closed and report it through
|
|
3962
|
-
* `onWatchdogTrip` (the caller's `onClose`) so the normal reconnect/backoff
|
|
3963
|
-
* takes over instead of every live query on it silently staling forever.
|
|
3964
|
-
* Otherwise it sends a {@link WS_KEEPALIVE_PING} text frame the server
|
|
3965
|
-
* answers from its hibernation auto-response without waking the DO. A
|
|
3966
|
-
* no-op when the heartbeat is disabled (an interval of zero or less);
|
|
3967
|
-
* idempotent — any existing timer is cleared first so a reconnect can't
|
|
3968
|
-
* leak intervals.
|
|
3969
|
-
*/
|
|
3970
|
-
private startHeartbeat;
|
|
3971
|
-
/** Clear a connection's keepalive timer, if any. Safe to call repeatedly. */
|
|
3972
|
-
private stopHeartbeat;
|
|
3973
3918
|
/** Mark every subscription bound to `shardKey` as needing a fresh ack. */
|
|
3974
3919
|
private markShardPendingAck;
|
|
3975
3920
|
/**
|
|
@@ -4006,17 +3951,10 @@ declare class LunoraClient {
|
|
|
4006
3951
|
private sendShapeSubscribeIfOpen;
|
|
4007
3952
|
private handleServerMessage;
|
|
4008
3953
|
private handleErrorMessage;
|
|
4009
|
-
/** Buffer key for an in-flight poke: `pokeId` is only unique per shard socket, so it is scoped by connection. */
|
|
4010
|
-
private pokeBufferKey;
|
|
4011
|
-
private handlePokeStart;
|
|
4012
|
-
private handlePokePart;
|
|
4013
3954
|
private handlePokeEnd;
|
|
4014
3955
|
/**
|
|
4015
|
-
* Commit one shape's slice of a poke
|
|
4016
|
-
*
|
|
4017
|
-
* Split out of {@link handlePokeEnd} because every decision here is PER SHAPE
|
|
4018
|
-
* — the reset flag, the base checkpoint, the watermark — while the poke
|
|
4019
|
-
* envelope around it is not.
|
|
3956
|
+
* Commit one shape's slice of a poke. The decision and the state change live in
|
|
3957
|
+
* `commitPokeSlice`; this method only performs the I/O that follows it.
|
|
4020
3958
|
*/
|
|
4021
3959
|
private applyPokePart;
|
|
4022
3960
|
/**
|
|
@@ -4028,8 +3966,6 @@ declare class LunoraClient {
|
|
|
4028
3966
|
* path's re-seed on a diverged base.
|
|
4029
3967
|
*/
|
|
4030
3968
|
private resnapshotSubscription;
|
|
4031
|
-
/** Materialize a shape's keyed view to an array and invoke its callbacks. */
|
|
4032
|
-
private emitShapeRows;
|
|
4033
3969
|
/**
|
|
4034
3970
|
* Apply one `data` frame. `snapshotMark` is set only for a frame synthesized
|
|
4035
3971
|
* by a poll, which carries no cursor: see {@link pollSubscriptions}.
|
|
@@ -4063,19 +3999,6 @@ declare class LunoraClient {
|
|
|
4063
3999
|
* client must re-render changed, but the resume position may have moved".
|
|
4064
4000
|
*/
|
|
4065
4001
|
private ackAndAdvanceCursor;
|
|
4066
|
-
/**
|
|
4067
|
-
* Resolve the value to publish for a `data`/`delta` frame.
|
|
4068
|
-
*
|
|
4069
|
-
* A `data` frame is an authoritative snapshot (the server re-execution path)
|
|
4070
|
-
* and always replaces the cached value wholesale. A `delta` frame carrying a
|
|
4071
|
-
* structured `MutationDelta` (the `broadcastDelta` row-change path) is
|
|
4072
|
-
* merged incrementally into the cached list — preserving order, no dup/loss —
|
|
4073
|
-
* so each subscription (including every paginated page) updates by delta
|
|
4074
|
-
* rather than a full re-send. We fall back to full replacement when the
|
|
4075
|
-
* delta isn't a recognisable row change, when there's no cached value yet,
|
|
4076
|
-
* or when it can't be applied cleanly against the current cached shape.
|
|
4077
|
-
*/
|
|
4078
|
-
private resolveDataPayload;
|
|
4079
4002
|
/** Route an inbound whisper to the topic's handlers on the originating shard. */
|
|
4080
4003
|
private dispatchWhisper;
|
|
4081
4004
|
/** Notify every {@link onTokenExpired} listener (best-effort, listener throws swallowed). */
|
|
@@ -4715,12 +4638,5 @@ declare class LunoraClient {
|
|
|
4715
4638
|
* @returns the writes that must be re-queued (kept slots), in input order
|
|
4716
4639
|
*/
|
|
4717
4640
|
private settleReplayBatchSlots;
|
|
4718
|
-
/**
|
|
4719
|
-
* Settle one batch slot that answered with a result. Decoded per slot: one
|
|
4720
|
-
* result the codec refuses must not abandon the slots after it (committed
|
|
4721
|
-
* writes left pending and unsettled for the rest of the session), and its
|
|
4722
|
-
* own write DID commit.
|
|
4723
|
-
*/
|
|
4724
|
-
private settleReplayBatchResult;
|
|
4725
4641
|
}
|
|
4726
4642
|
export { ServerMessage as $, ActionCallOptions as A, BookmarkStorage as B, ConnectionStatus as C, DEFAULT_MAX_BUFFER as D, OutboxMutation as E, FunctionArgumentDescriptor as F, GlobalFacetResult as G, HttpStreamRef as H, OutboxSink as I, PersistedMutation as J, ReplayCredential as K, LunoraClient as L, MutationCallOptions as M, ReplayIdentityVerdict as N, OfflineQueueOptions as O, Preloaded as P, QueryCacheAdapter as Q, ReconnectOptions as R, SubscriptionError as S, RowOp as T, User as U, RpcEnvelope as V, RpcResponseBody as W, ScheduleRecord as X, ScheduleRetryPolicy as Y, SchedulerPoolStatus as Z, SchedulerStatus as _, Unsubscribe as a, ServerPokeEndMessage as a0, ServerPokePartMessage as a1, ServerPokeStartMessage as a2, ShardTrafficEntry as a3, ShardTrafficResult as a4, StorageListPage as a5, StorageObject as a6, StoredQuery as a7, StreamHandle as a8, SubscriptionCallback as a9, SubscriptionRegistry as aa, SubscriptionState as ab, SyncWatermark as ac, WorkflowInstanceAction as ad, WorkflowInstanceDetail as ae, WorkflowInstancePage as af, WorkflowInstanceStatus as ag, WorkflowInstanceSummary as ah, WorkflowStepDetail as ai, WsTokenProvider as aj, createClientQuery as ak, createLocalStore as al, createStream as am, SubscriptionErrorCallback as b, PersistenceAdapter as c, HttpStreamArgsOf as d, HttpStreamChunkOf as e, StreamIterable as f, BatchSlot as g, CachedQuery as h, ClientDebugShard as i, ClientDebugSnapshot as j, ClientDebugSubscription as k, ClientMessage as l, ClientQueryRef as m, ClientShapeSubscribeMessage as n, ClientShapeUnsubscribeMessage as o, FunctionDescriptor as p, GlobalFacetValue as q, GlobalFilterClause as r, GlobalTableInfo as s, GlobalTablePage as t, HttpStreamCallArgs as u, LunoraClientError as v, LunoraClientOptions as w, MutationSettledEvent as x, OptimisticLocalStore as y, OptimisticUpdate as z };
|