@synnaxlabs/client 0.46.1 → 0.48.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 (508) hide show
  1. package/.turbo/turbo-build.log +7 -7
  2. package/dist/client.cjs +35 -35
  3. package/dist/client.js +5053 -4924
  4. package/dist/eslint.config.d.ts +4 -0
  5. package/dist/eslint.config.d.ts.map +1 -0
  6. package/dist/src/access/client.d.ts.map +1 -0
  7. package/dist/src/access/external.d.ts.map +1 -0
  8. package/dist/src/access/index.d.ts.map +1 -0
  9. package/dist/src/access/payload.d.ts.map +1 -0
  10. package/dist/src/access/policy/client.d.ts.map +1 -0
  11. package/dist/src/access/policy/external.d.ts.map +1 -0
  12. package/dist/src/access/policy/index.d.ts.map +1 -0
  13. package/dist/src/access/policy/payload.d.ts.map +1 -0
  14. package/dist/src/access/policy/policy.spec.d.ts.map +1 -0
  15. package/dist/{arc → src/arc}/client.d.ts +17 -2
  16. package/dist/src/arc/client.d.ts.map +1 -0
  17. package/dist/src/arc/external.d.ts.map +1 -0
  18. package/dist/src/arc/index.d.ts.map +1 -0
  19. package/dist/src/arc/lsp.spec.d.ts +2 -0
  20. package/dist/src/arc/lsp.spec.d.ts.map +1 -0
  21. package/dist/{arc → src/arc}/payload.d.ts +11 -9
  22. package/dist/src/arc/payload.d.ts.map +1 -0
  23. package/dist/src/auth/auth.d.ts.map +1 -0
  24. package/dist/{auth → src/auth}/auth.spec.d.ts.map +1 -1
  25. package/dist/src/auth/index.d.ts.map +1 -0
  26. package/dist/src/channel/batchRetriever.spec.d.ts.map +1 -0
  27. package/dist/src/channel/channel.spec.d.ts.map +1 -0
  28. package/dist/{channel → src/channel}/client.d.ts +8 -8
  29. package/dist/src/channel/client.d.ts.map +1 -0
  30. package/dist/src/channel/external.d.ts.map +1 -0
  31. package/dist/src/channel/index.d.ts.map +1 -0
  32. package/dist/src/channel/payload.d.ts +260 -0
  33. package/dist/src/channel/payload.d.ts.map +1 -0
  34. package/dist/{channel → src/channel}/retriever.d.ts +2 -1
  35. package/dist/src/channel/retriever.d.ts.map +1 -0
  36. package/dist/src/channel/writer.d.ts.map +1 -0
  37. package/dist/{client.d.ts → src/client.d.ts} +10 -6
  38. package/dist/src/client.d.ts.map +1 -0
  39. package/dist/{connection → src/connection}/checker.d.ts +3 -4
  40. package/dist/src/connection/checker.d.ts.map +1 -0
  41. package/dist/src/connection/connection.spec.d.ts +2 -0
  42. package/dist/src/connection/connection.spec.d.ts.map +1 -0
  43. package/dist/src/connection/index.d.ts.map +1 -0
  44. package/dist/src/connection.spec.d.ts.map +1 -0
  45. package/dist/src/control/client.d.ts.map +1 -0
  46. package/dist/src/control/external.d.ts.map +1 -0
  47. package/dist/src/control/index.d.ts.map +1 -0
  48. package/dist/{control → src/control}/state.d.ts +1 -2
  49. package/dist/src/control/state.d.ts.map +1 -0
  50. package/dist/{control → src/control}/state.spec.d.ts.map +1 -1
  51. package/dist/src/errors.d.ts.map +1 -0
  52. package/dist/{errors.spec.d.ts.map → src/errors.spec.d.ts.map} +1 -1
  53. package/dist/{framer → src/framer}/adapter.d.ts +3 -3
  54. package/dist/src/framer/adapter.d.ts.map +1 -0
  55. package/dist/src/framer/adapter.spec.d.ts.map +1 -0
  56. package/dist/src/framer/client.d.ts.map +1 -0
  57. package/dist/src/framer/client.spec.d.ts.map +1 -0
  58. package/dist/src/framer/codec.d.ts.map +1 -0
  59. package/dist/{framer → src/framer}/codec.spec.d.ts.map +1 -1
  60. package/dist/src/framer/deleter.d.ts.map +1 -0
  61. package/dist/src/framer/deleter.spec.d.ts.map +1 -0
  62. package/dist/{framer → src/framer}/external.d.ts +1 -0
  63. package/dist/src/framer/external.d.ts.map +1 -0
  64. package/dist/{framer → src/framer}/frame.d.ts +5 -4
  65. package/dist/src/framer/frame.d.ts.map +1 -0
  66. package/dist/{framer → src/framer}/frame.spec.d.ts.map +1 -1
  67. package/dist/src/framer/index.d.ts.map +1 -0
  68. package/dist/{framer → src/framer}/iterator.d.ts +1 -2
  69. package/dist/src/framer/iterator.d.ts.map +1 -0
  70. package/dist/src/framer/iterator.spec.d.ts.map +1 -0
  71. package/dist/src/framer/payload.d.ts +7 -0
  72. package/dist/src/framer/payload.d.ts.map +1 -0
  73. package/dist/src/framer/streamProxy.d.ts.map +1 -0
  74. package/dist/{framer → src/framer}/streamer.d.ts +106 -4
  75. package/dist/src/framer/streamer.d.ts.map +1 -0
  76. package/dist/src/framer/streamer.spec.d.ts.map +1 -0
  77. package/dist/{framer → src/framer}/writer.d.ts +133 -36
  78. package/dist/src/framer/writer.d.ts.map +1 -0
  79. package/dist/src/framer/writer.spec.d.ts.map +1 -0
  80. package/dist/src/hardware/client.d.ts.map +1 -0
  81. package/dist/src/hardware/device/client.d.ts.map +1 -0
  82. package/dist/src/hardware/device/device.spec.d.ts.map +1 -0
  83. package/dist/src/hardware/device/external.d.ts.map +1 -0
  84. package/dist/src/hardware/device/index.d.ts.map +1 -0
  85. package/dist/{hardware → src/hardware}/device/payload.d.ts +4 -4
  86. package/dist/src/hardware/device/payload.d.ts.map +1 -0
  87. package/dist/src/hardware/external.d.ts.map +1 -0
  88. package/dist/src/hardware/index.d.ts.map +1 -0
  89. package/dist/src/hardware/rack/client.d.ts.map +1 -0
  90. package/dist/src/hardware/rack/external.d.ts.map +1 -0
  91. package/dist/src/hardware/rack/index.d.ts.map +1 -0
  92. package/dist/{hardware → src/hardware}/rack/payload.d.ts +4 -4
  93. package/dist/src/hardware/rack/payload.d.ts.map +1 -0
  94. package/dist/src/hardware/rack/rack.spec.d.ts.map +1 -0
  95. package/dist/{hardware → src/hardware}/task/client.d.ts +1 -2
  96. package/dist/src/hardware/task/client.d.ts.map +1 -0
  97. package/dist/src/hardware/task/external.d.ts.map +1 -0
  98. package/dist/src/hardware/task/index.d.ts.map +1 -0
  99. package/dist/src/hardware/task/payload.d.ts.map +1 -0
  100. package/dist/src/hardware/task/task.spec.d.ts.map +1 -0
  101. package/dist/{index.d.ts → src/index.d.ts} +3 -3
  102. package/dist/src/index.d.ts.map +1 -0
  103. package/dist/src/label/client.d.ts.map +1 -0
  104. package/dist/src/label/external.d.ts.map +1 -0
  105. package/dist/src/label/index.d.ts.map +1 -0
  106. package/dist/{label → src/label}/label.spec.d.ts.map +1 -1
  107. package/dist/src/label/payload.d.ts.map +1 -0
  108. package/dist/src/ontology/client.d.ts.map +1 -0
  109. package/dist/src/ontology/external.d.ts.map +1 -0
  110. package/dist/src/ontology/group/client.d.ts.map +1 -0
  111. package/dist/src/ontology/group/external.d.ts.map +1 -0
  112. package/dist/src/ontology/group/group.spec.d.ts.map +1 -0
  113. package/dist/src/ontology/group/index.d.ts.map +1 -0
  114. package/dist/src/ontology/group/payload.d.ts.map +1 -0
  115. package/dist/src/ontology/index.d.ts.map +1 -0
  116. package/dist/src/ontology/ontology.spec.d.ts.map +1 -0
  117. package/dist/src/ontology/payload.d.ts.map +1 -0
  118. package/dist/src/ontology/writer.d.ts.map +1 -0
  119. package/dist/{ranger → src/ranger}/alias.d.ts +1 -1
  120. package/dist/src/ranger/alias.d.ts.map +1 -0
  121. package/dist/{ranger → src/ranger}/client.d.ts +1 -2
  122. package/dist/src/ranger/client.d.ts.map +1 -0
  123. package/dist/src/ranger/external.d.ts.map +1 -0
  124. package/dist/src/ranger/index.d.ts.map +1 -0
  125. package/dist/src/ranger/kv.d.ts.map +1 -0
  126. package/dist/{ranger → src/ranger}/payload.d.ts +1 -1
  127. package/dist/src/ranger/payload.d.ts.map +1 -0
  128. package/dist/src/ranger/ranger.spec.d.ts.map +1 -0
  129. package/dist/src/ranger/writer.d.ts.map +1 -0
  130. package/dist/src/status/client.d.ts.map +1 -0
  131. package/dist/src/status/external.d.ts.map +1 -0
  132. package/dist/src/status/index.d.ts.map +1 -0
  133. package/dist/{status → src/status}/payload.d.ts +2 -2
  134. package/dist/src/status/payload.d.ts.map +1 -0
  135. package/dist/src/status/status.spec.d.ts.map +1 -0
  136. package/dist/src/testutil/channels.d.ts.map +1 -0
  137. package/dist/src/testutil/client.d.ts +4 -0
  138. package/dist/src/testutil/client.d.ts.map +1 -0
  139. package/dist/src/testutil/telem.d.ts.map +1 -0
  140. package/dist/{transport.d.ts → src/transport.d.ts} +1 -2
  141. package/dist/src/transport.d.ts.map +1 -0
  142. package/dist/src/user/client.d.ts.map +1 -0
  143. package/dist/src/user/external.d.ts.map +1 -0
  144. package/dist/src/user/index.d.ts.map +1 -0
  145. package/dist/src/user/payload.d.ts.map +1 -0
  146. package/dist/src/user/retriever.d.ts.map +1 -0
  147. package/dist/{user → src/user}/user.spec.d.ts.map +1 -1
  148. package/dist/src/user/writer.d.ts.map +1 -0
  149. package/dist/src/util/decodeJSONString.d.ts.map +1 -0
  150. package/dist/src/util/parseWithoutKeyConversion.d.ts +3 -0
  151. package/dist/src/util/parseWithoutKeyConversion.d.ts.map +1 -0
  152. package/dist/src/util/retrieve.d.ts.map +1 -0
  153. package/dist/src/util/retrieve.spec.d.ts.map +1 -0
  154. package/dist/src/util/telem.d.ts +3 -0
  155. package/dist/src/util/telem.d.ts.map +1 -0
  156. package/dist/src/workspace/client.d.ts.map +1 -0
  157. package/dist/src/workspace/external.d.ts.map +1 -0
  158. package/dist/src/workspace/index.d.ts.map +1 -0
  159. package/dist/src/workspace/lineplot/client.d.ts.map +1 -0
  160. package/dist/src/workspace/lineplot/external.d.ts.map +1 -0
  161. package/dist/src/workspace/lineplot/index.d.ts.map +1 -0
  162. package/dist/src/workspace/lineplot/lineplot.spec.d.ts.map +1 -0
  163. package/dist/{workspace → src/workspace}/lineplot/payload.d.ts +1 -1
  164. package/dist/src/workspace/lineplot/payload.d.ts.map +1 -0
  165. package/dist/src/workspace/log/client.d.ts.map +1 -0
  166. package/dist/src/workspace/log/external.d.ts.map +1 -0
  167. package/dist/src/workspace/log/index.d.ts.map +1 -0
  168. package/dist/src/workspace/log/log.spec.d.ts.map +1 -0
  169. package/dist/{workspace → src/workspace}/log/payload.d.ts +1 -1
  170. package/dist/src/workspace/log/payload.d.ts.map +1 -0
  171. package/dist/{workspace → src/workspace}/payload.d.ts +1 -1
  172. package/dist/src/workspace/payload.d.ts.map +1 -0
  173. package/dist/src/workspace/schematic/client.d.ts.map +1 -0
  174. package/dist/src/workspace/schematic/external.d.ts.map +1 -0
  175. package/dist/src/workspace/schematic/index.d.ts.map +1 -0
  176. package/dist/{workspace → src/workspace}/schematic/payload.d.ts +1 -1
  177. package/dist/src/workspace/schematic/payload.d.ts.map +1 -0
  178. package/dist/src/workspace/schematic/schematic.spec.d.ts.map +1 -0
  179. package/dist/src/workspace/schematic/symbol/client.d.ts.map +1 -0
  180. package/dist/src/workspace/schematic/symbol/client.spec.d.ts.map +1 -0
  181. package/dist/src/workspace/schematic/symbol/external.d.ts.map +1 -0
  182. package/dist/src/workspace/schematic/symbol/index.d.ts.map +1 -0
  183. package/dist/src/workspace/schematic/symbol/payload.d.ts.map +1 -0
  184. package/dist/src/workspace/table/client.d.ts.map +1 -0
  185. package/dist/src/workspace/table/external.d.ts.map +1 -0
  186. package/dist/src/workspace/table/index.d.ts.map +1 -0
  187. package/dist/{workspace → src/workspace}/table/payload.d.ts +1 -1
  188. package/dist/src/workspace/table/payload.d.ts.map +1 -0
  189. package/dist/src/workspace/table/table.spec.d.ts.map +1 -0
  190. package/dist/src/workspace/workspace.spec.d.ts.map +1 -0
  191. package/eslint.config.ts +14 -0
  192. package/examples/node/streamWrite.js +0 -1
  193. package/package.json +11 -11
  194. package/src/arc/client.ts +27 -2
  195. package/src/arc/lsp.spec.ts +852 -0
  196. package/src/arc/payload.ts +13 -8
  197. package/src/auth/auth.spec.ts +14 -14
  198. package/src/channel/batchRetriever.spec.ts +3 -2
  199. package/src/channel/channel.spec.ts +8 -22
  200. package/src/channel/client.ts +22 -14
  201. package/src/channel/payload.ts +25 -3
  202. package/src/channel/retriever.ts +2 -3
  203. package/src/client.ts +26 -14
  204. package/src/connection/checker.ts +13 -14
  205. package/src/connection/connection.spec.ts +14 -14
  206. package/src/connection.spec.ts +145 -0
  207. package/src/control/state.ts +1 -3
  208. package/src/errors.ts +2 -2
  209. package/src/framer/adapter.spec.ts +340 -2
  210. package/src/framer/adapter.ts +24 -15
  211. package/src/framer/client.ts +0 -2
  212. package/src/framer/codec.spec.ts +11 -1
  213. package/src/framer/codec.ts +3 -2
  214. package/src/framer/deleter.spec.ts +1 -1
  215. package/src/framer/deleter.ts +1 -3
  216. package/src/framer/external.ts +1 -0
  217. package/src/framer/frame.spec.ts +297 -1
  218. package/src/framer/frame.ts +26 -6
  219. package/src/framer/iterator.spec.ts +1 -2
  220. package/src/framer/iterator.ts +4 -5
  221. package/{eslint.config.js → src/framer/payload.ts} +6 -3
  222. package/src/framer/streamer.spec.ts +72 -12
  223. package/src/framer/streamer.ts +7 -6
  224. package/src/framer/writer.spec.ts +1 -9
  225. package/src/framer/writer.ts +29 -35
  226. package/src/hardware/task/client.ts +9 -2
  227. package/src/index.ts +10 -3
  228. package/src/label/client.ts +1 -1
  229. package/src/ranger/alias.ts +1 -2
  230. package/src/ranger/client.ts +1 -2
  231. package/src/ranger/kv.ts +1 -2
  232. package/src/ranger/payload.ts +1 -2
  233. package/src/ranger/ranger.spec.ts +1 -2
  234. package/src/status/client.ts +1 -1
  235. package/src/status/payload.ts +4 -2
  236. package/src/testutil/client.ts +4 -4
  237. package/src/transport.ts +1 -3
  238. package/src/user/writer.ts +1 -1
  239. package/src/util/parseWithoutKeyConversion.ts +1 -1
  240. package/src/util/telem.ts +1 -1
  241. package/src/workspace/lineplot/payload.ts +1 -1
  242. package/src/workspace/log/payload.ts +1 -1
  243. package/src/workspace/payload.ts +1 -1
  244. package/src/workspace/schematic/payload.ts +1 -1
  245. package/src/workspace/table/payload.ts +1 -1
  246. package/tsconfig.json +1 -1
  247. package/dist/access/client.d.ts.map +0 -1
  248. package/dist/access/external.d.ts.map +0 -1
  249. package/dist/access/index.d.ts.map +0 -1
  250. package/dist/access/payload.d.ts.map +0 -1
  251. package/dist/access/policy/client.d.ts.map +0 -1
  252. package/dist/access/policy/external.d.ts.map +0 -1
  253. package/dist/access/policy/index.d.ts.map +0 -1
  254. package/dist/access/policy/payload.d.ts.map +0 -1
  255. package/dist/access/policy/policy.spec.d.ts.map +0 -1
  256. package/dist/arc/client.d.ts.map +0 -1
  257. package/dist/arc/external.d.ts.map +0 -1
  258. package/dist/arc/index.d.ts.map +0 -1
  259. package/dist/arc/payload.d.ts.map +0 -1
  260. package/dist/auth/auth.d.ts.map +0 -1
  261. package/dist/auth/index.d.ts.map +0 -1
  262. package/dist/channel/batchRetriever.spec.d.ts.map +0 -1
  263. package/dist/channel/channel.spec.d.ts.map +0 -1
  264. package/dist/channel/client.d.ts.map +0 -1
  265. package/dist/channel/external.d.ts.map +0 -1
  266. package/dist/channel/index.d.ts.map +0 -1
  267. package/dist/channel/payload.d.ts +0 -150
  268. package/dist/channel/payload.d.ts.map +0 -1
  269. package/dist/channel/retriever.d.ts.map +0 -1
  270. package/dist/channel/writer.d.ts.map +0 -1
  271. package/dist/client.d.ts.map +0 -1
  272. package/dist/connection/checker.d.ts.map +0 -1
  273. package/dist/connection/connection.spec.d.ts.map +0 -1
  274. package/dist/connection/index.d.ts.map +0 -1
  275. package/dist/control/client.d.ts.map +0 -1
  276. package/dist/control/external.d.ts.map +0 -1
  277. package/dist/control/index.d.ts.map +0 -1
  278. package/dist/control/state.d.ts.map +0 -1
  279. package/dist/errors.d.ts.map +0 -1
  280. package/dist/framer/adapter.d.ts.map +0 -1
  281. package/dist/framer/adapter.spec.d.ts.map +0 -1
  282. package/dist/framer/client.d.ts.map +0 -1
  283. package/dist/framer/client.spec.d.ts.map +0 -1
  284. package/dist/framer/codec.d.ts.map +0 -1
  285. package/dist/framer/deleter.d.ts.map +0 -1
  286. package/dist/framer/deleter.spec.d.ts.map +0 -1
  287. package/dist/framer/external.d.ts.map +0 -1
  288. package/dist/framer/frame.d.ts.map +0 -1
  289. package/dist/framer/index.d.ts.map +0 -1
  290. package/dist/framer/iterator.d.ts.map +0 -1
  291. package/dist/framer/iterator.spec.d.ts.map +0 -1
  292. package/dist/framer/streamProxy.d.ts.map +0 -1
  293. package/dist/framer/streamer.d.ts.map +0 -1
  294. package/dist/framer/streamer.spec.d.ts.map +0 -1
  295. package/dist/framer/writer.d.ts.map +0 -1
  296. package/dist/framer/writer.spec.d.ts.map +0 -1
  297. package/dist/hardware/client.d.ts.map +0 -1
  298. package/dist/hardware/device/client.d.ts.map +0 -1
  299. package/dist/hardware/device/device.spec.d.ts.map +0 -1
  300. package/dist/hardware/device/external.d.ts.map +0 -1
  301. package/dist/hardware/device/index.d.ts.map +0 -1
  302. package/dist/hardware/device/payload.d.ts.map +0 -1
  303. package/dist/hardware/external.d.ts.map +0 -1
  304. package/dist/hardware/index.d.ts.map +0 -1
  305. package/dist/hardware/rack/client.d.ts.map +0 -1
  306. package/dist/hardware/rack/external.d.ts.map +0 -1
  307. package/dist/hardware/rack/index.d.ts.map +0 -1
  308. package/dist/hardware/rack/payload.d.ts.map +0 -1
  309. package/dist/hardware/rack/rack.spec.d.ts.map +0 -1
  310. package/dist/hardware/task/client.d.ts.map +0 -1
  311. package/dist/hardware/task/external.d.ts.map +0 -1
  312. package/dist/hardware/task/index.d.ts.map +0 -1
  313. package/dist/hardware/task/payload.d.ts.map +0 -1
  314. package/dist/hardware/task/task.spec.d.ts.map +0 -1
  315. package/dist/index.d.ts.map +0 -1
  316. package/dist/label/client.d.ts.map +0 -1
  317. package/dist/label/external.d.ts.map +0 -1
  318. package/dist/label/index.d.ts.map +0 -1
  319. package/dist/label/payload.d.ts.map +0 -1
  320. package/dist/ontology/client.d.ts.map +0 -1
  321. package/dist/ontology/external.d.ts.map +0 -1
  322. package/dist/ontology/group/client.d.ts.map +0 -1
  323. package/dist/ontology/group/external.d.ts.map +0 -1
  324. package/dist/ontology/group/group.spec.d.ts.map +0 -1
  325. package/dist/ontology/group/index.d.ts.map +0 -1
  326. package/dist/ontology/group/payload.d.ts.map +0 -1
  327. package/dist/ontology/index.d.ts.map +0 -1
  328. package/dist/ontology/ontology.spec.d.ts.map +0 -1
  329. package/dist/ontology/payload.d.ts.map +0 -1
  330. package/dist/ontology/writer.d.ts.map +0 -1
  331. package/dist/ranger/alias.d.ts.map +0 -1
  332. package/dist/ranger/client.d.ts.map +0 -1
  333. package/dist/ranger/external.d.ts.map +0 -1
  334. package/dist/ranger/index.d.ts.map +0 -1
  335. package/dist/ranger/kv.d.ts.map +0 -1
  336. package/dist/ranger/payload.d.ts.map +0 -1
  337. package/dist/ranger/ranger.spec.d.ts.map +0 -1
  338. package/dist/ranger/writer.d.ts.map +0 -1
  339. package/dist/status/client.d.ts.map +0 -1
  340. package/dist/status/external.d.ts.map +0 -1
  341. package/dist/status/index.d.ts.map +0 -1
  342. package/dist/status/payload.d.ts.map +0 -1
  343. package/dist/status/status.spec.d.ts.map +0 -1
  344. package/dist/testutil/channels.d.ts.map +0 -1
  345. package/dist/testutil/client.d.ts +0 -4
  346. package/dist/testutil/client.d.ts.map +0 -1
  347. package/dist/testutil/telem.d.ts.map +0 -1
  348. package/dist/transport.d.ts.map +0 -1
  349. package/dist/user/client.d.ts.map +0 -1
  350. package/dist/user/external.d.ts.map +0 -1
  351. package/dist/user/index.d.ts.map +0 -1
  352. package/dist/user/payload.d.ts.map +0 -1
  353. package/dist/user/retriever.d.ts.map +0 -1
  354. package/dist/user/writer.d.ts.map +0 -1
  355. package/dist/util/decodeJSONString.d.ts.map +0 -1
  356. package/dist/util/parseWithoutKeyConversion.d.ts +0 -3
  357. package/dist/util/parseWithoutKeyConversion.d.ts.map +0 -1
  358. package/dist/util/retrieve.d.ts.map +0 -1
  359. package/dist/util/retrieve.spec.d.ts.map +0 -1
  360. package/dist/util/telem.d.ts +0 -3
  361. package/dist/util/telem.d.ts.map +0 -1
  362. package/dist/workspace/client.d.ts.map +0 -1
  363. package/dist/workspace/external.d.ts.map +0 -1
  364. package/dist/workspace/index.d.ts.map +0 -1
  365. package/dist/workspace/lineplot/client.d.ts.map +0 -1
  366. package/dist/workspace/lineplot/external.d.ts.map +0 -1
  367. package/dist/workspace/lineplot/index.d.ts.map +0 -1
  368. package/dist/workspace/lineplot/lineplot.spec.d.ts.map +0 -1
  369. package/dist/workspace/lineplot/payload.d.ts.map +0 -1
  370. package/dist/workspace/log/client.d.ts.map +0 -1
  371. package/dist/workspace/log/external.d.ts.map +0 -1
  372. package/dist/workspace/log/index.d.ts.map +0 -1
  373. package/dist/workspace/log/log.spec.d.ts.map +0 -1
  374. package/dist/workspace/log/payload.d.ts.map +0 -1
  375. package/dist/workspace/payload.d.ts.map +0 -1
  376. package/dist/workspace/schematic/client.d.ts.map +0 -1
  377. package/dist/workspace/schematic/external.d.ts.map +0 -1
  378. package/dist/workspace/schematic/index.d.ts.map +0 -1
  379. package/dist/workspace/schematic/payload.d.ts.map +0 -1
  380. package/dist/workspace/schematic/schematic.spec.d.ts.map +0 -1
  381. package/dist/workspace/schematic/symbol/client.d.ts.map +0 -1
  382. package/dist/workspace/schematic/symbol/client.spec.d.ts.map +0 -1
  383. package/dist/workspace/schematic/symbol/external.d.ts.map +0 -1
  384. package/dist/workspace/schematic/symbol/index.d.ts.map +0 -1
  385. package/dist/workspace/schematic/symbol/payload.d.ts.map +0 -1
  386. package/dist/workspace/table/client.d.ts.map +0 -1
  387. package/dist/workspace/table/external.d.ts.map +0 -1
  388. package/dist/workspace/table/index.d.ts.map +0 -1
  389. package/dist/workspace/table/payload.d.ts.map +0 -1
  390. package/dist/workspace/table/table.spec.d.ts.map +0 -1
  391. package/dist/workspace/workspace.spec.d.ts.map +0 -1
  392. /package/dist/{access → src/access}/client.d.ts +0 -0
  393. /package/dist/{access → src/access}/external.d.ts +0 -0
  394. /package/dist/{access → src/access}/index.d.ts +0 -0
  395. /package/dist/{access → src/access}/payload.d.ts +0 -0
  396. /package/dist/{access → src/access}/policy/client.d.ts +0 -0
  397. /package/dist/{access → src/access}/policy/external.d.ts +0 -0
  398. /package/dist/{access → src/access}/policy/index.d.ts +0 -0
  399. /package/dist/{access → src/access}/policy/payload.d.ts +0 -0
  400. /package/dist/{access → src/access}/policy/policy.spec.d.ts +0 -0
  401. /package/dist/{arc → src/arc}/external.d.ts +0 -0
  402. /package/dist/{arc → src/arc}/index.d.ts +0 -0
  403. /package/dist/{auth → src/auth}/auth.d.ts +0 -0
  404. /package/dist/{auth → src/auth}/auth.spec.d.ts +0 -0
  405. /package/dist/{auth → src/auth}/index.d.ts +0 -0
  406. /package/dist/{channel → src/channel}/batchRetriever.spec.d.ts +0 -0
  407. /package/dist/{channel → src/channel}/channel.spec.d.ts +0 -0
  408. /package/dist/{channel → src/channel}/external.d.ts +0 -0
  409. /package/dist/{channel → src/channel}/index.d.ts +0 -0
  410. /package/dist/{channel → src/channel}/writer.d.ts +0 -0
  411. /package/dist/{connection → src/connection}/index.d.ts +0 -0
  412. /package/dist/{connection → src}/connection.spec.d.ts +0 -0
  413. /package/dist/{control → src/control}/client.d.ts +0 -0
  414. /package/dist/{control → src/control}/external.d.ts +0 -0
  415. /package/dist/{control → src/control}/index.d.ts +0 -0
  416. /package/dist/{control → src/control}/state.spec.d.ts +0 -0
  417. /package/dist/{errors.d.ts → src/errors.d.ts} +0 -0
  418. /package/dist/{errors.spec.d.ts → src/errors.spec.d.ts} +0 -0
  419. /package/dist/{framer → src/framer}/adapter.spec.d.ts +0 -0
  420. /package/dist/{framer → src/framer}/client.d.ts +0 -0
  421. /package/dist/{framer → src/framer}/client.spec.d.ts +0 -0
  422. /package/dist/{framer → src/framer}/codec.d.ts +0 -0
  423. /package/dist/{framer → src/framer}/codec.spec.d.ts +0 -0
  424. /package/dist/{framer → src/framer}/deleter.d.ts +0 -0
  425. /package/dist/{framer → src/framer}/deleter.spec.d.ts +0 -0
  426. /package/dist/{framer → src/framer}/frame.spec.d.ts +0 -0
  427. /package/dist/{framer → src/framer}/index.d.ts +0 -0
  428. /package/dist/{framer → src/framer}/iterator.spec.d.ts +0 -0
  429. /package/dist/{framer → src/framer}/streamProxy.d.ts +0 -0
  430. /package/dist/{framer → src/framer}/streamer.spec.d.ts +0 -0
  431. /package/dist/{framer → src/framer}/writer.spec.d.ts +0 -0
  432. /package/dist/{hardware → src/hardware}/client.d.ts +0 -0
  433. /package/dist/{hardware → src/hardware}/device/client.d.ts +0 -0
  434. /package/dist/{hardware → src/hardware}/device/device.spec.d.ts +0 -0
  435. /package/dist/{hardware → src/hardware}/device/external.d.ts +0 -0
  436. /package/dist/{hardware → src/hardware}/device/index.d.ts +0 -0
  437. /package/dist/{hardware → src/hardware}/external.d.ts +0 -0
  438. /package/dist/{hardware → src/hardware}/index.d.ts +0 -0
  439. /package/dist/{hardware → src/hardware}/rack/client.d.ts +0 -0
  440. /package/dist/{hardware → src/hardware}/rack/external.d.ts +0 -0
  441. /package/dist/{hardware → src/hardware}/rack/index.d.ts +0 -0
  442. /package/dist/{hardware → src/hardware}/rack/rack.spec.d.ts +0 -0
  443. /package/dist/{hardware → src/hardware}/task/external.d.ts +0 -0
  444. /package/dist/{hardware → src/hardware}/task/index.d.ts +0 -0
  445. /package/dist/{hardware → src/hardware}/task/payload.d.ts +0 -0
  446. /package/dist/{hardware → src/hardware}/task/task.spec.d.ts +0 -0
  447. /package/dist/{label → src/label}/client.d.ts +0 -0
  448. /package/dist/{label → src/label}/external.d.ts +0 -0
  449. /package/dist/{label → src/label}/index.d.ts +0 -0
  450. /package/dist/{label → src/label}/label.spec.d.ts +0 -0
  451. /package/dist/{label → src/label}/payload.d.ts +0 -0
  452. /package/dist/{ontology → src/ontology}/client.d.ts +0 -0
  453. /package/dist/{ontology → src/ontology}/external.d.ts +0 -0
  454. /package/dist/{ontology → src/ontology}/group/client.d.ts +0 -0
  455. /package/dist/{ontology → src/ontology}/group/external.d.ts +0 -0
  456. /package/dist/{ontology → src/ontology}/group/group.spec.d.ts +0 -0
  457. /package/dist/{ontology → src/ontology}/group/index.d.ts +0 -0
  458. /package/dist/{ontology → src/ontology}/group/payload.d.ts +0 -0
  459. /package/dist/{ontology → src/ontology}/index.d.ts +0 -0
  460. /package/dist/{ontology → src/ontology}/ontology.spec.d.ts +0 -0
  461. /package/dist/{ontology → src/ontology}/payload.d.ts +0 -0
  462. /package/dist/{ontology → src/ontology}/writer.d.ts +0 -0
  463. /package/dist/{ranger → src/ranger}/external.d.ts +0 -0
  464. /package/dist/{ranger → src/ranger}/index.d.ts +0 -0
  465. /package/dist/{ranger → src/ranger}/kv.d.ts +0 -0
  466. /package/dist/{ranger → src/ranger}/ranger.spec.d.ts +0 -0
  467. /package/dist/{ranger → src/ranger}/writer.d.ts +0 -0
  468. /package/dist/{status → src/status}/client.d.ts +0 -0
  469. /package/dist/{status → src/status}/external.d.ts +0 -0
  470. /package/dist/{status → src/status}/index.d.ts +0 -0
  471. /package/dist/{status → src/status}/status.spec.d.ts +0 -0
  472. /package/dist/{testutil → src/testutil}/channels.d.ts +0 -0
  473. /package/dist/{testutil → src/testutil}/telem.d.ts +0 -0
  474. /package/dist/{user → src/user}/client.d.ts +0 -0
  475. /package/dist/{user → src/user}/external.d.ts +0 -0
  476. /package/dist/{user → src/user}/index.d.ts +0 -0
  477. /package/dist/{user → src/user}/payload.d.ts +0 -0
  478. /package/dist/{user → src/user}/retriever.d.ts +0 -0
  479. /package/dist/{user → src/user}/user.spec.d.ts +0 -0
  480. /package/dist/{user → src/user}/writer.d.ts +0 -0
  481. /package/dist/{util → src/util}/decodeJSONString.d.ts +0 -0
  482. /package/dist/{util → src/util}/retrieve.d.ts +0 -0
  483. /package/dist/{util → src/util}/retrieve.spec.d.ts +0 -0
  484. /package/dist/{workspace → src/workspace}/client.d.ts +0 -0
  485. /package/dist/{workspace → src/workspace}/external.d.ts +0 -0
  486. /package/dist/{workspace → src/workspace}/index.d.ts +0 -0
  487. /package/dist/{workspace → src/workspace}/lineplot/client.d.ts +0 -0
  488. /package/dist/{workspace → src/workspace}/lineplot/external.d.ts +0 -0
  489. /package/dist/{workspace → src/workspace}/lineplot/index.d.ts +0 -0
  490. /package/dist/{workspace → src/workspace}/lineplot/lineplot.spec.d.ts +0 -0
  491. /package/dist/{workspace → src/workspace}/log/client.d.ts +0 -0
  492. /package/dist/{workspace → src/workspace}/log/external.d.ts +0 -0
  493. /package/dist/{workspace → src/workspace}/log/index.d.ts +0 -0
  494. /package/dist/{workspace → src/workspace}/log/log.spec.d.ts +0 -0
  495. /package/dist/{workspace → src/workspace}/schematic/client.d.ts +0 -0
  496. /package/dist/{workspace → src/workspace}/schematic/external.d.ts +0 -0
  497. /package/dist/{workspace → src/workspace}/schematic/index.d.ts +0 -0
  498. /package/dist/{workspace → src/workspace}/schematic/schematic.spec.d.ts +0 -0
  499. /package/dist/{workspace → src/workspace}/schematic/symbol/client.d.ts +0 -0
  500. /package/dist/{workspace → src/workspace}/schematic/symbol/client.spec.d.ts +0 -0
  501. /package/dist/{workspace → src/workspace}/schematic/symbol/external.d.ts +0 -0
  502. /package/dist/{workspace → src/workspace}/schematic/symbol/index.d.ts +0 -0
  503. /package/dist/{workspace → src/workspace}/schematic/symbol/payload.d.ts +0 -0
  504. /package/dist/{workspace → src/workspace}/table/client.d.ts +0 -0
  505. /package/dist/{workspace → src/workspace}/table/external.d.ts +0 -0
  506. /package/dist/{workspace → src/workspace}/table/index.d.ts +0 -0
  507. /package/dist/{workspace → src/workspace}/table/table.spec.d.ts +0 -0
  508. /package/dist/{workspace → src/workspace}/workspace.spec.d.ts +0 -0
