@sdxc/zone-file 2026.10.10 → 2026.10.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/types.d.ts CHANGED
@@ -7,7 +7,7 @@
7
7
  * @copyright Sergio Xalambrí 2026
8
8
  */
9
9
  /** The record types whose data is read into typed fields. */
10
- export type TypedRecordType = "A" | "AAAA" | "CNAME" | "NS" | "PTR" | "DNAME" | "MX" | "TXT" | "CAA" | "SRV" | "SOA";
10
+ export type TypedRecordType = "A" | "AAAA" | "CNAME" | "NS" | "PTR" | "DNAME" | "MX" | "TXT" | "CAA" | "SRV" | "SOA" | "SVCB" | "HTTPS" | "TLSA" | "DS" | "CDS" | "DNSKEY" | "CDNSKEY";
11
11
  /** A record type by mnemonic; the typed ones autocomplete, any other name is accepted. */
12
12
  export type RecordType = TypedRecordType | (string & {});
13
13
  /** A record class; `IN` is the internet, `CLASSnnn` spells one without a mnemonic. */
@@ -90,13 +90,102 @@ export interface SOAData {
90
90
  /** Bounds how long a negative answer may be cached (RFC 2308). */
91
91
  minimum: number;
92
92
  }
93
+ /**
94
+ * The parameters of an SVCB or HTTPS record (RFC 9460), one optional field per key. A key
95
+ * that is absent was not published; `true` marks a key published without a value.
96
+ */
97
+ export interface SvcParams {
98
+ /** Keys a client must understand to use the record, by presentation name (`alpn`, `key65000`). */
99
+ mandatory?: string[];
100
+ /** Protocol ids (`h2`, `h3`) in the publisher's order of preference. */
101
+ alpn?: string[];
102
+ /** The default ALPN (`http/1.1` for HTTPS) is unsupported; only `alpn` applies. */
103
+ noDefaultAlpn?: true;
104
+ port?: number;
105
+ /** IPv4 addresses a client may use before the target's A records resolve. */
106
+ ipv4Hint?: string[];
107
+ /** The ECHConfigList, base64-encoded as the presentation format writes it. */
108
+ ech?: string;
109
+ /** IPv6 addresses in RFC 5952 canonical form, as hints like `ipv4Hint`. */
110
+ ipv6Hint?: string[];
111
+ /** The DoH URI template's path (RFC 9461), relative to the target. */
112
+ dohPath?: string;
113
+ /** The service accepts Oblivious HTTP requests (RFC 9540). */
114
+ ohttp?: true;
115
+ /** Keys without a reading here, by key number, each value's octets read as UTF-8. */
116
+ other?: {
117
+ [key: number]: string;
118
+ };
119
+ }
120
+ /** A service binding (RFC 9460): where and how to reach the service at the owner. */
121
+ export interface SVCBData {
122
+ type: "SVCB";
123
+ /** `0` is AliasMode, which only names `target`; any other value orders ServiceMode records, lowest first. */
124
+ priority: number;
125
+ /** The service's host; `"."` means the owner itself in ServiceMode and no service in AliasMode. */
126
+ target: string;
127
+ params: SvcParams;
128
+ }
129
+ /** The SVCB record for HTTPS origins (RFC 9460), published at the origin's own name. */
130
+ export interface HTTPSData extends Omit<SVCBData, "type"> {
131
+ type: "HTTPS";
132
+ }
133
+ /** Binds a TLS certificate or public key to a service, DANE (RFC 6698, RFC 7671). */
134
+ export interface TLSAData {
135
+ type: "TLSA";
136
+ /** `0` PKIX-TA, `1` PKIX-EE, `2` DANE-TA, `3` DANE-EE. */
137
+ usage: number;
138
+ /** `0` matches the whole certificate, `1` its SubjectPublicKeyInfo. */
139
+ selector: number;
140
+ /** `0` the exact bytes, `1` their SHA-256, `2` their SHA-512. */
141
+ matchingType: number;
142
+ /** Lowercase hex. */
143
+ certificateAssociation: string;
144
+ }
145
+ /** A digest of the child zone's key-signing key, published in the parent (RFC 4034). */
146
+ export interface DSData {
147
+ type: "DS";
148
+ /** The key tag of the DNSKEY the digest is of, for picking it out of the child's key set. */
149
+ keyTag: number;
150
+ /** The DNSSEC algorithm number; `13` is ECDSA P-256 with SHA-256. */
151
+ algorithm: number;
152
+ /** `1` SHA-1, `2` SHA-256, `4` SHA-384. */
153
+ digestType: number;
154
+ /** Lowercase hex. */
155
+ digest: string;
156
+ }
157
+ /** The child's DS record as it asks the parent to publish it (RFC 7344); `0 0 0 00` asks for removal. */
158
+ export interface CDSData extends Omit<DSData, "type"> {
159
+ type: "CDS";
160
+ }
161
+ /** A zone's public signing key (RFC 4034). */
162
+ export interface DNSKEYData {
163
+ type: "DNSKEY";
164
+ /** The flags as published, so the record prints back unchanged. */
165
+ flags: number;
166
+ /** Bit 7 of `flags`: the key signs the zone's records; DNSSEC ignores a key without it. */
167
+ zoneKey: boolean;
168
+ /** Bit 15 of `flags`: the key is a key-signing key, the one a DS record points at. */
169
+ secureEntryPoint: boolean;
170
+ /** Always `3` in a valid key. */
171
+ protocol: number;
172
+ algorithm: number;
173
+ /** Base64, as the presentation format writes it. */
174
+ publicKey: string;
175
+ /** The RFC 4034 Appendix B tag a DS or RRSIG names this key by. */
176
+ keyTag: number;
177
+ }
178
+ /** The child's DNSKEY as it asks the parent to derive a DS from it (RFC 7344). */
179
+ export interface CDNSKEYData extends Omit<DNSKEYData, "type"> {
180
+ type: "CDNSKEY";
181
+ }
93
182
  /** Data of a type without a typed reading, kept as written. */
