Skip to content

Commit

Permalink
Migrate to proper protobuf casing and remove viewer proto
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexProgrammerDE committed Jan 1, 2025
1 parent 4731eea commit 281e9a2
Show file tree
Hide file tree
Showing 13 changed files with 78 additions and 103 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public <T> T set(T value) {

targetCommandSpec.addOption(optionSpec);
}
case STRINGLIST -> {
case STRING_LIST -> {
var stringListEntry = settingType.getStringList();
var description = escapeFormatSpecifiers(stringListEntry.getDescription());

Expand Down Expand Up @@ -248,7 +248,7 @@ public <T> T set(T value) {

targetCommandSpec.addOption(optionSpec);
}
case MINMAX -> {
case MIN_MAX -> {
var minMaxEntry = settingType.getMinMax();

var minRef = new AtomicInteger();
Expand Down
4 changes: 2 additions & 2 deletions proto/src/main/proto/soulfire/command.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ option java_multiple_files = true;
package soulfire.v1;

message CommandRequest {
string instanceId = 1;
string instance_id = 1;
string command = 2;
}

Expand All @@ -15,7 +15,7 @@ message CommandResponse {
}

message CommandCompletionRequest {
string instanceId = 1;
string instance_id = 1;
string command = 2;
}

Expand Down
38 changes: 19 additions & 19 deletions proto/src/main/proto/soulfire/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -45,37 +45,37 @@ message MinecraftAccountProto {
}

message OnlineSimpleJavaData {
string authToken = 1;
int64 tokenExpireAt = 2;
string auth_token = 1;
int64 token_expire_at = 2;
}

message OnlineChainJavaData {
string authToken = 1;
int64 tokenExpireAt = 2;
google.protobuf.Struct authChain = 3;
string auth_token = 1;
int64 token_expire_at = 2;
google.protobuf.Struct auth_chain = 3;
}

message OfflineJavaData {
}

message BedrockData {
string mojangJwt = 1;
string identityJwt = 2;
string publicKey = 3;
string privateKey = 4;
string deviceId = 5;
string playFabId = 6;
google.protobuf.Struct authChain = 7;
string mojang_jwt = 1;
string identity_jwt = 2;
string public_key = 3;
string private_key = 4;
string device_id = 5;
string play_fab_id = 6;
google.protobuf.Struct auth_chain = 7;
}

AccountTypeProto type = 1;
string profileId = 2;
string lastKnownName = 3;
oneof accountData {
OnlineSimpleJavaData onlineSimpleJavaData = 4;
OnlineChainJavaData onlineChainJavaData = 5;
OfflineJavaData offlineJavaData = 6;
BedrockData bedrockData = 7;
string profile_id = 2;
string last_known_name = 3;
oneof account_data {
OnlineSimpleJavaData online_simple_java_data = 4;
OnlineChainJavaData online_chain_java_data = 5;
OfflineJavaData offline_java_data = 6;
BedrockData bedrock_data = 7;
}
}

Expand Down
44 changes: 22 additions & 22 deletions proto/src/main/proto/soulfire/config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ message ClientDataRequest {
}

message StringSetting {
string uiName = 1;
string ui_name = 1;
string description = 2;
string def = 3;
bool secret = 4;
Expand All @@ -20,7 +20,7 @@ message StringSetting {
}

message IntSetting {
string uiName = 1;
string ui_name = 1;
string description = 2;
int32 def = 3;
int32 min = 4;
Expand All @@ -31,7 +31,7 @@ message IntSetting {
}

message DoubleSetting {
string uiName = 1;
string ui_name = 1;
string description = 2;
double def = 3;
double min = 4;
Expand All @@ -42,7 +42,7 @@ message DoubleSetting {
}

message BoolSetting {
string uiName = 1;
string ui_name = 1;
string description = 2;
bool def = 3;
}
Expand All @@ -51,36 +51,36 @@ message ComboOption {
// Sent to server
string id = 1;
// Displayed to user
string displayName = 2;
string display_name = 2;
}

message ComboSetting {
string uiName = 1;
string ui_name = 1;
string description = 2;
// List of options
repeated ComboOption options = 3;
string def = 4;
}

message StringListSetting {
string uiName = 1;
string ui_name = 1;
string description = 2;
repeated string def = 3;
}

message MinMaxSetting {
string minUiName = 1;
string maxUiName = 2;
string minDescription = 3;
string maxDescription = 4;
int32 minDef = 5;
int32 maxDef = 6;
string min_ui_name = 1;
string max_ui_name = 2;
string min_description = 3;
string max_description = 4;
int32 min_def = 5;
int32 max_def = 6;
int32 min = 7;
int32 max = 8;
int32 step = 9;
optional string format = 10;
string minPlaceholder = 11;
string maxPlaceholder = 12;
string min_placeholder = 11;
string max_placeholder = 12;
}

// A single setting type with optional default value
Expand All @@ -91,8 +91,8 @@ message SettingType {
DoubleSetting double = 3;
BoolSetting bool = 4;
ComboSetting combo = 5;
StringListSetting stringList = 6;
MinMaxSetting minMax = 7;
StringListSetting string_list = 6;
MinMaxSetting min_max = 7;
}
}

Expand All @@ -110,18 +110,18 @@ message SettingsPage {
}

Type type = 1;
optional string owningPlugin = 2;
optional string owning_plugin = 2;
// The name of the page for these settings
string pageName = 3;
string page_name = 3;
// What namespace the settings of this page represent
string namespace = 4;
repeated SettingEntry entries = 5;
// https://lucide.dev icon id for this page (Usually rendered left of the page name)
string iconId = 6;
string icon_id = 6;
}

message GlobalPermissionState {
GlobalPermission globalPermission = 1;
GlobalPermission global_permission = 1;
bool granted = 2;
}

Expand All @@ -139,7 +139,7 @@ message ClientDataResponse {
string username = 1;
UserRole role = 7;
string email = 8;
repeated GlobalPermissionState serverPermissions = 2;
repeated GlobalPermissionState server_permissions = 2;
repeated ServerPlugin plugins = 3;
repeated SettingsPage settings = 5;
}
Expand Down
4 changes: 2 additions & 2 deletions proto/src/main/proto/soulfire/download.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ message HeaderPair {
}

message DownloadRequest {
string instanceId = 1;
string instance_id = 1;
string uri = 2;
repeated HeaderPair headers = 3;
optional ProxyProto proxy = 4;
Expand All @@ -22,7 +22,7 @@ message DownloadRequest {
message DownloadResponse {
bytes data = 1;
repeated HeaderPair headers = 2;
int32 statusCode = 3;
int32 status_code = 3;
}

service DownloadService {
Expand Down
12 changes: 6 additions & 6 deletions proto/src/main/proto/soulfire/instance.proto
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ message InstanceListRequest {
message InstanceListResponse {
message Instance {
string id = 1;
string friendlyName = 2;
string friendly_name = 2;
string icon = 5;
InstanceState state = 3;
repeated InstancePermissionState instancePermissions = 4;
repeated InstancePermissionState instance_permissions = 4;
}

repeated Instance instances = 1;
}

message InstancePermissionState {
InstancePermission instancePermission = 1;
InstancePermission instance_permission = 1;
bool granted = 2;
}

Expand All @@ -61,17 +61,17 @@ message InstanceInfoRequest {
}

message InstanceInfoResponse {
string friendlyName = 1;
string friendly_name = 1;
string icon = 5;
InstanceConfig config = 2;
InstanceState state = 3;
repeated InstancePermissionState instancePermissions = 4;
repeated InstancePermissionState instance_permissions = 4;
}

message InstanceUpdateMetaRequest {
string id = 1;
oneof meta {
string friendlyName = 2;
string friendly_name = 2;
string icon = 3;
}
}
Expand Down
4 changes: 2 additions & 2 deletions proto/src/main/proto/soulfire/logs.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ option java_multiple_files = true;
package soulfire.v1;

message PreviousLogRequest {
string instanceId = 1;
string instance_id = 1;
int32 count = 2;
}

Expand All @@ -15,7 +15,7 @@ message PreviousLogResponse {
}

message LogRequest {
string instanceId = 1;
string instance_id = 1;
}

message LogResponse {
Expand Down
16 changes: 8 additions & 8 deletions proto/src/main/proto/soulfire/mc-auth.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package soulfire.v1;
import "soulfire/common.proto";

message CredentialsAuthRequest {
string instanceId = 1;
string instance_id = 1;
AccountTypeCredentials service = 2;
repeated string payload = 3;
}
Expand All @@ -18,26 +18,26 @@ message CredentialsAuthResponse {
}

message DeviceCodeAuthRequest {
string instanceId = 1;
string instance_id = 1;
AccountTypeDeviceCode service = 2;
}

message DeviceCode {
string deviceCode = 1;
string userCode = 2;
string verificationUri = 3;
string directVerificationUri = 4;
string device_code = 1;
string user_code = 2;
string verification_uri = 3;
string direct_verification_uri = 4;
}

message DeviceCodeAuthResponse {
oneof data {
MinecraftAccountProto account = 1;
DeviceCode deviceCode = 2;
DeviceCode device_code = 2;
}
}

message RefreshRequest {
string instanceId = 1;
string instance_id = 1;
MinecraftAccountProto account = 2;
}

Expand Down
16 changes: 8 additions & 8 deletions proto/src/main/proto/soulfire/object-storage.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,37 @@ option java_multiple_files = true;
package soulfire.v1;

message ObjectStorageUploadRequest {
string instanceId = 1;
string instance_id = 1;
bytes data = 2;
string fileName = 3;
string file_name = 3;
}

message ObjectStorageUploadResponse {
}

message ObjectStorageDownloadRequest {
string instanceId = 1;
string fileName = 2;
string instance_id = 1;
string file_name = 2;
}

message ObjectStorageDownloadResponse {
bytes data = 1;
}

message ObjectStorageDeleteRequest {
string instanceId = 1;
string fileName = 2;
string instance_id = 1;
string file_name = 2;
}

message ObjectStorageDeleteResponse {
}

message ObjectStorageListRequest {
string instanceId = 1;
string instance_id = 1;
}

message ObjectStorageListResponse {
repeated string fileNames = 1;
repeated string file_names = 1;
}

service ObjectStorageService {
Expand Down
Loading

0 comments on commit 281e9a2

Please sign in to comment.