@xyo-network/dns
Advanced tools
Comparing version 2.110.10 to 2.110.11
@@ -1,7 +0,3 @@ | ||
var __defProp = Object.defineProperty; | ||
var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); | ||
// src/DnsRecordType.ts | ||
var DnsRecordType; | ||
(function(DnsRecordType2) { | ||
var DnsRecordType = /* @__PURE__ */ ((DnsRecordType2) => { | ||
DnsRecordType2[DnsRecordType2["A"] = 1] = "A"; | ||
@@ -19,7 +15,7 @@ DnsRecordType2[DnsRecordType2["AAAA"] = 28] = "AAAA"; | ||
DnsRecordType2[DnsRecordType2["TXT"] = 16] = "TXT"; | ||
})(DnsRecordType || (DnsRecordType = {})); | ||
return DnsRecordType2; | ||
})(DnsRecordType || {}); | ||
// src/DnsReturnCode.ts | ||
var DnsReturnCode; | ||
(function(DnsReturnCode2) { | ||
var DnsReturnCode = /* @__PURE__ */ ((DnsReturnCode2) => { | ||
DnsReturnCode2[DnsReturnCode2["NoError"] = 0] = "NoError"; | ||
@@ -35,24 +31,24 @@ DnsReturnCode2[DnsReturnCode2["QueryFormatError"] = 1] = "QueryFormatError"; | ||
DnsReturnCode2[DnsReturnCode2["NotInZone"] = 9] = "NotInZone"; | ||
})(DnsReturnCode || (DnsReturnCode = {})); | ||
return DnsReturnCode2; | ||
})(DnsReturnCode || {}); | ||
// src/googleDnsOverHttps.ts | ||
import { axios } from "@xylabs/axios"; | ||
var googleDnsOverHttps = /* @__PURE__ */ __name(async (name, type = DnsRecordType.A) => { | ||
var googleDnsOverHttps = async (name, type = 1 /* A */) => { | ||
return (await axios.get(`https://dns.google/resolve?name=${name}&type=${type}`)).data; | ||
}, "googleDnsOverHttps"); | ||
}; | ||
// src/domainResolve.ts | ||
var domainResolve = /* @__PURE__ */ __name(async (domain, type = DnsRecordType.A) => { | ||
var domainResolve = async (domain, type = 1 /* A */) => { | ||
if (domain) { | ||
const dnsResult = await googleDnsOverHttps(domain, type); | ||
return dnsResult; | ||
return await googleDnsOverHttps(domain, type); | ||
} | ||
}, "domainResolve"); | ||
}; | ||
// src/domainExists.ts | ||
var domainExists = /* @__PURE__ */ __name(async (domain) => { | ||
var domainExists = async (domain) => { | ||
if (domain === void 0) return false; | ||
const dnsResult = await domainResolve(domain); | ||
return dnsResult?.Status === DnsReturnCode.NoError; | ||
}, "domainExists"); | ||
return dnsResult?.Status === 0 /* NoError */; | ||
}; | ||
export { | ||
@@ -59,0 +55,0 @@ DnsRecordType, |
@@ -1,7 +0,3 @@ | ||
var __defProp = Object.defineProperty; | ||
var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); | ||
// src/DnsRecordType.ts | ||
var DnsRecordType; | ||
(function(DnsRecordType2) { | ||
var DnsRecordType = /* @__PURE__ */ ((DnsRecordType2) => { | ||
DnsRecordType2[DnsRecordType2["A"] = 1] = "A"; | ||
@@ -19,7 +15,7 @@ DnsRecordType2[DnsRecordType2["AAAA"] = 28] = "AAAA"; | ||
DnsRecordType2[DnsRecordType2["TXT"] = 16] = "TXT"; | ||
})(DnsRecordType || (DnsRecordType = {})); | ||
return DnsRecordType2; | ||
})(DnsRecordType || {}); | ||
// src/DnsReturnCode.ts | ||
var DnsReturnCode; | ||
(function(DnsReturnCode2) { | ||
var DnsReturnCode = /* @__PURE__ */ ((DnsReturnCode2) => { | ||
DnsReturnCode2[DnsReturnCode2["NoError"] = 0] = "NoError"; | ||
@@ -35,24 +31,24 @@ DnsReturnCode2[DnsReturnCode2["QueryFormatError"] = 1] = "QueryFormatError"; | ||
DnsReturnCode2[DnsReturnCode2["NotInZone"] = 9] = "NotInZone"; | ||
})(DnsReturnCode || (DnsReturnCode = {})); | ||
return DnsReturnCode2; | ||
})(DnsReturnCode || {}); | ||
// src/googleDnsOverHttps.ts | ||
import { axios } from "@xylabs/axios"; | ||
var googleDnsOverHttps = /* @__PURE__ */ __name(async (name, type = DnsRecordType.A) => { | ||
var googleDnsOverHttps = async (name, type = 1 /* A */) => { | ||
return (await axios.get(`https://dns.google/resolve?name=${name}&type=${type}`)).data; | ||
}, "googleDnsOverHttps"); | ||
}; | ||
// src/domainResolve.ts | ||
var domainResolve = /* @__PURE__ */ __name(async (domain, type = DnsRecordType.A) => { | ||
var domainResolve = async (domain, type = 1 /* A */) => { | ||
if (domain) { | ||
const dnsResult = await googleDnsOverHttps(domain, type); | ||
return dnsResult; | ||
return await googleDnsOverHttps(domain, type); | ||
} | ||
}, "domainResolve"); | ||
}; | ||
// src/domainExists.ts | ||
var domainExists = /* @__PURE__ */ __name(async (domain) => { | ||
var domainExists = async (domain) => { | ||
if (domain === void 0) return false; | ||
const dnsResult = await domainResolve(domain); | ||
return dnsResult?.Status === DnsReturnCode.NoError; | ||
}, "domainExists"); | ||
return dnsResult?.Status === 0 /* NoError */; | ||
}; | ||
export { | ||
@@ -59,0 +55,0 @@ DnsRecordType, |
@@ -1,7 +0,3 @@ | ||
var __defProp = Object.defineProperty; | ||
var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); | ||
// src/DnsRecordType.ts | ||
var DnsRecordType; | ||
(function(DnsRecordType2) { | ||
var DnsRecordType = /* @__PURE__ */ ((DnsRecordType2) => { | ||
DnsRecordType2[DnsRecordType2["A"] = 1] = "A"; | ||
@@ -19,7 +15,7 @@ DnsRecordType2[DnsRecordType2["AAAA"] = 28] = "AAAA"; | ||
DnsRecordType2[DnsRecordType2["TXT"] = 16] = "TXT"; | ||
})(DnsRecordType || (DnsRecordType = {})); | ||
return DnsRecordType2; | ||
})(DnsRecordType || {}); | ||
// src/DnsReturnCode.ts | ||
var DnsReturnCode; | ||
(function(DnsReturnCode2) { | ||
var DnsReturnCode = /* @__PURE__ */ ((DnsReturnCode2) => { | ||
DnsReturnCode2[DnsReturnCode2["NoError"] = 0] = "NoError"; | ||
@@ -35,24 +31,24 @@ DnsReturnCode2[DnsReturnCode2["QueryFormatError"] = 1] = "QueryFormatError"; | ||
DnsReturnCode2[DnsReturnCode2["NotInZone"] = 9] = "NotInZone"; | ||
})(DnsReturnCode || (DnsReturnCode = {})); | ||
return DnsReturnCode2; | ||
})(DnsReturnCode || {}); | ||
// src/googleDnsOverHttps.ts | ||
import { axios } from "@xylabs/axios"; | ||
var googleDnsOverHttps = /* @__PURE__ */ __name(async (name, type = DnsRecordType.A) => { | ||
var googleDnsOverHttps = async (name, type = 1 /* A */) => { | ||
return (await axios.get(`https://dns.google/resolve?name=${name}&type=${type}`)).data; | ||
}, "googleDnsOverHttps"); | ||
}; | ||
// src/domainResolve.ts | ||
var domainResolve = /* @__PURE__ */ __name(async (domain, type = DnsRecordType.A) => { | ||
var domainResolve = async (domain, type = 1 /* A */) => { | ||
if (domain) { | ||
const dnsResult = await googleDnsOverHttps(domain, type); | ||
return dnsResult; | ||
return await googleDnsOverHttps(domain, type); | ||
} | ||
}, "domainResolve"); | ||
}; | ||
// src/domainExists.ts | ||
var domainExists = /* @__PURE__ */ __name(async (domain) => { | ||
var domainExists = async (domain) => { | ||
if (domain === void 0) return false; | ||
const dnsResult = await domainResolve(domain); | ||
return (dnsResult == null ? void 0 : dnsResult.Status) === DnsReturnCode.NoError; | ||
}, "domainExists"); | ||
return (dnsResult == null ? void 0 : dnsResult.Status) === 0 /* NoError */; | ||
}; | ||
export { | ||
@@ -59,0 +55,0 @@ DnsRecordType, |
@@ -14,7 +14,7 @@ { | ||
"dependencies": { | ||
"@xylabs/axios": "^3.6.4" | ||
"@xylabs/axios": "^3.6.5" | ||
}, | ||
"devDependencies": { | ||
"@xylabs/ts-scripts-yarn3": "^3.12.4", | ||
"@xylabs/tsconfig": "^3.12.4", | ||
"@xylabs/ts-scripts-yarn3": "^3.13.3", | ||
"@xylabs/tsconfig": "^3.13.3", | ||
"typescript": "^5.5.4" | ||
@@ -60,4 +60,4 @@ }, | ||
"sideEffects": false, | ||
"version": "2.110.10", | ||
"version": "2.110.11", | ||
"type": "module" | ||
} |
@@ -11,4 +11,3 @@ import { DnsRecordType } from './DnsRecordType.js' | ||
if (domain) { | ||
const dnsResult = await googleDnsOverHttps(domain, type) | ||
return dnsResult | ||
return await googleDnsOverHttps(domain, type) | ||
} | ||
@@ -15,0 +14,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
101417
731
Updated@xylabs/axios@^3.6.5