skyeye-sdk-js 1.0.7 → 1.0.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/dist/src/SkyEyeClient.d.ts +4 -2
- package/dist/src/SkyEyeClient.js +51 -19
- package/dist/src/proto/dir.bat +37 -0
- package/dist/src/proto/protoc.bat +37 -0
- package/dist/src/proto/protoc.sh +32 -0
- package/dist/src/proto/skyeye_rpc.proto +3 -0
- package/dist/src/proto/skyeye_rpc_grpc_pb.js +77 -44
- package/dist/src/proto/skyeye_rpc_pb.js +328 -322
- package/dist/src/proto/tsconfig.json +118 -0
- package/dist/src/proto copy/skyeye_rpc.proto +11 -0
- package/dist/src/proto copy/skyeye_rpc_grpc_pb.js +44 -0
- package/dist/src/proto copy/skyeye_rpc_pb.d.ts +47 -0
- package/dist/src/proto copy/skyeye_rpc_pb.js +322 -0
- package/dist/test.js +18 -7
- package/package.json +11 -6
- package/src/SkyEyeClient.ts +52 -20
- package/src/proto/protoc.bat +37 -0
- package/src/proto/protoc.sh +32 -0
- package/src/proto/skyeye_rpc.proto +3 -0
- package/src/proto/skyeye_rpc_grpc_pb.js +77 -44
- package/src/proto/skyeye_rpc_pb.js +328 -322
- package/src/proto/tsconfig.json +118 -0
- package/src/proto_backup/skyeye_rpc.proto +11 -0
- package/src/proto_backup/skyeye_rpc_grpc_pb.js +44 -0
- package/src/proto_backup/skyeye_rpc_pb.d.ts +47 -0
- package/src/proto_backup/skyeye_rpc_pb.js +322 -0
- package/test.ts +22 -6
- package/dist/SkyEyeClient.d.ts +0 -71
- package/dist/SkyEyeClient.js +0 -831
- package/dist/SkyEyeClientFactory.d.ts +0 -10
- package/dist/SkyEyeClientFactory.js +0 -53
- package/dist/requests/BaseRequest.d.ts +0 -13
- package/dist/requests/BaseRequest.js +0 -18
- package/dist/response/BaseResponse.d.ts +0 -5
- package/dist/response/BaseResponse.js +0 -7
- package/dist/response/GetAllDeviceInfoResponse.d.ts +0 -5
- package/dist/response/GetAllDeviceInfoResponse.js +0 -11
- package/dist/response/GetCpuListResponse.d.ts +0 -8
- package/dist/response/GetCpuListResponse.js +0 -18
- package/dist/response/GetCpuRegisterInfoResponse.d.ts +0 -6
- package/dist/response/GetCpuRegisterInfoResponse.js +0 -11
- package/dist/response/GetCurrentPCResponse.d.ts +0 -4
- package/dist/response/GetCurrentPCResponse.js +0 -7
- package/dist/response/GetDeviceListResponse.d.ts +0 -6
- package/dist/response/GetDeviceListResponse.js +0 -11
- package/dist/response/GetDeviceTreeResponse.d.ts +0 -5
- package/dist/response/GetDeviceTreeResponse.js +0 -11
- package/dist/response/GetDisassembleInfoResponse.d.ts +0 -5
- package/dist/response/GetDisassembleInfoResponse.js +0 -7
- package/dist/response/GetFaultInjectListResponse.d.ts +0 -8
- package/dist/response/GetFaultInjectListResponse.js +0 -18
- package/dist/response/GetRamAddrInfoResponse.d.ts +0 -5
- package/dist/response/GetRamAddrInfoResponse.js +0 -7
- package/dist/response/GetRunningStateResponse.d.ts +0 -14
- package/dist/response/GetRunningStateResponse.js +0 -25
- package/src/response/BaseResponse.js +0 -27
- /package/dist/src/{proto → proto copy}/skyeye_rpc_grpc_pb.d.ts +0 -0
- /package/src/{proto → proto_backup}/skyeye_rpc_grpc_pb.d.ts +0 -0
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { SkyEyeClient } from "./SkyEyeClient";
|
|
2
|
-
declare class SkyEyeClientFactory {
|
|
3
|
-
private static _instance;
|
|
4
|
-
private constructor();
|
|
5
|
-
static get instance(): SkyEyeClientFactory;
|
|
6
|
-
createClient(ip: string, port: string): SkyEyeClient;
|
|
7
|
-
createConnectedClient(ip: string, port: string): Promise<SkyEyeClient>;
|
|
8
|
-
createConnectedClientTime(ip: string, port: string, time: number): Promise<SkyEyeClient>;
|
|
9
|
-
}
|
|
10
|
-
export { SkyEyeClientFactory };
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.SkyEyeClientFactory = void 0;
|
|
13
|
-
const SkyEyeClient_1 = require("./SkyEyeClient");
|
|
14
|
-
class SkyEyeClientFactory {
|
|
15
|
-
constructor() { }
|
|
16
|
-
static get instance() {
|
|
17
|
-
if (!this._instance) {
|
|
18
|
-
this._instance = new SkyEyeClientFactory();
|
|
19
|
-
}
|
|
20
|
-
return this._instance;
|
|
21
|
-
}
|
|
22
|
-
createClient(ip, port) {
|
|
23
|
-
return new SkyEyeClient_1.SkyEyeClient(ip, port);
|
|
24
|
-
}
|
|
25
|
-
createConnectedClient(ip, port) {
|
|
26
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
-
return this.createConnectedClientTime(ip, port, 5);
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
createConnectedClientTime(ip, port, time) {
|
|
31
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
-
const client = this.createClient(ip, port);
|
|
33
|
-
const startTime = Date.now();
|
|
34
|
-
while (Date.now() - startTime < time * 1000) {
|
|
35
|
-
try {
|
|
36
|
-
const response = client.getCurrentRunningState();
|
|
37
|
-
console.log("response:", response);
|
|
38
|
-
break;
|
|
39
|
-
}
|
|
40
|
-
catch (error) {
|
|
41
|
-
try {
|
|
42
|
-
yield new Promise(resolve => setTimeout(resolve, 100));
|
|
43
|
-
}
|
|
44
|
-
catch (ex) {
|
|
45
|
-
throw new Error(ex);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return client;
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
exports.SkyEyeClientFactory = SkyEyeClientFactory;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BaseRequest = void 0;
|
|
4
|
-
class BaseRequest {
|
|
5
|
-
constructor(name) {
|
|
6
|
-
this.request = {
|
|
7
|
-
name: name,
|
|
8
|
-
args: null
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
toJSONString() {
|
|
12
|
-
return JSON.stringify({ request: this.request });
|
|
13
|
-
}
|
|
14
|
-
setArgs(args) {
|
|
15
|
-
this.request.args = args;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
exports.BaseRequest = BaseRequest;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BaseResponse = void 0;
|
|
4
|
-
const skyeye_rpc_pb_1 = require("../proto/skyeye_rpc_pb");
|
|
5
|
-
class BaseResponse extends skyeye_rpc_pb_1.JSONResponse {
|
|
6
|
-
}
|
|
7
|
-
exports.BaseResponse = BaseResponse;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GetAllDeviceInfoResponse = void 0;
|
|
4
|
-
const BaseResponse_1 = require("./BaseResponse");
|
|
5
|
-
class GetAllDeviceInfoResponse extends BaseResponse_1.BaseResponse {
|
|
6
|
-
constructor() {
|
|
7
|
-
super(...arguments);
|
|
8
|
-
this.boardMap = new Map();
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
exports.GetAllDeviceInfoResponse = GetAllDeviceInfoResponse;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GetCpuListResponse = void 0;
|
|
4
|
-
const BaseResponse_1 = require("./BaseResponse");
|
|
5
|
-
class GetCpuListResponse extends BaseResponse_1.BaseResponse {
|
|
6
|
-
constructor() {
|
|
7
|
-
super();
|
|
8
|
-
this.cpuList = [];
|
|
9
|
-
this.callFuncName = "cpu_list";
|
|
10
|
-
}
|
|
11
|
-
getCpuList() {
|
|
12
|
-
return this.cpuList;
|
|
13
|
-
}
|
|
14
|
-
setCpuList(cpuList) {
|
|
15
|
-
this.cpuList = cpuList;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
exports.GetCpuListResponse = GetCpuListResponse;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GetCpuRegisterInfoResponse = void 0;
|
|
4
|
-
const BaseResponse_1 = require("./BaseResponse");
|
|
5
|
-
class GetCpuRegisterInfoResponse extends BaseResponse_1.BaseResponse {
|
|
6
|
-
constructor() {
|
|
7
|
-
super();
|
|
8
|
-
this.registers = [];
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
exports.GetCpuRegisterInfoResponse = GetCpuRegisterInfoResponse;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GetCurrentPCResponse = void 0;
|
|
4
|
-
const BaseResponse_1 = require("./BaseResponse");
|
|
5
|
-
class GetCurrentPCResponse extends BaseResponse_1.BaseResponse {
|
|
6
|
-
}
|
|
7
|
-
exports.GetCurrentPCResponse = GetCurrentPCResponse;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GetDeviceListResponse = void 0;
|
|
4
|
-
const BaseResponse_1 = require("./BaseResponse");
|
|
5
|
-
class GetDeviceListResponse extends BaseResponse_1.BaseResponse {
|
|
6
|
-
constructor() {
|
|
7
|
-
super();
|
|
8
|
-
this.deviceList = [];
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
exports.GetDeviceListResponse = GetDeviceListResponse;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GetDeviceTreeResponse = void 0;
|
|
4
|
-
const BaseResponse_1 = require("./BaseResponse");
|
|
5
|
-
class GetDeviceTreeResponse extends BaseResponse_1.BaseResponse {
|
|
6
|
-
constructor() {
|
|
7
|
-
super(...arguments);
|
|
8
|
-
this.boardMap = new Map();
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
exports.GetDeviceTreeResponse = GetDeviceTreeResponse;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GetDisassembleInfoResponse = void 0;
|
|
4
|
-
const BaseResponse_1 = require("./BaseResponse");
|
|
5
|
-
class GetDisassembleInfoResponse extends BaseResponse_1.BaseResponse {
|
|
6
|
-
}
|
|
7
|
-
exports.GetDisassembleInfoResponse = GetDisassembleInfoResponse;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { FaultInjectItem } from "../models/FaultInjectItem";
|
|
2
|
-
import { BaseResponse } from "./BaseResponse";
|
|
3
|
-
export declare class GetFaultInjectListResponse extends BaseResponse {
|
|
4
|
-
private _faultInjectItems;
|
|
5
|
-
constructor();
|
|
6
|
-
get faultInjectItems(): FaultInjectItem[];
|
|
7
|
-
set faultInjectItems(value: FaultInjectItem[]);
|
|
8
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GetFaultInjectListResponse = void 0;
|
|
4
|
-
const BaseResponse_1 = require("./BaseResponse");
|
|
5
|
-
class GetFaultInjectListResponse extends BaseResponse_1.BaseResponse {
|
|
6
|
-
constructor() {
|
|
7
|
-
super();
|
|
8
|
-
this.callFuncName = "SE_get_fault_inject_list";
|
|
9
|
-
this._faultInjectItems = [];
|
|
10
|
-
}
|
|
11
|
-
get faultInjectItems() {
|
|
12
|
-
return this._faultInjectItems;
|
|
13
|
-
}
|
|
14
|
-
set faultInjectItems(value) {
|
|
15
|
-
this._faultInjectItems = value;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
exports.GetFaultInjectListResponse = GetFaultInjectListResponse;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GetRamAddrInfoResponse = void 0;
|
|
4
|
-
const BaseResponse_1 = require("./BaseResponse");
|
|
5
|
-
class GetRamAddrInfoResponse extends BaseResponse_1.BaseResponse {
|
|
6
|
-
}
|
|
7
|
-
exports.GetRamAddrInfoResponse = GetRamAddrInfoResponse;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { BaseResponse } from "./BaseResponse";
|
|
2
|
-
export declare enum StateState {
|
|
3
|
-
QUITED = "QUITED",
|
|
4
|
-
UNLOADED = "UNLOADED",
|
|
5
|
-
RUNNING = "RUNNING",
|
|
6
|
-
STOPPED = "STOPPED"
|
|
7
|
-
}
|
|
8
|
-
export declare class GetRunningStateResponse extends BaseResponse {
|
|
9
|
-
state: StateState;
|
|
10
|
-
callFuncName: string;
|
|
11
|
-
constructor();
|
|
12
|
-
getState(): StateState;
|
|
13
|
-
setState(state: StateState): void;
|
|
14
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GetRunningStateResponse = exports.StateState = void 0;
|
|
4
|
-
const BaseResponse_1 = require("./BaseResponse");
|
|
5
|
-
var StateState;
|
|
6
|
-
(function (StateState) {
|
|
7
|
-
StateState["QUITED"] = "QUITED";
|
|
8
|
-
StateState["UNLOADED"] = "UNLOADED";
|
|
9
|
-
StateState["RUNNING"] = "RUNNING";
|
|
10
|
-
StateState["STOPPED"] = "STOPPED";
|
|
11
|
-
})(StateState || (exports.StateState = StateState = {}));
|
|
12
|
-
class GetRunningStateResponse extends BaseResponse_1.BaseResponse {
|
|
13
|
-
constructor() {
|
|
14
|
-
super();
|
|
15
|
-
this.state = StateState.QUITED;
|
|
16
|
-
this.callFuncName = "SE_get_running_status";
|
|
17
|
-
}
|
|
18
|
-
getState() {
|
|
19
|
-
return this.state;
|
|
20
|
-
}
|
|
21
|
-
setState(state) {
|
|
22
|
-
this.state = state;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
exports.GetRunningStateResponse = GetRunningStateResponse;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.BaseResponse = void 0;
|
|
19
|
-
var skyeye_rpc_pb_1 = require("../proto/skyeye_rpc_pb");
|
|
20
|
-
var BaseResponse = /** @class */ (function (_super) {
|
|
21
|
-
__extends(BaseResponse, _super);
|
|
22
|
-
function BaseResponse() {
|
|
23
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
-
}
|
|
25
|
-
return BaseResponse;
|
|
26
|
-
}(skyeye_rpc_pb_1.JSONResponse));
|
|
27
|
-
exports.BaseResponse = BaseResponse;
|
|
File without changes
|
|
File without changes
|