@dxos/feed-store 0.8.4-main.5ea62a8 → 0.8.4-main.72ec0f3

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.
@@ -3,7 +3,7 @@ import {
3
3
  FeedFactory,
4
4
  FeedStore,
5
5
  FeedWrapper
6
- } from "./chunk-HBSCNY5U.mjs";
6
+ } from "./chunk-I36R5SR3.mjs";
7
7
 
8
8
  // src/feed-iterator.ts
9
9
  import safeRace from "race-as-promised";
@@ -18,27 +18,28 @@ import { Event, Trigger, latch } from "@dxos/async";
18
18
  import { inspectObject } from "@dxos/debug";
19
19
  import { invariant } from "@dxos/invariant";
20
20
  import { log } from "@dxos/log";
21
- function _define_property(obj, key, value) {
22
- if (key in obj) {
23
- Object.defineProperty(obj, key, {
24
- value,
25
- enumerable: true,
26
- configurable: true,
27
- writable: true
28
- });
29
- } else {
30
- obj[key] = value;
31
- }
32
- return obj;
33
- }
34
21
  var __dxlog_file = "/__w/dxos/dxos/packages/common/feed-store/src/feed-queue.ts";
35
22
  var defaultReadStreamOptions = {
36
23
  live: true,
37
24
  batch: 1024
38
25
  };
