Skip to content

Commit

Permalink
fix(BREAKING): make dns record types have consistent naming (#25357)
Browse files Browse the repository at this point in the history
Closes #15207
  • Loading branch information
dsherret authored Sep 2, 2024
1 parent 42cf762 commit a3bd1ba
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
30 changes: 15 additions & 15 deletions cli/tsc/dts/lib.deno.ns.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5773,7 +5773,7 @@ declare namespace Deno {
*
* @category Network
*/
export interface CAARecord {
export interface CaaRecord {
/** If `true`, indicates that the corresponding property tag **must** be
* understood if the semantics of the CAA record are to be correctly
* interpreted by an issuer.
Expand All @@ -5793,7 +5793,7 @@ declare namespace Deno {
* specified, it will return an array of objects with this interface.
*
* @category Network */
export interface MXRecord {
export interface MxRecord {
/** A priority value, which is a relative value compared to the other
* preferences of MX records for the domain. */
preference: number;
Expand All @@ -5805,7 +5805,7 @@ declare namespace Deno {
* specified, it will return an array of objects with this interface.
*
* @category Network */
export interface NAPTRRecord {
export interface NaptrRecord {
order: number;
preference: number;
flags: string;
Expand All @@ -5818,7 +5818,7 @@ declare namespace Deno {
* specified, it will return an array of objects with this interface.
*
* @category Network */
export interface SOARecord {
export interface SoaRecord {
mname: string;
rname: string;
serial: number;
Expand All @@ -5833,7 +5833,7 @@ declare namespace Deno {
*
* @category Network
*/
export interface SRVRecord {
export interface SrvRecord {
priority: number;
weight: number;
port: number;
Expand Down Expand Up @@ -5898,7 +5898,7 @@ declare namespace Deno {
query: string,
recordType: "CAA",
options?: ResolveDnsOptions,
): Promise<CAARecord[]>;
): Promise<CaaRecord[]>;

/**
* Performs DNS resolution against the given query, returning resolved
Expand Down Expand Up @@ -5928,7 +5928,7 @@ declare namespace Deno {
query: string,
recordType: "MX",
options?: ResolveDnsOptions,
): Promise<MXRecord[]>;
): Promise<MxRecord[]>;

/**
* Performs DNS resolution against the given query, returning resolved
Expand Down Expand Up @@ -5958,7 +5958,7 @@ declare namespace Deno {
query: string,
recordType: "NAPTR",
options?: ResolveDnsOptions,
): Promise<NAPTRRecord[]>;
): Promise<NaptrRecord[]>;

/**
* Performs DNS resolution against the given query, returning resolved
Expand Down Expand Up @@ -5988,7 +5988,7 @@ declare namespace Deno {
query: string,
recordType: "SOA",
options?: ResolveDnsOptions,
): Promise<SOARecord[]>;
): Promise<SoaRecord[]>;

/**
* Performs DNS resolution against the given query, returning resolved
Expand Down Expand Up @@ -6018,7 +6018,7 @@ declare namespace Deno {
query: string,
recordType: "SRV",
options?: ResolveDnsOptions,
): Promise<SRVRecord[]>;
): Promise<SrvRecord[]>;

/**
* Performs DNS resolution against the given query, returning resolved
Expand Down Expand Up @@ -6080,11 +6080,11 @@ declare namespace Deno {
options?: ResolveDnsOptions,
): Promise<
| string[]
| CAARecord[]
| MXRecord[]
| NAPTRRecord[]
| SOARecord[]
| SRVRecord[]
| CaaRecord[]
| MxRecord[]
| NaptrRecord[]
| SoaRecord[]
| SrvRecord[]
| string[][]
>;

Expand Down
20 changes: 10 additions & 10 deletions ext/node/polyfills/internal_binding/cares_wrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ export class ChannelWrap extends AsyncWrap implements ChannelWrapQuery {
);
}),
this.#query(name, "CAA").then(({ ret }) => {
(ret as Deno.CAARecord[]).forEach(({ critical, tag, value }) =>
(ret as Deno.CaaRecord[]).forEach(({ critical, tag, value }) =>
records.push({
type: "CAA",
[tag]: value,
Expand All @@ -284,7 +284,7 @@ export class ChannelWrap extends AsyncWrap implements ChannelWrapQuery {
);
}),
this.#query(name, "MX").then(({ ret }) => {
(ret as Deno.MXRecord[]).forEach(({ preference, exchange }) =>
(ret as Deno.MxRecord[]).forEach(({ preference, exchange }) =>
records.push({
type: "MX",
priority: preference,
Expand All @@ -293,7 +293,7 @@ export class ChannelWrap extends AsyncWrap implements ChannelWrapQuery {
);
}),
this.#query(name, "NAPTR").then(({ ret }) => {
(ret as Deno.NAPTRRecord[]).forEach(
(ret as Deno.NaptrRecord[]).forEach(
({ order, preference, flags, services, regexp, replacement }) =>
records.push({
type: "NAPTR",
Expand All @@ -317,7 +317,7 @@ export class ChannelWrap extends AsyncWrap implements ChannelWrapQuery {
);
}),
this.#query(name, "SOA").then(({ ret }) => {
(ret as Deno.SOARecord[]).forEach(
(ret as Deno.SoaRecord[]).forEach(
({ mname, rname, serial, refresh, retry, expire, minimum }) =>
records.push({
type: "SOA",
Expand All @@ -332,7 +332,7 @@ export class ChannelWrap extends AsyncWrap implements ChannelWrapQuery {
);
}),
this.#query(name, "SRV").then(({ ret }) => {
(ret as Deno.SRVRecord[]).forEach(
(ret as Deno.SrvRecord[]).forEach(
({ priority, weight, port, target }) =>
records.push({
type: "SRV",
Expand Down Expand Up @@ -378,7 +378,7 @@ export class ChannelWrap extends AsyncWrap implements ChannelWrapQuery {

queryCaa(req: QueryReqWrap, name: string): number {
this.#query(name, "CAA").then(({ code, ret }) => {
const records = (ret as Deno.CAARecord[]).map(
const records = (ret as Deno.CaaRecord[]).map(
({ critical, tag, value }) => ({
[tag]: value,
critical: +critical && 128,
Expand All @@ -401,7 +401,7 @@ export class ChannelWrap extends AsyncWrap implements ChannelWrapQuery {

queryMx(req: QueryReqWrap, name: string): number {
this.#query(name, "MX").then(({ code, ret }) => {
const records = (ret as Deno.MXRecord[]).map(
const records = (ret as Deno.MxRecord[]).map(
({ preference, exchange }) => ({
priority: preference,
exchange: fqdnToHostname(exchange),
Expand All @@ -416,7 +416,7 @@ export class ChannelWrap extends AsyncWrap implements ChannelWrapQuery {

queryNaptr(req: QueryReqWrap, name: string): number {
this.#query(name, "NAPTR").then(({ code, ret }) => {
const records = (ret as Deno.NAPTRRecord[]).map(
const records = (ret as Deno.NaptrRecord[]).map(
({ order, preference, flags, services, regexp, replacement }) => ({
flags,
service: services,
Expand Down Expand Up @@ -459,7 +459,7 @@ export class ChannelWrap extends AsyncWrap implements ChannelWrapQuery {

if (ret.length) {
const { mname, rname, serial, refresh, retry, expire, minimum } =
ret[0] as Deno.SOARecord;
ret[0] as Deno.SoaRecord;

record = {
nsname: fqdnToHostname(mname),
Expand All @@ -480,7 +480,7 @@ export class ChannelWrap extends AsyncWrap implements ChannelWrapQuery {

querySrv(req: QueryReqWrap, name: string): number {
this.#query(name, "SRV").then(({ code, ret }) => {
const records = (ret as Deno.SRVRecord[]).map(
const records = (ret as Deno.SrvRecord[]).map(
({ priority, weight, port, target }) => ({
priority,
weight,
Expand Down

0 comments on commit a3bd1ba

Please sign in to comment.