From 078eeb1bc4a882f4c92d211a7a246e267b03f04e Mon Sep 17 00:00:00 2001 From: Francesco Stasi Date: Mon, 29 Mar 2021 11:05:05 +0200 Subject: [PATCH] chore: update CLI version, gRPC and bit of documentation --- arduino-ide-extension/README.md | 4 + arduino-ide-extension/package.json | 2 +- .../node/cli-protocol/commands/board_pb.js | 1 + .../node/cli-protocol/commands/commands_pb.js | 1 + .../node/cli-protocol/commands/common_pb.js | 1 + .../node/cli-protocol/commands/compile_pb.js | 1 + .../src/node/cli-protocol/commands/core_pb.js | 1 + .../src/node/cli-protocol/commands/lib_pb.js | 1 + .../node/cli-protocol/commands/upload_pb.js | 1 + .../src/node/cli-protocol/debug/debug_pb.js | 1 + .../node/cli-protocol/monitor/monitor_pb.d.ts | 18 +++ .../node/cli-protocol/monitor/monitor_pb.js | 123 +++++++++++++++++- .../node/cli-protocol/settings/settings_pb.js | 1 + 13 files changed, 149 insertions(+), 7 deletions(-) diff --git a/arduino-ide-extension/README.md b/arduino-ide-extension/README.md index 4f8794277..288199aff 100644 --- a/arduino-ide-extension/README.md +++ b/arduino-ide-extension/README.md @@ -54,3 +54,7 @@ The Config Service knows about your system, like for example the default sketch ### `"arduino"` configuration in the `package.json`: - `"cli"`: - `"version"` type `string` | `{ owner: string, repo: string, commitish?: string }`: if the type is a `string` and is a valid semver, it will get the corresponding [released](https://github.com/arduino/arduino-cli/releases) CLI. If the type is `string` and is a [date in `YYYYMMDD`](https://arduino.github.io/arduino-cli/latest/installation/#nightly-builds) format, it will get a nightly CLI. If the type is an object, a CLI, build from the sources in the `owner/repo` will be used. If `commitish` is not defined, the HEAD of the default branch will be used. In any other cases an error is thrown. + +#### Rebuild gRPC protocol interfaces + - Some CLI updates can bring changes to the gRPC interfaces, as the API might change. gRPC interfaces can be updated running the command + `yarn --cwd arduino-ide-extension generate-protocol` diff --git a/arduino-ide-extension/package.json b/arduino-ide-extension/package.json index 970481038..907b85bb8 100644 --- a/arduino-ide-extension/package.json +++ b/arduino-ide-extension/package.json @@ -122,7 +122,7 @@ ], "arduino": { "cli": { - "version": "0.17.0" + "version": "20210329" } } } diff --git a/arduino-ide-extension/src/node/cli-protocol/commands/board_pb.js b/arduino-ide-extension/src/node/cli-protocol/commands/board_pb.js index b2f1271be..ccc5babfb 100644 --- a/arduino-ide-extension/src/node/cli-protocol/commands/board_pb.js +++ b/arduino-ide-extension/src/node/cli-protocol/commands/board_pb.js @@ -2,6 +2,7 @@ /** * @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 diff --git a/arduino-ide-extension/src/node/cli-protocol/commands/commands_pb.js b/arduino-ide-extension/src/node/cli-protocol/commands/commands_pb.js index caee3de24..4d0de9828 100644 --- a/arduino-ide-extension/src/node/cli-protocol/commands/commands_pb.js +++ b/arduino-ide-extension/src/node/cli-protocol/commands/commands_pb.js @@ -2,6 +2,7 @@ /** * @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 diff --git a/arduino-ide-extension/src/node/cli-protocol/commands/common_pb.js b/arduino-ide-extension/src/node/cli-protocol/commands/common_pb.js index fa5c25219..1f54f7e88 100644 --- a/arduino-ide-extension/src/node/cli-protocol/commands/common_pb.js +++ b/arduino-ide-extension/src/node/cli-protocol/commands/common_pb.js @@ -2,6 +2,7 @@ /** * @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 diff --git a/arduino-ide-extension/src/node/cli-protocol/commands/compile_pb.js b/arduino-ide-extension/src/node/cli-protocol/commands/compile_pb.js index 10fa8e17f..1994a4b46 100644 --- a/arduino-ide-extension/src/node/cli-protocol/commands/compile_pb.js +++ b/arduino-ide-extension/src/node/cli-protocol/commands/compile_pb.js @@ -2,6 +2,7 @@ /** * @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 diff --git a/arduino-ide-extension/src/node/cli-protocol/commands/core_pb.js b/arduino-ide-extension/src/node/cli-protocol/commands/core_pb.js index 7d0990dcc..f83366cc8 100644 --- a/arduino-ide-extension/src/node/cli-protocol/commands/core_pb.js +++ b/arduino-ide-extension/src/node/cli-protocol/commands/core_pb.js @@ -2,6 +2,7 @@ /** * @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 diff --git a/arduino-ide-extension/src/node/cli-protocol/commands/lib_pb.js b/arduino-ide-extension/src/node/cli-protocol/commands/lib_pb.js index def3fb9cf..9277fc876 100644 --- a/arduino-ide-extension/src/node/cli-protocol/commands/lib_pb.js +++ b/arduino-ide-extension/src/node/cli-protocol/commands/lib_pb.js @@ -2,6 +2,7 @@ /** * @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 diff --git a/arduino-ide-extension/src/node/cli-protocol/commands/upload_pb.js b/arduino-ide-extension/src/node/cli-protocol/commands/upload_pb.js index cc95d5c53..68fc287aa 100644 --- a/arduino-ide-extension/src/node/cli-protocol/commands/upload_pb.js +++ b/arduino-ide-extension/src/node/cli-protocol/commands/upload_pb.js @@ -2,6 +2,7 @@ /** * @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 diff --git a/arduino-ide-extension/src/node/cli-protocol/debug/debug_pb.js b/arduino-ide-extension/src/node/cli-protocol/debug/debug_pb.js index 6a87cd1d9..5753730ee 100644 --- a/arduino-ide-extension/src/node/cli-protocol/debug/debug_pb.js +++ b/arduino-ide-extension/src/node/cli-protocol/debug/debug_pb.js @@ -2,6 +2,7 @@ /** * @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 diff --git a/arduino-ide-extension/src/node/cli-protocol/monitor/monitor_pb.d.ts b/arduino-ide-extension/src/node/cli-protocol/monitor/monitor_pb.d.ts index d80a52153..38f999b69 100644 --- a/arduino-ide-extension/src/node/cli-protocol/monitor/monitor_pb.d.ts +++ b/arduino-ide-extension/src/node/cli-protocol/monitor/monitor_pb.d.ts @@ -23,6 +23,12 @@ export class StreamingOpenReq extends jspb.Message { setData(value: Uint8Array | string): StreamingOpenReq; + hasRecvAcknowledge(): boolean; + clearRecvAcknowledge(): void; + getRecvAcknowledge(): number; + setRecvAcknowledge(value: number): StreamingOpenReq; + + getContentCase(): StreamingOpenReq.ContentCase; serializeBinary(): Uint8Array; @@ -39,6 +45,7 @@ export namespace StreamingOpenReq { export type AsObject = { monitorconfig?: MonitorConfig.AsObject, data: Uint8Array | string, + recvAcknowledge: number, } export enum ContentCase { @@ -48,6 +55,8 @@ export namespace StreamingOpenReq { DATA = 2, + RECV_ACKNOWLEDGE = 3, + } } @@ -65,6 +74,9 @@ export class MonitorConfig extends jspb.Message { getAdditionalconfig(): google_protobuf_struct_pb.Struct | undefined; setAdditionalconfig(value?: google_protobuf_struct_pb.Struct): MonitorConfig; + getRecvRateLimitBuffer(): number; + setRecvRateLimitBuffer(value: number): MonitorConfig; + serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): MonitorConfig.AsObject; @@ -81,10 +93,12 @@ export namespace MonitorConfig { target: string, type: MonitorConfig.TargetType, additionalconfig?: google_protobuf_struct_pb.Struct.AsObject, + recvRateLimitBuffer: number, } export enum TargetType { SERIAL = 0, + NULL = 99, } } @@ -95,6 +109,9 @@ export class StreamingOpenResp extends jspb.Message { getData_asB64(): string; setData(value: Uint8Array | string): StreamingOpenResp; + getDropped(): number; + setDropped(value: number): StreamingOpenResp; + serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): StreamingOpenResp.AsObject; @@ -109,5 +126,6 @@ export class StreamingOpenResp extends jspb.Message { export namespace StreamingOpenResp { export type AsObject = { data: Uint8Array | string, + dropped: number, } } diff --git a/arduino-ide-extension/src/node/cli-protocol/monitor/monitor_pb.js b/arduino-ide-extension/src/node/cli-protocol/monitor/monitor_pb.js index 7514bfe1c..0cace1dd6 100644 --- a/arduino-ide-extension/src/node/cli-protocol/monitor/monitor_pb.js +++ b/arduino-ide-extension/src/node/cli-protocol/monitor/monitor_pb.js @@ -2,6 +2,7 @@ /** * @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 @@ -93,7 +94,7 @@ if (goog.DEBUG && !COMPILED) { * @private {!Array>} * @const */ -proto.cc.arduino.cli.monitor.StreamingOpenReq.oneofGroups_ = [[1,2]]; +proto.cc.arduino.cli.monitor.StreamingOpenReq.oneofGroups_ = [[1,2,3]]; /** * @enum {number} @@ -101,7 +102,8 @@ proto.cc.arduino.cli.monitor.StreamingOpenReq.oneofGroups_ = [[1,2]]; proto.cc.arduino.cli.monitor.StreamingOpenReq.ContentCase = { CONTENT_NOT_SET: 0, MONITORCONFIG: 1, - DATA: 2 + DATA: 2, + RECV_ACKNOWLEDGE: 3 }; /** @@ -143,7 +145,8 @@ proto.cc.arduino.cli.monitor.StreamingOpenReq.prototype.toObject = function(opt_ proto.cc.arduino.cli.monitor.StreamingOpenReq.toObject = function(includeInstance, msg) { var f, obj = { monitorconfig: (f = msg.getMonitorconfig()) && proto.cc.arduino.cli.monitor.MonitorConfig.toObject(includeInstance, f), - data: msg.getData_asB64() + data: msg.getData_asB64(), + recvAcknowledge: jspb.Message.getFieldWithDefault(msg, 3, 0) }; if (includeInstance) { @@ -189,6 +192,10 @@ proto.cc.arduino.cli.monitor.StreamingOpenReq.deserializeBinaryFromReader = func var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setData(value); break; + case 3: + var value = /** @type {number} */ (reader.readInt32()); + msg.setRecvAcknowledge(value); + break; default: reader.skipField(); break; @@ -233,6 +240,13 @@ proto.cc.arduino.cli.monitor.StreamingOpenReq.serializeBinaryToWriter = function f ); } + f = /** @type {number} */ (jspb.Message.getField(message, 3)); + if (f != null) { + writer.writeInt32( + 3, + f + ); + } }; @@ -333,6 +347,42 @@ proto.cc.arduino.cli.monitor.StreamingOpenReq.prototype.hasData = function() { }; +/** + * optional int32 recv_acknowledge = 3; + * @return {number} + */ +proto.cc.arduino.cli.monitor.StreamingOpenReq.prototype.getRecvAcknowledge = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.cc.arduino.cli.monitor.StreamingOpenReq} returns this + */ +proto.cc.arduino.cli.monitor.StreamingOpenReq.prototype.setRecvAcknowledge = function(value) { + return jspb.Message.setOneofField(this, 3, proto.cc.arduino.cli.monitor.StreamingOpenReq.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.cc.arduino.cli.monitor.StreamingOpenReq} returns this + */ +proto.cc.arduino.cli.monitor.StreamingOpenReq.prototype.clearRecvAcknowledge = function() { + return jspb.Message.setOneofField(this, 3, proto.cc.arduino.cli.monitor.StreamingOpenReq.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.cc.arduino.cli.monitor.StreamingOpenReq.prototype.hasRecvAcknowledge = function() { + return jspb.Message.getField(this, 3) != null; +}; + + @@ -367,7 +417,8 @@ proto.cc.arduino.cli.monitor.MonitorConfig.toObject = function(includeInstance, var f, obj = { target: jspb.Message.getFieldWithDefault(msg, 1, ""), type: jspb.Message.getFieldWithDefault(msg, 2, 0), - additionalconfig: (f = msg.getAdditionalconfig()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f) + additionalconfig: (f = msg.getAdditionalconfig()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f), + recvRateLimitBuffer: jspb.Message.getFieldWithDefault(msg, 4, 0) }; if (includeInstance) { @@ -417,6 +468,10 @@ proto.cc.arduino.cli.monitor.MonitorConfig.deserializeBinaryFromReader = functio reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); msg.setAdditionalconfig(value); break; + case 4: + var value = /** @type {number} */ (reader.readInt32()); + msg.setRecvRateLimitBuffer(value); + break; default: reader.skipField(); break; @@ -468,6 +523,13 @@ proto.cc.arduino.cli.monitor.MonitorConfig.serializeBinaryToWriter = function(me google_protobuf_struct_pb.Struct.serializeBinaryToWriter ); } + f = message.getRecvRateLimitBuffer(); + if (f !== 0) { + writer.writeInt32( + 4, + f + ); + } }; @@ -475,7 +537,8 @@ proto.cc.arduino.cli.monitor.MonitorConfig.serializeBinaryToWriter = function(me * @enum {number} */ proto.cc.arduino.cli.monitor.MonitorConfig.TargetType = { - SERIAL: 0 + SERIAL: 0, + NULL: 99 }; /** @@ -551,6 +614,24 @@ proto.cc.arduino.cli.monitor.MonitorConfig.prototype.hasAdditionalconfig = funct }; +/** + * optional int32 recv_rate_limit_buffer = 4; + * @return {number} + */ +proto.cc.arduino.cli.monitor.MonitorConfig.prototype.getRecvRateLimitBuffer = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.cc.arduino.cli.monitor.MonitorConfig} returns this + */ +proto.cc.arduino.cli.monitor.MonitorConfig.prototype.setRecvRateLimitBuffer = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); +}; + + @@ -583,7 +664,8 @@ proto.cc.arduino.cli.monitor.StreamingOpenResp.prototype.toObject = function(opt */ proto.cc.arduino.cli.monitor.StreamingOpenResp.toObject = function(includeInstance, msg) { var f, obj = { - data: msg.getData_asB64() + data: msg.getData_asB64(), + dropped: jspb.Message.getFieldWithDefault(msg, 2, 0) }; if (includeInstance) { @@ -624,6 +706,10 @@ proto.cc.arduino.cli.monitor.StreamingOpenResp.deserializeBinaryFromReader = fun var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setData(value); break; + case 2: + var value = /** @type {number} */ (reader.readInt32()); + msg.setDropped(value); + break; default: reader.skipField(); break; @@ -660,6 +746,13 @@ proto.cc.arduino.cli.monitor.StreamingOpenResp.serializeBinaryToWriter = functio f ); } + f = message.getDropped(); + if (f !== 0) { + writer.writeInt32( + 2, + f + ); + } }; @@ -705,4 +798,22 @@ proto.cc.arduino.cli.monitor.StreamingOpenResp.prototype.setData = function(valu }; +/** + * optional int32 dropped = 2; + * @return {number} + */ +proto.cc.arduino.cli.monitor.StreamingOpenResp.prototype.getDropped = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.cc.arduino.cli.monitor.StreamingOpenResp} returns this + */ +proto.cc.arduino.cli.monitor.StreamingOpenResp.prototype.setDropped = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + goog.object.extend(exports, proto.cc.arduino.cli.monitor); diff --git a/arduino-ide-extension/src/node/cli-protocol/settings/settings_pb.js b/arduino-ide-extension/src/node/cli-protocol/settings/settings_pb.js index 3fe308c4d..f34b0077f 100644 --- a/arduino-ide-extension/src/node/cli-protocol/settings/settings_pb.js +++ b/arduino-ide-extension/src/node/cli-protocol/settings/settings_pb.js @@ -2,6 +2,7 @@ /** * @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