@durable-streams/state 0.2.9 → 0.3.0

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.cjs CHANGED
@@ -1,759 +1,6 @@
1
- "use strict";
2
- //#region rolldown:runtime
3
- var __create = Object.create;
4
- var __defProp = Object.defineProperty;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getProtoOf = Object.getPrototypeOf;
8
- var __hasOwnProp = Object.prototype.hasOwnProperty;
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
- key = keys[i];
12
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
13
- get: ((k) => from[k]).bind(null, key),
14
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
- });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
20
- value: mod,
21
- enumerable: true
22
- }) : target, mod));
1
+ const require_src = require('./src-AIE5IYwJ.cjs');
23
2
 
24
- //#endregion
25
- const __tanstack_db = __toESM(require("@tanstack/db"));
26
- const __durable_streams_client = __toESM(require("@durable-streams/client"));
27
-
28
- //#region src/types.ts
29
- /**
30
- * Type guard to check if an event is a change event
31
- */
32
- function isChangeEvent(event) {
33
- return event != null && `operation` in event.headers;
34
- }
35
- /**
36
- * Type guard to check if an event is a control event
37
- */
38
- function isControlEvent(event) {
39
- return event != null && `control` in event.headers;
40
- }
41
-
42
- //#endregion
43
- //#region src/materialized-state.ts
44
- /**
45
- * MaterializedState maintains an in-memory view of state from change events.
46
- *
47
- * It organizes data by type, where each type contains a map of key -> value.
48
- * This supports multi-type streams where different entity types can coexist.
49
- */
50
- var MaterializedState = class {
51
- data;
52
- constructor() {
53
- this.data = new Map();
54
- }
55
- /**
56
- * Apply a single change event to update the materialized state
57
- */
58
- apply(event) {
59
- const { type, key, value, headers } = event;
60
- let typeMap = this.data.get(type);
61
- if (!typeMap) {
62
- typeMap = new Map();
63
- this.data.set(type, typeMap);
64
- }
65
- switch (headers.operation) {
66
- case `insert`:
67
- typeMap.set(key, value);
68
- break;
69
- case `update`:
70
- typeMap.set(key, value);
71
- break;
72
- case `upsert`:
73
- typeMap.set(key, value);
74
- break;
75
- case `delete`:
76
- typeMap.delete(key);
77
- break;
78
- }
79
- }
80
- /**
81
- * Apply a batch of change events
82
- */
83
- applyBatch(events) {
84
- for (const event of events) this.apply(event);
85
- }
86
- /**
87
- * Get a specific value by type and key
88
- */
89
- get(type, key) {
90
- const typeMap = this.data.get(type);
91
- if (!typeMap) return void 0;
92
- return typeMap.get(key);
93
- }
94
- /**
95
- * Get all entries for a specific type
96
- */
97
- getType(type) {
98
- return this.data.get(type) || new Map();
99
- }
100
- /**
101
- * Clear all state
102
- */
103
- clear() {
104
- this.data.clear();
105
- }
106
- /**
107
- * Get the number of types in the state
108
- */
109
- get typeCount() {
110
- return this.data.size;
111
- }
112
- /**
113
- * Get all type names
114
- */
115
- get types() {
116
- return Array.from(this.data.keys());
117
- }
118
- };
119
-
120
- //#endregion
121
- //#region src/stream-db.ts
122
- /**
123
- * Build a TanStack collection id for a StreamDB collection.
124
- *
125
- * Collection ids must be unique per source stream, not just per schema key,
126
- * otherwise joining the same collection name from two different streams can
127
- * collapse to one logical source inside TanStack DB.
128
- */
129
- function getStreamDBCollectionId(streamUrl, collectionName) {
130
- return `stream-db:${streamUrl}:${collectionName}`;
131
- }
132
- /**
133
- * Internal event dispatcher that routes stream events to collection handlers
134
- */
135
- var EventDispatcher = class {
136
- /** Map from event type to collection handler */
137
- handlers = new Map();
138
- /** Handlers that have pending writes (need commit) */
139
- pendingHandlers = new Set();
140
- /** Whether we've received the initial up-to-date signal */
141
- isUpToDate = false;
142
- /** Resolvers and rejecters for preload promises */
143
- preloadResolvers = [];
144
- preloadRejecters = [];
145
- /** Set of all txids that have been seen and committed */
146
- seenTxids = new Set();
147
- /** Txids collected during current batch (before commit) */
148
- pendingTxids = new Set();
149
- /** Resolvers waiting for specific txids */
150
- txidResolvers = new Map();
151
- /** Track existing keys per collection for upsert logic */
152
- existingKeys = new Map();
153
- /** Global sequence counter for insertion ordering */
154
- seq = 0;
155
- comparableRow(row) {
156
- const clone = { ...row };
157
- delete clone._seq;
158
- return clone;
159
- }
160
- /**
161
- * Register a handler for a specific event type
162
- */
163
- registerHandler(eventType, handler) {
164
- this.handlers.set(eventType, handler);
165
- if (!this.existingKeys.has(eventType)) this.existingKeys.set(eventType, new Set());
166
- }
167
- /**
168
- * Dispatch a change event to the appropriate collection.
169
- * Writes are buffered until commit() is called via markUpToDate().
170
- */
171
- dispatchChange(event, cursor) {
172
- if (!isChangeEvent(event)) return;
173
- const eventCursor = event.headers.offset ?? cursor;
174
- if (event.headers.txid && typeof event.headers.txid === `string`) this.pendingTxids.add(event.headers.txid);
175
- const handler = this.handlers.get(event.type);
176
- if (!handler) return;
177
- let operation = event.headers.operation;
178
- if (operation !== `delete`) {
179
- if (typeof event.value !== `object` || event.value === null) throw new Error(`StreamDB collections require object values; got ${typeof event.value} for type=${event.type}, key=${event.key}`);
180
- }
181
- const originalValue = event.value ?? {};
182
- const value = { ...originalValue };
183
- value[handler.primaryKey] = event.key;
184
- value._seq = this.seq++;
185
- if (!this.pendingHandlers.has(handler)) {
186
- handler.begin();
187
- this.pendingHandlers.add(handler);
188
- }
189
- if (operation === `upsert`) {
190
- const keys$1 = this.existingKeys.get(event.type);
191
- const existing = keys$1?.has(event.key);
192
- operation = existing ? `update` : `insert`;
193
- }
194
- const keys = this.existingKeys.get(event.type);
195
- if (operation === `insert` && keys?.has(event.key)) operation = `update`;
196
- else if (operation === `insert` && typeof event.key === `string`) {
197
- const existingValue = handler.read(event.key);
198
- if (existingValue && (0, __tanstack_db.deepEquals)(this.comparableRow(existingValue), this.comparableRow(value))) operation = `update`;
199
- }
200
- if (operation === `insert` || operation === `update`) keys?.add(event.key);
201
- else keys?.delete(event.key);
202
- try {
203
- handler.write(value, operation, eventCursor);
204
- } catch (error) {
205
- console.error(`[StreamDB] Error in handler.write():`, error);
206
- console.error(`[StreamDB] Event that caused error:`, {
207
- type: event.type,
208
- key: event.key,
209
- operation
210
- });
211
- throw error;
212
- }
213
- }
214
- /**
215
- * Handle control events from the stream JSON items
216
- */
217
- dispatchControl(event) {
218
- if (!isControlEvent(event)) return;
219
- switch (event.headers.control) {
220
- case `reset`:
221
- for (const handler of this.handlers.values()) handler.truncate();
222
- for (const keys of this.existingKeys.values()) keys.clear();
223
- this.pendingHandlers.clear();
224
- this.isUpToDate = false;
225
- break;
226
- case `snapshot-start`:
227
- case `snapshot-end`: break;
228
- }
229
- }
230
- /**
231
- * Commit all pending writes and handle up-to-date signal
232
- */
233
- markUpToDate() {
234
- for (const handler of this.pendingHandlers) try {
235
- handler.commit();
236
- } catch (error) {
237
- console.error(`[StreamDB] Error in handler.commit():`, error);
238
- if (error instanceof Error && error.message.includes(`already exists in the collection`) && error.message.includes(`live-query`)) {
239
- console.warn(`[StreamDB] Known TanStack DB groupBy bug detected - continuing despite error`);
240
- console.warn(`[StreamDB] Queries with groupBy may show stale data until fixed`);
241
- continue;
242
- }
243
- throw error;
244
- }
245
- this.pendingHandlers.clear();
246
- for (const txid of this.pendingTxids) {
247
- this.seenTxids.add(txid);
248
- const resolvers = this.txidResolvers.get(txid);
249
- if (resolvers) {
250
- for (const { resolve, timeoutId } of resolvers) {
251
- clearTimeout(timeoutId);
252
- resolve();
253
- }
254
- this.txidResolvers.delete(txid);
255
- }
256
- }
257
- this.pendingTxids.clear();
258
- if (!this.isUpToDate) {
259
- this.isUpToDate = true;
260
- for (const handler of this.handlers.values()) handler.markReady();
261
- for (const resolve of this.preloadResolvers) resolve();
262
- this.preloadResolvers = [];
263
- }
264
- }
265
- /**
266
- * Wait for the stream to reach up-to-date state
267
- */
268
- waitForUpToDate() {
269
- if (this.isUpToDate) return Promise.resolve();
270
- return new Promise((resolve, reject) => {
271
- this.preloadResolvers.push(resolve);
272
- this.preloadRejecters.push(reject);
273
- });
274
- }
275
- /**
276
- * Reject all waiting preload promises with an error
277
- */
278
- rejectAll(error) {
279
- for (const reject of this.preloadRejecters) reject(error);
280
- this.preloadResolvers = [];
281
- this.preloadRejecters = [];
282
- for (const resolvers of this.txidResolvers.values()) for (const { reject, timeoutId } of resolvers) {
283
- clearTimeout(timeoutId);
284
- reject(error);
285
- }
286
- this.txidResolvers.clear();
287
- }
288
- /**
289
- * Check if we've received up-to-date
290
- */
291
- get ready() {
292
- return this.isUpToDate;
293
- }
294
- /**
295
- * Wait for a specific txid to be seen in the stream
296
- */
297
- awaitTxId(txid, timeout = 5e3) {
298
- if (this.seenTxids.has(txid)) return Promise.resolve();
299
- return new Promise((resolve, reject) => {
300
- const timeoutId = setTimeout(() => {
301
- const resolvers = this.txidResolvers.get(txid);
302
- if (resolvers) {
303
- const index = resolvers.findIndex((r) => r.timeoutId === timeoutId);
304
- if (index !== -1) resolvers.splice(index, 1);
305
- if (resolvers.length === 0) this.txidResolvers.delete(txid);
306
- }
307
- reject(new Error(`Timeout waiting for txid: ${txid}`));
308
- }, timeout);
309
- if (!this.txidResolvers.has(txid)) this.txidResolvers.set(txid, []);
310
- this.txidResolvers.get(txid).push({
311
- resolve,
312
- reject,
313
- timeoutId
314
- });
315
- });
316
- }
317
- };
318
- /**
319
- * Create a sync config for a stream-backed collection
320
- */
321
- function createStreamSyncConfig(eventType, dispatcher, primaryKey, read) {
322
- return { sync: ({ begin, write, commit, markReady, truncate }) => {
323
- dispatcher.registerHandler(eventType, {
324
- begin,
325
- write: (value, type, _cursor) => {
326
- write({
327
- value,
328
- type
329
- });
330
- },
331
- read: (key) => read(key),
332
- commit,
333
- markReady,
334
- truncate,
335
- primaryKey
336
- });
337
- if (dispatcher.ready) markReady();
338
- return () => {};
339
- } };
340
- }
341
- /**
342
- * Reserved collection names that would collide with StreamDB properties
343
- * (collections are now namespaced, but we still prevent internal name collisions)
344
- */
345
- const RESERVED_COLLECTION_NAMES = new Set([
346
- `collections`,
347
- `preload`,
348
- `close`,
349
- `utils`,
350
- `actions`
351
- ]);
352
- /**
353
- * Create helper functions for a collection
354
- */
355
- function createCollectionHelpers(eventType, primaryKey, schema) {
356
- return {
357
- insert: ({ key, value, headers }) => {
358
- const result = schema[`~standard`].validate(value);
359
- if (`issues` in result) throw new Error(`Validation failed for ${eventType} insert: ${result.issues?.map((i) => i.message).join(`, `) ?? `Unknown validation error`}`);
360
- const derived = value[primaryKey];
361
- const finalKey = key ?? (derived != null && derived !== `` ? String(derived) : void 0);
362
- if (finalKey == null || finalKey === ``) throw new Error(`Cannot create ${eventType} insert event: must provide either 'key' or a value with a non-empty '${primaryKey}' field`);
363
- return {
364
- type: eventType,
365
- key: finalKey,
366
- value,
367
- headers: {
368
- ...headers,
369
- operation: `insert`
370
- }
371
- };
372
- },
373
- update: ({ key, value, oldValue, headers }) => {
374
- const result = schema[`~standard`].validate(value);
375
- if (`issues` in result) throw new Error(`Validation failed for ${eventType} update: ${result.issues?.map((i) => i.message).join(`, `) ?? `Unknown validation error`}`);
376
- if (oldValue !== void 0) {
377
- const oldResult = schema[`~standard`].validate(oldValue);
378
- if (`issues` in oldResult) throw new Error(`Validation failed for ${eventType} update (oldValue): ${oldResult.issues?.map((i) => i.message).join(`, `) ?? `Unknown validation error`}`);
379
- }
380
- const derived = value[primaryKey];
381
- const finalKey = key ?? (derived != null && derived !== `` ? String(derived) : void 0);
382
- if (finalKey == null || finalKey === ``) throw new Error(`Cannot create ${eventType} update event: must provide either 'key' or a value with a non-empty '${primaryKey}' field`);
383
- return {
384
- type: eventType,
385
- key: finalKey,
386
- value,
387
- old_value: oldValue,
388
- headers: {
389
- ...headers,
390
- operation: `update`
391
- }
392
- };
393
- },
394
- delete: ({ key, oldValue, headers }) => {
395
- if (oldValue !== void 0) {
396
- const result = schema[`~standard`].validate(oldValue);
397
- if (`issues` in result) throw new Error(`Validation failed for ${eventType} delete (oldValue): ${result.issues?.map((i) => i.message).join(`, `) ?? `Unknown validation error`}`);
398
- }
399
- const finalKey = key ?? (oldValue ? String(oldValue[primaryKey]) : void 0);
400
- if (!finalKey) throw new Error(`Cannot create ${eventType} delete event: must provide either 'key' or 'oldValue' with a ${primaryKey} field`);
401
- return {
402
- type: eventType,
403
- key: finalKey,
404
- old_value: oldValue,
405
- headers: {
406
- ...headers,
407
- operation: `delete`
408
- }
409
- };
410
- },
411
- upsert: ({ key, value, headers }) => {
412
- const result = schema[`~standard`].validate(value);
413
- if (`issues` in result) throw new Error(`Validation failed for ${eventType} upsert: ${result.issues?.map((i) => i.message).join(`, `) ?? `Unknown validation error`}`);
414
- const derived = value[primaryKey];
415
- const finalKey = key ?? (derived != null && derived !== `` ? String(derived) : void 0);
416
- if (finalKey == null || finalKey === ``) throw new Error(`Cannot create ${eventType} upsert event: must provide either 'key' or a value with a non-empty '${primaryKey}' field`);
417
- return {
418
- type: eventType,
419
- key: finalKey,
420
- value,
421
- headers: {
422
- ...headers,
423
- operation: `upsert`
424
- }
425
- };
426
- }
427
- };
428
- }
429
- /**
430
- * Create a state schema definition with typed collections and event helpers
431
- */
432
- function createStateSchema(collections) {
433
- for (const name of Object.keys(collections)) if (RESERVED_COLLECTION_NAMES.has(name)) throw new Error(`Reserved collection name "${name}" - this would collide with StreamDB properties (${Array.from(RESERVED_COLLECTION_NAMES).join(`, `)})`);
434
- const typeToCollection = new Map();
435
- for (const [collectionName, def] of Object.entries(collections)) {
436
- const existing = typeToCollection.get(def.type);
437
- if (existing) throw new Error(`Duplicate event type "${def.type}" - used by both "${existing}" and "${collectionName}" collections`);
438
- typeToCollection.set(def.type, collectionName);
439
- }
440
- const enhancedCollections = {};
441
- for (const [name, collectionDef] of Object.entries(collections)) enhancedCollections[name] = {
442
- ...collectionDef,
443
- ...createCollectionHelpers(collectionDef.type, collectionDef.primaryKey, collectionDef.schema)
444
- };
445
- return enhancedCollections;
446
- }
447
- /**
448
- * Create a stream-backed database with TanStack DB collections
449
- *
450
- * This function is synchronous - it creates the stream handle and collections
451
- * but does not start the stream connection. Call `db.preload()` to connect
452
- * and sync initial data.
453
- *
454
- * @example
455
- * ```typescript
456
- * const stateSchema = createStateSchema({
457
- * users: { schema: userSchema, type: "user", primaryKey: "id" },
458
- * messages: { schema: messageSchema, type: "message", primaryKey: "id" },
459
- * })
460
- *
461
- * // Create a stream DB (synchronous - stream is created lazily on preload)
462
- * const db = createStreamDB({
463
- * streamOptions: {
464
- * url: "https://api.example.com/streams/my-stream",
465
- * contentType: "application/json",
466
- * },
467
- * state: stateSchema,
468
- * })
469
- *
470
- * // preload() creates the stream and loads initial data
471
- * await db.preload()
472
- * const user = await db.collections.users.get("123")
473
- * ```
474
- */
475
- function createStreamDB(options) {
476
- const { streamOptions, state, actions: actionsFactory, live = true, onEvent, onBeforeBatch, onBatch } = options;
477
- const stream = options.stream ?? (() => {
478
- if (!streamOptions) throw new Error(`createStreamDB requires stream or streamOptions`);
479
- return new __durable_streams_client.DurableStream(streamOptions);
480
- })();
481
- const dispatcher = new EventDispatcher();
482
- const streamIdentity = stream.url;
483
- const collectionInstances = {};
484
- for (const [name, definition] of Object.entries(state)) {
485
- let collection = (0, __tanstack_db.createCollection)({
486
- id: getStreamDBCollectionId(streamIdentity, name),
487
- schema: definition.schema,
488
- getKey: (item) => String(item[definition.primaryKey]),
489
- sync: createStreamSyncConfig(definition.type, dispatcher, definition.primaryKey, (key) => collection.get(key)),
490
- startSync: true,
491
- gcTime: 0
492
- });
493
- collectionInstances[name] = collection;
494
- }
495
- let streamResponse = null;
496
- const abortController = new AbortController();
497
- let consumerStarted = false;
498
- let lastConsumedOffset = `-1`;
499
- const isAbortLikeError = (err) => {
500
- if (abortController.signal.aborted) return true;
501
- if (!(err instanceof Error)) return false;
502
- return err.name === `AbortError` || err.name === `FetchBackoffAbortError` || err.message === `Stream request was aborted`;
503
- };
504
- /**
505
- * Start the stream consumer (called lazily on first preload)
506
- */
507
- const startConsumer = async () => {
508
- if (consumerStarted) return;
509
- consumerStarted = true;
510
- streamResponse = await stream.stream({
511
- live,
512
- json: true,
513
- signal: abortController.signal
514
- });
515
- streamResponse.closed.catch((err) => {
516
- if (isAbortLikeError(err)) return void 0;
517
- const error = err instanceof Error ? err : new Error(String(err));
518
- console.error(`[StreamDB] Stream consumer closed unexpectedly:`, error);
519
- dispatcher.rejectAll(error);
520
- return void 0;
521
- });
522
- lastConsumedOffset = streamResponse.offset;
523
- streamResponse.subscribeJson((batch) => {
524
- try {
525
- lastConsumedOffset = batch.offset;
526
- onBeforeBatch?.(batch);
527
- for (const event of batch.items) if (isChangeEvent(event)) {
528
- dispatcher.dispatchChange(event, batch.offset);
529
- onEvent?.(event);
530
- } else if (isControlEvent(event)) dispatcher.dispatchControl(event);
531
- onBatch?.(batch);
532
- if (batch.upToDate || dispatcher.ready) dispatcher.markUpToDate();
533
- } catch (error) {
534
- console.error(`[StreamDB] Error processing batch:`, error);
535
- dispatcher.rejectAll(error);
536
- abortController.abort();
537
- }
538
- return Promise.resolve();
539
- });
540
- };
541
- const dbMethods = {
542
- stream,
543
- get offset() {
544
- return lastConsumedOffset;
545
- },
546
- preload: async () => {
547
- await startConsumer();
548
- await dispatcher.waitForUpToDate();
549
- },
550
- close: () => {
551
- dispatcher.rejectAll(new Error(`StreamDB closed`));
552
- abortController.abort();
553
- },
554
- utils: { awaitTxId: (txid, timeout) => dispatcher.awaitTxId(txid, timeout) }
555
- };
556
- const db = Object.create(null);
557
- Object.defineProperty(db, `collections`, {
558
- value: collectionInstances,
559
- enumerable: true,
560
- configurable: false,
561
- writable: false
562
- });
563
- Object.defineProperties(db, Object.getOwnPropertyDescriptors(dbMethods));
564
- if (actionsFactory) {
565
- const actionDefs = actionsFactory({
566
- db,
567
- stream
568
- });
569
- const wrappedActions = {};
570
- for (const [name, def] of Object.entries(actionDefs)) wrappedActions[name] = (0, __tanstack_db.createOptimisticAction)({
571
- onMutate: def.onMutate,
572
- mutationFn: def.mutationFn
573
- });
574
- Object.defineProperty(db, `actions`, {
575
- value: wrappedActions,
576
- enumerable: true,
577
- configurable: false,
578
- writable: false
579
- });
580
- return db;
581
- }
582
- return db;
583
- }
584
-
585
- //#endregion
586
- exports.MaterializedState = MaterializedState
587
- Object.defineProperty(exports, 'and', {
588
- enumerable: true,
589
- get: function () {
590
- return __tanstack_db.and;
591
- }
592
- });
593
- Object.defineProperty(exports, 'avg', {
594
- enumerable: true,
595
- get: function () {
596
- return __tanstack_db.avg;
597
- }
598
- });
599
- Object.defineProperty(exports, 'coalesce', {
600
- enumerable: true,
601
- get: function () {
602
- return __tanstack_db.coalesce;
603
- }
604
- });
605
- Object.defineProperty(exports, 'concat', {
606
- enumerable: true,
607
- get: function () {
608
- return __tanstack_db.concat;
609
- }
610
- });
611
- Object.defineProperty(exports, 'count', {
612
- enumerable: true,
613
- get: function () {
614
- return __tanstack_db.count;
615
- }
616
- });
617
- Object.defineProperty(exports, 'createCollection', {
618
- enumerable: true,
619
- get: function () {
620
- return __tanstack_db.createCollection;
621
- }
622
- });
623
- Object.defineProperty(exports, 'createLiveQueryCollection', {
624
- enumerable: true,
625
- get: function () {
626
- return __tanstack_db.createLiveQueryCollection;
627
- }
628
- });
629
- Object.defineProperty(exports, 'createOptimisticAction', {
630
- enumerable: true,
631
- get: function () {
632
- return __tanstack_db.createOptimisticAction;
633
- }
634
- });
635
- exports.createStateSchema = createStateSchema
636
- exports.createStreamDB = createStreamDB
637
- Object.defineProperty(exports, 'createTransaction', {
638
- enumerable: true,
639
- get: function () {
640
- return __tanstack_db.createTransaction;
641
- }
642
- });
643
- Object.defineProperty(exports, 'deepEquals', {
644
- enumerable: true,
645
- get: function () {
646
- return __tanstack_db.deepEquals;
647
- }
648
- });
649
- Object.defineProperty(exports, 'eq', {
650
- enumerable: true,
651
- get: function () {
652
- return __tanstack_db.eq;
653
- }
654
- });
655
- exports.getStreamDBCollectionId = getStreamDBCollectionId
656
- Object.defineProperty(exports, 'gt', {
657
- enumerable: true,
658
- get: function () {
659
- return __tanstack_db.gt;
660
- }
661
- });
662
- Object.defineProperty(exports, 'gte', {
663
- enumerable: true,
664
- get: function () {
665
- return __tanstack_db.gte;
666
- }
667
- });
668
- Object.defineProperty(exports, 'ilike', {
669
- enumerable: true,
670
- get: function () {
671
- return __tanstack_db.ilike;
672
- }
673
- });
674
- Object.defineProperty(exports, 'inArray', {
675
- enumerable: true,
676
- get: function () {
677
- return __tanstack_db.inArray;
678
- }
679
- });
680
- exports.isChangeEvent = isChangeEvent
681
- exports.isControlEvent = isControlEvent
682
- Object.defineProperty(exports, 'isNull', {
683
- enumerable: true,
684
- get: function () {
685
- return __tanstack_db.isNull;
686
- }
687
- });
688
- Object.defineProperty(exports, 'isUndefined', {
689
- enumerable: true,
690
- get: function () {
691
- return __tanstack_db.isUndefined;
692
- }
693
- });
694
- Object.defineProperty(exports, 'like', {
695
- enumerable: true,
696
- get: function () {
697
- return __tanstack_db.like;
698
- }
699
- });
700
- Object.defineProperty(exports, 'localOnlyCollectionOptions', {
701
- enumerable: true,
702
- get: function () {
703
- return __tanstack_db.localOnlyCollectionOptions;
704
- }
705
- });
706
- Object.defineProperty(exports, 'lt', {
707
- enumerable: true,
708
- get: function () {
709
- return __tanstack_db.lt;
710
- }
711
- });
712
- Object.defineProperty(exports, 'lte', {
713
- enumerable: true,
714
- get: function () {
715
- return __tanstack_db.lte;
716
- }
717
- });
718
- Object.defineProperty(exports, 'max', {
719
- enumerable: true,
720
- get: function () {
721
- return __tanstack_db.max;
722
- }
723
- });
724
- Object.defineProperty(exports, 'min', {
725
- enumerable: true,
726
- get: function () {
727
- return __tanstack_db.min;
728
- }
729
- });
730
- Object.defineProperty(exports, 'not', {
731
- enumerable: true,
732
- get: function () {
733
- return __tanstack_db.not;
734
- }
735
- });
736
- Object.defineProperty(exports, 'or', {
737
- enumerable: true,
738
- get: function () {
739
- return __tanstack_db.or;
740
- }
741
- });
742
- Object.defineProperty(exports, 'queryOnce', {
743
- enumerable: true,
744
- get: function () {
745
- return __tanstack_db.queryOnce;
746
- }
747
- });
748
- Object.defineProperty(exports, 'sum', {
749
- enumerable: true,
750
- get: function () {
751
- return __tanstack_db.sum;
752
- }
753
- });
754
- Object.defineProperty(exports, 'toArray', {
755
- enumerable: true,
756
- get: function () {
757
- return __tanstack_db.toArray;
758
- }
759
- });
3
+ exports.MaterializedState = require_src.MaterializedState
4
+ exports.createStateSchema = require_src.createStateSchema
5
+ exports.isChangeEvent = require_src.isChangeEvent
6
+ exports.isControlEvent = require_src.isControlEvent