@synnaxlabs/client 0.49.3 → 0.52.3
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.
- package/.turbo/turbo-build.log +10 -10
- package/CONTRIBUTING.md +1 -2
- package/README.md +1 -1
- package/dist/client.cjs +58 -34
- package/dist/client.js +5256 -4528
- package/dist/eslint.config.d.ts +2 -2
- package/dist/eslint.config.d.ts.map +1 -1
- package/dist/src/access/policy/client.d.ts +90 -76
- package/dist/src/access/policy/client.d.ts.map +1 -1
- package/dist/src/access/policy/payload.d.ts +17 -14
- package/dist/src/access/policy/payload.d.ts.map +1 -1
- package/dist/src/access/role/payload.d.ts +2 -2
- package/dist/src/arc/payload.d.ts +21 -20
- package/dist/src/arc/payload.d.ts.map +1 -1
- package/dist/src/channel/client.d.ts +9 -15
- package/dist/src/channel/client.d.ts.map +1 -1
- package/dist/src/channel/payload.d.ts +18 -18
- package/dist/src/channel/payload.d.ts.map +1 -1
- package/dist/src/channel/retriever.d.ts.map +1 -1
- package/dist/src/client.d.ts +12 -0
- package/dist/src/client.d.ts.map +1 -1
- package/dist/src/device/client.d.ts +14 -7
- package/dist/src/device/client.d.ts.map +1 -1
- package/dist/src/device/payload.d.ts +65 -32
- package/dist/src/device/payload.d.ts.map +1 -1
- package/dist/src/device/payload.spec.d.ts +2 -0
- package/dist/src/device/payload.spec.d.ts.map +1 -0
- package/dist/src/framer/adapter.d.ts.map +1 -1
- package/dist/src/framer/client.d.ts +2 -2
- package/dist/src/framer/frame.d.ts +5 -5
- package/dist/src/framer/frame.d.ts.map +1 -1
- package/dist/src/framer/streamer.d.ts +7 -17
- package/dist/src/framer/streamer.d.ts.map +1 -1
- package/dist/src/framer/writer.d.ts +9 -19
- package/dist/src/framer/writer.d.ts.map +1 -1
- package/dist/src/group/access.spec.d.ts.map +1 -0
- package/dist/src/{ontology/group → group}/client.d.ts +3 -2
- package/dist/src/group/client.d.ts.map +1 -0
- package/dist/src/group/external.d.ts.map +1 -0
- package/dist/src/group/group.spec.d.ts.map +1 -0
- package/dist/src/group/index.d.ts.map +1 -0
- package/dist/src/{ontology/group → group}/payload.d.ts +1 -1
- package/dist/src/group/payload.d.ts.map +1 -0
- package/dist/src/index.d.ts +6 -5
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/label/client.d.ts +27 -10
- package/dist/src/label/client.d.ts.map +1 -1
- package/dist/src/label/payload.d.ts +15 -1
- package/dist/src/label/payload.d.ts.map +1 -1
- package/dist/src/lineplot/access.spec.d.ts.map +1 -0
- package/dist/src/{workspace/lineplot → lineplot}/client.d.ts +6 -6
- package/dist/src/lineplot/client.d.ts.map +1 -0
- package/dist/src/lineplot/external.d.ts.map +1 -0
- package/dist/src/lineplot/index.d.ts.map +1 -0
- package/dist/src/lineplot/lineplot.spec.d.ts.map +1 -0
- package/dist/src/{workspace/lineplot → lineplot}/payload.d.ts +3 -3
- package/dist/src/lineplot/payload.d.ts.map +1 -0
- package/dist/src/log/access.spec.d.ts.map +1 -0
- package/dist/src/{workspace/log → log}/client.d.ts +6 -6
- package/dist/src/log/client.d.ts.map +1 -0
- package/dist/src/log/external.d.ts.map +1 -0
- package/dist/src/log/index.d.ts.map +1 -0
- package/dist/src/log/log.spec.d.ts.map +1 -0
- package/dist/src/{workspace/log → log}/payload.d.ts +3 -3
- package/dist/src/log/payload.d.ts.map +1 -0
- package/dist/src/ontology/client.d.ts +7 -9
- package/dist/src/ontology/client.d.ts.map +1 -1
- package/dist/src/ontology/payload.d.ts +25 -20
- package/dist/src/ontology/payload.d.ts.map +1 -1
- package/dist/src/ontology/writer.d.ts +15 -10
- package/dist/src/ontology/writer.d.ts.map +1 -1
- package/dist/src/rack/client.d.ts +2 -2
- package/dist/src/rack/payload.d.ts +44 -16
- package/dist/src/rack/payload.d.ts.map +1 -1
- package/dist/src/ranger/alias/client.d.ts +17 -0
- package/dist/src/ranger/alias/client.d.ts.map +1 -0
- package/dist/src/ranger/alias/external.d.ts +2 -0
- package/dist/src/ranger/alias/external.d.ts.map +1 -0
- package/dist/src/ranger/alias/index.d.ts +2 -0
- package/dist/src/ranger/alias/index.d.ts.map +1 -0
- package/dist/src/ranger/{alias.d.ts → alias/payload.d.ts} +14 -20
- package/dist/src/ranger/alias/payload.d.ts.map +1 -0
- package/dist/src/ranger/client.d.ts +10 -10
- package/dist/src/ranger/client.d.ts.map +1 -1
- package/dist/src/ranger/external.d.ts +20 -0
- package/dist/src/ranger/external.d.ts.map +1 -1
- package/dist/src/ranger/kv/client.d.ts +14 -0
- package/dist/src/ranger/kv/client.d.ts.map +1 -0
- package/dist/src/ranger/kv/external.d.ts +2 -0
- package/dist/src/ranger/kv/external.d.ts.map +1 -0
- package/dist/src/ranger/kv/index.d.ts +2 -0
- package/dist/src/ranger/kv/index.d.ts.map +1 -0
- package/dist/src/ranger/kv/payload.d.ts +26 -0
- package/dist/src/ranger/kv/payload.d.ts.map +1 -0
- package/dist/src/ranger/payload.d.ts +45 -3
- package/dist/src/ranger/payload.d.ts.map +1 -1
- package/dist/src/ranger/writer.d.ts +18 -3
- package/dist/src/ranger/writer.d.ts.map +1 -1
- package/dist/src/schematic/access.spec.d.ts.map +1 -0
- package/dist/src/{workspace/schematic → schematic}/client.d.ts +6 -6
- package/dist/src/schematic/client.d.ts.map +1 -0
- package/dist/src/schematic/external.d.ts.map +1 -0
- package/dist/src/schematic/index.d.ts.map +1 -0
- package/dist/src/{workspace/schematic → schematic}/payload.d.ts +3 -3
- package/dist/src/schematic/payload.d.ts.map +1 -0
- package/dist/src/schematic/schematic.spec.d.ts.map +1 -0
- package/dist/src/schematic/symbol/access.spec.d.ts.map +1 -0
- package/dist/src/{workspace/schematic → schematic}/symbol/client.d.ts +2 -2
- package/dist/src/schematic/symbol/client.d.ts.map +1 -0
- package/dist/src/schematic/symbol/client.spec.d.ts.map +1 -0
- package/dist/src/schematic/symbol/external.d.ts.map +1 -0
- package/dist/src/schematic/symbol/index.d.ts.map +1 -0
- package/dist/src/schematic/symbol/payload.d.ts.map +1 -0
- package/dist/src/status/payload.d.ts +43 -7
- package/dist/src/status/payload.d.ts.map +1 -1
- package/dist/src/table/access.spec.d.ts.map +1 -0
- package/dist/src/{workspace/table → table}/client.d.ts +6 -6
- package/dist/src/table/client.d.ts.map +1 -0
- package/dist/src/table/external.d.ts.map +1 -0
- package/dist/src/table/index.d.ts.map +1 -0
- package/dist/src/{workspace/table → table}/payload.d.ts +3 -3
- package/dist/src/table/payload.d.ts.map +1 -0
- package/dist/src/table/table.spec.d.ts.map +1 -0
- package/dist/src/task/client.d.ts +2 -2
- package/dist/src/task/client.d.ts.map +1 -1
- package/dist/src/task/payload.d.ts +5 -4
- package/dist/src/task/payload.d.ts.map +1 -1
- package/dist/src/task/payload.spec.d.ts +2 -0
- package/dist/src/task/payload.spec.d.ts.map +1 -0
- package/dist/src/user/client.d.ts +2 -2
- package/dist/src/view/client.d.ts +43 -0
- package/dist/src/view/client.d.ts.map +1 -0
- package/dist/src/view/external.d.ts +3 -0
- package/dist/src/view/external.d.ts.map +1 -0
- package/dist/src/view/index.d.ts +2 -0
- package/dist/src/view/index.d.ts.map +1 -0
- package/dist/src/view/payload.d.ts +20 -0
- package/dist/src/view/payload.d.ts.map +1 -0
- package/dist/src/view/view.spec.d.ts +2 -0
- package/dist/src/view/view.spec.d.ts.map +1 -0
- package/dist/src/workspace/client.d.ts +3 -11
- package/dist/src/workspace/client.d.ts.map +1 -1
- package/dist/src/workspace/payload.d.ts +3 -3
- package/eslint.config.ts +3 -4
- package/examples/node/basicReadWrite.js +1 -1
- package/examples/node/createChannels.js +50 -0
- package/examples/node/createRange.js +67 -0
- package/examples/node/readLatest.js +76 -0
- package/examples/node/seriesAndFrames.js +2 -2
- package/examples/node/{liveStream.js → streamRead.js} +1 -1
- package/examples/node/streamWrite.js +1 -1
- package/package.json +11 -10
- package/src/access/client.ts +1 -1
- package/src/access/enforce.spec.ts +1 -1
- package/src/access/enforce.ts +1 -1
- package/src/access/external.ts +1 -1
- package/src/access/index.ts +1 -1
- package/src/access/payload.ts +1 -1
- package/src/access/policy/access.spec.ts +1 -1
- package/src/access/policy/client.ts +1 -1
- package/src/access/policy/external.ts +1 -1
- package/src/access/policy/index.ts +1 -1
- package/src/access/policy/payload.ts +1 -1
- package/src/access/role/client.ts +1 -1
- package/src/access/role/external.ts +1 -1
- package/src/access/role/index.ts +1 -1
- package/src/access/role/payload.ts +1 -1
- package/src/access/role/role.spec.ts +1 -1
- package/src/arc/access.spec.ts +1 -7
- package/src/arc/client.ts +1 -1
- package/src/arc/external.ts +1 -1
- package/src/arc/index.ts +1 -1
- package/src/arc/lsp.spec.ts +156 -287
- package/src/arc/payload.ts +7 -12
- package/src/auth/auth.spec.ts +1 -1
- package/src/auth/auth.ts +1 -1
- package/src/auth/index.ts +1 -1
- package/src/channel/access.spec.ts +1 -1
- package/src/channel/batchRetriever.spec.ts +1 -3
- package/src/channel/channel.spec.ts +13 -20
- package/src/channel/client.ts +8 -41
- package/src/channel/external.ts +1 -1
- package/src/channel/index.ts +1 -1
- package/src/channel/payload.spec.ts +1 -58
- package/src/channel/payload.ts +19 -19
- package/src/channel/retriever.ts +7 -6
- package/src/channel/writer.ts +1 -1
- package/src/client.ts +24 -4
- package/src/connection/checker.ts +2 -2
- package/src/connection/connection.spec.ts +1 -1
- package/src/connection/index.ts +1 -1
- package/src/connection.spec.ts +1 -1
- package/src/control/client.ts +1 -1
- package/src/control/external.ts +1 -1
- package/src/control/index.ts +1 -1
- package/src/control/state.spec.ts +1 -1
- package/src/control/state.ts +1 -1
- package/src/device/access.spec.ts +1 -1
- package/src/device/client.ts +90 -44
- package/src/device/device.spec.ts +1 -1
- package/src/device/external.ts +1 -1
- package/src/device/index.ts +1 -1
- package/src/device/payload.spec.ts +118 -0
- package/src/device/payload.ts +56 -31
- package/src/errors.spec.ts +2 -2
- package/src/errors.ts +1 -1
- package/src/framer/adapter.spec.ts +1 -1
- package/src/framer/adapter.ts +6 -8
- package/src/framer/client.spec.ts +1 -1
- package/src/framer/client.ts +1 -1
- package/src/framer/codec.spec.ts +1 -1
- package/src/framer/codec.ts +1 -1
- package/src/framer/deleter.spec.ts +1 -1
- package/src/framer/deleter.ts +1 -1
- package/src/framer/external.ts +1 -1
- package/src/framer/frame.spec.ts +1 -1
- package/src/framer/frame.ts +9 -9
- package/src/framer/index.ts +1 -1
- package/src/framer/iterator.spec.ts +1 -1
- package/src/framer/iterator.ts +1 -1
- package/src/framer/payload.ts +1 -1
- package/src/framer/reader.spec.ts +1 -1
- package/src/framer/reader.ts +1 -1
- package/src/framer/streamProxy.ts +1 -1
- package/src/framer/streamer.spec.ts +1 -2
- package/src/framer/streamer.ts +4 -4
- package/src/framer/writer.spec.ts +1 -1
- package/src/framer/writer.ts +1 -1
- package/src/{ontology/group → group}/access.spec.ts +8 -8
- package/src/{ontology/group → group}/client.ts +2 -2
- package/src/group/external.ts +11 -0
- package/src/{ontology/group → group}/group.spec.ts +10 -10
- package/src/{workspace/log → group}/index.ts +2 -2
- package/src/{ontology/group → group}/payload.ts +1 -1
- package/src/index.ts +7 -6
- package/src/label/access.spec.ts +2 -2
- package/src/label/client.ts +2 -2
- package/src/label/external.ts +1 -1
- package/src/label/index.ts +1 -1
- package/src/label/label.spec.ts +5 -5
- package/src/label/payload.ts +1 -1
- package/src/{workspace/lineplot → lineplot}/access.spec.ts +15 -15
- package/src/{workspace/lineplot → lineplot}/client.ts +14 -14
- package/src/lineplot/external.ts +11 -0
- package/src/{ontology/group → lineplot}/index.ts +2 -2
- package/src/{workspace/lineplot → lineplot}/lineplot.spec.ts +13 -13
- package/src/{workspace/lineplot → lineplot}/payload.ts +1 -1
- package/src/{workspace/log → log}/access.spec.ts +17 -19
- package/src/{workspace/log → log}/client.ts +14 -14
- package/src/{workspace/schematic/index.ts → log/external.ts} +3 -2
- package/src/{workspace/table → log}/index.ts +2 -2
- package/src/{workspace/log → log}/log.spec.ts +11 -11
- package/src/{workspace/log → log}/payload.ts +1 -1
- package/src/ontology/client.ts +7 -14
- package/src/ontology/external.ts +1 -1
- package/src/ontology/index.ts +1 -1
- package/src/ontology/ontology.spec.ts +13 -13
- package/src/ontology/payload.ts +6 -3
- package/src/ontology/writer.ts +1 -1
- package/src/rack/access.spec.ts +1 -1
- package/src/rack/client.ts +1 -1
- package/src/rack/external.ts +1 -1
- package/src/rack/index.ts +1 -1
- package/src/rack/payload.ts +1 -1
- package/src/rack/rack.spec.ts +1 -1
- package/src/ranger/access.spec.ts +1 -1
- package/src/ranger/{alias.ts → alias/client.ts} +7 -38
- package/src/{workspace/lineplot → ranger/alias}/external.ts +11 -3
- package/src/{workspace/lineplot → ranger/alias}/index.ts +2 -2
- package/src/ranger/alias/payload.ts +50 -0
- package/src/ranger/client.ts +27 -20
- package/src/ranger/external.ts +23 -1
- package/src/ranger/index.ts +1 -1
- package/src/ranger/{kv.ts → kv/client.ts} +6 -20
- package/src/{workspace/schematic → ranger/kv}/external.ts +8 -4
- package/src/ranger/kv/index.ts +10 -0
- package/src/ranger/kv/payload.ts +32 -0
- package/src/ranger/payload.ts +3 -3
- package/src/ranger/ranger.spec.ts +2 -2
- package/src/ranger/writer.ts +1 -1
- package/src/{workspace/schematic → schematic}/access.spec.ts +15 -15
- package/src/{workspace/schematic → schematic}/client.ts +15 -15
- package/src/{workspace/log → schematic}/external.ts +4 -3
- package/src/schematic/index.ts +10 -0
- package/src/{workspace/schematic → schematic}/payload.ts +1 -1
- package/src/{workspace/schematic → schematic}/schematic.spec.ts +18 -18
- package/src/{workspace/schematic → schematic}/symbol/access.spec.ts +20 -20
- package/src/{workspace/schematic → schematic}/symbol/client.spec.ts +17 -17
- package/src/{workspace/schematic → schematic}/symbol/client.ts +9 -9
- package/src/{ontology/group → schematic/symbol}/external.ts +3 -3
- package/src/schematic/symbol/index.ts +10 -0
- package/src/{workspace/schematic → schematic}/symbol/payload.ts +1 -1
- package/src/status/access.spec.ts +1 -1
- package/src/status/client.ts +1 -1
- package/src/status/external.ts +1 -1
- package/src/status/index.ts +1 -1
- package/src/status/payload.ts +2 -2
- package/src/status/status.spec.ts +3 -3
- package/src/{workspace/table → table}/access.spec.ts +15 -15
- package/src/{workspace/table → table}/client.ts +16 -13
- package/src/table/external.ts +11 -0
- package/src/table/index.ts +10 -0
- package/src/{workspace/table → table}/payload.ts +1 -1
- package/src/{workspace/table → table}/table.spec.ts +13 -13
- package/src/task/access.spec.ts +1 -1
- package/src/task/client.ts +11 -6
- package/src/task/external.ts +1 -1
- package/src/task/index.ts +1 -1
- package/src/task/payload.spec.ts +113 -0
- package/src/task/payload.ts +14 -10
- package/src/task/task.spec.ts +1 -1
- package/src/testutil/access.ts +1 -1
- package/src/testutil/channels.ts +1 -1
- package/src/testutil/client.ts +1 -1
- package/src/testutil/telem.ts +1 -1
- package/src/transport.ts +1 -1
- package/src/user/access.spec.ts +1 -1
- package/src/user/client.ts +1 -1
- package/src/user/external.ts +1 -1
- package/src/user/index.ts +1 -1
- package/src/user/payload.ts +1 -1
- package/src/user/user.spec.ts +1 -1
- package/src/util/decodeJSONString.ts +1 -1
- package/src/util/parseWithoutKeyConversion.ts +1 -1
- package/src/util/retrieve.spec.ts +1 -1
- package/src/util/retrieve.ts +1 -1
- package/src/util/telem.ts +1 -1
- package/src/view/client.ts +96 -0
- package/src/view/external.ts +11 -0
- package/src/view/index.ts +10 -0
- package/src/view/payload.ts +25 -0
- package/src/view/view.spec.ts +161 -0
- package/src/vite-env.d.ts +1 -1
- package/src/workspace/access.spec.ts +1 -1
- package/src/workspace/client.ts +1 -13
- package/src/workspace/external.ts +1 -1
- package/src/workspace/index.ts +1 -1
- package/src/workspace/payload.ts +1 -1
- package/src/workspace/workspace.spec.ts +1 -1
- package/vite.config.ts +1 -1
- package/dist/src/ontology/group/access.spec.d.ts.map +0 -1
- package/dist/src/ontology/group/client.d.ts.map +0 -1
- package/dist/src/ontology/group/external.d.ts.map +0 -1
- package/dist/src/ontology/group/group.spec.d.ts.map +0 -1
- package/dist/src/ontology/group/index.d.ts.map +0 -1
- package/dist/src/ontology/group/payload.d.ts.map +0 -1
- package/dist/src/ranger/alias.d.ts.map +0 -1
- package/dist/src/ranger/kv.d.ts +0 -48
- package/dist/src/ranger/kv.d.ts.map +0 -1
- package/dist/src/workspace/lineplot/access.spec.d.ts.map +0 -1
- package/dist/src/workspace/lineplot/client.d.ts.map +0 -1
- package/dist/src/workspace/lineplot/external.d.ts.map +0 -1
- package/dist/src/workspace/lineplot/index.d.ts.map +0 -1
- package/dist/src/workspace/lineplot/lineplot.spec.d.ts.map +0 -1
- package/dist/src/workspace/lineplot/payload.d.ts.map +0 -1
- package/dist/src/workspace/log/access.spec.d.ts.map +0 -1
- package/dist/src/workspace/log/client.d.ts.map +0 -1
- package/dist/src/workspace/log/external.d.ts.map +0 -1
- package/dist/src/workspace/log/index.d.ts.map +0 -1
- package/dist/src/workspace/log/log.spec.d.ts.map +0 -1
- package/dist/src/workspace/log/payload.d.ts.map +0 -1
- package/dist/src/workspace/schematic/access.spec.d.ts.map +0 -1
- package/dist/src/workspace/schematic/client.d.ts.map +0 -1
- package/dist/src/workspace/schematic/external.d.ts.map +0 -1
- package/dist/src/workspace/schematic/index.d.ts.map +0 -1
- package/dist/src/workspace/schematic/payload.d.ts.map +0 -1
- package/dist/src/workspace/schematic/schematic.spec.d.ts.map +0 -1
- package/dist/src/workspace/schematic/symbol/access.spec.d.ts.map +0 -1
- package/dist/src/workspace/schematic/symbol/client.d.ts.map +0 -1
- package/dist/src/workspace/schematic/symbol/client.spec.d.ts.map +0 -1
- package/dist/src/workspace/schematic/symbol/external.d.ts.map +0 -1
- package/dist/src/workspace/schematic/symbol/index.d.ts.map +0 -1
- package/dist/src/workspace/schematic/symbol/payload.d.ts.map +0 -1
- package/dist/src/workspace/table/access.spec.d.ts.map +0 -1
- package/dist/src/workspace/table/client.d.ts.map +0 -1
- package/dist/src/workspace/table/external.d.ts.map +0 -1
- package/dist/src/workspace/table/index.d.ts.map +0 -1
- package/dist/src/workspace/table/payload.d.ts.map +0 -1
- package/dist/src/workspace/table/table.spec.d.ts.map +0 -1
- package/src/workspace/schematic/symbol/external.ts +0 -11
- package/src/workspace/schematic/symbol/index.ts +0 -10
- package/src/workspace/table/external.ts +0 -11
- /package/dist/src/{ontology/group → group}/access.spec.d.ts +0 -0
- /package/dist/src/{ontology/group → group}/external.d.ts +0 -0
- /package/dist/src/{ontology/group → group}/group.spec.d.ts +0 -0
- /package/dist/src/{ontology/group → group}/index.d.ts +0 -0
- /package/dist/src/{workspace/lineplot → lineplot}/access.spec.d.ts +0 -0
- /package/dist/src/{workspace/lineplot → lineplot}/external.d.ts +0 -0
- /package/dist/src/{workspace/lineplot → lineplot}/index.d.ts +0 -0
- /package/dist/src/{workspace/lineplot → lineplot}/lineplot.spec.d.ts +0 -0
- /package/dist/src/{workspace/log → log}/access.spec.d.ts +0 -0
- /package/dist/src/{workspace/log → log}/external.d.ts +0 -0
- /package/dist/src/{workspace/log → log}/index.d.ts +0 -0
- /package/dist/src/{workspace/log → log}/log.spec.d.ts +0 -0
- /package/dist/src/{workspace/schematic → schematic}/access.spec.d.ts +0 -0
- /package/dist/src/{workspace/schematic → schematic}/external.d.ts +0 -0
- /package/dist/src/{workspace/schematic → schematic}/index.d.ts +0 -0
- /package/dist/src/{workspace/schematic → schematic}/schematic.spec.d.ts +0 -0
- /package/dist/src/{workspace/schematic → schematic}/symbol/access.spec.d.ts +0 -0
- /package/dist/src/{workspace/schematic → schematic}/symbol/client.spec.d.ts +0 -0
- /package/dist/src/{workspace/schematic → schematic}/symbol/external.d.ts +0 -0
- /package/dist/src/{workspace/schematic → schematic}/symbol/index.d.ts +0 -0
- /package/dist/src/{workspace/schematic → schematic}/symbol/payload.d.ts +0 -0
- /package/dist/src/{workspace/table → table}/access.spec.d.ts +0 -0
- /package/dist/src/{workspace/table → table}/external.d.ts +0 -0
- /package/dist/src/{workspace/table → table}/index.d.ts +0 -0
- /package/dist/src/{workspace/table → table}/table.spec.d.ts +0 -0
package/src/arc/payload.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2026 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Use of this software is governed by the Business Source License included in the file
|
|
4
4
|
// licenses/BSL.txt.
|
|
@@ -11,7 +11,6 @@ import { record, xy } from "@synnaxlabs/x";
|
|
|
11
11
|
import { z } from "zod/v4";
|
|
12
12
|
|
|
13
13
|
import { ontology } from "@/ontology";
|
|
14
|
-
import { statusZ as baseStatusZ } from "@/status/payload";
|
|
15
14
|
import { parseWithoutKeyConversion } from "@/util/parseWithoutKeyConversion";
|
|
16
15
|
|
|
17
16
|
export const irNodeZ = z.object({
|
|
@@ -48,27 +47,23 @@ export const keyZ = z.uuid();
|
|
|
48
47
|
export type Key = z.infer<typeof keyZ>;
|
|
49
48
|
export type Params = Key | Key[];
|
|
50
49
|
|
|
51
|
-
export const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
export const statusZ = baseStatusZ(statusDetailsZ);
|
|
56
|
-
|
|
57
|
-
export type Status = z.infer<typeof statusZ>;
|
|
50
|
+
export const modeZ = z
|
|
51
|
+
.enum(["graph", "text"])
|
|
52
|
+
.or(z.literal("").transform<"graph">(() => "graph"));
|
|
53
|
+
export type Mode = z.infer<typeof modeZ>;
|
|
58
54
|
|
|
59
55
|
export const arcZ = z.object({
|
|
60
56
|
key: keyZ,
|
|
61
57
|
name: z.string(),
|
|
62
58
|
graph: graphZ,
|
|
63
59
|
text: textZ,
|
|
64
|
-
deploy: z.boolean(),
|
|
65
60
|
version: z.string(),
|
|
66
|
-
|
|
61
|
+
mode: modeZ,
|
|
67
62
|
});
|
|
68
63
|
|
|
69
64
|
export interface Arc extends z.infer<typeof arcZ> {}
|
|
70
65
|
|
|
71
|
-
export const newZ = arcZ.partial({ key: true
|
|
66
|
+
export const newZ = arcZ.partial({ key: true, mode: true });
|
|
72
67
|
export interface New extends z.input<typeof newZ> {}
|
|
73
68
|
|
|
74
69
|
export const ONTOLOGY_TYPE = "arc";
|
package/src/auth/auth.spec.ts
CHANGED
package/src/auth/auth.ts
CHANGED
package/src/auth/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2026 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Use of this software is governed by the Business Source License included in the file
|
|
4
4
|
// licenses/BSL.txt.
|
|
@@ -55,7 +55,6 @@ describe("channelchannel.Retriever", () => {
|
|
|
55
55
|
virtual: false,
|
|
56
56
|
expression: "",
|
|
57
57
|
operations: [],
|
|
58
|
-
requires: [],
|
|
59
58
|
}));
|
|
60
59
|
});
|
|
61
60
|
const retriever = new channel.DebouncedBatchRetriever(base, 10);
|
|
@@ -85,7 +84,6 @@ describe("channelchannel.Retriever", () => {
|
|
|
85
84
|
virtual: false,
|
|
86
85
|
expression: "",
|
|
87
86
|
operations: [],
|
|
88
|
-
requires: [],
|
|
89
87
|
}));
|
|
90
88
|
});
|
|
91
89
|
const retriever = new channel.DebouncedBatchRetriever(base, 10);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2026 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Use of this software is governed by the Business Source License included in the file
|
|
4
4
|
// licenses/BSL.txt.
|
|
@@ -11,7 +11,7 @@ import { DataType, id } from "@synnaxlabs/x";
|
|
|
11
11
|
import { describe, expect, it, test } from "vitest";
|
|
12
12
|
|
|
13
13
|
import { Channel } from "@/channel/client";
|
|
14
|
-
import { NotFoundError
|
|
14
|
+
import { NotFoundError } from "@/errors";
|
|
15
15
|
import { createTestClient } from "@/testutil/client";
|
|
16
16
|
|
|
17
17
|
const client = createTestClient();
|
|
@@ -51,24 +51,17 @@ describe("Channel", () => {
|
|
|
51
51
|
expect(calculatedCH.expression).toEqual(`return ${chOneName} * 2`);
|
|
52
52
|
});
|
|
53
53
|
|
|
54
|
-
test("create calculated
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
);
|
|
66
|
-
expect(PathError.matches(e)).toBe(true);
|
|
67
|
-
expect((e as PathError).path).toEqual(["requires"]);
|
|
68
|
-
expect((e as PathError).error.message).contain(
|
|
69
|
-
"calculated channels must require at least one channel",
|
|
70
|
-
);
|
|
71
|
-
}
|
|
54
|
+
test("create calculated channel with constant expression", async () => {
|
|
55
|
+
// Calculated channels can now have constant expressions that don't
|
|
56
|
+
// reference other channels
|
|
57
|
+
const calculatedCH = await client.channels.create({
|
|
58
|
+
name: id.create(),
|
|
59
|
+
virtual: true,
|
|
60
|
+
dataType: DataType.FLOAT32,
|
|
61
|
+
expression: `return 2`,
|
|
62
|
+
});
|
|
63
|
+
expect(calculatedCH.virtual).toEqual(true);
|
|
64
|
+
expect(calculatedCH.expression).toEqual(`return 2`);
|
|
72
65
|
});
|
|
73
66
|
|
|
74
67
|
test("create index and indexed pair", async () => {
|
package/src/channel/client.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2026 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Use of this software is governed by the Business Source License included in the file
|
|
4
4
|
// licenses/BSL.txt.
|
|
@@ -24,7 +24,6 @@ import {
|
|
|
24
24
|
type Key,
|
|
25
25
|
type KeyOrName,
|
|
26
26
|
keyZ,
|
|
27
|
-
type Name,
|
|
28
27
|
type New,
|
|
29
28
|
ontologyID,
|
|
30
29
|
type Operation,
|
|
@@ -45,8 +44,8 @@ import {
|
|
|
45
44
|
import { type Writer } from "@/channel/writer";
|
|
46
45
|
import { ValidationError } from "@/errors";
|
|
47
46
|
import { type framer } from "@/framer";
|
|
47
|
+
import { group } from "@/group";
|
|
48
48
|
import { type ontology } from "@/ontology";
|
|
49
|
-
import { group } from "@/ontology/group";
|
|
50
49
|
import { checkForMultipleOrNoResults } from "@/util/retrieve";
|
|
51
50
|
|
|
52
51
|
interface CreateOptions {
|
|
@@ -73,10 +72,9 @@ export class Channel {
|
|
|
73
72
|
*/
|
|
74
73
|
readonly key: Key;
|
|
75
74
|
/**
|
|
76
|
-
* A human-readable name for the channel. This name is not guaranteed to be
|
|
77
|
-
* unique.
|
|
75
|
+
* A human-readable name for the channel. This name is not guaranteed to be unique.
|
|
78
76
|
*/
|
|
79
|
-
readonly name:
|
|
77
|
+
readonly name: string;
|
|
80
78
|
/**
|
|
81
79
|
* The data type of the channel.
|
|
82
80
|
*/
|
|
@@ -111,12 +109,11 @@ export class Channel {
|
|
|
111
109
|
*/
|
|
112
110
|
readonly virtual: boolean;
|
|
113
111
|
/**
|
|
114
|
-
* Only used for calculated channels. Specifies the
|
|
112
|
+
* Only used for calculated channels. Specifies the Arc expression used to evaluate
|
|
115
113
|
* the calculated value
|
|
116
114
|
*/
|
|
117
115
|
readonly expression: string;
|
|
118
116
|
readonly operations: Operation[];
|
|
119
|
-
readonly requires: Key[];
|
|
120
117
|
/**
|
|
121
118
|
* The status of the channel.
|
|
122
119
|
*/
|
|
@@ -136,14 +133,12 @@ export class Channel {
|
|
|
136
133
|
status: argsStatus,
|
|
137
134
|
expression = "",
|
|
138
135
|
operations = [],
|
|
139
|
-
requires = [],
|
|
140
136
|
}: New & {
|
|
141
137
|
internal?: boolean;
|
|
142
138
|
frameClient?: framer.Client;
|
|
143
139
|
density?: CrudeDensity;
|
|
144
140
|
status?: status.Crude;
|
|
145
141
|
operations?: Operation[];
|
|
146
|
-
requires?: Key[];
|
|
147
142
|
}) {
|
|
148
143
|
this.key = keyZ.parse(key);
|
|
149
144
|
this.name = name;
|
|
@@ -156,7 +151,6 @@ export class Channel {
|
|
|
156
151
|
this.virtual = virtual;
|
|
157
152
|
this.expression = expression;
|
|
158
153
|
this.operations = operations;
|
|
159
|
-
this.requires = requires;
|
|
160
154
|
if (argsStatus != null) this.status = status.create(argsStatus);
|
|
161
155
|
this._frameClient = frameClient ?? null;
|
|
162
156
|
}
|
|
@@ -182,7 +176,6 @@ export class Channel {
|
|
|
182
176
|
isIndex: this.isIndex,
|
|
183
177
|
internal: this.internal,
|
|
184
178
|
virtual: this.virtual,
|
|
185
|
-
requires: this.requires,
|
|
186
179
|
expression: this.expression,
|
|
187
180
|
status: this.status,
|
|
188
181
|
operations: this.operations,
|
|
@@ -222,16 +215,14 @@ export class Channel {
|
|
|
222
215
|
}
|
|
223
216
|
}
|
|
224
217
|
|
|
225
|
-
export const CALCULATION_STATUS_CHANNEL_NAME = "sy_calculation_status";
|
|
226
|
-
|
|
227
218
|
const retrieveGroupReqZ = z.object({});
|
|
228
219
|
|
|
229
220
|
const retrieveGroupResZ = z.object({ group: group.groupZ });
|
|
230
221
|
|
|
231
222
|
/**
|
|
232
|
-
* The
|
|
233
|
-
*
|
|
234
|
-
*
|
|
223
|
+
* The main client class for executing channel operations against a Synnax Core. This
|
|
224
|
+
* class should not be instantiated directly, and instead should be used through the
|
|
225
|
+
* `channels` property of an {@link Synnax} client.
|
|
235
226
|
*/
|
|
236
227
|
export class Client {
|
|
237
228
|
private readonly frameClient: framer.Client;
|
|
@@ -437,27 +428,3 @@ export class Client {
|
|
|
437
428
|
|
|
438
429
|
export const isCalculated = ({ virtual, expression }: Payload): boolean =>
|
|
439
430
|
virtual && expression !== "";
|
|
440
|
-
|
|
441
|
-
export const isLegacyCalculated = (pld: Payload): boolean =>
|
|
442
|
-
isCalculated(pld) && pld.requires.length > 0;
|
|
443
|
-
|
|
444
|
-
export const resolveLegacyCalculatedIndex = async (
|
|
445
|
-
retrieve: (key: Key) => Promise<Payload | null>,
|
|
446
|
-
channel: Payload,
|
|
447
|
-
): Promise<Key | null> => {
|
|
448
|
-
if (!isCalculated(channel)) return channel.index;
|
|
449
|
-
for (const required of channel.requires) {
|
|
450
|
-
const requiredChannel = await retrieve(required);
|
|
451
|
-
if (requiredChannel == null) return null;
|
|
452
|
-
if (!requiredChannel.virtual) return requiredChannel.index;
|
|
453
|
-
}
|
|
454
|
-
for (const required of channel.requires) {
|
|
455
|
-
const requiredChannel = await retrieve(required);
|
|
456
|
-
if (requiredChannel == null) return null;
|
|
457
|
-
if (isCalculated(requiredChannel)) {
|
|
458
|
-
const index = await resolveLegacyCalculatedIndex(retrieve, requiredChannel);
|
|
459
|
-
if (index != null) return index;
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
return null;
|
|
463
|
-
};
|
package/src/channel/external.ts
CHANGED
package/src/channel/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2026 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Use of this software is governed by the Business Source License included in the file
|
|
4
4
|
// licenses/BSL.txt.
|
|
@@ -43,48 +43,6 @@ describe("nameZ", () => {
|
|
|
43
43
|
expect(result.success).toBe(false);
|
|
44
44
|
expect(result.error?.issues[0].message).toContain("Name must not be empty");
|
|
45
45
|
});
|
|
46
|
-
|
|
47
|
-
it("should reject name starting with digit", () => {
|
|
48
|
-
const result = nameZ.safeParse("1sensor");
|
|
49
|
-
expect(result.success).toBe(false);
|
|
50
|
-
// Regex validation covers both "cannot start with digit" and "invalid characters"
|
|
51
|
-
expect(result.error?.issues[0].message).toContain(
|
|
52
|
-
"can only contain letters, digits, and underscores",
|
|
53
|
-
);
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
it("should reject name with spaces", () => {
|
|
57
|
-
const result = nameZ.safeParse("my channel");
|
|
58
|
-
expect(result.success).toBe(false);
|
|
59
|
-
expect(result.error?.issues[0].message).toContain(
|
|
60
|
-
"can only contain letters, digits, and underscores",
|
|
61
|
-
);
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
it("should reject name with special characters", () => {
|
|
65
|
-
const result = nameZ.safeParse("sensor!");
|
|
66
|
-
expect(result.success).toBe(false);
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
it("should reject name with hyphens", () => {
|
|
70
|
-
const result = nameZ.safeParse("sensor-temp");
|
|
71
|
-
expect(result.success).toBe(false);
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
it("should reject name with dots", () => {
|
|
75
|
-
const result = nameZ.safeParse("sensor.temp");
|
|
76
|
-
expect(result.success).toBe(false);
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
it("should reject name with parentheses", () => {
|
|
80
|
-
const result = nameZ.safeParse("sensor(1)");
|
|
81
|
-
expect(result.success).toBe(false);
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
it("should reject name with brackets", () => {
|
|
85
|
-
const result = nameZ.safeParse("sensor[0]");
|
|
86
|
-
expect(result.success).toBe(false);
|
|
87
|
-
});
|
|
88
46
|
});
|
|
89
47
|
});
|
|
90
48
|
|
|
@@ -106,21 +64,6 @@ describe("newZ", () => {
|
|
|
106
64
|
expect(result.success).toBe(false);
|
|
107
65
|
});
|
|
108
66
|
|
|
109
|
-
it("should reject name starting with digit", () => {
|
|
110
|
-
const result = newZ.safeParse({ ...validNewChannel, name: "1sensor" });
|
|
111
|
-
expect(result.success).toBe(false);
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
it("should reject name with spaces", () => {
|
|
115
|
-
const result = newZ.safeParse({ ...validNewChannel, name: "my channel" });
|
|
116
|
-
expect(result.success).toBe(false);
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
it("should reject name with special characters", () => {
|
|
120
|
-
const result = newZ.safeParse({ ...validNewChannel, name: "sensor-temp" });
|
|
121
|
-
expect(result.success).toBe(false);
|
|
122
|
-
});
|
|
123
|
-
|
|
124
67
|
it("should accept name with underscores", () => {
|
|
125
68
|
const result = newZ.safeParse({
|
|
126
69
|
...validNewChannel,
|
package/src/channel/payload.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2026 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Use of this software is governed by the Business Source License included in the file
|
|
4
4
|
// licenses/BSL.txt.
|
|
@@ -30,19 +30,10 @@ export const keyZ = z.uint32().or(
|
|
|
30
30
|
);
|
|
31
31
|
export type Key = z.infer<typeof keyZ>;
|
|
32
32
|
export type Keys = Key[];
|
|
33
|
-
const
|
|
34
|
-
export
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
.regex(
|
|
38
|
-
VALID_NAME_PATTERN,
|
|
39
|
-
"Name can only contain letters, digits, and underscores, and cannot start with a digit",
|
|
40
|
-
);
|
|
41
|
-
export type Name = z.infer<typeof nameZ>;
|
|
42
|
-
export type Names = Name[];
|
|
43
|
-
export type KeyOrName = Key | Name;
|
|
44
|
-
export type KeysOrNames = Keys | Names;
|
|
45
|
-
export type PrimitiveParams = Key | Name | Keys | Names;
|
|
33
|
+
export const nameZ = z.string().min(1, "Name must not be empty");
|
|
34
|
+
export type KeyOrName = Key | string;
|
|
35
|
+
export type KeysOrNames = Keys | string[];
|
|
36
|
+
export type PrimitiveParams = KeyOrName | KeysOrNames;
|
|
46
37
|
|
|
47
38
|
export const OPERATION_TYPES = ["min", "max", "avg", "none"] as const;
|
|
48
39
|
export const operationType = z.enum(OPERATION_TYPES);
|
|
@@ -58,6 +49,13 @@ export type Operation = z.infer<typeof operationZ>;
|
|
|
58
49
|
|
|
59
50
|
export const statusZ = status.statusZ();
|
|
60
51
|
export type Status = z.infer<typeof statusZ>;
|
|
52
|
+
|
|
53
|
+
export const calculationStatusDetailsZ = z.object({ channel: keyZ });
|
|
54
|
+
export type CalculationStatusDetails = z.infer<typeof calculationStatusDetailsZ>;
|
|
55
|
+
export const calculationStatusZ = status.statusZ(calculationStatusDetailsZ);
|
|
56
|
+
export type CalculationStatus = z.infer<typeof calculationStatusZ>;
|
|
57
|
+
|
|
58
|
+
export const statusKey = (key: Key): string => ontology.idToString(ontologyID(key));
|
|
61
59
|
export const payloadZ = z.object({
|
|
62
60
|
name: z.string(),
|
|
63
61
|
key: keyZ,
|
|
@@ -71,7 +69,6 @@ export const payloadZ = z.object({
|
|
|
71
69
|
expression: z.string().default(""),
|
|
72
70
|
status: statusZ.optional(),
|
|
73
71
|
operations: array.nullableZ(operationZ),
|
|
74
|
-
requires: array.nullableZ(keyZ),
|
|
75
72
|
});
|
|
76
73
|
export interface Payload extends z.infer<typeof payloadZ> {}
|
|
77
74
|
|
|
@@ -85,11 +82,12 @@ export const newZ = payloadZ.extend({
|
|
|
85
82
|
virtual: z.boolean().default(false),
|
|
86
83
|
expression: z.string().default(""),
|
|
87
84
|
operations: array.nullableZ(operationZ).optional(),
|
|
88
|
-
requires: array.nullableZ(keyZ).optional(),
|
|
89
85
|
});
|
|
90
86
|
|
|
91
|
-
export interface New
|
|
92
|
-
|
|
87
|
+
export interface New extends Omit<
|
|
88
|
+
z.input<typeof newZ>,
|
|
89
|
+
"dataType" | "status" | "internal"
|
|
90
|
+
> {
|
|
93
91
|
dataType: CrudeDataType;
|
|
94
92
|
}
|
|
95
93
|
|
|
@@ -98,13 +96,15 @@ export const paramsZ = z.union([
|
|
|
98
96
|
zod.toArray(nameZ),
|
|
99
97
|
zod.toArray(payloadZ).transform((p) => p.map((c) => c.key)),
|
|
100
98
|
]);
|
|
101
|
-
export type Params =
|
|
99
|
+
export type Params = PrimitiveParams | Payload | Payload[];
|
|
102
100
|
|
|
103
101
|
export const ontologyID = ontology.createIDFactory<Key>("channel");
|
|
104
102
|
export const TYPE_ONTOLOGY_ID = ontologyID(0);
|
|
105
103
|
|
|
106
104
|
const CHAR_REGEX = /[a-zA-Z0-9_]/;
|
|
107
105
|
|
|
106
|
+
const VALID_NAME_PATTERN = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
|
|
107
|
+
|
|
108
108
|
export const escapeInvalidName = (name: string, changeEmptyToUnderscore = false) => {
|
|
109
109
|
if (name === "") return changeEmptyToUnderscore ? "_" : "";
|
|
110
110
|
if (name.match(VALID_NAME_PATTERN)) return name;
|
package/src/channel/retriever.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2026 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Use of this software is governed by the Business Source License included in the file
|
|
4
4
|
// licenses/BSL.txt.
|
|
@@ -18,11 +18,10 @@ import {
|
|
|
18
18
|
type Keys,
|
|
19
19
|
type KeysOrNames,
|
|
20
20
|
keyZ,
|
|
21
|
-
type Name,
|
|
22
|
-
type Names,
|
|
23
21
|
type Params,
|
|
24
22
|
type Payload,
|
|
25
23
|
payloadZ,
|
|
24
|
+
type PrimitiveParams,
|
|
26
25
|
} from "@/channel/payload";
|
|
27
26
|
import { QueryError } from "@/errors";
|
|
28
27
|
import { keyZ as rangeKeyZ } from "@/ranger/payload";
|
|
@@ -48,8 +47,10 @@ const reqZ = z.object({
|
|
|
48
47
|
});
|
|
49
48
|
export interface RetrieveRequest extends z.input<typeof reqZ> {}
|
|
50
49
|
|
|
51
|
-
export interface RetrieveOptions
|
|
52
|
-
|
|
50
|
+
export interface RetrieveOptions extends Omit<
|
|
51
|
+
RetrieveRequest,
|
|
52
|
+
"keys" | "names" | "search"
|
|
53
|
+
> {}
|
|
53
54
|
export interface PageOptions extends Omit<RetrieveOptions, "offset" | "limit"> {}
|
|
54
55
|
|
|
55
56
|
const resZ = z.object({ channels: array.nullableZ(payloadZ) });
|
|
@@ -60,7 +61,7 @@ export const analyzeParams = (
|
|
|
60
61
|
if (Array.isArray(channels) && channels.length > 0 && typeof channels[0] === "object")
|
|
61
62
|
channels = (channels as Payload[]).map((c) => c.key);
|
|
62
63
|
else if (typeof channels === "object" && "key" in channels) channels = [channels.key];
|
|
63
|
-
return analyzeParameters(channels as
|
|
64
|
+
return analyzeParameters(channels as PrimitiveParams, {
|
|
64
65
|
number: "keys",
|
|
65
66
|
string: "names",
|
|
66
67
|
});
|
package/src/channel/writer.ts
CHANGED
package/src/client.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2026 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Use of this software is governed by the Business Source License included in the file
|
|
4
4
|
// licenses/BSL.txt.
|
|
@@ -19,14 +19,20 @@ import { control } from "@/control";
|
|
|
19
19
|
import { device } from "@/device";
|
|
20
20
|
import { errorsMiddleware } from "@/errors";
|
|
21
21
|
import { framer } from "@/framer";
|
|
22
|
+
import { group } from "@/group";
|
|
22
23
|
import { label } from "@/label";
|
|
24
|
+
import { lineplot } from "@/lineplot";
|
|
25
|
+
import { log } from "@/log";
|
|
23
26
|
import { ontology } from "@/ontology";
|
|
24
27
|
import { rack } from "@/rack";
|
|
25
28
|
import { ranger } from "@/ranger";
|
|
29
|
+
import { schematic } from "@/schematic";
|
|
26
30
|
import { status } from "@/status";
|
|
31
|
+
import { table } from "@/table";
|
|
27
32
|
import { task } from "@/task";
|
|
28
33
|
import { Transport } from "@/transport";
|
|
29
34
|
import { user } from "@/user";
|
|
35
|
+
import { view } from "@/view";
|
|
30
36
|
import { workspace } from "@/workspace";
|
|
31
37
|
|
|
32
38
|
export const synnaxParamsZ = z.object({
|
|
@@ -71,6 +77,12 @@ export default class Synnax extends framer.Client {
|
|
|
71
77
|
readonly devices: device.Client;
|
|
72
78
|
readonly control: control.Client;
|
|
73
79
|
readonly arcs: arc.Client;
|
|
80
|
+
readonly views: view.Client;
|
|
81
|
+
readonly schematics: schematic.Client;
|
|
82
|
+
readonly lineplots: lineplot.Client;
|
|
83
|
+
readonly logs: log.Client;
|
|
84
|
+
readonly tables: table.Client;
|
|
85
|
+
readonly groups: group.Client;
|
|
74
86
|
static readonly connectivity = connection.Checker;
|
|
75
87
|
private readonly transport: Transport;
|
|
76
88
|
|
|
@@ -129,7 +141,7 @@ export default class Synnax extends framer.Client {
|
|
|
129
141
|
parsedParams.name,
|
|
130
142
|
);
|
|
131
143
|
this.control = new control.Client(this);
|
|
132
|
-
this.ontology = new ontology.Client(transport.unary
|
|
144
|
+
this.ontology = new ontology.Client(this.transport.unary);
|
|
133
145
|
const rangeWriter = new ranger.Writer(this.transport.unary);
|
|
134
146
|
this.labels = new label.Client(this.transport.unary);
|
|
135
147
|
this.statuses = new status.Client(this.transport.unary);
|
|
@@ -153,6 +165,12 @@ export default class Synnax extends framer.Client {
|
|
|
153
165
|
this.racks = new rack.Client(this.transport.unary, this.tasks);
|
|
154
166
|
this.devices = new device.Client(this.transport.unary);
|
|
155
167
|
this.arcs = new arc.Client(this.transport.unary, this.transport.stream);
|
|
168
|
+
this.views = new view.Client(this.transport.unary);
|
|
169
|
+
this.schematics = new schematic.Client(this.transport.unary);
|
|
170
|
+
this.lineplots = new lineplot.Client(this.transport.unary);
|
|
171
|
+
this.logs = new log.Client(this.transport.unary);
|
|
172
|
+
this.tables = new table.Client(this.transport.unary);
|
|
173
|
+
this.groups = new group.Client(this.transport.unary);
|
|
156
174
|
}
|
|
157
175
|
|
|
158
176
|
get key(): string {
|
|
@@ -164,8 +182,10 @@ export default class Synnax extends framer.Client {
|
|
|
164
182
|
}
|
|
165
183
|
}
|
|
166
184
|
|
|
167
|
-
export interface CheckConnectionParams
|
|
168
|
-
|
|
185
|
+
export interface CheckConnectionParams extends Pick<
|
|
186
|
+
SynnaxParams,
|
|
187
|
+
"host" | "port" | "secure" | "retry" | "name"
|
|
188
|
+
> {}
|
|
169
189
|
|
|
170
190
|
export const checkConnection = async (params: CheckConnectionParams) =>
|
|
171
191
|
await newConnectionChecker(params).check();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2026 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Use of this software is governed by the Business Source License included in the file
|
|
4
4
|
// licenses/BSL.txt.
|
|
@@ -48,7 +48,7 @@ const createWarning = (
|
|
|
48
48
|
const toUpgrade = clientIsNewer ? "Core" : "client";
|
|
49
49
|
return `Synnax Core version ${nodeVersion != null ? `${nodeVersion} ` : ""}is too ${clientIsNewer ? "old" : "new"} for client version ${clientVersion}.
|
|
50
50
|
This may cause compatibility issues. We recommend updating the ${toUpgrade}. For more information, see
|
|
51
|
-
https://docs.synnaxlabs.com/reference/
|
|
51
|
+
https://docs.synnaxlabs.com/reference/client/resources/troubleshooting#old-${toUpgrade}-version`;
|
|
52
52
|
};
|
|
53
53
|
|
|
54
54
|
/** Polls a synnax cluster for connectivity information. */
|
package/src/connection/index.ts
CHANGED
package/src/connection.spec.ts
CHANGED
package/src/control/client.ts
CHANGED
package/src/control/external.ts
CHANGED
package/src/control/index.ts
CHANGED
package/src/control/state.ts
CHANGED