Update path of proto files in docker/compose-cli

Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
This commit is contained in:
Guillaume Tardif 2021-03-01 16:23:01 +01:00
Родитель e20ba7c85f
Коммит 09d6d3adae
10 изменённых файлов: 82 добавлений и 11 удалений

Просмотреть файл

@ -36,12 +36,13 @@ const get = async (p: string) => {
} }
if (p.endsWith('.proto')) { if (p.endsWith('.proto')) {
console.log(`Downloading ${response.data.path}`); const targetFile = response.data.path.replace("cli/server/protos", "protos")
const dir = path.dirname(response.data.path); console.log(`Downloading ${response.data.path} to ${targetFile}`);
const dir = path.dirname(targetFile);
fs.mkdirSync(`src/${dir}`, { recursive: true }); fs.mkdirSync(`src/${dir}`, { recursive: true });
const buffer = Buffer.from(response.data.content, 'base64'); const buffer = Buffer.from(response.data.content, 'base64');
const data = Readable.from(buffer.toString('ascii')); const data = Readable.from(buffer.toString('ascii'));
data.pipe(fs.createWriteStream(`src/${p}`)); data.pipe(fs.createWriteStream(`src/${targetFile}`));
} }
} catch (e) { } catch (e) {
console.error(e); console.error(e);
@ -49,5 +50,5 @@ const get = async (p: string) => {
}; };
(async function () { (async function () {
get('protos'); get('cli/server/protos');
})(); })();

Просмотреть файл

@ -17,7 +17,7 @@ syntax = "proto3";
package com.docker.api.protos.compose.v1; package com.docker.api.protos.compose.v1;
option go_package = "github.com/docker/compose-cli/protos/compose/v1;v1"; option go_package = "github.com/docker/compose-cli/cli/server/protos/compose/v1;v1";
service Compose { service Compose {
rpc Up(ComposeUpRequest) returns (ComposeUpResponse); rpc Up(ComposeUpRequest) returns (ComposeUpResponse);
@ -48,6 +48,7 @@ message ComposeDownResponse {
message ComposeStacksRequest { message ComposeStacksRequest {
string projectName = 1; string projectName = 1;
bool all = 2;
} }
message ComposeStacksResponse { message ComposeStacksResponse {

4
src/protos/compose/v1/compose_pb.d.ts поставляемый
Просмотреть файл

@ -114,6 +114,9 @@ export class ComposeStacksRequest extends jspb.Message {
getProjectname(): string; getProjectname(): string;
setProjectname(value: string): ComposeStacksRequest; setProjectname(value: string): ComposeStacksRequest;
getAll(): boolean;
setAll(value: boolean): ComposeStacksRequest;
serializeBinary(): Uint8Array; serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): ComposeStacksRequest.AsObject; toObject(includeInstance?: boolean): ComposeStacksRequest.AsObject;
@ -128,6 +131,7 @@ export class ComposeStacksRequest extends jspb.Message {
export namespace ComposeStacksRequest { export namespace ComposeStacksRequest {
export type AsObject = { export type AsObject = {
projectname: string, projectname: string,
all: boolean,
} }
} }

Просмотреть файл

@ -956,7 +956,8 @@ proto.com.docker.api.protos.compose.v1.ComposeStacksRequest.prototype.toObject =
*/ */
proto.com.docker.api.protos.compose.v1.ComposeStacksRequest.toObject = function(includeInstance, msg) { proto.com.docker.api.protos.compose.v1.ComposeStacksRequest.toObject = function(includeInstance, msg) {
var f, obj = { var f, obj = {
projectname: jspb.Message.getFieldWithDefault(msg, 1, "") projectname: jspb.Message.getFieldWithDefault(msg, 1, ""),
all: jspb.Message.getBooleanFieldWithDefault(msg, 2, false)
}; };
if (includeInstance) { if (includeInstance) {
@ -997,6 +998,10 @@ proto.com.docker.api.protos.compose.v1.ComposeStacksRequest.deserializeBinaryFro
var value = /** @type {string} */ (reader.readString()); var value = /** @type {string} */ (reader.readString());
msg.setProjectname(value); msg.setProjectname(value);
break; break;
case 2:
var value = /** @type {boolean} */ (reader.readBool());
msg.setAll(value);
break;
default: default:
reader.skipField(); reader.skipField();
break; break;
@ -1033,6 +1038,13 @@ proto.com.docker.api.protos.compose.v1.ComposeStacksRequest.serializeBinaryToWri
f f
); );
} }
f = message.getAll();
if (f) {
writer.writeBool(
2,
f
);
}
}; };
@ -1054,6 +1066,24 @@ proto.com.docker.api.protos.compose.v1.ComposeStacksRequest.prototype.setProject
}; };
/**
* optional bool all = 2;
* @return {boolean}
*/
proto.com.docker.api.protos.compose.v1.ComposeStacksRequest.prototype.getAll = function() {
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false));
};
/**
* @param {boolean} value
* @return {!proto.com.docker.api.protos.compose.v1.ComposeStacksRequest} returns this
*/
proto.com.docker.api.protos.compose.v1.ComposeStacksRequest.prototype.setAll = function(value) {
return jspb.Message.setProto3BooleanField(this, 2, value);
};
/** /**
* List of repeated fields within this message type. * List of repeated fields within this message type.

Просмотреть файл

@ -17,7 +17,7 @@ syntax = "proto3";
package com.docker.api.protos.containers.v1; package com.docker.api.protos.containers.v1;
option go_package = "github.com/docker/compose-cli/protos/containers/v1;v1"; option go_package = "github.com/docker/compose-cli/cli/server/protos/containers/v1;v1";
service Containers { service Containers {
rpc List(ListRequest) returns (ListResponse); rpc List(ListRequest) returns (ListResponse);
@ -121,6 +121,7 @@ message RunRequest {
repeated string environment = 10; repeated string environment = 10;
bool auto_remove = 11; bool auto_remove = 11;
Healthcheck healthcheck = 12; Healthcheck healthcheck = 12;
string platform = 13;
} }
message RunResponse { message RunResponse {

4
src/protos/containers/v1/containers_pb.d.ts поставляемый
Просмотреть файл

@ -448,6 +448,9 @@ export class RunRequest extends jspb.Message {
getHealthcheck(): Healthcheck | undefined; getHealthcheck(): Healthcheck | undefined;
setHealthcheck(value?: Healthcheck): RunRequest; setHealthcheck(value?: Healthcheck): RunRequest;
getPlatform(): string;
setPlatform(value: string): RunRequest;
serializeBinary(): Uint8Array; serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): RunRequest.AsObject; toObject(includeInstance?: boolean): RunRequest.AsObject;
@ -474,6 +477,7 @@ export namespace RunRequest {
environmentList: Array<string>, environmentList: Array<string>,
autoRemove: boolean, autoRemove: boolean,
healthcheck?: Healthcheck.AsObject, healthcheck?: Healthcheck.AsObject,
platform: string,
} }
} }

Просмотреть файл

@ -3139,7 +3139,8 @@ proto.com.docker.api.protos.containers.v1.RunRequest.toObject = function(include
commandList: (f = jspb.Message.getRepeatedField(msg, 9)) == null ? undefined : f, commandList: (f = jspb.Message.getRepeatedField(msg, 9)) == null ? undefined : f,
environmentList: (f = jspb.Message.getRepeatedField(msg, 10)) == null ? undefined : f, environmentList: (f = jspb.Message.getRepeatedField(msg, 10)) == null ? undefined : f,
autoRemove: jspb.Message.getBooleanFieldWithDefault(msg, 11, false), autoRemove: jspb.Message.getBooleanFieldWithDefault(msg, 11, false),
healthcheck: (f = msg.getHealthcheck()) && proto.com.docker.api.protos.containers.v1.Healthcheck.toObject(includeInstance, f) healthcheck: (f = msg.getHealthcheck()) && proto.com.docker.api.protos.containers.v1.Healthcheck.toObject(includeInstance, f),
platform: jspb.Message.getFieldWithDefault(msg, 13, "")
}; };
if (includeInstance) { if (includeInstance) {
@ -3228,6 +3229,10 @@ proto.com.docker.api.protos.containers.v1.RunRequest.deserializeBinaryFromReader
reader.readMessage(value,proto.com.docker.api.protos.containers.v1.Healthcheck.deserializeBinaryFromReader); reader.readMessage(value,proto.com.docker.api.protos.containers.v1.Healthcheck.deserializeBinaryFromReader);
msg.setHealthcheck(value); msg.setHealthcheck(value);
break; break;
case 13:
var value = /** @type {string} */ (reader.readString());
msg.setPlatform(value);
break;
default: default:
reader.skipField(); reader.skipField();
break; break;
@ -3340,6 +3345,13 @@ proto.com.docker.api.protos.containers.v1.RunRequest.serializeBinaryToWriter = f
proto.com.docker.api.protos.containers.v1.Healthcheck.serializeBinaryToWriter proto.com.docker.api.protos.containers.v1.Healthcheck.serializeBinaryToWriter
); );
} }
f = message.getPlatform();
if (f.length > 0) {
writer.writeString(
13,
f
);
}
}; };
@ -3659,6 +3671,24 @@ proto.com.docker.api.protos.containers.v1.RunRequest.prototype.hasHealthcheck =
}; };
/**
* optional string platform = 13;
* @return {string}
*/
proto.com.docker.api.protos.containers.v1.RunRequest.prototype.getPlatform = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 13, ""));
};
/**
* @param {string} value
* @return {!proto.com.docker.api.protos.containers.v1.RunRequest} returns this
*/
proto.com.docker.api.protos.containers.v1.RunRequest.prototype.setPlatform = function(value) {
return jspb.Message.setProto3StringField(this, 13, value);
};

