@lunora/client 1.0.0-alpha.8 → 1.0.0-alpha.9

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,6 +1,6 @@
1
- import { P as Preloaded, L as LunoraClient } from "../packem_shared/lunora-client.d-CeUZ8lE1.js";
2
- export type { A as ArgsOf, F as FunctionReference, R as ReturnOf } from "../packem_shared/lunora-client.d-CeUZ8lE1.js";
3
- export { p as preloadQuery, a as preloadedQueryResult } from "../packem_shared/preload.d-CzHLgVfw.js";
1
+ import { P as Preloaded, L as LunoraClient } from "../packem_shared/lunora-client.d-CfwxuJo8.js";
2
+ export type { A as ArgsOf, F as FunctionReference, R as ReturnOf } from "../packem_shared/lunora-client.d-CfwxuJo8.js";
3
+ export { p as preloadQuery, a as preloadedQueryResult } from "../packem_shared/preload.d-DuMetDdU.js";
4
4
  import '@lunora/runtime';
5
5
  /**
6
6
  * Structural shape of a better-auth `getSession` call's resolved value.
@@ -1,4 +1,4 @@
1
1
  export { getServerSession } from '../packem_shared/getServerSession-8jXewqxd.mjs';
2
2
  export { deserializePreloaded, serializePreloaded } from '../packem_shared/deserializePreloaded-C0eJTY_W.mjs';
3
- export { createServerClient } from '../packem_shared/createServerClient-DucOyOz3.mjs';
3
+ export { createServerClient } from '../packem_shared/createServerClient-PHoMdNGJ.mjs';
4
4
  export { preloadQuery, preloadedQueryResult } from '../packem_shared/preloadQuery-lobFkD2Z.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/client",
3
- "version": "1.0.0-alpha.8",
3
+ "version": "1.0.0-alpha.9",
4
4
  "description": "Lunora browser SDK: WebSocket transport, optimistic updates, and an offline mutation queue",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -1,36 +0,0 @@
1
- const createLocalStore = (subscriptions, shardKey, write, stableStringify) => {
2
- const rollbacks = [];
3
- const findState = (functionRef, argsKey) => {
4
- for (const state of subscriptions.all()) {
5
- if (state.fn.__lunoraRef === functionRef && state.shardKey === shardKey && state.argsKey === argsKey) {
6
- return state;
7
- }
8
- }
9
- return void 0;
10
- };
11
- const store = {
12
- getAllQueries: (function_) => {
13
- const matches = [];
14
- for (const state of subscriptions.all()) {
15
- if (state.fn.__lunoraRef === function_.__lunoraRef && state.shardKey === shardKey) {
16
- matches.push({ args: state.args, value: state.lastValue });
17
- }
18
- }
19
- return matches;
20
- },
21
- getQuery: (function_, args) => {
22
- const state = findState(function_.__lunoraRef, stableStringify(args ?? {}));
23
- return state?.lastValue;
24
- },
25
- setQuery: (function_, args, value) => {
26
- const state = findState(function_.__lunoraRef, stableStringify(args ?? {}));
27
- if (!state) {
28
- return;
29
- }
30
- rollbacks.push(write(state, value));
31
- }
32
- };
33
- return { rollbacks, store };
34
- };
35
-
36
- export { createLocalStore };