2023-08-07 21:30:30 +03:00
|
|
|
syntax = "proto3";
|
|
|
|
|
2023-08-11 21:27:38 +03:00
|
|
|
package pkgdash;
|
2023-08-07 21:30:30 +03:00
|
|
|
|
2023-08-11 21:27:38 +03:00
|
|
|
option go_package = "go.unistack.org/unistack-org/pkgdash/proto;pkgdashpb";
|
2023-08-07 21:30:30 +03:00
|
|
|
|
2023-08-11 21:27:38 +03:00
|
|
|
import "api/annotations.proto";
|
|
|
|
import "openapiv3/annotations.proto";
|
2023-08-07 21:30:30 +03:00
|
|
|
import "validate/validate.proto";
|
2023-08-11 20:12:15 +03:00
|
|
|
import "google/protobuf/wrappers.proto";
|
2023-08-07 21:30:30 +03:00
|
|
|
|
2023-08-11 21:27:38 +03:00
|
|
|
service PkgdashService {
|
|
|
|
rpc ListPackage(ListPackageReq) returns (ListPackageRsp) {
|
|
|
|
option (micro.openapiv3.openapiv3_operation) = {
|
|
|
|
operation_id: "ListPackage";
|
|
|
|
responses: {
|
|
|
|
default: {
|
|
|
|
reference: {_ref: ".pkgdash.ErrorRsp"};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
option (micro.api.http) = {
|
|
|
|
get: "/v1/packages";
|
|
|
|
};
|
|
|
|
};
|
2023-08-11 21:45:08 +03:00
|
|
|
rpc UpdatePackage(UpdatePackageReq) returns (UpdatePackageRsp) {
|
2023-08-11 21:27:38 +03:00
|
|
|
option (micro.openapiv3.openapiv3_operation) = {
|
|
|
|
operation_id: "UpdateInfo";
|
|
|
|
responses: {
|
|
|
|
default: {
|
|
|
|
reference: {_ref: ".pkgdash.ErrorRsp"};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
option (micro.api.http) = {
|
|
|
|
post: "/v1/package/{id}";
|
|
|
|
body: "*";
|
|
|
|
};
|
|
|
|
};
|
2023-08-11 21:45:08 +03:00
|
|
|
rpc AddComment(AddCommentReq) returns (AddCommentRsp) {
|
2023-08-11 21:27:38 +03:00
|
|
|
option (micro.openapiv3.openapiv3_operation) = {
|
|
|
|
operation_id: "AddComment";
|
|
|
|
responses: {
|
|
|
|
default: {
|
|
|
|
reference: {_ref: ".pkgdash.ErrorRsp"};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
option (micro.api.http) = {
|
|
|
|
post: "/v1/package/{pkg}/comment";
|
|
|
|
body: "*";
|
|
|
|
};
|
|
|
|
};
|
2023-08-11 21:45:08 +03:00
|
|
|
rpc AddPackage(AddPackageReq) returns (AddPackageRsp) {
|
|
|
|
option (micro.openapiv3.openapiv3_operation) = {
|
|
|
|
operation_id: "AddPackage";
|
|
|
|
responses: {
|
|
|
|
default: {
|
|
|
|
reference: {_ref: ".pkgdash.ErrorRsp"};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
option (micro.api.http) = {
|
|
|
|
post: "/v1/package";
|
|
|
|
body: "*";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
rpc GetModule(GetModuleReq) returns (GetModuleRsp) {
|
|
|
|
option (micro.openapiv3.openapiv3_operation) = {
|
|
|
|
operation_id: "GetModule";
|
|
|
|
responses: {
|
|
|
|
default: {
|
|
|
|
reference: {_ref: ".pkgdash.ErrorRsp"};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
option (micro.api.http) = {
|
|
|
|
get: "/v1/module";
|
|
|
|
};
|
|
|
|
};
|
2023-08-07 21:30:30 +03:00
|
|
|
};
|
|
|
|
|
2023-08-09 14:31:23 +03:00
|
|
|
message ErrorRsp {
|
|
|
|
Error error = 1 [json_name = "error"];
|
|
|
|
}
|
|
|
|
|
|
|
|
message Error {
|
|
|
|
string code = 1 [json_name = "code"];
|
|
|
|
string title = 2 [json_name = "title"];
|
|
|
|
string uuid = 3 [json_name = "uuid"];
|
|
|
|
string details = 4 [json_name = "details"];
|
|
|
|
}
|
|
|
|
|
2023-08-07 21:30:30 +03:00
|
|
|
message Package {
|
|
|
|
uint64 id = 1 [(validate.rules).uint64.gt = 0];
|
|
|
|
string name = 2 [(validate.rules).string.min_len = 1];
|
|
|
|
string url = 3 [(validate.rules).string.min_len = 1];
|
2023-08-11 20:12:15 +03:00
|
|
|
repeated uint64 modules = 4;
|
|
|
|
repeated uint64 issues = 5;
|
|
|
|
repeated uint64 comments = 6;
|
2023-08-07 21:30:30 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
message Module {
|
|
|
|
uint64 id = 1 [(validate.rules).uint64.gt = 0];
|
|
|
|
string name = 2 [(validate.rules).string.min_len = 1];
|
|
|
|
string version = 3 [(validate.rules).string.min_len = 1];
|
|
|
|
uint64 package = 4 [(validate.rules).uint64.gt = 0];
|
2023-08-11 20:12:15 +03:00
|
|
|
string last_version = 5 [(validate.rules).string.min_len = 1];
|
2023-08-07 21:30:30 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
message Issue {
|
|
|
|
uint64 id = 1 [(validate.rules).uint64.gt = 0];
|
|
|
|
uint64 status = 2 [(validate.rules).uint64.gt = 0];
|
|
|
|
string desc = 3 [(validate.rules).string.min_len = 1];
|
|
|
|
uint64 package = 4 [(validate.rules).uint64.gt = 0];
|
|
|
|
repeated uint64 modules = 5;
|
|
|
|
}
|
|
|
|
|
|
|
|
message Comment {
|
|
|
|
uint64 id = 1 [(validate.rules).uint64.gt = 0];
|
|
|
|
uint64 package = 2 [(validate.rules).uint64.gt = 0];
|
|
|
|
string text = 3;
|
|
|
|
uint64 created = 4 [(validate.rules).uint64.gt = 0];
|
|
|
|
uint64 updated = 5 [(validate.rules).uint64.gt = 0];
|
|
|
|
}
|
|
|
|
|
|
|
|
message ListPackageReq {}
|
|
|
|
message ListPackageRsp{
|
|
|
|
repeated Package packages = 1;
|
|
|
|
}
|
|
|
|
|
2023-08-11 20:12:15 +03:00
|
|
|
message UpdatePackageReq {
|
|
|
|
google.protobuf.UInt64Value id = 1 [(validate.rules).message.required = true];
|
|
|
|
google.protobuf.StringValue name = 2 [(validate.rules).message.required = true];
|
|
|
|
google.protobuf.StringValue url = 3 [(validate.rules).message.required = true];
|
|
|
|
repeated uint64 modules = 4 ;
|
|
|
|
repeated uint64 issues = 5 ;
|
2023-08-07 21:30:30 +03:00
|
|
|
}
|
2023-08-11 20:12:15 +03:00
|
|
|
message UpdatePackageRsp {
|
2023-08-07 21:30:30 +03:00
|
|
|
uint64 id = 1 [(validate.rules).uint64.gt = 0];
|
|
|
|
}
|
|
|
|
|
2023-08-11 21:27:38 +03:00
|
|
|
message CommentReq {
|
|
|
|
uint64 pkg = 1 [(validate.rules).uint64.gt = 0];
|
2023-08-07 21:30:30 +03:00
|
|
|
string text = 2;
|
|
|
|
}
|
|
|
|
|
2023-08-11 20:12:15 +03:00
|
|
|
message AddCommentReq {
|
|
|
|
google.protobuf.UInt64Value idPackage = 1 [(validate.rules).message.required = true];
|
2023-08-07 21:30:30 +03:00
|
|
|
string text = 2;
|
|
|
|
}
|
|
|
|
|
2023-08-11 20:12:15 +03:00
|
|
|
message AddCommentRsp {
|
2023-08-07 21:30:30 +03:00
|
|
|
uint64 id = 1 [(validate.rules).uint64.gt = 0];
|
2023-08-11 20:12:15 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
message AddPackageReq {
|
|
|
|
google.protobuf.StringValue name = 1 [(validate.rules).message.required = true];
|
|
|
|
google.protobuf.StringValue url = 2 [(validate.rules).message.required = true];
|
|
|
|
repeated uint64 modules = 3;
|
|
|
|
}
|
2023-08-11 21:45:08 +03:00
|
|
|
|
2023-08-11 20:12:15 +03:00
|
|
|
message AddPackageRsp{}
|
|
|
|
|
|
|
|
message GetModuleReq {
|
|
|
|
repeated uint64 id = 1 ;
|
|
|
|
}
|
|
|
|
message GetModuleRsp {
|
|
|
|
repeated Module modules = 1 ;
|
2023-08-07 21:30:30 +03:00
|
|
|
}
|