@ikalogic/at1000 0.4.0 → 0.5.0

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 (128) hide show
  1. package/README.md +23 -0
  2. package/build/{at1000-B3HgANSi.d.mts → at1000-BG_IKvW8.d.mts} +10 -16
  3. package/build/at1000-BG_IKvW8.d.mts.map +1 -0
  4. package/build/at1000-BaJD2vC5.mjs +8 -0
  5. package/build/at1000-BaJD2vC5.mjs.map +1 -0
  6. package/build/{at1000-C6w5G8L4.d.cts → at1000-Bk6QeH1q.d.cts} +10 -16
  7. package/build/at1000-Bk6QeH1q.d.cts.map +1 -0
  8. package/build/at1000-DuULyDOw.cjs +8 -0
  9. package/build/at1000-DuULyDOw.cjs.map +1 -0
  10. package/build/browser.cjs +1 -1
  11. package/build/browser.cjs.map +1 -1
  12. package/build/browser.d.cts +5 -4
  13. package/build/browser.d.cts.map +1 -1
  14. package/build/browser.d.mts +5 -4
  15. package/build/browser.d.mts.map +1 -1
  16. package/build/browser.mjs +1 -1
  17. package/build/browser.mjs.map +1 -1
  18. package/build/{com-BLw4CGid.d.cts → com-B2R6yhB4.d.cts} +47 -43
  19. package/build/com-B2R6yhB4.d.cts.map +1 -0
  20. package/build/{com-BLw4CGid.d.mts → com-B2R6yhB4.d.mts} +47 -43
  21. package/build/com-B2R6yhB4.d.mts.map +1 -0
  22. package/build/com.cjs +1 -1
  23. package/build/com.cjs.map +1 -1
  24. package/build/com.d.cts +1 -1
  25. package/build/com.d.mts +1 -1
  26. package/build/com.mjs +1 -1
  27. package/build/com.mjs.map +1 -1
  28. package/build/common-BSrNhbq_.cjs +2 -0
  29. package/build/{common-BSabSaAU.cjs.map → common-BSrNhbq_.cjs.map} +1 -1
  30. package/build/{common-BY1vXz1l.d.cts → common-Cv6nZZS9.d.cts} +1 -2
  31. package/build/common-Cv6nZZS9.d.cts.map +1 -0
  32. package/build/{common-BY1vXz1l.d.mts → common-Cv6nZZS9.d.mts} +1 -2
  33. package/build/common-Cv6nZZS9.d.mts.map +1 -0
  34. package/build/{events-CBVQfojK.d.cts → events-zRq39ozC.d.cts} +5 -5
  35. package/build/events-zRq39ozC.d.cts.map +1 -0
  36. package/build/{events-CBVQfojK.d.mts → events-zRq39ozC.d.mts} +5 -5
  37. package/build/events-zRq39ozC.d.mts.map +1 -0
  38. package/build/events.cjs +1 -1
  39. package/build/events.d.cts +1 -1
  40. package/build/events.d.mts +1 -1
  41. package/build/events.mjs +1 -1
  42. package/build/{gpio-DgQHE5fr.d.mts → gpio-DThbC_mm.d.mts} +10 -11
  43. package/build/gpio-DThbC_mm.d.mts.map +1 -0
  44. package/build/{gpio-BuvDysYa.d.cts → gpio-xjqg-50L.d.cts} +10 -11
  45. package/build/gpio-xjqg-50L.d.cts.map +1 -0
  46. package/build/gpio.cjs +1 -1
  47. package/build/gpio.cjs.map +1 -1
  48. package/build/gpio.d.cts +2 -2
  49. package/build/gpio.d.mts +2 -2
  50. package/build/{hmi-BrdqKB3o.d.cts → hmi-6SM_R-VX.d.cts} +3 -4
  51. package/build/hmi-6SM_R-VX.d.cts.map +1 -0
  52. package/build/{hmi-BrdqKB3o.d.mts → hmi-6SM_R-VX.d.mts} +3 -4
  53. package/build/hmi-6SM_R-VX.d.mts.map +1 -0
  54. package/build/hmi.cjs +1 -1
  55. package/build/hmi.cjs.map +1 -1
  56. package/build/hmi.d.cts +1 -1
  57. package/build/hmi.d.mts +1 -1
  58. package/build/management.cjs +1 -1
  59. package/build/management.d.cts +14 -7
  60. package/build/management.d.cts.map +1 -1
  61. package/build/management.d.mts +14 -7
  62. package/build/management.d.mts.map +1 -1
  63. package/build/management.mjs +1 -1
  64. package/build/node.cjs +1 -1
  65. package/build/node.cjs.map +1 -1
  66. package/build/node.d.cts +16 -11
  67. package/build/node.d.cts.map +1 -1
  68. package/build/node.d.mts +16 -11
  69. package/build/node.d.mts.map +1 -1
  70. package/build/node.mjs +1 -1
  71. package/build/node.mjs.map +1 -1
  72. package/build/package-ByQuarMd.cjs +2 -0
  73. package/build/package-ByQuarMd.cjs.map +1 -0
  74. package/build/package-gaVXFnhN.mjs +2 -0
  75. package/build/package-gaVXFnhN.mjs.map +1 -0
  76. package/build/{power-FmknBUz2.d.cts → power-CUrqOTyE.d.cts} +10 -11
  77. package/build/power-CUrqOTyE.d.cts.map +1 -0
  78. package/build/{power-HWfK-Ybw.d.mts → power-SmiM6n5O.d.mts} +10 -11
  79. package/build/power-SmiM6n5O.d.mts.map +1 -0
  80. package/build/power.cjs +1 -1
  81. package/build/power.cjs.map +1 -1
  82. package/build/power.d.cts +2 -2
  83. package/build/power.d.mts +2 -2
  84. package/build/{relays-8EGNIK1T.d.cts → relays-TADiLsPk.d.cts} +1 -3
  85. package/build/relays-TADiLsPk.d.cts.map +1 -0
  86. package/build/{relays-8EGNIK1T.d.mts → relays-TADiLsPk.d.mts} +1 -3
  87. package/build/relays-TADiLsPk.d.mts.map +1 -0
  88. package/build/relays.cjs +1 -1
  89. package/build/relays.cjs.map +1 -1
  90. package/build/relays.d.cts +1 -1
  91. package/build/relays.d.mts +1 -1
  92. package/build/{session-D7TpUd6L.d.cts → session-qWW9mqWH.d.cts} +1 -2
  93. package/build/session-qWW9mqWH.d.cts.map +1 -0
  94. package/build/{session-D7TpUd6L.d.mts → session-qWW9mqWH.d.mts} +1 -2
  95. package/build/session-qWW9mqWH.d.mts.map +1 -0
  96. package/build/session.cjs +1 -1
  97. package/build/session.d.cts +1 -1
  98. package/build/session.d.mts +1 -1
  99. package/build/session.mjs +1 -1
  100. package/package.json +2 -2
  101. package/build/at1000-B3HgANSi.d.mts.map +0 -1
  102. package/build/at1000-B_udjy0I.cjs +0 -8
  103. package/build/at1000-B_udjy0I.cjs.map +0 -1
  104. package/build/at1000-BjVj0Ujk.mjs +0 -8
  105. package/build/at1000-BjVj0Ujk.mjs.map +0 -1
  106. package/build/at1000-C6w5G8L4.d.cts.map +0 -1
  107. package/build/com-BLw4CGid.d.cts.map +0 -1
  108. package/build/com-BLw4CGid.d.mts.map +0 -1
  109. package/build/common-BSabSaAU.cjs +0 -2
  110. package/build/common-BY1vXz1l.d.cts.map +0 -1
  111. package/build/common-BY1vXz1l.d.mts.map +0 -1
  112. package/build/events-CBVQfojK.d.cts.map +0 -1
  113. package/build/events-CBVQfojK.d.mts.map +0 -1
  114. package/build/gpio-BuvDysYa.d.cts.map +0 -1
  115. package/build/gpio-DgQHE5fr.d.mts.map +0 -1
  116. package/build/hmi-BrdqKB3o.d.cts.map +0 -1
  117. package/build/hmi-BrdqKB3o.d.mts.map +0 -1
  118. package/build/package-Bcvmz2Lx.cjs +0 -2
  119. package/build/package-Bcvmz2Lx.cjs.map +0 -1
  120. package/build/package-CN49oc-F.mjs +0 -2
  121. package/build/package-CN49oc-F.mjs.map +0 -1
  122. package/build/power-FmknBUz2.d.cts.map +0 -1
  123. package/build/power-HWfK-Ybw.d.mts.map +0 -1
  124. package/build/relays-8EGNIK1T.d.cts.map +0 -1
  125. package/build/relays-8EGNIK1T.d.mts.map +0 -1
  126. package/build/session-D7TpUd6L.d.cts.map +0 -1
  127. package/build/session-D7TpUd6L.d.mts.map +0 -1
  128. /package/build/{chunk-CMqjfN_6.cjs → rolldown-runtime-CMqjfN_6.cjs} +0 -0
