-
Notifications
You must be signed in to change notification settings - Fork 12
/
api.proto
271 lines (240 loc) · 9.12 KB
/
api.proto
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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
/*----------------------------------------------------------------
* Copyright (c) ThoughtWorks, Inc.
* Licensed under the Apache License, Version 2.0
* See LICENSE in the project root for license information.
*----------------------------------------------------------------*/
// The comments are exported to Markdown, hence they may contain markdown syntax and cross-refs.
syntax = "proto3";
package gauge.messages;
import "spec.proto";
option csharp_namespace = "Gauge.Messages";
option java_package = "com.thoughtworks.gauge";
option go_package = "github.com/getgauge/gauge-proto/go/gauge_messages";
/// Request to get the Root Directory of the project
message GetProjectRootRequest {
}
/// Response of GetProjectRootRequest.
message GetProjectRootResponse {
/// Holds the absolute path of the Project Root directory.
string projectRoot = 1;
}
/// Request to get the Root Directory of the Gauge installation
message GetInstallationRootRequest {
}
/// Response of GetInstallationRootRequest
message GetInstallationRootResponse {
/// Holds the absolute path of the Gauge installation directory
string installationRoot = 1;
}
/// Request to get all Steps in the project
message GetAllStepsRequest {
}
/// Response to GetAllStepsRequest
message GetAllStepsResponse {
/// Holds a collection of Steps that are defined in the project.
repeated gauge.messages.ProtoStepValue allSteps = 1;
}
/// Request to get all Specs in the project
message SpecsRequest {
repeated string specs = 1;
}
/// Response to GetAllSpecsRequest
message SpecsResponse {
/// Holds a collection of Spec details.
repeated SpecDetail details = 1;
message SpecDetail {
/// Holds a collection of Specs that are defined in the project.
gauge.messages.ProtoSpec spec = 1;
/// Holds a collection of parse errors present in the above spec.
repeated Error parseErrors = 2;
}
}
/// Request to get all Concepts in the project
message GetAllConceptsRequest {
}
/// Response to GetAllConceptsResponse
message GetAllConceptsResponse {
/// Holds a collection of Concepts that are defined in the project.
repeated ConceptInfo concepts = 1;
}
/// Details of a Concept
message ConceptInfo {
/// The text that defines a concept
gauge.messages.ProtoStepValue stepValue = 1;
/// The absolute path to the file that contains the Concept
string filepath = 2;
/// The line number in the file where the concept is defined.
int32 lineNumber = 3;
}
/// Request to get a Step Value.
message GetStepValueRequest {
/// The text of the Step.
string stepText = 1;
/// Flag to indicate if the Step has an inline table.
bool hasInlineTable = 2;
}
/// Response to GetStepValueRequest
message GetStepValueResponse {
/// The Step corresponding to the request provided.
gauge.messages.ProtoStepValue stepValue = 1;
}
/// Request to get the location of language plugin's Lib directory
message GetLanguagePluginLibPathRequest {
/// The language to locate the lib directory for.
string language = 1;
}
/// Response to GetLanguagePluginLibPathRequest
message GetLanguagePluginLibPathResponse {
/// Absolute path to the Lib directory of the language.
string path = 1;
}
/// A generic failure response
message ErrorResponse {
/// Actual error message
string error = 1;
}
/// Request to perform a Refactor
message PerformRefactoringRequest {
/// Step to refactor
string oldStep = 1;
/// Change to be made
string newStep = 2;
}
/// Response to PerformRefactoringRequest
message PerformRefactoringResponse {
/// Flag indicating Success
bool success = 1;
/// Error message if the refactoring was unsuccessful.
repeated string errors = 2;
/// Collection of files that were changed as part of the Refactoring.
repeated string filesChanged = 3;
}
/// Request to perform Extract to Concept refactoring
message ExtractConceptRequest {
/// The Concept name given by the user
step conceptName = 1;
/// steps to extract
repeated step steps = 2;
/// Flag indicating if refactoring should be done across project
bool changeAcrossProject = 3;
/// The concept filename in which extracted concept will be added
string conceptFileName = 4;
/// Info related to selected text, only if changeAcrossProject is false
textInfo selectedTextInfo = 5;
}
message textInfo {
/// The filename from where concept is being extracted
string fileName = 1;
/// storing the starting and ending line number of selected text
int32 startingLineNo = 2;
int32 endLineNo = 3;
}
message step {
/// name of the step
string name = 1;
/// table present in step as parameter
string table = 2;
/// name of table in concept heading, if it comes as a param to concept
string paramTableName = 3;
}
/// Response to perform Extract to Concept refactoring
message ExtractConceptResponse {
/// Flag indicating Success
bool isSuccess = 1;
/// Error message if the refactoring was unsuccessful.
string error = 2;
/// Collection of files that were changed as part of the Refactoring.
repeated string filesChanged = 3;
}
/// Request to format spec files
message FormatSpecsRequest {
/// Specs to be formatted
repeated string specs = 1;
}
/// Response on formatting spec files
message FormatSpecsResponse {
/// Errors occurred on formatting
repeated string errors = 1;
/// Warnings occurred on formatting
repeated string warnings = 2;
}
/// Response when a API message request is not supported.
message UnsupportedApiMessageResponse {
}
/// A generic message composing of all possible operations.
/// One of the Request/Response fields will have value, depending on the MessageType set.
message APIMessage {
enum APIMessageType {
GetProjectRootRequest = 0;
GetProjectRootResponse = 1;
GetInstallationRootRequest = 2;
GetInstallationRootResponse = 3;
GetAllStepsRequest = 4;
GetAllStepResponse = 5;
SpecsRequest = 6;
SpecsResponse = 7;
GetStepValueRequest = 8;
GetStepValueResponse = 9;
GetLanguagePluginLibPathRequest = 10;
GetLanguagePluginLibPathResponse = 11;
ErrorResponse = 12;
GetAllConceptsRequest = 13;
GetAllConceptsResponse = 14;
PerformRefactoringRequest = 15;
PerformRefactoringResponse = 16;
ExtractConceptRequest = 17;
ExtractConceptResponse = 18;
FormatSpecsRequest = 19;
FormatSpecsResponse = 20;
UnsupportedApiMessageResponse = 21;
}
/// Type of API call being made
APIMessageType messageType = 1;
/// A unique id to represent this message. A response to the message should copy over this value.
/// This is used to synchronize messages & responses
int64 messageId = 2;
/// [GetProjectRootRequest](#gauge.messages.GetProjectRootRequest)
GetProjectRootRequest projectRootRequest = 3;
/// [GetProjectRootResponse](#gauge.messages.GetProjectRootResponse)
GetProjectRootResponse projectRootResponse = 4;
/// [GetInstallationRootRequest](#gauge.messages.GetInstallationRootRequest)
GetInstallationRootRequest installationRootRequest = 5;
/// [GetInstallationRootResponse](#gauge.messages.GetInstallationRootResponse)
GetInstallationRootResponse installationRootResponse = 6;
/// [GetAllStepsRequest](#gauge.messages.GetAllStepsRequest)
GetAllStepsRequest allStepsRequest = 7;
/// [GetAllStepsResponse](#gauge.messages.GetAllStepsResponse)
GetAllStepsResponse allStepsResponse = 8;
/// [GetAllSpecsRequest](#gauge.messages.GetAllSpecsRequest)
SpecsRequest specsRequest = 9;
/// [GetAllSpecsResponse](#gauge.messages.GetAllSpecsResponse)
SpecsResponse specsResponse = 10;
/// [GetStepValueRequest](#gauge.messages.GetStepValueRequest)
GetStepValueRequest stepValueRequest = 11;
/// [GetStepValueResponse](#gauge.messages.GetStepValueResponse)
GetStepValueResponse stepValueResponse = 12;
/// [GetLanguagePluginLibPathRequest](#gauge.messages.GetLanguagePluginLibPathRequest)
GetLanguagePluginLibPathRequest libPathRequest = 13;
/// [GetLanguagePluginLibPathResponse](#gauge.messages.GetLanguagePluginLibPathResponse)
GetLanguagePluginLibPathResponse libPathResponse = 14;
/// [ErrorResponse](#gauge.messages.ErrorResponse)
ErrorResponse error = 15;
/// [GetAllConceptsRequest](#gauge.messages.GetAllConceptsRequest)
GetAllConceptsRequest allConceptsRequest = 16;
/// [GetAllConceptsResponse](#gauge.messages.GetAllConceptsResponse)
GetAllConceptsResponse allConceptsResponse = 17;
/// [PerformRefactoringRequest](#gauge.messages.PerformRefactoringRequest)
PerformRefactoringRequest performRefactoringRequest = 18;
/// [PerformRefactoringResponse](#gauge.messages.PerformRefactoringResponse)
PerformRefactoringResponse performRefactoringResponse = 19;
/// [ExtractConceptRequest](#gauge.messages.ExtractConceptRequest)
ExtractConceptRequest extractConceptRequest = 20;
/// [ExtractConceptResponse](#gauge.messages.ExtractConceptResponse)
ExtractConceptResponse extractConceptResponse = 21;
/// [FormatSpecsRequest] (#gauge.messages.FormatSpecsRequest)
FormatSpecsRequest formatSpecsRequest = 22;
/// [FormatSpecsResponse] (#gauge.messages.FormatSpecsResponse)
FormatSpecsResponse formatSpecsResponse = 23;
/// [UnsupportedApiMessageResponse] (#gauge.messages.UnsupportedApiMessageResponse)
UnsupportedApiMessageResponse unsupportedApiMessageResponse= 24;
}