@synnaxlabs/client 0.53.0 → 0.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +14 -8
- package/dist/client.cjs +48 -54
- package/dist/client.js +12360 -15511
- package/dist/src/access/action/index.d.ts +2 -0
- package/dist/src/access/action/index.d.ts.map +1 -0
- package/dist/src/access/{payload.d.ts → action/types.gen.d.ts} +2 -1
- package/dist/src/access/action/types.gen.d.ts.map +1 -0
- package/dist/src/access/enforce.d.ts +2 -2
- package/dist/src/access/enforce.d.ts.map +1 -1
- package/dist/src/access/external.d.ts +1 -1
- package/dist/src/access/external.d.ts.map +1 -1
- package/dist/src/access/policy/client.d.ts +233 -389
- package/dist/src/access/policy/client.d.ts.map +1 -1
- package/dist/src/access/policy/external.d.ts +1 -1
- package/dist/src/access/policy/external.d.ts.map +1 -1
- package/dist/src/access/policy/types.gen.d.ts +120 -0
- package/dist/src/access/policy/types.gen.d.ts.map +1 -0
- package/dist/src/access/role/client.d.ts +1 -1
- package/dist/src/access/role/client.d.ts.map +1 -1
- package/dist/src/access/role/external.d.ts +1 -1
- package/dist/src/access/role/external.d.ts.map +1 -1
- package/dist/src/access/role/types.gen.d.ts +34 -0
- package/dist/src/access/role/types.gen.d.ts.map +1 -0
- package/dist/src/arc/client.d.ts +2 -2
- package/dist/src/arc/client.d.ts.map +1 -1
- package/dist/src/arc/compiler/index.d.ts +2 -0
- package/dist/src/arc/compiler/index.d.ts.map +1 -0
- package/dist/src/arc/compiler/types.gen.d.ts +12 -0
- package/dist/src/arc/compiler/types.gen.d.ts.map +1 -0
- package/dist/src/arc/external.d.ts +6 -1
- package/dist/src/arc/external.d.ts.map +1 -1
- package/dist/src/arc/graph/index.d.ts +2 -0
- package/dist/src/arc/graph/index.d.ts.map +1 -0
- package/dist/src/arc/graph/types.gen.d.ts +644 -0
- package/dist/src/arc/graph/types.gen.d.ts.map +1 -0
- package/dist/src/arc/ir/index.d.ts +2 -0
- package/dist/src/arc/ir/index.d.ts.map +1 -0
- package/dist/src/arc/ir/types.gen.d.ts +2988 -0
- package/dist/src/arc/ir/types.gen.d.ts.map +1 -0
- package/dist/src/arc/module/index.d.ts +2 -0
- package/dist/src/arc/module/index.d.ts.map +1 -0
- package/dist/src/arc/module/types.gen.d.ts +1138 -0
- package/dist/src/arc/module/types.gen.d.ts.map +1 -0
- package/dist/src/arc/program/index.d.ts +2 -0
- package/dist/src/arc/program/index.d.ts.map +1 -0
- package/dist/src/arc/program/types.gen.d.ts +1138 -0
- package/dist/src/arc/program/types.gen.d.ts.map +1 -0
- package/dist/src/arc/text/index.d.ts +2 -0
- package/dist/src/arc/text/index.d.ts.map +1 -0
- package/dist/src/arc/text/types.gen.d.ts +8 -0
- package/dist/src/arc/text/types.gen.d.ts.map +1 -0
- package/dist/src/arc/types/index.d.ts +2 -0
- package/dist/src/arc/types/index.d.ts.map +1 -0
- package/dist/src/arc/types/types.gen.d.ts +237 -0
- package/dist/src/arc/types/types.gen.d.ts.map +1 -0
- package/dist/src/arc/types.gen.d.ts +2394 -0
- package/dist/src/arc/types.gen.d.ts.map +1 -0
- package/dist/src/channel/client.d.ts +5 -4
- package/dist/src/channel/client.d.ts.map +1 -1
- package/dist/src/channel/external.d.ts +1 -0
- package/dist/src/channel/external.d.ts.map +1 -1
- package/dist/src/channel/payload.d.ts +93 -178
- package/dist/src/channel/payload.d.ts.map +1 -1
- package/dist/src/channel/retriever.d.ts +3 -2
- package/dist/src/channel/retriever.d.ts.map +1 -1
- package/dist/src/channel/types.gen.d.ts +151 -0
- package/dist/src/channel/types.gen.d.ts.map +1 -0
- package/dist/src/channel/writer.d.ts +1 -1
- package/dist/src/channel/writer.d.ts.map +1 -1
- package/dist/src/client.d.ts.map +1 -1
- package/dist/src/cluster/index.d.ts +2 -0
- package/dist/src/cluster/index.d.ts.map +1 -0
- package/dist/src/cluster/types.gen.d.ts +4 -0
- package/dist/src/cluster/types.gen.d.ts.map +1 -0
- package/dist/src/control/state.d.ts +14 -9
- package/dist/src/control/state.d.ts.map +1 -1
- package/dist/src/device/client.d.ts +7 -12
- package/dist/src/device/client.d.ts.map +1 -1
- package/dist/src/device/external.d.ts +1 -1
- package/dist/src/device/external.d.ts.map +1 -1
- package/dist/src/device/types.gen.d.ts +163 -0
- package/dist/src/device/types.gen.d.ts.map +1 -0
- package/dist/src/framer/adapter.d.ts +2 -2
- package/dist/src/framer/adapter.d.ts.map +1 -1
- package/dist/src/framer/client.d.ts +7 -7
- package/dist/src/framer/client.d.ts.map +1 -1
- package/dist/src/framer/codec.d.ts +5 -5
- package/dist/src/framer/codec.d.ts.map +1 -1
- package/dist/src/framer/external.d.ts +1 -1
- package/dist/src/framer/external.d.ts.map +1 -1
- package/dist/src/framer/frame.d.ts +18 -18
- package/dist/src/framer/frame.d.ts.map +1 -1
- package/dist/src/framer/reader.d.ts +1 -1
- package/dist/src/framer/reader.d.ts.map +1 -1
- package/dist/src/framer/streamer.d.ts +177 -114
- package/dist/src/framer/streamer.d.ts.map +1 -1
- package/dist/src/framer/types.gen.d.ts +9 -0
- package/dist/src/framer/types.gen.d.ts.map +1 -0
- package/dist/src/framer/writer.d.ts +192 -128
- package/dist/src/framer/writer.d.ts.map +1 -1
- package/dist/src/group/client.d.ts +17 -17
- package/dist/src/group/client.d.ts.map +1 -1
- package/dist/src/group/external.d.ts +1 -1
- package/dist/src/group/external.d.ts.map +1 -1
- package/dist/src/group/types.gen.d.ts +23 -0
- package/dist/src/group/types.gen.d.ts.map +1 -0
- package/dist/src/label/client.d.ts +51 -72
- package/dist/src/label/client.d.ts.map +1 -1
- package/dist/src/label/payload.d.ts +30 -8
- package/dist/src/label/payload.d.ts.map +1 -1
- package/dist/src/lineplot/client.d.ts +2 -11
- package/dist/src/lineplot/client.d.ts.map +1 -1
- package/dist/src/lineplot/external.d.ts +1 -1
- package/dist/src/lineplot/external.d.ts.map +1 -1
- package/dist/src/lineplot/types.gen.d.ts +33 -0
- package/dist/src/lineplot/types.gen.d.ts.map +1 -0
- package/dist/src/log/client.d.ts +2 -11
- package/dist/src/log/client.d.ts.map +1 -1
- package/dist/src/log/external.d.ts +1 -1
- package/dist/src/log/external.d.ts.map +1 -1
- package/dist/src/log/types.gen.d.ts +33 -0
- package/dist/src/log/types.gen.d.ts.map +1 -0
- package/dist/src/ontology/client.d.ts +31 -31
- package/dist/src/ontology/payload.d.ts +74 -99
- package/dist/src/ontology/payload.d.ts.map +1 -1
- package/dist/src/ontology/types.gen.d.ts +30 -0
- package/dist/src/ontology/types.gen.d.ts.map +1 -0
- package/dist/src/ontology/writer.d.ts +80 -80
- package/dist/src/rack/client.d.ts +22 -11
- package/dist/src/rack/client.d.ts.map +1 -1
- package/dist/src/rack/external.d.ts +1 -1
- package/dist/src/rack/external.d.ts.map +1 -1
- package/dist/src/rack/types.gen.d.ts +72 -0
- package/dist/src/rack/types.gen.d.ts.map +1 -0
- package/dist/src/range/alias/types.gen.d.ts +14 -0
- package/dist/src/range/alias/types.gen.d.ts.map +1 -0
- package/dist/src/range/kv/types.gen.d.ts +13 -0
- package/dist/src/range/kv/types.gen.d.ts.map +1 -0
- package/dist/src/ranger/alias/client.d.ts +1 -1
- package/dist/src/ranger/alias/client.d.ts.map +1 -1
- package/dist/src/ranger/alias/external.d.ts +3 -1
- package/dist/src/ranger/alias/external.d.ts.map +1 -1
- package/dist/src/ranger/alias/payload.d.ts +5 -9
- package/dist/src/ranger/alias/payload.d.ts.map +1 -1
- package/dist/src/ranger/alias/payload.spec.d.ts +2 -0
- package/dist/src/ranger/alias/payload.spec.d.ts.map +1 -0
- package/dist/src/ranger/alias/types.gen.d.ts +14 -0
- package/dist/src/ranger/alias/types.gen.d.ts.map +1 -0
- package/dist/src/ranger/client.d.ts +10 -15
- package/dist/src/ranger/client.d.ts.map +1 -1
- package/dist/src/ranger/external.d.ts +4 -4
- package/dist/src/ranger/external.d.ts.map +1 -1
- package/dist/src/ranger/kv/client.d.ts +1 -1
- package/dist/src/ranger/kv/client.d.ts.map +1 -1
- package/dist/src/ranger/kv/external.d.ts +3 -1
- package/dist/src/ranger/kv/external.d.ts.map +1 -1
- package/dist/src/ranger/kv/payload.d.ts +6 -13
- package/dist/src/ranger/kv/payload.d.ts.map +1 -1
- package/dist/src/ranger/kv/types.gen.d.ts +13 -0
- package/dist/src/ranger/kv/types.gen.d.ts.map +1 -0
- package/dist/src/ranger/payload.d.ts +2 -97
- package/dist/src/ranger/payload.d.ts.map +1 -1
- package/dist/src/ranger/types.gen.d.ts +219 -0
- package/dist/src/ranger/types.gen.d.ts.map +1 -0
- package/dist/src/ranger/writer.d.ts +25 -25
- package/dist/src/ranger/writer.d.ts.map +1 -1
- package/dist/src/schematic/client.d.ts +2 -11
- package/dist/src/schematic/client.d.ts.map +1 -1
- package/dist/src/schematic/external.d.ts +1 -1
- package/dist/src/schematic/external.d.ts.map +1 -1
- package/dist/src/schematic/symbol/client.d.ts +1 -2
- package/dist/src/schematic/symbol/client.d.ts.map +1 -1
- package/dist/src/schematic/symbol/external.d.ts +1 -1
- package/dist/src/schematic/symbol/external.d.ts.map +1 -1
- package/dist/src/schematic/symbol/types.gen.d.ts +277 -0
- package/dist/src/schematic/symbol/types.gen.d.ts.map +1 -0
- package/dist/src/schematic/types.gen.d.ts +35 -0
- package/dist/src/schematic/types.gen.d.ts.map +1 -0
- package/dist/src/status/client.d.ts +2 -0
- package/dist/src/status/client.d.ts.map +1 -1
- package/dist/src/status/payload.d.ts +25 -54
- package/dist/src/status/payload.d.ts.map +1 -1
- package/dist/src/table/client.d.ts +2 -11
- package/dist/src/table/client.d.ts.map +1 -1
- package/dist/src/table/external.d.ts +1 -1
- package/dist/src/table/external.d.ts.map +1 -1
- package/dist/src/table/types.gen.d.ts +33 -0
- package/dist/src/table/types.gen.d.ts.map +1 -0
- package/dist/src/task/client.d.ts +15 -20
- package/dist/src/task/client.d.ts.map +1 -1
- package/dist/src/task/external.d.ts +1 -1
- package/dist/src/task/external.d.ts.map +1 -1
- package/dist/src/task/types.gen.d.ts +155 -0
- package/dist/src/task/types.gen.d.ts.map +1 -0
- package/dist/src/user/client.d.ts +3 -3
- package/dist/src/user/client.d.ts.map +1 -1
- package/dist/src/user/external.d.ts +1 -1
- package/dist/src/user/external.d.ts.map +1 -1
- package/dist/src/user/types.gen.d.ts +35 -0
- package/dist/src/user/types.gen.d.ts.map +1 -0
- package/dist/src/util/decodeJSONString.d.ts.map +1 -1
- package/dist/src/view/client.d.ts +1 -10
- package/dist/src/view/client.d.ts.map +1 -1
- package/dist/src/view/external.d.ts +1 -1
- package/dist/src/view/external.d.ts.map +1 -1
- package/dist/src/view/types.gen.d.ts +35 -0
- package/dist/src/view/types.gen.d.ts.map +1 -0
- package/dist/src/workspace/client.d.ts +2 -11
- package/dist/src/workspace/client.d.ts.map +1 -1
- package/dist/src/workspace/external.d.ts +1 -1
- package/dist/src/workspace/external.d.ts.map +1 -1
- package/dist/src/workspace/types.gen.d.ts +34 -0
- package/dist/src/workspace/types.gen.d.ts.map +1 -0
- package/package.json +11 -11
- package/src/access/action/index.ts +11 -0
- package/src/access/{payload.ts → action/types.gen.ts} +4 -1
- package/src/access/enforce.spec.ts +1 -2
- package/src/access/enforce.ts +2 -2
- package/src/access/external.ts +1 -1
- package/src/access/policy/client.ts +2 -2
- package/src/access/policy/external.ts +1 -1
- package/src/access/policy/types.gen.ts +44 -0
- package/src/access/role/client.ts +2 -2
- package/src/access/role/external.ts +1 -1
- package/src/access/role/types.gen.ts +46 -0
- package/src/arc/access.spec.ts +18 -6
- package/src/arc/client.ts +3 -3
- package/src/{framer/payload.ts → arc/compiler/index.ts} +1 -6
- package/src/arc/compiler/types.gen.ts +27 -0
- package/src/arc/external.ts +6 -1
- package/src/arc/graph/index.ts +10 -0
- package/src/arc/graph/types.gen.ts +59 -0
- package/src/arc/ir/index.ts +10 -0
- package/src/arc/ir/types.gen.ts +166 -0
- package/src/arc/module/index.ts +10 -0
- package/src/arc/module/types.gen.ts +18 -0
- package/src/arc/program/index.ts +10 -0
- package/src/arc/program/types.gen.ts +18 -0
- package/src/arc/text/index.ts +10 -0
- package/src/arc/text/types.gen.ts +19 -0
- package/src/arc/types/index.ts +10 -0
- package/src/arc/types/types.gen.ts +132 -0
- package/src/arc/types.gen.ts +85 -0
- package/src/channel/client.ts +14 -15
- package/src/channel/external.ts +1 -0
- package/src/channel/payload.spec.ts +19 -16
- package/src/channel/payload.ts +14 -82
- package/src/channel/retriever.ts +9 -18
- package/src/channel/types.gen.ts +137 -0
- package/src/channel/writer.ts +2 -2
- package/src/client.ts +4 -0
- package/src/cluster/index.ts +10 -0
- package/src/cluster/types.gen.ts +16 -0
- package/src/control/state.ts +8 -6
- package/src/device/client.ts +14 -11
- package/src/device/device.spec.ts +95 -1
- package/src/device/external.ts +1 -1
- package/src/device/payload.spec.ts +26 -2
- package/src/device/types.gen.ts +100 -0
- package/src/framer/adapter.ts +7 -4
- package/src/framer/client.ts +15 -9
- package/src/framer/codec.spec.ts +25 -5
- package/src/framer/codec.ts +11 -9
- package/src/framer/deleter.spec.ts +0 -15
- package/src/framer/external.ts +1 -1
- package/src/framer/frame.ts +44 -36
- package/src/framer/reader.spec.ts +2 -2
- package/src/framer/reader.ts +6 -6
- package/src/framer/streamer.spec.ts +98 -0
- package/src/framer/streamer.ts +10 -0
- package/src/framer/types.gen.ts +20 -0
- package/src/framer/writer.ts +14 -8
- package/src/group/client.ts +1 -1
- package/src/group/external.ts +1 -1
- package/src/group/group.spec.ts +1 -1
- package/src/{access/role/payload.ts → group/types.gen.ts} +11 -11
- package/src/label/client.ts +2 -5
- package/src/label/label.spec.ts +12 -3
- package/src/label/payload.ts +3 -1
- package/src/lineplot/client.ts +9 -11
- package/src/lineplot/external.ts +1 -1
- package/src/lineplot/lineplot.spec.ts +40 -0
- package/src/lineplot/types.gen.ts +42 -0
- package/src/log/client.ts +9 -18
- package/src/log/external.ts +1 -1
- package/src/log/log.spec.ts +38 -0
- package/src/log/types.gen.ts +42 -0
- package/src/ontology/payload.ts +5 -29
- package/src/ontology/types.gen.ts +41 -0
- package/src/rack/client.ts +26 -10
- package/src/rack/external.ts +1 -1
- package/src/rack/rack.spec.ts +37 -0
- package/src/rack/types.gen.ts +62 -0
- package/src/range/alias/types.gen.ts +30 -0
- package/src/range/kv/types.gen.ts +28 -0
- package/src/ranger/alias/client.ts +1 -1
- package/src/ranger/alias/external.ts +3 -10
- package/src/ranger/alias/payload.spec.ts +52 -0
- package/src/ranger/alias/payload.ts +11 -10
- package/src/ranger/alias/types.gen.ts +30 -0
- package/src/ranger/client.ts +34 -45
- package/src/ranger/external.ts +3 -3
- package/src/ranger/kv/client.ts +3 -3
- package/src/ranger/kv/external.ts +3 -7
- package/src/ranger/kv/payload.ts +1 -6
- package/src/ranger/kv/types.gen.ts +28 -0
- package/src/ranger/payload.ts +2 -46
- package/src/ranger/ranger.spec.ts +2 -4
- package/src/ranger/types.gen.ts +66 -0
- package/src/ranger/writer.ts +2 -1
- package/src/schematic/client.ts +11 -14
- package/src/schematic/external.ts +1 -1
- package/src/schematic/schematic.spec.ts +54 -2
- package/src/schematic/symbol/client.ts +2 -4
- package/src/schematic/symbol/external.ts +1 -1
- package/src/schematic/symbol/types.gen.ts +124 -0
- package/src/schematic/types.gen.ts +44 -0
- package/src/status/client.ts +4 -3
- package/src/status/payload.ts +5 -4
- package/src/status/status.spec.ts +106 -11
- package/src/table/client.ts +10 -19
- package/src/table/external.ts +1 -1
- package/src/table/table.spec.ts +38 -0
- package/src/table/types.gen.ts +42 -0
- package/src/task/client.ts +30 -28
- package/src/task/external.ts +1 -1
- package/src/task/payload.spec.ts +19 -19
- package/src/task/task.spec.ts +127 -9
- package/src/task/types.gen.ts +169 -0
- package/src/user/client.ts +2 -2
- package/src/user/external.ts +1 -1
- package/src/user/types.gen.ts +49 -0
- package/src/util/decodeJSONString.ts +1 -1
- package/src/util/retrieve.ts +2 -2
- package/src/view/client.ts +2 -7
- package/src/view/external.ts +1 -1
- package/src/view/types.gen.ts +44 -0
- package/src/workspace/client.ts +10 -14
- package/src/workspace/external.ts +1 -1
- package/src/workspace/types.gen.ts +45 -0
- package/src/workspace/workspace.spec.ts +37 -0
- package/tsconfig.json +1 -3
- package/vite.config.ts +9 -2
- package/dist/src/access/payload.d.ts.map +0 -1
- package/dist/src/access/policy/payload.d.ts +0 -156
- package/dist/src/access/policy/payload.d.ts.map +0 -1
- package/dist/src/access/role/payload.d.ts +0 -27
- package/dist/src/access/role/payload.d.ts.map +0 -1
- package/dist/src/arc/payload.d.ts +0 -167
- package/dist/src/arc/payload.d.ts.map +0 -1
- package/dist/src/device/payload.d.ts +0 -281
- package/dist/src/device/payload.d.ts.map +0 -1
- package/dist/src/framer/payload.d.ts +0 -7
- package/dist/src/framer/payload.d.ts.map +0 -1
- package/dist/src/group/payload.d.ts +0 -16
- package/dist/src/group/payload.d.ts.map +0 -1
- package/dist/src/lineplot/payload.d.ts +0 -28
- package/dist/src/lineplot/payload.d.ts.map +0 -1
- package/dist/src/log/payload.d.ts +0 -28
- package/dist/src/log/payload.d.ts.map +0 -1
- package/dist/src/rack/payload.d.ts +0 -243
- package/dist/src/rack/payload.d.ts.map +0 -1
- package/dist/src/schematic/payload.d.ts +0 -38
- package/dist/src/schematic/payload.d.ts.map +0 -1
- package/dist/src/schematic/symbol/payload.d.ts +0 -169
- package/dist/src/schematic/symbol/payload.d.ts.map +0 -1
- package/dist/src/table/payload.d.ts +0 -33
- package/dist/src/table/payload.d.ts.map +0 -1
- package/dist/src/task/payload.d.ts +0 -123
- package/dist/src/task/payload.d.ts.map +0 -1
- package/dist/src/user/payload.d.ts +0 -22
- package/dist/src/user/payload.d.ts.map +0 -1
- package/dist/src/view/payload.d.ts +0 -20
- package/dist/src/view/payload.d.ts.map +0 -1
- package/dist/src/workspace/payload.d.ts +0 -33
- package/dist/src/workspace/payload.d.ts.map +0 -1
- package/src/access/policy/payload.ts +0 -37
- package/src/arc/payload.ts +0 -73
- package/src/device/payload.ts +0 -83
- package/src/group/payload.ts +0 -24
- package/src/lineplot/payload.ts +0 -29
- package/src/log/payload.ts +0 -29
- package/src/rack/payload.ts +0 -30
- package/src/schematic/payload.ts +0 -34
- package/src/schematic/symbol/payload.ts +0 -70
- package/src/table/payload.ts +0 -33
- package/src/task/payload.ts +0 -127
- package/src/user/payload.ts +0 -29
- package/src/view/payload.ts +0 -25
- package/src/workspace/payload.ts +0 -33
|
@@ -41,6 +41,36 @@ describe("Streamer", () => {
|
|
|
41
41
|
const d = await streamer.read();
|
|
42
42
|
expect(Array.from(d.get(ch.key))).toEqual([1, 2, 3]);
|
|
43
43
|
});
|
|
44
|
+
test("should preserve non-zero time ranges through codec round-trip", async () => {
|
|
45
|
+
const ch = await newVirtualChannel(client);
|
|
46
|
+
const streamer = await client.openStreamer(ch.key);
|
|
47
|
+
const writer = await client.openWriter({
|
|
48
|
+
start: TimeStamp.now(),
|
|
49
|
+
channels: ch.key,
|
|
50
|
+
});
|
|
51
|
+
const start = new TimeStamp(1000000000n);
|
|
52
|
+
const end = new TimeStamp(6000000000n);
|
|
53
|
+
try {
|
|
54
|
+
const fr = new Frame(
|
|
55
|
+
[ch.key],
|
|
56
|
+
[
|
|
57
|
+
new Series({
|
|
58
|
+
data: new Float64Array([1, 2, 3]),
|
|
59
|
+
dataType: DataType.FLOAT64,
|
|
60
|
+
timeRange: start.spanRange(TimeSpan.seconds(5)),
|
|
61
|
+
}),
|
|
62
|
+
],
|
|
63
|
+
);
|
|
64
|
+
await writer.write(fr);
|
|
65
|
+
} finally {
|
|
66
|
+
await writer.close();
|
|
67
|
+
}
|
|
68
|
+
const d = await streamer.read();
|
|
69
|
+
const series = d.series[0];
|
|
70
|
+
expect(series.timeRange).toBeDefined();
|
|
71
|
+
expect(series.timeRange?.start.valueOf()).toEqual(start.valueOf());
|
|
72
|
+
expect(series.timeRange?.end.valueOf()).toEqual(end.valueOf());
|
|
73
|
+
});
|
|
44
74
|
test("open with config", async () => {
|
|
45
75
|
const ch = await newVirtualChannel(client);
|
|
46
76
|
await expect(client.openStreamer({ channels: ch.key })).resolves.not.toThrow();
|
|
@@ -56,6 +86,73 @@ describe("Streamer", () => {
|
|
|
56
86
|
it("should throw an error when the streamer is opened with a channel that does not exist", async () => {
|
|
57
87
|
await expect(client.openStreamer([5678])).rejects.toThrow("not found");
|
|
58
88
|
});
|
|
89
|
+
describe("excludeGroups", () => {
|
|
90
|
+
test("should filter out frames from a writer whose group matches", async () => {
|
|
91
|
+
const ch = await newVirtualChannel(client);
|
|
92
|
+
const streamer = await client.openStreamer({
|
|
93
|
+
channels: ch.key,
|
|
94
|
+
excludeGroups: [42],
|
|
95
|
+
});
|
|
96
|
+
const writer = await client.openWriter({
|
|
97
|
+
start: TimeStamp.now(),
|
|
98
|
+
channels: ch.key,
|
|
99
|
+
controlSubject: { name: "grouped", key: id.create(), group: 42 },
|
|
100
|
+
});
|
|
101
|
+
try {
|
|
102
|
+
await writer.write(ch.key, new Float64Array([1, 2, 3]));
|
|
103
|
+
const result = await Promise.race([
|
|
104
|
+
streamer.read().then((f) => f),
|
|
105
|
+
sleep.sleep(TimeSpan.milliseconds(500)).then(() => null),
|
|
106
|
+
]);
|
|
107
|
+
expect(result).toBeNull();
|
|
108
|
+
} finally {
|
|
109
|
+
await writer.close();
|
|
110
|
+
streamer.close();
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
test("should deliver frames from a writer whose group does not match", async () => {
|
|
115
|
+
const ch = await newVirtualChannel(client);
|
|
116
|
+
const streamer = await client.openStreamer({
|
|
117
|
+
channels: ch.key,
|
|
118
|
+
excludeGroups: [99],
|
|
119
|
+
});
|
|
120
|
+
const writer = await client.openWriter({
|
|
121
|
+
start: TimeStamp.now(),
|
|
122
|
+
channels: ch.key,
|
|
123
|
+
controlSubject: { name: "grouped", key: id.create(), group: 42 },
|
|
124
|
+
});
|
|
125
|
+
try {
|
|
126
|
+
await writer.write(ch.key, new Float64Array([1, 2, 3]));
|
|
127
|
+
const d = await streamer.read();
|
|
128
|
+
expect(Array.from(d.get(ch.key))).toEqual([1, 2, 3]);
|
|
129
|
+
} finally {
|
|
130
|
+
await writer.close();
|
|
131
|
+
streamer.close();
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
test("should deliver frames from a writer with group 0 even if 0 is excluded", async () => {
|
|
136
|
+
const ch = await newVirtualChannel(client);
|
|
137
|
+
const streamer = await client.openStreamer({
|
|
138
|
+
channels: ch.key,
|
|
139
|
+
excludeGroups: [0],
|
|
140
|
+
});
|
|
141
|
+
const writer = await client.openWriter({
|
|
142
|
+
start: TimeStamp.now(),
|
|
143
|
+
channels: ch.key,
|
|
144
|
+
});
|
|
145
|
+
try {
|
|
146
|
+
await writer.write(ch.key, new Float64Array([1, 2, 3]));
|
|
147
|
+
const d = await streamer.read();
|
|
148
|
+
expect(Array.from(d.get(ch.key))).toEqual([1, 2, 3]);
|
|
149
|
+
} finally {
|
|
150
|
+
await writer.close();
|
|
151
|
+
streamer.close();
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
|
|
59
156
|
describe("downsampling", () => {
|
|
60
157
|
test("downsample factor of 1", async () => {
|
|
61
158
|
const ch = await newVirtualChannel(client);
|
|
@@ -484,6 +581,7 @@ describe("Streamer", () => {
|
|
|
484
581
|
expect(openMock).toHaveBeenCalledWith({
|
|
485
582
|
...config,
|
|
486
583
|
downsampleFactor: 1,
|
|
584
|
+
excludeGroups: [],
|
|
487
585
|
throttleRate: new Rate(0),
|
|
488
586
|
});
|
|
489
587
|
await hardened.update([1, 2, 3]);
|
package/src/framer/streamer.ts
CHANGED
|
@@ -22,6 +22,7 @@ const reqZ = z.object({
|
|
|
22
22
|
keys: z.number().array(),
|
|
23
23
|
downsampleFactor: z.int(),
|
|
24
24
|
throttleRate: Rate.z.optional(),
|
|
25
|
+
excludeGroups: z.uint32().array().optional(),
|
|
25
26
|
});
|
|
26
27
|
|
|
27
28
|
/**
|
|
@@ -48,6 +49,9 @@ const intermediateStreamerConfigZ = z.object({
|
|
|
48
49
|
/** useHighPerformanceCodec sets whether the writer will use the Synnax frame encoder
|
|
49
50
|
as opposed to the standard JSON encoding mechanisms for frames. */
|
|
50
51
|
useHighPerformanceCodec: z.boolean().default(true),
|
|
52
|
+
/** excludeGroups sets writer group IDs whose frames should be filtered out by the
|
|
53
|
+
Core. Used for telemetry bypass deduplication. */
|
|
54
|
+
excludeGroups: z.uint32().array().default([]),
|
|
51
55
|
});
|
|
52
56
|
|
|
53
57
|
export const streamerConfigZ = intermediateStreamerConfigZ.or(
|
|
@@ -116,11 +120,13 @@ export const createStreamOpener =
|
|
|
116
120
|
adapter,
|
|
117
121
|
cfg.downsampleFactor,
|
|
118
122
|
cfg.throttleRate,
|
|
123
|
+
cfg.excludeGroups,
|
|
119
124
|
);
|
|
120
125
|
stream.send({
|
|
121
126
|
keys: Array.from(adapter.keys),
|
|
122
127
|
downsampleFactor: cfg.downsampleFactor,
|
|
123
128
|
throttleRate: cfg.throttleRate,
|
|
129
|
+
excludeGroups: cfg.excludeGroups,
|
|
124
130
|
});
|
|
125
131
|
const [, err] = await stream.receive();
|
|
126
132
|
if (err != null) throw err;
|
|
@@ -145,17 +151,20 @@ class BaseStreamer implements Streamer {
|
|
|
145
151
|
private readonly adapter: ReadAdapter;
|
|
146
152
|
private readonly downsampleFactor: number;
|
|
147
153
|
private readonly throttleRate: Rate;
|
|
154
|
+
private readonly excludeGroups: number[];
|
|
148
155
|
|
|
149
156
|
constructor(
|
|
150
157
|
stream: Stream<typeof reqZ, typeof resZ>,
|
|
151
158
|
adapter: ReadAdapter,
|
|
152
159
|
downsampleFactor: number = 1,
|
|
153
160
|
throttleRate: Rate = new Rate(0),
|
|
161
|
+
excludeGroups: number[] = [],
|
|
154
162
|
) {
|
|
155
163
|
this.stream = new StreamProxy("Streamer", stream);
|
|
156
164
|
this.adapter = adapter;
|
|
157
165
|
this.downsampleFactor = downsampleFactor;
|
|
158
166
|
this.throttleRate = throttleRate;
|
|
167
|
+
this.excludeGroups = excludeGroups;
|
|
159
168
|
}
|
|
160
169
|
|
|
161
170
|
get keys(): channel.Key[] {
|
|
@@ -183,6 +192,7 @@ class BaseStreamer implements Streamer {
|
|
|
183
192
|
keys: Array.from(this.adapter.keys),
|
|
184
193
|
downsampleFactor: this.downsampleFactor,
|
|
185
194
|
throttleRate: this.throttleRate,
|
|
195
|
+
excludeGroups: this.excludeGroups,
|
|
186
196
|
});
|
|
187
197
|
}
|
|
188
198
|
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
// Code generated by Oracle. DO NOT EDIT.
|
|
11
|
+
|
|
12
|
+
import { z } from "zod";
|
|
13
|
+
|
|
14
|
+
export enum WriterCommand {
|
|
15
|
+
Open = 0,
|
|
16
|
+
Write = 1,
|
|
17
|
+
Commit = 2,
|
|
18
|
+
SetAuthority = 3,
|
|
19
|
+
}
|
|
20
|
+
export const writerCommandZ = z.enum(WriterCommand);
|
package/src/framer/writer.ts
CHANGED
|
@@ -16,7 +16,7 @@ import { SynnaxError } from "@/errors";
|
|
|
16
16
|
import { WriteAdapter } from "@/framer/adapter";
|
|
17
17
|
import { WSWriterCodec } from "@/framer/codec";
|
|
18
18
|
import { type CrudeFrame, frameZ } from "@/framer/frame";
|
|
19
|
-
import { WriterCommand } from "@/framer/
|
|
19
|
+
import { WriterCommand } from "@/framer/types.gen";
|
|
20
20
|
|
|
21
21
|
export enum WriterMode {
|
|
22
22
|
PersistStream = 1,
|
|
@@ -135,9 +135,12 @@ const authorityArgsZ = z
|
|
|
135
135
|
throw new Error(
|
|
136
136
|
"authority is required when setting authority for a single channel",
|
|
137
137
|
);
|
|
138
|
-
return {
|
|
138
|
+
return {
|
|
139
|
+
keys: [value] as channel.Key[] | channel.Name[],
|
|
140
|
+
authorities: [authority],
|
|
141
|
+
};
|
|
139
142
|
}
|
|
140
|
-
const oValue = value as Record<channel.
|
|
143
|
+
const oValue = value as Record<channel.Key | channel.Name, control.Authority>;
|
|
141
144
|
return { keys: Object.keys(oValue), authorities: Object.values(oValue) };
|
|
142
145
|
});
|
|
143
146
|
|
|
@@ -213,15 +216,18 @@ export class Writer {
|
|
|
213
216
|
return writer;
|
|
214
217
|
}
|
|
215
218
|
|
|
216
|
-
async write(channel: channel.
|
|
217
|
-
async write(channel: channel.KeysOrNames, data: CrudeSeries[]): Promise<void>;
|
|
219
|
+
async write(channel: channel.Key | channel.Name, data: CrudeSeries): Promise<void>;
|
|
218
220
|
async write(
|
|
219
|
-
|
|
221
|
+
channel: channel.Key[] | channel.Name[],
|
|
222
|
+
data: CrudeSeries[],
|
|
223
|
+
): Promise<void>;
|
|
224
|
+
async write(
|
|
225
|
+
frame: CrudeFrame | Record<channel.Key | channel.Name, CrudeSeries>,
|
|
220
226
|
): Promise<void>;
|
|
221
227
|
async write(
|
|
222
228
|
channelsOrData:
|
|
223
229
|
| channel.Params
|
|
224
|
-
| Record<channel.
|
|
230
|
+
| Record<channel.Key | channel.Name, CrudeSeries>
|
|
225
231
|
| CrudeFrame,
|
|
226
232
|
series?: CrudeSeries | CrudeSeries[],
|
|
227
233
|
): Promise<void>;
|
|
@@ -243,7 +249,7 @@ export class Writer {
|
|
|
243
249
|
async write(
|
|
244
250
|
channelsOrData:
|
|
245
251
|
| channel.Params
|
|
246
|
-
| Record<channel.
|
|
252
|
+
| Record<channel.Key | channel.Name, CrudeSeries>
|
|
247
253
|
| CrudeFrame,
|
|
248
254
|
series?: CrudeSeries | CrudeSeries[],
|
|
249
255
|
): Promise<void> {
|
package/src/group/client.ts
CHANGED
|
@@ -11,7 +11,7 @@ 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 Group, groupZ, type Key, keyZ } from "@/group/
|
|
14
|
+
import { type Group, groupZ, type Key, keyZ } from "@/group/types.gen";
|
|
15
15
|
import { idZ as ontologyIDZ } from "@/ontology/payload";
|
|
16
16
|
|
|
17
17
|
export const SET_CHANNEL_NAME = "sy_group_set";
|
package/src/group/external.ts
CHANGED
package/src/group/group.spec.ts
CHANGED
|
@@ -7,26 +7,26 @@
|
|
|
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
|
+
// Code generated by Oracle. DO NOT EDIT.
|
|
11
|
+
|
|
10
12
|
import { z } from "zod";
|
|
11
13
|
|
|
12
14
|
import { ontology } from "@/ontology";
|
|
13
15
|
|
|
14
16
|
export const keyZ = z.uuid();
|
|
15
|
-
|
|
16
17
|
export type Key = z.infer<typeof keyZ>;
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Group is a named collection container for organizing related resources. Groups
|
|
21
|
+
* provide hierarchical organization through the ontology system.
|
|
22
|
+
*/
|
|
23
|
+
export const groupZ = z.object({
|
|
24
|
+
/** key is the unique identifier for this group. */
|
|
19
25
|
key: keyZ,
|
|
26
|
+
/** name is a human-readable name for the group. */
|
|
20
27
|
name: z.string(),
|
|
21
|
-
description: z.string().optional(),
|
|
22
|
-
internal: z.boolean().optional(),
|
|
23
28
|
});
|
|
29
|
+
export interface Group extends z.infer<typeof groupZ> {}
|
|
24
30
|
|
|
25
|
-
export
|
|
26
|
-
|
|
27
|
-
export const newZ = roleZ.partial({ key: true });
|
|
28
|
-
|
|
29
|
-
export type New = z.infer<typeof newZ>;
|
|
30
|
-
|
|
31
|
-
export const ontologyID = ontology.createIDFactory<Key>("role");
|
|
31
|
+
export const ontologyID = ontology.createIDFactory<Key>("group");
|
|
32
32
|
export const TYPE_ONTOLOGY_ID = ontologyID("");
|
package/src/label/client.ts
CHANGED
|
@@ -11,16 +11,13 @@ 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 Key, keyZ, type Label, labelZ } from "@/label/payload";
|
|
14
|
+
import { type Key, keyZ, type Label, labelZ, type New, newZ } from "@/label/payload";
|
|
15
15
|
import { ontology } from "@/ontology";
|
|
16
16
|
import { checkForMultipleOrNoResults } from "@/util/retrieve";
|
|
17
17
|
|
|
18
18
|
export const SET_CHANNEL_NAME = "sy_label_set";
|
|
19
19
|
export const DELETE_CHANNEL_NAME = "sy_label_delete";
|
|
20
20
|
|
|
21
|
-
export const newZ = labelZ.extend({ key: keyZ.optional() });
|
|
22
|
-
export interface New extends z.input<typeof newZ> {}
|
|
23
|
-
|
|
24
21
|
const createReqZ = z.object({ labels: newZ.array() });
|
|
25
22
|
const createResZ = z.object({ labels: labelZ.array() });
|
|
26
23
|
const deleteReqZ = z.object({ keys: keyZ.array() });
|
|
@@ -55,7 +52,7 @@ export type RetrieveArgs = z.input<typeof retrieveArgsZ>;
|
|
|
55
52
|
export type RetrieveSingleParams = z.input<typeof singleRetrieveArgsZ>;
|
|
56
53
|
export type RetrieveMultipleParams = z.input<typeof retrieveRequestZ>;
|
|
57
54
|
|
|
58
|
-
const retrieveResponseZ = z.object({ labels: array.
|
|
55
|
+
const retrieveResponseZ = z.object({ labels: array.nullishToEmpty(labelZ) });
|
|
59
56
|
|
|
60
57
|
export class Client {
|
|
61
58
|
readonly type: string = "label";
|
package/src/label/label.spec.ts
CHANGED
|
@@ -17,14 +17,20 @@ const client = createTestClient();
|
|
|
17
17
|
describe("Label", () => {
|
|
18
18
|
describe("create", () => {
|
|
19
19
|
it("should create a label", async () => {
|
|
20
|
-
const v = await client.labels.create({
|
|
20
|
+
const v = await client.labels.create({
|
|
21
|
+
name: "Label",
|
|
22
|
+
color: "#E774D0",
|
|
23
|
+
});
|
|
21
24
|
expect(v.key).not.toHaveLength(0);
|
|
22
25
|
});
|
|
23
26
|
});
|
|
24
27
|
|
|
25
28
|
describe("retrieve", () => {
|
|
26
29
|
it("should retrieve a label by its key", async () => {
|
|
27
|
-
const v = await client.labels.create({
|
|
30
|
+
const v = await client.labels.create({
|
|
31
|
+
name: "Label",
|
|
32
|
+
color: "#E774D0",
|
|
33
|
+
});
|
|
28
34
|
const retrieved = await client.labels.retrieve({ key: v.key });
|
|
29
35
|
expect(retrieved).toEqual(v);
|
|
30
36
|
});
|
|
@@ -32,7 +38,10 @@ describe("Label", () => {
|
|
|
32
38
|
|
|
33
39
|
describe("delete", () => {
|
|
34
40
|
it("should delete a label by its key", async () => {
|
|
35
|
-
const v = await client.labels.create({
|
|
41
|
+
const v = await client.labels.create({
|
|
42
|
+
name: "Label",
|
|
43
|
+
color: "#E774D0",
|
|
44
|
+
});
|
|
36
45
|
await client.labels.delete(v.key);
|
|
37
46
|
await expect(
|
|
38
47
|
async () => await client.labels.retrieve({ key: v.key }),
|
package/src/label/payload.ts
CHANGED
|
@@ -14,6 +14,8 @@ export type Params = label.Key | label.Key[];
|
|
|
14
14
|
export const keyZ = label.keyZ;
|
|
15
15
|
export type Key = label.Key;
|
|
16
16
|
export const labelZ = label.labelZ;
|
|
17
|
-
export
|
|
17
|
+
export interface Label extends label.Label {}
|
|
18
|
+
export const newZ = label.newZ;
|
|
19
|
+
export interface New extends label.New {}
|
|
18
20
|
|
|
19
21
|
export const LABELED_BY_ONTOLOGY_RELATIONSHIP_TYPE = "labeled_by";
|
package/src/lineplot/client.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
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, caseconv, record } from "@synnaxlabs/x";
|
|
12
12
|
import { z } from "zod";
|
|
13
13
|
|
|
14
14
|
import {
|
|
@@ -18,15 +18,16 @@ import {
|
|
|
18
18
|
linePlotZ,
|
|
19
19
|
type New,
|
|
20
20
|
newZ,
|
|
21
|
-
|
|
22
|
-
} from "@/lineplot/payload";
|
|
23
|
-
import { ontology } from "@/ontology";
|
|
21
|
+
} from "@/lineplot/types.gen";
|
|
24
22
|
import { checkForMultipleOrNoResults } from "@/util/retrieve";
|
|
25
23
|
import { workspace } from "@/workspace";
|
|
26
24
|
|
|
27
25
|
const renameReqZ = z.object({ key: keyZ, name: z.string() });
|
|
28
26
|
|
|
29
|
-
const setDataReqZ = z.object({
|
|
27
|
+
const setDataReqZ = z.object({
|
|
28
|
+
key: keyZ,
|
|
29
|
+
data: caseconv.preserveCase(record.unknownZ()),
|
|
30
|
+
});
|
|
30
31
|
const deleteReqZ = z.object({ keys: keyZ.array() });
|
|
31
32
|
|
|
32
33
|
const retrieveReqZ = z.object({ keys: keyZ.array() });
|
|
@@ -39,7 +40,7 @@ export type RetrieveArgs = z.input<typeof retrieveArgsZ>;
|
|
|
39
40
|
export type RetrieveSingleParams = z.input<typeof singleRetrieveArgsZ>;
|
|
40
41
|
export type RetrieveMultipleParams = z.input<typeof retrieveReqZ>;
|
|
41
42
|
|
|
42
|
-
const retrieveResZ = z.object({ linePlots: array.
|
|
43
|
+
const retrieveResZ = z.object({ linePlots: array.nullishToEmpty(linePlotZ) });
|
|
43
44
|
|
|
44
45
|
const createReqZ = z.object({ workspace: workspace.keyZ, linePlots: newZ.array() });
|
|
45
46
|
const createResZ = z.object({ linePlots: linePlotZ.array() });
|
|
@@ -84,7 +85,7 @@ export class Client {
|
|
|
84
85
|
await sendRequired(
|
|
85
86
|
this.client,
|
|
86
87
|
"/lineplot/set-data",
|
|
87
|
-
{ key, data
|
|
88
|
+
{ key, data },
|
|
88
89
|
setDataReqZ,
|
|
89
90
|
emptyResZ,
|
|
90
91
|
);
|
|
@@ -107,7 +108,7 @@ export class Client {
|
|
|
107
108
|
return isSingle ? res.linePlots[0] : res.linePlots;
|
|
108
109
|
}
|
|
109
110
|
|
|
110
|
-
async delete(keys:
|
|
111
|
+
async delete(keys: Key | Key[]): Promise<void> {
|
|
111
112
|
await sendRequired(
|
|
112
113
|
this.client,
|
|
113
114
|
"/lineplot/delete",
|
|
@@ -117,6 +118,3 @@ export class Client {
|
|
|
117
118
|
);
|
|
118
119
|
}
|
|
119
120
|
}
|
|
120
|
-
|
|
121
|
-
export const ontologyID = ontology.createIDFactory<Key>("lineplot");
|
|
122
|
-
export const TYPE_ONTOLOGY_ID = ontologyID("");
|
package/src/lineplot/external.ts
CHANGED
|
@@ -77,4 +77,44 @@ describe("LinePlot", () => {
|
|
|
77
77
|
);
|
|
78
78
|
});
|
|
79
79
|
});
|
|
80
|
+
describe("case preservation", () => {
|
|
81
|
+
test("should preserve key casing in data field on create/retrieve cycle", async () => {
|
|
82
|
+
const ws = await client.workspaces.create({ name: "CaseTest", layout: {} });
|
|
83
|
+
const linePlot = await client.lineplots.create(ws.key, {
|
|
84
|
+
name: "CaseTest",
|
|
85
|
+
data: {
|
|
86
|
+
camelCaseKey: "value1",
|
|
87
|
+
PascalCaseKey: "value2",
|
|
88
|
+
snake_case_key: "value3",
|
|
89
|
+
nested: {
|
|
90
|
+
innerCamelCase: 123,
|
|
91
|
+
InnerPascalCase: { deepKey: true },
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
const retrieved = await client.lineplots.retrieve({
|
|
97
|
+
key: linePlot.key,
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
const data = retrieved.data as Record<string, unknown>;
|
|
101
|
+
expect(data.camelCaseKey).toEqual("value1");
|
|
102
|
+
expect(data.PascalCaseKey).toEqual("value2");
|
|
103
|
+
expect(data.snake_case_key).toEqual("value3");
|
|
104
|
+
expect((data.nested as Record<string, unknown>).innerCamelCase).toEqual(123);
|
|
105
|
+
expect(
|
|
106
|
+
(
|
|
107
|
+
(data.nested as Record<string, unknown>).InnerPascalCase as Record<
|
|
108
|
+
string,
|
|
109
|
+
unknown
|
|
110
|
+
>
|
|
111
|
+
).deepKey,
|
|
112
|
+
).toEqual(true);
|
|
113
|
+
expect(Object.keys(data)).toContain("camelCaseKey");
|
|
114
|
+
expect(Object.keys(data)).toContain("PascalCaseKey");
|
|
115
|
+
expect(Object.keys(data)).toContain("snake_case_key");
|
|
116
|
+
expect(Object.keys(data)).not.toContain("camel_case_key");
|
|
117
|
+
expect(Object.keys(data)).not.toContain("pascal_case_key");
|
|
118
|
+
});
|
|
119
|
+
});
|
|
80
120
|
});
|
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
// Code generated by Oracle. DO NOT EDIT.
|
|
11
|
+
|
|
12
|
+
import { caseconv, record } from "@synnaxlabs/x";
|
|
13
|
+
import { z } from "zod";
|
|
14
|
+
|
|
15
|
+
import { ontology } from "@/ontology";
|
|
16
|
+
|
|
17
|
+
export const keyZ = z.uuid();
|
|
18
|
+
export type Key = z.infer<typeof keyZ>;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* LinePlot is a time-series visualization component for plotting telemetry data.
|
|
22
|
+
* Line plots support multiple channels, real-time streaming, and historical
|
|
23
|
+
* data display with zoom and pan capabilities.
|
|
24
|
+
*/
|
|
25
|
+
export const linePlotZ = z.object({
|
|
26
|
+
/** key is the unique identifier for this line plot. */
|
|
27
|
+
key: keyZ,
|
|
28
|
+
/** name is a human-readable name for the line plot. */
|
|
29
|
+
name: z.string(),
|
|
30
|
+
/**
|
|
31
|
+
* data is the line plot configuration including channel references, axis
|
|
32
|
+
* settings, and display options.
|
|
33
|
+
*/
|
|
34
|
+
data: caseconv.preserveCase(record.nullishToEmpty()),
|
|
35
|
+
});
|
|
36
|
+
export interface LinePlot extends z.infer<typeof linePlotZ> {}
|
|
37
|
+
|
|
38
|
+
export const newZ = linePlotZ.partial({ key: true });
|
|
39
|
+
export interface New extends z.input<typeof newZ> {}
|
|
40
|
+
|
|
41
|
+
export const ontologyID = ontology.createIDFactory<Key>("lineplot");
|
|
42
|
+
export const TYPE_ONTOLOGY_ID = ontologyID("");
|
package/src/log/client.ts
CHANGED
|
@@ -8,25 +8,19 @@
|
|
|
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, caseconv, record } from "@synnaxlabs/x";
|
|
12
12
|
import { z } from "zod";
|
|
13
13
|
|
|
14
|
-
import {
|
|
15
|
-
type Key,
|
|
16
|
-
keyZ,
|
|
17
|
-
type Log,
|
|
18
|
-
logZ,
|
|
19
|
-
type New,
|
|
20
|
-
newZ,
|
|
21
|
-
type Params,
|
|
22
|
-
} from "@/log/payload";
|
|
23
|
-
import { ontology } from "@/ontology";
|
|
14
|
+
import { type Key, keyZ, type Log, logZ, type New, newZ } from "@/log/types.gen";
|
|
24
15
|
import { checkForMultipleOrNoResults } from "@/util/retrieve";
|
|
25
16
|
import { workspace } from "@/workspace";
|
|
26
17
|
|
|
27
18
|
const renameReqZ = z.object({ key: keyZ, name: z.string() });
|
|
28
19
|
|
|
29
|
-
const setDataReqZ = z.object({
|
|
20
|
+
const setDataReqZ = z.object({
|
|
21
|
+
key: keyZ,
|
|
22
|
+
data: caseconv.preserveCase(record.unknownZ()),
|
|
23
|
+
});
|
|
30
24
|
const deleteReqZ = z.object({ keys: keyZ.array() });
|
|
31
25
|
|
|
32
26
|
const retrieveReqZ = z.object({ keys: keyZ.array() });
|
|
@@ -39,7 +33,7 @@ export type RetrieveArgs = z.input<typeof retrieveArgsZ>;
|
|
|
39
33
|
export type RetrieveSingleParams = z.input<typeof singleRetrieveArgsZ>;
|
|
40
34
|
export type RetrieveMultipleParams = z.input<typeof retrieveReqZ>;
|
|
41
35
|
|
|
42
|
-
const retrieveResZ = z.object({ logs: array.
|
|
36
|
+
const retrieveResZ = z.object({ logs: array.nullishToEmpty(logZ) });
|
|
43
37
|
|
|
44
38
|
const createReqZ = z.object({ workspace: workspace.keyZ, logs: newZ.array() });
|
|
45
39
|
const createResZ = z.object({ logs: logZ.array() });
|
|
@@ -81,7 +75,7 @@ export class Client {
|
|
|
81
75
|
await sendRequired(
|
|
82
76
|
this.client,
|
|
83
77
|
"/log/set-data",
|
|
84
|
-
{ key, data
|
|
78
|
+
{ key, data },
|
|
85
79
|
setDataReqZ,
|
|
86
80
|
emptyResZ,
|
|
87
81
|
);
|
|
@@ -104,7 +98,7 @@ export class Client {
|
|
|
104
98
|
return isSingle ? res.logs[0] : res.logs;
|
|
105
99
|
}
|
|
106
100
|
|
|
107
|
-
async delete(keys:
|
|
101
|
+
async delete(keys: Key | Key[]): Promise<void> {
|
|
108
102
|
await sendRequired(
|
|
109
103
|
this.client,
|
|
110
104
|
"/log/delete",
|
|
@@ -114,6 +108,3 @@ export class Client {
|
|
|
114
108
|
);
|
|
115
109
|
}
|
|
116
110
|
}
|
|
117
|
-
|
|
118
|
-
export const ontologyID = ontology.createIDFactory<Key>("log");
|
|
119
|
-
export const TYPE_ONTOLOGY_ID = ontologyID("");
|
package/src/log/external.ts
CHANGED
package/src/log/log.spec.ts
CHANGED
|
@@ -65,4 +65,42 @@ describe("Log", () => {
|
|
|
65
65
|
);
|
|
66
66
|
});
|
|
67
67
|
});
|
|
68
|
+
describe("case preservation", () => {
|
|
69
|
+
test("should preserve key casing in data field on create/retrieve cycle", async () => {
|
|
70
|
+
const ws = await client.workspaces.create({ name: "CaseTest", layout: {} });
|
|
71
|
+
const log = await client.logs.create(ws.key, {
|
|
72
|
+
name: "CaseTest",
|
|
73
|
+
data: {
|
|
74
|
+
camelCaseKey: "value1",
|
|
75
|
+
PascalCaseKey: "value2",
|
|
76
|
+
snake_case_key: "value3",
|
|
77
|
+
nested: {
|
|
78
|
+
innerCamelCase: 123,
|
|
79
|
+
InnerPascalCase: { deepKey: true },
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
const retrieved = await client.logs.retrieve({ key: log.key });
|
|
85
|
+
|
|
86
|
+
const data = retrieved.data as Record<string, unknown>;
|
|
87
|
+
expect(data.camelCaseKey).toEqual("value1");
|
|
88
|
+
expect(data.PascalCaseKey).toEqual("value2");
|
|
89
|
+
expect(data.snake_case_key).toEqual("value3");
|
|
90
|
+
expect((data.nested as Record<string, unknown>).innerCamelCase).toEqual(123);
|
|
91
|
+
expect(
|
|
92
|
+
(
|
|
93
|
+
(data.nested as Record<string, unknown>).InnerPascalCase as Record<
|
|
94
|
+
string,
|
|
95
|
+
unknown
|
|
96
|
+
>
|
|
97
|
+
).deepKey,
|
|
98
|
+
).toEqual(true);
|
|
99
|
+
expect(Object.keys(data)).toContain("camelCaseKey");
|
|
100
|
+
expect(Object.keys(data)).toContain("PascalCaseKey");
|
|
101
|
+
expect(Object.keys(data)).toContain("snake_case_key");
|
|
102
|
+
expect(Object.keys(data)).not.toContain("camel_case_key");
|
|
103
|
+
expect(Object.keys(data)).not.toContain("pascal_case_key");
|
|
104
|
+
});
|
|
105
|
+
});
|
|
68
106
|
});
|