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