@dxos/client-services 0.8.4-main.84f28bd → 0.8.4-main.a4bbb77
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-OCFDRCSN.mjs → chunk-FZDVFED2.mjs} +2385 -1808
- package/dist/lib/browser/chunk-FZDVFED2.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +143 -99
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +69 -40
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/node-esm/{chunk-D7F3FYZS.mjs → chunk-JDTIU3EP.mjs} +2382 -1804
- package/dist/lib/node-esm/chunk-JDTIU3EP.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +143 -99
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +69 -40
- package/dist/lib/node-esm/testing/index.mjs.map +3 -3
- package/dist/types/src/packlets/agents/edge-agent-service.d.ts +1 -1
- package/dist/types/src/packlets/agents/edge-agent-service.d.ts.map +1 -1
- package/dist/types/src/packlets/devices/devices-service.d.ts.map +1 -1
- package/dist/types/src/packlets/devtools/devtools.d.ts +18 -18
- package/dist/types/src/packlets/devtools/devtools.d.ts.map +1 -1
- package/dist/types/src/packlets/devtools/feeds.d.ts +1 -1
- package/dist/types/src/packlets/devtools/feeds.d.ts.map +1 -1
- package/dist/types/src/packlets/devtools/network.d.ts +1 -1
- package/dist/types/src/packlets/devtools/network.d.ts.map +1 -1
- package/dist/types/src/packlets/diagnostics/browser-diagnostics-broadcast.d.ts +1 -1
- package/dist/types/src/packlets/diagnostics/browser-diagnostics-broadcast.d.ts.map +1 -1
- package/dist/types/src/packlets/diagnostics/diagnostics-broadcast.d.ts +1 -1
- package/dist/types/src/packlets/diagnostics/diagnostics-broadcast.d.ts.map +1 -1
- package/dist/types/src/packlets/diagnostics/diagnostics.d.ts +1 -1
- package/dist/types/src/packlets/diagnostics/diagnostics.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/authenticator.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/contacts-service.d.ts +1 -1
- package/dist/types/src/packlets/identity/contacts-service.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/default-space-state-machine.d.ts +1 -1
- package/dist/types/src/packlets/identity/default-space-state-machine.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity-manager.d.ts +1 -1
- package/dist/types/src/packlets/identity/identity-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity-service.d.ts +1 -1
- package/dist/types/src/packlets/identity/identity-service.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity.d.ts +1 -1
- package/dist/types/src/packlets/identity/identity.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/device-invitation-protocol.d.ts +1 -1
- package/dist/types/src/packlets/invitations/device-invitation-protocol.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/edge-invitation-handler.d.ts +1 -1
- package/dist/types/src/packlets/invitations/edge-invitation-handler.d.ts.map +1 -1
- 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/invitations/invitation-guest-extenstion.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitation-host-extension.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitation-protocol.d.ts +1 -1
- package/dist/types/src/packlets/invitations/invitation-protocol.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitations-handler.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitations-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitations-service.d.ts +1 -1
- package/dist/types/src/packlets/invitations/invitations-service.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/space-invitation-protocol.d.ts +1 -1
- package/dist/types/src/packlets/invitations/space-invitation-protocol.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/utils.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 +1 -1
- package/dist/types/src/packlets/logging/logging-service.d.ts.map +1 -1
- package/dist/types/src/packlets/network/network-service.d.ts +2 -2
- package/dist/types/src/packlets/network/network-service.d.ts.map +1 -1
- package/dist/types/src/packlets/services/client-rpc-server.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-context.d.ts +3 -3
- package/dist/types/src/packlets/services/service-context.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/packlets/space-export/space-archive-writer.d.ts +1 -1
- package/dist/types/src/packlets/space-export/space-archive-writer.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/automerge-space-state.d.ts +1 -1
- package/dist/types/src/packlets/spaces/automerge-space-state.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts +2 -2
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space.d.ts +4 -4
- package/dist/types/src/packlets/spaces/data-space.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/notarization-plugin.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/spaces-service.d.ts +2 -2
- package/dist/types/src/packlets/spaces/spaces-service.d.ts.map +1 -1
- package/dist/types/src/packlets/storage/profile-archive.d.ts.map +1 -1
- package/dist/types/src/packlets/storage/storage.d.ts.map +1 -1
- 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 +2 -2
- package/dist/types/src/packlets/testing/test-builder.d.ts.map +1 -1
- package/dist/types/src/packlets/worker/worker-runtime.d.ts.map +1 -1
- package/dist/types/src/packlets/worker/worker-session.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +41 -39
- package/src/packlets/agents/edge-agent-manager.ts +2 -2
- package/src/packlets/agents/edge-agent-service.ts +2 -2
- package/src/packlets/devices/devices-service.test.ts +4 -3
- package/src/packlets/devices/devices-service.ts +1 -1
- package/src/packlets/devtools/devtools.ts +28 -27
- package/src/packlets/devtools/feeds.ts +2 -2
- package/src/packlets/devtools/network.ts +1 -1
- package/src/packlets/diagnostics/browser-diagnostics-broadcast.ts +1 -1
- package/src/packlets/diagnostics/diagnostics-broadcast.ts +1 -1
- package/src/packlets/diagnostics/diagnostics-collector.ts +1 -1
- package/src/packlets/diagnostics/diagnostics.ts +1 -1
- package/src/packlets/identity/authenticator.node.test.ts +1 -1
- package/src/packlets/identity/authenticator.ts +1 -1
- package/src/packlets/identity/contacts-service.ts +3 -2
- package/src/packlets/identity/default-space-state-machine.ts +1 -1
- package/src/packlets/identity/identity-manager.test.ts +3 -3
- package/src/packlets/identity/identity-manager.ts +3 -3
- package/src/packlets/identity/identity-service.test.ts +3 -2
- package/src/packlets/identity/identity-service.ts +2 -1
- package/src/packlets/identity/identity.test.ts +5 -5
- package/src/packlets/identity/identity.ts +7 -6
- package/src/packlets/invitations/device-invitation-protocol.test.ts +4 -4
- package/src/packlets/invitations/device-invitation-protocol.ts +2 -1
- package/src/packlets/invitations/edge-invitation-handler.ts +1 -1
- package/src/packlets/invitations/index.ts +1 -1
- package/src/packlets/invitations/invitation-guest-extenstion.ts +1 -1
- package/src/packlets/invitations/invitation-host-extension.ts +2 -2
- package/src/packlets/invitations/invitation-protocol.ts +1 -1
- package/src/packlets/invitations/invitations-handler.test.ts +302 -292
- package/src/packlets/invitations/invitations-handler.ts +3 -3
- package/src/packlets/invitations/invitations-manager.ts +3 -3
- package/src/packlets/invitations/invitations-service.ts +1 -1
- package/src/packlets/invitations/space-invitation-protocol.test.ts +9 -9
- package/src/packlets/invitations/space-invitation-protocol.ts +3 -2
- package/src/packlets/invitations/utils.ts +1 -1
- package/src/packlets/locks/browser.ts +1 -1
- package/src/packlets/locks/index.ts +1 -1
- package/src/packlets/logging/logging-service.ts +3 -2
- package/src/packlets/logging/logging.test.ts +1 -1
- package/src/packlets/network/network-service.test.ts +4 -3
- package/src/packlets/network/network-service.ts +2 -2
- package/src/packlets/services/client-rpc-server.ts +1 -1
- package/src/packlets/services/service-context.test.ts +1 -1
- package/src/packlets/services/service-context.ts +9 -8
- package/src/packlets/services/service-host.test.ts +3 -2
- package/src/packlets/services/service-host.ts +19 -10
- package/src/packlets/services/service-registry.test.ts +2 -1
- package/src/packlets/space-export/space-archive-reader.ts +1 -1
- package/src/packlets/space-export/space-archive-writer.ts +4 -4
- package/src/packlets/space-export/tar.test.ts +1 -1
- package/src/packlets/spaces/automerge-space-state.ts +1 -1
- package/src/packlets/spaces/data-space-manager.ts +21 -16
- package/src/packlets/spaces/data-space.ts +9 -8
- package/src/packlets/spaces/edge-feed-replicator.test.ts +2 -2
- package/src/packlets/spaces/edge-feed-replicator.ts +1 -1
- package/src/packlets/spaces/notarization-plugin.test.ts +1 -1
- package/src/packlets/spaces/notarization-plugin.ts +3 -3
- package/src/packlets/spaces/spaces-service.test.ts +3 -2
- package/src/packlets/spaces/spaces-service.ts +17 -16
- package/src/packlets/storage/profile-archive.ts +1 -1
- package/src/packlets/storage/storage.ts +3 -4
- package/src/packlets/system/system-service.test.ts +1 -1
- package/src/packlets/system/system-service.ts +4 -4
- package/src/packlets/testing/invitation-utils.ts +1 -1
- package/src/packlets/testing/test-builder.ts +3 -3
- package/src/packlets/worker/worker-runtime.ts +2 -1
- package/src/packlets/worker/worker-session.ts +4 -4
- package/src/version.ts +1 -1
- package/dist/lib/browser/chunk-OCFDRCSN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-D7F3FYZS.mjs.map +0 -7
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
InvitationsManager,
|
|
7
7
|
ServiceContext,
|
|
8
8
|
SpaceInvitationProtocol
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-JDTIU3EP.mjs";
|
|
10
10
|
|
|
11
11
|
// src/packlets/testing/credential-utils.ts
|
|
12
12
|
import { createCredential } from "@dxos/credentials";
|
|
@@ -197,10 +197,10 @@ var performInvitation = ({ host, guest, options, hooks, guestDeviceProfile, code
|
|
|
197
197
|
];
|
|
198
198
|
};
|
|
199
199
|
var createInvitation = async (host, options) => {
|
|
200
|
-
options
|
|
200
|
+
options ?? (options = {
|
|
201
201
|
authMethod: Invitation.AuthMethod.NONE,
|
|
202
202
|
...options ?? {}
|
|
203
|
-
};
|
|
203
|
+
});
|
|
204
204
|
if (host instanceof ServiceContext) {
|
|
205
205
|
return host.invitationsManager.createInvitation({
|
|
206
206
|
kind: Invitation.Kind.SPACE,
|
|
@@ -222,17 +222,30 @@ var acceptInvitation = (guest, invitation, guestDeviceProfile) => {
|
|
|
222
222
|
|
|
223
223
|
// src/packlets/testing/test-builder.ts
|
|
224
224
|
import { Context } from "@dxos/context";
|
|
225
|
-
import {
|
|
225
|
+
import { CredentialGenerator, createCredentialSignerWithChain } from "@dxos/credentials";
|
|
226
226
|
import { failUndefined } from "@dxos/debug";
|
|
227
|
-
import { EchoHost, MetadataStore, SpaceManager, valueEncoding
|
|
227
|
+
import { EchoHost, MeshEchoReplicator, MetadataStore, SpaceManager, valueEncoding } from "@dxos/echo-pipeline";
|
|
228
228
|
import { FeedFactory, FeedStore } from "@dxos/feed-store";
|
|
229
229
|
import { Keyring } from "@dxos/keyring";
|
|
230
230
|
import { createTestLevel } from "@dxos/kv-store/testing";
|
|
231
231
|
import { MemorySignalManager, MemorySignalManagerContext } from "@dxos/messaging";
|
|
232
232
|
import { MemoryTransportFactory, SwarmNetworkManager } from "@dxos/network-manager";
|
|
233
233
|
import { Invitation as Invitation2 } from "@dxos/protocols/proto/dxos/client/services";
|
|
234
|
-
import {
|
|
234
|
+
import { StorageType, createStorage } from "@dxos/random-access-storage";
|
|
235
235
|
import { BlobStore } from "@dxos/teleport-extension-object-sync";
|
|
236
|
+
function _define_property(obj, key, value) {
|
|
237
|
+
if (key in obj) {
|
|
238
|
+
Object.defineProperty(obj, key, {
|
|
239
|
+
value,
|
|
240
|
+
enumerable: true,
|
|
241
|
+
configurable: true,
|
|
242
|
+
writable: true
|
|
243
|
+
});
|
|
244
|
+
} else {
|
|
245
|
+
obj[key] = value;
|
|
246
|
+
}
|
|
247
|
+
return obj;
|
|
248
|
+
}
|
|
236
249
|
var __dxlog_file2 = "/__w/dxos/dxos/packages/sdk/client-services/src/packlets/testing/test-builder.ts";
|
|
237
250
|
var createServiceHost = (config, signalManagerContext) => {
|
|
238
251
|
return new ClientServicesHost({
|
|
@@ -284,13 +297,6 @@ var createIdentity = async (peer) => {
|
|
|
284
297
|
return peer;
|
|
285
298
|
};
|
|
286
299
|
var TestBuilder = class {
|
|
287
|
-
constructor() {
|
|
288
|
-
this.signalContext = new MemorySignalManagerContext();
|
|
289
|
-
this._ctx = new Context(void 0, {
|
|
290
|
-
F: __dxlog_file2,
|
|
291
|
-
L: 83
|
|
292
|
-
});
|
|
293
|
-
}
|
|
294
300
|
createPeer(peerOptions) {
|
|
295
301
|
const peer = new TestPeer(this.signalContext, peerOptions);
|
|
296
302
|
this._ctx.onDispose(async () => peer.destroy());
|
|
@@ -299,31 +305,35 @@ var TestBuilder = class {
|
|
|
299
305
|
async destroy() {
|
|
300
306
|
await this._ctx.dispose();
|
|
301
307
|
}
|
|
308
|
+
constructor() {
|
|
309
|
+
_define_property(this, "signalContext", new MemorySignalManagerContext());
|
|
310
|
+
_define_property(this, "_ctx", new Context(void 0, {
|
|
311
|
+
F: __dxlog_file2,
|
|
312
|
+
L: 83
|
|
313
|
+
}));
|
|
314
|
+
}
|
|
302
315
|
};
|
|
303
316
|
var TestPeer = class {
|
|
304
|
-
constructor(_signalContext, _opts = {
|
|
305
|
-
dataStore: StorageType.RAM
|
|
306
|
-
}) {
|
|
307
|
-
this._signalContext = _signalContext;
|
|
308
|
-
this._opts = _opts;
|
|
309
|
-
this._props = {};
|
|
310
|
-
}
|
|
311
317
|
get props() {
|
|
312
318
|
return this._props;
|
|
313
319
|
}
|
|
314
320
|
get storage() {
|
|
315
|
-
|
|
321
|
+
var _this__props;
|
|
322
|
+
return (_this__props = this._props).storage ?? (_this__props.storage = createStorage({
|
|
316
323
|
type: this._opts.dataStore
|
|
317
|
-
});
|
|
324
|
+
}));
|
|
318
325
|
}
|
|
319
326
|
get keyring() {
|
|
320
|
-
|
|
327
|
+
var _this__props;
|
|
328
|
+
return (_this__props = this._props).keyring ?? (_this__props.keyring = new Keyring(this.storage.createDirectory("keyring")));
|
|
321
329
|
}
|
|
322
330
|
get level() {
|
|
323
|
-
|
|
331
|
+
var _this__props;
|
|
332
|
+
return (_this__props = this._props).level ?? (_this__props.level = createTestLevel());
|
|
324
333
|
}
|
|
325
334
|
get feedStore() {
|
|
326
|
-
|
|
335
|
+
var _this__props;
|
|
336
|
+
return (_this__props = this._props).feedStore ?? (_this__props.feedStore = new FeedStore({
|
|
327
337
|
factory: new FeedFactory({
|
|
328
338
|
root: this.storage.createDirectory("feeds"),
|
|
329
339
|
signer: this.keyring,
|
|
@@ -331,41 +341,48 @@ var TestPeer = class {
|
|
|
331
341
|
valueEncoding
|
|
332
342
|
}
|
|
333
343
|
})
|
|
334
|
-
});
|
|
344
|
+
}));
|
|
335
345
|
}
|
|
336
346
|
get metadataStore() {
|
|
337
|
-
|
|
347
|
+
var _this__props;
|
|
348
|
+
return (_this__props = this._props).metadataStore ?? (_this__props.metadataStore = new MetadataStore(this.storage.createDirectory("metadata")));
|
|
338
349
|
}
|
|
339
350
|
get blobStore() {
|
|
340
|
-
|
|
351
|
+
var _this__props;
|
|
352
|
+
return (_this__props = this._props).blobStore ?? (_this__props.blobStore = new BlobStore(this.storage.createDirectory("blobs")));
|
|
341
353
|
}
|
|
342
354
|
get networkManager() {
|
|
343
|
-
|
|
355
|
+
var _this__props;
|
|
356
|
+
return (_this__props = this._props).networkManager ?? (_this__props.networkManager = new SwarmNetworkManager({
|
|
344
357
|
signalManager: new MemorySignalManager(this._signalContext),
|
|
345
358
|
transportFactory: MemoryTransportFactory
|
|
346
|
-
});
|
|
359
|
+
}));
|
|
347
360
|
}
|
|
348
361
|
get spaceManager() {
|
|
349
|
-
|
|
362
|
+
var _this__props;
|
|
363
|
+
return (_this__props = this._props).spaceManager ?? (_this__props.spaceManager = new SpaceManager({
|
|
350
364
|
feedStore: this.feedStore,
|
|
351
365
|
networkManager: this.networkManager,
|
|
352
366
|
metadataStore: this.metadataStore,
|
|
353
367
|
blobStore: this.blobStore
|
|
354
|
-
});
|
|
368
|
+
}));
|
|
355
369
|
}
|
|
356
370
|
get identity() {
|
|
357
371
|
return this._props.signingContext ?? failUndefined();
|
|
358
372
|
}
|
|
359
373
|
get echoHost() {
|
|
360
|
-
|
|
374
|
+
var _this__props;
|
|
375
|
+
return (_this__props = this._props).echoHost ?? (_this__props.echoHost = new EchoHost({
|
|
361
376
|
kv: this.level
|
|
362
|
-
});
|
|
377
|
+
}));
|
|
363
378
|
}
|
|
364
379
|
get meshEchoReplicator() {
|
|
365
|
-
|
|
380
|
+
var _this__props;
|
|
381
|
+
return (_this__props = this._props).meshEchoReplicator ?? (_this__props.meshEchoReplicator = new MeshEchoReplicator());
|
|
366
382
|
}
|
|
367
383
|
get dataSpaceManager() {
|
|
368
|
-
|
|
384
|
+
var _this__props;
|
|
385
|
+
return (_this__props = this._props).dataSpaceManager ?? (_this__props.dataSpaceManager = new DataSpaceManager({
|
|
369
386
|
spaceManager: this.spaceManager,
|
|
370
387
|
metadataStore: this.metadataStore,
|
|
371
388
|
keyring: this.keyring,
|
|
@@ -377,19 +394,21 @@ var TestPeer = class {
|
|
|
377
394
|
meshReplicator: this.meshEchoReplicator,
|
|
378
395
|
echoEdgeReplicator: void 0,
|
|
379
396
|
runtimeParams: this._opts.dataSpaceParams
|
|
380
|
-
});
|
|
397
|
+
}));
|
|
381
398
|
}
|
|
382
399
|
get invitationsManager() {
|
|
383
|
-
|
|
400
|
+
var _this__props;
|
|
401
|
+
return (_this__props = this._props).invitationsManager ?? (_this__props.invitationsManager = new InvitationsManager(new InvitationsHandler(this.networkManager), (invitation) => {
|
|
384
402
|
if (invitation.kind === Invitation2.Kind.SPACE) {
|
|
385
403
|
return new SpaceInvitationProtocol(this.dataSpaceManager, this.identity, this.keyring, invitation.spaceKey);
|
|
386
404
|
} else {
|
|
387
405
|
throw new Error("not implemented");
|
|
388
406
|
}
|
|
389
|
-
}, this.metadataStore);
|
|
407
|
+
}, this.metadataStore));
|
|
390
408
|
}
|
|
391
409
|
async createIdentity() {
|
|
392
|
-
|
|
410
|
+
var _this__props;
|
|
411
|
+
(_this__props = this._props).signingContext ?? (_this__props.signingContext = await createSigningContext(this.keyring));
|
|
393
412
|
this.networkManager.setPeerInfo({
|
|
394
413
|
identityKey: this._props.signingContext.identityKey.toHex(),
|
|
395
414
|
peerKey: this._props.signingContext.deviceKey.toHex()
|
|
@@ -399,6 +418,16 @@ var TestPeer = class {
|
|
|
399
418
|
await this.level.close();
|
|
400
419
|
await this.storage.reset();
|
|
401
420
|
}
|
|
421
|
+
constructor(_signalContext, _opts = {
|
|
422
|
+
dataStore: StorageType.RAM
|
|
423
|
+
}) {
|
|
424
|
+
_define_property(this, "_signalContext", void 0);
|
|
425
|
+
_define_property(this, "_opts", void 0);
|
|
426
|
+
_define_property(this, "_props", void 0);
|
|
427
|
+
this._signalContext = _signalContext;
|
|
428
|
+
this._opts = _opts;
|
|
429
|
+
this._props = {};
|
|
430
|
+
}
|
|
402
431
|
};
|
|
403
432
|
var createSigningContext = async (keyring) => {
|
|
404
433
|
const identityKey = await keyring.createKey();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/packlets/testing/credential-utils.ts", "../../../../src/packlets/testing/invitation-utils.ts", "../../../../src/packlets/testing/test-builder.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { createCredential } from '@dxos/credentials';\nimport { type Signer } from '@dxos/crypto';\nimport { PublicKey } from '@dxos/keys';\nimport { type Credential } from '@dxos/protocols/proto/dxos/halo/credentials';\n\nexport const createMockCredential = async ({\n signer,\n issuer,\n}: {\n signer: Signer;\n issuer: PublicKey;\n}): Promise<Credential> =>\n createCredential({\n signer,\n issuer,\n subject: new PublicKey(Buffer.from('test')),\n assertion: {\n '@type': 'example.testing.rpc.MessageWithAny',\n payload: {\n '@type': 'google.protobuf.Any',\n value: Buffer.from('test'),\n },\n },\n });\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { Trigger } from '@dxos/async';\nimport { InvitationEncoder, type AuthenticatingInvitation, type CancellableInvitation } from '@dxos/client-protocol';\nimport { invariant } from '@dxos/invariant';\nimport { Invitation } from '@dxos/protocols/proto/dxos/client/services';\nimport { type DeviceProfileDocument } from '@dxos/protocols/proto/dxos/halo/credentials';\n\nimport { ServiceContext } from '../services';\n\n/**\n * Strip secrets from invitation before giving it to the peer.\n */\nexport const sanitizeInvitation = (invitation: Invitation): Invitation => {\n return InvitationEncoder.decode(InvitationEncoder.encode(invitation));\n};\n\nexport type InvitationHost = {\n share(options?: Partial<Invitation>): CancellableInvitation;\n};\n\nexport type InvitationGuest = {\n join(invitation: Invitation | string, deviceProfile?: DeviceProfileDocument): AuthenticatingInvitation;\n};\n\nexport type PerformInvitationCallbacks<T> = {\n onConnecting?: (value: T) => boolean | void;\n onConnected?: (value: T) => boolean | void;\n onReady?: (value: T) => boolean | void;\n onAuthenticating?: (value: T) => boolean | void;\n onSuccess?: (value: T) => boolean | void;\n onCancelled?: (value: T) => boolean | void;\n onTimeout?: (value: T) => boolean | void;\n onError?: (value: T) => boolean | void;\n};\n\nexport type PerformInvitationParams = {\n host: ServiceContext | InvitationHost;\n guest: ServiceContext | InvitationGuest;\n options?: Partial<Invitation>;\n hooks?: {\n host?: PerformInvitationCallbacks<CancellableInvitation>;\n guest?: PerformInvitationCallbacks<AuthenticatingInvitation>;\n };\n guestDeviceProfile?: DeviceProfileDocument;\n codeInputDelay?: number;\n};\n\nexport type Result = { invitation?: Invitation; error?: Error };\n\n// TODO(burdon): Make async.\n// TODO(burdon): Rename startInvitation.\nexport const performInvitation = ({\n host,\n guest,\n options,\n hooks,\n guestDeviceProfile,\n codeInputDelay,\n}: PerformInvitationParams): [Promise<Result>, Promise<Result>] => {\n let guestError = false;\n let guestConnected = false;\n let wereConnected = false;\n const hostComplete = new Trigger<Result>();\n const guestComplete = new Trigger<Result>();\n const authCode = new Trigger<string>();\n\n void createInvitation(host, options).then((hostObservable) => {\n hostObservable.subscribe(\n async (hostInvitation: Invitation) => {\n switch (hostInvitation.state) {\n case Invitation.State.CONNECTING: {\n if (guestConnected) {\n if (wereConnected) {\n hostComplete.wake({ invitation: hostInvitation });\n }\n break;\n }\n\n guestConnected = true;\n if (hooks?.host?.onConnecting?.(hostObservable)) {\n break;\n }\n\n const guestObservable = acceptInvitation(guest, hostInvitation, guestDeviceProfile);\n guestObservable.subscribe(\n async (guestInvitation: Invitation) => {\n switch (guestInvitation.state) {\n case Invitation.State.CONNECTING: {\n if (hooks?.guest?.onConnecting?.(guestObservable)) {\n break;\n }\n invariant(hostInvitation.swarmKey!.equals(guestInvitation.swarmKey!));\n break;\n }\n\n case Invitation.State.CONNECTED: {\n hooks?.guest?.onConnected?.(guestObservable);\n break;\n }\n\n case Invitation.State.READY_FOR_AUTHENTICATION: {\n if (hooks?.guest?.onReady?.(guestObservable)) {\n break;\n }\n const code = await authCode.wait();\n if (codeInputDelay == null) {\n await guestObservable.authenticate(code);\n } else {\n setTimeout(async () => {\n if (!guestError) {\n await guestObservable.authenticate(code);\n }\n }, codeInputDelay);\n }\n break;\n }\n\n case Invitation.State.AUTHENTICATING: {\n hooks?.guest?.onAuthenticating?.(guestObservable);\n break;\n }\n\n case Invitation.State.SUCCESS: {\n if (hooks?.guest?.onSuccess?.(guestObservable)) {\n break;\n }\n guestComplete.wake({ invitation: guestInvitation });\n break;\n }\n\n case Invitation.State.CANCELLED: {\n if (hooks?.guest?.onCancelled?.(guestObservable)) {\n break;\n }\n guestComplete.wake({ invitation: guestInvitation });\n break;\n }\n\n case Invitation.State.TIMEOUT: {\n if (hooks?.guest?.onTimeout?.(guestObservable)) {\n return;\n }\n guestComplete.wake({ invitation: guestInvitation });\n }\n }\n },\n (error: Error) => {\n guestError = true;\n if (hooks?.guest?.onError?.(guestObservable)) {\n return;\n }\n guestComplete.wake({ error });\n },\n );\n break;\n }\n\n case Invitation.State.CONNECTED: {\n wereConnected = true;\n hooks?.host?.onConnected?.(hostObservable);\n break;\n }\n\n case Invitation.State.READY_FOR_AUTHENTICATION: {\n if (hooks?.host?.onReady?.(hostObservable)) {\n break;\n }\n if (hostInvitation.authCode) {\n authCode.wake(hostInvitation.authCode);\n }\n break;\n }\n\n case Invitation.State.AUTHENTICATING: {\n hooks?.host?.onAuthenticating?.(hostObservable);\n break;\n }\n\n case Invitation.State.SUCCESS: {\n if (hooks?.host?.onSuccess?.(hostObservable)) {\n break;\n }\n hostComplete.wake({ invitation: hostInvitation });\n break;\n }\n\n case Invitation.State.CANCELLED: {\n if (hooks?.host?.onCancelled?.(hostObservable)) {\n break;\n }\n hostComplete.wake({ invitation: hostInvitation });\n break;\n }\n\n case Invitation.State.TIMEOUT: {\n if (hooks?.host?.onTimeout?.(hostObservable)) {\n break;\n }\n hostComplete.wake({ invitation: hostInvitation });\n break;\n }\n }\n },\n (error: Error) => {\n if (hooks?.host?.onError?.(hostObservable)) {\n return;\n }\n hostComplete.wake({ error });\n },\n );\n });\n\n return [hostComplete.wait(), guestComplete.wait()];\n};\n\nexport const createInvitation = async (\n host: ServiceContext | InvitationHost,\n options?: Partial<Invitation>,\n): Promise<CancellableInvitation> => {\n options ??= {\n authMethod: Invitation.AuthMethod.NONE,\n ...(options ?? {}),\n };\n\n if (host instanceof ServiceContext) {\n return host.invitationsManager.createInvitation({\n kind: Invitation.Kind.SPACE,\n ...options,\n });\n }\n\n return host.share(options);\n};\n\nexport const acceptInvitation = (\n guest: ServiceContext | InvitationGuest,\n invitation: Invitation,\n guestDeviceProfile?: DeviceProfileDocument,\n): AuthenticatingInvitation => {\n invitation = sanitizeInvitation(invitation);\n\n if (guest instanceof ServiceContext) {\n return guest.invitationsManager.acceptInvitation({\n invitation,\n deviceProfile: guestDeviceProfile,\n });\n }\n\n return guest.join(invitation, guestDeviceProfile);\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { type Config } from '@dxos/config';\nimport { Context } from '@dxos/context';\nimport { createCredentialSignerWithChain, CredentialGenerator } from '@dxos/credentials';\nimport { failUndefined } from '@dxos/debug';\nimport { EchoHost, MetadataStore, SpaceManager, valueEncoding, MeshEchoReplicator } from '@dxos/echo-pipeline';\nimport { FeedFactory, FeedStore } from '@dxos/feed-store';\nimport { Keyring } from '@dxos/keyring';\nimport { type LevelDB } from '@dxos/kv-store';\nimport { createTestLevel } from '@dxos/kv-store/testing';\nimport { MemorySignalManager, MemorySignalManagerContext, type SignalManager } from '@dxos/messaging';\nimport { MemoryTransportFactory, SwarmNetworkManager } from '@dxos/network-manager';\nimport { Invitation } from '@dxos/protocols/proto/dxos/client/services';\nimport { createStorage, StorageType, type Storage } from '@dxos/random-access-storage';\nimport { BlobStore } from '@dxos/teleport-extension-object-sync';\n\nimport { InvitationsHandler, InvitationsManager, SpaceInvitationProtocol } from '../invitations';\nimport { ClientServicesHost, ServiceContext, type ServiceContextRuntimeParams } from '../services';\nimport { DataSpaceManager, type DataSpaceManagerRuntimeParams, type SigningContext } from '../spaces';\n\n//\n// TODO(burdon): Replace with test builder.\n//\n\nexport const createServiceHost = (config: Config, signalManagerContext: MemorySignalManagerContext) => {\n return new ClientServicesHost({\n config,\n signalManager: new MemorySignalManager(signalManagerContext),\n transportFactory: MemoryTransportFactory,\n });\n};\n\nexport const createServiceContext = async ({\n signalManagerFactory = async () => {\n const signalContext = new MemorySignalManagerContext();\n return new MemorySignalManager(signalContext);\n },\n storage = createStorage({ type: StorageType.RAM }),\n runtimeParams,\n}: {\n signalManagerFactory?: () => Promise<SignalManager>;\n storage?: Storage;\n runtimeParams?: ServiceContextRuntimeParams;\n} = {}) => {\n const signalManager = await signalManagerFactory();\n const networkManager = new SwarmNetworkManager({\n signalManager,\n transportFactory: MemoryTransportFactory,\n });\n const level = createTestLevel();\n await level.open();\n\n return new ServiceContext(storage, level, networkManager, signalManager, undefined, undefined, {\n invitationConnectionDefaultParams: { teleport: { controlHeartbeatInterval: 200 } },\n ...runtimeParams,\n });\n};\n\nexport const createPeers = async (numPeers: number, signalManagerFactory?: () => Promise<SignalManager>) => {\n if (!signalManagerFactory) {\n const signalContext = new MemorySignalManagerContext();\n signalManagerFactory = async () => new MemorySignalManager(signalContext);\n }\n return await Promise.all(\n Array.from(Array(numPeers)).map(async () => {\n const peer = await createServiceContext({ signalManagerFactory });\n await peer.open(new Context());\n return peer;\n }),\n );\n};\n\nexport const createIdentity = async (peer: ServiceContext) => {\n await peer.createIdentity();\n return peer;\n};\n\nexport class TestBuilder {\n public readonly signalContext = new MemorySignalManagerContext();\n private readonly _ctx = new Context();\n\n createPeer(peerOptions?: TestPeerOpts): TestPeer {\n const peer = new TestPeer(this.signalContext, peerOptions);\n this._ctx.onDispose(async () => peer.destroy());\n return peer;\n }\n\n async destroy(): Promise<void> {\n await this._ctx.dispose();\n }\n}\n\nexport type TestPeerOpts = {\n dataStore?: StorageType;\n dataSpaceParams?: DataSpaceManagerRuntimeParams;\n};\n\nexport type TestPeerProps = {\n storage?: Storage;\n level?: LevelDB;\n feedStore?: FeedStore<any>;\n metadataStore?: MetadataStore;\n keyring?: Keyring;\n networkManager?: SwarmNetworkManager;\n spaceManager?: SpaceManager;\n dataSpaceManager?: DataSpaceManager;\n signingContext?: SigningContext;\n blobStore?: BlobStore;\n echoHost?: EchoHost;\n meshEchoReplicator?: MeshEchoReplicator;\n invitationsManager?: InvitationsManager;\n};\n\nexport class TestPeer {\n private _props: TestPeerProps = {};\n\n constructor(\n private readonly _signalContext: MemorySignalManagerContext,\n private readonly _opts: TestPeerOpts = { dataStore: StorageType.RAM },\n ) {}\n\n get props() {\n return this._props;\n }\n\n get storage() {\n return (this._props.storage ??= createStorage({ type: this._opts.dataStore }));\n }\n\n get keyring() {\n return (this._props.keyring ??= new Keyring(this.storage.createDirectory('keyring')));\n }\n\n get level() {\n return (this._props.level ??= createTestLevel());\n }\n\n get feedStore() {\n return (this._props.feedStore ??= new FeedStore({\n factory: new FeedFactory({\n root: this.storage.createDirectory('feeds'),\n signer: this.keyring,\n hypercore: {\n valueEncoding,\n },\n }),\n }));\n }\n\n get metadataStore() {\n return (this._props.metadataStore ??= new MetadataStore(this.storage.createDirectory('metadata')));\n }\n\n get blobStore() {\n return (this._props.blobStore ??= new BlobStore(this.storage.createDirectory('blobs')));\n }\n\n get networkManager() {\n return (this._props.networkManager ??= new SwarmNetworkManager({\n signalManager: new MemorySignalManager(this._signalContext),\n transportFactory: MemoryTransportFactory,\n }));\n }\n\n get spaceManager() {\n return (this._props.spaceManager ??= new SpaceManager({\n feedStore: this.feedStore,\n networkManager: this.networkManager,\n metadataStore: this.metadataStore,\n blobStore: this.blobStore,\n }));\n }\n\n get identity() {\n return this._props.signingContext ?? failUndefined();\n }\n\n get echoHost() {\n return (this._props.echoHost ??= new EchoHost({ kv: this.level }));\n }\n\n get meshEchoReplicator() {\n return (this._props.meshEchoReplicator ??= new MeshEchoReplicator());\n }\n\n get dataSpaceManager(): DataSpaceManager {\n return (this._props.dataSpaceManager ??= new DataSpaceManager({\n spaceManager: this.spaceManager,\n metadataStore: this.metadataStore,\n keyring: this.keyring,\n signingContext: this.identity,\n feedStore: this.feedStore,\n echoHost: this.echoHost,\n invitationsManager: this.invitationsManager,\n edgeConnection: undefined,\n meshReplicator: this.meshEchoReplicator,\n echoEdgeReplicator: undefined,\n runtimeParams: this._opts.dataSpaceParams,\n }));\n }\n\n get invitationsManager() {\n return (this._props.invitationsManager ??= new InvitationsManager(\n new InvitationsHandler(this.networkManager),\n (invitation) => {\n if (invitation.kind === Invitation.Kind.SPACE) {\n return new SpaceInvitationProtocol(this.dataSpaceManager, this.identity!, this.keyring, invitation.spaceKey!);\n } else {\n throw new Error('not implemented');\n }\n },\n this.metadataStore,\n ));\n }\n\n async createIdentity(): Promise<void> {\n this._props.signingContext ??= await createSigningContext(this.keyring);\n this.networkManager.setPeerInfo({\n identityKey: this._props.signingContext.identityKey.toHex(),\n peerKey: this._props.signingContext.deviceKey.toHex(),\n });\n }\n\n async destroy(): Promise<void> {\n await this.level.close();\n await this.storage.reset();\n }\n}\n\nexport const createSigningContext = async (keyring: Keyring): Promise<SigningContext> => {\n const identityKey = await keyring.createKey();\n const deviceKey = await keyring.createKey();\n\n return {\n identityKey,\n deviceKey,\n credentialSigner: createCredentialSignerWithChain(\n keyring,\n {\n credential: await new CredentialGenerator(keyring, identityKey, deviceKey).createDeviceAuthorization(deviceKey),\n },\n deviceKey,\n ),\n recordCredential: async () => {}, // No-op.\n getProfile: () => undefined,\n };\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;AAIA,SAASA,wBAAwB;AAEjC,SAASC,iBAAiB;AAGnB,IAAMC,uBAAuB,OAAO,EACzCC,QACAC,OAAM,MAKNC,iBAAiB;EACfF;EACAC;EACAE,SAAS,IAAIC,UAAUC,OAAOC,KAAK,MAAA,CAAA;EACnCC,WAAW;IACT,SAAS;IACTC,SAAS;MACP,SAAS;MACTC,OAAOJ,OAAOC,KAAK,MAAA;IACrB;EACF;AACF,CAAA;;;ACvBF,SAASI,eAAe;AACxB,
|
|
6
|
-
"names": ["createCredential", "PublicKey", "createMockCredential", "signer", "issuer", "createCredential", "subject", "PublicKey", "Buffer", "from", "assertion", "payload", "value", "Trigger", "InvitationEncoder", "invariant", "Invitation", "sanitizeInvitation", "invitation", "InvitationEncoder", "decode", "encode", "performInvitation", "host", "guest", "options", "hooks", "guestDeviceProfile", "codeInputDelay", "guestError", "guestConnected", "wereConnected", "hostComplete", "Trigger", "guestComplete", "authCode", "createInvitation", "then", "hostObservable", "subscribe", "hostInvitation", "state", "Invitation", "State", "CONNECTING", "wake", "onConnecting", "guestObservable", "acceptInvitation", "guestInvitation", "invariant", "swarmKey", "equals", "CONNECTED", "onConnected", "READY_FOR_AUTHENTICATION", "onReady", "code", "wait", "authenticate", "setTimeout", "AUTHENTICATING", "onAuthenticating", "SUCCESS", "onSuccess", "CANCELLED", "onCancelled", "TIMEOUT", "onTimeout", "error", "onError", "authMethod", "AuthMethod", "NONE", "ServiceContext", "invitationsManager", "kind", "Kind", "SPACE", "share", "deviceProfile", "join", "Context", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { createCredential } from '@dxos/credentials';\nimport { type Signer } from '@dxos/crypto';\nimport { PublicKey } from '@dxos/keys';\nimport { type Credential } from '@dxos/protocols/proto/dxos/halo/credentials';\n\nexport const createMockCredential = async ({\n signer,\n issuer,\n}: {\n signer: Signer;\n issuer: PublicKey;\n}): Promise<Credential> =>\n createCredential({\n signer,\n issuer,\n subject: new PublicKey(Buffer.from('test')),\n assertion: {\n '@type': 'example.testing.rpc.MessageWithAny',\n payload: {\n '@type': 'google.protobuf.Any',\n value: Buffer.from('test'),\n },\n },\n });\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { Trigger } from '@dxos/async';\nimport { type AuthenticatingInvitation, type CancellableInvitation, InvitationEncoder } from '@dxos/client-protocol';\nimport { invariant } from '@dxos/invariant';\nimport { Invitation } from '@dxos/protocols/proto/dxos/client/services';\nimport { type DeviceProfileDocument } from '@dxos/protocols/proto/dxos/halo/credentials';\n\nimport { ServiceContext } from '../services';\n\n/**\n * Strip secrets from invitation before giving it to the peer.\n */\nexport const sanitizeInvitation = (invitation: Invitation): Invitation => {\n return InvitationEncoder.decode(InvitationEncoder.encode(invitation));\n};\n\nexport type InvitationHost = {\n share(options?: Partial<Invitation>): CancellableInvitation;\n};\n\nexport type InvitationGuest = {\n join(invitation: Invitation | string, deviceProfile?: DeviceProfileDocument): AuthenticatingInvitation;\n};\n\nexport type PerformInvitationCallbacks<T> = {\n onConnecting?: (value: T) => boolean | void;\n onConnected?: (value: T) => boolean | void;\n onReady?: (value: T) => boolean | void;\n onAuthenticating?: (value: T) => boolean | void;\n onSuccess?: (value: T) => boolean | void;\n onCancelled?: (value: T) => boolean | void;\n onTimeout?: (value: T) => boolean | void;\n onError?: (value: T) => boolean | void;\n};\n\nexport type PerformInvitationParams = {\n host: ServiceContext | InvitationHost;\n guest: ServiceContext | InvitationGuest;\n options?: Partial<Invitation>;\n hooks?: {\n host?: PerformInvitationCallbacks<CancellableInvitation>;\n guest?: PerformInvitationCallbacks<AuthenticatingInvitation>;\n };\n guestDeviceProfile?: DeviceProfileDocument;\n codeInputDelay?: number;\n};\n\nexport type Result = { invitation?: Invitation; error?: Error };\n\n// TODO(burdon): Make async.\n// TODO(burdon): Rename startInvitation.\nexport const performInvitation = ({\n host,\n guest,\n options,\n hooks,\n guestDeviceProfile,\n codeInputDelay,\n}: PerformInvitationParams): [Promise<Result>, Promise<Result>] => {\n let guestError = false;\n let guestConnected = false;\n let wereConnected = false;\n const hostComplete = new Trigger<Result>();\n const guestComplete = new Trigger<Result>();\n const authCode = new Trigger<string>();\n\n void createInvitation(host, options).then((hostObservable) => {\n hostObservable.subscribe(\n async (hostInvitation: Invitation) => {\n switch (hostInvitation.state) {\n case Invitation.State.CONNECTING: {\n if (guestConnected) {\n if (wereConnected) {\n hostComplete.wake({ invitation: hostInvitation });\n }\n break;\n }\n\n guestConnected = true;\n if (hooks?.host?.onConnecting?.(hostObservable)) {\n break;\n }\n\n const guestObservable = acceptInvitation(guest, hostInvitation, guestDeviceProfile);\n guestObservable.subscribe(\n async (guestInvitation: Invitation) => {\n switch (guestInvitation.state) {\n case Invitation.State.CONNECTING: {\n if (hooks?.guest?.onConnecting?.(guestObservable)) {\n break;\n }\n invariant(hostInvitation.swarmKey!.equals(guestInvitation.swarmKey!));\n break;\n }\n\n case Invitation.State.CONNECTED: {\n hooks?.guest?.onConnected?.(guestObservable);\n break;\n }\n\n case Invitation.State.READY_FOR_AUTHENTICATION: {\n if (hooks?.guest?.onReady?.(guestObservable)) {\n break;\n }\n const code = await authCode.wait();\n if (codeInputDelay == null) {\n await guestObservable.authenticate(code);\n } else {\n setTimeout(async () => {\n if (!guestError) {\n await guestObservable.authenticate(code);\n }\n }, codeInputDelay);\n }\n break;\n }\n\n case Invitation.State.AUTHENTICATING: {\n hooks?.guest?.onAuthenticating?.(guestObservable);\n break;\n }\n\n case Invitation.State.SUCCESS: {\n if (hooks?.guest?.onSuccess?.(guestObservable)) {\n break;\n }\n guestComplete.wake({ invitation: guestInvitation });\n break;\n }\n\n case Invitation.State.CANCELLED: {\n if (hooks?.guest?.onCancelled?.(guestObservable)) {\n break;\n }\n guestComplete.wake({ invitation: guestInvitation });\n break;\n }\n\n case Invitation.State.TIMEOUT: {\n if (hooks?.guest?.onTimeout?.(guestObservable)) {\n return;\n }\n guestComplete.wake({ invitation: guestInvitation });\n }\n }\n },\n (error: Error) => {\n guestError = true;\n if (hooks?.guest?.onError?.(guestObservable)) {\n return;\n }\n guestComplete.wake({ error });\n },\n );\n break;\n }\n\n case Invitation.State.CONNECTED: {\n wereConnected = true;\n hooks?.host?.onConnected?.(hostObservable);\n break;\n }\n\n case Invitation.State.READY_FOR_AUTHENTICATION: {\n if (hooks?.host?.onReady?.(hostObservable)) {\n break;\n }\n if (hostInvitation.authCode) {\n authCode.wake(hostInvitation.authCode);\n }\n break;\n }\n\n case Invitation.State.AUTHENTICATING: {\n hooks?.host?.onAuthenticating?.(hostObservable);\n break;\n }\n\n case Invitation.State.SUCCESS: {\n if (hooks?.host?.onSuccess?.(hostObservable)) {\n break;\n }\n hostComplete.wake({ invitation: hostInvitation });\n break;\n }\n\n case Invitation.State.CANCELLED: {\n if (hooks?.host?.onCancelled?.(hostObservable)) {\n break;\n }\n hostComplete.wake({ invitation: hostInvitation });\n break;\n }\n\n case Invitation.State.TIMEOUT: {\n if (hooks?.host?.onTimeout?.(hostObservable)) {\n break;\n }\n hostComplete.wake({ invitation: hostInvitation });\n break;\n }\n }\n },\n (error: Error) => {\n if (hooks?.host?.onError?.(hostObservable)) {\n return;\n }\n hostComplete.wake({ error });\n },\n );\n });\n\n return [hostComplete.wait(), guestComplete.wait()];\n};\n\nexport const createInvitation = async (\n host: ServiceContext | InvitationHost,\n options?: Partial<Invitation>,\n): Promise<CancellableInvitation> => {\n options ??= {\n authMethod: Invitation.AuthMethod.NONE,\n ...(options ?? {}),\n };\n\n if (host instanceof ServiceContext) {\n return host.invitationsManager.createInvitation({\n kind: Invitation.Kind.SPACE,\n ...options,\n });\n }\n\n return host.share(options);\n};\n\nexport const acceptInvitation = (\n guest: ServiceContext | InvitationGuest,\n invitation: Invitation,\n guestDeviceProfile?: DeviceProfileDocument,\n): AuthenticatingInvitation => {\n invitation = sanitizeInvitation(invitation);\n\n if (guest instanceof ServiceContext) {\n return guest.invitationsManager.acceptInvitation({\n invitation,\n deviceProfile: guestDeviceProfile,\n });\n }\n\n return guest.join(invitation, guestDeviceProfile);\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { type Config } from '@dxos/config';\nimport { Context } from '@dxos/context';\nimport { CredentialGenerator, createCredentialSignerWithChain } from '@dxos/credentials';\nimport { failUndefined } from '@dxos/debug';\nimport { EchoHost, MeshEchoReplicator, MetadataStore, SpaceManager, valueEncoding } from '@dxos/echo-pipeline';\nimport { FeedFactory, FeedStore } from '@dxos/feed-store';\nimport { Keyring } from '@dxos/keyring';\nimport { type LevelDB } from '@dxos/kv-store';\nimport { createTestLevel } from '@dxos/kv-store/testing';\nimport { MemorySignalManager, MemorySignalManagerContext, type SignalManager } from '@dxos/messaging';\nimport { MemoryTransportFactory, SwarmNetworkManager } from '@dxos/network-manager';\nimport { Invitation } from '@dxos/protocols/proto/dxos/client/services';\nimport { type Storage, StorageType, createStorage } from '@dxos/random-access-storage';\nimport { BlobStore } from '@dxos/teleport-extension-object-sync';\n\nimport { InvitationsHandler, InvitationsManager, SpaceInvitationProtocol } from '../invitations';\nimport { ClientServicesHost, ServiceContext, type ServiceContextRuntimeParams } from '../services';\nimport { DataSpaceManager, type DataSpaceManagerRuntimeParams, type SigningContext } from '../spaces';\n\n//\n// TODO(burdon): Replace with test builder.\n//\n\nexport const createServiceHost = (config: Config, signalManagerContext: MemorySignalManagerContext) => {\n return new ClientServicesHost({\n config,\n signalManager: new MemorySignalManager(signalManagerContext),\n transportFactory: MemoryTransportFactory,\n });\n};\n\nexport const createServiceContext = async ({\n signalManagerFactory = async () => {\n const signalContext = new MemorySignalManagerContext();\n return new MemorySignalManager(signalContext);\n },\n storage = createStorage({ type: StorageType.RAM }),\n runtimeParams,\n}: {\n signalManagerFactory?: () => Promise<SignalManager>;\n storage?: Storage;\n runtimeParams?: ServiceContextRuntimeParams;\n} = {}) => {\n const signalManager = await signalManagerFactory();\n const networkManager = new SwarmNetworkManager({\n signalManager,\n transportFactory: MemoryTransportFactory,\n });\n const level = createTestLevel();\n await level.open();\n\n return new ServiceContext(storage, level, networkManager, signalManager, undefined, undefined, {\n invitationConnectionDefaultParams: { teleport: { controlHeartbeatInterval: 200 } },\n ...runtimeParams,\n });\n};\n\nexport const createPeers = async (numPeers: number, signalManagerFactory?: () => Promise<SignalManager>) => {\n if (!signalManagerFactory) {\n const signalContext = new MemorySignalManagerContext();\n signalManagerFactory = async () => new MemorySignalManager(signalContext);\n }\n return await Promise.all(\n Array.from(Array(numPeers)).map(async () => {\n const peer = await createServiceContext({ signalManagerFactory });\n await peer.open(new Context());\n return peer;\n }),\n );\n};\n\nexport const createIdentity = async (peer: ServiceContext) => {\n await peer.createIdentity();\n return peer;\n};\n\nexport class TestBuilder {\n public readonly signalContext = new MemorySignalManagerContext();\n private readonly _ctx = new Context();\n\n createPeer(peerOptions?: TestPeerOpts): TestPeer {\n const peer = new TestPeer(this.signalContext, peerOptions);\n this._ctx.onDispose(async () => peer.destroy());\n return peer;\n }\n\n async destroy(): Promise<void> {\n await this._ctx.dispose();\n }\n}\n\nexport type TestPeerOpts = {\n dataStore?: StorageType;\n dataSpaceParams?: DataSpaceManagerRuntimeParams;\n};\n\nexport type TestPeerProps = {\n storage?: Storage;\n level?: LevelDB;\n feedStore?: FeedStore<any>;\n metadataStore?: MetadataStore;\n keyring?: Keyring;\n networkManager?: SwarmNetworkManager;\n spaceManager?: SpaceManager;\n dataSpaceManager?: DataSpaceManager;\n signingContext?: SigningContext;\n blobStore?: BlobStore;\n echoHost?: EchoHost;\n meshEchoReplicator?: MeshEchoReplicator;\n invitationsManager?: InvitationsManager;\n};\n\nexport class TestPeer {\n private _props: TestPeerProps = {};\n\n constructor(\n private readonly _signalContext: MemorySignalManagerContext,\n private readonly _opts: TestPeerOpts = { dataStore: StorageType.RAM },\n ) {}\n\n get props() {\n return this._props;\n }\n\n get storage() {\n return (this._props.storage ??= createStorage({ type: this._opts.dataStore }));\n }\n\n get keyring() {\n return (this._props.keyring ??= new Keyring(this.storage.createDirectory('keyring')));\n }\n\n get level() {\n return (this._props.level ??= createTestLevel());\n }\n\n get feedStore() {\n return (this._props.feedStore ??= new FeedStore({\n factory: new FeedFactory({\n root: this.storage.createDirectory('feeds'),\n signer: this.keyring,\n hypercore: {\n valueEncoding,\n },\n }),\n }));\n }\n\n get metadataStore() {\n return (this._props.metadataStore ??= new MetadataStore(this.storage.createDirectory('metadata')));\n }\n\n get blobStore() {\n return (this._props.blobStore ??= new BlobStore(this.storage.createDirectory('blobs')));\n }\n\n get networkManager() {\n return (this._props.networkManager ??= new SwarmNetworkManager({\n signalManager: new MemorySignalManager(this._signalContext),\n transportFactory: MemoryTransportFactory,\n }));\n }\n\n get spaceManager() {\n return (this._props.spaceManager ??= new SpaceManager({\n feedStore: this.feedStore,\n networkManager: this.networkManager,\n metadataStore: this.metadataStore,\n blobStore: this.blobStore,\n }));\n }\n\n get identity() {\n return this._props.signingContext ?? failUndefined();\n }\n\n get echoHost() {\n return (this._props.echoHost ??= new EchoHost({ kv: this.level }));\n }\n\n get meshEchoReplicator() {\n return (this._props.meshEchoReplicator ??= new MeshEchoReplicator());\n }\n\n get dataSpaceManager(): DataSpaceManager {\n return (this._props.dataSpaceManager ??= new DataSpaceManager({\n spaceManager: this.spaceManager,\n metadataStore: this.metadataStore,\n keyring: this.keyring,\n signingContext: this.identity,\n feedStore: this.feedStore,\n echoHost: this.echoHost,\n invitationsManager: this.invitationsManager,\n edgeConnection: undefined,\n meshReplicator: this.meshEchoReplicator,\n echoEdgeReplicator: undefined,\n runtimeParams: this._opts.dataSpaceParams,\n }));\n }\n\n get invitationsManager() {\n return (this._props.invitationsManager ??= new InvitationsManager(\n new InvitationsHandler(this.networkManager),\n (invitation) => {\n if (invitation.kind === Invitation.Kind.SPACE) {\n return new SpaceInvitationProtocol(this.dataSpaceManager, this.identity!, this.keyring, invitation.spaceKey!);\n } else {\n throw new Error('not implemented');\n }\n },\n this.metadataStore,\n ));\n }\n\n async createIdentity(): Promise<void> {\n this._props.signingContext ??= await createSigningContext(this.keyring);\n this.networkManager.setPeerInfo({\n identityKey: this._props.signingContext.identityKey.toHex(),\n peerKey: this._props.signingContext.deviceKey.toHex(),\n });\n }\n\n async destroy(): Promise<void> {\n await this.level.close();\n await this.storage.reset();\n }\n}\n\nexport const createSigningContext = async (keyring: Keyring): Promise<SigningContext> => {\n const identityKey = await keyring.createKey();\n const deviceKey = await keyring.createKey();\n\n return {\n identityKey,\n deviceKey,\n credentialSigner: createCredentialSignerWithChain(\n keyring,\n {\n credential: await new CredentialGenerator(keyring, identityKey, deviceKey).createDeviceAuthorization(deviceKey),\n },\n deviceKey,\n ),\n recordCredential: async () => {}, // No-op.\n getProfile: () => undefined,\n };\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;AAIA,SA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,YAAY;MAC9BC,aAAa,KAAKhD,OAAOsB,eAAe0B,YAAYC,MAAK;MACzDC,SAAS,KAAKlD,OAAOsB,eAAe6B,UAAUF,MAAK;IACrD,CAAA;EACF;EAEA,MAAMpD,UAAyB;AAC7B,UAAM,KAAKxB,MAAM+E,MAAK;AACtB,UAAM,KAAKvF,QAAQwF,MAAK;EAC1B;EA9GA,YACmBnC,gBACAjB,QAAsB;IAAEC,WAAWlC,YAAYC;EAAI,GACpE;;;AALF,qBAAA,MAAQ+B,UAAR,MAAA;SAGmBkB,iBAAAA;SACAjB,QAAAA;SAJXD,SAAwB,CAAC;EAK9B;AA4GL;AAEO,IAAM8C,uBAAuB,OAAO3C,YAAAA;AACzC,QAAM6C,cAAc,MAAM7C,QAAQmD,UAAS;AAC3C,QAAMH,YAAY,MAAMhD,QAAQmD,UAAS;AAEzC,SAAO;IACLN;IACAG;IACAI,kBAAkBC,gCAChBrD,SACA;MACEsD,YAAY,MAAM,IAAIC,oBAAoBvD,SAAS6C,aAAaG,SAAAA,EAAWQ,0BAA0BR,SAAAA;IACvG,GACAA,SAAAA;IAEFS,kBAAkB,YAAA;IAAa;IAC/BC,YAAY,MAAMpF;EACpB;AACF;",
|
|
6
|
+
"names": ["createCredential", "PublicKey", "createMockCredential", "signer", "issuer", "createCredential", "subject", "PublicKey", "Buffer", "from", "assertion", "payload", "value", "Trigger", "InvitationEncoder", "invariant", "Invitation", "sanitizeInvitation", "invitation", "InvitationEncoder", "decode", "encode", "performInvitation", "host", "guest", "options", "hooks", "guestDeviceProfile", "codeInputDelay", "guestError", "guestConnected", "wereConnected", "hostComplete", "Trigger", "guestComplete", "authCode", "createInvitation", "then", "hostObservable", "subscribe", "hostInvitation", "state", "Invitation", "State", "CONNECTING", "wake", "onConnecting", "guestObservable", "acceptInvitation", "guestInvitation", "invariant", "swarmKey", "equals", "CONNECTED", "onConnected", "READY_FOR_AUTHENTICATION", "onReady", "code", "wait", "authenticate", "setTimeout", "AUTHENTICATING", "onAuthenticating", "SUCCESS", "onSuccess", "CANCELLED", "onCancelled", "TIMEOUT", "onTimeout", "error", "onError", "authMethod", "AuthMethod", "NONE", "ServiceContext", "invitationsManager", "kind", "Kind", "SPACE", "share", "deviceProfile", "join", "Context", "CredentialGenerator", "createCredentialSignerWithChain", "failUndefined", "EchoHost", "MeshEchoReplicator", "MetadataStore", "SpaceManager", "valueEncoding", "FeedFactory", "FeedStore", "Keyring", "createTestLevel", "MemorySignalManager", "MemorySignalManagerContext", "MemoryTransportFactory", "SwarmNetworkManager", "Invitation", "StorageType", "createStorage", "BlobStore", "createServiceHost", "config", "signalManagerContext", "ClientServicesHost", "signalManager", "MemorySignalManager", "transportFactory", "MemoryTransportFactory", "createServiceContext", "signalManagerFactory", "signalContext", "MemorySignalManagerContext", "storage", "createStorage", "type", "StorageType", "RAM", "runtimeParams", "networkManager", "SwarmNetworkManager", "level", "createTestLevel", "open", "ServiceContext", "undefined", "invitationConnectionDefaultParams", "teleport", "controlHeartbeatInterval", "createPeers", "numPeers", "Promise", "all", "Array", "from", "map", "peer", "Context", "createIdentity", "TestBuilder", "createPeer", "peerOptions", "TestPeer", "_ctx", "onDispose", "destroy", "dispose", "props", "_props", "_opts", "dataStore", "keyring", "Keyring", "createDirectory", "feedStore", "FeedStore", "factory", "FeedFactory", "root", "signer", "hypercore", "valueEncoding", "metadataStore", "MetadataStore", "blobStore", "BlobStore", "_signalContext", "spaceManager", "SpaceManager", "identity", "signingContext", "failUndefined", "echoHost", "EchoHost", "kv", "meshEchoReplicator", "MeshEchoReplicator", "dataSpaceManager", "DataSpaceManager", "invitationsManager", "edgeConnection", "meshReplicator", "echoEdgeReplicator", "dataSpaceParams", "InvitationsManager", "InvitationsHandler", "invitation", "kind", "Invitation", "Kind", "SPACE", "SpaceInvitationProtocol", "spaceKey", "Error", "createSigningContext", "setPeerInfo", "identityKey", "toHex", "peerKey", "deviceKey", "close", "reset", "createKey", "credentialSigner", "createCredentialSignerWithChain", "credential", "CredentialGenerator", "createDeviceAuthorization", "recordCredential", "getProfile"]
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Stream } from '@dxos/codec-protobuf/stream';
|
|
2
2
|
import { type EdgeConnection } from '@dxos/edge-client';
|
|
3
|
-
import { QueryAgentStatusResponse, type QueryEdgeStatusResponse
|
|
3
|
+
import { type EdgeAgentService, QueryAgentStatusResponse, type QueryEdgeStatusResponse } from '@dxos/protocols/proto/dxos/client/services';
|
|
4
4
|
import { type EdgeAgentManager } from './edge-agent-manager';
|
|
5
5
|
export declare class EdgeAgentServiceImpl implements EdgeAgentService {
|
|
6
6
|
private readonly _agentManagerProvider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edge-agent-service.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/agents/edge-agent-service.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"edge-agent-service.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/agents/edge-agent-service.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EACL,KAAK,gBAAgB,EAErB,wBAAwB,EACxB,KAAK,uBAAuB,EAC7B,MAAM,4CAA4C,CAAC;AAEpD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAG7D,qBAAa,oBAAqB,YAAW,gBAAgB;IAEzD,OAAO,CAAC,QAAQ,CAAC,qBAAqB;IACtC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC;gBADhB,qBAAqB,EAAE,MAAM,OAAO,CAAC,gBAAgB,CAAC,EACtD,eAAe,CAAC,EAAE,cAAc,YAAA;IAInD,eAAe,IAAI,MAAM,CAAC,uBAAuB,CAAC;IAW5C,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAIlC,gBAAgB,IAAI,MAAM,CAAC,wBAAwB,CAAC;CAWrD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devices-service.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/devices/devices-service.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EACL,MAAM,
|
|
1
|
+
{"version":3,"file":"devices-service.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/devices/devices-service.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EACL,MAAM,EAEN,KAAK,cAAc,EAEnB,KAAK,oBAAoB,EAC1B,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AAEzF,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,qBAAa,kBAAmB,YAAW,cAAc;IAErD,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC;gBADhB,gBAAgB,EAAE,eAAe,EACjC,eAAe,CAAC,EAAE,cAAc,YAAA;IAG7C,YAAY,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC;IAInE,YAAY,IAAI,MAAM,CAAC,oBAAoB,CAAC;CAgF7C"}
|
|
@@ -2,7 +2,7 @@ import { Event as AsyncEvent } from '@dxos/async';
|
|
|
2
2
|
import { Stream } from '@dxos/codec-protobuf/stream';
|
|
3
3
|
import { type Config } from '@dxos/config';
|
|
4
4
|
import { type ClearSnapshotsRequest, type DevtoolsHost, // TODO(burdon): Rename DevtoolsService
|
|
5
|
-
type EnableDebugLoggingRequest, type EnableDebugLoggingResponse, type Event, type GetConfigResponse, type GetNetworkPeersRequest, type GetNetworkPeersResponse, type GetSpaceSnapshotRequest, type GetSpaceSnapshotResponse, type ResetStorageRequest, type SaveSpaceSnapshotRequest, type SaveSpaceSnapshotResponse, type SubscribeToCredentialMessagesRequest, type SubscribeToCredentialMessagesResponse, type SubscribeToFeedBlocksRequest, type SubscribeToFeedBlocksResponse, type SubscribeToFeedsRequest, type SubscribeToFeedsResponse, type SubscribeToItemsRequest, type SubscribeToItemsResponse, type SubscribeToKeyringKeysRequest, type SubscribeToKeyringKeysResponse, type
|
|
5
|
+
type EnableDebugLoggingRequest, type EnableDebugLoggingResponse, type Event, type GetBlobsResponse, type GetConfigResponse, type GetNetworkPeersRequest, type GetNetworkPeersResponse, type GetSnapshotsResponse, type GetSpaceSnapshotRequest, type GetSpaceSnapshotResponse, type ResetStorageRequest, type SaveSpaceSnapshotRequest, type SaveSpaceSnapshotResponse, type SignalResponse, type StorageInfo, type SubscribeToCredentialMessagesRequest, type SubscribeToCredentialMessagesResponse, type SubscribeToFeedBlocksRequest, type SubscribeToFeedBlocksResponse, type SubscribeToFeedsRequest, type SubscribeToFeedsResponse, type SubscribeToItemsRequest, type SubscribeToItemsResponse, type SubscribeToKeyringKeysRequest, type SubscribeToKeyringKeysResponse, type SubscribeToMetadataResponse, type SubscribeToNetworkTopicsResponse, type SubscribeToSignalStatusResponse, type SubscribeToSpacesRequest, type SubscribeToSpacesResponse, type SubscribeToSwarmInfoResponse } from '@dxos/protocols/proto/dxos/devtools/host';
|
|
6
6
|
import { type ServiceContext } from '../services';
|
|
7
7
|
export declare class DevtoolsHostEvents {
|
|
8
8
|
readonly ready: AsyncEvent<void>;
|
|
@@ -18,26 +18,26 @@ export type DevtoolsServiceParams = {
|
|
|
18
18
|
export declare class DevtoolsServiceImpl implements DevtoolsHost {
|
|
19
19
|
private readonly params;
|
|
20
20
|
constructor(params: DevtoolsServiceParams);
|
|
21
|
-
events(
|
|
22
|
-
getConfig(
|
|
21
|
+
events(_request: void): Stream<Event>;
|
|
22
|
+
getConfig(_request: void): Promise<GetConfigResponse>;
|
|
23
23
|
getStorageInfo(): Promise<StorageInfo>;
|
|
24
24
|
getBlobs(): Promise<GetBlobsResponse>;
|
|
25
25
|
getSnapshots(): Promise<GetSnapshotsResponse>;
|
|
26
|
-
resetStorage(
|
|
27
|
-
enableDebugLogging(
|
|
28
|
-
disableDebugLogging(
|
|
29
|
-
subscribeToKeyringKeys(
|
|
30
|
-
subscribeToCredentialMessages(
|
|
31
|
-
subscribeToSpaces(
|
|
32
|
-
subscribeToItems(
|
|
33
|
-
subscribeToFeeds(
|
|
34
|
-
subscribeToFeedBlocks(
|
|
35
|
-
getSpaceSnapshot(
|
|
36
|
-
saveSpaceSnapshot(
|
|
37
|
-
clearSnapshots(
|
|
38
|
-
getNetworkPeers(
|
|
39
|
-
subscribeToNetworkTopics(
|
|
40
|
-
subscribeToSignalStatus(
|
|
26
|
+
resetStorage(_request: ResetStorageRequest): Promise<void>;
|
|
27
|
+
enableDebugLogging(_request: EnableDebugLoggingRequest): Promise<EnableDebugLoggingResponse>;
|
|
28
|
+
disableDebugLogging(_request: EnableDebugLoggingRequest): Promise<EnableDebugLoggingResponse>;
|
|
29
|
+
subscribeToKeyringKeys(_request: SubscribeToKeyringKeysRequest): Stream<SubscribeToKeyringKeysResponse>;
|
|
30
|
+
subscribeToCredentialMessages(_request: SubscribeToCredentialMessagesRequest): Stream<SubscribeToCredentialMessagesResponse>;
|
|
31
|
+
subscribeToSpaces(_request: SubscribeToSpacesRequest): Stream<SubscribeToSpacesResponse>;
|
|
32
|
+
subscribeToItems(_request: SubscribeToItemsRequest): Stream<SubscribeToItemsResponse>;
|
|
33
|
+
subscribeToFeeds(_request: SubscribeToFeedsRequest): Stream<SubscribeToFeedsResponse>;
|
|
34
|
+
subscribeToFeedBlocks(_request: SubscribeToFeedBlocksRequest): Stream<SubscribeToFeedBlocksResponse>;
|
|
35
|
+
getSpaceSnapshot(_request: GetSpaceSnapshotRequest): Promise<GetSpaceSnapshotResponse>;
|
|
36
|
+
saveSpaceSnapshot(_request: SaveSpaceSnapshotRequest): Promise<SaveSpaceSnapshotResponse>;
|
|
37
|
+
clearSnapshots(_request: ClearSnapshotsRequest): Promise<void>;
|
|
38
|
+
getNetworkPeers(_request: GetNetworkPeersRequest): Promise<GetNetworkPeersResponse>;
|
|
39
|
+
subscribeToNetworkTopics(_request: void): Stream<SubscribeToNetworkTopicsResponse>;
|
|
40
|
+
subscribeToSignalStatus(_request: void): Stream<SubscribeToSignalStatusResponse>;
|
|
41
41
|
subscribeToSignal(): Stream<SignalResponse>;
|
|
42
42
|
subscribeToSwarmInfo(): Stream<SubscribeToSwarmInfoResponse>;
|
|
43
43
|
subscribeToMetadata(): Stream<SubscribeToMetadataResponse>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devtools.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/devtools/devtools.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,UAAU,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,YAAY,EAAE,uCAAuC;AAC1D,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAC/B,KAAK,KAAK,EACV,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,KAAK,oCAAoC,EACzC,KAAK,qCAAqC,EAC1C,KAAK,4BAA4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6BAA6B,CAAC;IAIpG,gBAAgB,CAAC,QAAQ,EAAE,uBAAuB,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAItF,iBAAiB,CAAC,QAAQ,EAAE,wBAAwB,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAIzF,cAAc,CAAC,QAAQ,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9D,eAAe,CAAC,QAAQ,EAAE,sBAAsB,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAInF,wBAAwB,CAAC,QAAQ,EAAE,IAAI,GAAG,MAAM,CAAC,gCAAgC,CAAC;IAIlF,uBAAuB,CAAC,QAAQ,EAAE,IAAI,GAAG,MAAM,CAAC,+BAA+B,CAAC;IAIhF,iBAAiB,IAAI,MAAM,CAAC,cAAc,CAAC;IAI3C,oBAAoB,IAAI,MAAM,CAAC,4BAA4B,CAAC;IAI5D,mBAAmB,IAAI,MAAM,CAAC,2BAA2B,CAAC;CAG3D"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Stream } from '@dxos/codec-protobuf/stream';
|
|
2
2
|
import { type SpaceManager } from '@dxos/echo-pipeline';
|
|
3
3
|
import { type FeedStore } from '@dxos/feed-store';
|
|
4
|
-
import { type
|
|
4
|
+
import { type SubscribeToFeedBlocksRequest, type SubscribeToFeedBlocksResponse, type SubscribeToFeedsRequest, type SubscribeToFeedsResponse } from '@dxos/protocols/proto/dxos/devtools/host';
|
|
5
5
|
import { type FeedMessage } from '@dxos/protocols/proto/dxos/echo/feed';
|
|
6
6
|
export declare const subscribeToFeeds: ({ feedStore, spaceManager }: {
|
|
7
7
|
feedStore: FeedStore<FeedMessage>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feeds.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/devtools/feeds.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAgB,KAAK,SAAS,EAAoB,MAAM,kBAAkB,CAAC;AAGlF,OAAO,EACL,KAAK,
|
|
1
|
+
{"version":3,"file":"feeds.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/devtools/feeds.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAgB,KAAK,SAAS,EAAoB,MAAM,kBAAkB,CAAC;AAGlF,OAAO,EACL,KAAK,4BAA4B,EACjC,KAAK,6BAA6B,EAClC,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC9B,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAQxE,eAAO,MAAM,gBAAgB,GAC3B,6BAA6B;IAAE,SAAS,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;IAAC,YAAY,EAAE,YAAY,CAAA;CAAE,EAC9F,cAAc,uBAAuB,qCAuCtC,CAAC;AAmBF,eAAO,MAAM,qBAAqB,GAChC,eAAe;IAAE,SAAS,EAAE,SAAS,CAAC,WAAW,CAAC,CAAA;CAAE,EACpD,wBAA6B,4BAA4B,0CAmD1D,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Stream } from '@dxos/codec-protobuf/stream';
|
|
2
2
|
import { type SignalManager } from '@dxos/messaging';
|
|
3
3
|
import { type SwarmNetworkManager } from '@dxos/network-manager';
|
|
4
|
-
import { type GetNetworkPeersRequest, type GetNetworkPeersResponse, type
|
|
4
|
+
import { type GetNetworkPeersRequest, type GetNetworkPeersResponse, type SignalResponse, type SubscribeToNetworkTopicsResponse, type SubscribeToSignalStatusResponse, type SubscribeToSwarmInfoResponse } from '@dxos/protocols/proto/dxos/devtools/host';
|
|
5
5
|
export declare const subscribeToNetworkStatus: ({ signalManager }: {
|
|
6
6
|
signalManager: SignalManager;
|
|
7
7
|
}) => Stream<SubscribeToSignalStatusResponse>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/devtools/network.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAGrD,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,gCAAgC,EACrC,KAAK,+BAA+B,EACpC,KAAK,
|
|
1
|
+
{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/devtools/network.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAGrD,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,cAAc,EACnB,KAAK,gCAAgC,EACrC,KAAK,+BAA+B,EACpC,KAAK,4BAA4B,EAClC,MAAM,0CAA0C,CAAC;AAElD,eAAO,MAAM,wBAAwB,GAAI,mBAAmB;IAAE,aAAa,EAAE,aAAa,CAAA;CAAE,4CAaxF,CAAC;AAEL,eAAO,MAAM,iBAAiB,GAAI,mBAAmB;IAAE,aAAa,EAAE,aAAa,CAAA;CAAE,2BA8BjF,CAAC;AAEL,eAAO,MAAM,wBAAwB,GAAI,oBAAoB;IAAE,cAAc,EAAE,mBAAmB,CAAA;CAAE,6CAiBhG,CAAC;AAEL,eAAO,MAAM,oBAAoB,GAAI,oBAAoB;IAAE,cAAc,EAAE,mBAAmB,CAAA;CAAE,yCAU5F,CAAC;AAEL,eAAO,MAAM,eAAe,GAC1B,oBAAoB;IAAE,cAAc,EAAE,mBAAmB,CAAA;CAAE,EAC3D,SAAS,sBAAsB,KAC9B,uBAYF,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type SystemService } from '@dxos/protocols/proto/dxos/client/services';
|
|
2
|
-
import { type
|
|
2
|
+
import { type CollectDiagnosticsBroadcastHandler, type CollectDiagnosticsBroadcastSender } from './diagnostics-collector';
|
|
3
3
|
export declare const createCollectDiagnosticsBroadcastSender: () => CollectDiagnosticsBroadcastSender;
|
|
4
4
|
export declare const createCollectDiagnosticsBroadcastHandler: (systemService: SystemService) => CollectDiagnosticsBroadcastHandler;
|
|
5
5
|
//# sourceMappingURL=browser-diagnostics-broadcast.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-diagnostics-broadcast.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/diagnostics/browser-diagnostics-broadcast.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAEhF,OAAO,EACL,KAAK,
|
|
1
|
+
{"version":3,"file":"browser-diagnostics-broadcast.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/diagnostics/browser-diagnostics-broadcast.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAEhF,OAAO,EACL,KAAK,kCAAkC,EACvC,KAAK,iCAAiC,EACvC,MAAM,yBAAyB,CAAC;AAgBjC,eAAO,MAAM,uCAAuC,QAAO,iCA4B1D,CAAC;AAEF,eAAO,MAAM,wCAAwC,GACnD,eAAe,aAAa,KAC3B,kCA0BF,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type SystemService } from '@dxos/protocols/proto/dxos/client/services';
|
|
2
|
-
import { type
|
|
2
|
+
import { type CollectDiagnosticsBroadcastHandler, type CollectDiagnosticsBroadcastSender } from './diagnostics-collector';
|
|
3
3
|
export declare const createCollectDiagnosticsBroadcastSender: () => CollectDiagnosticsBroadcastSender;
|
|
4
4
|
export declare const createCollectDiagnosticsBroadcastHandler: (_: SystemService) => CollectDiagnosticsBroadcastHandler;
|
|
5
5
|
//# sourceMappingURL=diagnostics-broadcast.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnostics-broadcast.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/diagnostics/diagnostics-broadcast.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAEhF,OAAO,EACL,KAAK,
|
|
1
|
+
{"version":3,"file":"diagnostics-broadcast.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/diagnostics/diagnostics-broadcast.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAEhF,OAAO,EACL,KAAK,kCAAkC,EACvC,KAAK,iCAAiC,EACvC,MAAM,yBAAyB,CAAC;AAEjC,eAAO,MAAM,uCAAuC,QAAO,iCAE1D,CAAC;AAEF,eAAO,MAAM,wCAAwC,GAAI,GAAG,aAAa,KAAG,kCAK3E,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ClientServices } from '@dxos/client-protocol';
|
|
2
2
|
import { type Config, type ConfigProto } from '@dxos/config';
|
|
3
3
|
import { type PublicKey } from '@dxos/keys';
|
|
4
|
-
import {
|
|
4
|
+
import { type Device, type Identity, type LogEntry, type Metrics, type NetworkStatus, type Platform, SpaceMember, type Space as SpaceProto } from '@dxos/protocols/proto/dxos/client/services';
|
|
5
5
|
import { type SubscribeToFeedsResponse } from '@dxos/protocols/proto/dxos/devtools/host';
|
|
6
6
|
import { type SwarmInfo } from '@dxos/protocols/proto/dxos/devtools/swarm';
|
|
7
7
|
import { type Epoch } from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/diagnostics/diagnostics.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAG7D,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/diagnostics/diagnostics.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAG7D,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EACL,KAAK,MAAM,EACX,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,OAAO,EACZ,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,WAAW,EACX,KAAK,KAAK,IAAI,UAAU,EACzB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AACzF,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,6CAA6C,CAAC;AACzE,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAI9E,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAMlD,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE;QACN,MAAM,EAAE,WAAW,CAAC;QACpB,KAAK,EAAE,eAAe,CAAC;KACxB,CAAC;IACF,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;KAAE,CAAC,EAAE,CAAC;IACxC,OAAO,CAAC,EAAE,WAAW,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE,UAAU,CAAC,aAAa,CAAC;CACrC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAC5B,gBAAgB,OAAO,CAAC,cAAc,CAAC,EACvC,gBAAgB,cAAc,EAC9B,QAAQ,MAAM,KACb,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,CA4EjC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authenticator.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/identity/authenticator.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,KAAK,EAAW,MAAM,aAAa,CAAC;AAElD,OAAO,
|
|
1
|
+
{"version":3,"file":"authenticator.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/identity/authenticator.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,KAAK,EAAW,MAAM,aAAa,CAAC;AAElD,OAAO,EAAE,KAAK,gBAAgB,EAAoB,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAG5C,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAI7C,eAAO,MAAM,kBAAkB,GAC5B,QAAQ,gBAAgB,KAAG,YAW3B,CAAC;AAEJ,MAAM,MAAM,+BAA+B,GAAG;IAE5C,mBAAmB,EAAE,MAAM,UAAU,CAAC,SAAS,CAAC,CAAC;IACjD,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IACpB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;;GAGG;AACH,qBAAa,yBAAyB;IAGxB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAFpC,OAAO,CAAC,IAAI,CAAiB;gBAEA,OAAO,EAAE,+BAA+B;IAE/D,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAI5B,IAAI,QAAQ,IAAI,YAAY,CA8C3B;IAED,OAAO,CAAC,aAAa;CAItB"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Stream } from '@dxos/codec-protobuf/stream';
|
|
2
2
|
import { type SpaceManager } from '@dxos/echo-pipeline';
|
|
3
3
|
import { type ContactBook, type ContactsService } from '@dxos/protocols/proto/dxos/client/services';
|
|
4
|
-
import { type IdentityManager } from './identity-manager';
|
|
5
4
|
import { type DataSpaceManager } from '../spaces';
|
|
5
|
+
import { type IdentityManager } from './identity-manager';
|
|
6
6
|
export declare class ContactsServiceImpl implements ContactsService {
|
|
7
7
|
private readonly _identityManager;
|
|
8
8
|
private readonly _spaceManager;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contacts-service.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/identity/contacts-service.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAErD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAgB,KAAK,WAAW,EAAE,KAAK,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAGlH,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"contacts-service.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/identity/contacts-service.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAErD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAgB,KAAK,WAAW,EAAE,KAAK,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAGlH,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAElD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,qBAAa,mBAAoB,YAAW,eAAe;IAEvD,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,yBAAyB;gBAFzB,gBAAgB,EAAE,eAAe,EACjC,aAAa,EAAE,YAAY,EAC3B,yBAAyB,EAAE,MAAM,OAAO,CAAC,gBAAgB,CAAC;IAGvE,WAAW,IAAI,OAAO,CAAC,WAAW,CAAC;IA8BzC,aAAa,IAAI,MAAM,CAAC,WAAW,CAAC;CAgCrC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type CredentialProcessor } from '@dxos/credentials';
|
|
2
|
-
import {
|
|
2
|
+
import { type PublicKey, SpaceId } from '@dxos/keys';
|
|
3
3
|
import { type Credential } from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
4
4
|
type DefaultSpaceStateMachineParams = {
|
|
5
5
|
identityKey: PublicKey;
|