@ray-js/robot-data-stream 0.0.15-beta.12 → 0.0.15-beta.13
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/lib/mqtt/type/fun.d.ts
CHANGED
|
@@ -92,6 +92,7 @@ export declare const ProtocolSchemas: {
|
|
|
92
92
|
}, z.core.$strip>;
|
|
93
93
|
set_wifi_map: import("../../myLib/zod/src/v4/mini/schemas").ZodMiniObject<{
|
|
94
94
|
taskId: import("../../myLib/zod/src/v4/mini/schemas").ZodMiniOptional<import("../../myLib/zod/src/v4/mini/schemas").ZodMiniString<string>>;
|
|
95
|
+
switch: import("../../myLib/zod/src/v4/mini/schemas").ZodMiniOptional<import("../../myLib/zod/src/v4/mini/schemas").ZodMiniBoolean<boolean>>;
|
|
95
96
|
}, z.core.$strip>;
|
|
96
97
|
set_voice: import("../../myLib/zod/src/v4/mini/schemas").ZodMiniObject<{
|
|
97
98
|
id: import("../../myLib/zod/src/v4/mini/schemas").ZodMiniNumberFormat;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as z from '../../../myLib/zod/mini';
|
|
2
2
|
export declare const setWifiMapSchema: import("../../../myLib/zod/src/v4/mini/schemas").ZodMiniObject<{
|
|
3
3
|
taskId: import("../../../myLib/zod/src/v4/mini/schemas").ZodMiniOptional<import("../../../myLib/zod/src/v4/mini/schemas").ZodMiniString<string>>;
|
|
4
|
+
switch: import("../../../myLib/zod/src/v4/mini/schemas").ZodMiniOptional<import("../../../myLib/zod/src/v4/mini/schemas").ZodMiniBoolean<boolean>>;
|
|
4
5
|
}, z.core.$strip>;
|
|
5
6
|
declare const wifiMapResponseSchema: import("../../../myLib/zod/src/v4/mini/schemas").ZodMiniObject<{
|
|
6
7
|
success: import("../../../myLib/zod/src/v4/mini/schemas").ZodMiniBoolean<boolean>;
|
|
@@ -3,7 +3,8 @@ import { BaseResponseSchema } from './base';
|
|
|
3
3
|
|
|
4
4
|
// 设置 WiFi 地图参数 Schema
|
|
5
5
|
export const setWifiMapSchema = z.object({
|
|
6
|
-
taskId: z.optional(z.string())
|
|
6
|
+
taskId: z.optional(z.string()),
|
|
7
|
+
switch: z.optional(z.boolean())
|
|
7
8
|
});
|
|
8
9
|
|
|
9
10
|
// WiFi 地图响应 Schema(BaseResponseSchema 已包含所有必需字段)
|
package/lib/mqtt/useWifiMap.js
CHANGED
|
@@ -18,7 +18,7 @@ export const useWifiMap = () => {
|
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* 设置 WiFi 地图
|
|
21
|
-
* @param data 包含 taskId 的参数对象(taskId
|
|
21
|
+
* @param data 包含 taskId 的参数对象(taskId 可选,不提供时自动生成,switch 可选,默认)
|
|
22
22
|
* @returns Promise<WifiMapResponse> 响应结果
|
|
23
23
|
*/
|
|
24
24
|
|
|
@@ -36,9 +36,11 @@ export const useWifiMap = () => {
|
|
|
36
36
|
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
37
37
|
return new Promise((resolve, reject) => {
|
|
38
38
|
try {
|
|
39
|
+
var _data$switch;
|
|
39
40
|
// 如果没有提供 taskId,自动生成
|
|
40
41
|
const wifiMapData = {
|
|
41
|
-
taskId: data.taskId || String(Date.now())
|
|
42
|
+
taskId: data.taskId || String(Date.now()),
|
|
43
|
+
switch: (_data$switch = data.switch) !== null && _data$switch !== void 0 ? _data$switch : true
|
|
42
44
|
};
|
|
43
45
|
|
|
44
46
|
// 使用 TypeBox Schema 进行参数验证
|