core-3nweb-client-lib 0.43.6 → 0.43.7

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.
@@ -169,6 +169,7 @@ declare namespace web3n.files {
169
169
  local?: LocalVersion;
170
170
  remote?: SyncVersionsBranch;
171
171
  existsInSyncedParent?: boolean;
172
+ uploading?: UploadingState;
172
173
  }
173
174
 
174
175
  interface LocalVersion {
@@ -184,6 +185,24 @@ declare namespace web3n.files {
184
185
 
185
186
  type SyncState = 'synced' | 'behind' | 'unsynced' | 'conflicting';
186
187
 
188
+ interface UploadingState {
189
+ /**
190
+ * Local version that is uploaded to server.
191
+ * If it is an upload of object removal, version is -1.
192
+ */
193
+ localVersion: number;
194
+ /**
195
+ * New remote version that is uploaded to server.
196
+ * If it is an upload of object removal, version is -1.
197
+ */
198
+ remoteVersion: number;
199
+ /**
200
+ * Bytes left to upload.
201
+ */
202
+ bytesLeftToUpload: number;
203
+ uploadStarted: boolean;
204
+ }
205
+
187
206
  interface FileByteSource {
188
207
 
189
208
  /**
@@ -48,16 +48,37 @@ export interface RemovalUpload {
48
48
  export interface WholeVerOrderedUpload {
49
49
  type: 'ordered-whole';
50
50
  createObj?: boolean;
51
+ /**
52
+ * Header bytes that need to be uploaded. Undefined when header has been uploaded.
53
+ */
51
54
  header?: number;
55
+ /**
56
+ * Segments bytes left to upload.
57
+ */
52
58
  segsLeft: number;
59
+ /**
60
+ * Offset in segments, to which point bytes where uploaded.
61
+ */
53
62
  segsOfs: number;
63
+ /**
64
+ * Upload transaction id.
65
+ */
54
66
  transactionId?: string;
55
67
  }
56
68
  export interface DiffVerOrderedUpload {
57
69
  type: 'ordered-diff';
58
70
  diff: DiffInfo;
71
+ /**
72
+ * Header bytes that need to be uploaded. Undefined when header has been uploaded.
73
+ */
59
74
  header?: number;
75
+ /**
76
+ * New chunks of segments that should be uploaded.
77
+ */
60
78
  newSegsLeft: FiniteChunk[];
79
+ /**
80
+ * Upload transaction id.
81
+ */
61
82
  transactionId?: string;
62
83
  }
63
84
  export interface BytesSection {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /*
3
- Copyright (C) 2016 - 2020, 2022 3NSoft Inc.
3
+ Copyright (C) 2016 - 2020, 2022, 2025 3NSoft Inc.
4
4
 
5
5
  This program is free software: you can redistribute it and/or modify it under
6
6
  the terms of the GNU General Public License as published by the Free Software
@@ -494,7 +494,8 @@ class ObjStatus {
494
494
  state: this.stateIndicator,
495
495
  local: localVersionFromStatus(this.status.local),
496
496
  remote,
497
- synced
497
+ synced,
498
+ uploading: uploadInStatus(this.status.upload)
498
499
  };
499
500
  }
500
501
  neverUploaded() {
@@ -674,4 +675,46 @@ function skipNotFoundExc(exc) {
674
675
  throw exc;
675
676
  }
676
677
  }
678
+ function uploadInStatus(upload) {
679
+ if (!upload) {
680
+ return;
681
+ }
682
+ if (upload.type === 'new-version') {
683
+ const { needUpload } = upload;
684
+ if (!needUpload) {
685
+ return;
686
+ }
687
+ let bytesLeftToUpload = 0;
688
+ if (needUpload.type === 'ordered-whole') {
689
+ const { header, segsLeft } = needUpload;
690
+ if (header) {
691
+ bytesLeftToUpload += header;
692
+ }
693
+ bytesLeftToUpload += segsLeft;
694
+ }
695
+ else if (needUpload.type === 'ordered-diff') {
696
+ const { header, newSegsLeft } = needUpload;
697
+ if (header) {
698
+ bytesLeftToUpload += header;
699
+ }
700
+ for (const { len: chunkLen } of newSegsLeft) {
701
+ bytesLeftToUpload += chunkLen;
702
+ }
703
+ }
704
+ return {
705
+ localVersion: upload.localVersion,
706
+ remoteVersion: upload.uploadVersion,
707
+ bytesLeftToUpload,
708
+ uploadStarted: !!needUpload.transactionId
709
+ };
710
+ }
711
+ else {
712
+ return {
713
+ localVersion: -1,
714
+ remoteVersion: -1,
715
+ bytesLeftToUpload: 0,
716
+ uploadStarted: false
717
+ };
718
+ }
719
+ }
677
720
  Object.freeze(exports);
@@ -181,8 +181,7 @@ class UploadTask {
181
181
  }
182
182
  }
183
183
  async headerToUpload() {
184
- return (this.uploadHeader ?
185
- this.uploadHeader : await this.src.readHeader());
184
+ return (this.uploadHeader ? this.uploadHeader : await this.src.readHeader());
186
185
  }
187
186
  async startOrderedDiffUpload(upload) {
188
187
  const diff = buffer_utils_1.utf8.pack(JSON.stringify(upload.diff));
@@ -205,7 +205,8 @@ function syncStatusToMsg(s) {
205
205
  local: syncBranchToMsg(s.local),
206
206
  synced: syncBranchToMsg(s.synced),
207
207
  remote: syncBranchToMsg(s.remote),
208
- existsInSyncedParent: (0, protobuf_msg_1.toOptVal)(s.existsInSyncedParent)
208
+ existsInSyncedParent: (0, protobuf_msg_1.toOptVal)(s.existsInSyncedParent),
209
+ uploading: uploadingToMsg(s.uploading)
209
210
  };
210
211
  }
211
212
  function msgToSyncStatus(m) {
@@ -217,7 +218,8 @@ function msgToSyncStatus(m) {
217
218
  local: msgToSyncBranch(m.local),
218
219
  synced: msgToSyncBranch(m.synced),
219
220
  remote: msgToSyncBranch(m.remote),
220
- existsInSyncedParent: (0, protobuf_msg_1.valOfOpt)(m.existsInSyncedParent)
221
+ existsInSyncedParent: (0, protobuf_msg_1.valOfOpt)(m.existsInSyncedParent),
222
+ uploading: msgToUploading(m.uploading)
221
223
  };
222
224
  }
223
225
  function syncBranchToMsg(b) {
@@ -241,6 +243,28 @@ function msgToSyncBranch(m) {
241
243
  isArchived: (0, protobuf_msg_1.valOfOpt)(m.isArchived)
242
244
  };
243
245
  }
246
+ function uploadingToMsg(u) {
247
+ if (!u) {
248
+ return;
249
+ }
250
+ return {
251
+ localVersion: (0, protobuf_msg_1.toVal)(u.localVersion),
252
+ remoteVersion: (0, protobuf_msg_1.toVal)(u.remoteVersion),
253
+ bytesLeftToUpload: (0, protobuf_msg_1.toVal)(u.bytesLeftToUpload),
254
+ uploadStarted: u.uploadStarted
255
+ };
256
+ }
257
+ function msgToUploading(u) {
258
+ if (!u) {
259
+ return;
260
+ }
261
+ return {
262
+ localVersion: (0, protobuf_msg_1.intValOf)(u.localVersion),
263
+ remoteVersion: (0, protobuf_msg_1.intValOf)(u.remoteVersion),
264
+ bytesLeftToUpload: (0, protobuf_msg_1.intValOf)(u.bytesLeftToUpload),
265
+ uploadStarted: u.uploadStarted
266
+ };
267
+ }
244
268
  const syncStatusMsgType = protobuf_type_1.ProtoType.for(file_proto_1.file.SyncStatusMsg);
245
269
  function packSyncStatus(s) {
246
270
  return syncStatusMsgType.pack(syncStatusToMsg(s));
@@ -8204,6 +8204,7 @@ $root.file = (function() {
8204
8204
  * @property {file.ISyncVersionsBranchMsg|null} [synced] SyncStatusMsg synced
8205
8205
  * @property {file.ISyncVersionsBranchMsg|null} [remote] SyncStatusMsg remote
8206
8206
  * @property {common.IBooleanValue|null} [existsInSyncedParent] SyncStatusMsg existsInSyncedParent
8207
+ * @property {file.IUploadingStateMsg|null} [uploading] SyncStatusMsg uploading
8207
8208
  */
8208
8209
 
8209
8210
  /**
@@ -8261,6 +8262,14 @@ $root.file = (function() {
8261
8262
  */
8262
8263
  SyncStatusMsg.prototype.existsInSyncedParent = null;
8263
8264
 
8265
+ /**
8266
+ * SyncStatusMsg uploading.
8267
+ * @member {file.IUploadingStateMsg|null|undefined} uploading
8268
+ * @memberof file.SyncStatusMsg
8269
+ * @instance
8270
+ */
8271
+ SyncStatusMsg.prototype.uploading = null;
8272
+
8264
8273
  /**
8265
8274
  * Creates a new SyncStatusMsg instance using the specified properties.
8266
8275
  * @function create
@@ -8295,6 +8304,8 @@ $root.file = (function() {
8295
8304
  $root.file.SyncVersionsBranchMsg.encode(message.remote, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
8296
8305
  if (message.existsInSyncedParent != null && Object.hasOwnProperty.call(message, "existsInSyncedParent"))
8297
8306
  $root.common.BooleanValue.encode(message.existsInSyncedParent, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
8307
+ if (message.uploading != null && Object.hasOwnProperty.call(message, "uploading"))
8308
+ $root.file.UploadingStateMsg.encode(message.uploading, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
8298
8309
  return writer;
8299
8310
  };
8300
8311
 
@@ -8351,6 +8362,10 @@ $root.file = (function() {
8351
8362
  message.existsInSyncedParent = $root.common.BooleanValue.decode(reader, reader.uint32());
8352
8363
  break;
8353
8364
  }
8365
+ case 6: {
8366
+ message.uploading = $root.file.UploadingStateMsg.decode(reader, reader.uint32());
8367
+ break;
8368
+ }
8354
8369
  default:
8355
8370
  reader.skipType(tag & 7);
8356
8371
  break;
@@ -8409,6 +8424,11 @@ $root.file = (function() {
8409
8424
  if (error)
8410
8425
  return "existsInSyncedParent." + error;
8411
8426
  }
8427
+ if (message.uploading != null && message.hasOwnProperty("uploading")) {
8428
+ var error = $root.file.UploadingStateMsg.verify(message.uploading);
8429
+ if (error)
8430
+ return "uploading." + error;
8431
+ }
8412
8432
  return null;
8413
8433
  };
8414
8434
 
@@ -8446,6 +8466,11 @@ $root.file = (function() {
8446
8466
  throw TypeError(".file.SyncStatusMsg.existsInSyncedParent: object expected");
8447
8467
  message.existsInSyncedParent = $root.common.BooleanValue.fromObject(object.existsInSyncedParent);
8448
8468
  }
8469
+ if (object.uploading != null) {
8470
+ if (typeof object.uploading !== "object")
8471
+ throw TypeError(".file.SyncStatusMsg.uploading: object expected");
8472
+ message.uploading = $root.file.UploadingStateMsg.fromObject(object.uploading);
8473
+ }
8449
8474
  return message;
8450
8475
  };
8451
8476
 
@@ -8468,6 +8493,7 @@ $root.file = (function() {
8468
8493
  object.synced = null;
8469
8494
  object.remote = null;
8470
8495
  object.existsInSyncedParent = null;
8496
+ object.uploading = null;
8471
8497
  }
8472
8498
  if (message.state != null && message.hasOwnProperty("state"))
8473
8499
  object.state = message.state;
@@ -8479,6 +8505,8 @@ $root.file = (function() {
8479
8505
  object.remote = $root.file.SyncVersionsBranchMsg.toObject(message.remote, options);
8480
8506
  if (message.existsInSyncedParent != null && message.hasOwnProperty("existsInSyncedParent"))
8481
8507
  object.existsInSyncedParent = $root.common.BooleanValue.toObject(message.existsInSyncedParent, options);
8508
+ if (message.uploading != null && message.hasOwnProperty("uploading"))
8509
+ object.uploading = $root.file.UploadingStateMsg.toObject(message.uploading, options);
8482
8510
  return object;
8483
8511
  };
8484
8512
 
@@ -8808,6 +8836,296 @@ $root.file = (function() {
8808
8836
  return SyncVersionsBranchMsg;
8809
8837
  })();
8810
8838
 
8839
+ file.UploadingStateMsg = (function() {
8840
+
8841
+ /**
8842
+ * Properties of an UploadingStateMsg.
8843
+ * @memberof file
8844
+ * @interface IUploadingStateMsg
8845
+ * @property {common.IUInt64Value|null} [localVersion] UploadingStateMsg localVersion
8846
+ * @property {common.IUInt64Value|null} [remoteVersion] UploadingStateMsg remoteVersion
8847
+ * @property {common.IUInt64Value|null} [bytesLeftToUpload] UploadingStateMsg bytesLeftToUpload
8848
+ * @property {boolean|null} [uploadStarted] UploadingStateMsg uploadStarted
8849
+ */
8850
+
8851
+ /**
8852
+ * Constructs a new UploadingStateMsg.
8853
+ * @memberof file
8854
+ * @classdesc Represents an UploadingStateMsg.
8855
+ * @implements IUploadingStateMsg
8856
+ * @constructor
8857
+ * @param {file.IUploadingStateMsg=} [properties] Properties to set
8858
+ */
8859
+ function UploadingStateMsg(properties) {
8860
+ if (properties)
8861
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
8862
+ if (properties[keys[i]] != null)
8863
+ this[keys[i]] = properties[keys[i]];
8864
+ }
8865
+
8866
+ /**
8867
+ * UploadingStateMsg localVersion.
8868
+ * @member {common.IUInt64Value|null|undefined} localVersion
8869
+ * @memberof file.UploadingStateMsg
8870
+ * @instance
8871
+ */
8872
+ UploadingStateMsg.prototype.localVersion = null;
8873
+
8874
+ /**
8875
+ * UploadingStateMsg remoteVersion.
8876
+ * @member {common.IUInt64Value|null|undefined} remoteVersion
8877
+ * @memberof file.UploadingStateMsg
8878
+ * @instance
8879
+ */
8880
+ UploadingStateMsg.prototype.remoteVersion = null;
8881
+
8882
+ /**
8883
+ * UploadingStateMsg bytesLeftToUpload.
8884
+ * @member {common.IUInt64Value|null|undefined} bytesLeftToUpload
8885
+ * @memberof file.UploadingStateMsg
8886
+ * @instance
8887
+ */
8888
+ UploadingStateMsg.prototype.bytesLeftToUpload = null;
8889
+
8890
+ /**
8891
+ * UploadingStateMsg uploadStarted.
8892
+ * @member {boolean} uploadStarted
8893
+ * @memberof file.UploadingStateMsg
8894
+ * @instance
8895
+ */
8896
+ UploadingStateMsg.prototype.uploadStarted = false;
8897
+
8898
+ /**
8899
+ * Creates a new UploadingStateMsg instance using the specified properties.
8900
+ * @function create
8901
+ * @memberof file.UploadingStateMsg
8902
+ * @static
8903
+ * @param {file.IUploadingStateMsg=} [properties] Properties to set
8904
+ * @returns {file.UploadingStateMsg} UploadingStateMsg instance
8905
+ */
8906
+ UploadingStateMsg.create = function create(properties) {
8907
+ return new UploadingStateMsg(properties);
8908
+ };
8909
+
8910
+ /**
8911
+ * Encodes the specified UploadingStateMsg message. Does not implicitly {@link file.UploadingStateMsg.verify|verify} messages.
8912
+ * @function encode
8913
+ * @memberof file.UploadingStateMsg
8914
+ * @static
8915
+ * @param {file.IUploadingStateMsg} message UploadingStateMsg message or plain object to encode
8916
+ * @param {$protobuf.Writer} [writer] Writer to encode to
8917
+ * @returns {$protobuf.Writer} Writer
8918
+ */
8919
+ UploadingStateMsg.encode = function encode(message, writer) {
8920
+ if (!writer)
8921
+ writer = $Writer.create();
8922
+ if (message.localVersion != null && Object.hasOwnProperty.call(message, "localVersion"))
8923
+ $root.common.UInt64Value.encode(message.localVersion, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
8924
+ if (message.remoteVersion != null && Object.hasOwnProperty.call(message, "remoteVersion"))
8925
+ $root.common.UInt64Value.encode(message.remoteVersion, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
8926
+ if (message.bytesLeftToUpload != null && Object.hasOwnProperty.call(message, "bytesLeftToUpload"))
8927
+ $root.common.UInt64Value.encode(message.bytesLeftToUpload, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
8928
+ if (message.uploadStarted != null && Object.hasOwnProperty.call(message, "uploadStarted"))
8929
+ writer.uint32(/* id 4, wireType 0 =*/32).bool(message.uploadStarted);
8930
+ return writer;
8931
+ };
8932
+
8933
+ /**
8934
+ * Encodes the specified UploadingStateMsg message, length delimited. Does not implicitly {@link file.UploadingStateMsg.verify|verify} messages.
8935
+ * @function encodeDelimited
8936
+ * @memberof file.UploadingStateMsg
8937
+ * @static
8938
+ * @param {file.IUploadingStateMsg} message UploadingStateMsg message or plain object to encode
8939
+ * @param {$protobuf.Writer} [writer] Writer to encode to
8940
+ * @returns {$protobuf.Writer} Writer
8941
+ */
8942
+ UploadingStateMsg.encodeDelimited = function encodeDelimited(message, writer) {
8943
+ return this.encode(message, writer).ldelim();
8944
+ };
8945
+
8946
+ /**
8947
+ * Decodes an UploadingStateMsg message from the specified reader or buffer.
8948
+ * @function decode
8949
+ * @memberof file.UploadingStateMsg
8950
+ * @static
8951
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
8952
+ * @param {number} [length] Message length if known beforehand
8953
+ * @returns {file.UploadingStateMsg} UploadingStateMsg
8954
+ * @throws {Error} If the payload is not a reader or valid buffer
8955
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
8956
+ */
8957
+ UploadingStateMsg.decode = function decode(reader, length, error) {
8958
+ if (!(reader instanceof $Reader))
8959
+ reader = $Reader.create(reader);
8960
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.file.UploadingStateMsg();
8961
+ while (reader.pos < end) {
8962
+ var tag = reader.uint32();
8963
+ if (tag === error)
8964
+ break;
8965
+ switch (tag >>> 3) {
8966
+ case 1: {
8967
+ message.localVersion = $root.common.UInt64Value.decode(reader, reader.uint32());
8968
+ break;
8969
+ }
8970
+ case 2: {
8971
+ message.remoteVersion = $root.common.UInt64Value.decode(reader, reader.uint32());
8972
+ break;
8973
+ }
8974
+ case 3: {
8975
+ message.bytesLeftToUpload = $root.common.UInt64Value.decode(reader, reader.uint32());
8976
+ break;
8977
+ }
8978
+ case 4: {
8979
+ message.uploadStarted = reader.bool();
8980
+ break;
8981
+ }
8982
+ default:
8983
+ reader.skipType(tag & 7);
8984
+ break;
8985
+ }
8986
+ }
8987
+ return message;
8988
+ };
8989
+
8990
+ /**
8991
+ * Decodes an UploadingStateMsg message from the specified reader or buffer, length delimited.
8992
+ * @function decodeDelimited
8993
+ * @memberof file.UploadingStateMsg
8994
+ * @static
8995
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
8996
+ * @returns {file.UploadingStateMsg} UploadingStateMsg
8997
+ * @throws {Error} If the payload is not a reader or valid buffer
8998
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
8999
+ */
9000
+ UploadingStateMsg.decodeDelimited = function decodeDelimited(reader) {
9001
+ if (!(reader instanceof $Reader))
9002
+ reader = new $Reader(reader);
9003
+ return this.decode(reader, reader.uint32());
9004
+ };
9005
+
9006
+ /**
9007
+ * Verifies an UploadingStateMsg message.
9008
+ * @function verify
9009
+ * @memberof file.UploadingStateMsg
9010
+ * @static
9011
+ * @param {Object.<string,*>} message Plain object to verify
9012
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
9013
+ */
9014
+ UploadingStateMsg.verify = function verify(message) {
9015
+ if (typeof message !== "object" || message === null)
9016
+ return "object expected";
9017
+ if (message.localVersion != null && message.hasOwnProperty("localVersion")) {
9018
+ var error = $root.common.UInt64Value.verify(message.localVersion);
9019
+ if (error)
9020
+ return "localVersion." + error;
9021
+ }
9022
+ if (message.remoteVersion != null && message.hasOwnProperty("remoteVersion")) {
9023
+ var error = $root.common.UInt64Value.verify(message.remoteVersion);
9024
+ if (error)
9025
+ return "remoteVersion." + error;
9026
+ }
9027
+ if (message.bytesLeftToUpload != null && message.hasOwnProperty("bytesLeftToUpload")) {
9028
+ var error = $root.common.UInt64Value.verify(message.bytesLeftToUpload);
9029
+ if (error)
9030
+ return "bytesLeftToUpload." + error;
9031
+ }
9032
+ if (message.uploadStarted != null && message.hasOwnProperty("uploadStarted"))
9033
+ if (typeof message.uploadStarted !== "boolean")
9034
+ return "uploadStarted: boolean expected";
9035
+ return null;
9036
+ };
9037
+
9038
+ /**
9039
+ * Creates an UploadingStateMsg message from a plain object. Also converts values to their respective internal types.
9040
+ * @function fromObject
9041
+ * @memberof file.UploadingStateMsg
9042
+ * @static
9043
+ * @param {Object.<string,*>} object Plain object
9044
+ * @returns {file.UploadingStateMsg} UploadingStateMsg
9045
+ */
9046
+ UploadingStateMsg.fromObject = function fromObject(object) {
9047
+ if (object instanceof $root.file.UploadingStateMsg)
9048
+ return object;
9049
+ var message = new $root.file.UploadingStateMsg();
9050
+ if (object.localVersion != null) {
9051
+ if (typeof object.localVersion !== "object")
9052
+ throw TypeError(".file.UploadingStateMsg.localVersion: object expected");
9053
+ message.localVersion = $root.common.UInt64Value.fromObject(object.localVersion);
9054
+ }
9055
+ if (object.remoteVersion != null) {
9056
+ if (typeof object.remoteVersion !== "object")
9057
+ throw TypeError(".file.UploadingStateMsg.remoteVersion: object expected");
9058
+ message.remoteVersion = $root.common.UInt64Value.fromObject(object.remoteVersion);
9059
+ }
9060
+ if (object.bytesLeftToUpload != null) {
9061
+ if (typeof object.bytesLeftToUpload !== "object")
9062
+ throw TypeError(".file.UploadingStateMsg.bytesLeftToUpload: object expected");
9063
+ message.bytesLeftToUpload = $root.common.UInt64Value.fromObject(object.bytesLeftToUpload);
9064
+ }
9065
+ if (object.uploadStarted != null)
9066
+ message.uploadStarted = Boolean(object.uploadStarted);
9067
+ return message;
9068
+ };
9069
+
9070
+ /**
9071
+ * Creates a plain object from an UploadingStateMsg message. Also converts values to other types if specified.
9072
+ * @function toObject
9073
+ * @memberof file.UploadingStateMsg
9074
+ * @static
9075
+ * @param {file.UploadingStateMsg} message UploadingStateMsg
9076
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
9077
+ * @returns {Object.<string,*>} Plain object
9078
+ */
9079
+ UploadingStateMsg.toObject = function toObject(message, options) {
9080
+ if (!options)
9081
+ options = {};
9082
+ var object = {};
9083
+ if (options.defaults) {
9084
+ object.localVersion = null;
9085
+ object.remoteVersion = null;
9086
+ object.bytesLeftToUpload = null;
9087
+ object.uploadStarted = false;
9088
+ }
9089
+ if (message.localVersion != null && message.hasOwnProperty("localVersion"))
9090
+ object.localVersion = $root.common.UInt64Value.toObject(message.localVersion, options);
9091
+ if (message.remoteVersion != null && message.hasOwnProperty("remoteVersion"))
9092
+ object.remoteVersion = $root.common.UInt64Value.toObject(message.remoteVersion, options);
9093
+ if (message.bytesLeftToUpload != null && message.hasOwnProperty("bytesLeftToUpload"))
9094
+ object.bytesLeftToUpload = $root.common.UInt64Value.toObject(message.bytesLeftToUpload, options);
9095
+ if (message.uploadStarted != null && message.hasOwnProperty("uploadStarted"))
9096
+ object.uploadStarted = message.uploadStarted;
9097
+ return object;
9098
+ };
9099
+
9100
+ /**
9101
+ * Converts this UploadingStateMsg to JSON.
9102
+ * @function toJSON
9103
+ * @memberof file.UploadingStateMsg
9104
+ * @instance
9105
+ * @returns {Object.<string,*>} JSON object
9106
+ */
9107
+ UploadingStateMsg.prototype.toJSON = function toJSON() {
9108
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
9109
+ };
9110
+
9111
+ /**
9112
+ * Gets the default type url for UploadingStateMsg
9113
+ * @function getTypeUrl
9114
+ * @memberof file.UploadingStateMsg
9115
+ * @static
9116
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
9117
+ * @returns {string} The default type url
9118
+ */
9119
+ UploadingStateMsg.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
9120
+ if (typeUrlPrefix === undefined) {
9121
+ typeUrlPrefix = "type.googleapis.com";
9122
+ }
9123
+ return typeUrlPrefix + "/file.UploadingStateMsg";
9124
+ };
9125
+
9126
+ return UploadingStateMsg;
9127
+ })();
9128
+
8811
9129
  file.StatsMsg = (function() {
8812
9130
 
8813
9131
  /**
@@ -355,6 +355,7 @@ $root.file = (function() {
355
355
  * @property {file.ISyncVersionsBranchMsg|null} [synced] SyncStatusMsg synced
356
356
  * @property {file.ISyncVersionsBranchMsg|null} [remote] SyncStatusMsg remote
357
357
  * @property {common.IBooleanValue|null} [existsInSyncedParent] SyncStatusMsg existsInSyncedParent
358
+ * @property {file.IUploadingStateMsg|null} [uploading] SyncStatusMsg uploading
358
359
  */
359
360
 
360
361
  /**
@@ -412,6 +413,14 @@ $root.file = (function() {
412
413
  */
413
414
  SyncStatusMsg.prototype.existsInSyncedParent = null;
414
415
 
416
+ /**
417
+ * SyncStatusMsg uploading.
418
+ * @member {file.IUploadingStateMsg|null|undefined} uploading
419
+ * @memberof file.SyncStatusMsg
420
+ * @instance
421
+ */
422
+ SyncStatusMsg.prototype.uploading = null;
423
+
415
424
  /**
416
425
  * Creates a new SyncStatusMsg instance using the specified properties.
417
426
  * @function create
@@ -446,6 +455,8 @@ $root.file = (function() {
446
455
  $root.file.SyncVersionsBranchMsg.encode(message.remote, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
447
456
  if (message.existsInSyncedParent != null && Object.hasOwnProperty.call(message, "existsInSyncedParent"))
448
457
  $root.common.BooleanValue.encode(message.existsInSyncedParent, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
458
+ if (message.uploading != null && Object.hasOwnProperty.call(message, "uploading"))
459
+ $root.file.UploadingStateMsg.encode(message.uploading, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
449
460
  return writer;
450
461
  };
451
462
 
@@ -502,6 +513,10 @@ $root.file = (function() {
502
513
  message.existsInSyncedParent = $root.common.BooleanValue.decode(reader, reader.uint32());
503
514
  break;
504
515
  }
516
+ case 6: {
517
+ message.uploading = $root.file.UploadingStateMsg.decode(reader, reader.uint32());
518
+ break;
519
+ }
505
520
  default:
506
521
  reader.skipType(tag & 7);
507
522
  break;
@@ -560,6 +575,11 @@ $root.file = (function() {
560
575
  if (error)
561
576
  return "existsInSyncedParent." + error;
562
577
  }
578
+ if (message.uploading != null && message.hasOwnProperty("uploading")) {
579
+ var error = $root.file.UploadingStateMsg.verify(message.uploading);
580
+ if (error)
581
+ return "uploading." + error;
582
+ }
563
583
  return null;
564
584
  };
565
585
 
@@ -597,6 +617,11 @@ $root.file = (function() {
597
617
  throw TypeError(".file.SyncStatusMsg.existsInSyncedParent: object expected");
598
618
  message.existsInSyncedParent = $root.common.BooleanValue.fromObject(object.existsInSyncedParent);
599
619
  }
620
+ if (object.uploading != null) {
621
+ if (typeof object.uploading !== "object")
622
+ throw TypeError(".file.SyncStatusMsg.uploading: object expected");
623
+ message.uploading = $root.file.UploadingStateMsg.fromObject(object.uploading);
624
+ }
600
625
  return message;
601
626
  };
602
627
 
@@ -619,6 +644,7 @@ $root.file = (function() {
619
644
  object.synced = null;
620
645
  object.remote = null;
621
646
  object.existsInSyncedParent = null;
647
+ object.uploading = null;
622
648
  }
623
649
  if (message.state != null && message.hasOwnProperty("state"))
624
650
  object.state = message.state;
@@ -630,6 +656,8 @@ $root.file = (function() {
630
656
  object.remote = $root.file.SyncVersionsBranchMsg.toObject(message.remote, options);
631
657
  if (message.existsInSyncedParent != null && message.hasOwnProperty("existsInSyncedParent"))
632
658
  object.existsInSyncedParent = $root.common.BooleanValue.toObject(message.existsInSyncedParent, options);
659
+ if (message.uploading != null && message.hasOwnProperty("uploading"))
660
+ object.uploading = $root.file.UploadingStateMsg.toObject(message.uploading, options);
633
661
  return object;
634
662
  };
635
663
 
@@ -959,6 +987,296 @@ $root.file = (function() {
959
987
  return SyncVersionsBranchMsg;
960
988
  })();
961
989
 
990
+ file.UploadingStateMsg = (function() {
991
+
992
+ /**
993
+ * Properties of an UploadingStateMsg.
994
+ * @memberof file
995
+ * @interface IUploadingStateMsg
996
+ * @property {common.IUInt64Value|null} [localVersion] UploadingStateMsg localVersion
997
+ * @property {common.IUInt64Value|null} [remoteVersion] UploadingStateMsg remoteVersion
998
+ * @property {common.IUInt64Value|null} [bytesLeftToUpload] UploadingStateMsg bytesLeftToUpload
999
+ * @property {boolean|null} [uploadStarted] UploadingStateMsg uploadStarted
1000
+ */
1001
+
1002
+ /**
1003
+ * Constructs a new UploadingStateMsg.
1004
+ * @memberof file
1005
+ * @classdesc Represents an UploadingStateMsg.
1006
+ * @implements IUploadingStateMsg
1007
+ * @constructor
1008
+ * @param {file.IUploadingStateMsg=} [properties] Properties to set
1009
+ */
1010
+ function UploadingStateMsg(properties) {
1011
+ if (properties)
1012
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1013
+ if (properties[keys[i]] != null)
1014
+ this[keys[i]] = properties[keys[i]];
1015
+ }
1016
+
1017
+ /**
1018
+ * UploadingStateMsg localVersion.
1019
+ * @member {common.IUInt64Value|null|undefined} localVersion
1020
+ * @memberof file.UploadingStateMsg
1021
+ * @instance
1022
+ */
1023
+ UploadingStateMsg.prototype.localVersion = null;
1024
+
1025
+ /**
1026
+ * UploadingStateMsg remoteVersion.
1027
+ * @member {common.IUInt64Value|null|undefined} remoteVersion
1028
+ * @memberof file.UploadingStateMsg
1029
+ * @instance
1030
+ */
1031
+ UploadingStateMsg.prototype.remoteVersion = null;
1032
+
1033
+ /**
1034
+ * UploadingStateMsg bytesLeftToUpload.
1035
+ * @member {common.IUInt64Value|null|undefined} bytesLeftToUpload
1036
+ * @memberof file.UploadingStateMsg
1037
+ * @instance
1038
+ */
1039
+ UploadingStateMsg.prototype.bytesLeftToUpload = null;
1040
+
1041
+ /**
1042
+ * UploadingStateMsg uploadStarted.
1043
+ * @member {boolean} uploadStarted
1044
+ * @memberof file.UploadingStateMsg
1045
+ * @instance
1046
+ */
1047
+ UploadingStateMsg.prototype.uploadStarted = false;
1048
+
1049
+ /**
1050
+ * Creates a new UploadingStateMsg instance using the specified properties.
1051
+ * @function create
1052
+ * @memberof file.UploadingStateMsg
1053
+ * @static
1054
+ * @param {file.IUploadingStateMsg=} [properties] Properties to set
1055
+ * @returns {file.UploadingStateMsg} UploadingStateMsg instance
1056
+ */
1057
+ UploadingStateMsg.create = function create(properties) {
1058
+ return new UploadingStateMsg(properties);
1059
+ };
1060
+
1061
+ /**
1062
+ * Encodes the specified UploadingStateMsg message. Does not implicitly {@link file.UploadingStateMsg.verify|verify} messages.
1063
+ * @function encode
1064
+ * @memberof file.UploadingStateMsg
1065
+ * @static
1066
+ * @param {file.IUploadingStateMsg} message UploadingStateMsg message or plain object to encode
1067
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1068
+ * @returns {$protobuf.Writer} Writer
1069
+ */
1070
+ UploadingStateMsg.encode = function encode(message, writer) {
1071
+ if (!writer)
1072
+ writer = $Writer.create();
1073
+ if (message.localVersion != null && Object.hasOwnProperty.call(message, "localVersion"))
1074
+ $root.common.UInt64Value.encode(message.localVersion, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
1075
+ if (message.remoteVersion != null && Object.hasOwnProperty.call(message, "remoteVersion"))
1076
+ $root.common.UInt64Value.encode(message.remoteVersion, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
1077
+ if (message.bytesLeftToUpload != null && Object.hasOwnProperty.call(message, "bytesLeftToUpload"))
1078
+ $root.common.UInt64Value.encode(message.bytesLeftToUpload, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
1079
+ if (message.uploadStarted != null && Object.hasOwnProperty.call(message, "uploadStarted"))
1080
+ writer.uint32(/* id 4, wireType 0 =*/32).bool(message.uploadStarted);
1081
+ return writer;
1082
+ };
1083
+
1084
+ /**
1085
+ * Encodes the specified UploadingStateMsg message, length delimited. Does not implicitly {@link file.UploadingStateMsg.verify|verify} messages.
1086
+ * @function encodeDelimited
1087
+ * @memberof file.UploadingStateMsg
1088
+ * @static
1089
+ * @param {file.IUploadingStateMsg} message UploadingStateMsg message or plain object to encode
1090
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1091
+ * @returns {$protobuf.Writer} Writer
1092
+ */
1093
+ UploadingStateMsg.encodeDelimited = function encodeDelimited(message, writer) {
1094
+ return this.encode(message, writer).ldelim();
1095
+ };
1096
+
1097
+ /**
1098
+ * Decodes an UploadingStateMsg message from the specified reader or buffer.
1099
+ * @function decode
1100
+ * @memberof file.UploadingStateMsg
1101
+ * @static
1102
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1103
+ * @param {number} [length] Message length if known beforehand
1104
+ * @returns {file.UploadingStateMsg} UploadingStateMsg
1105
+ * @throws {Error} If the payload is not a reader or valid buffer
1106
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1107
+ */
1108
+ UploadingStateMsg.decode = function decode(reader, length, error) {
1109
+ if (!(reader instanceof $Reader))
1110
+ reader = $Reader.create(reader);
1111
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.file.UploadingStateMsg();
1112
+ while (reader.pos < end) {
1113
+ var tag = reader.uint32();
1114
+ if (tag === error)
1115
+ break;
1116
+ switch (tag >>> 3) {
1117
+ case 1: {
1118
+ message.localVersion = $root.common.UInt64Value.decode(reader, reader.uint32());
1119
+ break;
1120
+ }
1121
+ case 2: {
1122
+ message.remoteVersion = $root.common.UInt64Value.decode(reader, reader.uint32());
1123
+ break;
1124
+ }
1125
+ case 3: {
1126
+ message.bytesLeftToUpload = $root.common.UInt64Value.decode(reader, reader.uint32());
1127
+ break;
1128
+ }
1129
+ case 4: {
1130
+ message.uploadStarted = reader.bool();
1131
+ break;
1132
+ }
1133
+ default:
1134
+ reader.skipType(tag & 7);
1135
+ break;
1136
+ }
1137
+ }
1138
+ return message;
1139
+ };
1140
+
1141
+ /**
1142
+ * Decodes an UploadingStateMsg message from the specified reader or buffer, length delimited.
1143
+ * @function decodeDelimited
1144
+ * @memberof file.UploadingStateMsg
1145
+ * @static
1146
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1147
+ * @returns {file.UploadingStateMsg} UploadingStateMsg
1148
+ * @throws {Error} If the payload is not a reader or valid buffer
1149
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1150
+ */
1151
+ UploadingStateMsg.decodeDelimited = function decodeDelimited(reader) {
1152
+ if (!(reader instanceof $Reader))
1153
+ reader = new $Reader(reader);
1154
+ return this.decode(reader, reader.uint32());
1155
+ };
1156
+
1157
+ /**
1158
+ * Verifies an UploadingStateMsg message.
1159
+ * @function verify
1160
+ * @memberof file.UploadingStateMsg
1161
+ * @static
1162
+ * @param {Object.<string,*>} message Plain object to verify
1163
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
1164
+ */
1165
+ UploadingStateMsg.verify = function verify(message) {
1166
+ if (typeof message !== "object" || message === null)
1167
+ return "object expected";
1168
+ if (message.localVersion != null && message.hasOwnProperty("localVersion")) {
1169
+ var error = $root.common.UInt64Value.verify(message.localVersion);
1170
+ if (error)
1171
+ return "localVersion." + error;
1172
+ }
1173
+ if (message.remoteVersion != null && message.hasOwnProperty("remoteVersion")) {
1174
+ var error = $root.common.UInt64Value.verify(message.remoteVersion);
1175
+ if (error)
1176
+ return "remoteVersion." + error;
1177
+ }
1178
+ if (message.bytesLeftToUpload != null && message.hasOwnProperty("bytesLeftToUpload")) {
1179
+ var error = $root.common.UInt64Value.verify(message.bytesLeftToUpload);
1180
+ if (error)
1181
+ return "bytesLeftToUpload." + error;
1182
+ }
1183
+ if (message.uploadStarted != null && message.hasOwnProperty("uploadStarted"))
1184
+ if (typeof message.uploadStarted !== "boolean")
1185
+ return "uploadStarted: boolean expected";
1186
+ return null;
1187
+ };
1188
+
1189
+ /**
1190
+ * Creates an UploadingStateMsg message from a plain object. Also converts values to their respective internal types.
1191
+ * @function fromObject
1192
+ * @memberof file.UploadingStateMsg
1193
+ * @static
1194
+ * @param {Object.<string,*>} object Plain object
1195
+ * @returns {file.UploadingStateMsg} UploadingStateMsg
1196
+ */
1197
+ UploadingStateMsg.fromObject = function fromObject(object) {
1198
+ if (object instanceof $root.file.UploadingStateMsg)
1199
+ return object;
1200
+ var message = new $root.file.UploadingStateMsg();
1201
+ if (object.localVersion != null) {
1202
+ if (typeof object.localVersion !== "object")
1203
+ throw TypeError(".file.UploadingStateMsg.localVersion: object expected");
1204
+ message.localVersion = $root.common.UInt64Value.fromObject(object.localVersion);
1205
+ }
1206
+ if (object.remoteVersion != null) {
1207
+ if (typeof object.remoteVersion !== "object")
1208
+ throw TypeError(".file.UploadingStateMsg.remoteVersion: object expected");
1209
+ message.remoteVersion = $root.common.UInt64Value.fromObject(object.remoteVersion);
1210
+ }
1211
+ if (object.bytesLeftToUpload != null) {
1212
+ if (typeof object.bytesLeftToUpload !== "object")
1213
+ throw TypeError(".file.UploadingStateMsg.bytesLeftToUpload: object expected");
1214
+ message.bytesLeftToUpload = $root.common.UInt64Value.fromObject(object.bytesLeftToUpload);
1215
+ }
1216
+ if (object.uploadStarted != null)
1217
+ message.uploadStarted = Boolean(object.uploadStarted);
1218
+ return message;
1219
+ };
1220
+
1221
+ /**
1222
+ * Creates a plain object from an UploadingStateMsg message. Also converts values to other types if specified.
1223
+ * @function toObject
1224
+ * @memberof file.UploadingStateMsg
1225
+ * @static
1226
+ * @param {file.UploadingStateMsg} message UploadingStateMsg
1227
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
1228
+ * @returns {Object.<string,*>} Plain object
1229
+ */
1230
+ UploadingStateMsg.toObject = function toObject(message, options) {
1231
+ if (!options)
1232
+ options = {};
1233
+ var object = {};
1234
+ if (options.defaults) {
1235
+ object.localVersion = null;
1236
+ object.remoteVersion = null;
1237
+ object.bytesLeftToUpload = null;
1238
+ object.uploadStarted = false;
1239
+ }
1240
+ if (message.localVersion != null && message.hasOwnProperty("localVersion"))
1241
+ object.localVersion = $root.common.UInt64Value.toObject(message.localVersion, options);
1242
+ if (message.remoteVersion != null && message.hasOwnProperty("remoteVersion"))
1243
+ object.remoteVersion = $root.common.UInt64Value.toObject(message.remoteVersion, options);
1244
+ if (message.bytesLeftToUpload != null && message.hasOwnProperty("bytesLeftToUpload"))
1245
+ object.bytesLeftToUpload = $root.common.UInt64Value.toObject(message.bytesLeftToUpload, options);
1246
+ if (message.uploadStarted != null && message.hasOwnProperty("uploadStarted"))
1247
+ object.uploadStarted = message.uploadStarted;
1248
+ return object;
1249
+ };
1250
+
1251
+ /**
1252
+ * Converts this UploadingStateMsg to JSON.
1253
+ * @function toJSON
1254
+ * @memberof file.UploadingStateMsg
1255
+ * @instance
1256
+ * @returns {Object.<string,*>} JSON object
1257
+ */
1258
+ UploadingStateMsg.prototype.toJSON = function toJSON() {
1259
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1260
+ };
1261
+
1262
+ /**
1263
+ * Gets the default type url for UploadingStateMsg
1264
+ * @function getTypeUrl
1265
+ * @memberof file.UploadingStateMsg
1266
+ * @static
1267
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
1268
+ * @returns {string} The default type url
1269
+ */
1270
+ UploadingStateMsg.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
1271
+ if (typeUrlPrefix === undefined) {
1272
+ typeUrlPrefix = "type.googleapis.com";
1273
+ }
1274
+ return typeUrlPrefix + "/file.UploadingStateMsg";
1275
+ };
1276
+
1277
+ return UploadingStateMsg;
1278
+ })();
1279
+
962
1280
  file.StatsMsg = (function() {
963
1281
 
964
1282
  /**
@@ -17895,6 +17895,7 @@ $root.file = (function() {
17895
17895
  * @property {file.ISyncVersionsBranchMsg|null} [synced] SyncStatusMsg synced
17896
17896
  * @property {file.ISyncVersionsBranchMsg|null} [remote] SyncStatusMsg remote
17897
17897
  * @property {common.IBooleanValue|null} [existsInSyncedParent] SyncStatusMsg existsInSyncedParent
17898
+ * @property {file.IUploadingStateMsg|null} [uploading] SyncStatusMsg uploading
17898
17899
  */
17899
17900
 
17900
17901
  /**
@@ -17952,6 +17953,14 @@ $root.file = (function() {
17952
17953
  */
17953
17954
  SyncStatusMsg.prototype.existsInSyncedParent = null;
17954
17955
 
17956
+ /**
17957
+ * SyncStatusMsg uploading.
17958
+ * @member {file.IUploadingStateMsg|null|undefined} uploading
17959
+ * @memberof file.SyncStatusMsg
17960
+ * @instance
17961
+ */
17962
+ SyncStatusMsg.prototype.uploading = null;
17963
+
17955
17964
  /**
17956
17965
  * Creates a new SyncStatusMsg instance using the specified properties.
17957
17966
  * @function create
@@ -17986,6 +17995,8 @@ $root.file = (function() {
17986
17995
  $root.file.SyncVersionsBranchMsg.encode(message.remote, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
17987
17996
  if (message.existsInSyncedParent != null && Object.hasOwnProperty.call(message, "existsInSyncedParent"))
17988
17997
  $root.common.BooleanValue.encode(message.existsInSyncedParent, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
17998
+ if (message.uploading != null && Object.hasOwnProperty.call(message, "uploading"))
17999
+ $root.file.UploadingStateMsg.encode(message.uploading, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
17989
18000
  return writer;
17990
18001
  };
17991
18002
 
@@ -18042,6 +18053,10 @@ $root.file = (function() {
18042
18053
  message.existsInSyncedParent = $root.common.BooleanValue.decode(reader, reader.uint32());
18043
18054
  break;
18044
18055
  }
18056
+ case 6: {
18057
+ message.uploading = $root.file.UploadingStateMsg.decode(reader, reader.uint32());
18058
+ break;
18059
+ }
18045
18060
  default:
18046
18061
  reader.skipType(tag & 7);
18047
18062
  break;
@@ -18100,6 +18115,11 @@ $root.file = (function() {
18100
18115
  if (error)
18101
18116
  return "existsInSyncedParent." + error;
18102
18117
  }
18118
+ if (message.uploading != null && message.hasOwnProperty("uploading")) {
18119
+ var error = $root.file.UploadingStateMsg.verify(message.uploading);
18120
+ if (error)
18121
+ return "uploading." + error;
18122
+ }
18103
18123
  return null;
18104
18124
  };
18105
18125
 
@@ -18137,6 +18157,11 @@ $root.file = (function() {
18137
18157
  throw TypeError(".file.SyncStatusMsg.existsInSyncedParent: object expected");
18138
18158
  message.existsInSyncedParent = $root.common.BooleanValue.fromObject(object.existsInSyncedParent);
18139
18159
  }
18160
+ if (object.uploading != null) {
18161
+ if (typeof object.uploading !== "object")
18162
+ throw TypeError(".file.SyncStatusMsg.uploading: object expected");
18163
+ message.uploading = $root.file.UploadingStateMsg.fromObject(object.uploading);
18164
+ }
18140
18165
  return message;
18141
18166
  };
18142
18167
 
@@ -18159,6 +18184,7 @@ $root.file = (function() {
18159
18184
  object.synced = null;
18160
18185
  object.remote = null;
18161
18186
  object.existsInSyncedParent = null;
18187
+ object.uploading = null;
18162
18188
  }
18163
18189
  if (message.state != null && message.hasOwnProperty("state"))
18164
18190
  object.state = message.state;
@@ -18170,6 +18196,8 @@ $root.file = (function() {
18170
18196
  object.remote = $root.file.SyncVersionsBranchMsg.toObject(message.remote, options);
18171
18197
  if (message.existsInSyncedParent != null && message.hasOwnProperty("existsInSyncedParent"))
18172
18198
  object.existsInSyncedParent = $root.common.BooleanValue.toObject(message.existsInSyncedParent, options);
18199
+ if (message.uploading != null && message.hasOwnProperty("uploading"))
18200
+ object.uploading = $root.file.UploadingStateMsg.toObject(message.uploading, options);
18173
18201
  return object;
18174
18202
  };
18175
18203
 
@@ -18499,6 +18527,296 @@ $root.file = (function() {
18499
18527
  return SyncVersionsBranchMsg;
18500
18528
  })();
18501
18529
 
18530
+ file.UploadingStateMsg = (function() {
18531
+
18532
+ /**
18533
+ * Properties of an UploadingStateMsg.
18534
+ * @memberof file
18535
+ * @interface IUploadingStateMsg
18536
+ * @property {common.IUInt64Value|null} [localVersion] UploadingStateMsg localVersion
18537
+ * @property {common.IUInt64Value|null} [remoteVersion] UploadingStateMsg remoteVersion
18538
+ * @property {common.IUInt64Value|null} [bytesLeftToUpload] UploadingStateMsg bytesLeftToUpload
18539
+ * @property {boolean|null} [uploadStarted] UploadingStateMsg uploadStarted
18540
+ */
18541
+
18542
+ /**
18543
+ * Constructs a new UploadingStateMsg.
18544
+ * @memberof file
18545
+ * @classdesc Represents an UploadingStateMsg.
18546
+ * @implements IUploadingStateMsg
18547
+ * @constructor
18548
+ * @param {file.IUploadingStateMsg=} [properties] Properties to set
18549
+ */
18550
+ function UploadingStateMsg(properties) {
18551
+ if (properties)
18552
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
18553
+ if (properties[keys[i]] != null)
18554
+ this[keys[i]] = properties[keys[i]];
18555
+ }
18556
+
18557
+ /**
18558
+ * UploadingStateMsg localVersion.
18559
+ * @member {common.IUInt64Value|null|undefined} localVersion
18560
+ * @memberof file.UploadingStateMsg
18561
+ * @instance
18562
+ */
18563
+ UploadingStateMsg.prototype.localVersion = null;
18564
+
18565
+ /**
18566
+ * UploadingStateMsg remoteVersion.
18567
+ * @member {common.IUInt64Value|null|undefined} remoteVersion
18568
+ * @memberof file.UploadingStateMsg
18569
+ * @instance
18570
+ */
18571
+ UploadingStateMsg.prototype.remoteVersion = null;
18572
+
18573
+ /**
18574
+ * UploadingStateMsg bytesLeftToUpload.
18575
+ * @member {common.IUInt64Value|null|undefined} bytesLeftToUpload
18576
+ * @memberof file.UploadingStateMsg
18577
+ * @instance
18578
+ */
18579
+ UploadingStateMsg.prototype.bytesLeftToUpload = null;
18580
+
18581
+ /**
18582
+ * UploadingStateMsg uploadStarted.
18583
+ * @member {boolean} uploadStarted
18584
+ * @memberof file.UploadingStateMsg
18585
+ * @instance
18586
+ */
18587
+ UploadingStateMsg.prototype.uploadStarted = false;
18588
+
18589
+ /**
18590
+ * Creates a new UploadingStateMsg instance using the specified properties.
18591
+ * @function create
18592
+ * @memberof file.UploadingStateMsg
18593
+ * @static
18594
+ * @param {file.IUploadingStateMsg=} [properties] Properties to set
18595
+ * @returns {file.UploadingStateMsg} UploadingStateMsg instance
18596
+ */
18597
+ UploadingStateMsg.create = function create(properties) {
18598
+ return new UploadingStateMsg(properties);
18599
+ };
18600
+
18601
+ /**
18602
+ * Encodes the specified UploadingStateMsg message. Does not implicitly {@link file.UploadingStateMsg.verify|verify} messages.
18603
+ * @function encode
18604
+ * @memberof file.UploadingStateMsg
18605
+ * @static
18606
+ * @param {file.IUploadingStateMsg} message UploadingStateMsg message or plain object to encode
18607
+ * @param {$protobuf.Writer} [writer] Writer to encode to
18608
+ * @returns {$protobuf.Writer} Writer
18609
+ */
18610
+ UploadingStateMsg.encode = function encode(message, writer) {
18611
+ if (!writer)
18612
+ writer = $Writer.create();
18613
+ if (message.localVersion != null && Object.hasOwnProperty.call(message, "localVersion"))
18614
+ $root.common.UInt64Value.encode(message.localVersion, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
18615
+ if (message.remoteVersion != null && Object.hasOwnProperty.call(message, "remoteVersion"))
18616
+ $root.common.UInt64Value.encode(message.remoteVersion, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
18617
+ if (message.bytesLeftToUpload != null && Object.hasOwnProperty.call(message, "bytesLeftToUpload"))
18618
+ $root.common.UInt64Value.encode(message.bytesLeftToUpload, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
18619
+ if (message.uploadStarted != null && Object.hasOwnProperty.call(message, "uploadStarted"))
18620
+ writer.uint32(/* id 4, wireType 0 =*/32).bool(message.uploadStarted);
18621
+ return writer;
18622
+ };
18623
+
18624
+ /**
18625
+ * Encodes the specified UploadingStateMsg message, length delimited. Does not implicitly {@link file.UploadingStateMsg.verify|verify} messages.
18626
+ * @function encodeDelimited
18627
+ * @memberof file.UploadingStateMsg
18628
+ * @static
18629
+ * @param {file.IUploadingStateMsg} message UploadingStateMsg message or plain object to encode
18630
+ * @param {$protobuf.Writer} [writer] Writer to encode to
18631
+ * @returns {$protobuf.Writer} Writer
18632
+ */
18633
+ UploadingStateMsg.encodeDelimited = function encodeDelimited(message, writer) {
18634
+ return this.encode(message, writer).ldelim();
18635
+ };
18636
+
18637
+ /**
18638
+ * Decodes an UploadingStateMsg message from the specified reader or buffer.
18639
+ * @function decode
18640
+ * @memberof file.UploadingStateMsg
18641
+ * @static
18642
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
18643
+ * @param {number} [length] Message length if known beforehand
18644
+ * @returns {file.UploadingStateMsg} UploadingStateMsg
18645
+ * @throws {Error} If the payload is not a reader or valid buffer
18646
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
18647
+ */
18648
+ UploadingStateMsg.decode = function decode(reader, length, error) {
18649
+ if (!(reader instanceof $Reader))
18650
+ reader = $Reader.create(reader);
18651
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.file.UploadingStateMsg();
18652
+ while (reader.pos < end) {
18653
+ var tag = reader.uint32();
18654
+ if (tag === error)
18655
+ break;
18656
+ switch (tag >>> 3) {
18657
+ case 1: {
18658
+ message.localVersion = $root.common.UInt64Value.decode(reader, reader.uint32());
18659
+ break;
18660
+ }
18661
+ case 2: {
18662
+ message.remoteVersion = $root.common.UInt64Value.decode(reader, reader.uint32());
18663
+ break;
18664
+ }
18665
+ case 3: {
18666
+ message.bytesLeftToUpload = $root.common.UInt64Value.decode(reader, reader.uint32());
18667
+ break;
18668
+ }
18669
+ case 4: {
18670
+ message.uploadStarted = reader.bool();
18671
+ break;
18672
+ }
18673
+ default:
18674
+ reader.skipType(tag & 7);
18675
+ break;
18676
+ }
18677
+ }
18678
+ return message;
18679
+ };
18680
+
18681
+ /**
18682
+ * Decodes an UploadingStateMsg message from the specified reader or buffer, length delimited.
18683
+ * @function decodeDelimited
18684
+ * @memberof file.UploadingStateMsg
18685
+ * @static
18686
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
18687
+ * @returns {file.UploadingStateMsg} UploadingStateMsg
18688
+ * @throws {Error} If the payload is not a reader or valid buffer
18689
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
18690
+ */
18691
+ UploadingStateMsg.decodeDelimited = function decodeDelimited(reader) {
18692
+ if (!(reader instanceof $Reader))
18693
+ reader = new $Reader(reader);
18694
+ return this.decode(reader, reader.uint32());
18695
+ };
18696
+
18697
+ /**
18698
+ * Verifies an UploadingStateMsg message.
18699
+ * @function verify
18700
+ * @memberof file.UploadingStateMsg
18701
+ * @static
18702
+ * @param {Object.<string,*>} message Plain object to verify
18703
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
18704
+ */
18705
+ UploadingStateMsg.verify = function verify(message) {
18706
+ if (typeof message !== "object" || message === null)
18707
+ return "object expected";
18708
+ if (message.localVersion != null && message.hasOwnProperty("localVersion")) {
18709
+ var error = $root.common.UInt64Value.verify(message.localVersion);
18710
+ if (error)
18711
+ return "localVersion." + error;
18712
+ }
18713
+ if (message.remoteVersion != null && message.hasOwnProperty("remoteVersion")) {
18714
+ var error = $root.common.UInt64Value.verify(message.remoteVersion);
18715
+ if (error)
18716
+ return "remoteVersion." + error;
18717
+ }
18718
+ if (message.bytesLeftToUpload != null && message.hasOwnProperty("bytesLeftToUpload")) {
18719
+ var error = $root.common.UInt64Value.verify(message.bytesLeftToUpload);
18720
+ if (error)
18721
+ return "bytesLeftToUpload." + error;
18722
+ }
18723
+ if (message.uploadStarted != null && message.hasOwnProperty("uploadStarted"))
18724
+ if (typeof message.uploadStarted !== "boolean")
18725
+ return "uploadStarted: boolean expected";
18726
+ return null;
18727
+ };
18728
+
18729
+ /**
18730
+ * Creates an UploadingStateMsg message from a plain object. Also converts values to their respective internal types.
18731
+ * @function fromObject
18732
+ * @memberof file.UploadingStateMsg
18733
+ * @static
18734
+ * @param {Object.<string,*>} object Plain object
18735
+ * @returns {file.UploadingStateMsg} UploadingStateMsg
18736
+ */
18737
+ UploadingStateMsg.fromObject = function fromObject(object) {
18738
+ if (object instanceof $root.file.UploadingStateMsg)
18739
+ return object;
18740
+ var message = new $root.file.UploadingStateMsg();
18741
+ if (object.localVersion != null) {
18742
+ if (typeof object.localVersion !== "object")
18743
+ throw TypeError(".file.UploadingStateMsg.localVersion: object expected");
18744
+ message.localVersion = $root.common.UInt64Value.fromObject(object.localVersion);
18745
+ }
18746
+ if (object.remoteVersion != null) {
18747
+ if (typeof object.remoteVersion !== "object")
18748
+ throw TypeError(".file.UploadingStateMsg.remoteVersion: object expected");
18749
+ message.remoteVersion = $root.common.UInt64Value.fromObject(object.remoteVersion);
18750
+ }
18751
+ if (object.bytesLeftToUpload != null) {
18752
+ if (typeof object.bytesLeftToUpload !== "object")
18753
+ throw TypeError(".file.UploadingStateMsg.bytesLeftToUpload: object expected");
18754
+ message.bytesLeftToUpload = $root.common.UInt64Value.fromObject(object.bytesLeftToUpload);
18755
+ }
18756
+ if (object.uploadStarted != null)
18757
+ message.uploadStarted = Boolean(object.uploadStarted);
18758
+ return message;
18759
+ };
18760
+
18761
+ /**
18762
+ * Creates a plain object from an UploadingStateMsg message. Also converts values to other types if specified.
18763
+ * @function toObject
18764
+ * @memberof file.UploadingStateMsg
18765
+ * @static
18766
+ * @param {file.UploadingStateMsg} message UploadingStateMsg
18767
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
18768
+ * @returns {Object.<string,*>} Plain object
18769
+ */
18770
+ UploadingStateMsg.toObject = function toObject(message, options) {
18771
+ if (!options)
18772
+ options = {};
18773
+ var object = {};
18774
+ if (options.defaults) {
18775
+ object.localVersion = null;
18776
+ object.remoteVersion = null;
18777
+ object.bytesLeftToUpload = null;
18778
+ object.uploadStarted = false;
18779
+ }
18780
+ if (message.localVersion != null && message.hasOwnProperty("localVersion"))
18781
+ object.localVersion = $root.common.UInt64Value.toObject(message.localVersion, options);
18782
+ if (message.remoteVersion != null && message.hasOwnProperty("remoteVersion"))
18783
+ object.remoteVersion = $root.common.UInt64Value.toObject(message.remoteVersion, options);
18784
+ if (message.bytesLeftToUpload != null && message.hasOwnProperty("bytesLeftToUpload"))
18785
+ object.bytesLeftToUpload = $root.common.UInt64Value.toObject(message.bytesLeftToUpload, options);
18786
+ if (message.uploadStarted != null && message.hasOwnProperty("uploadStarted"))
18787
+ object.uploadStarted = message.uploadStarted;
18788
+ return object;
18789
+ };
18790
+
18791
+ /**
18792
+ * Converts this UploadingStateMsg to JSON.
18793
+ * @function toJSON
18794
+ * @memberof file.UploadingStateMsg
18795
+ * @instance
18796
+ * @returns {Object.<string,*>} JSON object
18797
+ */
18798
+ UploadingStateMsg.prototype.toJSON = function toJSON() {
18799
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
18800
+ };
18801
+
18802
+ /**
18803
+ * Gets the default type url for UploadingStateMsg
18804
+ * @function getTypeUrl
18805
+ * @memberof file.UploadingStateMsg
18806
+ * @static
18807
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
18808
+ * @returns {string} The default type url
18809
+ */
18810
+ UploadingStateMsg.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
18811
+ if (typeUrlPrefix === undefined) {
18812
+ typeUrlPrefix = "type.googleapis.com";
18813
+ }
18814
+ return typeUrlPrefix + "/file.UploadingStateMsg";
18815
+ };
18816
+
18817
+ return UploadingStateMsg;
18818
+ })();
18819
+
18502
18820
  file.StatsMsg = (function() {
18503
18821
 
18504
18822
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "core-3nweb-client-lib",
3
- "version": "0.43.6",
3
+ "version": "0.43.7",
4
4
  "description": "3NWeb client core library, embeddable into different environments",
5
5
  "main": "build/lib-index.js",
6
6
  "types": "build/lib-index.d.ts",
package/protos/file.proto CHANGED
@@ -23,6 +23,7 @@ message SyncStatusMsg {
23
23
  SyncVersionsBranchMsg synced = 3;
24
24
  SyncVersionsBranchMsg remote = 4;
25
25
  common.BooleanValue exists_in_synced_parent = 5;
26
+ UploadingStateMsg uploading = 6;
26
27
  }
27
28
 
28
29
  message SyncVersionsBranchMsg {
@@ -31,6 +32,12 @@ message SyncVersionsBranchMsg {
31
32
  common.BooleanValue is_archived = 3;
32
33
  }
33
34
 
35
+ message UploadingStateMsg {
36
+ common.UInt64Value local_version = 1;
37
+ common.UInt64Value remote_version = 2;
38
+ common.UInt64Value bytes_left_to_upload = 3;
39
+ bool upload_started = 4;
40
+ }
34
41
 
35
42
  // ==== ReadonlyFile referable as impl object ====
36
43