@synnaxlabs/client 0.34.0 → 0.36.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.
Files changed (126) hide show
  1. package/.turbo/turbo-build.log +7 -7
  2. package/dist/access/policy/payload.d.ts +40 -40
  3. package/dist/access/policy/retriever.d.ts +5 -5
  4. package/dist/client.cjs +28 -28
  5. package/dist/client.d.ts +35 -0
  6. package/dist/client.d.ts.map +1 -1
  7. package/dist/client.js +3092 -2820
  8. package/dist/control/state.d.ts.map +1 -1
  9. package/dist/framer/deleter.d.ts.map +1 -1
  10. package/dist/framer/frame.d.ts +14 -7
  11. package/dist/framer/frame.d.ts.map +1 -1
  12. package/dist/framer/writer.d.ts +8 -8
  13. package/dist/framer/writer.d.ts.map +1 -1
  14. package/dist/hardware/device/client.d.ts +2 -2
  15. package/dist/hardware/device/client.d.ts.map +1 -1
  16. package/dist/hardware/device/payload.d.ts +2 -2
  17. package/dist/hardware/device/payload.d.ts.map +1 -1
  18. package/dist/hardware/task/client.d.ts +4 -2
  19. package/dist/hardware/task/client.d.ts.map +1 -1
  20. package/dist/hardware/task/payload.d.ts +9 -5
  21. package/dist/hardware/task/payload.d.ts.map +1 -1
  22. package/dist/index.d.ts +2 -0
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/label/writer.d.ts +5 -5
  25. package/dist/ontology/client.d.ts +8 -8
  26. package/dist/ontology/group/payload.d.ts +3 -0
  27. package/dist/ontology/group/payload.d.ts.map +1 -1
  28. package/dist/ontology/payload.d.ts +43 -43
  29. package/dist/ontology/payload.d.ts.map +1 -1
  30. package/dist/ranger/client.d.ts +1 -0
  31. package/dist/ranger/client.d.ts.map +1 -1
  32. package/dist/ranger/payload.d.ts.map +1 -1
  33. package/dist/ranger/writer.d.ts +5 -5
  34. package/dist/ranger/writer.d.ts.map +1 -1
  35. package/dist/transport.d.ts +2 -1
  36. package/dist/transport.d.ts.map +1 -1
  37. package/dist/workspace/client.d.ts +70 -11
  38. package/dist/workspace/client.d.ts.map +1 -1
  39. package/dist/workspace/index.d.ts +1 -1
  40. package/dist/workspace/index.d.ts.map +1 -1
  41. package/dist/workspace/lineplot/client.d.ts +48 -6
  42. package/dist/workspace/lineplot/client.d.ts.map +1 -1
  43. package/dist/workspace/lineplot/index.d.ts +1 -1
  44. package/dist/workspace/lineplot/index.d.ts.map +1 -1
  45. package/dist/workspace/log/client.d.ts +48 -6
  46. package/dist/workspace/log/client.d.ts.map +1 -1
  47. package/dist/workspace/log/index.d.ts +1 -1
  48. package/dist/workspace/log/index.d.ts.map +1 -1
  49. package/dist/workspace/schematic/client.d.ts +72 -6
  50. package/dist/workspace/schematic/client.d.ts.map +1 -1
  51. package/dist/workspace/schematic/index.d.ts +1 -1
  52. package/dist/workspace/schematic/index.d.ts.map +1 -1
  53. package/dist/workspace/table/client.d.ts +71 -0
  54. package/dist/workspace/table/client.d.ts.map +1 -0
  55. package/dist/workspace/table/index.d.ts +2 -0
  56. package/dist/workspace/table/index.d.ts.map +1 -0
  57. package/dist/workspace/table/table.spec.d.ts +2 -0
  58. package/dist/workspace/table/table.spec.d.ts.map +1 -0
  59. package/package.json +10 -10
  60. package/src/client.ts +16 -2
  61. package/src/control/state.ts +1 -1
  62. package/src/framer/frame.spec.ts +32 -3
  63. package/src/framer/frame.ts +17 -0
  64. package/src/hardware/device/client.ts +10 -4
  65. package/src/hardware/task/client.ts +51 -3
  66. package/src/hardware/task/payload.ts +21 -6
  67. package/src/index.ts +2 -0
  68. package/src/ontology/group/payload.ts +8 -7
  69. package/src/ontology/payload.ts +1 -0
  70. package/src/ranger/client.ts +4 -1
  71. package/src/transport.ts +8 -3
  72. package/src/workspace/client.ts +151 -47
  73. package/src/workspace/index.ts +1 -1
  74. package/src/workspace/lineplot/client.ts +96 -28
  75. package/src/workspace/lineplot/index.ts +1 -1
  76. package/src/workspace/log/client.ts +93 -28
  77. package/src/workspace/log/index.ts +1 -1
  78. package/src/workspace/schematic/client.ts +121 -29
  79. package/src/workspace/schematic/index.ts +1 -1
  80. package/src/workspace/table/client.ts +125 -0
  81. package/src/workspace/{external.ts → table/index.ts} +1 -2
  82. package/src/workspace/table/table.spec.ts +65 -0
  83. package/dist/workspace/external.d.ts +0 -3
  84. package/dist/workspace/external.d.ts.map +0 -1
  85. package/dist/workspace/lineplot/external.d.ts +0 -3
  86. package/dist/workspace/lineplot/external.d.ts.map +0 -1
  87. package/dist/workspace/lineplot/retriever.d.ts +0 -9
  88. package/dist/workspace/lineplot/retriever.d.ts.map +0 -1
  89. package/dist/workspace/lineplot/writer.d.ts +0 -35
  90. package/dist/workspace/lineplot/writer.d.ts.map +0 -1
  91. package/dist/workspace/log/external.d.ts +0 -3
  92. package/dist/workspace/log/external.d.ts.map +0 -1
  93. package/dist/workspace/log/payload.d.ts +0 -36
  94. package/dist/workspace/log/payload.d.ts.map +0 -1
  95. package/dist/workspace/log/retriever.d.ts +0 -9
  96. package/dist/workspace/log/retriever.d.ts.map +0 -1
  97. package/dist/workspace/log/writer.d.ts +0 -35
  98. package/dist/workspace/log/writer.d.ts.map +0 -1
  99. package/dist/workspace/payload.d.ts +0 -38
  100. package/dist/workspace/payload.d.ts.map +0 -1
  101. package/dist/workspace/retriever.d.ts +0 -13
  102. package/dist/workspace/retriever.d.ts.map +0 -1
  103. package/dist/workspace/schematic/external.d.ts +0 -3
  104. package/dist/workspace/schematic/external.d.ts.map +0 -1
  105. package/dist/workspace/schematic/payload.d.ts +0 -42
  106. package/dist/workspace/schematic/payload.d.ts.map +0 -1
  107. package/dist/workspace/schematic/retriever.d.ts +0 -9
  108. package/dist/workspace/schematic/retriever.d.ts.map +0 -1
  109. package/dist/workspace/schematic/writer.d.ts +0 -41
  110. package/dist/workspace/schematic/writer.d.ts.map +0 -1
  111. package/dist/workspace/writer.d.ts +0 -66
  112. package/dist/workspace/writer.d.ts.map +0 -1
  113. package/src/workspace/lineplot/external.ts +0 -11
  114. package/src/workspace/lineplot/retriever.ts +0 -34
  115. package/src/workspace/lineplot/writer.ts +0 -115
  116. package/src/workspace/log/external.ts +0 -11
  117. package/src/workspace/log/payload.ts +0 -36
  118. package/src/workspace/log/retriever.ts +0 -38
  119. package/src/workspace/log/writer.ts +0 -116
  120. package/src/workspace/payload.ts +0 -44
  121. package/src/workspace/retriever.ts +0 -70
  122. package/src/workspace/schematic/external.ts +0 -11
  123. package/src/workspace/schematic/payload.ts +0 -38
  124. package/src/workspace/schematic/retriever.ts +0 -42
  125. package/src/workspace/schematic/writer.ts +0 -140
  126. package/src/workspace/writer.ts +0 -111
