@dxos/client-services 0.5.1-main.f81ddc4 → 0.5.1-next.260c093
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-OE6XNPWD.mjs → chunk-55TEJXLO.mjs} +908 -1264
- package/dist/lib/browser/chunk-55TEJXLO.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/packlets/testing/index.mjs +8 -28
- package/dist/lib/browser/packlets/testing/index.mjs.map +3 -3
- package/dist/lib/node/{chunk-PQ6V45LX.cjs → chunk-3ZUQNDPT.cjs} +1037 -1385
- package/dist/lib/node/chunk-3ZUQNDPT.cjs.map +7 -0
- package/dist/lib/node/index.cjs +43 -43
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/packlets/testing/index.cjs +14 -34
- package/dist/lib/node/packlets/testing/index.cjs.map +3 -3
- package/dist/types/src/packlets/invitations/device-invitation-protocol.d.ts +1 -2
- package/dist/types/src/packlets/invitations/device-invitation-protocol.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/{invitation-host-extension.d.ts → invitation-extension.d.ts} +31 -17
- package/dist/types/src/packlets/invitations/invitation-extension.d.ts.map +1 -0
- package/dist/types/src/packlets/invitations/invitation-protocol.d.ts +1 -6
- package/dist/types/src/packlets/invitations/invitation-protocol.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitations-handler.d.ts +10 -19
- package/dist/types/src/packlets/invitations/invitations-handler.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitations-manager.d.ts +1 -2
- package/dist/types/src/packlets/invitations/invitations-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/space-invitation-protocol.d.ts +0 -1
- package/dist/types/src/packlets/invitations/space-invitation-protocol.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-context.d.ts +3 -6
- package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
- package/dist/types/src/packlets/testing/invitation-utils.d.ts +1 -2
- package/dist/types/src/packlets/testing/invitation-utils.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 +36 -36
- package/src/packlets/invitations/device-invitation-protocol.ts +1 -5
- package/src/packlets/invitations/{invitation-host-extension.ts → invitation-extension.ts} +105 -99
- package/src/packlets/invitations/invitation-protocol.ts +1 -7
- package/src/packlets/invitations/invitations-handler.ts +149 -246
- package/src/packlets/invitations/invitations-manager.ts +3 -42
- package/src/packlets/invitations/space-invitation-protocol.ts +1 -19
- package/src/packlets/services/service-context.ts +3 -5
- package/src/packlets/testing/invitation-utils.ts +3 -23
- package/src/packlets/testing/test-builder.ts +1 -3
- package/src/version.ts +1 -1
- package/dist/lib/browser/chunk-OE6XNPWD.mjs.map +0 -7
- package/dist/lib/node/chunk-PQ6V45LX.cjs.map +0 -7
- package/dist/types/src/packlets/invitations/invitation-guest-extenstion.d.ts +0 -39
- package/dist/types/src/packlets/invitations/invitation-guest-extenstion.d.ts.map +0 -1
- package/dist/types/src/packlets/invitations/invitation-host-extension.d.ts.map +0 -1
- package/dist/types/src/packlets/invitations/invitation-topology.d.ts +0 -37
- package/dist/types/src/packlets/invitations/invitation-topology.d.ts.map +0 -1
- package/dist/types/src/packlets/invitations/invitations-handler.test.d.ts +0 -2
- package/dist/types/src/packlets/invitations/invitations-handler.test.d.ts.map +0 -1
- package/dist/types/src/packlets/invitations/utils.d.ts +0 -6
- package/dist/types/src/packlets/invitations/utils.d.ts.map +0 -1
- package/src/packlets/invitations/invitation-guest-extenstion.ts +0 -126
- package/src/packlets/invitations/invitation-topology.ts +0 -87
- package/src/packlets/invitations/invitations-handler.test.ts +0 -361
- package/src/packlets/invitations/utils.ts +0 -27
|
@@ -30,7 +30,7 @@ __export(testing_exports, {
|
|
|
30
30
|
sanitizeInvitation: () => sanitizeInvitation
|
|
31
31
|
});
|
|
32
32
|
module.exports = __toCommonJS(testing_exports);
|
|
33
|
-
var
|
|
33
|
+
var import_chunk_3ZUQNDPT = require("../../chunk-3ZUQNDPT.cjs");
|
|
34
34
|
var import_credentials = require("@dxos/credentials");
|
|
35
35
|
var import_keys = require("@dxos/keys");
|
|
36
36
|
var import_async = require("@dxos/async");
|
|
@@ -66,9 +66,7 @@ var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src
|
|
|
66
66
|
var sanitizeInvitation = (invitation) => {
|
|
67
67
|
return import_client_protocol.InvitationEncoder.decode(import_client_protocol.InvitationEncoder.encode(invitation));
|
|
68
68
|
};
|
|
69
|
-
var performInvitation = ({ host, guest, options, hooks, guestDeviceProfile
|
|
70
|
-
let guestError = false;
|
|
71
|
-
let guestConnected = false;
|
|
69
|
+
var performInvitation = ({ host, guest, options, hooks, guestDeviceProfile }) => {
|
|
72
70
|
const hostComplete = new import_async.Trigger();
|
|
73
71
|
const guestComplete = new import_async.Trigger();
|
|
74
72
|
const authCode = new import_async.Trigger();
|
|
@@ -76,10 +74,6 @@ var performInvitation = ({ host, guest, options, hooks, guestDeviceProfile, code
|
|
|
76
74
|
hostObservable.subscribe(async (hostInvitation) => {
|
|
77
75
|
switch (hostInvitation.state) {
|
|
78
76
|
case import_services.Invitation.State.CONNECTING: {
|
|
79
|
-
if (guestConnected) {
|
|
80
|
-
break;
|
|
81
|
-
}
|
|
82
|
-
guestConnected = true;
|
|
83
77
|
if (hooks?.host?.onConnecting?.(hostObservable)) {
|
|
84
78
|
break;
|
|
85
79
|
}
|
|
@@ -92,7 +86,7 @@ var performInvitation = ({ host, guest, options, hooks, guestDeviceProfile, code
|
|
|
92
86
|
}
|
|
93
87
|
(0, import_invariant.invariant)(hostInvitation.swarmKey.equals(guestInvitation.swarmKey), void 0, {
|
|
94
88
|
F: __dxlog_file,
|
|
95
|
-
L:
|
|
89
|
+
L: 79,
|
|
96
90
|
S: void 0,
|
|
97
91
|
A: [
|
|
98
92
|
"hostInvitation.swarmKey!.equals(guestInvitation.swarmKey!)",
|
|
@@ -109,16 +103,7 @@ var performInvitation = ({ host, guest, options, hooks, guestDeviceProfile, code
|
|
|
109
103
|
if (hooks?.guest?.onReady?.(guestObservable)) {
|
|
110
104
|
break;
|
|
111
105
|
}
|
|
112
|
-
|
|
113
|
-
if (codeInputDelay == null) {
|
|
114
|
-
await guestObservable.authenticate(code);
|
|
115
|
-
} else {
|
|
116
|
-
setTimeout(async () => {
|
|
117
|
-
if (!guestError) {
|
|
118
|
-
await guestObservable.authenticate(code);
|
|
119
|
-
}
|
|
120
|
-
}, codeInputDelay);
|
|
121
|
-
}
|
|
106
|
+
await guestObservable.authenticate(await authCode.wait());
|
|
122
107
|
break;
|
|
123
108
|
}
|
|
124
109
|
case import_services.Invitation.State.AUTHENTICATING: {
|
|
@@ -153,7 +138,6 @@ var performInvitation = ({ host, guest, options, hooks, guestDeviceProfile, code
|
|
|
153
138
|
}
|
|
154
139
|
}
|
|
155
140
|
}, (error) => {
|
|
156
|
-
guestError = true;
|
|
157
141
|
if (hooks?.guest?.onError?.(guestObservable)) {
|
|
158
142
|
return;
|
|
159
143
|
}
|
|
@@ -227,7 +211,7 @@ var createInvitation = async (host, options) => {
|
|
|
227
211
|
authMethod: import_services.Invitation.AuthMethod.NONE,
|
|
228
212
|
...options ?? {}
|
|
229
213
|
};
|
|
230
|
-
if (host instanceof
|
|
214
|
+
if (host instanceof import_chunk_3ZUQNDPT.ServiceContext) {
|
|
231
215
|
return host.invitationsManager.createInvitation({
|
|
232
216
|
kind: import_services.Invitation.Kind.SPACE,
|
|
233
217
|
...options
|
|
@@ -237,16 +221,16 @@ var createInvitation = async (host, options) => {
|
|
|
237
221
|
};
|
|
238
222
|
var acceptInvitation = (guest, invitation, guestDeviceProfile) => {
|
|
239
223
|
invitation = sanitizeInvitation(invitation);
|
|
240
|
-
if (guest instanceof
|
|
241
|
-
|
|
242
|
-
invitation
|
|
243
|
-
deviceProfile: guestDeviceProfile
|
|
224
|
+
if (guest instanceof import_chunk_3ZUQNDPT.ServiceContext) {
|
|
225
|
+
const guestHandler = guest.getInvitationHandler({
|
|
226
|
+
kind: invitation.kind
|
|
244
227
|
});
|
|
228
|
+
return guest.invitations.acceptInvitation(guestHandler, invitation, guestDeviceProfile);
|
|
245
229
|
}
|
|
246
230
|
return guest.join(invitation, guestDeviceProfile);
|
|
247
231
|
};
|
|
248
232
|
var createServiceHost = (config, signalManagerContext) => {
|
|
249
|
-
return new
|
|
233
|
+
return new import_chunk_3ZUQNDPT.ClientServicesHost({
|
|
250
234
|
config,
|
|
251
235
|
signalManager: new import_messaging.MemorySignalManager(signalManagerContext),
|
|
252
236
|
transportFactory: import_network_manager.MemoryTransportFactory
|
|
@@ -262,11 +246,7 @@ var createServiceContext = async ({ signalContext = new import_messaging.MemoryS
|
|
|
262
246
|
});
|
|
263
247
|
const level = (0, import_testing.createTestLevel)();
|
|
264
248
|
await level.open();
|
|
265
|
-
return new
|
|
266
|
-
invitationConnectionDefaultParams: {
|
|
267
|
-
controlHeartbeatInterval: 200
|
|
268
|
-
}
|
|
269
|
-
});
|
|
249
|
+
return new import_chunk_3ZUQNDPT.ServiceContext(storage, level, networkManager, signalManager);
|
|
270
250
|
};
|
|
271
251
|
var createPeers = async (numPeers) => {
|
|
272
252
|
const signalContext = new import_messaging.MemorySignalManagerContext();
|
|
@@ -363,12 +343,12 @@ var TestPeer = class {
|
|
|
363
343
|
});
|
|
364
344
|
}
|
|
365
345
|
get dataSpaceManager() {
|
|
366
|
-
return this._props.dataSpaceManager ??= new
|
|
346
|
+
return this._props.dataSpaceManager ??= new import_chunk_3ZUQNDPT.DataSpaceManager(this.spaceManager, this.metadataStore, this.keyring, this.identity, this.feedStore, this.echoHost, this.invitationsManager);
|
|
367
347
|
}
|
|
368
348
|
get invitationsManager() {
|
|
369
|
-
return this._props.invitationsManager ??= new
|
|
349
|
+
return this._props.invitationsManager ??= new import_chunk_3ZUQNDPT.InvitationsManager(new import_chunk_3ZUQNDPT.InvitationsHandler(this.networkManager), (invitation) => {
|
|
370
350
|
if (invitation.kind === import_services2.Invitation.Kind.SPACE) {
|
|
371
|
-
return new
|
|
351
|
+
return new import_chunk_3ZUQNDPT.SpaceInvitationProtocol(this.dataSpaceManager, this.identity, this.keyring, invitation.spaceKey);
|
|
372
352
|
} else {
|
|
373
353
|
throw new Error("not implemented");
|
|
374
354
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/packlets/testing/credential-utils.ts", "../../../../../src/packlets/testing/invitation-utils.ts", "../../../../../src/packlets/testing/test-builder.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { createCredential } from '@dxos/credentials';\nimport { type Signer } from '@dxos/crypto';\nimport { PublicKey } from '@dxos/keys';\nimport { type Credential } from '@dxos/protocols/proto/dxos/halo/credentials';\n\nexport const createMockCredential = async ({\n signer,\n issuer,\n}: {\n signer: Signer;\n issuer: PublicKey;\n}): Promise<Credential> =>\n createCredential({\n signer,\n issuer,\n subject: new PublicKey(Buffer.from('test')),\n assertion: {\n '@type': 'example.testing.rpc.MessageWithAny',\n payload: {\n '@type': 'google.protobuf.Any',\n value: Buffer.from('test'),\n },\n },\n });\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { Trigger } from '@dxos/async';\nimport { InvitationEncoder, type AuthenticatingInvitation, type CancellableInvitation } from '@dxos/client-protocol';\nimport { invariant } from '@dxos/invariant';\nimport { Invitation } from '@dxos/protocols/proto/dxos/client/services';\nimport { type DeviceProfileDocument } from '@dxos/protocols/proto/dxos/halo/credentials';\n\nimport { ServiceContext } from '../services';\n\n/**\n * Strip secrets from invitation before giving it to the peer.\n */\nexport const sanitizeInvitation = (invitation: Invitation): Invitation => {\n return InvitationEncoder.decode(InvitationEncoder.encode(invitation));\n};\n\nexport type InvitationHost = {\n share(options?: Partial<Invitation>): CancellableInvitation;\n};\n\nexport type InvitationGuest = {\n join(invitation: Invitation | string, deviceProfile?: DeviceProfileDocument): AuthenticatingInvitation;\n};\n\nexport type PerformInvitationCallbacks<T> = {\n onConnecting?: (value: T) => boolean | void;\n onConnected?: (value: T) => boolean | void;\n onReady?: (value: T) => boolean | void;\n onAuthenticating?: (value: T) => boolean | void;\n onSuccess?: (value: T) => boolean | void;\n onCancelled?: (value: T) => boolean | void;\n onTimeout?: (value: T) => boolean | void;\n onError?: (value: T) => boolean | void;\n};\n\nexport type PerformInvitationParams = {\n host: ServiceContext | InvitationHost;\n guest: ServiceContext | InvitationGuest;\n options?: Partial<Invitation>;\n hooks?: {\n host?: PerformInvitationCallbacks<CancellableInvitation>;\n guest?: PerformInvitationCallbacks<AuthenticatingInvitation>;\n };\n guestDeviceProfile?: DeviceProfileDocument;\n codeInputDelay?: number;\n};\n\nexport type Result = { invitation?: Invitation; error?: Error };\n\nexport const performInvitation = ({\n host,\n guest,\n options,\n hooks,\n guestDeviceProfile,\n codeInputDelay,\n}: PerformInvitationParams): [Promise<Result>, Promise<Result>] => {\n let guestError = false;\n let guestConnected = false;\n const hostComplete = new Trigger<Result>();\n const guestComplete = new Trigger<Result>();\n const authCode = new Trigger<string>();\n\n void createInvitation(host, options).then((hostObservable) => {\n hostObservable.subscribe(\n async (hostInvitation: Invitation) => {\n switch (hostInvitation.state) {\n case Invitation.State.CONNECTING: {\n if (guestConnected) {\n break;\n }\n guestConnected = true;\n if (hooks?.host?.onConnecting?.(hostObservable)) {\n break;\n }\n const guestObservable = acceptInvitation(guest, hostInvitation, guestDeviceProfile);\n guestObservable.subscribe(\n async (guestInvitation: Invitation) => {\n switch (guestInvitation.state) {\n case Invitation.State.CONNECTING: {\n if (hooks?.guest?.onConnecting?.(guestObservable)) {\n break;\n }\n invariant(hostInvitation.swarmKey!.equals(guestInvitation.swarmKey!));\n break;\n }\n\n case Invitation.State.CONNECTED: {\n hooks?.guest?.onConnected?.(guestObservable);\n break;\n }\n\n case Invitation.State.READY_FOR_AUTHENTICATION: {\n if (hooks?.guest?.onReady?.(guestObservable)) {\n break;\n }\n const code = await authCode.wait();\n if (codeInputDelay == null) {\n await guestObservable.authenticate(code);\n } else {\n setTimeout(async () => {\n if (!guestError) {\n await guestObservable.authenticate(code);\n }\n }, codeInputDelay);\n }\n break;\n }\n\n case Invitation.State.AUTHENTICATING: {\n hooks?.guest?.onAuthenticating?.(guestObservable);\n break;\n }\n\n case Invitation.State.SUCCESS: {\n if (hooks?.guest?.onSuccess?.(guestObservable)) {\n break;\n }\n guestComplete.wake({ invitation: guestInvitation });\n break;\n }\n\n case Invitation.State.CANCELLED: {\n if (hooks?.guest?.onCancelled?.(guestObservable)) {\n break;\n }\n guestComplete.wake({ invitation: guestInvitation });\n break;\n }\n\n case Invitation.State.TIMEOUT: {\n if (hooks?.guest?.onTimeout?.(guestObservable)) {\n return;\n }\n guestComplete.wake({ invitation: guestInvitation });\n }\n }\n },\n (error: Error) => {\n guestError = true;\n if (hooks?.guest?.onError?.(guestObservable)) {\n return;\n }\n guestComplete.wake({ error });\n },\n );\n break;\n }\n\n case Invitation.State.CONNECTED: {\n hooks?.host?.onConnected?.(hostObservable);\n break;\n }\n\n case Invitation.State.READY_FOR_AUTHENTICATION: {\n if (hooks?.host?.onReady?.(hostObservable)) {\n break;\n }\n if (hostInvitation.authCode) {\n authCode.wake(hostInvitation.authCode);\n }\n break;\n }\n\n case Invitation.State.AUTHENTICATING: {\n hooks?.host?.onAuthenticating?.(hostObservable);\n break;\n }\n\n case Invitation.State.SUCCESS: {\n if (hooks?.host?.onSuccess?.(hostObservable)) {\n break;\n }\n hostComplete.wake({ invitation: hostInvitation });\n break;\n }\n\n case Invitation.State.CANCELLED: {\n if (hooks?.host?.onCancelled?.(hostObservable)) {\n break;\n }\n hostComplete.wake({ invitation: hostInvitation });\n break;\n }\n\n case Invitation.State.TIMEOUT: {\n if (hooks?.host?.onTimeout?.(hostObservable)) {\n break;\n }\n hostComplete.wake({ invitation: hostInvitation });\n break;\n }\n }\n },\n (error: Error) => {\n if (hooks?.host?.onError?.(hostObservable)) {\n return;\n }\n hostComplete.wake({ error });\n },\n );\n });\n\n return [hostComplete.wait(), guestComplete.wait()];\n};\n\nconst createInvitation = async (\n host: ServiceContext | InvitationHost,\n options?: Partial<Invitation>,\n): Promise<CancellableInvitation> => {\n options ??= {\n authMethod: Invitation.AuthMethod.NONE,\n ...(options ?? {}),\n };\n\n if (host instanceof ServiceContext) {\n return host.invitationsManager.createInvitation({\n kind: Invitation.Kind.SPACE,\n ...options,\n });\n }\n\n return host.share(options);\n};\n\nconst acceptInvitation = (\n guest: ServiceContext | InvitationGuest,\n invitation: Invitation,\n guestDeviceProfile?: DeviceProfileDocument,\n): AuthenticatingInvitation => {\n invitation = sanitizeInvitation(invitation);\n\n if (guest instanceof ServiceContext) {\n return guest.invitationsManager.acceptInvitation({\n invitation,\n deviceProfile: guestDeviceProfile,\n });\n }\n\n return guest.join(invitation, guestDeviceProfile);\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { type Config } from '@dxos/config';\nimport { Context } from '@dxos/context';\nimport { createCredentialSignerWithChain, CredentialGenerator } from '@dxos/credentials';\nimport { failUndefined } from '@dxos/debug';\nimport { EchoHost } from '@dxos/echo-db';\nimport { MetadataStore, SnapshotStore, SpaceManager, valueEncoding } from '@dxos/echo-pipeline';\nimport { FeedFactory, FeedStore } from '@dxos/feed-store';\nimport { Keyring } from '@dxos/keyring';\nimport { type LevelDB } from '@dxos/kv-store';\nimport { createTestLevel } from '@dxos/kv-store/testing';\nimport { MemorySignalManager, MemorySignalManagerContext } from '@dxos/messaging';\nimport { MemoryTransportFactory, NetworkManager } from '@dxos/network-manager';\nimport { Invitation } from '@dxos/protocols/proto/dxos/client/services';\nimport { createStorage, StorageType, type Storage } from '@dxos/random-access-storage';\nimport { BlobStore } from '@dxos/teleport-extension-object-sync';\n\nimport { InvitationsHandler, InvitationsManager, SpaceInvitationProtocol } from '../invitations';\nimport { ClientServicesHost, ServiceContext } 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 invitationConnectionDefaultParams: { controlHeartbeatInterval: 200 },\n });\n};\n\nexport const createPeers = async (numPeers: number) => {\n const signalContext = new MemorySignalManagerContext();\n\n return await Promise.all(\n Array.from(Array(numPeers)).map(async () => {\n const peer = await createServiceContext({ signalContext });\n await peer.open(new Context());\n return peer;\n }),\n );\n};\n\nexport const createIdentity = async (peer: ServiceContext) => {\n await peer.createIdentity();\n return peer;\n};\n\nexport class TestBuilder {\n public readonly signalContext = new MemorySignalManagerContext();\n private readonly _ctx = new Context();\n\n createPeer(peerOptions?: TestPeerOpts): TestPeer {\n const peer = new TestPeer(this.signalContext, peerOptions);\n this._ctx.onDispose(async () => peer.destroy());\n return peer;\n }\n\n async destroy() {\n await this._ctx.dispose();\n }\n}\n\nexport type TestPeerOpts = {\n dataStore?: StorageType;\n};\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 echoHost?: EchoHost;\n invitationsManager?: InvitationsManager;\n};\n\nexport class TestPeer {\n private _props: TestPeerProps = {};\n\n constructor(\n private readonly signalContext: MemorySignalManagerContext,\n private readonly opts: TestPeerOpts = { dataStore: StorageType.RAM },\n ) {}\n\n get props() {\n return this._props;\n }\n\n get storage() {\n return (this._props.storage ??= createStorage({ type: this.opts.dataStore }));\n }\n\n get keyring() {\n return (this._props.keyring ??= new Keyring(this.storage.createDirectory('keyring')));\n }\n\n get level() {\n return (this._props.level ??= createTestLevel());\n }\n\n get feedStore() {\n return (this._props.feedStore ??= new FeedStore({\n factory: new FeedFactory({\n root: this.storage.createDirectory('feeds'),\n signer: this.keyring,\n hypercore: {\n valueEncoding,\n },\n }),\n }));\n }\n\n get metadataStore() {\n return (this._props.metadataStore ??= new MetadataStore(this.storage.createDirectory('metadata')));\n }\n\n get blobStore() {\n return (this._props.blobStore ??= new BlobStore(this.storage.createDirectory('blobs')));\n }\n\n get snapshotStore() {\n return (this._props.snapshotStore ??= new SnapshotStore(this.storage.createDirectory('snapshots')));\n }\n\n get networkManager() {\n return (this._props.networkManager ??= new 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 echoHost() {\n return (this._props.echoHost ??= new EchoHost({\n kv: this.level,\n storage: this.storage,\n }));\n }\n\n get dataSpaceManager(): DataSpaceManager {\n return (this._props.dataSpaceManager ??= new DataSpaceManager(\n this.spaceManager,\n this.metadataStore,\n this.keyring,\n this.identity,\n this.feedStore,\n this.echoHost,\n this.invitationsManager,\n ));\n }\n\n get invitationsManager() {\n return (this._props.invitationsManager ??= new InvitationsManager(\n new InvitationsHandler(this.networkManager),\n (invitation) => {\n if (invitation.kind === Invitation.Kind.SPACE) {\n return new SpaceInvitationProtocol(this.dataSpaceManager, this.identity!, this.keyring, invitation.spaceKey!);\n } else {\n throw new Error('not implemented');\n }\n },\n this.metadataStore,\n ));\n }\n\n async createIdentity() {\n this._props.signingContext ??= await createSigningContext(this.keyring);\n }\n\n async destroy() {\n await this.level.close();\n await this.storage.reset();\n }\n}\n\nexport const createSigningContext = async (keyring: Keyring): Promise<SigningContext> => {\n const identityKey = await keyring.createKey();\n const deviceKey = await keyring.createKey();\n\n return {\n identityKey,\n deviceKey,\n credentialSigner: createCredentialSignerWithChain(\n keyring,\n {\n credential: await new CredentialGenerator(keyring, identityKey, deviceKey).createDeviceAuthorization(deviceKey),\n },\n deviceKey,\n ),\n recordCredential: async () => {}, // No-op.\n getProfile: () => undefined,\n };\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,yBAAiC;AAEjC,kBAA0B;ACF1B,mBAAwB;AACxB,6BAA6F;AAC7F,uBAA0B;AAC1B,sBAA2B;ACF3B,qBAAwB;AACxB,IAAAA,sBAAqE;AACrE,mBAA8B;AAC9B,qBAAyB;AACzB,2BAA0E;AAC1E,wBAAuC;AACvC,qBAAwB;AAExB,qBAAgC;AAChC,uBAAgE;AAChE,6BAAuD;AACvD,IAAAC,mBAA2B;AAC3B,mCAAyD;AACzD,4CAA0B;AFTnB,IAAMC,uBAAuB,OAAO,EACzCC,QACAC,OAAM,UAKNC,qCAAiB;EACfF;EACAC;EACAE,SAAS,IAAIC,sBAAUC,OAAOC,KAAK,MAAA,CAAA;EACnCC,WAAW;IACT,SAAS;IACTC,SAAS;MACP,SAAS;MACTC,OAAOJ,OAAOC,KAAK,MAAA;IACrB;EACF;AACF,CAAA;;ACZK,IAAMI,qBAAqB,CAACC,eAAAA;AACjC,SAAOC,yCAAkBC,OAAOD,yCAAkBE,OAAOH,UAAAA,CAAAA;AAC3D;
|
|
6
|
-
"names": ["import_credentials", "import_services", "createMockCredential", "signer", "issuer", "createCredential", "subject", "PublicKey", "Buffer", "from", "assertion", "payload", "value", "sanitizeInvitation", "invitation", "InvitationEncoder", "decode", "encode", "performInvitation", "host", "guest", "options", "hooks", "guestDeviceProfile", "
|
|
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 void createInvitation(host, options).then((hostObservable) => {\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\n return [hostComplete.wait(), guestComplete.wait()];\n};\n\nconst createInvitation = async (\n host: ServiceContext | InvitationHost,\n options?: Partial<Invitation>,\n): Promise<CancellableInvitation> => {\n options ??= {\n authMethod: Invitation.AuthMethod.NONE,\n ...(options ?? {}),\n };\n\n if (host instanceof ServiceContext) {\n return host.invitationsManager.createInvitation({\n kind: Invitation.Kind.SPACE,\n ...options,\n });\n }\n\n return host.share(options);\n};\n\nconst acceptInvitation = (\n guest: ServiceContext | InvitationGuest,\n invitation: Invitation,\n guestDeviceProfile?: DeviceProfileDocument,\n): AuthenticatingInvitation => {\n invitation = sanitizeInvitation(invitation);\n\n if (guest instanceof ServiceContext) {\n 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 { EchoHost } from '@dxos/echo-db';\nimport { MetadataStore, SnapshotStore, SpaceManager, valueEncoding } from '@dxos/echo-pipeline';\nimport { FeedFactory, FeedStore } from '@dxos/feed-store';\nimport { Keyring } from '@dxos/keyring';\nimport { type LevelDB } from '@dxos/kv-store';\nimport { createTestLevel } from '@dxos/kv-store/testing';\nimport { MemorySignalManager, MemorySignalManagerContext } from '@dxos/messaging';\nimport { MemoryTransportFactory, NetworkManager } from '@dxos/network-manager';\nimport { Invitation } from '@dxos/protocols/proto/dxos/client/services';\nimport { createStorage, StorageType, type Storage } from '@dxos/random-access-storage';\nimport { BlobStore } from '@dxos/teleport-extension-object-sync';\n\nimport { InvitationsHandler, InvitationsManager, SpaceInvitationProtocol } from '../invitations';\nimport { ClientServicesHost, ServiceContext } 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 echoHost?: EchoHost;\n invitationsManager?: InvitationsManager;\n};\n\nexport class TestPeer {\n private _props: TestPeerProps = {};\n\n constructor(\n private readonly signalContext: MemorySignalManagerContext,\n private readonly opts: TestPeerOpts = { dataStore: StorageType.RAM },\n ) {}\n\n get props() {\n return this._props;\n }\n\n get storage() {\n return (this._props.storage ??= createStorage({ type: this.opts.dataStore }));\n }\n\n get keyring() {\n return (this._props.keyring ??= new Keyring(this.storage.createDirectory('keyring')));\n }\n\n get level() {\n return (this._props.level ??= createTestLevel());\n }\n\n get feedStore() {\n return (this._props.feedStore ??= new FeedStore({\n factory: new FeedFactory({\n root: this.storage.createDirectory('feeds'),\n signer: this.keyring,\n hypercore: {\n valueEncoding,\n },\n }),\n }));\n }\n\n get metadataStore() {\n return (this._props.metadataStore ??= new MetadataStore(this.storage.createDirectory('metadata')));\n }\n\n get blobStore() {\n return (this._props.blobStore ??= new BlobStore(this.storage.createDirectory('blobs')));\n }\n\n get snapshotStore() {\n return (this._props.snapshotStore ??= new SnapshotStore(this.storage.createDirectory('snapshots')));\n }\n\n get networkManager() {\n return (this._props.networkManager ??= new 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 echoHost() {\n return (this._props.echoHost ??= new EchoHost({\n kv: this.level,\n storage: this.storage,\n }));\n }\n\n get dataSpaceManager(): DataSpaceManager {\n return (this._props.dataSpaceManager ??= new DataSpaceManager(\n this.spaceManager,\n this.metadataStore,\n this.keyring,\n this.identity,\n this.feedStore,\n this.echoHost,\n this.invitationsManager,\n ));\n }\n\n get invitationsManager() {\n return (this._props.invitationsManager ??= new InvitationsManager(\n new InvitationsHandler(this.networkManager),\n (invitation) => {\n if (invitation.kind === Invitation.Kind.SPACE) {\n return new SpaceInvitationProtocol(this.dataSpaceManager, this.identity!, this.keyring, invitation.spaceKey!);\n } else {\n throw new Error('not implemented');\n }\n },\n this.metadataStore,\n ));\n }\n\n async createIdentity() {\n this._props.signingContext ??= await createSigningContext(this.keyring);\n }\n\n async destroy() {\n await this.level.close();\n await this.storage.reset();\n }\n}\n\nexport const createSigningContext = async (keyring: Keyring): Promise<SigningContext> => {\n const identityKey = await keyring.createKey();\n const deviceKey = await keyring.createKey();\n\n return {\n identityKey,\n deviceKey,\n credentialSigner: createCredentialSignerWithChain(\n keyring,\n {\n credential: await new CredentialGenerator(keyring, identityKey, deviceKey).createDeviceAuthorization(deviceKey),\n },\n deviceKey,\n ),\n recordCredential: async () => {}, // No-op.\n getProfile: () => undefined,\n };\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;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;MAC7G,OAAO;AACL,cAAM,IAAIC,MAAM,iBAAA;MAClB;IACF,GACA,KAAKpB,aAAa;EAEtB;EAEA,MAAMxB,iBAAiB;AACrB,SAAKY,OAAOqB,mBAAmB,MAAMY,qBAAqB,KAAK/B,OAAO;EACxE;EAEA,MAAMP,UAAU;AACd,UAAM,KAAKlB,MAAMyD,MAAK;AACtB,UAAM,KAAKhE,QAAQiE,MAAK;EAC1B;AACF;AAEO,IAAMF,uBAAuB,OAAO/B,YAAAA;AACzC,QAAMkC,cAAc,MAAMlC,QAAQmC,UAAS;AAC3C,QAAMC,YAAY,MAAMpC,QAAQmC,UAAS;AAEzC,SAAO;IACLD;IACAE;IACAC,sBAAkBC,qDAChBtC,SACA;MACEuC,YAAY,MAAM,IAAIC,wCAAoBxC,SAASkC,aAAaE,SAAAA,EAAWK,0BAA0BL,SAAAA;IACvG,GACAA,SAAAA;IAEFM,kBAAkB,YAAA;IAAa;IAC/BC,YAAY,MAAMC;EACpB;AACF;",
|
|
6
|
+
"names": ["import_credentials", "import_services", "createMockCredential", "signer", "issuer", "createCredential", "subject", "PublicKey", "Buffer", "from", "assertion", "payload", "value", "sanitizeInvitation", "invitation", "InvitationEncoder", "decode", "encode", "performInvitation", "host", "guest", "options", "hooks", "guestDeviceProfile", "hostComplete", "Trigger", "guestComplete", "authCode", "createInvitation", "then", "hostObservable", "subscribe", "hostInvitation", "state", "Invitation", "State", "CONNECTING", "onConnecting", "guestObservable", "acceptInvitation", "guestInvitation", "invariant", "swarmKey", "equals", "CONNECTED", "onConnected", "READY_FOR_AUTHENTICATION", "onReady", "authenticate", "wait", "AUTHENTICATING", "onAuthenticating", "SUCCESS", "onSuccess", "wake", "CANCELLED", "onCancelled", "TIMEOUT", "onTimeout", "error", "onError", "authMethod", "AuthMethod", "NONE", "ServiceContext", "invitationsManager", "kind", "Kind", "SPACE", "share", "guestHandler", "getInvitationHandler", "invitations", "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", "echoHost", "EchoHost", "kv", "dataSpaceManager", "DataSpaceManager", "InvitationsManager", "InvitationsHandler", "SpaceInvitationProtocol", "spaceKey", "Error", "createSigningContext", "close", "reset", "identityKey", "createKey", "deviceKey", "credentialSigner", "createCredentialSignerWithChain", "credential", "CredentialGenerator", "createDeviceAuthorization", "recordCredential", "getProfile", "undefined"]
|
|
7
7
|
}
|
|
@@ -13,8 +13,7 @@ export declare class DeviceInvitationProtocol implements InvitationProtocol {
|
|
|
13
13
|
constructor(_keyring: Keyring, _getIdentity: () => Identity, _acceptIdentity: (identity: JoinIdentityParams) => Promise<Identity>);
|
|
14
14
|
toJSON(): object;
|
|
15
15
|
getInvitationContext(): Partial<Invitation> & Pick<Invitation, 'kind'>;
|
|
16
|
-
delegate(): Promise<PublicKey>;
|
|
17
|
-
cancelDelegation(): Promise<void>;
|
|
16
|
+
delegate(invitation: Invitation): Promise<PublicKey>;
|
|
18
17
|
admit(_: Invitation, request: AdmissionRequest): Promise<AdmissionResponse>;
|
|
19
18
|
checkInvitation(invitation: Partial<Invitation>): AlreadyJoinedError | undefined;
|
|
20
19
|
createIntroduction(): IntroductionRequest;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device-invitation-protocol.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/invitations/device-invitation-protocol.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AACxE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AACzF,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACzB,MAAM,6CAA6C,CAAC;AAErD,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAErE,qBAAa,wBAAyB,YAAW,kBAAkB;IAE/D,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,eAAe;gBAFf,QAAQ,EAAE,OAAO,EACjB,YAAY,EAAE,MAAM,QAAQ,EAC5B,eAAe,EAAE,CAAC,QAAQ,EAAE,kBAAkB,KAAK,OAAO,CAAC,QAAQ,CAAC;IAGvF,MAAM,IAAI,MAAM;IAIhB,oBAAoB,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC;IAMhE,QAAQ,
|
|
1
|
+
{"version":3,"file":"device-invitation-protocol.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/invitations/device-invitation-protocol.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD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{
|
|
1
|
+
import { Trigger } from '@dxos/async';
|
|
2
2
|
import { Context } from '@dxos/context';
|
|
3
3
|
import { PublicKey } from '@dxos/keys';
|
|
4
4
|
import { Invitation } from '@dxos/protocols/proto/dxos/client/services';
|
|
5
5
|
import { type ProfileDocument } from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
6
|
-
import { type AdmissionRequest, type AdmissionResponse, type InvitationHostService } from '@dxos/protocols/proto/dxos/halo/invitations';
|
|
6
|
+
import { type AdmissionRequest, type AdmissionResponse, type IntroductionRequest, type InvitationHostService } from '@dxos/protocols/proto/dxos/halo/invitations';
|
|
7
7
|
import { type ExtensionContext, RpcExtension } from '@dxos/teleport';
|
|
8
8
|
export declare const MAX_OTP_ATTEMPTS = 3;
|
|
9
9
|
type InvitationHostExtensionCallbacks = {
|
|
10
|
-
|
|
11
|
-
onOpen: (ctx: Context, extensionCtx: ExtensionContext) => void;
|
|
10
|
+
onOpen: () => void;
|
|
12
11
|
onError: (error: Error) => void;
|
|
13
|
-
onStateUpdate: (
|
|
12
|
+
onStateUpdate: (invitation: Invitation) => void;
|
|
13
|
+
resolveInvitation: (request: IntroductionRequest) => Promise<Invitation | undefined>;
|
|
14
14
|
admit: (request: AdmissionRequest) => Promise<AdmissionResponse>;
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
@@ -21,11 +21,11 @@ export declare class InvitationHostExtension extends RpcExtension<{
|
|
|
21
21
|
}, {
|
|
22
22
|
InvitationHostService: InvitationHostService;
|
|
23
23
|
}> {
|
|
24
|
-
private readonly _invitationFlowMutex;
|
|
25
24
|
private readonly _callbacks;
|
|
26
25
|
private _remoteOptions?;
|
|
27
26
|
private _remoteOptionsTrigger;
|
|
28
27
|
private _challenge?;
|
|
28
|
+
invitation?: Invitation;
|
|
29
29
|
guestProfile?: ProfileDocument;
|
|
30
30
|
authenticationPassed: boolean;
|
|
31
31
|
/**
|
|
@@ -36,22 +36,36 @@ export declare class InvitationHostExtension extends RpcExtension<{
|
|
|
36
36
|
* Resolved when admission is completed.
|
|
37
37
|
*/
|
|
38
38
|
completedTrigger: Trigger<PublicKey>;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
constructor(_callbacks: InvitationHostExtensionCallbacks);
|
|
40
|
+
protected getHandlers(): Promise<{
|
|
41
|
+
InvitationHostService: InvitationHostService;
|
|
42
|
+
}>;
|
|
43
|
+
onOpen(context: ExtensionContext): Promise<void>;
|
|
44
|
+
onClose(): Promise<void>;
|
|
45
|
+
}
|
|
46
|
+
type InvitationGuestExtensionCallbacks = {
|
|
47
|
+
onOpen: (ctx: Context) => void;
|
|
48
|
+
onError: (error: Error) => void;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Guest's side for a connection to a concrete peer in p2p network during invitation.
|
|
52
|
+
*/
|
|
53
|
+
export declare class InvitationGuestExtension extends RpcExtension<{
|
|
54
|
+
InvitationHostService: InvitationHostService;
|
|
55
|
+
}, {
|
|
56
|
+
InvitationHostService: InvitationHostService;
|
|
57
|
+
}> {
|
|
58
|
+
private readonly _callbacks;
|
|
59
|
+
private _ctx;
|
|
60
|
+
private _remoteOptions?;
|
|
61
|
+
private _remoteOptionsTrigger;
|
|
62
|
+
constructor(_callbacks: InvitationGuestExtensionCallbacks);
|
|
45
63
|
protected getHandlers(): Promise<{
|
|
46
64
|
InvitationHostService: InvitationHostService;
|
|
47
65
|
}>;
|
|
48
66
|
onOpen(context: ExtensionContext): Promise<void>;
|
|
49
|
-
private _requireActiveInvitation;
|
|
50
|
-
private _assertInvitationState;
|
|
51
67
|
onClose(): Promise<void>;
|
|
52
|
-
onAbort(): Promise<void>;
|
|
53
|
-
private _destroy;
|
|
54
68
|
}
|
|
55
69
|
export declare const isAuthenticationRequired: (invitation: Invitation) => boolean;
|
|
56
70
|
export {};
|
|
57
|
-
//# sourceMappingURL=invitation-
|
|
71
|
+
//# sourceMappingURL=invitation-extension.d.ts.map
|
|
@@ -0,0 +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;AAG3D,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGvC,OAAO,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AACxE,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,6CAA6C,CAAC;AACnF,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EAEtB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAE3B,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,KAAK,gBAAgB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAKrE,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAElC,KAAK,gCAAgC,GAAG;IAEtC,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAEhC,aAAa,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;IAEhD,iBAAiB,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAAC;IAErF,KAAK,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAClE,CAAC;AAEF;;GAEG;AACH,qBAAa,uBAAwB,SAAQ,YAAY,CACvD;IAAE,qBAAqB,EAAE,qBAAqB,CAAA;CAAE,EAChD;IAAE,qBAAqB,EAAE,qBAAqB,CAAA;CAAE,CACjD;IA0Ba,OAAO,CAAC,QAAQ,CAAC,UAAU;IArBvC,OAAO,CAAC,cAAc,CAAC,CAAU;IACjC,OAAO,CAAC,qBAAqB,CAAiB;IAE9C,OAAO,CAAC,UAAU,CAAC,CAAqB;IAEjC,UAAU,CAAC,EAAE,UAAU,CAAa;IAEpC,YAAY,CAAC,EAAE,eAAe,CAAa;IAE3C,oBAAoB,UAAS;IAEpC;;OAEG;IACI,mBAAmB,SAAK;IAE/B;;OAEG;IACI,gBAAgB,qBAA4B;gBAEtB,UAAU,EAAE,gCAAgC;cAWhD,WAAW,IAAI,OAAO,CAAC;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"}
|
|
@@ -13,14 +13,9 @@ export interface InvitationProtocol {
|
|
|
13
13
|
*/
|
|
14
14
|
getInvitationContext(): Partial<Invitation> & Pick<Invitation, 'kind'>;
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
17
|
-
* @return id of the delegation credential written to subject control-feed.
|
|
16
|
+
* Once authentication is successful, the host can admit the guest to the requested resource.
|
|
18
17
|
*/
|
|
19
18
|
delegate(invitation: Invitation): Promise<PublicKey>;
|
|
20
|
-
/**
|
|
21
|
-
* Notify other peers that a delegated invitation was cancelled;
|
|
22
|
-
*/
|
|
23
|
-
cancelDelegation(invitation: Invitation): Promise<void>;
|
|
24
19
|
/**
|
|
25
20
|
* Once authentication is successful, the host can admit the guest to the requested resource.
|
|
26
21
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invitation-protocol.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/invitations/invitation-protocol.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AAC7E,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AAC1G,OAAO,KAAK,EACV,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,6CAA6C,CAAC;AAErD,MAAM,WAAW,kBAAkB;IAKjC;;OAEG;IACH,MAAM,IAAI,MAAM,CAAC;IAMjB;;OAEG;IACH,oBAAoB,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IAEvE
|
|
1
|
+
{"version":3,"file":"invitation-protocol.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/invitations/invitation-protocol.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AAC7E,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AAC1G,OAAO,KAAK,EACV,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,6CAA6C,CAAC;AAErD,MAAM,WAAW,kBAAkB;IAKjC;;OAEG;IACH,MAAM,IAAI,MAAM,CAAC;IAMjB;;OAEG;IACH,oBAAoB,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IAEvE;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IAErD;;OAEG;IACH,KAAK,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,gBAAgB,EAAE,YAAY,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAMrH;;;;OAIG;IACH,eAAe,CAAC,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,QAAQ,GAAG,SAAS,CAAC;IAEvE;;OAEG;IACH,kBAAkB,IAAI,mBAAmB,CAAC;IAE1C;;OAEG;IACH,sBAAsB,CAAC,aAAa,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAEzF;;OAEG;IACH,MAAM,CAAC,QAAQ,EAAE,iBAAiB,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;CAC9F"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { PushStream } from '@dxos/async';
|
|
2
|
+
import { AuthenticatingInvitation } from '@dxos/client-protocol';
|
|
3
|
+
import { Context } from '@dxos/context';
|
|
3
4
|
import { type AdmissionKeypair, Invitation } from '@dxos/protocols/proto/dxos/client/services';
|
|
4
5
|
import { type DeviceProfileDocument } from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
5
6
|
import { type InvitationProtocol } from './invitation-protocol';
|
|
@@ -10,40 +11,30 @@ import { type InvitationProtocol } from './invitation-protocol';
|
|
|
10
11
|
* Host
|
|
11
12
|
* - Creates an invitation containing a swarm topic (which can be shared via a URL, QR code, or direct message).
|
|
12
13
|
* - Joins the swarm with the topic and waits for guest's introduction.
|
|
13
|
-
* - Wait for guest to authenticate with
|
|
14
|
+
* - Wait for guest to authenticate with OTP.
|
|
14
15
|
* - Waits for guest to present credentials (containing local device and feed keys).
|
|
15
|
-
* - Writes credentials to control feed then exits
|
|
16
|
+
* - Writes credentials to control feed then exits.
|
|
16
17
|
*
|
|
17
18
|
* Guest
|
|
18
19
|
* - Joins the swarm with the topic.
|
|
19
20
|
* - Sends an introduction.
|
|
20
|
-
* -
|
|
21
|
+
* - Sends authentication OTP.
|
|
21
22
|
* - If Space handler then creates a local cloned space (with genesis block).
|
|
22
23
|
* - Sends admission credentials.
|
|
24
|
+
*
|
|
25
|
+
* TODO(burdon): Show proxy/service relationship and reference design doc/diagram.
|
|
26
|
+
*
|
|
23
27
|
* ```
|
|
24
28
|
* [Guest] [Host]
|
|
25
29
|
* |------------------------------------Introduce-->|
|
|
26
30
|
* |-------------------------------[Authenticate]-->|
|
|
27
31
|
* |----------------------------------------Admit-->|
|
|
28
32
|
* ```
|
|
29
|
-
*
|
|
30
|
-
* TODO: consider refactoring using xstate making the logic separation more explicit:
|
|
31
|
-
* TODO: the flow logic should either be contained in invitations-handler or in extensions, not be split across
|
|
32
|
-
* TODO: potentially re-evaluate host-side API to allow multiple concurrent connection, so that mutex can be removed
|
|
33
33
|
*/
|
|
34
34
|
export declare class InvitationsHandler {
|
|
35
35
|
private readonly _networkManager;
|
|
36
|
-
private readonly _defaultTeleportParams?;
|
|
37
36
|
handleInvitationFlow(ctx: Context, stream: PushStream<Invitation>, protocol: InvitationProtocol, invitation: Invitation): void;
|
|
38
|
-
acceptInvitation(
|
|
39
|
-
private _joinSwarm;
|
|
40
|
-
/**
|
|
41
|
-
* A utility object for serializing invitation state changes by multiple concurrent
|
|
42
|
-
* invitation flow connections.
|
|
43
|
-
*/
|
|
44
|
-
private _createGuardedState;
|
|
45
|
-
private _logStateUpdate;
|
|
46
|
-
private _isNotTerminal;
|
|
37
|
+
acceptInvitation(protocol: InvitationProtocol, invitation: Invitation, deviceProfile?: DeviceProfileDocument): AuthenticatingInvitation;
|
|
47
38
|
private _handleGuestOtpAuth;
|
|
48
39
|
private _handleGuestKpkAuth;
|
|
49
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invitations-handler.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/invitations/invitations-handler.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"invitations-handler.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/invitations/invitations-handler.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAuC,MAAM,aAAa,CAAC;AAC9E,OAAO,EAAE,wBAAwB,EAAsB,MAAM,uBAAuB,CAAC;AACrF,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAYxC,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,oBAAoB,CAClB,GAAG,EAAE,OAAO,EACZ,MAAM,EAAE,UAAU,CAAC,UAAU,CAAC,EAC9B,QAAQ,EAAE,kBAAkB,EAC5B,UAAU,EAAE,UAAU,GACrB,IAAI;IAoHP,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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Event } from '@dxos/async';
|
|
2
|
-
import { AuthenticatingInvitation, CancellableInvitation } from '@dxos/client-protocol';
|
|
2
|
+
import { type AuthenticatingInvitation, CancellableInvitation } from '@dxos/client-protocol';
|
|
3
3
|
import { Context } from '@dxos/context';
|
|
4
4
|
import { type MetadataStore } from '@dxos/echo-pipeline';
|
|
5
5
|
import { type AcceptInvitationRequest, type AuthenticationRequest, Invitation } from '@dxos/protocols/proto/dxos/client/services';
|
|
@@ -37,7 +37,6 @@ export declare class InvitationsManager {
|
|
|
37
37
|
onPersistentInvitationsLoaded(ctx: Context, callback: () => void): void;
|
|
38
38
|
private _createInvitation;
|
|
39
39
|
private _createObservableInvitation;
|
|
40
|
-
private _createObservableAcceptingInvitation;
|
|
41
40
|
private _persistIfRequired;
|
|
42
41
|
private _safeDeleteInvitation;
|
|
43
42
|
private _onInvitationComplete;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invitations-manager.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/invitations/invitations-manager.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"invitations-manager.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/invitations/invitations-manager.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAc,MAAM,aAAa,CAAC;AAChD,OAAO,EACL,KAAK,wBAAwB,EAE7B,qBAAqB,EAEtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAwB,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAI/E,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,UAAU,EACX,MAAM,4CAA4C,CAAC;A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AC,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,iBAAiB;IAqCzB,OAAO,CAAC,2BAA2B;YAuBrB,kBAAkB;YAclB,qBAAqB;IAQnC,OAAO,CAAC,qBAAqB;CAO9B"}
|
|
@@ -16,7 +16,6 @@ export declare class SpaceInvitationProtocol implements InvitationProtocol {
|
|
|
16
16
|
getInvitationContext(): Partial<Invitation> & Pick<Invitation, 'kind'>;
|
|
17
17
|
admit(invitation: Invitation, request: AdmissionRequest, guestProfile?: ProfileDocument | undefined): Promise<AdmissionResponse>;
|
|
18
18
|
delegate(invitation: Invitation): Promise<PublicKey>;
|
|
19
|
-
cancelDelegation(invitation: Invitation): Promise<void>;
|
|
20
19
|
checkInvitation(invitation: Partial<Invitation>): AlreadyJoinedError | undefined;
|
|
21
20
|
createIntroduction(): IntroductionRequest;
|
|
22
21
|
createAdmissionRequest(): Promise<AdmissionRequest>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"space-invitation-protocol.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/invitations/space-invitation-protocol.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"space-invitation-protocol.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/invitations/space-invitation-protocol.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AAExE,OAAO,EAAe,KAAK,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAChG,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACzB,MAAM,6CAA6C,CAAC;AAErD,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;AAEvE,qBAAa,uBAAwB,YAAW,kBAAkB;IAE9D,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC;gBAHV,aAAa,EAAE,gBAAgB,EAC/B,eAAe,EAAE,cAAc,EAC/B,QAAQ,EAAE,OAAO,EACjB,SAAS,CAAC,uBAAW;IAGxC,MAAM,IAAI,MAAM;IAOhB,oBAAoB,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC;IAOhE,KAAK,CACT,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,gBAAgB,EACzB,YAAY,CAAC,EAAE,eAAe,GAAG,SAAS,GACzC,OAAO,CAAC,iBAAiB,CAAC;IAkCvB,QAAQ,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC;IAiC1D,eAAe,CAAC,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC;IAM/C,kBAAkB,IAAI,mBAAmB;IAMnC,sBAAsB,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAenD,MAAM,CAAC,QAAQ,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;CAuBxE"}
|
|
@@ -11,15 +11,12 @@ import { Invitation } from '@dxos/protocols/proto/dxos/client/services';
|
|
|
11
11
|
import type { FeedMessage } from '@dxos/protocols/proto/dxos/echo/feed';
|
|
12
12
|
import { type ProfileDocument } from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
13
13
|
import { type Storage } from '@dxos/random-access-storage';
|
|
14
|
-
import type { TeleportParams } from '@dxos/teleport';
|
|
15
14
|
import { BlobStore } from '@dxos/teleport-extension-object-sync';
|
|
16
15
|
import { IdentityManager, type CreateIdentityOptions, type IdentityManagerRuntimeParams } from '../identity';
|
|
17
16
|
import { InvitationsHandler, type InvitationProtocol } from '../invitations';
|
|
18
17
|
import { InvitationsManager } from '../invitations/invitations-manager';
|
|
19
18
|
import { DataSpaceManager, type DataSpaceManagerRuntimeParams } from '../spaces';
|
|
20
|
-
export type ServiceContextRuntimeParams = IdentityManagerRuntimeParams & DataSpaceManagerRuntimeParams
|
|
21
|
-
invitationConnectionDefaultParams?: Partial<TeleportParams>;
|
|
22
|
-
};
|
|
19
|
+
export type ServiceContextRuntimeParams = IdentityManagerRuntimeParams & DataSpaceManagerRuntimeParams;
|
|
23
20
|
/**
|
|
24
21
|
* Shared backend for all client services.
|
|
25
22
|
*/
|
|
@@ -28,7 +25,7 @@ export declare class ServiceContext extends Resource {
|
|
|
28
25
|
readonly level: LevelDB;
|
|
29
26
|
readonly networkManager: NetworkManager;
|
|
30
27
|
readonly signalManager: SignalManager;
|
|
31
|
-
readonly _runtimeParams?:
|
|
28
|
+
readonly _runtimeParams?: (IdentityManagerRuntimeParams & DataSpaceManagerRuntimeParams) | undefined;
|
|
32
29
|
readonly initialized: Trigger<void>;
|
|
33
30
|
readonly metadataStore: MetadataStore;
|
|
34
31
|
/**
|
|
@@ -47,7 +44,7 @@ export declare class ServiceContext extends Resource {
|
|
|
47
44
|
private readonly _handlerFactories;
|
|
48
45
|
private _deviceSpaceSync?;
|
|
49
46
|
private readonly _instanceId;
|
|
50
|
-
constructor(storage: Storage, level: LevelDB, networkManager: NetworkManager, signalManager: SignalManager, _runtimeParams?:
|
|
47
|
+
constructor(storage: Storage, level: LevelDB, networkManager: NetworkManager, signalManager: SignalManager, _runtimeParams?: (IdentityManagerRuntimeParams & DataSpaceManagerRuntimeParams) | undefined);
|
|
51
48
|
protected _open(ctx: Context): Promise<void>;
|
|
52
49
|
protected _close(ctx: Context): Promise<void>;
|
|
53
50
|
createIdentity(params?: CreateIdentityOptions): Promise<import("../identity").Identity>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-context.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/services/service-context.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGlD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAiB,MAAM,qBAAqB,CAAC;AAChG,OAAO,EAAe,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AACxE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,6CAA6C,CAAC;AACpG,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,
|
|
1
|
+
{"version":3,"file":"service-context.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/services/service-context.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGlD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OA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E,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,QAAQ,EAAE,QAAQ,CAAC;IAG5B,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IAE3C,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAG9B;IAEJ,OAAO,CAAC,gBAAgB,CAAC,CAAsB;IAE/C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA8B;gBAGxC,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,OAAO,EACd,cAAc,EAAE,cAAc,EAC9B,aAAa,EAAE,aAAa,EAC5B,cAAc,CAAC,4EAA8D;cA+DtE,KAAK,CAAC,GAAG,EAAE,OAAO;cAuBlB,MAAM,CAAC,GAAG,EAAE,OAAO;IAgBtC,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;CAgE1B"}
|
|
@@ -31,11 +31,10 @@ export type PerformInvitationParams = {
|
|
|
31
31
|
guest?: PerformInvitationCallbacks<AuthenticatingInvitation>;
|
|
32
32
|
};
|
|
33
33
|
guestDeviceProfile?: DeviceProfileDocument;
|
|
34
|
-
codeInputDelay?: number;
|
|
35
34
|
};
|
|
36
35
|
export type Result = {
|
|
37
36
|
invitation?: Invitation;
|
|
38
37
|
error?: Error;
|
|
39
38
|
};
|
|
40
|
-
export declare const performInvitation: ({ host, guest, options, hooks, guestDeviceProfile,
|
|
39
|
+
export declare const performInvitation: ({ host, guest, options, hooks, guestDeviceProfile, }: PerformInvitationParams) => [Promise<Result>, Promise<Result>];
|
|
41
40
|
//# sourceMappingURL=invitation-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invitation-utils.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/testing/invitation-utils.ts"],"names":[],"mappings":"AAKA,OAAO,EAAqB,KAAK,wBAAwB,EAAE,KAAK,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAErH,OAAO,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AACxE,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AAEzF,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C;;GAEG;AACH,eAAO,MAAM,kBAAkB,eAAgB,UAAU,KAAG,UAE3D,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,qBAAqB,CAAC;CAC7D,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,EAAE,aAAa,CAAC,EAAE,qBAAqB,GAAG,wBAAwB,CAAC;CACxG,CAAC;AAEF,MAAM,MAAM,0BAA0B,CAAC,CAAC,IAAI;IAC1C,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,GAAG,IAAI,CAAC;IAC5C,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,GAAG,IAAI,CAAC;IAC3C,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,GAAG,IAAI,CAAC;IACvC,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,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