File: wiki.proto

package info (click to toggle)
golang-gitaly-proto 1.37.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 372 kB
  • sloc: ruby: 216; makefile: 93
file content (204 lines) | stat: -rw-r--r-- 4,894 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
syntax = "proto3";

import "shared.proto";

package gitaly;

option go_package = "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb";

service WikiService {
  rpc WikiGetPageVersions(WikiGetPageVersionsRequest) returns (stream WikiGetPageVersionsResponse) {
    option (op_type).op = ACCESSOR;
  }
  rpc WikiWritePage(stream WikiWritePageRequest) returns (WikiWritePageResponse) {
    option (op_type) = {
      op: MUTATOR
      target_repository_field: "1"
    };
  }
  rpc WikiUpdatePage(stream WikiUpdatePageRequest) returns (WikiUpdatePageResponse) {
    option (op_type) = {
      op: MUTATOR
      target_repository_field: "1"
    };
  }
  rpc WikiDeletePage(WikiDeletePageRequest) returns (WikiDeletePageResponse) {
    option (op_type) = {
      op: MUTATOR
      target_repository_field: "1"
    };
  }
  // WikiFindPage returns a stream because the page's raw_data field may be arbitrarily large.
  rpc WikiFindPage(WikiFindPageRequest) returns (stream WikiFindPageResponse) {
    option (op_type).op = ACCESSOR;
  }
  rpc WikiFindFile(WikiFindFileRequest) returns (stream WikiFindFileResponse) {
    option (op_type).op = ACCESSOR;
  }
  rpc WikiGetAllPages(WikiGetAllPagesRequest) returns (stream WikiGetAllPagesResponse) {
    option (op_type).op = ACCESSOR;
  }
  rpc WikiListPages(WikiListPagesRequest) returns (stream WikiListPagesResponse) {
    option (op_type).op = ACCESSOR;
  }
  rpc WikiGetFormattedData(WikiGetFormattedDataRequest) returns (stream WikiGetFormattedDataResponse) {
    option (op_type).op = ACCESSOR;
  }
}

message WikiCommitDetails {
  bytes name = 1;
  bytes email = 2;
  bytes message = 3;
  int32 user_id = 4;
  bytes user_name = 5;
}

message WikiPageVersion {
  GitCommit commit = 1;
  string format = 2;
}

message WikiPage {
  // These fields are only present in the first message of a WikiPage stream
  WikiPageVersion version = 1;
  string format = 2;
  bytes title = 3;
  string url_path = 4;
  bytes path = 5;
  bytes name = 6;
  bool historical = 7;

  // This field is present in all messages of a WikiPage stream
  bytes raw_data = 8;
}

message WikiGetPageVersionsRequest {
  Repository repository = 1;
  bytes page_path = 2;

  int32 page = 3;
  int32 per_page = 4;
}

message WikiGetPageVersionsResponse {
  repeated WikiPageVersion versions = 1;
}

// This message is sent in a stream because the 'content' field may be large.
message WikiWritePageRequest {
  // These following fields are only present in the first message.
  Repository repository = 1;
  bytes name = 2;
  string format = 3;
  WikiCommitDetails commit_details = 4;
  // This field is present in all messages.
  bytes content = 5;
}

message WikiWritePageResponse {
  bytes duplicate_error = 1;
}

message WikiUpdatePageRequest {
  // There fields are only present in the first message of the stream
  Repository repository = 1;
  bytes page_path = 2;
  bytes title = 3;
  string format = 4;
  WikiCommitDetails commit_details = 5;

  // This field is present in all messages
  bytes content = 6;
}

message WikiUpdatePageResponse {
  bytes error = 1;
}

message WikiDeletePageRequest {
  Repository repository = 1;
  bytes page_path = 2;
  WikiCommitDetails commit_details = 3;
}

message WikiDeletePageResponse {}

message WikiFindPageRequest {
  Repository repository = 1;
  bytes title = 2;
  bytes revision = 3;
  bytes directory = 4;
}

// WikiFindPageResponse is a stream because we need multiple WikiPage
// messages to send the raw_data field.
message WikiFindPageResponse {
  WikiPage page = 1;
}

message WikiFindFileRequest {
  Repository repository = 1;
  bytes name = 2;
  // Optional: revision
  bytes revision = 3;
}

message WikiFindFileResponse {
  // If 'name' is empty, the file was not found.
  bytes name = 1;
  string mime_type = 2;
  bytes raw_data = 3;
  bytes path = 4;
}

message WikiGetAllPagesRequest {
  Repository repository = 1;
  // Passing 0 means no limit is applied
  uint32 limit = 2;
  bool direction_desc = 3;

  enum SortBy {
    TITLE = 0;
    CREATED_AT = 1;
  }
  SortBy sort = 4;
}

// The WikiGetAllPagesResponse stream is a concatenation of WikiPage streams
message WikiGetAllPagesResponse {
  WikiPage page = 1;
  // When end_of_page is true it signals a change of page for the next Response message (if any)
  bool end_of_page = 2;
}

message WikiGetFormattedDataRequest {
  Repository repository = 1;
  bytes title = 2;
  bytes revision = 3;
  bytes directory = 4;
}

message WikiGetFormattedDataResponse {
  bytes data = 1;
}

message WikiListPagesRequest {
  Repository repository = 1;
  // Passing 0 means no limit is applied
  uint32 limit = 2;
  bool direction_desc = 3;

  enum SortBy {
    TITLE = 0;
    CREATED_AT = 1;
  }
  SortBy sort = 4;

  uint32 offset = 5;
}

// The WikiListPagesResponse stream is a concatenation of WikiPage streams without content
message WikiListPagesResponse {
  WikiPage page = 1;
}