@cpzxrobot/sdk 1.1.97 → 1.1.98
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/dist/index.js +2 -0
- package/dist/logs_gateway.js +15 -0
- package/index.ts +2 -0
- package/logs_gateway.ts +17 -0
- package/package.json +1 -1
- package/readme.md +1 -0
- package/types.d.ts +2 -0
package/dist/index.js
CHANGED
|
@@ -23,6 +23,7 @@ const contract_gateway_1 = require("./contract_gateway");
|
|
|
23
23
|
const customer_gateway_1 = require("./customer_gateway");
|
|
24
24
|
const company_gateway_1 = require("./company_gateway");
|
|
25
25
|
const news_gateway_1 = require("./news_gateway");
|
|
26
|
+
const logs_gateway_1 = require("./logs_gateway");
|
|
26
27
|
class Cpzxrobot {
|
|
27
28
|
constructor(appCode) {
|
|
28
29
|
this.pigfarm = new pigfarm_gateway_1.PigfarmGateway(this);
|
|
@@ -38,6 +39,7 @@ class Cpzxrobot {
|
|
|
38
39
|
this.customer = new customer_gateway_1.CustomerGateway(this);
|
|
39
40
|
this.company = new company_gateway_1.CompanyGateway(this);
|
|
40
41
|
this.news = new news_gateway_1.NewsGateway(this);
|
|
42
|
+
this.logs = new logs_gateway_1.LogsGateway(this);
|
|
41
43
|
//获取当前浏览器的域名
|
|
42
44
|
this.ready = new Promise((resolve, reject) => {
|
|
43
45
|
this.resolveReady = resolve;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LogsGateway = void 0;
|
|
4
|
+
class LogsGateway extends Object {
|
|
5
|
+
constructor(context) {
|
|
6
|
+
super();
|
|
7
|
+
this.context = context;
|
|
8
|
+
}
|
|
9
|
+
operations(args) {
|
|
10
|
+
return this.context.ready.then(axios => {
|
|
11
|
+
return axios.post("/api/v2/log/operationRecord", args);
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.LogsGateway = LogsGateway;
|
package/index.ts
CHANGED
|
@@ -18,6 +18,7 @@ import { ContractGateway } from "./contract_gateway";
|
|
|
18
18
|
import { CustomerGateway } from "./customer_gateway";
|
|
19
19
|
import { CompanyGateway } from "./company_gateway";
|
|
20
20
|
import { NewsGateway } from "./news_gateway";
|
|
21
|
+
import { LogsGateway } from "./logs_gateway";
|
|
21
22
|
|
|
22
23
|
export class Cpzxrobot {
|
|
23
24
|
device: DeviceGateway;
|
|
@@ -62,6 +63,7 @@ export class Cpzxrobot {
|
|
|
62
63
|
customer: CustomerGateway = new CustomerGateway(this);
|
|
63
64
|
company: CompanyGateway = new CompanyGateway(this);
|
|
64
65
|
news: NewsGateway = new NewsGateway(this);
|
|
66
|
+
logs: LogsGateway = new LogsGateway(this);
|
|
65
67
|
|
|
66
68
|
|
|
67
69
|
constructor(appCode: string) {
|
package/logs_gateway.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Cpzxrobot, Factory, Unit } from "./types";
|
|
2
|
+
|
|
3
|
+
export class LogsGateway extends Object {
|
|
4
|
+
context: Cpzxrobot;
|
|
5
|
+
|
|
6
|
+
constructor(context: Cpzxrobot) {
|
|
7
|
+
super();
|
|
8
|
+
this.context = context;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
operations(args:any){
|
|
12
|
+
return this.context.ready.then(axios => {
|
|
13
|
+
return axios.post("/api/v2/log/operationRecord", args);
|
|
14
|
+
})
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
}
|
package/package.json
CHANGED
package/readme.md
CHANGED
package/types.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ import { ProductGateway } from "@cpzxrobot/sdk/product_gateway";
|
|
|
13
13
|
import { ContractGateway } from "@cpzxrobot/sdk/contract_gateway";
|
|
14
14
|
import { CustomerGateway } from "@cpzxrobot/sdk/customer_gateway";
|
|
15
15
|
import { CompanyGateway } from "@cpzxrobot/sdk/company_gateway";
|
|
16
|
+
import { LogsGateway } from "@cpzxrobot/sdk/logs_gateway";
|
|
16
17
|
|
|
17
18
|
type Device = {
|
|
18
19
|
id: number;
|
|
@@ -329,6 +330,7 @@ class Cpzxrobot {
|
|
|
329
330
|
contract: ContractGateway;
|
|
330
331
|
customer: CustomerGateway;
|
|
331
332
|
company: CompanyGateway;
|
|
333
|
+
logs: LogsGateway;
|
|
332
334
|
dict: (key: string) => any;
|
|
333
335
|
_getSelectedFarmFromMiniApp: () => Promise<Factory>;
|
|
334
336
|
_getSelectedUnitFromMiniApp: () => Promise<Unit>;
|