@dxos/client-services 0.6.5 → 0.6.6-main.e1a6e1f
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-GIAH3RXX.mjs → chunk-DR3GOD3O.mjs} +907 -442
- package/dist/lib/browser/chunk-DR3GOD3O.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +28 -13
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +21 -4
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/node/{chunk-NDXK2NIM.cjs → chunk-DRNEKKQP.cjs} +1065 -607
- package/dist/lib/node/chunk-DRNEKKQP.cjs.map +7 -0
- package/dist/lib/node/index.cjs +77 -62
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +27 -8
- package/dist/lib/node/testing/index.cjs.map +3 -3
- package/dist/types/src/packlets/invitations/invitations-handler.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-context.d.ts +6 -1
- package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-host.d.ts +1 -0
- package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts +29 -12
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space.d.ts +7 -0
- package/dist/types/src/packlets/spaces/data-space.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/edge-feed-replicator.d.ts +35 -0
- package/dist/types/src/packlets/spaces/edge-feed-replicator.d.ts.map +1 -0
- package/dist/types/src/packlets/spaces/index.d.ts +1 -0
- package/dist/types/src/packlets/spaces/index.d.ts.map +1 -1
- package/dist/types/src/packlets/testing/invitation-utils.d.ts +2 -0
- package/dist/types/src/packlets/testing/invitation-utils.d.ts.map +1 -1
- package/dist/types/src/packlets/testing/test-builder.d.ts +3 -1
- package/dist/types/src/packlets/testing/test-builder.d.ts.map +1 -1
- package/dist/types/src/packlets/worker/worker-runtime.d.ts +8 -3
- package/dist/types/src/packlets/worker/worker-runtime.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/dist/types/src/version.d.ts.map +1 -1
- package/package.json +38 -36
- package/src/packlets/invitations/invitations-handler.test.ts +1 -0
- package/src/packlets/invitations/invitations-handler.ts +12 -0
- package/src/packlets/invitations/space-invitation-protocol.test.ts +23 -1
- package/src/packlets/services/service-context.ts +44 -12
- package/src/packlets/services/service-host.ts +26 -4
- package/src/packlets/spaces/data-space-manager.test.ts +6 -0
- package/src/packlets/spaces/data-space-manager.ts +80 -36
- package/src/packlets/spaces/data-space.ts +36 -2
- package/src/packlets/spaces/edge-feed-replicator.ts +249 -0
- package/src/packlets/spaces/index.ts +1 -0
- package/src/packlets/testing/invitation-utils.ts +2 -2
- package/src/packlets/testing/test-builder.ts +20 -12
- package/src/packlets/worker/worker-runtime.ts +32 -10
- package/src/version.ts +1 -5
- package/dist/lib/browser/chunk-GIAH3RXX.mjs.map +0 -7
- package/dist/lib/node/chunk-NDXK2NIM.cjs.map +0 -7
|
@@ -20,7 +20,9 @@ var testing_exports = {};
|
|
|
20
20
|
__export(testing_exports, {
|
|
21
21
|
TestBuilder: () => TestBuilder,
|
|
22
22
|
TestPeer: () => TestPeer,
|
|
23
|
+
acceptInvitation: () => acceptInvitation,
|
|
23
24
|
createIdentity: () => createIdentity,
|
|
25
|
+
createInvitation: () => createInvitation,
|
|
24
26
|
createMockCredential: () => createMockCredential,
|
|
25
27
|
createPeers: () => createPeers,
|
|
26
28
|
createServiceContext: () => createServiceContext,
|
|
@@ -30,7 +32,7 @@ __export(testing_exports, {
|
|
|
30
32
|
sanitizeInvitation: () => sanitizeInvitation
|
|
31
33
|
});
|
|
32
34
|
module.exports = __toCommonJS(testing_exports);
|
|
33
|
-
var
|
|
35
|
+
var import_chunk_DRNEKKQP = require("../chunk-DRNEKKQP.cjs");
|
|
34
36
|
var import_credentials = require("@dxos/credentials");
|
|
35
37
|
var import_keys = require("@dxos/keys");
|
|
36
38
|
var import_async = require("@dxos/async");
|
|
@@ -227,7 +229,7 @@ var createInvitation = async (host, options) => {
|
|
|
227
229
|
authMethod: import_services.Invitation.AuthMethod.NONE,
|
|
228
230
|
...options ?? {}
|
|
229
231
|
};
|
|
230
|
-
if (host instanceof
|
|
232
|
+
if (host instanceof import_chunk_DRNEKKQP.ServiceContext) {
|
|
231
233
|
return host.invitationsManager.createInvitation({
|
|
232
234
|
kind: import_services.Invitation.Kind.SPACE,
|
|
233
235
|
...options
|
|
@@ -237,7 +239,7 @@ var createInvitation = async (host, options) => {
|
|
|
237
239
|
};
|
|
238
240
|
var acceptInvitation = (guest, invitation, guestDeviceProfile) => {
|
|
239
241
|
invitation = sanitizeInvitation(invitation);
|
|
240
|
-
if (guest instanceof
|
|
242
|
+
if (guest instanceof import_chunk_DRNEKKQP.ServiceContext) {
|
|
241
243
|
return guest.invitationsManager.acceptInvitation({
|
|
242
244
|
invitation,
|
|
243
245
|
deviceProfile: guestDeviceProfile
|
|
@@ -247,7 +249,7 @@ var acceptInvitation = (guest, invitation, guestDeviceProfile) => {
|
|
|
247
249
|
};
|
|
248
250
|
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/testing/test-builder.ts";
|
|
249
251
|
var createServiceHost = (config, signalManagerContext) => {
|
|
250
|
-
return new
|
|
252
|
+
return new import_chunk_DRNEKKQP.ClientServicesHost({
|
|
251
253
|
config,
|
|
252
254
|
signalManager: new import_messaging.MemorySignalManager(signalManagerContext),
|
|
253
255
|
transportFactory: import_network_manager.MemoryTransportFactory
|
|
@@ -263,7 +265,7 @@ var createServiceContext = async ({ signalContext = new import_messaging.MemoryS
|
|
|
263
265
|
});
|
|
264
266
|
const level = (0, import_testing.createTestLevel)();
|
|
265
267
|
await level.open();
|
|
266
|
-
return new
|
|
268
|
+
return new import_chunk_DRNEKKQP.ServiceContext(storage, level, networkManager, signalManager, void 0, {
|
|
267
269
|
invitationConnectionDefaultParams: {
|
|
268
270
|
controlHeartbeatInterval: 200
|
|
269
271
|
},
|
|
@@ -369,13 +371,28 @@ var TestPeer = class {
|
|
|
369
371
|
kv: this.level
|
|
370
372
|
});
|
|
371
373
|
}
|
|
374
|
+
get meshEchoReplicator() {
|
|
375
|
+
return this._props.meshEchoReplicator ??= new import_echo_pipeline.MeshEchoReplicator();
|
|
376
|
+
}
|
|
372
377
|
get dataSpaceManager() {
|
|
373
|
-
return this._props.dataSpaceManager ??= new
|
|
378
|
+
return this._props.dataSpaceManager ??= new import_chunk_DRNEKKQP.DataSpaceManager({
|
|
379
|
+
spaceManager: this.spaceManager,
|
|
380
|
+
metadataStore: this.metadataStore,
|
|
381
|
+
keyring: this.keyring,
|
|
382
|
+
signingContext: this.identity,
|
|
383
|
+
feedStore: this.feedStore,
|
|
384
|
+
echoHost: this.echoHost,
|
|
385
|
+
invitationsManager: this.invitationsManager,
|
|
386
|
+
edgeConnection: void 0,
|
|
387
|
+
meshReplicator: this.meshEchoReplicator,
|
|
388
|
+
echoEdgeReplicator: void 0,
|
|
389
|
+
runtimeParams: this._opts.dataSpaceParams
|
|
390
|
+
});
|
|
374
391
|
}
|
|
375
392
|
get invitationsManager() {
|
|
376
|
-
return this._props.invitationsManager ??= new
|
|
393
|
+
return this._props.invitationsManager ??= new import_chunk_DRNEKKQP.InvitationsManager(new import_chunk_DRNEKKQP.InvitationsHandler(this.networkManager), (invitation) => {
|
|
377
394
|
if (invitation.kind === import_services2.Invitation.Kind.SPACE) {
|
|
378
|
-
return new
|
|
395
|
+
return new import_chunk_DRNEKKQP.SpaceInvitationProtocol(this.dataSpaceManager, this.identity, this.keyring, invitation.spaceKey);
|
|
379
396
|
} else {
|
|
380
397
|
throw new Error("not implemented");
|
|
381
398
|
}
|
|
@@ -407,7 +424,9 @@ var createSigningContext = async (keyring) => {
|
|
|
407
424
|
0 && (module.exports = {
|
|
408
425
|
TestBuilder,
|
|
409
426
|
TestPeer,
|
|
427
|
+
acceptInvitation,
|
|
410
428
|
createIdentity,
|
|
429
|
+
createInvitation,
|
|
411
430
|
createMockCredential,
|
|
412
431
|
createPeers,
|
|
413
432
|
createServiceContext,
|
|
@@ -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\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 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 break;\n }\n guestConnected = true;\n if (hooks?.host?.onConnecting?.(hostObservable)) {\n break;\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 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\nconst 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\nconst 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 } from '@dxos/echo-db';\nimport { MetadataStore, SnapshotStore, 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 } 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 signalContext = new MemorySignalManagerContext(),\n storage = createStorage({ type: StorageType.RAM }),\n runtimeParams,\n}: {\n signalContext?: MemorySignalManagerContext;\n storage?: Storage;\n runtimeParams?: ServiceContextRuntimeParams;\n} = {}) => {\n const signalManager = new MemorySignalManager(signalContext);\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, {\n invitationConnectionDefaultParams: { controlHeartbeatInterval: 200 },\n ...runtimeParams,\n });\n};\n\nexport const createPeers = async (numPeers: number) => {\n const signalContext = new MemorySignalManagerContext();\n\n return await Promise.all(\n Array.from(Array(numPeers)).map(async () => {\n const peer = await createServiceContext({ signalContext });\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() {\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 snapshotStore?: SnapshotStore;\n signingContext?: SigningContext;\n blobStore?: BlobStore;\n echoHost?: EchoHost;\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 snapshotStore() {\n return (this._props.snapshotStore ??= new SnapshotStore(this.storage.createDirectory('snapshots')));\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 snapshotStore: this.snapshotStore,\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 dataSpaceManager(): DataSpaceManager {\n return (this._props.dataSpaceManager ??= new DataSpaceManager(\n this.spaceManager,\n this.metadataStore,\n this.keyring,\n this.identity,\n this.feedStore,\n this.echoHost,\n this.invitationsManager,\n 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() {\n this._props.signingContext ??= await createSigningContext(this.keyring);\n }\n\n async destroy() {\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": "
|
|
6
|
-
"names": ["import_credentials", "import_services", "createMockCredential", "signer", "issuer", "createCredential", "subject", "PublicKey", "Buffer", "from", "assertion", "payload", "value", "sanitizeInvitation", "invitation", "InvitationEncoder", "decode", "encode", "performInvitation", "host", "guest", "options", "hooks", "guestDeviceProfile", "codeInputDelay", "guestError", "guestConnected", "hostComplete", "Trigger", "guestComplete", "authCode", "createInvitation", "then", "hostObservable", "subscribe", "hostInvitation", "state", "Invitation", "State", "CONNECTING", "onConnecting", "guestObservable", "acceptInvitation", "guestInvitation", "invariant", "swarmKey", "equals", "CONNECTED", "onConnected", "READY_FOR_AUTHENTICATION", "onReady", "code", "wait", "authenticate", "setTimeout", "AUTHENTICATING", "onAuthenticating", "SUCCESS", "onSuccess", "wake", "CANCELLED", "onCancelled", "TIMEOUT", "onTimeout", "error", "onError", "authMethod", "AuthMethod", "NONE", "ServiceContext", "invitationsManager", "kind", "Kind", "SPACE", "share", "deviceProfile", "join", "createServiceHost", "config", "signalManagerContext", "ClientServicesHost", "signalManager", "MemorySignalManager", "transportFactory", "MemoryTransportFactory", "createServiceContext", "signalContext", "MemorySignalManagerContext", "storage", "createStorage", "type", "StorageType", "RAM", "runtimeParams", "networkManager", "SwarmNetworkManager", "level", "createTestLevel", "open", "invitationConnectionDefaultParams", "controlHeartbeatInterval", "createPeers", "numPeers", "Promise", "all", "Array", "map", "peer", "Context", "createIdentity", "TestBuilder", "_ctx", "createPeer", "peerOptions", "TestPeer", "onDispose", "destroy", "dispose", "constructor", "_signalContext", "_opts", "dataStore", "_props", "props", "keyring", "Keyring", "createDirectory", "feedStore", "FeedStore", "factory", "FeedFactory", "root", "hypercore", "valueEncoding", "metadataStore", "MetadataStore", "blobStore", "BlobStore", "snapshotStore", "SnapshotStore", "spaceManager", "SpaceManager", "identity", "signingContext", "failUndefined", "echoHost", "EchoHost", "kv", "dataSpaceManager", "DataSpaceManager", "dataSpaceParams", "InvitationsManager", "InvitationsHandler", "SpaceInvitationProtocol", "spaceKey", "Error", "createSigningContext", "close", "reset", "identityKey", "createKey", "deviceKey", "credentialSigner", "createCredentialSignerWithChain", "credential", "CredentialGenerator", "createDeviceAuthorization", "recordCredential", "getProfile"
|
|
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\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 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 break;\n }\n guestConnected = true;\n if (hooks?.host?.onConnecting?.(hostObservable)) {\n break;\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 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 } from '@dxos/echo-db';\nimport { MetadataStore, SnapshotStore, 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 } 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 signalContext = new MemorySignalManagerContext(),\n storage = createStorage({ type: StorageType.RAM }),\n runtimeParams,\n}: {\n signalContext?: MemorySignalManagerContext;\n storage?: Storage;\n runtimeParams?: ServiceContextRuntimeParams;\n} = {}) => {\n const signalManager = new MemorySignalManager(signalContext);\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, {\n invitationConnectionDefaultParams: { controlHeartbeatInterval: 200 },\n ...runtimeParams,\n });\n};\n\nexport const createPeers = async (numPeers: number) => {\n const signalContext = new MemorySignalManagerContext();\n\n return await Promise.all(\n Array.from(Array(numPeers)).map(async () => {\n const peer = await createServiceContext({ signalContext });\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() {\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 snapshotStore?: SnapshotStore;\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 snapshotStore() {\n return (this._props.snapshotStore ??= new SnapshotStore(this.storage.createDirectory('snapshots')));\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 snapshotStore: this.snapshotStore,\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() {\n this._props.signingContext ??= await createSigningContext(this.keyring);\n }\n\n async destroy() {\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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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CAAiB;MAC5DX,cAAc,KAAKA;MACnBN,eAAe,KAAKA;MACpBV,SAAS,KAAKA;MACdmB,gBAAgB,KAAKD;MACrBf,WAAW,KAAKA;MAChBkB,UAAU,KAAKA;MACf5E,oBAAoB,KAAKA;MACzBmF,gBAAgBtD;MAChBuD,gBAAgB,KAAKL;MACrBM,oBAAoBxD;MACpBN,eAAe,KAAK4B,MAAMmC;IAC5B,CAAA;EACF;EAEA,IAAItF,qBAAqB;AACvB,WAAQ,KAAKqD,OAAOrD,uBAAuB,IAAIuF,yCAC7C,IAAIC,yCAAmB,KAAKhE,cAAc,GAC1C,CAAChF,eAAAA;AACC,UAAIA,WAAWyD,SAASlC,iBAAAA,WAAWmC,KAAKC,OAAO;AAC7C,eAAO,IAAIsF,8CAAwB,KAAKR,kBAAkB,KAAKR,UAAW,KAAKlB,SAAS/G,WAAWkJ,QAAQ;MAC7G,OAAO;AACL,cAAM,IAAIC,MAAM,iBAAA;MAClB;IACF,GACA,KAAK1B,aAAa;EAEtB;EAEA,MAAMzB,iBAAiB;AACrB,SAAKa,OAAOqB,mBAAmB,MAAMkB,qBAAqB,KAAKrC,OAAO;EACxE;EAEA,MAAMR,UAAU;AACd,UAAM,KAAKrB,MAAMmE,MAAK;AACtB,UAAM,KAAK3E,QAAQ4E,MAAK;EAC1B;AACF;AAEO,IAAMF,uBAAuB,OAAOrC,YAAAA;AACzC,QAAMwC,cAAc,MAAMxC,QAAQyC,UAAS;AAC3C,QAAMC,YAAY,MAAM1C,QAAQyC,UAAS;AAEzC,SAAO;IACLD;IACAE;IACAC,sBAAkBC,qDAChB5C,SACA;MACE6C,YAAY,MAAM,IAAIC,wCAAoB9C,SAASwC,aAAaE,SAAAA,EAAWK,0BAA0BL,SAAAA;IACvG,GACAA,SAAAA;IAEFM,kBAAkB,YAAA;IAAa;IAC/BC,YAAY,MAAM3E;EACpB;AACF;",
|
|
6
|
+
"names": ["import_credentials", "import_services", "createMockCredential", "signer", "issuer", "createCredential", "subject", "PublicKey", "Buffer", "from", "assertion", "payload", "value", "sanitizeInvitation", "invitation", "InvitationEncoder", "decode", "encode", "performInvitation", "host", "guest", "options", "hooks", "guestDeviceProfile", "codeInputDelay", "guestError", "guestConnected", "hostComplete", "Trigger", "guestComplete", "authCode", "createInvitation", "then", "hostObservable", "subscribe", "hostInvitation", "state", "Invitation", "State", "CONNECTING", "onConnecting", "guestObservable", "acceptInvitation", "guestInvitation", "invariant", "swarmKey", "equals", "CONNECTED", "onConnected", "READY_FOR_AUTHENTICATION", "onReady", "code", "wait", "authenticate", "setTimeout", "AUTHENTICATING", "onAuthenticating", "SUCCESS", "onSuccess", "wake", "CANCELLED", "onCancelled", "TIMEOUT", "onTimeout", "error", "onError", "authMethod", "AuthMethod", "NONE", "ServiceContext", "invitationsManager", "kind", "Kind", "SPACE", "share", "deviceProfile", "join", "createServiceHost", "config", "signalManagerContext", "ClientServicesHost", "signalManager", "MemorySignalManager", "transportFactory", "MemoryTransportFactory", "createServiceContext", "signalContext", "MemorySignalManagerContext", "storage", "createStorage", "type", "StorageType", "RAM", "runtimeParams", "networkManager", "SwarmNetworkManager", "level", "createTestLevel", "open", "undefined", "invitationConnectionDefaultParams", "controlHeartbeatInterval", "createPeers", "numPeers", "Promise", "all", "Array", "map", "peer", "Context", "createIdentity", "TestBuilder", "_ctx", "createPeer", "peerOptions", "TestPeer", "onDispose", "destroy", "dispose", "constructor", "_signalContext", "_opts", "dataStore", "_props", "props", "keyring", "Keyring", "createDirectory", "feedStore", "FeedStore", "factory", "FeedFactory", "root", "hypercore", "valueEncoding", "metadataStore", "MetadataStore", "blobStore", "BlobStore", "snapshotStore", "SnapshotStore", "spaceManager", "SpaceManager", "identity", "signingContext", "failUndefined", "echoHost", "EchoHost", "kv", "meshEchoReplicator", "MeshEchoReplicator", "dataSpaceManager", "DataSpaceManager", "edgeConnection", "meshReplicator", "echoEdgeReplicator", "dataSpaceParams", "InvitationsManager", "InvitationsHandler", "SpaceInvitationProtocol", "spaceKey", "Error", "createSigningContext", "close", "reset", "identityKey", "createKey", "deviceKey", "credentialSigner", "createCredentialSignerWithChain", "credential", "CredentialGenerator", "createDeviceAuthorization", "recordCredential", "getProfile"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invitations-handler.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/invitations/invitations-handler.ts"],"names":[],"mappings":";AAIA,OAAO,EAAS,KAAK,UAAU,EAA8B,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAE/F,OAAO,EAAE,KAAK,OAAO,EAAwB,MAAM,eAAe,CAAC;AAOnE,OAAO,EAAE,KAAK,gBAAgB,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AAC/F,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AASzF,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAUhE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,qBAAa,kBAAkB;IAK3B,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAC;IAG1C,oBAAoB,CAClB,GAAG,EAAE,OAAO,EACZ,MAAM,EAAE,UAAU,CAAC,UAAU,CAAC,EAC9B,QAAQ,EAAE,kBAAkB,EAC5B,UAAU,EAAE,UAAU,GACrB,IAAI;IAwHP,gBAAgB,CACd,GAAG,EAAE,OAAO,EACZ,MAAM,EAAE,UAAU,CAAC,UAAU,CAAC,EAC9B,QAAQ,EAAE,kBAAkB,EAC5B,UAAU,EAAE,UAAU,EACtB,iBAAiB,EAAE,OAAO,CAAC,MAAM,CAAC,EAClC,aAAa,CAAC,EAAE,qBAAqB,GACpC,IAAI;
|
|
1
|
+
{"version":3,"file":"invitations-handler.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/invitations/invitations-handler.ts"],"names":[],"mappings":";AAIA,OAAO,EAAS,KAAK,UAAU,EAA8B,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAE/F,OAAO,EAAE,KAAK,OAAO,EAAwB,MAAM,eAAe,CAAC;AAOnE,OAAO,EAAE,KAAK,gBAAgB,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AAC/F,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AASzF,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAUhE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,qBAAa,kBAAkB;IAK3B,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAC;IAG1C,oBAAoB,CAClB,GAAG,EAAE,OAAO,EACZ,MAAM,EAAE,UAAU,CAAC,UAAU,CAAC,EAC9B,QAAQ,EAAE,kBAAkB,EAC5B,UAAU,EAAE,UAAU,GACrB,IAAI;IAwHP,gBAAgB,CACd,GAAG,EAAE,OAAO,EACZ,MAAM,EAAE,UAAU,CAAC,UAAU,CAAC,EAC9B,QAAQ,EAAE,kBAAkB,EAC5B,UAAU,EAAE,UAAU,EACtB,iBAAiB,EAAE,OAAO,CAAC,MAAM,CAAC,EAClC,aAAa,CAAC,EAAE,qBAAqB,GACpC,IAAI;YA2KO,UAAU;IA2BxB;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAsD3B,OAAO,CAAC,eAAe;IAgBvB,OAAO,CAAC,cAAc;YAUR,mBAAmB;YA6BnB,mBAAmB;CAsBlC;AAED,eAAO,MAAM,sBAAsB,QAAO,gBAGzC,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { Trigger } from '@dxos/async';
|
|
|
2
2
|
import { Context, Resource } from '@dxos/context';
|
|
3
3
|
import { EchoHost } from '@dxos/echo-db';
|
|
4
4
|
import { MetadataStore, SnapshotStore, SpaceManager } from '@dxos/echo-pipeline';
|
|
5
|
+
import type { EdgeConnection } from '@dxos/edge-client';
|
|
5
6
|
import { FeedStore } from '@dxos/feed-store';
|
|
6
7
|
import { Keyring } from '@dxos/keyring';
|
|
7
8
|
import { type LevelDB } from '@dxos/kv-store';
|
|
@@ -18,6 +19,7 @@ import { InvitationsHandler, InvitationsManager, type InvitationProtocol } from
|
|
|
18
19
|
import { DataSpaceManager, type DataSpaceManagerRuntimeParams } from '../spaces';
|
|
19
20
|
export type ServiceContextRuntimeParams = IdentityManagerRuntimeParams & DataSpaceManagerRuntimeParams & {
|
|
20
21
|
invitationConnectionDefaultParams?: Partial<TeleportParams>;
|
|
22
|
+
disableP2pReplication?: boolean;
|
|
21
23
|
};
|
|
22
24
|
/**
|
|
23
25
|
* Shared backend for all client services.
|
|
@@ -27,6 +29,7 @@ export declare class ServiceContext extends Resource {
|
|
|
27
29
|
readonly level: LevelDB;
|
|
28
30
|
readonly networkManager: SwarmNetworkManager;
|
|
29
31
|
readonly signalManager: SignalManager;
|
|
32
|
+
private readonly _edgeConnection;
|
|
30
33
|
readonly _runtimeParams?: ServiceContextRuntimeParams | undefined;
|
|
31
34
|
readonly initialized: Trigger<void>;
|
|
32
35
|
readonly metadataStore: MetadataStore;
|
|
@@ -42,11 +45,13 @@ export declare class ServiceContext extends Resource {
|
|
|
42
45
|
readonly invitations: InvitationsHandler;
|
|
43
46
|
readonly invitationsManager: InvitationsManager;
|
|
44
47
|
readonly echoHost: EchoHost;
|
|
48
|
+
private readonly _meshReplicator?;
|
|
49
|
+
private readonly _echoEdgeReplicator?;
|
|
45
50
|
dataSpaceManager?: DataSpaceManager;
|
|
46
51
|
private readonly _handlerFactories;
|
|
47
52
|
private _deviceSpaceSync?;
|
|
48
53
|
private readonly _instanceId;
|
|
49
|
-
constructor(storage: Storage, level: LevelDB, networkManager: SwarmNetworkManager, signalManager: SignalManager, _runtimeParams?: ServiceContextRuntimeParams | undefined);
|
|
54
|
+
constructor(storage: Storage, level: LevelDB, networkManager: SwarmNetworkManager, signalManager: SignalManager, _edgeConnection: EdgeConnection | undefined, _runtimeParams?: ServiceContextRuntimeParams | undefined);
|
|
50
55
|
protected _open(ctx: Context): Promise<void>;
|
|
51
56
|
protected _close(ctx: Context): Promise<void>;
|
|
52
57
|
createIdentity(params?: CreateIdentityOptions): Promise<import("../identity").Identity>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-context.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/services/service-context.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGlD,OAAO,
|
|
1
|
+
{"version":3,"file":"service-context.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/services/service-context.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGlD,OAAO,EAAsB,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAsB,aAAa,EAAE,aAAa,EAAE,YAAY,EAAiB,MAAM,qBAAqB,CAAC;AACpH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAe,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AACxE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,6CAA6C,CAAC;AACpG,OAAO,EAAE,KAA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,QAAQ,CAAC,eAAe,CAAC,CAAiC;IAClE,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAiC;IAG/D,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IAE3C,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAG9B;IAEJ,OAAO,CAAC,gBAAgB,CAAC,CAAsB;IAE/C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA8B;gBAGxC,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,OAAO,EACd,cAAc,EAAE,mBAAmB,EACnC,aAAa,EAAE,aAAa,EAC3B,eAAe,EAAE,cAAc,GAAG,SAAS,EAC5C,cAAc,CAAC,yCAA6B;cAsErC,KAAK,CAAC,GAAG,EAAE,OAAO;cAgClB,MAAM,CAAC,GAAG,EAAE,OAAO;IAmBtC,cAAc,CAAC,MAAM,GAAE,qBAA0B;IAMvD,oBAAoB,CAAC,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,GAAG,kBAAkB;IAM9F,sBAAsB,CAAC,OAAO,EAAE,eAAe,GAAG,SAAS;YAUnD,eAAe;YAMf,oBAAoB;YAUpB,WAAW;CAmE1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-host.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/services/service-host.ts"],"names":[],"mappings":"AAKA,OAAO,EAAuB,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACjF,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"service-host.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/services/service-host.ts"],"names":[],"mappings":"AAKA,OAAO,EAAuB,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACjF,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CA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CAAkC;IACnE,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAoB;IACnD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAqB;IACrD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAuC;IAEvE,OAAO,CAAC,OAAO,CAAC,CAAS;IACzB,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAqB;IACnD,OAAO,CAAC,cAAc,CAAC,CAAgB;IACvC,OAAO,CAAC,eAAe,CAAC,CAAsB;IAC9C,OAAO,CAAC,QAAQ,CAAC,CAAU;IAC3B,OAAO,CAAC,MAAM,CAAC,CAAU;IACzB,OAAO,CAAC,UAAU,CAAC,CAA8B;IACjD,OAAO,CAAC,cAAc,CAAC,CAAyC;IAChE,OAAO,CAAC,eAAe,CAAC,CAA6B;IAErD,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA8B;IAC7D,OAAO,CAAC,2BAA2B,CAAqC;IAGxE,OAAO,CAAC,QAAQ,CAAS;IAGzB,OAAO,CAAC,KAAK,CAAS;gBAEV,EACV,MAAM,EACN,gBAAgB,EAChB,aAAa,EACb,OAAO,EACP,KAAK,EAEL,OAAO,EACP,SAAS,EACT,aAAa,GACd,GAAE,wBAA6B;IAuDhC,IAAI,MAAM,YAET;IAED,IAAI,MAAM,uBAET;IAED,IAAI,OAAO,mBAEV;IAED,IAAI,eAAe,oCAElB;IAED,IAAI,WAAW,kFAEd;IAED,IAAI,QAAQ,4BAEX;IAED;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,EAAE,iBAAiB;IA8C9C,IAAI,CAAC,GAAG,EAAE,OAAO;IA2GjB,KAAK;IAkBL,KAAK;YAYG,eAAe;CAK9B"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Event } from '@dxos/async';
|
|
2
|
+
import { Resource } from '@dxos/context';
|
|
2
3
|
import { type CredentialSigner } from '@dxos/credentials';
|
|
3
|
-
import { type EchoHost } from '@dxos/echo-db';
|
|
4
|
-
import { type MetadataStore, type SpaceManager } from '@dxos/echo-pipeline';
|
|
4
|
+
import { type EchoEdgeReplicator, type EchoHost } from '@dxos/echo-db';
|
|
5
|
+
import { type MeshEchoReplicator, type MetadataStore, type SpaceManager } from '@dxos/echo-pipeline';
|
|
6
|
+
import type { EdgeConnection } from '@dxos/edge-client';
|
|
5
7
|
import { type FeedStore } from '@dxos/feed-store';
|
|
6
8
|
import { type Keyring } from '@dxos/keyring';
|
|
7
9
|
import { PublicKey } from '@dxos/keys';
|
|
@@ -39,11 +41,27 @@ export type AdmitMemberOptions = {
|
|
|
39
41
|
profile?: ProfileDocument;
|
|
40
42
|
delegationCredentialId?: PublicKey;
|
|
41
43
|
};
|
|
44
|
+
export type DataSpaceManagerParams = {
|
|
45
|
+
spaceManager: SpaceManager;
|
|
46
|
+
metadataStore: MetadataStore;
|
|
47
|
+
keyring: Keyring;
|
|
48
|
+
signingContext: SigningContext;
|
|
49
|
+
feedStore: FeedStore<FeedMessage>;
|
|
50
|
+
echoHost: EchoHost;
|
|
51
|
+
invitationsManager: InvitationsManager;
|
|
52
|
+
edgeConnection?: EdgeConnection;
|
|
53
|
+
meshReplicator?: MeshEchoReplicator;
|
|
54
|
+
echoEdgeReplicator?: EchoEdgeReplicator;
|
|
55
|
+
runtimeParams?: DataSpaceManagerRuntimeParams;
|
|
56
|
+
};
|
|
42
57
|
export type DataSpaceManagerRuntimeParams = {
|
|
43
58
|
spaceMemberPresenceAnnounceInterval?: number;
|
|
44
59
|
spaceMemberPresenceOfflineTimeout?: number;
|
|
45
60
|
};
|
|
46
|
-
export declare class DataSpaceManager {
|
|
61
|
+
export declare class DataSpaceManager extends Resource {
|
|
62
|
+
readonly updated: Event<void>;
|
|
63
|
+
private readonly _spaces;
|
|
64
|
+
private readonly _instanceId;
|
|
47
65
|
private readonly _spaceManager;
|
|
48
66
|
private readonly _metadataStore;
|
|
49
67
|
private readonly _keyring;
|
|
@@ -51,16 +69,14 @@ export declare class DataSpaceManager {
|
|
|
51
69
|
private readonly _feedStore;
|
|
52
70
|
private readonly _echoHost;
|
|
53
71
|
private readonly _invitationsManager;
|
|
54
|
-
private readonly
|
|
55
|
-
private readonly
|
|
56
|
-
readonly
|
|
57
|
-
private readonly
|
|
58
|
-
|
|
59
|
-
private readonly _instanceId;
|
|
60
|
-
constructor(_spaceManager: SpaceManager, _metadataStore: MetadataStore, _keyring: Keyring, _signingContext: SigningContext, _feedStore: FeedStore<FeedMessage>, _echoHost: EchoHost, _invitationsManager: InvitationsManager, _params?: DataSpaceManagerRuntimeParams | undefined);
|
|
72
|
+
private readonly _edgeConnection?;
|
|
73
|
+
private readonly _meshReplicator?;
|
|
74
|
+
private readonly _echoEdgeReplicator?;
|
|
75
|
+
private readonly _runtimeParams?;
|
|
76
|
+
constructor(params: DataSpaceManagerParams);
|
|
61
77
|
get spaces(): ComplexMap<PublicKey, DataSpace>;
|
|
62
|
-
|
|
63
|
-
|
|
78
|
+
protected _open(): Promise<void>;
|
|
79
|
+
protected _close(): Promise<void>;
|
|
64
80
|
/**
|
|
65
81
|
* Creates a new space writing the genesis credentials to the control feed.
|
|
66
82
|
*/
|
|
@@ -78,6 +94,7 @@ export declare class DataSpaceManager {
|
|
|
78
94
|
waitUntilSpaceReady(spaceKey: PublicKey): Promise<void>;
|
|
79
95
|
requestSpaceAdmissionCredential(spaceKey: PublicKey): Promise<Credential>;
|
|
80
96
|
private _constructSpace;
|
|
97
|
+
private _connectEchoMeshReplicator;
|
|
81
98
|
private _handleMemberRoleChanges;
|
|
82
99
|
private _handleNewPeerConnected;
|
|
83
100
|
private _handleInvitationStatusChange;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-space-manager.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/spaces/data-space-manager.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAA4B,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"data-space-man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QAAQ,CAAC,cAAc,CAAgB;IAC/C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAU;IACnC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAiB;IACjD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAyB;IACpD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAW;IACrC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAqB;IACzD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,CAA6B;IAC9D,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAiC;IAClE,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAiC;IACtE,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,CAA4C;gBAEhE,MAAM,EAAE,sBAAsB;IA0C1C,IAAI,MAAM,qCAET;cAGwB,KAAK;cAoBL,MAAM;IAQ/B;;OAEG;IAEG,WAAW;IAgCX,cAAc,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC;IAqBlD,kBAAkB;YA0BV,qBAAqB;IAU7B,WAAW,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,SAAS,CAAC;IAqBzD,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,UAAU,CAAC;IA6BnE;;;;OAIG;IACG,mBAAmB,CAAC,QAAQ,EAAE,SAAS;IAUhC,+BAA+B,CAAC,QAAQ,EAAE,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC;YAaxE,eAAe;YAgHf,0BAA0B;IAaxC,OAAO,CAAC,wBAAwB;IAyBhC,OAAO,CAAC,uBAAuB;YAWjB,6BAA6B;YAiB7B,2BAA2B;CAqB1C"}
|
|
@@ -2,6 +2,7 @@ import { Event } from '@dxos/async';
|
|
|
2
2
|
import type { SpecificCredential } from '@dxos/credentials';
|
|
3
3
|
import { type EchoHost, type DatabaseRoot } from '@dxos/echo-db';
|
|
4
4
|
import { type MetadataStore, type Space } from '@dxos/echo-pipeline';
|
|
5
|
+
import type { EdgeConnection } from '@dxos/edge-client';
|
|
5
6
|
import { type FeedStore } from '@dxos/feed-store';
|
|
6
7
|
import { type Keyring } from '@dxos/keyring';
|
|
7
8
|
import { PublicKey } from '@dxos/keys';
|
|
@@ -12,6 +13,7 @@ import { type Epoch, type ProfileDocument } from '@dxos/protocols/proto/dxos/hal
|
|
|
12
13
|
import { type GossipMessage } from '@dxos/protocols/proto/dxos/mesh/teleport/gossip';
|
|
13
14
|
import { type Gossip, type Presence } from '@dxos/teleport-extension-gossip';
|
|
14
15
|
import { Timeframe } from '@dxos/timeframe';
|
|
16
|
+
import { CallbackCollection, type AsyncCallback } from '@dxos/util';
|
|
15
17
|
import { AutomergeSpaceState } from './automerge-space-state';
|
|
16
18
|
import { type SigningContext } from './data-space-manager';
|
|
17
19
|
import { NotarizationPlugin } from './notarization-plugin';
|
|
@@ -42,6 +44,7 @@ export type DataSpaceParams = {
|
|
|
42
44
|
signingContext: SigningContext;
|
|
43
45
|
callbacks?: DataSpaceCallbacks;
|
|
44
46
|
cache?: SpaceCache;
|
|
47
|
+
edgeConnection?: EdgeConnection;
|
|
45
48
|
};
|
|
46
49
|
export type CreateEpochOptions = {
|
|
47
50
|
migration?: CreateEpochRequest.Migration;
|
|
@@ -60,6 +63,7 @@ export declare class DataSpace {
|
|
|
60
63
|
private readonly _callbacks;
|
|
61
64
|
private readonly _cache?;
|
|
62
65
|
private readonly _echoHost;
|
|
66
|
+
private readonly _edgeFeedReplicator?;
|
|
63
67
|
private readonly _automergeSpaceState;
|
|
64
68
|
private readonly _epochProcessingMutex;
|
|
65
69
|
private _state;
|
|
@@ -70,6 +74,8 @@ export declare class DataSpace {
|
|
|
70
74
|
error: Error | undefined;
|
|
71
75
|
readonly authVerifier: TrustedKeySetAuthVerifier;
|
|
72
76
|
readonly stateUpdate: Event<void>;
|
|
77
|
+
readonly postOpen: CallbackCollection<AsyncCallback<void>>;
|
|
78
|
+
readonly preClose: CallbackCollection<AsyncCallback<void>>;
|
|
73
79
|
metrics: SpaceProto.Metrics;
|
|
74
80
|
constructor(params: DataSpaceParams);
|
|
75
81
|
get id(): import("@dxos/keys").SpaceId;
|
|
@@ -104,6 +110,7 @@ export declare class DataSpace {
|
|
|
104
110
|
createEpoch(options?: CreateEpochOptions): Promise<CreateEpochResult | null>;
|
|
105
111
|
activate(): Promise<void>;
|
|
106
112
|
deactivate(): Promise<void>;
|
|
113
|
+
private _onFeedAdded;
|
|
107
114
|
}
|
|
108
115
|
type CreateEpochResult = {
|
|
109
116
|
credential: SpecificCredential<Epoch>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-space.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/spaces/data-space.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAwD,MAAM,aAAa,CAAC;AAG1F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAA0B,KAAK,aAAa,EAAE,KAAK,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE7F,OAAO,EAAE,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"data-space.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/spaces/data-space.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAwD,MAAM,aAAa,CAAC;AAG1F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAA0B,KAAK,aAAa,EAAE,KAAK,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE7F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,KAAK,SAAS,EAAoB,MAAM,kBAAk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1,35 @@
|
|
|
1
|
+
import { Resource } from '@dxos/context';
|
|
2
|
+
import { type EdgeConnection } from '@dxos/edge-client';
|
|
3
|
+
import { type FeedWrapper } from '@dxos/feed-store';
|
|
4
|
+
import { type SpaceId } from '@dxos/keys';
|
|
5
|
+
export type EdgeFeedReplicatorParams = {
|
|
6
|
+
messenger: EdgeConnection;
|
|
7
|
+
spaceId: SpaceId;
|
|
8
|
+
};
|
|
9
|
+
export declare class EdgeFeedReplicator extends Resource {
|
|
10
|
+
private readonly _messenger;
|
|
11
|
+
private readonly _spaceId;
|
|
12
|
+
private readonly _feeds;
|
|
13
|
+
private _connectionCtx?;
|
|
14
|
+
private _connected;
|
|
15
|
+
/**
|
|
16
|
+
* Feed length at service.
|
|
17
|
+
*/
|
|
18
|
+
private _remoteLength;
|
|
19
|
+
/**
|
|
20
|
+
* Protects against concurrent pushes so that remote length is updated consistently.
|
|
21
|
+
*/
|
|
22
|
+
private _pushMutex;
|
|
23
|
+
constructor({ messenger, spaceId }: EdgeFeedReplicatorParams);
|
|
24
|
+
protected _open(): Promise<void>;
|
|
25
|
+
protected _close(): Promise<void>;
|
|
26
|
+
addFeed(feed: FeedWrapper<any>): Promise<void>;
|
|
27
|
+
private _getPushMutex;
|
|
28
|
+
private _replicateFeed;
|
|
29
|
+
private _sendMessage;
|
|
30
|
+
private _onMessage;
|
|
31
|
+
private _pushBlocks;
|
|
32
|
+
private _integrateBlocks;
|
|
33
|
+
private _pushBlocksIfNeeded;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=edge-feed-replicator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edge-feed-replicator.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/spaces/edge-feed-replicator.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,QAAQ,EAAgB,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,EAAa,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAQrD,MAAM,MAAM,wBAAwB,GAAG;IACrC,SAAS,EAAE,cAAc,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,qBAAa,kBAAmB,SAAQ,QAAQ;IAC9C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAiB;IAC5C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAU;IACnC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA+D;IAEtF,OAAO,CAAC,cAAc,CAAC,CAAsB;IAC7C,OAAO,CAAC,UAAU,CAAS;IAC3B;;OAEG;IACH,OAAO,CAAC,aAAa,CAAqD;IAE1E;;OAEG;IACH,OAAO,CAAC,UAAU,CAAoD;gBAE1D,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,wBAAwB;cAMnC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;cA+BtB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAS1C,OAAO,CAAC,IAAI,EAAE,WAAW,CAAC,GAAG,CAAC;IASpC,OAAO,CAAC,aAAa;YAIP,cAAc;YAad,YAAY;IAkB1B,OAAO,CAAC,UAAU;YAiDJ,WAAW;YA0BX,gBAAgB;YAkBhB,mBAAmB;CAYlC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/spaces/index.ts"],"names":[],"mappings":"AAIA,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/spaces/index.ts"],"names":[],"mappings":"AAIA,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC"}
|
|
@@ -38,4 +38,6 @@ export type Result = {
|
|
|
38
38
|
error?: Error;
|
|
39
39
|
};
|
|
40
40
|
export declare const performInvitation: ({ host, guest, options, hooks, guestDeviceProfile, codeInputDelay, }: PerformInvitationParams) => [Promise<Result>, Promise<Result>];
|
|
41
|
+
export declare const createInvitation: (host: ServiceContext | InvitationHost, options?: Partial<Invitation>) => Promise<CancellableInvitation>;
|
|
42
|
+
export declare const acceptInvitation: (guest: ServiceContext | InvitationGuest, invitation: Invitation, guestDeviceProfile?: DeviceProfileDocument) => AuthenticatingInvitation;
|
|
41
43
|
//# sourceMappingURL=invitation-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invitation-utils.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/testing/invitation-utils.ts"],"names":[],"mappings":"AAKA,OAAO,EAAqB,KAAK,wBAAwB,EAAE,KAAK,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAErH,OAAO,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AACxE,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AAEzF,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C;;GAEG;AACH,eAAO,MAAM,kBAAkB,eAAgB,UAAU,KAAG,UAE3D,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,qBAAqB,CAAC;CAC7D,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,EAAE,aAAa,CAAC,EAAE,qBAAqB,GAAG,wBAAwB,CAAC;CACxG,CAAC;AAEF,MAAM,MAAM,0BAA0B,CAAC,CAAC,IAAI;IAC1C,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,GAAG,IAAI,CAAC;IAC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OAAO,GAAG,IAAI,CAAC;IACzC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,GAAG,IAAI,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,EAAE,cAAc,GAAG,cAAc,CAAC;IACtC,KAAK,EAAE,cAAc,GAAG,eAAe,CAAC;IACxC,OAAO,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IAC9B,KAAK,CAAC,EAAE;QACN,IAAI,CAAC,EAAE,0BAA0B,CAAC,qBAAqB,CAAC,CAAC;QACzD,KAAK,CAAC,EAAE,0BAA0B,CAAC,wBAAwB,CAAC,CAAC;KAC9D,CAAC;IACF,kBAAkB,CAAC,EAAE,qBAAqB,CAAC;IAC3C,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG;IAAE,UAAU,CAAC,EAAE,UAAU,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAEhE,eAAO,MAAM,iBAAiB,yEAO3B,uBAAuB,KAAG,CAAC,QAAQ,MAAM,CAAC,EAAE,QAAQ,MAAM,CAAC,CAoJ7D,CAAC;AAEF,eAAO,MAAM,gBAAgB,SACrB,cAAc,GAAG,cAAc,YAC3B,QAAQ,UAAU,CAAC,KAC5B,QAAQ,qBAAqB,CAc/B,CAAC;AAEF,eAAO,MAAM,gBAAgB,UACpB,cAAc,GAAG,eAAe,cAC3B,UAAU,uBACD,qBAAqB,KACzC,wBAWF,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Config } from '@dxos/config';
|
|
2
2
|
import { EchoHost } from '@dxos/echo-db';
|
|
3
|
-
import { MetadataStore, SnapshotStore, SpaceManager } from '@dxos/echo-pipeline';
|
|
3
|
+
import { MetadataStore, SnapshotStore, SpaceManager, MeshEchoReplicator } from '@dxos/echo-pipeline';
|
|
4
4
|
import { FeedStore } from '@dxos/feed-store';
|
|
5
5
|
import { Keyring } from '@dxos/keyring';
|
|
6
6
|
import { type LevelDB } from '@dxos/kv-store';
|
|
@@ -42,6 +42,7 @@ export type TestPeerProps = {
|
|
|
42
42
|
signingContext?: SigningContext;
|
|
43
43
|
blobStore?: BlobStore;
|
|
44
44
|
echoHost?: EchoHost;
|
|
45
|
+
meshEchoReplicator?: MeshEchoReplicator;
|
|
45
46
|
invitationsManager?: InvitationsManager;
|
|
46
47
|
};
|
|
47
48
|
export declare class TestPeer {
|
|
@@ -61,6 +62,7 @@ export declare class TestPeer {
|
|
|
61
62
|
get spaceManager(): SpaceManager;
|
|
62
63
|
get identity(): SigningContext;
|
|
63
64
|
get echoHost(): EchoHost;
|
|
65
|
+
get meshEchoReplicator(): MeshEchoReplicator;
|
|
64
66
|
get dataSpaceManager(): DataSpaceManager;
|
|
65
67
|
get invitationsManager(): InvitationsManager;
|
|
66
68
|
createIdentity(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-builder.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/testing/test-builder.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAI3C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAiB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"test-builder.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/testing/test-builder.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAI3C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAiB,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACpH,OAAO,EAAe,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,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