1
+ syntax = "proto3" ;
2
+ option java_package = "io.keploy.grpc.stubs" ;
3
+ option go_package = "go.keploy.io/server/grpc/regression" ;
4
+ package services ;
5
+
6
+ message Dependency {
7
+ string Name = 1 ;
8
+ string Type = 2 ;
9
+ map <string , string > Meta = 3 ;
10
+ repeated DataBytes Data = 4 ;
11
+ }
12
+
13
+ message DataBytes {
14
+ bytes Bin = 1 ;
15
+ }
16
+
17
+ message TestCaseReq {
18
+ int64 Captured = 1 ;
19
+ string AppID = 2 ;
20
+ string URI = 3 ;
21
+ HttpReq HttpReq = 4 ;
22
+ HttpResp HttpResp = 5 ;
23
+ repeated Dependency Dependency = 6 ;
24
+ string TestCasePath = 7 ;
25
+ string MockPath = 8 ;
26
+ repeated Mock Mocks = 9 ;
27
+ repeated string Remove = 10 ;
28
+ map <string , string > Replace = 11 ;
29
+ string Type = 12 ;
30
+ GrpcReq GrpcReq = 13 ;
31
+ GrpcResp GrpcResp = 14 ;
32
+ }
33
+
34
+
35
+ message TestReq {
36
+ string ID = 1 ;
37
+ string AppID = 2 ;
38
+ string RunID = 3 ;
39
+ HttpResp Resp = 4 ;
40
+ string TestCasePath = 5 ;
41
+ string MockPath = 6 ;
42
+ string Type = 7 ;
43
+ GrpcResp GrpcResp = 8 ;
44
+ }
45
+
46
+ message TestCase {
47
+ string id = 1 ;
48
+ int64 created = 2 ;
49
+ int64 updated = 3 ;
50
+ int64 captured = 4 ;
51
+ string CID = 5 ;
52
+ string appID = 6 ;
53
+ string URI = 7 ;
54
+ HttpReq HttpReq = 8 ;
55
+ HttpResp HttpResp = 9 ;
56
+ repeated Dependency Deps = 10 ;
57
+ map <string , StrArr > allKeys = 11 ;
58
+ map <string , StrArr > anchors = 12 ;
59
+ repeated string noise = 13 ;
60
+ repeated Mock Mocks = 14 ;
61
+ }
62
+
63
+ message Method {
64
+ string Method = 1 ;
65
+ }
66
+ message HttpReq {
67
+ string Method = 1 ;
68
+ int64 ProtoMajor = 2 ;
69
+ int64 ProtoMinor = 3 ;
70
+ string URL = 4 ;
71
+ map <string , string > URLParams = 5 ;
72
+ map <string , StrArr > Header = 6 ;
73
+ string Body = 7 [deprecated = true ];
74
+ bytes BodyData = 10 ;
75
+ string Binary = 8 ;
76
+ repeated FormData Form = 9 ;
77
+ }
78
+
79
+ //for multipart request
80
+ message FormData {
81
+ string Key = 1 ; //partName
82
+ repeated string Values = 2 ;
83
+ repeated string Paths = 3 ;
84
+ }
85
+
86
+ message StrArr {
87
+ repeated string Value = 1 ;
88
+ }
89
+
90
+ message HttpResp {
91
+ int64 StatusCode = 1 ;
92
+ map <string , StrArr > Header = 2 ;
93
+ string Body = 3 [deprecated = true ];
94
+ bytes BodyData = 8 ;
95
+ string StatusMessage = 4 ;
96
+ int64 ProtoMajor = 5 ;
97
+ int64 ProtoMinor = 6 ;
98
+ string Binary = 7 ;
99
+ }
100
+
101
+ message endRequest {
102
+ string status = 1 ;
103
+ string id = 2 ;
104
+ }
105
+
106
+ message endResponse {
107
+ string message = 1 ;
108
+ }
109
+
110
+ message startRequest {
111
+ string total = 1 ;
112
+ string app = 2 ;
113
+ string TestCasePath = 3 ;
114
+ string MockPath = 4 ;
115
+ }
116
+
117
+ message startResponse {
118
+ string id = 1 ;
119
+ }
120
+
121
+ message getTCRequest {
122
+ string id = 1 ;
123
+ string app = 2 ;
124
+ }
125
+ message getTCSRequest {
126
+ string app = 1 ;
127
+ string offset = 2 ;
128
+ string limit = 3 ;
129
+ string TestCasePath = 4 ;
130
+ string MockPath = 5 ;
131
+ }
132
+ message getTCSResponse {
133
+ repeated TestCase tcs = 1 ;
134
+ bool eof = 2 ;
135
+ }
136
+ message postTCResponse {
137
+ map <string , string > tcsId = 1 ;
138
+ }
139
+ message deNoiseResponse {
140
+ string message = 1 ;
141
+ }
142
+ message testResponse {
143
+ map <string , bool > pass = 1 ;
144
+ }
145
+ message GrpcReq {
146
+ string Body = 1 ;
147
+ string Method = 2 ;
148
+ }
149
+ message GrpcResp {
150
+ string Body = 1 ;
151
+ string Err = 2 ;
152
+ }
153
+
154
+ message Mock {
155
+ message Request {
156
+ string Method = 1 ;
157
+ int64 ProtoMajor = 2 ;
158
+ int64 ProtoMinor = 3 ;
159
+ string URL = 4 ;
160
+ map <string , StrArr > Header = 5 ;
161
+ string Body = 6 ;
162
+ }
163
+ message Object {
164
+ string Type = 1 ;
165
+ bytes Data = 2 ;
166
+ }
167
+
168
+ string Version = 1 ;
169
+ string Name = 2 ;
170
+ string Kind = 3 ;
171
+ message SpecSchema {
172
+ map <string , string > Metadata = 1 ;
173
+ repeated Object Objects = 2 ;
174
+ HttpReq Req = 3 ;
175
+ HttpResp Res = 4 ;
176
+ repeated string Mocks = 5 ;
177
+ map <string , StrArr > Assertions = 6 ;
178
+ int64 Created = 7 ;
179
+ // for sql
180
+ string Type = 8 ;
181
+ optional Table Table = 9 ;
182
+ int64 Int = 10 ; // change it to rows commited
183
+ repeated string Err = 11 ;
184
+ GrpcReq GrpcRequest = 12 ;
185
+ GrpcResp GrpcResp = 13 ;
186
+ }
187
+ SpecSchema Spec = 4 ;
188
+ }
189
+
190
+ message Table {
191
+ repeated SqlCol Cols = 1 ;
192
+ repeated string Rows = 2 ;
193
+ }
194
+
195
+ message SqlCol {
196
+ string Name = 1 ;
197
+ string Type = 2 ;
198
+ //optional fields
199
+ int64 Precision = 3 ;
200
+ int64 Scale = 4 ;
201
+ }
202
+
203
+ message PutMockReq {
204
+ Mock Mock = 1 ;
205
+ string Path = 2 ;
206
+ repeated string Remove = 3 ;
207
+ map <string , string > Replace = 4 ;
208
+ }
209
+
210
+ message PutMockResp {
211
+ int64 Inserted = 1 ;
212
+ }
213
+
214
+ message GetMockReq {
215
+ string Path = 1 ;
216
+ string Name = 2 ;
217
+ }
218
+
219
+ message getMockResp {
220
+ repeated Mock Mocks = 1 ;
221
+ }
222
+
223
+ message StartMockReq {
224
+ string Path = 1 ;
225
+ string Mode = 2 ;
226
+ bool OverWrite = 3 ;
227
+ string Name = 4 ;
228
+ }
229
+
230
+ message StartMockResp {
231
+ bool Exists = 1 ;
232
+ }
233
+
234
+ service RegressionService {
235
+ rpc End (endRequest ) returns (endResponse );
236
+ rpc Start (startRequest ) returns (startResponse );
237
+ rpc GetTC (getTCRequest ) returns (TestCase );
238
+ rpc GetTCS (getTCSRequest ) returns (getTCSResponse );
239
+ rpc PostTC (TestCaseReq ) returns (postTCResponse );
240
+ rpc DeNoise (TestReq ) returns (deNoiseResponse );
241
+ rpc Test (TestReq ) returns (testResponse );
242
+ rpc PutMock (PutMockReq ) returns (PutMockResp );
243
+ rpc GetMocks (GetMockReq ) returns (getMockResp );
244
+ rpc StartMocking (StartMockReq ) returns (StartMockResp );
245
+ }
0 commit comments