@synnaxlabs/client 0.43.1 → 0.44.2
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/payload.d.ts +1 -1
- package/dist/access/payload.d.ts.map +1 -1
- package/dist/access/policy/client.d.ts +263 -6
- package/dist/access/policy/client.d.ts.map +1 -1
- package/dist/access/policy/external.d.ts +0 -1
- package/dist/access/policy/external.d.ts.map +1 -1
- package/dist/access/policy/payload.d.ts +105 -93
- package/dist/access/policy/payload.d.ts.map +1 -1
- package/dist/auth/auth.d.ts +1 -1
- package/dist/auth/auth.d.ts.map +1 -1
- package/dist/channel/client.d.ts +23 -17
- package/dist/channel/client.d.ts.map +1 -1
- package/dist/channel/payload.d.ts +151 -21
- package/dist/channel/payload.d.ts.map +1 -1
- package/dist/channel/retriever.d.ts +9 -16
- package/dist/channel/retriever.d.ts.map +1 -1
- package/dist/channel/writer.d.ts +1 -1
- package/dist/channel/writer.d.ts.map +1 -1
- package/dist/client.cjs +27 -135
- package/dist/client.d.ts +3 -3
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +8657 -28963
- package/dist/connection/checker.d.ts +1 -1
- package/dist/connection/checker.d.ts.map +1 -1
- package/dist/control/client.d.ts +1 -0
- package/dist/control/client.d.ts.map +1 -1
- package/dist/control/state.d.ts +6 -6
- package/dist/control/state.d.ts.map +1 -1
- package/dist/errors.d.ts +18 -5
- package/dist/errors.d.ts.map +1 -1
- package/dist/framer/adapter.d.ts +3 -3
- package/dist/framer/adapter.d.ts.map +1 -1
- package/dist/framer/client.d.ts +4 -13
- package/dist/framer/client.d.ts.map +1 -1
- package/dist/framer/codec.d.ts +1 -1
- package/dist/framer/codec.d.ts.map +1 -1
- package/dist/framer/deleter.d.ts +5 -5
- package/dist/framer/deleter.d.ts.map +1 -1
- package/dist/framer/frame.d.ts +5 -7
- package/dist/framer/frame.d.ts.map +1 -1
- package/dist/framer/streamProxy.d.ts +1 -1
- package/dist/framer/streamProxy.d.ts.map +1 -1
- package/dist/framer/streamer.d.ts +235 -20
- package/dist/framer/streamer.d.ts.map +1 -1
- package/dist/framer/writer.d.ts +302 -33
- package/dist/framer/writer.d.ts.map +1 -1
- package/dist/hardware/device/client.d.ts +49 -28
- package/dist/hardware/device/client.d.ts.map +1 -1
- package/dist/hardware/device/payload.d.ts +126 -46
- package/dist/hardware/device/payload.d.ts.map +1 -1
- package/dist/hardware/rack/client.d.ts +78 -22
- package/dist/hardware/rack/client.d.ts.map +1 -1
- package/dist/hardware/rack/payload.d.ts +99 -56
- package/dist/hardware/rack/payload.d.ts.map +1 -1
- package/dist/hardware/task/client.d.ts +100 -41
- package/dist/hardware/task/client.d.ts.map +1 -1
- package/dist/hardware/task/payload.d.ts +83 -61
- package/dist/hardware/task/payload.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/label/client.d.ts +138 -20
- package/dist/label/client.d.ts.map +1 -1
- package/dist/label/external.d.ts +0 -2
- package/dist/label/external.d.ts.map +1 -1
- package/dist/label/payload.d.ts +4 -5
- package/dist/label/payload.d.ts.map +1 -1
- package/dist/ontology/client.d.ts +45 -135
- package/dist/ontology/client.d.ts.map +1 -1
- package/dist/ontology/group/group.d.ts +3 -3
- package/dist/ontology/group/group.d.ts.map +1 -1
- package/dist/ontology/group/payload.d.ts +3 -27
- package/dist/ontology/group/payload.d.ts.map +1 -1
- package/dist/ontology/payload.d.ts +114 -243
- package/dist/ontology/payload.d.ts.map +1 -1
- package/dist/ontology/writer.d.ts +4 -4
- package/dist/ontology/writer.d.ts.map +1 -1
- package/dist/ranger/alias.d.ts +15 -5
- package/dist/ranger/alias.d.ts.map +1 -1
- package/dist/ranger/client.d.ts +91 -30
- package/dist/ranger/client.d.ts.map +1 -1
- package/dist/ranger/external.d.ts +1 -1
- package/dist/ranger/external.d.ts.map +1 -1
- package/dist/ranger/kv.d.ts +11 -12
- package/dist/ranger/kv.d.ts.map +1 -1
- package/dist/ranger/payload.d.ts +19 -44
- package/dist/ranger/payload.d.ts.map +1 -1
- package/dist/ranger/writer.d.ts +22 -19
- package/dist/ranger/writer.d.ts.map +1 -1
- package/dist/testutil/client.d.ts +4 -0
- package/dist/testutil/client.d.ts.map +1 -0
- package/dist/user/client.d.ts +59 -6
- package/dist/user/client.d.ts.map +1 -1
- package/dist/user/payload.d.ts +4 -6
- package/dist/user/payload.d.ts.map +1 -1
- package/dist/user/retriever.d.ts +2 -2
- package/dist/user/retriever.d.ts.map +1 -1
- package/dist/util/decodeJSONString.d.ts +2 -2
- package/dist/util/decodeJSONString.d.ts.map +1 -1
- package/dist/util/parseWithoutKeyConversion.d.ts +2 -2
- package/dist/util/parseWithoutKeyConversion.d.ts.map +1 -1
- package/dist/util/retrieve.d.ts +1 -1
- package/dist/util/retrieve.d.ts.map +1 -1
- package/dist/util/zod.d.ts +1 -1
- package/dist/util/zod.d.ts.map +1 -1
- package/dist/workspace/client.d.ts +17 -6
- package/dist/workspace/client.d.ts.map +1 -1
- package/dist/workspace/lineplot/client.d.ts +2 -2
- package/dist/workspace/lineplot/client.d.ts.map +1 -1
- package/dist/workspace/lineplot/payload.d.ts +8 -9
- package/dist/workspace/lineplot/payload.d.ts.map +1 -1
- package/dist/workspace/log/client.d.ts +2 -2
- package/dist/workspace/log/client.d.ts.map +1 -1
- package/dist/workspace/log/payload.d.ts +8 -9
- package/dist/workspace/log/payload.d.ts.map +1 -1
- package/dist/workspace/payload.d.ts +10 -11
- package/dist/workspace/payload.d.ts.map +1 -1
- package/dist/workspace/schematic/client.d.ts +2 -2
- package/dist/workspace/schematic/client.d.ts.map +1 -1
- package/dist/workspace/schematic/payload.d.ts +10 -11
- package/dist/workspace/schematic/payload.d.ts.map +1 -1
- package/dist/workspace/table/client.d.ts +2 -2
- package/dist/workspace/table/client.d.ts.map +1 -1
- package/dist/workspace/table/payload.d.ts +10 -11
- package/dist/workspace/table/payload.d.ts.map +1 -1
- package/examples/node/package-lock.json +47 -39
- package/examples/node/package.json +2 -1
- package/examples/node/streamWrite.js +5 -11
- package/package.json +14 -13
- package/src/access/payload.ts +1 -1
- package/src/access/policy/client.ts +87 -32
- package/src/access/policy/external.ts +0 -1
- package/src/access/policy/payload.ts +4 -4
- package/src/access/policy/policy.spec.ts +86 -83
- package/src/auth/auth.spec.ts +29 -18
- package/src/auth/auth.ts +1 -1
- package/src/channel/batchRetriever.spec.ts +4 -9
- package/src/channel/channel.spec.ts +24 -6
- package/src/channel/client.ts +52 -51
- package/src/channel/payload.ts +15 -16
- package/src/channel/retriever.ts +26 -41
- package/src/channel/writer.ts +7 -4
- package/src/client.ts +4 -4
- package/src/connection/checker.ts +1 -1
- package/src/connection/connection.spec.ts +31 -23
- package/src/control/client.ts +2 -2
- package/src/control/state.spec.ts +3 -3
- package/src/control/state.ts +1 -1
- package/src/errors.spec.ts +9 -5
- package/src/errors.ts +28 -15
- package/src/framer/adapter.spec.ts +118 -9
- package/src/framer/adapter.ts +24 -11
- package/src/framer/client.spec.ts +125 -2
- package/src/framer/client.ts +41 -47
- package/src/framer/codec.ts +1 -1
- package/src/framer/deleter.spec.ts +2 -2
- package/src/framer/deleter.ts +1 -1
- package/src/framer/frame.ts +1 -4
- package/src/framer/iterator.spec.ts +8 -8
- package/src/framer/iterator.ts +1 -1
- package/src/framer/streamProxy.ts +1 -1
- package/src/framer/streamer.spec.ts +185 -36
- package/src/framer/streamer.ts +28 -36
- package/src/framer/writer.spec.ts +7 -6
- package/src/framer/writer.ts +97 -111
- package/src/hardware/device/client.ts +45 -131
- package/src/hardware/device/device.spec.ts +163 -52
- package/src/hardware/device/payload.ts +10 -21
- package/src/hardware/rack/client.ts +87 -105
- package/src/hardware/rack/payload.ts +4 -13
- package/src/hardware/rack/rack.spec.ts +28 -35
- package/src/hardware/task/client.ts +335 -291
- package/src/hardware/task/payload.ts +86 -62
- package/src/hardware/task/task.spec.ts +208 -32
- package/src/index.ts +2 -1
- package/src/label/client.ts +100 -95
- package/src/label/external.ts +0 -2
- package/src/label/label.spec.ts +8 -6
- package/src/label/payload.ts +3 -4
- package/src/ontology/client.ts +41 -324
- package/src/ontology/group/group.spec.ts +2 -2
- package/src/ontology/group/group.ts +4 -5
- package/src/ontology/group/payload.ts +2 -25
- package/src/ontology/group/writer.ts +1 -1
- package/src/ontology/ontology.spec.ts +355 -41
- package/src/ontology/payload.ts +77 -112
- package/src/ontology/writer.ts +8 -17
- package/src/ranger/alias.ts +45 -37
- package/src/ranger/client.ts +144 -149
- package/src/ranger/external.ts +1 -1
- package/src/ranger/kv.ts +9 -27
- package/src/ranger/payload.ts +23 -37
- package/src/ranger/ranger.spec.ts +37 -56
- package/src/ranger/writer.ts +1 -1
- package/src/{signals/index.ts → testutil/client.ts} +11 -1
- package/src/user/client.ts +122 -47
- package/src/user/payload.ts +2 -5
- package/src/user/retriever.ts +1 -1
- package/src/user/user.spec.ts +31 -31
- package/src/user/writer.ts +1 -1
- package/src/util/decodeJSONString.ts +3 -3
- package/src/util/parseWithoutKeyConversion.ts +2 -2
- package/src/util/retrieve.ts +1 -1
- package/src/util/zod.ts +1 -1
- package/src/workspace/client.ts +20 -36
- package/src/workspace/lineplot/client.ts +5 -7
- package/src/workspace/lineplot/lineplot.spec.ts +2 -2
- package/src/workspace/lineplot/payload.ts +4 -7
- package/src/workspace/log/client.ts +5 -7
- package/src/workspace/log/log.spec.ts +2 -2
- package/src/workspace/log/payload.ts +4 -7
- package/src/workspace/payload.ts +4 -7
- package/src/workspace/schematic/client.ts +5 -7
- package/src/workspace/schematic/payload.ts +4 -7
- package/src/workspace/schematic/schematic.spec.ts +2 -2
- package/src/workspace/table/client.ts +5 -7
- package/src/workspace/table/payload.ts +4 -7
- package/src/workspace/table/table.spec.ts +2 -2
- package/src/workspace/workspace.spec.ts +2 -2
- package/dist/access/policy/ontology.d.ts +0 -5
- package/dist/access/policy/ontology.d.ts.map +0 -1
- package/dist/access/policy/retriever.d.ts +0 -40
- package/dist/access/policy/retriever.d.ts.map +0 -1
- package/dist/access/policy/writer.d.ts +0 -9
- package/dist/access/policy/writer.d.ts.map +0 -1
- package/dist/label/retriever.d.ts +0 -14
- package/dist/label/retriever.d.ts.map +0 -1
- package/dist/label/writer.d.ts +0 -54
- package/dist/label/writer.d.ts.map +0 -1
- package/dist/setupspecs.d.ts +0 -5
- package/dist/setupspecs.d.ts.map +0 -1
- package/dist/signals/external.d.ts +0 -2
- package/dist/signals/external.d.ts.map +0 -1
- package/dist/signals/index.d.ts +0 -2
- package/dist/signals/index.d.ts.map +0 -1
- package/dist/signals/observable.d.ts +0 -12
- package/dist/signals/observable.d.ts.map +0 -1
- package/src/access/policy/ontology.ts +0 -17
- package/src/access/policy/retriever.ts +0 -44
- package/src/access/policy/writer.ts +0 -65
- package/src/label/retriever.ts +0 -63
- package/src/label/writer.ts +0 -95
- package/src/setupspecs.ts +0 -27
- package/src/signals/external.ts +0 -10
- package/src/signals/observable.ts +0 -42
|
@@ -9,7 +9,16 @@
|
|
|
9
9
|
"version": "1.0.0",
|
|
10
10
|
"license": "ISC",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@synnaxlabs/client": "^0.
|
|
12
|
+
"@synnaxlabs/client": "^0.43.0"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"node_modules/@msgpack/msgpack": {
|
|
16
|
+
"version": "3.1.2",
|
|
17
|
+
"resolved": "https://registry.npmjs.org/@msgpack/msgpack/-/msgpack-3.1.2.tgz",
|
|
18
|
+
"integrity": "sha512-JEW4DEtBzfe8HvUYecLU9e6+XJnKDlUAIve8FvPzF3Kzs6Xo/KuZkZJsDH0wJXl/qEZbeeE7edxDNY3kMs39hQ==",
|
|
19
|
+
"license": "ISC",
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">= 18"
|
|
13
22
|
}
|
|
14
23
|
},
|
|
15
24
|
"node_modules/@opentelemetry/api": {
|
|
@@ -22,50 +31,49 @@
|
|
|
22
31
|
}
|
|
23
32
|
},
|
|
24
33
|
"node_modules/@synnaxlabs/alamos": {
|
|
25
|
-
"version": "0.
|
|
26
|
-
"resolved": "https://registry.npmjs.org/@synnaxlabs/alamos/-/alamos-0.
|
|
27
|
-
"integrity": "sha512-
|
|
34
|
+
"version": "0.43.0",
|
|
35
|
+
"resolved": "https://registry.npmjs.org/@synnaxlabs/alamos/-/alamos-0.43.0.tgz",
|
|
36
|
+
"integrity": "sha512-NSBfO4eGLqEUuMvGqYEq8mdoezA/+mSFZR2+NJ7yQMbAsDE4yUWLol2RaakiZNV8rZk5vszEI/rc2BhY7RMdug==",
|
|
28
37
|
"license": "MIT",
|
|
29
38
|
"dependencies": {
|
|
30
39
|
"@opentelemetry/api": "^1.9.0",
|
|
31
|
-
"@synnaxlabs/x": "0.
|
|
32
|
-
},
|
|
33
|
-
"engines": {
|
|
34
|
-
"node": ">=18"
|
|
40
|
+
"@synnaxlabs/x": "0.43.0"
|
|
35
41
|
}
|
|
36
42
|
},
|
|
37
43
|
"node_modules/@synnaxlabs/client": {
|
|
38
|
-
"version": "0.
|
|
39
|
-
"resolved": "https://registry.npmjs.org/@synnaxlabs/client/-/client-0.
|
|
40
|
-
"integrity": "sha512-
|
|
44
|
+
"version": "0.43.0",
|
|
45
|
+
"resolved": "https://registry.npmjs.org/@synnaxlabs/client/-/client-0.43.0.tgz",
|
|
46
|
+
"integrity": "sha512-u+1IlU+R2jmy/sFJKc/9T9AeHvTERLhtVF2dWK3CcxrjyjNVNEzfOMBQXlEF4CZJtuMmiv4cgw5S7UL64hCW3w==",
|
|
41
47
|
"license": "BUSL-1.1",
|
|
42
48
|
"dependencies": {
|
|
43
|
-
"@synnaxlabs/freighter": "0.
|
|
44
|
-
"@synnaxlabs/x": "0.
|
|
49
|
+
"@synnaxlabs/freighter": "0.43.0",
|
|
50
|
+
"@synnaxlabs/x": "0.43.0",
|
|
45
51
|
"async-mutex": "^0.5.0",
|
|
46
|
-
"
|
|
47
|
-
"zod": "^3.24.1"
|
|
52
|
+
"zod": "^3.25.63"
|
|
48
53
|
}
|
|
49
54
|
},
|
|
50
55
|
"node_modules/@synnaxlabs/freighter": {
|
|
51
|
-
"version": "0.
|
|
52
|
-
"resolved": "https://registry.npmjs.org/@synnaxlabs/freighter/-/freighter-0.
|
|
53
|
-
"integrity": "sha512-
|
|
56
|
+
"version": "0.43.0",
|
|
57
|
+
"resolved": "https://registry.npmjs.org/@synnaxlabs/freighter/-/freighter-0.43.0.tgz",
|
|
58
|
+
"integrity": "sha512-b/TPZjgg1M9fdK1B8AkofhJ+fC47XqdUfjN/xPvVHzKx371bkr+LeYnVBN+FPhWP+20uL6SPxlGK5R/zWra6oQ==",
|
|
54
59
|
"dependencies": {
|
|
55
|
-
"@synnaxlabs/alamos": "0.
|
|
56
|
-
"@synnaxlabs/x": "0.
|
|
60
|
+
"@synnaxlabs/alamos": "0.43.0",
|
|
61
|
+
"@synnaxlabs/x": "0.43.0",
|
|
57
62
|
"node-fetch": "^2.7.0",
|
|
58
|
-
"ws": "^8.18.
|
|
59
|
-
"zod": "^3.
|
|
63
|
+
"ws": "^8.18.2",
|
|
64
|
+
"zod": "^3.25.63"
|
|
60
65
|
}
|
|
61
66
|
},
|
|
62
67
|
"node_modules/@synnaxlabs/x": {
|
|
63
|
-
"version": "0.
|
|
64
|
-
"resolved": "https://registry.npmjs.org/@synnaxlabs/x/-/x-0.
|
|
65
|
-
"integrity": "sha512-
|
|
68
|
+
"version": "0.43.0",
|
|
69
|
+
"resolved": "https://registry.npmjs.org/@synnaxlabs/x/-/x-0.43.0.tgz",
|
|
70
|
+
"integrity": "sha512-DsMuFjKtTvscfjEq3PeUhMdkHf9CuPUEyYGjGJhthqn19KftNRzoFqlPvvQsngq9bjv7shd4p0qaMOm4y/FimQ==",
|
|
66
71
|
"dependencies": {
|
|
67
|
-
"
|
|
68
|
-
"
|
|
72
|
+
"@msgpack/msgpack": "^3.1.2",
|
|
73
|
+
"async-mutex": "^0.5.0",
|
|
74
|
+
"nanoid": "^5.1.5",
|
|
75
|
+
"uuid": "^11.1.0",
|
|
76
|
+
"zod": "^3.25.63"
|
|
69
77
|
}
|
|
70
78
|
},
|
|
71
79
|
"node_modules/async-mutex": {
|
|
@@ -78,9 +86,9 @@
|
|
|
78
86
|
}
|
|
79
87
|
},
|
|
80
88
|
"node_modules/nanoid": {
|
|
81
|
-
"version": "5.
|
|
82
|
-
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.
|
|
83
|
-
"integrity": "sha512-
|
|
89
|
+
"version": "5.1.5",
|
|
90
|
+
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.1.5.tgz",
|
|
91
|
+
"integrity": "sha512-Ir/+ZpE9fDsNH0hQ3C68uyThDXzYcim2EqcZ8zn8Chtt1iylPT9xXJB0kPCnqzgcEGikO9RxSrh63MsmVCU7Fw==",
|
|
84
92
|
"funding": [
|
|
85
93
|
{
|
|
86
94
|
"type": "github",
|
|
@@ -128,9 +136,9 @@
|
|
|
128
136
|
"license": "0BSD"
|
|
129
137
|
},
|
|
130
138
|
"node_modules/uuid": {
|
|
131
|
-
"version": "11.0
|
|
132
|
-
"resolved": "https://registry.npmjs.org/uuid/-/uuid-11.0.
|
|
133
|
-
"integrity": "sha512-
|
|
139
|
+
"version": "11.1.0",
|
|
140
|
+
"resolved": "https://registry.npmjs.org/uuid/-/uuid-11.1.0.tgz",
|
|
141
|
+
"integrity": "sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==",
|
|
134
142
|
"funding": [
|
|
135
143
|
"https://github.com/sponsors/broofa",
|
|
136
144
|
"https://github.com/sponsors/ctavan"
|
|
@@ -157,9 +165,9 @@
|
|
|
157
165
|
}
|
|
158
166
|
},
|
|
159
167
|
"node_modules/ws": {
|
|
160
|
-
"version": "8.18.
|
|
161
|
-
"resolved": "https://registry.npmjs.org/ws/-/ws-8.18.
|
|
162
|
-
"integrity": "sha512-
|
|
168
|
+
"version": "8.18.2",
|
|
169
|
+
"resolved": "https://registry.npmjs.org/ws/-/ws-8.18.2.tgz",
|
|
170
|
+
"integrity": "sha512-DMricUmwGZUVr++AEAe2uiVM7UoO9MAVZMDu05UQOaUII0lp+zOzLLU4Xqh/JvTqklB1T4uELaaPBKyjE1r4fQ==",
|
|
163
171
|
"license": "MIT",
|
|
164
172
|
"engines": {
|
|
165
173
|
"node": ">=10.0.0"
|
|
@@ -178,9 +186,9 @@
|
|
|
178
186
|
}
|
|
179
187
|
},
|
|
180
188
|
"node_modules/zod": {
|
|
181
|
-
"version": "3.
|
|
182
|
-
"resolved": "https://registry.npmjs.org/zod/-/zod-3.
|
|
183
|
-
"integrity": "sha512-
|
|
189
|
+
"version": "3.25.64",
|
|
190
|
+
"resolved": "https://registry.npmjs.org/zod/-/zod-3.25.64.tgz",
|
|
191
|
+
"integrity": "sha512-hbP9FpSZf7pkS7hRVUrOjhwKJNyampPgtXKc3AN6DsWtoHsg2Sb4SQaS4Tcay380zSwd2VPo9G9180emBACp5g==",
|
|
184
192
|
"license": "MIT",
|
|
185
193
|
"funding": {
|
|
186
194
|
"url": "https://github.com/sponsors/colinhacks"
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
"version": "1.0.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "index.js",
|
|
7
|
+
"private": true,
|
|
7
8
|
"scripts": {
|
|
8
9
|
"main": "node index.js"
|
|
9
10
|
},
|
|
@@ -11,6 +12,6 @@
|
|
|
11
12
|
"author": "",
|
|
12
13
|
"license": "ISC",
|
|
13
14
|
"dependencies": {
|
|
14
|
-
"@synnaxlabs/client": "^0.
|
|
15
|
+
"@synnaxlabs/client": "^0.43.0"
|
|
15
16
|
}
|
|
16
17
|
}
|
|
@@ -74,17 +74,11 @@ try {
|
|
|
74
74
|
const timestamp = TimeStamp.now();
|
|
75
75
|
const data1 = Math.sin(i / 10);
|
|
76
76
|
const data2 = i % 2;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}))
|
|
83
|
-
) {
|
|
84
|
-
console.error("Failed to write");
|
|
85
|
-
break;
|
|
86
|
-
}
|
|
87
|
-
|
|
77
|
+
await writer.write({
|
|
78
|
+
[timeChannel.key]: timestamp,
|
|
79
|
+
[dataChannel1.key]: data1,
|
|
80
|
+
[dataChannel2.key]: data2,
|
|
81
|
+
});
|
|
88
82
|
if (i % 60 == 0) console.log(`Writing sample ${i} at ${timestamp.toISOString()}`);
|
|
89
83
|
}
|
|
90
84
|
} finally {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synnaxlabs/client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.44.2",
|
|
4
4
|
"description": "The Synnax Client Library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"synnax",
|
|
@@ -25,20 +25,21 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"async-mutex": "^0.5.0",
|
|
28
|
-
"zod": "^
|
|
29
|
-
"@synnaxlabs/freighter": "0.
|
|
30
|
-
"@synnaxlabs/x": "0.
|
|
28
|
+
"zod": "^4.0.2",
|
|
29
|
+
"@synnaxlabs/freighter": "^0.44.0",
|
|
30
|
+
"@synnaxlabs/x": "^0.44.2"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@
|
|
34
|
-
"
|
|
33
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
34
|
+
"@types/node": "^24.0.12",
|
|
35
|
+
"eslint": "^9.30.1",
|
|
35
36
|
"madge": "^8.0.0",
|
|
36
37
|
"typescript": "^5.8.3",
|
|
37
|
-
"vite": "^
|
|
38
|
-
"vitest": "^3.2.
|
|
39
|
-
"@synnaxlabs/tsconfig": "0.0
|
|
40
|
-
"@synnaxlabs/vite-plugin": "0.43.0",
|
|
41
|
-
"eslint-config-synnaxlabs": "0.43.0"
|
|
38
|
+
"vite": "^7.0.4",
|
|
39
|
+
"vitest": "^3.2.4",
|
|
40
|
+
"@synnaxlabs/tsconfig": "^0.43.0",
|
|
41
|
+
"@synnaxlabs/vite-plugin": "^0.43.0",
|
|
42
|
+
"eslint-config-synnaxlabs": "^0.43.0"
|
|
42
43
|
},
|
|
43
44
|
"type": "module",
|
|
44
45
|
"types": "dist/index.d.ts",
|
|
@@ -48,8 +49,8 @@
|
|
|
48
49
|
"check-types": "tsc --noEmit",
|
|
49
50
|
"watch": "tsc --noEmit && vite build --watch",
|
|
50
51
|
"test": "vitest",
|
|
51
|
-
"lint": "eslint
|
|
52
|
-
"fix": "eslint --
|
|
52
|
+
"lint": "eslint",
|
|
53
|
+
"fix": "eslint --fix",
|
|
53
54
|
"madge": "madge --circular src"
|
|
54
55
|
}
|
|
55
56
|
}
|
package/src/access/payload.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
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 { z } from "zod
|
|
10
|
+
import { z } from "zod";
|
|
11
11
|
|
|
12
12
|
export const ALL_ACTION = "all";
|
|
13
13
|
export const CREATE_ACTION = "create";
|
|
@@ -7,60 +7,115 @@
|
|
|
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 UnaryClient } from "@synnaxlabs/freighter";
|
|
10
|
+
import { sendRequired, type UnaryClient } from "@synnaxlabs/freighter";
|
|
11
11
|
import { array } from "@synnaxlabs/x";
|
|
12
|
+
import { z } from "zod";
|
|
12
13
|
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
import {
|
|
15
|
+
type Key,
|
|
16
|
+
keyZ,
|
|
17
|
+
type New,
|
|
18
|
+
newZ,
|
|
19
|
+
type Policy,
|
|
20
|
+
policyZ,
|
|
21
|
+
} from "@/access/policy/payload";
|
|
17
22
|
import { ontology } from "@/ontology";
|
|
23
|
+
import { nullableArrayZ } from "@/util/zod";
|
|
24
|
+
|
|
25
|
+
const retrieveRequestZ = z.object({
|
|
26
|
+
keys: keyZ.array().optional(),
|
|
27
|
+
subjects: ontology.idZ.array().optional(),
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const keyRetrieveRequestZ = z
|
|
31
|
+
.object({ key: keyZ })
|
|
32
|
+
.transform(({ key }) => ({ keys: [key] }));
|
|
33
|
+
|
|
34
|
+
const listRetrieveArgsZ = z.union([
|
|
35
|
+
z
|
|
36
|
+
.object({ for: ontology.idZ })
|
|
37
|
+
.transform(({ for: forId }) => ({ subjects: [forId] })),
|
|
38
|
+
z
|
|
39
|
+
.object({ for: ontology.idZ.array() })
|
|
40
|
+
.transform(({ for: forIds }) => ({ subjects: forIds })),
|
|
41
|
+
retrieveRequestZ,
|
|
42
|
+
]);
|
|
43
|
+
|
|
44
|
+
export type SingleRetrieveArgs = z.input<typeof keyRetrieveRequestZ>;
|
|
45
|
+
export type ListRetrieveArgs = z.input<typeof listRetrieveArgsZ>;
|
|
46
|
+
|
|
47
|
+
const retrieveArgsZ = z.union([keyRetrieveRequestZ, listRetrieveArgsZ]);
|
|
48
|
+
|
|
49
|
+
export type RetrieveArgs = z.input<typeof retrieveArgsZ>;
|
|
50
|
+
|
|
51
|
+
const retrieveResZ = z.object({ policies: nullableArrayZ(policyZ) });
|
|
52
|
+
|
|
53
|
+
const createReqZ = z.object({ policies: policyZ.partial({ key: true }).array() });
|
|
54
|
+
const createResZ = z.object({ policies: policyZ.array() });
|
|
55
|
+
const deleteReqZ = z.object({ keys: keyZ.array() });
|
|
56
|
+
const deleteResZ = z.object({});
|
|
57
|
+
|
|
58
|
+
const RETRIEVE_ENDPOINT = "/access/policy/retrieve";
|
|
59
|
+
const CREATE_ENDPOINT = "/access/policy/create";
|
|
60
|
+
const DELETE_ENDPOINT = "/access/policy/delete";
|
|
18
61
|
|
|
19
62
|
export class Client {
|
|
20
|
-
private readonly
|
|
21
|
-
private readonly writer: Writer;
|
|
63
|
+
private readonly client: UnaryClient;
|
|
22
64
|
|
|
23
65
|
constructor(client: UnaryClient) {
|
|
24
|
-
this.
|
|
25
|
-
this.writer = new Writer(client);
|
|
66
|
+
this.client = client;
|
|
26
67
|
}
|
|
27
68
|
|
|
28
69
|
async create(policy: New): Promise<Policy>;
|
|
29
70
|
async create(policies: New[]): Promise<Policy[]>;
|
|
30
71
|
async create(policies: New | New[]): Promise<Policy | Policy[]> {
|
|
31
72
|
const isMany = Array.isArray(policies);
|
|
32
|
-
const
|
|
33
|
-
|
|
73
|
+
const parsedPolicies = newZ.array().parse(array.toArray(policies));
|
|
74
|
+
const req = parsedPolicies.map((policy) => ({
|
|
75
|
+
objects: array.toArray(policy.objects),
|
|
76
|
+
actions: array.toArray(policy.actions),
|
|
77
|
+
subjects: array.toArray(policy.subjects),
|
|
78
|
+
}));
|
|
79
|
+
const res = await sendRequired<typeof createReqZ, typeof createResZ>(
|
|
80
|
+
this.client,
|
|
81
|
+
CREATE_ENDPOINT,
|
|
82
|
+
{ policies: req },
|
|
83
|
+
createReqZ,
|
|
84
|
+
createResZ,
|
|
85
|
+
);
|
|
86
|
+
return isMany ? res.policies : res.policies[0];
|
|
34
87
|
}
|
|
35
88
|
|
|
36
|
-
async retrieve(
|
|
37
|
-
async retrieve(
|
|
38
|
-
async retrieve(
|
|
39
|
-
const
|
|
40
|
-
const res = await
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
): Promise<Policy[]> {
|
|
49
|
-
const newIds = array.toArray(subjects).map((id) => new ontology.ID(id).payload);
|
|
50
|
-
return await this.retriever.retrieve({ subjects: newIds });
|
|
89
|
+
async retrieve(args: SingleRetrieveArgs): Promise<Policy>;
|
|
90
|
+
async retrieve(args: ListRetrieveArgs): Promise<Policy[]>;
|
|
91
|
+
async retrieve(args: RetrieveArgs): Promise<Policy | Policy[]> {
|
|
92
|
+
const isSingle = "key" in args;
|
|
93
|
+
const res = await sendRequired<typeof retrieveArgsZ, typeof retrieveResZ>(
|
|
94
|
+
this.client,
|
|
95
|
+
RETRIEVE_ENDPOINT,
|
|
96
|
+
args,
|
|
97
|
+
retrieveArgsZ,
|
|
98
|
+
retrieveResZ,
|
|
99
|
+
);
|
|
100
|
+
return isSingle ? res.policies[0] : res.policies;
|
|
51
101
|
}
|
|
52
102
|
|
|
53
103
|
async delete(key: Key): Promise<void>;
|
|
54
104
|
async delete(keys: Key[]): Promise<void>;
|
|
55
105
|
async delete(keys: Key | Key[]): Promise<void> {
|
|
56
|
-
await
|
|
106
|
+
await sendRequired<typeof deleteReqZ, typeof deleteResZ>(
|
|
107
|
+
this.client,
|
|
108
|
+
DELETE_ENDPOINT,
|
|
109
|
+
{ keys: array.toArray(keys) },
|
|
110
|
+
deleteReqZ,
|
|
111
|
+
deleteResZ,
|
|
112
|
+
);
|
|
57
113
|
}
|
|
58
114
|
}
|
|
59
115
|
|
|
60
|
-
export const ontologyID = (key: Key): ontology.ID =>
|
|
61
|
-
new ontology.ID({ type: ONTOLOGY_TYPE, key });
|
|
116
|
+
export const ontologyID = (key: Key): ontology.ID => ({ type: "policy", key });
|
|
62
117
|
|
|
63
|
-
export const ALLOW_ALL_ONTOLOGY_ID
|
|
64
|
-
type:
|
|
118
|
+
export const ALLOW_ALL_ONTOLOGY_ID: ontology.ID = {
|
|
119
|
+
type: "allow_all",
|
|
65
120
|
key: "",
|
|
66
|
-
}
|
|
121
|
+
};
|
|
@@ -7,13 +7,13 @@
|
|
|
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 { z } from "zod
|
|
10
|
+
import { z } from "zod";
|
|
11
11
|
|
|
12
12
|
import { actionZ } from "@/access/payload";
|
|
13
13
|
import { ontology } from "@/ontology";
|
|
14
14
|
import { nullableArrayZ } from "@/util/zod";
|
|
15
15
|
|
|
16
|
-
export const keyZ = z.
|
|
16
|
+
export const keyZ = z.uuid();
|
|
17
17
|
export type Key = z.infer<typeof keyZ>;
|
|
18
18
|
|
|
19
19
|
export const policyZ = z.object({
|
|
@@ -26,8 +26,8 @@ export interface Policy extends z.infer<typeof policyZ> {}
|
|
|
26
26
|
|
|
27
27
|
export const newZ = z.object({
|
|
28
28
|
key: keyZ.optional(),
|
|
29
|
-
subjects: ontology.
|
|
30
|
-
objects: ontology.
|
|
29
|
+
subjects: ontology.idZ.array().or(ontology.idZ),
|
|
30
|
+
objects: ontology.idZ.array().or(ontology.idZ),
|
|
31
31
|
actions: actionZ.array().or(actionZ),
|
|
32
32
|
});
|
|
33
33
|
export interface New extends z.input<typeof newZ> {}
|