Просмотреть файл

@ -17,7 +17,7 @@ syntax = "proto3";
package com.docker.api.protos.context.v1; package com.docker.api.protos.context.v1;
option go_package = "github.com/docker/compose-cli/protos/context/v1;v1"; option go_package = "github.com/docker/compose-cli/cli/server/protos/context/v1;v1";
service Contexts { service Contexts {
// Sets the current request for all calls // Sets the current request for all calls

Просмотреть файл

@ -19,7 +19,7 @@ package com.docker.api.protos.streams.v1;
import "google/protobuf/any.proto"; import "google/protobuf/any.proto";
option go_package = "github.com/docker/compose-cli/protos/streams/v1;v1"; option go_package = "github.com/docker/compose-cli/cli/server/protos/streams/v1;v1";
service Streaming { service Streaming {
rpc NewStream(stream google.protobuf.Any) returns (stream google.protobuf.Any); rpc NewStream(stream google.protobuf.Any) returns (stream google.protobuf.Any);

Просмотреть файл

@ -19,7 +19,7 @@ package com.docker.api.protos.volumes.v1;
import "google/protobuf/any.proto"; import "google/protobuf/any.proto";
option go_package = "github.com/docker/compose-cli/protos/volumes/v1;v1"; option go_package = "github.com/docker/compose-cli/cli/server/protos/volumes/v1;v1";
service Volumes { service Volumes {
rpc VolumesCreate(VolumesCreateRequest) returns (VolumesCreateResponse); rpc VolumesCreate(VolumesCreateRequest) returns (VolumesCreateResponse);