@cpzxrobot/sdk 1.1.7 → 1.1.9

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 CHANGED
@@ -7,9 +7,9 @@ export class CarGateway extends Object {
7
7
  this.context = context;
8
8
  }
9
9
 
10
- weightRecords(car: Device,date: Date) {
10
+ weightRecords(factory: Factory,date: Date) {
11
11
  return this.context.axios
12
- .get(`/api/v2/car/${car.id}/weightRecords?date=`+date.toISOString())
12
+ .get(`/api/v2/car/${factory.pid}/weightRecords?date=`+date.toISOString())
13
13
  .then((res) => res.data);
14
14
  }
15
15
 
@@ -18,4 +18,9 @@ export 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
+
22
+ orders(factory: Factory,date: Date) {
23
+ return this.context.axios
24
+ .get(`/api/v2/car/${factory.pid}/orders?date=`+ date.toISOString())
25
+ }
21
26
  }
@@ -6,9 +6,9 @@ class CarGateway extends Object {
6
6
  super();
7
7
  this.context = context;
8
8
  }
9
- weightRecords(car, date) {
9
+ weightRecords(factory, date) {
10
10
  return this.context.axios
11
- .get(`/api/v2/car/${car.id}/weightRecords?date=` + date.toISOString())
11
+ .get(`/api/v2/car/${factory.pid}/weightRecords?date=` + date.toISOString())
12
12
  .then((res) => res.data);
13
13
  }
14
14
  detections(factory, date) {
@@ -16,5 +16,9 @@ class CarGateway extends Object {
16
16
  .get(`/api/v2/car/${factory.pid}/detections?date=` + date.toISOString())
17
17
  .then((res) => res.data);
18
18
  }
19
+ orders(factory, date) {
20
+ return this.context.axios
21
+ .get(`/api/v2/car/${factory.pid}/orders?date=` + date.toISOString());
22
+ }
19
23
  }
20
24
  exports.CarGateway = CarGateway;
@@ -26,7 +26,7 @@ class FactoryGateway extends Object {
26
26
  //获得工厂的应用信息, 如果指定withRoles为true,则返回app和app的详细角色信息
27
27
  async apps(id, withRoles = false) {
28
28
  var axios = await this.context.ready;
29
- var url = `/api/v2/factory/${id}/apps`;
29
+ var url = `/api/v1/factory/${id}/apps`;
30
30
  if (withRoles) {
31
31
  url += "/roles";
32
32
  }
@@ -31,7 +31,7 @@ export class FactoryGateway extends Object {
31
31
  //获得工厂的应用信息, 如果指定withRoles为true,则返回app和app的详细角色信息
32
32
  async apps(id: number, withRoles = false): Promise<any> {
33
33
  var axios = await this.context.ready;
34
- var url = `/api/v2/factory/${id}/apps`;
34
+ var url = `/api/v1/factory/${id}/apps`;
35
35
  if (withRoles) {
36
36
  url += "/roles";
37
37
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.1.7",
3
+ "version": "1.1.9",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {