Various library/platform index update fixes

- IDE2 can start if the package index download fails. Closes #1084
 - Split the lib and platform index update. Closes #1156

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
This commit is contained in:
Akos Kitta
2022-09-09 18:49:28 +02:00
committed by Akos Kitta
parent 945a8f4841
commit 0c20ae0e28
18 changed files with 1412 additions and 340 deletions

View File

@@ -220,6 +220,9 @@ export class UpdateIndexRequest extends jspb.Message {
getInstance(): cc_arduino_cli_commands_v1_common_pb.Instance | undefined;
setInstance(value?: cc_arduino_cli_commands_v1_common_pb.Instance): UpdateIndexRequest;
getIgnoreCustomPackageIndexes(): boolean;
setIgnoreCustomPackageIndexes(value: boolean): UpdateIndexRequest;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): UpdateIndexRequest.AsObject;
@@ -234,6 +237,7 @@ export class UpdateIndexRequest extends jspb.Message {
export namespace UpdateIndexRequest {
export type AsObject = {
instance?: cc_arduino_cli_commands_v1_common_pb.Instance.AsObject,
ignoreCustomPackageIndexes: boolean,
}
}

View File

@@ -1811,7 +1811,8 @@ proto.cc.arduino.cli.commands.v1.UpdateIndexRequest.prototype.toObject = functio
*/
proto.cc.arduino.cli.commands.v1.UpdateIndexRequest.toObject = function(includeInstance, msg) {
var f, obj = {
instance: (f = msg.getInstance()) && cc_arduino_cli_commands_v1_common_pb.Instance.toObject(includeInstance, f)
instance: (f = msg.getInstance()) && cc_arduino_cli_commands_v1_common_pb.Instance.toObject(includeInstance, f),
ignoreCustomPackageIndexes: jspb.Message.getBooleanFieldWithDefault(msg, 2, false)
};
if (includeInstance) {
@@ -1853,6 +1854,10 @@ proto.cc.arduino.cli.commands.v1.UpdateIndexRequest.deserializeBinaryFromReader
reader.readMessage(value,cc_arduino_cli_commands_v1_common_pb.Instance.deserializeBinaryFromReader);
msg.setInstance(value);
break;
case 2:
var value = /** @type {boolean} */ (reader.readBool());
msg.setIgnoreCustomPackageIndexes(value);
break;
default:
reader.skipField();
break;
@@ -1890,6 +1895,13 @@ proto.cc.arduino.cli.commands.v1.UpdateIndexRequest.serializeBinaryToWriter = fu
cc_arduino_cli_commands_v1_common_pb.Instance.serializeBinaryToWriter
);
}
f = message.getIgnoreCustomPackageIndexes();
if (f) {
writer.writeBool(
2,
f
);
}
};
@@ -1930,6 +1942,24 @@ proto.cc.arduino.cli.commands.v1.UpdateIndexRequest.prototype.hasInstance = func
};
/**
* optional bool ignore_custom_package_indexes = 2;
* @return {boolean}
*/
proto.cc.arduino.cli.commands.v1.UpdateIndexRequest.prototype.getIgnoreCustomPackageIndexes = function() {
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false));
};
/**
* @param {boolean} value
* @return {!proto.cc.arduino.cli.commands.v1.UpdateIndexRequest} returns this
*/
proto.cc.arduino.cli.commands.v1.UpdateIndexRequest.prototype.setIgnoreCustomPackageIndexes = function(value) {
return jspb.Message.setProto3BooleanField(this, 2, value);
};

View File