package/build/com.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import*as e from"valibot";const t=e.object({id:e.number(),extended_id:e.optional(e.boolean(),!1),rtr:e.optional(e.boolean(),!1),data:e.optional(e.pipe(e.array(e.number()),e.minLength(0),e.maxLength(8)),[]),timeout:e.optional(e.pipe(e.number(),e.integer(),e.minValue(1),e.maxValue(5e3)))}),n=e.pipe(e.union([e.pipe(e.string(),e.maxLength(65536)),e.pipe(e.array(e.pipe(e.number(),e.minValue(0),e.maxValue(255))),e.maxLength(65536))]),e.transform(e=>typeof e==`string`?e.split(``).map(e=>{let t=e.charCodeAt(0);return t>127?63:t}):e)),r=e.object({address:e.number(),start:e.boolean(),stop:e.boolean(),nack_last_byte:e.boolean()}),i=e.intersect([e.partial(r,[`start`,`stop`,`nack_last_byte`]),e.object({length:e.pipe(e.number(),e.minValue(1),e.maxValue(1024))})]),a=e.intersect([e.partial(r,[`start`,`stop`,`nack_last_byte`]),e.object({data:n})]),o=e.object({enabled:e.boolean(),baud_rate:e.picklist([5e3,1e4,2e4,31250,33e3,4e4,5e4,8e4,83300,95e3,1e5,125e3,2e5,25e4,5e5,1e6]),termination_resistors:e.boolean(),rx_filter:e.object({extended_id:e.boolean(),id:e.number(),mask:e.number()})}),s=e.partial(o);e.omit(s,[`enabled`]);const c=e.picklist([`none`,`odd`,`even`,`mark`,`space`]),l=e.picklist([`1`,`1.5`,`2`]),u=e.object({enabled:e.boolean(),baud_rate:e.pipe(e.number(),e.minValue(50),e.maxValue(1e6)),data_bits:e.pipe(e.number(),e.minValue(7),e.maxValue(8)),stop_bits:l,parity:c}),d=e.partial(u);e.omit(d,[`enabled`]);const f=e.object({enabled:e.boolean(),baud_rate:e.pipe(e.number(),e.minValue(300),e.maxValue(2e7)),data_bits:e.pipe(e.number(),e.minValue(7),e.maxValue(8)),stop_bits:l,parity:c,termination_resistors:e.boolean()}),p=e.partial(f);e.omit(p,[`enabled`]);const m=e.object({enabled:e.boolean(),baud_rate:e.pipe(e.number(),e.minValue(300),e.maxValue(1e7)),vcc:e.pipe(e.number(),e.minValue(1.6),e.maxValue(5)),mode:e.pipe(e.number(),e.minValue(0),e.maxValue(3))}),h=e.partial(m);e.omit(h,[`enabled`]);const g=e.object({enabled:e.boolean(),baud_rate:e.picklist([1e5,4e5,1e6]),vcc:e.pipe(e.number(),e.minValue(1.6),e.maxValue(5))}),_=e.partial(g);e.omit(_,[`enabled`]);const v=e.object({enabled:e.boolean(),baud_rate:e.pipe(e.number(),e.minValue(300),e.maxValue(12e6)),vcc:e.pipe(e.number(),e.minValue(1.6),e.maxValue(5)),data_bits:e.pipe(e.number(),e.minValue(7),e.maxValue(8)),stop_bits:l,parity:c}),y=e.partial(v);e.omit(y,[`enabled`]);const b=e.object({number:e.number(),class:e.number(),subclass:e.number(),protocol:e.number(),num_endpoints:e.number()}),x=e.object({vendor_id:e.number(),product_id:e.number(),device_class:e.number(),device_subclass:e.number(),device_protocol:e.number(),usb_version:e.string(),speed:e.string(),manufacturer:e.optional(e.nullable(e.string())),product:e.optional(e.nullable(e.string())),serial_number:e.optional(e.nullable(e.string())),bus:e.number(),port:e.number(),address:e.number(),num_configurations:e.number(),interfaces:e.array(b)}),S=e.object({devices:e.array(x)});var C=class{fetch;constructor(e){this.fetch=e}reset(){return this.fetch(`/com/reset`,{method:`POST`,parseResponse:()=>{}})}can(e){return new T(this.fetch,e)}rs232(e){return new E(this.fetch,e)}rs485(e){return new D(this.fetch,e)}spi(e){return new O(this.fetch,e)}i2c(e){return new k(this.fetch,e)}uart(e){return new A(this.fetch,e)}usb(e){return new w(this.fetch,e)}},w=class{fetch;id;constructor(e,t){this.fetch=e,this.id=t}state(){return this.fetch(`/com/usb/${this.id}/state`,{schema:S})}},T=class{fetch;id;constructor(e,t){this.fetch=e,this.id=t}configure(t){return this.fetch(`/com/can/${this.id}/config`,{method:`PATCH`,body:e.parse(s,t),schema:o})}enable(e={}){return this.configure({...e,enabled:!0})}disable(){return this.configure({enabled:!1})}tx(n){return Array.isArray(n)?this.fetch(`/com/can/${this.id}/write`,{method:`POST`,body:n.map(n=>e.parse(t,n)),schema:e.array(t)}):this.fetch(`/com/can/${this.id}/write`,{method:`POST`,body:e.parse(t,n),schema:t})}start_rx(){return this.fetch(`/com/can/${this.id}/start_rx`,{method:`POST`,parseResponse:()=>{}})}stop_rx(){return this.fetch(`/com/can/${this.id}/stop_rx`,{method:`POST`,parseResponse:()=>{}})}rx(){return this.fetch(`/com/can/${this.id}/read`,{schema:e.array(t)})}},E=class{fetch;id;constructor(e,t){this.fetch=e,this.id=t}configure(t){return this.fetch(`/com/rs232/${this.id}/config`,{method:`PATCH`,body:e.parse(d,t),schema:u})}enable(e={}){return this.configure({...e,enabled:!0})}disable(){return this.configure({enabled:!1})}tx(t){return this.fetch(`/com/rs232/${this.id}/write`,{method:`POST`,body:e.parse(n,t),schema:n})}start_rx(){return this.fetch(`/com/rs232/${this.id}/start_rx`,{method:`POST`,parseResponse:()=>{}})}stop_rx(){return this.fetch(`/com/rs232/${this.id}/stop_rx`,{method:`POST`,parseResponse:()=>{}})}rx(){return this.fetch(`/com/rs232/${this.id}/read`,{schema:n})}},D=class{fetch;id;constructor(e,t){this.fetch=e,this.id=t}configure(t){return this.fetch(`/com/rs485/${this.id}/config`,{method:`PATCH`,body:e.parse(p,t),schema:f})}enable(e={}){return this.configure({...e,enabled:!0})}disable(){return this.configure({enabled:!1})}tx(t){return this.fetch(`/com/rs485/${this.id}/write`,{method:`POST`,body:e.parse(n,t),schema:n})}start_rx(){return this.fetch(`/com/rs485/${this.id}/start_rx`,{method:`POST`,parseResponse:()=>{}})}stop_rx(){return this.fetch(`/com/rs485/${this.id}/stop_rx`,{method:`POST`,parseResponse:()=>{}})}rx(){return this.fetch(`/com/rs485/${this.id}/read`,{schema:n})}},O=class{fetch;id;constructor(e,t){this.fetch=e,this.id=t}configure(t){return this.fetch(`/com/spi/${this.id}/config`,{method:`PATCH`,body:e.parse(h,t),schema:m})}enable(e={}){return this.configure({...e,enabled:!0})}disable(){return this.configure({enabled:!1})}trx(t){return this.fetch(`/com/spi/${this.id}/write_read`,{method:`POST`,body:e.parse(n,t),schema:n})}},k=class{fetch;id;constructor(e,t){this.fetch=e,this.id=t}configure(t){return this.fetch(`/com/i2c/${this.id}/config`,{method:`PATCH`,body:e.parse(_,t),schema:g})}enable(e={}){return this.configure({...e,enabled:!0})}disable(){return this.configure({enabled:!1})}tx(t){return this.fetch(`/com/i2c/${this.id}/write`,{method:`POST`,body:e.parse(a,t),parseResponse:async e=>{let t=await e.text();return parseInt(t,10)}})}rx(t){return this.fetch(`/com/i2c/${this.id}/read`,{method:`POST`,body:e.parse(i,t),schema:n})}},A=class{fetch;id;constructor(e,t){this.fetch=e,this.id=t}configure(t){return this.fetch(`/com/uart/${this.id}/config`,{method:`PATCH`,body:e.parse(y,t),schema:v})}enable(e={}){return this.configure({...e,enabled:!0})}disable(){return this.configure({enabled:!1})}tx(t){return this.fetch(`/com/uart/${this.id}/write`,{method:`POST`,body:e.parse(n,t),schema:n})}start_rx(){return this.fetch(`/com/uart/${this.id}/start_rx`,{method:`POST`,parseResponse:()=>{}})}stop_rx(){return this.fetch(`/com/uart/${this.id}/stop_rx`,{method:`POST`,parseResponse:()=>{}})}rx(){return this.fetch(`/com/uart/${this.id}/read`,{schema:n})}};export{T as Can,C as ComApi,w as ComUsb,k as I2c,E as Rs232,D as Rs485,O as Spi,A as Uart,o as canConfig,t as canFrame,g as i2cConfig,u as rs232Config,f as rs485Config,m as spiConfig,v as uartConfig};
1
+ import*as e from"valibot";const t=e.object({id:e.number(),extended_id:e.optional(e.boolean(),!1),rtr:e.optional(e.boolean(),!1),dlc:e.optional(e.pipe(e.number(),e.integer(),e.minValue(0),e.maxValue(8))),data:e.optional(e.pipe(e.array(e.number()),e.minLength(0),e.maxLength(8)),[]),timeout:e.optional(e.pipe(e.number(),e.integer(),e.minValue(1),e.maxValue(5e3)))}),n=e.pipe(e.union([e.pipe(e.string(),e.maxLength(65536)),e.pipe(e.array(e.pipe(e.number(),e.minValue(0),e.maxValue(255))),e.maxLength(65536))]),e.transform(e=>typeof e==`string`?e.split(``).map(e=>{let t=e.charCodeAt(0);return t>127?63:t}):e)),r=e.object({address:e.number(),start:e.boolean(),stop:e.boolean(),nack_last_byte:e.boolean()}),i=e.intersect([e.partial(r,[`start`,`stop`,`nack_last_byte`]),e.object({length:e.pipe(e.number(),e.minValue(1),e.maxValue(1024))})]),a=e.intersect([e.partial(r,[`start`,`stop`,`nack_last_byte`]),e.object({data:n})]),o=e.object({enabled:e.boolean(),baud_rate:e.picklist([5e3,1e4,2e4,31250,33e3,4e4,5e4,8e4,83300,95e3,1e5,125e3,2e5,25e4,5e5,1e6]),termination_resistors:e.boolean(),rx_filter:e.object({extended_id:e.boolean(),id:e.number(),mask:e.number()})}),s=e.partial(o);e.omit(s,[`enabled`]);const c=e.picklist([`none`,`odd`,`even`,`mark`,`space`]),l=e.picklist([`1`,`1.5`,`2`]),u=e.object({enabled:e.boolean(),baud_rate:e.pipe(e.number(),e.minValue(50),e.maxValue(1e6)),data_bits:e.pipe(e.number(),e.minValue(7),e.maxValue(8)),stop_bits:l,parity:c}),d=e.partial(u);e.omit(d,[`enabled`]);const f=e.object({enabled:e.boolean(),baud_rate:e.pipe(e.number(),e.minValue(300),e.maxValue(2e7)),data_bits:e.pipe(e.number(),e.minValue(7),e.maxValue(8)),stop_bits:l,parity:c,termination_resistors:e.boolean()}),p=e.partial(f);e.omit(p,[`enabled`]);const m=e.object({enabled:e.boolean(),baud_rate:e.pipe(e.number(),e.minValue(300),e.maxValue(1e7)),vcc:e.pipe(e.number(),e.minValue(1.6),e.maxValue(5)),mode:e.pipe(e.number(),e.minValue(0),e.maxValue(3))}),h=e.partial(m);e.omit(h,[`enabled`]);const g=e.object({enabled:e.boolean(),baud_rate:e.picklist([1e5,4e5,1e6]),vcc:e.pipe(e.number(),e.minValue(1.6),e.maxValue(5))}),_=e.partial(g);e.omit(_,[`enabled`]);const v=e.object({enabled:e.boolean(),baud_rate:e.pipe(e.number(),e.minValue(300),e.maxValue(12e6)),vcc:e.pipe(e.number(),e.minValue(1.6),e.maxValue(5)),data_bits:e.pipe(e.number(),e.minValue(7),e.maxValue(8)),stop_bits:l,parity:c}),y=e.partial(v);e.omit(y,[`enabled`]);const b=e.object({number:e.number(),class:e.number(),subclass:e.number(),protocol:e.number(),num_endpoints:e.number()}),x=e.object({vendor_id:e.number(),product_id:e.number(),device_class:e.number(),device_subclass:e.number(),device_protocol:e.number(),usb_version:e.string(),speed:e.string(),manufacturer:e.optional(e.nullable(e.string())),product:e.optional(e.nullable(e.string())),serial_number:e.optional(e.nullable(e.string())),bus:e.number(),port:e.number(),address:e.number(),num_configurations:e.number(),interfaces:e.array(b)}),S=e.object({devices:e.array(x)});var C=class{fetch;constructor(e){this.fetch=e}reset(){return this.fetch(`/com/reset`,{method:`POST`,parseResponse:()=>{}})}can(e){return new T(this.fetch,e)}rs232(e){return new E(this.fetch,e)}rs485(e){return new D(this.fetch,e)}spi(e){return new O(this.fetch,e)}i2c(e){return new k(this.fetch,e)}uart(e){return new A(this.fetch,e)}usb(e){return new w(this.fetch,e)}},w=class{fetch;id;constructor(e,t){this.fetch=e,this.id=t}state(){return this.fetch(`/com/usb/${this.id}/state`,{schema:S})}},T=class{fetch;id;constructor(e,t){this.fetch=e,this.id=t}configure(t){return this.fetch(`/com/can/${this.id}/config`,{method:`PATCH`,body:e.parse(s,t),schema:o})}enable(e={}){return this.configure({...e,enabled:!0})}disable(){return this.configure({enabled:!1})}tx(n){return Array.isArray(n)?this.fetch(`/com/can/${this.id}/write`,{method:`POST`,body:n.map(n=>e.parse(t,n)),schema:e.array(t)}):this.fetch(`/com/can/${this.id}/write`,{method:`POST`,body:e.parse(t,n),schema:t})}start_rx(){return this.fetch(`/com/can/${this.id}/start_rx`,{method:`POST`,parseResponse:()=>{}})}stop_rx(){return this.fetch(`/com/can/${this.id}/stop_rx`,{method:`POST`,parseResponse:()=>{}})}rx(){return this.fetch(`/com/can/${this.id}/read`,{schema:e.array(t)})}},E=class{fetch;id;constructor(e,t){this.fetch=e,this.id=t}configure(t){return this.fetch(`/com/rs232/${this.id}/config`,{method:`PATCH`,body:e.parse(d,t),schema:u})}enable(e={}){return this.configure({...e,enabled:!0})}disable(){return this.configure({enabled:!1})}tx(t){return this.fetch(`/com/rs232/${this.id}/write`,{method:`POST`,body:e.parse(n,t),schema:n})}start_rx(){return this.fetch(`/com/rs232/${this.id}/start_rx`,{method:`POST`,parseResponse:()=>{}})}stop_rx(){return this.fetch(`/com/rs232/${this.id}/stop_rx`,{method:`POST`,parseResponse:()=>{}})}rx(){return this.fetch(`/com/rs232/${this.id}/read`,{schema:n})}},D=class{fetch;id;constructor(e,t){this.fetch=e,this.id=t}configure(t){return this.fetch(`/com/rs485/${this.id}/config`,{method:`PATCH`,body:e.parse(p,t),schema:f})}enable(e={}){return this.configure({...e,enabled:!0})}disable(){return this.configure({enabled:!1})}tx(t){return this.fetch(`/com/rs485/${this.id}/write`,{method:`POST`,body:e.parse(n,t),schema:n})}start_rx(){return this.fetch(`/com/rs485/${this.id}/start_rx`,{method:`POST`,parseResponse:()=>{}})}stop_rx(){return this.fetch(`/com/rs485/${this.id}/stop_rx`,{method:`POST`,parseResponse:()=>{}})}rx(){return this.fetch(`/com/rs485/${this.id}/read`,{schema:n})}},O=class{fetch;id;constructor(e,t){this.fetch=e,this.id=t}configure(t){return this.fetch(`/com/spi/${this.id}/config`,{method:`PATCH`,body:e.parse(h,t),schema:m})}enable(e={}){return this.configure({...e,enabled:!0})}disable(){return this.configure({enabled:!1})}trx(t){return this.fetch(`/com/spi/${this.id}/write_read`,{method:`POST`,body:e.parse(n,t),schema:n})}},k=class{fetch;id;constructor(e,t){this.fetch=e,this.id=t}configure(t){return this.fetch(`/com/i2c/${this.id}/config`,{method:`PATCH`,body:e.parse(_,t),schema:g})}enable(e={}){return this.configure({...e,enabled:!0})}disable(){return this.configure({enabled:!1})}tx(t){return this.fetch(`/com/i2c/${this.id}/write`,{method:`POST`,body:e.parse(a,t),parseResponse:async e=>{let t=await e.text();return parseInt(t,10)}})}rx(t){return this.fetch(`/com/i2c/${this.id}/read`,{method:`POST`,body:e.parse(i,t),schema:n})}},A=class{fetch;id;constructor(e,t){this.fetch=e,this.id=t}configure(t){return this.fetch(`/com/uart/${this.id}/config`,{method:`PATCH`,body:e.parse(y,t),schema:v})}enable(e={}){return this.configure({...e,enabled:!0})}disable(){return this.configure({enabled:!1})}tx(t){return this.fetch(`/com/uart/${this.id}/write`,{method:`POST`,body:e.parse(n,t),schema:n})}start_rx(){return this.fetch(`/com/uart/${this.id}/start_rx`,{method:`POST`,parseResponse:()=>{}})}stop_rx(){return this.fetch(`/com/uart/${this.id}/stop_rx`,{method:`POST`,parseResponse:()=>{}})}rx(){return this.fetch(`/com/uart/${this.id}/read`,{schema:n})}};export{T as Can,C as ComApi,w as ComUsb,k as I2c,E as Rs232,D as Rs485,O as Spi,A as Uart,o as canConfig,t as canFrame,g as i2cConfig,u as rs232Config,f as rs485Config,m as spiConfig,v as uartConfig};
2
2
  //# sourceMappingURL=com.mjs.map
