@dxos/echo-db 2.33.1-dev.ed7f30e1 → 2.33.1

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.
Files changed (53) hide show
  1. package/dist/src/database/data-mirror.js +2 -2
  2. package/dist/src/database/data-mirror.js.map +1 -1
  3. package/dist/src/database/item-demuxer.test.js +2 -2
  4. package/dist/src/database/item-demuxer.test.js.map +1 -1
  5. package/dist/src/echo.d.ts +19 -19
  6. package/dist/src/echo.d.ts.map +1 -1
  7. package/dist/src/echo.js +32 -19
  8. package/dist/src/echo.js.map +1 -1
  9. package/dist/src/echo.test.js +1 -1
  10. package/dist/src/echo.test.js.map +1 -1
  11. package/dist/src/parties/party-core.d.ts.map +1 -1
  12. package/dist/src/parties/party-core.js +7 -3
  13. package/dist/src/parties/party-core.js.map +1 -1
  14. package/dist/src/parties/party-core.test.js +136 -5
  15. package/dist/src/parties/party-core.test.js.map +1 -1
  16. package/dist/src/parties/party-internal.d.ts.map +1 -1
  17. package/dist/src/parties/party-internal.js +15 -10
  18. package/dist/src/parties/party-internal.js.map +1 -1
  19. package/dist/src/parties/party-manager.test.js +4 -4
  20. package/dist/src/parties/party-manager.test.js.map +1 -1
  21. package/dist/src/pipeline/party-processor.d.ts +1 -1
  22. package/dist/src/pipeline/party-processor.d.ts.map +1 -1
  23. package/dist/src/pipeline/party-processor.js +3 -3
  24. package/dist/src/pipeline/party-processor.js.map +1 -1
  25. package/dist/src/pipeline/party-processor.test.js +8 -8
  26. package/dist/src/pipeline/party-processor.test.js.map +1 -1
  27. package/dist/src/pipeline/party-protocol-factory.d.ts +11 -0
  28. package/dist/src/pipeline/party-protocol-factory.d.ts.map +1 -1
  29. package/dist/src/pipeline/party-protocol-factory.js +2 -1
  30. package/dist/src/pipeline/party-protocol-factory.js.map +1 -1
  31. package/dist/src/pipeline/pipeline.js +1 -1
  32. package/dist/src/pipeline/pipeline.js.map +1 -1
  33. package/dist/src/pipeline/pipeline.test.js +3 -3
  34. package/dist/src/pipeline/pipeline.test.js.map +1 -1
  35. package/dist/src/util/persistant-ram-storage.d.ts.map +1 -1
  36. package/dist/src/util/persistant-ram-storage.js +1 -1
  37. package/dist/src/util/persistant-ram-storage.js.map +1 -1
  38. package/dist/tsconfig.tsbuildinfo +1 -1
  39. package/package.json +20 -20
  40. package/src/database/data-mirror.ts +2 -2
  41. package/src/database/item-demuxer.test.ts +3 -3
  42. package/src/echo.test.ts +1 -1
  43. package/src/echo.ts +76 -73
  44. package/src/parties/party-core.test.ts +233 -10
  45. package/src/parties/party-core.ts +8 -3
  46. package/src/parties/party-internal.ts +14 -9
  47. package/src/parties/party-manager.test.ts +5 -5
  48. package/src/pipeline/party-processor.test.ts +8 -8
  49. package/src/pipeline/party-processor.ts +3 -3
  50. package/src/pipeline/party-protocol-factory.ts +1 -1
  51. package/src/pipeline/pipeline.test.ts +4 -4
  52. package/src/pipeline/pipeline.ts +1 -1
  53. package/src/util/persistant-ram-storage.ts +3 -3
@@ -12,7 +12,7 @@ import { createId, createKeyPair, PublicKey } from '@dxos/crypto';
12
12
  import { codec, createFeedWriter, FeedSelector, FeedStoreIterator, IEchoStream, Timeframe } from '@dxos/echo-protocol';
13
13
  import { FeedStore, createWritableFeedStream, createWritable, WritableArray } from '@dxos/feed-store';
14
14
  import { createSetPropertyMutation } from '@dxos/model-factory';
15
- import { createStorage, STORAGE_RAM } from '@dxos/random-access-multi-storage';
15
+ import { createStorage, StorageType } from '@dxos/random-access-multi-storage';
16
16
  import { jsonReplacer } from '@dxos/util';
17
17
 
18
18
  import { TimeframeClock } from '../database';
@@ -24,7 +24,7 @@ const log = debug('dxos:echo:pipeline:test');
24
24
  // TODO(burdon): Test read-only.
25
25
  describe('pipeline', () => {
26
26
  test('streams', async () => {
27
- const storage = createStorage('', STORAGE_RAM);
27
+ const storage = createStorage('', StorageType.RAM);
28
28
  const feedStore = new FeedStore(storage, { valueEncoding: codec });
29
29
  const feedKeys: Uint8Array[] = [];
30
30
  const feedSelector: FeedSelector = descriptor => !!feedKeys.find(key => descriptor.key.equals(key));
@@ -52,7 +52,7 @@ describe('pipeline', () => {
52
52
  await partyProcessor.processMessage({
53
53
  data: createPartyGenesisMessage(keyring, partyKey, feedKey.publicKey, identityKey),
54
54
  meta: {
55
- feedKey: feedKey.publicKey.asBuffer(),
55
+ feedKey: feedKey.publicKey,
56
56
  seq: 0
57
57
  }
58
58
  });
@@ -86,7 +86,7 @@ describe('pipeline', () => {
86
86
  });
87
87
 
88
88
  test('writing', async () => {
89
- const storage = createStorage('', STORAGE_RAM);
89
+ const storage = createStorage('', StorageType.RAM);
90
90
  const feedStore = new FeedStore(storage, { valueEncoding: codec });
91
91
  const feedReadStream = new FeedStoreIterator(() => true, () => 0, new Timeframe());
92
92
 
@@ -141,7 +141,7 @@ export class Pipeline {
141
141
  meta: {
142
142
  seq: block.seq,
143
143
  feedKey: block.key,
144
- memberKey: memberKey.asUint8Array(),
144
+ memberKey,
145
145
  timeframe: message.echo.timeframe ?? new Timeframe()
146
146
  },
147
147
  data: message.echo
@@ -2,7 +2,7 @@
2
2
  // Copyright 2020 DXOS.org
3
3
  //
4
4
 
5
- import { createStorage, IFile, IStorage } from '@dxos/random-access-multi-storage';
5
+ import { StorageType, createStorage, File, IStorage } from '@dxos/random-access-multi-storage';
6
6
 
7
7
  /**
8
8
  * A wrapper around RAM storage that preserves file data when closing and re-opening files.
@@ -10,8 +10,8 @@ import { createStorage, IFile, IStorage } from '@dxos/random-access-multi-storag
10
10
  // TODO(burdon): Factor out?
11
11
  export function createRamStorage (): IStorage {
12
12
  const root = 'snapshots';
13
- const storage = createStorage(root, 'ram');
14
- const files = new Map<string, IFile>();
13
+ const storage = createStorage(root, StorageType.RAM);
14
+ const files = new Map<string, File>();
15
15
 
16
16
  const fn: any = {};
17
17