@blueyerobotics/blueye-ts 3.7.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.
- package/dist/src/binlog-parser.d.ts +1 -1
- package/dist/src/client.js +0 -2
- package/dist/src/schema.d.ts +3 -4
- package/dist/src/schema.js +4 -5
- package/package.json +6 -5
|
@@ -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.
|
package/dist/src/client.js
CHANGED
|
@@ -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 });
|
package/dist/src/schema.d.ts
CHANGED
|
@@ -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<
|
|
5
|
-
data: z.ZodCustom<
|
|
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
|
|
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>;
|
package/dist/src/schema.js
CHANGED
|
@@ -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(
|
|
10
|
+
.instanceof(Uint8Array)
|
|
12
11
|
.transform((val) => val.toString().split(".").at(-1)),
|
|
13
|
-
data: zod_1.default.instanceof(
|
|
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
|
|
21
|
-
.transform((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.
|
|
3
|
+
"version": "3.9.0",
|
|
4
4
|
"description": "A TypeScript client for interacting with Blueye underwater drones.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -15,17 +15,18 @@
|
|
|
15
15
|
"author": "Blueye <contact@blueye.no> (https://blueye.no/)",
|
|
16
16
|
"license": "LGPL-3.0-only",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@blueyerobotics/protocol-definitions": "3.2.0-
|
|
19
|
-
"@bufbuild/protobuf": "^2.
|
|
18
|
+
"@blueyerobotics/protocol-definitions": "3.2.0-98aafe92",
|
|
19
|
+
"@bufbuild/protobuf": "^2.11.0",
|
|
20
20
|
"buffer": "^6.0.3",
|
|
21
21
|
"consola": "^3.4.2",
|
|
22
22
|
"fflate": "^0.8.2",
|
|
23
23
|
"jszmq": "^0.1.2",
|
|
24
24
|
"strict-event-emitter": "^0.5.1",
|
|
25
|
-
"zod": "^4.3.
|
|
25
|
+
"zod": "^4.3.6"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@biomejs/biome": "2.3.
|
|
28
|
+
"@biomejs/biome": "2.3.14",
|
|
29
|
+
"@types/node": "^25.4.0",
|
|
29
30
|
"typescript": "^5.9.3"
|
|
30
31
|
},
|
|
31
32
|
"scripts": {
|