@lunora/client 1.0.0-alpha.12 → 1.0.0-alpha.13
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/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.mjs +4 -4
- package/dist/packem_shared/{LunoraClient-wh6w9Ivn.mjs → LunoraClient-cxtxdYiI.mjs} +3 -3
- package/dist/packem_shared/{OfflineQueue-BI0FNNvc.mjs → OfflineQueue-GGYJRmhF.mjs} +1 -1
- package/dist/packem_shared/{createInMemoryPersistence-DlFjWtOm.mjs → createInMemoryPersistence-CY6F0ZvQ.mjs} +1 -1
- package/dist/packem_shared/{createInMemoryQueryCache-4AkTV38-.mjs → createInMemoryQueryCache-Bv4Ruv6n.mjs} +2 -2
- package/dist/packem_shared/{createServerClient-C5GMCGSQ.mjs → createServerClient-DQu_BVen.mjs} +1 -1
- package/dist/packem_shared/{offline-queue-7Wc4onA0.mjs → offline-queue-B9vfdSqp.mjs} +7 -1
- package/dist/ssr/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -311,7 +311,7 @@ declare class OfflineQueue {
|
|
|
311
311
|
*/
|
|
312
312
|
declare const createInMemoryPersistence: () => PersistenceAdapter;
|
|
313
313
|
interface IndexedDbPersistenceOptions {
|
|
314
|
-
/** Database name; defaults to `"lunora"
|
|
314
|
+
/** Database name; defaults to `"lunora-outbox"` (its own DB, separate from the read cache). */
|
|
315
315
|
databaseName?: string;
|
|
316
316
|
/** Injectable `IDBFactory` (e.g. `fake-indexeddb` in tests); defaults to the global `indexedDB`. */
|
|
317
317
|
indexedDB?: IDBFactory;
|
|
@@ -364,7 +364,7 @@ declare const createInMemoryQueryCache: (options?: {
|
|
|
364
364
|
maxEntries?: number;
|
|
365
365
|
}) => QueryCacheAdapter;
|
|
366
366
|
interface IndexedDbQueryCacheOptions {
|
|
367
|
-
/** Database name; defaults to `"lunora"` (
|
|
367
|
+
/** Database name; defaults to `"lunora-query-cache"` (its own DB, separate from the offline outbox). */
|
|
368
368
|
databaseName?: string;
|
|
369
369
|
/** Injectable `IDBFactory` (e.g. `fake-indexeddb` in tests); defaults to the global `indexedDB`. */
|
|
370
370
|
indexedDB?: IDBFactory;
|
|
@@ -379,11 +379,11 @@ interface IndexedDbQueryCacheOptions {
|
|
|
379
379
|
* LRU eviction. The store handle is opened lazily and cached, so repeated ops
|
|
380
380
|
* reuse one connection.
|
|
381
381
|
*
|
|
382
|
-
* The store lives in
|
|
383
|
-
*
|
|
384
|
-
*
|
|
385
|
-
* `IDBFactory` is available — callers in non-browser
|
|
386
|
-
* {@link createInMemoryQueryCache}.
|
|
382
|
+
* The store lives in its own `lunora-query-cache` database — deliberately
|
|
383
|
+
* separate from the offline-mutation outbox's `lunora-outbox` database so the two
|
|
384
|
+
* independently-toggleable adapters never share (and drift on) a schema version.
|
|
385
|
+
* Throws eagerly if no `IDBFactory` is available — callers in non-browser
|
|
386
|
+
* environments should use {@link createInMemoryQueryCache}.
|
|
387
387
|
*/
|
|
388
388
|
declare const createIndexedDbQueryCache: (options?: IndexedDbQueryCacheOptions) => QueryCacheAdapter;
|
|
389
389
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -311,7 +311,7 @@ declare class OfflineQueue {
|
|
|
311
311
|
*/
|
|
312
312
|
declare const createInMemoryPersistence: () => PersistenceAdapter;
|
|
313
313
|
interface IndexedDbPersistenceOptions {
|
|
314
|
-
/** Database name; defaults to `"lunora"
|
|
314
|
+
/** Database name; defaults to `"lunora-outbox"` (its own DB, separate from the read cache). */
|
|
315
315
|
databaseName?: string;
|
|
316
316
|
/** Injectable `IDBFactory` (e.g. `fake-indexeddb` in tests); defaults to the global `indexedDB`. */
|
|
317
317
|
indexedDB?: IDBFactory;
|
|
@@ -364,7 +364,7 @@ declare const createInMemoryQueryCache: (options?: {
|
|
|
364
364
|
maxEntries?: number;
|
|
365
365
|
}) => QueryCacheAdapter;
|
|
366
366
|
interface IndexedDbQueryCacheOptions {
|
|
367
|
-
/** Database name; defaults to `"lunora"` (
|
|
367
|
+
/** Database name; defaults to `"lunora-query-cache"` (its own DB, separate from the offline outbox). */
|
|
368
368
|
databaseName?: string;
|
|
369
369
|
/** Injectable `IDBFactory` (e.g. `fake-indexeddb` in tests); defaults to the global `indexedDB`. */
|
|
370
370
|
indexedDB?: IDBFactory;
|
|
@@ -379,11 +379,11 @@ interface IndexedDbQueryCacheOptions {
|
|
|
379
379
|
* LRU eviction. The store handle is opened lazily and cached, so repeated ops
|
|
380
380
|
* reuse one connection.
|
|
381
381
|
*
|
|
382
|
-
* The store lives in
|
|
383
|
-
*
|
|
384
|
-
*
|
|
385
|
-
* `IDBFactory` is available — callers in non-browser
|
|
386
|
-
* {@link createInMemoryQueryCache}.
|
|
382
|
+
* The store lives in its own `lunora-query-cache` database — deliberately
|
|
383
|
+
* separate from the offline-mutation outbox's `lunora-outbox` database so the two
|
|
384
|
+
* independently-toggleable adapters never share (and drift on) a schema version.
|
|
385
|
+
* Throws eagerly if no `IDBFactory` is available — callers in non-browser
|
|
386
|
+
* environments should use {@link createInMemoryQueryCache}.
|
|
387
387
|
*/
|
|
388
388
|
declare const createIndexedDbQueryCache: (options?: IndexedDbQueryCacheOptions) => QueryCacheAdapter;
|
|
389
389
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -3,13 +3,13 @@ export { default as createInMemoryBookmarkStorage } from './packem_shared/create
|
|
|
3
3
|
export { applyDelta, isMutationDelta } from './packem_shared/applyDelta-4jFGTPA3.mjs';
|
|
4
4
|
export { CONFLICT_ERROR_CODE, isConflictError } from './packem_shared/CONFLICT_ERROR_CODE-aUdVbEDw.mjs';
|
|
5
5
|
export { c as createLocalStore } from './packem_shared/local-store-BNgN3Dw3.mjs';
|
|
6
|
-
export { LunoraClient } from './packem_shared/LunoraClient-
|
|
6
|
+
export { LunoraClient } from './packem_shared/LunoraClient-cxtxdYiI.mjs';
|
|
7
7
|
export { createMutationRunner } from './packem_shared/createMutationRunner-BqsavzvG.mjs';
|
|
8
8
|
export { createMutatorRunner } from './packem_shared/createMutatorRunner-BETvCd0p.mjs';
|
|
9
|
-
export { O as OfflineQueue } from './packem_shared/offline-queue-
|
|
10
|
-
export { createInMemoryPersistence, createIndexedDbPersistence } from './packem_shared/createInMemoryPersistence-
|
|
9
|
+
export { O as OfflineQueue } from './packem_shared/offline-queue-B9vfdSqp.mjs';
|
|
10
|
+
export { createInMemoryPersistence, createIndexedDbPersistence } from './packem_shared/createInMemoryPersistence-CY6F0ZvQ.mjs';
|
|
11
11
|
export { preloadQuery, preloadedQueryResult } from './packem_shared/preloadQuery-lobFkD2Z.mjs';
|
|
12
|
-
export { createInMemoryQueryCache, createIndexedDbQueryCache, queryCacheKey } from './packem_shared/createInMemoryQueryCache-
|
|
12
|
+
export { createInMemoryQueryCache, createIndexedDbQueryCache, queryCacheKey } from './packem_shared/createInMemoryQueryCache-Bv4Ruv6n.mjs';
|
|
13
13
|
export { createReconnect } from './packem_shared/createReconnect-Di_-oHH7.mjs';
|
|
14
14
|
export { DEFAULT_MAX_BUFFER, createStream } from './packem_shared/DEFAULT_MAX_BUFFER-BDkqO5PW.mjs';
|
|
15
15
|
export { S as SubscriptionRegistry } from './packem_shared/subscription-DoyO04-2.mjs';
|
|
@@ -2,9 +2,9 @@ import { S as SubscriptionRegistry, s as stableStringify } from './subscription-
|
|
|
2
2
|
import createInMemoryBookmarkStorage from './createInMemoryBookmarkStorage-BoN7a7TH.mjs';
|
|
3
3
|
import { isMutationDelta, applyDelta } from './applyDelta-4jFGTPA3.mjs';
|
|
4
4
|
import { a as applyOptimisticLayer, d as dropConfirmedLayers, n as notifySubscription, f as foldOptimistic, c as createLocalStore } from './local-store-BNgN3Dw3.mjs';
|
|
5
|
-
import { O as OfflineQueue, n as nextId, i as isStaleVersion, r as reportPersistenceError } from './offline-queue-
|
|
6
|
-
import { resolvePersistenceAdapter } from './createInMemoryPersistence-
|
|
7
|
-
import { resolveQueryCacheAdapter, queryCacheKey } from './createInMemoryQueryCache-
|
|
5
|
+
import { O as OfflineQueue, n as nextId, i as isStaleVersion, r as reportPersistenceError } from './offline-queue-B9vfdSqp.mjs';
|
|
6
|
+
import { resolvePersistenceAdapter } from './createInMemoryPersistence-CY6F0ZvQ.mjs';
|
|
7
|
+
import { resolveQueryCacheAdapter, queryCacheKey } from './createInMemoryQueryCache-Bv4Ruv6n.mjs';
|
|
8
8
|
import { createReconnect } from './createReconnect-Di_-oHH7.mjs';
|
|
9
9
|
import { createStream } from './DEFAULT_MAX_BUFFER-BDkqO5PW.mjs';
|
|
10
10
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { O as OfflineQueue, n as nextId, r as reportPersistenceError } from './offline-queue-
|
|
1
|
+
export { O as OfflineQueue, n as nextId, r as reportPersistenceError } from './offline-queue-B9vfdSqp.mjs';
|
|
@@ -25,7 +25,7 @@ const createInMemoryPersistence = () => {
|
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
|
-
const DEFAULT_DATABASE = "lunora";
|
|
28
|
+
const DEFAULT_DATABASE = "lunora-outbox";
|
|
29
29
|
const DEFAULT_STORE = "offline-mutations";
|
|
30
30
|
const ID_INDEX = "by_id";
|
|
31
31
|
const promisifyRequest = (request) => new Promise((resolve, reject) => {
|
|
@@ -35,10 +35,10 @@ const createInMemoryQueryCache = (options = {}) => {
|
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
|
-
const DEFAULT_DATABASE = "lunora";
|
|
38
|
+
const DEFAULT_DATABASE = "lunora-query-cache";
|
|
39
39
|
const DEFAULT_STORE = "query-cache";
|
|
40
40
|
const TS_INDEX = "by_ts";
|
|
41
|
-
const DATABASE_VERSION =
|
|
41
|
+
const DATABASE_VERSION = 1;
|
|
42
42
|
const promisifyRequest = (request) => new Promise((resolve, reject) => {
|
|
43
43
|
request.addEventListener("success", () => {
|
|
44
44
|
resolve(request.result);
|
|
@@ -84,7 +84,13 @@ class OfflineQueue {
|
|
|
84
84
|
if (!this.persistence) {
|
|
85
85
|
return [];
|
|
86
86
|
}
|
|
87
|
-
|
|
87
|
+
let persisted;
|
|
88
|
+
try {
|
|
89
|
+
persisted = await this.persistence.load();
|
|
90
|
+
} catch (error) {
|
|
91
|
+
reportPersistenceError(this.onPersistenceError, "load", error);
|
|
92
|
+
throw error;
|
|
93
|
+
}
|
|
88
94
|
const shardKeys = /* @__PURE__ */ new Set();
|
|
89
95
|
for (const mutation of persisted) {
|
|
90
96
|
if (this.items.some((item) => item.id === mutation.id)) {
|
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-DQu_BVen.mjs';
|
|
4
4
|
export { preloadQuery, preloadedQueryResult } from '../packem_shared/preloadQuery-lobFkD2Z.mjs';
|