@synnaxlabs/client 0.56.2 → 0.57.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/dist/client-B08VDLSA.js +14463 -0
- package/dist/client-B08VDLSA.js.map +1 -0
- package/dist/client.js +1128 -14876
- package/dist/client.js.map +1 -0
- package/dist/src/access/client.d.ts +10 -1
- package/dist/src/access/client.d.ts.map +1 -1
- package/dist/src/access/enforce.d.ts.map +1 -1
- package/dist/src/access/external.d.ts +1 -0
- package/dist/src/access/external.d.ts.map +1 -1
- package/dist/src/access/granted.d.ts +39 -0
- package/dist/src/access/granted.d.ts.map +1 -0
- package/dist/src/access/policy/client.d.ts +136 -147
- package/dist/src/access/policy/client.d.ts.map +1 -1
- package/dist/src/access/policy/types.gen.d.ts +15 -68
- package/dist/src/access/policy/types.gen.d.ts.map +1 -1
- package/dist/src/access/role/client.d.ts +77 -58
- package/dist/src/access/role/client.d.ts.map +1 -1
- package/dist/src/access/role/types.gen.d.ts +8 -14
- package/dist/src/access/role/types.gen.d.ts.map +1 -1
- package/dist/src/actions/actions.d.ts +5 -6
- package/dist/src/actions/actions.d.ts.map +1 -1
- package/dist/src/actions/controller.d.ts +194 -0
- package/dist/src/actions/controller.d.ts.map +1 -0
- package/dist/src/actions/external.d.ts +1 -0
- package/dist/src/actions/external.d.ts.map +1 -1
- package/dist/src/arc/actions.d.ts +575 -0
- package/dist/src/arc/actions.d.ts.map +1 -0
- package/dist/src/arc/actions.gen.d.ts +1439 -0
- package/dist/src/arc/actions.gen.d.ts.map +1 -0
- package/dist/src/arc/client.d.ts +97 -13
- package/dist/src/arc/client.d.ts.map +1 -1
- package/dist/src/arc/compiler/types.gen.d.ts +3 -3
- package/dist/src/arc/compiler/types.gen.d.ts.map +1 -1
- package/dist/src/arc/external.d.ts +2 -0
- package/dist/src/arc/external.d.ts.map +1 -1
- package/dist/src/arc/graph/types.gen.d.ts +45 -597
- package/dist/src/arc/graph/types.gen.d.ts.map +1 -1
- package/dist/src/arc/ir/index.d.ts +1 -1
- package/dist/src/arc/ir/index.d.ts.map +1 -1
- package/dist/src/arc/ir/ir.d.ts +2 -0
- package/dist/src/arc/ir/ir.d.ts.map +1 -0
- package/dist/src/arc/ir/types.gen.d.ts +58 -2807
- package/dist/src/arc/ir/types.gen.d.ts.map +1 -1
- package/dist/src/arc/module/types.gen.d.ts +18 -1090
- package/dist/src/arc/module/types.gen.d.ts.map +1 -1
- package/dist/src/arc/program/types.gen.d.ts +18 -1090
- package/dist/src/arc/program/types.gen.d.ts.map +1 -1
- package/dist/src/arc/text/types.gen.d.ts +54 -1
- package/dist/src/arc/text/types.gen.d.ts.map +1 -1
- package/dist/src/arc/types/types.gen.d.ts +35 -153
- package/dist/src/arc/types/types.gen.d.ts.map +1 -1
- package/dist/src/arc/types.gen.d.ts +98 -2278
- package/dist/src/arc/types.gen.d.ts.map +1 -1
- package/dist/src/auth/auth.d.ts +14 -2
- package/dist/src/auth/auth.d.ts.map +1 -1
- package/dist/src/channel/client.d.ts +113 -75
- package/dist/src/channel/client.d.ts.map +1 -1
- package/dist/src/channel/external.d.ts +0 -1
- package/dist/src/channel/external.d.ts.map +1 -1
- package/dist/src/channel/payload.d.ts +65 -56
- package/dist/src/channel/payload.d.ts.map +1 -1
- package/dist/src/channel/types.gen.d.ts +26 -73
- package/dist/src/channel/types.gen.d.ts.map +1 -1
- package/dist/src/channel/writer.d.ts +1 -3
- package/dist/src/channel/writer.d.ts.map +1 -1
- package/dist/src/client.d.ts +55 -27
- package/dist/src/client.d.ts.map +1 -1
- package/dist/src/connection/client.d.ts +146 -0
- package/dist/src/connection/client.d.ts.map +1 -0
- package/dist/src/connection/external.d.ts +3 -0
- package/dist/src/connection/external.d.ts.map +1 -0
- package/dist/src/connection/index.d.ts +1 -1
- package/dist/src/connection/index.d.ts.map +1 -1
- package/dist/src/connection/status.d.ts +252 -0
- package/dist/src/connection/status.d.ts.map +1 -0
- package/dist/src/control/client.d.ts +31 -7
- package/dist/src/control/client.d.ts.map +1 -1
- package/dist/src/control/state.d.ts +47 -16
- package/dist/src/control/state.d.ts.map +1 -1
- package/dist/src/device/client.d.ts +59 -17
- package/dist/src/device/client.d.ts.map +1 -1
- package/dist/src/device/types.gen.d.ts +17 -67
- package/dist/src/device/types.gen.d.ts.map +1 -1
- package/dist/src/errors.d.ts +17 -20
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/ethercat/external.d.ts +2 -0
- package/dist/src/ethercat/external.d.ts.map +1 -0
- package/dist/src/ethercat/index.d.ts +2 -0
- package/dist/src/ethercat/index.d.ts.map +1 -0
- package/dist/src/ethercat/types.gen.d.ts +243 -0
- package/dist/src/ethercat/types.gen.d.ts.map +1 -0
- package/dist/src/framer/adapter.d.ts +8 -5
- package/dist/src/framer/adapter.d.ts.map +1 -1
- package/dist/src/framer/benchutil.d.ts +19 -0
- package/dist/src/framer/benchutil.d.ts.map +1 -0
- package/dist/src/framer/cache/cache.d.ts +38 -0
- package/dist/src/framer/cache/cache.d.ts.map +1 -0
- package/dist/src/framer/cache/dynamic.d.ts +71 -0
- package/dist/src/framer/cache/dynamic.d.ts.map +1 -0
- package/dist/src/framer/cache/reader.d.ts +43 -0
- package/dist/src/framer/cache/reader.d.ts.map +1 -0
- package/dist/src/framer/cache/static.d.ts +66 -0
- package/dist/src/framer/cache/static.d.ts.map +1 -0
- package/dist/src/framer/cache/streamer.d.ts +86 -0
- package/dist/src/framer/cache/streamer.d.ts.map +1 -0
- package/dist/src/framer/cache/transform.d.ts +18 -0
- package/dist/src/framer/cache/transform.d.ts.map +1 -0
- package/dist/src/framer/cache/unary.d.ts +37 -0
- package/dist/src/framer/cache/unary.d.ts.map +1 -0
- package/dist/src/framer/client.d.ts +35 -14
- package/dist/src/framer/client.d.ts.map +1 -1
- package/dist/src/framer/codec.d.ts.map +1 -1
- package/dist/src/framer/deleter.d.ts +3 -2
- package/dist/src/framer/deleter.d.ts.map +1 -1
- package/dist/src/framer/external.d.ts +6 -0
- package/dist/src/framer/external.d.ts.map +1 -1
- package/dist/src/framer/feed.d.ts +40 -0
- package/dist/src/framer/feed.d.ts.map +1 -0
- package/dist/src/framer/frame.d.ts +16 -20
- package/dist/src/framer/frame.d.ts.map +1 -1
- package/dist/src/framer/hardened.d.ts +70 -0
- package/dist/src/framer/hardened.d.ts.map +1 -0
- package/dist/src/framer/iterator.d.ts +36 -43
- package/dist/src/framer/iterator.d.ts.map +1 -1
- package/dist/src/framer/reader.d.ts +3 -2
- package/dist/src/framer/reader.d.ts.map +1 -1
- package/dist/src/framer/streamer.d.ts +132 -205
- package/dist/src/framer/streamer.d.ts.map +1 -1
- package/dist/src/framer/writer.d.ts +130 -161
- package/dist/src/framer/writer.d.ts.map +1 -1
- package/dist/src/group/client.d.ts +66 -9
- package/dist/src/group/client.d.ts.map +1 -1
- package/dist/src/group/types.gen.d.ts +2 -2
- package/dist/src/http/external.d.ts +2 -0
- package/dist/src/http/external.d.ts.map +1 -0
- package/dist/src/http/index.d.ts +2 -0
- package/dist/src/http/index.d.ts.map +1 -0
- package/dist/src/http/types.gen.d.ts +451 -0
- package/dist/src/http/types.gen.d.ts.map +1 -0
- package/dist/src/imex/client.d.ts +88 -0
- package/dist/src/imex/client.d.ts.map +1 -0
- package/dist/src/imex/index.d.ts +2 -0
- package/dist/src/imex/index.d.ts.map +1 -0
- package/dist/src/index.d.ts +18 -5
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/label/client.d.ts +55 -36
- package/dist/src/label/client.d.ts.map +1 -1
- package/dist/src/label/external.d.ts +2 -0
- package/dist/src/label/external.d.ts.map +1 -1
- package/dist/src/label/payload.d.ts +4 -46
- package/dist/src/label/payload.d.ts.map +1 -1
- package/dist/src/label/store.d.ts +8 -0
- package/dist/src/label/store.d.ts.map +1 -0
- package/dist/src/label/types.gen.d.ts +45 -0
- package/dist/src/label/types.gen.d.ts.map +1 -0
- package/dist/src/labjack/external.d.ts +2 -0
- package/dist/src/labjack/external.d.ts.map +1 -0
- package/dist/src/labjack/index.d.ts +2 -0
- package/dist/src/labjack/index.d.ts.map +1 -0
- package/dist/src/labjack/types.gen.d.ts +442 -0
- package/dist/src/labjack/types.gen.d.ts.map +1 -0
- package/dist/src/lineplot/actions.d.ts +914 -0
- package/dist/src/lineplot/actions.d.ts.map +1 -0
- package/dist/src/lineplot/actions.gen.d.ts +4208 -0
- package/dist/src/lineplot/actions.gen.d.ts.map +1 -0
- package/dist/src/lineplot/client.d.ts +66 -16
- package/dist/src/lineplot/client.d.ts.map +1 -1
- package/dist/src/lineplot/external.d.ts +3 -0
- package/dist/src/lineplot/external.d.ts.map +1 -1
- package/dist/src/lineplot/line.d.ts +16 -0
- package/dist/src/lineplot/line.d.ts.map +1 -0
- package/dist/src/lineplot/types.gen.d.ts +837 -14
- package/dist/src/lineplot/types.gen.d.ts.map +1 -1
- package/dist/src/log/actions.d.ts +271 -0
- package/dist/src/log/actions.d.ts.map +1 -0
- package/dist/src/log/actions.gen.d.ts +1529 -0
- package/dist/src/log/actions.gen.d.ts.map +1 -0
- package/dist/src/log/client.d.ts +66 -16
- package/dist/src/log/client.d.ts.map +1 -1
- package/dist/src/log/external.d.ts +2 -0
- package/dist/src/log/external.d.ts.map +1 -1
- package/dist/src/log/types.gen.d.ts +139 -14
- package/dist/src/log/types.gen.d.ts.map +1 -1
- package/dist/src/modbus/external.d.ts +2 -0
- package/dist/src/modbus/external.d.ts.map +1 -0
- package/dist/src/modbus/index.d.ts +2 -0
- package/dist/src/modbus/index.d.ts.map +1 -0
- package/dist/src/modbus/types.gen.d.ts +280 -0
- package/dist/src/modbus/types.gen.d.ts.map +1 -0
- package/dist/src/ni/external.d.ts +2 -0
- package/dist/src/ni/external.d.ts.map +1 -0
- package/dist/src/ni/index.d.ts +2 -0
- package/dist/src/ni/index.d.ts.map +1 -0
- package/dist/src/ni/types.gen.d.ts +21029 -0
- package/dist/src/ni/types.gen.d.ts.map +1 -0
- package/dist/src/node/index.d.ts +2 -0
- package/dist/src/node/index.d.ts.map +1 -0
- package/dist/src/node/types.gen.d.ts +4 -0
- package/dist/src/node/types.gen.d.ts.map +1 -0
- package/dist/src/ontology/client.d.ts +314 -67
- package/dist/src/ontology/client.d.ts.map +1 -1
- package/dist/src/ontology/external.d.ts +1 -0
- package/dist/src/ontology/external.d.ts.map +1 -1
- package/dist/src/ontology/payload.d.ts +60 -18
- package/dist/src/ontology/payload.d.ts.map +1 -1
- package/dist/src/ontology/store.d.ts +32 -0
- package/dist/src/ontology/store.d.ts.map +1 -0
- package/dist/src/ontology/types.gen.d.ts +3 -2
- package/dist/src/ontology/types.gen.d.ts.map +1 -1
- package/dist/src/ontology/writer.d.ts +16 -10
- package/dist/src/ontology/writer.d.ts.map +1 -1
- package/dist/src/opcua/external.d.ts +2 -0
- package/dist/src/opcua/external.d.ts.map +1 -0
- package/dist/src/opcua/index.d.ts +2 -0
- package/dist/src/opcua/index.d.ts.map +1 -0
- package/dist/src/opcua/types.gen.d.ts +82 -0
- package/dist/src/opcua/types.gen.d.ts.map +1 -0
- package/dist/src/pagerduty/external.d.ts +2 -0
- package/dist/src/pagerduty/external.d.ts.map +1 -0
- package/dist/src/pagerduty/index.d.ts +2 -0
- package/dist/src/pagerduty/index.d.ts.map +1 -0
- package/dist/src/pagerduty/types.gen.d.ts +30 -0
- package/dist/src/pagerduty/types.gen.d.ts.map +1 -0
- package/dist/src/panel/actions.d.ts +273 -0
- package/dist/src/panel/actions.d.ts.map +1 -0
- package/dist/src/panel/actions.gen.d.ts +1255 -0
- package/dist/src/panel/actions.gen.d.ts.map +1 -0
- package/dist/src/panel/client.d.ts +148 -0
- package/dist/src/panel/client.d.ts.map +1 -0
- package/dist/src/panel/external.d.ts +6 -0
- package/dist/src/panel/external.d.ts.map +1 -0
- package/dist/src/panel/index.d.ts +2 -0
- package/dist/src/panel/index.d.ts.map +1 -0
- package/dist/src/panel/tree.d.ts +50 -0
- package/dist/src/panel/tree.d.ts.map +1 -0
- package/dist/src/panel/types.gen.d.ts +370 -0
- package/dist/src/panel/types.gen.d.ts.map +1 -0
- package/dist/src/project/client.d.ts +89 -0
- package/dist/src/project/client.d.ts.map +1 -0
- package/dist/src/project/external.d.ts.map +1 -0
- package/dist/src/project/index.d.ts +2 -0
- package/dist/src/project/index.d.ts.map +1 -0
- package/dist/src/project/types.gen.d.ts +27 -0
- package/dist/src/project/types.gen.d.ts.map +1 -0
- package/dist/src/query/cache.d.ts +132 -0
- package/dist/src/query/cache.d.ts.map +1 -0
- package/dist/src/query/deleted.d.ts +20 -0
- package/dist/src/query/deleted.d.ts.map +1 -0
- package/dist/src/query/derived.d.ts +33 -0
- package/dist/src/query/derived.d.ts.map +1 -0
- package/dist/src/query/external.d.ts +10 -0
- package/dist/src/query/external.d.ts.map +1 -0
- package/dist/src/query/index.d.ts +2 -0
- package/dist/src/query/index.d.ts.map +1 -0
- package/dist/src/query/query.d.ts +235 -0
- package/dist/src/query/query.d.ts.map +1 -0
- package/dist/src/query/retriever.d.ts +135 -0
- package/dist/src/query/retriever.d.ts.map +1 -0
- package/dist/src/query/streamer.d.ts +67 -0
- package/dist/src/query/streamer.d.ts.map +1 -0
- package/dist/src/query/table.d.ts +219 -0
- package/dist/src/query/table.d.ts.map +1 -0
- package/dist/src/query/types.d.ts +35 -0
- package/dist/src/query/types.d.ts.map +1 -0
- package/dist/src/query/write.d.ts +21 -0
- package/dist/src/query/write.d.ts.map +1 -0
- package/dist/src/rack/client.d.ts +58 -20
- package/dist/src/rack/client.d.ts.map +1 -1
- package/dist/src/rack/types.gen.d.ts +11 -12
- package/dist/src/rack/types.gen.d.ts.map +1 -1
- package/dist/src/range/alias/types.gen.d.ts +2 -3
- package/dist/src/range/alias/types.gen.d.ts.map +1 -1
- package/dist/src/ranger/client.d.ts +138 -27
- package/dist/src/ranger/client.d.ts.map +1 -1
- package/dist/src/ranger/kv/client.d.ts +7 -4
- package/dist/src/ranger/kv/client.d.ts.map +1 -1
- package/dist/src/ranger/payload.d.ts +3 -0
- package/dist/src/ranger/payload.d.ts.map +1 -1
- package/dist/src/ranger/types.gen.d.ts +45 -101
- package/dist/src/ranger/types.gen.d.ts.map +1 -1
- package/dist/src/ranger/writer.d.ts +2 -74
- package/dist/src/ranger/writer.d.ts.map +1 -1
- package/dist/src/schematic/actions.d.ts +90 -33
- package/dist/src/schematic/actions.d.ts.map +1 -1
- package/dist/src/schematic/actions.gen.d.ts +207 -114
- package/dist/src/schematic/actions.gen.d.ts.map +1 -1
- package/dist/src/schematic/client.d.ts +70 -68
- package/dist/src/schematic/client.d.ts.map +1 -1
- package/dist/src/schematic/symbol/client.d.ts +133 -27
- package/dist/src/schematic/symbol/client.d.ts.map +1 -1
- package/dist/src/schematic/symbol/types.gen.d.ts +258 -153
- package/dist/src/schematic/symbol/types.gen.d.ts.map +1 -1
- package/dist/src/schematic/types.gen.d.ts +17 -96
- package/dist/src/schematic/types.gen.d.ts.map +1 -1
- package/dist/src/status/client.d.ts +69 -14
- package/dist/src/status/client.d.ts.map +1 -1
- package/dist/src/status/external.d.ts +2 -0
- package/dist/src/status/external.d.ts.map +1 -1
- package/dist/src/status/payload.d.ts +2 -36
- package/dist/src/status/payload.d.ts.map +1 -1
- package/dist/src/status/status.d.ts +65 -0
- package/dist/src/status/status.d.ts.map +1 -0
- package/dist/src/status/types.gen.d.ts +58 -0
- package/dist/src/status/types.gen.d.ts.map +1 -0
- package/dist/src/table/actions.d.ts +72 -13
- package/dist/src/table/actions.d.ts.map +1 -1
- package/dist/src/table/actions.gen.d.ts +221 -137
- package/dist/src/table/actions.gen.d.ts.map +1 -1
- package/dist/src/table/client.d.ts +64 -40
- package/dist/src/table/client.d.ts.map +1 -1
- package/dist/src/table/types.gen.d.ts +20 -55
- package/dist/src/table/types.gen.d.ts.map +1 -1
- package/dist/src/task/client.d.ts +149 -28
- package/dist/src/task/client.d.ts.map +1 -1
- package/dist/src/task/types.gen.d.ts +71 -89
- package/dist/src/task/types.gen.d.ts.map +1 -1
- package/dist/src/testutil/access.d.ts +27 -1
- package/dist/src/testutil/access.d.ts.map +1 -1
- package/dist/src/testutil/channels.d.ts +2 -0
- package/dist/src/testutil/channels.d.ts.map +1 -1
- package/dist/src/testutil/client.d.ts +5 -0
- package/dist/src/testutil/client.d.ts.map +1 -1
- package/dist/src/testutil/connection.d.ts +10 -0
- package/dist/src/testutil/connection.d.ts.map +1 -0
- package/dist/src/testutil/index.d.ts +9 -0
- package/dist/src/testutil/index.d.ts.map +1 -0
- package/dist/src/testutil/panels.d.ts +8 -0
- package/dist/src/testutil/panels.d.ts.map +1 -0
- package/dist/src/testutil/proxy.d.ts +29 -0
- package/dist/src/testutil/proxy.d.ts.map +1 -0
- package/dist/src/testutil/query.d.ts +7 -0
- package/dist/src/testutil/query.d.ts.map +1 -0
- package/dist/src/testutil/telem.d.ts +4 -0
- package/dist/src/testutil/telem.d.ts.map +1 -1
- package/dist/src/transport.d.ts +10 -4
- package/dist/src/transport.d.ts.map +1 -1
- package/dist/src/user/client.d.ts +29 -28
- 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 +4 -4
- package/dist/src/util/retrieve.d.ts +2 -2
- package/dist/src/util/retrieve.d.ts.map +1 -1
- package/dist/src/util/telem.d.ts.map +1 -1
- package/dist/src/view/client.d.ts +30 -14
- package/dist/src/view/client.d.ts.map +1 -1
- package/dist/src/view/types.gen.d.ts +7 -15
- package/dist/src/view/types.gen.d.ts.map +1 -1
- package/dist/testutil.js +189 -0
- package/dist/testutil.js.map +1 -0
- package/package.json +40 -17
- package/src/access/client.ts +14 -3
- package/src/access/enforce.ts +0 -3
- package/src/access/external.ts +1 -0
- package/src/access/granted.ts +114 -0
- package/src/access/policy/client.ts +135 -43
- package/src/access/policy/types.gen.ts +9 -11
- package/src/access/role/client.ts +160 -38
- package/src/access/role/types.gen.ts +8 -12
- package/src/actions/actions.ts +5 -6
- package/src/actions/controller.ts +626 -0
- package/src/actions/external.ts +11 -0
- package/src/arc/actions.gen.ts +313 -0
- package/src/arc/actions.ts +192 -0
- package/src/arc/client.ts +424 -41
- package/src/arc/compiler/types.gen.ts +5 -6
- package/src/arc/external.ts +2 -0
- package/src/arc/graph/types.gen.ts +24 -22
- package/src/arc/ir/index.ts +1 -1
- package/{eslint.config.ts → src/arc/ir/ir.ts} +1 -4
- package/src/arc/ir/types.gen.ts +42 -41
- package/src/arc/text/types.gen.ts +21 -2
- package/src/arc/types/types.gen.ts +40 -32
- package/src/arc/types.gen.ts +31 -29
- package/src/auth/auth.ts +40 -8
- package/src/channel/client.ts +529 -132
- package/src/channel/external.ts +0 -1
- package/src/channel/payload.ts +30 -3
- package/src/channel/types.gen.ts +37 -48
- package/src/channel/writer.ts +2 -11
- package/src/client.ts +215 -91
- package/src/connection/client.ts +495 -0
- package/src/connection/external.ts +34 -0
- package/src/connection/index.ts +1 -1
- package/src/connection/status.ts +442 -0
- package/src/control/client.ts +84 -12
- package/src/control/state.ts +17 -36
- package/src/device/client.ts +293 -41
- package/src/device/types.gen.ts +15 -26
- package/src/errors.ts +45 -22
- package/src/{workspace → ethercat}/external.ts +1 -2
- package/src/{workspace → ethercat}/index.ts +1 -1
- package/src/ethercat/types.gen.ts +151 -0
- package/src/framer/adapter.ts +60 -37
- package/src/framer/benchutil.ts +67 -0
- package/src/framer/cache/cache.ts +115 -0
- package/src/framer/cache/dynamic.ts +279 -0
- package/src/framer/cache/reader.ts +160 -0
- package/src/framer/cache/static.ts +215 -0
- package/src/framer/cache/streamer.ts +391 -0
- package/src/framer/cache/transform.ts +31 -0
- package/src/framer/cache/unary.ts +104 -0
- package/src/framer/client.ts +71 -43
- package/src/framer/codec.ts +55 -18
- package/src/framer/deleter.ts +4 -6
- package/src/framer/external.ts +10 -0
- package/src/framer/feed.ts +108 -0
- package/src/framer/frame.ts +13 -23
- package/src/framer/hardened.ts +283 -0
- package/src/framer/iterator.ts +31 -42
- package/src/framer/reader.ts +11 -11
- package/src/framer/streamer.ts +18 -178
- package/src/framer/writer.ts +39 -59
- package/src/group/client.ts +158 -23
- package/src/http/external.ts +10 -0
- package/src/{cluster → http}/index.ts +1 -1
- package/src/http/types.gen.ts +245 -0
- package/src/imex/client.ts +125 -0
- package/src/imex/index.ts +10 -0
- package/src/index.ts +18 -6
- package/src/label/client.ts +193 -54
- package/src/label/external.ts +2 -0
- package/src/label/payload.ts +4 -9
- package/src/label/store.ts +28 -0
- package/src/label/types.gen.ts +31 -0
- package/src/labjack/external.ts +10 -0
- package/src/labjack/index.ts +10 -0
- package/src/labjack/types.gen.ts +251 -0
- package/src/lineplot/actions.gen.ts +880 -0
- package/src/lineplot/actions.ts +535 -0
- package/src/lineplot/client.ts +224 -52
- package/src/lineplot/external.ts +3 -0
- package/src/lineplot/line.ts +80 -0
- package/src/lineplot/types.gen.ts +225 -12
- package/src/log/actions.gen.ts +474 -0
- package/src/log/actions.ts +242 -0
- package/src/log/client.ts +223 -52
- package/src/log/external.ts +2 -0
- package/src/log/types.gen.ts +45 -14
- package/src/modbus/external.ts +10 -0
- package/src/modbus/index.ts +10 -0
- package/src/modbus/types.gen.ts +185 -0
- package/src/ni/external.ts +10 -0
- package/src/ni/index.ts +10 -0
- package/src/ni/types.gen.ts +1632 -0
- package/src/node/index.ts +10 -0
- package/src/{cluster → node}/types.gen.ts +2 -2
- package/src/ontology/client.ts +408 -99
- package/src/ontology/external.ts +7 -0
- package/src/ontology/payload.ts +48 -7
- package/src/ontology/store.ts +83 -0
- package/src/ontology/types.gen.ts +2 -1
- package/src/ontology/writer.ts +1 -0
- package/src/opcua/external.ts +10 -0
- package/src/opcua/index.ts +10 -0
- package/src/opcua/types.gen.ts +65 -0
- package/src/pagerduty/external.ts +10 -0
- package/src/pagerduty/index.ts +10 -0
- package/src/pagerduty/types.gen.ts +41 -0
- package/src/panel/actions.gen.ts +267 -0
- package/src/panel/actions.ts +357 -0
- package/src/panel/client.ts +327 -0
- package/src/panel/external.ts +14 -0
- package/src/panel/index.ts +10 -0
- package/src/panel/tree.ts +163 -0
- package/src/panel/types.gen.ts +164 -0
- package/src/project/client.ts +273 -0
- package/src/project/external.ts +11 -0
- package/src/project/index.ts +10 -0
- package/src/project/types.gen.ts +40 -0
- package/src/query/cache.ts +326 -0
- package/src/query/deleted.ts +38 -0
- package/src/query/derived.ts +101 -0
- package/src/query/external.ts +51 -0
- package/src/query/index.ts +10 -0
- package/src/query/query.ts +865 -0
- package/src/query/retriever.ts +308 -0
- package/src/query/streamer.ts +207 -0
- package/src/query/table.ts +625 -0
- package/src/query/types.ts +54 -0
- package/src/query/write.ts +42 -0
- package/src/rack/client.ts +233 -45
- package/src/rack/types.gen.ts +15 -16
- package/src/range/alias/types.gen.ts +2 -3
- package/src/ranger/client.ts +581 -70
- package/src/ranger/kv/client.ts +52 -21
- package/src/ranger/payload.ts +3 -0
- package/src/ranger/types.gen.ts +21 -23
- package/src/ranger/writer.ts +4 -8
- package/src/schematic/actions.gen.ts +62 -53
- package/src/schematic/actions.ts +44 -42
- package/src/schematic/client.ts +226 -70
- package/src/schematic/symbol/client.ts +277 -48
- package/src/schematic/symbol/types.gen.ts +22 -34
- package/src/schematic/types.gen.ts +22 -29
- package/src/status/client.ts +321 -44
- package/src/status/external.ts +2 -0
- package/src/status/payload.ts +1 -23
- package/src/status/status.ts +241 -0
- package/src/status/types.gen.ts +108 -0
- package/src/table/actions.gen.ts +96 -63
- package/src/table/actions.ts +44 -19
- package/src/table/client.ts +220 -56
- package/src/table/types.gen.ts +24 -31
- package/src/task/client.ts +580 -101
- package/src/task/types.gen.ts +68 -75
- package/src/testutil/access.ts +102 -6
- package/src/testutil/channels.ts +29 -0
- package/src/testutil/client.ts +27 -2
- package/src/testutil/connection.ts +47 -0
- package/src/testutil/index.ts +17 -0
- package/src/testutil/panels.ts +26 -0
- package/src/testutil/proxy.ts +106 -0
- package/src/testutil/query.ts +28 -0
- package/src/testutil/telem.ts +17 -1
- package/src/transport.ts +18 -7
- package/src/user/client.ts +165 -64
- package/src/user/external.ts +1 -1
- package/src/user/types.gen.ts +5 -5
- package/src/util/retrieve.ts +4 -4
- package/src/util/telem.ts +0 -1
- package/src/view/client.ts +120 -37
- package/src/view/types.gen.ts +8 -11
- package/.turbo/turbo-build.log +0 -20
- package/.vscode/settings.json +0 -3
- package/CONTRIBUTING.md +0 -47
- package/dist/client.cjs +0 -118
- package/dist/eslint.config.d.ts +0 -4
- package/dist/eslint.config.d.ts.map +0 -1
- package/dist/src/access/enforce.spec.d.ts +0 -2
- package/dist/src/access/enforce.spec.d.ts.map +0 -1
- package/dist/src/access/policy/access.spec.d.ts +0 -2
- package/dist/src/access/policy/access.spec.d.ts.map +0 -1
- package/dist/src/access/role/role.spec.d.ts +0 -2
- package/dist/src/access/role/role.spec.d.ts.map +0 -1
- package/dist/src/actions/actions.spec.d.ts +0 -2
- package/dist/src/actions/actions.spec.d.ts.map +0 -1
- package/dist/src/arc/access.spec.d.ts +0 -2
- package/dist/src/arc/access.spec.d.ts.map +0 -1
- package/dist/src/arc/arc.spec.d.ts +0 -2
- package/dist/src/arc/arc.spec.d.ts.map +0 -1
- package/dist/src/arc/lsp.spec.d.ts +0 -2
- package/dist/src/arc/lsp.spec.d.ts.map +0 -1
- package/dist/src/auth/auth.spec.d.ts +0 -2
- package/dist/src/auth/auth.spec.d.ts.map +0 -1
- package/dist/src/channel/access.spec.d.ts +0 -2
- package/dist/src/channel/access.spec.d.ts.map +0 -1
- package/dist/src/channel/batchRetriever.spec.d.ts +0 -2
- package/dist/src/channel/batchRetriever.spec.d.ts.map +0 -1
- package/dist/src/channel/channel.spec.d.ts +0 -2
- package/dist/src/channel/channel.spec.d.ts.map +0 -1
- package/dist/src/channel/payload.spec.d.ts +0 -2
- package/dist/src/channel/payload.spec.d.ts.map +0 -1
- package/dist/src/channel/retriever.d.ts +0 -64
- package/dist/src/channel/retriever.d.ts.map +0 -1
- package/dist/src/cluster/index.d.ts +0 -2
- package/dist/src/cluster/index.d.ts.map +0 -1
- package/dist/src/cluster/types.gen.d.ts +0 -4
- package/dist/src/cluster/types.gen.d.ts.map +0 -1
- package/dist/src/connection/checker.d.ts +0 -86
- package/dist/src/connection/checker.d.ts.map +0 -1
- package/dist/src/connection/connection.spec.d.ts +0 -2
- package/dist/src/connection/connection.spec.d.ts.map +0 -1
- package/dist/src/connection.spec.d.ts +0 -2
- package/dist/src/connection.spec.d.ts.map +0 -1
- package/dist/src/control/state.spec.d.ts +0 -2
- package/dist/src/control/state.spec.d.ts.map +0 -1
- package/dist/src/device/access.spec.d.ts +0 -2
- package/dist/src/device/access.spec.d.ts.map +0 -1
- package/dist/src/device/device.spec.d.ts +0 -2
- package/dist/src/device/device.spec.d.ts.map +0 -1
- package/dist/src/device/payload.spec.d.ts +0 -2
- package/dist/src/device/payload.spec.d.ts.map +0 -1
- package/dist/src/errors.spec.d.ts +0 -2
- package/dist/src/errors.spec.d.ts.map +0 -1
- package/dist/src/framer/adapter.spec.d.ts +0 -2
- package/dist/src/framer/adapter.spec.d.ts.map +0 -1
- package/dist/src/framer/client.spec.d.ts +0 -2
- package/dist/src/framer/client.spec.d.ts.map +0 -1
- package/dist/src/framer/codec.spec.d.ts +0 -2
- package/dist/src/framer/codec.spec.d.ts.map +0 -1
- package/dist/src/framer/deleter.spec.d.ts +0 -2
- package/dist/src/framer/deleter.spec.d.ts.map +0 -1
- package/dist/src/framer/frame.spec.d.ts +0 -2
- package/dist/src/framer/frame.spec.d.ts.map +0 -1
- package/dist/src/framer/iterator.spec.d.ts +0 -2
- package/dist/src/framer/iterator.spec.d.ts.map +0 -1
- package/dist/src/framer/reader.spec.d.ts +0 -2
- package/dist/src/framer/reader.spec.d.ts.map +0 -1
- package/dist/src/framer/streamer.spec.d.ts +0 -2
- package/dist/src/framer/streamer.spec.d.ts.map +0 -1
- package/dist/src/framer/writer.spec.d.ts +0 -2
- package/dist/src/framer/writer.spec.d.ts.map +0 -1
- package/dist/src/group/access.spec.d.ts +0 -2
- package/dist/src/group/access.spec.d.ts.map +0 -1
- package/dist/src/group/group.spec.d.ts +0 -2
- package/dist/src/group/group.spec.d.ts.map +0 -1
- package/dist/src/label/access.spec.d.ts +0 -2
- package/dist/src/label/access.spec.d.ts.map +0 -1
- package/dist/src/label/label.spec.d.ts +0 -2
- package/dist/src/label/label.spec.d.ts.map +0 -1
- package/dist/src/lineplot/access.spec.d.ts +0 -2
- package/dist/src/lineplot/access.spec.d.ts.map +0 -1
- package/dist/src/lineplot/lineplot.spec.d.ts +0 -2
- package/dist/src/lineplot/lineplot.spec.d.ts.map +0 -1
- package/dist/src/log/access.spec.d.ts +0 -2
- package/dist/src/log/access.spec.d.ts.map +0 -1
- package/dist/src/log/log.spec.d.ts +0 -2
- package/dist/src/log/log.spec.d.ts.map +0 -1
- package/dist/src/ontology/ontology.spec.d.ts +0 -2
- package/dist/src/ontology/ontology.spec.d.ts.map +0 -1
- package/dist/src/rack/access.spec.d.ts +0 -2
- package/dist/src/rack/access.spec.d.ts.map +0 -1
- package/dist/src/rack/rack.spec.d.ts +0 -2
- package/dist/src/rack/rack.spec.d.ts.map +0 -1
- package/dist/src/ranger/access.spec.d.ts +0 -2
- package/dist/src/ranger/access.spec.d.ts.map +0 -1
- package/dist/src/ranger/alias/payload.spec.d.ts +0 -2
- package/dist/src/ranger/alias/payload.spec.d.ts.map +0 -1
- package/dist/src/ranger/ranger.spec.d.ts +0 -2
- package/dist/src/ranger/ranger.spec.d.ts.map +0 -1
- package/dist/src/schematic/access.spec.d.ts +0 -2
- package/dist/src/schematic/access.spec.d.ts.map +0 -1
- package/dist/src/schematic/actions.spec.d.ts +0 -2
- package/dist/src/schematic/actions.spec.d.ts.map +0 -1
- package/dist/src/schematic/schematic.spec.d.ts +0 -2
- package/dist/src/schematic/schematic.spec.d.ts.map +0 -1
- package/dist/src/schematic/symbol/access.spec.d.ts +0 -2
- package/dist/src/schematic/symbol/access.spec.d.ts.map +0 -1
- package/dist/src/schematic/symbol/client.spec.d.ts +0 -2
- package/dist/src/schematic/symbol/client.spec.d.ts.map +0 -1
- package/dist/src/status/access.spec.d.ts +0 -2
- package/dist/src/status/access.spec.d.ts.map +0 -1
- package/dist/src/status/status.spec.d.ts +0 -2
- package/dist/src/status/status.spec.d.ts.map +0 -1
- package/dist/src/table/access.spec.d.ts +0 -2
- package/dist/src/table/access.spec.d.ts.map +0 -1
- package/dist/src/table/table.spec.d.ts +0 -2
- package/dist/src/table/table.spec.d.ts.map +0 -1
- package/dist/src/task/access.spec.d.ts +0 -2
- package/dist/src/task/access.spec.d.ts.map +0 -1
- package/dist/src/task/payload.spec.d.ts +0 -2
- package/dist/src/task/payload.spec.d.ts.map +0 -1
- package/dist/src/task/task.spec.d.ts +0 -2
- package/dist/src/task/task.spec.d.ts.map +0 -1
- package/dist/src/user/access.spec.d.ts +0 -2
- package/dist/src/user/access.spec.d.ts.map +0 -1
- package/dist/src/user/user.spec.d.ts +0 -2
- package/dist/src/user/user.spec.d.ts.map +0 -1
- package/dist/src/util/retrieve.spec.d.ts +0 -2
- package/dist/src/util/retrieve.spec.d.ts.map +0 -1
- package/dist/src/view/view.spec.d.ts +0 -2
- package/dist/src/view/view.spec.d.ts.map +0 -1
- package/dist/src/workspace/access.spec.d.ts +0 -2
- package/dist/src/workspace/access.spec.d.ts.map +0 -1
- package/dist/src/workspace/client.d.ts +0 -36
- package/dist/src/workspace/client.d.ts.map +0 -1
- package/dist/src/workspace/external.d.ts.map +0 -1
- package/dist/src/workspace/index.d.ts +0 -2
- package/dist/src/workspace/index.d.ts.map +0 -1
- package/dist/src/workspace/types.gen.d.ts +0 -34
- package/dist/src/workspace/types.gen.d.ts.map +0 -1
- package/dist/src/workspace/workspace.spec.d.ts +0 -2
- package/dist/src/workspace/workspace.spec.d.ts.map +0 -1
- package/examples/node/basicReadWrite.js +0 -86
- package/examples/node/createChannels.js +0 -50
- package/examples/node/createRange.js +0 -67
- package/examples/node/package-lock.json +0 -133
- package/examples/node/package.json +0 -17
- package/examples/node/readLatest.js +0 -76
- package/examples/node/seriesAndFrames.js +0 -173
- package/examples/node/streamRead.js +0 -50
- package/examples/node/streamWrite.js +0 -87
- package/src/access/enforce.spec.ts +0 -188
- package/src/access/policy/access.spec.ts +0 -147
- package/src/access/role/role.spec.ts +0 -95
- package/src/actions/actions.spec.ts +0 -229
- package/src/arc/access.spec.ts +0 -149
- package/src/arc/arc.spec.ts +0 -44
- package/src/arc/lsp.spec.ts +0 -717
- package/src/auth/auth.spec.ts +0 -101
- package/src/channel/access.spec.ts +0 -116
- package/src/channel/batchRetriever.spec.ts +0 -115
- package/src/channel/channel.spec.ts +0 -352
- package/src/channel/payload.spec.ts +0 -117
- package/src/channel/retriever.ts +0 -252
- package/src/connection/checker.ts +0 -203
- package/src/connection/connection.spec.ts +0 -152
- package/src/connection.spec.ts +0 -145
- package/src/control/state.spec.ts +0 -22
- package/src/device/access.spec.ts +0 -159
- package/src/device/device.spec.ts +0 -461
- package/src/device/payload.spec.ts +0 -142
- package/src/errors.spec.ts +0 -71
- package/src/framer/adapter.spec.ts +0 -620
- package/src/framer/client.spec.ts +0 -180
- package/src/framer/codec.spec.ts +0 -383
- package/src/framer/deleter.spec.ts +0 -103
- package/src/framer/frame.spec.ts +0 -973
- package/src/framer/iterator.spec.ts +0 -169
- package/src/framer/reader.spec.ts +0 -865
- package/src/framer/streamer.spec.ts +0 -871
- package/src/framer/writer.spec.ts +0 -486
- package/src/group/access.spec.ts +0 -77
- package/src/group/group.spec.ts +0 -65
- package/src/label/access.spec.ts +0 -109
- package/src/label/label.spec.ts +0 -83
- package/src/lineplot/access.spec.ts +0 -134
- package/src/lineplot/lineplot.spec.ts +0 -120
- package/src/log/access.spec.ts +0 -132
- package/src/log/log.spec.ts +0 -106
- package/src/ontology/ontology.spec.ts +0 -521
- package/src/rack/access.spec.ts +0 -102
- package/src/rack/rack.spec.ts +0 -171
- package/src/ranger/access.spec.ts +0 -115
- package/src/ranger/alias/payload.spec.ts +0 -52
- package/src/ranger/ranger.spec.ts +0 -343
- package/src/schematic/access.spec.ts +0 -134
- package/src/schematic/actions.spec.ts +0 -699
- package/src/schematic/schematic.spec.ts +0 -340
- package/src/schematic/symbol/access.spec.ts +0 -172
- package/src/schematic/symbol/client.spec.ts +0 -160
- package/src/status/access.spec.ts +0 -129
- package/src/status/status.spec.ts +0 -448
- package/src/table/access.spec.ts +0 -128
- package/src/table/table.spec.ts +0 -651
- package/src/task/access.spec.ts +0 -131
- package/src/task/payload.spec.ts +0 -113
- package/src/task/task.spec.ts +0 -657
- package/src/user/access.spec.ts +0 -107
- package/src/user/user.spec.ts +0 -290
- package/src/util/retrieve.spec.ts +0 -49
- package/src/view/view.spec.ts +0 -165
- package/src/workspace/access.spec.ts +0 -108
- package/src/workspace/client.ts +0 -112
- package/src/workspace/types.gen.ts +0 -46
- package/src/workspace/workspace.spec.ts +0 -111
- package/tsconfig.json +0 -5
- package/tsconfig.vite.json +0 -4
- package/vite.config.ts +0 -29
- /package/dist/src/{workspace → project}/external.d.ts +0 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { FileTransport, UnaryClient, UploadBody } from '@synnaxlabs/freighter';
|
|
2
|
+
import { destructor, record } from '@synnaxlabs/x';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { imex } from '../imex';
|
|
5
|
+
import { ontology } from '../ontology';
|
|
6
|
+
import { Key, New, Project } from './types.gen';
|
|
7
|
+
import { query } from '../query';
|
|
8
|
+
export declare const SET_CHANNEL_NAME = "sy_project_set";
|
|
9
|
+
export declare const DELETE_CHANNEL_NAME = "sy_project_delete";
|
|
10
|
+
declare const retrieveReqZ: z.ZodObject<{
|
|
11
|
+
keys: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
|
|
12
|
+
searchTerm: z.ZodOptional<z.ZodString>;
|
|
13
|
+
offset: z.ZodOptional<z.ZodInt>;
|
|
14
|
+
limit: z.ZodOptional<z.ZodInt>;
|
|
15
|
+
ignoreNotFoundError: z.ZodOptional<z.ZodBoolean>;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
declare const retrieveMultiParamsZ: z.ZodUnion<[z.ZodObject<{
|
|
18
|
+
keys: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
|
|
19
|
+
searchTerm: z.ZodOptional<z.ZodString>;
|
|
20
|
+
offset: z.ZodOptional<z.ZodInt>;
|
|
21
|
+
limit: z.ZodOptional<z.ZodInt>;
|
|
22
|
+
ignoreNotFoundError: z.ZodOptional<z.ZodBoolean>;
|
|
23
|
+
}, z.core.$strip>, z.ZodPipe<z.ZodArray<z.ZodUUID>, z.ZodTransform<{
|
|
24
|
+
keys: string[];
|
|
25
|
+
}, string[]>>]>;
|
|
26
|
+
export interface RetrieveRequest extends z.infer<typeof retrieveReqZ> {
|
|
27
|
+
}
|
|
28
|
+
declare const setLayoutReqZ: z.ZodObject<{
|
|
29
|
+
key: z.ZodUUID;
|
|
30
|
+
layout: z.ZodRecord<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodUnknown>;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
/** Options for a project import call. */
|
|
33
|
+
export interface ImportOptions {
|
|
34
|
+
/**
|
|
35
|
+
* The name of the uploaded archive or picked directory. Its extension-stripped form
|
|
36
|
+
* names the project when the bundle carries no name.
|
|
37
|
+
*/
|
|
38
|
+
fileName: string;
|
|
39
|
+
}
|
|
40
|
+
export interface SetLayoutParams extends z.input<typeof setLayoutReqZ> {
|
|
41
|
+
}
|
|
42
|
+
export interface ClientConfig {
|
|
43
|
+
unary: UnaryClient;
|
|
44
|
+
file: FileTransport;
|
|
45
|
+
cache: query.Cache;
|
|
46
|
+
ontology: ontology.Client;
|
|
47
|
+
}
|
|
48
|
+
export declare class Client extends query.Retriever<typeof retrieveMultiParamsZ, Key, Project> {
|
|
49
|
+
private readonly cfg;
|
|
50
|
+
private readonly store;
|
|
51
|
+
constructor(cfg: ClientConfig);
|
|
52
|
+
create(project: New, opts?: query.WriteOptions<Project[]>): Promise<Project>;
|
|
53
|
+
create(projects: New[], opts?: query.WriteOptions<Project[]>): Promise<Project[]>;
|
|
54
|
+
rename(key: Key, name: string, opts?: query.WriteOptions): Promise<void>;
|
|
55
|
+
setLayout(key: Key, layout: record.Unknown, opts?: query.WriteOptions): Promise<void>;
|
|
56
|
+
delete(key: Key, opts?: query.WriteOptions): Promise<void>;
|
|
57
|
+
delete(keys: Key[], opts?: query.WriteOptions): Promise<void>;
|
|
58
|
+
/**
|
|
59
|
+
* Exports the project and its contents as a bundle: a zip archive holding one JSON
|
|
60
|
+
* file per document and panel, group children as directories, and a manifest.json
|
|
61
|
+
* naming the project. Two members of one directory that take the same file name keep
|
|
62
|
+
* distinct names through a numeric suffix. The caller pipes the stream wherever it
|
|
63
|
+
* likes without the client buffering the whole archive.
|
|
64
|
+
* @param options - the export options, including the serialization member files are
|
|
65
|
+
* written in.
|
|
66
|
+
* @returns the bundle as a stream of zip bytes.
|
|
67
|
+
*/
|
|
68
|
+
export(key: Key, options: imex.Options): Promise<ReadableStream<Uint8Array>>;
|
|
69
|
+
/**
|
|
70
|
+
* Imports a project bundle: a zip archive holding one JSON envelope per document and
|
|
71
|
+
* panel, group children as directories, and a manifest.json naming the project. The
|
|
72
|
+
* Core creates a fresh project and imports every member in a single transaction, so a
|
|
73
|
+
* failure leaves nothing behind. Legacy project directories (a root LAYOUT.json with
|
|
74
|
+
* no manifest) import through the same call.
|
|
75
|
+
*
|
|
76
|
+
* @param data - the bundle as zip bytes.
|
|
77
|
+
* @param options - the import options, including the source file's name.
|
|
78
|
+
* @returns the created project.
|
|
79
|
+
* @throws {ValidationError} if the manifest is missing, malformed, or of another
|
|
80
|
+
* bundle kind, if two member names collide, or if a member cannot be imported.
|
|
81
|
+
*/
|
|
82
|
+
import(data: UploadBody, options: ImportOptions): Promise<Project>;
|
|
83
|
+
/** Subscribes to every project delete delivered to the cache. */
|
|
84
|
+
onDelete(handler: (key: Key) => void): destructor.Destructor;
|
|
85
|
+
private mergeThrough;
|
|
86
|
+
private execRetrieve;
|
|
87
|
+
}
|
|
88
|
+
export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,OAAO,CAAC;IAWxE,iEAAiE;IACjE,QAAQ,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,GAAG,UAAU,CAAC,UAAU;IAO5D,OAAO,CAAC,YAAY;YAMN,YAAY;CAS3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"external.d.ts","sourceRoot":"","sources":["../../../src/project/external.ts"],"names":[],"mappings":"AASA,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/project/index.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ontology } from '../ontology';
|
|
3
|
+
export declare const keyZ: z.ZodUUID;
|
|
4
|
+
export type Key = z.infer<typeof keyZ>;
|
|
5
|
+
/**
|
|
6
|
+
* Project is a named, persistable container that stores the layout and organization of
|
|
7
|
+
* the Console application. Projects allow users to save and restore custom arrangements
|
|
8
|
+
* of visualizations, tabs, and window configurations.
|
|
9
|
+
*/
|
|
10
|
+
export declare const projectZ: z.ZodObject<{
|
|
11
|
+
key: z.ZodDefault<z.ZodUUID>;
|
|
12
|
+
name: z.ZodString;
|
|
13
|
+
layout: z.ZodDefault<z.ZodRecord<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodUnknown>>;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
export interface Project extends z.infer<typeof projectZ> {
|
|
16
|
+
}
|
|
17
|
+
export interface New extends z.input<typeof projectZ> {
|
|
18
|
+
}
|
|
19
|
+
export declare const ontologyID: ontology.CreateID<string>;
|
|
20
|
+
export declare const TYPE_ONTOLOGY_ID: {
|
|
21
|
+
type: "arc" | "builtin" | "channel" | "device" | "framer" | "group" | "label" | "lineplot" | "log" | "node" | "panel" | "policy" | "project" | "rack" | "range" | "range-alias" | "role" | "schematic" | "schematic_symbol" | "status" | "table" | "task" | "user" | "view";
|
|
22
|
+
key: string;
|
|
23
|
+
} | {
|
|
24
|
+
type: "arc" | "builtin" | "channel" | "device" | "framer" | "group" | "label" | "lineplot" | "log" | "node" | "panel" | "policy" | "project" | "rack" | "range" | "range-alias" | "role" | "schematic" | "schematic_symbol" | "status" | "table" | "task" | "user" | "view";
|
|
25
|
+
key: string;
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=types.gen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.gen.d.ts","sourceRoot":"","sources":["../../../src/project/types.gen.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,eAAO,MAAM,IAAI,WAAW,CAAC;AAC7B,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAEvC;;;;GAIG;AACH,eAAO,MAAM,QAAQ;;;;iBAUnB,CAAC;AACH,MAAM,WAAW,OAAQ,SAAQ,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC;CAAG;AAC5D,MAAM,WAAW,GAAI,SAAQ,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC;CAAG;AAExD,eAAO,MAAM,UAAU,2BAA2C,CAAC;AACnE,eAAO,MAAM,gBAAgB;;;;;;CAAiB,CAAC"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { breaker, destructor, record, state } from '@synnaxlabs/x';
|
|
2
|
+
import { default as z } from 'zod';
|
|
3
|
+
import { framer } from '../framer';
|
|
4
|
+
import { DeriveParams } from './derived';
|
|
5
|
+
import { Retrieves, SpaceConfig } from './query';
|
|
6
|
+
import { Listener } from './streamer';
|
|
7
|
+
import { Keyed, ListenerSpec, Table, TableParams } from './table';
|
|
8
|
+
import { Data, Params } from './types';
|
|
9
|
+
export interface CacheParams {
|
|
10
|
+
/**
|
|
11
|
+
* Opens the raw frame streamer used to receive change signals; reconnect hardening is
|
|
12
|
+
* applied internally. Null constructs a detached cache: purely local tables and no
|
|
13
|
+
* change stream. Used for clients constructed with `cache: false`.
|
|
14
|
+
*/
|
|
15
|
+
openStreamer: framer.StreamOpener | null;
|
|
16
|
+
/** Retry behavior for change-stream reconnect attempts. */
|
|
17
|
+
breaker?: breaker.Config;
|
|
18
|
+
/** Called whenever the change stream goes live, before reconciliation begins. */
|
|
19
|
+
onStreamLive?: () => void;
|
|
20
|
+
/** Called when the change stream fails and reconnection begins. */
|
|
21
|
+
onStreamDrop?: (error: Error) => void;
|
|
22
|
+
/**
|
|
23
|
+
* Called when the change stream is refused because the caller lacks access to
|
|
24
|
+
* the mirrored channels. Only a policy change lifts a denial.
|
|
25
|
+
*/
|
|
26
|
+
onStreamDenied?: (error: Error) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Receives errors that have no caller to throw to: listener fan-out, streamer frame
|
|
29
|
+
* handling, and background reconciliation. Defaults to console logging.
|
|
30
|
+
*/
|
|
31
|
+
onError?: (error: Error) => void;
|
|
32
|
+
}
|
|
33
|
+
/** Configuration for a derived table owned by a {@link Cache}. */
|
|
34
|
+
export interface DerivedConfig<Key extends record.Key, Value extends Keyed<Key>, Composed extends Keyed<Key>> extends DeriveParams<Key, Value, Composed> {
|
|
35
|
+
/** Names the table in diagnostics. */
|
|
36
|
+
name: string;
|
|
37
|
+
/** Overrides the deep-equality default used to silence redundant sets. */
|
|
38
|
+
equal?: (a: Composed, b: Composed, key: Key) => boolean;
|
|
39
|
+
}
|
|
40
|
+
/** Configuration for a table owned by a {@link Cache}. */
|
|
41
|
+
export interface TableConfig<Key extends record.Key = record.Key, Value extends state.State = state.State> extends Omit<TableParams<Key, Value>, "onError"> {
|
|
42
|
+
/** Names the table in diagnostics (reconciliation errors). */
|
|
43
|
+
name: string;
|
|
44
|
+
/** Mirror listeners keeping this table current from stream channels. */
|
|
45
|
+
listen?: Array<ListenerSpec<Key, Value>>;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The client's local mirror of cluster state: keyed tables, the change-stream loop,
|
|
49
|
+
* connection epochs, and reconciliation. Holds zero domain knowledge — domain clients
|
|
50
|
+
* create their tables here and expose typed query spaces. Always present on a client; a
|
|
51
|
+
* null {@link CacheParams.openStreamer} stands in for "disabled" or "not yet connected"
|
|
52
|
+
* rather than a null cache. The change stream opens lazily: nothing touches the network
|
|
53
|
+
* until the first {@link ensureStreaming} call. All tables and listeners must be
|
|
54
|
+
* declared before streaming starts.
|
|
55
|
+
*/
|
|
56
|
+
export declare class Cache {
|
|
57
|
+
private readonly tables;
|
|
58
|
+
private readonly reactions;
|
|
59
|
+
private readonly spaces;
|
|
60
|
+
private readonly detachers;
|
|
61
|
+
private readonly epochObserver;
|
|
62
|
+
private readonly params;
|
|
63
|
+
private streamer;
|
|
64
|
+
private epochCount;
|
|
65
|
+
private unmaintained;
|
|
66
|
+
/**
|
|
67
|
+
* Stable error sink for machinery built on this cache (dispatch
|
|
68
|
+
* controllers, answer spaces).
|
|
69
|
+
*/
|
|
70
|
+
readonly onError: (error: Error) => void;
|
|
71
|
+
constructor(params: CacheParams);
|
|
72
|
+
/**
|
|
73
|
+
* Creates a table owned by this cache and returns it, binding its declared mirror
|
|
74
|
+
* listeners. Must be called before streaming starts; creating after {@link
|
|
75
|
+
* ensureStreaming} throws, as the new table's channels would never be streamed.
|
|
76
|
+
*/
|
|
77
|
+
createTable<Key extends record.Key, Value extends state.State>(config: TableConfig<Key, Value>): Table<Key, Value>;
|
|
78
|
+
/**
|
|
79
|
+
* Creates a table materialized from another table owned by this cache. Composed
|
|
80
|
+
* entries are replaced on source and watch events, so entry identity changes exactly
|
|
81
|
+
* when composition changes; misses on read fetch through the source. Resets with the
|
|
82
|
+
* cache. No stream listeners of its own, so it may be created at any time.
|
|
83
|
+
*/
|
|
84
|
+
derive<Key extends record.Key, Value extends Keyed<Key>, Composed extends Keyed<Key>>(config: DerivedConfig<Key, Value, Composed>): Table<Key, Composed>;
|
|
85
|
+
/**
|
|
86
|
+
* Registers a channel reaction: a listener that is not a table mirror
|
|
87
|
+
* (dispatch wires, cross-table side effects). Same pre-streaming
|
|
88
|
+
* constraint as {@link createTable}.
|
|
89
|
+
*/
|
|
90
|
+
listen<Z extends z.ZodType>(listener: Listener<Z>): void;
|
|
91
|
+
/**
|
|
92
|
+
* Constructs an answer space wired to this cache: reads open the change
|
|
93
|
+
* stream, maintained answers refetch on epoch bumps, maintenance errors
|
|
94
|
+
* report to the cache's error sink, and the space closes with the cache.
|
|
95
|
+
*/
|
|
96
|
+
queries<Q extends Params, D extends Data, K extends record.Key = record.Key, V extends state.State = state.State>(config: SpaceConfig<Q, D, K, V>): Retrieves<Q, D>;
|
|
97
|
+
/**
|
|
98
|
+
* Ensures the change stream is open, opening it on first call. Callers that
|
|
99
|
+
* populate or read tables await this first so no change is missed between a
|
|
100
|
+
* fetch and the stream opening.
|
|
101
|
+
* @throws {AccessDeniedError} if the caller cannot stream the mirrored
|
|
102
|
+
* channels. Answers stop being maintained until a later call succeeds.
|
|
103
|
+
*/
|
|
104
|
+
ensureStreaming(): Promise<void>;
|
|
105
|
+
/**
|
|
106
|
+
* The connection epoch: 0 before streaming starts, 1 once live, incremented
|
|
107
|
+
* on every reconnect. Changes may have been missed between epochs.
|
|
108
|
+
*/
|
|
109
|
+
get epoch(): number;
|
|
110
|
+
/** Subscribes to epoch changes. Returns a destructor that unsubscribes. */
|
|
111
|
+
onEpoch(callback: (epoch: number) => void): destructor.Destructor;
|
|
112
|
+
/**
|
|
113
|
+
* Re-checks every cached entry against the cluster: refreshes entries that
|
|
114
|
+
* still exist and tombstones entries that vanished. Runs after every
|
|
115
|
+
* reconnect for tables that declare a fetch.
|
|
116
|
+
*/
|
|
117
|
+
private reconcile;
|
|
118
|
+
/**
|
|
119
|
+
* Discards every cached entry, tombstone, and answer, closes the change
|
|
120
|
+
* stream so it reopens fresh, and returns the epoch to 0. Called when the
|
|
121
|
+
* cluster behind the connection is replaced: no cached record, corpse, or
|
|
122
|
+
* answer remains meaningful, so nothing is tombstoned or diffed.
|
|
123
|
+
*/
|
|
124
|
+
reset(): Promise<void>;
|
|
125
|
+
private bumpEpoch;
|
|
126
|
+
/**
|
|
127
|
+
* Closes the change stream and every answer space this cache constructed.
|
|
128
|
+
* A no-op for the stream when streaming never started.
|
|
129
|
+
*/
|
|
130
|
+
close(): Promise<void>;
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../src/query/cache.ts"],"names":[],"mappings":"AASA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,UAAU,EAGf,KAAK,MAAM,EACX,KAAK,KAAK,EACX,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAGzB,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,KAAK,SAAS,EAAS,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAAkB,KAAK,QAAQ,EAAiB,MAAM,kBAAkB,CAAC;AAChF,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,YAAY,EAAE,KAAK,EAAE,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AACvF,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvD,MAAM,WAAW,WAAW;IAC1B;;;;OAIG;IACH,YAAY,EAAE,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC;IACzC,2DAA2D;IAC3D,OAAO,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC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AC,GAAG,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;IAWnD;;;;;;OAMG;IACG,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IA+CtC;;;OAGG;IACH,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,2EAA2E;IAC3E,OAAO,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,UAAU,CAAC,UAAU;IAIjE;;;;OAIG;YACW,SAAS;IAevB;;;;;OAKG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAkB5B,OAAO,CAAC,SAAS;IAUjB;;;OAGG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAM7B"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { TimeStamp } from '@synnaxlabs/x';
|
|
2
|
+
declare const BRAND: unique symbol;
|
|
3
|
+
/**
|
|
4
|
+
* The last value of a deleted record, delivered wherever a cached answer would be, so
|
|
5
|
+
* deletion can never be mistaken for live data. One instance exists per deletion:
|
|
6
|
+
* repeated reads of a deleted answer return the same reference.
|
|
7
|
+
*/
|
|
8
|
+
export declare class Deleted<D = unknown> {
|
|
9
|
+
/** The record's value at the moment it was deleted. */
|
|
10
|
+
readonly corpse: D;
|
|
11
|
+
/** When the deletion was applied. */
|
|
12
|
+
readonly deletedAt: TimeStamp;
|
|
13
|
+
protected readonly [BRAND] = true;
|
|
14
|
+
constructor(corpse: D, deletedAt: TimeStamp);
|
|
15
|
+
/** Narrows a cached answer to the deleted case, carrying its record type
|
|
16
|
+
* onto the corpse. */
|
|
17
|
+
static matches<D>(value: D | Deleted<D> | undefined): value is Deleted<D>;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=deleted.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deleted.d.ts","sourceRoot":"","sources":["../../../src/query/deleted.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;AAI/C,QAAA,MAAM,KAAK,eAAgD,CAAC;AAE5D;;;;GAIG;AACH,qBAAa,OAAO,CAAC,CAAC,GAAG,OAAO;IAC9B,uDAAuD;IACvD,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IACnB,qCAAqC;IACrC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,SAAS,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,QAAQ;gBAEtB,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,SAAS;IAK3C;2BACuB;IACvB,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,SAAS,GAAG,KAAK,IAAI,OAAO,CAAC,CAAC,CAAC;CAG1E"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { destructor, record, state } from '@synnaxlabs/x';
|
|
2
|
+
import { Keyed, Table, TableEvent } from './table';
|
|
3
|
+
/**
|
|
4
|
+
* A foreign-table trigger for a derived table: projects that table's events onto the
|
|
5
|
+
* source keys whose composition they change. Build with {@link deriveWatch}.
|
|
6
|
+
*/
|
|
7
|
+
export interface DeriveWatch<K extends record.Key> {
|
|
8
|
+
attach: (recompose: (keys: K[] | "all") => void) => destructor.Destructor;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Declares that events on the given table change composed entries. `affects`
|
|
12
|
+
* maps an event to the source keys whose composition it touches, "all" to
|
|
13
|
+
* recompose every entry, or null when unaffected.
|
|
14
|
+
*/
|
|
15
|
+
export declare const deriveWatch: <K extends record.Key, ForeignKey extends record.Key, ForeignValue extends state.State>(table: Table<ForeignKey, ForeignValue>, affects: (event: TableEvent<ForeignKey, ForeignValue>) => K[] | "all" | null) => DeriveWatch<K>;
|
|
16
|
+
/** Derivation wiring shared by {@link Cache.derive}. */
|
|
17
|
+
export interface DeriveParams<K extends record.Key, V extends Keyed<K>, CV extends Keyed<K>> {
|
|
18
|
+
/** The table owning the raw records the derivation reads. */
|
|
19
|
+
source: Table<K, V>;
|
|
20
|
+
/** Builds the composed entry for one source record. Pure; no network. */
|
|
21
|
+
compose: (record: V) => CV;
|
|
22
|
+
/** Foreign tables whose events change composition. */
|
|
23
|
+
watch?: Array<DeriveWatch<K>>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Keeps a derived table materialized from its source: composed entries are
|
|
27
|
+
* replaced (never mutated) on source and watch events, so an entry's identity
|
|
28
|
+
* changes exactly when its composition changes, with equal recompositions
|
|
29
|
+
* silenced by the table's equality check. Existing source entries are composed
|
|
30
|
+
* immediately. Returns a destructor that detaches every subscription.
|
|
31
|
+
*/
|
|
32
|
+
export declare const bindDerived: <K extends record.Key, V extends Keyed<K>, CV extends Keyed<K>>(into: Table<K, CV>, { source, compose, watch }: DeriveParams<K, V, CV>) => destructor.Destructor;
|
|
33
|
+
//# sourceMappingURL=derived.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"derived.d.ts","sourceRoot":"","sources":["../../../src/query/derived.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,MAAM,EAAE,KAAK,KAAK,EAAE,MAAM,eAAe,CAAC;AAEzE,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAExE;;;GAGG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG;IAC/C,MAAM,EAAE,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,KAAK,KAAK,IAAI,KAAK,UAAU,CAAC,UAAU,CAAC;CAC3E;AAED;;;;GAIG;AACH,eAAO,MAAM,WAAW,GACtB,CAAC,SAAS,MAAM,CAAC,GAAG,EACpB,UAAU,SAAS,MAAM,CAAC,GAAG,EAC7B,YAAY,SAAS,KAAK,CAAC,KAAK,EAEhC,OAAO,KAAK,CAAC,UAAU,EAAE,YAAY,CAAC,EACtC,SAAS,CAAC,KAAK,EAAE,UAAU,CAAC,UAAU,EAAE,YAAY,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,GAAG,IAAI,KAC3E,WAAW,CAAC,CAAC,CAcd,CAAC;AAEH,wDAAwD;AACxD,MAAM,WAAW,YAAY,CAC3B,CAAC,SAAS,MAAM,CAAC,GAAG,EACpB,CAAC,SAAS,KAAK,CAAC,CAAC,CAAC,EAClB,EAAE,SAAS,KAAK,CAAC,CAAC,CAAC;IAEnB,6DAA6D;IAC7D,MAAM,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACpB,yEAAyE;IACzE,OAAO,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC;IAC3B,sDAAsD;IACtD,KAAK,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;CAC/B;AAED;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,GACtB,CAAC,SAAS,MAAM,CAAC,GAAG,EACpB,CAAC,SAAS,KAAK,CAAC,CAAC,CAAC,EAClB,EAAE,SAAS,KAAK,CAAC,CAAC,CAAC,EAEnB,MAAM,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAClB,4BAA4B,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,KACjD,UAAU,CAAC,UAuBb,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { Cache, type CacheParams, type DerivedConfig, type TableConfig, } from './cache';
|
|
2
|
+
export { Deleted } from './deleted';
|
|
3
|
+
export { type DeriveWatch, deriveWatch } from './derived';
|
|
4
|
+
export { type Cached, type ChangeHandler, hash, isLive, requireCorpse, type Retrieves, type SpaceConfig, type Watch, watch, } from './query';
|
|
5
|
+
export { keyListZ, Retriever, type RetrieverParams } from './retriever';
|
|
6
|
+
export { type Listener } from './streamer';
|
|
7
|
+
export { createDeleteListener, createFetchListener, createSetListener, type EntryStatus, type HydrateMode, type Keyed, type ListenerSpec, partialUpdate, Table, type TableEvent, type TableParams, type TableSubscriber, } from './table';
|
|
8
|
+
export { type Data, type FetchOptions, type Params, type WriteOptions, } from './types';
|
|
9
|
+
export { optimistic, type OptimisticParams } from './write';
|
|
10
|
+
//# sourceMappingURL=external.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"external.d.ts","sourceRoot":"","sources":["../../../src/query/external.ts"],"names":[],"mappings":"AASA,OAAO,EACL,KAAK,EACL,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,WAAW,GACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,KAAK,WAAW,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EACL,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,IAAI,EACJ,MAAM,EACN,aAAa,EACb,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,KAAK,EACV,KAAK,GACN,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,KAAK,EACV,KAAK,YAAY,EACjB,aAAa,EACb,KAAK,EACL,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,eAAe,GACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,KAAK,IAAI,EACT,KAAK,YAAY,EACjB,KAAK,MAAM,EACX,KAAK,YAAY,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/query/index.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { destructor, record, state, TimeSpan } from '@synnaxlabs/x';
|
|
2
|
+
import { Deleted } from './deleted';
|
|
3
|
+
import { Table, TableEvent } from './table';
|
|
4
|
+
import { Data, FetchOptions, Params } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* Deterministically serializes query params to a stable string. Keys are sorted
|
|
7
|
+
* recursively so `{a: 1, b: 2}` and `{b: 2, a: 1}` collapse to the same key, and
|
|
8
|
+
* explicitly-undefined fields hash like absent ones (matching JSON semantics). Class
|
|
9
|
+
* instances implementing {@link primitive.Hashable} delegate to their `hash()` method;
|
|
10
|
+
* plain objects and arrays recurse structurally, memoized per object identity ({@link
|
|
11
|
+
* Params} is readonly, so an object's hash never changes).
|
|
12
|
+
*/
|
|
13
|
+
export declare const hash: (params: Params) => string;
|
|
14
|
+
/**
|
|
15
|
+
* A cached answer as delivered to consumers: the query's current data, or the
|
|
16
|
+
* {@link Deleted} corpse of a record that was deleted. A corpse is never
|
|
17
|
+
* delivered as bare data, so deletion cannot be mistaken for a live result.
|
|
18
|
+
* Narrow with {@link isLive}, or {@link Deleted.matches} to reach the corpse.
|
|
19
|
+
*/
|
|
20
|
+
export type Cached<D extends Data> = D | Deleted<D>;
|
|
21
|
+
/** True when a cached answer is live: cached at all, and not a deletion. */
|
|
22
|
+
export declare const isLive: <D extends Data>(value: Cached<D> | undefined) => value is D;
|
|
23
|
+
/**
|
|
24
|
+
* Returns the corpse of a deleted answer, for callers that need the record's
|
|
25
|
+
* last value (restoring it, say) and have no use for any other outcome.
|
|
26
|
+
* @throws {NotFoundError} if the answer is live or nothing is cached.
|
|
27
|
+
*/
|
|
28
|
+
export declare const requireCorpse: <D extends Data>(value: Cached<D> | undefined) => D;
|
|
29
|
+
/**
|
|
30
|
+
* Receives the new cached answer for a query. `undefined` means the answer was
|
|
31
|
+
* invalidated; the next read refetches.
|
|
32
|
+
*/
|
|
33
|
+
export interface ChangeHandler<D extends Data> {
|
|
34
|
+
(result: Cached<D> | undefined): void;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The read surface of one query space: fetch, subscribe, snapshot. The public
|
|
38
|
+
* face of every answer space, including the named spaces domain clients
|
|
39
|
+
* expose (children, parents, kv).
|
|
40
|
+
*/
|
|
41
|
+
export interface Retrieves<P extends Params, D extends Data> {
|
|
42
|
+
retrieve: (params: P, options?: FetchOptions) => Promise<D>;
|
|
43
|
+
onChange: (params: P, handler: ChangeHandler<D>) => destructor.Destructor;
|
|
44
|
+
getCached: (params: P) => Cached<D> | undefined;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* A foreign-table subscription for an answer space: projects that table's
|
|
48
|
+
* events onto the space's primary keys. Build with {@link watch}.
|
|
49
|
+
*/
|
|
50
|
+
export interface Watch<P extends Params, K extends record.Key> {
|
|
51
|
+
attach: (params: P, onEvent: (result: K[] | "refetch") => void) => destructor.Destructor;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Declares that events on the given table affect answers in this space.
|
|
55
|
+
* `affects` maps an event to the primary keys whose membership or content it
|
|
56
|
+
* touches, "refetch" to invalidate wholesale, or null when unaffected.
|
|
57
|
+
*/
|
|
58
|
+
export declare const watch: <P extends Params, K extends record.Key, ForeignKey extends record.Key, ForeignValue extends state.State>(table: Table<ForeignKey, ForeignValue>, affects: (event: TableEvent<ForeignKey, ForeignValue>, params: P) => K[] | "refetch" | null) => Watch<P, K>;
|
|
59
|
+
/**
|
|
60
|
+
* Declaration of one query space: which table owns its records, how to fetch
|
|
61
|
+
* an answer's keys, how to assemble content, and how membership is maintained.
|
|
62
|
+
*
|
|
63
|
+
* Maintenance is chosen per query instance:
|
|
64
|
+
* 1. exact-key — `keyOf` returns a key: track that entry; deletion flips the
|
|
65
|
+
* answer to deleted.
|
|
66
|
+
* 2. client-checkable — `matches` compares a record against the query:
|
|
67
|
+
* admit/evict exactly, no network.
|
|
68
|
+
* 3. server-computed — any field named in `serverFields` is set on the query
|
|
69
|
+
* (or neither `keyOf` nor `matches` applies): debounced wholesale refetch.
|
|
70
|
+
*/
|
|
71
|
+
export interface SpaceConfig<P extends Params, D extends Data, K extends record.Key = record.Key, V extends state.State = state.State> {
|
|
72
|
+
/** Resource name used in error messages, e.g. "range". */
|
|
73
|
+
name: string;
|
|
74
|
+
/** The table owning this space's record content. */
|
|
75
|
+
table: Table<K, V>;
|
|
76
|
+
/**
|
|
77
|
+
* Fetches the answer from the cluster: writes fetched records into their
|
|
78
|
+
* tables and returns the member keys.
|
|
79
|
+
*/
|
|
80
|
+
fetch: (params: P, options?: FetchOptions) => Promise<K[]>;
|
|
81
|
+
/** Assembles the answer from resolved member records at read time. */
|
|
82
|
+
compose: (records: V[], params: P) => D;
|
|
83
|
+
/** Rule 1: the single key a query addresses, or null when it doesn't. */
|
|
84
|
+
keyOf?: (params: P) => K | null;
|
|
85
|
+
/**
|
|
86
|
+
* The exact key set a keys-only query addresses, or null when it doesn't. Lets
|
|
87
|
+
* getCached compose the answer straight from the table (params order, deduped,
|
|
88
|
+
* tombstoned members omitted) and lets maintenance seed a ready answer on
|
|
89
|
+
* subscribe, so a fully cached key set never fetches.
|
|
90
|
+
*/
|
|
91
|
+
keysOf?: (params: P) => K[] | null;
|
|
92
|
+
/** Rule 2: whether a record satisfies the query. Pure; no network. */
|
|
93
|
+
matches?: (record: V, params: P) => boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Query fields only the server can evaluate (searchTerm, limit, offset).
|
|
96
|
+
* A query instance with any of them set is maintained by rule 3.
|
|
97
|
+
*/
|
|
98
|
+
serverFields?: readonly string[];
|
|
99
|
+
/** Foreign tables whose events affect this space's answers. */
|
|
100
|
+
watch?: Watch<P, K>[];
|
|
101
|
+
/**
|
|
102
|
+
* Marks a space whose answer addresses one record and cannot compose an
|
|
103
|
+
* empty membership: rule-2 eviction of the last member flips the query to
|
|
104
|
+
* deleted (when the entry tombstoned) or invalidates it, instead of
|
|
105
|
+
* composing []. Leave unset for spaces where [] is a valid answer.
|
|
106
|
+
*/
|
|
107
|
+
single?: boolean;
|
|
108
|
+
}
|
|
109
|
+
/** Wiring a {@link Space} receives from the cache that owns it. */
|
|
110
|
+
export interface SpaceHooks {
|
|
111
|
+
/** Started (not awaited) on reads and subscriptions to open change delivery. */
|
|
112
|
+
ensureStreaming?: () => Promise<void>;
|
|
113
|
+
/** Subscribes to connection-epoch changes; maintained answers refetch on bump. */
|
|
114
|
+
onEpoch?: (callback: (epoch: number) => void) => destructor.Destructor;
|
|
115
|
+
/**
|
|
116
|
+
* Whether change delivery keeps subscribed answers current. False when the
|
|
117
|
+
* cache is detached or the cluster refused the stream. Defaults to true.
|
|
118
|
+
*/
|
|
119
|
+
maintained?: () => boolean;
|
|
120
|
+
/** Reports maintenance errors that have no caller to throw to. Defaults to
|
|
121
|
+
* console logging. */
|
|
122
|
+
onError?: (error: Error) => void;
|
|
123
|
+
/**
|
|
124
|
+
* How long maintenance survives the last unsubscribe, so a quick remount finds
|
|
125
|
+
* the answer still maintained and skips the reconfirm refetch. Zero tears down
|
|
126
|
+
* synchronously. Defaults to 5 seconds.
|
|
127
|
+
*/
|
|
128
|
+
teardownGrace?: TimeSpan;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Cached read path for one query space of a domain client: deduped fetches, per-query
|
|
132
|
+
* lifecycle, subscriptions, and deletion delivery. Answers hold only key lists; record
|
|
133
|
+
* content lives in tables and is assembled at read time, so answer content cannot
|
|
134
|
+
* diverge from the record cache. Answers are maintained only while subscribed. An
|
|
135
|
+
* unsubscribed read refetches; an unsubscribed getCached serves the retained (possibly
|
|
136
|
+
* stale) answer, recomposed against live tables.
|
|
137
|
+
*/
|
|
138
|
+
export declare class Space<P extends Params, D extends Data, K extends record.Key = record.Key, V extends state.State = state.State> {
|
|
139
|
+
private readonly queries;
|
|
140
|
+
/** Composed corpses interned per tombstone and params, so deleted answers
|
|
141
|
+
* stay referentially stable. Identity composes reuse the tombstone. */
|
|
142
|
+
private readonly corpses;
|
|
143
|
+
/** Answers for reads with no live query, interned per entry and params. */
|
|
144
|
+
private readonly entryAnswers;
|
|
145
|
+
private readonly config;
|
|
146
|
+
private readonly hooks;
|
|
147
|
+
private readonly detachEpoch?;
|
|
148
|
+
private readonly grace;
|
|
149
|
+
private sweepTimer?;
|
|
150
|
+
constructor(config: SpaceConfig<P, D, K, V>, hooks?: SpaceHooks);
|
|
151
|
+
/**
|
|
152
|
+
* Returns the answer to the query: instantly when cached and subscribed,
|
|
153
|
+
* joining the in-flight fetch when one exists, fetching otherwise. Settled
|
|
154
|
+
* answers are kept fresh only while maintained (subscribed, or within the teardown
|
|
155
|
+
* grace window after the last unsubscribe, and only while change delivery is on),
|
|
156
|
+
* so an unmaintained read always refetches. A previously failed query refetches.
|
|
157
|
+
* @throws {NotFoundError} if the queried record was deleted.
|
|
158
|
+
*/
|
|
159
|
+
retrieve(params: P, options?: FetchOptions): Promise<D>;
|
|
160
|
+
/**
|
|
161
|
+
* Returns the cached answer without touching the network: the current data,
|
|
162
|
+
* the corpse of a deleted record, or undefined when nothing is cached.
|
|
163
|
+
* Exact-key queries also resolve from a table entry cached by any other
|
|
164
|
+
* query. May be stale for queries nothing subscribes to.
|
|
165
|
+
*/
|
|
166
|
+
getCached(params: P): Cached<D> | undefined;
|
|
167
|
+
/**
|
|
168
|
+
* Resolves a keys-only query's key list against the table: deduped, in params order,
|
|
169
|
+
* tombstoned keys omitted to match the fetch answer. Returns null when any key is
|
|
170
|
+
* unknown, since only a fetch can tell an uncached record from a nonexistent one.
|
|
171
|
+
*/
|
|
172
|
+
private composableMembersOf;
|
|
173
|
+
/**
|
|
174
|
+
* Subscribes to changes in the query's cached answer. The handler fires with the new
|
|
175
|
+
* answer on every change or deletion. Maintenance for the query runs while at least
|
|
176
|
+
* one subscriber exists and survives the last unsubscribe by the grace window, so a
|
|
177
|
+
* quick remount skips the reconfirm refetch. Returns a destructor that unsubscribes.
|
|
178
|
+
*/
|
|
179
|
+
onChange(params: P, handler: ChangeHandler<D>): destructor.Destructor;
|
|
180
|
+
/**
|
|
181
|
+
* Resets every answer to unfetched and notifies subscribers that their answer was
|
|
182
|
+
* invalidated, so the next read refetches. Maintenance subscriptions stay mounted.
|
|
183
|
+
* Called by the cache when the cluster behind the connection is replaced.
|
|
184
|
+
*/
|
|
185
|
+
reset(): void;
|
|
186
|
+
/** Detaches the epoch subscription. Queries and handlers are dropped. */
|
|
187
|
+
close(): void;
|
|
188
|
+
private teardownQuery;
|
|
189
|
+
/** Arms the sweep while any query sits in the grace window. One timer per
|
|
190
|
+
* space, no matter how many queries go idle at once. */
|
|
191
|
+
private armSweep;
|
|
192
|
+
private sweep;
|
|
193
|
+
private ensure;
|
|
194
|
+
private startStreaming;
|
|
195
|
+
private report;
|
|
196
|
+
/** Composes a ready answer, interned against the records it was built from. */
|
|
197
|
+
private composedOf;
|
|
198
|
+
private cachedOf;
|
|
199
|
+
/** Composes a rule-1 answer for a read with no live query, interned per entry
|
|
200
|
+
* and params. The memo dies with the entry it is keyed on, which a table
|
|
201
|
+
* replaces on every content change. */
|
|
202
|
+
private entryAnswerOf;
|
|
203
|
+
private deletedOf;
|
|
204
|
+
/** Notifies subscribers when any of the keys is a member of the ready
|
|
205
|
+
* answer; otherwise just drops the memo so the next read recomposes. */
|
|
206
|
+
private touchMembers;
|
|
207
|
+
/** Notifies every subscriber with the query's current answer. */
|
|
208
|
+
private touch;
|
|
209
|
+
private settle;
|
|
210
|
+
/**
|
|
211
|
+
* Replays membership changes a fetch in flight deferred. The fetch answers the query
|
|
212
|
+
* as of when it ran, so a change that raced it would otherwise be lost under the keys
|
|
213
|
+
* it publishes. Applies quietly: the settle that calls this notifies once for the
|
|
214
|
+
* whole answer.
|
|
215
|
+
*/
|
|
216
|
+
private drainRechecks;
|
|
217
|
+
private fetch;
|
|
218
|
+
/** Never rejects: a failed refetch leaves the previous answer in place. */
|
|
219
|
+
private refetch;
|
|
220
|
+
private scheduleRefetch;
|
|
221
|
+
private isServerComputed;
|
|
222
|
+
private maintain;
|
|
223
|
+
/**
|
|
224
|
+
* Applies membership rechecks for the given keys against the table's current entries,
|
|
225
|
+
* without notifying. Admissions append in iteration order; evicting a single space's
|
|
226
|
+
* last member flips the query to deleted or unfetched. Returns whether the answer
|
|
227
|
+
* changed: membership moved, or a member's content was touched.
|
|
228
|
+
*/
|
|
229
|
+
private applyRechecks;
|
|
230
|
+
/** Applies rechecks for the keys, then notifies once when anything changed. */
|
|
231
|
+
private recheckKeys;
|
|
232
|
+
/** Never rejects: a failed backfill is reported and the recheck is skipped. */
|
|
233
|
+
private recheckMany;
|
|
234
|
+
}
|
|
235
|
+
//# sourceMappingURL=query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/query/query.ts"],"names":[],"mappings":"AASA,OAAO,EAEL,KAAK,UAAU,EAGf,KAAK,MAAM,EACX,KAAK,KAAK,EACV,QAAQ,EAET,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,YAAY,EAAE,KAAK,MAAM,EAAE,MAAM,eAAe,CAAC;AAI1E;;;;;;;GAOG;AACH,eAAO,MAAM,IAAI,GAAI,QAAQ,MAAM,KAAG,MAkBrC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,IAAI,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAEpD,4EAA4E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