package/build/com.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"com.mjs","names":[],"sources":["../src/api/com.ts"],"sourcesContent":["import type { UpFetch } from 'up-fetch';\nimport * as v from 'valibot';\n\nexport const canFrame = v.object({\n id: v.number(),\n extended_id: v.optional(v.boolean(), false),\n rtr: v.optional(v.boolean(), false),\n data: v.optional(v.pipe(v.array(v.number()), v.minLength(0), v.maxLength(8)), []),\n /** Transmit-only: max ms to wait for a free TX buffer. Omit for the server default (1000 ms). */\n timeout: v.optional(v.pipe(v.number(), v.integer(), v.minValue(1), v.maxValue(5000))),\n});\nexport type CanFrame = v.InferOutput<typeof canFrame>;\nexport type CanFrameInput = v.InferInput<typeof canFrame>;\n\nconst serialData = v.pipe(\n // 1. Validate Input: String OR Array of Bytes (0-255), both max length 65536\n // Server enforces per-endpoint limits (e.g. SPI max transfer = 65536 bytes)\n v.union([\n v.pipe(v.string(), v.maxLength(65536)),\n v.pipe(v.array(v.pipe(v.number(), v.minValue(0), v.maxValue(255))), v.maxLength(65536)),\n ]),\n // 2. Transform: Convert String to ASCII bytes or pass Array as is\n v.transform((input) => {\n if (typeof input === 'string') {\n return input.split('').map((char) => {\n const code = char.charCodeAt(0);\n // Replace UTF8/Non-ASCII (>127) with \"?\" (ASCII 63)\n return code > 127 ? 63 : code;\n });\n }\n return input;\n }),\n);\nexport type SerialData = v.InferOutput<typeof serialData>;\nexport type SerialDataInput = v.InferInput<typeof serialData>;\n\nconst i2cTransactionBase = v.object({\n address: v.number(),\n start: v.boolean(),\n stop: v.boolean(),\n nack_last_byte: v.boolean(),\n});\nconst i2cTransactionRead = v.intersect([\n v.partial(i2cTransactionBase, ['start', 'stop', 'nack_last_byte']),\n v.object({ length: v.pipe(v.number(), v.minValue(1), v.maxValue(1024)) }),\n]);\ntype I2cTransactionRead = v.InferOutput<typeof i2cTransactionRead>;\nconst i2cTransactionWrite = v.intersect([\n v.partial(i2cTransactionBase, ['start', 'stop', 'nack_last_byte']),\n v.object({ data: serialData }),\n]);\ntype I2cTransactionWrite = v.InferOutput<typeof i2cTransactionWrite>;\n\nexport const canConfig = v.object({\n enabled: v.boolean(),\n baud_rate: v.picklist([5_000, 10_000, 20_000, 31_250, 33_000, 40_000, 50_000, 80_000, 83_300,\n 95_000, 100_000, 125_000, 200_000, 250_000, 500_000, 1_000_000]),\n termination_resistors: v.boolean(),\n rx_filter: v.object({ extended_id: v.boolean(), id: v.number(), mask: v.number() }),\n});\nexport type CanConfig = v.InferOutput<typeof canConfig>;\nconst canConfigPatch = v.partial(canConfig);\nexport type CanConfigPatch = v.InferOutput<typeof canConfigPatch>;\nconst canEnableConfig = v.omit(canConfigPatch, ['enabled']);\nexport type CanEnableConfig = v.InferOutput<typeof canEnableConfig>;\n\nconst serialParity = v.picklist(['none', 'odd', 'even', 'mark', 'space']);\nexport type SerialParity = v.InferOutput<typeof serialParity>;\n\nconst serialStopBits = v.picklist(['1', '1.5', '2']);\nexport type SerialStopBits = v.InferOutput<typeof serialStopBits>;\n\nexport const rs232Config = v.object({\n enabled: v.boolean(),\n baud_rate: v.pipe(v.number(), v.minValue(50), v.maxValue(1_000_000)),\n data_bits: v.pipe(v.number(), v.minValue(7), v.maxValue(8)),\n stop_bits: serialStopBits,\n parity: serialParity,\n});\nexport type Rs232Config = v.InferOutput<typeof rs232Config>;\nconst rs232ConfigPatch = v.partial(rs232Config);\nexport type Rs232ConfigPatch = v.InferOutput<typeof rs232ConfigPatch>;\nconst rs232EnableConfig = v.omit(rs232ConfigPatch, ['enabled']);\nexport type Rs232EnableConfig = v.InferOutput<typeof rs232EnableConfig>;\n\nexport const rs485Config = v.object({\n enabled: v.boolean(),\n baud_rate: v.pipe(v.number(), v.minValue(300), v.maxValue(20_000_000)),\n data_bits: v.pipe(v.number(), v.minValue(7), v.maxValue(8)),\n stop_bits: serialStopBits,\n parity: serialParity,\n termination_resistors: v.boolean(),\n});\nexport type Rs485Config = v.InferOutput<typeof rs485Config>;\nconst rs485ConfigPatch = v.partial(rs485Config);\nexport type Rs485ConfigPatch = v.InferOutput<typeof rs485ConfigPatch>;\nconst rs485EnableConfig = v.omit(rs485ConfigPatch, ['enabled']);\nexport type Rs485EnableConfig = v.InferOutput<typeof rs485EnableConfig>;\n\nexport const spiConfig = v.object({\n enabled: v.boolean(),\n baud_rate: v.pipe(v.number(), v.minValue(300), v.maxValue(10_000_000)),\n vcc: v.pipe(v.number(), v.minValue(1.6), v.maxValue(5)),\n mode: v.pipe(v.number(), v.minValue(0), v.maxValue(3)),\n});\nexport type SpiConfig = v.InferOutput<typeof spiConfig>;\nconst spiConfigPatch = v.partial(spiConfig);\nexport type SpiConfigPatch = v.InferOutput<typeof spiConfigPatch>;\nconst spiEnableConfig = v.omit(spiConfigPatch, ['enabled']);\nexport type SpiEnableConfig = v.InferOutput<typeof spiEnableConfig>;\n\nexport const i2cConfig = v.object({\n enabled: v.boolean(),\n baud_rate: v.picklist([100_000, 400_000, 1_000_000]),\n vcc: v.pipe(v.number(), v.minValue(1.6), v.maxValue(5)),\n});\nexport type I2cConfig = v.InferOutput<typeof i2cConfig>;\nconst i2cConfigPatch = v.partial(i2cConfig);\nexport type I2cConfigPatch = v.InferOutput<typeof i2cConfigPatch>;\nconst i2cEnableConfig = v.omit(i2cConfigPatch, ['enabled']);\nexport type I2cEnableConfig = v.InferOutput<typeof i2cEnableConfig>;\n\nexport const uartConfig = v.object({\n enabled: v.boolean(),\n baud_rate: v.pipe(v.number(), v.minValue(300), v.maxValue(12_000_000)),\n vcc: v.pipe(v.number(), v.minValue(1.6), v.maxValue(5)),\n data_bits: v.pipe(v.number(), v.minValue(7), v.maxValue(8)),\n stop_bits: serialStopBits,\n parity: serialParity,\n});\nexport type UartConfig = v.InferOutput<typeof uartConfig>;\nconst uartConfigPatch = v.partial(uartConfig);\nexport type UartConfigPatch = v.InferOutput<typeof uartConfigPatch>;\nconst uartEnableConfig = v.omit(uartConfigPatch, ['enabled']);\nexport type UartEnableConfig = v.InferOutput<typeof uartEnableConfig>;\n\nconst usbInterface = v.object({\n number: v.number(),\n class: v.number(),\n subclass: v.number(),\n protocol: v.number(),\n num_endpoints: v.number(),\n});\nexport type UsbInterface = v.InferOutput<typeof usbInterface>;\n\nconst usbDevice = v.object({\n vendor_id: v.number(),\n product_id: v.number(),\n device_class: v.number(),\n device_subclass: v.number(),\n device_protocol: v.number(),\n usb_version: v.string(),\n speed: v.string(),\n manufacturer: v.optional(v.nullable(v.string())),\n product: v.optional(v.nullable(v.string())),\n serial_number: v.optional(v.nullable(v.string())),\n bus: v.number(),\n port: v.number(),\n address: v.number(),\n num_configurations: v.number(),\n interfaces: v.array(usbInterface),\n});\nexport type UsbDevice = v.InferOutput<typeof usbDevice>;\n\nconst usbState = v.object({ devices: v.array(usbDevice) });\nexport type UsbState = v.InferOutput<typeof usbState>;\n\n/** @hideconstructor */\nexport class ComApi {\n constructor(private readonly fetch: UpFetch) {}\n\n /**\n * Resets the communication interfaces.\n */\n reset(): Promise<void> {\n return this.fetch('/com/reset', { method: 'POST', parseResponse: () => {} });\n }\n\n /**\n * Access a specific CAN interface by id.\n * @param id The CAN interface id.\n * @returns The CAN instance.\n */\n can(id: number): Can {\n return new Can(this.fetch, id);\n }\n\n /**\n * Access a specific RS232 interface by id.\n * @param id The RS232 interface id.\n * @returns The RS232 instance.\n */\n rs232(id: number): Rs232 {\n return new Rs232(this.fetch, id);\n }\n\n /**\n * Access a specific RS485 interface by id.\n * @param id The RS485 interface id.\n * @returns The RS485 instance.\n */\n rs485(id: number): Rs485 {\n return new Rs485(this.fetch, id);\n }\n\n /**\n * Access a specific SPI interface by id.\n * @param id The SPI interface id.\n * @returns The SPI instance.\n */\n spi(id: number): Spi {\n return new Spi(this.fetch, id);\n }\n\n /**\n * Access a specific I2C interface by id.\n * @param id The I2C interface id.\n * @returns The I2C instance.\n */\n i2c(id: number): I2c {\n return new I2c(this.fetch, id);\n }\n\n /**\n * Access a specific UART interface by id.\n * @param id The UART interface id.\n * @returns The UART instance.\n */\n uart(id: number): Uart {\n return new Uart(this.fetch, id);\n }\n\n /**\n * Access a specific USB interface by id.\n * @param id The USB interface id.\n * @returns The ComUsb instance.\n */\n usb(id: number): ComUsb {\n return new ComUsb(this.fetch, id);\n }\n}\n\n/** @hideconstructor */\nexport class ComUsb {\n constructor(private readonly fetch: UpFetch, public readonly id: number) {}\n\n /**\n * Returns the current state of the USB port, including all connected devices.\n * @returns The USB port state with device information.\n */\n state(): Promise<UsbState> {\n return this.fetch(`/com/usb/${this.id}/state`, { schema: usbState });\n }\n}\n\n/** @hideconstructor */\nexport class Can {\n constructor(private readonly fetch: UpFetch, public readonly id: number) {}\n\n /**\n * Configures the CAN interface.\n * @param config The configuration to apply.\n * @returns The updated configuration.\n */\n configure(config: CanConfigPatch): Promise<CanConfig> {\n return this.fetch(`/com/can/${this.id}/config`, {\n method: 'PATCH',\n body: v.parse(canConfigPatch, config),\n schema: canConfig,\n });\n }\n\n /**\n * Enables the CAN interface.\n * @param config Optional configuration to apply while enabling.\n * @returns The updated configuration.\n */\n enable(config: CanEnableConfig = {}): Promise<CanConfig> {\n return this.configure({ ...config, enabled: true });\n }\n\n /**\n * Disables the CAN interface.\n * @returns The updated configuration.\n */\n disable(): Promise<CanConfig> {\n return this.configure({ enabled: false });\n }\n\n /**\n * Transmits one or more frames over the CAN interface.\n *\n * Each frame may carry an optional `timeout` (milliseconds, 1-5000) bounding how\n * long the device waits for a free hardware TX buffer before that frame fails.\n * Omit it to use the server default (1000 ms).\n * @param data A single frame, or an array of frames to transmit as a batch.\n * @returns The transmitted frame, or the array of transmitted frames, mirroring the input.\n */\n tx(data: CanFrameInput): Promise<CanFrame>;\n tx(data: CanFrameInput[]): Promise<CanFrame[]>;\n tx(data: CanFrameInput | CanFrameInput[]): Promise<CanFrame | CanFrame[]> {\n if (Array.isArray(data)) {\n return this.fetch(`/com/can/${this.id}/write`, {\n method: 'POST',\n body: data.map((frame) => v.parse(canFrame, frame)),\n schema: v.array(canFrame),\n });\n }\n return this.fetch(`/com/can/${this.id}/write`, {\n method: 'POST',\n body: v.parse(canFrame, data),\n schema: canFrame,\n });\n }\n\n /**\n * Starts receiving data over the CAN interface.\n */\n start_rx(): Promise<void> {\n return this.fetch(`/com/can/${this.id}/start_rx`, { method: 'POST', parseResponse: () => {} });\n }\n\n /**\n * Stops receiving data over the CAN interface.\n */\n stop_rx(): Promise<void> {\n return this.fetch(`/com/can/${this.id}/stop_rx`, { method: 'POST', parseResponse: () => {} });\n }\n\n /**\n * Reads data from the CAN interface.\n * @returns An array of can frames.\n */\n rx(): Promise<CanFrame[]> {\n return this.fetch(`/com/can/${this.id}/read`, { schema: v.array(canFrame) });\n }\n}\n\n/** @hideconstructor */\nexport class Rs232 {\n constructor(private readonly fetch: UpFetch, public readonly id: number) {}\n\n /**\n * Configures the RS232 interface.\n * @param config The configuration to apply.\n * @returns The updated configuration.\n */\n configure(config: Rs232ConfigPatch): Promise<Rs232Config> {\n return this.fetch(`/com/rs232/${this.id}/config`, {\n method: 'PATCH',\n body: v.parse(rs232ConfigPatch, config),\n schema: rs232Config,\n });\n }\n\n /**\n * Enables the RS232 interface.\n * @param config Optional configuration to apply while enabling.\n * @returns The updated configuration.\n */\n enable(config: Rs232EnableConfig = {}): Promise<Rs232Config> {\n return this.configure({ ...config, enabled: true });\n }\n\n /**\n * Disables the RS232 interface.\n * @returns The updated configuration.\n */\n disable(): Promise<Rs232Config> {\n return this.configure({ enabled: false });\n }\n\n /**\n * Transmits data over the RS232 interface.\n * @param data The data to transmit (byte array or string).\n * @returns The transmitted data.\n */\n tx(data: SerialDataInput): Promise<SerialData> {\n return this.fetch(`/com/rs232/${this.id}/write`, {\n method: 'POST',\n body: v.parse(serialData, data),\n schema: serialData,\n });\n }\n\n /**\n * Starts receiving data over the RS232 interface.\n */\n start_rx(): Promise<void> {\n return this.fetch(`/com/rs232/${this.id}/start_rx`, {\n method: 'POST',\n parseResponse: () => {},\n });\n }\n\n /**\n * Stops receiving data over the RS232 interface.\n */\n stop_rx(): Promise<void> {\n return this.fetch(`/com/rs232/${this.id}/stop_rx`, { method: 'POST', parseResponse: () => {} });\n }\n\n /**\n * Reads data from the RS232 interface.\n * @returns An array containing the received data.\n */\n rx(): Promise<SerialData> {\n return this.fetch(`/com/rs232/${this.id}/read`, { schema: serialData });\n }\n}\n\n/** @hideconstructor */\nexport class Rs485 {\n constructor(private readonly fetch: UpFetch, public readonly id: number) {}\n\n /**\n * Configures the RS485 interface.\n * @param config The configuration to apply.\n * @returns The updated configuration.\n */\n configure(config: Rs485ConfigPatch): Promise<Rs485Config> {\n return this.fetch(`/com/rs485/${this.id}/config`, {\n method: 'PATCH',\n body: v.parse(rs485ConfigPatch, config),\n schema: rs485Config,\n });\n }\n\n /**\n * Enables the RS485 interface.\n * @param config Optional configuration to apply while enabling.\n * @returns The updated configuration.\n */\n enable(config: Rs485EnableConfig = {}): Promise<Rs485Config> {\n return this.configure({ ...config, enabled: true });\n }\n\n /**\n * Disables the RS485 interface.\n * @returns The updated configuration.\n */\n disable(): Promise<Rs485Config> {\n return this.configure({ enabled: false });\n }\n\n /**\n * Transmits data over the RS485 interface.\n * @param data The data to transmit (byte array or string).\n * @returns The transmitted data.\n */\n tx(data: SerialDataInput): Promise<SerialData> {\n return this.fetch(`/com/rs485/${this.id}/write`, {\n method: 'POST',\n body: v.parse(serialData, data),\n schema: serialData,\n });\n }\n\n /**\n * Starts receiving data over the RS485 interface.\n */\n start_rx(): Promise<void> {\n return this.fetch(`/com/rs485/${this.id}/start_rx`, {\n method: 'POST',\n parseResponse: () => {},\n });\n }\n\n /**\n * Stops receiving data over the RS485 interface.\n */\n stop_rx(): Promise<void> {\n return this.fetch(`/com/rs485/${this.id}/stop_rx`, { method: 'POST', parseResponse: () => {} });\n }\n\n /**\n * Reads data from the RS485 interface.\n * @returns The received data.\n */\n rx(): Promise<SerialData> {\n return this.fetch(`/com/rs485/${this.id}/read`, { schema: serialData });\n }\n}\n\n/** @hideconstructor */\nexport class Spi {\n constructor(private readonly fetch: UpFetch, public readonly id: number) {}\n\n /**\n * Configures the SPI interface.\n * @param config The configuration to apply.\n * @returns The updated configuration.\n */\n configure(config: SpiConfigPatch): Promise<SpiConfig> {\n return this.fetch(`/com/spi/${this.id}/config`, {\n method: 'PATCH',\n body: v.parse(spiConfigPatch, config),\n schema: spiConfig,\n });\n }\n\n /**\n * Enables the SPI interface.\n * @param config Optional configuration to apply while enabling.\n * @returns The updated configuration.\n */\n enable(config: SpiEnableConfig = {}): Promise<SpiConfig> {\n return this.configure({ ...config, enabled: true });\n }\n\n /**\n * Disables the SPI interface.\n * @returns The updated configuration.\n */\n disable(): Promise<SpiConfig> {\n return this.configure({ enabled: false });\n }\n\n /**\n * Transmits data over the SPI interface and receives the response.\n * @param data The data to transmit (byte array or string).\n * @returns The received response data.\n */\n trx(data: SerialDataInput): Promise<SerialData> {\n return this.fetch(`/com/spi/${this.id}/write_read`, {\n method: 'POST',\n body: v.parse(serialData, data),\n schema: serialData,\n });\n }\n}\n\n/** @hideconstructor */\nexport class I2c {\n constructor(private readonly fetch: UpFetch, public readonly id: number) {}\n\n /**\n * Configures the I2C interface.\n * @param config The configuration to apply.\n * @returns The updated configuration.\n */\n configure(config: I2cConfigPatch): Promise<I2cConfig> {\n return this.fetch(`/com/i2c/${this.id}/config`, {\n method: 'PATCH',\n body: v.parse(i2cConfigPatch, config),\n schema: i2cConfig,\n });\n }\n\n /**\n * Enables the I2C interface.\n * @param config Optional configuration to apply while enabling.\n * @returns The updated configuration.\n */\n enable(config: I2cEnableConfig = {}): Promise<I2cConfig> {\n return this.configure({ ...config, enabled: true });\n }\n\n /**\n * Disables the I2C interface.\n * @returns The updated configuration.\n */\n disable(): Promise<I2cConfig> {\n return this.configure({ enabled: false });\n }\n\n tx(transaction: I2cTransactionWrite): Promise<number> {\n return this.fetch(`/com/i2c/${this.id}/write`, {\n method: 'POST',\n body: v.parse(i2cTransactionWrite, transaction),\n parseResponse: async (response) => {\n const text = await response.text();\n return parseInt(text, 10);\n },\n });\n }\n\n rx(transaction: I2cTransactionRead): Promise<SerialData> {\n return this.fetch(`/com/i2c/${this.id}/read`, {\n method: 'POST',\n body: v.parse(i2cTransactionRead, transaction),\n schema: serialData,\n });\n }\n}\n\n/** @hideconstructor */\nexport class Uart {\n constructor(private readonly fetch: UpFetch, public readonly id: number) {}\n\n /**\n * Configures the UART interface.\n * @param config The configuration to apply.\n * @returns The updated configuration.\n */\n configure(config: UartConfigPatch): Promise<UartConfig> {\n return this.fetch(`/com/uart/${this.id}/config`, {\n method: 'PATCH',\n body: v.parse(uartConfigPatch, config),\n schema: uartConfig,\n });\n }\n\n /**\n * Enables the UART interface.\n * @param config Optional configuration to apply while enabling.\n * @returns The updated configuration.\n */\n enable(config: UartEnableConfig = {}): Promise<UartConfig> {\n return this.configure({ ...config, enabled: true });\n }\n\n /**\n * Disables the UART interface.\n * @returns The updated configuration.\n */\n disable(): Promise<UartConfig> {\n return this.configure({ enabled: false });\n }\n\n /**\n * Transmits data over the UART interface.\n * @param data The data to transmit (byte array or string).\n * @returns The received response data.\n */\n tx(data: SerialDataInput): Promise<SerialData> {\n return this.fetch(`/com/uart/${this.id}/write`, {\n method: 'POST',\n body: v.parse(serialData, data),\n schema: serialData,\n });\n }\n\n /**\n * Starts receiving data over the UART interface.\n */\n start_rx(): Promise<void> {\n return this.fetch(`/com/uart/${this.id}/start_rx`, { method: 'POST', parseResponse: () => {} });\n }\n\n /**\n * Stops receiving data over the UART interface.\n */\n stop_rx(): Promise<void> {\n return this.fetch(`/com/uart/${this.id}/stop_rx`, { method: 'POST', parseResponse: () => {} });\n }\n\n /**\n * Reads data from the UART interface.\n * @returns The received data.\n */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AU,EAA8C,CACtD,OAAO,KAAK,MAAM,aAAa,KAAK,GAAG,SAAU,CAC/C,OAAQ,QACR,KAAM,EAAE,MAAM,EAAiB,CAAM,EACrC,OAAQ,CACV,CAAC,CACH,CAOA,OAAO,EAA2B,CAAC,EAAwB,CACzD,OAAO,KAAK,UAAU,CAAE,GAAG,EAAQ,QAAS,EAAK,CAAC,CACpD,CAMA,SAA+B,CAC7B,OAAO,KAAK,UAAU,CAAE,QAAS,EAAM,CAAC,CAC1C,CAOA,GAAG,EAA4C,CAC7C,OAAO,KAAK,MAAM,aAAa,KAAK,GAAG,QAAS,CAC9C,OAAQ,OACR,KAAM,EAAE,MAAM,EAAY,CAAI,EAC9B,OAAQ,CACV,CAAC,CACH,CAKA,UAA0B,CACxB,OAAO,KAAK,MAAM,aAAa,KAAK,GAAG,WAAY,CAAE,OAAQ,OAAQ,kBAAqB,CAAC,CAAE,CAAC,CAChG,CAKA,SAAyB,CACvB,OAAO,KAAK,MAAM,aAAa,KAAK,GAAG,UAAW,CAAE,OAAQ,OAAQ,kBAAqB,CAAC,CAAE,CAAC,CAC/F,CAMA,IAA0B,CACxB,OAAO,KAAK,MAAM,aAAa,KAAK,GAAG,OAAQ,CAAE,OAAQ,CAAW,CAAC,CACvE,CACF"}
1
+ {"version":3,"file":"com.mjs","names":[],"sources":["../src/api/com.ts"],"sourcesContent":["import type { UpFetch } from 'up-fetch';\nimport * as v from 'valibot';\n\nexport const canFrame = v.object({\n id: v.number(),\n extended_id: v.optional(v.boolean(), false),\n rtr: v.optional(v.boolean(), false),\n /** RTR-only: requested data length (0-8). The server rejects `dlc` on data frames and non-empty `data` on RTR frames. */\n dlc: v.optional(v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(8))),\n data: v.optional(v.pipe(v.array(v.number()), v.minLength(0), v.maxLength(8)), []),\n /** Transmit-only: max ms to wait for a free TX buffer. Omit for the server default (1000 ms). */\n timeout: v.optional(v.pipe(v.number(), v.integer(), v.minValue(1), v.maxValue(5000))),\n});\nexport type CanFrame = v.InferOutput<typeof canFrame>;\nexport type CanFrameInput = v.InferInput<typeof canFrame>;\n\nconst serialData = v.pipe(\n // 1. Validate Input: String OR Array of Bytes (0-255), both max length 65536\n // Server enforces per-endpoint limits (e.g. SPI max transfer = 65536 bytes)\n v.union([\n v.pipe(v.string(), v.maxLength(65536)),\n v.pipe(v.array(v.pipe(v.number(), v.minValue(0), v.maxValue(255))), v.maxLength(65536)),\n ]),\n // 2. Transform: Convert String to ASCII bytes or pass Array as is\n v.transform((input) => {\n if (typeof input === 'string') {\n return input.split('').map((char) => {\n const code = char.charCodeAt(0);\n // Replace UTF8/Non-ASCII (>127) with \"?\" (ASCII 63)\n return code > 127 ? 63 : code;\n });\n }\n return input;\n }),\n);\nexport type SerialData = v.InferOutput<typeof serialData>;\nexport type SerialDataInput = v.InferInput<typeof serialData>;\n\nconst i2cTransactionBase = v.object({\n address: v.number(),\n start: v.boolean(),\n stop: v.boolean(),\n nack_last_byte: v.boolean(),\n});\nconst i2cTransactionRead = v.intersect([\n v.partial(i2cTransactionBase, ['start', 'stop', 'nack_last_byte']),\n v.object({ length: v.pipe(v.number(), v.minValue(1), v.maxValue(1024)) }),\n]);\ntype I2cTransactionRead = v.InferOutput<typeof i2cTransactionRead>;\nconst i2cTransactionWrite = v.intersect([\n v.partial(i2cTransactionBase, ['start', 'stop', 'nack_last_byte']),\n v.object({ data: serialData }),\n]);\ntype I2cTransactionWrite = v.InferOutput<typeof i2cTransactionWrite>;\n\nexport const canConfig = v.object({\n enabled: v.boolean(),\n baud_rate: v.picklist([5_000, 10_000, 20_000, 31_250, 33_000, 40_000, 50_000, 80_000, 83_300,\n 95_000, 100_000, 125_000, 200_000, 250_000, 500_000, 1_000_000]),\n termination_resistors: v.boolean(),\n rx_filter: v.object({ extended_id: v.boolean(), id: v.number(), mask: v.number() }),\n});\nexport type CanConfig = v.InferOutput<typeof canConfig>;\nconst canConfigPatch = v.partial(canConfig);\nexport type CanConfigPatch = v.InferOutput<typeof canConfigPatch>;\nconst canEnableConfig = v.omit(canConfigPatch, ['enabled']);\nexport type CanEnableConfig = v.InferOutput<typeof canEnableConfig>;\n\nconst serialParity = v.picklist(['none', 'odd', 'even', 'mark', 'space']);\nexport type SerialParity = v.InferOutput<typeof serialParity>;\n\nconst serialStopBits = v.picklist(['1', '1.5', '2']);\nexport type SerialStopBits = v.InferOutput<typeof serialStopBits>;\n\nexport const rs232Config = v.object({\n enabled: v.boolean(),\n baud_rate: v.pipe(v.number(), v.minValue(50), v.maxValue(1_000_000)),\n data_bits: v.pipe(v.number(), v.minValue(7), v.maxValue(8)),\n stop_bits: serialStopBits,\n parity: serialParity,\n});\nexport type Rs232Config = v.InferOutput<typeof rs232Config>;\nconst rs232ConfigPatch = v.partial(rs232Config);\nexport type Rs232ConfigPatch = v.InferOutput<typeof rs232ConfigPatch>;\nconst rs232EnableConfig = v.omit(rs232ConfigPatch, ['enabled']);\nexport type Rs232EnableConfig = v.InferOutput<typeof rs232EnableConfig>;\n\nexport const rs485Config = v.object({\n enabled: v.boolean(),\n baud_rate: v.pipe(v.number(), v.minValue(300), v.maxValue(20_000_000)),\n data_bits: v.pipe(v.number(), v.minValue(7), v.maxValue(8)),\n stop_bits: serialStopBits,\n parity: serialParity,\n termination_resistors: v.boolean(),\n});\nexport type Rs485Config = v.InferOutput<typeof rs485Config>;\nconst rs485ConfigPatch = v.partial(rs485Config);\nexport type Rs485ConfigPatch = v.InferOutput<typeof rs485ConfigPatch>;\nconst rs485EnableConfig = v.omit(rs485ConfigPatch, ['enabled']);\nexport type Rs485EnableConfig = v.InferOutput<typeof rs485EnableConfig>;\n\nexport const spiConfig = v.object({\n enabled: v.boolean(),\n baud_rate: v.pipe(v.number(), v.minValue(300), v.maxValue(10_000_000)),\n vcc: v.pipe(v.number(), v.minValue(1.6), v.maxValue(5)),\n mode: v.pipe(v.number(), v.minValue(0), v.maxValue(3)),\n});\nexport type SpiConfig = v.InferOutput<typeof spiConfig>;\nconst spiConfigPatch = v.partial(spiConfig);\nexport type SpiConfigPatch = v.InferOutput<typeof spiConfigPatch>;\nconst spiEnableConfig = v.omit(spiConfigPatch, ['enabled']);\nexport type SpiEnableConfig = v.InferOutput<typeof spiEnableConfig>;\n\nexport const i2cConfig = v.object({\n enabled: v.boolean(),\n baud_rate: v.picklist([100_000, 400_000, 1_000_000]),\n vcc: v.pipe(v.number(), v.minValue(1.6), v.maxValue(5)),\n});\nexport type I2cConfig = v.InferOutput<typeof i2cConfig>;\nconst i2cConfigPatch = v.partial(i2cConfig);\nexport type I2cConfigPatch = v.InferOutput<typeof i2cConfigPatch>;\nconst i2cEnableConfig = v.omit(i2cConfigPatch, ['enabled']);\nexport type I2cEnableConfig = v.InferOutput<typeof i2cEnableConfig>;\n\nexport const uartConfig = v.object({\n enabled: v.boolean(),\n baud_rate: v.pipe(v.number(), v.minValue(300), v.maxValue(12_000_000)),\n vcc: v.pipe(v.number(), v.minValue(1.6), v.maxValue(5)),\n data_bits: v.pipe(v.number(), v.minValue(7), v.maxValue(8)),\n stop_bits: serialStopBits,\n parity: serialParity,\n});\nexport type UartConfig = v.InferOutput<typeof uartConfig>;\nconst uartConfigPatch = v.partial(uartConfig);\nexport type UartConfigPatch = v.InferOutput<typeof uartConfigPatch>;\nconst uartEnableConfig = v.omit(uartConfigPatch, ['enabled']);\nexport type UartEnableConfig = v.InferOutput<typeof uartEnableConfig>;\n\nconst usbInterface = v.object({\n number: v.number(),\n class: v.number(),\n subclass: v.number(),\n protocol: v.number(),\n num_endpoints: v.number(),\n});\nexport type UsbInterface = v.InferOutput<typeof usbInterface>;\n\nconst usbDevice = v.object({\n vendor_id: v.number(),\n product_id: v.number(),\n device_class: v.number(),\n device_subclass: v.number(),\n device_protocol: v.number(),\n usb_version: v.string(),\n speed: v.string(),\n manufacturer: v.optional(v.nullable(v.string())),\n product: v.optional(v.nullable(v.string())),\n serial_number: v.optional(v.nullable(v.string())),\n bus: v.number(),\n port: v.number(),\n address: v.number(),\n num_configurations: v.number(),\n interfaces: v.array(usbInterface),\n});\nexport type UsbDevice = v.InferOutput<typeof usbDevice>;\n\nconst usbState = v.object({ devices: v.array(usbDevice) });\nexport type UsbState = v.InferOutput<typeof usbState>;\n\n/** @hideconstructor */\nexport class ComApi {\n constructor(private readonly fetch: UpFetch) {}\n\n /**\n * Resets the communication interfaces.\n */\n reset(): Promise<void> {\n return this.fetch('/com/reset', { method: 'POST', parseResponse: () => {} });\n }\n\n /**\n * Access a specific CAN interface by id.\n * @param id The CAN interface id.\n * @returns The CAN instance.\n */\n can(id: number): Can {\n return new Can(this.fetch, id);\n }\n\n /**\n * Access a specific RS232 interface by id.\n * @param id The RS232 interface id.\n * @returns The RS232 instance.\n */\n rs232(id: number): Rs232 {\n return new Rs232(this.fetch, id);\n }\n\n /**\n * Access a specific RS485 interface by id.\n * @param id The RS485 interface id.\n * @returns The RS485 instance.\n */\n rs485(id: number): Rs485 {\n return new Rs485(this.fetch, id);\n }\n\n /**\n * Access a specific SPI interface by id.\n * @param id The SPI interface id.\n * @returns The SPI instance.\n */\n spi(id: number): Spi {\n return new Spi(this.fetch, id);\n }\n\n /**\n * Access a specific I2C interface by id.\n * @param id The I2C interface id.\n * @returns The I2C instance.\n */\n i2c(id: number): I2c {\n return new I2c(this.fetch, id);\n }\n\n /**\n * Access a specific UART interface by id.\n * @param id The UART interface id.\n * @returns The UART instance.\n */\n uart(id: number): Uart {\n return new Uart(this.fetch, id);\n }\n\n /**\n * Access a specific USB interface by id.\n * @param id The USB interface id.\n * @returns The ComUsb instance.\n */\n usb(id: number): ComUsb {\n return new ComUsb(this.fetch, id);\n }\n}\n\n/** @hideconstructor */\nexport class ComUsb {\n constructor(private readonly fetch: UpFetch, public readonly id: number) {}\n\n /**\n * Returns the current state of the USB port, including all connected devices.\n * @returns The USB port state with device information.\n */\n state(): Promise<UsbState> {\n return this.fetch(`/com/usb/${this.id}/state`, { schema: usbState });\n }\n}\n\n/** @hideconstructor */\nexport class Can {\n constructor(private readonly fetch: UpFetch, public readonly id: number) {}\n\n /**\n * Configures the CAN interface.\n * @param config The configuration to apply.\n * @returns The updated configuration.\n */\n configure(config: CanConfigPatch): Promise<CanConfig> {\n return this.fetch(`/com/can/${this.id}/config`, {\n method: 'PATCH',\n body: v.parse(canConfigPatch, config),\n schema: canConfig,\n });\n }\n\n /**\n * Enables the CAN interface.\n * @param config Optional configuration to apply while enabling.\n * @returns The updated configuration.\n */\n enable(config: CanEnableConfig = {}): Promise<CanConfig> {\n return this.configure({ ...config, enabled: true });\n }\n\n /**\n * Disables the CAN interface.\n * @returns The updated configuration.\n */\n disable(): Promise<CanConfig> {\n return this.configure({ enabled: false });\n }\n\n /**\n * Transmits one or more frames over the CAN interface.\n *\n * Each frame may carry an optional `timeout` (milliseconds, 1-5000) bounding how\n * long the device waits for a free hardware TX buffer before that frame fails.\n * Omit it to use the server default (1000 ms).\n *\n * RTR frames set `dlc` (0-8) to request a data length instead of carrying `data`.\n * @param data A single frame, or an array of frames to transmit as a batch.\n * @returns The transmitted frame, or the array of transmitted frames, mirroring the input.\n */\n tx(data: CanFrameInput): Promise<CanFrame>;\n tx(data: CanFrameInput[]): Promise<CanFrame[]>;\n tx(data: CanFrameInput | CanFrameInput[]): Promise<CanFrame | CanFrame[]> {\n if (Array.isArray(data)) {\n return this.fetch(`/com/can/${this.id}/write`, {\n method: 'POST',\n body: data.map((frame) => v.parse(canFrame, frame)),\n schema: v.array(canFrame),\n });\n }\n return this.fetch(`/com/can/${this.id}/write`, {\n method: 'POST',\n body: v.parse(canFrame, data),\n schema: canFrame,\n });\n }\n\n /**\n * Starts receiving data over the CAN interface.\n */\n start_rx(): Promise<void> {\n return this.fetch(`/com/can/${this.id}/start_rx`, { method: 'POST', parseResponse: () => {} });\n }\n\n /**\n * Stops receiving data over the CAN interface.\n */\n stop_rx(): Promise<void> {\n return this.fetch(`/com/can/${this.id}/stop_rx`, { method: 'POST', parseResponse: () => {} });\n }\n\n /**\n * Reads data from the CAN interface.\n * @returns An array of can frames.\n */\n rx(): Promise<CanFrame[]> {\n return this.fetch(`/com/can/${this.id}/read`, { schema: v.array(canFrame) });\n }\n}\n\n/** @hideconstructor */\nexport class Rs232 {\n constructor(private readonly fetch: UpFetch, public readonly id: number) {}\n\n /**\n * Configures the RS232 interface.\n * @param config The configuration to apply.\n * @returns The updated configuration.\n */\n configure(config: Rs232ConfigPatch): Promise<Rs232Config> {\n return this.fetch(`/com/rs232/${this.id}/config`, {\n method: 'PATCH',\n body: v.parse(rs232ConfigPatch, config),\n schema: rs232Config,\n });\n }\n\n /**\n * Enables the RS232 interface.\n * @param config Optional configuration to apply while enabling.\n * @returns The updated configuration.\n */\n enable(config: Rs232EnableConfig = {}): Promise<Rs232Config> {\n return this.configure({ ...config, enabled: true });\n }\n\n /**\n * Disables the RS232 interface.\n * @returns The updated configuration.\n */\n disable(): Promise<Rs232Config> {\n return this.configure({ enabled: false });\n }\n\n /**\n * Transmits data over the RS232 interface.\n * @param data The data to transmit (byte array or string).\n * @returns The transmitted data.\n */\n tx(data: SerialDataInput): Promise<SerialData> {\n return this.fetch(`/com/rs232/${this.id}/write`, {\n method: 'POST',\n body: v.parse(serialData, data),\n schema: serialData,\n });\n }\n\n /**\n * Starts receiving data over the RS232 interface.\n */\n start_rx(): Promise<void> {\n return this.fetch(`/com/rs232/${this.id}/start_rx`, {\n method: 'POST',\n parseResponse: () => {},\n });\n }\n\n /**\n * Stops receiving data over the RS232 interface.\n */\n stop_rx(): Promise<void> {\n return this.fetch(`/com/rs232/${this.id}/stop_rx`, { method: 'POST', parseResponse: () => {} });\n }\n\n /**\n * Reads data from the RS232 interface.\n * @returns An array containing the received data.\n */\n rx(): Promise<SerialData> {\n return this.fetch(`/com/rs232/${this.id}/read`, { schema: serialData });\n }\n}\n\n/** @hideconstructor */\nexport class Rs485 {\n constructor(private readonly fetch: UpFetch, public readonly id: number) {}\n\n /**\n * Configures the RS485 interface.\n * @param config The configuration to apply.\n * @returns The updated configuration.\n */\n configure(config: Rs485ConfigPatch): Promise<Rs485Config> {\n return this.fetch(`/com/rs485/${this.id}/config`, {\n method: 'PATCH',\n body: v.parse(rs485ConfigPatch, config),\n schema: rs485Config,\n });\n }\n\n /**\n * Enables the RS485 interface.\n * @param config Optional configuration to apply while enabling.\n * @returns The updated configuration.\n */\n enable(config: Rs485EnableConfig = {}): Promise<Rs485Config> {\n return this.configure({ ...config, enabled: true });\n }\n\n /**\n * Disables the RS485 interface.\n * @returns The updated configuration.\n */\n disable(): Promise<Rs485Config> {\n return this.configure({ enabled: false });\n }\n\n /**\n * Transmits data over the RS485 interface.\n * @param data The data to transmit (byte array or string).\n * @returns The transmitted data.\n */\n tx(data: SerialDataInput): Promise<SerialData> {\n return this.fetch(`/com/rs485/${this.id}/write`, {\n method: 'POST',\n body: v.parse(serialData, data),\n schema: serialData,\n });\n }\n\n /**\n * Starts receiving data over the RS485 interface.\n */\n start_rx(): Promise<void> {\n return this.fetch(`/com/rs485/${this.id}/start_rx`, {\n method: 'POST',\n parseResponse: () => {},\n });\n }\n\n /**\n * Stops receiving data over the RS485 interface.\n */\n stop_rx(): Promise<void> {\n return this.fetch(`/com/rs485/${this.id}/stop_rx`, { method: 'POST', parseResponse: () => {} });\n }\n\n /**\n * Reads data from the RS485 interface.\n * @returns The received data.\n */\n rx(): Promise<SerialData> {\n return this.fetch(`/com/rs485/${this.id}/read`, { schema: serialData });\n }\n}\n\n/** @hideconstructor */\nexport class Spi {\n constructor(private readonly fetch: UpFetch, public readonly id: number) {}\n\n /**\n * Configures the SPI interface.\n * @param config The configuration to apply.\n * @returns The updated configuration.\n */\n configure(config: SpiConfigPatch): Promise<SpiConfig> {\n return this.fetch(`/com/spi/${this.id}/config`, {\n method: 'PATCH',\n body: v.parse(spiConfigPatch, config),\n schema: spiConfig,\n });\n }\n\n /**\n * Enables the SPI interface.\n * @param config Optional configuration to apply while enabling.\n * @returns The updated configuration.\n */\n enable(config: SpiEnableConfig = {}): Promise<SpiConfig> {\n return this.configure({ ...config, enabled: true });\n }\n\n /**\n * Disables the SPI interface.\n * @returns The updated configuration.\n */\n disable(): Promise<SpiConfig> {\n return this.configure({ enabled: false });\n }\n\n /**\n * Transmits data over the SPI interface and receives the response.\n * @param data The data to transmit (byte array or string).\n * @returns The received response data.\n */\n trx(data: SerialDataInput): Promise<SerialData> {\n return this.fetch(`/com/spi/${this.id}/write_read`, {\n method: 'POST',\n body: v.parse(serialData, data),\n schema: serialData,\n });\n }\n}\n\n/** @hideconstructor */\nexport class I2c {\n constructor(private readonly fetch: UpFetch, public readonly id: number) {}\n\n /**\n * Configures the I2C interface.\n * @param config The configuration to apply.\n * @returns The updated configuration.\n */\n configure(config: I2cConfigPatch): Promise<I2cConfig> {\n return this.fetch(`/com/i2c/${this.id}/config`, {\n method: 'PATCH',\n body: v.parse(i2cConfigPatch, config),\n schema: i2cConfig,\n });\n }\n\n /**\n * Enables the I2C interface.\n * @param config Optional configuration to apply while enabling.\n * @returns The updated configuration.\n */\n enable(config: I2cEnableConfig = {}): Promise<I2cConfig> {\n return this.configure({ ...config, enabled: true });\n }\n\n /**\n * Disables the I2C interface.\n * @returns The updated configuration.\n */\n disable(): Promise<I2cConfig> {\n return this.configure({ enabled: false });\n }\n\n tx(transaction: I2cTransactionWrite): Promise<number> {\n return this.fetch(`/com/i2c/${this.id}/write`, {\n method: 'POST',\n body: v.parse(i2cTransactionWrite, transaction),\n parseResponse: async (response) => {\n const text = await response.text();\n return parseInt(text, 10);\n },\n });\n }\n\n rx(transaction: I2cTransactionRead): Promise<SerialData> {\n return this.fetch(`/com/i2c/${this.id}/read`, {\n method: 'POST',\n body: v.parse(i2cTransactionRead, transaction),\n schema: serialData,\n });\n }\n}\n\n/** @hideconstructor */\nexport class Uart {\n constructor(private readonly fetch: UpFetch, public readonly id: number) {}\n\n /**\n * Configures the UART interface.\n * @param config The configuration to apply.\n * @returns The updated configuration.\n */\n configure(config: UartConfigPatch): Promise<UartConfig> {\n return this.fetch(`/com/uart/${this.id}/config`, {\n method: 'PATCH',\n body: v.parse(uartConfigPatch, config),\n schema: uartConfig,\n });\n }\n\n /**\n * Enables the UART interface.\n * @param config Optional configuration to apply while enabling.\n * @returns The updated configuration.\n */\n enable(config: UartEnableConfig = {}): Promise<UartConfig> {\n return this.configure({ ...config, enabled: true });\n }\n\n /**\n * Disables the UART interface.\n * @returns The updated configuration.\n */\n disable(): Promise<UartConfig> {\n return this.configure({ enabled: false });\n }\n\n /**\n * Transmits data over the UART interface.\n * @param data The data to transmit (byte array or string).\n * @returns The received response data.\n */\n tx(data: SerialDataInput): Promise<SerialData> {\n return this.fetch(`/com/uart/${this.id}/write`, {\n method: 'POST',\n body: v.parse(serialData, data),\n schema: serialData,\n });\n }\n\n /**\n * Starts receiving data over the UART interface.\n */\n start_rx(): Promise<void> {\n return this.fetch(`/com/uart/${this.id}/start_rx`, { method: 'POST', parseResponse: () => {} });\n }\n\n /**\n * Stops receiving data over the UART interface.\n */\n stop_rx(): Promise<void> {\n return this.fetch(`/com/uart/${this.id}/stop_rx`, { method: 'POST', parseResponse: () => {} });\n }\n\n /**\n * Reads data from the UART interface.\n * @returns The received data.\n */\n rx(): Promise<SerialData> {\n return this.fetch(`/com/uart/${this.id}/read`, { schema: serialData });\n }\n}\n"],"mappings":"0BAGA,MAAa,EAAW,EAAE,OAAO,CAC/B,GAAI,EAAE,OAAO,EACb,YAAa,EAAE,SAAS,EAAE,QAAQ,EAAG,EAAK,EAC1C,IAAK,EAAE,SAAS,EAAE,QAAQ,EAAG,EAAK,EAElC,IAAK,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAG,EAAE,QAAQ,EAAG,EAAE,SAAS,CAAC,EAAG,EAAE,SAAS,CAAC,CAAC,CAAC,EAC7E,KAAM,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAG,EAAE,UAAU,CAAC,EAAG,EAAE,UAAU,CAAC,CAAC,EAAG,CAAC,CAAC,EAEhF,QAAS,EAAE,SAAS,EAAE,KAAK,EAAE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EAAY,CAAI,EAC9B,OAAQ,CACV,CAAC,CACH,CAKA,UAA0B,CACxB,OAAO,KAAK,MAAM,aAAa,KAAK,GAAG,WAAY,CAAE,OAAQ,OAAQ,kBAAqB,CAAC,CAAE,CAAC,CAChG,CAKA,SAAyB,CACvB,OAAO,KAAK,MAAM,aAAa,KAAK,GAAG,UAAW,CAAE,OAAQ,OAAQ,kBAAqB,CAAC,CAAE,CAAC,CAC/F,CAMA,IAA0B,CACxB,OAAO,KAAK,MAAM,aAAa,KAAK,GAAG,OAAQ,CAAE,OAAQ,CAAW,CAAC,CACvE,CACF"}
@@ -0,0 +1,2 @@
1
+ const e=require("./rolldown-runtime-CMqjfN_6.cjs");let t=require("valibot");t=e.t(t,1);const n=t.pipe(t.number(),t.minValue(-25),t.maxValue(25)),r=t.pipe(t.number(),t.minValue(0),t.maxValue(24)),i=t.pipe(t.union([t.boolean(),t.number()]),t.toBoolean());Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return n}});
2
+ //# sourceMappingURL=common-BSrNhbq_.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"common-BSabSaAU.cjs","names":["v"],"sources":["../src/api/common.ts"],"sourcesContent":["import * as v from 'valibot';\n\nexport const analogLevel = v.pipe(v.number(), v.minValue(-25), v.maxValue(25));\nexport const analogOutputLevel = v.pipe(v.number(), v.minValue(0), v.maxValue(24));\nexport const digitalLevel = v.pipe(v.union([v.boolean(), v.number()]), v.toBoolean());\n\nexport type AnalogLevel = v.InferOutput<typeof analogLevel>;\nexport type AnalogOutputLevel = v.InferOutput<typeof analogOutputLevel>;\nexport type DigitalLevel = v.InferInput<typeof digitalLevel>;\n"],"mappings":"4EAEA,MAAa,EAAcA,EAAE,KAAKA,EAAE,OAAO,EAAGA,EAAE,SAAS,GAAG,EAAGA,EAAE,SAAS,EAAE,CAAC,EAChE,EAAoBA,EAAE,KAAKA,EAAE,OAAO,EAAGA,EAAE,SAAS,CAAC,EAAGA,EAAE,SAAS,EAAE,CAAC,EACpE,EAAeA,EAAE,KAAKA,EAAE,MAAM,CAACA,EAAE,QAAQ,EAAGA,EAAE,OAAO,CAAC,CAAC,EAAGA,EAAE,UAAU,CAAC"}
1
+ {"version":3,"file":"common-BSrNhbq_.cjs","names":["v"],"sources":["../src/api/common.ts"],"sourcesContent":["import * as v from 'valibot';\n\nexport const analogLevel = v.pipe(v.number(), v.minValue(-25), v.maxValue(25));\nexport const analogOutputLevel = v.pipe(v.number(), v.minValue(0), v.maxValue(24));\nexport const digitalLevel = v.pipe(v.union([v.boolean(), v.number()]), v.toBoolean());\n\nexport type AnalogLevel = v.InferOutput<typeof analogLevel>;\nexport type AnalogOutputLevel = v.InferOutput<typeof analogOutputLevel>;\nexport type DigitalLevel = v.InferInput<typeof digitalLevel>;\n"],"mappings":"uFAEA,MAAa,EAAcA,EAAE,KAAKA,EAAE,OAAO,EAAGA,EAAE,SAAS,GAAG,EAAGA,EAAE,SAAS,EAAE,CAAC,EAChE,EAAoBA,EAAE,KAAKA,EAAE,OAAO,EAAGA,EAAE,SAAS,CAAC,EAAGA,EAAE,SAAS,EAAE,CAAC,EACpE,EAAeA,EAAE,KAAKA,EAAE,MAAM,CAACA,EAAE,QAAQ,EAAGA,EAAE,OAAO,CAAC,CAAC,EAAGA,EAAE,UAAU,CAAC"}
@@ -1,8 +1,7 @@
1
1
  import * as v from "valibot";
