diff --git a/proto/api/v2/resource_service.proto b/proto/api/v2/resource_service.proto index 4a12d8bb2..967692488 100644 --- a/proto/api/v2/resource_service.proto +++ b/proto/api/v2/resource_service.proto @@ -4,6 +4,7 @@ package memos.api.v2; import "google/api/annotations.proto"; import "google/api/client.proto"; +import "google/api/field_behavior.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; @@ -51,29 +52,25 @@ message Resource { // The user defined id of the resource. string uid = 2; - google.protobuf.Timestamp create_time = 3; + google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; string filename = 4; - string external_link = 5; + bytes content = 5 [(google.api.field_behavior) = INPUT_ONLY]; - string type = 6; + string external_link = 6; - int64 size = 7; + string type = 7; + int64 size = 8; + + // The related memo. // Format: memos/{id} - optional string memo = 8; + optional string memo = 9; } message CreateResourceRequest { - string filename = 1; - - string external_link = 2; - - string type = 3; - - // Format: memos/{id} - optional string memo = 4; + Resource resource = 1; } message CreateResourceResponse { @@ -95,6 +92,9 @@ message SearchResourcesResponse { } message GetResourceRequest { + // The name of the resource. + // Format: resources/{id} + // id is the system generated unique identifier. string name = 1; } @@ -113,6 +113,9 @@ message UpdateResourceResponse { } message DeleteResourceRequest { + // The name of the resource. + // Format: resources/{id} + // id is the system generated unique identifier. string name = 1; } diff --git a/proto/gen/api/v2/README.md b/proto/gen/api/v2/README.md index 2dd08e01c..9abe50247 100644 --- a/proto/gen/api/v2/README.md +++ b/proto/gen/api/v2/README.md @@ -1609,10 +1609,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| filename | [string](#string) | | | -| external_link | [string](#string) | | | -| type | [string](#string) | | | -| memo | [string](#string) | optional | Format: memos/{id} | +| resource | [Resource](#memos-api-v2-Resource) | | | @@ -1642,7 +1639,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| name | [string](#string) | | | +| name | [string](#string) | | The name of the resource. Format: resources/{id} id is the system generated unique identifier. | @@ -1667,7 +1664,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| name | [string](#string) | | | +| name | [string](#string) | | The name of the resource. Format: resources/{id} id is the system generated unique identifier. | @@ -1726,10 +1723,11 @@ Used internally for obfuscating the page token. | uid | [string](#string) | | The user defined id of the resource. | | create_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | | filename | [string](#string) | | | +| content | [bytes](#bytes) | | | | external_link | [string](#string) | | | | type | [string](#string) | | | | size | [int64](#int64) | | | -| memo | [string](#string) | optional | Format: memos/{id} | +| memo | [string](#string) | optional | The related memo. Format: memos/{id} | diff --git a/proto/gen/api/v2/resource_service.pb.go b/proto/gen/api/v2/resource_service.pb.go index c58a03b35..990d51f46 100644 --- a/proto/gen/api/v2/resource_service.pb.go +++ b/proto/gen/api/v2/resource_service.pb.go @@ -36,11 +36,13 @@ type Resource struct { Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"` CreateTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` Filename string `protobuf:"bytes,4,opt,name=filename,proto3" json:"filename,omitempty"` - ExternalLink string `protobuf:"bytes,5,opt,name=external_link,json=externalLink,proto3" json:"external_link,omitempty"` - Type string `protobuf:"bytes,6,opt,name=type,proto3" json:"type,omitempty"` - Size int64 `protobuf:"varint,7,opt,name=size,proto3" json:"size,omitempty"` + Content []byte `protobuf:"bytes,5,opt,name=content,proto3" json:"content,omitempty"` + ExternalLink string `protobuf:"bytes,6,opt,name=external_link,json=externalLink,proto3" json:"external_link,omitempty"` + Type string `protobuf:"bytes,7,opt,name=type,proto3" json:"type,omitempty"` + Size int64 `protobuf:"varint,8,opt,name=size,proto3" json:"size,omitempty"` + // The related memo. // Format: memos/{id} - Memo *string `protobuf:"bytes,8,opt,name=memo,proto3,oneof" json:"memo,omitempty"` + Memo *string `protobuf:"bytes,9,opt,name=memo,proto3,oneof" json:"memo,omitempty"` } func (x *Resource) Reset() { @@ -103,6 +105,13 @@ func (x *Resource) GetFilename() string { return "" } +func (x *Resource) GetContent() []byte { + if x != nil { + return x.Content + } + return nil +} + func (x *Resource) GetExternalLink() string { if x != nil { return x.ExternalLink @@ -136,11 +145,7 @@ type CreateResourceRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Filename string `protobuf:"bytes,1,opt,name=filename,proto3" json:"filename,omitempty"` - ExternalLink string `protobuf:"bytes,2,opt,name=external_link,json=externalLink,proto3" json:"external_link,omitempty"` - Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` - // Format: memos/{id} - Memo *string `protobuf:"bytes,4,opt,name=memo,proto3,oneof" json:"memo,omitempty"` + Resource *Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` } func (x *CreateResourceRequest) Reset() { @@ -175,32 +180,11 @@ func (*CreateResourceRequest) Descriptor() ([]byte, []int) { return file_api_v2_resource_service_proto_rawDescGZIP(), []int{1} } -func (x *CreateResourceRequest) GetFilename() string { - if x != nil { - return x.Filename - } - return "" -} - -func (x *CreateResourceRequest) GetExternalLink() string { - if x != nil { - return x.ExternalLink - } - return "" -} - -func (x *CreateResourceRequest) GetType() string { +func (x *CreateResourceRequest) GetResource() *Resource { if x != nil { - return x.Type - } - return "" -} - -func (x *CreateResourceRequest) GetMemo() string { - if x != nil && x.Memo != nil { - return *x.Memo + return x.Resource } - return "" + return nil } type CreateResourceResponse struct { @@ -434,6 +418,9 @@ type GetResourceRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // The name of the resource. + // Format: resources/{id} + // id is the system generated unique identifier. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } @@ -630,6 +617,9 @@ type DeleteResourceRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // The name of the resource. + // Format: resources/{id} + // id is the system generated unique identifier. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } @@ -719,143 +709,143 @@ var file_api_v2_resource_service_proto_rawDesc = []byte{ 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf8, 0x01, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x3b, 0x0a, 0x0b, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, - 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x78, 0x74, 0x65, - 0x72, 0x6e, 0x61, 0x6c, 0x4c, 0x69, 0x6e, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, - 0x73, 0x69, 0x7a, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, - 0x12, 0x17, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, - 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x88, 0x01, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x6d, 0x65, - 0x6d, 0x6f, 0x22, 0x8e, 0x01, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, - 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x78, 0x74, 0x65, - 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, + 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9c, 0x02, 0x0a, 0x08, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x40, 0x0a, 0x0b, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, + 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, + 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x07, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x03, 0xe0, 0x41, 0x04, 0x52, + 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x78, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x4c, 0x69, 0x6e, 0x6b, 0x12, 0x12, 0x0a, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x12, 0x17, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, - 0x00, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x88, 0x01, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x6d, - 0x65, 0x6d, 0x6f, 0x22, 0x4c, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x17, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x88, 0x01, 0x01, 0x42, 0x07, + 0x0a, 0x05, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x22, 0x4b, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x32, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x22, 0x4c, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, + 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, + 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x22, 0x16, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x4d, 0x0a, 0x15, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x09, + 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x30, 0x0a, 0x16, 0x53, 0x65, 0x61, + 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x4f, 0x0a, 0x17, 0x53, + 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, + 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x28, 0x0a, 0x12, + 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x49, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x22, 0x16, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x4d, 0x0a, 0x15, 0x4c, 0x69, 0x73, - 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x34, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x09, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x30, 0x0a, 0x16, 0x53, 0x65, 0x61, 0x72, - 0x63, 0x68, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x4f, 0x0a, 0x17, 0x53, 0x65, - 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x65, 0x22, 0x88, 0x01, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x32, 0x0a, 0x08, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, + 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, + 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, + 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x4c, 0x0a, 0x16, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x28, 0x0a, 0x12, 0x47, - 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x49, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x08, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, - 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x22, 0x88, 0x01, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x32, 0x0a, 0x08, 0x72, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, - 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x3b, - 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, - 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x4c, 0x0a, 0x16, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, - 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x2b, 0x0a, 0x15, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x18, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x32, 0xb5, 0x06, 0x0a, 0x0f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x76, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x23, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x6d, 0x65, - 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x22, 0x11, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x76, 0x32, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x73, 0x0a, 0x0d, - 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x22, 0x2e, - 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x23, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x12, 0x11, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x73, 0x12, 0x80, 0x01, 0x0a, 0x0f, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x24, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x6d, 0x65, - 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, - 0x68, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x12, 0x18, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x3a, 0x73, 0x65, - 0x61, 0x72, 0x63, 0x68, 0x12, 0x7d, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x12, 0x20, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, - 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, - 0x2f, 0x2a, 0x7d, 0x12, 0xa9, 0x01, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x23, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x6d, 0x65, - 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x2b, 0x0a, 0x15, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x18, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x4c, 0xda, 0x41, 0x14, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2c, 0x75, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f, - 0x3a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x32, 0x23, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x6e, 0x61, - 0x6d, 0x65, 0x3d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x12, - 0x86, 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x12, 0x23, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0xda, - 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x2a, 0x1a, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x42, 0xac, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, - 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, 0x14, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, - 0x32, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x4d, 0x41, 0x58, 0xaa, 0x02, 0x0c, - 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0c, 0x4d, - 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x18, 0x4d, 0x65, - 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, - 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x32, 0xb5, 0x06, 0x0a, 0x0f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x76, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x23, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x6d, + 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x22, 0x11, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x73, 0x0a, + 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x22, + 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x12, + 0x11, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x73, 0x12, 0x80, 0x01, 0x0a, 0x0f, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x24, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x6d, + 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x61, 0x72, + 0x63, 0x68, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x12, 0x18, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x3a, 0x73, + 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x7d, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x12, 0x20, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0xda, 0x41, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, + 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xa9, 0x01, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x23, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x6d, + 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x4c, 0xda, 0x41, 0x14, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2c, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x2f, 0x3a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x32, 0x23, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x6e, + 0x61, 0x6d, 0x65, 0x3d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x7d, + 0x12, 0x86, 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x12, 0x23, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, + 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x2a, 0x1a, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x42, 0xac, 0x01, 0x0a, 0x10, 0x63, 0x6f, + 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, 0x14, + 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, + 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x76, 0x32, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x4d, 0x41, 0x58, 0xaa, 0x02, + 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0c, + 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x18, 0x4d, + 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x3a, + 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -890,30 +880,31 @@ var file_api_v2_resource_service_proto_goTypes = []interface{}{ } var file_api_v2_resource_service_proto_depIdxs = []int32{ 13, // 0: memos.api.v2.Resource.create_time:type_name -> google.protobuf.Timestamp - 0, // 1: memos.api.v2.CreateResourceResponse.resource:type_name -> memos.api.v2.Resource - 0, // 2: memos.api.v2.ListResourcesResponse.resources:type_name -> memos.api.v2.Resource - 0, // 3: memos.api.v2.SearchResourcesResponse.resources:type_name -> memos.api.v2.Resource - 0, // 4: memos.api.v2.GetResourceResponse.resource:type_name -> memos.api.v2.Resource - 0, // 5: memos.api.v2.UpdateResourceRequest.resource:type_name -> memos.api.v2.Resource - 14, // 6: memos.api.v2.UpdateResourceRequest.update_mask:type_name -> google.protobuf.FieldMask - 0, // 7: memos.api.v2.UpdateResourceResponse.resource:type_name -> memos.api.v2.Resource - 1, // 8: memos.api.v2.ResourceService.CreateResource:input_type -> memos.api.v2.CreateResourceRequest - 3, // 9: memos.api.v2.ResourceService.ListResources:input_type -> memos.api.v2.ListResourcesRequest - 5, // 10: memos.api.v2.ResourceService.SearchResources:input_type -> memos.api.v2.SearchResourcesRequest - 7, // 11: memos.api.v2.ResourceService.GetResource:input_type -> memos.api.v2.GetResourceRequest - 9, // 12: memos.api.v2.ResourceService.UpdateResource:input_type -> memos.api.v2.UpdateResourceRequest - 11, // 13: memos.api.v2.ResourceService.DeleteResource:input_type -> memos.api.v2.DeleteResourceRequest - 2, // 14: memos.api.v2.ResourceService.CreateResource:output_type -> memos.api.v2.CreateResourceResponse - 4, // 15: memos.api.v2.ResourceService.ListResources:output_type -> memos.api.v2.ListResourcesResponse - 6, // 16: memos.api.v2.ResourceService.SearchResources:output_type -> memos.api.v2.SearchResourcesResponse - 8, // 17: memos.api.v2.ResourceService.GetResource:output_type -> memos.api.v2.GetResourceResponse - 10, // 18: memos.api.v2.ResourceService.UpdateResource:output_type -> memos.api.v2.UpdateResourceResponse - 12, // 19: memos.api.v2.ResourceService.DeleteResource:output_type -> memos.api.v2.DeleteResourceResponse - 14, // [14:20] is the sub-list for method output_type - 8, // [8:14] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name + 0, // 1: memos.api.v2.CreateResourceRequest.resource:type_name -> memos.api.v2.Resource + 0, // 2: memos.api.v2.CreateResourceResponse.resource:type_name -> memos.api.v2.Resource + 0, // 3: memos.api.v2.ListResourcesResponse.resources:type_name -> memos.api.v2.Resource + 0, // 4: memos.api.v2.SearchResourcesResponse.resources:type_name -> memos.api.v2.Resource + 0, // 5: memos.api.v2.GetResourceResponse.resource:type_name -> memos.api.v2.Resource + 0, // 6: memos.api.v2.UpdateResourceRequest.resource:type_name -> memos.api.v2.Resource + 14, // 7: memos.api.v2.UpdateResourceRequest.update_mask:type_name -> google.protobuf.FieldMask + 0, // 8: memos.api.v2.UpdateResourceResponse.resource:type_name -> memos.api.v2.Resource + 1, // 9: memos.api.v2.ResourceService.CreateResource:input_type -> memos.api.v2.CreateResourceRequest + 3, // 10: memos.api.v2.ResourceService.ListResources:input_type -> memos.api.v2.ListResourcesRequest + 5, // 11: memos.api.v2.ResourceService.SearchResources:input_type -> memos.api.v2.SearchResourcesRequest + 7, // 12: memos.api.v2.ResourceService.GetResource:input_type -> memos.api.v2.GetResourceRequest + 9, // 13: memos.api.v2.ResourceService.UpdateResource:input_type -> memos.api.v2.UpdateResourceRequest + 11, // 14: memos.api.v2.ResourceService.DeleteResource:input_type -> memos.api.v2.DeleteResourceRequest + 2, // 15: memos.api.v2.ResourceService.CreateResource:output_type -> memos.api.v2.CreateResourceResponse + 4, // 16: memos.api.v2.ResourceService.ListResources:output_type -> memos.api.v2.ListResourcesResponse + 6, // 17: memos.api.v2.ResourceService.SearchResources:output_type -> memos.api.v2.SearchResourcesResponse + 8, // 18: memos.api.v2.ResourceService.GetResource:output_type -> memos.api.v2.GetResourceResponse + 10, // 19: memos.api.v2.ResourceService.UpdateResource:output_type -> memos.api.v2.UpdateResourceResponse + 12, // 20: memos.api.v2.ResourceService.DeleteResource:output_type -> memos.api.v2.DeleteResourceResponse + 15, // [15:21] is the sub-list for method output_type + 9, // [9:15] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name } func init() { file_api_v2_resource_service_proto_init() } @@ -1080,7 +1071,6 @@ func file_api_v2_resource_service_proto_init() { } } file_api_v2_resource_service_proto_msgTypes[0].OneofWrappers = []interface{}{} - file_api_v2_resource_service_proto_msgTypes[1].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/proto/gen/store/README.md b/proto/gen/store/README.md index ede361632..8e0342817 100644 --- a/proto/gen/store/README.md +++ b/proto/gen/store/README.md @@ -26,6 +26,13 @@ - [Reaction.Type](#memos-store-Reaction-Type) +- [store/storage.proto](#store_storage-proto) + - [S3Config](#memos-store-S3Config) + - [Storage](#memos-store-Storage) + - [StorageConfig](#memos-store-StorageConfig) + + - [Storage.Type](#memos-store-Storage-Type) + - [store/user_setting.proto](#store_user_setting-proto) - [AccessTokensUserSetting](#memos-store-AccessTokensUserSetting) - [AccessTokensUserSetting.AccessToken](#memos-store-AccessTokensUserSetting-AccessToken) @@ -37,6 +44,8 @@ - [Webhook](#memos-store-Webhook) - [store/workspace_setting.proto](#store_workspace_setting-proto) + - [WorkspaceBasicSetting](#memos-store-WorkspaceBasicSetting) + - [WorkspaceCustomProfile](#memos-store-WorkspaceCustomProfile) - [WorkspaceGeneralSetting](#memos-store-WorkspaceGeneralSetting) - [WorkspaceMemoRelatedSetting](#memos-store-WorkspaceMemoRelatedSetting) - [WorkspaceSetting](#memos-store-WorkspaceSetting) @@ -314,6 +323,90 @@ + +
+ +## store/storage.proto + + + + + +### S3Config + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| end_point | [string](#string) | | | +| path | [string](#string) | | | +| region | [string](#string) | | | +| access_key | [string](#string) | | | +| secret_key | [string](#string) | | | +| bucket | [string](#string) | | | +| url_prefix | [string](#string) | | | +| url_suffix | [string](#string) | | | +| pre_sign | [bool](#bool) | | | + + + + + + + + +### Storage + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int32](#int32) | | | +| name | [string](#string) | | | +| type | [Storage.Type](#memos-store-Storage-Type) | | | +| config | [StorageConfig](#memos-store-StorageConfig) | | | + + + + + + + + +### StorageConfig + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| s3_config | [S3Config](#memos-store-S3Config) | | | + + + + + + + + + + +### Storage.Type + + +| Name | Number | Description | +| ---- | ------ | ----------- | +| TYPE_UNSPECIFIED | 0 | | +| S3 | 1 | | + + + + + + + + + + @@ -442,6 +535,41 @@ + + +### WorkspaceBasicSetting + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| server_id | [string](#string) | | | +| secret_key | [string](#string) | | | + + + + + + + + +### WorkspaceCustomProfile + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| title | [string](#string) | | | +| description | [string](#string) | | | +| logo_url | [string](#string) | | | +| locale | [string](#string) | | | +| appearance | [string](#string) | | | + + + + + + ### WorkspaceGeneralSetting @@ -455,6 +583,7 @@ | disallow_password_login | [bool](#bool) | | disallow_password_login is the flag to disallow password login. | | additional_script | [string](#string) | | additional_script is the additional script. | | additional_style | [string](#string) | | additional_style is the additional style. | +| custom_profile | [WorkspaceCustomProfile](#memos-store-WorkspaceCustomProfile) | | custom_profile is the custom profile. | @@ -486,6 +615,7 @@ | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | key | [WorkspaceSettingKey](#memos-store-WorkspaceSettingKey) | | | +| basic_setting | [WorkspaceBasicSetting](#memos-store-WorkspaceBasicSetting) | | | | general_setting | [WorkspaceGeneralSetting](#memos-store-WorkspaceGeneralSetting) | | | | storage_setting | [WorkspaceStorageSetting](#memos-store-WorkspaceStorageSetting) | | | | memo_related_setting | [WorkspaceMemoRelatedSetting](#memos-store-WorkspaceMemoRelatedSetting) | | | @@ -505,6 +635,7 @@ | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | storage_type | [WorkspaceStorageSetting.StorageType](#memos-store-WorkspaceStorageSetting-StorageType) | | storage_type is the storage type. | +| actived_external_storage_id | [int32](#int32) | optional | The id of actived external storage. | | local_storage_path | [string](#string) | | The local storage path for STORAGE_TYPE_LOCAL. e.g. assets/{timestamp}_{filename} | | upload_size_limit_mb | [int64](#int64) | | The max upload size in megabytes. | @@ -538,10 +669,11 @@ | Name | Number | Description | | ---- | ------ | ----------- | | WORKSPACE_SETTING_KEY_UNSPECIFIED | 0 | | -| WORKSPACE_SETTING_GENERAL | 1 | WORKSPACE_SETTING_GENERAL is the key for general settings. | -| WORKSPACE_SETTING_STORAGE | 2 | WORKSPACE_SETTING_STORAGE is the key for storage settings. | -| WORKSPACE_SETTING_MEMO_RELATED | 3 | WORKSPACE_SETTING_MEMO_RELATED is the key for memo related settings. | -| WORKSPACE_SETTING_TELEGRAM_INTEGRATION | 4 | WORKSPACE_SETTING_TELEGRAM_INTEGRATION is the key for telegram integration settings. | +| WORKSPACE_SETTING_BASIC | 1 | WORKSPACE_SETTING_BASIC is the key for basic settings. | +| WORKSPACE_SETTING_GENERAL | 2 | WORKSPACE_SETTING_GENERAL is the key for general settings. | +| WORKSPACE_SETTING_STORAGE | 3 | WORKSPACE_SETTING_STORAGE is the key for storage settings. | +| WORKSPACE_SETTING_MEMO_RELATED | 4 | WORKSPACE_SETTING_MEMO_RELATED is the key for memo related settings. | +| WORKSPACE_SETTING_TELEGRAM_INTEGRATION | 5 | WORKSPACE_SETTING_TELEGRAM_INTEGRATION is the key for telegram integration settings. | diff --git a/proto/gen/store/storage.pb.go b/proto/gen/store/storage.pb.go new file mode 100644 index 000000000..3b6a118b2 --- /dev/null +++ b/proto/gen/store/storage.pb.go @@ -0,0 +1,465 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: store/storage.proto + +package store + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Storage_Type int32 + +const ( + Storage_TYPE_UNSPECIFIED Storage_Type = 0 + Storage_S3 Storage_Type = 1 +) + +// Enum value maps for Storage_Type. +var ( + Storage_Type_name = map[int32]string{ + 0: "TYPE_UNSPECIFIED", + 1: "S3", + } + Storage_Type_value = map[string]int32{ + "TYPE_UNSPECIFIED": 0, + "S3": 1, + } +) + +func (x Storage_Type) Enum() *Storage_Type { + p := new(Storage_Type) + *p = x + return p +} + +func (x Storage_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Storage_Type) Descriptor() protoreflect.EnumDescriptor { + return file_store_storage_proto_enumTypes[0].Descriptor() +} + +func (Storage_Type) Type() protoreflect.EnumType { + return &file_store_storage_proto_enumTypes[0] +} + +func (x Storage_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Storage_Type.Descriptor instead. +func (Storage_Type) EnumDescriptor() ([]byte, []int) { + return file_store_storage_proto_rawDescGZIP(), []int{0, 0} +} + +type Storage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Type Storage_Type `protobuf:"varint,3,opt,name=type,proto3,enum=memos.store.Storage_Type" json:"type,omitempty"` + Config *StorageConfig `protobuf:"bytes,4,opt,name=config,proto3" json:"config,omitempty"` +} + +func (x *Storage) Reset() { + *x = Storage{} + if protoimpl.UnsafeEnabled { + mi := &file_store_storage_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Storage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Storage) ProtoMessage() {} + +func (x *Storage) ProtoReflect() protoreflect.Message { + mi := &file_store_storage_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Storage.ProtoReflect.Descriptor instead. +func (*Storage) Descriptor() ([]byte, []int) { + return file_store_storage_proto_rawDescGZIP(), []int{0} +} + +func (x *Storage) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *Storage) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Storage) GetType() Storage_Type { + if x != nil { + return x.Type + } + return Storage_TYPE_UNSPECIFIED +} + +func (x *Storage) GetConfig() *StorageConfig { + if x != nil { + return x.Config + } + return nil +} + +type StorageConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to StorageConfig: + // + // *StorageConfig_S3Config + StorageConfig isStorageConfig_StorageConfig `protobuf_oneof:"storage_config"` +} + +func (x *StorageConfig) Reset() { + *x = StorageConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_store_storage_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StorageConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StorageConfig) ProtoMessage() {} + +func (x *StorageConfig) ProtoReflect() protoreflect.Message { + mi := &file_store_storage_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StorageConfig.ProtoReflect.Descriptor instead. +func (*StorageConfig) Descriptor() ([]byte, []int) { + return file_store_storage_proto_rawDescGZIP(), []int{1} +} + +func (m *StorageConfig) GetStorageConfig() isStorageConfig_StorageConfig { + if m != nil { + return m.StorageConfig + } + return nil +} + +func (x *StorageConfig) GetS3Config() *S3Config { + if x, ok := x.GetStorageConfig().(*StorageConfig_S3Config); ok { + return x.S3Config + } + return nil +} + +type isStorageConfig_StorageConfig interface { + isStorageConfig_StorageConfig() +} + +type StorageConfig_S3Config struct { + S3Config *S3Config `protobuf:"bytes,1,opt,name=s3_config,json=s3Config,proto3,oneof"` +} + +func (*StorageConfig_S3Config) isStorageConfig_StorageConfig() {} + +type S3Config struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + EndPoint string `protobuf:"bytes,1,opt,name=end_point,json=endPoint,proto3" json:"end_point,omitempty"` + Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` + Region string `protobuf:"bytes,3,opt,name=region,proto3" json:"region,omitempty"` + AccessKey string `protobuf:"bytes,4,opt,name=access_key,json=accessKey,proto3" json:"access_key,omitempty"` + SecretKey string `protobuf:"bytes,5,opt,name=secret_key,json=secretKey,proto3" json:"secret_key,omitempty"` + Bucket string `protobuf:"bytes,6,opt,name=bucket,proto3" json:"bucket,omitempty"` + UrlPrefix string `protobuf:"bytes,7,opt,name=url_prefix,json=urlPrefix,proto3" json:"url_prefix,omitempty"` + UrlSuffix string `protobuf:"bytes,8,opt,name=url_suffix,json=urlSuffix,proto3" json:"url_suffix,omitempty"` + PreSign bool `protobuf:"varint,9,opt,name=pre_sign,json=preSign,proto3" json:"pre_sign,omitempty"` +} + +func (x *S3Config) Reset() { + *x = S3Config{} + if protoimpl.UnsafeEnabled { + mi := &file_store_storage_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *S3Config) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*S3Config) ProtoMessage() {} + +func (x *S3Config) ProtoReflect() protoreflect.Message { + mi := &file_store_storage_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use S3Config.ProtoReflect.Descriptor instead. +func (*S3Config) Descriptor() ([]byte, []int) { + return file_store_storage_proto_rawDescGZIP(), []int{2} +} + +func (x *S3Config) GetEndPoint() string { + if x != nil { + return x.EndPoint + } + return "" +} + +func (x *S3Config) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *S3Config) GetRegion() string { + if x != nil { + return x.Region + } + return "" +} + +func (x *S3Config) GetAccessKey() string { + if x != nil { + return x.AccessKey + } + return "" +} + +func (x *S3Config) GetSecretKey() string { + if x != nil { + return x.SecretKey + } + return "" +} + +func (x *S3Config) GetBucket() string { + if x != nil { + return x.Bucket + } + return "" +} + +func (x *S3Config) GetUrlPrefix() string { + if x != nil { + return x.UrlPrefix + } + return "" +} + +func (x *S3Config) GetUrlSuffix() string { + if x != nil { + return x.UrlSuffix + } + return "" +} + +func (x *S3Config) GetPreSign() bool { + if x != nil { + return x.PreSign + } + return false +} + +var File_store_storage_proto protoreflect.FileDescriptor + +var file_store_storage_proto_rawDesc = []byte{ + 0x0a, 0x13, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x6f, + 0x72, 0x65, 0x22, 0xb6, 0x01, 0x0a, 0x07, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x2d, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x19, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x53, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x12, 0x32, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, + 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x06, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x24, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, + 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, + 0x44, 0x10, 0x00, 0x12, 0x06, 0x0a, 0x02, 0x53, 0x33, 0x10, 0x01, 0x22, 0x57, 0x0a, 0x0d, 0x53, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x34, 0x0a, 0x09, + 0x73, 0x33, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x15, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x33, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x00, 0x52, 0x08, 0x73, 0x33, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x42, 0x10, 0x0a, 0x0e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x22, 0x82, 0x02, 0x0a, 0x08, 0x53, 0x33, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x6e, 0x64, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x12, + 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, + 0x74, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x63, + 0x72, 0x65, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, + 0x65, 0x63, 0x72, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, + 0x65, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, + 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x72, 0x6c, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x72, 0x6c, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, + 0x1d, 0x0a, 0x0a, 0x75, 0x72, 0x6c, 0x5f, 0x73, 0x75, 0x66, 0x66, 0x69, 0x78, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x72, 0x6c, 0x53, 0x75, 0x66, 0x66, 0x69, 0x78, 0x12, 0x19, + 0x0a, 0x08, 0x70, 0x72, 0x65, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x07, 0x70, 0x72, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x42, 0x97, 0x01, 0x0a, 0x0f, 0x63, 0x6f, + 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x0c, 0x53, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x29, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d, + 0x6f, 0x73, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, + 0x65, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0xa2, 0x02, 0x03, 0x4d, 0x53, 0x58, 0xaa, 0x02, + 0x0b, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0xca, 0x02, 0x0b, 0x4d, + 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x74, 0x6f, 0x72, 0x65, 0xe2, 0x02, 0x17, 0x4d, 0x65, 0x6d, + 0x6f, 0x73, 0x5c, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x53, 0x74, + 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_store_storage_proto_rawDescOnce sync.Once + file_store_storage_proto_rawDescData = file_store_storage_proto_rawDesc +) + +func file_store_storage_proto_rawDescGZIP() []byte { + file_store_storage_proto_rawDescOnce.Do(func() { + file_store_storage_proto_rawDescData = protoimpl.X.CompressGZIP(file_store_storage_proto_rawDescData) + }) + return file_store_storage_proto_rawDescData +} + +var file_store_storage_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_store_storage_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_store_storage_proto_goTypes = []interface{}{ + (Storage_Type)(0), // 0: memos.store.Storage.Type + (*Storage)(nil), // 1: memos.store.Storage + (*StorageConfig)(nil), // 2: memos.store.StorageConfig + (*S3Config)(nil), // 3: memos.store.S3Config +} +var file_store_storage_proto_depIdxs = []int32{ + 0, // 0: memos.store.Storage.type:type_name -> memos.store.Storage.Type + 2, // 1: memos.store.Storage.config:type_name -> memos.store.StorageConfig + 3, // 2: memos.store.StorageConfig.s3_config:type_name -> memos.store.S3Config + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_store_storage_proto_init() } +func file_store_storage_proto_init() { + if File_store_storage_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_store_storage_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Storage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_store_storage_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StorageConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_store_storage_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*S3Config); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_store_storage_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*StorageConfig_S3Config)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_store_storage_proto_rawDesc, + NumEnums: 1, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_store_storage_proto_goTypes, + DependencyIndexes: file_store_storage_proto_depIdxs, + EnumInfos: file_store_storage_proto_enumTypes, + MessageInfos: file_store_storage_proto_msgTypes, + }.Build() + File_store_storage_proto = out.File + file_store_storage_proto_rawDesc = nil + file_store_storage_proto_goTypes = nil + file_store_storage_proto_depIdxs = nil +} diff --git a/proto/gen/store/workspace_setting.pb.go b/proto/gen/store/workspace_setting.pb.go index a2e2be5d1..f45e4e9ac 100644 --- a/proto/gen/store/workspace_setting.pb.go +++ b/proto/gen/store/workspace_setting.pb.go @@ -24,31 +24,35 @@ type WorkspaceSettingKey int32 const ( WorkspaceSettingKey_WORKSPACE_SETTING_KEY_UNSPECIFIED WorkspaceSettingKey = 0 + // WORKSPACE_SETTING_BASIC is the key for basic settings. + WorkspaceSettingKey_WORKSPACE_SETTING_BASIC WorkspaceSettingKey = 1 // WORKSPACE_SETTING_GENERAL is the key for general settings. - WorkspaceSettingKey_WORKSPACE_SETTING_GENERAL WorkspaceSettingKey = 1 + WorkspaceSettingKey_WORKSPACE_SETTING_GENERAL WorkspaceSettingKey = 2 // WORKSPACE_SETTING_STORAGE is the key for storage settings. - WorkspaceSettingKey_WORKSPACE_SETTING_STORAGE WorkspaceSettingKey = 2 + WorkspaceSettingKey_WORKSPACE_SETTING_STORAGE WorkspaceSettingKey = 3 // WORKSPACE_SETTING_MEMO_RELATED is the key for memo related settings. - WorkspaceSettingKey_WORKSPACE_SETTING_MEMO_RELATED WorkspaceSettingKey = 3 + WorkspaceSettingKey_WORKSPACE_SETTING_MEMO_RELATED WorkspaceSettingKey = 4 // WORKSPACE_SETTING_TELEGRAM_INTEGRATION is the key for telegram integration settings. - WorkspaceSettingKey_WORKSPACE_SETTING_TELEGRAM_INTEGRATION WorkspaceSettingKey = 4 + WorkspaceSettingKey_WORKSPACE_SETTING_TELEGRAM_INTEGRATION WorkspaceSettingKey = 5 ) // Enum value maps for WorkspaceSettingKey. var ( WorkspaceSettingKey_name = map[int32]string{ 0: "WORKSPACE_SETTING_KEY_UNSPECIFIED", - 1: "WORKSPACE_SETTING_GENERAL", - 2: "WORKSPACE_SETTING_STORAGE", - 3: "WORKSPACE_SETTING_MEMO_RELATED", - 4: "WORKSPACE_SETTING_TELEGRAM_INTEGRATION", + 1: "WORKSPACE_SETTING_BASIC", + 2: "WORKSPACE_SETTING_GENERAL", + 3: "WORKSPACE_SETTING_STORAGE", + 4: "WORKSPACE_SETTING_MEMO_RELATED", + 5: "WORKSPACE_SETTING_TELEGRAM_INTEGRATION", } WorkspaceSettingKey_value = map[string]int32{ "WORKSPACE_SETTING_KEY_UNSPECIFIED": 0, - "WORKSPACE_SETTING_GENERAL": 1, - "WORKSPACE_SETTING_STORAGE": 2, - "WORKSPACE_SETTING_MEMO_RELATED": 3, - "WORKSPACE_SETTING_TELEGRAM_INTEGRATION": 4, + "WORKSPACE_SETTING_BASIC": 1, + "WORKSPACE_SETTING_GENERAL": 2, + "WORKSPACE_SETTING_STORAGE": 3, + "WORKSPACE_SETTING_MEMO_RELATED": 4, + "WORKSPACE_SETTING_TELEGRAM_INTEGRATION": 5, } ) @@ -131,7 +135,7 @@ func (x WorkspaceStorageSetting_StorageType) Number() protoreflect.EnumNumber { // Deprecated: Use WorkspaceStorageSetting_StorageType.Descriptor instead. func (WorkspaceStorageSetting_StorageType) EnumDescriptor() ([]byte, []int) { - return file_store_workspace_setting_proto_rawDescGZIP(), []int{2, 0} + return file_store_workspace_setting_proto_rawDescGZIP(), []int{4, 0} } type WorkspaceSetting struct { @@ -142,6 +146,7 @@ type WorkspaceSetting struct { Key WorkspaceSettingKey `protobuf:"varint,1,opt,name=key,proto3,enum=memos.store.WorkspaceSettingKey" json:"key,omitempty"` // Types that are assignable to Value: // + // *WorkspaceSetting_BasicSetting // *WorkspaceSetting_GeneralSetting // *WorkspaceSetting_StorageSetting // *WorkspaceSetting_MemoRelatedSetting @@ -195,6 +200,13 @@ func (m *WorkspaceSetting) GetValue() isWorkspaceSetting_Value { return nil } +func (x *WorkspaceSetting) GetBasicSetting() *WorkspaceBasicSetting { + if x, ok := x.GetValue().(*WorkspaceSetting_BasicSetting); ok { + return x.BasicSetting + } + return nil +} + func (x *WorkspaceSetting) GetGeneralSetting() *WorkspaceGeneralSetting { if x, ok := x.GetValue().(*WorkspaceSetting_GeneralSetting); ok { return x.GeneralSetting @@ -227,22 +239,28 @@ type isWorkspaceSetting_Value interface { isWorkspaceSetting_Value() } +type WorkspaceSetting_BasicSetting struct { + BasicSetting *WorkspaceBasicSetting `protobuf:"bytes,2,opt,name=basic_setting,json=basicSetting,proto3,oneof"` +} + type WorkspaceSetting_GeneralSetting struct { - GeneralSetting *WorkspaceGeneralSetting `protobuf:"bytes,2,opt,name=general_setting,json=generalSetting,proto3,oneof"` + GeneralSetting *WorkspaceGeneralSetting `protobuf:"bytes,3,opt,name=general_setting,json=generalSetting,proto3,oneof"` } type WorkspaceSetting_StorageSetting struct { - StorageSetting *WorkspaceStorageSetting `protobuf:"bytes,3,opt,name=storage_setting,json=storageSetting,proto3,oneof"` + StorageSetting *WorkspaceStorageSetting `protobuf:"bytes,4,opt,name=storage_setting,json=storageSetting,proto3,oneof"` } type WorkspaceSetting_MemoRelatedSetting struct { - MemoRelatedSetting *WorkspaceMemoRelatedSetting `protobuf:"bytes,4,opt,name=memo_related_setting,json=memoRelatedSetting,proto3,oneof"` + MemoRelatedSetting *WorkspaceMemoRelatedSetting `protobuf:"bytes,5,opt,name=memo_related_setting,json=memoRelatedSetting,proto3,oneof"` } type WorkspaceSetting_TelegramIntegrationSetting struct { - TelegramIntegrationSetting *WorkspaceTelegramIntegrationSetting `protobuf:"bytes,5,opt,name=telegram_integration_setting,json=telegramIntegrationSetting,proto3,oneof"` + TelegramIntegrationSetting *WorkspaceTelegramIntegrationSetting `protobuf:"bytes,6,opt,name=telegram_integration_setting,json=telegramIntegrationSetting,proto3,oneof"` } +func (*WorkspaceSetting_BasicSetting) isWorkspaceSetting_Value() {} + func (*WorkspaceSetting_GeneralSetting) isWorkspaceSetting_Value() {} func (*WorkspaceSetting_StorageSetting) isWorkspaceSetting_Value() {} @@ -251,6 +269,61 @@ func (*WorkspaceSetting_MemoRelatedSetting) isWorkspaceSetting_Value() {} func (*WorkspaceSetting_TelegramIntegrationSetting) isWorkspaceSetting_Value() {} +type WorkspaceBasicSetting struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ServerId string `protobuf:"bytes,1,opt,name=server_id,json=serverId,proto3" json:"server_id,omitempty"` + SecretKey string `protobuf:"bytes,2,opt,name=secret_key,json=secretKey,proto3" json:"secret_key,omitempty"` +} + +func (x *WorkspaceBasicSetting) Reset() { + *x = WorkspaceBasicSetting{} + if protoimpl.UnsafeEnabled { + mi := &file_store_workspace_setting_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WorkspaceBasicSetting) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WorkspaceBasicSetting) ProtoMessage() {} + +func (x *WorkspaceBasicSetting) ProtoReflect() protoreflect.Message { + mi := &file_store_workspace_setting_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WorkspaceBasicSetting.ProtoReflect.Descriptor instead. +func (*WorkspaceBasicSetting) Descriptor() ([]byte, []int) { + return file_store_workspace_setting_proto_rawDescGZIP(), []int{1} +} + +func (x *WorkspaceBasicSetting) GetServerId() string { + if x != nil { + return x.ServerId + } + return "" +} + +func (x *WorkspaceBasicSetting) GetSecretKey() string { + if x != nil { + return x.SecretKey + } + return "" +} + type WorkspaceGeneralSetting struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -266,12 +339,14 @@ type WorkspaceGeneralSetting struct { AdditionalScript string `protobuf:"bytes,5,opt,name=additional_script,json=additionalScript,proto3" json:"additional_script,omitempty"` // additional_style is the additional style. AdditionalStyle string `protobuf:"bytes,6,opt,name=additional_style,json=additionalStyle,proto3" json:"additional_style,omitempty"` + // custom_profile is the custom profile. + CustomProfile *WorkspaceCustomProfile `protobuf:"bytes,4,opt,name=custom_profile,json=customProfile,proto3" json:"custom_profile,omitempty"` } func (x *WorkspaceGeneralSetting) Reset() { *x = WorkspaceGeneralSetting{} if protoimpl.UnsafeEnabled { - mi := &file_store_workspace_setting_proto_msgTypes[1] + mi := &file_store_workspace_setting_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -284,7 +359,7 @@ func (x *WorkspaceGeneralSetting) String() string { func (*WorkspaceGeneralSetting) ProtoMessage() {} func (x *WorkspaceGeneralSetting) ProtoReflect() protoreflect.Message { - mi := &file_store_workspace_setting_proto_msgTypes[1] + mi := &file_store_workspace_setting_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -297,7 +372,7 @@ func (x *WorkspaceGeneralSetting) ProtoReflect() protoreflect.Message { // Deprecated: Use WorkspaceGeneralSetting.ProtoReflect.Descriptor instead. func (*WorkspaceGeneralSetting) Descriptor() ([]byte, []int) { - return file_store_workspace_setting_proto_rawDescGZIP(), []int{1} + return file_store_workspace_setting_proto_rawDescGZIP(), []int{2} } func (x *WorkspaceGeneralSetting) GetInstanceUrl() string { @@ -335,6 +410,92 @@ func (x *WorkspaceGeneralSetting) GetAdditionalStyle() string { return "" } +func (x *WorkspaceGeneralSetting) GetCustomProfile() *WorkspaceCustomProfile { + if x != nil { + return x.CustomProfile + } + return nil +} + +type WorkspaceCustomProfile struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + LogoUrl string `protobuf:"bytes,3,opt,name=logo_url,json=logoUrl,proto3" json:"logo_url,omitempty"` + Locale string `protobuf:"bytes,4,opt,name=locale,proto3" json:"locale,omitempty"` + Appearance string `protobuf:"bytes,5,opt,name=appearance,proto3" json:"appearance,omitempty"` +} + +func (x *WorkspaceCustomProfile) Reset() { + *x = WorkspaceCustomProfile{} + if protoimpl.UnsafeEnabled { + mi := &file_store_workspace_setting_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WorkspaceCustomProfile) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WorkspaceCustomProfile) ProtoMessage() {} + +func (x *WorkspaceCustomProfile) ProtoReflect() protoreflect.Message { + mi := &file_store_workspace_setting_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WorkspaceCustomProfile.ProtoReflect.Descriptor instead. +func (*WorkspaceCustomProfile) Descriptor() ([]byte, []int) { + return file_store_workspace_setting_proto_rawDescGZIP(), []int{3} +} + +func (x *WorkspaceCustomProfile) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *WorkspaceCustomProfile) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *WorkspaceCustomProfile) GetLogoUrl() string { + if x != nil { + return x.LogoUrl + } + return "" +} + +func (x *WorkspaceCustomProfile) GetLocale() string { + if x != nil { + return x.Locale + } + return "" +} + +func (x *WorkspaceCustomProfile) GetAppearance() string { + if x != nil { + return x.Appearance + } + return "" +} + type WorkspaceStorageSetting struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -342,17 +503,19 @@ type WorkspaceStorageSetting struct { // storage_type is the storage type. StorageType WorkspaceStorageSetting_StorageType `protobuf:"varint,1,opt,name=storage_type,json=storageType,proto3,enum=memos.store.WorkspaceStorageSetting_StorageType" json:"storage_type,omitempty"` + // The id of actived external storage. + ActivedExternalStorageId *int32 `protobuf:"varint,2,opt,name=actived_external_storage_id,json=activedExternalStorageId,proto3,oneof" json:"actived_external_storage_id,omitempty"` // The local storage path for STORAGE_TYPE_LOCAL. // e.g. assets/{timestamp}_{filename} - LocalStoragePath string `protobuf:"bytes,2,opt,name=local_storage_path,json=localStoragePath,proto3" json:"local_storage_path,omitempty"` + LocalStoragePath string `protobuf:"bytes,3,opt,name=local_storage_path,json=localStoragePath,proto3" json:"local_storage_path,omitempty"` // The max upload size in megabytes. - UploadSizeLimitMb int64 `protobuf:"varint,3,opt,name=upload_size_limit_mb,json=uploadSizeLimitMb,proto3" json:"upload_size_limit_mb,omitempty"` + UploadSizeLimitMb int64 `protobuf:"varint,4,opt,name=upload_size_limit_mb,json=uploadSizeLimitMb,proto3" json:"upload_size_limit_mb,omitempty"` } func (x *WorkspaceStorageSetting) Reset() { *x = WorkspaceStorageSetting{} if protoimpl.UnsafeEnabled { - mi := &file_store_workspace_setting_proto_msgTypes[2] + mi := &file_store_workspace_setting_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -365,7 +528,7 @@ func (x *WorkspaceStorageSetting) String() string { func (*WorkspaceStorageSetting) ProtoMessage() {} func (x *WorkspaceStorageSetting) ProtoReflect() protoreflect.Message { - mi := &file_store_workspace_setting_proto_msgTypes[2] + mi := &file_store_workspace_setting_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -378,7 +541,7 @@ func (x *WorkspaceStorageSetting) ProtoReflect() protoreflect.Message { // Deprecated: Use WorkspaceStorageSetting.ProtoReflect.Descriptor instead. func (*WorkspaceStorageSetting) Descriptor() ([]byte, []int) { - return file_store_workspace_setting_proto_rawDescGZIP(), []int{2} + return file_store_workspace_setting_proto_rawDescGZIP(), []int{4} } func (x *WorkspaceStorageSetting) GetStorageType() WorkspaceStorageSetting_StorageType { @@ -388,6 +551,13 @@ func (x *WorkspaceStorageSetting) GetStorageType() WorkspaceStorageSetting_Stora return WorkspaceStorageSetting_STORAGE_TYPE_UNSPECIFIED } +func (x *WorkspaceStorageSetting) GetActivedExternalStorageId() int32 { + if x != nil && x.ActivedExternalStorageId != nil { + return *x.ActivedExternalStorageId + } + return 0 +} + func (x *WorkspaceStorageSetting) GetLocalStoragePath() string { if x != nil { return x.LocalStoragePath @@ -416,7 +586,7 @@ type WorkspaceMemoRelatedSetting struct { func (x *WorkspaceMemoRelatedSetting) Reset() { *x = WorkspaceMemoRelatedSetting{} if protoimpl.UnsafeEnabled { - mi := &file_store_workspace_setting_proto_msgTypes[3] + mi := &file_store_workspace_setting_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -429,7 +599,7 @@ func (x *WorkspaceMemoRelatedSetting) String() string { func (*WorkspaceMemoRelatedSetting) ProtoMessage() {} func (x *WorkspaceMemoRelatedSetting) ProtoReflect() protoreflect.Message { - mi := &file_store_workspace_setting_proto_msgTypes[3] + mi := &file_store_workspace_setting_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -442,7 +612,7 @@ func (x *WorkspaceMemoRelatedSetting) ProtoReflect() protoreflect.Message { // Deprecated: Use WorkspaceMemoRelatedSetting.ProtoReflect.Descriptor instead. func (*WorkspaceMemoRelatedSetting) Descriptor() ([]byte, []int) { - return file_store_workspace_setting_proto_rawDescGZIP(), []int{3} + return file_store_workspace_setting_proto_rawDescGZIP(), []int{5} } func (x *WorkspaceMemoRelatedSetting) GetDisallowPublicVisible() bool { @@ -471,7 +641,7 @@ type WorkspaceTelegramIntegrationSetting struct { func (x *WorkspaceTelegramIntegrationSetting) Reset() { *x = WorkspaceTelegramIntegrationSetting{} if protoimpl.UnsafeEnabled { - mi := &file_store_workspace_setting_proto_msgTypes[4] + mi := &file_store_workspace_setting_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -484,7 +654,7 @@ func (x *WorkspaceTelegramIntegrationSetting) String() string { func (*WorkspaceTelegramIntegrationSetting) ProtoMessage() {} func (x *WorkspaceTelegramIntegrationSetting) ProtoReflect() protoreflect.Message { - mi := &file_store_workspace_setting_proto_msgTypes[4] + mi := &file_store_workspace_setting_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -497,7 +667,7 @@ func (x *WorkspaceTelegramIntegrationSetting) ProtoReflect() protoreflect.Messag // Deprecated: Use WorkspaceTelegramIntegrationSetting.ProtoReflect.Descriptor instead. func (*WorkspaceTelegramIntegrationSetting) Descriptor() ([]byte, []int) { - return file_store_workspace_setting_proto_rawDescGZIP(), []int{4} + return file_store_workspace_setting_proto_rawDescGZIP(), []int{6} } func (x *WorkspaceTelegramIntegrationSetting) GetBotToken() string { @@ -512,36 +682,46 @@ var File_store_workspace_setting_proto protoreflect.FileDescriptor var file_store_workspace_setting_proto_rawDesc = []byte{ 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x0b, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x22, 0xc5, 0x03, 0x0a, + 0x0b, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x22, 0x90, 0x04, 0x0a, 0x10, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x32, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x4b, 0x65, 0x79, - 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x4f, 0x0a, 0x0f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, - 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, - 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x57, 0x6f, 0x72, - 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x53, 0x65, 0x74, - 0x74, 0x69, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x0e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x53, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x4f, 0x0a, 0x0f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x24, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x57, 0x6f, - 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x53, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x0e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, - 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x5c, 0x0a, 0x14, 0x6d, 0x65, 0x6d, 0x6f, 0x5f, - 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, - 0x6f, 0x72, 0x65, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4d, 0x65, 0x6d, - 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x48, - 0x00, 0x52, 0x12, 0x6d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x53, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x74, 0x0a, 0x1c, 0x74, 0x65, 0x6c, 0x65, 0x67, 0x72, 0x61, - 0x6d, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x6d, 0x65, - 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, - 0x61, 0x63, 0x65, 0x54, 0x65, 0x6c, 0x65, 0x67, 0x72, 0x61, 0x6d, 0x49, 0x6e, 0x74, 0x65, 0x67, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x48, 0x00, 0x52, - 0x1a, 0x74, 0x65, 0x6c, 0x65, 0x67, 0x72, 0x61, 0x6d, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x42, 0x07, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x22, 0xf5, 0x01, 0x0a, 0x17, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x49, 0x0a, 0x0d, 0x62, 0x61, 0x73, 0x69, 0x63, 0x5f, 0x73, + 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6d, + 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x42, 0x61, 0x73, 0x69, 0x63, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, + 0x48, 0x00, 0x52, 0x0c, 0x62, 0x61, 0x73, 0x69, 0x63, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, + 0x12, 0x4f, 0x0a, 0x0f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x5f, 0x73, 0x65, 0x74, 0x74, + 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, + 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x48, + 0x00, 0x52, 0x0e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, + 0x67, 0x12, 0x4f, 0x0a, 0x0f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x65, 0x74, + 0x74, 0x69, 0x6e, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6d, 0x65, 0x6d, + 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, + 0x48, 0x00, 0x52, 0x0e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, + 0x6e, 0x67, 0x12, 0x5c, 0x0a, 0x14, 0x6d, 0x65, 0x6d, 0x6f, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, + 0x65, 0x64, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x28, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x57, + 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, + 0x74, 0x65, 0x64, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x12, 0x6d, 0x65, + 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, + 0x12, 0x74, 0x0a, 0x1c, 0x74, 0x65, 0x6c, 0x65, 0x67, 0x72, 0x61, 0x6d, 0x5f, 0x69, 0x6e, 0x74, + 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, + 0x6c, 0x65, 0x67, 0x72, 0x61, 0x6d, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x1a, 0x74, 0x65, 0x6c, 0x65, + 0x67, 0x72, 0x61, 0x6d, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, + 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, + 0x53, 0x0a, 0x15, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x42, 0x61, 0x73, 0x69, + 0x63, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x5f, + 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x63, 0x72, 0x65, + 0x74, 0x4b, 0x65, 0x79, 0x22, 0xc1, 0x02, 0x0a, 0x17, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, @@ -556,65 +736,88 @@ var file_store_workspace_setting_proto_rawDesc = []byte{ 0x10, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x61, 0x64, 0x64, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x22, 0xc8, 0x02, 0x0a, - 0x17, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x53, 0x0a, 0x0c, 0x73, 0x74, 0x6f, 0x72, - 0x61, 0x67, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x30, - 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x57, 0x6f, 0x72, - 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x53, 0x65, 0x74, - 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, - 0x52, 0x0b, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2c, 0x0a, - 0x12, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x70, - 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6c, 0x6f, 0x63, 0x61, 0x6c, - 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x50, 0x61, 0x74, 0x68, 0x12, 0x2f, 0x0a, 0x14, 0x75, - 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, - 0x5f, 0x6d, 0x62, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x11, 0x75, 0x70, 0x6c, 0x6f, 0x61, - 0x64, 0x53, 0x69, 0x7a, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4d, 0x62, 0x22, 0x79, 0x0a, 0x0b, - 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x18, 0x53, - 0x54, 0x4f, 0x52, 0x41, 0x47, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, - 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x19, 0x0a, 0x15, 0x53, 0x54, 0x4f, - 0x52, 0x41, 0x47, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x42, 0x41, - 0x53, 0x45, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x4f, 0x52, 0x41, 0x47, 0x45, 0x5f, - 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x10, 0x02, 0x12, 0x19, 0x0a, 0x15, - 0x53, 0x54, 0x4f, 0x52, 0x41, 0x47, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x58, 0x54, - 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x10, 0x03, 0x22, 0x8e, 0x01, 0x0a, 0x1b, 0x57, 0x6f, 0x72, 0x6b, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, - 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x36, 0x0a, 0x17, 0x64, 0x69, 0x73, 0x61, 0x6c, - 0x6c, 0x6f, 0x77, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x76, 0x69, 0x73, 0x69, 0x62, - 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, - 0x6f, 0x77, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x56, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x12, - 0x37, 0x0a, 0x18, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, - 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x15, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x57, 0x69, 0x74, 0x68, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x42, 0x0a, 0x23, 0x57, 0x6f, 0x72, 0x6b, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6c, 0x65, 0x67, 0x72, 0x61, 0x6d, 0x49, 0x6e, 0x74, - 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, - 0x1b, 0x0a, 0x09, 0x62, 0x6f, 0x74, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x62, 0x6f, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x2a, 0xca, 0x01, 0x0a, - 0x13, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, - 0x67, 0x4b, 0x65, 0x79, 0x12, 0x25, 0x0a, 0x21, 0x57, 0x4f, 0x52, 0x4b, 0x53, 0x50, 0x41, 0x43, - 0x45, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x55, 0x4e, - 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1d, 0x0a, 0x19, 0x57, - 0x4f, 0x52, 0x4b, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x49, 0x4e, 0x47, - 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x1d, 0x0a, 0x19, 0x57, 0x4f, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x12, 0x4a, 0x0a, 0x0e, + 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x6f, + 0x72, 0x65, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x43, 0x75, 0x73, 0x74, + 0x6f, 0x6d, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x0d, 0x63, 0x75, 0x73, 0x74, 0x6f, + 0x6d, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x22, 0xa3, 0x01, 0x0a, 0x16, 0x57, 0x6f, 0x72, + 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x50, 0x72, 0x6f, 0x66, + 0x69, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x6c, + 0x6f, 0x67, 0x6f, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, + 0x6f, 0x67, 0x6f, 0x55, 0x72, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x12, 0x1e, + 0x0a, 0x0a, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x61, 0x6e, 0x63, 0x65, 0x22, 0xac, + 0x03, 0x0a, 0x17, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x53, 0x0a, 0x0c, 0x73, 0x74, + 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x30, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x57, + 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x53, + 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x54, 0x79, + 0x70, 0x65, 0x52, 0x0b, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x42, 0x0a, 0x1b, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x64, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x72, + 0x6e, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x48, 0x00, 0x52, 0x18, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x64, 0x45, + 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x49, 0x64, + 0x88, 0x01, 0x01, 0x12, 0x2c, 0x0a, 0x12, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x6f, + 0x72, 0x61, 0x67, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x10, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x50, 0x61, 0x74, + 0x68, 0x12, 0x2f, 0x0a, 0x14, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x73, 0x69, 0x7a, 0x65, + 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x5f, 0x6d, 0x62, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x11, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x69, 0x7a, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, + 0x4d, 0x62, 0x22, 0x79, 0x0a, 0x0b, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x1c, 0x0a, 0x18, 0x53, 0x54, 0x4f, 0x52, 0x41, 0x47, 0x45, 0x5f, 0x54, 0x59, 0x50, + 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, + 0x19, 0x0a, 0x15, 0x53, 0x54, 0x4f, 0x52, 0x41, 0x47, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, + 0x44, 0x41, 0x54, 0x41, 0x42, 0x41, 0x53, 0x45, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, + 0x4f, 0x52, 0x41, 0x47, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4c, 0x4f, 0x43, 0x41, 0x4c, + 0x10, 0x02, 0x12, 0x19, 0x0a, 0x15, 0x53, 0x54, 0x4f, 0x52, 0x41, 0x47, 0x45, 0x5f, 0x54, 0x59, + 0x50, 0x45, 0x5f, 0x45, 0x58, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x10, 0x03, 0x42, 0x1e, 0x0a, + 0x1c, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x64, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, + 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x22, 0x8e, 0x01, + 0x0a, 0x1b, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, + 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x36, 0x0a, + 0x17, 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x5f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, + 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x56, 0x69, + 0x73, 0x69, 0x62, 0x6c, 0x65, 0x12, 0x37, 0x0a, 0x18, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, + 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, + 0x57, 0x69, 0x74, 0x68, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x42, + 0x0a, 0x23, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6c, 0x65, 0x67, + 0x72, 0x61, 0x6d, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, + 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x6f, 0x74, 0x5f, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x6f, 0x74, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x2a, 0xe7, 0x01, 0x0a, 0x13, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x4b, 0x65, 0x79, 0x12, 0x25, 0x0a, 0x21, 0x57, 0x4f, 0x52, 0x4b, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x49, 0x4e, 0x47, 0x5f, - 0x53, 0x54, 0x4f, 0x52, 0x41, 0x47, 0x45, 0x10, 0x02, 0x12, 0x22, 0x0a, 0x1e, 0x57, 0x4f, 0x52, - 0x4b, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x4d, - 0x45, 0x4d, 0x4f, 0x5f, 0x52, 0x45, 0x4c, 0x41, 0x54, 0x45, 0x44, 0x10, 0x03, 0x12, 0x2a, 0x0a, - 0x26, 0x57, 0x4f, 0x52, 0x4b, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x49, - 0x4e, 0x47, 0x5f, 0x54, 0x45, 0x4c, 0x45, 0x47, 0x52, 0x41, 0x4d, 0x5f, 0x49, 0x4e, 0x54, 0x45, - 0x47, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x04, 0x42, 0xa0, 0x01, 0x0a, 0x0f, 0x63, 0x6f, - 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x15, 0x57, - 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, - 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x72, - 0x65, 0xa2, 0x02, 0x03, 0x4d, 0x53, 0x58, 0xaa, 0x02, 0x0b, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, - 0x53, 0x74, 0x6f, 0x72, 0x65, 0xca, 0x02, 0x0b, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x74, - 0x6f, 0x72, 0x65, 0xe2, 0x02, 0x17, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x74, 0x6f, 0x72, - 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0c, - 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x4b, 0x45, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, + 0x00, 0x12, 0x1b, 0x0a, 0x17, 0x57, 0x4f, 0x52, 0x4b, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x53, + 0x45, 0x54, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x42, 0x41, 0x53, 0x49, 0x43, 0x10, 0x01, 0x12, 0x1d, + 0x0a, 0x19, 0x57, 0x4f, 0x52, 0x4b, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x53, 0x45, 0x54, 0x54, + 0x49, 0x4e, 0x47, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x4c, 0x10, 0x02, 0x12, 0x1d, 0x0a, + 0x19, 0x57, 0x4f, 0x52, 0x4b, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x49, + 0x4e, 0x47, 0x5f, 0x53, 0x54, 0x4f, 0x52, 0x41, 0x47, 0x45, 0x10, 0x03, 0x12, 0x22, 0x0a, 0x1e, + 0x57, 0x4f, 0x52, 0x4b, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x49, 0x4e, + 0x47, 0x5f, 0x4d, 0x45, 0x4d, 0x4f, 0x5f, 0x52, 0x45, 0x4c, 0x41, 0x54, 0x45, 0x44, 0x10, 0x04, + 0x12, 0x2a, 0x0a, 0x26, 0x57, 0x4f, 0x52, 0x4b, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x53, 0x45, + 0x54, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x54, 0x45, 0x4c, 0x45, 0x47, 0x52, 0x41, 0x4d, 0x5f, 0x49, + 0x4e, 0x54, 0x45, 0x47, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x05, 0x42, 0xa0, 0x01, 0x0a, + 0x0f, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x42, 0x15, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, + 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, + 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0xa2, 0x02, 0x03, 0x4d, 0x53, 0x58, 0xaa, 0x02, 0x0b, 0x4d, 0x65, 0x6d, + 0x6f, 0x73, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0xca, 0x02, 0x0b, 0x4d, 0x65, 0x6d, 0x6f, 0x73, + 0x5c, 0x53, 0x74, 0x6f, 0x72, 0x65, 0xe2, 0x02, 0x17, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x53, + 0x74, 0x6f, 0x72, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -630,28 +833,32 @@ func file_store_workspace_setting_proto_rawDescGZIP() []byte { } var file_store_workspace_setting_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_store_workspace_setting_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_store_workspace_setting_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_store_workspace_setting_proto_goTypes = []interface{}{ (WorkspaceSettingKey)(0), // 0: memos.store.WorkspaceSettingKey (WorkspaceStorageSetting_StorageType)(0), // 1: memos.store.WorkspaceStorageSetting.StorageType (*WorkspaceSetting)(nil), // 2: memos.store.WorkspaceSetting - (*WorkspaceGeneralSetting)(nil), // 3: memos.store.WorkspaceGeneralSetting - (*WorkspaceStorageSetting)(nil), // 4: memos.store.WorkspaceStorageSetting - (*WorkspaceMemoRelatedSetting)(nil), // 5: memos.store.WorkspaceMemoRelatedSetting - (*WorkspaceTelegramIntegrationSetting)(nil), // 6: memos.store.WorkspaceTelegramIntegrationSetting + (*WorkspaceBasicSetting)(nil), // 3: memos.store.WorkspaceBasicSetting + (*WorkspaceGeneralSetting)(nil), // 4: memos.store.WorkspaceGeneralSetting + (*WorkspaceCustomProfile)(nil), // 5: memos.store.WorkspaceCustomProfile + (*WorkspaceStorageSetting)(nil), // 6: memos.store.WorkspaceStorageSetting + (*WorkspaceMemoRelatedSetting)(nil), // 7: memos.store.WorkspaceMemoRelatedSetting + (*WorkspaceTelegramIntegrationSetting)(nil), // 8: memos.store.WorkspaceTelegramIntegrationSetting } var file_store_workspace_setting_proto_depIdxs = []int32{ 0, // 0: memos.store.WorkspaceSetting.key:type_name -> memos.store.WorkspaceSettingKey - 3, // 1: memos.store.WorkspaceSetting.general_setting:type_name -> memos.store.WorkspaceGeneralSetting - 4, // 2: memos.store.WorkspaceSetting.storage_setting:type_name -> memos.store.WorkspaceStorageSetting - 5, // 3: memos.store.WorkspaceSetting.memo_related_setting:type_name -> memos.store.WorkspaceMemoRelatedSetting - 6, // 4: memos.store.WorkspaceSetting.telegram_integration_setting:type_name -> memos.store.WorkspaceTelegramIntegrationSetting - 1, // 5: memos.store.WorkspaceStorageSetting.storage_type:type_name -> memos.store.WorkspaceStorageSetting.StorageType - 6, // [6:6] is the sub-list for method output_type - 6, // [6:6] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name + 3, // 1: memos.store.WorkspaceSetting.basic_setting:type_name -> memos.store.WorkspaceBasicSetting + 4, // 2: memos.store.WorkspaceSetting.general_setting:type_name -> memos.store.WorkspaceGeneralSetting + 6, // 3: memos.store.WorkspaceSetting.storage_setting:type_name -> memos.store.WorkspaceStorageSetting + 7, // 4: memos.store.WorkspaceSetting.memo_related_setting:type_name -> memos.store.WorkspaceMemoRelatedSetting + 8, // 5: memos.store.WorkspaceSetting.telegram_integration_setting:type_name -> memos.store.WorkspaceTelegramIntegrationSetting + 5, // 6: memos.store.WorkspaceGeneralSetting.custom_profile:type_name -> memos.store.WorkspaceCustomProfile + 1, // 7: memos.store.WorkspaceStorageSetting.storage_type:type_name -> memos.store.WorkspaceStorageSetting.StorageType + 8, // [8:8] is the sub-list for method output_type + 8, // [8:8] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name } func init() { file_store_workspace_setting_proto_init() } @@ -673,7 +880,7 @@ func file_store_workspace_setting_proto_init() { } } file_store_workspace_setting_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WorkspaceGeneralSetting); i { + switch v := v.(*WorkspaceBasicSetting); i { case 0: return &v.state case 1: @@ -685,7 +892,7 @@ func file_store_workspace_setting_proto_init() { } } file_store_workspace_setting_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WorkspaceStorageSetting); i { + switch v := v.(*WorkspaceGeneralSetting); i { case 0: return &v.state case 1: @@ -697,7 +904,7 @@ func file_store_workspace_setting_proto_init() { } } file_store_workspace_setting_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WorkspaceMemoRelatedSetting); i { + switch v := v.(*WorkspaceCustomProfile); i { case 0: return &v.state case 1: @@ -709,6 +916,30 @@ func file_store_workspace_setting_proto_init() { } } file_store_workspace_setting_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WorkspaceStorageSetting); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_store_workspace_setting_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WorkspaceMemoRelatedSetting); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_store_workspace_setting_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*WorkspaceTelegramIntegrationSetting); i { case 0: return &v.state @@ -722,18 +953,20 @@ func file_store_workspace_setting_proto_init() { } } file_store_workspace_setting_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*WorkspaceSetting_BasicSetting)(nil), (*WorkspaceSetting_GeneralSetting)(nil), (*WorkspaceSetting_StorageSetting)(nil), (*WorkspaceSetting_MemoRelatedSetting)(nil), (*WorkspaceSetting_TelegramIntegrationSetting)(nil), } + file_store_workspace_setting_proto_msgTypes[4].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_store_workspace_setting_proto_rawDesc, NumEnums: 2, - NumMessages: 5, + NumMessages: 7, NumExtensions: 0, NumServices: 0, }, diff --git a/proto/store/storage.proto b/proto/store/storage.proto new file mode 100644 index 000000000..675ab5d5c --- /dev/null +++ b/proto/store/storage.proto @@ -0,0 +1,35 @@ +syntax = "proto3"; + +package memos.store; + +option go_package = "gen/store"; + +message Storage { + int32 id = 1; + string name = 2; + + enum Type { + TYPE_UNSPECIFIED = 0; + S3 = 1; + } + Type type = 3; + StorageConfig config = 4; +} + +message StorageConfig { + oneof storage_config { + S3Config s3_config = 1; + } +} + +message S3Config { + string end_point = 1; + string path = 2; + string region = 3; + string access_key = 4; + string secret_key = 5; + string bucket = 6; + string url_prefix = 7; + string url_suffix = 8; + bool pre_sign = 9; +} diff --git a/proto/store/workspace_setting.proto b/proto/store/workspace_setting.proto index 32fc10142..2127f96df 100644 --- a/proto/store/workspace_setting.proto +++ b/proto/store/workspace_setting.proto @@ -6,26 +6,34 @@ option go_package = "gen/store"; enum WorkspaceSettingKey { WORKSPACE_SETTING_KEY_UNSPECIFIED = 0; + // WORKSPACE_SETTING_BASIC is the key for basic settings. + WORKSPACE_SETTING_BASIC = 1; // WORKSPACE_SETTING_GENERAL is the key for general settings. - WORKSPACE_SETTING_GENERAL = 1; + WORKSPACE_SETTING_GENERAL = 2; // WORKSPACE_SETTING_STORAGE is the key for storage settings. - WORKSPACE_SETTING_STORAGE = 2; + WORKSPACE_SETTING_STORAGE = 3; // WORKSPACE_SETTING_MEMO_RELATED is the key for memo related settings. - WORKSPACE_SETTING_MEMO_RELATED = 3; + WORKSPACE_SETTING_MEMO_RELATED = 4; // WORKSPACE_SETTING_TELEGRAM_INTEGRATION is the key for telegram integration settings. - WORKSPACE_SETTING_TELEGRAM_INTEGRATION = 4; + WORKSPACE_SETTING_TELEGRAM_INTEGRATION = 5; } message WorkspaceSetting { WorkspaceSettingKey key = 1; oneof value { - WorkspaceGeneralSetting general_setting = 2; - WorkspaceStorageSetting storage_setting = 3; - WorkspaceMemoRelatedSetting memo_related_setting = 4; - WorkspaceTelegramIntegrationSetting telegram_integration_setting = 5; + WorkspaceBasicSetting basic_setting = 2; + WorkspaceGeneralSetting general_setting = 3; + WorkspaceStorageSetting storage_setting = 4; + WorkspaceMemoRelatedSetting memo_related_setting = 5; + WorkspaceTelegramIntegrationSetting telegram_integration_setting = 6; } } +message WorkspaceBasicSetting { + string server_id = 1; + string secret_key = 2; +} + message WorkspaceGeneralSetting { // instance_url is the instance URL. string instance_url = 1; @@ -37,16 +45,28 @@ message WorkspaceGeneralSetting { string additional_script = 5; // additional_style is the additional style. string additional_style = 6; + // custom_profile is the custom profile. + WorkspaceCustomProfile custom_profile = 4; +} + +message WorkspaceCustomProfile { + string title = 1; + string description = 2; + string logo_url = 3; + string locale = 4; + string appearance = 5; } message WorkspaceStorageSetting { // storage_type is the storage type. StorageType storage_type = 1; + // The id of actived external storage. + optional int32 actived_external_storage_id = 2; // The local storage path for STORAGE_TYPE_LOCAL. // e.g. assets/{timestamp}_{filename} - string local_storage_path = 2; + string local_storage_path = 3; // The max upload size in megabytes. - int64 upload_size_limit_mb = 3; + int64 upload_size_limit_mb = 4; enum StorageType { STORAGE_TYPE_UNSPECIFIED = 0; diff --git a/server/integration/telegram.go b/server/integration/telegram.go index c19e7cbb0..7c5a05cb7 100644 --- a/server/integration/telegram.go +++ b/server/integration/telegram.go @@ -3,7 +3,6 @@ package integration import ( "bytes" "context" - "encoding/json" "fmt" "path/filepath" "slices" @@ -34,10 +33,10 @@ func NewTelegramHandler(store *store.Store) *TelegramHandler { } func (t *TelegramHandler) BotToken(ctx context.Context) string { - if setting, err := t.store.GetWorkspaceSetting(ctx, &store.FindWorkspaceSetting{ - Name: apiv1.SystemSettingTelegramBotTokenName.String(), - }); err == nil && setting != nil { - return setting.Value + if workspaceSetting, err := t.store.GetWorkspaceSettingV1(ctx, &store.FindWorkspaceSetting{ + Name: storepb.WorkspaceSettingKey_WORKSPACE_SETTING_TELEGRAM_INTEGRATION.String(), + }); err == nil && workspaceSetting != nil { + return workspaceSetting.GetTelegramIntegrationSetting().BotToken } return "" } @@ -170,21 +169,12 @@ func (t *TelegramHandler) CallbackQueryHandle(ctx context.Context, bot *telegram return bot.AnswerCallbackQuery(ctx, callbackQuery.ID, fmt.Sprintf("Memo %d not found, possibly deleted elsewhere", memoID)) } - setting, err := t.store.GetWorkspaceSetting(ctx, &store.FindWorkspaceSetting{ - Name: apiv1.SystemSettingDisablePublicMemosName.String(), - }) + workspaceMemoRelatedSetting, err := t.store.GetWorkspaceMemoRelatedSetting(ctx) if err != nil { return bot.AnswerCallbackQuery(ctx, callbackQuery.ID, fmt.Sprintf("Failed to get workspace setting %s", err)) } - if setting != nil && setting.Value != "" { - disablePublicMemo := false - err = json.Unmarshal([]byte(setting.Value), &disablePublicMemo) - if err != nil { - return bot.AnswerCallbackQuery(ctx, callbackQuery.ID, fmt.Sprintf("Failed to get workspace setting %s", err)) - } - if disablePublicMemo && visibility == store.Public { - return bot.AnswerCallbackQuery(ctx, callbackQuery.ID, fmt.Sprintf("Failed to changing Memo %d to %s\n(workspace disallowed public memo)", memoID, visibility)) - } + if workspaceMemoRelatedSetting.DisallowPublicVisible && visibility == store.Public { + return bot.AnswerCallbackQuery(ctx, callbackQuery.ID, fmt.Sprintf("Failed to changing Memo %d to %s\n(workspace disallowed public memo)", memoID, visibility)) } update := store.UpdateMemo{ diff --git a/server/route/api/v1/memo.go b/server/route/api/v1/memo.go index 08003ea01..0b92121d0 100644 --- a/server/route/api/v1/memo.go +++ b/server/route/api/v1/memo.go @@ -202,14 +202,6 @@ func (s *APIV1Service) GetMemoList(c echo.Context) error { find.Offset = &offset } - memoDisplayWithUpdatedTs, err := s.getMemoDisplayWithUpdatedTsSettingValue(ctx) - if err != nil { - return echo.NewHTTPError(http.StatusInternalServerError, "Failed to get memo display with updated ts setting value").SetInternal(err) - } - if memoDisplayWithUpdatedTs { - find.OrderByUpdatedTs = true - } - list, err := s.Store.ListMemos(ctx, find) if err != nil { return echo.NewHTTPError(http.StatusInternalServerError, "Failed to fetch memo list").SetInternal(err) @@ -274,36 +266,6 @@ func (s *APIV1Service) CreateMemo(c echo.Context) error { } } - // Find disable public memos system setting. - disablePublicMemosSystemSetting, err := s.Store.GetWorkspaceSetting(ctx, &store.FindWorkspaceSetting{ - Name: SystemSettingDisablePublicMemosName.String(), - }) - if err != nil { - return echo.NewHTTPError(http.StatusInternalServerError, "Failed to find system setting").SetInternal(err) - } - if disablePublicMemosSystemSetting != nil { - disablePublicMemos := false - err = json.Unmarshal([]byte(disablePublicMemosSystemSetting.Value), &disablePublicMemos) - if err != nil { - return echo.NewHTTPError(http.StatusInternalServerError, "Failed to unmarshal system setting").SetInternal(err) - } - if disablePublicMemos { - user, err := s.Store.GetUser(ctx, &store.FindUser{ - ID: &userID, - }) - if err != nil { - return echo.NewHTTPError(http.StatusInternalServerError, "Failed to find user").SetInternal(err) - } - if user == nil { - return echo.NewHTTPError(http.StatusNotFound, "User not found") - } - // Enforce normal user to create private memo if public memos are disabled. - if user.Role == store.RoleUser { - createMemoRequest.Visibility = Private - } - } - } - createMemoRequest.CreatorID = userID memo, err := s.Store.CreateMemo(ctx, convertCreateMemoRequestToMemoMessage(createMemoRequest)) if err != nil { @@ -444,14 +406,6 @@ func (s *APIV1Service) GetAllMemos(c echo.Context) error { normalStatus := store.Normal memoFind.RowStatus = &normalStatus - memoDisplayWithUpdatedTs, err := s.getMemoDisplayWithUpdatedTsSettingValue(ctx) - if err != nil { - return echo.NewHTTPError(http.StatusInternalServerError, "Failed to get memo display with updated ts setting value").SetInternal(err) - } - if memoDisplayWithUpdatedTs { - memoFind.OrderByUpdatedTs = true - } - list, err := s.Store.ListMemos(ctx, memoFind) if err != nil { return echo.NewHTTPError(http.StatusInternalServerError, "Failed to fetch all memo list").SetInternal(err) @@ -512,28 +466,14 @@ func (s *APIV1Service) GetMemoStats(c echo.Context) error { } } - memoDisplayWithUpdatedTs, err := s.getMemoDisplayWithUpdatedTsSettingValue(ctx) - if err != nil { - return echo.NewHTTPError(http.StatusInternalServerError, "Failed to get memo display with updated ts setting value").SetInternal(err) - } - if memoDisplayWithUpdatedTs { - findMemoMessage.OrderByUpdatedTs = true - } - list, err := s.Store.ListMemos(ctx, findMemoMessage) if err != nil { return echo.NewHTTPError(http.StatusInternalServerError, "Failed to find memo list").SetInternal(err) } displayTsList := []int64{} - if memoDisplayWithUpdatedTs { - for _, memo := range list { - displayTsList = append(displayTsList, memo.UpdatedTs) - } - } else { - for _, memo := range list { - displayTsList = append(displayTsList, memo.CreatedTs) - } + for _, memo := range list { + displayTsList = append(displayTsList, memo.CreatedTs) } return c.JSON(http.StatusOK, displayTsList) } @@ -704,40 +644,6 @@ func (s *APIV1Service) UpdateMemo(c echo.Context) error { rowStatus := store.RowStatus(patchMemoRequest.RowStatus.String()) updateMemoMessage.RowStatus = &rowStatus } - if patchMemoRequest.Visibility != nil { - visibility := store.Visibility(patchMemoRequest.Visibility.String()) - updateMemoMessage.Visibility = &visibility - // Find disable public memos system setting. - disablePublicMemosSystemSetting, err := s.Store.GetWorkspaceSetting(ctx, &store.FindWorkspaceSetting{ - Name: SystemSettingDisablePublicMemosName.String(), - }) - if err != nil { - return echo.NewHTTPError(http.StatusInternalServerError, "Failed to find system setting").SetInternal(err) - } - if disablePublicMemosSystemSetting != nil { - disablePublicMemos := false - err = json.Unmarshal([]byte(disablePublicMemosSystemSetting.Value), &disablePublicMemos) - if err != nil { - return echo.NewHTTPError(http.StatusInternalServerError, "Failed to unmarshal system setting").SetInternal(err) - } - if disablePublicMemos { - user, err := s.Store.GetUser(ctx, &store.FindUser{ - ID: &userID, - }) - if err != nil { - return echo.NewHTTPError(http.StatusInternalServerError, "Failed to find user").SetInternal(err) - } - if user == nil { - return echo.NewHTTPError(http.StatusNotFound, "User not found") - } - // Enforce normal user to save as private memo if public memos are disabled. - if user.Role == store.RoleUser { - visibility = store.Visibility("PRIVATE") - updateMemoMessage.Visibility = &visibility - } - } - } - } err = s.Store.UpdateMemo(ctx, updateMemoMessage) if err != nil { @@ -853,14 +759,6 @@ func (s *APIV1Service) convertMemoFromStore(ctx context.Context, memo *store.Mem // Compose display ts. memoMessage.DisplayTs = memoMessage.CreatedTs - // Find memo display with updated ts setting. - memoDisplayWithUpdatedTs, err := s.getMemoDisplayWithUpdatedTsSettingValue(ctx) - if err != nil { - return nil, err - } - if memoDisplayWithUpdatedTs { - memoMessage.DisplayTs = memoMessage.UpdatedTs - } // Compose related resources. resourceList, err := s.Store.ListResources(ctx, &store.FindResource{ @@ -898,23 +796,6 @@ func (s *APIV1Service) convertMemoFromStore(ctx context.Context, memo *store.Mem return memoMessage, nil } -func (s *APIV1Service) getMemoDisplayWithUpdatedTsSettingValue(ctx context.Context) (bool, error) { - memoDisplayWithUpdatedTsSetting, err := s.Store.GetWorkspaceSetting(ctx, &store.FindWorkspaceSetting{ - Name: SystemSettingMemoDisplayWithUpdatedTsName.String(), - }) - if err != nil { - return false, errors.Wrap(err, "failed to find system setting") - } - memoDisplayWithUpdatedTs := false - if memoDisplayWithUpdatedTsSetting != nil { - err = json.Unmarshal([]byte(memoDisplayWithUpdatedTsSetting.Value), &memoDisplayWithUpdatedTs) - if err != nil { - return false, errors.Wrap(err, "failed to unmarshal system setting value") - } - } - return memoDisplayWithUpdatedTs, nil -} - func convertCreateMemoRequestToMemoMessage(memoCreate *CreateMemoRequest) *store.Memo { createdTs := time.Now().Unix() if memoCreate.CreatedTs != nil { diff --git a/server/route/api/v1/system.go b/server/route/api/v1/system.go index 51a26c11c..412f936f3 100644 --- a/server/route/api/v1/system.go +++ b/server/route/api/v1/system.go @@ -98,10 +98,6 @@ func (s *APIV1Service) GetSystemStatus(c echo.Context) error { return echo.NewHTTPError(http.StatusInternalServerError, "Failed to find system setting list").SetInternal(err) } for _, systemSetting := range systemSettingList { - if systemSetting.Name == SystemSettingServerIDName.String() || systemSetting.Name == SystemSettingSecretSessionName.String() || systemSetting.Name == SystemSettingTelegramBotTokenName.String() { - continue - } - var baseValue any err := json.Unmarshal([]byte(systemSetting.Value), &baseValue) if err != nil { @@ -110,8 +106,6 @@ func (s *APIV1Service) GetSystemStatus(c echo.Context) error { } switch systemSetting.Name { - case SystemSettingDisablePublicMemosName.String(): - systemStatus.DisablePublicMemos = baseValue.(bool) case SystemSettingMaxUploadSizeMiBName.String(): systemStatus.MaxUploadSizeMiB = int(baseValue.(float64)) case SystemSettingCustomizedProfileName.String(): @@ -122,10 +116,6 @@ func (s *APIV1Service) GetSystemStatus(c echo.Context) error { systemStatus.CustomizedProfile = customizedProfile case SystemSettingStorageServiceIDName.String(): systemStatus.StorageServiceID = int32(baseValue.(float64)) - case SystemSettingLocalStoragePathName.String(): - systemStatus.LocalStoragePath = baseValue.(string) - case SystemSettingMemoDisplayWithUpdatedTsName.String(): - systemStatus.MemoDisplayWithUpdatedTs = baseValue.(bool) default: // Skip unknown system setting. } diff --git a/server/route/api/v1/system_setting.go b/server/route/api/v1/system_setting.go index 4aff3816e..13fbcb90b 100644 --- a/server/route/api/v1/system_setting.go +++ b/server/route/api/v1/system_setting.go @@ -15,12 +15,6 @@ import ( type SystemSettingName string const ( - // SystemSettingServerIDName is the name of server id. - SystemSettingServerIDName SystemSettingName = "server-id" - // SystemSettingSecretSessionName is the name of secret session. - SystemSettingSecretSessionName SystemSettingName = "secret-session" - // SystemSettingDisablePublicMemosName is the name of disable public memos setting. - SystemSettingDisablePublicMemosName SystemSettingName = "disable-public-memos" // SystemSettingMaxUploadSizeMiBName is the name of max upload size setting. SystemSettingMaxUploadSizeMiBName SystemSettingName = "max-upload-size-mib" // SystemSettingCustomizedProfileName is the name of customized server profile. @@ -29,10 +23,6 @@ const ( SystemSettingStorageServiceIDName SystemSettingName = "storage-service-id" // SystemSettingLocalStoragePathName is the name of local storage path. SystemSettingLocalStoragePathName SystemSettingName = "local-storage-path" - // SystemSettingTelegramBotTokenName is the name of Telegram Bot Token. - SystemSettingTelegramBotTokenName SystemSettingName = "telegram-bot-token" - // SystemSettingMemoDisplayWithUpdatedTsName is the name of memo display with updated ts. - SystemSettingMemoDisplayWithUpdatedTsName SystemSettingName = "memo-display-with-updated-ts" ) const systemSettingUnmarshalError = `failed to unmarshal value from system setting "%v"` @@ -160,13 +150,6 @@ func (s *APIV1Service) CreateSystemSetting(c echo.Context) error { func (upsert UpsertSystemSettingRequest) Validate() error { switch settingName := upsert.Name; settingName { - case SystemSettingServerIDName: - return errors.Errorf("updating %v is not allowed", settingName) - case SystemSettingDisablePublicMemosName: - var value bool - if err := json.Unmarshal([]byte(upsert.Value), &value); err != nil { - return errors.Errorf(systemSettingUnmarshalError, settingName) - } case SystemSettingMaxUploadSizeMiBName: var value int if err := json.Unmarshal([]byte(upsert.Value), &value); err != nil { @@ -213,27 +196,6 @@ func (upsert UpsertSystemSettingRequest) Validate() error { case !strings.Contains(trimmedValue, "{filename}"): return errors.New("local storage path must contain `{filename}`") } - case SystemSettingTelegramBotTokenName: - if upsert.Value == "" { - return nil - } - // Bot Token with Reverse Proxy shoule like `http.../bot