workspace_setting.proto 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. syntax = "proto3";
  2. package memos.store;
  3. option go_package = "gen/store";
  4. enum WorkspaceSettingKey {
  5. WORKSPACE_SETTING_KEY_UNSPECIFIED = 0;
  6. // BASIC is the key for basic settings.
  7. BASIC = 1;
  8. // GENERAL is the key for general settings.
  9. GENERAL = 2;
  10. // STORAGE is the key for storage settings.
  11. STORAGE = 3;
  12. // MEMO_RELATED is the key for memo related settings.
  13. MEMO_RELATED = 4;
  14. }
  15. message WorkspaceSetting {
  16. WorkspaceSettingKey key = 1;
  17. oneof value {
  18. WorkspaceBasicSetting basic_setting = 2;
  19. WorkspaceGeneralSetting general_setting = 3;
  20. WorkspaceStorageSetting storage_setting = 4;
  21. WorkspaceMemoRelatedSetting memo_related_setting = 5;
  22. }
  23. }
  24. message WorkspaceBasicSetting {
  25. string secret_key = 1;
  26. }
  27. message WorkspaceGeneralSetting {
  28. // additional_script is the additional script.
  29. string additional_script = 3;
  30. // additional_style is the additional style.
  31. string additional_style = 4;
  32. // custom_profile is the custom profile.
  33. WorkspaceCustomProfile custom_profile = 5;
  34. }
  35. message WorkspaceCustomProfile {
  36. string title = 1;
  37. string description = 2;
  38. string logo_url = 3;
  39. string locale = 4;
  40. string appearance = 5;
  41. }
  42. message WorkspaceStorageSetting {
  43. enum StorageType {
  44. STORAGE_TYPE_UNSPECIFIED = 0;
  45. // STORAGE_TYPE_DATABASE is the database storage type.
  46. DATABASE = 1;
  47. // STORAGE_TYPE_LOCAL is the local storage type.
  48. LOCAL = 2;
  49. // STORAGE_TYPE_S3 is the S3 storage type.
  50. S3 = 3;
  51. }
  52. // storage_type is the storage type.
  53. StorageType storage_type = 1;
  54. // The template of file path.
  55. // e.g. assets/{timestamp}_{filename}
  56. string filepath_template = 2;
  57. // The max upload size in megabytes.
  58. int64 upload_size_limit_mb = 3;
  59. // The S3 config.
  60. StorageS3Config s3_config = 4;
  61. }
  62. // Reference: https://developers.cloudflare.com/r2/examples/aws/aws-sdk-go/
  63. message StorageS3Config {
  64. string access_key_id = 1;
  65. string access_key_secret = 2;
  66. string endpoint = 3;
  67. string region = 4;
  68. string bucket = 5;
  69. }
  70. message WorkspaceMemoRelatedSetting {
  71. // disallow_public_share disallows set memo as public visible.
  72. bool disallow_public_visible = 1;
  73. // display_with_update_time orders and displays memo with update time.
  74. bool display_with_update_time = 2;
  75. // content_length_limit is the limit of content length. Unit is byte.
  76. int32 content_length_limit = 3;
  77. // enable_auto_compact enables auto compact for large content.
  78. bool enable_auto_compact = 4;
  79. // enable_double_click_edit enables editing on double click.
  80. bool enable_double_click_edit = 5;
  81. // enable_link_preview enables links preview.
  82. bool enable_link_preview = 6;
  83. }