@synnaxlabs/client 0.33.0 → 0.34.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 (72) hide show
  1. package/.turbo/turbo-build.log +6 -6
  2. package/dist/auth/auth.d.ts.map +1 -1
  3. package/dist/channel/writer.d.ts.map +1 -1
  4. package/dist/client.cjs +26 -26
  5. package/dist/client.js +235 -190
  6. package/dist/control/client.d.ts.map +1 -1
  7. package/dist/control/state.d.ts.map +1 -1
  8. package/dist/errors.d.ts +3 -3
  9. package/dist/errors.d.ts.map +1 -1
  10. package/dist/framer/adapter.d.ts.map +1 -1
  11. package/dist/framer/client.d.ts.map +1 -1
  12. package/dist/framer/deleter.d.ts.map +1 -1
  13. package/dist/framer/frame.d.ts.map +1 -1
  14. package/dist/framer/writer.d.ts.map +1 -1
  15. package/dist/hardware/device/client.d.ts.map +1 -1
  16. package/dist/hardware/device/payload.d.ts.map +1 -1
  17. package/dist/hardware/rack/client.d.ts.map +1 -1
  18. package/dist/hardware/task/client.d.ts +1 -1
  19. package/dist/hardware/task/client.d.ts.map +1 -1
  20. package/dist/hardware/task/ni/types.d.ts.map +1 -1
  21. package/dist/hardware/task/payload.d.ts.map +1 -1
  22. package/dist/label/client.d.ts.map +1 -1
  23. package/dist/ontology/client.d.ts.map +1 -1
  24. package/dist/ontology/payload.d.ts.map +1 -1
  25. package/dist/ranger/alias.d.ts.map +1 -1
  26. package/dist/ranger/client.d.ts.map +1 -1
  27. package/dist/ranger/kv.d.ts.map +1 -1
  28. package/dist/ranger/payload.d.ts.map +1 -1
  29. package/dist/util/telem.d.ts.map +1 -1
  30. package/dist/workspace/lineplot/payload.d.ts.map +1 -1
  31. package/dist/workspace/log/payload.d.ts.map +1 -1
  32. package/dist/workspace/payload.d.ts.map +1 -1
  33. package/dist/workspace/schematic/payload.d.ts.map +1 -1
  34. package/eslint.config.js +1 -1
  35. package/package.json +11 -11
  36. package/src/access/policy/policy.spec.ts +2 -4
  37. package/src/auth/auth.spec.ts +1 -1
  38. package/src/auth/auth.ts +17 -18
  39. package/src/channel/writer.ts +2 -2
  40. package/src/connection/checker.ts +1 -1
  41. package/src/control/client.ts +1 -1
  42. package/src/control/state.ts +1 -1
  43. package/src/errors.spec.ts +1 -1
  44. package/src/errors.ts +14 -15
  45. package/src/framer/adapter.ts +5 -6
  46. package/src/framer/client.ts +9 -4
  47. package/src/framer/deleter.ts +1 -1
  48. package/src/framer/frame.ts +9 -11
  49. package/src/framer/iterator.spec.ts +2 -3
  50. package/src/framer/writer.ts +1 -1
  51. package/src/hardware/device/client.ts +3 -3
  52. package/src/hardware/device/payload.ts +1 -1
  53. package/src/hardware/rack/client.ts +3 -3
  54. package/src/hardware/task/client.ts +13 -11
  55. package/src/hardware/task/ni/types.ts +1 -1
  56. package/src/hardware/task/payload.ts +1 -1
  57. package/src/hardware/task/task.spec.ts +1 -1
  58. package/src/label/client.ts +1 -1
  59. package/src/ontology/client.ts +1 -3
  60. package/src/ontology/group/payload.ts +2 -2
  61. package/src/ontology/payload.ts +1 -1
  62. package/src/ranger/alias.ts +2 -3
  63. package/src/ranger/client.ts +7 -9
  64. package/src/ranger/kv.ts +2 -2
  65. package/src/ranger/payload.ts +2 -2
  66. package/src/ranger/ranger.spec.ts +2 -2
  67. package/src/user/user.spec.ts +1 -2
  68. package/src/util/telem.ts +1 -3
  69. package/src/workspace/lineplot/payload.ts +1 -1
  70. package/src/workspace/log/payload.ts +1 -1
  71. package/src/workspace/payload.ts +1 -1
  72. package/src/workspace/schematic/payload.ts +1 -1
