@synapticon/motion-master-client 2.2.2 → 6.0.0-alpha.22

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.
Files changed (71) hide show
  1. package/LICENSE +21 -0
  2. package/dist/client.d.ts +20 -0
  3. package/dist/client.js +37 -0
  4. package/dist/constants.d.ts +2 -0
  5. package/dist/constants.js +8 -0
  6. package/dist/generated/Api.d.ts +991 -0
  7. package/dist/generated/Api.js +614 -0
  8. package/dist/generated/data-contracts.d.ts +644 -0
  9. package/dist/generated/data-contracts.js +12 -0
  10. package/dist/generated/http-client.d.ts +60 -0
  11. package/dist/generated/http-client.js +171 -0
  12. package/dist/hex.d.ts +2 -0
  13. package/dist/hex.js +20 -0
  14. package/dist/index.d.ts +10 -7
  15. package/dist/index.js +16 -22
  16. package/dist/mmpd.d.ts +54 -0
  17. package/dist/mmpd.js +323 -0
  18. package/dist/sdo.d.ts +15 -0
  19. package/dist/sdo.js +212 -0
  20. package/dist/somanet.d.ts +5 -0
  21. package/dist/somanet.js +15 -0
  22. package/dist/web-socket-connection.d.ts +69 -0
  23. package/dist/web-socket-connection.js +206 -0
  24. package/package.json +29 -39
  25. package/.vscode/launch.json +0 -23
  26. package/README.md +0 -118
  27. package/box.config.json +0 -7
  28. package/dist/cli.d.ts +0 -3
  29. package/dist/cli.d.ts.map +0 -1
  30. package/dist/cli.js +0 -1433
  31. package/dist/cli.js.map +0 -1
  32. package/dist/index.d.ts.map +0 -1
  33. package/dist/index.js.map +0 -1
  34. package/dist/motion-master-client-web-socket-connection.d.ts +0 -43
  35. package/dist/motion-master-client-web-socket-connection.d.ts.map +0 -1
  36. package/dist/motion-master-client-web-socket-connection.js +0 -91
  37. package/dist/motion-master-client-web-socket-connection.js.map +0 -1
  38. package/dist/motion-master-client.d.ts +0 -105
  39. package/dist/motion-master-client.d.ts.map +0 -1
  40. package/dist/motion-master-client.js +0 -348
  41. package/dist/motion-master-client.js.map +0 -1
  42. package/dist/motion-master-notification-subscribe-data.d.ts +0 -8
  43. package/dist/motion-master-notification-subscribe-data.d.ts.map +0 -1
  44. package/dist/motion-master-notification-subscribe-data.js +0 -3
  45. package/dist/motion-master-notification-subscribe-data.js.map +0 -1
  46. package/dist/motion-master-notification-web-socket-connection.d.ts +0 -56
  47. package/dist/motion-master-notification-web-socket-connection.d.ts.map +0 -1
  48. package/dist/motion-master-notification-web-socket-connection.js +0 -115
  49. package/dist/motion-master-notification-web-socket-connection.js.map +0 -1
  50. package/dist/motion-master-notification.d.ts +0 -31
  51. package/dist/motion-master-notification.d.ts.map +0 -1
  52. package/dist/motion-master-notification.js +0 -44
  53. package/dist/motion-master-notification.js.map +0 -1
  54. package/dist/util.d.ts +0 -16
  55. package/dist/util.d.ts.map +0 -1
  56. package/dist/util.js +0 -24
  57. package/dist/util.js.map +0 -1
  58. package/licenses.format.json +0 -4
  59. package/motion-master-client.config.json +0 -7
  60. package/smm_data_dic.json +0 -1213
  61. package/src/cli.ts +0 -1361
  62. package/src/index.ts +0 -7
  63. package/src/motion-master-client-web-socket-connection.ts +0 -104
  64. package/src/motion-master-client.ts +0 -468
  65. package/src/motion-master-notification-subscribe-data.ts +0 -7
  66. package/src/motion-master-notification-web-socket-connection.ts +0 -143
  67. package/src/motion-master-notification.ts +0 -51
  68. package/src/util.ts +0 -22
  69. package/test.sh +0 -122
  70. package/tsconfig.json +0 -63
  71. package/tslint.json +0 -118