@@ -28,21 +28,26 @@ export namespace Instance {
}
export class DownloadProgress extends jspb.Message {
getUrl(): string;
setUrl(value: string): DownloadProgress;
getFile(): string;
setFile(value: string): DownloadProgress;
hasStart(): boolean;
clearStart(): void;
getStart(): DownloadProgressStart | undefined;
setStart(value?: DownloadProgressStart): DownloadProgress;
getTotalSize(): number;
setTotalSize(value: number): DownloadProgress;
getDownloaded(): number;
setDownloaded(value: number): DownloadProgress;
hasUpdate(): boolean;
clearUpdate(): void;
getUpdate(): DownloadProgressUpdate | undefined;
setUpdate(value?: DownloadProgressUpdate): DownloadProgress;
getCompleted(): boolean;
setCompleted(value: boolean): DownloadProgress;
hasEnd(): boolean;
clearEnd(): void;
getEnd(): DownloadProgressEnd | undefined;
setEnd(value?: DownloadProgressEnd): DownloadProgress;
getMessageCase(): DownloadProgress.MessageCase;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): DownloadProgress.AsObject;
@@ -55,12 +60,97 @@ export class DownloadProgress extends jspb.Message {
}
export namespace DownloadProgress {
export type AsObject = {
start?: DownloadProgressStart.AsObject,
update?: DownloadProgressUpdate.AsObject,
end?: DownloadProgressEnd.AsObject,
}
export enum MessageCase {
MESSAGE_NOT_SET = 0,
START = 1,
UPDATE = 2,
END = 3,
}
}
export class DownloadProgressStart extends jspb.Message {
getUrl(): string;
setUrl(value: string): DownloadProgressStart;
getLabel(): string;
setLabel(value: string): DownloadProgressStart;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): DownloadProgressStart.AsObject;
static toObject(includeInstance: boolean, msg: DownloadProgressStart): DownloadProgressStart.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: DownloadProgressStart, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): DownloadProgressStart;
static deserializeBinaryFromReader(message: DownloadProgressStart, reader: jspb.BinaryReader): DownloadProgressStart;
}
export namespace DownloadProgressStart {
export type AsObject = {
url: string,
file: string,
totalSize: number,
label: string,
}
}
export class DownloadProgressUpdate extends jspb.Message {
getDownloaded(): number;
setDownloaded(value: number): DownloadProgressUpdate;
getTotalSize(): number;
setTotalSize(value: number): DownloadProgressUpdate;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): DownloadProgressUpdate.AsObject;
static toObject(includeInstance: boolean, msg: DownloadProgressUpdate): DownloadProgressUpdate.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: DownloadProgressUpdate, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): DownloadProgressUpdate;
static deserializeBinaryFromReader(message: DownloadProgressUpdate, reader: jspb.BinaryReader): DownloadProgressUpdate;
}
export namespace DownloadProgressUpdate {
export type AsObject = {
downloaded: number,
completed: boolean,
totalSize: number,
}
}
export class DownloadProgressEnd extends jspb.Message {
getSuccess(): boolean;
setSuccess(value: boolean): DownloadProgressEnd;
getMessage(): string;
setMessage(value: string): DownloadProgressEnd;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): DownloadProgressEnd.AsObject;
static toObject(includeInstance: boolean, msg: DownloadProgressEnd): DownloadProgressEnd.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: DownloadProgressEnd, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): DownloadProgressEnd;
static deserializeBinaryFromReader(message: DownloadProgressEnd, reader: jspb.BinaryReader): DownloadProgressEnd;
}
export namespace DownloadProgressEnd {
export type AsObject = {
success: boolean,
message: string,
}
}

View File

