@cpzxrobot/sdk 1.3.78 → 1.3.79

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/device_gateway.ts CHANGED
@@ -1060,4 +1060,27 @@ export class DeviceGateway extends Object {
1060
1060
  });
1061
1061
  }
1062
1062
 
1063
+ /**
1064
+ * 获取报警具体信息
1065
+ * @param logId 报警日志ID
1066
+ * @returns Promise 包含报警具体信息的数据
1067
+ */
1068
+ async getAlarmDetails(logId: number): Promise<any> {
1069
+ const axios = await this.context.ready;
1070
+
1071
+ // 参数验证
1072
+ if (!logId || logId <= 0) {
1073
+ throw new Error('报警日志ID不能为空且必须大于0');
1074
+ }
1075
+
1076
+ return axios.get(`/api/v2/device/stat/alarms/details`, {
1077
+ params: { logId }
1078
+ }).then((res) => {
1079
+ if (res.data.code !== 200) {
1080
+ throw new Error(res.data.message || '获取报警具体信息失败');
1081
+ }
1082
+ return res.data;
1083
+ });
1084
+ }
1085
+
1063
1086
  }
@@ -847,5 +847,27 @@ class DeviceGateway extends Object {
847
847
  });
848
848
  });
849
849
  }
850
+ /**
851
+ * 获取报警具体信息
852
+ * @param logId 报警日志ID
853
+ * @returns Promise 包含报警具体信息的数据
854
+ */
855
+ getAlarmDetails(logId) {
856
+ return __awaiter(this, void 0, void 0, function* () {
857
+ const axios = yield this.context.ready;
858
+ // 参数验证
859
+ if (!logId || logId <= 0) {
860
+ throw new Error('报警日志ID不能为空且必须大于0');
861
+ }
862
+ return axios.get(`/api/v2/device/stat/alarms/details`, {
863
+ params: { logId }
864
+ }).then((res) => {
865
+ if (res.data.code !== 200) {
866
+ throw new Error(res.data.message || '获取报警具体信息失败');
867
+ }
868
+ return res.data;
869
+ });
870
+ });
871
+ }
850
872
  }
851
873
  exports.DeviceGateway = DeviceGateway;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.3.78",
3
+ "version": "1.3.79",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {