@lunora/db 1.0.0-alpha.40 → 1.0.0-alpha.41
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/collections/index.d.mts +1 -1
- package/dist/collections/index.d.ts +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/mutators/index.d.mts +1 -1
- package/dist/mutators/index.d.ts +1 -1
- package/dist/packem_shared/{define-collections.d-DAFPHFxr.d.ts → define-collections.d-BcQg0ibQ.d.ts} +1 -1
- package/dist/packem_shared/{define-collections.d-C6J1Y4Q_.d.mts → define-collections.d-CK7jEXQJ.d.mts} +1 -1
- package/dist/packem_shared/{define-mutators.d-BXQN7fju.d.mts → define-mutators.d-D51n_r1n.d.mts} +8 -8
- package/dist/packem_shared/{define-mutators.d-DLP_vYu9.d.ts → define-mutators.d-DuAmdkYR.d.ts} +8 -8
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { type C as CheckpointRegistry, type L as LunoraCollectionConfig, type a as LunoraCollectionOptions, c as createCheckpointRegistry, l as lunoraCollectionOptions } from "../packem_shared/collection-options.d-B_2IXvdU.mjs";
|
|
2
|
-
export { type C as CollectionDef, type I as InsertBinding, type L as LunoraDb, d as defineCollections } from "../packem_shared/define-collections.d-
|
|
2
|
+
export { type C as CollectionDef, type I as InsertBinding, type L as LunoraDb, d as defineCollections } from "../packem_shared/define-collections.d-CK7jEXQJ.mjs";
|
|
3
3
|
import '@lunora/client';
|
|
4
4
|
import '@tanstack/db';
|
|
5
5
|
import '@tanstack/offline-transactions';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { type C as CheckpointRegistry, type L as LunoraCollectionConfig, type a as LunoraCollectionOptions, c as createCheckpointRegistry, l as lunoraCollectionOptions } from "../packem_shared/collection-options.d-B_2IXvdU.js";
|
|
2
|
-
export { type C as CollectionDef, type I as InsertBinding, type L as LunoraDb, d as defineCollections } from "../packem_shared/define-collections.d-
|
|
2
|
+
export { type C as CollectionDef, type I as InsertBinding, type L as LunoraDb, d as defineCollections } from "../packem_shared/define-collections.d-BcQg0ibQ.js";
|
|
3
3
|
import '@lunora/client';
|
|
4
4
|
import '@tanstack/db';
|
|
5
5
|
import '@tanstack/offline-transactions';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Collection } from '@tanstack/db';
|
|
2
2
|
import { R as Row } from "./packem_shared/collection-options.d-B_2IXvdU.mjs";
|
|
3
3
|
export { b as CHECKPOINT_FALLBACK_MS, type d as CheckpointFallbackEvent, type C as CheckpointRegistry, type e as CheckpointRegistryOptions, type f as CheckpointRegistryStats, type g as CheckpointWatermark, type E as ExecutorOutboxSinkOptions, type L as LunoraCollectionConfig, type a as LunoraCollectionOptions, O as OUTBOX_MUTATION_FN_NAME, type h as OutboxExecutor, type i as OutboxMutationMetadata, type S as SyncWriter, c as createCheckpointRegistry, j as createExecutorOutboxSink, k as createOptimisticOnlineDetector, m as getShardCheckpoints, l as lunoraCollectionOptions, n as makeDiffEmit, r as releaseShardCheckpoints, o as runOutboxMutation, s as shardCheckpointStats, t as toMap } from "./packem_shared/collection-options.d-B_2IXvdU.mjs";
|
|
4
|
-
export { type C as CollectionDef, type D as DefineCollectionsOptions, type I as InsertBinding, type L as LunoraDb, type W as WriteRejectedEvent, d as defineCollections } from "./packem_shared/define-collections.d-
|
|
5
|
-
export { type B as BindMutatorsContext, type a as BoundMutatorApi, type b as BoundMutators, type C as ClientMutatorContext, type c as ClientMutatorDef, type d as CollectionMap, D as DIRECT_TRANSACTION_METADATA_KEY, type g as MutatorReference, type M as MutatorRejectedEvent, e as bindMutators, f as defineMutator, i as initMutators } from "./packem_shared/define-mutators.d-
|
|
4
|
+
export { type C as CollectionDef, type D as DefineCollectionsOptions, type I as InsertBinding, type L as LunoraDb, type W as WriteRejectedEvent, d as defineCollections } from "./packem_shared/define-collections.d-CK7jEXQJ.mjs";
|
|
5
|
+
export { type B as BindMutatorsContext, type a as BoundMutatorApi, type b as BoundMutators, type C as ClientMutatorContext, type c as ClientMutatorDef, type d as CollectionMap, D as DIRECT_TRANSACTION_METADATA_KEY, type g as MutatorReference, type M as MutatorRejectedEvent, e as bindMutators, f as defineMutator, i as initMutators } from "./packem_shared/define-mutators.d-D51n_r1n.mjs";
|
|
6
6
|
import '@lunora/client';
|
|
7
7
|
import '@tanstack/offline-transactions';
|
|
8
8
|
/** One row to insert. `_id` may be pre-minted client-side so the optimistic row keys match the persisted one. */
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Collection } from '@tanstack/db';
|
|
2
2
|
import { R as Row } from "./packem_shared/collection-options.d-B_2IXvdU.js";
|
|
3
3
|
export { b as CHECKPOINT_FALLBACK_MS, type d as CheckpointFallbackEvent, type C as CheckpointRegistry, type e as CheckpointRegistryOptions, type f as CheckpointRegistryStats, type g as CheckpointWatermark, type E as ExecutorOutboxSinkOptions, type L as LunoraCollectionConfig, type a as LunoraCollectionOptions, O as OUTBOX_MUTATION_FN_NAME, type h as OutboxExecutor, type i as OutboxMutationMetadata, type S as SyncWriter, c as createCheckpointRegistry, j as createExecutorOutboxSink, k as createOptimisticOnlineDetector, m as getShardCheckpoints, l as lunoraCollectionOptions, n as makeDiffEmit, r as releaseShardCheckpoints, o as runOutboxMutation, s as shardCheckpointStats, t as toMap } from "./packem_shared/collection-options.d-B_2IXvdU.js";
|
|
4
|
-
export { type C as CollectionDef, type D as DefineCollectionsOptions, type I as InsertBinding, type L as LunoraDb, type W as WriteRejectedEvent, d as defineCollections } from "./packem_shared/define-collections.d-
|
|
5
|
-
export { type B as BindMutatorsContext, type a as BoundMutatorApi, type b as BoundMutators, type C as ClientMutatorContext, type c as ClientMutatorDef, type d as CollectionMap, D as DIRECT_TRANSACTION_METADATA_KEY, type g as MutatorReference, type M as MutatorRejectedEvent, e as bindMutators, f as defineMutator, i as initMutators } from "./packem_shared/define-mutators.d-
|
|
4
|
+
export { type C as CollectionDef, type D as DefineCollectionsOptions, type I as InsertBinding, type L as LunoraDb, type W as WriteRejectedEvent, d as defineCollections } from "./packem_shared/define-collections.d-BcQg0ibQ.js";
|
|
5
|
+
export { type B as BindMutatorsContext, type a as BoundMutatorApi, type b as BoundMutators, type C as ClientMutatorContext, type c as ClientMutatorDef, type d as CollectionMap, D as DIRECT_TRANSACTION_METADATA_KEY, type g as MutatorReference, type M as MutatorRejectedEvent, e as bindMutators, f as defineMutator, i as initMutators } from "./packem_shared/define-mutators.d-DuAmdkYR.js";
|
|
6
6
|
import '@lunora/client';
|
|
7
7
|
import '@tanstack/offline-transactions';
|
|
8
8
|
/** One row to insert. `_id` may be pre-minted client-side so the optimistic row keys match the persisted one. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { type B as BindMutatorsContext, type a as BoundMutatorApi, type b as BoundMutators, type C as ClientMutatorContext, type c as ClientMutatorDef, type d as CollectionMap, type M as MutatorRejectedEvent, e as bindMutators, f as defineMutator, i as initMutators } from "../packem_shared/define-mutators.d-
|
|
1
|
+
export { type B as BindMutatorsContext, type a as BoundMutatorApi, type b as BoundMutators, type C as ClientMutatorContext, type c as ClientMutatorDef, type d as CollectionMap, type M as MutatorRejectedEvent, e as bindMutators, f as defineMutator, i as initMutators } from "../packem_shared/define-mutators.d-D51n_r1n.mjs";
|
|
2
2
|
import '@lunora/client';
|
|
3
3
|
import '@tanstack/db';
|
|
4
4
|
import "../packem_shared/collection-options.d-B_2IXvdU.mjs";
|
package/dist/mutators/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { type B as BindMutatorsContext, type a as BoundMutatorApi, type b as BoundMutators, type C as ClientMutatorContext, type c as ClientMutatorDef, type d as CollectionMap, type M as MutatorRejectedEvent, e as bindMutators, f as defineMutator, i as initMutators } from "../packem_shared/define-mutators.d-
|
|
1
|
+
export { type B as BindMutatorsContext, type a as BoundMutatorApi, type b as BoundMutators, type C as ClientMutatorContext, type c as ClientMutatorDef, type d as CollectionMap, type M as MutatorRejectedEvent, e as bindMutators, f as defineMutator, i as initMutators } from "../packem_shared/define-mutators.d-DuAmdkYR.js";
|
|
2
2
|
import '@lunora/client';
|
|
3
3
|
import '@tanstack/db';
|
|
4
4
|
import "../packem_shared/collection-options.d-B_2IXvdU.js";
|
package/dist/packem_shared/{define-collections.d-DAFPHFxr.d.ts → define-collections.d-BcQg0ibQ.d.ts}
RENAMED
|
@@ -59,7 +59,7 @@ interface CollectionDef<TList extends FunctionReference, TInput = never> {
|
|
|
59
59
|
type AnyDef = CollectionDef<any, any>;
|
|
60
60
|
/**
|
|
61
61
|
* The public row type a collection exposes — the element type of its `list`
|
|
62
|
-
* query's return, with no `& Row`: a `Collection
|
|
62
|
+
* query's return, with no `& Row`: a `Collection<T>` is invariant in `T`, so the
|
|
63
63
|
* exposed type must be exactly the document type, not a subtype.
|
|
64
64
|
*/
|
|
65
65
|
type RowOf<C extends AnyDef> = C["list"] extends FunctionReference<infer _K, infer _A, infer R> ? Element<R> : never;
|
|
@@ -59,7 +59,7 @@ interface CollectionDef<TList extends FunctionReference, TInput = never> {
|
|
|
59
59
|
type AnyDef = CollectionDef<any, any>;
|
|
60
60
|
/**
|
|
61
61
|
* The public row type a collection exposes — the element type of its `list`
|
|
62
|
-
* query's return, with no `& Row`: a `Collection
|
|
62
|
+
* query's return, with no `& Row`: a `Collection<T>` is invariant in `T`, so the
|
|
63
63
|
* exposed type must be exactly the document type, not a subtype.
|
|
64
64
|
*/
|
|
65
65
|
type RowOf<C extends AnyDef> = C["list"] extends FunctionReference<infer _K, infer _A, infer R> ? Element<R> : never;
|
package/dist/packem_shared/{define-mutators.d-BXQN7fju.d.mts → define-mutators.d-D51n_r1n.d.mts}
RENAMED
|
@@ -23,11 +23,11 @@ declare const DIRECT_TRANSACTION_METADATA_KEY = "__tanstack_db_direct";
|
|
|
23
23
|
* A map of wired collections, keyed by the name the optimistic bodies address them
|
|
24
24
|
* by.
|
|
25
25
|
*
|
|
26
|
-
* The row type is `any` on purpose. `Collection
|
|
26
|
+
* The row type is `any` on purpose. `Collection<T, string>` is **invariant** in
|
|
27
27
|
* `T` (its methods both consume and produce rows), so a concrete
|
|
28
|
-
* `Collection
|
|
29
|
-
* is why the previous `Record
|
|
30
|
-
* `as never` cast on every entry, and left `context.collections
|
|
28
|
+
* `Collection<Doc<"nodes"> & Row>` is NOT assignable to `Collection<Row>` — which
|
|
29
|
+
* is why the previous `Record<string, Collection<Row, string>>` forced an
|
|
30
|
+
* `as never` cast on every entry, and left `context.collections.<name>` too
|
|
31
31
|
* untyped to be worth using. Projects recover the concrete types by binding them
|
|
32
32
|
* once through {@link initMutators}.
|
|
33
33
|
*/
|
|
@@ -89,7 +89,7 @@ interface ClientMutatorDef<TArgs, TCollections extends CollectionMap = Collectio
|
|
|
89
89
|
*
|
|
90
90
|
* `context.collections` is typed by whatever map it is bound to — which for this
|
|
91
91
|
* standalone form is the widest one. Bind the concrete collections once with
|
|
92
|
-
* {@link initMutators} to get `collections
|
|
92
|
+
* {@link initMutators} to get `collections.<name>` typed inside `apply`.
|
|
93
93
|
*/
|
|
94
94
|
declare const defineMutator: {
|
|
95
95
|
<TArgs = Record<string, unknown>>(definition: {
|
|
@@ -218,17 +218,17 @@ interface BoundMutatorApi<TCollections extends CollectionMap> {
|
|
|
218
218
|
* Bind the mutator surface to **this project's** collections map, once.
|
|
219
219
|
*
|
|
220
220
|
* `Collection` is invariant in its row type, so a shared
|
|
221
|
-
* `Record
|
|
221
|
+
* `Record<string, Collection<Row, string>>` could neither accept a generated
|
|
222
222
|
* collection without an `as never` cast nor hand a usable type back to `apply` —
|
|
223
223
|
* which is why optimistic bodies tended to ignore `context.collections` and close
|
|
224
224
|
* over module-scope collection variables instead. Declaring the map once here
|
|
225
225
|
* fixes both ends: `bindMutators` takes the concrete collections cast-free, and
|
|
226
|
-
* `apply` reads `collections
|
|
226
|
+
* `apply` reads `collections.<name>` at its real row type.
|
|
227
227
|
*
|
|
228
228
|
* Runtime-identical to the standalone {@link defineMutator} / {@link bindMutators}
|
|
229
229
|
* (this returns those very functions); only the types narrow.
|
|
230
230
|
* @example
|
|
231
|
-
* const { bindMutators, defineMutator } = initMutators
|
|
231
|
+
* const { bindMutators, defineMutator } = initMutators<{ nodes: typeof wholeOutlineCollection }>();
|
|
232
232
|
* const setText = defineMutator({ apply: ({ collections }, args) => collections.nodes.update(args.id, setter), serverRef: api.mutators.setText });
|
|
233
233
|
*/
|
|
234
234
|
declare const initMutators: <TCollections extends CollectionMap>() => BoundMutatorApi<TCollections>;
|
package/dist/packem_shared/{define-mutators.d-DLP_vYu9.d.ts → define-mutators.d-DuAmdkYR.d.ts}
RENAMED
|
@@ -23,11 +23,11 @@ declare const DIRECT_TRANSACTION_METADATA_KEY = "__tanstack_db_direct";
|
|
|
23
23
|
* A map of wired collections, keyed by the name the optimistic bodies address them
|
|
24
24
|
* by.
|
|
25
25
|
*
|
|
26
|
-
* The row type is `any` on purpose. `Collection
|
|
26
|
+
* The row type is `any` on purpose. `Collection<T, string>` is **invariant** in
|
|
27
27
|
* `T` (its methods both consume and produce rows), so a concrete
|
|
28
|
-
* `Collection
|
|
29
|
-
* is why the previous `Record
|
|
30
|
-
* `as never` cast on every entry, and left `context.collections
|
|
28
|
+
* `Collection<Doc<"nodes"> & Row>` is NOT assignable to `Collection<Row>` — which
|
|
29
|
+
* is why the previous `Record<string, Collection<Row, string>>` forced an
|
|
30
|
+
* `as never` cast on every entry, and left `context.collections.<name>` too
|
|
31
31
|
* untyped to be worth using. Projects recover the concrete types by binding them
|
|
32
32
|
* once through {@link initMutators}.
|
|
33
33
|
*/
|
|
@@ -89,7 +89,7 @@ interface ClientMutatorDef<TArgs, TCollections extends CollectionMap = Collectio
|
|
|
89
89
|
*
|
|
90
90
|
* `context.collections` is typed by whatever map it is bound to — which for this
|
|
91
91
|
* standalone form is the widest one. Bind the concrete collections once with
|
|
92
|
-
* {@link initMutators} to get `collections
|
|
92
|
+
* {@link initMutators} to get `collections.<name>` typed inside `apply`.
|
|
93
93
|
*/
|
|
94
94
|
declare const defineMutator: {
|
|
95
95
|
<TArgs = Record<string, unknown>>(definition: {
|
|
@@ -218,17 +218,17 @@ interface BoundMutatorApi<TCollections extends CollectionMap> {
|
|
|
218
218
|
* Bind the mutator surface to **this project's** collections map, once.
|
|
219
219
|
*
|
|
220
220
|
* `Collection` is invariant in its row type, so a shared
|
|
221
|
-
* `Record
|
|
221
|
+
* `Record<string, Collection<Row, string>>` could neither accept a generated
|
|
222
222
|
* collection without an `as never` cast nor hand a usable type back to `apply` —
|
|
223
223
|
* which is why optimistic bodies tended to ignore `context.collections` and close
|
|
224
224
|
* over module-scope collection variables instead. Declaring the map once here
|
|
225
225
|
* fixes both ends: `bindMutators` takes the concrete collections cast-free, and
|
|
226
|
-
* `apply` reads `collections
|
|
226
|
+
* `apply` reads `collections.<name>` at its real row type.
|
|
227
227
|
*
|
|
228
228
|
* Runtime-identical to the standalone {@link defineMutator} / {@link bindMutators}
|
|
229
229
|
* (this returns those very functions); only the types narrow.
|
|
230
230
|
* @example
|
|
231
|
-
* const { bindMutators, defineMutator } = initMutators
|
|
231
|
+
* const { bindMutators, defineMutator } = initMutators<{ nodes: typeof wholeOutlineCollection }>();
|
|
232
232
|
* const setText = defineMutator({ apply: ({ collections }, args) => collections.nodes.update(args.id, setter), serverRef: api.mutators.setText });
|
|
233
233
|
*/
|
|
234
234
|
declare const initMutators: <TCollections extends CollectionMap>() => BoundMutatorApi<TCollections>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/db",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.41",
|
|
4
4
|
"description": "TanStack DB binding: typed, live-synced collections and a durable offline outbox over the Lunora client",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"access": "public"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@lunora/client": "1.0.0-alpha.
|
|
58
|
-
"@lunora/errors": "1.0.0-alpha.
|
|
57
|
+
"@lunora/client": "1.0.0-alpha.40",
|
|
58
|
+
"@lunora/errors": "1.0.0-alpha.14"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"@tanstack/db": "^0.6.0",
|