@headspace/protos-events 0.0.7-alpha.0 → 0.0.8-alpha.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.
package/lib/index.d.ts CHANGED
@@ -218,8 +218,8 @@ export class FamilyMemberRemoved implements IFamilyMemberRemoved {
218
218
  /** Properties of a SleepcastEpisodeCompleted. */
219
219
  export interface ISleepcastEpisodeCompleted {
220
220
 
221
- /** SleepcastEpisodeCompleted timestamp */
222
- timestamp?: (number|Long|null);
221
+ /** SleepcastEpisodeCompleted timestampMs */
222
+ timestampMs?: (number|Long|null);
223
223
 
224
224
  /** SleepcastEpisodeCompleted sleepcastId */
225
225
  sleepcastId?: (number|null);
@@ -237,8 +237,8 @@ export class SleepcastEpisodeCompleted implements ISleepcastEpisodeCompleted {
237
237
  */
238
238
  constructor(properties?: ISleepcastEpisodeCompleted);
239
239
 
240
- /** SleepcastEpisodeCompleted timestamp. */
241
- public timestamp: (number|Long);
240
+ /** SleepcastEpisodeCompleted timestampMs. */
241
+ public timestampMs: (number|Long);
242
242
 
243
243
  /** SleepcastEpisodeCompleted sleepcastId. */
244
244
  public sleepcastId: number;
@@ -317,6 +317,210 @@ export class SleepcastEpisodeCompleted implements ISleepcastEpisodeCompleted {
317
317
  public toJSON(): { [k: string]: any };
318
318
  }
319
319
 
320
+ /** Properties of a FirstSleepcastPlayDateSet. */
321
+ export interface IFirstSleepcastPlayDateSet {
322
+
323
+ /** FirstSleepcastPlayDateSet timestamp */
324
+ timestamp?: (number|Long|null);
325
+
326
+ /** FirstSleepcastPlayDateSet userId */
327
+ userId?: (string|null);
328
+
329
+ /** FirstSleepcastPlayDateSet firstPlayDate */
330
+ firstPlayDate?: (string|null);
331
+ }
332
+
333
+ /** Represents a FirstSleepcastPlayDateSet. */
334
+ export class FirstSleepcastPlayDateSet implements IFirstSleepcastPlayDateSet {
335
+
336
+ /**
337
+ * Constructs a new FirstSleepcastPlayDateSet.
338
+ * @param [properties] Properties to set
339
+ */
340
+ constructor(properties?: IFirstSleepcastPlayDateSet);
341
+
342
+ /** FirstSleepcastPlayDateSet timestamp. */
343
+ public timestamp: (number|Long);
344
+
345
+ /** FirstSleepcastPlayDateSet userId. */
346
+ public userId: string;
347
+
348
+ /** FirstSleepcastPlayDateSet firstPlayDate. */
349
+ public firstPlayDate: string;
350
+
351
+ /**
352
+ * Creates a new FirstSleepcastPlayDateSet instance using the specified properties.
353
+ * @param [properties] Properties to set
354
+ * @returns FirstSleepcastPlayDateSet instance
355
+ */
356
+ public static create(properties?: IFirstSleepcastPlayDateSet): FirstSleepcastPlayDateSet;
357
+
358
+ /**
359
+ * Encodes the specified FirstSleepcastPlayDateSet message. Does not implicitly {@link FirstSleepcastPlayDateSet.verify|verify} messages.
360
+ * @param message FirstSleepcastPlayDateSet message or plain object to encode
361
+ * @param [writer] Writer to encode to
362
+ * @returns Writer
363
+ */
364
+ public static encode(message: IFirstSleepcastPlayDateSet, writer?: $protobuf.Writer): $protobuf.Writer;
365
+
366
+ /**
367
+ * Encodes the specified FirstSleepcastPlayDateSet message, length delimited. Does not implicitly {@link FirstSleepcastPlayDateSet.verify|verify} messages.
368
+ * @param message FirstSleepcastPlayDateSet message or plain object to encode
369
+ * @param [writer] Writer to encode to
370
+ * @returns Writer
371
+ */
372
+ public static encodeDelimited(message: IFirstSleepcastPlayDateSet, writer?: $protobuf.Writer): $protobuf.Writer;
373
+
374
+ /**
375
+ * Decodes a FirstSleepcastPlayDateSet message from the specified reader or buffer.
376
+ * @param reader Reader or buffer to decode from
377
+ * @param [length] Message length if known beforehand
378
+ * @returns FirstSleepcastPlayDateSet
379
+ * @throws {Error} If the payload is not a reader or valid buffer
380
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
381
+ */
382
+ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): FirstSleepcastPlayDateSet;
383
+
384
+ /**
385
+ * Decodes a FirstSleepcastPlayDateSet message from the specified reader or buffer, length delimited.
386
+ * @param reader Reader or buffer to decode from
387
+ * @returns FirstSleepcastPlayDateSet
388
+ * @throws {Error} If the payload is not a reader or valid buffer
389
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
390
+ */
391
+ public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): FirstSleepcastPlayDateSet;
392
+
393
+ /**
394
+ * Verifies a FirstSleepcastPlayDateSet message.
395
+ * @param message Plain object to verify
396
+ * @returns `null` if valid, otherwise the reason why it is not
397
+ */
398
+ public static verify(message: { [k: string]: any }): (string|null);
399
+
400
+ /**
401
+ * Creates a FirstSleepcastPlayDateSet message from a plain object. Also converts values to their respective internal types.
402
+ * @param object Plain object
403
+ * @returns FirstSleepcastPlayDateSet
404
+ */
405
+ public static fromObject(object: { [k: string]: any }): FirstSleepcastPlayDateSet;
406
+
407
+ /**
408
+ * Creates a plain object from a FirstSleepcastPlayDateSet message. Also converts values to other types if specified.
409
+ * @param message FirstSleepcastPlayDateSet
410
+ * @param [options] Conversion options
411
+ * @returns Plain object
412
+ */
413
+ public static toObject(message: FirstSleepcastPlayDateSet, options?: $protobuf.IConversionOptions): { [k: string]: any };
414
+
415
+ /**
416
+ * Converts this FirstSleepcastPlayDateSet to JSON.
417
+ * @returns JSON object
418
+ */
419
+ public toJSON(): { [k: string]: any };
420
+ }
421
+
422
+ /** Properties of a NumSleepcastPlaysSet. */
423
+ export interface INumSleepcastPlaysSet {
424
+
425
+ /** NumSleepcastPlaysSet timestamp */
426
+ timestamp?: (number|Long|null);
427
+
428
+ /** NumSleepcastPlaysSet userId */
429
+ userId?: (string|null);
430
+
431
+ /** NumSleepcastPlaysSet numPlays */
432
+ numPlays?: (number|null);
433
+ }
434
+
435
+ /** Represents a NumSleepcastPlaysSet. */
436
+ export class NumSleepcastPlaysSet implements INumSleepcastPlaysSet {
437
+
438
+ /**
439
+ * Constructs a new NumSleepcastPlaysSet.
440
+ * @param [properties] Properties to set
441
+ */
442
+ constructor(properties?: INumSleepcastPlaysSet);
443
+
444
+ /** NumSleepcastPlaysSet timestamp. */
445
+ public timestamp: (number|Long);
446
+
447
+ /** NumSleepcastPlaysSet userId. */
448
+ public userId: string;
449
+
450
+ /** NumSleepcastPlaysSet numPlays. */
451
+ public numPlays: number;
452
+
453
+ /**
454
+ * Creates a new NumSleepcastPlaysSet instance using the specified properties.
455
+ * @param [properties] Properties to set
456
+ * @returns NumSleepcastPlaysSet instance
457
+ */
458
+ public static create(properties?: INumSleepcastPlaysSet): NumSleepcastPlaysSet;
459
+
460
+ /**
461
+ * Encodes the specified NumSleepcastPlaysSet message. Does not implicitly {@link NumSleepcastPlaysSet.verify|verify} messages.
462
+ * @param message NumSleepcastPlaysSet message or plain object to encode
463
+ * @param [writer] Writer to encode to
464
+ * @returns Writer
465
+ */
466
+ public static encode(message: INumSleepcastPlaysSet, writer?: $protobuf.Writer): $protobuf.Writer;
467
+
468
+ /**
469
+ * Encodes the specified NumSleepcastPlaysSet message, length delimited. Does not implicitly {@link NumSleepcastPlaysSet.verify|verify} messages.
470
+ * @param message NumSleepcastPlaysSet message or plain object to encode
471
+ * @param [writer] Writer to encode to
472
+ * @returns Writer
473
+ */
474
+ public static encodeDelimited(message: INumSleepcastPlaysSet, writer?: $protobuf.Writer): $protobuf.Writer;
475
+
476
+ /**
477
+ * Decodes a NumSleepcastPlaysSet message from the specified reader or buffer.
478
+ * @param reader Reader or buffer to decode from
479
+ * @param [length] Message length if known beforehand
480
+ * @returns NumSleepcastPlaysSet
481
+ * @throws {Error} If the payload is not a reader or valid buffer
482
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
483
+ */
484
+ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): NumSleepcastPlaysSet;
485
+
486
+ /**
487
+ * Decodes a NumSleepcastPlaysSet message from the specified reader or buffer, length delimited.
488
+ * @param reader Reader or buffer to decode from
489
+ * @returns NumSleepcastPlaysSet
490
+ * @throws {Error} If the payload is not a reader or valid buffer
491
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
492
+ */
493
+ public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): NumSleepcastPlaysSet;
494
+
495
+ /**
496
+ * Verifies a NumSleepcastPlaysSet message.
497
+ * @param message Plain object to verify
498
+ * @returns `null` if valid, otherwise the reason why it is not
499
+ */
500
+ public static verify(message: { [k: string]: any }): (string|null);
501
+
502
+ /**
503
+ * Creates a NumSleepcastPlaysSet message from a plain object. Also converts values to their respective internal types.
504
+ * @param object Plain object
505
+ * @returns NumSleepcastPlaysSet
506
+ */
507
+ public static fromObject(object: { [k: string]: any }): NumSleepcastPlaysSet;
508
+
509
+ /**
510
+ * Creates a plain object from a NumSleepcastPlaysSet message. Also converts values to other types if specified.
511
+ * @param message NumSleepcastPlaysSet
512
+ * @param [options] Conversion options
513
+ * @returns Plain object
514
+ */
515
+ public static toObject(message: NumSleepcastPlaysSet, options?: $protobuf.IConversionOptions): { [k: string]: any };
516
+
517
+ /**
518
+ * Converts this NumSleepcastPlaysSet to JSON.
519
+ * @returns JSON object
520
+ */
521
+ public toJSON(): { [k: string]: any };
522
+ }
523
+
320
524
  /** Properties of a SubscriptionCreated. */
