skyeye-sdk-js 1.0.8 → 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 (33) hide show
  1. package/dist/src/SkyEyeClient.d.ts +4 -2
  2. package/dist/src/SkyEyeClient.js +51 -17
  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/src/{proto → proto copy}/skyeye_rpc_grpc_pb.d.ts +0 -0
  33. /package/src/{proto → proto_backup}/skyeye_rpc_grpc_pb.d.ts +0 -0
@@ -0,0 +1,118 @@
1
+ {
2
+ "compilerOptions": {
3
+ "outDir": "./dist/",
4
+ "module": "commonjs",
5
+ "noImplicitAny": true,
6
+ "allowJs": true,
7
+ "esModuleInterop": true,
8
+ "target": "es6",
9
+ "sourceMap": true,
10
+ /* Visit https://aka.ms/tsconfig to read more about this file */
11
+
12
+ /* Projects */
13
+ // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
14
+ // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
15
+ // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
16
+ // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
17
+ // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
18
+ // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
19
+
20
+ /* Language and Environment */
21
+ "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
22
+ // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
23
+ // "jsx": "preserve", /* Specify what JSX code is generated. */
24
+ // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
25
+ // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
26
+ // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
27
+ // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
28
+ // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
29
+ // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
30
+ // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
31
+ // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
32
+ // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
33
+
34
+ /* Modules */
35
+ "module": "commonjs", /* Specify what module code is generated. */
36
+ // "rootDir": "./", /* Specify the root folder within your source files. */
37
+ // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
38
+ // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
39
+ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
40
+ // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
41
+ // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
42
+ // "types": [], /* Specify type package names to be included without being referenced in a source file. */
43
+ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
44
+ // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
45
+ // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
46
+ // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
47
+ // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
48
+ // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
49
+ // "resolveJsonModule": true, /* Enable importing .json files. */
50
+ // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
51
+ // "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
52
+
53
+ /* JavaScript Support */
54
+ // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
55
+ // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
56
+ // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
57
+
58
+ /* Emit */
59
+ // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
60
+ // "declarationMap": true, /* Create sourcemaps for d.ts files. */
61
+ // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
62
+ // "sourceMap": true, /* Create source map files for emitted JavaScript files. */
63
+ // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
64
+ // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
65
+ // "outDir": "./", /* Specify an output folder for all emitted files. */
66
+ // "removeComments": true, /* Disable emitting comments. */
67
+ // "noEmit": true, /* Disable emitting files from a compilation. */
68
+ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
69
+ // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
70
+ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
71
+ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
72
+ // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
73
+ // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
74
+ // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
75
+ // "newLine": "crlf", /* Set the newline character for emitting files. */
76
+ // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
77
+ // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
78
+ // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
79
+ // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
80
+ // "declarationDir": "./", /* Specify the output directory for generated declaration files. */
81
+ // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
82
+
83
+ /* Interop Constraints */
84
+ // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
85
+ // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
86
+ // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
87
+ "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
88
+ // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
89
+ "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
90
+
91
+ /* Type Checking */
92
+ "strict": true, /* Enable all strict type-checking options. */
93
+ // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
94
+ // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
95
+ // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
96
+ // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
97
+ // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
98
+ // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
99
+ // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
100
+ // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
101
+ // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
102
+ // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
103
+ // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
104
+ // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
105
+ // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
106
+ // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
107
+ // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
108
+ // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
109
+ // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
110
+ // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
111
+
112
+ /* Completeness */
113
+ // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
114
+ "skipLibCheck": true /* Skip type checking all .d.ts files. */
115
+ },
116
+ "include": ["./src/**/*"],
117
+ "exclude": ["node_modules"]
118
+ }
@@ -0,0 +1,11 @@
1
+ syntax = "proto3";
2
+
3
+ service JSONTransmission {
4
+ rpc CallSkyEye (JSONRequest) returns (JSONResponse){}
5
+ }
6
+ message JSONRequest {
7
+ string request = 1;
8
+ }
9
+ message JSONResponse {
10
+ string response = 1;
11
+ }
@@ -0,0 +1,44 @@
1
+ // GENERATED CODE -- DO NOT EDIT!
2
+
3
+ 'use strict';
4
+ var grpc = require('@grpc/grpc-js');
5
+ var src_proto_skyeye_rpc_pb = require('../../src/proto/skyeye_rpc_pb.js');
6
+
7
+ function serialize_JSONRequest(arg) {
8
+ if (!(arg instanceof src_proto_skyeye_rpc_pb.JSONRequest)) {
9
+ throw new Error('Expected argument of type JSONRequest');
10
+ }
11
+ return Buffer.from(arg.serializeBinary());
12
+ }
13
+
14
+ function deserialize_JSONRequest(buffer_arg) {
15
+ return src_proto_skyeye_rpc_pb.JSONRequest.deserializeBinary(new Uint8Array(buffer_arg));
16
+ }
17
+
18
+ function serialize_JSONResponse(arg) {
19
+ if (!(arg instanceof src_proto_skyeye_rpc_pb.JSONResponse)) {
20
+ throw new Error('Expected argument of type JSONResponse');
21
+ }
22
+ return Buffer.from(arg.serializeBinary());
23
+ }
24
+
25
+ function deserialize_JSONResponse(buffer_arg) {
26
+ return src_proto_skyeye_rpc_pb.JSONResponse.deserializeBinary(new Uint8Array(buffer_arg));
27
+ }
28
+
29
+
30
+ var JSONTransmissionService = exports.JSONTransmissionService = {
31
+ callSkyEye: {
32
+ path: '/JSONTransmission/CallSkyEye',
33
+ requestStream: false,
34
+ responseStream: false,
35
+ requestType: src_proto_skyeye_rpc_pb.JSONRequest,
36
+ responseType: src_proto_skyeye_rpc_pb.JSONResponse,
37
+ requestSerialize: serialize_JSONRequest,
38
+ requestDeserialize: deserialize_JSONRequest,
39
+ responseSerialize: serialize_JSONResponse,
40
+ responseDeserialize: deserialize_JSONResponse,
41
+ },
42
+ };
43
+
44
+ exports.JSONTransmissionClient = grpc.makeGenericClientConstructor(JSONTransmissionService);
@@ -0,0 +1,47 @@
1
+ // package:
2
+ // file: skyeye_rpc.proto
3
+
4
+ /* tslint:disable */
5
+ /* eslint-disable */
6
+
7
+ import * as jspb from "google-protobuf";
8
+
9
+ export class JSONRequest extends jspb.Message {
10
+ getRequest(): string;
11
+ setRequest(value: string): JSONRequest;
12
+
13
+ serializeBinary(): Uint8Array;
14
+ toObject(includeInstance?: boolean): JSONRequest.AsObject;
15
+ static toObject(includeInstance: boolean, msg: JSONRequest): JSONRequest.AsObject;
16
+ static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
17
+ static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
18
+ static serializeBinaryToWriter(message: JSONRequest, writer: jspb.BinaryWriter): void;
19
+ static deserializeBinary(bytes: Uint8Array): JSONRequest;
20
+ static deserializeBinaryFromReader(message: JSONRequest, reader: jspb.BinaryReader): JSONRequest;
21
+ }
22
+
23
+ export namespace JSONRequest {
24
+ export type AsObject = {
25
+ request: string,
26
+ }
27
+ }
28
+
29
+ export class JSONResponse extends jspb.Message {
30
+ getResponse(): string;
31
+ setResponse(value: string): JSONResponse;
32
+
33
+ serializeBinary(): Uint8Array;
34
+ toObject(includeInstance?: boolean): JSONResponse.AsObject;
35
+ static toObject(includeInstance: boolean, msg: JSONResponse): JSONResponse.AsObject;
36
+ static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
37
+ static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
38
+ static serializeBinaryToWriter(message: JSONResponse, writer: jspb.BinaryWriter): void;
39
+ static deserializeBinary(bytes: Uint8Array): JSONResponse;
40
+ static deserializeBinaryFromReader(message: JSONResponse, reader: jspb.BinaryReader): JSONResponse;
41
+ }
42
+
43
+ export namespace JSONResponse {
44
+ export type AsObject = {
45
+ response: string,
46
+ }
47
+ }
@@ -0,0 +1,322 @@
1
+ // source: src/proto/skyeye_rpc.proto
2
+ /**
3
+ * @fileoverview
4
+ * @enhanceable
5
+ * @suppress {missingRequire} reports error on implicit type usages.
6
+ * @suppress {messageConventions} JS Compiler reports an error if a variable or
7
+ * field starts with 'MSG_' and isn't a translatable message.
8
+ * @public
9
+ */
10
+ // GENERATED CODE -- DO NOT EDIT!
11
+ /* eslint-disable */
12
+ // @ts-nocheck
13
+
14
+ var jspb = require('google-protobuf');
15
+ var goog = jspb;
16
+ var global = Function('return this')();
17
+
18
+ goog.exportSymbol('proto.JSONRequest', null, global);
19
+ goog.exportSymbol('proto.JSONResponse', null, global);
20
+ /**
21
+ * Generated by JsPbCodeGenerator.
22
+ * @param {Array=} opt_data Optional initial data array, typically from a
23
+ * server response, or constructed directly in Javascript. The array is used
24
+ * in place and becomes part of the constructed object. It is not cloned.
25
+ * If no data is provided, the constructed object will be empty, but still
26
+ * valid.
27
+ * @extends {jspb.Message}
28
+ * @constructor
29
+ */
30
+ proto.JSONRequest = function(opt_data) {
31
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
32
+ };
33
+ goog.inherits(proto.JSONRequest, jspb.Message);
34
+ if (goog.DEBUG && !COMPILED) {
35
+ /**
36
+ * @public
37
+ * @override
38
+ */
39
+ proto.JSONRequest.displayName = 'proto.JSONRequest';
40
+ }
41
+ /**
42
+ * Generated by JsPbCodeGenerator.
43
+ * @param {Array=} opt_data Optional initial data array, typically from a
44
+ * server response, or constructed directly in Javascript. The array is used
45
+ * in place and becomes part of the constructed object. It is not cloned.
46
+ * If no data is provided, the constructed object will be empty, but still
47
+ * valid.
48
+ * @extends {jspb.Message}
49
+ * @constructor
50
+ */
51
+ proto.JSONResponse = function(opt_data) {
52
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
53
+ };
54
+ goog.inherits(proto.JSONResponse, jspb.Message);
55
+ if (goog.DEBUG && !COMPILED) {
56
+ /**
57
+ * @public
58
+ * @override
59
+ */
60
+ proto.JSONResponse.displayName = 'proto.JSONResponse';
61
+ }
62
+
63
+
64
+
65
+ if (jspb.Message.GENERATE_TO_OBJECT) {
66
+ /**
67
+ * Creates an object representation of this proto.
68
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
69
+ * Optional fields that are not set will be set to undefined.
70
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
71
+ * For the list of reserved names please see:
72
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
73
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
74
+ * JSPB instance for transitional soy proto support:
75
+ * http://goto/soy-param-migration
76
+ * @return {!Object}
77
+ */
78
+ proto.JSONRequest.prototype.toObject = function(opt_includeInstance) {
79
+ return proto.JSONRequest.toObject(opt_includeInstance, this);
80
+ };
81
+
82
+
83
+ /**
84
+ * Static version of the {@see toObject} method.
85
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
86
+ * the JSPB instance for transitional soy proto support:
87
+ * http://goto/soy-param-migration
88
+ * @param {!proto.JSONRequest} msg The msg instance to transform.
89
+ * @return {!Object}
90
+ * @suppress {unusedLocalVariables} f is only used for nested messages
91
+ */
92
+ proto.JSONRequest.toObject = function(includeInstance, msg) {
93
+ var f, obj = {
94
+ request: jspb.Message.getFieldWithDefault(msg, 1, "")
95
+ };
96
+
97
+ if (includeInstance) {
98
+ obj.$jspbMessageInstance = msg;
99
+ }
100
+ return obj;
101
+ };
102
+ }
103
+
104
+
105
+ /**
106
+ * Deserializes binary data (in protobuf wire format).
107
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
108
+ * @return {!proto.JSONRequest}
109
+ */
110
+ proto.JSONRequest.deserializeBinary = function(bytes) {
111
+ var reader = new jspb.BinaryReader(bytes);
112
+ var msg = new proto.JSONRequest;
113
+ return proto.JSONRequest.deserializeBinaryFromReader(msg, reader);
114
+ };
115
+
116
+
117
+ /**
118
+ * Deserializes binary data (in protobuf wire format) from the
119
+ * given reader into the given message object.
120
+ * @param {!proto.JSONRequest} msg The message object to deserialize into.
121
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
122
+ * @return {!proto.JSONRequest}
123
+ */
124
+ proto.JSONRequest.deserializeBinaryFromReader = function(msg, reader) {
125
+ while (reader.nextField()) {
126
+ if (reader.isEndGroup()) {
127
+ break;
128
+ }
129
+ var field = reader.getFieldNumber();
130
+ switch (field) {
131
+ case 1:
132
+ var value = /** @type {string} */ (reader.readString());
133
+ msg.setRequest(value);
134
+ break;
135
+ default:
136
+ reader.skipField();
137
+ break;
138
+ }
139
+ }
140
+ return msg;
141
+ };
142
+
143
+
144
+ /**
145
+ * Serializes the message to binary data (in protobuf wire format).
146
+ * @return {!Uint8Array}
147
+ */
148
+ proto.JSONRequest.prototype.serializeBinary = function() {
149
+ var writer = new jspb.BinaryWriter();
150
+ proto.JSONRequest.serializeBinaryToWriter(this, writer);
151
+ return writer.getResultBuffer();
152
+ };
153
+
154
+
155
+ /**
156
+ * Serializes the given message to binary data (in protobuf wire
157
+ * format), writing to the given BinaryWriter.
158
+ * @param {!proto.JSONRequest} message
159
+ * @param {!jspb.BinaryWriter} writer
160
+ * @suppress {unusedLocalVariables} f is only used for nested messages
161
+ */
162
+ proto.JSONRequest.serializeBinaryToWriter = function(message, writer) {
163
+ var f = undefined;
164
+ f = message.getRequest();
165
+ if (f.length > 0) {
166
+ writer.writeString(
167
+ 1,
168
+ f
169
+ );
170
+ }
171
+ };
172
+
173
+
174
+ /**
175
+ * optional string request = 1;
176
+ * @return {string}
177
+ */
178
+ proto.JSONRequest.prototype.getRequest = function() {
179
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
180
+ };
181
+
182
+
183
+ /**
184
+ * @param {string} value
185
+ * @return {!proto.JSONRequest} returns this
186
+ */
187
+ proto.JSONRequest.prototype.setRequest = function(value) {
188
+ return jspb.Message.setProto3StringField(this, 1, value);
189
+ };
190
+
191
+
192
+
193
+
194
+
195
+ if (jspb.Message.GENERATE_TO_OBJECT) {
196
+ /**
197
+ * Creates an object representation of this proto.
198
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
199
+ * Optional fields that are not set will be set to undefined.
200
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
201
+ * For the list of reserved names please see:
202
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
203
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
204
+ * JSPB instance for transitional soy proto support:
205
+ * http://goto/soy-param-migration
206
+ * @return {!Object}
207
+ */
208
+ proto.JSONResponse.prototype.toObject = function(opt_includeInstance) {
209
+ return proto.JSONResponse.toObject(opt_includeInstance, this);
210
+ };
211
+
212
+
213
+ /**
214
+ * Static version of the {@see toObject} method.
215
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
216
+ * the JSPB instance for transitional soy proto support:
217
+ * http://goto/soy-param-migration
218
+ * @param {!proto.JSONResponse} msg The msg instance to transform.
219
+ * @return {!Object}
220
+ * @suppress {unusedLocalVariables} f is only used for nested messages
221
+ */
222
+ proto.JSONResponse.toObject = function(includeInstance, msg) {
223
+ var f, obj = {
224
+ response: jspb.Message.getFieldWithDefault(msg, 1, "")
225
+ };
226
+
227
+ if (includeInstance) {
228
+ obj.$jspbMessageInstance = msg;
229
+ }
230
+ return obj;
231
+ };
232
+ }
233
+
234
+
235
+ /**
236
+ * Deserializes binary data (in protobuf wire format).
237
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
238
+ * @return {!proto.JSONResponse}
239
+ */
240
+ proto.JSONResponse.deserializeBinary = function(bytes) {
241
+ var reader = new jspb.BinaryReader(bytes);
242
+ var msg = new proto.JSONResponse;
243
+ return proto.JSONResponse.deserializeBinaryFromReader(msg, reader);
244
+ };
245
+
246
+
247
+ /**
248
+ * Deserializes binary data (in protobuf wire format) from the
249
+ * given reader into the given message object.
250
+ * @param {!proto.JSONResponse} msg The message object to deserialize into.
251
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
252
+ * @return {!proto.JSONResponse}
253
+ */
254
+ proto.JSONResponse.deserializeBinaryFromReader = function(msg, reader) {
255
+ while (reader.nextField()) {
256
+ if (reader.isEndGroup()) {
257
+ break;
258
+ }
259
+ var field = reader.getFieldNumber();
260
+ switch (field) {
261
+ case 1:
262
+ var value = /** @type {string} */ (reader.readString());
263
+ msg.setResponse(value);
264
+ break;
265
+ default:
266
+ reader.skipField();
267
+ break;
268
+ }
269
+ }
270
+ return msg;
271
+ };
272
+
273
+
274
+ /**
275
+ * Serializes the message to binary data (in protobuf wire format).
276
+ * @return {!Uint8Array}
277
+ */
278
+ proto.JSONResponse.prototype.serializeBinary = function() {
279
+ var writer = new jspb.BinaryWriter();
280
+ proto.JSONResponse.serializeBinaryToWriter(this, writer);
281
+ return writer.getResultBuffer();
282
+ };
283
+
284
+
285
+ /**
286
+ * Serializes the given message to binary data (in protobuf wire
287
+ * format), writing to the given BinaryWriter.
288
+ * @param {!proto.JSONResponse} message
289
+ * @param {!jspb.BinaryWriter} writer
290
+ * @suppress {unusedLocalVariables} f is only used for nested messages
291
+ */
292
+ proto.JSONResponse.serializeBinaryToWriter = function(message, writer) {
293
+ var f = undefined;
294
+ f = message.getResponse();
295
+ if (f.length > 0) {
296
+ writer.writeString(
297
+ 1,
298
+ f
299
+ );
300
+ }
301
+ };
302
+
303
+
304
+ /**
305
+ * optional string response = 1;
306
+ * @return {string}
307
+ */
308
+ proto.JSONResponse.prototype.getResponse = function() {
309
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
310
+ };
311
+
312
+
313
+ /**
314
+ * @param {string} value
315
+ * @return {!proto.JSONResponse} returns this
316
+ */
317
+ proto.JSONResponse.prototype.setResponse = function(value) {
318
+ return jspb.Message.setProto3StringField(this, 1, value);
319
+ };
320
+
321
+
322
+ goog.object.extend(exports, proto);
package/test.ts CHANGED
@@ -1,4 +1,6 @@
1
+ import { JSONResponse } from "./src/proto/skyeye_rpc_pb";
1
2
  import { GrpcUtil } from "./src/GrpcUtil";
