@blueyerobotics/blueye-ts 3.8.0 → 3.9.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.
@@ -22,7 +22,7 @@ export declare const parse: (rawData: Blob, fixTimes?: boolean) => Promise<Messa
22
22
  * @param rawData The compressed binary data to decompress (gzip format).
23
23
  * @returns A promise that resolves to the decompressed data as a Buffer.
24
24
  */
25
- export declare const decompress: (rawData: Blob) => Promise<Buffer>;
25
+ export declare const decompress: (rawData: Blob) => Promise<Buffer<ArrayBuffer>>;
26
26
  /**
27
27
  * Parse the decompressed binlog data into structured messages.
28
28
  * @param decompressed The gunzipped binlog data.
@@ -42,7 +42,6 @@ class BlueyeClient extends strict_event_emitter_1.Emitter {
42
42
  level: logLevel,
43
43
  formatOptions: { colors: true, compact: false },
44
44
  });
45
- // @ts-ignore
46
45
  this.sub.on("message", (topic, msg) => {
47
46
  const { key, data } = schema_1.responseSchema.parse({ key: topic, data: msg });
48
47
  if (!(0, exports.isInProtocol)(key) || !key.endsWith("Tel")) {
@@ -107,7 +106,6 @@ class BlueyeClient extends strict_event_emitter_1.Emitter {
107
106
  const request = () => {
108
107
  return new Promise((resolve, reject) => {
109
108
  const timer = setTimeout(() => reject(new Error("[rpc] request timed out")), this.timeout);
110
- // @ts-ignore
111
109
  this.rpc.once("message", (topic, msg) => {
112
110
  clearTimeout(timer);
113
111
  resolve({ key: topic.toString().split(".").at(-1), data: msg });
@@ -1,12 +1,11 @@
1
- import { Buffer } from "buffer";
2
1
  import z from "zod";
3
2
  export declare const responseSchema: z.ZodObject<{
4
- key: z.ZodPipe<z.ZodCustom<Buffer, Buffer>, z.ZodTransform<string, Buffer>>;
5
- data: z.ZodCustom<Buffer, Buffer>;
3
+ key: z.ZodPipe<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodTransform<string, Uint8Array<ArrayBuffer>>>;
4
+ data: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
6
5
  }, z.core.$strip>;
7
6
  export declare const telemetrySchema: z.ZodObject<{
8
7
  payload: z.ZodObject<{
9
8
  typeUrl: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
10
- value: z.ZodPipe<z.ZodAny & z.ZodType<Buffer | Uint8Array<ArrayBufferLike>, any, z.core.$ZodTypeInternals<Buffer | Uint8Array<ArrayBufferLike>, any>>, z.ZodTransform<Buffer, any>>;
9
+ value: z.ZodPipe<z.ZodAny & z.ZodType<Buffer<ArrayBuffer> | Buffer<any> | Uint8Array<ArrayBufferLike>, any, z.core.$ZodTypeInternals<Buffer<ArrayBuffer> | Buffer<any> | Uint8Array<ArrayBufferLike>, any>>, z.ZodTransform<Buffer<any>, any>>;
11
10
  }, z.core.$strip>;
12
11
  }, z.core.$strip>;
@@ -4,20 +4,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.telemetrySchema = exports.responseSchema = void 0;
7
- const buffer_1 = require("buffer");
8
7
  const zod_1 = __importDefault(require("zod"));
9
8
  exports.responseSchema = zod_1.default.object({
10
9
  key: zod_1.default
11
- .instanceof(buffer_1.Buffer)
10
+ .instanceof(Uint8Array)
12
11
  .transform((val) => val.toString().split(".").at(-1)),
13
- data: zod_1.default.instanceof(buffer_1.Buffer),
12
+ data: zod_1.default.instanceof(Uint8Array),
14
13
  });
15
14
  exports.telemetrySchema = zod_1.default.object({
16
15
  payload: zod_1.default.object({
17
16
  typeUrl: zod_1.default.string().transform((val) => val.split(".").at(-1)),
18
17
  value: zod_1.default
19
18
  .any()
20
- .refine((val) => val instanceof buffer_1.Buffer || val instanceof Uint8Array)
21
- .transform((val) => (buffer_1.Buffer.isBuffer(val) ? val : buffer_1.Buffer.from(val))),
19
+ .refine((val) => val instanceof Buffer || val instanceof Uint8Array)
20
+ .transform((val) => (Buffer.isBuffer(val) ? val : Buffer.from(val))),
22
21
  }),
23
22
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blueyerobotics/blueye-ts",
3
- "version": "3.8.0",
3
+ "version": "3.9.0",
4
4
  "description": "A TypeScript client for interacting with Blueye underwater drones.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,6 +26,7 @@
26
26
  },
27
27
  "devDependencies": {
28
28
  "@biomejs/biome": "2.3.14",
29
+ "@types/node": "^25.4.0",
29
30
  "typescript": "^5.9.3"
30
31
  },
31
32
  "scripts": {