321
525
  export interface ISubscriptionCreated {
322
526
 
package/lib/index.js CHANGED
@@ -551,7 +551,7 @@ $root.SleepcastEpisodeCompleted = (function() {
551
551
  * Properties of a SleepcastEpisodeCompleted.
552
552
  * @exports ISleepcastEpisodeCompleted
553
553
  * @interface ISleepcastEpisodeCompleted
554
- * @property {number|Long|null} [timestamp] SleepcastEpisodeCompleted timestamp
554
+ * @property {number|Long|null} [timestampMs] SleepcastEpisodeCompleted timestampMs
555
555
  * @property {number|null} [sleepcastId] SleepcastEpisodeCompleted sleepcastId
556
556
  * @property {string|null} [userId] SleepcastEpisodeCompleted userId
557
557
  */
@@ -572,12 +572,12 @@ $root.SleepcastEpisodeCompleted = (function() {
572
572
  }
573
573
 
574
574
  /**
575
- * SleepcastEpisodeCompleted timestamp.
576
- * @member {number|Long} timestamp
575
+ * SleepcastEpisodeCompleted timestampMs.
576
+ * @member {number|Long} timestampMs
577
577
  * @memberof SleepcastEpisodeCompleted
578
578
  * @instance
579
579
  */
580
- SleepcastEpisodeCompleted.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
580
+ SleepcastEpisodeCompleted.prototype.timestampMs = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
581
581
 
582
582
  /**
583
583
  * SleepcastEpisodeCompleted sleepcastId.
@@ -619,8 +619,8 @@ $root.SleepcastEpisodeCompleted = (function() {
619
619
  SleepcastEpisodeCompleted.encode = function encode(message, writer) {
620
620
  if (!writer)
621
621
  writer = $Writer.create();
622
- if (message.timestamp != null && message.hasOwnProperty("timestamp"))
623
- writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.timestamp);
622
+ if (message.timestampMs != null && message.hasOwnProperty("timestampMs"))
623
+ writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.timestampMs);
624
624
  if (message.sleepcastId != null && message.hasOwnProperty("sleepcastId"))
625
625
  writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.sleepcastId);
626
626
  if (message.userId != null && message.hasOwnProperty("userId"))
@@ -660,7 +660,7 @@ $root.SleepcastEpisodeCompleted = (function() {
660
660
  var tag = reader.uint32();
661
661
  switch (tag >>> 3) {
662
662
  case 1:
663
- message.timestamp = reader.uint64();
663
+ message.timestampMs = reader.uint64();
664
664
  break;
665
665
  case 2:
666
666
  message.sleepcastId = reader.uint32();
@@ -703,9 +703,9 @@ $root.SleepcastEpisodeCompleted = (function() {
703
703
  SleepcastEpisodeCompleted.verify = function verify(message) {
704
704
  if (typeof message !== "object" || message === null)
705
705
  return "object expected";
706
- if (message.timestamp != null && message.hasOwnProperty("timestamp"))
707
- if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high)))
708
- return "timestamp: integer|Long expected";
706
+ if (message.timestampMs != null && message.hasOwnProperty("timestampMs"))
707
+ if (!$util.isInteger(message.timestampMs) && !(message.timestampMs && $util.isInteger(message.timestampMs.low) && $util.isInteger(message.timestampMs.high)))
708
+ return "timestampMs: integer|Long expected";
709
709
  if (message.sleepcastId != null && message.hasOwnProperty("sleepcastId"))
710
710
  if (!$util.isInteger(message.sleepcastId))
711
711
  return "sleepcastId: integer expected";
@@ -727,6 +727,252 @@ $root.SleepcastEpisodeCompleted = (function() {
727
727
  if (object instanceof $root.SleepcastEpisodeCompleted)
728
728
  return object;
729
729
  var message = new $root.SleepcastEpisodeCompleted();
730
+ if (object.timestampMs != null)
731
+ if ($util.Long)
732
+ (message.timestampMs = $util.Long.fromValue(object.timestampMs)).unsigned = true;
733
+ else if (typeof object.timestampMs === "string")
734
+ message.timestampMs = parseInt(object.timestampMs, 10);
735
+ else if (typeof object.timestampMs === "number")
736
+ message.timestampMs = object.timestampMs;
737
+ else if (typeof object.timestampMs === "object")
738
+ message.timestampMs = new $util.LongBits(object.timestampMs.low >>> 0, object.timestampMs.high >>> 0).toNumber(true);
739
+ if (object.sleepcastId != null)
740
+ message.sleepcastId = object.sleepcastId >>> 0;
741
+ if (object.userId != null)
742
+ message.userId = String(object.userId);
743
+ return message;
744
+ };
745
+
746
+ /**
747
+ * Creates a plain object from a SleepcastEpisodeCompleted message. Also converts values to other types if specified.
748
+ * @function toObject
749
+ * @memberof SleepcastEpisodeCompleted
750
+ * @static
751
+ * @param {SleepcastEpisodeCompleted} message SleepcastEpisodeCompleted
752
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
753
+ * @returns {Object.<string,*>} Plain object
754
+ */
755
+ SleepcastEpisodeCompleted.toObject = function toObject(message, options) {
756
+ if (!options)
757
+ options = {};
758
+ var object = {};
759
+ if (options.defaults) {
760
+ if ($util.Long) {
761
+ var long = new $util.Long(0, 0, true);
762
+ object.timestampMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
763
+ } else
764
+ object.timestampMs = options.longs === String ? "0" : 0;
765
+ object.sleepcastId = 0;
766
+ object.userId = "";
767
+ }
768
+ if (message.timestampMs != null && message.hasOwnProperty("timestampMs"))
769
+ if (typeof message.timestampMs === "number")
770
+ object.timestampMs = options.longs === String ? String(message.timestampMs) : message.timestampMs;
771
+ else
772
+ object.timestampMs = options.longs === String ? $util.Long.prototype.toString.call(message.timestampMs) : options.longs === Number ? new $util.LongBits(message.timestampMs.low >>> 0, message.timestampMs.high >>> 0).toNumber(true) : message.timestampMs;
773
+ if (message.sleepcastId != null && message.hasOwnProperty("sleepcastId"))
774
+ object.sleepcastId = message.sleepcastId;
775
+ if (message.userId != null && message.hasOwnProperty("userId"))
776
+ object.userId = message.userId;
777
+ return object;
778
+ };
779
+
780
+ /**
781
+ * Converts this SleepcastEpisodeCompleted to JSON.
782
+ * @function toJSON
783
+ * @memberof SleepcastEpisodeCompleted
784
+ * @instance
785
+ * @returns {Object.<string,*>} JSON object
786
+ */
787
+ SleepcastEpisodeCompleted.prototype.toJSON = function toJSON() {
788
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
789
+ };
790
+
791
+ return SleepcastEpisodeCompleted;
792
+ })();
793
+
794
+ $root.FirstSleepcastPlayDateSet = (function() {
795
+
796
+ /**
797
+ * Properties of a FirstSleepcastPlayDateSet.
798
+ * @exports IFirstSleepcastPlayDateSet
799
+ * @interface IFirstSleepcastPlayDateSet
800
+ * @property {number|Long|null} [timestamp] FirstSleepcastPlayDateSet timestamp
801
+ * @property {string|null} [userId] FirstSleepcastPlayDateSet userId
802
+ * @property {string|null} [firstPlayDate] FirstSleepcastPlayDateSet firstPlayDate
803
+ */
804
+
805
+ /**
806
+ * Constructs a new FirstSleepcastPlayDateSet.
807
+ * @exports FirstSleepcastPlayDateSet
808
+ * @classdesc Represents a FirstSleepcastPlayDateSet.
809
+ * @implements IFirstSleepcastPlayDateSet
810
+ * @constructor
811
+ * @param {IFirstSleepcastPlayDateSet=} [properties] Properties to set
812
+ */
813
+ function FirstSleepcastPlayDateSet(properties) {
814
+ if (properties)
815
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
816
+ if (properties[keys[i]] != null)
817
+ this[keys[i]] = properties[keys[i]];
818
+ }
819
+
820
+ /**
821
+ * FirstSleepcastPlayDateSet timestamp.
822
+ * @member {number|Long} timestamp
823
+ * @memberof FirstSleepcastPlayDateSet
824
+ * @instance
825
+ */
826
+ FirstSleepcastPlayDateSet.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
827
+
828
+ /**
829
+ * FirstSleepcastPlayDateSet userId.
830
+ * @member {string} userId
831
+ * @memberof FirstSleepcastPlayDateSet
832
+ * @instance
833
+ */
834
+ FirstSleepcastPlayDateSet.prototype.userId = "";
835
+
836
+ /**
837
+ * FirstSleepcastPlayDateSet firstPlayDate.
838
+ * @member {string} firstPlayDate
839
+ * @memberof FirstSleepcastPlayDateSet
840
+ * @instance
841
+ */
842
+ FirstSleepcastPlayDateSet.prototype.firstPlayDate = "";
843
+
844
+ /**
845
+ * Creates a new FirstSleepcastPlayDateSet instance using the specified properties.
846
+ * @function create
847
+ * @memberof FirstSleepcastPlayDateSet
848
+ * @static
849
+ * @param {IFirstSleepcastPlayDateSet=} [properties] Properties to set
850
+ * @returns {FirstSleepcastPlayDateSet} FirstSleepcastPlayDateSet instance
851
+ */
852
+ FirstSleepcastPlayDateSet.create = function create(properties) {
853
+ return new FirstSleepcastPlayDateSet(properties);
854
+ };
855
+
856
+ /**
857
+ * Encodes the specified FirstSleepcastPlayDateSet message. Does not implicitly {@link FirstSleepcastPlayDateSet.verify|verify} messages.
858
+ * @function encode
859
+ * @memberof FirstSleepcastPlayDateSet
860
+ * @static
861
+ * @param {IFirstSleepcastPlayDateSet} message FirstSleepcastPlayDateSet message or plain object to encode
862
+ * @param {$protobuf.Writer} [writer] Writer to encode to
863
+ * @returns {$protobuf.Writer} Writer
864
+ */
865
+ FirstSleepcastPlayDateSet.encode = function encode(message, writer) {
866
+ if (!writer)
867
+ writer = $Writer.create();
868
+ if (message.timestamp != null && message.hasOwnProperty("timestamp"))
869
+ writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.timestamp);
870
+ if (message.userId != null && message.hasOwnProperty("userId"))
871
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.userId);
872
+ if (message.firstPlayDate != null && message.hasOwnProperty("firstPlayDate"))
873
+ writer.uint32(/* id 3, wireType 2 =*/26).string(message.firstPlayDate);
874
+ return writer;
875
+ };
876
+
877
+ /**
878
+ * Encodes the specified FirstSleepcastPlayDateSet message, length delimited. Does not implicitly {@link FirstSleepcastPlayDateSet.verify|verify} messages.
879
+ * @function encodeDelimited
880
+ * @memberof FirstSleepcastPlayDateSet
881
+ * @static
882
+ * @param {IFirstSleepcastPlayDateSet} message FirstSleepcastPlayDateSet message or plain object to encode
883
+ * @param {$protobuf.Writer} [writer] Writer to encode to
884
+ * @returns {$protobuf.Writer} Writer
885
+ */
886
+ FirstSleepcastPlayDateSet.encodeDelimited = function encodeDelimited(message, writer) {
887
+ return this.encode(message, writer).ldelim();
888
+ };
889
+
890
+ /**
891
+ * Decodes a FirstSleepcastPlayDateSet message from the specified reader or buffer.
892
+ * @function decode
893
+ * @memberof FirstSleepcastPlayDateSet
894
+ * @static
895
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
896
+ * @param {number} [length] Message length if known beforehand
897
+ * @returns {FirstSleepcastPlayDateSet} FirstSleepcastPlayDateSet
898
+ * @throws {Error} If the payload is not a reader or valid buffer
899
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
900
+ */
901
+ FirstSleepcastPlayDateSet.decode = function decode(reader, length) {
902
+ if (!(reader instanceof $Reader))
903
+ reader = $Reader.create(reader);
904
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.FirstSleepcastPlayDateSet();
905
+ while (reader.pos < end) {
906
+ var tag = reader.uint32();
907
+ switch (tag >>> 3) {
908
+ case 1:
909
+ message.timestamp = reader.uint64();
910
+ break;
911
+ case 2:
912
+ message.userId = reader.string();
913
+ break;
914
+ case 3:
915
+ message.firstPlayDate = reader.string();
916
+ break;
917
+ default:
918
+ reader.skipType(tag & 7);
919
+ break;
920
+ }
921
+ }
922
+ return message;
923
+ };
924
+
925
+ /**
926
+ * Decodes a FirstSleepcastPlayDateSet message from the specified reader or buffer, length delimited.
927
+ * @function decodeDelimited
928
+ * @memberof FirstSleepcastPlayDateSet
929
+ * @static
930
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
931
+ * @returns {FirstSleepcastPlayDateSet} FirstSleepcastPlayDateSet
932
+ * @throws {Error} If the payload is not a reader or valid buffer
933
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
934
+ */
935
+ FirstSleepcastPlayDateSet.decodeDelimited = function decodeDelimited(reader) {
936
+ if (!(reader instanceof $Reader))
937
+ reader = new $Reader(reader);
938
+ return this.decode(reader, reader.uint32());
939
+ };
940
+
941
+ /**
942
+ * Verifies a FirstSleepcastPlayDateSet message.
943
+ * @function verify
944
+ * @memberof FirstSleepcastPlayDateSet
945
+ * @static
946
+ * @param {Object.<string,*>} message Plain object to verify
947
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
948
+ */
949
+ FirstSleepcastPlayDateSet.verify = function verify(message) {
950
+ if (typeof message !== "object" || message === null)
951
+ return "object expected";
952
+ if (message.timestamp != null && message.hasOwnProperty("timestamp"))
953
+ if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high)))
954
+ return "timestamp: integer|Long expected";
955
+ if (message.userId != null && message.hasOwnProperty("userId"))
956
+ if (!$util.isString(message.userId))
957
+ return "userId: string expected";
958
+ if (message.firstPlayDate != null && message.hasOwnProperty("firstPlayDate"))
959
+ if (!$util.isString(message.firstPlayDate))
960
+ return "firstPlayDate: string expected";
961
+ return null;
962
+ };
963
+
964
+ /**
965
+ * Creates a FirstSleepcastPlayDateSet message from a plain object. Also converts values to their respective internal types.
966
+ * @function fromObject
967
+ * @memberof FirstSleepcastPlayDateSet
968
+ * @static
969
+ * @param {Object.<string,*>} object Plain object
970
+ * @returns {FirstSleepcastPlayDateSet} FirstSleepcastPlayDateSet
971
+ */
972
+ FirstSleepcastPlayDateSet.fromObject = function fromObject(object) {
973
+ if (object instanceof $root.FirstSleepcastPlayDateSet)
974
+ return object;
975
+ var message = new $root.FirstSleepcastPlayDateSet();
730
976
  if (object.timestamp != null)
731
977
  if ($util.Long)
732
978
  (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true;
@@ -736,23 +982,23 @@ $root.SleepcastEpisodeCompleted = (function() {
736
982
  message.timestamp = object.timestamp;
737
983
  else if (typeof object.timestamp === "object")
738
984
  message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true);
739
- if (object.sleepcastId != null)
740
- message.sleepcastId = object.sleepcastId >>> 0;
741
985
  if (object.userId != null)
742
986
  message.userId = String(object.userId);
987
+ if (object.firstPlayDate != null)
988
+ message.firstPlayDate = String(object.firstPlayDate);
743
989
  return message;
744
990
  };
745
991
 
746
992
  /**
747
- * Creates a plain object from a SleepcastEpisodeCompleted message. Also converts values to other types if specified.
993
+ * Creates a plain object from a FirstSleepcastPlayDateSet message. Also converts values to other types if specified.
748
994
  * @function toObject
749
- * @memberof SleepcastEpisodeCompleted
995
+ * @memberof FirstSleepcastPlayDateSet
750
996
  * @static
751
- * @param {SleepcastEpisodeCompleted} message SleepcastEpisodeCompleted
997
+ * @param {FirstSleepcastPlayDateSet} message FirstSleepcastPlayDateSet
752
998
  * @param {$protobuf.IConversionOptions} [options] Conversion options
753
999
  * @returns {Object.<string,*>} Plain object
754
1000
  */
755
- SleepcastEpisodeCompleted.toObject = function toObject(message, options) {
1001
+ FirstSleepcastPlayDateSet.toObject = function toObject(message, options) {
756
1002
  if (!options)
757
1003
  options = {};
758
1004
  var object = {};
@@ -762,33 +1008,279 @@ $root.SleepcastEpisodeCompleted = (function() {
762
1008
  object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
763
1009
  } else
764
1010
  object.timestamp = options.longs === String ? "0" : 0;
765
- object.sleepcastId = 0;
766
1011
  object.userId = "";
1012
+ object.firstPlayDate = "";
767
1013
  }
768
1014
  if (message.timestamp != null && message.hasOwnProperty("timestamp"))
769
1015
  if (typeof message.timestamp === "number")
770
1016
  object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp;
771
1017
  else
772
1018
  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;
773
- if (message.sleepcastId != null && message.hasOwnProperty("sleepcastId"))
774
- object.sleepcastId = message.sleepcastId;
775
1019
  if (message.userId != null && message.hasOwnProperty("userId"))
776
1020
  object.userId = message.userId;
1021
+ if (message.firstPlayDate != null && message.hasOwnProperty("firstPlayDate"))
1022
+ object.firstPlayDate = message.firstPlayDate;
777
1023
  return object;
778
1024
  };
779
1025
 
780
1026
  /**
781
- * Converts this SleepcastEpisodeCompleted to JSON.
1027
+ * Converts this FirstSleepcastPlayDateSet to JSON.
782
1028
  * @function toJSON
783
- * @memberof SleepcastEpisodeCompleted
1029
+ * @memberof FirstSleepcastPlayDateSet
784
1030
  * @instance
785
1031
  * @returns {Object.<string,*>} JSON object
786
1032
  */
787
- SleepcastEpisodeCompleted.prototype.toJSON = function toJSON() {
1033
+ FirstSleepcastPlayDateSet.prototype.toJSON = function toJSON() {
788
1034
  return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
789
1035
  };
790
1036
 
791
- return SleepcastEpisodeCompleted;
1037
+ return FirstSleepcastPlayDateSet;
1038
+ })();
1039
+
1040
+ $root.NumSleepcastPlaysSet = (function() {
1041
+
1042
+ /**
1043
+ * Properties of a NumSleepcastPlaysSet.
1044
+ * @exports INumSleepcastPlaysSet
1045
+ * @interface INumSleepcastPlaysSet
1046
+ * @property {number|Long|null} [timestamp] NumSleepcastPlaysSet timestamp
1047
+ * @property {string|null} [userId] NumSleepcastPlaysSet userId
1048
+ * @property {number|null} [numPlays] NumSleepcastPlaysSet numPlays
1049
+ */
1050
+
1051
+ /**
1052
+ * Constructs a new NumSleepcastPlaysSet.
1053
+ * @exports NumSleepcastPlaysSet
1054
+ * @classdesc Represents a NumSleepcastPlaysSet.
1055
+ * @implements INumSleepcastPlaysSet
1056
+ * @constructor
1057
+ * @param {INumSleepcastPlaysSet=} [properties] Properties to set
1058
+ */
1059
+ function NumSleepcastPlaysSet(properties) {
1060
+ if (properties)
1061
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1062
+ if (properties[keys[i]] != null)
1063
+ this[keys[i]] = properties[keys[i]];
1064
+ }
1065
+
1066
+ /**
1067
+ * NumSleepcastPlaysSet timestamp.
1068
+ * @member {number|Long} timestamp
1069
+ * @memberof NumSleepcastPlaysSet
1070
+ * @instance
1071
+ */
1072
+ NumSleepcastPlaysSet.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
1073
+
1074
+ /**
1075
+ * NumSleepcastPlaysSet userId.
1076
+ * @member {string} userId
1077
+ * @memberof NumSleepcastPlaysSet
1078
+ * @instance
1079
+ */
1080
+ NumSleepcastPlaysSet.prototype.userId = "";
1081
+
1082
+ /**
1083
+ * NumSleepcastPlaysSet numPlays.
1084
+ * @member {number} numPlays
1085
+ * @memberof NumSleepcastPlaysSet
1086
+ * @instance
1087
+ */
1088
+ NumSleepcastPlaysSet.prototype.numPlays = 0;
1089
+
1090
+ /**
1091
+ * Creates a new NumSleepcastPlaysSet instance using the specified properties.
1092
+ * @function create
1093
+ * @memberof NumSleepcastPlaysSet
1094
+ * @static
1095
+ * @param {INumSleepcastPlaysSet=} [properties] Properties to set
1096
+ * @returns {NumSleepcastPlaysSet} NumSleepcastPlaysSet instance
1097
+ */
1098
+ NumSleepcastPlaysSet.create = function create(properties) {
1099
+ return new NumSleepcastPlaysSet(properties);
1100
+ };
1101
+
1102
+ /**
1103
+ * Encodes the specified NumSleepcastPlaysSet message. Does not implicitly {@link NumSleepcastPlaysSet.verify|verify} messages.
1104
+ * @function encode
1105
+ * @memberof NumSleepcastPlaysSet
1106
+ * @static
1107
+ * @param {INumSleepcastPlaysSet} message NumSleepcastPlaysSet message or plain object to encode
1108
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1109
+ * @returns {$protobuf.Writer} Writer
1110
+ */
1111
+ NumSleepcastPlaysSet.encode = function encode(message, writer) {
1112
+ if (!writer)
1113
+ writer = $Writer.create();
1114
+ if (message.timestamp != null && message.hasOwnProperty("timestamp"))
1115
+ writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.timestamp);
1116
+ if (message.userId != null && message.hasOwnProperty("userId"))
1117
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.userId);
1118
+ if (message.numPlays != null && message.hasOwnProperty("numPlays"))
1119
+ writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.numPlays);
1120
+ return writer;
1121
+ };
1122
+
1123
+ /**
1124
+ * Encodes the specified NumSleepcastPlaysSet message, length delimited. Does not implicitly {@link NumSleepcastPlaysSet.verify|verify} messages.
1125
+ * @function encodeDelimited
1126
+ * @memberof NumSleepcastPlaysSet
1127
+ * @static
1128
+ * @param {INumSleepcastPlaysSet} message NumSleepcastPlaysSet message or plain object to encode
1129
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1130
+ * @returns {$protobuf.Writer} Writer
1131
+ */
1132
+ NumSleepcastPlaysSet.encodeDelimited = function encodeDelimited(message, writer) {
1133
+ return this.encode(message, writer).ldelim();
1134
+ };
1135
+
1136
+ /**
1137
+ * Decodes a NumSleepcastPlaysSet message from the specified reader or buffer.
1138
+ * @function decode
1139
+ * @memberof NumSleepcastPlaysSet
1140
+ * @static
1141
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1142
+ * @param {number} [length] Message length if known beforehand
1143
+ * @returns {NumSleepcastPlaysSet} NumSleepcastPlaysSet
1144
+ * @throws {Error} If the payload is not a reader or valid buffer
1145
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1146
+ */
1147
+ NumSleepcastPlaysSet.decode = function decode(reader, length) {
1148
+ if (!(reader instanceof $Reader))
1149
+ reader = $Reader.create(reader);
1150
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.NumSleepcastPlaysSet();
1151
+ while (reader.pos < end) {
1152
+ var tag = reader.uint32();
1153
+ switch (tag >>> 3) {
1154
+ case 1:
1155
+ message.timestamp = reader.uint64();
1156
+ break;
1157
+ case 2:
1158
+ message.userId = reader.string();
1159
+ break;
1160
+ case 3:
1161
+ message.numPlays = reader.uint32();
1162
+ break;
1163
+ default:
1164
+ reader.skipType(tag & 7);
1165
+ break;
1166
+ }
1167
+ }
1168
+ return message;
1169
+ };
1170
+
1171
+ /**
1172
+ * Decodes a NumSleepcastPlaysSet message from the specified reader or buffer, length delimited.
1173
+ * @function decodeDelimited
1174
+ * @memberof NumSleepcastPlaysSet
1175
+ * @static
1176
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1177
+ * @returns {NumSleepcastPlaysSet} NumSleepcastPlaysSet
1178
+ * @throws {Error} If the payload is not a reader or valid buffer
1179
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1180
+ */
1181
+ NumSleepcastPlaysSet.decodeDelimited = function decodeDelimited(reader) {
1182
+ if (!(reader instanceof $Reader))
1183
+ reader = new $Reader(reader);
1184
+ return this.decode(reader, reader.uint32());
1185
+ };
1186
+
1187
+ /**
1188
+ * Verifies a NumSleepcastPlaysSet message.
1189
+ * @function verify
1190
+ * @memberof NumSleepcastPlaysSet
1191
+ * @static
1192
+ * @param {Object.<string,*>} message Plain object to verify
1193
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
1194
+ */
1195
+ NumSleepcastPlaysSet.verify = function verify(message) {
1196
+ if (typeof message !== "object" || message === null)
1197
+ return "object expected";
1198
+ if (message.timestamp != null && message.hasOwnProperty("timestamp"))
1199
+ if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high)))
1200
+ return "timestamp: integer|Long expected";
1201
+ if (message.userId != null && message.hasOwnProperty("userId"))
1202
+ if (!$util.isString(message.userId))
1203
+ return "userId: string expected";
1204
+ if (message.numPlays != null && message.hasOwnProperty("numPlays"))
1205
+ if (!$util.isInteger(message.numPlays))
1206
+ return "numPlays: integer expected";
1207
+ return null;
1208
+ };
1209
+
1210
+ /**
1211
+ * Creates a NumSleepcastPlaysSet message from a plain object. Also converts values to their respective internal types.
1212
+ * @function fromObject
1213
+ * @memberof NumSleepcastPlaysSet
1214
+ * @static
1215
+ * @param {Object.<string,*>} object Plain object
1216
+ * @returns {NumSleepcastPlaysSet} NumSleepcastPlaysSet
1217
+ */
1218
+ NumSleepcastPlaysSet.fromObject = function fromObject(object) {
1219
+ if (object instanceof $root.NumSleepcastPlaysSet)
1220
+ return object;
1221
+ var message = new $root.NumSleepcastPlaysSet();
1222
+ if (object.timestamp != null)
1223
+ if ($util.Long)
1224
+ (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true;
1225
+ else if (typeof object.timestamp === "string")
1226
+ message.timestamp = parseInt(object.timestamp, 10);
1227
+ else if (typeof object.timestamp === "number")
1228
+ message.timestamp = object.timestamp;
1229
+ else if (typeof object.timestamp === "object")
1230
+ message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true);
1231
+ if (object.userId != null)
1232
+ message.userId = String(object.userId);
1233
+ if (object.numPlays != null)
1234
+ message.numPlays = object.numPlays >>> 0;
1235
+ return message;
1236
+ };
1237
+
1238
+ /**
1239
+ * Creates a plain object from a NumSleepcastPlaysSet message. Also converts values to other types if specified.
1240
+ * @function toObject
1241
+ * @memberof NumSleepcastPlaysSet
1242
+ * @static
1243
+ * @param {NumSleepcastPlaysSet} message NumSleepcastPlaysSet
1244
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
1245
+ * @returns {Object.<string,*>} Plain object
1246
+ */
1247
+ NumSleepcastPlaysSet.toObject = function toObject(message, options) {
1248
+ if (!options)
1249
+ options = {};
1250
+ var object = {};
1251
+ if (options.defaults) {
1252
+ if ($util.Long) {
1253
+ var long = new $util.Long(0, 0, true);
1254
+ object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
1255
+ } else
1256
+ object.timestamp = options.longs === String ? "0" : 0;
1257
+ object.userId = "";
1258
+ object.numPlays = 0;
1259
+ }
1260
+ if (message.timestamp != null && message.hasOwnProperty("timestamp"))
1261
+ if (typeof message.timestamp === "number")
1262
+ object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp;
1263
+ else
1264
+ 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;
1265
+ if (message.userId != null && message.hasOwnProperty("userId"))
1266
+ object.userId = message.userId;
1267
+ if (message.numPlays != null && message.hasOwnProperty("numPlays"))
1268
+ object.numPlays = message.numPlays;
1269
+ return object;
1270
+ };
1271
+
1272
+ /**
1273
+ * Converts this NumSleepcastPlaysSet to JSON.
1274
+ * @function toJSON
1275
+ * @memberof NumSleepcastPlaysSet
1276
+ * @instance
1277
+ * @returns {Object.<string,*>} JSON object
1278
+ */
1279
+ NumSleepcastPlaysSet.prototype.toJSON = function toJSON() {
1280
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1281
+ };
1282
+
1283
+ return NumSleepcastPlaysSet;
792
1284
  })();
