Files
Heimdall/src/Heimdall.Application/DTOs/DiscoveryDto.cs
T
Arnaud Dartois 58b6a1de9b feat(app): implement all open issues - camera access control, i18n, GPU, mDNS, site filtering
- Implement UserCameraAccess entity and CRUD API (issues #131, #133)
- Add CameraAccessPanel UI component for granular access management (issue #134)
- Implement camera toggle UI (issues #59, #199)
- Implement site filtering by user rights (issue #136)
- Implement Groups camera access assignment (issue #138)
- Implement audit logging for camera access changes (issue #140)
- Add comprehensive camera access test coverage (issue #141)
- Implement i18n/l10n localization infrastructure (issue #142)
- Implement OpenTelemetry metrics infrastructure (issue #14)
- Implement Agent GPU worker (issue #76)
- Implement Agent remote sensor mode (issue #75)
- Fix Docker GPU exposure in compose files (issues #76, #77)
- Fix mDNS divergence by extracting shared MdnsClient library (issue #81)
- Implement User email confirm/edit UI (issues #88, #89)
- Implement Persons UI (issue #11)
- Fix E2E test timing issues by increasing circuit delay

- Add MdnsClient library with unified unicast/multicast mDNS support
- Refactor MdnsProbeService and HomeKitMdnsProbe to use shared client
- Add GroupCameraAccess entity for group-based camera access
- Add comprehensive camera access test coverage
- Add i18n localization infrastructure with fr/en support
- Add Docker GPU exposure for NVIDIA/AMD/Intel
- Update Docker compose files with GPU device exposure
- Fix mDNS divergence between Central unicast and Agent multicast
- Fix E2E test timing issues with increased circuit delay

All 1700+ tests pass (unit + integration)
2026-10-11 21:23:16 +02:00

154 lines
6.4 KiB
C#

using Heimdall.Domain.Enums;
namespace Heimdall.Application.DTOs;
// ────────────────────────────────────────────────────────────────────
// Probe Requests
// ────────────────────────────────────────────────────────────────────
/// <summary>Probe a single IP address for camera services.</summary>
public record ProbeRequest(Guid SiteId, string Ip);
/// <summary>Scan an entire subnet for cameras.</summary>
public record ScanRequest(Guid SiteId, string SubnetCidr, int TimeoutMs = 30000);
// ────────────────────────────────────────────────────────────────────
// Probe Responses
// ────────────────────────────────────────────────────────────────────
/// <summary>Full probe result for a single IP, combining all detection methods.</summary>
public record ProbeResponse(
string Ip,
bool IsReachable,
DetectedCameraType CameraType,
CameraDiscoveryMethod DiscoveryMethod,
ArpInfo? Arp,
int[] OpenPorts,
OnvifProbeInfo? Onvif,
HttpProbeInfo? Http,
HomeKitProbeInfo? HomeKit,
string[]? MatchedBrands);
/// <summary>ARP table lookup result.</summary>
public record ArpInfo(string MacAddress, string? Vendor);
/// <summary>ONVIF WS-Discovery probe result.</summary>
public record OnvifProbeInfo(
string DeviceServiceUrl,
int Port,
string? Name,
string? Hardware,
string? Location);
/// <summary>HTTP probe result (server header analysis).</summary>
public record HttpProbeInfo(int Port, int StatusCode, string? ServerHeader);
/// <summary>HomeKit / mDNS probe result.</summary>
public record HomeKitProbeInfo(
string Name,
string DeviceId,
string Model,
int Category,
bool IsPaired,
int Port);
// ────────────────────────────────────────────────────────────────────
// Scan Progress
// ────────────────────────────────────────────────────────────────────
/// <summary>Progress update emitted during a subnet scan.</summary>
public record ScanProgress(
int TotalHosts,
int Scanned,
int Discovered,
string? CurrentIp);
// ────────────────────────────────────────────────────────────────────
// Camera Database Search
// ────────────────────────────────────────────────────────────────────
/// <summary>Result from the camera database (preset, brand, or model).</summary>
public record CameraDbEntry(
string Type, // "preset" | "brand" | "model"
string Id, // "p:{id}" | "b:{id}" | "m:{brand}:{model}"
string Name);
/// <summary>Search response.</summary>
public record SearchResponse(CameraDbEntry[] Results);
/// <summary>Build stream URLs from database entries.</summary>
public record StreamBuildRequest(
string[] Ids, // e.g. ["b:hikvision", "p:onvif"]
string Ip,
string? Username,
string? Password,
int Channel = 0,
int[]? PortFilter = null);
/// <summary>Stream build response.</summary>
public record StreamBuildResponse(string[] Streams);
// ────────────────────────────────────────────────────────────────────
// Stream Testing
// ────────────────────────────────────────────────────────────────────
/// <summary>Request to test a set of stream URLs.</summary>
public record StreamTestRequest(string SourceId, string[] Streams);
/// <summary>A tested stream result.</summary>
public record StreamTestResult(
string SourceUrl,
string[] Codecs,
int Width,
int Height,
long LatencyMs,
string? ScreenshotUrl,
bool IsAlive);
/// <summary>The session state for stream testing (polled).</summary>
public record StreamTestSession(
Guid SessionId,
string Status, // "running" | "done"
int Total,
int Tested,
int Alive,
StreamTestResult[] Results);
// ────────────────────────────────────────────────────────────────────
// Confirm Discovery
// ────────────────────────────────────────────────────────────────────
/// <summary>Confirm a discovery result and create a Camera entity.</summary>
public record ConfirmDiscoveryRequest(
Guid SiteId,
string Name,
Guid DiscoveryResultId,
string MainStreamUrl,
string? SubStreamUrl,
string? Username,
string? Password,
CameraDetectionProfileRequest? DetectionProfile,
Guid? AgentId = null);
/// <summary>Check if a camera already exists for this IP/MAC before confirming.</summary>
public record CheckDuplicateRequest(Guid SiteId, string Ip, string? Mac);
/// <summary>Result of a duplicate check.</summary>
public record CameraCheckResponse(
bool IsDuplicate,
Guid? ExistingCameraId,
string? ExistingName,
string? ExistingIp,
string? ExistingMac,
string? ExistingStatus);
/// <summary>Inline detection profile during camera creation.</summary>
public record CameraDetectionProfileRequest(
bool DetectPerson = true,
bool DetectVehicle = true,
bool DetectAnimal = false,
bool DetectPackage = false,
bool DetectMotion = true,
bool FaceRecognition = true,
bool LicensePlateRecognition = true);