@@ -1,16 +1,58 @@
1
+ import { ontology } from '../../ontology';
1
2
  import { UnaryClient } from '@synnaxlabs/freighter';
2
- import { UnknownRecord } from '@synnaxlabs/x/record';
3
- import { Key, LinePlot, Params } from './payload';
4
- import { NewLinePlot } from './writer';
3
+ import { UnknownRecord } from '@synnaxlabs/x';
4
+ import { z } from 'zod';
5
+ export declare const keyZ: z.ZodString;
6
+ export type Key = z.infer<typeof keyZ>;
7
+ export type Params = Key | Key[];
8
+ export declare const linePlotZ: z.ZodObject<{
9
+ key: z.ZodString;
10
+ name: z.ZodString;
11
+ data: z.ZodUnion<[z.ZodRecord<z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodSymbol]>, z.ZodUnknown>, z.ZodEffects<z.ZodString, UnknownRecord, string>]>;
12
+ }, "strip", z.ZodTypeAny, {
13
+ name: string;
14
+ key: string;
15
+ data: UnknownRecord | Record<string | number | symbol, unknown>;
16
+ }, {
17
+ name: string;
18
+ key: string;
19
+ data: string | Record<string | number | symbol, unknown>;
20
+ }>;
21
+ export type LinePlot = z.infer<typeof linePlotZ>;
22
+ export declare const ONTOLOGY_TYPE: ontology.ResourceType;
23
+ export declare const ontologyID: (key: Key) => ontology.ID;
24
+ export declare const newLinePlotZ: z.ZodEffects<z.ZodObject<{
25
+ name: z.ZodString;
26
+ key: z.ZodOptional<z.ZodString>;
27
+ data: z.ZodUnion<[z.ZodRecord<z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodSymbol]>, z.ZodUnknown>, z.ZodEffects<z.ZodString, UnknownRecord, string>]>;
28
+ }, "strip", z.ZodTypeAny, {
29
+ name: string;
30
+ data: UnknownRecord | Record<string | number | symbol, unknown>;
31
+ key?: string | undefined;
32
+ }, {
33
+ name: string;
34
+ data: string | Record<string | number | symbol, unknown>;
35
+ key?: string | undefined;
36
+ }>, {
37
+ data: string;
38
+ name: string;
39
+ key?: string | undefined;
40
+ }, {
41
+ name: string;
42
+ data: string | Record<string | number | symbol, unknown>;
43
+ key?: string | undefined;
44
+ }>;
45
+ export type NewLinePlot = z.input<typeof newLinePlotZ>;
5
46
  export declare class Client {
6
- private readonly writer;
7
- private readonly retriever;
47
+ private readonly client;
8
48
  constructor(client: UnaryClient);
9
49
  create(workspace: string, linePlot: NewLinePlot): Promise<LinePlot>;
50
+ create(workspace: string, linePlots: NewLinePlot[]): Promise<LinePlot[]>;
10
51
  rename(key: Key, name: string): Promise<void>;
11
52
  setData(key: Key, data: UnknownRecord): Promise<void>;
12
53
  retrieve(key: Key): Promise<LinePlot>;
13
54
  retrieve(keys: Key[]): Promise<LinePlot[]>;
14
- delete(keys: Params): Promise<void>;
55
+ delete(key: Key): Promise<void>;
56
+ delete(keys: Key[]): Promise<void>;
15
57
  }
