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
+38
View File
@@ -0,0 +1,38 @@
version: v1
plugins:
- name: go
path: ../../.bingo/protoc-gen-go
out: ../gen/
opt:
- paths=source_relative
- name: go-grpc
path: ../../.bingo/protoc-gen-go-grpc
out: ../gen/
opt:
- paths=source_relative
- name: micro
path: ../../.bingo/protoc-gen-micro
out: ../gen/
opt:
- paths=source_relative
- name: microweb
path: ../../.bingo/protoc-gen-microweb
out: ../gen/
opt:
- paths=source_relative
- "ignore_packages=\
qsfera.services.thumbnails.v0;\
qsfera.messages.thumbnails.v0;\
qsfera.services.store.v0;\
qsfera.messages.store.v0;\
qsfera.services.eventhistory.v0;\
qsfera.messages.eventhistory.v0;\
qsfera.services.policies.v0;\
qsfera.messages.policies.v0"
- name: openapiv2
path: ../../.bingo/protoc-gen-openapiv2
out: ../gen/
+11
View File
@@ -0,0 +1,11 @@
# Generated by buf. DO NOT EDIT.
version: v1
deps:
- remote: buf.build
owner: googleapis
repository: googleapis
commit: 62f35d8aed1149c291d606d958a7ce32
- remote: buf.build
owner: grpc-ecosystem
repository: grpc-gateway
commit: bc28b723cd774c32b6fbc77621518765
+10
View File
@@ -0,0 +1,10 @@
version: v1
lint:
use:
- DEFAULT
deps:
- buf.build/googleapis/googleapis
- buf.build/grpc-ecosystem/grpc-gateway
breaking:
use:
- FILE
@@ -0,0 +1,16 @@
syntax = "proto3";
package qsfera.messages.eventhistory.v0;
option go_package = "github.com/qsfera/server/protogen/gen/qsfera/messages/eventhistory/v0";
message Event {
// REQUIRED.
string type = 1;
// REQUIRED.
string id = 2;
// REQUIRED
bytes event = 3;
}
@@ -0,0 +1,49 @@
syntax = "proto3";
package qsfera.messages.policies.v0;
option go_package = "github.com/qsfera/server/protogen/gen/qsfera/messages/policies/v0";
message User {
message ID {
string opaque_id = 1;
}
ID id = 1;
string username = 2;
string mail = 3;
string display_name = 4;
repeated string groups = 5;
}
message Resource {
message ID {
string storage_id = 1;
string opaque_id = 2;
string space_id = 3;
}
ID id = 1;
string name = 2;
uint64 size = 3;
string url = 4;
}
message Request {
string method = 1;
string path = 2;
}
enum Stage {
STAGE_PP = 0;
STAGE_HTTP = 1;
}
message Environment {
Stage stage = 1;
User user = 2;
Request request = 3;
Resource resource = 4;
}
@@ -0,0 +1,90 @@
syntax = "proto3";
package qsfera.messages.search.v0;
import "google/protobuf/timestamp.proto";
option go_package = "github.com/qsfera/server/protogen/gen/qsfera/messages/search/v0";
message ResourceID {
string storage_id = 1;
string opaque_id = 2;
string space_id = 3;
}
message Reference {
ResourceID resource_id = 1;
string path = 2;
}
message Audio {
optional string album = 1;
optional string albumArtist = 2;
optional string artist = 3;
optional int64 bitrate = 4;
optional string composers = 5;
optional string copyright = 6;
optional int32 disc = 7;
optional int32 discCount = 8;
optional int64 duration = 9;
optional string genre = 10;
optional bool hasDrm = 11;
optional bool isVariableBitrate = 12;
optional string title = 13;
optional int32 track = 14;
optional int32 trackCount = 15;
optional int32 year = 16;
}
message Image {
optional int32 width = 1;
optional int32 height = 2;
}
message GeoCoordinates {
optional double altitude = 1;
optional double latitude = 2;
optional double longitude = 3;
}
message Photo {
optional string cameraMake = 1;
optional string cameraModel = 2;
optional float exposureDenominator = 3;
optional float exposureNumerator = 4;
optional float fNumber = 5;
optional float focalLength = 6;
optional int32 iso = 7;
optional int32 orientation = 8;
optional google.protobuf.Timestamp takenDateTime = 9;
}
message Entity {
Reference ref = 1;
ResourceID id = 2;
string name = 3;
string etag = 4;
uint64 size = 5;
google.protobuf.Timestamp last_modified_time = 6;
string mime_type = 7;
string permissions = 8;
uint64 type = 9;
bool deleted = 10;
string shareRootName = 11;
ResourceID parent_id = 12;
repeated string tags = 13;
string highlights = 14;
Audio audio = 15;
GeoCoordinates location = 16;
ResourceID remote_item_id = 17;
Image image = 18;
Photo photo = 19;
repeated string favorites = 20;
}
message Match {
// the matched entity
Entity entity = 1;
// the match score
float score = 2;
}
@@ -0,0 +1,221 @@
syntax = "proto3";
package qsfera.messages.settings.v0;
option go_package = "github.com/qsfera/server/protogen/gen/qsfera/messages/settings/v0";
// ---
// messages for settings values
// ---
message ValueWithIdentifier {
Identifier identifier = 1;
Value value = 2;
}
message Identifier {
string extension = 1;
string bundle = 2;
string setting = 3;
}
// ---
// messages for role assignment
// ---
message UserRoleAssignment {
// id is generated upon saving the assignment
string id = 1;
string account_uuid = 2;
// the role_id is a bundle_id internally
string role_id = 3;
}
message UserRoleAssignmentFilter {
enum Type {
TYPE_UNKNOWN = 0;
TYPE_ACCOUNT = 1;
TYPE_ROLE = 2;
}
Type type = 1;
oneof term {
string account_uuid = 2;
string role_id = 3;
}
}
// ---
// resource payloads
// ---
message Resource {
enum Type {
TYPE_UNKNOWN = 0;
TYPE_SYSTEM = 1;
TYPE_FILE = 2;
TYPE_SHARE = 3;
TYPE_SETTING = 4;
TYPE_BUNDLE = 5;
TYPE_USER = 6;
TYPE_GROUP = 7;
}
Type type = 1;
string id = 2;
}
// ---
// payloads for bundles
// ---
message Bundle {
enum Type {
TYPE_UNKNOWN = 0;
TYPE_DEFAULT = 1;
TYPE_ROLE = 2;
};
string id = 1; // @gotags: yaml:"id"
string name = 2; // @gotags: yaml:"name"
Type type = 3; // @gotags: yaml:"type"
string extension = 4; // @gotags: yaml:"extension"
string display_name = 5; // @gotags: yaml:"display_name"
repeated Setting settings = 6; // @gotags: yaml:"settings"
Resource resource = 7; // @gotags: yaml:"resource"
}
message Setting {
string id = 1; // @gotags: yaml:"id"
string name = 2; // @gotags: yaml:"name"
string display_name = 3; // @gotags: yaml:"display_name"
string description = 4; // @gotags: yaml:"description"
oneof value {
Int int_value = 5; // @gotags: yaml:"int_value"
String string_value = 6; // @gotags: yaml:"string_value"
Bool bool_value = 7; // @gotags: yaml:"bool_value"
SingleChoiceList single_choice_value = 8; // @gotags: yaml:"single_choice_value"
MultiChoiceList multi_choice_value = 9; // @gotags: yaml:"multi_choice_value"
Permission permission_value = 10; // @gotags: yaml:"permission_value"
MultiChoiceCollection multi_choice_collection_value = 12; // @gotags: yaml:"multi_choice_collection_value"
}
Resource resource = 11; // @gotags: yaml:"resource"
}
message Int {
int64 default = 1; // @gotags: yaml:"default"
int64 min = 2; // @gotags: yaml:"min"
int64 max = 3; // @gotags: yaml:"max"
int64 step = 4; // @gotags: yaml:"step"
string placeholder = 5; // @gotags: yaml:"placeholder"
}
message String {
string default = 1; // @gotags: yaml:"default"
bool required = 2; // @gotags: yaml:"required"
int32 min_length = 3; // @gotags: yaml:"min_length"
int32 max_length = 4; // @gotags: yaml:"max_length"
string placeholder = 5; // @gotags: yaml:"placeholder"
}
message Bool {
bool default = 1; // @gotags: yaml:"default"
string label = 2; // @gotags: yaml:"label"
}
message SingleChoiceList {
repeated ListOption options = 1; // @gotags: yaml:"options"
}
message MultiChoiceList {
repeated ListOption options = 1; // @gotags: yaml:"options"
}
message ListOption {
ListOptionValue value = 1; // @gotags: yaml:"value"
bool default = 2; // @gotags: yaml:"default"
string display_value = 3; // @gotags: yaml:"display_value"
}
message MultiChoiceCollection {
repeated MultiChoiceCollectionOption options = 1; // @gotags: yaml:"options"
}
message MultiChoiceCollectionOption {
MultiChoiceCollectionOptionValue value = 1; // @gotags: yaml:"value"
string key = 2; // @gotags: yaml:"key"
string attribute = 3; // @gotags: yaml:"attribute"
string display_value = 4; // @gotags: yaml:"display_value"
}
message MultiChoiceCollectionOptionValue {
oneof option {
Int int_value = 1; // @gotags: yaml:"int_value"
String string_value = 2; // @gotags: yaml:"string_value"
Bool bool_value = 3; // @gotags: yaml:"bool_value"
}
}
message Permission {
enum Operation {
OPERATION_UNKNOWN = 0;
OPERATION_CREATE = 1;
OPERATION_READ = 2;
OPERATION_UPDATE = 3;
OPERATION_DELETE = 4;
OPERATION_WRITE = 5;// WRITE is a combination of CREATE and UPDATE
OPERATION_READWRITE = 6;// READWRITE is a combination of READ and WRITE
}
Operation operation = 1; // @gotags: yaml:"operation"
enum Constraint {
CONSTRAINT_UNKNOWN = 0;
CONSTRAINT_OWN = 1;
CONSTRAINT_SHARED = 2;
CONSTRAINT_ALL = 3;
}
Constraint constraint = 2; // @gotags: yaml:"constraint"
}
// ---
// payloads for values
// ---
message Value {
// id is the id of the Value. It is generated on saving it.
string id = 1; // @gotags: yaml:"id"
string bundle_id = 2; // @gotags: yaml:"bundle_id"
// setting_id is the id of the setting from within its bundle.
string setting_id = 3; // @gotags: yaml:"setting_id"
string account_uuid = 4; // @gotags: yaml:"account_uuid"
Resource resource = 5; // @gotags: yaml:"resource"
oneof value {
bool bool_value = 6; // @gotags: yaml:"bool_value"
int64 int_value = 7; // @gotags: yaml:"int_value"
string string_value = 8; // @gotags: yaml:"string_value"
ListValue list_value = 9; // @gotags: yaml:"list_value"
CollectionValue collection_value = 10; // @gotags: yaml:"collection_value"
}
}
message ListValue {
repeated ListOptionValue values = 1; // @gotags: yaml:"values"
}
message ListOptionValue {
oneof option {
string string_value = 1; // @gotags: yaml:"string_value"
int64 int_value = 2; // @gotags: yaml:"int_value"
bool bool_value = 3; // @gotags: yaml:"bool_value"
}
}
message CollectionValue {
repeated CollectionOption values = 1; // @gotags: yaml:"values"
}
message CollectionOption {
// required
string key = 1; // @gotags: yaml:"key"
oneof option {
int64 int_value = 2; // @gotags: yaml:"int_value"
string string_value = 3; // @gotags: yaml:"string_value"
bool bool_value = 4; // @gotags: yaml:"bool_value"
}
}
@@ -0,0 +1,30 @@
syntax = "proto3";
package qsfera.messages.thumbnails.v0;
option go_package = "github.com/qsfera/server/protogen/gen/qsfera/messages/thumbnails/v0";
message WebdavSource {
// REQUIRED.
string url = 1;
// REQUIRED.
bool is_public_link = 2;
// OPTIONAL.
string webdav_authorization = 3;
// OPTIONAL.
string reva_authorization = 4;
// OPTIONAL.
string public_link_token = 5;
}
message CS3Source {
string path = 1;
string authorization = 2;
}
// The file types to which the thumbnail can be encoded to.
enum ThumbnailType {
PNG = 0; // Represents PNG type
JPG = 1; // Represents JPG type
GIF = 2; // Represents GIF type
}
@@ -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;
}