@@ -0,0 +1,614 @@
1
+ /* eslint-disable */
2
+ /* tslint:disable */
3
+ // @ts-nocheck
4
+ /*
5
+ * ---------------------------------------------------------------
6
+ * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
7
+ * ## ##
8
+ * ## AUTHOR: acacode ##
9
+ * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
10
+ * ---------------------------------------------------------------
11
+ */
12
+ import { ContentType, HttpClient } from "./http-client.js";
13
+ export class Api extends HttpClient {
14
+ /**
15
+ * No description
16
+ *
17
+ * @name GetAdapters
18
+ * @summary List network adapters on the host
19
+ * @request GET:/api/adapters
20
+ */
21
+ getAdapters = (params = {}) => this.request({
22
+ path: `/api/adapters`,
23
+ method: "GET",
24
+ format: "json",
25
+ ...params,
26
+ });
27
+ /**
28
+ * No description
29
+ *
30
+ * @name GetVersion
31
+ * @summary Get Motion Master version
32
+ * @request GET:/api/version
33
+ */
34
+ getVersion = (params = {}) => this.request({
35
+ path: `/api/version`,
36
+ method: "GET",
37
+ format: "json",
38
+ ...params,
39
+ });
40
+ /**
41
+ * @description The effective configuration after merging the JSONC config file (if any) over the built-in defaults — the same `Config` the server booted with. Read-only; changing it requires editing the config file and restarting. The shape mirrors the config file (server, fieldbus, logLevel, tls, gameLoop, recorder).
42
+ *
43
+ * @name GetStartedConfig
44
+ * @summary Get the configuration Motion Master was started with
45
+ * @request GET:/api/config
46
+ */
47
+ getStartedConfig = (params = {}) => this.request({
48
+ path: `/api/config`,
49
+ method: "GET",
50
+ format: "json",
51
+ ...params,
52
+ });
53
+ /**
54
+ * @description A best-effort snapshot of the operating system and hardware Motion Master is running on, for the Connection page's System panel. Every field is best-effort: one that cannot be determined on the current platform is returned empty (strings) or zero (numbers) rather than failing the request. Collected on demand — not cached.
55
+ *
56
+ * @name GetSystemInfo
57
+ * @summary Get host OS and hardware information
58
+ * @request GET:/api/system-info
59
+ */
60
+ getSystemInfo = (params = {}) => this.request({
61
+ path: `/api/system-info`,
62
+ method: "GET",
63
+ format: "json",
64
+ ...params,
65
+ });
66
+ /**
67
+ * @description Reports the validity window and identity of the certificate the server is currently serving. `expiresSoon` trips within 7 days of `notAfter`, so the PWA can prompt the user to refresh. Note that an already-expired certificate blocks the browser from reaching this endpoint at all; the binary self-heals an expired/missing certificate at startup (fetching from the rolling release) and exposes `--update-cert` for manual refresh. Returns 500 if the certificate file cannot be read or parsed.
68
+ *
69
+ * @name GetCert
70
+ * @summary Get the TLS certificate validity window
71
+ * @request GET:/api/cert
72
+ */
73
+ getCert = (params = {}) => this.request({
74
+ path: `/api/cert`,
75
+ method: "GET",
76
+ format: "json",
77
+ ...params,
78
+ });
79
+ /**
80
+ * @description Downloads a fresh certificate and key from the rolling release, validates the pair (parses, CN matches, not expired, key matches cert), and atomically installs them next to the binary. The new certificate only takes effect after a restart (the TLS listener loads the certificate once at startup), indicated by `restartRequired` in the response. Use the still-valid proactive case; an already-expired certificate is healed by the binary at startup instead.
81
+ *
82
+ * @name RefreshCert
83
+ * @summary Fetch and install a fresh TLS certificate
84
+ * @request POST:/api/cert/refresh
85
+ */
86
+ refreshCert = (params = {}) => this.request({
87
+ path: `/api/cert/refresh`,
88
+ method: "POST",
89
+ format: "json",
90
+ ...params,
91
+ });
92
+ /**
93
+ * No description
94
+ *
95
+ * @name GetDevice
96
+ * @summary Get a single fieldbus device by bus position
97
+ * @request GET:/api/devices/{slavePosition}
98
+ */
99
+ getDevice = (slavePosition, params = {}) => this.request({
100
+ path: `/api/devices/${slavePosition}`,
101
+ method: "GET",
102
+ format: "json",
103
+ ...params,
104
+ });
105
+ /**
106
+ * @description Performs a live AL-state read for the device and reports whether its CoE/SDO mailbox is active — i.e. it is in PRE-OP, SAFE-OP, or OP. This is independent of the AL error indicator: a device in SAFE-OP+error still answers mailbox requests. Only INIT (no mailbox) and BOOT (FoE-only mailbox) report inactive. The device must already be known from a prior scan. Reading one device at a time means a single missing device reports inactive without failing the others.
107
+ *
108
+ * @name GetDeviceMailboxActive
109
+ * @summary Check whether a device's mailbox is active
110
+ * @request GET:/api/devices/{slavePosition}/mailbox
111
+ */
112
+ getDeviceMailboxActive = (slavePosition, params = {}) => this.request({
113
+ path: `/api/devices/${slavePosition}/mailbox`,
114
+ method: "GET",
115
+ format: "json",
116
+ ...params,
117
+ });
118
+ /**
119
+ * @description Constructs the requested fieldbus driver, opens the network interface, and makes the driver available for subsequent calls to /api/scan. The driver defaults to SOEM when omitted. SOEM has no adapter auto-detect: a network adapter must be supplied, otherwise init fails.
120
+ *
121
+ * @name Init
122
+ * @summary Initialise the fieldbus driver
123
+ * @request POST:/api/init
124
+ */
125
+ init = (data, params = {}) => this.request({
126
+ path: `/api/init`,
127
+ method: "POST",
128
+ body: data,
129
+ type: ContentType.Json,
130
+ format: "json",
131
+ ...params,
132
+ });
133
+ /**
134
+ * @description Scans the fieldbus for slaves and configures their sync managers and FMMUs. Must be called after a successful POST /api/init. Slaves remain in INIT state after this call; state transitions are driven by subsequent API calls.
135
+ *
136
+ * @name Scan
137
+ * @summary Scan the bus for slaves
138
+ * @request POST:/api/scan
139
+ */
140
+ scan = (params = {}) => this.request({
141
+ path: `/api/scan`,
142
+ method: "POST",
143
+ format: "json",
144
+ ...params,
145
+ });
146
+ /**
147
+ * @description Transitions all slaves to INIT state, closes the network interface, and removes all Device objects. After this returns, POST /api/init and POST /api/scan may be called again.
148
+ *
149
+ * @name Reset
150
+ * @summary Reset the fieldbus driver and clear the device list
151
+ * @request POST:/api/reset
152
+ */
153
+ reset = (params = {}) => this.request({
154
+ path: `/api/reset`,
155
+ method: "POST",
156
+ format: "json",
157
+ ...params,
158
+ });
159
+ /**
160
+ * @description Returns the most recent in-memory log lines as plain text, one entry per line. The ring buffer holds up to 100 000 entries (~10 MB).
161
+ *
162
+ * @name GetLog
163
+ * @summary Get recent log output
164
+ * @request GET:/api/log
165
+ */
166
+ getLog = (params = {}) => this.request({
167
+ path: `/api/log`,
168
+ method: "GET",
169
+ ...params,
170
+ });
171
+ /**
172
+ * @description Returns the static catalogue of EtherCAT AL Status Codes defined in ETG.1000.6 §6.4.1. These codes appear in the alStatusCode field of the device state response when an error is present and identify the cause of the state transition failure.
173
+ *
174
+ * @name GetAlStatusCodes
175
+ * @summary List all known AL Status Codes
176
+ * @request GET:/api/meta/al-status-codes
177
+ */
178
+ getAlStatusCodes = (params = {}) => this.request({
179
+ path: `/api/meta/al-status-codes`,
180
+ method: "GET",
181
+ format: "json",
182
+ ...params,
183
+ });
184
+ /**
185
+ * @description Returns the static catalogue of well-known EtherCAT Slave Controller registers from the Beckhoff ESC datasheet (Section II) and ETG.1000.4. Use the address and length fields as inputs to the device register read/write endpoints.
186
+ *
187
+ * @name GetRegisters
188
+ * @summary List all known ESC registers
189
+ * @request GET:/api/meta/esc-registers
190
+ */
191
+ getRegisters = (params = {}) => this.request({
192
+ path: `/api/meta/esc-registers`,
193
+ method: "GET",
194
+ format: "json",
195
+ ...params,
196
+ });
197
+ /**
198
+ * @description Returns the static catalogue of standard File over EtherCAT (FoE) error codes defined in ETG.1000.6 §5.5. These codes appear in the FoE ERROR packet sent by the slave when a file transfer fails, and are surfaced in the error message returned by the file read endpoint. Vendor-specific codes outside the 0x8000 range are not listed here.
199
+ *
200
+ * @name GetFoeErrorCodes
201
+ * @summary List all known FoE error codes
202
+ * @request GET:/api/meta/foe-error-codes
203
+ */
204
+ getFoeErrorCodes = (params = {}) => this.request({
205
+ path: `/api/meta/foe-error-codes`,
206
+ method: "GET",
207
+ format: "json",
208
+ ...params,
209
+ });
210
+ /**
211
+ * @description Returns the static catalogue of ETG.1020 data type codes used in CoE object dictionary entries. Each entry of a `DeviceParameter` carries a `dataType` field whose value is one of the codes listed here.
212
+ *
213
+ * @name GetDataTypes
214
+ * @summary List all known CoE object dictionary data types
215
+ * @request GET:/api/meta/data-types
216
+ */
217
+ getDataTypes = (params = {}) => this.request({
218
+ path: `/api/meta/data-types`,
219
+ method: "GET",
220
+ format: "json",
221
+ ...params,
222
+ });
223
+ /**
224
+ * @description Enumerates the entire CoE object dictionary of the device at `slavePosition` via the SDO Info service ("Get Object List" → "Get Object Description" → "Get Entry Description") and rebuilds its parameter map. The device must be in PRE-OP, SAFE-OP, or OP (mailbox communication active). On a fully populated drive the call can take several seconds. When `readValues=true` each entry is additionally read via SDO upload and the decoded value is stored on the parameter; entries that fail to read keep their type-appropriate default and the call still succeeds.
225
+ *
226
+ * @name InitializeDeviceParameters
227
+ * @summary Initialise the parameter list for a device by enumerating its object dictionary
228
+ * @request POST:/api/devices/{slavePosition}/parameters/init
229
+ */
230
+ initializeDeviceParameters = (slavePosition, query, params = {}) => this.request({
231
+ path: `/api/devices/${slavePosition}/parameters/init`,
232
+ method: "POST",
233
+ query: query,
234
+ format: "json",
235
+ ...params,
236
+ });
237
+ /**
238
+ * @description Returns the parameter list populated by the most recent call to `POST /api/devices/{slavePosition}/parameters/init`. Empty before the first call. Entries are ordered ascending by `(index, subindex)`.
239
+ *
240
+ * @name GetDeviceParameters
241
+ * @summary Read the previously initialised parameter list for a device
242
+ * @request GET:/api/devices/{slavePosition}/parameters
243
+ */
244
+ getDeviceParameters = (slavePosition, params = {}) => this.request({
245
+ path: `/api/devices/${slavePosition}/parameters`,
246
+ method: "GET",
247
+ format: "json",
248
+ ...params,
249
+ });
250
+ /**
251
+ * @description Reads `length` bytes from the ESC register at `address` on the slave at `slavePosition` using a Configured-Address Read (FPRD) datagram. Pass `address` in decimal (e.g. 272 for DL Status at 0x0110).
252
+ *
253
+ * @name ReadRegister
254
+ * @summary Read bytes from an ESC register
255
+ * @request GET:/api/devices/{slavePosition}/registers/{address}
256
+ */
257
+ readRegister = (slavePosition, address, query, params = {}) => this.request({
258
+ path: `/api/devices/${slavePosition}/registers/${address}`,
259
+ method: "GET",
260
+ query: query,
261
+ format: "json",
262
+ ...params,
263
+ });
264
+ /**
265
+ * @description Writes bytes to the ESC register at `address` on the slave at `slavePosition` using a Configured-Address Write (FPWR) datagram. Pass `address` in decimal (e.g. 272 for DL Status at 0x0110).
266
+ *
267
+ * @name WriteRegister
268
+ * @summary Write bytes to an ESC register
269
+ * @request POST:/api/devices/{slavePosition}/registers/{address}
270
+ */
271
+ writeRegister = (slavePosition, address, data, params = {}) => this.request({
272
+ path: `/api/devices/${slavePosition}/registers/${address}`,
273
+ method: "POST",
274
+ body: data,
275
+ type: ContentType.Json,
276
+ format: "json",
277
+ ...params,
278
+ });
279
+ /**
280
+ * @description Reads the process-data watchdog timeout the slave at `slavePosition` is configured with, decoded from the watchdog divider (0x0400) and process-data watchdog time (0x0420) ESC registers. This is the configured timeout itself, not the expiration counter exposed by `GET /api/devices/diagnostics`. A device in OP that misses process data past this timeout faults itself to SAFE-OP+error; raising it lets a device tolerate the brief PDO pause of a whole-bus re-map.
281
+ *
282
+ * @name GetProcessDataWatchdog
283
+ * @summary Read the process-data (sync-manager) watchdog configuration
284
+ * @request GET:/api/devices/{slavePosition}/watchdog
285
+ */
286
+ getProcessDataWatchdog = (slavePosition, params = {}) => this.request({
287
+ path: `/api/devices/${slavePosition}/watchdog`,
288
+ method: "GET",
289
+ format: "json",
290
+ ...params,
291
+ });
292
+ /**
293
+ * @description Sets the process-data watchdog timeout of the slave at `slavePosition`, writing the process-data watchdog time register (0x0420). The device's watchdog divider (0x0400) is left untouched (it is shared with the PDI watchdog), so the achieved timeout is rounded to that divider's tick base — the response reports the value actually programmed. A `timeoutMs` of 0 disables the watchdog. The write persists across re-maps and re-scans until the ESC reloads EEPROM (power cycle).
294
+ *
295
+ * @name SetProcessDataWatchdog
296
+ * @summary Set the process-data (sync-manager) watchdog timeout
297
+ * @request PUT:/api/devices/{slavePosition}/watchdog
298
+ */
299
+ setProcessDataWatchdog = (slavePosition, data, params = {}) => this.request({
300
+ path: `/api/devices/${slavePosition}/watchdog`,
301
+ method: "PUT",
302
+ body: data,
303
+ type: ContentType.Json,
304
+ format: "json",
305
+ ...params,
306
+ });
307
+ /**
308
+ * @description Performs a CoE SDO upload — reads the value of object `index:subindex` from the device at `slavePosition` and returns the raw bytes as a JSON array. Both `index` and `subindex` accept decimal or hexadecimal notation; prefix with `0x` for hex (e.g. `0x6064` or `24676` for object 0x6064).
309
+ *
310
+ * @name SdoUpload
311
+ * @summary Upload an object dictionary entry from a device (CoE SDO upload)
312
+ * @request GET:/api/devices/{slavePosition}/sdo/{index}/{subindex}
313
+ */
314
+ sdoUpload = (slavePosition, index, subindex, params = {}) => this.request({
315
+ path: `/api/devices/${slavePosition}/sdo/${index}/${subindex}`,
316
+ method: "GET",
317
+ format: "json",
318
+ ...params,
319
+ });
320
+ /**
321
+ * @description Performs a CoE SDO download — writes the raw bytes in the request body to object `index:subindex` on the device at `slavePosition`. The byte count must match the object's length. Requires the device to be in PRE-OP, SAFE-OP, or OP (mailbox communication active). Both `index` and `subindex` accept decimal or hexadecimal notation; prefix with `0x` for hex (e.g. `0x6064` or `24676`).
322
+ *
323
+ * @name SdoDownload
324
+ * @summary Download an object dictionary entry to a device (CoE SDO download)
325
+ * @request PUT:/api/devices/{slavePosition}/sdo/{index}/{subindex}
326
+ */
327
+ sdoDownload = (slavePosition, index, subindex, data, params = {}) => this.request({
328
+ path: `/api/devices/${slavePosition}/sdo/${index}/${subindex}`,
329
+ method: "PUT",
330
+ body: data,
331
+ type: ContentType.Json,
332
+ format: "json",
333
+ ...params,
334
+ });
335
+ /**
336
+ * @description Sends an FoE read request for `filename` to the device at `slavePosition` and returns the raw file bytes. FoE is available in Boot, Pre-Op, Safe-Op, and Op states (device-dependent); the caller is responsible for ensuring the device is in a suitable state before calling. The call blocks until the full file has been received or a per-packet timeout of 700 ms is exceeded.
337
+ *
338
+ * @name FoeReadFile
339
+ * @summary Read a file from a device via FoE (File over EtherCAT)
340
+ * @request GET:/api/devices/{slavePosition}/files/{filename}
341
+ */
342
+ foeReadFile = (slavePosition, filename, params = {}) => this.request({
343
+ path: `/api/devices/${slavePosition}/files/${filename}`,
344
+ method: "GET",
345
+ ...params,
346
+ });
347
+ /**
348
+ * @description Sends an FoE write request for `filename` to the device at `slavePosition`, streaming the raw request body as the file contents. FoE is available in Boot, Pre-Op, Safe-Op, and Op states (device-dependent); the caller is responsible for ensuring the device is in a suitable state before calling.
349
+ *
350
+ * @name FoeWriteFile
351
+ * @summary Write a file to a device via FoE (File over EtherCAT)
352
+ * @request PUT:/api/devices/{slavePosition}/files/{filename}
353
+ */
354
+ foeWriteFile = (slavePosition, filename, data, params = {}) => this.request({
355
+ path: `/api/devices/${slavePosition}/files/${filename}`,
356
+ method: "PUT",
357
+ body: data,
358
+ format: "json",
359
+ ...params,
360
+ });
361
+ /**
362
+ * @description Reads the raw SII EEPROM image of the device at `slavePosition` through the ESC's EEPROM-control registers and returns either the parsed structure or the raw bytes, selected by the `Accept` request header. With `Accept: application/json` (or `*\/*`, or no `Accept` header) the parsed `SlaveInformationInterface` is returned — the 128-byte fixed header plus the decoded category section (strings, general info, FMMU/Sync-Manager and PDO defaults, distributed-clock settings). With `Accept: application/octet-stream` the raw EEPROM image is returned unparsed, suitable for a hex dump or archival. EEPROM access is a control-plane operation and is most reliable while the device is in INIT or PRE-OP. String-index fields in the parsed structure (e.g. `general.nameIdx`) are 1-based references into `category.strings`.
363
+ *
364
+ * @name ReadSii
365
+ * @summary Read a device's SII (Slave Information Interface / EEPROM)
366
+ * @request GET:/api/devices/{slavePosition}/sii
367
+ */
368
+ readSii = (slavePosition, params = {}) => this.request({
369
+ path: `/api/devices/${slavePosition}/sii`,
370
+ method: "GET",
371
+ format: "json",
372
+ ...params,
373
+ });
374
+ /**
375
+ * @description Writes the raw SII image in the request body to the device's EEPROM, one 16-bit word at a time. The image is parse-validated first and rejected if it is not a well-formed SII (a guard against bricking the device). **Destructive:** a wrong image can leave the device unidentifiable until re-flashed. The device adopts the new contents only after a **power cycle**, and the write is most reliable while the device is in INIT or PRE-OP. Intended for restoring a previously downloaded image.
376
+ *
377
+ * @name WriteSii
378
+ * @summary Write a raw SII (EEPROM) image to a device
379
+ * @request PUT:/api/devices/{slavePosition}/sii
380
+ */
381
+ writeSii = (slavePosition, data, params = {}) => this.request({
382
+ path: `/api/devices/${slavePosition}/sii`,
383
+ method: "PUT",
384
+ body: data,
385
+ format: "json",
386
+ ...params,
387
+ });
388
+ /**
389
+ * @description Decodes a raw SII EEPROM image supplied in the request body and returns the parsed structure — the same decoder the device read path uses, exposed as a bus-independent utility. No device is involved; the Tools SII page uses this to view previously downloaded `.bin` files offline.
390
+ *
391
+ * @name ParseSii
392
+ * @summary Parse a raw SII (EEPROM) image
393
+ * @request POST:/api/sii/parse
394
+ */
395
+ parseSii = (data, params = {}) => this.request({
396
+ path: `/api/sii/parse`,
397
+ method: "POST",
398
+ body: data,
399
+ format: "json",
400
+ ...params,
401
+ });
402
+ /**
403
+ * @description Reads live link-quality and watchdog diagnostics from each slave's EtherCAT Slave Controller (DL Status 0x0110, error-counter block 0x0300–0x0313, watchdog block 0x0440–0x0443) via FPRD. Counters are 8-bit, saturate at 255, and are cleared only by a power cycle or explicit write — poll this endpoint and watch for a rising delta rather than an absolute value. The per-port counters localise a degrading link to a specific cable/connector; the watchdog counters distinguish a slave that stopped receiving process data from a master-side problem. Omit `positions` to query all discovered devices. Returns 500 for transports without an ESC (e.g. SPoE).
404
+ *
405
+ * @name GetDeviceDiagnostics
406
+ * @summary Read live ESC health diagnostics for devices
407
+ * @request GET:/api/devices/diagnostics
408
+ */
409
+ getDeviceDiagnostics = (query, params = {}) => this.request({
410
+ path: `/api/devices/diagnostics`,
411
+ method: "GET",
412
+ query: query,
413
+ format: "json",
414
+ ...params,
415
+ });
416
+ /**
417
+ * @description Reads each slave's distributed-clock unit live from its EtherCAT Slave Controller (system-time delay 0x0928 and system-time difference 0x092C) via FPRD. The reference clock is the first DC-capable slave; every other DC slave continuously corrects its local clock toward it, and `systemTimeDifference` is the live deviation in nanoseconds. The figure is meaningful only while the bus is exchanging process data in SAFE-OP/OP (the reference time is distributed in the cyclic frame) and converges toward zero as the slaves' drift loops settle — poll this endpoint and watch for a slave whose deviation stays large or grows rather than an absolute value. Non-DC slaves report `dcCapable` false with zeroed values. Omit `positions` to query all discovered devices. Returns 500 for transports without an ESC (e.g. SPoE).
418
+ *
419
+ * @name GetDcSync
420
+ * @summary Read live distributed-clock synchronisation status for devices
421
+ * @request GET:/api/dc-sync
422
+ */
423
+ getDcSync = (query, params = {}) => this.request({
424
+ path: `/api/dc-sync`,
425
+ method: "GET",
426
+ query: query,
427
+ format: "json",
428
+ ...params,
429
+ });
430
+ /**
431
+ * @description Reads the current EtherCAT Application Layer state for one or more devices. Omit the `positions` query parameter to query all discovered devices.
432
+ *
433
+ * @name GetDeviceStates
434
+ * @summary Read current AL state for devices
435
+ * @request GET:/api/devices/state
436
+ */
437
+ getDeviceStates = (query, params = {}) => this.request({
438
+ path: `/api/devices/state`,
439
+ method: "GET",
440
+ query: query,
441
+ format: "json",
442
+ ...params,
443
+ });
444
+ /**
445
+ * @description Commands one or more devices to the requested EtherCAT Application Layer state and blocks until all targeted devices arrive or the timeout elapses. The settled state of every targeted device is then read back and returned in `devices`, each with a `reached` flag; `ok` is true only when every device reached the target. A device that did not reach it carries an `alStatusCode` explaining why. Omit `positions` or pass an empty array to target all discovered devices. State values are the standard AL state register encodings from ETG.1000.6: 1 (Init), 2 (PreOp), 3 (Boot), 4 (SafeOp), 8 (Op).
446
+ *
447
+ * @name TransitionToState
448
+ * @summary Transition devices to an EtherCAT AL state
449
+ * @request POST:/api/devices/state
450
+ */
451
+ transitionToState = (data, params = {}) => this.request({
452
+ path: `/api/devices/state`,
453
+ method: "POST",
454
+ body: data,
455
+ type: ContentType.Json,
456
+ format: "json",
457
+ ...params,
458
+ });
459
+ /**
460
+ * No description
461
+ *
462
+ * @name GetDevices
463
+ * @summary List all fieldbus devices
464
+ * @request GET:/api/devices
465
+ */
466
+ getDevices = (params = {}) => this.request({
467
+ path: `/api/devices`,
468
+ method: "GET",
469
+ format: "json",
470
+ ...params,
471
+ });
472
+ /**
473
+ * @description Returns the whole-bus process image: the byte sizes of each direction, the expected and last working counters and overall health, the number of retained image generations (one per re-map since the last reset), and every mapped object resolved to its absolute bit offset. While an image is live `configured` is true and the layout describes it. When no image is published (no device is in SAFE-OP/OP) but at least one generation has been mapped, `configured` is false and the layout describes the most recent retained generation — the last-known mapping — so a bus that has dropped out of SAFE-OP/OP stays inspectable; `lastWkc` then holds the final exchange value and working-counter health does not apply. The object lists are empty only before any image has ever been mapped. Object `name` is populated only for devices whose object dictionary has been enumerated.
474
+ *
475
+ * @name GetProcessImage
476
+ * @summary Inspect the published EtherCAT process image
477
+ * @request GET:/api/process-image
478
+ */
479
+ getProcessImage = (params = {}) => this.request({
480
+ path: `/api/process-image`,
481
+ method: "GET",
482
+ format: "json",
483
+ ...params,
484
+ });
485
+ /**
486
+ * @description Streams the same `.mmpd` serialisation as the POST variant (the recorder's current span, with the process image embedded as a header) directly in the response body instead of writing a file — for the client SDK / browser, which parses the bytes offline. Request with `Accept: application/octet-stream`. Same span semantics as the POST; works in any state.
487
+ *
488
+ * @name StreamProcessDataDump
489
+ * @summary Stream the recorder ring as a binary .mmpd
490
+ * @request GET:/api/process-data/dump
491
+ */
492
+ streamProcessDataDump = (params = {}) => this.request({
493
+ path: `/api/process-data/dump`,
494
+ method: "GET",
495
+ ...params,
496
+ });
497
+ /**
498
+ * @description Serialises the process-data recorder's current span — every cycle from the oldest still in the ring up to the newest at the instant of the call — to a `.mmpd` file and returns its path. Each cycle's full raw input and output images, sequence, and epoch-nanosecond timestamp are written, with the process image (per-device identity and PDO object layout, including object names and data types where the object dictionary has been enumerated) embedded as a header, so the file decodes fully offline with no running Motion Master and no live bus. Works in any state: while devices are exchanging (SAFE-OP/OP) it captures tail→head at that moment and ignores cycles recorded afterwards; after the bus has left the exchange states it uses the most recent retained image layout. The file is written under the configured `recorder.dumpDir` (default: a `motion-master` subdirectory of the OS temporary directory), created if absent. Motion Master binds 127.0.0.1, so the file is on the caller's own machine — only the path is returned (there is no download, list, or delete endpoint).
499
+ *
500
+ * @name DumpProcessData
501
+ * @summary Dump the recorder ring to a binary .mmpd file
502
+ * @request POST:/api/process-data/dump
503
+ */
504
+ dumpProcessData = (params = {}) => this.request({
505
+ path: `/api/process-data/dump`,
506
+ method: "POST",
507
+ format: "json",
508
+ ...params,
509
+ });
510
+ /**
511
+ * @description Returns the static ESC configuration the master programmed into every slave during the last scan: station/alias addresses, mapped process-data sizes, the mailbox transport windows, the distributed-clock setup, and the configured Sync Managers and FMMUs. Read from cached state with no bus I/O and valid once the bus has been scanned. The list is empty before any scan, or when the active transport has no ESC (e.g. SPoE). Numeric fields (SM/FMMU type, mailbox protocol bits, SM flags) are raw register values; the client decodes them. `deviceName` is empty when no known device occupies the slave.
512
+ *
513
+ * @name GetBusConfig
514
+ * @summary Inspect each slave's static EtherCAT Slave Controller configuration
515
+ * @request GET:/api/bus-config
516
+ */
517
+ getBusConfig = (params = {}) => this.request({
518
+ path: `/api/bus-config`,
519
+ method: "GET",
520
+ format: "json",
521
+ ...params,
522
+ });
523
+ /**
524
+ * @description Returns every registered monitoring as a resource — its configuration plus, per parameter, how its value is sourced, and the current buffer fill.
525
+ *
526
+ * @name ListMonitorings
527
+ * @summary List all monitorings
528
+ * @request GET:/api/monitorings
529
+ */
530
+ listMonitorings = (params = {}) => this.request({
531
+ path: `/api/monitorings`,
532
+ method: "GET",
533
+ format: "json",
534
+ ...params,
535
+ });
536
+ /**
537
+ * @description Registers a monitoring and starts sampling it off the real-time thread. Each parameter is classified once against the published process image: PDO-mapped objects are decoded from the live image; the rest are polled over SDO in the background. Create monitorings after the bus is operational so PDO objects are recognised as PDO. Monitoring is live-only — a parameter samples `null` while its owning device is not exchanging (SAFE-OP/OP).
538
+ *
539
+ * @name CreateMonitoring
540
+ * @summary Create a monitoring
541
+ * @request POST:/api/monitorings
542
+ */
543
+ createMonitoring = (data, params = {}) => this.request({
544
+ path: `/api/monitorings`,
545
+ method: "POST",
546
+ body: data,
547
+ type: ContentType.Json,
548
+ format: "json",
549
+ ...params,
550
+ });
551
+ /**
552
+ * No description
553
+ *
554
+ * @name GetMonitoring
555
+ * @summary Get a monitoring
556
+ * @request GET:/api/monitorings/{topic}
557
+ */
558
+ getMonitoring = (topic, params = {}) => this.request({
559
+ path: `/api/monitorings/${topic}`,
560
+ method: "GET",
561
+ format: "json",
562
+ ...params,
563
+ });
564
+ /**
565
+ * @description Stops sampling and releases the monitoring's SDO parameters from the shared refresher — an object no remaining monitoring needs stops being polled.
566
+ *
567
+ * @name DeleteMonitoring
568
+ * @summary Delete a monitoring
569
+ * @request DELETE:/api/monitorings/{topic}
570
+ */
571
+ deleteMonitoring = (topic, params = {}) => this.request({
572
+ path: `/api/monitorings/${topic}`,
573
+ method: "DELETE",
574
+ ...params,
575
+ });
576
+ /**
577
+ * @description Returns one entry per cached parameter-definition file on disk, keyed by device identity (vendor, product, revision). The cache stores only the object-dictionary *definitions* (not live values), so a scan of previously-seen hardware can skip the slow SDO enumeration. Independent of the bus — works whether or not a driver is initialised.
578
+ *
579
+ * @name ListParameterCaches
580
+ * @summary List on-disk parameter caches
581
+ * @request GET:/api/parameter-caches
582
+ */
583
+ listParameterCaches = (params = {}) => this.request({
584
+ path: `/api/parameter-caches`,
585
+ method: "GET",
586
+ format: "json",
587
+ ...params,
588
+ });
589
+ /**
590
+ * @description Returns the raw JSON cache file for the given id, verbatim, so it can be saved or inspected offline.
591
+ *
592
+ * @name GetParameterCache
593
+ * @summary Download a parameter-cache file
594
+ * @request GET:/api/parameter-caches/{id}
595
+ */
596
+ getParameterCache = (id, params = {}) => this.request({
597
+ path: `/api/parameter-caches/${id}`,
598
+ method: "GET",
599
+ format: "json",
600
+ ...params,
601
+ });
602
+ /**
603
+ * @description Removes one cached file from disk. The next scan of that hardware re-enumerates it. Useful when a vendor reused a revision across an object-dictionary change.
604
+ *
605
+ * @name DeleteParameterCache
606
+ * @summary Delete a parameter-cache file
607
+ * @request DELETE:/api/parameter-caches/{id}
608
+ */
609
+ deleteParameterCache = (id, params = {}) => this.request({
610
+ path: `/api/parameter-caches/${id}`,
611
+ method: "DELETE",
612
+ ...params,
613
+ });
614
+ }