@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
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
InvitationsManager,
|
|
8
8
|
ServiceContext,
|
|
9
9
|
SpaceInvitationProtocol
|
|
10
|
-
} from "../../chunk-
|
|
10
|
+
} from "../../chunk-XEFU5A4F.mjs";
|
|
11
11
|
|
|
12
12
|
// packages/sdk/client-services/src/packlets/testing/credential-utils.ts
|
|
13
13
|
import { createCredential } from "@dxos/credentials";
|
|
@@ -26,8 +26,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_C76GOJIJ_exports = {};
|
|
30
|
+
__export(chunk_C76GOJIJ_exports, {
|
|
31
31
|
ClientRpcServer: () => ClientRpcServer,
|
|
32
32
|
ClientServicesHost: () => ClientServicesHost,
|
|
33
33
|
ClientServicesProviderResource: () => ClientServicesProviderResource,
|
|
@@ -67,7 +67,7 @@ __export(chunk_5463POZV_exports, {
|
|
|
67
67
|
subscribeToSpaces: () => subscribeToSpaces,
|
|
68
68
|
subscribeToSwarmInfo: () => subscribeToSwarmInfo
|
|
69
69
|
});
|
|
70
|
-
module.exports = __toCommonJS(
|
|
70
|
+
module.exports = __toCommonJS(chunk_C76GOJIJ_exports);
|
|
71
71
|
var import_async = require("@dxos/async");
|
|
72
72
|
var import_codec_protobuf = require("@dxos/codec-protobuf");
|
|
73
73
|
var import_feed_store = require("@dxos/feed-store");
|
|
@@ -229,6 +229,7 @@ var import_invariant14 = require("@dxos/invariant");
|
|
|
229
229
|
var import_log13 = require("@dxos/log");
|
|
230
230
|
var import_protocols11 = require("@dxos/protocols");
|
|
231
231
|
var import_services11 = require("@dxos/protocols/proto/dxos/client/services");
|
|
232
|
+
var import_tracing6 = require("@dxos/tracing");
|
|
232
233
|
var import_async16 = require("@dxos/async");
|
|
233
234
|
var import_context12 = require("@dxos/context");
|
|
234
235
|
var import_credentials18 = require("@dxos/credentials");
|
|
@@ -243,7 +244,7 @@ var import_log14 = require("@dxos/log");
|
|
|
243
244
|
var import_protocols12 = require("@dxos/protocols");
|
|
244
245
|
var import_services12 = require("@dxos/protocols/proto/dxos/client/services");
|
|
245
246
|
var import_teleport_extension_object_sync = require("@dxos/teleport-extension-object-sync");
|
|
246
|
-
var
|
|
247
|
+
var import_tracing7 = require("@dxos/tracing");
|
|
247
248
|
var import_util9 = require("@dxos/util");
|
|
248
249
|
var import_async17 = require("@dxos/async");
|
|
249
250
|
var import_codec_protobuf11 = require("@dxos/codec-protobuf");
|
|
@@ -251,11 +252,11 @@ var import_credentials19 = require("@dxos/credentials");
|
|
|
251
252
|
var import_invariant16 = require("@dxos/invariant");
|
|
252
253
|
var import_protocols13 = require("@dxos/protocols");
|
|
253
254
|
var import_services13 = require("@dxos/protocols/proto/dxos/client/services");
|
|
254
|
-
var
|
|
255
|
+
var import_tracing8 = require("@dxos/tracing");
|
|
255
256
|
var import_services14 = require("@dxos/protocols/proto/dxos/client/services");
|
|
256
257
|
var import_config = require("@dxos/config");
|
|
257
258
|
var import_services15 = require("@dxos/protocols/proto/dxos/client/services");
|
|
258
|
-
var
|
|
259
|
+
var import_tracing9 = require("@dxos/tracing");
|
|
259
260
|
var import_util10 = require("@dxos/util");
|
|
260
261
|
var import_async18 = require("@dxos/async");
|
|
261
262
|
var import_client_protocol5 = require("@dxos/client-protocol");
|
|
@@ -269,7 +270,7 @@ var import_messaging = require("@dxos/messaging");
|
|
|
269
270
|
var import_network_manager2 = require("@dxos/network-manager");
|
|
270
271
|
var import_protocols14 = require("@dxos/protocols");
|
|
271
272
|
var import_services16 = require("@dxos/protocols/proto/dxos/client/services");
|
|
272
|
-
var
|
|
273
|
+
var import_tracing10 = require("@dxos/tracing");
|
|
273
274
|
var import_util11 = require("@dxos/util");
|
|
274
275
|
var import_websocket_rpc = require("@dxos/websocket-rpc");
|
|
275
276
|
var import_async19 = require("@dxos/async");
|
|
@@ -4823,6 +4824,7 @@ var SpacesServiceImpl = class {
|
|
|
4823
4824
|
this._requireIdentity();
|
|
4824
4825
|
const dataSpaceManager = await this._getDataSpaceManager();
|
|
4825
4826
|
const space = await dataSpaceManager.createSpace();
|
|
4827
|
+
await this._updateMetrics();
|
|
4826
4828
|
return this._serializeSpace(space);
|
|
4827
4829
|
}
|
|
4828
4830
|
async updateSpace({ spaceKey, state }) {
|
|
@@ -4856,7 +4858,7 @@ var SpacesServiceImpl = class {
|
|
|
4856
4858
|
const credentials = await (0, import_credentials17.createAdmissionCredentials)(identity.getIdentityCredentialSigner(), request.memberKey, space.key, space.genesisFeedKey, request.newRole, space.spaceState.membershipChainHeads);
|
|
4857
4859
|
(0, import_invariant14.invariant)(credentials[0].credential, void 0, {
|
|
4858
4860
|
F: __dxlog_file15,
|
|
4859
|
-
L:
|
|
4861
|
+
L: 97,
|
|
4860
4862
|
S: this,
|
|
4861
4863
|
A: [
|
|
4862
4864
|
"credentials[0].credential",
|
|
@@ -4866,7 +4868,7 @@ var SpacesServiceImpl = class {
|
|
|
4866
4868
|
const spaceMemberCredential = credentials[0].credential.credential;
|
|
4867
4869
|
(0, import_invariant14.invariant)((0, import_credentials17.getCredentialAssertion)(spaceMemberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
|
|
4868
4870
|
F: __dxlog_file15,
|
|
4869
|
-
L:
|
|
4871
|
+
L: 99,
|
|
4870
4872
|
S: this,
|
|
4871
4873
|
A: [
|
|
4872
4874
|
"getCredentialAssertion(spaceMemberCredential)['@type'] === 'dxos.halo.credentials.SpaceMember'",
|
|
@@ -4884,10 +4886,11 @@ var SpacesServiceImpl = class {
|
|
|
4884
4886
|
spaces
|
|
4885
4887
|
}, {
|
|
4886
4888
|
F: __dxlog_file15,
|
|
4887
|
-
L:
|
|
4889
|
+
L: 110,
|
|
4888
4890
|
S: this,
|
|
4889
4891
|
C: (f, a) => f(...a)
|
|
4890
4892
|
});
|
|
4893
|
+
await this._updateMetrics();
|
|
4891
4894
|
next({
|
|
4892
4895
|
spaces
|
|
4893
4896
|
});
|
|
@@ -4967,7 +4970,7 @@ var SpacesServiceImpl = class {
|
|
|
4967
4970
|
} else {
|
|
4968
4971
|
(0, import_invariant14.invariant)(!credential.id, "Id on unsigned credentials is not allowed", {
|
|
4969
4972
|
F: __dxlog_file15,
|
|
4970
|
-
L:
|
|
4973
|
+
L: 198,
|
|
4971
4974
|
S: this,
|
|
4972
4975
|
A: [
|
|
4973
4976
|
"!credential.id",
|
|
@@ -4976,7 +4979,7 @@ var SpacesServiceImpl = class {
|
|
|
4976
4979
|
});
|
|
4977
4980
|
(0, import_invariant14.invariant)(this._identityManager.identity, "Identity is not available", {
|
|
4978
4981
|
F: __dxlog_file15,
|
|
4979
|
-
L:
|
|
4982
|
+
L: 199,
|
|
4980
4983
|
S: this,
|
|
4981
4984
|
A: [
|
|
4982
4985
|
"this._identityManager.identity",
|
|
@@ -4986,7 +4989,7 @@ var SpacesServiceImpl = class {
|
|
|
4986
4989
|
const signer = this._identityManager.identity.getIdentityCredentialSigner();
|
|
4987
4990
|
(0, import_invariant14.invariant)(credential.issuer.equals(signer.getIssuer()), void 0, {
|
|
4988
4991
|
F: __dxlog_file15,
|
|
4989
|
-
L:
|
|
4992
|
+
L: 201,
|
|
4990
4993
|
S: this,
|
|
4991
4994
|
A: [
|
|
4992
4995
|
"credential.issuer.equals(signer.getIssuer())",
|
|
@@ -5057,6 +5060,17 @@ var SpacesServiceImpl = class {
|
|
|
5057
5060
|
}
|
|
5058
5061
|
return this._identityManager.identity;
|
|
5059
5062
|
}
|
|
5063
|
+
async _updateMetrics() {
|
|
5064
|
+
const dataSpaceManager = await this._getDataSpaceManager();
|
|
5065
|
+
const identity = this._identityManager.identity?.identityKey.truncate();
|
|
5066
|
+
if (identity) {
|
|
5067
|
+
import_tracing6.trace.metrics.gauge("echo.space.count", dataSpaceManager.spaces.size, {
|
|
5068
|
+
tags: {
|
|
5069
|
+
identity
|
|
5070
|
+
}
|
|
5071
|
+
});
|
|
5072
|
+
}
|
|
5073
|
+
}
|
|
5060
5074
|
};
|
|
5061
5075
|
var getChannelId = (channel) => `user-channel/${channel}`;
|
|
5062
5076
|
function _ts_decorate6(decorators, target, key, desc) {
|
|
@@ -5317,14 +5331,14 @@ var ServiceContext = class extends import_context12.Resource {
|
|
|
5317
5331
|
}
|
|
5318
5332
|
};
|
|
5319
5333
|
_ts_decorate6([
|
|
5320
|
-
|
|
5334
|
+
import_tracing7.trace.span()
|
|
5321
5335
|
], ServiceContext.prototype, "_open", null);
|
|
5322
5336
|
_ts_decorate6([
|
|
5323
|
-
|
|
5337
|
+
import_tracing7.trace.span()
|
|
5324
5338
|
], ServiceContext.prototype, "_initialize", null);
|
|
5325
5339
|
ServiceContext = _ts_decorate6([
|
|
5326
5340
|
(0, import_util9.safeInstanceof)("dxos.client-services.ServiceContext"),
|
|
5327
|
-
|
|
5341
|
+
import_tracing7.trace.resource()
|
|
5328
5342
|
], ServiceContext);
|
|
5329
5343
|
var ServiceRegistry = class {
|
|
5330
5344
|
// prettier-ignore
|
|
@@ -5348,7 +5362,7 @@ var ServiceRegistry = class {
|
|
|
5348
5362
|
delete this._handlers[name];
|
|
5349
5363
|
}
|
|
5350
5364
|
};
|
|
5351
|
-
var DXOS_VERSION = "0.5.6-
|
|
5365
|
+
var DXOS_VERSION = "0.5.6-next.e11ff5d";
|
|
5352
5366
|
var getPlatform = () => {
|
|
5353
5367
|
if (process.browser) {
|
|
5354
5368
|
if (typeof window !== "undefined") {
|
|
@@ -5388,7 +5402,7 @@ var createDiagnostics = async (clientServices, serviceContext, config) => {
|
|
|
5388
5402
|
version: import_protocols13.STORAGE_VERSION
|
|
5389
5403
|
}
|
|
5390
5404
|
},
|
|
5391
|
-
trace:
|
|
5405
|
+
trace: import_tracing8.TRACE_PROCESSOR.getDiagnostics()
|
|
5392
5406
|
};
|
|
5393
5407
|
await Promise.all([
|
|
5394
5408
|
(async () => {
|
|
@@ -5915,7 +5929,7 @@ var ClientServicesHost = class {
|
|
|
5915
5929
|
callbacks,
|
|
5916
5930
|
runtimeParams
|
|
5917
5931
|
} = {}) {
|
|
5918
|
-
this._tracingService =
|
|
5932
|
+
this._tracingService = import_tracing10.TRACE_PROCESSOR.createTraceSender();
|
|
5919
5933
|
this._statusUpdate = new import_async18.Event();
|
|
5920
5934
|
this._opening = false;
|
|
5921
5935
|
this._open = false;
|
|
@@ -6277,21 +6291,21 @@ var ClientServicesHost = class {
|
|
|
6277
6291
|
}
|
|
6278
6292
|
};
|
|
6279
6293
|
_ts_decorate8([
|
|
6280
|
-
|
|
6294
|
+
import_tracing10.trace.info()
|
|
6281
6295
|
], ClientServicesHost.prototype, "_opening", void 0);
|
|
6282
6296
|
_ts_decorate8([
|
|
6283
|
-
|
|
6297
|
+
import_tracing10.trace.info()
|
|
6284
6298
|
], ClientServicesHost.prototype, "_open", void 0);
|
|
6285
6299
|
_ts_decorate8([
|
|
6286
6300
|
import_async18.synchronized,
|
|
6287
|
-
|
|
6301
|
+
import_tracing10.trace.span()
|
|
6288
6302
|
], ClientServicesHost.prototype, "open", null);
|
|
6289
6303
|
_ts_decorate8([
|
|
6290
6304
|
import_async18.synchronized,
|
|
6291
|
-
|
|
6305
|
+
import_tracing10.trace.span()
|
|
6292
6306
|
], ClientServicesHost.prototype, "close", null);
|
|
6293
6307
|
ClientServicesHost = _ts_decorate8([
|
|
6294
|
-
|
|
6308
|
+
import_tracing10.trace.resource()
|
|
6295
6309
|
], ClientServicesHost);
|
|
6296
6310
|
var ClientServicesProviderResource = Symbol.for("dxos.resource.ClientServices");
|
|
6297
6311
|
var GET_DIAGNOSTICS_RPC_TIMEOUT = 1e4;
|
|
@@ -6307,7 +6321,7 @@ var DiagnosticsCollector = class {
|
|
|
6307
6321
|
});
|
|
6308
6322
|
const clientDiagnostics = {
|
|
6309
6323
|
config,
|
|
6310
|
-
trace:
|
|
6324
|
+
trace: import_tracing9.TRACE_PROCESSOR.getDiagnostics()
|
|
6311
6325
|
};
|
|
6312
6326
|
const diagnostics = serviceDiagnostics != null ? {
|
|
6313
6327
|
client: clientDiagnostics,
|
|
@@ -6320,12 +6334,12 @@ var DiagnosticsCollector = class {
|
|
|
6320
6334
|
}
|
|
6321
6335
|
};
|
|
6322
6336
|
var findSystemServiceProvider = () => {
|
|
6323
|
-
const serviceProviders =
|
|
6337
|
+
const serviceProviders = import_tracing9.TRACE_PROCESSOR.findResourcesByAnnotation(ClientServicesProviderResource);
|
|
6324
6338
|
const providerResource = serviceProviders.find((r) => r.instance.deref()?.services?.SystemService != null);
|
|
6325
6339
|
return providerResource?.instance?.deref() ?? null;
|
|
6326
6340
|
};
|
|
6327
6341
|
var findConfigs = () => {
|
|
6328
|
-
const configs =
|
|
6342
|
+
const configs = import_tracing9.TRACE_PROCESSOR.findResourcesByAnnotation(import_config.ConfigResource);
|
|
6329
6343
|
return configs.map((r) => r.instance.deref()).filter(import_util10.nonNullable);
|
|
6330
6344
|
};
|
|
6331
6345
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -6369,4 +6383,4 @@ var findConfigs = () => {
|
|
|
6369
6383
|
subscribeToSpaces,
|
|
6370
6384
|
subscribeToSwarmInfo
|
|
6371
6385
|
});
|
|
6372
|
-
//# sourceMappingURL=chunk-
|
|
6386
|
+
//# sourceMappingURL=chunk-C76GOJIJ.cjs.map
|