@dxos/client-services 0.1.48-next.83f55fd → 0.1.48
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-LGYQZ6UO.mjs → chunk-KN2NX2RP.mjs} +11 -28
- package/dist/lib/browser/{chunk-LGYQZ6UO.mjs.map → chunk-KN2NX2RP.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/index.cjs +26 -43
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/packlets/testing/index.cjs +25 -42
- package/dist/lib/node/packlets/testing/index.cjs.map +3 -3
- package/dist/types/src/packlets/logging/logging-service.d.ts.map +1 -1
- package/package.json +30 -30
- package/src/packlets/logging/logging-service.ts +9 -31
|
@@ -2138,6 +2138,7 @@ var SpaceInvitationProtocol = class {
|
|
|
2138
2138
|
var import_async11 = require("@dxos/async");
|
|
2139
2139
|
var import_codec_protobuf9 = require("@dxos/codec-protobuf");
|
|
2140
2140
|
var import_log8 = require("@dxos/log");
|
|
2141
|
+
var import_util3 = require("@dxos/util");
|
|
2141
2142
|
var LoggingServiceImpl = class {
|
|
2142
2143
|
constructor() {
|
|
2143
2144
|
this._logs = new import_async11.Event();
|
|
@@ -2157,12 +2158,18 @@ var LoggingServiceImpl = class {
|
|
|
2157
2158
|
const filters = ((_a = request.filters) == null ? void 0 : _a.length) ? request.filters : void 0;
|
|
2158
2159
|
return new import_codec_protobuf9.Stream(({ ctx, next }) => {
|
|
2159
2160
|
const handler = (entry2) => {
|
|
2160
|
-
var _a2;
|
|
2161
|
+
var _a2, _b, _c;
|
|
2161
2162
|
if (((_a2 = entry2.meta) == null ? void 0 : _a2.file.includes("logging-service")) || entry2.context && Object.values(entry2.context).some((value) => typeof value === "string" && value.includes("LoggingService"))) {
|
|
2162
2163
|
return;
|
|
2163
2164
|
}
|
|
2164
2165
|
if ((0, import_log8.shouldLog)(entry2, filters)) {
|
|
2165
|
-
|
|
2166
|
+
const record = {
|
|
2167
|
+
...entry2,
|
|
2168
|
+
context: (0, import_util3.jsonify)((0, import_log8.getContextFromEntry)(entry2))
|
|
2169
|
+
};
|
|
2170
|
+
(_b = record.meta) == null ? true : delete _b.bugcheck;
|
|
2171
|
+
(_c = record.meta) == null ? true : delete _c.scope;
|
|
2172
|
+
next(record);
|
|
2166
2173
|
}
|
|
2167
2174
|
};
|
|
2168
2175
|
ctx.onDispose(() => {
|
|
@@ -2172,30 +2179,6 @@ var LoggingServiceImpl = class {
|
|
|
2172
2179
|
});
|
|
2173
2180
|
}
|
|
2174
2181
|
};
|
|
2175
|
-
var jsonify = (value, handles = /* @__PURE__ */ new WeakSet()) => {
|
|
2176
|
-
if (typeof value === "function") {
|
|
2177
|
-
return null;
|
|
2178
|
-
} else if (typeof value === "object" && value !== null) {
|
|
2179
|
-
if (handles.has(value)) {
|
|
2180
|
-
return null;
|
|
2181
|
-
}
|
|
2182
|
-
handles.add(value);
|
|
2183
|
-
if (Array.isArray(value)) {
|
|
2184
|
-
return value.map((x) => jsonify(x, handles));
|
|
2185
|
-
} else {
|
|
2186
|
-
if (typeof value.toJSON === "function") {
|
|
2187
|
-
return value.toJSON();
|
|
2188
|
-
}
|
|
2189
|
-
const res = {};
|
|
2190
|
-
for (const key of Object.keys(value)) {
|
|
2191
|
-
res[key] = jsonify(value[key], handles);
|
|
2192
|
-
}
|
|
2193
|
-
return res;
|
|
2194
|
-
}
|
|
2195
|
-
} else {
|
|
2196
|
-
return value;
|
|
2197
|
-
}
|
|
2198
|
-
};
|
|
2199
2182
|
|
|
2200
2183
|
// packages/sdk/client-services/src/packlets/network/network-service.ts
|
|
2201
2184
|
var import_codec_protobuf10 = require("@dxos/codec-protobuf");
|
|
@@ -2239,7 +2222,7 @@ var import_log11 = require("@dxos/log");
|
|
|
2239
2222
|
var import_protocols6 = require("@dxos/protocols");
|
|
2240
2223
|
var import_services8 = require("@dxos/protocols/proto/dxos/client/services");
|
|
2241
2224
|
var import_teleport_extension_gossip = require("@dxos/teleport-extension-gossip");
|
|
2242
|
-
var
|
|
2225
|
+
var import_util6 = require("@dxos/util");
|
|
2243
2226
|
|
|
2244
2227
|
// packages/sdk/client-services/src/packlets/spaces/data-space.ts
|
|
2245
2228
|
var import_async13 = require("@dxos/async");
|
|
@@ -2252,7 +2235,7 @@ var import_keys9 = require("@dxos/keys");
|
|
|
2252
2235
|
var import_log10 = require("@dxos/log");
|
|
2253
2236
|
var import_services7 = require("@dxos/protocols/proto/dxos/client/services");
|
|
2254
2237
|
var import_credentials10 = require("@dxos/protocols/proto/dxos/halo/credentials");
|
|
2255
|
-
var
|
|
2238
|
+
var import_util5 = require("@dxos/util");
|
|
2256
2239
|
|
|
2257
2240
|
// packages/sdk/client-services/src/packlets/spaces/notarization-plugin.ts
|
|
2258
2241
|
var import_node_assert9 = __toESM(require("node:assert"));
|
|
@@ -2262,7 +2245,7 @@ var import_keys8 = require("@dxos/keys");
|
|
|
2262
2245
|
var import_log9 = require("@dxos/log");
|
|
2263
2246
|
var import_protocols5 = require("@dxos/protocols");
|
|
2264
2247
|
var import_teleport2 = require("@dxos/teleport");
|
|
2265
|
-
var
|
|
2248
|
+
var import_util4 = require("@dxos/util");
|
|
2266
2249
|
var DEFAULT_RETRY_TIMEOUT = 1e3;
|
|
2267
2250
|
var DEFAULT_SUCCESS_DELAY = 1e3;
|
|
2268
2251
|
var DEFAULT_NOTARIZE_TIMEOUT = 1e4;
|
|
@@ -2271,8 +2254,8 @@ var NotarizationPlugin = class {
|
|
|
2271
2254
|
this._ctx = new import_context5.Context();
|
|
2272
2255
|
this._extensionOpened = new import_async12.Event();
|
|
2273
2256
|
this._extensions = /* @__PURE__ */ new Set();
|
|
2274
|
-
this._processedCredentials = new
|
|
2275
|
-
this._processCredentialsTriggers = new
|
|
2257
|
+
this._processedCredentials = new import_util4.ComplexSet(import_keys8.PublicKey.hash);
|
|
2258
|
+
this._processCredentialsTriggers = new import_util4.ComplexMap(import_keys8.PublicKey.hash);
|
|
2276
2259
|
}
|
|
2277
2260
|
async open() {
|
|
2278
2261
|
}
|
|
@@ -2414,7 +2397,7 @@ var NotarizationPlugin = class {
|
|
|
2414
2397
|
if (this._processedCredentials.has(id)) {
|
|
2415
2398
|
return;
|
|
2416
2399
|
}
|
|
2417
|
-
await (0,
|
|
2400
|
+
await (0, import_util4.entry)(this._processCredentialsTriggers, id).orInsert(new import_async12.Trigger()).value.wait();
|
|
2418
2401
|
}
|
|
2419
2402
|
/**
|
|
2420
2403
|
* Requests from other peers to notarize credentials.
|
|
@@ -2525,7 +2508,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2525
2508
|
this._signingContext = params.signingContext;
|
|
2526
2509
|
this._callbacks = (_a = params.callbacks) != null ? _a : {};
|
|
2527
2510
|
this.authVerifier = new TrustedKeySetAuthVerifier({
|
|
2528
|
-
trustedKeysProvider: () => new
|
|
2511
|
+
trustedKeysProvider: () => new import_util5.ComplexSet(import_keys9.PublicKey.hash, Array.from(this._inner.spaceState.members.keys())),
|
|
2529
2512
|
update: this._inner.stateUpdate,
|
|
2530
2513
|
authTimeout: import_client_protocol3.AUTH_TIMEOUT
|
|
2531
2514
|
});
|
|
@@ -2823,7 +2806,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
2823
2806
|
this._feedStore = _feedStore;
|
|
2824
2807
|
this._ctx = new import_context7.Context();
|
|
2825
2808
|
this.updated = new import_async14.Event();
|
|
2826
|
-
this._spaces = new
|
|
2809
|
+
this._spaces = new import_util6.ComplexMap(import_keys10.PublicKey.hash);
|
|
2827
2810
|
this._isOpen = false;
|
|
2828
2811
|
this._instanceId = import_keys10.PublicKey.random().toHex();
|
|
2829
2812
|
}
|
|
@@ -2999,7 +2982,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
2999
2982
|
swarmIdentity: {
|
|
3000
2983
|
peerKey: this._signingContext.deviceKey,
|
|
3001
2984
|
credentialProvider: createAuthProvider(this._signingContext.credentialSigner),
|
|
3002
|
-
credentialAuthenticator: (0,
|
|
2985
|
+
credentialAuthenticator: (0, import_util6.deferFunction)(() => dataSpace.authVerifier.verifier)
|
|
3003
2986
|
},
|
|
3004
2987
|
onNetworkConnection: (session) => {
|
|
3005
2988
|
session.addExtension("dxos.mesh.teleport.gossip", gossip.createExtension({
|
|
@@ -3092,7 +3075,7 @@ var import_echo_pipeline2 = require("@dxos/echo-pipeline");
|
|
|
3092
3075
|
var import_log12 = require("@dxos/log");
|
|
3093
3076
|
var import_protocols7 = require("@dxos/protocols");
|
|
3094
3077
|
var import_services9 = require("@dxos/protocols/proto/dxos/client/services");
|
|
3095
|
-
var
|
|
3078
|
+
var import_util7 = require("@dxos/util");
|
|
3096
3079
|
var TIMEFRAME_UPDATE_DEBOUNCE_TIME = 500;
|
|
3097
3080
|
var SpacesServiceImpl = class {
|
|
3098
3081
|
constructor(_identityManager, _spaceManager, _dataServiceSubscriptions, _getDataSpaceManager) {
|
|
@@ -3229,7 +3212,7 @@ var SpacesServiceImpl = class {
|
|
|
3229
3212
|
identity: {
|
|
3230
3213
|
identityKey: member.key,
|
|
3231
3214
|
profile: {
|
|
3232
|
-
displayName: (_b2 = (_a2 = member.assertion.profile) == null ? void 0 : _a2.displayName) != null ? _b2 : (0,
|
|
3215
|
+
displayName: (_b2 = (_a2 = member.assertion.profile) == null ? void 0 : _a2.displayName) != null ? _b2 : (0, import_util7.humanize)(member.key)
|
|
3233
3216
|
}
|
|
3234
3217
|
},
|
|
3235
3218
|
presence: ((_c2 = this._identityManager.identity) == null ? void 0 : _c2.identityKey.equals(member.key)) || space.presence.getPeersOnline().filter(({ identityKey }) => identityKey.equals(member.key)).length > 0 ? import_services9.SpaceMember.PresenceState.ONLINE : import_services9.SpaceMember.PresenceState.OFFLINE
|
|
@@ -3333,7 +3316,7 @@ var import_client_protocol5 = require("@dxos/client-protocol");
|
|
|
3333
3316
|
var import_log13 = require("@dxos/log");
|
|
3334
3317
|
var import_messaging = require("@dxos/messaging");
|
|
3335
3318
|
var import_network_manager2 = require("@dxos/network-manager");
|
|
3336
|
-
var
|
|
3319
|
+
var import_util8 = require("@dxos/util");
|
|
3337
3320
|
|
|
3338
3321
|
// packages/sdk/client-services/src/packlets/services/client-rpc-server.ts
|
|
3339
3322
|
var import_codec_protobuf13 = require("@dxos/codec-protobuf");
|
|
@@ -3485,7 +3468,7 @@ var IFrameHostRuntime = class {
|
|
|
3485
3468
|
callSite: (f, a) => f(...a)
|
|
3486
3469
|
});
|
|
3487
3470
|
try {
|
|
3488
|
-
this._config = await (0,
|
|
3471
|
+
this._config = await (0, import_util8.getAsyncValue)(this._configProvider);
|
|
3489
3472
|
this._transportFactory = (0, import_network_manager2.createWebRTCTransportFactory)({
|
|
3490
3473
|
iceServers: this._config.get("runtime.services.ice")
|
|
3491
3474
|
});
|
|
@@ -3573,7 +3556,7 @@ var import_errors5 = require("@dxos/errors");
|
|
|
3573
3556
|
var import_log14 = require("@dxos/log");
|
|
3574
3557
|
var import_network_manager3 = require("@dxos/network-manager");
|
|
3575
3558
|
var import_rpc3 = require("@dxos/rpc");
|
|
3576
|
-
var
|
|
3559
|
+
var import_util9 = require("@dxos/util");
|
|
3577
3560
|
|
|
3578
3561
|
// packages/sdk/client-services/src/packlets/vault/vault-resource-lock.ts
|
|
3579
3562
|
var import_async19 = require("@dxos/async");
|
|
@@ -3709,7 +3692,7 @@ var import_async20 = require("@dxos/async");
|
|
|
3709
3692
|
var import_client_protocol8 = require("@dxos/client-protocol");
|
|
3710
3693
|
var import_log16 = require("@dxos/log");
|
|
3711
3694
|
var import_rpc4 = require("@dxos/rpc");
|
|
3712
|
-
var
|
|
3695
|
+
var import_util10 = require("@dxos/util");
|
|
3713
3696
|
var __decorate5 = function(decorators, target, key, desc) {
|
|
3714
3697
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3715
3698
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
@@ -3723,7 +3706,7 @@ var __decorate5 = function(decorators, target, key, desc) {
|
|
|
3723
3706
|
var WorkerSession = class {
|
|
3724
3707
|
constructor({ serviceHost, systemPort, appPort, shellPort, readySignal }) {
|
|
3725
3708
|
this._startTrigger = new import_async20.Trigger();
|
|
3726
|
-
this.onClose = new
|
|
3709
|
+
this.onClose = new import_util10.Callback();
|
|
3727
3710
|
(0, import_node_assert12.default)(serviceHost);
|
|
3728
3711
|
this._serviceHost = serviceHost;
|
|
3729
3712
|
const middleware = {
|