@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
|
@@ -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.
|
|
@@ -22,7 +22,7 @@ describe("LinePlot", () => {
|
|
|
22
22
|
name: "Line Plot",
|
|
23
23
|
layout: { one: 1 },
|
|
24
24
|
});
|
|
25
|
-
const linePlot = await client.
|
|
25
|
+
const linePlot = await client.lineplots.create(ws.key, {
|
|
26
26
|
name: "Line Plot",
|
|
27
27
|
data: { one: 1 },
|
|
28
28
|
});
|
|
@@ -37,12 +37,12 @@ describe("LinePlot", () => {
|
|
|
37
37
|
name: "Line Plot",
|
|
38
38
|
layout: { one: 1 },
|
|
39
39
|
});
|
|
40
|
-
const linePlot = await client.
|
|
40
|
+
const linePlot = await client.lineplots.create(ws.key, {
|
|
41
41
|
name: "Line Plot",
|
|
42
42
|
data: { one: 1 },
|
|
43
43
|
});
|
|
44
|
-
await client.
|
|
45
|
-
const res = await client.
|
|
44
|
+
await client.lineplots.rename(linePlot.key, "Line Plot2");
|
|
45
|
+
const res = await client.lineplots.retrieve({ key: linePlot.key });
|
|
46
46
|
expect(res.name).toEqual("Line Plot2");
|
|
47
47
|
});
|
|
48
48
|
});
|
|
@@ -52,12 +52,12 @@ describe("LinePlot", () => {
|
|
|
52
52
|
name: "Line Plot",
|
|
53
53
|
layout: { one: 1 },
|
|
54
54
|
});
|
|
55
|
-
const linePlot = await client.
|
|
55
|
+
const linePlot = await client.lineplots.create(ws.key, {
|
|
56
56
|
name: "Line Plot",
|
|
57
57
|
data: { one: 1 },
|
|
58
58
|
});
|
|
59
|
-
await client.
|
|
60
|
-
const res = await client.
|
|
59
|
+
await client.lineplots.setData(linePlot.key, { two: 2 });
|
|
60
|
+
const res = await client.lineplots.retrieve({ key: linePlot.key });
|
|
61
61
|
expect(res.data.two).toEqual(2);
|
|
62
62
|
});
|
|
63
63
|
});
|
|
@@ -67,14 +67,14 @@ describe("LinePlot", () => {
|
|
|
67
67
|
name: "Line Plot",
|
|
68
68
|
layout: { one: 1 },
|
|
69
69
|
});
|
|
70
|
-
const linePlot = await client.
|
|
70
|
+
const linePlot = await client.lineplots.create(ws.key, {
|
|
71
71
|
name: "Line Plot",
|
|
72
72
|
data: { one: 1 },
|
|
73
73
|
});
|
|
74
|
-
await client.
|
|
75
|
-
await expect(
|
|
76
|
-
|
|
77
|
-
)
|
|
74
|
+
await client.lineplots.delete(linePlot.key);
|
|
75
|
+
await expect(client.lineplots.retrieve({ key: linePlot.key })).rejects.toThrow(
|
|
76
|
+
NotFoundError,
|
|
77
|
+
);
|
|
78
78
|
});
|
|
79
79
|
});
|
|
80
80
|
});
|
|
@@ -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.
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
import { describe, expect, it } from "vitest";
|
|
11
11
|
|
|
12
12
|
import { AuthError, NotFoundError } from "@/errors";
|
|
13
|
+
import { log } from "@/log";
|
|
13
14
|
import { createTestClientWithPolicy } from "@/testutil/access";
|
|
14
15
|
import { createTestClient } from "@/testutil/client";
|
|
15
|
-
import { log } from "@/workspace/log";
|
|
16
16
|
|
|
17
17
|
const client = createTestClient();
|
|
18
18
|
|
|
@@ -28,13 +28,13 @@ describe("log", () => {
|
|
|
28
28
|
name: "test",
|
|
29
29
|
layout: {},
|
|
30
30
|
});
|
|
31
|
-
const randomLog = await client.
|
|
31
|
+
const randomLog = await client.logs.create(ws.key, {
|
|
32
32
|
name: "test",
|
|
33
33
|
data: {},
|
|
34
34
|
});
|
|
35
|
-
await expect(
|
|
36
|
-
|
|
37
|
-
)
|
|
35
|
+
await expect(userClient.logs.retrieve({ key: randomLog.key })).rejects.toThrow(
|
|
36
|
+
AuthError,
|
|
37
|
+
);
|
|
38
38
|
});
|
|
39
39
|
|
|
40
40
|
it("should allow the caller to retrieve logs with the correct policy", async () => {
|
|
@@ -47,11 +47,11 @@ describe("log", () => {
|
|
|
47
47
|
name: "test",
|
|
48
48
|
layout: {},
|
|
49
49
|
});
|
|
50
|
-
const randomLog = await client.
|
|
50
|
+
const randomLog = await client.logs.create(ws.key, {
|
|
51
51
|
name: "test",
|
|
52
52
|
data: {},
|
|
53
53
|
});
|
|
54
|
-
const retrieved = await userClient.
|
|
54
|
+
const retrieved = await userClient.logs.retrieve({
|
|
55
55
|
key: randomLog.key,
|
|
56
56
|
});
|
|
57
57
|
expect(retrieved.key).toBe(randomLog.key);
|
|
@@ -68,7 +68,7 @@ describe("log", () => {
|
|
|
68
68
|
name: "test",
|
|
69
69
|
layout: {},
|
|
70
70
|
});
|
|
71
|
-
await userClient.
|
|
71
|
+
await userClient.logs.create(ws.key, {
|
|
72
72
|
name: "test",
|
|
73
73
|
data: {},
|
|
74
74
|
});
|
|
@@ -85,7 +85,7 @@ describe("log", () => {
|
|
|
85
85
|
layout: {},
|
|
86
86
|
});
|
|
87
87
|
await expect(
|
|
88
|
-
userClient.
|
|
88
|
+
userClient.logs.create(ws.key, {
|
|
89
89
|
name: "test",
|
|
90
90
|
data: {},
|
|
91
91
|
}),
|
|
@@ -102,14 +102,14 @@ describe("log", () => {
|
|
|
102
102
|
name: "test",
|
|
103
103
|
layout: {},
|
|
104
104
|
});
|
|
105
|
-
const randomLog = await client.
|
|
105
|
+
const randomLog = await client.logs.create(ws.key, {
|
|
106
106
|
name: "test",
|
|
107
107
|
data: {},
|
|
108
108
|
});
|
|
109
|
-
await userClient.
|
|
110
|
-
await expect(
|
|
111
|
-
|
|
112
|
-
)
|
|
109
|
+
await userClient.logs.delete(randomLog.key);
|
|
110
|
+
await expect(userClient.logs.retrieve({ key: randomLog.key })).rejects.toThrow(
|
|
111
|
+
NotFoundError,
|
|
112
|
+
);
|
|
113
113
|
});
|
|
114
114
|
|
|
115
115
|
it("should deny access when no delete policy exists", async () => {
|
|
@@ -122,13 +122,11 @@ describe("log", () => {
|
|
|
122
122
|
name: "test",
|
|
123
123
|
layout: {},
|
|
124
124
|
});
|
|
125
|
-
const randomLog = await client.
|
|
125
|
+
const randomLog = await client.logs.create(ws.key, {
|
|
126
126
|
name: "test",
|
|
127
127
|
data: {},
|
|
128
128
|
});
|
|
129
|
-
await expect(userClient.
|
|
130
|
-
AuthError,
|
|
131
|
-
);
|
|
129
|
+
await expect(userClient.logs.delete(randomLog.key)).rejects.toThrow(AuthError);
|
|
132
130
|
});
|
|
133
131
|
});
|
|
134
132
|
});
|
|
@@ -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,8 +11,6 @@ import { sendRequired, type UnaryClient } from "@synnaxlabs/freighter";
|
|
|
11
11
|
import { array, type record } from "@synnaxlabs/x";
|
|
12
12
|
import { z } from "zod";
|
|
13
13
|
|
|
14
|
-
import { ontology } from "@/ontology";
|
|
15
|
-
import { checkForMultipleOrNoResults } from "@/util/retrieve";
|
|
16
14
|
import {
|
|
17
15
|
type Key,
|
|
18
16
|
keyZ,
|
|
@@ -21,8 +19,10 @@ import {
|
|
|
21
19
|
type New,
|
|
22
20
|
newZ,
|
|
23
21
|
type Params,
|
|
24
|
-
} from "@/
|
|
25
|
-
import {
|
|
22
|
+
} from "@/log/payload";
|
|
23
|
+
import { ontology } from "@/ontology";
|
|
24
|
+
import { checkForMultipleOrNoResults } from "@/util/retrieve";
|
|
25
|
+
import { workspace } from "@/workspace";
|
|
26
26
|
|
|
27
27
|
const renameReqZ = z.object({ key: keyZ, name: z.string() });
|
|
28
28
|
|
|
@@ -41,7 +41,7 @@ export type RetrieveMultipleParams = z.input<typeof retrieveReqZ>;
|
|
|
41
41
|
|
|
42
42
|
const retrieveResZ = z.object({ logs: array.nullableZ(logZ) });
|
|
43
43
|
|
|
44
|
-
const createReqZ = z.object({ workspace:
|
|
44
|
+
const createReqZ = z.object({ workspace: workspace.keyZ, logs: newZ.array() });
|
|
45
45
|
const createResZ = z.object({ logs: logZ.array() });
|
|
46
46
|
|
|
47
47
|
const emptyResZ = z.object({});
|
|
@@ -53,13 +53,13 @@ export class Client {
|
|
|
53
53
|
this.client = client;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
async create(workspace:
|
|
57
|
-
async create(workspace:
|
|
58
|
-
async create(workspace:
|
|
56
|
+
async create(workspace: workspace.Key, log: New): Promise<Log>;
|
|
57
|
+
async create(workspace: workspace.Key, logs: New[]): Promise<Log[]>;
|
|
58
|
+
async create(workspace: workspace.Key, logs: New | New[]): Promise<Log | Log[]> {
|
|
59
59
|
const isMany = Array.isArray(logs);
|
|
60
60
|
const res = await sendRequired(
|
|
61
61
|
this.client,
|
|
62
|
-
"/
|
|
62
|
+
"/log/create",
|
|
63
63
|
{ workspace, logs: array.toArray(logs) },
|
|
64
64
|
createReqZ,
|
|
65
65
|
createResZ,
|
|
@@ -70,7 +70,7 @@ export class Client {
|
|
|
70
70
|
async rename(key: Key, name: string): Promise<void> {
|
|
71
71
|
await sendRequired(
|
|
72
72
|
this.client,
|
|
73
|
-
"/
|
|
73
|
+
"/log/rename",
|
|
74
74
|
{ key, name },
|
|
75
75
|
renameReqZ,
|
|
76
76
|
emptyResZ,
|
|
@@ -80,7 +80,7 @@ export class Client {
|
|
|
80
80
|
async setData(key: Key, data: record.Unknown): Promise<void> {
|
|
81
81
|
await sendRequired(
|
|
82
82
|
this.client,
|
|
83
|
-
"/
|
|
83
|
+
"/log/set-data",
|
|
84
84
|
{ key, data: JSON.stringify(data) },
|
|
85
85
|
setDataReqZ,
|
|
86
86
|
emptyResZ,
|
|
@@ -95,7 +95,7 @@ export class Client {
|
|
|
95
95
|
const isSingle = singleRetrieveArgsZ.safeParse(args).success;
|
|
96
96
|
const res = await sendRequired(
|
|
97
97
|
this.client,
|
|
98
|
-
"/
|
|
98
|
+
"/log/retrieve",
|
|
99
99
|
args,
|
|
100
100
|
retrieveArgsZ,
|
|
101
101
|
retrieveResZ,
|
|
@@ -107,7 +107,7 @@ export class Client {
|
|
|
107
107
|
async delete(keys: Params): Promise<void> {
|
|
108
108
|
await sendRequired(
|
|
109
109
|
this.client,
|
|
110
|
-
"/
|
|
110
|
+
"/log/delete",
|
|
111
111
|
{ keys: array.toArray(keys) },
|
|
112
112
|
deleteReqZ,
|
|
113
113
|
emptyResZ,
|
|
@@ -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.
|
|
@@ -7,4 +7,5 @@
|
|
|
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
|
-
export *
|
|
10
|
+
export * from "@/log/client";
|
|
11
|
+
export * from "@/log/payload";
|
|
@@ -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.
|
|
@@ -7,4 +7,4 @@
|
|
|
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
|
-
export * as
|
|
10
|
+
export * as log from "@/log/external";
|
|
@@ -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,7 +19,7 @@ describe("Log", () => {
|
|
|
19
19
|
describe("create", () => {
|
|
20
20
|
test("create one", async () => {
|
|
21
21
|
const ws = await client.workspaces.create({ name: "Log", layout: { one: 1 } });
|
|
22
|
-
const log = await client.
|
|
22
|
+
const log = await client.logs.create(ws.key, {
|
|
23
23
|
name: "Log",
|
|
24
24
|
data: { one: 1 },
|
|
25
25
|
});
|
|
@@ -31,36 +31,36 @@ describe("Log", () => {
|
|
|
31
31
|
describe("rename", () => {
|
|
32
32
|
test("rename one", async () => {
|
|
33
33
|
const ws = await client.workspaces.create({ name: "Log", layout: { one: 1 } });
|
|
34
|
-
const log = await client.
|
|
34
|
+
const log = await client.logs.create(ws.key, {
|
|
35
35
|
name: "Log",
|
|
36
36
|
data: { one: 1 },
|
|
37
37
|
});
|
|
38
|
-
await client.
|
|
39
|
-
const res = await client.
|
|
38
|
+
await client.logs.rename(log.key, "Log2");
|
|
39
|
+
const res = await client.logs.retrieve({ key: log.key });
|
|
40
40
|
expect(res.name).toEqual("Log2");
|
|
41
41
|
});
|
|
42
42
|
});
|
|
43
43
|
describe("setData", () => {
|
|
44
44
|
test("set data", async () => {
|
|
45
45
|
const ws = await client.workspaces.create({ name: "Log", layout: { one: 1 } });
|
|
46
|
-
const log = await client.
|
|
46
|
+
const log = await client.logs.create(ws.key, {
|
|
47
47
|
name: "Log",
|
|
48
48
|
data: { one: 1 },
|
|
49
49
|
});
|
|
50
|
-
await client.
|
|
51
|
-
const res = await client.
|
|
50
|
+
await client.logs.setData(log.key, { two: 2 });
|
|
51
|
+
const res = await client.logs.retrieve({ key: log.key });
|
|
52
52
|
expect(res.data.two).toEqual(2);
|
|
53
53
|
});
|
|
54
54
|
});
|
|
55
55
|
describe("delete", () => {
|
|
56
56
|
test("delete one", async () => {
|
|
57
57
|
const ws = await client.workspaces.create({ name: "Log", layout: { one: 1 } });
|
|
58
|
-
const log = await client.
|
|
58
|
+
const log = await client.logs.create(ws.key, {
|
|
59
59
|
name: "Log",
|
|
60
60
|
data: { one: 1 },
|
|
61
61
|
});
|
|
62
|
-
await client.
|
|
63
|
-
await expect(client.
|
|
62
|
+
await client.logs.delete(log.key);
|
|
63
|
+
await expect(client.logs.retrieve({ key: log.key })).rejects.toThrow(
|
|
64
64
|
NotFoundError,
|
|
65
65
|
);
|
|
66
66
|
});
|
package/src/ontology/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.
|
|
@@ -12,8 +12,6 @@ import { array, strings } from "@synnaxlabs/x";
|
|
|
12
12
|
import { z } from "zod";
|
|
13
13
|
|
|
14
14
|
import { QueryError } from "@/errors";
|
|
15
|
-
import { type framer } from "@/framer";
|
|
16
|
-
import { group } from "@/ontology/group";
|
|
17
15
|
import {
|
|
18
16
|
type ID,
|
|
19
17
|
idToString,
|
|
@@ -37,27 +35,22 @@ const retrieveReqZ = z.object({
|
|
|
37
35
|
});
|
|
38
36
|
export interface RetrieveRequest extends z.infer<typeof retrieveReqZ> {}
|
|
39
37
|
|
|
40
|
-
export interface RetrieveOptions
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
> {}
|
|
38
|
+
export interface RetrieveOptions extends Pick<
|
|
39
|
+
RetrieveRequest,
|
|
40
|
+
"excludeFieldData" | "types" | "children" | "parents"
|
|
41
|
+
> {}
|
|
45
42
|
|
|
46
43
|
const retrieveResZ = z.object({ resources: resourceZ.array() });
|
|
47
44
|
|
|
48
|
-
/** The
|
|
45
|
+
/** The main client class for executing queries against a Synnax cluster ontology */
|
|
49
46
|
export class Client {
|
|
50
47
|
readonly type: string = "ontology";
|
|
51
|
-
groups: group.Client;
|
|
52
48
|
private readonly client: UnaryClient;
|
|
53
49
|
private readonly writer: Writer;
|
|
54
|
-
private readonly framer: framer.Client;
|
|
55
50
|
|
|
56
|
-
constructor(unary: UnaryClient
|
|
51
|
+
constructor(unary: UnaryClient) {
|
|
57
52
|
this.client = unary;
|
|
58
53
|
this.writer = new Writer(unary);
|
|
59
|
-
this.groups = new group.Client(unary);
|
|
60
|
-
this.framer = framer;
|
|
61
54
|
}
|
|
62
55
|
|
|
63
56
|
/**
|
package/src/ontology/external.ts
CHANGED
package/src/ontology/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.
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
|
|
10
10
|
import { describe, expect, it, test } from "vitest";
|
|
11
11
|
|
|
12
|
+
import { group } from "@/group";
|
|
12
13
|
import { ontology } from "@/ontology";
|
|
13
|
-
import { group } from "@/ontology/group";
|
|
14
14
|
import { createTestClient } from "@/testutil/client";
|
|
15
15
|
|
|
16
16
|
const client = createTestClient();
|
|
@@ -126,15 +126,15 @@ describe("Ontology", () => {
|
|
|
126
126
|
describe("retrieve", () => {
|
|
127
127
|
test("retrieve", async () => {
|
|
128
128
|
const name = randomName();
|
|
129
|
-
const g = await client.
|
|
129
|
+
const g = await client.groups.create({ parent: ontology.ROOT_ID, name });
|
|
130
130
|
const g2 = await client.ontology.retrieve(group.ontologyID(g.key));
|
|
131
131
|
expect(g2.name).toEqual(name);
|
|
132
132
|
});
|
|
133
133
|
test("retrieve children", async () => {
|
|
134
134
|
const name = randomName();
|
|
135
|
-
const g = await client.
|
|
135
|
+
const g = await client.groups.create({ parent: ontology.ROOT_ID, name });
|
|
136
136
|
const name2 = randomName();
|
|
137
|
-
await client.
|
|
137
|
+
await client.groups.create({
|
|
138
138
|
parent: group.ontologyID(g.key),
|
|
139
139
|
name: name2,
|
|
140
140
|
});
|
|
@@ -144,9 +144,9 @@ describe("Ontology", () => {
|
|
|
144
144
|
});
|
|
145
145
|
test("retrieve parents", async () => {
|
|
146
146
|
const name = randomName();
|
|
147
|
-
const g = await client.
|
|
147
|
+
const g = await client.groups.create({ parent: ontology.ROOT_ID, name });
|
|
148
148
|
const name2 = randomName();
|
|
149
|
-
const g2 = await client.
|
|
149
|
+
const g2 = await client.groups.create({
|
|
150
150
|
parent: group.ontologyID(g.key),
|
|
151
151
|
name: name2,
|
|
152
152
|
});
|
|
@@ -159,9 +159,9 @@ describe("Ontology", () => {
|
|
|
159
159
|
describe("write", () => {
|
|
160
160
|
test("add children", async () => {
|
|
161
161
|
const name = randomName();
|
|
162
|
-
const g = await client.
|
|
162
|
+
const g = await client.groups.create({ parent: ontology.ROOT_ID, name });
|
|
163
163
|
const name2 = randomName();
|
|
164
|
-
const g2 = await client.
|
|
164
|
+
const g2 = await client.groups.create({
|
|
165
165
|
parent: ontology.ROOT_ID,
|
|
166
166
|
name: name2,
|
|
167
167
|
});
|
|
@@ -175,9 +175,9 @@ describe("Ontology", () => {
|
|
|
175
175
|
});
|
|
176
176
|
test("remove children", async () => {
|
|
177
177
|
const name = randomName();
|
|
178
|
-
const g = await client.
|
|
178
|
+
const g = await client.groups.create({ parent: ontology.ROOT_ID, name });
|
|
179
179
|
const name2 = randomName();
|
|
180
|
-
const g2 = await client.
|
|
180
|
+
const g2 = await client.groups.create({
|
|
181
181
|
parent: ontology.ROOT_ID,
|
|
182
182
|
name: name2,
|
|
183
183
|
});
|
|
@@ -194,9 +194,9 @@ describe("Ontology", () => {
|
|
|
194
194
|
});
|
|
195
195
|
test("move children", async () => {
|
|
196
196
|
const name = randomName();
|
|
197
|
-
const g = await client.
|
|
197
|
+
const g = await client.groups.create({ parent: ontology.ROOT_ID, name });
|
|
198
198
|
const name2 = randomName();
|
|
199
|
-
const g2 = await client.
|
|
199
|
+
const g2 = await client.groups.create({
|
|
200
200
|
parent: ontology.ROOT_ID,
|
|
201
201
|
name: name2,
|
|
202
202
|
});
|
package/src/ontology/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.
|
|
@@ -43,6 +43,7 @@ export const resourceTypeZ = z.enum([
|
|
|
43
43
|
"arc",
|
|
44
44
|
"schematic_symbol",
|
|
45
45
|
"status",
|
|
46
|
+
"view",
|
|
46
47
|
]);
|
|
47
48
|
export type ResourceType = z.infer<typeof resourceTypeZ>;
|
|
48
49
|
|
|
@@ -103,8 +104,10 @@ export const resourceZ = z
|
|
|
103
104
|
data: record.unknownZ.optional().nullable(),
|
|
104
105
|
})
|
|
105
106
|
.transform((resource) => ({ key: idToString(resource.id), ...resource }));
|
|
106
|
-
export interface Resource<T extends record.Unknown = record.Unknown>
|
|
107
|
-
|
|
107
|
+
export interface Resource<T extends record.Unknown = record.Unknown> extends Omit<
|
|
108
|
+
z.infer<typeof resourceZ>,
|
|
109
|
+
"data"
|
|
110
|
+
> {
|
|
108
111
|
data?: T | null;
|
|
109
112
|
}
|
|
110
113
|
|
package/src/ontology/writer.ts
CHANGED
package/src/rack/access.spec.ts
CHANGED
package/src/rack/client.ts
CHANGED
package/src/rack/external.ts
CHANGED
package/src/rack/index.ts
CHANGED
package/src/rack/payload.ts
CHANGED
package/src/rack/rack.spec.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.
|
|
@@ -8,36 +8,31 @@
|
|
|
8
8
|
// included in the file licenses/APL.txt.
|
|
9
9
|
|
|
10
10
|
import { sendRequired, type UnaryClient } from "@synnaxlabs/freighter";
|
|
11
|
-
import { array
|
|
11
|
+
import { array } from "@synnaxlabs/x";
|
|
12
12
|
import { z } from "zod";
|
|
13
13
|
|
|
14
14
|
import { channel } from "@/channel";
|
|
15
15
|
import { type Key, keyZ } from "@/ranger/payload";
|
|
16
16
|
|
|
17
|
-
export const SET_ALIAS_CHANNEL_NAME = "sy_range_alias_set";
|
|
18
|
-
export const DELETE_ALIAS_CHANNEL_NAME = "sy_range_alias_delete";
|
|
19
|
-
|
|
20
17
|
const resolveReqZ = z.object({ range: keyZ, aliases: z.string().array() });
|
|
21
|
-
|
|
22
18
|
const resolveResZ = z.object({ aliases: z.record(z.string(), channel.keyZ) });
|
|
23
19
|
|
|
24
|
-
const setReqZ = z.object({
|
|
25
|
-
|
|
20
|
+
const setReqZ = z.object({
|
|
21
|
+
range: keyZ,
|
|
22
|
+
aliases: z.record(channel.keyZ, z.string()),
|
|
23
|
+
});
|
|
26
24
|
const setResZ = z.unknown();
|
|
27
25
|
|
|
28
26
|
const deleteReqZ = z.object({ range: keyZ, channels: channel.keyZ.array() });
|
|
29
|
-
|
|
30
27
|
const deleteResZ = z.unknown();
|
|
31
28
|
|
|
32
29
|
const listReqZ = z.object({ range: keyZ });
|
|
33
|
-
|
|
34
30
|
const listResZ = z.object({ aliases: z.record(z.string(), z.string()) });
|
|
35
31
|
|
|
36
32
|
const retrieveReqZ = z.object({ range: keyZ, channels: channel.keyZ.array() });
|
|
37
|
-
|
|
38
33
|
const retrieveResZ = z.object({ aliases: z.record(z.string(), z.string()) });
|
|
39
34
|
|
|
40
|
-
export class
|
|
35
|
+
export class Client {
|
|
41
36
|
private readonly cache = new Map<string, channel.Key>();
|
|
42
37
|
private readonly client: UnaryClient;
|
|
43
38
|
private readonly rangeKey: Key;
|
|
@@ -129,29 +124,3 @@ export class Aliaser {
|
|
|
129
124
|
);
|
|
130
125
|
}
|
|
131
126
|
}
|
|
132
|
-
|
|
133
|
-
export const aliasZ = z.object({
|
|
134
|
-
alias: z.string().optional(),
|
|
135
|
-
channel: channel.keyZ,
|
|
136
|
-
range: keyZ,
|
|
137
|
-
});
|
|
138
|
-
export interface Alias extends z.infer<typeof aliasZ> {}
|
|
139
|
-
|
|
140
|
-
export type AliasChange = change.Change<string, Alias>;
|
|
141
|
-
|
|
142
|
-
const SEPARATOR = "---";
|
|
143
|
-
|
|
144
|
-
export const aliasKey = (alias: Pick<Alias, "range" | "channel">): string =>
|
|
145
|
-
`${alias.range}${SEPARATOR}${alias.channel}`;
|
|
146
|
-
|
|
147
|
-
export interface DecodedDeleteAliasChange {
|
|
148
|
-
range: Key;
|
|
149
|
-
channel: channel.Key;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
export const decodeDeleteAliasChange = (
|
|
153
|
-
deletedAlias: string,
|
|
154
|
-
): DecodedDeleteAliasChange => {
|
|
155
|
-
const [range, channel] = deletedAlias.split(SEPARATOR);
|
|
156
|
-
return { range, channel: Number(channel) };
|
|
157
|
-
};
|