diff --git a/connect/project.proto b/connect/project.proto new file mode 100644 index 0000000..46adf47 --- /dev/null +++ b/connect/project.proto @@ -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; +} diff --git a/rapidpro_billing/billing.proto b/flow/billing.proto similarity index 100% rename from rapidpro_billing/billing.proto rename to flow/billing.proto diff --git a/rapidpro_classifier/classifier.proto b/flow/classifier.proto similarity index 97% rename from rapidpro_classifier/classifier.proto rename to flow/classifier.proto index d179140..0642a19 100644 --- a/rapidpro_classifier/classifier.proto +++ b/flow/classifier.proto @@ -39,4 +39,5 @@ message ClassifierRetrieveRequest { message ClassifierDestroyRequest { string uuid = 1; + string user_email = 2; } diff --git a/rapidpro_flow/flow.proto b/flow/flow.proto similarity index 100% rename from rapidpro_flow/flow.proto rename to flow/flow.proto diff --git a/rapidpro_org/org.proto b/flow/org.proto similarity index 100% rename from rapidpro_org/org.proto rename to flow/org.proto diff --git a/rapidpro_statistic/statistic.proto b/flow/statistic.proto similarity index 99% rename from rapidpro_statistic/statistic.proto rename to flow/statistic.proto index 3c7862f..37bfa2d 100644 --- a/rapidpro_statistic/statistic.proto +++ b/flow/statistic.proto @@ -15,5 +15,3 @@ message OrgStatistic { int32 active_classifiers = 2; int32 active_contacts = 3; } - - diff --git a/rapidpro_user/user.proto b/flow/user.proto similarity index 100% rename from rapidpro_user/user.proto rename to flow/user.proto diff --git a/inteligence/authentication.proto b/inteligence/authentication.proto new file mode 100644 index 0000000..9789133 --- /dev/null +++ b/inteligence/authentication.proto @@ -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; +} diff --git a/inteligence/organization.proto b/inteligence/organization.proto new file mode 100644 index 0000000..87f29c7 --- /dev/null +++ b/inteligence/organization.proto @@ -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; +} diff --git a/inteligence/repository.proto b/inteligence/repository.proto new file mode 100644 index 0000000..d8ce47c --- /dev/null +++ b/inteligence/repository.proto @@ -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; +}