@dxos/client-services 0.7.5-staging.b81e783 → 0.8.0
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-BOYWFK2U.mjs → chunk-25OL3JVO.mjs} +21 -21
- package/dist/lib/browser/chunk-25OL3JVO.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +1 -1
- package/dist/lib/node/{chunk-LWLCZ5YB.cjs → chunk-FELZPQQE.cjs} +24 -24
- package/dist/lib/node/chunk-FELZPQQE.cjs.map +7 -0
- package/dist/lib/node/index.cjs +47 -47
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +8 -8
- package/dist/lib/node-esm/{chunk-IUVDCT7O.mjs → chunk-ORQYMDJN.mjs} +21 -21
- package/dist/lib/node-esm/chunk-ORQYMDJN.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +1 -1
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +1 -1
- package/dist/types/src/packlets/identity/identity-recovery-manager.d.ts +2 -2
- package/dist/types/src/packlets/identity/identity-recovery-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity-service.d.ts +2 -2
- package/dist/types/src/packlets/services/service-host.d.ts +1 -1
- package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/dist/types/src/version.d.ts.map +1 -1
- package/package.json +38 -38
- package/src/packlets/identity/identity-recovery-manager.ts +14 -6
- package/src/packlets/spaces/data-space.ts +2 -2
- package/src/version.ts +5 -1
- package/dist/lib/browser/chunk-BOYWFK2U.mjs.map +0 -7
- package/dist/lib/node/chunk-LWLCZ5YB.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-IUVDCT7O.mjs.map +0 -7
|
@@ -32,7 +32,7 @@ __export(testing_exports, {
|
|
|
32
32
|
sanitizeInvitation: () => sanitizeInvitation
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(testing_exports);
|
|
35
|
-
var
|
|
35
|
+
var import_chunk_FELZPQQE = require("../chunk-FELZPQQE.cjs");
|
|
36
36
|
var import_credentials = require("@dxos/credentials");
|
|
37
37
|
var import_keys = require("@dxos/keys");
|
|
38
38
|
var import_async = require("@dxos/async");
|
|
@@ -235,7 +235,7 @@ var createInvitation = async (host, options) => {
|
|
|
235
235
|
authMethod: import_services.Invitation.AuthMethod.NONE,
|
|
236
236
|
...options ?? {}
|
|
237
237
|
};
|
|
238
|
-
if (host instanceof
|
|
238
|
+
if (host instanceof import_chunk_FELZPQQE.ServiceContext) {
|
|
239
239
|
return host.invitationsManager.createInvitation({
|
|
240
240
|
kind: import_services.Invitation.Kind.SPACE,
|
|
241
241
|
...options
|
|
@@ -245,7 +245,7 @@ var createInvitation = async (host, options) => {
|
|
|
245
245
|
};
|
|
246
246
|
var acceptInvitation = (guest, invitation, guestDeviceProfile) => {
|
|
247
247
|
invitation = sanitizeInvitation(invitation);
|
|
248
|
-
if (guest instanceof
|
|
248
|
+
if (guest instanceof import_chunk_FELZPQQE.ServiceContext) {
|
|
249
249
|
return guest.invitationsManager.acceptInvitation({
|
|
250
250
|
invitation,
|
|
251
251
|
deviceProfile: guestDeviceProfile
|
|
@@ -255,7 +255,7 @@ var acceptInvitation = (guest, invitation, guestDeviceProfile) => {
|
|
|
255
255
|
};
|
|
256
256
|
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/testing/test-builder.ts";
|
|
257
257
|
var createServiceHost = (config, signalManagerContext) => {
|
|
258
|
-
return new
|
|
258
|
+
return new import_chunk_FELZPQQE.ClientServicesHost({
|
|
259
259
|
config,
|
|
260
260
|
signalManager: new import_messaging.MemorySignalManager(signalManagerContext),
|
|
261
261
|
transportFactory: import_network_manager.MemoryTransportFactory
|
|
@@ -274,7 +274,7 @@ var createServiceContext = async ({ signalManagerFactory = async () => {
|
|
|
274
274
|
});
|
|
275
275
|
const level = (0, import_testing.createTestLevel)();
|
|
276
276
|
await level.open();
|
|
277
|
-
return new
|
|
277
|
+
return new import_chunk_FELZPQQE.ServiceContext(storage, level, networkManager, signalManager, void 0, void 0, {
|
|
278
278
|
invitationConnectionDefaultParams: {
|
|
279
279
|
teleport: {
|
|
280
280
|
controlHeartbeatInterval: 200
|
|
@@ -385,7 +385,7 @@ var TestPeer = class {
|
|
|
385
385
|
return this._props.meshEchoReplicator ??= new import_echo_pipeline.MeshEchoReplicator();
|
|
386
386
|
}
|
|
387
387
|
get dataSpaceManager() {
|
|
388
|
-
return this._props.dataSpaceManager ??= new
|
|
388
|
+
return this._props.dataSpaceManager ??= new import_chunk_FELZPQQE.DataSpaceManager({
|
|
389
389
|
spaceManager: this.spaceManager,
|
|
390
390
|
metadataStore: this.metadataStore,
|
|
391
391
|
keyring: this.keyring,
|
|
@@ -400,9 +400,9 @@ var TestPeer = class {
|
|
|
400
400
|
});
|
|
401
401
|
}
|
|
402
402
|
get invitationsManager() {
|
|
403
|
-
return this._props.invitationsManager ??= new
|
|
403
|
+
return this._props.invitationsManager ??= new import_chunk_FELZPQQE.InvitationsManager(new import_chunk_FELZPQQE.InvitationsHandler(this.networkManager), (invitation) => {
|
|
404
404
|
if (invitation.kind === import_services2.Invitation.Kind.SPACE) {
|
|
405
|
-
return new
|
|
405
|
+
return new import_chunk_FELZPQQE.SpaceInvitationProtocol(this.dataSpaceManager, this.identity, this.keyring, invitation.spaceKey);
|
|
406
406
|
} else {
|
|
407
407
|
throw new Error("not implemented");
|
|
408
408
|
}
|
|
@@ -397,7 +397,7 @@ import { SpaceMember } from "@dxos/protocols/proto/dxos/client/services";
|
|
|
397
397
|
import { TRACE_PROCESSOR } from "@dxos/tracing";
|
|
398
398
|
|
|
399
399
|
// packages/sdk/client-services/src/version.ts
|
|
400
|
-
var DXOS_VERSION = "0.
|
|
400
|
+
var DXOS_VERSION = "0.8.0";
|
|
401
401
|
|
|
402
402
|
// packages/sdk/client-services/src/packlets/services/platform.ts
|
|
403
403
|
import { Platform } from "@dxos/protocols/proto/dxos/client/services";
|
|
@@ -7285,7 +7285,7 @@ var EdgeIdentityRecoveryManager = class {
|
|
|
7285
7285
|
this._identityProvider = _identityProvider;
|
|
7286
7286
|
this._acceptRecoveredIdentity = _acceptRecoveredIdentity;
|
|
7287
7287
|
}
|
|
7288
|
-
async createRecoveryCredential({
|
|
7288
|
+
async createRecoveryCredential({ data }) {
|
|
7289
7289
|
const identity = this._identityProvider();
|
|
7290
7290
|
invariant20(identity, void 0, {
|
|
7291
7291
|
F: __dxlog_file26,
|
|
@@ -7296,22 +7296,21 @@ var EdgeIdentityRecoveryManager = class {
|
|
|
7296
7296
|
""
|
|
7297
7297
|
]
|
|
7298
7298
|
});
|
|
7299
|
+
let recoveryKey;
|
|
7300
|
+
let lookupKey;
|
|
7301
|
+
let algorithm;
|
|
7299
7302
|
let recoveryCode;
|
|
7300
|
-
if (
|
|
7303
|
+
if (data) {
|
|
7304
|
+
recoveryKey = data.recoveryKey;
|
|
7305
|
+
lookupKey = data.lookupKey;
|
|
7306
|
+
algorithm = data.algorithm;
|
|
7307
|
+
} else {
|
|
7301
7308
|
recoveryCode = generateSeedPhrase();
|
|
7302
7309
|
const keypair = keyPairFromSeedPhrase(recoveryCode);
|
|
7303
7310
|
recoveryKey = PublicKey14.from(keypair.publicKey);
|
|
7311
|
+
lookupKey = PublicKey14.from(keypair.publicKey);
|
|
7304
7312
|
algorithm = "ED25519";
|
|
7305
7313
|
}
|
|
7306
|
-
invariant20(algorithm, "Algorithm is required.", {
|
|
7307
|
-
F: __dxlog_file26,
|
|
7308
|
-
L: 47,
|
|
7309
|
-
S: this,
|
|
7310
|
-
A: [
|
|
7311
|
-
"algorithm",
|
|
7312
|
-
"'Algorithm is required.'"
|
|
7313
|
-
]
|
|
7314
|
-
});
|
|
7315
7314
|
const identityKey = identity.identityKey;
|
|
7316
7315
|
const credential = await identity.getIdentityCredentialSigner().createCredential({
|
|
7317
7316
|
subject: identityKey,
|
|
@@ -7319,7 +7318,8 @@ var EdgeIdentityRecoveryManager = class {
|
|
|
7319
7318
|
"@type": "dxos.halo.credentials.IdentityRecovery",
|
|
7320
7319
|
recoveryKey,
|
|
7321
7320
|
identityKey,
|
|
7322
|
-
algorithm
|
|
7321
|
+
algorithm,
|
|
7322
|
+
lookupKey
|
|
7323
7323
|
}
|
|
7324
7324
|
});
|
|
7325
7325
|
const receipt = await identity.controlPipeline.writer.write({
|
|
@@ -7340,7 +7340,7 @@ var EdgeIdentityRecoveryManager = class {
|
|
|
7340
7340
|
async requestRecoveryChallenge() {
|
|
7341
7341
|
invariant20(this._edgeClient, "Not connected to EDGE.", {
|
|
7342
7342
|
F: __dxlog_file26,
|
|
7343
|
-
L:
|
|
7343
|
+
L: 74,
|
|
7344
7344
|
S: this,
|
|
7345
7345
|
A: [
|
|
7346
7346
|
"this._edgeClient",
|
|
@@ -7367,10 +7367,10 @@ var EdgeIdentityRecoveryManager = class {
|
|
|
7367
7367
|
};
|
|
7368
7368
|
}
|
|
7369
7369
|
}
|
|
7370
|
-
async recoverIdentityWithExternalSignature({
|
|
7370
|
+
async recoverIdentityWithExternalSignature({ lookupKey, deviceKey, controlFeedKey, signature, clientDataJson, authenticatorData }) {
|
|
7371
7371
|
invariant20(this._edgeClient, "Not connected to EDGE.", {
|
|
7372
7372
|
F: __dxlog_file26,
|
|
7373
|
-
L:
|
|
7373
|
+
L: 106,
|
|
7374
7374
|
S: this,
|
|
7375
7375
|
A: [
|
|
7376
7376
|
"this._edgeClient",
|
|
@@ -7378,7 +7378,7 @@ var EdgeIdentityRecoveryManager = class {
|
|
|
7378
7378
|
]
|
|
7379
7379
|
});
|
|
7380
7380
|
const request = {
|
|
7381
|
-
|
|
7381
|
+
lookupKey: lookupKey.toHex(),
|
|
7382
7382
|
deviceKey: deviceKey.toHex(),
|
|
7383
7383
|
controlFeedKey: controlFeedKey.toHex(),
|
|
7384
7384
|
signature: clientDataJson && authenticatorData ? {
|
|
@@ -7401,7 +7401,7 @@ var EdgeIdentityRecoveryManager = class {
|
|
|
7401
7401
|
async recoverIdentity({ recoveryCode }) {
|
|
7402
7402
|
invariant20(this._edgeClient, "Not connected to EDGE.", {
|
|
7403
7403
|
F: __dxlog_file26,
|
|
7404
|
-
L:
|
|
7404
|
+
L: 136,
|
|
7405
7405
|
S: this,
|
|
7406
7406
|
A: [
|
|
7407
7407
|
"this._edgeClient",
|
|
@@ -7413,7 +7413,7 @@ var EdgeIdentityRecoveryManager = class {
|
|
|
7413
7413
|
const deviceKey = await this._keyring.createKey();
|
|
7414
7414
|
const controlFeedKey = await this._keyring.createKey();
|
|
7415
7415
|
const request = {
|
|
7416
|
-
|
|
7416
|
+
lookupKey: recoveryKey.toHex(),
|
|
7417
7417
|
deviceKey: deviceKey.toHex(),
|
|
7418
7418
|
controlFeedKey: controlFeedKey.toHex()
|
|
7419
7419
|
};
|
|
@@ -7432,7 +7432,7 @@ var EdgeIdentityRecoveryManager = class {
|
|
|
7432
7432
|
}
|
|
7433
7433
|
log22.info("recovering identity", response, {
|
|
7434
7434
|
F: __dxlog_file26,
|
|
7435
|
-
L:
|
|
7435
|
+
L: 162,
|
|
7436
7436
|
S: this,
|
|
7437
7437
|
C: (f, a) => f(...a)
|
|
7438
7438
|
});
|
|
@@ -9034,4 +9034,4 @@ export {
|
|
|
9034
9034
|
importProfileData,
|
|
9035
9035
|
ClientServicesHost
|
|
9036
9036
|
};
|
|
9037
|
-
//# sourceMappingURL=chunk-
|
|
9037
|
+
//# sourceMappingURL=chunk-ORQYMDJN.mjs.map
|