@synapticon/motion-master-client 6.0.0-alpha.53 → 6.0.0-alpha.54

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.
@@ -670,12 +670,6 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
670
670
  * @example [0,0,0,0]
671
671
  */
672
672
  data: number[];
673
- /**
674
- * Server-measured duration of the SDO transaction in microseconds (control-plane lock acquire + mailbox wire round-trip). This is the wire cost only — far smaller than the end-to-end HTTP round-trip a cross-origin browser client observes.
675
- * @min 0
676
- * @example 5000
677
- */
678
- wireUs: number;
679
673
  }, void | {
680
674
  /**
681
675
  * Human-readable error message from the driver
@@ -699,12 +693,6 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
699
693
  }, params?: RequestParams) => Promise<import("./http-client.js").HttpResponse<{
700
694
  /** @example true */
701
695
  ok: boolean;
702
- /**
703
- * Server-measured duration of the SDO transaction in microseconds (control-plane lock acquire + mailbox wire round-trip). This is the wire cost only — far smaller than the end-to-end HTTP round-trip a cross-origin browser client observes.
704
- * @min 0
705
- * @example 5000
706
- */
707
- wireUs: number;
708
696
  }, void | {
709
697
  /**
710
698
  * Human-readable error message from the driver
package/dist/index.d.ts CHANGED
@@ -8,3 +8,4 @@ export * from './hex.js';
8
8
  export * from './sdo.js';
9
9
  export * from './somanet.js';
10
10
  export * from './mmpd.js';
11
+ export * from './wire-time.js';
package/dist/index.js CHANGED
@@ -14,3 +14,4 @@ export * from './hex.js';
14
14
  export * from './sdo.js';
15
15
  export * from './somanet.js';
16
16
  export * from './mmpd.js';
17
+ export * from './wire-time.js';
@@ -0,0 +1,2 @@
1
+ export declare const WIRE_TIME_HEADER = "X-Wire-Us";
2
+ export declare function wireTimeMs(res: Response): number | null;
@@ -0,0 +1,18 @@
1
+ // Helper for the server-measured wire-time channel.
2
+ //
3
+ // Endpoints that perform a fieldbus transaction (SDO, FoE, ...) report the on-device wire cost —
4
+ // control-plane lock acquire + the mailbox/ESC round-trip — via the `X-Wire-Us` response header
5
+ // (microseconds), independent of the response body shape. A cross-origin client subtracts this
6
+ // from its own observed HTTP round-trip to separate the device cost from browser/transport
7
+ // overhead. The header is CORS-exposed by the server so it is readable cross-origin.
8
+ // Name of the wire-time response header (microseconds, integer).
9
+ export const WIRE_TIME_HEADER = 'X-Wire-Us';
10
+ // Reads the server-measured wire time from a response, in milliseconds, or null if the header is
11
+ // absent or unparseable. Accepts any `Response` (the generated client's `HttpResponse` extends it).
12
+ export function wireTimeMs(res) {
13
+ const raw = res.headers.get(WIRE_TIME_HEADER);
14
+ if (raw === null)
15
+ return null;
16
+ const us = Number(raw);
17
+ return Number.isFinite(us) ? us / 1000 : null;
18
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synapticon/motion-master-client",
3
- "version": "6.0.0-alpha.53",
3
+ "version": "6.0.0-alpha.54",
4
4
  "description": "Isomorphic TypeScript client for Motion Master: the generated HTTP API client, the WebSocket connection, and helpers.",
5
5
  "license": "MIT",
6
6
  "repository": {