2018-06-13 01:15:36 +03:00
|
|
|
syntax = "proto3";
|
2018-07-04 00:21:46 +03:00
|
|
|
|
|
|
|
package github.semantic;
|
|
|
|
|
2018-07-18 01:06:42 +03:00
|
|
|
import "ruby-terms.proto";
|
|
|
|
import "ruby-diffs.proto";
|
|
|
|
import "json-terms.proto";
|
|
|
|
import "typescript-terms.proto";
|
2018-07-24 01:11:24 +03:00
|
|
|
import "typescript-diffs.proto";
|
2018-07-24 00:39:08 +03:00
|
|
|
import "python-terms.proto";
|
|
|
|
import "python-diffs.proto";
|
2018-06-13 01:15:36 +03:00
|
|
|
import "types.proto";
|
2018-06-26 17:48:34 +03:00
|
|
|
import "error_details.proto";
|
|
|
|
|
2018-06-26 17:50:38 +03:00
|
|
|
option java_package = "com.github.semantic.analysis";
|
|
|
|
option go_package = "github.com/semantic/analysis/;analysis";
|
2018-07-04 00:21:46 +03:00
|
|
|
|
2018-06-13 01:15:36 +03:00
|
|
|
|
2018-06-13 01:29:41 +03:00
|
|
|
// Semantic's CodeAnalysis service provides endpoints for parsing, analyzing, and
|
2018-06-13 01:15:36 +03:00
|
|
|
// comparing source code.
|
|
|
|
service CodeAnalysis {
|
|
|
|
// Parsing
|
|
|
|
//
|
2018-06-13 01:29:41 +03:00
|
|
|
// Parse source code blobs and return abstract syntax trees.
|
2018-07-03 18:33:12 +03:00
|
|
|
rpc ParseTree (ParseTreeRequest) returns (ParseTreeResponse);
|
2018-06-13 01:15:36 +03:00
|
|
|
|
|
|
|
// Diffing
|
|
|
|
//
|
2018-06-13 01:29:41 +03:00
|
|
|
// Summarize an AST diff of source blobs.
|
2018-06-13 01:15:36 +03:00
|
|
|
rpc SummarizeDiff (SummarizeDiffRequest) returns (SummarizeDiffResponse);
|
2018-07-13 19:37:16 +03:00
|
|
|
// Diff the ASTs of source blobs
|
|
|
|
rpc DiffTree (DiffTreeRequest) returns (DiffTreeResponse);
|
2018-06-13 01:15:36 +03:00
|
|
|
|
|
|
|
// Analyzing
|
|
|
|
//
|
|
|
|
// Calculate an import graph for a project.
|
2018-06-13 21:10:18 +03:00
|
|
|
rpc GraphImports (ImportGraphRequest) returns (ImportGraphResponse);
|
|
|
|
|
2018-08-30 20:18:49 +03:00
|
|
|
// Calculate a call graph for a project.
|
2018-07-17 17:15:04 +03:00
|
|
|
rpc GraphCalls (CallGraphRequest) returns (CallGraphResponse);
|
2018-06-13 01:15:36 +03:00
|
|
|
|
2018-08-30 20:18:49 +03:00
|
|
|
// Status and Health
|
|
|
|
//
|
2018-06-13 01:29:41 +03:00
|
|
|
// Check health & status of the service.
|
2018-06-13 01:15:36 +03:00
|
|
|
rpc CheckHealth (HealthCheckRequest) returns (HealthCheckResponse);
|
|
|
|
}
|
|
|
|
|
|
|
|
message ParseTreeRequest {
|
|
|
|
repeated Blob blobs = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ParseTreeResponse {
|
2018-06-30 00:11:23 +03:00
|
|
|
oneof response_type {
|
2018-07-02 18:29:44 +03:00
|
|
|
RubyResponse ruby = 1;
|
2018-07-02 18:37:49 +03:00
|
|
|
JSONResponse json = 2;
|
2018-07-02 19:43:31 +03:00
|
|
|
TypeScriptResponse typescript = 3;
|
2018-07-24 00:39:08 +03:00
|
|
|
PythonResponse python = 4;
|
2018-06-30 00:11:23 +03:00
|
|
|
}
|
2018-08-24 20:11:38 +03:00
|
|
|
DebugInfo error_info = 5;
|
2018-06-30 00:11:23 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
message RubyResponse {
|
2018-07-18 01:06:42 +03:00
|
|
|
repeated ruby_terms.RubyTerm terms = 1;
|
2018-08-30 00:29:32 +03:00
|
|
|
repeated DebugInfo errors = 2;
|
2018-06-14 22:56:37 +03:00
|
|
|
}
|
|
|
|
|
2018-07-02 18:29:44 +03:00
|
|
|
message JSONResponse {
|
2018-07-18 01:06:42 +03:00
|
|
|
repeated json_terms.JSONTerm terms = 1;
|
2018-08-30 20:18:49 +03:00
|
|
|
repeated DebugInfo errors = 2;
|
2018-07-02 18:29:44 +03:00
|
|
|
}
|
|
|
|
|
2018-07-02 19:43:31 +03:00
|
|
|
message TypeScriptResponse {
|
2018-07-18 01:06:42 +03:00
|
|
|
repeated typescript_terms.TypeScriptTerm terms = 1;
|
2018-08-30 20:18:49 +03:00
|
|
|
repeated DebugInfo errors = 2;
|
2018-07-02 19:43:31 +03:00
|
|
|
}
|
|
|
|
|
2018-07-24 00:39:08 +03:00
|
|
|
message PythonResponse {
|
|
|
|
repeated python_terms.PythonTerm terms = 1;
|
2018-08-30 20:18:49 +03:00
|
|
|
repeated DebugInfo errors = 2;
|
2018-07-24 00:39:08 +03:00
|
|
|
}
|
|
|
|
|
2018-06-13 01:15:36 +03:00
|
|
|
message SummarizeDiffRequest {
|
|
|
|
repeated BlobPair blobPairs = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message SummarizeDiffResponse {
|
|
|
|
repeated DiffSummary changes = 1;
|
|
|
|
repeated ParseError errors = 2;
|
2018-08-23 01:41:27 +03:00
|
|
|
DebugInfo error_info = 3;
|
2018-06-13 01:15:36 +03:00
|
|
|
}
|
|
|
|
|
2018-07-13 19:37:16 +03:00
|
|
|
message DiffTreeRequest {
|
|
|
|
repeated BlobPair blobPairs = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message DiffTreeResponse {
|
|
|
|
oneof response_type {
|
|
|
|
RubyDiffResponse ruby = 1;
|
2018-07-24 00:39:08 +03:00
|
|
|
PythonDiffResponse python = 2;
|
2018-07-24 01:11:24 +03:00
|
|
|
TypeScriptDiffResponse typescript = 3;
|
2018-07-13 19:37:16 +03:00
|
|
|
}
|
2018-08-24 20:11:38 +03:00
|
|
|
DebugInfo error_info = 4;
|
2018-07-13 19:37:16 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
message RubyDiffResponse {
|
2018-07-18 01:06:42 +03:00
|
|
|
repeated ruby_diffs.RubyDiff diffs = 1;
|
2018-07-13 19:37:16 +03:00
|
|
|
}
|
|
|
|
|
2018-07-24 00:39:08 +03:00
|
|
|
message PythonDiffResponse {
|
|
|
|
repeated python_diffs.PythonDiff diffs = 1;
|
|
|
|
}
|
|
|
|
|
2018-07-24 01:11:24 +03:00
|
|
|
message TypeScriptDiffResponse {
|
|
|
|
repeated typescript_diffs.TypeScriptDiff diffs = 1;
|
|
|
|
}
|
|
|
|
|
2018-07-17 17:15:04 +03:00
|
|
|
message CallGraphRequest {
|
|
|
|
Project project = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message CallGraphResponse {
|
2018-07-17 18:35:03 +03:00
|
|
|
AdjacencyList graph = 1;
|
2018-07-17 17:15:04 +03:00
|
|
|
DebugInfo error_info = 2;
|
|
|
|
}
|
|
|
|
|
2018-06-13 21:10:18 +03:00
|
|
|
message ImportGraphRequest {
|
|
|
|
Project project = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ImportGraphResponse {
|
2018-07-17 18:35:03 +03:00
|
|
|
AdjacencyList graph = 1;
|
2018-06-26 17:48:34 +03:00
|
|
|
DebugInfo error_info = 2;
|
2018-06-13 21:10:18 +03:00
|
|
|
}
|
|
|
|
|
2018-06-13 01:15:36 +03:00
|
|
|
message DiffSummary {
|
|
|
|
string term = 1;
|
|
|
|
string name = 2;
|
|
|
|
Span span = 3;
|
|
|
|
string change = 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ParseError {
|
|
|
|
string error = 1;
|
|
|
|
Span span = 2;
|
|
|
|
string language = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
message HealthCheckRequest {
|
|
|
|
string service = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message HealthCheckResponse {
|
|
|
|
enum ServingStatus {
|
|
|
|
UNKNOWN = 0;
|
|
|
|
SERVING = 1;
|
|
|
|
NOT_SERVING = 2;
|
|
|
|
}
|
|
|
|
ServingStatus status = 1;
|
|
|
|
}
|