16
58
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/workspace/lineplot/client.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,QAAQ,EAAE,KAAK,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAEpF,OAAO,EAAE,KAAK,WAAW,EAAU,MAAM,6BAA6B,CAAC;AAEvE,qBAAa,MAAM;IACjB,OAAO,CAAC,QAAQ,CAAC,MA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D,eAAO,MAAM,UAAU,QAAS,GAAG,KAAG,QAAQ,CAAC,EACA,CAAC;AAQhD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;EAGtB,CAAC;AAEJ,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAWvD,qBAAa,MAAM;IACjB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAc;gBAEzB,MAAM,EAAE,WAAW;IAIzB,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC;IACnE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAiBxE,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAU7C,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAUrD,QAAQ,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC;IACrC,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAc1C,MAAM,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAC/B,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAWzC"}
@@ -1,2 +1,2 @@
1
- export * as linePlot from './external';
1
+ export * as linePlot from './client';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/workspace/lineplot/index.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,QAAQ,MAAM,+BAA+B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/workspace/lineplot/index.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,QAAQ,MAAM,6BAA6B,CAAC"}
@@ -1,16 +1,58 @@
1
+ import { ontology } from '../../ontology';
1
2
  import { UnaryClient } from '@synnaxlabs/freighter';
2
- import { UnknownRecord } from '@synnaxlabs/x/record';
3
- import { Key, Log, Params } from './payload';
4
- import { NewLog } from './writer';
3
+ import { UnknownRecord } from '@synnaxlabs/x';
4
+ import { z } from 'zod';
5
+ export declare const keyZ: z.ZodString;
6
+ export type Key = z.infer<typeof keyZ>;
7
+ export type Params = Key | Key[];
8
+ export declare const logZ: z.ZodObject<{
9
+ key: z.ZodString;
10
+ name: z.ZodString;
11
+ data: z.ZodUnion<[z.ZodRecord<z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodSymbol]>, z.ZodUnknown>, z.ZodEffects<z.ZodString, UnknownRecord, string>]>;
12
+ }, "strip", z.ZodTypeAny, {
13
+ name: string;
14
+ key: string;
15
+ data: UnknownRecord | Record<string | number | symbol, unknown>;
16
+ }, {
17
+ name: string;
18
+ key: string;
19
+ data: string | Record<string | number | symbol, unknown>;
20
+ }>;
21
+ export type Log = z.infer<typeof logZ>;
22
+ export declare const ONTOLOGY_TYPE: ontology.ResourceType;
23
+ export declare const ontologyID: (key: Key) => ontology.ID;
24
+ export declare const newLogZ: z.ZodEffects<z.ZodObject<{
25
+ name: z.ZodString;
26
+ key: z.ZodOptional<z.ZodString>;
27
+ data: z.ZodUnion<[z.ZodRecord<z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodSymbol]>, z.ZodUnknown>, z.ZodEffects<z.ZodString, UnknownRecord, string>]>;
28
+ }, "strip", z.ZodTypeAny, {
29
+ name: string;
30
+ data: UnknownRecord | Record<string | number | symbol, unknown>;
31
+ key?: string | undefined;
32
+ }, {
33
+ name: string;
34
+ data: string | Record<string | number | symbol, unknown>;
35
+ key?: string | undefined;
36
+ }>, {
37
+ data: string;
38
+ name: string;
39
+ key?: string | undefined;
40
+ }, {
41
+ name: string;
42
+ data: string | Record<string | number | symbol, unknown>;
43
+ key?: string | undefined;
44
+ }>;
45
+ export type NewLog = z.input<typeof newLogZ>;
5
46
  export declare class Client {
6
- private readonly writer;
7
- private readonly retriever;
47
+ private readonly client;
8
48
  constructor(client: UnaryClient);
9
49
  create(workspace: string, log: NewLog): Promise<Log>;
50
+ create(workspace: string, logs: NewLog[]): Promise<Log[]>;
10
51
  rename(key: Key, name: string): Promise<void>;
11
52
  setData(key: Key, data: UnknownRecord): Promise<void>;
12
53
  retrieve(key: Key): Promise<Log>;
13
54
  retrieve(keys: Key[]): Promise<Log[]>;
14
- delete(keys: Params): Promise<void>;
55
+ delete(key: Key): Promise<void>;
56
+ delete(keys: Key[]): Promise<void>;
15
57
  }
