@dxos/client-services 0.1.58-main.fa022ee → 0.1.58-main.ffb4cc4
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-SNPC4XOB.mjs → chunk-RELEQQS5.mjs} +108 -78
- package/dist/lib/browser/chunk-RELEQQS5.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +5 -6
- package/dist/lib/browser/index.mjs.map +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/packlets/testing/index.mjs +3 -3
- package/dist/lib/browser/packlets/testing/index.mjs.map +3 -3
- package/dist/lib/node/index.cjs +109 -80
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/packlets/testing/index.cjs +107 -77
- package/dist/lib/node/packlets/testing/index.cjs.map +4 -4
- package/dist/types/src/packlets/devtools/devtools.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/authenticator.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/device-invitation-protocol.d.ts +1 -1
- package/dist/types/src/packlets/invitations/device-invitation-protocol.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/space-invitation-protocol.d.ts +1 -1
- package/dist/types/src/packlets/invitations/space-invitation-protocol.d.ts.map +1 -1
- package/dist/types/src/packlets/services/diagnostics.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-host.d.ts +1 -0
- package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space.d.ts +1 -1
- package/dist/types/src/packlets/spaces/data-space.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/spaces-service.d.ts +1 -1
- package/dist/types/src/packlets/spaces/spaces-service.d.ts.map +1 -1
- package/dist/types/src/packlets/testing/test-builder.d.ts +1 -1
- package/dist/types/src/packlets/testing/test-builder.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/iframe-host-runtime.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 +35 -34
- package/src/packlets/devices/devices-service.test.ts +1 -1
- package/src/packlets/devtools/devtools.ts +1 -1
- package/src/packlets/identity/authenticator.ts +1 -4
- package/src/packlets/identity/identity-manager.test.ts +1 -1
- package/src/packlets/identity/identity-service.test.ts +1 -1
- package/src/packlets/identity/identity.test.ts +1 -1
- package/src/packlets/invitations/device-invitation-protocol.ts +1 -1
- package/src/packlets/invitations/space-invitation-protocol.ts +1 -1
- package/src/packlets/network/network-service.test.ts +1 -1
- package/src/packlets/services/diagnostics.ts +2 -2
- package/src/packlets/services/service-context.ts +5 -11
- package/src/packlets/services/service-host.test.ts +3 -3
- package/src/packlets/services/service-host.ts +42 -6
- package/src/packlets/services/service-registry.test.ts +1 -1
- package/src/packlets/spaces/data-space-manager.test.ts +1 -1
- package/src/packlets/spaces/data-space-manager.ts +1 -1
- package/src/packlets/spaces/data-space.ts +1 -1
- package/src/packlets/spaces/spaces-service.test.ts +1 -1
- package/src/packlets/spaces/spaces-service.ts +1 -1
- package/src/packlets/storage/storage.ts +9 -9
- package/src/packlets/testing/test-builder.ts +3 -3
- package/src/packlets/vault/iframe-host-runtime.ts +1 -1
- package/src/packlets/vault/worker-runtime.ts +9 -6
- package/src/version.ts +1 -1
- package/dist/lib/browser/chunk-SNPC4XOB.mjs.map +0 -7
package/dist/lib/node/index.cjs
CHANGED
|
@@ -416,7 +416,6 @@ var createAuthProvider = (signer) => async (nonce) => {
|
|
|
416
416
|
return Credential.encode(credential);
|
|
417
417
|
};
|
|
418
418
|
var TrustedKeySetAuthVerifier = class {
|
|
419
|
-
// prettier-ignore
|
|
420
419
|
constructor(_params) {
|
|
421
420
|
this._params = _params;
|
|
422
421
|
this._ctx = new import_context2.Context();
|
|
@@ -431,7 +430,7 @@ var TrustedKeySetAuthVerifier = class {
|
|
|
431
430
|
credential
|
|
432
431
|
}, {
|
|
433
432
|
F: __dxlog_file,
|
|
434
|
-
L:
|
|
433
|
+
L: 56,
|
|
435
434
|
S: this,
|
|
436
435
|
C: (f, a) => f(...a)
|
|
437
436
|
});
|
|
@@ -441,7 +440,7 @@ var TrustedKeySetAuthVerifier = class {
|
|
|
441
440
|
result
|
|
442
441
|
}, {
|
|
443
442
|
F: __dxlog_file,
|
|
444
|
-
L:
|
|
443
|
+
L: 60,
|
|
445
444
|
S: this,
|
|
446
445
|
C: (f, a) => f(...a)
|
|
447
446
|
});
|
|
@@ -453,7 +452,7 @@ var TrustedKeySetAuthVerifier = class {
|
|
|
453
452
|
credential
|
|
454
453
|
}, {
|
|
455
454
|
F: __dxlog_file,
|
|
456
|
-
L:
|
|
455
|
+
L: 65,
|
|
457
456
|
S: this,
|
|
458
457
|
C: (f, a) => f(...a)
|
|
459
458
|
});
|
|
@@ -464,7 +463,7 @@ var TrustedKeySetAuthVerifier = class {
|
|
|
464
463
|
key: credential.issuer
|
|
465
464
|
}, {
|
|
466
465
|
F: __dxlog_file,
|
|
467
|
-
L:
|
|
466
|
+
L: 70,
|
|
468
467
|
S: this,
|
|
469
468
|
C: (f, a) => f(...a)
|
|
470
469
|
});
|
|
@@ -480,7 +479,7 @@ var TrustedKeySetAuthVerifier = class {
|
|
|
480
479
|
key: credential.issuer
|
|
481
480
|
}, {
|
|
482
481
|
F: __dxlog_file,
|
|
483
|
-
L:
|
|
482
|
+
L: 81,
|
|
484
483
|
S: this,
|
|
485
484
|
C: (f, a) => f(...a)
|
|
486
485
|
});
|
|
@@ -490,7 +489,7 @@ var TrustedKeySetAuthVerifier = class {
|
|
|
490
489
|
key: credential.issuer
|
|
491
490
|
}, {
|
|
492
491
|
F: __dxlog_file,
|
|
493
|
-
L:
|
|
492
|
+
L: 84,
|
|
494
493
|
S: this,
|
|
495
494
|
C: (f, a) => f(...a)
|
|
496
495
|
});
|
|
@@ -2529,9 +2528,6 @@ var import_log8 = require("@dxos/log");
|
|
|
2529
2528
|
var import_protocols5 = require("@dxos/protocols");
|
|
2530
2529
|
var import_services6 = require("@dxos/protocols/proto/dxos/client/services");
|
|
2531
2530
|
|
|
2532
|
-
// packages/sdk/client-services/src/version.ts
|
|
2533
|
-
var DXOS_VERSION = "0.1.58-main.fa022ee";
|
|
2534
|
-
|
|
2535
2531
|
// packages/sdk/client-services/src/packlets/services/platform.ts
|
|
2536
2532
|
var getPlatform = () => {
|
|
2537
2533
|
if (process.browser) {
|
|
@@ -2560,6 +2556,9 @@ var getPlatform = () => {
|
|
|
2560
2556
|
}
|
|
2561
2557
|
};
|
|
2562
2558
|
|
|
2559
|
+
// packages/sdk/client-services/src/version.ts
|
|
2560
|
+
var DXOS_VERSION = "0.1.58-main.ffb4cc4";
|
|
2561
|
+
|
|
2563
2562
|
// packages/sdk/client-services/src/packlets/services/diagnostics.ts
|
|
2564
2563
|
var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/diagnostics.ts";
|
|
2565
2564
|
var DEFAULT_TIMEOUT = 1e3;
|
|
@@ -3988,7 +3987,6 @@ function _ts_decorate5(decorators, target, key, desc) {
|
|
|
3988
3987
|
}
|
|
3989
3988
|
var __dxlog_file15 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-context.ts";
|
|
3990
3989
|
var ServiceContext = class ServiceContext2 {
|
|
3991
|
-
// prettier-ignore
|
|
3992
3990
|
constructor(storage, networkManager, signalManager, modelFactory) {
|
|
3993
3991
|
this.storage = storage;
|
|
3994
3992
|
this.networkManager = networkManager;
|
|
@@ -4028,7 +4026,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4028
4026
|
await this._checkStorageVersion();
|
|
4029
4027
|
(0, import_log13.log)("opening...", void 0, {
|
|
4030
4028
|
F: __dxlog_file15,
|
|
4031
|
-
L:
|
|
4029
|
+
L: 129,
|
|
4032
4030
|
S: this,
|
|
4033
4031
|
C: (f, a) => f(...a)
|
|
4034
4032
|
});
|
|
@@ -4036,7 +4034,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4036
4034
|
id: this._instanceId
|
|
4037
4035
|
}), {
|
|
4038
4036
|
F: __dxlog_file15,
|
|
4039
|
-
L:
|
|
4037
|
+
L: 130,
|
|
4040
4038
|
S: this,
|
|
4041
4039
|
C: (f, a) => f(...a)
|
|
4042
4040
|
});
|
|
@@ -4052,13 +4050,13 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4052
4050
|
id: this._instanceId
|
|
4053
4051
|
}), {
|
|
4054
4052
|
F: __dxlog_file15,
|
|
4055
|
-
L:
|
|
4053
|
+
L: 140,
|
|
4056
4054
|
S: this,
|
|
4057
4055
|
C: (f, a) => f(...a)
|
|
4058
4056
|
});
|
|
4059
4057
|
(0, import_log13.log)("opened", void 0, {
|
|
4060
4058
|
F: __dxlog_file15,
|
|
4061
|
-
L:
|
|
4059
|
+
L: 141,
|
|
4062
4060
|
S: this,
|
|
4063
4061
|
C: (f, a) => f(...a)
|
|
4064
4062
|
});
|
|
@@ -4066,7 +4064,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4066
4064
|
async close() {
|
|
4067
4065
|
(0, import_log13.log)("closing...", void 0, {
|
|
4068
4066
|
F: __dxlog_file15,
|
|
4069
|
-
L:
|
|
4067
|
+
L: 145,
|
|
4070
4068
|
S: this,
|
|
4071
4069
|
C: (f, a) => f(...a)
|
|
4072
4070
|
});
|
|
@@ -4083,7 +4081,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4083
4081
|
await this.metadataStore.close();
|
|
4084
4082
|
(0, import_log13.log)("closed", void 0, {
|
|
4085
4083
|
F: __dxlog_file15,
|
|
4086
|
-
L:
|
|
4084
|
+
L: 157,
|
|
4087
4085
|
S: this,
|
|
4088
4086
|
C: (f, a) => f(...a)
|
|
4089
4087
|
});
|
|
@@ -4097,7 +4095,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4097
4095
|
const factory = this._handlerFactories.get(invitation.kind);
|
|
4098
4096
|
(0, import_invariant13.invariant)(factory, `Unknown invitation kind: ${invitation.kind}`, {
|
|
4099
4097
|
F: __dxlog_file15,
|
|
4100
|
-
L:
|
|
4098
|
+
L: 168,
|
|
4101
4099
|
S: this,
|
|
4102
4100
|
A: [
|
|
4103
4101
|
"factory",
|
|
@@ -4121,7 +4119,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4121
4119
|
async _initialize(ctx) {
|
|
4122
4120
|
(0, import_log13.log)("initializing spaces...", void 0, {
|
|
4123
4121
|
F: __dxlog_file15,
|
|
4124
|
-
L:
|
|
4122
|
+
L: 189,
|
|
4125
4123
|
S: this,
|
|
4126
4124
|
C: (f, a) => f(...a)
|
|
4127
4125
|
});
|
|
@@ -4144,7 +4142,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4144
4142
|
this._handlerFactories.set(import_services10.Invitation.Kind.SPACE, (invitation) => {
|
|
4145
4143
|
(0, import_invariant13.invariant)(this.dataSpaceManager, "dataSpaceManager not initialized yet", {
|
|
4146
4144
|
F: __dxlog_file15,
|
|
4147
|
-
L:
|
|
4145
|
+
L: 212,
|
|
4148
4146
|
S: this,
|
|
4149
4147
|
A: [
|
|
4150
4148
|
"this.dataSpaceManager",
|
|
@@ -4168,7 +4166,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4168
4166
|
details: assertion
|
|
4169
4167
|
}, {
|
|
4170
4168
|
F: __dxlog_file15,
|
|
4171
|
-
L:
|
|
4169
|
+
L: 228,
|
|
4172
4170
|
S: this,
|
|
4173
4171
|
C: (f, a) => f(...a)
|
|
4174
4172
|
});
|
|
@@ -4179,7 +4177,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4179
4177
|
details: assertion
|
|
4180
4178
|
}, {
|
|
4181
4179
|
F: __dxlog_file15,
|
|
4182
|
-
L:
|
|
4180
|
+
L: 232,
|
|
4183
4181
|
S: this,
|
|
4184
4182
|
C: (f, a) => f(...a)
|
|
4185
4183
|
});
|
|
@@ -4190,7 +4188,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4190
4188
|
details: assertion
|
|
4191
4189
|
}, {
|
|
4192
4190
|
F: __dxlog_file15,
|
|
4193
|
-
L:
|
|
4191
|
+
L: 237,
|
|
4194
4192
|
S: this,
|
|
4195
4193
|
C: (f, a) => f(...a)
|
|
4196
4194
|
});
|
|
@@ -4201,7 +4199,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4201
4199
|
} catch (err) {
|
|
4202
4200
|
import_log13.log.catch(err, void 0, {
|
|
4203
4201
|
F: __dxlog_file15,
|
|
4204
|
-
L:
|
|
4202
|
+
L: 243,
|
|
4205
4203
|
S: this,
|
|
4206
4204
|
C: (f, a) => f(...a)
|
|
4207
4205
|
});
|
|
@@ -4228,6 +4226,7 @@ var import_client_protocol5 = require("@dxos/client-protocol");
|
|
|
4228
4226
|
var import_context10 = require("@dxos/context");
|
|
4229
4227
|
var import_document_model2 = require("@dxos/document-model");
|
|
4230
4228
|
var import_echo_pipeline3 = require("@dxos/echo-pipeline");
|
|
4229
|
+
var import_echo_schema = require("@dxos/echo-schema");
|
|
4231
4230
|
var import_invariant15 = require("@dxos/invariant");
|
|
4232
4231
|
var import_keys11 = require("@dxos/keys");
|
|
4233
4232
|
var import_log16 = require("@dxos/log");
|
|
@@ -4240,6 +4239,30 @@ var import_text_model = require("@dxos/text-model");
|
|
|
4240
4239
|
var import_tracing5 = require("@dxos/tracing");
|
|
4241
4240
|
var import_websocket_rpc = require("@dxos/websocket-rpc");
|
|
4242
4241
|
|
|
4242
|
+
// packages/sdk/client-services/src/packlets/services/service-registry.ts
|
|
4243
|
+
var ServiceRegistry = class {
|
|
4244
|
+
// prettier-ignore
|
|
4245
|
+
constructor(_serviceBundle, _handlers = {}) {
|
|
4246
|
+
this._serviceBundle = _serviceBundle;
|
|
4247
|
+
this._handlers = _handlers;
|
|
4248
|
+
}
|
|
4249
|
+
get descriptors() {
|
|
4250
|
+
return this._serviceBundle;
|
|
4251
|
+
}
|
|
4252
|
+
get services() {
|
|
4253
|
+
return this._handlers;
|
|
4254
|
+
}
|
|
4255
|
+
setServices(services) {
|
|
4256
|
+
this._handlers = services;
|
|
4257
|
+
}
|
|
4258
|
+
addService(name, service) {
|
|
4259
|
+
this._handlers[name] = service;
|
|
4260
|
+
}
|
|
4261
|
+
removeService(name) {
|
|
4262
|
+
delete this._handlers[name];
|
|
4263
|
+
}
|
|
4264
|
+
};
|
|
4265
|
+
|
|
4243
4266
|
// packages/sdk/client-services/src/packlets/devices/devices-service.ts
|
|
4244
4267
|
var import_async15 = require("@dxos/async");
|
|
4245
4268
|
var import_codec_protobuf12 = require("@dxos/codec-protobuf");
|
|
@@ -4499,23 +4522,23 @@ var import_random_access_storage = require("@dxos/random-access-storage");
|
|
|
4499
4522
|
var import_util8 = require("@dxos/util");
|
|
4500
4523
|
var StorageDriver = import_config.Runtime.Client.Storage.StorageDriver;
|
|
4501
4524
|
var createStorageObjects = (config) => {
|
|
4502
|
-
const {
|
|
4503
|
-
if (persistent &&
|
|
4525
|
+
const { persistent = false, keyStore, dataStore, dataRoot = (0, import_util8.isNode)() ? import_client_protocol4.DX_DATA : "dxos/storage" } = config ?? {};
|
|
4526
|
+
if (persistent && dataStore === StorageDriver.RAM) {
|
|
4504
4527
|
throw new import_protocols11.InvalidConfigError("RAM storage cannot be used in persistent mode.");
|
|
4505
4528
|
}
|
|
4506
|
-
if (!persistent &&
|
|
4529
|
+
if (!persistent && dataStore !== void 0 && dataStore !== StorageDriver.RAM) {
|
|
4507
4530
|
throw new import_protocols11.InvalidConfigError("Cannot use a persistent storage in not persistent mode.");
|
|
4508
4531
|
}
|
|
4509
|
-
if (persistent &&
|
|
4532
|
+
if (persistent && keyStore === StorageDriver.RAM) {
|
|
4510
4533
|
throw new import_protocols11.InvalidConfigError("RAM key storage cannot be used in persistent mode.");
|
|
4511
4534
|
}
|
|
4512
|
-
if (!persistent &&
|
|
4535
|
+
if (!persistent && keyStore !== StorageDriver.RAM && keyStore !== void 0) {
|
|
4513
4536
|
throw new import_protocols11.InvalidConfigError("Cannot use a persistent key storage in not persistent mode.");
|
|
4514
4537
|
}
|
|
4515
4538
|
return {
|
|
4516
4539
|
storage: (0, import_random_access_storage.createStorage)({
|
|
4517
|
-
type: persistent ? toStorageType(
|
|
4518
|
-
root: `${
|
|
4540
|
+
type: persistent ? toStorageType(dataStore) : import_random_access_storage.StorageType.RAM,
|
|
4541
|
+
root: `${dataRoot}/`
|
|
4519
4542
|
})
|
|
4520
4543
|
};
|
|
4521
4544
|
};
|
|
@@ -4594,30 +4617,6 @@ var SystemServiceImpl = class {
|
|
|
4594
4617
|
}
|
|
4595
4618
|
};
|
|
4596
4619
|
|
|
4597
|
-
// packages/sdk/client-services/src/packlets/services/service-registry.ts
|
|
4598
|
-
var ServiceRegistry = class {
|
|
4599
|
-
// prettier-ignore
|
|
4600
|
-
constructor(_serviceBundle, _handlers = {}) {
|
|
4601
|
-
this._serviceBundle = _serviceBundle;
|
|
4602
|
-
this._handlers = _handlers;
|
|
4603
|
-
}
|
|
4604
|
-
get descriptors() {
|
|
4605
|
-
return this._serviceBundle;
|
|
4606
|
-
}
|
|
4607
|
-
get services() {
|
|
4608
|
-
return this._handlers;
|
|
4609
|
-
}
|
|
4610
|
-
setServices(services) {
|
|
4611
|
-
this._handlers = services;
|
|
4612
|
-
}
|
|
4613
|
-
addService(name, service) {
|
|
4614
|
-
this._handlers[name] = service;
|
|
4615
|
-
}
|
|
4616
|
-
removeService(name) {
|
|
4617
|
-
delete this._handlers[name];
|
|
4618
|
-
}
|
|
4619
|
-
};
|
|
4620
|
-
|
|
4621
4620
|
// packages/sdk/client-services/src/packlets/services/service-host.ts
|
|
4622
4621
|
function _ts_decorate7(decorators, target, key, desc) {
|
|
4623
4622
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -4633,6 +4632,18 @@ var __dxlog_file17 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/s
|
|
|
4633
4632
|
var createDefaultModelFactory = () => {
|
|
4634
4633
|
return new import_model_factory.ModelFactory().registerModel(import_document_model2.DocumentModel).registerModel(import_text_model.TextModel);
|
|
4635
4634
|
};
|
|
4635
|
+
var createGenesisMutationFromTypedObject = (obj) => {
|
|
4636
|
+
const snapshot = obj[import_echo_schema.base]._createSnapshot();
|
|
4637
|
+
return {
|
|
4638
|
+
objectId: obj[import_echo_schema.base]._id,
|
|
4639
|
+
genesis: {
|
|
4640
|
+
modelType: obj[import_echo_schema.base]._modelConstructor.meta.type
|
|
4641
|
+
},
|
|
4642
|
+
snapshot: {
|
|
4643
|
+
model: snapshot
|
|
4644
|
+
}
|
|
4645
|
+
};
|
|
4646
|
+
};
|
|
4636
4647
|
var ClientServicesHost = class ClientServicesHost2 {
|
|
4637
4648
|
constructor({
|
|
4638
4649
|
config,
|
|
@@ -4719,7 +4730,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4719
4730
|
initialize({ config, ...options }) {
|
|
4720
4731
|
(0, import_invariant15.invariant)(!this._open, "service host is open", {
|
|
4721
4732
|
F: __dxlog_file17,
|
|
4722
|
-
L:
|
|
4733
|
+
L: 201,
|
|
4723
4734
|
S: this,
|
|
4724
4735
|
A: [
|
|
4725
4736
|
"!this._open",
|
|
@@ -4728,14 +4739,14 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4728
4739
|
});
|
|
4729
4740
|
(0, import_log16.log)("initializing...", void 0, {
|
|
4730
4741
|
F: __dxlog_file17,
|
|
4731
|
-
L:
|
|
4742
|
+
L: 202,
|
|
4732
4743
|
S: this,
|
|
4733
4744
|
C: (f, a) => f(...a)
|
|
4734
4745
|
});
|
|
4735
4746
|
if (config) {
|
|
4736
4747
|
(0, import_invariant15.invariant)(!this._config, "config already set", {
|
|
4737
4748
|
F: __dxlog_file17,
|
|
4738
|
-
L:
|
|
4749
|
+
L: 205,
|
|
4739
4750
|
S: this,
|
|
4740
4751
|
A: [
|
|
4741
4752
|
"!this._config",
|
|
@@ -4753,7 +4764,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4753
4764
|
this._signalManager = signalManager;
|
|
4754
4765
|
(0, import_invariant15.invariant)(!this._networkManager, "network manager already set", {
|
|
4755
4766
|
F: __dxlog_file17,
|
|
4756
|
-
L:
|
|
4767
|
+
L: 221,
|
|
4757
4768
|
S: this,
|
|
4758
4769
|
A: [
|
|
4759
4770
|
"!this._networkManager",
|
|
@@ -4767,7 +4778,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4767
4778
|
});
|
|
4768
4779
|
(0, import_log16.log)("initialized", void 0, {
|
|
4769
4780
|
F: __dxlog_file17,
|
|
4770
|
-
L:
|
|
4781
|
+
L: 228,
|
|
4771
4782
|
S: this,
|
|
4772
4783
|
C: (f, a) => f(...a)
|
|
4773
4784
|
});
|
|
@@ -4781,13 +4792,13 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4781
4792
|
id: traceId
|
|
4782
4793
|
}), {
|
|
4783
4794
|
F: __dxlog_file17,
|
|
4784
|
-
L:
|
|
4795
|
+
L: 239,
|
|
4785
4796
|
S: this,
|
|
4786
4797
|
C: (f, a) => f(...a)
|
|
4787
4798
|
});
|
|
4788
4799
|
(0, import_invariant15.invariant)(this._config, "config not set", {
|
|
4789
4800
|
F: __dxlog_file17,
|
|
4790
|
-
L:
|
|
4801
|
+
L: 241,
|
|
4791
4802
|
S: this,
|
|
4792
4803
|
A: [
|
|
4793
4804
|
"this._config",
|
|
@@ -4796,7 +4807,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4796
4807
|
});
|
|
4797
4808
|
(0, import_invariant15.invariant)(this._storage, "storage not set", {
|
|
4798
4809
|
F: __dxlog_file17,
|
|
4799
|
-
L:
|
|
4810
|
+
L: 242,
|
|
4800
4811
|
S: this,
|
|
4801
4812
|
A: [
|
|
4802
4813
|
"this._storage",
|
|
@@ -4805,7 +4816,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4805
4816
|
});
|
|
4806
4817
|
(0, import_invariant15.invariant)(this._signalManager, "signal manager not set", {
|
|
4807
4818
|
F: __dxlog_file17,
|
|
4808
|
-
L:
|
|
4819
|
+
L: 243,
|
|
4809
4820
|
S: this,
|
|
4810
4821
|
A: [
|
|
4811
4822
|
"this._signalManager",
|
|
@@ -4814,7 +4825,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4814
4825
|
});
|
|
4815
4826
|
(0, import_invariant15.invariant)(this._networkManager, "network manager not set", {
|
|
4816
4827
|
F: __dxlog_file17,
|
|
4817
|
-
L:
|
|
4828
|
+
L: 244,
|
|
4818
4829
|
S: this,
|
|
4819
4830
|
A: [
|
|
4820
4831
|
"this._networkManager",
|
|
@@ -4826,7 +4837,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4826
4837
|
lockKey: this._resourceLock?.lockKey
|
|
4827
4838
|
}, {
|
|
4828
4839
|
F: __dxlog_file17,
|
|
4829
|
-
L:
|
|
4840
|
+
L: 247,
|
|
4830
4841
|
S: this,
|
|
4831
4842
|
C: (f, a) => f(...a)
|
|
4832
4843
|
});
|
|
@@ -4835,7 +4846,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4835
4846
|
this._serviceContext = new ServiceContext(this._storage, this._networkManager, this._signalManager, this._modelFactory);
|
|
4836
4847
|
this._serviceRegistry.setServices({
|
|
4837
4848
|
SystemService: this._systemService,
|
|
4838
|
-
IdentityService: new IdentityServiceImpl((params) => this.
|
|
4849
|
+
IdentityService: new IdentityServiceImpl((params) => this._createIdentity(params), this._serviceContext.identityManager, this._serviceContext.keyring),
|
|
4839
4850
|
InvitationsService: new InvitationsServiceImpl(this._serviceContext.invitations, (invitation) => this._serviceContext.getInvitationHandler(invitation)),
|
|
4840
4851
|
DevicesService: new DevicesServiceImpl(this._serviceContext.identityManager),
|
|
4841
4852
|
SpacesService: new SpacesServiceImpl(this._serviceContext.identityManager, this._serviceContext.spaceManager, this._serviceContext.dataServiceSubscriptions, async () => {
|
|
@@ -4872,7 +4883,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4872
4883
|
deviceKey
|
|
4873
4884
|
}, {
|
|
4874
4885
|
F: __dxlog_file17,
|
|
4875
|
-
L:
|
|
4886
|
+
L: 316,
|
|
4876
4887
|
S: this,
|
|
4877
4888
|
C: (f, a) => f(...a)
|
|
4878
4889
|
});
|
|
@@ -4880,7 +4891,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4880
4891
|
id: traceId
|
|
4881
4892
|
}), {
|
|
4882
4893
|
F: __dxlog_file17,
|
|
4883
|
-
L:
|
|
4894
|
+
L: 317,
|
|
4884
4895
|
S: this,
|
|
4885
4896
|
C: (f, a) => f(...a)
|
|
4886
4897
|
});
|
|
@@ -4894,7 +4905,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4894
4905
|
deviceKey
|
|
4895
4906
|
}, {
|
|
4896
4907
|
F: __dxlog_file17,
|
|
4897
|
-
L:
|
|
4908
|
+
L: 328,
|
|
4898
4909
|
S: this,
|
|
4899
4910
|
C: (f, a) => f(...a)
|
|
4900
4911
|
});
|
|
@@ -4910,7 +4921,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4910
4921
|
deviceKey
|
|
4911
4922
|
}, {
|
|
4912
4923
|
F: __dxlog_file17,
|
|
4913
|
-
L:
|
|
4924
|
+
L: 335,
|
|
4914
4925
|
S: this,
|
|
4915
4926
|
C: (f, a) => f(...a)
|
|
4916
4927
|
});
|
|
@@ -4921,13 +4932,13 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4921
4932
|
id: traceId
|
|
4922
4933
|
}), {
|
|
4923
4934
|
F: __dxlog_file17,
|
|
4924
|
-
L:
|
|
4935
|
+
L: 340,
|
|
4925
4936
|
S: this,
|
|
4926
4937
|
C: (f, a) => f(...a)
|
|
4927
4938
|
});
|
|
4928
4939
|
(0, import_log16.log)("resetting...", void 0, {
|
|
4929
4940
|
F: __dxlog_file17,
|
|
4930
|
-
L:
|
|
4941
|
+
L: 342,
|
|
4931
4942
|
S: this,
|
|
4932
4943
|
C: (f, a) => f(...a)
|
|
4933
4944
|
});
|
|
@@ -4935,7 +4946,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4935
4946
|
await this._storage.reset();
|
|
4936
4947
|
(0, import_log16.log)("reset", void 0, {
|
|
4937
4948
|
F: __dxlog_file17,
|
|
4938
|
-
L:
|
|
4949
|
+
L: 345,
|
|
4939
4950
|
S: this,
|
|
4940
4951
|
C: (f, a) => f(...a)
|
|
4941
4952
|
});
|
|
@@ -4943,12 +4954,31 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4943
4954
|
id: traceId
|
|
4944
4955
|
}), {
|
|
4945
4956
|
F: __dxlog_file17,
|
|
4946
|
-
L:
|
|
4957
|
+
L: 346,
|
|
4947
4958
|
S: this,
|
|
4948
4959
|
C: (f, a) => f(...a)
|
|
4949
4960
|
});
|
|
4950
4961
|
await this._callbacks?.onReset?.();
|
|
4951
4962
|
}
|
|
4963
|
+
async _createIdentity(params) {
|
|
4964
|
+
const identity = await this._serviceContext.createIdentity(params);
|
|
4965
|
+
await this._serviceContext.initialized.wait();
|
|
4966
|
+
const space = await this._serviceContext.dataSpaceManager.createSpace();
|
|
4967
|
+
const obj = new import_client_protocol5.Properties();
|
|
4968
|
+
obj[import_client_protocol5.defaultKey] = identity.identityKey.toHex();
|
|
4969
|
+
await this._serviceRegistry.services.DataService.write({
|
|
4970
|
+
spaceKey: space.key,
|
|
4971
|
+
batch: {
|
|
4972
|
+
objects: [
|
|
4973
|
+
createGenesisMutationFromTypedObject(obj)
|
|
4974
|
+
]
|
|
4975
|
+
}
|
|
4976
|
+
});
|
|
4977
|
+
await this._serviceRegistry.services.DataService.flush({
|
|
4978
|
+
spaceKey: space.key
|
|
4979
|
+
});
|
|
4980
|
+
return identity;
|
|
4981
|
+
}
|
|
4952
4982
|
};
|
|
4953
4983
|
_ts_decorate7([
|
|
4954
4984
|
import_tracing5.trace.info()
|
|
@@ -5419,7 +5449,6 @@ _ts_decorate9([
|
|
|
5419
5449
|
// packages/sdk/client-services/src/packlets/vault/worker-runtime.ts
|
|
5420
5450
|
var __dxlog_file22 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/vault/worker-runtime.ts";
|
|
5421
5451
|
var WorkerRuntime = class {
|
|
5422
|
-
// prettier-ignore
|
|
5423
5452
|
constructor(_configProvider) {
|
|
5424
5453
|
this._configProvider = _configProvider;
|
|
5425
5454
|
this._transportFactory = new import_network_manager5.SimplePeerTransportProxyFactory();
|
|
@@ -5439,7 +5468,7 @@ var WorkerRuntime = class {
|
|
|
5439
5468
|
async start() {
|
|
5440
5469
|
(0, import_log20.log)("starting...", void 0, {
|
|
5441
5470
|
F: __dxlog_file22,
|
|
5442
|
-
L:
|
|
5471
|
+
L: 52,
|
|
5443
5472
|
S: this,
|
|
5444
5473
|
C: (f, a) => f(...a)
|
|
5445
5474
|
});
|
|
@@ -5455,7 +5484,7 @@ var WorkerRuntime = class {
|
|
|
5455
5484
|
this._ready.wake(void 0);
|
|
5456
5485
|
(0, import_log20.log)("started", void 0, {
|
|
5457
5486
|
F: __dxlog_file22,
|
|
5458
|
-
L:
|
|
5487
|
+
L: 66,
|
|
5459
5488
|
S: this,
|
|
5460
5489
|
C: (f, a) => f(...a)
|
|
5461
5490
|
});
|
|
@@ -5463,7 +5492,7 @@ var WorkerRuntime = class {
|
|
|
5463
5492
|
this._ready.wake(err);
|
|
5464
5493
|
import_log20.log.error("starting", err, {
|
|
5465
5494
|
F: __dxlog_file22,
|
|
5466
|
-
L:
|
|
5495
|
+
L: 69,
|
|
5467
5496
|
S: this,
|
|
5468
5497
|
C: (f, a) => f(...a)
|
|
5469
5498
|
});
|
|
@@ -5497,7 +5526,7 @@ var WorkerRuntime = class {
|
|
|
5497
5526
|
_reconnectWebrtc() {
|
|
5498
5527
|
(0, import_log20.log)("reconnecting webrtc...", void 0, {
|
|
5499
5528
|
F: __dxlog_file22,
|
|
5500
|
-
L:
|
|
5529
|
+
L: 106,
|
|
5501
5530
|
S: this,
|
|
5502
5531
|
C: (f, a) => f(...a)
|
|
5503
5532
|
});
|