@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.
|
|
@@ -7,5 +7,13 @@
|
|
|
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
|
|
11
|
-
|
|
10
|
+
export {
|
|
11
|
+
type Alias,
|
|
12
|
+
type AliasChange,
|
|
13
|
+
aliasZ,
|
|
14
|
+
createKey,
|
|
15
|
+
type DecodedDeleteAliasChange,
|
|
16
|
+
decodeDeleteChange,
|
|
17
|
+
DELETE_CHANNEL_NAME,
|
|
18
|
+
SET_CHANNEL_NAME,
|
|
19
|
+
} from "@/ranger/alias/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 alias from "@/ranger/alias/external";
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// Copyright 2026 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 { type change } from "@synnaxlabs/x";
|
|
11
|
+
import { z } from "zod";
|
|
12
|
+
|
|
13
|
+
import { channel } from "@/channel";
|
|
14
|
+
import { type Key, keyZ } from "@/ranger/payload";
|
|
15
|
+
|
|
16
|
+
export const SET_CHANNEL_NAME = "sy_range_alias_set";
|
|
17
|
+
export const DELETE_CHANNEL_NAME = "sy_range_alias_delete";
|
|
18
|
+
|
|
19
|
+
export const aliasZ = z.object({
|
|
20
|
+
alias: z.string().optional(),
|
|
21
|
+
channel: channel.keyZ,
|
|
22
|
+
range: keyZ,
|
|
23
|
+
});
|
|
24
|
+
export interface Alias extends z.infer<typeof aliasZ> {}
|
|
25
|
+
|
|
26
|
+
export type AliasChange = change.Change<string, Alias>;
|
|
27
|
+
|
|
28
|
+
const SEPARATOR = "---";
|
|
29
|
+
|
|
30
|
+
export const createKey = (alias: Pick<Alias, "range" | "channel">): string =>
|
|
31
|
+
`${alias.range}${SEPARATOR}${alias.channel}`;
|
|
32
|
+
|
|
33
|
+
export interface DecodedDeleteAliasChange {
|
|
34
|
+
range: Key;
|
|
35
|
+
channel: channel.Key;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const decodeDeleteChange = (deletedAlias: string): DecodedDeleteAliasChange => {
|
|
39
|
+
const [range, channel] = deletedAlias.split(SEPARATOR);
|
|
40
|
+
return { range, channel: Number(channel) };
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/** @deprecated Use {@link SET_CHANNEL_NAME} instead. */
|
|
44
|
+
export const SET_ALIAS_CHANNEL_NAME = SET_CHANNEL_NAME;
|
|
45
|
+
/** @deprecated Use {@link DELETE_CHANNEL_NAME} instead. */
|
|
46
|
+
export const DELETE_ALIAS_CHANNEL_NAME = DELETE_CHANNEL_NAME;
|
|
47
|
+
/** @deprecated Use {@link createKey} instead. */
|
|
48
|
+
export const aliasKey = createKey;
|
|
49
|
+
/** @deprecated Use {@link decodeDeleteChange} instead. */
|
|
50
|
+
export const decodeDeleteAliasChange = decodeDeleteChange;
|
package/src/ranger/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.
|
|
@@ -8,7 +8,13 @@
|
|
|
8
8
|
// included in the file licenses/APL.txt.
|
|
9
9
|
|
|
10
10
|
import { sendRequired, type UnaryClient } from "@synnaxlabs/freighter";
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
array,
|
|
13
|
+
color,
|
|
14
|
+
type CrudeTimeRange,
|
|
15
|
+
type Series,
|
|
16
|
+
TimeRange,
|
|
17
|
+
} from "@synnaxlabs/x";
|
|
12
18
|
import { z } from "zod";
|
|
13
19
|
|
|
14
20
|
import { type channel } from "@/channel";
|
|
@@ -16,8 +22,8 @@ import { QueryError } from "@/errors";
|
|
|
16
22
|
import { type framer } from "@/framer";
|
|
17
23
|
import { label } from "@/label";
|
|
18
24
|
import { ontology } from "@/ontology";
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
25
|
+
import { Client as AliasClient } from "@/ranger/alias/client";
|
|
26
|
+
import { Client as KVClient } from "@/ranger/kv/client";
|
|
21
27
|
import {
|
|
22
28
|
type Key,
|
|
23
29
|
type Keys,
|
|
@@ -37,8 +43,8 @@ export const DELETE_CHANNEL_NAME = "sy_range_delete";
|
|
|
37
43
|
|
|
38
44
|
interface RangeConstructionOptions {
|
|
39
45
|
frameClient: framer.Client;
|
|
40
|
-
kv:
|
|
41
|
-
aliaser:
|
|
46
|
+
kv: KVClient;
|
|
47
|
+
aliaser: AliasClient;
|
|
42
48
|
channels: channel.Retriever;
|
|
43
49
|
labelClient: label.Client;
|
|
44
50
|
ontologyClient: ontology.Client;
|
|
@@ -48,13 +54,13 @@ interface RangeConstructionOptions {
|
|
|
48
54
|
export class Range {
|
|
49
55
|
key: string;
|
|
50
56
|
name: string;
|
|
51
|
-
readonly kv:
|
|
57
|
+
readonly kv: KVClient;
|
|
52
58
|
readonly timeRange: TimeRange;
|
|
53
|
-
readonly color:
|
|
59
|
+
readonly color: color.Color | undefined;
|
|
54
60
|
readonly parent: Payload | null;
|
|
55
61
|
readonly labels?: label.Label[];
|
|
56
62
|
readonly channels: channel.Retriever;
|
|
57
|
-
private readonly aliaser:
|
|
63
|
+
private readonly aliaser: AliasClient;
|
|
58
64
|
private readonly frameClient: framer.Client;
|
|
59
65
|
private readonly labelClient: label.Client;
|
|
60
66
|
private readonly ontologyClient: ontology.Client;
|
|
@@ -252,8 +258,8 @@ export class Client {
|
|
|
252
258
|
return this.sugarMany(ranges);
|
|
253
259
|
}
|
|
254
260
|
|
|
255
|
-
getKV(range: Key):
|
|
256
|
-
return new
|
|
261
|
+
getKV(range: Key): KVClient {
|
|
262
|
+
return new KVClient(range, this.unaryClient);
|
|
257
263
|
}
|
|
258
264
|
|
|
259
265
|
async retrieveParent(range: Key): Promise<Range | null> {
|
|
@@ -269,7 +275,7 @@ export class Client {
|
|
|
269
275
|
}
|
|
270
276
|
|
|
271
277
|
async retrieveAlias(range: Key, channel: channel.Key): Promise<string> {
|
|
272
|
-
const aliaser = new
|
|
278
|
+
const aliaser = new AliasClient(range, this.unaryClient);
|
|
273
279
|
return await aliaser.retrieve(channel);
|
|
274
280
|
}
|
|
275
281
|
|
|
@@ -277,30 +283,30 @@ export class Client {
|
|
|
277
283
|
range: Key,
|
|
278
284
|
channels: channel.Key[],
|
|
279
285
|
): Promise<Record<channel.Key, string>> {
|
|
280
|
-
const aliaser = new
|
|
286
|
+
const aliaser = new AliasClient(range, this.unaryClient);
|
|
281
287
|
return await aliaser.retrieve(channels);
|
|
282
288
|
}
|
|
283
289
|
|
|
284
290
|
async listAliases(range: Key): Promise<Record<channel.Key, string>> {
|
|
285
|
-
const aliaser = new
|
|
291
|
+
const aliaser = new AliasClient(range, this.unaryClient);
|
|
286
292
|
return await aliaser.list();
|
|
287
293
|
}
|
|
288
294
|
|
|
289
295
|
async setAlias(range: Key, channel: channel.Key, alias: string): Promise<void> {
|
|
290
|
-
const aliaser = new
|
|
296
|
+
const aliaser = new AliasClient(range, this.unaryClient);
|
|
291
297
|
await aliaser.set({ [channel]: alias });
|
|
292
298
|
}
|
|
293
299
|
|
|
294
300
|
async deleteAlias(range: Key, channels: channel.Key | channel.Key[]): Promise<void> {
|
|
295
|
-
const aliaser = new
|
|
301
|
+
const aliaser = new AliasClient(range, this.unaryClient);
|
|
296
302
|
await aliaser.delete(channels);
|
|
297
303
|
}
|
|
298
304
|
|
|
299
305
|
sugarOne(payload: Payload): Range {
|
|
300
306
|
return new Range(payload, {
|
|
301
307
|
frameClient: this.frameClient,
|
|
302
|
-
kv: new
|
|
303
|
-
aliaser: new
|
|
308
|
+
kv: new KVClient(payload.key, this.unaryClient),
|
|
309
|
+
aliaser: new AliasClient(payload.key, this.unaryClient),
|
|
304
310
|
channels: this.channels,
|
|
305
311
|
labelClient: this.labelClient,
|
|
306
312
|
ontologyClient: this.ontologyClient,
|
|
@@ -317,7 +323,7 @@ export class Client {
|
|
|
317
323
|
key: resource.id.key,
|
|
318
324
|
name: resource.data?.name as string,
|
|
319
325
|
timeRange: new TimeRange(resource.data?.timeRange as CrudeTimeRange),
|
|
320
|
-
color: resource.data?.color as
|
|
326
|
+
color: resource.data?.color as color.Color,
|
|
321
327
|
labels: [],
|
|
322
328
|
parent: null,
|
|
323
329
|
});
|
|
@@ -338,11 +344,12 @@ export const convertOntologyResourceToPayload = ({
|
|
|
338
344
|
name,
|
|
339
345
|
}: ontology.Resource): Payload => {
|
|
340
346
|
const timeRange = TimeRange.z.parse(data?.timeRange);
|
|
347
|
+
const c = color.colorZ.safeParse(data?.color);
|
|
341
348
|
return {
|
|
342
349
|
key,
|
|
343
350
|
name,
|
|
344
351
|
timeRange,
|
|
345
|
-
color:
|
|
352
|
+
color: c.success ? c.data : undefined,
|
|
346
353
|
labels: [],
|
|
347
354
|
parent: null,
|
|
348
355
|
};
|
package/src/ranger/external.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,7 +8,29 @@
|
|
|
8
8
|
// included in the file licenses/APL.txt.
|
|
9
9
|
|
|
10
10
|
export * from "@/ranger/alias";
|
|
11
|
+
export {
|
|
12
|
+
/** @deprecated Use {@link alias.createKey} instead. */
|
|
13
|
+
createKey as aliasKey,
|
|
14
|
+
/** @deprecated Use {@link alias.decodeDeleteChange} instead. */
|
|
15
|
+
decodeDeleteChange as decodeDeleteAliasChange,
|
|
16
|
+
/** @deprecated Use {@link alias.DELETE_CHANNEL_NAME} instead. */
|
|
17
|
+
DELETE_CHANNEL_NAME as DELETE_ALIAS_CHANNEL_NAME,
|
|
18
|
+
/** @deprecated Use {@link SET_CHANNEL_NAME} instead. */
|
|
19
|
+
SET_CHANNEL_NAME as SET_ALIAS_CHANNEL_NAME,
|
|
20
|
+
} from "@/ranger/alias/payload";
|
|
11
21
|
export * from "@/ranger/client";
|
|
12
22
|
export * from "@/ranger/kv";
|
|
23
|
+
export {
|
|
24
|
+
/** @deprecated Use {@link kv.DELETE_CHANNEL_NAME} instead. */
|
|
25
|
+
DELETE_CHANNEL_NAME as KV_DELETE_CHANNEL,
|
|
26
|
+
/** @deprecated Use {@link kv.SET_CHANNEL_NAME} instead. */
|
|
27
|
+
SET_CHANNEL_NAME as KV_SET_CHANNEL,
|
|
28
|
+
/** @deprecated Use {@link kv.Pair} instead. */
|
|
29
|
+
type Pair as KVPair,
|
|
30
|
+
/** @deprecated Use {@link kv.createPairKey} instead. */
|
|
31
|
+
createPairKey as kvPairKey,
|
|
32
|
+
/** @deprecated Use {@link kv.pairZ} instead. */
|
|
33
|
+
pairZ as kvPairZ,
|
|
34
|
+
} from "@/ranger/kv/payload";
|
|
13
35
|
export * from "@/ranger/payload";
|
|
14
36
|
export * from "@/ranger/writer";
|
package/src/ranger/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.
|
|
@@ -11,29 +11,15 @@ import { sendRequired, type UnaryClient } from "@synnaxlabs/freighter";
|
|
|
11
11
|
import { array } from "@synnaxlabs/x";
|
|
12
12
|
import { z } from "zod";
|
|
13
13
|
|
|
14
|
+
import { type Pair, pairZ } from "@/ranger/kv/payload";
|
|
14
15
|
import { type Key, keyZ } from "@/ranger/payload";
|
|
15
16
|
|
|
16
|
-
export const KV_SET_CHANNEL = "sy_range_kv_set";
|
|
17
|
-
export const KV_DELETE_CHANNEL = "sy_range_kv_delete";
|
|
18
|
-
|
|
19
|
-
export const kvPairZ = z.object({ range: keyZ, key: z.string(), value: z.string() });
|
|
20
|
-
export interface KVPair extends z.infer<typeof kvPairZ> {}
|
|
21
|
-
|
|
22
|
-
export const kvPairKey = ({ range, key }: Omit<KVPair, "value">) =>
|
|
23
|
-
`${range}<--->${key}`;
|
|
24
|
-
|
|
25
17
|
const getReqZ = z.object({ range: keyZ, keys: z.string().array() });
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const getResZ = z.object({ pairs: array.nullableZ(kvPairZ) });
|
|
29
|
-
|
|
30
|
-
const setReqZ = z.object({ range: keyZ, pairs: kvPairZ.array() });
|
|
31
|
-
export interface SetRequest extends z.infer<typeof setReqZ> {}
|
|
32
|
-
|
|
18
|
+
const getResZ = z.object({ pairs: array.nullableZ(pairZ) });
|
|
19
|
+
const setReqZ = z.object({ range: keyZ, pairs: pairZ.array() });
|
|
33
20
|
const deleteReqZ = z.object({ range: keyZ, keys: z.string().array() });
|
|
34
|
-
export interface DeleteRequest extends z.infer<typeof deleteReqZ> {}
|
|
35
21
|
|
|
36
|
-
export class
|
|
22
|
+
export class Client {
|
|
37
23
|
private readonly rangeKey: Key;
|
|
38
24
|
private readonly client: UnaryClient;
|
|
39
25
|
|
|
@@ -63,7 +49,7 @@ export class KV {
|
|
|
63
49
|
async set(key: string, value: string): Promise<void>;
|
|
64
50
|
async set(kv: Record<string, string>): Promise<void>;
|
|
65
51
|
async set(key: string | Record<string, string>, value: string = ""): Promise<void> {
|
|
66
|
-
let pairs:
|
|
52
|
+
let pairs: Pair[];
|
|
67
53
|
if (typeof key == "string") pairs = [{ range: this.rangeKey, key, value }];
|
|
68
54
|
else
|
|
69
55
|
pairs = Object.entries(key).map(([k, v]) => ({
|
|
@@ -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,6 +7,10 @@
|
|
|
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
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
export {
|
|
11
|
+
createPairKey,
|
|
12
|
+
DELETE_CHANNEL_NAME as DELETE_CHANNEL,
|
|
13
|
+
type Pair,
|
|
14
|
+
pairZ,
|
|
15
|
+
SET_CHANNEL_NAME as SET_CHANNEL,
|
|
16
|
+
} from "@/ranger/kv/payload";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Copyright 2026 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
|
+
export * as kv from "@/ranger/kv/external";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Copyright 2026 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 { z } from "zod";
|
|
11
|
+
|
|
12
|
+
import { keyZ } from "@/ranger/payload";
|
|
13
|
+
|
|
14
|
+
export const SET_CHANNEL_NAME = "sy_range_kv_set";
|
|
15
|
+
export const DELETE_CHANNEL_NAME = "sy_range_kv_delete";
|
|
16
|
+
|
|
17
|
+
export const pairZ = z.object({ range: keyZ, key: z.string(), value: z.string() });
|
|
18
|
+
export interface Pair extends z.infer<typeof pairZ> {}
|
|
19
|
+
|
|
20
|
+
export const createPairKey = ({ range, key }: Omit<Pair, "value">) =>
|
|
21
|
+
`${range}<--->${key}`;
|
|
22
|
+
|
|
23
|
+
/** @deprecated Use {@link SET_CHANNEL_NAME} instead. */
|
|
24
|
+
export const KV_SET_CHANNEL = SET_CHANNEL_NAME;
|
|
25
|
+
/** @deprecated Use {@link DELETE_CHANNEL_NAME} instead. */
|
|
26
|
+
export const KV_DELETE_CHANNEL = DELETE_CHANNEL_NAME;
|
|
27
|
+
/** @deprecated Use {@link pairZ} instead. */
|
|
28
|
+
export const kvPairZ = pairZ;
|
|
29
|
+
/** @deprecated Use {@link Pair} instead. */
|
|
30
|
+
export type KVPair = Pair;
|
|
31
|
+
/** @deprecated Use {@link createPairKey} instead. */
|
|
32
|
+
export const kvPairKey = createPairKey;
|
package/src/ranger/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.
|
|
@@ -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 { math, TimeRange } from "@synnaxlabs/x";
|
|
10
|
+
import { color, math, TimeRange } from "@synnaxlabs/x";
|
|
11
11
|
import { z } from "zod";
|
|
12
12
|
|
|
13
13
|
import { label } from "@/label";
|
|
@@ -35,7 +35,7 @@ export const payloadZ = z.object({
|
|
|
35
35
|
error:
|
|
36
36
|
"Time range start time must be greater than or equal to the minimum value of an int64",
|
|
37
37
|
}),
|
|
38
|
-
color:
|
|
38
|
+
color: color.colorZ.optional(),
|
|
39
39
|
labels: label.labelZ
|
|
40
40
|
.array()
|
|
41
41
|
.or(z.null().transform(() => undefined))
|
|
@@ -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.
|
|
@@ -90,7 +90,7 @@ describe("Ranger", () => {
|
|
|
90
90
|
});
|
|
91
91
|
expect(range.key).not.toHaveLength(0);
|
|
92
92
|
expect(timeRange).toEqual(range.timeRange);
|
|
93
|
-
expect(range.color).toEqual(
|
|
93
|
+
expect(range.color).toEqual([231, 116, 208, 1]);
|
|
94
94
|
});
|
|
95
95
|
it("should create multiple ranges", async () => {
|
|
96
96
|
const ranges: ranger.New[] = [
|
package/src/ranger/writer.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.
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
import { describe, expect, it } from "vitest";
|
|
11
11
|
|
|
12
12
|
import { AuthError, NotFoundError } from "@/errors";
|
|
13
|
+
import { schematic } from "@/schematic";
|
|
13
14
|
import { createTestClientWithPolicy } from "@/testutil/access";
|
|
14
15
|
import { createTestClient } from "@/testutil/client";
|
|
15
|
-
import { schematic } from "@/workspace/schematic";
|
|
16
16
|
|
|
17
17
|
const client = createTestClient();
|
|
18
18
|
|
|
@@ -28,12 +28,12 @@ describe("schematic", () => {
|
|
|
28
28
|
name: "test",
|
|
29
29
|
layout: {},
|
|
30
30
|
});
|
|
31
|
-
const randomSchematic = await client.
|
|
31
|
+
const randomSchematic = await client.schematics.create(ws.key, {
|
|
32
32
|
name: "test",
|
|
33
33
|
data: {},
|
|
34
34
|
});
|
|
35
35
|
await expect(
|
|
36
|
-
userClient.
|
|
36
|
+
userClient.schematics.retrieve({ key: randomSchematic.key }),
|
|
37
37
|
).rejects.toThrow(AuthError);
|
|
38
38
|
});
|
|
39
39
|
|
|
@@ -47,11 +47,11 @@ describe("schematic", () => {
|
|
|
47
47
|
name: "test",
|
|
48
48
|
layout: {},
|
|
49
49
|
});
|
|
50
|
-
const randomSchematic = await client.
|
|
50
|
+
const randomSchematic = await client.schematics.create(ws.key, {
|
|
51
51
|
name: "test",
|
|
52
52
|
data: {},
|
|
53
53
|
});
|
|
54
|
-
const retrieved = await userClient.
|
|
54
|
+
const retrieved = await userClient.schematics.retrieve({
|
|
55
55
|
key: randomSchematic.key,
|
|
56
56
|
});
|
|
57
57
|
expect(retrieved.key).toBe(randomSchematic.key);
|
|
@@ -68,7 +68,7 @@ describe("schematic", () => {
|
|
|
68
68
|
name: "test",
|
|
69
69
|
layout: {},
|
|
70
70
|
});
|
|
71
|
-
await userClient.
|
|
71
|
+
await userClient.schematics.create(ws.key, {
|
|
72
72
|
name: "test",
|
|
73
73
|
data: {},
|
|
74
74
|
});
|
|
@@ -85,7 +85,7 @@ describe("schematic", () => {
|
|
|
85
85
|
layout: {},
|
|
86
86
|
});
|
|
87
87
|
await expect(
|
|
88
|
-
userClient.
|
|
88
|
+
userClient.schematics.create(ws.key, {
|
|
89
89
|
name: "test",
|
|
90
90
|
data: {},
|
|
91
91
|
}),
|
|
@@ -102,13 +102,13 @@ describe("schematic", () => {
|
|
|
102
102
|
name: "test",
|
|
103
103
|
layout: {},
|
|
104
104
|
});
|
|
105
|
-
const randomSchematic = await client.
|
|
105
|
+
const randomSchematic = await client.schematics.create(ws.key, {
|
|
106
106
|
name: "test",
|
|
107
107
|
data: {},
|
|
108
108
|
});
|
|
109
|
-
await userClient.
|
|
109
|
+
await userClient.schematics.delete(randomSchematic.key);
|
|
110
110
|
await expect(
|
|
111
|
-
userClient.
|
|
111
|
+
userClient.schematics.retrieve({ key: randomSchematic.key }),
|
|
112
112
|
).rejects.toThrow(NotFoundError);
|
|
113
113
|
});
|
|
114
114
|
|
|
@@ -122,13 +122,13 @@ describe("schematic", () => {
|
|
|
122
122
|
name: "test",
|
|
123
123
|
layout: {},
|
|
124
124
|
});
|
|
125
|
-
const randomSchematic = await client.
|
|
125
|
+
const randomSchematic = await client.schematics.create(ws.key, {
|
|
126
126
|
name: "test",
|
|
127
127
|
data: {},
|
|
128
128
|
});
|
|
129
|
-
await expect(
|
|
130
|
-
|
|
131
|
-
)
|
|
129
|
+
await expect(userClient.schematics.delete(randomSchematic.key)).rejects.toThrow(
|
|
130
|
+
AuthError,
|
|
131
|
+
);
|
|
132
132
|
});
|
|
133
133
|
});
|
|
134
134
|
});
|
|
@@ -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, type record } from "@synnaxlabs/x";
|
|
|
12
12
|
import { z } from "zod";
|
|
13
13
|
|
|
14
14
|
import { ontology } from "@/ontology";
|
|
15
|
-
import { checkForMultipleOrNoResults } from "@/util/retrieve";
|
|
16
|
-
import { type Key as WorkspaceKey, keyZ as workspaceKeyZ } from "@/workspace/payload";
|
|
17
15
|
import {
|
|
18
16
|
type Key,
|
|
19
17
|
keyZ,
|
|
@@ -23,8 +21,10 @@ import {
|
|
|
23
21
|
remoteZ,
|
|
24
22
|
type Schematic,
|
|
25
23
|
schematicZ,
|
|
26
|
-
} from "@/
|
|
27
|
-
import { symbol } from "@/
|
|
24
|
+
} from "@/schematic/payload";
|
|
25
|
+
import { symbol } from "@/schematic/symbol";
|
|
26
|
+
import { checkForMultipleOrNoResults } from "@/util/retrieve";
|
|
27
|
+
import { workspace } from "@/workspace";
|
|
28
28
|
|
|
29
29
|
const renameReqZ = z.object({ key: keyZ, name: z.string() });
|
|
30
30
|
|
|
@@ -51,7 +51,7 @@ export type CopyArgs = z.input<typeof copyReqZ>;
|
|
|
51
51
|
const retrieveResZ = z.object({ schematics: array.nullableZ(remoteZ) });
|
|
52
52
|
|
|
53
53
|
const createReqZ = z.object({
|
|
54
|
-
workspace:
|
|
54
|
+
workspace: workspace.keyZ,
|
|
55
55
|
schematics: newZ.array(),
|
|
56
56
|
});
|
|
57
57
|
const createResZ = z.object({ schematics: remoteZ.array() });
|
|
@@ -68,16 +68,16 @@ export class Client {
|
|
|
68
68
|
this.symbols = new symbol.Client(client);
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
async create(workspace:
|
|
72
|
-
async create(workspace:
|
|
71
|
+
async create(workspace: workspace.Key, schematic: New): Promise<Schematic>;
|
|
72
|
+
async create(workspace: workspace.Key, schematics: New[]): Promise<Schematic[]>;
|
|
73
73
|
async create(
|
|
74
|
-
workspace:
|
|
74
|
+
workspace: workspace.Key,
|
|
75
75
|
schematics: New | New[],
|
|
76
76
|
): Promise<Schematic | Schematic[]> {
|
|
77
77
|
const isMany = Array.isArray(schematics);
|
|
78
78
|
const res = await sendRequired(
|
|
79
79
|
this.client,
|
|
80
|
-
"/
|
|
80
|
+
"/schematic/create",
|
|
81
81
|
{ workspace, schematics: array.toArray(schematics) },
|
|
82
82
|
createReqZ,
|
|
83
83
|
createResZ,
|
|
@@ -88,7 +88,7 @@ export class Client {
|
|
|
88
88
|
async rename(key: Key, name: string): Promise<void> {
|
|
89
89
|
await sendRequired(
|
|
90
90
|
this.client,
|
|
91
|
-
"/
|
|
91
|
+
"/schematic/rename",
|
|
92
92
|
{ key, name },
|
|
93
93
|
renameReqZ,
|
|
94
94
|
emptyResZ,
|
|
@@ -98,7 +98,7 @@ export class Client {
|
|
|
98
98
|
async setData(key: Key, data: record.Unknown): Promise<void> {
|
|
99
99
|
await sendRequired(
|
|
100
100
|
this.client,
|
|
101
|
-
"/
|
|
101
|
+
"/schematic/set-data",
|
|
102
102
|
{ key, data: JSON.stringify(data) },
|
|
103
103
|
setDataReqZ,
|
|
104
104
|
emptyResZ,
|
|
@@ -113,7 +113,7 @@ export class Client {
|
|
|
113
113
|
const isSingle = singleRetrieveArgsZ.safeParse(args).success;
|
|
114
114
|
const res = await sendRequired(
|
|
115
115
|
this.client,
|
|
116
|
-
"/
|
|
116
|
+
"/schematic/retrieve",
|
|
117
117
|
args,
|
|
118
118
|
retrieveArgsZ,
|
|
119
119
|
retrieveResZ,
|
|
@@ -125,7 +125,7 @@ export class Client {
|
|
|
125
125
|
async delete(keys: Params): Promise<void> {
|
|
126
126
|
await sendRequired(
|
|
127
127
|
this.client,
|
|
128
|
-
"/
|
|
128
|
+
"/schematic/delete",
|
|
129
129
|
{ keys: array.toArray(keys) },
|
|
130
130
|
deleteReqZ,
|
|
131
131
|
emptyResZ,
|
|
@@ -135,7 +135,7 @@ export class Client {
|
|
|
135
135
|
async copy(args: CopyArgs): Promise<Schematic> {
|
|
136
136
|
const res = await sendRequired(
|
|
137
137
|
this.client,
|
|
138
|
-
"/
|
|
138
|
+
"/schematic/copy",
|
|
139
139
|
args,
|
|
140
140
|
copyReqZ,
|
|
141
141
|
copyResZ,
|
|
@@ -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,5 +7,6 @@
|
|
|
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 * from "@/
|
|
11
|
-
export * from "@/
|
|
10
|
+
export * from "@/schematic/client";
|
|
11
|
+
export * from "@/schematic/payload";
|
|
12
|
+
export * from "@/schematic/symbol";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Copyright 2026 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
|
+
export * as schematic from "@/schematic/external";
|