@dxos/client-services 0.8.3 → 0.8.4-main.2e9d522

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 (39) hide show
  1. package/dist/lib/browser/{chunk-LBG3C332.mjs → chunk-NPM7LZLM.mjs} +125 -124
  2. package/dist/lib/browser/chunk-NPM7LZLM.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +6 -6
  4. package/dist/lib/browser/meta.json +1 -1
  5. package/dist/lib/browser/testing/index.mjs +6 -6
  6. package/dist/lib/node-esm/{chunk-SKGQLRKS.mjs → chunk-3GXJDHS7.mjs} +124 -123
  7. package/dist/lib/node-esm/chunk-3GXJDHS7.mjs.map +7 -0
  8. package/dist/lib/node-esm/index.mjs +6 -6
  9. package/dist/lib/node-esm/meta.json +1 -1
  10. package/dist/lib/node-esm/testing/index.mjs +6 -6
  11. package/dist/types/src/packlets/invitations/index.d.ts +1 -1
  12. package/dist/types/src/packlets/invitations/index.d.ts.map +1 -1
  13. package/dist/types/src/packlets/locks/index.d.ts +1 -1
  14. package/dist/types/src/packlets/locks/index.d.ts.map +1 -1
  15. package/dist/types/src/packlets/logging/logging-service.d.ts.map +1 -1
  16. package/dist/types/src/packlets/services/service-host.d.ts +1 -1
  17. package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
  18. package/dist/types/src/version.d.ts +1 -1
  19. package/dist/types/src/version.d.ts.map +1 -1
  20. package/dist/types/tsconfig.tsbuildinfo +1 -1
  21. package/package.json +39 -39
  22. package/src/packlets/invitations/device-invitation-protocol.test.ts +3 -3
  23. package/src/packlets/invitations/index.ts +1 -1
  24. package/src/packlets/invitations/invitations-handler.test.ts +298 -289
  25. package/src/packlets/invitations/space-invitation-protocol.test.ts +8 -8
  26. package/src/packlets/locks/index.ts +1 -1
  27. package/src/packlets/logging/logging-service.ts +1 -0
  28. package/src/packlets/services/service-host.ts +6 -5
  29. package/src/version.ts +1 -5
  30. package/README.yml +0 -5
  31. package/dist/lib/browser/chunk-LBG3C332.mjs.map +0 -7
  32. package/dist/lib/node/chunk-LMGLGOUU.cjs +0 -9311
  33. package/dist/lib/node/chunk-LMGLGOUU.cjs.map +0 -7
  34. package/dist/lib/node/index.cjs +0 -437
  35. package/dist/lib/node/index.cjs.map +0 -7
  36. package/dist/lib/node/meta.json +0 -1
  37. package/dist/lib/node/testing/index.cjs +0 -452
  38. package/dist/lib/node/testing/index.cjs.map +0 -7
  39. package/dist/lib/node-esm/chunk-SKGQLRKS.mjs.map +0 -7
@@ -4,7 +4,7 @@
4
4
 
5
5
  import { onTestFinished, describe, expect, test } from 'vitest';
6
6
 
7
- import { asyncChain, Trigger } from '@dxos/async';
7
+ import { chain, Trigger } from '@dxos/async';
8
8
  import { raise } from '@dxos/debug';
9
9
  import { AlreadyJoinedError } from '@dxos/protocols';
10
10
  import { Invitation } from '@dxos/protocols/proto/dxos/client/services';
