@dxos/client-services 0.1.51-main.e7215ae → 0.1.51-next.5787f10
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-5W2L64HI.mjs → chunk-2GQ7337P.mjs} +105 -49
- package/dist/lib/browser/chunk-2GQ7337P.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 +8 -2
- package/dist/lib/browser/packlets/testing/index.mjs.map +3 -3
- package/dist/lib/node/index.cjs +122 -66
- 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 +146 -84
- package/dist/lib/node/packlets/testing/index.cjs.map +3 -3
- package/dist/types/src/packlets/devtools/devtools.d.ts +2 -1
- package/dist/types/src/packlets/devtools/devtools.d.ts.map +1 -1
- package/dist/types/src/packlets/devtools/feeds.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/logging/logging-service.d.ts +1 -1
- package/dist/types/src/packlets/logging/logging-service.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-context.d.ts +5 -0
- package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/spaces-service.d.ts.map +1 -1
- package/dist/types/src/packlets/testing/test-builder.d.ts +3 -0
- package/dist/types/src/packlets/testing/test-builder.d.ts.map +1 -1
- package/package.json +31 -30
- package/src/packlets/devtools/devtools.ts +7 -0
- package/src/packlets/devtools/feeds.ts +1 -0
- package/src/packlets/identity/identity-manager.test.ts +4 -1
- package/src/packlets/identity/identity-manager.ts +4 -1
- package/src/packlets/identity/identity.test.ts +40 -15
- package/src/packlets/logging/logging-service.ts +58 -15
- package/src/packlets/services/service-context.ts +7 -0
- package/src/packlets/spaces/data-space-manager.test.ts +64 -1
- package/src/packlets/spaces/data-space-manager.ts +2 -2
- package/src/packlets/spaces/data-space.ts +8 -3
- package/src/packlets/spaces/spaces-service.ts +7 -0
- package/src/packlets/testing/test-builder.ts +7 -0
- package/dist/lib/browser/chunk-5W2L64HI.mjs.map +0 -7
|
@@ -20,11 +20,15 @@ var subscribeToFeeds = ({ feedStore }, { feedKeys }) => {
|
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
22
|
next({
|
|
23
|
-
feeds: Array.from(feedMap.values()).map((feed) =>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
feeds: Array.from(feedMap.values()).map((feed) => {
|
|
24
|
+
var _a, _b;
|
|
25
|
+
return {
|
|
26
|
+
feedKey: feed.key,
|
|
27
|
+
length: feed.properties.length,
|
|
28
|
+
bytes: feed.core.byteLength,
|
|
29
|
+
downloaded: (_b = (_a = feed.core.bitfield) == null ? void 0 : _a.data.toBuffer()) != null ? _b : new Uint8Array()
|
|
30
|
+
};
|
|
31
|
+
})
|
|
28
32
|
});
|
|
29
33
|
};
|
|
30
34
|
subscriptions.add(feedStore.feedOpened.on(update));
|
|
@@ -260,6 +264,11 @@ var DevtoolsServiceImpl = class {
|
|
|
260
264
|
usageQuota: (_e = navigatorInfo == null ? void 0 : navigatorInfo.quota) != null ? _e : 0
|
|
261
265
|
};
|
|
262
266
|
}
|
|
267
|
+
async getBlobs() {
|
|
268
|
+
return {
|
|
269
|
+
blobs: await this.params.context.blobStore.list()
|
|
270
|
+
};
|
|
271
|
+
}
|
|
263
272
|
async getSnapshots() {
|
|
264
273
|
return {
|
|
265
274
|
snapshots: await this.params.context.snapshotStore.listSnapshots()
|
|
@@ -800,7 +809,8 @@ var IdentityManager = class {
|
|
|
800
809
|
});
|
|
801
810
|
assert2(identityRecord.haloSpace.dataFeedKey);
|
|
802
811
|
const dataFeed = await this._feedStore.openFeed(identityRecord.haloSpace.dataFeedKey, {
|
|
803
|
-
writable: true
|
|
812
|
+
writable: true,
|
|
813
|
+
sparse: true
|
|
804
814
|
});
|
|
805
815
|
const space = await this._constructSpace({
|
|
806
816
|
spaceRecord: identityRecord.haloSpace,
|
|
@@ -823,7 +833,7 @@ var IdentityManager = class {
|
|
|
823
833
|
identityKey: identityRecord.identityKey
|
|
824
834
|
}, {
|
|
825
835
|
file: "identity-manager.ts",
|
|
826
|
-
line:
|
|
836
|
+
line: 226,
|
|
827
837
|
scope: this,
|
|
828
838
|
callSite: (f, a) => f(...a)
|
|
829
839
|
});
|
|
@@ -844,7 +854,7 @@ var IdentityManager = class {
|
|
|
844
854
|
onAuthFailure: () => {
|
|
845
855
|
log3.warn("auth failure", {}, {
|
|
846
856
|
file: "identity-manager.ts",
|
|
847
|
-
line:
|
|
857
|
+
line: 245,
|
|
848
858
|
scope: this,
|
|
849
859
|
callSite: (f, a) => f(...a)
|
|
850
860
|
});
|
|
@@ -2198,6 +2208,7 @@ import { PublicKey as PublicKey7 } from "@dxos/keys";
|
|
|
2198
2208
|
import { log as log10 } from "@dxos/log";
|
|
2199
2209
|
import { SpaceState } from "@dxos/protocols/proto/dxos/client/services";
|
|
2200
2210
|
import { AdmittedFeed as AdmittedFeed3 } from "@dxos/protocols/proto/dxos/halo/credentials";
|
|
2211
|
+
import { Timeframe } from "@dxos/timeframe";
|
|
2201
2212
|
import { ComplexSet as ComplexSet2 } from "@dxos/util";
|
|
2202
2213
|
|
|
2203
2214
|
// packages/sdk/client-services/src/packlets/spaces/notarization-plugin.ts
|
|
@@ -2540,7 +2551,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2540
2551
|
if (err instanceof CancelledError) {
|
|
2541
2552
|
log10("Data pipeline initialization cancelled", err, {
|
|
2542
2553
|
file: "data-space.ts",
|
|
2543
|
-
line:
|
|
2554
|
+
line: 173,
|
|
2544
2555
|
scope: this,
|
|
2545
2556
|
callSite: (f, a) => f(...a)
|
|
2546
2557
|
});
|
|
@@ -2548,7 +2559,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2548
2559
|
}
|
|
2549
2560
|
log10.error("Error initializing data pipeline", err, {
|
|
2550
2561
|
file: "data-space.ts",
|
|
2551
|
-
line:
|
|
2562
|
+
line: 177,
|
|
2552
2563
|
scope: this,
|
|
2553
2564
|
callSite: (f, a) => f(...a)
|
|
2554
2565
|
});
|
|
@@ -2629,7 +2640,8 @@ var DataSpace = class DataSpace2 {
|
|
|
2629
2640
|
}
|
|
2630
2641
|
if (!this.inner.dataFeedKey) {
|
|
2631
2642
|
const dataFeed = await this._feedStore.openFeed(await this._keyring.createKey(), {
|
|
2632
|
-
writable: true
|
|
2643
|
+
writable: true,
|
|
2644
|
+
sparse: true
|
|
2633
2645
|
});
|
|
2634
2646
|
this.inner.setDataFeed(dataFeed);
|
|
2635
2647
|
credentials.push(await this._signingContext.credentialSigner.createCredential({
|
|
@@ -2655,7 +2667,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2655
2667
|
async createEpoch() {
|
|
2656
2668
|
var _a, _b;
|
|
2657
2669
|
const epoch = await this.dataPipeline.createEpoch();
|
|
2658
|
-
await this.inner.controlPipeline.writer.write({
|
|
2670
|
+
const receipt = await this.inner.controlPipeline.writer.write({
|
|
2659
2671
|
credential: {
|
|
2660
2672
|
credential: await this._signingContext.credentialSigner.createCredential({
|
|
2661
2673
|
subject: this.key,
|
|
@@ -2666,6 +2678,12 @@ var DataSpace = class DataSpace2 {
|
|
|
2666
2678
|
})
|
|
2667
2679
|
}
|
|
2668
2680
|
});
|
|
2681
|
+
await this.inner.controlPipeline.state.waitUntilTimeframe(new Timeframe([
|
|
2682
|
+
[
|
|
2683
|
+
receipt.feedKey,
|
|
2684
|
+
receipt.seq
|
|
2685
|
+
]
|
|
2686
|
+
]));
|
|
2669
2687
|
for (const feed of (_b = (_a = this.inner.dataPipeline.pipelineState) == null ? void 0 : _a.feeds) != null ? _b : []) {
|
|
2670
2688
|
const indexBeforeEpoch = epoch.timeframe.get(feed.key);
|
|
2671
2689
|
if (indexBeforeEpoch) {
|
|
@@ -2697,7 +2715,7 @@ import { ComplexMap as ComplexMap3, deferFunction as deferFunction2 } from "@dxo
|
|
|
2697
2715
|
import { createCredential } from "@dxos/credentials";
|
|
2698
2716
|
import { failUndefined as failUndefined2 } from "@dxos/debug";
|
|
2699
2717
|
import { AdmittedFeed as AdmittedFeed4, SpaceMember } from "@dxos/protocols/proto/dxos/halo/credentials";
|
|
2700
|
-
import { Timeframe } from "@dxos/timeframe";
|
|
2718
|
+
import { Timeframe as Timeframe2 } from "@dxos/timeframe";
|
|
2701
2719
|
var spaceGenesis = async (keyring, signingContext, space) => {
|
|
2702
2720
|
var _a, _b, _c, _d;
|
|
2703
2721
|
const credentials = [
|
|
@@ -2748,7 +2766,7 @@ var spaceGenesis = async (keyring, signingContext, space) => {
|
|
|
2748
2766
|
"@type": "dxos.halo.credentials.Epoch",
|
|
2749
2767
|
number: 0,
|
|
2750
2768
|
previousId: void 0,
|
|
2751
|
-
timeframe: new
|
|
2769
|
+
timeframe: new Timeframe2(),
|
|
2752
2770
|
snapshotCid: void 0
|
|
2753
2771
|
}
|
|
2754
2772
|
})
|
|
@@ -2953,7 +2971,8 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
2953
2971
|
writable: true
|
|
2954
2972
|
});
|
|
2955
2973
|
const dataFeed = metadata.dataFeedKey && await this._feedStore.openFeed(metadata.dataFeedKey, {
|
|
2956
|
-
writable: true
|
|
2974
|
+
writable: true,
|
|
2975
|
+
sparse: true
|
|
2957
2976
|
});
|
|
2958
2977
|
const space = await this._spaceManager.constructSpace({
|
|
2959
2978
|
metadata,
|
|
@@ -2966,7 +2985,6 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
2966
2985
|
session.addExtension("dxos.mesh.teleport.gossip", gossip.createExtension({
|
|
2967
2986
|
remotePeerId: session.remotePeerId
|
|
2968
2987
|
}));
|
|
2969
|
-
session.addExtension("dxos.mesh.teleport.objectsync", space.snapshotManager.objectSync.createExtension());
|
|
2970
2988
|
session.addExtension("dxos.mesh.teleport.notarization", dataSpace.notarizationPlugin.createExtension());
|
|
2971
2989
|
},
|
|
2972
2990
|
onAuthFailure: () => {
|
|
@@ -3082,7 +3100,7 @@ var SpacesServiceImpl = class {
|
|
|
3082
3100
|
spaces
|
|
3083
3101
|
}, {
|
|
3084
3102
|
file: "spaces-service.ts",
|
|
3085
|
-
line:
|
|
3103
|
+
line: 60,
|
|
3086
3104
|
scope: this,
|
|
3087
3105
|
callSite: (f, a) => f(...a)
|
|
3088
3106
|
});
|
|
@@ -3099,6 +3117,7 @@ var SpacesServiceImpl = class {
|
|
|
3099
3117
|
for (const space of dataSpaceManager.spaces.values()) {
|
|
3100
3118
|
subscriptions.add(space.stateUpdate.on(ctx, onUpdate));
|
|
3101
3119
|
subscriptions.add(space.presence.updated.on(ctx, onUpdate));
|
|
3120
|
+
subscriptions.add(space.dataPipeline.onNewEpoch.on(ctx, onUpdate));
|
|
3102
3121
|
space.inner.controlPipeline.state.timeframeUpdate.debounce(TIMEFRAME_UPDATE_DEBOUNCE_TIME).on(ctx, onUpdate);
|
|
3103
3122
|
if (space.dataPipeline.pipelineState) {
|
|
3104
3123
|
subscriptions.add(space.dataPipeline.pipelineState.timeframeUpdate.debounce(TIMEFRAME_UPDATE_DEBOUNCE_TIME).on(ctx, onUpdate));
|
|
@@ -3169,20 +3188,23 @@ var SpacesServiceImpl = class {
|
|
|
3169
3188
|
await space.createEpoch();
|
|
3170
3189
|
}
|
|
3171
3190
|
_transformSpace(space) {
|
|
3172
|
-
var _a, _b, _c, _d, _e;
|
|
3191
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
3173
3192
|
return {
|
|
3174
3193
|
spaceKey: space.key,
|
|
3175
3194
|
state: space.state,
|
|
3176
3195
|
error: space.error ? encodeError(space.error) : void 0,
|
|
3177
3196
|
pipeline: {
|
|
3197
|
+
currentEpoch: space.dataPipeline.currentEpoch,
|
|
3198
|
+
appliedEpoch: space.dataPipeline.appliedEpoch,
|
|
3178
3199
|
controlFeeds: space.inner.controlPipeline.state.feeds.map((feed) => feed.key),
|
|
3179
3200
|
currentControlTimeframe: space.inner.controlPipeline.state.timeframe,
|
|
3180
3201
|
targetControlTimeframe: space.inner.controlPipeline.state.targetTimeframe,
|
|
3181
3202
|
totalControlTimeframe: space.inner.controlPipeline.state.endTimeframe,
|
|
3182
3203
|
dataFeeds: (_b = (_a = space.dataPipeline.pipelineState) == null ? void 0 : _a.feeds.map((feed) => feed.key)) != null ? _b : [],
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3204
|
+
startDataTimeframe: (_c = space.dataPipeline.pipelineState) == null ? void 0 : _c.startTimeframe,
|
|
3205
|
+
currentDataTimeframe: (_d = space.dataPipeline.pipelineState) == null ? void 0 : _d.timeframe,
|
|
3206
|
+
targetDataTimeframe: (_e = space.dataPipeline.pipelineState) == null ? void 0 : _e.targetTimeframe,
|
|
3207
|
+
totalDataTimeframe: (_f = space.dataPipeline.pipelineState) == null ? void 0 : _f.endTimeframe
|
|
3186
3208
|
},
|
|
3187
3209
|
members: Array.from(space.inner.spaceState.members.values()).map((member) => {
|
|
3188
3210
|
var _a2, _b2, _c2;
|
|
@@ -3196,6 +3218,7 @@ var SpacesServiceImpl = class {
|
|
|
3196
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 ? SpaceMember2.PresenceState.ONLINE : SpaceMember2.PresenceState.OFFLINE
|
|
3197
3219
|
};
|
|
3198
3220
|
}),
|
|
3221
|
+
creator: (_g = space.inner.spaceState.creator) == null ? void 0 : _g.key,
|
|
3199
3222
|
cache: space.cache,
|
|
3200
3223
|
metrics: space.metrics
|
|
3201
3224
|
};
|
|
@@ -3264,6 +3287,7 @@ import { PublicKey as PublicKey9 } from "@dxos/keys";
|
|
|
3264
3287
|
import { log as log13 } from "@dxos/log";
|
|
3265
3288
|
import { STORAGE_VERSION, trace as trace5 } from "@dxos/protocols";
|
|
3266
3289
|
import { Invitation as Invitation5 } from "@dxos/protocols/proto/dxos/client/services";
|
|
3290
|
+
import { BlobStore } from "@dxos/teleport-extension-object-sync";
|
|
3267
3291
|
var ServiceContext = class {
|
|
3268
3292
|
// prettier-ignore
|
|
3269
3293
|
constructor(storage, networkManager, signalManager, modelFactory) {
|
|
@@ -3277,6 +3301,7 @@ var ServiceContext = class {
|
|
|
3277
3301
|
this._instanceId = PublicKey9.random().toHex();
|
|
3278
3302
|
this.metadataStore = new MetadataStore(storage.createDirectory("metadata"));
|
|
3279
3303
|
this.snapshotStore = new SnapshotStore(storage.createDirectory("snapshots"));
|
|
3304
|
+
this.blobStore = new BlobStore(storage.createDirectory("blobs"));
|
|
3280
3305
|
this.keyring = new Keyring(storage.createDirectory("keyring"));
|
|
3281
3306
|
this.feedStore = new FeedStore({
|
|
3282
3307
|
factory: new FeedFactory({
|
|
@@ -3290,6 +3315,7 @@ var ServiceContext = class {
|
|
|
3290
3315
|
this.spaceManager = new SpaceManager({
|
|
3291
3316
|
feedStore: this.feedStore,
|
|
3292
3317
|
networkManager: this.networkManager,
|
|
3318
|
+
blobStore: this.blobStore,
|
|
3293
3319
|
metadataStore: this.metadataStore,
|
|
3294
3320
|
modelFactory: this.modelFactory,
|
|
3295
3321
|
snapshotStore: this.snapshotStore
|
|
@@ -3306,14 +3332,14 @@ var ServiceContext = class {
|
|
|
3306
3332
|
id: this._instanceId
|
|
3307
3333
|
}), {
|
|
3308
3334
|
file: "service-context.ts",
|
|
3309
|
-
line:
|
|
3335
|
+
line: 126,
|
|
3310
3336
|
scope: this,
|
|
3311
3337
|
callSite: (f, a) => f(...a)
|
|
3312
3338
|
});
|
|
3313
3339
|
await this._checkStorageVersion();
|
|
3314
3340
|
log13("opening...", {}, {
|
|
3315
3341
|
file: "service-context.ts",
|
|
3316
|
-
line:
|
|
3342
|
+
line: 130,
|
|
3317
3343
|
scope: this,
|
|
3318
3344
|
callSite: (f, a) => f(...a)
|
|
3319
3345
|
});
|
|
@@ -3326,7 +3352,7 @@ var ServiceContext = class {
|
|
|
3326
3352
|
}
|
|
3327
3353
|
log13("opened", {}, {
|
|
3328
3354
|
file: "service-context.ts",
|
|
3329
|
-
line:
|
|
3355
|
+
line: 138,
|
|
3330
3356
|
scope: this,
|
|
3331
3357
|
callSite: (f, a) => f(...a)
|
|
3332
3358
|
});
|
|
@@ -3334,7 +3360,7 @@ var ServiceContext = class {
|
|
|
3334
3360
|
id: this._instanceId
|
|
3335
3361
|
}), {
|
|
3336
3362
|
file: "service-context.ts",
|
|
3337
|
-
line:
|
|
3363
|
+
line: 139,
|
|
3338
3364
|
scope: this,
|
|
3339
3365
|
callSite: (f, a) => f(...a)
|
|
3340
3366
|
});
|
|
@@ -3343,7 +3369,7 @@ var ServiceContext = class {
|
|
|
3343
3369
|
var _a, _b;
|
|
3344
3370
|
log13("closing...", {}, {
|
|
3345
3371
|
file: "service-context.ts",
|
|
3346
|
-
line:
|
|
3372
|
+
line: 143,
|
|
3347
3373
|
scope: this,
|
|
3348
3374
|
callSite: (f, a) => f(...a)
|
|
3349
3375
|
});
|
|
@@ -3357,7 +3383,7 @@ var ServiceContext = class {
|
|
|
3357
3383
|
this.dataServiceSubscriptions.clear();
|
|
3358
3384
|
log13("closed", {}, {
|
|
3359
3385
|
file: "service-context.ts",
|
|
3360
|
-
line:
|
|
3386
|
+
line: 152,
|
|
3361
3387
|
scope: this,
|
|
3362
3388
|
callSite: (f, a) => f(...a)
|
|
3363
3389
|
});
|
|
@@ -3388,7 +3414,7 @@ var ServiceContext = class {
|
|
|
3388
3414
|
var _a;
|
|
3389
3415
|
log13("initializing spaces...", {}, {
|
|
3390
3416
|
file: "service-context.ts",
|
|
3391
|
-
line:
|
|
3417
|
+
line: 185,
|
|
3392
3418
|
scope: this,
|
|
3393
3419
|
callSite: (f, a) => f(...a)
|
|
3394
3420
|
});
|
|
@@ -3427,7 +3453,7 @@ var ServiceContext = class {
|
|
|
3427
3453
|
details: assertion
|
|
3428
3454
|
}, {
|
|
3429
3455
|
file: "service-context.ts",
|
|
3430
|
-
line:
|
|
3456
|
+
line: 224,
|
|
3431
3457
|
scope: this,
|
|
3432
3458
|
callSite: (f, a) => f(...a)
|
|
3433
3459
|
});
|
|
@@ -3438,7 +3464,7 @@ var ServiceContext = class {
|
|
|
3438
3464
|
details: assertion
|
|
3439
3465
|
}, {
|
|
3440
3466
|
file: "service-context.ts",
|
|
3441
|
-
line:
|
|
3467
|
+
line: 228,
|
|
3442
3468
|
scope: this,
|
|
3443
3469
|
callSite: (f, a) => f(...a)
|
|
3444
3470
|
});
|
|
@@ -3449,7 +3475,7 @@ var ServiceContext = class {
|
|
|
3449
3475
|
details: assertion
|
|
3450
3476
|
}, {
|
|
3451
3477
|
file: "service-context.ts",
|
|
3452
|
-
line:
|
|
3478
|
+
line: 233,
|
|
3453
3479
|
scope: this,
|
|
3454
3480
|
callSite: (f, a) => f(...a)
|
|
3455
3481
|
});
|
|
@@ -3460,7 +3486,7 @@ var ServiceContext = class {
|
|
|
3460
3486
|
} catch (err) {
|
|
3461
3487
|
log13.catch(err, {}, {
|
|
3462
3488
|
file: "service-context.ts",
|
|
3463
|
-
line:
|
|
3489
|
+
line: 239,
|
|
3464
3490
|
scope: this,
|
|
3465
3491
|
callSite: (f, a) => f(...a)
|
|
3466
3492
|
});
|
|
@@ -3557,7 +3583,8 @@ var DevicesServiceImpl = class {
|
|
|
3557
3583
|
// packages/sdk/client-services/src/packlets/logging/logging-service.ts
|
|
3558
3584
|
import { Event as Event7 } from "@dxos/async";
|
|
3559
3585
|
import { Stream as Stream11 } from "@dxos/codec-protobuf";
|
|
3560
|
-
import { log as log14
|
|
3586
|
+
import { getContextFromEntry, log as log14 } from "@dxos/log";
|
|
3587
|
+
import { QueryLogsRequest } from "@dxos/protocols/proto/dxos/client/services";
|
|
3561
3588
|
import { jsonify } from "@dxos/util";
|
|
3562
3589
|
var LoggingServiceImpl = class {
|
|
3563
3590
|
constructor() {
|
|
@@ -3574,31 +3601,60 @@ var LoggingServiceImpl = class {
|
|
|
3574
3601
|
log14.runtimeConfig.processors.splice(index, 1);
|
|
3575
3602
|
}
|
|
3576
3603
|
queryLogs(request) {
|
|
3577
|
-
var _a;
|
|
3578
|
-
const filters = ((_a = request.filters) == null ? void 0 : _a.length) ? request.filters : void 0;
|
|
3579
3604
|
return new Stream11(({ ctx, next }) => {
|
|
3580
3605
|
const handler = (entry2) => {
|
|
3581
|
-
var
|
|
3582
|
-
if (
|
|
3606
|
+
var _a, _b, _c, _d, _e;
|
|
3607
|
+
if (LOG_PROCESSING > 0) {
|
|
3583
3608
|
return;
|
|
3584
3609
|
}
|
|
3585
|
-
if (
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3610
|
+
if (((_a = entry2.meta) == null ? void 0 : _a.file.includes("logging-service")) || entry2.context && Object.values(entry2.context).some((value) => typeof value === "string" && value.includes("LoggingService"))) {
|
|
3611
|
+
return;
|
|
3612
|
+
}
|
|
3613
|
+
if (!shouldLog(entry2, request)) {
|
|
3614
|
+
return;
|
|
3615
|
+
}
|
|
3616
|
+
const record = {
|
|
3617
|
+
...entry2,
|
|
3618
|
+
context: jsonify(getContextFromEntry(entry2)),
|
|
3619
|
+
timestamp: new Date(),
|
|
3620
|
+
meta: {
|
|
3621
|
+
// TODO(dmaretskyi): Fix proto.
|
|
3622
|
+
file: (_c = (_b = entry2.meta) == null ? void 0 : _b.file) != null ? _c : "",
|
|
3623
|
+
line: (_e = (_d = entry2.meta) == null ? void 0 : _d.line) != null ? _e : 0
|
|
3624
|
+
}
|
|
3625
|
+
};
|
|
3626
|
+
try {
|
|
3627
|
+
LOG_PROCESSING++;
|
|
3592
3628
|
next(record);
|
|
3629
|
+
} finally {
|
|
3630
|
+
LOG_PROCESSING--;
|
|
3593
3631
|
}
|
|
3594
3632
|
};
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3633
|
+
this._logs.on(ctx, handler);
|
|
3634
|
+
});
|
|
3635
|
+
}
|
|
3636
|
+
};
|
|
3637
|
+
var matchFilter = (filter, level, path, options) => {
|
|
3638
|
+
switch (options) {
|
|
3639
|
+
case QueryLogsRequest.MatchingOptions.INCLUSIVE:
|
|
3640
|
+
return level >= filter.level && (!filter.pattern || path.includes(filter.pattern));
|
|
3641
|
+
case QueryLogsRequest.MatchingOptions.EXPLICIT:
|
|
3642
|
+
return level === filter.level && (!filter.pattern || path.includes(filter.pattern));
|
|
3643
|
+
}
|
|
3644
|
+
};
|
|
3645
|
+
var shouldLog = (entry2, request) => {
|
|
3646
|
+
var _a;
|
|
3647
|
+
const options = (_a = request.options) != null ? _a : QueryLogsRequest.MatchingOptions.INCLUSIVE;
|
|
3648
|
+
if (request.filters === void 0) {
|
|
3649
|
+
return options === QueryLogsRequest.MatchingOptions.INCLUSIVE;
|
|
3650
|
+
} else {
|
|
3651
|
+
return request.filters.some((filter) => {
|
|
3652
|
+
var _a2, _b;
|
|
3653
|
+
return matchFilter(filter, entry2.level, (_b = (_a2 = entry2.meta) == null ? void 0 : _a2.file) != null ? _b : "", options);
|
|
3599
3654
|
});
|
|
3600
3655
|
}
|
|
3601
3656
|
};
|
|
3657
|
+
var LOG_PROCESSING = 0;
|
|
3602
3658
|
|
|
3603
3659
|
// packages/sdk/client-services/src/packlets/network/network-service.ts
|
|
3604
3660
|
import { Stream as Stream12 } from "@dxos/codec-protobuf";
|
|
@@ -3955,4 +4011,4 @@ export {
|
|
|
3955
4011
|
ClientServicesHost,
|
|
3956
4012
|
LocalClientServices
|
|
3957
4013
|
};
|
|
3958
|
-
//# sourceMappingURL=chunk-
|
|
4014
|
+
//# sourceMappingURL=chunk-2GQ7337P.mjs.map
|