@dxos/client-services 0.4.10-main.b3cf40d → 0.4.10-main.bb9f1bf
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-4ECD5R24.mjs → chunk-TM5QAJBN.mjs} +1439 -1073
- package/dist/lib/browser/chunk-TM5QAJBN.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +15 -3
- package/dist/lib/browser/index.mjs.map +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/packlets/testing/index.mjs +136 -116
- package/dist/lib/browser/packlets/testing/index.mjs.map +3 -3
- package/dist/lib/node/{chunk-OYV4Y6T4.cjs → chunk-ZMWT7BZY.cjs} +1357 -1079
- package/dist/lib/node/chunk-ZMWT7BZY.cjs.map +7 -0
- package/dist/lib/node/index.cjs +50 -38
- package/dist/lib/node/index.cjs.map +1 -1
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/packlets/testing/index.cjs +135 -118
- package/dist/lib/node/packlets/testing/index.cjs.map +3 -3
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/packlets/diagnostics/browser-diagnostics-broadcast.d.ts +5 -0
- package/dist/types/src/packlets/diagnostics/browser-diagnostics-broadcast.d.ts.map +1 -0
- package/dist/types/src/packlets/diagnostics/diagnostics-broadcast.d.ts +5 -0
- package/dist/types/src/packlets/diagnostics/diagnostics-broadcast.d.ts.map +1 -0
- package/dist/types/src/packlets/diagnostics/diagnostics-collector.d.ts +15 -0
- package/dist/types/src/packlets/diagnostics/diagnostics-collector.d.ts.map +1 -0
- package/dist/types/src/packlets/{services → diagnostics}/diagnostics.d.ts +1 -1
- package/dist/types/src/packlets/diagnostics/diagnostics.d.ts.map +1 -0
- package/dist/types/src/packlets/diagnostics/index.d.ts +4 -0
- package/dist/types/src/packlets/diagnostics/index.d.ts.map +1 -0
- package/dist/types/src/packlets/identity/identity-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/indexing/util.d.ts +2 -6
- package/dist/types/src/packlets/indexing/util.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/device-invitation-protocol.d.ts +3 -1
- package/dist/types/src/packlets/invitations/device-invitation-protocol.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/index.d.ts +1 -0
- package/dist/types/src/packlets/invitations/index.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitation-extension.d.ts +1 -0
- package/dist/types/src/packlets/invitations/invitation-extension.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitation-protocol.d.ts +6 -1
- package/dist/types/src/packlets/invitations/invitation-protocol.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitations-handler.d.ts +8 -4
- package/dist/types/src/packlets/invitations/invitations-handler.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitations-manager.d.ts +44 -0
- package/dist/types/src/packlets/invitations/invitations-manager.d.ts.map +1 -0
- package/dist/types/src/packlets/invitations/invitations-service.d.ts +7 -23
- package/dist/types/src/packlets/invitations/invitations-service.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/space-invitation-protocol.d.ts +2 -1
- package/dist/types/src/packlets/invitations/space-invitation-protocol.d.ts.map +1 -1
- package/dist/types/src/packlets/services/index.d.ts +1 -1
- package/dist/types/src/packlets/services/index.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-context.d.ts +9 -5
- package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-host.d.ts +6 -1
- package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
- package/dist/types/src/packlets/services/util.d.ts +1 -0
- package/dist/types/src/packlets/services/util.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts +5 -1
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space.d.ts.map +1 -1
- package/dist/types/src/packlets/storage/index.d.ts +1 -0
- package/dist/types/src/packlets/storage/index.d.ts.map +1 -1
- package/dist/types/src/packlets/storage/level.d.ts +4 -0
- package/dist/types/src/packlets/storage/level.d.ts.map +1 -0
- package/dist/types/src/packlets/storage/storage.d.ts.map +1 -1
- package/dist/types/src/packlets/storage/util.d.ts +4 -0
- package/dist/types/src/packlets/storage/util.d.ts.map +1 -0
- package/dist/types/src/packlets/system/system-service.d.ts +1 -1
- package/dist/types/src/packlets/system/system-service.d.ts.map +1 -1
- package/dist/types/src/packlets/testing/invitation-utils.d.ts.map +1 -1
- package/dist/types/src/packlets/testing/test-builder.d.ts +7 -2
- package/dist/types/src/packlets/testing/test-builder.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/package.json +36 -34
- package/src/index.ts +1 -0
- package/src/packlets/devices/devices-service.test.ts +1 -1
- package/src/packlets/diagnostics/browser-diagnostics-broadcast.ts +94 -0
- package/src/packlets/diagnostics/diagnostics-broadcast.ts +20 -0
- package/src/packlets/diagnostics/diagnostics-collector.ts +65 -0
- package/src/packlets/{services → diagnostics}/diagnostics.ts +2 -2
- package/src/packlets/diagnostics/index.ts +7 -0
- package/src/packlets/identity/identity-manager.ts +1 -0
- package/src/packlets/identity/identity-service.test.ts +1 -1
- package/src/packlets/identity/identity.test.ts +3 -0
- package/src/packlets/indexing/util.ts +9 -66
- package/src/packlets/invitations/device-invitation-protocol.test.ts +1 -1
- package/src/packlets/invitations/device-invitation-protocol.ts +6 -1
- package/src/packlets/invitations/index.ts +1 -0
- package/src/packlets/invitations/invitation-extension.ts +28 -1
- package/src/packlets/invitations/invitation-protocol.ts +7 -1
- package/src/packlets/invitations/invitations-handler.ts +75 -96
- package/src/packlets/invitations/invitations-manager.ts +271 -0
- package/src/packlets/invitations/invitations-service.ts +23 -168
- package/src/packlets/invitations/space-invitation-protocol.ts +45 -3
- package/src/packlets/network/network-service.test.ts +1 -1
- package/src/packlets/services/automerge-host.test.ts +10 -4
- package/src/packlets/services/index.ts +1 -1
- package/src/packlets/services/service-context.test.ts +9 -6
- package/src/packlets/services/service-context.ts +29 -10
- package/src/packlets/services/service-host.ts +61 -29
- package/src/packlets/services/service-registry.test.ts +1 -1
- package/src/packlets/services/util.ts +2 -0
- package/src/packlets/spaces/data-space-manager.test.ts +4 -4
- package/src/packlets/spaces/data-space-manager.ts +48 -2
- package/src/packlets/spaces/data-space.ts +1 -1
- package/src/packlets/spaces/spaces-service.test.ts +1 -1
- package/src/packlets/storage/index.ts +1 -0
- package/src/packlets/storage/level.ts +19 -0
- package/src/packlets/storage/storage.ts +3 -9
- package/src/packlets/storage/util.ts +19 -0
- package/src/packlets/system/system-service.ts +1 -1
- package/src/packlets/testing/invitation-utils.ts +100 -97
- package/src/packlets/testing/test-builder.ts +42 -6
- package/src/version.ts +1 -1
- package/dist/lib/browser/chunk-4ECD5R24.mjs.map +0 -7
- package/dist/lib/node/chunk-OYV4Y6T4.cjs.map +0 -7
- package/dist/types/src/packlets/services/diagnostics.d.ts.map +0 -1
|
@@ -60,146 +60,149 @@ export const performInvitation = ({
|
|
|
60
60
|
const guestComplete = new Trigger<Result>();
|
|
61
61
|
const authCode = new Trigger<string>();
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
63
|
+
void createInvitation(host, options).then((hostObservable) => {
|
|
64
|
+
hostObservable.subscribe(
|
|
65
|
+
async (hostInvitation: Invitation) => {
|
|
66
|
+
switch (hostInvitation.state) {
|
|
67
|
+
case Invitation.State.CONNECTING: {
|
|
68
|
+
if (hooks?.host?.onConnecting?.(hostObservable)) {
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
const guestObservable = acceptInvitation(guest, hostInvitation, guestDeviceProfile);
|
|
72
|
+
guestObservable.subscribe(
|
|
73
|
+
async (guestInvitation: Invitation) => {
|
|
74
|
+
switch (guestInvitation.state) {
|
|
75
|
+
case Invitation.State.CONNECTING: {
|
|
76
|
+
if (hooks?.guest?.onConnecting?.(guestObservable)) {
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
invariant(hostInvitation.swarmKey!.equals(guestInvitation.swarmKey!));
|
|
77
80
|
break;
|
|
78
81
|
}
|
|
79
|
-
invariant(hostInvitation.swarmKey!.equals(guestInvitation.swarmKey!));
|
|
80
|
-
break;
|
|
81
|
-
}
|
|
82
82
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
83
|
+
case Invitation.State.CONNECTED: {
|
|
84
|
+
hooks?.guest?.onConnected?.(guestObservable);
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
87
|
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
case Invitation.State.READY_FOR_AUTHENTICATION: {
|
|
89
|
+
if (hooks?.guest?.onReady?.(guestObservable)) {
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
await guestObservable.authenticate(await authCode.wait());
|
|
90
93
|
break;
|
|
91
94
|
}
|
|
92
|
-
await guestObservable.authenticate(await authCode.wait());
|
|
93
|
-
break;
|
|
94
|
-
}
|
|
95
95
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
96
|
+
case Invitation.State.AUTHENTICATING: {
|
|
97
|
+
hooks?.guest?.onAuthenticating?.(guestObservable);
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
100
|
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
case Invitation.State.SUCCESS: {
|
|
102
|
+
if (hooks?.guest?.onSuccess?.(guestObservable)) {
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
guestComplete.wake({ invitation: guestInvitation });
|
|
103
106
|
break;
|
|
104
107
|
}
|
|
105
|
-
guestComplete.wake({ invitation: guestInvitation });
|
|
106
|
-
break;
|
|
107
|
-
}
|
|
108
108
|
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
case Invitation.State.CANCELLED: {
|
|
110
|
+
if (hooks?.guest?.onCancelled?.(guestObservable)) {
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
guestComplete.wake({ invitation: guestInvitation });
|
|
111
114
|
break;
|
|
112
115
|
}
|
|
113
|
-
guestComplete.wake({ invitation: guestInvitation });
|
|
114
|
-
break;
|
|
115
|
-
}
|
|
116
116
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
117
|
+
case Invitation.State.TIMEOUT: {
|
|
118
|
+
if (hooks?.guest?.onTimeout?.(guestObservable)) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
guestComplete.wake({ invitation: guestInvitation });
|
|
120
122
|
}
|
|
121
|
-
guestComplete.wake({ invitation: guestInvitation });
|
|
122
123
|
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
case Invitation.State.CONNECTED: {
|
|
136
|
-
hooks?.host?.onConnected?.(hostObservable);
|
|
137
|
-
break;
|
|
138
|
-
}
|
|
124
|
+
},
|
|
125
|
+
(error: Error) => {
|
|
126
|
+
if (hooks?.guest?.onError?.(guestObservable)) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
guestComplete.wake({ error });
|
|
130
|
+
},
|
|
131
|
+
);
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
139
134
|
|
|
140
|
-
|
|
141
|
-
|
|
135
|
+
case Invitation.State.CONNECTED: {
|
|
136
|
+
hooks?.host?.onConnected?.(hostObservable);
|
|
142
137
|
break;
|
|
143
138
|
}
|
|
144
|
-
|
|
145
|
-
|
|
139
|
+
|
|
140
|
+
case Invitation.State.READY_FOR_AUTHENTICATION: {
|
|
141
|
+
if (hooks?.host?.onReady?.(hostObservable)) {
|
|
142
|
+
break;
|
|
143
|
+
}
|
|
144
|
+
if (hostInvitation.authCode) {
|
|
145
|
+
authCode.wake(hostInvitation.authCode);
|
|
146
|
+
}
|
|
147
|
+
break;
|
|
146
148
|
}
|
|
147
|
-
break;
|
|
148
|
-
}
|
|
149
149
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
150
|
+
case Invitation.State.AUTHENTICATING: {
|
|
151
|
+
hooks?.host?.onAuthenticating?.(hostObservable);
|
|
152
|
+
break;
|
|
153
|
+
}
|
|
154
154
|
|
|
155
|
-
|
|
156
|
-
|
|
155
|
+
case Invitation.State.SUCCESS: {
|
|
156
|
+
if (hooks?.host?.onSuccess?.(hostObservable)) {
|
|
157
|
+
break;
|
|
158
|
+
}
|
|
159
|
+
hostComplete.wake({ invitation: hostInvitation });
|
|
157
160
|
break;
|
|
158
161
|
}
|
|
159
|
-
hostComplete.wake({ invitation: hostInvitation });
|
|
160
|
-
break;
|
|
161
|
-
}
|
|
162
162
|
|
|
163
|
-
|
|
164
|
-
|
|
163
|
+
case Invitation.State.CANCELLED: {
|
|
164
|
+
if (hooks?.host?.onCancelled?.(hostObservable)) {
|
|
165
|
+
break;
|
|
166
|
+
}
|
|
167
|
+
hostComplete.wake({ invitation: hostInvitation });
|
|
165
168
|
break;
|
|
166
169
|
}
|
|
167
|
-
hostComplete.wake({ invitation: hostInvitation });
|
|
168
|
-
break;
|
|
169
|
-
}
|
|
170
170
|
|
|
171
|
-
|
|
172
|
-
|
|
171
|
+
case Invitation.State.TIMEOUT: {
|
|
172
|
+
if (hooks?.host?.onTimeout?.(hostObservable)) {
|
|
173
|
+
break;
|
|
174
|
+
}
|
|
175
|
+
hostComplete.wake({ invitation: hostInvitation });
|
|
173
176
|
break;
|
|
174
177
|
}
|
|
175
|
-
hostComplete.wake({ invitation: hostInvitation });
|
|
176
|
-
break;
|
|
177
178
|
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
);
|
|
179
|
+
},
|
|
180
|
+
(error: Error) => {
|
|
181
|
+
if (hooks?.host?.onError?.(hostObservable)) {
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
hostComplete.wake({ error });
|
|
185
|
+
},
|
|
186
|
+
);
|
|
187
|
+
});
|
|
187
188
|
|
|
188
189
|
return [hostComplete.wait(), guestComplete.wait()];
|
|
189
190
|
};
|
|
190
191
|
|
|
191
|
-
const createInvitation = (
|
|
192
|
+
const createInvitation = async (
|
|
192
193
|
host: ServiceContext | InvitationHost,
|
|
193
194
|
options?: Partial<Invitation>,
|
|
194
|
-
): CancellableInvitation => {
|
|
195
|
+
): Promise<CancellableInvitation> => {
|
|
195
196
|
options ??= {
|
|
196
197
|
authMethod: Invitation.AuthMethod.NONE,
|
|
197
198
|
...(options ?? {}),
|
|
198
199
|
};
|
|
199
200
|
|
|
200
201
|
if (host instanceof ServiceContext) {
|
|
201
|
-
|
|
202
|
-
|
|
202
|
+
return host.invitationsManager.createInvitation({
|
|
203
|
+
kind: Invitation.Kind.SPACE,
|
|
204
|
+
...options,
|
|
205
|
+
});
|
|
203
206
|
}
|
|
204
207
|
|
|
205
208
|
return host.share(options);
|
|
@@ -6,14 +6,24 @@ import { type Config } from '@dxos/config';
|
|
|
6
6
|
import { Context } from '@dxos/context';
|
|
7
7
|
import { createCredentialSignerWithChain, CredentialGenerator } from '@dxos/credentials';
|
|
8
8
|
import { failUndefined } from '@dxos/debug';
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
AutomergeHost,
|
|
11
|
+
MetadataStore,
|
|
12
|
+
type LevelDB,
|
|
13
|
+
SnapshotStore,
|
|
14
|
+
SpaceManager,
|
|
15
|
+
valueEncoding,
|
|
16
|
+
} from '@dxos/echo-pipeline';
|
|
17
|
+
import { createTestLevel } from '@dxos/echo-pipeline/testing';
|
|
10
18
|
import { FeedFactory, FeedStore } from '@dxos/feed-store';
|
|
11
19
|
import { Keyring } from '@dxos/keyring';
|
|
12
20
|
import { MemorySignalManager, MemorySignalManagerContext } from '@dxos/messaging';
|
|
13
21
|
import { MemoryTransportFactory, NetworkManager } from '@dxos/network-manager';
|
|
22
|
+
import { Invitation } from '@dxos/protocols/proto/dxos/client/services';
|
|
14
23
|
import { createStorage, StorageType, type Storage } from '@dxos/random-access-storage';
|
|
15
24
|
import { BlobStore } from '@dxos/teleport-extension-object-sync';
|
|
16
25
|
|
|
26
|
+
import { InvitationsHandler, InvitationsManager, SpaceInvitationProtocol } from '../invitations';
|
|
17
27
|
import { ClientServicesHost, ServiceContext } from '../services';
|
|
18
28
|
import { DataSpaceManager, type SigningContext } from '../spaces';
|
|
19
29
|
|
|
@@ -29,7 +39,7 @@ export const createServiceHost = (config: Config, signalManagerContext: MemorySi
|
|
|
29
39
|
});
|
|
30
40
|
};
|
|
31
41
|
|
|
32
|
-
export const createServiceContext = ({
|
|
42
|
+
export const createServiceContext = async ({
|
|
33
43
|
signalContext = new MemorySignalManagerContext(),
|
|
34
44
|
storage = createStorage({ type: StorageType.RAM }),
|
|
35
45
|
}: {
|
|
@@ -41,8 +51,10 @@ export const createServiceContext = ({
|
|
|
41
51
|
signalManager,
|
|
42
52
|
transportFactory: MemoryTransportFactory,
|
|
43
53
|
});
|
|
54
|
+
const level = createTestLevel();
|
|
55
|
+
await level.open();
|
|
44
56
|
|
|
45
|
-
return new ServiceContext(storage, networkManager, signalManager);
|
|
57
|
+
return new ServiceContext(storage, level, networkManager, signalManager);
|
|
46
58
|
};
|
|
47
59
|
|
|
48
60
|
export const createPeers = async (numPeers: number) => {
|
|
@@ -50,7 +62,7 @@ export const createPeers = async (numPeers: number) => {
|
|
|
50
62
|
|
|
51
63
|
return await Promise.all(
|
|
52
64
|
Array.from(Array(numPeers)).map(async () => {
|
|
53
|
-
const peer = createServiceContext({ signalContext });
|
|
65
|
+
const peer = await createServiceContext({ signalContext });
|
|
54
66
|
await peer.open(new Context());
|
|
55
67
|
return peer;
|
|
56
68
|
}),
|
|
@@ -83,6 +95,7 @@ export type TestPeerOpts = {
|
|
|
83
95
|
|
|
84
96
|
export type TestPeerProps = {
|
|
85
97
|
storage?: Storage;
|
|
98
|
+
level?: LevelDB;
|
|
86
99
|
feedStore?: FeedStore<any>;
|
|
87
100
|
metadataStore?: MetadataStore;
|
|
88
101
|
keyring?: Keyring;
|
|
@@ -93,6 +106,7 @@ export type TestPeerProps = {
|
|
|
93
106
|
signingContext?: SigningContext;
|
|
94
107
|
blobStore?: BlobStore;
|
|
95
108
|
automergeHost?: AutomergeHost;
|
|
109
|
+
invitationsManager?: InvitationsManager;
|
|
96
110
|
};
|
|
97
111
|
|
|
98
112
|
export class TestPeer {
|
|
@@ -115,6 +129,10 @@ export class TestPeer {
|
|
|
115
129
|
return (this._props.keyring ??= new Keyring(this.storage.createDirectory('keyring')));
|
|
116
130
|
}
|
|
117
131
|
|
|
132
|
+
get level() {
|
|
133
|
+
return (this._props.level ??= createTestLevel());
|
|
134
|
+
}
|
|
135
|
+
|
|
118
136
|
get feedStore() {
|
|
119
137
|
return (this._props.feedStore ??= new FeedStore({
|
|
120
138
|
factory: new FeedFactory({
|
|
@@ -161,10 +179,12 @@ export class TestPeer {
|
|
|
161
179
|
}
|
|
162
180
|
|
|
163
181
|
get automergeHost() {
|
|
164
|
-
return (this._props.automergeHost ??= new AutomergeHost({
|
|
182
|
+
return (this._props.automergeHost ??= new AutomergeHost({
|
|
183
|
+
db: this.level.sublevel('automerge'),
|
|
184
|
+
}));
|
|
165
185
|
}
|
|
166
186
|
|
|
167
|
-
get dataSpaceManager() {
|
|
187
|
+
get dataSpaceManager(): DataSpaceManager {
|
|
168
188
|
return (this._props.dataSpaceManager ??= new DataSpaceManager(
|
|
169
189
|
this.spaceManager,
|
|
170
190
|
this.metadataStore,
|
|
@@ -172,6 +192,21 @@ export class TestPeer {
|
|
|
172
192
|
this.identity,
|
|
173
193
|
this.feedStore,
|
|
174
194
|
this.automergeHost,
|
|
195
|
+
this.invitationsManager,
|
|
196
|
+
));
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
get invitationsManager() {
|
|
200
|
+
return (this._props.invitationsManager ??= new InvitationsManager(
|
|
201
|
+
new InvitationsHandler(this.networkManager),
|
|
202
|
+
(invitation) => {
|
|
203
|
+
if (invitation.kind === Invitation.Kind.SPACE) {
|
|
204
|
+
return new SpaceInvitationProtocol(this.dataSpaceManager, this.identity!, this.keyring, invitation.spaceKey!);
|
|
205
|
+
} else {
|
|
206
|
+
throw new Error('not implemented');
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
this.metadataStore,
|
|
175
210
|
));
|
|
176
211
|
}
|
|
177
212
|
|
|
@@ -180,6 +215,7 @@ export class TestPeer {
|
|
|
180
215
|
}
|
|
181
216
|
|
|
182
217
|
async destroy() {
|
|
218
|
+
await this.level.close();
|
|
183
219
|
await this.storage.reset();
|
|
184
220
|
}
|
|
185
221
|
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const DXOS_VERSION = "0.4.10-main.
|
|
1
|
+
export const DXOS_VERSION = "0.4.10-main.bb9f1bf";
|