/** * Command DTOs * * Data Transfer Objects for command message operations. */ import { IsString, IsObject, IsNotEmpty, IsNumber } from "class-validator"; import type { CommandMessage } from "../types/message.types"; /** * DTO for sending a command to a remote instance */ export class SendCommandDto { @IsString() @IsNotEmpty() connectionId!: string; @IsString() @IsNotEmpty() commandType!: string; @IsObject() @IsNotEmpty() payload!: Record; } /** * DTO for incoming command request from remote instance */ export class IncomingCommandDto implements CommandMessage { @IsString() @IsNotEmpty() messageId!: string; @IsString() @IsNotEmpty() instanceId!: string; @IsString() @IsNotEmpty() commandType!: string; @IsObject() @IsNotEmpty() payload!: Record; @IsNumber() @IsNotEmpty() timestamp!: number; @IsString() @IsNotEmpty() signature!: string; }