39
- var _inspect_custom = inspect.custom;
40
26
  var FeedQueue = class {
41
- [_inspect_custom]() {
27
+ _feed;
28
+ _options;
29
+ updated = new Event();
30
+ _messageTrigger = new Trigger({
31
+ autoReset: true
32
+ });
33
+ _feedConsumer = void 0;
34
+ _next;
35
+ _currentBlock = void 0;
36
+ _index = -1;
37
+ // prettier-ignore
38
+ constructor(_feed, _options = {}) {
39
+ this._feed = _feed;
40
+ this._options = _options;
41
+ }
42
+ [inspect.custom]() {
42
43
  return inspectObject(this);
43
44
  }
44
45
  toJSON() {
@@ -223,44 +224,14 @@ var FeedQueue = class {
223
224
  this._index = -1;
224
225
  }
225
226
  }
226
- // prettier-ignore
227
- constructor(_feed, _options = {}) {
228
- _define_property(this, "_feed", void 0);
229
- _define_property(this, "_options", void 0);
230
- _define_property(this, "updated", void 0);
231
- _define_property(this, "_messageTrigger", void 0);
232
- _define_property(this, "_feedConsumer", void 0);
233
- _define_property(this, "_next", void 0);
234
- _define_property(this, "_currentBlock", void 0);
235
- _define_property(this, "_index", void 0);
236
- this._feed = _feed;
237
- this._options = _options;
238
- this.updated = new Event();
239
- this._messageTrigger = new Trigger({
240
- autoReset: true
241
- });
242
- this._feedConsumer = void 0;
243
- this._currentBlock = void 0;
244
- this._index = -1;
245
- }
246
227
  };
247
228
 
248
229
  // src/feed-iterator.ts
249
- function _define_property2(obj, key, value) {
250
- if (key in obj) {
251
- Object.defineProperty(obj, key, {
252
- value,
253
- enumerable: true,
254
- configurable: true,
255
- writable: true
256
- });
257
- } else {
258
- obj[key] = value;
259
- }
260
- return obj;
261
- }
262
230
  var __dxlog_file2 = "/__w/dxos/dxos/packages/common/feed-store/src/feed-iterator.ts";
263
231
  var AbstractFeedIterator = class {
232
+ _stopTrigger = new Trigger2();
233
+ _open = false;
234
+ _running = false;
264
235
  toJSON() {
265
236
  return {
266
237
  open: this.isOpen,
@@ -370,13 +341,14 @@ var AbstractFeedIterator = class {
370
341
  C: (f, a) => f(...a)
371
342
  });
372
343
  }
373
- constructor() {
374
- _define_property2(this, "_stopTrigger", new Trigger2());
375
- _define_property2(this, "_open", false);
376
- _define_property2(this, "_running", false);
377
- }
378
344
  };
379
345
  var FeedIterator = class extends AbstractFeedIterator {
346
+ _feed;
347
+ _queue;
348
+ constructor(_feed) {
349
+ super(), this._feed = _feed;
350
+ this._queue = new FeedQueue(this._feed);
351
+ }
380
352
  async _onOpen() {
381
353
  await this._queue.open();
382
354
  }
@@ -386,10 +358,6 @@ var FeedIterator = class extends AbstractFeedIterator {
386
358
  async _nextBlock() {
387
359
  return this._queue.pop();
388
360
  }
389
- constructor(_feed) {
390
- super(), _define_property2(this, "_feed", void 0), _define_property2(this, "_queue", void 0), this._feed = _feed;
391
- this._queue = new FeedQueue(this._feed);
392
- }
393
361
  };
394
362
 
395
363
  // src/feed-set-iterator.ts
@@ -400,26 +368,41 @@ import { invariant as invariant3 } from "@dxos/invariant";
400
368
  import { PublicKey } from "@dxos/keys";
401
369
  import { log as log3 } from "@dxos/log";
402
370
  import { ComplexMap, isNonNullable } from "@dxos/util";
403
- function _define_property3(obj, key, value) {
404
- if (key in obj) {
405
- Object.defineProperty(obj, key, {
406
- value,
407
- enumerable: true,
408
- configurable: true,
409
- writable: true
410
- });
411
- } else {
412
- obj[key] = value;
413
- }
414
- return obj;
415
- }
416
371
  var __dxlog_file3 = "/__w/dxos/dxos/packages/common/feed-store/src/feed-set-iterator.ts";
417
372
  var defaultFeedSetIteratorOptions = {
418
373
  stallTimeout: 1e3
419
374
  };
420
- var _inspect_custom2 = inspect2.custom;
421
375
  var FeedSetIterator = class extends AbstractFeedIterator {
422
- [_inspect_custom2]() {
376
+ _selector;
377
+ options;
378
+ _feedQueues = new ComplexMap(PublicKey.hash);
379
+ _trigger = new Trigger3({
380
+ autoReset: true
381
+ });
382
+ _subscriptions = new SubscriptionList();
383
+ stalled = new Event2();
384
+ constructor(_selector, options = defaultFeedSetIteratorOptions) {
385
+ super(), this._selector = _selector, this.options = options;
386
+ invariant3(_selector, void 0, {
387
+ F: __dxlog_file3,
388
+ L: 55,
389
+ S: this,
390
+ A: [
391
+ "_selector",
392
+ ""
393
+ ]
394
+ });
395
+ invariant3(options, void 0, {
396
+ F: __dxlog_file3,
397
+ L: 56,
398
+ S: this,
399
+ A: [
400
+ "options",
401
+ ""
402
+ ]
403
+ });
404
+ }
405
+ [inspect2.custom]() {
423
406
  return inspectObject2(this);
424
407
  }
425
408
  toJSON() {
@@ -562,29 +545,6 @@ var FeedSetIterator = class extends AbstractFeedIterator {
562
545
  await this._trigger.wait();
563
546
  }
564
547
  }
565
- constructor(_selector, options = defaultFeedSetIteratorOptions) {
566
- super(), _define_property3(this, "_selector", void 0), _define_property3(this, "options", void 0), _define_property3(this, "_feedQueues", void 0), _define_property3(this, "_trigger", void 0), _define_property3(this, "_subscriptions", void 0), _define_property3(this, "stalled", void 0), this._selector = _selector, this.options = options, this._feedQueues = new ComplexMap(PublicKey.hash), this._trigger = new Trigger3({
567
- autoReset: true
568
- }), this._subscriptions = new SubscriptionList(), this.stalled = new Event2();
569
- invariant3(_selector, void 0, {
570
- F: __dxlog_file3,
571
- L: 55,
572
- S: this,
573
- A: [
574
- "_selector",
575
- ""
576
- ]
577
- });
578
- invariant3(options, void 0, {
579
- F: __dxlog_file3,
580
- L: 56,
581
- S: this,
582
- A: [
583
- "options",
584
- ""
585
- ]
586
- });
587
- }
588
548
  };
589
549
 
590
550
  // src/feed-writer.ts
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/feed-iterator.ts", "../../../src/feed-queue.ts", "../../../src/feed-set-iterator.ts", "../../../src/feed-writer.ts"],
4
4
  "sourcesContent": ["//\n// Copyright 2020 DXOS.org\n//\n\nimport safeRace from 'race-as-promised';\n\nimport { Trigger } from '@dxos/async';\nimport { invariant } from '@dxos/invariant';\nimport { log } from '@dxos/log';\n\nimport { FeedQueue } from './feed-queue';\nimport { type FeedWrapper } from './feed-wrapper';\nimport { type FeedBlock } from './types';\n\n/**\n * Base class for an async iterable feed.\n */\nexport abstract class AbstractFeedIterator<T> implements AsyncIterable<FeedBlock<T>> {\n private readonly _stopTrigger = new Trigger();\n\n protected _open = false;\n protected _running = false;\n\n toJSON(): { open: boolean; running: boolean } {\n return {\n open: this.isOpen,\n running: this.isRunning,\n };\n }\n\n get isOpen() {\n return this._open;\n }\n\n get isRunning() {\n return this._running;\n }\n\n async open(): Promise<void> {\n if (!this._open) {\n log('opening...');\n await this._onOpen();\n this._open = true;\n\n await this.start();\n log('opened');\n }\n }\n\n async close(): Promise<void> {\n if (this._open) {\n log('closing...');\n await this.stop();\n\n await this._onClose();\n this._open = false;\n log('closed');\n }\n }\n\n async start(): Promise<void> {\n invariant(this._open);\n if (!this._running) {\n this._running = true;\n }\n }\n\n async stop(): Promise<void> {\n invariant(this._open);\n if (this._running) {\n this._running = false;\n this._stopTrigger.wake();\n }\n }\n\n //\n // AsyncIterable\n //\n\n [Symbol.asyncIterator]() {\n return this._generator();\n }\n\n async *_generator() {\n log('started');\n while (this._running) {\n // https://github.com/nodejs/node/issues/17469\n const block = await safeRace([this._stopTrigger.wait(), this._nextBlock()]);\n\n if (block === undefined) {\n break;\n }\n\n yield block;\n }\n\n log('stopped');\n }\n\n abstract _onOpen(): Promise<void>;\n abstract _onClose(): Promise<void>;\n abstract _nextBlock(): Promise<FeedBlock<T> | undefined>;\n}\n\n/**\n * Iterator that reads blocks from a single feed.\n */\nexport class FeedIterator<T extends {}> extends AbstractFeedIterator<T> {\n private readonly _queue: FeedQueue<T>;\n\n constructor(private readonly _feed: FeedWrapper<T>) {\n super();\n this._queue = new FeedQueue<T>(this._feed);\n }\n\n override async _onOpen(): Promise<void> {\n await this._queue.open();\n }\n\n override async _onClose(): Promise<void> {\n await this._queue.close();\n }\n\n override async _nextBlock(): Promise<FeedBlock<T> | undefined> {\n return this._queue.pop();\n }\n}\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { inspect } from 'node:util';\n\nimport { Writable } from 'streamx';\n\nimport { Event, Trigger, latch } from '@dxos/async';\nimport { inspectObject } from '@dxos/debug';\nimport type { ReadStreamOptions } from '@dxos/hypercore';\nimport { invariant } from '@dxos/invariant';\nimport { log } from '@dxos/log';\n\nimport { type FeedWrapper } from './feed-wrapper';\nimport { type FeedBlock } from './types';\n\nexport const defaultReadStreamOptions: ReadStreamOptions = {\n live: true, // Keep reading until closed.\n batch: 1024, // Read in batches.\n};\n\nexport type FeedQueueOptions = {};\n\n/**\n * Async queue using an AsyncIterator created from a hypercore.\n */\nexport class FeedQueue<T extends {}> {\n public updated = new Event<FeedQueue<T>>();\n\n private readonly _messageTrigger = new Trigger<FeedBlock<T>>({\n autoReset: true,\n });\n\n private _feedConsumer?: Writable = undefined;\n private _next?: () => void;\n private _currentBlock?: FeedBlock<T> = undefined;\n private _index = -1;\n\n // prettier-ignore\n constructor(\n private readonly _feed: FeedWrapper<T>,\n private readonly _options: FeedQueueOptions = {},\n ) {}\n\n [inspect.custom](): string {\n return inspectObject(this);\n }\n\n toJSON() {\n return {\n feedKey: this._feed.key,\n index: this.index,\n length: this.length,\n open: this.isOpen,\n };\n }\n\n get feed() {\n return this._feed;\n }\n\n get isOpen(): boolean {\n return Boolean(this._feedConsumer);\n }\n\n get length(): number {\n return this._feed.properties.length;\n }\n\n /**\n * Index (seq) of the NEXT block to be read, or -1 if not open.\n */\n get index() {\n return this._index;\n }\n\n /**\n * Opens (or reopens) the queue.\n * @param options.start Starting index. First mutation to be read would have `seq == options.start`.\n */\n async open(options: ReadStreamOptions = {}): Promise<void> {\n if (this.isOpen) {\n // TODO(burdon): Warn if re-opening (e.g., with different starting point).\n return;\n }\n\n this._index = options.start ?? 0;\n // if (this._index !== 0) {\n // console.warn('Start index not yet supported.');\n // }\n\n log('opening', { feedKey: this._feed.key });\n\n // TODO(burdon): Open with starting range.\n const opts = Object.assign({}, defaultReadStreamOptions, options);\n const feedStream = this._feed.createReadableStream(opts);\n\n this._feedConsumer = new Writable({\n write: (data: any, next: () => void) => {\n this._next = () => {\n this._next = undefined;\n this._currentBlock = undefined;\n this._index++;\n next();\n };\n\n this._currentBlock = {\n feedKey: this._feed.key,\n seq: this._index,\n data,\n };\n\n this._messageTrigger.wake(this._currentBlock);\n this.updated.emit(this);\n },\n });\n\n const onClose = () => {\n this.feed.core.off('close', onClose);\n this._feedConsumer?.off('close', onClose);\n this._feedConsumer?.off('error', onError);\n\n this._destroyConsumer();\n };\n\n const onError = (err?: Error) => {\n if (!this.isOpen) {\n return;\n }\n if (!err) {\n return;\n }\n if (err.message === 'Writable stream closed prematurely' || err.message === 'Feed is closed') {\n return;\n }\n\n log.catch(err, { feedKey: this._feed.key });\n };\n\n // Called if feed is closed externally.\n this._feed.core.once('close', onClose);\n this._feedConsumer.on('error', onError);\n\n // Called when queue is closed. Throws exception if waiting for `pop`.\n this._feedConsumer.once('close', onClose);\n\n // Pipe readable stream into writable consumer.\n feedStream.pipe(this._feedConsumer, (err) => {\n if (err) {\n onError(err);\n }\n this._destroyConsumer();\n });\n\n log('opened');\n }\n\n /**\n * Closes the queue.\n */\n async close(): Promise<void> {\n if (this.isOpen) {\n invariant(this._feedConsumer);\n invariant(!this._feed.properties.closed);\n\n log('closing', { feedKey: this._feed.key });\n const [closed, setClosed] = latch();\n this._feedConsumer.once('close', setClosed);\n this._feedConsumer.destroy();\n this._next?.(); // Release any message currently in the queue (otherwise destroy will block).\n await closed();\n log('closed');\n }\n }\n\n /**\n * Get the block at the head of the queue without removing it.\n */\n peek(): FeedBlock<T> | undefined {\n return this._currentBlock;\n }\n\n /**\n * Pop block at the head of the queue.\n */\n async pop(): Promise<FeedBlock<T>> {\n if (!this.isOpen) {\n throw new Error(`Queue closed: ${this.feed.key.truncate()}`);\n }\n\n let block = this.peek();\n if (!block) {\n block = await this._messageTrigger.wait();\n }\n\n if (block) {\n this._next?.();\n }\n\n return block;\n }\n\n private _destroyConsumer(): void {\n if (this._feedConsumer) {\n log('queue closed', { feedKey: this._feed.key });\n this._feedConsumer = undefined;\n this._next = undefined;\n this._currentBlock = undefined;\n this._index = -1;\n }\n }\n}\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { inspect } from 'node:util';\n\nimport { Event, SubscriptionList, Trigger } from '@dxos/async';\nimport { inspectObject } from '@dxos/debug';\nimport { invariant } from '@dxos/invariant';\nimport { PublicKey } from '@dxos/keys';\nimport { log } from '@dxos/log';\nimport { ComplexMap, isNonNullable } from '@dxos/util';\n\nimport { AbstractFeedIterator } from './feed-iterator';\nimport { FeedQueue } from './feed-queue';\nimport { type FeedWrapper } from './feed-wrapper';\nimport { type FeedBlock } from './types';\n\n/**\n * Select next block.\n */\nexport type FeedBlockSelector<T> = (blocks: FeedBlock<T>[]) => number | undefined;\n\nexport type FeedIndex = {\n feedKey: PublicKey;\n index: number;\n};\n\nexport type FeedSetIteratorOptions = {\n // TODO(burdon): Should we remove this and assume the feeds are positioned before adding?\n start?: FeedIndex[];\n stallTimeout?: number;\n};\n\nexport const defaultFeedSetIteratorOptions = {\n stallTimeout: 1000,\n};\n\n/**\n * Iterator that reads blocks from multiple feeds, ordering them based on a traversal callback.\n */\nexport class FeedSetIterator<T extends {}> extends AbstractFeedIterator<T> {\n private readonly _feedQueues = new ComplexMap<PublicKey, FeedQueue<T>>(PublicKey.hash);\n\n private readonly _trigger = new Trigger({ autoReset: true });\n private readonly _subscriptions = new SubscriptionList();\n\n public readonly stalled = new Event<FeedSetIterator<T>>();\n\n constructor(\n private readonly _selector: FeedBlockSelector<T>,\n public readonly options: FeedSetIteratorOptions = defaultFeedSetIteratorOptions,\n ) {\n super();\n invariant(_selector);\n invariant(options);\n }\n\n [inspect.custom](): string {\n return inspectObject(this);\n }\n\n override toJSON(): { open: boolean; running: boolean; indexes: FeedIndex[] } {\n return {\n open: this.isOpen,\n running: this.isRunning,\n indexes: this.indexes,\n };\n }\n\n get size() {\n return this._feedQueues.size;\n }\n\n get feeds(): FeedWrapper<T>[] {\n return Array.from(this._feedQueues.values()).map((feedQueue) => feedQueue.feed);\n }\n\n get indexes(): FeedIndex[] {\n return Array.from(this._feedQueues.values()).map((feedQueue) => ({\n feedKey: feedQueue.feed.key,\n index: feedQueue.index,\n }));\n }\n\n reiterateBlock(block: FeedBlock<T>): void {\n this._trigger.wake();\n }\n\n async addFeed(feed: FeedWrapper<T>): Promise<void> {\n invariant(!this._feedQueues.has(feed.key), `Feed already added: ${feed.key}`);\n invariant(feed.properties.opened);\n log('feed added', { feedKey: feed.key });\n\n // Create queue and listen for updates.\n const queue = new FeedQueue<T>(feed);\n this._feedQueues.set(feed.key, queue);\n this._subscriptions.add(\n queue.updated.on(() => {\n this._trigger.wake();\n }),\n );\n\n await queue.open({\n start: this.options.start?.find((index) => index.feedKey.equals(feed.key))?.index,\n });\n\n // Wake when feed added or queue updated.\n this._trigger.wake();\n }\n\n hasFeed(feedKey: PublicKey): boolean {\n return this._feedQueues.has(feedKey);\n }\n\n override async _onOpen(): Promise<void> {\n for (const queue of this._feedQueues.values()) {\n await queue.open();\n }\n }\n\n override async _onClose(): Promise<void> {\n this._subscriptions.clear();\n await Promise.all(Array.from(this._feedQueues.values()).map((queue) => queue.close()));\n\n // Wake when feed added or queue updated.\n this._trigger.wake();\n }\n\n /**\n * Gets the next block from the selected queue.\n */\n override async _nextBlock(): Promise<FeedBlock<T> | undefined> {\n let t: NodeJS.Timeout | undefined;\n\n while (this._running) {\n // Get blocks from the head of each queue.\n const queues = Array.from(this._feedQueues.values());\n const blocks = queues.map((queue) => queue.peek()).filter(isNonNullable);\n if (blocks.length) {\n // Get the selected block from candidates.\n const idx = this._selector(blocks);\n log('selected', { idx, blocks });\n if (idx === undefined) {\n // Timeout if all candidates are rejected.\n if (t === undefined) {\n t = setTimeout(() => {\n this.stalled.emit(this);\n this._trigger.wake();\n }, this.options.stallTimeout);\n }\n } else {\n if (t !== undefined) {\n clearTimeout(t);\n t = undefined;\n }\n if (idx >= blocks.length) {\n throw new Error(`Index out of bounds: ${idx} of ${blocks.length}`);\n }\n\n // Pop from queue.\n const queue = this._feedQueues.get(blocks[idx].feedKey)!;\n log('popping', queue.toJSON());\n try {\n const message = await queue.pop();\n invariant(message === blocks[idx]);\n return message;\n } catch (err) {\n // TODO(burdon): Same queue closed twice.\n log.warn('queue closed', { feedKey: queue.feed.key });\n // console.log(Array.from(this._feedQueues.values()));\n }\n }\n }\n\n // Wait until feed added, new block, or closing.\n await this._trigger.wait();\n }\n }\n}\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { type PublicKey } from '@dxos/keys';\n\nexport type WriteReceipt = {\n feedKey: PublicKey;\n seq: number;\n};\n\nexport type WriteOptions = {\n /**\n * Called after the write is complete.\n * Runs and completes before the mutation is read from the pipeline.\n */\n afterWrite?: (receipt: WriteReceipt) => Promise<void>;\n};\n\nexport interface FeedWriter<T extends {}> {\n /**\n * Write data to the feed.\n * Awaits `afterWrite` before returning.\n */\n write(data: T, options?: WriteOptions): Promise<WriteReceipt>;\n}\n\nexport const createFeedWriter = <T extends {}>(cb: (data: T) => Promise<WriteReceipt>): FeedWriter<T> => ({\n write: async (data: T) => {\n return cb(data);\n },\n});\n\nexport const writeMessages = async <T extends {}>(writer: FeedWriter<T>, messages: T[]): Promise<WriteReceipt[]> => {\n const receipts: WriteReceipt[] = [];\n // NOTE: Write messages sequentially.\n for (const message of messages) {\n receipts.push(await writer.write(message));\n }\n return receipts;\n};\n"],
5
- "mappings": ";;;;;;;;AAIA,OAAOA,cAAc;AAErB,SAASC,WAAAA,gBAAe;AACxB,SAASC,aAAAA,kBAAiB;AAC1B,SAASC,OAAAA,YAAW;;;ACJpB,SAASC,eAAe;AAExB,SAASC,gBAAgB;AAEzB,SAASC,OAAOC,SAASC,aAAa;AACtC,SAASC,qBAAqB;AAE9B,SAASC,iBAAiB;AAC1B,SAASC,WAAW;;;;;;;;;;;;;;;AAKb,IAAMC,2BAA8C;EACzDC,MAAM;EACNC,OAAO;AACT;IAyBGV,kBAAAA,QAAQW;AAlBJ,IAAMC,YAAN,MAAMA;EAkBX,CAACZ,eAAAA,IAA0B;AACzB,WAAOK,cAAc,IAAI;EAC3B;EAEAQ,SAAS;AACP,WAAO;MACLC,SAAS,KAAKC,MAAMC;MACpBC,OAAO,KAAKA;MACZC,QAAQ,KAAKA;MACbC,MAAM,KAAKC;IACb;EACF;EAEA,IAAIC,OAAO;AACT,WAAO,KAAKN;EACd;EAEA,IAAIK,SAAkB;AACpB,WAAOE,QAAQ,KAAKC,aAAa;EACnC;EAEA,IAAIL,SAAiB;AACnB,WAAO,KAAKH,MAAMS,WAAWN;EAC/B;;;;EAKA,IAAID,QAAQ;AACV,WAAO,KAAKQ;EACd;;;;;EAMA,MAAMN,KAAKO,UAA6B,CAAC,GAAkB;AACzD,QAAI,KAAKN,QAAQ;AAEf;IACF;AAEA,SAAKK,SAASC,QAAQC,SAAS;AAK/BpB,QAAI,WAAW;MAAEO,SAAS,KA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C,mBAAOS;UACT,SAASE,KAAK;AAEZvC,YAAAA,KAAIwC,KAAK,gBAAgB;cAAEpD,SAASa,MAAMd,KAAKE;YAAI,GAAA;;;;;;UAErD;QACF;MACF;AAGA,YAAM,KAAKI,SAASgD,KAAI;IAC1B;EACF;EAjIA,YACmBZ,WACDpB,UAAkC3C,+BAClD;AACA,UAAK,GAAA4E,kBAAA,MAAA,aAAA,MAAA,GAAAA,kBAAA,MAAA,WAAA,MAAA,GAXPA,kBAAA,MAAiB9D,eAAjB,MAAA,GAEA8D,kBAAA,MAAiBjD,YAAjB,MAAA,GACAiD,kBAAA,MAAiBtC,kBAAjB,MAAA,GAEAsC,kBAAA,MAAgBV,WAAhB,MAAA,GAAA,KAGmBH,YAAAA,WAAAA,KACDpB,UAAAA,SAAAA,KATD7B,cAAc,IAAI+D,WAAoCC,UAAUC,IAAI,GAAA,KAEpEpD,WAAW,IAAIqD,SAAQ;MAAEC,WAAW;IAAK,CAAA,GAAA,KACzC3C,iBAAiB,IAAI4C,iBAAAA,GAAAA,KAEtBhB,UAAU,IAAIiB,OAAAA;AAO5BrD,IAAAA,WAAUiC,WAAAA,QAAAA;;;;;;;;;AACVjC,IAAAA,WAAUa,SAAAA,QAAAA;;;;;;;;;EACZ;AA2HF;;;ACxJO,IAAMyC,mBAAmB,CAAeC,QAA2D;EACxGC,OAAO,OAAOC,SAAAA;AACZ,WAAOF,GAAGE,IAAAA;EACZ;AACF;AAEO,IAAMC,gBAAgB,OAAqBC,QAAuBC,aAAAA;AACvE,QAAMC,WAA2B,CAAA;AAEjC,aAAWC,WAAWF,UAAU;AAC9BC,aAASE,KAAK,MAAMJ,OAAOH,MAAMM,OAAAA,CAAAA;EACnC;AACA,SAAOD;AACT;",
6
- "names": ["safeRace", "Trigger", "invariant", "log", "inspect", "Writable", "Event", "Trigger", "latch", "inspectObject", "invariant", "log", "defaultReadStreamOptions", "live", "batch", "custom", "FeedQueue", "toJSON", "feedKey", "_feed", "key", "index", "length", "open", "isOpen", "feed", "Boolean", "_feedConsumer", "properties", "_index", "options", "start", "opts", "Object", "assign", "feedStream", "createReadableStream", "write", "data", "next", "_next", "undefined", "_currentBlock", "seq", "_messageTrigger", "wake", "updated", "emit", "onClose", "core", "off", "onError", "_destroyConsumer", "err", "message", "catch", "once", "on", "pipe", "close", "closed", "setClosed", "destroy", "peek", "pop", "Error", "truncate", "block", "wait", "_options", "autoReset", "AbstractFeedIterator", "toJSON", "open", "isOpen", "running", "isRunning", "_open", "_running", "log", "_onOpen", "start", "close", "stop", "_onClose", "invariant", "_stopTrigger", "wake", "Symbol", "asyncIterator", "_generator", "block", "safeRace", "wait", "_nextBlock", "undefined", "_define_property", "Trigger", "FeedIterator", "_queue", "pop", "_feed", "FeedQueue", "inspect", "Event", "SubscriptionList", "Trigger", "inspectObject", "invariant", "PublicKey", "log", "ComplexMap", "isNonNullable", "defaultFeedSetIteratorOptions", "stallTimeout", "inspect", "custom", "FeedSetIterator", "AbstractFeedIterator", "inspectObject", "toJSON", "open", "isOpen", "running", "isRunning", "indexes", "size", "_feedQueues", "feeds", "Array", "from", "values", "map", "feedQueue", "feed", "feedKey", "key", "index", "reiterateBlock", "block", "_trigger", "wake", "addFeed", "invariant", "has", "properties", "opened", "log", "queue", "FeedQueue", "set", "_subscriptions", "add", "updated", "on", "start", "options", "find", "equals", "hasFeed", "_onOpen", "_onClose", "clear", "Promise", "all", "close", "_nextBlock", "t", "_running", "queues", "blocks", "peek", "filter", "isNonNullable", "length", "idx", "_selector", "undefined", "setTimeout", "stalled", "emit", "clearTimeout", "Error", "get", "message", "pop", "err", "warn", "wait", "_define_property", "ComplexMap", "PublicKey", "hash", "Trigger", "autoReset", "SubscriptionList", "Event", "createFeedWriter", "cb", "write", "data", "writeMessages", "writer", "messages", "receipts", "message", "push"]
5
+ "mappings": ";;;;;;;;AAIA,OAAOA,cAAc;AAErB,SAASC,WAAAA,gBAAe;AACxB,SAASC,aAAAA,kBAAiB;AAC1B,SAASC,OAAAA,YAAW;;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inspect", "Writable", "Event", "Trigger", "latch", "inspectObject", "invariant", "log", "defaultReadStreamOptions", "live", "batch", "FeedQueue", "updated", "_messageTrigger", "autoReset", "_feedConsumer", "undefined", "_next", "_currentBlock", "_index", "_feed", "_options", "custom", "toJSON", "feedKey", "key", "index", "length", "open", "isOpen", "feed", "Boolean", "properties", "options", "start", "opts", "Object", "assign", "feedStream", "createReadableStream", "write", "data", "next", "seq", "wake", "emit", "onClose", "core", "off", "onError", "_destroyConsumer", "err", "message", "catch", "once", "on", "pipe", "close", "closed", "setClosed", "destroy", "peek", "pop", "Error", "truncate", "block", "wait", "AbstractFeedIterator", "_stopTrigger", "Trigger", "_open", "_running", "toJSON", "open", "isOpen", "running", "isRunning", "log", "_onOpen", "start", "close", "stop", "_onClose", "invariant", "wake", "Symbol", "asyncIterator", "_generator", "block", "safeRace", "wait", "_nextBlock", "undefined", "FeedIterator", "_queue", "_feed", "FeedQueue", "pop", "inspect", "Event", "SubscriptionList", "Trigger", "inspectObject", "invariant", "PublicKey", "log", "ComplexMap", "isNonNullable", "defaultFeedSetIteratorOptions", "stallTimeout", "FeedSetIterator", "AbstractFeedIterator", "_feedQueues", "ComplexMap", "PublicKey", "hash", "_trigger", "Trigger", "autoReset", "_subscriptions", "SubscriptionList", "stalled", "Event", "_selector", "options", "invariant", "inspect", "custom", "inspectObject", "toJSON", "open", "isOpen", "running", "isRunning", "indexes", "size", "feeds", "Array", "from", "values", "map", "feedQueue", "feed", "feedKey", "key", "index", "reiterateBlock", "block", "wake", "addFeed", "has", "properties", "opened", "log", "queue", "FeedQueue", "set", "add", "updated", "on", "start", "find", "equals", "hasFeed", "_onOpen", "_onClose", "clear", "Promise", "all", "close", "_nextBlock", "t", "_running", "queues", "blocks", "peek", "filter", "isNonNullable", "length", "idx", "undefined", "setTimeout", "emit", "clearTimeout", "Error", "get", "message", "pop", "err", "warn", "wait", "createFeedWriter", "cb", "write", "data", "writeMessages", "writer", "messages", "receipts", "message", "push"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"src/feed-wrapper.ts":{"bytes":35773,"imports":[{"path":"@dxos/node-std/util","kind":"import-statement","external":true},{"path":"streamx","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/feed-factory.ts":{"bytes":9571,"imports":[{"path":"lodash.defaultsdeep","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/hypercore","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"src/feed-wrapper.ts","kind":"import-statement","original":"./feed-wrapper"}],"format":"esm"},"src/feed-queue.ts":{"bytes":20539,"imports":[{"path":"@dxos/node-std/util","kind":"import-statement","external":true},{"path":"streamx","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/feed-iterator.ts":{"bytes":10629,"imports":[{"path":"race-as-promised","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"src/feed-queue.ts","kind":"import-statement","original":"./feed-queue"}],"format":"esm"},"src/feed-set-iterator.ts":{"bytes":20673,"imports":[{"path":"@dxos/node-std/util","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/feed-iterator.ts","kind":"import-statement","original":"./feed-iterator"},{"path":"src/feed-queue.ts","kind":"import-statement","original":"./feed-queue"}],"format":"esm"},"src/feed-store.ts":{"bytes":12603,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/feed-writer.ts":{"bytes":2625,"imports":[],"format":"esm"},"src/index.ts":{"bytes":1106,"imports":[{"path":"src/feed-factory.ts","kind":"import-statement","original":"./feed-factory"},{"path":"src/feed-iterator.ts","kind":"import-statement","original":"./feed-iterator"},{"path":"src/feed-set-iterator.ts","kind":"import-statement","original":"./feed-set-iterator"},{"path":"src/feed-queue.ts","kind":"import-statement","original":"./feed-queue"},{"path":"src/feed-store.ts","kind":"import-statement","original":"./feed-store"},{"path":"src/feed-wrapper.ts","kind":"import-statement","original":"./feed-wrapper"},{"path":"src/feed-writer.ts","kind":"import-statement","original":"./feed-writer"}],"format":"esm"},"src/testing/mocks.ts":{"bytes":3897,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true}],"format":"esm"},"src/testing/test-generator.ts":{"bytes":5937,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/hypercore","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true}],"format":"esm"},"src/testing/test-builder.ts":{"bytes":10338,"imports":[{"path":"@dxos/keyring","kind":"import-statement","external":true},{"path":"@dxos/random-access-storage","kind":"import-statement","external":true},{"path":"src/feed-factory.ts","kind":"import-statement","original":"../feed-factory"},{"path":"src/feed-store.ts","kind":"import-statement","original":"../feed-store"},{"path":"src/testing/test-generator.ts","kind":"import-statement","original":"./test-generator"}],"format":"esm"},"src/testing/index.ts":{"bytes":660,"imports":[{"path":"src/testing/mocks.ts","kind":"import-statement","original":"./mocks"},{"path":"src/testing/test-builder.ts","kind":"import-statement","original":"./test-builder"},{"path":"src/testing/test-generator.ts","kind":"import-statement","original":"./test-generator"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":25092},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-HBSCNY5U.mjs","kind":"import-statement"},{"path":"race-as-promised","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/node-std/util","kind":"import-statement","external":true},{"path":"streamx","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/node-std/util","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["AbstractFeedIterator","FeedFactory","FeedIterator","FeedQueue","FeedSetIterator","FeedStore","FeedWrapper","createFeedWriter","defaultFeedSetIteratorOptions","defaultReadStreamOptions","writeMessages"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0},"src/feed-iterator.ts":{"bytesInOutput":3182},"src/feed-queue.ts":{"bytesInOutput":5651},"src/feed-set-iterator.ts":{"bytesInOutput":5498},"src/feed-writer.ts":{"bytesInOutput":273}},"bytes":15102},"dist/lib/browser/testing/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":9852},"dist/lib/browser/testing/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-HBSCNY5U.mjs","kind":"import-statement"},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/keyring","kind":"import-statement","external":true},{"path":"@dxos/random-access-storage","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/hypercore","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true}],"exports":["MockFeedWriter","TestBuilder","TestGenerator","TestItemBuilder","defaultCodec","defaultTestBlockGenerator","defaultTestGenerator","defaultValueEncoding"],"entryPoint":"src/testing/index.ts","inputs":{"src/testing/mocks.ts":{"bytesInOutput":1161},"src/testing/index.ts":{"bytesInOutput":0},"src/testing/test-builder.ts":{"bytesInOutput":2341},"src/testing/test-generator.ts":{"bytesInOutput":1307}},"bytes":5241},"dist/lib/browser/chunk-HBSCNY5U.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":27224},"dist/lib/browser/chunk-HBSCNY5U.mjs":{"imports":[{"path":"@dxos/node-std/util","kind":"import-statement","external":true},{"path":"streamx","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"lodash.defaultsdeep","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/hypercore","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["FeedFactory","FeedStore","FeedWrapper"],"inputs":{"src/feed-wrapper.ts":{"bytesInOutput":9715},"src/feed-factory.ts":{"bytesInOutput":2403},"src/feed-store.ts":{"bytesInOutput":3498}},"bytes":15818}}}
1
+ {"inputs":{"src/feed-wrapper.ts":{"bytes":35830,"imports":[{"path":"@dxos/node-std/util","kind":"import-statement","external":true},{"path":"@dxos/node-std/util","kind":"import-statement","external":true},{"path":"streamx","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/feed-factory.ts":{"bytes":9086,"imports":[{"path":"lodash.defaultsdeep","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/hypercore","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"src/feed-wrapper.ts","kind":"import-statement","original":"./feed-wrapper"}],"format":"esm"},"src/feed-queue.ts":{"bytes":19592,"imports":[{"path":"@dxos/node-std/util","kind":"import-statement","external":true},{"path":"streamx","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/feed-iterator.ts":{"bytes":10114,"imports":[{"path":"race-as-promised","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"src/feed-queue.ts","kind":"import-statement","original":"./feed-queue"}],"format":"esm"},"src/feed-set-iterator.ts":{"bytes":19967,"imports":[{"path":"@dxos/node-std/util","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/feed-iterator.ts","kind":"import-statement","original":"./feed-iterator"},{"path":"src/feed-queue.ts","kind":"import-statement","original":"./feed-queue"}],"format":"esm"},"src/feed-store.ts":{"bytes":12102,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/feed-writer.ts":{"bytes":2625,"imports":[],"format":"esm"},"src/index.ts":{"bytes":1106,"imports":[{"path":"src/feed-factory.ts","kind":"import-statement","original":"./feed-factory"},{"path":"src/feed-iterator.ts","kind":"import-statement","original":"./feed-iterator"},{"path":"src/feed-set-iterator.ts","kind":"import-statement","original":"./feed-set-iterator"},{"path":"src/feed-queue.ts","kind":"import-statement","original":"./feed-queue"},{"path":"src/feed-store.ts","kind":"import-statement","original":"./feed-store"},{"path":"src/feed-wrapper.ts","kind":"import-statement","original":"./feed-wrapper"},{"path":"src/feed-writer.ts","kind":"import-statement","original":"./feed-writer"}],"format":"esm"},"src/testing/mocks.ts":{"bytes":3371,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true}],"format":"esm"},"src/testing/test-generator.ts":{"bytes":5521,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/hypercore","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true}],"format":"esm"},"src/testing/test-builder.ts":{"bytes":9653,"imports":[{"path":"@dxos/keyring","kind":"import-statement","external":true},{"path":"@dxos/random-access-storage","kind":"import-statement","external":true},{"path":"src/feed-factory.ts","kind":"import-statement","original":"../feed-factory"},{"path":"src/feed-store.ts","kind":"import-statement","original":"../feed-store"},{"path":"src/testing/test-generator.ts","kind":"import-statement","original":"./test-generator"}],"format":"esm"},"src/testing/index.ts":{"bytes":660,"imports":[{"path":"src/testing/mocks.ts","kind":"import-statement","original":"./mocks"},{"path":"src/testing/test-builder.ts","kind":"import-statement","original":"./test-builder"},{"path":"src/testing/test-generator.ts","kind":"import-statement","original":"./test-generator"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":24505},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-I36R5SR3.mjs","kind":"import-statement"},{"path":"race-as-promised","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/node-std/util","kind":"import-statement","external":true},{"path":"streamx","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/node-std/util","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["AbstractFeedIterator","FeedFactory","FeedIterator","FeedQueue","FeedSetIterator","FeedStore","FeedWrapper","createFeedWriter","defaultFeedSetIteratorOptions","defaultReadStreamOptions","writeMessages"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0},"src/feed-iterator.ts":{"bytesInOutput":2761},"src/feed-queue.ts":{"bytesInOutput":4963},"src/feed-set-iterator.ts":{"bytesInOutput":4938},"src/feed-writer.ts":{"bytesInOutput":273}},"bytes":13433},"dist/lib/browser/testing/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":9644},"dist/lib/browser/testing/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-I36R5SR3.mjs","kind":"import-statement"},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/keyring","kind":"import-statement","external":true},{"path":"@dxos/random-access-storage","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/hypercore","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true}],"exports":["MockFeedWriter","TestBuilder","TestGenerator","TestItemBuilder","defaultCodec","defaultTestBlockGenerator","defaultTestGenerator","defaultValueEncoding"],"entryPoint":"src/testing/index.ts","inputs":{"src/testing/mocks.ts":{"bytesInOutput":768},"src/testing/index.ts":{"bytesInOutput":0},"src/testing/test-builder.ts":{"bytesInOutput":1800},"src/testing/test-generator.ts":{"bytesInOutput":967}},"bytes":3967},"dist/lib/browser/chunk-I36R5SR3.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":27830},"dist/lib/browser/chunk-I36R5SR3.mjs":{"imports":[{"path":"@dxos/node-std/util","kind":"import-statement","external":true},{"path":"@dxos/node-std/util","kind":"import-statement","external":true},{"path":"streamx","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"lodash.defaultsdeep","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/hypercore","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["FeedFactory","FeedStore","FeedWrapper"],"inputs":{"src/feed-wrapper.ts":{"bytesInOutput":8770},"src/feed-factory.ts":{"bytesInOutput":2043},"src/feed-store.ts":{"bytesInOutput":3100}},"bytes":14115}}}
@@ -2,27 +2,20 @@ import "@dxos/node-std/globals";
2
2
  import {
3
3
  FeedFactory,
4
4
  FeedStore
5
- } from "../chunk-HBSCNY5U.mjs";
5
+ } from "../chunk-I36R5SR3.mjs";
6
6
 