2
-
3
2
  //#region src/api/common.d.ts
4
3
  declare const analogOutputLevel: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 24, undefined>]>;
5
4
  type AnalogOutputLevel = v.InferOutput<typeof analogOutputLevel>;
6
5
  //#endregion
7
6
  export { AnalogOutputLevel as t };
8
- //# sourceMappingURL=common-BY1vXz1l.d.cts.map
7
+ //# sourceMappingURL=common-Cv6nZZS9.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common-Cv6nZZS9.d.cts","names":[],"sources":["../src/api/common.ts"],"mappings":";;cAGa,mBAAiB,EAAA,yBAAA,EAAA,yBAAA,EAAA,sCAAA,EAAA;KAIlB,oBAAoB,EAAE,mBAAmB"}
@@ -1,8 +1,7 @@
1
1
  import * as v from "valibot";
2
-
3
2
  //#region src/api/common.d.ts
4
3
  declare const analogOutputLevel: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 24, undefined>]>;
5
4
  type AnalogOutputLevel = v.InferOutput<typeof analogOutputLevel>;
6
5
  //#endregion
7
6
  export { AnalogOutputLevel as t };
8
- //# sourceMappingURL=common-BY1vXz1l.d.mts.map
7
+ //# sourceMappingURL=common-Cv6nZZS9.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common-Cv6nZZS9.d.mts","names":[],"sources":["../src/api/common.ts"],"mappings":";;cAGa,mBAAiB,EAAA,yBAAA,EAAA,yBAAA,EAAA,sCAAA,EAAA;KAIlB,oBAAoB,EAAE,mBAAmB"}
@@ -1,5 +1,4 @@
1
1
  import * as v from "valibot";
