Files
AobaV2/AobaServer/Proto/Types.proto
T
2026-04-13 14:58:10 -04:00

171 lines
2.6 KiB
Protocol Buffer

syntax = "proto3";
option csharp_namespace = "Aoba.RPC";
package aoba;
import "google/protobuf/empty.proto";
message Credentials{
string user = 1;
string password = 2;
}
message SetMediaClassRequest{
Id id = 1;
MediaClass class = 2;
}
message Jwt{
string token = 1;
}
message LoginResponse{
oneof result {
Jwt jwt = 1;
LoginError error = 2;
}
}
message LoginError{
string message = 1;
}
message PageFilter {
optional int32 page = 1;
optional int32 pageSize = 2;
optional string query = 3;
}
message Id {
string value = 1;
}
message IdList {
repeated Id value = 1;
}
message MediaResponse {
optional MediaModel value = 1;
}
message ListResponse {
repeated MediaModel items = 1;
Pagination pagination = 2;
}
message Pagination {
int32 page = 1;
int32 pageSize = 2;
int32 totalPages = 3;
int32 totalItems = 4;
optional string query = 5;
}
message UserResponse {
oneof userResult {
UserModel user = 1;
google.protobuf.Empty empty = 2;
}
}
message UserModel {
Id id = 1;
string username = 2;
string email = 3;
bool isAdmin = 4;
}
message MediaModel {
Id id = 1;
string fileName = 2;
MediaType mediaType = 3;
string ext = 4;
int32 viewCount = 5;
Id owner = 6;
string thumbUrl = 7;
string mediaUrl = 8;
MediaClass class = 9;
}
enum MediaType {
Image = 0;
Audio = 1;
Video = 2;
Text = 3;
Code = 4;
Raw = 5;
}
enum MediaClass {
Standard = 0;
NSFW = 1;
Secret = 2;
}
message ShareXResponse {
oneof dstResult {
string destination = 1;
string error = 2;
}
}
message SearchQuery {
optional string queryText = 1;
repeated Filter filters = 2;
}
message Filter {
string key = 1;
repeated string values = 2;
}
message PasskeyPayload {
}
message PasskeyCredentialCreateOptions{
string challenge = 1;
PublicKeyCredentialUser user = 2;
PublicKeyCredentialRpEntity rp = 3;
repeated PubKeyCredParam pubKeyParams = 4;
}
message PubKeyCredParam{
string alg = 1;
string type = 2;
}
message PublicKeyCredentialRpEntity{
string id = 1;
string icon = 2;
string name = 3;
}
message PublicKeyCredentialUser{
string id = 1;
string name = 2;
string displayName = 3;
}
message PasskeyRegistrationCredentials{
string id = 1;
string rawId = 2;
string type = 3;
CredentialsClientResponse response = 4;
}
message CredentialsClientResponse{
string clientDataJSON = 1;
string attestationObject = 2;
string authenticatorData = 3;
}
message PublicKeyCredentialDescriptor{
string type = 1;
string id = 2;
repeated string transports = 3;
}