7
7
  // src/testing/mocks.ts
8
8
  import { Event, scheduleTask } from "@dxos/async";
9
9
  import { Context } from "@dxos/context";
10
10
  import { PublicKey } from "@dxos/keys";
11
- function _define_property(obj, key, value) {
12
- if (key in obj) {
13
- Object.defineProperty(obj, key, {
14
- value,
15
- enumerable: true,
16
- configurable: true,
17
- writable: true
18
- });
19
- } else {
20
- obj[key] = value;
21
- }
22
- return obj;
23
- }
24
11
  var __dxlog_file = "/__w/dxos/dxos/packages/common/feed-store/src/testing/mocks.ts";
25
12
  var MockFeedWriter = class {
13
+ feedKey;
14
+ written = new Event();
15
+ messages = [];
16
+ constructor(feedKey = PublicKey.random()) {
17
+ this.feedKey = feedKey;
18
+ }
26
19
  async write(data, { afterWrite } = {}) {
27
20
  this.messages.push(data);
28
21
  const receipt = {
@@ -41,14 +34,6 @@ var MockFeedWriter = class {
41
34
  });
42
35
  return receipt;
43
36
  }
44
- constructor(feedKey = PublicKey.random()) {
45
- _define_property(this, "feedKey", void 0);
46
- _define_property(this, "written", void 0);
47
- _define_property(this, "messages", void 0);
48
- this.feedKey = feedKey;
49
- this.written = new Event();
50
- this.messages = [];
51
- }
52
37
  };
