@dxos/client-services 0.1.48 → 0.1.49-next.c888fc1
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-KN2NX2RP.mjs → chunk-YLH4UYUT.mjs} +84 -74
- package/dist/lib/browser/chunk-YLH4UYUT.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 +18 -5
- package/dist/lib/browser/packlets/testing/index.mjs.map +3 -3
- package/dist/lib/node/index.cjs +90 -80
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/packlets/testing/index.cjs +104 -81
- package/dist/lib/node/packlets/testing/index.cjs.map +4 -4
- 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/metadata.d.ts +7 -0
- package/dist/types/src/packlets/devtools/metadata.d.ts.map +1 -0
- package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space.d.ts +1 -1
- package/dist/types/src/packlets/spaces/notarization-plugin.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/spaces-service.d.ts +0 -3
- package/dist/types/src/packlets/spaces/spaces-service.d.ts.map +1 -1
- package/dist/types/src/packlets/testing/test-builder.d.ts +10 -3
- package/dist/types/src/packlets/testing/test-builder.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/vault-resource-lock.d.ts.map +1 -1
- package/package.json +30 -30
- package/src/packlets/devtools/devtools.ts +6 -0
- package/src/packlets/devtools/feeds.ts +1 -1
- package/src/packlets/devtools/metadata.ts +14 -0
- package/src/packlets/services/service-context.ts +1 -2
- package/src/packlets/services/service-host.ts +1 -0
- package/src/packlets/spaces/data-space-manager.test.ts +43 -0
- package/src/packlets/spaces/notarization-plugin.ts +7 -3
- package/src/packlets/spaces/spaces-service.ts +0 -3
- package/src/packlets/testing/test-builder.ts +23 -4
- package/src/packlets/vault/vault-resource-lock.ts +1 -0
- package/dist/lib/browser/chunk-KN2NX2RP.mjs.map +0 -7
|
@@ -23,7 +23,7 @@ var subscribeToFeeds = ({ feedStore }, { feedKeys }) => {
|
|
|
23
23
|
feeds: Array.from(feedMap.values()).map((feed) => ({
|
|
24
24
|
feedKey: feed.key,
|
|
25
25
|
length: feed.properties.length,
|
|
26
|
-
|
|
26
|
+
bytes: feed.core.byteLength
|
|
27
27
|
}))
|
|
28
28
|
});
|
|
29
29
|
};
|
|
@@ -199,7 +199,7 @@ var subscribeToSpaces = (context, { spaceKeys = [] }) => {
|
|
|
199
199
|
|
|
200
200
|
// packages/sdk/client-services/src/packlets/devtools/devtools.ts
|
|
201
201
|
import { Event as AsyncEvent } from "@dxos/async";
|
|
202
|
-
import { Stream as
|
|
202
|
+
import { Stream as Stream6 } from "@dxos/codec-protobuf";
|
|
203
203
|
|
|
204
204
|
// packages/sdk/client-services/src/packlets/devtools/keys.ts
|
|
205
205
|
import { scheduleTask } from "@dxos/async";
|
|
@@ -214,6 +214,17 @@ var subscribeToKeyringKeys = ({ keyring }) => new Stream4(({ next, ctx }) => {
|
|
|
214
214
|
scheduleTask(ctx, update);
|
|
215
215
|
});
|
|
216
216
|
|
|
217
|
+
// packages/sdk/client-services/src/packlets/devtools/metadata.ts
|
|
218
|
+
import { Stream as Stream5 } from "@dxos/codec-protobuf";
|
|
219
|
+
var subscribeToMetadata = ({ context }) => new Stream5(({ next, ctx }) => {
|
|
220
|
+
context.metadataStore.update.on(ctx, (data) => next({
|
|
221
|
+
metadata: data
|
|
222
|
+
}));
|
|
223
|
+
next({
|
|
224
|
+
metadata: context.metadataStore.metadata
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
|
|
217
228
|
// packages/sdk/client-services/src/packlets/devtools/devtools.ts
|
|
218
229
|
var DevtoolsHostEvents = class {
|
|
219
230
|
constructor() {
|
|
@@ -225,7 +236,7 @@ var DevtoolsServiceImpl = class {
|
|
|
225
236
|
this.params = params;
|
|
226
237
|
}
|
|
227
238
|
events(request) {
|
|
228
|
-
return new
|
|
239
|
+
return new Stream6(({ next }) => {
|
|
229
240
|
this.params.events.ready.on(() => {
|
|
230
241
|
next({
|
|
231
242
|
ready: {}
|
|
@@ -317,6 +328,11 @@ var DevtoolsServiceImpl = class {
|
|
|
317
328
|
networkManager: this.params.context.networkManager
|
|
318
329
|
});
|
|
319
330
|
}
|
|
331
|
+
subscribeToMetadata() {
|
|
332
|
+
return subscribeToMetadata({
|
|
333
|
+
context: this.params.context
|
|
334
|
+
});
|
|
335
|
+
}
|
|
320
336
|
};
|
|
321
337
|
|
|
322
338
|
// packages/sdk/client-services/src/packlets/identity/authenticator.ts
|
|
@@ -840,7 +856,7 @@ var IdentityManager = class {
|
|
|
840
856
|
|
|
841
857
|
// packages/sdk/client-services/src/packlets/identity/identity-service.ts
|
|
842
858
|
import assert3 from "@dxos/node-std/assert";
|
|
843
|
-
import { Stream as
|
|
859
|
+
import { Stream as Stream7 } from "@dxos/codec-protobuf";
|
|
844
860
|
import { signPresentation } from "@dxos/credentials";
|
|
845
861
|
import { todo } from "@dxos/debug";
|
|
846
862
|
var IdentityServiceImpl = class {
|
|
@@ -856,7 +872,7 @@ var IdentityServiceImpl = class {
|
|
|
856
872
|
return todo();
|
|
857
873
|
}
|
|
858
874
|
queryIdentity() {
|
|
859
|
-
return new
|
|
875
|
+
return new Stream7(({ next }) => {
|
|
860
876
|
const emitNext = () => next({
|
|
861
877
|
identity: this._getIdentity()
|
|
862
878
|
});
|
|
@@ -1788,7 +1804,7 @@ var InvitationsHandler = class {
|
|
|
1788
1804
|
// packages/sdk/client-services/src/packlets/invitations/invitations-service.ts
|
|
1789
1805
|
import assert7 from "@dxos/node-std/assert";
|
|
1790
1806
|
import { Event as Event3 } from "@dxos/async";
|
|
1791
|
-
import { Stream as
|
|
1807
|
+
import { Stream as Stream8 } from "@dxos/codec-protobuf";
|
|
1792
1808
|
import { log as log6 } from "@dxos/log";
|
|
1793
1809
|
import { QueryInvitationsResponse } from "@dxos/protocols/proto/dxos/client/services";
|
|
1794
1810
|
var InvitationsServiceImpl = class {
|
|
@@ -1817,7 +1833,7 @@ var InvitationsServiceImpl = class {
|
|
|
1817
1833
|
this._createInvitations.set(invitation.get().invitationId, invitation);
|
|
1818
1834
|
this._invitationCreated.emit(invitation.get());
|
|
1819
1835
|
}
|
|
1820
|
-
return new
|
|
1836
|
+
return new Stream8(({ next, close }) => {
|
|
1821
1837
|
invitation.subscribe((invitation2) => {
|
|
1822
1838
|
next(invitation2);
|
|
1823
1839
|
}, (err) => {
|
|
@@ -1839,7 +1855,7 @@ var InvitationsServiceImpl = class {
|
|
|
1839
1855
|
this._acceptInvitations.set(invitation.get().invitationId, invitation);
|
|
1840
1856
|
this._invitationAccepted.emit(invitation.get());
|
|
1841
1857
|
}
|
|
1842
|
-
return new
|
|
1858
|
+
return new Stream8(({ next, close }) => {
|
|
1843
1859
|
invitation.subscribe((invitation2) => {
|
|
1844
1860
|
next(invitation2);
|
|
1845
1861
|
}, (err) => {
|
|
@@ -1902,7 +1918,7 @@ var InvitationsServiceImpl = class {
|
|
|
1902
1918
|
}
|
|
1903
1919
|
}
|
|
1904
1920
|
queryInvitations() {
|
|
1905
|
-
return new
|
|
1921
|
+
return new Stream8(({ next, ctx }) => {
|
|
1906
1922
|
this._invitationCreated.on(ctx, (invitation) => {
|
|
1907
1923
|
next({
|
|
1908
1924
|
action: QueryInvitationsResponse.Action.ADDED,
|
|
@@ -2068,6 +2084,7 @@ import { ComplexMap as ComplexMap2, ComplexSet, entry } from "@dxos/util";
|
|
|
2068
2084
|
var DEFAULT_RETRY_TIMEOUT = 1e3;
|
|
2069
2085
|
var DEFAULT_SUCCESS_DELAY = 1e3;
|
|
2070
2086
|
var DEFAULT_NOTARIZE_TIMEOUT = 1e4;
|
|
2087
|
+
var WRITER_NOT_SET_ERROR_CODE = "WRITER_NOT_SET";
|
|
2071
2088
|
var NotarizationPlugin = class {
|
|
2072
2089
|
constructor() {
|
|
2073
2090
|
this._ctx = new Context5();
|
|
@@ -2089,7 +2106,7 @@ var NotarizationPlugin = class {
|
|
|
2089
2106
|
credentials
|
|
2090
2107
|
}, {
|
|
2091
2108
|
file: "notarization-plugin.ts",
|
|
2092
|
-
line:
|
|
2109
|
+
line: 87,
|
|
2093
2110
|
scope: this,
|
|
2094
2111
|
callSite: (f, a) => f(...a)
|
|
2095
2112
|
});
|
|
@@ -2101,7 +2118,7 @@ var NotarizationPlugin = class {
|
|
|
2101
2118
|
err
|
|
2102
2119
|
}, {
|
|
2103
2120
|
file: "notarization-plugin.ts",
|
|
2104
|
-
line:
|
|
2121
|
+
line: 96,
|
|
2105
2122
|
scope: this,
|
|
2106
2123
|
callSite: (f, a) => f(...a)
|
|
2107
2124
|
});
|
|
@@ -2117,7 +2134,7 @@ var NotarizationPlugin = class {
|
|
|
2117
2134
|
peers: Array.from(this._extensions).map((extension) => extension.remotePeerId)
|
|
2118
2135
|
}, {
|
|
2119
2136
|
file: "notarization-plugin.ts",
|
|
2120
|
-
line:
|
|
2137
|
+
line: 108,
|
|
2121
2138
|
scope: this,
|
|
2122
2139
|
callSite: (f, a) => f(...a)
|
|
2123
2140
|
});
|
|
@@ -2140,7 +2157,7 @@ var NotarizationPlugin = class {
|
|
|
2140
2157
|
retryIn: retryTimeout
|
|
2141
2158
|
}, {
|
|
2142
2159
|
file: "notarization-plugin.ts",
|
|
2143
|
-
line:
|
|
2160
|
+
line: 133,
|
|
2144
2161
|
scope: this,
|
|
2145
2162
|
callSite: (f, a) => f(...a)
|
|
2146
2163
|
});
|
|
@@ -2154,7 +2171,7 @@ var NotarizationPlugin = class {
|
|
|
2154
2171
|
credentialId: credentials.map((credential) => credential.id)
|
|
2155
2172
|
}, {
|
|
2156
2173
|
file: "notarization-plugin.ts",
|
|
2157
|
-
line:
|
|
2174
|
+
line: 140,
|
|
2158
2175
|
scope: this,
|
|
2159
2176
|
callSite: (f, a) => f(...a)
|
|
2160
2177
|
});
|
|
@@ -2163,18 +2180,20 @@ var NotarizationPlugin = class {
|
|
|
2163
2180
|
});
|
|
2164
2181
|
log8("success", {}, {
|
|
2165
2182
|
file: "notarization-plugin.ts",
|
|
2166
|
-
line:
|
|
2183
|
+
line: 144,
|
|
2167
2184
|
scope: this,
|
|
2168
2185
|
callSite: (f, a) => f(...a)
|
|
2169
2186
|
});
|
|
2170
2187
|
await sleep2(successDelay);
|
|
2171
2188
|
} catch (err) {
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2189
|
+
if (!ctx.disposed && !err.message.includes(WRITER_NOT_SET_ERROR_CODE)) {
|
|
2190
|
+
log8.warn("error notarizing (recoverable)", err, {
|
|
2191
|
+
file: "notarization-plugin.ts",
|
|
2192
|
+
line: 148,
|
|
2193
|
+
scope: this,
|
|
2194
|
+
callSite: (f, a) => f(...a)
|
|
2195
|
+
});
|
|
2196
|
+
}
|
|
2178
2197
|
notarizeTask.schedule();
|
|
2179
2198
|
}
|
|
2180
2199
|
});
|
|
@@ -2188,7 +2207,7 @@ var NotarizationPlugin = class {
|
|
|
2188
2207
|
]);
|
|
2189
2208
|
log8("done", {}, {
|
|
2190
2209
|
file: "notarization-plugin.ts",
|
|
2191
|
-
line:
|
|
2210
|
+
line: 159,
|
|
2192
2211
|
scope: this,
|
|
2193
2212
|
callSite: (f, a) => f(...a)
|
|
2194
2213
|
});
|
|
@@ -2224,7 +2243,7 @@ var NotarizationPlugin = class {
|
|
|
2224
2243
|
async _onNotarize(request) {
|
|
2225
2244
|
var _a;
|
|
2226
2245
|
if (!this._writer) {
|
|
2227
|
-
throw new Error(
|
|
2246
|
+
throw new Error(WRITER_NOT_SET_ERROR_CODE);
|
|
2228
2247
|
}
|
|
2229
2248
|
for (const credential of (_a = request.credentials) != null ? _a : []) {
|
|
2230
2249
|
assert9(credential.id, "Credential must have an id");
|
|
@@ -2241,7 +2260,7 @@ var NotarizationPlugin = class {
|
|
|
2241
2260
|
peer: extension.localPeerId
|
|
2242
2261
|
}, {
|
|
2243
2262
|
file: "notarization-plugin.ts",
|
|
2244
|
-
line:
|
|
2263
|
+
line: 208,
|
|
2245
2264
|
scope: this,
|
|
2246
2265
|
callSite: (f, a) => f(...a)
|
|
2247
2266
|
});
|
|
@@ -2253,7 +2272,7 @@ var NotarizationPlugin = class {
|
|
|
2253
2272
|
peer: extension.localPeerId
|
|
2254
2273
|
}, {
|
|
2255
2274
|
file: "notarization-plugin.ts",
|
|
2256
|
-
line:
|
|
2275
|
+
line: 213,
|
|
2257
2276
|
scope: this,
|
|
2258
2277
|
callSite: (f, a) => f(...a)
|
|
2259
2278
|
});
|
|
@@ -2900,7 +2919,7 @@ DataSpaceManager = __decorate2([
|
|
|
2900
2919
|
|
|
2901
2920
|
// packages/sdk/client-services/src/packlets/spaces/spaces-service.ts
|
|
2902
2921
|
import { EventSubscriptions as EventSubscriptions2, scheduleTask as scheduleTask5 } from "@dxos/async";
|
|
2903
|
-
import { Stream as
|
|
2922
|
+
import { Stream as Stream9 } from "@dxos/codec-protobuf";
|
|
2904
2923
|
import { raise, todo as todo2 } from "@dxos/debug";
|
|
2905
2924
|
import { SpaceNotFoundError } from "@dxos/echo-pipeline";
|
|
2906
2925
|
import { log as log11 } from "@dxos/log";
|
|
@@ -2927,7 +2946,7 @@ var SpacesServiceImpl = class {
|
|
|
2927
2946
|
todo2();
|
|
2928
2947
|
}
|
|
2929
2948
|
querySpaces() {
|
|
2930
|
-
return new
|
|
2949
|
+
return new Stream9(({ next, ctx }) => {
|
|
2931
2950
|
const onUpdate = async () => {
|
|
2932
2951
|
const dataSpaceManager = await this._getDataSpaceManager();
|
|
2933
2952
|
const spaces = Array.from(dataSpaceManager.spaces.values()).map((space) => this._transformSpace(space));
|
|
@@ -2935,7 +2954,7 @@ var SpacesServiceImpl = class {
|
|
|
2935
2954
|
spaces
|
|
2936
2955
|
}, {
|
|
2937
2956
|
file: "spaces-service.ts",
|
|
2938
|
-
line:
|
|
2957
|
+
line: 59,
|
|
2939
2958
|
scope: this,
|
|
2940
2959
|
callSite: (f, a) => f(...a)
|
|
2941
2960
|
});
|
|
@@ -2979,7 +2998,7 @@ var SpacesServiceImpl = class {
|
|
|
2979
2998
|
await space.postMessage(getChannelId(channel), message);
|
|
2980
2999
|
}
|
|
2981
3000
|
subscribeMessages({ spaceKey, channel }) {
|
|
2982
|
-
return new
|
|
3001
|
+
return new Stream9(({ ctx, next }) => {
|
|
2983
3002
|
scheduleTask5(ctx, async () => {
|
|
2984
3003
|
var _a;
|
|
2985
3004
|
const dataSpaceManager = await this._getDataSpaceManager();
|
|
@@ -2992,7 +3011,7 @@ var SpacesServiceImpl = class {
|
|
|
2992
3011
|
});
|
|
2993
3012
|
}
|
|
2994
3013
|
queryCredentials({ spaceKey }) {
|
|
2995
|
-
return new
|
|
3014
|
+
return new Stream9(({ ctx, next }) => {
|
|
2996
3015
|
var _a;
|
|
2997
3016
|
const space = (_a = this._spaceManager.spaces.get(spaceKey)) != null ? _a : raise(new SpaceNotFoundError(spaceKey));
|
|
2998
3017
|
const processor = space.spaceState.registerProcessor({
|
|
@@ -3214,7 +3233,7 @@ import { SystemStatus } from "@dxos/protocols/proto/dxos/client/services";
|
|
|
3214
3233
|
|
|
3215
3234
|
// packages/sdk/client-services/src/packlets/devices/devices-service.ts
|
|
3216
3235
|
import { EventSubscriptions as EventSubscriptions3 } from "@dxos/async";
|
|
3217
|
-
import { Stream as
|
|
3236
|
+
import { Stream as Stream10 } from "@dxos/codec-protobuf";
|
|
3218
3237
|
import { DeviceKind } from "@dxos/protocols/proto/dxos/client/services";
|
|
3219
3238
|
var DevicesServiceImpl = class {
|
|
3220
3239
|
constructor(_identityManager) {
|
|
@@ -3224,7 +3243,7 @@ var DevicesServiceImpl = class {
|
|
|
3224
3243
|
throw new Error("Method not implemented.");
|
|
3225
3244
|
}
|
|
3226
3245
|
queryDevices() {
|
|
3227
|
-
return new
|
|
3246
|
+
return new Stream10(({ next }) => {
|
|
3228
3247
|
const update = () => {
|
|
3229
3248
|
var _a;
|
|
3230
3249
|
const deviceKeys = (_a = this._identityManager.identity) == null ? void 0 : _a.authorizedDeviceKeys;
|
|
@@ -3261,7 +3280,7 @@ var DevicesServiceImpl = class {
|
|
|
3261
3280
|
|
|
3262
3281
|
// packages/sdk/client-services/src/packlets/logging/logging-service.ts
|
|
3263
3282
|
import { Event as Event8 } from "@dxos/async";
|
|
3264
|
-
import { Stream as
|
|
3283
|
+
import { Stream as Stream11 } from "@dxos/codec-protobuf";
|
|
3265
3284
|
import { log as log12, shouldLog, getContextFromEntry } from "@dxos/log";
|
|
3266
3285
|
import { jsonify } from "@dxos/util";
|
|
3267
3286
|
var LoggingServiceImpl = class {
|
|
@@ -3281,7 +3300,7 @@ var LoggingServiceImpl = class {
|
|
|
3281
3300
|
queryLogs(request) {
|
|
3282
3301
|
var _a;
|
|
3283
3302
|
const filters = ((_a = request.filters) == null ? void 0 : _a.length) ? request.filters : void 0;
|
|
3284
|
-
return new
|
|
3303
|
+
return new Stream11(({ ctx, next }) => {
|
|
3285
3304
|
const handler = (entry2) => {
|
|
3286
3305
|
var _a2, _b, _c;
|
|
3287
3306
|
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"))) {
|
|
@@ -3306,14 +3325,14 @@ var LoggingServiceImpl = class {
|
|
|
3306
3325
|
};
|
|
3307
3326
|
|
|
3308
3327
|
// packages/sdk/client-services/src/packlets/network/network-service.ts
|
|
3309
|
-
import { Stream as
|
|
3328
|
+
import { Stream as Stream12 } from "@dxos/codec-protobuf";
|
|
3310
3329
|
var NetworkServiceImpl = class {
|
|
3311
3330
|
constructor(networkManager, signalManager) {
|
|
3312
3331
|
this.networkManager = networkManager;
|
|
3313
3332
|
this.signalManager = signalManager;
|
|
3314
3333
|
}
|
|
3315
3334
|
queryStatus() {
|
|
3316
|
-
return new
|
|
3335
|
+
return new Stream12(({ next }) => {
|
|
3317
3336
|
const update = () => {
|
|
3318
3337
|
next({
|
|
3319
3338
|
swarm: this.networkManager.connectionState,
|
|
@@ -3338,7 +3357,7 @@ var NetworkServiceImpl = class {
|
|
|
3338
3357
|
};
|
|
3339
3358
|
|
|
3340
3359
|
// packages/sdk/client-services/src/packlets/system/system-service.ts
|
|
3341
|
-
import { Stream as
|
|
3360
|
+
import { Stream as Stream13 } from "@dxos/codec-protobuf";
|
|
3342
3361
|
var SystemServiceImpl = class {
|
|
3343
3362
|
constructor({ config, statusUpdate, onUpdateStatus, getCurrentStatus, onReset }) {
|
|
3344
3363
|
this._config = config;
|
|
@@ -3355,7 +3374,7 @@ var SystemServiceImpl = class {
|
|
|
3355
3374
|
await this._onUpdateStatus(status);
|
|
3356
3375
|
}
|
|
3357
3376
|
queryStatus() {
|
|
3358
|
-
return new
|
|
3377
|
+
return new Stream13(({ next }) => {
|
|
3359
3378
|
const update = () => {
|
|
3360
3379
|
next({
|
|
3361
3380
|
status: this._getCurrentStatus()
|
|
@@ -3489,28 +3508,28 @@ var VaultResourceLock = class {
|
|
|
3489
3508
|
try {
|
|
3490
3509
|
log14("aquiring lock...", {}, {
|
|
3491
3510
|
file: "vault-resource-lock.ts",
|
|
3492
|
-
line:
|
|
3511
|
+
line: 46,
|
|
3493
3512
|
scope: this,
|
|
3494
3513
|
callSite: (f, a) => f(...a)
|
|
3495
3514
|
});
|
|
3496
3515
|
await asyncTimeout(this._requestLock(), RESOURCE_LOCK_TIMEOUT);
|
|
3497
3516
|
log14("acquired lock", {}, {
|
|
3498
3517
|
file: "vault-resource-lock.ts",
|
|
3499
|
-
line:
|
|
3518
|
+
line: 48,
|
|
3500
3519
|
scope: this,
|
|
3501
3520
|
callSite: (f, a) => f(...a)
|
|
3502
3521
|
});
|
|
3503
3522
|
} catch (e) {
|
|
3504
3523
|
log14("stealing lock...", {}, {
|
|
3505
3524
|
file: "vault-resource-lock.ts",
|
|
3506
|
-
line:
|
|
3525
|
+
line: 50,
|
|
3507
3526
|
scope: this,
|
|
3508
3527
|
callSite: (f, a) => f(...a)
|
|
3509
3528
|
});
|
|
3510
3529
|
await this._requestLock(true);
|
|
3511
3530
|
log14("stolen lock", {}, {
|
|
3512
3531
|
file: "vault-resource-lock.ts",
|
|
3513
|
-
line:
|
|
3532
|
+
line: 52,
|
|
3514
3533
|
scope: this,
|
|
3515
3534
|
callSite: (f, a) => f(...a)
|
|
3516
3535
|
});
|
|
@@ -3529,7 +3548,7 @@ var VaultResourceLock = class {
|
|
|
3529
3548
|
steal
|
|
3530
3549
|
}, {
|
|
3531
3550
|
file: "vault-resource-lock.ts",
|
|
3532
|
-
line:
|
|
3551
|
+
line: 67,
|
|
3533
3552
|
scope: this,
|
|
3534
3553
|
callSite: (f, a) => f(...a)
|
|
3535
3554
|
});
|
|
@@ -3544,14 +3563,14 @@ var VaultResourceLock = class {
|
|
|
3544
3563
|
await this._releaseTrigger.wait();
|
|
3545
3564
|
log14("releasing lock...", {}, {
|
|
3546
3565
|
file: "vault-resource-lock.ts",
|
|
3547
|
-
line:
|
|
3566
|
+
line: 76,
|
|
3548
3567
|
scope: this,
|
|
3549
3568
|
callSite: (f, a) => f(...a)
|
|
3550
3569
|
});
|
|
3551
3570
|
await ((_b = this._onRelease) == null ? void 0 : _b.call(this));
|
|
3552
3571
|
log14("released lock", {}, {
|
|
3553
3572
|
file: "vault-resource-lock.ts",
|
|
3554
|
-
line:
|
|
3573
|
+
line: 78,
|
|
3555
3574
|
scope: this,
|
|
3556
3575
|
callSite: (f, a) => f(...a)
|
|
3557
3576
|
});
|
|
@@ -3564,7 +3583,7 @@ var VaultResourceLock = class {
|
|
|
3564
3583
|
steal
|
|
3565
3584
|
}, {
|
|
3566
3585
|
file: "vault-resource-lock.ts",
|
|
3567
|
-
line:
|
|
3586
|
+
line: 85,
|
|
3568
3587
|
scope: this,
|
|
3569
3588
|
callSite: (f, a) => f(...a)
|
|
3570
3589
|
});
|
|
@@ -3589,7 +3608,7 @@ import { createProtoRpcPeer as createProtoRpcPeer3 } from "@dxos/rpc";
|
|
|
3589
3608
|
import { Callback } from "@dxos/util";
|
|
3590
3609
|
|
|
3591
3610
|
// packages/sdk/client-services/src/packlets/services/client-rpc-server.ts
|
|
3592
|
-
import { Stream as
|
|
3611
|
+
import { Stream as Stream14 } from "@dxos/codec-protobuf";
|
|
3593
3612
|
import { raise as raise2 } from "@dxos/debug";
|
|
3594
3613
|
import { parseMethodName, RpcPeer } from "@dxos/rpc";
|
|
3595
3614
|
var ClientRpcServer = class {
|
|
@@ -3614,7 +3633,7 @@ var ClientRpcServer = class {
|
|
|
3614
3633
|
const [serviceName, methodName] = parseMethodName(method);
|
|
3615
3634
|
const handler = (method2, params3) => this._getServiceHandler(serviceName).callStream(method2, params3);
|
|
3616
3635
|
if (this._handleStream) {
|
|
3617
|
-
return
|
|
3636
|
+
return Stream14.unwrapPromise(this._handleStream(methodName, params2, handler));
|
|
3618
3637
|
} else {
|
|
3619
3638
|
return handler(methodName, params2);
|
|
3620
3639
|
}
|
|
@@ -4007,16 +4026,7 @@ var ServiceContext = class {
|
|
|
4007
4026
|
async _checkStorageVersion() {
|
|
4008
4027
|
await this.metadataStore.load();
|
|
4009
4028
|
if (this.metadataStore.version !== STORAGE_VERSION) {
|
|
4010
|
-
|
|
4011
|
-
current: this.metadataStore.version,
|
|
4012
|
-
expected: STORAGE_VERSION
|
|
4013
|
-
}, {
|
|
4014
|
-
file: "service-context.ts",
|
|
4015
|
-
line: 171,
|
|
4016
|
-
scope: this,
|
|
4017
|
-
callSite: (f, a) => f(...a)
|
|
4018
|
-
});
|
|
4019
|
-
await this.metadataStore.clear();
|
|
4029
|
+
throw new Error(`Invalid storage version: current=${this.metadataStore.version}, expected=${STORAGE_VERSION}`);
|
|
4020
4030
|
}
|
|
4021
4031
|
}
|
|
4022
4032
|
// Called when identity is created.
|
|
@@ -4024,7 +4034,7 @@ var ServiceContext = class {
|
|
|
4024
4034
|
var _a;
|
|
4025
4035
|
log17("initializing spaces...", {}, {
|
|
4026
4036
|
file: "service-context.ts",
|
|
4027
|
-
line:
|
|
4037
|
+
line: 178,
|
|
4028
4038
|
scope: this,
|
|
4029
4039
|
callSite: (f, a) => f(...a)
|
|
4030
4040
|
});
|
|
@@ -4063,7 +4073,7 @@ var ServiceContext = class {
|
|
|
4063
4073
|
details: assertion
|
|
4064
4074
|
}, {
|
|
4065
4075
|
file: "service-context.ts",
|
|
4066
|
-
line:
|
|
4076
|
+
line: 217,
|
|
4067
4077
|
scope: this,
|
|
4068
4078
|
callSite: (f, a) => f(...a)
|
|
4069
4079
|
});
|
|
@@ -4074,7 +4084,7 @@ var ServiceContext = class {
|
|
|
4074
4084
|
details: assertion
|
|
4075
4085
|
}, {
|
|
4076
4086
|
file: "service-context.ts",
|
|
4077
|
-
line:
|
|
4087
|
+
line: 221,
|
|
4078
4088
|
scope: this,
|
|
4079
4089
|
callSite: (f, a) => f(...a)
|
|
4080
4090
|
});
|
|
@@ -4085,7 +4095,7 @@ var ServiceContext = class {
|
|
|
4085
4095
|
details: assertion
|
|
4086
4096
|
}, {
|
|
4087
4097
|
file: "service-context.ts",
|
|
4088
|
-
line:
|
|
4098
|
+
line: 226,
|
|
4089
4099
|
scope: this,
|
|
4090
4100
|
callSite: (f, a) => f(...a)
|
|
4091
4101
|
});
|
|
@@ -4096,7 +4106,7 @@ var ServiceContext = class {
|
|
|
4096
4106
|
} catch (err) {
|
|
4097
4107
|
log17.catch(err, {}, {
|
|
4098
4108
|
file: "service-context.ts",
|
|
4099
|
-
line:
|
|
4109
|
+
line: 232,
|
|
4100
4110
|
scope: this,
|
|
4101
4111
|
callSite: (f, a) => f(...a)
|
|
4102
4112
|
});
|
|
@@ -4234,7 +4244,7 @@ var ClientServicesHost = class {
|
|
|
4234
4244
|
id: traceId
|
|
4235
4245
|
}), {
|
|
4236
4246
|
file: "service-host.ts",
|
|
4237
|
-
line:
|
|
4247
|
+
line: 187,
|
|
4238
4248
|
scope: this,
|
|
4239
4249
|
callSite: (f, a) => f(...a)
|
|
4240
4250
|
});
|
|
@@ -4247,7 +4257,7 @@ var ClientServicesHost = class {
|
|
|
4247
4257
|
lockKey: (_a = this._resourceLock) == null ? void 0 : _a.lockKey
|
|
4248
4258
|
}, {
|
|
4249
4259
|
file: "service-host.ts",
|
|
4250
|
-
line:
|
|
4260
|
+
line: 195,
|
|
4251
4261
|
scope: this,
|
|
4252
4262
|
callSite: (f, a) => f(...a)
|
|
4253
4263
|
});
|
|
@@ -4282,7 +4292,7 @@ var ClientServicesHost = class {
|
|
|
4282
4292
|
deviceKey
|
|
4283
4293
|
}, {
|
|
4284
4294
|
file: "service-host.ts",
|
|
4285
|
-
line:
|
|
4295
|
+
line: 250,
|
|
4286
4296
|
scope: this,
|
|
4287
4297
|
callSite: (f, a) => f(...a)
|
|
4288
4298
|
});
|
|
@@ -4290,7 +4300,7 @@ var ClientServicesHost = class {
|
|
|
4290
4300
|
id: traceId
|
|
4291
4301
|
}), {
|
|
4292
4302
|
file: "service-host.ts",
|
|
4293
|
-
line:
|
|
4303
|
+
line: 251,
|
|
4294
4304
|
scope: this,
|
|
4295
4305
|
callSite: (f, a) => f(...a)
|
|
4296
4306
|
});
|
|
@@ -4305,7 +4315,7 @@ var ClientServicesHost = class {
|
|
|
4305
4315
|
deviceKey
|
|
4306
4316
|
}, {
|
|
4307
4317
|
file: "service-host.ts",
|
|
4308
|
-
line:
|
|
4318
|
+
line: 260,
|
|
4309
4319
|
scope: this,
|
|
4310
4320
|
callSite: (f, a) => f(...a)
|
|
4311
4321
|
});
|
|
@@ -4320,7 +4330,7 @@ var ClientServicesHost = class {
|
|
|
4320
4330
|
deviceKey
|
|
4321
4331
|
}, {
|
|
4322
4332
|
file: "service-host.ts",
|
|
4323
|
-
line:
|
|
4333
|
+
line: 266,
|
|
4324
4334
|
scope: this,
|
|
4325
4335
|
callSite: (f, a) => f(...a)
|
|
4326
4336
|
});
|
|
@@ -4332,13 +4342,13 @@ var ClientServicesHost = class {
|
|
|
4332
4342
|
id: traceId
|
|
4333
4343
|
}), {
|
|
4334
4344
|
file: "service-host.ts",
|
|
4335
|
-
line:
|
|
4345
|
+
line: 271,
|
|
4336
4346
|
scope: this,
|
|
4337
4347
|
callSite: (f, a) => f(...a)
|
|
4338
4348
|
});
|
|
4339
4349
|
log18("resetting...", {}, {
|
|
4340
4350
|
file: "service-host.ts",
|
|
4341
|
-
line:
|
|
4351
|
+
line: 273,
|
|
4342
4352
|
scope: this,
|
|
4343
4353
|
callSite: (f, a) => f(...a)
|
|
4344
4354
|
});
|
|
@@ -4346,7 +4356,7 @@ var ClientServicesHost = class {
|
|
|
4346
4356
|
await this._storage.reset();
|
|
4347
4357
|
log18("reset", {}, {
|
|
4348
4358
|
file: "service-host.ts",
|
|
4349
|
-
line:
|
|
4359
|
+
line: 276,
|
|
4350
4360
|
scope: this,
|
|
4351
4361
|
callSite: (f, a) => f(...a)
|
|
4352
4362
|
});
|
|
@@ -4354,7 +4364,7 @@ var ClientServicesHost = class {
|
|
|
4354
4364
|
id: traceId
|
|
4355
4365
|
}), {
|
|
4356
4366
|
file: "service-host.ts",
|
|
4357
|
-
line:
|
|
4367
|
+
line: 277,
|
|
4358
4368
|
scope: this,
|
|
4359
4369
|
callSite: (f, a) => f(...a)
|
|
4360
4370
|
});
|
|
@@ -4538,4 +4548,4 @@ export {
|
|
|
4538
4548
|
ClientServicesHost,
|
|
4539
4549
|
LocalClientServices
|
|
4540
4550
|
};
|
|
4541
|
-
//# sourceMappingURL=chunk-
|
|
4551
|
+
//# sourceMappingURL=chunk-YLH4UYUT.mjs.map
|