2
-
3
2
  //#region src/api/events.d.ts
4
3
  declare const eventDataSchemas: {
5
4
  readonly 'com.can_config': v.ObjectSchema<{
@@ -50,6 +49,7 @@ declare const eventDataSchemas: {
50
49
  readonly id: v.NumberSchema<undefined>;
51
50
  readonly extended_id: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
52
51
  readonly rtr: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
52
+ readonly dlc: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 8, undefined>]>, undefined>;
53
53
  readonly data: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.NumberSchema<undefined>, undefined>, v.MinLengthAction<number[], 0, undefined>, v.MaxLengthAction<number[], 8, undefined>]>, readonly []>;
54
54
  readonly timeout: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 5000, undefined>]>, undefined>;
55
55
  }, undefined>, undefined>;
@@ -257,7 +257,7 @@ declare const eventDataSchemas: {
257
257
  enabled: boolean;
258
258
  voltage: number;
259
259
  current: number;
260
- }, v.BooleanIssue | v.NumberIssue | v.ObjectIssue | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25>>;
260
+ }, v.NumberIssue | v.BooleanIssue | v.ObjectIssue | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25>>;
261
261
  readonly "~types"?: {
262
262
  readonly input: {
263
263
  enabled: boolean;
@@ -269,7 +269,7 @@ declare const eventDataSchemas: {
269
269
  voltage: number;
270
270
  current: number;
271
271
  };
272
- readonly issue: v.BooleanIssue | v.NumberIssue | v.ObjectIssue | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25>;
272
+ readonly issue: v.NumberIssue | v.BooleanIssue | v.ObjectIssue | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25>;
273
273
  } | undefined;
274
274
  };
