Compare commits

..

6 Commits

13 changed files with 138 additions and 2 deletions

View File

@@ -0,0 +1,9 @@
namespace MareSynchronos.API.Data.Enum;
public enum TypingScope
{
Unknown = 0,
Proximity = 1, // Parler/Crier/Hurler
Party = 2,
CrossParty = 3
}

View File

@@ -10,6 +10,8 @@ public record GroupInfoDto(GroupData Group, UserData Owner, GroupPermissions Gro
{
public GroupPermissions GroupPermissions { get; set; } = GroupPermissions;
public UserData Owner { get; set; } = Owner;
public bool AutoDetectVisible { get; set; }
public bool PasswordTemporarilyDisabled { get; set; }
public string OwnerUID => Owner.UID;
public string? OwnerAlias => Owner.Alias;

View File

@@ -0,0 +1,15 @@
using MessagePack;
namespace MareSynchronos.API.Dto.Group;
[MessagePackObject(keyAsPropertyName: true)]
public sealed record SyncshellDiscoveryEntryDto
{
public string GID { get; init; } = string.Empty;
public string? Alias { get; init; }
public string OwnerUID { get; init; } = string.Empty;
public string? OwnerAlias { get; init; }
public int MemberCount { get; init; }
public bool AutoAcceptPairs { get; init; }
public string? Description { get; init; }
}

View File

@@ -0,0 +1,11 @@
using MessagePack;
namespace MareSynchronos.API.Dto.Group;
[MessagePackObject(keyAsPropertyName: true)]
public sealed record SyncshellDiscoveryStateDto
{
public string GID { get; init; } = string.Empty;
public bool AutoDetectVisible { get; init; }
public bool PasswordTemporarilyDisabled { get; init; }
}

View File

@@ -0,0 +1,16 @@
using MessagePack;
namespace MareSynchronos.API.Dto.Group;
[MessagePackObject(keyAsPropertyName: true)]
public sealed record SyncshellDiscoveryVisibilityRequestDto
{
public string GID { get; init; } = string.Empty;
public bool AutoDetectVisible { get; init; }
public int? DisplayDurationHours { get; init; }
public int[]? ActiveWeekdays { get; init; }
public string? TimeStartLocal { get; init; }
public string? TimeEndLocal { get; init; }
public string? TimeZone { get; init; }
}

View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using MessagePack;
namespace MareSynchronos.API.Dto.McdfShare;
[MessagePackObject]
public class McdfShareEntryDto
{
[Key(0)] public Guid Id { get; set; }
[Key(1)] public string Description { get; set; } = string.Empty;
[Key(2)] public DateTime CreatedUtc { get; set; }
[Key(3)] public DateTime? UpdatedUtc { get; set; }
[Key(4)] public DateTime? ExpiresAtUtc { get; set; }
[Key(5)] public bool IsOwner { get; set; }
[Key(6)] public string OwnerUid { get; set; } = string.Empty;
[Key(7)] public string OwnerAlias { get; set; } = string.Empty;
[Key(8)] public int DownloadCount { get; set; }
[Key(9)] public List<string> AllowedIndividuals { get; set; } = [];
[Key(10)] public List<string> AllowedSyncshells { get; set; } = [];
}

View File

@@ -0,0 +1,17 @@
using System;
using MessagePack;
namespace MareSynchronos.API.Dto.McdfShare;
[MessagePackObject]
public class McdfSharePayloadDto
{
[Key(0)] public Guid ShareId { get; set; }
[Key(1)] public string Description { get; set; } = string.Empty;
[Key(2)] public byte[] CipherData { get; set; } = Array.Empty<byte>();
[Key(3)] public byte[] Nonce { get; set; } = Array.Empty<byte>();
[Key(4)] public byte[] Salt { get; set; } = Array.Empty<byte>();
[Key(5)] public byte[] Tag { get; set; } = Array.Empty<byte>();
[Key(6)] public DateTime CreatedUtc { get; set; }
[Key(7)] public DateTime? ExpiresAtUtc { get; set; }
}

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using MessagePack;
namespace MareSynchronos.API.Dto.McdfShare;
[MessagePackObject]
public class McdfShareUpdateRequestDto
{
[Key(0)] public Guid ShareId { get; set; }
[Key(1)] public string Description { get; set; } = string.Empty;
[Key(2)] public DateTime? ExpiresAtUtc { get; set; }
[Key(3)] public List<string> AllowedIndividuals { get; set; } = [];
[Key(4)] public List<string> AllowedSyncshells { get; set; } = [];
}

View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using MessagePack;
namespace MareSynchronos.API.Dto.McdfShare;
[MessagePackObject]
public class McdfShareUploadRequestDto
{
[Key(0)] public Guid ShareId { get; set; }
[Key(1)] public string Description { get; set; } = string.Empty;
[Key(2)] public byte[] CipherData { get; set; } = Array.Empty<byte>();
[Key(3)] public byte[] Nonce { get; set; } = Array.Empty<byte>();
[Key(4)] public byte[] Salt { get; set; } = Array.Empty<byte>();
[Key(5)] public byte[] Tag { get; set; } = Array.Empty<byte>();
[Key(6)] public DateTime? ExpiresAtUtc { get; set; }
[Key(7)] public List<string> AllowedIndividuals { get; set; } = [];
[Key(8)] public List<string> AllowedSyncshells { get; set; } = [];
}

View File

@@ -6,4 +6,5 @@ namespace MareSynchronos.API.Dto;
public record SystemInfoDto
{
public int OnlineUsers { get; set; }
}
public bool SupportsTypingState { get; set; }
}

View File

@@ -1,5 +1,13 @@
using MareSynchronos.API.Data;
using MareSynchronos.API.Data.Enum;
using MessagePack;
namespace MareSynchronos.API.Dto.User;
public record TypingStateDto(UserData User, bool IsTyping);
[MessagePackObject(keyAsPropertyName: true)]
public record TypingStateDto(UserData User, bool IsTyping, TypingScope Scope)
{
public UserData User { get; set; } = User;
public bool IsTyping { get; set; } = IsTyping;
public TypingScope Scope { get; set; } = Scope;
}

View File

@@ -4,6 +4,7 @@
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<NoWarn>$(NoWarn);NU1900</NoWarn>
</PropertyGroup>
<ItemGroup>

View File

@@ -131,6 +131,7 @@ public interface IMareHub
Task UserSetProfile(UserProfileDto userDescription);
Task UserSetTypingState(bool isTyping);
Task UserSetTypingState(bool isTyping, TypingScope scope);
Task<CharaDataFullDto?> CharaDataCreate();
Task<CharaDataFullDto?> CharaDataUpdate(CharaDataUpdateDto updateDto);
Task<bool> CharaDataDelete(string id);