@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
|
@@ -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
|
+
* Log is a timestamped event and message logging component. Logs display
|
|
22
|
+
* chronological records of events, system messages, and audit trails with
|
|
23
|
+
* filtering and formatting capabilities.
|
|
24
|
+
*/
|
|
25
|
+
export const logZ = z.object({
|
|
26
|
+
/** key is the unique identifier for this log. */
|
|
27
|
+
key: keyZ,
|
|
28
|
+
/** name is a human-readable name for the log. */
|
|
29
|
+
name: z.string(),
|
|
30
|
+
/**
|
|
31
|
+
* data is the log configuration including message formatting, filtering
|
|
32
|
+
* rules, and display options.
|
|
33
|
+
*/
|
|
34
|
+
data: caseconv.preserveCase(record.nullishToEmpty()),
|
|
35
|
+
});
|
|
36
|
+
export interface Log extends z.infer<typeof logZ> {}
|
|
37
|
+
|
|
38
|
+
export const newZ = logZ.partial({ key: true });
|
|
39
|
+
export interface New extends z.input<typeof newZ> {}
|
|
40
|
+
|
|
41
|
+
export const ontologyID = ontology.createIDFactory<Key>("log");
|
|
42
|
+
export const TYPE_ONTOLOGY_ID = ontologyID("");
|
package/src/ontology/payload.ts
CHANGED
|
@@ -10,6 +10,10 @@
|
|
|
10
10
|
import { array, type change, primitive, record } from "@synnaxlabs/x";
|
|
11
11
|
import { z } from "zod";
|
|
12
12
|
|
|
13
|
+
import { RESOURCE_TYPES, type ResourceType, resourceTypeZ } from "@/ontology/types.gen";
|
|
14
|
+
|
|
15
|
+
export { RESOURCE_TYPES, type ResourceType, resourceTypeZ };
|
|
16
|
+
|
|
13
17
|
export type ResourceChange = change.Change<ID, Resource>;
|
|
14
18
|
export interface ResourceSet extends change.Set<ID, Resource> {}
|
|
15
19
|
export interface ResourceDelete extends change.Delete<ID, Resource> {}
|
|
@@ -19,34 +23,6 @@ export interface RelationshipDelete extends change.Delete<Relationship, undefine
|
|
|
19
23
|
|
|
20
24
|
export interface RelationshipDelete extends change.Delete<Relationship, undefined> {}
|
|
21
25
|
|
|
22
|
-
export const resourceTypeZ = z.enum([
|
|
23
|
-
"label",
|
|
24
|
-
"log",
|
|
25
|
-
"builtin",
|
|
26
|
-
"cluster",
|
|
27
|
-
"channel",
|
|
28
|
-
"node",
|
|
29
|
-
"group",
|
|
30
|
-
"range",
|
|
31
|
-
"framer",
|
|
32
|
-
"range-alias",
|
|
33
|
-
"user",
|
|
34
|
-
"workspace",
|
|
35
|
-
"schematic",
|
|
36
|
-
"lineplot",
|
|
37
|
-
"rack",
|
|
38
|
-
"device",
|
|
39
|
-
"task",
|
|
40
|
-
"policy",
|
|
41
|
-
"role",
|
|
42
|
-
"table",
|
|
43
|
-
"arc",
|
|
44
|
-
"schematic_symbol",
|
|
45
|
-
"status",
|
|
46
|
-
"view",
|
|
47
|
-
]);
|
|
48
|
-
export type ResourceType = z.infer<typeof resourceTypeZ>;
|
|
49
|
-
|
|
50
26
|
const stringIDZ = z.string().transform((v) => {
|
|
51
27
|
const [type, key] = v.split(":");
|
|
52
28
|
return { type: resourceTypeZ.parse(type), key: key ?? "" };
|
|
@@ -101,7 +77,7 @@ export const resourceZ = z
|
|
|
101
77
|
.object({
|
|
102
78
|
id: idZ,
|
|
103
79
|
name: z.string(),
|
|
104
|
-
data: record.unknownZ.optional().nullable(),
|
|
80
|
+
data: record.unknownZ().optional().nullable(),
|
|
105
81
|
})
|
|
106
82
|
.transform((resource) => ({ key: idToString(resource.id), ...resource }));
|
|
107
83
|
export interface Resource<T extends record.Unknown = record.Unknown> extends Omit<
|
|
@@ -0,0 +1,41 @@
|
|
|
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 const RESOURCE_TYPES = [
|
|
15
|
+
"arc",
|
|
16
|
+
"builtin",
|
|
17
|
+
"channel",
|
|
18
|
+
"cluster",
|
|
19
|
+
"device",
|
|
20
|
+
"framer",
|
|
21
|
+
"group",
|
|
22
|
+
"label",
|
|
23
|
+
"lineplot",
|
|
24
|
+
"log",
|
|
25
|
+
"node",
|
|
26
|
+
"policy",
|
|
27
|
+
"rack",
|
|
28
|
+
"range",
|
|
29
|
+
"range-alias",
|
|
30
|
+
"role",
|
|
31
|
+
"schematic",
|
|
32
|
+
"schematic_symbol",
|
|
33
|
+
"status",
|
|
34
|
+
"table",
|
|
35
|
+
"task",
|
|
36
|
+
"user",
|
|
37
|
+
"view",
|
|
38
|
+
"workspace",
|
|
39
|
+
] as const;
|
|
40
|
+
export const resourceTypeZ = z.enum(RESOURCE_TYPES);
|
|
41
|
+
export type ResourceType = z.infer<typeof resourceTypeZ>;
|
package/src/rack/client.ts
CHANGED
|
@@ -17,10 +17,11 @@ import {
|
|
|
17
17
|
keyZ,
|
|
18
18
|
type New,
|
|
19
19
|
newZ,
|
|
20
|
+
ontologyID,
|
|
20
21
|
type Payload,
|
|
21
|
-
|
|
22
|
+
payloadZ,
|
|
22
23
|
type Status,
|
|
23
|
-
} from "@/rack/
|
|
24
|
+
} from "@/rack/types.gen";
|
|
24
25
|
import { type task } from "@/task";
|
|
25
26
|
import { checkForMultipleOrNoResults } from "@/util/retrieve";
|
|
26
27
|
|
|
@@ -30,6 +31,7 @@ export const DELETE_CHANNEL_NAME = "sy_rack_delete";
|
|
|
30
31
|
const retrieveReqZ = z.object({
|
|
31
32
|
keys: keyZ.array().optional(),
|
|
32
33
|
names: z.string().array().optional(),
|
|
34
|
+
integration: z.string().optional(),
|
|
33
35
|
searchTerm: z.string().optional(),
|
|
34
36
|
embedded: z.boolean().optional(),
|
|
35
37
|
hostIsNode: z.boolean().optional(),
|
|
@@ -37,7 +39,8 @@ const retrieveReqZ = z.object({
|
|
|
37
39
|
offset: z.int().optional(),
|
|
38
40
|
includeStatus: z.boolean().optional(),
|
|
39
41
|
});
|
|
40
|
-
const retrieveResZ = z.object({ racks: array.
|
|
42
|
+
const retrieveResZ = z.object({ racks: array.nullishToEmpty(payloadZ) });
|
|
43
|
+
export const rackZ = payloadZ;
|
|
41
44
|
|
|
42
45
|
const singleRetrieveArgsZ = z.union([
|
|
43
46
|
z
|
|
@@ -64,7 +67,7 @@ const retrieveArgsZ = z.union([singleRetrieveArgsZ, multiRetrieveArgsZ]);
|
|
|
64
67
|
export type RetrieveArgs = z.input<typeof retrieveArgsZ>;
|
|
65
68
|
|
|
66
69
|
const createReqZ = z.object({ racks: newZ.array() });
|
|
67
|
-
const createResZ = z.object({ racks:
|
|
70
|
+
const createResZ = z.object({ racks: payloadZ.array() });
|
|
68
71
|
|
|
69
72
|
const deleteReqZ = z.object({ keys: keyZ.array() });
|
|
70
73
|
const deleteResZ = z.object({});
|
|
@@ -125,7 +128,10 @@ export class Client {
|
|
|
125
128
|
const isSingle = !Array.isArray(payloads);
|
|
126
129
|
const sugared = array
|
|
127
130
|
.toArray(payloads)
|
|
128
|
-
.map(
|
|
131
|
+
.map(
|
|
132
|
+
({ key, name, status, integrations }) =>
|
|
133
|
+
new Rack(key, name, this.tasks, status, integrations),
|
|
134
|
+
);
|
|
129
135
|
return isSingle ? sugared[0] : sugared;
|
|
130
136
|
}
|
|
131
137
|
}
|
|
@@ -134,13 +140,21 @@ export class Rack {
|
|
|
134
140
|
key: Key;
|
|
135
141
|
name: string;
|
|
136
142
|
status?: Status;
|
|
143
|
+
integrations?: string[];
|
|
137
144
|
private readonly tasks: task.Client;
|
|
138
145
|
|
|
139
|
-
constructor(
|
|
146
|
+
constructor(
|
|
147
|
+
key: Key,
|
|
148
|
+
name: string,
|
|
149
|
+
taskClient: task.Client,
|
|
150
|
+
status?: Status,
|
|
151
|
+
integrations?: string[],
|
|
152
|
+
) {
|
|
140
153
|
this.key = key;
|
|
141
154
|
this.name = name;
|
|
142
155
|
this.tasks = taskClient;
|
|
143
156
|
this.status = status;
|
|
157
|
+
this.integrations = integrations;
|
|
144
158
|
}
|
|
145
159
|
|
|
146
160
|
async listTasks(): Promise<task.Task[]> {
|
|
@@ -169,11 +183,13 @@ export class Rack {
|
|
|
169
183
|
}
|
|
170
184
|
|
|
171
185
|
get payload(): Payload {
|
|
172
|
-
return {
|
|
186
|
+
return {
|
|
187
|
+
key: this.key,
|
|
188
|
+
name: this.name,
|
|
189
|
+
status: this.status,
|
|
190
|
+
integrations: this.integrations,
|
|
191
|
+
};
|
|
173
192
|
}
|
|
174
193
|
}
|
|
175
194
|
|
|
176
|
-
export const ontologyID = ontology.createIDFactory<Key>("rack");
|
|
177
|
-
export const TYPE_ONTOLOGY_ID = ontologyID(0);
|
|
178
|
-
|
|
179
195
|
export const statusKey = (key: Key): string => ontology.idToString(ontologyID(key));
|
package/src/rack/external.ts
CHANGED
package/src/rack/rack.spec.ts
CHANGED
|
@@ -79,6 +79,43 @@ describe("Rack", () => {
|
|
|
79
79
|
expect(retrieved.name).toEqual(name);
|
|
80
80
|
});
|
|
81
81
|
});
|
|
82
|
+
describe("integrations", () => {
|
|
83
|
+
it("should create a rack with integrations and retrieve them", async () => {
|
|
84
|
+
const r = await client.racks.create({
|
|
85
|
+
name: "rack-with-integrations",
|
|
86
|
+
integrations: ["ni", "opc", "modbus"],
|
|
87
|
+
});
|
|
88
|
+
const retrieved = await client.racks.retrieve({ key: r.key });
|
|
89
|
+
expect(retrieved.integrations).toEqual(["ni", "opc", "modbus"]);
|
|
90
|
+
});
|
|
91
|
+
it("should filter racks by integration", async () => {
|
|
92
|
+
const r1 = await client.racks.create({
|
|
93
|
+
name: "rack-ni-opc",
|
|
94
|
+
integrations: ["ni", "opc"],
|
|
95
|
+
});
|
|
96
|
+
const r2 = await client.racks.create({
|
|
97
|
+
name: "rack-modbus-only",
|
|
98
|
+
integrations: ["modbus"],
|
|
99
|
+
});
|
|
100
|
+
const results = await client.racks.retrieve({ integration: "ni" });
|
|
101
|
+
const keys = results.map((r) => r.key);
|
|
102
|
+
expect(keys).toContain(r1.key);
|
|
103
|
+
expect(keys).not.toContain(r2.key);
|
|
104
|
+
});
|
|
105
|
+
it("should update integrations on upsert", async () => {
|
|
106
|
+
const r = await client.racks.create({
|
|
107
|
+
name: "rack-update-integrations",
|
|
108
|
+
integrations: ["ni"],
|
|
109
|
+
});
|
|
110
|
+
await client.racks.create({
|
|
111
|
+
key: r.key,
|
|
112
|
+
name: "rack-update-integrations",
|
|
113
|
+
integrations: ["ni", "opc", "arc"],
|
|
114
|
+
});
|
|
115
|
+
const retrieved = await client.racks.retrieve({ key: r.key });
|
|
116
|
+
expect(retrieved.integrations).toEqual(["ni", "opc", "arc"]);
|
|
117
|
+
});
|
|
118
|
+
});
|
|
82
119
|
describe("tasks", () => {
|
|
83
120
|
it("should list the tasks on a rack", async () => {
|
|
84
121
|
const r = await client.racks.create({ name: "test" });
|
|
@@ -0,0 +1,62 @@
|
|
|
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 { status, zod } from "@synnaxlabs/x";
|
|
13
|
+
import { z } from "zod";
|
|
14
|
+
|
|
15
|
+
import { ontology } from "@/ontology";
|
|
16
|
+
|
|
17
|
+
export const keyZ = z.uint32();
|
|
18
|
+
export type Key = z.infer<typeof keyZ>;
|
|
19
|
+
|
|
20
|
+
/** StatusDetails contains rack-specific status details. */
|
|
21
|
+
export const statusDetailsZ = z.object({
|
|
22
|
+
/** rack is the key of the rack this status pertains to. */
|
|
23
|
+
rack: keyZ,
|
|
24
|
+
});
|
|
25
|
+
export interface StatusDetails extends z.infer<typeof statusDetailsZ> {}
|
|
26
|
+
|
|
27
|
+
export const statusZ = status.statusZ({ details: statusDetailsZ });
|
|
28
|
+
export type Status = z.infer<typeof statusZ>;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Payload is a collection container for hardware devices and tasks running on a
|
|
32
|
+
* specific cluster node. Racks serve as the integration point between the
|
|
33
|
+
* Synnax server and physical hardware via the Driver system.
|
|
34
|
+
*/
|
|
35
|
+
export const payloadZ = z.object({
|
|
36
|
+
/** key is the composite identifier for this rack. */
|
|
37
|
+
key: keyZ,
|
|
38
|
+
/** name is a human-readable name for the rack. */
|
|
39
|
+
name: z.string().min(1, "Name is required"),
|
|
40
|
+
/** taskCounter is an internal counter used for generating unique local task keys. */
|
|
41
|
+
taskCounter: z.uint32().optional(),
|
|
42
|
+
/** embedded is true if this rack is embedded within the Synnax server process. */
|
|
43
|
+
embedded: z.boolean().optional(),
|
|
44
|
+
/** status is the current operational status of the rack. */
|
|
45
|
+
status: statusZ.optional(),
|
|
46
|
+
/**
|
|
47
|
+
* integrations is the list of hardware integrations this rack supports (e.g., "ni", "opc",
|
|
48
|
+
* "labjack"). An empty or nil list means the rack supports no integrations.
|
|
49
|
+
*/
|
|
50
|
+
integrations: zod.nullToUndefined(z.string().array()),
|
|
51
|
+
});
|
|
52
|
+
export interface Payload extends z.infer<typeof payloadZ> {}
|
|
53
|
+
|
|
54
|
+
export const newZ = payloadZ
|
|
55
|
+
.omit({ taskCounter: true, embedded: true, key: true })
|
|
56
|
+
.extend({
|
|
57
|
+
key: z.uint32().default(0),
|
|
58
|
+
});
|
|
59
|
+
export interface New extends z.input<typeof newZ> {}
|
|
60
|
+
|
|
61
|
+
export const ontologyID = ontology.createIDFactory<Key>("rack");
|
|
62
|
+
export const TYPE_ONTOLOGY_ID = ontologyID(0);
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
import { channel } from "@/channel";
|
|
15
|
+
import { ranger } from "@/ranger";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Alias associates a human-readable string alias with a channel within the
|
|
19
|
+
* context of a specific range. Enables semantic naming of channels that varies by
|
|
20
|
+
* range context.
|
|
21
|
+
*/
|
|
22
|
+
export const aliasZ = z.object({
|
|
23
|
+
/** range is the unique identifier of the range containing this alias. */
|
|
24
|
+
range: ranger.keyZ,
|
|
25
|
+
/** channel is the unique identifier of the channel being aliased. */
|
|
26
|
+
channel: channel.keyZ,
|
|
27
|
+
/** alias is the human-readable name for the channel within this range context. */
|
|
28
|
+
alias: z.string(),
|
|
29
|
+
});
|
|
30
|
+
export interface Alias extends z.infer<typeof aliasZ> {}
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
import { ranger } from "@/ranger";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Pair is a key-value metadata pair associated with a specific range, enabling
|
|
18
|
+
* arbitrary metadata storage on time ranges.
|
|
19
|
+
*/
|
|
20
|
+
export const pairZ = z.object({
|
|
21
|
+
/** range is the unique identifier of the range owning this key-value pair. */
|
|
22
|
+
range: ranger.keyZ,
|
|
23
|
+
/** key is the metadata key name. */
|
|
24
|
+
key: z.string(),
|
|
25
|
+
/** value is the metadata value stored as a string for flexibility. */
|
|
26
|
+
value: z.string(),
|
|
27
|
+
});
|
|
28
|
+
export interface Pair extends z.infer<typeof pairZ> {}
|
|
@@ -12,7 +12,7 @@ import { array } from "@synnaxlabs/x";
|
|
|
12
12
|
import { z } from "zod";
|
|
13
13
|
|
|
14
14
|
import { channel } from "@/channel";
|
|
15
|
-
import { type Key, keyZ } from "@/ranger/
|
|
15
|
+
import { type Key, keyZ } from "@/ranger/types.gen";
|
|
16
16
|
|
|
17
17
|
const resolveReqZ = z.object({ range: keyZ, aliases: z.string().array() });
|
|
18
18
|
const resolveResZ = z.object({ aliases: z.record(z.string(), channel.keyZ) });
|
|
@@ -7,13 +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
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
aliasZ,
|
|
14
|
-
createKey,
|
|
15
|
-
type DecodedDeleteAliasChange,
|
|
16
|
-
decodeDeleteChange,
|
|
17
|
-
DELETE_CHANNEL_NAME,
|
|
18
|
-
SET_CHANNEL_NAME,
|
|
19
|
-
} from "@/ranger/alias/payload";
|
|
10
|
+
export * from "@/ranger/alias/client";
|
|
11
|
+
export * from "@/ranger/alias/payload";
|
|
12
|
+
export * from "@/ranger/alias/types.gen";
|
|
@@ -0,0 +1,52 @@
|
|
|
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 { describe, expect, it } from "vitest";
|
|
11
|
+
|
|
12
|
+
import { ranger } from "@/ranger";
|
|
13
|
+
|
|
14
|
+
describe("alias", () => {
|
|
15
|
+
describe("ontologyID", () => {
|
|
16
|
+
it("should create an ontology ID with the correct type and composite key", () => {
|
|
17
|
+
const id = ranger.alias.ontologyID("range-uuid-123", 42);
|
|
18
|
+
expect(id.type).toBe("range-alias");
|
|
19
|
+
expect(id.key).toBe("range-uuid-123---42");
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it("should match the key format produced by createKey", () => {
|
|
23
|
+
const rangeKey = "abc-def";
|
|
24
|
+
const channelKey = 7;
|
|
25
|
+
const id = ranger.alias.ontologyID(rangeKey, channelKey);
|
|
26
|
+
const key = ranger.alias.createKey({ range: rangeKey, channel: channelKey });
|
|
27
|
+
expect(id.key).toBe(key);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
describe("TYPE_ONTOLOGY_ID", () => {
|
|
32
|
+
it("should have the correct type and an empty key", () => {
|
|
33
|
+
expect(ranger.alias.TYPE_ONTOLOGY_ID.type).toBe("range-alias");
|
|
34
|
+
expect(ranger.alias.TYPE_ONTOLOGY_ID.key).toBe("");
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
describe("createKey", () => {
|
|
39
|
+
it("should create a composite key from range and channel", () => {
|
|
40
|
+
const key = ranger.alias.createKey({ range: "my-range", channel: 10 });
|
|
41
|
+
expect(key).toBe("my-range---10");
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
describe("decodeDeleteChange", () => {
|
|
46
|
+
it("should decode a composite key into range and channel", () => {
|
|
47
|
+
const decoded = ranger.alias.decodeDeleteChange("my-range---10");
|
|
48
|
+
expect(decoded.range).toBe("my-range");
|
|
49
|
+
expect(decoded.channel).toBe(10);
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
});
|
|
@@ -8,21 +8,15 @@
|
|
|
8
8
|
// included in the file licenses/APL.txt.
|
|
9
9
|
|
|
10
10
|
import { type change } from "@synnaxlabs/x";
|
|
11
|
-
import { z } from "zod";
|
|
12
11
|
|
|
13
|
-
import { channel } from "@/channel";
|
|
14
|
-
import { type
|
|
12
|
+
import { type channel } from "@/channel";
|
|
13
|
+
import { type ontology } from "@/ontology";
|
|
14
|
+
import { type Alias } from "@/ranger/alias/types.gen";
|
|
15
|
+
import { type Key } from "@/ranger/types.gen";
|
|
15
16
|
|
|
16
17
|
export const SET_CHANNEL_NAME = "sy_range_alias_set";
|
|
17
18
|
export const DELETE_CHANNEL_NAME = "sy_range_alias_delete";
|
|
18
19
|
|
|
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
20
|
export type AliasChange = change.Change<string, Alias>;
|
|
27
21
|
|
|
28
22
|
const SEPARATOR = "---";
|
|
@@ -30,6 +24,13 @@ const SEPARATOR = "---";
|
|
|
30
24
|
export const createKey = (alias: Pick<Alias, "range" | "channel">): string =>
|
|
31
25
|
`${alias.range}${SEPARATOR}${alias.channel}`;
|
|
32
26
|
|
|
27
|
+
export const ontologyID = (rangeKey: Key, channelKey: channel.Key): ontology.ID => ({
|
|
28
|
+
type: "range-alias",
|
|
29
|
+
key: createKey({ range: rangeKey, channel: channelKey }),
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export const TYPE_ONTOLOGY_ID: ontology.ID = { type: "range-alias", key: "" };
|
|
33
|
+
|
|
33
34
|
export interface DecodedDeleteAliasChange {
|
|
34
35
|
range: Key;
|
|
35
36
|
channel: channel.Key;
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
import { channel } from "@/channel";
|
|
15
|
+
import * as ranger from "@/ranger/types.gen";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Alias associates a human-readable string alias with a channel within the
|
|
19
|
+
* context of a specific range. Enables semantic naming of channels that varies by
|
|
20
|
+
* range context.
|
|
21
|
+
*/
|
|
22
|
+
export const aliasZ = z.object({
|
|
23
|
+
/** range is the unique identifier of the range containing this alias. */
|
|
24
|
+
range: ranger.keyZ,
|
|
25
|
+
/** channel is the unique identifier of the channel being aliased. */
|
|
26
|
+
channel: channel.keyZ,
|
|
27
|
+
/** alias is the human-readable name for the channel within this range context. */
|
|
28
|
+
alias: z.string(),
|
|
29
|
+
});
|
|
30
|
+
export interface Alias extends z.infer<typeof aliasZ> {}
|