skyeye-sdk-js 1.0.9 → 1.1.1
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/src/SkyEyeClient.d.ts +2 -2
- package/dist/src/SkyEyeClient.js +13 -13
- package/dist/test.js +1 -1
- package/package.json +2 -7
- package/src/proto/skyeye_rpc_grpc_pb.js +1 -1
- package/test.ts +3 -7
|
@@ -18,8 +18,8 @@ export declare class SkyEyeClient extends JSONTransmissionClient {
|
|
|
18
18
|
private host;
|
|
19
19
|
private port;
|
|
20
20
|
constructor(host: string, port: string);
|
|
21
|
-
RunTestcase(
|
|
22
|
-
Monitor(
|
|
21
|
+
RunTestcase(json: string): Promise<any>;
|
|
22
|
+
Monitor(json: string): Promise<any>;
|
|
23
23
|
call(request: JSONRequest): Promise<any>;
|
|
24
24
|
private printRequestLog;
|
|
25
25
|
private printResponseLog;
|
package/dist/src/SkyEyeClient.js
CHANGED
|
@@ -64,14 +64,14 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
|
|
|
64
64
|
this.host = host;
|
|
65
65
|
this.port = port;
|
|
66
66
|
}
|
|
67
|
-
RunTestcase(
|
|
67
|
+
RunTestcase(json) {
|
|
68
68
|
const _super = Object.create(null, {
|
|
69
69
|
runTestcase: { get: () => super.runTestcase }
|
|
70
70
|
});
|
|
71
71
|
return __awaiter(this, void 0, void 0, function* () {
|
|
72
72
|
try {
|
|
73
73
|
const request = new skyeye_rpc_pb_1.JSONRequest();
|
|
74
|
-
request.setRequest(
|
|
74
|
+
request.setRequest(json);
|
|
75
75
|
const stream = _super.runTestcase.call(this, request);
|
|
76
76
|
return stream;
|
|
77
77
|
}
|
|
@@ -81,21 +81,21 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
|
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
|
-
Monitor(
|
|
84
|
+
Monitor(json) {
|
|
85
85
|
const _super = Object.create(null, {
|
|
86
86
|
Monitor: { get: () => super.Monitor }
|
|
87
87
|
});
|
|
88
88
|
return __awaiter(this, void 0, void 0, function* () {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
89
|
+
try {
|
|
90
|
+
const request = new skyeye_rpc_pb_1.JSONRequest();
|
|
91
|
+
request.setRequest(json);
|
|
92
|
+
const stream = _super.Monitor.call(this, request);
|
|
93
|
+
return stream;
|
|
94
|
+
}
|
|
95
|
+
catch (error) {
|
|
96
|
+
console.error("Error during RunTestcase:", error);
|
|
97
|
+
throw error;
|
|
98
|
+
}
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
101
|
call(request) {
|
package/dist/test.js
CHANGED
|
@@ -32,7 +32,7 @@ function test() {
|
|
|
32
32
|
// const port = "50051"
|
|
33
33
|
// await client.initSkyEyeAndRun(pathSkyEye,fileName,port,skyeyeDir);
|
|
34
34
|
// GrpcUtil.initAndRunExample();
|
|
35
|
-
// const bean = "";
|
|
35
|
+
// const bean:string = '{"id":"33d209da-2459-4e49-97c3-5b1509bc638c","steps":[{"condition":{"type":10,"value":"123"},"send":{"target":{"type":2,"addr":"1222"},"data":"0101011101"}},{"condition":{"type":0,"value":"0xff"},"send":{"target":{"type":2,"addr":"1222"},"data":"0101011101"}}],"expects":[{"condition":{"type":0,"value":"0xff"},"send":{"target":{"type":3,"addr":"2221"}}}]}';
|
|
36
36
|
// const stream = await client.RunTestcase(bean);
|
|
37
37
|
// stream.on('data', (response: JSONResponse) => {
|
|
38
38
|
// console.log('Received response:', response.toObject());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skyeye-sdk-js",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "gRPC to SkyEye",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -14,20 +14,15 @@
|
|
|
14
14
|
"author": "",
|
|
15
15
|
"license": "ISC",
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@types/dotenv": "^8.2.0",
|
|
18
|
-
"@types/google-protobuf": "^3.15.12",
|
|
19
17
|
"@types/node": "^20.11.22",
|
|
20
18
|
"chokidar": "^3.5.3",
|
|
21
19
|
"grpc_tools_node_protoc_ts": "^5.3.3",
|
|
22
|
-
"grpc-tools": "^1.12.4",
|
|
23
20
|
"gulp-mocha": "^10.0.0",
|
|
24
21
|
"typescript": "^5.3.3"
|
|
25
22
|
},
|
|
26
23
|
"dependencies": {
|
|
27
24
|
"@grpc/grpc-js": "^1.10.1",
|
|
28
|
-
|
|
29
|
-
"@grpc/proto-loader": "^0.6.0",
|
|
30
|
-
"@grpc/reflection": "^1.0.0",
|
|
25
|
+
|
|
31
26
|
"async": "^1.5.2",
|
|
32
27
|
"google-protobuf": "^3.21.2",
|
|
33
28
|
"lodash": "^4.6.1",
|
package/test.ts
CHANGED
|
@@ -12,7 +12,7 @@ async function test() {
|
|
|
12
12
|
// await client.getCurrentCpuMips();
|
|
13
13
|
// await client.runCommand();
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
const response = await client.getCurrentRunningState();
|
|
16
16
|
|
|
17
17
|
// const response = await client.getGlobalVarValueDefault("a",GlobalVarType.DOUBLE);
|
|
18
18
|
// const response = await client.getGlobalVarValue("cx53123","a",16,GlobalVarType.DOUBLE);
|
|
@@ -22,7 +22,7 @@ async function test() {
|
|
|
22
22
|
|
|
23
23
|
// const response = await client.getMemoryValueDefault(1, 16);
|
|
24
24
|
// const response = await client.getMemoryValue("c7s",0,16);
|
|
25
|
-
|
|
25
|
+
console.log("结果response:", response)
|
|
26
26
|
|
|
27
27
|
// const pathSkyEye = "D:/data/case/c6713_demo";
|
|
28
28
|
// const fileName = "c6713_demo.skyeye";
|
|
@@ -40,12 +40,8 @@ async function test() {
|
|
|
40
40
|
stream.on('end', () => {
|
|
41
41
|
console.log('Stream ended');
|
|
42
42
|
});
|
|
43
|
-
stream.on('error', (error:
|
|
43
|
+
stream.on('error', (error: Error) => {
|
|
44
44
|
console.error('Error occurred:', error.message);
|
|
45
45
|
});
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
46
|
}
|
|
51
47
|
test();
|