@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("Schematic", () => {
|
|
|
22
22
|
name: "Schematic",
|
|
23
23
|
layout: { one: 1 },
|
|
24
24
|
});
|
|
25
|
-
const schematic = await client.
|
|
25
|
+
const schematic = await client.schematics.create(ws.key, {
|
|
26
26
|
name: "Schematic",
|
|
27
27
|
data: { one: 1 },
|
|
28
28
|
});
|
|
@@ -37,12 +37,12 @@ describe("Schematic", () => {
|
|
|
37
37
|
name: "Schematic",
|
|
38
38
|
layout: { one: 1 },
|
|
39
39
|
});
|
|
40
|
-
const schematic = await client.
|
|
40
|
+
const schematic = await client.schematics.create(ws.key, {
|
|
41
41
|
name: "Schematic",
|
|
42
42
|
data: { one: 1 },
|
|
43
43
|
});
|
|
44
|
-
await client.
|
|
45
|
-
const res = await client.
|
|
44
|
+
await client.schematics.rename(schematic.key, "Schematic2");
|
|
45
|
+
const res = await client.schematics.retrieve({
|
|
46
46
|
key: schematic.key,
|
|
47
47
|
});
|
|
48
48
|
expect(res.name).toEqual("Schematic2");
|
|
@@ -54,12 +54,12 @@ describe("Schematic", () => {
|
|
|
54
54
|
name: "Schematic",
|
|
55
55
|
layout: { one: 1 },
|
|
56
56
|
});
|
|
57
|
-
const schematic = await client.
|
|
57
|
+
const schematic = await client.schematics.create(ws.key, {
|
|
58
58
|
name: "Schematic",
|
|
59
59
|
data: { one: 1 },
|
|
60
60
|
});
|
|
61
|
-
await client.
|
|
62
|
-
const res = await client.
|
|
61
|
+
await client.schematics.setData(schematic.key, { two: 2 });
|
|
62
|
+
const res = await client.schematics.retrieve({
|
|
63
63
|
key: schematic.key,
|
|
64
64
|
});
|
|
65
65
|
expect(res.data.two).toEqual(2);
|
|
@@ -71,14 +71,14 @@ describe("Schematic", () => {
|
|
|
71
71
|
name: "Schematic",
|
|
72
72
|
layout: { one: 1 },
|
|
73
73
|
});
|
|
74
|
-
const schematic = await client.
|
|
74
|
+
const schematic = await client.schematics.create(ws.key, {
|
|
75
75
|
name: "Schematic",
|
|
76
76
|
data: { one: 1 },
|
|
77
77
|
});
|
|
78
|
-
await client.
|
|
79
|
-
await expect(
|
|
80
|
-
|
|
81
|
-
)
|
|
78
|
+
await client.schematics.delete(schematic.key);
|
|
79
|
+
await expect(client.schematics.retrieve({ key: schematic.key })).rejects.toThrow(
|
|
80
|
+
NotFoundError,
|
|
81
|
+
);
|
|
82
82
|
});
|
|
83
83
|
});
|
|
84
84
|
describe("copy", () => {
|
|
@@ -87,11 +87,11 @@ describe("Schematic", () => {
|
|
|
87
87
|
name: "Schematic",
|
|
88
88
|
layout: { one: 1 },
|
|
89
89
|
});
|
|
90
|
-
const schematic = await client.
|
|
90
|
+
const schematic = await client.schematics.create(ws.key, {
|
|
91
91
|
name: "Schematic",
|
|
92
92
|
data: { one: 1 },
|
|
93
93
|
});
|
|
94
|
-
const schematic2 = await client.
|
|
94
|
+
const schematic2 = await client.schematics.copy({
|
|
95
95
|
key: schematic.key,
|
|
96
96
|
name: "Schematic2",
|
|
97
97
|
snapshot: false,
|
|
@@ -106,17 +106,17 @@ describe("Schematic", () => {
|
|
|
106
106
|
name: "Schematic",
|
|
107
107
|
layout: { one: 1 },
|
|
108
108
|
});
|
|
109
|
-
const schematic = await client.
|
|
109
|
+
const schematic = await client.schematics.create(ws.key, {
|
|
110
110
|
name: "Schematic",
|
|
111
111
|
data: { one: 1 },
|
|
112
112
|
});
|
|
113
|
-
const schematic2 = await client.
|
|
113
|
+
const schematic2 = await client.schematics.copy({
|
|
114
114
|
key: schematic.key,
|
|
115
115
|
name: "Schematic2",
|
|
116
116
|
snapshot: true,
|
|
117
117
|
});
|
|
118
118
|
await expect(
|
|
119
|
-
client.
|
|
119
|
+
client.schematics.setData(schematic2.key, { two: 2 }),
|
|
120
120
|
).rejects.toThrow(ValidationError);
|
|
121
121
|
});
|
|
122
122
|
});
|
|
@@ -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,11 +10,11 @@
|
|
|
10
10
|
import { describe, expect, it } from "vitest";
|
|
11
11
|
|
|
12
12
|
import { AuthError, NotFoundError } from "@/errors";
|
|
13
|
+
import { group } from "@/group";
|
|
13
14
|
import { ontology } from "@/ontology";
|
|
14
|
-
import {
|
|
15
|
+
import { symbol } from "@/schematic/symbol";
|
|
15
16
|
import { createTestClientWithPolicy } from "@/testutil/access";
|
|
16
17
|
import { createTestClient } from "@/testutil/client";
|
|
17
|
-
import { symbol } from "@/workspace/schematic/symbol";
|
|
18
18
|
|
|
19
19
|
const client = createTestClient();
|
|
20
20
|
|
|
@@ -26,11 +26,11 @@ describe("schematic_symbol", () => {
|
|
|
26
26
|
objects: [],
|
|
27
27
|
actions: [],
|
|
28
28
|
});
|
|
29
|
-
const symbolGroup = await client.
|
|
29
|
+
const symbolGroup = await client.groups.create({
|
|
30
30
|
parent: ontology.ROOT_ID,
|
|
31
31
|
name: "Test Symbols",
|
|
32
32
|
});
|
|
33
|
-
const randomSymbol = await client.
|
|
33
|
+
const randomSymbol = await client.schematics.symbols.create({
|
|
34
34
|
name: "test",
|
|
35
35
|
data: {
|
|
36
36
|
svg: "<svg></svg>",
|
|
@@ -41,7 +41,7 @@ describe("schematic_symbol", () => {
|
|
|
41
41
|
parent: group.ontologyID(symbolGroup.key),
|
|
42
42
|
});
|
|
43
43
|
await expect(
|
|
44
|
-
userClient.
|
|
44
|
+
userClient.schematics.symbols.retrieve({ key: randomSymbol.key }),
|
|
45
45
|
).rejects.toThrow(AuthError);
|
|
46
46
|
});
|
|
47
47
|
|
|
@@ -51,11 +51,11 @@ describe("schematic_symbol", () => {
|
|
|
51
51
|
objects: [symbol.ontologyID("")],
|
|
52
52
|
actions: ["retrieve"],
|
|
53
53
|
});
|
|
54
|
-
const symbolGroup = await client.
|
|
54
|
+
const symbolGroup = await client.groups.create({
|
|
55
55
|
parent: ontology.ROOT_ID,
|
|
56
56
|
name: "Test Symbols",
|
|
57
57
|
});
|
|
58
|
-
const randomSymbol = await client.
|
|
58
|
+
const randomSymbol = await client.schematics.symbols.create({
|
|
59
59
|
name: "test",
|
|
60
60
|
data: {
|
|
61
61
|
svg: "<svg></svg>",
|
|
@@ -65,7 +65,7 @@ describe("schematic_symbol", () => {
|
|
|
65
65
|
},
|
|
66
66
|
parent: group.ontologyID(symbolGroup.key),
|
|
67
67
|
});
|
|
68
|
-
const retrieved = await userClient.
|
|
68
|
+
const retrieved = await userClient.schematics.symbols.retrieve({
|
|
69
69
|
key: randomSymbol.key,
|
|
70
70
|
});
|
|
71
71
|
expect(retrieved.key).toBe(randomSymbol.key);
|
|
@@ -78,11 +78,11 @@ describe("schematic_symbol", () => {
|
|
|
78
78
|
objects: [symbol.ontologyID("")],
|
|
79
79
|
actions: ["create"],
|
|
80
80
|
});
|
|
81
|
-
const symbolGroup = await client.
|
|
81
|
+
const symbolGroup = await client.groups.create({
|
|
82
82
|
parent: ontology.ROOT_ID,
|
|
83
83
|
name: "Test Symbols",
|
|
84
84
|
});
|
|
85
|
-
await userClient.
|
|
85
|
+
await userClient.schematics.symbols.create({
|
|
86
86
|
name: "test",
|
|
87
87
|
data: {
|
|
88
88
|
svg: "<svg></svg>",
|
|
@@ -100,12 +100,12 @@ describe("schematic_symbol", () => {
|
|
|
100
100
|
objects: [symbol.ontologyID("")],
|
|
101
101
|
actions: [],
|
|
102
102
|
});
|
|
103
|
-
const symbolGroup = await client.
|
|
103
|
+
const symbolGroup = await client.groups.create({
|
|
104
104
|
parent: ontology.ROOT_ID,
|
|
105
105
|
name: "Test Symbols",
|
|
106
106
|
});
|
|
107
107
|
await expect(
|
|
108
|
-
userClient.
|
|
108
|
+
userClient.schematics.symbols.create({
|
|
109
109
|
name: "test",
|
|
110
110
|
data: {
|
|
111
111
|
svg: "<svg></svg>",
|
|
@@ -124,11 +124,11 @@ describe("schematic_symbol", () => {
|
|
|
124
124
|
objects: [symbol.ontologyID("")],
|
|
125
125
|
actions: ["delete", "retrieve"],
|
|
126
126
|
});
|
|
127
|
-
const symbolGroup = await client.
|
|
127
|
+
const symbolGroup = await client.groups.create({
|
|
128
128
|
parent: ontology.ROOT_ID,
|
|
129
129
|
name: "Test Symbols",
|
|
130
130
|
});
|
|
131
|
-
const randomSymbol = await client.
|
|
131
|
+
const randomSymbol = await client.schematics.symbols.create({
|
|
132
132
|
name: "test",
|
|
133
133
|
data: {
|
|
134
134
|
svg: "<svg></svg>",
|
|
@@ -138,9 +138,9 @@ describe("schematic_symbol", () => {
|
|
|
138
138
|
},
|
|
139
139
|
parent: group.ontologyID(symbolGroup.key),
|
|
140
140
|
});
|
|
141
|
-
await userClient.
|
|
141
|
+
await userClient.schematics.symbols.delete(randomSymbol.key);
|
|
142
142
|
await expect(
|
|
143
|
-
userClient.
|
|
143
|
+
userClient.schematics.symbols.retrieve({ key: randomSymbol.key }),
|
|
144
144
|
).rejects.toThrow(NotFoundError);
|
|
145
145
|
});
|
|
146
146
|
|
|
@@ -150,11 +150,11 @@ describe("schematic_symbol", () => {
|
|
|
150
150
|
objects: [symbol.ontologyID("")],
|
|
151
151
|
actions: [],
|
|
152
152
|
});
|
|
153
|
-
const symbolGroup = await client.
|
|
153
|
+
const symbolGroup = await client.groups.create({
|
|
154
154
|
parent: ontology.ROOT_ID,
|
|
155
155
|
name: "Test Symbols",
|
|
156
156
|
});
|
|
157
|
-
const randomSymbol = await client.
|
|
157
|
+
const randomSymbol = await client.schematics.symbols.create({
|
|
158
158
|
name: "test",
|
|
159
159
|
data: {
|
|
160
160
|
svg: "<svg></svg>",
|
|
@@ -165,7 +165,7 @@ describe("schematic_symbol", () => {
|
|
|
165
165
|
parent: group.ontologyID(symbolGroup.key),
|
|
166
166
|
});
|
|
167
167
|
await expect(
|
|
168
|
-
userClient.
|
|
168
|
+
userClient.schematics.symbols.delete(randomSymbol.key),
|
|
169
169
|
).rejects.toThrow(AuthError);
|
|
170
170
|
});
|
|
171
171
|
});
|
|
@@ -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 { beforeAll, describe, expect, it } 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();
|
|
@@ -18,14 +18,14 @@ const client = createTestClient();
|
|
|
18
18
|
describe("Symbol Client", () => {
|
|
19
19
|
let symbolGroup: group.Group;
|
|
20
20
|
beforeAll(async () => {
|
|
21
|
-
symbolGroup = await client.
|
|
21
|
+
symbolGroup = await client.groups.create({
|
|
22
22
|
parent: ontology.ROOT_ID,
|
|
23
23
|
name: "Test Symbols",
|
|
24
24
|
});
|
|
25
25
|
});
|
|
26
26
|
describe("create", () => {
|
|
27
27
|
it("should create a single symbol", async () => {
|
|
28
|
-
const symbol = await client.
|
|
28
|
+
const symbol = await client.schematics.symbols.create({
|
|
29
29
|
name: "Test Symbol",
|
|
30
30
|
data: {
|
|
31
31
|
svg: "<svg></svg>",
|
|
@@ -40,7 +40,7 @@ describe("Symbol Client", () => {
|
|
|
40
40
|
});
|
|
41
41
|
|
|
42
42
|
it("should create multiple symbols", async () => {
|
|
43
|
-
const symbols = await client.
|
|
43
|
+
const symbols = await client.schematics.symbols.create({
|
|
44
44
|
symbols: [
|
|
45
45
|
{
|
|
46
46
|
name: "Symbol 1",
|
|
@@ -61,13 +61,13 @@ describe("Symbol Client", () => {
|
|
|
61
61
|
|
|
62
62
|
describe("retrieve", () => {
|
|
63
63
|
it("should retrieve a single symbol by key", async () => {
|
|
64
|
-
const created = await client.
|
|
64
|
+
const created = await client.schematics.symbols.create({
|
|
65
65
|
name: "Retrieve Test",
|
|
66
66
|
data: { svg: "<svg></svg>", states: [], handles: [], variant: "sensor" },
|
|
67
67
|
parent: group.ontologyID(symbolGroup.key),
|
|
68
68
|
});
|
|
69
69
|
|
|
70
|
-
const retrieved = await client.
|
|
70
|
+
const retrieved = await client.schematics.symbols.retrieve({
|
|
71
71
|
key: created.key,
|
|
72
72
|
});
|
|
73
73
|
expect(retrieved.key).toBe(created.key);
|
|
@@ -75,18 +75,18 @@ describe("Symbol Client", () => {
|
|
|
75
75
|
});
|
|
76
76
|
|
|
77
77
|
it("should retrieve multiple symbols by keys", async () => {
|
|
78
|
-
const created1 = await client.
|
|
78
|
+
const created1 = await client.schematics.symbols.create({
|
|
79
79
|
name: "Multi Test 1",
|
|
80
80
|
data: { svg: "<svg></svg>", states: [], handles: [], variant: "sensor" },
|
|
81
81
|
parent: group.ontologyID(symbolGroup.key),
|
|
82
82
|
});
|
|
83
|
-
const created2 = await client.
|
|
83
|
+
const created2 = await client.schematics.symbols.create({
|
|
84
84
|
name: "Multi Test 2",
|
|
85
85
|
data: { svg: "<svg></svg>", states: [], handles: [], variant: "sensor" },
|
|
86
86
|
parent: group.ontologyID(symbolGroup.key),
|
|
87
87
|
});
|
|
88
88
|
|
|
89
|
-
const retrieved = await client.
|
|
89
|
+
const retrieved = await client.schematics.symbols.retrieve({
|
|
90
90
|
keys: [created1.key, created2.key],
|
|
91
91
|
});
|
|
92
92
|
expect(retrieved).toHaveLength(2);
|
|
@@ -95,15 +95,15 @@ describe("Symbol Client", () => {
|
|
|
95
95
|
|
|
96
96
|
describe("rename", () => {
|
|
97
97
|
it("should rename a symbol", async () => {
|
|
98
|
-
const symbol = await client.
|
|
98
|
+
const symbol = await client.schematics.symbols.create({
|
|
99
99
|
name: "Original Name",
|
|
100
100
|
data: { svg: "<svg></svg>", states: [], handles: [], variant: "sensor" },
|
|
101
101
|
parent: group.ontologyID(symbolGroup.key),
|
|
102
102
|
});
|
|
103
103
|
|
|
104
|
-
await client.
|
|
104
|
+
await client.schematics.symbols.rename(symbol.key, "New Name");
|
|
105
105
|
|
|
106
|
-
const retrieved = await client.
|
|
106
|
+
const retrieved = await client.schematics.symbols.retrieve({
|
|
107
107
|
key: symbol.key,
|
|
108
108
|
});
|
|
109
109
|
expect(retrieved.name).toBe("New Name");
|
|
@@ -112,23 +112,23 @@ describe("Symbol Client", () => {
|
|
|
112
112
|
|
|
113
113
|
describe("delete", () => {
|
|
114
114
|
it("should delete a single symbol", async () => {
|
|
115
|
-
const symbol = await client.
|
|
115
|
+
const symbol = await client.schematics.symbols.create({
|
|
116
116
|
name: "Delete Test",
|
|
117
117
|
data: { svg: "<svg></svg>", states: [], handles: [], variant: "sensor" },
|
|
118
118
|
parent: group.ontologyID(symbolGroup.key),
|
|
119
119
|
});
|
|
120
120
|
|
|
121
|
-
await client.
|
|
121
|
+
await client.schematics.symbols.delete(symbol.key);
|
|
122
122
|
|
|
123
123
|
await expect(
|
|
124
|
-
client.
|
|
124
|
+
client.schematics.symbols.retrieve({ key: symbol.key }),
|
|
125
125
|
).rejects.toThrow();
|
|
126
126
|
});
|
|
127
127
|
});
|
|
128
128
|
|
|
129
129
|
describe("retrieveGroup", () => {
|
|
130
130
|
it("should retrieve the symbol group", async () => {
|
|
131
|
-
const group = await client.
|
|
131
|
+
const group = await client.schematics.symbols.retrieveGroup();
|
|
132
132
|
expect(group.key).toBeDefined();
|
|
133
133
|
expect(group.name).toBe("Schematic Symbols");
|
|
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.
|
|
@@ -11,9 +11,8 @@ import { sendRequired, type UnaryClient } from "@synnaxlabs/freighter";
|
|
|
11
11
|
import { array } from "@synnaxlabs/x";
|
|
12
12
|
import { z } from "zod";
|
|
13
13
|
|
|
14
|
+
import { group } from "@/group";
|
|
14
15
|
import { ontology } from "@/ontology";
|
|
15
|
-
import { group } from "@/ontology/group";
|
|
16
|
-
import { checkForMultipleOrNoResults } from "@/util/retrieve";
|
|
17
16
|
import {
|
|
18
17
|
type Key,
|
|
19
18
|
keyZ,
|
|
@@ -21,7 +20,8 @@ import {
|
|
|
21
20
|
newZ,
|
|
22
21
|
type Symbol,
|
|
23
22
|
symbolZ,
|
|
24
|
-
} from "@/
|
|
23
|
+
} from "@/schematic/symbol/payload";
|
|
24
|
+
import { checkForMultipleOrNoResults } from "@/util/retrieve";
|
|
25
25
|
|
|
26
26
|
const createReqZ = z.object({ symbols: newZ.array(), parent: ontology.idZ });
|
|
27
27
|
const renameReqZ = z.object({ key: keyZ, name: z.string() });
|
|
@@ -74,7 +74,7 @@ export class Client {
|
|
|
74
74
|
const symbols = isMany ? options.symbols : [options];
|
|
75
75
|
const res = await sendRequired(
|
|
76
76
|
this.client,
|
|
77
|
-
"/
|
|
77
|
+
"/schematic/symbol/create",
|
|
78
78
|
{ symbols, parent: options.parent },
|
|
79
79
|
createReqZ,
|
|
80
80
|
createResZ,
|
|
@@ -85,7 +85,7 @@ export class Client {
|
|
|
85
85
|
async rename(key: Key, name: string): Promise<void> {
|
|
86
86
|
await sendRequired(
|
|
87
87
|
this.client,
|
|
88
|
-
"/
|
|
88
|
+
"/schematic/symbol/rename",
|
|
89
89
|
{ key, name },
|
|
90
90
|
renameReqZ,
|
|
91
91
|
emptyResZ,
|
|
@@ -98,7 +98,7 @@ export class Client {
|
|
|
98
98
|
const isSingle = "key" in args;
|
|
99
99
|
const res = await sendRequired(
|
|
100
100
|
this.client,
|
|
101
|
-
"/
|
|
101
|
+
"/schematic/symbol/retrieve",
|
|
102
102
|
args,
|
|
103
103
|
retrieveArgsZ,
|
|
104
104
|
retrieveResZ,
|
|
@@ -110,7 +110,7 @@ export class Client {
|
|
|
110
110
|
async delete(keys: Key | Key[]): Promise<void> {
|
|
111
111
|
await sendRequired(
|
|
112
112
|
this.client,
|
|
113
|
-
"/
|
|
113
|
+
"/schematic/symbol/delete",
|
|
114
114
|
{ keys: array.toArray(keys) },
|
|
115
115
|
deleteReqZ,
|
|
116
116
|
emptyResZ,
|
|
@@ -120,7 +120,7 @@ export class Client {
|
|
|
120
120
|
async retrieveGroup(): Promise<group.Group> {
|
|
121
121
|
const res = await sendRequired(
|
|
122
122
|
this.client,
|
|
123
|
-
"/
|
|
123
|
+
"/schematic/symbol/retrieve-group",
|
|
124
124
|
{},
|
|
125
125
|
retrieveGroupReqZ,
|
|
126
126
|
retrieveGroupResZ,
|
|
@@ -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,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 * from "@/
|
|
11
|
-
export * from "@/
|
|
10
|
+
export * from "@/schematic/symbol/client";
|
|
11
|
+
export * from "@/schematic/symbol/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 symbol from "@/schematic/symbol/external";
|
package/src/status/client.ts
CHANGED
package/src/status/external.ts
CHANGED
package/src/status/index.ts
CHANGED
package/src/status/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.
|
|
@@ -23,7 +23,7 @@ export const statusZ = <Details extends z.ZodType = z.ZodNever>(
|
|
|
23
23
|
|
|
24
24
|
export const newZ = <DetailsSchema extends z.ZodType = z.ZodNever>(
|
|
25
25
|
detailsSchema?: DetailsSchema,
|
|
26
|
-
) => statusZ(detailsSchema).omit({ labels: true }).
|
|
26
|
+
) => statusZ(detailsSchema).omit({ labels: true }).extend({ key: keyZ.optional() });
|
|
27
27
|
|
|
28
28
|
export type New<DetailsSchema extends z.ZodType = z.ZodNever> = z.input<
|
|
29
29
|
ReturnType<typeof newZ<DetailsSchema>>
|
|
@@ -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,8 @@ import { TimeStamp, uuid } from "@synnaxlabs/x";
|
|
|
11
11
|
import { describe, expect, it } from "vitest";
|
|
12
12
|
import z from "zod";
|
|
13
13
|
|
|
14
|
+
import { group } from "@/group";
|
|
14
15
|
import { ontology } from "@/ontology";
|
|
15
|
-
import { group } from "@/ontology/group";
|
|
16
16
|
import { status } from "@/status";
|
|
17
17
|
import { createTestClient } from "@/testutil/client";
|
|
18
18
|
|
|
@@ -82,7 +82,7 @@ describe("Status", () => {
|
|
|
82
82
|
});
|
|
83
83
|
|
|
84
84
|
it("should set a status with a parent", async () => {
|
|
85
|
-
const parentGroup = await client.
|
|
85
|
+
const parentGroup = await client.groups.create({
|
|
86
86
|
parent: ontology.ROOT_ID,
|
|
87
87
|
name: "Parent Group",
|
|
88
88
|
});
|
|
@@ -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 { table } from "@/table";
|
|
13
14
|
import { createTestClientWithPolicy } from "@/testutil/access";
|
|
14
15
|
import { createTestClient } from "@/testutil/client";
|
|
15
|
-
import { table } from "@/workspace/table";
|
|
16
16
|
|
|
17
17
|
const client = createTestClient();
|
|
18
18
|
|
|
@@ -28,12 +28,12 @@ describe("table", () => {
|
|
|
28
28
|
name: "test",
|
|
29
29
|
layout: {},
|
|
30
30
|
});
|
|
31
|
-
const randomTable = await client.
|
|
31
|
+
const randomTable = await client.tables.create(ws.key, {
|
|
32
32
|
name: "test",
|
|
33
33
|
data: {},
|
|
34
34
|
});
|
|
35
35
|
await expect(
|
|
36
|
-
userClient.
|
|
36
|
+
userClient.tables.retrieve({ key: randomTable.key }),
|
|
37
37
|
).rejects.toThrow(AuthError);
|
|
38
38
|
});
|
|
39
39
|
|
|
@@ -47,11 +47,11 @@ describe("table", () => {
|
|
|
47
47
|
name: "test",
|
|
48
48
|
layout: {},
|
|
49
49
|
});
|
|
50
|
-
const randomTable = await client.
|
|
50
|
+
const randomTable = await client.tables.create(ws.key, {
|
|
51
51
|
name: "test",
|
|
52
52
|
data: {},
|
|
53
53
|
});
|
|
54
|
-
const retrieved = await userClient.
|
|
54
|
+
const retrieved = await userClient.tables.retrieve({
|
|
55
55
|
key: randomTable.key,
|
|
56
56
|
});
|
|
57
57
|
expect(retrieved.key).toBe(randomTable.key);
|
|
@@ -68,7 +68,7 @@ describe("table", () => {
|
|
|
68
68
|
name: "test",
|
|
69
69
|
layout: {},
|
|
70
70
|
});
|
|
71
|
-
await userClient.
|
|
71
|
+
await userClient.tables.create(ws.key, {
|
|
72
72
|
name: "test",
|
|
73
73
|
data: {},
|
|
74
74
|
});
|
|
@@ -85,7 +85,7 @@ describe("table", () => {
|
|
|
85
85
|
layout: {},
|
|
86
86
|
});
|
|
87
87
|
await expect(
|
|
88
|
-
userClient.
|
|
88
|
+
userClient.tables.create(ws.key, {
|
|
89
89
|
name: "test",
|
|
90
90
|
data: {},
|
|
91
91
|
}),
|
|
@@ -102,13 +102,13 @@ describe("table", () => {
|
|
|
102
102
|
name: "test",
|
|
103
103
|
layout: {},
|
|
104
104
|
});
|
|
105
|
-
const randomTable = await client.
|
|
105
|
+
const randomTable = await client.tables.create(ws.key, {
|
|
106
106
|
name: "test",
|
|
107
107
|
data: {},
|
|
108
108
|
});
|
|
109
|
-
await userClient.
|
|
109
|
+
await userClient.tables.delete(randomTable.key);
|
|
110
110
|
await expect(
|
|
111
|
-
userClient.
|
|
111
|
+
userClient.tables.retrieve({ key: randomTable.key }),
|
|
112
112
|
).rejects.toThrow(NotFoundError);
|
|
113
113
|
});
|
|
114
114
|
|
|
@@ -122,13 +122,13 @@ describe("table", () => {
|
|
|
122
122
|
name: "test",
|
|
123
123
|
layout: {},
|
|
124
124
|
});
|
|
125
|
-
const randomTable = await client.
|
|
125
|
+
const randomTable = await client.tables.create(ws.key, {
|
|
126
126
|
name: "test",
|
|
127
127
|
data: {},
|
|
128
128
|
});
|
|
129
|
-
await expect(
|
|
130
|
-
|
|
131
|
-
)
|
|
129
|
+
await expect(userClient.tables.delete(randomTable.key)).rejects.toThrow(
|
|
130
|
+
AuthError,
|
|
131
|
+
);
|
|
132
132
|
});
|
|
133
133
|
});
|
|
134
134
|
});
|