@@ -22,7 +22,7 @@ const closeAfterTest = async (peer: ServiceContext) => {
22
22
 
23
23
  describe('services/space-invitations-protocol', () => {
24
24
  test('genesis', async () => {
25
- const [peer] = await asyncChain<ServiceContext>([createIdentity, closeAfterTest])(createPeers(1));
25
+ const [peer] = await chain<ServiceContext>([createIdentity, closeAfterTest])(createPeers(1));
26
26
 
27
27
  const space = await peer.dataSpaceManager!.createSpace();
28
28
  expect(peer.dataSpaceManager!.spaces.has(space.key)).to.be.true;
@@ -31,7 +31,7 @@ describe('services/space-invitations-protocol', () => {
31
31
  });
32
32
 
33
33
  test('genesis & ready', async () => {
34
- const [peer] = await asyncChain<ServiceContext>([createIdentity, closeAfterTest])(createPeers(1));
34
+ const [peer] = await chain<ServiceContext>([createIdentity, closeAfterTest])(createPeers(1));
35
35
 
36
36
  const space = await peer.dataSpaceManager!.createSpace();
37
37
  expect(peer.dataSpaceManager!.spaces.has(space.key)).to.be.true;
@@ -41,7 +41,7 @@ describe('services/space-invitations-protocol', () => {
41
41
  });
42
42
 
43
43
  test('invitation with no auth', async () => {
44
- const [host, guest] = await asyncChain<ServiceContext>([createIdentity, closeAfterTest])(createPeers(2));
44
+ const [host, guest] = await chain<ServiceContext>([createIdentity, closeAfterTest])(createPeers(2));
45
45
 
46
46
  const space1 = await host.dataSpaceManager!.createSpace();
47
47
  const spaceKey = space1.key;
@@ -65,7 +65,7 @@ describe('services/space-invitations-protocol', () => {
65
65
  });
66
66
 
67
67
  test('invitation when already joined', async () => {
68
- const [host, guest] = await asyncChain<ServiceContext>([createIdentity, closeAfterTest])(createPeers(2));
68
+ const [host, guest] = await chain<ServiceContext>([createIdentity, closeAfterTest])(createPeers(2));
69
69
 
70
70
  const space1 = await host.dataSpaceManager!.createSpace();
71
71
  const spaceKey = space1.key;
@@ -92,7 +92,7 @@ describe('services/space-invitations-protocol', () => {
92
92
  });
93
93
 
94
94
  test('creates and accepts invitation with retry', async () => {
95
- const [host, guest] = await asyncChain<ServiceContext>([createIdentity, closeAfterTest])(createPeers(2));
95
+ const [host, guest] = await chain<ServiceContext>([createIdentity, closeAfterTest])(createPeers(2));
96
96
 
97
97
  let attempt = 0;
98
98
 
@@ -153,7 +153,7 @@ describe('services/space-invitations-protocol', () => {
153
153
  });
154
154
 
155
155
  test('timeout', async () => {
156
- const [host, guest] = await asyncChain<ServiceContext>([createIdentity, closeAfterTest])(createPeers(2));
156
+ const [host, guest] = await chain<ServiceContext>([createIdentity, closeAfterTest])(createPeers(2));
157
157
  const space = await host.dataSpaceManager!.createSpace();
158
158
  const hostInvitation = await createInvitation(host, {
159
159
  kind: Invitation.Kind.SPACE,
@@ -175,7 +175,7 @@ describe('services/space-invitations-protocol', () => {
175
175
  });
176
176
 
177
177
  test('cancels invitation', async () => {
178
- const [host, guest] = await asyncChain<ServiceContext>([createIdentity, closeAfterTest])(createPeers(2));
178
+ const [host, guest] = await chain<ServiceContext>([createIdentity, closeAfterTest])(createPeers(2));
179
179
 
180
180
  const hostConnected = new Trigger<Invitation>();
181
181
  const guestConnected = new Trigger<Invitation>();
@@ -2,5 +2,5 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- export * from './resource-lock';
5
+ export type * from './resource-lock';
6
6
  export * from './node';
@@ -112,6 +112,7 @@ export class LoggingServiceImpl implements LoggingService {
112
112
 
113
113
  const record: LogEntry = {
114
114
  ...entry,
115
+ message: entry.message ?? (entry.error ? (entry.error.message ?? String(entry.error)) : ''),
115
116
  context: jsonify(getContextFromEntry(entry)),
116
117
  timestamp: new Date(),
117
118
  meta: {
@@ -81,8 +81,9 @@ export class ClientServicesHost {
81
81
  private readonly _loggingService: LoggingServiceImpl;
82
82
  private readonly _tracingService = TRACE_PROCESSOR.createTraceSender();
83
83
 
84
- private _config?: Config;
85
84
  private readonly _statusUpdate = new Event<void>();
85
+
86
+ private _config?: Config;
86
87
  private _signalManager?: SignalManager;
87
88
  private _networkManager?: SwarmNetworkManager;
88
89
  private _storage?: Storage;
@@ -219,10 +220,10 @@ export class ClientServicesHost {
219
220
  log.warn('running signaling without telemetry metadata.');
220
221
  }
221
222
 
222
- const edgeEndpoint = config?.get('runtime.services.edge.url');
223
- if (edgeEndpoint) {
224
- this._edgeConnection = new EdgeClient(createStubEdgeIdentity(), { socketEndpoint: edgeEndpoint });
225
- this._edgeHttpClient = new EdgeHttpClient(edgeEndpoint);
223
+ const endpoint = config?.get('runtime.services.edge.url');
224
+ if (endpoint) {
225
+ this._edgeConnection = new EdgeClient(createStubEdgeIdentity(), { socketEndpoint: endpoint });
226
+ this._edgeHttpClient = new EdgeHttpClient(endpoint);
226
227
  }
227
228
 
228
229
  const {
package/src/version.ts CHANGED
@@ -1,5 +1 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- export const DXOS_VERSION = '0.8.3'; // {x-release-please-version}
1
+ export const DXOS_VERSION = "0.8.4-main.2e9d522";
package/README.yml DELETED
@@ -1,5 +0,0 @@
1
- badges:
2
- - "[![js-semistandard-style](https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg?style=flat-square)](https://github.com/standard/semistandard)"
3
-
4
- badgesWeMightSupportLater:
5
- - "[![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)"