@dxos/client-services 0.4.10-main.b1e8dec → 0.4.10-main.b30eb88
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-BJNDCR72.mjs → chunk-BDY63S7K.mjs} +1290 -992
- package/dist/lib/browser/chunk-BDY63S7K.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +15 -3
- package/dist/lib/browser/index.mjs.map +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/packlets/testing/index.mjs +12 -5
- package/dist/lib/browser/packlets/testing/index.mjs.map +3 -3
- package/dist/lib/node/{chunk-DLKFCGSD.cjs → chunk-3LNVXTU2.cjs} +1118 -908
- package/dist/lib/node/chunk-3LNVXTU2.cjs.map +7 -0
- package/dist/lib/node/index.cjs +50 -38
- package/dist/lib/node/index.cjs.map +1 -1
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/packlets/testing/index.cjs +16 -9
- package/dist/lib/node/packlets/testing/index.cjs.map +3 -3
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/packlets/diagnostics/browser-diagnostics-broadcast.d.ts +5 -0
- package/dist/types/src/packlets/diagnostics/browser-diagnostics-broadcast.d.ts.map +1 -0
- package/dist/types/src/packlets/diagnostics/diagnostics-broadcast.d.ts +5 -0
- package/dist/types/src/packlets/diagnostics/diagnostics-broadcast.d.ts.map +1 -0
- package/dist/types/src/packlets/diagnostics/diagnostics-collector.d.ts +15 -0
- package/dist/types/src/packlets/diagnostics/diagnostics-collector.d.ts.map +1 -0
- package/dist/types/src/packlets/{services → diagnostics}/diagnostics.d.ts +1 -1
- package/dist/types/src/packlets/diagnostics/diagnostics.d.ts.map +1 -0
- package/dist/types/src/packlets/diagnostics/index.d.ts +4 -0
- package/dist/types/src/packlets/diagnostics/index.d.ts.map +1 -0
- package/dist/types/src/packlets/indexing/util.d.ts +2 -1
- package/dist/types/src/packlets/indexing/util.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/index.d.ts +1 -0
- package/dist/types/src/packlets/invitations/index.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitation-extension.d.ts +1 -0
- package/dist/types/src/packlets/invitations/invitation-extension.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitations-handler.d.ts +4 -2
- package/dist/types/src/packlets/invitations/invitations-handler.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitations-manager.d.ts +42 -0
- package/dist/types/src/packlets/invitations/invitations-manager.d.ts.map +1 -0
- package/dist/types/src/packlets/invitations/invitations-service.d.ts +7 -23
- package/dist/types/src/packlets/invitations/invitations-service.d.ts.map +1 -1
- package/dist/types/src/packlets/services/index.d.ts +1 -1
- package/dist/types/src/packlets/services/index.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-context.d.ts +9 -5
- package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-host.d.ts +6 -1
- package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
- package/dist/types/src/packlets/services/util.d.ts +1 -0
- package/dist/types/src/packlets/services/util.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space.d.ts.map +1 -1
- package/dist/types/src/packlets/storage/index.d.ts +1 -0
- package/dist/types/src/packlets/storage/index.d.ts.map +1 -1
- package/dist/types/src/packlets/storage/level.d.ts +4 -0
- package/dist/types/src/packlets/storage/level.d.ts.map +1 -0
- package/dist/types/src/packlets/storage/storage.d.ts.map +1 -1
- package/dist/types/src/packlets/storage/util.d.ts +4 -0
- package/dist/types/src/packlets/storage/util.d.ts.map +1 -0
- package/dist/types/src/packlets/system/system-service.d.ts +1 -1
- package/dist/types/src/packlets/system/system-service.d.ts.map +1 -1
- package/dist/types/src/packlets/testing/test-builder.d.ts +4 -2
- package/dist/types/src/packlets/testing/test-builder.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/package.json +36 -34
- package/src/index.ts +1 -0
- package/src/packlets/devices/devices-service.test.ts +1 -1
- package/src/packlets/diagnostics/browser-diagnostics-broadcast.ts +94 -0
- package/src/packlets/diagnostics/diagnostics-broadcast.ts +20 -0
- package/src/packlets/diagnostics/diagnostics-collector.ts +65 -0
- package/src/packlets/{services → diagnostics}/diagnostics.ts +2 -2
- package/src/packlets/diagnostics/index.ts +7 -0
- package/src/packlets/identity/identity-service.test.ts +1 -1
- package/src/packlets/indexing/util.ts +15 -8
- package/src/packlets/invitations/device-invitation-protocol.test.ts +1 -1
- package/src/packlets/invitations/index.ts +1 -0
- package/src/packlets/invitations/invitation-extension.ts +28 -1
- package/src/packlets/invitations/invitations-handler.ts +74 -34
- package/src/packlets/invitations/invitations-manager.ts +197 -0
- package/src/packlets/invitations/invitations-service.ts +21 -168
- package/src/packlets/network/network-service.test.ts +1 -1
- package/src/packlets/services/automerge-host.test.ts +10 -4
- package/src/packlets/services/index.ts +1 -1
- package/src/packlets/services/service-context.test.ts +9 -6
- package/src/packlets/services/service-context.ts +26 -8
- package/src/packlets/services/service-host.ts +61 -29
- package/src/packlets/services/service-registry.test.ts +1 -1
- package/src/packlets/services/util.ts +2 -0
- package/src/packlets/spaces/data-space-manager.test.ts +4 -4
- package/src/packlets/spaces/data-space.ts +1 -1
- package/src/packlets/spaces/spaces-service.test.ts +1 -1
- package/src/packlets/storage/index.ts +1 -0
- package/src/packlets/storage/level.ts +19 -0
- package/src/packlets/storage/storage.ts +3 -9
- package/src/packlets/storage/util.ts +19 -0
- package/src/packlets/system/system-service.ts +1 -1
- package/src/packlets/testing/test-builder.ts +23 -5
- package/src/version.ts +1 -1
- package/dist/lib/browser/chunk-BJNDCR72.mjs.map +0 -7
- package/dist/lib/node/chunk-DLKFCGSD.cjs.map +0 -7
- package/dist/types/src/packlets/services/diagnostics.d.ts.map +0 -1
|
@@ -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};\n\nexport type Result = { invitation?: Invitation; error?: Error };\n\nexport const performInvitation = ({\n host,\n guest,\n options,\n hooks,\n guestDeviceProfile,\n}: PerformInvitationParams): [Promise<Result>, Promise<Result>] => {\n const hostComplete = new Trigger<Result>();\n const guestComplete = new Trigger<Result>();\n const authCode = new Trigger<string>();\n\n const hostObservable = createInvitation(host, options);\n hostObservable.subscribe(\n async (hostInvitation: Invitation) => {\n switch (hostInvitation.state) {\n case Invitation.State.CONNECTING: {\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 await guestObservable.authenticate(await authCode.wait());\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 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 return [hostComplete.wait(), guestComplete.wait()];\n};\n\nconst createInvitation = (\n host: ServiceContext | InvitationHost,\n options?: Partial<Invitation>,\n): CancellableInvitation => {\n options ??= {\n authMethod: Invitation.AuthMethod.NONE,\n ...(options ?? {}),\n };\n\n if (host instanceof ServiceContext) {\n const hostHandler = host.getInvitationHandler({ kind: Invitation.Kind.SPACE, ...options });\n return host.invitations.createInvitation(hostHandler, options);\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 const guestHandler = guest.getInvitationHandler({ kind: invitation.kind });\n return guest.invitations.acceptInvitation(guestHandler, invitation, guestDeviceProfile);\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 { AutomergeHost, MetadataStore, SnapshotStore, SpaceManager, valueEncoding } from '@dxos/echo-pipeline';\nimport { FeedFactory, FeedStore } from '@dxos/feed-store';\nimport { Keyring } from '@dxos/keyring';\nimport { MemorySignalManager, MemorySignalManagerContext } from '@dxos/messaging';\nimport { MemoryTransportFactory, NetworkManager } from '@dxos/network-manager';\nimport { createStorage, StorageType, type Storage } from '@dxos/random-access-storage';\nimport { BlobStore } from '@dxos/teleport-extension-object-sync';\n\nimport { ClientServicesHost, ServiceContext } from '../services';\nimport { DataSpaceManager, 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 = ({\n signalContext = new MemorySignalManagerContext(),\n storage = createStorage({ type: StorageType.RAM }),\n}: {\n signalContext?: MemorySignalManagerContext;\n storage?: Storage;\n} = {}) => {\n const signalManager = new MemorySignalManager(signalContext);\n const networkManager = new NetworkManager({\n signalManager,\n transportFactory: MemoryTransportFactory,\n });\n\n return new ServiceContext(storage, networkManager, signalManager);\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 = 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};\n\nexport type TestPeerProps = {\n storage?: Storage;\n feedStore?: FeedStore<any>;\n metadataStore?: MetadataStore;\n keyring?: Keyring;\n networkManager?: NetworkManager;\n spaceManager?: SpaceManager;\n dataSpaceManager?: DataSpaceManager;\n snapshotStore?: SnapshotStore;\n signingContext?: SigningContext;\n blobStore?: BlobStore;\n automergeHost?: AutomergeHost;\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 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 NetworkManager({\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 automergeHost() {\n return (this._props.automergeHost ??= new AutomergeHost({ directory: this.storage.createDirectory('automerge') }));\n }\n\n get 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.automergeHost,\n ));\n }\n\n async createIdentity() {\n this._props.signingContext ??= await createSigningContext(this.keyring);\n }\n\n async destroy() {\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,yBAAiC;AAEjC,kBAA0B;ACF1B,mBAAwB;AACxB,6BAA6F;AAC7F,uBAA0B;AAC1B,sBAA2B;ACF3B,qBAAwB;AACxB,IAAAA,sBAAqE;AACrE,mBAA8B;AAC9B,
|
|
6
|
-
"names": ["import_credentials", "createMockCredential", "signer", "issuer", "createCredential", "subject", "PublicKey", "Buffer", "from", "assertion", "payload", "value", "sanitizeInvitation", "invitation", "InvitationEncoder", "decode", "encode", "performInvitation", "host", "guest", "options", "hooks", "guestDeviceProfile", "hostComplete", "Trigger", "guestComplete", "authCode", "hostObservable", "createInvitation", "subscribe", "hostInvitation", "state", "Invitation", "State", "CONNECTING", "onConnecting", "guestObservable", "acceptInvitation", "guestInvitation", "invariant", "swarmKey", "equals", "CONNECTED", "onConnected", "READY_FOR_AUTHENTICATION", "onReady", "authenticate", "wait", "AUTHENTICATING", "onAuthenticating", "SUCCESS", "onSuccess", "wake", "CANCELLED", "onCancelled", "TIMEOUT", "onTimeout", "error", "onError", "authMethod", "AuthMethod", "NONE", "ServiceContext", "hostHandler", "getInvitationHandler", "kind", "Kind", "SPACE", "invitations", "share", "guestHandler", "join", "createServiceHost", "config", "signalManagerContext", "ClientServicesHost", "signalManager", "MemorySignalManager", "transportFactory", "MemoryTransportFactory", "createServiceContext", "signalContext", "MemorySignalManagerContext", "storage", "createStorage", "type", "StorageType", "RAM", "networkManager", "NetworkManager", "createPeers", "numPeers", "Promise", "all", "Array", "map", "peer", "
|
|
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};\n\nexport type Result = { invitation?: Invitation; error?: Error };\n\nexport const performInvitation = ({\n host,\n guest,\n options,\n hooks,\n guestDeviceProfile,\n}: PerformInvitationParams): [Promise<Result>, Promise<Result>] => {\n const hostComplete = new Trigger<Result>();\n const guestComplete = new Trigger<Result>();\n const authCode = new Trigger<string>();\n\n const hostObservable = createInvitation(host, options);\n hostObservable.subscribe(\n async (hostInvitation: Invitation) => {\n switch (hostInvitation.state) {\n case Invitation.State.CONNECTING: {\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 await guestObservable.authenticate(await authCode.wait());\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 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 return [hostComplete.wait(), guestComplete.wait()];\n};\n\nconst createInvitation = (\n host: ServiceContext | InvitationHost,\n options?: Partial<Invitation>,\n): CancellableInvitation => {\n options ??= {\n authMethod: Invitation.AuthMethod.NONE,\n ...(options ?? {}),\n };\n\n if (host instanceof ServiceContext) {\n const hostHandler = host.getInvitationHandler({ kind: Invitation.Kind.SPACE, ...options });\n return host.invitations.createInvitation(hostHandler, options);\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 const guestHandler = guest.getInvitationHandler({ kind: invitation.kind });\n return guest.invitations.acceptInvitation(guestHandler, invitation, guestDeviceProfile);\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 {\n AutomergeHost,\n MetadataStore,\n type LevelDB,\n SnapshotStore,\n SpaceManager,\n valueEncoding,\n} from '@dxos/echo-pipeline';\nimport { createTestLevel } from '@dxos/echo-pipeline/testing';\nimport { FeedFactory, FeedStore } from '@dxos/feed-store';\nimport { Keyring } from '@dxos/keyring';\nimport { MemorySignalManager, MemorySignalManagerContext } from '@dxos/messaging';\nimport { MemoryTransportFactory, NetworkManager } from '@dxos/network-manager';\nimport { createStorage, StorageType, type Storage } from '@dxos/random-access-storage';\nimport { BlobStore } from '@dxos/teleport-extension-object-sync';\n\nimport { ClientServicesHost, ServiceContext } from '../services';\nimport { DataSpaceManager, 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}: {\n signalContext?: MemorySignalManagerContext;\n storage?: Storage;\n} = {}) => {\n const signalManager = new MemorySignalManager(signalContext);\n const networkManager = new NetworkManager({\n signalManager,\n transportFactory: MemoryTransportFactory,\n });\n const level = createTestLevel();\n await level.open();\n\n return new ServiceContext(storage, level, networkManager, signalManager);\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};\n\nexport type TestPeerProps = {\n storage?: Storage;\n level?: LevelDB;\n feedStore?: FeedStore<any>;\n metadataStore?: MetadataStore;\n keyring?: Keyring;\n networkManager?: NetworkManager;\n spaceManager?: SpaceManager;\n dataSpaceManager?: DataSpaceManager;\n snapshotStore?: SnapshotStore;\n signingContext?: SigningContext;\n blobStore?: BlobStore;\n automergeHost?: AutomergeHost;\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 NetworkManager({\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 automergeHost() {\n return (this._props.automergeHost ??= new AutomergeHost({\n db: this.level.sublevel('automerge'),\n }));\n }\n\n get 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.automergeHost,\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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,yBAAiC;AAEjC,kBAA0B;ACF1B,mBAAwB;AACxB,6BA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AAM,IAAIC,wCAAoBpC,SAAS8B,aAAaE,SAAAA,EAAWK,0BAA0BL,SAAAA;IACvG,GACAA,SAAAA;IAEFM,kBAAkB,YAAA;IAAa;IAC/BC,YAAY,MAAMC;EACpB;AACF;",
|
|
6
|
+
"names": ["import_credentials", "createMockCredential", "signer", "issuer", "createCredential", "subject", "PublicKey", "Buffer", "from", "assertion", "payload", "value", "sanitizeInvitation", "invitation", "InvitationEncoder", "decode", "encode", "performInvitation", "host", "guest", "options", "hooks", "guestDeviceProfile", "hostComplete", "Trigger", "guestComplete", "authCode", "hostObservable", "createInvitation", "subscribe", "hostInvitation", "state", "Invitation", "State", "CONNECTING", "onConnecting", "guestObservable", "acceptInvitation", "guestInvitation", "invariant", "swarmKey", "equals", "CONNECTED", "onConnected", "READY_FOR_AUTHENTICATION", "onReady", "authenticate", "wait", "AUTHENTICATING", "onAuthenticating", "SUCCESS", "onSuccess", "wake", "CANCELLED", "onCancelled", "TIMEOUT", "onTimeout", "error", "onError", "authMethod", "AuthMethod", "NONE", "ServiceContext", "hostHandler", "getInvitationHandler", "kind", "Kind", "SPACE", "invitations", "share", "guestHandler", "join", "createServiceHost", "config", "signalManagerContext", "ClientServicesHost", "signalManager", "MemorySignalManager", "transportFactory", "MemoryTransportFactory", "createServiceContext", "signalContext", "MemorySignalManagerContext", "storage", "createStorage", "type", "StorageType", "RAM", "networkManager", "NetworkManager", "level", "createTestLevel", "open", "createPeers", "numPeers", "Promise", "all", "Array", "map", "peer", "Context", "createIdentity", "TestBuilder", "_ctx", "createPeer", "peerOptions", "TestPeer", "onDispose", "destroy", "dispose", "constructor", "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", "automergeHost", "AutomergeHost", "db", "sublevel", "dataSpaceManager", "DataSpaceManager", "createSigningContext", "close", "reset", "identityKey", "createKey", "deviceKey", "credentialSigner", "createCredentialSignerWithChain", "credential", "CredentialGenerator", "createDeviceAuthorization", "recordCredential", "getProfile", "undefined"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type SystemService } from '@dxos/protocols/proto/dxos/client/services';
|
|
2
|
+
import { type CollectDiagnosticsBroadcastSender, type CollectDiagnosticsBroadcastHandler } from './diagnostics-collector';
|
|
3
|
+
export declare const createCollectDiagnosticsBroadcastSender: () => CollectDiagnosticsBroadcastSender;
|
|
4
|
+
export declare const createCollectDiagnosticsBroadcastHandler: (systemService: SystemService) => CollectDiagnosticsBroadcastHandler;
|
|
5
|
+
//# sourceMappingURL=browser-diagnostics-broadcast.d.ts.map
|
|
@@ -0,0 +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,iCAAiC,EACtC,KAAK,kCAAkC,EACxC,MAAM,yBAAyB,CAAC;AAgBjC,eAAO,MAAM,uCAAuC,QAAO,iCA4B1D,CAAC;AAEF,eAAO,MAAM,wCAAwC,kBACpC,aAAa,KAC3B,kCA0BF,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type SystemService } from '@dxos/protocols/proto/dxos/client/services';
|
|
2
|
+
import { type CollectDiagnosticsBroadcastSender, type CollectDiagnosticsBroadcastHandler } from './diagnostics-collector';
|
|
3
|
+
export declare const createCollectDiagnosticsBroadcastSender: () => CollectDiagnosticsBroadcastSender;
|
|
4
|
+
export declare const createCollectDiagnosticsBroadcastHandler: (_: SystemService) => CollectDiagnosticsBroadcastHandler;
|
|
5
|
+
//# sourceMappingURL=diagnostics-broadcast.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnostics-broadcast.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/diagnostics/diagnostics-broadcast.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAEhF,OAAO,EACL,KAAK,iCAAiC,EACtC,KAAK,kCAAkC,EACxC,MAAM,yBAAyB,CAAC;AAEjC,eAAO,MAAM,uCAAuC,QAAO,iCAE1D,CAAC;AAEF,eAAO,MAAM,wCAAwC,MAAO,aAAa,KAAG,kCAK3E,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ClientServicesProvider } from '@dxos/client-protocol';
|
|
2
|
+
import { type Config } from '@dxos/config';
|
|
3
|
+
import { type JsonKeyOptions } from '@dxos/util';
|
|
4
|
+
export interface CollectDiagnosticsBroadcastSender {
|
|
5
|
+
broadcastDiagnosticsRequest(): any;
|
|
6
|
+
}
|
|
7
|
+
export interface CollectDiagnosticsBroadcastHandler {
|
|
8
|
+
start(): void;
|
|
9
|
+
stop(): void;
|
|
10
|
+
}
|
|
11
|
+
export declare class DiagnosticsCollector {
|
|
12
|
+
private static broadcastSender;
|
|
13
|
+
static collect(config?: Config | Config[], services?: ClientServicesProvider | null, options?: JsonKeyOptions): Promise<any>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=diagnostics-collector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnostics-collector.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/diagnostics/diagnostics-collector.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,KAAK,MAAM,EAAkB,MAAM,cAAc,CAAC;AAG3D,OAAO,EAAE,KAAK,cAAc,EAAgC,MAAM,YAAY,CAAC;AAK/E,MAAM,WAAW,iCAAiC;IAChD,2BAA2B,IAAI,GAAG,CAAC;CACpC;AAED,MAAM,WAAW,kCAAkC;IACjD,KAAK,IAAI,IAAI,CAAC;IACd,IAAI,IAAI,IAAI,CAAC;CACd;AAED,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,MAAM,CAAC,eAAe,CAA6C;WAEvD,OAAO,CACzB,MAAM,GAAE,MAAM,GAAG,MAAM,EAAkB,EACzC,QAAQ,GAAE,sBAAsB,GAAG,IAAkC,EACrE,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,GAAG,CAAC;CAwBhB"}
|
|
@@ -6,7 +6,7 @@ import { type SubscribeToFeedsResponse } from '@dxos/protocols/proto/dxos/devtoo
|
|
|
6
6
|
import { type SwarmInfo } from '@dxos/protocols/proto/dxos/devtools/swarm';
|
|
7
7
|
import { type Epoch } from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
8
8
|
import { type Resource, type Span } from '@dxos/protocols/proto/dxos/tracing';
|
|
9
|
-
import { type ServiceContext } from '
|
|
9
|
+
import { type ServiceContext } from '../services';
|
|
10
10
|
export type Diagnostics = {
|
|
11
11
|
client: {
|
|
12
12
|
config: ConfigProto;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/diagnostics/diagnostics.ts"],"names":[],"mappings":"AAIA,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,WAAW,EACX,KAAK,MAAM,EACX,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,OAAO,EACZ,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,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,QAAQ,EAAE;QACR,KAAK,EAAE,eAAe,CAAC;QACvB,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,EAAE,QAAQ,CAAC;QACnB,MAAM,CAAC,EAAE,WAAW,CAAC;QACrB,MAAM,EAAE;YACN,OAAO,EAAE,MAAM,CAAC;YAChB,OAAO,EAAE;gBACP,OAAO,E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KACb,QAAQ,WAAW,CAAC,UAAU,CAAC,CAsFjC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/diagnostics/index.ts"],"names":[],"mappings":"AAIA,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { type AutomergeHost } from '@dxos/echo-pipeline';
|
|
2
2
|
import { type ObjectSnapshot } from '@dxos/indexing';
|
|
3
|
+
import { type ObjectPointerEncoded } from '@dxos/protocols';
|
|
3
4
|
/**
|
|
4
5
|
* Factory for `loadDocuments` iterator.
|
|
5
6
|
*/
|
|
6
|
-
export declare const createSelectedDocumentsIterator: (automergeHost: AutomergeHost) => (ids:
|
|
7
|
+
export declare const createSelectedDocumentsIterator: (automergeHost: AutomergeHost) => (ids: ObjectPointerEncoded[]) => AsyncGenerator<{
|
|
7
8
|
id: string;
|
|
8
9
|
object: any;
|
|
9
10
|
currentHash: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/indexing/util.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/indexing/util.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,KAAK,oBAAoB,EAAW,MAAM,iBAAiB,CAAC;AAErE;;GAEG;AACH,eAAO,MAAM,+BAA+B,kBAAmB,aAAa,WAMvC,oBAAoB,EAAE;;;;mBAaxD,CAAC;AAEJ;;GAEG;AACH,eAAO,MAAM,uBAAuB,kBAAmB,aAAa,WAM/B,eAAe,cAAc,EAAE,EAAE,IAAI,EAAE,MAAM,CAoD/E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/invitations/index.ts"],"names":[],"mappings":"AAIA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/invitations/index.ts"],"names":[],"mappings":"AAIA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC"}
|
|
@@ -24,6 +24,7 @@ export declare class InvitationHostExtension extends RpcExtension<{
|
|
|
24
24
|
private readonly _callbacks;
|
|
25
25
|
private _remoteOptions?;
|
|
26
26
|
private _remoteOptionsTrigger;
|
|
27
|
+
private _challenge?;
|
|
27
28
|
invitation?: Invitation;
|
|
28
29
|
guestProfile?: ProfileDocument;
|
|
29
30
|
authenticationPassed: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invitation-extension.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/invitations/invitation-extension.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAqB,OAAO,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"invitation-extension.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/invitations/invitation-extension.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAqB,OAAO,EAAE,MAAM,eAAe,CAAC;AAG3D,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGvC,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QAAE,qBAAqB,EAAE,qBAAqB,CAAA;KAAE,CAAC;IA8HlF,MAAM,CAAC,OAAO,EAAE,gBAAgB;IAmBhC,OAAO;CAGvB;AAED,KAAK,iCAAiC,GAAG;IAEvC,MAAM,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/B,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CACjC,CAAC;AAEF;;GAEG;AACH,qBAAa,wBAAyB,SAAQ,YAAY,CACxD;IAAE,qBAAqB,EAAE,qBAAqB,CAAA;CAAE,EAChD;IAAE,qBAAqB,EAAE,qBAAqB,CAAA;CAAE,CACjD;IAKa,OAAO,CAAC,QAAQ,CAAC,UAAU;IAJvC,OAAO,CAAC,IAAI,CAAiB;IAC7B,OAAO,CAAC,cAAc,CAAC,CAAU;IACjC,OAAO,CAAC,qBAAqB,CAAiB;gBAEjB,UAAU,EAAE,iCAAiC;cAWjD,WAAW,IAAI,OAAO,CAAC;QAAE,qBAAqB,EAAE,qBAAqB,CAAA;KAAE,CAAC;IAqBlF,MAAM,CAAC,OAAO,EAAE,gBAAgB;IAsBhC,OAAO;CAIvB;AAED,eAAO,MAAM,wBAAwB,eAAgB,UAAU,YACT,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AuthenticatingInvitation, CancellableInvitation } from '@dxos/client-protocol';
|
|
2
|
-
import { Invitation } from '@dxos/protocols/proto/dxos/client/services';
|
|
2
|
+
import { type AdmissionKeypair, Invitation } from '@dxos/protocols/proto/dxos/client/services';
|
|
3
3
|
import { type DeviceProfileDocument } from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
4
4
|
import { type InvitationProtocol } from './invitation-protocol';
|
|
5
5
|
/**
|
|
@@ -33,6 +33,8 @@ export declare class InvitationsHandler {
|
|
|
33
33
|
private readonly _networkManager;
|
|
34
34
|
createInvitation(protocol: InvitationProtocol, options?: Partial<Invitation>): CancellableInvitation;
|
|
35
35
|
acceptInvitation(protocol: InvitationProtocol, invitation: Invitation, deviceProfile?: DeviceProfileDocument): AuthenticatingInvitation;
|
|
36
|
+
private _handleGuestOtpAuth;
|
|
37
|
+
private _handleGuestKpkAuth;
|
|
36
38
|
}
|
|
37
|
-
export declare const
|
|
39
|
+
export declare const createAdmissionKeypair: () => AdmissionKeypair;
|
|
38
40
|
//# sourceMappingURL=invitations-handler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invitations-handler.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/invitations/invitations-handler.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,wBAAwB,EAExB,qBAAqB,EAEtB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"invitations-handler.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/invitations/invitations-handler.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,wBAAwB,EAExB,qBAAqB,EAEtB,MAAM,uBAAuB,CAAC;AAc/B,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;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAAa,kBAAkB;IAIjB,OAAO,CAAC,QAAQ,CAAC,eAAe;IAE5C,gBAAgB,CAAC,QAAQ,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,qBAAqB;IAgLpG,gBAAgB,CACd,QAAQ,EAAE,kBAAkB,EAC5B,UAAU,EAAE,UAAU,EACtB,aAAa,CAAC,EAAE,qBAAqB,GACpC,wBAAwB;YAyKb,mBAAmB;YA6BnB,mBAAmB;CAsBlC;AAED,eAAO,MAAM,sBAAsB,QAAO,gBAGzC,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Event } from '@dxos/async';
|
|
2
|
+
import type { AuthenticatingInvitation, CancellableInvitation } from '@dxos/client-protocol';
|
|
3
|
+
import { type Context } from '@dxos/context';
|
|
4
|
+
import { type MetadataStore } from '@dxos/echo-pipeline';
|
|
5
|
+
import { type AcceptInvitationRequest, type Invitation, type AuthenticationRequest } from '@dxos/protocols/proto/dxos/client/services';
|
|
6
|
+
import type { InvitationProtocol } from './invitation-protocol';
|
|
7
|
+
import type { InvitationsHandler } from './invitations-handler';
|
|
8
|
+
/**
|
|
9
|
+
* Entry point for creating and accepting invitations, keeps track of existing invitation set and
|
|
10
|
+
* emits events when the set changes.
|
|
11
|
+
*/
|
|
12
|
+
export declare class InvitationsManager {
|
|
13
|
+
private readonly _invitationsHandler;
|
|
14
|
+
private readonly _getHandler;
|
|
15
|
+
private readonly _metadataStore;
|
|
16
|
+
private readonly _createInvitations;
|
|
17
|
+
private readonly _acceptInvitations;
|
|
18
|
+
readonly invitationCreated: Event<Invitation>;
|
|
19
|
+
readonly invitationAccepted: Event<Invitation>;
|
|
20
|
+
readonly removedCreated: Event<Invitation>;
|
|
21
|
+
readonly removedAccepted: Event<Invitation>;
|
|
22
|
+
readonly saved: Event<Invitation>;
|
|
23
|
+
private readonly _persistentInvitationsLoadedEvent;
|
|
24
|
+
private _persistentInvitationsLoaded;
|
|
25
|
+
constructor(_invitationsHandler: InvitationsHandler, _getHandler: (invitation: Invitation) => InvitationProtocol, _metadataStore: MetadataStore);
|
|
26
|
+
createInvitation(options: Invitation): CancellableInvitation;
|
|
27
|
+
loadPersistentInvitations(): Promise<{
|
|
28
|
+
invitations: Invitation[];
|
|
29
|
+
}>;
|
|
30
|
+
acceptInvitation(request: AcceptInvitationRequest): AuthenticatingInvitation;
|
|
31
|
+
authenticate({ invitationId, authCode }: AuthenticationRequest): Promise<void>;
|
|
32
|
+
cancelInvitation({ invitationId }: {
|
|
33
|
+
invitationId: string;
|
|
34
|
+
}): Promise<void>;
|
|
35
|
+
getCreatedInvitations(): Invitation[];
|
|
36
|
+
getAcceptedInvitations(): Invitation[];
|
|
37
|
+
onPersistentInvitationsLoaded(ctx: Context, callback: () => void): void;
|
|
38
|
+
private _safePersistInBackground;
|
|
39
|
+
private _safeDeleteInvitation;
|
|
40
|
+
private _onInvitationComplete;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=invitations-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invitations-manager.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/invitations/invitations-manager.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,KAAK,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC7F,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAwB,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAG/E,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,UAAU,EACf,KAAK,qBAAqB,EAC3B,MAAM,4CAA4C,CAAC;AAEpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEhE;;;GAGG;AACH,qBAAa,kBAAkB;IAc3B,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IACpC,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,cAAc;IAfjC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAA4C;IAC/E,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAA+C;IAElF,SAAgB,iBAAiB,oBAA2B;IAC5D,SAAgB,kBAAkB,oBAA2B;IAC7D,SAAgB,cAAc,oBAA2B;IACzD,SAAgB,eAAe,oBAA2B;IAC1D,SAAgB,KAAK,oBAA2B;IAEhD,OAAO,CAAC,QAAQ,CAAC,iCAAiC,CAAe;IACjE,OAAO,CAAC,4BAA4B,CAAS;gBAG1B,mBAAmB,EAAE,kBAAkB,EACvC,WAAW,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,kBAAkB,EAC3D,cAAc,EAAE,aAAa;IAGhD,gBAAgB,CAAC,OAAO,EAAE,UAAU,GAAG,qBAAqB;IA4BtD,yBAAyB,IAAI,OAAO,CAAC;QAAE,WAAW,EAAE,UAAU,EAAE,CAAA;KAAE,CAAC;IAyBzE,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,wBAAwB;IAoBtE,YAAY,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC;IAW9E,gBAAgB,CAAC,EAAE,YAAY,EAAE,EAAE;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAuBjF,qBAAqB,IAAI,UAAU,EAAE;IAIrC,sBAAsB,IAAI,UAAU,EAAE;IAItC,6BAA6B,CAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI;IAQhE,OAAO,CAAC,wBAAwB;YAgBlB,qBAAqB;IAQnC,OAAO,CAAC,qBAAqB;CAO9B"}
|
|
@@ -1,33 +1,17 @@
|
|
|
1
1
|
import { Stream } from '@dxos/codec-protobuf';
|
|
2
|
-
import { type
|
|
3
|
-
import { type
|
|
4
|
-
import { type InvitationProtocol } from './invitation-protocol';
|
|
5
|
-
import { type InvitationsHandler } from './invitations-handler';
|
|
2
|
+
import { type AuthenticationRequest, type AcceptInvitationRequest, type Invitation, type InvitationsService, QueryInvitationsResponse } from '@dxos/protocols/proto/dxos/client/services';
|
|
3
|
+
import { type InvitationsManager } from './invitations-manager';
|
|
6
4
|
/**
|
|
7
5
|
* Adapts invitation service observable to client/service stream.
|
|
8
6
|
*/
|
|
9
7
|
export declare class InvitationsServiceImpl implements InvitationsService {
|
|
10
|
-
private readonly
|
|
11
|
-
|
|
12
|
-
private readonly _metadataStore;
|
|
13
|
-
private readonly _createInvitations;
|
|
14
|
-
private readonly _acceptInvitations;
|
|
15
|
-
private readonly _invitationCreated;
|
|
16
|
-
private readonly _invitationAccepted;
|
|
17
|
-
private readonly _removedCreated;
|
|
18
|
-
private readonly _removedAccepted;
|
|
19
|
-
private readonly _saved;
|
|
20
|
-
private readonly _persistentInvitationsLoadedEvent;
|
|
21
|
-
private _persistentInvitationsLoaded;
|
|
22
|
-
constructor(_invitationsHandler: InvitationsHandler, _getHandler: (invitation: Invitation) => InvitationProtocol, _metadataStore: MetadataStore);
|
|
8
|
+
private readonly _invitationsManager;
|
|
9
|
+
constructor(_invitationsManager: InvitationsManager);
|
|
23
10
|
getLoggingContext(): {};
|
|
24
11
|
createInvitation(options: Invitation): Stream<Invitation>;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
acceptInvitation({ invitation: options, deviceProfile }: AcceptInvitationRequest): Stream<Invitation>;
|
|
29
|
-
authenticate({ invitationId, authCode }: AuthenticationRequest): Promise<void>;
|
|
30
|
-
cancelInvitation({ invitationId }: {
|
|
12
|
+
acceptInvitation(request: AcceptInvitationRequest): Stream<Invitation>;
|
|
13
|
+
authenticate(request: AuthenticationRequest): Promise<void>;
|
|
14
|
+
cancelInvitation(request: {
|
|
31
15
|
invitationId: string;
|
|
32
16
|
}): Promise<void>;
|
|
33
17
|
queryInvitations(): Stream<QueryInvitationsResponse>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invitations-service.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/invitations/invitations-service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"invitations-service.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/invitations/invitations-service.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,wBAAwB,EACzB,MAAM,4CAA4C,CAAC;AAEpD,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEhE;;GAEG;AACH,qBAAa,sBAAuB,YAAW,kBAAkB;IACnD,OAAO,CAAC,QAAQ,CAAC,mBAAmB;gBAAnB,mBAAmB,EAAE,kBAAkB;IAGpE,iBAAiB;IAMjB,gBAAgB,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;IAOzD,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,MAAM,CAAC,UAAU,CAAC;IAOhE,YAAY,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3D,gBAAgB,CAAC,OAAO,EAAE;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAIxE,gBAAgB,IAAI,MAAM,CAAC,wBAAwB,CAAC;CAsErD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from './client-rpc-server';
|
|
2
|
-
export * from './diagnostics';
|
|
3
2
|
export * from './service-context';
|
|
4
3
|
export * from './service-host';
|
|
5
4
|
export * from './service-registry';
|
|
5
|
+
export { ClientServicesProviderResource } from './util';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/services/index.ts"],"names":[],"mappings":"AAIA,cAAc,qBAAqB,CAAC;AACpC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/services/index.ts"],"names":[],"mappings":"AAIA,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,8BAA8B,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { type Level } from 'level';
|
|
1
2
|
import { Trigger } from '@dxos/async';
|
|
2
|
-
import { Context } from '@dxos/context';
|
|
3
|
+
import { Context, Resource } from '@dxos/context';
|
|
3
4
|
import { AutomergeHost, MetadataStore, SnapshotStore, SpaceManager } from '@dxos/echo-pipeline';
|
|
4
5
|
import { FeedStore } from '@dxos/feed-store';
|
|
5
6
|
import { IndexMetadataStore, Indexer } from '@dxos/indexing';
|
|
@@ -13,13 +14,15 @@ import { type Storage } from '@dxos/random-access-storage';
|
|
|
13
14
|
import { BlobStore } from '@dxos/teleport-extension-object-sync';
|
|
14
15
|
import { IdentityManager, type CreateIdentityOptions, type IdentityManagerRuntimeParams } from '../identity';
|
|
15
16
|
import { InvitationsHandler, type InvitationProtocol } from '../invitations';
|
|
17
|
+
import { InvitationsManager } from '../invitations/invitations-manager';
|
|
16
18
|
import { DataSpaceManager, type DataSpaceManagerRuntimeParams } from '../spaces';
|
|
17
19
|
export type ServiceContextRuntimeParams = IdentityManagerRuntimeParams & DataSpaceManagerRuntimeParams;
|
|
18
20
|
/**
|
|
19
21
|
* Shared backend for all client services.
|
|
20
22
|
*/
|
|
21
|
-
export declare class ServiceContext {
|
|
23
|
+
export declare class ServiceContext extends Resource {
|
|
22
24
|
readonly storage: Storage;
|
|
25
|
+
readonly level: Level<string, string>;
|
|
23
26
|
readonly networkManager: NetworkManager;
|
|
24
27
|
readonly signalManager: SignalManager;
|
|
25
28
|
readonly _runtimeParams?: (IdentityManagerRuntimeParams & DataSpaceManagerRuntimeParams) | undefined;
|
|
@@ -35,6 +38,7 @@ export declare class ServiceContext {
|
|
|
35
38
|
readonly spaceManager: SpaceManager;
|
|
36
39
|
readonly identityManager: IdentityManager;
|
|
37
40
|
readonly invitations: InvitationsHandler;
|
|
41
|
+
readonly invitationsManager: InvitationsManager;
|
|
38
42
|
readonly automergeHost: AutomergeHost;
|
|
39
43
|
readonly indexMetadata: IndexMetadataStore;
|
|
40
44
|
readonly indexer: Indexer;
|
|
@@ -42,9 +46,9 @@ export declare class ServiceContext {
|
|
|
42
46
|
private readonly _handlerFactories;
|
|
43
47
|
private _deviceSpaceSync?;
|
|
44
48
|
private readonly _instanceId;
|
|
45
|
-
constructor(storage: Storage, networkManager: NetworkManager, signalManager: SignalManager, _runtimeParams?: (IdentityManagerRuntimeParams & DataSpaceManagerRuntimeParams) | undefined);
|
|
46
|
-
|
|
47
|
-
|
|
49
|
+
constructor(storage: Storage, level: Level<string, string>, networkManager: NetworkManager, signalManager: SignalManager, _runtimeParams?: (IdentityManagerRuntimeParams & DataSpaceManagerRuntimeParams) | undefined);
|
|
50
|
+
protected _open(ctx: Context): Promise<void>;
|
|
51
|
+
protected _close(): Promise<void>;
|
|
48
52
|
createIdentity(params?: CreateIdentityOptions): Promise<import("../identity").Identity>;
|
|
49
53
|
getInvitationHandler(invitation: Partial<Invitation> & Pick<Invitation, 'kind'>): InvitationProtocol;
|
|
50
54
|
broadcastProfileUpdate(profile: ProfileDocument | undefined): Promise<void>;
|
|
@@ -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,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"service-context.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/services/service-context.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGlD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAiB,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aAAa,CAAC;IAC7C,SAAgB,SAAS,EAAE,SAAS,CAAC;IACrC,SAAgB,SAAS,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;IAClD,SAAgB,OAAO,EAAE,OAAO,CAAC;IACjC,SAAgB,YAAY,EAAE,YAAY,CAAC;IAC3C,SAAgB,eAAe,EAAE,eAAe,CAAC;IACjD,SAAgB,WAAW,EAAE,kBAAkB,CAAC;IAChD,SAAgB,kBAAkB,EAAE,kBAAkB,CAAC;IACvD,SAAgB,aAAa,EAAE,aAAa,CAAC;IAC7C,SAAgB,aAAa,EAAE,kBAAkB,CAAC;IAClD,SAAgB,OAAO,EAAE,OAAO,CAAC;IAG1B,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,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5B,cAAc,EAAE,cAAc,EAC9B,aAAa,EAAE,aAAa,EAC5B,cAAc,CAAC,4EAA8D;cAyEtE,KAAK,CAAC,GAAG,EAAE,OAAO;cAuBlB,MAAM;IAiBzB,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;CA+D1B"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type ClientServices } from '@dxos/client-protocol';
|
|
2
2
|
import { type Config } from '@dxos/config';
|
|
3
3
|
import { Context } from '@dxos/context';
|
|
4
|
+
import { type LevelDB } from '@dxos/echo-pipeline';
|
|
4
5
|
import { type SignalManager } from '@dxos/messaging';
|
|
5
6
|
import { type TransportFactory } from '@dxos/network-manager';
|
|
6
7
|
import { type Storage } from '@dxos/random-access-storage';
|
|
@@ -15,6 +16,7 @@ export type ClientServicesHostParams = {
|
|
|
15
16
|
signalManager?: SignalManager;
|
|
16
17
|
connectionLog?: boolean;
|
|
17
18
|
storage?: Storage;
|
|
19
|
+
level?: LevelDB;
|
|
18
20
|
lockKey?: string;
|
|
19
21
|
callbacks?: ClientServicesHostCallbacks;
|
|
20
22
|
runtimeParams?: ServiceContextRuntimeParams;
|
|
@@ -37,18 +39,21 @@ export declare class ClientServicesHost {
|
|
|
37
39
|
private readonly _systemService;
|
|
38
40
|
private readonly _loggingService;
|
|
39
41
|
private readonly _tracingService;
|
|
42
|
+
private _queryService;
|
|
40
43
|
private _config?;
|
|
41
44
|
private readonly _statusUpdate;
|
|
42
45
|
private _signalManager?;
|
|
43
46
|
private _networkManager?;
|
|
44
47
|
private _storage?;
|
|
48
|
+
private _level?;
|
|
45
49
|
private _callbacks?;
|
|
46
50
|
private _devtoolsProxy?;
|
|
47
51
|
private _serviceContext;
|
|
48
52
|
private readonly _runtimeParams?;
|
|
53
|
+
private diagnosticsBroadcastHandler;
|
|
49
54
|
private _opening;
|
|
50
55
|
private _open;
|
|
51
|
-
constructor({ config, transportFactory, signalManager, storage, lockKey, callbacks, runtimeParams, }?: ClientServicesHostParams);
|
|
56
|
+
constructor({ config, transportFactory, signalManager, storage, level, lockKey, callbacks, runtimeParams, }?: ClientServicesHostParams);
|
|
52
57
|
get isOpen(): boolean;
|
|
53
58
|
get config(): Config | undefined;
|
|
54
59
|
get context(): ServiceContext;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-host.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/services/service-host.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"service-host.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/services/service-host.ts"],"names":[],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
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/services/util.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/services/util.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,8BAA8B,eAA6C,CAAC;AAIzF,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,aAAa,wBAAyB,oBAAoB,QAMtE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-space.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/spaces/data-space.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAA+D,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"data-space.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/spaces/data-space.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAA+D,MAAM,aAAa,CAAC;AAIjG,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,KAAK,EAEV,KAAK,aAAa,EAEnB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGvC,OAAO,EAAE,UAAU,EAAE,KAAK,KAAK,IAAI,UAAU,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AACtH,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAC3E,OAAO,EAEL,KAAK,eAAe,EAGrB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,K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mBAAmB;IA8BrB,gBAAgB,CAAC,OAAO,EAAE,eAAe;IAWzC,WAAW,CAAC,OAAO,CAAC,EAAE,kBAAkB;IA0GxC,QAAQ;IAWR,UAAU;CAYjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/storage/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/storage/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"level.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/storage/level.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAI9B,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,mCAAmC,CAAC;AAIjE,eAAO,MAAM,WAAW,WAAkB,QAAQ,MAAM,QAAQ,mCAM/D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/storage/storage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/storage/storage.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAC;AAO5D,eAAO,MAAM,oBAAoB,WAAY,QAAQ,MAAM,QAAQ;;CAsBlE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/storage/util.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAC;AAG5D,eAAO,MAAM,WAAW,WAAY,QAAQ,MAAM,QAAQ,WAGzD,CAAC;AAEF,eAAO,MAAM,YAAY,WAAY,QAAQ,MAAM,QAAQ,YAK1D,CAAC"}
|