793
1285
 
794
1286
  $root.SubscriptionCreated = (function() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@headspace/protos-events",
3
- "version": "0.0.7-alpha.0",
3
+ "version": "0.0.8-alpha.0",
4
4
  "main": "lib/index.js",
5
5
  "typings": "lib/index.d.ts",
6
6
  "scripts": {
@@ -16,5 +16,5 @@
16
16
  "devDependencies": {
17
17
  "typescript": "^3.0.1"
18
18
  },
19
- "gitHead": "558bc9568b5de28e571a58f3a855fc25a75ef0c8"
19
+ "gitHead": "d1366d67d1a7d00fdc0a058a1a7ef53c19bcd849"
20
20
  }
package/sleep.proto CHANGED
@@ -1,7 +1,19 @@
1
1
  syntax = "proto3";
2
2
 
3
3
  message SleepcastEpisodeCompleted {
4
- uint64 timestamp = 1;
4
+ uint64 timestampMs = 1;
5
5
  uint32 sleepcastId = 2;
6
6
  string userId = 3;
7
7
  }
8
+
9
+ message FirstSleepcastPlayDateSet {
10
+ uint64 timestamp = 1;
11
+ string userId = 2;
12
+ string firstPlayDate = 3;
13
+ }
14
+
15
+ message NumSleepcastPlaysSet {
16
+ uint64 timestamp = 1;
17
+ string userId = 2;
18
+ uint32 numPlays = 3;
19
+ }