2024-02-20 23:02:01 +08:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package memos.api.v2;
|
|
|
|
|
|
|
|
import "google/api/annotations.proto";
|
|
|
|
import "google/api/client.proto";
|
|
|
|
import "google/api/field_behavior.proto";
|
|
|
|
|
|
|
|
option go_package = "gen/api/v2";
|
|
|
|
|
|
|
|
service WorkspaceSettingService {
|
2024-04-12 08:32:54 +08:00
|
|
|
// ListWorkspaceSetting returns the list of settings.
|
|
|
|
rpc ListWorkspaceSettings(ListWorkspaceSettingsRequest) returns (ListWorkspaceSettingsResponse) {
|
|
|
|
option (google.api.http) = {get: "/api/v2/workspace/settings"};
|
|
|
|
}
|
2024-02-20 23:02:01 +08:00
|
|
|
// GetWorkspaceSetting returns the setting by name.
|
|
|
|
rpc GetWorkspaceSetting(GetWorkspaceSettingRequest) returns (GetWorkspaceSettingResponse) {
|
|
|
|
option (google.api.http) = {get: "/api/v2/workspace/{name=settings/*}"};
|
|
|
|
option (google.api.method_signature) = "name";
|
|
|
|
}
|
|
|
|
// SetWorkspaceSetting updates the setting.
|
|
|
|
rpc SetWorkspaceSetting(SetWorkspaceSettingRequest) returns (SetWorkspaceSettingResponse) {
|
|
|
|
option (google.api.http) = {
|
|
|
|
patch: "/api/v2/workspace/{setting.name=settings/*}",
|
|
|
|
body: "setting"
|
|
|
|
};
|
|
|
|
option (google.api.method_signature) = "setting";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-04-12 08:32:54 +08:00
|
|
|
message ListWorkspaceSettingsRequest {}
|
|
|
|
|
|
|
|
message ListWorkspaceSettingsResponse {
|
|
|
|
repeated WorkspaceSetting settings = 1;
|
|
|
|
}
|
|
|
|
|
2024-02-20 23:02:01 +08:00
|
|
|
message GetWorkspaceSettingRequest {
|
|
|
|
// The resource name of the workspace setting.
|
|
|
|
// Format: settings/{setting}
|
|
|
|
string name = 1 [(google.api.field_behavior) = REQUIRED];
|
|
|
|
}
|
|
|
|
|
|
|
|
message GetWorkspaceSettingResponse {
|
|
|
|
WorkspaceSetting setting = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message SetWorkspaceSettingRequest {
|
|
|
|
// setting is the setting to update.
|
|
|
|
WorkspaceSetting setting = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message SetWorkspaceSettingResponse {
|
|
|
|
WorkspaceSetting setting = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message WorkspaceSetting {
|
|
|
|
// name is the name of the setting.
|
|
|
|
// Format: settings/{setting}
|
|
|
|
string name = 1;
|
|
|
|
oneof value {
|
|
|
|
WorkspaceGeneralSetting general_setting = 2;
|
2024-04-10 23:01:01 +08:00
|
|
|
WorkspaceStorageSetting storage_setting = 3;
|
|
|
|
WorkspaceMemoRelatedSetting memo_related_setting = 4;
|
|
|
|
WorkspaceTelegramIntegrationSetting telegram_integration_setting = 5;
|
2024-02-20 23:02:01 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
message WorkspaceGeneralSetting {
|
|
|
|
// instance_url is the instance URL.
|
|
|
|
string instance_url = 1;
|
|
|
|
// disallow_signup is the flag to disallow signup.
|
|
|
|
bool disallow_signup = 2;
|
|
|
|
// disallow_password_login is the flag to disallow password login.
|
|
|
|
bool disallow_password_login = 3;
|
|
|
|
// additional_script is the additional script.
|
2024-04-12 08:32:54 +08:00
|
|
|
string additional_script = 4;
|
2024-02-20 23:02:01 +08:00
|
|
|
// additional_style is the additional style.
|
2024-04-12 08:32:54 +08:00
|
|
|
string additional_style = 5;
|
|
|
|
// custom_profile is the custom profile.
|
|
|
|
WorkspaceCustomProfile custom_profile = 6;
|
|
|
|
}
|
|
|
|
|
|
|
|
message WorkspaceCustomProfile {
|
|
|
|
string title = 1;
|
|
|
|
string description = 2;
|
|
|
|
string logo_url = 3;
|
|
|
|
string locale = 4;
|
|
|
|
string appearance = 5;
|
2024-02-20 23:02:01 +08:00
|
|
|
}
|
2024-04-10 23:01:01 +08:00
|
|
|
|
|
|
|
message WorkspaceStorageSetting {
|
|
|
|
// storage_type is the storage type.
|
|
|
|
StorageType storage_type = 1;
|
2024-04-12 08:32:54 +08:00
|
|
|
// The id of actived external storage.
|
|
|
|
optional int32 actived_external_storage_id = 2;
|
2024-04-10 23:01:01 +08:00
|
|
|
// The local storage path for STORAGE_TYPE_LOCAL.
|
|
|
|
// e.g. assets/{timestamp}_{filename}
|
2024-04-12 08:32:54 +08:00
|
|
|
string local_storage_path = 3;
|
2024-04-10 23:01:01 +08:00
|
|
|
// The max upload size in megabytes.
|
2024-04-12 08:32:54 +08:00
|
|
|
int64 upload_size_limit_mb = 4;
|
2024-04-10 23:01:01 +08:00
|
|
|
|
|
|
|
enum StorageType {
|
|
|
|
STORAGE_TYPE_UNSPECIFIED = 0;
|
|
|
|
// STORAGE_TYPE_DATABASE is the database storage type.
|
|
|
|
STORAGE_TYPE_DATABASE = 1;
|
|
|
|
// STORAGE_TYPE_LOCAL is the local storage type.
|
|
|
|
STORAGE_TYPE_LOCAL = 2;
|
|
|
|
// STORAGE_TYPE_EXTERNAL is the external storage type.
|
|
|
|
STORAGE_TYPE_EXTERNAL = 3;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
message WorkspaceMemoRelatedSetting {
|
|
|
|
// disallow_public_share disallows set memo as public visible.
|
|
|
|
bool disallow_public_visible = 1;
|
|
|
|
// display_with_update_time orders and displays memo with update time.
|
|
|
|
bool display_with_update_time = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message WorkspaceTelegramIntegrationSetting {
|
|
|
|
// bot_token is the telegram bot token.
|
|
|
|
string bot_token = 1;
|
|
|
|
}
|