@dxos/echo-db 2.33.1-dev.81fe88b8 → 2.33.1-dev.e48632f8
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/src/database/data-mirror.js +2 -2
- package/dist/src/database/data-mirror.js.map +1 -1
- package/dist/src/database/item-demuxer.test.js +2 -2
- package/dist/src/database/item-demuxer.test.js.map +1 -1
- package/dist/src/echo.d.ts +19 -19
- package/dist/src/echo.d.ts.map +1 -1
- package/dist/src/echo.js +32 -19
- package/dist/src/echo.js.map +1 -1
- package/dist/src/echo.test.js +1 -1
- package/dist/src/echo.test.js.map +1 -1
- package/dist/src/parties/party-core.d.ts.map +1 -1
- package/dist/src/parties/party-core.js +7 -3
- package/dist/src/parties/party-core.js.map +1 -1
- package/dist/src/parties/party-core.test.js +136 -5
- package/dist/src/parties/party-core.test.js.map +1 -1
- package/dist/src/parties/party-internal.d.ts.map +1 -1
- package/dist/src/parties/party-internal.js +15 -10
- package/dist/src/parties/party-internal.js.map +1 -1
- package/dist/src/parties/party-manager.test.js +4 -4
- package/dist/src/parties/party-manager.test.js.map +1 -1
- package/dist/src/pipeline/party-processor.d.ts +1 -1
- package/dist/src/pipeline/party-processor.d.ts.map +1 -1
- package/dist/src/pipeline/party-processor.js +3 -3
- package/dist/src/pipeline/party-processor.js.map +1 -1
- package/dist/src/pipeline/party-processor.test.js +8 -8
- package/dist/src/pipeline/party-processor.test.js.map +1 -1
- package/dist/src/pipeline/party-protocol-factory.d.ts +11 -0
- package/dist/src/pipeline/party-protocol-factory.d.ts.map +1 -1
- package/dist/src/pipeline/party-protocol-factory.js +2 -1
- package/dist/src/pipeline/party-protocol-factory.js.map +1 -1
- package/dist/src/pipeline/pipeline.js +1 -1
- package/dist/src/pipeline/pipeline.js.map +1 -1
- package/dist/src/pipeline/pipeline.test.js +3 -3
- package/dist/src/pipeline/pipeline.test.js.map +1 -1
- package/dist/src/util/persistant-ram-storage.d.ts.map +1 -1
- package/dist/src/util/persistant-ram-storage.js +1 -1
- package/dist/src/util/persistant-ram-storage.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +17 -17
- package/src/database/data-mirror.ts +2 -2
- package/src/database/item-demuxer.test.ts +3 -3
- package/src/echo.test.ts +1 -1
- package/src/echo.ts +76 -73
- package/src/parties/party-core.test.ts +233 -10
- package/src/parties/party-core.ts +8 -3
- package/src/parties/party-internal.ts +14 -9
- package/src/parties/party-manager.test.ts +5 -5
- package/src/pipeline/party-processor.test.ts +8 -8
- package/src/pipeline/party-processor.ts +3 -3
- package/src/pipeline/party-protocol-factory.ts +1 -1
- package/src/pipeline/pipeline.test.ts +4 -4
- package/src/pipeline/pipeline.ts +1 -1
- 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,
|
|
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('',
|
|
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
|
|
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('',
|
|
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
|
|
package/src/pipeline/pipeline.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2020 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { createStorage,
|
|
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,
|
|
14
|
-
const files = new Map<string,
|
|
13
|
+
const storage = createStorage(root, StorageType.RAM);
|
|
14
|
+
const files = new Map<string, File>();
|
|
15
15
|
|
|
16
16
|
const fn: any = {};
|
|
17
17
|
|