@dxos/client-services 0.4.9-main.80b4fd7 → 0.4.9-main.8bba6f8
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-FOFTFOBV.mjs → chunk-W2K34SLV.mjs} +53 -42
- package/dist/lib/browser/{chunk-FOFTFOBV.mjs.map → chunk-W2K34SLV.mjs.map} +3 -3
- package/dist/lib/browser/index.mjs +3 -1
- package/dist/lib/browser/index.mjs.map +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/packlets/testing/index.mjs +6 -3
- package/dist/lib/browser/packlets/testing/index.mjs.map +3 -3
- package/dist/lib/node/{chunk-WXWO4WWA.cjs → chunk-K2T4Z5GX.cjs} +54 -42
- package/dist/lib/node/{chunk-WXWO4WWA.cjs.map → chunk-K2T4Z5GX.cjs.map} +3 -3
- package/dist/lib/node/index.cjs +39 -37
- 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 +8 -6
- package/dist/lib/node/packlets/testing/index.cjs.map +3 -3
- package/dist/types/src/packlets/services/diagnostics.d.ts +1 -1
- package/dist/types/src/packlets/services/diagnostics.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-context.d.ts +3 -1
- package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-host.d.ts +5 -1
- package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
- 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 +37 -34
- package/src/packlets/identity/identity-manager.test.ts +2 -0
- package/src/packlets/identity/identity.test.ts +4 -0
- package/src/packlets/services/diagnostics.ts +3 -3
- package/src/packlets/services/service-context.ts +3 -0
- package/src/packlets/services/service-host.ts +18 -5
- package/src/packlets/testing/test-builder.ts +4 -2
- package/src/version.ts +1 -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": "
|
|
6
|
-
"names": ["createCredential", "PublicKey", "createMockCredential", "signer", "issuer", "createCredential", "subject", "PublicKey", "Buffer", "from", "assertion", "payload", "value", "Trigger", "InvitationEncoder", "invariant", "Invitation", "sanitizeInvitation", "invitation", "InvitationEncoder", "decode", "encode", "performInvitation", "host", "guest", "options", "hooks", "guestDeviceProfile", "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", "Context", "createCredentialSignerWithChain", "CredentialGenerator", "failUndefined", "AutomergeHost", "MetadataStore", "SnapshotStore", "SpaceManager", "valueEncoding", "FeedFactory", "FeedStore", "Keyring", "MemorySignalManager", "MemorySignalManagerContext", "MemoryTransportFactory", "NetworkManager", "createStorage", "StorageType", "BlobStore", "createServiceHost", "config", "signalManagerContext", "ClientServicesHost", "signalManager", "MemorySignalManager", "transportFactory", "MemoryTransportFactory", "createServiceContext", "signalContext", "MemorySignalManagerContext", "storage", "createStorage", "type", "StorageType", "RAM", "networkManager", "NetworkManager", "ServiceContext", "createPeers", "numPeers", "Promise", "all", "Array", "from", "map", "peer", "open", "Context", "createIdentity", "TestBuilder", "_ctx", "createPeer", "peerOptions", "TestPeer", "onDispose", "destroy", "dispose", "constructor", "opts", "dataStore", "_props", "props", "keyring", "Keyring", "createDirectory", "feedStore", "FeedStore", "factory", "FeedFactory", "root", "signer", "hypercore", "valueEncoding", "metadataStore", "MetadataStore", "blobStore", "BlobStore", "snapshotStore", "SnapshotStore", "spaceManager", "SpaceManager", "identity", "signingContext", "failUndefined", "automergeHost", "AutomergeHost", "directory", "dataSpaceManager", "DataSpaceManager", "createSigningContext", "reset", "identityKey", "createKey", "deviceKey", "credentialSigner", "createCredentialSignerWithChain", "credential", "CredentialGenerator", "createDeviceAuthorization", "recordCredential", "getProfile", "undefined"]
|
|
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, createDefaultModelFactory, 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 const modelFactory = createDefaultModelFactory();\n return new ServiceContext(storage, networkManager, signalManager, modelFactory);\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 modelFactory: createDefaultModelFactory(),\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,SAASA,wBAAwB;AAEjC,SAASC,iBAAiB;AAGnB,IAAMC,uBAAuB,OAAO,EACzCC,QACAC,OAAM,MAKNC,iBAAiB;EACfF;EACAC;EACAE,SAAS,IAAIC,UAAUC,OAAOC,KAAK,MAAA,CAAA;EACnCC,WAAW;IACT,SAAS;IACTC,SAAS;MACP,SAAS;MACTC,OAAOJ,OAAOC,KAAK,MAAA;IACrB;EACF;AACF,CAAA;;;ACvBF,SAASI,eAAe;AACxB,SAASC,yBAAoF;AAC7F,SAASC,iBAAiB;AAC1B,SAASC,kBAAkB;;AAQpB,IAAMC,qBAAqB,CAACC,eAAAA;AACjC,SAAOC,kBAAkBC,OAAOD,kBAAkBE,OAAOH,UAAAA,CAAAA;AAC3D;AAkCO,IAAMI,oBAAoB,CAAC,EAChCC,MACAC,OACAC,SACAC,OACAC,mBAAkB,MACM;AACxB,QAAMC,eAAe,IAAIC,QAAAA;AACzB,QAAMC,gBAAgB,IAAID,QAAAA;AAC1B,QAAME,WAAW,IAAIF,QAAAA;AAErB,QAAMG,iBAAiBC,iBAAiBV,MAAME,OAAAA;AAC9CO,iBAAeE,UACb,OAAOC,mBAAAA;AACL,YAAQA,eAAeC,OAAK;MAC1B,KAAKC,WAAWC,MAAMC,YAAY;AAChC,YAAIb,OAAOH,MAAMiB,eAAeR,cAAAA,GAAiB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ACL,KAAKX,SACL,KAAKmB,UACL,KAAKhB,WACL,KAAKmB,aAAa;EAEtB;EAEA,MAAMpC,iBAAiB;AACrB,SAAKY,OAAOsB,mBAAmB,MAAMO,qBAAqB,KAAK3B,OAAO;EACxE;EAEA,MAAMP,UAAU;AACd,UAAM,KAAK3B,QAAQ8D,MAAK;EAC1B;AACF;AAEO,IAAMD,uBAAuB,OAAO3B,YAAAA;AACzC,QAAM6B,cAAc,MAAM7B,QAAQ8B,UAAS;AAC3C,QAAMC,YAAY,MAAM/B,QAAQ8B,UAAS;AAEzC,SAAO;IACLD;IACAE;IACAC,kBAAkBC,gCAChBjC,SACA;MACEkC,YAAY,MAAM,IAAIC,oBAAoBnC,SAAS6B,aAAaE,SAAAA,EAAWK,0BAA0BL,SAAAA;IACvG,GACAA,SAAAA;IAEFM,kBAAkB,YAAA;IAAa;IAC/BC,YAAY,MAAMC;EACpB;AACF;",
|
|
6
|
+
"names": ["createCredential", "PublicKey", "createMockCredential", "signer", "issuer", "createCredential", "subject", "PublicKey", "Buffer", "from", "assertion", "payload", "value", "Trigger", "InvitationEncoder", "invariant", "Invitation", "sanitizeInvitation", "invitation", "InvitationEncoder", "decode", "encode", "performInvitation", "host", "guest", "options", "hooks", "guestDeviceProfile", "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", "Context", "createCredentialSignerWithChain", "CredentialGenerator", "failUndefined", "AutomergeHost", "MetadataStore", "SnapshotStore", "SpaceManager", "valueEncoding", "FeedFactory", "FeedStore", "Keyring", "MemorySignalManager", "MemorySignalManagerContext", "MemoryTransportFactory", "NetworkManager", "createStorage", "StorageType", "BlobStore", "createServiceHost", "config", "signalManagerContext", "ClientServicesHost", "signalManager", "MemorySignalManager", "transportFactory", "MemoryTransportFactory", "createServiceContext", "signalContext", "MemorySignalManagerContext", "storage", "createStorage", "type", "StorageType", "RAM", "networkManager", "NetworkManager", "modelFactory", "createDefaultModelFactory", "ServiceContext", "createPeers", "numPeers", "Promise", "all", "Array", "from", "map", "peer", "open", "Context", "createIdentity", "TestBuilder", "_ctx", "createPeer", "peerOptions", "TestPeer", "onDispose", "destroy", "dispose", "constructor", "opts", "dataStore", "_props", "props", "keyring", "Keyring", "createDirectory", "feedStore", "FeedStore", "factory", "FeedFactory", "root", "signer", "hypercore", "valueEncoding", "metadataStore", "MetadataStore", "blobStore", "BlobStore", "snapshotStore", "SnapshotStore", "spaceManager", "SpaceManager", "identity", "signingContext", "failUndefined", "automergeHost", "AutomergeHost", "directory", "dataSpaceManager", "DataSpaceManager", "createSigningContext", "reset", "identityKey", "createKey", "deviceKey", "credentialSigner", "createCredentialSignerWithChain", "credential", "CredentialGenerator", "createDeviceAuthorization", "recordCredential", "getProfile", "undefined"]
|
|
7
7
|
}
|
|
@@ -26,8 +26,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_K2T4Z5GX_exports = {};
|
|
30
|
+
__export(chunk_K2T4Z5GX_exports, {
|
|
31
31
|
ClientRpcServer: () => ClientRpcServer,
|
|
32
32
|
ClientServicesHost: () => ClientServicesHost,
|
|
33
33
|
DataSpace: () => DataSpace,
|
|
@@ -47,6 +47,7 @@ __export(chunk_WXWO4WWA_exports, {
|
|
|
47
47
|
SpacesServiceImpl: () => SpacesServiceImpl,
|
|
48
48
|
TrustedKeySetAuthVerifier: () => TrustedKeySetAuthVerifier,
|
|
49
49
|
createAuthProvider: () => createAuthProvider,
|
|
50
|
+
createDefaultModelFactory: () => createDefaultModelFactory,
|
|
50
51
|
createDiagnostics: () => createDiagnostics,
|
|
51
52
|
createStorageObjects: () => createStorageObjects,
|
|
52
53
|
getNetworkPeers: () => getNetworkPeers,
|
|
@@ -60,7 +61,7 @@ __export(chunk_WXWO4WWA_exports, {
|
|
|
60
61
|
subscribeToSpaces: () => subscribeToSpaces,
|
|
61
62
|
subscribeToSwarmInfo: () => subscribeToSwarmInfo
|
|
62
63
|
});
|
|
63
|
-
module.exports = __toCommonJS(
|
|
64
|
+
module.exports = __toCommonJS(chunk_K2T4Z5GX_exports);
|
|
64
65
|
var import_async = require("@dxos/async");
|
|
65
66
|
var import_codec_protobuf = require("@dxos/codec-protobuf");
|
|
66
67
|
var import_feed_store = require("@dxos/feed-store");
|
|
@@ -229,6 +230,7 @@ var import_util8 = require("@dxos/util");
|
|
|
229
230
|
var import_async16 = require("@dxos/async");
|
|
230
231
|
var import_client_protocol5 = require("@dxos/client-protocol");
|
|
231
232
|
var import_context11 = require("@dxos/context");
|
|
233
|
+
var import_document_model = require("@dxos/document-model");
|
|
232
234
|
var import_echo_pipeline3 = require("@dxos/echo-pipeline");
|
|
233
235
|
var import_echo_schema = require("@dxos/echo-schema");
|
|
234
236
|
var import_indexing2 = require("@dxos/indexing");
|
|
@@ -236,9 +238,11 @@ var import_invariant16 = require("@dxos/invariant");
|
|
|
236
238
|
var import_keys11 = require("@dxos/keys");
|
|
237
239
|
var import_log14 = require("@dxos/log");
|
|
238
240
|
var import_messaging = require("@dxos/messaging");
|
|
241
|
+
var import_model_factory = require("@dxos/model-factory");
|
|
239
242
|
var import_network_manager2 = require("@dxos/network-manager");
|
|
240
243
|
var import_protocols15 = require("@dxos/protocols");
|
|
241
244
|
var import_services13 = require("@dxos/protocols/proto/dxos/client/services");
|
|
245
|
+
var import_text_model = require("@dxos/text-model");
|
|
242
246
|
var import_tracing7 = require("@dxos/tracing");
|
|
243
247
|
var import_util9 = require("@dxos/util");
|
|
244
248
|
var import_websocket_rpc = require("@dxos/websocket-rpc");
|
|
@@ -2884,7 +2888,7 @@ var getPlatform = () => {
|
|
|
2884
2888
|
};
|
|
2885
2889
|
}
|
|
2886
2890
|
};
|
|
2887
|
-
var DXOS_VERSION = "0.4.9-main.
|
|
2891
|
+
var DXOS_VERSION = "0.4.9-main.8bba6f8";
|
|
2888
2892
|
var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/diagnostics.ts";
|
|
2889
2893
|
var DEFAULT_TIMEOUT = 1e3;
|
|
2890
2894
|
var createDiagnostics = async (clientServices, serviceContext, config) => {
|
|
@@ -4455,10 +4459,11 @@ function _ts_decorate6(decorators, target, key, desc) {
|
|
|
4455
4459
|
}
|
|
4456
4460
|
var __dxlog_file15 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-context.ts";
|
|
4457
4461
|
var ServiceContext = class {
|
|
4458
|
-
constructor(storage, networkManager, signalManager, _runtimeParams) {
|
|
4462
|
+
constructor(storage, networkManager, signalManager, modelFactory, _runtimeParams) {
|
|
4459
4463
|
this.storage = storage;
|
|
4460
4464
|
this.networkManager = networkManager;
|
|
4461
4465
|
this.signalManager = signalManager;
|
|
4466
|
+
this.modelFactory = modelFactory;
|
|
4462
4467
|
this._runtimeParams = _runtimeParams;
|
|
4463
4468
|
this.initialized = new import_async15.Trigger();
|
|
4464
4469
|
this._handlerFactories = /* @__PURE__ */ new Map();
|
|
@@ -4482,6 +4487,7 @@ var ServiceContext = class {
|
|
|
4482
4487
|
networkManager: this.networkManager,
|
|
4483
4488
|
blobStore: this.blobStore,
|
|
4484
4489
|
metadataStore: this.metadataStore,
|
|
4490
|
+
modelFactory: this.modelFactory,
|
|
4485
4491
|
snapshotStore: this.snapshotStore
|
|
4486
4492
|
});
|
|
4487
4493
|
this.identityManager = new IdentityManager(this.metadataStore, this.keyring, this.feedStore, this.spaceManager, this._runtimeParams);
|
|
@@ -4507,7 +4513,7 @@ var ServiceContext = class {
|
|
|
4507
4513
|
await this._checkStorageVersion();
|
|
4508
4514
|
(0, import_log12.log)("opening...", void 0, {
|
|
4509
4515
|
F: __dxlog_file15,
|
|
4510
|
-
L:
|
|
4516
|
+
L: 154,
|
|
4511
4517
|
S: this,
|
|
4512
4518
|
C: (f, a) => f(...a)
|
|
4513
4519
|
});
|
|
@@ -4515,7 +4521,7 @@ var ServiceContext = class {
|
|
|
4515
4521
|
id: this._instanceId
|
|
4516
4522
|
}), {
|
|
4517
4523
|
F: __dxlog_file15,
|
|
4518
|
-
L:
|
|
4524
|
+
L: 155,
|
|
4519
4525
|
S: this,
|
|
4520
4526
|
C: (f, a) => f(...a)
|
|
4521
4527
|
});
|
|
@@ -4531,13 +4537,13 @@ var ServiceContext = class {
|
|
|
4531
4537
|
id: this._instanceId
|
|
4532
4538
|
}), {
|
|
4533
4539
|
F: __dxlog_file15,
|
|
4534
|
-
L:
|
|
4540
|
+
L: 165,
|
|
4535
4541
|
S: this,
|
|
4536
4542
|
C: (f, a) => f(...a)
|
|
4537
4543
|
});
|
|
4538
4544
|
(0, import_log12.log)("opened", void 0, {
|
|
4539
4545
|
F: __dxlog_file15,
|
|
4540
|
-
L:
|
|
4546
|
+
L: 166,
|
|
4541
4547
|
S: this,
|
|
4542
4548
|
C: (f, a) => f(...a)
|
|
4543
4549
|
});
|
|
@@ -4545,7 +4551,7 @@ var ServiceContext = class {
|
|
|
4545
4551
|
async close() {
|
|
4546
4552
|
(0, import_log12.log)("closing...", void 0, {
|
|
4547
4553
|
F: __dxlog_file15,
|
|
4548
|
-
L:
|
|
4554
|
+
L: 170,
|
|
4549
4555
|
S: this,
|
|
4550
4556
|
C: (f, a) => f(...a)
|
|
4551
4557
|
});
|
|
@@ -4563,7 +4569,7 @@ var ServiceContext = class {
|
|
|
4563
4569
|
await this.indexer.destroy();
|
|
4564
4570
|
(0, import_log12.log)("closed", void 0, {
|
|
4565
4571
|
F: __dxlog_file15,
|
|
4566
|
-
L:
|
|
4572
|
+
L: 183,
|
|
4567
4573
|
S: this,
|
|
4568
4574
|
C: (f, a) => f(...a)
|
|
4569
4575
|
});
|
|
@@ -4577,7 +4583,7 @@ var ServiceContext = class {
|
|
|
4577
4583
|
const factory = this._handlerFactories.get(invitation.kind);
|
|
4578
4584
|
(0, import_invariant14.invariant)(factory, `Unknown invitation kind: ${invitation.kind}`, {
|
|
4579
4585
|
F: __dxlog_file15,
|
|
4580
|
-
L:
|
|
4586
|
+
L: 194,
|
|
4581
4587
|
S: this,
|
|
4582
4588
|
A: [
|
|
4583
4589
|
"factory",
|
|
@@ -4609,7 +4615,7 @@ var ServiceContext = class {
|
|
|
4609
4615
|
async _initialize(ctx) {
|
|
4610
4616
|
(0, import_log12.log)("initializing spaces...", void 0, {
|
|
4611
4617
|
F: __dxlog_file15,
|
|
4612
|
-
L:
|
|
4618
|
+
L: 225,
|
|
4613
4619
|
S: this,
|
|
4614
4620
|
C: (f, a) => f(...a)
|
|
4615
4621
|
});
|
|
@@ -4632,7 +4638,7 @@ var ServiceContext = class {
|
|
|
4632
4638
|
this._handlerFactories.set(import_services12.Invitation.Kind.SPACE, (invitation) => {
|
|
4633
4639
|
(0, import_invariant14.invariant)(this.dataSpaceManager, "dataSpaceManager not initialized yet", {
|
|
4634
4640
|
F: __dxlog_file15,
|
|
4635
|
-
L:
|
|
4641
|
+
L: 249,
|
|
4636
4642
|
S: this,
|
|
4637
4643
|
A: [
|
|
4638
4644
|
"this.dataSpaceManager",
|
|
@@ -4656,7 +4662,7 @@ var ServiceContext = class {
|
|
|
4656
4662
|
details: assertion
|
|
4657
4663
|
}, {
|
|
4658
4664
|
F: __dxlog_file15,
|
|
4659
|
-
L:
|
|
4665
|
+
L: 265,
|
|
4660
4666
|
S: this,
|
|
4661
4667
|
C: (f, a) => f(...a)
|
|
4662
4668
|
});
|
|
@@ -4667,7 +4673,7 @@ var ServiceContext = class {
|
|
|
4667
4673
|
details: assertion
|
|
4668
4674
|
}, {
|
|
4669
4675
|
F: __dxlog_file15,
|
|
4670
|
-
L:
|
|
4676
|
+
L: 269,
|
|
4671
4677
|
S: this,
|
|
4672
4678
|
C: (f, a) => f(...a)
|
|
4673
4679
|
});
|
|
@@ -4678,7 +4684,7 @@ var ServiceContext = class {
|
|
|
4678
4684
|
details: assertion
|
|
4679
4685
|
}, {
|
|
4680
4686
|
F: __dxlog_file15,
|
|
4681
|
-
L:
|
|
4687
|
+
L: 274,
|
|
4682
4688
|
S: this,
|
|
4683
4689
|
C: (f, a) => f(...a)
|
|
4684
4690
|
});
|
|
@@ -4689,7 +4695,7 @@ var ServiceContext = class {
|
|
|
4689
4695
|
} catch (err) {
|
|
4690
4696
|
import_log12.log.catch(err, void 0, {
|
|
4691
4697
|
F: __dxlog_file15,
|
|
4692
|
-
L:
|
|
4698
|
+
L: 280,
|
|
4693
4699
|
S: this,
|
|
4694
4700
|
C: (f, a) => f(...a)
|
|
4695
4701
|
});
|
|
@@ -5112,9 +5118,13 @@ function _ts_decorate8(decorators, target, key, desc) {
|
|
|
5112
5118
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
5113
5119
|
}
|
|
5114
5120
|
var __dxlog_file18 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-host.ts";
|
|
5121
|
+
var createDefaultModelFactory = () => {
|
|
5122
|
+
return new import_model_factory.ModelFactory().registerModel(import_document_model.DocumentModel).registerModel(import_text_model.TextModel);
|
|
5123
|
+
};
|
|
5115
5124
|
var ClientServicesHost = class {
|
|
5116
5125
|
constructor({
|
|
5117
5126
|
config,
|
|
5127
|
+
modelFactory = createDefaultModelFactory(),
|
|
5118
5128
|
transportFactory,
|
|
5119
5129
|
signalManager,
|
|
5120
5130
|
storage,
|
|
@@ -5128,6 +5138,7 @@ var ClientServicesHost = class {
|
|
|
5128
5138
|
this._opening = false;
|
|
5129
5139
|
this._open = false;
|
|
5130
5140
|
this._storage = storage;
|
|
5141
|
+
this._modelFactory = modelFactory;
|
|
5131
5142
|
this._callbacks = callbacks;
|
|
5132
5143
|
this._runtimeParams = runtimeParams;
|
|
5133
5144
|
if (config) {
|
|
@@ -5198,7 +5209,7 @@ var ClientServicesHost = class {
|
|
|
5198
5209
|
initialize({ config, ...options }) {
|
|
5199
5210
|
(0, import_invariant16.invariant)(!this._open, "service host is open", {
|
|
5200
5211
|
F: __dxlog_file18,
|
|
5201
|
-
L:
|
|
5212
|
+
L: 191,
|
|
5202
5213
|
S: this,
|
|
5203
5214
|
A: [
|
|
5204
5215
|
"!this._open",
|
|
@@ -5207,14 +5218,14 @@ var ClientServicesHost = class {
|
|
|
5207
5218
|
});
|
|
5208
5219
|
(0, import_log14.log)("initializing...", void 0, {
|
|
5209
5220
|
F: __dxlog_file18,
|
|
5210
|
-
L:
|
|
5221
|
+
L: 192,
|
|
5211
5222
|
S: this,
|
|
5212
5223
|
C: (f, a) => f(...a)
|
|
5213
5224
|
});
|
|
5214
5225
|
if (config) {
|
|
5215
5226
|
(0, import_invariant16.invariant)(!this._config, "config already set", {
|
|
5216
5227
|
F: __dxlog_file18,
|
|
5217
|
-
L:
|
|
5228
|
+
L: 195,
|
|
5218
5229
|
S: this,
|
|
5219
5230
|
A: [
|
|
5220
5231
|
"!this._config",
|
|
@@ -5232,7 +5243,7 @@ var ClientServicesHost = class {
|
|
|
5232
5243
|
this._signalManager = signalManager;
|
|
5233
5244
|
(0, import_invariant16.invariant)(!this._networkManager, "network manager already set", {
|
|
5234
5245
|
F: __dxlog_file18,
|
|
5235
|
-
L:
|
|
5246
|
+
L: 211,
|
|
5236
5247
|
S: this,
|
|
5237
5248
|
A: [
|
|
5238
5249
|
"!this._networkManager",
|
|
@@ -5246,7 +5257,7 @@ var ClientServicesHost = class {
|
|
|
5246
5257
|
});
|
|
5247
5258
|
(0, import_log14.log)("initialized", void 0, {
|
|
5248
5259
|
F: __dxlog_file18,
|
|
5249
|
-
L:
|
|
5260
|
+
L: 218,
|
|
5250
5261
|
S: this,
|
|
5251
5262
|
C: (f, a) => f(...a)
|
|
5252
5263
|
});
|
|
@@ -5260,13 +5271,13 @@ var ClientServicesHost = class {
|
|
|
5260
5271
|
id: traceId
|
|
5261
5272
|
}), {
|
|
5262
5273
|
F: __dxlog_file18,
|
|
5263
|
-
L:
|
|
5274
|
+
L: 229,
|
|
5264
5275
|
S: this,
|
|
5265
5276
|
C: (f, a) => f(...a)
|
|
5266
5277
|
});
|
|
5267
5278
|
(0, import_invariant16.invariant)(this._config, "config not set", {
|
|
5268
5279
|
F: __dxlog_file18,
|
|
5269
|
-
L:
|
|
5280
|
+
L: 231,
|
|
5270
5281
|
S: this,
|
|
5271
5282
|
A: [
|
|
5272
5283
|
"this._config",
|
|
@@ -5275,7 +5286,7 @@ var ClientServicesHost = class {
|
|
|
5275
5286
|
});
|
|
5276
5287
|
(0, import_invariant16.invariant)(this._storage, "storage not set", {
|
|
5277
5288
|
F: __dxlog_file18,
|
|
5278
|
-
L:
|
|
5289
|
+
L: 232,
|
|
5279
5290
|
S: this,
|
|
5280
5291
|
A: [
|
|
5281
5292
|
"this._storage",
|
|
@@ -5284,7 +5295,7 @@ var ClientServicesHost = class {
|
|
|
5284
5295
|
});
|
|
5285
5296
|
(0, import_invariant16.invariant)(this._signalManager, "signal manager not set", {
|
|
5286
5297
|
F: __dxlog_file18,
|
|
5287
|
-
L:
|
|
5298
|
+
L: 233,
|
|
5288
5299
|
S: this,
|
|
5289
5300
|
A: [
|
|
5290
5301
|
"this._signalManager",
|
|
@@ -5293,7 +5304,7 @@ var ClientServicesHost = class {
|
|
|
5293
5304
|
});
|
|
5294
5305
|
(0, import_invariant16.invariant)(this._networkManager, "network manager not set", {
|
|
5295
5306
|
F: __dxlog_file18,
|
|
5296
|
-
L:
|
|
5307
|
+
L: 234,
|
|
5297
5308
|
S: this,
|
|
5298
5309
|
A: [
|
|
5299
5310
|
"this._networkManager",
|
|
@@ -5305,13 +5316,13 @@ var ClientServicesHost = class {
|
|
|
5305
5316
|
lockKey: this._resourceLock?.lockKey
|
|
5306
5317
|
}, {
|
|
5307
5318
|
F: __dxlog_file18,
|
|
5308
|
-
L:
|
|
5319
|
+
L: 237,
|
|
5309
5320
|
S: this,
|
|
5310
5321
|
C: (f, a) => f(...a)
|
|
5311
5322
|
});
|
|
5312
5323
|
await this._resourceLock?.acquire();
|
|
5313
5324
|
await this._loggingService.open();
|
|
5314
|
-
this._serviceContext = new ServiceContext(this._storage, this._networkManager, this._signalManager, this._runtimeParams);
|
|
5325
|
+
this._serviceContext = new ServiceContext(this._storage, this._networkManager, this._signalManager, this._modelFactory, this._runtimeParams);
|
|
5315
5326
|
this._serviceRegistry.setServices({
|
|
5316
5327
|
SystemService: this._systemService,
|
|
5317
5328
|
IdentityService: new IdentityServiceImpl((params) => this._createIdentity(params), this._serviceContext.identityManager, this._serviceContext.keyring, (profile) => this._serviceContext.broadcastProfileUpdate(profile)),
|
|
@@ -5339,7 +5350,7 @@ var ClientServicesHost = class {
|
|
|
5339
5350
|
await this._serviceContext.open(ctx);
|
|
5340
5351
|
(0, import_invariant16.invariant)(this.serviceRegistry.services.InvitationsService, void 0, {
|
|
5341
5352
|
F: __dxlog_file18,
|
|
5342
|
-
L:
|
|
5353
|
+
L: 299,
|
|
5343
5354
|
S: this,
|
|
5344
5355
|
A: [
|
|
5345
5356
|
"this.serviceRegistry.services.InvitationsService",
|
|
@@ -5351,7 +5362,7 @@ var ClientServicesHost = class {
|
|
|
5351
5362
|
count: loadedInvitations.invitations?.length
|
|
5352
5363
|
}, {
|
|
5353
5364
|
F: __dxlog_file18,
|
|
5354
|
-
L:
|
|
5365
|
+
L: 302,
|
|
5355
5366
|
S: this,
|
|
5356
5367
|
C: (f, a) => f(...a)
|
|
5357
5368
|
});
|
|
@@ -5373,7 +5384,7 @@ var ClientServicesHost = class {
|
|
|
5373
5384
|
deviceKey
|
|
5374
5385
|
}, {
|
|
5375
5386
|
F: __dxlog_file18,
|
|
5376
|
-
L:
|
|
5387
|
+
L: 319,
|
|
5377
5388
|
S: this,
|
|
5378
5389
|
C: (f, a) => f(...a)
|
|
5379
5390
|
});
|
|
@@ -5381,7 +5392,7 @@ var ClientServicesHost = class {
|
|
|
5381
5392
|
id: traceId
|
|
5382
5393
|
}), {
|
|
5383
5394
|
F: __dxlog_file18,
|
|
5384
|
-
L:
|
|
5395
|
+
L: 320,
|
|
5385
5396
|
S: this,
|
|
5386
5397
|
C: (f, a) => f(...a)
|
|
5387
5398
|
});
|
|
@@ -5395,7 +5406,7 @@ var ClientServicesHost = class {
|
|
|
5395
5406
|
deviceKey
|
|
5396
5407
|
}, {
|
|
5397
5408
|
F: __dxlog_file18,
|
|
5398
|
-
L:
|
|
5409
|
+
L: 331,
|
|
5399
5410
|
S: this,
|
|
5400
5411
|
C: (f, a) => f(...a)
|
|
5401
5412
|
});
|
|
@@ -5411,7 +5422,7 @@ var ClientServicesHost = class {
|
|
|
5411
5422
|
deviceKey
|
|
5412
5423
|
}, {
|
|
5413
5424
|
F: __dxlog_file18,
|
|
5414
|
-
L:
|
|
5425
|
+
L: 338,
|
|
5415
5426
|
S: this,
|
|
5416
5427
|
C: (f, a) => f(...a)
|
|
5417
5428
|
});
|
|
@@ -5422,13 +5433,13 @@ var ClientServicesHost = class {
|
|
|
5422
5433
|
id: traceId
|
|
5423
5434
|
}), {
|
|
5424
5435
|
F: __dxlog_file18,
|
|
5425
|
-
L:
|
|
5436
|
+
L: 343,
|
|
5426
5437
|
S: this,
|
|
5427
5438
|
C: (f, a) => f(...a)
|
|
5428
5439
|
});
|
|
5429
5440
|
(0, import_log14.log)("resetting...", void 0, {
|
|
5430
5441
|
F: __dxlog_file18,
|
|
5431
|
-
L:
|
|
5442
|
+
L: 345,
|
|
5432
5443
|
S: this,
|
|
5433
5444
|
C: (f, a) => f(...a)
|
|
5434
5445
|
});
|
|
@@ -5436,7 +5447,7 @@ var ClientServicesHost = class {
|
|
|
5436
5447
|
await this._storage.reset();
|
|
5437
5448
|
(0, import_log14.log)("reset", void 0, {
|
|
5438
5449
|
F: __dxlog_file18,
|
|
5439
|
-
L:
|
|
5450
|
+
L: 348,
|
|
5440
5451
|
S: this,
|
|
5441
5452
|
C: (f, a) => f(...a)
|
|
5442
5453
|
});
|
|
@@ -5444,7 +5455,7 @@ var ClientServicesHost = class {
|
|
|
5444
5455
|
id: traceId
|
|
5445
5456
|
}), {
|
|
5446
5457
|
F: __dxlog_file18,
|
|
5447
|
-
L:
|
|
5458
|
+
L: 349,
|
|
5448
5459
|
S: this,
|
|
5449
5460
|
C: (f, a) => f(...a)
|
|
5450
5461
|
});
|
|
@@ -5459,7 +5470,7 @@ var ClientServicesHost = class {
|
|
|
5459
5470
|
const automergeIndex = space.automergeSpaceState.rootUrl;
|
|
5460
5471
|
(0, import_invariant16.invariant)(automergeIndex, void 0, {
|
|
5461
5472
|
F: __dxlog_file18,
|
|
5462
|
-
L:
|
|
5473
|
+
L: 364,
|
|
5463
5474
|
S: this,
|
|
5464
5475
|
A: [
|
|
5465
5476
|
"automergeIndex",
|
|
@@ -5515,6 +5526,7 @@ ClientServicesHost = _ts_decorate8([
|
|
|
5515
5526
|
SpacesServiceImpl,
|
|
5516
5527
|
TrustedKeySetAuthVerifier,
|
|
5517
5528
|
createAuthProvider,
|
|
5529
|
+
createDefaultModelFactory,
|
|
5518
5530
|
createDiagnostics,
|
|
5519
5531
|
createStorageObjects,
|
|
5520
5532
|
getNetworkPeers,
|
|
@@ -5528,4 +5540,4 @@ ClientServicesHost = _ts_decorate8([
|
|
|
5528
5540
|
subscribeToSpaces,
|
|
5529
5541
|
subscribeToSwarmInfo
|
|
5530
5542
|
});
|
|
5531
|
-
//# sourceMappingURL=chunk-
|
|
5543
|
+
//# sourceMappingURL=chunk-K2T4Z5GX.cjs.map
|