@dxos/client-services 0.4.10-main.c75170d → 0.4.10-main.c8e5c39
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-JP7F2IH3.mjs → chunk-7OKNHCYB.mjs} +425 -410
- package/dist/lib/browser/chunk-7OKNHCYB.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +6 -4
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/packlets/testing/index.mjs +131 -116
- package/dist/lib/browser/packlets/testing/index.mjs.map +3 -3
- package/dist/lib/node/{chunk-34EZSH65.cjs → chunk-5JA576YH.cjs} +527 -508
- package/dist/lib/node/chunk-5JA576YH.cjs.map +7 -0
- package/dist/lib/node/index.cjs +48 -46
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/packlets/testing/index.cjs +130 -118
- package/dist/lib/node/packlets/testing/index.cjs.map +3 -3
- package/dist/types/src/packlets/identity/identity-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/device-invitation-protocol.d.ts +3 -1
- package/dist/types/src/packlets/invitations/device-invitation-protocol.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitation-protocol.d.ts +6 -1
- package/dist/types/src/packlets/invitations/invitation-protocol.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitations-handler.d.ts +4 -2
- package/dist/types/src/packlets/invitations/invitations-handler.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitations-manager.d.ts +9 -7
- package/dist/types/src/packlets/invitations/invitations-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitations-service.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/space-invitation-protocol.d.ts +2 -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 +4 -6
- package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts +8 -3
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space.d.ts +4 -3
- package/dist/types/src/packlets/spaces/data-space.d.ts.map +1 -1
- package/dist/types/src/packlets/storage/level.d.ts.map +1 -1
- package/dist/types/src/packlets/testing/invitation-utils.d.ts.map +1 -1
- package/dist/types/src/packlets/testing/test-builder.d.ts +7 -3
- package/dist/types/src/packlets/testing/test-builder.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/worker-runtime.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/package.json +34 -34
- package/src/packlets/identity/identity-manager.ts +1 -0
- package/src/packlets/identity/identity.test.ts +3 -0
- package/src/packlets/invitations/device-invitation-protocol.ts +6 -1
- package/src/packlets/invitations/invitation-protocol.ts +7 -1
- package/src/packlets/invitations/invitations-handler.ts +10 -71
- package/src/packlets/invitations/invitations-manager.ts +114 -40
- package/src/packlets/invitations/invitations-service.ts +4 -2
- package/src/packlets/invitations/space-invitation-protocol.ts +45 -3
- package/src/packlets/services/automerge-host.test.ts +4 -4
- package/src/packlets/services/service-context.test.ts +3 -3
- package/src/packlets/services/service-context.ts +12 -25
- package/src/packlets/services/service-host.test.ts +6 -0
- package/src/packlets/services/service-host.ts +5 -16
- package/src/packlets/spaces/data-space-manager.test.ts +4 -4
- package/src/packlets/spaces/data-space-manager.ts +56 -13
- package/src/packlets/spaces/data-space.ts +14 -19
- package/src/packlets/storage/level.ts +1 -0
- package/src/packlets/testing/invitation-utils.ts +100 -97
- package/src/packlets/testing/test-builder.ts +27 -14
- package/src/packlets/vault/worker-runtime.ts +3 -1
- package/src/version.ts +1 -1
- package/dist/lib/browser/chunk-JP7F2IH3.mjs.map +0 -7
- package/dist/lib/node/chunk-34EZSH65.cjs.map +0 -7
- package/dist/types/src/packlets/indexing/index.d.ts +0 -2
- package/dist/types/src/packlets/indexing/index.d.ts.map +0 -1
- package/dist/types/src/packlets/indexing/util.d.ts +0 -16
- package/dist/types/src/packlets/indexing/util.d.ts.map +0 -1
- package/src/packlets/indexing/index.ts +0 -5
- package/src/packlets/indexing/util.ts +0 -89
|
@@ -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_5JA576YH = require("../../chunk-5JA576YH.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");
|
|
@@ -40,12 +40,14 @@ var import_services = require("@dxos/protocols/proto/dxos/client/services");
|
|
|
40
40
|
var import_context = require("@dxos/context");
|
|
41
41
|
var import_credentials2 = require("@dxos/credentials");
|
|
42
42
|
var import_debug = require("@dxos/debug");
|
|
43
|
+
var import_echo_db = require("@dxos/echo-db");
|
|
43
44
|
var import_echo_pipeline = require("@dxos/echo-pipeline");
|
|
44
45
|
var import_testing = require("@dxos/echo-pipeline/testing");
|
|
45
46
|
var import_feed_store = require("@dxos/feed-store");
|
|
46
47
|
var import_keyring = require("@dxos/keyring");
|
|
47
48
|
var import_messaging = require("@dxos/messaging");
|
|
48
49
|
var import_network_manager = require("@dxos/network-manager");
|
|
50
|
+
var import_services2 = require("@dxos/protocols/proto/dxos/client/services");
|
|
49
51
|
var import_random_access_storage = require("@dxos/random-access-storage");
|
|
50
52
|
var import_teleport_extension_object_sync = require("@dxos/teleport-extension-object-sync");
|
|
51
53
|
var createMockCredential = async ({ signer, issuer }) => (0, import_credentials.createCredential)({
|
|
@@ -68,134 +70,135 @@ var performInvitation = ({ host, guest, options, hooks, guestDeviceProfile }) =>
|
|
|
68
70
|
const hostComplete = new import_async.Trigger();
|
|
69
71
|
const guestComplete = new import_async.Trigger();
|
|
70
72
|
const authCode = new import_async.Trigger();
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
73
|
+
void createInvitation(host, options).then((hostObservable) => {
|
|
74
|
+
hostObservable.subscribe(async (hostInvitation) => {
|
|
75
|
+
switch (hostInvitation.state) {
|
|
76
|
+
case import_services.Invitation.State.CONNECTING: {
|
|
77
|
+
if (hooks?.host?.onConnecting?.(hostObservable)) {
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
const guestObservable = acceptInvitation(guest, hostInvitation, guestDeviceProfile);
|
|
81
|
+
guestObservable.subscribe(async (guestInvitation) => {
|
|
82
|
+
switch (guestInvitation.state) {
|
|
83
|
+
case import_services.Invitation.State.CONNECTING: {
|
|
84
|
+
if (hooks?.guest?.onConnecting?.(guestObservable)) {
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
(0, import_invariant.invariant)(hostInvitation.swarmKey.equals(guestInvitation.swarmKey), void 0, {
|
|
88
|
+
F: __dxlog_file,
|
|
89
|
+
L: 79,
|
|
90
|
+
S: void 0,
|
|
91
|
+
A: [
|
|
92
|
+
"hostInvitation.swarmKey!.equals(guestInvitation.swarmKey!)",
|
|
93
|
+
""
|
|
94
|
+
]
|
|
95
|
+
});
|
|
83
96
|
break;
|
|
84
97
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
L: 79,
|
|
88
|
-
S: void 0,
|
|
89
|
-
A: [
|
|
90
|
-
"hostInvitation.swarmKey!.equals(guestInvitation.swarmKey!)",
|
|
91
|
-
""
|
|
92
|
-
]
|
|
93
|
-
});
|
|
94
|
-
break;
|
|
95
|
-
}
|
|
96
|
-
case import_services.Invitation.State.CONNECTED: {
|
|
97
|
-
hooks?.guest?.onConnected?.(guestObservable);
|
|
98
|
-
break;
|
|
99
|
-
}
|
|
100
|
-
case import_services.Invitation.State.READY_FOR_AUTHENTICATION: {
|
|
101
|
-
if (hooks?.guest?.onReady?.(guestObservable)) {
|
|
98
|
+
case import_services.Invitation.State.CONNECTED: {
|
|
99
|
+
hooks?.guest?.onConnected?.(guestObservable);
|
|
102
100
|
break;
|
|
103
101
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
break;
|
|
110
|
-
}
|
|
111
|
-
case import_services.Invitation.State.SUCCESS: {
|
|
112
|
-
if (hooks?.guest?.onSuccess?.(guestObservable)) {
|
|
102
|
+
case import_services.Invitation.State.READY_FOR_AUTHENTICATION: {
|
|
103
|
+
if (hooks?.guest?.onReady?.(guestObservable)) {
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
await guestObservable.authenticate(await authCode.wait());
|
|
113
107
|
break;
|
|
114
108
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
});
|
|
118
|
-
break;
|
|
119
|
-
}
|
|
120
|
-
case import_services.Invitation.State.CANCELLED: {
|
|
121
|
-
if (hooks?.guest?.onCancelled?.(guestObservable)) {
|
|
109
|
+
case import_services.Invitation.State.AUTHENTICATING: {
|
|
110
|
+
hooks?.guest?.onAuthenticating?.(guestObservable);
|
|
122
111
|
break;
|
|
123
112
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
113
|
+
case import_services.Invitation.State.SUCCESS: {
|
|
114
|
+
if (hooks?.guest?.onSuccess?.(guestObservable)) {
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
guestComplete.wake({
|
|
118
|
+
invitation: guestInvitation
|
|
119
|
+
});
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
case import_services.Invitation.State.CANCELLED: {
|
|
123
|
+
if (hooks?.guest?.onCancelled?.(guestObservable)) {
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
guestComplete.wake({
|
|
127
|
+
invitation: guestInvitation
|
|
128
|
+
});
|
|
129
|
+
break;
|
|
130
|
+
}
|
|
131
|
+
case import_services.Invitation.State.TIMEOUT: {
|
|
132
|
+
if (hooks?.guest?.onTimeout?.(guestObservable)) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
guestComplete.wake({
|
|
136
|
+
invitation: guestInvitation
|
|
137
|
+
});
|
|
132
138
|
}
|
|
133
|
-
guestComplete.wake({
|
|
134
|
-
invitation: guestInvitation
|
|
135
|
-
});
|
|
136
139
|
}
|
|
140
|
+
}, (error) => {
|
|
141
|
+
if (hooks?.guest?.onError?.(guestObservable)) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
guestComplete.wake({
|
|
145
|
+
error
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
break;
|
|
149
|
+
}
|
|
150
|
+
case import_services.Invitation.State.CONNECTED: {
|
|
151
|
+
hooks?.host?.onConnected?.(hostObservable);
|
|
152
|
+
break;
|
|
153
|
+
}
|
|
154
|
+
case import_services.Invitation.State.READY_FOR_AUTHENTICATION: {
|
|
155
|
+
if (hooks?.host?.onReady?.(hostObservable)) {
|
|
156
|
+
break;
|
|
137
157
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
return;
|
|
158
|
+
if (hostInvitation.authCode) {
|
|
159
|
+
authCode.wake(hostInvitation.authCode);
|
|
141
160
|
}
|
|
142
|
-
guestComplete.wake({
|
|
143
|
-
error
|
|
144
|
-
});
|
|
145
|
-
});
|
|
146
|
-
break;
|
|
147
|
-
}
|
|
148
|
-
case import_services.Invitation.State.CONNECTED: {
|
|
149
|
-
hooks?.host?.onConnected?.(hostObservable);
|
|
150
|
-
break;
|
|
151
|
-
}
|
|
152
|
-
case import_services.Invitation.State.READY_FOR_AUTHENTICATION: {
|
|
153
|
-
if (hooks?.host?.onReady?.(hostObservable)) {
|
|
154
161
|
break;
|
|
155
162
|
}
|
|
156
|
-
|
|
157
|
-
|
|
163
|
+
case import_services.Invitation.State.AUTHENTICATING: {
|
|
164
|
+
hooks?.host?.onAuthenticating?.(hostObservable);
|
|
165
|
+
break;
|
|
158
166
|
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
if (hooks?.host?.onSuccess?.(hostObservable)) {
|
|
167
|
+
case import_services.Invitation.State.SUCCESS: {
|
|
168
|
+
if (hooks?.host?.onSuccess?.(hostObservable)) {
|
|
169
|
+
break;
|
|
170
|
+
}
|
|
171
|
+
hostComplete.wake({
|
|
172
|
+
invitation: hostInvitation
|
|
173
|
+
});
|
|
167
174
|
break;
|
|
168
175
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
+
case import_services.Invitation.State.CANCELLED: {
|
|
177
|
+
if (hooks?.host?.onCancelled?.(hostObservable)) {
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
180
|
+
hostComplete.wake({
|
|
181
|
+
invitation: hostInvitation
|
|
182
|
+
});
|
|
176
183
|
break;
|
|
177
184
|
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
+
case import_services.Invitation.State.TIMEOUT: {
|
|
186
|
+
if (hooks?.host?.onTimeout?.(hostObservable)) {
|
|
187
|
+
break;
|
|
188
|
+
}
|
|
189
|
+
hostComplete.wake({
|
|
190
|
+
invitation: hostInvitation
|
|
191
|
+
});
|
|
185
192
|
break;
|
|
186
193
|
}
|
|
187
|
-
hostComplete.wake({
|
|
188
|
-
invitation: hostInvitation
|
|
189
|
-
});
|
|
190
|
-
break;
|
|
191
194
|
}
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
195
|
+
}, (error) => {
|
|
196
|
+
if (hooks?.host?.onError?.(hostObservable)) {
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
hostComplete.wake({
|
|
200
|
+
error
|
|
201
|
+
});
|
|
199
202
|
});
|
|
200
203
|
});
|
|
201
204
|
return [
|
|
@@ -203,23 +206,22 @@ var performInvitation = ({ host, guest, options, hooks, guestDeviceProfile }) =>
|
|
|
203
206
|
guestComplete.wait()
|
|
204
207
|
];
|
|
205
208
|
};
|
|
206
|
-
var createInvitation = (host, options) => {
|
|
209
|
+
var createInvitation = async (host, options) => {
|
|
207
210
|
options ??= {
|
|
208
211
|
authMethod: import_services.Invitation.AuthMethod.NONE,
|
|
209
212
|
...options ?? {}
|
|
210
213
|
};
|
|
211
|
-
if (host instanceof
|
|
212
|
-
|
|
214
|
+
if (host instanceof import_chunk_5JA576YH.ServiceContext) {
|
|
215
|
+
return host.invitationsManager.createInvitation({
|
|
213
216
|
kind: import_services.Invitation.Kind.SPACE,
|
|
214
217
|
...options
|
|
215
218
|
});
|
|
216
|
-
return host.invitations.createInvitation(hostHandler, options);
|
|
217
219
|
}
|
|
218
220
|
return host.share(options);
|
|
219
221
|
};
|
|
220
222
|
var acceptInvitation = (guest, invitation, guestDeviceProfile) => {
|
|
221
223
|
invitation = sanitizeInvitation(invitation);
|
|
222
|
-
if (guest instanceof
|
|
224
|
+
if (guest instanceof import_chunk_5JA576YH.ServiceContext) {
|
|
223
225
|
const guestHandler = guest.getInvitationHandler({
|
|
224
226
|
kind: invitation.kind
|
|
225
227
|
});
|
|
@@ -228,7 +230,7 @@ var acceptInvitation = (guest, invitation, guestDeviceProfile) => {
|
|
|
228
230
|
return guest.join(invitation, guestDeviceProfile);
|
|
229
231
|
};
|
|
230
232
|
var createServiceHost = (config, signalManagerContext) => {
|
|
231
|
-
return new
|
|
233
|
+
return new import_chunk_5JA576YH.ClientServicesHost({
|
|
232
234
|
config,
|
|
233
235
|
signalManager: new import_messaging.MemorySignalManager(signalManagerContext),
|
|
234
236
|
transportFactory: import_network_manager.MemoryTransportFactory
|
|
@@ -244,7 +246,7 @@ var createServiceContext = async ({ signalContext = new import_messaging.MemoryS
|
|
|
244
246
|
});
|
|
245
247
|
const level = (0, import_testing.createTestLevel)();
|
|
246
248
|
await level.open();
|
|
247
|
-
return new
|
|
249
|
+
return new import_chunk_5JA576YH.ServiceContext(storage, level, networkManager, signalManager);
|
|
248
250
|
};
|
|
249
251
|
var createPeers = async (numPeers) => {
|
|
250
252
|
const signalContext = new import_messaging.MemorySignalManagerContext();
|
|
@@ -334,13 +336,23 @@ var TestPeer = class {
|
|
|
334
336
|
get identity() {
|
|
335
337
|
return this._props.signingContext ?? (0, import_debug.failUndefined)();
|
|
336
338
|
}
|
|
337
|
-
get
|
|
338
|
-
return this._props.
|
|
339
|
-
|
|
339
|
+
get echoHost() {
|
|
340
|
+
return this._props.echoHost ??= new import_echo_db.EchoHost({
|
|
341
|
+
kv: this.level,
|
|
342
|
+
storage: this.storage
|
|
340
343
|
});
|
|
341
344
|
}
|
|
342
345
|
get dataSpaceManager() {
|
|
343
|
-
return this._props.dataSpaceManager ??= new
|
|
346
|
+
return this._props.dataSpaceManager ??= new import_chunk_5JA576YH.DataSpaceManager(this.spaceManager, this.metadataStore, this.keyring, this.identity, this.feedStore, this.echoHost, this.invitationsManager);
|
|
347
|
+
}
|
|
348
|
+
get invitationsManager() {
|
|
349
|
+
return this._props.invitationsManager ??= new import_chunk_5JA576YH.InvitationsManager(new import_chunk_5JA576YH.InvitationsHandler(this.networkManager), (invitation) => {
|
|
350
|
+
if (invitation.kind === import_services2.Invitation.Kind.SPACE) {
|
|
351
|
+
return new import_chunk_5JA576YH.SpaceInvitationProtocol(this.dataSpaceManager, this.identity, this.keyring, invitation.spaceKey);
|
|
352
|
+
} else {
|
|
353
|
+
throw new Error("not implemented");
|
|
354
|
+
}
|
|
355
|
+
}, this.metadataStore);
|
|
344
356
|
}
|
|
345
357
|
async createIdentity() {
|
|
346
358
|
this._props.signingContext ??= await createSigningContext(this.keyring);
|
|
@@ -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 {\n AutomergeHost,\n MetadataStore,\n type LevelDB,\n SnapshotStore,\n SpaceManager,\n valueEncoding,\n} from '@dxos/echo-pipeline';\nimport { createTestLevel } from '@dxos/echo-pipeline/testing';\nimport { FeedFactory, FeedStore } from '@dxos/feed-store';\nimport { Keyring } from '@dxos/keyring';\nimport { MemorySignalManager, MemorySignalManagerContext } from '@dxos/messaging';\nimport { MemoryTransportFactory, NetworkManager } from '@dxos/network-manager';\nimport { createStorage, StorageType, type Storage } from '@dxos/random-access-storage';\nimport { BlobStore } from '@dxos/teleport-extension-object-sync';\n\nimport { ClientServicesHost, ServiceContext } from '../services';\nimport { DataSpaceManager, type SigningContext } from '../spaces';\n\n//\n// TODO(burdon): Replace with test builder.\n//\n\nexport const createServiceHost = (config: Config, signalManagerContext: MemorySignalManagerContext) => {\n return new ClientServicesHost({\n config,\n signalManager: new MemorySignalManager(signalManagerContext),\n transportFactory: MemoryTransportFactory,\n });\n};\n\nexport const createServiceContext = async ({\n signalContext = new MemorySignalManagerContext(),\n storage = createStorage({ type: StorageType.RAM }),\n}: {\n signalContext?: MemorySignalManagerContext;\n storage?: Storage;\n} = {}) => {\n const signalManager = new MemorySignalManager(signalContext);\n const networkManager = new NetworkManager({\n signalManager,\n transportFactory: MemoryTransportFactory,\n });\n const level = createTestLevel();\n await level.open();\n\n return new ServiceContext(storage, level, networkManager, signalManager);\n};\n\nexport const createPeers = async (numPeers: number) => {\n const signalContext = new MemorySignalManagerContext();\n\n return await Promise.all(\n Array.from(Array(numPeers)).map(async () => {\n const peer = await createServiceContext({ signalContext });\n await peer.open(new Context());\n return peer;\n }),\n );\n};\n\nexport const createIdentity = async (peer: ServiceContext) => {\n await peer.createIdentity();\n return peer;\n};\n\nexport class TestBuilder {\n public readonly signalContext = new MemorySignalManagerContext();\n private readonly _ctx = new Context();\n\n createPeer(peerOptions?: TestPeerOpts): TestPeer {\n const peer = new TestPeer(this.signalContext, peerOptions);\n this._ctx.onDispose(async () => peer.destroy());\n return peer;\n }\n\n async destroy() {\n await this._ctx.dispose();\n }\n}\n\nexport type TestPeerOpts = {\n dataStore?: StorageType;\n};\n\nexport type TestPeerProps = {\n storage?: Storage;\n level?: LevelDB;\n feedStore?: FeedStore<any>;\n metadataStore?: MetadataStore;\n keyring?: Keyring;\n networkManager?: NetworkManager;\n spaceManager?: SpaceManager;\n dataSpaceManager?: DataSpaceManager;\n snapshotStore?: SnapshotStore;\n signingContext?: SigningContext;\n blobStore?: BlobStore;\n automergeHost?: AutomergeHost;\n};\n\nexport class TestPeer {\n private _props: TestPeerProps = {};\n\n constructor(\n private readonly signalContext: MemorySignalManagerContext,\n private readonly opts: TestPeerOpts = { dataStore: StorageType.RAM },\n ) {}\n\n get props() {\n return this._props;\n }\n\n get storage() {\n return (this._props.storage ??= createStorage({ type: this.opts.dataStore }));\n }\n\n get keyring() {\n return (this._props.keyring ??= new Keyring(this.storage.createDirectory('keyring')));\n }\n\n get level() {\n return (this._props.level ??= createTestLevel());\n }\n\n get feedStore() {\n return (this._props.feedStore ??= new FeedStore({\n factory: new FeedFactory({\n root: this.storage.createDirectory('feeds'),\n signer: this.keyring,\n hypercore: {\n valueEncoding,\n },\n }),\n }));\n }\n\n get metadataStore() {\n return (this._props.metadataStore ??= new MetadataStore(this.storage.createDirectory('metadata')));\n }\n\n get blobStore() {\n return (this._props.blobStore ??= new BlobStore(this.storage.createDirectory('blobs')));\n }\n\n get snapshotStore() {\n return (this._props.snapshotStore ??= new SnapshotStore(this.storage.createDirectory('snapshots')));\n }\n\n get networkManager() {\n return (this._props.networkManager ??= new NetworkManager({\n signalManager: new MemorySignalManager(this.signalContext),\n transportFactory: MemoryTransportFactory,\n }));\n }\n\n get spaceManager() {\n return (this._props.spaceManager ??= new SpaceManager({\n feedStore: this.feedStore,\n networkManager: this.networkManager,\n metadataStore: this.metadataStore,\n snapshotStore: this.snapshotStore,\n blobStore: this.blobStore,\n }));\n }\n\n get identity() {\n return this._props.signingContext ?? failUndefined();\n }\n\n get automergeHost() {\n return (this._props.automergeHost ??= new AutomergeHost({\n db: this.level.sublevel('automerge'),\n }));\n }\n\n get dataSpaceManager() {\n return (this._props.dataSpaceManager ??= new DataSpaceManager(\n this.spaceManager,\n this.metadataStore,\n this.keyring,\n this.identity,\n this.feedStore,\n this.automergeHost,\n ));\n }\n\n async createIdentity() {\n this._props.signingContext ??= await createSigningContext(this.keyring);\n }\n\n async destroy() {\n await this.level.close();\n await this.storage.reset();\n }\n}\n\nexport const createSigningContext = async (keyring: Keyring): Promise<SigningContext> => {\n const identityKey = await keyring.createKey();\n const deviceKey = await keyring.createKey();\n\n return {\n identityKey,\n deviceKey,\n credentialSigner: createCredentialSignerWithChain(\n keyring,\n {\n credential: await new CredentialGenerator(keyring, identityKey, deviceKey).createDeviceAuthorization(deviceKey),\n },\n deviceKey,\n ),\n recordCredential: async () => {}, // No-op.\n getProfile: () => undefined,\n };\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,yBAAiC;AAEjC,kBAA0B;ACF1B,mBAAwB;AACxB,6BAA6F;AAC7F,uBAA0B;AAC1B,sBAA2B;ACF3B,qBAAwB;AACxB,IAAAA,sBAAqE;AACrE,mBAA8B;AAC9B,
|
|
6
|
-
"names": ["import_credentials", "createMockCredential", "signer", "issuer", "createCredential", "subject", "PublicKey", "Buffer", "from", "assertion", "payload", "value", "sanitizeInvitation", "invitation", "InvitationEncoder", "decode", "encode", "performInvitation", "host", "guest", "options", "hooks", "guestDeviceProfile", "hostComplete", "Trigger", "guestComplete", "authCode", "
|
|
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, type LevelDB, SnapshotStore, SpaceManager, valueEncoding } from '@dxos/echo-pipeline';\nimport { createTestLevel } from '@dxos/echo-pipeline/testing';\nimport { FeedFactory, FeedStore } from '@dxos/feed-store';\nimport { Keyring } from '@dxos/keyring';\nimport { MemorySignalManager, MemorySignalManagerContext } from '@dxos/messaging';\nimport { MemoryTransportFactory, NetworkManager } from '@dxos/network-manager';\nimport { 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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AAQ;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
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity-manager.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/identity/identity-manager.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,YAAY,EAAsB,MAAM,qBAAqB,CAAC;AAChG,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGvC,OAAO,EAAE,MAAM,EAAc,MAAM,4CAA4C,CAAC;AAChF,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAExE,OA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,OAAO,CAAC,MAAM,CAAC;YA0B5D,kBAAkB;YAwDlB,eAAe;CAoB9B"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Keyring } from '@dxos/keyring';
|
|
2
|
+
import { type PublicKey } from '@dxos/keys';
|
|
2
3
|
import { AlreadyJoinedError } from '@dxos/protocols';
|
|
3
4
|
import { Invitation } from '@dxos/protocols/proto/dxos/client/services';
|
|
4
5
|
import type { DeviceProfileDocument } from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
@@ -12,7 +13,8 @@ export declare class DeviceInvitationProtocol implements InvitationProtocol {
|
|
|
12
13
|
constructor(_keyring: Keyring, _getIdentity: () => Identity, _acceptIdentity: (identity: JoinIdentityParams) => Promise<Identity>);
|
|
13
14
|
toJSON(): object;
|
|
14
15
|
getInvitationContext(): Partial<Invitation> & Pick<Invitation, 'kind'>;
|
|
15
|
-
|
|
16
|
+
delegate(invitation: Invitation): Promise<PublicKey>;
|
|
17
|
+
admit(_: Invitation, request: AdmissionRequest): Promise<AdmissionResponse>;
|
|
16
18
|
checkInvitation(invitation: Partial<Invitation>): AlreadyJoinedError | undefined;
|
|
17
19
|
createIntroduction(): IntroductionRequest;
|
|
18
20
|
createAdmissionRequest(deviceProfile?: DeviceProfileDocument): Promise<AdmissionRequest>;
|
|
@@ -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,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,KAAK,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,iBAAiB,CAAC;
|
|
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,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC;IAIpD,KAAK,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAejF,eAAe,CAAC,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC;IAW/C,kBAAkB,IAAI,mBAAmB;IAInC,sBAAsB,CAAC,aAAa,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAexF,MAAM,CAAC,QAAQ,EAAE,iBAAiB,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;CAsBnG"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type PublicKey } from '@dxos/keys';
|
|
1
2
|
import type { ApiError } from '@dxos/protocols';
|
|
2
3
|
import type { Invitation } from '@dxos/protocols/proto/dxos/client/services';
|
|
3
4
|
import type { ProfileDocument, DeviceProfileDocument } from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
@@ -14,7 +15,11 @@ export interface InvitationProtocol {
|
|
|
14
15
|
/**
|
|
15
16
|
* Once authentication is successful, the host can admit the guest to the requested resource.
|
|
16
17
|
*/
|
|
17
|
-
|
|
18
|
+
delegate(invitation: Invitation): Promise<PublicKey>;
|
|
19
|
+
/**
|
|
20
|
+
* Once authentication is successful, the host can admit the guest to the requested resource.
|
|
21
|
+
*/
|
|
22
|
+
admit(invitation: Invitation, request: AdmissionRequest, guestProfile?: ProfileDocument): Promise<AdmissionResponse>;
|
|
18
23
|
/**
|
|
19
24
|
* Check if the invitation is valid.
|
|
20
25
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invitation-protocol.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/invitations/invitation-protocol.ts"],"names":[],"mappings":"AAIA,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,KAAK,CAAC,OAAO,EAAE,gBAAgB,EAAE,YAAY,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;
|
|
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,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PushStream } from '@dxos/async';
|
|
2
|
+
import { AuthenticatingInvitation } from '@dxos/client-protocol';
|
|
3
|
+
import { Context } from '@dxos/context';
|
|
2
4
|
import { type AdmissionKeypair, Invitation } from '@dxos/protocols/proto/dxos/client/services';
|
|
3
5
|
import { type DeviceProfileDocument } from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
4
6
|
import { type InvitationProtocol } from './invitation-protocol';
|
|
@@ -31,7 +33,7 @@ import { type InvitationProtocol } from './invitation-protocol';
|
|
|
31
33
|
*/
|
|
32
34
|
export declare class InvitationsHandler {
|
|
33
35
|
private readonly _networkManager;
|
|
34
|
-
|
|
36
|
+
handleInvitationFlow(ctx: Context, stream: PushStream<Invitation>, protocol: InvitationProtocol, invitation: Invitation): void;
|
|
35
37
|
acceptInvitation(protocol: InvitationProtocol, invitation: Invitation, deviceProfile?: DeviceProfileDocument): AuthenticatingInvitation;
|
|
36
38
|
private _handleGuestOtpAuth;
|
|
37
39
|
private _handleGuestKpkAuth;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invitations-handler.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/invitations/invitations-handler.ts"],"names":[],"mappings":"
|
|
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,10 +1,10 @@
|
|
|
1
1
|
import { Event } from '@dxos/async';
|
|
2
|
-
import type
|
|
3
|
-
import {
|
|
2
|
+
import { type AuthenticatingInvitation, CancellableInvitation } from '@dxos/client-protocol';
|
|
3
|
+
import { Context } from '@dxos/context';
|
|
4
4
|
import { type MetadataStore } from '@dxos/echo-pipeline';
|
|
5
|
-
import { type AcceptInvitationRequest, type
|
|
5
|
+
import { type AcceptInvitationRequest, type AuthenticationRequest, Invitation } from '@dxos/protocols/proto/dxos/client/services';
|
|
6
6
|
import type { InvitationProtocol } from './invitation-protocol';
|
|
7
|
-
import type
|
|
7
|
+
import { type InvitationsHandler } from './invitations-handler';
|
|
8
8
|
/**
|
|
9
9
|
* Entry point for creating and accepting invitations, keeps track of existing invitation set and
|
|
10
10
|
* emits events when the set changes.
|
|
@@ -22,8 +22,8 @@ export declare class InvitationsManager {
|
|
|
22
22
|
readonly saved: Event<Invitation>;
|
|
23
23
|
private readonly _persistentInvitationsLoadedEvent;
|
|
24
24
|
private _persistentInvitationsLoaded;
|
|
25
|
-
constructor(_invitationsHandler: InvitationsHandler, _getHandler: (invitation: Invitation) => InvitationProtocol, _metadataStore: MetadataStore);
|
|
26
|
-
createInvitation(options: Invitation): CancellableInvitation
|
|
25
|
+
constructor(_invitationsHandler: InvitationsHandler, _getHandler: (invitation: Partial<Invitation> & Pick<Invitation, 'kind'>) => InvitationProtocol, _metadataStore: MetadataStore);
|
|
26
|
+
createInvitation(options: Partial<Invitation> & Pick<Invitation, 'kind'>): Promise<CancellableInvitation>;
|
|
27
27
|
loadPersistentInvitations(): Promise<{
|
|
28
28
|
invitations: Invitation[];
|
|
29
29
|
}>;
|
|
@@ -35,7 +35,9 @@ export declare class InvitationsManager {
|
|
|
35
35
|
getCreatedInvitations(): Invitation[];
|
|
36
36
|
getAcceptedInvitations(): Invitation[];
|
|
37
37
|
onPersistentInvitationsLoaded(ctx: Context, callback: () => void): void;
|
|
38
|
-
private
|
|
38
|
+
private _createInvitation;
|
|
39
|
+
private _createObservableInvitation;
|
|
40
|
+
private _persistIfRequired;
|
|
39
41
|
private _safeDeleteInvitation;
|
|
40
42
|
private _onInvitationComplete;
|
|
41
43
|
}
|
|
@@ -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;AAEpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAA0B,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAExF;;;GAGG;AACH,qBAAa,kBAAkB;IAc3B,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IACpC,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,cAAc;IAfjC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAA4C;IAC/E,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAA+C;IAElF,SAAgB,iBAAiB,oBAA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ings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,wBAAwB,EACzB,MAAM,4CAA4C,CAAC;AAEpD,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEhE;;GAEG;AACH,qBAAa,sBAAuB,YAAW,kBAAkB;IACnD,OAAO,CAAC,QAAQ,CAAC,mBAAmB;gBAAnB,mBAAmB,EAAE,kBAAkB;IAGpE,iBAAiB;IAMjB,gBAAgB,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"invitations-service.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/invitations/invitations-service.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,wBAAwB,EACzB,MAAM,4CAA4C,CAAC;AAEpD,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEhE;;GAEG;AACH,qBAAa,sBAAuB,YAAW,kBAAkB;IACnD,OAAO,CAAC,QAAQ,CAAC,mBAAmB;gBAAnB,mBAAmB,EAAE,kBAAkB;IAGpE,iBAAiB;IAMjB,gBAAgB,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;IASzD,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,MAAM,CAAC,UAAU,CAAC;IAOhE,YAAY,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3D,gBAAgB,CAAC,OAAO,EAAE;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAIxE,gBAAgB,IAAI,MAAM,CAAC,wBAAwB,CAAC;CAsErD"}
|