@synnaxlabs/client 0.15.3 → 0.16.4
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 +5 -5
- package/README.md +11 -2
- package/dist/channel/client.d.ts +147 -15
- package/dist/client.cjs +21 -0
- package/dist/client.cjs.map +1 -0
- package/dist/client.d.ts +1 -1
- package/dist/{client.es.js → client.js} +4782 -4656
- package/dist/client.js.map +1 -0
- package/dist/errors.d.ts +4 -0
- package/dist/ontology/payload.d.ts +38 -38
- package/examples/node/basicReadWriter.js +37 -0
- package/examples/node/package-lock.json +4961 -0
- package/examples/node/package.json +16 -0
- package/package.json +7 -7
- package/src/channel/channel.spec.ts +19 -2
- package/src/channel/client.ts +170 -38
- package/src/channel/payload.ts +2 -2
- package/src/client.ts +10 -5
- package/src/connection/checker.ts +5 -1
- package/src/errors.ts +4 -0
- package/src/framer/client.ts +6 -2
- package/src/framer/streamer.spec.ts +1 -0
- package/dist/client.cjs.js +0 -21
- package/dist/client.cjs.js.map +0 -1
- package/dist/client.es.js.map +0 -1
package/dist/errors.d.ts
CHANGED
|
@@ -39,6 +39,10 @@ export declare class UnexpectedError extends BaseError {
|
|
|
39
39
|
*/
|
|
40
40
|
export declare class QueryError extends BaseError {
|
|
41
41
|
}
|
|
42
|
+
export declare class NoResultsError extends QueryError {
|
|
43
|
+
}
|
|
44
|
+
export declare class MultipleResultsError extends QueryError {
|
|
45
|
+
}
|
|
42
46
|
/**
|
|
43
47
|
* RouteError is raised when a routing error occurs.
|
|
44
48
|
*/
|
|
@@ -6,27 +6,27 @@ export declare const idZ: z.ZodObject<{
|
|
|
6
6
|
key: z.ZodString;
|
|
7
7
|
}, "strip", z.ZodTypeAny, {
|
|
8
8
|
key: string;
|
|
9
|
-
type: "user" | "cluster" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot"
|
|
9
|
+
type: "user" | "cluster" | "rack" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot";
|
|
10
10
|
}, {
|
|
11
11
|
key: string;
|
|
12
|
-
type: "user" | "cluster" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot"
|
|
12
|
+
type: "user" | "cluster" | "rack" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot";
|
|
13
13
|
}>;
|
|
14
14
|
export declare const stringIDZ: z.ZodEffects<z.ZodString, {
|
|
15
|
-
type: "user" | "cluster" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot"
|
|
15
|
+
type: "user" | "cluster" | "rack" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot";
|
|
16
16
|
key: string;
|
|
17
17
|
}, string>;
|
|
18
18
|
export declare const crudeIDZ: z.ZodUnion<[z.ZodEffects<z.ZodString, {
|
|
19
|
-
type: "user" | "cluster" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot"
|
|
19
|
+
type: "user" | "cluster" | "rack" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot";
|
|
20
20
|
key: string;
|
|
21
21
|
}, string>, z.ZodObject<{
|
|
22
22
|
type: z.ZodUnion<[z.ZodLiteral<"label">, z.ZodLiteral<"builtin">, z.ZodLiteral<"cluster">, z.ZodLiteral<"channel">, z.ZodLiteral<"node">, z.ZodLiteral<"group">, z.ZodLiteral<"range">, z.ZodLiteral<"range-alias">, z.ZodLiteral<"user">, z.ZodLiteral<"workspace">, z.ZodLiteral<"pid">, z.ZodLiteral<"lineplot">, z.ZodLiteral<"rack">]>;
|
|
23
23
|
key: z.ZodString;
|
|
24
24
|
}, "strip", z.ZodTypeAny, {
|
|
25
25
|
key: string;
|
|
26
|
-
type: "user" | "cluster" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot"
|
|
26
|
+
type: "user" | "cluster" | "rack" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot";
|
|
27
27
|
}, {
|
|
28
28
|
key: string;
|
|
29
|
-
type: "user" | "cluster" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot"
|
|
29
|
+
type: "user" | "cluster" | "rack" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot";
|
|
30
30
|
}>]>;
|
|
31
31
|
export declare class ID {
|
|
32
32
|
type: ResourceType;
|
|
@@ -35,20 +35,20 @@ export declare class ID {
|
|
|
35
35
|
toString(): string;
|
|
36
36
|
get payload(): z.infer<typeof idZ>;
|
|
37
37
|
static readonly z: z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodEffects<z.ZodString, {
|
|
38
|
-
type: "user" | "cluster" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot"
|
|
38
|
+
type: "user" | "cluster" | "rack" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot";
|
|
39
39
|
key: string;
|
|
40
40
|
}, string>, z.ZodObject<{
|
|
41
41
|
type: z.ZodUnion<[z.ZodLiteral<"label">, z.ZodLiteral<"builtin">, z.ZodLiteral<"cluster">, z.ZodLiteral<"channel">, z.ZodLiteral<"node">, z.ZodLiteral<"group">, z.ZodLiteral<"range">, z.ZodLiteral<"range-alias">, z.ZodLiteral<"user">, z.ZodLiteral<"workspace">, z.ZodLiteral<"pid">, z.ZodLiteral<"lineplot">, z.ZodLiteral<"rack">]>;
|
|
42
42
|
key: z.ZodString;
|
|
43
43
|
}, "strip", z.ZodTypeAny, {
|
|
44
44
|
key: string;
|
|
45
|
-
type: "user" | "cluster" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot"
|
|
45
|
+
type: "user" | "cluster" | "rack" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot";
|
|
46
46
|
}, {
|
|
47
47
|
key: string;
|
|
48
|
-
type: "user" | "cluster" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot"
|
|
48
|
+
type: "user" | "cluster" | "rack" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot";
|
|
49
49
|
}>]>, z.ZodType<ID, z.ZodTypeDef, ID>]>, ID, string | ID | {
|
|
50
50
|
key: string;
|
|
51
|
-
type: "user" | "cluster" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot"
|
|
51
|
+
type: "user" | "cluster" | "rack" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot";
|
|
52
52
|
}>;
|
|
53
53
|
}
|
|
54
54
|
export declare const Root: ID;
|
|
@@ -70,12 +70,12 @@ export declare const schemaZ: z.ZodObject<{
|
|
|
70
70
|
type: number;
|
|
71
71
|
}>>;
|
|
72
72
|
}, "strip", z.ZodTypeAny, {
|
|
73
|
-
type: "user" | "cluster" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot"
|
|
73
|
+
type: "user" | "cluster" | "rack" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot";
|
|
74
74
|
fields: Record<string, {
|
|
75
75
|
type: number;
|
|
76
76
|
}>;
|
|
77
77
|
}, {
|
|
78
|
-
type: "user" | "cluster" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot"
|
|
78
|
+
type: "user" | "cluster" | "rack" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot";
|
|
79
79
|
fields: Record<string, {
|
|
80
80
|
type: number;
|
|
81
81
|
}>;
|
|
@@ -83,20 +83,20 @@ export declare const schemaZ: z.ZodObject<{
|
|
|
83
83
|
export type Schema = z.infer<typeof schemaZ>;
|
|
84
84
|
export declare const resourceSchemaZ: z.ZodEffects<z.ZodObject<{
|
|
85
85
|
id: z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodEffects<z.ZodString, {
|
|
86
|
-
type: "user" | "cluster" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot"
|
|
86
|
+
type: "user" | "cluster" | "rack" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot";
|
|
87
87
|
key: string;
|
|
88
88
|
}, string>, z.ZodObject<{
|
|
89
89
|
type: z.ZodUnion<[z.ZodLiteral<"label">, z.ZodLiteral<"builtin">, z.ZodLiteral<"cluster">, z.ZodLiteral<"channel">, z.ZodLiteral<"node">, z.ZodLiteral<"group">, z.ZodLiteral<"range">, z.ZodLiteral<"range-alias">, z.ZodLiteral<"user">, z.ZodLiteral<"workspace">, z.ZodLiteral<"pid">, z.ZodLiteral<"lineplot">, z.ZodLiteral<"rack">]>;
|
|
90
90
|
key: z.ZodString;
|
|
91
91
|
}, "strip", z.ZodTypeAny, {
|
|
92
92
|
key: string;
|
|
93
|
-
type: "user" | "cluster" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot"
|
|
93
|
+
type: "user" | "cluster" | "rack" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot";
|
|
94
94
|
}, {
|
|
95
95
|
key: string;
|
|
96
|
-
type: "user" | "cluster" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot"
|
|
96
|
+
type: "user" | "cluster" | "rack" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot";
|
|
97
97
|
}>]>, z.ZodType<ID, z.ZodTypeDef, ID>]>, ID, string | ID | {
|
|
98
98
|
key: string;
|
|
99
|
-
type: "user" | "cluster" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot"
|
|
99
|
+
type: "user" | "cluster" | "rack" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot";
|
|
100
100
|
}>;
|
|
101
101
|
name: z.ZodString;
|
|
102
102
|
schema: z.ZodOptional<z.ZodObject<{
|
|
@@ -109,12 +109,12 @@ export declare const resourceSchemaZ: z.ZodEffects<z.ZodObject<{
|
|
|
109
109
|
type: number;
|
|
110
110
|
}>>;
|
|
111
111
|
}, "strip", z.ZodTypeAny, {
|
|
112
|
-
type: "user" | "cluster" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot"
|
|
112
|
+
type: "user" | "cluster" | "rack" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot";
|
|
113
113
|
fields: Record<string, {
|
|
114
114
|
type: number;
|
|
115
115
|
}>;
|
|
116
116
|
}, {
|
|
117
|
-
type: "user" | "cluster" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot"
|
|
117
|
+
type: "user" | "cluster" | "rack" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot";
|
|
118
118
|
fields: Record<string, {
|
|
119
119
|
type: number;
|
|
120
120
|
}>;
|
|
@@ -124,7 +124,7 @@ export declare const resourceSchemaZ: z.ZodEffects<z.ZodObject<{
|
|
|
124
124
|
name: string;
|
|
125
125
|
id: ID;
|
|
126
126
|
schema?: {
|
|
127
|
-
type: "user" | "cluster" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot"
|
|
127
|
+
type: "user" | "cluster" | "rack" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot";
|
|
128
128
|
fields: Record<string, {
|
|
129
129
|
type: number;
|
|
130
130
|
}>;
|
|
@@ -134,13 +134,13 @@ export declare const resourceSchemaZ: z.ZodEffects<z.ZodObject<{
|
|
|
134
134
|
name: string;
|
|
135
135
|
id: (string | ID | {
|
|
136
136
|
key: string;
|
|
137
|
-
type: "user" | "cluster" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot"
|
|
137
|
+
type: "user" | "cluster" | "rack" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot";
|
|
138
138
|
}) & (string | ID | {
|
|
139
139
|
key: string;
|
|
140
|
-
type: "user" | "cluster" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot"
|
|
140
|
+
type: "user" | "cluster" | "rack" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot";
|
|
141
141
|
} | undefined);
|
|
142
142
|
schema?: {
|
|
143
|
-
type: "user" | "cluster" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot"
|
|
143
|
+
type: "user" | "cluster" | "rack" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot";
|
|
144
144
|
fields: Record<string, {
|
|
145
145
|
type: number;
|
|
146
146
|
}>;
|
|
@@ -150,7 +150,7 @@ export declare const resourceSchemaZ: z.ZodEffects<z.ZodObject<{
|
|
|
150
150
|
name: string;
|
|
151
151
|
id: ID;
|
|
152
152
|
schema?: {
|
|
153
|
-
type: "user" | "cluster" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot"
|
|
153
|
+
type: "user" | "cluster" | "rack" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot";
|
|
154
154
|
fields: Record<string, {
|
|
155
155
|
type: number;
|
|
156
156
|
}>;
|
|
@@ -161,13 +161,13 @@ export declare const resourceSchemaZ: z.ZodEffects<z.ZodObject<{
|
|
|
161
161
|
name: string;
|
|
162
162
|
id: (string | ID | {
|
|
163
163
|
key: string;
|
|
164
|
-
type: "user" | "cluster" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot"
|
|
164
|
+
type: "user" | "cluster" | "rack" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot";
|
|
165
165
|
}) & (string | ID | {
|
|
166
166
|
key: string;
|
|
167
|
-
type: "user" | "cluster" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot"
|
|
167
|
+
type: "user" | "cluster" | "rack" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot";
|
|
168
168
|
} | undefined);
|
|
169
169
|
schema?: {
|
|
170
|
-
type: "user" | "cluster" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot"
|
|
170
|
+
type: "user" | "cluster" | "rack" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot";
|
|
171
171
|
fields: Record<string, {
|
|
172
172
|
type: number;
|
|
173
173
|
}>;
|
|
@@ -177,37 +177,37 @@ export declare const resourceSchemaZ: z.ZodEffects<z.ZodObject<{
|
|
|
177
177
|
export type Resource = z.infer<typeof resourceSchemaZ>;
|
|
178
178
|
export declare const relationshipSchemaZ: z.ZodObject<{
|
|
179
179
|
from: z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodEffects<z.ZodString, {
|
|
180
|
-
type: "user" | "cluster" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot"
|
|
180
|
+
type: "user" | "cluster" | "rack" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot";
|
|
181
181
|
key: string;
|
|
182
182
|
}, string>, z.ZodObject<{
|
|
183
183
|
type: z.ZodUnion<[z.ZodLiteral<"label">, z.ZodLiteral<"builtin">, z.ZodLiteral<"cluster">, z.ZodLiteral<"channel">, z.ZodLiteral<"node">, z.ZodLiteral<"group">, z.ZodLiteral<"range">, z.ZodLiteral<"range-alias">, z.ZodLiteral<"user">, z.ZodLiteral<"workspace">, z.ZodLiteral<"pid">, z.ZodLiteral<"lineplot">, z.ZodLiteral<"rack">]>;
|
|
184
184
|
key: z.ZodString;
|
|
185
185
|
}, "strip", z.ZodTypeAny, {
|
|
186
186
|
key: string;
|
|
187
|
-
type: "user" | "cluster" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot"
|
|
187
|
+
type: "user" | "cluster" | "rack" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot";
|
|
188
188
|
}, {
|
|
189
189
|
key: string;
|
|
190
|
-
type: "user" | "cluster" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot"
|
|
190
|
+
type: "user" | "cluster" | "rack" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot";
|
|
191
191
|
}>]>, z.ZodType<ID, z.ZodTypeDef, ID>]>, ID, string | ID | {
|
|
192
192
|
key: string;
|
|
193
|
-
type: "user" | "cluster" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot"
|
|
193
|
+
type: "user" | "cluster" | "rack" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot";
|
|
194
194
|
}>;
|
|
195
195
|
type: z.ZodString;
|
|
196
196
|
to: z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodEffects<z.ZodString, {
|
|
197
|
-
type: "user" | "cluster" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot"
|
|
197
|
+
type: "user" | "cluster" | "rack" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot";
|
|
198
198
|
key: string;
|
|
199
199
|
}, string>, z.ZodObject<{
|
|
200
200
|
type: z.ZodUnion<[z.ZodLiteral<"label">, z.ZodLiteral<"builtin">, z.ZodLiteral<"cluster">, z.ZodLiteral<"channel">, z.ZodLiteral<"node">, z.ZodLiteral<"group">, z.ZodLiteral<"range">, z.ZodLiteral<"range-alias">, z.ZodLiteral<"user">, z.ZodLiteral<"workspace">, z.ZodLiteral<"pid">, z.ZodLiteral<"lineplot">, z.ZodLiteral<"rack">]>;
|
|
201
201
|
key: z.ZodString;
|
|
202
202
|
}, "strip", z.ZodTypeAny, {
|
|
203
203
|
key: string;
|
|
204
|
-
type: "user" | "cluster" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot"
|
|
204
|
+
type: "user" | "cluster" | "rack" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot";
|
|
205
205
|
}, {
|
|
206
206
|
key: string;
|
|
207
|
-
type: "user" | "cluster" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot"
|
|
207
|
+
type: "user" | "cluster" | "rack" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot";
|
|
208
208
|
}>]>, z.ZodType<ID, z.ZodTypeDef, ID>]>, ID, string | ID | {
|
|
209
209
|
key: string;
|
|
210
|
-
type: "user" | "cluster" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot"
|
|
210
|
+
type: "user" | "cluster" | "rack" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot";
|
|
211
211
|
}>;
|
|
212
212
|
}, "strip", z.ZodTypeAny, {
|
|
213
213
|
type: string;
|
|
@@ -217,17 +217,17 @@ export declare const relationshipSchemaZ: z.ZodObject<{
|
|
|
217
217
|
type: string;
|
|
218
218
|
from: (string | ID | {
|
|
219
219
|
key: string;
|
|
220
|
-
type: "user" | "cluster" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot"
|
|
220
|
+
type: "user" | "cluster" | "rack" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot";
|
|
221
221
|
}) & (string | ID | {
|
|
222
222
|
key: string;
|
|
223
|
-
type: "user" | "cluster" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot"
|
|
223
|
+
type: "user" | "cluster" | "rack" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot";
|
|
224
224
|
} | undefined);
|
|
225
225
|
to: (string | ID | {
|
|
226
226
|
key: string;
|
|
227
|
-
type: "user" | "cluster" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot"
|
|
227
|
+
type: "user" | "cluster" | "rack" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot";
|
|
228
228
|
}) & (string | ID | {
|
|
229
229
|
key: string;
|
|
230
|
-
type: "user" | "cluster" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot"
|
|
230
|
+
type: "user" | "cluster" | "rack" | "label" | "builtin" | "channel" | "node" | "group" | "range" | "range-alias" | "workspace" | "pid" | "lineplot";
|
|
231
231
|
} | undefined);
|
|
232
232
|
}>;
|
|
233
233
|
export type Relationship = z.infer<typeof relationshipSchemaZ>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { DataType, Synnax, TimeSpan, TimeStamp } from "@synnaxlabs/client";
|
|
2
|
+
|
|
3
|
+
const client = new Synnax({
|
|
4
|
+
host: "localhost",
|
|
5
|
+
port: 9090,
|
|
6
|
+
username: "synnax",
|
|
7
|
+
password: "seldon",
|
|
8
|
+
secure: false
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
const time_channel = await client.channels.create({
|
|
12
|
+
name: "basic_read_write_time",
|
|
13
|
+
isIndex: true,
|
|
14
|
+
dataType: DataType.TIMESTAMP
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const data_channel = await client.channels.create({
|
|
18
|
+
name: "basic_read_write_data",
|
|
19
|
+
isIndex: false,
|
|
20
|
+
dataType: DataType.FLOAT32,
|
|
21
|
+
index: time_channel.key,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const N_SAMPLES = 500;
|
|
25
|
+
|
|
26
|
+
const start = TimeStamp.now();
|
|
27
|
+
|
|
28
|
+
const data = Float32Array.from({ length: N_SAMPLES }, (_, i) => Math.sin(i / 100));
|
|
29
|
+
const time = BigInt64Array.from({ length: N_SAMPLES }, (_, i) => start.add(TimeSpan.milliseconds(i)).bigInt);
|
|
30
|
+
|
|
31
|
+
await client.telem.write("basic_read_write_time", start, time);
|
|
32
|
+
// console.log("HERE")
|
|
33
|
+
// // await data_channel.write(start, data);
|
|
34
|
+
|
|
35
|
+
console.log("HERE")
|
|
36
|
+
|
|
37
|
+
client.close();
|