Add Vexer connector suite, format normalizers, and tooling
This commit is contained in:
@@ -570,3 +570,35 @@ internal sealed class VexCacheEntryRecord
|
||||
expires);
|
||||
}
|
||||
}
|
||||
|
||||
[BsonIgnoreExtraElements]
|
||||
internal sealed class VexConnectorStateDocument
|
||||
{
|
||||
[BsonId]
|
||||
public string ConnectorId { get; set; } = default!;
|
||||
|
||||
public DateTime? LastUpdated { get; set; }
|
||||
= null;
|
||||
|
||||
public List<string> DocumentDigests { get; set; } = new();
|
||||
|
||||
public static VexConnectorStateDocument FromRecord(VexConnectorState state)
|
||||
=> new()
|
||||
{
|
||||
ConnectorId = state.ConnectorId,
|
||||
LastUpdated = state.LastUpdated?.UtcDateTime,
|
||||
DocumentDigests = state.DocumentDigests.ToList(),
|
||||
};
|
||||
|
||||
public VexConnectorState ToRecord()
|
||||
{
|
||||
var lastUpdated = LastUpdated.HasValue
|
||||
? new DateTimeOffset(DateTime.SpecifyKind(LastUpdated.Value, DateTimeKind.Utc))
|
||||
: (DateTimeOffset?)null;
|
||||
|
||||
return new VexConnectorState(
|
||||
ConnectorId,
|
||||
lastUpdated,
|
||||
DocumentDigests.ToImmutableArray());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user