2024-02-20 08:47:52 +00:00
|
|
|
syntax = "proto3";
|
2024-03-05 19:59:11 +00:00
|
|
|
import "google/protobuf/timestamp.proto";
|
2024-02-20 08:47:52 +00:00
|
|
|
|
2024-02-20 08:51:06 +00:00
|
|
|
option go_package = "git.dragse.it/anthrove/plug-[REPLACE_ME]/api/gRPC";
|
2024-02-20 08:47:52 +00:00
|
|
|
|
|
|
|
service PlugConnector {
|
|
|
|
rpc TaskStart(PlugTaskCreation) returns (PlugTaskStatus);
|
|
|
|
rpc TaskStatus(PlugTask) returns (PlugTaskStatus);
|
|
|
|
rpc TaskCancel(PlugTask) returns (PlugTaskStatus);
|
2024-03-05 19:43:49 +00:00
|
|
|
rpc Ping(PingRequest) returns (PongResponse); // Added Ping endpoint
|
2024-05-28 20:15:47 +00:00
|
|
|
rpc SendMessage(SendMessageRequest) returns (SendMessageResponse);
|
2024-07-09 19:29:11 +00:00
|
|
|
rpc GetUserMessages(GetMessagesRequest) returns (GetMessagesResponse);
|
2024-03-05 19:43:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message PingRequest {
|
|
|
|
string message = 1; // Optional message field, can be removed if not needed
|
2024-03-05 19:59:11 +00:00
|
|
|
google.protobuf.Timestamp timestamp = 2;
|
2024-03-05 19:43:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message PongResponse {
|
|
|
|
string message = 1; // Optional message field, can be removed if not needed
|
2024-03-05 19:59:11 +00:00
|
|
|
google.protobuf.Timestamp timestamp = 2;
|
2024-02-20 08:47:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message PlugTaskStatus {
|
|
|
|
string task_id = 1;
|
|
|
|
PlugTaskState task_state = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
enum PlugTaskState {
|
|
|
|
UNKNOWN = 0;
|
|
|
|
STARTED = 1;
|
|
|
|
RUNNING = 2;
|
|
|
|
STOPPED = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
message PlugTask {
|
|
|
|
string task_id = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message PlugTaskCreation {
|
|
|
|
string user_id = 1;
|
|
|
|
string user_source_name = 2;
|
|
|
|
bool deep_scrape = 3;
|
2024-05-28 20:15:47 +00:00
|
|
|
string api_key = 4;
|
2024-07-09 20:22:54 +00:00
|
|
|
string user_source_id = 5;
|
2024-03-05 19:43:49 +00:00
|
|
|
}
|
2024-05-28 20:15:47 +00:00
|
|
|
|
|
|
|
message SendMessageRequest {
|
2024-07-09 20:26:07 +00:00
|
|
|
string user_source_id = 1;
|
2024-05-28 20:15:47 +00:00
|
|
|
string message = 2;
|
2024-07-09 20:26:07 +00:00
|
|
|
string user_source_name = 3;
|
2024-05-28 20:15:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message SendMessageResponse {
|
|
|
|
bool success = 1;
|
2024-07-09 19:29:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message GetMessagesRequest {
|
2024-07-09 20:26:07 +00:00
|
|
|
string user_source_id = 1;
|
|
|
|
string user_source_name = 2;
|
2024-07-09 19:29:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message GetMessagesResponse {
|
|
|
|
repeated Message messages = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message Message {
|
2024-07-09 20:26:07 +00:00
|
|
|
string from_user_source_id = 1;
|
|
|
|
string from_user_source_name = 2;
|
2024-07-09 19:29:11 +00:00
|
|
|
google.protobuf.Timestamp created_at = 3;
|
|
|
|
string body = 4;
|
|
|
|
string title = 5;
|
2024-05-28 20:15:47 +00:00
|
|
|
}
|