@dxos/client-services 0.4.10-main.e2d2318 → 0.4.10-main.e3078ed
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-HAFART26.mjs → chunk-IYPYLH4D.mjs} +631 -511
- package/dist/lib/browser/chunk-IYPYLH4D.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +3 -1
- 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 +127 -113
- package/dist/lib/browser/packlets/testing/index.mjs.map +3 -3
- package/dist/lib/node/{chunk-5YDVC6TU.cjs → chunk-PZOCMCLY.cjs} +699 -580
- package/dist/lib/node/chunk-PZOCMCLY.cjs.map +7 -0
- package/dist/lib/node/index.cjs +44 -42
- 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 +127 -116
- package/dist/lib/node/packlets/testing/index.cjs.map +3 -3
- 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-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 +4 -2
- 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/service-context.d.ts +2 -0
- package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-host.d.ts +3 -2
- package/dist/types/src/packlets/services/service-host.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/testing/invitation-utils.d.ts.map +1 -1
- package/dist/types/src/packlets/testing/test-builder.d.ts +6 -4
- 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 +34 -34
- package/src/packlets/identity/identity-manager.ts +1 -0
- package/src/packlets/identity/identity.test.ts +3 -0
- package/src/packlets/indexing/util.ts +9 -66
- package/src/packlets/invitations/device-invitation-protocol.ts +6 -1
- package/src/packlets/invitations/index.ts +1 -0
- package/src/packlets/invitations/invitation-protocol.ts +7 -1
- package/src/packlets/invitations/invitations-handler.ts +11 -73
- 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/services/automerge-host.test.ts +1 -1
- package/src/packlets/services/service-context.ts +17 -5
- package/src/packlets/services/service-host.ts +13 -17
- package/src/packlets/spaces/data-space-manager.ts +48 -2
- package/src/packlets/spaces/data-space.ts +1 -1
- package/src/packlets/testing/invitation-utils.ts +100 -97
- package/src/packlets/testing/test-builder.ts +23 -5
- package/src/version.ts +1 -1
- package/dist/lib/browser/chunk-HAFART26.mjs.map +0 -7
- package/dist/lib/node/chunk-5YDVC6TU.cjs.map +0 -7
|
@@ -9,7 +9,7 @@ import { failUndefined } from '@dxos/debug';
|
|
|
9
9
|
import {
|
|
10
10
|
AutomergeHost,
|
|
11
11
|
MetadataStore,
|
|
12
|
-
type
|
|
12
|
+
type LevelDB,
|
|
13
13
|
SnapshotStore,
|
|
14
14
|
SpaceManager,
|
|
15
15
|
valueEncoding,
|
|
@@ -19,10 +19,11 @@ import { FeedFactory, FeedStore } from '@dxos/feed-store';
|
|
|
19
19
|
import { Keyring } from '@dxos/keyring';
|
|
20
20
|
import { MemorySignalManager, MemorySignalManagerContext } from '@dxos/messaging';
|
|
21
21
|
import { MemoryTransportFactory, NetworkManager } from '@dxos/network-manager';
|
|
22
|
+
import { Invitation } from '@dxos/protocols/proto/dxos/client/services';
|
|
22
23
|
import { createStorage, StorageType, type Storage } from '@dxos/random-access-storage';
|
|
23
24
|
import { BlobStore } from '@dxos/teleport-extension-object-sync';
|
|
24
|
-
import { type MaybePromise } from '@dxos/util';
|
|
25
25
|
|
|
26
|
+
import { InvitationsHandler, InvitationsManager, SpaceInvitationProtocol } from '../invitations';
|
|
26
27
|
import { ClientServicesHost, ServiceContext } from '../services';
|
|
27
28
|
import { DataSpaceManager, type SigningContext } from '../spaces';
|
|
28
29
|
|
|
@@ -94,7 +95,7 @@ export type TestPeerOpts = {
|
|
|
94
95
|
|
|
95
96
|
export type TestPeerProps = {
|
|
96
97
|
storage?: Storage;
|
|
97
|
-
level?:
|
|
98
|
+
level?: LevelDB;
|
|
98
99
|
feedStore?: FeedStore<any>;
|
|
99
100
|
metadataStore?: MetadataStore;
|
|
100
101
|
keyring?: Keyring;
|
|
@@ -105,6 +106,7 @@ export type TestPeerProps = {
|
|
|
105
106
|
signingContext?: SigningContext;
|
|
106
107
|
blobStore?: BlobStore;
|
|
107
108
|
automergeHost?: AutomergeHost;
|
|
109
|
+
invitationsManager?: InvitationsManager;
|
|
108
110
|
};
|
|
109
111
|
|
|
110
112
|
export class TestPeer {
|
|
@@ -178,11 +180,11 @@ export class TestPeer {
|
|
|
178
180
|
|
|
179
181
|
get automergeHost() {
|
|
180
182
|
return (this._props.automergeHost ??= new AutomergeHost({
|
|
181
|
-
db:
|
|
183
|
+
db: this.level.sublevel('automerge'),
|
|
182
184
|
}));
|
|
183
185
|
}
|
|
184
186
|
|
|
185
|
-
get dataSpaceManager() {
|
|
187
|
+
get dataSpaceManager(): DataSpaceManager {
|
|
186
188
|
return (this._props.dataSpaceManager ??= new DataSpaceManager(
|
|
187
189
|
this.spaceManager,
|
|
188
190
|
this.metadataStore,
|
|
@@ -190,6 +192,21 @@ export class TestPeer {
|
|
|
190
192
|
this.identity,
|
|
191
193
|
this.feedStore,
|
|
192
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,
|
|
193
210
|
));
|
|
194
211
|
}
|
|
195
212
|
|
|
@@ -198,6 +215,7 @@ export class TestPeer {
|
|
|
198
215
|
}
|
|
199
216
|
|
|
200
217
|
async destroy() {
|
|
218
|
+
await this.level.close();
|
|
201
219
|
await this.storage.reset();
|
|
202
220
|
}
|
|
203
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.e3078ed";
|