diff --git a/arduino-ide-extension/package.json b/arduino-ide-extension/package.json index a928ffe09..fb0bf563d 100644 --- a/arduino-ide-extension/package.json +++ b/arduino-ide-extension/package.json @@ -171,10 +171,14 @@ ], "arduino": { "cli": { - "version": "0.33.1" + "version": { + "owner": "cmaglie", + "repo": "arduino-cli", + "commitish": "board_port_after_upload" + } }, "fwuploader": { - "version": "2.2.2" + "version": "2.3.0" }, "clangd": { "version": "14.0.0" diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_grpc_pb.d.ts b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_grpc_pb.d.ts index b321b3c23..ff15d4c43 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_grpc_pb.d.ts +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_grpc_pb.d.ts @@ -26,6 +26,7 @@ interface IArduinoCoreServiceService extends grpc.ServiceDefinition; responseDeserialize: grpc.deserialize; } +interface IArduinoCoreServiceService_ISetSketchDefaults extends grpc.MethodDefinition { + path: "/cc.arduino.cli.commands.v1.ArduinoCoreService/SetSketchDefaults"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} interface IArduinoCoreServiceService_IBoardDetails extends grpc.MethodDefinition { path: "/cc.arduino.cli.commands.v1.ArduinoCoreService/BoardDetails"; requestStream: false; @@ -412,6 +422,7 @@ export interface IArduinoCoreServiceServer { newSketch: grpc.handleUnaryCall; loadSketch: grpc.handleUnaryCall; archiveSketch: grpc.handleUnaryCall; + setSketchDefaults: grpc.handleUnaryCall; boardDetails: grpc.handleUnaryCall; boardList: grpc.handleUnaryCall; boardListAll: grpc.handleUnaryCall; @@ -468,6 +479,9 @@ export interface IArduinoCoreServiceClient { archiveSketch(request: cc_arduino_cli_commands_v1_commands_pb.ArchiveSketchRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.ArchiveSketchResponse) => void): grpc.ClientUnaryCall; archiveSketch(request: cc_arduino_cli_commands_v1_commands_pb.ArchiveSketchRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.ArchiveSketchResponse) => void): grpc.ClientUnaryCall; archiveSketch(request: cc_arduino_cli_commands_v1_commands_pb.ArchiveSketchRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.ArchiveSketchResponse) => void): grpc.ClientUnaryCall; + setSketchDefaults(request: cc_arduino_cli_commands_v1_commands_pb.SetSketchDefaultsRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.SetSketchDefaultsResponse) => void): grpc.ClientUnaryCall; + setSketchDefaults(request: cc_arduino_cli_commands_v1_commands_pb.SetSketchDefaultsRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.SetSketchDefaultsResponse) => void): grpc.ClientUnaryCall; + setSketchDefaults(request: cc_arduino_cli_commands_v1_commands_pb.SetSketchDefaultsRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.SetSketchDefaultsResponse) => void): grpc.ClientUnaryCall; boardDetails(request: cc_arduino_cli_commands_v1_board_pb.BoardDetailsRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_board_pb.BoardDetailsResponse) => void): grpc.ClientUnaryCall; boardDetails(request: cc_arduino_cli_commands_v1_board_pb.BoardDetailsRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_board_pb.BoardDetailsResponse) => void): grpc.ClientUnaryCall; boardDetails(request: cc_arduino_cli_commands_v1_board_pb.BoardDetailsRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_board_pb.BoardDetailsResponse) => void): grpc.ClientUnaryCall; @@ -568,6 +582,9 @@ export class ArduinoCoreServiceClient extends grpc.Client implements IArduinoCor public archiveSketch(request: cc_arduino_cli_commands_v1_commands_pb.ArchiveSketchRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.ArchiveSketchResponse) => void): grpc.ClientUnaryCall; public archiveSketch(request: cc_arduino_cli_commands_v1_commands_pb.ArchiveSketchRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.ArchiveSketchResponse) => void): grpc.ClientUnaryCall; public archiveSketch(request: cc_arduino_cli_commands_v1_commands_pb.ArchiveSketchRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.ArchiveSketchResponse) => void): grpc.ClientUnaryCall; + public setSketchDefaults(request: cc_arduino_cli_commands_v1_commands_pb.SetSketchDefaultsRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.SetSketchDefaultsResponse) => void): grpc.ClientUnaryCall; + public setSketchDefaults(request: cc_arduino_cli_commands_v1_commands_pb.SetSketchDefaultsRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.SetSketchDefaultsResponse) => void): grpc.ClientUnaryCall; + public setSketchDefaults(request: cc_arduino_cli_commands_v1_commands_pb.SetSketchDefaultsRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.SetSketchDefaultsResponse) => void): grpc.ClientUnaryCall; public boardDetails(request: cc_arduino_cli_commands_v1_board_pb.BoardDetailsRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_board_pb.BoardDetailsResponse) => void): grpc.ClientUnaryCall; public boardDetails(request: cc_arduino_cli_commands_v1_board_pb.BoardDetailsRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_board_pb.BoardDetailsResponse) => void): grpc.ClientUnaryCall; public boardDetails(request: cc_arduino_cli_commands_v1_board_pb.BoardDetailsRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_board_pb.BoardDetailsResponse) => void): grpc.ClientUnaryCall; diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_grpc_pb.js b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_grpc_pb.js index 49ec3d019..8947c7570 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_grpc_pb.js +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_grpc_pb.js @@ -709,6 +709,28 @@ function deserialize_cc_arduino_cli_commands_v1_PlatformUpgradeResponse(buffer_a return cc_arduino_cli_commands_v1_core_pb.PlatformUpgradeResponse.deserializeBinary(new Uint8Array(buffer_arg)); } +function serialize_cc_arduino_cli_commands_v1_SetSketchDefaultsRequest(arg) { + if (!(arg instanceof cc_arduino_cli_commands_v1_commands_pb.SetSketchDefaultsRequest)) { + throw new Error('Expected argument of type cc.arduino.cli.commands.v1.SetSketchDefaultsRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_cc_arduino_cli_commands_v1_SetSketchDefaultsRequest(buffer_arg) { + return cc_arduino_cli_commands_v1_commands_pb.SetSketchDefaultsRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_cc_arduino_cli_commands_v1_SetSketchDefaultsResponse(arg) { + if (!(arg instanceof cc_arduino_cli_commands_v1_commands_pb.SetSketchDefaultsResponse)) { + throw new Error('Expected argument of type cc.arduino.cli.commands.v1.SetSketchDefaultsResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_cc_arduino_cli_commands_v1_SetSketchDefaultsResponse(buffer_arg) { + return cc_arduino_cli_commands_v1_commands_pb.SetSketchDefaultsResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + function serialize_cc_arduino_cli_commands_v1_SupportedUserFieldsRequest(arg) { if (!(arg instanceof cc_arduino_cli_commands_v1_upload_pb.SupportedUserFieldsRequest)) { throw new Error('Expected argument of type cc.arduino.cli.commands.v1.SupportedUserFieldsRequest'); @@ -975,6 +997,20 @@ archiveSketch: { responseSerialize: serialize_cc_arduino_cli_commands_v1_ArchiveSketchResponse, responseDeserialize: deserialize_cc_arduino_cli_commands_v1_ArchiveSketchResponse, }, + // Sets the sketch default FQBN and Port Address/Protocol in +// the sketch project file (sketch.yaml). These metadata can be retrieved +// using LoadSketch. +setSketchDefaults: { + path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/SetSketchDefaults', + requestStream: false, + responseStream: false, + requestType: cc_arduino_cli_commands_v1_commands_pb.SetSketchDefaultsRequest, + responseType: cc_arduino_cli_commands_v1_commands_pb.SetSketchDefaultsResponse, + requestSerialize: serialize_cc_arduino_cli_commands_v1_SetSketchDefaultsRequest, + requestDeserialize: deserialize_cc_arduino_cli_commands_v1_SetSketchDefaultsRequest, + responseSerialize: serialize_cc_arduino_cli_commands_v1_SetSketchDefaultsResponse, + responseDeserialize: deserialize_cc_arduino_cli_commands_v1_SetSketchDefaultsResponse, + }, // BOARD COMMANDS // -------------- // diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_pb.d.ts b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_pb.d.ts index fc1c8b525..2bb88967b 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_pb.d.ts +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_pb.d.ts @@ -377,12 +377,6 @@ export namespace VersionResponse { } export class NewSketchRequest extends jspb.Message { - - hasInstance(): boolean; - clearInstance(): void; - getInstance(): cc_arduino_cli_commands_v1_common_pb.Instance | undefined; - setInstance(value?: cc_arduino_cli_commands_v1_common_pb.Instance): NewSketchRequest; - getSketchName(): string; setSketchName(value: string): NewSketchRequest; @@ -405,7 +399,6 @@ export class NewSketchRequest extends jspb.Message { export namespace NewSketchRequest { export type AsObject = { - instance?: cc_arduino_cli_commands_v1_common_pb.Instance.AsObject, sketchName: string, sketchDir: string, overwrite: boolean, @@ -434,12 +427,6 @@ export namespace NewSketchResponse { } export class LoadSketchRequest extends jspb.Message { - - hasInstance(): boolean; - clearInstance(): void; - getInstance(): cc_arduino_cli_commands_v1_common_pb.Instance | undefined; - setInstance(value?: cc_arduino_cli_commands_v1_common_pb.Instance): LoadSketchRequest; - getSketchPath(): string; setSketchPath(value: string): LoadSketchRequest; @@ -456,7 +443,6 @@ export class LoadSketchRequest extends jspb.Message { export namespace LoadSketchRequest { export type AsObject = { - instance?: cc_arduino_cli_commands_v1_common_pb.Instance.AsObject, sketchPath: string, } } @@ -483,6 +469,15 @@ export class LoadSketchResponse extends jspb.Message { setRootFolderFilesList(value: Array): LoadSketchResponse; addRootFolderFiles(value: string, index?: number): string; + getDefaultFqbn(): string; + setDefaultFqbn(value: string): LoadSketchResponse; + + getDefaultPort(): string; + setDefaultPort(value: string): LoadSketchResponse; + + getDefaultProtocol(): string; + setDefaultProtocol(value: string): LoadSketchResponse; + serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): LoadSketchResponse.AsObject; @@ -501,6 +496,9 @@ export namespace LoadSketchResponse { otherSketchFilesList: Array, additionalFilesList: Array, rootFolderFilesList: Array, + defaultFqbn: string, + defaultPort: string, + defaultProtocol: string, } } @@ -554,6 +552,68 @@ export namespace ArchiveSketchResponse { } } +export class SetSketchDefaultsRequest extends jspb.Message { + getSketchPath(): string; + setSketchPath(value: string): SetSketchDefaultsRequest; + + getDefaultFqbn(): string; + setDefaultFqbn(value: string): SetSketchDefaultsRequest; + + getDefaultPortAddress(): string; + setDefaultPortAddress(value: string): SetSketchDefaultsRequest; + + getDefaultPortProtocol(): string; + setDefaultPortProtocol(value: string): SetSketchDefaultsRequest; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SetSketchDefaultsRequest.AsObject; + static toObject(includeInstance: boolean, msg: SetSketchDefaultsRequest): SetSketchDefaultsRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SetSketchDefaultsRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SetSketchDefaultsRequest; + static deserializeBinaryFromReader(message: SetSketchDefaultsRequest, reader: jspb.BinaryReader): SetSketchDefaultsRequest; +} + +export namespace SetSketchDefaultsRequest { + export type AsObject = { + sketchPath: string, + defaultFqbn: string, + defaultPortAddress: string, + defaultPortProtocol: string, + } +} + +export class SetSketchDefaultsResponse extends jspb.Message { + getDefaultFqbn(): string; + setDefaultFqbn(value: string): SetSketchDefaultsResponse; + + getDefaultPortAddress(): string; + setDefaultPortAddress(value: string): SetSketchDefaultsResponse; + + getDefaultPortProtocol(): string; + setDefaultPortProtocol(value: string): SetSketchDefaultsResponse; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SetSketchDefaultsResponse.AsObject; + static toObject(includeInstance: boolean, msg: SetSketchDefaultsResponse): SetSketchDefaultsResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SetSketchDefaultsResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SetSketchDefaultsResponse; + static deserializeBinaryFromReader(message: SetSketchDefaultsResponse, reader: jspb.BinaryReader): SetSketchDefaultsResponse; +} + +export namespace SetSketchDefaultsResponse { + export type AsObject = { + defaultFqbn: string, + defaultPortAddress: string, + defaultPortProtocol: string, + } +} + export enum FailedInstanceInitReason { FAILED_INSTANCE_INIT_REASON_UNSPECIFIED = 0, FAILED_INSTANCE_INIT_REASON_INVALID_INDEX_URL = 1, diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_pb.js b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_pb.js index ead2d3881..14f1dfc5e 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_pb.js +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_pb.js @@ -53,6 +53,8 @@ goog.exportSymbol('proto.cc.arduino.cli.commands.v1.LoadSketchRequest', null, gl goog.exportSymbol('proto.cc.arduino.cli.commands.v1.LoadSketchResponse', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.NewSketchRequest', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.NewSketchResponse', null, global); +goog.exportSymbol('proto.cc.arduino.cli.commands.v1.SetSketchDefaultsRequest', null, global); +goog.exportSymbol('proto.cc.arduino.cli.commands.v1.SetSketchDefaultsResponse', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.UpdateIndexRequest', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.UpdateIndexResponse', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.UpdateLibrariesIndexRequest', null, global); @@ -479,6 +481,48 @@ if (goog.DEBUG && !COMPILED) { */ proto.cc.arduino.cli.commands.v1.ArchiveSketchResponse.displayName = 'proto.cc.arduino.cli.commands.v1.ArchiveSketchResponse'; } +/** + * 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.SetSketchDefaultsRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.cc.arduino.cli.commands.v1.SetSketchDefaultsRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.cc.arduino.cli.commands.v1.SetSketchDefaultsRequest.displayName = 'proto.cc.arduino.cli.commands.v1.SetSketchDefaultsRequest'; +} +/** + * 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.SetSketchDefaultsResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.cc.arduino.cli.commands.v1.SetSketchDefaultsResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.cc.arduino.cli.commands.v1.SetSketchDefaultsResponse.displayName = 'proto.cc.arduino.cli.commands.v1.SetSketchDefaultsResponse'; +} @@ -2733,7 +2777,6 @@ proto.cc.arduino.cli.commands.v1.NewSketchRequest.prototype.toObject = function( */ proto.cc.arduino.cli.commands.v1.NewSketchRequest.toObject = function(includeInstance, msg) { var f, obj = { - instance: (f = msg.getInstance()) && cc_arduino_cli_commands_v1_common_pb.Instance.toObject(includeInstance, f), sketchName: jspb.Message.getFieldWithDefault(msg, 2, ""), sketchDir: jspb.Message.getFieldWithDefault(msg, 3, ""), overwrite: jspb.Message.getBooleanFieldWithDefault(msg, 4, false) @@ -2773,11 +2816,6 @@ proto.cc.arduino.cli.commands.v1.NewSketchRequest.deserializeBinaryFromReader = } var field = reader.getFieldNumber(); switch (field) { - case 1: - var value = new cc_arduino_cli_commands_v1_common_pb.Instance; - reader.readMessage(value,cc_arduino_cli_commands_v1_common_pb.Instance.deserializeBinaryFromReader); - msg.setInstance(value); - break; case 2: var value = /** @type {string} */ (reader.readString()); msg.setSketchName(value); @@ -2819,14 +2857,6 @@ proto.cc.arduino.cli.commands.v1.NewSketchRequest.prototype.serializeBinary = fu */ proto.cc.arduino.cli.commands.v1.NewSketchRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getInstance(); - if (f != null) { - writer.writeMessage( - 1, - f, - cc_arduino_cli_commands_v1_common_pb.Instance.serializeBinaryToWriter - ); - } f = message.getSketchName(); if (f.length > 0) { writer.writeString( @@ -2851,43 +2881,6 @@ proto.cc.arduino.cli.commands.v1.NewSketchRequest.serializeBinaryToWriter = func }; -/** - * optional Instance instance = 1; - * @return {?proto.cc.arduino.cli.commands.v1.Instance} - */ -proto.cc.arduino.cli.commands.v1.NewSketchRequest.prototype.getInstance = function() { - return /** @type{?proto.cc.arduino.cli.commands.v1.Instance} */ ( - jspb.Message.getWrapperField(this, cc_arduino_cli_commands_v1_common_pb.Instance, 1)); -}; - - -/** - * @param {?proto.cc.arduino.cli.commands.v1.Instance|undefined} value - * @return {!proto.cc.arduino.cli.commands.v1.NewSketchRequest} returns this -*/ -proto.cc.arduino.cli.commands.v1.NewSketchRequest.prototype.setInstance = function(value) { - return jspb.Message.setWrapperField(this, 1, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.cc.arduino.cli.commands.v1.NewSketchRequest} returns this - */ -proto.cc.arduino.cli.commands.v1.NewSketchRequest.prototype.clearInstance = function() { - return this.setInstance(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.cc.arduino.cli.commands.v1.NewSketchRequest.prototype.hasInstance = function() { - return jspb.Message.getField(this, 1) != null; -}; - - /** * optional string sketch_name = 2; * @return {string} @@ -3104,7 +3097,6 @@ proto.cc.arduino.cli.commands.v1.LoadSketchRequest.prototype.toObject = function */ proto.cc.arduino.cli.commands.v1.LoadSketchRequest.toObject = function(includeInstance, msg) { var f, obj = { - instance: (f = msg.getInstance()) && cc_arduino_cli_commands_v1_common_pb.Instance.toObject(includeInstance, f), sketchPath: jspb.Message.getFieldWithDefault(msg, 2, "") }; @@ -3142,11 +3134,6 @@ proto.cc.arduino.cli.commands.v1.LoadSketchRequest.deserializeBinaryFromReader = } var field = reader.getFieldNumber(); switch (field) { - case 1: - var value = new cc_arduino_cli_commands_v1_common_pb.Instance; - reader.readMessage(value,cc_arduino_cli_commands_v1_common_pb.Instance.deserializeBinaryFromReader); - msg.setInstance(value); - break; case 2: var value = /** @type {string} */ (reader.readString()); msg.setSketchPath(value); @@ -3180,14 +3167,6 @@ proto.cc.arduino.cli.commands.v1.LoadSketchRequest.prototype.serializeBinary = f */ proto.cc.arduino.cli.commands.v1.LoadSketchRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getInstance(); - if (f != null) { - writer.writeMessage( - 1, - f, - cc_arduino_cli_commands_v1_common_pb.Instance.serializeBinaryToWriter - ); - } f = message.getSketchPath(); if (f.length > 0) { writer.writeString( @@ -3198,43 +3177,6 @@ proto.cc.arduino.cli.commands.v1.LoadSketchRequest.serializeBinaryToWriter = fun }; -/** - * optional Instance instance = 1; - * @return {?proto.cc.arduino.cli.commands.v1.Instance} - */ -proto.cc.arduino.cli.commands.v1.LoadSketchRequest.prototype.getInstance = function() { - return /** @type{?proto.cc.arduino.cli.commands.v1.Instance} */ ( - jspb.Message.getWrapperField(this, cc_arduino_cli_commands_v1_common_pb.Instance, 1)); -}; - - -/** - * @param {?proto.cc.arduino.cli.commands.v1.Instance|undefined} value - * @return {!proto.cc.arduino.cli.commands.v1.LoadSketchRequest} returns this -*/ -proto.cc.arduino.cli.commands.v1.LoadSketchRequest.prototype.setInstance = function(value) { - return jspb.Message.setWrapperField(this, 1, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.cc.arduino.cli.commands.v1.LoadSketchRequest} returns this - */ -proto.cc.arduino.cli.commands.v1.LoadSketchRequest.prototype.clearInstance = function() { - return this.setInstance(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.cc.arduino.cli.commands.v1.LoadSketchRequest.prototype.hasInstance = function() { - return jspb.Message.getField(this, 1) != null; -}; - - /** * optional string sketch_path = 2; * @return {string} @@ -3296,7 +3238,10 @@ proto.cc.arduino.cli.commands.v1.LoadSketchResponse.toObject = function(includeI locationPath: jspb.Message.getFieldWithDefault(msg, 2, ""), otherSketchFilesList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f, additionalFilesList: (f = jspb.Message.getRepeatedField(msg, 4)) == null ? undefined : f, - rootFolderFilesList: (f = jspb.Message.getRepeatedField(msg, 5)) == null ? undefined : f + rootFolderFilesList: (f = jspb.Message.getRepeatedField(msg, 5)) == null ? undefined : f, + defaultFqbn: jspb.Message.getFieldWithDefault(msg, 6, ""), + defaultPort: jspb.Message.getFieldWithDefault(msg, 7, ""), + defaultProtocol: jspb.Message.getFieldWithDefault(msg, 8, "") }; if (includeInstance) { @@ -3353,6 +3298,18 @@ proto.cc.arduino.cli.commands.v1.LoadSketchResponse.deserializeBinaryFromReader var value = /** @type {string} */ (reader.readString()); msg.addRootFolderFiles(value); break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.setDefaultFqbn(value); + break; + case 7: + var value = /** @type {string} */ (reader.readString()); + msg.setDefaultPort(value); + break; + case 8: + var value = /** @type {string} */ (reader.readString()); + msg.setDefaultProtocol(value); + break; default: reader.skipField(); break; @@ -3417,6 +3374,27 @@ proto.cc.arduino.cli.commands.v1.LoadSketchResponse.serializeBinaryToWriter = fu f ); } + f = message.getDefaultFqbn(); + if (f.length > 0) { + writer.writeString( + 6, + f + ); + } + f = message.getDefaultPort(); + if (f.length > 0) { + writer.writeString( + 7, + f + ); + } + f = message.getDefaultProtocol(); + if (f.length > 0) { + writer.writeString( + 8, + f + ); + } }; @@ -3567,6 +3545,60 @@ proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.clearRootFolderFil }; +/** + * optional string default_fqbn = 6; + * @return {string} + */ +proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.getDefaultFqbn = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** + * @param {string} value + * @return {!proto.cc.arduino.cli.commands.v1.LoadSketchResponse} returns this + */ +proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.setDefaultFqbn = function(value) { + return jspb.Message.setProto3StringField(this, 6, value); +}; + + +/** + * optional string default_port = 7; + * @return {string} + */ +proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.getDefaultPort = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); +}; + + +/** + * @param {string} value + * @return {!proto.cc.arduino.cli.commands.v1.LoadSketchResponse} returns this + */ +proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.setDefaultPort = function(value) { + return jspb.Message.setProto3StringField(this, 7, value); +}; + + +/** + * optional string default_protocol = 8; + * @return {string} + */ +proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.getDefaultProtocol = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 8, "")); +}; + + +/** + * @param {string} value + * @return {!proto.cc.arduino.cli.commands.v1.LoadSketchResponse} returns this + */ +proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.setDefaultProtocol = function(value) { + return jspb.Message.setProto3StringField(this, 8, value); +}; + + @@ -3888,6 +3920,416 @@ proto.cc.arduino.cli.commands.v1.ArchiveSketchResponse.serializeBinaryToWriter = }; + + + +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_, 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.SetSketchDefaultsRequest.prototype.toObject = function(opt_includeInstance) { + return proto.cc.arduino.cli.commands.v1.SetSketchDefaultsRequest.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.SetSketchDefaultsRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.cc.arduino.cli.commands.v1.SetSketchDefaultsRequest.toObject = function(includeInstance, msg) { + var f, obj = { + sketchPath: jspb.Message.getFieldWithDefault(msg, 1, ""), + defaultFqbn: jspb.Message.getFieldWithDefault(msg, 2, ""), + defaultPortAddress: jspb.Message.getFieldWithDefault(msg, 3, ""), + defaultPortProtocol: jspb.Message.getFieldWithDefault(msg, 4, "") + }; + + 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.SetSketchDefaultsRequest} + */ +proto.cc.arduino.cli.commands.v1.SetSketchDefaultsRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.cc.arduino.cli.commands.v1.SetSketchDefaultsRequest; + return proto.cc.arduino.cli.commands.v1.SetSketchDefaultsRequest.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.SetSketchDefaultsRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.cc.arduino.cli.commands.v1.SetSketchDefaultsRequest} + */ +proto.cc.arduino.cli.commands.v1.SetSketchDefaultsRequest.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.setSketchPath(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setDefaultFqbn(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setDefaultPortAddress(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setDefaultPortProtocol(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.SetSketchDefaultsRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.cc.arduino.cli.commands.v1.SetSketchDefaultsRequest.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.SetSketchDefaultsRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.cc.arduino.cli.commands.v1.SetSketchDefaultsRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSketchPath(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getDefaultFqbn(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getDefaultPortAddress(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getDefaultPortProtocol(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } +}; + + +/** + * optional string sketch_path = 1; + * @return {string} + */ +proto.cc.arduino.cli.commands.v1.SetSketchDefaultsRequest.prototype.getSketchPath = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.cc.arduino.cli.commands.v1.SetSketchDefaultsRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.SetSketchDefaultsRequest.prototype.setSketchPath = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string default_fqbn = 2; + * @return {string} + */ +proto.cc.arduino.cli.commands.v1.SetSketchDefaultsRequest.prototype.getDefaultFqbn = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.cc.arduino.cli.commands.v1.SetSketchDefaultsRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.SetSketchDefaultsRequest.prototype.setDefaultFqbn = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string default_port_address = 3; + * @return {string} + */ +proto.cc.arduino.cli.commands.v1.SetSketchDefaultsRequest.prototype.getDefaultPortAddress = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.cc.arduino.cli.commands.v1.SetSketchDefaultsRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.SetSketchDefaultsRequest.prototype.setDefaultPortAddress = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string default_port_protocol = 4; + * @return {string} + */ +proto.cc.arduino.cli.commands.v1.SetSketchDefaultsRequest.prototype.getDefaultPortProtocol = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.cc.arduino.cli.commands.v1.SetSketchDefaultsRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.SetSketchDefaultsRequest.prototype.setDefaultPortProtocol = function(value) { + return jspb.Message.setProto3StringField(this, 4, 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_, 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.SetSketchDefaultsResponse.prototype.toObject = function(opt_includeInstance) { + return proto.cc.arduino.cli.commands.v1.SetSketchDefaultsResponse.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.SetSketchDefaultsResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.cc.arduino.cli.commands.v1.SetSketchDefaultsResponse.toObject = function(includeInstance, msg) { + var f, obj = { + defaultFqbn: jspb.Message.getFieldWithDefault(msg, 1, ""), + defaultPortAddress: jspb.Message.getFieldWithDefault(msg, 2, ""), + defaultPortProtocol: jspb.Message.getFieldWithDefault(msg, 3, "") + }; + + 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.SetSketchDefaultsResponse} + */ +proto.cc.arduino.cli.commands.v1.SetSketchDefaultsResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.cc.arduino.cli.commands.v1.SetSketchDefaultsResponse; + return proto.cc.arduino.cli.commands.v1.SetSketchDefaultsResponse.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.SetSketchDefaultsResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.cc.arduino.cli.commands.v1.SetSketchDefaultsResponse} + */ +proto.cc.arduino.cli.commands.v1.SetSketchDefaultsResponse.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.setDefaultFqbn(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setDefaultPortAddress(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setDefaultPortProtocol(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.SetSketchDefaultsResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.cc.arduino.cli.commands.v1.SetSketchDefaultsResponse.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.SetSketchDefaultsResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.cc.arduino.cli.commands.v1.SetSketchDefaultsResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getDefaultFqbn(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getDefaultPortAddress(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getDefaultPortProtocol(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } +}; + + +/** + * optional string default_fqbn = 1; + * @return {string} + */ +proto.cc.arduino.cli.commands.v1.SetSketchDefaultsResponse.prototype.getDefaultFqbn = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.cc.arduino.cli.commands.v1.SetSketchDefaultsResponse} returns this + */ +proto.cc.arduino.cli.commands.v1.SetSketchDefaultsResponse.prototype.setDefaultFqbn = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string default_port_address = 2; + * @return {string} + */ +proto.cc.arduino.cli.commands.v1.SetSketchDefaultsResponse.prototype.getDefaultPortAddress = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.cc.arduino.cli.commands.v1.SetSketchDefaultsResponse} returns this + */ +proto.cc.arduino.cli.commands.v1.SetSketchDefaultsResponse.prototype.setDefaultPortAddress = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string default_port_protocol = 3; + * @return {string} + */ +proto.cc.arduino.cli.commands.v1.SetSketchDefaultsResponse.prototype.getDefaultPortProtocol = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.cc.arduino.cli.commands.v1.SetSketchDefaultsResponse} returns this + */ +proto.cc.arduino.cli.commands.v1.SetSketchDefaultsResponse.prototype.setDefaultPortProtocol = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + /** * @enum {number} */ diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/lib_pb.d.ts b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/lib_pb.d.ts index 27866d15a..4d71dd6e7 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/lib_pb.d.ts +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/lib_pb.d.ts @@ -409,6 +409,9 @@ export class LibrarySearchRequest extends jspb.Message { getOmitReleasesDetails(): boolean; setOmitReleasesDetails(value: boolean): LibrarySearchRequest; + getSearchArgs(): string; + setSearchArgs(value: string): LibrarySearchRequest; + serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): LibrarySearchRequest.AsObject; @@ -425,6 +428,7 @@ export namespace LibrarySearchRequest { instance?: cc_arduino_cli_commands_v1_common_pb.Instance.AsObject, query: string, omitReleasesDetails: boolean, + searchArgs: string, } } diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/lib_pb.js b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/lib_pb.js index fa7cc1365..7ec2e0bbf 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/lib_pb.js +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/lib_pb.js @@ -3209,7 +3209,8 @@ proto.cc.arduino.cli.commands.v1.LibrarySearchRequest.toObject = function(includ var f, obj = { instance: (f = msg.getInstance()) && cc_arduino_cli_commands_v1_common_pb.Instance.toObject(includeInstance, f), query: jspb.Message.getFieldWithDefault(msg, 2, ""), - omitReleasesDetails: jspb.Message.getBooleanFieldWithDefault(msg, 3, false) + omitReleasesDetails: jspb.Message.getBooleanFieldWithDefault(msg, 3, false), + searchArgs: jspb.Message.getFieldWithDefault(msg, 4, "") }; if (includeInstance) { @@ -3259,6 +3260,10 @@ proto.cc.arduino.cli.commands.v1.LibrarySearchRequest.deserializeBinaryFromReade var value = /** @type {boolean} */ (reader.readBool()); msg.setOmitReleasesDetails(value); break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setSearchArgs(value); + break; default: reader.skipField(); break; @@ -3310,6 +3315,13 @@ proto.cc.arduino.cli.commands.v1.LibrarySearchRequest.serializeBinaryToWriter = f ); } + f = message.getSearchArgs(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } }; @@ -3386,6 +3398,24 @@ proto.cc.arduino.cli.commands.v1.LibrarySearchRequest.prototype.setOmitReleasesD }; +/** + * optional string search_args = 4; + * @return {string} + */ +proto.cc.arduino.cli.commands.v1.LibrarySearchRequest.prototype.getSearchArgs = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.cc.arduino.cli.commands.v1.LibrarySearchRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.LibrarySearchRequest.prototype.setSearchArgs = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + /** * List of repeated fields within this message type. diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/upload_pb.d.ts b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/upload_pb.d.ts index 4427473a6..e2c5f4a37 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/upload_pb.d.ts +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/upload_pb.d.ts @@ -78,17 +78,31 @@ export namespace UploadRequest { } export class UploadResponse extends jspb.Message { + + hasOutStream(): boolean; + clearOutStream(): void; getOutStream(): Uint8Array | string; getOutStream_asU8(): Uint8Array; getOutStream_asB64(): string; setOutStream(value: Uint8Array | string): UploadResponse; + + hasErrStream(): boolean; + clearErrStream(): void; getErrStream(): Uint8Array | string; getErrStream_asU8(): Uint8Array; getErrStream_asB64(): string; setErrStream(value: Uint8Array | string): UploadResponse; + hasResult(): boolean; + clearResult(): void; + getResult(): UploadResult | undefined; + setResult(value?: UploadResult): UploadResponse; + + + getMessageCase(): UploadResponse.MessageCase; + serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): UploadResponse.AsObject; static toObject(includeInstance: boolean, msg: UploadResponse): UploadResponse.AsObject; @@ -103,6 +117,43 @@ export namespace UploadResponse { export type AsObject = { outStream: Uint8Array | string, errStream: Uint8Array | string, + result?: UploadResult.AsObject, + } + + export enum MessageCase { + MESSAGE_NOT_SET = 0, + + OUT_STREAM = 1, + + ERR_STREAM = 2, + + RESULT = 3, + + } + +} + +export class UploadResult extends jspb.Message { + + hasUpdatedUploadPort(): boolean; + clearUpdatedUploadPort(): void; + getUpdatedUploadPort(): cc_arduino_cli_commands_v1_port_pb.Port | undefined; + setUpdatedUploadPort(value?: cc_arduino_cli_commands_v1_port_pb.Port): UploadResult; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): UploadResult.AsObject; + static toObject(includeInstance: boolean, msg: UploadResult): UploadResult.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: UploadResult, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): UploadResult; + static deserializeBinaryFromReader(message: UploadResult, reader: jspb.BinaryReader): UploadResult; +} + +export namespace UploadResult { + export type AsObject = { + updatedUploadPort?: cc_arduino_cli_commands_v1_port_pb.Port.AsObject, } } diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/upload_pb.js b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/upload_pb.js index c38618ad6..937a819c4 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/upload_pb.js +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/upload_pb.js @@ -34,6 +34,8 @@ goog.exportSymbol('proto.cc.arduino.cli.commands.v1.SupportedUserFieldsRequest', goog.exportSymbol('proto.cc.arduino.cli.commands.v1.SupportedUserFieldsResponse', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.UploadRequest', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.UploadResponse', null, global); +goog.exportSymbol('proto.cc.arduino.cli.commands.v1.UploadResponse.MessageCase', null, global); +goog.exportSymbol('proto.cc.arduino.cli.commands.v1.UploadResult', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerRequest', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerResponse', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.UserField', null, global); @@ -69,7 +71,7 @@ if (goog.DEBUG && !COMPILED) { * @constructor */ proto.cc.arduino.cli.commands.v1.UploadResponse = 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.UploadResponse.oneofGroups_); }; goog.inherits(proto.cc.arduino.cli.commands.v1.UploadResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { @@ -79,6 +81,27 @@ if (goog.DEBUG && !COMPILED) { */ proto.cc.arduino.cli.commands.v1.UploadResponse.displayName = 'proto.cc.arduino.cli.commands.v1.UploadResponse'; } +/** + * 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.UploadResult = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.cc.arduino.cli.commands.v1.UploadResult, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.cc.arduino.cli.commands.v1.UploadResult.displayName = 'proto.cc.arduino.cli.commands.v1.UploadResult'; +} /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -765,6 +788,33 @@ proto.cc.arduino.cli.commands.v1.UploadRequest.prototype.clearUserFieldsMap = fu +/** + * 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>} + * @const + */ +proto.cc.arduino.cli.commands.v1.UploadResponse.oneofGroups_ = [[1,2,3]]; + +/** + * @enum {number} + */ +proto.cc.arduino.cli.commands.v1.UploadResponse.MessageCase = { + MESSAGE_NOT_SET: 0, + OUT_STREAM: 1, + ERR_STREAM: 2, + RESULT: 3 +}; + +/** + * @return {proto.cc.arduino.cli.commands.v1.UploadResponse.MessageCase} + */ +proto.cc.arduino.cli.commands.v1.UploadResponse.prototype.getMessageCase = function() { + return /** @type {proto.cc.arduino.cli.commands.v1.UploadResponse.MessageCase} */(jspb.Message.computeOneofCase(this, proto.cc.arduino.cli.commands.v1.UploadResponse.oneofGroups_[0])); +}; + if (jspb.Message.GENERATE_TO_OBJECT) { @@ -797,7 +847,8 @@ proto.cc.arduino.cli.commands.v1.UploadResponse.prototype.toObject = function(op proto.cc.arduino.cli.commands.v1.UploadResponse.toObject = function(includeInstance, msg) { var f, obj = { outStream: msg.getOutStream_asB64(), - errStream: msg.getErrStream_asB64() + errStream: msg.getErrStream_asB64(), + result: (f = msg.getResult()) && proto.cc.arduino.cli.commands.v1.UploadResult.toObject(includeInstance, f) }; if (includeInstance) { @@ -842,6 +893,11 @@ proto.cc.arduino.cli.commands.v1.UploadResponse.deserializeBinaryFromReader = fu var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setErrStream(value); break; + case 3: + var value = new proto.cc.arduino.cli.commands.v1.UploadResult; + reader.readMessage(value,proto.cc.arduino.cli.commands.v1.UploadResult.deserializeBinaryFromReader); + msg.setResult(value); + break; default: reader.skipField(); break; @@ -871,20 +927,28 @@ proto.cc.arduino.cli.commands.v1.UploadResponse.prototype.serializeBinary = func */ proto.cc.arduino.cli.commands.v1.UploadResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getOutStream_asU8(); - if (f.length > 0) { + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 1)); + if (f != null) { writer.writeBytes( 1, f ); } - f = message.getErrStream_asU8(); - if (f.length > 0) { + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 2)); + if (f != null) { writer.writeBytes( 2, f ); } + f = message.getResult(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.cc.arduino.cli.commands.v1.UploadResult.serializeBinaryToWriter + ); + } }; @@ -926,7 +990,25 @@ proto.cc.arduino.cli.commands.v1.UploadResponse.prototype.getOutStream_asU8 = fu * @return {!proto.cc.arduino.cli.commands.v1.UploadResponse} returns this */ proto.cc.arduino.cli.commands.v1.UploadResponse.prototype.setOutStream = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); + return jspb.Message.setOneofField(this, 1, proto.cc.arduino.cli.commands.v1.UploadResponse.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.cc.arduino.cli.commands.v1.UploadResponse} returns this + */ +proto.cc.arduino.cli.commands.v1.UploadResponse.prototype.clearOutStream = function() { + return jspb.Message.setOneofField(this, 1, proto.cc.arduino.cli.commands.v1.UploadResponse.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.cc.arduino.cli.commands.v1.UploadResponse.prototype.hasOutStream = function() { + return jspb.Message.getField(this, 1) != null; }; @@ -968,7 +1050,213 @@ proto.cc.arduino.cli.commands.v1.UploadResponse.prototype.getErrStream_asU8 = fu * @return {!proto.cc.arduino.cli.commands.v1.UploadResponse} returns this */ proto.cc.arduino.cli.commands.v1.UploadResponse.prototype.setErrStream = function(value) { - return jspb.Message.setProto3BytesField(this, 2, value); + return jspb.Message.setOneofField(this, 2, proto.cc.arduino.cli.commands.v1.UploadResponse.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.cc.arduino.cli.commands.v1.UploadResponse} returns this + */ +proto.cc.arduino.cli.commands.v1.UploadResponse.prototype.clearErrStream = function() { + return jspb.Message.setOneofField(this, 2, proto.cc.arduino.cli.commands.v1.UploadResponse.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.cc.arduino.cli.commands.v1.UploadResponse.prototype.hasErrStream = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional UploadResult result = 3; + * @return {?proto.cc.arduino.cli.commands.v1.UploadResult} + */ +proto.cc.arduino.cli.commands.v1.UploadResponse.prototype.getResult = function() { + return /** @type{?proto.cc.arduino.cli.commands.v1.UploadResult} */ ( + jspb.Message.getWrapperField(this, proto.cc.arduino.cli.commands.v1.UploadResult, 3)); +}; + + +/** + * @param {?proto.cc.arduino.cli.commands.v1.UploadResult|undefined} value + * @return {!proto.cc.arduino.cli.commands.v1.UploadResponse} returns this +*/ +proto.cc.arduino.cli.commands.v1.UploadResponse.prototype.setResult = function(value) { + return jspb.Message.setOneofWrapperField(this, 3, proto.cc.arduino.cli.commands.v1.UploadResponse.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.cc.arduino.cli.commands.v1.UploadResponse} returns this + */ +proto.cc.arduino.cli.commands.v1.UploadResponse.prototype.clearResult = function() { + return this.setResult(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.cc.arduino.cli.commands.v1.UploadResponse.prototype.hasResult = 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_, 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.UploadResult.prototype.toObject = function(opt_includeInstance) { + return proto.cc.arduino.cli.commands.v1.UploadResult.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.UploadResult} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.cc.arduino.cli.commands.v1.UploadResult.toObject = function(includeInstance, msg) { + var f, obj = { + updatedUploadPort: (f = msg.getUpdatedUploadPort()) && cc_arduino_cli_commands_v1_port_pb.Port.toObject(includeInstance, f) + }; + + 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.UploadResult} + */ +proto.cc.arduino.cli.commands.v1.UploadResult.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.cc.arduino.cli.commands.v1.UploadResult; + return proto.cc.arduino.cli.commands.v1.UploadResult.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.UploadResult} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.cc.arduino.cli.commands.v1.UploadResult} + */ +proto.cc.arduino.cli.commands.v1.UploadResult.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new cc_arduino_cli_commands_v1_port_pb.Port; + reader.readMessage(value,cc_arduino_cli_commands_v1_port_pb.Port.deserializeBinaryFromReader); + msg.setUpdatedUploadPort(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.UploadResult.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.cc.arduino.cli.commands.v1.UploadResult.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.UploadResult} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.cc.arduino.cli.commands.v1.UploadResult.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getUpdatedUploadPort(); + if (f != null) { + writer.writeMessage( + 1, + f, + cc_arduino_cli_commands_v1_port_pb.Port.serializeBinaryToWriter + ); + } +}; + + +/** + * optional Port updated_upload_port = 1; + * @return {?proto.cc.arduino.cli.commands.v1.Port} + */ +proto.cc.arduino.cli.commands.v1.UploadResult.prototype.getUpdatedUploadPort = function() { + return /** @type{?proto.cc.arduino.cli.commands.v1.Port} */ ( + jspb.Message.getWrapperField(this, cc_arduino_cli_commands_v1_port_pb.Port, 1)); +}; + + +/** + * @param {?proto.cc.arduino.cli.commands.v1.Port|undefined} value + * @return {!proto.cc.arduino.cli.commands.v1.UploadResult} returns this +*/ +proto.cc.arduino.cli.commands.v1.UploadResult.prototype.setUpdatedUploadPort = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.cc.arduino.cli.commands.v1.UploadResult} returns this + */ +proto.cc.arduino.cli.commands.v1.UploadResult.prototype.clearUpdatedUploadPort = function() { + return this.setUpdatedUploadPort(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.cc.arduino.cli.commands.v1.UploadResult.prototype.hasUpdatedUploadPort = function() { + return jspb.Message.getField(this, 1) != null; }; diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/settings/v1/settings_grpc_pb.d.ts b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/settings/v1/settings_grpc_pb.d.ts index f08b64d21..823aa885e 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/settings/v1/settings_grpc_pb.d.ts +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/settings/v1/settings_grpc_pb.d.ts @@ -14,6 +14,7 @@ interface ISettingsServiceService extends grpc.ServiceDefinition { @@ -61,6 +62,15 @@ interface ISettingsServiceService_IWrite extends grpc.MethodDefinition; responseDeserialize: grpc.deserialize; } +interface ISettingsServiceService_IDelete extends grpc.MethodDefinition { + path: "/cc.arduino.cli.settings.v1.SettingsService/Delete"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} export const SettingsServiceService: ISettingsServiceService; @@ -70,6 +80,7 @@ export interface ISettingsServiceServer { getValue: grpc.handleUnaryCall; setValue: grpc.handleUnaryCall; write: grpc.handleUnaryCall; + delete: grpc.handleUnaryCall; } export interface ISettingsServiceClient { @@ -88,6 +99,9 @@ export interface ISettingsServiceClient { write(request: cc_arduino_cli_settings_v1_settings_pb.WriteRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.WriteResponse) => void): grpc.ClientUnaryCall; write(request: cc_arduino_cli_settings_v1_settings_pb.WriteRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.WriteResponse) => void): grpc.ClientUnaryCall; write(request: cc_arduino_cli_settings_v1_settings_pb.WriteRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.WriteResponse) => void): grpc.ClientUnaryCall; + delete(request: cc_arduino_cli_settings_v1_settings_pb.DeleteRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.DeleteResponse) => void): grpc.ClientUnaryCall; + delete(request: cc_arduino_cli_settings_v1_settings_pb.DeleteRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.DeleteResponse) => void): grpc.ClientUnaryCall; + delete(request: cc_arduino_cli_settings_v1_settings_pb.DeleteRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.DeleteResponse) => void): grpc.ClientUnaryCall; } export class SettingsServiceClient extends grpc.Client implements ISettingsServiceClient { @@ -107,4 +121,7 @@ export class SettingsServiceClient extends grpc.Client implements ISettingsServi public write(request: cc_arduino_cli_settings_v1_settings_pb.WriteRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.WriteResponse) => void): grpc.ClientUnaryCall; public write(request: cc_arduino_cli_settings_v1_settings_pb.WriteRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.WriteResponse) => void): grpc.ClientUnaryCall; public write(request: cc_arduino_cli_settings_v1_settings_pb.WriteRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.WriteResponse) => void): grpc.ClientUnaryCall; + public delete(request: cc_arduino_cli_settings_v1_settings_pb.DeleteRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.DeleteResponse) => void): grpc.ClientUnaryCall; + public delete(request: cc_arduino_cli_settings_v1_settings_pb.DeleteRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.DeleteResponse) => void): grpc.ClientUnaryCall; + public delete(request: cc_arduino_cli_settings_v1_settings_pb.DeleteRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.DeleteResponse) => void): grpc.ClientUnaryCall; } diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/settings/v1/settings_grpc_pb.js b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/settings/v1/settings_grpc_pb.js index fd3549cdc..76c399866 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/settings/v1/settings_grpc_pb.js +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/settings/v1/settings_grpc_pb.js @@ -19,6 +19,28 @@ 'use strict'; var cc_arduino_cli_settings_v1_settings_pb = require('../../../../../cc/arduino/cli/settings/v1/settings_pb.js'); +function serialize_cc_arduino_cli_settings_v1_DeleteRequest(arg) { + if (!(arg instanceof cc_arduino_cli_settings_v1_settings_pb.DeleteRequest)) { + throw new Error('Expected argument of type cc.arduino.cli.settings.v1.DeleteRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_cc_arduino_cli_settings_v1_DeleteRequest(buffer_arg) { + return cc_arduino_cli_settings_v1_settings_pb.DeleteRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_cc_arduino_cli_settings_v1_DeleteResponse(arg) { + if (!(arg instanceof cc_arduino_cli_settings_v1_settings_pb.DeleteResponse)) { + throw new Error('Expected argument of type cc.arduino.cli.settings.v1.DeleteResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_cc_arduino_cli_settings_v1_DeleteResponse(buffer_arg) { + return cc_arduino_cli_settings_v1_settings_pb.DeleteResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + function serialize_cc_arduino_cli_settings_v1_GetAllRequest(arg) { if (!(arg instanceof cc_arduino_cli_settings_v1_settings_pb.GetAllRequest)) { throw new Error('Expected argument of type cc.arduino.cli.settings.v1.GetAllRequest'); @@ -193,5 +215,17 @@ write: { responseSerialize: serialize_cc_arduino_cli_settings_v1_WriteResponse, responseDeserialize: deserialize_cc_arduino_cli_settings_v1_WriteResponse, }, + // Deletes an entry and rewrites the file settings +delete: { + path: '/cc.arduino.cli.settings.v1.SettingsService/Delete', + requestStream: false, + responseStream: false, + requestType: cc_arduino_cli_settings_v1_settings_pb.DeleteRequest, + responseType: cc_arduino_cli_settings_v1_settings_pb.DeleteResponse, + requestSerialize: serialize_cc_arduino_cli_settings_v1_DeleteRequest, + requestDeserialize: deserialize_cc_arduino_cli_settings_v1_DeleteRequest, + responseSerialize: serialize_cc_arduino_cli_settings_v1_DeleteResponse, + responseDeserialize: deserialize_cc_arduino_cli_settings_v1_DeleteResponse, + }, }; diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/settings/v1/settings_pb.d.ts b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/settings/v1/settings_pb.d.ts index 2453b6879..00d5860c1 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/settings/v1/settings_pb.d.ts +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/settings/v1/settings_pb.d.ts @@ -207,3 +207,41 @@ export namespace WriteResponse { export type AsObject = { } } + +export class DeleteRequest extends jspb.Message { + getKey(): string; + setKey(value: string): DeleteRequest; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): DeleteRequest.AsObject; + static toObject(includeInstance: boolean, msg: DeleteRequest): DeleteRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: DeleteRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): DeleteRequest; + static deserializeBinaryFromReader(message: DeleteRequest, reader: jspb.BinaryReader): DeleteRequest; +} + +export namespace DeleteRequest { + export type AsObject = { + key: string, + } +} + +export class DeleteResponse extends jspb.Message { + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): DeleteResponse.AsObject; + static toObject(includeInstance: boolean, msg: DeleteResponse): DeleteResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: DeleteResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): DeleteResponse; + static deserializeBinaryFromReader(message: DeleteResponse, reader: jspb.BinaryReader): DeleteResponse; +} + +export namespace DeleteResponse { + export type AsObject = { + } +} diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/settings/v1/settings_pb.js b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/settings/v1/settings_pb.js index 585bd6473..a00c4ffe8 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/settings/v1/settings_pb.js +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/settings/v1/settings_pb.js @@ -21,6 +21,8 @@ var global = (function() { return Function('return this')(); }.call(null)); +goog.exportSymbol('proto.cc.arduino.cli.settings.v1.DeleteRequest', null, global); +goog.exportSymbol('proto.cc.arduino.cli.settings.v1.DeleteResponse', null, global); goog.exportSymbol('proto.cc.arduino.cli.settings.v1.GetAllRequest', null, global); goog.exportSymbol('proto.cc.arduino.cli.settings.v1.GetAllResponse', null, global); goog.exportSymbol('proto.cc.arduino.cli.settings.v1.GetValueRequest', null, global); @@ -241,6 +243,48 @@ if (goog.DEBUG && !COMPILED) { */ proto.cc.arduino.cli.settings.v1.WriteResponse.displayName = 'proto.cc.arduino.cli.settings.v1.WriteResponse'; } +/** + * 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.settings.v1.DeleteRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.cc.arduino.cli.settings.v1.DeleteRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.cc.arduino.cli.settings.v1.DeleteRequest.displayName = 'proto.cc.arduino.cli.settings.v1.DeleteRequest'; +} +/** + * 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.settings.v1.DeleteResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.cc.arduino.cli.settings.v1.DeleteResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.cc.arduino.cli.settings.v1.DeleteResponse.displayName = 'proto.cc.arduino.cli.settings.v1.DeleteResponse'; +} @@ -1485,4 +1529,235 @@ proto.cc.arduino.cli.settings.v1.WriteResponse.serializeBinaryToWriter = functio }; + + + +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_, 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.settings.v1.DeleteRequest.prototype.toObject = function(opt_includeInstance) { + return proto.cc.arduino.cli.settings.v1.DeleteRequest.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.settings.v1.DeleteRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.cc.arduino.cli.settings.v1.DeleteRequest.toObject = function(includeInstance, msg) { + var f, obj = { + key: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + 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.settings.v1.DeleteRequest} + */ +proto.cc.arduino.cli.settings.v1.DeleteRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.cc.arduino.cli.settings.v1.DeleteRequest; + return proto.cc.arduino.cli.settings.v1.DeleteRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.cc.arduino.cli.settings.v1.DeleteRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.cc.arduino.cli.settings.v1.DeleteRequest} + */ +proto.cc.arduino.cli.settings.v1.DeleteRequest.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.setKey(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.cc.arduino.cli.settings.v1.DeleteRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.cc.arduino.cli.settings.v1.DeleteRequest.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.settings.v1.DeleteRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.cc.arduino.cli.settings.v1.DeleteRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getKey(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string key = 1; + * @return {string} + */ +proto.cc.arduino.cli.settings.v1.DeleteRequest.prototype.getKey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.cc.arduino.cli.settings.v1.DeleteRequest} returns this + */ +proto.cc.arduino.cli.settings.v1.DeleteRequest.prototype.setKey = function(value) { + return jspb.Message.setProto3StringField(this, 1, 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_, 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.settings.v1.DeleteResponse.prototype.toObject = function(opt_includeInstance) { + return proto.cc.arduino.cli.settings.v1.DeleteResponse.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.settings.v1.DeleteResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.cc.arduino.cli.settings.v1.DeleteResponse.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + 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.settings.v1.DeleteResponse} + */ +proto.cc.arduino.cli.settings.v1.DeleteResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.cc.arduino.cli.settings.v1.DeleteResponse; + return proto.cc.arduino.cli.settings.v1.DeleteResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.cc.arduino.cli.settings.v1.DeleteResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.cc.arduino.cli.settings.v1.DeleteResponse} + */ +proto.cc.arduino.cli.settings.v1.DeleteResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.cc.arduino.cli.settings.v1.DeleteResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.cc.arduino.cli.settings.v1.DeleteResponse.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.settings.v1.DeleteResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.cc.arduino.cli.settings.v1.DeleteResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + goog.object.extend(exports, proto.cc.arduino.cli.settings.v1); diff --git a/arduino-ide-extension/src/node/sketches-service-impl.ts b/arduino-ide-extension/src/node/sketches-service-impl.ts index ccf78cc41..95493bb19 100644 --- a/arduino-ide-extension/src/node/sketches-service-impl.ts +++ b/arduino-ide-extension/src/node/sketches-service-impl.ts @@ -128,11 +128,11 @@ export class SketchesServiceImpl uri: string, detectInvalidSketchNameError = true ): Promise { - const { client, instance } = await this.coreClient; + const { client } = await this.coreClient; const req = new LoadSketchRequest(); const requestSketchPath = FileUri.fsPath(uri); req.setSketchPath(requestSketchPath); - req.setInstance(instance); + // TODO: since the instance is not required on the request, can IDE2 do this faster or have a dedicated client for the sketch loading? const stat = new Deferred(); lstat(requestSketchPath, (err, result) => err ? stat.resolve(err) : stat.resolve(result) diff --git a/arduino-ide-extension/src/test/node/core-client-provider.slow-test.ts b/arduino-ide-extension/src/test/node/core-client-provider.slow-test.ts index 8ce8670be..533cca46e 100644 --- a/arduino-ide-extension/src/test/node/core-client-provider.slow-test.ts +++ b/arduino-ide-extension/src/test/node/core-client-provider.slow-test.ts @@ -3,6 +3,7 @@ import type { MaybePromise } from '@theia/core/lib/common/types'; import { FileUri } from '@theia/core/lib/node/file-uri'; import { Container } from '@theia/core/shared/inversify'; import { expect } from 'chai'; +import { dump, load } from 'js-yaml'; import { promises as fs } from 'node:fs'; import { join } from 'node:path'; import { sync as deleteSync } from 'rimraf'; @@ -66,16 +67,11 @@ describe('core-client-provider', () => { const configDirPath = await prepareTestConfigDir(); deleteSync(join(configDirPath, 'data')); - const now = new Date().toISOString(); const container = await startCli(configDirPath, toDispose); await assertFunctionalCli(container, ({ coreClientProvider }) => { const { indexUpdateSummaryBeforeInit } = coreClientProvider; - const libUpdateTimestamp = indexUpdateSummaryBeforeInit['library']; - expect(libUpdateTimestamp).to.be.not.empty; - expect(libUpdateTimestamp.localeCompare(now)).to.be.greaterThan(0); - const platformUpdateTimestamp = indexUpdateSummaryBeforeInit['platform']; - expect(platformUpdateTimestamp).to.be.not.empty; - expect(platformUpdateTimestamp.localeCompare(now)).to.be.greaterThan(0); + expect(indexUpdateSummaryBeforeInit).to.be.not.undefined; + expect(indexUpdateSummaryBeforeInit).to.be.empty; }); }); @@ -90,14 +86,11 @@ describe('core-client-provider', () => { ); deleteSync(primaryPackageIndexPath); - const now = new Date().toISOString(); const container = await startCli(configDirPath, toDispose); await assertFunctionalCli(container, ({ coreClientProvider }) => { const { indexUpdateSummaryBeforeInit } = coreClientProvider; - expect(indexUpdateSummaryBeforeInit['library']).to.be.undefined; - const platformUpdateTimestamp = indexUpdateSummaryBeforeInit['platform']; - expect(platformUpdateTimestamp).to.be.not.empty; - expect(platformUpdateTimestamp.localeCompare(now)).to.be.greaterThan(0); + expect(indexUpdateSummaryBeforeInit).to.be.not.undefined; + expect(indexUpdateSummaryBeforeInit).to.be.empty; }); const rawJson = await fs.readFile(primaryPackageIndexPath, { encoding: 'utf8', @@ -149,14 +142,11 @@ describe('core-client-provider', () => { ); deleteSync(libraryPackageIndexPath); - const now = new Date().toISOString(); const container = await startCli(configDirPath, toDispose); await assertFunctionalCli(container, ({ coreClientProvider }) => { const { indexUpdateSummaryBeforeInit } = coreClientProvider; - const libUpdateTimestamp = indexUpdateSummaryBeforeInit['library']; - expect(libUpdateTimestamp).to.be.not.empty; - expect(libUpdateTimestamp.localeCompare(now)).to.be.greaterThan(0); - expect(indexUpdateSummaryBeforeInit['platform']).to.be.undefined; + expect(indexUpdateSummaryBeforeInit).to.be.not.undefined; + expect(indexUpdateSummaryBeforeInit).to.be.empty; }); const rawJson = await fs.readFile(libraryPackageIndexPath, { encoding: 'utf8', @@ -191,20 +181,38 @@ describe('core-client-provider', () => { const container = await startCli(configDirPath, toDispose); await assertFunctionalCli( container, - async ({ coreClientProvider, boardsService, coreService }) => { + async ({ coreClientProvider, boardsService }) => { const { indexUpdateSummaryBeforeInit } = coreClientProvider; expect(indexUpdateSummaryBeforeInit).to.be.not.undefined; expect(indexUpdateSummaryBeforeInit).to.be.empty; - - // IDE2 cannot recover from a 3rd party package index issue. - // Only when the primary package or library index is corrupt. - // https://github.com/arduino/arduino-ide/issues/2021 - await coreService.updateIndex({ types: ['platform'] }); - await assertTeensyAvailable(boardsService); } ); }); + + it("should recover when invalid 3rd package URL is defined in the CLI config and the 'directories.data' folder is missing", async function () { + this.timeout(timeout); + const configDirPath = await prepareTestConfigDir(); + deleteSync(join(configDirPath, 'data')); + + // set an invalid URL so the CLI will try to download it + const cliConfigPath = join(configDirPath, 'arduino-cli.yaml'); + const rawYaml = await fs.readFile(cliConfigPath, { encoding: 'utf8' }); + const config: DefaultCliConfig = load(rawYaml); + expect(config.board_manager).to.be.undefined; + config.board_manager = { additional_urls: ['https://invalidUrl'] }; + expect(config.board_manager?.additional_urls?.[0]).to.be.equal( + 'https://invalidUrl' + ); + await fs.writeFile(cliConfigPath, dump(config)); + + const container = await startCli(configDirPath, toDispose); + await assertFunctionalCli(container, ({ coreClientProvider }) => { + const { indexUpdateSummaryBeforeInit } = coreClientProvider; + expect(indexUpdateSummaryBeforeInit).to.be.not.undefined; + expect(indexUpdateSummaryBeforeInit).to.be.empty; + }); + }); }); interface Services { @@ -277,7 +285,7 @@ async function prepareTestConfigDir( const params = { configDirPath: newTempConfigDirPath(), configOverrides }; const container = await createContainer(params); const daemon = container.get(ArduinoDaemonImpl); - const cliPath = await daemon.getExecPath(); + const cliPath = daemon.getExecPath(); const configDirUriProvider = container.get(ConfigDirUriProvider); const configDirPath = FileUri.fsPath(configDirUriProvider.configDirUri());