@headspace/protos-events 0.1.0-0 → 0.1.0-alpha.0ae9639

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/community.proto CHANGED
@@ -4,12 +4,10 @@ message FamilyMemberAdded {
4
4
  uint64 timestamp = 1;
5
5
  uint32 userGroupEntryId = 2;
6
6
  string userId = 3;
7
- uint32 userGroupId = 4;
8
7
  }
9
8
 
10
9
  message FamilyMemberRemoved {
11
10
  uint64 timestamp = 1;
12
11
  uint32 userGroupEntryId = 2;
13
12
  string userId = 3;
14
- uint32 userGroupId = 4;
15
13
  }
package/lib/index.d.ts CHANGED
@@ -10,9 +10,6 @@ export interface IFamilyMemberAdded {
10
10
 
11
11
  /** FamilyMemberAdded userId */
12
12
  userId?: (string|null);
13
-
14
- /** FamilyMemberAdded userGroupId */
15
- userGroupId?: (number|null);
16
13
  }
17
14
 
18
15
  /** Represents a FamilyMemberAdded. */
@@ -33,9 +30,6 @@ export class FamilyMemberAdded implements IFamilyMemberAdded {
33
30
  /** FamilyMemberAdded userId. */
34
31
  public userId: string;
35
32
 
36
- /** FamilyMemberAdded userGroupId. */
37
- public userGroupId: number;
38
-
39
33
  /**
40
34
  * Creates a new FamilyMemberAdded instance using the specified properties.
41
35
  * @param [properties] Properties to set
@@ -118,9 +112,6 @@ export interface IFamilyMemberRemoved {
118
112
 
119
113
  /** FamilyMemberRemoved userId */
120
114
  userId?: (string|null);
121
-
122
- /** FamilyMemberRemoved userGroupId */
123
- userGroupId?: (number|null);
124
115
  }
125
116
 
126
117
  /** Represents a FamilyMemberRemoved. */