@@ -17,6 +17,10 @@ var global = Function('return this')();
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.Board', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.DownloadProgress', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.DownloadProgress.MessageCase', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.DownloadProgressEnd', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.DownloadProgressStart', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.DownloadProgressUpdate', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.InstalledPlatformReference', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.Instance', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.Platform', null, global);
@@ -55,7 +59,7 @@ if (goog.DEBUG && !COMPILED) {
* @constructor
*/
proto.cc.arduino.cli.commands.v1.DownloadProgress = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
jspb.Message.initialize(this, opt_data, 0, -1, null, proto.cc.arduino.cli.commands.v1.DownloadProgress.oneofGroups_);
};
goog.inherits(proto.cc.arduino.cli.commands.v1.DownloadProgress, jspb.Message);
if (goog.DEBUG && !COMPILED) {
@@ -65,6 +69,69 @@ if (goog.DEBUG && !COMPILED) {
*/
proto.cc.arduino.cli.commands.v1.DownloadProgress.displayName = 'proto.cc.arduino.cli.commands.v1.DownloadProgress';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.cc.arduino.cli.commands.v1.DownloadProgressStart = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.cc.arduino.cli.commands.v1.DownloadProgressStart, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.cc.arduino.cli.commands.v1.DownloadProgressStart.displayName = 'proto.cc.arduino.cli.commands.v1.DownloadProgressStart';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.cc.arduino.cli.commands.v1.DownloadProgressUpdate = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.cc.arduino.cli.commands.v1.DownloadProgressUpdate, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.cc.arduino.cli.commands.v1.DownloadProgressUpdate.displayName = 'proto.cc.arduino.cli.commands.v1.DownloadProgressUpdate';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.cc.arduino.cli.commands.v1.DownloadProgressEnd = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.cc.arduino.cli.commands.v1.DownloadProgressEnd, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.cc.arduino.cli.commands.v1.DownloadProgressEnd.displayName = 'proto.cc.arduino.cli.commands.v1.DownloadProgressEnd';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
@@ -322,6 +389,33 @@ proto.cc.arduino.cli.commands.v1.Instance.prototype.setId = function(value) {
/**
* Oneof group definitions for this message. Each group defines the field
* numbers belonging to that group. When of these fields' value is set, all
* other fields in the group are cleared. During deserialization, if multiple
* fields are encountered for a group, only the last value seen will be kept.
* @private {!Array<!Array<number>>}
* @const
*/
proto.cc.arduino.cli.commands.v1.DownloadProgress.oneofGroups_ = [[1,2,3]];
/**
* @enum {number}
*/
proto.cc.arduino.cli.commands.v1.DownloadProgress.MessageCase = {
MESSAGE_NOT_SET: 0,
START: 1,
UPDATE: 2,
END: 3
};
/**
* @return {proto.cc.arduino.cli.commands.v1.DownloadProgress.MessageCase}
*/
proto.cc.arduino.cli.commands.v1.DownloadProgress.prototype.getMessageCase = function() {
return /** @type {proto.cc.arduino.cli.commands.v1.DownloadProgress.MessageCase} */(jspb.Message.computeOneofCase(this, proto.cc.arduino.cli.commands.v1.DownloadProgress.oneofGroups_[0]));
};
if (jspb.Message.GENERATE_TO_OBJECT) {
@@ -353,11 +447,9 @@ proto.cc.arduino.cli.commands.v1.DownloadProgress.prototype.toObject = function(
*/
proto.cc.arduino.cli.commands.v1.DownloadProgress.toObject = function(includeInstance, msg) {
var f, obj = {
url: jspb.Message.getFieldWithDefault(msg, 1, ""),
file: jspb.Message.getFieldWithDefault(msg, 2, ""),
totalSize: jspb.Message.getFieldWithDefault(msg, 3, 0),
downloaded: jspb.Message.getFieldWithDefault(msg, 4, 0),
completed: jspb.Message.getBooleanFieldWithDefault(msg, 5, false)
start: (f = msg.getStart()) && proto.cc.arduino.cli.commands.v1.DownloadProgressStart.toObject(includeInstance, f),
update: (f = msg.getUpdate()) && proto.cc.arduino.cli.commands.v1.DownloadProgressUpdate.toObject(includeInstance, f),
end: (f = msg.getEnd()) && proto.cc.arduino.cli.commands.v1.DownloadProgressEnd.toObject(includeInstance, f)
};
if (includeInstance) {
@@ -395,24 +487,19 @@ proto.cc.arduino.cli.commands.v1.DownloadProgress.deserializeBinaryFromReader =
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {string} */ (reader.readString());
msg.setUrl(value);
var value = new proto.cc.arduino.cli.commands.v1.DownloadProgressStart;
reader.readMessage(value,proto.cc.arduino.cli.commands.v1.DownloadProgressStart.deserializeBinaryFromReader);
msg.setStart(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setFile(value);
var value = new proto.cc.arduino.cli.commands.v1.DownloadProgressUpdate;
reader.readMessage(value,proto.cc.arduino.cli.commands.v1.DownloadProgressUpdate.deserializeBinaryFromReader);
msg.setUpdate(value);
break;
case 3:
var value = /** @type {number} */ (reader.readInt64());
msg.setTotalSize(value);
break;
case 4:
var value = /** @type {number} */ (reader.readInt64());
msg.setDownloaded(value);
break;
case 5:
var value = /** @type {boolean} */ (reader.readBool());
msg.setCompleted(value);
var value = new proto.cc.arduino.cli.commands.v1.DownloadProgressEnd;
reader.readMessage(value,proto.cc.arduino.cli.commands.v1.DownloadProgressEnd.deserializeBinaryFromReader);
msg.setEnd(value);
break;
default:
reader.skipField();
@@ -442,6 +529,251 @@ proto.cc.arduino.cli.commands.v1.DownloadProgress.prototype.serializeBinary = fu
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cc.arduino.cli.commands.v1.DownloadProgress.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getStart();
if (f != null) {
writer.writeMessage(
1,
f,
proto.cc.arduino.cli.commands.v1.DownloadProgressStart.serializeBinaryToWriter
);
}
f = message.getUpdate();
if (f != null) {
writer.writeMessage(
2,
f,
proto.cc.arduino.cli.commands.v1.DownloadProgressUpdate.serializeBinaryToWriter
);
}
f = message.getEnd();
if (f != null) {
writer.writeMessage(
3,
f,
proto.cc.arduino.cli.commands.v1.DownloadProgressEnd.serializeBinaryToWriter
);
}
};
/**
* optional DownloadProgressStart start = 1;
* @return {?proto.cc.arduino.cli.commands.v1.DownloadProgressStart}
*/
proto.cc.arduino.cli.commands.v1.DownloadProgress.prototype.getStart = function() {
return /** @type{?proto.cc.arduino.cli.commands.v1.DownloadProgressStart} */ (
jspb.Message.getWrapperField(this, proto.cc.arduino.cli.commands.v1.DownloadProgressStart, 1));
};
/**
* @param {?proto.cc.arduino.cli.commands.v1.DownloadProgressStart|undefined} value
* @return {!proto.cc.arduino.cli.commands.v1.DownloadProgress} returns this
*/
proto.cc.arduino.cli.commands.v1.DownloadProgress.prototype.setStart = function(value) {
return jspb.Message.setOneofWrapperField(this, 1, proto.cc.arduino.cli.commands.v1.DownloadProgress.oneofGroups_[0], value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.cc.arduino.cli.commands.v1.DownloadProgress} returns this
*/
proto.cc.arduino.cli.commands.v1.DownloadProgress.prototype.clearStart = function() {
return this.setStart(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.cc.arduino.cli.commands.v1.DownloadProgress.prototype.hasStart = function() {
return jspb.Message.getField(this, 1) != null;
};
/**
* optional DownloadProgressUpdate update = 2;
* @return {?proto.cc.arduino.cli.commands.v1.DownloadProgressUpdate}
*/
proto.cc.arduino.cli.commands.v1.DownloadProgress.prototype.getUpdate = function() {
return /** @type{?proto.cc.arduino.cli.commands.v1.DownloadProgressUpdate} */ (
jspb.Message.getWrapperField(this, proto.cc.arduino.cli.commands.v1.DownloadProgressUpdate, 2));
};
/**
* @param {?proto.cc.arduino.cli.commands.v1.DownloadProgressUpdate|undefined} value
* @return {!proto.cc.arduino.cli.commands.v1.DownloadProgress} returns this
*/
proto.cc.arduino.cli.commands.v1.DownloadProgress.prototype.setUpdate = function(value) {
return jspb.Message.setOneofWrapperField(this, 2, proto.cc.arduino.cli.commands.v1.DownloadProgress.oneofGroups_[0], value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.cc.arduino.cli.commands.v1.DownloadProgress} returns this
*/
proto.cc.arduino.cli.commands.v1.DownloadProgress.prototype.clearUpdate = function() {
return this.setUpdate(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.cc.arduino.cli.commands.v1.DownloadProgress.prototype.hasUpdate = function() {
return jspb.Message.getField(this, 2) != null;
};
/**
* optional DownloadProgressEnd end = 3;
* @return {?proto.cc.arduino.cli.commands.v1.DownloadProgressEnd}
*/
proto.cc.arduino.cli.commands.v1.DownloadProgress.prototype.getEnd = function() {
return /** @type{?proto.cc.arduino.cli.commands.v1.DownloadProgressEnd} */ (
jspb.Message.getWrapperField(this, proto.cc.arduino.cli.commands.v1.DownloadProgressEnd, 3));
};
/**
* @param {?proto.cc.arduino.cli.commands.v1.DownloadProgressEnd|undefined} value
* @return {!proto.cc.arduino.cli.commands.v1.DownloadProgress} returns this
*/
proto.cc.arduino.cli.commands.v1.DownloadProgress.prototype.setEnd = function(value) {
return jspb.Message.setOneofWrapperField(this, 3, proto.cc.arduino.cli.commands.v1.DownloadProgress.oneofGroups_[0], value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.cc.arduino.cli.commands.v1.DownloadProgress} returns this
*/
proto.cc.arduino.cli.commands.v1.DownloadProgress.prototype.clearEnd = function() {
return this.setEnd(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.cc.arduino.cli.commands.v1.DownloadProgress.prototype.hasEnd = function() {
return jspb.Message.getField(this, 3) != null;
};
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.cc.arduino.cli.commands.v1.DownloadProgressStart.prototype.toObject = function(opt_includeInstance) {
return proto.cc.arduino.cli.commands.v1.DownloadProgressStart.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.cc.arduino.cli.commands.v1.DownloadProgressStart} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cc.arduino.cli.commands.v1.DownloadProgressStart.toObject = function(includeInstance, msg) {
var f, obj = {
url: jspb.Message.getFieldWithDefault(msg, 1, ""),
label: jspb.Message.getFieldWithDefault(msg, 2, "")
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.cc.arduino.cli.commands.v1.DownloadProgressStart}
*/
proto.cc.arduino.cli.commands.v1.DownloadProgressStart.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.cc.arduino.cli.commands.v1.DownloadProgressStart;
return proto.cc.arduino.cli.commands.v1.DownloadProgressStart.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.cc.arduino.cli.commands.v1.DownloadProgressStart} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.cc.arduino.cli.commands.v1.DownloadProgressStart}
*/
proto.cc.arduino.cli.commands.v1.DownloadProgressStart.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {string} */ (reader.readString());
msg.setUrl(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setLabel(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.cc.arduino.cli.commands.v1.DownloadProgressStart.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.cc.arduino.cli.commands.v1.DownloadProgressStart.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.cc.arduino.cli.commands.v1.DownloadProgressStart} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cc.arduino.cli.commands.v1.DownloadProgressStart.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getUrl();
if (f.length > 0) {
@@ -450,34 +782,13 @@ proto.cc.arduino.cli.commands.v1.DownloadProgress.serializeBinaryToWriter = func
f
);
}
f = message.getFile();
f = message.getLabel();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getTotalSize();
if (f !== 0) {
writer.writeInt64(
3,
f
);
}
f = message.getDownloaded();
if (f !== 0) {
writer.writeInt64(
4,
f
);
}
f = message.getCompleted();
if (f) {
writer.writeBool(
5,
f
);
}
};
@@ -485,89 +796,355 @@ proto.cc.arduino.cli.commands.v1.DownloadProgress.serializeBinaryToWriter = func
* optional string url = 1;
* @return {string}
*/
proto.cc.arduino.cli.commands.v1.DownloadProgress.prototype.getUrl = function() {
proto.cc.arduino.cli.commands.v1.DownloadProgressStart.prototype.getUrl = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.cc.arduino.cli.commands.v1.DownloadProgress} returns this
* @return {!proto.cc.arduino.cli.commands.v1.DownloadProgressStart} returns this
*/
proto.cc.arduino.cli.commands.v1.DownloadProgress.prototype.setUrl = function(value) {
proto.cc.arduino.cli.commands.v1.DownloadProgressStart.prototype.setUrl = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional string file = 2;
* optional string label = 2;
* @return {string}
*/
proto.cc.arduino.cli.commands.v1.DownloadProgress.prototype.getFile = function() {
proto.cc.arduino.cli.commands.v1.DownloadProgressStart.prototype.getLabel = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* @param {string} value
* @return {!proto.cc.arduino.cli.commands.v1.DownloadProgress} returns this
* @return {!proto.cc.arduino.cli.commands.v1.DownloadProgressStart} returns this
*/
proto.cc.arduino.cli.commands.v1.DownloadProgress.prototype.setFile = function(value) {
proto.cc.arduino.cli.commands.v1.DownloadProgressStart.prototype.setLabel = function(value) {
return jspb.Message.setProto3StringField(this, 2, value);
};
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* optional int64 total_size = 3;
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.cc.arduino.cli.commands.v1.DownloadProgressUpdate.prototype.toObject = function(opt_includeInstance) {
return proto.cc.arduino.cli.commands.v1.DownloadProgressUpdate.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.cc.arduino.cli.commands.v1.DownloadProgressUpdate} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cc.arduino.cli.commands.v1.DownloadProgressUpdate.toObject = function(includeInstance, msg) {
var f, obj = {
downloaded: jspb.Message.getFieldWithDefault(msg, 1, 0),
totalSize: jspb.Message.getFieldWithDefault(msg, 2, 0)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.cc.arduino.cli.commands.v1.DownloadProgressUpdate}
*/
proto.cc.arduino.cli.commands.v1.DownloadProgressUpdate.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.cc.arduino.cli.commands.v1.DownloadProgressUpdate;
return proto.cc.arduino.cli.commands.v1.DownloadProgressUpdate.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.cc.arduino.cli.commands.v1.DownloadProgressUpdate} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.cc.arduino.cli.commands.v1.DownloadProgressUpdate}
*/
proto.cc.arduino.cli.commands.v1.DownloadProgressUpdate.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {number} */ (reader.readInt64());
msg.setDownloaded(value);
break;
case 2:
var value = /** @type {number} */ (reader.readInt64());
msg.setTotalSize(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.cc.arduino.cli.commands.v1.DownloadProgressUpdate.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.cc.arduino.cli.commands.v1.DownloadProgressUpdate.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.cc.arduino.cli.commands.v1.DownloadProgressUpdate} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cc.arduino.cli.commands.v1.DownloadProgressUpdate.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getDownloaded();
if (f !== 0) {
writer.writeInt64(
1,
f
);
}
f = message.getTotalSize();
if (f !== 0) {
writer.writeInt64(
2,
f
);
}
};
/**
* optional int64 downloaded = 1;
* @return {number}
*/
proto.cc.arduino.cli.commands.v1.DownloadProgress.prototype.getTotalSize = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0));
proto.cc.arduino.cli.commands.v1.DownloadProgressUpdate.prototype.getDownloaded = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
};
/**
* @param {number} value
* @return {!proto.cc.arduino.cli.commands.v1.DownloadProgress} returns this
* @return {!proto.cc.arduino.cli.commands.v1.DownloadProgressUpdate} returns this
*/
proto.cc.arduino.cli.commands.v1.DownloadProgress.prototype.setTotalSize = function(value) {
return jspb.Message.setProto3IntField(this, 3, value);
proto.cc.arduino.cli.commands.v1.DownloadProgressUpdate.prototype.setDownloaded = function(value) {
return jspb.Message.setProto3IntField(this, 1, value);
};
/**
* optional int64 downloaded = 4;
* optional int64 total_size = 2;
* @return {number}
*/
proto.cc.arduino.cli.commands.v1.DownloadProgress.prototype.getDownloaded = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0));
proto.cc.arduino.cli.commands.v1.DownloadProgressUpdate.prototype.getTotalSize = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
};
/**
* @param {number} value
* @return {!proto.cc.arduino.cli.commands.v1.DownloadProgress} returns this
* @return {!proto.cc.arduino.cli.commands.v1.DownloadProgressUpdate} returns this
*/
proto.cc.arduino.cli.commands.v1.DownloadProgress.prototype.setDownloaded = function(value) {
return jspb.Message.setProto3IntField(this, 4, value);
proto.cc.arduino.cli.commands.v1.DownloadProgressUpdate.prototype.setTotalSize = function(value) {
return jspb.Message.setProto3IntField(this, 2, value);
};
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.cc.arduino.cli.commands.v1.DownloadProgressEnd.prototype.toObject = function(opt_includeInstance) {
return proto.cc.arduino.cli.commands.v1.DownloadProgressEnd.toObject(opt_includeInstance, this);
};
/**
* optional bool completed = 5;
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.cc.arduino.cli.commands.v1.DownloadProgressEnd} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cc.arduino.cli.commands.v1.DownloadProgressEnd.toObject = function(includeInstance, msg) {
var f, obj = {
success: jspb.Message.getBooleanFieldWithDefault(msg, 1, false),
message: jspb.Message.getFieldWithDefault(msg, 2, "")
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.cc.arduino.cli.commands.v1.DownloadProgressEnd}
*/
proto.cc.arduino.cli.commands.v1.DownloadProgressEnd.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.cc.arduino.cli.commands.v1.DownloadProgressEnd;
return proto.cc.arduino.cli.commands.v1.DownloadProgressEnd.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.cc.arduino.cli.commands.v1.DownloadProgressEnd} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.cc.arduino.cli.commands.v1.DownloadProgressEnd}
*/
proto.cc.arduino.cli.commands.v1.DownloadProgressEnd.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {boolean} */ (reader.readBool());
msg.setSuccess(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setMessage(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.cc.arduino.cli.commands.v1.DownloadProgressEnd.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.cc.arduino.cli.commands.v1.DownloadProgressEnd.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.cc.arduino.cli.commands.v1.DownloadProgressEnd} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cc.arduino.cli.commands.v1.DownloadProgressEnd.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getSuccess();
if (f) {
writer.writeBool(
1,
f
);
}
f = message.getMessage();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
};
/**
* optional bool success = 1;
* @return {boolean}
*/
proto.cc.arduino.cli.commands.v1.DownloadProgress.prototype.getCompleted = function() {
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 5, false));
proto.cc.arduino.cli.commands.v1.DownloadProgressEnd.prototype.getSuccess = function() {
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false));
};
/**
* @param {boolean} value
* @return {!proto.cc.arduino.cli.commands.v1.DownloadProgress} returns this
* @return {!proto.cc.arduino.cli.commands.v1.DownloadProgressEnd} returns this
*/
proto.cc.arduino.cli.commands.v1.DownloadProgress.prototype.setCompleted = function(value) {
return jspb.Message.setProto3BooleanField(this, 5, value);
proto.cc.arduino.cli.commands.v1.DownloadProgressEnd.prototype.setSuccess = function(value) {
return jspb.Message.setProto3BooleanField(this, 1, value);
};
/**
* optional string message = 2;
* @return {string}
*/
proto.cc.arduino.cli.commands.v1.DownloadProgressEnd.prototype.getMessage = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* @param {string} value
* @return {!proto.cc.arduino.cli.commands.v1.DownloadProgressEnd} returns this
*/
proto.cc.arduino.cli.commands.v1.DownloadProgressEnd.prototype.setMessage = function(value) {
return jspb.Message.setProto3StringField(this, 2, value);
};