16
58
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/workspace/log/client.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,GAAG,EAAE,KAAK,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAE1E,OAAO,EAAE,KAAK,MAAM,EAAU,MAAM,wBAAwB,CAAC;AAE7D,qBAAa,MAAM;IACjB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAY;gBAE1B,MAAM,EAAE,WAAW;IAKzB,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAIpD,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI7C,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,IAA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AE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IACpD,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAczD,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAU7C,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAUrD,QAAQ,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IAChC,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAcrC,MAAM,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAC/B,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAWzC"}
@@ -1,2 +1,2 @@
1
- export * as log from './external';
1
+ export * as log from './client';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/workspace/log/index.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,GAAG,MAAM,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/workspace/log/index.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,GAAG,MAAM,wBAAwB,CAAC"}
@@ -1,17 +1,83 @@
1
+ import { ontology } from '../../ontology';
1
2
  import { UnaryClient } from '@synnaxlabs/freighter';
2
- import { UnknownRecord } from '@synnaxlabs/x/record';
3
- import { Key, Params, Schematic } from './payload';
4
- import { NewSchematic } from './writer';
3
+ import { UnknownRecord } from '@synnaxlabs/x';
4
+ import { z } from 'zod';
5
+ export declare const keyZ: z.ZodString;
6
+ export type Key = z.infer<typeof keyZ>;
7
+ export type Params = Key | Key[];
8
+ export declare const schematicZ: z.ZodObject<{
9
+ key: z.ZodString;
10
+ name: z.ZodString;
11
+ data: z.ZodUnion<[z.ZodRecord<z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodSymbol]>, z.ZodUnknown>, z.ZodEffects<z.ZodString, UnknownRecord, string>]>;
12
+ snapshot: z.ZodBoolean;
13
+ }, "strip", z.ZodTypeAny, {
14
+ name: string;
15
+ key: string;
16
+ data: UnknownRecord | Record<string | number | symbol, unknown>;
17
+ snapshot: boolean;
18
+ }, {
19
+ name: string;
20
+ key: string;
21
+ data: string | Record<string | number | symbol, unknown>;
22
+ snapshot: boolean;
23
+ }>;
24
+ export declare const schematicRemoteZ: z.ZodObject<{
25
+ key: z.ZodString;
26
+ name: z.ZodString;
27
+ snapshot: z.ZodBoolean;
28
+ data: z.ZodEffects<z.ZodString, UnknownRecord, string>;
29
+ }, "strip", z.ZodTypeAny, {
30
+ name: string;
31
+ key: string;
32
+ data: UnknownRecord;
33
+ snapshot: boolean;
34
+ }, {
35
+ name: string;
36
+ key: string;
37
+ data: string;
38
+ snapshot: boolean;
39
+ }>;
40
+ export type Schematic = z.infer<typeof schematicZ>;
41
+ export declare const ONTOLOGY_TYPE: ontology.ResourceType;
42
+ export declare const ontologyID: (key: Key) => ontology.ID;
43
+ export declare const newSchematicZ: z.ZodEffects<z.ZodObject<{
44
+ name: z.ZodString;
45
+ key: z.ZodOptional<z.ZodString>;
46
+ data: z.ZodUnion<[z.ZodRecord<z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodSymbol]>, z.ZodUnknown>, z.ZodEffects<z.ZodString, UnknownRecord, string>]>;
47
+ snapshot: z.ZodOptional<z.ZodBoolean>;
48
+ }, "strip", z.ZodTypeAny, {
49
+ name: string;
50
+ data: UnknownRecord | Record<string | number | symbol, unknown>;
51
+ key?: string | undefined;
52
+ snapshot?: boolean | undefined;
53
+ }, {
54
+ name: string;
55
+ data: string | Record<string | number | symbol, unknown>;
56
+ key?: string | undefined;
57
+ snapshot?: boolean | undefined;
58
+ }>, {
59
+ data: string;
60
+ name: string;
61
+ key?: string | undefined;
62
+ snapshot?: boolean | undefined;
63
+ }, {
64
+ name: string;
65
+ data: string | Record<string | number | symbol, unknown>;
66
+ key?: string | undefined;
67
+ snapshot?: boolean | undefined;
68
+ }>;
69
+ export type NewSchematic = z.input<typeof newSchematicZ>;
5
70
  export declare class Client {
6
- private readonly writer;
7
- private readonly retriever;
71
+ private readonly client;
8
72
  constructor(client: UnaryClient);
9
73
  create(workspace: string, schematic: NewSchematic): Promise<Schematic>;
74
+ create(workspace: string, schematics: NewSchematic[]): Promise<Schematic[]>;
10
75
  rename(key: Key, name: string): Promise<void>;
11
76
  setData(key: Key, data: UnknownRecord): Promise<void>;
12
77
  retrieve(key: Key): Promise<Schematic>;
13
78
  retrieve(keys: Key[]): Promise<Schematic[]>;
14
- delete(keys: Params): Promise<void>;
79
+ delete(key: Key): Promise<void>;
80
+ delete(keys: Key[]): Promise<void>;
15
81
  copy(key: Key, name: string, snapshot: boolean): Promise<Schematic>;
16
82
  }
