@dxos/echo-protocol 2.33.7-dev.c2ba88fb → 2.33.8-dev.c77ba621
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/feeds/feed-store-iterator.d.ts.map +1 -1
- package/dist/src/feeds/feed-store-iterator.js +2 -1
- package/dist/src/feeds/feed-store-iterator.js.map +1 -1
- package/dist/src/feeds/feed-store-iterator.test.js +9 -39
- package/dist/src/feeds/feed-store-iterator.test.js.map +1 -1
- package/dist/src/feeds/feed-writer.d.ts +1 -1
- package/dist/src/feeds/feed-writer.d.ts.map +1 -1
- package/dist/src/feeds/feed-writer.js +4 -3
- package/dist/src/feeds/feed-writer.js.map +1 -1
- package/dist/src/feeds/feed.test.js +3 -2
- package/dist/src/feeds/feed.test.js.map +1 -1
- package/dist/src/proto/gen/dxos/halo/keys.d.ts +9 -9
- package/dist/src/proto/gen/index.d.ts.map +1 -1
- package/dist/src/proto/gen/index.js +1 -1
- package/dist/src/proto/gen/index.js.map +1 -1
- package/dist/src/proto/substitutions.d.ts +2 -2
- package/dist/src/proto/substitutions.js +2 -2
- package/dist/src/proto/substitutions.js.map +1 -1
- package/dist/src/spacetime/substitutions.js +2 -2
- package/dist/src/spacetime/substitutions.js.map +1 -1
- package/dist/src/spacetime/timeframe.d.ts.map +1 -1
- package/dist/src/spacetime/timeframe.js +3 -2
- package/dist/src/spacetime/timeframe.js.map +1 -1
- package/dist/src/spacetime/timeframe.test.js +2 -1
- package/dist/src/spacetime/timeframe.test.js.map +1 -1
- package/dist/src/types.d.ts +1 -1
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -10
- package/src/feeds/feed-store-iterator.test.ts +3 -40
- package/src/feeds/feed-store-iterator.ts +2 -1
- package/src/feeds/feed-writer.ts +2 -1
- package/src/feeds/feed.test.ts +2 -1
- package/src/proto/gen/dxos/halo/keys.ts +9 -9
- package/src/proto/gen/index.ts +1 -1
- package/src/proto/substitutions.ts +1 -1
- package/src/spacetime/substitutions.ts +1 -1
- package/src/spacetime/timeframe.test.ts +2 -1
- package/src/spacetime/timeframe.ts +3 -2
- package/src/types.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feed-store-iterator.d.ts","sourceRoot":"","sources":["../../../src/feeds/feed-store-iterator.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,EAAW,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAqB,cAAc,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"feed-store-iterator.d.ts","sourceRoot":"","sources":["../../../src/feeds/feed-store-iterator.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,EAAW,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAqB,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGrE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAWrC,oBAAY,eAAe,GAAG,CAAC,UAAU,EAAE,SAAS,EAAE,KAAK,MAAM,GAAG,SAAS,CAAA;AAC7E,oBAAY,YAAY,GAAG,CAAC,UAAU,EAAE,cAAc,KAAK,OAAO,CAAA;AAElE;;;;GAIG;AAEH,qBAAa,iBAAkB,YAAW,aAAa,CAAC,SAAS,CAAC;IAiC9D,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,cAAc;IAlCjC,kCAAkC;IAClC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA6B;IAE7D,oCAAoC;IACpC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAKtB;IAEL,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAiB;IAC1C,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAqB;IAExD;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAiB;IAG/C,OAAO,CAAC,aAAa,CAAK;IAE1B,OAAO,CAAC,OAAO,CAAS;IAExB,SAAgB,OAAO,qBAA4B;IAEnD;;;;OAIG;gBAEgB,aAAa,EAAE,YAAY,EAC3B,gBAAgB,EAAE,eAAe,EACjC,cAAc,EAAE,SAAS;IAM5C;;;OAGG;IACH,iBAAiB,CAAE,UAAU,EAAE,cAAc;IAM7C;;OAEG;IACG,KAAK;IAMX;;;OAGG;IACH,CAAC,MAAM,CAAC,aAAa,CAAC;IAItB;;OAEG;YAEW,gBAAgB;YAiBhB,qBAAqB;IAkBnC;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAO7B;;OAEG;IAEH,OAAO,CAAC,aAAa;IAmBrB;;;OAGG;IAEH,OAAO,CAAC,UAAU;IAwBlB;;;OAGG;YAEW,YAAY;IAqB1B;;OAEG;IAEK,UAAU;CAyBnB"}
|
|
@@ -13,6 +13,7 @@ const readable_stream_1 = require("readable-stream");
|
|
|
13
13
|
const async_1 = require("@dxos/async");
|
|
14
14
|
const crypto_1 = require("@dxos/crypto");
|
|
15
15
|
const feed_store_1 = require("@dxos/feed-store");
|
|
16
|
+
const protocols_1 = require("@dxos/protocols");
|
|
16
17
|
const log = (0, debug_1.default)('dxos:echo:feed-store-iterator:log');
|
|
17
18
|
const STALL_TIMEOUT = 1000;
|
|
18
19
|
/**
|
|
@@ -92,7 +93,7 @@ class FeedStoreIterator {
|
|
|
92
93
|
}
|
|
93
94
|
}
|
|
94
95
|
async _startReadingFromFeed(descriptor) {
|
|
95
|
-
const frameSeq = this._skipTimeframe.get(
|
|
96
|
+
const frameSeq = this._skipTimeframe.get(protocols_1.PublicKey.from(descriptor.key));
|
|
96
97
|
const startIdx = frameSeq !== undefined ? frameSeq + 1 : 0;
|
|
97
98
|
log(`Starting reading from feed ${descriptor.key.toString()} from sequence ${startIdx}`);
|
|
98
99
|
(0, assert_1.default)(descriptor.feed, 'Feed is not initialized');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feed-store-iterator.js","sourceRoot":"","sources":["../../../src/feeds/feed-store-iterator.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,oDAA4B;AAC5B,kDAA0B;AAC1B,qDAA2C;AAE3C,uCAA6C;AAC7C,
|
|
1
|
+
{"version":3,"file":"feed-store-iterator.js","sourceRoot":"","sources":["../../../src/feeds/feed-store-iterator.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,oDAA4B;AAC5B,kDAA0B;AAC1B,qDAA2C;AAE3C,uCAA6C;AAC7C,yCAA2C;AAC3C,iDAAqE;AACrE,+CAA4C;AAK5C,MAAM,GAAG,GAAG,IAAA,eAAK,EAAC,mCAAmC,CAAC,CAAC;AACvD,MAAM,aAAa,GAAG,IAAI,CAAC;AAW3B;;;;GAIG;AACH,kCAAkC;AAClC,MAAa,iBAAiB;IA2B5B;;;;OAIG;IACH,YACmB,aAA2B,EAC3B,gBAAiC,EACjC,cAAyB;QAFzB,kBAAa,GAAb,aAAa,CAAc;QAC3B,qBAAgB,GAAhB,gBAAgB,CAAiB;QACjC,mBAAc,GAAd,cAAc,CAAW;QAlC5C,kCAAkC;QACjB,oBAAe,GAAG,IAAI,GAAG,EAAkB,CAAC;QAE7D,oCAAoC;QACnB,eAAU,GAAG,IAAI,GAAG,EAKjC,CAAC;QAEY,aAAQ,GAAG,IAAI,eAAO,EAAE,CAAC;QACzB,uBAAkB,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QAExD;;WAEG;QACc,kBAAa,GAAG,IAAI,eAAO,EAAE,CAAC;QAE/C,mCAAmC;QAC3B,kBAAa,GAAG,CAAC,CAAC;QAElB,YAAO,GAAG,KAAK,CAAC;QAER,YAAO,GAAG,IAAI,aAAK,EAAe,CAAC;QAYjD,IAAA,gBAAM,EAAC,aAAa,CAAC,CAAC;QACtB,IAAA,gB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
@@ -13,6 +13,7 @@ const pify_1 = __importDefault(require("pify"));
|
|
|
13
13
|
const async_1 = require("@dxos/async");
|
|
14
14
|
const crypto_1 = require("@dxos/crypto");
|
|
15
15
|
const feed_store_1 = require("@dxos/feed-store");
|
|
16
|
+
const protocols_1 = require("@dxos/protocols");
|
|
16
17
|
const random_access_multi_storage_1 = require("@dxos/random-access-multi-storage");
|
|
17
18
|
const util_1 = require("@dxos/util");
|
|
18
19
|
const proto_1 = require("../proto");
|
|
@@ -31,7 +32,7 @@ describe('feed store iterator', () => {
|
|
|
31
32
|
// Create the ordered feed stream.
|
|
32
33
|
//
|
|
33
34
|
// Update when processed downstream.
|
|
34
|
-
|
|
35
|
+
const currentTimeframe = new spacetime_1.Timeframe();
|
|
35
36
|
// TODO(burdon): Factor out/generalize.
|
|
36
37
|
// Select message based on timeframe.
|
|
37
38
|
const messageSelector = (candidates) => {
|
|
@@ -61,7 +62,7 @@ describe('feed store iterator', () => {
|
|
|
61
62
|
// TODO(burdon): Handle tie-break if multiple messages.
|
|
62
63
|
return (_a = next[0]) === null || _a === void 0 ? void 0 : _a.i;
|
|
63
64
|
};
|
|
64
|
-
const feedSelector = descriptor => feeds.has(
|
|
65
|
+
const feedSelector = descriptor => feeds.has(protocols_1.PublicKey.from(descriptor.key));
|
|
65
66
|
const iterator = new feed_store_iterator_1.FeedStoreIterator(feedSelector, messageSelector, new spacetime_1.Timeframe());
|
|
66
67
|
//
|
|
67
68
|
// Create feeds.
|
|
@@ -69,9 +70,9 @@ describe('feed store iterator', () => {
|
|
|
69
70
|
const feeds = new util_1.ComplexMap(key => key.toHex());
|
|
70
71
|
await Promise.all(Array.from({ length: config.numFeeds }, (_, i) => i + 1).map(async () => {
|
|
71
72
|
const { publicKey, secretKey } = (0, crypto_1.createKeyPair)();
|
|
72
|
-
const descriptor = await feedStore.openReadWriteFeed(
|
|
73
|
+
const descriptor = await feedStore.openReadWriteFeed(protocols_1.PublicKey.from(publicKey), secretKey);
|
|
73
74
|
const feed = descriptor.feed;
|
|
74
|
-
feeds.set(
|
|
75
|
+
feeds.set(protocols_1.PublicKey.from(feed.key), feed);
|
|
75
76
|
iterator.addFeedDescriptor(descriptor);
|
|
76
77
|
}));
|
|
77
78
|
log(JSON.stringify({
|
|
@@ -87,7 +88,7 @@ describe('feed store iterator', () => {
|
|
|
87
88
|
// Create timeframe dependency.
|
|
88
89
|
const timeframe = new spacetime_1.Timeframe(Array.from(feeds.values())
|
|
89
90
|
.filter(f => f.key !== feed.key && f.length > 0)
|
|
90
|
-
.map(f => [
|
|
91
|
+
.map(f => [protocols_1.PublicKey.from(f.key), f.length - 1]));
|
|
91
92
|
// Create data.
|
|
92
93
|
const word = faker_1.default.lorem.word();
|
|
93
94
|
const value = { i, word };
|
|
@@ -96,52 +97,21 @@ describe('feed store iterator', () => {
|
|
|
96
97
|
await (0, pify_1.default)(feed.append.bind(feed))(message);
|
|
97
98
|
log('Write:', (0, crypto_1.keyToString)(feed.key), value, timeframe);
|
|
98
99
|
}
|
|
99
|
-
return;
|
|
100
|
-
//
|
|
101
|
-
// Consume iterator.
|
|
102
|
-
//
|
|
103
|
-
let j = 0;
|
|
104
|
-
const [counter, updateCounter] = (0, async_1.latch)(config.numMessages);
|
|
105
|
-
setImmediate(async () => {
|
|
106
|
-
var _a, _b;
|
|
107
|
-
for await (const message of iterator) {
|
|
108
|
-
(0, assert_1.default)((_b = (_a = message.data) === null || _a === void 0 ? void 0 : _a.echo) === null || _b === void 0 ? void 0 : _b.mutation);
|
|
109
|
-
const { key: feedKey, seq, data: { timeframe, echo: { itemId, mutation } } } = message;
|
|
110
|
-
(0, assert_1.default)(itemId);
|
|
111
|
-
(0, assert_1.default)(timeframe);
|
|
112
|
-
(0, assert_1.default)(mutation);
|
|
113
|
-
const { key, value: word } = proto_1.schema.getCodecForType('dxos.echo.testing.TestItemMutation').decode(mutation);
|
|
114
|
-
const i = parseInt(key);
|
|
115
|
-
log('Read:', j, { i, word }, i === j, timeframe);
|
|
116
|
-
// Check order.
|
|
117
|
-
expect(i).toBe(j);
|
|
118
|
-
// Update timeframe for node.
|
|
119
|
-
currentTimeframe = spacetime_1.Timeframe.merge(currentTimeframe, new spacetime_1.Timeframe([[crypto_1.PublicKey.from(feedKey), seq]]));
|
|
120
|
-
updateCounter();
|
|
121
|
-
j++;
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
await counter;
|
|
125
|
-
await iterator.close();
|
|
126
|
-
await feedStore.close();
|
|
127
|
-
// Test expected number of messages.
|
|
128
|
-
expect(Array.from(feeds.values())
|
|
129
|
-
.reduce((sum, feed) => sum + feed.length, 0)).toBe(config.numMessages);
|
|
130
100
|
});
|
|
131
101
|
test('skipping initial messages', async () => {
|
|
132
102
|
const feedStore = new feed_store_1.FeedStore((0, random_access_multi_storage_1.createStorage)('', random_access_multi_storage_1.StorageType.RAM).directory('feed'), {
|
|
133
103
|
valueEncoding: proto_1.schema.getCodecForType('dxos.echo.testing.TestItemMutation')
|
|
134
104
|
});
|
|
135
105
|
const [keyPair1, keyPair2] = [(0, crypto_1.createKeyPair)(), (0, crypto_1.createKeyPair)()];
|
|
136
|
-
const descriptor1 = await feedStore.openReadWriteFeed(
|
|
137
|
-
const descriptor2 = await feedStore.openReadWriteFeed(
|
|
106
|
+
const descriptor1 = await feedStore.openReadWriteFeed(protocols_1.PublicKey.from(keyPair1.publicKey), keyPair1.secretKey);
|
|
107
|
+
const descriptor2 = await feedStore.openReadWriteFeed(protocols_1.PublicKey.from(keyPair2.publicKey), keyPair2.secretKey);
|
|
138
108
|
const feed1 = descriptor1.feed;
|
|
139
109
|
const feed2 = descriptor2.feed;
|
|
140
110
|
await (0, pify_1.default)(feed1.append.bind(feed1))({ key: 'feed1', value: '0' });
|
|
141
111
|
await (0, pify_1.default)(feed1.append.bind(feed1))({ key: 'feed1', value: '1' });
|
|
142
112
|
await (0, pify_1.default)(feed2.append.bind(feed2))({ key: 'feed2', value: '0' });
|
|
143
113
|
await (0, pify_1.default)(feed2.append.bind(feed2))({ key: 'feed2', value: '1' });
|
|
144
|
-
const timeframe = new spacetime_1.Timeframe([[
|
|
114
|
+
const timeframe = new spacetime_1.Timeframe([[protocols_1.PublicKey.from(feed1.key), 0]]);
|
|
145
115
|
const iterator = new feed_store_iterator_1.FeedStoreIterator(() => true, () => 0, timeframe);
|
|
146
116
|
iterator.addFeedDescriptor(descriptor1);
|
|
147
117
|
iterator.addFeedDescriptor(descriptor2);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feed-store-iterator.test.js","sourceRoot":"","sources":["../../../src/feeds/feed-store-iterator.test.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;AAEF,oDAA4B;AAC5B,kDAA0B;AAC1B,kDAA0B;AAC1B,gDAAwB;AAExB,uCAAoC;AACpC,
|
|
1
|
+
{"version":3,"file":"feed-store-iterator.test.js","sourceRoot":"","sources":["../../../src/feeds/feed-store-iterator.test.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;AAEF,oDAA4B;AAC5B,kDAA0B;AAC1B,kDAA0B;AAC1B,gDAAwB;AAExB,uCAAoC;AACpC,yCAAoE;AACpE,iDAA4D;AAC5D,+CAA4C;AAC5C,mFAA+E;AAC/E,qCAAwC;AAExC,oCAAiE;AACjE,4CAAyC;AAEzC,+DAAwE;AAExE,MAAM,GAAG,GAAG,IAAA,eAAK,EAAC,oCAAoC,CAAC,CAAC;AAExD,eAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAEd,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACnC,IAAI,CAAC,eAAe,EAAE,KAAK,IAAI,EAAE;QAC/B,MAAM,MAAM,GAAG;YACb,QAAQ,EAAE,CAAC;YACX,WAAW,EAAE,EAAE;SAChB,CAAC;QAEF,MAAM,SAAS,GAAG,IAAI,sBAAS,CAAC,IAAA,2CAAa,EAAC,EAAE,EAAE,yCAAW,CAAC,G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QAAQ,CAAC,CAAC,cAAc,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;QAC9D,MAAM,CAAC,QAAQ,CAAC,CAAC,cAAc,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
/// <reference types="node" />
|
|
4
4
|
/// <reference types="node" />
|
|
5
5
|
import { Event } from '@dxos/async';
|
|
6
|
-
import { PublicKey } from '@dxos/crypto';
|
|
7
6
|
import type { HypercoreFeed } from '@dxos/feed-store';
|
|
7
|
+
import { PublicKey } from '@dxos/protocols';
|
|
8
8
|
import { MaybePromise } from '@dxos/util';
|
|
9
9
|
import { FeedKey } from '../types';
|
|
10
10
|
export interface WriteReceipt {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feed-writer.d.ts","sourceRoot":"","sources":["../../../src/feeds/feed-writer.ts"],"names":[],"mappings":";;;;AAMA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"feed-writer.d.ts","sourceRoot":"","sources":["../../../src/feeds/feed-writer.ts"],"names":[],"mappings":";;;;AAMA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,OAAO,CAAA;IAChB,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,KAAK,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,OAAO,CAAC,YAAY,CAAC,CAAA;CAC7C;AAED,eAAO,MAAM,aAAa,kFAExB,CAAC;AAEH,eAAO,MAAM,gBAAgB,YAAa,aAAa,kBAQrD,CAAC;AAEH,eAAO,MAAM,8BAA8B,UAAW,OAAO,cAAc,KAAG,WAAW,GAAG,CAQ1F,CAAC;AAEH,qBAAa,cAAc,CAAC,CAAC,CAAE,YAAW,UAAU,CAAC,CAAC,CAAC;IAMnD,QAAQ,CAAC,OAAO;IALlB,QAAQ,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAK;IAE3B,QAAQ,CAAC,OAAO,2BAAiC;gBAGtC,OAAO,YAAqB;IAGjC,KAAK,CAAE,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC;CAYhD"}
|
|
@@ -10,6 +10,7 @@ exports.MockFeedWriter = exports.createMockFeedWriterFromStream = exports.create
|
|
|
10
10
|
const pify_1 = __importDefault(require("pify"));
|
|
11
11
|
const async_1 = require("@dxos/async");
|
|
12
12
|
const crypto_1 = require("@dxos/crypto");
|
|
13
|
+
const protocols_1 = require("@dxos/protocols");
|
|
13
14
|
const mapFeedWriter = (map, writer) => ({
|
|
14
15
|
write: async (message) => writer.write(await map(message))
|
|
15
16
|
});
|
|
@@ -18,7 +19,7 @@ const createFeedWriter = (feed) => ({
|
|
|
18
19
|
write: async (message) => {
|
|
19
20
|
const seq = await (0, pify_1.default)(feed.append.bind(feed))(message);
|
|
20
21
|
return {
|
|
21
|
-
feedKey:
|
|
22
|
+
feedKey: protocols_1.PublicKey.from(feed.key),
|
|
22
23
|
seq
|
|
23
24
|
};
|
|
24
25
|
}
|
|
@@ -28,14 +29,14 @@ const createMockFeedWriterFromStream = (strem) => ({
|
|
|
28
29
|
write: async (message) => {
|
|
29
30
|
await (0, pify_1.default)(strem.write.bind(strem))(message);
|
|
30
31
|
return {
|
|
31
|
-
feedKey:
|
|
32
|
+
feedKey: protocols_1.PublicKey.from(Buffer.alloc(crypto_1.PUBLIC_KEY_LENGTH)),
|
|
32
33
|
seq: 0
|
|
33
34
|
};
|
|
34
35
|
}
|
|
35
36
|
});
|
|
36
37
|
exports.createMockFeedWriterFromStream = createMockFeedWriterFromStream;
|
|
37
38
|
class MockFeedWriter {
|
|
38
|
-
constructor(feedKey =
|
|
39
|
+
constructor(feedKey = protocols_1.PublicKey.random()) {
|
|
39
40
|
this.feedKey = feedKey;
|
|
40
41
|
this.messages = [];
|
|
41
42
|
this.written = new async_1.Event();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feed-writer.js","sourceRoot":"","sources":["../../../src/feeds/feed-writer.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,gDAAwB;AAExB,uCAAoC;AACpC,
|
|
1
|
+
{"version":3,"file":"feed-writer.js","sourceRoot":"","sources":["../../../src/feeds/feed-writer.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,gDAAwB;AAExB,uCAAoC;AACpC,yCAAiD;AAEjD,+CAA4C;AAcrC,MAAM,aAAa,GAAG,CAAO,GAAgC,EAAE,MAAqB,EAAiB,EAAE,CAAC,CAAC;IAC9G,KAAK,EAAE,KAAK,EAAC,OAAO,EAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,OAAO,CAAC,CAAC;CACzD,CAAC,CAAC;AAFU,QAAA,aAAa,iBAEvB;AAEI,MAAM,gBAAgB,GAAG,CAAI,IAAmB,EAAiB,EAAE,CAAC,CAAC;IAC1E,KAAK,EAAE,KAAK,EAAC,OAAO,EAAC,EAAE;QACrB,MAAM,GAAG,GAAG,MAAM,IAAA,cAAI,EAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;QACxD,OAAO;YACL,OAAO,EAAE,qBAAS,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;YACjC,GAAG;SACJ,CAAC;IACJ,CAAC;CACF,CAAC,CAAC;AARU,QAAA,gBAAgB,oBAQ1B;AAEI,MAAM,8BAA8B,GAAG,CAAC,KAA4B,EAAmB,EAAE,CAAC,CAAC;IAChG,KAAK,EAAE,KAAK,EAAC,OAAO,EAAC,EAAE;QACrB,MAAM,IAAA,cAAI,EAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;QAC7C,OAAO;YACL,OAAO,EAAE,qBAAS,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,0BAAiB,CAAC,CAAC;YACxD,GAAG,EAAE,CAAC;SACP,CAAC;IACJ,CAAC;CACF,CAAC,CAAC;AARU,QAAA,8BAA8B,kCAQxC;AAEH,MAAa,cAAc;IAKzB,YACW,UAAU,qBAAS,CAAC,MAAM,EAAE;QAA5B,YAAO,GAAP,OAAO,CAAqB;QAL9B,aAAQ,GAAQ,EAAE,CAAA;QAElB,YAAO,GAAG,IAAI,aAAK,EAAqB,CAAA;IAI9C,CAAC;IAEJ,KAAK,CAAC,KAAK,CAAE,OAAU;QACrB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAE5B,MAAM,OAAO,GAAiB;YAC5B,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,GAAG,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC;SAC9B,CAAC;QAEF,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;QAEtC,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AArBD,wCAqBC"}
|
|
@@ -9,6 +9,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
const pify_1 = __importDefault(require("pify"));
|
|
10
10
|
const crypto_1 = require("@dxos/crypto");
|
|
11
11
|
const feed_store_1 = require("@dxos/feed-store");
|
|
12
|
+
const protocols_1 = require("@dxos/protocols");
|
|
12
13
|
const random_access_multi_storage_1 = require("@dxos/random-access-multi-storage");
|
|
13
14
|
const proto_1 = require("../proto");
|
|
14
15
|
const feed_writer_1 = require("./feed-writer");
|
|
@@ -22,7 +23,7 @@ describe('Feed tests:', () => {
|
|
|
22
23
|
test('hypercore', async () => {
|
|
23
24
|
const feedStore = new feed_store_1.FeedStore((0, random_access_multi_storage_1.createStorage)('', random_access_multi_storage_1.StorageType.RAM).directory('feed'), { valueEncoding: proto_1.codec });
|
|
24
25
|
const { publicKey, secretKey } = (0, crypto_1.createKeyPair)();
|
|
25
|
-
const { feed } = await feedStore.openReadWriteFeed(
|
|
26
|
+
const { feed } = await feedStore.openReadWriteFeed(protocols_1.PublicKey.from(publicKey), secretKey);
|
|
26
27
|
expect(feed.length).toBe(0);
|
|
27
28
|
const data = {};
|
|
28
29
|
await (0, pify_1.default)(feed.append.bind(feed))(data);
|
|
@@ -33,7 +34,7 @@ describe('Feed tests:', () => {
|
|
|
33
34
|
test('feed writer', async () => {
|
|
34
35
|
const feedStore = new feed_store_1.FeedStore((0, random_access_multi_storage_1.createStorage)('', random_access_multi_storage_1.StorageType.RAM).directory('feed'), { valueEncoding: proto_1.codec });
|
|
35
36
|
const { publicKey, secretKey } = (0, crypto_1.createKeyPair)();
|
|
36
|
-
const { feed } = await feedStore.openReadWriteFeed(
|
|
37
|
+
const { feed } = await feedStore.openReadWriteFeed(protocols_1.PublicKey.from(publicKey), secretKey);
|
|
37
38
|
const writer = (0, feed_writer_1.createFeedWriter)(feed);
|
|
38
39
|
const data = {
|
|
39
40
|
echo: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feed.test.js","sourceRoot":"","sources":["../../../src/feeds/feed.test.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;AAEF,gDAAwB;AAExB,
|
|
1
|
+
{"version":3,"file":"feed.test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AAC,CAAC;QAE/B,MAAM,KAAK,GAAG,MAAM,IAAA,cAAI,EAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACjD,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -16,36 +16,36 @@ export interface PrivKey {
|
|
|
16
16
|
}
|
|
17
17
|
export interface KeyRecord {
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* The `KeyType` type of the key. This is often unknown for keys from other sources.
|
|
20
20
|
*/
|
|
21
21
|
type: KeyType;
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* The public key as a Buffer (required).
|
|
24
24
|
*/
|
|
25
25
|
publicKey: ReturnType<(typeof substitutions)["dxos.halo.keys.PubKey"]["decode"]>;
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
27
|
+
* The secret key as a Buffer (this will never be visible outside the Keyring).
|
|
28
28
|
*/
|
|
29
29
|
secretKey?: ReturnType<(typeof substitutions)["dxos.halo.keys.PrivKey"]["decode"]>;
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
31
|
+
* Is this key from a Greeting "hint"?
|
|
32
32
|
*/
|
|
33
33
|
hint?: boolean;
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
36
|
-
* may be false for "inception keys" such as the Party key.
|
|
35
|
+
* Determines if this is our key?
|
|
36
|
+
* Usually true if `secretKey` is present; may be false for "inception keys" such as the Party key.
|
|
37
37
|
*/
|
|
38
38
|
own?: boolean;
|
|
39
39
|
/**
|
|
40
|
-
*
|
|
40
|
+
* Is this key to be trusted?
|
|
41
41
|
*/
|
|
42
42
|
trusted?: boolean;
|
|
43
43
|
/**
|
|
44
|
-
*
|
|
44
|
+
* An RFC-3339 date/time string for when the key was added to the Keyring.
|
|
45
45
|
*/
|
|
46
46
|
added?: string;
|
|
47
47
|
/**
|
|
48
|
-
*
|
|
48
|
+
* An RFC-3339 date/time string for when the key was created.
|
|
49
49
|
*/
|
|
50
50
|
created?: string;
|
|
51
51
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/proto/gen/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,KAAK,gBAAgB,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,cAAc,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,oBAAoB,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,kBAAkB,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,iBAAiB,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,kBAAkB,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,iBAAiB,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,mBAAmB,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,cAAc,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,eAAe,MAAM,mBAAmB,CAAC;AAErD,MAAM,WAAW,KAAK;IAClB,0BAA0B,EAAE,gBAAgB,CAAC,OAAO,CAAC;IACrD,gCAAgC,EAAE,gBAAgB,CAAC,aAAa,CAAC;IACjE,0CAA0C,EAAE,gBAAgB,CAAC,aAAa,CAAC,SAAS,CAAC;IACrF,uCAAuC,EAAE,gBAAgB,CAAC,aAAa,CAAC,MAAM,CAAC;IAC/E,mCAAmC,EAAE,cAAc,CAAC,kBAAkB,CAAC;IACvE,6BAA6B,EAAE,cAAc,CAAC,YAAY,CAAC;IAC3D,4BAA4B,EAAE,cAAc,CAAC,WAAW,CAAC;IACzD,4BAA4B,EAAE,cAAc,CAAC,WAAW,CAAC;IACzD,6BAA6B,EAAE,cAAc,CAAC,YAAY,CAAC;IAC3D,oCAAoC,EAAE,cAAc,C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,kBAAkB,CAAC,iBAAiB,CAAC;IAC7E,iCAAiC,EAAE,kBAAkB,CAAC,YAAY,CAAC;IACnE,iCAAiC,EAAE,kBAAkB,CAAC,YAAY,CAAC;IACnE,kCAAkC,EAAE,kBAAkB,CAAC,aAAa,CAAC;IACrE,sCAAsC,EAAE,kBAAkB,CAAC,iBAAiB,CAAC;IAC7E,kCAAkC,EAAE,kBAAkB,CAAC,aAAa,CAAC;IACrE,kCAAkC,EAAE,kBAAkB,CAAC,aAAa,CAAC;IACrE,oCAAoC,EAAE,iBAAiB,CAAC,gBAAgB,CAAC;IACzE,oCAAoC,EAAE,iBAAiB,CAAC,gBAAgB,CAAC;IACzE,oCAAoC,EAAE,iBAAiB,CAAC,gBAAgB,CAAC;IACzE,qCAAqC,EAAE,mBAAmB,CAAC,eAAe,CAAC;IAC3E,2CAA2C,EAAE,mBAAmB,CAAC,eAAe,CAAC,KAAK,CAAC;IACvF,yBAAyB,EAAE,cAAc,CAAC,QAAQ,CAAC;IACnD,0BAA0B,EAAE,cAAc,CAAC,SAAS,CAAC;IACrD,8BAA8B,EAAE,cAAc,CAAC,aAAa,CAAC;IAC7D,wBAAwB,EAAE,cAAc,CAAC,OAAO,CAAC;IACjD,wBAAwB,EAAE,cAAc,CAAC,OAAO,CAAC;IACjD,uBAAuB,EAAE,cAAc,CAAC,MAAM,CAAC;IAC/C,qBAAqB,EAAE,eAAe,CAAC,GAAG,CAAC;IAC3C,2BAA2B,EAAE,eAAe,CAAC,SAAS,CAAC;CAC1D;AACD,MAAM,WAAW,QAAQ;IACrB,+BAA+B,EAAE,iBAAiB,CAAC,WAAW,CAAC;CAClE;AACD,eAAO,MAAM,UAAU,KAAukb,CAAC;AAC/lb,eAAO,MAAM,MAAM,yBAA8D,CAAC"}
|
|
@@ -6,6 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.schema = exports.schemaJson = void 0;
|
|
7
7
|
const codec_protobuf_1 = require("@dxos/codec-protobuf");
|
|
8
8
|
const substitutions_1 = __importDefault(require("../substitutions"));
|
|
9
|
-
exports.schemaJson = JSON.parse("{\"nested\":{\"dxos\":{\"nested\":{\"credentials\":{\"nested\":{\"Message\":{\"fields\":{\"payload\":{\"rule\":\"required\",\"type\":\"google.protobuf.Any\",\"id\":1,\"comment\":null}},\"comment\":null},\"SignedMessage\":{\"fields\":{\"signed\":{\"rule\":\"required\",\"type\":\"Signed\",\"id\":1,\"comment\":null},\"signatures\":{\"rule\":\"repeated\",\"type\":\"Signature\",\"id\":2,\"comment\":null}},\"nested\":{\"Signature\":{\"fields\":{\"key\":{\"rule\":\"required\",\"type\":\"PubKey\",\"id\":1,\"comment\":null},\"signature\":{\"rule\":\"required\",\"type\":\"bytes\",\"id\":2,\"comment\":null},\"keyChain\":{\"type\":\"KeyChain\",\"id\":3,\"comment\":null}},\"comment\":null},\"Signed\":{\"fields\":{\"created\":{\"rule\":\"required\",\"type\":\"string\",\"id\":1,\"comment\":null},\"nonce\":{\"rule\":\"required\",\"type\":\"bytes\",\"id\":2,\"comment\":null},\"payload\":{\"rule\":\"required\",\"type\":\"google.protobuf.Any\",\"id\":10,\"comment\":null}},\"comment\":null}},\"comment\":\"A generic container message used whenever messages are signed (e.g. PartyCredential)\"}}},\"echo\":{\"nested\":{\"feed\":{\"nested\":{\"CredentialsMessage\":{\"fields\":{\"data\":{\"type\":\"bytes\",\"id\":1,\"comment\":null}},\"comment\":\"A container for dxos.credentials.Message\"},\"EchoEnvelope\":{\"fields\":{\"itemId\":{\"type\":\"string\",\"id\":1,\"comment\":null},\"genesis\":{\"type\":\"ItemGenesis\",\"id\":10,\"comment\":null},\"itemMutation\":{\"type\":\"ItemMutation\",\"id\":11,\"comment\":null},\"mutation\":{\"type\":\"bytes\",\"id\":12,\"comment\":null},\"snapshot\":{\"type\":\"ModelSnapshot\",\"id\":13,\"comment\":\"Set the model to the provided snapshot.\"}},\"comment\":\"Wrapper for all ECHO messages.\"},\"FeedMessage\":{\"oneofs\":{\"payload\":{\"oneof\":[\"halo\",\"echo\"],\"comment\":null}},\"fields\":{\"timeframe\":{\"type\":\"TimeframeVector\",\"id\":1,\"comment\":null},\"halo\":{\"type\":\"CredentialsMessage\",\"id\":10,\"comment\":null},\"echo\":{\"type\":\"EchoEnvelope\",\"id\":11,\"comment\":null}},\"comment\":\"Outer message type decoded by Codec.\\nThis is what is written to the feeds.\"},\"ItemGenesis\":{\"fields\":{\"itemType\":{\"type\":\"string\",\"id\":1,\"comment\":null},\"modelType\":{\"type\":\"string\",\"id\":2,\"comment\":null},\"modelVersion\":{\"type\":\"string\",\"id\":3,\"comment\":null},\"link\":{\"type\":\"LinkData\",\"id\":4,\"comment\":null}},\"comment\":null},\"ItemMutation\":{\"fields\":{\"parentId\":{\"type\":\"string\",\"id\":1,\"comment\":null},\"action\":{\"type\":\"Action\",\"id\":2,\"comment\":null}},\"nested\":{\"Action\":{\"values\":{\"NOOP\":0,\"DELETE\":1,\"RESTORE\":2},\"comment\":null,\"comments\":{\"NOOP\":null,\"DELETE\":null,\"RESTORE\":null}}},\"comment\":\"Item mutation.\"},\"LinkData\":{\"fields\":{\"source\":{\"type\":\"string\",\"id\":1,\"comment\":null},\"target\":{\"type\":\"string\",\"id\":2,\"comment\":null}},\"comment\":null}}},\"invitation\":{\"nested\":{\"InvitationDescriptor\":{\"fields\":{\"type\":{\"type\":\"Type\",\"id\":1,\"comment\":null},\"swarmKey\":{\"type\":\"bytes\",\"id\":2,\"comment\":null},\"invitation\":{\"type\":\"bytes\",\"id\":3,\"comment\":null},\"identityKey\":{\"type\":\"bytes\",\"id\":4,\"comment\":\"Only present if type == OFFLINE.\"},\"secret\":{\"type\":\"bytes\",\"id\":5,\"comment\":\"Must be stripped out when passing to another peer.\"}},\"nested\":{\"Type\":{\"values\":{\"INTERACTIVE\":1,\"OFFLINE\":2},\"comment\":\"Defines an invitation type.\",\"comments\":{\"INTERACTIVE\":\"Interactive invitation is when both peers are online at the same time.\",\"OFFLINE\":\"Offline is when only a single peer needs to be online at the time.\"}}},\"comment\":null}}},\"metadata\":{\"nested\":{\"EchoMetadata\":{\"fields\":{\"version\":{\"type\":\"int32\",\"id\":1,\"comment\":\"Version number that is inceremnted every time there's a breaking change to the storage schema.\\n\\nThis is used to detect if the storage schema has changed since the last time the client was run.\\nLoading data from a different version will might result in an error.\"},\"parties\":{\"rule\":\"repeated\",\"type\":\"PartyMetadata\",\"id\":2,\"comment\":null},\"created\":{\"type\":\"google.protobuf.Timestamp\",\"id\":3,\"comment\":null},\"updated\":{\"type\":\"google.protobuf.Timestamp\",\"id\":4,\"comment\":null}},\"comment\":null},\"PartyMetadata\":{\"fields\":{\"key\":{\"type\":\"PubKey\",\"id\":1,\"comment\":\"Party key.\"},\"feedKeys\":{\"rule\":\"repeated\",\"type\":\"PubKey\",\"id\":2,\"comment\":\"List of all feed associated with the party.\"},\"dataFeedKey\":{\"type\":\"PubKey\",\"id\":3,\"comment\":\"Key of the wriatable data feed.\"},\"controlFeedKey\":{\"type\":\"PubKey\",\"id\":4,\"comment\":\"Key of the wriatable control feed.\"},\"latestTimeframe\":{\"type\":\"TimeframeVector\",\"id\":5,\"comment\":null}},\"comment\":null}}},\"service\":{\"nested\":{\"DataService\":{\"methods\":{\"SubscribeEntitySet\":{\"requestType\":\"SubscribeEntitySetRequest\",\"responseType\":\"SubscribeEntitySetResponse\",\"responseStream\":true,\"comment\":null},\"SubscribeEntityStream\":{\"requestType\":\"SubscribeEntityStreamRequest\",\"responseType\":\"SubscribeEntityStreamResponse\",\"responseStream\":true,\"comment\":null},\"Write\":{\"requestType\":\"WriteRequest\",\"responseType\":\"MutationReceipt\",\"comment\":null}},\"comment\":null},\"MutationReceipt\":{\"fields\":{\"feedKey\":{\"type\":\"PubKey\",\"id\":1,\"comment\":null},\"seq\":{\"type\":\"int32\",\"id\":2,\"comment\":null}},\"comment\":null},\"SubscribeEntitySetRequest\":{\"fields\":{\"partyKey\":{\"type\":\"PubKey\",\"id\":1,\"comment\":null}},\"comment\":null},\"SubscribeEntitySetResponse\":{\"fields\":{\"added\":{\"rule\":\"repeated\",\"type\":\"EchoEnvelope\",\"id\":1,\"comment\":null},\"deleted\":{\"rule\":\"repeated\",\"type\":\"EchoEnvelope\",\"id\":2,\"comment\":null}},\"comment\":null},\"SubscribeEntityStreamRequest\":{\"fields\":{\"partyKey\":{\"type\":\"PubKey\",\"id\":1,\"comment\":null},\"itemId\":{\"type\":\"string\",\"id\":2,\"comment\":null}},\"comment\":null},\"SubscribeEntityStreamResponse\":{\"oneofs\":{\"kind\":{\"oneof\":[\"snapshot\",\"mutation\"],\"comment\":null}},\"fields\":{\"snapshot\":{\"type\":\"ItemSnapshot\",\"id\":1,\"comment\":null},\"mutation\":{\"type\":\"Mutation\",\"id\":2,\"comment\":null}},\"nested\":{\"Mutation\":{\"fields\":{\"data\":{\"type\":\"EchoEnvelope\",\"id\":1,\"comment\":null},\"meta\":{\"type\":\"Metadata\",\"id\":2,\"comment\":null}},\"nested\":{\"Metadata\":{\"fields\":{\"feedKey\":{\"type\":\"PubKey\",\"id\":1,\"comment\":null},\"memberKey\":{\"type\":\"PubKey\",\"id\":2,\"comment\":null},\"seq\":{\"type\":\"int32\",\"id\":3,\"comment\":null},\"timeframe\":{\"type\":\"TimeframeVector\",\"id\":4,\"comment\":null}},\"comment\":null}},\"comment\":null}},\"comment\":null},\"WriteRequest\":{\"fields\":{\"partyKey\":{\"type\":\"PubKey\",\"id\":1,\"comment\":null},\"mutation\":{\"type\":\"EchoEnvelope\",\"id\":2,\"comment\":null}},\"comment\":null}}},\"snapshot\":{\"nested\":{\"DatabaseSnapshot\":{\"fields\":{\"items\":{\"rule\":\"repeated\",\"type\":\"ItemSnapshot\",\"id\":1,\"comment\":null},\"links\":{\"rule\":\"repeated\",\"type\":\"LinkSnapshot\",\"id\":2,\"comment\":null}},\"comment\":null},\"HaloStateSnapshot\":{\"fields\":{\"messages\":{\"rule\":\"repeated\",\"type\":\"dxos.CredentialsMessage\",\"id\":1,\"comment\":null}},\"comment\":null},\"ItemSnapshot\":{\"oneofs\":{\"_itemId\":{\"oneof\":[\"itemId\"]},\"_itemType\":{\"oneof\":[\"itemType\"]},\"_modelType\":{\"oneof\":[\"modelType\"]},\"_modelVersion\":{\"oneof\":[\"modelVersion\"]},\"_parentId\":{\"oneof\":[\"parentId\"]},\"_model\":{\"oneof\":[\"model\"]}},\"fields\":{\"itemId\":{\"type\":\"string\",\"id\":1,\"options\":{\"proto3_optional\":true},\"comment\":null},\"itemType\":{\"type\":\"string\",\"id\":2,\"options\":{\"proto3_optional\":true},\"comment\":null},\"modelType\":{\"type\":\"string\",\"id\":3,\"options\":{\"proto3_optional\":true},\"comment\":null},\"modelVersion\":{\"type\":\"string\",\"id\":4,\"options\":{\"proto3_optional\":true},\"comment\":null},\"parentId\":{\"type\":\"string\",\"id\":5,\"options\":{\"proto3_optional\":true},\"comment\":null},\"model\":{\"type\":\"ModelSnapshot\",\"id\":6,\"options\":{\"proto3_optional\":true},\"comment\":null}},\"comment\":null},\"LinkSnapshot\":{\"oneofs\":{\"_linkId\":{\"oneof\":[\"linkId\"]},\"_linkType\":{\"oneof\":[\"linkType\"]},\"_modelType\":{\"oneof\":[\"modelType\"]},\"_modelVersion\":{\"oneof\":[\"modelVersion\"]},\"_model\":{\"oneof\":[\"model\"]}},\"fields\":{\"linkId\":{\"type\":\"string\",\"id\":1,\"options\":{\"proto3_optional\":true},\"comment\":null},\"linkType\":{\"type\":\"string\",\"id\":2,\"options\":{\"proto3_optional\":true},\"comment\":null},\"modelType\":{\"type\":\"string\",\"id\":3,\"options\":{\"proto3_optional\":true},\"comment\":null},\"modelVersion\":{\"type\":\"string\",\"id\":4,\"options\":{\"proto3_optional\":true},\"comment\":null},\"source\":{\"rule\":\"required\",\"type\":\"string\",\"id\":5,\"comment\":null},\"target\":{\"rule\":\"required\",\"type\":\"string\",\"id\":6,\"comment\":null},\"model\":{\"type\":\"ModelSnapshot\",\"id\":7,\"options\":{\"proto3_optional\":true},\"comment\":null}},\"comment\":null},\"ModelMutation\":{\"fields\":{\"mutation\":{\"rule\":\"required\",\"type\":\"bytes\",\"id\":1,\"comment\":null},\"meta\":{\"rule\":\"required\",\"type\":\"ModelMutationMeta\",\"id\":2,\"comment\":null}},\"comment\":null},\"ModelMutationMeta\":{\"fields\":{\"feedKey\":{\"rule\":\"required\",\"type\":\"dxos.halo.keys.PubKey\",\"id\":1,\"comment\":null},\"seq\":{\"rule\":\"required\",\"type\":\"int32\",\"id\":2,\"comment\":null},\"memberKey\":{\"rule\":\"required\",\"type\":\"dxos.halo.keys.PubKey\",\"id\":3,\"comment\":null}},\"comment\":null},\"ModelSnapshot\":{\"oneofs\":{\"_snapshot\":{\"oneof\":[\"snapshot\"]}},\"fields\":{\"snapshot\":{\"type\":\"bytes\",\"id\":1,\"options\":{\"proto3_optional\":true},\"comment\":\"Encoded model snapshot (defined by the model's codec).\\nIf undefined the state machine will be initialized with it's default state.\"},\"mutations\":{\"rule\":\"repeated\",\"type\":\"ModelMutation\",\"id\":2,\"comment\":\"Mutations to be applied on top of the snapshot, or on top of initial state if the snapshot is undefined.\"}},\"comment\":null},\"PartySnapshot\":{\"fields\":{\"partyKey\":{\"type\":\"bytes\",\"id\":1,\"comment\":null},\"timeframe\":{\"type\":\"TimeframeVector\",\"id\":2,\"comment\":null},\"timestamp\":{\"type\":\"int32\",\"id\":3,\"comment\":null},\"halo\":{\"type\":\"HaloStateSnapshot\",\"id\":11,\"comment\":null},\"database\":{\"type\":\"DatabaseSnapshot\",\"id\":12,\"comment\":null}},\"comment\":null}}},\"testing\":{\"nested\":{\"TestItemMutation\":{\"fields\":{\"key\":{\"type\":\"string\",\"id\":1,\"comment\":null},\"value\":{\"type\":\"string\",\"id\":2,\"comment\":null}},\"comment\":null},\"TestItemSnapshot\":{\"fields\":{\"keys\":{\"rule\":\"repeated\",\"type\":\"TestItemMutation\",\"id\":1,\"comment\":null}},\"comment\":null},\"TestListMutation\":{\"fields\":{\"data\":{\"type\":\"string\",\"id\":1,\"comment\":null}},\"comment\":null}}},\"timeframe\":{\"nested\":{\"TimeframeVector\":{\"fields\":{\"frames\":{\"rule\":\"repeated\",\"type\":\"Frame\",\"id\":1,\"comment\":null}},\"nested\":{\"Frame\":{\"fields\":{\"feedKey\":{\"type\":\"bytes\",\"id\":1,\"comment\":null},\"seq\":{\"type\":\"int32\",\"id\":3,\"comment\":null}},\"comment\":null}},\"comment\":\"Vector timestamp used to order messages.\"}}}}},\"halo\":{\"nested\":{\"keys\":{\"nested\":{\"KeyChain\":{\"fields\":{\"publicKey\":{\"rule\":\"required\",\"type\":\"PubKey\",\"id\":1,\"comment\":null},\"message\":{\"rule\":\"required\",\"type\":\"SignedMessage\",\"id\":2,\"comment\":null},\"parents\":{\"rule\":\"repeated\",\"type\":\"KeyChain\",\"id\":3,\"comment\":null}},\"comment\":null},\"KeyRecord\":{\"fields\":{\"type\":{\"rule\":\"required\",\"type\":\"KeyType\",\"id\":1,\"comment\":\"- The `KeyType` type of the key. This is often unknown for keys from other sources.\"},\"publicKey\":{\"rule\":\"required\",\"type\":\"PubKey\",\"id\":2,\"comment\":\"- The public key as a Buffer (required).\"},\"secretKey\":{\"type\":\"PrivKey\",\"id\":3,\"comment\":\"- The secret key as a Buffer (this will never be visible outside the Keyring).\"},\"hint\":{\"type\":\"bool\",\"id\":4,\"comment\":\"- Is this key from a Greeting \\\"hint\\\"?\"},\"own\":{\"type\":\"bool\",\"id\":5,\"comment\":\"- Is this our key? Usually true if `secretKey` is present,\\nmay be false for \\\"inception keys\\\" such as the Party key.\"},\"trusted\":{\"type\":\"bool\",\"id\":6,\"comment\":\"- Is this key to be trusted?\"},\"added\":{\"type\":\"string\",\"id\":7,\"comment\":\"- An RFC-3339 date/time string for when the key was added to the Keyring.\"},\"created\":{\"type\":\"string\",\"id\":8,\"comment\":\"- An RFC-3339 date/time string for when the key was created.\"}},\"comment\":null},\"KeyRecordList\":{\"fields\":{\"keys\":{\"rule\":\"repeated\",\"type\":\"KeyRecord\",\"id\":1,\"comment\":null}},\"comment\":null},\"KeyType\":{\"values\":{\"UNKNOWN\":0,\"IDENTITY\":1,\"DEVICE\":2,\"PARTY\":3,\"FEED\":4,\"DXNS_ADDRESS\":5},\"comment\":null,\"comments\":{\"UNKNOWN\":null,\"IDENTITY\":null,\"DEVICE\":null,\"PARTY\":null,\"FEED\":null,\"DXNS_ADDRESS\":null}},\"PrivKey\":{\"fields\":{\"data\":{\"type\":\"bytes\",\"id\":1,\"comment\":null}},\"comment\":null},\"PubKey\":{\"fields\":{\"data\":{\"type\":\"bytes\",\"id\":1,\"comment\":null}},\"comment\":null}}}}}}},\"google\":{\"nested\":{\"protobuf\":{\"nested\":{\"Any\":{\"fields\":{\"type_url\":{\"type\":\"string\",\"id\":1},\"value\":{\"type\":\"bytes\",\"id\":2}},\"comment\":null},\"Timestamp\":{\"fields\":{\"seconds\":{\"type\":\"int64\",\"id\":1},\"nanos\":{\"type\":\"int32\",\"id\":2}},\"comment\":null}}}}}}}");
|
|
9
|
+
exports.schemaJson = JSON.parse("{\"nested\":{\"dxos\":{\"nested\":{\"credentials\":{\"nested\":{\"Message\":{\"fields\":{\"payload\":{\"rule\":\"required\",\"type\":\"google.protobuf.Any\",\"id\":1,\"comment\":null}},\"comment\":null},\"SignedMessage\":{\"fields\":{\"signed\":{\"rule\":\"required\",\"type\":\"Signed\",\"id\":1,\"comment\":null},\"signatures\":{\"rule\":\"repeated\",\"type\":\"Signature\",\"id\":2,\"comment\":null}},\"nested\":{\"Signature\":{\"fields\":{\"key\":{\"rule\":\"required\",\"type\":\"PubKey\",\"id\":1,\"comment\":null},\"signature\":{\"rule\":\"required\",\"type\":\"bytes\",\"id\":2,\"comment\":null},\"keyChain\":{\"type\":\"KeyChain\",\"id\":3,\"comment\":null}},\"comment\":null},\"Signed\":{\"fields\":{\"created\":{\"rule\":\"required\",\"type\":\"string\",\"id\":1,\"comment\":null},\"nonce\":{\"rule\":\"required\",\"type\":\"bytes\",\"id\":2,\"comment\":null},\"payload\":{\"rule\":\"required\",\"type\":\"google.protobuf.Any\",\"id\":10,\"comment\":null}},\"comment\":null}},\"comment\":\"A generic container message used whenever messages are signed (e.g. PartyCredential)\"}}},\"echo\":{\"nested\":{\"feed\":{\"nested\":{\"CredentialsMessage\":{\"fields\":{\"data\":{\"type\":\"bytes\",\"id\":1,\"comment\":null}},\"comment\":\"A container for dxos.credentials.Message\"},\"EchoEnvelope\":{\"fields\":{\"itemId\":{\"type\":\"string\",\"id\":1,\"comment\":null},\"genesis\":{\"type\":\"ItemGenesis\",\"id\":10,\"comment\":null},\"itemMutation\":{\"type\":\"ItemMutation\",\"id\":11,\"comment\":null},\"mutation\":{\"type\":\"bytes\",\"id\":12,\"comment\":null},\"snapshot\":{\"type\":\"ModelSnapshot\",\"id\":13,\"comment\":\"Set the model to the provided snapshot.\"}},\"comment\":\"Wrapper for all ECHO messages.\"},\"FeedMessage\":{\"oneofs\":{\"payload\":{\"oneof\":[\"halo\",\"echo\"],\"comment\":null}},\"fields\":{\"timeframe\":{\"type\":\"TimeframeVector\",\"id\":1,\"comment\":null},\"halo\":{\"type\":\"CredentialsMessage\",\"id\":10,\"comment\":null},\"echo\":{\"type\":\"EchoEnvelope\",\"id\":11,\"comment\":null}},\"comment\":\"Outer message type decoded by Codec.\\nThis is what is written to the feeds.\"},\"ItemGenesis\":{\"fields\":{\"itemType\":{\"type\":\"string\",\"id\":1,\"comment\":null},\"modelType\":{\"type\":\"string\",\"id\":2,\"comment\":null},\"modelVersion\":{\"type\":\"string\",\"id\":3,\"comment\":null},\"link\":{\"type\":\"LinkData\",\"id\":4,\"comment\":null}},\"comment\":null},\"ItemMutation\":{\"fields\":{\"parentId\":{\"type\":\"string\",\"id\":1,\"comment\":null},\"action\":{\"type\":\"Action\",\"id\":2,\"comment\":null}},\"nested\":{\"Action\":{\"values\":{\"NOOP\":0,\"DELETE\":1,\"RESTORE\":2},\"comment\":null,\"comments\":{\"NOOP\":null,\"DELETE\":null,\"RESTORE\":null}}},\"comment\":\"Item mutation.\"},\"LinkData\":{\"fields\":{\"source\":{\"type\":\"string\",\"id\":1,\"comment\":null},\"target\":{\"type\":\"string\",\"id\":2,\"comment\":null}},\"comment\":null}}},\"invitation\":{\"nested\":{\"InvitationDescriptor\":{\"fields\":{\"type\":{\"type\":\"Type\",\"id\":1,\"comment\":null},\"swarmKey\":{\"type\":\"bytes\",\"id\":2,\"comment\":null},\"invitation\":{\"type\":\"bytes\",\"id\":3,\"comment\":null},\"identityKey\":{\"type\":\"bytes\",\"id\":4,\"comment\":\"Only present if type == OFFLINE.\"},\"secret\":{\"type\":\"bytes\",\"id\":5,\"comment\":\"Must be stripped out when passing to another peer.\"}},\"nested\":{\"Type\":{\"values\":{\"INTERACTIVE\":1,\"OFFLINE\":2},\"comment\":\"Defines an invitation type.\",\"comments\":{\"INTERACTIVE\":\"Interactive invitation is when both peers are online at the same time.\",\"OFFLINE\":\"Offline is when only a single peer needs to be online at the time.\"}}},\"comment\":null}}},\"metadata\":{\"nested\":{\"EchoMetadata\":{\"fields\":{\"version\":{\"type\":\"int32\",\"id\":1,\"comment\":\"Version number that is inceremnted every time there's a breaking change to the storage schema.\\n\\nThis is used to detect if the storage schema has changed since the last time the client was run.\\nLoading data from a different version will might result in an error.\"},\"parties\":{\"rule\":\"repeated\",\"type\":\"PartyMetadata\",\"id\":2,\"comment\":null},\"created\":{\"type\":\"google.protobuf.Timestamp\",\"id\":3,\"comment\":null},\"updated\":{\"type\":\"google.protobuf.Timestamp\",\"id\":4,\"comment\":null}},\"comment\":null},\"PartyMetadata\":{\"fields\":{\"key\":{\"type\":\"PubKey\",\"id\":1,\"comment\":\"Party key.\"},\"feedKeys\":{\"rule\":\"repeated\",\"type\":\"PubKey\",\"id\":2,\"comment\":\"List of all feed associated with the party.\"},\"dataFeedKey\":{\"type\":\"PubKey\",\"id\":3,\"comment\":\"Key of the wriatable data feed.\"},\"controlFeedKey\":{\"type\":\"PubKey\",\"id\":4,\"comment\":\"Key of the wriatable control feed.\"},\"latestTimeframe\":{\"type\":\"TimeframeVector\",\"id\":5,\"comment\":null}},\"comment\":null}}},\"service\":{\"nested\":{\"DataService\":{\"methods\":{\"SubscribeEntitySet\":{\"requestType\":\"SubscribeEntitySetRequest\",\"responseType\":\"SubscribeEntitySetResponse\",\"responseStream\":true,\"comment\":null},\"SubscribeEntityStream\":{\"requestType\":\"SubscribeEntityStreamRequest\",\"responseType\":\"SubscribeEntityStreamResponse\",\"responseStream\":true,\"comment\":null},\"Write\":{\"requestType\":\"WriteRequest\",\"responseType\":\"MutationReceipt\",\"comment\":null}},\"comment\":null},\"MutationReceipt\":{\"fields\":{\"feedKey\":{\"type\":\"PubKey\",\"id\":1,\"comment\":null},\"seq\":{\"type\":\"int32\",\"id\":2,\"comment\":null}},\"comment\":null},\"SubscribeEntitySetRequest\":{\"fields\":{\"partyKey\":{\"type\":\"PubKey\",\"id\":1,\"comment\":null}},\"comment\":null},\"SubscribeEntitySetResponse\":{\"fields\":{\"added\":{\"rule\":\"repeated\",\"type\":\"EchoEnvelope\",\"id\":1,\"comment\":null},\"deleted\":{\"rule\":\"repeated\",\"type\":\"EchoEnvelope\",\"id\":2,\"comment\":null}},\"comment\":null},\"SubscribeEntityStreamRequest\":{\"fields\":{\"partyKey\":{\"type\":\"PubKey\",\"id\":1,\"comment\":null},\"itemId\":{\"type\":\"string\",\"id\":2,\"comment\":null}},\"comment\":null},\"SubscribeEntityStreamResponse\":{\"oneofs\":{\"kind\":{\"oneof\":[\"snapshot\",\"mutation\"],\"comment\":null}},\"fields\":{\"snapshot\":{\"type\":\"ItemSnapshot\",\"id\":1,\"comment\":null},\"mutation\":{\"type\":\"Mutation\",\"id\":2,\"comment\":null}},\"nested\":{\"Mutation\":{\"fields\":{\"data\":{\"type\":\"EchoEnvelope\",\"id\":1,\"comment\":null},\"meta\":{\"type\":\"Metadata\",\"id\":2,\"comment\":null}},\"nested\":{\"Metadata\":{\"fields\":{\"feedKey\":{\"type\":\"PubKey\",\"id\":1,\"comment\":null},\"memberKey\":{\"type\":\"PubKey\",\"id\":2,\"comment\":null},\"seq\":{\"type\":\"int32\",\"id\":3,\"comment\":null},\"timeframe\":{\"type\":\"TimeframeVector\",\"id\":4,\"comment\":null}},\"comment\":null}},\"comment\":null}},\"comment\":null},\"WriteRequest\":{\"fields\":{\"partyKey\":{\"type\":\"PubKey\",\"id\":1,\"comment\":null},\"mutation\":{\"type\":\"EchoEnvelope\",\"id\":2,\"comment\":null}},\"comment\":null}}},\"snapshot\":{\"nested\":{\"DatabaseSnapshot\":{\"fields\":{\"items\":{\"rule\":\"repeated\",\"type\":\"ItemSnapshot\",\"id\":1,\"comment\":null},\"links\":{\"rule\":\"repeated\",\"type\":\"LinkSnapshot\",\"id\":2,\"comment\":null}},\"comment\":null},\"HaloStateSnapshot\":{\"fields\":{\"messages\":{\"rule\":\"repeated\",\"type\":\"dxos.CredentialsMessage\",\"id\":1,\"comment\":null}},\"comment\":null},\"ItemSnapshot\":{\"oneofs\":{\"_itemId\":{\"oneof\":[\"itemId\"]},\"_itemType\":{\"oneof\":[\"itemType\"]},\"_modelType\":{\"oneof\":[\"modelType\"]},\"_modelVersion\":{\"oneof\":[\"modelVersion\"]},\"_parentId\":{\"oneof\":[\"parentId\"]},\"_model\":{\"oneof\":[\"model\"]}},\"fields\":{\"itemId\":{\"type\":\"string\",\"id\":1,\"options\":{\"proto3_optional\":true},\"comment\":null},\"itemType\":{\"type\":\"string\",\"id\":2,\"options\":{\"proto3_optional\":true},\"comment\":null},\"modelType\":{\"type\":\"string\",\"id\":3,\"options\":{\"proto3_optional\":true},\"comment\":null},\"modelVersion\":{\"type\":\"string\",\"id\":4,\"options\":{\"proto3_optional\":true},\"comment\":null},\"parentId\":{\"type\":\"string\",\"id\":5,\"options\":{\"proto3_optional\":true},\"comment\":null},\"model\":{\"type\":\"ModelSnapshot\",\"id\":6,\"options\":{\"proto3_optional\":true},\"comment\":null}},\"comment\":null},\"LinkSnapshot\":{\"oneofs\":{\"_linkId\":{\"oneof\":[\"linkId\"]},\"_linkType\":{\"oneof\":[\"linkType\"]},\"_modelType\":{\"oneof\":[\"modelType\"]},\"_modelVersion\":{\"oneof\":[\"modelVersion\"]},\"_model\":{\"oneof\":[\"model\"]}},\"fields\":{\"linkId\":{\"type\":\"string\",\"id\":1,\"options\":{\"proto3_optional\":true},\"comment\":null},\"linkType\":{\"type\":\"string\",\"id\":2,\"options\":{\"proto3_optional\":true},\"comment\":null},\"modelType\":{\"type\":\"string\",\"id\":3,\"options\":{\"proto3_optional\":true},\"comment\":null},\"modelVersion\":{\"type\":\"string\",\"id\":4,\"options\":{\"proto3_optional\":true},\"comment\":null},\"source\":{\"rule\":\"required\",\"type\":\"string\",\"id\":5,\"comment\":null},\"target\":{\"rule\":\"required\",\"type\":\"string\",\"id\":6,\"comment\":null},\"model\":{\"type\":\"ModelSnapshot\",\"id\":7,\"options\":{\"proto3_optional\":true},\"comment\":null}},\"comment\":null},\"ModelMutation\":{\"fields\":{\"mutation\":{\"rule\":\"required\",\"type\":\"bytes\",\"id\":1,\"comment\":null},\"meta\":{\"rule\":\"required\",\"type\":\"ModelMutationMeta\",\"id\":2,\"comment\":null}},\"comment\":null},\"ModelMutationMeta\":{\"fields\":{\"feedKey\":{\"rule\":\"required\",\"type\":\"dxos.halo.keys.PubKey\",\"id\":1,\"comment\":null},\"seq\":{\"rule\":\"required\",\"type\":\"int32\",\"id\":2,\"comment\":null},\"memberKey\":{\"rule\":\"required\",\"type\":\"dxos.halo.keys.PubKey\",\"id\":3,\"comment\":null}},\"comment\":null},\"ModelSnapshot\":{\"oneofs\":{\"_snapshot\":{\"oneof\":[\"snapshot\"]}},\"fields\":{\"snapshot\":{\"type\":\"bytes\",\"id\":1,\"options\":{\"proto3_optional\":true},\"comment\":\"Encoded model snapshot (defined by the model's codec).\\nIf undefined the state machine will be initialized with it's default state.\"},\"mutations\":{\"rule\":\"repeated\",\"type\":\"ModelMutation\",\"id\":2,\"comment\":\"Mutations to be applied on top of the snapshot, or on top of initial state if the snapshot is undefined.\"}},\"comment\":null},\"PartySnapshot\":{\"fields\":{\"partyKey\":{\"type\":\"bytes\",\"id\":1,\"comment\":null},\"timeframe\":{\"type\":\"TimeframeVector\",\"id\":2,\"comment\":null},\"timestamp\":{\"type\":\"int32\",\"id\":3,\"comment\":null},\"halo\":{\"type\":\"HaloStateSnapshot\",\"id\":11,\"comment\":null},\"database\":{\"type\":\"DatabaseSnapshot\",\"id\":12,\"comment\":null}},\"comment\":null}}},\"testing\":{\"nested\":{\"TestItemMutation\":{\"fields\":{\"key\":{\"type\":\"string\",\"id\":1,\"comment\":null},\"value\":{\"type\":\"string\",\"id\":2,\"comment\":null}},\"comment\":null},\"TestItemSnapshot\":{\"fields\":{\"keys\":{\"rule\":\"repeated\",\"type\":\"TestItemMutation\",\"id\":1,\"comment\":null}},\"comment\":null},\"TestListMutation\":{\"fields\":{\"data\":{\"type\":\"string\",\"id\":1,\"comment\":null}},\"comment\":null}}},\"timeframe\":{\"nested\":{\"TimeframeVector\":{\"fields\":{\"frames\":{\"rule\":\"repeated\",\"type\":\"Frame\",\"id\":1,\"comment\":null}},\"nested\":{\"Frame\":{\"fields\":{\"feedKey\":{\"type\":\"bytes\",\"id\":1,\"comment\":null},\"seq\":{\"type\":\"int32\",\"id\":3,\"comment\":null}},\"comment\":null}},\"comment\":\"Vector timestamp used to order messages.\"}}}}},\"halo\":{\"nested\":{\"keys\":{\"nested\":{\"KeyChain\":{\"fields\":{\"publicKey\":{\"rule\":\"required\",\"type\":\"PubKey\",\"id\":1,\"comment\":null},\"message\":{\"rule\":\"required\",\"type\":\"SignedMessage\",\"id\":2,\"comment\":null},\"parents\":{\"rule\":\"repeated\",\"type\":\"KeyChain\",\"id\":3,\"comment\":null}},\"comment\":null},\"KeyRecord\":{\"fields\":{\"type\":{\"rule\":\"required\",\"type\":\"KeyType\",\"id\":1,\"comment\":\"The `KeyType` type of the key. This is often unknown for keys from other sources.\"},\"publicKey\":{\"rule\":\"required\",\"type\":\"PubKey\",\"id\":2,\"comment\":\"The public key as a Buffer (required).\"},\"secretKey\":{\"type\":\"PrivKey\",\"id\":3,\"comment\":\"The secret key as a Buffer (this will never be visible outside the Keyring).\"},\"hint\":{\"type\":\"bool\",\"id\":4,\"comment\":\"Is this key from a Greeting \\\"hint\\\"?\"},\"own\":{\"type\":\"bool\",\"id\":5,\"comment\":\"Determines if this is our key?\\nUsually true if `secretKey` is present; may be false for \\\"inception keys\\\" such as the Party key.\"},\"trusted\":{\"type\":\"bool\",\"id\":6,\"comment\":\"Is this key to be trusted?\"},\"added\":{\"type\":\"string\",\"id\":7,\"comment\":\"An RFC-3339 date/time string for when the key was added to the Keyring.\"},\"created\":{\"type\":\"string\",\"id\":8,\"comment\":\"An RFC-3339 date/time string for when the key was created.\"}},\"comment\":null},\"KeyRecordList\":{\"fields\":{\"keys\":{\"rule\":\"repeated\",\"type\":\"KeyRecord\",\"id\":1,\"comment\":null}},\"comment\":null},\"KeyType\":{\"values\":{\"UNKNOWN\":0,\"IDENTITY\":1,\"DEVICE\":2,\"PARTY\":3,\"FEED\":4,\"DXNS_ADDRESS\":5},\"comment\":null,\"comments\":{\"UNKNOWN\":null,\"IDENTITY\":null,\"DEVICE\":null,\"PARTY\":null,\"FEED\":null,\"DXNS_ADDRESS\":null}},\"PrivKey\":{\"fields\":{\"data\":{\"type\":\"bytes\",\"id\":1,\"comment\":null}},\"comment\":null},\"PubKey\":{\"fields\":{\"data\":{\"type\":\"bytes\",\"id\":1,\"comment\":null}},\"comment\":null}}}}}}},\"google\":{\"nested\":{\"protobuf\":{\"nested\":{\"Any\":{\"fields\":{\"type_url\":{\"type\":\"string\",\"id\":1},\"value\":{\"type\":\"bytes\",\"id\":2}},\"comment\":null},\"Timestamp\":{\"fields\":{\"seconds\":{\"type\":\"int64\",\"id\":1},\"nanos\":{\"type\":\"int32\",\"id\":2}},\"comment\":null}}}}}}}");
|
|
10
10
|
exports.schema = codec_protobuf_1.Schema.fromJson(exports.schemaJson, substitutions_1.default);
|
|
11
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/proto/gen/index.ts"],"names":[],"mappings":";;;;;;AAAA,yDAA8C;AAW9C,qEAA6C;AAkDhC,QAAA,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/proto/gen/index.ts"],"names":[],"mappings":";;;;;;AAAA,yDAA8C;AAW9C,qEAA6C;AAkDhC,QAAA,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,wjbAAwjb,CAAC,CAAC;AACllb,QAAA,MAAM,GAAG,uBAAM,CAAC,QAAQ,CAAkB,kBAAU,EAAE,uBAAa,CAAC,CAAC"}
|
|
@@ -17,10 +17,10 @@ declare const _default: {
|
|
|
17
17
|
decode: (vector: any) => import("../spacetime").Timeframe;
|
|
18
18
|
};
|
|
19
19
|
'dxos.halo.keys.PubKey': {
|
|
20
|
-
encode: (value: import("@dxos/
|
|
20
|
+
encode: (value: import("@dxos/protocols").PublicKey) => {
|
|
21
21
|
data: Uint8Array;
|
|
22
22
|
};
|
|
23
|
-
decode: (value: any) => import("@dxos/
|
|
23
|
+
decode: (value: any) => import("@dxos/protocols").PublicKey;
|
|
24
24
|
};
|
|
25
25
|
'dxos.halo.keys.PrivKey': {
|
|
26
26
|
encode: (value: Buffer) => {
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const codec_protobuf_1 = require("@dxos/codec-protobuf");
|
|
7
7
|
const credentials_1 = require("@dxos/credentials");
|
|
8
|
-
const
|
|
8
|
+
const protocols_1 = require("@dxos/protocols");
|
|
9
9
|
const spacetime_1 = require("../spacetime");
|
|
10
10
|
exports.default = {
|
|
11
11
|
...codec_protobuf_1.timestampSubstitutions,
|
|
12
|
-
...
|
|
12
|
+
...protocols_1.publicKeySubstitutions,
|
|
13
13
|
...spacetime_1.timeframeSubstitutions,
|
|
14
14
|
// TODO(marik-d): Temporary codec bridging logic until we can require proto declarations across package boundaries.
|
|
15
15
|
'dxos.echo.feed.CredentialsMessage': {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"substitutions.js","sourceRoot":"","sources":["../../../src/proto/substitutions.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;AAEF,yDAA8D;AAC9D,mDAAmD;AACnD
|
|
1
|
+
{"version":3,"file":"substitutions.js","sourceRoot":"","sources":["../../../src/proto/substitutions.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;AAEF,yDAA8D;AAC9D,mDAAmD;AACnD,+CAAyD;AAEzD,4CAAsD;AAEtD,kBAAe;IACb,GAAG,uCAAsB;IACzB,GAAG,kCAAsB;IACzB,GAAG,kCAAsB;IACzB,mHAAmH;IACnH,mCAAmC,EAAE;QACnC,MAAM,EAAE,CAAC,GAAY,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,mBAAK,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;QACvD,MAAM,EAAE,CAAC,GAAQ,EAAW,EAAE,CAAC,mBAAK,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC;KACtD;CACF,CAAC"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
//
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.timeframeSubstitutions = void 0;
|
|
7
|
-
const
|
|
7
|
+
const protocols_1 = require("@dxos/protocols");
|
|
8
8
|
const timeframe_1 = require("./timeframe");
|
|
9
9
|
exports.timeframeSubstitutions = {
|
|
10
10
|
'dxos.echo.timeframe.TimeframeVector': {
|
|
@@ -15,7 +15,7 @@ exports.timeframeSubstitutions = {
|
|
|
15
15
|
var _a;
|
|
16
16
|
return new timeframe_1.Timeframe(((_a = vector.frames) !== null && _a !== void 0 ? _a : [])
|
|
17
17
|
.filter((frame) => frame.feedKey != null && frame.seq != null)
|
|
18
|
-
.map((frame) => [
|
|
18
|
+
.map((frame) => [protocols_1.PublicKey.from(new Uint8Array(frame.feedKey)), frame.seq]));
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"substitutions.js","sourceRoot":"","sources":["../../../src/spacetime/substitutions.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAEF
|
|
1
|
+
{"version":3,"file":"substitutions.js","sourceRoot":"","sources":["../../../src/spacetime/substitutions.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAEF,+CAA4C;AAE5C,2CAAwC;AAE3B,QAAA,sBAAsB,GAAG;IACpC,qCAAqC,EAAE;QACrC,MAAM,EAAE,CAAC,SAAoB,EAAE,EAAE,CAAC,CAAC;YACjC,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,YAAY,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;SAC/F,CAAC;QACF,MAAM,EAAE,CAAC,MAAW,EAAE,EAAE;;YAAC,OAAA,IAAI,qBAAS,CACpC,CAAC,MAAA,MAAM,CAAC,MAAM,mCAAI,EAAE,CAAC;iBAClB,MAAM,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,IAAI,IAAI,IAAI,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC;iBAClE,GAAG,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,CAAC,qBAAS,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CACnF,CAAA;SAAA;KACF;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeframe.d.ts","sourceRoot":"","sources":["../../../src/spacetime/timeframe.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"timeframe.d.ts","sourceRoot":"","sources":["../../../src/spacetime/timeframe.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAK/B,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC;;;GAGG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyE;gBAEpF,MAAM,GAAE,CAAC,OAAO,EAAE,MAAM,CAAC,EAAO;IAM7C,GAAG,CAAE,GAAG,EAAE,OAAO;IAIjB,GAAG,CAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM;IAKhC,MAAM,IAAK,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE;IAK9B,IAAI;IAKJ,OAAO;IAIP;;;OAGG;IACH,WAAW,CAAE,IAAI,EAAE,OAAO,EAAE,GAAG,SAAS;IAKxC;;OAEG;IACH,aAAa,IAAK,MAAM;IAIxB,MAAM;IAON,QAAQ;IAIR;;OAEG;IACH,CAAC,OAAO,CAAC,MAAM,CAAC;IAIhB;;;OAGG;IACH,MAAM,CAAC,KAAK,CAAE,GAAG,UAAU,EAAE,SAAS,EAAE,GAAG,SAAS;IAcpD;;;;;;OAMG;IACH,MAAM,CAAC,YAAY,CACjB,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,GAC7B,SAAS;CAWb"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Timeframe = void 0;
|
|
7
7
|
const util_1 = require("util");
|
|
8
|
+
const crypto_1 = require("@dxos/crypto");
|
|
8
9
|
const util_2 = require("@dxos/util");
|
|
9
10
|
/**
|
|
10
11
|
* A mapping of feed key to a sequence number on that feed.
|
|
@@ -50,12 +51,12 @@ class Timeframe {
|
|
|
50
51
|
}
|
|
51
52
|
toJSON() {
|
|
52
53
|
return this.frames().reduce((frames, [key, seq]) => {
|
|
53
|
-
frames[
|
|
54
|
+
frames[(0, crypto_1.humanize)(key)] = seq;
|
|
54
55
|
return frames;
|
|
55
56
|
}, {});
|
|
56
57
|
}
|
|
57
58
|
toString() {
|
|
58
|
-
return `(${this.frames().map(([key, seq]) => `${
|
|
59
|
+
return `(${this.frames().map(([key, seq]) => `${(0, crypto_1.humanize)(key)} => ${seq}`).join(', ')})`;
|
|
59
60
|
}
|
|
60
61
|
/**
|
|
61
62
|
* Used by NodeJS to get textual representation of this object when it's printed with a `console.log` statement.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeframe.js","sourceRoot":"","sources":["../../../src/spacetime/timeframe.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAEF,+BAA+B;AAE/B,qCAAwC;AAIxC;;;GAGG;AACH,MAAa,SAAS;IAGpB,YAAa,SAA8B,EAAE;QAF5B,YAAO,GAAG,IAAI,iBAAU,CAAkB,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;QAG/F,KAAK,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,MAAM,EAAE;YAC/B,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;SAC5B;IACH,CAAC;IAED,GAAG,CAAE,GAAY;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC/B,CAAC;IAED,GAAG,CAAE,GAAY,EAAE,KAAa;QAC9B,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IA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AM,CAAC;IAChB,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,YAAY,CACjB,GAAc,EAAE,GAAc;QAE9B,MAAM,MAAM,GAAG,IAAI,SAAS,EAAE,CAAC;QAC/B,KAAK,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,GAAG,CAAC,MAAM,EAAE,EAAE;YACrC,MAAM,QAAQ,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC9B,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,GAAG,GAAG,EAAE;gBAC5C,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;aACtB;SACF;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAxGD,8BAwGC"}
|
|
@@ -8,11 +8,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
const debug_1 = __importDefault(require("debug"));
|
|
10
10
|
const crypto_1 = require("@dxos/crypto");
|
|
11
|
+
const protocols_1 = require("@dxos/protocols");
|
|
11
12
|
const timeframe_1 = require("./timeframe");
|
|
12
13
|
const log = (0, debug_1.default)('dxos:echo:spacetime:test');
|
|
13
14
|
const createFeedKey = () => {
|
|
14
15
|
const { publicKey } = (0, crypto_1.createKeyPair)();
|
|
15
|
-
return
|
|
16
|
+
return protocols_1.PublicKey.from(publicKey);
|
|
16
17
|
};
|
|
17
18
|
describe('spacetime', () => {
|
|
18
19
|
test('constructors', () => {
|