@dxos/client 2.26.2-dev.96e7d25d → 2.27.0

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 (49) hide show
  1. package/dist/src/client/client.d.ts +5 -15
  2. package/dist/src/client/client.d.ts.map +1 -1
  3. package/dist/src/client/client.js +6 -89
  4. package/dist/src/client/client.js.map +1 -1
  5. package/dist/src/client/client.test.js.map +1 -1
  6. package/dist/src/client/local-client.test.js +0 -10
  7. package/dist/src/client/local-client.test.js.map +1 -1
  8. package/dist/src/client/service-host/services/system.d.ts.map +1 -1
  9. package/dist/src/client/service-host/services/system.js +1 -7
  10. package/dist/src/client/service-host/services/system.js.map +1 -1
  11. package/dist/src/client/service-host/storage.d.ts +1 -1
  12. package/dist/src/client/service-host/storage.d.ts.map +1 -1
  13. package/dist/src/client/service-host/storage.js +15 -14
  14. package/dist/src/client/service-host/storage.js.map +1 -1
  15. package/dist/src/proto/gen/dxos/config.d.ts +175 -253
  16. package/dist/src/proto/gen/dxos/config.d.ts.map +1 -1
  17. package/dist/src/proto/gen/dxos/config.js +26 -23
  18. package/dist/src/proto/gen/dxos/config.js.map +1 -1
  19. package/dist/src/proto/gen/dxos/devtools.d.ts +2 -2
  20. package/dist/src/proto/gen/dxos/devtools.d.ts.map +1 -1
  21. package/dist/src/proto/gen/dxos/echo/service.d.ts +1 -0
  22. package/dist/src/proto/gen/dxos/echo/service.d.ts.map +1 -1
  23. package/dist/src/proto/gen/dxos/echo/snapshot.d.ts +12 -4
  24. package/dist/src/proto/gen/dxos/echo/snapshot.d.ts.map +1 -1
  25. package/dist/src/proto/gen/google/protobuf.d.ts +0 -2
  26. package/dist/src/proto/gen/google/protobuf.d.ts.map +1 -1
  27. package/dist/src/proto/gen/google/protobuf.js.map +1 -1
  28. package/dist/src/proto/gen/index.d.ts +26 -22
  29. package/dist/src/proto/gen/index.d.ts.map +1 -1
  30. package/dist/src/proto/gen/index.js +1 -1
  31. package/dist/src/proto/gen/index.js.map +1 -1
  32. package/dist/src/proto/substitutions.d.ts +16 -21
  33. package/dist/src/proto/substitutions.d.ts.map +1 -1
  34. package/dist/src/proto/substitutions.js +6 -46
  35. package/dist/src/proto/substitutions.js.map +1 -1
  36. package/dist/tsconfig.tsbuildinfo +1 -1
  37. package/package.json +19 -19
  38. package/src/client/client.test.ts +2 -2
  39. package/src/client/client.ts +13 -106
  40. package/src/client/local-client.test.ts +2 -16
  41. package/src/client/service-host/services/system.ts +1 -7
  42. package/src/client/service-host/storage.ts +18 -17
  43. package/src/proto/gen/dxos/config.ts +175 -253
  44. package/src/proto/gen/dxos/devtools.ts +2 -2
  45. package/src/proto/gen/dxos/echo/service.ts +1 -0
  46. package/src/proto/gen/dxos/echo/snapshot.ts +12 -4
  47. package/src/proto/gen/google/protobuf.ts +0 -2
  48. package/src/proto/gen/index.ts +27 -23
  49. package/src/proto/substitutions.ts +9 -51
@@ -1 +1 @@
1
- {"version":3,"file":"substitutions.d.ts","sourceRoot":"","sources":["../../../src/proto/substitutions.ts"],"names":[],"mappings":";AAIA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAS,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;;;sBAM3C,OAAO;;;sBACP,GAAG,KAAG,OAAO;;;4BAGP,SAAS;;;;;;yBAGZ,GAAG;;;wBAOJ,SAAS;;;wBACT,GAAG;;;wBAGH,MAAM;;;wBACN,GAAG;;;wBAGH,MAAM;;;wBACN,GAAG;;;wBAGH,eAAe;;;wBACf,GAAG;;;wBAGH,GAAG,UAAU,OAAO,GAAG,CAAC,KAAG,GAAG;wBAY9B,GAAG,UAAU,OAAO,GAAG,CAAC,KAAG,GAAG;;;AA5ClD,wBAuDE"}
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;;AAGF,mDAAmD;AACnD,yCAAyC;AACzC,uDAAgD;AAGhD,oCAAoC;AAEpC,kBAAe;IACb,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,C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