@cpzxrobot/sdk 1.3.63 → 1.3.64

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.3.63",
3
+ "version": "1.3.64",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/types.d.ts CHANGED
@@ -104,6 +104,7 @@ type Unit = {
104
104
  workshopId?: number;
105
105
  factoryId?: number;
106
106
  };
107
+ type UnitConfigType = "HeatLamp" | "DeviceFilter" | "PigFarm";
107
108
  type DeviceType = {
108
109
  id: number;
109
110
  code: string;
package/unit_gateway.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Cpzxrobot, type Unit } from "./types";
1
+ import { Cpzxrobot, type Unit, type UnitConfigType } from "./types";
2
2
 
3
3
  export class UnitGateway extends Object {
4
4
  context: Cpzxrobot;
@@ -16,7 +16,7 @@ export class UnitGateway extends Object {
16
16
  return {
17
17
  add: (
18
18
  unit: Unit,
19
- type: "HeatLamp" | "DeviceFilter",
19
+ type: UnitConfigType,
20
20
  config: {
21
21
  [key: string]: any;
22
22
  }
@@ -31,7 +31,7 @@ export class UnitGateway extends Object {
31
31
  },
32
32
  update: (
33
33
  unit: Unit,
34
- type: "HeatLamp" | "DeviceFilter",
34
+ type: UnitConfigType,
35
35
  config: {
36
36
  [key: string]: any;
37
37
  }
@@ -44,7 +44,7 @@ export class UnitGateway extends Object {
44
44
  });
45
45
  });
46
46
  },
47
- get: (unit: Unit, type: "HeatLamp" | "DeviceFilter") => {
47
+ get: (unit: Unit, type: UnitConfigType) => {
48
48
  return this.context.ready.then((axios) => {
49
49
  return axios.get(`/api/v2/unit/config`, {
50
50
  params: {
@@ -57,7 +57,7 @@ export class UnitGateway extends Object {
57
57
  delete: (
58
58
  unit: Unit,
59
59
  config: string,
60
- type: "HeatLamp" | "DeviceFilter"
60
+ type: UnitConfigType
61
61
  ) => {
62
62
  return this.context.ready.then((axios) => {
63
63
  return axios.get(`/api/v2/unit/config/delete`, {