diff --git a/Luski.Shared/GlobalAttributes/DisplayNameAttribute.cs b/Luski.Shared/GlobalAttributes/DisplayNameAttribute.cs
new file mode 100644
index 0000000..e9ab5af
--- /dev/null
+++ b/Luski.Shared/GlobalAttributes/DisplayNameAttribute.cs
@@ -0,0 +1,11 @@
+namespace Luski.Shared.GlobalAttributes;
+
+public class DisplayNameAttribute : Attribute
+{
+ public DisplayNameAttribute(string DisplayName)
+ {
+ this.DisplayName = DisplayName;
+ }
+
+ public string DisplayName { get; private set; }
+}
\ No newline at end of file
diff --git a/Luski.Shared/Luski.Shared.csproj b/Luski.Shared/Luski.Shared.csproj
index 3ab241d..91d7b4b 100644
--- a/Luski.Shared/Luski.Shared.csproj
+++ b/Luski.Shared/Luski.Shared.csproj
@@ -5,7 +5,7 @@
enable
enable
Luski.Shared
- 1.1.0-alpha21
+ 1.1.0-alpha44
diff --git a/Luski.Shared/PublicServers/V1/ClientToServer/HTTP/CategoryPostCTS.cs b/Luski.Shared/PublicServers/V1/ClientToServer/HTTP/CategoryPostCTS.cs
index bea6409..d233161 100644
--- a/Luski.Shared/PublicServers/V1/ClientToServer/HTTP/CategoryPostCTS.cs
+++ b/Luski.Shared/PublicServers/V1/ClientToServer/HTTP/CategoryPostCTS.cs
@@ -1,5 +1,6 @@
using System.Text.Json.Serialization;
using JacobTechEncryption.Enums;
+using Luski.Shared.PublicServers.V1.Enums;
namespace Luski.Shared.PublicServers.V1.ClientToServer.HTTP;
@@ -8,6 +9,9 @@ public class CategoryPostCTS : CTS
[JsonInclude]
[JsonPropertyName("parent")]
public long Parent { get; set; }
+ [JsonInclude]
+ [JsonPropertyName("color_type")]
+ public ColorType ColorType { get; set; } = ColorType.Full;
[JsonInclude]
[JsonPropertyName("color")]
@@ -22,7 +26,7 @@ public class CategoryPostCTS : CTS
public string Description { get; set; } = string.Empty;
[JsonInclude]
[JsonPropertyName("role_overrides")]
- public UserRoleOverrideCTS[] RoleOverrides { get; set; } = Array.Empty();
+ public RoleOverrideCTS[] RoleOverrides { get; set; } = Array.Empty();
[JsonInclude]
[JsonPropertyName("member_overrides")]
public UserOverrideCTS[] UserOverrides { get; set; } = Array.Empty();
diff --git a/Luski.Shared/PublicServers/V1/ClientToServer/HTTP/ChannelPostCTS.cs b/Luski.Shared/PublicServers/V1/ClientToServer/HTTP/ChannelPostCTS.cs
index 18e2038..79c5571 100644
--- a/Luski.Shared/PublicServers/V1/ClientToServer/HTTP/ChannelPostCTS.cs
+++ b/Luski.Shared/PublicServers/V1/ClientToServer/HTTP/ChannelPostCTS.cs
@@ -10,6 +10,9 @@ public class ChannelPostCTS : CTS
[JsonPropertyName("parent")]
public long Parent { get; set; }
[JsonInclude]
+ [JsonPropertyName("color_type")]
+ public ColorType ColorType { get; set; } = ColorType.Full;
+ [JsonInclude]
[JsonPropertyName("color")]
public string Color { get; set; } = string.Empty;
[JsonInclude]
@@ -23,7 +26,7 @@ public class ChannelPostCTS : CTS
public string Description { get; set; } = string.Empty;
[JsonInclude]
[JsonPropertyName("role_overrides")]
- public UserRoleOverrideCTS[] RoleOverrides { get; set; } = Array.Empty();
+ public RoleOverrideCTS[] RoleOverrides { get; set; } = Array.Empty();
[JsonInclude]
[JsonPropertyName("member_overrides")]
public UserOverrideCTS[] UserOverrides { get; set; } = Array.Empty();
diff --git a/Luski.Shared/PublicServers/V1/ClientToServer/HTTP/RoleMembersPatchCTS.cs b/Luski.Shared/PublicServers/V1/ClientToServer/HTTP/RoleMembersPatchCTS.cs
new file mode 100644
index 0000000..4231d15
--- /dev/null
+++ b/Luski.Shared/PublicServers/V1/ClientToServer/HTTP/RoleMembersPatchCTS.cs
@@ -0,0 +1,25 @@
+using System.Text.Json.Serialization;
+using Luski.Shared.PublicServers.V1.Enums;
+
+namespace Luski.Shared.PublicServers.V1.ClientToServer.HTTP;
+
+public class RoleMembersPatchCTS : CTS
+{
+ [JsonInclude]
+ [JsonPropertyName("id")]
+ public long ID { get; set; }
+ [JsonInclude]
+ [JsonPropertyName("removed_members")]
+ public long[] RemovedMembers { get; set; }
+ [JsonInclude]
+ [JsonPropertyName("added_members")]
+ public long[] AddedMembers { get; set; }
+}
+
+[JsonSerializable(typeof(RoleMembersPatchCTS))]
+[JsonSourceGenerationOptions(
+ GenerationMode = JsonSourceGenerationMode.Default,
+ PropertyNamingPolicy = JsonKnownNamingPolicy.Unspecified,
+ WriteIndented = false,
+ DefaultIgnoreCondition = JsonIgnoreCondition.Never)]
+public partial class RoleMembersPatchCTSContext : JsonSerializerContext;
\ No newline at end of file
diff --git a/Luski.Shared/PublicServers/V1/ClientToServer/HTTP/UserRoleOverrideCTS.cs b/Luski.Shared/PublicServers/V1/ClientToServer/HTTP/RoleOverrideCTS.cs
similarity index 81%
rename from Luski.Shared/PublicServers/V1/ClientToServer/HTTP/UserRoleOverrideCTS.cs
rename to Luski.Shared/PublicServers/V1/ClientToServer/HTTP/RoleOverrideCTS.cs
index 189e969..4e106f3 100644
--- a/Luski.Shared/PublicServers/V1/ClientToServer/HTTP/UserRoleOverrideCTS.cs
+++ b/Luski.Shared/PublicServers/V1/ClientToServer/HTTP/RoleOverrideCTS.cs
@@ -4,7 +4,7 @@ using Luski.Shared.PublicServers.V1.Shared;
namespace Luski.Shared.PublicServers.V1.ClientToServer.HTTP;
-public class UserRoleOverrideCTS : CTS
+public class RoleOverrideCTS : CTS
{
[JsonInclude]
[JsonPropertyName("role_id")]
@@ -17,9 +17,9 @@ public class UserRoleOverrideCTS : CTS
public ServerPermission BadPermissions { get; set; }
}
-[JsonSerializable(typeof(UserRoleOverrideCTS))]
+[JsonSerializable(typeof(RoleOverrideCTS))]
[JsonSourceGenerationOptions(
GenerationMode = JsonSourceGenerationMode.Default,
PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase,
WriteIndented = false)]
-public partial class UserRoleOverrideCTSContext : JsonSerializerContext;
\ No newline at end of file
+public partial class RoleOverrideCTSContext : JsonSerializerContext;
\ No newline at end of file
diff --git a/Luski.Shared/PublicServers/V1/ClientToServer/HTTP/RolePatchCTS.cs b/Luski.Shared/PublicServers/V1/ClientToServer/HTTP/RolePatchCTS.cs
new file mode 100644
index 0000000..9fd38e1
--- /dev/null
+++ b/Luski.Shared/PublicServers/V1/ClientToServer/HTTP/RolePatchCTS.cs
@@ -0,0 +1,37 @@
+using System.Text.Json.Serialization;
+using Luski.Shared.PublicServers.V1.Enums;
+
+namespace Luski.Shared.PublicServers.V1.ClientToServer.HTTP;
+
+public class RolePatchCTS : CTS
+{
+ [JsonInclude]
+ [JsonPropertyName("id")]
+ public long ID { get; set; }
+ [JsonInclude]
+ [JsonPropertyName("display_name")]
+ public string? DisplayName { get; set; }
+ [JsonInclude]
+ [JsonPropertyName("index")]
+ public int? Index { get; set; }
+ [JsonInclude]
+ [JsonPropertyName("color_type")]
+ public ColorType? ColorType { get; set; }
+ [JsonInclude]
+ [JsonPropertyName("color")]
+ public string? Color { get; set; }
+ [JsonInclude]
+ [JsonPropertyName("description")]
+ public string? Description { get; set; }
+ [JsonInclude]
+ [JsonPropertyName("server_permissions")]
+ public ServerPermission? ServerPermissions { get; set; }
+}
+
+[JsonSerializable(typeof(RolePatchCTS))]
+[JsonSourceGenerationOptions(
+ GenerationMode = JsonSourceGenerationMode.Default,
+ PropertyNamingPolicy = JsonKnownNamingPolicy.Unspecified,
+ WriteIndented = false,
+ DefaultIgnoreCondition = JsonIgnoreCondition.Never)]
+public partial class RolePatchCTSContext : JsonSerializerContext;
\ No newline at end of file
diff --git a/Luski.Shared/PublicServers/V1/ClientToServer/HTTP/RolePostCTS.cs b/Luski.Shared/PublicServers/V1/ClientToServer/HTTP/RolePostCTS.cs
new file mode 100644
index 0000000..be0ac68
--- /dev/null
+++ b/Luski.Shared/PublicServers/V1/ClientToServer/HTTP/RolePostCTS.cs
@@ -0,0 +1,34 @@
+using System.Text.Json.Serialization;
+using Luski.Shared.PublicServers.V1.Enums;
+
+namespace Luski.Shared.PublicServers.V1.ClientToServer.HTTP;
+
+public class RolePostCTS : CTS
+{
+ [JsonInclude]
+ [JsonPropertyName("display_name")]
+ public string DisplayName { get; set; } = string.Empty;
+ [JsonInclude]
+ [JsonPropertyName("index")]
+ public int Index { get; set; }
+ [JsonInclude]
+ [JsonPropertyName("color_type")]
+ public ColorType ColorType { get; set; } = ColorType.Full;
+ [JsonInclude]
+ [JsonPropertyName("color")]
+ public string Color { get; set; } = string.Empty;
+ [JsonInclude]
+ [JsonPropertyName("description")]
+ public string Description { get; set; } = string.Empty;
+ [JsonInclude]
+ [JsonPropertyName("server_permissions")]
+ public ServerPermission ServerPermissions { get; set; } = ServerPermission.None;
+}
+
+[JsonSerializable(typeof(RolePostCTS))]
+[JsonSourceGenerationOptions(
+ GenerationMode = JsonSourceGenerationMode.Default,
+ PropertyNamingPolicy = JsonKnownNamingPolicy.Unspecified,
+ WriteIndented = false,
+ DefaultIgnoreCondition = JsonIgnoreCondition.Never)]
+public partial class RolePostCTSContext : JsonSerializerContext;
\ No newline at end of file
diff --git a/Luski.Shared/PublicServers/V1/ClientToServer/HTTP/UserOverrideCTS.cs b/Luski.Shared/PublicServers/V1/ClientToServer/HTTP/UserOverrideCTS.cs
index e60c2e9..564dab0 100644
--- a/Luski.Shared/PublicServers/V1/ClientToServer/HTTP/UserOverrideCTS.cs
+++ b/Luski.Shared/PublicServers/V1/ClientToServer/HTTP/UserOverrideCTS.cs
@@ -9,7 +9,6 @@ public class UserOverrideCTS : CTS
[JsonInclude]
[JsonPropertyName("user_id")]
public long UserID { get; set; }
-
[JsonInclude]
[JsonPropertyName("good_permissions")]
public ServerPermission GoodPermissions { get; set; }
diff --git a/Luski.Shared/PublicServers/V1/Enums/ColorType.cs b/Luski.Shared/PublicServers/V1/Enums/ColorType.cs
new file mode 100644
index 0000000..1077eb9
--- /dev/null
+++ b/Luski.Shared/PublicServers/V1/Enums/ColorType.cs
@@ -0,0 +1,7 @@
+namespace Luski.Shared.PublicServers.V1.Enums;
+
+public enum ColorType
+{
+ Full,
+ LeftToRightGradient
+}
\ No newline at end of file
diff --git a/Luski.Shared/PublicServers/V1/Enums/DataType.cs b/Luski.Shared/PublicServers/V1/Enums/DataType.cs
index e943488..86032ae 100644
--- a/Luski.Shared/PublicServers/V1/Enums/DataType.cs
+++ b/Luski.Shared/PublicServers/V1/Enums/DataType.cs
@@ -3,5 +3,12 @@ namespace Luski.Shared.PublicServers.V1.Enums;
public enum DataType
{
Token,
- MessageCreate
+ MessageCreate,
+ MessageEdit,
+ MessageDelete,
+ StatusUpdate,
+ Role,
+ RoleMember,
+ RoleDelete,
+
}
\ No newline at end of file
diff --git a/Luski.Shared/PublicServers/V1/Enums/ServerPermission.cs b/Luski.Shared/PublicServers/V1/Enums/ServerPermission.cs
index 532e8d7..0731725 100644
--- a/Luski.Shared/PublicServers/V1/Enums/ServerPermission.cs
+++ b/Luski.Shared/PublicServers/V1/Enums/ServerPermission.cs
@@ -1,48 +1,160 @@
+using System.ComponentModel;
+
namespace Luski.Shared.PublicServers.V1.Enums;
[Flags]
public enum ServerPermission : long
{
- ///
- /// Internal permission for quick permission lookup
- ///
None = 0b_0000000000000000000000000000000000000000000000000000000000000000,
+ ///
+ /// Internal permission for quick permission lookup.
+ ///
+ [Description("Internal permission for quick permission lookup")]
+ [GlobalAttributes.DisplayName("View This")]
+ [Category("Internal")]
ViewThis = 0b_0000000000000000000000000000000000000000000000000000000000000001,
+ [Description("User can view channels")]
+ [GlobalAttributes.DisplayName("View Channels")]
+ [Category("General")]
ViewChannels = 0b_0000000000000000000000000000000000000000000000000000000000000010,
+ [Description("User can move channels")]
+ [GlobalAttributes.DisplayName("Move Channels")]
+ [Category("General")]
MoveChannels = 0b_0000000000000000000000000000000000000000000000000000000000000100,
+ [Description("User can edit channels")]
+ [GlobalAttributes.DisplayName("Edit Channels")]
+ [Category("General")]
EditChannels = 0b_0000000000000000000000000000000000000000000000000000000000001000,
+ [Description("User can edit channel permissions")]
+ [GlobalAttributes.DisplayName("Edit Channel Permissions")]
+ [Category("General")]
EditChannelPermissions = 0b_0000000000000000000000000000000000000000000000000000000000010000,
+ [Description("User can create channels")]
+ [GlobalAttributes.DisplayName("Create Channels")]
+ [Category("General")]
CreateChannels = 0b_0000000000000000000000000000000000000000000000000000000000100000,
+ [Description("User can delete channels")]
+ [GlobalAttributes.DisplayName("Delete Channels")]
+ [Category("General")]
DeleteChannels = 0b_0000000000000000000000000000000000000000000000000000000001000000,
+ [Description("User can view categories")]
+ [GlobalAttributes.DisplayName("View Categories")]
+ [Category("General")]
ViewCategories = 0b_0000000000000000000000000000000000000000000000000000000010000000,
+ [Description("User can move categories")]
+ [GlobalAttributes.DisplayName("Move Categories")]
+ [Category("General")]
MoveCategories = 0b_0000000000000000000000000000000000000000000000000000000100000000,
+ [Description("User can edit categories")]
+ [GlobalAttributes.DisplayName("Edit Categories")]
+ [Category("General")]
EditCategories = 0b_0000000000000000000000000000000000000000000000000000001000000000,
+ [Description("User can edit category permissions")]
+ [GlobalAttributes.DisplayName("Edit Category Permissions")]
+ [Category("General")]
EditCategoryPermissions = 0b_0000000000000000000000000000000000000000000000000000010000000000,
+ [Description("User can create categories")]
+ [GlobalAttributes.DisplayName("Create Categories")]
+ [Category("General")]
CreateCategories = 0b_0000000000000000000000000000000000000000000000000000100000000000,
+ [Description("User can delete categories")]
+ [GlobalAttributes.DisplayName("Delete Categories")]
+ [Category("General")]
DeleteCategories = 0b_0000000000000000000000000000000000000000000000000001000000000000,
+ [Description("User can delete keys")]
+ [GlobalAttributes.DisplayName("Delete Keys")]
+ [Category("General")]
DeleteKeys = 0b_0000000000000000000000000000000000000000000000000010000000000000,
+ [Description("User can manage roles")]
+ [GlobalAttributes.DisplayName("Manage Roles")]
+ [Category("General")]
ManageRoles = 0b_0000000000000000000000000000000000000000000000000100000000000000,
+ [Description("User can view logs")]
+ [GlobalAttributes.DisplayName("View Logs")]
+ [Category("General")]
ViewLogs = 0b_0000000000000000000000000000000000000000000000001000000000000000,
+ [Description("User can manage the server")]
+ [GlobalAttributes.DisplayName("Manage Server")]
+ [Category("General")]
ManageServer = 0b_0000000000000000000000000000000000000000000000010000000000000000,
+ [Description("User can add servers")]
+ [GlobalAttributes.DisplayName("Add Servers")]
+ [Category("General")]
AddServers = 0b_0000000000000000000000000000000000000000000000100000000000000000,
+ [Description("User can remove servers")]
+ [GlobalAttributes.DisplayName("Remove Servers")]
+ [Category("General")]
RemoveServers = 0b_0000000000000000000000000000000000000000000001000000000000000000,
+ [Description("User can invite people to the server if invite codes are required")]
+ [GlobalAttributes.DisplayName("Invite")]
+ [Category("General")]
Invite = 0b_0000000000000000000000000000000000000000000010000000000000000000,
- Nickname = 0b_0000000000000000000000000000000000000000000100000000000000000000,
- ManageNicknames = 0b_0000000000000000000000000000000000000000001000000000000000000000,
- Kick = 0b_0000000000000000000000000000000000000000010000000000000000000000,
- Ban = 0b_0000000000000000000000000000000000000000100000000000000000000000,
- SendMessages = 0b_0000000000000000000000000000000000000001000000000000000000000000,
- SendFiles = 0b_0000000000000000000000000000000000000010000000000000000000000000,
- ChannelPings = 0b_0000000000000000000000000000000000000100000000000000000000000000,
- ServerPings = 0b_0000000000000000000000000000000000001000000000000000000000000000,
- PingSomeone = 0b_0000000000000000000000000000000000010000000000000000000000000000,
- ManageMessages = 0b_0000000000000000000000000000000000100000000000000000000000000000,
- ReadMessageHistory = 0b_0000000000000000000000000000000001000000000000000000000000000000,
- UseServerCommands = 0b_0000000000000000000000000000000010000000000000000000000000000000,
- JoinVoice = 0b_0000000000000000000000000000000100000000000000000000000000000000,
- SpeakInVoice = 0b_0000000000000000000000000000001000000000000000000000000000000000,
- MuteMembers = 0b_0000000000000000000000000000010000000000000000000000000000000000,
- DeafenMembers = 0b_0000000000000000000000000000100000000000000000000000000000000000,
- MoveMembers = 0b_0000000000000000000000000001000000000000000000000000000000000000,
- ManageChannelProfiles = 0b_0000000000000000000000000010000000000000000000000000000000000000,
+ [Description("User can kick people")]
+ [GlobalAttributes.DisplayName("Kick")]
+ [Category("General")]
+ Kick = 0b_0000000000000000000000000000000000000000000100000000000000000000,
+ [Description("User can ban people")]
+ [GlobalAttributes.DisplayName("Ban")]
+ [Category("General")]
+ Ban = 0b_0000000000000000000000000000000000000000001000000000000000000000,
+ [Description("User can send messages")]
+ [GlobalAttributes.DisplayName("Send Messages")]
+ [Category("Text Channel")]
+ SendMessages = 0b_0000000000000000000000000000000000000000010000000000000000000000,
+ [Description("User can send files")]
+ [GlobalAttributes.DisplayName("Send Files")]
+ [Category("Text Channel")]
+ SendFiles = 0b_0000000000000000000000000000000000000000100000000000000000000000,
+ [Description("User can ping channels")]
+ [GlobalAttributes.DisplayName("Ping Channels")]
+ [Category("Text Channel")]
+ ChannelPings = 0b_0000000000000000000000000000000000000001000000000000000000000000,
+ [Description("User can ping the server")]
+ [GlobalAttributes.DisplayName("Ping Server")]
+ [Category("Text Channel")]
+ ServerPings = 0b_0000000000000000000000000000000000000010000000000000000000000000,
+ [Description("User can ping people")]
+ [GlobalAttributes.DisplayName("Ping Someone")]
+ [Category("Text Channel")]
+ PingSomeone = 0b_0000000000000000000000000000000000000100000000000000000000000000,
+ [Description("User can manage messages")]
+ [GlobalAttributes.DisplayName("Manage Messages")]
+ [Category("Text Channel")]
+ ManageMessages = 0b_0000000000000000000000000000000000001000000000000000000000000000,
+ [Description("User can read message history")]
+ [GlobalAttributes.DisplayName("Read Message History")]
+ [Category("Text Channel")]
+ ReadMessageHistory = 0b_0000000000000000000000000000000000010000000000000000000000000000,
+ [Description("User can use commands")]
+ [GlobalAttributes.DisplayName("Use Commands")]
+ [Category("Text Channel")]
+ UseServerCommands = 0b_0000000000000000000000000000000000100000000000000000000000000000,
+ [Description("User can join voice chats")]
+ [GlobalAttributes.DisplayName("Join Voice")]
+ [Category("Voice Channel")]
+ JoinVoice = 0b_0000000000000000000000000000000001000000000000000000000000000000,
+ [Description("User can speak in voice")]
+ [GlobalAttributes.DisplayName("Speak In Voice")]
+ [Category("Voice Channel")]
+ SpeakInVoice = 0b_0000000000000000000000000000000010000000000000000000000000000000,
+ [Description("User can mute people in voice")]
+ [GlobalAttributes.DisplayName("Mute Members In Voice")]
+ [Category("Voice Channel")]
+ MuteMembers = 0b_0000000000000000000000000000000100000000000000000000000000000000,
+ [Description("User can defen people in voice")]
+ [GlobalAttributes.DisplayName("Deafen Members In Voice")]
+ [Category("Voice Channel")]
+ DeafenMembers = 0b_0000000000000000000000000000001000000000000000000000000000000000,
+ [Description("User can move people in voice")]
+ [GlobalAttributes.DisplayName("Move Members In Voice")]
+ [Category("Voice Channel")]
+ MoveMembers = 0b_0000000000000000000000000000010000000000000000000000000000000000,
+ [Description("User can manage profiles")]
+ [GlobalAttributes.DisplayName("Manage Profiles")]
+ [Category("Personalization")]
+ ManageProfiles = 0b_0000000000000000000000000000100000000000000000000000000000000000,
+ [Description("User can create profiles")]
+ [GlobalAttributes.DisplayName("Create Profiles")]
+ [Category("Personalization")]
+ CreateProfile = 0b_0000000000000000000000000001000000000000000000000000000000000000,
}
\ No newline at end of file
diff --git a/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/CategorySTC.cs b/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/CategorySTC.cs
index f9cf5c3..7d5cc02 100644
--- a/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/CategorySTC.cs
+++ b/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/CategorySTC.cs
@@ -13,6 +13,9 @@ public class CategorySTC : STC
[JsonPropertyName("picture_type")]
public PictureType PictureType { get; set; }
[JsonInclude]
+ [JsonPropertyName("color_type")]
+ public ColorType ColorType { get; set; } = ColorType.Full;
+ [JsonInclude]
[JsonPropertyName("color")]
public string Color { get; set; } = string.Empty;
[JsonInclude]
@@ -32,10 +35,10 @@ public class CategorySTC : STC
public long[] Channels { get; set; } = Array.Empty();
[JsonInclude]
[JsonPropertyName("role_overrides")]
- public long[] RoleOverrides { get; set; } = Array.Empty();
+ public RoleOverrideSTC[] RoleOverrides { get; set; } = Array.Empty();
[JsonInclude]
[JsonPropertyName("member_overrides")]
- public long[] UserOverrides { get; set; } = Array.Empty();
+ public UserOverrideSTC[] UserOverrides { get; set; } = Array.Empty();
[JsonInclude]
[JsonPropertyName("title_encryption_key")]
public long TitleEncryptionKey { get; set; }
diff --git a/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/ChannelSTC.cs b/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/ChannelSTC.cs
index 4dbf260..e738570 100644
--- a/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/ChannelSTC.cs
+++ b/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/ChannelSTC.cs
@@ -13,6 +13,9 @@ public class ChannelSTC : STC
[JsonPropertyName("parent")]
public long Parent { get; set; }
[JsonInclude]
+ [JsonPropertyName("color_type")]
+ public ColorType ColorType { get; set; } = ColorType.Full;
+ [JsonInclude]
[JsonPropertyName("color")]
public string Color { get; set; } = string.Empty;
[JsonInclude]
@@ -32,10 +35,10 @@ public class ChannelSTC : STC
[JsonInclude]
[JsonPropertyName("role_overrides")]
- public long[] RoleOverrides { get; set; } = Array.Empty();
+ public RoleOverrideSTC[] RoleOverrides { get; set; } = Array.Empty();
[JsonInclude]
[JsonPropertyName("member_overrides")]
- public long[] UserOverrides { get; set; } = Array.Empty();
+ public UserOverrideSTC[] UserOverrides { get; set; } = Array.Empty();
[JsonInclude]
[JsonPropertyName("title_encryption_key")]
public long TitleEncryptionKey { get; set; }
diff --git a/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/MessageSTC.cs b/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/MessageSTC.cs
index c3e71f8..39a3a00 100644
--- a/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/MessageSTC.cs
+++ b/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/MessageSTC.cs
@@ -9,12 +9,18 @@ public class MessageSTC : STC
[JsonPropertyName("id")]
public long ID { get; set; }
[JsonInclude]
+ [JsonPropertyName("timestamp")]
+ public long Timestamp { get; set; }
+ [JsonInclude]
[JsonPropertyName("channel_id")]
public long ChannelID { get; set; }
[JsonInclude]
[JsonPropertyName("author_id")]
public long AuthorID { get; set; }
[JsonInclude]
+ [JsonPropertyName("profile_id")]
+ public long ProfileID { get; set; }
+ [JsonInclude]
[JsonPropertyName("context")]
public string Context { get; set; } = string.Empty;
[JsonInclude]
@@ -26,9 +32,6 @@ public class MessageSTC : STC
[JsonInclude]
[JsonPropertyName("encoder_type")]
public EncoderType EncoderType { get; set; }
- [JsonInclude]
- [JsonPropertyName("is_channel_profile")]
- public bool IsProfile { get; set; }
}
[JsonSerializable(typeof(MessageSTC))]
diff --git a/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/ProfileListSTC.cs b/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/ProfileListSTC.cs
new file mode 100644
index 0000000..6012cca
--- /dev/null
+++ b/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/ProfileListSTC.cs
@@ -0,0 +1,19 @@
+using System.Text.Json.Serialization;
+using Luski.Shared.PublicServers.V1.Enums;
+
+namespace Luski.Shared.PublicServers.V1.ServerToClient.HTTP;
+
+public class ProfileListSTC : STC
+{
+ [JsonInclude]
+ [JsonPropertyName("profiles")]
+ public List Profiles { get; set; } = default!;
+}
+
+[JsonSerializable(typeof(ProfileListSTC))]
+[JsonSourceGenerationOptions(
+ GenerationMode = JsonSourceGenerationMode.Default,
+ PropertyNamingPolicy = JsonKnownNamingPolicy.Unspecified,
+ WriteIndented = false,
+ DefaultIgnoreCondition = JsonIgnoreCondition.Never)]
+public partial class ProfileListSTCContext : JsonSerializerContext;
\ No newline at end of file
diff --git a/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/ChannelProfileSTC.cs b/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/ProfileSTC.cs
similarity index 62%
rename from Luski.Shared/PublicServers/V1/ServerToClient/HTTP/ChannelProfileSTC.cs
rename to Luski.Shared/PublicServers/V1/ServerToClient/HTTP/ProfileSTC.cs
index 232246e..673f608 100644
--- a/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/ChannelProfileSTC.cs
+++ b/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/ProfileSTC.cs
@@ -3,7 +3,7 @@ using Luski.Shared.PublicServers.V1.Enums;
namespace Luski.Shared.PublicServers.V1.ServerToClient.HTTP;
-public class ChannelProfileSTC : STC
+public class ProfileSTC : STC
{
[JsonInclude]
[JsonPropertyName("id")]
@@ -18,11 +18,23 @@ public class ChannelProfileSTC : STC
[JsonPropertyName("controllers")]
public long[] Controllers { get; set; } = default!;
[JsonInclude]
+ [JsonPropertyName("role_controllers")]
+ public long[] RoleControllers { get; set; } = default!;
+ [JsonInclude]
+ [JsonPropertyName("channels")]
+ public long[] Channels { get; set; } = default!;
+ [JsonInclude]
+ [JsonPropertyName("categories")]
+ public long[] Categories { get; set; } = default!;
+ [JsonInclude]
+ [JsonPropertyName("color_type")]
+ public ColorType? ColorType { get; set; }
+ [JsonInclude]
[JsonPropertyName("color")]
- public string Color { get; set; } = string.Empty;
+ public string? Color { get; set; } = string.Empty;
}
-[JsonSerializable(typeof(ChannelProfileSTC))]
+[JsonSerializable(typeof(ProfileSTC))]
[JsonSourceGenerationOptions(
GenerationMode = JsonSourceGenerationMode.Default,
PropertyNamingPolicy = JsonKnownNamingPolicy.Unspecified,
diff --git a/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/UserRoleOverrideSTC.cs b/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/RoleOverrideSTC.cs
similarity index 74%
rename from Luski.Shared/PublicServers/V1/ServerToClient/HTTP/UserRoleOverrideSTC.cs
rename to Luski.Shared/PublicServers/V1/ServerToClient/HTTP/RoleOverrideSTC.cs
index 3a2525c..bbbb7f3 100644
--- a/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/UserRoleOverrideSTC.cs
+++ b/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/RoleOverrideSTC.cs
@@ -4,11 +4,8 @@ using Luski.Shared.PublicServers.V1.Shared;
namespace Luski.Shared.PublicServers.V1.ServerToClient.HTTP;
-public class UserRoleOverrideSTC : STC
+public class RoleOverrideSTC : STC
{
- [JsonInclude]
- [JsonPropertyName("id")]
- public long Id { get; set; }
[JsonInclude]
[JsonPropertyName("role_id")]
public long RoleID { get; set; }
@@ -20,9 +17,9 @@ public class UserRoleOverrideSTC : STC
public ServerPermission BadPermissions { get; set; }
}
-[JsonSerializable(typeof(UserRoleOverrideSTC))]
+[JsonSerializable(typeof(RoleOverrideSTC))]
[JsonSourceGenerationOptions(
GenerationMode = JsonSourceGenerationMode.Default,
PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase,
WriteIndented = false)]
-public partial class UserRoleOverrideSTCContext : JsonSerializerContext;
\ No newline at end of file
+public partial class RoleOverrideSTCContext : JsonSerializerContext;
\ No newline at end of file
diff --git a/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/RoleSTC.cs b/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/RoleSTC.cs
index 5c381fa..bee29ce 100644
--- a/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/RoleSTC.cs
+++ b/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/RoleSTC.cs
@@ -9,15 +9,15 @@ public class RoleSTC : STC
[JsonPropertyName("id")]
public long ID { get; set; }
[JsonInclude]
- [JsonPropertyName("name")]
- public string Name { get; set; } = string.Empty;
- [JsonInclude]
[JsonPropertyName("display_name")]
public string DisplayName { get; set; } = string.Empty;
[JsonInclude]
[JsonPropertyName("index")]
public int Index { get; set; }
[JsonInclude]
+ [JsonPropertyName("color_type")]
+ public ColorType ColorType { get; set; } = ColorType.Full;
+ [JsonInclude]
[JsonPropertyName("color")]
public string Color { get; set; } = string.Empty;
[JsonInclude]
diff --git a/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/RolesSTC.cs b/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/RolesSTC.cs
index eddd320..d476de1 100644
--- a/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/RolesSTC.cs
+++ b/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/RolesSTC.cs
@@ -1,5 +1,4 @@
using System.Text.Json.Serialization;
-using Luski.Shared.PublicServers.V1.Enums;
namespace Luski.Shared.PublicServers.V1.ServerToClient.HTTP;
@@ -7,7 +6,7 @@ public class RolesSTC : STC
{
[JsonInclude]
[JsonPropertyName("roles")]
- public RoleSTC[] Roles { get; set; }
+ public RoleSTC[] Roles { get; set; } = Array.Empty();
}
[JsonSerializable(typeof(RolesSTC))]
diff --git a/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/ServerInfoSTC.cs b/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/ServerInfoSTC.cs
index 9cc7245..73ef05f 100644
--- a/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/ServerInfoSTC.cs
+++ b/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/ServerInfoSTC.cs
@@ -1,4 +1,5 @@
using System.Text.Json.Serialization;
+using Luski.Shared.PublicServers.V1.Enums;
using Luski.Shared.PublicServers.V1.Shared;
namespace Luski.Shared.PublicServers.V1.ServerToClient.HTTP;
@@ -18,6 +19,9 @@ public class ServerInfoSTC : STC
[JsonPropertyName("owner")]
public long Owner { get; set; }
[JsonInclude]
+ [JsonPropertyName("picture_type")]
+ public PictureType PictureType { get; set; }
+ [JsonInclude]
[JsonPropertyName("alternate_servers")]
public ServerData[] AlternateServers { get; set; } =Array.Empty();
}
diff --git a/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/SocketUserSTC.cs b/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/SocketUserSTC.cs
index da0842a..dcb805b 100644
--- a/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/SocketUserSTC.cs
+++ b/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/SocketUserSTC.cs
@@ -9,17 +9,14 @@ public class SocketUserSTC : STC
[JsonPropertyName("id")]
public long ID { get; set; }
[JsonInclude]
- [JsonPropertyName("displayname")]
- public string DisplayName { get; set; } = default!;
+ [JsonPropertyName("server_profile")]
+ public long ServerProfile { get; set; } = default!;
[JsonInclude]
[JsonPropertyName("selected_channel")]
public long SelectedChannel { get; set; }
[JsonInclude]
[JsonPropertyName("status")]
public UserStatus Status { get; set; }
- [JsonInclude]
- [JsonPropertyName("picture_type")]
- public PictureType PictureType { get; set; }
[JsonInclude]
[JsonPropertyName("roles")]
public long[] RoleIds { get; set; } = default!;
diff --git a/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/UserOverrideSTC.cs b/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/UserOverrideSTC.cs
index 70263c9..4555395 100644
--- a/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/UserOverrideSTC.cs
+++ b/Luski.Shared/PublicServers/V1/ServerToClient/HTTP/UserOverrideSTC.cs
@@ -6,9 +6,6 @@ namespace Luski.Shared.PublicServers.V1.ServerToClient.HTTP;
public class UserOverrideSTC : STC
{
- [JsonInclude]
- [JsonPropertyName("id")]
- public long Id { get; set; }
[JsonInclude]
[JsonPropertyName("user_id")]
public long UserID { get; set; }
diff --git a/Luski.Shared/PublicServers/V1/ServerToClient/WSS/WebsocketMessageSendEventSTC.cs b/Luski.Shared/PublicServers/V1/ServerToClient/WSS/WebsocketMessageSendEventSTC.cs
new file mode 100644
index 0000000..27bccf5
--- /dev/null
+++ b/Luski.Shared/PublicServers/V1/ServerToClient/WSS/WebsocketMessageSendEventSTC.cs
@@ -0,0 +1,14 @@
+using System.Text.Json.Serialization;
+using Luski.Shared.PublicServers.V1.Enums;
+
+namespace Luski.Shared.PublicServers.V1.ServerToClient.WSS;
+
+public class WebsocketMessageSendEventSTC
+{
+ [JsonPropertyName("type")]
+ [JsonInclude]
+ public DataType? Type { get; set; } = DataType.Token!;
+ [JsonPropertyName("error")]
+ [JsonInclude]
+ public string Error { get; set; } = default!;
+}
\ No newline at end of file
diff --git a/Luski.Shared/PublicServers/V1/ServerToClient/WSS/WebsocketTokenEventSTC.cs b/Luski.Shared/PublicServers/V1/ServerToClient/WSS/WebsocketTokenEventSTC.cs
new file mode 100644
index 0000000..0978f65
--- /dev/null
+++ b/Luski.Shared/PublicServers/V1/ServerToClient/WSS/WebsocketTokenEventSTC.cs
@@ -0,0 +1,20 @@
+using System.Text.Json.Serialization;
+
+namespace Luski.Shared.PublicServers.V1.ServerToClient.WSS;
+
+public class WebsocketTokenEventSTC : WebsocketMessageSendEventSTC
+{
+ [JsonInclude]
+ [JsonPropertyName("token")]
+ public string Token { get; set; } = default!;
+ [JsonInclude]
+ [JsonPropertyName("session_token")]
+ public string? SessionToken { get; set; }
+}
+
+[JsonSerializable(typeof(WebsocketTokenEventSTC))]
+[JsonSourceGenerationOptions(
+ GenerationMode = JsonSourceGenerationMode.Default,
+ PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase,
+ WriteIndented = false)]
+public partial class WebsocketTokenEventSTCContext : JsonSerializerContext;
\ No newline at end of file
diff --git a/Luski.Shared/PublicServers/V1/Shared/IServerEvent.cs b/Luski.Shared/PublicServers/V1/Shared/IServerEvent.cs
new file mode 100644
index 0000000..e6a6220
--- /dev/null
+++ b/Luski.Shared/PublicServers/V1/Shared/IServerEvent.cs
@@ -0,0 +1,3 @@
+namespace Luski.Shared.PublicServers.V1.Shared;
+
+public interface IServerEvent;
\ No newline at end of file
diff --git a/Luski.Shared/PublicServers/V1/Shared/MessageEvent.cs b/Luski.Shared/PublicServers/V1/Shared/MessageEvent.cs
new file mode 100644
index 0000000..51d94c0
--- /dev/null
+++ b/Luski.Shared/PublicServers/V1/Shared/MessageEvent.cs
@@ -0,0 +1,43 @@
+using System.Text.Json.Serialization;
+using JacobTechEncryption.Enums;
+using Luski.Shared.PublicServers.V1.ServerToClient.HTTP;
+
+namespace Luski.Shared.PublicServers.V1.Shared;
+
+public class MessageEvent : IServerEvent
+{
+ [JsonInclude]
+ [JsonPropertyName("author_id")]
+ public long AuthorID { get; set; }
+ [JsonInclude]
+ [JsonPropertyName("profile_id")]
+ public long ProfileID { get; set; }
+ [JsonInclude]
+ [JsonPropertyName("channel_id")]
+ public long ChannelID { get; set; }
+ [JsonInclude]
+ [JsonPropertyName("timestamp")]
+ public long Timestamp { get; set; }
+ [JsonInclude]
+ [JsonPropertyName("context")]
+ public string Base64Context { get; set; } = default!;
+ [JsonInclude]
+ [JsonPropertyName("id")]
+ public long ID { get; set; }
+ [JsonInclude]
+ [JsonPropertyName("files")]
+ public ServerFileInfoSTC[] Files { get; set; } = Array.Empty();
+ [JsonInclude]
+ [JsonPropertyName("encryption_key")]
+ public long EncryptionKey { get; set; }
+ [JsonInclude]
+ [JsonPropertyName("encoder_type")]
+ public EncoderType EncoderType { get; set; }
+}
+
+[JsonSerializable(typeof(MessageEvent))]
+[JsonSourceGenerationOptions(
+ GenerationMode = JsonSourceGenerationMode.Default,
+ PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase,
+ WriteIndented = false)]
+public partial class MessageEventContext : JsonSerializerContext;
\ No newline at end of file
diff --git a/Luski.Shared/PublicServers/V1/Shared/RoleEvent.cs b/Luski.Shared/PublicServers/V1/Shared/RoleEvent.cs
new file mode 100644
index 0000000..a32af47
--- /dev/null
+++ b/Luski.Shared/PublicServers/V1/Shared/RoleEvent.cs
@@ -0,0 +1,37 @@
+using System.Text.Json.Serialization;
+using Luski.Shared.PublicServers.V1.Enums;
+using Luski.Shared.PublicServers.V1.ServerToClient.HTTP;
+
+namespace Luski.Shared.PublicServers.V1.Shared;
+
+public class RoleEvent : IServerEvent
+{
+ [JsonInclude]
+ [JsonPropertyName("id")]
+ public long ID { get; set; }
+ [JsonInclude]
+ [JsonPropertyName("display_name")]
+ public string? DisplayName { get; set; }
+ [JsonInclude]
+ [JsonPropertyName("index")]
+ public int? Index { get; set; }
+ [JsonInclude]
+ [JsonPropertyName("color_type")]
+ public ColorType? ColorType { get; set; }
+ [JsonInclude]
+ [JsonPropertyName("color")]
+ public string? Color { get; set; }
+ [JsonInclude]
+ [JsonPropertyName("description")]
+ public string? Description { get; set; }
+ [JsonInclude]
+ [JsonPropertyName("server_permissions")]
+ public ServerPermission? ServerPermissions { get; set; }
+}
+
+[JsonSerializable(typeof(RoleEvent))]
+[JsonSourceGenerationOptions(
+ GenerationMode = JsonSourceGenerationMode.Default,
+ PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase,
+ WriteIndented = false)]
+public partial class RoleEventContext : JsonSerializerContext;
\ No newline at end of file
diff --git a/Luski.Shared/PublicServers/V1/Shared/RoleMemberEvent.cs b/Luski.Shared/PublicServers/V1/Shared/RoleMemberEvent.cs
new file mode 100644
index 0000000..1500072
--- /dev/null
+++ b/Luski.Shared/PublicServers/V1/Shared/RoleMemberEvent.cs
@@ -0,0 +1,24 @@
+using System.Text.Json.Serialization;
+using Luski.Shared.PublicServers.V1.ServerToClient.HTTP;
+
+namespace Luski.Shared.PublicServers.V1.Shared;
+
+public class RoleMemberEvent : IServerEvent
+{
+ [JsonInclude]
+ [JsonPropertyName("id")]
+ public long ID { get; set; }
+ [JsonInclude]
+ [JsonPropertyName("removed_members")]
+ public long[] RemovedMembers { get; set; }
+ [JsonInclude]
+ [JsonPropertyName("added_members")]
+ public long[] AddedMembers { get; set; }
+}
+
+[JsonSerializable(typeof(RoleMemberEvent))]
+[JsonSourceGenerationOptions(
+ GenerationMode = JsonSourceGenerationMode.Default,
+ PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase,
+ WriteIndented = false)]
+public partial class RoleMemberEventContext : JsonSerializerContext;
\ No newline at end of file
diff --git a/Luski.Shared/PublicServers/V1/Shared/ServerEvent.cs b/Luski.Shared/PublicServers/V1/Shared/ServerEvent.cs
new file mode 100644
index 0000000..8838ff2
--- /dev/null
+++ b/Luski.Shared/PublicServers/V1/Shared/ServerEvent.cs
@@ -0,0 +1,22 @@
+using System.Text.Json.Serialization;
+using Luski.Shared.PublicServers.V1.Enums;
+
+namespace Luski.Shared.PublicServers.V1.Shared;
+
+public class ServerEvent
+{
+ [JsonInclude]
+ [JsonPropertyName("type")]
+ public DataType Type { get; set; }
+
+ [JsonInclude]
+ [JsonPropertyName("data")]
+ public object Data { get; set; } = default!;
+}
+
+[JsonSerializable(typeof(ServerEvent))]
+[JsonSourceGenerationOptions(
+ GenerationMode = JsonSourceGenerationMode.Default,
+ PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase,
+ WriteIndented = false)]
+public partial class ServerEventContext : JsonSerializerContext;
\ No newline at end of file
diff --git a/Luski.Shared/PublicServers/V1/Shared/StatusEvent.cs b/Luski.Shared/PublicServers/V1/Shared/StatusEvent.cs
new file mode 100644
index 0000000..ff4b3f9
--- /dev/null
+++ b/Luski.Shared/PublicServers/V1/Shared/StatusEvent.cs
@@ -0,0 +1,24 @@
+using System.Text.Json.Serialization;
+using Luski.Shared.PublicServers.V1.Enums;
+
+namespace Luski.Shared.PublicServers.V1.Shared;
+
+public class StatusEvent : IServerEvent
+{
+ [JsonInclude]
+ [JsonPropertyName("id")]
+ public long User { get; set; }
+ [JsonInclude]
+ [JsonPropertyName("before")]
+ public UserStatus Before { get; set; }
+ [JsonInclude]
+ [JsonPropertyName("after")]
+ public UserStatus After { get; set; }
+}
+
+[JsonSerializable(typeof(StatusEvent))]
+[JsonSourceGenerationOptions(
+ GenerationMode = JsonSourceGenerationMode.Default,
+ PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase,
+ WriteIndented = false)]
+public partial class StatusEventContext : JsonSerializerContext;
\ No newline at end of file