Skip to content

Commit

Permalink
Updated the definition of directories for all products (#17)
Browse files Browse the repository at this point in the history
* Updated the definition of directories for all products

* Flow directories renamed

* Update of protobuffers

* Add user_email as parameter to ClassifierDestroyRequest (required due to rapidpro update)

Co-authored-by: Joao <[email protected]>
  • Loading branch information
dyohan9 and jcbalmeida authored Aug 10, 2021
1 parent a84bb86 commit d365cdc
Show file tree
Hide file tree
Showing 10 changed files with 204 additions and 2 deletions.
40 changes: 40 additions & 0 deletions connect/project.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
syntax = "proto3";

package weni.connect.project;

import "google/protobuf/empty.proto";

service ProjectController {
rpc Classifier(ClassifierListRequest) returns (stream ClassifierResponse) {}
rpc CreateClassifier(ClassifierCreateRequest) returns (ClassifierResponse) {}
rpc RetrieveClassifier(ClassifierRetrieveRequest) returns (ClassifierResponse) {}
rpc DestroyClassifier(ClassifierDestroyRequest) returns (google.protobuf.Empty) {}
}

message ClassifierResponse {
string authorization_uuid = 1;
string classifier_type = 2;
string name = 3;
bool is_active = 4;
string uuid = 5;
}

message ClassifierListRequest {
string project_uuid = 1;
}

message ClassifierCreateRequest {
string project_uuid = 1;
string user = 2;
string classifier_type = 3;
string name = 4;
string access_token = 5;
}

message ClassifierRetrieveRequest {
string uuid = 1;
}

message ClassifierDestroyRequest {
string uuid = 1;
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ message ClassifierRetrieveRequest {

message ClassifierDestroyRequest {
string uuid = 1;
string user_email = 2;
}
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions rapidpro_statistic/statistic.proto → flow/statistic.proto
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,3 @@ message OrgStatistic {
int32 active_classifiers = 2;
int32 active_contacts = 3;
}


File renamed without changes.
60 changes: 60 additions & 0 deletions inteligence/authentication.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
syntax = "proto3";

package weni.bothub.authentication;

import "google/protobuf/empty.proto";

service UserPermissionController {
rpc Retrieve(UserPermissionRetrieveRequest) returns (Permission) {}
rpc Update(UserPermissionUpdateRequest) returns (Permission) {}
rpc Remove(UserPermissionRemoveRequest) returns (google.protobuf.Empty) {}
}

service UserController {
rpc Retrieve(UserRetrieveRequest) returns (User) {}
}

service UserLanguageController {
rpc Update(UserLanguageUpdateRequest) returns (User) {}
}

message UserPermissionRetrieveRequest {
string org_user_email = 1;
int32 org_id = 2;
}

message UserPermissionUpdateRequest {
int32 org_id = 1;
string user_email = 2;
int32 permission = 3;
}

message UserPermissionRemoveRequest {
int32 org_id = 1;
string user_email = 2;
int32 permission = 3;
}

message UserLanguageUpdateRequest {
string email = 1;
string language = 2;
}

message Permission {
int32 role = 1;
}

message UserRetrieveRequest {
string email = 1;
}

message User {
int32 id = 1;
string email = 2;
string nickname = 3;
string name = 4;
string language = 5;
string joined_at = 6;
bool is_active = 7;
bool is_superuser = 8;
}
53 changes: 53 additions & 0 deletions inteligence/organization.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
syntax = "proto3";

package weni.bothub.org;

import "google/protobuf/empty.proto";

service OrgController {
rpc List(OrgListRequest) returns (stream Org) {}
rpc Create(OrgCreateRequest) returns (Org) {}
rpc Update(OrgUpdateRequest) returns (OrgUpdateRequest) {}
rpc Destroy(OrgDestroyRequest) returns (google.protobuf.Empty) {}
rpc Retrieve(OrgStatisticRetrieveRequest) returns (OrgStatistic) {}
}

message Org {
int32 id = 1;
string name = 2;
repeated Users users = 3;
}

message Users {
int32 org_user_id = 1;
string org_user_email = 2;
string org_user_nickname = 3;
string org_user_name = 4;
}

message OrgListRequest {
string user_email = 1;
}

message OrgCreateRequest {
string organization_name = 1;
string user_email = 2;
}

message OrgDestroyRequest {
int32 id = 1;
string user_email = 2;
}

message OrgUpdateRequest {
int32 id = 1;
optional string name = 2;
}

message OrgStatisticRetrieveRequest {
int32 org_id = 1;
}

message OrgStatistic {
int32 repositories_count = 1;
}
50 changes: 50 additions & 0 deletions inteligence/repository.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
syntax = "proto3";

package weni.bothub.repository;

service RepositoryController {
rpc List(RepositoryListRequest) returns (stream Repository) {}
rpc RetrieveAuthorization(RepositoryAuthorizationRetrieveRequest) returns (Repository) {}
}

message Repository {
string uuid = 1;
string name = 2;
string slug = 3;
string description = 4;
bool is_private = 5;
string created_at = 6;
string language = 7;
int32 owner = 8;
string algorithm = 9;
bool use_competing_intents = 10;
bool use_name_entities = 11;
bool use_analyze_char = 12;
string repository_type = 13;
string owner__nickname = 14;
repeated Intent intents = 15;
repeated int32 categories = 16;
repeated string available_languages = 17;
repeated Category categories_list = 18;
}

message Intent {
int32 id = 1;
string value = 2;
int32 examples__count = 3;
}

message Category {
int32 id = 1;
string name = 2;
string icon = 3;
}

message RepositoryListRequest {
optional int32 org_id = 1;
string name = 2;
}

message RepositoryAuthorizationRetrieveRequest {
string repository_authorization = 1;
}

0 comments on commit d365cdc

Please sign in to comment.