Server Update
This commit is contained in:
parent
900136ef76
commit
5c5b975b93
11
Luski.Shared/GlobalAttributes/DisplayNameAttribute.cs
Normal file
11
Luski.Shared/GlobalAttributes/DisplayNameAttribute.cs
Normal file
@ -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; }
|
||||||
|
}
|
@ -5,7 +5,7 @@
|
|||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<Title>Luski.Shared</Title>
|
<Title>Luski.Shared</Title>
|
||||||
<Version>1.1.0-alpha21</Version>
|
<Version>1.1.0-alpha44</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using JacobTechEncryption.Enums;
|
using JacobTechEncryption.Enums;
|
||||||
|
using Luski.Shared.PublicServers.V1.Enums;
|
||||||
|
|
||||||
namespace Luski.Shared.PublicServers.V1.ClientToServer.HTTP;
|
namespace Luski.Shared.PublicServers.V1.ClientToServer.HTTP;
|
||||||
|
|
||||||
@ -8,6 +9,9 @@ public class CategoryPostCTS : CTS
|
|||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
[JsonPropertyName("parent")]
|
[JsonPropertyName("parent")]
|
||||||
public long Parent { get; set; }
|
public long Parent { get; set; }
|
||||||
|
[JsonInclude]
|
||||||
|
[JsonPropertyName("color_type")]
|
||||||
|
public ColorType ColorType { get; set; } = ColorType.Full;
|
||||||
|
|
||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
[JsonPropertyName("color")]
|
[JsonPropertyName("color")]
|
||||||
@ -22,7 +26,7 @@ public class CategoryPostCTS : CTS
|
|||||||
public string Description { get; set; } = string.Empty;
|
public string Description { get; set; } = string.Empty;
|
||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
[JsonPropertyName("role_overrides")]
|
[JsonPropertyName("role_overrides")]
|
||||||
public UserRoleOverrideCTS[] RoleOverrides { get; set; } = Array.Empty<UserRoleOverrideCTS>();
|
public RoleOverrideCTS[] RoleOverrides { get; set; } = Array.Empty<RoleOverrideCTS>();
|
||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
[JsonPropertyName("member_overrides")]
|
[JsonPropertyName("member_overrides")]
|
||||||
public UserOverrideCTS[] UserOverrides { get; set; } = Array.Empty<UserOverrideCTS>();
|
public UserOverrideCTS[] UserOverrides { get; set; } = Array.Empty<UserOverrideCTS>();
|
||||||
|
@ -10,6 +10,9 @@ public class ChannelPostCTS : CTS
|
|||||||
[JsonPropertyName("parent")]
|
[JsonPropertyName("parent")]
|
||||||
public long Parent { get; set; }
|
public long Parent { get; set; }
|
||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
|
[JsonPropertyName("color_type")]
|
||||||
|
public ColorType ColorType { get; set; } = ColorType.Full;
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("color")]
|
[JsonPropertyName("color")]
|
||||||
public string Color { get; set; } = string.Empty;
|
public string Color { get; set; } = string.Empty;
|
||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
@ -23,7 +26,7 @@ public class ChannelPostCTS : CTS
|
|||||||
public string Description { get; set; } = string.Empty;
|
public string Description { get; set; } = string.Empty;
|
||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
[JsonPropertyName("role_overrides")]
|
[JsonPropertyName("role_overrides")]
|
||||||
public UserRoleOverrideCTS[] RoleOverrides { get; set; } = Array.Empty<UserRoleOverrideCTS>();
|
public RoleOverrideCTS[] RoleOverrides { get; set; } = Array.Empty<RoleOverrideCTS>();
|
||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
[JsonPropertyName("member_overrides")]
|
[JsonPropertyName("member_overrides")]
|
||||||
public UserOverrideCTS[] UserOverrides { get; set; } = Array.Empty<UserOverrideCTS>();
|
public UserOverrideCTS[] UserOverrides { get; set; } = Array.Empty<UserOverrideCTS>();
|
||||||
|
@ -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;
|
@ -4,7 +4,7 @@ using Luski.Shared.PublicServers.V1.Shared;
|
|||||||
|
|
||||||
namespace Luski.Shared.PublicServers.V1.ClientToServer.HTTP;
|
namespace Luski.Shared.PublicServers.V1.ClientToServer.HTTP;
|
||||||
|
|
||||||
public class UserRoleOverrideCTS : CTS
|
public class RoleOverrideCTS : CTS
|
||||||
{
|
{
|
||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
[JsonPropertyName("role_id")]
|
[JsonPropertyName("role_id")]
|
||||||
@ -17,9 +17,9 @@ public class UserRoleOverrideCTS : CTS
|
|||||||
public ServerPermission BadPermissions { get; set; }
|
public ServerPermission BadPermissions { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[JsonSerializable(typeof(UserRoleOverrideCTS))]
|
[JsonSerializable(typeof(RoleOverrideCTS))]
|
||||||
[JsonSourceGenerationOptions(
|
[JsonSourceGenerationOptions(
|
||||||
GenerationMode = JsonSourceGenerationMode.Default,
|
GenerationMode = JsonSourceGenerationMode.Default,
|
||||||
PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase,
|
PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase,
|
||||||
WriteIndented = false)]
|
WriteIndented = false)]
|
||||||
public partial class UserRoleOverrideCTSContext : JsonSerializerContext;
|
public partial class RoleOverrideCTSContext : JsonSerializerContext;
|
@ -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;
|
@ -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;
|
@ -9,7 +9,6 @@ public class UserOverrideCTS : CTS
|
|||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
[JsonPropertyName("user_id")]
|
[JsonPropertyName("user_id")]
|
||||||
public long UserID { get; set; }
|
public long UserID { get; set; }
|
||||||
|
|
||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
[JsonPropertyName("good_permissions")]
|
[JsonPropertyName("good_permissions")]
|
||||||
public ServerPermission GoodPermissions { get; set; }
|
public ServerPermission GoodPermissions { get; set; }
|
||||||
|
7
Luski.Shared/PublicServers/V1/Enums/ColorType.cs
Normal file
7
Luski.Shared/PublicServers/V1/Enums/ColorType.cs
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
namespace Luski.Shared.PublicServers.V1.Enums;
|
||||||
|
|
||||||
|
public enum ColorType
|
||||||
|
{
|
||||||
|
Full,
|
||||||
|
LeftToRightGradient
|
||||||
|
}
|
@ -3,5 +3,12 @@ namespace Luski.Shared.PublicServers.V1.Enums;
|
|||||||
public enum DataType
|
public enum DataType
|
||||||
{
|
{
|
||||||
Token,
|
Token,
|
||||||
MessageCreate
|
MessageCreate,
|
||||||
|
MessageEdit,
|
||||||
|
MessageDelete,
|
||||||
|
StatusUpdate,
|
||||||
|
Role,
|
||||||
|
RoleMember,
|
||||||
|
RoleDelete,
|
||||||
|
|
||||||
}
|
}
|
@ -1,48 +1,160 @@
|
|||||||
|
using System.ComponentModel;
|
||||||
|
|
||||||
namespace Luski.Shared.PublicServers.V1.Enums;
|
namespace Luski.Shared.PublicServers.V1.Enums;
|
||||||
|
|
||||||
[Flags]
|
[Flags]
|
||||||
public enum ServerPermission : long
|
public enum ServerPermission : long
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Internal permission for quick permission lookup
|
|
||||||
/// </summary>
|
|
||||||
None = 0b_0000000000000000000000000000000000000000000000000000000000000000,
|
None = 0b_0000000000000000000000000000000000000000000000000000000000000000,
|
||||||
|
/// <summary>
|
||||||
|
/// Internal permission for quick permission lookup.
|
||||||
|
/// </summary>
|
||||||
|
[Description("Internal permission for quick permission lookup")]
|
||||||
|
[GlobalAttributes.DisplayName("View This")]
|
||||||
|
[Category("Internal")]
|
||||||
ViewThis = 0b_0000000000000000000000000000000000000000000000000000000000000001,
|
ViewThis = 0b_0000000000000000000000000000000000000000000000000000000000000001,
|
||||||
|
[Description("User can view channels")]
|
||||||
|
[GlobalAttributes.DisplayName("View Channels")]
|
||||||
|
[Category("General")]
|
||||||
ViewChannels = 0b_0000000000000000000000000000000000000000000000000000000000000010,
|
ViewChannels = 0b_0000000000000000000000000000000000000000000000000000000000000010,
|
||||||
|
[Description("User can move channels")]
|
||||||
|
[GlobalAttributes.DisplayName("Move Channels")]
|
||||||
|
[Category("General")]
|
||||||
MoveChannels = 0b_0000000000000000000000000000000000000000000000000000000000000100,
|
MoveChannels = 0b_0000000000000000000000000000000000000000000000000000000000000100,
|
||||||
|
[Description("User can edit channels")]
|
||||||
|
[GlobalAttributes.DisplayName("Edit Channels")]
|
||||||
|
[Category("General")]
|
||||||
EditChannels = 0b_0000000000000000000000000000000000000000000000000000000000001000,
|
EditChannels = 0b_0000000000000000000000000000000000000000000000000000000000001000,
|
||||||
|
[Description("User can edit channel permissions")]
|
||||||
|
[GlobalAttributes.DisplayName("Edit Channel Permissions")]
|
||||||
|
[Category("General")]
|
||||||
EditChannelPermissions = 0b_0000000000000000000000000000000000000000000000000000000000010000,
|
EditChannelPermissions = 0b_0000000000000000000000000000000000000000000000000000000000010000,
|
||||||
|
[Description("User can create channels")]
|
||||||
|
[GlobalAttributes.DisplayName("Create Channels")]
|
||||||
|
[Category("General")]
|
||||||
CreateChannels = 0b_0000000000000000000000000000000000000000000000000000000000100000,
|
CreateChannels = 0b_0000000000000000000000000000000000000000000000000000000000100000,
|
||||||
|
[Description("User can delete channels")]
|
||||||
|
[GlobalAttributes.DisplayName("Delete Channels")]
|
||||||
|
[Category("General")]
|
||||||
DeleteChannels = 0b_0000000000000000000000000000000000000000000000000000000001000000,
|
DeleteChannels = 0b_0000000000000000000000000000000000000000000000000000000001000000,
|
||||||
|
[Description("User can view categories")]
|
||||||
|
[GlobalAttributes.DisplayName("View Categories")]
|
||||||
|
[Category("General")]
|
||||||
ViewCategories = 0b_0000000000000000000000000000000000000000000000000000000010000000,
|
ViewCategories = 0b_0000000000000000000000000000000000000000000000000000000010000000,
|
||||||
|
[Description("User can move categories")]
|
||||||
|
[GlobalAttributes.DisplayName("Move Categories")]
|
||||||
|
[Category("General")]
|
||||||
MoveCategories = 0b_0000000000000000000000000000000000000000000000000000000100000000,
|
MoveCategories = 0b_0000000000000000000000000000000000000000000000000000000100000000,
|
||||||
|
[Description("User can edit categories")]
|
||||||
|
[GlobalAttributes.DisplayName("Edit Categories")]
|
||||||
|
[Category("General")]
|
||||||
EditCategories = 0b_0000000000000000000000000000000000000000000000000000001000000000,
|
EditCategories = 0b_0000000000000000000000000000000000000000000000000000001000000000,
|
||||||
|
[Description("User can edit category permissions")]
|
||||||
|
[GlobalAttributes.DisplayName("Edit Category Permissions")]
|
||||||
|
[Category("General")]
|
||||||
EditCategoryPermissions = 0b_0000000000000000000000000000000000000000000000000000010000000000,
|
EditCategoryPermissions = 0b_0000000000000000000000000000000000000000000000000000010000000000,
|
||||||
|
[Description("User can create categories")]
|
||||||
|
[GlobalAttributes.DisplayName("Create Categories")]
|
||||||
|
[Category("General")]
|
||||||
CreateCategories = 0b_0000000000000000000000000000000000000000000000000000100000000000,
|
CreateCategories = 0b_0000000000000000000000000000000000000000000000000000100000000000,
|
||||||
|
[Description("User can delete categories")]
|
||||||
|
[GlobalAttributes.DisplayName("Delete Categories")]
|
||||||
|
[Category("General")]
|
||||||
DeleteCategories = 0b_0000000000000000000000000000000000000000000000000001000000000000,
|
DeleteCategories = 0b_0000000000000000000000000000000000000000000000000001000000000000,
|
||||||
|
[Description("User can delete keys")]
|
||||||
|
[GlobalAttributes.DisplayName("Delete Keys")]
|
||||||
|
[Category("General")]
|
||||||
DeleteKeys = 0b_0000000000000000000000000000000000000000000000000010000000000000,
|
DeleteKeys = 0b_0000000000000000000000000000000000000000000000000010000000000000,
|
||||||
|
[Description("User can manage roles")]
|
||||||
|
[GlobalAttributes.DisplayName("Manage Roles")]
|
||||||
|
[Category("General")]
|
||||||
ManageRoles = 0b_0000000000000000000000000000000000000000000000000100000000000000,
|
ManageRoles = 0b_0000000000000000000000000000000000000000000000000100000000000000,
|
||||||
|
[Description("User can view logs")]
|
||||||
|
[GlobalAttributes.DisplayName("View Logs")]
|
||||||
|
[Category("General")]
|
||||||
ViewLogs = 0b_0000000000000000000000000000000000000000000000001000000000000000,
|
ViewLogs = 0b_0000000000000000000000000000000000000000000000001000000000000000,
|
||||||
|
[Description("User can manage the server")]
|
||||||
|
[GlobalAttributes.DisplayName("Manage Server")]
|
||||||
|
[Category("General")]
|
||||||
ManageServer = 0b_0000000000000000000000000000000000000000000000010000000000000000,
|
ManageServer = 0b_0000000000000000000000000000000000000000000000010000000000000000,
|
||||||
|
[Description("User can add servers")]
|
||||||
|
[GlobalAttributes.DisplayName("Add Servers")]
|
||||||
|
[Category("General")]
|
||||||
AddServers = 0b_0000000000000000000000000000000000000000000000100000000000000000,
|
AddServers = 0b_0000000000000000000000000000000000000000000000100000000000000000,
|
||||||
|
[Description("User can remove servers")]
|
||||||
|
[GlobalAttributes.DisplayName("Remove Servers")]
|
||||||
|
[Category("General")]
|
||||||
RemoveServers = 0b_0000000000000000000000000000000000000000000001000000000000000000,
|
RemoveServers = 0b_0000000000000000000000000000000000000000000001000000000000000000,
|
||||||
|
[Description("User can invite people to the server if invite codes are required")]
|
||||||
|
[GlobalAttributes.DisplayName("Invite")]
|
||||||
|
[Category("General")]
|
||||||
Invite = 0b_0000000000000000000000000000000000000000000010000000000000000000,
|
Invite = 0b_0000000000000000000000000000000000000000000010000000000000000000,
|
||||||
Nickname = 0b_0000000000000000000000000000000000000000000100000000000000000000,
|
[Description("User can kick people")]
|
||||||
ManageNicknames = 0b_0000000000000000000000000000000000000000001000000000000000000000,
|
[GlobalAttributes.DisplayName("Kick")]
|
||||||
Kick = 0b_0000000000000000000000000000000000000000010000000000000000000000,
|
[Category("General")]
|
||||||
Ban = 0b_0000000000000000000000000000000000000000100000000000000000000000,
|
Kick = 0b_0000000000000000000000000000000000000000000100000000000000000000,
|
||||||
SendMessages = 0b_0000000000000000000000000000000000000001000000000000000000000000,
|
[Description("User can ban people")]
|
||||||
SendFiles = 0b_0000000000000000000000000000000000000010000000000000000000000000,
|
[GlobalAttributes.DisplayName("Ban")]
|
||||||
ChannelPings = 0b_0000000000000000000000000000000000000100000000000000000000000000,
|
[Category("General")]
|
||||||
ServerPings = 0b_0000000000000000000000000000000000001000000000000000000000000000,
|
Ban = 0b_0000000000000000000000000000000000000000001000000000000000000000,
|
||||||
PingSomeone = 0b_0000000000000000000000000000000000010000000000000000000000000000,
|
[Description("User can send messages")]
|
||||||
ManageMessages = 0b_0000000000000000000000000000000000100000000000000000000000000000,
|
[GlobalAttributes.DisplayName("Send Messages")]
|
||||||
ReadMessageHistory = 0b_0000000000000000000000000000000001000000000000000000000000000000,
|
[Category("Text Channel")]
|
||||||
UseServerCommands = 0b_0000000000000000000000000000000010000000000000000000000000000000,
|
SendMessages = 0b_0000000000000000000000000000000000000000010000000000000000000000,
|
||||||
JoinVoice = 0b_0000000000000000000000000000000100000000000000000000000000000000,
|
[Description("User can send files")]
|
||||||
SpeakInVoice = 0b_0000000000000000000000000000001000000000000000000000000000000000,
|
[GlobalAttributes.DisplayName("Send Files")]
|
||||||
MuteMembers = 0b_0000000000000000000000000000010000000000000000000000000000000000,
|
[Category("Text Channel")]
|
||||||
DeafenMembers = 0b_0000000000000000000000000000100000000000000000000000000000000000,
|
SendFiles = 0b_0000000000000000000000000000000000000000100000000000000000000000,
|
||||||
MoveMembers = 0b_0000000000000000000000000001000000000000000000000000000000000000,
|
[Description("User can ping channels")]
|
||||||
ManageChannelProfiles = 0b_0000000000000000000000000010000000000000000000000000000000000000,
|
[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,
|
||||||
}
|
}
|
@ -13,6 +13,9 @@ public class CategorySTC : STC
|
|||||||
[JsonPropertyName("picture_type")]
|
[JsonPropertyName("picture_type")]
|
||||||
public PictureType PictureType { get; set; }
|
public PictureType PictureType { get; set; }
|
||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
|
[JsonPropertyName("color_type")]
|
||||||
|
public ColorType ColorType { get; set; } = ColorType.Full;
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("color")]
|
[JsonPropertyName("color")]
|
||||||
public string Color { get; set; } = string.Empty;
|
public string Color { get; set; } = string.Empty;
|
||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
@ -32,10 +35,10 @@ public class CategorySTC : STC
|
|||||||
public long[] Channels { get; set; } = Array.Empty<long>();
|
public long[] Channels { get; set; } = Array.Empty<long>();
|
||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
[JsonPropertyName("role_overrides")]
|
[JsonPropertyName("role_overrides")]
|
||||||
public long[] RoleOverrides { get; set; } = Array.Empty<long>();
|
public RoleOverrideSTC[] RoleOverrides { get; set; } = Array.Empty<RoleOverrideSTC>();
|
||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
[JsonPropertyName("member_overrides")]
|
[JsonPropertyName("member_overrides")]
|
||||||
public long[] UserOverrides { get; set; } = Array.Empty<long>();
|
public UserOverrideSTC[] UserOverrides { get; set; } = Array.Empty<UserOverrideSTC>();
|
||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
[JsonPropertyName("title_encryption_key")]
|
[JsonPropertyName("title_encryption_key")]
|
||||||
public long TitleEncryptionKey { get; set; }
|
public long TitleEncryptionKey { get; set; }
|
||||||
|
@ -13,6 +13,9 @@ public class ChannelSTC : STC
|
|||||||
[JsonPropertyName("parent")]
|
[JsonPropertyName("parent")]
|
||||||
public long Parent { get; set; }
|
public long Parent { get; set; }
|
||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
|
[JsonPropertyName("color_type")]
|
||||||
|
public ColorType ColorType { get; set; } = ColorType.Full;
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("color")]
|
[JsonPropertyName("color")]
|
||||||
public string Color { get; set; } = string.Empty;
|
public string Color { get; set; } = string.Empty;
|
||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
@ -32,10 +35,10 @@ public class ChannelSTC : STC
|
|||||||
|
|
||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
[JsonPropertyName("role_overrides")]
|
[JsonPropertyName("role_overrides")]
|
||||||
public long[] RoleOverrides { get; set; } = Array.Empty<long>();
|
public RoleOverrideSTC[] RoleOverrides { get; set; } = Array.Empty<RoleOverrideSTC>();
|
||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
[JsonPropertyName("member_overrides")]
|
[JsonPropertyName("member_overrides")]
|
||||||
public long[] UserOverrides { get; set; } = Array.Empty<long>();
|
public UserOverrideSTC[] UserOverrides { get; set; } = Array.Empty<UserOverrideSTC>();
|
||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
[JsonPropertyName("title_encryption_key")]
|
[JsonPropertyName("title_encryption_key")]
|
||||||
public long TitleEncryptionKey { get; set; }
|
public long TitleEncryptionKey { get; set; }
|
||||||
|
@ -9,12 +9,18 @@ public class MessageSTC : STC
|
|||||||
[JsonPropertyName("id")]
|
[JsonPropertyName("id")]
|
||||||
public long ID { get; set; }
|
public long ID { get; set; }
|
||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
|
[JsonPropertyName("timestamp")]
|
||||||
|
public long Timestamp { get; set; }
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("channel_id")]
|
[JsonPropertyName("channel_id")]
|
||||||
public long ChannelID { get; set; }
|
public long ChannelID { get; set; }
|
||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
[JsonPropertyName("author_id")]
|
[JsonPropertyName("author_id")]
|
||||||
public long AuthorID { get; set; }
|
public long AuthorID { get; set; }
|
||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
|
[JsonPropertyName("profile_id")]
|
||||||
|
public long ProfileID { get; set; }
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("context")]
|
[JsonPropertyName("context")]
|
||||||
public string Context { get; set; } = string.Empty;
|
public string Context { get; set; } = string.Empty;
|
||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
@ -26,9 +32,6 @@ public class MessageSTC : STC
|
|||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
[JsonPropertyName("encoder_type")]
|
[JsonPropertyName("encoder_type")]
|
||||||
public EncoderType EncoderType { get; set; }
|
public EncoderType EncoderType { get; set; }
|
||||||
[JsonInclude]
|
|
||||||
[JsonPropertyName("is_channel_profile")]
|
|
||||||
public bool IsProfile { get; set; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[JsonSerializable(typeof(MessageSTC))]
|
[JsonSerializable(typeof(MessageSTC))]
|
||||||
|
@ -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<ProfileSTC> Profiles { get; set; } = default!;
|
||||||
|
}
|
||||||
|
|
||||||
|
[JsonSerializable(typeof(ProfileListSTC))]
|
||||||
|
[JsonSourceGenerationOptions(
|
||||||
|
GenerationMode = JsonSourceGenerationMode.Default,
|
||||||
|
PropertyNamingPolicy = JsonKnownNamingPolicy.Unspecified,
|
||||||
|
WriteIndented = false,
|
||||||
|
DefaultIgnoreCondition = JsonIgnoreCondition.Never)]
|
||||||
|
public partial class ProfileListSTCContext : JsonSerializerContext;
|
@ -3,7 +3,7 @@ using Luski.Shared.PublicServers.V1.Enums;
|
|||||||
|
|
||||||
namespace Luski.Shared.PublicServers.V1.ServerToClient.HTTP;
|
namespace Luski.Shared.PublicServers.V1.ServerToClient.HTTP;
|
||||||
|
|
||||||
public class ChannelProfileSTC : STC
|
public class ProfileSTC : STC
|
||||||
{
|
{
|
||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
[JsonPropertyName("id")]
|
[JsonPropertyName("id")]
|
||||||
@ -18,11 +18,23 @@ public class ChannelProfileSTC : STC
|
|||||||
[JsonPropertyName("controllers")]
|
[JsonPropertyName("controllers")]
|
||||||
public long[] Controllers { get; set; } = default!;
|
public long[] Controllers { get; set; } = default!;
|
||||||
[JsonInclude]
|
[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")]
|
[JsonPropertyName("color")]
|
||||||
public string Color { get; set; } = string.Empty;
|
public string? Color { get; set; } = string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
[JsonSerializable(typeof(ChannelProfileSTC))]
|
[JsonSerializable(typeof(ProfileSTC))]
|
||||||
[JsonSourceGenerationOptions(
|
[JsonSourceGenerationOptions(
|
||||||
GenerationMode = JsonSourceGenerationMode.Default,
|
GenerationMode = JsonSourceGenerationMode.Default,
|
||||||
PropertyNamingPolicy = JsonKnownNamingPolicy.Unspecified,
|
PropertyNamingPolicy = JsonKnownNamingPolicy.Unspecified,
|
@ -4,11 +4,8 @@ using Luski.Shared.PublicServers.V1.Shared;
|
|||||||
|
|
||||||
namespace Luski.Shared.PublicServers.V1.ServerToClient.HTTP;
|
namespace Luski.Shared.PublicServers.V1.ServerToClient.HTTP;
|
||||||
|
|
||||||
public class UserRoleOverrideSTC : STC
|
public class RoleOverrideSTC : STC
|
||||||
{
|
{
|
||||||
[JsonInclude]
|
|
||||||
[JsonPropertyName("id")]
|
|
||||||
public long Id { get; set; }
|
|
||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
[JsonPropertyName("role_id")]
|
[JsonPropertyName("role_id")]
|
||||||
public long RoleID { get; set; }
|
public long RoleID { get; set; }
|
||||||
@ -20,9 +17,9 @@ public class UserRoleOverrideSTC : STC
|
|||||||
public ServerPermission BadPermissions { get; set; }
|
public ServerPermission BadPermissions { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[JsonSerializable(typeof(UserRoleOverrideSTC))]
|
[JsonSerializable(typeof(RoleOverrideSTC))]
|
||||||
[JsonSourceGenerationOptions(
|
[JsonSourceGenerationOptions(
|
||||||
GenerationMode = JsonSourceGenerationMode.Default,
|
GenerationMode = JsonSourceGenerationMode.Default,
|
||||||
PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase,
|
PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase,
|
||||||
WriteIndented = false)]
|
WriteIndented = false)]
|
||||||
public partial class UserRoleOverrideSTCContext : JsonSerializerContext;
|
public partial class RoleOverrideSTCContext : JsonSerializerContext;
|
@ -9,15 +9,15 @@ public class RoleSTC : STC
|
|||||||
[JsonPropertyName("id")]
|
[JsonPropertyName("id")]
|
||||||
public long ID { get; set; }
|
public long ID { get; set; }
|
||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
[JsonPropertyName("name")]
|
|
||||||
public string Name { get; set; } = string.Empty;
|
|
||||||
[JsonInclude]
|
|
||||||
[JsonPropertyName("display_name")]
|
[JsonPropertyName("display_name")]
|
||||||
public string DisplayName { get; set; } = string.Empty;
|
public string DisplayName { get; set; } = string.Empty;
|
||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
[JsonPropertyName("index")]
|
[JsonPropertyName("index")]
|
||||||
public int Index { get; set; }
|
public int Index { get; set; }
|
||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
|
[JsonPropertyName("color_type")]
|
||||||
|
public ColorType ColorType { get; set; } = ColorType.Full;
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("color")]
|
[JsonPropertyName("color")]
|
||||||
public string Color { get; set; } = string.Empty;
|
public string Color { get; set; } = string.Empty;
|
||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using Luski.Shared.PublicServers.V1.Enums;
|
|
||||||
|
|
||||||
namespace Luski.Shared.PublicServers.V1.ServerToClient.HTTP;
|
namespace Luski.Shared.PublicServers.V1.ServerToClient.HTTP;
|
||||||
|
|
||||||
@ -7,7 +6,7 @@ public class RolesSTC : STC
|
|||||||
{
|
{
|
||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
[JsonPropertyName("roles")]
|
[JsonPropertyName("roles")]
|
||||||
public RoleSTC[] Roles { get; set; }
|
public RoleSTC[] Roles { get; set; } = Array.Empty<RoleSTC>();
|
||||||
}
|
}
|
||||||
|
|
||||||
[JsonSerializable(typeof(RolesSTC))]
|
[JsonSerializable(typeof(RolesSTC))]
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
using Luski.Shared.PublicServers.V1.Enums;
|
||||||
using Luski.Shared.PublicServers.V1.Shared;
|
using Luski.Shared.PublicServers.V1.Shared;
|
||||||
|
|
||||||
namespace Luski.Shared.PublicServers.V1.ServerToClient.HTTP;
|
namespace Luski.Shared.PublicServers.V1.ServerToClient.HTTP;
|
||||||
@ -18,6 +19,9 @@ public class ServerInfoSTC : STC
|
|||||||
[JsonPropertyName("owner")]
|
[JsonPropertyName("owner")]
|
||||||
public long Owner { get; set; }
|
public long Owner { get; set; }
|
||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
|
[JsonPropertyName("picture_type")]
|
||||||
|
public PictureType PictureType { get; set; }
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("alternate_servers")]
|
[JsonPropertyName("alternate_servers")]
|
||||||
public ServerData[] AlternateServers { get; set; } =Array.Empty<ServerData>();
|
public ServerData[] AlternateServers { get; set; } =Array.Empty<ServerData>();
|
||||||
}
|
}
|
||||||
|
@ -9,8 +9,8 @@ public class SocketUserSTC : STC
|
|||||||
[JsonPropertyName("id")]
|
[JsonPropertyName("id")]
|
||||||
public long ID { get; set; }
|
public long ID { get; set; }
|
||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
[JsonPropertyName("displayname")]
|
[JsonPropertyName("server_profile")]
|
||||||
public string DisplayName { get; set; } = default!;
|
public long ServerProfile { get; set; } = default!;
|
||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
[JsonPropertyName("selected_channel")]
|
[JsonPropertyName("selected_channel")]
|
||||||
public long SelectedChannel { get; set; }
|
public long SelectedChannel { get; set; }
|
||||||
@ -18,9 +18,6 @@ public class SocketUserSTC : STC
|
|||||||
[JsonPropertyName("status")]
|
[JsonPropertyName("status")]
|
||||||
public UserStatus Status { get; set; }
|
public UserStatus Status { get; set; }
|
||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
[JsonPropertyName("picture_type")]
|
|
||||||
public PictureType PictureType { get; set; }
|
|
||||||
[JsonInclude]
|
|
||||||
[JsonPropertyName("roles")]
|
[JsonPropertyName("roles")]
|
||||||
public long[] RoleIds { get; set; } = default!;
|
public long[] RoleIds { get; set; } = default!;
|
||||||
}
|
}
|
||||||
|
@ -6,9 +6,6 @@ namespace Luski.Shared.PublicServers.V1.ServerToClient.HTTP;
|
|||||||
|
|
||||||
public class UserOverrideSTC : STC
|
public class UserOverrideSTC : STC
|
||||||
{
|
{
|
||||||
[JsonInclude]
|
|
||||||
[JsonPropertyName("id")]
|
|
||||||
public long Id { get; set; }
|
|
||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
[JsonPropertyName("user_id")]
|
[JsonPropertyName("user_id")]
|
||||||
public long UserID { get; set; }
|
public long UserID { get; set; }
|
||||||
|
@ -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!;
|
||||||
|
}
|
@ -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;
|
3
Luski.Shared/PublicServers/V1/Shared/IServerEvent.cs
Normal file
3
Luski.Shared/PublicServers/V1/Shared/IServerEvent.cs
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
namespace Luski.Shared.PublicServers.V1.Shared;
|
||||||
|
|
||||||
|
public interface IServerEvent;
|
43
Luski.Shared/PublicServers/V1/Shared/MessageEvent.cs
Normal file
43
Luski.Shared/PublicServers/V1/Shared/MessageEvent.cs
Normal file
@ -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<ServerFileInfoSTC>();
|
||||||
|
[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;
|
37
Luski.Shared/PublicServers/V1/Shared/RoleEvent.cs
Normal file
37
Luski.Shared/PublicServers/V1/Shared/RoleEvent.cs
Normal file
@ -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;
|
24
Luski.Shared/PublicServers/V1/Shared/RoleMemberEvent.cs
Normal file
24
Luski.Shared/PublicServers/V1/Shared/RoleMemberEvent.cs
Normal file
@ -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;
|
22
Luski.Shared/PublicServers/V1/Shared/ServerEvent.cs
Normal file
22
Luski.Shared/PublicServers/V1/Shared/ServerEvent.cs
Normal file
@ -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;
|
24
Luski.Shared/PublicServers/V1/Shared/StatusEvent.cs
Normal file
24
Luski.Shared/PublicServers/V1/Shared/StatusEvent.cs
Normal file
@ -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;
|
Loading…
Reference in New Issue
Block a user