@@ -7,12 +7,12 @@
7
7
  // License, use of this software will be governed by the Apache License, Version 2.0,
8
8
  // included in the file licenses/APL.txt.
9
9
 
10
- import { change } from "@synnaxlabs/x";
10
+ import { type change } from "@synnaxlabs/x";
11
11
  import { DataType, Rate, TimeSpan, TimeStamp } from "@synnaxlabs/x/telem";
12
12
  import { describe, expect, it } from "vitest";
13
13
 
14
14
  import { QueryError } from "@/errors";
15
- import { ranger } from "@/ranger";
15
+ import { type ranger } from "@/ranger";
16
16
  import { type NewPayload } from "@/ranger/payload";
17
17
  import { newClient } from "@/setupspecs";
18
18
 
@@ -183,9 +183,8 @@ describe("User", () => {
183
183
  });
184
184
  });
185
185
  test("not found", async () => {
186
- for (const u of userArray) {
186
+ for (const u of userArray)
187
187
  await expect(client.user.delete(u.key as string)).resolves.toBeUndefined();
188
- }
189
188
  await expect(
190
189
  client.user.retrieve(userArray.map((u) => u.key as string)),
191
190
  ).rejects.toThrow(NotFoundError);
package/src/util/telem.ts CHANGED
@@ -12,8 +12,6 @@ import { type DataType, type TypedArray } from "@synnaxlabs/x/telem";
12
12
  export const randomSeries = (length: number, dataType: DataType): TypedArray => {
13
13
  // generate random bytes of the correct length
14
14
  const bytes = new Uint8Array(length * dataType.density.valueOf());
15
- for (let i = 0; i < bytes.byteLength; i++) {
16
- bytes[i] = Math.floor(Math.random() * 256);
17
- }
15
+ for (let i = 0; i < bytes.byteLength; i++) bytes[i] = Math.floor(Math.random() * 256);
18
16
  return new dataType.Array(bytes.buffer);
19
17
  };
@@ -27,4 +27,4 @@ export type LinePlot = z.infer<typeof linePlotZ>;
27
27
  export const ONTOLOGY_TYPE: ontology.ResourceType = "lineplot";
28
28
 
29
29
  export const ontologyID = (key: Key): ontology.ID =>
30
- new ontology.ID({ type: ONTOLOGY_TYPE, key: key });
30
+ new ontology.ID({ type: ONTOLOGY_TYPE, key });
@@ -33,4 +33,4 @@ export type Log = z.infer<typeof logZ>;
33
33
  export const ONTOLOGY_TYPE: ontology.ResourceType = "log";
34
34
 
35
35
  export const ontologyID = (key: Key): ontology.ID =>
36
- new ontology.ID({ type: ONTOLOGY_TYPE, key: key });
36
+ new ontology.ID({ type: ONTOLOGY_TYPE, key });
@@ -41,4 +41,4 @@ export type Workspace = z.infer<typeof workspaceZ>;
41
41
  export const ONTOLOGY_TYPE: ontology.ResourceType = "workspace";
42
42
 
43
43
  export const ontologyID = (key: Key): ontology.ID =>
44
- new ontology.ID({ type: ONTOLOGY_TYPE, key: key });
44
+ new ontology.ID({ type: ONTOLOGY_TYPE, key });
@@ -35,4 +35,4 @@ export type Schematic = z.infer<typeof schematicZ>;
35
35
  export const ONTOLOGY_TYPE: ontology.ResourceType = "schematic";
36
36
 
37
37
  export const ontologyID = (key: Key): ontology.ID =>
38
- new ontology.ID({ type: ONTOLOGY_TYPE, key: key });
38
+ new ontology.ID({ type: ONTOLOGY_TYPE, key });