@dxos/client-services 0.1.55-main.ff36828 → 0.1.55
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-JW4TUGHP.mjs → chunk-XSZIBW37.mjs} +60 -19
- package/dist/lib/browser/{chunk-JW4TUGHP.mjs.map → chunk-XSZIBW37.mjs.map} +3 -3
- package/dist/lib/browser/index.mjs +5 -5
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/packlets/testing/index.mjs +1 -1
- package/dist/lib/node/index.cjs +62 -21
- 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 +58 -17
- package/dist/lib/node/packlets/testing/index.cjs.map +3 -3
- package/dist/types/src/packlets/logging/logging-service.d.ts +3 -1
- package/dist/types/src/packlets/logging/logging-service.d.ts.map +1 -1
- package/dist/types/src/packlets/system/system-service.d.ts +3 -6
- package/dist/types/src/packlets/system/system-service.d.ts.map +1 -1
- package/package.json +32 -32
- package/src/packlets/logging/logging-service.ts +52 -2
- package/src/packlets/system/system-service.test.ts +4 -4
- package/src/packlets/system/system-service.ts +9 -11
|
@@ -352,7 +352,7 @@ import { Context as Context2 } from "@dxos/context";
|
|
|
352
352
|
import { verifyCredential } from "@dxos/credentials";
|
|
353
353
|
import { log } from "@dxos/log";
|
|
354
354
|
import { schema } from "@dxos/protocols";
|
|
355
|
-
var __dxlog_file = "/
|
|
355
|
+
var __dxlog_file = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/identity/authenticator.ts";
|
|
356
356
|
var Credential = schema.getCodecForType("dxos.halo.credentials.Credential");
|
|
357
357
|
var createAuthProvider = (signer) => async (nonce) => {
|
|
358
358
|
const credential = await signer.createCredential({
|
|
@@ -471,7 +471,7 @@ import { failUndefined } from "@dxos/debug";
|
|
|
471
471
|
import { writeMessages } from "@dxos/feed-store";
|
|
472
472
|
import { log as log2 } from "@dxos/log";
|
|
473
473
|
import { AdmittedFeed } from "@dxos/protocols/proto/dxos/halo/credentials";
|
|
474
|
-
var __dxlog_file2 = "/
|
|
474
|
+
var __dxlog_file2 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/identity/identity.ts";
|
|
475
475
|
var Identity = class {
|
|
476
476
|
constructor({ space, signer, identityKey, deviceKey }) {
|
|
477
477
|
this.stateUpdate = new Event();
|
|
@@ -615,7 +615,7 @@ import { log as log3 } from "@dxos/log";
|
|
|
615
615
|
import { trace } from "@dxos/protocols";
|
|
616
616
|
import { AdmittedFeed as AdmittedFeed2 } from "@dxos/protocols/proto/dxos/halo/credentials";
|
|
617
617
|
import { deferFunction } from "@dxos/util";
|
|
618
|
-
var __dxlog_file3 = "/
|
|
618
|
+
var __dxlog_file3 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/identity/identity-manager.ts";
|
|
619
619
|
var IdentityManager = class {
|
|
620
620
|
// TODO(burdon): IdentityManagerParams.
|
|
621
621
|
// TODO(dmaretskyi): Perhaps this should take/generate the peerKey outside of an initialized identity.
|
|
@@ -1008,7 +1008,7 @@ import { schema as schema2, trace as trace2 } from "@dxos/protocols";
|
|
|
1008
1008
|
import { Invitation as Invitation2 } from "@dxos/protocols/proto/dxos/client/services";
|
|
1009
1009
|
import { AuthenticationResponse, Options } from "@dxos/protocols/proto/dxos/halo/invitations";
|
|
1010
1010
|
import { RpcExtension } from "@dxos/teleport";
|
|
1011
|
-
var __dxlog_file4 = "/
|
|
1011
|
+
var __dxlog_file4 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/invitations/invitation-extension.ts";
|
|
1012
1012
|
var OPTIONS_TIMEOUT = 1e4;
|
|
1013
1013
|
var MAX_OTP_ATTEMPTS = 3;
|
|
1014
1014
|
var InvitationHostExtension = class extends RpcExtension {
|
|
@@ -1309,7 +1309,7 @@ var InvitationGuestExtension = class extends RpcExtension {
|
|
|
1309
1309
|
var isAuthenticationRequired = (invitation) => invitation.authMethod !== Invitation2.AuthMethod.NONE;
|
|
1310
1310
|
|
|
1311
1311
|
// packages/sdk/client-services/src/packlets/invitations/invitations-handler.ts
|
|
1312
|
-
var __dxlog_file5 = "/
|
|
1312
|
+
var __dxlog_file5 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/invitations/invitations-handler.ts";
|
|
1313
1313
|
var InvitationsHandler = class {
|
|
1314
1314
|
/**
|
|
1315
1315
|
* @internal
|
|
@@ -1828,7 +1828,7 @@ import { Event as Event3 } from "@dxos/async";
|
|
|
1828
1828
|
import { Stream as Stream8 } from "@dxos/codec-protobuf";
|
|
1829
1829
|
import { log as log6 } from "@dxos/log";
|
|
1830
1830
|
import { QueryInvitationsResponse } from "@dxos/protocols/proto/dxos/client/services";
|
|
1831
|
-
var __dxlog_file6 = "/
|
|
1831
|
+
var __dxlog_file6 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/invitations/invitations-service.ts";
|
|
1832
1832
|
var InvitationsServiceImpl = class {
|
|
1833
1833
|
constructor(_invitationsHandler, _getHandler) {
|
|
1834
1834
|
this._invitationsHandler = _invitationsHandler;
|
|
@@ -1997,7 +1997,7 @@ import { createAdmissionCredentials, getCredentialAssertion } from "@dxos/creden
|
|
|
1997
1997
|
import { writeMessages as writeMessages2 } from "@dxos/feed-store";
|
|
1998
1998
|
import { log as log7 } from "@dxos/log";
|
|
1999
1999
|
import { Invitation as Invitation4 } from "@dxos/protocols/proto/dxos/client/services";
|
|
2000
|
-
var __dxlog_file7 = "/
|
|
2000
|
+
var __dxlog_file7 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/invitations/space-invitation-protocol.ts";
|
|
2001
2001
|
var SpaceInvitationProtocol = class {
|
|
2002
2002
|
constructor(_spaceManager, _signingContext, _keyring, _spaceKey) {
|
|
2003
2003
|
this._spaceManager = _spaceManager;
|
|
@@ -2158,7 +2158,7 @@ import { log as log8 } from "@dxos/log";
|
|
|
2158
2158
|
import { schema as schema3 } from "@dxos/protocols";
|
|
2159
2159
|
import { RpcExtension as RpcExtension2 } from "@dxos/teleport";
|
|
2160
2160
|
import { ComplexMap as ComplexMap2, ComplexSet, entry } from "@dxos/util";
|
|
2161
|
-
var __dxlog_file8 = "/
|
|
2161
|
+
var __dxlog_file8 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/spaces/notarization-plugin.ts";
|
|
2162
2162
|
var DEFAULT_RETRY_TIMEOUT = 1e3;
|
|
2163
2163
|
var DEFAULT_SUCCESS_DELAY = 1e3;
|
|
2164
2164
|
var DEFAULT_NOTARIZE_TIMEOUT = 1e4;
|
|
@@ -2406,7 +2406,7 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
2406
2406
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2407
2407
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2408
2408
|
}
|
|
2409
|
-
var __dxlog_file9 = "/
|
|
2409
|
+
var __dxlog_file9 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/spaces/data-space.ts";
|
|
2410
2410
|
var DataSpace = class DataSpace2 {
|
|
2411
2411
|
constructor(params) {
|
|
2412
2412
|
this._ctx = new Context6();
|
|
@@ -2778,7 +2778,7 @@ function _ts_decorate2(decorators, target, key, desc) {
|
|
|
2778
2778
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2779
2779
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2780
2780
|
}
|
|
2781
|
-
var __dxlog_file10 = "/
|
|
2781
|
+
var __dxlog_file10 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/spaces/data-space-manager.ts";
|
|
2782
2782
|
var DataSpaceManager = class DataSpaceManager2 {
|
|
2783
2783
|
constructor(_spaceManager, _metadataStore, _dataServiceSubscriptions, _keyring, _signingContext, _feedStore) {
|
|
2784
2784
|
this._spaceManager = _spaceManager;
|
|
@@ -3077,7 +3077,7 @@ import { log as log11 } from "@dxos/log";
|
|
|
3077
3077
|
import { encodeError } from "@dxos/protocols";
|
|
3078
3078
|
import { SpaceMember as SpaceMember2, SpaceState as SpaceState3 } from "@dxos/protocols/proto/dxos/client/services";
|
|
3079
3079
|
import { humanize } from "@dxos/util";
|
|
3080
|
-
var __dxlog_file11 = "/
|
|
3080
|
+
var __dxlog_file11 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/spaces/spaces-service.ts";
|
|
3081
3081
|
var SpacesServiceImpl = class {
|
|
3082
3082
|
constructor(_identityManager, _spaceManager, _dataServiceSubscriptions, _getDataSpaceManager) {
|
|
3083
3083
|
this._identityManager = _identityManager;
|
|
@@ -3260,7 +3260,7 @@ import { log as log12 } from "@dxos/log";
|
|
|
3260
3260
|
import { STORAGE_VERSION, trace as trace5 } from "@dxos/protocols";
|
|
3261
3261
|
import { Invitation as Invitation5 } from "@dxos/protocols/proto/dxos/client/services";
|
|
3262
3262
|
import { BlobStore } from "@dxos/teleport-extension-object-sync";
|
|
3263
|
-
var __dxlog_file12 = "/
|
|
3263
|
+
var __dxlog_file12 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/services/service-context.ts";
|
|
3264
3264
|
var ServiceContext = class {
|
|
3265
3265
|
// prettier-ignore
|
|
3266
3266
|
constructor(storage, networkManager, signalManager, modelFactory) {
|
|
@@ -3486,7 +3486,7 @@ function _ts_decorate3(decorators, target, key, desc) {
|
|
|
3486
3486
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
3487
3487
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3488
3488
|
}
|
|
3489
|
-
var __dxlog_file13 = "/
|
|
3489
|
+
var __dxlog_file13 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/locks/browser.ts";
|
|
3490
3490
|
var Message;
|
|
3491
3491
|
(function(Message2) {
|
|
3492
3492
|
Message2["ACQUIRING"] = "acquiring";
|
|
@@ -3738,7 +3738,7 @@ import { Event as Event7 } from "@dxos/async";
|
|
|
3738
3738
|
import { Stream as Stream12 } from "@dxos/codec-protobuf";
|
|
3739
3739
|
import { getContextFromEntry, log as log14 } from "@dxos/log";
|
|
3740
3740
|
import { QueryLogsRequest } from "@dxos/protocols/proto/dxos/client/services";
|
|
3741
|
-
import { jsonify } from "@dxos/util";
|
|
3741
|
+
import { jsonify, numericalValues, tracer } from "@dxos/util";
|
|
3742
3742
|
var LoggingServiceImpl = class {
|
|
3743
3743
|
constructor() {
|
|
3744
3744
|
this._logs = new Event7();
|
|
@@ -3753,6 +3753,46 @@ var LoggingServiceImpl = class {
|
|
|
3753
3753
|
const index = log14.runtimeConfig.processors.findIndex((processor) => processor === this._logProcessor);
|
|
3754
3754
|
log14.runtimeConfig.processors.splice(index, 1);
|
|
3755
3755
|
}
|
|
3756
|
+
async controlMetrics({ reset, record }) {
|
|
3757
|
+
if (reset) {
|
|
3758
|
+
tracer.clear();
|
|
3759
|
+
}
|
|
3760
|
+
if (record === true) {
|
|
3761
|
+
tracer.start();
|
|
3762
|
+
} else if (record === false) {
|
|
3763
|
+
tracer.stop();
|
|
3764
|
+
}
|
|
3765
|
+
return {
|
|
3766
|
+
recording: tracer.recording
|
|
3767
|
+
};
|
|
3768
|
+
}
|
|
3769
|
+
queryMetrics({ interval }) {
|
|
3770
|
+
const createNumericalValues = (key) => {
|
|
3771
|
+
var _a;
|
|
3772
|
+
const consume = (_a = tracer.get(key)) != null ? _a : [];
|
|
3773
|
+
return {
|
|
3774
|
+
key,
|
|
3775
|
+
stats: numericalValues(consume, "duration")
|
|
3776
|
+
};
|
|
3777
|
+
};
|
|
3778
|
+
return new Stream12(({ next }) => {
|
|
3779
|
+
const update = () => {
|
|
3780
|
+
const metrics = {
|
|
3781
|
+
timestamp: new Date(),
|
|
3782
|
+
values: [
|
|
3783
|
+
createNumericalValues("dxos.echo.pipeline.control"),
|
|
3784
|
+
createNumericalValues("dxos.echo.pipeline.data")
|
|
3785
|
+
]
|
|
3786
|
+
};
|
|
3787
|
+
next(metrics);
|
|
3788
|
+
};
|
|
3789
|
+
update();
|
|
3790
|
+
const i = setInterval(update, interval);
|
|
3791
|
+
return () => {
|
|
3792
|
+
clearInterval(i);
|
|
3793
|
+
};
|
|
3794
|
+
});
|
|
3795
|
+
}
|
|
3756
3796
|
queryLogs(request) {
|
|
3757
3797
|
return new Stream12(({ ctx, next }) => {
|
|
3758
3798
|
const handler = (entry2) => {
|
|
@@ -3858,7 +3898,8 @@ var SystemServiceImpl = class {
|
|
|
3858
3898
|
async updateStatus({ status }) {
|
|
3859
3899
|
await this._onUpdateStatus(status);
|
|
3860
3900
|
}
|
|
3861
|
-
|
|
3901
|
+
// TODO(burdon): Standardize interval option in stream request?
|
|
3902
|
+
queryStatus({ interval = 3e3 } = {}) {
|
|
3862
3903
|
return new Stream14(({ next }) => {
|
|
3863
3904
|
const update = () => {
|
|
3864
3905
|
next({
|
|
@@ -3867,9 +3908,9 @@ var SystemServiceImpl = class {
|
|
|
3867
3908
|
};
|
|
3868
3909
|
update();
|
|
3869
3910
|
const unsubscribe = this._statusUpdate.on(() => update());
|
|
3870
|
-
const
|
|
3911
|
+
const i = setInterval(update, interval);
|
|
3871
3912
|
return () => {
|
|
3872
|
-
clearInterval(
|
|
3913
|
+
clearInterval(i);
|
|
3873
3914
|
unsubscribe();
|
|
3874
3915
|
};
|
|
3875
3916
|
});
|
|
@@ -3890,7 +3931,7 @@ function _ts_decorate4(decorators, target, key, desc) {
|
|
|
3890
3931
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
3891
3932
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3892
3933
|
}
|
|
3893
|
-
var __dxlog_file14 = "/
|
|
3934
|
+
var __dxlog_file14 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/services/service-host.ts";
|
|
3894
3935
|
var createDefaultModelFactory = () => {
|
|
3895
3936
|
return new ModelFactory().registerModel(DocumentModel).registerModel(TextModel);
|
|
3896
3937
|
};
|
|
@@ -4166,4 +4207,4 @@ export {
|
|
|
4166
4207
|
createDefaultModelFactory,
|
|
4167
4208
|
ClientServicesHost
|
|
4168
4209
|
};
|
|
4169
|
-
//# sourceMappingURL=chunk-
|
|
4210
|
+
//# sourceMappingURL=chunk-XSZIBW37.mjs.map
|