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.
Files changed (58) hide show
  1. package/dist/src/SkyEyeClient.d.ts +4 -2
  2. package/dist/src/SkyEyeClient.js +51 -19
  3. package/dist/src/proto/dir.bat +37 -0
  4. package/dist/src/proto/protoc.bat +37 -0
  5. package/dist/src/proto/protoc.sh +32 -0
  6. package/dist/src/proto/skyeye_rpc.proto +3 -0
  7. package/dist/src/proto/skyeye_rpc_grpc_pb.js +77 -44
  8. package/dist/src/proto/skyeye_rpc_pb.js +328 -322
  9. package/dist/src/proto/tsconfig.json +118 -0
  10. package/dist/src/proto copy/skyeye_rpc.proto +11 -0
  11. package/dist/src/proto copy/skyeye_rpc_grpc_pb.js +44 -0
  12. package/dist/src/proto copy/skyeye_rpc_pb.d.ts +47 -0
  13. package/dist/src/proto copy/skyeye_rpc_pb.js +322 -0
  14. package/dist/test.js +18 -7
  15. package/package.json +11 -6
  16. package/src/SkyEyeClient.ts +52 -20
  17. package/src/proto/protoc.bat +37 -0
  18. package/src/proto/protoc.sh +32 -0
  19. package/src/proto/skyeye_rpc.proto +3 -0
  20. package/src/proto/skyeye_rpc_grpc_pb.js +77 -44
  21. package/src/proto/skyeye_rpc_pb.js +328 -322
  22. package/src/proto/tsconfig.json +118 -0
  23. package/src/proto_backup/skyeye_rpc.proto +11 -0
  24. package/src/proto_backup/skyeye_rpc_grpc_pb.js +44 -0
  25. package/src/proto_backup/skyeye_rpc_pb.d.ts +47 -0
  26. package/src/proto_backup/skyeye_rpc_pb.js +322 -0
  27. package/test.ts +22 -6
  28. package/dist/SkyEyeClient.d.ts +0 -71
  29. package/dist/SkyEyeClient.js +0 -831
  30. package/dist/SkyEyeClientFactory.d.ts +0 -10
  31. package/dist/SkyEyeClientFactory.js +0 -53
  32. package/dist/requests/BaseRequest.d.ts +0 -13
  33. package/dist/requests/BaseRequest.js +0 -18
  34. package/dist/response/BaseResponse.d.ts +0 -5
  35. package/dist/response/BaseResponse.js +0 -7
  36. package/dist/response/GetAllDeviceInfoResponse.d.ts +0 -5
  37. package/dist/response/GetAllDeviceInfoResponse.js +0 -11
  38. package/dist/response/GetCpuListResponse.d.ts +0 -8
  39. package/dist/response/GetCpuListResponse.js +0 -18
  40. package/dist/response/GetCpuRegisterInfoResponse.d.ts +0 -6
  41. package/dist/response/GetCpuRegisterInfoResponse.js +0 -11
  42. package/dist/response/GetCurrentPCResponse.d.ts +0 -4
  43. package/dist/response/GetCurrentPCResponse.js +0 -7
  44. package/dist/response/GetDeviceListResponse.d.ts +0 -6
  45. package/dist/response/GetDeviceListResponse.js +0 -11
  46. package/dist/response/GetDeviceTreeResponse.d.ts +0 -5
  47. package/dist/response/GetDeviceTreeResponse.js +0 -11
  48. package/dist/response/GetDisassembleInfoResponse.d.ts +0 -5
  49. package/dist/response/GetDisassembleInfoResponse.js +0 -7
  50. package/dist/response/GetFaultInjectListResponse.d.ts +0 -8
  51. package/dist/response/GetFaultInjectListResponse.js +0 -18
  52. package/dist/response/GetRamAddrInfoResponse.d.ts +0 -5
  53. package/dist/response/GetRamAddrInfoResponse.js +0 -7
  54. package/dist/response/GetRunningStateResponse.d.ts +0 -14
  55. package/dist/response/GetRunningStateResponse.js +0 -25
  56. package/src/response/BaseResponse.js +0 -27
  57. /package/dist/src/{proto → proto copy}/skyeye_rpc_grpc_pb.d.ts +0 -0
  58. /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,13 +0,0 @@
1
- export declare class BaseRequest {
2
- request: {
3
- name: string;
4
- args: {
5
- [key: string]: string;
6
- };
7
- };
8
- constructor(name: string);
9
- toJSONString(): string;
10
- setArgs(args: {
11
- [key: string]: string;
12
- }): void;
13
- }
@@ -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,5 +0,0 @@
1
- import { JSONResponse } from "../proto/skyeye_rpc_pb";
2
- export declare class BaseResponse extends JSONResponse {
3
- isSuccess: boolean;
4
- callFuncName: string;
5
- }
@@ -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,5 +0,0 @@
1
- import { Board } from "../models/Board";
2
- import { BaseResponse } from "./BaseResponse";
3
- export declare class GetAllDeviceInfoResponse extends BaseResponse {
4
- boardMap: Map<String, Board>;
5
- }
@@ -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,8 +0,0 @@
1
- import { Cpu } from "../models/Cpu";
2
- import { BaseResponse } from "./BaseResponse";
3
- export declare class GetCpuListResponse extends BaseResponse {
4
- private cpuList;
5
- constructor();
6
- getCpuList(): Cpu[];
7
- setCpuList(cpuList: Cpu[]): void;
8
- }
@@ -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,6 +0,0 @@
1
- import { Register } from "../models/Register";
2
- import { BaseResponse } from "./BaseResponse";
3
- export declare class GetCpuRegisterInfoResponse extends BaseResponse {
4
- registers: Register[];
5
- constructor();
6
- }
@@ -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,4 +0,0 @@
1
- import { BaseResponse } from "./BaseResponse";
2
- export declare class GetCurrentPCResponse extends BaseResponse {
3
- private pc;
4
- }
@@ -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,6 +0,0 @@
1
- import { Device } from '../models/Device';
2
- import { BaseResponse } from './BaseResponse';
3
- export declare class GetDeviceListResponse extends BaseResponse {
4
- deviceList: Device[];
5
- constructor();
6
- }
@@ -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,5 +0,0 @@
1
- import { BaseResponse } from "./BaseResponse";
2
- import { Board } from "../models/Board";
3
- export declare class GetDeviceTreeResponse extends BaseResponse {
4
- boardMap: Map<string, Board>;
5
- }
@@ -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,5 +0,0 @@
1
- import { InstructionItem } from "../models/InstructionItem";
2
- import { BaseResponse } from "./BaseResponse";
3
- export declare class GetDisassembleInfoResponse extends BaseResponse {
4
- instructions: Array<InstructionItem>;
5
- }
@@ -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,5 +0,0 @@
1
- import { BaseResponse } from "./BaseResponse";
2
- export declare class GetRamAddrInfoResponse extends BaseResponse {
3
- bits: number;
4
- value: number;
5
- }
@@ -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;