@dxos/client-services 0.1.49-next.fdd6c88 → 0.1.49
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-KMQOZOUZ.mjs → chunk-YLH4UYUT.mjs} +73 -63
- 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 +1 -1
- package/dist/lib/node/index.cjs +79 -69
- 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 +76 -66
- 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/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/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/metadata.ts +14 -0
- package/src/packlets/services/service-context.ts +1 -2
- package/src/packlets/spaces/notarization-plugin.ts +7 -3
- package/src/packlets/spaces/spaces-service.ts +0 -3
- package/src/packlets/vault/vault-resource-lock.ts +1 -0
- package/dist/lib/browser/chunk-KMQOZOUZ.mjs.map +0 -7
|
@@ -126,7 +126,7 @@ var DevicesServiceImpl = class {
|
|
|
126
126
|
|
|
127
127
|
// packages/sdk/client-services/src/packlets/devtools/devtools.ts
|
|
128
128
|
var import_async4 = require("@dxos/async");
|
|
129
|
-
var
|
|
129
|
+
var import_codec_protobuf7 = require("@dxos/codec-protobuf");
|
|
130
130
|
|
|
131
131
|
// packages/sdk/client-services/src/packlets/devtools/feeds.ts
|
|
132
132
|
var import_async2 = require("@dxos/async");
|
|
@@ -214,11 +214,22 @@ var subscribeToKeyringKeys = ({ keyring }) => new import_codec_protobuf3.Stream(
|
|
|
214
214
|
(0, import_async3.scheduleTask)(ctx, update);
|
|
215
215
|
});
|
|
216
216
|
|
|
217
|
-
// packages/sdk/client-services/src/packlets/devtools/
|
|
217
|
+
// packages/sdk/client-services/src/packlets/devtools/metadata.ts
|
|
218
218
|
var import_codec_protobuf4 = require("@dxos/codec-protobuf");
|
|
219
|
+
var subscribeToMetadata = ({ context }) => new import_codec_protobuf4.Stream(({ next, ctx }) => {
|
|
220
|
+
context.metadataStore.update.on(ctx, (data) => next({
|
|
221
|
+
metadata: data
|
|
222
|
+
}));
|
|
223
|
+
next({
|
|
224
|
+
metadata: context.metadataStore.metadata
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
// packages/sdk/client-services/src/packlets/devtools/network.ts
|
|
229
|
+
var import_codec_protobuf5 = require("@dxos/codec-protobuf");
|
|
219
230
|
var import_context = require("@dxos/context");
|
|
220
231
|
var import_keys3 = require("@dxos/keys");
|
|
221
|
-
var subscribeToNetworkStatus = ({ signalManager }) => new
|
|
232
|
+
var subscribeToNetworkStatus = ({ signalManager }) => new import_codec_protobuf5.Stream(({ next, close }) => {
|
|
222
233
|
const update = () => {
|
|
223
234
|
try {
|
|
224
235
|
const status = signalManager.getStatus();
|
|
@@ -232,7 +243,7 @@ var subscribeToNetworkStatus = ({ signalManager }) => new import_codec_protobuf4
|
|
|
232
243
|
signalManager.statusChanged.on(() => update());
|
|
233
244
|
update();
|
|
234
245
|
});
|
|
235
|
-
var subscribeToSignal = ({ signalManager }) => new
|
|
246
|
+
var subscribeToSignal = ({ signalManager }) => new import_codec_protobuf5.Stream(({ next }) => {
|
|
236
247
|
const ctx = new import_context.Context();
|
|
237
248
|
signalManager.onMessage.on(ctx, (message) => {
|
|
238
249
|
next({
|
|
@@ -254,7 +265,7 @@ var subscribeToSignal = ({ signalManager }) => new import_codec_protobuf4.Stream
|
|
|
254
265
|
return ctx.dispose();
|
|
255
266
|
};
|
|
256
267
|
});
|
|
257
|
-
var subscribeToSwarmInfo = ({ networkManager }) => new
|
|
268
|
+
var subscribeToSwarmInfo = ({ networkManager }) => new import_codec_protobuf5.Stream(({ next }) => {
|
|
258
269
|
var _a;
|
|
259
270
|
const update = () => {
|
|
260
271
|
var _a2;
|
|
@@ -270,9 +281,9 @@ var subscribeToSwarmInfo = ({ networkManager }) => new import_codec_protobuf4.St
|
|
|
270
281
|
});
|
|
271
282
|
|
|
272
283
|
// packages/sdk/client-services/src/packlets/devtools/spaces.ts
|
|
273
|
-
var
|
|
284
|
+
var import_codec_protobuf6 = require("@dxos/codec-protobuf");
|
|
274
285
|
var subscribeToSpaces = (context, { spaceKeys = [] }) => {
|
|
275
|
-
return new
|
|
286
|
+
return new import_codec_protobuf6.Stream(({ next }) => {
|
|
276
287
|
let unsubscribe;
|
|
277
288
|
const update = async () => {
|
|
278
289
|
const spaces = [
|
|
@@ -316,7 +327,7 @@ var DevtoolsServiceImpl = class {
|
|
|
316
327
|
this.params = params;
|
|
317
328
|
}
|
|
318
329
|
events(request) {
|
|
319
|
-
return new
|
|
330
|
+
return new import_codec_protobuf7.Stream(({ next }) => {
|
|
320
331
|
this.params.events.ready.on(() => {
|
|
321
332
|
next({
|
|
322
333
|
ready: {}
|
|
@@ -408,6 +419,11 @@ var DevtoolsServiceImpl = class {
|
|
|
408
419
|
networkManager: this.params.context.networkManager
|
|
409
420
|
});
|
|
410
421
|
}
|
|
422
|
+
subscribeToMetadata() {
|
|
423
|
+
return subscribeToMetadata({
|
|
424
|
+
context: this.params.context
|
|
425
|
+
});
|
|
426
|
+
}
|
|
411
427
|
};
|
|
412
428
|
|
|
413
429
|
// packages/sdk/client-services/src/packlets/identity/authenticator.ts
|
|
@@ -931,7 +947,7 @@ var IdentityManager = class {
|
|
|
931
947
|
|
|
932
948
|
// packages/sdk/client-services/src/packlets/identity/identity-service.ts
|
|
933
949
|
var import_node_assert3 = __toESM(require("node:assert"));
|
|
934
|
-
var
|
|
950
|
+
var import_codec_protobuf8 = require("@dxos/codec-protobuf");
|
|
935
951
|
var import_credentials7 = require("@dxos/credentials");
|
|
936
952
|
var import_debug2 = require("@dxos/debug");
|
|
937
953
|
var IdentityServiceImpl = class {
|
|
@@ -947,7 +963,7 @@ var IdentityServiceImpl = class {
|
|
|
947
963
|
return (0, import_debug2.todo)();
|
|
948
964
|
}
|
|
949
965
|
queryIdentity() {
|
|
950
|
-
return new
|
|
966
|
+
return new import_codec_protobuf8.Stream(({ next }) => {
|
|
951
967
|
const emitNext = () => next({
|
|
952
968
|
identity: this._getIdentity()
|
|
953
969
|
});
|
|
@@ -1879,7 +1895,7 @@ var InvitationsHandler = class {
|
|
|
1879
1895
|
// packages/sdk/client-services/src/packlets/invitations/invitations-service.ts
|
|
1880
1896
|
var import_node_assert7 = __toESM(require("node:assert"));
|
|
1881
1897
|
var import_async10 = require("@dxos/async");
|
|
1882
|
-
var
|
|
1898
|
+
var import_codec_protobuf9 = require("@dxos/codec-protobuf");
|
|
1883
1899
|
var import_log6 = require("@dxos/log");
|
|
1884
1900
|
var import_services5 = require("@dxos/protocols/proto/dxos/client/services");
|
|
1885
1901
|
var InvitationsServiceImpl = class {
|
|
@@ -1908,7 +1924,7 @@ var InvitationsServiceImpl = class {
|
|
|
1908
1924
|
this._createInvitations.set(invitation.get().invitationId, invitation);
|
|
1909
1925
|
this._invitationCreated.emit(invitation.get());
|
|
1910
1926
|
}
|
|
1911
|
-
return new
|
|
1927
|
+
return new import_codec_protobuf9.Stream(({ next, close }) => {
|
|
1912
1928
|
invitation.subscribe((invitation2) => {
|
|
1913
1929
|
next(invitation2);
|
|
1914
1930
|
}, (err) => {
|
|
@@ -1930,7 +1946,7 @@ var InvitationsServiceImpl = class {
|
|
|
1930
1946
|
this._acceptInvitations.set(invitation.get().invitationId, invitation);
|
|
1931
1947
|
this._invitationAccepted.emit(invitation.get());
|
|
1932
1948
|
}
|
|
1933
|
-
return new
|
|
1949
|
+
return new import_codec_protobuf9.Stream(({ next, close }) => {
|
|
1934
1950
|
invitation.subscribe((invitation2) => {
|
|
1935
1951
|
next(invitation2);
|
|
1936
1952
|
}, (err) => {
|
|
@@ -1993,7 +2009,7 @@ var InvitationsServiceImpl = class {
|
|
|
1993
2009
|
}
|
|
1994
2010
|
}
|
|
1995
2011
|
queryInvitations() {
|
|
1996
|
-
return new
|
|
2012
|
+
return new import_codec_protobuf9.Stream(({ next, ctx }) => {
|
|
1997
2013
|
this._invitationCreated.on(ctx, (invitation) => {
|
|
1998
2014
|
next({
|
|
1999
2015
|
action: import_services5.QueryInvitationsResponse.Action.ADDED,
|
|
@@ -2136,7 +2152,7 @@ var SpaceInvitationProtocol = class {
|
|
|
2136
2152
|
|
|
2137
2153
|
// packages/sdk/client-services/src/packlets/logging/logging-service.ts
|
|
2138
2154
|
var import_async11 = require("@dxos/async");
|
|
2139
|
-
var
|
|
2155
|
+
var import_codec_protobuf10 = require("@dxos/codec-protobuf");
|
|
2140
2156
|
var import_log8 = require("@dxos/log");
|
|
2141
2157
|
var import_util3 = require("@dxos/util");
|
|
2142
2158
|
var LoggingServiceImpl = class {
|
|
@@ -2156,7 +2172,7 @@ var LoggingServiceImpl = class {
|
|
|
2156
2172
|
queryLogs(request) {
|
|
2157
2173
|
var _a;
|
|
2158
2174
|
const filters = ((_a = request.filters) == null ? void 0 : _a.length) ? request.filters : void 0;
|
|
2159
|
-
return new
|
|
2175
|
+
return new import_codec_protobuf10.Stream(({ ctx, next }) => {
|
|
2160
2176
|
const handler = (entry2) => {
|
|
2161
2177
|
var _a2, _b, _c;
|
|
2162
2178
|
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"))) {
|
|
@@ -2181,14 +2197,14 @@ var LoggingServiceImpl = class {
|
|
|
2181
2197
|
};
|
|
2182
2198
|
|
|
2183
2199
|
// packages/sdk/client-services/src/packlets/network/network-service.ts
|
|
2184
|
-
var
|
|
2200
|
+
var import_codec_protobuf11 = require("@dxos/codec-protobuf");
|
|
2185
2201
|
var NetworkServiceImpl = class {
|
|
2186
2202
|
constructor(networkManager, signalManager) {
|
|
2187
2203
|
this.networkManager = networkManager;
|
|
2188
2204
|
this.signalManager = signalManager;
|
|
2189
2205
|
}
|
|
2190
2206
|
queryStatus() {
|
|
2191
|
-
return new
|
|
2207
|
+
return new import_codec_protobuf11.Stream(({ next }) => {
|
|
2192
2208
|
const update = () => {
|
|
2193
2209
|
next({
|
|
2194
2210
|
swarm: this.networkManager.connectionState,
|
|
@@ -2249,6 +2265,7 @@ var import_util4 = require("@dxos/util");
|
|
|
2249
2265
|
var DEFAULT_RETRY_TIMEOUT = 1e3;
|
|
2250
2266
|
var DEFAULT_SUCCESS_DELAY = 1e3;
|
|
2251
2267
|
var DEFAULT_NOTARIZE_TIMEOUT = 1e4;
|
|
2268
|
+
var WRITER_NOT_SET_ERROR_CODE = "WRITER_NOT_SET";
|
|
2252
2269
|
var NotarizationPlugin = class {
|
|
2253
2270
|
constructor() {
|
|
2254
2271
|
this._ctx = new import_context5.Context();
|
|
@@ -2270,7 +2287,7 @@ var NotarizationPlugin = class {
|
|
|
2270
2287
|
credentials
|
|
2271
2288
|
}, {
|
|
2272
2289
|
file: "notarization-plugin.ts",
|
|
2273
|
-
line:
|
|
2290
|
+
line: 87,
|
|
2274
2291
|
scope: this,
|
|
2275
2292
|
callSite: (f, a) => f(...a)
|
|
2276
2293
|
});
|
|
@@ -2282,7 +2299,7 @@ var NotarizationPlugin = class {
|
|
|
2282
2299
|
err
|
|
2283
2300
|
}, {
|
|
2284
2301
|
file: "notarization-plugin.ts",
|
|
2285
|
-
line:
|
|
2302
|
+
line: 96,
|
|
2286
2303
|
scope: this,
|
|
2287
2304
|
callSite: (f, a) => f(...a)
|
|
2288
2305
|
});
|
|
@@ -2298,7 +2315,7 @@ var NotarizationPlugin = class {
|
|
|
2298
2315
|
peers: Array.from(this._extensions).map((extension) => extension.remotePeerId)
|
|
2299
2316
|
}, {
|
|
2300
2317
|
file: "notarization-plugin.ts",
|
|
2301
|
-
line:
|
|
2318
|
+
line: 108,
|
|
2302
2319
|
scope: this,
|
|
2303
2320
|
callSite: (f, a) => f(...a)
|
|
2304
2321
|
});
|
|
@@ -2321,7 +2338,7 @@ var NotarizationPlugin = class {
|
|
|
2321
2338
|
retryIn: retryTimeout
|
|
2322
2339
|
}, {
|
|
2323
2340
|
file: "notarization-plugin.ts",
|
|
2324
|
-
line:
|
|
2341
|
+
line: 133,
|
|
2325
2342
|
scope: this,
|
|
2326
2343
|
callSite: (f, a) => f(...a)
|
|
2327
2344
|
});
|
|
@@ -2335,7 +2352,7 @@ var NotarizationPlugin = class {
|
|
|
2335
2352
|
credentialId: credentials.map((credential) => credential.id)
|
|
2336
2353
|
}, {
|
|
2337
2354
|
file: "notarization-plugin.ts",
|
|
2338
|
-
line:
|
|
2355
|
+
line: 140,
|
|
2339
2356
|
scope: this,
|
|
2340
2357
|
callSite: (f, a) => f(...a)
|
|
2341
2358
|
});
|
|
@@ -2344,18 +2361,20 @@ var NotarizationPlugin = class {
|
|
|
2344
2361
|
});
|
|
2345
2362
|
(0, import_log9.log)("success", {}, {
|
|
2346
2363
|
file: "notarization-plugin.ts",
|
|
2347
|
-
line:
|
|
2364
|
+
line: 144,
|
|
2348
2365
|
scope: this,
|
|
2349
2366
|
callSite: (f, a) => f(...a)
|
|
2350
2367
|
});
|
|
2351
2368
|
await (0, import_async12.sleep)(successDelay);
|
|
2352
2369
|
} catch (err) {
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2370
|
+
if (!ctx.disposed && !err.message.includes(WRITER_NOT_SET_ERROR_CODE)) {
|
|
2371
|
+
import_log9.log.warn("error notarizing (recoverable)", err, {
|
|
2372
|
+
file: "notarization-plugin.ts",
|
|
2373
|
+
line: 148,
|
|
2374
|
+
scope: this,
|
|
2375
|
+
callSite: (f, a) => f(...a)
|
|
2376
|
+
});
|
|
2377
|
+
}
|
|
2359
2378
|
notarizeTask.schedule();
|
|
2360
2379
|
}
|
|
2361
2380
|
});
|
|
@@ -2369,7 +2388,7 @@ var NotarizationPlugin = class {
|
|
|
2369
2388
|
]);
|
|
2370
2389
|
(0, import_log9.log)("done", {}, {
|
|
2371
2390
|
file: "notarization-plugin.ts",
|
|
2372
|
-
line:
|
|
2391
|
+
line: 159,
|
|
2373
2392
|
scope: this,
|
|
2374
2393
|
callSite: (f, a) => f(...a)
|
|
2375
2394
|
});
|
|
@@ -2405,7 +2424,7 @@ var NotarizationPlugin = class {
|
|
|
2405
2424
|
async _onNotarize(request) {
|
|
2406
2425
|
var _a;
|
|
2407
2426
|
if (!this._writer) {
|
|
2408
|
-
throw new Error(
|
|
2427
|
+
throw new Error(WRITER_NOT_SET_ERROR_CODE);
|
|
2409
2428
|
}
|
|
2410
2429
|
for (const credential of (_a = request.credentials) != null ? _a : []) {
|
|
2411
2430
|
(0, import_node_assert9.default)(credential.id, "Credential must have an id");
|
|
@@ -2422,7 +2441,7 @@ var NotarizationPlugin = class {
|
|
|
2422
2441
|
peer: extension.localPeerId
|
|
2423
2442
|
}, {
|
|
2424
2443
|
file: "notarization-plugin.ts",
|
|
2425
|
-
line:
|
|
2444
|
+
line: 208,
|
|
2426
2445
|
scope: this,
|
|
2427
2446
|
callSite: (f, a) => f(...a)
|
|
2428
2447
|
});
|
|
@@ -2434,7 +2453,7 @@ var NotarizationPlugin = class {
|
|
|
2434
2453
|
peer: extension.localPeerId
|
|
2435
2454
|
}, {
|
|
2436
2455
|
file: "notarization-plugin.ts",
|
|
2437
|
-
line:
|
|
2456
|
+
line: 213,
|
|
2438
2457
|
scope: this,
|
|
2439
2458
|
callSite: (f, a) => f(...a)
|
|
2440
2459
|
});
|
|
@@ -3069,7 +3088,7 @@ DataSpaceManager = __decorate2([
|
|
|
3069
3088
|
|
|
3070
3089
|
// packages/sdk/client-services/src/packlets/spaces/spaces-service.ts
|
|
3071
3090
|
var import_async15 = require("@dxos/async");
|
|
3072
|
-
var
|
|
3091
|
+
var import_codec_protobuf12 = require("@dxos/codec-protobuf");
|
|
3073
3092
|
var import_debug5 = require("@dxos/debug");
|
|
3074
3093
|
var import_echo_pipeline2 = require("@dxos/echo-pipeline");
|
|
3075
3094
|
var import_log12 = require("@dxos/log");
|
|
@@ -3096,7 +3115,7 @@ var SpacesServiceImpl = class {
|
|
|
3096
3115
|
(0, import_debug5.todo)();
|
|
3097
3116
|
}
|
|
3098
3117
|
querySpaces() {
|
|
3099
|
-
return new
|
|
3118
|
+
return new import_codec_protobuf12.Stream(({ next, ctx }) => {
|
|
3100
3119
|
const onUpdate = async () => {
|
|
3101
3120
|
const dataSpaceManager = await this._getDataSpaceManager();
|
|
3102
3121
|
const spaces = Array.from(dataSpaceManager.spaces.values()).map((space) => this._transformSpace(space));
|
|
@@ -3104,7 +3123,7 @@ var SpacesServiceImpl = class {
|
|
|
3104
3123
|
spaces
|
|
3105
3124
|
}, {
|
|
3106
3125
|
file: "spaces-service.ts",
|
|
3107
|
-
line:
|
|
3126
|
+
line: 59,
|
|
3108
3127
|
scope: this,
|
|
3109
3128
|
callSite: (f, a) => f(...a)
|
|
3110
3129
|
});
|
|
@@ -3148,7 +3167,7 @@ var SpacesServiceImpl = class {
|
|
|
3148
3167
|
await space.postMessage(getChannelId(channel), message);
|
|
3149
3168
|
}
|
|
3150
3169
|
subscribeMessages({ spaceKey, channel }) {
|
|
3151
|
-
return new
|
|
3170
|
+
return new import_codec_protobuf12.Stream(({ ctx, next }) => {
|
|
3152
3171
|
(0, import_async15.scheduleTask)(ctx, async () => {
|
|
3153
3172
|
var _a;
|
|
3154
3173
|
const dataSpaceManager = await this._getDataSpaceManager();
|
|
@@ -3161,7 +3180,7 @@ var SpacesServiceImpl = class {
|
|
|
3161
3180
|
});
|
|
3162
3181
|
}
|
|
3163
3182
|
queryCredentials({ spaceKey }) {
|
|
3164
|
-
return new
|
|
3183
|
+
return new import_codec_protobuf12.Stream(({ ctx, next }) => {
|
|
3165
3184
|
var _a;
|
|
3166
3185
|
const space = (_a = this._spaceManager.spaces.get(spaceKey)) != null ? _a : (0, import_debug5.raise)(new import_echo_pipeline2.SpaceNotFoundError(spaceKey));
|
|
3167
3186
|
const processor = space.spaceState.registerProcessor({
|
|
@@ -3273,7 +3292,7 @@ var toStorageType = (type) => {
|
|
|
3273
3292
|
};
|
|
3274
3293
|
|
|
3275
3294
|
// packages/sdk/client-services/src/packlets/system/system-service.ts
|
|
3276
|
-
var
|
|
3295
|
+
var import_codec_protobuf13 = require("@dxos/codec-protobuf");
|
|
3277
3296
|
var SystemServiceImpl = class {
|
|
3278
3297
|
constructor({ config, statusUpdate, onUpdateStatus, getCurrentStatus, onReset }) {
|
|
3279
3298
|
this._config = config;
|
|
@@ -3290,7 +3309,7 @@ var SystemServiceImpl = class {
|
|
|
3290
3309
|
await this._onUpdateStatus(status);
|
|
3291
3310
|
}
|
|
3292
3311
|
queryStatus() {
|
|
3293
|
-
return new
|
|
3312
|
+
return new import_codec_protobuf13.Stream(({ next }) => {
|
|
3294
3313
|
const update = () => {
|
|
3295
3314
|
next({
|
|
3296
3315
|
status: this._getCurrentStatus()
|
|
@@ -3319,7 +3338,7 @@ var import_network_manager2 = require("@dxos/network-manager");
|
|
|
3319
3338
|
var import_util8 = require("@dxos/util");
|
|
3320
3339
|
|
|
3321
3340
|
// packages/sdk/client-services/src/packlets/services/client-rpc-server.ts
|
|
3322
|
-
var
|
|
3341
|
+
var import_codec_protobuf14 = require("@dxos/codec-protobuf");
|
|
3323
3342
|
var import_debug6 = require("@dxos/debug");
|
|
3324
3343
|
var import_rpc = require("@dxos/rpc");
|
|
3325
3344
|
var ClientRpcServer = class {
|
|
@@ -3344,7 +3363,7 @@ var ClientRpcServer = class {
|
|
|
3344
3363
|
const [serviceName, methodName] = (0, import_rpc.parseMethodName)(method);
|
|
3345
3364
|
const handler = (method2, params3) => this._getServiceHandler(serviceName).callStream(method2, params3);
|
|
3346
3365
|
if (this._handleStream) {
|
|
3347
|
-
return
|
|
3366
|
+
return import_codec_protobuf14.Stream.unwrapPromise(this._handleStream(methodName, params2, handler));
|
|
3348
3367
|
} else {
|
|
3349
3368
|
return handler(methodName, params2);
|
|
3350
3369
|
}
|
|
@@ -3595,28 +3614,28 @@ var VaultResourceLock = class {
|
|
|
3595
3614
|
try {
|
|
3596
3615
|
(0, import_log15.log)("aquiring lock...", {}, {
|
|
3597
3616
|
file: "vault-resource-lock.ts",
|
|
3598
|
-
line:
|
|
3617
|
+
line: 46,
|
|
3599
3618
|
scope: this,
|
|
3600
3619
|
callSite: (f, a) => f(...a)
|
|
3601
3620
|
});
|
|
3602
3621
|
await (0, import_async19.asyncTimeout)(this._requestLock(), import_client_protocol7.RESOURCE_LOCK_TIMEOUT);
|
|
3603
3622
|
(0, import_log15.log)("acquired lock", {}, {
|
|
3604
3623
|
file: "vault-resource-lock.ts",
|
|
3605
|
-
line:
|
|
3624
|
+
line: 48,
|
|
3606
3625
|
scope: this,
|
|
3607
3626
|
callSite: (f, a) => f(...a)
|
|
3608
3627
|
});
|
|
3609
3628
|
} catch (e) {
|
|
3610
3629
|
(0, import_log15.log)("stealing lock...", {}, {
|
|
3611
3630
|
file: "vault-resource-lock.ts",
|
|
3612
|
-
line:
|
|
3631
|
+
line: 50,
|
|
3613
3632
|
scope: this,
|
|
3614
3633
|
callSite: (f, a) => f(...a)
|
|
3615
3634
|
});
|
|
3616
3635
|
await this._requestLock(true);
|
|
3617
3636
|
(0, import_log15.log)("stolen lock", {}, {
|
|
3618
3637
|
file: "vault-resource-lock.ts",
|
|
3619
|
-
line:
|
|
3638
|
+
line: 52,
|
|
3620
3639
|
scope: this,
|
|
3621
3640
|
callSite: (f, a) => f(...a)
|
|
3622
3641
|
});
|
|
@@ -3635,7 +3654,7 @@ var VaultResourceLock = class {
|
|
|
3635
3654
|
steal
|
|
3636
3655
|
}, {
|
|
3637
3656
|
file: "vault-resource-lock.ts",
|
|
3638
|
-
line:
|
|
3657
|
+
line: 67,
|
|
3639
3658
|
scope: this,
|
|
3640
3659
|
callSite: (f, a) => f(...a)
|
|
3641
3660
|
});
|
|
@@ -3650,14 +3669,14 @@ var VaultResourceLock = class {
|
|
|
3650
3669
|
await this._releaseTrigger.wait();
|
|
3651
3670
|
(0, import_log15.log)("releasing lock...", {}, {
|
|
3652
3671
|
file: "vault-resource-lock.ts",
|
|
3653
|
-
line:
|
|
3672
|
+
line: 76,
|
|
3654
3673
|
scope: this,
|
|
3655
3674
|
callSite: (f, a) => f(...a)
|
|
3656
3675
|
});
|
|
3657
3676
|
await ((_b = this._onRelease) == null ? void 0 : _b.call(this));
|
|
3658
3677
|
(0, import_log15.log)("released lock", {}, {
|
|
3659
3678
|
file: "vault-resource-lock.ts",
|
|
3660
|
-
line:
|
|
3679
|
+
line: 78,
|
|
3661
3680
|
scope: this,
|
|
3662
3681
|
callSite: (f, a) => f(...a)
|
|
3663
3682
|
});
|
|
@@ -3670,7 +3689,7 @@ var VaultResourceLock = class {
|
|
|
3670
3689
|
steal
|
|
3671
3690
|
}, {
|
|
3672
3691
|
file: "vault-resource-lock.ts",
|
|
3673
|
-
line:
|
|
3692
|
+
line: 85,
|
|
3674
3693
|
scope: this,
|
|
3675
3694
|
callSite: (f, a) => f(...a)
|
|
3676
3695
|
});
|
|
@@ -3963,16 +3982,7 @@ var ServiceContext = class {
|
|
|
3963
3982
|
async _checkStorageVersion() {
|
|
3964
3983
|
await this.metadataStore.load();
|
|
3965
3984
|
if (this.metadataStore.version !== import_protocols8.STORAGE_VERSION) {
|
|
3966
|
-
|
|
3967
|
-
current: this.metadataStore.version,
|
|
3968
|
-
expected: import_protocols8.STORAGE_VERSION
|
|
3969
|
-
}, {
|
|
3970
|
-
file: "service-context.ts",
|
|
3971
|
-
line: 171,
|
|
3972
|
-
scope: this,
|
|
3973
|
-
callSite: (f, a) => f(...a)
|
|
3974
|
-
});
|
|
3975
|
-
await this.metadataStore.clear();
|
|
3985
|
+
throw new Error(`Invalid storage version: current=${this.metadataStore.version}, expected=${import_protocols8.STORAGE_VERSION}`);
|
|
3976
3986
|
}
|
|
3977
3987
|
}
|
|
3978
3988
|
// Called when identity is created.
|
|
@@ -3980,7 +3990,7 @@ var ServiceContext = class {
|
|
|
3980
3990
|
var _a;
|
|
3981
3991
|
(0, import_log18.log)("initializing spaces...", {}, {
|
|
3982
3992
|
file: "service-context.ts",
|
|
3983
|
-
line:
|
|
3993
|
+
line: 178,
|
|
3984
3994
|
scope: this,
|
|
3985
3995
|
callSite: (f, a) => f(...a)
|
|
3986
3996
|
});
|
|
@@ -4019,7 +4029,7 @@ var ServiceContext = class {
|
|
|
4019
4029
|
details: assertion
|
|
4020
4030
|
}, {
|
|
4021
4031
|
file: "service-context.ts",
|
|
4022
|
-
line:
|
|
4032
|
+
line: 217,
|
|
4023
4033
|
scope: this,
|
|
4024
4034
|
callSite: (f, a) => f(...a)
|
|
4025
4035
|
});
|
|
@@ -4030,7 +4040,7 @@ var ServiceContext = class {
|
|
|
4030
4040
|
details: assertion
|
|
4031
4041
|
}, {
|
|
4032
4042
|
file: "service-context.ts",
|
|
4033
|
-
line:
|
|
4043
|
+
line: 221,
|
|
4034
4044
|
scope: this,
|
|
4035
4045
|
callSite: (f, a) => f(...a)
|
|
4036
4046
|
});
|
|
@@ -4041,7 +4051,7 @@ var ServiceContext = class {
|
|
|
4041
4051
|
details: assertion
|
|
4042
4052
|
}, {
|
|
4043
4053
|
file: "service-context.ts",
|
|
4044
|
-
line:
|
|
4054
|
+
line: 226,
|
|
4045
4055
|
scope: this,
|
|
4046
4056
|
callSite: (f, a) => f(...a)
|
|
4047
4057
|
});
|
|
@@ -4052,7 +4062,7 @@ var ServiceContext = class {
|
|
|
4052
4062
|
} catch (err) {
|
|
4053
4063
|
import_log18.log.catch(err, {}, {
|
|
4054
4064
|
file: "service-context.ts",
|
|
4055
|
-
line:
|
|
4065
|
+
line: 232,
|
|
4056
4066
|
scope: this,
|
|
4057
4067
|
callSite: (f, a) => f(...a)
|
|
4058
4068
|
});
|