wire-mesh-core 4.2.10 → 4.2.12
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.
|
@@ -27,7 +27,7 @@ function buildPathTraceResponse(incoming, hubAddress) {
|
|
|
27
27
|
async function tracePath(options) {
|
|
28
28
|
const startedAt = options.clock.now();
|
|
29
29
|
const outcome = await options.session.sendManageRequest(buildPathTraceCommand(), options.scope ?? PATH_TRACE_SCOPE, options.targetDevice, options.token, options.timeoutMs);
|
|
30
|
-
const rttMs = options.clock.now() - startedAt;
|
|
30
|
+
const rttMs = Math.max(0, options.clock.now() - startedAt);
|
|
31
31
|
const local = {
|
|
32
32
|
relayed: options.targetDevice !== void 0,
|
|
33
33
|
...options.targetDevice !== void 0 && options.localHubAddress !== void 0 ? { hubAddress: options.localHubAddress } : {}
|
|
@@ -26,7 +26,7 @@ function buildPathTraceResponse(incoming, hubAddress) {
|
|
|
26
26
|
async function tracePath(options) {
|
|
27
27
|
const startedAt = options.clock.now();
|
|
28
28
|
const outcome = await options.session.sendManageRequest(buildPathTraceCommand(), options.scope ?? PATH_TRACE_SCOPE, options.targetDevice, options.token, options.timeoutMs);
|
|
29
|
-
const rttMs = options.clock.now() - startedAt;
|
|
29
|
+
const rttMs = Math.max(0, options.clock.now() - startedAt);
|
|
30
30
|
const local = {
|
|
31
31
|
relayed: options.targetDevice !== void 0,
|
|
32
32
|
...options.targetDevice !== void 0 && options.localHubAddress !== void 0 ? { hubAddress: options.localHubAddress } : {}
|
|
@@ -30,9 +30,9 @@ export declare function assembleTopologyGraph(directory: readonly DirectoryEntry
|
|
|
30
30
|
/**
|
|
31
31
|
* Sends topology.get and resolves with the peer's own live TopologyPeers, parsed back out of the manage-ok response's own open `* tstr => any` tail -- the on-demand, cache-bust counterpart to reading a possibly-stale `topology/peers` gossip extension off the directory. targetDevice/timeoutMs forward directly to MeshSession.sendManageRequest's own identically-named parameters (relay routing and a requester-side give-up bound respectively), exactly as requestCapability already does for capability-request.
|
|
32
32
|
*/
|
|
33
|
-
export declare function sendTopologyGet(session: Readonly<MeshSession
|
|
33
|
+
export declare function sendTopologyGet(session: Readonly<Pick<MeshSession, "sendManageRequest">>, targetDevice?: DeviceId, timeoutMs?: number): Promise<TopologyPeers>;
|
|
34
34
|
/**
|
|
35
35
|
* Answers an incoming topology.get manage-request directly off the given session's own live MeshSession.getTopologyPeers() -- deliberately ungated, per management.cddl's own `topology-get` comment: no token/scope check at all, matching room.join/room.invite's identical "no gate" treatment in room-client.ts. Assumes the caller's own incomingManageRequests dispatch has already routed here for a request whose command.params.verb is "topology.get" (the same assumption createCapabilityRequestHandler already makes for capability-request) -- anything that doesn't parse as topology-get is answered `{result:"error", code:"malformed"}` rather than silently ignored, since reaching this handler at all means the caller believed it was one.
|
|
36
36
|
*/
|
|
37
|
-
export declare function createTopologyGetHandler(session: Readonly<MeshSession
|
|
37
|
+
export declare function createTopologyGetHandler(session: Readonly<Pick<MeshSession, "getTopologyPeers">>): (incoming: Readonly<IncomingManageRequest>) => Promise<void>;
|
|
38
38
|
//#endregion
|
|
@@ -30,9 +30,9 @@ export declare function assembleTopologyGraph(directory: readonly DirectoryEntry
|
|
|
30
30
|
/**
|
|
31
31
|
* Sends topology.get and resolves with the peer's own live TopologyPeers, parsed back out of the manage-ok response's own open `* tstr => any` tail -- the on-demand, cache-bust counterpart to reading a possibly-stale `topology/peers` gossip extension off the directory. targetDevice/timeoutMs forward directly to MeshSession.sendManageRequest's own identically-named parameters (relay routing and a requester-side give-up bound respectively), exactly as requestCapability already does for capability-request.
|
|
32
32
|
*/
|
|
33
|
-
export declare function sendTopologyGet(session: Readonly<MeshSession
|
|
33
|
+
export declare function sendTopologyGet(session: Readonly<Pick<MeshSession, "sendManageRequest">>, targetDevice?: DeviceId, timeoutMs?: number): Promise<TopologyPeers>;
|
|
34
34
|
/**
|
|
35
35
|
* Answers an incoming topology.get manage-request directly off the given session's own live MeshSession.getTopologyPeers() -- deliberately ungated, per management.cddl's own `topology-get` comment: no token/scope check at all, matching room.join/room.invite's identical "no gate" treatment in room-client.ts. Assumes the caller's own incomingManageRequests dispatch has already routed here for a request whose command.params.verb is "topology.get" (the same assumption createCapabilityRequestHandler already makes for capability-request) -- anything that doesn't parse as topology-get is answered `{result:"error", code:"malformed"}` rather than silently ignored, since reaching this handler at all means the caller believed it was one.
|
|
36
36
|
*/
|
|
37
|
-
export declare function createTopologyGetHandler(session: Readonly<MeshSession
|
|
37
|
+
export declare function createTopologyGetHandler(session: Readonly<Pick<MeshSession, "getTopologyPeers">>): (incoming: Readonly<IncomingManageRequest>) => Promise<void>;
|
|
38
38
|
//#endregion
|