275
275
  readonly 'relays.state': v.ObjectSchema<{
@@ -293,7 +293,7 @@ type PayloadEvent = { [K in keyof EventDataSchemas]: {
293
293
  id?: number;
294
294
  ts: number;
295
295
  data: v.InferOutput<EventDataSchemas[K]>;
296
- } }[keyof EventDataSchemas];
296
+ }; }[keyof EventDataSchemas];
297
297
  type DataLessEvent = {
298
298
  type: (typeof dataLessEvents)[number];
299
299
  id?: number;
@@ -356,4 +356,4 @@ declare class EventsApi {
356
356
  }
357
357
  //#endregion
358
358
  export { EventsApi as i, DeviceEvent as n, EventType as r, AnyDeviceEvent as t };
359
- //# sourceMappingURL=events-CBVQfojK.d.cts.map
359
+ //# sourceMappingURL=events-zRq39ozC.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events-zRq39ozC.d.cts","names":[],"sources":["../src/api/events.ts"],"mappings":";;cAiCM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAuCA;KAgBD,0BAA0B;;KAGnB,kBAAkB,2BAA2B;KAEpD,kBACF,WAAW;EACV,MAAM;EACN;EACA;EACA,MAAM,EAAE,YAAY,iBAAiB;WAEjC;KAEH;EAAkB,cAAc;EAAyB;EAAa;;;KAG/D,cAAc,eAAe;;;;;KAM7B,iBAAiB;EAC3B;EACA;EACA;EACA;;KAIG,iBAAiB;;cAST;mBAUkB;UATrB;mBACS;mBACA;UACT;UACA;UACA;UACA;UACA;EAEqB,YAAA;;MAGzB;;;;;;;EAUE,QAAQ;IAAY;MAAqB;;EAsB/C;;;;;;EAmBA,GAAG,UAAU,WACX,MAAM,GACN,WAAW,OAAO,QAAQ;IAAe,MAAM;;EAEjD,GAAG,WAAW,WAAW,OAAO;;EAqBhC,cAAc,UAAU;UAOhB;UA+DA;UAiBA;UAgDA;UAcA"}
@@ -1,5 +1,4 @@
1
1
  import * as v from "valibot";
2
-
3
2
  //#region src/api/events.d.ts
4
3
  declare const eventDataSchemas: {
5
4
  readonly 'com.can_config': v.ObjectSchema<{
@@ -50,6 +49,7 @@ declare const eventDataSchemas: {
50
49
  readonly id: v.NumberSchema<undefined>;
51
50
  readonly extended_id: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
52
51
  readonly rtr: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
52
+ readonly dlc: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 8, undefined>]>, undefined>;
53
53
  readonly data: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.NumberSchema<undefined>, undefined>, v.MinLengthAction<number[], 0, undefined>, v.MaxLengthAction<number[], 8, undefined>]>, readonly []>;
54
54
  readonly timeout: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 5000, undefined>]>, undefined>;
55
55
  }, undefined>, undefined>;
@@ -257,7 +257,7 @@ declare const eventDataSchemas: {
257
257
  enabled: boolean;
258
258
  voltage: number;
259
259
  current: number;
260
- }, v.BooleanIssue | v.NumberIssue | v.ObjectIssue | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25>>;
260
+ }, v.NumberIssue | v.BooleanIssue | v.ObjectIssue | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25>>;
261
261
  readonly "~types"?: {
262
262
  readonly input: {
263
263
  enabled: boolean;
@@ -269,7 +269,7 @@ declare const eventDataSchemas: {
269
269
  voltage: number;
270
270
  current: number;
271
271
  };
272
- readonly issue: v.BooleanIssue | v.NumberIssue | v.ObjectIssue | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25>;
272
+ readonly issue: v.NumberIssue | v.BooleanIssue | v.ObjectIssue | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25>;
273
273
  } | undefined;
274
274
  };