17
83
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/workspace/schematic/client.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,MAAM,EAAE,KAAK,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAEtF,OAAO,EAAE,KAAK,YAAY,EAAU,MAAM,8BAA8B,CAAC;AAEzE,qBAAa,MAAM;IACjB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAY;gBAE1B,MAAM,EAAE,WAAW;IAKzB,MAAM,CAAC,SA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index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/workspace/schematic/index.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,SAAS,MAAM,gCAAgC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/workspace/schematic/index.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,SAAS,MAAM,8BAA8B,CAAC"}
@@ -0,0 +1,71 @@
1
+ import { ontology } from '../../ontology';
2
+ import { UnaryClient } from '@synnaxlabs/freighter';
3
+ import { UnknownRecord } from '@synnaxlabs/x';
4
+ import { z } from 'zod';
5
+ export declare const keyZ: z.ZodString;
6
+ export type Key = z.infer<typeof keyZ>;
7
+ export type Params = Key | Key[];
8
+ export declare const tableZ: z.ZodObject<{
9
+ key: z.ZodString;
10
+ name: z.ZodString;
11
+ data: z.ZodUnion<[z.ZodRecord<z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodSymbol]>, z.ZodUnknown>, z.ZodEffects<z.ZodString, UnknownRecord, string>]>;
12
+ }, "strip", z.ZodTypeAny, {
13
+ name: string;
14
+ key: string;
15
+ data: UnknownRecord | Record<string | number | symbol, unknown>;
16
+ }, {
17
+ name: string;
18
+ key: string;
19
+ data: string | Record<string | number | symbol, unknown>;
20
+ }>;
21
+ export type Table = z.infer<typeof tableZ>;
22
+ export declare const ONTOLOGY_TYPE: ontology.ResourceType;
23
+ export declare const ontologyID: (key: Key) => ontology.ID;
24
+ export declare const newTableZ: z.ZodEffects<z.ZodObject<{
25
+ name: z.ZodString;
26
+ key: z.ZodOptional<z.ZodString>;
27
+ data: z.ZodUnion<[z.ZodRecord<z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodSymbol]>, z.ZodUnknown>, z.ZodEffects<z.ZodString, UnknownRecord, string>]>;
28
+ }, "strip", z.ZodTypeAny, {
29
+ name: string;
30
+ data: UnknownRecord | Record<string | number | symbol, unknown>;
31
+ key?: string | undefined;
32
+ }, {
33
+ name: string;
34
+ data: string | Record<string | number | symbol, unknown>;
35
+ key?: string | undefined;
36
+ }>, {
37
+ data: string;
38
+ name: string;
39
+ key?: string | undefined;
40
+ }, {
41
+ name: string;
42
+ data: string | Record<string | number | symbol, unknown>;
43
+ key?: string | undefined;
44
+ }>;
45
+ export type NewTable = z.input<typeof newTableZ>;
46
+ export declare const tableRemoteZ: z.ZodObject<{
47
+ key: z.ZodString;
48
+ name: z.ZodString;
49
+ data: z.ZodEffects<z.ZodString, UnknownRecord, string>;
50
+ }, "strip", z.ZodTypeAny, {
51
+ name: string;
52
+ key: string;
53
+ data: UnknownRecord;
54
+ }, {
55
+ name: string;
56
+ key: string;
57
+ data: string;
58
+ }>;
59
+ export declare class Client {
60
+ private readonly client;
61
+ constructor(client: UnaryClient);
62
+ create(workspace: string, table: NewTable): Promise<Table>;
63
+ create(workspace: string, tables: NewTable[]): Promise<Table[]>;
64
+ rename(key: Key, name: string): Promise<void>;
65
+ setData(key: Key, data: UnknownRecord): Promise<void>;
66
+ retrieve(key: Key): Promise<Table>;
67
+ retrieve(keys: Key[]): Promise<Table[]>;
68
+ delete(key: Key): Promise<void>;
69
+ delete(keys: Key[]): Promise<void>;
70
+ }
71
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/workspace/table/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAgB,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAW,aAAa,EAAE,MAAM,eAAe,CAAC;AAEvD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,IAAI,aAAoB,CAAC;AACtC,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AACvC,MAAM,MAAM,MAAM,GAAG,GAAG,GAAG,GAAG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@ -0,0 +1,2 @@
1
+ export * as table from './client';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/workspace/table/index.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=table.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table.spec.d.ts","sourceRoot":"","sources":["../../../src/workspace/table/table.spec.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synnaxlabs/client",
3
- "version": "0.34.0",
3
+ "version": "0.36.0",
4
4
  "description": "The Synnax Client Library",
