@cpzxrobot/sdk 1.3.52 → 1.3.54
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/car_gateway.ts +1 -1
- package/device_filter.ts +5 -4
- package/dist/car_gateway.js +1 -1
- package/dist/device_filter.js +5 -3
- package/dist/product_gateway.js +1 -1
- package/package.json +1 -1
- package/product_gateway.ts +1 -1
- package/user_gateway.ts +1 -1
package/car_gateway.ts
CHANGED
package/device_filter.ts
CHANGED
|
@@ -208,12 +208,11 @@ export abstract class DeviceFilter<T extends { id: number }> {
|
|
|
208
208
|
if (args.type == "raw") {
|
|
209
209
|
return res;
|
|
210
210
|
} else {
|
|
211
|
-
if (res.data) {
|
|
212
|
-
throw "device_list error("+JSON.stringify(res)+")";
|
|
211
|
+
if (!res.data) {
|
|
212
|
+
throw "device_list error(" + JSON.stringify(res) + ")";
|
|
213
213
|
} else if (res.data.Error) {
|
|
214
214
|
throw res.data.Error;
|
|
215
215
|
}
|
|
216
|
-
// this.devices.push(res.data);
|
|
217
216
|
return res.data;
|
|
218
217
|
}
|
|
219
218
|
});
|
|
@@ -386,7 +385,9 @@ export abstract class DeviceFilter<T extends { id: number }> {
|
|
|
386
385
|
});
|
|
387
386
|
})
|
|
388
387
|
.then((res) => {
|
|
389
|
-
if (res.data
|
|
388
|
+
if (!res.data) {
|
|
389
|
+
throw "device_list error(" + JSON.stringify(res) + ")";
|
|
390
|
+
} else if (res.data.Error) {
|
|
390
391
|
throw res.data.Error;
|
|
391
392
|
} else {
|
|
392
393
|
return this.wrapList(res.data);
|
package/dist/car_gateway.js
CHANGED
|
@@ -18,7 +18,7 @@ class CarGateway extends Object {
|
|
|
18
18
|
.get(`/api/v2/car/${factory.pid}/detections?date=` + date.toISOString())
|
|
19
19
|
.then((res) => res.data);
|
|
20
20
|
}
|
|
21
|
-
async cars(factory
|
|
21
|
+
async cars(factory) {
|
|
22
22
|
var axios = await this.context.ready;
|
|
23
23
|
return axios
|
|
24
24
|
.get(`/api/v2/car/${factory.pid}/cars`)
|
package/dist/device_filter.js
CHANGED
|
@@ -189,13 +189,12 @@ class DeviceFilter {
|
|
|
189
189
|
return res;
|
|
190
190
|
}
|
|
191
191
|
else {
|
|
192
|
-
if (res.data) {
|
|
192
|
+
if (!res.data) {
|
|
193
193
|
throw "device_list error(" + JSON.stringify(res) + ")";
|
|
194
194
|
}
|
|
195
195
|
else if (res.data.Error) {
|
|
196
196
|
throw res.data.Error;
|
|
197
197
|
}
|
|
198
|
-
// this.devices.push(res.data);
|
|
199
198
|
return res.data;
|
|
200
199
|
}
|
|
201
200
|
});
|
|
@@ -331,7 +330,10 @@ class DeviceFilter {
|
|
|
331
330
|
});
|
|
332
331
|
})
|
|
333
332
|
.then((res) => {
|
|
334
|
-
if (res.data
|
|
333
|
+
if (!res.data) {
|
|
334
|
+
throw "device_list error(" + JSON.stringify(res) + ")";
|
|
335
|
+
}
|
|
336
|
+
else if (res.data.Error) {
|
|
335
337
|
throw res.data.Error;
|
|
336
338
|
}
|
|
337
339
|
else {
|
package/dist/product_gateway.js
CHANGED
package/package.json
CHANGED
package/product_gateway.ts
CHANGED
|
@@ -186,7 +186,7 @@ export class ProductGateway extends Object {
|
|
|
186
186
|
* @param file 上传的Excel文件
|
|
187
187
|
* @returns Promise
|
|
188
188
|
*/
|
|
189
|
-
import(
|
|
189
|
+
import() {
|
|
190
190
|
return this.context.ready.then((axios) => {
|
|
191
191
|
return axios.upload(`/api/v2/coremde-sale/product/import`);
|
|
192
192
|
});
|
package/user_gateway.ts
CHANGED
|
@@ -62,7 +62,7 @@ export class UserGateway extends Object {
|
|
|
62
62
|
}
|
|
63
63
|
} else {
|
|
64
64
|
var selectedFarm = await this.context.user.getSelectedFarm()
|
|
65
|
-
factoryId = selectedFarm.id
|
|
65
|
+
factoryId = selectedFarm.id as number
|
|
66
66
|
}
|
|
67
67
|
return this.context.ready.then((axios) => {
|
|
68
68
|
return axios.get(`/api/v2/user/list/${factoryId}`)
|