275
275
  readonly 'relays.state': v.ObjectSchema<{
@@ -293,7 +293,7 @@ type PayloadEvent = { [K in keyof EventDataSchemas]: {
293
293
  id?: number;
294
294
  ts: number;
295
295
  data: v.InferOutput<EventDataSchemas[K]>;
296
- } }[keyof EventDataSchemas];
296
+ }; }[keyof EventDataSchemas];
297
297
  type DataLessEvent = {
298
298
  type: (typeof dataLessEvents)[number];
299
299
  id?: number;
@@ -356,4 +356,4 @@ declare class EventsApi {
356
356
  }
357
357
  //#endregion
358
358
  export { EventsApi as i, DeviceEvent as n, EventType as r, AnyDeviceEvent as t };
359
- //# sourceMappingURL=events-CBVQfojK.d.mts.map
359
+ //# sourceMappingURL=events-zRq39ozC.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events-zRq39ozC.d.mts","names":[],"sources":["../src/api/events.ts"],"mappings":";;cAiCM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAuCA;KAgBD,0BAA0B;;KAGnB,kBAAkB,2BAA2B;KAEpD,kBACF,WAAW;EACV,MAAM;EACN;EACA;EACA,MAAM,EAAE,YAAY,iBAAiB;WAEjC;KAEH;EAAkB,cAAc;EAAyB;EAAa;;;KAG/D,cAAc,eAAe;;;;;KAM7B,iBAAiB;EAC3B;EACA;EACA;EACA;;KAIG,iBAAiB;;cAST;mBAUkB;UATrB;mBACS;mBACA;UACT;UACA;UACA;UACA;UACA;EAEqB,YAAA;;MAGzB;;;;;;;EAUE,QAAQ;IAAY;MAAqB;;EAsB/C;;;;;;EAmBA,GAAG,UAAU,WACX,MAAM,GACN,WAAW,OAAO,QAAQ;IAAe,MAAM;;EAEjD,GAAG,WAAW,WAAW,OAAO;;EAqBhC,cAAc,UAAU;UAOhB;UA+DA;UAiBA;UAgDA;UAcA"}
package/build/events.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./at1000-B_udjy0I.cjs");exports.EventsApi=e.o;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./at1000-DuULyDOw.cjs");exports.EventsApi=e.o;
@@ -1,2 +1,2 @@
1
- import { i as EventsApi, n as DeviceEvent, r as EventType, t as AnyDeviceEvent } from "./events-CBVQfojK.cjs";
1
+ import { i as EventsApi, n as DeviceEvent, r as EventType, t as AnyDeviceEvent } from "./events-zRq39ozC.cjs";
2
2
  export { AnyDeviceEvent, DeviceEvent, EventType, EventsApi };
@@ -1,2 +1,2 @@
1
- import { i as EventsApi, n as DeviceEvent, r as EventType, t as AnyDeviceEvent } from "./events-CBVQfojK.mjs";
1
+ import { i as EventsApi, n as DeviceEvent, r as EventType, t as AnyDeviceEvent } from "./events-zRq39ozC.mjs";
2
2
  export { AnyDeviceEvent, DeviceEvent, EventType, EventsApi };
package/build/events.mjs CHANGED
@@ -1 +1 @@
1
- import{o as e}from"./at1000-BjVj0Ujk.mjs";export{e as EventsApi};
1
+ import{o as e}from"./at1000-BaJD2vC5.mjs";export{e as EventsApi};
@@ -1,8 +1,7 @@
1
- import { t as AnalogOutputLevel } from "./common-BY1vXz1l.mjs";
1
+ import { t as AnalogOutputLevel } from "./common-Cv6nZZS9.mjs";
2
2
  import { Information } from "./management.mjs";
3
3
  import { UpFetch } from "up-fetch";
4
4
  import * as v from "valibot";
5
-
6
5
  //#region src/api/gpio.d.ts
7
6
  declare const analogInputConfiguration: v.ObjectSchema<{
8
7
  readonly mode: v.LiteralSchema<"analog", undefined>;
@@ -57,7 +56,7 @@ declare const partialAnalogOutputConfiguration: Omit<v.ObjectSchema<{
57
56
  }>;
58
57
  readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
59
58
  value?: number | undefined;
60
- }, v.NumberIssue | v.ObjectIssue | v.MinValueIssue<number, 0> | v.MaxValueIssue<number, 24>>;
59
+ }, v.NumberIssue | v.MinValueIssue<number, 0> | v.ObjectIssue | v.MaxValueIssue<number, 24>>;
61
60
  readonly "~types"?: {
62
61
  readonly input: {
63
62
  value?: number | undefined;
@@ -65,7 +64,7 @@ declare const partialAnalogOutputConfiguration: Omit<v.ObjectSchema<{
65
64
  readonly output: {
66
65
  value?: number | undefined;
67
66
  };
68
- readonly issue: v.NumberIssue | v.ObjectIssue | v.MinValueIssue<number, 0> | v.MaxValueIssue<number, 24>;
67
+ readonly issue: v.NumberIssue | v.MinValueIssue<number, 0> | v.ObjectIssue | v.MaxValueIssue<number, 24>;
69
68
  } | undefined;
70
69
  };
71
70
  type PartialAnalogOutputConfiguration = v.InferOutput<typeof partialAnalogOutputConfiguration>;
@@ -142,7 +141,7 @@ declare const partialDigitalOutputConfiguration: Omit<Omit<v.ObjectSchema<{
142
141
  vih: number;
143
142
  vol: number;
144
143
  voh: number;
145
- }, v.BooleanIssue | v.NumberIssue | v.ObjectIssue | v.MinValueIssue<number, 0> | v.UnionIssue<v.BooleanIssue | v.NumberIssue> | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25> | v.MaxValueIssue<number, 24>>;
144
+ }, v.NumberIssue | v.BooleanIssue | v.MinValueIssue<number, 0> | v.ObjectIssue | v.UnionIssue<v.NumberIssue | v.BooleanIssue> | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25> | v.MaxValueIssue<number, 24>>;
146
145
  readonly "~types"?: {
147
146
  readonly input: {
148
147
  value: number | boolean;
@@ -158,7 +157,7 @@ declare const partialDigitalOutputConfiguration: Omit<Omit<v.ObjectSchema<{
158
157
  vol: number;
159
158
  voh: number;
160
159
  };
161
- readonly issue: v.BooleanIssue | v.NumberIssue | v.ObjectIssue | v.MinValueIssue<number, 0> | v.UnionIssue<v.BooleanIssue | v.NumberIssue> | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25> | v.MaxValueIssue<number, 24>;
160
+ readonly issue: v.NumberIssue | v.BooleanIssue | v.MinValueIssue<number, 0> | v.ObjectIssue | v.UnionIssue<v.NumberIssue | v.BooleanIssue> | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25> | v.MaxValueIssue<number, 24>;
162
161
  } | undefined;
163
162
  }, "~types" | "~run" | "~standard" | "entries"> & {
164
163
  readonly entries: {
@@ -187,7 +186,7 @@ declare const partialDigitalOutputConfiguration: Omit<Omit<v.ObjectSchema<{
187
186
  vih?: number | undefined;
188
187
  vol: number;
189
188
  voh: number;
190
- }, v.BooleanIssue | v.NumberIssue | v.ObjectIssue | v.MinValueIssue<number, 0> | v.UnionIssue<v.BooleanIssue | v.NumberIssue> | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25> | v.MaxValueIssue<number, 24>>;
189
+ }, v.NumberIssue | v.BooleanIssue | v.MinValueIssue<number, 0> | v.ObjectIssue | v.UnionIssue<v.NumberIssue | v.BooleanIssue> | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25> | v.MaxValueIssue<number, 24>>;
191
190
  readonly "~types"?: {
192
191
  readonly input: {
193
192
  value: number | boolean;
@@ -203,7 +202,7 @@ declare const partialDigitalOutputConfiguration: Omit<Omit<v.ObjectSchema<{
203
202
  vol: number;
204
203
  voh: number;
205
204
  };
206
- readonly issue: v.BooleanIssue | v.NumberIssue | v.ObjectIssue | v.MinValueIssue<number, 0> | v.UnionIssue<v.BooleanIssue | v.NumberIssue> | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25> | v.MaxValueIssue<number, 24>;
205
+ readonly issue: v.NumberIssue | v.BooleanIssue | v.MinValueIssue<number, 0> | v.ObjectIssue | v.UnionIssue<v.NumberIssue | v.BooleanIssue> | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25> | v.MaxValueIssue<number, 24>;
207
206
  } | undefined;
208
207
  };
209
208
  type PartialDigitalOutputConfiguration = v.InferInput<typeof partialDigitalOutputConfiguration>;
@@ -234,7 +233,7 @@ declare const partialOpenDrainConfiguration: Omit<v.ObjectSchema<{
234
233
  value: boolean;
235
234
  vil: number;
236
235
  vih: number;
237
- }, v.BooleanIssue | v.NumberIssue | v.ObjectIssue | v.UnionIssue<v.BooleanIssue | v.NumberIssue> | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25>>;
236
+ }, v.NumberIssue | v.BooleanIssue | v.ObjectIssue | v.UnionIssue<v.NumberIssue | v.BooleanIssue> | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25>>;
238
237
  readonly "~types"?: {
239
238
  readonly input: {
240
239
  value: number | boolean;
@@ -246,7 +245,7 @@ declare const partialOpenDrainConfiguration: Omit<v.ObjectSchema<{
246
245
  vil: number;
247
246
  vih: number;
248
247
  };
249
- readonly issue: v.BooleanIssue | v.NumberIssue | v.ObjectIssue | v.UnionIssue<v.BooleanIssue | v.NumberIssue> | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25>;
248
+ readonly issue: v.NumberIssue | v.BooleanIssue | v.ObjectIssue | v.UnionIssue<v.NumberIssue | v.BooleanIssue> | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25>;
250
249
  } | undefined;
251
250
  };
252
251
  type PartialOpenDrainConfiguration = v.InferOutput<typeof partialOpenDrainConfiguration>;
@@ -404,4 +403,4 @@ declare class AnalogIO {
404
403
  }
405
404
  //#endregion
406
405
  export { openDrainConfiguration as C, gpioConfiguration as S, analogOutputConfiguration as _, DigitalInputConfiguration as a, digitalOutputConfiguration as b, GpioConfiguration as c, PartialDigitalInputConfiguration as d, PartialDigitalOutputConfiguration as f, analogInputConfiguration as g, SyncState as h, DigitalIO as i, OpenDrainConfiguration as l, SyncConfiguration as m, AnalogInputConfiguration as n, DigitalOutputConfiguration as o, PartialOpenDrainConfiguration as p, AnalogOutputConfiguration as r, GpioApi as s, AnalogIO as t, PartialAnalogOutputConfiguration as u, analogState as v, syncState as w, digitalState as x, digitalInputConfiguration as y };
407
- //# sourceMappingURL=gpio-DgQHE5fr.d.mts.map
406
+ //# sourceMappingURL=gpio-DThbC_mm.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gpio-DThbC_mm.d.mts","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;;;EAanB,YAAY,aAAa,QAAQ;;;;;EAgBjC,aAAa,QAAQ;;;cAMV;mBACkB;WAAgC;EAAhC,YAAA,OAAO,SAAyB;;;;;;EAO7D,gBAAgB,QAAQ,mCAAmC,QAAQ;;;;;;EAgBnE,iBAAiB,QAAQ,oCAAoC,QAAQ;;;;;EAwB/D,QAAQ;;;;;;EASR,MAAM,0BAA0B;;;;;;EActC,qBAAqB,QAAQ,gCAAgC,QAAQ;;;cAa1D;mBACkB;WAAgC;EAAhC,YAAA,OAAO,SAAyB;;;;;;EAO7D,mBAAmB,QAAQ;;;;;;EAa3B,iBAAiB,OAAO,oBAAoB,QAAQ;;;;;EAe9C,QAAQ;;;;;;EASR,MAAM,gBAAgB"}
@@ -1,8 +1,7 @@
1
- import { t as AnalogOutputLevel } from "./common-BY1vXz1l.cjs";
1
+ import { t as AnalogOutputLevel } from "./common-Cv6nZZS9.cjs";
2
2
  import { Information } from "./management.cjs";
3
3
  import { UpFetch } from "up-fetch";
4
4
  import * as v from "valibot";
5
-
6
5
  //#region src/api/gpio.d.ts
7
6
  declare const analogInputConfiguration: v.ObjectSchema<{
8
7
  readonly mode: v.LiteralSchema<"analog", undefined>;
@@ -57,7 +56,7 @@ declare const partialAnalogOutputConfiguration: Omit<v.ObjectSchema<{
57
56
  }>;
58
57
  readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
59
58
  value?: number | undefined;
60
- }, v.NumberIssue | v.ObjectIssue | v.MinValueIssue<number, 0> | v.MaxValueIssue<number, 24>>;
59
+ }, v.NumberIssue | v.MinValueIssue<number, 0> | v.ObjectIssue | v.MaxValueIssue<number, 24>>;
61
60
  readonly "~types"?: {
62
61
  readonly input: {
63
62
  value?: number | undefined;
@@ -65,7 +64,7 @@ declare const partialAnalogOutputConfiguration: Omit<v.ObjectSchema<{
65
64
  readonly output: {
66
65
  value?: number | undefined;
67
66
  };
68
- readonly issue: v.NumberIssue | v.ObjectIssue | v.MinValueIssue<number, 0> | v.MaxValueIssue<number, 24>;
67
+ readonly issue: v.NumberIssue | v.MinValueIssue<number, 0> | v.ObjectIssue | v.MaxValueIssue<number, 24>;
69
68
  } | undefined;
70
69
  };
71
70
  type PartialAnalogOutputConfiguration = v.InferOutput<typeof partialAnalogOutputConfiguration>;
@@ -142,7 +141,7 @@ declare const partialDigitalOutputConfiguration: Omit<Omit<v.ObjectSchema<{
142
141
  vih: number;
143
142
  vol: number;
144
143
  voh: number;
145
- }, v.BooleanIssue | v.NumberIssue | v.ObjectIssue | v.MinValueIssue<number, 0> | v.UnionIssue<v.BooleanIssue | v.NumberIssue> | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25> | v.MaxValueIssue<number, 24>>;
144
+ }, v.NumberIssue | v.BooleanIssue | v.MinValueIssue<number, 0> | v.ObjectIssue | v.UnionIssue<v.NumberIssue | v.BooleanIssue> | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25> | v.MaxValueIssue<number, 24>>;
146
145
  readonly "~types"?: {
147
146
  readonly input: {
148
147
  value: number | boolean;
@@ -158,7 +157,7 @@ declare const partialDigitalOutputConfiguration: Omit<Omit<v.ObjectSchema<{
158
157
  vol: number;
159
158
  voh: number;
160
159
  };
161
- readonly issue: v.BooleanIssue | v.NumberIssue | v.ObjectIssue | v.MinValueIssue<number, 0> | v.UnionIssue<v.BooleanIssue | v.NumberIssue> | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25> | v.MaxValueIssue<number, 24>;
160
+ readonly issue: v.NumberIssue | v.BooleanIssue | v.MinValueIssue<number, 0> | v.ObjectIssue | v.UnionIssue<v.NumberIssue | v.BooleanIssue> | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25> | v.MaxValueIssue<number, 24>;
162
161
  } | undefined;
163
162
  }, "~types" | "~run" | "~standard" | "entries"> & {
164
163
  readonly entries: {
@@ -187,7 +186,7 @@ declare const partialDigitalOutputConfiguration: Omit<Omit<v.ObjectSchema<{
187
186
  vih?: number | undefined;
188
187
  vol: number;
189
188
  voh: number;
190
- }, v.BooleanIssue | v.NumberIssue | v.ObjectIssue | v.MinValueIssue<number, 0> | v.UnionIssue<v.BooleanIssue | v.NumberIssue> | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25> | v.MaxValueIssue<number, 24>>;
189
+ }, v.NumberIssue | v.BooleanIssue | v.MinValueIssue<number, 0> | v.ObjectIssue | v.UnionIssue<v.NumberIssue | v.BooleanIssue> | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25> | v.MaxValueIssue<number, 24>>;
191
190
  readonly "~types"?: {
192
191
  readonly input: {
193
192
  value: number | boolean;
@@ -203,7 +202,7 @@ declare const partialDigitalOutputConfiguration: Omit<Omit<v.ObjectSchema<{
203
202
  vol: number;
204
203
  voh: number;
205
204
  };
206
- readonly issue: v.BooleanIssue | v.NumberIssue | v.ObjectIssue | v.MinValueIssue<number, 0> | v.UnionIssue<v.BooleanIssue | v.NumberIssue> | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25> | v.MaxValueIssue<number, 24>;
205
+ readonly issue: v.NumberIssue | v.BooleanIssue | v.MinValueIssue<number, 0> | v.ObjectIssue | v.UnionIssue<v.NumberIssue | v.BooleanIssue> | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25> | v.MaxValueIssue<number, 24>;
207
206
  } | undefined;
208
207
  };
209
208
  type PartialDigitalOutputConfiguration = v.InferInput<typeof partialDigitalOutputConfiguration>;
@@ -234,7 +233,7 @@ declare const partialOpenDrainConfiguration: Omit<v.ObjectSchema<{
234
233
  value: boolean;
235
234
  vil: number;
236
235
  vih: number;
237
- }, v.BooleanIssue | v.NumberIssue | v.ObjectIssue | v.UnionIssue<v.BooleanIssue | v.NumberIssue> | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25>>;
236
+ }, v.NumberIssue | v.BooleanIssue | v.ObjectIssue | v.UnionIssue<v.NumberIssue | v.BooleanIssue> | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25>>;
238
237
  readonly "~types"?: {
239
238
  readonly input: {
240
239
  value: number | boolean;
@@ -246,7 +245,7 @@ declare const partialOpenDrainConfiguration: Omit<v.ObjectSchema<{
246
245
  vil: number;
247
246
  vih: number;
248
247
  };
249
- readonly issue: v.BooleanIssue | v.NumberIssue | v.ObjectIssue | v.UnionIssue<v.BooleanIssue | v.NumberIssue> | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25>;
248
+ readonly issue: v.NumberIssue | v.BooleanIssue | v.ObjectIssue | v.UnionIssue<v.NumberIssue | v.BooleanIssue> | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25>;
250
249
  } | undefined;
251
250
  };
