@dxos/client-services 0.3.3-main.f2ca85a → 0.3.3-main.ff5734a
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-CIMVJJPI.mjs → chunk-OTXSFYDU.mjs} +86 -66
- package/dist/lib/browser/chunk-OTXSFYDU.mjs.map +7 -0
- 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 +135 -115
- 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 +216 -149
- package/dist/lib/node/packlets/testing/index.cjs.map +3 -3
- package/dist/types/src/packlets/services/client-rpc-server.d.ts +2 -0
- package/dist/types/src/packlets/services/client-rpc-server.d.ts.map +1 -1
- package/dist/types/src/packlets/services/diagnostics.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/package.json +35 -35
- package/src/packlets/services/client-rpc-server.ts +18 -1
- package/src/packlets/services/diagnostics.ts +1 -9
- package/src/version.ts +1 -1
- package/dist/lib/browser/chunk-CIMVJJPI.mjs.map +0 -7
|
@@ -2420,9 +2420,21 @@ var SpaceInvitationProtocol = class {
|
|
|
2420
2420
|
import { Stream as Stream9 } from "@dxos/codec-protobuf";
|
|
2421
2421
|
import { raise } from "@dxos/debug";
|
|
2422
2422
|
import { parseMethodName, RpcPeer } from "@dxos/rpc";
|
|
2423
|
-
|
|
2423
|
+
import { MapCounter, trace as trace5 } from "@dxos/tracing";
|
|
2424
|
+
function _ts_decorate3(decorators, target, key, desc) {
|
|
2425
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2426
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
2427
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
2428
|
+
else
|
|
2429
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
2430
|
+
if (d = decorators[i])
|
|
2431
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2432
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2433
|
+
}
|
|
2434
|
+
var ClientRpcServer = class ClientRpcServer2 {
|
|
2424
2435
|
constructor(params) {
|
|
2425
2436
|
this._handlerCache = /* @__PURE__ */ new Map();
|
|
2437
|
+
this._callMetrics = new MapCounter();
|
|
2426
2438
|
const { serviceRegistry, handleCall, handleStream, ...rpcOptions } = params;
|
|
2427
2439
|
this._handleCall = handleCall;
|
|
2428
2440
|
this._handleStream = handleStream;
|
|
@@ -2432,6 +2444,7 @@ var ClientRpcServer = class {
|
|
|
2432
2444
|
callHandler: (method, params2) => {
|
|
2433
2445
|
const [serviceName, methodName] = parseMethodName(method);
|
|
2434
2446
|
const handler = (method2, params3) => this._getServiceHandler(serviceName).call(method2, params3);
|
|
2447
|
+
this._callMetrics.inc(`${serviceName}.${methodName} request`);
|
|
2435
2448
|
if (this._handleCall) {
|
|
2436
2449
|
return this._handleCall(methodName, params2, handler);
|
|
2437
2450
|
} else {
|
|
@@ -2441,14 +2454,21 @@ var ClientRpcServer = class {
|
|
|
2441
2454
|
streamHandler: (method, params2) => {
|
|
2442
2455
|
const [serviceName, methodName] = parseMethodName(method);
|
|
2443
2456
|
const handler = (method2, params3) => this._getServiceHandler(serviceName).callStream(method2, params3);
|
|
2457
|
+
this._callMetrics.inc(`${serviceName}.${methodName} request stream`);
|
|
2444
2458
|
if (this._handleStream) {
|
|
2445
|
-
return Stream9.unwrapPromise(this._handleStream(methodName, params2, handler))
|
|
2459
|
+
return Stream9.map(Stream9.unwrapPromise(this._handleStream(methodName, params2, handler)), (data) => {
|
|
2460
|
+
this._callMetrics.inc(`${serviceName}.${methodName} response stream`);
|
|
2461
|
+
return data;
|
|
2462
|
+
});
|
|
2446
2463
|
} else {
|
|
2447
2464
|
return handler(methodName, params2);
|
|
2448
2465
|
}
|
|
2449
2466
|
}
|
|
2450
2467
|
});
|
|
2451
2468
|
}
|
|
2469
|
+
get _services() {
|
|
2470
|
+
return Object.keys(this._serviceRegistry.services);
|
|
2471
|
+
}
|
|
2452
2472
|
async open() {
|
|
2453
2473
|
await this._rpcPeer.open();
|
|
2454
2474
|
}
|
|
@@ -2467,9 +2487,17 @@ var ClientRpcServer = class {
|
|
|
2467
2487
|
return this._handlerCache.get(serviceName);
|
|
2468
2488
|
}
|
|
2469
2489
|
};
|
|
2490
|
+
_ts_decorate3([
|
|
2491
|
+
trace5.metricsCounter()
|
|
2492
|
+
], ClientRpcServer.prototype, "_callMetrics", void 0);
|
|
2493
|
+
_ts_decorate3([
|
|
2494
|
+
trace5.info()
|
|
2495
|
+
], ClientRpcServer.prototype, "_services", null);
|
|
2496
|
+
ClientRpcServer = _ts_decorate3([
|
|
2497
|
+
trace5.resource()
|
|
2498
|
+
], ClientRpcServer);
|
|
2470
2499
|
|
|
2471
2500
|
// packages/sdk/client-services/src/packlets/services/diagnostics.ts
|
|
2472
|
-
import { Trigger as Trigger4 } from "@dxos/async";
|
|
2473
2501
|
import { getFirstStreamValue } from "@dxos/codec-protobuf";
|
|
2474
2502
|
import { credentialTypeFilter } from "@dxos/credentials";
|
|
2475
2503
|
import { DocumentModel } from "@dxos/document-model";
|
|
@@ -2508,7 +2536,7 @@ var getPlatform = () => {
|
|
|
2508
2536
|
};
|
|
2509
2537
|
|
|
2510
2538
|
// packages/sdk/client-services/src/version.ts
|
|
2511
|
-
var DXOS_VERSION = "0.3.3-main.
|
|
2539
|
+
var DXOS_VERSION = "0.3.3-main.ff5734a";
|
|
2512
2540
|
|
|
2513
2541
|
// packages/sdk/client-services/src/packlets/services/diagnostics.ts
|
|
2514
2542
|
var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/diagnostics.ts";
|
|
@@ -2527,7 +2555,7 @@ var createDiagnostics = async (clientServices, serviceContext, config) => {
|
|
|
2527
2555
|
{
|
|
2528
2556
|
invariant9(clientServices.LoggingService, "SystemService is not available.", {
|
|
2529
2557
|
F: __dxlog_file10,
|
|
2530
|
-
L:
|
|
2558
|
+
L: 92,
|
|
2531
2559
|
S: void 0,
|
|
2532
2560
|
A: [
|
|
2533
2561
|
"clientServices.LoggingService",
|
|
@@ -2564,15 +2592,7 @@ var createDiagnostics = async (clientServices, serviceContext, config) => {
|
|
|
2564
2592
|
timeout: DEFAULT_TIMEOUT
|
|
2565
2593
|
}).catch(() => void 0);
|
|
2566
2594
|
diagnostics.networkStatus = status;
|
|
2567
|
-
|
|
2568
|
-
serviceContext.networkManager.connectionLog?.update.on(async () => {
|
|
2569
|
-
const swarms = serviceContext.networkManager.connectionLog?.swarms;
|
|
2570
|
-
diagnostics.swarms = swarms;
|
|
2571
|
-
await swarmInfoDone.wake();
|
|
2572
|
-
});
|
|
2573
|
-
await swarmInfoDone.wait({
|
|
2574
|
-
timeout: DEFAULT_TIMEOUT
|
|
2575
|
-
});
|
|
2595
|
+
diagnostics.swarms = serviceContext.networkManager.connectionLog?.swarms;
|
|
2576
2596
|
}
|
|
2577
2597
|
diagnostics.config = config.values;
|
|
2578
2598
|
return diagnostics;
|
|
@@ -2586,7 +2606,7 @@ var getProperties = (space) => {
|
|
|
2586
2606
|
} catch (err) {
|
|
2587
2607
|
log8.warn(err.message, void 0, {
|
|
2588
2608
|
F: __dxlog_file10,
|
|
2589
|
-
L:
|
|
2609
|
+
L: 160,
|
|
2590
2610
|
S: void 0,
|
|
2591
2611
|
C: (f, a) => f(...a)
|
|
2592
2612
|
});
|
|
@@ -2653,11 +2673,11 @@ import { CancelledError, SystemError } from "@dxos/protocols";
|
|
|
2653
2673
|
import { SpaceState } from "@dxos/protocols/proto/dxos/client/services";
|
|
2654
2674
|
import { AdmittedFeed as AdmittedFeed3 } from "@dxos/protocols/proto/dxos/halo/credentials";
|
|
2655
2675
|
import { Timeframe as Timeframe2 } from "@dxos/timeframe";
|
|
2656
|
-
import { trace as
|
|
2676
|
+
import { trace as trace6 } from "@dxos/tracing";
|
|
2657
2677
|
import { ComplexSet as ComplexSet3 } from "@dxos/util";
|
|
2658
2678
|
|
|
2659
2679
|
// packages/sdk/client-services/src/packlets/spaces/notarization-plugin.ts
|
|
2660
|
-
import { DeferredTask, Event as Event4, scheduleTask as scheduleTask3, sleep, TimeoutError as TimeoutError2, Trigger as
|
|
2680
|
+
import { DeferredTask, Event as Event4, scheduleTask as scheduleTask3, sleep, TimeoutError as TimeoutError2, Trigger as Trigger4 } from "@dxos/async";
|
|
2661
2681
|
import { Context as Context6, rejectOnDispose } from "@dxos/context";
|
|
2662
2682
|
import { invariant as invariant10 } from "@dxos/invariant";
|
|
2663
2683
|
import { PublicKey as PublicKey7 } from "@dxos/keys";
|
|
@@ -2707,7 +2727,7 @@ var NotarizationPlugin = class {
|
|
|
2707
2727
|
"'Credentials must have an id'"
|
|
2708
2728
|
]
|
|
2709
2729
|
});
|
|
2710
|
-
const errors = new
|
|
2730
|
+
const errors = new Trigger4();
|
|
2711
2731
|
const ctx = this._ctx.derive({
|
|
2712
2732
|
onError: (err) => {
|
|
2713
2733
|
log9.warn("Notarization error", {
|
|
@@ -2838,7 +2858,7 @@ var NotarizationPlugin = class {
|
|
|
2838
2858
|
if (this._processedCredentials.has(id)) {
|
|
2839
2859
|
return;
|
|
2840
2860
|
}
|
|
2841
|
-
await entry(this._processCredentialsTriggers, id).orInsert(new
|
|
2861
|
+
await entry(this._processCredentialsTriggers, id).orInsert(new Trigger4()).value.wait();
|
|
2842
2862
|
}
|
|
2843
2863
|
/**
|
|
2844
2864
|
* Requests from other peers to notarize credentials.
|
|
@@ -2925,7 +2945,7 @@ var NotarizationTeleportExtension = class extends RpcExtension2 {
|
|
|
2925
2945
|
};
|
|
2926
2946
|
|
|
2927
2947
|
// packages/sdk/client-services/src/packlets/spaces/data-space.ts
|
|
2928
|
-
function
|
|
2948
|
+
function _ts_decorate4(decorators, target, key, desc) {
|
|
2929
2949
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2930
2950
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
2931
2951
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -3257,32 +3277,32 @@ var DataSpace = class DataSpace2 {
|
|
|
3257
3277
|
this.stateUpdate.emit();
|
|
3258
3278
|
}
|
|
3259
3279
|
};
|
|
3260
|
-
|
|
3280
|
+
_ts_decorate4([
|
|
3261
3281
|
synchronized
|
|
3262
3282
|
], DataSpace.prototype, "open", null);
|
|
3263
|
-
|
|
3283
|
+
_ts_decorate4([
|
|
3264
3284
|
synchronized
|
|
3265
3285
|
], DataSpace.prototype, "close", null);
|
|
3266
|
-
|
|
3267
|
-
|
|
3286
|
+
_ts_decorate4([
|
|
3287
|
+
trace6.span({
|
|
3268
3288
|
showInBrowserTimeline: true
|
|
3269
3289
|
})
|
|
3270
3290
|
], DataSpace.prototype, "initializeDataPipeline", null);
|
|
3271
|
-
|
|
3272
|
-
|
|
3291
|
+
_ts_decorate4([
|
|
3292
|
+
trace6.span({
|
|
3273
3293
|
showInBrowserTimeline: true
|
|
3274
3294
|
})
|
|
3275
3295
|
], DataSpace.prototype, "_initializeAndReadControlPipeline", null);
|
|
3276
|
-
|
|
3296
|
+
_ts_decorate4([
|
|
3277
3297
|
timed(1e4)
|
|
3278
3298
|
], DataSpace.prototype, "_createWritableFeeds", null);
|
|
3279
|
-
|
|
3299
|
+
_ts_decorate4([
|
|
3280
3300
|
synchronized
|
|
3281
3301
|
], DataSpace.prototype, "activate", null);
|
|
3282
|
-
|
|
3302
|
+
_ts_decorate4([
|
|
3283
3303
|
synchronized
|
|
3284
3304
|
], DataSpace.prototype, "deactivate", null);
|
|
3285
|
-
DataSpace =
|
|
3305
|
+
DataSpace = _ts_decorate4([
|
|
3286
3306
|
trackLeaks("open", "close")
|
|
3287
3307
|
], DataSpace);
|
|
3288
3308
|
|
|
@@ -3293,7 +3313,7 @@ import { getCredentialAssertion as getCredentialAssertion2 } from "@dxos/credent
|
|
|
3293
3313
|
import { invariant as invariant11 } from "@dxos/invariant";
|
|
3294
3314
|
import { PublicKey as PublicKey9 } from "@dxos/keys";
|
|
3295
3315
|
import { log as log11 } from "@dxos/log";
|
|
3296
|
-
import { trace as
|
|
3316
|
+
import { trace as trace7 } from "@dxos/protocols";
|
|
3297
3317
|
import { SpaceState as SpaceState2 } from "@dxos/protocols/proto/dxos/client/services";
|
|
3298
3318
|
import { Gossip, Presence } from "@dxos/teleport-extension-gossip";
|
|
3299
3319
|
import { ComplexMap as ComplexMap3, deferFunction as deferFunction2, forEachAsync } from "@dxos/util";
|
|
@@ -3368,7 +3388,7 @@ var spaceGenesis = async (keyring, signingContext, space) => {
|
|
|
3368
3388
|
};
|
|
3369
3389
|
|
|
3370
3390
|
// packages/sdk/client-services/src/packlets/spaces/data-space-manager.ts
|
|
3371
|
-
function
|
|
3391
|
+
function _ts_decorate5(decorators, target, key, desc) {
|
|
3372
3392
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3373
3393
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
3374
3394
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -3404,7 +3424,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3404
3424
|
S: this,
|
|
3405
3425
|
C: (f, a) => f(...a)
|
|
3406
3426
|
});
|
|
3407
|
-
log11.trace("dxos.echo.data-space-manager.open",
|
|
3427
|
+
log11.trace("dxos.echo.data-space-manager.open", trace7.begin({
|
|
3408
3428
|
id: this._instanceId
|
|
3409
3429
|
}), {
|
|
3410
3430
|
F: __dxlog_file13,
|
|
@@ -3450,7 +3470,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3450
3470
|
space.initializeDataPipelineAsync();
|
|
3451
3471
|
}
|
|
3452
3472
|
}
|
|
3453
|
-
log11.trace("dxos.echo.data-space-manager.open",
|
|
3473
|
+
log11.trace("dxos.echo.data-space-manager.open", trace7.end({
|
|
3454
3474
|
id: this._instanceId
|
|
3455
3475
|
}), {
|
|
3456
3476
|
F: __dxlog_file13,
|
|
@@ -3684,19 +3704,19 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3684
3704
|
return dataSpace;
|
|
3685
3705
|
}
|
|
3686
3706
|
};
|
|
3687
|
-
|
|
3707
|
+
_ts_decorate5([
|
|
3688
3708
|
synchronized2
|
|
3689
3709
|
], DataSpaceManager.prototype, "open", null);
|
|
3690
|
-
|
|
3710
|
+
_ts_decorate5([
|
|
3691
3711
|
synchronized2
|
|
3692
3712
|
], DataSpaceManager.prototype, "close", null);
|
|
3693
|
-
|
|
3713
|
+
_ts_decorate5([
|
|
3694
3714
|
synchronized2
|
|
3695
3715
|
], DataSpaceManager.prototype, "createSpace", null);
|
|
3696
|
-
|
|
3716
|
+
_ts_decorate5([
|
|
3697
3717
|
synchronized2
|
|
3698
3718
|
], DataSpaceManager.prototype, "acceptSpace", null);
|
|
3699
|
-
DataSpaceManager =
|
|
3719
|
+
DataSpaceManager = _ts_decorate5([
|
|
3700
3720
|
trackLeaks2("open", "close")
|
|
3701
3721
|
], DataSpaceManager);
|
|
3702
3722
|
|
|
@@ -3922,7 +3942,7 @@ var SpacesServiceImpl = class {
|
|
|
3922
3942
|
var getChannelId = (channel) => `user-channel/${channel}`;
|
|
3923
3943
|
|
|
3924
3944
|
// packages/sdk/client-services/src/packlets/services/service-context.ts
|
|
3925
|
-
import { Trigger as
|
|
3945
|
+
import { Trigger as Trigger5 } from "@dxos/async";
|
|
3926
3946
|
import { Context as Context9 } from "@dxos/context";
|
|
3927
3947
|
import { getCredentialAssertion as getCredentialAssertion3 } from "@dxos/credentials";
|
|
3928
3948
|
import { failUndefined as failUndefined3 } from "@dxos/debug";
|
|
@@ -3932,12 +3952,12 @@ import { invariant as invariant13 } from "@dxos/invariant";
|
|
|
3932
3952
|
import { Keyring } from "@dxos/keyring";
|
|
3933
3953
|
import { PublicKey as PublicKey10 } from "@dxos/keys";
|
|
3934
3954
|
import { log as log13 } from "@dxos/log";
|
|
3935
|
-
import { InvalidStorageVersionError, STORAGE_VERSION as STORAGE_VERSION2, trace as
|
|
3955
|
+
import { InvalidStorageVersionError, STORAGE_VERSION as STORAGE_VERSION2, trace as trace8 } from "@dxos/protocols";
|
|
3936
3956
|
import { Invitation as Invitation6 } from "@dxos/protocols/proto/dxos/client/services";
|
|
3937
3957
|
import { BlobStore } from "@dxos/teleport-extension-object-sync";
|
|
3938
3958
|
import { trace as Trace2 } from "@dxos/tracing";
|
|
3939
3959
|
import { safeInstanceof } from "@dxos/util";
|
|
3940
|
-
function
|
|
3960
|
+
function _ts_decorate6(decorators, target, key, desc) {
|
|
3941
3961
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3942
3962
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
3943
3963
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -3954,7 +3974,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
3954
3974
|
this.networkManager = networkManager;
|
|
3955
3975
|
this.signalManager = signalManager;
|
|
3956
3976
|
this.modelFactory = modelFactory;
|
|
3957
|
-
this.initialized = new
|
|
3977
|
+
this.initialized = new Trigger5();
|
|
3958
3978
|
this.dataServiceSubscriptions = new DataServiceSubscriptions();
|
|
3959
3979
|
this._handlerFactories = /* @__PURE__ */ new Map();
|
|
3960
3980
|
this._instanceId = PublicKey10.random().toHex();
|
|
@@ -3992,7 +4012,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
3992
4012
|
S: this,
|
|
3993
4013
|
C: (f, a) => f(...a)
|
|
3994
4014
|
});
|
|
3995
|
-
log13.trace("dxos.sdk.service-context.open",
|
|
4015
|
+
log13.trace("dxos.sdk.service-context.open", trace8.begin({
|
|
3996
4016
|
id: this._instanceId
|
|
3997
4017
|
}), {
|
|
3998
4018
|
F: __dxlog_file15,
|
|
@@ -4008,7 +4028,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4008
4028
|
if (this.identityManager.identity) {
|
|
4009
4029
|
await this._initialize(ctx);
|
|
4010
4030
|
}
|
|
4011
|
-
log13.trace("dxos.sdk.service-context.open",
|
|
4031
|
+
log13.trace("dxos.sdk.service-context.open", trace8.end({
|
|
4012
4032
|
id: this._instanceId
|
|
4013
4033
|
}), {
|
|
4014
4034
|
F: __dxlog_file15,
|
|
@@ -4171,13 +4191,13 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4171
4191
|
await identity.space.spaceState.addCredentialProcessor(this._deviceSpaceSync);
|
|
4172
4192
|
}
|
|
4173
4193
|
};
|
|
4174
|
-
|
|
4194
|
+
_ts_decorate6([
|
|
4175
4195
|
Trace2.span()
|
|
4176
4196
|
], ServiceContext.prototype, "open", null);
|
|
4177
|
-
|
|
4197
|
+
_ts_decorate6([
|
|
4178
4198
|
Trace2.span()
|
|
4179
4199
|
], ServiceContext.prototype, "_initialize", null);
|
|
4180
|
-
ServiceContext =
|
|
4200
|
+
ServiceContext = _ts_decorate6([
|
|
4181
4201
|
safeInstanceof("dxos.client-services.ServiceContext"),
|
|
4182
4202
|
Trace2.resource()
|
|
4183
4203
|
], ServiceContext);
|
|
@@ -4207,10 +4227,10 @@ var ServiceRegistry = class {
|
|
|
4207
4227
|
};
|
|
4208
4228
|
|
|
4209
4229
|
// packages/sdk/client-services/src/packlets/locks/browser.ts
|
|
4210
|
-
import { asyncTimeout, Trigger as
|
|
4230
|
+
import { asyncTimeout, Trigger as Trigger6 } from "@dxos/async";
|
|
4211
4231
|
import { RESOURCE_LOCK_TIMEOUT } from "@dxos/client-protocol";
|
|
4212
4232
|
import { log as log14, logInfo } from "@dxos/log";
|
|
4213
|
-
function
|
|
4233
|
+
function _ts_decorate7(decorators, target, key, desc) {
|
|
4214
4234
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4215
4235
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
4216
4236
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -4228,7 +4248,7 @@ var Message;
|
|
|
4228
4248
|
var Lock = class {
|
|
4229
4249
|
constructor({ lockKey, onAcquire, onRelease }) {
|
|
4230
4250
|
this._broadcastChannel = new BroadcastChannel("vault-resource-lock");
|
|
4231
|
-
this._releaseTrigger = new
|
|
4251
|
+
this._releaseTrigger = new Trigger6();
|
|
4232
4252
|
this._lockKey = lockKey;
|
|
4233
4253
|
this._onAcquire = onAcquire;
|
|
4234
4254
|
this._onRelease = onRelease;
|
|
@@ -4288,13 +4308,13 @@ var Lock = class {
|
|
|
4288
4308
|
S: this,
|
|
4289
4309
|
C: (f, a) => f(...a)
|
|
4290
4310
|
});
|
|
4291
|
-
const acquired = new
|
|
4311
|
+
const acquired = new Trigger6();
|
|
4292
4312
|
void navigator.locks.request(this._lockKey, {
|
|
4293
4313
|
steal
|
|
4294
4314
|
}, async () => {
|
|
4295
4315
|
await this._onAcquire?.();
|
|
4296
4316
|
acquired.wake();
|
|
4297
|
-
this._releaseTrigger = new
|
|
4317
|
+
this._releaseTrigger = new Trigger6();
|
|
4298
4318
|
await this._releaseTrigger.wait();
|
|
4299
4319
|
log14("releasing lock...", void 0, {
|
|
4300
4320
|
F: __dxlog_file16,
|
|
@@ -4323,7 +4343,7 @@ var Lock = class {
|
|
|
4323
4343
|
});
|
|
4324
4344
|
}
|
|
4325
4345
|
};
|
|
4326
|
-
|
|
4346
|
+
_ts_decorate7([
|
|
4327
4347
|
logInfo
|
|
4328
4348
|
], Lock.prototype, "lockKey", null);
|
|
4329
4349
|
var isLocked = (lockPath) => {
|
|
@@ -4392,7 +4412,7 @@ import { log as log16 } from "@dxos/log";
|
|
|
4392
4412
|
import { WebsocketSignalManager } from "@dxos/messaging";
|
|
4393
4413
|
import { ModelFactory } from "@dxos/model-factory";
|
|
4394
4414
|
import { createSimplePeerTransportFactory, NetworkManager } from "@dxos/network-manager";
|
|
4395
|
-
import { trace as
|
|
4415
|
+
import { trace as trace9 } from "@dxos/protocols";
|
|
4396
4416
|
import { SystemStatus } from "@dxos/protocols/proto/dxos/client/services";
|
|
4397
4417
|
import { TextModel } from "@dxos/text-model";
|
|
4398
4418
|
import { TRACE_PROCESSOR, trace as Trace3 } from "@dxos/tracing";
|
|
@@ -4646,7 +4666,7 @@ var SystemServiceImpl = class {
|
|
|
4646
4666
|
};
|
|
4647
4667
|
|
|
4648
4668
|
// packages/sdk/client-services/src/packlets/services/service-host.ts
|
|
4649
|
-
function
|
|
4669
|
+
function _ts_decorate8(decorators, target, key, desc) {
|
|
4650
4670
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4651
4671
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
4652
4672
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -4816,7 +4836,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4816
4836
|
return;
|
|
4817
4837
|
}
|
|
4818
4838
|
const traceId = PublicKey11.random().toHex();
|
|
4819
|
-
log16.trace("dxos.client-services.host.open",
|
|
4839
|
+
log16.trace("dxos.client-services.host.open", trace9.begin({
|
|
4820
4840
|
id: traceId
|
|
4821
4841
|
}), {
|
|
4822
4842
|
F: __dxlog_file17,
|
|
@@ -4915,7 +4935,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4915
4935
|
S: this,
|
|
4916
4936
|
C: (f, a) => f(...a)
|
|
4917
4937
|
});
|
|
4918
|
-
log16.trace("dxos.client-services.host.open",
|
|
4938
|
+
log16.trace("dxos.client-services.host.open", trace9.end({
|
|
4919
4939
|
id: traceId
|
|
4920
4940
|
}), {
|
|
4921
4941
|
F: __dxlog_file17,
|
|
@@ -4956,7 +4976,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4956
4976
|
}
|
|
4957
4977
|
async reset() {
|
|
4958
4978
|
const traceId = PublicKey11.random().toHex();
|
|
4959
|
-
log16.trace("dxos.sdk.client-services-host.reset",
|
|
4979
|
+
log16.trace("dxos.sdk.client-services-host.reset", trace9.begin({
|
|
4960
4980
|
id: traceId
|
|
4961
4981
|
}), {
|
|
4962
4982
|
F: __dxlog_file17,
|
|
@@ -4978,7 +4998,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4978
4998
|
S: this,
|
|
4979
4999
|
C: (f, a) => f(...a)
|
|
4980
5000
|
});
|
|
4981
|
-
log16.trace("dxos.sdk.client-services-host.reset",
|
|
5001
|
+
log16.trace("dxos.sdk.client-services-host.reset", trace9.end({
|
|
4982
5002
|
id: traceId
|
|
4983
5003
|
}), {
|
|
4984
5004
|
F: __dxlog_file17,
|
|
@@ -5008,21 +5028,21 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
5008
5028
|
return identity;
|
|
5009
5029
|
}
|
|
5010
5030
|
};
|
|
5011
|
-
|
|
5031
|
+
_ts_decorate8([
|
|
5012
5032
|
Trace3.info()
|
|
5013
5033
|
], ClientServicesHost.prototype, "_opening", void 0);
|
|
5014
|
-
|
|
5034
|
+
_ts_decorate8([
|
|
5015
5035
|
Trace3.info()
|
|
5016
5036
|
], ClientServicesHost.prototype, "_open", void 0);
|
|
5017
|
-
|
|
5037
|
+
_ts_decorate8([
|
|
5018
5038
|
synchronized3,
|
|
5019
5039
|
Trace3.span()
|
|
5020
5040
|
], ClientServicesHost.prototype, "open", null);
|
|
5021
|
-
|
|
5041
|
+
_ts_decorate8([
|
|
5022
5042
|
synchronized3,
|
|
5023
5043
|
Trace3.span()
|
|
5024
5044
|
], ClientServicesHost.prototype, "close", null);
|
|
5025
|
-
ClientServicesHost =
|
|
5045
|
+
ClientServicesHost = _ts_decorate8([
|
|
5026
5046
|
Trace3.resource()
|
|
5027
5047
|
], ClientServicesHost);
|
|
5028
5048
|
|
|
@@ -5059,4 +5079,4 @@ export {
|
|
|
5059
5079
|
createDefaultModelFactory,
|
|
5060
5080
|
ClientServicesHost
|
|
5061
5081
|
};
|
|
5062
|
-
//# sourceMappingURL=chunk-
|
|
5082
|
+
//# sourceMappingURL=chunk-OTXSFYDU.mjs.map
|