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
|
|
|
import "api/annotations.proto";
|
2023-08-18 23:59:15 +03:00
|
|
|
import "google/protobuf/timestamp.proto";
|
2023-08-11 21:27:38 +03:00
|
|
|
import "openapiv3/annotations.proto";
|
2023-08-07 21:30:30 +03:00
|
|
|
import "validate/validate.proto";
|
2023-08-16 13:17:42 +03:00
|
|
|
|
2024-12-07 02:35:30 +03:00
|
|
|
option go_package = "go.unistack.org/pkgdash/proto;pkgdashpb";
|
2023-08-07 21:30:30 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
service Pkgdash {
|
|
|
|
rpc PackageLookup(PackageLookupReq) returns (PackageLookupRsp) {
|
2023-08-18 23:59:15 +03:00
|
|
|
option (micro.openapiv3.openapiv3_operation) = {
|
2023-08-20 14:19:57 +03:00
|
|
|
operation_id: "PackageLookup";
|
2023-08-18 23:59:15 +03:00
|
|
|
responses: {
|
|
|
|
default: {
|
|
|
|
reference: {_ref: ".pkgdash.ErrorRsp"};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2023-09-23 21:16:26 +03:00
|
|
|
option (micro.api.http) = {get: "/v1/packages/{id}"};
|
2023-08-18 23:59:15 +03:00
|
|
|
}
|
2023-08-20 14:19:57 +03:00
|
|
|
rpc PackageCreate(PackageCreateReq) returns (PackageCreateRsp) {
|
2023-08-11 21:27:38 +03:00
|
|
|
option (micro.openapiv3.openapiv3_operation) = {
|
2023-08-20 14:19:57 +03:00
|
|
|
operation_id: "PackageCreate";
|
2023-08-11 21:27:38 +03:00
|
|
|
responses: {
|
|
|
|
default: {
|
|
|
|
reference: {_ref: ".pkgdash.ErrorRsp"};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
option (micro.api.http) = {
|
2023-08-16 13:17:42 +03:00
|
|
|
post: "/v1/packages";
|
|
|
|
body: "*";
|
2023-08-11 21:27:38 +03:00
|
|
|
};
|
2023-08-16 13:17:42 +03:00
|
|
|
}
|
2023-08-20 14:19:57 +03:00
|
|
|
rpc PackageDelete(PackageDeleteReq) returns (PackageDeleteRsp) {
|
2023-08-11 21:27:38 +03:00
|
|
|
option (micro.openapiv3.openapiv3_operation) = {
|
2023-08-20 14:19:57 +03:00
|
|
|
operation_id: "PackageDelete";
|
2023-08-11 21:27:38 +03:00
|
|
|
responses: {
|
|
|
|
default: {
|
|
|
|
reference: {_ref: ".pkgdash.ErrorRsp"};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2023-08-16 13:17:42 +03:00
|
|
|
option (micro.api.http) = {delete: "/v1/packages/{id}"};
|
|
|
|
}
|
2023-08-20 14:19:57 +03:00
|
|
|
rpc PackageList(PackageListReq) returns (PackageListRsp) {
|
2023-08-16 13:17:42 +03:00
|
|
|
option (micro.openapiv3.openapiv3_operation) = {
|
2023-08-20 14:19:57 +03:00
|
|
|
operation_id: "PackageList";
|
2023-08-16 13:17:42 +03:00
|
|
|
responses: {
|
|
|
|
default: {
|
|
|
|
reference: {_ref: ".pkgdash.ErrorRsp"};
|
|
|
|
};
|
|
|
|
};
|
2023-08-11 21:27:38 +03:00
|
|
|
};
|
2023-08-16 13:17:42 +03:00
|
|
|
option (micro.api.http) = {get: "/v1/packages"};
|
|
|
|
}
|
2023-09-23 21:16:26 +03:00
|
|
|
rpc HandlerList(HandlerListReq) returns (HandlerListRsp) {
|
|
|
|
option (micro.openapiv3.openapiv3_operation) = {
|
|
|
|
operation_id: "HandlerList";
|
|
|
|
responses: {
|
|
|
|
default: {
|
|
|
|
reference: {_ref: ".pkgdash.ErrorRsp"};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
option (micro.api.http) = {get: "/v1/packages/{package}/handlers"};
|
|
|
|
}
|
2023-08-20 14:19:57 +03:00
|
|
|
rpc PackageModules(PackageModulesReq) returns (PackageModulesRsp) {
|
2023-08-18 23:59:15 +03:00
|
|
|
option (micro.openapiv3.openapiv3_operation) = {
|
2023-08-20 14:19:57 +03:00
|
|
|
operation_id: "PackageModules";
|
2023-08-18 23:59:15 +03:00
|
|
|
responses: {
|
|
|
|
default: {
|
|
|
|
reference: {_ref: ".pkgdash.ErrorRsp"};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2023-08-19 16:55:52 +03:00
|
|
|
option (micro.api.http) = {get: "/v1/packages/{package}/modules"};
|
2023-08-18 23:59:15 +03:00
|
|
|
}
|
2023-08-20 14:19:57 +03:00
|
|
|
rpc PackageUpdate(PackageUpdateReq) returns (PackageUpdateRsp) {
|
2023-08-11 21:27:38 +03:00
|
|
|
option (micro.openapiv3.openapiv3_operation) = {
|
2023-08-20 14:19:57 +03:00
|
|
|
operation_id: "PackageUpdate";
|
2023-08-11 21:27:38 +03:00
|
|
|
responses: {
|
|
|
|
default: {
|
|
|
|
reference: {_ref: ".pkgdash.ErrorRsp"};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
option (micro.api.http) = {
|
2023-08-16 13:17:42 +03:00
|
|
|
put: "/v1/packages/{id}";
|
2023-08-11 21:27:38 +03:00
|
|
|
body: "*";
|
|
|
|
};
|
2023-08-16 13:17:42 +03:00
|
|
|
}
|
2023-08-20 14:19:57 +03:00
|
|
|
rpc CommentCreate(CommentCreateReq) returns (CommentCreateRsp) {
|
2023-08-11 21:45:08 +03:00
|
|
|
option (micro.openapiv3.openapiv3_operation) = {
|
2023-08-20 14:19:57 +03:00
|
|
|
operation_id: "CommentCreate";
|
2023-08-11 21:45:08 +03:00
|
|
|
responses: {
|
|
|
|
default: {
|
|
|
|
reference: {_ref: ".pkgdash.ErrorRsp"};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
option (micro.api.http) = {
|
2023-08-19 16:55:52 +03:00
|
|
|
post: "/v1/packages/{package}/comments";
|
2023-08-11 21:45:08 +03:00
|
|
|
body: "*";
|
|
|
|
};
|
2023-08-16 13:17:42 +03:00
|
|
|
}
|
2023-08-20 14:19:57 +03:00
|
|
|
rpc CommentLookup(CommentLookupReq) returns (CommentLookupRsp) {
|
2023-08-11 21:45:08 +03:00
|
|
|
option (micro.openapiv3.openapiv3_operation) = {
|
2023-08-20 14:19:57 +03:00
|
|
|
operation_id: "CommentLookup";
|
2023-08-11 21:45:08 +03:00
|
|
|
responses: {
|
|
|
|
default: {
|
|
|
|
reference: {_ref: ".pkgdash.ErrorRsp"};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
option (micro.api.http) = {
|
2023-09-23 21:16:26 +03:00
|
|
|
get: "/v1/comments/{id}";
|
2023-08-19 16:55:52 +03:00
|
|
|
additional_bindings {get: "/v1/comments/{package}/comments/{id}"};
|
2023-08-16 13:17:42 +03:00
|
|
|
};
|
|
|
|
}
|
2023-08-20 14:19:57 +03:00
|
|
|
rpc CommentList(CommentListReq) returns (CommentListRsp) {
|
2023-08-16 13:17:42 +03:00
|
|
|
option (micro.openapiv3.openapiv3_operation) = {
|
2023-08-20 14:19:57 +03:00
|
|
|
operation_id: "CommentList";
|
2023-08-16 13:17:42 +03:00
|
|
|
responses: {
|
|
|
|
default: {
|
|
|
|
reference: {_ref: ".pkgdash.ErrorRsp"};
|
|
|
|
};
|
|
|
|
};
|
2023-08-11 21:45:08 +03:00
|
|
|
};
|
2023-08-19 16:55:52 +03:00
|
|
|
option (micro.api.http) = {get: "/v1/packages/{package}/comments"};
|
2023-08-16 13:17:42 +03:00
|
|
|
}
|
2023-08-20 14:19:57 +03:00
|
|
|
rpc CommentDelete(CommentDeleteReq) returns (CommentDeleteRsp) {
|
2023-08-14 14:27:29 +03:00
|
|
|
option (micro.openapiv3.openapiv3_operation) = {
|
2023-08-20 14:19:57 +03:00
|
|
|
operation_id: "CommentDelete";
|
2023-08-14 14:27:29 +03:00
|
|
|
responses: {
|
|
|
|
default: {
|
|
|
|
reference: {_ref: ".pkgdash.ErrorRsp"};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
option (micro.api.http) = {
|
2023-08-16 13:17:42 +03:00
|
|
|
delete: "/v1/packages/{package_id}/comments/{id}";
|
|
|
|
additional_bindings {delete: "/v1/comments/{id}"};
|
2023-08-14 14:27:29 +03:00
|
|
|
};
|
|
|
|
}
|
2023-08-20 14:19:57 +03:00
|
|
|
rpc ModuleList(ModuleListReq) returns (ModuleListRsp) {
|
2023-08-16 13:17:42 +03:00
|
|
|
option (micro.openapiv3.openapiv3_operation) = {
|
2023-08-20 14:19:57 +03:00
|
|
|
operation_id: "ModuleList";
|
2023-08-16 13:17:42 +03:00
|
|
|
responses: {
|
|
|
|
default: {
|
|
|
|
reference: {_ref: ".pkgdash.ErrorRsp"};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
option (micro.api.http) = {get: "/v1/modules"};
|
|
|
|
}
|
2023-08-09 14:31:23 +03:00
|
|
|
}
|
|
|
|
|
2023-09-23 21:16:26 +03:00
|
|
|
message HandlerListReq {
|
|
|
|
uint64 package = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message HandlerListRsp {
|
|
|
|
repeated Handler handlers = 1;
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
message PackageModulesReq {
|
2023-08-19 16:55:52 +03:00
|
|
|
uint64 package = 1 [json_name = "package"];
|
2023-08-18 23:59:15 +03:00
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
message PackageModulesRsp {
|
2023-08-18 23:59:15 +03:00
|
|
|
repeated Module modules = 1 [json_name = "modules"];
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
message PackageLookupReq {
|
2023-08-18 23:59:15 +03:00
|
|
|
uint64 id = 1 [json_name = "id"];
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
message PackageLookupRsp {
|
2023-08-18 23:59:15 +03:00
|
|
|
Package package = 1 [json_name = "package"];
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
message ErrorRsp {
|
2023-08-09 14:31:23 +03:00
|
|
|
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-20 14:19:57 +03:00
|
|
|
string description = 4 [(validate.rules).string.min_len = 1];
|
|
|
|
uint64 modules = 5;
|
|
|
|
uint64 issues = 6;
|
|
|
|
uint64 comments = 7;
|
2023-09-23 21:16:26 +03:00
|
|
|
uint64 handlers = 8;
|
|
|
|
google.protobuf.Timestamp created = 9;
|
|
|
|
google.protobuf.Timestamp updated = 10;
|
|
|
|
google.protobuf.Timestamp last_check = 11;
|
|
|
|
string type = 12;
|
|
|
|
double coverage = 13;
|
|
|
|
}
|
|
|
|
|
|
|
|
message Handler {
|
|
|
|
uint64 id = 1 [(validate.rules).uint64.gt = 0];
|
|
|
|
uint64 package = 2 [(validate.rules).uint64.gt = 0];
|
|
|
|
string name = 3 [(validate.rules).string.min_len = 1];
|
|
|
|
double coverage = 4;
|
2023-08-16 13:17:42 +03:00
|
|
|
}
|
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];
|
2023-08-19 16:55:52 +03:00
|
|
|
google.protobuf.Timestamp last_check = 8;
|
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;
|
2023-08-16 13:17:42 +03:00
|
|
|
google.protobuf.Timestamp created = 6;
|
|
|
|
google.protobuf.Timestamp updated = 7;
|
2023-08-07 21:30:30 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
message Comment {
|
|
|
|
uint64 id = 1 [(validate.rules).uint64.gt = 0];
|
|
|
|
uint64 package = 2 [(validate.rules).uint64.gt = 0];
|
2023-08-18 23:59:15 +03:00
|
|
|
string comment = 3;
|
2023-08-16 13:17:42 +03:00
|
|
|
google.protobuf.Timestamp created = 4;
|
|
|
|
google.protobuf.Timestamp updated = 5;
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
message CommentDeleteReq {
|
2023-08-16 13:17:42 +03:00
|
|
|
uint64 id = 1 [json_name = "id"];
|
|
|
|
uint64 package_id = 2 [json_name = "package_id"];
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
message CommentDeleteRsp {}
|
2023-08-16 13:17:42 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
message PackageDeleteReq {
|
2023-08-16 13:17:42 +03:00
|
|
|
uint64 id = 1 [json_name = "id"];
|
2023-08-07 21:30:30 +03:00
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
message PackageDeleteRsp {}
|
2023-08-16 13:17:42 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
message PackageListReq {}
|
2023-08-16 13:17:42 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
message PackageListRsp {
|
2023-08-07 21:30:30 +03:00
|
|
|
repeated Package packages = 1;
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
message PackageUpdateReq {
|
2023-08-12 19:26:50 +03:00
|
|
|
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-16 13:17:42 +03:00
|
|
|
repeated uint64 modules = 4;
|
|
|
|
repeated uint64 issues = 5;
|
2023-09-23 21:16:26 +03:00
|
|
|
bytes coverprofile = 6;
|
2023-08-07 21:30:30 +03:00
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
message PackageUpdateRsp {
|
2023-08-16 13:17:42 +03:00
|
|
|
Package package = 1 [json_name = "package"];
|
2023-08-07 21:30:30 +03:00
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
message CommentCreateReq {
|
2023-08-16 13:17:42 +03:00
|
|
|
uint64 package_id = 1 [
|
|
|
|
json_name = "package_id",
|
|
|
|
(validate.rules).uint64.gt = 0
|
|
|
|
];
|
2023-08-18 23:59:15 +03:00
|
|
|
string comment = 2;
|
2023-08-07 21:30:30 +03:00
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
message CommentCreateRsp {
|
2023-08-16 13:17:42 +03:00
|
|
|
Comment comment = 1 [json_name = "comment"];
|
2023-08-11 20:12:15 +03:00
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
message PackageCreateReq {
|
2023-08-12 19:26:50 +03:00
|
|
|
string name = 1 [(validate.rules).string.min_len = 1];
|
2023-08-16 13:17:42 +03:00
|
|
|
string url = 2 [(validate.rules).string.min_len = 1];
|
2023-09-23 21:16:26 +03:00
|
|
|
string description = 3;
|
2023-08-11 20:12:15 +03:00
|
|
|
}
|
2023-08-11 21:45:08 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
message PackageCreateRsp {
|
2023-09-23 21:16:26 +03:00
|
|
|
Package package = 1 [json_name = "package"];
|
2023-08-12 19:26:50 +03:00
|
|
|
}
|
2023-08-11 20:12:15 +03:00
|
|
|
|
2023-09-23 21:16:26 +03:00
|
|
|
message ModuleListReq {
|
|
|
|
uint64 package = 1 [json_name = "package"];
|
|
|
|
}
|
2023-08-16 13:17:42 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
message ModuleListRsp {
|
2023-09-23 21:16:26 +03:00
|
|
|
repeated Module modules = 1 [json_name = "modules"];
|
2023-08-11 20:12:15 +03:00
|
|
|
}
|
2023-08-16 13:17:42 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
message CommentListReq {
|
2023-09-23 21:16:26 +03:00
|
|
|
uint64 package = 1 [json_name = "package"];
|
2023-08-14 14:27:29 +03:00
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
message CommentListRsp {
|
2023-08-16 13:17:42 +03:00
|
|
|
repeated Comment comments = 1 [json_name = "comments"];
|
2023-08-14 14:27:29 +03:00
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
message CommentLookupReq {
|
2023-08-16 13:17:42 +03:00
|
|
|
uint64 id = 1 [json_name = "id"];
|
2023-09-23 21:16:26 +03:00
|
|
|
uint64 package = 2 [json_name = "package"];
|
2023-08-16 13:17:42 +03:00
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
message CommentLookupRsp {
|
2023-08-16 13:17:42 +03:00
|
|
|
Comment comment = 1 [json_name = "comment"];
|
|
|
|
}
|