@synnaxlabs/client 0.26.1 → 0.27.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 -7
- package/README.md +36 -10
- package/api/client.api.md +3077 -0
- package/api-extractor.json +7 -0
- package/dist/access/client.d.ts +0 -1
- package/dist/access/payload.d.ts +0 -1
- package/dist/auth/auth.d.ts +0 -1
- package/dist/channel/client.d.ts +6 -2
- package/dist/channel/client.d.ts.map +1 -1
- package/dist/channel/creator.d.ts +0 -1
- package/dist/channel/payload.d.ts +4 -1
- package/dist/channel/payload.d.ts.map +1 -1
- package/dist/channel/retriever.d.ts +0 -1
- package/dist/channel/writer.d.ts +0 -1
- package/dist/client.cjs +17 -17
- package/dist/client.d.ts +6 -7
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +2006 -1745
- package/dist/connection/checker.d.ts +0 -1
- package/dist/control/client.d.ts +0 -1
- package/dist/control/client.d.ts.map +1 -1
- package/dist/control/state.d.ts +0 -1
- package/dist/errors.d.ts +0 -1
- package/dist/framer/adapter.d.ts +0 -1
- package/dist/framer/client.d.ts +0 -1
- package/dist/framer/deleter.d.ts +0 -1
- package/dist/framer/frame.d.ts +11 -12
- package/dist/framer/iterator.d.ts +0 -1
- package/dist/framer/streamProxy.d.ts +0 -1
- package/dist/framer/streamer.d.ts +0 -1
- package/dist/framer/writer.d.ts +0 -1
- package/dist/framer/writer.d.ts.map +1 -1
- package/dist/hardware/client.d.ts +0 -1
- package/dist/hardware/device/client.d.ts +0 -1
- package/dist/hardware/device/payload.d.ts +0 -1
- package/dist/hardware/device/payload.d.ts.map +1 -1
- package/dist/hardware/rack/client.d.ts +0 -1
- package/dist/hardware/rack/payload.d.ts +0 -1
- package/dist/hardware/rack/payload.d.ts.map +1 -1
- package/dist/hardware/task/client.d.ts +0 -1
- package/dist/hardware/task/payload.d.ts +0 -1
- package/dist/hardware/task/payload.d.ts.map +1 -1
- package/dist/label/client.d.ts +8 -6
- package/dist/label/client.d.ts.map +1 -1
- package/dist/label/payload.d.ts +0 -1
- package/dist/label/retriever.d.ts +0 -1
- package/dist/label/retriever.d.ts.map +1 -1
- package/dist/label/writer.d.ts +32 -2
- package/dist/label/writer.d.ts.map +1 -1
- package/dist/ontology/client.d.ts +124 -11
- package/dist/ontology/client.d.ts.map +1 -1
- package/dist/ontology/group/client.d.ts +0 -1
- package/dist/ontology/group/group.d.ts +0 -1
- package/dist/ontology/group/payload.d.ts +0 -1
- package/dist/ontology/group/writer.d.ts +0 -1
- package/dist/ontology/payload.d.ts +5 -1
- package/dist/ontology/payload.d.ts.map +1 -1
- package/dist/ontology/writer.d.ts +4 -5
- package/dist/ontology/writer.d.ts.map +1 -1
- package/dist/ranger/alias.d.ts +0 -1
- package/dist/ranger/client.d.ts +55 -14
- 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 +42 -5
- package/dist/ranger/kv.d.ts.map +1 -1
- package/dist/ranger/payload.d.ts +5 -2
- package/dist/ranger/payload.d.ts.map +1 -1
- package/dist/ranger/writer.d.ts +107 -2
- package/dist/ranger/writer.d.ts.map +1 -1
- package/dist/setupspecs.d.ts +0 -1
- package/dist/signals/observable.d.ts +0 -1
- package/dist/transport.d.ts +0 -1
- package/dist/user/client.d.ts +0 -1
- package/dist/user/payload.d.ts +0 -1
- package/dist/util/retrieve.d.ts +0 -1
- package/dist/util/telem.d.ts +0 -1
- package/dist/util/zod.d.ts +0 -1
- package/dist/workspace/client.d.ts +0 -1
- package/dist/workspace/lineplot/client.d.ts +0 -1
- package/dist/workspace/lineplot/payload.d.ts +0 -1
- package/dist/workspace/lineplot/retriever.d.ts +0 -1
- package/dist/workspace/lineplot/writer.d.ts +0 -1
- package/dist/workspace/payload.d.ts +0 -1
- package/dist/workspace/retriever.d.ts +0 -1
- package/dist/workspace/schematic/client.d.ts +0 -1
- package/dist/workspace/schematic/payload.d.ts +0 -1
- package/dist/workspace/schematic/retriever.d.ts +0 -1
- package/dist/workspace/schematic/writer.d.ts +0 -1
- package/dist/workspace/writer.d.ts +0 -1
- package/package.json +14 -12
- package/src/access/access.spec.ts +11 -11
- package/src/channel/batchRetriever.spec.ts +2 -0
- package/src/channel/channel.spec.ts +51 -31
- package/src/channel/client.ts +7 -0
- package/src/channel/payload.ts +1 -0
- package/src/client.ts +4 -3
- package/src/control/client.ts +9 -0
- package/src/errors.spec.ts +9 -0
- package/src/framer/frame.spec.ts +2 -2
- package/src/framer/frame.ts +22 -22
- package/src/framer/writer.ts +2 -1
- package/src/hardware/device/payload.ts +9 -0
- package/src/hardware/rack/payload.ts +9 -0
- package/src/hardware/task/payload.ts +9 -0
- package/src/label/client.ts +49 -19
- package/src/label/label.spec.ts +9 -0
- package/src/label/retriever.ts +2 -1
- package/src/label/writer.ts +11 -3
- package/src/ontology/client.ts +214 -13
- package/src/ontology/payload.ts +4 -0
- package/src/ontology/writer.ts +26 -12
- package/src/ranger/client.ts +204 -28
- package/src/ranger/external.ts +1 -1
- package/src/ranger/kv.ts +50 -11
- package/src/ranger/payload.ts +9 -5
- package/src/ranger/ranger.spec.ts +114 -49
- package/src/ranger/writer.ts +7 -2
- package/vite.config.ts +1 -1
- package/dist/ranger/active.d.ts +0 -11
- package/dist/ranger/active.d.ts.map +0 -1
- package/dist/ranger/range.d.ts +0 -32
- package/dist/ranger/range.d.ts.map +0 -1
- package/src/ranger/active.ts +0 -74
- package/src/ranger/range.ts +0 -98
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { UnaryClient } from '@synnaxlabs/freighter';
|
|
2
2
|
import { TimeSpan } from '@synnaxlabs/x/telem';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
|
|
5
4
|
export declare const status: z.ZodEnum<["disconnected", "connecting", "connected", "failed"]>;
|
|
6
5
|
export type Status = z.infer<typeof status>;
|
|
7
6
|
export declare const state: z.ZodObject<{
|
package/dist/control/client.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/control/client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/control/client.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAIlC,qBAAa,MAAM;IACjB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgB;gBAE3B,MAAM,EAAE,MAAM,CAAC,MAAM;IAI3B,gBAAgB,IAAI,OAAO,CAAC,YAAY,CAAC;CAIhD"}
|
package/dist/control/state.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ import { z } from 'zod';
|
|
|
4
4
|
import { Key as ChannelKey } from '../channel/payload';
|
|
5
5
|
import { framer } from '../framer';
|
|
6
6
|
import { Streamer as FrameStreamer } from '../framer/streamer';
|
|
7
|
-
|
|
8
7
|
export type Authority = control.Authority;
|
|
9
8
|
export declare const Authority: typeof control.Authority;
|
|
10
9
|
export type Transfer = control.Transfer<ChannelKey>;
|
package/dist/errors.d.ts
CHANGED
package/dist/framer/adapter.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { CrudeSeries } from '@synnaxlabs/x/telem';
|
|
|
2
2
|
import { Key, KeyOrName, Params } from '../channel/payload';
|
|
3
3
|
import { Retriever } from '../channel/retriever';
|
|
4
4
|
import { CrudeFrame, Frame } from './frame';
|
|
5
|
-
|
|
6
5
|
export declare class ReadFrameAdapter {
|
|
7
6
|
private adapter;
|
|
8
7
|
retriever: Retriever;
|
package/dist/framer/client.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ import { Frame } from './frame';
|
|
|
6
6
|
import { Iterator, IteratorConfig } from './iterator';
|
|
7
7
|
import { Streamer, StreamerConfig } from './streamer';
|
|
8
8
|
import { Writer, WriterConfig } from './writer';
|
|
9
|
-
|
|
10
9
|
export declare class Client {
|
|
11
10
|
private readonly streamClient;
|
|
12
11
|
private readonly retriever;
|
package/dist/framer/deleter.d.ts
CHANGED
package/dist/framer/frame.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { DataType, MultiSeries, Series, Size, TelemValue, TimeRange, TimeStamp } from '@synnaxlabs/x/telem';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { KeyOrName, Keys, Names, Params } from '../channel/payload';
|
|
4
|
-
|
|
5
4
|
type ColumnType = "key" | "name" | null;
|
|
6
5
|
export type CrudeFrame = Frame | FramePayload | Map<KeyOrName, Series[] | Series> | Record<KeyOrName, Series[] | Series>;
|
|
7
6
|
/**
|
|
@@ -10,15 +9,15 @@ export type CrudeFrame = Frame | FramePayload | Map<KeyOrName, Series[] | Series
|
|
|
10
9
|
*
|
|
11
10
|
* Frames have two important characteristics: alignment and orientation.
|
|
12
11
|
*
|
|
13
|
-
* A frame's alignment defines how correlated the
|
|
12
|
+
* A frame's alignment defines how correlated the series for different channels in the
|
|
14
13
|
* frame are:
|
|
15
14
|
*
|
|
16
|
-
* - A frame is weakly aligned if
|
|
15
|
+
* - A frame is weakly aligned if the time range occupied by all series of a
|
|
17
16
|
* particular channel is the same for all channels in the frame. This means that the
|
|
18
|
-
*
|
|
17
|
+
* series for a particular channel can have gaps between them.
|
|
19
18
|
*
|
|
20
19
|
* - A strongly aligned frame means that all channels share the same rate/index and
|
|
21
|
-
* there are no gaps in time between
|
|
20
|
+
* there are no gaps in time between series. Strongly aligned frames are natural
|
|
22
21
|
* to interpret, as the values in a particular 'row' of the frame share the same
|
|
23
22
|
* timestamp. All frames written to Synnax must be strongly aligned.
|
|
24
23
|
*
|
|
@@ -30,7 +29,7 @@ export type CrudeFrame = Frame | FramePayload | Map<KeyOrName, Series[] | Series
|
|
|
30
29
|
*
|
|
31
30
|
* - Horizontal frames have a single channel, and are strongly aligned by default.
|
|
32
31
|
* A horizontal frame typically has a single array (in which case, it's also 'square'),
|
|
33
|
-
* although it can have multiple
|
|
32
|
+
* although it can have multiple series if all the series are continuous in time.
|
|
34
33
|
*
|
|
35
34
|
* - Vertical frames are strongly aligned and have on or more channels, but ONLY a single
|
|
36
35
|
* array per channel. Synnax requires that all frames written to the database are
|
|
@@ -42,7 +41,7 @@ export type CrudeFrame = Frame | FramePayload | Map<KeyOrName, Series[] | Series
|
|
|
42
41
|
export declare class Frame {
|
|
43
42
|
readonly columns: Keys | Names;
|
|
44
43
|
readonly series: Series[];
|
|
45
|
-
constructor(columnsOrData?: Params | CrudeFrame,
|
|
44
|
+
constructor(columnsOrData?: Params | CrudeFrame, series?: Series | Series[]);
|
|
46
45
|
/**
|
|
47
46
|
* @returns "key" if the frame columns are channel keys, "name" if the columns are
|
|
48
47
|
* channel names, and null if the frame has no columns.
|
|
@@ -82,8 +81,8 @@ export declare class Frame {
|
|
|
82
81
|
/**
|
|
83
82
|
* @returns true if the frame is horizontal. Horizontal frames have a single channel,
|
|
84
83
|
* and are strongly aligned by default.A horizontal frame typically has a single array
|
|
85
|
-
* (in which case, it's also 'square'), although it can have multiple
|
|
86
|
-
* the
|
|
84
|
+
* (in which case, it's also 'square'), although it can have multiple series if all
|
|
85
|
+
* the series are continuous in time.
|
|
87
86
|
*/
|
|
88
87
|
get isHorizontal(): boolean;
|
|
89
88
|
/**
|
|
@@ -93,8 +92,8 @@ export declare class Frame {
|
|
|
93
92
|
get isSquare(): boolean;
|
|
94
93
|
/**
|
|
95
94
|
* @returns true if the frame is weakly aligned. A frame is weakly aligned if it meets
|
|
96
|
-
* the time range occupied by all
|
|
97
|
-
* channels in the frame. This means that the
|
|
95
|
+
* the time range occupied by all series of a particular channel is the same for all
|
|
96
|
+
* channels in the frame. This means that the series for a particular channel can have
|
|
98
97
|
* gaps between them.
|
|
99
98
|
*/
|
|
100
99
|
get isWeaklyAligned(): boolean;
|
|
@@ -102,7 +101,7 @@ export declare class Frame {
|
|
|
102
101
|
latest(): Record<string, TelemValue | undefined>;
|
|
103
102
|
get timeRanges(): TimeRange[];
|
|
104
103
|
/**
|
|
105
|
-
* @returns lazy
|
|
104
|
+
* @returns lazy series matching the given channel key or name.
|
|
106
105
|
* @param key the channel key or name.
|
|
107
106
|
*/
|
|
108
107
|
get(key: KeyOrName): MultiSeries;
|
|
@@ -3,7 +3,6 @@ import { CrudeTimeRange, CrudeTimeSpan, CrudeTimeStamp, TimeSpan } from '@synnax
|
|
|
3
3
|
import { Params } from '../channel/payload';
|
|
4
4
|
import { Retriever } from '../channel/retriever';
|
|
5
5
|
import { Frame } from './frame';
|
|
6
|
-
|
|
7
6
|
export declare const AUTO_SPAN: TimeSpan;
|
|
8
7
|
export interface IteratorConfig {
|
|
9
8
|
/** chunkSize is the maximum number of samples contained per channel in the frame
|
|
@@ -4,7 +4,6 @@ import { CrudeTimeStamp } from '@synnaxlabs/x/telem';
|
|
|
4
4
|
import { Key, Params } from '../channel/payload';
|
|
5
5
|
import { Retriever } from '../channel/retriever';
|
|
6
6
|
import { Frame } from './frame';
|
|
7
|
-
|
|
8
7
|
export interface StreamerConfig {
|
|
9
8
|
channels: Params;
|
|
10
9
|
from?: CrudeTimeStamp;
|
package/dist/framer/writer.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writer.d.ts","sourceRoot":"","sources":["../../src/framer/writer.ts"],"names":[],"mappings":"AASA,OAAO,EAIL,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,QAAQ,EACR,SAAS,EACV,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,WAAW,EAAE,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAClF,OAAO,EAAE,KAAK,SAAS,EAAE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evice } from './payload';
|
|
7
7
|
import { signals } from '../../signals';
|
|
8
|
-
|
|
9
8
|
declare const retrieveReqZ: z.ZodObject<{
|
|
10
9
|
search: z.ZodOptional<z.ZodString>;
|
|
11
10
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../../src/hardware/device/payload.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../../src/hardware/device/payload.ts"],"names":[],"mappings":"AASA,OAAO,EAAU,aAAa,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,eAAO,MAAM,UAAU,aAAa,CAAC;AAErC,eAAO,MAAM,OAAO;;;;;;;;gBAab,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;;;;;;;;;;;;;;;;;;;EAC7B,CAAC;AAEH,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,IAAI,IAAI,CAChE,CAAC,CAAC,MAAM,CAAC,OAAO,OAAO,CAAC,EACxB,YAAY,CACb,GAAG;IAAE,UAAU,EAAE,CAAC,CAAA;CAAE,CAAC;AAEtB,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAEnD,eAAO,MAAM,UAAU;;;;;;;;gBAVhB,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;;;;;;;;;;;;;;;;;;;;;EAY7B,CAAC;AAEH,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,IAAI,IAAI,CACnE,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,EAC1B,YAAY,CACb,GAAG;IAAE,UAAU,EAAE,CAAC,CAAA;CAAE,CAAC;AAEtB,eAAO,MAAM,kBAAkB,EAAe,QAAQ,CAAC,YAAY,CAAC;AAEpE,eAAO,MAAM,UAAU,QAAS,SAAS,KAAG,QAAQ,CAAC,EACe,CAAC"}
|
|
@@ -4,7 +4,6 @@ import { AsyncTermSearcher } from '@synnaxlabs/x/search';
|
|
|
4
4
|
import { framer } from '../../framer';
|
|
5
5
|
import { NewRack, RackKey, rackKeyZ } from './payload';
|
|
6
6
|
import { task } from '../task';
|
|
7
|
-
|
|
8
7
|
export declare class Client implements AsyncTermSearcher<string, RackKey, Rack> {
|
|
9
8
|
readonly type: string;
|
|
10
9
|
private readonly client;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../../src/hardware/rack/payload.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../../src/hardware/rack/payload.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,eAAO,MAAM,QAAQ,aAAa,CAAC;AAEnC,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC;AAE/C,eAAO,MAAM,KAAK;;;;;;;;;EAGhB,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,KAAK,CAAC,CAAC;AAEhD,eAAO,MAAM,QAAQ;;;;;;;;;EAA+B,CAAC;AAErD,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC;AAE/C,eAAO,MAAM,gBAAgB,EAAa,QAAQ,CAAC,YAAY,CAAC;AAEhE,eAAO,MAAM,UAAU,QAAS,OAAO,KAAG,QAAQ,CAAC,EACe,CAAC"}
|
|
@@ -6,7 +6,6 @@ import { z } from 'zod';
|
|
|
6
6
|
import { framer } from '../../framer';
|
|
7
7
|
import { NewTask, Payload, State, StateObservable, TaskKey } from './payload';
|
|
8
8
|
import { signals } from '../../signals';
|
|
9
|
-
|
|
10
9
|
export declare class Task<C extends UnknownRecord = UnknownRecord, D extends {} = UnknownRecord, T extends string = string> {
|
|
11
10
|
readonly key: TaskKey;
|
|
12
11
|
readonly name: string;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { observe, UnknownRecord } from '@synnaxlabs/x';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { ontology } from '../../ontology';
|
|
4
|
-
|
|
5
4
|
export declare const taskKeyZ: z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodBigInt, string, bigint>, z.ZodEffects<z.ZodNumber, string, number>]>;
|
|
6
5
|
export type TaskKey = z.infer<typeof taskKeyZ>;
|
|
7
6
|
export declare const stateZ: z.ZodObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../../src/hardware/task/payload.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../../src/hardware/task/payload.ts"],"names":[],"mappings":"AASA,OAAO,EAAU,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,eAAO,MAAM,QAAQ,iHAInB,CAAC;AAEH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC;AAE/C,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;EAcjB,CAAC;AAEH,MAAM,MAAM,KAAK,CAAC,CAAC,SAAS,EAAE,GAAG,aAAa,IAAI,IAAI,CACpD,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,EACtB,SAAS,CACV,GAAG;IACF,OAAO,CAAC,EAAE,CAAC,C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AAU,QAAS,OAAO,KAAG,QAAQ,CAAC,EACiB,CAAC"}
|
package/dist/label/client.d.ts
CHANGED
|
@@ -1,28 +1,30 @@
|
|
|
1
1
|
import { UnaryClient } from '@synnaxlabs/freighter';
|
|
2
|
+
import { observe } from '@synnaxlabs/x';
|
|
2
3
|
import { AsyncTermSearcher } from '@synnaxlabs/x/search';
|
|
3
4
|
import { framer } from '../framer';
|
|
4
5
|
import { Key, Label } from './payload';
|
|
5
|
-
import { NewLabelPayload } from './writer';
|
|
6
|
+
import { NewLabelPayload, SetOptions } from './writer';
|
|
6
7
|
import { ontology } from '../ontology';
|
|
7
8
|
import { signals } from '../signals';
|
|
8
|
-
|
|
9
9
|
export declare class Client implements AsyncTermSearcher<string, Key, Label> {
|
|
10
10
|
readonly type: string;
|
|
11
11
|
private readonly retriever;
|
|
12
12
|
private readonly writer;
|
|
13
13
|
private readonly frameClient;
|
|
14
|
-
|
|
14
|
+
private readonly ontology;
|
|
15
|
+
constructor(client: UnaryClient, frameClient: framer.Client, ontology: ontology.Client);
|
|
15
16
|
search(term: string): Promise<Label[]>;
|
|
16
17
|
retrieve(key: Key): Promise<Label>;
|
|
17
18
|
retrieve(keys: Key[]): Promise<Label[]>;
|
|
18
|
-
retrieveFor(id: ontology.
|
|
19
|
-
label(id: ontology.
|
|
20
|
-
removeLabels(id: ontology.
|
|
19
|
+
retrieveFor(id: ontology.CrudeID): Promise<Label[]>;
|
|
20
|
+
label(id: ontology.CrudeID, labels: Key[], opts?: SetOptions): Promise<void>;
|
|
21
|
+
removeLabels(id: ontology.CrudeID, labels: Key[]): Promise<void>;
|
|
21
22
|
page(offset: number, limit: number): Promise<Label[]>;
|
|
22
23
|
create(label: NewLabelPayload): Promise<Label>;
|
|
23
24
|
create(labels: NewLabelPayload[]): Promise<Label[]>;
|
|
24
25
|
delete(key: Key): Promise<void>;
|
|
25
26
|
delete(keys: Key[]): Promise<void>;
|
|
26
27
|
openChangeTracker(): Promise<signals.Observable<string, Label>>;
|
|
28
|
+
trackLabelsOf(id: ontology.CrudeID): Promise<observe.ObservableAsyncCloseable<Label[]>>;
|
|
27
29
|
}
|
|
28
30
|
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/label/client.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,KAAK,EAAU,MAAM,iBAAiB,CAAC;AAE/D,OAAO,EAAE,KAAK,eAAe,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/label/client.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,KAAK,EAAU,MAAM,iBAAiB,CAAC;AAE/D,OAAO,EAAE,KAAK,eAAe,EAAE,UAAU,EAAU,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,qBAAa,MAAO,YAAW,iBAAiB,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC;IAClE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAW;IAChC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAY;IACtC,OAAO,CAAC,QAAQ,CAAC,MAAM,C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CACjB,EAAE,EAAE,QAAQ,CAAC,OAAO,GACnB,OAAO,CAAC,OAAO,CAAC,wBAAwB,CAAC,KAAK,EAAE,CAAC,CAAC;CAwBtD"}
|
package/dist/label/payload.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retriever.d.ts","sourceRoot":"","sources":["../../src/label/retriever.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAIzD,OAAO,EAAQ,KAAK,KAAK,EAAU,KAAK,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"retriever.d.ts","sourceRoot":"","sources":["../../src/label/retriever.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAIzD,OAAO,EAAQ,KAAK,KAAK,EAAU,KAAK,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAiBtC,qBAAa,SAAS;IACpB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAqB;IACrD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAc;gBAEzB,MAAM,EAAE,WAAW;IAIzB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAK1C,WAAW,CAAC,EAAE,EAAE,QAAQ,CAAC,EAAE,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAI9C,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAItC,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;YAI7C,OAAO;CAUtB"}
|
package/dist/label/writer.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { UnaryClient } from '@synnaxlabs/freighter';
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { Key, Label } from './payload';
|
|
4
4
|
import { ontology } from '../ontology';
|
|
5
|
-
|
|
6
5
|
export declare const newLabelPayloadZ: z.ZodObject<z.objectUtil.extendShape<{
|
|
7
6
|
key: z.ZodString;
|
|
8
7
|
name: z.ZodString;
|
|
@@ -19,12 +18,43 @@ export declare const newLabelPayloadZ: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
19
18
|
key?: string | undefined;
|
|
20
19
|
}>;
|
|
21
20
|
export type NewLabelPayload = z.infer<typeof newLabelPayloadZ>;
|
|
21
|
+
declare const setReqZ: z.ZodObject<{
|
|
22
|
+
id: z.ZodObject<{
|
|
23
|
+
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<"schematic">, z.ZodLiteral<"lineplot">, z.ZodLiteral<"rack">, z.ZodLiteral<"device">, z.ZodLiteral<"task">, z.ZodLiteral<"policy">]>;
|
|
24
|
+
key: z.ZodString;
|
|
25
|
+
}, "strip", z.ZodTypeAny, {
|
|
26
|
+
type: "label" | "builtin" | "cluster" | "channel" | "node" | "group" | "range" | "range-alias" | "user" | "workspace" | "schematic" | "lineplot" | "rack" | "device" | "task" | "policy";
|
|
27
|
+
key: string;
|
|
28
|
+
}, {
|
|
29
|
+
type: "label" | "builtin" | "cluster" | "channel" | "node" | "group" | "range" | "range-alias" | "user" | "workspace" | "schematic" | "lineplot" | "rack" | "device" | "task" | "policy";
|
|
30
|
+
key: string;
|
|
31
|
+
}>;
|
|
32
|
+
labels: z.ZodArray<z.ZodString, "many">;
|
|
33
|
+
replace: z.ZodOptional<z.ZodBoolean>;
|
|
34
|
+
}, "strip", z.ZodTypeAny, {
|
|
35
|
+
id: {
|
|
36
|
+
type: "label" | "builtin" | "cluster" | "channel" | "node" | "group" | "range" | "range-alias" | "user" | "workspace" | "schematic" | "lineplot" | "rack" | "device" | "task" | "policy";
|
|
37
|
+
key: string;
|
|
38
|
+
};
|
|
39
|
+
labels: string[];
|
|
40
|
+
replace?: boolean | undefined;
|
|
41
|
+
}, {
|
|
42
|
+
id: {
|
|
43
|
+
type: "label" | "builtin" | "cluster" | "channel" | "node" | "group" | "range" | "range-alias" | "user" | "workspace" | "schematic" | "lineplot" | "rack" | "device" | "task" | "policy";
|
|
44
|
+
key: string;
|
|
45
|
+
};
|
|
46
|
+
labels: string[];
|
|
47
|
+
replace?: boolean | undefined;
|
|
48
|
+
}>;
|
|
49
|
+
type SetReq = z.infer<typeof setReqZ>;
|
|
50
|
+
export type SetOptions = Pick<SetReq, "replace">;
|
|
22
51
|
export declare class Writer {
|
|
23
52
|
private readonly client;
|
|
24
53
|
constructor(client: UnaryClient);
|
|
25
54
|
create(labels: NewLabelPayload | NewLabelPayload[]): Promise<Label[]>;
|
|
26
55
|
delete(keys: Key | Key[]): Promise<void>;
|
|
27
|
-
set(id: ontology.ID, labels: Key[]): Promise<void>;
|
|
56
|
+
set(id: ontology.ID, labels: Key[], { replace }?: SetOptions): Promise<void>;
|
|
28
57
|
remove(id: ontology.ID, labels: Key[]): Promise<void>;
|
|
29
58
|
}
|
|
59
|
+
export {};
|
|
30
60
|
//# sourceMappingURL=writer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writer.d.ts","sourceRoot":"","sources":["../../src/label/writer.ts"],"names":[],"mappings":"AASA,OAAO,EAAgB,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEvE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,KAAK,GAAG,EAAQ,KAAK,KAAK,EAAU,MAAM,iBAAiB,CAAC;AACrE,OAAO,E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,IAAI,CAAC;IAUV,MAAM,CAAC,EAAE,EAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAS5D"}
|
|
@@ -4,8 +4,7 @@ import { AsyncTermSearcher } from '@synnaxlabs/x/search';
|
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { framer } from '../framer';
|
|
6
6
|
import { group } from './group';
|
|
7
|
-
import { ID, RelationshipChange, Resource, ResourceChange } from './payload';
|
|
8
|
-
|
|
7
|
+
import { CrudeID, ID, IDPayload, RelationshipChange, RelationshipDirection, Resource, ResourceChange } from './payload';
|
|
9
8
|
declare const retrieveReqZ: z.ZodObject<{
|
|
10
9
|
ids: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
11
10
|
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<"schematic">, z.ZodLiteral<"lineplot">, z.ZodLiteral<"rack">, z.ZodLiteral<"device">, z.ZodLiteral<"task">, z.ZodLiteral<"policy">]>;
|
|
@@ -51,6 +50,7 @@ declare const retrieveReqZ: z.ZodObject<{
|
|
|
51
50
|
}>;
|
|
52
51
|
type RetrieveRequest = z.infer<typeof retrieveReqZ>;
|
|
53
52
|
export type RetrieveOptions = Pick<RetrieveRequest, "includeSchema" | "excludeFieldData">;
|
|
53
|
+
export declare const parseIDs: (ids: CrudeID | CrudeID[] | string | string[]) => IDPayload[];
|
|
54
54
|
/** The core client class for executing queries against a Synnax cluster ontology */
|
|
55
55
|
export declare class Client implements AsyncTermSearcher<string, string, Resource> {
|
|
56
56
|
readonly type: string;
|
|
@@ -59,24 +59,119 @@ export declare class Client implements AsyncTermSearcher<string, string, Resourc
|
|
|
59
59
|
private readonly writer;
|
|
60
60
|
private readonly framer;
|
|
61
61
|
constructor(unary: UnaryClient, framer: framer.Client);
|
|
62
|
+
/**
|
|
63
|
+
* Executes a fuzzy search on the ontology for resources with names/fields similar to the
|
|
64
|
+
* given term.
|
|
65
|
+
*
|
|
66
|
+
* @param term The search term.
|
|
67
|
+
* @param options Additional options for the search.
|
|
68
|
+
* @param options.includeSchema Whether to include the schema of the resources in the
|
|
69
|
+
* results.
|
|
70
|
+
* @param options.excludeFieldData Whether to exclude the field data of the resources in
|
|
71
|
+
* the results.
|
|
72
|
+
* @returns A list of resources that match the search term.
|
|
73
|
+
*/
|
|
62
74
|
search(term: string, options?: RetrieveOptions): Promise<Resource[]>;
|
|
63
|
-
|
|
64
|
-
|
|
75
|
+
/**
|
|
76
|
+
* Retrieves the resource in the ontology with the given ID.
|
|
77
|
+
* @param id The ID of the resource to retrieve.
|
|
78
|
+
* @param options Additional options for the retrieval.
|
|
79
|
+
* @param options.includeSchema Whether to include the schema of the resource in the
|
|
80
|
+
* results.
|
|
81
|
+
* @param options.excludeFieldData Whether to exclude the field data of the resource in
|
|
82
|
+
* the results.
|
|
83
|
+
* @returns The resource with the given ID.
|
|
84
|
+
* @throws {QueryError} If no resource is found with the given ID.
|
|
85
|
+
*/
|
|
86
|
+
retrieve(id: CrudeID, options?: RetrieveOptions): Promise<Resource>;
|
|
87
|
+
/**
|
|
88
|
+
* Retrieves the resources in the ontology with the given IDs.
|
|
89
|
+
* @param ids The IDs of the resources to retrieve.
|
|
90
|
+
* @param options Additional options for the retrieval.
|
|
91
|
+
* @param options.includeSchema Whether to include the schema of the resources in the
|
|
92
|
+
* results.
|
|
93
|
+
* @param options.excludeFieldData Whether to exclude the field data of the resources in
|
|
94
|
+
* the results.
|
|
95
|
+
* @returns The resources with the given IDs.
|
|
96
|
+
* @throws {QueryError} If no resource is found with any of the given IDs.
|
|
97
|
+
*/
|
|
98
|
+
retrieve(ids: CrudeID[], options?: RetrieveOptions): Promise<Resource[]>;
|
|
99
|
+
/**
|
|
100
|
+
* Retrieves resources from the ontology in a paginated manner.
|
|
101
|
+
*
|
|
102
|
+
* @param offset - The offset of the page (i.e. how many resources to skip before
|
|
103
|
+
* returning results).
|
|
104
|
+
* @param limit - The maximum number of resources to return.
|
|
105
|
+
* @param options - Additional options for the retrieval.
|
|
106
|
+
* @returns A list of resources in the ontology.
|
|
107
|
+
*/
|
|
65
108
|
page(offset: number, limit: number, options?: RetrieveOptions): Promise<Resource[]>;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
109
|
+
/**
|
|
110
|
+
* Retrieves the children of the resources with the given IDs.
|
|
111
|
+
* @param ids - The IDs of the resources whose children to retrieve.
|
|
112
|
+
* @param options - Additional options for the retrieval.
|
|
113
|
+
* @param options.includeSchema - Whether to include the schema of the children in the
|
|
114
|
+
* results.
|
|
115
|
+
* @param options.excludeFieldData - Whether to exclude the field data of the children in
|
|
116
|
+
* the results.
|
|
117
|
+
* @returns The children of the resources with the given IDs.
|
|
118
|
+
*/
|
|
119
|
+
retrieveChildren(ids: CrudeID | CrudeID[], options?: RetrieveOptions): Promise<Resource[]>;
|
|
120
|
+
/**
|
|
121
|
+
* Retrieves the parents of the resources with the given IDs.
|
|
122
|
+
*
|
|
123
|
+
* @param ids the IDs of the resources whose parents to retrieve
|
|
124
|
+
* @param options additional options for the retrieval
|
|
125
|
+
* @param options.includeSchema whether to include the schema of the parents in the results
|
|
126
|
+
* @param options.excludeFieldData whether to exclude the field data of the parents in the results
|
|
127
|
+
* @returns the parents of the resources with the given IDs
|
|
128
|
+
*/
|
|
129
|
+
retrieveParents(ids: CrudeID | CrudeID[], options?: RetrieveOptions): Promise<Resource[]>;
|
|
130
|
+
/**
|
|
131
|
+
* Adds children to a resource in the ontology.
|
|
132
|
+
* @param id The ID of the resource to add children to.
|
|
133
|
+
* @param children The IDs of the children to add.
|
|
134
|
+
*/
|
|
135
|
+
addChildren(id: CrudeID, ...children: CrudeID[]): Promise<void>;
|
|
136
|
+
/**
|
|
137
|
+
* Removes children from a resource in the ontology.
|
|
138
|
+
* @param id The ID of the resource to remove children from.
|
|
139
|
+
* @param children The IDs of the children
|
|
140
|
+
* to remove.
|
|
141
|
+
*/
|
|
142
|
+
removeChildren(id: CrudeID, ...children: CrudeID[]): Promise<void>;
|
|
143
|
+
/**
|
|
144
|
+
* Moves children from one resource to another in the ontology.
|
|
145
|
+
* @param from The ID of the resource to move children from.
|
|
146
|
+
* @param to The ID of the resource to move children to.
|
|
147
|
+
* @param children The IDs of the children to move.
|
|
148
|
+
*/
|
|
149
|
+
moveChildren(from: CrudeID, to: CrudeID, ...children: CrudeID[]): Promise<void>;
|
|
150
|
+
/**
|
|
151
|
+
* Opens an observable that can be used to subscribe to changes in both the ontology's
|
|
152
|
+
* resources and relationships.
|
|
153
|
+
* @see ChangeTracker for more information.
|
|
154
|
+
* @returns An observable that emits changes to the ontology's resources and relationships.
|
|
155
|
+
*/
|
|
71
156
|
openChangeTracker(): Promise<ChangeTracker>;
|
|
157
|
+
openDependentTracker(parent: ID, initial: Resource[], type?: string, direction?: RelationshipDirection): Promise<observe.ObservableAsyncCloseable<Resource[]>>;
|
|
72
158
|
newSearcherWithOptions(options: RetrieveOptions): AsyncTermSearcher<string, string, Resource>;
|
|
73
159
|
private execRetrieve;
|
|
74
160
|
}
|
|
161
|
+
/**
|
|
162
|
+
* A class that tracks changes to the ontology's resources and relationships.
|
|
163
|
+
*/
|
|
75
164
|
export declare class ChangeTracker {
|
|
76
|
-
|
|
77
|
-
|
|
165
|
+
/**
|
|
166
|
+
* An observable that emits changes to the ontology's relationships.
|
|
167
|
+
*/
|
|
78
168
|
readonly relationships: observe.Observable<RelationshipChange[]>;
|
|
169
|
+
/**
|
|
170
|
+
* An observable that emits changes to the ontology's resources.
|
|
171
|
+
*/
|
|
79
172
|
readonly resources: observe.Observable<ResourceChange[]>;
|
|
173
|
+
private readonly resourceObs;
|
|
174
|
+
private readonly relationshipObs;
|
|
80
175
|
private readonly streamer;
|
|
81
176
|
private readonly client;
|
|
82
177
|
private readonly closePromise;
|
|
@@ -90,5 +185,23 @@ export declare class ChangeTracker {
|
|
|
90
185
|
private parseResourceDeletes;
|
|
91
186
|
static open(client: framer.Client, retriever: Client): Promise<ChangeTracker>;
|
|
92
187
|
}
|
|
188
|
+
/**
|
|
189
|
+
* A class that tracks a resource (called the 'target' resource) and related resources
|
|
190
|
+
* (called 'dependents') of a particular type (called the 'type') in a Synnax cluster
|
|
191
|
+
* ontology.
|
|
192
|
+
*/
|
|
193
|
+
export declare class DependentTracker extends observe.Observer<Resource[]> implements observe.ObservableAsyncCloseable<Resource[]> {
|
|
194
|
+
private readonly internal;
|
|
195
|
+
private readonly target;
|
|
196
|
+
private readonly direction;
|
|
197
|
+
private dependents;
|
|
198
|
+
private readonly client;
|
|
199
|
+
private readonly type;
|
|
200
|
+
private constructor();
|
|
201
|
+
static open(from: ID, client: Client, framer: framer.Client, initial: Resource[], type?: string, direction?: RelationshipDirection): Promise<DependentTracker>;
|
|
202
|
+
private handleResourceChange;
|
|
203
|
+
private handleRelationshipChange;
|
|
204
|
+
close(): Promise<void>;
|
|
205
|
+
}
|
|
93
206
|
export {};
|
|
94
207
|
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/ontology/client.ts"],"names":[],"mappings":"AASA,OAAO,EAAgB,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,OAAO,EAAW,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EACL,EAAE,
|
|
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