@dxos/client-services 0.1.10 → 0.1.11
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/src/index.d.ts +0 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +0 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/packlets/deprecated/space.d.ts.map +1 -1
- package/dist/src/packlets/deprecated/space.js +21 -21
- package/dist/src/packlets/deprecated/space.js.map +1 -1
- package/dist/src/packlets/deprecated/system.d.ts +3 -1
- package/dist/src/packlets/deprecated/system.d.ts.map +1 -1
- package/dist/src/packlets/deprecated/system.js +3 -4
- package/dist/src/packlets/deprecated/system.js.map +1 -1
- package/dist/src/packlets/devtools/feeds.d.ts.map +1 -1
- package/dist/src/packlets/devtools/feeds.js +2 -1
- package/dist/src/packlets/devtools/feeds.js.map +1 -1
- package/dist/src/packlets/devtools/spaces.d.ts.map +1 -1
- package/dist/src/packlets/devtools/spaces.js +2 -1
- package/dist/src/packlets/devtools/spaces.js.map +1 -1
- package/dist/src/packlets/identity/authenticator.js +3 -3
- package/dist/src/packlets/identity/authenticator.js.map +1 -1
- package/dist/src/packlets/identity/identity-manager.js +5 -5
- package/dist/src/packlets/identity/identity-manager.js.map +1 -1
- package/dist/src/packlets/identity/identity.js +1 -1
- package/dist/src/packlets/identity/identity.js.map +1 -1
- package/dist/src/packlets/invitations/halo-invitations-handler.d.ts +2 -2
- package/dist/src/packlets/invitations/halo-invitations-handler.d.ts.map +1 -1
- package/dist/src/packlets/invitations/halo-invitations-handler.js +13 -13
- package/dist/src/packlets/invitations/halo-invitations-handler.js.map +1 -1
- package/dist/src/packlets/invitations/invitations-handler.d.ts +3 -3
- package/dist/src/packlets/invitations/invitations-handler.d.ts.map +1 -1
- package/dist/src/packlets/invitations/invitations-proxy.d.ts +2 -2
- package/dist/src/packlets/invitations/invitations-proxy.d.ts.map +1 -1
- package/dist/src/packlets/invitations/invitations-proxy.js +2 -2
- package/dist/src/packlets/invitations/invitations-proxy.js.map +1 -1
- package/dist/src/packlets/invitations/invitations-service.js +10 -10
- package/dist/src/packlets/invitations/invitations-service.js.map +1 -1
- package/dist/src/packlets/invitations/invitations.d.ts +6 -9
- package/dist/src/packlets/invitations/invitations.d.ts.map +1 -1
- package/dist/src/packlets/invitations/invitations.js +6 -5
- package/dist/src/packlets/invitations/invitations.js.map +1 -1
- package/dist/src/packlets/invitations/space-invitations-handler.d.ts +2 -2
- package/dist/src/packlets/invitations/space-invitations-handler.d.ts.map +1 -1
- package/dist/src/packlets/invitations/space-invitations-handler.js +15 -13
- package/dist/src/packlets/invitations/space-invitations-handler.js.map +1 -1
- package/dist/src/packlets/services/service-context.d.ts +1 -1
- package/dist/src/packlets/services/service-context.d.ts.map +1 -1
- package/dist/src/packlets/services/service-context.js +10 -6
- package/dist/src/packlets/services/service-context.js.map +1 -1
- package/dist/src/packlets/services/service-host.d.ts +6 -2
- package/dist/src/packlets/services/service-host.d.ts.map +1 -1
- package/dist/src/packlets/services/service-host.js +33 -25
- package/dist/src/packlets/services/service-host.js.map +1 -1
- package/dist/src/packlets/services/service-proxy.d.ts.map +1 -1
- package/dist/src/packlets/services/service-proxy.js +1 -1
- package/dist/src/packlets/services/service-proxy.js.map +1 -1
- package/dist/src/packlets/services/service-registry.test.js +3 -3
- package/dist/src/packlets/services/service-registry.test.js.map +1 -1
- package/dist/src/packlets/storage/storage.d.ts.map +1 -1
- package/dist/src/packlets/storage/storage.js +6 -6
- package/dist/src/packlets/storage/storage.js.map +1 -1
- package/dist/src/packlets/testing/test-builder.js +1 -1
- package/dist/src/packlets/testing/test-builder.js.map +1 -1
- package/dist/src/packlets/vault/worker-session.js +3 -3
- package/dist/src/packlets/vault/worker-session.js.map +1 -1
- package/package.json +28 -28
- package/src/index.ts +0 -2
- package/src/packlets/deprecated/space.ts +21 -20
- package/src/packlets/deprecated/system.ts +4 -4
- package/src/packlets/devtools/feeds.ts +2 -1
- package/src/packlets/devtools/spaces.ts +2 -1
- package/src/packlets/invitations/halo-invitations-handler.ts +2 -2
- package/src/packlets/invitations/invitations-handler.ts +3 -3
- package/src/packlets/invitations/invitations-proxy.ts +2 -2
- package/src/packlets/invitations/invitations.ts +6 -11
- package/src/packlets/invitations/space-invitations-handler.ts +4 -2
- package/src/packlets/services/service-context.ts +7 -2
- package/src/packlets/services/service-host.ts +42 -29
- package/src/packlets/services/service-proxy.ts +1 -1
- package/src/packlets/storage/storage.ts +6 -6
- package/src/packlets/testing/test-builder.ts +1 -1
- package/testing.d.ts +11 -0
- package/testing.js +5 -0
- package/dist/src/errors.d.ts +0 -8
- package/dist/src/errors.d.ts.map +0 -1
- package/dist/src/errors.js +0 -21
- package/dist/src/errors.js.map +0 -1
- package/src/errors.ts +0 -19
|
@@ -32,10 +32,38 @@ class ClientServicesHost {
|
|
|
32
32
|
constructor({ config, modelFactory = (0, exports.createDefaultModelFactory)(),
|
|
33
33
|
// TODO(burdon): Create ApolloLink abstraction (see Client).
|
|
34
34
|
networkManager }) {
|
|
35
|
+
this._config = config;
|
|
36
|
+
this._modelFactory = modelFactory;
|
|
37
|
+
this._networkManager = networkManager;
|
|
38
|
+
}
|
|
39
|
+
get descriptors() {
|
|
40
|
+
return this._serviceRegistry.descriptors;
|
|
41
|
+
}
|
|
42
|
+
get services() {
|
|
43
|
+
return this._serviceRegistry.services;
|
|
44
|
+
}
|
|
45
|
+
async open() {
|
|
46
|
+
var _a;
|
|
47
|
+
await this._initialize();
|
|
48
|
+
const deviceKey = (_a = this._serviceContext.identityManager.identity) === null || _a === void 0 ? void 0 : _a.deviceKey;
|
|
49
|
+
(0, log_1.log)('opening...', { deviceKey }, { file: "packages/sdk/client-services/src/packlets/services/service-host.ts", line: 69, scope: this, bugcheck: "If you see this message then it means that the source code preprocessor for @dxos/log is broken. It probably has misinterpreted an unrelated call for a logger invocation.", callSite: (fn, args) => fn(...args) });
|
|
50
|
+
await this._initialize();
|
|
51
|
+
await this._serviceContext.open();
|
|
52
|
+
(0, log_1.log)('opened', { deviceKey }, { file: "packages/sdk/client-services/src/packlets/services/service-host.ts", line: 72, scope: this, bugcheck: "If you see this message then it means that the source code preprocessor for @dxos/log is broken. It probably has misinterpreted an unrelated call for a logger invocation.", callSite: (fn, args) => fn(...args) });
|
|
53
|
+
}
|
|
54
|
+
async close() {
|
|
55
|
+
var _a;
|
|
56
|
+
const deviceKey = (_a = this._serviceContext.identityManager.identity) === null || _a === void 0 ? void 0 : _a.deviceKey;
|
|
57
|
+
(0, log_1.log)('closing...', { deviceKey }, { file: "packages/sdk/client-services/src/packlets/services/service-host.ts", line: 77, scope: this, bugcheck: "If you see this message then it means that the source code preprocessor for @dxos/log is broken. It probably has misinterpreted an unrelated call for a logger invocation.", callSite: (fn, args) => fn(...args) });
|
|
58
|
+
await this._serviceContext.close();
|
|
59
|
+
(0, log_1.log)('closed', { deviceKey }, { file: "packages/sdk/client-services/src/packlets/services/service-host.ts", line: 79, scope: this, bugcheck: "If you see this message then it means that the source code preprocessor for @dxos/log is broken. It probably has misinterpreted an unrelated call for a logger invocation.", callSite: (fn, args) => fn(...args) });
|
|
60
|
+
}
|
|
61
|
+
// TODO(burdon): Move into open.
|
|
62
|
+
async _initialize() {
|
|
35
63
|
// TODO(dmaretskyi): Remove keyStorage.
|
|
36
|
-
const { storage } = (0, storage_1.createStorageObjects)(
|
|
64
|
+
const { storage } = (0, storage_1.createStorageObjects)(this._config.get('runtime.client.storage', {}));
|
|
37
65
|
// TODO(burdon): Break into components.
|
|
38
|
-
this._serviceContext = new service_context_1.ServiceContext(storage,
|
|
66
|
+
this._serviceContext = new service_context_1.ServiceContext(storage, this._networkManager, this._modelFactory);
|
|
39
67
|
// TODO(burdon): Start to think of DMG (dynamic services).
|
|
40
68
|
this._serviceRegistry = new service_registry_1.ServiceRegistry(service_definitions_1.clientServiceBundle, {
|
|
41
69
|
HaloInvitationsService: new invitations_1.HaloInvitationsServiceImpl(this._serviceContext.identityManager, this._serviceContext.haloInvitations),
|
|
@@ -46,35 +74,15 @@ class ClientServicesHost {
|
|
|
46
74
|
// TODO(burdon): Move to new protobuf definitions.
|
|
47
75
|
ProfileService: new deprecated_1.ProfileServiceImpl(this._serviceContext),
|
|
48
76
|
SpaceService: new deprecated_1.SpaceServiceImpl(this._serviceContext),
|
|
49
|
-
SystemService: new deprecated_1.SystemServiceImpl(
|
|
50
|
-
TracingService: new deprecated_1.TracingServiceImpl(
|
|
77
|
+
SystemService: new deprecated_1.SystemServiceImpl(this._config, this._serviceContext),
|
|
78
|
+
TracingService: new deprecated_1.TracingServiceImpl(this._config),
|
|
51
79
|
DevtoolsHost: new devtools_1.DevtoolsServiceImpl({
|
|
52
80
|
events: new devtools_1.DevtoolsHostEvents(),
|
|
53
|
-
config,
|
|
81
|
+
config: this._config,
|
|
54
82
|
context: this._serviceContext
|
|
55
83
|
})
|
|
56
84
|
});
|
|
57
85
|
}
|
|
58
|
-
get descriptors() {
|
|
59
|
-
return this._serviceRegistry.descriptors;
|
|
60
|
-
}
|
|
61
|
-
get services() {
|
|
62
|
-
return this._serviceRegistry.services;
|
|
63
|
-
}
|
|
64
|
-
async open() {
|
|
65
|
-
var _a;
|
|
66
|
-
const deviceKey = (_a = this._serviceContext.identityManager.identity) === null || _a === void 0 ? void 0 : _a.deviceKey;
|
|
67
|
-
(0, log_1.log)('opening...', { deviceKey }, { file: "packages/sdk/client-services/src/packlets/services/service-host.ts", line: 97, scope: this, bugcheck: "If you see this message then it means that the source code preprocessor for @dxos/log is broken. It probably has misinterpreted an unrelated call for a logger invocation." });
|
|
68
|
-
await this._serviceContext.open();
|
|
69
|
-
(0, log_1.log)('opened', { deviceKey }, { file: "packages/sdk/client-services/src/packlets/services/service-host.ts", line: 99, scope: this, bugcheck: "If you see this message then it means that the source code preprocessor for @dxos/log is broken. It probably has misinterpreted an unrelated call for a logger invocation." });
|
|
70
|
-
}
|
|
71
|
-
async close() {
|
|
72
|
-
var _a;
|
|
73
|
-
const deviceKey = (_a = this._serviceContext.identityManager.identity) === null || _a === void 0 ? void 0 : _a.deviceKey;
|
|
74
|
-
(0, log_1.log)('closing...', { deviceKey }, { file: "packages/sdk/client-services/src/packlets/services/service-host.ts", line: 104, scope: this, bugcheck: "If you see this message then it means that the source code preprocessor for @dxos/log is broken. It probably has misinterpreted an unrelated call for a logger invocation." });
|
|
75
|
-
await this._serviceContext.close();
|
|
76
|
-
(0, log_1.log)('closed', { deviceKey }, { file: "packages/sdk/client-services/src/packlets/services/service-host.ts", line: 106, scope: this, bugcheck: "If you see this message then it means that the source code preprocessor for @dxos/log is broken. It probably has misinterpreted an unrelated call for a logger invocation." });
|
|
77
|
-
}
|
|
78
86
|
}
|
|
79
87
|
exports.ClientServicesHost = ClientServicesHost;
|
|
80
88
|
//# sourceMappingURL=service-host.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-host.js","sourceRoot":"","sources":["../../../../src/packlets/services/service-host.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAGF,uCAAoC;AACpC,2CAAgD;AAChD,mCAAgC;AAChC,uDAAmD;AAEnD,qDAAiD;AACjD,iDAA6C;AAE7C,8CAA4G;AAC5G,0CAAsE;AACtE,2EAAsE;AACtE,gDAAyF;AACzF,sCAA8C;AAC9C,wCAAkD;AAClD,uDAAmD;AACnD,+DAAoG;AACpG,yDAAqD;AAErD,sCAAsC;AACtC,2CAA2C;AACpC,MAAM,yBAAyB,GAAG,GAAG,EAAE;IAC5C,OAAO,IAAI,4BAAY,EAAE,CAAC,aAAa,CAAC,0BAAW,CAAC,CAAC,aAAa,CAAC,sBAAS,CAAC,CAAC;AAChF,CAAC,CAAC;AAFW,QAAA,yBAAyB,6BAEpC;AAQF;;GAEG;AACH,MAAa,kBAAkB;
|
|
1
|
+
{"version":3,"file":"service-host.js","sourceRoot":"","sources":["../../../../src/packlets/services/service-host.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAGF,uC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K,EAAC,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC,CAAA,EAAA,CAC5F;YAED,aAAa,EAAE,IAAI,0BAAiB,EAAE;YAEtC,WAAW,EAAE,IAAI,yBAAe,CAAC,IAAI,CAAC,eAAe,CAAC,wBAAwB,CAAC;YAE/E,kDAAkD;YAClD,cAAc,EAAE,IAAI,+BAAkB,CAAC,IAAI,CAAC,eAAe,CAAC;YAC5D,YAAY,EAAE,IAAI,6BAAgB,CAAC,IAAI,CAAC,eAAe,CAAC;YACxD,aAAa,EAAE,IAAI,8BAAiB,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,eAAe,CAAC;YACxE,cAAc,EAAE,IAAI,+BAAkB,CAAC,IAAI,CAAC,OAAO,CAAC;YACpD,YAAY,EAAE,IAAI,8BAAmB,CAAC;gBACpC,MAAM,EAAE,IAAI,6BAAkB,EAAE;gBAChC,MAAM,EAAE,IAAI,CAAC,OAAO;gBACpB,OAAO,EAAE,IAAI,CAAC,eAAe;aAC9B,CAAC;SACH,CAAC,CAAC;IACL,CAAC;CACF;AAlFD,gDAkFC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-proxy.d.ts","sourceRoot":"","sources":["../../../../src/packlets/services/service-proxy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"service-proxy.d.ts","sourceRoot":"","sources":["../../../../src/packlets/services/service-proxy.ts"],"names":[],"mappings":"AAMA,OAAO,EAAsB,YAAY,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEtE,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAuB,MAAM,uBAAuB,CAAC;AAEpG;;;GAGG;AAGH,qBAAa,mBAAoB,YAAW,sBAAsB;IAQ9D,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAP3B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA+B;gBAIpD,IAAI,EAAE,OAAO,EAGI,QAAQ,SAAO;IAUlC,IAAI,KAAK,iCAER;IAED,IAAI,WAAW,sDAEd;IAED,IAAI,QAAQ,mBAEX;IAEK,IAAI;IAIJ,KAAK;CAGZ"}
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ClientServicesProxy = void 0;
|
|
7
7
|
const async_1 = require("@dxos/async");
|
|
8
|
+
const errors_1 = require("@dxos/errors");
|
|
8
9
|
const rpc_1 = require("@dxos/rpc");
|
|
9
|
-
const errors_1 = require("../../errors");
|
|
10
10
|
const service_definitions_1 = require("./service-definitions");
|
|
11
11
|
/**
|
|
12
12
|
* Implements services that are not local to the app.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-proxy.js","sourceRoot":"","sources":["../../../../src/packlets/services/service-proxy.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAEF,uCAA2C;AAC3C,mCAAsE;AAEtE
|
|
1
|
+
{"version":3,"file":"service-proxy.js","sourceRoot":"","sources":["../../../../src/packlets/services/service-proxy.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAEF,uCAA2C;AAC3C,yCAA8D;AAC9D,mCAAsE;AAEtE,+DAAoG;AAEpG;;;GAGG;AACH,6EAA6E;AAC7E,6GAA6G;AAC7G,MAAa,mBAAmB;IAG9B,kBAAkB;IAClB,YACE,IAAa;IACb,iFAAiF;IACjF,kIAAkI;IACjH,WAAW,IAAI;QAAf,aAAQ,GAAR,QAAQ,CAAO;QAEhC,IAAI,CAAC,MAAM,GAAG,IAAA,wBAAkB,EAAC;YAC/B,SAAS,EAAE,yCAAmB;YAC9B,OAAO,EAAE,EAAE;YACX,QAAQ,EAAE,EAAE;YACZ,IAAI;SACL,CAAC,CAAC;IACL,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,IAAI,WAAW;QACb,OAAO,yCAAmB,CAAC;IAC7B,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,IAAI;QACR,MAAM,IAAA,oBAAY,EAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,uCAA8B,EAAE,CAAC,CAAC;IAC9F,CAAC;IAED,KAAK,CAAC,KAAK;QACT,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IAC5B,CAAC;CACF;AArCD,kDAqCC"}
|
|
@@ -40,16 +40,16 @@ describe('service registry', function () {
|
|
|
40
40
|
handlers: serviceRegistry.services,
|
|
41
41
|
port: serverPort
|
|
42
42
|
});
|
|
43
|
-
(0, log_1.log)('opening...', {}, { file: "packages/sdk/client-services/src/packlets/services/service-registry.test.ts", line: 60, scope: this, bugcheck: "If you see this message then it means that the source code preprocessor for @dxos/log is broken. It probably has misinterpreted an unrelated call for a logger invocation." });
|
|
43
|
+
(0, log_1.log)('opening...', {}, { file: "packages/sdk/client-services/src/packlets/services/service-registry.test.ts", line: 60, scope: this, bugcheck: "If you see this message then it means that the source code preprocessor for @dxos/log is broken. It probably has misinterpreted an unrelated call for a logger invocation.", callSite: (fn, args) => fn(...args) });
|
|
44
44
|
await Promise.all([proxy.open(), server.open()]);
|
|
45
|
-
(0, log_1.log)('open', {}, { file: "packages/sdk/client-services/src/packlets/services/service-registry.test.ts", line: 62, scope: this, bugcheck: "If you see this message then it means that the source code preprocessor for @dxos/log is broken. It probably has misinterpreted an unrelated call for a logger invocation." });
|
|
45
|
+
(0, log_1.log)('open', {}, { file: "packages/sdk/client-services/src/packlets/services/service-registry.test.ts", line: 62, scope: this, bugcheck: "If you see this message then it means that the source code preprocessor for @dxos/log is broken. It probably has misinterpreted an unrelated call for a logger invocation.", callSite: (fn, args) => fn(...args) });
|
|
46
46
|
const done = new async_1.Trigger(); // createRpcServer
|
|
47
47
|
{
|
|
48
48
|
const spaceInvitationsProxy = new invitations_1.SpaceInvitationsProxy(proxy.rpc.SpaceInvitationsService);
|
|
49
49
|
const observer = spaceInvitationsProxy.createInvitation(space.key);
|
|
50
50
|
observer.subscribe({
|
|
51
51
|
onConnecting: (invitation) => {
|
|
52
|
-
(0, log_1.log)('connecting', invitation, { file: "packages/sdk/client-services/src/packlets/services/service-registry.test.ts", line: 71, scope: this, bugcheck: "If you see this message then it means that the source code preprocessor for @dxos/log is broken. It probably has misinterpreted an unrelated call for a logger invocation." });
|
|
52
|
+
(0, log_1.log)('connecting', invitation, { file: "packages/sdk/client-services/src/packlets/services/service-registry.test.ts", line: 71, scope: this, bugcheck: "If you see this message then it means that the source code preprocessor for @dxos/log is broken. It probably has misinterpreted an unrelated call for a logger invocation.", callSite: (fn, args) => fn(...args) });
|
|
53
53
|
void observer.cancel();
|
|
54
54
|
},
|
|
55
55
|
onCancelled: () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-registry.test.js","sourceRoot":"","sources":["../../../../src/packlets/services/service-registry.test.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;AAEF,oDAA4B;AAE5B,uCAAsC;AACtC,mCAAgC;AAChC,+CAAyC;AAEzC,mCAAuF;AAEvF,gDAAoF;AACpF,wCAAkD;AAClD,yDAAqD;AAQrD,MAAM,aAAa,GAAG,IAAA,yBAAmB,EAAe;IACtD,uBAAuB,EAAE,kBAAM,CAAC,UAAU,CAAC,8CAA8C,CAAC;CAC3F,CAAC,CAAC;AAEH,QAAQ,CAAC,kBAAkB,EAAE;IAC3B,EAAE,CAAC,2BAA2B,EAAE,KAAK;QACnC,MAAM,cAAc,GAAG,IAAA,8BAAoB,GAAE,CAAC;QAC9C,MAAM,cAAc,CAAC,IAAI,EAAE,CAAC;QAC5B,MAAM,cAAc,CAAC,cAAc,EAAE,CAAC;QAEtC,IAAA,gBAAM,EAAC,cAAc,CAAC,YAAY,CAAC,CAAC;QACpC,IAAA,gBAAM,EAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC;QACxC,MAAM,KAAK,GAAG,MAAM,cAAc,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC;QAE9D,MAAM,eAAe,GAAG,IAAI,kCAAe,CAAC,aAAa,EAAE;YACzD,uBAAuB,EAAE,IAAI,yCAA2B,CACtD,cAAc,CAAC,eAAe,EAC9B,GAAG,EAAE,CAAC,cAAc,CAAC,gBAAiB,EACtC,GAAG,EAAE,CAAC,cAAc,CAAC,YAAa,CACnC;SACF,CAAC,CAAC;QAEH,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG,IAAA,uBAAiB,GAAE,CAAC;QAEpD,MAAM,KAAK,GAAG,IAAA,wBAAkB,EAAC;YAC/B,SAAS,EAAE,eAAe,CAAC,WAAW;YACtC,OAAO,EAAE,EAAE;YACX,QAAQ,EAAE,EAAE;YACZ,IAAI,EAAE,SAAS;SAChB,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG,IAAA,wBAAkB,EAAC;YAChC,OAAO,EAAE,eAAe,CAAC,WAAW;YACpC,QAAQ,EAAE,eAAe,CAAC,QAAQ;YAClC,IAAI,EAAE,UAAU;SACjB,CAAC,CAAC;QAEH,IAAA,SAAG,EAAC,YAAY,
|
|
1
|
+
{"version":3,"file":"service-registry.test.js","sourceRoot":"","sources":["../../../../src/packlets/services/service-registry.test.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;AAEF,oDAA4B;AAE5B,uCAAsC;AACtC,mCAAgC;AAChC,+CAAyC;AAEzC,mCAAuF;AAEvF,gDAAoF;AACpF,wCAAkD;AAClD,yDAAqD;AAQrD,MAAM,aAAa,GAAG,IAAA,yBAAmB,EAAe;IACtD,uBAAuB,EAAE,kBAAM,CAAC,UAAU,CAAC,8CAA8C,CAAC;CAC3F,CAAC,CAAC;AAEH,QAAQ,CAAC,kBAAkB,EAAE;IAC3B,EAAE,CAA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CAAC,kBAAkB;QAE9C;YACE,MAAM,qBAAqB,GAAG,IAAI,mCAAqB,CAAC,KAAK,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;YAC3F,MAAM,QAAQ,GAAG,qBAAqB,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACnE,QAAQ,CAAC,SAAS,CAAC;gBACjB,YAAY,EAAE,CAAC,UAAsB,EAAE,EAAE;oBACvC,IAAA,SAAG,EAAC,YAAY,EAAE,UAAU,8UAAC,CAAC;oBAC9B,KAAK,QAAQ,CAAC,MAAM,EAAE,CAAC;gBACzB,CAAC;gBACD,WAAW,EAAE,GAAG,EAAE;oBAChB,IAAI,CAAC,IAAI,EAAE,CAAC;gBACd,CAAC;gBACD,SAAS,EAAE,CAAC,WAAuB,EAAE,EAAE;oBACrC,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;gBAC1C,CAAC;gBACD,OAAO,EAAE,GAAG,EAAE;oBACZ,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;gBAC1C,CAAC;aACF,CAAC,CAAC;SACJ;QAED,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;QAElB,+CAA+C;QAC/C,8EAA8E;QAC9E,qBAAqB;QACrB,sDAAsD;QACtD,gCAAgC;QAChC,iBAAiB;IACnB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../../src/packlets/storage/storage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../../src/packlets/storage/storage.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAC;AAM5D,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,SAAS,GAAG,UAAU,CAAC;AAG5D,eAAO,MAAM,oBAAoB,WAAY,QAAQ,MAAM,QAAQ;;;CA4BlE,CAAC"}
|
|
@@ -10,26 +10,26 @@ exports.createStorageObjects = void 0;
|
|
|
10
10
|
const jsondown_1 = __importDefault(require("jsondown")); // TODO(burdon): Uses custom implementation.
|
|
11
11
|
const level_js_1 = __importDefault(require("level-js"));
|
|
12
12
|
const memdown_1 = __importDefault(require("memdown"));
|
|
13
|
+
const errors_1 = require("@dxos/errors");
|
|
13
14
|
const config_1 = require("@dxos/protocols/proto/dxos/config");
|
|
14
15
|
const random_access_storage_1 = require("@dxos/random-access-storage");
|
|
15
16
|
const util_1 = require("@dxos/util");
|
|
16
17
|
var StorageDriver = config_1.Runtime.Client.Storage.StorageDriver;
|
|
17
|
-
const errors_1 = require("../../errors");
|
|
18
18
|
// TODO(burdon): Factor out.
|
|
19
19
|
const createStorageObjects = (config) => {
|
|
20
20
|
const { path = 'dxos/storage', // TODO(burdon): Factor out const.
|
|
21
21
|
storageType, keyStorage, persistent = false } = config !== null && config !== void 0 ? config : {};
|
|
22
22
|
if (persistent && storageType === StorageDriver.RAM) {
|
|
23
|
-
throw new errors_1.
|
|
23
|
+
throw new errors_1.InvalidConfigError('RAM storage cannot be used in persistent mode.');
|
|
24
24
|
}
|
|
25
25
|
if (!persistent && storageType !== undefined && storageType !== StorageDriver.RAM) {
|
|
26
|
-
throw new errors_1.
|
|
26
|
+
throw new errors_1.InvalidConfigError('Cannot use a persistent storage in not persistent mode.');
|
|
27
27
|
}
|
|
28
28
|
if (persistent && keyStorage === StorageDriver.RAM) {
|
|
29
|
-
throw new errors_1.
|
|
29
|
+
throw new errors_1.InvalidConfigError('RAM key storage cannot be used in persistent mode.');
|
|
30
30
|
}
|
|
31
31
|
if (!persistent && keyStorage !== StorageDriver.RAM && keyStorage !== undefined) {
|
|
32
|
-
throw new errors_1.
|
|
32
|
+
throw new errors_1.InvalidConfigError('Cannot use a persistent key storage in not persistent mode.');
|
|
33
33
|
}
|
|
34
34
|
return {
|
|
35
35
|
storage: (0, random_access_storage_1.createStorage)({
|
|
@@ -51,7 +51,7 @@ const createKeyStorage = (path, type) => {
|
|
|
51
51
|
case 'ram':
|
|
52
52
|
return (0, memdown_1.default)();
|
|
53
53
|
default:
|
|
54
|
-
throw new errors_1.
|
|
54
|
+
throw new errors_1.InvalidConfigError(`Invalid key storage type: ${defaultedType}`);
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
57
|
const toStorageType = (type) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.js","sourceRoot":"","sources":["../../../../src/packlets/storage/storage.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,wDAAgC,CAAC,4CAA4C;AAC7E,wDAA+B;AAC/B,sDAA8B;AAE9B,8DAA4D;AAC5D,uEAAyE;AACzE,qCAAoC;AAEpC,IAAO,aAAa,GAAG,gBAAO,CAAC,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"storage.js","sourceRoot":"","sources":["../../../../src/packlets/storage/storage.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,wDAAgC,CAAC,4CAA4C;AAC7E,wDAA+B;AAC/B,sDAA8B;AAE9B,yCAAkD;AAClD,8DAA4D;AAC5D,uEAAyE;AACzE,qCAAoC;AAEpC,IAAO,aAAa,GAAG,gBAAO,CAAC,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC;AAI5D,4BAA4B;AACrB,MAAM,oBAAoB,GAAG,CAAC,MAA8B,EAAE,EAAE;IACrE,MAAM,EACJ,IAAI,GAAG,cAAc,EAAE,kCAAkC;IACzD,WAAW,EACX,UAAU,EACV,UAAU,GAAG,KAAK,EACnB,GAAG,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,EAAE,CAAC;IAEjB,IAAI,UAAU,IAAI,WAAW,KAAK,aAAa,CAAC,GAAG,EAAE;QACnD,MAAM,IAAI,2BAAkB,CAAC,gDAAgD,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+
// TODO(burdon): Remove @dxos/client-testing.
|
|
50
50
|
// TODO(burdon): Create builder and make configurable.
|
|
51
51
|
const syncItems = async (space1, space2) => {
|
|
52
52
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-builder.js","sourceRoot":"","sources":["../../../../src/packlets/testing/test-builder.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAEF,+BAA8B;AAI9B,+CAAkF;AAClF,2DAA+E;AAC/E,uEAAkF;AAElF,0CAA4F;AAE5F,EAAE;AACF,2CAA2C;AAC3C,EAAE;AAEK,MAAM,iBAAiB,GAAG,CAAC,MAAc,EAAE,oBAAgD,EAAE,EAAE;IACpG,MAAM,cAAc,GAAG,IAAI,gCAAc,CAAC;QACxC,aAAa,EAAE,IAAI,+BAAmB,CAAC,oBAAoB,CAAC;QAC5D,gBAAgB,EAAE,wCAAsB;KACzC,CAAC,CAAC;IAEH,OAAO,IAAI,6BAAkB,CAAC;QAC5B,MAAM;QACN,cAAc;KACf,CAAC,CAAC;AACL,CAAC,CAAC;AAVW,QAAA,iBAAiB,qBAU5B;AAEK,MAAM,oBAAoB,GAAG,CAAC,EACnC,aAAa,GAAG,IAAI,sCAA0B,EAAE,EAChD,OAAO,GAAG,IAAA,qCAAa,EAAC,EAAE,IAAI,EAAE,mCAAW,CAAC,GAAG,EAAE,CAAC,KAIhD,EAAE,EAAE,EAAE;IACR,MAAM,cAAc,GAAG,IAAI,gCAAc,CAAC;QACxC,aAAa,EAAE,IAAI,+BAAmB,CAAC,aAAa,CAAC;QACrD,gBAAgB,EAAE,wCAAsB;KACzC,CAAC,CAAC;IAEH,MAAM,YAAY,GAAG,IAAA,oCAAyB,GAAE,CAAC;IACjD,OAAO,IAAI,yBAAc,CAAC,OAAO,EAAE,cAAc,EAAE,YAAY,CAAC,CAAC;AACnE,CAAC,CAAC;AAdW,QAAA,oBAAoB,wBAc/B;AAEK,MAAM,WAAW,GAAG,KAAK,EA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AE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;QACpE,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,QAAS,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;QACrE,IAAA,aAAM,EAAC,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;KAClC;IAED;QACE,qCAAqC;QACrC,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,QAAS,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;QACpE,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,QAAS,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;QACrE,IAAA,aAAM,EAAC,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;KAClC;AACH,CAAC,CAAC;AAdW,QAAA,SAAS,aAcpB"}
|
|
@@ -52,7 +52,7 @@ class WorkerSession {
|
|
|
52
52
|
await this.close();
|
|
53
53
|
}
|
|
54
54
|
catch (err) {
|
|
55
|
-
log_1.log.catch(err, {}, { file: "packages/sdk/client-services/src/packlets/vault/worker-session.ts", line: 83, scope: this, bugcheck: "If you see this message then it means that the source code preprocessor for @dxos/log is broken. It probably has misinterpreted an unrelated call for a logger invocation." });
|
|
55
|
+
log_1.log.catch(err, {}, { file: "packages/sdk/client-services/src/packlets/vault/worker-session.ts", line: 83, scope: this, bugcheck: "If you see this message then it means that the source code preprocessor for @dxos/log is broken. It probably has misinterpreted an unrelated call for a logger invocation.", callSite: (fn, args) => fn(...args) });
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
58
|
}
|
|
@@ -75,7 +75,7 @@ class WorkerSession {
|
|
|
75
75
|
await this.close();
|
|
76
76
|
}
|
|
77
77
|
catch (err) {
|
|
78
|
-
log_1.log.catch(err, {}, { file: "packages/sdk/client-services/src/packlets/vault/worker-session.ts", line: 108, scope: this, bugcheck: "If you see this message then it means that the source code preprocessor for @dxos/log is broken. It probably has misinterpreted an unrelated call for a logger invocation." });
|
|
78
|
+
log_1.log.catch(err, {}, { file: "packages/sdk/client-services/src/packlets/vault/worker-session.ts", line: 108, scope: this, bugcheck: "If you see this message then it means that the source code preprocessor for @dxos/log is broken. It probably has misinterpreted an unrelated call for a logger invocation.", callSite: (fn, args) => fn(...args) });
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
}, this._options.heartbeatInterval);
|
|
@@ -85,7 +85,7 @@ class WorkerSession {
|
|
|
85
85
|
await this.onClose.callIfSet();
|
|
86
86
|
}
|
|
87
87
|
catch (err) {
|
|
88
|
-
log_1.log.catch(err, {}, { file: "packages/sdk/client-services/src/packlets/vault/worker-session.ts", line: 118, scope: this, bugcheck: "If you see this message then it means that the source code preprocessor for @dxos/log is broken. It probably has misinterpreted an unrelated call for a logger invocation." });
|
|
88
|
+
log_1.log.catch(err, {}, { file: "packages/sdk/client-services/src/packlets/vault/worker-session.ts", line: 118, scope: this, bugcheck: "If you see this message then it means that the source code preprocessor for @dxos/log is broken. It probably has misinterpreted an unrelated call for a logger invocation.", callSite: (fn, args) => fn(...args) });
|
|
89
89
|
}
|
|
90
90
|
if (this._heartbeatTimer !== undefined) {
|
|
91
91
|
clearInterval(this._heartbeatTimer);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker-session.js","sourceRoot":"","sources":["../../../../src/packlets/vault/worker-session.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAEF,uCAAsC;AACtC,mCAAgC;AAEhC,mCAAsE;AACtE,qCAAsC;AAEtC,0CAAsE;AACtE,yCAA2F;AAY3F;;GAEG;AACH,MAAa,aAAa;IAaxB,YAAY,EACV,WAAW,EACX,UAAU,EACV,OAAO,EACP,OAAO,GAAG;QACR,iBAAiB,EAA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,EAAE;gBACZ,IAAI;oBACF,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;iBACpB;gBAAC,OAAO,GAAQ,EAAE;oBACjB,SAAG,CAAC,KAAK,CAAC,GAAG,yUAAC,CAAC;iBAChB;aACF;QACH,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;IACtC,CAAC;IAED,KAAK,CAAC,KAAK;QACT,IAAI;YACF,MAAM,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;SAChC;QAAC,OAAO,GAAQ,EAAE;YACjB,SAAG,CAAC,KAAK,CAAC,GAAG,yUAAC,CAAC;SAChB;QAED,IAAI,IAAI,CAAC,eAAe,KAAK,SAAS,EAAE;YACtC,aAAa,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;SACrC;QAED,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IACxE,CAAC;CACF;AApGD,sCAoGC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/client-services",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.11",
|
|
4
4
|
"description": "DXOS client services implementation",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
},
|
|
13
13
|
"types": "dist/src/index.d.ts",
|
|
14
14
|
"files": [
|
|
15
|
+
"testing.d.ts",
|
|
16
|
+
"testing.js",
|
|
15
17
|
"dist",
|
|
16
18
|
"src"
|
|
17
19
|
],
|
|
@@ -22,35 +24,36 @@
|
|
|
22
24
|
"jsondown": "dxos/jsondown#main",
|
|
23
25
|
"level-js": "^5.0.2",
|
|
24
26
|
"memdown": "^5.1.0",
|
|
25
|
-
"@dxos/async": "0.1.
|
|
26
|
-
"@dxos/codec-protobuf": "0.1.
|
|
27
|
-
"@dxos/config": "0.1.
|
|
28
|
-
"@dxos/credentials": "0.1.
|
|
29
|
-
"@dxos/crypto": "0.1.
|
|
30
|
-
"@dxos/debug": "0.1.
|
|
31
|
-
"@dxos/echo-db": "0.1.
|
|
32
|
-
"@dxos/
|
|
33
|
-
"@dxos/
|
|
34
|
-
"@dxos/
|
|
35
|
-
"@dxos/
|
|
36
|
-
"@dxos/
|
|
37
|
-
"@dxos/
|
|
38
|
-
"@dxos/
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
27
|
+
"@dxos/async": "0.1.11",
|
|
28
|
+
"@dxos/codec-protobuf": "0.1.11",
|
|
29
|
+
"@dxos/config": "0.1.11",
|
|
30
|
+
"@dxos/credentials": "0.1.11",
|
|
31
|
+
"@dxos/crypto": "0.1.11",
|
|
32
|
+
"@dxos/debug": "0.1.11",
|
|
33
|
+
"@dxos/echo-db": "0.1.11",
|
|
34
|
+
"@dxos/errors": "0.1.9",
|
|
35
|
+
"@dxos/feed-store": "0.1.11",
|
|
36
|
+
"@dxos/keyring": "0.1.11",
|
|
37
|
+
"@dxos/keys": "0.1.11",
|
|
38
|
+
"@dxos/log": "0.1.11",
|
|
39
|
+
"@dxos/messaging": "0.1.11",
|
|
40
|
+
"@dxos/model-factory": "0.1.11",
|
|
41
|
+
"@dxos/network-manager": "0.1.11",
|
|
42
|
+
"@dxos/object-model": "0.1.11",
|
|
43
|
+
"@dxos/protocol-plugin-rpc": "0.1.11",
|
|
44
|
+
"@dxos/protocols": "0.1.11",
|
|
45
|
+
"@dxos/random-access-storage": "0.1.11",
|
|
46
|
+
"@dxos/rpc": "0.1.11",
|
|
47
|
+
"@dxos/text-model": "0.1.11",
|
|
48
|
+
"@dxos/timeframe": "0.1.11",
|
|
49
|
+
"@dxos/util": "0.1.11"
|
|
47
50
|
},
|
|
48
51
|
"devDependencies": {
|
|
49
52
|
"@types/level-js": "~4.0.1",
|
|
50
53
|
"@types/memdown": "^3.0.0",
|
|
51
54
|
"@types/readable-stream": "^2.3.9",
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
55
|
+
"@dxos/signal": "0.1.11",
|
|
56
|
+
"@dxos/testutils": "0.1.11"
|
|
54
57
|
},
|
|
55
58
|
"publishConfig": {
|
|
56
59
|
"access": "public"
|
|
@@ -64,8 +67,5 @@
|
|
|
64
67
|
]
|
|
65
68
|
}
|
|
66
69
|
]
|
|
67
|
-
},
|
|
68
|
-
"scripts": {
|
|
69
|
-
"check": "true"
|
|
70
70
|
}
|
|
71
71
|
}
|
package/src/index.ts
CHANGED
|
@@ -7,6 +7,7 @@ import assert from 'node:assert';
|
|
|
7
7
|
import { EventSubscriptions } from '@dxos/async';
|
|
8
8
|
import { Stream } from '@dxos/codec-protobuf';
|
|
9
9
|
import { todo } from '@dxos/debug';
|
|
10
|
+
import { log } from '@dxos/log';
|
|
10
11
|
import {
|
|
11
12
|
AuthenticateInvitationRequest,
|
|
12
13
|
CreateSnapshotRequest,
|
|
@@ -96,22 +97,22 @@ export class SpaceServiceImpl implements SpaceService {
|
|
|
96
97
|
const subscriptions = new EventSubscriptions();
|
|
97
98
|
|
|
98
99
|
const onUpdate = () => {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
100
|
+
const spaces = Array.from(this.serviceContext.spaceManager!.spaces.values()).map(
|
|
101
|
+
(space): Space => ({
|
|
102
|
+
publicKey: space.key,
|
|
103
|
+
isOpen: true,
|
|
104
|
+
isActive: true,
|
|
105
|
+
members: Array.from(space.spaceState.members.values()).map((member) => ({
|
|
106
|
+
identityKey: member.key,
|
|
107
|
+
profile: {
|
|
106
108
|
identityKey: member.key,
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
});
|
|
109
|
+
displayName: member.assertion.profile?.displayName ?? humanize(member.key)
|
|
110
|
+
}
|
|
111
|
+
}))
|
|
112
|
+
})
|
|
113
|
+
);
|
|
114
|
+
log('update', { spaces });
|
|
115
|
+
next({ spaces });
|
|
115
116
|
};
|
|
116
117
|
|
|
117
118
|
setTimeout(async () => {
|
|
@@ -130,6 +131,10 @@ export class SpaceServiceImpl implements SpaceService {
|
|
|
130
131
|
})
|
|
131
132
|
);
|
|
132
133
|
|
|
134
|
+
this.serviceContext.spaceManager!.spaces.forEach((space) => {
|
|
135
|
+
subscriptions.add(space.stateUpdate.on(onUpdate));
|
|
136
|
+
});
|
|
137
|
+
|
|
133
138
|
onUpdate();
|
|
134
139
|
});
|
|
135
140
|
|
|
@@ -208,11 +213,7 @@ export class SpaceServiceImpl implements SpaceService {
|
|
|
208
213
|
}
|
|
209
214
|
|
|
210
215
|
subscribeMembers(request: SubscribeMembersRequest): Stream<SubscribeMembersResponse> {
|
|
211
|
-
return
|
|
212
|
-
next({
|
|
213
|
-
members: []
|
|
214
|
-
});
|
|
215
|
-
});
|
|
216
|
+
return todo();
|
|
216
217
|
// const space = this.echo.getSpace(request.space_key);
|
|
217
218
|
// if (space) {
|
|
218
219
|
// return resultSetToStream(space.queryMembers(), (members): SubscribeMembersResponse => ({ members }));
|
|
@@ -3,14 +3,15 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { Config } from '@dxos/config';
|
|
6
|
-
import { todo } from '@dxos/debug';
|
|
7
6
|
import { SystemService } from '@dxos/protocols/proto/dxos/client';
|
|
8
7
|
|
|
8
|
+
import { ServiceContext } from '../services';
|
|
9
|
+
|
|
9
10
|
/**
|
|
10
11
|
* @deprecated
|
|
11
12
|
*/
|
|
12
13
|
export class SystemServiceImpl implements SystemService {
|
|
13
|
-
constructor(private readonly _config: Config) {}
|
|
14
|
+
constructor(private readonly _config: Config, private readonly _serviceContext: ServiceContext) {}
|
|
14
15
|
|
|
15
16
|
// TODO(burdon): Remove.
|
|
16
17
|
async initSession() {
|
|
@@ -21,8 +22,7 @@ export class SystemServiceImpl implements SystemService {
|
|
|
21
22
|
return this._config.values;
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
// TODO(burdon): Reset ServiceContext
|
|
25
25
|
async reset(request: any) {
|
|
26
|
-
|
|
26
|
+
await this._serviceContext.reset();
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -61,7 +61,7 @@ export const subscribeToFeedBlocks = (
|
|
|
61
61
|
}
|
|
62
62
|
const subscriptions = new EventSubscriptions();
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
const timeout = setTimeout(async () => {
|
|
65
65
|
const feed = feedStore.getFeed(feedKey);
|
|
66
66
|
if (!feed) {
|
|
67
67
|
return;
|
|
@@ -93,5 +93,6 @@ export const subscribeToFeedBlocks = (
|
|
|
93
93
|
|
|
94
94
|
return () => {
|
|
95
95
|
subscriptions.clear();
|
|
96
|
+
clearTimeout(timeout);
|
|
96
97
|
};
|
|
97
98
|
});
|
|
@@ -37,7 +37,7 @@ export const subscribeToSpaces = (context: ServiceContext, { spaceKeys = [] }: S
|
|
|
37
37
|
});
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
const timeout = setTimeout(async () => {
|
|
41
41
|
await context.initialized.wait();
|
|
42
42
|
unsubscribe = context.spaceManager!.updated.on(() => update());
|
|
43
43
|
|
|
@@ -47,5 +47,6 @@ export const subscribeToSpaces = (context: ServiceContext, { spaceKeys = [] }: S
|
|
|
47
47
|
|
|
48
48
|
return () => {
|
|
49
49
|
unsubscribe?.();
|
|
50
|
+
clearTimeout(timeout);
|
|
50
51
|
};
|
|
51
52
|
});
|
|
@@ -18,7 +18,7 @@ import { createProtoRpcPeer } from '@dxos/rpc';
|
|
|
18
18
|
import { IdentityManager } from '../identity';
|
|
19
19
|
import {
|
|
20
20
|
AuthenticatingInvitationProvider,
|
|
21
|
-
|
|
21
|
+
CancellableInvitationObservable,
|
|
22
22
|
InvitationObservableProvider,
|
|
23
23
|
AUTHENTICATION_CODE_LENGTH,
|
|
24
24
|
INVITATION_TIMEOUT,
|
|
@@ -42,7 +42,7 @@ export class HaloInvitationsHandler extends AbstractInvitationsHandler {
|
|
|
42
42
|
/**
|
|
43
43
|
* Creates an invitation and listens for a join request from the invited (guest) peer.
|
|
44
44
|
*/
|
|
45
|
-
createInvitation(context: void, options?: InvitationsOptions):
|
|
45
|
+
createInvitation(context: void, options?: InvitationsOptions): CancellableInvitationObservable {
|
|
46
46
|
let swarmConnection: SwarmConnection | undefined;
|
|
47
47
|
const { type, timeout = INVITATION_TIMEOUT, swarmKey } = options ?? {};
|
|
48
48
|
assert(type !== Invitation.Type.OFFLINE);
|
|
@@ -6,7 +6,7 @@ import { PublicKey } from '@dxos/keys';
|
|
|
6
6
|
import { NetworkManager } from '@dxos/network-manager';
|
|
7
7
|
import { Invitation } from '@dxos/protocols/proto/dxos/client/services';
|
|
8
8
|
|
|
9
|
-
import { AuthenticatingInvitationObservable,
|
|
9
|
+
import { AuthenticatingInvitationObservable, CancellableInvitationObservable } from './invitations';
|
|
10
10
|
|
|
11
11
|
export type InvitationsOptions = {
|
|
12
12
|
type?: Invitation.Type;
|
|
@@ -43,7 +43,7 @@ export type InvitationsOptions = {
|
|
|
43
43
|
* ```
|
|
44
44
|
*/
|
|
45
45
|
export interface InvitationsHandler<T = void> {
|
|
46
|
-
createInvitation(context: T, options?: InvitationsOptions):
|
|
46
|
+
createInvitation(context: T, options?: InvitationsOptions): CancellableInvitationObservable;
|
|
47
47
|
acceptInvitation(invitation: Invitation, options?: InvitationsOptions): AuthenticatingInvitationObservable;
|
|
48
48
|
}
|
|
49
49
|
|
|
@@ -57,6 +57,6 @@ export abstract class AbstractInvitationsHandler<T = void> implements Invitation
|
|
|
57
57
|
protected readonly _networkManager: NetworkManager
|
|
58
58
|
) {}
|
|
59
59
|
|
|
60
|
-
abstract createInvitation(context: T, options?: InvitationsOptions):
|
|
60
|
+
abstract createInvitation(context: T, options?: InvitationsOptions): CancellableInvitationObservable;
|
|
61
61
|
abstract acceptInvitation(invitation: Invitation, options?: InvitationsOptions): AuthenticatingInvitationObservable;
|
|
62
62
|
}
|
|
@@ -12,7 +12,7 @@ import { Invitation } from '@dxos/protocols/proto/dxos/client/services';
|
|
|
12
12
|
import {
|
|
13
13
|
AuthenticatingInvitationObservable,
|
|
14
14
|
AuthenticatingInvitationProvider,
|
|
15
|
-
|
|
15
|
+
CancellableInvitationObservable,
|
|
16
16
|
InvitationObservableProvider,
|
|
17
17
|
InvitationsService
|
|
18
18
|
} from './invitations';
|
|
@@ -34,7 +34,7 @@ export abstract class AbstractInvitationsProxy<T = void> implements InvitationsP
|
|
|
34
34
|
|
|
35
35
|
abstract getInvitationOptions(context: T): Invitation;
|
|
36
36
|
|
|
37
|
-
createInvitation(context: T, options?: InvitationsOptions):
|
|
37
|
+
createInvitation(context: T, options?: InvitationsOptions): CancellableInvitationObservable {
|
|
38
38
|
let invitationId: string;
|
|
39
39
|
const observable = new InvitationObservableProvider(async () => {
|
|
40
40
|
if (invitationId) {
|