252
251
  type PartialOpenDrainConfiguration = v.InferOutput<typeof partialOpenDrainConfiguration>;
@@ -404,4 +403,4 @@ declare class AnalogIO {
404
403
  }
405
404
  //#endregion
406
405
  export { openDrainConfiguration as C, gpioConfiguration as S, analogOutputConfiguration as _, DigitalInputConfiguration as a, digitalOutputConfiguration as b, GpioConfiguration as c, PartialDigitalInputConfiguration as d, PartialDigitalOutputConfiguration as f, analogInputConfiguration as g, SyncState as h, DigitalIO as i, OpenDrainConfiguration as l, SyncConfiguration as m, AnalogInputConfiguration as n, DigitalOutputConfiguration as o, PartialOpenDrainConfiguration as p, AnalogOutputConfiguration as r, GpioApi as s, AnalogIO as t, PartialAnalogOutputConfiguration as u, analogState as v, syncState as w, digitalState as x, digitalInputConfiguration as y };
407
- //# sourceMappingURL=gpio-BuvDysYa.d.cts.map
406
+ //# sourceMappingURL=gpio-xjqg-50L.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gpio-xjqg-50L.d.cts","names":[],"sources":["../src/api/gpio.ts"],"mappings":";;;;;cASa,0BAAwB,EAAA;;;;cAIxB,2BAAyB,EAAA;;;;;cAKzB,2BAAyB,EAAA;;;;;;cAMzB,4BAA0B,EAAA;;;;;;;;;cAS1B,wBAAsB,EAAA;;;;;;;KAOvB,2BAA2B,EAAE,mB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EAwB/D,QAAQ;;;;;;EASR,MAAM,0BAA0B;;;;;;EActC,qBAAqB,QAAQ,gCAAgC,QAAQ;;;cAa1D;mBACkB;WAAgC;EAAhC,YAAA,OAAO,SAAyB;;;;;;EAO7D,mBAAmB,QAAQ;;;;;;EAa3B,iBAAiB,OAAO,oBAAoB,QAAQ;;;;;EAe9C,QAAQ;;;;;;EASR,MAAM,gBAAgB"}
package/build/gpio.cjs CHANGED
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./chunk-CMqjfN_6.cjs"),t=require("./common-BSabSaAU.cjs");let n=require("valibot");n=e.t(n,1);const r=n.picklist([`release`,`hold`],`Invalid sync action`),i=n.object({mode:n.literal(`analog`),direction:n.literal(`input`)}),a=n.object({mode:n.literal(`analog`),direction:n.literal(`output`),value:n.optional(t.n)}),o=n.object({mode:n.literal(`digital`),direction:n.literal(`input`),vil:t.t,vih:t.t}),s=n.object({mode:n.literal(`digital`),direction:n.literal(`output`),value:t.r,vol:t.n,voh:t.n,vil:t.t,vih:t.t}),c=n.object({mode:n.literal(`digital`),direction:n.literal(`open_drain`),value:t.r,vil:t.t,vih:t.t});n.omit(a,[`direction`,`mode`]),n.omit(o,[`direction`,`mode`]);const l=n.partial(n.omit(s,[`direction`,`mode`]),[`vih`,`vil`]);n.omit(c,[`direction`,`mode`]);const u=n.object({value:t.r}),d=n.object({value:t.t}),f=n.object({action:r}),p=n.object({hold_state:n.picklist([`held`,`released`])}),m=n.union([s,c,o,a,i]);var h=class{fetch;count;constructor(e,t){this.fetch=e,this.count=t.capabilities.io.count}reset(){return this.fetch(`/gpio/reset`,{method:`POST`,parseResponse:()=>{}})}digital(e){if(e<0||e>=this.count)throw Error(`Invalid GPIO pin ${e} (RESOURCE_NOT_FOUND)\n Suggestion: Use a pin number between 0 and ${this.count-1}\n Path: /gpio/${e}`);return new g(this.fetch,e)}analog(e){if(e<0||e>=this.count)throw Error(`Invalid GPIO pin ${e} (RESOURCE_NOT_FOUND)\n Suggestion: Use a pin number between 0 and ${this.count-1}\n Path: /gpio/${e}`);return new _(this.fetch,e)}hold(){return this.fetch(`/gpio/sync`,{method:`POST`,body:{action:`hold`},schema:f})}release(){return this.fetch(`/gpio/sync`,{method:`POST`,body:{action:`release`},schema:f})}read_config(e){if(e<0||e>=this.count)throw Error(`Invalid GPIO pin ${e} (RESOURCE_NOT_FOUND)\n Suggestion: Use a pin number between 0 and ${this.count-1}\n Path: /gpio/${e}/config`);return this.fetch(`/gpio/${e}/config`,{schema:m})}read_sync(){return this.fetch(`/gpio/sync`,{schema:p})}},g=class{fetch;id;constructor(e,t){this.fetch=e,this.id=t}configure_input(e){return this.fetch(`/gpio/${this.id}/config`,{method:`PATCH`,body:n.parse(o,{...e,mode:`digital`,direction:`input`}),schema:o})}configure_output(e){e=n.parse(l,e);let t={mode:`digital`,direction:`output`,value:e.value,vol:e.vol,voh:e.voh,vil:e.vil??e.vol+(e.voh-e.vol)/4,vih:e.vih??e.voh-(e.voh-e.vol)/4};return this.fetch(`/gpio/${this.id}/config`,{method:`PATCH`,body:n.parse(s,t),schema:s})}async read(){return(await this.fetch(`/gpio/${this.id}/state`,{schema:u})).value}async write(e){return(await this.fetch(`/gpio/${this.id}/state`,{method:`PUT`,body:n.parse(u,{value:e}),schema:u})).value}configure_open_drain(e){return this.fetch(`/gpio/${this.id}/config`,{method:`PATCH`,body:n.parse(c,{...e,mode:`digital`,direction:`open_drain`}),schema:c})}},_=class{fetch;id;constructor(e,t){this.fetch=e,this.id=t}configure_input(){return this.fetch(`/gpio/${this.id}/config`,{method:`PATCH`,body:{mode:`analog`,direction:`input`},schema:i})}configure_output(e){return this.fetch(`/gpio/${this.id}/config`,{method:`PATCH`,body:n.parse(a,{value:e,mode:`analog`,direction:`output`}),schema:a})}async read(){return(await this.fetch(`/gpio/${this.id}/state`,{schema:d})).value}async write(e){return(await this.fetch(`/gpio/${this.id}/state`,{method:`PUT`,body:{value:e},schema:d})).value}};exports.AnalogIO=_,exports.DigitalIO=g,exports.GpioApi=h,exports.analogInputConfiguration=i,exports.analogOutputConfiguration=a,exports.analogState=d,exports.digitalInputConfiguration=o,exports.digitalOutputConfiguration=s,exports.digitalState=u,exports.gpioConfiguration=m,exports.openDrainConfiguration=c,exports.syncState=p;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-CMqjfN_6.cjs"),t=require("./common-BSrNhbq_.cjs");let n=require("valibot");n=e.t(n,1);const r=n.picklist([`release`,`hold`],`Invalid sync action`),i=n.object({mode:n.literal(`analog`),direction:n.literal(`input`)}),a=n.object({mode:n.literal(`analog`),direction:n.literal(`output`),value:n.optional(t.n)}),o=n.object({mode:n.literal(`digital`),direction:n.literal(`input`),vil:t.t,vih:t.t}),s=n.object({mode:n.literal(`digital`),direction:n.literal(`output`),value:t.r,vol:t.n,voh:t.n,vil:t.t,vih:t.t}),c=n.object({mode:n.literal(`digital`),direction:n.literal(`open_drain`),value:t.r,vil:t.t,vih:t.t});n.omit(a,[`direction`,`mode`]),n.omit(o,[`direction`,`mode`]);const l=n.partial(n.omit(s,[`direction`,`mode`]),[`vih`,`vil`]);n.omit(c,[`direction`,`mode`]);const u=n.object({value:t.r}),d=n.object({value:t.t}),f=n.object({action:r}),p=n.object({hold_state:n.picklist([`held`,`released`])}),m=n.union([s,c,o,a,i]);var h=class{fetch;count;constructor(e,t){this.fetch=e,this.count=t.capabilities.io.count}reset(){return this.fetch(`/gpio/reset`,{method:`POST`,parseResponse:()=>{}})}digital(e){if(e<0||e>=this.count)throw Error(`Invalid GPIO pin ${e} (RESOURCE_NOT_FOUND)\n Suggestion: Use a pin number between 0 and ${this.count-1}\n Path: /gpio/${e}`);return new g(this.fetch,e)}analog(e){if(e<0||e>=this.count)throw Error(`Invalid GPIO pin ${e} (RESOURCE_NOT_FOUND)\n Suggestion: Use a pin number between 0 and ${this.count-1}\n Path: /gpio/${e}`);return new _(this.fetch,e)}hold(){return this.fetch(`/gpio/sync`,{method:`POST`,body:{action:`hold`},schema:f})}release(){return this.fetch(`/gpio/sync`,{method:`POST`,body:{action:`release`},schema:f})}read_config(e){if(e<0||e>=this.count)throw Error(`Invalid GPIO pin ${e} (RESOURCE_NOT_FOUND)\n Suggestion: Use a pin number between 0 and ${this.count-1}\n Path: /gpio/${e}/config`);return this.fetch(`/gpio/${e}/config`,{schema:m})}read_sync(){return this.fetch(`/gpio/sync`,{schema:p})}},g=class{fetch;id;constructor(e,t){this.fetch=e,this.id=t}configure_input(e){return this.fetch(`/gpio/${this.id}/config`,{method:`PATCH`,body:n.parse(o,{...e,mode:`digital`,direction:`input`}),schema:o})}configure_output(e){e=n.parse(l,e);let t={mode:`digital`,direction:`output`,value:e.value,vol:e.vol,voh:e.voh,vil:e.vil??e.vol+(e.voh-e.vol)/4,vih:e.vih??e.voh-(e.voh-e.vol)/4};return this.fetch(`/gpio/${this.id}/config`,{method:`PATCH`,body:n.parse(s,t),schema:s})}async read(){return(await this.fetch(`/gpio/${this.id}/state`,{schema:u})).value}async write(e){return(await this.fetch(`/gpio/${this.id}/state`,{method:`PUT`,body:n.parse(u,{value:e}),schema:u})).value}configure_open_drain(e){return this.fetch(`/gpio/${this.id}/config`,{method:`PATCH`,body:n.parse(c,{...e,mode:`digital`,direction:`open_drain`}),schema:c})}},_=class{fetch;id;constructor(e,t){this.fetch=e,this.id=t}configure_input(){return this.fetch(`/gpio/${this.id}/config`,{method:`PATCH`,body:{mode:`analog`,direction:`input`},schema:i})}configure_output(e){return this.fetch(`/gpio/${this.id}/config`,{method:`PATCH`,body:n.parse(a,{value:e,mode:`analog`,direction:`output`}),schema:a})}async read(){return(await this.fetch(`/gpio/${this.id}/state`,{schema:d})).value}async write(e){return(await this.fetch(`/gpio/${this.id}/state`,{method:`PUT`,body:{value:e},schema:d})).value}};exports.AnalogIO=_,exports.DigitalIO=g,exports.GpioApi=h,exports.analogInputConfiguration=i,exports.analogOutputConfiguration=a,exports.analogState=d,exports.digitalInputConfiguration=o,exports.digitalOutputConfiguration=s,exports.digitalState=u,exports.gpioConfiguration=m,exports.openDrainConfiguration=c,exports.syncState=p;
2
2
  //# sourceMappingURL=gpio.cjs.map