From fb6569463aae860ce28b16707209ec8c0369108f Mon Sep 17 00:00:00 2001 From: Daniel Yohan Date: Wed, 31 Mar 2021 14:00:38 -0300 Subject: [PATCH 1/4] Updated the definition of directories for all products --- connect/project.proto | 17 +++++++ .../rapidpro_billing}/billing.proto | 0 .../rapidpro_classifier}/classifier.proto | 0 .../rapidpro_flow}/flow.proto | 0 {rapidpro_org => flow/rapidpro_org}/org.proto | 0 .../rapidpro_statistic}/statistic.proto | 0 .../rapidpro_user}/user.proto | 0 inteligence/authentication.proto | 50 +++++++++++++++++++ inteligence/organization.proto | 45 +++++++++++++++++ 9 files changed, 112 insertions(+) create mode 100644 connect/project.proto rename {rapidpro_billing => flow/rapidpro_billing}/billing.proto (100%) rename {rapidpro_classifier => flow/rapidpro_classifier}/classifier.proto (100%) rename {rapidpro_flow => flow/rapidpro_flow}/flow.proto (100%) rename {rapidpro_org => flow/rapidpro_org}/org.proto (100%) rename {rapidpro_statistic => flow/rapidpro_statistic}/statistic.proto (100%) rename {rapidpro_user => flow/rapidpro_user}/user.proto (100%) create mode 100644 inteligence/authentication.proto create mode 100644 inteligence/organization.proto diff --git a/connect/project.proto b/connect/project.proto new file mode 100644 index 0000000..39e5d96 --- /dev/null +++ b/connect/project.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; + +package weni.connect.project; + +service ProjectController { + rpc Classifier(ClassifierListRequest) returns (stream ClassifierResponse) {} +} + +message ClassifierResponse { + string authorization_uuid = 1; + string classifier_type = 2; + string name = 3; +} + +message ClassifierListRequest { + string project_uuid = 1; +} diff --git a/rapidpro_billing/billing.proto b/flow/rapidpro_billing/billing.proto similarity index 100% rename from rapidpro_billing/billing.proto rename to flow/rapidpro_billing/billing.proto diff --git a/rapidpro_classifier/classifier.proto b/flow/rapidpro_classifier/classifier.proto similarity index 100% rename from rapidpro_classifier/classifier.proto rename to flow/rapidpro_classifier/classifier.proto diff --git a/rapidpro_flow/flow.proto b/flow/rapidpro_flow/flow.proto similarity index 100% rename from rapidpro_flow/flow.proto rename to flow/rapidpro_flow/flow.proto diff --git a/rapidpro_org/org.proto b/flow/rapidpro_org/org.proto similarity index 100% rename from rapidpro_org/org.proto rename to flow/rapidpro_org/org.proto diff --git a/rapidpro_statistic/statistic.proto b/flow/rapidpro_statistic/statistic.proto similarity index 100% rename from rapidpro_statistic/statistic.proto rename to flow/rapidpro_statistic/statistic.proto diff --git a/rapidpro_user/user.proto b/flow/rapidpro_user/user.proto similarity index 100% rename from rapidpro_user/user.proto rename to flow/rapidpro_user/user.proto diff --git a/inteligence/authentication.proto b/inteligence/authentication.proto new file mode 100644 index 0000000..a94403b --- /dev/null +++ b/inteligence/authentication.proto @@ -0,0 +1,50 @@ +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) {} +} + +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 Permission { + int32 role = 1; +} + +message UserRetrieveRequest { + string email = 1; +} + +message User { + int32 id = 1; + string email = 2; + string nickname = 3; + string name = 4; + string joined_at = 6; + bool is_active = 7; + bool is_superuser = 8; +} \ No newline at end of file diff --git a/inteligence/organization.proto b/inteligence/organization.proto new file mode 100644 index 0000000..8cf78b0 --- /dev/null +++ b/inteligence/organization.proto @@ -0,0 +1,45 @@ +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) {} +} + +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 name = 1; + string user_email = 2; + string user_nickname = 3; +} + +message OrgDestroyRequest { + int32 id = 1; + string user_email = 2; +} + +message OrgUpdateRequest { + int32 id = 1; + optional string name = 2; +} From d8b9eed6dfddc626e02160d6bb25ea2d1ac9a5d9 Mon Sep 17 00:00:00 2001 From: Daniel Yohan Date: Thu, 1 Apr 2021 11:02:40 -0300 Subject: [PATCH 2/4] Flow directories renamed --- flow/{rapidpro_billing => billing}/billing.proto | 0 flow/{rapidpro_classifier => classifier}/classifier.proto | 0 flow/{rapidpro_flow => flow}/flow.proto | 0 flow/{rapidpro_org => org}/org.proto | 0 flow/{rapidpro_statistic => statistic}/statistic.proto | 0 flow/{rapidpro_user => user}/user.proto | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename flow/{rapidpro_billing => billing}/billing.proto (100%) rename flow/{rapidpro_classifier => classifier}/classifier.proto (100%) rename flow/{rapidpro_flow => flow}/flow.proto (100%) rename flow/{rapidpro_org => org}/org.proto (100%) rename flow/{rapidpro_statistic => statistic}/statistic.proto (100%) rename flow/{rapidpro_user => user}/user.proto (100%) diff --git a/flow/rapidpro_billing/billing.proto b/flow/billing/billing.proto similarity index 100% rename from flow/rapidpro_billing/billing.proto rename to flow/billing/billing.proto diff --git a/flow/rapidpro_classifier/classifier.proto b/flow/classifier/classifier.proto similarity index 100% rename from flow/rapidpro_classifier/classifier.proto rename to flow/classifier/classifier.proto diff --git a/flow/rapidpro_flow/flow.proto b/flow/flow/flow.proto similarity index 100% rename from flow/rapidpro_flow/flow.proto rename to flow/flow/flow.proto diff --git a/flow/rapidpro_org/org.proto b/flow/org/org.proto similarity index 100% rename from flow/rapidpro_org/org.proto rename to flow/org/org.proto diff --git a/flow/rapidpro_statistic/statistic.proto b/flow/statistic/statistic.proto similarity index 100% rename from flow/rapidpro_statistic/statistic.proto rename to flow/statistic/statistic.proto diff --git a/flow/rapidpro_user/user.proto b/flow/user/user.proto similarity index 100% rename from flow/rapidpro_user/user.proto rename to flow/user/user.proto From 98b7d52c000b3f7e804052f7f36ecf50eb91fd2a Mon Sep 17 00:00:00 2001 From: Daniel Yohan Date: Fri, 9 Jul 2021 10:46:49 -0300 Subject: [PATCH 3/4] Update of protobuffers --- connect/project.proto | 23 +++++++++++++ flow/{billing => }/billing.proto | 0 flow/classifier.proto | 42 +++++++++++++++++++++++ flow/classifier/classifier.proto | 18 ---------- flow/{flow => }/flow.proto | 0 flow/{org => }/org.proto | 1 - flow/{statistic => }/statistic.proto | 2 -- flow/{user => }/user.proto | 0 inteligence/authentication.proto | 12 ++++++- inteligence/organization.proto | 12 +++++-- inteligence/repository.proto | 50 ++++++++++++++++++++++++++++ 11 files changed, 136 insertions(+), 24 deletions(-) rename flow/{billing => }/billing.proto (100%) create mode 100644 flow/classifier.proto delete mode 100644 flow/classifier/classifier.proto rename flow/{flow => }/flow.proto (100%) rename flow/{org => }/org.proto (98%) rename flow/{statistic => }/statistic.proto (99%) rename flow/{user => }/user.proto (100%) create mode 100644 inteligence/repository.proto diff --git a/connect/project.proto b/connect/project.proto index 39e5d96..46adf47 100644 --- a/connect/project.proto +++ b/connect/project.proto @@ -2,16 +2,39 @@ 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/flow/billing/billing.proto b/flow/billing.proto similarity index 100% rename from flow/billing/billing.proto rename to flow/billing.proto diff --git a/flow/classifier.proto b/flow/classifier.proto new file mode 100644 index 0000000..d179140 --- /dev/null +++ b/flow/classifier.proto @@ -0,0 +1,42 @@ +syntax = "proto3"; + +package weni.rapidpro.classifier; + +import "google/protobuf/empty.proto"; + +service ClassifierController { + rpc Create(ClassifierCreateRequest) returns (Classifier) {} + rpc Retrieve(ClassifierRetrieveRequest) returns (Classifier) {} + rpc Destroy(ClassifierDestroyRequest) returns (google.protobuf.Empty) {} + rpc List(ClassifierListRequest) returns (stream Classifier) {} +} + +message ClassifierListRequest { + string org_uuid = 1; + bool is_active = 2; + optional string classifier_type = 3; +} + +message Classifier { + string uuid = 1; + string classifier_type = 2; + string name = 3; + string access_token = 4; + bool is_active = 5; +} + +message ClassifierCreateRequest { + string org = 1; + string user = 2; + string classifier_type = 4; + string name = 5; + string access_token = 6; +} + +message ClassifierRetrieveRequest { + string uuid = 1; +} + +message ClassifierDestroyRequest { + string uuid = 1; +} diff --git a/flow/classifier/classifier.proto b/flow/classifier/classifier.proto deleted file mode 100644 index a6c2eb1..0000000 --- a/flow/classifier/classifier.proto +++ /dev/null @@ -1,18 +0,0 @@ -syntax = "proto3"; - -package weni.rapidpro.classifier; - -service ClassifierController { - rpc List(ClassifierListRequest) returns (stream Classifier) {} -} - -message ClassifierListRequest { - string org_uuid = 1; - optional string classifier_type = 2; -} - -message Classifier { - string uuid = 1; - string classifier_type = 2; - string name = 3; -} diff --git a/flow/flow/flow.proto b/flow/flow.proto similarity index 100% rename from flow/flow/flow.proto rename to flow/flow.proto diff --git a/flow/org/org.proto b/flow/org.proto similarity index 98% rename from flow/org/org.proto rename to flow/org.proto index 5e8f955..00e3ccf 100644 --- a/flow/org/org.proto +++ b/flow/org.proto @@ -37,7 +37,6 @@ message OrgCreateRequest { string name = 1; string timezone = 2; string user_email = 3; - string username = 4; } message OrgRetrieveRequest { diff --git a/flow/statistic/statistic.proto b/flow/statistic.proto similarity index 99% rename from flow/statistic/statistic.proto rename to flow/statistic.proto index 3c7862f..37bfa2d 100644 --- a/flow/statistic/statistic.proto +++ b/flow/statistic.proto @@ -15,5 +15,3 @@ message OrgStatistic { int32 active_classifiers = 2; int32 active_contacts = 3; } - - diff --git a/flow/user/user.proto b/flow/user.proto similarity index 100% rename from flow/user/user.proto rename to flow/user.proto diff --git a/inteligence/authentication.proto b/inteligence/authentication.proto index a94403b..9789133 100644 --- a/inteligence/authentication.proto +++ b/inteligence/authentication.proto @@ -14,6 +14,10 @@ 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; @@ -31,6 +35,11 @@ message UserPermissionRemoveRequest { int32 permission = 3; } +message UserLanguageUpdateRequest { + string email = 1; + string language = 2; +} + message Permission { int32 role = 1; } @@ -44,7 +53,8 @@ message User { string email = 2; string nickname = 3; string name = 4; + string language = 5; string joined_at = 6; bool is_active = 7; bool is_superuser = 8; -} \ No newline at end of file +} diff --git a/inteligence/organization.proto b/inteligence/organization.proto index 8cf78b0..87f29c7 100644 --- a/inteligence/organization.proto +++ b/inteligence/organization.proto @@ -9,6 +9,7 @@ service OrgController { rpc Create(OrgCreateRequest) returns (Org) {} rpc Update(OrgUpdateRequest) returns (OrgUpdateRequest) {} rpc Destroy(OrgDestroyRequest) returns (google.protobuf.Empty) {} + rpc Retrieve(OrgStatisticRetrieveRequest) returns (OrgStatistic) {} } message Org { @@ -29,9 +30,8 @@ message OrgListRequest { } message OrgCreateRequest { - string name = 1; + string organization_name = 1; string user_email = 2; - string user_nickname = 3; } message OrgDestroyRequest { @@ -43,3 +43,11 @@ 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; +} From 80184476716aec3911978f2873ee1d405b5ece73 Mon Sep 17 00:00:00 2001 From: Joao Date: Mon, 9 Aug 2021 01:54:22 -0300 Subject: [PATCH 4/4] Add user_email as parameter to ClassifierDestroyRequest --- flow/classifier.proto | 1 + 1 file changed, 1 insertion(+) diff --git a/flow/classifier.proto b/flow/classifier.proto index d179140..0642a19 100644 --- a/flow/classifier.proto +++ b/flow/classifier.proto @@ -39,4 +39,5 @@ message ClassifierRetrieveRequest { message ClassifierDestroyRequest { string uuid = 1; + string user_email = 2; }