@@ -7,24 +7,24 @@
7
7
  // License, use of this software will be governed by the Apache License, Version 2.0,
8
8
  // included in the file licenses/APL.txt.
9
9
 
10
- import { URL } from "@synnaxlabs/x/url";
10
+ import { URL } from "@synnaxlabs/x";
11
11
  import { describe, expect, it } from "vitest";
12
12
  import { z } from "zod";
13
13
 
14
14
  import { auth } from "@/auth";
15
15
  import { connection } from "@/connection";
16
- import { TEST_CLIENT_PROPS } from "@/testutil/client";
16
+ import { TEST_CLIENT_PARAMS } from "@/testutil/client";
17
17
  import { Transport } from "@/transport";
18
18
 
19
19
  describe("connectivity", () => {
20
20
  it("should connect to the server", async () => {
21
21
  const transport = new Transport(
22
22
  new URL({
23
- host: TEST_CLIENT_PROPS.host,
24
- port: Number(TEST_CLIENT_PROPS.port),
23
+ host: TEST_CLIENT_PARAMS.host,
24
+ port: Number(TEST_CLIENT_PARAMS.port),
25
25
  }),
26
26
  );
27
- const client = new auth.Client(transport.unary, TEST_CLIENT_PROPS);
27
+ const client = new auth.Client(transport.unary, TEST_CLIENT_PARAMS);
28
28
  transport.use(client.middleware());
29
29
  const connectivity = new connection.Checker(
30
30
  transport.unary,
@@ -39,11 +39,11 @@ describe("connectivity", () => {
39
39
  it("should pull the server and client versions", async () => {
40
40
  const transport = new Transport(
41
41
  new URL({
42
- host: TEST_CLIENT_PROPS.host,
43
- port: Number(TEST_CLIENT_PROPS.port),
42
+ host: TEST_CLIENT_PARAMS.host,
43
+ port: Number(TEST_CLIENT_PARAMS.port),
44
44
  }),
45
45
  );
46
- const client = new auth.Client(transport.unary, TEST_CLIENT_PROPS);
46
+ const client = new auth.Client(transport.unary, TEST_CLIENT_PARAMS);
47
47
  transport.use(client.middleware());
48
48
  const connectivity = new connection.Checker(
49
49
  transport.unary,
@@ -57,11 +57,11 @@ describe("connectivity", () => {
57
57
  it("should adjust state if the server is too old", async () => {
58
58
  const transport = new Transport(
59
59
  new URL({
60
- host: TEST_CLIENT_PROPS.host,
61
- port: Number(TEST_CLIENT_PROPS.port),
60
+ host: TEST_CLIENT_PARAMS.host,
61
+ port: Number(TEST_CLIENT_PARAMS.port),
62
62
  }),
63
63
  );
64
- const client = new auth.Client(transport.unary, TEST_CLIENT_PROPS);
64
+ const client = new auth.Client(transport.unary, TEST_CLIENT_PARAMS);
65
65
  transport.use(client.middleware());
66
66
  const connectivity = new connection.Checker(
67
67
  transport.unary,
@@ -75,11 +75,11 @@ describe("connectivity", () => {
75
75
  it("should adjust state if the server is too new", async () => {
76
76
  const transport = new Transport(
77
77
  new URL({
78
- host: TEST_CLIENT_PROPS.host,
79
- port: Number(TEST_CLIENT_PROPS.port),
78
+ host: TEST_CLIENT_PARAMS.host,
79
+ port: Number(TEST_CLIENT_PARAMS.port),
80
80
  }),
81
81
  );
82
- const client = new auth.Client(transport.unary, TEST_CLIENT_PROPS);
82
+ const client = new auth.Client(transport.unary, TEST_CLIENT_PARAMS);
83
83
  transport.use(client.middleware());
84
84
  const connectivity = new connection.Checker(transport.unary, undefined, "0.0.0");
85
85
  const state = await connectivity.check();
@@ -0,0 +1,145 @@
1
+ // Copyright 2025 Synnax Labs, Inc.
2
+ //
3
+ // Use of this software is governed by the Business Source License included in the file
4
+ // licenses/BSL.txt.
5
+ //
6
+ // As of the Change Date specified in that file, in accordance with the Business Source
7
+ // License, use of this software will be governed by the Apache License, Version 2.0,
8
+ // included in the file licenses/APL.txt.
9
+
10
+ import { describe, expect, it } from "vitest";
11
+ import { z } from "zod";
12
+
13
+ import { checkConnection, newConnectionChecker } from "@/client";
14
+ import { TEST_CLIENT_PARAMS } from "@/testutil/client";
15
+
16
+ describe("checkConnection", () => {
17
+ it("should check connection to the server", async () => {
18
+ const state = await checkConnection({
19
+ host: TEST_CLIENT_PARAMS.host,
20
+ port: TEST_CLIENT_PARAMS.port,
21
+ secure: false,
22
+ });
23
+ expect(state.status).toEqual("connected");
24
+ expect(z.uuid().safeParse(state.clusterKey).success).toBe(true);
25
+ });
26
+
27
+ it("should include client version in the connection check", async () => {
28
+ const state = await checkConnection({
29
+ host: TEST_CLIENT_PARAMS.host,
30
+ port: TEST_CLIENT_PARAMS.port,
31
+ secure: false,
32
+ });
33
+ expect(state.clientVersion).toBeDefined();
34
+ expect(state.clientServerCompatible).toBe(true);
35
+ });
36
+
37
+ it("should support custom name parameter", async () => {
38
+ const state = await checkConnection({
39
+ host: TEST_CLIENT_PARAMS.host,
40
+ port: TEST_CLIENT_PARAMS.port,
41
+ secure: false,
42
+ name: "test-client",
43
+ });
44
+ expect(state.status).toEqual("connected");
45
+ });
46
+
47
+ it("should handle connection failure to invalid host", async () => {
48
+ const state = await checkConnection({
49
+ host: "invalid-host-that-does-not-exist",
50
+ port: 9999,
51
+ secure: false,
52
+ retry: {
53
+ maxRetries: 0, // Disable retries for faster test
54
+ },
55
+ });
56
+ expect(state.status).toEqual("failed");
57
+ });
58
+
59
+ it("should handle connection failure to invalid port", async () => {
60
+ const state = await checkConnection({
61
+ host: TEST_CLIENT_PARAMS.host,
62
+ port: 9999, // Wrong port
63
+ secure: false,
64
+ retry: {
65
+ maxRetries: 0, // Disable retries for faster test
66
+ },
67
+ });
68
+ expect(state.status).toEqual("failed");
69
+ });
70
+ });
71
+
72
+ describe("newConnectionChecker", () => {
73
+ it("should create a connection checker", () => {
74
+ const checker = newConnectionChecker({
75
+ host: TEST_CLIENT_PARAMS.host,
76
+ port: TEST_CLIENT_PARAMS.port,
77
+ secure: false,
78
+ });
79
+ expect(checker).toBeDefined();
80
+ });
81
+
82
+ it("should create a checker that can check connection", async () => {
83
+ const checker = newConnectionChecker({
84
+ host: TEST_CLIENT_PARAMS.host,
85
+ port: TEST_CLIENT_PARAMS.port,
86
+ secure: false,
87
+ });
88
+ const state = await checker.check();
89
+ expect(state.status).toEqual("connected");
90
+ expect(z.uuid().safeParse(state.clusterKey).success).toBe(true);
91
+ });
92
+
93
+ it("should support custom name parameter", async () => {
94
+ const checker = newConnectionChecker({
95
+ host: TEST_CLIENT_PARAMS.host,
96
+ port: TEST_CLIENT_PARAMS.port,
97
+ secure: false,
98
+ name: "custom-checker-name",
99
+ });
100
+ const state = await checker.check();
101
+ expect(state.status).toEqual("connected");
102
+ });
103
+
104
+ it("should support secure connection parameter", () => {
105
+ const checker = newConnectionChecker({
106
+ host: TEST_CLIENT_PARAMS.host,
107
+ port: TEST_CLIENT_PARAMS.port,
108
+ secure: true,
109
+ });
110
+ expect(checker).toBeDefined();
111
+ });
112
+
113
+ it("should create multiple independent checkers", async () => {
114
+ const checker1 = newConnectionChecker({
115
+ host: TEST_CLIENT_PARAMS.host,
116
+ port: TEST_CLIENT_PARAMS.port,
117
+ secure: false,
118
+ name: "checker-1",
119
+ });
120
+ const checker2 = newConnectionChecker({
121
+ host: TEST_CLIENT_PARAMS.host,
122
+ port: TEST_CLIENT_PARAMS.port,
123
+ secure: false,
124
+ name: "checker-2",
125
+ });
126
+
127
+ const state1 = await checker1.check();
128
+ const state2 = await checker2.check();
129
+
130
+ expect(state1.status).toEqual("connected");
131
+ expect(state2.status).toEqual("connected");
132
+ expect(checker1).not.toBe(checker2); // Different instances
133
+ });
134
+
135
+ it("should handle version compatibility checking", async () => {
136
+ const checker = newConnectionChecker({
137
+ host: TEST_CLIENT_PARAMS.host,
138
+ port: TEST_CLIENT_PARAMS.port,
139
+ secure: false,
140
+ });
141
+ const state = await checker.check();
142
+ expect(state.clientVersion).toBeDefined();
143
+ expect(state.clientServerCompatible).toBe(true);
144
+ });
145
+ });
@@ -7,9 +7,7 @@
7
7
  // License, use of this software will be governed by the Apache License, Version 2.0,
8
8
  // included in the file licenses/APL.txt.
9
9
 
10
- import { control } from "@synnaxlabs/x";
11
- import { binary } from "@synnaxlabs/x/binary";
12
- import { type observe } from "@synnaxlabs/x/observe";
10
+ import { binary, control, type observe } from "@synnaxlabs/x";
13
11
  import { z } from "zod";
14
12
 
15
13
  import { type channel } from "@/channel";
package/src/errors.ts CHANGED
@@ -92,7 +92,7 @@ export class ControlError extends SynnaxError.sub("control") {}
92
92
  export class UnauthorizedError extends ControlError.sub("unauthorized") {}
93
93
 
94
94
  export class DisconnectedError extends SynnaxError.sub("disconnected") {
95
- constructor(message: string = "Operation failed because no cluster is connected.") {
95
+ constructor(message: string = "Operation failed because no Core is connected.") {
96
96
  super(message);
97
97
  }
98
98
  }
@@ -161,7 +161,7 @@ export const errorsMiddleware: Middleware = async (ctx, next) => {
161
161
  return [
162
162
  res,
163
163
  new Unreachable({
164
- message: `Cannot reach cluster at ${err.url.host}:${err.url.port}`,
164
+ message: `Cannot reach Core at ${err.url.host}:${err.url.port}`,
165
165
  url: err.url,
166
166
  }),
167
167
  ];
@@ -7,7 +7,7 @@
7
7
  // License, use of this software will be governed by the Apache License, Version 2.0,
8
8
  // included in the file licenses/APL.txt.
9
9
 
10
- import { DataType, Series, TimeStamp } from "@synnaxlabs/x/telem";
10
+ import { DataType, Series, TimeStamp } from "@synnaxlabs/x";
11
11
  import { beforeAll, describe, expect, it } from "vitest";
12
12
 
13
13
  import { type channel } from "@/channel";
@@ -213,9 +213,10 @@ describe("WriteFrameAdapter", () => {
213
213
  });
214
214
  });
215
215
 
216
- describe("ReadAdapter", () => {
216
+ describe("ReadFrameAdapter", () => {
217
217
  let timeCh: channel.Channel;
218
218
  let dataCh: channel.Channel;
219
+ let extraCh: channel.Channel;
219
220
  let adapter: ReadAdapter;
220
221
 
221
222
  beforeAll(async () => {
@@ -229,6 +230,11 @@ describe("ReadAdapter", () => {
229
230
  dataType: DataType.FLOAT32,
230
231
  index: timeCh.key,
231
232
  });
233
+ extraCh = await client.channels.create({
234
+ name: `read-extra-${Math.random()}-${TimeStamp.now().toString()}`,
235
+ dataType: DataType.FLOAT64,
236
+ index: timeCh.key,
237
+ });
232
238
 
233
239
  adapter = await ReadAdapter.open(client.channels.retriever, [
234
240
  timeCh.key,
@@ -236,6 +242,338 @@ describe("ReadAdapter", () => {
236
242
  ]);
237
243
  });
238
244
 
245
+ describe("adapt", () => {
246
+ describe("with keys (no conversion)", () => {
247
+ describe("hot path - exact channel match", () => {
248
+ it("should return frame unchanged when all channels match", () => {
249
+ // HOT PATH: Frame has exactly the channels registered with adapter
250
+ const ts = TimeStamp.now().valueOf();
251
+ const inputFrame = new Frame({
252
+ [timeCh.key]: new Series([ts]),
253
+ [dataCh.key]: new Series([1.5]),
254
+ });
255
+
256
+ const result = adapter.adapt(inputFrame);
257
+
258
+ // Frame should be returned unchanged (zero allocations)
259
+ expect(result).toBe(inputFrame); // Same object reference
260
+ expect(result.columns).toHaveLength(2);
261
+ expect(result.has(timeCh.key)).toBe(true);
262
+ expect(result.has(dataCh.key)).toBe(true);
263
+ expect(result.get(timeCh.key).at(0)).toEqual(ts);
264
+ expect(result.get(dataCh.key).at(0)).toEqual(1.5);
265
+ });
266
+
267
+ it("should preserve series data types in hot path", () => {
268
+ const ts = TimeStamp.now().valueOf();
269
+ const inputFrame = new Frame({
270
+ [timeCh.key]: new Series({ data: [ts], dataType: DataType.TIMESTAMP }),
271
+ [dataCh.key]: new Series({ data: [1.5], dataType: DataType.FLOAT32 }),
272
+ });
273
+
274
+ const result = adapter.adapt(inputFrame);
275
+
276
+ // Data types should be preserved
277
+ expect(result.get(timeCh.key).dataType).toEqual(DataType.TIMESTAMP);
278
+ expect(result.get(dataCh.key).dataType).toEqual(DataType.FLOAT32);
279
+ });
280
+ });
281
+
282
+ describe("cold path - filtering needed", () => {
283
+ it("should filter out extra channels in key mode", () => {
284
+ // COLD PATH: Frame has extra channels not in adapter
285
+ const ts = TimeStamp.now().valueOf();
286
+ const inputFrame = new Frame({
287
+ [timeCh.key]: new Series([ts]),
288
+ [dataCh.key]: new Series([1.5]),
289
+ [extraCh.key]: new Series([999.0]), // Extra channel
290
+ });
291
+
292
+ const result = adapter.adapt(inputFrame);
293
+
294
+ // Should filter out extraCh
295
+ expect(result).not.toBe(inputFrame); // Different object (filtered)
296
+ expect(result.columns).toHaveLength(2);
297
+ expect(result.has(timeCh.key)).toBe(true);
298
+ expect(result.has(dataCh.key)).toBe(true);
299
+ expect(result.has(extraCh.key)).toBe(false);
300
+ });
301
+
302
+ it("should handle partial matches in key mode", () => {
303
+ // Frame has some matching and some extra channels
304
+ const ts = TimeStamp.now().valueOf();
305
+ const inputFrame = new Frame({
306
+ [timeCh.key]: new Series([ts]),
307
+ [extraCh.key]: new Series([999.0]),
308
+ });
309
+
310
+ const result = adapter.adapt(inputFrame);
311
+
312
+ expect(result.columns).toHaveLength(1);
313
+ expect(result.has(timeCh.key)).toBe(true);
314
+ expect(result.has(extraCh.key)).toBe(false);
315
+ });
316
+
317
+ it("should return empty frame when no channels match in key mode", () => {
318
+ const inputFrame = new Frame({
319
+ [extraCh.key]: new Series([999.0]),
320
+ });
321
+
322
+ const result = adapter.adapt(inputFrame);
323
+
324
+ expect(result.columns).toHaveLength(0);
325
+ expect(result.series).toHaveLength(0);
326
+ });
327
+ });
328
+ });
329
+
330
+ describe("with names (conversion)", () => {
331
+ let nameAdapter: ReadAdapter;
332
+
333
+ beforeAll(async () => {
334
+ // Create adapter with channel names (triggers key-to-name mapping)
335
+ nameAdapter = await ReadAdapter.open(client.channels.retriever, [
336
+ timeCh.name,
337
+ dataCh.name,
338
+ ]);
339
+ });
340
+
341
+ describe("hot path - exact match, only convert", () => {
342
+ it("should convert channel keys to names when all channels match", () => {
343
+ // HOT PATH: Frame has exactly the channels in adapter
344
+ const ts = TimeStamp.now().valueOf();
345
+ const inputFrame = new Frame({
346
+ [timeCh.key]: new Series([ts]),
347
+ [dataCh.key]: new Series([2.5]),
348
+ });
349
+
350
+ const result = nameAdapter.adapt(inputFrame);
351
+
352
+ // Output should have names instead of keys (one allocation for conversion)
353
+ expect(result.columns).toHaveLength(2);
354
+ expect(result.has(timeCh.name)).toBe(true);
355
+ expect(result.has(dataCh.name)).toBe(true);
356
+ expect(result.get(timeCh.name).at(0)).toEqual(ts);
357
+ expect(result.get(dataCh.name).at(0)).toEqual(2.5);
358
+ });
359
+
360
+ it("should handle multiple values in hot path", () => {
361
+ const ts = TimeStamp.now().valueOf();
362
+ const inputFrame = new Frame({
363
+ [timeCh.key]: new Series([ts, ts + 1000n]),
364
+ [dataCh.key]: new Series([1.0, 2.0]),
365
+ });
366
+
367
+ const result = nameAdapter.adapt(inputFrame);
368
+
369
+ expect(result.columns).toHaveLength(2);
370
+ expect(result.get(timeCh.name)).toHaveLength(2);
371
+ expect(result.get(dataCh.name)).toHaveLength(2);
372
+ expect(result.get(timeCh.name).at(0)).toEqual(ts);
373
+ expect(result.get(timeCh.name).at(1)).toEqual(ts + 1000n);
374
+ expect(result.get(dataCh.name).at(0)).toEqual(1.0);
375
+ expect(result.get(dataCh.name).at(1)).toEqual(2.0);
376
+ });
377
+
378
+ it("should preserve data types during name conversion", () => {
379
+ const ts = TimeStamp.now().valueOf();
380
+ const inputFrame = new Frame({
381
+ [timeCh.key]: new Series({ data: [ts], dataType: DataType.TIMESTAMP }),
382
+ [dataCh.key]: new Series({ data: [3.5], dataType: DataType.FLOAT32 }),
383
+ });
384
+
385
+ const result = nameAdapter.adapt(inputFrame);
386
+
387
+ expect(result.get(timeCh.name).dataType).toEqual(DataType.TIMESTAMP);
388
+ expect(result.get(dataCh.name).dataType).toEqual(DataType.FLOAT32);
389
+ });
390
+ });
391
+
392
+ describe("cold path - filter and convert", () => {
393
+ it("should filter out extra channels while converting", async () => {
394
+ // COLD PATH: Frame has extra channels that need filtering
395
+ const ts = TimeStamp.now().valueOf();
396
+ const inputFrame = new Frame({
397
+ [timeCh.key]: new Series([ts]),
398
+ [dataCh.key]: new Series([1.5]),
399
+ [extraCh.key]: new Series([999.0]), // Extra channel
400
+ });
401
+
402
+ const result = nameAdapter.adapt(inputFrame);
403
+
404
+ // Should filter extraCh and convert remaining keys to names
405
+ expect(result.columns).toHaveLength(2);
406
+ expect(result.has(timeCh.name)).toBe(true);
407
+ expect(result.has(dataCh.name)).toBe(true);
408
+ expect(result.has(extraCh.key)).toBe(false);
409
+ });
410
+
411
+ it("should handle partial matches while converting", async () => {
412
+ const filterAdapter = await ReadAdapter.open(client.channels.retriever, [
413
+ timeCh.name,
414
+ ]);
415
+
416
+ const ts = TimeStamp.now().valueOf();
417
+ const inputFrame = new Frame({
418
+ [timeCh.key]: new Series([ts]),
419
+ [extraCh.key]: new Series([999.0]),
420
+ });
421
+
422
+ const result = filterAdapter.adapt(inputFrame);
423
+
424
+ expect(result.columns).toHaveLength(1);
425
+ expect(result.has(timeCh.name)).toBe(true);
426
+ expect(result.has(extraCh.key)).toBe(false);
427
+ expect(result.get(timeCh.name).at(0)).toEqual(ts);
428
+ });
429
+
430
+ it("should return empty frame when no channels match", async () => {
431
+ const filterAdapter = await ReadAdapter.open(client.channels.retriever, [
432
+ timeCh.name,
433
+ ]);
434
+
435
+ const inputFrame = new Frame({
436
+ [extraCh.key]: new Series([999.0]),
437
+ });
438
+
439
+ const result = filterAdapter.adapt(inputFrame);
440
+
441
+ expect(result.columns).toHaveLength(0);
442
+ expect(result.series).toHaveLength(0);
443
+ });
444
+ });
445
+ });
446
+
447
+ describe("edge cases", () => {
448
+ it("should handle empty frames", () => {
449
+ const inputFrame = new Frame({});
450
+
451
+ const result = adapter.adapt(inputFrame);
452
+
453
+ expect(result.columns).toHaveLength(0);
454
+ expect(result.series).toHaveLength(0);
455
+ });
456
+
457
+ it("should handle frames with empty series", () => {
458
+ const inputFrame = new Frame({
459
+ [timeCh.key]: new Series({ data: [], dataType: DataType.TIMESTAMP }),
460
+ [dataCh.key]: new Series({ data: [], dataType: DataType.FLOAT32 }),
461
+ });
462
+
463
+ const result = adapter.adapt(inputFrame);
464
+
465
+ expect(result.columns).toHaveLength(2);
466
+ expect(result.get(timeCh.key)).toHaveLength(0);
467
+ expect(result.get(dataCh.key)).toHaveLength(0);
468
+ });
469
+ });
470
+
471
+ describe("data integrity", () => {
472
+ it("should preserve series values across multiple data types", async () => {
473
+ const int64Ch = await client.channels.create({
474
+ name: `read-int64-${Math.random()}-${TimeStamp.now().toString()}`,
475
+ dataType: DataType.INT64,
476
+ index: timeCh.key,
477
+ });
478
+
479
+ const testAdapter = await ReadAdapter.open(client.channels.retriever, [
480
+ timeCh.key,
481
+ dataCh.key,
482
+ int64Ch.key,
483
+ ]);
484
+
485
+ const ts = TimeStamp.now().valueOf();
486
+ const inputFrame = new Frame({
487
+ [timeCh.key]: new Series([ts, ts + 1000n]),
488
+ [dataCh.key]: new Series([1.5, 2.5]),
489
+ [int64Ch.key]: new Series([100n, 200n]),
490
+ });
491
+
492
+ const result = testAdapter.adapt(inputFrame);
493
+
494
+ // Verify all values preserved
495
+ expect(result.get(timeCh.key).at(0)).toEqual(ts);
496
+ expect(result.get(timeCh.key).at(1)).toEqual(ts + 1000n);
497
+ expect(result.get(dataCh.key).at(0)).toEqual(1.5);
498
+ expect(result.get(dataCh.key).at(1)).toEqual(2.5);
499
+ expect(result.get(int64Ch.key).at(0)).toEqual(100n);
500
+ expect(result.get(int64Ch.key).at(1)).toEqual(200n);
501
+ });
502
+
503
+ it("should preserve series lengths after filtering", () => {
504
+ const ts = TimeStamp.now().valueOf();
505
+ const inputFrame = new Frame({
506
+ [timeCh.key]: new Series([ts, ts + 1000n, ts + 2000n]),
507
+ [dataCh.key]: new Series([1.0, 2.0, 3.0]),
508
+ [extraCh.key]: new Series([999.0, 888.0, 777.0]),
509
+ });
510
+
511
+ const result = adapter.adapt(inputFrame);
512
+
513
+ // Lengths should be preserved for included channels
514
+ expect(result.get(timeCh.key)).toHaveLength(3);
515
+ expect(result.get(dataCh.key)).toHaveLength(3);
516
+ });
517
+
518
+ it("should preserve series order", () => {
519
+ const ts = TimeStamp.now().valueOf();
520
+ // Create frame with explicit column order
521
+ const inputFrame = new Frame(
522
+ [dataCh.key, timeCh.key],
523
+ [new Series([1.0, 2.0, 3.0]), new Series([ts, ts + 1000n, ts + 2000n])],
524
+ );
525
+
526
+ const result = adapter.adapt(inputFrame);
527
+
528
+ // Order should be preserved (dataCh first, then timeCh)
529
+ expect(result.columns[0]).toEqual(dataCh.key);
530
+ expect(result.columns[1]).toEqual(timeCh.key);
531
+ });
532
+ });
533
+
534
+ describe("state management", () => {
535
+ it("should handle multiple sequential updates correctly", async () => {
536
+ // Start with NAME mode to enable filtering
537
+ const newAdapter = await ReadAdapter.open(client.channels.retriever, [
538
+ timeCh.name,
539
+ ]);
540
+
541
+ // Initial state: only timeCh registered
542
+ const ts = TimeStamp.now().valueOf();
543
+ const inputFrame = new Frame({
544
+ [timeCh.key]: new Series([ts]),
545
+ [dataCh.key]: new Series([1.5]),
546
+ });
547
+
548
+ // Should filter out dataCh and convert timeCh key to name
549
+ let result = newAdapter.adapt(inputFrame);
550
+ expect(result.columns).toHaveLength(1);
551
+ expect(result.has(timeCh.name)).toBe(true);
552
+ expect(result.has(dataCh.name)).toBe(false);
553
+
554
+ // Update to include dataCh
555
+ await newAdapter.update([timeCh.name, dataCh.name]);
556
+
557
+ // Should now include both channels (converted to names)
558
+ result = newAdapter.adapt(inputFrame);
559
+ expect(result.columns).toHaveLength(2);
560
+ expect(result.has(timeCh.name)).toBe(true);
561
+ expect(result.has(dataCh.name)).toBe(true);
562
+ });
563
+ });
564
+
565
+ describe("codec integration", () => {
566
+ it("should update codec when channels change", async () => {
567
+ const codecAdapter = await ReadAdapter.open(client.channels.retriever, [
568
+ timeCh.key,
569
+ ]);
570
+ expect(codecAdapter.keys).toHaveLength(1);
571
+ await codecAdapter.update([timeCh.key, dataCh.key]);
572
+ expect(codecAdapter.keys).toHaveLength(2);
573
+ });
574
+ });
575
+ });
576
+
239
577
  describe("update", () => {
240
578
  it("should return false when updating with the same channels", async () => {
241
579
  const hasChanged = await adapter.update([timeCh.key, dataCh.key]);