@dxos/client-services 0.5.6-main.d5dee02 → 0.5.6-next.e11ff5d
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-A4HK3WDD.mjs → chunk-XEFU5A4F.mjs} +30 -16
- package/dist/lib/browser/{chunk-A4HK3WDD.mjs.map → chunk-XEFU5A4F.mjs.map} +3 -3
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/packlets/testing/index.mjs +1 -1
- package/dist/lib/node/{chunk-5463POZV.cjs → chunk-C76GOJIJ.cjs} +42 -28
- package/dist/lib/node/{chunk-5463POZV.cjs.map → chunk-C76GOJIJ.cjs.map} +3 -3
- package/dist/lib/node/index.cjs +44 -44
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/packlets/testing/index.cjs +8 -8
- package/dist/types/src/packlets/spaces/spaces-service.d.ts +1 -0
- package/dist/types/src/packlets/spaces/spaces-service.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/package.json +36 -36
- package/src/packlets/spaces/spaces-service.ts +13 -0
- package/src/version.ts +1 -1
|
@@ -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_C76GOJIJ = require("../../chunk-C76GOJIJ.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");
|
|
@@ -227,7 +227,7 @@ var createInvitation = async (host, options) => {
|
|
|
227
227
|
authMethod: import_services.Invitation.AuthMethod.NONE,
|
|
228
228
|
...options ?? {}
|
|
229
229
|
};
|
|
230
|
-
if (host instanceof
|
|
230
|
+
if (host instanceof import_chunk_C76GOJIJ.ServiceContext) {
|
|
231
231
|
return host.invitationsManager.createInvitation({
|
|
232
232
|
kind: import_services.Invitation.Kind.SPACE,
|
|
233
233
|
...options
|
|
@@ -237,7 +237,7 @@ var createInvitation = async (host, options) => {
|
|
|
237
237
|
};
|
|
238
238
|
var acceptInvitation = (guest, invitation, guestDeviceProfile) => {
|
|
239
239
|
invitation = sanitizeInvitation(invitation);
|
|
240
|
-
if (guest instanceof
|
|
240
|
+
if (guest instanceof import_chunk_C76GOJIJ.ServiceContext) {
|
|
241
241
|
return guest.invitationsManager.acceptInvitation({
|
|
242
242
|
invitation,
|
|
243
243
|
deviceProfile: guestDeviceProfile
|
|
@@ -246,7 +246,7 @@ var acceptInvitation = (guest, invitation, guestDeviceProfile) => {
|
|
|
246
246
|
return guest.join(invitation, guestDeviceProfile);
|
|
247
247
|
};
|
|
248
248
|
var createServiceHost = (config, signalManagerContext) => {
|
|
249
|
-
return new
|
|
249
|
+
return new import_chunk_C76GOJIJ.ClientServicesHost({
|
|
250
250
|
config,
|
|
251
251
|
signalManager: new import_messaging.MemorySignalManager(signalManagerContext),
|
|
252
252
|
transportFactory: import_network_manager.MemoryTransportFactory
|
|
@@ -262,7 +262,7 @@ var createServiceContext = async ({ signalContext = new import_messaging.MemoryS
|
|
|
262
262
|
});
|
|
263
263
|
const level = (0, import_testing.createTestLevel)();
|
|
264
264
|
await level.open();
|
|
265
|
-
return new
|
|
265
|
+
return new import_chunk_C76GOJIJ.ServiceContext(storage, level, networkManager, signalManager, {
|
|
266
266
|
invitationConnectionDefaultParams: {
|
|
267
267
|
controlHeartbeatInterval: 200
|
|
268
268
|
}
|
|
@@ -363,12 +363,12 @@ var TestPeer = class {
|
|
|
363
363
|
});
|
|
364
364
|
}
|
|
365
365
|
get dataSpaceManager() {
|
|
366
|
-
return this._props.dataSpaceManager ??= new
|
|
366
|
+
return this._props.dataSpaceManager ??= new import_chunk_C76GOJIJ.DataSpaceManager(this.spaceManager, this.metadataStore, this.keyring, this.identity, this.feedStore, this.echoHost, this.invitationsManager);
|
|
367
367
|
}
|
|
368
368
|
get invitationsManager() {
|
|
369
|
-
return this._props.invitationsManager ??= new
|
|
369
|
+
return this._props.invitationsManager ??= new import_chunk_C76GOJIJ.InvitationsManager(new import_chunk_C76GOJIJ.InvitationsHandler(this.networkManager), (invitation) => {
|
|
370
370
|
if (invitation.kind === import_services2.Invitation.Kind.SPACE) {
|
|
371
|
-
return new
|
|
371
|
+
return new import_chunk_C76GOJIJ.SpaceInvitationProtocol(this.dataSpaceManager, this.identity, this.keyring, invitation.spaceKey);
|
|
372
372
|
} else {
|
|
373
373
|
throw new Error("not implemented");
|
|
374
374
|
}
|
|
@@ -22,5 +22,6 @@ export declare class SpacesServiceImpl implements SpacesService {
|
|
|
22
22
|
createEpoch({ spaceKey, migration }: CreateEpochRequest): Promise<void>;
|
|
23
23
|
private _serializeSpace;
|
|
24
24
|
private _requireIdentity;
|
|
25
|
+
private _updateMetrics;
|
|
25
26
|
}
|
|
26
27
|
//# sourceMappingURL=spaces-service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spaces-service.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/spaces/spaces-service.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAG9C,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAWxD,OAAO,EAGL,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,KAAK,EACV,KAAK,aAAa,EAClB,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC7B,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,6CAA6C,CAAC;AAC9E,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,iDAAiD,CAAC;
|
|
1
|
+
{"version":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W,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,kBAAkB;IAMpE,iBAAiB,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,wBAAwB;IAajE,gBAAgB,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,uBAAuB,GAAG,MAAM,CAAC,UAAU,CAAC;IAmB7E,gBAAgB,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,uBAAuB;IAmBnE,WAAW,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,kBAAkB;IAM7D,OAAO,CAAC,eAAe;IA4CvB,OAAO,CAAC,gBAAgB;YASV,cAAc;CAS7B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const DXOS_VERSION = "0.5.6-
|
|
1
|
+
export declare const DXOS_VERSION = "0.5.6-next.e11ff5d";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/client-services",
|
|
3
|
-
"version": "0.5.6-
|
|
3
|
+
"version": "0.5.6-next.e11ff5d",
|
|
4
4
|
"description": "DXOS client services implementation",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -23,45 +23,45 @@
|
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"platform": "^1.3.6",
|
|
26
|
-
"@dxos/async": "0.5.6-
|
|
27
|
-
"@dxos/automerge": "0.5.6-
|
|
28
|
-
"@dxos/
|
|
29
|
-
"@dxos/
|
|
30
|
-
"@dxos/
|
|
31
|
-
"@dxos/context": "0.5.6-
|
|
32
|
-
"@dxos/credentials": "0.5.6-
|
|
33
|
-
"@dxos/crypto": "0.5.6-
|
|
34
|
-
"@dxos/debug": "0.5.6-
|
|
35
|
-
"@dxos/echo-db": "0.5.6-
|
|
36
|
-
"@dxos/echo-
|
|
37
|
-
"@dxos/echo-
|
|
38
|
-
"@dxos/echo-schema": "0.5.6-
|
|
39
|
-
"@dxos/feed-store": "0.5.6-
|
|
40
|
-
"@dxos/indexing": "0.5.6-
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/lock-file": "0.5.6-
|
|
46
|
-
"@dxos/log": "0.5.6-
|
|
47
|
-
"@dxos/messaging": "0.5.6-
|
|
48
|
-
"@dxos/network-manager": "0.5.6-
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/random-access-storage": "0.5.6-
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/teleport": "0.5.6-
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/teleport-extension-object-sync": "0.5.6-
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/util": "0.5.6-
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/
|
|
26
|
+
"@dxos/async": "0.5.6-next.e11ff5d",
|
|
27
|
+
"@dxos/automerge": "0.5.6-next.e11ff5d",
|
|
28
|
+
"@dxos/client-protocol": "0.5.6-next.e11ff5d",
|
|
29
|
+
"@dxos/codec-protobuf": "0.5.6-next.e11ff5d",
|
|
30
|
+
"@dxos/config": "0.5.6-next.e11ff5d",
|
|
31
|
+
"@dxos/context": "0.5.6-next.e11ff5d",
|
|
32
|
+
"@dxos/credentials": "0.5.6-next.e11ff5d",
|
|
33
|
+
"@dxos/crypto": "0.5.6-next.e11ff5d",
|
|
34
|
+
"@dxos/debug": "0.5.6-next.e11ff5d",
|
|
35
|
+
"@dxos/echo-db": "0.5.6-next.e11ff5d",
|
|
36
|
+
"@dxos/echo-pipeline": "0.5.6-next.e11ff5d",
|
|
37
|
+
"@dxos/echo-protocol": "0.5.6-next.e11ff5d",
|
|
38
|
+
"@dxos/echo-schema": "0.5.6-next.e11ff5d",
|
|
39
|
+
"@dxos/feed-store": "0.5.6-next.e11ff5d",
|
|
40
|
+
"@dxos/indexing": "0.5.6-next.e11ff5d",
|
|
41
|
+
"@dxos/keyring": "0.5.6-next.e11ff5d",
|
|
42
|
+
"@dxos/invariant": "0.5.6-next.e11ff5d",
|
|
43
|
+
"@dxos/keys": "0.5.6-next.e11ff5d",
|
|
44
|
+
"@dxos/kv-store": "0.5.6-next.e11ff5d",
|
|
45
|
+
"@dxos/lock-file": "0.5.6-next.e11ff5d",
|
|
46
|
+
"@dxos/log": "0.5.6-next.e11ff5d",
|
|
47
|
+
"@dxos/messaging": "0.5.6-next.e11ff5d",
|
|
48
|
+
"@dxos/network-manager": "0.5.6-next.e11ff5d",
|
|
49
|
+
"@dxos/protocols": "0.5.6-next.e11ff5d",
|
|
50
|
+
"@dxos/node-std": "0.5.6-next.e11ff5d",
|
|
51
|
+
"@dxos/random-access-storage": "0.5.6-next.e11ff5d",
|
|
52
|
+
"@dxos/teleport": "0.5.6-next.e11ff5d",
|
|
53
|
+
"@dxos/teleport-extension-gossip": "0.5.6-next.e11ff5d",
|
|
54
|
+
"@dxos/rpc": "0.5.6-next.e11ff5d",
|
|
55
|
+
"@dxos/teleport-extension-object-sync": "0.5.6-next.e11ff5d",
|
|
56
|
+
"@dxos/tracing": "0.5.6-next.e11ff5d",
|
|
57
|
+
"@dxos/util": "0.5.6-next.e11ff5d",
|
|
58
|
+
"@dxos/timeframe": "0.5.6-next.e11ff5d",
|
|
59
|
+
"@dxos/websocket-rpc": "0.5.6-next.e11ff5d"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@types/platform": "^1.3.4",
|
|
63
63
|
"@types/readable-stream": "^2.3.9",
|
|
64
|
-
"@dxos/signal": "0.5.6-
|
|
64
|
+
"@dxos/signal": "0.5.6-next.e11ff5d"
|
|
65
65
|
},
|
|
66
66
|
"publishConfig": {
|
|
67
67
|
"access": "public"
|
|
@@ -33,6 +33,7 @@ import {
|
|
|
33
33
|
} from '@dxos/protocols/proto/dxos/client/services';
|
|
34
34
|
import { type Credential } from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
35
35
|
import { type GossipMessage } from '@dxos/protocols/proto/dxos/mesh/teleport/gossip';
|
|
36
|
+
import { trace } from '@dxos/tracing';
|
|
36
37
|
import { type Provider } from '@dxos/util';
|
|
37
38
|
|
|
38
39
|
import { type DataSpace } from './data-space';
|
|
@@ -50,6 +51,7 @@ export class SpacesServiceImpl implements SpacesService {
|
|
|
50
51
|
this._requireIdentity();
|
|
51
52
|
const dataSpaceManager = await this._getDataSpaceManager();
|
|
52
53
|
const space = await dataSpaceManager.createSpace();
|
|
54
|
+
await this._updateMetrics();
|
|
53
55
|
return this._serializeSpace(space);
|
|
54
56
|
}
|
|
55
57
|
|
|
@@ -106,6 +108,7 @@ export class SpacesServiceImpl implements SpacesService {
|
|
|
106
108
|
const dataSpaceManager = await this._getDataSpaceManager();
|
|
107
109
|
const spaces = Array.from(dataSpaceManager.spaces.values()).map((space) => this._serializeSpace(space));
|
|
108
110
|
log('update', { spaces });
|
|
111
|
+
await this._updateMetrics();
|
|
109
112
|
next({ spaces });
|
|
110
113
|
},
|
|
111
114
|
{ maxFrequency: process.env.NODE_ENV === 'test' ? undefined : 2 },
|
|
@@ -263,6 +266,16 @@ export class SpacesServiceImpl implements SpacesService {
|
|
|
263
266
|
}
|
|
264
267
|
return this._identityManager.identity;
|
|
265
268
|
}
|
|
269
|
+
|
|
270
|
+
private async _updateMetrics() {
|
|
271
|
+
const dataSpaceManager = await this._getDataSpaceManager();
|
|
272
|
+
const identity = this._identityManager.identity?.identityKey.truncate();
|
|
273
|
+
if (identity) {
|
|
274
|
+
trace.metrics.gauge('echo.space.count', dataSpaceManager.spaces.size, {
|
|
275
|
+
tags: { identity },
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
}
|
|
266
279
|
}
|
|
267
280
|
|
|
268
281
|
// Add `user-channel` prefix to the channel name, so that it doesn't collide with the internal channels.
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const DXOS_VERSION = "0.5.6-
|
|
1
|
+
export const DXOS_VERSION = "0.5.6-next.e11ff5d";
|