logical.isEmptyconstno test imports itconst isEmpty: (p: DnsPlan) => booleanWhether a plan changes nothing.
The plan of a DNS zone: from the records wanted and the records found, the ones to create, to update and to remove. A profile removes only what it claims: a record that carries its marker, never the rest of the zone.
import { planDns } from "./dns.ts";
planDns([{ type: "A", name: "a.example.org", content: "192.0.2.1", ttl: 300, proxied: false }], []).create.length; // 1logical.isEmptyconstno test imports itconst isEmpty: (p: DnsPlan) => booleanWhether a plan changes nothing.
logical.planDnsfunctionno test imports itfunction planDns(wanted: readonly DnsRecord[], found: readonly FoundRecord[]): DnsPlanThe plan to make the zone have the records wanted. A wanted name that is found without the marker is updated (the profile lists its exact name and so claims it); a found record that carries the marker and is not wanted is removed; all others are left.
logical.DnsPlantypeno test imports ittype DnsPlan = {
readonly create: readonly DnsRecord[];
readonly update: readonly { readonly id: string; readonly record: DnsRecord }[];
readonly remove: readonly FoundRecord[];
};What a plan changes.
logical.FoundRecordtypeno test imports ittype FoundRecord = DnsRecord & { readonly id: string; readonly comment: string };A record as the provider holds it: with its id and its comment.
isEmptyconstconst isEmpty: (p: DnsPlan) => booleanWhether a plan changes nothing.
planDnsfunctionfunction planDns(wanted: readonly DnsRecord[], found: readonly FoundRecord[]): DnsPlanThe plan to make the zone have the records wanted. A wanted name that is found without the marker is updated (the profile lists its exact name and so claims it); a found record that carries the marker and is not wanted is removed; all others are left.
DnsPlantypeno test imports ittype DnsPlan = {
readonly create: readonly DnsRecord[];
readonly update: readonly { readonly id: string; readonly record: DnsRecord }[];
readonly remove: readonly FoundRecord[];
};What a plan changes.
FoundRecordtypetype FoundRecord = DnsRecord & { readonly id: string; readonly comment: string };A record as the provider holds it: with its id and its comment.