diff options
| author | Christian Cleberg <[email protected]> | 2026-04-21 22:54:40 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-04-21 22:54:40 -0500 |
| commit | e73d58ee5dd43eaeaaa717f7781cc22256df30f0 (patch) | |
| tree | 2eb84058b37f4edfb6cf6ad7205c08a2af374938 /LookupSnapshot.swift | |
| parent | 22ecca12b4fe0e0850401754c674632f322d919d (diff) | |
| download | domain-dig-e73d58ee5dd43eaeaaa717f7781cc22256df30f0.tar.gz domain-dig-e73d58ee5dd43eaeaaa717f7781cc22256df30f0.tar.bz2 domain-dig-e73d58ee5dd43eaeaaa717f7781cc22256df30f0.zip | |
feat(v2.4.0): add JSON output, CLI foundation, and shared report layer
* introduce DomainReport as canonical output model
* add JSON export for single and batch results
* create DomainReportBuilder for reusable report construction
* add CLI target using shared inspection pipeline
* refactor services for UI-independent usage
* ensure consistency across TXT, CSV, and JSON outputs
Diffstat (limited to 'LookupSnapshot.swift')
| -rw-r--r-- | LookupSnapshot.swift | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/LookupSnapshot.swift b/LookupSnapshot.swift new file mode 100644 index 0000000..3a35eff --- /dev/null +++ b/LookupSnapshot.swift @@ -0,0 +1,89 @@ +import Foundation + +struct LookupSnapshot { + let historyEntryID: UUID? + let domain: String + let timestamp: Date + let trackedDomainID: UUID? + let resolverDisplayName: String + let resolverURLString: String + let totalLookupDurationMs: Int? + let dnsSections: [DNSSection] + let dnsError: String? + let availabilityResult: DomainAvailabilityResult? + let suggestions: [DomainSuggestionResult] + let sslInfo: SSLCertificateInfo? + let sslError: String? + let hstsPreloaded: Bool? + let httpHeaders: [HTTPHeader] + let httpSecurityGrade: String? + let httpStatusCode: Int? + let httpResponseTimeMs: Int? + let httpProtocol: String? + let http3Advertised: Bool + let httpHeadersError: String? + let reachabilityResults: [PortReachability] + let reachabilityError: String? + let ipGeolocation: IPGeolocation? + let ipGeolocationError: String? + let emailSecurity: EmailSecurityResult? + let emailSecurityError: String? + let ownership: DomainOwnership? + let ownershipError: String? + let ptrRecord: String? + let ptrError: String? + let redirectChain: [RedirectHop] + let redirectChainError: String? + let subdomains: [DiscoveredSubdomain] + let subdomainsError: String? + let portScanResults: [PortScanResult] + let portScanError: String? + let changeSummary: DomainChangeSummary? + let isLive: Bool +} + +extension HistoryEntry { + var snapshot: LookupSnapshot { + LookupSnapshot( + historyEntryID: id, + domain: domain, + timestamp: timestamp, + trackedDomainID: trackedDomainID, + resolverDisplayName: resolverDisplayName, + resolverURLString: resolverURLString, + totalLookupDurationMs: totalLookupDurationMs, + dnsSections: dnsSections, + dnsError: nil, + availabilityResult: availabilityResult, + suggestions: suggestions, + sslInfo: sslInfo, + sslError: sslError, + hstsPreloaded: hstsPreloaded, + httpHeaders: httpHeaders, + httpSecurityGrade: HTTPSecurityGrade.grade(for: httpHeaders).rawValue, + httpStatusCode: nil, + httpResponseTimeMs: nil, + httpProtocol: nil, + http3Advertised: false, + httpHeadersError: httpHeadersError, + reachabilityResults: reachabilityResults, + reachabilityError: reachabilityError, + ipGeolocation: ipGeolocation, + ipGeolocationError: ipGeolocationError, + emailSecurity: emailSecurity, + emailSecurityError: emailSecurityError, + ownership: ownership, + ownershipError: ownershipError, + ptrRecord: ptrRecord, + ptrError: ptrError, + redirectChain: redirectChain, + redirectChainError: redirectChainError, + subdomains: subdomains, + subdomainsError: subdomainsError, + portScanResults: portScanResults, + portScanError: portScanError, + changeSummary: changeSummary, + isLive: false + ) + } +} |
