@@ -2,17 +2,17 @@ syntax = "proto3";
|
||||
|
||||
package pkgdash;
|
||||
|
||||
option go_package = "go.unistack.org/unistack-org/pkgdash/proto;pkgdashpb";
|
||||
|
||||
import "api/annotations.proto";
|
||||
import "openapiv3/annotations.proto";
|
||||
import "validate/validate.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
option go_package = "go.unistack.org/unistack-org/pkgdash/proto;pkgdashpb";
|
||||
|
||||
service PkgdashService {
|
||||
rpc ListPackage(google.protobuf.Empty) returns (ListPackageRsp) {
|
||||
rpc PackagesCreate(PackagesCreateReq) returns (PackagesCreateRsp) {
|
||||
option (micro.openapiv3.openapiv3_operation) = {
|
||||
operation_id: "ListPackage";
|
||||
operation_id: "PackagesCreate";
|
||||
responses: {
|
||||
default: {
|
||||
reference: {_ref: ".pkgdash.ErrorRsp"};
|
||||
@@ -20,84 +20,113 @@ service PkgdashService {
|
||||
};
|
||||
};
|
||||
option (micro.api.http) = {
|
||||
get: "/v1/packages";
|
||||
};
|
||||
};
|
||||
rpc UpdatePackage(UpdatePackageReq) returns (UpdatePackageRsp) {
|
||||
option (micro.openapiv3.openapiv3_operation) = {
|
||||
operation_id: "UpdateInfo";
|
||||
responses: {
|
||||
default: {
|
||||
reference: {_ref: ".pkgdash.ErrorRsp"};
|
||||
};
|
||||
};
|
||||
};
|
||||
option (micro.api.http) = {
|
||||
post: "/v1/package/{id}";
|
||||
post: "/v1/packages";
|
||||
body: "*";
|
||||
};
|
||||
};
|
||||
rpc AddComment(AddCommentReq) returns (AddCommentRsp) {
|
||||
option (micro.openapiv3.openapiv3_operation) = {
|
||||
operation_id: "AddComment";
|
||||
responses: {
|
||||
default: {
|
||||
reference: {_ref: ".pkgdash.ErrorRsp"};
|
||||
};
|
||||
};
|
||||
};
|
||||
option (micro.api.http) = {
|
||||
post: "/v1/package/{pkg}/comment";
|
||||
body: "*";
|
||||
};
|
||||
};
|
||||
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";
|
||||
};
|
||||
};
|
||||
rpc GetComments(GetCommentsReq) returns (GetCommentsRsp) {
|
||||
option (micro.openapiv3.openapiv3_operation) = {
|
||||
operation_id: "GetComments";
|
||||
responses: {
|
||||
default: {
|
||||
reference: {_ref: ".pkgdash.ErrorRsp"};
|
||||
};
|
||||
};
|
||||
};
|
||||
option (micro.api.http) = {
|
||||
get: "/v1/comment";
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
message ErrorRsp {
|
||||
Error error = 1 [json_name = "error"];
|
||||
rpc PackagesDelete(PackagesDeleteReq) returns (PackagesDeleteRsp) {
|
||||
option (micro.openapiv3.openapiv3_operation) = {
|
||||
operation_id: "PackagesDelete";
|
||||
responses: {
|
||||
default: {
|
||||
reference: {_ref: ".pkgdash.ErrorRsp"};
|
||||
};
|
||||
};
|
||||
};
|
||||
option (micro.api.http) = {delete: "/v1/packages/{id}"};
|
||||
}
|
||||
rpc PackagesList(PackagesListReq) returns (PackagesListRsp) {
|
||||
option (micro.openapiv3.openapiv3_operation) = {
|
||||
operation_id: "PackagesList";
|
||||
responses: {
|
||||
default: {
|
||||
reference: {_ref: ".pkgdash.ErrorRsp"};
|
||||
};
|
||||
};
|
||||
};
|
||||
option (micro.api.http) = {get: "/v1/packages"};
|
||||
}
|
||||
rpc PackagesUpdate(PackagesUpdateReq) returns (PackagesUpdateRsp) {
|
||||
option (micro.openapiv3.openapiv3_operation) = {
|
||||
operation_id: "PackagesUpdate";
|
||||
responses: {
|
||||
default: {
|
||||
reference: {_ref: ".pkgdash.ErrorRsp"};
|
||||
};
|
||||
};
|
||||
};
|
||||
option (micro.api.http) = {
|
||||
put: "/v1/packages/{id}";
|
||||
body: "*";
|
||||
};
|
||||
}
|
||||
rpc CommentsCreate(CommentsCreateReq) returns (CommentsCreateRsp) {
|
||||
option (micro.openapiv3.openapiv3_operation) = {
|
||||
operation_id: "CommentsCreate";
|
||||
responses: {
|
||||
default: {
|
||||
reference: {_ref: ".pkgdash.ErrorRsp"};
|
||||
};
|
||||
};
|
||||
};
|
||||
option (micro.api.http) = {
|
||||
post: "/v1/packages/{package_id}/comments";
|
||||
body: "*";
|
||||
};
|
||||
}
|
||||
rpc CommentsLookup(CommentsLookupReq) returns (CommentsLookupRsp) {
|
||||
option (micro.openapiv3.openapiv3_operation) = {
|
||||
operation_id: "CommentsLookup";
|
||||
responses: {
|
||||
default: {
|
||||
reference: {_ref: ".pkgdash.ErrorRsp"};
|
||||
};
|
||||
};
|
||||
};
|
||||
option (micro.api.http) = {
|
||||
get: "/v1/comments/{id}/comments";
|
||||
additional_bindings {get: "/v1/comments/{package_id}/comments/{id}"};
|
||||
};
|
||||
}
|
||||
rpc CommentsList(CommentsListReq) returns (CommentsListRsp) {
|
||||
option (micro.openapiv3.openapiv3_operation) = {
|
||||
operation_id: "CommentsList";
|
||||
responses: {
|
||||
default: {
|
||||
reference: {_ref: ".pkgdash.ErrorRsp"};
|
||||
};
|
||||
};
|
||||
};
|
||||
option (micro.api.http) = {get: "/v1/packages/{package_id}/comments"};
|
||||
}
|
||||
rpc CommentsDelete(CommentsDeleteReq) returns (CommentsDeleteRsp) {
|
||||
option (micro.openapiv3.openapiv3_operation) = {
|
||||
operation_id: "CommentsDelete";
|
||||
responses: {
|
||||
default: {
|
||||
reference: {_ref: ".pkgdash.ErrorRsp"};
|
||||
};
|
||||
};
|
||||
};
|
||||
option (micro.api.http) = {
|
||||
delete: "/v1/packages/{package_id}/comments/{id}";
|
||||
additional_bindings {delete: "/v1/comments/{id}"};
|
||||
};
|
||||
}
|
||||
rpc ModulesList(ModulesListReq) returns (ModulesListRsp) {
|
||||
option (micro.openapiv3.openapiv3_operation) = {
|
||||
operation_id: "ModulesList";
|
||||
responses: {
|
||||
default: {
|
||||
reference: {_ref: ".pkgdash.ErrorRsp"};
|
||||
};
|
||||
};
|
||||
};
|
||||
option (micro.api.http) = {get: "/v1/modules"};
|
||||
}
|
||||
}
|
||||
|
||||
message Error {
|
||||
message ErrorRsp {
|
||||
string code = 1 [json_name = "code"];
|
||||
string title = 2 [json_name = "title"];
|
||||
string uuid = 3 [json_name = "uuid"];
|
||||
@@ -111,7 +140,9 @@ message Package {
|
||||
repeated uint64 modules = 4;
|
||||
repeated uint64 issues = 5;
|
||||
repeated uint64 comments = 6;
|
||||
};
|
||||
google.protobuf.Timestamp created = 7;
|
||||
google.protobuf.Timestamp updated = 8;
|
||||
}
|
||||
|
||||
message Module {
|
||||
uint64 id = 1 [(validate.rules).uint64.gt = 0];
|
||||
@@ -119,6 +150,8 @@ message Module {
|
||||
string version = 3 [(validate.rules).string.min_len = 1];
|
||||
uint64 package = 4 [(validate.rules).uint64.gt = 0];
|
||||
string last_version = 5 [(validate.rules).string.min_len = 1];
|
||||
google.protobuf.Timestamp created = 6;
|
||||
google.protobuf.Timestamp updated = 7;
|
||||
}
|
||||
|
||||
message Issue {
|
||||
@@ -127,75 +160,90 @@ message Issue {
|
||||
string desc = 3 [(validate.rules).string.min_len = 1];
|
||||
uint64 package = 4 [(validate.rules).uint64.gt = 0];
|
||||
repeated uint64 modules = 5;
|
||||
google.protobuf.Timestamp created = 6;
|
||||
google.protobuf.Timestamp updated = 7;
|
||||
}
|
||||
|
||||
message Comment {
|
||||
uint64 id = 1 [(validate.rules).uint64.gt = 0];
|
||||
uint64 package = 2 [(validate.rules).uint64.gt = 0];
|
||||
string text = 3;
|
||||
string created = 4 ;
|
||||
string updated = 5 ;
|
||||
google.protobuf.Timestamp created = 4;
|
||||
google.protobuf.Timestamp updated = 5;
|
||||
}
|
||||
|
||||
message ListPackageReq {}
|
||||
message ListPackageRsp{
|
||||
message CommentsDeleteReq {
|
||||
uint64 id = 1 [json_name = "id"];
|
||||
uint64 package_id = 2 [json_name = "package_id"];
|
||||
}
|
||||
|
||||
message CommentsDeleteRsp {}
|
||||
|
||||
message PackagesDeleteReq {
|
||||
uint64 id = 1 [json_name = "id"];
|
||||
}
|
||||
|
||||
message PackagesDeleteRsp {}
|
||||
|
||||
message PackagesListReq {}
|
||||
|
||||
message PackagesListRsp {
|
||||
repeated Package packages = 1;
|
||||
}
|
||||
|
||||
message UpdatePackageReq {
|
||||
message PackagesUpdateReq {
|
||||
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];
|
||||
repeated uint64 modules = 4 ;
|
||||
repeated uint64 issues = 5 ;
|
||||
}
|
||||
message UpdatePackageRsp {
|
||||
uint64 id = 1 [(validate.rules).uint64.gt = 0];
|
||||
repeated uint64 modules = 4;
|
||||
repeated uint64 issues = 5;
|
||||
}
|
||||
|
||||
message CommentReq {
|
||||
uint64 pkg = 1 [(validate.rules).uint64.gt = 0];
|
||||
message PackagesUpdateRsp {
|
||||
Package package = 1 [json_name = "package"];
|
||||
}
|
||||
|
||||
message CommentsCreateReq {
|
||||
uint64 package_id = 1 [
|
||||
json_name = "package_id",
|
||||
(validate.rules).uint64.gt = 0
|
||||
];
|
||||
string text = 2;
|
||||
}
|
||||
|
||||
message AddCommentReq {
|
||||
uint64 idPackage = 1 [(validate.rules).uint64.gt = 0];
|
||||
string text = 2;
|
||||
message CommentsCreateRsp {
|
||||
Comment comment = 1 [json_name = "comment"];
|
||||
}
|
||||
|
||||
message AddCommentRsp {
|
||||
uint64 id = 1 [(validate.rules).uint64.gt = 0];
|
||||
}
|
||||
|
||||
message AddPackageReq {
|
||||
message PackagesCreateReq {
|
||||
string name = 1 [(validate.rules).string.min_len = 1];
|
||||
string url = 2 [(validate.rules).string.min_len = 1];
|
||||
string url = 2 [(validate.rules).string.min_len = 1];
|
||||
repeated uint64 modules = 3;
|
||||
}
|
||||
|
||||
message AddPackageRsp{
|
||||
message PackagesCreateRsp {
|
||||
string status = 1 [(validate.rules).string.min_len = 1];
|
||||
}
|
||||
|
||||
message GetModuleReq {
|
||||
repeated uint64 id = 1 ;
|
||||
}
|
||||
message GetModuleRsp {
|
||||
repeated Module modules = 1 ;
|
||||
message ModulesListReq {}
|
||||
|
||||
message ModulesListRsp {
|
||||
repeated Module modules = 1;
|
||||
}
|
||||
|
||||
message GetCommentsReq {
|
||||
repeated uint64 id = 1 [(validate.rules).repeated = {
|
||||
unique: true
|
||||
min_items: 1
|
||||
items: {
|
||||
uint64: {
|
||||
gt: 0
|
||||
}
|
||||
}
|
||||
}] ;
|
||||
message CommentsListReq {
|
||||
uint64 package_id = 1 [json_name = "package_id"];
|
||||
}
|
||||
|
||||
message GetCommentsRsp {
|
||||
repeated Comment comments = 1;
|
||||
}
|
||||
message CommentsListRsp {
|
||||
repeated Comment comments = 1 [json_name = "comments"];
|
||||
}
|
||||
|
||||
message CommentsLookupReq {
|
||||
uint64 id = 1 [json_name = "id"];
|
||||
uint64 package_id = 2 [json_name = "package_id"];
|
||||
}
|
||||
|
||||
message CommentsLookupRsp {
|
||||
Comment comment = 1 [json_name = "comment"];
|
||||
}
|
||||
|
Reference in New Issue
Block a user