core-3nweb-client-lib 0.25.3 → 0.26.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 (113) hide show
  1. package/README.md +2 -2
  2. package/build/api-defs/files.d.ts +23 -20
  3. package/build/core/asmail/config/common.js +2 -2
  4. package/build/core/asmail/delivery/index.js +4 -3
  5. package/build/core/asmail/delivery/msg.js +5 -4
  6. package/build/core/asmail/delivery/per-recipient-wip.js +2 -2
  7. package/build/core/asmail/inbox/attachments/fs.js +6 -0
  8. package/build/core/asmail/inbox/cached-msgs.js +2 -2
  9. package/build/core/asmail/inbox/inbox-events.js +2 -1
  10. package/build/core/asmail/inbox/index.js +2 -2
  11. package/build/core/asmail/inbox/msg-downloader.js +2 -2
  12. package/build/core/asmail/inbox/msg-indexing.js +3 -3
  13. package/build/core/asmail/inbox/msg-on-disk.js +2 -2
  14. package/build/core/asmail/keyring/keyring-storage.js +2 -2
  15. package/build/core/asmail/sending-params/own-params.js +2 -2
  16. package/build/core/asmail/sending-params/params-from-others.js +2 -2
  17. package/build/core/id-manager.js +2 -2
  18. package/build/core/sign-in.d.ts +5 -4
  19. package/build/core/sign-in.js +9 -11
  20. package/build/core/sign-up.d.ts +1 -0
  21. package/build/core/sign-up.js +7 -3
  22. package/build/core/storage/common/json-saving.d.ts +21 -0
  23. package/build/core/storage/common/json-saving.js +82 -0
  24. package/build/core/storage/common/obj-info-file.d.ts +43 -0
  25. package/build/core/storage/common/obj-info-file.js +119 -3
  26. package/build/core/storage/index.js +1 -1
  27. package/build/core/storage/local/obj-files-gc.js +8 -6
  28. package/build/core/storage/local/obj-files.d.ts +3 -3
  29. package/build/core/storage/local/obj-files.js +9 -9
  30. package/build/core/storage/local/obj-status.d.ts +9 -25
  31. package/build/core/storage/local/obj-status.js +28 -110
  32. package/build/core/storage/local/storage.d.ts +8 -1
  33. package/build/core/storage/local/storage.js +10 -2
  34. package/build/core/storage/synced/downloader.js +6 -5
  35. package/build/core/storage/synced/obj-files-gc.d.ts +1 -0
  36. package/build/core/storage/synced/obj-files-gc.js +44 -5
  37. package/build/core/storage/synced/obj-files.d.ts +13 -20
  38. package/build/core/storage/synced/obj-files.js +70 -48
  39. package/build/core/storage/synced/obj-status.d.ts +74 -15
  40. package/build/core/storage/synced/obj-status.js +291 -107
  41. package/build/core/storage/synced/remote-events.js +32 -26
  42. package/build/core/storage/synced/storage.d.ts +11 -1
  43. package/build/core/storage/synced/storage.js +28 -3
  44. package/build/core/storage/synced/upsyncer.d.ts +8 -7
  45. package/build/core/storage/synced/upsyncer.js +211 -163
  46. package/build/ipc-via-protobuf/asmail-cap.js +17 -34
  47. package/build/ipc-via-protobuf/connector-clients-side.js +2 -2
  48. package/build/ipc-via-protobuf/file.js +26 -18
  49. package/build/ipc-via-protobuf/fs.js +33 -35
  50. package/build/ipc-via-protobuf/mailerid.js +3 -2
  51. package/build/ipc-via-protobuf/protobuf-msg.d.ts +2 -0
  52. package/build/ipc-via-protobuf/protobuf-msg.js +11 -1
  53. package/build/ipc-via-protobuf/startup-cap.js +5 -5
  54. package/build/lib-client/3nstorage/exceptions.d.ts +9 -8
  55. package/build/lib-client/3nstorage/exceptions.js +18 -9
  56. package/build/lib-client/3nstorage/service.js +10 -6
  57. package/build/lib-client/3nstorage/xsp-fs/common.d.ts +18 -4
  58. package/build/lib-client/3nstorage/xsp-fs/common.js +6 -1
  59. package/build/lib-client/3nstorage/xsp-fs/file-node.js +3 -3
  60. package/build/lib-client/3nstorage/xsp-fs/file.js +4 -1
  61. package/build/lib-client/3nstorage/xsp-fs/folder-node.js +27 -13
  62. package/build/lib-client/3nstorage/xsp-fs/fs.d.ts +11 -6
  63. package/build/lib-client/3nstorage/xsp-fs/fs.js +189 -58
  64. package/build/lib-client/3nstorage/xsp-fs/node-in-fs.d.ts +4 -0
  65. package/build/lib-client/3nstorage/xsp-fs/node-in-fs.js +51 -24
  66. package/build/lib-client/3nstorage/xsp-fs/node-persistence.js +2 -2
  67. package/build/lib-client/3nstorage/xsp-fs/xsp-payload-v1.js +2 -2
  68. package/build/lib-client/3nstorage/xsp-fs/xsp-payload-v2.js +3 -3
  69. package/build/lib-client/cryptor/cryptor-in-worker.js +4 -4
  70. package/build/lib-client/cryptor/cryptor-wasm.js +1 -1
  71. package/build/lib-client/cryptor/cryptor.wasm +0 -0
  72. package/build/lib-client/cryptor/in-proc-wasm.js +2 -2
  73. package/build/lib-client/files.js +2 -0
  74. package/build/lib-client/fs-collection.js +3 -2
  75. package/build/lib-client/logging/log-to-file.js +6 -14
  76. package/build/lib-client/objs-on-disk/file-writing-proc.js +2 -2
  77. package/build/lib-client/objs-on-disk/obj-folders.d.ts +12 -1
  78. package/build/lib-client/objs-on-disk/obj-folders.js +26 -19
  79. package/build/lib-client/request-utils.js +2 -2
  80. package/build/lib-client/server-events.js +4 -3
  81. package/build/lib-client/ws-utils.js +2 -2
  82. package/build/lib-common/async-fs-node.d.ts +6 -0
  83. package/build/lib-common/async-fs-node.js +28 -4
  84. package/build/lib-common/byte-streaming/wrapping.js +17 -17
  85. package/build/lib-common/exceptions/file.js +6 -1
  86. package/build/lib-common/ipc/generic-ipc.js +2 -2
  87. package/build/lib-common/json-utils.js +2 -1
  88. package/build/lib-common/objs-on-disk/obj-file.js +4 -3
  89. package/build/lib-common/objs-on-disk/utils.js +2 -2
  90. package/build/lib-common/processes/deferred.d.ts +6 -0
  91. package/build/lib-common/processes/deferred.js +30 -0
  92. package/build/lib-common/processes/labelled-exec-pools.d.ts +33 -0
  93. package/build/lib-common/processes/labelled-exec-pools.js +141 -0
  94. package/build/lib-common/processes/pressure.d.ts +7 -0
  95. package/build/lib-common/processes/pressure.js +56 -0
  96. package/build/lib-common/processes/sleep.d.ts +1 -0
  97. package/build/lib-common/processes/sleep.js +26 -0
  98. package/build/lib-common/{processes.d.ts → processes/synced.d.ts} +0 -40
  99. package/build/lib-common/{processes.js → processes/synced.js} +187 -204
  100. package/build/lib-common/processes/timeout.d.ts +1 -0
  101. package/build/lib-common/processes/timeout.js +51 -0
  102. package/build/lib-common/service-api/3nstorage/owner.d.ts +5 -4
  103. package/build/lib-common/service-api/3nstorage/owner.js +3 -2
  104. package/build/lib-common/utils-for-observables.d.ts +15 -1
  105. package/build/lib-common/utils-for-observables.js +68 -17
  106. package/build/protos/asmail.proto.js +404 -78
  107. package/build/protos/file.proto.js +370 -44
  108. package/build/protos/fs.proto.js +404 -78
  109. package/package.json +4 -4
  110. package/protos/file.proto +10 -2
  111. package/protos/fs.proto +2 -2
  112. package/build/core/storage/synced/upsync-status.d.ts +0 -41
  113. package/build/core/storage/synced/upsync-status.js +0 -158
