@bounded-sh/core 0.0.53-next.0 → 0.0.53

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.
@@ -53,6 +53,27 @@ export declare function forceReconnectV2(): Promise<void>;
53
53
  * Returns true if there is an active v2 WebSocket connection open.
54
54
  */
55
55
  export declare function hasActiveConnection(): boolean;
56
+ /**
57
+ * v2 socket-when-warm transport for named/computed query polls (subscribeQuery /
58
+ * runQuery). Runs `queries` over the ambient per-app authenticated socket instead
59
+ * of HTTP `POST /queries`, but ONLY when that is observably safe and identity-correct:
60
+ * - a warm, OPEN, non-authenticating app socket already exists (never opens one);
61
+ * - the server advertised `capabilities.runQuery` on the authenticated ack;
62
+ * - the socket's authenticated principal matches the caller's CURRENT identity
63
+ * (else read rules would evaluate for the wrong user) - reuses the same gate as
64
+ * reliable live intents;
65
+ * - the serialized frame fits the WS message limit.
66
+ * Returns the per-row array on a clean socket success; returns null - meaning
67
+ * "fall back to HTTP" - for every miss/refusal (no socket, no capability, identity
68
+ * skew, oversized batch, the server's own `{ useHttp: true }` deferral, or any
69
+ * timeout / disconnect / error frame). The rows are byte-identical to POST /queries,
70
+ * so the caller is transport-agnostic and never observes which transport won.
71
+ */
72
+ export declare function runNamedQueriesOverSocket(appId: string, queries: Array<{
73
+ path: string;
74
+ queryName: string;
75
+ queryArgs: any;
76
+ }>, isServer: boolean): Promise<any[] | null>;
56
77
  /**
57
78
  * Send a live-room intent over the EXISTING per-room socket (fire-and-forget).
58
79
  * Returns true if it was sent over an open connection, false if there is no