53
38
 
54
39
  // src/testing/test-builder.ts
@@ -59,19 +44,6 @@ import { StorageType, createStorage } from "@dxos/random-access-storage";
59
44
  import { sleep } from "@dxos/async";
60
45
  import { createCodecEncoding } from "@dxos/hypercore";
61
46
  import { faker } from "@dxos/random";
62
- function _define_property2(obj, key, value) {
63
- if (key in obj) {
64
- Object.defineProperty(obj, key, {
65
- value,
66
- enumerable: true,
67
- configurable: true,
68
- writable: true
69
- });
70
- } else {
71
- obj[key] = value;
72
- }
73
- return obj;
74
- }
75
47
  var defaultCodec = {
76
48
  encode: (obj) => Buffer.from(JSON.stringify(obj)),
77
49
  decode: (buffer) => JSON.parse(buffer.toString())
@@ -83,6 +55,11 @@ var defaultTestBlockGenerator = (i) => ({
83
55
  value: faker.lorem.sentence()
84
56
  });
85
57
  var TestGenerator = class {
58
+ _generate;
59
+ _count = 0;
60
+ constructor(_generate) {
61
+ this._generate = _generate;
62
+ }
86
63
  async writeBlocks(writer, { count = 1, delay } = {}) {
87
64
  return await Promise.all(Array.from(Array(count)).map(async () => {
88
65
  const data = this._generate(this._count++);
@@ -93,31 +70,17 @@ var TestGenerator = class {
93
70
  return receipt;
94
71
  }));
95
72
  }
96
- constructor(_generate) {
97
- _define_property2(this, "_generate", void 0);
98
- _define_property2(this, "_count", void 0);
99
- this._generate = _generate;
100
- this._count = 0;
101
- }
102
73
  };
103
74
  var defaultTestGenerator = new TestGenerator(defaultTestBlockGenerator);
104
75
 
105
76
  // src/testing/test-builder.ts
106
- function _define_property3(obj, key, value) {
107
- if (key in obj) {
108
- Object.defineProperty(obj, key, {
109
- value,
110
- enumerable: true,
111
- configurable: true,
112
- writable: true
113
- });
114
- } else {
115
- obj[key] = value;
116
- }
117
- return obj;
118
- }
119
77
  var evaluate = (builder, arg) => arg === "function" ? arg(builder) : arg;
120
78
  var TestBuilder = class _TestBuilder {
79
+ _properties;
80
+ static ROOT_DIR = "feeds";
81
+ constructor(_properties = {}) {
82
+ this._properties = _properties;
83
+ }
121
84
  /**
122
85
  * Creates a new builder with the current builder's properties.
123
86
  */
@@ -125,18 +88,15 @@ var TestBuilder = class _TestBuilder {
125
88
  return new _TestBuilder(Object.assign({}, this._properties));
126
89
  }
127
90
  get keyring() {
128
- var _this__properties;
129
- return (_this__properties = this._properties).keyring ?? (_this__properties.keyring = new Keyring());
91
+ return this._properties.keyring ??= new Keyring();
130
92
  }
131
93
  get storage() {
132
- var _this__properties;
133
- return (_this__properties = this._properties).storage ?? (_this__properties.storage = createStorage({
94
+ return this._properties.storage ??= createStorage({
134
95
  type: StorageType.RAM
135
- }));
96
+ });
136
97
  }
137
98
  get root() {
138
- var _this__properties;
139
- return (_this__properties = this._properties).root ?? (_this__properties.root = this.storage.createDirectory(_TestBuilder.ROOT_DIR));
99
+ return this._properties.root ??= this.storage.createDirectory(_TestBuilder.ROOT_DIR);
140
100
  }
141
101
  setKeyring(keyring) {
142
102
  this._properties.keyring = evaluate(this, keyring);
@@ -167,25 +127,20 @@ var TestBuilder = class _TestBuilder {
167
127
  factory: this.createFeedFactory()
168
128
  });
169
129
  }
170
- constructor(_properties = {}) {
171
- _define_property3(this, "_properties", void 0);
172
- this._properties = _properties;
173
- }
174
130
  };
175
- _define_property3(TestBuilder, "ROOT_DIR", "feeds");
176
131
  var TestItemBuilder = class extends TestBuilder {
177
- get valueEncoding() {
178
- return this._properties.valueEncoding;
179
- }
180
- get generator() {
181
- return this._properties.generator;
182
- }
183
132
  constructor() {
184
133
  super({
185
134
  valueEncoding: defaultValueEncoding,
186
135
  generator: defaultTestGenerator
187
136
  });
188
137
  }
138
+ get valueEncoding() {
139
+ return this._properties.valueEncoding;
140
+ }
141
+ get generator() {
142
+ return this._properties.generator;
143
+ }
189
144
  };
190
145
  export {
191
146
  MockFeedWriter,