diff --git a/arduino-ide-extension/package.json b/arduino-ide-extension/package.json index abe0caa88..0ee49a0a0 100644 --- a/arduino-ide-extension/package.json +++ b/arduino-ide-extension/package.json @@ -138,7 +138,7 @@ ], "arduino": { "cli": { - "version": "0.18.3" + "version": "0.19.1" }, "fwuploader": { "version": "2.0.0" diff --git a/arduino-ide-extension/src/browser/contributions/burn-bootloader.ts b/arduino-ide-extension/src/browser/contributions/burn-bootloader.ts index 0664476fc..10f7c26d1 100644 --- a/arduino-ide-extension/src/browser/contributions/burn-bootloader.ts +++ b/arduino-ide-extension/src/browser/contributions/burn-bootloader.ts @@ -50,7 +50,7 @@ export class BurnBootloader extends SketchContribution { } try { const { boardsConfig } = this.boardsServiceClientImpl; - const port = boardsConfig.selectedPort?.address; + const port = boardsConfig.selectedPort; const [fqbn, { selectedProgrammer: programmer }, verify, verbose] = await Promise.all([ this.boardsDataStore.appendConfigToFqbn( diff --git a/arduino-ide-extension/src/browser/contributions/upload-sketch.ts b/arduino-ide-extension/src/browser/contributions/upload-sketch.ts index a704c97ab..607831521 100644 --- a/arduino-ide-extension/src/browser/contributions/upload-sketch.ts +++ b/arduino-ide-extension/src/browser/contributions/upload-sketch.ts @@ -130,7 +130,7 @@ export class UploadSketch extends SketchContribution { const sketchUri = sketch.uri; const optimizeForDebug = this.editorMode.compileForDebug; const { selectedPort } = boardsConfig; - const port = selectedPort?.address; + const port = selectedPort; if (usingProgrammer) { const programmer = selectedProgrammer; diff --git a/arduino-ide-extension/src/common/protocol/core-service.ts b/arduino-ide-extension/src/common/protocol/core-service.ts index c6e388230..1454ffbd2 100644 --- a/arduino-ide-extension/src/common/protocol/core-service.ts +++ b/arduino-ide-extension/src/common/protocol/core-service.ts @@ -1,3 +1,4 @@ +import { Port } from '../../common/protocol/boards-service'; import { Programmer } from './boards-service'; export const CompilerWarningLiterals = [ @@ -39,7 +40,7 @@ export namespace CoreService { export namespace Upload { export interface Options extends Compile.Options { - readonly port?: string | undefined; + readonly port?: Port | undefined; readonly programmer?: Programmer | undefined; readonly verify: boolean; } @@ -48,7 +49,7 @@ export namespace CoreService { export namespace Bootloader { export interface Options { readonly fqbn?: string | undefined; - readonly port?: string | undefined; + readonly port?: Port | undefined; readonly programmer?: Programmer | undefined; readonly verbose: boolean; readonly verify: boolean; diff --git a/arduino-ide-extension/src/node/board-discovery.ts b/arduino-ide-extension/src/node/board-discovery.ts index 3eee3cd08..d168aea2e 100644 --- a/arduino-ide-extension/src/node/board-discovery.ts +++ b/arduino-ide-extension/src/node/board-discovery.ts @@ -2,7 +2,7 @@ import { injectable, inject, postConstruct, named } from 'inversify'; import { ClientDuplexStream } from '@grpc/grpc-js'; import { ILogger } from '@theia/core/lib/common/logger'; import { deepClone } from '@theia/core/lib/common/objects'; -import { CoreClientAware } from './core-client-provider'; +import { CoreClientAware, CoreClientProvider } from './core-client-provider'; import { BoardListWatchRequest, BoardListWatchResponse, @@ -29,6 +29,10 @@ export class BoardDiscovery extends CoreClientAware { @inject(NotificationServiceServer) protected readonly notificationService: NotificationServiceServer; + // Used to know if the board watch process is already running to avoid + // starting it multiple times + private watching: boolean; + protected boardWatchDuplex: | ClientDuplexStream | undefined; @@ -51,11 +55,26 @@ export class BoardDiscovery extends CoreClientAware { @postConstruct() protected async init(): Promise { + await this.coreClientProvider.initialized; const coreClient = await this.coreClient(); + this.startBoardListWatch(coreClient); + } + + startBoardListWatch(coreClient: CoreClientProvider.Client): void { + if (this.watching) { + // We want to avoid starting the board list watch process multiple + // times to meet unforseen consequences + return + } + this.watching = true; const { client, instance } = coreClient; const req = new BoardListWatchRequest(); req.setInstance(instance); this.boardWatchDuplex = client.boardListWatch(); + this.boardWatchDuplex.on('end', () => { + this.watching = false; + console.info('board watch ended') + }) this.boardWatchDuplex.on('data', (resp: BoardListWatchResponse) => { const detectedPort = resp.getPort(); if (detectedPort) { @@ -75,12 +94,14 @@ export class BoardDiscovery extends CoreClientAware { const oldState = deepClone(this._state); const newState = deepClone(this._state); - const address = detectedPort.getAddress(); - const protocol = Port.Protocol.toProtocol(detectedPort.getProtocol()); + const address = (detectedPort as any).getPort().getAddress(); + const protocol = Port.Protocol.toProtocol( + (detectedPort as any).getPort().getProtocol() + ); // const label = detectedPort.getProtocolLabel(); const port = { address, protocol }; const boards: Board[] = []; - for (const item of detectedPort.getBoardsList()) { + for (const item of detectedPort.getMatchingBoardsList()) { boards.push({ fqbn: item.getFqbn(), name: item.getName() || 'unknown', @@ -92,9 +113,7 @@ export class BoardDiscovery extends CoreClientAware { if (newState[port.address] !== undefined) { const [, knownBoards] = newState[port.address]; console.warn( - `Port '${ - port.address - }' was already available. Known boards before override: ${JSON.stringify( + `Port '${port.address}' was already available. Known boards before override: ${JSON.stringify( knownBoards )}` ); diff --git a/arduino-ide-extension/src/node/boards-service-impl.ts b/arduino-ide-extension/src/node/boards-service-impl.ts index 8cb6bf75a..20dfdc6ef 100644 --- a/arduino-ide-extension/src/node/boards-service-impl.ts +++ b/arduino-ide-extension/src/node/boards-service-impl.ts @@ -42,8 +42,7 @@ import { InstallWithProgress } from './grpc-installable'; @injectable() export class BoardsServiceImpl extends CoreClientAware - implements BoardsService -{ + implements BoardsService { @inject(ILogger) protected logger: ILogger; @@ -75,6 +74,7 @@ export class BoardsServiceImpl async getBoardDetails(options: { fqbn: string; }): Promise { + await this.coreClientProvider.initialized; const coreClient = await this.coreClient(); const { client, instance } = coreClient; const { fqbn } = options; @@ -165,13 +165,13 @@ export class BoardsServiceImpl let VID = 'N/A'; let PID = 'N/A'; - const usbId = detailsResp - .getIdentificationPrefsList() - .map((item) => item.getUsbId()) + const prop = detailsResp + .getIdentificationPropertiesList() + .map((item) => item.getPropertiesMap()) .find(notEmpty); - if (usbId) { - VID = usbId.getVid(); - PID = usbId.getPid(); + if (prop) { + VID = prop.get('vid') || ''; + PID = prop.get('pid') || ''; } return { @@ -214,6 +214,7 @@ export class BoardsServiceImpl }: { query?: string; }): Promise { + await this.coreClientProvider.initialized; const { instance, client } = await this.coreClient(); const req = new BoardSearchRequest(); req.setSearchArgs(query || ''); @@ -244,6 +245,7 @@ export class BoardsServiceImpl } async search(options: { query?: string }): Promise { + await this.coreClientProvider.initialized; const coreClient = await this.coreClient(); const { client, instance } = coreClient; @@ -361,6 +363,7 @@ export class BoardsServiceImpl const version = !!options.version ? options.version : item.availableVersions[0]; + await this.coreClientProvider.initialized; const coreClient = await this.coreClient(); const { client, instance } = coreClient; @@ -382,7 +385,10 @@ export class BoardsServiceImpl }) ); await new Promise((resolve, reject) => { - resp.on('end', resolve); + resp.on('end', () => { + this.boardDiscovery.startBoardListWatch(coreClient) + resolve(); + }); resp.on('error', (error) => { this.responseService.appendToOutput({ chunk: `Failed to install platform: ${item.id}.\n`, @@ -406,6 +412,7 @@ export class BoardsServiceImpl progressId?: string; }): Promise { const { item, progressId } = options; + await this.coreClientProvider.initialized; const coreClient = await this.coreClient(); const { client, instance } = coreClient; @@ -426,7 +433,10 @@ export class BoardsServiceImpl }) ); await new Promise((resolve, reject) => { - resp.on('end', resolve); + resp.on('end', () => { + this.boardDiscovery.startBoardListWatch(coreClient) + resolve(); + }); resp.on('error', reject); }); diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/board_pb.d.ts b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/board_pb.d.ts index ce15a5986..b8e1e2cf9 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/board_pb.d.ts +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/board_pb.d.ts @@ -6,6 +6,7 @@ import * as jspb from "google-protobuf"; import * as cc_arduino_cli_commands_v1_common_pb from "../../../../../cc/arduino/cli/commands/v1/common_pb"; +import * as cc_arduino_cli_commands_v1_port_pb from "../../../../../cc/arduino/cli/commands/v1/port_pb"; export class BoardDetailsRequest extends jspb.Message { @@ -79,11 +80,6 @@ export class BoardDetailsResponse extends jspb.Message { setConfigOptionsList(value: Array): BoardDetailsResponse; addConfigOptions(value?: ConfigOption, index?: number): ConfigOption; - clearIdentificationPrefsList(): void; - getIdentificationPrefsList(): Array; - setIdentificationPrefsList(value: Array): BoardDetailsResponse; - addIdentificationPrefs(value?: IdentificationPref, index?: number): IdentificationPref; - clearProgrammersList(): void; getProgrammersList(): Array; setProgrammersList(value: Array): BoardDetailsResponse; @@ -92,6 +88,11 @@ export class BoardDetailsResponse extends jspb.Message { getDebuggingSupported(): boolean; setDebuggingSupported(value: boolean): BoardDetailsResponse; + clearIdentificationPropertiesList(): void; + getIdentificationPropertiesList(): Array; + setIdentificationPropertiesList(value: Array): BoardDetailsResponse; + addIdentificationProperties(value?: BoardIdentificationProperties, index?: number): BoardIdentificationProperties; + serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): BoardDetailsResponse.AsObject; @@ -116,58 +117,32 @@ export namespace BoardDetailsResponse { platform?: BoardPlatform.AsObject, toolsDependenciesList: Array, configOptionsList: Array, - identificationPrefsList: Array, programmersList: Array, debuggingSupported: boolean, + identificationPropertiesList: Array, } } -export class IdentificationPref extends jspb.Message { +export class BoardIdentificationProperties extends jspb.Message { - hasUsbId(): boolean; - clearUsbId(): void; - getUsbId(): USBID | undefined; - setUsbId(value?: USBID): IdentificationPref; + getPropertiesMap(): jspb.Map; + clearPropertiesMap(): void; serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): IdentificationPref.AsObject; - static toObject(includeInstance: boolean, msg: IdentificationPref): IdentificationPref.AsObject; + toObject(includeInstance?: boolean): BoardIdentificationProperties.AsObject; + static toObject(includeInstance: boolean, msg: BoardIdentificationProperties): BoardIdentificationProperties.AsObject; static extensions: {[key: number]: jspb.ExtensionFieldInfo}; static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: IdentificationPref, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): IdentificationPref; - static deserializeBinaryFromReader(message: IdentificationPref, reader: jspb.BinaryReader): IdentificationPref; + static serializeBinaryToWriter(message: BoardIdentificationProperties, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): BoardIdentificationProperties; + static deserializeBinaryFromReader(message: BoardIdentificationProperties, reader: jspb.BinaryReader): BoardIdentificationProperties; } -export namespace IdentificationPref { +export namespace BoardIdentificationProperties { export type AsObject = { - usbId?: USBID.AsObject, - } -} - -export class USBID extends jspb.Message { - getVid(): string; - setVid(value: string): USBID; - - getPid(): string; - setPid(value: string): USBID; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): USBID.AsObject; - static toObject(includeInstance: boolean, msg: USBID): USBID.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: USBID, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): USBID; - static deserializeBinaryFromReader(message: USBID, reader: jspb.BinaryReader): USBID; -} - -export namespace USBID { - export type AsObject = { - vid: string, - pid: string, + propertiesMap: Array<[string, string]>, } } @@ -480,6 +455,9 @@ export class BoardListRequest extends jspb.Message { getInstance(): cc_arduino_cli_commands_v1_common_pb.Instance | undefined; setInstance(value?: cc_arduino_cli_commands_v1_common_pb.Instance): BoardListRequest; + getTimeout(): number; + setTimeout(value: number): BoardListRequest; + serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): BoardListRequest.AsObject; @@ -494,6 +472,7 @@ export class BoardListRequest extends jspb.Message { export namespace BoardListRequest { export type AsObject = { instance?: cc_arduino_cli_commands_v1_common_pb.Instance.AsObject, + timeout: number, } } @@ -521,22 +500,16 @@ export namespace BoardListResponse { } export class DetectedPort extends jspb.Message { - getAddress(): string; - setAddress(value: string): DetectedPort; - - getProtocol(): string; - setProtocol(value: string): DetectedPort; - - getProtocolLabel(): string; - setProtocolLabel(value: string): DetectedPort; + clearMatchingBoardsList(): void; + getMatchingBoardsList(): Array; + setMatchingBoardsList(value: Array): DetectedPort; + addMatchingBoards(value?: BoardListItem, index?: number): BoardListItem; - clearBoardsList(): void; - getBoardsList(): Array; - setBoardsList(value: Array): DetectedPort; - addBoards(value?: BoardListItem, index?: number): BoardListItem; - getSerialNumber(): string; - setSerialNumber(value: string): DetectedPort; + hasPort(): boolean; + clearPort(): void; + getPort(): cc_arduino_cli_commands_v1_port_pb.Port | undefined; + setPort(value?: cc_arduino_cli_commands_v1_port_pb.Port): DetectedPort; serializeBinary(): Uint8Array; @@ -551,11 +524,8 @@ export class DetectedPort extends jspb.Message { export namespace DetectedPort { export type AsObject = { - address: string, - protocol: string, - protocolLabel: string, - boardsList: Array, - serialNumber: string, + matchingBoardsList: Array, + port?: cc_arduino_cli_commands_v1_port_pb.Port.AsObject, } } @@ -686,12 +656,6 @@ export class BoardListItem extends jspb.Message { getIsHidden(): boolean; setIsHidden(value: boolean): BoardListItem; - getVid(): string; - setVid(value: string): BoardListItem; - - getPid(): string; - setPid(value: string): BoardListItem; - hasPlatform(): boolean; clearPlatform(): void; @@ -714,8 +678,6 @@ export namespace BoardListItem { name: string, fqbn: string, isHidden: boolean, - vid: string, - pid: string, platform?: cc_arduino_cli_commands_v1_common_pb.Platform.AsObject, } } @@ -773,4 +735,4 @@ export namespace BoardSearchResponse { export type AsObject = { boardsList: Array, } -} +} \ No newline at end of file diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/board_pb.js b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/board_pb.js index 5782236ee..d498dc1ce 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/board_pb.js +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/board_pb.js @@ -17,10 +17,13 @@ var global = Function('return this')(); var cc_arduino_cli_commands_v1_common_pb = require('../../../../../cc/arduino/cli/commands/v1/common_pb.js'); goog.object.extend(proto, cc_arduino_cli_commands_v1_common_pb); +var cc_arduino_cli_commands_v1_port_pb = require('../../../../../cc/arduino/cli/commands/v1/port_pb.js'); +goog.object.extend(proto, cc_arduino_cli_commands_v1_port_pb); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.BoardAttachRequest', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.BoardAttachResponse', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.BoardDetailsRequest', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.BoardDetailsResponse', null, global); +goog.exportSymbol('proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.BoardListAllRequest', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.BoardListAllResponse', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.BoardListItem', null, global); @@ -35,11 +38,9 @@ goog.exportSymbol('proto.cc.arduino.cli.commands.v1.ConfigOption', null, global) goog.exportSymbol('proto.cc.arduino.cli.commands.v1.ConfigValue', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.DetectedPort', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.Help', null, global); -goog.exportSymbol('proto.cc.arduino.cli.commands.v1.IdentificationPref', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.Package', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.Systems', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.ToolsDependencies', null, global); -goog.exportSymbol('proto.cc.arduino.cli.commands.v1.USBID', null, global); /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -92,37 +93,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.cc.arduino.cli.commands.v1.IdentificationPref = function(opt_data) { +proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.cc.arduino.cli.commands.v1.IdentificationPref, jspb.Message); +goog.inherits(proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.cc.arduino.cli.commands.v1.IdentificationPref.displayName = 'proto.cc.arduino.cli.commands.v1.IdentificationPref'; -} -/** - * 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.USBID = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.cc.arduino.cli.commands.v1.USBID, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.cc.arduino.cli.commands.v1.USBID.displayName = 'proto.cc.arduino.cli.commands.v1.USBID'; + proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties.displayName = 'proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties'; } /** * Generated by JsPbCodeGenerator. @@ -710,7 +690,7 @@ proto.cc.arduino.cli.commands.v1.BoardDetailsRequest.prototype.setFqbn = functio * @private {!Array} * @const */ -proto.cc.arduino.cli.commands.v1.BoardDetailsResponse.repeatedFields_ = [10,11,12,13]; +proto.cc.arduino.cli.commands.v1.BoardDetailsResponse.repeatedFields_ = [10,11,13,15]; @@ -756,11 +736,11 @@ proto.cc.arduino.cli.commands.v1.BoardDetailsResponse.toObject = function(includ proto.cc.arduino.cli.commands.v1.ToolsDependencies.toObject, includeInstance), configOptionsList: jspb.Message.toObjectList(msg.getConfigOptionsList(), proto.cc.arduino.cli.commands.v1.ConfigOption.toObject, includeInstance), - identificationPrefsList: jspb.Message.toObjectList(msg.getIdentificationPrefsList(), - proto.cc.arduino.cli.commands.v1.IdentificationPref.toObject, includeInstance), programmersList: jspb.Message.toObjectList(msg.getProgrammersList(), cc_arduino_cli_commands_v1_common_pb.Programmer.toObject, includeInstance), - debuggingSupported: jspb.Message.getBooleanFieldWithDefault(msg, 14, false) + debuggingSupported: jspb.Message.getBooleanFieldWithDefault(msg, 14, false), + identificationPropertiesList: jspb.Message.toObjectList(msg.getIdentificationPropertiesList(), + proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties.toObject, includeInstance) }; if (includeInstance) { @@ -845,11 +825,6 @@ proto.cc.arduino.cli.commands.v1.BoardDetailsResponse.deserializeBinaryFromReade reader.readMessage(value,proto.cc.arduino.cli.commands.v1.ConfigOption.deserializeBinaryFromReader); msg.addConfigOptions(value); break; - case 12: - var value = new proto.cc.arduino.cli.commands.v1.IdentificationPref; - reader.readMessage(value,proto.cc.arduino.cli.commands.v1.IdentificationPref.deserializeBinaryFromReader); - msg.addIdentificationPrefs(value); - break; case 13: var value = new cc_arduino_cli_commands_v1_common_pb.Programmer; reader.readMessage(value,cc_arduino_cli_commands_v1_common_pb.Programmer.deserializeBinaryFromReader); @@ -859,6 +834,11 @@ proto.cc.arduino.cli.commands.v1.BoardDetailsResponse.deserializeBinaryFromReade var value = /** @type {boolean} */ (reader.readBool()); msg.setDebuggingSupported(value); break; + case 15: + var value = new proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties; + reader.readMessage(value,proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties.deserializeBinaryFromReader); + msg.addIdentificationProperties(value); + break; default: reader.skipField(); break; @@ -969,14 +949,6 @@ proto.cc.arduino.cli.commands.v1.BoardDetailsResponse.serializeBinaryToWriter = proto.cc.arduino.cli.commands.v1.ConfigOption.serializeBinaryToWriter ); } - f = message.getIdentificationPrefsList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 12, - f, - proto.cc.arduino.cli.commands.v1.IdentificationPref.serializeBinaryToWriter - ); - } f = message.getProgrammersList(); if (f.length > 0) { writer.writeRepeatedMessage( @@ -992,6 +964,14 @@ proto.cc.arduino.cli.commands.v1.BoardDetailsResponse.serializeBinaryToWriter = f ); } + f = message.getIdentificationPropertiesList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 15, + f, + proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties.serializeBinaryToWriter + ); + } }; @@ -1271,44 +1251,6 @@ proto.cc.arduino.cli.commands.v1.BoardDetailsResponse.prototype.clearConfigOptio }; -/** - * repeated IdentificationPref identification_prefs = 12; - * @return {!Array} - */ -proto.cc.arduino.cli.commands.v1.BoardDetailsResponse.prototype.getIdentificationPrefsList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.cc.arduino.cli.commands.v1.IdentificationPref, 12)); -}; - - -/** - * @param {!Array} value - * @return {!proto.cc.arduino.cli.commands.v1.BoardDetailsResponse} returns this -*/ -proto.cc.arduino.cli.commands.v1.BoardDetailsResponse.prototype.setIdentificationPrefsList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 12, value); -}; - - -/** - * @param {!proto.cc.arduino.cli.commands.v1.IdentificationPref=} opt_value - * @param {number=} opt_index - * @return {!proto.cc.arduino.cli.commands.v1.IdentificationPref} - */ -proto.cc.arduino.cli.commands.v1.BoardDetailsResponse.prototype.addIdentificationPrefs = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 12, opt_value, proto.cc.arduino.cli.commands.v1.IdentificationPref, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.cc.arduino.cli.commands.v1.BoardDetailsResponse} returns this - */ -proto.cc.arduino.cli.commands.v1.BoardDetailsResponse.prototype.clearIdentificationPrefsList = function() { - return this.setIdentificationPrefsList([]); -}; - - /** * repeated Programmer programmers = 13; * @return {!Array} @@ -1365,154 +1307,41 @@ proto.cc.arduino.cli.commands.v1.BoardDetailsResponse.prototype.setDebuggingSupp }; - - - -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.IdentificationPref.prototype.toObject = function(opt_includeInstance) { - return proto.cc.arduino.cli.commands.v1.IdentificationPref.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.IdentificationPref} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.cc.arduino.cli.commands.v1.IdentificationPref.toObject = function(includeInstance, msg) { - var f, obj = { - usbId: (f = msg.getUsbId()) && proto.cc.arduino.cli.commands.v1.USBID.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.IdentificationPref} - */ -proto.cc.arduino.cli.commands.v1.IdentificationPref.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.cc.arduino.cli.commands.v1.IdentificationPref; - return proto.cc.arduino.cli.commands.v1.IdentificationPref.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.IdentificationPref} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.cc.arduino.cli.commands.v1.IdentificationPref} + * repeated BoardIdentificationProperties identification_properties = 15; + * @return {!Array} */ -proto.cc.arduino.cli.commands.v1.IdentificationPref.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.cc.arduino.cli.commands.v1.USBID; - reader.readMessage(value,proto.cc.arduino.cli.commands.v1.USBID.deserializeBinaryFromReader); - msg.setUsbId(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; +proto.cc.arduino.cli.commands.v1.BoardDetailsResponse.prototype.getIdentificationPropertiesList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties, 15)); }; /** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.cc.arduino.cli.commands.v1.IdentificationPref.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.cc.arduino.cli.commands.v1.IdentificationPref.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.IdentificationPref} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.cc.arduino.cli.commands.v1.IdentificationPref.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getUsbId(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.cc.arduino.cli.commands.v1.USBID.serializeBinaryToWriter - ); - } -}; - - -/** - * optional USBID usb_id = 1; - * @return {?proto.cc.arduino.cli.commands.v1.USBID} - */ -proto.cc.arduino.cli.commands.v1.IdentificationPref.prototype.getUsbId = function() { - return /** @type{?proto.cc.arduino.cli.commands.v1.USBID} */ ( - jspb.Message.getWrapperField(this, proto.cc.arduino.cli.commands.v1.USBID, 1)); -}; - - -/** - * @param {?proto.cc.arduino.cli.commands.v1.USBID|undefined} value - * @return {!proto.cc.arduino.cli.commands.v1.IdentificationPref} returns this + * @param {!Array} value + * @return {!proto.cc.arduino.cli.commands.v1.BoardDetailsResponse} returns this */ -proto.cc.arduino.cli.commands.v1.IdentificationPref.prototype.setUsbId = function(value) { - return jspb.Message.setWrapperField(this, 1, value); +proto.cc.arduino.cli.commands.v1.BoardDetailsResponse.prototype.setIdentificationPropertiesList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 15, value); }; /** - * Clears the message field making it undefined. - * @return {!proto.cc.arduino.cli.commands.v1.IdentificationPref} returns this + * @param {!proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties=} opt_value + * @param {number=} opt_index + * @return {!proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties} */ -proto.cc.arduino.cli.commands.v1.IdentificationPref.prototype.clearUsbId = function() { - return this.setUsbId(undefined); +proto.cc.arduino.cli.commands.v1.BoardDetailsResponse.prototype.addIdentificationProperties = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 15, opt_value, proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties, opt_index); }; /** - * Returns whether this field is set. - * @return {boolean} + * Clears the list making it empty but non-null. + * @return {!proto.cc.arduino.cli.commands.v1.BoardDetailsResponse} returns this */ -proto.cc.arduino.cli.commands.v1.IdentificationPref.prototype.hasUsbId = function() { - return jspb.Message.getField(this, 1) != null; +proto.cc.arduino.cli.commands.v1.BoardDetailsResponse.prototype.clearIdentificationPropertiesList = function() { + return this.setIdentificationPropertiesList([]); }; @@ -1532,8 +1361,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.cc.arduino.cli.commands.v1.USBID.prototype.toObject = function(opt_includeInstance) { - return proto.cc.arduino.cli.commands.v1.USBID.toObject(opt_includeInstance, this); +proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties.prototype.toObject = function(opt_includeInstance) { + return proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties.toObject(opt_includeInstance, this); }; @@ -1542,14 +1371,13 @@ proto.cc.arduino.cli.commands.v1.USBID.prototype.toObject = function(opt_include * @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.USBID} msg The msg instance to transform. + * @param {!proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.cc.arduino.cli.commands.v1.USBID.toObject = function(includeInstance, msg) { +proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties.toObject = function(includeInstance, msg) { var f, obj = { - vid: jspb.Message.getFieldWithDefault(msg, 1, ""), - pid: jspb.Message.getFieldWithDefault(msg, 2, "") + propertiesMap: (f = msg.getPropertiesMap()) ? f.toObject(includeInstance, undefined) : [] }; if (includeInstance) { @@ -1563,23 +1391,23 @@ proto.cc.arduino.cli.commands.v1.USBID.toObject = function(includeInstance, msg) /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.cc.arduino.cli.commands.v1.USBID} + * @return {!proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties} */ -proto.cc.arduino.cli.commands.v1.USBID.deserializeBinary = function(bytes) { +proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.cc.arduino.cli.commands.v1.USBID; - return proto.cc.arduino.cli.commands.v1.USBID.deserializeBinaryFromReader(msg, reader); + var msg = new proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties; + return proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties.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.USBID} msg The message object to deserialize into. + * @param {!proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.cc.arduino.cli.commands.v1.USBID} + * @return {!proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties} */ -proto.cc.arduino.cli.commands.v1.USBID.deserializeBinaryFromReader = function(msg, reader) { +proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -1587,12 +1415,10 @@ proto.cc.arduino.cli.commands.v1.USBID.deserializeBinaryFromReader = function(ms var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setVid(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setPid(value); + var value = msg.getPropertiesMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); break; default: reader.skipField(); @@ -1607,9 +1433,9 @@ proto.cc.arduino.cli.commands.v1.USBID.deserializeBinaryFromReader = function(ms * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.cc.arduino.cli.commands.v1.USBID.prototype.serializeBinary = function() { +proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.cc.arduino.cli.commands.v1.USBID.serializeBinaryToWriter(this, writer); + proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -1617,63 +1443,39 @@ proto.cc.arduino.cli.commands.v1.USBID.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.cc.arduino.cli.commands.v1.USBID} message + * @param {!proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.cc.arduino.cli.commands.v1.USBID.serializeBinaryToWriter = function(message, writer) { +proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getVid(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getPid(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); + f = message.getPropertiesMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); } }; /** - * optional string vid = 1; - * @return {string} + * map properties = 1; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} */ -proto.cc.arduino.cli.commands.v1.USBID.prototype.getVid = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties.prototype.getPropertiesMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 1, opt_noLazyCreate, + null)); }; /** - * @param {string} value - * @return {!proto.cc.arduino.cli.commands.v1.USBID} returns this + * Clears values from the map. The map will be non-null. + * @return {!proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties} returns this */ -proto.cc.arduino.cli.commands.v1.USBID.prototype.setVid = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string pid = 2; - * @return {string} - */ -proto.cc.arduino.cli.commands.v1.USBID.prototype.getPid = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.cc.arduino.cli.commands.v1.USBID} returns this - */ -proto.cc.arduino.cli.commands.v1.USBID.prototype.setPid = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; +proto.cc.arduino.cli.commands.v1.BoardIdentificationProperties.prototype.clearPropertiesMap = function() { + this.getPropertiesMap().clear(); + return this;}; @@ -3751,7 +3553,8 @@ proto.cc.arduino.cli.commands.v1.BoardListRequest.prototype.toObject = function( */ proto.cc.arduino.cli.commands.v1.BoardListRequest.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), + timeout: jspb.Message.getFieldWithDefault(msg, 2, 0) }; if (includeInstance) { @@ -3793,6 +3596,10 @@ proto.cc.arduino.cli.commands.v1.BoardListRequest.deserializeBinaryFromReader = reader.readMessage(value,cc_arduino_cli_commands_v1_common_pb.Instance.deserializeBinaryFromReader); msg.setInstance(value); break; + case 2: + var value = /** @type {number} */ (reader.readInt64()); + msg.setTimeout(value); + break; default: reader.skipField(); break; @@ -3830,6 +3637,13 @@ proto.cc.arduino.cli.commands.v1.BoardListRequest.serializeBinaryToWriter = func cc_arduino_cli_commands_v1_common_pb.Instance.serializeBinaryToWriter ); } + f = message.getTimeout(); + if (f !== 0) { + writer.writeInt64( + 2, + f + ); + } }; @@ -3870,6 +3684,24 @@ proto.cc.arduino.cli.commands.v1.BoardListRequest.prototype.hasInstance = functi }; +/** + * optional int64 timeout = 2; + * @return {number} + */ +proto.cc.arduino.cli.commands.v1.BoardListRequest.prototype.getTimeout = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.cc.arduino.cli.commands.v1.BoardListRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.BoardListRequest.prototype.setTimeout = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + /** * List of repeated fields within this message type. @@ -4036,7 +3868,7 @@ proto.cc.arduino.cli.commands.v1.BoardListResponse.prototype.clearPortsList = fu * @private {!Array} * @const */ -proto.cc.arduino.cli.commands.v1.DetectedPort.repeatedFields_ = [4]; +proto.cc.arduino.cli.commands.v1.DetectedPort.repeatedFields_ = [1]; @@ -4069,12 +3901,9 @@ proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.toObject = function(opt_ */ proto.cc.arduino.cli.commands.v1.DetectedPort.toObject = function(includeInstance, msg) { var f, obj = { - address: jspb.Message.getFieldWithDefault(msg, 1, ""), - protocol: jspb.Message.getFieldWithDefault(msg, 2, ""), - protocolLabel: jspb.Message.getFieldWithDefault(msg, 3, ""), - boardsList: jspb.Message.toObjectList(msg.getBoardsList(), + matchingBoardsList: jspb.Message.toObjectList(msg.getMatchingBoardsList(), proto.cc.arduino.cli.commands.v1.BoardListItem.toObject, includeInstance), - serialNumber: jspb.Message.getFieldWithDefault(msg, 5, "") + port: (f = msg.getPort()) && cc_arduino_cli_commands_v1_port_pb.Port.toObject(includeInstance, f) }; if (includeInstance) { @@ -4112,25 +3941,14 @@ proto.cc.arduino.cli.commands.v1.DetectedPort.deserializeBinaryFromReader = func var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setAddress(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setProtocol(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setProtocolLabel(value); - break; - case 4: var value = new proto.cc.arduino.cli.commands.v1.BoardListItem; reader.readMessage(value,proto.cc.arduino.cli.commands.v1.BoardListItem.deserializeBinaryFromReader); - msg.addBoards(value); + msg.addMatchingBoards(value); break; - case 5: - var value = /** @type {string} */ (reader.readString()); - msg.setSerialNumber(value); + case 2: + var value = new cc_arduino_cli_commands_v1_port_pb.Port; + reader.readMessage(value,cc_arduino_cli_commands_v1_port_pb.Port.deserializeBinaryFromReader); + msg.setPort(value); break; default: reader.skipField(); @@ -4161,152 +3979,97 @@ proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.serializeBinary = functi */ proto.cc.arduino.cli.commands.v1.DetectedPort.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getAddress(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getProtocol(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getProtocolLabel(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } - f = message.getBoardsList(); + f = message.getMatchingBoardsList(); if (f.length > 0) { writer.writeRepeatedMessage( - 4, + 1, f, proto.cc.arduino.cli.commands.v1.BoardListItem.serializeBinaryToWriter ); } - f = message.getSerialNumber(); - if (f.length > 0) { - writer.writeString( - 5, - f + f = message.getPort(); + if (f != null) { + writer.writeMessage( + 2, + f, + cc_arduino_cli_commands_v1_port_pb.Port.serializeBinaryToWriter ); } }; /** - * optional string address = 1; - * @return {string} - */ -proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.getAddress = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.cc.arduino.cli.commands.v1.DetectedPort} returns this - */ -proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.setAddress = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string protocol = 2; - * @return {string} + * repeated BoardListItem matching_boards = 1; + * @return {!Array} */ -proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.getProtocol = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.getMatchingBoardsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.cc.arduino.cli.commands.v1.BoardListItem, 1)); }; /** - * @param {string} value + * @param {!Array} value * @return {!proto.cc.arduino.cli.commands.v1.DetectedPort} returns this - */ -proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.setProtocol = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); +*/ +proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.setMatchingBoardsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); }; /** - * optional string protocol_label = 3; - * @return {string} + * @param {!proto.cc.arduino.cli.commands.v1.BoardListItem=} opt_value + * @param {number=} opt_index + * @return {!proto.cc.arduino.cli.commands.v1.BoardListItem} */ -proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.getProtocolLabel = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.addMatchingBoards = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.cc.arduino.cli.commands.v1.BoardListItem, opt_index); }; /** - * @param {string} value + * Clears the list making it empty but non-null. * @return {!proto.cc.arduino.cli.commands.v1.DetectedPort} returns this */ -proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.setProtocolLabel = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); +proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.clearMatchingBoardsList = function() { + return this.setMatchingBoardsList([]); }; /** - * repeated BoardListItem boards = 4; - * @return {!Array} + * optional Port port = 2; + * @return {?proto.cc.arduino.cli.commands.v1.Port} */ -proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.getBoardsList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.cc.arduino.cli.commands.v1.BoardListItem, 4)); +proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.getPort = function() { + return /** @type{?proto.cc.arduino.cli.commands.v1.Port} */ ( + jspb.Message.getWrapperField(this, cc_arduino_cli_commands_v1_port_pb.Port, 2)); }; /** - * @param {!Array} value + * @param {?proto.cc.arduino.cli.commands.v1.Port|undefined} value * @return {!proto.cc.arduino.cli.commands.v1.DetectedPort} returns this */ -proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.setBoardsList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 4, value); -}; - - -/** - * @param {!proto.cc.arduino.cli.commands.v1.BoardListItem=} opt_value - * @param {number=} opt_index - * @return {!proto.cc.arduino.cli.commands.v1.BoardListItem} - */ -proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.addBoards = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.cc.arduino.cli.commands.v1.BoardListItem, opt_index); +proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.setPort = function(value) { + return jspb.Message.setWrapperField(this, 2, value); }; /** - * Clears the list making it empty but non-null. + * Clears the message field making it undefined. * @return {!proto.cc.arduino.cli.commands.v1.DetectedPort} returns this */ -proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.clearBoardsList = function() { - return this.setBoardsList([]); -}; - - -/** - * optional string serial_number = 5; - * @return {string} - */ -proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.getSerialNumber = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.clearPort = function() { + return this.setPort(undefined); }; /** - * @param {string} value - * @return {!proto.cc.arduino.cli.commands.v1.DetectedPort} returns this + * Returns whether this field is set. + * @return {boolean} */ -proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.setSerialNumber = function(value) { - return jspb.Message.setProto3StringField(this, 5, value); +proto.cc.arduino.cli.commands.v1.DetectedPort.prototype.hasPort = function() { + return jspb.Message.getField(this, 2) != null; }; @@ -5134,8 +4897,6 @@ proto.cc.arduino.cli.commands.v1.BoardListItem.toObject = function(includeInstan name: jspb.Message.getFieldWithDefault(msg, 1, ""), fqbn: jspb.Message.getFieldWithDefault(msg, 2, ""), isHidden: jspb.Message.getBooleanFieldWithDefault(msg, 3, false), - vid: jspb.Message.getFieldWithDefault(msg, 4, ""), - pid: jspb.Message.getFieldWithDefault(msg, 5, ""), platform: (f = msg.getPlatform()) && cc_arduino_cli_commands_v1_common_pb.Platform.toObject(includeInstance, f) }; @@ -5185,14 +4946,6 @@ proto.cc.arduino.cli.commands.v1.BoardListItem.deserializeBinaryFromReader = fun var value = /** @type {boolean} */ (reader.readBool()); msg.setIsHidden(value); break; - case 4: - var value = /** @type {string} */ (reader.readString()); - msg.setVid(value); - break; - case 5: - var value = /** @type {string} */ (reader.readString()); - msg.setPid(value); - break; case 6: var value = new cc_arduino_cli_commands_v1_common_pb.Platform; reader.readMessage(value,cc_arduino_cli_commands_v1_common_pb.Platform.deserializeBinaryFromReader); @@ -5248,20 +5001,6 @@ proto.cc.arduino.cli.commands.v1.BoardListItem.serializeBinaryToWriter = functio f ); } - f = message.getVid(); - if (f.length > 0) { - writer.writeString( - 4, - f - ); - } - f = message.getPid(); - if (f.length > 0) { - writer.writeString( - 5, - f - ); - } f = message.getPlatform(); if (f != null) { writer.writeMessage( @@ -5327,42 +5066,6 @@ proto.cc.arduino.cli.commands.v1.BoardListItem.prototype.setIsHidden = function( }; -/** - * optional string vid = 4; - * @return {string} - */ -proto.cc.arduino.cli.commands.v1.BoardListItem.prototype.getVid = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); -}; - - -/** - * @param {string} value - * @return {!proto.cc.arduino.cli.commands.v1.BoardListItem} returns this - */ -proto.cc.arduino.cli.commands.v1.BoardListItem.prototype.setVid = function(value) { - return jspb.Message.setProto3StringField(this, 4, value); -}; - - -/** - * optional string pid = 5; - * @return {string} - */ -proto.cc.arduino.cli.commands.v1.BoardListItem.prototype.getPid = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); -}; - - -/** - * @param {string} value - * @return {!proto.cc.arduino.cli.commands.v1.BoardListItem} returns this - */ -proto.cc.arduino.cli.commands.v1.BoardListItem.prototype.setPid = function(value) { - return jspb.Message.setProto3StringField(this, 5, value); -}; - - /** * optional Platform platform = 6; * @return {?proto.cc.arduino.cli.commands.v1.Platform} @@ -5771,4 +5474,4 @@ proto.cc.arduino.cli.commands.v1.BoardSearchResponse.prototype.clearBoardsList = }; -goog.object.extend(exports, proto.cc.arduino.cli.commands.v1); +goog.object.extend(exports, proto.cc.arduino.cli.commands.v1); \ No newline at end of file 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 2ca2ef54a..a7b28fc65 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 @@ -7,6 +7,7 @@ import * as grpc from "@grpc/grpc-js"; import {handleClientStreamingCall} from "@grpc/grpc-js/build/src/server-call"; import * as cc_arduino_cli_commands_v1_commands_pb from "../../../../../cc/arduino/cli/commands/v1/commands_pb"; +import * as google_rpc_status_pb from "../../../../../google/rpc/status_pb"; import * as cc_arduino_cli_commands_v1_common_pb from "../../../../../cc/arduino/cli/commands/v1/common_pb"; import * as cc_arduino_cli_commands_v1_board_pb from "../../../../../cc/arduino/cli/commands/v1/board_pb"; import * as cc_arduino_cli_commands_v1_compile_pb from "../../../../../cc/arduino/cli/commands/v1/compile_pb"; @@ -15,9 +16,9 @@ import * as cc_arduino_cli_commands_v1_upload_pb from "../../../../../cc/arduino import * as cc_arduino_cli_commands_v1_lib_pb from "../../../../../cc/arduino/cli/commands/v1/lib_pb"; interface IArduinoCoreServiceService extends grpc.ServiceDefinition { + create: IArduinoCoreServiceService_ICreate; init: IArduinoCoreServiceService_IInit; destroy: IArduinoCoreServiceService_IDestroy; - rescan: IArduinoCoreServiceService_IRescan; updateIndex: IArduinoCoreServiceService_IUpdateIndex; updateLibrariesIndex: IArduinoCoreServiceService_IUpdateLibrariesIndex; updateCoreLibrariesIndex: IArduinoCoreServiceService_IUpdateCoreLibrariesIndex; @@ -54,6 +55,15 @@ interface IArduinoCoreServiceService extends grpc.ServiceDefinition { + path: "/cc.arduino.cli.commands.v1.ArduinoCoreService/Create"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} interface IArduinoCoreServiceService_IInit extends grpc.MethodDefinition { path: "/cc.arduino.cli.commands.v1.ArduinoCoreService/Init"; requestStream: false; @@ -72,15 +82,6 @@ interface IArduinoCoreServiceService_IDestroy extends grpc.MethodDefinition; responseDeserialize: grpc.deserialize; } -interface IArduinoCoreServiceService_IRescan extends grpc.MethodDefinition { - path: "/cc.arduino.cli.commands.v1.ArduinoCoreService/Rescan"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} interface IArduinoCoreServiceService_IUpdateIndex extends grpc.MethodDefinition { path: "/cc.arduino.cli.commands.v1.ArduinoCoreService/UpdateIndex"; requestStream: false; @@ -391,9 +392,9 @@ interface IArduinoCoreServiceService_ILibraryList extends grpc.MethodDefinition< export const ArduinoCoreServiceService: IArduinoCoreServiceService; export interface IArduinoCoreServiceServer { + create: grpc.handleUnaryCall; init: grpc.handleServerStreamingCall; destroy: grpc.handleUnaryCall; - rescan: grpc.handleUnaryCall; updateIndex: grpc.handleServerStreamingCall; updateLibrariesIndex: grpc.handleServerStreamingCall; updateCoreLibrariesIndex: grpc.handleServerStreamingCall; @@ -431,14 +432,14 @@ export interface IArduinoCoreServiceServer { } export interface IArduinoCoreServiceClient { + create(request: cc_arduino_cli_commands_v1_commands_pb.CreateRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.CreateResponse) => void): grpc.ClientUnaryCall; + create(request: cc_arduino_cli_commands_v1_commands_pb.CreateRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.CreateResponse) => void): grpc.ClientUnaryCall; + create(request: cc_arduino_cli_commands_v1_commands_pb.CreateRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.CreateResponse) => void): grpc.ClientUnaryCall; init(request: cc_arduino_cli_commands_v1_commands_pb.InitRequest, options?: Partial): grpc.ClientReadableStream; init(request: cc_arduino_cli_commands_v1_commands_pb.InitRequest, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; destroy(request: cc_arduino_cli_commands_v1_commands_pb.DestroyRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.DestroyResponse) => void): grpc.ClientUnaryCall; destroy(request: cc_arduino_cli_commands_v1_commands_pb.DestroyRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.DestroyResponse) => void): grpc.ClientUnaryCall; destroy(request: cc_arduino_cli_commands_v1_commands_pb.DestroyRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.DestroyResponse) => void): grpc.ClientUnaryCall; - rescan(request: cc_arduino_cli_commands_v1_commands_pb.RescanRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.RescanResponse) => void): grpc.ClientUnaryCall; - rescan(request: cc_arduino_cli_commands_v1_commands_pb.RescanRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.RescanResponse) => void): grpc.ClientUnaryCall; - rescan(request: cc_arduino_cli_commands_v1_commands_pb.RescanRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.RescanResponse) => void): grpc.ClientUnaryCall; updateIndex(request: cc_arduino_cli_commands_v1_commands_pb.UpdateIndexRequest, options?: Partial): grpc.ClientReadableStream; updateIndex(request: cc_arduino_cli_commands_v1_commands_pb.UpdateIndexRequest, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; updateLibrariesIndex(request: cc_arduino_cli_commands_v1_commands_pb.UpdateLibrariesIndexRequest, options?: Partial): grpc.ClientReadableStream; @@ -526,14 +527,14 @@ export interface IArduinoCoreServiceClient { export class ArduinoCoreServiceClient extends grpc.Client implements IArduinoCoreServiceClient { constructor(address: string, credentials: grpc.ChannelCredentials, options?: Partial); + public create(request: cc_arduino_cli_commands_v1_commands_pb.CreateRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.CreateResponse) => void): grpc.ClientUnaryCall; + public create(request: cc_arduino_cli_commands_v1_commands_pb.CreateRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.CreateResponse) => void): grpc.ClientUnaryCall; + public create(request: cc_arduino_cli_commands_v1_commands_pb.CreateRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.CreateResponse) => void): grpc.ClientUnaryCall; public init(request: cc_arduino_cli_commands_v1_commands_pb.InitRequest, options?: Partial): grpc.ClientReadableStream; public init(request: cc_arduino_cli_commands_v1_commands_pb.InitRequest, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; public destroy(request: cc_arduino_cli_commands_v1_commands_pb.DestroyRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.DestroyResponse) => void): grpc.ClientUnaryCall; public destroy(request: cc_arduino_cli_commands_v1_commands_pb.DestroyRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.DestroyResponse) => void): grpc.ClientUnaryCall; public destroy(request: cc_arduino_cli_commands_v1_commands_pb.DestroyRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.DestroyResponse) => void): grpc.ClientUnaryCall; - public rescan(request: cc_arduino_cli_commands_v1_commands_pb.RescanRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.RescanResponse) => void): grpc.ClientUnaryCall; - public rescan(request: cc_arduino_cli_commands_v1_commands_pb.RescanRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.RescanResponse) => void): grpc.ClientUnaryCall; - public rescan(request: cc_arduino_cli_commands_v1_commands_pb.RescanRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_commands_pb.RescanResponse) => void): grpc.ClientUnaryCall; public updateIndex(request: cc_arduino_cli_commands_v1_commands_pb.UpdateIndexRequest, options?: Partial): grpc.ClientReadableStream; public updateIndex(request: cc_arduino_cli_commands_v1_commands_pb.UpdateIndexRequest, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; public updateLibrariesIndex(request: cc_arduino_cli_commands_v1_commands_pb.UpdateLibrariesIndexRequest, options?: Partial): grpc.ClientReadableStream; @@ -616,4 +617,4 @@ export class ArduinoCoreServiceClient extends grpc.Client implements IArduinoCor public libraryList(request: cc_arduino_cli_commands_v1_lib_pb.LibraryListRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_lib_pb.LibraryListResponse) => void): grpc.ClientUnaryCall; public libraryList(request: cc_arduino_cli_commands_v1_lib_pb.LibraryListRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_lib_pb.LibraryListResponse) => void): grpc.ClientUnaryCall; public libraryList(request: cc_arduino_cli_commands_v1_lib_pb.LibraryListRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_lib_pb.LibraryListResponse) => void): grpc.ClientUnaryCall; -} +} \ No newline at end of file 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 93f458146..33d095b2c 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 @@ -18,6 +18,7 @@ // 'use strict'; var cc_arduino_cli_commands_v1_commands_pb = require('../../../../../cc/arduino/cli/commands/v1/commands_pb.js'); +var google_rpc_status_pb = require('../../../../../google/rpc/status_pb.js'); var cc_arduino_cli_commands_v1_common_pb = require('../../../../../cc/arduino/cli/commands/v1/common_pb.js'); var cc_arduino_cli_commands_v1_board_pb = require('../../../../../cc/arduino/cli/commands/v1/board_pb.js'); var cc_arduino_cli_commands_v1_compile_pb = require('../../../../../cc/arduino/cli/commands/v1/compile_pb.js'); @@ -223,6 +224,28 @@ function deserialize_cc_arduino_cli_commands_v1_CompileResponse(buffer_arg) { return cc_arduino_cli_commands_v1_compile_pb.CompileResponse.deserializeBinary(new Uint8Array(buffer_arg)); } +function serialize_cc_arduino_cli_commands_v1_CreateRequest(arg) { + if (!(arg instanceof cc_arduino_cli_commands_v1_commands_pb.CreateRequest)) { + throw new Error('Expected argument of type cc.arduino.cli.commands.v1.CreateRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_cc_arduino_cli_commands_v1_CreateRequest(buffer_arg) { + return cc_arduino_cli_commands_v1_commands_pb.CreateRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_cc_arduino_cli_commands_v1_CreateResponse(arg) { + if (!(arg instanceof cc_arduino_cli_commands_v1_commands_pb.CreateResponse)) { + throw new Error('Expected argument of type cc.arduino.cli.commands.v1.CreateResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_cc_arduino_cli_commands_v1_CreateResponse(buffer_arg) { + return cc_arduino_cli_commands_v1_commands_pb.CreateResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + function serialize_cc_arduino_cli_commands_v1_DestroyRequest(arg) { if (!(arg instanceof cc_arduino_cli_commands_v1_commands_pb.DestroyRequest)) { throw new Error('Expected argument of type cc.arduino.cli.commands.v1.DestroyRequest'); @@ -641,28 +664,6 @@ 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_RescanRequest(arg) { - if (!(arg instanceof cc_arduino_cli_commands_v1_commands_pb.RescanRequest)) { - throw new Error('Expected argument of type cc.arduino.cli.commands.v1.RescanRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_cc_arduino_cli_commands_v1_RescanRequest(buffer_arg) { - return cc_arduino_cli_commands_v1_commands_pb.RescanRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_cc_arduino_cli_commands_v1_RescanResponse(arg) { - if (!(arg instanceof cc_arduino_cli_commands_v1_commands_pb.RescanResponse)) { - throw new Error('Expected argument of type cc.arduino.cli.commands.v1.RescanResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_cc_arduino_cli_commands_v1_RescanResponse(buffer_arg) { - return cc_arduino_cli_commands_v1_commands_pb.RescanResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - function serialize_cc_arduino_cli_commands_v1_UpdateCoreLibrariesIndexRequest(arg) { if (!(arg instanceof cc_arduino_cli_commands_v1_commands_pb.UpdateCoreLibrariesIndexRequest)) { throw new Error('Expected argument of type cc.arduino.cli.commands.v1.UpdateCoreLibrariesIndexRequest'); @@ -842,7 +843,20 @@ function deserialize_cc_arduino_cli_commands_v1_ZipLibraryInstallResponse(buffer // The main Arduino Platform service API var ArduinoCoreServiceService = exports['cc.arduino.cli.commands.v1.ArduinoCoreService'] = { - // Start a new instance of the Arduino Core Service + // Create a new Arduino Core instance +create: { + path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/Create', + requestStream: false, + responseStream: false, + requestType: cc_arduino_cli_commands_v1_commands_pb.CreateRequest, + responseType: cc_arduino_cli_commands_v1_commands_pb.CreateResponse, + requestSerialize: serialize_cc_arduino_cli_commands_v1_CreateRequest, + requestDeserialize: deserialize_cc_arduino_cli_commands_v1_CreateRequest, + responseSerialize: serialize_cc_arduino_cli_commands_v1_CreateResponse, + responseDeserialize: deserialize_cc_arduino_cli_commands_v1_CreateResponse, + }, + // Initializes an existing Arduino Core instance by loading platforms and +// libraries init: { path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/Init', requestStream: false, @@ -866,18 +880,6 @@ destroy: { responseSerialize: serialize_cc_arduino_cli_commands_v1_DestroyResponse, responseDeserialize: deserialize_cc_arduino_cli_commands_v1_DestroyResponse, }, - // Rescan instance of the Arduino Core Service -rescan: { - path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/Rescan', - requestStream: false, - responseStream: false, - requestType: cc_arduino_cli_commands_v1_commands_pb.RescanRequest, - responseType: cc_arduino_cli_commands_v1_commands_pb.RescanResponse, - requestSerialize: serialize_cc_arduino_cli_commands_v1_RescanRequest, - requestDeserialize: deserialize_cc_arduino_cli_commands_v1_RescanRequest, - responseSerialize: serialize_cc_arduino_cli_commands_v1_RescanResponse, - responseDeserialize: deserialize_cc_arduino_cli_commands_v1_RescanResponse, - }, // Update package index of the Arduino Core Service updateIndex: { path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/UpdateIndex', @@ -1297,4 +1299,4 @@ libraryList: { }; // BOOTSTRAP COMMANDS -// ------------------- +// ------------------- \ No newline at end of file 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 f0de66bc5..f04366943 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 @@ -5,6 +5,7 @@ /* eslint-disable */ import * as jspb from "google-protobuf"; +import * as google_rpc_status_pb from "../../../../../google/rpc/status_pb"; import * as cc_arduino_cli_commands_v1_common_pb from "../../../../../cc/arduino/cli/commands/v1/common_pb"; import * as cc_arduino_cli_commands_v1_board_pb from "../../../../../cc/arduino/cli/commands/v1/board_pb"; import * as cc_arduino_cli_commands_v1_compile_pb from "../../../../../cc/arduino/cli/commands/v1/compile_pb"; @@ -12,9 +13,53 @@ import * as cc_arduino_cli_commands_v1_core_pb from "../../../../../cc/arduino/c import * as cc_arduino_cli_commands_v1_upload_pb from "../../../../../cc/arduino/cli/commands/v1/upload_pb"; import * as cc_arduino_cli_commands_v1_lib_pb from "../../../../../cc/arduino/cli/commands/v1/lib_pb"; +export class CreateRequest extends jspb.Message { + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): CreateRequest.AsObject; + static toObject(includeInstance: boolean, msg: CreateRequest): CreateRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: CreateRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): CreateRequest; + static deserializeBinaryFromReader(message: CreateRequest, reader: jspb.BinaryReader): CreateRequest; +} + +export namespace CreateRequest { + export type AsObject = { + } +} + +export class CreateResponse 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): CreateResponse; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): CreateResponse.AsObject; + static toObject(includeInstance: boolean, msg: CreateResponse): CreateResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: CreateResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): CreateResponse; + static deserializeBinaryFromReader(message: CreateResponse, reader: jspb.BinaryReader): CreateResponse; +} + +export namespace CreateResponse { + export type AsObject = { + instance?: cc_arduino_cli_commands_v1_common_pb.Instance.AsObject, + } +} + export class InitRequest extends jspb.Message { - getLibraryManagerOnly(): boolean; - setLibraryManagerOnly(value: boolean): InitRequest; + + hasInstance(): boolean; + clearInstance(): void; + getInstance(): cc_arduino_cli_commands_v1_common_pb.Instance | undefined; + setInstance(value?: cc_arduino_cli_commands_v1_common_pb.Instance): InitRequest; serializeBinary(): Uint8Array; @@ -29,37 +74,25 @@ export class InitRequest extends jspb.Message { export namespace InitRequest { export type AsObject = { - libraryManagerOnly: boolean, + instance?: cc_arduino_cli_commands_v1_common_pb.Instance.AsObject, } } export class InitResponse 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): InitResponse; + hasInitProgress(): boolean; + clearInitProgress(): void; + getInitProgress(): InitResponse.Progress | undefined; + setInitProgress(value?: InitResponse.Progress): InitResponse; - clearPlatformsIndexErrorsList(): void; - getPlatformsIndexErrorsList(): Array; - setPlatformsIndexErrorsList(value: Array): InitResponse; - addPlatformsIndexErrors(value: string, index?: number): string; - getLibrariesIndexError(): string; - setLibrariesIndexError(value: string): InitResponse; + hasError(): boolean; + clearError(): void; + getError(): google_rpc_status_pb.Status | undefined; + setError(value?: google_rpc_status_pb.Status): InitResponse; - hasDownloadProgress(): boolean; - clearDownloadProgress(): void; - getDownloadProgress(): cc_arduino_cli_commands_v1_common_pb.DownloadProgress | undefined; - setDownloadProgress(value?: cc_arduino_cli_commands_v1_common_pb.DownloadProgress): InitResponse; - - - hasTaskProgress(): boolean; - clearTaskProgress(): void; - getTaskProgress(): cc_arduino_cli_commands_v1_common_pb.TaskProgress | undefined; - setTaskProgress(value?: cc_arduino_cli_commands_v1_common_pb.TaskProgress): InitResponse; - + getMessageCase(): InitResponse.MessageCase; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): InitResponse.AsObject; @@ -73,12 +106,52 @@ export class InitResponse extends jspb.Message { export namespace InitResponse { export type AsObject = { - instance?: cc_arduino_cli_commands_v1_common_pb.Instance.AsObject, - platformsIndexErrorsList: Array, - librariesIndexError: string, - downloadProgress?: cc_arduino_cli_commands_v1_common_pb.DownloadProgress.AsObject, - taskProgress?: cc_arduino_cli_commands_v1_common_pb.TaskProgress.AsObject, + initProgress?: InitResponse.Progress.AsObject, + error?: google_rpc_status_pb.Status.AsObject, } + + + export class Progress extends jspb.Message { + + hasDownloadProgress(): boolean; + clearDownloadProgress(): void; + getDownloadProgress(): cc_arduino_cli_commands_v1_common_pb.DownloadProgress | undefined; + setDownloadProgress(value?: cc_arduino_cli_commands_v1_common_pb.DownloadProgress): Progress; + + + hasTaskProgress(): boolean; + clearTaskProgress(): void; + getTaskProgress(): cc_arduino_cli_commands_v1_common_pb.TaskProgress | undefined; + setTaskProgress(value?: cc_arduino_cli_commands_v1_common_pb.TaskProgress): Progress; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Progress.AsObject; + static toObject(includeInstance: boolean, msg: Progress): Progress.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Progress, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Progress; + static deserializeBinaryFromReader(message: Progress, reader: jspb.BinaryReader): Progress; + } + + export namespace Progress { + export type AsObject = { + downloadProgress?: cc_arduino_cli_commands_v1_common_pb.DownloadProgress.AsObject, + taskProgress?: cc_arduino_cli_commands_v1_common_pb.TaskProgress.AsObject, + } + } + + + export enum MessageCase { + MESSAGE_NOT_SET = 0, + + INIT_PROGRESS = 1, + + ERROR = 2, + + } + } export class DestroyRequest extends jspb.Message { @@ -122,57 +195,6 @@ export namespace DestroyResponse { } } -export class RescanRequest 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): RescanRequest; - - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): RescanRequest.AsObject; - static toObject(includeInstance: boolean, msg: RescanRequest): RescanRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: RescanRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): RescanRequest; - static deserializeBinaryFromReader(message: RescanRequest, reader: jspb.BinaryReader): RescanRequest; -} - -export namespace RescanRequest { - export type AsObject = { - instance?: cc_arduino_cli_commands_v1_common_pb.Instance.AsObject, - } -} - -export class RescanResponse extends jspb.Message { - clearPlatformsIndexErrorsList(): void; - getPlatformsIndexErrorsList(): Array; - setPlatformsIndexErrorsList(value: Array): RescanResponse; - addPlatformsIndexErrors(value: string, index?: number): string; - - getLibrariesIndexError(): string; - setLibrariesIndexError(value: string): RescanResponse; - - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): RescanResponse.AsObject; - static toObject(includeInstance: boolean, msg: RescanResponse): RescanResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: RescanResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): RescanResponse; - static deserializeBinaryFromReader(message: RescanResponse, reader: jspb.BinaryReader): RescanResponse; -} - -export namespace RescanResponse { - export type AsObject = { - platformsIndexErrorsList: Array, - librariesIndexError: string, - } -} - export class UpdateIndexRequest extends jspb.Message { hasInstance(): boolean; @@ -582,4 +604,4 @@ export class ArchiveSketchResponse extends jspb.Message { export namespace ArchiveSketchResponse { export type AsObject = { } -} +} \ No newline at end of file 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 282c13491..627897fda 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 @@ -15,6 +15,8 @@ var jspb = require('google-protobuf'); var goog = jspb; var global = Function('return this')(); +var google_rpc_status_pb = require('../../../../../google/rpc/status_pb.js'); +goog.object.extend(proto, google_rpc_status_pb); var cc_arduino_cli_commands_v1_common_pb = require('../../../../../cc/arduino/cli/commands/v1/common_pb.js'); goog.object.extend(proto, cc_arduino_cli_commands_v1_common_pb); var cc_arduino_cli_commands_v1_board_pb = require('../../../../../cc/arduino/cli/commands/v1/board_pb.js'); @@ -29,16 +31,18 @@ var cc_arduino_cli_commands_v1_lib_pb = require('../../../../../cc/arduino/cli/c goog.object.extend(proto, cc_arduino_cli_commands_v1_lib_pb); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.ArchiveSketchRequest', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.ArchiveSketchResponse', null, global); +goog.exportSymbol('proto.cc.arduino.cli.commands.v1.CreateRequest', null, global); +goog.exportSymbol('proto.cc.arduino.cli.commands.v1.CreateResponse', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.DestroyRequest', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.DestroyResponse', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.InitRequest', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.InitResponse', null, global); +goog.exportSymbol('proto.cc.arduino.cli.commands.v1.InitResponse.MessageCase', null, global); +goog.exportSymbol('proto.cc.arduino.cli.commands.v1.InitResponse.Progress', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.LoadSketchRequest', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.LoadSketchResponse', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.OutdatedRequest', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.OutdatedResponse', null, global); -goog.exportSymbol('proto.cc.arduino.cli.commands.v1.RescanRequest', null, global); -goog.exportSymbol('proto.cc.arduino.cli.commands.v1.RescanResponse', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.UpdateCoreLibrariesIndexRequest', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.UpdateCoreLibrariesIndexResponse', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.UpdateIndexRequest', null, global); @@ -59,16 +63,16 @@ goog.exportSymbol('proto.cc.arduino.cli.commands.v1.VersionResponse', null, glob * @extends {jspb.Message} * @constructor */ -proto.cc.arduino.cli.commands.v1.InitRequest = function(opt_data) { +proto.cc.arduino.cli.commands.v1.CreateRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.cc.arduino.cli.commands.v1.InitRequest, jspb.Message); +goog.inherits(proto.cc.arduino.cli.commands.v1.CreateRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.cc.arduino.cli.commands.v1.InitRequest.displayName = 'proto.cc.arduino.cli.commands.v1.InitRequest'; + proto.cc.arduino.cli.commands.v1.CreateRequest.displayName = 'proto.cc.arduino.cli.commands.v1.CreateRequest'; } /** * Generated by JsPbCodeGenerator. @@ -80,16 +84,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.cc.arduino.cli.commands.v1.InitResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.cc.arduino.cli.commands.v1.InitResponse.repeatedFields_, null); +proto.cc.arduino.cli.commands.v1.CreateResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.cc.arduino.cli.commands.v1.InitResponse, jspb.Message); +goog.inherits(proto.cc.arduino.cli.commands.v1.CreateResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.cc.arduino.cli.commands.v1.InitResponse.displayName = 'proto.cc.arduino.cli.commands.v1.InitResponse'; + proto.cc.arduino.cli.commands.v1.CreateResponse.displayName = 'proto.cc.arduino.cli.commands.v1.CreateResponse'; } /** * Generated by JsPbCodeGenerator. @@ -101,16 +105,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.cc.arduino.cli.commands.v1.DestroyRequest = function(opt_data) { +proto.cc.arduino.cli.commands.v1.InitRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.cc.arduino.cli.commands.v1.DestroyRequest, jspb.Message); +goog.inherits(proto.cc.arduino.cli.commands.v1.InitRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.cc.arduino.cli.commands.v1.DestroyRequest.displayName = 'proto.cc.arduino.cli.commands.v1.DestroyRequest'; + proto.cc.arduino.cli.commands.v1.InitRequest.displayName = 'proto.cc.arduino.cli.commands.v1.InitRequest'; } /** * Generated by JsPbCodeGenerator. @@ -122,16 +126,37 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.cc.arduino.cli.commands.v1.DestroyResponse = function(opt_data) { +proto.cc.arduino.cli.commands.v1.InitResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.cc.arduino.cli.commands.v1.InitResponse.oneofGroups_); +}; +goog.inherits(proto.cc.arduino.cli.commands.v1.InitResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.cc.arduino.cli.commands.v1.InitResponse.displayName = 'proto.cc.arduino.cli.commands.v1.InitResponse'; +} +/** + * 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.InitResponse.Progress = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.cc.arduino.cli.commands.v1.DestroyResponse, jspb.Message); +goog.inherits(proto.cc.arduino.cli.commands.v1.InitResponse.Progress, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.cc.arduino.cli.commands.v1.DestroyResponse.displayName = 'proto.cc.arduino.cli.commands.v1.DestroyResponse'; + proto.cc.arduino.cli.commands.v1.InitResponse.Progress.displayName = 'proto.cc.arduino.cli.commands.v1.InitResponse.Progress'; } /** * Generated by JsPbCodeGenerator. @@ -143,16 +168,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.cc.arduino.cli.commands.v1.RescanRequest = function(opt_data) { +proto.cc.arduino.cli.commands.v1.DestroyRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.cc.arduino.cli.commands.v1.RescanRequest, jspb.Message); +goog.inherits(proto.cc.arduino.cli.commands.v1.DestroyRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.cc.arduino.cli.commands.v1.RescanRequest.displayName = 'proto.cc.arduino.cli.commands.v1.RescanRequest'; + proto.cc.arduino.cli.commands.v1.DestroyRequest.displayName = 'proto.cc.arduino.cli.commands.v1.DestroyRequest'; } /** * Generated by JsPbCodeGenerator. @@ -164,16 +189,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.cc.arduino.cli.commands.v1.RescanResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.cc.arduino.cli.commands.v1.RescanResponse.repeatedFields_, null); +proto.cc.arduino.cli.commands.v1.DestroyResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.cc.arduino.cli.commands.v1.RescanResponse, jspb.Message); +goog.inherits(proto.cc.arduino.cli.commands.v1.DestroyResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.cc.arduino.cli.commands.v1.RescanResponse.displayName = 'proto.cc.arduino.cli.commands.v1.RescanResponse'; + proto.cc.arduino.cli.commands.v1.DestroyResponse.displayName = 'proto.cc.arduino.cli.commands.v1.DestroyResponse'; } /** * Generated by JsPbCodeGenerator. @@ -527,8 +552,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.cc.arduino.cli.commands.v1.InitRequest.prototype.toObject = function(opt_includeInstance) { - return proto.cc.arduino.cli.commands.v1.InitRequest.toObject(opt_includeInstance, this); +proto.cc.arduino.cli.commands.v1.CreateRequest.prototype.toObject = function(opt_includeInstance) { + return proto.cc.arduino.cli.commands.v1.CreateRequest.toObject(opt_includeInstance, this); }; @@ -537,13 +562,13 @@ proto.cc.arduino.cli.commands.v1.InitRequest.prototype.toObject = function(opt_i * @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.InitRequest} msg The msg instance to transform. + * @param {!proto.cc.arduino.cli.commands.v1.CreateRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.cc.arduino.cli.commands.v1.InitRequest.toObject = function(includeInstance, msg) { +proto.cc.arduino.cli.commands.v1.CreateRequest.toObject = function(includeInstance, msg) { var f, obj = { - libraryManagerOnly: jspb.Message.getBooleanFieldWithDefault(msg, 2, false) + }; if (includeInstance) { @@ -557,33 +582,29 @@ proto.cc.arduino.cli.commands.v1.InitRequest.toObject = function(includeInstance /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.cc.arduino.cli.commands.v1.InitRequest} + * @return {!proto.cc.arduino.cli.commands.v1.CreateRequest} */ -proto.cc.arduino.cli.commands.v1.InitRequest.deserializeBinary = function(bytes) { +proto.cc.arduino.cli.commands.v1.CreateRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.cc.arduino.cli.commands.v1.InitRequest; - return proto.cc.arduino.cli.commands.v1.InitRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.cc.arduino.cli.commands.v1.CreateRequest; + return proto.cc.arduino.cli.commands.v1.CreateRequest.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.InitRequest} msg The message object to deserialize into. + * @param {!proto.cc.arduino.cli.commands.v1.CreateRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.cc.arduino.cli.commands.v1.InitRequest} + * @return {!proto.cc.arduino.cli.commands.v1.CreateRequest} */ -proto.cc.arduino.cli.commands.v1.InitRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.cc.arduino.cli.commands.v1.CreateRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { - case 2: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setLibraryManagerOnly(value); - break; default: reader.skipField(); break; @@ -597,9 +618,9 @@ proto.cc.arduino.cli.commands.v1.InitRequest.deserializeBinaryFromReader = funct * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.cc.arduino.cli.commands.v1.InitRequest.prototype.serializeBinary = function() { +proto.cc.arduino.cli.commands.v1.CreateRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.cc.arduino.cli.commands.v1.InitRequest.serializeBinaryToWriter(this, writer); + proto.cc.arduino.cli.commands.v1.CreateRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -607,48 +628,16 @@ proto.cc.arduino.cli.commands.v1.InitRequest.prototype.serializeBinary = functio /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.cc.arduino.cli.commands.v1.InitRequest} message + * @param {!proto.cc.arduino.cli.commands.v1.CreateRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.cc.arduino.cli.commands.v1.InitRequest.serializeBinaryToWriter = function(message, writer) { +proto.cc.arduino.cli.commands.v1.CreateRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getLibraryManagerOnly(); - if (f) { - writer.writeBool( - 2, - f - ); - } -}; - - -/** - * optional bool library_manager_only = 2; - * @return {boolean} - */ -proto.cc.arduino.cli.commands.v1.InitRequest.prototype.getLibraryManagerOnly = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.cc.arduino.cli.commands.v1.InitRequest} returns this - */ -proto.cc.arduino.cli.commands.v1.InitRequest.prototype.setLibraryManagerOnly = function(value) { - return jspb.Message.setProto3BooleanField(this, 2, value); }; -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.cc.arduino.cli.commands.v1.InitResponse.repeatedFields_ = [2]; - if (jspb.Message.GENERATE_TO_OBJECT) { @@ -664,8 +653,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.cc.arduino.cli.commands.v1.InitResponse.prototype.toObject = function(opt_includeInstance) { - return proto.cc.arduino.cli.commands.v1.InitResponse.toObject(opt_includeInstance, this); +proto.cc.arduino.cli.commands.v1.CreateResponse.prototype.toObject = function(opt_includeInstance) { + return proto.cc.arduino.cli.commands.v1.CreateResponse.toObject(opt_includeInstance, this); }; @@ -674,17 +663,13 @@ proto.cc.arduino.cli.commands.v1.InitResponse.prototype.toObject = function(opt_ * @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.InitResponse} msg The msg instance to transform. + * @param {!proto.cc.arduino.cli.commands.v1.CreateResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.cc.arduino.cli.commands.v1.InitResponse.toObject = function(includeInstance, msg) { +proto.cc.arduino.cli.commands.v1.CreateResponse.toObject = function(includeInstance, msg) { var f, obj = { - instance: (f = msg.getInstance()) && cc_arduino_cli_commands_v1_common_pb.Instance.toObject(includeInstance, f), - platformsIndexErrorsList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? undefined : f, - librariesIndexError: jspb.Message.getFieldWithDefault(msg, 3, ""), - downloadProgress: (f = msg.getDownloadProgress()) && cc_arduino_cli_commands_v1_common_pb.DownloadProgress.toObject(includeInstance, f), - taskProgress: (f = msg.getTaskProgress()) && cc_arduino_cli_commands_v1_common_pb.TaskProgress.toObject(includeInstance, f) + instance: (f = msg.getInstance()) && cc_arduino_cli_commands_v1_common_pb.Instance.toObject(includeInstance, f) }; if (includeInstance) { @@ -698,23 +683,23 @@ proto.cc.arduino.cli.commands.v1.InitResponse.toObject = function(includeInstanc /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.cc.arduino.cli.commands.v1.InitResponse} + * @return {!proto.cc.arduino.cli.commands.v1.CreateResponse} */ -proto.cc.arduino.cli.commands.v1.InitResponse.deserializeBinary = function(bytes) { +proto.cc.arduino.cli.commands.v1.CreateResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.cc.arduino.cli.commands.v1.InitResponse; - return proto.cc.arduino.cli.commands.v1.InitResponse.deserializeBinaryFromReader(msg, reader); + var msg = new proto.cc.arduino.cli.commands.v1.CreateResponse; + return proto.cc.arduino.cli.commands.v1.CreateResponse.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.InitResponse} msg The message object to deserialize into. + * @param {!proto.cc.arduino.cli.commands.v1.CreateResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.cc.arduino.cli.commands.v1.InitResponse} + * @return {!proto.cc.arduino.cli.commands.v1.CreateResponse} */ -proto.cc.arduino.cli.commands.v1.InitResponse.deserializeBinaryFromReader = function(msg, reader) { +proto.cc.arduino.cli.commands.v1.CreateResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -726,24 +711,6 @@ proto.cc.arduino.cli.commands.v1.InitResponse.deserializeBinaryFromReader = func 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.addPlatformsIndexErrors(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setLibrariesIndexError(value); - break; - case 4: - var value = new cc_arduino_cli_commands_v1_common_pb.DownloadProgress; - reader.readMessage(value,cc_arduino_cli_commands_v1_common_pb.DownloadProgress.deserializeBinaryFromReader); - msg.setDownloadProgress(value); - break; - case 5: - var value = new cc_arduino_cli_commands_v1_common_pb.TaskProgress; - reader.readMessage(value,cc_arduino_cli_commands_v1_common_pb.TaskProgress.deserializeBinaryFromReader); - msg.setTaskProgress(value); - break; default: reader.skipField(); break; @@ -757,9 +724,9 @@ proto.cc.arduino.cli.commands.v1.InitResponse.deserializeBinaryFromReader = func * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.cc.arduino.cli.commands.v1.InitResponse.prototype.serializeBinary = function() { +proto.cc.arduino.cli.commands.v1.CreateResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.cc.arduino.cli.commands.v1.InitResponse.serializeBinaryToWriter(this, writer); + proto.cc.arduino.cli.commands.v1.CreateResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -767,11 +734,11 @@ proto.cc.arduino.cli.commands.v1.InitResponse.prototype.serializeBinary = functi /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.cc.arduino.cli.commands.v1.InitResponse} message + * @param {!proto.cc.arduino.cli.commands.v1.CreateResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.cc.arduino.cli.commands.v1.InitResponse.serializeBinaryToWriter = function(message, writer) { +proto.cc.arduino.cli.commands.v1.CreateResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getInstance(); if (f != null) { @@ -781,36 +748,6 @@ proto.cc.arduino.cli.commands.v1.InitResponse.serializeBinaryToWriter = function cc_arduino_cli_commands_v1_common_pb.Instance.serializeBinaryToWriter ); } - f = message.getPlatformsIndexErrorsList(); - if (f.length > 0) { - writer.writeRepeatedString( - 2, - f - ); - } - f = message.getLibrariesIndexError(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } - f = message.getDownloadProgress(); - if (f != null) { - writer.writeMessage( - 4, - f, - cc_arduino_cli_commands_v1_common_pb.DownloadProgress.serializeBinaryToWriter - ); - } - f = message.getTaskProgress(); - if (f != null) { - writer.writeMessage( - 5, - f, - cc_arduino_cli_commands_v1_common_pb.TaskProgress.serializeBinaryToWriter - ); - } }; @@ -818,7 +755,7 @@ proto.cc.arduino.cli.commands.v1.InitResponse.serializeBinaryToWriter = function * optional Instance instance = 1; * @return {?proto.cc.arduino.cli.commands.v1.Instance} */ -proto.cc.arduino.cli.commands.v1.InitResponse.prototype.getInstance = function() { +proto.cc.arduino.cli.commands.v1.CreateResponse.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)); }; @@ -826,18 +763,18 @@ proto.cc.arduino.cli.commands.v1.InitResponse.prototype.getInstance = function() /** * @param {?proto.cc.arduino.cli.commands.v1.Instance|undefined} value - * @return {!proto.cc.arduino.cli.commands.v1.InitResponse} returns this + * @return {!proto.cc.arduino.cli.commands.v1.CreateResponse} returns this */ -proto.cc.arduino.cli.commands.v1.InitResponse.prototype.setInstance = function(value) { +proto.cc.arduino.cli.commands.v1.CreateResponse.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.InitResponse} returns this + * @return {!proto.cc.arduino.cli.commands.v1.CreateResponse} returns this */ -proto.cc.arduino.cli.commands.v1.InitResponse.prototype.clearInstance = function() { +proto.cc.arduino.cli.commands.v1.CreateResponse.prototype.clearInstance = function() { return this.setInstance(undefined); }; @@ -846,91 +783,150 @@ proto.cc.arduino.cli.commands.v1.InitResponse.prototype.clearInstance = function * Returns whether this field is set. * @return {boolean} */ -proto.cc.arduino.cli.commands.v1.InitResponse.prototype.hasInstance = function() { +proto.cc.arduino.cli.commands.v1.CreateResponse.prototype.hasInstance = function() { return jspb.Message.getField(this, 1) != null; }; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { /** - * repeated string platforms_index_errors = 2; - * @return {!Array} + * 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.InitResponse.prototype.getPlatformsIndexErrorsList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 2)); +proto.cc.arduino.cli.commands.v1.InitRequest.prototype.toObject = function(opt_includeInstance) { + return proto.cc.arduino.cli.commands.v1.InitRequest.toObject(opt_includeInstance, this); }; /** - * @param {!Array} value - * @return {!proto.cc.arduino.cli.commands.v1.InitResponse} returns 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.InitRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.cc.arduino.cli.commands.v1.InitResponse.prototype.setPlatformsIndexErrorsList = function(value) { - return jspb.Message.setField(this, 2, value || []); +proto.cc.arduino.cli.commands.v1.InitRequest.toObject = function(includeInstance, msg) { + var f, obj = { + instance: (f = msg.getInstance()) && cc_arduino_cli_commands_v1_common_pb.Instance.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; }; +} /** - * @param {string} value - * @param {number=} opt_index - * @return {!proto.cc.arduino.cli.commands.v1.InitResponse} returns this + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.cc.arduino.cli.commands.v1.InitRequest} */ -proto.cc.arduino.cli.commands.v1.InitResponse.prototype.addPlatformsIndexErrors = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 2, value, opt_index); +proto.cc.arduino.cli.commands.v1.InitRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.cc.arduino.cli.commands.v1.InitRequest; + return proto.cc.arduino.cli.commands.v1.InitRequest.deserializeBinaryFromReader(msg, reader); }; /** - * Clears the list making it empty but non-null. - * @return {!proto.cc.arduino.cli.commands.v1.InitResponse} returns this + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.cc.arduino.cli.commands.v1.InitRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.cc.arduino.cli.commands.v1.InitRequest} */ -proto.cc.arduino.cli.commands.v1.InitResponse.prototype.clearPlatformsIndexErrorsList = function() { - return this.setPlatformsIndexErrorsList([]); +proto.cc.arduino.cli.commands.v1.InitRequest.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_common_pb.Instance; + reader.readMessage(value,cc_arduino_cli_commands_v1_common_pb.Instance.deserializeBinaryFromReader); + msg.setInstance(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; }; /** - * optional string libraries_index_error = 3; - * @return {string} + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} */ -proto.cc.arduino.cli.commands.v1.InitResponse.prototype.getLibrariesIndexError = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +proto.cc.arduino.cli.commands.v1.InitRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.cc.arduino.cli.commands.v1.InitRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); }; /** - * @param {string} value - * @return {!proto.cc.arduino.cli.commands.v1.InitResponse} returns this + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.cc.arduino.cli.commands.v1.InitRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.cc.arduino.cli.commands.v1.InitResponse.prototype.setLibrariesIndexError = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); +proto.cc.arduino.cli.commands.v1.InitRequest.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 + ); + } }; /** - * optional DownloadProgress download_progress = 4; - * @return {?proto.cc.arduino.cli.commands.v1.DownloadProgress} + * optional Instance instance = 1; + * @return {?proto.cc.arduino.cli.commands.v1.Instance} */ -proto.cc.arduino.cli.commands.v1.InitResponse.prototype.getDownloadProgress = function() { - return /** @type{?proto.cc.arduino.cli.commands.v1.DownloadProgress} */ ( - jspb.Message.getWrapperField(this, cc_arduino_cli_commands_v1_common_pb.DownloadProgress, 4)); +proto.cc.arduino.cli.commands.v1.InitRequest.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.DownloadProgress|undefined} value - * @return {!proto.cc.arduino.cli.commands.v1.InitResponse} returns this + * @param {?proto.cc.arduino.cli.commands.v1.Instance|undefined} value + * @return {!proto.cc.arduino.cli.commands.v1.InitRequest} returns this */ -proto.cc.arduino.cli.commands.v1.InitResponse.prototype.setDownloadProgress = function(value) { - return jspb.Message.setWrapperField(this, 4, value); +proto.cc.arduino.cli.commands.v1.InitRequest.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.InitResponse} returns this + * @return {!proto.cc.arduino.cli.commands.v1.InitRequest} returns this */ -proto.cc.arduino.cli.commands.v1.InitResponse.prototype.clearDownloadProgress = function() { - return this.setDownloadProgress(undefined); +proto.cc.arduino.cli.commands.v1.InitRequest.prototype.clearInstance = function() { + return this.setInstance(undefined); }; @@ -938,51 +934,40 @@ proto.cc.arduino.cli.commands.v1.InitResponse.prototype.clearDownloadProgress = * Returns whether this field is set. * @return {boolean} */ -proto.cc.arduino.cli.commands.v1.InitResponse.prototype.hasDownloadProgress = function() { - return jspb.Message.getField(this, 4) != null; +proto.cc.arduino.cli.commands.v1.InitRequest.prototype.hasInstance = function() { + return jspb.Message.getField(this, 1) != null; }; -/** - * optional TaskProgress task_progress = 5; - * @return {?proto.cc.arduino.cli.commands.v1.TaskProgress} - */ -proto.cc.arduino.cli.commands.v1.InitResponse.prototype.getTaskProgress = function() { - return /** @type{?proto.cc.arduino.cli.commands.v1.TaskProgress} */ ( - jspb.Message.getWrapperField(this, cc_arduino_cli_commands_v1_common_pb.TaskProgress, 5)); -}; - /** - * @param {?proto.cc.arduino.cli.commands.v1.TaskProgress|undefined} value - * @return {!proto.cc.arduino.cli.commands.v1.InitResponse} returns this -*/ -proto.cc.arduino.cli.commands.v1.InitResponse.prototype.setTaskProgress = function(value) { - return jspb.Message.setWrapperField(this, 5, 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>} + * @const + */ +proto.cc.arduino.cli.commands.v1.InitResponse.oneofGroups_ = [[1,2]]; /** - * Clears the message field making it undefined. - * @return {!proto.cc.arduino.cli.commands.v1.InitResponse} returns this + * @enum {number} */ -proto.cc.arduino.cli.commands.v1.InitResponse.prototype.clearTaskProgress = function() { - return this.setTaskProgress(undefined); +proto.cc.arduino.cli.commands.v1.InitResponse.MessageCase = { + MESSAGE_NOT_SET: 0, + INIT_PROGRESS: 1, + ERROR: 2 }; - /** - * Returns whether this field is set. - * @return {boolean} + * @return {proto.cc.arduino.cli.commands.v1.InitResponse.MessageCase} */ -proto.cc.arduino.cli.commands.v1.InitResponse.prototype.hasTaskProgress = function() { - return jspb.Message.getField(this, 5) != null; +proto.cc.arduino.cli.commands.v1.InitResponse.prototype.getMessageCase = function() { + return /** @type {proto.cc.arduino.cli.commands.v1.InitResponse.MessageCase} */(jspb.Message.computeOneofCase(this, proto.cc.arduino.cli.commands.v1.InitResponse.oneofGroups_[0])); }; - - if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. @@ -996,8 +981,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.cc.arduino.cli.commands.v1.DestroyRequest.prototype.toObject = function(opt_includeInstance) { - return proto.cc.arduino.cli.commands.v1.DestroyRequest.toObject(opt_includeInstance, this); +proto.cc.arduino.cli.commands.v1.InitResponse.prototype.toObject = function(opt_includeInstance) { + return proto.cc.arduino.cli.commands.v1.InitResponse.toObject(opt_includeInstance, this); }; @@ -1006,13 +991,14 @@ proto.cc.arduino.cli.commands.v1.DestroyRequest.prototype.toObject = function(op * @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.DestroyRequest} msg The msg instance to transform. + * @param {!proto.cc.arduino.cli.commands.v1.InitResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.cc.arduino.cli.commands.v1.DestroyRequest.toObject = function(includeInstance, msg) { +proto.cc.arduino.cli.commands.v1.InitResponse.toObject = function(includeInstance, msg) { var f, obj = { - instance: (f = msg.getInstance()) && cc_arduino_cli_commands_v1_common_pb.Instance.toObject(includeInstance, f) + initProgress: (f = msg.getInitProgress()) && proto.cc.arduino.cli.commands.v1.InitResponse.Progress.toObject(includeInstance, f), + error: (f = msg.getError()) && google_rpc_status_pb.Status.toObject(includeInstance, f) }; if (includeInstance) { @@ -1026,23 +1012,23 @@ proto.cc.arduino.cli.commands.v1.DestroyRequest.toObject = function(includeInsta /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.cc.arduino.cli.commands.v1.DestroyRequest} + * @return {!proto.cc.arduino.cli.commands.v1.InitResponse} */ -proto.cc.arduino.cli.commands.v1.DestroyRequest.deserializeBinary = function(bytes) { +proto.cc.arduino.cli.commands.v1.InitResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.cc.arduino.cli.commands.v1.DestroyRequest; - return proto.cc.arduino.cli.commands.v1.DestroyRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.cc.arduino.cli.commands.v1.InitResponse; + return proto.cc.arduino.cli.commands.v1.InitResponse.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.DestroyRequest} msg The message object to deserialize into. + * @param {!proto.cc.arduino.cli.commands.v1.InitResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.cc.arduino.cli.commands.v1.DestroyRequest} + * @return {!proto.cc.arduino.cli.commands.v1.InitResponse} */ -proto.cc.arduino.cli.commands.v1.DestroyRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.cc.arduino.cli.commands.v1.InitResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -1050,9 +1036,14 @@ proto.cc.arduino.cli.commands.v1.DestroyRequest.deserializeBinaryFromReader = fu 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); + var value = new proto.cc.arduino.cli.commands.v1.InitResponse.Progress; + reader.readMessage(value,proto.cc.arduino.cli.commands.v1.InitResponse.Progress.deserializeBinaryFromReader); + msg.setInitProgress(value); + break; + case 2: + var value = new google_rpc_status_pb.Status; + reader.readMessage(value,google_rpc_status_pb.Status.deserializeBinaryFromReader); + msg.setError(value); break; default: reader.skipField(); @@ -1067,9 +1058,9 @@ proto.cc.arduino.cli.commands.v1.DestroyRequest.deserializeBinaryFromReader = fu * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.cc.arduino.cli.commands.v1.DestroyRequest.prototype.serializeBinary = function() { +proto.cc.arduino.cli.commands.v1.InitResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.cc.arduino.cli.commands.v1.DestroyRequest.serializeBinaryToWriter(this, writer); + proto.cc.arduino.cli.commands.v1.InitResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -1077,57 +1068,28 @@ proto.cc.arduino.cli.commands.v1.DestroyRequest.prototype.serializeBinary = func /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.cc.arduino.cli.commands.v1.DestroyRequest} message + * @param {!proto.cc.arduino.cli.commands.v1.InitResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.cc.arduino.cli.commands.v1.DestroyRequest.serializeBinaryToWriter = function(message, writer) { +proto.cc.arduino.cli.commands.v1.InitResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getInstance(); + f = message.getInitProgress(); if (f != null) { writer.writeMessage( 1, f, - cc_arduino_cli_commands_v1_common_pb.Instance.serializeBinaryToWriter + proto.cc.arduino.cli.commands.v1.InitResponse.Progress.serializeBinaryToWriter + ); + } + f = message.getError(); + if (f != null) { + writer.writeMessage( + 2, + f, + google_rpc_status_pb.Status.serializeBinaryToWriter ); } -}; - - -/** - * optional Instance instance = 1; - * @return {?proto.cc.arduino.cli.commands.v1.Instance} - */ -proto.cc.arduino.cli.commands.v1.DestroyRequest.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.DestroyRequest} returns this -*/ -proto.cc.arduino.cli.commands.v1.DestroyRequest.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.DestroyRequest} returns this - */ -proto.cc.arduino.cli.commands.v1.DestroyRequest.prototype.clearInstance = function() { - return this.setInstance(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.cc.arduino.cli.commands.v1.DestroyRequest.prototype.hasInstance = function() { - return jspb.Message.getField(this, 1) != null; }; @@ -1147,8 +1109,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.cc.arduino.cli.commands.v1.DestroyResponse.prototype.toObject = function(opt_includeInstance) { - return proto.cc.arduino.cli.commands.v1.DestroyResponse.toObject(opt_includeInstance, this); +proto.cc.arduino.cli.commands.v1.InitResponse.Progress.prototype.toObject = function(opt_includeInstance) { + return proto.cc.arduino.cli.commands.v1.InitResponse.Progress.toObject(opt_includeInstance, this); }; @@ -1157,13 +1119,14 @@ proto.cc.arduino.cli.commands.v1.DestroyResponse.prototype.toObject = function(o * @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.DestroyResponse} msg The msg instance to transform. + * @param {!proto.cc.arduino.cli.commands.v1.InitResponse.Progress} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.cc.arduino.cli.commands.v1.DestroyResponse.toObject = function(includeInstance, msg) { +proto.cc.arduino.cli.commands.v1.InitResponse.Progress.toObject = function(includeInstance, msg) { var f, obj = { - + downloadProgress: (f = msg.getDownloadProgress()) && cc_arduino_cli_commands_v1_common_pb.DownloadProgress.toObject(includeInstance, f), + taskProgress: (f = msg.getTaskProgress()) && cc_arduino_cli_commands_v1_common_pb.TaskProgress.toObject(includeInstance, f) }; if (includeInstance) { @@ -1177,29 +1140,39 @@ proto.cc.arduino.cli.commands.v1.DestroyResponse.toObject = function(includeInst /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.cc.arduino.cli.commands.v1.DestroyResponse} + * @return {!proto.cc.arduino.cli.commands.v1.InitResponse.Progress} */ -proto.cc.arduino.cli.commands.v1.DestroyResponse.deserializeBinary = function(bytes) { +proto.cc.arduino.cli.commands.v1.InitResponse.Progress.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.cc.arduino.cli.commands.v1.DestroyResponse; - return proto.cc.arduino.cli.commands.v1.DestroyResponse.deserializeBinaryFromReader(msg, reader); + var msg = new proto.cc.arduino.cli.commands.v1.InitResponse.Progress; + return proto.cc.arduino.cli.commands.v1.InitResponse.Progress.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.DestroyResponse} msg The message object to deserialize into. + * @param {!proto.cc.arduino.cli.commands.v1.InitResponse.Progress} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.cc.arduino.cli.commands.v1.DestroyResponse} + * @return {!proto.cc.arduino.cli.commands.v1.InitResponse.Progress} */ -proto.cc.arduino.cli.commands.v1.DestroyResponse.deserializeBinaryFromReader = function(msg, reader) { +proto.cc.arduino.cli.commands.v1.InitResponse.Progress.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_common_pb.DownloadProgress; + reader.readMessage(value,cc_arduino_cli_commands_v1_common_pb.DownloadProgress.deserializeBinaryFromReader); + msg.setDownloadProgress(value); + break; + case 2: + var value = new cc_arduino_cli_commands_v1_common_pb.TaskProgress; + reader.readMessage(value,cc_arduino_cli_commands_v1_common_pb.TaskProgress.deserializeBinaryFromReader); + msg.setTaskProgress(value); + break; default: reader.skipField(); break; @@ -1213,9 +1186,9 @@ proto.cc.arduino.cli.commands.v1.DestroyResponse.deserializeBinaryFromReader = f * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.cc.arduino.cli.commands.v1.DestroyResponse.prototype.serializeBinary = function() { +proto.cc.arduino.cli.commands.v1.InitResponse.Progress.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.cc.arduino.cli.commands.v1.DestroyResponse.serializeBinaryToWriter(this, writer); + proto.cc.arduino.cli.commands.v1.InitResponse.Progress.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -1223,12 +1196,176 @@ proto.cc.arduino.cli.commands.v1.DestroyResponse.prototype.serializeBinary = fun /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.cc.arduino.cli.commands.v1.DestroyResponse} message + * @param {!proto.cc.arduino.cli.commands.v1.InitResponse.Progress} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.cc.arduino.cli.commands.v1.DestroyResponse.serializeBinaryToWriter = function(message, writer) { +proto.cc.arduino.cli.commands.v1.InitResponse.Progress.serializeBinaryToWriter = function(message, writer) { var f = undefined; + f = message.getDownloadProgress(); + if (f != null) { + writer.writeMessage( + 1, + f, + cc_arduino_cli_commands_v1_common_pb.DownloadProgress.serializeBinaryToWriter + ); + } + f = message.getTaskProgress(); + if (f != null) { + writer.writeMessage( + 2, + f, + cc_arduino_cli_commands_v1_common_pb.TaskProgress.serializeBinaryToWriter + ); + } +}; + + +/** + * optional DownloadProgress download_progress = 1; + * @return {?proto.cc.arduino.cli.commands.v1.DownloadProgress} + */ +proto.cc.arduino.cli.commands.v1.InitResponse.Progress.prototype.getDownloadProgress = function() { + return /** @type{?proto.cc.arduino.cli.commands.v1.DownloadProgress} */ ( + jspb.Message.getWrapperField(this, cc_arduino_cli_commands_v1_common_pb.DownloadProgress, 1)); +}; + + +/** + * @param {?proto.cc.arduino.cli.commands.v1.DownloadProgress|undefined} value + * @return {!proto.cc.arduino.cli.commands.v1.InitResponse.Progress} returns this +*/ +proto.cc.arduino.cli.commands.v1.InitResponse.Progress.prototype.setDownloadProgress = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.cc.arduino.cli.commands.v1.InitResponse.Progress} returns this + */ +proto.cc.arduino.cli.commands.v1.InitResponse.Progress.prototype.clearDownloadProgress = function() { + return this.setDownloadProgress(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.cc.arduino.cli.commands.v1.InitResponse.Progress.prototype.hasDownloadProgress = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional TaskProgress task_progress = 2; + * @return {?proto.cc.arduino.cli.commands.v1.TaskProgress} + */ +proto.cc.arduino.cli.commands.v1.InitResponse.Progress.prototype.getTaskProgress = function() { + return /** @type{?proto.cc.arduino.cli.commands.v1.TaskProgress} */ ( + jspb.Message.getWrapperField(this, cc_arduino_cli_commands_v1_common_pb.TaskProgress, 2)); +}; + + +/** + * @param {?proto.cc.arduino.cli.commands.v1.TaskProgress|undefined} value + * @return {!proto.cc.arduino.cli.commands.v1.InitResponse.Progress} returns this +*/ +proto.cc.arduino.cli.commands.v1.InitResponse.Progress.prototype.setTaskProgress = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.cc.arduino.cli.commands.v1.InitResponse.Progress} returns this + */ +proto.cc.arduino.cli.commands.v1.InitResponse.Progress.prototype.clearTaskProgress = function() { + return this.setTaskProgress(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.cc.arduino.cli.commands.v1.InitResponse.Progress.prototype.hasTaskProgress = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional Progress init_progress = 1; + * @return {?proto.cc.arduino.cli.commands.v1.InitResponse.Progress} + */ +proto.cc.arduino.cli.commands.v1.InitResponse.prototype.getInitProgress = function() { + return /** @type{?proto.cc.arduino.cli.commands.v1.InitResponse.Progress} */ ( + jspb.Message.getWrapperField(this, proto.cc.arduino.cli.commands.v1.InitResponse.Progress, 1)); +}; + + +/** + * @param {?proto.cc.arduino.cli.commands.v1.InitResponse.Progress|undefined} value + * @return {!proto.cc.arduino.cli.commands.v1.InitResponse} returns this +*/ +proto.cc.arduino.cli.commands.v1.InitResponse.prototype.setInitProgress = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.cc.arduino.cli.commands.v1.InitResponse.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.cc.arduino.cli.commands.v1.InitResponse} returns this + */ +proto.cc.arduino.cli.commands.v1.InitResponse.prototype.clearInitProgress = function() { + return this.setInitProgress(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.cc.arduino.cli.commands.v1.InitResponse.prototype.hasInitProgress = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional google.rpc.Status error = 2; + * @return {?proto.google.rpc.Status} + */ +proto.cc.arduino.cli.commands.v1.InitResponse.prototype.getError = function() { + return /** @type{?proto.google.rpc.Status} */ ( + jspb.Message.getWrapperField(this, google_rpc_status_pb.Status, 2)); +}; + + +/** + * @param {?proto.google.rpc.Status|undefined} value + * @return {!proto.cc.arduino.cli.commands.v1.InitResponse} returns this +*/ +proto.cc.arduino.cli.commands.v1.InitResponse.prototype.setError = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.cc.arduino.cli.commands.v1.InitResponse.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.cc.arduino.cli.commands.v1.InitResponse} returns this + */ +proto.cc.arduino.cli.commands.v1.InitResponse.prototype.clearError = function() { + return this.setError(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.cc.arduino.cli.commands.v1.InitResponse.prototype.hasError = function() { + return jspb.Message.getField(this, 2) != null; }; @@ -1248,8 +1385,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.cc.arduino.cli.commands.v1.RescanRequest.prototype.toObject = function(opt_includeInstance) { - return proto.cc.arduino.cli.commands.v1.RescanRequest.toObject(opt_includeInstance, this); +proto.cc.arduino.cli.commands.v1.DestroyRequest.prototype.toObject = function(opt_includeInstance) { + return proto.cc.arduino.cli.commands.v1.DestroyRequest.toObject(opt_includeInstance, this); }; @@ -1258,11 +1395,11 @@ proto.cc.arduino.cli.commands.v1.RescanRequest.prototype.toObject = function(opt * @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.RescanRequest} msg The msg instance to transform. + * @param {!proto.cc.arduino.cli.commands.v1.DestroyRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.cc.arduino.cli.commands.v1.RescanRequest.toObject = function(includeInstance, msg) { +proto.cc.arduino.cli.commands.v1.DestroyRequest.toObject = function(includeInstance, msg) { var f, obj = { instance: (f = msg.getInstance()) && cc_arduino_cli_commands_v1_common_pb.Instance.toObject(includeInstance, f) }; @@ -1278,23 +1415,23 @@ proto.cc.arduino.cli.commands.v1.RescanRequest.toObject = function(includeInstan /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.cc.arduino.cli.commands.v1.RescanRequest} + * @return {!proto.cc.arduino.cli.commands.v1.DestroyRequest} */ -proto.cc.arduino.cli.commands.v1.RescanRequest.deserializeBinary = function(bytes) { +proto.cc.arduino.cli.commands.v1.DestroyRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.cc.arduino.cli.commands.v1.RescanRequest; - return proto.cc.arduino.cli.commands.v1.RescanRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.cc.arduino.cli.commands.v1.DestroyRequest; + return proto.cc.arduino.cli.commands.v1.DestroyRequest.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.RescanRequest} msg The message object to deserialize into. + * @param {!proto.cc.arduino.cli.commands.v1.DestroyRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.cc.arduino.cli.commands.v1.RescanRequest} + * @return {!proto.cc.arduino.cli.commands.v1.DestroyRequest} */ -proto.cc.arduino.cli.commands.v1.RescanRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.cc.arduino.cli.commands.v1.DestroyRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -1319,9 +1456,9 @@ proto.cc.arduino.cli.commands.v1.RescanRequest.deserializeBinaryFromReader = fun * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.cc.arduino.cli.commands.v1.RescanRequest.prototype.serializeBinary = function() { +proto.cc.arduino.cli.commands.v1.DestroyRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.cc.arduino.cli.commands.v1.RescanRequest.serializeBinaryToWriter(this, writer); + proto.cc.arduino.cli.commands.v1.DestroyRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -1329,11 +1466,11 @@ proto.cc.arduino.cli.commands.v1.RescanRequest.prototype.serializeBinary = funct /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.cc.arduino.cli.commands.v1.RescanRequest} message + * @param {!proto.cc.arduino.cli.commands.v1.DestroyRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.cc.arduino.cli.commands.v1.RescanRequest.serializeBinaryToWriter = function(message, writer) { +proto.cc.arduino.cli.commands.v1.DestroyRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getInstance(); if (f != null) { @@ -1350,7 +1487,7 @@ proto.cc.arduino.cli.commands.v1.RescanRequest.serializeBinaryToWriter = functio * optional Instance instance = 1; * @return {?proto.cc.arduino.cli.commands.v1.Instance} */ -proto.cc.arduino.cli.commands.v1.RescanRequest.prototype.getInstance = function() { +proto.cc.arduino.cli.commands.v1.DestroyRequest.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)); }; @@ -1358,18 +1495,18 @@ proto.cc.arduino.cli.commands.v1.RescanRequest.prototype.getInstance = function( /** * @param {?proto.cc.arduino.cli.commands.v1.Instance|undefined} value - * @return {!proto.cc.arduino.cli.commands.v1.RescanRequest} returns this + * @return {!proto.cc.arduino.cli.commands.v1.DestroyRequest} returns this */ -proto.cc.arduino.cli.commands.v1.RescanRequest.prototype.setInstance = function(value) { +proto.cc.arduino.cli.commands.v1.DestroyRequest.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.RescanRequest} returns this + * @return {!proto.cc.arduino.cli.commands.v1.DestroyRequest} returns this */ -proto.cc.arduino.cli.commands.v1.RescanRequest.prototype.clearInstance = function() { +proto.cc.arduino.cli.commands.v1.DestroyRequest.prototype.clearInstance = function() { return this.setInstance(undefined); }; @@ -1378,19 +1515,12 @@ proto.cc.arduino.cli.commands.v1.RescanRequest.prototype.clearInstance = functio * Returns whether this field is set. * @return {boolean} */ -proto.cc.arduino.cli.commands.v1.RescanRequest.prototype.hasInstance = function() { +proto.cc.arduino.cli.commands.v1.DestroyRequest.prototype.hasInstance = function() { return jspb.Message.getField(this, 1) != null; }; -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.cc.arduino.cli.commands.v1.RescanResponse.repeatedFields_ = [1]; - if (jspb.Message.GENERATE_TO_OBJECT) { @@ -1406,8 +1536,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.cc.arduino.cli.commands.v1.RescanResponse.prototype.toObject = function(opt_includeInstance) { - return proto.cc.arduino.cli.commands.v1.RescanResponse.toObject(opt_includeInstance, this); +proto.cc.arduino.cli.commands.v1.DestroyResponse.prototype.toObject = function(opt_includeInstance) { + return proto.cc.arduino.cli.commands.v1.DestroyResponse.toObject(opt_includeInstance, this); }; @@ -1416,14 +1546,13 @@ proto.cc.arduino.cli.commands.v1.RescanResponse.prototype.toObject = function(op * @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.RescanResponse} msg The msg instance to transform. + * @param {!proto.cc.arduino.cli.commands.v1.DestroyResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.cc.arduino.cli.commands.v1.RescanResponse.toObject = function(includeInstance, msg) { +proto.cc.arduino.cli.commands.v1.DestroyResponse.toObject = function(includeInstance, msg) { var f, obj = { - platformsIndexErrorsList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f, - librariesIndexError: jspb.Message.getFieldWithDefault(msg, 2, "") + }; if (includeInstance) { @@ -1437,37 +1566,29 @@ proto.cc.arduino.cli.commands.v1.RescanResponse.toObject = function(includeInsta /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.cc.arduino.cli.commands.v1.RescanResponse} + * @return {!proto.cc.arduino.cli.commands.v1.DestroyResponse} */ -proto.cc.arduino.cli.commands.v1.RescanResponse.deserializeBinary = function(bytes) { +proto.cc.arduino.cli.commands.v1.DestroyResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.cc.arduino.cli.commands.v1.RescanResponse; - return proto.cc.arduino.cli.commands.v1.RescanResponse.deserializeBinaryFromReader(msg, reader); + var msg = new proto.cc.arduino.cli.commands.v1.DestroyResponse; + return proto.cc.arduino.cli.commands.v1.DestroyResponse.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.RescanResponse} msg The message object to deserialize into. + * @param {!proto.cc.arduino.cli.commands.v1.DestroyResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.cc.arduino.cli.commands.v1.RescanResponse} + * @return {!proto.cc.arduino.cli.commands.v1.DestroyResponse} */ -proto.cc.arduino.cli.commands.v1.RescanResponse.deserializeBinaryFromReader = function(msg, reader) { +proto.cc.arduino.cli.commands.v1.DestroyResponse.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.addPlatformsIndexErrors(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setLibrariesIndexError(value); - break; default: reader.skipField(); break; @@ -1481,9 +1602,9 @@ proto.cc.arduino.cli.commands.v1.RescanResponse.deserializeBinaryFromReader = fu * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.cc.arduino.cli.commands.v1.RescanResponse.prototype.serializeBinary = function() { +proto.cc.arduino.cli.commands.v1.DestroyResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.cc.arduino.cli.commands.v1.RescanResponse.serializeBinaryToWriter(this, writer); + proto.cc.arduino.cli.commands.v1.DestroyResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -1491,81 +1612,12 @@ proto.cc.arduino.cli.commands.v1.RescanResponse.prototype.serializeBinary = func /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.cc.arduino.cli.commands.v1.RescanResponse} message + * @param {!proto.cc.arduino.cli.commands.v1.DestroyResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.cc.arduino.cli.commands.v1.RescanResponse.serializeBinaryToWriter = function(message, writer) { +proto.cc.arduino.cli.commands.v1.DestroyResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getPlatformsIndexErrorsList(); - if (f.length > 0) { - writer.writeRepeatedString( - 1, - f - ); - } - f = message.getLibrariesIndexError(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } -}; - - -/** - * repeated string platforms_index_errors = 1; - * @return {!Array} - */ -proto.cc.arduino.cli.commands.v1.RescanResponse.prototype.getPlatformsIndexErrorsList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); -}; - - -/** - * @param {!Array} value - * @return {!proto.cc.arduino.cli.commands.v1.RescanResponse} returns this - */ -proto.cc.arduino.cli.commands.v1.RescanResponse.prototype.setPlatformsIndexErrorsList = function(value) { - return jspb.Message.setField(this, 1, value || []); -}; - - -/** - * @param {string} value - * @param {number=} opt_index - * @return {!proto.cc.arduino.cli.commands.v1.RescanResponse} returns this - */ -proto.cc.arduino.cli.commands.v1.RescanResponse.prototype.addPlatformsIndexErrors = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 1, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.cc.arduino.cli.commands.v1.RescanResponse} returns this - */ -proto.cc.arduino.cli.commands.v1.RescanResponse.prototype.clearPlatformsIndexErrorsList = function() { - return this.setPlatformsIndexErrorsList([]); -}; - - -/** - * optional string libraries_index_error = 2; - * @return {string} - */ -proto.cc.arduino.cli.commands.v1.RescanResponse.prototype.getLibrariesIndexError = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.cc.arduino.cli.commands.v1.RescanResponse} returns this - */ -proto.cc.arduino.cli.commands.v1.RescanResponse.prototype.setLibrariesIndexError = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); }; @@ -4239,4 +4291,4 @@ proto.cc.arduino.cli.commands.v1.ArchiveSketchResponse.serializeBinaryToWriter = }; -goog.object.extend(exports, proto.cc.arduino.cli.commands.v1); +goog.object.extend(exports, proto.cc.arduino.cli.commands.v1); \ No newline at end of file diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/core_pb.d.ts b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/core_pb.d.ts index b67beed5f..77c274051 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/core_pb.d.ts +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/core_pb.d.ts @@ -194,6 +194,23 @@ export namespace PlatformUninstallResponse { } } +export class AlreadyAtLatestVersionError extends jspb.Message { + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): AlreadyAtLatestVersionError.AsObject; + static toObject(includeInstance: boolean, msg: AlreadyAtLatestVersionError): AlreadyAtLatestVersionError.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: AlreadyAtLatestVersionError, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): AlreadyAtLatestVersionError; + static deserializeBinaryFromReader(message: AlreadyAtLatestVersionError, reader: jspb.BinaryReader): AlreadyAtLatestVersionError; +} + +export namespace AlreadyAtLatestVersionError { + export type AsObject = { + } +} + export class PlatformUpgradeRequest extends jspb.Message { hasInstance(): boolean; @@ -369,4 +386,4 @@ export namespace PlatformListResponse { export type AsObject = { installedPlatformsList: Array, } -} +} \ No newline at end of file diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/core_pb.js b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/core_pb.js index edf65eb83..b783b0521 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/core_pb.js +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/core_pb.js @@ -17,6 +17,7 @@ var global = Function('return this')(); var cc_arduino_cli_commands_v1_common_pb = require('../../../../../cc/arduino/cli/commands/v1/common_pb.js'); goog.object.extend(proto, cc_arduino_cli_commands_v1_common_pb); +goog.exportSymbol('proto.cc.arduino.cli.commands.v1.AlreadyAtLatestVersionError', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.PlatformDownloadRequest', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.PlatformDownloadResponse', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.PlatformInstallRequest', null, global); @@ -155,6 +156,27 @@ if (goog.DEBUG && !COMPILED) { */ proto.cc.arduino.cli.commands.v1.PlatformUninstallResponse.displayName = 'proto.cc.arduino.cli.commands.v1.PlatformUninstallResponse'; } +/** + * 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.AlreadyAtLatestVersionError = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.cc.arduino.cli.commands.v1.AlreadyAtLatestVersionError, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.cc.arduino.cli.commands.v1.AlreadyAtLatestVersionError.displayName = 'proto.cc.arduino.cli.commands.v1.AlreadyAtLatestVersionError'; +} /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -1511,6 +1533,107 @@ proto.cc.arduino.cli.commands.v1.PlatformUninstallResponse.prototype.hasTaskProg +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.AlreadyAtLatestVersionError.prototype.toObject = function(opt_includeInstance) { + return proto.cc.arduino.cli.commands.v1.AlreadyAtLatestVersionError.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.AlreadyAtLatestVersionError} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.cc.arduino.cli.commands.v1.AlreadyAtLatestVersionError.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.commands.v1.AlreadyAtLatestVersionError} + */ +proto.cc.arduino.cli.commands.v1.AlreadyAtLatestVersionError.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.cc.arduino.cli.commands.v1.AlreadyAtLatestVersionError; + return proto.cc.arduino.cli.commands.v1.AlreadyAtLatestVersionError.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.AlreadyAtLatestVersionError} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.cc.arduino.cli.commands.v1.AlreadyAtLatestVersionError} + */ +proto.cc.arduino.cli.commands.v1.AlreadyAtLatestVersionError.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.commands.v1.AlreadyAtLatestVersionError.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.cc.arduino.cli.commands.v1.AlreadyAtLatestVersionError.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.AlreadyAtLatestVersionError} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.cc.arduino.cli.commands.v1.AlreadyAtLatestVersionError.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + + + if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. @@ -2693,4 +2816,4 @@ proto.cc.arduino.cli.commands.v1.PlatformListResponse.prototype.clearInstalledPl }; -goog.object.extend(exports, proto.cc.arduino.cli.commands.v1); +goog.object.extend(exports, proto.cc.arduino.cli.commands.v1); \ No newline at end of file diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/port_grpc_pb.js b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/port_grpc_pb.js new file mode 100644 index 000000000..97b3a2461 --- /dev/null +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/port_grpc_pb.js @@ -0,0 +1 @@ +// GENERATED CODE -- NO SERVICES IN PROTO \ No newline at end of file diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/port_pb.d.ts b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/port_pb.d.ts new file mode 100644 index 000000000..ee504921f --- /dev/null +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/port_pb.d.ts @@ -0,0 +1,46 @@ +// package: cc.arduino.cli.commands.v1 +// file: cc/arduino/cli/commands/v1/port.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as jspb from "google-protobuf"; + +export class Port extends jspb.Message { + getAddress(): string; + setAddress(value: string): Port; + + getLabel(): string; + setLabel(value: string): Port; + + getProtocol(): string; + setProtocol(value: string): Port; + + getProtocolLabel(): string; + setProtocolLabel(value: string): Port; + + + getPropertiesMap(): jspb.Map; + clearPropertiesMap(): void; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Port.AsObject; + static toObject(includeInstance: boolean, msg: Port): Port.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Port, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Port; + static deserializeBinaryFromReader(message: Port, reader: jspb.BinaryReader): Port; +} + +export namespace Port { + export type AsObject = { + address: string, + label: string, + protocol: string, + protocolLabel: string, + + propertiesMap: Array<[string, string]>, + } +} \ No newline at end of file diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/port_pb.js b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/port_pb.js new file mode 100644 index 000000000..1178f61b0 --- /dev/null +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/port_pb.js @@ -0,0 +1,293 @@ +// source: cc/arduino/cli/commands/v1/port.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = Function('return this')(); + +goog.exportSymbol('proto.cc.arduino.cli.commands.v1.Port', null, global); +/** + * 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.Port = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.cc.arduino.cli.commands.v1.Port, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.cc.arduino.cli.commands.v1.Port.displayName = 'proto.cc.arduino.cli.commands.v1.Port'; +} + + + +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.Port.prototype.toObject = function(opt_includeInstance) { + return proto.cc.arduino.cli.commands.v1.Port.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.Port} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.cc.arduino.cli.commands.v1.Port.toObject = function(includeInstance, msg) { + var f, obj = { + address: jspb.Message.getFieldWithDefault(msg, 1, ""), + label: jspb.Message.getFieldWithDefault(msg, 2, ""), + protocol: jspb.Message.getFieldWithDefault(msg, 3, ""), + protocolLabel: jspb.Message.getFieldWithDefault(msg, 4, ""), + propertiesMap: (f = msg.getPropertiesMap()) ? f.toObject(includeInstance, undefined) : [] + }; + + 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.Port} + */ +proto.cc.arduino.cli.commands.v1.Port.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.cc.arduino.cli.commands.v1.Port; + return proto.cc.arduino.cli.commands.v1.Port.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.Port} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.cc.arduino.cli.commands.v1.Port} + */ +proto.cc.arduino.cli.commands.v1.Port.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.setAddress(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setLabel(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setProtocol(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setProtocolLabel(value); + break; + case 5: + var value = msg.getPropertiesMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + 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.Port.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.cc.arduino.cli.commands.v1.Port.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.Port} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.cc.arduino.cli.commands.v1.Port.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getAddress(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getLabel(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getProtocol(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getProtocolLabel(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getPropertiesMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(5, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } +}; + + +/** + * optional string address = 1; + * @return {string} + */ +proto.cc.arduino.cli.commands.v1.Port.prototype.getAddress = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.cc.arduino.cli.commands.v1.Port} returns this + */ +proto.cc.arduino.cli.commands.v1.Port.prototype.setAddress = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string label = 2; + * @return {string} + */ +proto.cc.arduino.cli.commands.v1.Port.prototype.getLabel = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.cc.arduino.cli.commands.v1.Port} returns this + */ +proto.cc.arduino.cli.commands.v1.Port.prototype.setLabel = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string protocol = 3; + * @return {string} + */ +proto.cc.arduino.cli.commands.v1.Port.prototype.getProtocol = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.cc.arduino.cli.commands.v1.Port} returns this + */ +proto.cc.arduino.cli.commands.v1.Port.prototype.setProtocol = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string protocol_label = 4; + * @return {string} + */ +proto.cc.arduino.cli.commands.v1.Port.prototype.getProtocolLabel = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.cc.arduino.cli.commands.v1.Port} returns this + */ +proto.cc.arduino.cli.commands.v1.Port.prototype.setProtocolLabel = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * map properties = 5; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.cc.arduino.cli.commands.v1.Port.prototype.getPropertiesMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 5, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.cc.arduino.cli.commands.v1.Port} returns this + */ +proto.cc.arduino.cli.commands.v1.Port.prototype.clearPropertiesMap = function() { + this.getPropertiesMap().clear(); + return this;}; + + +goog.object.extend(exports, proto.cc.arduino.cli.commands.v1); \ No newline at end of file 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 170f144e6..73c5bf59e 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 @@ -6,6 +6,7 @@ import * as jspb from "google-protobuf"; import * as cc_arduino_cli_commands_v1_common_pb from "../../../../../cc/arduino/cli/commands/v1/common_pb"; +import * as cc_arduino_cli_commands_v1_port_pb from "../../../../../cc/arduino/cli/commands/v1/port_pb"; export class UploadRequest extends jspb.Message { @@ -20,8 +21,11 @@ export class UploadRequest extends jspb.Message { getSketchPath(): string; setSketchPath(value: string): UploadRequest; - getPort(): string; - setPort(value: string): UploadRequest; + + hasPort(): boolean; + clearPort(): void; + getPort(): cc_arduino_cli_commands_v1_port_pb.Port | undefined; + setPort(value?: cc_arduino_cli_commands_v1_port_pb.Port): UploadRequest; getVerbose(): boolean; setVerbose(value: boolean): UploadRequest; @@ -38,6 +42,13 @@ export class UploadRequest extends jspb.Message { getProgrammer(): string; setProgrammer(value: string): UploadRequest; + getDryRun(): boolean; + setDryRun(value: boolean): UploadRequest; + + + getUserFieldsMap(): jspb.Map; + clearUserFieldsMap(): void; + serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): UploadRequest.AsObject; @@ -54,12 +65,15 @@ export namespace UploadRequest { instance?: cc_arduino_cli_commands_v1_common_pb.Instance.AsObject, fqbn: string, sketchPath: string, - port: string, + port?: cc_arduino_cli_commands_v1_port_pb.Port.AsObject, verbose: boolean, verify: boolean, importFile: string, importDir: string, programmer: string, + dryRun: boolean, + + userFieldsMap: Array<[string, string]>, } } @@ -92,6 +106,23 @@ export namespace UploadResponse { } } +export class ProgrammerIsRequiredForUploadError extends jspb.Message { + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ProgrammerIsRequiredForUploadError.AsObject; + static toObject(includeInstance: boolean, msg: ProgrammerIsRequiredForUploadError): ProgrammerIsRequiredForUploadError.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ProgrammerIsRequiredForUploadError, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ProgrammerIsRequiredForUploadError; + static deserializeBinaryFromReader(message: ProgrammerIsRequiredForUploadError, reader: jspb.BinaryReader): ProgrammerIsRequiredForUploadError; +} + +export namespace ProgrammerIsRequiredForUploadError { + export type AsObject = { + } +} + export class UploadUsingProgrammerRequest extends jspb.Message { hasInstance(): boolean; @@ -105,8 +136,11 @@ export class UploadUsingProgrammerRequest extends jspb.Message { getSketchPath(): string; setSketchPath(value: string): UploadUsingProgrammerRequest; - getPort(): string; - setPort(value: string): UploadUsingProgrammerRequest; + + hasPort(): boolean; + clearPort(): void; + getPort(): cc_arduino_cli_commands_v1_port_pb.Port | undefined; + setPort(value?: cc_arduino_cli_commands_v1_port_pb.Port): UploadUsingProgrammerRequest; getVerbose(): boolean; setVerbose(value: boolean): UploadUsingProgrammerRequest; @@ -123,6 +157,13 @@ export class UploadUsingProgrammerRequest extends jspb.Message { getProgrammer(): string; setProgrammer(value: string): UploadUsingProgrammerRequest; + getDryRun(): boolean; + setDryRun(value: boolean): UploadUsingProgrammerRequest; + + + getUserFieldsMap(): jspb.Map; + clearUserFieldsMap(): void; + serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): UploadUsingProgrammerRequest.AsObject; @@ -139,12 +180,15 @@ export namespace UploadUsingProgrammerRequest { instance?: cc_arduino_cli_commands_v1_common_pb.Instance.AsObject, fqbn: string, sketchPath: string, - port: string, + port?: cc_arduino_cli_commands_v1_port_pb.Port.AsObject, verbose: boolean, verify: boolean, importFile: string, importDir: string, programmer: string, + dryRun: boolean, + + userFieldsMap: Array<[string, string]>, } } @@ -187,8 +231,11 @@ export class BurnBootloaderRequest extends jspb.Message { getFqbn(): string; setFqbn(value: string): BurnBootloaderRequest; - getPort(): string; - setPort(value: string): BurnBootloaderRequest; + + hasPort(): boolean; + clearPort(): void; + getPort(): cc_arduino_cli_commands_v1_port_pb.Port | undefined; + setPort(value?: cc_arduino_cli_commands_v1_port_pb.Port): BurnBootloaderRequest; getVerbose(): boolean; setVerbose(value: boolean): BurnBootloaderRequest; @@ -199,6 +246,13 @@ export class BurnBootloaderRequest extends jspb.Message { getProgrammer(): string; setProgrammer(value: string): BurnBootloaderRequest; + getDryRun(): boolean; + setDryRun(value: boolean): BurnBootloaderRequest; + + + getUserFieldsMap(): jspb.Map; + clearUserFieldsMap(): void; + serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): BurnBootloaderRequest.AsObject; @@ -214,10 +268,13 @@ export namespace BurnBootloaderRequest { export type AsObject = { instance?: cc_arduino_cli_commands_v1_common_pb.Instance.AsObject, fqbn: string, - port: string, + port?: cc_arduino_cli_commands_v1_port_pb.Port.AsObject, verbose: boolean, verify: boolean, programmer: string, + dryRun: boolean, + + userFieldsMap: Array<[string, string]>, } } @@ -300,3 +357,91 @@ export namespace ListProgrammersAvailableForUploadResponse { programmersList: Array, } } + +export class SupportedUserFieldsRequest 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): SupportedUserFieldsRequest; + + getFqbn(): string; + setFqbn(value: string): SupportedUserFieldsRequest; + + getProtocol(): string; + setProtocol(value: string): SupportedUserFieldsRequest; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SupportedUserFieldsRequest.AsObject; + static toObject(includeInstance: boolean, msg: SupportedUserFieldsRequest): SupportedUserFieldsRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SupportedUserFieldsRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SupportedUserFieldsRequest; + static deserializeBinaryFromReader(message: SupportedUserFieldsRequest, reader: jspb.BinaryReader): SupportedUserFieldsRequest; +} + +export namespace SupportedUserFieldsRequest { + export type AsObject = { + instance?: cc_arduino_cli_commands_v1_common_pb.Instance.AsObject, + fqbn: string, + protocol: string, + } +} + +export class UserField extends jspb.Message { + getToolId(): string; + setToolId(value: string): UserField; + + getName(): string; + setName(value: string): UserField; + + getLabel(): string; + setLabel(value: string): UserField; + + getSecret(): boolean; + setSecret(value: boolean): UserField; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): UserField.AsObject; + static toObject(includeInstance: boolean, msg: UserField): UserField.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: UserField, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): UserField; + static deserializeBinaryFromReader(message: UserField, reader: jspb.BinaryReader): UserField; +} + +export namespace UserField { + export type AsObject = { + toolId: string, + name: string, + label: string, + secret: boolean, + } +} + +export class SupportedUserFieldsResponse extends jspb.Message { + clearUserFieldsList(): void; + getUserFieldsList(): Array; + setUserFieldsList(value: Array): SupportedUserFieldsResponse; + addUserFields(value?: UserField, index?: number): UserField; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SupportedUserFieldsResponse.AsObject; + static toObject(includeInstance: boolean, msg: SupportedUserFieldsResponse): SupportedUserFieldsResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SupportedUserFieldsResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SupportedUserFieldsResponse; + static deserializeBinaryFromReader(message: SupportedUserFieldsResponse, reader: jspb.BinaryReader): SupportedUserFieldsResponse; +} + +export namespace SupportedUserFieldsResponse { + export type AsObject = { + userFieldsList: Array, + } +} \ No newline at end of file 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 be06b513d..9bc9637ee 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 @@ -17,14 +17,20 @@ var global = Function('return this')(); var cc_arduino_cli_commands_v1_common_pb = require('../../../../../cc/arduino/cli/commands/v1/common_pb.js'); goog.object.extend(proto, cc_arduino_cli_commands_v1_common_pb); +var cc_arduino_cli_commands_v1_port_pb = require('../../../../../cc/arduino/cli/commands/v1/port_pb.js'); +goog.object.extend(proto, cc_arduino_cli_commands_v1_port_pb); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.BurnBootloaderRequest', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.BurnBootloaderResponse', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.ListProgrammersAvailableForUploadRequest', null, global); goog.exportSymbol('proto.cc.arduino.cli.commands.v1.ListProgrammersAvailableForUploadResponse', null, global); +goog.exportSymbol('proto.cc.arduino.cli.commands.v1.ProgrammerIsRequiredForUploadError', null, global); +goog.exportSymbol('proto.cc.arduino.cli.commands.v1.SupportedUserFieldsRequest', null, global); +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.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); /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -67,6 +73,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.ProgrammerIsRequiredForUploadError = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.cc.arduino.cli.commands.v1.ProgrammerIsRequiredForUploadError, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.cc.arduino.cli.commands.v1.ProgrammerIsRequiredForUploadError.displayName = 'proto.cc.arduino.cli.commands.v1.ProgrammerIsRequiredForUploadError'; +} /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -193,6 +220,69 @@ if (goog.DEBUG && !COMPILED) { */ proto.cc.arduino.cli.commands.v1.ListProgrammersAvailableForUploadResponse.displayName = 'proto.cc.arduino.cli.commands.v1.ListProgrammersAvailableForUploadResponse'; } +/** + * 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.SupportedUserFieldsRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.cc.arduino.cli.commands.v1.SupportedUserFieldsRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.cc.arduino.cli.commands.v1.SupportedUserFieldsRequest.displayName = 'proto.cc.arduino.cli.commands.v1.SupportedUserFieldsRequest'; +} +/** + * 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.UserField = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.cc.arduino.cli.commands.v1.UserField, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.cc.arduino.cli.commands.v1.UserField.displayName = 'proto.cc.arduino.cli.commands.v1.UserField'; +} +/** + * 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.SupportedUserFieldsResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.cc.arduino.cli.commands.v1.SupportedUserFieldsResponse.repeatedFields_, null); +}; +goog.inherits(proto.cc.arduino.cli.commands.v1.SupportedUserFieldsResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.cc.arduino.cli.commands.v1.SupportedUserFieldsResponse.displayName = 'proto.cc.arduino.cli.commands.v1.SupportedUserFieldsResponse'; +} @@ -228,12 +318,14 @@ proto.cc.arduino.cli.commands.v1.UploadRequest.toObject = function(includeInstan instance: (f = msg.getInstance()) && cc_arduino_cli_commands_v1_common_pb.Instance.toObject(includeInstance, f), fqbn: jspb.Message.getFieldWithDefault(msg, 2, ""), sketchPath: jspb.Message.getFieldWithDefault(msg, 3, ""), - port: jspb.Message.getFieldWithDefault(msg, 4, ""), + port: (f = msg.getPort()) && cc_arduino_cli_commands_v1_port_pb.Port.toObject(includeInstance, f), verbose: jspb.Message.getBooleanFieldWithDefault(msg, 5, false), verify: jspb.Message.getBooleanFieldWithDefault(msg, 6, false), importFile: jspb.Message.getFieldWithDefault(msg, 7, ""), importDir: jspb.Message.getFieldWithDefault(msg, 8, ""), - programmer: jspb.Message.getFieldWithDefault(msg, 9, "") + programmer: jspb.Message.getFieldWithDefault(msg, 9, ""), + dryRun: jspb.Message.getBooleanFieldWithDefault(msg, 10, false), + userFieldsMap: (f = msg.getUserFieldsMap()) ? f.toObject(includeInstance, undefined) : [] }; if (includeInstance) { @@ -284,7 +376,8 @@ proto.cc.arduino.cli.commands.v1.UploadRequest.deserializeBinaryFromReader = fun msg.setSketchPath(value); break; case 4: - var value = /** @type {string} */ (reader.readString()); + var value = new cc_arduino_cli_commands_v1_port_pb.Port; + reader.readMessage(value,cc_arduino_cli_commands_v1_port_pb.Port.deserializeBinaryFromReader); msg.setPort(value); break; case 5: @@ -307,6 +400,16 @@ proto.cc.arduino.cli.commands.v1.UploadRequest.deserializeBinaryFromReader = fun var value = /** @type {string} */ (reader.readString()); msg.setProgrammer(value); break; + case 10: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setDryRun(value); + break; + case 11: + var value = msg.getUserFieldsMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; default: reader.skipField(); break; @@ -359,10 +462,11 @@ proto.cc.arduino.cli.commands.v1.UploadRequest.serializeBinaryToWriter = functio ); } f = message.getPort(); - if (f.length > 0) { - writer.writeString( + if (f != null) { + writer.writeMessage( 4, - f + f, + cc_arduino_cli_commands_v1_port_pb.Port.serializeBinaryToWriter ); } f = message.getVerbose(); @@ -400,6 +504,17 @@ proto.cc.arduino.cli.commands.v1.UploadRequest.serializeBinaryToWriter = functio f ); } + f = message.getDryRun(); + if (f) { + writer.writeBool( + 10, + f + ); + } + f = message.getUserFieldsMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(11, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } }; @@ -477,20 +592,39 @@ proto.cc.arduino.cli.commands.v1.UploadRequest.prototype.setSketchPath = functio /** - * optional string port = 4; - * @return {string} + * optional Port port = 4; + * @return {?proto.cc.arduino.cli.commands.v1.Port} */ proto.cc.arduino.cli.commands.v1.UploadRequest.prototype.getPort = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); + return /** @type{?proto.cc.arduino.cli.commands.v1.Port} */ ( + jspb.Message.getWrapperField(this, cc_arduino_cli_commands_v1_port_pb.Port, 4)); }; /** - * @param {string} value + * @param {?proto.cc.arduino.cli.commands.v1.Port|undefined} value * @return {!proto.cc.arduino.cli.commands.v1.UploadRequest} returns this - */ +*/ proto.cc.arduino.cli.commands.v1.UploadRequest.prototype.setPort = function(value) { - return jspb.Message.setProto3StringField(this, 4, value); + return jspb.Message.setWrapperField(this, 4, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.cc.arduino.cli.commands.v1.UploadRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.UploadRequest.prototype.clearPort = function() { + return this.setPort(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.cc.arduino.cli.commands.v1.UploadRequest.prototype.hasPort = function() { + return jspb.Message.getField(this, 4) != null; }; @@ -584,6 +718,46 @@ proto.cc.arduino.cli.commands.v1.UploadRequest.prototype.setProgrammer = functio }; +/** + * optional bool dry_run = 10; + * @return {boolean} + */ +proto.cc.arduino.cli.commands.v1.UploadRequest.prototype.getDryRun = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 10, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.cc.arduino.cli.commands.v1.UploadRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.UploadRequest.prototype.setDryRun = function(value) { + return jspb.Message.setProto3BooleanField(this, 10, value); +}; + + +/** + * map user_fields = 11; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.cc.arduino.cli.commands.v1.UploadRequest.prototype.getUserFieldsMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 11, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.cc.arduino.cli.commands.v1.UploadRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.UploadRequest.prototype.clearUserFieldsMap = function() { + this.getUserFieldsMap().clear(); + return this;}; + + @@ -795,6 +969,107 @@ proto.cc.arduino.cli.commands.v1.UploadResponse.prototype.setErrStream = 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.commands.v1.ProgrammerIsRequiredForUploadError.prototype.toObject = function(opt_includeInstance) { + return proto.cc.arduino.cli.commands.v1.ProgrammerIsRequiredForUploadError.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.ProgrammerIsRequiredForUploadError} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.cc.arduino.cli.commands.v1.ProgrammerIsRequiredForUploadError.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.commands.v1.ProgrammerIsRequiredForUploadError} + */ +proto.cc.arduino.cli.commands.v1.ProgrammerIsRequiredForUploadError.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.cc.arduino.cli.commands.v1.ProgrammerIsRequiredForUploadError; + return proto.cc.arduino.cli.commands.v1.ProgrammerIsRequiredForUploadError.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.ProgrammerIsRequiredForUploadError} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.cc.arduino.cli.commands.v1.ProgrammerIsRequiredForUploadError} + */ +proto.cc.arduino.cli.commands.v1.ProgrammerIsRequiredForUploadError.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.commands.v1.ProgrammerIsRequiredForUploadError.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.cc.arduino.cli.commands.v1.ProgrammerIsRequiredForUploadError.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.ProgrammerIsRequiredForUploadError} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.cc.arduino.cli.commands.v1.ProgrammerIsRequiredForUploadError.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + + + if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. @@ -827,12 +1102,14 @@ proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerRequest.toObject = functio instance: (f = msg.getInstance()) && cc_arduino_cli_commands_v1_common_pb.Instance.toObject(includeInstance, f), fqbn: jspb.Message.getFieldWithDefault(msg, 2, ""), sketchPath: jspb.Message.getFieldWithDefault(msg, 3, ""), - port: jspb.Message.getFieldWithDefault(msg, 4, ""), + port: (f = msg.getPort()) && cc_arduino_cli_commands_v1_port_pb.Port.toObject(includeInstance, f), verbose: jspb.Message.getBooleanFieldWithDefault(msg, 5, false), verify: jspb.Message.getBooleanFieldWithDefault(msg, 6, false), importFile: jspb.Message.getFieldWithDefault(msg, 7, ""), importDir: jspb.Message.getFieldWithDefault(msg, 8, ""), - programmer: jspb.Message.getFieldWithDefault(msg, 9, "") + programmer: jspb.Message.getFieldWithDefault(msg, 9, ""), + dryRun: jspb.Message.getBooleanFieldWithDefault(msg, 10, false), + userFieldsMap: (f = msg.getUserFieldsMap()) ? f.toObject(includeInstance, undefined) : [] }; if (includeInstance) { @@ -883,7 +1160,8 @@ proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerRequest.deserializeBinaryF msg.setSketchPath(value); break; case 4: - var value = /** @type {string} */ (reader.readString()); + var value = new cc_arduino_cli_commands_v1_port_pb.Port; + reader.readMessage(value,cc_arduino_cli_commands_v1_port_pb.Port.deserializeBinaryFromReader); msg.setPort(value); break; case 5: @@ -906,6 +1184,16 @@ proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerRequest.deserializeBinaryF var value = /** @type {string} */ (reader.readString()); msg.setProgrammer(value); break; + case 10: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setDryRun(value); + break; + case 11: + var value = msg.getUserFieldsMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; default: reader.skipField(); break; @@ -958,10 +1246,11 @@ proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerRequest.serializeBinaryToW ); } f = message.getPort(); - if (f.length > 0) { - writer.writeString( + if (f != null) { + writer.writeMessage( 4, - f + f, + cc_arduino_cli_commands_v1_port_pb.Port.serializeBinaryToWriter ); } f = message.getVerbose(); @@ -999,6 +1288,17 @@ proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerRequest.serializeBinaryToW f ); } + f = message.getDryRun(); + if (f) { + writer.writeBool( + 10, + f + ); + } + f = message.getUserFieldsMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(11, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } }; @@ -1076,20 +1376,39 @@ proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerRequest.prototype.setSketc /** - * optional string port = 4; - * @return {string} + * optional Port port = 4; + * @return {?proto.cc.arduino.cli.commands.v1.Port} */ proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerRequest.prototype.getPort = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); + return /** @type{?proto.cc.arduino.cli.commands.v1.Port} */ ( + jspb.Message.getWrapperField(this, cc_arduino_cli_commands_v1_port_pb.Port, 4)); }; /** - * @param {string} value + * @param {?proto.cc.arduino.cli.commands.v1.Port|undefined} value * @return {!proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerRequest} returns this - */ +*/ proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerRequest.prototype.setPort = function(value) { - return jspb.Message.setProto3StringField(this, 4, value); + return jspb.Message.setWrapperField(this, 4, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerRequest.prototype.clearPort = function() { + return this.setPort(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerRequest.prototype.hasPort = function() { + return jspb.Message.getField(this, 4) != null; }; @@ -1183,13 +1502,53 @@ proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerRequest.prototype.setProgr }; +/** + * optional bool dry_run = 10; + * @return {boolean} + */ +proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerRequest.prototype.getDryRun = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 10, false)); +}; - -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. + * @param {boolean} value + * @return {!proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerRequest.prototype.setDryRun = function(value) { + return jspb.Message.setProto3BooleanField(this, 10, value); +}; + + +/** + * map user_fields = 11; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerRequest.prototype.getUserFieldsMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 11, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerRequest.prototype.clearUserFieldsMap = function() { + this.getUserFieldsMap().clear(); + return this;}; + + + + + +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: @@ -1425,10 +1784,12 @@ proto.cc.arduino.cli.commands.v1.BurnBootloaderRequest.toObject = function(inclu var f, obj = { instance: (f = msg.getInstance()) && cc_arduino_cli_commands_v1_common_pb.Instance.toObject(includeInstance, f), fqbn: jspb.Message.getFieldWithDefault(msg, 2, ""), - port: jspb.Message.getFieldWithDefault(msg, 3, ""), + port: (f = msg.getPort()) && cc_arduino_cli_commands_v1_port_pb.Port.toObject(includeInstance, f), verbose: jspb.Message.getBooleanFieldWithDefault(msg, 4, false), verify: jspb.Message.getBooleanFieldWithDefault(msg, 5, false), - programmer: jspb.Message.getFieldWithDefault(msg, 6, "") + programmer: jspb.Message.getFieldWithDefault(msg, 6, ""), + dryRun: jspb.Message.getBooleanFieldWithDefault(msg, 7, false), + userFieldsMap: (f = msg.getUserFieldsMap()) ? f.toObject(includeInstance, undefined) : [] }; if (includeInstance) { @@ -1475,7 +1836,8 @@ proto.cc.arduino.cli.commands.v1.BurnBootloaderRequest.deserializeBinaryFromRead msg.setFqbn(value); break; case 3: - var value = /** @type {string} */ (reader.readString()); + var value = new cc_arduino_cli_commands_v1_port_pb.Port; + reader.readMessage(value,cc_arduino_cli_commands_v1_port_pb.Port.deserializeBinaryFromReader); msg.setPort(value); break; case 4: @@ -1490,6 +1852,16 @@ proto.cc.arduino.cli.commands.v1.BurnBootloaderRequest.deserializeBinaryFromRead var value = /** @type {string} */ (reader.readString()); msg.setProgrammer(value); break; + case 7: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setDryRun(value); + break; + case 11: + var value = msg.getUserFieldsMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; default: reader.skipField(); break; @@ -1535,10 +1907,11 @@ proto.cc.arduino.cli.commands.v1.BurnBootloaderRequest.serializeBinaryToWriter = ); } f = message.getPort(); - if (f.length > 0) { - writer.writeString( + if (f != null) { + writer.writeMessage( 3, - f + f, + cc_arduino_cli_commands_v1_port_pb.Port.serializeBinaryToWriter ); } f = message.getVerbose(); @@ -1562,6 +1935,17 @@ proto.cc.arduino.cli.commands.v1.BurnBootloaderRequest.serializeBinaryToWriter = f ); } + f = message.getDryRun(); + if (f) { + writer.writeBool( + 7, + f + ); + } + f = message.getUserFieldsMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(11, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } }; @@ -1621,20 +2005,39 @@ proto.cc.arduino.cli.commands.v1.BurnBootloaderRequest.prototype.setFqbn = funct /** - * optional string port = 3; - * @return {string} + * optional Port port = 3; + * @return {?proto.cc.arduino.cli.commands.v1.Port} */ proto.cc.arduino.cli.commands.v1.BurnBootloaderRequest.prototype.getPort = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); + return /** @type{?proto.cc.arduino.cli.commands.v1.Port} */ ( + jspb.Message.getWrapperField(this, cc_arduino_cli_commands_v1_port_pb.Port, 3)); }; /** - * @param {string} value + * @param {?proto.cc.arduino.cli.commands.v1.Port|undefined} value * @return {!proto.cc.arduino.cli.commands.v1.BurnBootloaderRequest} returns this - */ +*/ proto.cc.arduino.cli.commands.v1.BurnBootloaderRequest.prototype.setPort = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.cc.arduino.cli.commands.v1.BurnBootloaderRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.BurnBootloaderRequest.prototype.clearPort = function() { + return this.setPort(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.cc.arduino.cli.commands.v1.BurnBootloaderRequest.prototype.hasPort = function() { + return jspb.Message.getField(this, 3) != null; }; @@ -1692,6 +2095,46 @@ proto.cc.arduino.cli.commands.v1.BurnBootloaderRequest.prototype.setProgrammer = }; +/** + * optional bool dry_run = 7; + * @return {boolean} + */ +proto.cc.arduino.cli.commands.v1.BurnBootloaderRequest.prototype.getDryRun = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 7, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.cc.arduino.cli.commands.v1.BurnBootloaderRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.BurnBootloaderRequest.prototype.setDryRun = function(value) { + return jspb.Message.setProto3BooleanField(this, 7, value); +}; + + +/** + * map user_fields = 11; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.cc.arduino.cli.commands.v1.BurnBootloaderRequest.prototype.getUserFieldsMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 11, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.cc.arduino.cli.commands.v1.BurnBootloaderRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.BurnBootloaderRequest.prototype.clearUserFieldsMap = function() { + this.getUserFieldsMap().clear(); + return this;}; + + @@ -2241,4 +2684,595 @@ proto.cc.arduino.cli.commands.v1.ListProgrammersAvailableForUploadResponse.proto }; -goog.object.extend(exports, proto.cc.arduino.cli.commands.v1); + + + +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.SupportedUserFieldsRequest.prototype.toObject = function(opt_includeInstance) { + return proto.cc.arduino.cli.commands.v1.SupportedUserFieldsRequest.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.SupportedUserFieldsRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.cc.arduino.cli.commands.v1.SupportedUserFieldsRequest.toObject = function(includeInstance, msg) { + var f, obj = { + instance: (f = msg.getInstance()) && cc_arduino_cli_commands_v1_common_pb.Instance.toObject(includeInstance, f), + fqbn: jspb.Message.getFieldWithDefault(msg, 2, ""), + protocol: 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.SupportedUserFieldsRequest} + */ +proto.cc.arduino.cli.commands.v1.SupportedUserFieldsRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.cc.arduino.cli.commands.v1.SupportedUserFieldsRequest; + return proto.cc.arduino.cli.commands.v1.SupportedUserFieldsRequest.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.SupportedUserFieldsRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.cc.arduino.cli.commands.v1.SupportedUserFieldsRequest} + */ +proto.cc.arduino.cli.commands.v1.SupportedUserFieldsRequest.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_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.setFqbn(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setProtocol(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.SupportedUserFieldsRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.cc.arduino.cli.commands.v1.SupportedUserFieldsRequest.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.SupportedUserFieldsRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.cc.arduino.cli.commands.v1.SupportedUserFieldsRequest.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.getFqbn(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getProtocol(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } +}; + + +/** + * optional Instance instance = 1; + * @return {?proto.cc.arduino.cli.commands.v1.Instance} + */ +proto.cc.arduino.cli.commands.v1.SupportedUserFieldsRequest.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.SupportedUserFieldsRequest} returns this +*/ +proto.cc.arduino.cli.commands.v1.SupportedUserFieldsRequest.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.SupportedUserFieldsRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.SupportedUserFieldsRequest.prototype.clearInstance = function() { + return this.setInstance(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.cc.arduino.cli.commands.v1.SupportedUserFieldsRequest.prototype.hasInstance = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional string fqbn = 2; + * @return {string} + */ +proto.cc.arduino.cli.commands.v1.SupportedUserFieldsRequest.prototype.getFqbn = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.cc.arduino.cli.commands.v1.SupportedUserFieldsRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.SupportedUserFieldsRequest.prototype.setFqbn = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string protocol = 3; + * @return {string} + */ +proto.cc.arduino.cli.commands.v1.SupportedUserFieldsRequest.prototype.getProtocol = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.cc.arduino.cli.commands.v1.SupportedUserFieldsRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.SupportedUserFieldsRequest.prototype.setProtocol = function(value) { + return jspb.Message.setProto3StringField(this, 3, 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.UserField.prototype.toObject = function(opt_includeInstance) { + return proto.cc.arduino.cli.commands.v1.UserField.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.UserField} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.cc.arduino.cli.commands.v1.UserField.toObject = function(includeInstance, msg) { + var f, obj = { + toolId: jspb.Message.getFieldWithDefault(msg, 1, ""), + name: jspb.Message.getFieldWithDefault(msg, 2, ""), + label: jspb.Message.getFieldWithDefault(msg, 3, ""), + secret: jspb.Message.getBooleanFieldWithDefault(msg, 4, false) + }; + + 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.UserField} + */ +proto.cc.arduino.cli.commands.v1.UserField.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.cc.arduino.cli.commands.v1.UserField; + return proto.cc.arduino.cli.commands.v1.UserField.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.UserField} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.cc.arduino.cli.commands.v1.UserField} + */ +proto.cc.arduino.cli.commands.v1.UserField.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.setToolId(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setLabel(value); + break; + case 4: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setSecret(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.UserField.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.cc.arduino.cli.commands.v1.UserField.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.UserField} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.cc.arduino.cli.commands.v1.UserField.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getToolId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getLabel(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getSecret(); + if (f) { + writer.writeBool( + 4, + f + ); + } +}; + + +/** + * optional string tool_id = 1; + * @return {string} + */ +proto.cc.arduino.cli.commands.v1.UserField.prototype.getToolId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.cc.arduino.cli.commands.v1.UserField} returns this + */ +proto.cc.arduino.cli.commands.v1.UserField.prototype.setToolId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string name = 2; + * @return {string} + */ +proto.cc.arduino.cli.commands.v1.UserField.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.cc.arduino.cli.commands.v1.UserField} returns this + */ +proto.cc.arduino.cli.commands.v1.UserField.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string label = 3; + * @return {string} + */ +proto.cc.arduino.cli.commands.v1.UserField.prototype.getLabel = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.cc.arduino.cli.commands.v1.UserField} returns this + */ +proto.cc.arduino.cli.commands.v1.UserField.prototype.setLabel = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional bool secret = 4; + * @return {boolean} + */ +proto.cc.arduino.cli.commands.v1.UserField.prototype.getSecret = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.cc.arduino.cli.commands.v1.UserField} returns this + */ +proto.cc.arduino.cli.commands.v1.UserField.prototype.setSecret = function(value) { + return jspb.Message.setProto3BooleanField(this, 4, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.cc.arduino.cli.commands.v1.SupportedUserFieldsResponse.repeatedFields_ = [1]; + + + +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.SupportedUserFieldsResponse.prototype.toObject = function(opt_includeInstance) { + return proto.cc.arduino.cli.commands.v1.SupportedUserFieldsResponse.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.SupportedUserFieldsResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.cc.arduino.cli.commands.v1.SupportedUserFieldsResponse.toObject = function(includeInstance, msg) { + var f, obj = { + userFieldsList: jspb.Message.toObjectList(msg.getUserFieldsList(), + proto.cc.arduino.cli.commands.v1.UserField.toObject, includeInstance) + }; + + 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.SupportedUserFieldsResponse} + */ +proto.cc.arduino.cli.commands.v1.SupportedUserFieldsResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.cc.arduino.cli.commands.v1.SupportedUserFieldsResponse; + return proto.cc.arduino.cli.commands.v1.SupportedUserFieldsResponse.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.SupportedUserFieldsResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.cc.arduino.cli.commands.v1.SupportedUserFieldsResponse} + */ +proto.cc.arduino.cli.commands.v1.SupportedUserFieldsResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.cc.arduino.cli.commands.v1.UserField; + reader.readMessage(value,proto.cc.arduino.cli.commands.v1.UserField.deserializeBinaryFromReader); + msg.addUserFields(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.SupportedUserFieldsResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.cc.arduino.cli.commands.v1.SupportedUserFieldsResponse.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.SupportedUserFieldsResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.cc.arduino.cli.commands.v1.SupportedUserFieldsResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getUserFieldsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.cc.arduino.cli.commands.v1.UserField.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated UserField user_fields = 1; + * @return {!Array} + */ +proto.cc.arduino.cli.commands.v1.SupportedUserFieldsResponse.prototype.getUserFieldsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.cc.arduino.cli.commands.v1.UserField, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.cc.arduino.cli.commands.v1.SupportedUserFieldsResponse} returns this +*/ +proto.cc.arduino.cli.commands.v1.SupportedUserFieldsResponse.prototype.setUserFieldsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.cc.arduino.cli.commands.v1.UserField=} opt_value + * @param {number=} opt_index + * @return {!proto.cc.arduino.cli.commands.v1.UserField} + */ +proto.cc.arduino.cli.commands.v1.SupportedUserFieldsResponse.prototype.addUserFields = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.cc.arduino.cli.commands.v1.UserField, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.cc.arduino.cli.commands.v1.SupportedUserFieldsResponse} returns this + */ +proto.cc.arduino.cli.commands.v1.SupportedUserFieldsResponse.prototype.clearUserFieldsList = function() { + return this.setUserFieldsList([]); +}; + + +goog.object.extend(exports, proto.cc.arduino.cli.commands.v1); \ No newline at end of file diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/debug/v1/debug_grpc_pb.d.ts b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/debug/v1/debug_grpc_pb.d.ts index 36904d89e..965b7c9b1 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/debug/v1/debug_grpc_pb.d.ts +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/debug/v1/debug_grpc_pb.d.ts @@ -8,6 +8,7 @@ import * as grpc from "@grpc/grpc-js"; import {handleClientStreamingCall} from "@grpc/grpc-js/build/src/server-call"; import * as cc_arduino_cli_debug_v1_debug_pb from "../../../../../cc/arduino/cli/debug/v1/debug_pb"; import * as cc_arduino_cli_commands_v1_common_pb from "../../../../../cc/arduino/cli/commands/v1/common_pb"; +import * as cc_arduino_cli_commands_v1_port_pb from "../../../../../cc/arduino/cli/commands/v1/port_pb"; interface IDebugServiceService extends grpc.ServiceDefinition { debug: IDebugServiceService_IDebug; @@ -56,4 +57,4 @@ export class DebugServiceClient extends grpc.Client implements IDebugServiceClie public getDebugConfig(request: cc_arduino_cli_debug_v1_debug_pb.DebugConfigRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_debug_v1_debug_pb.GetDebugConfigResponse) => void): grpc.ClientUnaryCall; public getDebugConfig(request: cc_arduino_cli_debug_v1_debug_pb.DebugConfigRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_debug_v1_debug_pb.GetDebugConfigResponse) => void): grpc.ClientUnaryCall; public getDebugConfig(request: cc_arduino_cli_debug_v1_debug_pb.DebugConfigRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_debug_v1_debug_pb.GetDebugConfigResponse) => void): grpc.ClientUnaryCall; -} +} \ No newline at end of file diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/debug/v1/debug_grpc_pb.js b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/debug/v1/debug_grpc_pb.js index a720fb103..2f628af5c 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/debug/v1/debug_grpc_pb.js +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/debug/v1/debug_grpc_pb.js @@ -19,6 +19,7 @@ 'use strict'; var cc_arduino_cli_debug_v1_debug_pb = require('../../../../../cc/arduino/cli/debug/v1/debug_pb.js'); var cc_arduino_cli_commands_v1_common_pb = require('../../../../../cc/arduino/cli/commands/v1/common_pb.js'); +var cc_arduino_cli_commands_v1_port_pb = require('../../../../../cc/arduino/cli/commands/v1/port_pb.js'); function serialize_cc_arduino_cli_debug_v1_DebugConfigRequest(arg) { if (!(arg instanceof cc_arduino_cli_debug_v1_debug_pb.DebugConfigRequest)) { @@ -91,4 +92,3 @@ debug: { responseDeserialize: deserialize_cc_arduino_cli_debug_v1_GetDebugConfigResponse, }, }; - diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/debug/v1/debug_pb.d.ts b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/debug/v1/debug_pb.d.ts index fd439f213..32b7c9b4d 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/debug/v1/debug_pb.d.ts +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/debug/v1/debug_pb.d.ts @@ -6,6 +6,7 @@ import * as jspb from "google-protobuf"; import * as cc_arduino_cli_commands_v1_common_pb from "../../../../../cc/arduino/cli/commands/v1/common_pb"; +import * as cc_arduino_cli_commands_v1_port_pb from "../../../../../cc/arduino/cli/commands/v1/port_pb"; export class DebugRequest extends jspb.Message { @@ -54,8 +55,11 @@ export class DebugConfigRequest extends jspb.Message { getSketchPath(): string; setSketchPath(value: string): DebugConfigRequest; - getPort(): string; - setPort(value: string): DebugConfigRequest; + + hasPort(): boolean; + clearPort(): void; + getPort(): cc_arduino_cli_commands_v1_port_pb.Port | undefined; + setPort(value?: cc_arduino_cli_commands_v1_port_pb.Port): DebugConfigRequest; getInterpreter(): string; setInterpreter(value: string): DebugConfigRequest; @@ -82,7 +86,7 @@ export namespace DebugConfigRequest { instance?: cc_arduino_cli_commands_v1_common_pb.Instance.AsObject, fqbn: string, sketchPath: string, - port: string, + port?: cc_arduino_cli_commands_v1_port_pb.Port.AsObject, interpreter: string, importDir: string, programmer: string, @@ -167,4 +171,4 @@ export namespace GetDebugConfigResponse { serverConfigurationMap: Array<[string, string]>, } -} +} \ No newline at end of file diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/debug/v1/debug_pb.js b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/debug/v1/debug_pb.js index 484214106..cb8136d54 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/debug/v1/debug_pb.js +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/debug/v1/debug_pb.js @@ -17,6 +17,8 @@ var global = Function('return this')(); var cc_arduino_cli_commands_v1_common_pb = require('../../../../../cc/arduino/cli/commands/v1/common_pb.js'); goog.object.extend(proto, cc_arduino_cli_commands_v1_common_pb); +var cc_arduino_cli_commands_v1_port_pb = require('../../../../../cc/arduino/cli/commands/v1/port_pb.js'); +goog.object.extend(proto, cc_arduino_cli_commands_v1_port_pb); goog.exportSymbol('proto.cc.arduino.cli.debug.v1.DebugConfigRequest', null, global); goog.exportSymbol('proto.cc.arduino.cli.debug.v1.DebugRequest', null, global); goog.exportSymbol('proto.cc.arduino.cli.debug.v1.DebugResponse', null, global); @@ -375,7 +377,7 @@ proto.cc.arduino.cli.debug.v1.DebugConfigRequest.toObject = function(includeInst instance: (f = msg.getInstance()) && cc_arduino_cli_commands_v1_common_pb.Instance.toObject(includeInstance, f), fqbn: jspb.Message.getFieldWithDefault(msg, 2, ""), sketchPath: jspb.Message.getFieldWithDefault(msg, 3, ""), - port: jspb.Message.getFieldWithDefault(msg, 4, ""), + port: (f = msg.getPort()) && cc_arduino_cli_commands_v1_port_pb.Port.toObject(includeInstance, f), interpreter: jspb.Message.getFieldWithDefault(msg, 5, ""), importDir: jspb.Message.getFieldWithDefault(msg, 8, ""), programmer: jspb.Message.getFieldWithDefault(msg, 9, "") @@ -429,7 +431,8 @@ proto.cc.arduino.cli.debug.v1.DebugConfigRequest.deserializeBinaryFromReader = f msg.setSketchPath(value); break; case 4: - var value = /** @type {string} */ (reader.readString()); + var value = new cc_arduino_cli_commands_v1_port_pb.Port; + reader.readMessage(value,cc_arduino_cli_commands_v1_port_pb.Port.deserializeBinaryFromReader); msg.setPort(value); break; case 5: @@ -496,10 +499,11 @@ proto.cc.arduino.cli.debug.v1.DebugConfigRequest.serializeBinaryToWriter = funct ); } f = message.getPort(); - if (f.length > 0) { - writer.writeString( + if (f != null) { + writer.writeMessage( 4, - f + f, + cc_arduino_cli_commands_v1_port_pb.Port.serializeBinaryToWriter ); } f = message.getInterpreter(); @@ -600,20 +604,39 @@ proto.cc.arduino.cli.debug.v1.DebugConfigRequest.prototype.setSketchPath = funct /** - * optional string port = 4; - * @return {string} + * optional cc.arduino.cli.commands.v1.Port port = 4; + * @return {?proto.cc.arduino.cli.commands.v1.Port} */ proto.cc.arduino.cli.debug.v1.DebugConfigRequest.prototype.getPort = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); + return /** @type{?proto.cc.arduino.cli.commands.v1.Port} */ ( + jspb.Message.getWrapperField(this, cc_arduino_cli_commands_v1_port_pb.Port, 4)); }; /** - * @param {string} value + * @param {?proto.cc.arduino.cli.commands.v1.Port|undefined} value * @return {!proto.cc.arduino.cli.debug.v1.DebugConfigRequest} returns this - */ +*/ proto.cc.arduino.cli.debug.v1.DebugConfigRequest.prototype.setPort = function(value) { - return jspb.Message.setProto3StringField(this, 4, value); + return jspb.Message.setWrapperField(this, 4, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.cc.arduino.cli.debug.v1.DebugConfigRequest} returns this + */ +proto.cc.arduino.cli.debug.v1.DebugConfigRequest.prototype.clearPort = function() { + return this.setPort(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.cc.arduino.cli.debug.v1.DebugConfigRequest.prototype.hasPort = function() { + return jspb.Message.getField(this, 4) != null; }; @@ -1201,4 +1224,4 @@ proto.cc.arduino.cli.debug.v1.GetDebugConfigResponse.prototype.clearServerConfig return this;}; -goog.object.extend(exports, proto.cc.arduino.cli.debug.v1); +goog.object.extend(exports, proto.cc.arduino.cli.debug.v1); \ No newline at end of file diff --git a/arduino-ide-extension/src/node/cli-protocol/google/rpc/status_grpc_pb.js b/arduino-ide-extension/src/node/cli-protocol/google/rpc/status_grpc_pb.js new file mode 100644 index 000000000..97b3a2461 --- /dev/null +++ b/arduino-ide-extension/src/node/cli-protocol/google/rpc/status_grpc_pb.js @@ -0,0 +1 @@ +// GENERATED CODE -- NO SERVICES IN PROTO \ No newline at end of file diff --git a/arduino-ide-extension/src/node/cli-protocol/google/rpc/status_pb.d.ts b/arduino-ide-extension/src/node/cli-protocol/google/rpc/status_pb.d.ts new file mode 100644 index 000000000..884f59ac8 --- /dev/null +++ b/arduino-ide-extension/src/node/cli-protocol/google/rpc/status_pb.d.ts @@ -0,0 +1,39 @@ +// package: google.rpc +// file: google/rpc/status.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as jspb from "google-protobuf"; +import * as google_protobuf_any_pb from "google-protobuf/google/protobuf/any_pb"; + +export class Status extends jspb.Message { + getCode(): number; + setCode(value: number): Status; + + getMessage(): string; + setMessage(value: string): Status; + + clearDetailsList(): void; + getDetailsList(): Array; + setDetailsList(value: Array): Status; + addDetails(value?: google_protobuf_any_pb.Any, index?: number): google_protobuf_any_pb.Any; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Status.AsObject; + static toObject(includeInstance: boolean, msg: Status): Status.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Status, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Status; + static deserializeBinaryFromReader(message: Status, reader: jspb.BinaryReader): Status; +} + +export namespace Status { + export type AsObject = { + code: number, + message: string, + detailsList: Array, + } +} \ No newline at end of file diff --git a/arduino-ide-extension/src/node/cli-protocol/google/rpc/status_pb.js b/arduino-ide-extension/src/node/cli-protocol/google/rpc/status_pb.js new file mode 100644 index 000000000..304b718a4 --- /dev/null +++ b/arduino-ide-extension/src/node/cli-protocol/google/rpc/status_pb.js @@ -0,0 +1,262 @@ +// source: google/rpc/status.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = Function('return this')(); + +var google_protobuf_any_pb = require('google-protobuf/google/protobuf/any_pb.js'); +goog.object.extend(proto, google_protobuf_any_pb); +goog.exportSymbol('proto.google.rpc.Status', null, global); +/** + * 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.google.rpc.Status = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.google.rpc.Status.repeatedFields_, null); +}; +goog.inherits(proto.google.rpc.Status, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.google.rpc.Status.displayName = 'proto.google.rpc.Status'; +} + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.google.rpc.Status.repeatedFields_ = [3]; + + + +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.google.rpc.Status.prototype.toObject = function(opt_includeInstance) { + return proto.google.rpc.Status.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.google.rpc.Status} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.google.rpc.Status.toObject = function(includeInstance, msg) { + var f, obj = { + code: jspb.Message.getFieldWithDefault(msg, 1, 0), + message: jspb.Message.getFieldWithDefault(msg, 2, ""), + detailsList: jspb.Message.toObjectList(msg.getDetailsList(), + google_protobuf_any_pb.Any.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.google.rpc.Status} + */ +proto.google.rpc.Status.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.google.rpc.Status; + return proto.google.rpc.Status.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.google.rpc.Status} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.google.rpc.Status} + */ +proto.google.rpc.Status.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt32()); + msg.setCode(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setMessage(value); + break; + case 3: + var value = new google_protobuf_any_pb.Any; + reader.readMessage(value,google_protobuf_any_pb.Any.deserializeBinaryFromReader); + msg.addDetails(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.google.rpc.Status.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.google.rpc.Status.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.google.rpc.Status} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.google.rpc.Status.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getCode(); + if (f !== 0) { + writer.writeInt32( + 1, + f + ); + } + f = message.getMessage(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getDetailsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 3, + f, + google_protobuf_any_pb.Any.serializeBinaryToWriter + ); + } +}; + + +/** + * optional int32 code = 1; + * @return {number} + */ +proto.google.rpc.Status.prototype.getCode = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.google.rpc.Status} returns this + */ +proto.google.rpc.Status.prototype.setCode = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional string message = 2; + * @return {string} + */ +proto.google.rpc.Status.prototype.getMessage = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.google.rpc.Status} returns this + */ +proto.google.rpc.Status.prototype.setMessage = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * repeated google.protobuf.Any details = 3; + * @return {!Array} + */ +proto.google.rpc.Status.prototype.getDetailsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, google_protobuf_any_pb.Any, 3)); +}; + + +/** + * @param {!Array} value + * @return {!proto.google.rpc.Status} returns this +*/ +proto.google.rpc.Status.prototype.setDetailsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 3, value); +}; + + +/** + * @param {!proto.google.protobuf.Any=} opt_value + * @param {number=} opt_index + * @return {!proto.google.protobuf.Any} + */ +proto.google.rpc.Status.prototype.addDetails = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.google.protobuf.Any, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.google.rpc.Status} returns this + */ +proto.google.rpc.Status.prototype.clearDetailsList = function() { + return this.setDetailsList([]); +}; + + +goog.object.extend(exports, proto.google.rpc); \ No newline at end of file diff --git a/arduino-ide-extension/src/node/core-client-provider.ts b/arduino-ide-extension/src/node/core-client-provider.ts index f80e62f26..aac884879 100644 --- a/arduino-ide-extension/src/node/core-client-provider.ts +++ b/arduino-ide-extension/src/node/core-client-provider.ts @@ -1,11 +1,12 @@ import * as grpc from '@grpc/grpc-js'; -import { inject, injectable } from 'inversify'; +import { inject, injectable, postConstruct } from 'inversify'; import { Event, Emitter } from '@theia/core/lib/common/event'; -import { DisposableCollection } from '@theia/core/lib/common/disposable'; import { GrpcClientProvider } from './grpc-client-provider'; import { ArduinoCoreServiceClient } from './cli-protocol/cc/arduino/cli/commands/v1/commands_grpc_pb'; import { Instance } from './cli-protocol/cc/arduino/cli/commands/v1/common_pb'; import { + CreateRequest, + CreateResponse, InitRequest, InitResponse, UpdateIndexRequest, @@ -15,6 +16,7 @@ import { } from './cli-protocol/cc/arduino/cli/commands/v1/commands_pb'; import * as commandsGrpcPb from './cli-protocol/cc/arduino/cli/commands/v1/commands_grpc_pb'; import { NotificationServiceServer } from '../common/protocol'; +import { Deferred } from '@theia/core/lib/common/promise-util'; @injectable() export class CoreClientProvider extends GrpcClientProvider { @@ -23,12 +25,27 @@ export class CoreClientProvider extends GrpcClientProvider(); + protected _created = new Deferred(); + protected _initialized = new Deferred(); + + get created(): Promise { + return this._created.promise; + } + + get initialized(): Promise { + return this._initialized.promise; + } + get onClientReady(): Event { return this.onClientReadyEmitter.event; } close(client: CoreClientProvider.Client): void { client.client.close(); + this._created.reject(); + this._initialized.reject(); + this._created = new Deferred(); + this._initialized = new Deferred(); } protected async reconcileClient( @@ -46,6 +63,39 @@ export class CoreClientProvider extends GrpcClientProvider { + this.daemon.ready.then(async () => { + const cliConfig = this.configService.cliConfiguration; + // First create the client and the instance synchronously + // and notify client is ready. + // TODO: Creation failure should probably be handled here + await this.reconcileClient( + cliConfig ? cliConfig.daemon.port : undefined + ).then(() => { + this._created.resolve(); + }); + + // If client has been created correctly update indexes and initialize + // its instance by loading platforms and cores. + if (this._client && !(this._client instanceof Error)) { + await this.updateIndexes(this._client) + .then(this.initInstance) + .then(() => { + this._initialized.resolve(); + }); + } + }); + + this.daemon.onDaemonStopped(() => { + if (this._client && !(this._client instanceof Error)) { + this.close(this._client); + } + this._client = undefined; + this._port = undefined; + }); + } + protected async createClient( port: string | number ): Promise { @@ -60,31 +110,64 @@ export class CoreClientProvider extends GrpcClientProvider((resolve, reject) => { - let resp: InitResponse | undefined = undefined; - const stream = client.init(initReq); - stream.on('data', (data: InitResponse) => (resp = data)); - stream.on('end', () => resolve(resp!)); - stream.on('error', (err) => reject(err)); + + const createRes = await new Promise((resolve, reject) => { + client.create(new CreateRequest(), (err, res: CreateResponse) => { + if (err) { + reject(err); + return; + } + resolve(res); + }); }); - const instance = initResp.getInstance(); + const instance = createRes.getInstance(); if (!instance) { throw new Error( 'Could not retrieve instance from the initialize response.' ); } - await this.updateIndexes({ instance, client }); return { instance, client }; } - protected async updateIndexes({ + protected async initInstance({ client, instance, }: CoreClientProvider.Client): Promise { + const initReq = new InitRequest(); + initReq.setInstance(instance); + await new Promise((resolve, reject) => { + const stream = client.init(initReq); + stream.on('data', (res: InitResponse) => { + const progress = res.getInitProgress(); + if (progress) { + const downloadProgress = progress.getDownloadProgress(); + if (downloadProgress && downloadProgress.getCompleted()) { + const file = downloadProgress.getFile(); + console.log(`Downloaded ${file}`); + } + const taskProgress = progress.getTaskProgress(); + if (taskProgress && taskProgress.getCompleted()) { + const name = taskProgress.getName(); + console.log(`Completed ${name}`); + } + } + + const err = res.getError(); + if (err) { + console.error(err.getMessage()); + } + }); + stream.on('error', (err) => reject(err)); + stream.on('end', resolve); + }); + } + + protected async updateIndexes({ + client, + instance, + }: CoreClientProvider.Client): Promise { // in a separate promise, try and update the index let indexUpdateSucceeded = true; for (let i = 0; i < 10; i++) { @@ -119,6 +202,7 @@ export class CoreClientProvider extends GrpcClientProvider { - const coreClient = await new Promise( + return await new Promise( async (resolve, reject) => { - const handle = (c: CoreClientProvider.Client | Error) => { - if (c instanceof Error) { - reject(c); - } else { - resolve(c); - } - }; const client = await this.coreClientProvider.client(); - if (client) { - handle(client); - return; + if (client && client instanceof Error) { + reject(client); + } else if (client) { + return resolve(client); } - const toDispose = new DisposableCollection(); - toDispose.push( - this.coreClientProvider.onClientReady(async () => { - const client = await this.coreClientProvider.client(); - if (client) { - handle(client); - } - toDispose.dispose(); - }) - ); } ); - return coreClient; } } diff --git a/arduino-ide-extension/src/node/core-service-impl.ts b/arduino-ide-extension/src/node/core-service-impl.ts index 36b173daf..6d6a0a34a 100644 --- a/arduino-ide-extension/src/node/core-service-impl.ts +++ b/arduino-ide-extension/src/node/core-service-impl.ts @@ -22,6 +22,7 @@ import { ResponseService } from '../common/protocol/response-service'; import { NotificationServiceServer } from '../common/protocol'; import { ArduinoCoreServiceClient } from './cli-protocol/cc/arduino/cli/commands/v1/commands_grpc_pb'; import { firstToUpperCase, firstToLowerCase } from '../common/utils'; +import { Port } from './cli-protocol/cc/arduino/cli/commands/v1/port_pb'; @injectable() export class CoreServiceImpl extends CoreClientAware implements CoreService { @@ -40,6 +41,7 @@ export class CoreServiceImpl extends CoreClientAware implements CoreService { const { sketchUri, fqbn, compilerWarnings } = options; const sketchPath = FileUri.fsPath(sketchUri); + await this.coreClientProvider.initialized; const coreClient = await this.coreClient(); const { client, instance } = coreClient; @@ -122,6 +124,7 @@ export class CoreServiceImpl extends CoreClientAware implements CoreService { const { sketchUri, fqbn, port, programmer } = options; const sketchPath = FileUri.fsPath(sketchUri); + await this.coreClientProvider.initialized; const coreClient = await this.coreClient(); const { client, instance } = coreClient; @@ -131,9 +134,13 @@ export class CoreServiceImpl extends CoreClientAware implements CoreService { if (fqbn) { req.setFqbn(fqbn); } + const p = new Port(); if (port) { - req.setPort(port); + p.setAddress(port.address); + p.setLabel(port.label || ''); + p.setProtocol(port.protocol); } + req.setPort(p); if (programmer) { req.setProgrammer(programmer.id); } @@ -170,6 +177,7 @@ export class CoreServiceImpl extends CoreClientAware implements CoreService { } async burnBootloader(options: CoreService.Bootloader.Options): Promise { + await this.coreClientProvider.initialized; const coreClient = await this.coreClient(); const { client, instance } = coreClient; const { fqbn, port, programmer } = options; @@ -178,9 +186,13 @@ export class CoreServiceImpl extends CoreClientAware implements CoreService { if (fqbn) { burnReq.setFqbn(fqbn); } + const p = new Port(); if (port) { - burnReq.setPort(port); + p.setAddress(port.address); + p.setLabel(port.label || ''); + p.setProtocol(port.protocol); } + burnReq.setPort(p); if (programmer) { burnReq.setProgrammer(programmer.id); } diff --git a/arduino-ide-extension/src/node/library-service-server-impl.ts b/arduino-ide-extension/src/node/library-service-server-impl.ts index 19477485e..7d24dc834 100644 --- a/arduino-ide-extension/src/node/library-service-server-impl.ts +++ b/arduino-ide-extension/src/node/library-service-server-impl.ts @@ -6,6 +6,7 @@ import { LibraryService, } from '../common/protocol/library-service'; import { CoreClientAware } from './core-client-provider'; +import { BoardDiscovery } from './board-discovery'; import { InstalledLibrary, Library, @@ -29,18 +30,21 @@ import { InstallWithProgress } from './grpc-installable'; @injectable() export class LibraryServiceImpl extends CoreClientAware - implements LibraryService -{ + implements LibraryService { @inject(ILogger) protected logger: ILogger; @inject(ResponseService) protected readonly responseService: ResponseService; + @inject(BoardDiscovery) + protected readonly boardDiscovery: BoardDiscovery; + @inject(NotificationServiceServer) protected readonly notificationServer: NotificationServiceServer; async search(options: { query?: string }): Promise { + await this.coreClientProvider.initialized; const coreClient = await this.coreClient(); const { client, instance } = coreClient; @@ -107,6 +111,7 @@ export class LibraryServiceImpl }: { fqbn?: string | undefined; }): Promise { + await this.coreClientProvider.initialized; const coreClient = await this.coreClient(); const { client, instance } = coreClient; const req = new LibraryListRequest(); @@ -212,6 +217,7 @@ export class LibraryServiceImpl version: Installable.Version; filterSelf?: boolean; }): Promise { + await this.coreClientProvider.initialized; const coreClient = await this.coreClient(); const { client, instance } = coreClient; const req = new LibraryResolveDependenciesRequest(); @@ -253,6 +259,7 @@ export class LibraryServiceImpl const version = !!options.version ? options.version : item.availableVersions[0]; + await this.coreClientProvider.initialized; const coreClient = await this.coreClient(); const { client, instance } = coreClient; @@ -274,12 +281,14 @@ export class LibraryServiceImpl }) ); await new Promise((resolve, reject) => { - resp.on('end', resolve); + resp.on('end', () => { + this.boardDiscovery.startBoardListWatch(coreClient) + resolve(); + }); resp.on('error', (error) => { this.responseService.appendToOutput({ - chunk: `Failed to install library: ${item.name}${ - version ? `:${version}` : '' - }.\n`, + chunk: `Failed to install library: ${item.name}${version ? `:${version}` : '' + }.\n`, }); this.responseService.appendToOutput({ chunk: error.toString(), @@ -304,6 +313,7 @@ export class LibraryServiceImpl progressId?: string; overwrite?: boolean; }): Promise { + await this.coreClientProvider.initialized; const coreClient = await this.coreClient(); const { client, instance } = coreClient; const req = new ZipLibraryInstallRequest(); @@ -321,7 +331,10 @@ export class LibraryServiceImpl }) ); await new Promise((resolve, reject) => { - resp.on('end', resolve); + resp.on('end', () => { + this.boardDiscovery.startBoardListWatch(coreClient) + resolve(); + }); resp.on('error', reject); }); } @@ -331,6 +344,7 @@ export class LibraryServiceImpl progressId?: string; }): Promise { const { item, progressId } = options; + await this.coreClientProvider.initialized; const coreClient = await this.coreClient(); const { client, instance } = coreClient; @@ -349,7 +363,10 @@ export class LibraryServiceImpl }) ); await new Promise((resolve, reject) => { - resp.on('end', resolve); + resp.on('end', () => { + this.boardDiscovery.startBoardListWatch(coreClient) + resolve(); + }); resp.on('error', reject); }); diff --git a/arduino-ide-extension/src/node/sketches-service-impl.ts b/arduino-ide-extension/src/node/sketches-service-impl.ts index d545e21b9..02280050d 100644 --- a/arduino-ide-extension/src/node/sketches-service-impl.ts +++ b/arduino-ide-extension/src/node/sketches-service-impl.ts @@ -136,6 +136,7 @@ export class SketchesServiceImpl } async loadSketch(uri: string): Promise { + await this.coreClientProvider.initialized; const { client, instance } = await this.coreClient(); const req = new LoadSketchRequest(); req.setSketchPath(FileUri.fsPath(uri)); @@ -462,6 +463,7 @@ void loop() { } async archive(sketch: Sketch, destinationUri: string): Promise { + await this.coreClientProvider.initialized; await this.loadSketch(sketch.uri); // sanity check const { client } = await this.coreClient(); const archivePath = FileUri.fsPath(destinationUri);