@dxos/client-services 0.3.2 → 0.3.3-main.1b7ca63
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-5YN7ZUGL.mjs → chunk-L2DNXWJ5.mjs} +116 -73
- package/dist/lib/browser/chunk-L2DNXWJ5.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +6 -6
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/packlets/testing/index.mjs +2 -2
- package/dist/lib/node/index.cjs +170 -127
- 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 +247 -157
- package/dist/lib/node/packlets/testing/index.cjs.map +3 -3
- package/dist/types/src/packlets/services/client-rpc-server.d.ts +2 -0
- package/dist/types/src/packlets/services/client-rpc-server.d.ts.map +1 -1
- package/dist/types/src/packlets/services/diagnostics.d.ts +4 -1
- package/dist/types/src/packlets/services/diagnostics.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/dist/types/src/version.d.ts.map +1 -1
- package/package.json +35 -35
- package/src/packlets/services/client-rpc-server.ts +18 -1
- package/src/packlets/services/diagnostics.ts +23 -0
- package/src/version.ts +1 -5
- package/dist/lib/browser/chunk-5YN7ZUGL.mjs.map +0 -7
|
@@ -344,7 +344,7 @@ import { Context as Context2 } from "@dxos/context";
|
|
|
344
344
|
import { verifyCredential } from "@dxos/credentials";
|
|
345
345
|
import { log } from "@dxos/log";
|
|
346
346
|
import { schema } from "@dxos/protocols";
|
|
347
|
-
var __dxlog_file = "/
|
|
347
|
+
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/authenticator.ts";
|
|
348
348
|
var Credential = schema.getCodecForType("dxos.halo.credentials.Credential");
|
|
349
349
|
var createAuthProvider = (signer) => async (nonce) => {
|
|
350
350
|
const credential = await signer.createCredential({
|
|
@@ -475,7 +475,7 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
475
475
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
476
476
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
477
477
|
}
|
|
478
|
-
var __dxlog_file2 = "/
|
|
478
|
+
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity.ts";
|
|
479
479
|
var Identity = class Identity2 {
|
|
480
480
|
constructor({ space, signer, identityKey, deviceKey }) {
|
|
481
481
|
this.stateUpdate = new Event();
|
|
@@ -657,7 +657,7 @@ function _ts_decorate2(decorators, target, key, desc) {
|
|
|
657
657
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
658
658
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
659
659
|
}
|
|
660
|
-
var __dxlog_file3 = "/
|
|
660
|
+
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity-manager.ts";
|
|
661
661
|
var IdentityManager = class IdentityManager2 {
|
|
662
662
|
// TODO(burdon): IdentityManagerParams.
|
|
663
663
|
// TODO(dmaretskyi): Perhaps this should take/generate the peerKey outside of an initialized identity.
|
|
@@ -1017,7 +1017,7 @@ import { Stream as Stream7 } from "@dxos/codec-protobuf";
|
|
|
1017
1017
|
import { signPresentation } from "@dxos/credentials";
|
|
1018
1018
|
import { todo } from "@dxos/debug";
|
|
1019
1019
|
import { invariant as invariant3 } from "@dxos/invariant";
|
|
1020
|
-
var __dxlog_file4 = "/
|
|
1020
|
+
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity-service.ts";
|
|
1021
1021
|
var IdentityServiceImpl = class {
|
|
1022
1022
|
constructor(_createIdentity, _identityManager, _keyring) {
|
|
1023
1023
|
this._createIdentity = _createIdentity;
|
|
@@ -1086,7 +1086,7 @@ var IdentityServiceImpl = class {
|
|
|
1086
1086
|
// packages/sdk/client-services/src/packlets/invitations/device-invitation-protocol.ts
|
|
1087
1087
|
import { invariant as invariant4 } from "@dxos/invariant";
|
|
1088
1088
|
import { Invitation } from "@dxos/protocols/proto/dxos/client/services";
|
|
1089
|
-
var __dxlog_file5 = "/
|
|
1089
|
+
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/device-invitation-protocol.ts";
|
|
1090
1090
|
var DeviceInvitationProtocol = class {
|
|
1091
1091
|
constructor(_keyring, _getIdentity, _acceptIdentity) {
|
|
1092
1092
|
this._keyring = _keyring;
|
|
@@ -1196,7 +1196,7 @@ import { InvalidInvitationExtensionRoleError, schema as schema2, trace as trace3
|
|
|
1196
1196
|
import { Invitation as Invitation2 } from "@dxos/protocols/proto/dxos/client/services";
|
|
1197
1197
|
import { AuthenticationResponse, Options } from "@dxos/protocols/proto/dxos/halo/invitations";
|
|
1198
1198
|
import { RpcExtension } from "@dxos/teleport";
|
|
1199
|
-
var __dxlog_file6 = "/
|
|
1199
|
+
var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitation-extension.ts";
|
|
1200
1200
|
var OPTIONS_TIMEOUT = 1e4;
|
|
1201
1201
|
var MAX_OTP_ATTEMPTS = 3;
|
|
1202
1202
|
var InvitationHostExtension = class extends RpcExtension {
|
|
@@ -1527,7 +1527,7 @@ var InvitationGuestExtension = class extends RpcExtension {
|
|
|
1527
1527
|
var isAuthenticationRequired = (invitation) => invitation.authMethod !== Invitation2.AuthMethod.NONE;
|
|
1528
1528
|
|
|
1529
1529
|
// packages/sdk/client-services/src/packlets/invitations/invitations-handler.ts
|
|
1530
|
-
var __dxlog_file7 = "/
|
|
1530
|
+
var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitations-handler.ts";
|
|
1531
1531
|
var InvitationsHandler = class {
|
|
1532
1532
|
/**
|
|
1533
1533
|
* @internal
|
|
@@ -2086,7 +2086,7 @@ import { Stream as Stream8 } from "@dxos/codec-protobuf";
|
|
|
2086
2086
|
import { invariant as invariant7 } from "@dxos/invariant";
|
|
2087
2087
|
import { log as log6 } from "@dxos/log";
|
|
2088
2088
|
import { Invitation as Invitation4, QueryInvitationsResponse } from "@dxos/protocols/proto/dxos/client/services";
|
|
2089
|
-
var __dxlog_file8 = "/
|
|
2089
|
+
var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitations-service.ts";
|
|
2090
2090
|
var InvitationsServiceImpl = class {
|
|
2091
2091
|
constructor(_invitationsHandler, _getHandler) {
|
|
2092
2092
|
this._invitationsHandler = _invitationsHandler;
|
|
@@ -2268,7 +2268,7 @@ import { writeMessages as writeMessages2 } from "@dxos/feed-store";
|
|
|
2268
2268
|
import { invariant as invariant8 } from "@dxos/invariant";
|
|
2269
2269
|
import { log as log7 } from "@dxos/log";
|
|
2270
2270
|
import { Invitation as Invitation5 } from "@dxos/protocols/proto/dxos/client/services";
|
|
2271
|
-
var __dxlog_file9 = "/
|
|
2271
|
+
var __dxlog_file9 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/space-invitation-protocol.ts";
|
|
2272
2272
|
var SpaceInvitationProtocol = class {
|
|
2273
2273
|
constructor(_spaceManager, _signingContext, _keyring, _spaceKey) {
|
|
2274
2274
|
this._spaceManager = _spaceManager;
|
|
@@ -2420,9 +2420,21 @@ var SpaceInvitationProtocol = class {
|
|
|
2420
2420
|
import { Stream as Stream9 } from "@dxos/codec-protobuf";
|
|
2421
2421
|
import { raise } from "@dxos/debug";
|
|
2422
2422
|
import { parseMethodName, RpcPeer } from "@dxos/rpc";
|
|
2423
|
-
|
|
2423
|
+
import { MapCounter, trace as trace5 } from "@dxos/tracing";
|
|
2424
|
+
function _ts_decorate3(decorators, target, key, desc) {
|
|
2425
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2426
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
2427
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
2428
|
+
else
|
|
2429
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
2430
|
+
if (d = decorators[i])
|
|
2431
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2432
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2433
|
+
}
|
|
2434
|
+
var ClientRpcServer = class ClientRpcServer2 {
|
|
2424
2435
|
constructor(params) {
|
|
2425
2436
|
this._handlerCache = /* @__PURE__ */ new Map();
|
|
2437
|
+
this._callMetrics = new MapCounter();
|
|
2426
2438
|
const { serviceRegistry, handleCall, handleStream, ...rpcOptions } = params;
|
|
2427
2439
|
this._handleCall = handleCall;
|
|
2428
2440
|
this._handleStream = handleStream;
|
|
@@ -2432,6 +2444,7 @@ var ClientRpcServer = class {
|
|
|
2432
2444
|
callHandler: (method, params2) => {
|
|
2433
2445
|
const [serviceName, methodName] = parseMethodName(method);
|
|
2434
2446
|
const handler = (method2, params3) => this._getServiceHandler(serviceName).call(method2, params3);
|
|
2447
|
+
this._callMetrics.inc(`${serviceName}.${methodName} request`);
|
|
2435
2448
|
if (this._handleCall) {
|
|
2436
2449
|
return this._handleCall(methodName, params2, handler);
|
|
2437
2450
|
} else {
|
|
@@ -2441,14 +2454,21 @@ var ClientRpcServer = class {
|
|
|
2441
2454
|
streamHandler: (method, params2) => {
|
|
2442
2455
|
const [serviceName, methodName] = parseMethodName(method);
|
|
2443
2456
|
const handler = (method2, params3) => this._getServiceHandler(serviceName).callStream(method2, params3);
|
|
2457
|
+
this._callMetrics.inc(`${serviceName}.${methodName} request stream`);
|
|
2444
2458
|
if (this._handleStream) {
|
|
2445
|
-
return Stream9.unwrapPromise(this._handleStream(methodName, params2, handler))
|
|
2459
|
+
return Stream9.map(Stream9.unwrapPromise(this._handleStream(methodName, params2, handler)), (data) => {
|
|
2460
|
+
this._callMetrics.inc(`${serviceName}.${methodName} response stream`);
|
|
2461
|
+
return data;
|
|
2462
|
+
});
|
|
2446
2463
|
} else {
|
|
2447
2464
|
return handler(methodName, params2);
|
|
2448
2465
|
}
|
|
2449
2466
|
}
|
|
2450
2467
|
});
|
|
2451
2468
|
}
|
|
2469
|
+
get _services() {
|
|
2470
|
+
return Object.keys(this._serviceRegistry.services);
|
|
2471
|
+
}
|
|
2452
2472
|
async open() {
|
|
2453
2473
|
await this._rpcPeer.open();
|
|
2454
2474
|
}
|
|
@@ -2467,8 +2487,18 @@ var ClientRpcServer = class {
|
|
|
2467
2487
|
return this._handlerCache.get(serviceName);
|
|
2468
2488
|
}
|
|
2469
2489
|
};
|
|
2490
|
+
_ts_decorate3([
|
|
2491
|
+
trace5.metricsCounter()
|
|
2492
|
+
], ClientRpcServer.prototype, "_callMetrics", void 0);
|
|
2493
|
+
_ts_decorate3([
|
|
2494
|
+
trace5.info()
|
|
2495
|
+
], ClientRpcServer.prototype, "_services", null);
|
|
2496
|
+
ClientRpcServer = _ts_decorate3([
|
|
2497
|
+
trace5.resource()
|
|
2498
|
+
], ClientRpcServer);
|
|
2470
2499
|
|
|
2471
2500
|
// packages/sdk/client-services/src/packlets/services/diagnostics.ts
|
|
2501
|
+
import { Trigger as Trigger4 } from "@dxos/async";
|
|
2472
2502
|
import { getFirstStreamValue } from "@dxos/codec-protobuf";
|
|
2473
2503
|
import { credentialTypeFilter } from "@dxos/credentials";
|
|
2474
2504
|
import { DocumentModel } from "@dxos/document-model";
|
|
@@ -2507,10 +2537,10 @@ var getPlatform = () => {
|
|
|
2507
2537
|
};
|
|
2508
2538
|
|
|
2509
2539
|
// packages/sdk/client-services/src/version.ts
|
|
2510
|
-
var DXOS_VERSION = "0.3.
|
|
2540
|
+
var DXOS_VERSION = "0.3.3-main.1b7ca63";
|
|
2511
2541
|
|
|
2512
2542
|
// packages/sdk/client-services/src/packlets/services/diagnostics.ts
|
|
2513
|
-
var __dxlog_file10 = "/
|
|
2543
|
+
var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/diagnostics.ts";
|
|
2514
2544
|
var DEFAULT_TIMEOUT = 1e3;
|
|
2515
2545
|
var createDiagnostics = async (clientServices, serviceContext, config) => {
|
|
2516
2546
|
const diagnostics = {
|
|
@@ -2526,7 +2556,7 @@ var createDiagnostics = async (clientServices, serviceContext, config) => {
|
|
|
2526
2556
|
{
|
|
2527
2557
|
invariant9(clientServices.LoggingService, "SystemService is not available.", {
|
|
2528
2558
|
F: __dxlog_file10,
|
|
2529
|
-
L:
|
|
2559
|
+
L: 93,
|
|
2530
2560
|
S: void 0,
|
|
2531
2561
|
A: [
|
|
2532
2562
|
"clientServices.LoggingService",
|
|
@@ -2559,6 +2589,19 @@ var createDiagnostics = async (clientServices, serviceContext, config) => {
|
|
|
2559
2589
|
bytes,
|
|
2560
2590
|
length
|
|
2561
2591
|
}));
|
|
2592
|
+
const status = await getFirstStreamValue(clientServices.NetworkService.queryStatus(), {
|
|
2593
|
+
timeout: DEFAULT_TIMEOUT
|
|
2594
|
+
}).catch(() => void 0);
|
|
2595
|
+
diagnostics.networkStatus = status;
|
|
2596
|
+
const swarmInfoDone = new Trigger4();
|
|
2597
|
+
serviceContext.networkManager.connectionLog?.update.on(async () => {
|
|
2598
|
+
const swarms = serviceContext.networkManager.connectionLog?.swarms;
|
|
2599
|
+
diagnostics.swarms = swarms;
|
|
2600
|
+
await swarmInfoDone.wake();
|
|
2601
|
+
});
|
|
2602
|
+
await swarmInfoDone.wait({
|
|
2603
|
+
timeout: DEFAULT_TIMEOUT
|
|
2604
|
+
});
|
|
2562
2605
|
}
|
|
2563
2606
|
diagnostics.config = config.values;
|
|
2564
2607
|
return diagnostics;
|
|
@@ -2572,7 +2615,7 @@ var getProperties = (space) => {
|
|
|
2572
2615
|
} catch (err) {
|
|
2573
2616
|
log8.warn(err.message, void 0, {
|
|
2574
2617
|
F: __dxlog_file10,
|
|
2575
|
-
L:
|
|
2618
|
+
L: 168,
|
|
2576
2619
|
S: void 0,
|
|
2577
2620
|
C: (f, a) => f(...a)
|
|
2578
2621
|
});
|
|
@@ -2639,11 +2682,11 @@ import { CancelledError, SystemError } from "@dxos/protocols";
|
|
|
2639
2682
|
import { SpaceState } from "@dxos/protocols/proto/dxos/client/services";
|
|
2640
2683
|
import { AdmittedFeed as AdmittedFeed3 } from "@dxos/protocols/proto/dxos/halo/credentials";
|
|
2641
2684
|
import { Timeframe as Timeframe2 } from "@dxos/timeframe";
|
|
2642
|
-
import { trace as
|
|
2685
|
+
import { trace as trace6 } from "@dxos/tracing";
|
|
2643
2686
|
import { ComplexSet as ComplexSet3 } from "@dxos/util";
|
|
2644
2687
|
|
|
2645
2688
|
// packages/sdk/client-services/src/packlets/spaces/notarization-plugin.ts
|
|
2646
|
-
import { DeferredTask, Event as Event4, scheduleTask as scheduleTask3, sleep, TimeoutError as TimeoutError2, Trigger as
|
|
2689
|
+
import { DeferredTask, Event as Event4, scheduleTask as scheduleTask3, sleep, TimeoutError as TimeoutError2, Trigger as Trigger5 } from "@dxos/async";
|
|
2647
2690
|
import { Context as Context6, rejectOnDispose } from "@dxos/context";
|
|
2648
2691
|
import { invariant as invariant10 } from "@dxos/invariant";
|
|
2649
2692
|
import { PublicKey as PublicKey7 } from "@dxos/keys";
|
|
@@ -2651,7 +2694,7 @@ import { log as log9 } from "@dxos/log";
|
|
|
2651
2694
|
import { schema as schema3 } from "@dxos/protocols";
|
|
2652
2695
|
import { RpcExtension as RpcExtension2 } from "@dxos/teleport";
|
|
2653
2696
|
import { ComplexMap as ComplexMap2, ComplexSet as ComplexSet2, entry } from "@dxos/util";
|
|
2654
|
-
var __dxlog_file11 = "/
|
|
2697
|
+
var __dxlog_file11 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/notarization-plugin.ts";
|
|
2655
2698
|
var DEFAULT_RETRY_TIMEOUT = 1e3;
|
|
2656
2699
|
var DEFAULT_SUCCESS_DELAY = 1e3;
|
|
2657
2700
|
var DEFAULT_NOTARIZE_TIMEOUT = 1e4;
|
|
@@ -2693,7 +2736,7 @@ var NotarizationPlugin = class {
|
|
|
2693
2736
|
"'Credentials must have an id'"
|
|
2694
2737
|
]
|
|
2695
2738
|
});
|
|
2696
|
-
const errors = new
|
|
2739
|
+
const errors = new Trigger5();
|
|
2697
2740
|
const ctx = this._ctx.derive({
|
|
2698
2741
|
onError: (err) => {
|
|
2699
2742
|
log9.warn("Notarization error", {
|
|
@@ -2824,7 +2867,7 @@ var NotarizationPlugin = class {
|
|
|
2824
2867
|
if (this._processedCredentials.has(id)) {
|
|
2825
2868
|
return;
|
|
2826
2869
|
}
|
|
2827
|
-
await entry(this._processCredentialsTriggers, id).orInsert(new
|
|
2870
|
+
await entry(this._processCredentialsTriggers, id).orInsert(new Trigger5()).value.wait();
|
|
2828
2871
|
}
|
|
2829
2872
|
/**
|
|
2830
2873
|
* Requests from other peers to notarize credentials.
|
|
@@ -2911,7 +2954,7 @@ var NotarizationTeleportExtension = class extends RpcExtension2 {
|
|
|
2911
2954
|
};
|
|
2912
2955
|
|
|
2913
2956
|
// packages/sdk/client-services/src/packlets/spaces/data-space.ts
|
|
2914
|
-
function
|
|
2957
|
+
function _ts_decorate4(decorators, target, key, desc) {
|
|
2915
2958
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2916
2959
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
2917
2960
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -2921,7 +2964,7 @@ function _ts_decorate3(decorators, target, key, desc) {
|
|
|
2921
2964
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2922
2965
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2923
2966
|
}
|
|
2924
|
-
var __dxlog_file12 = "/
|
|
2967
|
+
var __dxlog_file12 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/data-space.ts";
|
|
2925
2968
|
var ENABLE_FEED_PURGE = false;
|
|
2926
2969
|
var DataSpace = class DataSpace2 {
|
|
2927
2970
|
constructor(params) {
|
|
@@ -3243,32 +3286,32 @@ var DataSpace = class DataSpace2 {
|
|
|
3243
3286
|
this.stateUpdate.emit();
|
|
3244
3287
|
}
|
|
3245
3288
|
};
|
|
3246
|
-
|
|
3289
|
+
_ts_decorate4([
|
|
3247
3290
|
synchronized
|
|
3248
3291
|
], DataSpace.prototype, "open", null);
|
|
3249
|
-
|
|
3292
|
+
_ts_decorate4([
|
|
3250
3293
|
synchronized
|
|
3251
3294
|
], DataSpace.prototype, "close", null);
|
|
3252
|
-
|
|
3253
|
-
|
|
3295
|
+
_ts_decorate4([
|
|
3296
|
+
trace6.span({
|
|
3254
3297
|
showInBrowserTimeline: true
|
|
3255
3298
|
})
|
|
3256
3299
|
], DataSpace.prototype, "initializeDataPipeline", null);
|
|
3257
|
-
|
|
3258
|
-
|
|
3300
|
+
_ts_decorate4([
|
|
3301
|
+
trace6.span({
|
|
3259
3302
|
showInBrowserTimeline: true
|
|
3260
3303
|
})
|
|
3261
3304
|
], DataSpace.prototype, "_initializeAndReadControlPipeline", null);
|
|
3262
|
-
|
|
3305
|
+
_ts_decorate4([
|
|
3263
3306
|
timed(1e4)
|
|
3264
3307
|
], DataSpace.prototype, "_createWritableFeeds", null);
|
|
3265
|
-
|
|
3308
|
+
_ts_decorate4([
|
|
3266
3309
|
synchronized
|
|
3267
3310
|
], DataSpace.prototype, "activate", null);
|
|
3268
|
-
|
|
3311
|
+
_ts_decorate4([
|
|
3269
3312
|
synchronized
|
|
3270
3313
|
], DataSpace.prototype, "deactivate", null);
|
|
3271
|
-
DataSpace =
|
|
3314
|
+
DataSpace = _ts_decorate4([
|
|
3272
3315
|
trackLeaks("open", "close")
|
|
3273
3316
|
], DataSpace);
|
|
3274
3317
|
|
|
@@ -3279,7 +3322,7 @@ import { getCredentialAssertion as getCredentialAssertion2 } from "@dxos/credent
|
|
|
3279
3322
|
import { invariant as invariant11 } from "@dxos/invariant";
|
|
3280
3323
|
import { PublicKey as PublicKey9 } from "@dxos/keys";
|
|
3281
3324
|
import { log as log11 } from "@dxos/log";
|
|
3282
|
-
import { trace as
|
|
3325
|
+
import { trace as trace7 } from "@dxos/protocols";
|
|
3283
3326
|
import { SpaceState as SpaceState2 } from "@dxos/protocols/proto/dxos/client/services";
|
|
3284
3327
|
import { Gossip, Presence } from "@dxos/teleport-extension-gossip";
|
|
3285
3328
|
import { ComplexMap as ComplexMap3, deferFunction as deferFunction2, forEachAsync } from "@dxos/util";
|
|
@@ -3354,7 +3397,7 @@ var spaceGenesis = async (keyring, signingContext, space) => {
|
|
|
3354
3397
|
};
|
|
3355
3398
|
|
|
3356
3399
|
// packages/sdk/client-services/src/packlets/spaces/data-space-manager.ts
|
|
3357
|
-
function
|
|
3400
|
+
function _ts_decorate5(decorators, target, key, desc) {
|
|
3358
3401
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3359
3402
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
3360
3403
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -3364,7 +3407,7 @@ function _ts_decorate4(decorators, target, key, desc) {
|
|
|
3364
3407
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
3365
3408
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3366
3409
|
}
|
|
3367
|
-
var __dxlog_file13 = "/
|
|
3410
|
+
var __dxlog_file13 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/data-space-manager.ts";
|
|
3368
3411
|
var DataSpaceManager = class DataSpaceManager2 {
|
|
3369
3412
|
constructor(_spaceManager, _metadataStore, _dataServiceSubscriptions, _keyring, _signingContext, _feedStore) {
|
|
3370
3413
|
this._spaceManager = _spaceManager;
|
|
@@ -3390,7 +3433,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3390
3433
|
S: this,
|
|
3391
3434
|
C: (f, a) => f(...a)
|
|
3392
3435
|
});
|
|
3393
|
-
log11.trace("dxos.echo.data-space-manager.open",
|
|
3436
|
+
log11.trace("dxos.echo.data-space-manager.open", trace7.begin({
|
|
3394
3437
|
id: this._instanceId
|
|
3395
3438
|
}), {
|
|
3396
3439
|
F: __dxlog_file13,
|
|
@@ -3436,7 +3479,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3436
3479
|
space.initializeDataPipelineAsync();
|
|
3437
3480
|
}
|
|
3438
3481
|
}
|
|
3439
|
-
log11.trace("dxos.echo.data-space-manager.open",
|
|
3482
|
+
log11.trace("dxos.echo.data-space-manager.open", trace7.end({
|
|
3440
3483
|
id: this._instanceId
|
|
3441
3484
|
}), {
|
|
3442
3485
|
F: __dxlog_file13,
|
|
@@ -3670,19 +3713,19 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3670
3713
|
return dataSpace;
|
|
3671
3714
|
}
|
|
3672
3715
|
};
|
|
3673
|
-
|
|
3716
|
+
_ts_decorate5([
|
|
3674
3717
|
synchronized2
|
|
3675
3718
|
], DataSpaceManager.prototype, "open", null);
|
|
3676
|
-
|
|
3719
|
+
_ts_decorate5([
|
|
3677
3720
|
synchronized2
|
|
3678
3721
|
], DataSpaceManager.prototype, "close", null);
|
|
3679
|
-
|
|
3722
|
+
_ts_decorate5([
|
|
3680
3723
|
synchronized2
|
|
3681
3724
|
], DataSpaceManager.prototype, "createSpace", null);
|
|
3682
|
-
|
|
3725
|
+
_ts_decorate5([
|
|
3683
3726
|
synchronized2
|
|
3684
3727
|
], DataSpaceManager.prototype, "acceptSpace", null);
|
|
3685
|
-
DataSpaceManager =
|
|
3728
|
+
DataSpaceManager = _ts_decorate5([
|
|
3686
3729
|
trackLeaks2("open", "close")
|
|
3687
3730
|
], DataSpaceManager);
|
|
3688
3731
|
|
|
@@ -3694,7 +3737,7 @@ import { invariant as invariant12 } from "@dxos/invariant";
|
|
|
3694
3737
|
import { log as log12 } from "@dxos/log";
|
|
3695
3738
|
import { ApiError, SpaceNotFoundError, encodeError } from "@dxos/protocols";
|
|
3696
3739
|
import { SpaceMember as SpaceMember3, SpaceState as SpaceState3 } from "@dxos/protocols/proto/dxos/client/services";
|
|
3697
|
-
var __dxlog_file14 = "/
|
|
3740
|
+
var __dxlog_file14 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/spaces-service.ts";
|
|
3698
3741
|
var SpacesServiceImpl = class {
|
|
3699
3742
|
constructor(_identityManager, _spaceManager, _dataServiceSubscriptions, _getDataSpaceManager) {
|
|
3700
3743
|
this._identityManager = _identityManager;
|
|
@@ -3908,7 +3951,7 @@ var SpacesServiceImpl = class {
|
|
|
3908
3951
|
var getChannelId = (channel) => `user-channel/${channel}`;
|
|
3909
3952
|
|
|
3910
3953
|
// packages/sdk/client-services/src/packlets/services/service-context.ts
|
|
3911
|
-
import { Trigger as
|
|
3954
|
+
import { Trigger as Trigger6 } from "@dxos/async";
|
|
3912
3955
|
import { Context as Context9 } from "@dxos/context";
|
|
3913
3956
|
import { getCredentialAssertion as getCredentialAssertion3 } from "@dxos/credentials";
|
|
3914
3957
|
import { failUndefined as failUndefined3 } from "@dxos/debug";
|
|
@@ -3918,12 +3961,12 @@ import { invariant as invariant13 } from "@dxos/invariant";
|
|
|
3918
3961
|
import { Keyring } from "@dxos/keyring";
|
|
3919
3962
|
import { PublicKey as PublicKey10 } from "@dxos/keys";
|
|
3920
3963
|
import { log as log13 } from "@dxos/log";
|
|
3921
|
-
import { InvalidStorageVersionError, STORAGE_VERSION as STORAGE_VERSION2, trace as
|
|
3964
|
+
import { InvalidStorageVersionError, STORAGE_VERSION as STORAGE_VERSION2, trace as trace8 } from "@dxos/protocols";
|
|
3922
3965
|
import { Invitation as Invitation6 } from "@dxos/protocols/proto/dxos/client/services";
|
|
3923
3966
|
import { BlobStore } from "@dxos/teleport-extension-object-sync";
|
|
3924
3967
|
import { trace as Trace2 } from "@dxos/tracing";
|
|
3925
3968
|
import { safeInstanceof } from "@dxos/util";
|
|
3926
|
-
function
|
|
3969
|
+
function _ts_decorate6(decorators, target, key, desc) {
|
|
3927
3970
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3928
3971
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
3929
3972
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -3933,14 +3976,14 @@ function _ts_decorate5(decorators, target, key, desc) {
|
|
|
3933
3976
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
3934
3977
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3935
3978
|
}
|
|
3936
|
-
var __dxlog_file15 = "/
|
|
3979
|
+
var __dxlog_file15 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-context.ts";
|
|
3937
3980
|
var ServiceContext = class ServiceContext2 {
|
|
3938
3981
|
constructor(storage, networkManager, signalManager, modelFactory) {
|
|
3939
3982
|
this.storage = storage;
|
|
3940
3983
|
this.networkManager = networkManager;
|
|
3941
3984
|
this.signalManager = signalManager;
|
|
3942
3985
|
this.modelFactory = modelFactory;
|
|
3943
|
-
this.initialized = new
|
|
3986
|
+
this.initialized = new Trigger6();
|
|
3944
3987
|
this.dataServiceSubscriptions = new DataServiceSubscriptions();
|
|
3945
3988
|
this._handlerFactories = /* @__PURE__ */ new Map();
|
|
3946
3989
|
this._instanceId = PublicKey10.random().toHex();
|
|
@@ -3978,7 +4021,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
3978
4021
|
S: this,
|
|
3979
4022
|
C: (f, a) => f(...a)
|
|
3980
4023
|
});
|
|
3981
|
-
log13.trace("dxos.sdk.service-context.open",
|
|
4024
|
+
log13.trace("dxos.sdk.service-context.open", trace8.begin({
|
|
3982
4025
|
id: this._instanceId
|
|
3983
4026
|
}), {
|
|
3984
4027
|
F: __dxlog_file15,
|
|
@@ -3994,7 +4037,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
3994
4037
|
if (this.identityManager.identity) {
|
|
3995
4038
|
await this._initialize(ctx);
|
|
3996
4039
|
}
|
|
3997
|
-
log13.trace("dxos.sdk.service-context.open",
|
|
4040
|
+
log13.trace("dxos.sdk.service-context.open", trace8.end({
|
|
3998
4041
|
id: this._instanceId
|
|
3999
4042
|
}), {
|
|
4000
4043
|
F: __dxlog_file15,
|
|
@@ -4157,13 +4200,13 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4157
4200
|
await identity.space.spaceState.addCredentialProcessor(this._deviceSpaceSync);
|
|
4158
4201
|
}
|
|
4159
4202
|
};
|
|
4160
|
-
|
|
4203
|
+
_ts_decorate6([
|
|
4161
4204
|
Trace2.span()
|
|
4162
4205
|
], ServiceContext.prototype, "open", null);
|
|
4163
|
-
|
|
4206
|
+
_ts_decorate6([
|
|
4164
4207
|
Trace2.span()
|
|
4165
4208
|
], ServiceContext.prototype, "_initialize", null);
|
|
4166
|
-
ServiceContext =
|
|
4209
|
+
ServiceContext = _ts_decorate6([
|
|
4167
4210
|
safeInstanceof("dxos.client-services.ServiceContext"),
|
|
4168
4211
|
Trace2.resource()
|
|
4169
4212
|
], ServiceContext);
|
|
@@ -4193,10 +4236,10 @@ var ServiceRegistry = class {
|
|
|
4193
4236
|
};
|
|
4194
4237
|
|
|
4195
4238
|
// packages/sdk/client-services/src/packlets/locks/browser.ts
|
|
4196
|
-
import { asyncTimeout, Trigger as
|
|
4239
|
+
import { asyncTimeout, Trigger as Trigger7 } from "@dxos/async";
|
|
4197
4240
|
import { RESOURCE_LOCK_TIMEOUT } from "@dxos/client-protocol";
|
|
4198
4241
|
import { log as log14, logInfo } from "@dxos/log";
|
|
4199
|
-
function
|
|
4242
|
+
function _ts_decorate7(decorators, target, key, desc) {
|
|
4200
4243
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4201
4244
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
4202
4245
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -4206,7 +4249,7 @@ function _ts_decorate6(decorators, target, key, desc) {
|
|
|
4206
4249
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
4207
4250
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4208
4251
|
}
|
|
4209
|
-
var __dxlog_file16 = "/
|
|
4252
|
+
var __dxlog_file16 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/locks/browser.ts";
|
|
4210
4253
|
var Message;
|
|
4211
4254
|
(function(Message2) {
|
|
4212
4255
|
Message2["ACQUIRING"] = "acquiring";
|
|
@@ -4214,7 +4257,7 @@ var Message;
|
|
|
4214
4257
|
var Lock = class {
|
|
4215
4258
|
constructor({ lockKey, onAcquire, onRelease }) {
|
|
4216
4259
|
this._broadcastChannel = new BroadcastChannel("vault-resource-lock");
|
|
4217
|
-
this._releaseTrigger = new
|
|
4260
|
+
this._releaseTrigger = new Trigger7();
|
|
4218
4261
|
this._lockKey = lockKey;
|
|
4219
4262
|
this._onAcquire = onAcquire;
|
|
4220
4263
|
this._onRelease = onRelease;
|
|
@@ -4274,13 +4317,13 @@ var Lock = class {
|
|
|
4274
4317
|
S: this,
|
|
4275
4318
|
C: (f, a) => f(...a)
|
|
4276
4319
|
});
|
|
4277
|
-
const acquired = new
|
|
4320
|
+
const acquired = new Trigger7();
|
|
4278
4321
|
void navigator.locks.request(this._lockKey, {
|
|
4279
4322
|
steal
|
|
4280
4323
|
}, async () => {
|
|
4281
4324
|
await this._onAcquire?.();
|
|
4282
4325
|
acquired.wake();
|
|
4283
|
-
this._releaseTrigger = new
|
|
4326
|
+
this._releaseTrigger = new Trigger7();
|
|
4284
4327
|
await this._releaseTrigger.wait();
|
|
4285
4328
|
log14("releasing lock...", void 0, {
|
|
4286
4329
|
F: __dxlog_file16,
|
|
@@ -4309,7 +4352,7 @@ var Lock = class {
|
|
|
4309
4352
|
});
|
|
4310
4353
|
}
|
|
4311
4354
|
};
|
|
4312
|
-
|
|
4355
|
+
_ts_decorate7([
|
|
4313
4356
|
logInfo
|
|
4314
4357
|
], Lock.prototype, "lockKey", null);
|
|
4315
4358
|
var isLocked = (lockPath) => {
|
|
@@ -4378,7 +4421,7 @@ import { log as log16 } from "@dxos/log";
|
|
|
4378
4421
|
import { WebsocketSignalManager } from "@dxos/messaging";
|
|
4379
4422
|
import { ModelFactory } from "@dxos/model-factory";
|
|
4380
4423
|
import { createSimplePeerTransportFactory, NetworkManager } from "@dxos/network-manager";
|
|
4381
|
-
import { trace as
|
|
4424
|
+
import { trace as trace9 } from "@dxos/protocols";
|
|
4382
4425
|
import { SystemStatus } from "@dxos/protocols/proto/dxos/client/services";
|
|
4383
4426
|
import { TextModel } from "@dxos/text-model";
|
|
4384
4427
|
import { TRACE_PROCESSOR, trace as Trace3 } from "@dxos/tracing";
|
|
@@ -4632,7 +4675,7 @@ var SystemServiceImpl = class {
|
|
|
4632
4675
|
};
|
|
4633
4676
|
|
|
4634
4677
|
// packages/sdk/client-services/src/packlets/services/service-host.ts
|
|
4635
|
-
function
|
|
4678
|
+
function _ts_decorate8(decorators, target, key, desc) {
|
|
4636
4679
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4637
4680
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
4638
4681
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -4642,7 +4685,7 @@ function _ts_decorate7(decorators, target, key, desc) {
|
|
|
4642
4685
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
4643
4686
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4644
4687
|
}
|
|
4645
|
-
var __dxlog_file17 = "/
|
|
4688
|
+
var __dxlog_file17 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-host.ts";
|
|
4646
4689
|
var createDefaultModelFactory = () => {
|
|
4647
4690
|
return new ModelFactory().registerModel(DocumentModel2).registerModel(TextModel);
|
|
4648
4691
|
};
|
|
@@ -4802,7 +4845,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4802
4845
|
return;
|
|
4803
4846
|
}
|
|
4804
4847
|
const traceId = PublicKey11.random().toHex();
|
|
4805
|
-
log16.trace("dxos.client-services.host.open",
|
|
4848
|
+
log16.trace("dxos.client-services.host.open", trace9.begin({
|
|
4806
4849
|
id: traceId
|
|
4807
4850
|
}), {
|
|
4808
4851
|
F: __dxlog_file17,
|
|
@@ -4901,7 +4944,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4901
4944
|
S: this,
|
|
4902
4945
|
C: (f, a) => f(...a)
|
|
4903
4946
|
});
|
|
4904
|
-
log16.trace("dxos.client-services.host.open",
|
|
4947
|
+
log16.trace("dxos.client-services.host.open", trace9.end({
|
|
4905
4948
|
id: traceId
|
|
4906
4949
|
}), {
|
|
4907
4950
|
F: __dxlog_file17,
|
|
@@ -4942,7 +4985,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4942
4985
|
}
|
|
4943
4986
|
async reset() {
|
|
4944
4987
|
const traceId = PublicKey11.random().toHex();
|
|
4945
|
-
log16.trace("dxos.sdk.client-services-host.reset",
|
|
4988
|
+
log16.trace("dxos.sdk.client-services-host.reset", trace9.begin({
|
|
4946
4989
|
id: traceId
|
|
4947
4990
|
}), {
|
|
4948
4991
|
F: __dxlog_file17,
|
|
@@ -4964,7 +5007,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4964
5007
|
S: this,
|
|
4965
5008
|
C: (f, a) => f(...a)
|
|
4966
5009
|
});
|
|
4967
|
-
log16.trace("dxos.sdk.client-services-host.reset",
|
|
5010
|
+
log16.trace("dxos.sdk.client-services-host.reset", trace9.end({
|
|
4968
5011
|
id: traceId
|
|
4969
5012
|
}), {
|
|
4970
5013
|
F: __dxlog_file17,
|
|
@@ -4994,21 +5037,21 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4994
5037
|
return identity;
|
|
4995
5038
|
}
|
|
4996
5039
|
};
|
|
4997
|
-
|
|
5040
|
+
_ts_decorate8([
|
|
4998
5041
|
Trace3.info()
|
|
4999
5042
|
], ClientServicesHost.prototype, "_opening", void 0);
|
|
5000
|
-
|
|
5043
|
+
_ts_decorate8([
|
|
5001
5044
|
Trace3.info()
|
|
5002
5045
|
], ClientServicesHost.prototype, "_open", void 0);
|
|
5003
|
-
|
|
5046
|
+
_ts_decorate8([
|
|
5004
5047
|
synchronized3,
|
|
5005
5048
|
Trace3.span()
|
|
5006
5049
|
], ClientServicesHost.prototype, "open", null);
|
|
5007
|
-
|
|
5050
|
+
_ts_decorate8([
|
|
5008
5051
|
synchronized3,
|
|
5009
5052
|
Trace3.span()
|
|
5010
5053
|
], ClientServicesHost.prototype, "close", null);
|
|
5011
|
-
ClientServicesHost =
|
|
5054
|
+
ClientServicesHost = _ts_decorate8([
|
|
5012
5055
|
Trace3.resource()
|
|
5013
5056
|
], ClientServicesHost);
|
|
5014
5057
|
|
|
@@ -5045,4 +5088,4 @@ export {
|
|
|
5045
5088
|
createDefaultModelFactory,
|
|
5046
5089
|
ClientServicesHost
|
|
5047
5090
|
};
|
|
5048
|
-
//# sourceMappingURL=chunk-
|
|
5091
|
+
//# sourceMappingURL=chunk-L2DNXWJ5.mjs.map
|