@cpzxrobot/sdk 1.1.89 → 1.1.90

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
@@ -58,7 +58,7 @@ export class DeviceGateway extends Object {
58
58
  }) => {
59
59
  let axios = await this.context.ready;
60
60
 
61
- return axios.post(`/api/v2/device/list`,condition).then((res) => {
61
+ return axios.post(`/api/v2/device/list`, condition).then((res) => {
62
62
  return res.data;
63
63
  });
64
64
  },
@@ -102,7 +102,7 @@ export class DeviceGateway extends Object {
102
102
  },
103
103
  delete: async (id: string) => {
104
104
  let axios = await this.context.ready;
105
- return axios.post(`/api/v2/threshold/config/delete`,{
105
+ return axios.post(`/api/v2/threshold/config/delete`, {
106
106
  id: id
107
107
  });
108
108
  },
@@ -160,21 +160,21 @@ export class DeviceGateway extends Object {
160
160
  options:
161
161
  | undefined
162
162
  | {
163
- id?: Number | null | undefined;
164
- data?:
165
- | "diffPerDay"
166
- | "sumPerDay"
167
- | "latest"
168
- | "weekoverweek"
169
- | "last"
170
- | "rangeToday"
171
- | null; //如果data为null,则不获取数据,只获取设备列表,否则获取设备列表和数据
172
- status?: string;
173
- unit?: Number;
174
- type?: string;
175
- detail?: boolean;
176
- supplier?: string; //供应商,可用于过滤设备
177
- } = undefined
163
+ id?: Number | null | undefined;
164
+ data?:
165
+ | "diffPerDay"
166
+ | "sumPerDay"
167
+ | "latest"
168
+ | "weekoverweek"
169
+ | "last"
170
+ | "rangeToday"
171
+ | null; //如果data为null,则不获取数据,只获取设备列表,否则获取设备列表和数据
172
+ status?: string;
173
+ unit?: Number;
174
+ type?: string;
175
+ detail?: boolean;
176
+ supplier?: string; //供应商,可用于过滤设备
177
+ } = undefined
178
178
  ) {
179
179
  return this.normalFilter.list(options);
180
180
  }
@@ -193,4 +193,12 @@ export class DeviceGateway extends Object {
193
193
  ) {
194
194
  return this.normalFilter.getData(id, args);
195
195
  }
196
+
197
+ async validate(serialNumbers: string[],type: string = "pywl") {
198
+ let axios = await this.context.ready;
199
+ return axios.post(`/api/v2/device/validateSerialNumber`, {
200
+ serialNumbers,
201
+ type,
202
+ });
203
+ }
196
204
  }
@@ -128,5 +128,12 @@ class DeviceGateway extends Object {
128
128
  }) {
129
129
  return this.normalFilter.getData(id, args);
130
130
  }
131
+ async validate(serialNumbers, type = "pywl") {
132
+ let axios = await this.context.ready;
133
+ return axios.post(`/api/v2/device/validateSerialNumber`, {
134
+ serialNumbers,
135
+ type,
136
+ });
137
+ }
131
138
  }
132
139
  exports.DeviceGateway = DeviceGateway;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.1.89",
3
+ "version": "1.1.90",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -1,4 +1,4 @@
1
- import { Cpzxrobot, Factory, Unit } from "./types";
1
+ import { Cpzxrobot } from "./types";
2
2
 
3
3
  export class ProductGateway extends Object {
4
4
  context: Cpzxrobot;
package/readme.md CHANGED
@@ -84,6 +84,7 @@ baseURL: "/"
84
84
  | cpzxrobot().device.v2.update | 更新设备(仅限v2设备) |
85
85
  | cpzxrobot().device.v2.list | 删除设备(仅限v2设备) |
86
86
  | cpzxrobot().device.v2.delete | 删除设备(仅限v2设备) |
87
+ | cpzxrobot().device.validate | 校验设备是否有效,传入serialNumbers数组,返回包含状态的设备列表 |
87
88
  | cpzxrobot().camera.xxx | 获得摄像头的相关信息 |
88
89
  | cpzxrobot().camera.control | 控制摄像头,例如:左移,右移,上移,下移等,如果传输start为true,则开始控制,如果传输stop为true,则停止控制,如果都没传输,则执行3秒后自动停止,传输start为true时,前端必须在需要停止时自行发送stop为true的消息 |
89
90
  | cpzxrobot().factory.entry | 获得工厂的可显示动态信息 |