family update

This commit is contained in:
lendry
2026-06-24 23:17:24 +03:00
parent 9727cf3f35
commit f2366a69a0
18 changed files with 1374 additions and 103 deletions

View File

@@ -20,6 +20,7 @@ import { FamilyService } from './family.service';
import { MediaService } from './media.service';
import { NotificationsService } from './notifications.service';
import { ChatService } from './chat.service';
import { PresenceService } from './presence.service';
import { TotpService } from './totp.service';
import { MessagingService } from '../infra/messaging.service';
@@ -44,6 +45,7 @@ export class AuthGrpcController {
private readonly media: MediaService,
private readonly notifications: NotificationsService,
private readonly chat: ChatService,
private readonly presence: PresenceService,
private readonly messaging: MessagingService,
private readonly totp: TotpService
) {}
@@ -624,6 +626,21 @@ export class AuthGrpcController {
return this.media.getChatMediaAccessUrl(command.requesterId, command.roomId, command.storageKey, command.fileName);
}
@GrpcMethod('MediaService', 'CreateChatRoomAvatarUploadUrl')
createChatRoomAvatarUploadUrl(command: { requesterId: string; roomId: string; contentType: string }) {
return this.media.createChatRoomAvatarUploadUrl(command.requesterId, command.roomId, command.contentType);
}
@GrpcMethod('MediaService', 'ConfirmChatRoomAvatar')
confirmChatRoomAvatar(command: { requesterId: string; roomId: string; storageKey: string }) {
return this.media.confirmChatRoomAvatar(command.requesterId, command.roomId, command.storageKey);
}
@GrpcMethod('MediaService', 'GetChatRoomAvatarAccessUrl')
getChatRoomAvatarAccessUrl(command: { requesterId: string; roomId: string }) {
return this.media.getChatRoomAvatarAccessUrl(command.requesterId, command.roomId);
}
@GrpcMethod('OAuthCoreService', 'Authorize')
authorize(command: { userId: string; clientId: string; redirectUri: string; scope: string; state?: string }) {
return this.oauthCore.authorize(command);
@@ -738,6 +755,11 @@ export class AuthGrpcController {
return this.family.listInvites(command.userId, command.groupId);
}
@GrpcMethod('FamilyService', 'GetFamilyPresence')
getFamilyPresence(command: { requesterId: string; groupId: string }) {
return this.presence.getFamilyPresence(command.requesterId, command.groupId);
}
@GrpcMethod('NotificationsService', 'ListNotifications')
listNotifications(command: { userId: string; limit?: number; unreadOnly?: boolean }) {
return this.notifications.list(command.userId, command.limit, command.unreadOnly);
@@ -783,6 +805,16 @@ export class AuthGrpcController {
return this.chat.updateRoomSettings(command.userId, command.roomId, command.name, command.notificationsMuted);
}
@GrpcMethod('ChatService', 'AddRoomMember')
addChatRoomMember(command: { userId: string; roomId: string; memberUserId: string }) {
return this.chat.addRoomMember(command.userId, command.roomId, command.memberUserId);
}
@GrpcMethod('ChatService', 'RemoveRoomMember')
removeChatRoomMember(command: { userId: string; roomId: string; memberUserId: string }) {
return this.chat.removeRoomMember(command.userId, command.roomId, command.memberUserId);
}
@GrpcMethod('ChatService', 'ListMessages')
listChatMessages(command: { userId: string; roomId: string; beforeMessageId?: string; limit?: number }) {
return this.chat.listMessages(command.userId, command.roomId, command.beforeMessageId, command.limit);
@@ -823,6 +855,21 @@ export class AuthGrpcController {
return this.chat.setRoomNotificationsMuted(command.userId, command.roomId, command.muted);
}
@GrpcMethod('ChatService', 'EditMessage')
editChatMessage(command: { userId: string; messageId: string; content: string }) {
return this.chat.editMessage(command.userId, command.messageId, command.content);
}
@GrpcMethod('ChatService', 'DeleteMessage')
deleteChatMessage(command: { userId: string; messageId: string }) {
return this.chat.deleteMessage(command.userId, command.messageId);
}
@GrpcMethod('ChatService', 'MarkRoomRead')
markChatRoomRead(command: { userId: string; roomId: string; lastMessageId?: string }) {
return this.chat.markRoomRead(command.userId, command.roomId, command.lastMessageId);
}
private toSessionResponse(session: { id: string; userId: string; deviceId: string | null; pinVerified: boolean; status: string; ipAddress: string | null; userAgent: string | null; expiresAt: Date; createdAt: Date; updatedAt: Date }) {
return {
id: session.id,