@science-corporation/synapse 0.13.0 → 2.0.0

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 (88) hide show
  1. package/README.md +4 -2
  2. package/dist/api/api.d.ts +711 -71
  3. package/dist/api/api.js +5532 -4083
  4. package/dist/api/api.js.map +1 -1
  5. package/dist/api/proto.json +122 -32
  6. package/dist/config.d.ts.map +1 -1
  7. package/dist/config.js +4 -2
  8. package/dist/config.js.map +1 -1
  9. package/dist/demo.js +125 -32
  10. package/dist/demo.js.map +1 -1
  11. package/dist/device.d.ts +6 -0
  12. package/dist/device.d.ts.map +1 -1
  13. package/dist/device.js +25 -0
  14. package/dist/device.js.map +1 -1
  15. package/dist/nodes/index.d.ts +2 -1
  16. package/dist/nodes/index.d.ts.map +1 -1
  17. package/dist/nodes/index.js +5 -3
  18. package/dist/nodes/index.js.map +1 -1
  19. package/dist/nodes/spike_binner.d.ts +11 -0
  20. package/dist/nodes/{spike_detect.d.ts.map → spike_binner.d.ts.map} +1 -1
  21. package/dist/nodes/spike_binner.js +28 -0
  22. package/dist/nodes/{spike_detect.js.map → spike_binner.js.map} +1 -1
  23. package/dist/nodes/spike_detector.d.ts +11 -0
  24. package/dist/nodes/spike_detector.d.ts.map +1 -0
  25. package/dist/nodes/{spike_detect.js → spike_detector.js} +9 -9
  26. package/dist/nodes/spike_detector.js.map +1 -0
  27. package/dist/nodes/stream_out.d.ts +12 -5
  28. package/dist/nodes/stream_out.d.ts.map +1 -1
  29. package/dist/nodes/stream_out.js +58 -40
  30. package/dist/nodes/stream_out.js.map +1 -1
  31. package/dist/utils/ip.d.ts +2 -0
  32. package/dist/utils/ip.d.ts.map +1 -0
  33. package/dist/utils/ip.js +52 -0
  34. package/dist/utils/ip.js.map +1 -0
  35. package/package.json +6 -5
  36. package/scripts/postinstall.sh +50 -10
  37. package/src/api/api.d.ts +711 -71
  38. package/src/api/api.js +5671 -4121
  39. package/src/api/proto.json +122 -32
  40. package/src/config.ts +4 -2
  41. package/src/demo.ts +20 -8
  42. package/src/device.ts +34 -1
  43. package/src/nodes/index.ts +2 -1
  44. package/src/nodes/spike_binner.ts +30 -0
  45. package/src/nodes/spike_detector.ts +30 -0
  46. package/src/nodes/stream_out.ts +67 -50
  47. package/src/utils/ip.ts +35 -0
  48. package/synapse-api/.github/pull_request_template.md +10 -0
  49. package/synapse-api/README.md +1 -1
  50. package/synapse-api/api/datatype.proto +1 -0
  51. package/synapse-api/api/node.proto +6 -3
  52. package/synapse-api/api/nodes/spike_binner.proto +7 -0
  53. package/synapse-api/api/nodes/spike_detector.proto +19 -0
  54. package/synapse-api/api/nodes/stream_out.proto +31 -1
  55. package/synapse-api/api/query.proto +19 -1
  56. package/synapse-api/api/synapse.proto +1 -0
  57. package/dist/api-science-device/api.d.ts +0 -3
  58. package/dist/api-science-device/api.d.ts.map +0 -1
  59. package/dist/api-science-device/api.js +0 -3822
  60. package/dist/api-science-device/api.js.map +0 -1
  61. package/dist/api-science-device/proto.json +0 -258
  62. package/dist/nodejs.d.ts +0 -8
  63. package/dist/nodejs.d.ts.map +0 -1
  64. package/dist/nodejs.js +0 -32
  65. package/dist/nodejs.js.map +0 -1
  66. package/dist/nodes/spike_detect.d.ts +0 -11
  67. package/dist/science-device-api/api.d.ts +0 -3
  68. package/dist/science-device-api/api.d.ts.map +0 -1
  69. package/dist/science-device-api/api.js +0 -3822
  70. package/dist/science-device-api/api.js.map +0 -1
  71. package/dist/types/index.d.ts +0 -3
  72. package/dist/types/index.d.ts.map +0 -1
  73. package/dist/types/index.js +0 -19
  74. package/dist/types/index.js.map +0 -1
  75. package/dist/types.d.ts +0 -5
  76. package/dist/types.d.ts.map +0 -1
  77. package/dist/types.js +0 -19
  78. package/dist/types.js.map +0 -1
  79. package/dist/utils/device-management.d.ts +0 -37
  80. package/dist/utils/device-management.d.ts.map +0 -1
  81. package/dist/utils/device-management.js +0 -126
  82. package/dist/utils/device-management.js.map +0 -1
  83. package/dist/utils/ndtp.d.ts +0 -40
  84. package/dist/utils/ndtp.d.ts.map +0 -1
  85. package/dist/utils/ndtp.js +0 -140
  86. package/dist/utils/ndtp.js.map +0 -1
  87. package/src/nodes/spike_detect.ts +0 -30
  88. package/synapse-api/api/nodes/spike_detect.proto +0 -16
@@ -1,3822 +0,0 @@
1
- /*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
2
- (function (global, factory) {
3
- /* AMD */ if (typeof define === 'function' && define.amd)
4
- define(["protobufjs/minimal"], factory);
5
- /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports)
6
- module.exports = factory(require("protobufjs/minimal"));
7
- })(this, function ($protobuf) {
8
- "use strict";
9
- // Common aliases
10
- var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
11
- // Exported root namespace
12
- var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
13
- $root.science = (function () {
14
- /**
15
- * Namespace science.
16
- * @exports science
17
- * @namespace
18
- */
19
- var science = {};
20
- science.OAuthCredentials = (function () {
21
- /**
22
- * Properties of a OAuthCredentials.
23
- * @memberof science
24
- * @interface IOAuthCredentials
25
- * @property {string|null} [token] OAuthCredentials token
26
- * @property {string|null} [authServerUrl] OAuthCredentials authServerUrl
27
- */
28
- /**
29
- * Constructs a new OAuthCredentials.
30
- * @memberof science
31
- * @classdesc Represents a OAuthCredentials.
32
- * @implements IOAuthCredentials
33
- * @constructor
34
- * @param {science.IOAuthCredentials=} [properties] Properties to set
35
- */
36
- function OAuthCredentials(properties) {
37
- if (properties)
38
- for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
39
- if (properties[keys[i]] != null)
40
- this[keys[i]] = properties[keys[i]];
41
- }
42
- /**
43
- * OAuthCredentials token.
44
- * @member {string} token
45
- * @memberof science.OAuthCredentials
46
- * @instance
47
- */
48
- OAuthCredentials.prototype.token = "";
49
- /**
50
- * OAuthCredentials authServerUrl.
51
- * @member {string} authServerUrl
52
- * @memberof science.OAuthCredentials
53
- * @instance
54
- */
55
- OAuthCredentials.prototype.authServerUrl = "";
56
- /**
57
- * Creates a new OAuthCredentials instance using the specified properties.
58
- * @function create
59
- * @memberof science.OAuthCredentials
60
- * @static
61
- * @param {science.IOAuthCredentials=} [properties] Properties to set
62
- * @returns {science.OAuthCredentials} OAuthCredentials instance
63
- */
64
- OAuthCredentials.create = function create(properties) {
65
- return new OAuthCredentials(properties);
66
- };
67
- /**
68
- * Encodes the specified OAuthCredentials message. Does not implicitly {@link science.OAuthCredentials.verify|verify} messages.
69
- * @function encode
70
- * @memberof science.OAuthCredentials
71
- * @static
72
- * @param {science.IOAuthCredentials} message OAuthCredentials message or plain object to encode
73
- * @param {$protobuf.Writer} [writer] Writer to encode to
74
- * @returns {$protobuf.Writer} Writer
75
- */
76
- OAuthCredentials.encode = function encode(message, writer) {
77
- if (!writer)
78
- writer = $Writer.create();
79
- if (message.token != null && Object.hasOwnProperty.call(message, "token"))
80
- writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.token);
81
- if (message.authServerUrl != null && Object.hasOwnProperty.call(message, "authServerUrl"))
82
- writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.authServerUrl);
83
- return writer;
84
- };
85
- /**
86
- * Encodes the specified OAuthCredentials message, length delimited. Does not implicitly {@link science.OAuthCredentials.verify|verify} messages.
87
- * @function encodeDelimited
88
- * @memberof science.OAuthCredentials
89
- * @static
90
- * @param {science.IOAuthCredentials} message OAuthCredentials message or plain object to encode
91
- * @param {$protobuf.Writer} [writer] Writer to encode to
92
- * @returns {$protobuf.Writer} Writer
93
- */
94
- OAuthCredentials.encodeDelimited = function encodeDelimited(message, writer) {
95
- return this.encode(message, writer).ldelim();
96
- };
97
- /**
98
- * Decodes a OAuthCredentials message from the specified reader or buffer.
99
- * @function decode
100
- * @memberof science.OAuthCredentials
101
- * @static
102
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
103
- * @param {number} [length] Message length if known beforehand
104
- * @returns {science.OAuthCredentials} OAuthCredentials
105
- * @throws {Error} If the payload is not a reader or valid buffer
106
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
107
- */
108
- OAuthCredentials.decode = function decode(reader, length) {
109
- if (!(reader instanceof $Reader))
110
- reader = $Reader.create(reader);
111
- var end = length === undefined ? reader.len : reader.pos + length, message = new $root.science.OAuthCredentials();
112
- while (reader.pos < end) {
113
- var tag = reader.uint32();
114
- switch (tag >>> 3) {
115
- case 1: {
116
- message.token = reader.string();
117
- break;
118
- }
119
- case 2: {
120
- message.authServerUrl = reader.string();
121
- break;
122
- }
123
- default:
124
- reader.skipType(tag & 7);
125
- break;
126
- }
127
- }
128
- return message;
129
- };
130
- /**
131
- * Decodes a OAuthCredentials message from the specified reader or buffer, length delimited.
132
- * @function decodeDelimited
133
- * @memberof science.OAuthCredentials
134
- * @static
135
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
136
- * @returns {science.OAuthCredentials} OAuthCredentials
137
- * @throws {Error} If the payload is not a reader or valid buffer
138
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
139
- */
140
- OAuthCredentials.decodeDelimited = function decodeDelimited(reader) {
141
- if (!(reader instanceof $Reader))
142
- reader = new $Reader(reader);
143
- return this.decode(reader, reader.uint32());
144
- };
145
- /**
146
- * Verifies a OAuthCredentials message.
147
- * @function verify
148
- * @memberof science.OAuthCredentials
149
- * @static
150
- * @param {Object.<string,*>} message Plain object to verify
151
- * @returns {string|null} `null` if valid, otherwise the reason why it is not
152
- */
153
- OAuthCredentials.verify = function verify(message) {
154
- if (typeof message !== "object" || message === null)
155
- return "object expected";
156
- if (message.token != null && message.hasOwnProperty("token"))
157
- if (!$util.isString(message.token))
158
- return "token: string expected";
159
- if (message.authServerUrl != null && message.hasOwnProperty("authServerUrl"))
160
- if (!$util.isString(message.authServerUrl))
161
- return "authServerUrl: string expected";
162
- return null;
163
- };
164
- /**
165
- * Creates a OAuthCredentials message from a plain object. Also converts values to their respective internal types.
166
- * @function fromObject
167
- * @memberof science.OAuthCredentials
168
- * @static
169
- * @param {Object.<string,*>} object Plain object
170
- * @returns {science.OAuthCredentials} OAuthCredentials
171
- */
172
- OAuthCredentials.fromObject = function fromObject(object) {
173
- if (object instanceof $root.science.OAuthCredentials)
174
- return object;
175
- var message = new $root.science.OAuthCredentials();
176
- if (object.token != null)
177
- message.token = String(object.token);
178
- if (object.authServerUrl != null)
179
- message.authServerUrl = String(object.authServerUrl);
180
- return message;
181
- };
182
- /**
183
- * Creates a plain object from a OAuthCredentials message. Also converts values to other types if specified.
184
- * @function toObject
185
- * @memberof science.OAuthCredentials
186
- * @static
187
- * @param {science.OAuthCredentials} message OAuthCredentials
188
- * @param {$protobuf.IConversionOptions} [options] Conversion options
189
- * @returns {Object.<string,*>} Plain object
190
- */
191
- OAuthCredentials.toObject = function toObject(message, options) {
192
- if (!options)
193
- options = {};
194
- var object = {};
195
- if (options.defaults) {
196
- object.token = "";
197
- object.authServerUrl = "";
198
- }
199
- if (message.token != null && message.hasOwnProperty("token"))
200
- object.token = message.token;
201
- if (message.authServerUrl != null && message.hasOwnProperty("authServerUrl"))
202
- object.authServerUrl = message.authServerUrl;
203
- return object;
204
- };
205
- /**
206
- * Converts this OAuthCredentials to JSON.
207
- * @function toJSON
208
- * @memberof science.OAuthCredentials
209
- * @instance
210
- * @returns {Object.<string,*>} JSON object
211
- */
212
- OAuthCredentials.prototype.toJSON = function toJSON() {
213
- return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
214
- };
215
- /**
216
- * Gets the default type url for OAuthCredentials
217
- * @function getTypeUrl
218
- * @memberof science.OAuthCredentials
219
- * @static
220
- * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
221
- * @returns {string} The default type url
222
- */
223
- OAuthCredentials.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
224
- if (typeUrlPrefix === undefined) {
225
- typeUrlPrefix = "type.googleapis.com";
226
- }
227
- return typeUrlPrefix + "/science.OAuthCredentials";
228
- };
229
- return OAuthCredentials;
230
- })();
231
- science.DeviceAuthenticationRequest = (function () {
232
- /**
233
- * Properties of a DeviceAuthenticationRequest.
234
- * @memberof science
235
- * @interface IDeviceAuthenticationRequest
236
- * @property {string|null} [userEmail] DeviceAuthenticationRequest userEmail
237
- * @property {string|null} [organizationId] DeviceAuthenticationRequest organizationId
238
- * @property {science.IOAuthCredentials|null} [oauth] DeviceAuthenticationRequest oauth
239
- */
240
- /**
241
- * Constructs a new DeviceAuthenticationRequest.
242
- * @memberof science
243
- * @classdesc Represents a DeviceAuthenticationRequest.
244
- * @implements IDeviceAuthenticationRequest
245
- * @constructor
246
- * @param {science.IDeviceAuthenticationRequest=} [properties] Properties to set
247
- */
248
- function DeviceAuthenticationRequest(properties) {
249
- if (properties)
250
- for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
251
- if (properties[keys[i]] != null)
252
- this[keys[i]] = properties[keys[i]];
253
- }
254
- /**
255
- * DeviceAuthenticationRequest userEmail.
256
- * @member {string} userEmail
257
- * @memberof science.DeviceAuthenticationRequest
258
- * @instance
259
- */
260
- DeviceAuthenticationRequest.prototype.userEmail = "";
261
- /**
262
- * DeviceAuthenticationRequest organizationId.
263
- * @member {string} organizationId
264
- * @memberof science.DeviceAuthenticationRequest
265
- * @instance
266
- */
267
- DeviceAuthenticationRequest.prototype.organizationId = "";
268
- /**
269
- * DeviceAuthenticationRequest oauth.
270
- * @member {science.IOAuthCredentials|null|undefined} oauth
271
- * @memberof science.DeviceAuthenticationRequest
272
- * @instance
273
- */
274
- DeviceAuthenticationRequest.prototype.oauth = null;
275
- // OneOf field names bound to virtual getters and setters
276
- var $oneOfFields;
277
- /**
278
- * DeviceAuthenticationRequest authMethod.
279
- * @member {"oauth"|undefined} authMethod
280
- * @memberof science.DeviceAuthenticationRequest
281
- * @instance
282
- */
283
- Object.defineProperty(DeviceAuthenticationRequest.prototype, "authMethod", {
284
- get: $util.oneOfGetter($oneOfFields = ["oauth"]),
285
- set: $util.oneOfSetter($oneOfFields)
286
- });
287
- /**
288
- * Creates a new DeviceAuthenticationRequest instance using the specified properties.
289
- * @function create
290
- * @memberof science.DeviceAuthenticationRequest
291
- * @static
292
- * @param {science.IDeviceAuthenticationRequest=} [properties] Properties to set
293
- * @returns {science.DeviceAuthenticationRequest} DeviceAuthenticationRequest instance
294
- */
295
- DeviceAuthenticationRequest.create = function create(properties) {
296
- return new DeviceAuthenticationRequest(properties);
297
- };
298
- /**
299
- * Encodes the specified DeviceAuthenticationRequest message. Does not implicitly {@link science.DeviceAuthenticationRequest.verify|verify} messages.
300
- * @function encode
301
- * @memberof science.DeviceAuthenticationRequest
302
- * @static
303
- * @param {science.IDeviceAuthenticationRequest} message DeviceAuthenticationRequest message or plain object to encode
304
- * @param {$protobuf.Writer} [writer] Writer to encode to
305
- * @returns {$protobuf.Writer} Writer
306
- */
307
- DeviceAuthenticationRequest.encode = function encode(message, writer) {
308
- if (!writer)
309
- writer = $Writer.create();
310
- if (message.userEmail != null && Object.hasOwnProperty.call(message, "userEmail"))
311
- writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.userEmail);
312
- if (message.organizationId != null && Object.hasOwnProperty.call(message, "organizationId"))
313
- writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.organizationId);
314
- if (message.oauth != null && Object.hasOwnProperty.call(message, "oauth"))
315
- $root.science.OAuthCredentials.encode(message.oauth, writer.uint32(/* id 3, wireType 2 =*/ 26).fork()).ldelim();
316
- return writer;
317
- };
318
- /**
319
- * Encodes the specified DeviceAuthenticationRequest message, length delimited. Does not implicitly {@link science.DeviceAuthenticationRequest.verify|verify} messages.
320
- * @function encodeDelimited
321
- * @memberof science.DeviceAuthenticationRequest
322
- * @static
323
- * @param {science.IDeviceAuthenticationRequest} message DeviceAuthenticationRequest message or plain object to encode
324
- * @param {$protobuf.Writer} [writer] Writer to encode to
325
- * @returns {$protobuf.Writer} Writer
326
- */
327
- DeviceAuthenticationRequest.encodeDelimited = function encodeDelimited(message, writer) {
328
- return this.encode(message, writer).ldelim();
329
- };
330
- /**
331
- * Decodes a DeviceAuthenticationRequest message from the specified reader or buffer.
332
- * @function decode
333
- * @memberof science.DeviceAuthenticationRequest
334
- * @static
335
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
336
- * @param {number} [length] Message length if known beforehand
337
- * @returns {science.DeviceAuthenticationRequest} DeviceAuthenticationRequest
338
- * @throws {Error} If the payload is not a reader or valid buffer
339
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
340
- */
341
- DeviceAuthenticationRequest.decode = function decode(reader, length) {
342
- if (!(reader instanceof $Reader))
343
- reader = $Reader.create(reader);
344
- var end = length === undefined ? reader.len : reader.pos + length, message = new $root.science.DeviceAuthenticationRequest();
345
- while (reader.pos < end) {
346
- var tag = reader.uint32();
347
- switch (tag >>> 3) {
348
- case 1: {
349
- message.userEmail = reader.string();
350
- break;
351
- }
352
- case 2: {
353
- message.organizationId = reader.string();
354
- break;
355
- }
356
- case 3: {
357
- message.oauth = $root.science.OAuthCredentials.decode(reader, reader.uint32());
358
- break;
359
- }
360
- default:
361
- reader.skipType(tag & 7);
362
- break;
363
- }
364
- }
365
- return message;
366
- };
367
- /**
368
- * Decodes a DeviceAuthenticationRequest message from the specified reader or buffer, length delimited.
369
- * @function decodeDelimited
370
- * @memberof science.DeviceAuthenticationRequest
371
- * @static
372
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
373
- * @returns {science.DeviceAuthenticationRequest} DeviceAuthenticationRequest
374
- * @throws {Error} If the payload is not a reader or valid buffer
375
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
376
- */
377
- DeviceAuthenticationRequest.decodeDelimited = function decodeDelimited(reader) {
378
- if (!(reader instanceof $Reader))
379
- reader = new $Reader(reader);
380
- return this.decode(reader, reader.uint32());
381
- };
382
- /**
383
- * Verifies a DeviceAuthenticationRequest message.
384
- * @function verify
385
- * @memberof science.DeviceAuthenticationRequest
386
- * @static
387
- * @param {Object.<string,*>} message Plain object to verify
388
- * @returns {string|null} `null` if valid, otherwise the reason why it is not
389
- */
390
- DeviceAuthenticationRequest.verify = function verify(message) {
391
- if (typeof message !== "object" || message === null)
392
- return "object expected";
393
- var properties = {};
394
- if (message.userEmail != null && message.hasOwnProperty("userEmail"))
395
- if (!$util.isString(message.userEmail))
396
- return "userEmail: string expected";
397
- if (message.organizationId != null && message.hasOwnProperty("organizationId"))
398
- if (!$util.isString(message.organizationId))
399
- return "organizationId: string expected";
400
- if (message.oauth != null && message.hasOwnProperty("oauth")) {
401
- properties.authMethod = 1;
402
- {
403
- var error = $root.science.OAuthCredentials.verify(message.oauth);
404
- if (error)
405
- return "oauth." + error;
406
- }
407
- }
408
- return null;
409
- };
410
- /**
411
- * Creates a DeviceAuthenticationRequest message from a plain object. Also converts values to their respective internal types.
412
- * @function fromObject
413
- * @memberof science.DeviceAuthenticationRequest
414
- * @static
415
- * @param {Object.<string,*>} object Plain object
416
- * @returns {science.DeviceAuthenticationRequest} DeviceAuthenticationRequest
417
- */
418
- DeviceAuthenticationRequest.fromObject = function fromObject(object) {
419
- if (object instanceof $root.science.DeviceAuthenticationRequest)
420
- return object;
421
- var message = new $root.science.DeviceAuthenticationRequest();
422
- if (object.userEmail != null)
423
- message.userEmail = String(object.userEmail);
424
- if (object.organizationId != null)
425
- message.organizationId = String(object.organizationId);
426
- if (object.oauth != null) {
427
- if (typeof object.oauth !== "object")
428
- throw TypeError(".science.DeviceAuthenticationRequest.oauth: object expected");
429
- message.oauth = $root.science.OAuthCredentials.fromObject(object.oauth);
430
- }
431
- return message;
432
- };
433
- /**
434
- * Creates a plain object from a DeviceAuthenticationRequest message. Also converts values to other types if specified.
435
- * @function toObject
436
- * @memberof science.DeviceAuthenticationRequest
437
- * @static
438
- * @param {science.DeviceAuthenticationRequest} message DeviceAuthenticationRequest
439
- * @param {$protobuf.IConversionOptions} [options] Conversion options
440
- * @returns {Object.<string,*>} Plain object
441
- */
442
- DeviceAuthenticationRequest.toObject = function toObject(message, options) {
443
- if (!options)
444
- options = {};
445
- var object = {};
446
- if (options.defaults) {
447
- object.userEmail = "";
448
- object.organizationId = "";
449
- }
450
- if (message.userEmail != null && message.hasOwnProperty("userEmail"))
451
- object.userEmail = message.userEmail;
452
- if (message.organizationId != null && message.hasOwnProperty("organizationId"))
453
- object.organizationId = message.organizationId;
454
- if (message.oauth != null && message.hasOwnProperty("oauth")) {
455
- object.oauth = $root.science.OAuthCredentials.toObject(message.oauth, options);
456
- if (options.oneofs)
457
- object.authMethod = "oauth";
458
- }
459
- return object;
460
- };
461
- /**
462
- * Converts this DeviceAuthenticationRequest to JSON.
463
- * @function toJSON
464
- * @memberof science.DeviceAuthenticationRequest
465
- * @instance
466
- * @returns {Object.<string,*>} JSON object
467
- */
468
- DeviceAuthenticationRequest.prototype.toJSON = function toJSON() {
469
- return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
470
- };
471
- /**
472
- * Gets the default type url for DeviceAuthenticationRequest
473
- * @function getTypeUrl
474
- * @memberof science.DeviceAuthenticationRequest
475
- * @static
476
- * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
477
- * @returns {string} The default type url
478
- */
479
- DeviceAuthenticationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
480
- if (typeUrlPrefix === undefined) {
481
- typeUrlPrefix = "type.googleapis.com";
482
- }
483
- return typeUrlPrefix + "/science.DeviceAuthenticationRequest";
484
- };
485
- return DeviceAuthenticationRequest;
486
- })();
487
- science.UserKey = (function () {
488
- /**
489
- * Properties of a UserKey.
490
- * @memberof science
491
- * @interface IUserKey
492
- * @property {string|null} [keyId] UserKey keyId
493
- * @property {string|null} [publicKey] UserKey publicKey
494
- * @property {string|null} [privateKey] UserKey privateKey
495
- * @property {Long|null} [creationTimeNs] UserKey creationTimeNs
496
- * @property {string|null} [userEmail] UserKey userEmail
497
- * @property {string|null} [deviceSerial] UserKey deviceSerial
498
- * @property {string|null} [organizationId] UserKey organizationId
499
- * @property {string|null} [authMethod] UserKey authMethod
500
- */
501
- /**
502
- * Constructs a new UserKey.
503
- * @memberof science
504
- * @classdesc Represents a UserKey.
505
- * @implements IUserKey
506
- * @constructor
507
- * @param {science.IUserKey=} [properties] Properties to set
508
- */
509
- function UserKey(properties) {
510
- if (properties)
511
- for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
512
- if (properties[keys[i]] != null)
513
- this[keys[i]] = properties[keys[i]];
514
- }
515
- /**
516
- * UserKey keyId.
517
- * @member {string} keyId
518
- * @memberof science.UserKey
519
- * @instance
520
- */
521
- UserKey.prototype.keyId = "";
522
- /**
523
- * UserKey publicKey.
524
- * @member {string} publicKey
525
- * @memberof science.UserKey
526
- * @instance
527
- */
528
- UserKey.prototype.publicKey = "";
529
- /**
530
- * UserKey privateKey.
531
- * @member {string} privateKey
532
- * @memberof science.UserKey
533
- * @instance
534
- */
535
- UserKey.prototype.privateKey = "";
536
- /**
537
- * UserKey creationTimeNs.
538
- * @member {Long} creationTimeNs
539
- * @memberof science.UserKey
540
- * @instance
541
- */
542
- UserKey.prototype.creationTimeNs = $util.Long ? $util.Long.fromBits(0, 0, true) : 0;
543
- /**
544
- * UserKey userEmail.
545
- * @member {string} userEmail
546
- * @memberof science.UserKey
547
- * @instance
548
- */
549
- UserKey.prototype.userEmail = "";
550
- /**
551
- * UserKey deviceSerial.
552
- * @member {string} deviceSerial
553
- * @memberof science.UserKey
554
- * @instance
555
- */
556
- UserKey.prototype.deviceSerial = "";
557
- /**
558
- * UserKey organizationId.
559
- * @member {string} organizationId
560
- * @memberof science.UserKey
561
- * @instance
562
- */
563
- UserKey.prototype.organizationId = "";
564
- /**
565
- * UserKey authMethod.
566
- * @member {string} authMethod
567
- * @memberof science.UserKey
568
- * @instance
569
- */
570
- UserKey.prototype.authMethod = "";
571
- /**
572
- * Creates a new UserKey instance using the specified properties.
573
- * @function create
574
- * @memberof science.UserKey
575
- * @static
576
- * @param {science.IUserKey=} [properties] Properties to set
577
- * @returns {science.UserKey} UserKey instance
578
- */
579
- UserKey.create = function create(properties) {
580
- return new UserKey(properties);
581
- };
582
- /**
583
- * Encodes the specified UserKey message. Does not implicitly {@link science.UserKey.verify|verify} messages.
584
- * @function encode
585
- * @memberof science.UserKey
586
- * @static
587
- * @param {science.IUserKey} message UserKey message or plain object to encode
588
- * @param {$protobuf.Writer} [writer] Writer to encode to
589
- * @returns {$protobuf.Writer} Writer
590
- */
591
- UserKey.encode = function encode(message, writer) {
592
- if (!writer)
593
- writer = $Writer.create();
594
- if (message.keyId != null && Object.hasOwnProperty.call(message, "keyId"))
595
- writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.keyId);
596
- if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey"))
597
- writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.publicKey);
598
- if (message.privateKey != null && Object.hasOwnProperty.call(message, "privateKey"))
599
- writer.uint32(/* id 3, wireType 2 =*/ 26).string(message.privateKey);
600
- if (message.creationTimeNs != null && Object.hasOwnProperty.call(message, "creationTimeNs"))
601
- writer.uint32(/* id 4, wireType 0 =*/ 32).uint64(message.creationTimeNs);
602
- if (message.userEmail != null && Object.hasOwnProperty.call(message, "userEmail"))
603
- writer.uint32(/* id 5, wireType 2 =*/ 42).string(message.userEmail);
604
- if (message.deviceSerial != null && Object.hasOwnProperty.call(message, "deviceSerial"))
605
- writer.uint32(/* id 6, wireType 2 =*/ 50).string(message.deviceSerial);
606
- if (message.organizationId != null && Object.hasOwnProperty.call(message, "organizationId"))
607
- writer.uint32(/* id 7, wireType 2 =*/ 58).string(message.organizationId);
608
- if (message.authMethod != null && Object.hasOwnProperty.call(message, "authMethod"))
609
- writer.uint32(/* id 8, wireType 2 =*/ 66).string(message.authMethod);
610
- return writer;
611
- };
612
- /**
613
- * Encodes the specified UserKey message, length delimited. Does not implicitly {@link science.UserKey.verify|verify} messages.
614
- * @function encodeDelimited
615
- * @memberof science.UserKey
616
- * @static
617
- * @param {science.IUserKey} message UserKey message or plain object to encode
618
- * @param {$protobuf.Writer} [writer] Writer to encode to
619
- * @returns {$protobuf.Writer} Writer
620
- */
621
- UserKey.encodeDelimited = function encodeDelimited(message, writer) {
622
- return this.encode(message, writer).ldelim();
623
- };
624
- /**
625
- * Decodes a UserKey message from the specified reader or buffer.
626
- * @function decode
627
- * @memberof science.UserKey
628
- * @static
629
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
630
- * @param {number} [length] Message length if known beforehand
631
- * @returns {science.UserKey} UserKey
632
- * @throws {Error} If the payload is not a reader or valid buffer
633
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
634
- */
635
- UserKey.decode = function decode(reader, length) {
636
- if (!(reader instanceof $Reader))
637
- reader = $Reader.create(reader);
638
- var end = length === undefined ? reader.len : reader.pos + length, message = new $root.science.UserKey();
639
- while (reader.pos < end) {
640
- var tag = reader.uint32();
641
- switch (tag >>> 3) {
642
- case 1: {
643
- message.keyId = reader.string();
644
- break;
645
- }
646
- case 2: {
647
- message.publicKey = reader.string();
648
- break;
649
- }
650
- case 3: {
651
- message.privateKey = reader.string();
652
- break;
653
- }
654
- case 4: {
655
- message.creationTimeNs = reader.uint64();
656
- break;
657
- }
658
- case 5: {
659
- message.userEmail = reader.string();
660
- break;
661
- }
662
- case 6: {
663
- message.deviceSerial = reader.string();
664
- break;
665
- }
666
- case 7: {
667
- message.organizationId = reader.string();
668
- break;
669
- }
670
- case 8: {
671
- message.authMethod = reader.string();
672
- break;
673
- }
674
- default:
675
- reader.skipType(tag & 7);
676
- break;
677
- }
678
- }
679
- return message;
680
- };
681
- /**
682
- * Decodes a UserKey message from the specified reader or buffer, length delimited.
683
- * @function decodeDelimited
684
- * @memberof science.UserKey
685
- * @static
686
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
687
- * @returns {science.UserKey} UserKey
688
- * @throws {Error} If the payload is not a reader or valid buffer
689
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
690
- */
691
- UserKey.decodeDelimited = function decodeDelimited(reader) {
692
- if (!(reader instanceof $Reader))
693
- reader = new $Reader(reader);
694
- return this.decode(reader, reader.uint32());
695
- };
696
- /**
697
- * Verifies a UserKey message.
698
- * @function verify
699
- * @memberof science.UserKey
700
- * @static
701
- * @param {Object.<string,*>} message Plain object to verify
702
- * @returns {string|null} `null` if valid, otherwise the reason why it is not
703
- */
704
- UserKey.verify = function verify(message) {
705
- if (typeof message !== "object" || message === null)
706
- return "object expected";
707
- if (message.keyId != null && message.hasOwnProperty("keyId"))
708
- if (!$util.isString(message.keyId))
709
- return "keyId: string expected";
710
- if (message.publicKey != null && message.hasOwnProperty("publicKey"))
711
- if (!$util.isString(message.publicKey))
712
- return "publicKey: string expected";
713
- if (message.privateKey != null && message.hasOwnProperty("privateKey"))
714
- if (!$util.isString(message.privateKey))
715
- return "privateKey: string expected";
716
- if (message.creationTimeNs != null && message.hasOwnProperty("creationTimeNs"))
717
- if (!$util.isInteger(message.creationTimeNs) && !(message.creationTimeNs && $util.isInteger(message.creationTimeNs.low) && $util.isInteger(message.creationTimeNs.high)))
718
- return "creationTimeNs: integer|Long expected";
719
- if (message.userEmail != null && message.hasOwnProperty("userEmail"))
720
- if (!$util.isString(message.userEmail))
721
- return "userEmail: string expected";
722
- if (message.deviceSerial != null && message.hasOwnProperty("deviceSerial"))
723
- if (!$util.isString(message.deviceSerial))
724
- return "deviceSerial: string expected";
725
- if (message.organizationId != null && message.hasOwnProperty("organizationId"))
726
- if (!$util.isString(message.organizationId))
727
- return "organizationId: string expected";
728
- if (message.authMethod != null && message.hasOwnProperty("authMethod"))
729
- if (!$util.isString(message.authMethod))
730
- return "authMethod: string expected";
731
- return null;
732
- };
733
- /**
734
- * Creates a UserKey message from a plain object. Also converts values to their respective internal types.
735
- * @function fromObject
736
- * @memberof science.UserKey
737
- * @static
738
- * @param {Object.<string,*>} object Plain object
739
- * @returns {science.UserKey} UserKey
740
- */
741
- UserKey.fromObject = function fromObject(object) {
742
- if (object instanceof $root.science.UserKey)
743
- return object;
744
- var message = new $root.science.UserKey();
745
- if (object.keyId != null)
746
- message.keyId = String(object.keyId);
747
- if (object.publicKey != null)
748
- message.publicKey = String(object.publicKey);
749
- if (object.privateKey != null)
750
- message.privateKey = String(object.privateKey);
751
- if (object.creationTimeNs != null)
752
- if ($util.Long)
753
- (message.creationTimeNs = $util.Long.fromValue(object.creationTimeNs)).unsigned = true;
754
- else if (typeof object.creationTimeNs === "string")
755
- message.creationTimeNs = parseInt(object.creationTimeNs, 10);
756
- else if (typeof object.creationTimeNs === "number")
757
- message.creationTimeNs = object.creationTimeNs;
758
- else if (typeof object.creationTimeNs === "object")
759
- message.creationTimeNs = new $util.LongBits(object.creationTimeNs.low >>> 0, object.creationTimeNs.high >>> 0).toNumber(true);
760
- if (object.userEmail != null)
761
- message.userEmail = String(object.userEmail);
762
- if (object.deviceSerial != null)
763
- message.deviceSerial = String(object.deviceSerial);
764
- if (object.organizationId != null)
765
- message.organizationId = String(object.organizationId);
766
- if (object.authMethod != null)
767
- message.authMethod = String(object.authMethod);
768
- return message;
769
- };
770
- /**
771
- * Creates a plain object from a UserKey message. Also converts values to other types if specified.
772
- * @function toObject
773
- * @memberof science.UserKey
774
- * @static
775
- * @param {science.UserKey} message UserKey
776
- * @param {$protobuf.IConversionOptions} [options] Conversion options
777
- * @returns {Object.<string,*>} Plain object
778
- */
779
- UserKey.toObject = function toObject(message, options) {
780
- if (!options)
781
- options = {};
782
- var object = {};
783
- if (options.defaults) {
784
- object.keyId = "";
785
- object.publicKey = "";
786
- object.privateKey = "";
787
- if ($util.Long) {
788
- var long = new $util.Long(0, 0, true);
789
- object.creationTimeNs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
790
- }
791
- else
792
- object.creationTimeNs = options.longs === String ? "0" : 0;
793
- object.userEmail = "";
794
- object.deviceSerial = "";
795
- object.organizationId = "";
796
- object.authMethod = "";
797
- }
798
- if (message.keyId != null && message.hasOwnProperty("keyId"))
799
- object.keyId = message.keyId;
800
- if (message.publicKey != null && message.hasOwnProperty("publicKey"))
801
- object.publicKey = message.publicKey;
802
- if (message.privateKey != null && message.hasOwnProperty("privateKey"))
803
- object.privateKey = message.privateKey;
804
- if (message.creationTimeNs != null && message.hasOwnProperty("creationTimeNs"))
805
- if (typeof message.creationTimeNs === "number")
806
- object.creationTimeNs = options.longs === String ? String(message.creationTimeNs) : message.creationTimeNs;
807
- else
808
- object.creationTimeNs = options.longs === String ? $util.Long.prototype.toString.call(message.creationTimeNs) : options.longs === Number ? new $util.LongBits(message.creationTimeNs.low >>> 0, message.creationTimeNs.high >>> 0).toNumber(true) : message.creationTimeNs;
809
- if (message.userEmail != null && message.hasOwnProperty("userEmail"))
810
- object.userEmail = message.userEmail;
811
- if (message.deviceSerial != null && message.hasOwnProperty("deviceSerial"))
812
- object.deviceSerial = message.deviceSerial;
813
- if (message.organizationId != null && message.hasOwnProperty("organizationId"))
814
- object.organizationId = message.organizationId;
815
- if (message.authMethod != null && message.hasOwnProperty("authMethod"))
816
- object.authMethod = message.authMethod;
817
- return object;
818
- };
819
- /**
820
- * Converts this UserKey to JSON.
821
- * @function toJSON
822
- * @memberof science.UserKey
823
- * @instance
824
- * @returns {Object.<string,*>} JSON object
825
- */
826
- UserKey.prototype.toJSON = function toJSON() {
827
- return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
828
- };
829
- /**
830
- * Gets the default type url for UserKey
831
- * @function getTypeUrl
832
- * @memberof science.UserKey
833
- * @static
834
- * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
835
- * @returns {string} The default type url
836
- */
837
- UserKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
838
- if (typeUrlPrefix === undefined) {
839
- typeUrlPrefix = "type.googleapis.com";
840
- }
841
- return typeUrlPrefix + "/science.UserKey";
842
- };
843
- return UserKey;
844
- })();
845
- science.DeviceAuthenticationResponse = (function () {
846
- /**
847
- * Properties of a DeviceAuthenticationResponse.
848
- * @memberof science
849
- * @interface IDeviceAuthenticationResponse
850
- * @property {science.IUserKey|null} [key] DeviceAuthenticationResponse key
851
- */
852
- /**
853
- * Constructs a new DeviceAuthenticationResponse.
854
- * @memberof science
855
- * @classdesc Represents a DeviceAuthenticationResponse.
856
- * @implements IDeviceAuthenticationResponse
857
- * @constructor
858
- * @param {science.IDeviceAuthenticationResponse=} [properties] Properties to set
859
- */
860
- function DeviceAuthenticationResponse(properties) {
861
- if (properties)
862
- for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
863
- if (properties[keys[i]] != null)
864
- this[keys[i]] = properties[keys[i]];
865
- }
866
- /**
867
- * DeviceAuthenticationResponse key.
868
- * @member {science.IUserKey|null|undefined} key
869
- * @memberof science.DeviceAuthenticationResponse
870
- * @instance
871
- */
872
- DeviceAuthenticationResponse.prototype.key = null;
873
- /**
874
- * Creates a new DeviceAuthenticationResponse instance using the specified properties.
875
- * @function create
876
- * @memberof science.DeviceAuthenticationResponse
877
- * @static
878
- * @param {science.IDeviceAuthenticationResponse=} [properties] Properties to set
879
- * @returns {science.DeviceAuthenticationResponse} DeviceAuthenticationResponse instance
880
- */
881
- DeviceAuthenticationResponse.create = function create(properties) {
882
- return new DeviceAuthenticationResponse(properties);
883
- };
884
- /**
885
- * Encodes the specified DeviceAuthenticationResponse message. Does not implicitly {@link science.DeviceAuthenticationResponse.verify|verify} messages.
886
- * @function encode
887
- * @memberof science.DeviceAuthenticationResponse
888
- * @static
889
- * @param {science.IDeviceAuthenticationResponse} message DeviceAuthenticationResponse message or plain object to encode
890
- * @param {$protobuf.Writer} [writer] Writer to encode to
891
- * @returns {$protobuf.Writer} Writer
892
- */
893
- DeviceAuthenticationResponse.encode = function encode(message, writer) {
894
- if (!writer)
895
- writer = $Writer.create();
896
- if (message.key != null && Object.hasOwnProperty.call(message, "key"))
897
- $root.science.UserKey.encode(message.key, writer.uint32(/* id 1, wireType 2 =*/ 10).fork()).ldelim();
898
- return writer;
899
- };
900
- /**
901
- * Encodes the specified DeviceAuthenticationResponse message, length delimited. Does not implicitly {@link science.DeviceAuthenticationResponse.verify|verify} messages.
902
- * @function encodeDelimited
903
- * @memberof science.DeviceAuthenticationResponse
904
- * @static
905
- * @param {science.IDeviceAuthenticationResponse} message DeviceAuthenticationResponse message or plain object to encode
906
- * @param {$protobuf.Writer} [writer] Writer to encode to
907
- * @returns {$protobuf.Writer} Writer
908
- */
909
- DeviceAuthenticationResponse.encodeDelimited = function encodeDelimited(message, writer) {
910
- return this.encode(message, writer).ldelim();
911
- };
912
- /**
913
- * Decodes a DeviceAuthenticationResponse message from the specified reader or buffer.
914
- * @function decode
915
- * @memberof science.DeviceAuthenticationResponse
916
- * @static
917
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
918
- * @param {number} [length] Message length if known beforehand
919
- * @returns {science.DeviceAuthenticationResponse} DeviceAuthenticationResponse
920
- * @throws {Error} If the payload is not a reader or valid buffer
921
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
922
- */
923
- DeviceAuthenticationResponse.decode = function decode(reader, length) {
924
- if (!(reader instanceof $Reader))
925
- reader = $Reader.create(reader);
926
- var end = length === undefined ? reader.len : reader.pos + length, message = new $root.science.DeviceAuthenticationResponse();
927
- while (reader.pos < end) {
928
- var tag = reader.uint32();
929
- switch (tag >>> 3) {
930
- case 1: {
931
- message.key = $root.science.UserKey.decode(reader, reader.uint32());
932
- break;
933
- }
934
- default:
935
- reader.skipType(tag & 7);
936
- break;
937
- }
938
- }
939
- return message;
940
- };
941
- /**
942
- * Decodes a DeviceAuthenticationResponse message from the specified reader or buffer, length delimited.
943
- * @function decodeDelimited
944
- * @memberof science.DeviceAuthenticationResponse
945
- * @static
946
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
947
- * @returns {science.DeviceAuthenticationResponse} DeviceAuthenticationResponse
948
- * @throws {Error} If the payload is not a reader or valid buffer
949
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
950
- */
951
- DeviceAuthenticationResponse.decodeDelimited = function decodeDelimited(reader) {
952
- if (!(reader instanceof $Reader))
953
- reader = new $Reader(reader);
954
- return this.decode(reader, reader.uint32());
955
- };
956
- /**
957
- * Verifies a DeviceAuthenticationResponse message.
958
- * @function verify
959
- * @memberof science.DeviceAuthenticationResponse
960
- * @static
961
- * @param {Object.<string,*>} message Plain object to verify
962
- * @returns {string|null} `null` if valid, otherwise the reason why it is not
963
- */
964
- DeviceAuthenticationResponse.verify = function verify(message) {
965
- if (typeof message !== "object" || message === null)
966
- return "object expected";
967
- if (message.key != null && message.hasOwnProperty("key")) {
968
- var error = $root.science.UserKey.verify(message.key);
969
- if (error)
970
- return "key." + error;
971
- }
972
- return null;
973
- };
974
- /**
975
- * Creates a DeviceAuthenticationResponse message from a plain object. Also converts values to their respective internal types.
976
- * @function fromObject
977
- * @memberof science.DeviceAuthenticationResponse
978
- * @static
979
- * @param {Object.<string,*>} object Plain object
980
- * @returns {science.DeviceAuthenticationResponse} DeviceAuthenticationResponse
981
- */
982
- DeviceAuthenticationResponse.fromObject = function fromObject(object) {
983
- if (object instanceof $root.science.DeviceAuthenticationResponse)
984
- return object;
985
- var message = new $root.science.DeviceAuthenticationResponse();
986
- if (object.key != null) {
987
- if (typeof object.key !== "object")
988
- throw TypeError(".science.DeviceAuthenticationResponse.key: object expected");
989
- message.key = $root.science.UserKey.fromObject(object.key);
990
- }
991
- return message;
992
- };
993
- /**
994
- * Creates a plain object from a DeviceAuthenticationResponse message. Also converts values to other types if specified.
995
- * @function toObject
996
- * @memberof science.DeviceAuthenticationResponse
997
- * @static
998
- * @param {science.DeviceAuthenticationResponse} message DeviceAuthenticationResponse
999
- * @param {$protobuf.IConversionOptions} [options] Conversion options
1000
- * @returns {Object.<string,*>} Plain object
1001
- */
1002
- DeviceAuthenticationResponse.toObject = function toObject(message, options) {
1003
- if (!options)
1004
- options = {};
1005
- var object = {};
1006
- if (options.defaults)
1007
- object.key = null;
1008
- if (message.key != null && message.hasOwnProperty("key"))
1009
- object.key = $root.science.UserKey.toObject(message.key, options);
1010
- return object;
1011
- };
1012
- /**
1013
- * Converts this DeviceAuthenticationResponse to JSON.
1014
- * @function toJSON
1015
- * @memberof science.DeviceAuthenticationResponse
1016
- * @instance
1017
- * @returns {Object.<string,*>} JSON object
1018
- */
1019
- DeviceAuthenticationResponse.prototype.toJSON = function toJSON() {
1020
- return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1021
- };
1022
- /**
1023
- * Gets the default type url for DeviceAuthenticationResponse
1024
- * @function getTypeUrl
1025
- * @memberof science.DeviceAuthenticationResponse
1026
- * @static
1027
- * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
1028
- * @returns {string} The default type url
1029
- */
1030
- DeviceAuthenticationResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
1031
- if (typeUrlPrefix === undefined) {
1032
- typeUrlPrefix = "type.googleapis.com";
1033
- }
1034
- return typeUrlPrefix + "/science.DeviceAuthenticationResponse";
1035
- };
1036
- return DeviceAuthenticationResponse;
1037
- })();
1038
- science.RevokeKeyRequest = (function () {
1039
- /**
1040
- * Properties of a RevokeKeyRequest.
1041
- * @memberof science
1042
- * @interface IRevokeKeyRequest
1043
- * @property {string|null} [keyId] RevokeKeyRequest keyId
1044
- */
1045
- /**
1046
- * Constructs a new RevokeKeyRequest.
1047
- * @memberof science
1048
- * @classdesc Represents a RevokeKeyRequest.
1049
- * @implements IRevokeKeyRequest
1050
- * @constructor
1051
- * @param {science.IRevokeKeyRequest=} [properties] Properties to set
1052
- */
1053
- function RevokeKeyRequest(properties) {
1054
- if (properties)
1055
- for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1056
- if (properties[keys[i]] != null)
1057
- this[keys[i]] = properties[keys[i]];
1058
- }
1059
- /**
1060
- * RevokeKeyRequest keyId.
1061
- * @member {string} keyId
1062
- * @memberof science.RevokeKeyRequest
1063
- * @instance
1064
- */
1065
- RevokeKeyRequest.prototype.keyId = "";
1066
- /**
1067
- * Creates a new RevokeKeyRequest instance using the specified properties.
1068
- * @function create
1069
- * @memberof science.RevokeKeyRequest
1070
- * @static
1071
- * @param {science.IRevokeKeyRequest=} [properties] Properties to set
1072
- * @returns {science.RevokeKeyRequest} RevokeKeyRequest instance
1073
- */
1074
- RevokeKeyRequest.create = function create(properties) {
1075
- return new RevokeKeyRequest(properties);
1076
- };
1077
- /**
1078
- * Encodes the specified RevokeKeyRequest message. Does not implicitly {@link science.RevokeKeyRequest.verify|verify} messages.
1079
- * @function encode
1080
- * @memberof science.RevokeKeyRequest
1081
- * @static
1082
- * @param {science.IRevokeKeyRequest} message RevokeKeyRequest message or plain object to encode
1083
- * @param {$protobuf.Writer} [writer] Writer to encode to
1084
- * @returns {$protobuf.Writer} Writer
1085
- */
1086
- RevokeKeyRequest.encode = function encode(message, writer) {
1087
- if (!writer)
1088
- writer = $Writer.create();
1089
- if (message.keyId != null && Object.hasOwnProperty.call(message, "keyId"))
1090
- writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.keyId);
1091
- return writer;
1092
- };
1093
- /**
1094
- * Encodes the specified RevokeKeyRequest message, length delimited. Does not implicitly {@link science.RevokeKeyRequest.verify|verify} messages.
1095
- * @function encodeDelimited
1096
- * @memberof science.RevokeKeyRequest
1097
- * @static
1098
- * @param {science.IRevokeKeyRequest} message RevokeKeyRequest message or plain object to encode
1099
- * @param {$protobuf.Writer} [writer] Writer to encode to
1100
- * @returns {$protobuf.Writer} Writer
1101
- */
1102
- RevokeKeyRequest.encodeDelimited = function encodeDelimited(message, writer) {
1103
- return this.encode(message, writer).ldelim();
1104
- };
1105
- /**
1106
- * Decodes a RevokeKeyRequest message from the specified reader or buffer.
1107
- * @function decode
1108
- * @memberof science.RevokeKeyRequest
1109
- * @static
1110
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1111
- * @param {number} [length] Message length if known beforehand
1112
- * @returns {science.RevokeKeyRequest} RevokeKeyRequest
1113
- * @throws {Error} If the payload is not a reader or valid buffer
1114
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
1115
- */
1116
- RevokeKeyRequest.decode = function decode(reader, length) {
1117
- if (!(reader instanceof $Reader))
1118
- reader = $Reader.create(reader);
1119
- var end = length === undefined ? reader.len : reader.pos + length, message = new $root.science.RevokeKeyRequest();
1120
- while (reader.pos < end) {
1121
- var tag = reader.uint32();
1122
- switch (tag >>> 3) {
1123
- case 1: {
1124
- message.keyId = reader.string();
1125
- break;
1126
- }
1127
- default:
1128
- reader.skipType(tag & 7);
1129
- break;
1130
- }
1131
- }
1132
- return message;
1133
- };
1134
- /**
1135
- * Decodes a RevokeKeyRequest message from the specified reader or buffer, length delimited.
1136
- * @function decodeDelimited
1137
- * @memberof science.RevokeKeyRequest
1138
- * @static
1139
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1140
- * @returns {science.RevokeKeyRequest} RevokeKeyRequest
1141
- * @throws {Error} If the payload is not a reader or valid buffer
1142
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
1143
- */
1144
- RevokeKeyRequest.decodeDelimited = function decodeDelimited(reader) {
1145
- if (!(reader instanceof $Reader))
1146
- reader = new $Reader(reader);
1147
- return this.decode(reader, reader.uint32());
1148
- };
1149
- /**
1150
- * Verifies a RevokeKeyRequest message.
1151
- * @function verify
1152
- * @memberof science.RevokeKeyRequest
1153
- * @static
1154
- * @param {Object.<string,*>} message Plain object to verify
1155
- * @returns {string|null} `null` if valid, otherwise the reason why it is not
1156
- */
1157
- RevokeKeyRequest.verify = function verify(message) {
1158
- if (typeof message !== "object" || message === null)
1159
- return "object expected";
1160
- if (message.keyId != null && message.hasOwnProperty("keyId"))
1161
- if (!$util.isString(message.keyId))
1162
- return "keyId: string expected";
1163
- return null;
1164
- };
1165
- /**
1166
- * Creates a RevokeKeyRequest message from a plain object. Also converts values to their respective internal types.
1167
- * @function fromObject
1168
- * @memberof science.RevokeKeyRequest
1169
- * @static
1170
- * @param {Object.<string,*>} object Plain object
1171
- * @returns {science.RevokeKeyRequest} RevokeKeyRequest
1172
- */
1173
- RevokeKeyRequest.fromObject = function fromObject(object) {
1174
- if (object instanceof $root.science.RevokeKeyRequest)
1175
- return object;
1176
- var message = new $root.science.RevokeKeyRequest();
1177
- if (object.keyId != null)
1178
- message.keyId = String(object.keyId);
1179
- return message;
1180
- };
1181
- /**
1182
- * Creates a plain object from a RevokeKeyRequest message. Also converts values to other types if specified.
1183
- * @function toObject
1184
- * @memberof science.RevokeKeyRequest
1185
- * @static
1186
- * @param {science.RevokeKeyRequest} message RevokeKeyRequest
1187
- * @param {$protobuf.IConversionOptions} [options] Conversion options
1188
- * @returns {Object.<string,*>} Plain object
1189
- */
1190
- RevokeKeyRequest.toObject = function toObject(message, options) {
1191
- if (!options)
1192
- options = {};
1193
- var object = {};
1194
- if (options.defaults)
1195
- object.keyId = "";
1196
- if (message.keyId != null && message.hasOwnProperty("keyId"))
1197
- object.keyId = message.keyId;
1198
- return object;
1199
- };
1200
- /**
1201
- * Converts this RevokeKeyRequest to JSON.
1202
- * @function toJSON
1203
- * @memberof science.RevokeKeyRequest
1204
- * @instance
1205
- * @returns {Object.<string,*>} JSON object
1206
- */
1207
- RevokeKeyRequest.prototype.toJSON = function toJSON() {
1208
- return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1209
- };
1210
- /**
1211
- * Gets the default type url for RevokeKeyRequest
1212
- * @function getTypeUrl
1213
- * @memberof science.RevokeKeyRequest
1214
- * @static
1215
- * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
1216
- * @returns {string} The default type url
1217
- */
1218
- RevokeKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
1219
- if (typeUrlPrefix === undefined) {
1220
- typeUrlPrefix = "type.googleapis.com";
1221
- }
1222
- return typeUrlPrefix + "/science.RevokeKeyRequest";
1223
- };
1224
- return RevokeKeyRequest;
1225
- })();
1226
- science.RevokeKeyResponse = (function () {
1227
- /**
1228
- * Properties of a RevokeKeyResponse.
1229
- * @memberof science
1230
- * @interface IRevokeKeyResponse
1231
- * @property {string|null} [keyId] RevokeKeyResponse keyId
1232
- */
1233
- /**
1234
- * Constructs a new RevokeKeyResponse.
1235
- * @memberof science
1236
- * @classdesc Represents a RevokeKeyResponse.
1237
- * @implements IRevokeKeyResponse
1238
- * @constructor
1239
- * @param {science.IRevokeKeyResponse=} [properties] Properties to set
1240
- */
1241
- function RevokeKeyResponse(properties) {
1242
- if (properties)
1243
- for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1244
- if (properties[keys[i]] != null)
1245
- this[keys[i]] = properties[keys[i]];
1246
- }
1247
- /**
1248
- * RevokeKeyResponse keyId.
1249
- * @member {string} keyId
1250
- * @memberof science.RevokeKeyResponse
1251
- * @instance
1252
- */
1253
- RevokeKeyResponse.prototype.keyId = "";
1254
- /**
1255
- * Creates a new RevokeKeyResponse instance using the specified properties.
1256
- * @function create
1257
- * @memberof science.RevokeKeyResponse
1258
- * @static
1259
- * @param {science.IRevokeKeyResponse=} [properties] Properties to set
1260
- * @returns {science.RevokeKeyResponse} RevokeKeyResponse instance
1261
- */
1262
- RevokeKeyResponse.create = function create(properties) {
1263
- return new RevokeKeyResponse(properties);
1264
- };
1265
- /**
1266
- * Encodes the specified RevokeKeyResponse message. Does not implicitly {@link science.RevokeKeyResponse.verify|verify} messages.
1267
- * @function encode
1268
- * @memberof science.RevokeKeyResponse
1269
- * @static
1270
- * @param {science.IRevokeKeyResponse} message RevokeKeyResponse message or plain object to encode
1271
- * @param {$protobuf.Writer} [writer] Writer to encode to
1272
- * @returns {$protobuf.Writer} Writer
1273
- */
1274
- RevokeKeyResponse.encode = function encode(message, writer) {
1275
- if (!writer)
1276
- writer = $Writer.create();
1277
- if (message.keyId != null && Object.hasOwnProperty.call(message, "keyId"))
1278
- writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.keyId);
1279
- return writer;
1280
- };
1281
- /**
1282
- * Encodes the specified RevokeKeyResponse message, length delimited. Does not implicitly {@link science.RevokeKeyResponse.verify|verify} messages.
1283
- * @function encodeDelimited
1284
- * @memberof science.RevokeKeyResponse
1285
- * @static
1286
- * @param {science.IRevokeKeyResponse} message RevokeKeyResponse message or plain object to encode
1287
- * @param {$protobuf.Writer} [writer] Writer to encode to
1288
- * @returns {$protobuf.Writer} Writer
1289
- */
1290
- RevokeKeyResponse.encodeDelimited = function encodeDelimited(message, writer) {
1291
- return this.encode(message, writer).ldelim();
1292
- };
1293
- /**
1294
- * Decodes a RevokeKeyResponse message from the specified reader or buffer.
1295
- * @function decode
1296
- * @memberof science.RevokeKeyResponse
1297
- * @static
1298
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1299
- * @param {number} [length] Message length if known beforehand
1300
- * @returns {science.RevokeKeyResponse} RevokeKeyResponse
1301
- * @throws {Error} If the payload is not a reader or valid buffer
1302
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
1303
- */
1304
- RevokeKeyResponse.decode = function decode(reader, length) {
1305
- if (!(reader instanceof $Reader))
1306
- reader = $Reader.create(reader);
1307
- var end = length === undefined ? reader.len : reader.pos + length, message = new $root.science.RevokeKeyResponse();
1308
- while (reader.pos < end) {
1309
- var tag = reader.uint32();
1310
- switch (tag >>> 3) {
1311
- case 1: {
1312
- message.keyId = reader.string();
1313
- break;
1314
- }
1315
- default:
1316
- reader.skipType(tag & 7);
1317
- break;
1318
- }
1319
- }
1320
- return message;
1321
- };
1322
- /**
1323
- * Decodes a RevokeKeyResponse message from the specified reader or buffer, length delimited.
1324
- * @function decodeDelimited
1325
- * @memberof science.RevokeKeyResponse
1326
- * @static
1327
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1328
- * @returns {science.RevokeKeyResponse} RevokeKeyResponse
1329
- * @throws {Error} If the payload is not a reader or valid buffer
1330
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
1331
- */
1332
- RevokeKeyResponse.decodeDelimited = function decodeDelimited(reader) {
1333
- if (!(reader instanceof $Reader))
1334
- reader = new $Reader(reader);
1335
- return this.decode(reader, reader.uint32());
1336
- };
1337
- /**
1338
- * Verifies a RevokeKeyResponse message.
1339
- * @function verify
1340
- * @memberof science.RevokeKeyResponse
1341
- * @static
1342
- * @param {Object.<string,*>} message Plain object to verify
1343
- * @returns {string|null} `null` if valid, otherwise the reason why it is not
1344
- */
1345
- RevokeKeyResponse.verify = function verify(message) {
1346
- if (typeof message !== "object" || message === null)
1347
- return "object expected";
1348
- if (message.keyId != null && message.hasOwnProperty("keyId"))
1349
- if (!$util.isString(message.keyId))
1350
- return "keyId: string expected";
1351
- return null;
1352
- };
1353
- /**
1354
- * Creates a RevokeKeyResponse message from a plain object. Also converts values to their respective internal types.
1355
- * @function fromObject
1356
- * @memberof science.RevokeKeyResponse
1357
- * @static
1358
- * @param {Object.<string,*>} object Plain object
1359
- * @returns {science.RevokeKeyResponse} RevokeKeyResponse
1360
- */
1361
- RevokeKeyResponse.fromObject = function fromObject(object) {
1362
- if (object instanceof $root.science.RevokeKeyResponse)
1363
- return object;
1364
- var message = new $root.science.RevokeKeyResponse();
1365
- if (object.keyId != null)
1366
- message.keyId = String(object.keyId);
1367
- return message;
1368
- };
1369
- /**
1370
- * Creates a plain object from a RevokeKeyResponse message. Also converts values to other types if specified.
1371
- * @function toObject
1372
- * @memberof science.RevokeKeyResponse
1373
- * @static
1374
- * @param {science.RevokeKeyResponse} message RevokeKeyResponse
1375
- * @param {$protobuf.IConversionOptions} [options] Conversion options
1376
- * @returns {Object.<string,*>} Plain object
1377
- */
1378
- RevokeKeyResponse.toObject = function toObject(message, options) {
1379
- if (!options)
1380
- options = {};
1381
- var object = {};
1382
- if (options.defaults)
1383
- object.keyId = "";
1384
- if (message.keyId != null && message.hasOwnProperty("keyId"))
1385
- object.keyId = message.keyId;
1386
- return object;
1387
- };
1388
- /**
1389
- * Converts this RevokeKeyResponse to JSON.
1390
- * @function toJSON
1391
- * @memberof science.RevokeKeyResponse
1392
- * @instance
1393
- * @returns {Object.<string,*>} JSON object
1394
- */
1395
- RevokeKeyResponse.prototype.toJSON = function toJSON() {
1396
- return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1397
- };
1398
- /**
1399
- * Gets the default type url for RevokeKeyResponse
1400
- * @function getTypeUrl
1401
- * @memberof science.RevokeKeyResponse
1402
- * @static
1403
- * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
1404
- * @returns {string} The default type url
1405
- */
1406
- RevokeKeyResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
1407
- if (typeUrlPrefix === undefined) {
1408
- typeUrlPrefix = "type.googleapis.com";
1409
- }
1410
- return typeUrlPrefix + "/science.RevokeKeyResponse";
1411
- };
1412
- return RevokeKeyResponse;
1413
- })();
1414
- science.ListKeysRequest = (function () {
1415
- /**
1416
- * Properties of a ListKeysRequest.
1417
- * @memberof science
1418
- * @interface IListKeysRequest
1419
- * @property {string|null} [userEmail] ListKeysRequest userEmail
1420
- */
1421
- /**
1422
- * Constructs a new ListKeysRequest.
1423
- * @memberof science
1424
- * @classdesc Represents a ListKeysRequest.
1425
- * @implements IListKeysRequest
1426
- * @constructor
1427
- * @param {science.IListKeysRequest=} [properties] Properties to set
1428
- */
1429
- function ListKeysRequest(properties) {
1430
- if (properties)
1431
- for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1432
- if (properties[keys[i]] != null)
1433
- this[keys[i]] = properties[keys[i]];
1434
- }
1435
- /**
1436
- * ListKeysRequest userEmail.
1437
- * @member {string} userEmail
1438
- * @memberof science.ListKeysRequest
1439
- * @instance
1440
- */
1441
- ListKeysRequest.prototype.userEmail = "";
1442
- /**
1443
- * Creates a new ListKeysRequest instance using the specified properties.
1444
- * @function create
1445
- * @memberof science.ListKeysRequest
1446
- * @static
1447
- * @param {science.IListKeysRequest=} [properties] Properties to set
1448
- * @returns {science.ListKeysRequest} ListKeysRequest instance
1449
- */
1450
- ListKeysRequest.create = function create(properties) {
1451
- return new ListKeysRequest(properties);
1452
- };
1453
- /**
1454
- * Encodes the specified ListKeysRequest message. Does not implicitly {@link science.ListKeysRequest.verify|verify} messages.
1455
- * @function encode
1456
- * @memberof science.ListKeysRequest
1457
- * @static
1458
- * @param {science.IListKeysRequest} message ListKeysRequest message or plain object to encode
1459
- * @param {$protobuf.Writer} [writer] Writer to encode to
1460
- * @returns {$protobuf.Writer} Writer
1461
- */
1462
- ListKeysRequest.encode = function encode(message, writer) {
1463
- if (!writer)
1464
- writer = $Writer.create();
1465
- if (message.userEmail != null && Object.hasOwnProperty.call(message, "userEmail"))
1466
- writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.userEmail);
1467
- return writer;
1468
- };
1469
- /**
1470
- * Encodes the specified ListKeysRequest message, length delimited. Does not implicitly {@link science.ListKeysRequest.verify|verify} messages.
1471
- * @function encodeDelimited
1472
- * @memberof science.ListKeysRequest
1473
- * @static
1474
- * @param {science.IListKeysRequest} message ListKeysRequest message or plain object to encode
1475
- * @param {$protobuf.Writer} [writer] Writer to encode to
1476
- * @returns {$protobuf.Writer} Writer
1477
- */
1478
- ListKeysRequest.encodeDelimited = function encodeDelimited(message, writer) {
1479
- return this.encode(message, writer).ldelim();
1480
- };
1481
- /**
1482
- * Decodes a ListKeysRequest message from the specified reader or buffer.
1483
- * @function decode
1484
- * @memberof science.ListKeysRequest
1485
- * @static
1486
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1487
- * @param {number} [length] Message length if known beforehand
1488
- * @returns {science.ListKeysRequest} ListKeysRequest
1489
- * @throws {Error} If the payload is not a reader or valid buffer
1490
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
1491
- */
1492
- ListKeysRequest.decode = function decode(reader, length) {
1493
- if (!(reader instanceof $Reader))
1494
- reader = $Reader.create(reader);
1495
- var end = length === undefined ? reader.len : reader.pos + length, message = new $root.science.ListKeysRequest();
1496
- while (reader.pos < end) {
1497
- var tag = reader.uint32();
1498
- switch (tag >>> 3) {
1499
- case 1: {
1500
- message.userEmail = reader.string();
1501
- break;
1502
- }
1503
- default:
1504
- reader.skipType(tag & 7);
1505
- break;
1506
- }
1507
- }
1508
- return message;
1509
- };
1510
- /**
1511
- * Decodes a ListKeysRequest message from the specified reader or buffer, length delimited.
1512
- * @function decodeDelimited
1513
- * @memberof science.ListKeysRequest
1514
- * @static
1515
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1516
- * @returns {science.ListKeysRequest} ListKeysRequest
1517
- * @throws {Error} If the payload is not a reader or valid buffer
1518
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
1519
- */
1520
- ListKeysRequest.decodeDelimited = function decodeDelimited(reader) {
1521
- if (!(reader instanceof $Reader))
1522
- reader = new $Reader(reader);
1523
- return this.decode(reader, reader.uint32());
1524
- };
1525
- /**
1526
- * Verifies a ListKeysRequest message.
1527
- * @function verify
1528
- * @memberof science.ListKeysRequest
1529
- * @static
1530
- * @param {Object.<string,*>} message Plain object to verify
1531
- * @returns {string|null} `null` if valid, otherwise the reason why it is not
1532
- */
1533
- ListKeysRequest.verify = function verify(message) {
1534
- if (typeof message !== "object" || message === null)
1535
- return "object expected";
1536
- if (message.userEmail != null && message.hasOwnProperty("userEmail"))
1537
- if (!$util.isString(message.userEmail))
1538
- return "userEmail: string expected";
1539
- return null;
1540
- };
1541
- /**
1542
- * Creates a ListKeysRequest message from a plain object. Also converts values to their respective internal types.
1543
- * @function fromObject
1544
- * @memberof science.ListKeysRequest
1545
- * @static
1546
- * @param {Object.<string,*>} object Plain object
1547
- * @returns {science.ListKeysRequest} ListKeysRequest
1548
- */
1549
- ListKeysRequest.fromObject = function fromObject(object) {
1550
- if (object instanceof $root.science.ListKeysRequest)
1551
- return object;
1552
- var message = new $root.science.ListKeysRequest();
1553
- if (object.userEmail != null)
1554
- message.userEmail = String(object.userEmail);
1555
- return message;
1556
- };
1557
- /**
1558
- * Creates a plain object from a ListKeysRequest message. Also converts values to other types if specified.
1559
- * @function toObject
1560
- * @memberof science.ListKeysRequest
1561
- * @static
1562
- * @param {science.ListKeysRequest} message ListKeysRequest
1563
- * @param {$protobuf.IConversionOptions} [options] Conversion options
1564
- * @returns {Object.<string,*>} Plain object
1565
- */
1566
- ListKeysRequest.toObject = function toObject(message, options) {
1567
- if (!options)
1568
- options = {};
1569
- var object = {};
1570
- if (options.defaults)
1571
- object.userEmail = "";
1572
- if (message.userEmail != null && message.hasOwnProperty("userEmail"))
1573
- object.userEmail = message.userEmail;
1574
- return object;
1575
- };
1576
- /**
1577
- * Converts this ListKeysRequest to JSON.
1578
- * @function toJSON
1579
- * @memberof science.ListKeysRequest
1580
- * @instance
1581
- * @returns {Object.<string,*>} JSON object
1582
- */
1583
- ListKeysRequest.prototype.toJSON = function toJSON() {
1584
- return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1585
- };
1586
- /**
1587
- * Gets the default type url for ListKeysRequest
1588
- * @function getTypeUrl
1589
- * @memberof science.ListKeysRequest
1590
- * @static
1591
- * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
1592
- * @returns {string} The default type url
1593
- */
1594
- ListKeysRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
1595
- if (typeUrlPrefix === undefined) {
1596
- typeUrlPrefix = "type.googleapis.com";
1597
- }
1598
- return typeUrlPrefix + "/science.ListKeysRequest";
1599
- };
1600
- return ListKeysRequest;
1601
- })();
1602
- science.ListKeysResponse = (function () {
1603
- /**
1604
- * Properties of a ListKeysResponse.
1605
- * @memberof science
1606
- * @interface IListKeysResponse
1607
- * @property {Array.<science.IUserKey>|null} [keys] ListKeysResponse keys
1608
- */
1609
- /**
1610
- * Constructs a new ListKeysResponse.
1611
- * @memberof science
1612
- * @classdesc Represents a ListKeysResponse.
1613
- * @implements IListKeysResponse
1614
- * @constructor
1615
- * @param {science.IListKeysResponse=} [properties] Properties to set
1616
- */
1617
- function ListKeysResponse(properties) {
1618
- this.keys = [];
1619
- if (properties)
1620
- for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1621
- if (properties[keys[i]] != null)
1622
- this[keys[i]] = properties[keys[i]];
1623
- }
1624
- /**
1625
- * ListKeysResponse keys.
1626
- * @member {Array.<science.IUserKey>} keys
1627
- * @memberof science.ListKeysResponse
1628
- * @instance
1629
- */
1630
- ListKeysResponse.prototype.keys = $util.emptyArray;
1631
- /**
1632
- * Creates a new ListKeysResponse instance using the specified properties.
1633
- * @function create
1634
- * @memberof science.ListKeysResponse
1635
- * @static
1636
- * @param {science.IListKeysResponse=} [properties] Properties to set
1637
- * @returns {science.ListKeysResponse} ListKeysResponse instance
1638
- */
1639
- ListKeysResponse.create = function create(properties) {
1640
- return new ListKeysResponse(properties);
1641
- };
1642
- /**
1643
- * Encodes the specified ListKeysResponse message. Does not implicitly {@link science.ListKeysResponse.verify|verify} messages.
1644
- * @function encode
1645
- * @memberof science.ListKeysResponse
1646
- * @static
1647
- * @param {science.IListKeysResponse} message ListKeysResponse message or plain object to encode
1648
- * @param {$protobuf.Writer} [writer] Writer to encode to
1649
- * @returns {$protobuf.Writer} Writer
1650
- */
1651
- ListKeysResponse.encode = function encode(message, writer) {
1652
- if (!writer)
1653
- writer = $Writer.create();
1654
- if (message.keys != null && message.keys.length)
1655
- for (var i = 0; i < message.keys.length; ++i)
1656
- $root.science.UserKey.encode(message.keys[i], writer.uint32(/* id 1, wireType 2 =*/ 10).fork()).ldelim();
1657
- return writer;
1658
- };
1659
- /**
1660
- * Encodes the specified ListKeysResponse message, length delimited. Does not implicitly {@link science.ListKeysResponse.verify|verify} messages.
1661
- * @function encodeDelimited
1662
- * @memberof science.ListKeysResponse
1663
- * @static
1664
- * @param {science.IListKeysResponse} message ListKeysResponse message or plain object to encode
1665
- * @param {$protobuf.Writer} [writer] Writer to encode to
1666
- * @returns {$protobuf.Writer} Writer
1667
- */
1668
- ListKeysResponse.encodeDelimited = function encodeDelimited(message, writer) {
1669
- return this.encode(message, writer).ldelim();
1670
- };
1671
- /**
1672
- * Decodes a ListKeysResponse message from the specified reader or buffer.
1673
- * @function decode
1674
- * @memberof science.ListKeysResponse
1675
- * @static
1676
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1677
- * @param {number} [length] Message length if known beforehand
1678
- * @returns {science.ListKeysResponse} ListKeysResponse
1679
- * @throws {Error} If the payload is not a reader or valid buffer
1680
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
1681
- */
1682
- ListKeysResponse.decode = function decode(reader, length) {
1683
- if (!(reader instanceof $Reader))
1684
- reader = $Reader.create(reader);
1685
- var end = length === undefined ? reader.len : reader.pos + length, message = new $root.science.ListKeysResponse();
1686
- while (reader.pos < end) {
1687
- var tag = reader.uint32();
1688
- switch (tag >>> 3) {
1689
- case 1: {
1690
- if (!(message.keys && message.keys.length))
1691
- message.keys = [];
1692
- message.keys.push($root.science.UserKey.decode(reader, reader.uint32()));
1693
- break;
1694
- }
1695
- default:
1696
- reader.skipType(tag & 7);
1697
- break;
1698
- }
1699
- }
1700
- return message;
1701
- };
1702
- /**
1703
- * Decodes a ListKeysResponse message from the specified reader or buffer, length delimited.
1704
- * @function decodeDelimited
1705
- * @memberof science.ListKeysResponse
1706
- * @static
1707
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1708
- * @returns {science.ListKeysResponse} ListKeysResponse
1709
- * @throws {Error} If the payload is not a reader or valid buffer
1710
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
1711
- */
1712
- ListKeysResponse.decodeDelimited = function decodeDelimited(reader) {
1713
- if (!(reader instanceof $Reader))
1714
- reader = new $Reader(reader);
1715
- return this.decode(reader, reader.uint32());
1716
- };
1717
- /**
1718
- * Verifies a ListKeysResponse message.
1719
- * @function verify
1720
- * @memberof science.ListKeysResponse
1721
- * @static
1722
- * @param {Object.<string,*>} message Plain object to verify
1723
- * @returns {string|null} `null` if valid, otherwise the reason why it is not
1724
- */
1725
- ListKeysResponse.verify = function verify(message) {
1726
- if (typeof message !== "object" || message === null)
1727
- return "object expected";
1728
- if (message.keys != null && message.hasOwnProperty("keys")) {
1729
- if (!Array.isArray(message.keys))
1730
- return "keys: array expected";
1731
- for (var i = 0; i < message.keys.length; ++i) {
1732
- var error = $root.science.UserKey.verify(message.keys[i]);
1733
- if (error)
1734
- return "keys." + error;
1735
- }
1736
- }
1737
- return null;
1738
- };
1739
- /**
1740
- * Creates a ListKeysResponse message from a plain object. Also converts values to their respective internal types.
1741
- * @function fromObject
1742
- * @memberof science.ListKeysResponse
1743
- * @static
1744
- * @param {Object.<string,*>} object Plain object
1745
- * @returns {science.ListKeysResponse} ListKeysResponse
1746
- */
1747
- ListKeysResponse.fromObject = function fromObject(object) {
1748
- if (object instanceof $root.science.ListKeysResponse)
1749
- return object;
1750
- var message = new $root.science.ListKeysResponse();
1751
- if (object.keys) {
1752
- if (!Array.isArray(object.keys))
1753
- throw TypeError(".science.ListKeysResponse.keys: array expected");
1754
- message.keys = [];
1755
- for (var i = 0; i < object.keys.length; ++i) {
1756
- if (typeof object.keys[i] !== "object")
1757
- throw TypeError(".science.ListKeysResponse.keys: object expected");
1758
- message.keys[i] = $root.science.UserKey.fromObject(object.keys[i]);
1759
- }
1760
- }
1761
- return message;
1762
- };
1763
- /**
1764
- * Creates a plain object from a ListKeysResponse message. Also converts values to other types if specified.
1765
- * @function toObject
1766
- * @memberof science.ListKeysResponse
1767
- * @static
1768
- * @param {science.ListKeysResponse} message ListKeysResponse
1769
- * @param {$protobuf.IConversionOptions} [options] Conversion options
1770
- * @returns {Object.<string,*>} Plain object
1771
- */
1772
- ListKeysResponse.toObject = function toObject(message, options) {
1773
- if (!options)
1774
- options = {};
1775
- var object = {};
1776
- if (options.arrays || options.defaults)
1777
- object.keys = [];
1778
- if (message.keys && message.keys.length) {
1779
- object.keys = [];
1780
- for (var j = 0; j < message.keys.length; ++j)
1781
- object.keys[j] = $root.science.UserKey.toObject(message.keys[j], options);
1782
- }
1783
- return object;
1784
- };
1785
- /**
1786
- * Converts this ListKeysResponse to JSON.
1787
- * @function toJSON
1788
- * @memberof science.ListKeysResponse
1789
- * @instance
1790
- * @returns {Object.<string,*>} JSON object
1791
- */
1792
- ListKeysResponse.prototype.toJSON = function toJSON() {
1793
- return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1794
- };
1795
- /**
1796
- * Gets the default type url for ListKeysResponse
1797
- * @function getTypeUrl
1798
- * @memberof science.ListKeysResponse
1799
- * @static
1800
- * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
1801
- * @returns {string} The default type url
1802
- */
1803
- ListKeysResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
1804
- if (typeUrlPrefix === undefined) {
1805
- typeUrlPrefix = "type.googleapis.com";
1806
- }
1807
- return typeUrlPrefix + "/science.ListKeysResponse";
1808
- };
1809
- return ListKeysResponse;
1810
- })();
1811
- science.DeviceAuthService = (function () {
1812
- /**
1813
- * Constructs a new DeviceAuthService service.
1814
- * @memberof science
1815
- * @classdesc Represents a DeviceAuthService
1816
- * @extends $protobuf.rpc.Service
1817
- * @constructor
1818
- * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
1819
- * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
1820
- * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
1821
- */
1822
- function DeviceAuthService(rpcImpl, requestDelimited, responseDelimited) {
1823
- $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
1824
- }
1825
- (DeviceAuthService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DeviceAuthService;
1826
- /**
1827
- * Creates new DeviceAuthService service using the specified rpc implementation.
1828
- * @function create
1829
- * @memberof science.DeviceAuthService
1830
- * @static
1831
- * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
1832
- * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
1833
- * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
1834
- * @returns {DeviceAuthService} RPC service. Useful where requests and/or responses are streamed.
1835
- */
1836
- DeviceAuthService.create = function create(rpcImpl, requestDelimited, responseDelimited) {
1837
- return new this(rpcImpl, requestDelimited, responseDelimited);
1838
- };
1839
- /**
1840
- * Callback as used by {@link science.DeviceAuthService#authenticateDevice}.
1841
- * @memberof science.DeviceAuthService
1842
- * @typedef AuthenticateDeviceCallback
1843
- * @type {function}
1844
- * @param {Error|null} error Error, if any
1845
- * @param {science.DeviceAuthenticationResponse} [response] DeviceAuthenticationResponse
1846
- */
1847
- /**
1848
- * Calls AuthenticateDevice.
1849
- * @function authenticateDevice
1850
- * @memberof science.DeviceAuthService
1851
- * @instance
1852
- * @param {science.IDeviceAuthenticationRequest} request DeviceAuthenticationRequest message or plain object
1853
- * @param {science.DeviceAuthService.AuthenticateDeviceCallback} callback Node-style callback called with the error, if any, and DeviceAuthenticationResponse
1854
- * @returns {undefined}
1855
- * @variation 1
1856
- */
1857
- Object.defineProperty(DeviceAuthService.prototype.authenticateDevice = function authenticateDevice(request, callback) {
1858
- return this.rpcCall(authenticateDevice, $root.science.DeviceAuthenticationRequest, $root.science.DeviceAuthenticationResponse, request, callback);
1859
- }, "name", { value: "AuthenticateDevice" });
1860
- /**
1861
- * Calls AuthenticateDevice.
1862
- * @function authenticateDevice
1863
- * @memberof science.DeviceAuthService
1864
- * @instance
1865
- * @param {science.IDeviceAuthenticationRequest} request DeviceAuthenticationRequest message or plain object
1866
- * @returns {Promise<science.DeviceAuthenticationResponse>} Promise
1867
- * @variation 2
1868
- */
1869
- /**
1870
- * Callback as used by {@link science.DeviceAuthService#revokeKey}.
1871
- * @memberof science.DeviceAuthService
1872
- * @typedef RevokeKeyCallback
1873
- * @type {function}
1874
- * @param {Error|null} error Error, if any
1875
- * @param {science.RevokeKeyResponse} [response] RevokeKeyResponse
1876
- */
1877
- /**
1878
- * Calls RevokeKey.
1879
- * @function revokeKey
1880
- * @memberof science.DeviceAuthService
1881
- * @instance
1882
- * @param {science.IRevokeKeyRequest} request RevokeKeyRequest message or plain object
1883
- * @param {science.DeviceAuthService.RevokeKeyCallback} callback Node-style callback called with the error, if any, and RevokeKeyResponse
1884
- * @returns {undefined}
1885
- * @variation 1
1886
- */
1887
- Object.defineProperty(DeviceAuthService.prototype.revokeKey = function revokeKey(request, callback) {
1888
- return this.rpcCall(revokeKey, $root.science.RevokeKeyRequest, $root.science.RevokeKeyResponse, request, callback);
1889
- }, "name", { value: "RevokeKey" });
1890
- /**
1891
- * Calls RevokeKey.
1892
- * @function revokeKey
1893
- * @memberof science.DeviceAuthService
1894
- * @instance
1895
- * @param {science.IRevokeKeyRequest} request RevokeKeyRequest message or plain object
1896
- * @returns {Promise<science.RevokeKeyResponse>} Promise
1897
- * @variation 2
1898
- */
1899
- /**
1900
- * Callback as used by {@link science.DeviceAuthService#listKeys}.
1901
- * @memberof science.DeviceAuthService
1902
- * @typedef ListKeysCallback
1903
- * @type {function}
1904
- * @param {Error|null} error Error, if any
1905
- * @param {science.ListKeysResponse} [response] ListKeysResponse
1906
- */
1907
- /**
1908
- * Calls ListKeys.
1909
- * @function listKeys
1910
- * @memberof science.DeviceAuthService
1911
- * @instance
1912
- * @param {science.IListKeysRequest} request ListKeysRequest message or plain object
1913
- * @param {science.DeviceAuthService.ListKeysCallback} callback Node-style callback called with the error, if any, and ListKeysResponse
1914
- * @returns {undefined}
1915
- * @variation 1
1916
- */
1917
- Object.defineProperty(DeviceAuthService.prototype.listKeys = function listKeys(request, callback) {
1918
- return this.rpcCall(listKeys, $root.science.ListKeysRequest, $root.science.ListKeysResponse, request, callback);
1919
- }, "name", { value: "ListKeys" });
1920
- /**
1921
- * Calls ListKeys.
1922
- * @function listKeys
1923
- * @memberof science.DeviceAuthService
1924
- * @instance
1925
- * @param {science.IListKeysRequest} request ListKeysRequest message or plain object
1926
- * @returns {Promise<science.ListKeysResponse>} Promise
1927
- * @variation 2
1928
- */
1929
- return DeviceAuthService;
1930
- })();
1931
- science.UpdatePackagesRequest = (function () {
1932
- /**
1933
- * Properties of an UpdatePackagesRequest.
1934
- * @memberof science
1935
- * @interface IUpdatePackagesRequest
1936
- * @property {Array.<science.IPackageSpec>|null} [packages] UpdatePackagesRequest packages
1937
- */
1938
- /**
1939
- * Constructs a new UpdatePackagesRequest.
1940
- * @memberof science
1941
- * @classdesc Represents an UpdatePackagesRequest.
1942
- * @implements IUpdatePackagesRequest
1943
- * @constructor
1944
- * @param {science.IUpdatePackagesRequest=} [properties] Properties to set
1945
- */
1946
- function UpdatePackagesRequest(properties) {
1947
- this.packages = [];
1948
- if (properties)
1949
- for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1950
- if (properties[keys[i]] != null)
1951
- this[keys[i]] = properties[keys[i]];
1952
- }
1953
- /**
1954
- * UpdatePackagesRequest packages.
1955
- * @member {Array.<science.IPackageSpec>} packages
1956
- * @memberof science.UpdatePackagesRequest
1957
- * @instance
1958
- */
1959
- UpdatePackagesRequest.prototype.packages = $util.emptyArray;
1960
- /**
1961
- * Creates a new UpdatePackagesRequest instance using the specified properties.
1962
- * @function create
1963
- * @memberof science.UpdatePackagesRequest
1964
- * @static
1965
- * @param {science.IUpdatePackagesRequest=} [properties] Properties to set
1966
- * @returns {science.UpdatePackagesRequest} UpdatePackagesRequest instance
1967
- */
1968
- UpdatePackagesRequest.create = function create(properties) {
1969
- return new UpdatePackagesRequest(properties);
1970
- };
1971
- /**
1972
- * Encodes the specified UpdatePackagesRequest message. Does not implicitly {@link science.UpdatePackagesRequest.verify|verify} messages.
1973
- * @function encode
1974
- * @memberof science.UpdatePackagesRequest
1975
- * @static
1976
- * @param {science.IUpdatePackagesRequest} message UpdatePackagesRequest message or plain object to encode
1977
- * @param {$protobuf.Writer} [writer] Writer to encode to
1978
- * @returns {$protobuf.Writer} Writer
1979
- */
1980
- UpdatePackagesRequest.encode = function encode(message, writer) {
1981
- if (!writer)
1982
- writer = $Writer.create();
1983
- if (message.packages != null && message.packages.length)
1984
- for (var i = 0; i < message.packages.length; ++i)
1985
- $root.science.PackageSpec.encode(message.packages[i], writer.uint32(/* id 1, wireType 2 =*/ 10).fork()).ldelim();
1986
- return writer;
1987
- };
1988
- /**
1989
- * Encodes the specified UpdatePackagesRequest message, length delimited. Does not implicitly {@link science.UpdatePackagesRequest.verify|verify} messages.
1990
- * @function encodeDelimited
1991
- * @memberof science.UpdatePackagesRequest
1992
- * @static
1993
- * @param {science.IUpdatePackagesRequest} message UpdatePackagesRequest message or plain object to encode
1994
- * @param {$protobuf.Writer} [writer] Writer to encode to
1995
- * @returns {$protobuf.Writer} Writer
1996
- */
1997
- UpdatePackagesRequest.encodeDelimited = function encodeDelimited(message, writer) {
1998
- return this.encode(message, writer).ldelim();
1999
- };
2000
- /**
2001
- * Decodes an UpdatePackagesRequest message from the specified reader or buffer.
2002
- * @function decode
2003
- * @memberof science.UpdatePackagesRequest
2004
- * @static
2005
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2006
- * @param {number} [length] Message length if known beforehand
2007
- * @returns {science.UpdatePackagesRequest} UpdatePackagesRequest
2008
- * @throws {Error} If the payload is not a reader or valid buffer
2009
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
2010
- */
2011
- UpdatePackagesRequest.decode = function decode(reader, length) {
2012
- if (!(reader instanceof $Reader))
2013
- reader = $Reader.create(reader);
2014
- var end = length === undefined ? reader.len : reader.pos + length, message = new $root.science.UpdatePackagesRequest();
2015
- while (reader.pos < end) {
2016
- var tag = reader.uint32();
2017
- switch (tag >>> 3) {
2018
- case 1: {
2019
- if (!(message.packages && message.packages.length))
2020
- message.packages = [];
2021
- message.packages.push($root.science.PackageSpec.decode(reader, reader.uint32()));
2022
- break;
2023
- }
2024
- default:
2025
- reader.skipType(tag & 7);
2026
- break;
2027
- }
2028
- }
2029
- return message;
2030
- };
2031
- /**
2032
- * Decodes an UpdatePackagesRequest message from the specified reader or buffer, length delimited.
2033
- * @function decodeDelimited
2034
- * @memberof science.UpdatePackagesRequest
2035
- * @static
2036
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2037
- * @returns {science.UpdatePackagesRequest} UpdatePackagesRequest
2038
- * @throws {Error} If the payload is not a reader or valid buffer
2039
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
2040
- */
2041
- UpdatePackagesRequest.decodeDelimited = function decodeDelimited(reader) {
2042
- if (!(reader instanceof $Reader))
2043
- reader = new $Reader(reader);
2044
- return this.decode(reader, reader.uint32());
2045
- };
2046
- /**
2047
- * Verifies an UpdatePackagesRequest message.
2048
- * @function verify
2049
- * @memberof science.UpdatePackagesRequest
2050
- * @static
2051
- * @param {Object.<string,*>} message Plain object to verify
2052
- * @returns {string|null} `null` if valid, otherwise the reason why it is not
2053
- */
2054
- UpdatePackagesRequest.verify = function verify(message) {
2055
- if (typeof message !== "object" || message === null)
2056
- return "object expected";
2057
- if (message.packages != null && message.hasOwnProperty("packages")) {
2058
- if (!Array.isArray(message.packages))
2059
- return "packages: array expected";
2060
- for (var i = 0; i < message.packages.length; ++i) {
2061
- var error = $root.science.PackageSpec.verify(message.packages[i]);
2062
- if (error)
2063
- return "packages." + error;
2064
- }
2065
- }
2066
- return null;
2067
- };
2068
- /**
2069
- * Creates an UpdatePackagesRequest message from a plain object. Also converts values to their respective internal types.
2070
- * @function fromObject
2071
- * @memberof science.UpdatePackagesRequest
2072
- * @static
2073
- * @param {Object.<string,*>} object Plain object
2074
- * @returns {science.UpdatePackagesRequest} UpdatePackagesRequest
2075
- */
2076
- UpdatePackagesRequest.fromObject = function fromObject(object) {
2077
- if (object instanceof $root.science.UpdatePackagesRequest)
2078
- return object;
2079
- var message = new $root.science.UpdatePackagesRequest();
2080
- if (object.packages) {
2081
- if (!Array.isArray(object.packages))
2082
- throw TypeError(".science.UpdatePackagesRequest.packages: array expected");
2083
- message.packages = [];
2084
- for (var i = 0; i < object.packages.length; ++i) {
2085
- if (typeof object.packages[i] !== "object")
2086
- throw TypeError(".science.UpdatePackagesRequest.packages: object expected");
2087
- message.packages[i] = $root.science.PackageSpec.fromObject(object.packages[i]);
2088
- }
2089
- }
2090
- return message;
2091
- };
2092
- /**
2093
- * Creates a plain object from an UpdatePackagesRequest message. Also converts values to other types if specified.
2094
- * @function toObject
2095
- * @memberof science.UpdatePackagesRequest
2096
- * @static
2097
- * @param {science.UpdatePackagesRequest} message UpdatePackagesRequest
2098
- * @param {$protobuf.IConversionOptions} [options] Conversion options
2099
- * @returns {Object.<string,*>} Plain object
2100
- */
2101
- UpdatePackagesRequest.toObject = function toObject(message, options) {
2102
- if (!options)
2103
- options = {};
2104
- var object = {};
2105
- if (options.arrays || options.defaults)
2106
- object.packages = [];
2107
- if (message.packages && message.packages.length) {
2108
- object.packages = [];
2109
- for (var j = 0; j < message.packages.length; ++j)
2110
- object.packages[j] = $root.science.PackageSpec.toObject(message.packages[j], options);
2111
- }
2112
- return object;
2113
- };
2114
- /**
2115
- * Converts this UpdatePackagesRequest to JSON.
2116
- * @function toJSON
2117
- * @memberof science.UpdatePackagesRequest
2118
- * @instance
2119
- * @returns {Object.<string,*>} JSON object
2120
- */
2121
- UpdatePackagesRequest.prototype.toJSON = function toJSON() {
2122
- return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
2123
- };
2124
- /**
2125
- * Gets the default type url for UpdatePackagesRequest
2126
- * @function getTypeUrl
2127
- * @memberof science.UpdatePackagesRequest
2128
- * @static
2129
- * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
2130
- * @returns {string} The default type url
2131
- */
2132
- UpdatePackagesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
2133
- if (typeUrlPrefix === undefined) {
2134
- typeUrlPrefix = "type.googleapis.com";
2135
- }
2136
- return typeUrlPrefix + "/science.UpdatePackagesRequest";
2137
- };
2138
- return UpdatePackagesRequest;
2139
- })();
2140
- science.PackageSpec = (function () {
2141
- /**
2142
- * Properties of a PackageSpec.
2143
- * @memberof science
2144
- * @interface IPackageSpec
2145
- * @property {string|null} [name] PackageSpec name
2146
- * @property {string|null} [version] PackageSpec version
2147
- */
2148
- /**
2149
- * Constructs a new PackageSpec.
2150
- * @memberof science
2151
- * @classdesc Represents a PackageSpec.
2152
- * @implements IPackageSpec
2153
- * @constructor
2154
- * @param {science.IPackageSpec=} [properties] Properties to set
2155
- */
2156
- function PackageSpec(properties) {
2157
- if (properties)
2158
- for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
2159
- if (properties[keys[i]] != null)
2160
- this[keys[i]] = properties[keys[i]];
2161
- }
2162
- /**
2163
- * PackageSpec name.
2164
- * @member {string} name
2165
- * @memberof science.PackageSpec
2166
- * @instance
2167
- */
2168
- PackageSpec.prototype.name = "";
2169
- /**
2170
- * PackageSpec version.
2171
- * @member {string} version
2172
- * @memberof science.PackageSpec
2173
- * @instance
2174
- */
2175
- PackageSpec.prototype.version = "";
2176
- /**
2177
- * Creates a new PackageSpec instance using the specified properties.
2178
- * @function create
2179
- * @memberof science.PackageSpec
2180
- * @static
2181
- * @param {science.IPackageSpec=} [properties] Properties to set
2182
- * @returns {science.PackageSpec} PackageSpec instance
2183
- */
2184
- PackageSpec.create = function create(properties) {
2185
- return new PackageSpec(properties);
2186
- };
2187
- /**
2188
- * Encodes the specified PackageSpec message. Does not implicitly {@link science.PackageSpec.verify|verify} messages.
2189
- * @function encode
2190
- * @memberof science.PackageSpec
2191
- * @static
2192
- * @param {science.IPackageSpec} message PackageSpec message or plain object to encode
2193
- * @param {$protobuf.Writer} [writer] Writer to encode to
2194
- * @returns {$protobuf.Writer} Writer
2195
- */
2196
- PackageSpec.encode = function encode(message, writer) {
2197
- if (!writer)
2198
- writer = $Writer.create();
2199
- if (message.name != null && Object.hasOwnProperty.call(message, "name"))
2200
- writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.name);
2201
- if (message.version != null && Object.hasOwnProperty.call(message, "version"))
2202
- writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.version);
2203
- return writer;
2204
- };
2205
- /**
2206
- * Encodes the specified PackageSpec message, length delimited. Does not implicitly {@link science.PackageSpec.verify|verify} messages.
2207
- * @function encodeDelimited
2208
- * @memberof science.PackageSpec
2209
- * @static
2210
- * @param {science.IPackageSpec} message PackageSpec message or plain object to encode
2211
- * @param {$protobuf.Writer} [writer] Writer to encode to
2212
- * @returns {$protobuf.Writer} Writer
2213
- */
2214
- PackageSpec.encodeDelimited = function encodeDelimited(message, writer) {
2215
- return this.encode(message, writer).ldelim();
2216
- };
2217
- /**
2218
- * Decodes a PackageSpec message from the specified reader or buffer.
2219
- * @function decode
2220
- * @memberof science.PackageSpec
2221
- * @static
2222
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2223
- * @param {number} [length] Message length if known beforehand
2224
- * @returns {science.PackageSpec} PackageSpec
2225
- * @throws {Error} If the payload is not a reader or valid buffer
2226
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
2227
- */
2228
- PackageSpec.decode = function decode(reader, length) {
2229
- if (!(reader instanceof $Reader))
2230
- reader = $Reader.create(reader);
2231
- var end = length === undefined ? reader.len : reader.pos + length, message = new $root.science.PackageSpec();
2232
- while (reader.pos < end) {
2233
- var tag = reader.uint32();
2234
- switch (tag >>> 3) {
2235
- case 1: {
2236
- message.name = reader.string();
2237
- break;
2238
- }
2239
- case 2: {
2240
- message.version = reader.string();
2241
- break;
2242
- }
2243
- default:
2244
- reader.skipType(tag & 7);
2245
- break;
2246
- }
2247
- }
2248
- return message;
2249
- };
2250
- /**
2251
- * Decodes a PackageSpec message from the specified reader or buffer, length delimited.
2252
- * @function decodeDelimited
2253
- * @memberof science.PackageSpec
2254
- * @static
2255
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2256
- * @returns {science.PackageSpec} PackageSpec
2257
- * @throws {Error} If the payload is not a reader or valid buffer
2258
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
2259
- */
2260
- PackageSpec.decodeDelimited = function decodeDelimited(reader) {
2261
- if (!(reader instanceof $Reader))
2262
- reader = new $Reader(reader);
2263
- return this.decode(reader, reader.uint32());
2264
- };
2265
- /**
2266
- * Verifies a PackageSpec message.
2267
- * @function verify
2268
- * @memberof science.PackageSpec
2269
- * @static
2270
- * @param {Object.<string,*>} message Plain object to verify
2271
- * @returns {string|null} `null` if valid, otherwise the reason why it is not
2272
- */
2273
- PackageSpec.verify = function verify(message) {
2274
- if (typeof message !== "object" || message === null)
2275
- return "object expected";
2276
- if (message.name != null && message.hasOwnProperty("name"))
2277
- if (!$util.isString(message.name))
2278
- return "name: string expected";
2279
- if (message.version != null && message.hasOwnProperty("version"))
2280
- if (!$util.isString(message.version))
2281
- return "version: string expected";
2282
- return null;
2283
- };
2284
- /**
2285
- * Creates a PackageSpec message from a plain object. Also converts values to their respective internal types.
2286
- * @function fromObject
2287
- * @memberof science.PackageSpec
2288
- * @static
2289
- * @param {Object.<string,*>} object Plain object
2290
- * @returns {science.PackageSpec} PackageSpec
2291
- */
2292
- PackageSpec.fromObject = function fromObject(object) {
2293
- if (object instanceof $root.science.PackageSpec)
2294
- return object;
2295
- var message = new $root.science.PackageSpec();
2296
- if (object.name != null)
2297
- message.name = String(object.name);
2298
- if (object.version != null)
2299
- message.version = String(object.version);
2300
- return message;
2301
- };
2302
- /**
2303
- * Creates a plain object from a PackageSpec message. Also converts values to other types if specified.
2304
- * @function toObject
2305
- * @memberof science.PackageSpec
2306
- * @static
2307
- * @param {science.PackageSpec} message PackageSpec
2308
- * @param {$protobuf.IConversionOptions} [options] Conversion options
2309
- * @returns {Object.<string,*>} Plain object
2310
- */
2311
- PackageSpec.toObject = function toObject(message, options) {
2312
- if (!options)
2313
- options = {};
2314
- var object = {};
2315
- if (options.defaults) {
2316
- object.name = "";
2317
- object.version = "";
2318
- }
2319
- if (message.name != null && message.hasOwnProperty("name"))
2320
- object.name = message.name;
2321
- if (message.version != null && message.hasOwnProperty("version"))
2322
- object.version = message.version;
2323
- return object;
2324
- };
2325
- /**
2326
- * Converts this PackageSpec to JSON.
2327
- * @function toJSON
2328
- * @memberof science.PackageSpec
2329
- * @instance
2330
- * @returns {Object.<string,*>} JSON object
2331
- */
2332
- PackageSpec.prototype.toJSON = function toJSON() {
2333
- return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
2334
- };
2335
- /**
2336
- * Gets the default type url for PackageSpec
2337
- * @function getTypeUrl
2338
- * @memberof science.PackageSpec
2339
- * @static
2340
- * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
2341
- * @returns {string} The default type url
2342
- */
2343
- PackageSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
2344
- if (typeUrlPrefix === undefined) {
2345
- typeUrlPrefix = "type.googleapis.com";
2346
- }
2347
- return typeUrlPrefix + "/science.PackageSpec";
2348
- };
2349
- return PackageSpec;
2350
- })();
2351
- science.UpdateResult = (function () {
2352
- /**
2353
- * Properties of an UpdateResult.
2354
- * @memberof science
2355
- * @interface IUpdateResult
2356
- * @property {string|null} [name] UpdateResult name
2357
- * @property {boolean|null} [success] UpdateResult success
2358
- * @property {string|null} [message] UpdateResult message
2359
- */
2360
- /**
2361
- * Constructs a new UpdateResult.
2362
- * @memberof science
2363
- * @classdesc Represents an UpdateResult.
2364
- * @implements IUpdateResult
2365
- * @constructor
2366
- * @param {science.IUpdateResult=} [properties] Properties to set
2367
- */
2368
- function UpdateResult(properties) {
2369
- if (properties)
2370
- for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
2371
- if (properties[keys[i]] != null)
2372
- this[keys[i]] = properties[keys[i]];
2373
- }
2374
- /**
2375
- * UpdateResult name.
2376
- * @member {string} name
2377
- * @memberof science.UpdateResult
2378
- * @instance
2379
- */
2380
- UpdateResult.prototype.name = "";
2381
- /**
2382
- * UpdateResult success.
2383
- * @member {boolean} success
2384
- * @memberof science.UpdateResult
2385
- * @instance
2386
- */
2387
- UpdateResult.prototype.success = false;
2388
- /**
2389
- * UpdateResult message.
2390
- * @member {string} message
2391
- * @memberof science.UpdateResult
2392
- * @instance
2393
- */
2394
- UpdateResult.prototype.message = "";
2395
- /**
2396
- * Creates a new UpdateResult instance using the specified properties.
2397
- * @function create
2398
- * @memberof science.UpdateResult
2399
- * @static
2400
- * @param {science.IUpdateResult=} [properties] Properties to set
2401
- * @returns {science.UpdateResult} UpdateResult instance
2402
- */
2403
- UpdateResult.create = function create(properties) {
2404
- return new UpdateResult(properties);
2405
- };
2406
- /**
2407
- * Encodes the specified UpdateResult message. Does not implicitly {@link science.UpdateResult.verify|verify} messages.
2408
- * @function encode
2409
- * @memberof science.UpdateResult
2410
- * @static
2411
- * @param {science.IUpdateResult} message UpdateResult message or plain object to encode
2412
- * @param {$protobuf.Writer} [writer] Writer to encode to
2413
- * @returns {$protobuf.Writer} Writer
2414
- */
2415
- UpdateResult.encode = function encode(message, writer) {
2416
- if (!writer)
2417
- writer = $Writer.create();
2418
- if (message.name != null && Object.hasOwnProperty.call(message, "name"))
2419
- writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.name);
2420
- if (message.success != null && Object.hasOwnProperty.call(message, "success"))
2421
- writer.uint32(/* id 2, wireType 0 =*/ 16).bool(message.success);
2422
- if (message.message != null && Object.hasOwnProperty.call(message, "message"))
2423
- writer.uint32(/* id 3, wireType 2 =*/ 26).string(message.message);
2424
- return writer;
2425
- };
2426
- /**
2427
- * Encodes the specified UpdateResult message, length delimited. Does not implicitly {@link science.UpdateResult.verify|verify} messages.
2428
- * @function encodeDelimited
2429
- * @memberof science.UpdateResult
2430
- * @static
2431
- * @param {science.IUpdateResult} message UpdateResult message or plain object to encode
2432
- * @param {$protobuf.Writer} [writer] Writer to encode to
2433
- * @returns {$protobuf.Writer} Writer
2434
- */
2435
- UpdateResult.encodeDelimited = function encodeDelimited(message, writer) {
2436
- return this.encode(message, writer).ldelim();
2437
- };
2438
- /**
2439
- * Decodes an UpdateResult message from the specified reader or buffer.
2440
- * @function decode
2441
- * @memberof science.UpdateResult
2442
- * @static
2443
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2444
- * @param {number} [length] Message length if known beforehand
2445
- * @returns {science.UpdateResult} UpdateResult
2446
- * @throws {Error} If the payload is not a reader or valid buffer
2447
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
2448
- */
2449
- UpdateResult.decode = function decode(reader, length) {
2450
- if (!(reader instanceof $Reader))
2451
- reader = $Reader.create(reader);
2452
- var end = length === undefined ? reader.len : reader.pos + length, message = new $root.science.UpdateResult();
2453
- while (reader.pos < end) {
2454
- var tag = reader.uint32();
2455
- switch (tag >>> 3) {
2456
- case 1: {
2457
- message.name = reader.string();
2458
- break;
2459
- }
2460
- case 2: {
2461
- message.success = reader.bool();
2462
- break;
2463
- }
2464
- case 3: {
2465
- message.message = reader.string();
2466
- break;
2467
- }
2468
- default:
2469
- reader.skipType(tag & 7);
2470
- break;
2471
- }
2472
- }
2473
- return message;
2474
- };
2475
- /**
2476
- * Decodes an UpdateResult message from the specified reader or buffer, length delimited.
2477
- * @function decodeDelimited
2478
- * @memberof science.UpdateResult
2479
- * @static
2480
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2481
- * @returns {science.UpdateResult} UpdateResult
2482
- * @throws {Error} If the payload is not a reader or valid buffer
2483
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
2484
- */
2485
- UpdateResult.decodeDelimited = function decodeDelimited(reader) {
2486
- if (!(reader instanceof $Reader))
2487
- reader = new $Reader(reader);
2488
- return this.decode(reader, reader.uint32());
2489
- };
2490
- /**
2491
- * Verifies an UpdateResult message.
2492
- * @function verify
2493
- * @memberof science.UpdateResult
2494
- * @static
2495
- * @param {Object.<string,*>} message Plain object to verify
2496
- * @returns {string|null} `null` if valid, otherwise the reason why it is not
2497
- */
2498
- UpdateResult.verify = function verify(message) {
2499
- if (typeof message !== "object" || message === null)
2500
- return "object expected";
2501
- if (message.name != null && message.hasOwnProperty("name"))
2502
- if (!$util.isString(message.name))
2503
- return "name: string expected";
2504
- if (message.success != null && message.hasOwnProperty("success"))
2505
- if (typeof message.success !== "boolean")
2506
- return "success: boolean expected";
2507
- if (message.message != null && message.hasOwnProperty("message"))
2508
- if (!$util.isString(message.message))
2509
- return "message: string expected";
2510
- return null;
2511
- };
2512
- /**
2513
- * Creates an UpdateResult message from a plain object. Also converts values to their respective internal types.
2514
- * @function fromObject
2515
- * @memberof science.UpdateResult
2516
- * @static
2517
- * @param {Object.<string,*>} object Plain object
2518
- * @returns {science.UpdateResult} UpdateResult
2519
- */
2520
- UpdateResult.fromObject = function fromObject(object) {
2521
- if (object instanceof $root.science.UpdateResult)
2522
- return object;
2523
- var message = new $root.science.UpdateResult();
2524
- if (object.name != null)
2525
- message.name = String(object.name);
2526
- if (object.success != null)
2527
- message.success = Boolean(object.success);
2528
- if (object.message != null)
2529
- message.message = String(object.message);
2530
- return message;
2531
- };
2532
- /**
2533
- * Creates a plain object from an UpdateResult message. Also converts values to other types if specified.
2534
- * @function toObject
2535
- * @memberof science.UpdateResult
2536
- * @static
2537
- * @param {science.UpdateResult} message UpdateResult
2538
- * @param {$protobuf.IConversionOptions} [options] Conversion options
2539
- * @returns {Object.<string,*>} Plain object
2540
- */
2541
- UpdateResult.toObject = function toObject(message, options) {
2542
- if (!options)
2543
- options = {};
2544
- var object = {};
2545
- if (options.defaults) {
2546
- object.name = "";
2547
- object.success = false;
2548
- object.message = "";
2549
- }
2550
- if (message.name != null && message.hasOwnProperty("name"))
2551
- object.name = message.name;
2552
- if (message.success != null && message.hasOwnProperty("success"))
2553
- object.success = message.success;
2554
- if (message.message != null && message.hasOwnProperty("message"))
2555
- object.message = message.message;
2556
- return object;
2557
- };
2558
- /**
2559
- * Converts this UpdateResult to JSON.
2560
- * @function toJSON
2561
- * @memberof science.UpdateResult
2562
- * @instance
2563
- * @returns {Object.<string,*>} JSON object
2564
- */
2565
- UpdateResult.prototype.toJSON = function toJSON() {
2566
- return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
2567
- };
2568
- /**
2569
- * Gets the default type url for UpdateResult
2570
- * @function getTypeUrl
2571
- * @memberof science.UpdateResult
2572
- * @static
2573
- * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
2574
- * @returns {string} The default type url
2575
- */
2576
- UpdateResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
2577
- if (typeUrlPrefix === undefined) {
2578
- typeUrlPrefix = "type.googleapis.com";
2579
- }
2580
- return typeUrlPrefix + "/science.UpdateResult";
2581
- };
2582
- return UpdateResult;
2583
- })();
2584
- science.UpdatePackageChunk = (function () {
2585
- /**
2586
- * Properties of an UpdatePackageChunk.
2587
- * @memberof science
2588
- * @interface IUpdatePackageChunk
2589
- * @property {science.IPackageMetadata|null} [metadata] UpdatePackageChunk metadata
2590
- * @property {Uint8Array|null} [fileChunk] UpdatePackageChunk fileChunk
2591
- */
2592
- /**
2593
- * Constructs a new UpdatePackageChunk.
2594
- * @memberof science
2595
- * @classdesc Represents an UpdatePackageChunk.
2596
- * @implements IUpdatePackageChunk
2597
- * @constructor
2598
- * @param {science.IUpdatePackageChunk=} [properties] Properties to set
2599
- */
2600
- function UpdatePackageChunk(properties) {
2601
- if (properties)
2602
- for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
2603
- if (properties[keys[i]] != null)
2604
- this[keys[i]] = properties[keys[i]];
2605
- }
2606
- /**
2607
- * UpdatePackageChunk metadata.
2608
- * @member {science.IPackageMetadata|null|undefined} metadata
2609
- * @memberof science.UpdatePackageChunk
2610
- * @instance
2611
- */
2612
- UpdatePackageChunk.prototype.metadata = null;
2613
- /**
2614
- * UpdatePackageChunk fileChunk.
2615
- * @member {Uint8Array|null|undefined} fileChunk
2616
- * @memberof science.UpdatePackageChunk
2617
- * @instance
2618
- */
2619
- UpdatePackageChunk.prototype.fileChunk = null;
2620
- // OneOf field names bound to virtual getters and setters
2621
- var $oneOfFields;
2622
- /**
2623
- * UpdatePackageChunk data.
2624
- * @member {"metadata"|"fileChunk"|undefined} data
2625
- * @memberof science.UpdatePackageChunk
2626
- * @instance
2627
- */
2628
- Object.defineProperty(UpdatePackageChunk.prototype, "data", {
2629
- get: $util.oneOfGetter($oneOfFields = ["metadata", "fileChunk"]),
2630
- set: $util.oneOfSetter($oneOfFields)
2631
- });
2632
- /**
2633
- * Creates a new UpdatePackageChunk instance using the specified properties.
2634
- * @function create
2635
- * @memberof science.UpdatePackageChunk
2636
- * @static
2637
- * @param {science.IUpdatePackageChunk=} [properties] Properties to set
2638
- * @returns {science.UpdatePackageChunk} UpdatePackageChunk instance
2639
- */
2640
- UpdatePackageChunk.create = function create(properties) {
2641
- return new UpdatePackageChunk(properties);
2642
- };
2643
- /**
2644
- * Encodes the specified UpdatePackageChunk message. Does not implicitly {@link science.UpdatePackageChunk.verify|verify} messages.
2645
- * @function encode
2646
- * @memberof science.UpdatePackageChunk
2647
- * @static
2648
- * @param {science.IUpdatePackageChunk} message UpdatePackageChunk message or plain object to encode
2649
- * @param {$protobuf.Writer} [writer] Writer to encode to
2650
- * @returns {$protobuf.Writer} Writer
2651
- */
2652
- UpdatePackageChunk.encode = function encode(message, writer) {
2653
- if (!writer)
2654
- writer = $Writer.create();
2655
- if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata"))
2656
- $root.science.PackageMetadata.encode(message.metadata, writer.uint32(/* id 1, wireType 2 =*/ 10).fork()).ldelim();
2657
- if (message.fileChunk != null && Object.hasOwnProperty.call(message, "fileChunk"))
2658
- writer.uint32(/* id 2, wireType 2 =*/ 18).bytes(message.fileChunk);
2659
- return writer;
2660
- };
2661
- /**
2662
- * Encodes the specified UpdatePackageChunk message, length delimited. Does not implicitly {@link science.UpdatePackageChunk.verify|verify} messages.
2663
- * @function encodeDelimited
2664
- * @memberof science.UpdatePackageChunk
2665
- * @static
2666
- * @param {science.IUpdatePackageChunk} message UpdatePackageChunk message or plain object to encode
2667
- * @param {$protobuf.Writer} [writer] Writer to encode to
2668
- * @returns {$protobuf.Writer} Writer
2669
- */
2670
- UpdatePackageChunk.encodeDelimited = function encodeDelimited(message, writer) {
2671
- return this.encode(message, writer).ldelim();
2672
- };
2673
- /**
2674
- * Decodes an UpdatePackageChunk message from the specified reader or buffer.
2675
- * @function decode
2676
- * @memberof science.UpdatePackageChunk
2677
- * @static
2678
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2679
- * @param {number} [length] Message length if known beforehand
2680
- * @returns {science.UpdatePackageChunk} UpdatePackageChunk
2681
- * @throws {Error} If the payload is not a reader or valid buffer
2682
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
2683
- */
2684
- UpdatePackageChunk.decode = function decode(reader, length) {
2685
- if (!(reader instanceof $Reader))
2686
- reader = $Reader.create(reader);
2687
- var end = length === undefined ? reader.len : reader.pos + length, message = new $root.science.UpdatePackageChunk();
2688
- while (reader.pos < end) {
2689
- var tag = reader.uint32();
2690
- switch (tag >>> 3) {
2691
- case 1: {
2692
- message.metadata = $root.science.PackageMetadata.decode(reader, reader.uint32());
2693
- break;
2694
- }
2695
- case 2: {
2696
- message.fileChunk = reader.bytes();
2697
- break;
2698
- }
2699
- default:
2700
- reader.skipType(tag & 7);
2701
- break;
2702
- }
2703
- }
2704
- return message;
2705
- };
2706
- /**
2707
- * Decodes an UpdatePackageChunk message from the specified reader or buffer, length delimited.
2708
- * @function decodeDelimited
2709
- * @memberof science.UpdatePackageChunk
2710
- * @static
2711
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2712
- * @returns {science.UpdatePackageChunk} UpdatePackageChunk
2713
- * @throws {Error} If the payload is not a reader or valid buffer
2714
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
2715
- */
2716
- UpdatePackageChunk.decodeDelimited = function decodeDelimited(reader) {
2717
- if (!(reader instanceof $Reader))
2718
- reader = new $Reader(reader);
2719
- return this.decode(reader, reader.uint32());
2720
- };
2721
- /**
2722
- * Verifies an UpdatePackageChunk message.
2723
- * @function verify
2724
- * @memberof science.UpdatePackageChunk
2725
- * @static
2726
- * @param {Object.<string,*>} message Plain object to verify
2727
- * @returns {string|null} `null` if valid, otherwise the reason why it is not
2728
- */
2729
- UpdatePackageChunk.verify = function verify(message) {
2730
- if (typeof message !== "object" || message === null)
2731
- return "object expected";
2732
- var properties = {};
2733
- if (message.metadata != null && message.hasOwnProperty("metadata")) {
2734
- properties.data = 1;
2735
- {
2736
- var error = $root.science.PackageMetadata.verify(message.metadata);
2737
- if (error)
2738
- return "metadata." + error;
2739
- }
2740
- }
2741
- if (message.fileChunk != null && message.hasOwnProperty("fileChunk")) {
2742
- if (properties.data === 1)
2743
- return "data: multiple values";
2744
- properties.data = 1;
2745
- if (!(message.fileChunk && typeof message.fileChunk.length === "number" || $util.isString(message.fileChunk)))
2746
- return "fileChunk: buffer expected";
2747
- }
2748
- return null;
2749
- };
2750
- /**
2751
- * Creates an UpdatePackageChunk message from a plain object. Also converts values to their respective internal types.
2752
- * @function fromObject
2753
- * @memberof science.UpdatePackageChunk
2754
- * @static
2755
- * @param {Object.<string,*>} object Plain object
2756
- * @returns {science.UpdatePackageChunk} UpdatePackageChunk
2757
- */
2758
- UpdatePackageChunk.fromObject = function fromObject(object) {
2759
- if (object instanceof $root.science.UpdatePackageChunk)
2760
- return object;
2761
- var message = new $root.science.UpdatePackageChunk();
2762
- if (object.metadata != null) {
2763
- if (typeof object.metadata !== "object")
2764
- throw TypeError(".science.UpdatePackageChunk.metadata: object expected");
2765
- message.metadata = $root.science.PackageMetadata.fromObject(object.metadata);
2766
- }
2767
- if (object.fileChunk != null)
2768
- if (typeof object.fileChunk === "string")
2769
- $util.base64.decode(object.fileChunk, message.fileChunk = $util.newBuffer($util.base64.length(object.fileChunk)), 0);
2770
- else if (object.fileChunk.length >= 0)
2771
- message.fileChunk = object.fileChunk;
2772
- return message;
2773
- };
2774
- /**
2775
- * Creates a plain object from an UpdatePackageChunk message. Also converts values to other types if specified.
2776
- * @function toObject
2777
- * @memberof science.UpdatePackageChunk
2778
- * @static
2779
- * @param {science.UpdatePackageChunk} message UpdatePackageChunk
2780
- * @param {$protobuf.IConversionOptions} [options] Conversion options
2781
- * @returns {Object.<string,*>} Plain object
2782
- */
2783
- UpdatePackageChunk.toObject = function toObject(message, options) {
2784
- if (!options)
2785
- options = {};
2786
- var object = {};
2787
- if (message.metadata != null && message.hasOwnProperty("metadata")) {
2788
- object.metadata = $root.science.PackageMetadata.toObject(message.metadata, options);
2789
- if (options.oneofs)
2790
- object.data = "metadata";
2791
- }
2792
- if (message.fileChunk != null && message.hasOwnProperty("fileChunk")) {
2793
- object.fileChunk = options.bytes === String ? $util.base64.encode(message.fileChunk, 0, message.fileChunk.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileChunk) : message.fileChunk;
2794
- if (options.oneofs)
2795
- object.data = "fileChunk";
2796
- }
2797
- return object;
2798
- };
2799
- /**
2800
- * Converts this UpdatePackageChunk to JSON.
2801
- * @function toJSON
2802
- * @memberof science.UpdatePackageChunk
2803
- * @instance
2804
- * @returns {Object.<string,*>} JSON object
2805
- */
2806
- UpdatePackageChunk.prototype.toJSON = function toJSON() {
2807
- return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
2808
- };
2809
- /**
2810
- * Gets the default type url for UpdatePackageChunk
2811
- * @function getTypeUrl
2812
- * @memberof science.UpdatePackageChunk
2813
- * @static
2814
- * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
2815
- * @returns {string} The default type url
2816
- */
2817
- UpdatePackageChunk.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
2818
- if (typeUrlPrefix === undefined) {
2819
- typeUrlPrefix = "type.googleapis.com";
2820
- }
2821
- return typeUrlPrefix + "/science.UpdatePackageChunk";
2822
- };
2823
- return UpdatePackageChunk;
2824
- })();
2825
- science.PackageMetadata = (function () {
2826
- /**
2827
- * Properties of a PackageMetadata.
2828
- * @memberof science
2829
- * @interface IPackageMetadata
2830
- * @property {string|null} [name] PackageMetadata name
2831
- * @property {string|null} [version] PackageMetadata version
2832
- * @property {Long|null} [size] PackageMetadata size
2833
- * @property {string|null} [sha256Sum] PackageMetadata sha256Sum
2834
- */
2835
- /**
2836
- * Constructs a new PackageMetadata.
2837
- * @memberof science
2838
- * @classdesc Represents a PackageMetadata.
2839
- * @implements IPackageMetadata
2840
- * @constructor
2841
- * @param {science.IPackageMetadata=} [properties] Properties to set
2842
- */
2843
- function PackageMetadata(properties) {
2844
- if (properties)
2845
- for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
2846
- if (properties[keys[i]] != null)
2847
- this[keys[i]] = properties[keys[i]];
2848
- }
2849
- /**
2850
- * PackageMetadata name.
2851
- * @member {string} name
2852
- * @memberof science.PackageMetadata
2853
- * @instance
2854
- */
2855
- PackageMetadata.prototype.name = "";
2856
- /**
2857
- * PackageMetadata version.
2858
- * @member {string} version
2859
- * @memberof science.PackageMetadata
2860
- * @instance
2861
- */
2862
- PackageMetadata.prototype.version = "";
2863
- /**
2864
- * PackageMetadata size.
2865
- * @member {Long} size
2866
- * @memberof science.PackageMetadata
2867
- * @instance
2868
- */
2869
- PackageMetadata.prototype.size = $util.Long ? $util.Long.fromBits(0, 0, true) : 0;
2870
- /**
2871
- * PackageMetadata sha256Sum.
2872
- * @member {string} sha256Sum
2873
- * @memberof science.PackageMetadata
2874
- * @instance
2875
- */
2876
- PackageMetadata.prototype.sha256Sum = "";
2877
- /**
2878
- * Creates a new PackageMetadata instance using the specified properties.
2879
- * @function create
2880
- * @memberof science.PackageMetadata
2881
- * @static
2882
- * @param {science.IPackageMetadata=} [properties] Properties to set
2883
- * @returns {science.PackageMetadata} PackageMetadata instance
2884
- */
2885
- PackageMetadata.create = function create(properties) {
2886
- return new PackageMetadata(properties);
2887
- };
2888
- /**
2889
- * Encodes the specified PackageMetadata message. Does not implicitly {@link science.PackageMetadata.verify|verify} messages.
2890
- * @function encode
2891
- * @memberof science.PackageMetadata
2892
- * @static
2893
- * @param {science.IPackageMetadata} message PackageMetadata message or plain object to encode
2894
- * @param {$protobuf.Writer} [writer] Writer to encode to
2895
- * @returns {$protobuf.Writer} Writer
2896
- */
2897
- PackageMetadata.encode = function encode(message, writer) {
2898
- if (!writer)
2899
- writer = $Writer.create();
2900
- if (message.name != null && Object.hasOwnProperty.call(message, "name"))
2901
- writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.name);
2902
- if (message.version != null && Object.hasOwnProperty.call(message, "version"))
2903
- writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.version);
2904
- if (message.size != null && Object.hasOwnProperty.call(message, "size"))
2905
- writer.uint32(/* id 3, wireType 0 =*/ 24).uint64(message.size);
2906
- if (message.sha256Sum != null && Object.hasOwnProperty.call(message, "sha256Sum"))
2907
- writer.uint32(/* id 4, wireType 2 =*/ 34).string(message.sha256Sum);
2908
- return writer;
2909
- };
2910
- /**
2911
- * Encodes the specified PackageMetadata message, length delimited. Does not implicitly {@link science.PackageMetadata.verify|verify} messages.
2912
- * @function encodeDelimited
2913
- * @memberof science.PackageMetadata
2914
- * @static
2915
- * @param {science.IPackageMetadata} message PackageMetadata message or plain object to encode
2916
- * @param {$protobuf.Writer} [writer] Writer to encode to
2917
- * @returns {$protobuf.Writer} Writer
2918
- */
2919
- PackageMetadata.encodeDelimited = function encodeDelimited(message, writer) {
2920
- return this.encode(message, writer).ldelim();
2921
- };
2922
- /**
2923
- * Decodes a PackageMetadata message from the specified reader or buffer.
2924
- * @function decode
2925
- * @memberof science.PackageMetadata
2926
- * @static
2927
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2928
- * @param {number} [length] Message length if known beforehand
2929
- * @returns {science.PackageMetadata} PackageMetadata
2930
- * @throws {Error} If the payload is not a reader or valid buffer
2931
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
2932
- */
2933
- PackageMetadata.decode = function decode(reader, length) {
2934
- if (!(reader instanceof $Reader))
2935
- reader = $Reader.create(reader);
2936
- var end = length === undefined ? reader.len : reader.pos + length, message = new $root.science.PackageMetadata();
2937
- while (reader.pos < end) {
2938
- var tag = reader.uint32();
2939
- switch (tag >>> 3) {
2940
- case 1: {
2941
- message.name = reader.string();
2942
- break;
2943
- }
2944
- case 2: {
2945
- message.version = reader.string();
2946
- break;
2947
- }
2948
- case 3: {
2949
- message.size = reader.uint64();
2950
- break;
2951
- }
2952
- case 4: {
2953
- message.sha256Sum = reader.string();
2954
- break;
2955
- }
2956
- default:
2957
- reader.skipType(tag & 7);
2958
- break;
2959
- }
2960
- }
2961
- return message;
2962
- };
2963
- /**
2964
- * Decodes a PackageMetadata message from the specified reader or buffer, length delimited.
2965
- * @function decodeDelimited
2966
- * @memberof science.PackageMetadata
2967
- * @static
2968
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2969
- * @returns {science.PackageMetadata} PackageMetadata
2970
- * @throws {Error} If the payload is not a reader or valid buffer
2971
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
2972
- */
2973
- PackageMetadata.decodeDelimited = function decodeDelimited(reader) {
2974
- if (!(reader instanceof $Reader))
2975
- reader = new $Reader(reader);
2976
- return this.decode(reader, reader.uint32());
2977
- };
2978
- /**
2979
- * Verifies a PackageMetadata message.
2980
- * @function verify
2981
- * @memberof science.PackageMetadata
2982
- * @static
2983
- * @param {Object.<string,*>} message Plain object to verify
2984
- * @returns {string|null} `null` if valid, otherwise the reason why it is not
2985
- */
2986
- PackageMetadata.verify = function verify(message) {
2987
- if (typeof message !== "object" || message === null)
2988
- return "object expected";
2989
- if (message.name != null && message.hasOwnProperty("name"))
2990
- if (!$util.isString(message.name))
2991
- return "name: string expected";
2992
- if (message.version != null && message.hasOwnProperty("version"))
2993
- if (!$util.isString(message.version))
2994
- return "version: string expected";
2995
- if (message.size != null && message.hasOwnProperty("size"))
2996
- if (!$util.isInteger(message.size) && !(message.size && $util.isInteger(message.size.low) && $util.isInteger(message.size.high)))
2997
- return "size: integer|Long expected";
2998
- if (message.sha256Sum != null && message.hasOwnProperty("sha256Sum"))
2999
- if (!$util.isString(message.sha256Sum))
3000
- return "sha256Sum: string expected";
3001
- return null;
3002
- };
3003
- /**
3004
- * Creates a PackageMetadata message from a plain object. Also converts values to their respective internal types.
3005
- * @function fromObject
3006
- * @memberof science.PackageMetadata
3007
- * @static
3008
- * @param {Object.<string,*>} object Plain object
3009
- * @returns {science.PackageMetadata} PackageMetadata
3010
- */
3011
- PackageMetadata.fromObject = function fromObject(object) {
3012
- if (object instanceof $root.science.PackageMetadata)
3013
- return object;
3014
- var message = new $root.science.PackageMetadata();
3015
- if (object.name != null)
3016
- message.name = String(object.name);
3017
- if (object.version != null)
3018
- message.version = String(object.version);
3019
- if (object.size != null)
3020
- if ($util.Long)
3021
- (message.size = $util.Long.fromValue(object.size)).unsigned = true;
3022
- else if (typeof object.size === "string")
3023
- message.size = parseInt(object.size, 10);
3024
- else if (typeof object.size === "number")
3025
- message.size = object.size;
3026
- else if (typeof object.size === "object")
3027
- message.size = new $util.LongBits(object.size.low >>> 0, object.size.high >>> 0).toNumber(true);
3028
- if (object.sha256Sum != null)
3029
- message.sha256Sum = String(object.sha256Sum);
3030
- return message;
3031
- };
3032
- /**
3033
- * Creates a plain object from a PackageMetadata message. Also converts values to other types if specified.
3034
- * @function toObject
3035
- * @memberof science.PackageMetadata
3036
- * @static
3037
- * @param {science.PackageMetadata} message PackageMetadata
3038
- * @param {$protobuf.IConversionOptions} [options] Conversion options
3039
- * @returns {Object.<string,*>} Plain object
3040
- */
3041
- PackageMetadata.toObject = function toObject(message, options) {
3042
- if (!options)
3043
- options = {};
3044
- var object = {};
3045
- if (options.defaults) {
3046
- object.name = "";
3047
- object.version = "";
3048
- if ($util.Long) {
3049
- var long = new $util.Long(0, 0, true);
3050
- object.size = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
3051
- }
3052
- else
3053
- object.size = options.longs === String ? "0" : 0;
3054
- object.sha256Sum = "";
3055
- }
3056
- if (message.name != null && message.hasOwnProperty("name"))
3057
- object.name = message.name;
3058
- if (message.version != null && message.hasOwnProperty("version"))
3059
- object.version = message.version;
3060
- if (message.size != null && message.hasOwnProperty("size"))
3061
- if (typeof message.size === "number")
3062
- object.size = options.longs === String ? String(message.size) : message.size;
3063
- else
3064
- object.size = options.longs === String ? $util.Long.prototype.toString.call(message.size) : options.longs === Number ? new $util.LongBits(message.size.low >>> 0, message.size.high >>> 0).toNumber(true) : message.size;
3065
- if (message.sha256Sum != null && message.hasOwnProperty("sha256Sum"))
3066
- object.sha256Sum = message.sha256Sum;
3067
- return object;
3068
- };
3069
- /**
3070
- * Converts this PackageMetadata to JSON.
3071
- * @function toJSON
3072
- * @memberof science.PackageMetadata
3073
- * @instance
3074
- * @returns {Object.<string,*>} JSON object
3075
- */
3076
- PackageMetadata.prototype.toJSON = function toJSON() {
3077
- return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
3078
- };
3079
- /**
3080
- * Gets the default type url for PackageMetadata
3081
- * @function getTypeUrl
3082
- * @memberof science.PackageMetadata
3083
- * @static
3084
- * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
3085
- * @returns {string} The default type url
3086
- */
3087
- PackageMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
3088
- if (typeUrlPrefix === undefined) {
3089
- typeUrlPrefix = "type.googleapis.com";
3090
- }
3091
- return typeUrlPrefix + "/science.PackageMetadata";
3092
- };
3093
- return PackageMetadata;
3094
- })();
3095
- science.PackageInfo = (function () {
3096
- /**
3097
- * Properties of a PackageInfo.
3098
- * @memberof science
3099
- * @interface IPackageInfo
3100
- * @property {string|null} [name] PackageInfo name
3101
- * @property {string|null} [installedVersion] PackageInfo installedVersion
3102
- * @property {string|null} [latestVersion] PackageInfo latestVersion
3103
- */
3104
- /**
3105
- * Constructs a new PackageInfo.
3106
- * @memberof science
3107
- * @classdesc Represents a PackageInfo.
3108
- * @implements IPackageInfo
3109
- * @constructor
3110
- * @param {science.IPackageInfo=} [properties] Properties to set
3111
- */
3112
- function PackageInfo(properties) {
3113
- if (properties)
3114
- for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
3115
- if (properties[keys[i]] != null)
3116
- this[keys[i]] = properties[keys[i]];
3117
- }
3118
- /**
3119
- * PackageInfo name.
3120
- * @member {string} name
3121
- * @memberof science.PackageInfo
3122
- * @instance
3123
- */
3124
- PackageInfo.prototype.name = "";
3125
- /**
3126
- * PackageInfo installedVersion.
3127
- * @member {string} installedVersion
3128
- * @memberof science.PackageInfo
3129
- * @instance
3130
- */
3131
- PackageInfo.prototype.installedVersion = "";
3132
- /**
3133
- * PackageInfo latestVersion.
3134
- * @member {string} latestVersion
3135
- * @memberof science.PackageInfo
3136
- * @instance
3137
- */
3138
- PackageInfo.prototype.latestVersion = "";
3139
- /**
3140
- * Creates a new PackageInfo instance using the specified properties.
3141
- * @function create
3142
- * @memberof science.PackageInfo
3143
- * @static
3144
- * @param {science.IPackageInfo=} [properties] Properties to set
3145
- * @returns {science.PackageInfo} PackageInfo instance
3146
- */
3147
- PackageInfo.create = function create(properties) {
3148
- return new PackageInfo(properties);
3149
- };
3150
- /**
3151
- * Encodes the specified PackageInfo message. Does not implicitly {@link science.PackageInfo.verify|verify} messages.
3152
- * @function encode
3153
- * @memberof science.PackageInfo
3154
- * @static
3155
- * @param {science.IPackageInfo} message PackageInfo message or plain object to encode
3156
- * @param {$protobuf.Writer} [writer] Writer to encode to
3157
- * @returns {$protobuf.Writer} Writer
3158
- */
3159
- PackageInfo.encode = function encode(message, writer) {
3160
- if (!writer)
3161
- writer = $Writer.create();
3162
- if (message.name != null && Object.hasOwnProperty.call(message, "name"))
3163
- writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.name);
3164
- if (message.installedVersion != null && Object.hasOwnProperty.call(message, "installedVersion"))
3165
- writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.installedVersion);
3166
- if (message.latestVersion != null && Object.hasOwnProperty.call(message, "latestVersion"))
3167
- writer.uint32(/* id 3, wireType 2 =*/ 26).string(message.latestVersion);
3168
- return writer;
3169
- };
3170
- /**
3171
- * Encodes the specified PackageInfo message, length delimited. Does not implicitly {@link science.PackageInfo.verify|verify} messages.
3172
- * @function encodeDelimited
3173
- * @memberof science.PackageInfo
3174
- * @static
3175
- * @param {science.IPackageInfo} message PackageInfo message or plain object to encode
3176
- * @param {$protobuf.Writer} [writer] Writer to encode to
3177
- * @returns {$protobuf.Writer} Writer
3178
- */
3179
- PackageInfo.encodeDelimited = function encodeDelimited(message, writer) {
3180
- return this.encode(message, writer).ldelim();
3181
- };
3182
- /**
3183
- * Decodes a PackageInfo message from the specified reader or buffer.
3184
- * @function decode
3185
- * @memberof science.PackageInfo
3186
- * @static
3187
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
3188
- * @param {number} [length] Message length if known beforehand
3189
- * @returns {science.PackageInfo} PackageInfo
3190
- * @throws {Error} If the payload is not a reader or valid buffer
3191
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
3192
- */
3193
- PackageInfo.decode = function decode(reader, length) {
3194
- if (!(reader instanceof $Reader))
3195
- reader = $Reader.create(reader);
3196
- var end = length === undefined ? reader.len : reader.pos + length, message = new $root.science.PackageInfo();
3197
- while (reader.pos < end) {
3198
- var tag = reader.uint32();
3199
- switch (tag >>> 3) {
3200
- case 1: {
3201
- message.name = reader.string();
3202
- break;
3203
- }
3204
- case 2: {
3205
- message.installedVersion = reader.string();
3206
- break;
3207
- }
3208
- case 3: {
3209
- message.latestVersion = reader.string();
3210
- break;
3211
- }
3212
- default:
3213
- reader.skipType(tag & 7);
3214
- break;
3215
- }
3216
- }
3217
- return message;
3218
- };
3219
- /**
3220
- * Decodes a PackageInfo message from the specified reader or buffer, length delimited.
3221
- * @function decodeDelimited
3222
- * @memberof science.PackageInfo
3223
- * @static
3224
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
3225
- * @returns {science.PackageInfo} PackageInfo
3226
- * @throws {Error} If the payload is not a reader or valid buffer
3227
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
3228
- */
3229
- PackageInfo.decodeDelimited = function decodeDelimited(reader) {
3230
- if (!(reader instanceof $Reader))
3231
- reader = new $Reader(reader);
3232
- return this.decode(reader, reader.uint32());
3233
- };
3234
- /**
3235
- * Verifies a PackageInfo message.
3236
- * @function verify
3237
- * @memberof science.PackageInfo
3238
- * @static
3239
- * @param {Object.<string,*>} message Plain object to verify
3240
- * @returns {string|null} `null` if valid, otherwise the reason why it is not
3241
- */
3242
- PackageInfo.verify = function verify(message) {
3243
- if (typeof message !== "object" || message === null)
3244
- return "object expected";
3245
- if (message.name != null && message.hasOwnProperty("name"))
3246
- if (!$util.isString(message.name))
3247
- return "name: string expected";
3248
- if (message.installedVersion != null && message.hasOwnProperty("installedVersion"))
3249
- if (!$util.isString(message.installedVersion))
3250
- return "installedVersion: string expected";
3251
- if (message.latestVersion != null && message.hasOwnProperty("latestVersion"))
3252
- if (!$util.isString(message.latestVersion))
3253
- return "latestVersion: string expected";
3254
- return null;
3255
- };
3256
- /**
3257
- * Creates a PackageInfo message from a plain object. Also converts values to their respective internal types.
3258
- * @function fromObject
3259
- * @memberof science.PackageInfo
3260
- * @static
3261
- * @param {Object.<string,*>} object Plain object
3262
- * @returns {science.PackageInfo} PackageInfo
3263
- */
3264
- PackageInfo.fromObject = function fromObject(object) {
3265
- if (object instanceof $root.science.PackageInfo)
3266
- return object;
3267
- var message = new $root.science.PackageInfo();
3268
- if (object.name != null)
3269
- message.name = String(object.name);
3270
- if (object.installedVersion != null)
3271
- message.installedVersion = String(object.installedVersion);
3272
- if (object.latestVersion != null)
3273
- message.latestVersion = String(object.latestVersion);
3274
- return message;
3275
- };
3276
- /**
3277
- * Creates a plain object from a PackageInfo message. Also converts values to other types if specified.
3278
- * @function toObject
3279
- * @memberof science.PackageInfo
3280
- * @static
3281
- * @param {science.PackageInfo} message PackageInfo
3282
- * @param {$protobuf.IConversionOptions} [options] Conversion options
3283
- * @returns {Object.<string,*>} Plain object
3284
- */
3285
- PackageInfo.toObject = function toObject(message, options) {
3286
- if (!options)
3287
- options = {};
3288
- var object = {};
3289
- if (options.defaults) {
3290
- object.name = "";
3291
- object.installedVersion = "";
3292
- object.latestVersion = "";
3293
- }
3294
- if (message.name != null && message.hasOwnProperty("name"))
3295
- object.name = message.name;
3296
- if (message.installedVersion != null && message.hasOwnProperty("installedVersion"))
3297
- object.installedVersion = message.installedVersion;
3298
- if (message.latestVersion != null && message.hasOwnProperty("latestVersion"))
3299
- object.latestVersion = message.latestVersion;
3300
- return object;
3301
- };
3302
- /**
3303
- * Converts this PackageInfo to JSON.
3304
- * @function toJSON
3305
- * @memberof science.PackageInfo
3306
- * @instance
3307
- * @returns {Object.<string,*>} JSON object
3308
- */
3309
- PackageInfo.prototype.toJSON = function toJSON() {
3310
- return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
3311
- };
3312
- /**
3313
- * Gets the default type url for PackageInfo
3314
- * @function getTypeUrl
3315
- * @memberof science.PackageInfo
3316
- * @static
3317
- * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
3318
- * @returns {string} The default type url
3319
- */
3320
- PackageInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
3321
- if (typeUrlPrefix === undefined) {
3322
- typeUrlPrefix = "type.googleapis.com";
3323
- }
3324
- return typeUrlPrefix + "/science.PackageInfo";
3325
- };
3326
- return PackageInfo;
3327
- })();
3328
- science.ListPackagesRequest = (function () {
3329
- /**
3330
- * Properties of a ListPackagesRequest.
3331
- * @memberof science
3332
- * @interface IListPackagesRequest
3333
- */
3334
- /**
3335
- * Constructs a new ListPackagesRequest.
3336
- * @memberof science
3337
- * @classdesc Represents a ListPackagesRequest.
3338
- * @implements IListPackagesRequest
3339
- * @constructor
3340
- * @param {science.IListPackagesRequest=} [properties] Properties to set
3341
- */
3342
- function ListPackagesRequest(properties) {
3343
- if (properties)
3344
- for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
3345
- if (properties[keys[i]] != null)
3346
- this[keys[i]] = properties[keys[i]];
3347
- }
3348
- /**
3349
- * Creates a new ListPackagesRequest instance using the specified properties.
3350
- * @function create
3351
- * @memberof science.ListPackagesRequest
3352
- * @static
3353
- * @param {science.IListPackagesRequest=} [properties] Properties to set
3354
- * @returns {science.ListPackagesRequest} ListPackagesRequest instance
3355
- */
3356
- ListPackagesRequest.create = function create(properties) {
3357
- return new ListPackagesRequest(properties);
3358
- };
3359
- /**
3360
- * Encodes the specified ListPackagesRequest message. Does not implicitly {@link science.ListPackagesRequest.verify|verify} messages.
3361
- * @function encode
3362
- * @memberof science.ListPackagesRequest
3363
- * @static
3364
- * @param {science.IListPackagesRequest} message ListPackagesRequest message or plain object to encode
3365
- * @param {$protobuf.Writer} [writer] Writer to encode to
3366
- * @returns {$protobuf.Writer} Writer
3367
- */
3368
- ListPackagesRequest.encode = function encode(message, writer) {
3369
- if (!writer)
3370
- writer = $Writer.create();
3371
- return writer;
3372
- };
3373
- /**
3374
- * Encodes the specified ListPackagesRequest message, length delimited. Does not implicitly {@link science.ListPackagesRequest.verify|verify} messages.
3375
- * @function encodeDelimited
3376
- * @memberof science.ListPackagesRequest
3377
- * @static
3378
- * @param {science.IListPackagesRequest} message ListPackagesRequest message or plain object to encode
3379
- * @param {$protobuf.Writer} [writer] Writer to encode to
3380
- * @returns {$protobuf.Writer} Writer
3381
- */
3382
- ListPackagesRequest.encodeDelimited = function encodeDelimited(message, writer) {
3383
- return this.encode(message, writer).ldelim();
3384
- };
3385
- /**
3386
- * Decodes a ListPackagesRequest message from the specified reader or buffer.
3387
- * @function decode
3388
- * @memberof science.ListPackagesRequest
3389
- * @static
3390
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
3391
- * @param {number} [length] Message length if known beforehand
3392
- * @returns {science.ListPackagesRequest} ListPackagesRequest
3393
- * @throws {Error} If the payload is not a reader or valid buffer
3394
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
3395
- */
3396
- ListPackagesRequest.decode = function decode(reader, length) {
3397
- if (!(reader instanceof $Reader))
3398
- reader = $Reader.create(reader);
3399
- var end = length === undefined ? reader.len : reader.pos + length, message = new $root.science.ListPackagesRequest();
3400
- while (reader.pos < end) {
3401
- var tag = reader.uint32();
3402
- switch (tag >>> 3) {
3403
- default:
3404
- reader.skipType(tag & 7);
3405
- break;
3406
- }
3407
- }
3408
- return message;
3409
- };
3410
- /**
3411
- * Decodes a ListPackagesRequest message from the specified reader or buffer, length delimited.
3412
- * @function decodeDelimited
3413
- * @memberof science.ListPackagesRequest
3414
- * @static
3415
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
3416
- * @returns {science.ListPackagesRequest} ListPackagesRequest
3417
- * @throws {Error} If the payload is not a reader or valid buffer
3418
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
3419
- */
3420
- ListPackagesRequest.decodeDelimited = function decodeDelimited(reader) {
3421
- if (!(reader instanceof $Reader))
3422
- reader = new $Reader(reader);
3423
- return this.decode(reader, reader.uint32());
3424
- };
3425
- /**
3426
- * Verifies a ListPackagesRequest message.
3427
- * @function verify
3428
- * @memberof science.ListPackagesRequest
3429
- * @static
3430
- * @param {Object.<string,*>} message Plain object to verify
3431
- * @returns {string|null} `null` if valid, otherwise the reason why it is not
3432
- */
3433
- ListPackagesRequest.verify = function verify(message) {
3434
- if (typeof message !== "object" || message === null)
3435
- return "object expected";
3436
- return null;
3437
- };
3438
- /**
3439
- * Creates a ListPackagesRequest message from a plain object. Also converts values to their respective internal types.
3440
- * @function fromObject
3441
- * @memberof science.ListPackagesRequest
3442
- * @static
3443
- * @param {Object.<string,*>} object Plain object
3444
- * @returns {science.ListPackagesRequest} ListPackagesRequest
3445
- */
3446
- ListPackagesRequest.fromObject = function fromObject(object) {
3447
- if (object instanceof $root.science.ListPackagesRequest)
3448
- return object;
3449
- return new $root.science.ListPackagesRequest();
3450
- };
3451
- /**
3452
- * Creates a plain object from a ListPackagesRequest message. Also converts values to other types if specified.
3453
- * @function toObject
3454
- * @memberof science.ListPackagesRequest
3455
- * @static
3456
- * @param {science.ListPackagesRequest} message ListPackagesRequest
3457
- * @param {$protobuf.IConversionOptions} [options] Conversion options
3458
- * @returns {Object.<string,*>} Plain object
3459
- */
3460
- ListPackagesRequest.toObject = function toObject() {
3461
- return {};
3462
- };
3463
- /**
3464
- * Converts this ListPackagesRequest to JSON.
3465
- * @function toJSON
3466
- * @memberof science.ListPackagesRequest
3467
- * @instance
3468
- * @returns {Object.<string,*>} JSON object
3469
- */
3470
- ListPackagesRequest.prototype.toJSON = function toJSON() {
3471
- return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
3472
- };
3473
- /**
3474
- * Gets the default type url for ListPackagesRequest
3475
- * @function getTypeUrl
3476
- * @memberof science.ListPackagesRequest
3477
- * @static
3478
- * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
3479
- * @returns {string} The default type url
3480
- */
3481
- ListPackagesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
3482
- if (typeUrlPrefix === undefined) {
3483
- typeUrlPrefix = "type.googleapis.com";
3484
- }
3485
- return typeUrlPrefix + "/science.ListPackagesRequest";
3486
- };
3487
- return ListPackagesRequest;
3488
- })();
3489
- science.ListPackagesResponse = (function () {
3490
- /**
3491
- * Properties of a ListPackagesResponse.
3492
- * @memberof science
3493
- * @interface IListPackagesResponse
3494
- * @property {Array.<science.IPackageInfo>|null} [packages] ListPackagesResponse packages
3495
- */
3496
- /**
3497
- * Constructs a new ListPackagesResponse.
3498
- * @memberof science
3499
- * @classdesc Represents a ListPackagesResponse.
3500
- * @implements IListPackagesResponse
3501
- * @constructor
3502
- * @param {science.IListPackagesResponse=} [properties] Properties to set
3503
- */
3504
- function ListPackagesResponse(properties) {
3505
- this.packages = [];
3506
- if (properties)
3507
- for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
3508
- if (properties[keys[i]] != null)
3509
- this[keys[i]] = properties[keys[i]];
3510
- }
3511
- /**
3512
- * ListPackagesResponse packages.
3513
- * @member {Array.<science.IPackageInfo>} packages
3514
- * @memberof science.ListPackagesResponse
3515
- * @instance
3516
- */
3517
- ListPackagesResponse.prototype.packages = $util.emptyArray;
3518
- /**
3519
- * Creates a new ListPackagesResponse instance using the specified properties.
3520
- * @function create
3521
- * @memberof science.ListPackagesResponse
3522
- * @static
3523
- * @param {science.IListPackagesResponse=} [properties] Properties to set
3524
- * @returns {science.ListPackagesResponse} ListPackagesResponse instance
3525
- */
3526
- ListPackagesResponse.create = function create(properties) {
3527
- return new ListPackagesResponse(properties);
3528
- };
3529
- /**
3530
- * Encodes the specified ListPackagesResponse message. Does not implicitly {@link science.ListPackagesResponse.verify|verify} messages.
3531
- * @function encode
3532
- * @memberof science.ListPackagesResponse
3533
- * @static
3534
- * @param {science.IListPackagesResponse} message ListPackagesResponse message or plain object to encode
3535
- * @param {$protobuf.Writer} [writer] Writer to encode to
3536
- * @returns {$protobuf.Writer} Writer
3537
- */
3538
- ListPackagesResponse.encode = function encode(message, writer) {
3539
- if (!writer)
3540
- writer = $Writer.create();
3541
- if (message.packages != null && message.packages.length)
3542
- for (var i = 0; i < message.packages.length; ++i)
3543
- $root.science.PackageInfo.encode(message.packages[i], writer.uint32(/* id 1, wireType 2 =*/ 10).fork()).ldelim();
3544
- return writer;
3545
- };
3546
- /**
3547
- * Encodes the specified ListPackagesResponse message, length delimited. Does not implicitly {@link science.ListPackagesResponse.verify|verify} messages.
3548
- * @function encodeDelimited
3549
- * @memberof science.ListPackagesResponse
3550
- * @static
3551
- * @param {science.IListPackagesResponse} message ListPackagesResponse message or plain object to encode
3552
- * @param {$protobuf.Writer} [writer] Writer to encode to
3553
- * @returns {$protobuf.Writer} Writer
3554
- */
3555
- ListPackagesResponse.encodeDelimited = function encodeDelimited(message, writer) {
3556
- return this.encode(message, writer).ldelim();
3557
- };
3558
- /**
3559
- * Decodes a ListPackagesResponse message from the specified reader or buffer.
3560
- * @function decode
3561
- * @memberof science.ListPackagesResponse
3562
- * @static
3563
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
3564
- * @param {number} [length] Message length if known beforehand
3565
- * @returns {science.ListPackagesResponse} ListPackagesResponse
3566
- * @throws {Error} If the payload is not a reader or valid buffer
3567
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
3568
- */
3569
- ListPackagesResponse.decode = function decode(reader, length) {
3570
- if (!(reader instanceof $Reader))
3571
- reader = $Reader.create(reader);
3572
- var end = length === undefined ? reader.len : reader.pos + length, message = new $root.science.ListPackagesResponse();
3573
- while (reader.pos < end) {
3574
- var tag = reader.uint32();
3575
- switch (tag >>> 3) {
3576
- case 1: {
3577
- if (!(message.packages && message.packages.length))
3578
- message.packages = [];
3579
- message.packages.push($root.science.PackageInfo.decode(reader, reader.uint32()));
3580
- break;
3581
- }
3582
- default:
3583
- reader.skipType(tag & 7);
3584
- break;
3585
- }
3586
- }
3587
- return message;
3588
- };
3589
- /**
3590
- * Decodes a ListPackagesResponse message from the specified reader or buffer, length delimited.
3591
- * @function decodeDelimited
3592
- * @memberof science.ListPackagesResponse
3593
- * @static
3594
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
3595
- * @returns {science.ListPackagesResponse} ListPackagesResponse
3596
- * @throws {Error} If the payload is not a reader or valid buffer
3597
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
3598
- */
3599
- ListPackagesResponse.decodeDelimited = function decodeDelimited(reader) {
3600
- if (!(reader instanceof $Reader))
3601
- reader = new $Reader(reader);
3602
- return this.decode(reader, reader.uint32());
3603
- };
3604
- /**
3605
- * Verifies a ListPackagesResponse message.
3606
- * @function verify
3607
- * @memberof science.ListPackagesResponse
3608
- * @static
3609
- * @param {Object.<string,*>} message Plain object to verify
3610
- * @returns {string|null} `null` if valid, otherwise the reason why it is not
3611
- */
3612
- ListPackagesResponse.verify = function verify(message) {
3613
- if (typeof message !== "object" || message === null)
3614
- return "object expected";
3615
- if (message.packages != null && message.hasOwnProperty("packages")) {
3616
- if (!Array.isArray(message.packages))
3617
- return "packages: array expected";
3618
- for (var i = 0; i < message.packages.length; ++i) {
3619
- var error = $root.science.PackageInfo.verify(message.packages[i]);
3620
- if (error)
3621
- return "packages." + error;
3622
- }
3623
- }
3624
- return null;
3625
- };
3626
- /**
3627
- * Creates a ListPackagesResponse message from a plain object. Also converts values to their respective internal types.
3628
- * @function fromObject
3629
- * @memberof science.ListPackagesResponse
3630
- * @static
3631
- * @param {Object.<string,*>} object Plain object
3632
- * @returns {science.ListPackagesResponse} ListPackagesResponse
3633
- */
3634
- ListPackagesResponse.fromObject = function fromObject(object) {
3635
- if (object instanceof $root.science.ListPackagesResponse)
3636
- return object;
3637
- var message = new $root.science.ListPackagesResponse();
3638
- if (object.packages) {
3639
- if (!Array.isArray(object.packages))
3640
- throw TypeError(".science.ListPackagesResponse.packages: array expected");
3641
- message.packages = [];
3642
- for (var i = 0; i < object.packages.length; ++i) {
3643
- if (typeof object.packages[i] !== "object")
3644
- throw TypeError(".science.ListPackagesResponse.packages: object expected");
3645
- message.packages[i] = $root.science.PackageInfo.fromObject(object.packages[i]);
3646
- }
3647
- }
3648
- return message;
3649
- };
3650
- /**
3651
- * Creates a plain object from a ListPackagesResponse message. Also converts values to other types if specified.
3652
- * @function toObject
3653
- * @memberof science.ListPackagesResponse
3654
- * @static
3655
- * @param {science.ListPackagesResponse} message ListPackagesResponse
3656
- * @param {$protobuf.IConversionOptions} [options] Conversion options
3657
- * @returns {Object.<string,*>} Plain object
3658
- */
3659
- ListPackagesResponse.toObject = function toObject(message, options) {
3660
- if (!options)
3661
- options = {};
3662
- var object = {};
3663
- if (options.arrays || options.defaults)
3664
- object.packages = [];
3665
- if (message.packages && message.packages.length) {
3666
- object.packages = [];
3667
- for (var j = 0; j < message.packages.length; ++j)
3668
- object.packages[j] = $root.science.PackageInfo.toObject(message.packages[j], options);
3669
- }
3670
- return object;
3671
- };
3672
- /**
3673
- * Converts this ListPackagesResponse to JSON.
3674
- * @function toJSON
3675
- * @memberof science.ListPackagesResponse
3676
- * @instance
3677
- * @returns {Object.<string,*>} JSON object
3678
- */
3679
- ListPackagesResponse.prototype.toJSON = function toJSON() {
3680
- return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
3681
- };
3682
- /**
3683
- * Gets the default type url for ListPackagesResponse
3684
- * @function getTypeUrl
3685
- * @memberof science.ListPackagesResponse
3686
- * @static
3687
- * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
3688
- * @returns {string} The default type url
3689
- */
3690
- ListPackagesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
3691
- if (typeUrlPrefix === undefined) {
3692
- typeUrlPrefix = "type.googleapis.com";
3693
- }
3694
- return typeUrlPrefix + "/science.ListPackagesResponse";
3695
- };
3696
- return ListPackagesResponse;
3697
- })();
3698
- science.SynapseUpdate = (function () {
3699
- /**
3700
- * Constructs a new SynapseUpdate service.
3701
- * @memberof science
3702
- * @classdesc Represents a SynapseUpdate
3703
- * @extends $protobuf.rpc.Service
3704
- * @constructor
3705
- * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
3706
- * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
3707
- * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
3708
- */
3709
- function SynapseUpdate(rpcImpl, requestDelimited, responseDelimited) {
3710
- $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
3711
- }
3712
- (SynapseUpdate.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SynapseUpdate;
3713
- /**
3714
- * Creates new SynapseUpdate service using the specified rpc implementation.
3715
- * @function create
3716
- * @memberof science.SynapseUpdate
3717
- * @static
3718
- * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
3719
- * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
3720
- * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
3721
- * @returns {SynapseUpdate} RPC service. Useful where requests and/or responses are streamed.
3722
- */
3723
- SynapseUpdate.create = function create(rpcImpl, requestDelimited, responseDelimited) {
3724
- return new this(rpcImpl, requestDelimited, responseDelimited);
3725
- };
3726
- /**
3727
- * Callback as used by {@link science.SynapseUpdate#updatePackages}.
3728
- * @memberof science.SynapseUpdate
3729
- * @typedef UpdatePackagesCallback
3730
- * @type {function}
3731
- * @param {Error|null} error Error, if any
3732
- * @param {science.UpdateResult} [response] UpdateResult
3733
- */
3734
- /**
3735
- * Calls UpdatePackages.
3736
- * @function updatePackages
3737
- * @memberof science.SynapseUpdate
3738
- * @instance
3739
- * @param {science.IUpdatePackagesRequest} request UpdatePackagesRequest message or plain object
3740
- * @param {science.SynapseUpdate.UpdatePackagesCallback} callback Node-style callback called with the error, if any, and UpdateResult
3741
- * @returns {undefined}
3742
- * @variation 1
3743
- */
3744
- Object.defineProperty(SynapseUpdate.prototype.updatePackages = function updatePackages(request, callback) {
3745
- return this.rpcCall(updatePackages, $root.science.UpdatePackagesRequest, $root.science.UpdateResult, request, callback);
3746
- }, "name", { value: "UpdatePackages" });
3747
- /**
3748
- * Calls UpdatePackages.
3749
- * @function updatePackages
3750
- * @memberof science.SynapseUpdate
3751
- * @instance
3752
- * @param {science.IUpdatePackagesRequest} request UpdatePackagesRequest message or plain object
3753
- * @returns {Promise<science.UpdateResult>} Promise
3754
- * @variation 2
3755
- */
3756
- /**
3757
- * Callback as used by {@link science.SynapseUpdate#uploadPackage}.
3758
- * @memberof science.SynapseUpdate
3759
- * @typedef UploadPackageCallback
3760
- * @type {function}
3761
- * @param {Error|null} error Error, if any
3762
- * @param {science.UpdateResult} [response] UpdateResult
3763
- */
3764
- /**
3765
- * Calls UploadPackage.
3766
- * @function uploadPackage
3767
- * @memberof science.SynapseUpdate
3768
- * @instance
3769
- * @param {science.IUpdatePackageChunk} request UpdatePackageChunk message or plain object
3770
- * @param {science.SynapseUpdate.UploadPackageCallback} callback Node-style callback called with the error, if any, and UpdateResult
3771
- * @returns {undefined}
3772
- * @variation 1
3773
- */
3774
- Object.defineProperty(SynapseUpdate.prototype.uploadPackage = function uploadPackage(request, callback) {
3775
- return this.rpcCall(uploadPackage, $root.science.UpdatePackageChunk, $root.science.UpdateResult, request, callback);
3776
- }, "name", { value: "UploadPackage" });
3777
- /**
3778
- * Calls UploadPackage.
3779
- * @function uploadPackage
3780
- * @memberof science.SynapseUpdate
3781
- * @instance
3782
- * @param {science.IUpdatePackageChunk} request UpdatePackageChunk message or plain object
3783
- * @returns {Promise<science.UpdateResult>} Promise
3784
- * @variation 2
3785
- */
3786
- /**
3787
- * Callback as used by {@link science.SynapseUpdate#listPackages}.
3788
- * @memberof science.SynapseUpdate
3789
- * @typedef ListPackagesCallback
3790
- * @type {function}
3791
- * @param {Error|null} error Error, if any
3792
- * @param {science.ListPackagesResponse} [response] ListPackagesResponse
3793
- */
3794
- /**
3795
- * Calls ListPackages.
3796
- * @function listPackages
3797
- * @memberof science.SynapseUpdate
3798
- * @instance
3799
- * @param {science.IListPackagesRequest} request ListPackagesRequest message or plain object
3800
- * @param {science.SynapseUpdate.ListPackagesCallback} callback Node-style callback called with the error, if any, and ListPackagesResponse
3801
- * @returns {undefined}
3802
- * @variation 1
3803
- */
3804
- Object.defineProperty(SynapseUpdate.prototype.listPackages = function listPackages(request, callback) {
3805
- return this.rpcCall(listPackages, $root.science.ListPackagesRequest, $root.science.ListPackagesResponse, request, callback);
3806
- }, "name", { value: "ListPackages" });
3807
- /**
3808
- * Calls ListPackages.
3809
- * @function listPackages
3810
- * @memberof science.SynapseUpdate
3811
- * @instance
3812
- * @param {science.IListPackagesRequest} request ListPackagesRequest message or plain object
3813
- * @returns {Promise<science.ListPackagesResponse>} Promise
3814
- * @variation 2
3815
- */
3816
- return SynapseUpdate;
3817
- })();
3818
- return science;
3819
- })();
3820
- return $root;
3821
- });
3822
- //# sourceMappingURL=api.js.map