Initial QSfera import
This commit is contained in:
@@ -0,0 +1,282 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package qsfera.services.settings.v0;
|
||||
|
||||
option go_package = "github.com/qsfera/server/protogen/gen/qsfera/services/settings/v0";
|
||||
|
||||
import "qsfera/messages/settings/v0/settings.proto";
|
||||
import "google/api/annotations.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
import "protoc-gen-openapiv2/options/annotations.proto";
|
||||
|
||||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
|
||||
info: {
|
||||
title: "КуСфера settings";
|
||||
version: "1.0.0";
|
||||
contact: {
|
||||
name: "КуСфера";
|
||||
url: "";
|
||||
email: "";
|
||||
};
|
||||
license: {
|
||||
name: "Apache-2.0";
|
||||
url: "";
|
||||
};
|
||||
};
|
||||
schemes: HTTP;
|
||||
schemes: HTTPS;
|
||||
consumes: "application/json";
|
||||
produces: "application/json";
|
||||
external_docs: {
|
||||
description: "Developer Manual";
|
||||
url: "";
|
||||
};
|
||||
};
|
||||
|
||||
service BundleService {
|
||||
rpc SaveBundle(SaveBundleRequest) returns (SaveBundleResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v0/settings/bundle-save",
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
rpc GetBundle(GetBundleRequest) returns (GetBundleResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v0/settings/bundle-get",
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
rpc ListBundles(ListBundlesRequest) returns (ListBundlesResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v0/settings/bundles-list",
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
rpc AddSettingToBundle(AddSettingToBundleRequest) returns (AddSettingToBundleResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v0/settings/bundles-add-setting",
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
rpc RemoveSettingFromBundle(RemoveSettingFromBundleRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v0/settings/bundles-remove-setting",
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
service ValueService {
|
||||
rpc SaveValue(SaveValueRequest) returns (SaveValueResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v0/settings/values-save",
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
rpc GetValue(GetValueRequest) returns (GetValueResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v0/settings/values-get",
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
rpc ListValues(ListValuesRequest) returns (ListValuesResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v0/settings/values-list",
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
rpc GetValueByUniqueIdentifiers(GetValueByUniqueIdentifiersRequest) returns (GetValueResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v0/settings/values-get-by-unique-identifiers",
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
service RoleService {
|
||||
rpc ListRoles(ListBundlesRequest) returns (ListBundlesResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v0/settings/roles-list",
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
rpc ListRoleAssignments(ListRoleAssignmentsRequest) returns (ListRoleAssignmentsResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v0/settings/assignments-list",
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
rpc ListRoleAssignmentsFiltered(ListRoleAssignmentsFilteredRequest) returns (ListRoleAssignmentsResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v0/settings/assignments-list-filtered",
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
rpc AssignRoleToUser(AssignRoleToUserRequest) returns (AssignRoleToUserResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v0/settings/assignments-add",
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
rpc RemoveRoleFromUser(RemoveRoleFromUserRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v0/settings/assignments-remove",
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
service PermissionService {
|
||||
rpc ListPermissions(ListPermissionsRequest) returns (ListPermissionsResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v0/settings/permissions-list",
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
rpc ListPermissionsByResource(ListPermissionsByResourceRequest) returns (ListPermissionsByResourceResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v0/settings/permissions-list-by-resource",
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
rpc GetPermissionByID(GetPermissionByIDRequest) returns (GetPermissionByIDResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v0/settings/permissions-get-by-id",
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// ---
|
||||
// requests and responses for settings bundles
|
||||
// ---
|
||||
message SaveBundleRequest {
|
||||
qsfera.messages.settings.v0.Bundle bundle = 1;
|
||||
}
|
||||
|
||||
message SaveBundleResponse {
|
||||
qsfera.messages.settings.v0.Bundle bundle = 1;
|
||||
}
|
||||
|
||||
message GetBundleRequest {
|
||||
string bundle_id = 1;
|
||||
}
|
||||
|
||||
message GetBundleResponse {
|
||||
qsfera.messages.settings.v0.Bundle bundle = 1;
|
||||
}
|
||||
|
||||
message ListBundlesRequest {
|
||||
repeated string bundle_ids = 1;
|
||||
string locale = 2;
|
||||
}
|
||||
|
||||
message ListBundlesResponse {
|
||||
repeated qsfera.messages.settings.v0.Bundle bundles = 1;
|
||||
}
|
||||
|
||||
message AddSettingToBundleRequest {
|
||||
string bundle_id = 1;
|
||||
qsfera.messages.settings.v0.Setting setting = 2;
|
||||
}
|
||||
|
||||
message AddSettingToBundleResponse {
|
||||
qsfera.messages.settings.v0.Setting setting = 1;
|
||||
}
|
||||
|
||||
message RemoveSettingFromBundleRequest {
|
||||
string bundle_id = 1;
|
||||
string setting_id = 2;
|
||||
}
|
||||
|
||||
// ---
|
||||
// requests and responses for settings values
|
||||
// ---
|
||||
|
||||
message SaveValueRequest {
|
||||
qsfera.messages.settings.v0.Value value = 1;
|
||||
}
|
||||
|
||||
message SaveValueResponse {
|
||||
qsfera.messages.settings.v0.ValueWithIdentifier value = 1;
|
||||
}
|
||||
|
||||
message GetValueRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
message GetValueResponse {
|
||||
qsfera.messages.settings.v0.ValueWithIdentifier value = 1;
|
||||
}
|
||||
|
||||
message ListValuesRequest {
|
||||
string bundle_id = 1;
|
||||
string account_uuid = 2;
|
||||
}
|
||||
|
||||
message ListValuesResponse {
|
||||
repeated qsfera.messages.settings.v0.ValueWithIdentifier values = 1;
|
||||
}
|
||||
|
||||
message GetValueByUniqueIdentifiersRequest{
|
||||
string account_uuid = 1;
|
||||
string setting_id = 2;
|
||||
}
|
||||
|
||||
// --
|
||||
// requests and responses for role assignments
|
||||
// ---
|
||||
|
||||
message ListRoleAssignmentsRequest {
|
||||
string account_uuid = 1;
|
||||
}
|
||||
|
||||
message ListRoleAssignmentsFilteredRequest {
|
||||
repeated qsfera.messages.settings.v0.UserRoleAssignmentFilter filters = 1;
|
||||
}
|
||||
|
||||
message ListRoleAssignmentsResponse {
|
||||
repeated qsfera.messages.settings.v0.UserRoleAssignment assignments = 1;
|
||||
}
|
||||
|
||||
message AssignRoleToUserRequest {
|
||||
string account_uuid = 1;
|
||||
// the role_id is a bundle_id internally
|
||||
string role_id = 2;
|
||||
}
|
||||
|
||||
message AssignRoleToUserResponse {
|
||||
qsfera.messages.settings.v0.UserRoleAssignment assignment = 1;
|
||||
}
|
||||
|
||||
message RemoveRoleFromUserRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
// --
|
||||
// requests and responses for permissions
|
||||
// ---
|
||||
|
||||
message ListPermissionsRequest {
|
||||
string account_uuid = 1;
|
||||
}
|
||||
|
||||
message ListPermissionsResponse {
|
||||
repeated string permissions = 1;
|
||||
}
|
||||
|
||||
message ListPermissionsByResourceRequest {
|
||||
qsfera.messages.settings.v0.Resource resource = 1;
|
||||
}
|
||||
|
||||
message ListPermissionsByResourceResponse {
|
||||
repeated qsfera.messages.settings.v0.Permission permissions = 1;
|
||||
}
|
||||
|
||||
message GetPermissionByIDRequest {
|
||||
string permission_id = 1;
|
||||
}
|
||||
|
||||
message GetPermissionByIDResponse {
|
||||
qsfera.messages.settings.v0.Permission permission = 1;
|
||||
}
|
||||
Reference in New Issue
Block a user