@headspace/protos-events 1.236.0 → 1.238.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 +607 -0
  2. package/lib/index.js +1513 -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
  /**
@@ -12207,6 +13420,7 @@ $root.scim = (function() {
12207
13420
  * @property {string|null} [lastName] SCIMUser lastName
12208
13421
  * @property {string|null} [workEmail] SCIMUser workEmail
12209
13422
  * @property {boolean|null} [isActive] SCIMUser isActive
13423
+ * @property {string|null} [oldWorkEmail] SCIMUser oldWorkEmail
12210
13424
  */
12211
13425
 
12212
13426
  /**
@@ -12264,6 +13478,14 @@ $root.scim = (function() {
12264
13478
  */
12265
13479
  SCIMUser.prototype.isActive = false;
12266
13480
 
13481
+ /**
13482
+ * SCIMUser oldWorkEmail.
13483
+ * @member {string} oldWorkEmail
13484
+ * @memberof scim.SCIMUser
13485
+ * @instance
13486
+ */
13487
+ SCIMUser.prototype.oldWorkEmail = "";
13488
+
12267
13489
  /**
12268
13490
  * Creates a new SCIMUser instance using the specified properties.
12269
13491
  * @function create
@@ -12298,6 +13520,8 @@ $root.scim = (function() {
12298
13520
  writer.uint32(/* id 4, wireType 2 =*/34).string(message.workEmail);
12299
13521
  if (message.isActive != null && message.hasOwnProperty("isActive"))
12300
13522
  writer.uint32(/* id 5, wireType 0 =*/40).bool(message.isActive);
13523
+ if (message.oldWorkEmail != null && message.hasOwnProperty("oldWorkEmail"))
13524
+ writer.uint32(/* id 6, wireType 2 =*/50).string(message.oldWorkEmail);
12301
13525
  return writer;
12302
13526
  };
12303
13527
 