@@ -141,9 +132,6 @@ export class FamilyMemberRemoved implements IFamilyMemberRemoved {
141
132
  /** FamilyMemberRemoved userId. */
142
133
  public userId: string;
143
134
 
144
- /** FamilyMemberRemoved userGroupId. */
145
- public userGroupId: number;
146
-
147
135
  /**
148
136
  * Creates a new FamilyMemberRemoved instance using the specified properties.
149
137
  * @param [properties] Properties to set
@@ -215,6 +203,243 @@ export class FamilyMemberRemoved implements IFamilyMemberRemoved {
215
203
  public toJSON(): { [k: string]: any };
216
204
  }
217
205
 
206
+ /** Properties of a Ping. */
207
+ export interface IPing {
208
+
209
+ /** Ping message */
210
+ message?: (string|null);
211
+
212
+ /** Ping timestamp */
213
+ timestamp?: (number|Long|null);
214
+ }
215
+
216
+ /** Represents a Ping. */
217
+ export class Ping implements IPing {
218
+
219
+ /**
220
+ * Constructs a new Ping.
221
+ * @param [properties] Properties to set
222
+ */
223
+ constructor(properties?: IPing);
224
+
225
+ /** Ping message. */
226
+ public message: string;
227
+
228
+ /** Ping timestamp. */
229
+ public timestamp: (number|Long);
230
+
231
+ /**
232
+ * Creates a new Ping instance using the specified properties.
233
+ * @param [properties] Properties to set
234
+ * @returns Ping instance
235
+ */
236
+ public static create(properties?: IPing): Ping;
237
+
238
+ /**
239
+ * Encodes the specified Ping message. Does not implicitly {@link Ping.verify|verify} messages.
240
+ * @param message Ping message or plain object to encode
241
+ * @param [writer] Writer to encode to
242
+ * @returns Writer
243
+ */
244
+ public static encode(message: IPing, writer?: $protobuf.Writer): $protobuf.Writer;
245
+
246
+ /**
247
+ * Encodes the specified Ping message, length delimited. Does not implicitly {@link Ping.verify|verify} messages.
248
+ * @param message Ping message or plain object to encode
249
+ * @param [writer] Writer to encode to
250
+ * @returns Writer
251
+ */
252
+ public static encodeDelimited(message: IPing, writer?: $protobuf.Writer): $protobuf.Writer;
253
+
254
+ /**
255
+ * Decodes a Ping message from the specified reader or buffer.
256
+ * @param reader Reader or buffer to decode from
257
+ * @param [length] Message length if known beforehand
258
+ * @returns Ping
259
+ * @throws {Error} If the payload is not a reader or valid buffer
260
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
261
+ */
262
+ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Ping;
263
+
264
+ /**
265
+ * Decodes a Ping message from the specified reader or buffer, length delimited.
266
+ * @param reader Reader or buffer to decode from
267
+ * @returns Ping
268
+ * @throws {Error} If the payload is not a reader or valid buffer
269
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
270
+ */
271
+ public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Ping;
272
+
273
+ /**
274
+ * Verifies a Ping message.
275
+ * @param message Plain object to verify
276
+ * @returns `null` if valid, otherwise the reason why it is not
277
+ */
278
+ public static verify(message: { [k: string]: any }): (string|null);
279
+
280
+ /**
281
+ * Creates a Ping message from a plain object. Also converts values to their respective internal types.
282
+ * @param object Plain object
283
+ * @returns Ping
284
+ */
285
+ public static fromObject(object: { [k: string]: any }): Ping;
286
+
287
+ /**
288
+ * Creates a plain object from a Ping message. Also converts values to other types if specified.
289
+ * @param message Ping
290
+ * @param [options] Conversion options
291
+ * @returns Plain object
292
+ */
293
+ public static toObject(message: Ping, options?: $protobuf.IConversionOptions): { [k: string]: any };
294
+
295
+ /**
296
+ * Converts this Ping to JSON.
297
+ * @returns JSON object
298
+ */
299
+ public toJSON(): { [k: string]: any };
300
+ }
301
+
302
+ /** Properties of a Pong. */
303
+ export interface IPong {
304
+
305
+ /** Pong message */
306
+ message?: (string|null);
307
+
308
+ /** Pong timestamp */
309
+ timestamp?: (number|Long|null);
310
+ }
311
+
312
+ /** Represents a Pong. */
313
+ export class Pong implements IPong {
314
+
315
+ /**
316
+ * Constructs a new Pong.
317
+ * @param [properties] Properties to set
318
+ */
319
+ constructor(properties?: IPong);
320
+
321
+ /** Pong message. */
322
+ public message: string;
323
+
324
+ /** Pong timestamp. */
325
+ public timestamp: (number|Long);
326
+
327
+ /**
328
+ * Creates a new Pong instance using the specified properties.
329
+ * @param [properties] Properties to set
330
+ * @returns Pong instance
331
+ */
332
+ public static create(properties?: IPong): Pong;
333
+
334
+ /**
335
+ * Encodes the specified Pong message. Does not implicitly {@link Pong.verify|verify} messages.
336
+ * @param message Pong message or plain object to encode
337
+ * @param [writer] Writer to encode to
338
+ * @returns Writer
339
+ */
340
+ public static encode(message: IPong, writer?: $protobuf.Writer): $protobuf.Writer;
341
+
342
+ /**
343
+ * Encodes the specified Pong message, length delimited. Does not implicitly {@link Pong.verify|verify} messages.
344
+ * @param message Pong message or plain object to encode
345
+ * @param [writer] Writer to encode to
346
+ * @returns Writer
347
+ */
348
+ public static encodeDelimited(message: IPong, writer?: $protobuf.Writer): $protobuf.Writer;
349
+
350
+ /**
351
+ * Decodes a Pong message from the specified reader or buffer.
352
+ * @param reader Reader or buffer to decode from
353
+ * @param [length] Message length if known beforehand
354
+ * @returns Pong
355
+ * @throws {Error} If the payload is not a reader or valid buffer
356
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
357
+ */
358
+ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Pong;
359
+
360
+ /**
361
+ * Decodes a Pong message from the specified reader or buffer, length delimited.
362
+ * @param reader Reader or buffer to decode from
363
+ * @returns Pong
364
+ * @throws {Error} If the payload is not a reader or valid buffer
365
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
366
+ */
367
+ public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Pong;
368
+
369
+ /**
370
+ * Verifies a Pong message.
371
+ * @param message Plain object to verify
372
+ * @returns `null` if valid, otherwise the reason why it is not
373
+ */
374
+ public static verify(message: { [k: string]: any }): (string|null);
375
+
376
+ /**
377
+ * Creates a Pong message from a plain object. Also converts values to their respective internal types.
378
+ * @param object Plain object
379
+ * @returns Pong
380
+ */
381
+ public static fromObject(object: { [k: string]: any }): Pong;
382
+
383
+ /**
384
+ * Creates a plain object from a Pong message. Also converts values to other types if specified.
385
+ * @param message Pong
386
+ * @param [options] Conversion options
387
+ * @returns Plain object
388
+ */
389
+ public static toObject(message: Pong, options?: $protobuf.IConversionOptions): { [k: string]: any };
390
+
391
+ /**
392
+ * Converts this Pong to JSON.
393
+ * @returns JSON object
394
+ */
395
+ public toJSON(): { [k: string]: any };
396
+ }
397
+
398
+ /** Represents a PingPongService */
399
+ export class PingPongService extends $protobuf.rpc.Service {
400
+
401
+ /**
402
+ * Constructs a new PingPongService service.
403
+ * @param rpcImpl RPC implementation
404
+ * @param [requestDelimited=false] Whether requests are length-delimited
405
+ * @param [responseDelimited=false] Whether responses are length-delimited
406
+ */
407
+ constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean);
408
+
409
+ /**
410
+ * Creates new PingPongService service using the specified rpc implementation.
411
+ * @param rpcImpl RPC implementation
412
+ * @param [requestDelimited=false] Whether requests are length-delimited
413
+ * @param [responseDelimited=false] Whether responses are length-delimited
414
+ * @returns RPC service. Useful where requests and/or responses are streamed.
415
+ */
416
+ public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): PingPongService;
417
+
418
+ /**
419
+ * Calls ping.
420
+ * @param request Ping message or plain object
421
+ * @param callback Node-style callback called with the error, if any, and Pong
422
+ */
423
+ public ping(request: IPing, callback: PingPongService.pingCallback): void;
424
+
425
+ /**
426
+ * Calls ping.
427
+ * @param request Ping message or plain object
428
+ * @returns Promise
429
+ */
430
+ public ping(request: IPing): Promise<Pong>;
431
+ }
432
+
433
+ export namespace PingPongService {
434
+
435
+ /**
436
+ * Callback as used by {@link PingPongService#ping}.
437
+ * @param error Error, if any
438
+ * @param [response] Pong
439
+ */
440
+ type pingCallback = (error: (Error|null), response?: Pong) => void;
441
+ }
442
+
218
443
  /** Properties of a SubscriptionCreated. */
