@dxos/client 2.26.2-dev.4412f210 → 2.27.1-dev.0c1c38c3
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/client/client.d.ts +5 -15
- package/dist/src/client/client.d.ts.map +1 -1
- package/dist/src/client/client.js +6 -89
- package/dist/src/client/client.js.map +1 -1
- package/dist/src/client/client.test.js.map +1 -1
- package/dist/src/client/local-client.test.js +0 -10
- package/dist/src/client/local-client.test.js.map +1 -1
- package/dist/src/client/service-host/services/system.d.ts.map +1 -1
- package/dist/src/client/service-host/services/system.js +1 -7
- package/dist/src/client/service-host/services/system.js.map +1 -1
- package/dist/src/client/service-host/storage.d.ts +1 -1
- package/dist/src/client/service-host/storage.d.ts.map +1 -1
- package/dist/src/client/service-host/storage.js +15 -14
- package/dist/src/client/service-host/storage.js.map +1 -1
- package/dist/src/proto/gen/dxos/config.d.ts +175 -253
- package/dist/src/proto/gen/dxos/config.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/config.js +26 -23
- package/dist/src/proto/gen/dxos/config.js.map +1 -1
- package/dist/src/proto/gen/dxos/devtools.d.ts +2 -2
- package/dist/src/proto/gen/dxos/devtools.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/echo/service.d.ts +1 -0
- package/dist/src/proto/gen/dxos/echo/service.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/echo/snapshot.d.ts +12 -4
- package/dist/src/proto/gen/dxos/echo/snapshot.d.ts.map +1 -1
- package/dist/src/proto/gen/google/protobuf.d.ts +0 -2
- package/dist/src/proto/gen/google/protobuf.d.ts.map +1 -1
- package/dist/src/proto/gen/google/protobuf.js.map +1 -1
- package/dist/src/proto/gen/index.d.ts +26 -22
- 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 +16 -21
- package/dist/src/proto/substitutions.d.ts.map +1 -1
- package/dist/src/proto/substitutions.js +6 -46
- package/dist/src/proto/substitutions.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +19 -20
- package/src/client/client.test.ts +2 -2
- package/src/client/client.ts +13 -106
- package/src/client/local-client.test.ts +2 -16
- package/src/client/service-host/services/system.ts +1 -7
- package/src/client/service-host/storage.ts +18 -17
- package/src/proto/gen/dxos/config.ts +175 -253
- package/src/proto/gen/dxos/devtools.ts +2 -2
- package/src/proto/gen/dxos/echo/service.ts +1 -0
- package/src/proto/gen/dxos/echo/snapshot.ts +12 -4
- package/src/proto/gen/google/protobuf.ts +0 -2
- package/src/proto/gen/index.ts +27 -23
- package/src/proto/substitutions.ts +9 -51
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"substitutions.d.ts","sourceRoot":"","sources":["../../../src/proto/substitutions.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"substitutions.d.ts","sourceRoot":"","sources":["../../../src/proto/substitutions.ts"],"names":[],"mappings":";AAKA,OAAO,EAAS,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAGnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;;;sBAU3C,OAAO;;;sBACP,GAAG,KAAG,OAAO;;;wBAGX,eAAe;;;wBACf,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAbvB,wBAeE"}
|
|
@@ -3,63 +3,23 @@
|
|
|
3
3
|
// Copyright 2021 DXOS.org
|
|
4
4
|
//
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const codec_protobuf_1 = require("@dxos/codec-protobuf");
|
|
6
7
|
const credentials_1 = require("@dxos/credentials");
|
|
7
8
|
const crypto_1 = require("@dxos/crypto");
|
|
8
9
|
const echo_protocol_1 = require("@dxos/echo-protocol");
|
|
9
|
-
// TODO(burdon): How to standardize?
|
|
10
10
|
exports.default = {
|
|
11
|
+
...codec_protobuf_1.timestampSubstitutions,
|
|
12
|
+
...crypto_1.publicKeySubstitutions,
|
|
13
|
+
...echo_protocol_1.timeframeSubstitutions,
|
|
14
|
+
...codec_protobuf_1.newAnySubstitutions,
|
|
15
|
+
// TODO(dmaretskyi): Remove this and include halo messages directly.
|
|
11
16
|
'dxos.echo.feed.CredentialsMessage': {
|
|
12
17
|
encode: (msg) => ({ data: credentials_1.codec.encode(msg) }),
|
|
13
18
|
decode: (msg) => credentials_1.codec.decode(msg.data)
|
|
14
19
|
},
|
|
15
|
-
'dxos.echo.feed.TimeframeVector': {
|
|
16
|
-
encode: (timeframe) => ({
|
|
17
|
-
frames: timeframe.frames().map(([feedKey, seq]) => ({ feedKey: feedKey.asUint8Array(), seq }))
|
|
18
|
-
}),
|
|
19
|
-
decode: (vector) => {
|
|
20
|
-
var _a;
|
|
21
|
-
return new echo_protocol_1.Timeframe(((_a = vector.frames) !== null && _a !== void 0 ? _a : [])
|
|
22
|
-
.filter((frame) => frame.feedKey != null && frame.seq != null)
|
|
23
|
-
.map((frame) => [crypto_1.PublicKey.from(new Uint8Array(frame.feedKey)), frame.seq]));
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
'dxos.halo.keys.PubKey': {
|
|
27
|
-
encode: (value) => ({ data: value.asUint8Array() }),
|
|
28
|
-
decode: (value) => crypto_1.PublicKey.from(new Uint8Array(value.data))
|
|
29
|
-
},
|
|
30
|
-
'dxos.halo.keys.PrivKey': {
|
|
31
|
-
encode: (value) => ({ data: new Uint8Array(value) }),
|
|
32
|
-
decode: (value) => crypto_1.PublicKey.from(new Uint8Array(value.data)).asBuffer()
|
|
33
|
-
},
|
|
34
|
-
'google.protobuf.Timestamp': {
|
|
35
|
-
encode: (value) => ({ seconds: value / 1000 }),
|
|
36
|
-
decode: (value) => +(value.seconds + '000')
|
|
37
|
-
},
|
|
38
20
|
'dxos.devtools.SubscribeToSwarmInfoResponse.SwarmInfo.ConnectionInfo.Json': {
|
|
39
21
|
encode: (value) => ({ data: JSON.stringify(value) }),
|
|
40
22
|
decode: (value) => JSON.parse(value.data)
|
|
41
|
-
},
|
|
42
|
-
'google.protobuf.Any': {
|
|
43
|
-
encode: (value, schema) => {
|
|
44
|
-
if (typeof value['@type'] !== 'string') {
|
|
45
|
-
throw new Error('Cannot encode google.protobuf.Any without proper "@type" field set');
|
|
46
|
-
}
|
|
47
|
-
const codec = schema.tryGetCodecForType(value['@type']);
|
|
48
|
-
const data = codec.encode(value);
|
|
49
|
-
return {
|
|
50
|
-
type_url: value['@type'],
|
|
51
|
-
value: data
|
|
52
|
-
};
|
|
53
|
-
},
|
|
54
|
-
decode: (value, schema) => {
|
|
55
|
-
console.log('decode any', value);
|
|
56
|
-
const codec = schema.tryGetCodecForType(value.type_url);
|
|
57
|
-
const data = codec.decode(value.value);
|
|
58
|
-
return {
|
|
59
|
-
'@type': value.type_url,
|
|
60
|
-
...data
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
23
|
}
|
|
64
24
|
};
|
|
65
25
|
//# sourceMappingURL=substitutions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"substitutions.js","sourceRoot":"","sources":["../../../src/proto/substitutions.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;
|
|
1
|
+
{"version":3,"file":"substitutions.js","sourceRoot":"","sources":["../../../src/proto/substitutions.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;AAEF,yDAAmF;AACnF,mDAAmD;AACnD,yCAAsD;AACtD,uDAA6D;AAG7D,kBAAe;IACb,GAAG,uCAAsB;IACzB,GAAG,+BAAsB;IACzB,GAAG,sCAAsB;IACzB,GAAG,oCAAmB;IAEtB,oEAAoE;IACpE,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;IACD,0EAA0E,EAAE;QAC1E,MAAM,EAAE,CAAC,KAAsB,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;QACrE,MAAM,EAAE,CAAC,KAAU,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAoB;KAClE;CACF,CAAC"}
|