core-3nweb-client-lib 0.43.6 → 0.43.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/api-defs/files.d.ts +33 -0
- package/build/core/storage/synced/obj-status.d.ts +21 -0
- package/build/core/storage/synced/obj-status.js +45 -2
- package/build/core/storage/synced/upsyncer.js +1 -2
- package/build/core-ipc/file.d.ts +4 -0
- package/build/core-ipc/file.js +52 -8
- package/build/core-ipc/fs.js +22 -0
- package/build/lib-client/fs-utils/files.js +4 -0
- package/build/lib-client/xsp-fs/file-node.d.ts +3 -2
- package/build/lib-client/xsp-fs/file-node.js +30 -11
- package/build/lib-client/xsp-fs/file.d.ts +1 -0
- package/build/lib-client/xsp-fs/file.js +8 -12
- package/build/lib-client/xsp-fs/folder-node.d.ts +2 -0
- package/build/lib-client/xsp-fs/folder-node.js +21 -1
- package/build/lib-client/xsp-fs/fs.d.ts +1 -0
- package/build/lib-client/xsp-fs/fs.js +8 -25
- package/build/lib-client/xsp-fs/link-node.d.ts +3 -0
- package/build/lib-client/xsp-fs/link-node.js +20 -0
- package/build/lib-client/xsp-fs/node-in-fs.d.ts +2 -1
- package/build/lib-client/xsp-fs/node-in-fs.js +0 -3
- package/build/lib-client/xsp-fs/node-persistence.d.ts +1 -0
- package/build/lib-client/xsp-fs/node-persistence.js +4 -0
- package/build/lib-common/big-endian.js +2 -2
- package/build/protos/asmail.proto.js +345 -0
- package/build/protos/file.proto.js +345 -0
- package/build/protos/fs.proto.js +345 -0
- package/package.json +1 -1
- package/protos/file.proto +11 -0
- package/protos/fs.proto +5 -1
|
@@ -103,6 +103,26 @@ class LinkNode extends node_in_fs_1.NodeInFS {
|
|
|
103
103
|
const { params, attrs, xattrs } = await this.crypto.read(src);
|
|
104
104
|
this.setUpdatedState(params, src.version, attrs, xattrs);
|
|
105
105
|
}
|
|
106
|
+
async getStats(flags) {
|
|
107
|
+
let attrs;
|
|
108
|
+
let version;
|
|
109
|
+
if ((0, node_in_fs_1.shouldReadCurrentVersion)(flags)) {
|
|
110
|
+
attrs = this.attrs;
|
|
111
|
+
version = this.version;
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
const src = await this.getObjSrcOfVersion(flags);
|
|
115
|
+
attrs = await this.crypto.getAttrs(src);
|
|
116
|
+
version = src.version;
|
|
117
|
+
}
|
|
118
|
+
return {
|
|
119
|
+
ctime: new Date(attrs.ctime),
|
|
120
|
+
mtime: new Date(attrs.mtime),
|
|
121
|
+
version,
|
|
122
|
+
writable: false,
|
|
123
|
+
isLink: true,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
106
126
|
setUpdatedState(params, version, attrs, xattrs) {
|
|
107
127
|
this.linkParams = params;
|
|
108
128
|
super.setUpdatedParams(version, attrs, xattrs);
|
|
@@ -10,6 +10,7 @@ type SyncStatus = web3n.files.SyncStatus;
|
|
|
10
10
|
type OptionsToAdopteRemote = web3n.files.OptionsToAdopteRemote;
|
|
11
11
|
type OptionsToUploadLocal = web3n.files.OptionsToUploadLocal;
|
|
12
12
|
type VersionedReadFlags = web3n.files.VersionedReadFlags;
|
|
13
|
+
type Stats = web3n.files.Stats;
|
|
13
14
|
export declare abstract class NodeInFS<P extends NodePersistance> implements Node {
|
|
14
15
|
protected readonly storage: Storage;
|
|
15
16
|
readonly type: NodeType;
|
|
@@ -44,7 +45,7 @@ export declare abstract class NodeInFS<P extends NodePersistance> implements Nod
|
|
|
44
45
|
lst: string[];
|
|
45
46
|
version: number;
|
|
46
47
|
}>;
|
|
47
|
-
|
|
48
|
+
abstract getStats(flags?: VersionedReadFlags): Promise<Stats>;
|
|
48
49
|
listVersions(): Promise<{
|
|
49
50
|
current?: number;
|
|
50
51
|
archived?: number[];
|
|
@@ -34,6 +34,7 @@ export declare abstract class NodePersistance {
|
|
|
34
34
|
sub: Subscribe;
|
|
35
35
|
}>;
|
|
36
36
|
reencryptHeader(initHeader: Uint8Array, newVersion: number): Promise<Uint8Array>;
|
|
37
|
+
getAttrs(objSrc: ObjSource): Promise<Attrs>;
|
|
37
38
|
}
|
|
38
39
|
type FileByteSource = web3n.files.FileByteSource;
|
|
39
40
|
type FileByteSink = web3n.files.FileByteSink;
|
|
@@ -175,6 +175,10 @@ class NodePersistance {
|
|
|
175
175
|
const n = (0, xsp_files_1.calculateNonce)(this.zerothHeaderNonce, newVersion);
|
|
176
176
|
return this.cryptor.formatWN.pack(headerContent, n, this.key, this.workLabel);
|
|
177
177
|
}
|
|
178
|
+
async getAttrs(objSrc) {
|
|
179
|
+
const payload = await this.readonlyPayload(objSrc);
|
|
180
|
+
return payload.getAttrs();
|
|
181
|
+
}
|
|
178
182
|
}
|
|
179
183
|
exports.NodePersistance = NodePersistance;
|
|
180
184
|
Object.freeze(NodePersistance.prototype);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
Copyright (C) 2020 3NSoft Inc.
|
|
3
|
+
Copyright (C) 2020, 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
|
|
@@ -144,7 +144,7 @@ function uintFrom6Bytes(x, i = 0) {
|
|
|
144
144
|
// treating intermediate integer as signed, and pulling sign to resulting
|
|
145
145
|
// float number. Hence, we need a bit different operation here.
|
|
146
146
|
const h = (x[i] << 8) | x[i + 1];
|
|
147
|
-
const l = (x[i] * 0x1000000) + ((x[i + 3] << 16) | (x[i + 4] << 8) | x[i + 5]);
|
|
147
|
+
const l = (x[i + 2] * 0x1000000) + ((x[i + 3] << 16) | (x[i + 4] << 8) | x[i + 5]);
|
|
148
148
|
return (h * 0x100000000 + l);
|
|
149
149
|
}
|
|
150
150
|
/**
|
|
@@ -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,323 @@ $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 {number|Long|null} [localVersion] UploadingStateMsg localVersion
|
|
8846
|
+
* @property {number|Long|null} [remoteVersion] UploadingStateMsg remoteVersion
|
|
8847
|
+
* @property {number|Long|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 {number|Long} localVersion
|
|
8869
|
+
* @memberof file.UploadingStateMsg
|
|
8870
|
+
* @instance
|
|
8871
|
+
*/
|
|
8872
|
+
UploadingStateMsg.prototype.localVersion = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
|
8873
|
+
|
|
8874
|
+
/**
|
|
8875
|
+
* UploadingStateMsg remoteVersion.
|
|
8876
|
+
* @member {number|Long} remoteVersion
|
|
8877
|
+
* @memberof file.UploadingStateMsg
|
|
8878
|
+
* @instance
|
|
8879
|
+
*/
|
|
8880
|
+
UploadingStateMsg.prototype.remoteVersion = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
|
8881
|
+
|
|
8882
|
+
/**
|
|
8883
|
+
* UploadingStateMsg bytesLeftToUpload.
|
|
8884
|
+
* @member {number|Long} bytesLeftToUpload
|
|
8885
|
+
* @memberof file.UploadingStateMsg
|
|
8886
|
+
* @instance
|
|
8887
|
+
*/
|
|
8888
|
+
UploadingStateMsg.prototype.bytesLeftToUpload = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
|
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
|
+
writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.localVersion);
|
|
8924
|
+
if (message.remoteVersion != null && Object.hasOwnProperty.call(message, "remoteVersion"))
|
|
8925
|
+
writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.remoteVersion);
|
|
8926
|
+
if (message.bytesLeftToUpload != null && Object.hasOwnProperty.call(message, "bytesLeftToUpload"))
|
|
8927
|
+
writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.bytesLeftToUpload);
|
|
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 = reader.uint64();
|
|
8968
|
+
break;
|
|
8969
|
+
}
|
|
8970
|
+
case 2: {
|
|
8971
|
+
message.remoteVersion = reader.uint64();
|
|
8972
|
+
break;
|
|
8973
|
+
}
|
|
8974
|
+
case 3: {
|
|
8975
|
+
message.bytesLeftToUpload = reader.uint64();
|
|
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
|
+
if (!$util.isInteger(message.localVersion) && !(message.localVersion && $util.isInteger(message.localVersion.low) && $util.isInteger(message.localVersion.high)))
|
|
9019
|
+
return "localVersion: integer|Long expected";
|
|
9020
|
+
if (message.remoteVersion != null && message.hasOwnProperty("remoteVersion"))
|
|
9021
|
+
if (!$util.isInteger(message.remoteVersion) && !(message.remoteVersion && $util.isInteger(message.remoteVersion.low) && $util.isInteger(message.remoteVersion.high)))
|
|
9022
|
+
return "remoteVersion: integer|Long expected";
|
|
9023
|
+
if (message.bytesLeftToUpload != null && message.hasOwnProperty("bytesLeftToUpload"))
|
|
9024
|
+
if (!$util.isInteger(message.bytesLeftToUpload) && !(message.bytesLeftToUpload && $util.isInteger(message.bytesLeftToUpload.low) && $util.isInteger(message.bytesLeftToUpload.high)))
|
|
9025
|
+
return "bytesLeftToUpload: integer|Long expected";
|
|
9026
|
+
if (message.uploadStarted != null && message.hasOwnProperty("uploadStarted"))
|
|
9027
|
+
if (typeof message.uploadStarted !== "boolean")
|
|
9028
|
+
return "uploadStarted: boolean expected";
|
|
9029
|
+
return null;
|
|
9030
|
+
};
|
|
9031
|
+
|
|
9032
|
+
/**
|
|
9033
|
+
* Creates an UploadingStateMsg message from a plain object. Also converts values to their respective internal types.
|
|
9034
|
+
* @function fromObject
|
|
9035
|
+
* @memberof file.UploadingStateMsg
|
|
9036
|
+
* @static
|
|
9037
|
+
* @param {Object.<string,*>} object Plain object
|
|
9038
|
+
* @returns {file.UploadingStateMsg} UploadingStateMsg
|
|
9039
|
+
*/
|
|
9040
|
+
UploadingStateMsg.fromObject = function fromObject(object) {
|
|
9041
|
+
if (object instanceof $root.file.UploadingStateMsg)
|
|
9042
|
+
return object;
|
|
9043
|
+
var message = new $root.file.UploadingStateMsg();
|
|
9044
|
+
if (object.localVersion != null)
|
|
9045
|
+
if ($util.Long)
|
|
9046
|
+
(message.localVersion = $util.Long.fromValue(object.localVersion)).unsigned = true;
|
|
9047
|
+
else if (typeof object.localVersion === "string")
|
|
9048
|
+
message.localVersion = parseInt(object.localVersion, 10);
|
|
9049
|
+
else if (typeof object.localVersion === "number")
|
|
9050
|
+
message.localVersion = object.localVersion;
|
|
9051
|
+
else if (typeof object.localVersion === "object")
|
|
9052
|
+
message.localVersion = new $util.LongBits(object.localVersion.low >>> 0, object.localVersion.high >>> 0).toNumber(true);
|
|
9053
|
+
if (object.remoteVersion != null)
|
|
9054
|
+
if ($util.Long)
|
|
9055
|
+
(message.remoteVersion = $util.Long.fromValue(object.remoteVersion)).unsigned = true;
|
|
9056
|
+
else if (typeof object.remoteVersion === "string")
|
|
9057
|
+
message.remoteVersion = parseInt(object.remoteVersion, 10);
|
|
9058
|
+
else if (typeof object.remoteVersion === "number")
|
|
9059
|
+
message.remoteVersion = object.remoteVersion;
|
|
9060
|
+
else if (typeof object.remoteVersion === "object")
|
|
9061
|
+
message.remoteVersion = new $util.LongBits(object.remoteVersion.low >>> 0, object.remoteVersion.high >>> 0).toNumber(true);
|
|
9062
|
+
if (object.bytesLeftToUpload != null)
|
|
9063
|
+
if ($util.Long)
|
|
9064
|
+
(message.bytesLeftToUpload = $util.Long.fromValue(object.bytesLeftToUpload)).unsigned = true;
|
|
9065
|
+
else if (typeof object.bytesLeftToUpload === "string")
|
|
9066
|
+
message.bytesLeftToUpload = parseInt(object.bytesLeftToUpload, 10);
|
|
9067
|
+
else if (typeof object.bytesLeftToUpload === "number")
|
|
9068
|
+
message.bytesLeftToUpload = object.bytesLeftToUpload;
|
|
9069
|
+
else if (typeof object.bytesLeftToUpload === "object")
|
|
9070
|
+
message.bytesLeftToUpload = new $util.LongBits(object.bytesLeftToUpload.low >>> 0, object.bytesLeftToUpload.high >>> 0).toNumber(true);
|
|
9071
|
+
if (object.uploadStarted != null)
|
|
9072
|
+
message.uploadStarted = Boolean(object.uploadStarted);
|
|
9073
|
+
return message;
|
|
9074
|
+
};
|
|
9075
|
+
|
|
9076
|
+
/**
|
|
9077
|
+
* Creates a plain object from an UploadingStateMsg message. Also converts values to other types if specified.
|
|
9078
|
+
* @function toObject
|
|
9079
|
+
* @memberof file.UploadingStateMsg
|
|
9080
|
+
* @static
|
|
9081
|
+
* @param {file.UploadingStateMsg} message UploadingStateMsg
|
|
9082
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
9083
|
+
* @returns {Object.<string,*>} Plain object
|
|
9084
|
+
*/
|
|
9085
|
+
UploadingStateMsg.toObject = function toObject(message, options) {
|
|
9086
|
+
if (!options)
|
|
9087
|
+
options = {};
|
|
9088
|
+
var object = {};
|
|
9089
|
+
if (options.defaults) {
|
|
9090
|
+
if ($util.Long) {
|
|
9091
|
+
var long = new $util.Long(0, 0, true);
|
|
9092
|
+
object.localVersion = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
9093
|
+
} else
|
|
9094
|
+
object.localVersion = options.longs === String ? "0" : 0;
|
|
9095
|
+
if ($util.Long) {
|
|
9096
|
+
var long = new $util.Long(0, 0, true);
|
|
9097
|
+
object.remoteVersion = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
9098
|
+
} else
|
|
9099
|
+
object.remoteVersion = options.longs === String ? "0" : 0;
|
|
9100
|
+
if ($util.Long) {
|
|
9101
|
+
var long = new $util.Long(0, 0, true);
|
|
9102
|
+
object.bytesLeftToUpload = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
9103
|
+
} else
|
|
9104
|
+
object.bytesLeftToUpload = options.longs === String ? "0" : 0;
|
|
9105
|
+
object.uploadStarted = false;
|
|
9106
|
+
}
|
|
9107
|
+
if (message.localVersion != null && message.hasOwnProperty("localVersion"))
|
|
9108
|
+
if (typeof message.localVersion === "number")
|
|
9109
|
+
object.localVersion = options.longs === String ? String(message.localVersion) : message.localVersion;
|
|
9110
|
+
else
|
|
9111
|
+
object.localVersion = options.longs === String ? $util.Long.prototype.toString.call(message.localVersion) : options.longs === Number ? new $util.LongBits(message.localVersion.low >>> 0, message.localVersion.high >>> 0).toNumber(true) : message.localVersion;
|
|
9112
|
+
if (message.remoteVersion != null && message.hasOwnProperty("remoteVersion"))
|
|
9113
|
+
if (typeof message.remoteVersion === "number")
|
|
9114
|
+
object.remoteVersion = options.longs === String ? String(message.remoteVersion) : message.remoteVersion;
|
|
9115
|
+
else
|
|
9116
|
+
object.remoteVersion = options.longs === String ? $util.Long.prototype.toString.call(message.remoteVersion) : options.longs === Number ? new $util.LongBits(message.remoteVersion.low >>> 0, message.remoteVersion.high >>> 0).toNumber(true) : message.remoteVersion;
|
|
9117
|
+
if (message.bytesLeftToUpload != null && message.hasOwnProperty("bytesLeftToUpload"))
|
|
9118
|
+
if (typeof message.bytesLeftToUpload === "number")
|
|
9119
|
+
object.bytesLeftToUpload = options.longs === String ? String(message.bytesLeftToUpload) : message.bytesLeftToUpload;
|
|
9120
|
+
else
|
|
9121
|
+
object.bytesLeftToUpload = options.longs === String ? $util.Long.prototype.toString.call(message.bytesLeftToUpload) : options.longs === Number ? new $util.LongBits(message.bytesLeftToUpload.low >>> 0, message.bytesLeftToUpload.high >>> 0).toNumber(true) : message.bytesLeftToUpload;
|
|
9122
|
+
if (message.uploadStarted != null && message.hasOwnProperty("uploadStarted"))
|
|
9123
|
+
object.uploadStarted = message.uploadStarted;
|
|
9124
|
+
return object;
|
|
9125
|
+
};
|
|
9126
|
+
|
|
9127
|
+
/**
|
|
9128
|
+
* Converts this UploadingStateMsg to JSON.
|
|
9129
|
+
* @function toJSON
|
|
9130
|
+
* @memberof file.UploadingStateMsg
|
|
9131
|
+
* @instance
|
|
9132
|
+
* @returns {Object.<string,*>} JSON object
|
|
9133
|
+
*/
|
|
9134
|
+
UploadingStateMsg.prototype.toJSON = function toJSON() {
|
|
9135
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
9136
|
+
};
|
|
9137
|
+
|
|
9138
|
+
/**
|
|
9139
|
+
* Gets the default type url for UploadingStateMsg
|
|
9140
|
+
* @function getTypeUrl
|
|
9141
|
+
* @memberof file.UploadingStateMsg
|
|
9142
|
+
* @static
|
|
9143
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
9144
|
+
* @returns {string} The default type url
|
|
9145
|
+
*/
|
|
9146
|
+
UploadingStateMsg.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
9147
|
+
if (typeUrlPrefix === undefined) {
|
|
9148
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
9149
|
+
}
|
|
9150
|
+
return typeUrlPrefix + "/file.UploadingStateMsg";
|
|
9151
|
+
};
|
|
9152
|
+
|
|
9153
|
+
return UploadingStateMsg;
|
|
9154
|
+
})();
|
|
9155
|
+
|
|
8811
9156
|
file.StatsMsg = (function() {
|
|
8812
9157
|
|
|
8813
9158
|
/**
|