@synnaxlabs/client 0.22.1 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +7 -6
- package/dist/auth/auth.d.ts.map +1 -1
- package/dist/channel/client.d.ts +14 -4
- package/dist/channel/client.d.ts.map +1 -1
- package/dist/channel/creator.d.ts +1 -1
- package/dist/channel/creator.d.ts.map +1 -1
- package/dist/channel/external.d.ts +1 -1
- package/dist/channel/external.d.ts.map +1 -1
- package/dist/channel/payload.d.ts +21 -8
- package/dist/channel/payload.d.ts.map +1 -1
- package/dist/channel/retriever.d.ts +6 -6
- package/dist/channel/retriever.d.ts.map +1 -1
- package/dist/channel/writer.d.ts +13 -1
- package/dist/channel/writer.d.ts.map +1 -1
- package/dist/client.cjs +17 -18
- package/dist/client.d.ts +4 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +5487 -13615
- package/dist/connection/checker.d.ts +4 -4
- package/dist/control/client.d.ts +9 -0
- package/dist/control/client.d.ts.map +1 -0
- package/dist/control/external.d.ts +1 -1
- package/dist/control/external.d.ts.map +1 -1
- package/dist/control/state.d.ts +17 -52
- package/dist/control/state.d.ts.map +1 -1
- package/dist/errors.d.ts +6 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/framer/adapter.d.ts +1 -1
- package/dist/framer/adapter.d.ts.map +1 -1
- package/dist/framer/client.d.ts +7 -5
- package/dist/framer/client.d.ts.map +1 -1
- package/dist/framer/deleter.d.ts +68 -0
- package/dist/framer/deleter.d.ts.map +1 -0
- package/dist/framer/deleter.spec.d.ts +2 -0
- package/dist/framer/deleter.spec.d.ts.map +1 -0
- package/dist/framer/frame.d.ts +45 -241
- package/dist/framer/frame.d.ts.map +1 -1
- package/dist/framer/iterator.d.ts +1 -1
- package/dist/framer/iterator.d.ts.map +1 -1
- package/dist/framer/streamProxy.d.ts.map +1 -1
- package/dist/framer/streamer.d.ts.map +1 -1
- package/dist/framer/writer.d.ts +86 -231
- package/dist/framer/writer.d.ts.map +1 -1
- package/dist/hardware/device/client.d.ts +9 -7
- package/dist/hardware/device/client.d.ts.map +1 -1
- package/dist/hardware/task/client.d.ts +17 -14
- package/dist/hardware/task/client.d.ts.map +1 -1
- package/dist/index.d.ts +12 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/label/client.d.ts.map +1 -1
- package/dist/label/external.d.ts +2 -2
- package/dist/label/external.d.ts.map +1 -1
- package/dist/label/writer.d.ts +4 -2
- package/dist/label/writer.d.ts.map +1 -1
- package/dist/ontology/client.d.ts +8 -8
- package/dist/ontology/client.d.ts.map +1 -1
- package/dist/ontology/group/client.d.ts +1 -1
- package/dist/ontology/group/client.d.ts.map +1 -1
- package/dist/ontology/group/external.d.ts +1 -1
- package/dist/ontology/group/external.d.ts.map +1 -1
- package/dist/ontology/group/writer.d.ts +1 -1
- package/dist/ontology/group/writer.d.ts.map +1 -1
- package/dist/ontology/payload.d.ts +14 -26
- package/dist/ontology/payload.d.ts.map +1 -1
- package/dist/ontology/writer.d.ts.map +1 -1
- package/dist/ranger/active.d.ts +1 -1
- package/dist/ranger/active.d.ts.map +1 -1
- package/dist/ranger/alias.d.ts.map +1 -1
- package/dist/ranger/client.d.ts +16 -100
- package/dist/ranger/client.d.ts.map +1 -1
- package/dist/ranger/external.d.ts +2 -2
- package/dist/ranger/external.d.ts.map +1 -1
- package/dist/ranger/kv.d.ts.map +1 -1
- package/dist/ranger/payload.d.ts +34 -270
- package/dist/ranger/payload.d.ts.map +1 -1
- package/dist/ranger/range.d.ts +1 -1
- package/dist/ranger/range.d.ts.map +1 -1
- package/dist/ranger/writer.d.ts.map +1 -1
- package/dist/transport.d.ts.map +1 -1
- package/dist/util/retrieve.d.ts.map +1 -1
- package/dist/util/zod.d.ts.map +1 -1
- package/dist/workspace/client.d.ts.map +1 -1
- package/dist/workspace/external.d.ts +1 -1
- package/dist/workspace/external.d.ts.map +1 -1
- package/dist/workspace/lineplot/client.d.ts +1 -1
- package/dist/workspace/lineplot/client.d.ts.map +1 -1
- package/dist/workspace/lineplot/external.d.ts +1 -1
- package/dist/workspace/lineplot/external.d.ts.map +1 -1
- package/dist/workspace/lineplot/payload.d.ts +2 -2
- package/dist/workspace/lineplot/retriever.d.ts.map +1 -1
- package/dist/workspace/lineplot/writer.d.ts +4 -4
- package/dist/workspace/lineplot/writer.d.ts.map +1 -1
- package/dist/workspace/payload.d.ts +6 -4
- package/dist/workspace/payload.d.ts.map +1 -1
- package/dist/workspace/retriever.d.ts.map +1 -1
- package/dist/workspace/schematic/client.d.ts.map +1 -1
- package/dist/workspace/schematic/external.d.ts +1 -1
- package/dist/workspace/schematic/external.d.ts.map +1 -1
- package/dist/workspace/schematic/payload.d.ts +2 -2
- package/dist/workspace/schematic/retriever.d.ts +1 -1
- package/dist/workspace/schematic/retriever.d.ts.map +1 -1
- package/dist/workspace/schematic/writer.d.ts +4 -4
- package/dist/workspace/schematic/writer.d.ts.map +1 -1
- package/dist/workspace/writer.d.ts +7 -5
- package/dist/workspace/writer.d.ts.map +1 -1
- package/eslint.config.js +12 -0
- package/examples/node/basicReadWrite.js +11 -2
- package/examples/node/liveStream.js +13 -4
- package/examples/node/seriesAndFrames.js +12 -3
- package/examples/node/streamWrite.js +15 -6
- package/package.json +11 -8
- package/src/auth/auth.spec.ts +7 -6
- package/src/auth/auth.ts +17 -13
- package/src/auth/index.ts +1 -1
- package/src/channel/batchRetriever.spec.ts +16 -5
- package/src/channel/channel.spec.ts +42 -4
- package/src/channel/client.ts +26 -9
- package/src/channel/creator.ts +2 -2
- package/src/channel/external.ts +2 -2
- package/src/channel/index.ts +1 -1
- package/src/channel/payload.ts +3 -1
- package/src/channel/retriever.ts +6 -4
- package/src/channel/writer.ts +23 -4
- package/src/client.ts +5 -3
- package/src/connection/checker.ts +1 -1
- package/src/connection/connection.spec.ts +1 -1
- package/src/connection/index.ts +1 -1
- package/src/control/client.ts +17 -0
- package/src/control/external.ts +2 -2
- package/src/control/index.ts +1 -1
- package/src/control/state.spec.ts +2 -3
- package/src/control/state.ts +20 -84
- package/src/errors.ts +18 -7
- package/src/framer/adapter.spec.ts +9 -0
- package/src/framer/adapter.ts +3 -3
- package/src/framer/client.spec.ts +1 -1
- package/src/framer/client.ts +30 -12
- package/src/framer/deleter.spec.ts +129 -0
- package/src/framer/deleter.ts +49 -0
- package/src/framer/external.ts +1 -1
- package/src/framer/frame.spec.ts +1 -1
- package/src/framer/frame.ts +14 -14
- package/src/framer/index.ts +1 -1
- package/src/framer/iterator.spec.ts +2 -2
- package/src/framer/iterator.ts +2 -2
- package/src/framer/streamProxy.ts +2 -4
- package/src/framer/streamer.spec.ts +2 -2
- package/src/framer/streamer.ts +6 -5
- package/src/framer/writer.spec.ts +18 -1
- package/src/framer/writer.ts +19 -27
- package/src/hardware/device/client.ts +2 -2
- package/src/hardware/device/index.ts +1 -1
- package/src/hardware/external.ts +1 -1
- package/src/hardware/index.ts +1 -1
- package/src/hardware/rack/rack.spec.ts +1 -1
- package/src/hardware/task/client.ts +3 -3
- package/src/hardware/task/task.spec.ts +2 -2
- package/src/index.ts +26 -25
- package/src/label/client.ts +2 -2
- package/src/label/external.ts +3 -3
- package/src/label/index.ts +1 -1
- package/src/label/label.spec.ts +1 -1
- package/src/label/payload.ts +1 -1
- package/src/label/retriever.ts +1 -1
- package/src/label/writer.ts +1 -1
- package/src/ontology/client.ts +7 -7
- package/src/ontology/external.ts +1 -1
- package/src/ontology/group/client.ts +3 -3
- package/src/ontology/group/external.ts +2 -2
- package/src/ontology/group/group.spec.ts +2 -2
- package/src/ontology/group/group.ts +1 -1
- package/src/ontology/group/index.ts +1 -1
- package/src/ontology/group/payload.ts +1 -1
- package/src/ontology/group/writer.ts +22 -6
- package/src/ontology/index.ts +1 -1
- package/src/ontology/ontology.spec.ts +2 -2
- package/src/ontology/payload.ts +3 -3
- package/src/ontology/writer.ts +2 -2
- package/src/ranger/active.ts +2 -2
- package/src/ranger/alias.ts +2 -2
- package/src/ranger/client.ts +15 -16
- package/src/ranger/external.ts +3 -3
- package/src/ranger/index.ts +1 -1
- package/src/ranger/kv.ts +2 -2
- package/src/ranger/payload.ts +1 -1
- package/src/ranger/range.ts +2 -2
- package/src/ranger/ranger.spec.ts +1 -1
- package/src/ranger/writer.ts +3 -3
- package/src/setupspecs.ts +1 -1
- package/src/signals/external.ts +1 -1
- package/src/signals/index.ts +1 -1
- package/src/signals/observable.ts +1 -1
- package/src/transport.ts +2 -2
- package/src/user/index.ts +1 -1
- package/src/user/payload.ts +1 -1
- package/src/util/retrieve.spec.ts +1 -1
- package/src/util/retrieve.ts +1 -1
- package/src/util/telem.ts +1 -1
- package/src/util/zod.ts +9 -0
- package/src/vite-env.d.ts +2 -2
- package/src/workspace/client.ts +2 -2
- package/src/workspace/external.ts +2 -2
- package/src/workspace/index.ts +1 -1
- package/src/workspace/lineplot/client.ts +2 -2
- package/src/workspace/lineplot/external.ts +2 -2
- package/src/workspace/lineplot/index.ts +1 -1
- package/src/workspace/lineplot/linePlot.spec.ts +2 -2
- package/src/workspace/lineplot/payload.ts +1 -1
- package/src/workspace/lineplot/retriever.ts +4 -10
- package/src/workspace/lineplot/writer.ts +4 -4
- package/src/workspace/payload.ts +3 -6
- package/src/workspace/retriever.ts +4 -8
- package/src/workspace/schematic/client.ts +2 -2
- package/src/workspace/schematic/external.ts +2 -2
- package/src/workspace/schematic/index.ts +1 -1
- package/src/workspace/schematic/payload.ts +1 -1
- package/src/workspace/schematic/retriever.ts +17 -18
- package/src/workspace/schematic/schematic.spec.ts +2 -2
- package/src/workspace/schematic/writer.ts +5 -5
- package/src/workspace/workspace.spec.ts +2 -2
- package/src/workspace/writer.ts +3 -3
- package/vite.config.ts +3 -4
- package/.eslintrc.cjs +0 -18
- package/dist/client.cjs.map +0 -1
- package/dist/client.js.map +0 -1
- package/dist/control/authority.d.ts +0 -8
- package/dist/control/authority.d.ts.map +0 -1
- package/src/control/authority.ts +0 -26
package/src/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2024 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Use of this software is governed by the Business Source License included in the file
|
|
4
4
|
// licenses/BSL.txt.
|
|
@@ -8,10 +8,11 @@
|
|
|
8
8
|
// included in the file licenses/APL.txt.
|
|
9
9
|
|
|
10
10
|
export * from "@/channel";
|
|
11
|
-
export {
|
|
11
|
+
export { Channel } from "@/channel/client";
|
|
12
12
|
export type { SynnaxProps } from "@/client";
|
|
13
|
+
export { default as Synnax, synnaxPropsZ } from "@/client";
|
|
13
14
|
export * from "@/connection";
|
|
14
|
-
export {
|
|
15
|
+
export { control } from "@/control";
|
|
15
16
|
export {
|
|
16
17
|
AuthError,
|
|
17
18
|
ContiguityError,
|
|
@@ -22,37 +23,37 @@ export {
|
|
|
22
23
|
} from "@/errors";
|
|
23
24
|
export { framer } from "@/framer";
|
|
24
25
|
export { Frame } from "@/framer/frame";
|
|
26
|
+
export { hardware } from "@/hardware";
|
|
27
|
+
export { device } from "@/hardware/device";
|
|
28
|
+
export { rack } from "@/hardware/rack";
|
|
29
|
+
export { task } from "@/hardware/task";
|
|
30
|
+
export { label } from "@/label";
|
|
25
31
|
export { ontology } from "@/ontology";
|
|
26
|
-
export {
|
|
27
|
-
export {
|
|
28
|
-
export {
|
|
29
|
-
DataType,
|
|
30
|
-
Density,
|
|
31
|
-
Rate,
|
|
32
|
-
Series,
|
|
33
|
-
TimeRange,
|
|
34
|
-
TimeSpan,
|
|
35
|
-
TimeStamp,
|
|
36
|
-
MultiSeries,
|
|
37
|
-
} from "@synnaxlabs/x/telem";
|
|
32
|
+
export { ranger } from "@/ranger";
|
|
33
|
+
export { signals } from "@/signals";
|
|
34
|
+
export { workspace } from "@/workspace";
|
|
38
35
|
export type {
|
|
39
|
-
TypedArray,
|
|
40
36
|
CrudeDataType,
|
|
41
37
|
CrudeDensity,
|
|
42
38
|
CrudeRate,
|
|
43
39
|
CrudeSize,
|
|
44
40
|
CrudeTimeSpan,
|
|
45
41
|
CrudeTimeStamp,
|
|
46
|
-
TelemValue,
|
|
47
42
|
NumericTelemValue,
|
|
43
|
+
TelemValue,
|
|
48
44
|
TimeStampStringFormat,
|
|
45
|
+
TypedArray,
|
|
49
46
|
TZInfo,
|
|
50
47
|
} from "@synnaxlabs/x/telem";
|
|
51
|
-
export {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
48
|
+
export {
|
|
49
|
+
DataType,
|
|
50
|
+
Density,
|
|
51
|
+
MultiSeries,
|
|
52
|
+
Rate,
|
|
53
|
+
Series,
|
|
54
|
+
TimeRange,
|
|
55
|
+
TimeSpan,
|
|
56
|
+
TimeStamp,
|
|
57
|
+
} from "@synnaxlabs/x/telem";
|
|
58
|
+
import { control } from "@synnaxlabs/x";
|
|
59
|
+
export const Authority = control.Authority;
|
package/src/label/client.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2024 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Use of this software is governed by the Business Source License included in the file
|
|
4
4
|
// licenses/BSL.txt.
|
|
@@ -13,7 +13,7 @@ import { type AsyncTermSearcher } from "@synnaxlabs/x/search";
|
|
|
13
13
|
import { type framer } from "@/framer";
|
|
14
14
|
import { type Key, type Label, labelZ } from "@/label/payload";
|
|
15
15
|
import { Retriever } from "@/label/retriever";
|
|
16
|
-
import {
|
|
16
|
+
import { type NewLabelPayload,Writer } from "@/label/writer";
|
|
17
17
|
import { type ontology } from "@/ontology";
|
|
18
18
|
import { signals } from "@/signals";
|
|
19
19
|
|
package/src/label/external.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2024 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Use of this software is governed by the Business Source License included in the file
|
|
4
4
|
// licenses/BSL.txt.
|
|
@@ -8,6 +8,6 @@
|
|
|
8
8
|
// included in the file licenses/APL.txt.
|
|
9
9
|
|
|
10
10
|
export * from "@/label/client";
|
|
11
|
-
export * from "@/label/writer";
|
|
12
|
-
export * from "@/label/retriever";
|
|
13
11
|
export * from "@/label/payload";
|
|
12
|
+
export * from "@/label/retriever";
|
|
13
|
+
export * from "@/label/writer";
|
package/src/label/index.ts
CHANGED
package/src/label/label.spec.ts
CHANGED
package/src/label/payload.ts
CHANGED
package/src/label/retriever.ts
CHANGED
package/src/label/writer.ts
CHANGED
package/src/ontology/client.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2024 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Use of this software is governed by the Business Source License included in the file
|
|
4
4
|
// licenses/BSL.txt.
|
|
@@ -8,25 +8,25 @@
|
|
|
8
8
|
// included in the file licenses/APL.txt.
|
|
9
9
|
|
|
10
10
|
import { sendRequired, type UnaryClient } from "@synnaxlabs/freighter";
|
|
11
|
+
import { observe, toArray } from "@synnaxlabs/x";
|
|
11
12
|
import { type AsyncTermSearcher } from "@synnaxlabs/x/search";
|
|
13
|
+
import { z } from "zod";
|
|
12
14
|
|
|
13
15
|
import { QueryError } from "@/errors";
|
|
14
16
|
import { framer } from "@/framer";
|
|
17
|
+
import { Frame } from "@/framer/frame";
|
|
15
18
|
import { group } from "@/ontology/group";
|
|
16
19
|
import {
|
|
17
20
|
ID,
|
|
18
21
|
IDPayload,
|
|
19
|
-
RelationshipChange,
|
|
20
|
-
ResourceChange,
|
|
21
22
|
idZ,
|
|
22
23
|
parseRelationship,
|
|
23
|
-
|
|
24
|
+
RelationshipChange,
|
|
24
25
|
type Resource,
|
|
26
|
+
ResourceChange,
|
|
27
|
+
resourceSchemaZ,
|
|
25
28
|
} from "@/ontology/payload";
|
|
26
29
|
import { Writer } from "@/ontology/writer";
|
|
27
|
-
import { z } from "zod";
|
|
28
|
-
import { observe, toArray } from "@synnaxlabs/x";
|
|
29
|
-
import { Frame } from "@/framer/frame";
|
|
30
30
|
|
|
31
31
|
const RETRIEVE_ENDPOINT = "/ontology/retrieve";
|
|
32
32
|
|
package/src/ontology/external.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2024 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Use of this software is governed by the Business Source License included in the file
|
|
4
4
|
// licenses/BSL.txt.
|
|
@@ -21,8 +21,8 @@ export class Client {
|
|
|
21
21
|
this.creator = new Writer(unary);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
async create(parent: ID, name: string): Promise<Group> {
|
|
25
|
-
return this.sugar(await this.creator.create(parent, name));
|
|
24
|
+
async create(parent: ID, name: string, key?: string): Promise<Group> {
|
|
25
|
+
return this.sugar(await this.creator.create(parent, name, key));
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
async rename(key: string, name: string): Promise<void> {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2024 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Use of this software is governed by the Business Source License included in the file
|
|
4
4
|
// licenses/BSL.txt.
|
|
@@ -7,5 +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
|
-
export * from "@/ontology/group/group";
|
|
11
10
|
export * from "@/ontology/group/client";
|
|
11
|
+
export * from "@/ontology/group/group";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2024 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Use of this software is governed by the Business Source License included in the file
|
|
4
4
|
// licenses/BSL.txt.
|
|
@@ -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 { describe, it
|
|
10
|
+
import { describe, expect,it } from "vitest";
|
|
11
11
|
|
|
12
12
|
import { QueryError } from "@/errors";
|
|
13
13
|
import { ontology } from "@/ontology";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2024 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Use of this software is governed by the Business Source License included in the file
|
|
4
4
|
// licenses/BSL.txt.
|
|
@@ -11,7 +11,7 @@ import { type UnaryClient } from "@synnaxlabs/freighter";
|
|
|
11
11
|
import { z } from "zod";
|
|
12
12
|
|
|
13
13
|
import { type Payload, payloadZ } from "@/ontology/group/payload";
|
|
14
|
-
import {
|
|
14
|
+
import { type ID, idZ } from "@/ontology/payload";
|
|
15
15
|
|
|
16
16
|
const resZ = z.object({
|
|
17
17
|
group: payloadZ,
|
|
@@ -19,6 +19,7 @@ const resZ = z.object({
|
|
|
19
19
|
|
|
20
20
|
const createReqZ = z.object({
|
|
21
21
|
parent: idZ,
|
|
22
|
+
key: z.string().uuid().optional(),
|
|
22
23
|
name: z.string(),
|
|
23
24
|
});
|
|
24
25
|
|
|
@@ -41,21 +42,36 @@ export class Writer {
|
|
|
41
42
|
this.client = client;
|
|
42
43
|
}
|
|
43
44
|
|
|
44
|
-
async create(parent: ID, name: string): Promise<Payload> {
|
|
45
|
-
const [res, err] = await this.client.send(
|
|
45
|
+
async create(parent: ID, name: string, key?: string): Promise<Payload> {
|
|
46
|
+
const [res, err] = await this.client.send(
|
|
47
|
+
Writer.ENDPOINT,
|
|
48
|
+
{ parent, name, key },
|
|
49
|
+
createReqZ,
|
|
50
|
+
resZ,
|
|
51
|
+
);
|
|
46
52
|
if (err != null) throw err;
|
|
47
53
|
return res.group;
|
|
48
54
|
}
|
|
49
55
|
|
|
50
56
|
async rename(key: string, name: string): Promise<void> {
|
|
51
57
|
const req = { key, name };
|
|
52
|
-
const [, err] = await this.client.send(
|
|
58
|
+
const [, err] = await this.client.send(
|
|
59
|
+
Writer.ENDPOINT_RENAME,
|
|
60
|
+
req,
|
|
61
|
+
renameReqZ,
|
|
62
|
+
z.object({}),
|
|
63
|
+
);
|
|
53
64
|
if (err != null) throw err;
|
|
54
65
|
}
|
|
55
66
|
|
|
56
67
|
async delete(keys: string[]): Promise<void> {
|
|
57
68
|
const req = { keys };
|
|
58
|
-
const [, err] = await this.client.send(
|
|
69
|
+
const [, err] = await this.client.send(
|
|
70
|
+
Writer.ENDPOINT_DELETE,
|
|
71
|
+
req,
|
|
72
|
+
deleteReqZ,
|
|
73
|
+
z.object({}),
|
|
74
|
+
);
|
|
59
75
|
if (err != null) throw err;
|
|
60
76
|
}
|
|
61
77
|
}
|
package/src/ontology/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2024 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Use of this software is governed by the Business Source License included in the file
|
|
4
4
|
// licenses/BSL.txt.
|
|
@@ -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 { describe, expect, test
|
|
10
|
+
import { describe, expect, it,test } from "vitest";
|
|
11
11
|
|
|
12
12
|
import { ontology } from "@/ontology";
|
|
13
13
|
import { newClient } from "@/setupspecs";
|
package/src/ontology/payload.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2024 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Use of this software is governed by the Business Source License included in the file
|
|
4
4
|
// licenses/BSL.txt.
|
|
@@ -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 { change } from "@synnaxlabs/x";
|
|
10
|
+
import { change,UnknownRecord } from "@synnaxlabs/x";
|
|
11
11
|
import { z } from "zod";
|
|
12
12
|
|
|
13
13
|
export type ResourceChange = change.Change<ID, Resource>;
|
|
@@ -109,7 +109,7 @@ export const resourceSchemaZ = z
|
|
|
109
109
|
};
|
|
110
110
|
});
|
|
111
111
|
|
|
112
|
-
export type Resource<T extends
|
|
112
|
+
export type Resource<T extends UnknownRecord = UnknownRecord> = Omit<
|
|
113
113
|
z.output<typeof resourceSchemaZ>,
|
|
114
114
|
"data"
|
|
115
115
|
> & { data?: T | null };
|
package/src/ontology/writer.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2024 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Use of this software is governed by the Business Source License included in the file
|
|
4
4
|
// licenses/BSL.txt.
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import { sendRequired, type UnaryClient } from "@synnaxlabs/freighter";
|
|
11
11
|
import { z } from "zod";
|
|
12
12
|
|
|
13
|
-
import {
|
|
13
|
+
import { type ID,idZ } from "@/ontology/payload";
|
|
14
14
|
|
|
15
15
|
const ENDPOINTS = {
|
|
16
16
|
ADD_CHILDREN: "/ontology/add-children",
|
package/src/ranger/active.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2024 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Use of this software is governed by the Business Source License included in the file
|
|
4
4
|
// licenses/BSL.txt.
|
|
@@ -11,7 +11,7 @@ import { sendRequired, type UnaryClient } from "@synnaxlabs/freighter";
|
|
|
11
11
|
import { z } from "zod";
|
|
12
12
|
|
|
13
13
|
import { QueryError } from "@/errors";
|
|
14
|
-
import { type
|
|
14
|
+
import { type Key, keyZ,type Payload, payloadZ } from "@/ranger/payload";
|
|
15
15
|
|
|
16
16
|
const setActiveResZ = z.object({});
|
|
17
17
|
|
package/src/ranger/alias.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2024 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Use of this software is governed by the Business Source License included in the file
|
|
4
4
|
// licenses/BSL.txt.
|
|
@@ -12,7 +12,7 @@ import { type change } from "@synnaxlabs/x/change";
|
|
|
12
12
|
import { z } from "zod";
|
|
13
13
|
|
|
14
14
|
import { type channel } from "@/channel";
|
|
15
|
-
import {
|
|
15
|
+
import { type Key as ChannelKey,keyZ as channelKeyZ } from "@/channel/payload";
|
|
16
16
|
import { type Client as FrameClient } from "@/framer/client";
|
|
17
17
|
import { type Key, keyZ } from "@/ranger/payload";
|
|
18
18
|
import { signals } from "@/signals";
|
package/src/ranger/client.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2024 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Use of this software is governed by the Business Source License included in the file
|
|
4
4
|
// licenses/BSL.txt.
|
|
@@ -8,33 +8,33 @@
|
|
|
8
8
|
// included in the file licenses/APL.txt.
|
|
9
9
|
|
|
10
10
|
import { sendRequired, type UnaryClient } from "@synnaxlabs/freighter";
|
|
11
|
+
import { CrudeTimeRange, TimeRange } from "@synnaxlabs/x";
|
|
11
12
|
import { type AsyncTermSearcher } from "@synnaxlabs/x/search";
|
|
12
13
|
import { toArray } from "@synnaxlabs/x/toArray";
|
|
14
|
+
import { z } from "zod";
|
|
13
15
|
|
|
14
16
|
import { type Retriever as ChannelRetriever } from "@/channel/retriever";
|
|
15
|
-
import { MultipleFoundError, NotFoundError
|
|
17
|
+
import { MultipleFoundError, NotFoundError } from "@/errors";
|
|
16
18
|
import { type framer } from "@/framer";
|
|
17
19
|
import { type label } from "@/label";
|
|
18
20
|
import { Active } from "@/ranger/active";
|
|
19
21
|
import { Aliaser } from "@/ranger/alias";
|
|
20
22
|
import { KV } from "@/ranger/kv";
|
|
21
23
|
import {
|
|
22
|
-
|
|
24
|
+
analyzeParams,
|
|
23
25
|
type Key,
|
|
24
26
|
type Keys,
|
|
27
|
+
keyZ,
|
|
25
28
|
type Name,
|
|
26
29
|
type Names,
|
|
30
|
+
type NewPayload,
|
|
27
31
|
type Params,
|
|
28
32
|
type Payload,
|
|
29
|
-
analyzeParams,
|
|
30
33
|
payloadZ,
|
|
31
|
-
keyZ,
|
|
32
34
|
} from "@/ranger/payload";
|
|
33
35
|
import { Range } from "@/ranger/range";
|
|
34
36
|
import { type Writer } from "@/ranger/writer";
|
|
35
37
|
import { signals } from "@/signals";
|
|
36
|
-
import { z } from "zod";
|
|
37
|
-
import { CrudeTimeRange, TimeRange } from "@synnaxlabs/x";
|
|
38
38
|
import { nullableArrayZ } from "@/util/zod";
|
|
39
39
|
|
|
40
40
|
const retrieveReqZ = z.object({
|
|
@@ -98,7 +98,7 @@ export class Client implements AsyncTermSearcher<string, Key, Range> {
|
|
|
98
98
|
return this.sugar(await this.execRetrieve({ term }));
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
async page(
|
|
101
|
+
async page(): Promise<Range[]> {
|
|
102
102
|
return [];
|
|
103
103
|
}
|
|
104
104
|
|
|
@@ -122,15 +122,14 @@ export class Client implements AsyncTermSearcher<string, Key, Range> {
|
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
private async execRetrieve(req: RetrieveRequest): Promise<Range[]> {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
retrieveResZ,
|
|
132
|
-
).then((res) => res.ranges),
|
|
125
|
+
const { ranges } = await sendRequired<typeof retrieveReqZ, typeof retrieveResZ>(
|
|
126
|
+
this.unaryClient,
|
|
127
|
+
RETRIEVE_ENDPOINT,
|
|
128
|
+
req,
|
|
129
|
+
retrieveReqZ,
|
|
130
|
+
retrieveResZ,
|
|
133
131
|
);
|
|
132
|
+
return this.sugar(ranges);
|
|
134
133
|
}
|
|
135
134
|
|
|
136
135
|
async setActive(range: Key): Promise<void> {
|
package/src/ranger/external.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2024 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Use of this software is governed by the Business Source License included in the file
|
|
4
4
|
// licenses/BSL.txt.
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
// License, use of this software will be governed by the Apache License, Version 2.0,
|
|
8
8
|
// included in the file licenses/APL.txt.
|
|
9
9
|
|
|
10
|
+
export type { Alias, AliasChange } from "@/ranger/alias";
|
|
10
11
|
export * from "@/ranger/client";
|
|
11
|
-
export * from "@/ranger/writer";
|
|
12
12
|
export * from "@/ranger/payload";
|
|
13
13
|
export * from "@/ranger/range";
|
|
14
|
-
export
|
|
14
|
+
export * from "@/ranger/writer";
|
package/src/ranger/index.ts
CHANGED
package/src/ranger/kv.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2024 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Use of this software is governed by the Business Source License included in the file
|
|
4
4
|
// licenses/BSL.txt.
|
|
@@ -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 { type UnaryClient
|
|
10
|
+
import { sendRequired,type UnaryClient } from "@synnaxlabs/freighter";
|
|
11
11
|
import { isObject } from "@synnaxlabs/x/identity";
|
|
12
12
|
import { toArray } from "@synnaxlabs/x/toArray";
|
|
13
13
|
import { z } from "zod";
|
package/src/ranger/payload.ts
CHANGED
package/src/ranger/range.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2024 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Use of this software is governed by the Business Source License included in the file
|
|
4
4
|
// licenses/BSL.txt.
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
import { type Series, TimeRange } from "@synnaxlabs/x/telem";
|
|
11
11
|
|
|
12
|
-
import { type Key, type
|
|
12
|
+
import { type Key, type Name,type Params } from "@/channel/payload";
|
|
13
13
|
import { type Retriever as ChannelRetriever } from "@/channel/retriever";
|
|
14
14
|
import { QueryError } from "@/errors";
|
|
15
15
|
import { type framer } from "@/framer";
|
package/src/ranger/writer.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2024 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Use of this software is governed by the Business Source License included in the file
|
|
4
4
|
// licenses/BSL.txt.
|
|
@@ -11,11 +11,11 @@ import { sendRequired, type UnaryClient } from "@synnaxlabs/freighter";
|
|
|
11
11
|
import { z } from "zod";
|
|
12
12
|
|
|
13
13
|
import {
|
|
14
|
+
keyZ,
|
|
14
15
|
type NewPayload,
|
|
16
|
+
newPayloadZ,
|
|
15
17
|
type Payload,
|
|
16
18
|
payloadZ,
|
|
17
|
-
keyZ,
|
|
18
|
-
newPayloadZ,
|
|
19
19
|
} from "@/ranger/payload";
|
|
20
20
|
|
|
21
21
|
const createResZ = z.object({
|
package/src/setupspecs.ts
CHANGED
package/src/signals/external.ts
CHANGED
package/src/signals/index.ts
CHANGED
package/src/transport.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2024 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Use of this software is governed by the Business Source License included in the file
|
|
4
4
|
// licenses/BSL.txt.
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
|
|
10
10
|
import {
|
|
11
11
|
HTTPClient,
|
|
12
|
-
WebSocketClient,
|
|
13
12
|
type Middleware,
|
|
14
13
|
type StreamClient,
|
|
15
14
|
type UnaryClient,
|
|
15
|
+
WebSocketClient,
|
|
16
16
|
} from "@synnaxlabs/freighter";
|
|
17
17
|
import { binary } from "@synnaxlabs/x/binary";
|
|
18
18
|
import { type URL } from "@synnaxlabs/x/url";
|
package/src/user/index.ts
CHANGED
package/src/user/payload.ts
CHANGED