@@ -313,6 +313,7 @@ $root.file = (function() {
313
313
  * @property {common.IUInt64Value|null} [mtime] StatsMsg mtime
314
314
  * @property {common.IUInt64Value|null} [ctime] StatsMsg ctime
315
315
  * @property {common.IUInt64Value|null} [version] StatsMsg version
316
+ * @property {file.StatsMsg.ISyncInfo|null} [sync] StatsMsg sync
316
317
  */
317
318
 
318
319
  /**
@@ -394,6 +395,14 @@ $root.file = (function() {
394
395
  */
395
396
  StatsMsg.prototype.version = null;
396
397
 
398
+ /**
399
+ * StatsMsg sync.
400
+ * @member {file.StatsMsg.ISyncInfo|null|undefined} sync
401
+ * @memberof file.StatsMsg
402
+ * @instance
403
+ */
404
+ StatsMsg.prototype.sync = null;
405
+
397
406
  /**
398
407
  * Creates a new StatsMsg instance using the specified properties.
399
408
  * @function create
@@ -434,6 +443,8 @@ $root.file = (function() {
434
443
  $root.common.UInt64Value.encode(message.ctime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
435
444
  if (message.version != null && Object.hasOwnProperty.call(message, "version"))
436
445
  $root.common.UInt64Value.encode(message.version, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
446
+ if (message.sync != null && Object.hasOwnProperty.call(message, "sync"))
447
+ $root.file.StatsMsg.SyncInfo.encode(message.sync, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
437
448
  return writer;
438
449
  };
439
450
 
@@ -492,6 +503,9 @@ $root.file = (function() {
492
503
  case 8:
493
504
  message.version = $root.common.UInt64Value.decode(reader, reader.uint32());
494
505
  break;
506
+ case 9:
507
+ message.sync = $root.file.StatsMsg.SyncInfo.decode(reader, reader.uint32());
508
+ break;
495
509
  default:
496
510
  reader.skipType(tag & 7);
497
511
  break;
@@ -565,6 +579,11 @@ $root.file = (function() {
565
579
  if (error)
566
580
  return "version." + error;
567
581
  }
582
+ if (message.sync != null && message.hasOwnProperty("sync")) {
583
+ var error = $root.file.StatsMsg.SyncInfo.verify(message.sync);
584
+ if (error)
585
+ return "sync." + error;
586
+ }
568
587
  return null;
569
588
  };
570
589
 
@@ -617,6 +636,11 @@ $root.file = (function() {
617
636
  throw TypeError(".file.StatsMsg.version: object expected");
618
637
  message.version = $root.common.UInt64Value.fromObject(object.version);
619
638
  }
639
+ if (object.sync != null) {
640
+ if (typeof object.sync !== "object")
641
+ throw TypeError(".file.StatsMsg.sync: object expected");
642
+ message.sync = $root.file.StatsMsg.SyncInfo.fromObject(object.sync);
643
+ }
620
644
  return message;
621
645
  };
622
646
 
@@ -642,6 +666,7 @@ $root.file = (function() {
642
666
  object.mtime = null;
643
667
  object.ctime = null;
644
668
  object.version = null;
669
+ object.sync = null;
645
670
  }
646
671
  if (message.isFile != null && message.hasOwnProperty("isFile"))
647
672
  object.isFile = $root.common.BooleanValue.toObject(message.isFile, options);
@@ -659,6 +684,8 @@ $root.file = (function() {
659
684
  object.ctime = $root.common.UInt64Value.toObject(message.ctime, options);
660
685
  if (message.version != null && message.hasOwnProperty("version"))
661
686
  object.version = $root.common.UInt64Value.toObject(message.version, options);
687
+ if (message.sync != null && message.hasOwnProperty("sync"))
688
+ object.sync = $root.file.StatsMsg.SyncInfo.toObject(message.sync, options);
662
689
  return object;
663
690
  };
664
691
 
@@ -673,6 +700,332 @@ $root.file = (function() {
673
700
  return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
674
701
  };
675
702
 
703
+ StatsMsg.SyncInfo = (function() {
704
+
705
+ /**
706
+ * Properties of a SyncInfo.
707
+ * @memberof file.StatsMsg
708
+ * @interface ISyncInfo
709
+ * @property {string|null} [state] SyncInfo state
710
+ * @property {common.IUInt64Value|null} [latest] SyncInfo latest
711
+ * @property {common.IUInt64Value|null} [remote] SyncInfo remote
712
+ * @property {Array.<number|Long>|null} [conflictingRemote] SyncInfo conflictingRemote
713
+ * @property {common.IBooleanValue|null} [deletedOnRemote] SyncInfo deletedOnRemote
714
+ */
715
+
716
+ /**
717
+ * Constructs a new SyncInfo.
718
+ * @memberof file.StatsMsg
719
+ * @classdesc Represents a SyncInfo.
720
+ * @implements ISyncInfo
721
+ * @constructor
722
+ * @param {file.StatsMsg.ISyncInfo=} [properties] Properties to set
723
+ */
724
+ function SyncInfo(properties) {
725
+ this.conflictingRemote = [];
726
+ if (properties)
727
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
728
+ if (properties[keys[i]] != null)
729
+ this[keys[i]] = properties[keys[i]];
730
+ }
731
+
732
+ /**
733
+ * SyncInfo state.
734
+ * @member {string} state
735
+ * @memberof file.StatsMsg.SyncInfo
736
+ * @instance
737
+ */
738
+ SyncInfo.prototype.state = "";
739
+
740
+ /**
741
+ * SyncInfo latest.
742
+ * @member {common.IUInt64Value|null|undefined} latest
743
+ * @memberof file.StatsMsg.SyncInfo
744
+ * @instance
745
+ */
746
+ SyncInfo.prototype.latest = null;
747
+
748
+ /**
749
+ * SyncInfo remote.
750
+ * @member {common.IUInt64Value|null|undefined} remote
751
+ * @memberof file.StatsMsg.SyncInfo
752
+ * @instance
753
+ */
754
+ SyncInfo.prototype.remote = null;
755
+
756
+ /**
757
+ * SyncInfo conflictingRemote.
758
+ * @member {Array.<number|Long>} conflictingRemote
759
+ * @memberof file.StatsMsg.SyncInfo
760
+ * @instance
761
+ */
762
+ SyncInfo.prototype.conflictingRemote = $util.emptyArray;
763
+
764
+ /**
765
+ * SyncInfo deletedOnRemote.
766
+ * @member {common.IBooleanValue|null|undefined} deletedOnRemote
767
+ * @memberof file.StatsMsg.SyncInfo
768
+ * @instance
769
+ */
770
+ SyncInfo.prototype.deletedOnRemote = null;
771
+
772
+ /**
773
+ * Creates a new SyncInfo instance using the specified properties.
774
+ * @function create
775
+ * @memberof file.StatsMsg.SyncInfo
776
+ * @static
777
+ * @param {file.StatsMsg.ISyncInfo=} [properties] Properties to set
778
+ * @returns {file.StatsMsg.SyncInfo} SyncInfo instance
779
+ */
780
+ SyncInfo.create = function create(properties) {
781
+ return new SyncInfo(properties);
782
+ };
783
+
784
+ /**
785
+ * Encodes the specified SyncInfo message. Does not implicitly {@link file.StatsMsg.SyncInfo.verify|verify} messages.
786
+ * @function encode
787
+ * @memberof file.StatsMsg.SyncInfo
788
+ * @static
789
+ * @param {file.StatsMsg.ISyncInfo} message SyncInfo message or plain object to encode
790
+ * @param {$protobuf.Writer} [writer] Writer to encode to
791
+ * @returns {$protobuf.Writer} Writer
792
+ */
793
+ SyncInfo.encode = function encode(message, writer) {
794
+ if (!writer)
795
+ writer = $Writer.create();
796
+ if (message.state != null && Object.hasOwnProperty.call(message, "state"))
797
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.state);
798
+ if (message.latest != null && Object.hasOwnProperty.call(message, "latest"))
799
+ $root.common.UInt64Value.encode(message.latest, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
800
+ if (message.remote != null && Object.hasOwnProperty.call(message, "remote"))
801
+ $root.common.UInt64Value.encode(message.remote, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
802
+ if (message.conflictingRemote != null && message.conflictingRemote.length) {
803
+ writer.uint32(/* id 4, wireType 2 =*/34).fork();
804
+ for (var i = 0; i < message.conflictingRemote.length; ++i)
805
+ writer.uint64(message.conflictingRemote[i]);
806
+ writer.ldelim();
807
+ }
808
+ if (message.deletedOnRemote != null && Object.hasOwnProperty.call(message, "deletedOnRemote"))
809
+ $root.common.BooleanValue.encode(message.deletedOnRemote, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
810
+ return writer;
811
+ };
812
+
813
+ /**
814
+ * Encodes the specified SyncInfo message, length delimited. Does not implicitly {@link file.StatsMsg.SyncInfo.verify|verify} messages.
815
+ * @function encodeDelimited
816
+ * @memberof file.StatsMsg.SyncInfo
817
+ * @static
818
+ * @param {file.StatsMsg.ISyncInfo} message SyncInfo message or plain object to encode
819
+ * @param {$protobuf.Writer} [writer] Writer to encode to
820
+ * @returns {$protobuf.Writer} Writer
821
+ */
822
+ SyncInfo.encodeDelimited = function encodeDelimited(message, writer) {
823
+ return this.encode(message, writer).ldelim();
824
+ };
825
+
826
+ /**
827
+ * Decodes a SyncInfo message from the specified reader or buffer.
828
+ * @function decode
829
+ * @memberof file.StatsMsg.SyncInfo
830
+ * @static
831
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
832
+ * @param {number} [length] Message length if known beforehand
833
+ * @returns {file.StatsMsg.SyncInfo} SyncInfo
834
+ * @throws {Error} If the payload is not a reader or valid buffer
835
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
836
+ */
837
+ SyncInfo.decode = function decode(reader, length) {
838
+ if (!(reader instanceof $Reader))
839
+ reader = $Reader.create(reader);
840
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.file.StatsMsg.SyncInfo();
841
+ while (reader.pos < end) {
842
+ var tag = reader.uint32();
843
+ switch (tag >>> 3) {
844
+ case 1:
845
+ message.state = reader.string();
846
+ break;
847
+ case 2:
848
+ message.latest = $root.common.UInt64Value.decode(reader, reader.uint32());
849
+ break;
850
+ case 3:
851
+ message.remote = $root.common.UInt64Value.decode(reader, reader.uint32());
852
+ break;
853
+ case 4:
854
+ if (!(message.conflictingRemote && message.conflictingRemote.length))
855
+ message.conflictingRemote = [];
856
+ if ((tag & 7) === 2) {
857
+ var end2 = reader.uint32() + reader.pos;
858
+ while (reader.pos < end2)
859
+ message.conflictingRemote.push(reader.uint64());
860
+ } else
861
+ message.conflictingRemote.push(reader.uint64());
862
+ break;
863
+ case 5:
864
+ message.deletedOnRemote = $root.common.BooleanValue.decode(reader, reader.uint32());
865
+ break;
866
+ default:
867
+ reader.skipType(tag & 7);
868
+ break;
869
+ }
870
+ }
871
+ return message;
872
+ };
873
+
874
+ /**
875
+ * Decodes a SyncInfo message from the specified reader or buffer, length delimited.
876
+ * @function decodeDelimited
877
+ * @memberof file.StatsMsg.SyncInfo
878
+ * @static
879
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
880
+ * @returns {file.StatsMsg.SyncInfo} SyncInfo
881
+ * @throws {Error} If the payload is not a reader or valid buffer
882
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
883
+ */
884
+ SyncInfo.decodeDelimited = function decodeDelimited(reader) {
885
+ if (!(reader instanceof $Reader))
886
+ reader = new $Reader(reader);
887
+ return this.decode(reader, reader.uint32());
888
+ };
889
+
890
+ /**
891
+ * Verifies a SyncInfo message.
892
+ * @function verify
893
+ * @memberof file.StatsMsg.SyncInfo
894
+ * @static
895
+ * @param {Object.<string,*>} message Plain object to verify
896
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
897
+ */
898
+ SyncInfo.verify = function verify(message) {
899
+ if (typeof message !== "object" || message === null)
900
+ return "object expected";
901
+ if (message.state != null && message.hasOwnProperty("state"))
902
+ if (!$util.isString(message.state))
903
+ return "state: string expected";
904
+ if (message.latest != null && message.hasOwnProperty("latest")) {
905
+ var error = $root.common.UInt64Value.verify(message.latest);
906
+ if (error)
907
+ return "latest." + error;
908
+ }
909
+ if (message.remote != null && message.hasOwnProperty("remote")) {
910
+ var error = $root.common.UInt64Value.verify(message.remote);
911
+ if (error)
912
+ return "remote." + error;
913
+ }
914
+ if (message.conflictingRemote != null && message.hasOwnProperty("conflictingRemote")) {
915
+ if (!Array.isArray(message.conflictingRemote))
916
+ return "conflictingRemote: array expected";
917
+ for (var i = 0; i < message.conflictingRemote.length; ++i)
918
+ if (!$util.isInteger(message.conflictingRemote[i]) && !(message.conflictingRemote[i] && $util.isInteger(message.conflictingRemote[i].low) && $util.isInteger(message.conflictingRemote[i].high)))
919
+ return "conflictingRemote: integer|Long[] expected";
920
+ }
921
+ if (message.deletedOnRemote != null && message.hasOwnProperty("deletedOnRemote")) {
922
+ var error = $root.common.BooleanValue.verify(message.deletedOnRemote);
923
+ if (error)
924
+ return "deletedOnRemote." + error;
925
+ }
926
+ return null;
927
+ };
928
+
929
+ /**
930
+ * Creates a SyncInfo message from a plain object. Also converts values to their respective internal types.
931
+ * @function fromObject
932
+ * @memberof file.StatsMsg.SyncInfo
933
+ * @static
934
+ * @param {Object.<string,*>} object Plain object
935
+ * @returns {file.StatsMsg.SyncInfo} SyncInfo
936
+ */
937
+ SyncInfo.fromObject = function fromObject(object) {
938
+ if (object instanceof $root.file.StatsMsg.SyncInfo)
939
+ return object;
940
+ var message = new $root.file.StatsMsg.SyncInfo();
941
+ if (object.state != null)
942
+ message.state = String(object.state);
943
+ if (object.latest != null) {
944
+ if (typeof object.latest !== "object")
945
+ throw TypeError(".file.StatsMsg.SyncInfo.latest: object expected");
946
+ message.latest = $root.common.UInt64Value.fromObject(object.latest);
947
+ }
948
+ if (object.remote != null) {
949
+ if (typeof object.remote !== "object")
950
+ throw TypeError(".file.StatsMsg.SyncInfo.remote: object expected");
951
+ message.remote = $root.common.UInt64Value.fromObject(object.remote);
952
+ }
953
+ if (object.conflictingRemote) {
954
+ if (!Array.isArray(object.conflictingRemote))
955
+ throw TypeError(".file.StatsMsg.SyncInfo.conflictingRemote: array expected");
956
+ message.conflictingRemote = [];
957
+ for (var i = 0; i < object.conflictingRemote.length; ++i)
958
+ if ($util.Long)
959
+ (message.conflictingRemote[i] = $util.Long.fromValue(object.conflictingRemote[i])).unsigned = true;
960
+ else if (typeof object.conflictingRemote[i] === "string")
961
+ message.conflictingRemote[i] = parseInt(object.conflictingRemote[i], 10);
962
+ else if (typeof object.conflictingRemote[i] === "number")
963
+ message.conflictingRemote[i] = object.conflictingRemote[i];
964
+ else if (typeof object.conflictingRemote[i] === "object")
965
+ message.conflictingRemote[i] = new $util.LongBits(object.conflictingRemote[i].low >>> 0, object.conflictingRemote[i].high >>> 0).toNumber(true);
966
+ }
967
+ if (object.deletedOnRemote != null) {
968
+ if (typeof object.deletedOnRemote !== "object")
969
+ throw TypeError(".file.StatsMsg.SyncInfo.deletedOnRemote: object expected");
970
+ message.deletedOnRemote = $root.common.BooleanValue.fromObject(object.deletedOnRemote);
971
+ }
972
+ return message;
973
+ };
974
+
975
+ /**
976
+ * Creates a plain object from a SyncInfo message. Also converts values to other types if specified.
977
+ * @function toObject
978
+ * @memberof file.StatsMsg.SyncInfo
979
+ * @static
980
+ * @param {file.StatsMsg.SyncInfo} message SyncInfo
981
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
982
+ * @returns {Object.<string,*>} Plain object
983
+ */
984
+ SyncInfo.toObject = function toObject(message, options) {
985
+ if (!options)
986
+ options = {};
987
+ var object = {};
988
+ if (options.arrays || options.defaults)
989
+ object.conflictingRemote = [];
990
+ if (options.defaults) {
991
+ object.state = "";
992
+ object.latest = null;
993
+ object.remote = null;
994
+ object.deletedOnRemote = null;
995
+ }
996
+ if (message.state != null && message.hasOwnProperty("state"))
997
+ object.state = message.state;
998
+ if (message.latest != null && message.hasOwnProperty("latest"))
999
+ object.latest = $root.common.UInt64Value.toObject(message.latest, options);
1000
+ if (message.remote != null && message.hasOwnProperty("remote"))
1001
+ object.remote = $root.common.UInt64Value.toObject(message.remote, options);
1002
+ if (message.conflictingRemote && message.conflictingRemote.length) {
1003
+ object.conflictingRemote = [];
1004
+ for (var j = 0; j < message.conflictingRemote.length; ++j)
1005
+ if (typeof message.conflictingRemote[j] === "number")
1006
+ object.conflictingRemote[j] = options.longs === String ? String(message.conflictingRemote[j]) : message.conflictingRemote[j];
1007
+ else
1008
+ object.conflictingRemote[j] = options.longs === String ? $util.Long.prototype.toString.call(message.conflictingRemote[j]) : options.longs === Number ? new $util.LongBits(message.conflictingRemote[j].low >>> 0, message.conflictingRemote[j].high >>> 0).toNumber(true) : message.conflictingRemote[j];
1009
+ }
1010
+ if (message.deletedOnRemote != null && message.hasOwnProperty("deletedOnRemote"))
1011
+ object.deletedOnRemote = $root.common.BooleanValue.toObject(message.deletedOnRemote, options);
1012
+ return object;
1013
+ };
1014
+
1015
+ /**
1016
+ * Converts this SyncInfo to JSON.
1017
+ * @function toJSON
1018
+ * @memberof file.StatsMsg.SyncInfo
1019
+ * @instance
1020
+ * @returns {Object.<string,*>} JSON object
1021
+ */
1022
+ SyncInfo.prototype.toJSON = function toJSON() {
1023
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1024
+ };
1025
+
1026
+ return SyncInfo;
1027
+ })();
1028
+
676
1029
  return StatsMsg;
677
1030
  })();