@@ -12347,6 +13571,9 @@ $root.scim = (function() {
12347
13571
  case 5:
12348
13572
  message.isActive = reader.bool();
12349
13573
  break;
13574
+ case 6:
13575
+ message.oldWorkEmail = reader.string();
13576
+ break;
12350
13577
  default:
12351
13578
  reader.skipType(tag & 7);
12352
13579
  break;
@@ -12397,6 +13624,9 @@ $root.scim = (function() {
12397
13624
  if (message.isActive != null && message.hasOwnProperty("isActive"))
12398
13625
  if (typeof message.isActive !== "boolean")
12399
13626
  return "isActive: boolean expected";
13627
+ if (message.oldWorkEmail != null && message.hasOwnProperty("oldWorkEmail"))
13628
+ if (!$util.isString(message.oldWorkEmail))
13629
+ return "oldWorkEmail: string expected";
12400
13630
  return null;
12401
13631
  };
12402
13632
 
@@ -12422,6 +13652,8 @@ $root.scim = (function() {
12422
13652
  message.workEmail = String(object.workEmail);
12423
13653
  if (object.isActive != null)
12424
13654
  message.isActive = Boolean(object.isActive);
13655
+ if (object.oldWorkEmail != null)
13656
+ message.oldWorkEmail = String(object.oldWorkEmail);
12425
13657
  return message;
12426
13658
  };
12427
13659
 
@@ -12444,6 +13676,7 @@ $root.scim = (function() {
12444
13676
  object.lastName = "";
12445
13677
  object.workEmail = "";
12446
13678
  object.isActive = false;
13679
+ object.oldWorkEmail = "";
12447
13680
  }
12448
13681
  if (message.orgId != null && message.hasOwnProperty("orgId"))
12449
13682
  object.orgId = message.orgId;
@@ -12455,6 +13688,8 @@ $root.scim = (function() {
12455
13688
  object.workEmail = message.workEmail;
12456
13689
  if (message.isActive != null && message.hasOwnProperty("isActive"))
12457
13690
  object.isActive = message.isActive;
13691
+ if (message.oldWorkEmail != null && message.hasOwnProperty("oldWorkEmail"))
13692
+ object.oldWorkEmail = message.oldWorkEmail;
12458
13693
  return object;
12459
13694
  };
12460
13695
 
@@ -42664,6 +43899,284 @@ $root.TopicDeleted = (function() {
42664
43899
  return TopicDeleted;
42665
43900
  })();
42666
43901
 
43902
+ $root.UserStatsUpdated = (function() {
43903
+
43904
+ /**
43905
+ * Properties of a UserStatsUpdated.
43906
+ * @exports IUserStatsUpdated
43907
+ * @interface IUserStatsUpdated
43908
+ * @property {string|null} [userId] UserStatsUpdated userId
43909
+ * @property {content.IUserStats|null} [stats] UserStatsUpdated stats
43910
+ * @property {content.IUserStats|null} [previousStats] UserStatsUpdated previousStats
43911
+ * @property {number|Long|null} [timestamp] UserStatsUpdated timestamp
43912
+ */
43913
+
43914
+ /**
43915
+ * Constructs a new UserStatsUpdated.
43916
+ * @exports UserStatsUpdated
43917
+ * @classdesc Represents a UserStatsUpdated.
43918
+ * @implements IUserStatsUpdated
43919
+ * @constructor
43920
+ * @param {IUserStatsUpdated=} [properties] Properties to set
43921
+ */
43922
+ function UserStatsUpdated(properties) {
43923
+ if (properties)
43924
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
43925
+ if (properties[keys[i]] != null)
43926
+ this[keys[i]] = properties[keys[i]];
43927
+ }
43928
+
43929
+ /**
43930
+ * UserStatsUpdated userId.
43931
+ * @member {string} userId
43932
+ * @memberof UserStatsUpdated
43933
+ * @instance
43934
+ */
43935
+ UserStatsUpdated.prototype.userId = "";
43936
+
43937
+ /**
43938
+ * UserStatsUpdated stats.
43939
+ * @member {content.IUserStats|null|undefined} stats
43940
+ * @memberof UserStatsUpdated
43941
+ * @instance
43942
+ */
43943
+ UserStatsUpdated.prototype.stats = null;
43944
+
43945
+ /**
43946
+ * UserStatsUpdated previousStats.
43947
+ * @member {content.IUserStats|null|undefined} previousStats
43948
+ * @memberof UserStatsUpdated
43949
+ * @instance
43950
+ */
43951
+ UserStatsUpdated.prototype.previousStats = null;
43952
+
43953
+ /**
43954
+ * UserStatsUpdated timestamp.
43955
+ * @member {number|Long} timestamp
43956
+ * @memberof UserStatsUpdated
43957
+ * @instance
43958
+ */
43959
+ UserStatsUpdated.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
43960
+
43961
+ /**
43962
+ * Creates a new UserStatsUpdated instance using the specified properties.
43963
+ * @function create
43964
+ * @memberof UserStatsUpdated
43965
+ * @static
43966
+ * @param {IUserStatsUpdated=} [properties] Properties to set
43967
+ * @returns {UserStatsUpdated} UserStatsUpdated instance
43968
+ */
43969
+ UserStatsUpdated.create = function create(properties) {
43970
+ return new UserStatsUpdated(properties);
43971
+ };
43972
+
43973
+ /**
43974
+ * Encodes the specified UserStatsUpdated message. Does not implicitly {@link UserStatsUpdated.verify|verify} messages.
43975
+ * @function encode
43976
+ * @memberof UserStatsUpdated
43977
+ * @static
43978
+ * @param {IUserStatsUpdated} message UserStatsUpdated message or plain object to encode
43979
+ * @param {$protobuf.Writer} [writer] Writer to encode to
43980
+ * @returns {$protobuf.Writer} Writer
43981
+ */
43982
+ UserStatsUpdated.encode = function encode(message, writer) {
43983
+ if (!writer)
43984
+ writer = $Writer.create();
43985
+ if (message.userId != null && message.hasOwnProperty("userId"))
43986
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.userId);
43987
+ if (message.stats != null && message.hasOwnProperty("stats"))
43988
+ $root.content.UserStats.encode(message.stats, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
43989
+ if (message.previousStats != null && message.hasOwnProperty("previousStats"))
43990
+ $root.content.UserStats.encode(message.previousStats, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
43991
+ if (message.timestamp != null && message.hasOwnProperty("timestamp"))
43992
+ writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.timestamp);
43993
+ return writer;
43994
+ };
43995
+
43996
+ /**
43997
+ * Encodes the specified UserStatsUpdated message, length delimited. Does not implicitly {@link UserStatsUpdated.verify|verify} messages.
43998
+ * @function encodeDelimited
43999
+ * @memberof UserStatsUpdated
44000
+ * @static
44001
+ * @param {IUserStatsUpdated} message UserStatsUpdated message or plain object to encode
44002
+ * @param {$protobuf.Writer} [writer] Writer to encode to
44003
+ * @returns {$protobuf.Writer} Writer
44004
+ */
44005
+ UserStatsUpdated.encodeDelimited = function encodeDelimited(message, writer) {
44006
+ return this.encode(message, writer).ldelim();
44007
+ };
44008
+
44009
+ /**
44010
+ * Decodes a UserStatsUpdated message from the specified reader or buffer.
44011
+ * @function decode
44012
+ * @memberof UserStatsUpdated
44013
+ * @static
44014
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
44015
+ * @param {number} [length] Message length if known beforehand
44016
+ * @returns {UserStatsUpdated} UserStatsUpdated
44017
+ * @throws {Error} If the payload is not a reader or valid buffer
44018
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
44019
+ */
44020
+ UserStatsUpdated.decode = function decode(reader, length) {
44021
+ if (!(reader instanceof $Reader))
44022
+ reader = $Reader.create(reader);
44023
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.UserStatsUpdated();
44024
+ while (reader.pos < end) {
44025
+ var tag = reader.uint32();
44026
+ switch (tag >>> 3) {
44027
+ case 1:
44028
+ message.userId = reader.string();
44029
+ break;
44030
+ case 2:
44031
+ message.stats = $root.content.UserStats.decode(reader, reader.uint32());
44032
+ break;
44033
+ case 3:
44034
+ message.previousStats = $root.content.UserStats.decode(reader, reader.uint32());
44035
+ break;
44036
+ case 4:
44037
+ message.timestamp = reader.uint64();
44038
+ break;
44039
+ default:
44040
+ reader.skipType(tag & 7);
44041
+ break;
44042
+ }
44043
+ }
44044
+ return message;
44045
+ };
44046
+
44047
+ /**
44048
+ * Decodes a UserStatsUpdated message from the specified reader or buffer, length delimited.
44049
+ * @function decodeDelimited
44050
+ * @memberof UserStatsUpdated
44051
+ * @static
44052
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
44053
+ * @returns {UserStatsUpdated} UserStatsUpdated
44054
+ * @throws {Error} If the payload is not a reader or valid buffer
44055
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
44056
+ */
44057
+ UserStatsUpdated.decodeDelimited = function decodeDelimited(reader) {
44058
+ if (!(reader instanceof $Reader))
44059
+ reader = new $Reader(reader);
44060
+ return this.decode(reader, reader.uint32());
44061
+ };
44062
+
44063
+ /**
44064
+ * Verifies a UserStatsUpdated message.
44065
+ * @function verify
44066
+ * @memberof UserStatsUpdated
44067
+ * @static
44068
+ * @param {Object.<string,*>} message Plain object to verify
44069
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
44070
+ */
44071
+ UserStatsUpdated.verify = function verify(message) {
44072
+ if (typeof message !== "object" || message === null)
44073
+ return "object expected";
44074
+ if (message.userId != null && message.hasOwnProperty("userId"))
44075
+ if (!$util.isString(message.userId))
44076
+ return "userId: string expected";
44077
+ if (message.stats != null && message.hasOwnProperty("stats")) {
44078
+ var error = $root.content.UserStats.verify(message.stats);
44079
+ if (error)
44080
+ return "stats." + error;
44081
+ }
44082
+ if (message.previousStats != null && message.hasOwnProperty("previousStats")) {
44083
+ var error = $root.content.UserStats.verify(message.previousStats);
44084
+ if (error)
44085
+ return "previousStats." + error;
44086
+ }
44087
+ if (message.timestamp != null && message.hasOwnProperty("timestamp"))
44088
+ if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high)))
44089
+ return "timestamp: integer|Long expected";
44090
+ return null;
44091
+ };
44092
+
44093
+ /**
44094
+ * Creates a UserStatsUpdated message from a plain object. Also converts values to their respective internal types.
44095
+ * @function fromObject
44096
+ * @memberof UserStatsUpdated
44097
+ * @static
44098
+ * @param {Object.<string,*>} object Plain object
44099
+ * @returns {UserStatsUpdated} UserStatsUpdated
44100
+ */
44101
+ UserStatsUpdated.fromObject = function fromObject(object) {
44102
+ if (object instanceof $root.UserStatsUpdated)
44103
+ return object;
44104
+ var message = new $root.UserStatsUpdated();
44105
+ if (object.userId != null)
44106
+ message.userId = String(object.userId);
44107
+ if (object.stats != null) {
44108
+ if (typeof object.stats !== "object")
44109
+ throw TypeError(".UserStatsUpdated.stats: object expected");
44110
+ message.stats = $root.content.UserStats.fromObject(object.stats);
44111
+ }
44112
+ if (object.previousStats != null) {
44113
+ if (typeof object.previousStats !== "object")
44114
+ throw TypeError(".UserStatsUpdated.previousStats: object expected");
44115
+ message.previousStats = $root.content.UserStats.fromObject(object.previousStats);
44116
+ }
44117
+ if (object.timestamp != null)
44118
+ if ($util.Long)
44119
+ (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true;
44120
+ else if (typeof object.timestamp === "string")
44121
+ message.timestamp = parseInt(object.timestamp, 10);
44122
+ else if (typeof object.timestamp === "number")
44123
+ message.timestamp = object.timestamp;
44124
+ else if (typeof object.timestamp === "object")
44125
+ message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true);
44126
+ return message;
44127
+ };
44128
+
44129
+ /**
44130
+ * Creates a plain object from a UserStatsUpdated message. Also converts values to other types if specified.
44131
+ * @function toObject
44132
+ * @memberof UserStatsUpdated
44133
+ * @static
44134
+ * @param {UserStatsUpdated} message UserStatsUpdated
44135
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
44136
+ * @returns {Object.<string,*>} Plain object
44137
+ */
44138
+ UserStatsUpdated.toObject = function toObject(message, options) {
44139
+ if (!options)
44140
+ options = {};
44141
+ var object = {};
44142
+ if (options.defaults) {
44143
+ object.userId = "";
44144
+ object.stats = null;
44145
+ object.previousStats = null;
44146
+ if ($util.Long) {
44147
+ var long = new $util.Long(0, 0, true);
44148
+ object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
44149
+ } else
44150
+ object.timestamp = options.longs === String ? "0" : 0;
44151
+ }
44152
+ if (message.userId != null && message.hasOwnProperty("userId"))
44153
+ object.userId = message.userId;
44154
+ if (message.stats != null && message.hasOwnProperty("stats"))
44155
+ object.stats = $root.content.UserStats.toObject(message.stats, options);
44156
+ if (message.previousStats != null && message.hasOwnProperty("previousStats"))
44157
+ object.previousStats = $root.content.UserStats.toObject(message.previousStats, options);
44158
+ if (message.timestamp != null && message.hasOwnProperty("timestamp"))
44159
+ if (typeof message.timestamp === "number")
44160
+ object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp;
44161
+ else
44162
+ 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;
44163
+ return object;
44164
+ };
44165
+
44166
+ /**
44167
+ * Converts this UserStatsUpdated to JSON.
44168
+ * @function toJSON
44169
+ * @memberof UserStatsUpdated
44170
+ * @instance
44171
+ * @returns {Object.<string,*>} JSON object
44172
+ */
44173
+ UserStatsUpdated.prototype.toJSON = function toJSON() {
44174
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
44175
+ };
44176
+
44177
+ return UserStatsUpdated;
44178
+ })();
44179
+
42667
44180
  $root.SurveyResponse = (function() {
42668
44181
 
42669
44182
  /**