219
444
  export interface ISubscriptionCreated {
220
445
 
package/lib/index.js CHANGED
@@ -18,7 +18,6 @@ $root.FamilyMemberAdded = (function() {
18
18
  * @property {number|Long|null} [timestamp] FamilyMemberAdded timestamp
19
19
  * @property {number|null} [userGroupEntryId] FamilyMemberAdded userGroupEntryId
20
20
  * @property {string|null} [userId] FamilyMemberAdded userId
21
- * @property {number|null} [userGroupId] FamilyMemberAdded userGroupId
22
21
  */
23
22
 
24
23
  /**
@@ -60,14 +59,6 @@ $root.FamilyMemberAdded = (function() {
60
59
  */
61
60
  FamilyMemberAdded.prototype.userId = "";
62
61
 
63
- /**
64
- * FamilyMemberAdded userGroupId.
65
- * @member {number} userGroupId
66
- * @memberof FamilyMemberAdded
67
- * @instance
68
- */
69
- FamilyMemberAdded.prototype.userGroupId = 0;
70
-
71
62
  /**
72
63
  * Creates a new FamilyMemberAdded instance using the specified properties.
73
64
  * @function create
@@ -98,8 +89,6 @@ $root.FamilyMemberAdded = (function() {
98
89
  writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.userGroupEntryId);
99
90
  if (message.userId != null && message.hasOwnProperty("userId"))
100
91
  writer.uint32(/* id 3, wireType 2 =*/26).string(message.userId);
101
- if (message.userGroupId != null && message.hasOwnProperty("userGroupId"))
102
- writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.userGroupId);
103
92
  return writer;
104
93
  };
105
94
 
