diff --git a/arduino-ide-extension/package.json b/arduino-ide-extension/package.json index 439ef6130..674615a5d 100644 --- a/arduino-ide-extension/package.json +++ b/arduino-ide-extension/package.json @@ -122,7 +122,7 @@ ], "arduino": { "cli": { - "version": "0.18.3" + "version": "0.19.0" } } } diff --git a/arduino-ide-extension/src/node/board-discovery.ts b/arduino-ide-extension/src/node/board-discovery.ts index 432ba9405..3b1481887 100644 --- a/arduino-ide-extension/src/node/board-discovery.ts +++ b/arduino-ide-extension/src/node/board-discovery.ts @@ -41,6 +41,7 @@ export class BoardDiscovery extends CoreClientAware { @postConstruct() protected async init(): Promise { + await this.coreClientProvider.initialized; const coreClient = await this.coreClient(); const { client, instance } = coreClient; const req = new BoardListWatchRequest(); diff --git a/arduino-ide-extension/src/node/boards-service-impl.ts b/arduino-ide-extension/src/node/boards-service-impl.ts index c41b72823..48fe75276 100644 --- a/arduino-ide-extension/src/node/boards-service-impl.ts +++ b/arduino-ide-extension/src/node/boards-service-impl.ts @@ -49,6 +49,7 @@ export class BoardsServiceImpl extends CoreClientAware implements BoardsService } async getBoardDetails(options: { fqbn: string }): Promise { + await this.coreClientProvider.initialized; const coreClient = await this.coreClient(); const { client, instance } = coreClient; const { fqbn } = options; @@ -152,6 +153,7 @@ export class BoardsServiceImpl extends CoreClientAware implements BoardsService } async searchBoards({ query }: { query?: string }): Promise { + await this.coreClientProvider.initialized; const { instance, client } = await this.coreClient(); const req = new BoardSearchRequest(); req.setSearchArgs(query || ''); @@ -181,6 +183,7 @@ export class BoardsServiceImpl extends CoreClientAware implements BoardsService } async search(options: { query?: string }): Promise { + await this.coreClientProvider.initialized; const coreClient = await this.coreClient(); const { client, instance } = coreClient; @@ -264,6 +267,7 @@ export class BoardsServiceImpl extends CoreClientAware implements BoardsService async install(options: { item: BoardsPackage, progressId?: string, version?: Installable.Version }): Promise { const item = options.item; const version = !!options.version ? options.version : item.availableVersions[0]; + await this.coreClientProvider.initialized; const coreClient = await this.coreClient(); const { client, instance } = coreClient; @@ -295,6 +299,7 @@ export class BoardsServiceImpl extends CoreClientAware implements BoardsService async uninstall(options: { item: BoardsPackage, progressId?: string }): Promise { const { item, progressId } = options; + await this.coreClientProvider.initialized; const coreClient = await this.coreClient(); const { client, instance } = coreClient; 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..aa12f8062 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; 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..77cdcc2e9 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', 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..f1f2e7ae6 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; - - clearPlatformsIndexErrorsList(): void; - getPlatformsIndexErrorsList(): Array; - setPlatformsIndexErrorsList(value: Array): InitResponse; - addPlatformsIndexErrors(value: string, index?: number): string; + hasInitProgress(): boolean; + clearInitProgress(): void; + getInitProgress(): InitResponse.Progress | undefined; + setInitProgress(value?: InitResponse.Progress): InitResponse; - 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; 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..8f9cb0b78 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); }; 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..91afcb7d5 --- /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, + } +} 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..d96766756 --- /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); diff --git a/arduino-ide-extension/src/node/core-client-provider.ts b/arduino-ide-extension/src/node/core-client-provider.ts index 04cce15f1..2d749e690 100644 --- a/arduino-ide-extension/src/node/core-client-provider.ts +++ b/arduino-ide-extension/src/node/core-client-provider.ts @@ -1,13 +1,12 @@ import * as grpc from '@grpc/grpc-js'; -import { inject, injectable } from 'inversify'; -import { Event, Emitter } from '@theia/core/lib/common/event'; -import { DisposableCollection } from '@theia/core/lib/common/disposable'; +import { inject, injectable, postConstruct } from 'inversify'; 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 { InitRequest, InitResponse, UpdateIndexRequest, UpdateIndexResponse, UpdateLibrariesIndexRequest, UpdateLibrariesIndexResponse } from './cli-protocol/cc/arduino/cli/commands/v1/commands_pb'; +import { CreateRequest, CreateResponse, InitRequest, InitResponse, UpdateIndexRequest, UpdateIndexResponse, UpdateLibrariesIndexRequest, UpdateLibrariesIndexResponse } 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 { @@ -15,27 +14,51 @@ export class CoreClientProvider extends GrpcClientProvider(); + protected _created = new Deferred(); + protected _initialized = new Deferred(); - get onClientReady(): Event { - return this.onClientReadyEmitter.event; + get created(): Promise { + return this._created.promise; + } + + get initialized(): Promise { + return this._initialized.promise } 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(port: string | number | undefined): Promise { - if (port && port === this._port) { - // No need to create a new gRPC client, but we have to update the indexes. + @postConstruct() + protected async init(): Promise { + 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); - this.onClientReadyEmitter.fire(); + await this.updateIndexes(this._client) + .then(this.initInstance) + .then(() => { this._initialized.resolve(); }); } - } else { - await super.reconcileClient(port); - this.onClientReadyEmitter.fire(); - } + }); + + 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 { @@ -43,26 +66,56 @@ 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({ client, instance }: CoreClientProvider.Client): Promise { + 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++) { @@ -95,6 +148,7 @@ export class CoreClientProvider extends GrpcClientProvider { @@ -174,29 +228,13 @@ export abstract class CoreClientAware { protected readonly coreClientProvider: CoreClientProvider; protected async coreClient(): Promise { - const coreClient = 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; + return await new Promise(async (resolve, reject) => { + const client = await this.coreClientProvider.client() + 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 3084dc619..c47c2c5d8 100644 --- a/arduino-ide-extension/src/node/core-service-impl.ts +++ b/arduino-ide-extension/src/node/core-service-impl.ts @@ -26,6 +26,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; @@ -85,6 +86,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; @@ -121,6 +123,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; 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 e936a8f33..8feb0ff29 100644 --- a/arduino-ide-extension/src/node/library-service-server-impl.ts +++ b/arduino-ide-extension/src/node/library-service-server-impl.ts @@ -25,6 +25,7 @@ export class LibraryServiceImpl extends CoreClientAware implements LibraryServic protected readonly notificationServer: NotificationServiceServer; async search(options: { query?: string }): Promise { + await this.coreClientProvider.initialized; const coreClient = await this.coreClient(); const { client, instance } = coreClient; @@ -68,6 +69,7 @@ export class LibraryServiceImpl extends CoreClientAware implements LibraryServic } async list({ fqbn }: { fqbn?: string | undefined }): Promise { + await this.coreClientProvider.initialized; const coreClient = await this.coreClient(); const { client, instance } = coreClient; const req = new LibraryListRequest(); @@ -143,6 +145,7 @@ export class LibraryServiceImpl extends CoreClientAware implements LibraryServic } async listDependencies({ item, version, filterSelf }: { item: LibraryPackage, version: Installable.Version, filterSelf?: boolean }): Promise { + await this.coreClientProvider.initialized; const coreClient = await this.coreClient(); const { client, instance } = coreClient; const req = new LibraryResolveDependenciesRequest(); @@ -168,6 +171,7 @@ export class LibraryServiceImpl extends CoreClientAware implements LibraryServic async install(options: { item: LibraryPackage, progressId?: string, version?: Installable.Version, installDependencies?: boolean }): Promise { const item = options.item; const version = !!options.version ? options.version : item.availableVersions[0]; + await this.coreClientProvider.initialized; const coreClient = await this.coreClient(); const { client, instance } = coreClient; @@ -198,6 +202,7 @@ export class LibraryServiceImpl extends CoreClientAware implements LibraryServic } async installZip({ zipUri, progressId, overwrite }: { zipUri: string, progressId?: string, overwrite?: boolean }): Promise { + await this.coreClientProvider.created; const coreClient = await this.coreClient(); const { client, instance } = coreClient; const req = new ZipLibraryInstallRequest(); @@ -216,6 +221,7 @@ export class LibraryServiceImpl extends CoreClientAware implements LibraryServic async uninstall(options: { item: LibraryPackage, progressId?: string }): Promise { const { item, progressId } = options; + await this.coreClientProvider.initialized; const coreClient = await this.coreClient(); const { client, instance } = coreClient; diff --git a/arduino-ide-extension/src/node/sketches-service-impl.ts b/arduino-ide-extension/src/node/sketches-service-impl.ts index d9c2789a5..251497315 100644 --- a/arduino-ide-extension/src/node/sketches-service-impl.ts +++ b/arduino-ide-extension/src/node/sketches-service-impl.ts @@ -107,6 +107,7 @@ export class SketchesServiceImpl extends CoreClientAware implements SketchesServ } async loadSketch(uri: string): Promise { + await this.coreClientProvider.initialized; const { client, instance } = await this.coreClient(); const req = new LoadSketchRequest(); req.setSketchPath(FileUri.fsPath(uri)); @@ -378,6 +379,7 @@ void loop() { async archive(sketch: Sketch, destinationUri: string): Promise { await this.loadSketch(sketch.uri); // sanity check + await this.coreClientProvider.initialized; const { client } = await this.coreClient(); const archivePath = FileUri.fsPath(destinationUri); // The CLI cannot override existing archives, so we have to wipe it manually: https://github.com/arduino/arduino-cli/issues/1160