678
1031
 
@@ -1533,8 +1886,7 @@ $root.file = (function() {
1533
1886
  * @property {common.IBooleanValue|null} [isRemote] FileEventMsg isRemote
1534
1887
  * @property {common.IUInt64Value|null} [newVersion] FileEventMsg newVersion
1535
1888
  * @property {common.IUInt64Value|null} [current] FileEventMsg current
1536
- * @property {common.IUInt64Value|null} [lastSynced] FileEventMsg lastSynced
1537
- * @property {common.IUInt64Value|null} [remoteVersion] FileEventMsg remoteVersion
1889
+ * @property {common.IUInt64Value|null} [uploaded] FileEventMsg uploaded
1538
1890
  */
1539
1891
 
1540
1892
  /**
@@ -1593,20 +1945,12 @@ $root.file = (function() {
1593
1945
  FileEventMsg.prototype.current = null;
1594
1946
 
1595
1947
  /**
1596
- * FileEventMsg lastSynced.
1597
- * @member {common.IUInt64Value|null|undefined} lastSynced
1948
+ * FileEventMsg uploaded.
1949
+ * @member {common.IUInt64Value|null|undefined} uploaded
1598
1950
  * @memberof file.FileEventMsg
1599
1951
  * @instance
1600
1952
  */
1601
- FileEventMsg.prototype.lastSynced = null;
1602
-
1603
- /**
1604
- * FileEventMsg remoteVersion.
1605
- * @member {common.IUInt64Value|null|undefined} remoteVersion
1606
- * @memberof file.FileEventMsg
1607
- * @instance
1608
- */
1609
- FileEventMsg.prototype.remoteVersion = null;
1953
+ FileEventMsg.prototype.uploaded = null;
1610
1954
 
1611
1955
  /**
1612
1956
  * Creates a new FileEventMsg instance using the specified properties.
@@ -1642,10 +1986,8 @@ $root.file = (function() {
1642
1986
  $root.common.UInt64Value.encode(message.newVersion, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
1643
1987
  if (message.current != null && Object.hasOwnProperty.call(message, "current"))
1644
1988
  $root.common.UInt64Value.encode(message.current, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim();
1645
- if (message.lastSynced != null && Object.hasOwnProperty.call(message, "lastSynced"))
1646
- $root.common.UInt64Value.encode(message.lastSynced, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim();
1647
- if (message.remoteVersion != null && Object.hasOwnProperty.call(message, "remoteVersion"))
1648
- $root.common.UInt64Value.encode(message.remoteVersion, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim();
1989
+ if (message.uploaded != null && Object.hasOwnProperty.call(message, "uploaded"))
1990
+ $root.common.UInt64Value.encode(message.uploaded, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim();
1649
1991
  return writer;
1650
1992
  };
1651
1993
 
@@ -1696,10 +2038,7 @@ $root.file = (function() {
1696
2038
  message.current = $root.common.UInt64Value.decode(reader, reader.uint32());
1697
2039
  break;
1698
2040
  case 15:
1699
- message.lastSynced = $root.common.UInt64Value.decode(reader, reader.uint32());
1700
- break;
1701
- case 16:
1702
- message.remoteVersion = $root.common.UInt64Value.decode(reader, reader.uint32());
2041
+ message.uploaded = $root.common.UInt64Value.decode(reader, reader.uint32());
1703
2042
  break;
1704
2043
  default:
1705
2044
  reader.skipType(tag & 7);
@@ -1757,15 +2096,10 @@ $root.file = (function() {
1757
2096
  if (error)
1758
2097
  return "current." + error;
1759
2098
  }
1760
- if (message.lastSynced != null && message.hasOwnProperty("lastSynced")) {
1761
- var error = $root.common.UInt64Value.verify(message.lastSynced);
2099
+ if (message.uploaded != null && message.hasOwnProperty("uploaded")) {
2100
+ var error = $root.common.UInt64Value.verify(message.uploaded);
1762
2101
  if (error)
1763
- return "lastSynced." + error;
1764
- }
1765
- if (message.remoteVersion != null && message.hasOwnProperty("remoteVersion")) {
1766
- var error = $root.common.UInt64Value.verify(message.remoteVersion);
1767
- if (error)
1768
- return "remoteVersion." + error;
2102
+ return "uploaded." + error;
1769
2103
  }
1770
2104
  return null;
1771
2105
  };
@@ -1801,15 +2135,10 @@ $root.file = (function() {
1801
2135
  throw TypeError(".file.FileEventMsg.current: object expected");
1802
2136
  message.current = $root.common.UInt64Value.fromObject(object.current);
1803
2137
  }
1804
- if (object.lastSynced != null) {
1805
- if (typeof object.lastSynced !== "object")
1806
- throw TypeError(".file.FileEventMsg.lastSynced: object expected");
1807
- message.lastSynced = $root.common.UInt64Value.fromObject(object.lastSynced);
1808
- }
1809
- if (object.remoteVersion != null) {
1810
- if (typeof object.remoteVersion !== "object")
1811
- throw TypeError(".file.FileEventMsg.remoteVersion: object expected");
1812
- message.remoteVersion = $root.common.UInt64Value.fromObject(object.remoteVersion);
2138
+ if (object.uploaded != null) {
2139
+ if (typeof object.uploaded !== "object")
2140
+ throw TypeError(".file.FileEventMsg.uploaded: object expected");
2141
+ message.uploaded = $root.common.UInt64Value.fromObject(object.uploaded);
1813
2142
  }
1814
2143
  return message;
1815
2144
  };
@@ -1833,8 +2162,7 @@ $root.file = (function() {
1833
2162
  object.isRemote = null;
1834
2163
  object.newVersion = null;
1835
2164
  object.current = null;
1836
- object.lastSynced = null;
1837
- object.remoteVersion = null;
2165
+ object.uploaded = null;
1838
2166
  }
1839
2167
  if (message.type != null && message.hasOwnProperty("type"))
1840
2168
  object.type = message.type;
@@ -1846,10 +2174,8 @@ $root.file = (function() {
1846
2174
  object.newVersion = $root.common.UInt64Value.toObject(message.newVersion, options);
1847
2175
  if (message.current != null && message.hasOwnProperty("current"))
1848
2176
  object.current = $root.common.UInt64Value.toObject(message.current, options);
1849
- if (message.lastSynced != null && message.hasOwnProperty("lastSynced"))
1850
- object.lastSynced = $root.common.UInt64Value.toObject(message.lastSynced, options);
1851
- if (message.remoteVersion != null && message.hasOwnProperty("remoteVersion"))
1852
- object.remoteVersion = $root.common.UInt64Value.toObject(message.remoteVersion, options);
2177
+ if (message.uploaded != null && message.hasOwnProperty("uploaded"))
2178
+ object.uploaded = $root.common.UInt64Value.toObject(message.uploaded, options);
1853
2179
  return object;
1854
2180
  };
1855
2181