Compare commits

...

3 Commits

Author SHA1 Message Date
deb911cb0a Syncshell Public & MCDF Share 2025-11-01 19:55:54 +01:00
0abb078c21 Update API for TypingState 2025-10-04 09:58:57 +02:00
5fc7969adf Hotfix - Update API 2025-09-29 00:24:20 +02:00
11 changed files with 114 additions and 3 deletions

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,10 @@
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; }
}

View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
namespace MareSynchronos.API.Dto.McdfShare;
public class McdfShareEntryDto
{
public Guid Id { get; set; }
public string Description { get; set; } = string.Empty;
public DateTime CreatedUtc { get; set; }
public DateTime? UpdatedUtc { get; set; }
public DateTime? ExpiresAtUtc { get; set; }
public bool IsOwner { get; set; }
public string OwnerUid { get; set; } = string.Empty;
public string OwnerAlias { get; set; } = string.Empty;
public int DownloadCount { get; set; }
public List<string> AllowedIndividuals { get; set; } = [];
public List<string> AllowedSyncshells { get; set; } = [];
}

View File

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

View File

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

View File

@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
namespace MareSynchronos.API.Dto.McdfShare;
public class McdfShareUploadRequestDto
{
public Guid ShareId { get; set; }
public string Description { get; set; } = string.Empty;
public byte[] CipherData { get; set; } = Array.Empty<byte>();
public byte[] Nonce { get; set; } = Array.Empty<byte>();
public byte[] Salt { get; set; } = Array.Empty<byte>();
public byte[] Tag { get; set; } = Array.Empty<byte>();
public DateTime? ExpiresAtUtc { get; set; }
public List<string> AllowedIndividuals { get; set; } = [];
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,11 @@
using MareSynchronos.API.Data;
using MessagePack;
namespace MareSynchronos.API.Dto.User;
public record TypingStateDto(UserData User, bool IsTyping);
[MessagePackObject(keyAsPropertyName: true)]
public record TypingStateDto(UserData User, bool IsTyping)
{
public UserData User { get; set; } = User;
public bool IsTyping { get; set; } = IsTyping;
}

View File

@@ -38,6 +38,8 @@ public interface IMareHubClient : IMareHub
void OnUserChatMsg(Action<UserChatMsgDto> chatMsgDto);
void OnUserTypingState(Action<TypingStateDto> act);
void OnUserReceiveCharacterData(Action<OnlineUserCharaDataDto> act);
void OnUserReceiveUploadStatus(Action<UserDto> act);