@@ -143,9 +132,6 @@ $root.FamilyMemberAdded = (function() {
143
132
  case 3:
144
133
  message.userId = reader.string();
145
134
  break;
146
- case 4:
147
- message.userGroupId = reader.uint32();
148
- break;
149
135
  default:
150
136
  reader.skipType(tag & 7);
151
137
  break;
@@ -190,9 +176,6 @@ $root.FamilyMemberAdded = (function() {
190
176
  if (message.userId != null && message.hasOwnProperty("userId"))
191
177
  if (!$util.isString(message.userId))
192
178
  return "userId: string expected";
193
- if (message.userGroupId != null && message.hasOwnProperty("userGroupId"))
194
- if (!$util.isInteger(message.userGroupId))
195
- return "userGroupId: integer expected";
196
179
  return null;
197
180
  };
198
181
 
@@ -221,8 +204,6 @@ $root.FamilyMemberAdded = (function() {
221
204
  message.userGroupEntryId = object.userGroupEntryId >>> 0;
222
205
  if (object.userId != null)
223
206
  message.userId = String(object.userId);
224
- if (object.userGroupId != null)
225
- message.userGroupId = object.userGroupId >>> 0;
226
207
  return message;
227
208
  };
228
209
 
@@ -247,7 +228,6 @@ $root.FamilyMemberAdded = (function() {
247
228
  object.timestamp = options.longs === String ? "0" : 0;
248
229
  object.userGroupEntryId = 0;
249
230
  object.userId = "";
250
- object.userGroupId = 0;
251
231
  }
252
232
  if (message.timestamp != null && message.hasOwnProperty("timestamp"))
253
233
  if (typeof message.timestamp === "number")
@@ -258,8 +238,6 @@ $root.FamilyMemberAdded = (function() {
258
238
  object.userGroupEntryId = message.userGroupEntryId;
259
239
  if (message.userId != null && message.hasOwnProperty("userId"))
260
240
  object.userId = message.userId;
261
- if (message.userGroupId != null && message.hasOwnProperty("userGroupId"))
262
- object.userGroupId = message.userGroupId;
263
241
  return object;
264
242
  };
265
243
 
@@ -286,7 +264,6 @@ $root.FamilyMemberRemoved = (function() {
286
264
  * @property {number|Long|null} [timestamp] FamilyMemberRemoved timestamp
287
265
  * @property {number|null} [userGroupEntryId] FamilyMemberRemoved userGroupEntryId
288
266
  * @property {string|null} [userId] FamilyMemberRemoved userId
289
- * @property {number|null} [userGroupId] FamilyMemberRemoved userGroupId
290
267
  */
291
268
 
292
269
  /**
@@ -328,14 +305,6 @@ $root.FamilyMemberRemoved = (function() {
328
305
  */
329
306
  FamilyMemberRemoved.prototype.userId = "";
330
307
 
331
- /**
332
- * FamilyMemberRemoved userGroupId.
333
- * @member {number} userGroupId
334
- * @memberof FamilyMemberRemoved
335
- * @instance
336
- */
337
- FamilyMemberRemoved.prototype.userGroupId = 0;
338
-
339
308
  /**
340
309
  * Creates a new FamilyMemberRemoved instance using the specified properties.
341
310
  * @function create
@@ -366,8 +335,6 @@ $root.FamilyMemberRemoved = (function() {
366
335
  writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.userGroupEntryId);
367
336
  if (message.userId != null && message.hasOwnProperty("userId"))
368
337
  writer.uint32(/* id 3, wireType 2 =*/26).string(message.userId);
369
- if (message.userGroupId != null && message.hasOwnProperty("userGroupId"))
370
- writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.userGroupId);
371
338
  return writer;
372
339
  };
373
340
 
@@ -411,9 +378,6 @@ $root.FamilyMemberRemoved = (function() {
411
378
  case 3:
412
379
  message.userId = reader.string();
413
380
  break;
414
- case 4:
415
- message.userGroupId = reader.uint32();
416
- break;
417
381
  default:
418
382
  reader.skipType(tag & 7);
419
383
  break;
@@ -458,9 +422,6 @@ $root.FamilyMemberRemoved = (function() {
458
422
  if (message.userId != null && message.hasOwnProperty("userId"))
459
423
  if (!$util.isString(message.userId))
460
424
  return "userId: string expected";
461
- if (message.userGroupId != null && message.hasOwnProperty("userGroupId"))
462
- if (!$util.isInteger(message.userGroupId))
463
- return "userGroupId: integer expected";
464
425
  return null;
465
426
  };
466
427
 
@@ -489,8 +450,6 @@ $root.FamilyMemberRemoved = (function() {
489
450
  message.userGroupEntryId = object.userGroupEntryId >>> 0;
490
451
  if (object.userId != null)
491
452
  message.userId = String(object.userId);
492
- if (object.userGroupId != null)
493
- message.userGroupId = object.userGroupId >>> 0;
494
453
  return message;
495
454
  };
496
455
 
@@ -515,7 +474,6 @@ $root.FamilyMemberRemoved = (function() {
515
474
  object.timestamp = options.longs === String ? "0" : 0;
516
475
  object.userGroupEntryId = 0;
517
476
  object.userId = "";
518
- object.userGroupId = 0;
519
477
  }
520
478
  if (message.timestamp != null && message.hasOwnProperty("timestamp"))
521
479
  if (typeof message.timestamp === "number")
@@ -526,8 +484,6 @@ $root.FamilyMemberRemoved = (function() {
526
484
  object.userGroupEntryId = message.userGroupEntryId;
527
485
  if (message.userId != null && message.hasOwnProperty("userId"))
528
486
  object.userId = message.userId;
529
- if (message.userGroupId != null && message.hasOwnProperty("userGroupId"))
530
- object.userGroupId = message.userGroupId;
531
487
  return object;
532
488
  };
533
489
 
@@ -545,6 +501,522 @@ $root.FamilyMemberRemoved = (function() {
545
501
  return FamilyMemberRemoved;
546
502
  })();
547
503
 
504
+ $root.Ping = (function() {
505
+
506
+ /**
507
+ * Properties of a Ping.
508
+ * @exports IPing
509
+ * @interface IPing
510
+ * @property {string|null} [message] Ping message
511
+ * @property {number|Long|null} [timestamp] Ping timestamp
512
+ */
513
+
514
+ /**
515
+ * Constructs a new Ping.
516
+ * @exports Ping
517
+ * @classdesc Represents a Ping.
518
+ * @implements IPing
519
+ * @constructor
520
+ * @param {IPing=} [properties] Properties to set
521
+ */
522
+ function Ping(properties) {
523
+ if (properties)
524
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
525
+ if (properties[keys[i]] != null)
526
+ this[keys[i]] = properties[keys[i]];
527
+ }
528
+
529
+ /**
530
+ * Ping message.
531
+ * @member {string} message
532
+ * @memberof Ping
533
+ * @instance
534
+ */
535
+ Ping.prototype.message = "";
536
+
537
+ /**
538
+ * Ping timestamp.
539
+ * @member {number|Long} timestamp
540
+ * @memberof Ping
541
+ * @instance
542
+ */
543
+ Ping.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
544
+
545
+ /**
546
+ * Creates a new Ping instance using the specified properties.
547
+ * @function create
548
+ * @memberof Ping
549
+ * @static
550
+ * @param {IPing=} [properties] Properties to set
551
+ * @returns {Ping} Ping instance
552
+ */
553
+ Ping.create = function create(properties) {
554
+ return new Ping(properties);
555
+ };
556
+
557
+ /**
558
+ * Encodes the specified Ping message. Does not implicitly {@link Ping.verify|verify} messages.
559
+ * @function encode
560
+ * @memberof Ping
561
+ * @static
562
+ * @param {IPing} message Ping message or plain object to encode
563
+ * @param {$protobuf.Writer} [writer] Writer to encode to
564
+ * @returns {$protobuf.Writer} Writer
565
+ */
566
+ Ping.encode = function encode(message, writer) {
567
+ if (!writer)
568
+ writer = $Writer.create();
569
+ if (message.message != null && message.hasOwnProperty("message"))
570
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.message);
571
+ if (message.timestamp != null && message.hasOwnProperty("timestamp"))
572
+ writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.timestamp);
573
+ return writer;
574
+ };
575
+
576
+ /**
577
+ * Encodes the specified Ping message, length delimited. Does not implicitly {@link Ping.verify|verify} messages.
578
+ * @function encodeDelimited
579
+ * @memberof Ping
580
+ * @static
581
+ * @param {IPing} message Ping message or plain object to encode
582
+ * @param {$protobuf.Writer} [writer] Writer to encode to
583
+ * @returns {$protobuf.Writer} Writer
584
+ */
585
+ Ping.encodeDelimited = function encodeDelimited(message, writer) {
586
+ return this.encode(message, writer).ldelim();
587
+ };
588
+
589
+ /**
590
+ * Decodes a Ping message from the specified reader or buffer.
591
+ * @function decode
592
+ * @memberof Ping
593
+ * @static
594
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
595
+ * @param {number} [length] Message length if known beforehand
596
+ * @returns {Ping} Ping
597
+ * @throws {Error} If the payload is not a reader or valid buffer
598
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
599
+ */
600
+ Ping.decode = function decode(reader, length) {
601
+ if (!(reader instanceof $Reader))
602
+ reader = $Reader.create(reader);
603
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Ping();
604
+ while (reader.pos < end) {
605
+ var tag = reader.uint32();
606
+ switch (tag >>> 3) {
607
+ case 1:
608
+ message.message = reader.string();
609
+ break;
610
+ case 2:
611
+ message.timestamp = reader.uint64();
612
+ break;
613
+ default:
614
+ reader.skipType(tag & 7);
615
+ break;
616
+ }
617
+ }
618
+ return message;
619
+ };
620
+
621
+ /**
622
+ * Decodes a Ping message from the specified reader or buffer, length delimited.
623
+ * @function decodeDelimited
624
+ * @memberof Ping
625
+ * @static
626
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
627
+ * @returns {Ping} Ping
628
+ * @throws {Error} If the payload is not a reader or valid buffer
629
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
630
+ */
631
+ Ping.decodeDelimited = function decodeDelimited(reader) {
632
+ if (!(reader instanceof $Reader))
633
+ reader = new $Reader(reader);
634
+ return this.decode(reader, reader.uint32());
635
+ };
636
+
637
+ /**
638
+ * Verifies a Ping message.
639
+ * @function verify
640
+ * @memberof Ping
641
+ * @static
642
+ * @param {Object.<string,*>} message Plain object to verify
643
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
644
+ */
645
+ Ping.verify = function verify(message) {
646
+ if (typeof message !== "object" || message === null)
647
+ return "object expected";
648
+ if (message.message != null && message.hasOwnProperty("message"))
649
+ if (!$util.isString(message.message))
650
+ return "message: string expected";
651
+ if (message.timestamp != null && message.hasOwnProperty("timestamp"))
652
+ if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high)))
653
+ return "timestamp: integer|Long expected";
654
+ return null;
655
+ };
656
+
657
+ /**
658
+ * Creates a Ping message from a plain object. Also converts values to their respective internal types.
659
+ * @function fromObject
660
+ * @memberof Ping
661
+ * @static
662
+ * @param {Object.<string,*>} object Plain object
663
+ * @returns {Ping} Ping
664
+ */
665
+ Ping.fromObject = function fromObject(object) {
666
+ if (object instanceof $root.Ping)
667
+ return object;
668
+ var message = new $root.Ping();
669
+ if (object.message != null)
670
+ message.message = String(object.message);
671
+ if (object.timestamp != null)
672
+ if ($util.Long)
673
+ (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true;
674
+ else if (typeof object.timestamp === "string")
675
+ message.timestamp = parseInt(object.timestamp, 10);
676
+ else if (typeof object.timestamp === "number")
677
+ message.timestamp = object.timestamp;
678
+ else if (typeof object.timestamp === "object")
679
+ message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true);
680
+ return message;
681
+ };
682
+
683
+ /**
684
+ * Creates a plain object from a Ping message. Also converts values to other types if specified.
685
+ * @function toObject
686
+ * @memberof Ping
687
+ * @static
688
+ * @param {Ping} message Ping
689
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
690
+ * @returns {Object.<string,*>} Plain object
691
+ */
692
+ Ping.toObject = function toObject(message, options) {
693
+ if (!options)
694
+ options = {};
695
+ var object = {};
696
+ if (options.defaults) {
697
+ object.message = "";
698
+ if ($util.Long) {
699
+ var long = new $util.Long(0, 0, true);
700
+ object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
701
+ } else
702
+ object.timestamp = options.longs === String ? "0" : 0;
703
+ }
704
+ if (message.message != null && message.hasOwnProperty("message"))
705
+ object.message = message.message;
706
+ if (message.timestamp != null && message.hasOwnProperty("timestamp"))
707
+ if (typeof message.timestamp === "number")
708
+ object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp;
709
+ else
710
+ object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp;
711
+ return object;
712
+ };
713
+
714
+ /**
715
+ * Converts this Ping to JSON.
716
+ * @function toJSON
717
+ * @memberof Ping
718
+ * @instance
719
+ * @returns {Object.<string,*>} JSON object
720
+ */
721
+ Ping.prototype.toJSON = function toJSON() {
722
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
723
+ };
724
+
725
+ return Ping;
726
+ })();
727
+
728
+ $root.Pong = (function() {
729
+
730
+ /**
731
+ * Properties of a Pong.
732
+ * @exports IPong
733
+ * @interface IPong
734
+ * @property {string|null} [message] Pong message
735
+ * @property {number|Long|null} [timestamp] Pong timestamp
736
+ */
737
+
738
+ /**
739
+ * Constructs a new Pong.
740
+ * @exports Pong
741
+ * @classdesc Represents a Pong.
742
+ * @implements IPong
743
+ * @constructor
744
+ * @param {IPong=} [properties] Properties to set
745
+ */
746
+ function Pong(properties) {
747
+ if (properties)
748
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
749
+ if (properties[keys[i]] != null)
750
+ this[keys[i]] = properties[keys[i]];
751
+ }
752
+
753
+ /**
754
+ * Pong message.
755
+ * @member {string} message
756
+ * @memberof Pong
757
+ * @instance
758
+ */
759
+ Pong.prototype.message = "";
760
+
761
+ /**
762
+ * Pong timestamp.
763
+ * @member {number|Long} timestamp
764
+ * @memberof Pong
765
+ * @instance
766
+ */
767
+ Pong.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
768
+
769
+ /**
770
+ * Creates a new Pong instance using the specified properties.
771
+ * @function create
772
+ * @memberof Pong
773
+ * @static
774
+ * @param {IPong=} [properties] Properties to set
775
+ * @returns {Pong} Pong instance
776
+ */
777
+ Pong.create = function create(properties) {
778
+ return new Pong(properties);
779
+ };
780
+
781
+ /**
782
+ * Encodes the specified Pong message. Does not implicitly {@link Pong.verify|verify} messages.
783
+ * @function encode
784
+ * @memberof Pong
785
+ * @static
786
+ * @param {IPong} message Pong message or plain object to encode
787
+ * @param {$protobuf.Writer} [writer] Writer to encode to
788
+ * @returns {$protobuf.Writer} Writer
789
+ */
790
+ Pong.encode = function encode(message, writer) {
791
+ if (!writer)
792
+ writer = $Writer.create();
793
+ if (message.message != null && message.hasOwnProperty("message"))
794
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.message);
795
+ if (message.timestamp != null && message.hasOwnProperty("timestamp"))
796
+ writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.timestamp);
797
+ return writer;
798
+ };
799
+
800
+ /**
801
+ * Encodes the specified Pong message, length delimited. Does not implicitly {@link Pong.verify|verify} messages.
802
+ * @function encodeDelimited
803
+ * @memberof Pong
804
+ * @static
805
+ * @param {IPong} message Pong message or plain object to encode
806
+ * @param {$protobuf.Writer} [writer] Writer to encode to
807
+ * @returns {$protobuf.Writer} Writer
808
+ */
809
+ Pong.encodeDelimited = function encodeDelimited(message, writer) {
810
+ return this.encode(message, writer).ldelim();
811
+ };
812
+
813
+ /**
814
+ * Decodes a Pong message from the specified reader or buffer.
815
+ * @function decode
816
+ * @memberof Pong
817
+ * @static
818
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
819
+ * @param {number} [length] Message length if known beforehand
820
+ * @returns {Pong} Pong
821
+ * @throws {Error} If the payload is not a reader or valid buffer
822
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
823
+ */
824
+ Pong.decode = function decode(reader, length) {
825
+ if (!(reader instanceof $Reader))
826
+ reader = $Reader.create(reader);
827
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Pong();
828
+ while (reader.pos < end) {
829
+ var tag = reader.uint32();
830
+ switch (tag >>> 3) {
831
+ case 1:
832
+ message.message = reader.string();
833
+ break;
834
+ case 2:
835
+ message.timestamp = reader.uint64();
836
+ break;
837
+ default:
838
+ reader.skipType(tag & 7);
839
+ break;
840
+ }
841
+ }
842
+ return message;
843
+ };
844
+
845
+ /**
846
+ * Decodes a Pong message from the specified reader or buffer, length delimited.
847
+ * @function decodeDelimited
848
+ * @memberof Pong
849
+ * @static
850
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
851
+ * @returns {Pong} Pong
852
+ * @throws {Error} If the payload is not a reader or valid buffer
853
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
854
+ */
855
+ Pong.decodeDelimited = function decodeDelimited(reader) {
856
+ if (!(reader instanceof $Reader))
857
+ reader = new $Reader(reader);
858
+ return this.decode(reader, reader.uint32());
859
+ };
860
+
861
+ /**
862
+ * Verifies a Pong message.
863
+ * @function verify
864
+ * @memberof Pong
865
+ * @static
866
+ * @param {Object.<string,*>} message Plain object to verify
867
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
868
+ */
869
+ Pong.verify = function verify(message) {
870
+ if (typeof message !== "object" || message === null)
871
+ return "object expected";
872
+ if (message.message != null && message.hasOwnProperty("message"))
873
+ if (!$util.isString(message.message))
874
+ return "message: string expected";
875
+ if (message.timestamp != null && message.hasOwnProperty("timestamp"))
876
+ if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high)))
877
+ return "timestamp: integer|Long expected";
878
+ return null;
879
+ };
880
+
881
+ /**
882
+ * Creates a Pong message from a plain object. Also converts values to their respective internal types.
883
+ * @function fromObject
884
+ * @memberof Pong
885
+ * @static
886
+ * @param {Object.<string,*>} object Plain object
887
+ * @returns {Pong} Pong
888
+ */
889
+ Pong.fromObject = function fromObject(object) {
890
+ if (object instanceof $root.Pong)
891
+ return object;
892
+ var message = new $root.Pong();
893
+ if (object.message != null)
894
+ message.message = String(object.message);
895
+ if (object.timestamp != null)
896
+ if ($util.Long)
897
+ (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true;
898
+ else if (typeof object.timestamp === "string")
899
+ message.timestamp = parseInt(object.timestamp, 10);
900
+ else if (typeof object.timestamp === "number")
901
+ message.timestamp = object.timestamp;
902
+ else if (typeof object.timestamp === "object")
903
+ message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true);
904
+ return message;
905
+ };
906
+
907
+ /**
908
+ * Creates a plain object from a Pong message. Also converts values to other types if specified.
909
+ * @function toObject
910
+ * @memberof Pong
911
+ * @static
912
+ * @param {Pong} message Pong
913
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
914
+ * @returns {Object.<string,*>} Plain object
915
+ */
916
+ Pong.toObject = function toObject(message, options) {
917
+ if (!options)
918
+ options = {};
919
+ var object = {};
920
+ if (options.defaults) {
921
+ object.message = "";
922
+ if ($util.Long) {
923
+ var long = new $util.Long(0, 0, true);
924
+ object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
925
+ } else
926
+ object.timestamp = options.longs === String ? "0" : 0;
927
+ }
928
+ if (message.message != null && message.hasOwnProperty("message"))
929
+ object.message = message.message;
930
+ if (message.timestamp != null && message.hasOwnProperty("timestamp"))
931
+ if (typeof message.timestamp === "number")
932
+ object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp;
933
+ else
934
+ object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp;
935
+ return object;
936
+ };
937
+
938
+ /**
939
+ * Converts this Pong to JSON.
940
+ * @function toJSON
941
+ * @memberof Pong
942
+ * @instance
943
+ * @returns {Object.<string,*>} JSON object
944
+ */
945
+ Pong.prototype.toJSON = function toJSON() {
946
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
947
+ };
948
+
949
+ return Pong;
950
+ })();
951
+
952
+ $root.PingPongService = (function() {
953
+
954
+ /**
955
+ * Constructs a new PingPongService service.
956
+ * @exports PingPongService
957
+ * @classdesc Represents a PingPongService
958
+ * @extends $protobuf.rpc.Service
959
+ * @constructor
960
+ * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
961
+ * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
962
+ * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
963
+ */
964
+ function PingPongService(rpcImpl, requestDelimited, responseDelimited) {
965
+ $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
966
+ }
967
+
968
+ (PingPongService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = PingPongService;
969
+
970
+ /**
971
+ * Creates new PingPongService service using the specified rpc implementation.
972
+ * @function create
973
+ * @memberof PingPongService
974
+ * @static
975
+ * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
976
+ * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
977
+ * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
978
+ * @returns {PingPongService} RPC service. Useful where requests and/or responses are streamed.
979
+ */
980
+ PingPongService.create = function create(rpcImpl, requestDelimited, responseDelimited) {
981
+ return new this(rpcImpl, requestDelimited, responseDelimited);
982
+ };
983
+
984
+ /**
985
+ * Callback as used by {@link PingPongService#ping}.
986
+ * @memberof PingPongService
987
+ * @typedef pingCallback
988
+ * @type {function}
989
+ * @param {Error|null} error Error, if any
990
+ * @param {Pong} [response] Pong
991
+ */
992
+
993
+ /**
994
+ * Calls ping.
995
+ * @function ping
996
+ * @memberof PingPongService
997
+ * @instance
998
+ * @param {IPing} request Ping message or plain object
999
+ * @param {PingPongService.pingCallback} callback Node-style callback called with the error, if any, and Pong
1000
+ * @returns {undefined}
1001
+ * @variation 1
1002
+ */
1003
+ Object.defineProperty(PingPongService.prototype.ping = function ping(request, callback) {
1004
+ return this.rpcCall(ping, $root.Ping, $root.Pong, request, callback);
1005
+ }, "name", { value: "ping" });
1006
+
1007
+ /**
1008
+ * Calls ping.
1009
+ * @function ping
1010
+ * @memberof PingPongService
1011
+ * @instance
1012
+ * @param {IPing} request Ping message or plain object
1013
+ * @returns {Promise<Pong>} Promise
1014
+ * @variation 2
1015
+ */
1016
+
1017
+ return PingPongService;
1018
+ })();
1019
+
548
1020
  $root.SubscriptionCreated = (function() {
549
1021
 
550
1022
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@headspace/protos-events",
3
- "version": "0.1.0-0",
3
+ "version": "0.1.0-alpha.0ae9639",
4
4
  "main": "lib/index.js",
5
5
  "typings": "lib/index.d.ts",
6
6
  "scripts": {
@@ -15,5 +15,6 @@
15
15
  },
16
16
  "devDependencies": {
17
17
  "typescript": "^3.0.1"
18
- }
18
+ },
19
+ "gitHead": "0ae963903ea3731205b0ea1a7dd6fe8c01ee5ed2"
19
20
  }
package/pingpong.proto ADDED
@@ -0,0 +1,15 @@
1
+ syntax = "proto3";
2
+
3
+ message Ping {
4
+ string message = 1;
5
+ uint64 timestamp = 2;
6
+ }
7
+
8
+ message Pong {
9
+ string message = 1;
10
+ uint64 timestamp= 2;
11
+ }
12
+
13
+ service PingPongService {
14
+ rpc ping (Ping) returns (Pong);
15
+ }