@dxos/client-services 0.1.52 → 0.1.53-main.032dce6
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-C3SPTMW3.mjs → chunk-6ITWCQIT.mjs} +47 -28
- package/dist/lib/browser/chunk-6ITWCQIT.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 +49 -30
- 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 +44 -25
- package/dist/lib/node/packlets/testing/index.cjs.map +3 -3
- package/dist/types/src/packlets/devtools/devtools.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/spaces-service.d.ts +1 -1
- package/dist/types/src/packlets/spaces/spaces-service.d.ts.map +1 -1
- package/package.json +32 -32
- package/src/packlets/devtools/devtools.ts +2 -2
- package/src/packlets/services/service-host.ts +3 -1
- package/src/packlets/spaces/spaces-service.ts +20 -24
- package/dist/lib/browser/chunk-C3SPTMW3.mjs.map +0 -7
|
@@ -2682,7 +2682,6 @@ var import_log11 = require("@dxos/log");
|
|
|
2682
2682
|
var import_protocols7 = require("@dxos/protocols");
|
|
2683
2683
|
var import_services8 = require("@dxos/protocols/proto/dxos/client/services");
|
|
2684
2684
|
var import_util5 = require("@dxos/util");
|
|
2685
|
-
var TIMEFRAME_UPDATE_DEBOUNCE_TIME = 500;
|
|
2686
2685
|
var SpacesServiceImpl = class {
|
|
2687
2686
|
constructor(_identityManager, _spaceManager, _dataServiceSubscriptions, _getDataSpaceManager) {
|
|
2688
2687
|
this._identityManager = _identityManager;
|
|
@@ -2696,16 +2695,16 @@ var SpacesServiceImpl = class {
|
|
|
2696
2695
|
}
|
|
2697
2696
|
const dataSpaceManager = await this._getDataSpaceManager();
|
|
2698
2697
|
const space = await dataSpaceManager.createSpace();
|
|
2699
|
-
return this.
|
|
2698
|
+
return this._serializeSpace(space);
|
|
2700
2699
|
}
|
|
2701
2700
|
async updateSpace(request) {
|
|
2702
2701
|
(0, import_debug5.todo)();
|
|
2703
2702
|
}
|
|
2704
2703
|
querySpaces() {
|
|
2705
2704
|
return new import_codec_protobuf3.Stream(({ next, ctx }) => {
|
|
2706
|
-
const
|
|
2705
|
+
const scheduler = new import_async10.UpdateScheduler(ctx, async () => {
|
|
2707
2706
|
const dataSpaceManager = await this._getDataSpaceManager();
|
|
2708
|
-
const spaces = Array.from(dataSpaceManager.spaces.values()).map((space) => this.
|
|
2707
|
+
const spaces = Array.from(dataSpaceManager.spaces.values()).map((space) => this._serializeSpace(space));
|
|
2709
2708
|
(0, import_log11.log)("update", {
|
|
2710
2709
|
spaces
|
|
2711
2710
|
}, {
|
|
@@ -2717,7 +2716,9 @@ var SpacesServiceImpl = class {
|
|
|
2717
2716
|
next({
|
|
2718
2717
|
spaces
|
|
2719
2718
|
});
|
|
2720
|
-
}
|
|
2719
|
+
}, {
|
|
2720
|
+
maxFrequency: 2
|
|
2721
|
+
});
|
|
2721
2722
|
(0, import_async10.scheduleTask)(ctx, async () => {
|
|
2722
2723
|
const dataSpaceManager = await this._getDataSpaceManager();
|
|
2723
2724
|
const subscriptions = new import_async10.EventSubscriptions();
|
|
@@ -2725,21 +2726,21 @@ var SpacesServiceImpl = class {
|
|
|
2725
2726
|
const subscribeSpaces = () => {
|
|
2726
2727
|
subscriptions.clear();
|
|
2727
2728
|
for (const space of dataSpaceManager.spaces.values()) {
|
|
2728
|
-
subscriptions.add(space.stateUpdate.on(ctx,
|
|
2729
|
-
subscriptions.add(space.presence.updated.on(ctx,
|
|
2730
|
-
subscriptions.add(space.dataPipeline.onNewEpoch.on(ctx,
|
|
2731
|
-
space.inner.controlPipeline.state.timeframeUpdate.
|
|
2729
|
+
subscriptions.add(space.stateUpdate.on(ctx, () => scheduler.trigger()));
|
|
2730
|
+
subscriptions.add(space.presence.updated.on(ctx, () => scheduler.trigger()));
|
|
2731
|
+
subscriptions.add(space.dataPipeline.onNewEpoch.on(ctx, () => scheduler.trigger()));
|
|
2732
|
+
space.inner.controlPipeline.state.timeframeUpdate.on(ctx, () => scheduler.trigger());
|
|
2732
2733
|
if (space.dataPipeline.pipelineState) {
|
|
2733
|
-
subscriptions.add(space.dataPipeline.pipelineState.timeframeUpdate.
|
|
2734
|
+
subscriptions.add(space.dataPipeline.pipelineState.timeframeUpdate.on(ctx, () => scheduler.trigger()));
|
|
2734
2735
|
}
|
|
2735
2736
|
}
|
|
2736
2737
|
};
|
|
2737
2738
|
dataSpaceManager.updated.on(ctx, () => {
|
|
2738
2739
|
subscribeSpaces();
|
|
2739
|
-
|
|
2740
|
+
scheduler.trigger();
|
|
2740
2741
|
});
|
|
2741
2742
|
subscribeSpaces();
|
|
2742
|
-
|
|
2743
|
+
scheduler.trigger();
|
|
2743
2744
|
});
|
|
2744
2745
|
if (!this._identityManager.identity) {
|
|
2745
2746
|
next({
|
|
@@ -2797,7 +2798,7 @@ var SpacesServiceImpl = class {
|
|
|
2797
2798
|
const space = (_a = dataSpaceManager.spaces.get(spaceKey)) != null ? _a : (0, import_debug5.raise)(new import_echo_pipeline2.SpaceNotFoundError(spaceKey));
|
|
2798
2799
|
await space.createEpoch();
|
|
2799
2800
|
}
|
|
2800
|
-
|
|
2801
|
+
_serializeSpace(space) {
|
|
2801
2802
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
2802
2803
|
return {
|
|
2803
2804
|
spaceKey: space.key,
|
|
@@ -3320,8 +3321,10 @@ var DevtoolsServiceImpl = class {
|
|
|
3320
3321
|
});
|
|
3321
3322
|
});
|
|
3322
3323
|
}
|
|
3323
|
-
getConfig(request) {
|
|
3324
|
-
|
|
3324
|
+
async getConfig(request) {
|
|
3325
|
+
return {
|
|
3326
|
+
config: JSON.stringify(this.params.config.values)
|
|
3327
|
+
};
|
|
3325
3328
|
}
|
|
3326
3329
|
async getStorageInfo() {
|
|
3327
3330
|
var _a, _b, _c, _d, _e;
|
|
@@ -3687,6 +3690,16 @@ var ServiceRegistry = class {
|
|
|
3687
3690
|
};
|
|
3688
3691
|
|
|
3689
3692
|
// packages/sdk/client-services/src/packlets/services/service-host.ts
|
|
3693
|
+
var __decorate4 = function(decorators, target, key, desc) {
|
|
3694
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3695
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
3696
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
3697
|
+
else
|
|
3698
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
3699
|
+
if (d = decorators[i])
|
|
3700
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
3701
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3702
|
+
};
|
|
3690
3703
|
var ClientServicesHost = class {
|
|
3691
3704
|
constructor({
|
|
3692
3705
|
config,
|
|
@@ -3791,7 +3804,7 @@ var ClientServicesHost = class {
|
|
|
3791
3804
|
id: traceId
|
|
3792
3805
|
}), {
|
|
3793
3806
|
file: "service-host.ts",
|
|
3794
|
-
line:
|
|
3807
|
+
line: 188,
|
|
3795
3808
|
scope: this,
|
|
3796
3809
|
callSite: (f, a) => f(...a)
|
|
3797
3810
|
});
|
|
@@ -3804,7 +3817,7 @@ var ClientServicesHost = class {
|
|
|
3804
3817
|
lockKey: (_a = this._resourceLock) == null ? void 0 : _a.lockKey
|
|
3805
3818
|
}, {
|
|
3806
3819
|
file: "service-host.ts",
|
|
3807
|
-
line:
|
|
3820
|
+
line: 196,
|
|
3808
3821
|
scope: this,
|
|
3809
3822
|
callSite: (f, a) => f(...a)
|
|
3810
3823
|
});
|
|
@@ -3839,7 +3852,7 @@ var ClientServicesHost = class {
|
|
|
3839
3852
|
deviceKey
|
|
3840
3853
|
}, {
|
|
3841
3854
|
file: "service-host.ts",
|
|
3842
|
-
line:
|
|
3855
|
+
line: 251,
|
|
3843
3856
|
scope: this,
|
|
3844
3857
|
callSite: (f, a) => f(...a)
|
|
3845
3858
|
});
|
|
@@ -3847,7 +3860,7 @@ var ClientServicesHost = class {
|
|
|
3847
3860
|
id: traceId
|
|
3848
3861
|
}), {
|
|
3849
3862
|
file: "service-host.ts",
|
|
3850
|
-
line:
|
|
3863
|
+
line: 252,
|
|
3851
3864
|
scope: this,
|
|
3852
3865
|
callSite: (f, a) => f(...a)
|
|
3853
3866
|
});
|
|
@@ -3862,7 +3875,7 @@ var ClientServicesHost = class {
|
|
|
3862
3875
|
deviceKey
|
|
3863
3876
|
}, {
|
|
3864
3877
|
file: "service-host.ts",
|
|
3865
|
-
line:
|
|
3878
|
+
line: 262,
|
|
3866
3879
|
scope: this,
|
|
3867
3880
|
callSite: (f, a) => f(...a)
|
|
3868
3881
|
});
|
|
@@ -3877,7 +3890,7 @@ var ClientServicesHost = class {
|
|
|
3877
3890
|
deviceKey
|
|
3878
3891
|
}, {
|
|
3879
3892
|
file: "service-host.ts",
|
|
3880
|
-
line:
|
|
3893
|
+
line: 268,
|
|
3881
3894
|
scope: this,
|
|
3882
3895
|
callSite: (f, a) => f(...a)
|
|
3883
3896
|
});
|
|
@@ -3889,13 +3902,13 @@ var ClientServicesHost = class {
|
|
|
3889
3902
|
id: traceId
|
|
3890
3903
|
}), {
|
|
3891
3904
|
file: "service-host.ts",
|
|
3892
|
-
line:
|
|
3905
|
+
line: 273,
|
|
3893
3906
|
scope: this,
|
|
3894
3907
|
callSite: (f, a) => f(...a)
|
|
3895
3908
|
});
|
|
3896
3909
|
(0, import_log15.log)("resetting...", {}, {
|
|
3897
3910
|
file: "service-host.ts",
|
|
3898
|
-
line:
|
|
3911
|
+
line: 275,
|
|
3899
3912
|
scope: this,
|
|
3900
3913
|
callSite: (f, a) => f(...a)
|
|
3901
3914
|
});
|
|
@@ -3903,7 +3916,7 @@ var ClientServicesHost = class {
|
|
|
3903
3916
|
await this._storage.reset();
|
|
3904
3917
|
(0, import_log15.log)("reset", {}, {
|
|
3905
3918
|
file: "service-host.ts",
|
|
3906
|
-
line:
|
|
3919
|
+
line: 278,
|
|
3907
3920
|
scope: this,
|
|
3908
3921
|
callSite: (f, a) => f(...a)
|
|
3909
3922
|
});
|
|
@@ -3911,12 +3924,18 @@ var ClientServicesHost = class {
|
|
|
3911
3924
|
id: traceId
|
|
3912
3925
|
}), {
|
|
3913
3926
|
file: "service-host.ts",
|
|
3914
|
-
line:
|
|
3927
|
+
line: 279,
|
|
3915
3928
|
scope: this,
|
|
3916
3929
|
callSite: (f, a) => f(...a)
|
|
3917
3930
|
});
|
|
3918
3931
|
}
|
|
3919
3932
|
};
|
|
3933
|
+
__decorate4([
|
|
3934
|
+
import_async17.synchronized
|
|
3935
|
+
], ClientServicesHost.prototype, "open", null);
|
|
3936
|
+
__decorate4([
|
|
3937
|
+
import_async17.synchronized
|
|
3938
|
+
], ClientServicesHost.prototype, "close", null);
|
|
3920
3939
|
|
|
3921
3940
|
// packages/sdk/client-services/src/packlets/testing/invitation-utils.ts
|
|
3922
3941
|
var sanitizeInvitation = (invitation) => {
|