5
5
  "keywords": [
6
6
  "synnax",
@@ -25,22 +25,22 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "async-mutex": "^0.5.0",
28
- "zod": "^3.23.8",
29
- "@synnaxlabs/freighter": "0.34.0",
30
- "@synnaxlabs/x": "0.34.0"
28
+ "zod": "^3.24.1",
29
+ "@synnaxlabs/x": "0.36.0",
30
+ "@synnaxlabs/freighter": "0.36.0"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/node": "^22.7.5",
34
34
  "@types/uuid": "^10.0.0",
35
- "@vitest/coverage-v8": "^2.1.4",
36
- "eslint": "^9.14.0",
35
+ "@vitest/coverage-v8": "^2.1.8",
36
+ "eslint": "^9.16.0",
37
37
  "typescript": "^5.6.3",
38
38
  "uuid": "^10.0.0",
39
- "vite": "^5.4.10",
40
- "vitest": "^2.1.4",
41
- "@synnaxlabs/vite-plugin": "0.0.1",
39
+ "vite": "^6.0.3",
40
+ "vitest": "^2.1.8",
42
41
  "@synnaxlabs/tsconfig": "0.0.2",
43
- "eslint-config-synnaxlabs": "0.0.1"
42
+ "eslint-config-synnaxlabs": "0.0.1",
43
+ "@synnaxlabs/vite-plugin": "0.0.1"
44
44
  },
