Initial QSfera import

This commit is contained in:
Курнат Андрей
2026-06-07 10:20:04 +03:00
commit 2315f25754
16485 changed files with 4826827 additions and 0 deletions
@@ -0,0 +1,58 @@
syntax = "proto3";
package qsfera.services.eventhistory.v0;
option go_package = "github.com/qsfera/server/protogen/gen/qsfera/services/eventhistory/v0";
import "qsfera/messages/eventhistory/v0/eventhistory.proto";
import "protoc-gen-openapiv2/options/annotations.proto";
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
info: {
title: "КуСфера eventhistory";
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: "";
};
};
// A Service for storing events
service EventHistoryService {
// returns the specified events
rpc GetEvents(GetEventsRequest) returns (GetEventsResponse);
// returns all events for the specified userID
rpc GetEventsForUser(GetEventsForUserRequest) returns (GetEventsResponse);
}
// A request to retrieve events
message GetEventsRequest {
// the ids of the events we want to get
repeated string ids = 1;
}
// A request to retrieve events belonging to a userID
message GetEventsForUserRequest {
// the userID of the events we want to get
string userID = 1;
}
// The service response
message GetEventsResponse {
repeated qsfera.messages.eventhistory.v0.Event events = 1;
}
@@ -0,0 +1,51 @@
syntax = "proto3";
package qsfera.services.policies.v0;
option go_package = "github.com/qsfera/server/protogen/gen/qsfera/service/policies/v0";
import "qsfera/messages/policies/v0/policies.proto";
import "protoc-gen-openapiv2/options/annotations.proto";
import "google/api/annotations.proto";
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
info: {
title: "КуСфера policies";
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 policiesProvider {
rpc Evaluate(EvaluateRequest) returns (EvaluateResponse) {
option (google.api.http) = {
post: "/api/v0/policies/evaluate",
body: "*"
};
};
}
message EvaluateRequest {
string query = 1;
qsfera.messages.policies.v0.Environment environment = 2;
}
message EvaluateResponse {
bool result = 1;
}
@@ -0,0 +1,111 @@
syntax = "proto3";
package qsfera.services.search.v0;
option go_package = "github.com/qsfera/server/protogen/gen/qsfera/service/search/v0";
import "qsfera/messages/search/v0/search.proto";
import "protoc-gen-openapiv2/options/annotations.proto";
import "google/api/field_behavior.proto";
import "google/api/annotations.proto";
import "google/protobuf/field_mask.proto";
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
info: {
title: "КуСфера search";
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 SearchProvider {
rpc Search(SearchRequest) returns (SearchResponse) {
option (google.api.http) = {
post: "/api/v0/search/search",
body: "*"
};
};
rpc IndexSpace(IndexSpaceRequest) returns (IndexSpaceResponse) {
option (google.api.http) = {
post: "/api/v0/search/index-space",
body: "*"
};
}
}
service IndexProvider {
rpc Search(SearchIndexRequest) returns (SearchIndexResponse) {
option (google.api.http) = {
post: "/api/v0/search/index/search",
body: "*"
};
};
// rpc Remove(RemoveRequest) returns (RemoveResponse) {};
}
message SearchRequest {
// Optional. The maximum number of entries to return in the response
int32 page_size = 1 [(google.api.field_behavior) = OPTIONAL];
// Optional. A pagination token returned from a previous call to `Get`
// that indicates from where search should continue
string page_token = 2 [(google.api.field_behavior) = OPTIONAL];
string query = 3;
qsfera.messages.search.v0.Reference ref = 4 [(google.api.field_behavior) = OPTIONAL];
}
message SearchResponse {
repeated qsfera.messages.search.v0.Match matches = 1;
// Token to retrieve the next page of results, or empty if there are no
// more results in the list
string next_page_token = 2;
int32 total_matches = 3;
}
message SearchIndexRequest {
// Optional. The maximum number of entries to return in the response
int32 page_size = 1 [(google.api.field_behavior) = OPTIONAL];
// Optional. A pagination token returned from a previous call to `Get`
// that indicates from where search should continue
string page_token = 2 [(google.api.field_behavior) = OPTIONAL];
string query = 3;
qsfera.messages.search.v0.Reference ref = 4 [(google.api.field_behavior) = OPTIONAL];
}
message SearchIndexResponse {
repeated qsfera.messages.search.v0.Match matches = 1;
// Token to retrieve the next page of results, or empty if there are no
// more results in the list
string next_page_token = 2;
int32 total_matches = 3;
}
message IndexSpaceRequest {
string space_id = 1;
string user_id = 2;
bool force_reindex = 3;
}
message IndexSpaceResponse {
}
@@ -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;
}
@@ -0,0 +1,66 @@
syntax = "proto3";
package qsfera.services.thumbnails.v0;
option go_package = "github.com/qsfera/server/protogen/gen/qsfera/services/thumbnails/v0";
import "qsfera/messages/thumbnails/v0/thumbnails.proto";
import "protoc-gen-openapiv2/options/annotations.proto";
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
info: {
title: "КуСфера thumbnails";
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: "";
};
};
// A Service for handling thumbnail generation
service ThumbnailService {
// Generates the thumbnail and returns it.
rpc GetThumbnail(GetThumbnailRequest) returns (GetThumbnailResponse);
}
// A request to retrieve a thumbnail
message GetThumbnailRequest {
// The path to the source image
string filepath = 1;
// The type to which the thumbnail should get encoded to.
qsfera.messages.thumbnails.v0.ThumbnailType thumbnail_type = 2;
// The width of the thumbnail
int32 width = 3;
// The height of the thumbnail
int32 height = 4;
// Indicates which image processor to use
string processor = 5;
oneof source {
qsfera.messages.thumbnails.v0.WebdavSource webdav_source = 6;
qsfera.messages.thumbnails.v0.CS3Source cs3_source = 7;
}
}
// The service response
message GetThumbnailResponse {
// The endpoint where the thumbnail can be downloaded.
string data_endpoint = 1;
// The transfer token to be able to download the thumbnail.
string transfer_token = 2;
// The mimetype of the thumbnail
string mimetype = 3;
}