94
183
  export interface UnknownData {
95
184
  type: string;
96
185
  data: string;
97
186
  }
98
187
  /** A record's type-specific fields, what `parseRecordData` reads out of RDATA. */
99
- export type RecordData<Type extends RecordType> = Type extends "A" ? AData : Type extends "AAAA" ? AAAAData : Type extends "CNAME" ? CNAMEData : Type extends "NS" ? NSData : Type extends "PTR" ? PTRData : Type extends "DNAME" ? DNAMEData : Type extends "MX" ? MXData : Type extends "TXT" ? TXTData : Type extends "CAA" ? CAAData : Type extends "SRV" ? SRVData : Type extends "SOA" ? SOAData : UnknownData;
188
+ export type RecordData<Type extends RecordType> = Type extends "A" ? AData : Type extends "AAAA" ? AAAAData : Type extends "CNAME" ? CNAMEData : Type extends "NS" ? NSData : Type extends "PTR" ? PTRData : Type extends "DNAME" ? DNAMEData : Type extends "MX" ? MXData : Type extends "TXT" ? TXTData : Type extends "CAA" ? CAAData : Type extends "SRV" ? SRVData : Type extends "SOA" ? SOAData : Type extends "SVCB" ? SVCBData : Type extends "HTTPS" ? HTTPSData : Type extends "TLSA" ? TLSAData : Type extends "DS" ? DSData : Type extends "CDS" ? CDSData : Type extends "DNSKEY" ? DNSKEYData : Type extends "CDNSKEY" ? CDNSKEYData : UnknownData;
100
189
  /** What every record read from a file carries beside its data. */
101
190
  export interface RecordFields {
102
191
  /** Absolute, lowercased, no trailing dot; the root is `"."`. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sdxc/zone-file",
3
- "version": "2026.10.10",
3
+ "version": "2026.10.25",
4
4
  "description": "Read and write RFC 1035 DNS zone files, with the record data codec for every typed record",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -8,9 +8,9 @@
8
8
  ".": "./dist/index.js"
9
9
  },
10
10
  "dependencies": {
11
- "@sdxc/result": "2026.10.6"
11
+ "@sdxc/result": "2026.10.13"
12
12
  },
13
- "gitHead": "b61f19c59866708a2d89a5a8f4655ebbc16941b0",
13
+ "gitHead": "1440b969c0a3e3808dfcee3f17d2ef43915f32a8",
14
14
  "publishConfig": {
15
15
  "access": "public"
16
16
  },
@@ -19,7 +19,7 @@
19
19
  "url": "git+https://github.com/sergiodxa/monorepo.git",
20
20
  "directory": "packages/zone-file"
21
21
  },
22
- "homepage": "https://sdxc.sergiodxa.com/api/zone-file",
22
+ "homepage": "https://sdxc.dev/api/zone-file",
23
23
  "author": {
24
24
  "name": "Sergio Xalambrí",
25
25
  "url": "https://sergiodxa.com"