@synnaxlabs/client 0.45.1 → 0.46.1
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 +7 -7
- package/dist/access/policy/client.d.ts +38 -26
- package/dist/access/policy/client.d.ts.map +1 -1
- package/dist/access/policy/payload.d.ts +22 -10
- package/dist/access/policy/payload.d.ts.map +1 -1
- package/dist/arc/client.d.ts +72 -0
- package/dist/arc/client.d.ts.map +1 -0
- package/dist/arc/external.d.ts +3 -0
- package/dist/arc/external.d.ts.map +1 -0
- package/dist/arc/index.d.ts +2 -0
- package/dist/arc/index.d.ts.map +1 -0
- package/dist/arc/payload.d.ts +155 -0
- package/dist/arc/payload.d.ts.map +1 -0
- package/dist/channel/client.d.ts +2 -3
- package/dist/channel/client.d.ts.map +1 -1
- package/dist/channel/payload.d.ts +23 -63
- package/dist/channel/payload.d.ts.map +1 -1
- package/dist/channel/retriever.d.ts.map +1 -1
- package/dist/client.cjs +44 -25
- package/dist/client.d.ts +5 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +7479 -4756
- package/dist/framer/client.d.ts +2 -2
- package/dist/framer/client.d.ts.map +1 -1
- package/dist/framer/deleter.d.ts +2 -2
- package/dist/framer/frame.d.ts +2 -2
- package/dist/framer/streamer.d.ts +42 -56
- package/dist/framer/streamer.d.ts.map +1 -1
- package/dist/framer/writer.d.ts +45 -43
- package/dist/framer/writer.d.ts.map +1 -1
- package/dist/hardware/device/client.d.ts +5 -6
- package/dist/hardware/device/client.d.ts.map +1 -1
- package/dist/hardware/device/payload.d.ts +83 -18
- package/dist/hardware/device/payload.d.ts.map +1 -1
- package/dist/hardware/rack/client.d.ts +4 -5
- package/dist/hardware/rack/client.d.ts.map +1 -1
- package/dist/hardware/rack/payload.d.ts +81 -17
- package/dist/hardware/rack/payload.d.ts.map +1 -1
- package/dist/hardware/task/client.d.ts +67 -12
- package/dist/hardware/task/client.d.ts.map +1 -1
- package/dist/hardware/task/payload.d.ts +18 -51
- package/dist/hardware/task/payload.d.ts.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/label/client.d.ts +14 -9
- package/dist/label/client.d.ts.map +1 -1
- package/dist/label/payload.d.ts +10 -11
- package/dist/label/payload.d.ts.map +1 -1
- package/dist/ontology/client.d.ts +7 -3
- package/dist/ontology/client.d.ts.map +1 -1
- package/dist/ontology/group/client.d.ts +45 -9
- package/dist/ontology/group/client.d.ts.map +1 -1
- package/dist/ontology/group/external.d.ts +0 -1
- package/dist/ontology/group/external.d.ts.map +1 -1
- package/dist/ontology/group/payload.d.ts +3 -1
- package/dist/ontology/group/payload.d.ts.map +1 -1
- package/dist/ontology/payload.d.ts +30 -17
- package/dist/ontology/payload.d.ts.map +1 -1
- package/dist/ontology/writer.d.ts +161 -0
- package/dist/ontology/writer.d.ts.map +1 -1
- package/dist/ranger/alias.d.ts +1 -1
- package/dist/ranger/alias.d.ts.map +1 -1
- package/dist/ranger/client.d.ts +9 -8
- package/dist/ranger/client.d.ts.map +1 -1
- package/dist/ranger/kv.d.ts.map +1 -1
- package/dist/ranger/payload.d.ts +5 -5
- package/dist/ranger/payload.d.ts.map +1 -1
- package/dist/ranger/writer.d.ts +6 -4
- package/dist/ranger/writer.d.ts.map +1 -1
- package/dist/status/client.d.ts +63 -0
- package/dist/status/client.d.ts.map +1 -0
- package/dist/status/external.d.ts +3 -0
- package/dist/status/external.d.ts.map +1 -0
- package/dist/status/index.d.ts +2 -0
- package/dist/status/index.d.ts.map +1 -0
- package/dist/status/payload.d.ts +32 -0
- package/dist/status/payload.d.ts.map +1 -0
- package/dist/status/status.spec.d.ts +2 -0
- package/dist/status/status.spec.d.ts.map +1 -0
- package/dist/user/client.d.ts.map +1 -1
- package/dist/user/retriever.d.ts.map +1 -1
- package/dist/workspace/client.d.ts +11 -6
- package/dist/workspace/client.d.ts.map +1 -1
- package/dist/workspace/lineplot/client.d.ts +28 -5
- package/dist/workspace/lineplot/client.d.ts.map +1 -1
- package/dist/workspace/lineplot/index.d.ts +1 -1
- package/dist/workspace/log/client.d.ts +28 -5
- package/dist/workspace/log/client.d.ts.map +1 -1
- package/dist/workspace/schematic/client.d.ts +35 -6
- package/dist/workspace/schematic/client.d.ts.map +1 -1
- package/dist/workspace/schematic/symbol/client.d.ts +6 -7
- package/dist/workspace/schematic/symbol/client.d.ts.map +1 -1
- package/dist/workspace/table/client.d.ts +28 -5
- package/dist/workspace/table/client.d.ts.map +1 -1
- package/examples/node/package-lock.json +30 -95
- package/examples/node/package.json +1 -1
- package/package.json +10 -10
- package/src/access/policy/client.ts +5 -6
- package/src/access/policy/payload.ts +4 -4
- package/src/access/policy/policy.spec.ts +4 -4
- package/src/arc/client.ts +117 -0
- package/src/{util/zod.ts → arc/external.ts} +2 -7
- package/src/arc/index.ts +10 -0
- package/src/arc/payload.ts +69 -0
- package/src/channel/client.ts +3 -4
- package/src/channel/payload.ts +4 -6
- package/src/channel/retriever.ts +2 -2
- package/src/client.ts +8 -2
- package/src/errors.spec.ts +1 -1
- package/src/framer/client.ts +4 -3
- package/src/framer/codec.spec.ts +1 -1
- package/src/hardware/device/client.ts +6 -8
- package/src/hardware/device/payload.ts +7 -6
- package/src/hardware/rack/client.ts +6 -8
- package/src/hardware/rack/payload.ts +2 -1
- package/src/hardware/task/client.ts +142 -100
- package/src/hardware/task/payload.ts +4 -4
- package/src/hardware/task/task.spec.ts +53 -2
- package/src/index.ts +3 -1
- package/src/label/client.ts +5 -8
- package/src/label/payload.ts +6 -11
- package/src/ontology/client.ts +3 -3
- package/src/ontology/group/client.ts +51 -18
- package/src/ontology/group/external.ts +0 -1
- package/src/ontology/group/group.spec.ts +6 -5
- package/src/ontology/group/payload.ts +5 -1
- package/src/ontology/ontology.spec.ts +88 -21
- package/src/ontology/payload.ts +15 -6
- package/src/ontology/writer.ts +3 -5
- package/src/ranger/alias.ts +2 -2
- package/src/ranger/client.ts +7 -3
- package/src/ranger/kv.ts +1 -2
- package/src/ranger/payload.ts +13 -1
- package/src/ranger/ranger.spec.ts +65 -1
- package/src/status/client.ts +129 -0
- package/src/status/external.ts +11 -0
- package/src/status/index.ts +10 -0
- package/src/status/payload.ts +35 -0
- package/src/status/status.spec.ts +352 -0
- package/src/user/client.ts +1 -2
- package/src/user/payload.ts +1 -1
- package/src/user/retriever.ts +2 -2
- package/src/user/user.spec.ts +41 -41
- package/src/workspace/client.ts +18 -15
- package/src/workspace/lineplot/client.ts +27 -13
- package/src/workspace/lineplot/index.ts +1 -1
- package/src/workspace/lineplot/lineplot.spec.ts +13 -10
- package/src/workspace/log/client.ts +26 -12
- package/src/workspace/log/log.spec.ts +13 -10
- package/src/workspace/payload.ts +1 -1
- package/src/workspace/schematic/client.ts +42 -17
- package/src/workspace/schematic/schematic.spec.ts +29 -25
- package/src/workspace/schematic/symbol/client.spec.ts +27 -24
- package/src/workspace/schematic/symbol/client.ts +6 -9
- package/src/workspace/table/client.ts +26 -12
- package/src/workspace/table/table.spec.ts +13 -10
- package/dist/ontology/group/group.d.ts +0 -10
- package/dist/ontology/group/group.d.ts.map +0 -1
- package/dist/ontology/group/writer.d.ts +0 -14
- package/dist/ontology/group/writer.d.ts.map +0 -1
- package/dist/util/zod.d.ts +0 -3
- package/dist/util/zod.d.ts.map +0 -1
- package/src/ontology/group/group.ts +0 -27
- package/src/ontology/group/writer.ts +0 -71
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"version": "1.0.0",
|
|
10
10
|
"license": "ISC",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@synnaxlabs/client": "^0.
|
|
12
|
+
"@synnaxlabs/client": "^0.45.1"
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"node_modules/@msgpack/msgpack": {
|
|
@@ -31,49 +31,47 @@
|
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
"node_modules/@synnaxlabs/alamos": {
|
|
34
|
-
"version": "0.
|
|
35
|
-
"resolved": "https://registry.npmjs.org/@synnaxlabs/alamos/-/alamos-0.
|
|
36
|
-
"integrity": "sha512-
|
|
34
|
+
"version": "0.45.1",
|
|
35
|
+
"resolved": "https://registry.npmjs.org/@synnaxlabs/alamos/-/alamos-0.45.1.tgz",
|
|
36
|
+
"integrity": "sha512-UF+vWStLOfyk3sDGl1AMccoYuGjwDr7NU9VmoES8WANjlW/IpxCuUHwZgMQLbMsWrTKyzBi0UKaRRHcdV7g2iA==",
|
|
37
37
|
"license": "MIT",
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@opentelemetry/api": "^1.9.0",
|
|
40
|
-
"@synnaxlabs/x": "0.
|
|
40
|
+
"@synnaxlabs/x": "^0.45.1"
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
43
|
"node_modules/@synnaxlabs/client": {
|
|
44
|
-
"version": "0.
|
|
45
|
-
"resolved": "https://registry.npmjs.org/@synnaxlabs/client/-/client-0.
|
|
46
|
-
"integrity": "sha512-
|
|
44
|
+
"version": "0.45.1",
|
|
45
|
+
"resolved": "https://registry.npmjs.org/@synnaxlabs/client/-/client-0.45.1.tgz",
|
|
46
|
+
"integrity": "sha512-DSIaLauKaa7VO9UL5nAaCXJKhSbWkLIvCJpHESWXgrkMMV3qSBayxrWDK7USoaa/qbINRQjL03TbsxTyCGI0tg==",
|
|
47
47
|
"license": "BUSL-1.1",
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@synnaxlabs/freighter": "0.
|
|
50
|
-
"@synnaxlabs/x": "0.
|
|
49
|
+
"@synnaxlabs/freighter": "^0.45.1",
|
|
50
|
+
"@synnaxlabs/x": "^0.45.1",
|
|
51
51
|
"async-mutex": "^0.5.0",
|
|
52
|
-
"zod": "^
|
|
52
|
+
"zod": "^4.0.2"
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
55
|
"node_modules/@synnaxlabs/freighter": {
|
|
56
|
-
"version": "0.
|
|
57
|
-
"resolved": "https://registry.npmjs.org/@synnaxlabs/freighter/-/freighter-0.
|
|
58
|
-
"integrity": "sha512-
|
|
56
|
+
"version": "0.45.1",
|
|
57
|
+
"resolved": "https://registry.npmjs.org/@synnaxlabs/freighter/-/freighter-0.45.1.tgz",
|
|
58
|
+
"integrity": "sha512-lwX0xboE7cXX6SI0N1ojaQzbtXQ82MAwCfG9RRM+lkzq/dQi3XcGbOSsqBz6uHvxENJRPJADGljmnb4vO1CMzA==",
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@synnaxlabs/alamos": "0.
|
|
61
|
-
"@synnaxlabs/x": "0.
|
|
62
|
-
"
|
|
63
|
-
"ws": "^8.18.2",
|
|
64
|
-
"zod": "^3.25.63"
|
|
60
|
+
"@synnaxlabs/alamos": "^0.45.1",
|
|
61
|
+
"@synnaxlabs/x": "^0.45.1",
|
|
62
|
+
"zod": "^4.0.2"
|
|
65
63
|
}
|
|
66
64
|
},
|
|
67
65
|
"node_modules/@synnaxlabs/x": {
|
|
68
|
-
"version": "0.
|
|
69
|
-
"resolved": "https://registry.npmjs.org/@synnaxlabs/x/-/x-0.
|
|
70
|
-
"integrity": "sha512-
|
|
66
|
+
"version": "0.45.1",
|
|
67
|
+
"resolved": "https://registry.npmjs.org/@synnaxlabs/x/-/x-0.45.1.tgz",
|
|
68
|
+
"integrity": "sha512-EDPxThi/bXoyNhs8Az4e4R52nliSkVE6TGYsTO1OFKTOU3Ej9dx9ucxy3HaClv0EsaNSEpSCEueSMx9KYxHXQw==",
|
|
71
69
|
"dependencies": {
|
|
72
70
|
"@msgpack/msgpack": "^3.1.2",
|
|
73
71
|
"async-mutex": "^0.5.0",
|
|
74
72
|
"nanoid": "^5.1.5",
|
|
75
73
|
"uuid": "^11.1.0",
|
|
76
|
-
"zod": "^
|
|
74
|
+
"zod": "^4.0.2"
|
|
77
75
|
}
|
|
78
76
|
},
|
|
79
77
|
"node_modules/async-mutex": {
|
|
@@ -86,9 +84,9 @@
|
|
|
86
84
|
}
|
|
87
85
|
},
|
|
88
86
|
"node_modules/nanoid": {
|
|
89
|
-
"version": "5.1.
|
|
90
|
-
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.1.
|
|
91
|
-
"integrity": "sha512-
|
|
87
|
+
"version": "5.1.6",
|
|
88
|
+
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.1.6.tgz",
|
|
89
|
+
"integrity": "sha512-c7+7RQ+dMB5dPwwCp4ee1/iV/q2P6aK1mTZcfr1BTuVlyW9hJYiMPybJCcnBlQtuSmTIWNeazm/zqNoZSSElBg==",
|
|
92
90
|
"funding": [
|
|
93
91
|
{
|
|
94
92
|
"type": "github",
|
|
@@ -103,36 +101,10 @@
|
|
|
103
101
|
"node": "^18 || >=20"
|
|
104
102
|
}
|
|
105
103
|
},
|
|
106
|
-
"node_modules/node-fetch": {
|
|
107
|
-
"version": "2.7.0",
|
|
108
|
-
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
|
|
109
|
-
"integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
|
|
110
|
-
"license": "MIT",
|
|
111
|
-
"dependencies": {
|
|
112
|
-
"whatwg-url": "^5.0.0"
|
|
113
|
-
},
|
|
114
|
-
"engines": {
|
|
115
|
-
"node": "4.x || >=6.0.0"
|
|
116
|
-
},
|
|
117
|
-
"peerDependencies": {
|
|
118
|
-
"encoding": "^0.1.0"
|
|
119
|
-
},
|
|
120
|
-
"peerDependenciesMeta": {
|
|
121
|
-
"encoding": {
|
|
122
|
-
"optional": true
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
"node_modules/tr46": {
|
|
127
|
-
"version": "0.0.3",
|
|
128
|
-
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
|
|
129
|
-
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==",
|
|
130
|
-
"license": "MIT"
|
|
131
|
-
},
|
|
132
104
|
"node_modules/tslib": {
|
|
133
|
-
"version": "2.
|
|
134
|
-
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.
|
|
135
|
-
"integrity": "sha512-
|
|
105
|
+
"version": "2.8.1",
|
|
106
|
+
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
|
|
107
|
+
"integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
|
|
136
108
|
"license": "0BSD"
|
|
137
109
|
},
|
|
138
110
|
"node_modules/uuid": {
|
|
@@ -148,47 +120,10 @@
|
|
|
148
120
|
"uuid": "dist/esm/bin/uuid"
|
|
149
121
|
}
|
|
150
122
|
},
|
|
151
|
-
"node_modules/webidl-conversions": {
|
|
152
|
-
"version": "3.0.1",
|
|
153
|
-
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
|
154
|
-
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==",
|
|
155
|
-
"license": "BSD-2-Clause"
|
|
156
|
-
},
|
|
157
|
-
"node_modules/whatwg-url": {
|
|
158
|
-
"version": "5.0.0",
|
|
159
|
-
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
|
|
160
|
-
"integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
|
|
161
|
-
"license": "MIT",
|
|
162
|
-
"dependencies": {
|
|
163
|
-
"tr46": "~0.0.3",
|
|
164
|
-
"webidl-conversions": "^3.0.0"
|
|
165
|
-
}
|
|
166
|
-
},
|
|
167
|
-
"node_modules/ws": {
|
|
168
|
-
"version": "8.18.2",
|
|
169
|
-
"resolved": "https://registry.npmjs.org/ws/-/ws-8.18.2.tgz",
|
|
170
|
-
"integrity": "sha512-DMricUmwGZUVr++AEAe2uiVM7UoO9MAVZMDu05UQOaUII0lp+zOzLLU4Xqh/JvTqklB1T4uELaaPBKyjE1r4fQ==",
|
|
171
|
-
"license": "MIT",
|
|
172
|
-
"engines": {
|
|
173
|
-
"node": ">=10.0.0"
|
|
174
|
-
},
|
|
175
|
-
"peerDependencies": {
|
|
176
|
-
"bufferutil": "^4.0.1",
|
|
177
|
-
"utf-8-validate": ">=5.0.2"
|
|
178
|
-
},
|
|
179
|
-
"peerDependenciesMeta": {
|
|
180
|
-
"bufferutil": {
|
|
181
|
-
"optional": true
|
|
182
|
-
},
|
|
183
|
-
"utf-8-validate": {
|
|
184
|
-
"optional": true
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
},
|
|
188
123
|
"node_modules/zod": {
|
|
189
|
-
"version": "
|
|
190
|
-
"resolved": "https://registry.npmjs.org/zod/-/zod-
|
|
191
|
-
"integrity": "sha512-
|
|
124
|
+
"version": "4.1.11",
|
|
125
|
+
"resolved": "https://registry.npmjs.org/zod/-/zod-4.1.11.tgz",
|
|
126
|
+
"integrity": "sha512-WPsqwxITS2tzx1bzhIKsEs19ABD5vmCVa4xBo2tq/SrV4RNZtfws1EnCWQXM6yh8bD08a1idvkB5MZSBiZsjwg==",
|
|
192
127
|
"license": "MIT",
|
|
193
128
|
"funding": {
|
|
194
129
|
"url": "https://github.com/sponsors/colinhacks"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synnaxlabs/client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.46.1",
|
|
4
4
|
"description": "The Synnax Client Library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"synnax",
|
|
@@ -25,21 +25,21 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"async-mutex": "^0.5.0",
|
|
28
|
-
"zod": "^4.
|
|
29
|
-
"@synnaxlabs/freighter": "^0.
|
|
30
|
-
"@synnaxlabs/x": "^0.
|
|
28
|
+
"zod": "^4.1.8",
|
|
29
|
+
"@synnaxlabs/freighter": "^0.46.0",
|
|
30
|
+
"@synnaxlabs/x": "^0.46.1"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@vitest/coverage-v8": "^3.2.4",
|
|
34
|
-
"@types/node": "^24.0
|
|
35
|
-
"eslint": "^9.
|
|
34
|
+
"@types/node": "^24.4.0",
|
|
35
|
+
"eslint": "^9.35.0",
|
|
36
36
|
"madge": "^8.0.0",
|
|
37
|
-
"typescript": "^5.
|
|
38
|
-
"vite": "^7.
|
|
37
|
+
"typescript": "^5.9.2",
|
|
38
|
+
"vite": "^7.1.5",
|
|
39
39
|
"vitest": "^3.2.4",
|
|
40
40
|
"@synnaxlabs/vite-plugin": "^0.43.0",
|
|
41
|
-
"
|
|
42
|
-
"
|
|
41
|
+
"eslint-config-synnaxlabs": "^0.43.0",
|
|
42
|
+
"@synnaxlabs/tsconfig": "^0.43.0"
|
|
43
43
|
},
|
|
44
44
|
"type": "module",
|
|
45
45
|
"types": "dist/index.d.ts",
|
|
@@ -20,7 +20,6 @@ import {
|
|
|
20
20
|
policyZ,
|
|
21
21
|
} from "@/access/policy/payload";
|
|
22
22
|
import { ontology } from "@/ontology";
|
|
23
|
-
import { nullableArrayZ } from "@/util/zod";
|
|
24
23
|
|
|
25
24
|
const retrieveRequestZ = z.object({
|
|
26
25
|
keys: keyZ.array().optional(),
|
|
@@ -41,14 +40,14 @@ const listRetrieveArgsZ = z.union([
|
|
|
41
40
|
retrieveRequestZ,
|
|
42
41
|
]);
|
|
43
42
|
|
|
44
|
-
export type
|
|
45
|
-
export type
|
|
43
|
+
export type RetrieveSingleParams = z.input<typeof keyRetrieveRequestZ>;
|
|
44
|
+
export type RetrieveMultipleParams = z.input<typeof listRetrieveArgsZ>;
|
|
46
45
|
|
|
47
46
|
const retrieveArgsZ = z.union([keyRetrieveRequestZ, listRetrieveArgsZ]);
|
|
48
47
|
|
|
49
48
|
export type RetrieveArgs = z.input<typeof retrieveArgsZ>;
|
|
50
49
|
|
|
51
|
-
const retrieveResZ = z.object({ policies:
|
|
50
|
+
const retrieveResZ = z.object({ policies: array.nullableZ(policyZ) });
|
|
52
51
|
|
|
53
52
|
const createReqZ = z.object({ policies: policyZ.partial({ key: true }).array() });
|
|
54
53
|
const createResZ = z.object({ policies: policyZ.array() });
|
|
@@ -86,8 +85,8 @@ export class Client {
|
|
|
86
85
|
return isMany ? res.policies : res.policies[0];
|
|
87
86
|
}
|
|
88
87
|
|
|
89
|
-
async retrieve(args:
|
|
90
|
-
async retrieve(args:
|
|
88
|
+
async retrieve(args: RetrieveSingleParams): Promise<Policy>;
|
|
89
|
+
async retrieve(args: RetrieveMultipleParams): Promise<Policy[]>;
|
|
91
90
|
async retrieve(args: RetrieveArgs): Promise<Policy | Policy[]> {
|
|
92
91
|
const isSingle = "key" in args;
|
|
93
92
|
const res = await sendRequired<typeof retrieveArgsZ, typeof retrieveResZ>(
|
|
@@ -7,20 +7,20 @@
|
|
|
7
7
|
// License, use of this software will be governed by the Apache License, Version 2.0,
|
|
8
8
|
// included in the file licenses/APL.txt.
|
|
9
9
|
|
|
10
|
+
import { array } from "@synnaxlabs/x";
|
|
10
11
|
import { z } from "zod";
|
|
11
12
|
|
|
12
13
|
import { actionZ } from "@/access/payload";
|
|
13
14
|
import { ontology } from "@/ontology";
|
|
14
|
-
import { nullableArrayZ } from "@/util/zod";
|
|
15
15
|
|
|
16
16
|
export const keyZ = z.uuid();
|
|
17
17
|
export type Key = z.infer<typeof keyZ>;
|
|
18
18
|
|
|
19
19
|
export const policyZ = z.object({
|
|
20
20
|
key: keyZ,
|
|
21
|
-
subjects:
|
|
22
|
-
objects:
|
|
23
|
-
actions:
|
|
21
|
+
subjects: array.nullableZ(ontology.idZ),
|
|
22
|
+
objects: array.nullableZ(ontology.idZ),
|
|
23
|
+
actions: array.nullableZ(actionZ),
|
|
24
24
|
});
|
|
25
25
|
export interface Policy extends z.infer<typeof policyZ> {}
|
|
26
26
|
|
|
@@ -297,11 +297,11 @@ describe("Policy", () => {
|
|
|
297
297
|
describe("privilege", async () => {
|
|
298
298
|
test("new user", async () => {
|
|
299
299
|
const username = id.create();
|
|
300
|
-
const user2 = await client.
|
|
300
|
+
const user2 = await client.users.create({ username, password: "pwd1" });
|
|
301
301
|
expect(user2).toBeDefined();
|
|
302
302
|
const client2 = createTestClient({ username: user2.username, password: "pwd1" });
|
|
303
303
|
await expect(
|
|
304
|
-
client2.
|
|
304
|
+
client2.users.create({ username: id.create(), password: id.create() }),
|
|
305
305
|
).rejects.toThrow(AuthError);
|
|
306
306
|
|
|
307
307
|
const policy = await client.access.policy.create({
|
|
@@ -312,7 +312,7 @@ describe("privilege", async () => {
|
|
|
312
312
|
|
|
313
313
|
const newUsername = id.create();
|
|
314
314
|
|
|
315
|
-
const newUser = await client2.
|
|
315
|
+
const newUser = await client2.users.create({
|
|
316
316
|
username: newUsername,
|
|
317
317
|
password: id.create(),
|
|
318
318
|
});
|
|
@@ -323,7 +323,7 @@ describe("privilege", async () => {
|
|
|
323
323
|
await client.access.policy.delete(policy.key);
|
|
324
324
|
|
|
325
325
|
await expect(
|
|
326
|
-
client2.
|
|
326
|
+
client2.users.create({ username: id.create(), password: id.create() }),
|
|
327
327
|
).rejects.toThrow(AuthError);
|
|
328
328
|
});
|
|
329
329
|
});
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
// Copyright 2025 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 { sendRequired, type UnaryClient } from "@synnaxlabs/freighter";
|
|
11
|
+
import { array } from "@synnaxlabs/x";
|
|
12
|
+
import { z } from "zod/v4";
|
|
13
|
+
|
|
14
|
+
import {
|
|
15
|
+
type Arc,
|
|
16
|
+
arcZ,
|
|
17
|
+
type Key,
|
|
18
|
+
keyZ,
|
|
19
|
+
type New,
|
|
20
|
+
newZ,
|
|
21
|
+
ONTOLOGY_TYPE,
|
|
22
|
+
type Params,
|
|
23
|
+
} from "@/arc/payload";
|
|
24
|
+
import { type ontology } from "@/ontology";
|
|
25
|
+
import { checkForMultipleOrNoResults } from "@/util/retrieve";
|
|
26
|
+
|
|
27
|
+
const RETRIEVE_ENDPOINT = "/arc/retrieve";
|
|
28
|
+
const CREATE_ENDPOINT = "/arc/create";
|
|
29
|
+
const DELETE_ENDPOINT = "/arc/delete";
|
|
30
|
+
|
|
31
|
+
const retrieveReqZ = z.object({
|
|
32
|
+
keys: keyZ.array().optional(),
|
|
33
|
+
names: z.string().array().optional(),
|
|
34
|
+
searchTerm: z.string().optional(),
|
|
35
|
+
limit: z.number().optional(),
|
|
36
|
+
offset: z.number().optional(),
|
|
37
|
+
includeStatus: z.boolean().optional(),
|
|
38
|
+
});
|
|
39
|
+
const createReqZ = z.object({ arcs: newZ.array() });
|
|
40
|
+
const deleteReqZ = z.object({ keys: keyZ.array() });
|
|
41
|
+
|
|
42
|
+
const retrieveResZ = z.object({ arcs: array.nullableZ(arcZ) });
|
|
43
|
+
const createResZ = z.object({ arcs: arcZ.array() });
|
|
44
|
+
const emptyResZ = z.object({});
|
|
45
|
+
|
|
46
|
+
export type RetrieveRequest = z.input<typeof retrieveReqZ>;
|
|
47
|
+
|
|
48
|
+
const keyRetrieveRequestZ = z
|
|
49
|
+
.object({
|
|
50
|
+
key: keyZ,
|
|
51
|
+
includeStatus: z.boolean().optional(),
|
|
52
|
+
})
|
|
53
|
+
.transform(({ key, includeStatus }) => ({ keys: [key], includeStatus }));
|
|
54
|
+
|
|
55
|
+
const nameRetrieveRequestZ = z
|
|
56
|
+
.object({
|
|
57
|
+
name: z.string(),
|
|
58
|
+
includeStatus: z.boolean().optional(),
|
|
59
|
+
})
|
|
60
|
+
.transform(({ name, includeStatus }) => ({ names: [name], includeStatus }));
|
|
61
|
+
|
|
62
|
+
export const singleRetrieveArgsZ = z.union([keyRetrieveRequestZ, nameRetrieveRequestZ]);
|
|
63
|
+
|
|
64
|
+
export type SingleRetrieveArgs = z.input<typeof singleRetrieveArgsZ>;
|
|
65
|
+
|
|
66
|
+
const retrieveArgsZ = z.union([singleRetrieveArgsZ, retrieveReqZ]);
|
|
67
|
+
|
|
68
|
+
export type RetrieveArgs = z.input<typeof retrieveArgsZ>;
|
|
69
|
+
|
|
70
|
+
export class Client {
|
|
71
|
+
private readonly client: UnaryClient;
|
|
72
|
+
|
|
73
|
+
constructor(client: UnaryClient) {
|
|
74
|
+
this.client = client;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
async create(arc: New): Promise<Arc>;
|
|
78
|
+
async create(arcs: New[]): Promise<Arc[]>;
|
|
79
|
+
async create(arcs: New | New[]): Promise<Arc | Arc[]> {
|
|
80
|
+
const isMany = Array.isArray(arcs);
|
|
81
|
+
const res = await sendRequired(
|
|
82
|
+
this.client,
|
|
83
|
+
CREATE_ENDPOINT,
|
|
84
|
+
{ arcs: array.toArray(arcs) },
|
|
85
|
+
createReqZ,
|
|
86
|
+
createResZ,
|
|
87
|
+
);
|
|
88
|
+
return isMany ? res.arcs : res.arcs[0];
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
async retrieve(args: SingleRetrieveArgs): Promise<Arc>;
|
|
92
|
+
async retrieve(args: RetrieveArgs): Promise<Arc[]>;
|
|
93
|
+
async retrieve(args: RetrieveArgs): Promise<Arc | Arc[]> {
|
|
94
|
+
const isSingle = "key" in args || "name" in args;
|
|
95
|
+
const res = await sendRequired(
|
|
96
|
+
this.client,
|
|
97
|
+
RETRIEVE_ENDPOINT,
|
|
98
|
+
args,
|
|
99
|
+
retrieveArgsZ,
|
|
100
|
+
retrieveResZ,
|
|
101
|
+
);
|
|
102
|
+
checkForMultipleOrNoResults("Arc", args, res.arcs, isSingle);
|
|
103
|
+
return isSingle ? res.arcs[0] : res.arcs;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
async delete(keys: Params): Promise<void> {
|
|
107
|
+
await sendRequired(
|
|
108
|
+
this.client,
|
|
109
|
+
DELETE_ENDPOINT,
|
|
110
|
+
{ keys: array.toArray(keys) },
|
|
111
|
+
deleteReqZ,
|
|
112
|
+
emptyResZ,
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export const ontologyID = (key: Key): ontology.ID => ({ type: ONTOLOGY_TYPE, key });
|
|
@@ -7,10 +7,5 @@
|
|
|
7
7
|
// License, use of this software will be governed by the Apache License, Version 2.0,
|
|
8
8
|
// included in the file licenses/APL.txt.
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export const nullableArrayZ = <Z extends z.ZodType>(item: Z) =>
|
|
13
|
-
z.union([
|
|
14
|
-
z.union([z.null(), z.undefined()]).transform<z.infer<Z>[]>(() => []),
|
|
15
|
-
item.array(),
|
|
16
|
-
]);
|
|
10
|
+
export * from "@/arc/client";
|
|
11
|
+
export * from "@/arc/payload";
|
package/src/arc/index.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Copyright 2025 Synnax Labs, Inc.
|
|
2
|
+
//
|
|
3
|
+
// Use of this software is governed by the Business Source License included in the file
|
|
4
|
+
// licenses/BSL.txt.
|
|
5
|
+
//
|
|
6
|
+
// As of the Change Date specified in that file, in accordance with the Business Source
|
|
7
|
+
// License, use of this software will be governed by the Apache License, Version 2.0,
|
|
8
|
+
// included in the file licenses/APL.txt.
|
|
9
|
+
|
|
10
|
+
export * as arc from "@/arc/external";
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// Copyright 2025 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 { xy } from "@synnaxlabs/x";
|
|
11
|
+
import { record } from "@synnaxlabs/x/record";
|
|
12
|
+
import { z } from "zod/v4";
|
|
13
|
+
|
|
14
|
+
import { type Status } from "@/status/payload";
|
|
15
|
+
import { parseWithoutKeyConversion } from "@/util/parseWithoutKeyConversion";
|
|
16
|
+
|
|
17
|
+
export const irNodeZ = z.object({
|
|
18
|
+
key: z.string(),
|
|
19
|
+
type: z.string(),
|
|
20
|
+
config: record.unknownZ.or(z.string().transform(parseWithoutKeyConversion)),
|
|
21
|
+
source: z.string().optional(),
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export const graphNodeZ = irNodeZ.extend({
|
|
25
|
+
position: xy.xy,
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export const handleZ = z.object({ param: z.string(), node: z.string() });
|
|
29
|
+
|
|
30
|
+
export const edgeZ = z.object({ source: handleZ, target: handleZ });
|
|
31
|
+
|
|
32
|
+
export const irZ = z.object({
|
|
33
|
+
nodes: irNodeZ.array(),
|
|
34
|
+
edges: edgeZ.array(),
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export const graphZ = z.object({
|
|
38
|
+
nodes: graphNodeZ.array(),
|
|
39
|
+
edges: edgeZ.array(),
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export const textZ = z.object({ raw: z.string() });
|
|
43
|
+
|
|
44
|
+
export interface IR extends z.infer<typeof irZ> {}
|
|
45
|
+
export interface Graph extends z.infer<typeof graphZ> {}
|
|
46
|
+
export interface Text extends z.infer<typeof textZ> {}
|
|
47
|
+
|
|
48
|
+
export const keyZ = z.uuid();
|
|
49
|
+
export type Key = z.infer<typeof keyZ>;
|
|
50
|
+
export type Params = Key | Key[];
|
|
51
|
+
|
|
52
|
+
export const arcZ = z.object({
|
|
53
|
+
key: keyZ,
|
|
54
|
+
name: z.string(),
|
|
55
|
+
graph: graphZ,
|
|
56
|
+
text: textZ,
|
|
57
|
+
deploy: z.boolean(),
|
|
58
|
+
version: z.string(),
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
export interface Arc extends z.infer<typeof arcZ> {
|
|
62
|
+
status?: Status;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export const newZ = arcZ.partial({ key: true });
|
|
66
|
+
export interface New extends z.input<typeof newZ> {}
|
|
67
|
+
|
|
68
|
+
export const ONTOLOGY_TYPE = "arc";
|
|
69
|
+
export type OntologyType = typeof ONTOLOGY_TYPE;
|
package/src/channel/client.ts
CHANGED
|
@@ -11,10 +11,10 @@ import { sendRequired, type UnaryClient } from "@synnaxlabs/freighter";
|
|
|
11
11
|
import { array, status } from "@synnaxlabs/x";
|
|
12
12
|
import {
|
|
13
13
|
type CrudeDensity,
|
|
14
|
+
type CrudeTimeRange,
|
|
14
15
|
type CrudeTimeStamp,
|
|
15
16
|
DataType,
|
|
16
17
|
type MultiSeries,
|
|
17
|
-
type TimeRange,
|
|
18
18
|
type TypedArray,
|
|
19
19
|
} from "@synnaxlabs/x/telem";
|
|
20
20
|
import { z } from "zod";
|
|
@@ -201,7 +201,7 @@ export class Channel {
|
|
|
201
201
|
* @param end - The ending timestamp of the range to read from.
|
|
202
202
|
* @returns A typed array containing the retrieved
|
|
203
203
|
*/
|
|
204
|
-
async read(tr:
|
|
204
|
+
async read(tr: CrudeTimeRange): Promise<MultiSeries> {
|
|
205
205
|
return await this.framer.read(tr, this.key);
|
|
206
206
|
}
|
|
207
207
|
|
|
@@ -230,7 +230,6 @@ const retrieveGroupResZ = z.object({ group: group.groupZ });
|
|
|
230
230
|
* through the `channels` property of an {@link Synnax} client.
|
|
231
231
|
*/
|
|
232
232
|
export class Client {
|
|
233
|
-
readonly type = "channel";
|
|
234
233
|
private readonly frameClient: framer.Client;
|
|
235
234
|
private readonly client: UnaryClient;
|
|
236
235
|
readonly retriever: Retriever;
|
|
@@ -428,7 +427,7 @@ export class Client {
|
|
|
428
427
|
retrieveGroupReqZ,
|
|
429
428
|
retrieveGroupResZ,
|
|
430
429
|
);
|
|
431
|
-
return
|
|
430
|
+
return res.group;
|
|
432
431
|
}
|
|
433
432
|
}
|
|
434
433
|
|
package/src/channel/payload.ts
CHANGED
|
@@ -7,18 +7,16 @@
|
|
|
7
7
|
// License, use of this software will be governed by the Apache License, Version 2.0,
|
|
8
8
|
// included in the file licenses/APL.txt.
|
|
9
9
|
|
|
10
|
-
import { type CrudeDataType, DataType, status, zod } from "@synnaxlabs/x";
|
|
10
|
+
import { array, type CrudeDataType, DataType, math, status, zod } from "@synnaxlabs/x";
|
|
11
11
|
import { z } from "zod";
|
|
12
12
|
|
|
13
|
-
import { nullableArrayZ } from "@/util/zod";
|
|
14
|
-
|
|
15
13
|
const errorMessage = "Channel key must be a valid uint32.";
|
|
16
14
|
export const keyZ = z.uint32().or(
|
|
17
15
|
z
|
|
18
16
|
.string()
|
|
19
17
|
.refine((val) => !isNaN(Number(val)), { message: errorMessage })
|
|
20
18
|
.transform(Number)
|
|
21
|
-
.refine((val) => val <
|
|
19
|
+
.refine((val) => val < math.MAX_UINT32, { message: errorMessage }),
|
|
22
20
|
);
|
|
23
21
|
export type Key = z.infer<typeof keyZ>;
|
|
24
22
|
export type Keys = Key[];
|
|
@@ -42,7 +40,7 @@ export const payloadZ = z.object({
|
|
|
42
40
|
virtual: z.boolean(),
|
|
43
41
|
alias: z.string().optional(),
|
|
44
42
|
expression: z.string().default(""),
|
|
45
|
-
requires:
|
|
43
|
+
requires: array.nullableZ(keyZ),
|
|
46
44
|
status: statusZ.optional(),
|
|
47
45
|
});
|
|
48
46
|
export interface Payload extends z.infer<typeof payloadZ> {}
|
|
@@ -55,7 +53,7 @@ export const newZ = payloadZ.extend({
|
|
|
55
53
|
internal: z.boolean().optional().default(false),
|
|
56
54
|
virtual: z.boolean().optional().default(false),
|
|
57
55
|
expression: z.string().optional().default(""),
|
|
58
|
-
requires:
|
|
56
|
+
requires: array.nullableZ(keyZ).optional().default([]),
|
|
59
57
|
});
|
|
60
58
|
|
|
61
59
|
export interface New
|
package/src/channel/retriever.ts
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
// included in the file licenses/APL.txt.
|
|
9
9
|
|
|
10
10
|
import { type UnaryClient } from "@synnaxlabs/freighter";
|
|
11
|
+
import { array } from "@synnaxlabs/x/array";
|
|
11
12
|
import { debounce } from "@synnaxlabs/x/debounce";
|
|
12
13
|
import { DataType } from "@synnaxlabs/x/telem";
|
|
13
14
|
import { Mutex } from "async-mutex";
|
|
@@ -30,7 +31,6 @@ import {
|
|
|
30
31
|
analyzeParams as analyzeParameters,
|
|
31
32
|
type ParamAnalysisResult,
|
|
32
33
|
} from "@/util/retrieve";
|
|
33
|
-
import { nullableArrayZ } from "@/util/zod";
|
|
34
34
|
|
|
35
35
|
const reqZ = z.object({
|
|
36
36
|
leaseholder: z.number().optional(),
|
|
@@ -53,7 +53,7 @@ export interface RetrieveOptions
|
|
|
53
53
|
extends Omit<RetrieveRequest, "keys" | "names" | "search"> {}
|
|
54
54
|
export interface PageOptions extends Omit<RetrieveOptions, "offset" | "limit"> {}
|
|
55
55
|
|
|
56
|
-
const resZ = z.object({ channels:
|
|
56
|
+
const resZ = z.object({ channels: array.nullableZ(payloadZ) });
|
|
57
57
|
|
|
58
58
|
export const analyzeParams = (
|
|
59
59
|
channels: Params,
|