3
+ import { ServiceError } from "@grpc/grpc-js";
2
4
 
3
5
  const { SkyEyeClientFactory } = require('./src/SkyEyeClientFactory')
4
6
  const { SkyEyeClient } = require('./src/SkyEyeClient')
@@ -22,14 +24,28 @@ async function test() {
22
24
  // const response = await client.getMemoryValue("c7s",0,16);
23
25
  // console.log("结果response:", response)
24
26
 
25
- const pathSkyEye = "D:/data/case/c6713_demo";
26
- const fileName = "c6713_demo.skyeye";
27
- const skyeyeDir = "D:/install/skyeye/opt/skyeye/bin/skyeye.exe"
28
- const port = "50051"
29
- await client.initSkyEyeAndRun(pathSkyEye,fileName,skyeyeDir,port);
27
+ // const pathSkyEye = "D:/data/case/c6713_demo";
28
+ // const fileName = "c6713_demo.skyeye";
29
+ // const skyeyeDir = "D:/install/skyeye/opt/skyeye/bin/skyeye.exe"
30
+ // const port = "50051"
31
+ // await client.initSkyEyeAndRun(pathSkyEye,fileName,port,skyeyeDir);
30
32
 
31
33
  // GrpcUtil.initAndRunExample();
32
-
34
+
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
+ const stream = await client.RunTestcase(bean);
37
+ stream.on('data', (response: JSONResponse) => {
38
+ console.log('Received response:', response.toObject());
39
+ });
40
+ stream.on('end', () => {
41
+ console.log('Stream ended');
42
+ });
43
+ stream.on('error', (error: ServiceError) => {
44
+ console.error('Error occurred:', error.message);
45
+ });
46
+
47
+
48
+
33
49
 
34
50
  }
35
51
  test();
@@ -1,71 +0,0 @@
1
- import { JSONRequest } from './proto/skyeye_rpc_pb';
2
- import { JSONTransmissionClient } from './proto/skyeye_rpc_grpc_pb';
3
- import { GetCpuListResponse } from './response/GetCpuListResponse';
4
- import { GlobalVarType } from './models/GlobalVarType';
5
- import { GetDeviceListResponse } from './response/GetDeviceListResponse';
6
- import { GetRunningStateResponse } from './response/GetRunningStateResponse';
7
- import { Register } from './models/Register';
8
- import { GetDeviceTreeResponse } from './response/GetDeviceTreeResponse';
9
- import { GetAllDeviceInfoResponse } from './response/GetAllDeviceInfoResponse';
10
- import { GetRamAddrInfoResponse } from './response/GetRamAddrInfoResponse';
11
- import { Device } from './models/Device';
12
- import { FaultInjectType } from './models/FaultInjectType';
13
- import { FaultInjectItem } from './models/FaultInjectItem';
14
- import { GetFaultInjectListResponse } from './response/GetFaultInjectListResponse';
15
- import { GetDisassembleInfoResponse } from './response/GetDisassembleInfoResponse';
16
- import { GetCpuRegisterInfoResponse } from './response/GetCpuRegisterInfoResponse';
17
- declare class SkyEyeClient extends JSONTransmissionClient {
18
- private host;
19
- private port;
20
- constructor(host: string, port: string);
21
- private printRequestLog;
22
- private printResponseLog;
23
- call(request: JSONRequest): Promise<any>;
24
- runScriptRequest(filename: string): Promise<any>;
25
- runCommand(): Promise<any>;
26
- stopCommand(): Promise<any>;
27
- quitCommand(): Promise<any>;
28
- getCpuList(): Promise<GetCpuListResponse>;
29
- enableDeviceWork(deviceName: string): Promise<any>;
30
- disableDeviceWork(deviceName: string): Promise<any>;
31
- changeDir(skyeyeProjectRootDir: string): Promise<any>;
32
- getRunningDeviceInfo(): Promise<any>;
33
- getSimulationTime(cpuName: string): Promise<any>;
34
- getCurrentSimulationTime(): Promise<any>;
35
- getDeviceList(): Promise<GetDeviceListResponse>;
36
- getPC(cpuName: string): Promise<any>;
37
- getCurrentPC(): Promise<any>;
38
- getCpuMips(cpuName: string): Promise<any>;
39
- getCurrentCpuMips(): Promise<any>;
40
- getGlobalVarValue(cpuName: string, varName: string, bytesNum: number, valueType: GlobalVarType): Promise<any>;
41
- getGlobalVarValueDefault(varName: string, valueType: GlobalVarType): Promise<any>;
42
- setGlobalVarValue(cpuName: string, varName: string, bytesNum: number, valueType: GlobalVarType, value: string): Promise<any>;
43
- setGlobalVarValueDefault(varName: string, valueType: GlobalVarType, value: string): Promise<any>;
44
- getMemoryValue(cpuName: string, baseAddr: number, length: number): Promise<any>;
45
- getAddressingSpace(cpuName: string, baseAddr: number, length: number): Promise<any>;
46
- getMemoryValueDefault(baseAddr: number, length: number): Promise<any>;
47
- getAddressingSpaceDefault(baseAddr: number, length: number): Promise<any>;
48
- getCpuRegisters(cpuName: string): Promise<GetCpuRegisterInfoResponse>;
49
- getCpuRegistersDefault(): Promise<GetCpuRegisterInfoResponse>;
50
- setCpuRegisterValueDefault(register: Register, value: number): Promise<any>;
51
- setCpuRegisterValue(boardName: string, cpuName: string, registerName: string, value: number): Promise<any>;
52
- getDeviceTree(): Promise<GetDeviceTreeResponse>;
53
- getCurrentRunningState(): Promise<GetRunningStateResponse>;
54
- getAllDeviceInfo(): Promise<GetAllDeviceInfoResponse>;
55
- getRamAddrInfo(machName: string, addr: number): Promise<GetRamAddrInfoResponse>;
56
- setRamFaultInjectDefault(device: Device, addr: number, bit: number, mode: FaultInjectType): Promise<any>;
57
- setRamFaultInject(boardName: string, deviceName: string, addr: number, bit: number, mode: FaultInjectType): Promise<any>;
58
- setRegisterFaultInjectDefault(register: Register, bit: number, mode: FaultInjectType): Promise<any>;
59
- setRegisterFaultInject(boardName: string, deviceName: string, addr: number, bit: number, mode: FaultInjectType): Promise<any>;
60
- deleteFaultInjectDefault(faultInjectItem: FaultInjectItem): Promise<any>;
61
- deleteFaultInject(boardName: string, deviceName: string, addr: number, bit: string, mode: FaultInjectType): Promise<any>;
62
- getFaultInjectList(): Promise<GetFaultInjectListResponse>;
63
- getDisassembleInfo(cpuName: string, startAddr: number, nums: number): Promise<GetDisassembleInfoResponse>;
64
- getDisassembleInfoDefault(startAddr: number, nums: number): Promise<GetDisassembleInfoResponse>;
65
- SingleStep(cpuName: string): Promise<any>;
66
- SingleStepDefault(): Promise<any>;
67
- close(): boolean;
68
- getHost(): string;
69
- getPort(): string;
70
- }
71
- export { SkyEyeClient };