@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.
- package/dist/auth/index.d.mts +1 -1
- package/dist/auth/index.d.ts +1 -1
- package/dist/index.d.mts +29 -4
- package/dist/index.d.ts +29 -4
- package/dist/index.mjs +3 -3
- package/dist/packem_shared/{LunoraClient-Bsv8immC.mjs → LunoraClient-C4eFp92b.mjs} +157 -105
- package/dist/packem_shared/{OfflineQueue-D-ASeqL7.mjs → OfflineQueue-eJBiWPfg.mjs} +4 -1
- package/dist/packem_shared/createLocalStore-IOur0jHF.mjs +1 -0
- package/dist/packem_shared/{createServerClient-DucOyOz3.mjs → createServerClient-PHoMdNGJ.mjs} +1 -1
- package/dist/packem_shared/local-store-BNgN3Dw3.mjs +111 -0
- package/dist/packem_shared/{lunora-client.d-CeUZ8lE1.d.mts → lunora-client.d-CfwxuJo8.d.mts} +114 -23
- package/dist/packem_shared/{lunora-client.d-CeUZ8lE1.d.ts → lunora-client.d-CfwxuJo8.d.ts} +114 -23
- package/dist/packem_shared/{preload.d-DipqU0PI.d.mts → preload.d-Bbn8plix.d.mts} +1 -1
- package/dist/packem_shared/{preload.d-CzHLgVfw.d.ts → preload.d-DuMetDdU.d.ts} +1 -1
- package/dist/query/index.d.mts +2 -2
- package/dist/query/index.d.ts +2 -2
- package/dist/ssr/index.d.mts +3 -3
- package/dist/ssr/index.d.ts +3 -3
- package/dist/ssr/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/packem_shared/createLocalStore-DSUfoLqY.mjs +0 -36
package/dist/ssr/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { P as Preloaded, L as LunoraClient } from "../packem_shared/lunora-client.d-
|
|
2
|
-
export type { A as ArgsOf, F as FunctionReference, R as ReturnOf } from "../packem_shared/lunora-client.d-
|
|
3
|
-
export { p as preloadQuery, a as preloadedQueryResult } from "../packem_shared/preload.d-
|
|
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.
|
package/dist/ssr/index.mjs
CHANGED
|
@@ -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-
|
|
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,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 };
|