skyeye-sdk-js 1.0.2 → 1.0.3

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.
@@ -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,40 @@
1
+ // package:
2
+ // file: skyeye_rpc.proto
3
+
4
+ /* tslint:disable */
5
+ /* eslint-disable */
6
+ import * as grpc from '@grpc/grpc-js';
7
+ import * as skyeye_rpc_pb from "./skyeye_rpc_pb";
8
+
9
+ interface IJSONTransmissionService extends grpc.ServiceDefinition<grpc.UntypedServiceImplementation> {
10
+ callSkyEye: IJSONTransmissionService_ICallSkyEye;
11
+ }
12
+
13
+ interface IJSONTransmissionService_ICallSkyEye extends grpc.MethodDefinition<skyeye_rpc_pb.JSONRequest, skyeye_rpc_pb.JSONResponse> {
14
+ path: "/JSONTransmission/CallSkyEye";
15
+ requestStream: false;
16
+ responseStream: false;
17
+ requestSerialize: grpc.serialize<skyeye_rpc_pb.JSONRequest>;
18
+ requestDeserialize: grpc.deserialize<skyeye_rpc_pb.JSONRequest>;
19
+ responseSerialize: grpc.serialize<skyeye_rpc_pb.JSONResponse>;
20
+ responseDeserialize: grpc.deserialize<skyeye_rpc_pb.JSONResponse>;
21
+ }
22
+
23
+ export const JSONTransmissionService: IJSONTransmissionService;
24
+
25
+ export interface IJSONTransmissionServer {
26
+ callSkyEye: grpc.handleUnaryCall<skyeye_rpc_pb.JSONRequest, skyeye_rpc_pb.JSONResponse>;
27
+ }
28
+
29
+ export interface IJSONTransmissionClient {
30
+ callSkyEye(request: skyeye_rpc_pb.JSONRequest, callback: (error: grpc.ServiceError | null, response: skyeye_rpc_pb.JSONResponse) => void): grpc.ClientUnaryCall;
31
+ callSkyEye(request: skyeye_rpc_pb.JSONRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: skyeye_rpc_pb.JSONResponse) => void): grpc.ClientUnaryCall;
32
+ callSkyEye(request: skyeye_rpc_pb.JSONRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: skyeye_rpc_pb.JSONResponse) => void): grpc.ClientUnaryCall;
33
+ }
34
+
35
+ export class JSONTransmissionClient extends grpc.Client implements IJSONTransmissionClient {
36
+ constructor(address: string, credentials: grpc.ChannelCredentials, options?: object);
37
+ public callSkyEye(request: skyeye_rpc_pb.JSONRequest, callback: (error: grpc.ServiceError | null, response: skyeye_rpc_pb.JSONResponse) => void): grpc.ClientUnaryCall;
38
+ public callSkyEye(request: skyeye_rpc_pb.JSONRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: skyeye_rpc_pb.JSONResponse) => void): grpc.ClientUnaryCall;
39
+ public callSkyEye(request: skyeye_rpc_pb.JSONRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: skyeye_rpc_pb.JSONResponse) => void): grpc.ClientUnaryCall;
40
+ }
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skyeye-sdk-js",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "gRPC to SkyEye",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",