@cpzxrobot/sdk 1.3.99 → 1.3.101

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
@@ -310,14 +310,7 @@ export class DeviceGateway extends Object {
310
310
  throw new Error('规则ID不能为空');
311
311
  }
312
312
 
313
- // 设置默认值
314
- const requestData: ActiveAlarmRuleRequest = {
315
- id: request.id,
316
- factoryIds: request.factoryIds || [],
317
- allActive: (request.factoryIds?.length || 0) > 0 ? false : request.allActive !== undefined ? request.allActive : true
318
- };
319
-
320
- return axios.post(`/api/v2/device/stat/alarms/rule/active`, requestData).then((res) => {
313
+ return axios.post(`/api/v2/device/stat/alarms/rule/activate`, request).then((res) => {
321
314
  if (res.data.code !== 200) {
322
315
  throw new Error(res.data.message || '激活报警规则失败');
323
316
  }
@@ -231,19 +231,12 @@ class DeviceGateway extends Object {
231
231
  * @returns Promise 包含激活结果
232
232
  */
233
233
  activeAlarmRule: (request) => __awaiter(this, void 0, void 0, function* () {
234
- var _a;
235
234
  const axios = yield this.context.ready;
236
235
  // 参数验证
237
236
  if (!request.id) {
238
237
  throw new Error('规则ID不能为空');
239
238
  }
240
- // 设置默认值
241
- const requestData = {
242
- id: request.id,
243
- factoryIds: request.factoryIds || [],
244
- allActive: (((_a = request.factoryIds) === null || _a === void 0 ? void 0 : _a.length) || 0) > 0 ? false : request.allActive !== undefined ? request.allActive : true
245
- };
246
- return axios.post(`/api/v2/device/stat/alarms/rule/active`, requestData).then((res) => {
239
+ return axios.post(`/api/v2/device/stat/alarms/rule/activate`, request).then((res) => {
247
240
  if (res.data.code !== 200) {
248
241
  throw new Error(res.data.message || '激活报警规则失败');
249
242
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.3.99",
3
+ "version": "1.3.101",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {