Add files from protobuf with def/protobuf prefix
This commit is contained in:
parent
85ae013df0
commit
baab53ef89
14
def/protobuf/.gitignore
vendored
Normal file
14
def/protobuf/.gitignore
vendored
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
.DS_Store
|
||||||
|
node_modules
|
||||||
|
dist
|
||||||
|
*.log
|
||||||
|
|
||||||
|
# Editor directories and files
|
||||||
|
.idea
|
||||||
|
.vscode
|
||||||
|
*.iml
|
||||||
|
*.suo
|
||||||
|
*.ntvs*
|
||||||
|
*.njsproj
|
||||||
|
*.sln
|
||||||
|
*.sw*
|
||||||
3
def/protobuf/dummy.go
Normal file
3
def/protobuf/dummy.go
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
package corteza_protobuf
|
||||||
|
|
||||||
|
// Dummy file so we can import it in go project
|
||||||
6
def/protobuf/package.json
Normal file
6
def/protobuf/package.json
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"name": "@cortezaproject/corteza-protobuf",
|
||||||
|
"version": "2020.3.0-rc.1",
|
||||||
|
"private": true,
|
||||||
|
"description": "Corteza Protobuf dummy package"
|
||||||
|
}
|
||||||
150
def/protobuf/service-corredor.proto
Normal file
150
def/protobuf/service-corredor.proto
Normal file
@ -0,0 +1,150 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package corredor;
|
||||||
|
|
||||||
|
// Executing and listing server-scripts
|
||||||
|
service ServerScripts {
|
||||||
|
// Executes server script
|
||||||
|
rpc Exec(ExecRequest) returns (ExecResponse);
|
||||||
|
|
||||||
|
// List of server scripts
|
||||||
|
rpc List(ServerScriptListRequest) returns (ServerScriptListResponse);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Executing and listing client-scripts
|
||||||
|
service ClientScripts {
|
||||||
|
// Bundles
|
||||||
|
rpc Bundle (BundleRequest) returns (BundleResponse);
|
||||||
|
|
||||||
|
// List of client scripts
|
||||||
|
rpc List(ClientScriptListRequest) returns (ClientScriptListResponse);
|
||||||
|
}
|
||||||
|
|
||||||
|
service Storage {
|
||||||
|
// rpc List(path) returns (list of dirs/files);
|
||||||
|
// rpc Store(path, content) returns (bool);
|
||||||
|
// rpc Delete(path, content) returns (bool);
|
||||||
|
// rpc Get(path) returns (file);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
|
||||||
|
|
||||||
|
message ExecRequest {
|
||||||
|
string name = 1;
|
||||||
|
map<string, string> args = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message ExecResponse {
|
||||||
|
map<string, string> result = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
|
||||||
|
|
||||||
|
message ServerScriptListRequest {
|
||||||
|
// query by name, label, description
|
||||||
|
string query = 1;
|
||||||
|
|
||||||
|
// filter by resource - exact match
|
||||||
|
string resourceType = 2;
|
||||||
|
|
||||||
|
// filter by events - script must contain all specified events
|
||||||
|
repeated string eventTypes = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message ServerScriptListResponse {
|
||||||
|
repeated ServerScript scripts = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
|
||||||
|
|
||||||
|
message ClientScriptListRequest {
|
||||||
|
// query by name, label, description
|
||||||
|
string query = 1;
|
||||||
|
|
||||||
|
// filter by resource - exact match
|
||||||
|
string resourceType = 2;
|
||||||
|
|
||||||
|
// filter by events - script must contain all specified events
|
||||||
|
repeated string eventTypes = 3;
|
||||||
|
|
||||||
|
// filter by bundle - exact match
|
||||||
|
string bundle = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
message ClientScriptListResponse {
|
||||||
|
repeated ClientScript scripts = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
|
||||||
|
|
||||||
|
message BundleRequest {
|
||||||
|
string name = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message BundleResponse {
|
||||||
|
repeated Bundle bundles = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
|
||||||
|
|
||||||
|
message ServerScript {
|
||||||
|
string name = 1;
|
||||||
|
string label = 2;
|
||||||
|
string description = 3;
|
||||||
|
string updatedAt = 12;
|
||||||
|
Security security = 13;
|
||||||
|
repeated Trigger triggers = 14;
|
||||||
|
Iterator iterator = 11;
|
||||||
|
repeated string errors = 15;
|
||||||
|
}
|
||||||
|
|
||||||
|
message ClientScript {
|
||||||
|
string name = 1;
|
||||||
|
string label = 2;
|
||||||
|
string description = 3;
|
||||||
|
string bundle = 4;
|
||||||
|
string type = 6;
|
||||||
|
string updatedAt = 12;
|
||||||
|
Security security = 13;
|
||||||
|
repeated Trigger triggers = 14;
|
||||||
|
repeated string errors = 15;
|
||||||
|
}
|
||||||
|
|
||||||
|
message Security {
|
||||||
|
string runAs = 1;
|
||||||
|
repeated string deny = 2;
|
||||||
|
repeated string allow = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message Trigger {
|
||||||
|
repeated string eventTypes = 1;
|
||||||
|
repeated string resourceTypes = 2;
|
||||||
|
repeated TUIProp uiProps = 14;
|
||||||
|
repeated TConstraint constraints = 15;
|
||||||
|
}
|
||||||
|
|
||||||
|
message Iterator {
|
||||||
|
string eventType = 1;
|
||||||
|
string resourceType = 2;
|
||||||
|
repeated string deferred = 3;
|
||||||
|
map<string, string> filter = 4;
|
||||||
|
string action = 5;
|
||||||
|
repeated TUIProp uiProps = 14;
|
||||||
|
}
|
||||||
|
|
||||||
|
message TConstraint {
|
||||||
|
string name = 1;
|
||||||
|
string op = 2;
|
||||||
|
repeated string value = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message TUIProp {
|
||||||
|
string name = 1;
|
||||||
|
string value = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message Bundle {
|
||||||
|
string name = 1;
|
||||||
|
string type = 2;
|
||||||
|
string code = 3;
|
||||||
|
}
|
||||||
3
def/protobuf/system/dummy.go
Normal file
3
def/protobuf/system/dummy.go
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
package system
|
||||||
|
|
||||||
|
// Dummy file so we can import it in go project
|
||||||
21
def/protobuf/system/role.proto
Normal file
21
def/protobuf/system/role.proto
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package system;
|
||||||
|
option go_package = "proto";
|
||||||
|
|
||||||
|
service Roles {
|
||||||
|
rpc Find(FindRoleRequest) returns (FindRoleResponse);
|
||||||
|
}
|
||||||
|
|
||||||
|
message FindRoleRequest {}
|
||||||
|
|
||||||
|
message FindRoleResponse {
|
||||||
|
repeated Role roles = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message Role {
|
||||||
|
uint64 ID = 1;
|
||||||
|
string handle = 2;
|
||||||
|
string name = 3;
|
||||||
|
}
|
||||||
|
|
||||||
34
def/protobuf/system/user.proto
Normal file
34
def/protobuf/system/user.proto
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package system;
|
||||||
|
option go_package = "proto";
|
||||||
|
|
||||||
|
service Users {
|
||||||
|
rpc MakeJWT(MakeJWTUserRequest) returns (MakeJWTUserResponse);
|
||||||
|
rpc FindByID(FindByIDUserRequest) returns (FindByIDUserResponse);
|
||||||
|
}
|
||||||
|
|
||||||
|
message MakeJWTUserRequest {
|
||||||
|
uint64 userID = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message MakeJWTUserResponse {
|
||||||
|
string JWT = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message FindByIDUserRequest {
|
||||||
|
uint64 userID = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message FindByIDUserResponse {
|
||||||
|
User user = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message User {
|
||||||
|
uint64 ID = 1;
|
||||||
|
string email = 2;
|
||||||
|
string handle = 3;
|
||||||
|
string name = 4;
|
||||||
|
string kind = 5;
|
||||||
|
}
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user