@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.
- package/dist/lib/browser/{chunk-LBG3C332.mjs → chunk-NPM7LZLM.mjs} +125 -124
- package/dist/lib/browser/chunk-NPM7LZLM.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +6 -6
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +6 -6
- package/dist/lib/node-esm/{chunk-SKGQLRKS.mjs → chunk-3GXJDHS7.mjs} +124 -123
- package/dist/lib/node-esm/chunk-3GXJDHS7.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +6 -6
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +6 -6
- package/dist/types/src/packlets/invitations/index.d.ts +1 -1
- package/dist/types/src/packlets/invitations/index.d.ts.map +1 -1
- package/dist/types/src/packlets/locks/index.d.ts +1 -1
- package/dist/types/src/packlets/locks/index.d.ts.map +1 -1
- package/dist/types/src/packlets/logging/logging-service.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-host.d.ts +1 -1
- package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/dist/types/src/version.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +39 -39
- package/src/packlets/invitations/device-invitation-protocol.test.ts +3 -3
- package/src/packlets/invitations/index.ts +1 -1
- package/src/packlets/invitations/invitations-handler.test.ts +298 -289
- package/src/packlets/invitations/space-invitation-protocol.test.ts +8 -8
- package/src/packlets/locks/index.ts +1 -1
- package/src/packlets/logging/logging-service.ts +1 -0
- package/src/packlets/services/service-host.ts +6 -5
- package/src/version.ts +1 -5
- package/README.yml +0 -5
- package/dist/lib/browser/chunk-LBG3C332.mjs.map +0 -7
- package/dist/lib/node/chunk-LMGLGOUU.cjs +0 -9311
- package/dist/lib/node/chunk-LMGLGOUU.cjs.map +0 -7
- package/dist/lib/node/index.cjs +0 -437
- package/dist/lib/node/index.cjs.map +0 -7
- package/dist/lib/node/meta.json +0 -1
- package/dist/lib/node/testing/index.cjs +0 -452
- package/dist/lib/node/testing/index.cjs.map +0 -7
- 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 {
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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>();
|
|
@@ -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
|
|
223
|
-
if (
|
|
224
|
-
this._edgeConnection = new EdgeClient(createStubEdgeIdentity(), { socketEndpoint:
|
|
225
|
-
this._edgeHttpClient = new EdgeHttpClient(
|
|
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
package/README.yml
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
badges:
|
|
2
|
-
- "[](https://github.com/standard/semistandard)"
|
|
3
|
-
|
|
4
|
-
badgesWeMightSupportLater:
|
|
5
|
-
- "[](https://github.com/RichardLitt/standard-readme)"
|