@headspace/protos-events 1.236.0 → 1.237.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 (3) hide show
  1. package/lib/index.d.ts +601 -0
  2. package/lib/index.js +1491 -0
  3. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -322,6 +322,1219 @@ $root.auth0 = (function() {
322
322
  return auth0;
323
323
  })();
324
324
 
325
+ $root.content = (function() {
326
+
327
+ /**
328
+ * Namespace content.
329
+ * @exports content
330
+ * @namespace
331
+ */
332
+ var content = {};
333
+
334
+ content.UserStatManager = (function() {
335
+
336
+ /**
337
+ * Constructs a new UserStatManager service.
338
+ * @memberof content
339
+ * @classdesc Represents a UserStatManager
340
+ * @extends $protobuf.rpc.Service
341
+ * @constructor
342
+ * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
343
+ * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
344
+ * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
345
+ */
346
+ function UserStatManager(rpcImpl, requestDelimited, responseDelimited) {
347
+ $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
348
+ }
349
+
350
+ (UserStatManager.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = UserStatManager;
351
+
352
+ /**
353
+ * Creates new UserStatManager service using the specified rpc implementation.
354
+ * @function create
355
+ * @memberof content.UserStatManager
356
+ * @static
357
+ * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
358
+ * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
359
+ * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
360
+ * @returns {UserStatManager} RPC service. Useful where requests and/or responses are streamed.
361
+ */
362
+ UserStatManager.create = function create(rpcImpl, requestDelimited, responseDelimited) {
363
+ return new this(rpcImpl, requestDelimited, responseDelimited);
364
+ };
365
+
366
+ /**
367
+ * Callback as used by {@link content.UserStatManager#getStatsForUser}.
368
+ * @memberof content.UserStatManager
369
+ * @typedef getStatsForUserCallback
370
+ * @type {function}
371
+ * @param {Error|null} error Error, if any
372
+ * @param {content.GetStatsResponse} [response] GetStatsResponse
373
+ */
374
+
375
+ /**
376
+ * Calls getStatsForUser.
377
+ * @function getStatsForUser
378
+ * @memberof content.UserStatManager
379
+ * @instance
380
+ * @param {content.IGetStatsRequest} request GetStatsRequest message or plain object
381
+ * @param {content.UserStatManager.getStatsForUserCallback} callback Node-style callback called with the error, if any, and GetStatsResponse
382
+ * @returns {undefined}
383
+ * @variation 1
384
+ */
385
+ Object.defineProperty(UserStatManager.prototype.getStatsForUser = function getStatsForUser(request, callback) {
386
+ return this.rpcCall(getStatsForUser, $root.content.GetStatsRequest, $root.content.GetStatsResponse, request, callback);
387
+ }, "name", { value: "getStatsForUser" });
388
+
389
+ /**
390
+ * Calls getStatsForUser.
391
+ * @function getStatsForUser
392
+ * @memberof content.UserStatManager
393
+ * @instance
394
+ * @param {content.IGetStatsRequest} request GetStatsRequest message or plain object
395
+ * @returns {Promise<content.GetStatsResponse>} Promise
396
+ * @variation 2
397
+ */
398
+
399
+ return UserStatManager;
400
+ })();
401
+
402
+ content.GetStatsRequest = (function() {
403
+
404
+ /**
405
+ * Properties of a GetStatsRequest.
406
+ * @memberof content
407
+ * @interface IGetStatsRequest
408
+ * @property {string|null} [userId] GetStatsRequest userId
409
+ */
410
+
411
+ /**
412
+ * Constructs a new GetStatsRequest.
413
+ * @memberof content
414
+ * @classdesc Represents a GetStatsRequest.
415
+ * @implements IGetStatsRequest
416
+ * @constructor
417
+ * @param {content.IGetStatsRequest=} [properties] Properties to set
418
+ */
419
+ function GetStatsRequest(properties) {
420
+ if (properties)
421
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
422
+ if (properties[keys[i]] != null)
423
+ this[keys[i]] = properties[keys[i]];
424
+ }
425
+
426
+ /**
427
+ * GetStatsRequest userId.
428
+ * @member {string} userId
429
+ * @memberof content.GetStatsRequest
430
+ * @instance
431
+ */
432
+ GetStatsRequest.prototype.userId = "";
433
+
434
+ /**
435
+ * Creates a new GetStatsRequest instance using the specified properties.
436
+ * @function create
437
+ * @memberof content.GetStatsRequest
438
+ * @static
439
+ * @param {content.IGetStatsRequest=} [properties] Properties to set
440
+ * @returns {content.GetStatsRequest} GetStatsRequest instance
441
+ */
442
+ GetStatsRequest.create = function create(properties) {
443
+ return new GetStatsRequest(properties);
444
+ };
445
+
446
+ /**
447
+ * Encodes the specified GetStatsRequest message. Does not implicitly {@link content.GetStatsRequest.verify|verify} messages.
448
+ * @function encode
449
+ * @memberof content.GetStatsRequest
450
+ * @static
451
+ * @param {content.IGetStatsRequest} message GetStatsRequest message or plain object to encode
452
+ * @param {$protobuf.Writer} [writer] Writer to encode to
453
+ * @returns {$protobuf.Writer} Writer
454
+ */
455
+ GetStatsRequest.encode = function encode(message, writer) {
456
+ if (!writer)
457
+ writer = $Writer.create();
458
+ if (message.userId != null && message.hasOwnProperty("userId"))
459
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.userId);
460
+ return writer;
461
+ };
462
+
463
+ /**
464
+ * Encodes the specified GetStatsRequest message, length delimited. Does not implicitly {@link content.GetStatsRequest.verify|verify} messages.
465
+ * @function encodeDelimited
466
+ * @memberof content.GetStatsRequest
467
+ * @static
468
+ * @param {content.IGetStatsRequest} message GetStatsRequest message or plain object to encode
469
+ * @param {$protobuf.Writer} [writer] Writer to encode to
470
+ * @returns {$protobuf.Writer} Writer
471
+ */
472
+ GetStatsRequest.encodeDelimited = function encodeDelimited(message, writer) {
473
+ return this.encode(message, writer).ldelim();
474
+ };
475
+
476
+ /**
477
+ * Decodes a GetStatsRequest message from the specified reader or buffer.
478
+ * @function decode
479
+ * @memberof content.GetStatsRequest
480
+ * @static
481
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
482
+ * @param {number} [length] Message length if known beforehand
483
+ * @returns {content.GetStatsRequest} GetStatsRequest
484
+ * @throws {Error} If the payload is not a reader or valid buffer
485
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
486
+ */
487
+ GetStatsRequest.decode = function decode(reader, length) {
488
+ if (!(reader instanceof $Reader))
489
+ reader = $Reader.create(reader);
490
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.content.GetStatsRequest();
491
+ while (reader.pos < end) {
492
+ var tag = reader.uint32();
493
+ switch (tag >>> 3) {
494
+ case 1:
495
+ message.userId = reader.string();
496
+ break;
497
+ default:
498
+ reader.skipType(tag & 7);
499
+ break;
500
+ }
501
+ }
502
+ return message;
503
+ };
504
+
505
+ /**
506
+ * Decodes a GetStatsRequest message from the specified reader or buffer, length delimited.
507
+ * @function decodeDelimited
508
+ * @memberof content.GetStatsRequest
509
+ * @static
510
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
511
+ * @returns {content.GetStatsRequest} GetStatsRequest
512
+ * @throws {Error} If the payload is not a reader or valid buffer
513
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
514
+ */
515
+ GetStatsRequest.decodeDelimited = function decodeDelimited(reader) {
516
+ if (!(reader instanceof $Reader))
517
+ reader = new $Reader(reader);
518
+ return this.decode(reader, reader.uint32());
519
+ };
520
+
521
+ /**
522
+ * Verifies a GetStatsRequest message.
523
+ * @function verify
524
+ * @memberof content.GetStatsRequest
525
+ * @static
526
+ * @param {Object.<string,*>} message Plain object to verify
527
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
528
+ */
529
+ GetStatsRequest.verify = function verify(message) {
530
+ if (typeof message !== "object" || message === null)
531
+ return "object expected";
532
+ if (message.userId != null && message.hasOwnProperty("userId"))
533
+ if (!$util.isString(message.userId))
534
+ return "userId: string expected";
535
+ return null;
536
+ };
537
+
538
+ /**
539
+ * Creates a GetStatsRequest message from a plain object. Also converts values to their respective internal types.
540
+ * @function fromObject
541
+ * @memberof content.GetStatsRequest
542
+ * @static
543
+ * @param {Object.<string,*>} object Plain object
544
+ * @returns {content.GetStatsRequest} GetStatsRequest
545
+ */
546
+ GetStatsRequest.fromObject = function fromObject(object) {
547
+ if (object instanceof $root.content.GetStatsRequest)
548
+ return object;
549
+ var message = new $root.content.GetStatsRequest();
550
+ if (object.userId != null)
551
+ message.userId = String(object.userId);
552
+ return message;
553
+ };
554
+
555
+ /**
556
+ * Creates a plain object from a GetStatsRequest message. Also converts values to other types if specified.
557
+ * @function toObject
558
+ * @memberof content.GetStatsRequest
559
+ * @static
560
+ * @param {content.GetStatsRequest} message GetStatsRequest
561
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
562
+ * @returns {Object.<string,*>} Plain object
563
+ */
564
+ GetStatsRequest.toObject = function toObject(message, options) {
565
+ if (!options)
566
+ options = {};
567
+ var object = {};
568
+ if (options.defaults)
569
+ object.userId = "";
570
+ if (message.userId != null && message.hasOwnProperty("userId"))
571
+ object.userId = message.userId;
572
+ return object;
573
+ };
574
+
575
+ /**
576
+ * Converts this GetStatsRequest to JSON.
577
+ * @function toJSON
578
+ * @memberof content.GetStatsRequest
579
+ * @instance
580
+ * @returns {Object.<string,*>} JSON object
581
+ */
582
+ GetStatsRequest.prototype.toJSON = function toJSON() {
583
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
584
+ };
585
+
586
+ return GetStatsRequest;
587
+ })();
588
+
589
+ content.GetStatsResponse = (function() {
590
+
591
+ /**
592
+ * Properties of a GetStatsResponse.
593
+ * @memberof content
594
+ * @interface IGetStatsResponse
595
+ * @property {Array.<content.IUserStat>|null} [stats] GetStatsResponse stats
596
+ * @property {number|Long|null} [lastUserActivityCompletionId] GetStatsResponse lastUserActivityCompletionId
597
+ */
598
+
599
+ /**
600
+ * Constructs a new GetStatsResponse.
601
+ * @memberof content
602
+ * @classdesc Represents a GetStatsResponse.
603
+ * @implements IGetStatsResponse
604
+ * @constructor
605
+ * @param {content.IGetStatsResponse=} [properties] Properties to set
606
+ */
607
+ function GetStatsResponse(properties) {
608
+ this.stats = [];
609
+ if (properties)
610
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
611
+ if (properties[keys[i]] != null)
612
+ this[keys[i]] = properties[keys[i]];
613
+ }
614
+
615
+ /**
616
+ * GetStatsResponse stats.
617
+ * @member {Array.<content.IUserStat>} stats
618
+ * @memberof content.GetStatsResponse
619
+ * @instance
620
+ */
621
+ GetStatsResponse.prototype.stats = $util.emptyArray;
622
+
623
+ /**
624
+ * GetStatsResponse lastUserActivityCompletionId.
625
+ * @member {number|Long} lastUserActivityCompletionId
626
+ * @memberof content.GetStatsResponse
627
+ * @instance
628
+ */
629
+ GetStatsResponse.prototype.lastUserActivityCompletionId = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
630
+
631
+ /**
632
+ * Creates a new GetStatsResponse instance using the specified properties.
633
+ * @function create
634
+ * @memberof content.GetStatsResponse
635
+ * @static
636
+ * @param {content.IGetStatsResponse=} [properties] Properties to set
637
+ * @returns {content.GetStatsResponse} GetStatsResponse instance
638
+ */
639
+ GetStatsResponse.create = function create(properties) {
640
+ return new GetStatsResponse(properties);
641
+ };
642
+
643
+ /**
644
+ * Encodes the specified GetStatsResponse message. Does not implicitly {@link content.GetStatsResponse.verify|verify} messages.
645
+ * @function encode
646
+ * @memberof content.GetStatsResponse
647
+ * @static
648
+ * @param {content.IGetStatsResponse} message GetStatsResponse message or plain object to encode
649
+ * @param {$protobuf.Writer} [writer] Writer to encode to
650
+ * @returns {$protobuf.Writer} Writer
651
+ */
652
+ GetStatsResponse.encode = function encode(message, writer) {
653
+ if (!writer)
654
+ writer = $Writer.create();
655
+ if (message.stats != null && message.stats.length)
656
+ for (var i = 0; i < message.stats.length; ++i)
657
+ $root.content.UserStat.encode(message.stats[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
658
+ if (message.lastUserActivityCompletionId != null && message.hasOwnProperty("lastUserActivityCompletionId"))
659
+ writer.uint32(/* id 2, wireType 0 =*/16).int64(message.lastUserActivityCompletionId);
660
+ return writer;
661
+ };
662
+
663
+ /**
664
+ * Encodes the specified GetStatsResponse message, length delimited. Does not implicitly {@link content.GetStatsResponse.verify|verify} messages.
665
+ * @function encodeDelimited
666
+ * @memberof content.GetStatsResponse
667
+ * @static
668
+ * @param {content.IGetStatsResponse} message GetStatsResponse message or plain object to encode
669
+ * @param {$protobuf.Writer} [writer] Writer to encode to
670
+ * @returns {$protobuf.Writer} Writer
671
+ */
672
+ GetStatsResponse.encodeDelimited = function encodeDelimited(message, writer) {
673
+ return this.encode(message, writer).ldelim();
674
+ };
675
+
676
+ /**
677
+ * Decodes a GetStatsResponse message from the specified reader or buffer.
678
+ * @function decode
679
+ * @memberof content.GetStatsResponse
680
+ * @static
681
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
682
+ * @param {number} [length] Message length if known beforehand
683
+ * @returns {content.GetStatsResponse} GetStatsResponse
684
+ * @throws {Error} If the payload is not a reader or valid buffer
685
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
686
+ */
687
+ GetStatsResponse.decode = function decode(reader, length) {
688
+ if (!(reader instanceof $Reader))
689
+ reader = $Reader.create(reader);
690
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.content.GetStatsResponse();
691
+ while (reader.pos < end) {
692
+ var tag = reader.uint32();
693
+ switch (tag >>> 3) {
694
+ case 1:
695
+ if (!(message.stats && message.stats.length))
696
+ message.stats = [];
697
+ message.stats.push($root.content.UserStat.decode(reader, reader.uint32()));
698
+ break;
699
+ case 2:
700
+ message.lastUserActivityCompletionId = reader.int64();
701
+ break;
702
+ default:
703
+ reader.skipType(tag & 7);
704
+ break;
705
+ }
706
+ }
707
+ return message;
708
+ };
709
+
710
+ /**
711
+ * Decodes a GetStatsResponse message from the specified reader or buffer, length delimited.
712
+ * @function decodeDelimited
713
+ * @memberof content.GetStatsResponse
714
+ * @static
715
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
716
+ * @returns {content.GetStatsResponse} GetStatsResponse
717
+ * @throws {Error} If the payload is not a reader or valid buffer
718
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
719
+ */
720
+ GetStatsResponse.decodeDelimited = function decodeDelimited(reader) {
721
+ if (!(reader instanceof $Reader))
722
+ reader = new $Reader(reader);
723
+ return this.decode(reader, reader.uint32());
724
+ };
725
+
726
+ /**
727
+ * Verifies a GetStatsResponse message.
728
+ * @function verify
729
+ * @memberof content.GetStatsResponse
730
+ * @static
731
+ * @param {Object.<string,*>} message Plain object to verify
732
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
733
+ */
734
+ GetStatsResponse.verify = function verify(message) {
735
+ if (typeof message !== "object" || message === null)
736
+ return "object expected";
737
+ if (message.stats != null && message.hasOwnProperty("stats")) {
738
+ if (!Array.isArray(message.stats))
739
+ return "stats: array expected";
740
+ for (var i = 0; i < message.stats.length; ++i) {
741
+ var error = $root.content.UserStat.verify(message.stats[i]);
742
+ if (error)
743
+ return "stats." + error;
744
+ }
745
+ }
746
+ if (message.lastUserActivityCompletionId != null && message.hasOwnProperty("lastUserActivityCompletionId"))
747
+ if (!$util.isInteger(message.lastUserActivityCompletionId) && !(message.lastUserActivityCompletionId && $util.isInteger(message.lastUserActivityCompletionId.low) && $util.isInteger(message.lastUserActivityCompletionId.high)))
748
+ return "lastUserActivityCompletionId: integer|Long expected";
749
+ return null;
750
+ };
751
+
752
+ /**
753
+ * Creates a GetStatsResponse message from a plain object. Also converts values to their respective internal types.
754
+ * @function fromObject
755
+ * @memberof content.GetStatsResponse
756
+ * @static
757
+ * @param {Object.<string,*>} object Plain object
758
+ * @returns {content.GetStatsResponse} GetStatsResponse
759
+ */
760
+ GetStatsResponse.fromObject = function fromObject(object) {
761
+ if (object instanceof $root.content.GetStatsResponse)
762
+ return object;
763
+ var message = new $root.content.GetStatsResponse();
764
+ if (object.stats) {
765
+ if (!Array.isArray(object.stats))
766
+ throw TypeError(".content.GetStatsResponse.stats: array expected");
767
+ message.stats = [];
768
+ for (var i = 0; i < object.stats.length; ++i) {
769
+ if (typeof object.stats[i] !== "object")
770
+ throw TypeError(".content.GetStatsResponse.stats: object expected");
771
+ message.stats[i] = $root.content.UserStat.fromObject(object.stats[i]);
772
+ }
773
+ }
774
+ if (object.lastUserActivityCompletionId != null)
775
+ if ($util.Long)
776
+ (message.lastUserActivityCompletionId = $util.Long.fromValue(object.lastUserActivityCompletionId)).unsigned = false;
777
+ else if (typeof object.lastUserActivityCompletionId === "string")
778
+ message.lastUserActivityCompletionId = parseInt(object.lastUserActivityCompletionId, 10);
779
+ else if (typeof object.lastUserActivityCompletionId === "number")
780
+ message.lastUserActivityCompletionId = object.lastUserActivityCompletionId;
781
+ else if (typeof object.lastUserActivityCompletionId === "object")
782
+ message.lastUserActivityCompletionId = new $util.LongBits(object.lastUserActivityCompletionId.low >>> 0, object.lastUserActivityCompletionId.high >>> 0).toNumber();
783
+ return message;
784
+ };
785
+
786
+ /**
787
+ * Creates a plain object from a GetStatsResponse message. Also converts values to other types if specified.
788
+ * @function toObject
789
+ * @memberof content.GetStatsResponse
790
+ * @static
791
+ * @param {content.GetStatsResponse} message GetStatsResponse
792
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
793
+ * @returns {Object.<string,*>} Plain object
794
+ */
795
+ GetStatsResponse.toObject = function toObject(message, options) {
796
+ if (!options)
797
+ options = {};
798
+ var object = {};
799
+ if (options.arrays || options.defaults)
800
+ object.stats = [];
801
+ if (options.defaults)
802
+ if ($util.Long) {
803
+ var long = new $util.Long(0, 0, false);
804
+ object.lastUserActivityCompletionId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
805
+ } else
806
+ object.lastUserActivityCompletionId = options.longs === String ? "0" : 0;
807
+ if (message.stats && message.stats.length) {
808
+ object.stats = [];
809
+ for (var j = 0; j < message.stats.length; ++j)
810
+ object.stats[j] = $root.content.UserStat.toObject(message.stats[j], options);
811
+ }
812
+ if (message.lastUserActivityCompletionId != null && message.hasOwnProperty("lastUserActivityCompletionId"))
813
+ if (typeof message.lastUserActivityCompletionId === "number")
814
+ object.lastUserActivityCompletionId = options.longs === String ? String(message.lastUserActivityCompletionId) : message.lastUserActivityCompletionId;
815
+ else
816
+ object.lastUserActivityCompletionId = options.longs === String ? $util.Long.prototype.toString.call(message.lastUserActivityCompletionId) : options.longs === Number ? new $util.LongBits(message.lastUserActivityCompletionId.low >>> 0, message.lastUserActivityCompletionId.high >>> 0).toNumber() : message.lastUserActivityCompletionId;
817
+ return object;
818
+ };
819
+
820
+ /**
821
+ * Converts this GetStatsResponse to JSON.
822
+ * @function toJSON
823
+ * @memberof content.GetStatsResponse
824
+ * @instance
825
+ * @returns {Object.<string,*>} JSON object
826
+ */
827
+ GetStatsResponse.prototype.toJSON = function toJSON() {
828
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
829
+ };
830
+
831
+ return GetStatsResponse;
832
+ })();
833
+
834
+ content.UserStat = (function() {
835
+
836
+ /**
837
+ * Properties of a UserStat.
838
+ * @memberof content
839
+ * @interface IUserStat
840
+ * @property {number|Long|null} [id] UserStat id
841
+ * @property {string|null} [label] UserStat label
842
+ * @property {string|null} [userId] UserStat userId
843
+ * @property {number|null} [previousValue] UserStat previousValue
844
+ * @property {number|null} [currentValue] UserStat currentValue
845
+ * @property {date.IDate|null} [deletedAt] UserStat deletedAt
846
+ * @property {date.IDate|null} [clientUpdatedAt] UserStat clientUpdatedAt
847
+ * @property {date.IDate|null} [createdAt] UserStat createdAt
848
+ * @property {date.IDate|null} [updatedAt] UserStat updatedAt
849
+ * @property {date.IDate|null} [validUntil] UserStat validUntil
850
+ */
851
+
852
+ /**
853
+ * Constructs a new UserStat.
854
+ * @memberof content
855
+ * @classdesc Represents a UserStat.
856
+ * @implements IUserStat
857
+ * @constructor
858
+ * @param {content.IUserStat=} [properties] Properties to set
859
+ */
860
+ function UserStat(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
+ /**
868
+ * UserStat id.
869
+ * @member {number|Long} id
870
+ * @memberof content.UserStat
871
+ * @instance
872
+ */
873
+ UserStat.prototype.id = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
874
+
875
+ /**
876
+ * UserStat label.
877
+ * @member {string} label
878
+ * @memberof content.UserStat
879
+ * @instance
880
+ */
881
+ UserStat.prototype.label = "";
882
+
883
+ /**
884
+ * UserStat userId.
885
+ * @member {string} userId
886
+ * @memberof content.UserStat
887
+ * @instance
888
+ */
889
+ UserStat.prototype.userId = "";
890
+
891
+ /**
892
+ * UserStat previousValue.
893
+ * @member {number} previousValue
894
+ * @memberof content.UserStat
895
+ * @instance
896
+ */
897
+ UserStat.prototype.previousValue = 0;
898
+
899
+ /**
900
+ * UserStat currentValue.
901
+ * @member {number} currentValue
902
+ * @memberof content.UserStat
903
+ * @instance
904
+ */
905
+ UserStat.prototype.currentValue = 0;
906
+
907
+ /**
908
+ * UserStat deletedAt.
909
+ * @member {date.IDate|null|undefined} deletedAt
910
+ * @memberof content.UserStat
911
+ * @instance
912
+ */
913
+ UserStat.prototype.deletedAt = null;
914
+
915
+ /**
916
+ * UserStat clientUpdatedAt.
917
+ * @member {date.IDate|null|undefined} clientUpdatedAt
918
+ * @memberof content.UserStat
919
+ * @instance
920
+ */
921
+ UserStat.prototype.clientUpdatedAt = null;
922
+
923
+ /**
924
+ * UserStat createdAt.
925
+ * @member {date.IDate|null|undefined} createdAt
926
+ * @memberof content.UserStat
927
+ * @instance
928
+ */
929
+ UserStat.prototype.createdAt = null;
930
+
931
+ /**
932
+ * UserStat updatedAt.
933
+ * @member {date.IDate|null|undefined} updatedAt
934
+ * @memberof content.UserStat
935
+ * @instance
936
+ */
937
+ UserStat.prototype.updatedAt = null;
938
+
939
+ /**
940
+ * UserStat validUntil.
941
+ * @member {date.IDate|null|undefined} validUntil
942
+ * @memberof content.UserStat
943
+ * @instance
944
+ */
945
+ UserStat.prototype.validUntil = null;
946
+
947
+ /**
948
+ * Creates a new UserStat instance using the specified properties.
949
+ * @function create
950
+ * @memberof content.UserStat
951
+ * @static
952
+ * @param {content.IUserStat=} [properties] Properties to set
953
+ * @returns {content.UserStat} UserStat instance
954
+ */
955
+ UserStat.create = function create(properties) {
956
+ return new UserStat(properties);
957
+ };
958
+
959
+ /**
960
+ * Encodes the specified UserStat message. Does not implicitly {@link content.UserStat.verify|verify} messages.
961
+ * @function encode
962
+ * @memberof content.UserStat
963
+ * @static
964
+ * @param {content.IUserStat} message UserStat message or plain object to encode
965
+ * @param {$protobuf.Writer} [writer] Writer to encode to
966
+ * @returns {$protobuf.Writer} Writer
967
+ */
968
+ UserStat.encode = function encode(message, writer) {
969
+ if (!writer)
970
+ writer = $Writer.create();
971
+ if (message.id != null && message.hasOwnProperty("id"))
972
+ writer.uint32(/* id 1, wireType 0 =*/8).int64(message.id);
973
+ if (message.label != null && message.hasOwnProperty("label"))
974
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.label);
975
+ if (message.userId != null && message.hasOwnProperty("userId"))
976
+ writer.uint32(/* id 3, wireType 2 =*/26).string(message.userId);
977
+ if (message.previousValue != null && message.hasOwnProperty("previousValue"))
978
+ writer.uint32(/* id 4, wireType 0 =*/32).int32(message.previousValue);
979
+ if (message.currentValue != null && message.hasOwnProperty("currentValue"))
980
+ writer.uint32(/* id 5, wireType 0 =*/40).int32(message.currentValue);
981
+ if (message.deletedAt != null && message.hasOwnProperty("deletedAt"))
982
+ $root.date.Date.encode(message.deletedAt, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
983
+ if (message.clientUpdatedAt != null && message.hasOwnProperty("clientUpdatedAt"))
984
+ $root.date.Date.encode(message.clientUpdatedAt, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
985
+ if (message.createdAt != null && message.hasOwnProperty("createdAt"))
986
+ $root.date.Date.encode(message.createdAt, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
987
+ if (message.updatedAt != null && message.hasOwnProperty("updatedAt"))
988
+ $root.date.Date.encode(message.updatedAt, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
989
+ if (message.validUntil != null && message.hasOwnProperty("validUntil"))
990
+ $root.date.Date.encode(message.validUntil, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();
991
+ return writer;
992
+ };
993
+
994
+ /**
995
+ * Encodes the specified UserStat message, length delimited. Does not implicitly {@link content.UserStat.verify|verify} messages.
996
+ * @function encodeDelimited
997
+ * @memberof content.UserStat
998
+ * @static
999
+ * @param {content.IUserStat} message UserStat message or plain object to encode
1000
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1001
+ * @returns {$protobuf.Writer} Writer
1002
+ */
1003
+ UserStat.encodeDelimited = function encodeDelimited(message, writer) {
1004
+ return this.encode(message, writer).ldelim();
1005
+ };
1006
+
1007
+ /**
1008
+ * Decodes a UserStat message from the specified reader or buffer.
1009
+ * @function decode
1010
+ * @memberof content.UserStat
1011
+ * @static
1012
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1013
+ * @param {number} [length] Message length if known beforehand
1014
+ * @returns {content.UserStat} UserStat
1015
+ * @throws {Error} If the payload is not a reader or valid buffer
1016
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1017
+ */
1018
+ UserStat.decode = function decode(reader, length) {
1019
+ if (!(reader instanceof $Reader))
1020
+ reader = $Reader.create(reader);
1021
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.content.UserStat();
1022
+ while (reader.pos < end) {
1023
+ var tag = reader.uint32();
1024
+ switch (tag >>> 3) {
1025
+ case 1:
1026
+ message.id = reader.int64();
1027
+ break;
1028
+ case 2:
1029
+ message.label = reader.string();
1030
+ break;
1031
+ case 3:
1032
+ message.userId = reader.string();
1033
+ break;
1034
+ case 4:
1035
+ message.previousValue = reader.int32();
1036
+ break;
1037
+ case 5:
1038
+ message.currentValue = reader.int32();
1039
+ break;
1040
+ case 6:
1041
+ message.deletedAt = $root.date.Date.decode(reader, reader.uint32());
1042
+ break;
1043
+ case 7:
1044
+ message.clientUpdatedAt = $root.date.Date.decode(reader, reader.uint32());
1045
+ break;
1046
+ case 8:
1047
+ message.createdAt = $root.date.Date.decode(reader, reader.uint32());
1048
+ break;
1049
+ case 9:
1050
+ message.updatedAt = $root.date.Date.decode(reader, reader.uint32());
1051
+ break;
1052
+ case 10:
1053
+ message.validUntil = $root.date.Date.decode(reader, reader.uint32());
1054
+ break;
1055
+ default:
1056
+ reader.skipType(tag & 7);
1057
+ break;
1058
+ }
1059
+ }
1060
+ return message;
1061
+ };
1062
+
1063
+ /**
1064
+ * Decodes a UserStat message from the specified reader or buffer, length delimited.
1065
+ * @function decodeDelimited
1066
+ * @memberof content.UserStat
1067
+ * @static
1068
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1069
+ * @returns {content.UserStat} UserStat
1070
+ * @throws {Error} If the payload is not a reader or valid buffer
1071
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1072
+ */
1073
+ UserStat.decodeDelimited = function decodeDelimited(reader) {
1074
+ if (!(reader instanceof $Reader))
1075
+ reader = new $Reader(reader);
1076
+ return this.decode(reader, reader.uint32());
1077
+ };
1078
+
1079
+ /**
1080
+ * Verifies a UserStat message.
1081
+ * @function verify
1082
+ * @memberof content.UserStat
1083
+ * @static
1084
+ * @param {Object.<string,*>} message Plain object to verify
1085
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
1086
+ */
1087
+ UserStat.verify = function verify(message) {
1088
+ if (typeof message !== "object" || message === null)
1089
+ return "object expected";
1090
+ if (message.id != null && message.hasOwnProperty("id"))
1091
+ if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high)))
1092
+ return "id: integer|Long expected";
1093
+ if (message.label != null && message.hasOwnProperty("label"))
1094
+ if (!$util.isString(message.label))
1095
+ return "label: string expected";
1096
+ if (message.userId != null && message.hasOwnProperty("userId"))
1097
+ if (!$util.isString(message.userId))
1098
+ return "userId: string expected";
1099
+ if (message.previousValue != null && message.hasOwnProperty("previousValue"))
1100
+ if (!$util.isInteger(message.previousValue))
1101
+ return "previousValue: integer expected";
1102
+ if (message.currentValue != null && message.hasOwnProperty("currentValue"))
1103
+ if (!$util.isInteger(message.currentValue))
1104
+ return "currentValue: integer expected";
1105
+ if (message.deletedAt != null && message.hasOwnProperty("deletedAt")) {
1106
+ var error = $root.date.Date.verify(message.deletedAt);
1107
+ if (error)
1108
+ return "deletedAt." + error;
1109
+ }
1110
+ if (message.clientUpdatedAt != null && message.hasOwnProperty("clientUpdatedAt")) {
1111
+ var error = $root.date.Date.verify(message.clientUpdatedAt);
1112
+ if (error)
1113
+ return "clientUpdatedAt." + error;
1114
+ }
1115
+ if (message.createdAt != null && message.hasOwnProperty("createdAt")) {
1116
+ var error = $root.date.Date.verify(message.createdAt);
1117
+ if (error)
1118
+ return "createdAt." + error;
1119
+ }
1120
+ if (message.updatedAt != null && message.hasOwnProperty("updatedAt")) {
1121
+ var error = $root.date.Date.verify(message.updatedAt);
1122
+ if (error)
1123
+ return "updatedAt." + error;
1124
+ }
1125
+ if (message.validUntil != null && message.hasOwnProperty("validUntil")) {
1126
+ var error = $root.date.Date.verify(message.validUntil);
1127
+ if (error)
1128
+ return "validUntil." + error;
1129
+ }
1130
+ return null;
1131
+ };
1132
+
1133
+ /**
1134
+ * Creates a UserStat message from a plain object. Also converts values to their respective internal types.
1135
+ * @function fromObject
1136
+ * @memberof content.UserStat
1137
+ * @static
1138
+ * @param {Object.<string,*>} object Plain object
1139
+ * @returns {content.UserStat} UserStat
1140
+ */
1141
+ UserStat.fromObject = function fromObject(object) {
1142
+ if (object instanceof $root.content.UserStat)
1143
+ return object;
1144
+ var message = new $root.content.UserStat();
1145
+ if (object.id != null)
1146
+ if ($util.Long)
1147
+ (message.id = $util.Long.fromValue(object.id)).unsigned = false;
1148
+ else if (typeof object.id === "string")
1149
+ message.id = parseInt(object.id, 10);
1150
+ else if (typeof object.id === "number")
1151
+ message.id = object.id;
1152
+ else if (typeof object.id === "object")
1153
+ message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber();
1154
+ if (object.label != null)
1155
+ message.label = String(object.label);
1156
+ if (object.userId != null)
1157
+ message.userId = String(object.userId);
1158
+ if (object.previousValue != null)
1159
+ message.previousValue = object.previousValue | 0;
1160
+ if (object.currentValue != null)
1161
+ message.currentValue = object.currentValue | 0;
1162
+ if (object.deletedAt != null) {
1163
+ if (typeof object.deletedAt !== "object")
1164
+ throw TypeError(".content.UserStat.deletedAt: object expected");
1165
+ message.deletedAt = $root.date.Date.fromObject(object.deletedAt);
1166
+ }
1167
+ if (object.clientUpdatedAt != null) {
1168
+ if (typeof object.clientUpdatedAt !== "object")
1169
+ throw TypeError(".content.UserStat.clientUpdatedAt: object expected");
1170
+ message.clientUpdatedAt = $root.date.Date.fromObject(object.clientUpdatedAt);
1171
+ }
1172
+ if (object.createdAt != null) {
1173
+ if (typeof object.createdAt !== "object")
1174
+ throw TypeError(".content.UserStat.createdAt: object expected");
1175
+ message.createdAt = $root.date.Date.fromObject(object.createdAt);
1176
+ }
1177
+ if (object.updatedAt != null) {
1178
+ if (typeof object.updatedAt !== "object")
1179
+ throw TypeError(".content.UserStat.updatedAt: object expected");
1180
+ message.updatedAt = $root.date.Date.fromObject(object.updatedAt);
1181
+ }
1182
+ if (object.validUntil != null) {
1183
+ if (typeof object.validUntil !== "object")
1184
+ throw TypeError(".content.UserStat.validUntil: object expected");
1185
+ message.validUntil = $root.date.Date.fromObject(object.validUntil);
1186
+ }
1187
+ return message;
1188
+ };
1189
+
1190
+ /**
1191
+ * Creates a plain object from a UserStat message. Also converts values to other types if specified.
1192
+ * @function toObject
1193
+ * @memberof content.UserStat
1194
+ * @static
1195
+ * @param {content.UserStat} message UserStat
1196
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
1197
+ * @returns {Object.<string,*>} Plain object
1198
+ */
1199
+ UserStat.toObject = function toObject(message, options) {
1200
+ if (!options)
1201
+ options = {};
1202
+ var object = {};
1203
+ if (options.defaults) {
1204
+ if ($util.Long) {
1205
+ var long = new $util.Long(0, 0, false);
1206
+ object.id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
1207
+ } else
1208
+ object.id = options.longs === String ? "0" : 0;
1209
+ object.label = "";
1210
+ object.userId = "";
1211
+ object.previousValue = 0;
1212
+ object.currentValue = 0;
1213
+ object.deletedAt = null;
1214
+ object.clientUpdatedAt = null;
1215
+ object.createdAt = null;
1216
+ object.updatedAt = null;
1217
+ object.validUntil = null;
1218
+ }
1219
+ if (message.id != null && message.hasOwnProperty("id"))
1220
+ if (typeof message.id === "number")
1221
+ object.id = options.longs === String ? String(message.id) : message.id;
1222
+ else
1223
+ object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber() : message.id;
1224
+ if (message.label != null && message.hasOwnProperty("label"))
1225
+ object.label = message.label;
1226
+ if (message.userId != null && message.hasOwnProperty("userId"))
1227
+ object.userId = message.userId;
1228
+ if (message.previousValue != null && message.hasOwnProperty("previousValue"))
1229
+ object.previousValue = message.previousValue;
1230
+ if (message.currentValue != null && message.hasOwnProperty("currentValue"))
1231
+ object.currentValue = message.currentValue;
1232
+ if (message.deletedAt != null && message.hasOwnProperty("deletedAt"))
1233
+ object.deletedAt = $root.date.Date.toObject(message.deletedAt, options);
1234
+ if (message.clientUpdatedAt != null && message.hasOwnProperty("clientUpdatedAt"))
1235
+ object.clientUpdatedAt = $root.date.Date.toObject(message.clientUpdatedAt, options);
1236
+ if (message.createdAt != null && message.hasOwnProperty("createdAt"))
1237
+ object.createdAt = $root.date.Date.toObject(message.createdAt, options);
1238
+ if (message.updatedAt != null && message.hasOwnProperty("updatedAt"))
1239
+ object.updatedAt = $root.date.Date.toObject(message.updatedAt, options);
1240
+ if (message.validUntil != null && message.hasOwnProperty("validUntil"))
1241
+ object.validUntil = $root.date.Date.toObject(message.validUntil, options);
1242
+ return object;
1243
+ };
1244
+
1245
+ /**
1246
+ * Converts this UserStat to JSON.
1247
+ * @function toJSON
1248
+ * @memberof content.UserStat
1249
+ * @instance
1250
+ * @returns {Object.<string,*>} JSON object
1251
+ */
1252
+ UserStat.prototype.toJSON = function toJSON() {
1253
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1254
+ };
1255
+
1256
+ return UserStat;
1257
+ })();
1258
+
1259
+ content.UserStats = (function() {
1260
+
1261
+ /**
1262
+ * Properties of a UserStats.
1263
+ * @memberof content
1264
+ * @interface IUserStats
1265
+ * @property {number|null} [runStreak] UserStats runStreak
1266
+ * @property {number|null} [averageMinutes] UserStats averageMinutes
1267
+ * @property {number|null} [highestRunStreak] UserStats highestRunStreak
1268
+ * @property {number|null} [totalMinutes] UserStats totalMinutes
1269
+ * @property {number|null} [totalSessions] UserStats totalSessions
1270
+ */
1271
+
1272
+ /**
1273
+ * Constructs a new UserStats.
1274
+ * @memberof content
1275
+ * @classdesc Represents a UserStats.
1276
+ * @implements IUserStats
1277
+ * @constructor
1278
+ * @param {content.IUserStats=} [properties] Properties to set
1279
+ */
1280
+ function UserStats(properties) {
1281
+ if (properties)
1282
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1283
+ if (properties[keys[i]] != null)
1284
+ this[keys[i]] = properties[keys[i]];
1285
+ }
1286
+
1287
+ /**
1288
+ * UserStats runStreak.
1289
+ * @member {number} runStreak
1290
+ * @memberof content.UserStats
1291
+ * @instance
1292
+ */
1293
+ UserStats.prototype.runStreak = 0;
1294
+
1295
+ /**
1296
+ * UserStats averageMinutes.
1297
+ * @member {number} averageMinutes
1298
+ * @memberof content.UserStats
1299
+ * @instance
1300
+ */
1301
+ UserStats.prototype.averageMinutes = 0;
1302
+
1303
+ /**
1304
+ * UserStats highestRunStreak.
1305
+ * @member {number} highestRunStreak
1306
+ * @memberof content.UserStats
1307
+ * @instance
1308
+ */
1309
+ UserStats.prototype.highestRunStreak = 0;
1310
+
1311
+ /**
1312
+ * UserStats totalMinutes.
1313
+ * @member {number} totalMinutes
1314
+ * @memberof content.UserStats
1315
+ * @instance
1316
+ */
1317
+ UserStats.prototype.totalMinutes = 0;
1318
+
1319
+ /**
1320
+ * UserStats totalSessions.
1321
+ * @member {number} totalSessions
1322
+ * @memberof content.UserStats
1323
+ * @instance
1324
+ */
1325
+ UserStats.prototype.totalSessions = 0;
1326
+
1327
+ /**
1328
+ * Creates a new UserStats instance using the specified properties.
1329
+ * @function create
1330
+ * @memberof content.UserStats
1331
+ * @static
1332
+ * @param {content.IUserStats=} [properties] Properties to set
1333
+ * @returns {content.UserStats} UserStats instance
1334
+ */
1335
+ UserStats.create = function create(properties) {
1336
+ return new UserStats(properties);
1337
+ };
1338
+
1339
+ /**
1340
+ * Encodes the specified UserStats message. Does not implicitly {@link content.UserStats.verify|verify} messages.
1341
+ * @function encode
1342
+ * @memberof content.UserStats
1343
+ * @static
1344
+ * @param {content.IUserStats} message UserStats message or plain object to encode
1345
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1346
+ * @returns {$protobuf.Writer} Writer
1347
+ */
1348
+ UserStats.encode = function encode(message, writer) {
1349
+ if (!writer)
1350
+ writer = $Writer.create();
1351
+ if (message.runStreak != null && message.hasOwnProperty("runStreak"))
1352
+ writer.uint32(/* id 1, wireType 0 =*/8).int32(message.runStreak);
1353
+ if (message.averageMinutes != null && message.hasOwnProperty("averageMinutes"))
1354
+ writer.uint32(/* id 2, wireType 0 =*/16).int32(message.averageMinutes);
1355
+ if (message.highestRunStreak != null && message.hasOwnProperty("highestRunStreak"))
1356
+ writer.uint32(/* id 3, wireType 0 =*/24).int32(message.highestRunStreak);
1357
+ if (message.totalMinutes != null && message.hasOwnProperty("totalMinutes"))
1358
+ writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalMinutes);
1359
+ if (message.totalSessions != null && message.hasOwnProperty("totalSessions"))
1360
+ writer.uint32(/* id 5, wireType 0 =*/40).int32(message.totalSessions);
1361
+ return writer;
1362
+ };
1363
+
1364
+ /**
1365
+ * Encodes the specified UserStats message, length delimited. Does not implicitly {@link content.UserStats.verify|verify} messages.
1366
+ * @function encodeDelimited
1367
+ * @memberof content.UserStats
1368
+ * @static
1369
+ * @param {content.IUserStats} message UserStats message or plain object to encode
1370
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1371
+ * @returns {$protobuf.Writer} Writer
1372
+ */
1373
+ UserStats.encodeDelimited = function encodeDelimited(message, writer) {
1374
+ return this.encode(message, writer).ldelim();
1375
+ };
1376
+
1377
+ /**
1378
+ * Decodes a UserStats message from the specified reader or buffer.
1379
+ * @function decode
1380
+ * @memberof content.UserStats
1381
+ * @static
1382
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1383
+ * @param {number} [length] Message length if known beforehand
1384
+ * @returns {content.UserStats} UserStats
1385
+ * @throws {Error} If the payload is not a reader or valid buffer
1386
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1387
+ */
1388
+ UserStats.decode = function decode(reader, length) {
1389
+ if (!(reader instanceof $Reader))
1390
+ reader = $Reader.create(reader);
1391
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.content.UserStats();
1392
+ while (reader.pos < end) {
1393
+ var tag = reader.uint32();
1394
+ switch (tag >>> 3) {
1395
+ case 1:
1396
+ message.runStreak = reader.int32();
1397
+ break;
1398
+ case 2:
1399
+ message.averageMinutes = reader.int32();
1400
+ break;
1401
+ case 3:
1402
+ message.highestRunStreak = reader.int32();
1403
+ break;
1404
+ case 4:
1405
+ message.totalMinutes = reader.int32();
1406
+ break;
1407
+ case 5:
1408
+ message.totalSessions = reader.int32();
1409
+ break;
1410
+ default:
1411
+ reader.skipType(tag & 7);
1412
+ break;
1413
+ }
1414
+ }
1415
+ return message;
1416
+ };
1417
+
1418
+ /**
1419
+ * Decodes a UserStats message from the specified reader or buffer, length delimited.
1420
+ * @function decodeDelimited
1421
+ * @memberof content.UserStats
1422
+ * @static
1423
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1424
+ * @returns {content.UserStats} UserStats
1425
+ * @throws {Error} If the payload is not a reader or valid buffer
1426
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1427
+ */
1428
+ UserStats.decodeDelimited = function decodeDelimited(reader) {
1429
+ if (!(reader instanceof $Reader))
1430
+ reader = new $Reader(reader);
1431
+ return this.decode(reader, reader.uint32());
1432
+ };
1433
+
1434
+ /**
1435
+ * Verifies a UserStats message.
1436
+ * @function verify
1437
+ * @memberof content.UserStats
1438
+ * @static
1439
+ * @param {Object.<string,*>} message Plain object to verify
1440
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
1441
+ */
1442
+ UserStats.verify = function verify(message) {
1443
+ if (typeof message !== "object" || message === null)
1444
+ return "object expected";
1445
+ if (message.runStreak != null && message.hasOwnProperty("runStreak"))
1446
+ if (!$util.isInteger(message.runStreak))
1447
+ return "runStreak: integer expected";
1448
+ if (message.averageMinutes != null && message.hasOwnProperty("averageMinutes"))
1449
+ if (!$util.isInteger(message.averageMinutes))
1450
+ return "averageMinutes: integer expected";
1451
+ if (message.highestRunStreak != null && message.hasOwnProperty("highestRunStreak"))
1452
+ if (!$util.isInteger(message.highestRunStreak))
1453
+ return "highestRunStreak: integer expected";
1454
+ if (message.totalMinutes != null && message.hasOwnProperty("totalMinutes"))
1455
+ if (!$util.isInteger(message.totalMinutes))
1456
+ return "totalMinutes: integer expected";
1457
+ if (message.totalSessions != null && message.hasOwnProperty("totalSessions"))
1458
+ if (!$util.isInteger(message.totalSessions))
1459
+ return "totalSessions: integer expected";
1460
+ return null;
1461
+ };
1462
+
1463
+ /**
1464
+ * Creates a UserStats message from a plain object. Also converts values to their respective internal types.
1465
+ * @function fromObject
1466
+ * @memberof content.UserStats
1467
+ * @static
1468
+ * @param {Object.<string,*>} object Plain object
1469
+ * @returns {content.UserStats} UserStats
1470
+ */
1471
+ UserStats.fromObject = function fromObject(object) {
1472
+ if (object instanceof $root.content.UserStats)
1473
+ return object;
1474
+ var message = new $root.content.UserStats();
1475
+ if (object.runStreak != null)
1476
+ message.runStreak = object.runStreak | 0;
1477
+ if (object.averageMinutes != null)
1478
+ message.averageMinutes = object.averageMinutes | 0;
1479
+ if (object.highestRunStreak != null)
1480
+ message.highestRunStreak = object.highestRunStreak | 0;
1481
+ if (object.totalMinutes != null)
1482
+ message.totalMinutes = object.totalMinutes | 0;
1483
+ if (object.totalSessions != null)
1484
+ message.totalSessions = object.totalSessions | 0;
1485
+ return message;
1486
+ };
1487
+
1488
+ /**
1489
+ * Creates a plain object from a UserStats message. Also converts values to other types if specified.
1490
+ * @function toObject
1491
+ * @memberof content.UserStats
1492
+ * @static
1493
+ * @param {content.UserStats} message UserStats
1494
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
1495
+ * @returns {Object.<string,*>} Plain object
1496
+ */
1497
+ UserStats.toObject = function toObject(message, options) {
1498
+ if (!options)
1499
+ options = {};
1500
+ var object = {};
1501
+ if (options.defaults) {
1502
+ object.runStreak = 0;
1503
+ object.averageMinutes = 0;
1504
+ object.highestRunStreak = 0;
1505
+ object.totalMinutes = 0;
1506
+ object.totalSessions = 0;
1507
+ }
1508
+ if (message.runStreak != null && message.hasOwnProperty("runStreak"))
1509
+ object.runStreak = message.runStreak;
1510
+ if (message.averageMinutes != null && message.hasOwnProperty("averageMinutes"))
1511
+ object.averageMinutes = message.averageMinutes;
1512
+ if (message.highestRunStreak != null && message.hasOwnProperty("highestRunStreak"))
1513
+ object.highestRunStreak = message.highestRunStreak;
1514
+ if (message.totalMinutes != null && message.hasOwnProperty("totalMinutes"))
1515
+ object.totalMinutes = message.totalMinutes;
1516
+ if (message.totalSessions != null && message.hasOwnProperty("totalSessions"))
1517
+ object.totalSessions = message.totalSessions;
1518
+ return object;
1519
+ };
1520
+
1521
+ /**
1522
+ * Converts this UserStats to JSON.
1523
+ * @function toJSON
1524
+ * @memberof content.UserStats
1525
+ * @instance
1526
+ * @returns {Object.<string,*>} JSON object
1527
+ */
1528
+ UserStats.prototype.toJSON = function toJSON() {
1529
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1530
+ };
1531
+
1532
+ return UserStats;
1533
+ })();
1534
+
1535
+ return content;
1536
+ })();
1537
+
325
1538
  $root.contentful = (function() {
326
1539
 
327
1540
  /**
@@ -42664,6 +43877,284 @@ $root.TopicDeleted = (function() {
42664
43877
  return TopicDeleted;
42665
43878
  })();
42666
43879
 
43880
+ $root.UserStatsUpdated = (function() {
43881
+
43882
+ /**
43883
+ * Properties of a UserStatsUpdated.
43884
+ * @exports IUserStatsUpdated
43885
+ * @interface IUserStatsUpdated
43886
+ * @property {string|null} [userId] UserStatsUpdated userId
43887
+ * @property {content.IUserStats|null} [stats] UserStatsUpdated stats
43888
+ * @property {content.IUserStats|null} [previousStats] UserStatsUpdated previousStats
43889
+ * @property {number|Long|null} [timestamp] UserStatsUpdated timestamp
43890
+ */
43891
+
43892
+ /**
43893
+ * Constructs a new UserStatsUpdated.
43894
+ * @exports UserStatsUpdated
43895
+ * @classdesc Represents a UserStatsUpdated.
43896
+ * @implements IUserStatsUpdated
43897
+ * @constructor
43898
+ * @param {IUserStatsUpdated=} [properties] Properties to set
43899
+ */
43900
+ function UserStatsUpdated(properties) {
43901
+ if (properties)
43902
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
43903
+ if (properties[keys[i]] != null)
43904
+ this[keys[i]] = properties[keys[i]];
43905
+ }
43906
+
43907
+ /**
43908
+ * UserStatsUpdated userId.
43909
+ * @member {string} userId
43910
+ * @memberof UserStatsUpdated
43911
+ * @instance
43912
+ */
43913
+ UserStatsUpdated.prototype.userId = "";
43914
+
43915
+ /**
43916
+ * UserStatsUpdated stats.
43917
+ * @member {content.IUserStats|null|undefined} stats
43918
+ * @memberof UserStatsUpdated
43919
+ * @instance
43920
+ */
43921
+ UserStatsUpdated.prototype.stats = null;
43922
+
43923
+ /**
43924
+ * UserStatsUpdated previousStats.
43925
+ * @member {content.IUserStats|null|undefined} previousStats
43926
+ * @memberof UserStatsUpdated
43927
+ * @instance
43928
+ */
43929
+ UserStatsUpdated.prototype.previousStats = null;
43930
+
43931
+ /**
43932
+ * UserStatsUpdated timestamp.
43933
+ * @member {number|Long} timestamp
43934
+ * @memberof UserStatsUpdated
43935
+ * @instance
43936
+ */
43937
+ UserStatsUpdated.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
43938
+
43939
+ /**
43940
+ * Creates a new UserStatsUpdated instance using the specified properties.
43941
+ * @function create
43942
+ * @memberof UserStatsUpdated
43943
+ * @static
43944
+ * @param {IUserStatsUpdated=} [properties] Properties to set
43945
+ * @returns {UserStatsUpdated} UserStatsUpdated instance
43946
+ */
43947
+ UserStatsUpdated.create = function create(properties) {
43948
+ return new UserStatsUpdated(properties);
43949
+ };
43950
+
43951
+ /**
43952
+ * Encodes the specified UserStatsUpdated message. Does not implicitly {@link UserStatsUpdated.verify|verify} messages.
43953
+ * @function encode
43954
+ * @memberof UserStatsUpdated
43955
+ * @static
43956
+ * @param {IUserStatsUpdated} message UserStatsUpdated message or plain object to encode
43957
+ * @param {$protobuf.Writer} [writer] Writer to encode to
43958
+ * @returns {$protobuf.Writer} Writer
43959
+ */
43960
+ UserStatsUpdated.encode = function encode(message, writer) {
43961
+ if (!writer)
43962
+ writer = $Writer.create();
43963
+ if (message.userId != null && message.hasOwnProperty("userId"))
43964
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.userId);
43965
+ if (message.stats != null && message.hasOwnProperty("stats"))
43966
+ $root.content.UserStats.encode(message.stats, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
43967
+ if (message.previousStats != null && message.hasOwnProperty("previousStats"))
43968
+ $root.content.UserStats.encode(message.previousStats, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
43969
+ if (message.timestamp != null && message.hasOwnProperty("timestamp"))
43970
+ writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.timestamp);
43971
+ return writer;
43972
+ };
43973
+
43974
+ /**
43975
+ * Encodes the specified UserStatsUpdated message, length delimited. Does not implicitly {@link UserStatsUpdated.verify|verify} messages.
43976
+ * @function encodeDelimited
43977
+ * @memberof UserStatsUpdated
43978
+ * @static
43979
+ * @param {IUserStatsUpdated} message UserStatsUpdated message or plain object to encode
43980
+ * @param {$protobuf.Writer} [writer] Writer to encode to
43981
+ * @returns {$protobuf.Writer} Writer
43982
+ */
43983
+ UserStatsUpdated.encodeDelimited = function encodeDelimited(message, writer) {
43984
+ return this.encode(message, writer).ldelim();
43985
+ };
43986
+
43987
+ /**
43988
+ * Decodes a UserStatsUpdated message from the specified reader or buffer.
43989
+ * @function decode
43990
+ * @memberof UserStatsUpdated
43991
+ * @static
43992
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
43993
+ * @param {number} [length] Message length if known beforehand
43994
+ * @returns {UserStatsUpdated} UserStatsUpdated
43995
+ * @throws {Error} If the payload is not a reader or valid buffer
43996
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
43997
+ */
43998
+ UserStatsUpdated.decode = function decode(reader, length) {
43999
+ if (!(reader instanceof $Reader))
44000
+ reader = $Reader.create(reader);
44001
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.UserStatsUpdated();
44002
+ while (reader.pos < end) {
44003
+ var tag = reader.uint32();
44004
+ switch (tag >>> 3) {
44005
+ case 1:
44006
+ message.userId = reader.string();
44007
+ break;
44008
+ case 2:
44009
+ message.stats = $root.content.UserStats.decode(reader, reader.uint32());
44010
+ break;
44011
+ case 3:
44012
+ message.previousStats = $root.content.UserStats.decode(reader, reader.uint32());
44013
+ break;
44014
+ case 4:
44015
+ message.timestamp = reader.uint64();
44016
+ break;
44017
+ default:
44018
+ reader.skipType(tag & 7);
44019
+ break;
44020
+ }
44021
+ }
44022
+ return message;
44023
+ };
44024
+
44025
+ /**
44026
+ * Decodes a UserStatsUpdated message from the specified reader or buffer, length delimited.
44027
+ * @function decodeDelimited
44028
+ * @memberof UserStatsUpdated
44029
+ * @static
44030
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
44031
+ * @returns {UserStatsUpdated} UserStatsUpdated
44032
+ * @throws {Error} If the payload is not a reader or valid buffer
44033
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
44034
+ */
44035
+ UserStatsUpdated.decodeDelimited = function decodeDelimited(reader) {
44036
+ if (!(reader instanceof $Reader))
44037
+ reader = new $Reader(reader);
44038
+ return this.decode(reader, reader.uint32());
44039
+ };
44040
+
44041
+ /**
44042
+ * Verifies a UserStatsUpdated message.
44043
+ * @function verify
44044
+ * @memberof UserStatsUpdated
44045
+ * @static
44046
+ * @param {Object.<string,*>} message Plain object to verify
44047
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
44048
+ */
44049
+ UserStatsUpdated.verify = function verify(message) {
44050
+ if (typeof message !== "object" || message === null)
44051
+ return "object expected";
44052
+ if (message.userId != null && message.hasOwnProperty("userId"))
44053
+ if (!$util.isString(message.userId))
44054
+ return "userId: string expected";
44055
+ if (message.stats != null && message.hasOwnProperty("stats")) {
44056
+ var error = $root.content.UserStats.verify(message.stats);
44057
+ if (error)
44058
+ return "stats." + error;
44059
+ }
44060
+ if (message.previousStats != null && message.hasOwnProperty("previousStats")) {
44061
+ var error = $root.content.UserStats.verify(message.previousStats);
44062
+ if (error)
44063
+ return "previousStats." + error;
44064
+ }
44065
+ if (message.timestamp != null && message.hasOwnProperty("timestamp"))
44066
+ if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high)))
44067
+ return "timestamp: integer|Long expected";
44068
+ return null;
44069
+ };
44070
+
44071
+ /**
44072
+ * Creates a UserStatsUpdated message from a plain object. Also converts values to their respective internal types.
44073
+ * @function fromObject
44074
+ * @memberof UserStatsUpdated
44075
+ * @static
44076
+ * @param {Object.<string,*>} object Plain object
44077
+ * @returns {UserStatsUpdated} UserStatsUpdated
44078
+ */
44079
+ UserStatsUpdated.fromObject = function fromObject(object) {
44080
+ if (object instanceof $root.UserStatsUpdated)
44081
+ return object;
44082
+ var message = new $root.UserStatsUpdated();
44083
+ if (object.userId != null)
44084
+ message.userId = String(object.userId);
44085
+ if (object.stats != null) {
44086
+ if (typeof object.stats !== "object")
44087
+ throw TypeError(".UserStatsUpdated.stats: object expected");
44088
+ message.stats = $root.content.UserStats.fromObject(object.stats);
44089
+ }
44090
+ if (object.previousStats != null) {
44091
+ if (typeof object.previousStats !== "object")
44092
+ throw TypeError(".UserStatsUpdated.previousStats: object expected");
44093
+ message.previousStats = $root.content.UserStats.fromObject(object.previousStats);
44094
+ }
44095
+ if (object.timestamp != null)
44096
+ if ($util.Long)
44097
+ (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true;
44098
+ else if (typeof object.timestamp === "string")
44099
+ message.timestamp = parseInt(object.timestamp, 10);
44100
+ else if (typeof object.timestamp === "number")
44101
+ message.timestamp = object.timestamp;
44102
+ else if (typeof object.timestamp === "object")
44103
+ message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true);
44104
+ return message;
44105
+ };
44106
+
44107
+ /**
44108
+ * Creates a plain object from a UserStatsUpdated message. Also converts values to other types if specified.
44109
+ * @function toObject
44110
+ * @memberof UserStatsUpdated
44111
+ * @static
44112
+ * @param {UserStatsUpdated} message UserStatsUpdated
44113
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
44114
+ * @returns {Object.<string,*>} Plain object
44115
+ */
44116
+ UserStatsUpdated.toObject = function toObject(message, options) {
44117
+ if (!options)
44118
+ options = {};
44119
+ var object = {};
44120
+ if (options.defaults) {
44121
+ object.userId = "";
44122
+ object.stats = null;
44123
+ object.previousStats = null;
44124
+ if ($util.Long) {
44125
+ var long = new $util.Long(0, 0, true);
44126
+ object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
44127
+ } else
44128
+ object.timestamp = options.longs === String ? "0" : 0;
44129
+ }
44130
+ if (message.userId != null && message.hasOwnProperty("userId"))
44131
+ object.userId = message.userId;
44132
+ if (message.stats != null && message.hasOwnProperty("stats"))
44133
+ object.stats = $root.content.UserStats.toObject(message.stats, options);
44134
+ if (message.previousStats != null && message.hasOwnProperty("previousStats"))
44135
+ object.previousStats = $root.content.UserStats.toObject(message.previousStats, options);
44136
+ if (message.timestamp != null && message.hasOwnProperty("timestamp"))
44137
+ if (typeof message.timestamp === "number")
44138
+ object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp;
44139
+ else
44140
+ 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;
44141
+ return object;
44142
+ };
44143
+
44144
+ /**
44145
+ * Converts this UserStatsUpdated to JSON.
44146
+ * @function toJSON
44147
+ * @memberof UserStatsUpdated
44148
+ * @instance
44149
+ * @returns {Object.<string,*>} JSON object
44150
+ */
44151
+ UserStatsUpdated.prototype.toJSON = function toJSON() {
44152
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
44153
+ };
44154
+
44155
+ return UserStatsUpdated;
44156
+ })();
44157
+
42667
44158
  $root.SurveyResponse = (function() {
42668
44159
 
42669
44160
  /**