field.proto 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. syntax = "proto3";
  2. message Field {
  3. string id = 1;
  4. string name = 2;
  5. string desc = 3;
  6. FieldType field_type = 4;
  7. bool frozen = 5;
  8. bool visibility = 6;
  9. int32 width = 7;
  10. bool is_primary = 8;
  11. }
  12. message FieldOrder {
  13. string field_id = 1;
  14. }
  15. message GridFieldChangeset {
  16. string grid_id = 1;
  17. repeated IndexField inserted_fields = 2;
  18. repeated FieldOrder deleted_fields = 3;
  19. repeated Field updated_fields = 4;
  20. }
  21. message IndexField {
  22. Field field = 1;
  23. int32 index = 2;
  24. }
  25. message GetEditFieldContextPayload {
  26. string grid_id = 1;
  27. oneof one_of_field_id { string field_id = 2; };
  28. FieldType field_type = 3;
  29. }
  30. message EditFieldPayload {
  31. string grid_id = 1;
  32. string field_id = 2;
  33. FieldType field_type = 3;
  34. bool create_if_not_exist = 4;
  35. }
  36. message FieldTypeOptionContext {
  37. string grid_id = 1;
  38. Field grid_field = 2;
  39. bytes type_option_data = 3;
  40. }
  41. message FieldTypeOptionData {
  42. string grid_id = 1;
  43. Field field = 2;
  44. bytes type_option_data = 3;
  45. }
  46. message RepeatedField {
  47. repeated Field items = 1;
  48. }
  49. message RepeatedFieldOrder {
  50. repeated FieldOrder items = 1;
  51. }
  52. message InsertFieldPayload {
  53. string grid_id = 1;
  54. Field field = 2;
  55. bytes type_option_data = 3;
  56. oneof one_of_start_field_id { string start_field_id = 4; };
  57. }
  58. message UpdateFieldTypeOptionPayload {
  59. string grid_id = 1;
  60. string field_id = 2;
  61. bytes type_option_data = 3;
  62. }
  63. message QueryFieldPayload {
  64. string grid_id = 1;
  65. RepeatedFieldOrder field_orders = 2;
  66. }
  67. message FieldChangesetPayload {
  68. string field_id = 1;
  69. string grid_id = 2;
  70. oneof one_of_name { string name = 3; };
  71. oneof one_of_desc { string desc = 4; };
  72. oneof one_of_field_type { FieldType field_type = 5; };
  73. oneof one_of_frozen { bool frozen = 6; };
  74. oneof one_of_visibility { bool visibility = 7; };
  75. oneof one_of_width { int32 width = 8; };
  76. oneof one_of_type_option_data { bytes type_option_data = 9; };
  77. }
  78. enum FieldType {
  79. RichText = 0;
  80. Number = 1;
  81. DateTime = 2;
  82. SingleSelect = 3;
  83. MultiSelect = 4;
  84. Checkbox = 5;
  85. URL = 6;
  86. }