@iglesys/techvulns-proto 0.0.1 → 0.0.3-b

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/README.md CHANGED
@@ -3,4 +3,5 @@ go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
3
3
  go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
4
4
 
5
5
  npm install -g grpc-tools
6
- npm install -g protoc-gen-js
6
+ npm install -g protoc-gen-js
7
+ npm install google-protobuf
package/package.json CHANGED
@@ -3,10 +3,10 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.0.1",
7
- "main": "gen/js/techvulns/v1/tech_pb.js",
6
+ "version": "0.0.3b",
7
+ "main": "gen/ts/techvulns/v1/tech.ts",
8
8
  "files": [
9
- "gen/js",
9
+ "gen/ts",
10
10
  "techvulns"
11
11
  ],
12
12
  "license": "GPL-3.0-only",
package/gen/js/.keep DELETED
File without changes
@@ -1,44 +0,0 @@
1
- // GENERATED CODE -- DO NOT EDIT!
2
-
3
- 'use strict';
4
- var grpc = require('@grpc/grpc-js');
5
- var techvulns_v1_tech_pb = require('../../techvulns/v1/tech_pb.js');
6
-
7
- function serialize_techvulns_v1_AnalyzeRequest(arg) {
8
- if (!(arg instanceof techvulns_v1_tech_pb.AnalyzeRequest)) {
9
- throw new Error('Expected argument of type techvulns.v1.AnalyzeRequest');
10
- }
11
- return Buffer.from(arg.serializeBinary());
12
- }
13
-
14
- function deserialize_techvulns_v1_AnalyzeRequest(buffer_arg) {
15
- return techvulns_v1_tech_pb.AnalyzeRequest.deserializeBinary(new Uint8Array(buffer_arg));
16
- }
17
-
18
- function serialize_techvulns_v1_AnalyzeResponse(arg) {
19
- if (!(arg instanceof techvulns_v1_tech_pb.AnalyzeResponse)) {
20
- throw new Error('Expected argument of type techvulns.v1.AnalyzeResponse');
21
- }
22
- return Buffer.from(arg.serializeBinary());
23
- }
24
-
25
- function deserialize_techvulns_v1_AnalyzeResponse(buffer_arg) {
26
- return techvulns_v1_tech_pb.AnalyzeResponse.deserializeBinary(new Uint8Array(buffer_arg));
27
- }
28
-
29
-
30
- var TechnologyServiceService = exports.TechnologyServiceService = {
31
- analyze: {
32
- path: '/techvulns.v1.TechnologyService/Analyze',
33
- requestStream: false,
34
- responseStream: false,
35
- requestType: techvulns_v1_tech_pb.AnalyzeRequest,
36
- responseType: techvulns_v1_tech_pb.AnalyzeResponse,
37
- requestSerialize: serialize_techvulns_v1_AnalyzeRequest,
38
- requestDeserialize: deserialize_techvulns_v1_AnalyzeRequest,
39
- responseSerialize: serialize_techvulns_v1_AnalyzeResponse,
40
- responseDeserialize: deserialize_techvulns_v1_AnalyzeResponse,
41
- },
42
- };
43
-
44
- exports.TechnologyServiceClient = grpc.makeGenericClientConstructor(TechnologyServiceService, 'TechnologyService');
@@ -1,1013 +0,0 @@
1
- // source: techvulns/v1/tech.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 =
17
- (typeof globalThis !== 'undefined' && globalThis) ||
18
- (typeof window !== 'undefined' && window) ||
19
- (typeof global !== 'undefined' && global) ||
20
- (typeof self !== 'undefined' && self) ||
21
- (function () { return this; }).call(null) ||
22
- Function('return this')();
23
-
24
- goog.exportSymbol('proto.techvulns.v1.AnalyzeRequest', null, global);
25
- goog.exportSymbol('proto.techvulns.v1.AnalyzeResponse', null, global);
26
- goog.exportSymbol('proto.techvulns.v1.Technology', null, global);
27
- goog.exportSymbol('proto.techvulns.v1.Technology.Category', null, global);
28
- /**
29
- * Generated by JsPbCodeGenerator.
30
- * @param {Array=} opt_data Optional initial data array, typically from a
31
- * server response, or constructed directly in Javascript. The array is used
32
- * in place and becomes part of the constructed object. It is not cloned.
33
- * If no data is provided, the constructed object will be empty, but still
34
- * valid.
35
- * @extends {jspb.Message}
36
- * @constructor
37
- */
38
- proto.techvulns.v1.AnalyzeRequest = function(opt_data) {
39
- jspb.Message.initialize(this, opt_data, 0, -1, null, null);
40
- };
41
- goog.inherits(proto.techvulns.v1.AnalyzeRequest, jspb.Message);
42
- if (goog.DEBUG && !COMPILED) {
43
- /**
44
- * @public
45
- * @override
46
- */
47
- proto.techvulns.v1.AnalyzeRequest.displayName = 'proto.techvulns.v1.AnalyzeRequest';
48
- }
49
- /**
50
- * Generated by JsPbCodeGenerator.
51
- * @param {Array=} opt_data Optional initial data array, typically from a
52
- * server response, or constructed directly in Javascript. The array is used
53
- * in place and becomes part of the constructed object. It is not cloned.
54
- * If no data is provided, the constructed object will be empty, but still
55
- * valid.
56
- * @extends {jspb.Message}
57
- * @constructor
58
- */
59
- proto.techvulns.v1.AnalyzeResponse = function(opt_data) {
60
- jspb.Message.initialize(this, opt_data, 0, -1, proto.techvulns.v1.AnalyzeResponse.repeatedFields_, null);
61
- };
62
- goog.inherits(proto.techvulns.v1.AnalyzeResponse, jspb.Message);
63
- if (goog.DEBUG && !COMPILED) {
64
- /**
65
- * @public
66
- * @override
67
- */
68
- proto.techvulns.v1.AnalyzeResponse.displayName = 'proto.techvulns.v1.AnalyzeResponse';
69
- }
70
- /**
71
- * Generated by JsPbCodeGenerator.
72
- * @param {Array=} opt_data Optional initial data array, typically from a
73
- * server response, or constructed directly in Javascript. The array is used
74
- * in place and becomes part of the constructed object. It is not cloned.
75
- * If no data is provided, the constructed object will be empty, but still
76
- * valid.
77
- * @extends {jspb.Message}
78
- * @constructor
79
- */
80
- proto.techvulns.v1.Technology = function(opt_data) {
81
- jspb.Message.initialize(this, opt_data, 0, -1, null, null);
82
- };
83
- goog.inherits(proto.techvulns.v1.Technology, jspb.Message);
84
- if (goog.DEBUG && !COMPILED) {
85
- /**
86
- * @public
87
- * @override
88
- */
89
- proto.techvulns.v1.Technology.displayName = 'proto.techvulns.v1.Technology';
90
- }
91
- /**
92
- * Generated by JsPbCodeGenerator.
93
- * @param {Array=} opt_data Optional initial data array, typically from a
94
- * server response, or constructed directly in Javascript. The array is used
95
- * in place and becomes part of the constructed object. It is not cloned.
96
- * If no data is provided, the constructed object will be empty, but still
97
- * valid.
98
- * @extends {jspb.Message}
99
- * @constructor
100
- */
101
- proto.techvulns.v1.Technology.Category = function(opt_data) {
102
- jspb.Message.initialize(this, opt_data, 0, -1, null, null);
103
- };
104
- goog.inherits(proto.techvulns.v1.Technology.Category, jspb.Message);
105
- if (goog.DEBUG && !COMPILED) {
106
- /**
107
- * @public
108
- * @override
109
- */
110
- proto.techvulns.v1.Technology.Category.displayName = 'proto.techvulns.v1.Technology.Category';
111
- }
112
-
113
-
114
-
115
- if (jspb.Message.GENERATE_TO_OBJECT) {
116
- /**
117
- * Creates an object representation of this proto.
118
- * Field names that are reserved in JavaScript and will be renamed to pb_name.
119
- * Optional fields that are not set will be set to undefined.
120
- * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
121
- * For the list of reserved names please see:
122
- * net/proto2/compiler/js/internal/generator.cc#kKeyword.
123
- * @param {boolean=} opt_includeInstance Deprecated. whether to include the
124
- * JSPB instance for transitional soy proto support:
125
- * http://goto/soy-param-migration
126
- * @return {!Object}
127
- */
128
- proto.techvulns.v1.AnalyzeRequest.prototype.toObject = function(opt_includeInstance) {
129
- return proto.techvulns.v1.AnalyzeRequest.toObject(opt_includeInstance, this);
130
- };
131
-
132
-
133
- /**
134
- * Static version of the {@see toObject} method.
135
- * @param {boolean|undefined} includeInstance Deprecated. Whether to include
136
- * the JSPB instance for transitional soy proto support:
137
- * http://goto/soy-param-migration
138
- * @param {!proto.techvulns.v1.AnalyzeRequest} msg The msg instance to transform.
139
- * @return {!Object}
140
- * @suppress {unusedLocalVariables} f is only used for nested messages
141
- */
142
- proto.techvulns.v1.AnalyzeRequest.toObject = function(includeInstance, msg) {
143
- var f, obj = {
144
- target: jspb.Message.getFieldWithDefault(msg, 1, "")
145
- };
146
-
147
- if (includeInstance) {
148
- obj.$jspbMessageInstance = msg;
149
- }
150
- return obj;
151
- };
152
- }
153
-
154
-
155
- /**
156
- * Deserializes binary data (in protobuf wire format).
157
- * @param {jspb.ByteSource} bytes The bytes to deserialize.
158
- * @return {!proto.techvulns.v1.AnalyzeRequest}
159
- */
160
- proto.techvulns.v1.AnalyzeRequest.deserializeBinary = function(bytes) {
161
- var reader = new jspb.BinaryReader(bytes);
162
- var msg = new proto.techvulns.v1.AnalyzeRequest;
163
- return proto.techvulns.v1.AnalyzeRequest.deserializeBinaryFromReader(msg, reader);
164
- };
165
-
166
-
167
- /**
168
- * Deserializes binary data (in protobuf wire format) from the
169
- * given reader into the given message object.
170
- * @param {!proto.techvulns.v1.AnalyzeRequest} msg The message object to deserialize into.
171
- * @param {!jspb.BinaryReader} reader The BinaryReader to use.
172
- * @return {!proto.techvulns.v1.AnalyzeRequest}
173
- */
174
- proto.techvulns.v1.AnalyzeRequest.deserializeBinaryFromReader = function(msg, reader) {
175
- while (reader.nextField()) {
176
- if (reader.isEndGroup()) {
177
- break;
178
- }
179
- var field = reader.getFieldNumber();
180
- switch (field) {
181
- case 1:
182
- var value = /** @type {string} */ (reader.readString());
183
- msg.setTarget(value);
184
- break;
185
- default:
186
- reader.skipField();
187
- break;
188
- }
189
- }
190
- return msg;
191
- };
192
-
193
-
194
- /**
195
- * Serializes the message to binary data (in protobuf wire format).
196
- * @return {!Uint8Array}
197
- */
198
- proto.techvulns.v1.AnalyzeRequest.prototype.serializeBinary = function() {
199
- var writer = new jspb.BinaryWriter();
200
- proto.techvulns.v1.AnalyzeRequest.serializeBinaryToWriter(this, writer);
201
- return writer.getResultBuffer();
202
- };
203
-
204
-
205
- /**
206
- * Serializes the given message to binary data (in protobuf wire
207
- * format), writing to the given BinaryWriter.
208
- * @param {!proto.techvulns.v1.AnalyzeRequest} message
209
- * @param {!jspb.BinaryWriter} writer
210
- * @suppress {unusedLocalVariables} f is only used for nested messages
211
- */
212
- proto.techvulns.v1.AnalyzeRequest.serializeBinaryToWriter = function(message, writer) {
213
- var f = undefined;
214
- f = message.getTarget();
215
- if (f.length > 0) {
216
- writer.writeString(
217
- 1,
218
- f
219
- );
220
- }
221
- };
222
-
223
-
224
- /**
225
- * optional string target = 1;
226
- * @return {string}
227
- */
228
- proto.techvulns.v1.AnalyzeRequest.prototype.getTarget = function() {
229
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
230
- };
231
-
232
-
233
- /**
234
- * @param {string} value
235
- * @return {!proto.techvulns.v1.AnalyzeRequest} returns this
236
- */
237
- proto.techvulns.v1.AnalyzeRequest.prototype.setTarget = function(value) {
238
- return jspb.Message.setProto3StringField(this, 1, value);
239
- };
240
-
241
-
242
-
243
- /**
244
- * List of repeated fields within this message type.
245
- * @private {!Array<number>}
246
- * @const
247
- */
248
- proto.techvulns.v1.AnalyzeResponse.repeatedFields_ = [1];
249
-
250
-
251
-
252
- if (jspb.Message.GENERATE_TO_OBJECT) {
253
- /**
254
- * Creates an object representation of this proto.
255
- * Field names that are reserved in JavaScript and will be renamed to pb_name.
256
- * Optional fields that are not set will be set to undefined.
257
- * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
258
- * For the list of reserved names please see:
259
- * net/proto2/compiler/js/internal/generator.cc#kKeyword.
260
- * @param {boolean=} opt_includeInstance Deprecated. whether to include the
261
- * JSPB instance for transitional soy proto support:
262
- * http://goto/soy-param-migration
263
- * @return {!Object}
264
- */
265
- proto.techvulns.v1.AnalyzeResponse.prototype.toObject = function(opt_includeInstance) {
266
- return proto.techvulns.v1.AnalyzeResponse.toObject(opt_includeInstance, this);
267
- };
268
-
269
-
270
- /**
271
- * Static version of the {@see toObject} method.
272
- * @param {boolean|undefined} includeInstance Deprecated. Whether to include
273
- * the JSPB instance for transitional soy proto support:
274
- * http://goto/soy-param-migration
275
- * @param {!proto.techvulns.v1.AnalyzeResponse} msg The msg instance to transform.
276
- * @return {!Object}
277
- * @suppress {unusedLocalVariables} f is only used for nested messages
278
- */
279
- proto.techvulns.v1.AnalyzeResponse.toObject = function(includeInstance, msg) {
280
- var f, obj = {
281
- technologiesList: jspb.Message.toObjectList(msg.getTechnologiesList(),
282
- proto.techvulns.v1.Technology.toObject, includeInstance)
283
- };
284
-
285
- if (includeInstance) {
286
- obj.$jspbMessageInstance = msg;
287
- }
288
- return obj;
289
- };
290
- }
291
-
292
-
293
- /**
294
- * Deserializes binary data (in protobuf wire format).
295
- * @param {jspb.ByteSource} bytes The bytes to deserialize.
296
- * @return {!proto.techvulns.v1.AnalyzeResponse}
297
- */
298
- proto.techvulns.v1.AnalyzeResponse.deserializeBinary = function(bytes) {
299
- var reader = new jspb.BinaryReader(bytes);
300
- var msg = new proto.techvulns.v1.AnalyzeResponse;
301
- return proto.techvulns.v1.AnalyzeResponse.deserializeBinaryFromReader(msg, reader);
302
- };
303
-
304
-
305
- /**
306
- * Deserializes binary data (in protobuf wire format) from the
307
- * given reader into the given message object.
308
- * @param {!proto.techvulns.v1.AnalyzeResponse} msg The message object to deserialize into.
309
- * @param {!jspb.BinaryReader} reader The BinaryReader to use.
310
- * @return {!proto.techvulns.v1.AnalyzeResponse}
311
- */
312
- proto.techvulns.v1.AnalyzeResponse.deserializeBinaryFromReader = function(msg, reader) {
313
- while (reader.nextField()) {
314
- if (reader.isEndGroup()) {
315
- break;
316
- }
317
- var field = reader.getFieldNumber();
318
- switch (field) {
319
- case 1:
320
- var value = new proto.techvulns.v1.Technology;
321
- reader.readMessage(value,proto.techvulns.v1.Technology.deserializeBinaryFromReader);
322
- msg.addTechnologies(value);
323
- break;
324
- default:
325
- reader.skipField();
326
- break;
327
- }
328
- }
329
- return msg;
330
- };
331
-
332
-
333
- /**
334
- * Serializes the message to binary data (in protobuf wire format).
335
- * @return {!Uint8Array}
336
- */
337
- proto.techvulns.v1.AnalyzeResponse.prototype.serializeBinary = function() {
338
- var writer = new jspb.BinaryWriter();
339
- proto.techvulns.v1.AnalyzeResponse.serializeBinaryToWriter(this, writer);
340
- return writer.getResultBuffer();
341
- };
342
-
343
-
344
- /**
345
- * Serializes the given message to binary data (in protobuf wire
346
- * format), writing to the given BinaryWriter.
347
- * @param {!proto.techvulns.v1.AnalyzeResponse} message
348
- * @param {!jspb.BinaryWriter} writer
349
- * @suppress {unusedLocalVariables} f is only used for nested messages
350
- */
351
- proto.techvulns.v1.AnalyzeResponse.serializeBinaryToWriter = function(message, writer) {
352
- var f = undefined;
353
- f = message.getTechnologiesList();
354
- if (f.length > 0) {
355
- writer.writeRepeatedMessage(
356
- 1,
357
- f,
358
- proto.techvulns.v1.Technology.serializeBinaryToWriter
359
- );
360
- }
361
- };
362
-
363
-
364
- /**
365
- * repeated Technology technologies = 1;
366
- * @return {!Array<!proto.techvulns.v1.Technology>}
367
- */
368
- proto.techvulns.v1.AnalyzeResponse.prototype.getTechnologiesList = function() {
369
- return /** @type{!Array<!proto.techvulns.v1.Technology>} */ (
370
- jspb.Message.getRepeatedWrapperField(this, proto.techvulns.v1.Technology, 1));
371
- };
372
-
373
-
374
- /**
375
- * @param {!Array<!proto.techvulns.v1.Technology>} value
376
- * @return {!proto.techvulns.v1.AnalyzeResponse} returns this
377
- */
378
- proto.techvulns.v1.AnalyzeResponse.prototype.setTechnologiesList = function(value) {
379
- return jspb.Message.setRepeatedWrapperField(this, 1, value);
380
- };
381
-
382
-
383
- /**
384
- * @param {!proto.techvulns.v1.Technology=} opt_value
385
- * @param {number=} opt_index
386
- * @return {!proto.techvulns.v1.Technology}
387
- */
388
- proto.techvulns.v1.AnalyzeResponse.prototype.addTechnologies = function(opt_value, opt_index) {
389
- return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.techvulns.v1.Technology, opt_index);
390
- };
391
-
392
-
393
- /**
394
- * Clears the list making it empty but non-null.
395
- * @return {!proto.techvulns.v1.AnalyzeResponse} returns this
396
- */
397
- proto.techvulns.v1.AnalyzeResponse.prototype.clearTechnologiesList = function() {
398
- return this.setTechnologiesList([]);
399
- };
400
-
401
-
402
-
403
-
404
-
405
- if (jspb.Message.GENERATE_TO_OBJECT) {
406
- /**
407
- * Creates an object representation of this proto.
408
- * Field names that are reserved in JavaScript and will be renamed to pb_name.
409
- * Optional fields that are not set will be set to undefined.
410
- * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
411
- * For the list of reserved names please see:
412
- * net/proto2/compiler/js/internal/generator.cc#kKeyword.
413
- * @param {boolean=} opt_includeInstance Deprecated. whether to include the
414
- * JSPB instance for transitional soy proto support:
415
- * http://goto/soy-param-migration
416
- * @return {!Object}
417
- */
418
- proto.techvulns.v1.Technology.prototype.toObject = function(opt_includeInstance) {
419
- return proto.techvulns.v1.Technology.toObject(opt_includeInstance, this);
420
- };
421
-
422
-
423
- /**
424
- * Static version of the {@see toObject} method.
425
- * @param {boolean|undefined} includeInstance Deprecated. Whether to include
426
- * the JSPB instance for transitional soy proto support:
427
- * http://goto/soy-param-migration
428
- * @param {!proto.techvulns.v1.Technology} msg The msg instance to transform.
429
- * @return {!Object}
430
- * @suppress {unusedLocalVariables} f is only used for nested messages
431
- */
432
- proto.techvulns.v1.Technology.toObject = function(includeInstance, msg) {
433
- var f, obj = {
434
- slug: jspb.Message.getFieldWithDefault(msg, 1, ""),
435
- name: jspb.Message.getFieldWithDefault(msg, 2, ""),
436
- description: jspb.Message.getFieldWithDefault(msg, 3, ""),
437
- confidence: jspb.Message.getFieldWithDefault(msg, 4, 0),
438
- version: jspb.Message.getFieldWithDefault(msg, 5, ""),
439
- icon: jspb.Message.getFieldWithDefault(msg, 6, ""),
440
- website: jspb.Message.getFieldWithDefault(msg, 7, ""),
441
- cpe: jspb.Message.getFieldWithDefault(msg, 8, ""),
442
- category: (f = msg.getCategory()) && proto.techvulns.v1.Technology.Category.toObject(includeInstance, f),
443
- rootPath: jspb.Message.getBooleanFieldWithDefault(msg, 10, false)
444
- };
445
-
446
- if (includeInstance) {
447
- obj.$jspbMessageInstance = msg;
448
- }
449
- return obj;
450
- };
451
- }
452
-
453
-
454
- /**
455
- * Deserializes binary data (in protobuf wire format).
456
- * @param {jspb.ByteSource} bytes The bytes to deserialize.
457
- * @return {!proto.techvulns.v1.Technology}
458
- */
459
- proto.techvulns.v1.Technology.deserializeBinary = function(bytes) {
460
- var reader = new jspb.BinaryReader(bytes);
461
- var msg = new proto.techvulns.v1.Technology;
462
- return proto.techvulns.v1.Technology.deserializeBinaryFromReader(msg, reader);
463
- };
464
-
465
-
466
- /**
467
- * Deserializes binary data (in protobuf wire format) from the
468
- * given reader into the given message object.
469
- * @param {!proto.techvulns.v1.Technology} msg The message object to deserialize into.
470
- * @param {!jspb.BinaryReader} reader The BinaryReader to use.
471
- * @return {!proto.techvulns.v1.Technology}
472
- */
473
- proto.techvulns.v1.Technology.deserializeBinaryFromReader = function(msg, reader) {
474
- while (reader.nextField()) {
475
- if (reader.isEndGroup()) {
476
- break;
477
- }
478
- var field = reader.getFieldNumber();
479
- switch (field) {
480
- case 1:
481
- var value = /** @type {string} */ (reader.readString());
482
- msg.setSlug(value);
483
- break;
484
- case 2:
485
- var value = /** @type {string} */ (reader.readString());
486
- msg.setName(value);
487
- break;
488
- case 3:
489
- var value = /** @type {string} */ (reader.readString());
490
- msg.setDescription(value);
491
- break;
492
- case 4:
493
- var value = /** @type {number} */ (reader.readInt32());
494
- msg.setConfidence(value);
495
- break;
496
- case 5:
497
- var value = /** @type {string} */ (reader.readString());
498
- msg.setVersion(value);
499
- break;
500
- case 6:
501
- var value = /** @type {string} */ (reader.readString());
502
- msg.setIcon(value);
503
- break;
504
- case 7:
505
- var value = /** @type {string} */ (reader.readString());
506
- msg.setWebsite(value);
507
- break;
508
- case 8:
509
- var value = /** @type {string} */ (reader.readString());
510
- msg.setCpe(value);
511
- break;
512
- case 9:
513
- var value = new proto.techvulns.v1.Technology.Category;
514
- reader.readMessage(value,proto.techvulns.v1.Technology.Category.deserializeBinaryFromReader);
515
- msg.setCategory(value);
516
- break;
517
- case 10:
518
- var value = /** @type {boolean} */ (reader.readBool());
519
- msg.setRootPath(value);
520
- break;
521
- default:
522
- reader.skipField();
523
- break;
524
- }
525
- }
526
- return msg;
527
- };
528
-
529
-
530
- /**
531
- * Serializes the message to binary data (in protobuf wire format).
532
- * @return {!Uint8Array}
533
- */
534
- proto.techvulns.v1.Technology.prototype.serializeBinary = function() {
535
- var writer = new jspb.BinaryWriter();
536
- proto.techvulns.v1.Technology.serializeBinaryToWriter(this, writer);
537
- return writer.getResultBuffer();
538
- };
539
-
540
-
541
- /**
542
- * Serializes the given message to binary data (in protobuf wire
543
- * format), writing to the given BinaryWriter.
544
- * @param {!proto.techvulns.v1.Technology} message
545
- * @param {!jspb.BinaryWriter} writer
546
- * @suppress {unusedLocalVariables} f is only used for nested messages
547
- */
548
- proto.techvulns.v1.Technology.serializeBinaryToWriter = function(message, writer) {
549
- var f = undefined;
550
- f = message.getSlug();
551
- if (f.length > 0) {
552
- writer.writeString(
553
- 1,
554
- f
555
- );
556
- }
557
- f = message.getName();
558
- if (f.length > 0) {
559
- writer.writeString(
560
- 2,
561
- f
562
- );
563
- }
564
- f = message.getDescription();
565
- if (f.length > 0) {
566
- writer.writeString(
567
- 3,
568
- f
569
- );
570
- }
571
- f = message.getConfidence();
572
- if (f !== 0) {
573
- writer.writeInt32(
574
- 4,
575
- f
576
- );
577
- }
578
- f = message.getVersion();
579
- if (f.length > 0) {
580
- writer.writeString(
581
- 5,
582
- f
583
- );
584
- }
585
- f = message.getIcon();
586
- if (f.length > 0) {
587
- writer.writeString(
588
- 6,
589
- f
590
- );
591
- }
592
- f = message.getWebsite();
593
- if (f.length > 0) {
594
- writer.writeString(
595
- 7,
596
- f
597
- );
598
- }
599
- f = message.getCpe();
600
- if (f.length > 0) {
601
- writer.writeString(
602
- 8,
603
- f
604
- );
605
- }
606
- f = message.getCategory();
607
- if (f != null) {
608
- writer.writeMessage(
609
- 9,
610
- f,
611
- proto.techvulns.v1.Technology.Category.serializeBinaryToWriter
612
- );
613
- }
614
- f = message.getRootPath();
615
- if (f) {
616
- writer.writeBool(
617
- 10,
618
- f
619
- );
620
- }
621
- };
622
-
623
-
624
-
625
-
626
-
627
- if (jspb.Message.GENERATE_TO_OBJECT) {
628
- /**
629
- * Creates an object representation of this proto.
630
- * Field names that are reserved in JavaScript and will be renamed to pb_name.
631
- * Optional fields that are not set will be set to undefined.
632
- * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
633
- * For the list of reserved names please see:
634
- * net/proto2/compiler/js/internal/generator.cc#kKeyword.
635
- * @param {boolean=} opt_includeInstance Deprecated. whether to include the
636
- * JSPB instance for transitional soy proto support:
637
- * http://goto/soy-param-migration
638
- * @return {!Object}
639
- */
640
- proto.techvulns.v1.Technology.Category.prototype.toObject = function(opt_includeInstance) {
641
- return proto.techvulns.v1.Technology.Category.toObject(opt_includeInstance, this);
642
- };
643
-
644
-
645
- /**
646
- * Static version of the {@see toObject} method.
647
- * @param {boolean|undefined} includeInstance Deprecated. Whether to include
648
- * the JSPB instance for transitional soy proto support:
649
- * http://goto/soy-param-migration
650
- * @param {!proto.techvulns.v1.Technology.Category} msg The msg instance to transform.
651
- * @return {!Object}
652
- * @suppress {unusedLocalVariables} f is only used for nested messages
653
- */
654
- proto.techvulns.v1.Technology.Category.toObject = function(includeInstance, msg) {
655
- var f, obj = {
656
- id: jspb.Message.getFieldWithDefault(msg, 1, 0),
657
- slug: jspb.Message.getFieldWithDefault(msg, 2, ""),
658
- name: jspb.Message.getFieldWithDefault(msg, 3, "")
659
- };
660
-
661
- if (includeInstance) {
662
- obj.$jspbMessageInstance = msg;
663
- }
664
- return obj;
665
- };
666
- }
667
-
668
-
669
- /**
670
- * Deserializes binary data (in protobuf wire format).
671
- * @param {jspb.ByteSource} bytes The bytes to deserialize.
672
- * @return {!proto.techvulns.v1.Technology.Category}
673
- */
674
- proto.techvulns.v1.Technology.Category.deserializeBinary = function(bytes) {
675
- var reader = new jspb.BinaryReader(bytes);
676
- var msg = new proto.techvulns.v1.Technology.Category;
677
- return proto.techvulns.v1.Technology.Category.deserializeBinaryFromReader(msg, reader);
678
- };
679
-
680
-
681
- /**
682
- * Deserializes binary data (in protobuf wire format) from the
683
- * given reader into the given message object.
684
- * @param {!proto.techvulns.v1.Technology.Category} msg The message object to deserialize into.
685
- * @param {!jspb.BinaryReader} reader The BinaryReader to use.
686
- * @return {!proto.techvulns.v1.Technology.Category}
687
- */
688
- proto.techvulns.v1.Technology.Category.deserializeBinaryFromReader = function(msg, reader) {
689
- while (reader.nextField()) {
690
- if (reader.isEndGroup()) {
691
- break;
692
- }
693
- var field = reader.getFieldNumber();
694
- switch (field) {
695
- case 1:
696
- var value = /** @type {number} */ (reader.readInt32());
697
- msg.setId(value);
698
- break;
699
- case 2:
700
- var value = /** @type {string} */ (reader.readString());
701
- msg.setSlug(value);
702
- break;
703
- case 3:
704
- var value = /** @type {string} */ (reader.readString());
705
- msg.setName(value);
706
- break;
707
- default:
708
- reader.skipField();
709
- break;
710
- }
711
- }
712
- return msg;
713
- };
714
-
715
-
716
- /**
717
- * Serializes the message to binary data (in protobuf wire format).
718
- * @return {!Uint8Array}
719
- */
720
- proto.techvulns.v1.Technology.Category.prototype.serializeBinary = function() {
721
- var writer = new jspb.BinaryWriter();
722
- proto.techvulns.v1.Technology.Category.serializeBinaryToWriter(this, writer);
723
- return writer.getResultBuffer();
724
- };
725
-
726
-
727
- /**
728
- * Serializes the given message to binary data (in protobuf wire
729
- * format), writing to the given BinaryWriter.
730
- * @param {!proto.techvulns.v1.Technology.Category} message
731
- * @param {!jspb.BinaryWriter} writer
732
- * @suppress {unusedLocalVariables} f is only used for nested messages
733
- */
734
- proto.techvulns.v1.Technology.Category.serializeBinaryToWriter = function(message, writer) {
735
- var f = undefined;
736
- f = message.getId();
737
- if (f !== 0) {
738
- writer.writeInt32(
739
- 1,
740
- f
741
- );
742
- }
743
- f = message.getSlug();
744
- if (f.length > 0) {
745
- writer.writeString(
746
- 2,
747
- f
748
- );
749
- }
750
- f = message.getName();
751
- if (f.length > 0) {
752
- writer.writeString(
753
- 3,
754
- f
755
- );
756
- }
757
- };
758
-
759
-
760
- /**
761
- * optional int32 id = 1;
762
- * @return {number}
763
- */
764
- proto.techvulns.v1.Technology.Category.prototype.getId = function() {
765
- return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
766
- };
767
-
768
-
769
- /**
770
- * @param {number} value
771
- * @return {!proto.techvulns.v1.Technology.Category} returns this
772
- */
773
- proto.techvulns.v1.Technology.Category.prototype.setId = function(value) {
774
- return jspb.Message.setProto3IntField(this, 1, value);
775
- };
776
-
777
-
778
- /**
779
- * optional string slug = 2;
780
- * @return {string}
781
- */
782
- proto.techvulns.v1.Technology.Category.prototype.getSlug = function() {
783
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
784
- };
785
-
786
-
787
- /**
788
- * @param {string} value
789
- * @return {!proto.techvulns.v1.Technology.Category} returns this
790
- */
791
- proto.techvulns.v1.Technology.Category.prototype.setSlug = function(value) {
792
- return jspb.Message.setProto3StringField(this, 2, value);
793
- };
794
-
795
-
796
- /**
797
- * optional string name = 3;
798
- * @return {string}
799
- */
800
- proto.techvulns.v1.Technology.Category.prototype.getName = function() {
801
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
802
- };
803
-
804
-
805
- /**
806
- * @param {string} value
807
- * @return {!proto.techvulns.v1.Technology.Category} returns this
808
- */
809
- proto.techvulns.v1.Technology.Category.prototype.setName = function(value) {
810
- return jspb.Message.setProto3StringField(this, 3, value);
811
- };
812
-
813
-
814
- /**
815
- * optional string slug = 1;
816
- * @return {string}
817
- */
818
- proto.techvulns.v1.Technology.prototype.getSlug = function() {
819
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
820
- };
821
-
822
-
823
- /**
824
- * @param {string} value
825
- * @return {!proto.techvulns.v1.Technology} returns this
826
- */
827
- proto.techvulns.v1.Technology.prototype.setSlug = function(value) {
828
- return jspb.Message.setProto3StringField(this, 1, value);
829
- };
830
-
831
-
832
- /**
833
- * optional string name = 2;
834
- * @return {string}
835
- */
836
- proto.techvulns.v1.Technology.prototype.getName = function() {
837
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
838
- };
839
-
840
-
841
- /**
842
- * @param {string} value
843
- * @return {!proto.techvulns.v1.Technology} returns this
844
- */
845
- proto.techvulns.v1.Technology.prototype.setName = function(value) {
846
- return jspb.Message.setProto3StringField(this, 2, value);
847
- };
848
-
849
-
850
- /**
851
- * optional string description = 3;
852
- * @return {string}
853
- */
854
- proto.techvulns.v1.Technology.prototype.getDescription = function() {
855
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
856
- };
857
-
858
-
859
- /**
860
- * @param {string} value
861
- * @return {!proto.techvulns.v1.Technology} returns this
862
- */
863
- proto.techvulns.v1.Technology.prototype.setDescription = function(value) {
864
- return jspb.Message.setProto3StringField(this, 3, value);
865
- };
866
-
867
-
868
- /**
869
- * optional int32 confidence = 4;
870
- * @return {number}
871
- */
872
- proto.techvulns.v1.Technology.prototype.getConfidence = function() {
873
- return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0));
874
- };
875
-
876
-
877
- /**
878
- * @param {number} value
879
- * @return {!proto.techvulns.v1.Technology} returns this
880
- */
881
- proto.techvulns.v1.Technology.prototype.setConfidence = function(value) {
882
- return jspb.Message.setProto3IntField(this, 4, value);
883
- };
884
-
885
-
886
- /**
887
- * optional string version = 5;
888
- * @return {string}
889
- */
890
- proto.techvulns.v1.Technology.prototype.getVersion = function() {
891
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, ""));
892
- };
893
-
894
-
895
- /**
896
- * @param {string} value
897
- * @return {!proto.techvulns.v1.Technology} returns this
898
- */
899
- proto.techvulns.v1.Technology.prototype.setVersion = function(value) {
900
- return jspb.Message.setProto3StringField(this, 5, value);
901
- };
902
-
903
-
904
- /**
905
- * optional string icon = 6;
906
- * @return {string}
907
- */
908
- proto.techvulns.v1.Technology.prototype.getIcon = function() {
909
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, ""));
910
- };
911
-
912
-
913
- /**
914
- * @param {string} value
915
- * @return {!proto.techvulns.v1.Technology} returns this
916
- */
917
- proto.techvulns.v1.Technology.prototype.setIcon = function(value) {
918
- return jspb.Message.setProto3StringField(this, 6, value);
919
- };
920
-
921
-
922
- /**
923
- * optional string website = 7;
924
- * @return {string}
925
- */
926
- proto.techvulns.v1.Technology.prototype.getWebsite = function() {
927
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, ""));
928
- };
929
-
930
-
931
- /**
932
- * @param {string} value
933
- * @return {!proto.techvulns.v1.Technology} returns this
934
- */
935
- proto.techvulns.v1.Technology.prototype.setWebsite = function(value) {
936
- return jspb.Message.setProto3StringField(this, 7, value);
937
- };
938
-
939
-
940
- /**
941
- * optional string cpe = 8;
942
- * @return {string}
943
- */
944
- proto.techvulns.v1.Technology.prototype.getCpe = function() {
945
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 8, ""));
946
- };
947
-
948
-
949
- /**
950
- * @param {string} value
951
- * @return {!proto.techvulns.v1.Technology} returns this
952
- */
953
- proto.techvulns.v1.Technology.prototype.setCpe = function(value) {
954
- return jspb.Message.setProto3StringField(this, 8, value);
955
- };
956
-
957
-
958
- /**
959
- * optional Category category = 9;
960
- * @return {?proto.techvulns.v1.Technology.Category}
961
- */
962
- proto.techvulns.v1.Technology.prototype.getCategory = function() {
963
- return /** @type{?proto.techvulns.v1.Technology.Category} */ (
964
- jspb.Message.getWrapperField(this, proto.techvulns.v1.Technology.Category, 9));
965
- };
966
-
967
-
968
- /**
969
- * @param {?proto.techvulns.v1.Technology.Category|undefined} value
970
- * @return {!proto.techvulns.v1.Technology} returns this
971
- */
972
- proto.techvulns.v1.Technology.prototype.setCategory = function(value) {
973
- return jspb.Message.setWrapperField(this, 9, value);
974
- };
975
-
976
-
977
- /**
978
- * Clears the message field making it undefined.
979
- * @return {!proto.techvulns.v1.Technology} returns this
980
- */
981
- proto.techvulns.v1.Technology.prototype.clearCategory = function() {
982
- return this.setCategory(undefined);
983
- };
984
-
985
-
986
- /**
987
- * Returns whether this field is set.
988
- * @return {boolean}
989
- */
990
- proto.techvulns.v1.Technology.prototype.hasCategory = function() {
991
- return jspb.Message.getField(this, 9) != null;
992
- };
993
-
994
-
995
- /**
996
- * optional bool root_path = 10;
997
- * @return {boolean}
998
- */
999
- proto.techvulns.v1.Technology.prototype.getRootPath = function() {
1000
- return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 10, false));
1001
- };
1002
-
1003
-
1004
- /**
1005
- * @param {boolean} value
1006
- * @return {!proto.techvulns.v1.Technology} returns this
1007
- */
1008
- proto.techvulns.v1.Technology.prototype.setRootPath = function(value) {
1009
- return jspb.Message.setProto3BooleanField(this, 10, value);
1010
- };
1011
-
1012
-
1013
- goog.object.extend(exports, proto.techvulns.v1);