45
45
  "type": "module",
46
46
  "types": "dist/index.d.ts",
package/src/client.ts CHANGED
@@ -28,6 +28,7 @@ import { ranger } from "@/ranger";
28
28
  import { Transport } from "@/transport";
29
29
  import { user } from "@/user";
30
30
  import { workspace } from "@/workspace";
31
+ import { breaker } from "@synnaxlabs/x";
31
32
 
32
33
  export const synnaxPropsZ = z.object({
33
34
  host: z
@@ -49,6 +50,7 @@ export const synnaxPropsZ = z.object({
49
50
  connectivityPollFrequency: TimeSpan.z.default(TimeSpan.seconds(30)),
50
51
  secure: z.boolean().optional().default(false),
51
52
  name: z.string().optional(),
53
+ retry: breaker.breakerConfig.optional(),
52
54
  });
53
55
 
54
56
  export type SynnaxProps = z.input<typeof synnaxPropsZ>;
@@ -101,8 +103,20 @@ export default class Synnax extends framer.Client {
101
103
  */
102
104
  constructor(props_: SynnaxProps) {
103
105
  const props = synnaxPropsZ.parse(props_);
104
- const { host, port, username, password, connectivityPollFrequency, secure } = props;
105
- const transport = new Transport(new URL({ host, port: Number(port) }), secure);
106
+ const {
107
+ host,
108
+ port,
109
+ username,
110
+ password,
111
+ connectivityPollFrequency,
112
+ secure,
113
+ retry: breaker,
114
+ } = props;
115
+ const transport = new Transport(
116
+ new URL({ host, port: Number(port) }),
117
+ breaker,
118
+ secure,
119
+ );
106
120
  transport.use(errorsMiddleware);
107
121
  let auth_: auth.Client | undefined;
108
122
  if (username != null && password != null) {
@@ -47,7 +47,7 @@ export class StateTracker
47
47
 
48
48
  constructor(streamer: FrameStreamer) {
49
49
  super(streamer, (frame) => {
50
- const update: Update = this.codec.decode(frame.series[0].data);
50
+ const update: Update = this.codec.decode(frame.series[0].buffer);
51
51
  this.merge(update);
52
52
  return [update.transfers, true];
53
53
  });
@@ -11,6 +11,7 @@ import { DataType, Series, TimeRange } from "@synnaxlabs/x/telem";
11
11
  import { describe, expect, it, test } from "vitest";
12
12
 
13
13
  import { framer } from "@/framer";
14
+ import { equal } from "assert";
14
15
 
15
16
  describe("framer.Frame", () => {
16
17
  describe("construction", () => {
@@ -79,9 +80,7 @@ describe("framer.Frame", () => {
79
80
  it("should correctly parse a series payload", () => {
80
81
  const f = new framer.Frame({
81
82
  keys: [12],
82
- series: [
83
- { dataType: new DataType("float32"), data: new SharedArrayBuffer(12) },
84
- ],
83
+ series: [{ dataType: new DataType("float32"), data: new ArrayBuffer(12) }],
85
84
  });
86
85
  expect(f.length.valueOf()).toEqual(3);
87
86
  expect(f.columns.length).toEqual(1);
@@ -515,4 +514,34 @@ describe("framer.Frame", () => {
515
514
  expect(f.at(2)).toEqual({ 12: 3, 13: undefined });
516
515
  });
517
516
  });
517
+
518
+ describe("digest", () => {
519
+ it("should return digest information about the frame", () => {
520
+ const s1 = new Series({
521
+ data: new Float32Array([1, 2, 3]),
522
+ timeRange: new TimeRange(40, 50000),
523
+ });
524
+ const s2 = new Series({
525
+ data: new Float32Array([4, 5, 6]),
526
+ timeRange: new TimeRange(50001, 60000),
527
+ });
528
+ const s3 = new Series({
529
+ data: new Float32Array([7, 8, 9]),
530
+ timeRange: new TimeRange(500, 50001),
531
+ });
532
+ const f = new framer.Frame(
533
+ new Map([
534
+ [12, [s1, s2]],
535
+ [13, [s3]],
536
+ ]),
537
+ );
538
+ const digest = f.digest;
539
+ expect(Object.keys(digest)).toEqual(["12", "13"]);
540
+ expect(digest[12].length).toEqual(2);
541
+ expect(digest[13].length).toEqual(1);
542
+ expect(digest[12][0]).toEqual(s1.digest);
543
+ expect(digest[12][1]).toEqual(s2.digest);
544
+ expect(digest[13][0]).toEqual(s3.digest);
545
+ });
546
+ });
518
547
  });
@@ -10,6 +10,7 @@
10
10
  import {
11
11
  MultiSeries,
12
12
  Series,
13
+ SeriesDigest,
13
14
  type SeriesPayload,
14
15
  Size,
15
16
  type TelemValue,
@@ -31,6 +32,8 @@ import { UnexpectedError, ValidationError } from "@/errors";
31
32
 
32
33
  type ColumnType = "key" | "name" | null;
33
34
 
35
+ export interface FrameDigest extends Record<KeyOrName, SeriesDigest[]> {}
36
+
34
37
  const columnType = (columns: Params): ColumnType => {
35
38
  const arrKeys = toArray(columns);
36
39
  if (arrKeys.length === 0) return null;
@@ -392,6 +395,20 @@ export class Frame {
392
395
  return new Size(this.series.reduce((acc, v) => acc.add(v.byteLength), Size.ZERO));
393
396
  }
394
397
 
398
+ /**
399
+ * @returns a digest of information about the structure of the frame for debugging
400
+ * purposes.
401
+ */
402
+ get digest(): FrameDigest {
403
+ const digest: FrameDigest = {};
404
+ this.keys.forEach((k, i) => {
405
+ const sd = this.series[i].digest;
406
+ if (k in digest) digest[k].push(sd);
407
+ else digest[k] = [sd];
408
+ });
409
+ return digest;
410
+ }
411
+
395
412
  /** @returns the total number of samples in the frame. */
396
413
  get length(): number {
397
414
  return this.series.reduce((acc, v) => acc + v.length, 0);
@@ -117,11 +117,17 @@ export class Client implements AsyncTermSearcher<string, DeviceKey, Device> {
117
117
  ).devices;
118
118
  }
119
119
 
120
- async create(device: NewDevice): Promise<Device>;
120
+ async create<P extends UnknownRecord = UnknownRecord>(
121
+ device: NewDevice<P>,
122
+ ): Promise<Device<P>>;
121
123
 
122
- async create(devices: NewDevice[]): Promise<Device[]>;
124
+ async create<P extends UnknownRecord = UnknownRecord>(
125
+ devices: NewDevice<P>[],
126
+ ): Promise<Device<P>[]>;
123
127
 
124
- async create(devices: NewDevice | NewDevice[]): Promise<Device | Device[]> {
128
+ async create<P extends UnknownRecord = UnknownRecord>(
129
+ devices: NewDevice<P> | NewDevice<P>[],
130
+ ): Promise<Device<P> | Device<P>[]> {
125
131
  const isSingle = !Array.isArray(devices);
126
132
  const res = await sendRequired(
127
133
  this.client,
@@ -130,7 +136,7 @@ export class Client implements AsyncTermSearcher<string, DeviceKey, Device> {
130
136
  createReqZ,
131
137
  createResZ,
132
138
  );
133
- return isSingle ? res.devices[0] : res.devices;
139
+ return isSingle ? (res.devices[0] as Device<P>) : (res.devices as Device<P>[]);
134
140
  }
135
141
 
136
142
  async delete(keys: string | string[]): Promise<void> {