@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 +0,0 @@
1
- {"version":3,"file":"retriever.d.ts","sourceRoot":"","sources":["../../../src/workspace/log/retriever.ts"],"names":[],"mappings":"AASA,OAAO,EAAgB,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAIvE,OAAO,EAAE,KAAK,GAAG,EAAc,KAAK,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAK5E,qBAAa,SAAS;IACpB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA6B;IACtD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAc;gBAEzB,MAAM,EAAE,WAAW;IAIzB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;CAW7C"}
@@ -1,35 +0,0 @@
1
- import { UnaryClient } from '@synnaxlabs/freighter';
2
- import { UnknownRecord } from '@synnaxlabs/x/record';
3
- import { z } from 'zod';
4
- import { Key, Log, Params } from './payload';
5
- export declare const newLogZ: z.ZodEffects<z.ZodObject<{
6
- name: z.ZodString;
7
- key: z.ZodOptional<z.ZodString>;
8
- data: z.ZodUnion<[z.ZodRecord<z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodSymbol]>, z.ZodUnknown>, z.ZodEffects<z.ZodString, UnknownRecord, string>]>;
9
- }, "strip", z.ZodTypeAny, {
10
- name: string;
11
- data: UnknownRecord | Record<string | number | symbol, unknown>;
12
- key?: string | undefined;
13
- }, {
14
- name: string;
15
- data: string | Record<string | number | symbol, unknown>;
16
- key?: string | undefined;
17
- }>, {
18
- data: string;
19
- name: string;
20
- key?: string | undefined;
21
- }, {
22
- name: string;
23
- data: string | Record<string | number | symbol, unknown>;
24
- key?: string | undefined;
25
- }>;
26
- export type NewLog = z.input<typeof newLogZ>;
27
- export declare class Writer {
28
- private readonly client;
29
- constructor(client: UnaryClient);
30
- create(workspace: string, log: NewLog): Promise<Log>;
31
- delete(logs: Params): Promise<void>;
32
- rename(log: Key, name: string): Promise<void>;
33
- setData(log: Key, data: UnknownRecord): Promise<void>;
34
- }
35
- //# sourceMappingURL=writer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"writer.d.ts","sourceRoot":"","sources":["../../../src/workspace/log/writer.ts"],"names":[],"mappings":"AASA,OAAO,EAAgB,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,KAAK,GAAG,EAER,KAAK,GAAG,EAGR,KAAK,MAAM,EACZ,MAAM,yBAAyB,CAAC;AAGjC,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;EAGjB,CAAC;AAEJ,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAC;AAoC7C,qBAAa,MAAM;IACjB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAc;gBAEzB,MAAM,EAAE,WAAW;IAIzB,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAapD,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAWnC,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;CAS5D"}
@@ -1,38 +0,0 @@
1
- import { UnknownRecord } from '@synnaxlabs/x/record';
2
- import { z } from 'zod';
3
- import { ontology } from '../ontology';
4
- export declare const keyZ: z.ZodString;
5
- export type Key = z.infer<typeof keyZ>;
6
- export type Params = Key | Key[];
7
- export declare const workspaceZ: z.ZodObject<{
8
- name: z.ZodString;
9
- key: z.ZodString;
10
- layout: z.ZodUnion<[z.ZodRecord<z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodSymbol]>, z.ZodUnknown>, z.ZodEffects<z.ZodString, UnknownRecord, string>]>;
11
- }, "strip", z.ZodTypeAny, {
12
- name: string;
13
- key: string;
14
- layout: UnknownRecord | Record<string | number | symbol, unknown>;
15
- }, {
16
- name: string;
17
- key: string;
18
- layout: string | Record<string | number | symbol, unknown>;
19
- }>;
20
- export declare const workspaceRemoteZ: z.ZodObject<z.objectUtil.extendShape<Omit<{
21
- name: z.ZodString;
22
- key: z.ZodString;
23
- layout: z.ZodUnion<[z.ZodRecord<z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodSymbol]>, z.ZodUnknown>, z.ZodEffects<z.ZodString, UnknownRecord, string>]>;
24
- }, "layout">, {
25
- layout: z.ZodEffects<z.ZodString, UnknownRecord, string>;
26
- }>, "strip", z.ZodTypeAny, {
27
- name: string;
28
- key: string;
29
- layout: UnknownRecord;
30
- }, {
31
- name: string;
32
- key: string;
33
- layout: string;
34
- }>;
35
- export type Workspace = z.infer<typeof workspaceZ>;
36
- export declare const ONTOLOGY_TYPE: ontology.ResourceType;
37
- export declare const ontologyID: (key: Key) => ontology.ID;
38
- //# sourceMappingURL=payload.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../src/workspace/payload.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,aAAa,EAAkB,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,eAAO,MAAM,IAAI,aAAoB,CAAC;AAEtC,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAEvC,MAAM,MAAM,MAAM,GAAG,GAAG,GAAG,GAAG,EAAE,CAAC;AAUjC,eAAO,MAAM,UAAU;;;;;;;;;;;;EAIrB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;EAE3B,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAEnD,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,YAA0B,CAAC;AAEhE,eAAO,MAAM,UAAU,QAAS,GAAG,KAAG,QAAQ,CAAC,EACA,CAAC"}
@@ -1,13 +0,0 @@
1
- import { UnaryClient } from '@synnaxlabs/freighter';
2
- import { Params, Workspace } from './payload';
3
- export declare class Retriever {
4
- private static readonly ENDPOINT;
5
- private readonly client;
6
- constructor(client: UnaryClient);
7
- retrieve(workspaces: Params): Promise<Workspace[]>;
8
- retrieveByAuthor(author: string): Promise<Workspace[]>;
9
- search(term: string): Promise<Workspace[]>;
10
- page(offset: number, limit: number): Promise<Workspace[]>;
11
- private execute;
12
- }
13
- //# sourceMappingURL=retriever.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"retriever.d.ts","sourceRoot":"","sources":["../../src/workspace/retriever.ts"],"names":[],"mappings":"AASA,OAAO,EAAgB,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAKvE,OAAO,EAEL,KAAK,MAAM,EACX,KAAK,SAAS,EAEf,MAAM,qBAAqB,CAAC;AAc7B,qBAAa,SAAS;IACpB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAyB;IAEzD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAc;gBAEzB,MAAM,EAAE,WAAW;IAIzB,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAKlD,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAItD,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAI1C,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;YAIjD,OAAO;CAUtB"}
@@ -1,3 +0,0 @@
1
- export * from './client';
2
- export * from './payload';
3
- //# sourceMappingURL=external.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"external.d.ts","sourceRoot":"","sources":["../../../src/workspace/schematic/external.ts"],"names":[],"mappings":"AASA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC"}
@@ -1,42 +0,0 @@
1
- import { UnknownRecord } from '@synnaxlabs/x/record';
2
- import { z } from 'zod';
3
- import { ontology } from '../../ontology';
4
- export declare const keyZ: z.ZodString;
5
- export type Key = z.infer<typeof keyZ>;
6
- export type Params = Key | Key[];
7
- export declare const schematicZ: z.ZodObject<{
8
- key: z.ZodString;
9
- name: z.ZodString;
10
- data: z.ZodUnion<[z.ZodRecord<z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodSymbol]>, z.ZodUnknown>, z.ZodEffects<z.ZodString, UnknownRecord, string>]>;
11
- snapshot: z.ZodBoolean;
12
- }, "strip", z.ZodTypeAny, {
13
- name: string;
14
- key: string;
15
- data: UnknownRecord | Record<string | number | symbol, unknown>;
16
- snapshot: boolean;
17
- }, {
18
- name: string;
19
- key: string;
20
- data: string | Record<string | number | symbol, unknown>;
21
- snapshot: boolean;
22
- }>;
23
- export declare const schematicRemoteZ: z.ZodObject<{
24
- key: z.ZodString;
25
- name: z.ZodString;
26
- snapshot: z.ZodBoolean;
27
- data: z.ZodEffects<z.ZodString, UnknownRecord, string>;
28
- }, "strip", z.ZodTypeAny, {
29
- name: string;
30
- key: string;
31
- data: UnknownRecord;
32
- snapshot: boolean;
33
- }, {
34
- name: string;
35
- key: string;
36
- data: string;
37
- snapshot: boolean;
38
- }>;
39
- export type Schematic = z.infer<typeof schematicZ>;
40
- export declare const ONTOLOGY_TYPE: ontology.ResourceType;
41
- export declare const ontologyID: (key: Key) => ontology.ID;
42
- //# sourceMappingURL=payload.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../../src/workspace/schematic/payload.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,aAAa,EAAkB,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,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,EAAE,CAAC;AAEjC,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;EAKrB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;EAK3B,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAEnD,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,YAA0B,CAAC;AAEhE,eAAO,MAAM,UAAU,QAAS,GAAG,KAAG,QAAQ,CAAC,EACA,CAAC"}
@@ -1,9 +0,0 @@
1
- import { UnaryClient } from '@synnaxlabs/freighter';
2
- import { Params, Schematic } from './payload';
3
- export declare class Retriever {
4
- private readonly ENDPOINT;
5
- private readonly client;
6
- constructor(client: UnaryClient);
7
- retrieve(schematics: Params): Promise<Schematic[]>;
8
- }
9
- //# sourceMappingURL=retriever.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"retriever.d.ts","sourceRoot":"","sources":["../../../src/workspace/schematic/retriever.ts"],"names":[],"mappings":"AASA,OAAO,EAAgB,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAIvE,OAAO,EACL,KAAK,MAAM,EACX,KAAK,SAAS,EAEf,MAAM,+BAA+B,CAAC;AAKvC,qBAAa,SAAS;IACpB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmC;IAC5D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAc;gBAEzB,MAAM,EAAE,WAAW;IAIzB,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;CAWzD"}
@@ -1,41 +0,0 @@
1
- import { UnaryClient } from '@synnaxlabs/freighter';
2
- import { UnknownRecord } from '@synnaxlabs/x/record';
3
- import { z } from 'zod';
4
- import { Key, Params, Schematic } from './payload';
5
- export declare const newSchematicZ: z.ZodEffects<z.ZodObject<{
6
- name: z.ZodString;
7
- key: z.ZodOptional<z.ZodString>;
8
- data: z.ZodUnion<[z.ZodRecord<z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodSymbol]>, z.ZodUnknown>, z.ZodEffects<z.ZodString, UnknownRecord, string>]>;
9
- snapshot: z.ZodOptional<z.ZodBoolean>;
10
- }, "strip", z.ZodTypeAny, {
11
- name: string;
12
- data: UnknownRecord | Record<string | number | symbol, unknown>;
13
- key?: string | undefined;
14
- snapshot?: boolean | undefined;
15
- }, {
16
- name: string;
17
- data: string | Record<string | number | symbol, unknown>;
18
- key?: string | undefined;
19
- snapshot?: boolean | undefined;
20
- }>, {
21
- data: string;
22
- name: string;
23
- key?: string | undefined;
24
- snapshot?: boolean | undefined;
25
- }, {
26
- name: string;
27
- data: string | Record<string | number | symbol, unknown>;
28
- key?: string | undefined;
29
- snapshot?: boolean | undefined;
30
- }>;
31
- export type NewSchematic = z.input<typeof newSchematicZ>;
32
- export declare class Writer {
33
- private readonly client;
34
- constructor(client: UnaryClient);
35
- create(workspace: string, schematic: NewSchematic): Promise<Schematic>;
36
- copy(key: Key, name: string, snapshot: boolean): Promise<Schematic>;
37
- delete(schematics: Params): Promise<void>;
38
- rename(schematic: Key, name: string): Promise<void>;
39
- setData(schematic: Key, data: UnknownRecord): Promise<void>;
40
- }
41
- //# sourceMappingURL=writer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"writer.d.ts","sourceRoot":"","sources":["../../../src/workspace/schematic/writer.ts"],"names":[],"mappings":"AASA,OAAO,EAAgB,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EACL,KAAK,GAAG,EAER,KAAK,MAAM,EACX,KAAK,SAAS,EAGf,MAAM,+BAA+B,CAAC;AAEvC,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;EAKrB,CAAC;AAEN,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AA+CzD,qBAAa,MAAM;IACjB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAc;gBAEzB,MAAM,EAAE,WAAW;IAIzB,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,GAAG,OAAO,CAAC,SAAS,CAAC;IAatE,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC;IAWnE,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAWzC,MAAM,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAUnD,OAAO,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;CASlE"}
@@ -1,66 +0,0 @@
1
- import { UnaryClient } from '@synnaxlabs/freighter';
2
- import { UnknownRecord } from '@synnaxlabs/x/record';
3
- import { z } from 'zod';
4
- import { Workspace } from './payload';
5
- declare const newWorkspaceZ: z.ZodEffects<z.ZodObject<{
6
- name: z.ZodString;
7
- key: z.ZodOptional<z.ZodString>;
8
- layout: z.ZodUnion<[z.ZodRecord<z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodSymbol]>, z.ZodUnknown>, z.ZodEffects<z.ZodString, UnknownRecord, string>]>;
9
- }, "strip", z.ZodTypeAny, {
10
- name: string;
11
- layout: UnknownRecord | Record<string | number | symbol, unknown>;
12
- key?: string | undefined;
13
- }, {
14
- name: string;
15
- layout: string | Record<string | number | symbol, unknown>;
16
- key?: string | undefined;
17
- }>, {
18
- layout: string;
19
- name: string;
20
- key?: string | undefined;
21
- }, {
22
- name: string;
23
- layout: string | Record<string | number | symbol, unknown>;
24
- key?: string | undefined;
25
- }>;
26
- export type NewWorkspace = z.input<typeof newWorkspaceZ>;
27
- declare const createResZ: z.ZodObject<{
28
- workspaces: z.ZodArray<z.ZodObject<z.objectUtil.extendShape<Omit<{
29
- name: z.ZodString;
30
- key: z.ZodString;
31
- layout: z.ZodUnion<[z.ZodRecord<z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodSymbol]>, z.ZodUnknown>, z.ZodEffects<z.ZodString, UnknownRecord, string>]>;
32
- }, "layout">, {
33
- layout: z.ZodEffects<z.ZodString, UnknownRecord, string>;
34
- }>, "strip", z.ZodTypeAny, {
35
- name: string;
36
- key: string;
37
- layout: UnknownRecord;
38
- }, {
39
- name: string;
40
- key: string;
41
- layout: string;
42
- }>, "many">;
43
- }, "strip", z.ZodTypeAny, {
44
- workspaces: {
45
- name: string;
46
- key: string;
47
- layout: UnknownRecord;
48
- }[];
49
- }, {
50
- workspaces: {
51
- name: string;
52
- key: string;
53
- layout: string;
54
- }[];
55
- }>;
56
- export type CreateResponse = z.infer<typeof createResZ>;
57
- export declare class Writer {
58
- private readonly client;
59
- constructor(client: UnaryClient);
60
- create(workspaces: NewWorkspace | NewWorkspace[]): Promise<Workspace[]>;
61
- delete(keys: string | string[]): Promise<void>;
62
- rename(key: string, name: string): Promise<void>;
63
- setLayout(key: string, layout: UnknownRecord): Promise<void>;
64
- }
65
- export {};
66
- //# sourceMappingURL=writer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"writer.d.ts","sourceRoot":"","sources":["../../src/workspace/writer.ts"],"names":[],"mappings":"AASA,OAAO,EAAgB,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAEL,KAAK,SAAS,EAGf,MAAM,qBAAqB,CAAC;AAE7B,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;EAGhB,CAAC;AAEJ,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAMzD,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEd,CAAC;AAsBH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAOxD,qBAAa,MAAM;IACjB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAc;gBAEzB,MAAM,EAAE,WAAW;IAIzB,MAAM,CAAC,UAAU,EAAE,YAAY,GAAG,YAAY,EAAE,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAWvE,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAU9C,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAUhD,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;CASnE"}
@@ -1,11 +0,0 @@
1
- // Copyright 2024 Synnax Labs, Inc.
2
- //
3
- // Use of this software is governed by the Business Source License included in the file
4
- // licenses/BSL.txt.
5
- //
6
- // As of the Change Date specified in that file, in accordance with the Business Source
7
- // License, use of this software will be governed by the Apache License, Version 2.0,
8
- // included in the file licenses/APL.txt.
9
-
10
- export * from "@/workspace/lineplot/client";
11
- export * from "@/workspace/lineplot/payload";
@@ -1,34 +0,0 @@
1
- // Copyright 2024 Synnax Labs, Inc.
2
- //
3
- // Use of this software is governed by the Business Source License included in the file
4
- // licenses/BSL.txt.
5
- //
6
- // As of the Change Date specified in that file, in accordance with the Business Source
7
- // License, use of this software will be governed by the Apache License, Version 2.0,
8
- // included in the file licenses/APL.txt.
9
-
10
- import { sendRequired, type UnaryClient } from "@synnaxlabs/freighter";
11
- import { toArray } from "@synnaxlabs/x/toArray";
12
- import { z } from "zod";
13
-
14
- import { type LinePlot, linePlotZ, type Params } from "@/workspace/lineplot/payload";
15
-
16
- const reqZ = z.object({ keys: z.string().array() });
17
-
18
- const resZ = z.object({ linePlots: linePlotZ.array() });
19
-
20
- export class Retriever {
21
- private readonly ENDPOINT = "/workspace/lineplot/retrieve";
22
- private readonly client: UnaryClient;
23
-
24
- constructor(client: UnaryClient) {
25
- this.client = client;
26
- }
27
-
28
- async retrieve(linePlots: Params): Promise<LinePlot[]> {
29
- const normalized = toArray(linePlots);
30
- return (
31
- await sendRequired(this.client, this.ENDPOINT, { keys: normalized }, reqZ, resZ)
32
- ).linePlots;
33
- }
34
- }
@@ -1,115 +0,0 @@
1
- // Copyright 2024 Synnax Labs, Inc.
2
- //
3
- // Use of this software is governed by the Business Source License included in the file
4
- // licenses/BSL.txt.
5
- //
6
- // As of the Change Date specified in that file, in accordance with the Business Source
7
- // License, use of this software will be governed by the Apache License, Version 2.0,
8
- // included in the file licenses/APL.txt.
9
-
10
- import { sendRequired, type UnaryClient } from "@synnaxlabs/freighter";
11
- import { type UnknownRecord } from "@synnaxlabs/x/record";
12
- import { toArray } from "@synnaxlabs/x/toArray";
13
- import { z } from "zod";
14
-
15
- import {
16
- type Key,
17
- keyZ,
18
- type LinePlot,
19
- linePlotZ,
20
- type Params,
21
- } from "@/workspace/lineplot/payload";
22
- import { keyZ as workspaceKeyZ } from "@/workspace/payload";
23
-
24
- export const newLinePlotZ = linePlotZ.partial({ key: true }).transform((p) => ({
25
- ...p,
26
- data: JSON.stringify(p.data),
27
- }));
28
-
29
- export type NewLinePlot = z.input<typeof newLinePlotZ>;
30
-
31
- const createReqZ = z.object({
32
- workspace: workspaceKeyZ,
33
- linePlots: newLinePlotZ.array(),
34
- });
35
-
36
- const createResZ = z.object({
37
- linePlots: linePlotZ.array(),
38
- });
39
-
40
- const deleteReqZ = z.object({
41
- keys: keyZ.array(),
42
- });
43
-
44
- const deleteResZ = z.object({});
45
-
46
- const renameReqZ = z.object({
47
- key: keyZ,
48
- name: z.string(),
49
- });
50
-
51
- const renameResZ = z.object({});
52
-
53
- const setDataReqZ = z.object({
54
- key: keyZ,
55
- data: z.string(),
56
- });
57
-
58
- const setDataResZ = z.object({});
59
-
60
- const CREATE_ENDPOINT = "/workspace/lineplot/create";
61
- const DELETE_ENDPOINT = "/workspace/lineplot/delete";
62
- const RENAME_ENDPOINT = "/workspace/lineplot/rename";
63
- const SET_DATA_ENDPOINT = "/workspace/lineplot/set-data";
64
-
65
- export class Writer {
66
- private readonly client: UnaryClient;
67
-
68
- constructor(client: UnaryClient) {
69
- this.client = client;
70
- }
71
-
72
- async create(workspace: string, plot: NewLinePlot): Promise<LinePlot> {
73
- const linePlot = { ...plot, data: JSON.stringify(plot.data) };
74
- const res = await sendRequired<typeof createReqZ, typeof createResZ>(
75
- this.client,
76
- CREATE_ENDPOINT,
77
- { workspace, linePlots: [linePlot] },
78
- createReqZ,
79
- createResZ,
80
- );
81
-
82
- return res.linePlots[0];
83
- }
84
-
85
- async delete(workspaces: Params): Promise<void> {
86
- const normalized = toArray(workspaces);
87
- await sendRequired<typeof deleteReqZ, typeof deleteResZ>(
88
- this.client,
89
- DELETE_ENDPOINT,
90
- { keys: normalized },
91
- deleteReqZ,
92
- deleteResZ,
93
- );
94
- }
95
-
96
- async rename(plot: Key, name: string): Promise<void> {
97
- await sendRequired<typeof renameReqZ, typeof renameResZ>(
98
- this.client,
99
- RENAME_ENDPOINT,
100
- { key: plot, name },
101
- renameReqZ,
102
- renameResZ,
103
- );
104
- }
105
-
106
- async setData(plot: Key, data: UnknownRecord): Promise<void> {
107
- await sendRequired<typeof setDataReqZ, typeof setDataResZ>(
108
- this.client,
109
- SET_DATA_ENDPOINT,
110
- { key: plot, data: JSON.stringify(data) },
111
- setDataReqZ,
112
- setDataResZ,
113
- );
114
- }
115
- }
@@ -1,11 +0,0 @@
1
- // Copyright 2024 Synnax Labs, Inc.
2
- //
3
- // Use of this software is governed by the Business Source License included in the file
4
- // licenses/BSL.txt.
5
- //
6
- // As of the Change Date specified in that file, in accordance with the Business Source
7
- // License, use of this software will be governed by the Apache License, Version 2.0,
8
- // included in the file licenses/APL.txt.
9
-
10
- export * from "@/workspace/log/client";
11
- export * from "@/workspace/log/payload";
@@ -1,36 +0,0 @@
1
- // Copyright 2024 Synnax Labs, Inc.
2
- //
3
- // Use of this software is governed by the Business Source License included in the file
4
- // licenses/BSL.txt.
5
- //
6
- // As of the Change Date specified in that file, in accordance with the Business Source
7
- // License, use of this software will be governed by the Apache License, Version 2.0,
8
- // included in the file licenses/APL.txt.
9
-
10
- import { type UnknownRecord, unknownRecordZ } from "@synnaxlabs/x/record";
11
- import { z } from "zod";
12
-
13
- import { ontology } from "@/ontology";
14
-
15
- export const keyZ = z.string().uuid();
16
- export type Key = z.infer<typeof keyZ>;
17
- export type Params = Key | Key[];
18
-
19
- export const logZ = z.object({
20
- key: z.string(),
21
- name: z.string(),
22
- data: unknownRecordZ.or(z.string().transform((s) => JSON.parse(s) as UnknownRecord)),
23
- });
24
-
25
- export const logRemoteZ = z.object({
26
- key: z.string(),
27
- name: z.string(),
28
- data: z.string().transform((s) => JSON.parse(s) as UnknownRecord),
29
- });
30
-
31
- export type Log = z.infer<typeof logZ>;
32
-
33
- export const ONTOLOGY_TYPE: ontology.ResourceType = "log";
34
-
35
- export const ontologyID = (key: Key): ontology.ID =>
36
- new ontology.ID({ type: ONTOLOGY_TYPE, key });
@@ -1,38 +0,0 @@
1
- // Copyright 2024 Synnax Labs, Inc.
2
- //
3
- // Use of this software is governed by the Business Source License included in the file
4
- // licenses/BSL.txt.
5
- //
6
- // As of the Change Date specified in that file, in accordance with the Business Source
7
- // License, use of this software will be governed by the Apache License, Version 2.0,
8
- // included in the file licenses/APL.txt.
9
-
10
- import { sendRequired, type UnaryClient } from "@synnaxlabs/freighter";
11
- import { toArray } from "@synnaxlabs/x/toArray";
12
- import { z } from "zod";
13
-
14
- import { type Log, logRemoteZ, type Params } from "@/workspace/log/payload";
15
-
16
- const reqZ = z.object({ keys: z.string().array() });
17
- const resZ = z.object({ logs: logRemoteZ.array() });
18
-
19
- export class Retriever {
20
- private readonly ENDPOINT = "/workspace/log/retrieve";
21
- private readonly client: UnaryClient;
22
-
23
- constructor(client: UnaryClient) {
24
- this.client = client;
25
- }
26
-
27
- async retrieve(logs: Params): Promise<Log[]> {
28
- return (
29
- await sendRequired(
30
- this.client,
31
- this.ENDPOINT,
32
- { keys: toArray(logs) },
33
- reqZ,
34
- resZ,
35
- )
36
- ).logs;
37
- }
38
- }
@@ -1,116 +0,0 @@
1
- // Copyright 2024 Synnax Labs, Inc.
2
- //
3
- // Use of this software is governed by the Business Source License included in the file
4
- // licenses/BSL.txt.
5
- //
6
- // As of the Change Date specified in that file, in accordance with the Business Source
7
- // License, use of this software will be governed by the Apache License, Version 2.0,
8
- // included in the file licenses/APL.txt.
9
-
10
- import { sendRequired, type UnaryClient } from "@synnaxlabs/freighter";
11
- import { type UnknownRecord } from "@synnaxlabs/x/record";
12
- import { toArray } from "@synnaxlabs/x/toArray";
13
- import { z } from "zod";
14
-
15
- import {
16
- type Key,
17
- keyZ,
18
- type Log,
19
- logRemoteZ,
20
- logZ,
21
- type Params,
22
- } from "@/workspace/log/payload";
23
- import { keyZ as workspaceKeyZ } from "@/workspace/payload";
24
-
25
- export const newLogZ = logZ.partial({ key: true }).transform((p) => ({
26
- ...p,
27
- data: JSON.stringify(p.data),
28
- }));
29
-
30
- export type NewLog = z.input<typeof newLogZ>;
31
-
32
- const createReqZ = z.object({
33
- workspace: workspaceKeyZ,
34
- logs: newLogZ.array(),
35
- });
36
-
37
- const createResZ = z.object({
38
- logs: logRemoteZ.array(),
39
- });
40
-
41
- const deleteReqZ = z.object({
42
- keys: keyZ.array(),
43
- });
44
-
45
- const deleteResZ = z.object({});
46
-
47
- const renameReqZ = z.object({
48
- key: keyZ,
49
- name: z.string(),
50
- });
51
-
52
- const renameResZ = z.object({});
53
-
54
- const setDataReqZ = z.object({
55
- key: keyZ,
56
- data: z.string(),
57
- });
58
-
59
- const setDataResZ = z.object({});
60
-
61
- const CREATE_ENDPOINT = "/workspace/log/create";
62
- const DELETE_ENDPOINT = "/workspace/log/delete";
63
- const RENAME_ENDPOINT = "/workspace/log/rename";
64
- const SET_DATA_ENDPOINT = "/workspace/log/set-data";
65
-
66
- export class Writer {
67
- private readonly client: UnaryClient;
68
-
69
- constructor(client: UnaryClient) {
70
- this.client = client;
71
- }
72
-
73
- async create(workspace: string, log: NewLog): Promise<Log> {
74
- const log_ = { ...log, data: JSON.stringify(log.data) };
75
- const res = await sendRequired<typeof createReqZ, typeof createResZ>(
76
- this.client,
77
- CREATE_ENDPOINT,
78
- { workspace, logs: [log_] },
79
- createReqZ,
80
- createResZ,
81
- );
82
-
83
- return res.logs[0];
84
- }
85
-
86
- async delete(logs: Params): Promise<void> {
87
- const normalized = toArray(logs);
88
- await sendRequired<typeof deleteReqZ, typeof deleteResZ>(
89
- this.client,
90
- DELETE_ENDPOINT,
91
- { keys: normalized },
92
- deleteReqZ,
93
- deleteResZ,
94
- );
95
- }
96
-
97
- async rename(log: Key, name: string): Promise<void> {
98
- await sendRequired<typeof renameReqZ, typeof renameResZ>(
99
- this.client,
100
- RENAME_ENDPOINT,
101
- { key: log, name },
102
- renameReqZ,
103
- renameResZ,
104
- );
105
- }
106
-
107
- async setData(log: Key, data: UnknownRecord): Promise<void> {
108
- await sendRequired<typeof setDataReqZ, typeof setDataResZ>(
109
- this.client,
110
- SET_DATA_ENDPOINT,
111
- { key: log, data: JSON.stringify(data) },
112
- setDataReqZ,
113
- setDataResZ,
114
- );
115
- }
116
- }