@xyo-network/dns 2.84.18 → 2.85.0
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/browser/index.cjs +14 -13
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.js +16 -13
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.cjs +14 -13
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.js +16 -13
- package/dist/node/index.js.map +1 -1
- package/package.json +1 -1
package/dist/browser/index.cjs
CHANGED
|
@@ -3,6 +3,7 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
7
|
var __export = (target, all) => {
|
|
7
8
|
for (var name in all)
|
|
8
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -29,7 +30,8 @@ __export(src_exports, {
|
|
|
29
30
|
module.exports = __toCommonJS(src_exports);
|
|
30
31
|
|
|
31
32
|
// src/DnsRecordType.ts
|
|
32
|
-
var DnsRecordType
|
|
33
|
+
var DnsRecordType;
|
|
34
|
+
(function(DnsRecordType2) {
|
|
33
35
|
DnsRecordType2[DnsRecordType2["A"] = 1] = "A";
|
|
34
36
|
DnsRecordType2[DnsRecordType2["AAAA"] = 28] = "AAAA";
|
|
35
37
|
DnsRecordType2[DnsRecordType2["CAA"] = 257] = "CAA";
|
|
@@ -42,11 +44,11 @@ var DnsRecordType = /* @__PURE__ */ ((DnsRecordType2) => {
|
|
|
42
44
|
DnsRecordType2[DnsRecordType2["SPF"] = 99] = "SPF";
|
|
43
45
|
DnsRecordType2[DnsRecordType2["SRV"] = 33] = "SRV";
|
|
44
46
|
DnsRecordType2[DnsRecordType2["TXT"] = 16] = "TXT";
|
|
45
|
-
|
|
46
|
-
})(DnsRecordType || {});
|
|
47
|
+
})(DnsRecordType || (DnsRecordType = {}));
|
|
47
48
|
|
|
48
49
|
// src/DnsReturnCode.ts
|
|
49
|
-
var DnsReturnCode
|
|
50
|
+
var DnsReturnCode;
|
|
51
|
+
(function(DnsReturnCode2) {
|
|
50
52
|
DnsReturnCode2[DnsReturnCode2["NoError"] = 0] = "NoError";
|
|
51
53
|
DnsReturnCode2[DnsReturnCode2["QueryFormatError"] = 1] = "QueryFormatError";
|
|
52
54
|
DnsReturnCode2[DnsReturnCode2["ServerFailed"] = 2] = "ServerFailed";
|
|
@@ -57,28 +59,27 @@ var DnsReturnCode = /* @__PURE__ */ ((DnsReturnCode2) => {
|
|
|
57
59
|
DnsReturnCode2[DnsReturnCode2["RRSetShouldNotExist"] = 7] = "RRSetShouldNotExist";
|
|
58
60
|
DnsReturnCode2[DnsReturnCode2["NotAuthoratative"] = 8] = "NotAuthoratative";
|
|
59
61
|
DnsReturnCode2[DnsReturnCode2["NotInZone"] = 9] = "NotInZone";
|
|
60
|
-
|
|
61
|
-
})(DnsReturnCode || {});
|
|
62
|
+
})(DnsReturnCode || (DnsReturnCode = {}));
|
|
62
63
|
|
|
63
64
|
// src/googleDnsOverHttps.ts
|
|
64
65
|
var import_axios = require("@xylabs/axios");
|
|
65
|
-
var googleDnsOverHttps = async (name, type =
|
|
66
|
+
var googleDnsOverHttps = /* @__PURE__ */ __name(async (name, type = DnsRecordType.A) => {
|
|
66
67
|
return (await import_axios.axios.get(`https://dns.google/resolve?name=${name}&type=${type}`)).data;
|
|
67
|
-
};
|
|
68
|
+
}, "googleDnsOverHttps");
|
|
68
69
|
|
|
69
70
|
// src/domainResolve.ts
|
|
70
|
-
var domainResolve = async (domain, type =
|
|
71
|
+
var domainResolve = /* @__PURE__ */ __name(async (domain, type = DnsRecordType.A) => {
|
|
71
72
|
if (domain) {
|
|
72
73
|
const dnsResult = await googleDnsOverHttps(domain, type);
|
|
73
74
|
return dnsResult;
|
|
74
75
|
}
|
|
75
|
-
};
|
|
76
|
+
}, "domainResolve");
|
|
76
77
|
|
|
77
78
|
// src/domainExists.ts
|
|
78
|
-
var domainExists = async (domain) => {
|
|
79
|
+
var domainExists = /* @__PURE__ */ __name(async (domain) => {
|
|
79
80
|
if (domain === void 0)
|
|
80
81
|
return false;
|
|
81
82
|
const dnsResult = await domainResolve(domain);
|
|
82
|
-
return dnsResult?.Status ===
|
|
83
|
-
};
|
|
83
|
+
return dnsResult?.Status === DnsReturnCode.NoError;
|
|
84
|
+
}, "domainExists");
|
|
84
85
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/DnsRecordType.ts","../../src/DnsReturnCode.ts","../../src/googleDnsOverHttps.ts","../../src/domainResolve.ts","../../src/domainExists.ts"],"sourcesContent":["export * from './DnsRecordType'\nexport * from './DnsReturnCode'\nexport * from './domainExists'\nexport * from './domainResolve'\nexport * from './googleDnsOverHttps'\nexport * from './GoogleDnsResult'\nexport * from './GoogleDnsResultAnswer'\nexport * from './GoogleDnsResultQuestion'\n","export enum DnsRecordType {\n A = 1,\n AAAA = 28,\n CAA = 257,\n CNAME = 5,\n DNAME = 39,\n MX = 15,\n NS = 2,\n PTR = 12,\n SOA = 6,\n SPF = 99,\n SRV = 33,\n TXT = 16,\n}\n","enum DnsReturnCode {\n NoError = 0,\n QueryFormatError = 1,\n ServerFailed = 2,\n DomainDoesNotExist = 3,\n NotImplemented = 4,\n Refused = 5,\n NameShouldNotExist = 6,\n RRSetShouldNotExist = 7,\n NotAuthoratative = 8,\n NotInZone = 9,\n}\n\nexport { DnsReturnCode }\n","import { axios } from '@xylabs/axios'\n\nimport { DnsRecordType } from './DnsRecordType'\nimport { GoogleDnsResult } from './GoogleDnsResult'\n\nconst googleDnsOverHttps = async (name: string, type = DnsRecordType.A) => {\n return (await axios.get<GoogleDnsResult>(`https://dns.google/resolve?name=${name}&type=${type}`)).data\n}\n\nexport { googleDnsOverHttps }\n","import { DnsRecordType } from './DnsRecordType'\nimport { googleDnsOverHttps } from './googleDnsOverHttps'\n\n/**\n * Resolves DNS information (resolves using DNS)\n * @param domain - string\n * @returns GoogleDnsResult\n */\nconst domainResolve = async (domain?: string, type = DnsRecordType.A) => {\n if (domain) {\n const dnsResult = await googleDnsOverHttps(domain, type)\n return dnsResult\n }\n}\n\nexport { domainResolve }\n","import { DnsReturnCode } from './DnsReturnCode'\nimport { domainResolve } from './domainResolve'\n\n/**\n * Checks if a domain exists (resolves using DNS)\n * @param domain - string\n * @returns boolean\n */\nconst domainExists = async (domain?: string) => {\n if (domain === undefined) return false\n const dnsResult = await domainResolve(domain)\n return dnsResult?.Status === DnsReturnCode.NoError\n}\n\nexport { domainExists }\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/DnsRecordType.ts","../../src/DnsReturnCode.ts","../../src/googleDnsOverHttps.ts","../../src/domainResolve.ts","../../src/domainExists.ts"],"sourcesContent":["export * from './DnsRecordType'\nexport * from './DnsReturnCode'\nexport * from './domainExists'\nexport * from './domainResolve'\nexport * from './googleDnsOverHttps'\nexport * from './GoogleDnsResult'\nexport * from './GoogleDnsResultAnswer'\nexport * from './GoogleDnsResultQuestion'\n","export enum DnsRecordType {\n A = 1,\n AAAA = 28,\n CAA = 257,\n CNAME = 5,\n DNAME = 39,\n MX = 15,\n NS = 2,\n PTR = 12,\n SOA = 6,\n SPF = 99,\n SRV = 33,\n TXT = 16,\n}\n","enum DnsReturnCode {\n NoError = 0,\n QueryFormatError = 1,\n ServerFailed = 2,\n DomainDoesNotExist = 3,\n NotImplemented = 4,\n Refused = 5,\n NameShouldNotExist = 6,\n RRSetShouldNotExist = 7,\n NotAuthoratative = 8,\n NotInZone = 9,\n}\n\nexport { DnsReturnCode }\n","import { axios } from '@xylabs/axios'\n\nimport { DnsRecordType } from './DnsRecordType'\nimport { GoogleDnsResult } from './GoogleDnsResult'\n\nconst googleDnsOverHttps = async (name: string, type = DnsRecordType.A) => {\n return (await axios.get<GoogleDnsResult>(`https://dns.google/resolve?name=${name}&type=${type}`)).data\n}\n\nexport { googleDnsOverHttps }\n","import { DnsRecordType } from './DnsRecordType'\nimport { googleDnsOverHttps } from './googleDnsOverHttps'\n\n/**\n * Resolves DNS information (resolves using DNS)\n * @param domain - string\n * @returns GoogleDnsResult\n */\nconst domainResolve = async (domain?: string, type = DnsRecordType.A) => {\n if (domain) {\n const dnsResult = await googleDnsOverHttps(domain, type)\n return dnsResult\n }\n}\n\nexport { domainResolve }\n","import { DnsReturnCode } from './DnsReturnCode'\nimport { domainResolve } from './domainResolve'\n\n/**\n * Checks if a domain exists (resolves using DNS)\n * @param domain - string\n * @returns boolean\n */\nconst domainExists = async (domain?: string) => {\n if (domain === undefined) return false\n const dnsResult = await domainResolve(domain)\n return dnsResult?.Status === DnsReturnCode.NoError\n}\n\nexport { domainExists }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;UCAYA,gBAAAA;;;;;;;;;;;;;GAAAA,kBAAAA,gBAAAA,CAAAA,EAAAA;;;;UCAPC,gBAAAA;;;;;;;;;;;GAAAA,kBAAAA,gBAAAA,CAAAA,EAAAA;;;ACAL,mBAAsB;AAKtB,IAAMC,qBAAqB,8BAAOC,MAAcC,OAAOC,cAAcC,MAAC;AACpE,UAAQ,MAAMC,mBAAMC,IAAqB,mCAAmCL,IAAAA,SAAaC,IAAAA,EAAM,GAAGK;AACpG,GAF2B;;;ACG3B,IAAMC,gBAAgB,8BAAOC,QAAiBC,OAAOC,cAAcC,MAAC;AAClE,MAAIH,QAAQ;AACV,UAAMI,YAAY,MAAMC,mBAAmBL,QAAQC,IAAAA;AACnD,WAAOG;EACT;AACF,GALsB;;;ACAtB,IAAME,eAAe,8BAAOC,WAAAA;AAC1B,MAAIA,WAAWC;AAAW,WAAO;AACjC,QAAMC,YAAY,MAAMC,cAAcH,MAAAA;AACtC,SAAOE,WAAWE,WAAWC,cAAcC;AAC7C,GAJqB;","names":["DnsRecordType","DnsReturnCode","googleDnsOverHttps","name","type","DnsRecordType","A","axios","get","data","domainResolve","domain","type","DnsRecordType","A","dnsResult","googleDnsOverHttps","domainExists","domain","undefined","dnsResult","domainResolve","Status","DnsReturnCode","NoError"]}
|
package/dist/browser/index.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
|
|
1
4
|
// src/DnsRecordType.ts
|
|
2
|
-
var DnsRecordType
|
|
5
|
+
var DnsRecordType;
|
|
6
|
+
(function(DnsRecordType2) {
|
|
3
7
|
DnsRecordType2[DnsRecordType2["A"] = 1] = "A";
|
|
4
8
|
DnsRecordType2[DnsRecordType2["AAAA"] = 28] = "AAAA";
|
|
5
9
|
DnsRecordType2[DnsRecordType2["CAA"] = 257] = "CAA";
|
|
@@ -12,11 +16,11 @@ var DnsRecordType = /* @__PURE__ */ ((DnsRecordType2) => {
|
|
|
12
16
|
DnsRecordType2[DnsRecordType2["SPF"] = 99] = "SPF";
|
|
13
17
|
DnsRecordType2[DnsRecordType2["SRV"] = 33] = "SRV";
|
|
14
18
|
DnsRecordType2[DnsRecordType2["TXT"] = 16] = "TXT";
|
|
15
|
-
|
|
16
|
-
})(DnsRecordType || {});
|
|
19
|
+
})(DnsRecordType || (DnsRecordType = {}));
|
|
17
20
|
|
|
18
21
|
// src/DnsReturnCode.ts
|
|
19
|
-
var DnsReturnCode
|
|
22
|
+
var DnsReturnCode;
|
|
23
|
+
(function(DnsReturnCode2) {
|
|
20
24
|
DnsReturnCode2[DnsReturnCode2["NoError"] = 0] = "NoError";
|
|
21
25
|
DnsReturnCode2[DnsReturnCode2["QueryFormatError"] = 1] = "QueryFormatError";
|
|
22
26
|
DnsReturnCode2[DnsReturnCode2["ServerFailed"] = 2] = "ServerFailed";
|
|
@@ -27,30 +31,29 @@ var DnsReturnCode = /* @__PURE__ */ ((DnsReturnCode2) => {
|
|
|
27
31
|
DnsReturnCode2[DnsReturnCode2["RRSetShouldNotExist"] = 7] = "RRSetShouldNotExist";
|
|
28
32
|
DnsReturnCode2[DnsReturnCode2["NotAuthoratative"] = 8] = "NotAuthoratative";
|
|
29
33
|
DnsReturnCode2[DnsReturnCode2["NotInZone"] = 9] = "NotInZone";
|
|
30
|
-
|
|
31
|
-
})(DnsReturnCode || {});
|
|
34
|
+
})(DnsReturnCode || (DnsReturnCode = {}));
|
|
32
35
|
|
|
33
36
|
// src/googleDnsOverHttps.ts
|
|
34
37
|
import { axios } from "@xylabs/axios";
|
|
35
|
-
var googleDnsOverHttps = async (name, type =
|
|
38
|
+
var googleDnsOverHttps = /* @__PURE__ */ __name(async (name, type = DnsRecordType.A) => {
|
|
36
39
|
return (await axios.get(`https://dns.google/resolve?name=${name}&type=${type}`)).data;
|
|
37
|
-
};
|
|
40
|
+
}, "googleDnsOverHttps");
|
|
38
41
|
|
|
39
42
|
// src/domainResolve.ts
|
|
40
|
-
var domainResolve = async (domain, type =
|
|
43
|
+
var domainResolve = /* @__PURE__ */ __name(async (domain, type = DnsRecordType.A) => {
|
|
41
44
|
if (domain) {
|
|
42
45
|
const dnsResult = await googleDnsOverHttps(domain, type);
|
|
43
46
|
return dnsResult;
|
|
44
47
|
}
|
|
45
|
-
};
|
|
48
|
+
}, "domainResolve");
|
|
46
49
|
|
|
47
50
|
// src/domainExists.ts
|
|
48
|
-
var domainExists = async (domain) => {
|
|
51
|
+
var domainExists = /* @__PURE__ */ __name(async (domain) => {
|
|
49
52
|
if (domain === void 0)
|
|
50
53
|
return false;
|
|
51
54
|
const dnsResult = await domainResolve(domain);
|
|
52
|
-
return dnsResult?.Status ===
|
|
53
|
-
};
|
|
55
|
+
return dnsResult?.Status === DnsReturnCode.NoError;
|
|
56
|
+
}, "domainExists");
|
|
54
57
|
export {
|
|
55
58
|
DnsRecordType,
|
|
56
59
|
DnsReturnCode,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/DnsRecordType.ts","../../src/DnsReturnCode.ts","../../src/googleDnsOverHttps.ts","../../src/domainResolve.ts","../../src/domainExists.ts"],"sourcesContent":["export enum DnsRecordType {\n A = 1,\n AAAA = 28,\n CAA = 257,\n CNAME = 5,\n DNAME = 39,\n MX = 15,\n NS = 2,\n PTR = 12,\n SOA = 6,\n SPF = 99,\n SRV = 33,\n TXT = 16,\n}\n","enum DnsReturnCode {\n NoError = 0,\n QueryFormatError = 1,\n ServerFailed = 2,\n DomainDoesNotExist = 3,\n NotImplemented = 4,\n Refused = 5,\n NameShouldNotExist = 6,\n RRSetShouldNotExist = 7,\n NotAuthoratative = 8,\n NotInZone = 9,\n}\n\nexport { DnsReturnCode }\n","import { axios } from '@xylabs/axios'\n\nimport { DnsRecordType } from './DnsRecordType'\nimport { GoogleDnsResult } from './GoogleDnsResult'\n\nconst googleDnsOverHttps = async (name: string, type = DnsRecordType.A) => {\n return (await axios.get<GoogleDnsResult>(`https://dns.google/resolve?name=${name}&type=${type}`)).data\n}\n\nexport { googleDnsOverHttps }\n","import { DnsRecordType } from './DnsRecordType'\nimport { googleDnsOverHttps } from './googleDnsOverHttps'\n\n/**\n * Resolves DNS information (resolves using DNS)\n * @param domain - string\n * @returns GoogleDnsResult\n */\nconst domainResolve = async (domain?: string, type = DnsRecordType.A) => {\n if (domain) {\n const dnsResult = await googleDnsOverHttps(domain, type)\n return dnsResult\n }\n}\n\nexport { domainResolve }\n","import { DnsReturnCode } from './DnsReturnCode'\nimport { domainResolve } from './domainResolve'\n\n/**\n * Checks if a domain exists (resolves using DNS)\n * @param domain - string\n * @returns boolean\n */\nconst domainExists = async (domain?: string) => {\n if (domain === undefined) return false\n const dnsResult = await domainResolve(domain)\n return dnsResult?.Status === DnsReturnCode.NoError\n}\n\nexport { domainExists }\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/DnsRecordType.ts","../../src/DnsReturnCode.ts","../../src/googleDnsOverHttps.ts","../../src/domainResolve.ts","../../src/domainExists.ts"],"sourcesContent":["export enum DnsRecordType {\n A = 1,\n AAAA = 28,\n CAA = 257,\n CNAME = 5,\n DNAME = 39,\n MX = 15,\n NS = 2,\n PTR = 12,\n SOA = 6,\n SPF = 99,\n SRV = 33,\n TXT = 16,\n}\n","enum DnsReturnCode {\n NoError = 0,\n QueryFormatError = 1,\n ServerFailed = 2,\n DomainDoesNotExist = 3,\n NotImplemented = 4,\n Refused = 5,\n NameShouldNotExist = 6,\n RRSetShouldNotExist = 7,\n NotAuthoratative = 8,\n NotInZone = 9,\n}\n\nexport { DnsReturnCode }\n","import { axios } from '@xylabs/axios'\n\nimport { DnsRecordType } from './DnsRecordType'\nimport { GoogleDnsResult } from './GoogleDnsResult'\n\nconst googleDnsOverHttps = async (name: string, type = DnsRecordType.A) => {\n return (await axios.get<GoogleDnsResult>(`https://dns.google/resolve?name=${name}&type=${type}`)).data\n}\n\nexport { googleDnsOverHttps }\n","import { DnsRecordType } from './DnsRecordType'\nimport { googleDnsOverHttps } from './googleDnsOverHttps'\n\n/**\n * Resolves DNS information (resolves using DNS)\n * @param domain - string\n * @returns GoogleDnsResult\n */\nconst domainResolve = async (domain?: string, type = DnsRecordType.A) => {\n if (domain) {\n const dnsResult = await googleDnsOverHttps(domain, type)\n return dnsResult\n }\n}\n\nexport { domainResolve }\n","import { DnsReturnCode } from './DnsReturnCode'\nimport { domainResolve } from './domainResolve'\n\n/**\n * Checks if a domain exists (resolves using DNS)\n * @param domain - string\n * @returns boolean\n */\nconst domainExists = async (domain?: string) => {\n if (domain === undefined) return false\n const dnsResult = await domainResolve(domain)\n return dnsResult?.Status === DnsReturnCode.NoError\n}\n\nexport { domainExists }\n"],"mappings":";;;;;UAAYA,gBAAAA;;;;;;;;;;;;;GAAAA,kBAAAA,gBAAAA,CAAAA,EAAAA;;;;UCAPC,gBAAAA;;;;;;;;;;;GAAAA,kBAAAA,gBAAAA,CAAAA,EAAAA;;;ACAL,SAASC,aAAa;AAKtB,IAAMC,qBAAqB,8BAAOC,MAAcC,OAAOC,cAAcC,MAAC;AACpE,UAAQ,MAAMC,MAAMC,IAAqB,mCAAmCL,IAAAA,SAAaC,IAAAA,EAAM,GAAGK;AACpG,GAF2B;;;ACG3B,IAAMC,gBAAgB,8BAAOC,QAAiBC,OAAOC,cAAcC,MAAC;AAClE,MAAIH,QAAQ;AACV,UAAMI,YAAY,MAAMC,mBAAmBL,QAAQC,IAAAA;AACnD,WAAOG;EACT;AACF,GALsB;;;ACAtB,IAAME,eAAe,8BAAOC,WAAAA;AAC1B,MAAIA,WAAWC;AAAW,WAAO;AACjC,QAAMC,YAAY,MAAMC,cAAcH,MAAAA;AACtC,SAAOE,WAAWE,WAAWC,cAAcC;AAC7C,GAJqB;","names":["DnsRecordType","DnsReturnCode","axios","googleDnsOverHttps","name","type","DnsRecordType","A","axios","get","data","domainResolve","domain","type","DnsRecordType","A","dnsResult","googleDnsOverHttps","domainExists","domain","undefined","dnsResult","domainResolve","Status","DnsReturnCode","NoError"]}
|
package/dist/node/index.cjs
CHANGED
|
@@ -3,6 +3,7 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
7
|
var __export = (target, all) => {
|
|
7
8
|
for (var name in all)
|
|
8
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -29,7 +30,8 @@ __export(src_exports, {
|
|
|
29
30
|
module.exports = __toCommonJS(src_exports);
|
|
30
31
|
|
|
31
32
|
// src/DnsRecordType.ts
|
|
32
|
-
var DnsRecordType
|
|
33
|
+
var DnsRecordType;
|
|
34
|
+
(function(DnsRecordType2) {
|
|
33
35
|
DnsRecordType2[DnsRecordType2["A"] = 1] = "A";
|
|
34
36
|
DnsRecordType2[DnsRecordType2["AAAA"] = 28] = "AAAA";
|
|
35
37
|
DnsRecordType2[DnsRecordType2["CAA"] = 257] = "CAA";
|
|
@@ -42,11 +44,11 @@ var DnsRecordType = /* @__PURE__ */ ((DnsRecordType2) => {
|
|
|
42
44
|
DnsRecordType2[DnsRecordType2["SPF"] = 99] = "SPF";
|
|
43
45
|
DnsRecordType2[DnsRecordType2["SRV"] = 33] = "SRV";
|
|
44
46
|
DnsRecordType2[DnsRecordType2["TXT"] = 16] = "TXT";
|
|
45
|
-
|
|
46
|
-
})(DnsRecordType || {});
|
|
47
|
+
})(DnsRecordType || (DnsRecordType = {}));
|
|
47
48
|
|
|
48
49
|
// src/DnsReturnCode.ts
|
|
49
|
-
var DnsReturnCode
|
|
50
|
+
var DnsReturnCode;
|
|
51
|
+
(function(DnsReturnCode2) {
|
|
50
52
|
DnsReturnCode2[DnsReturnCode2["NoError"] = 0] = "NoError";
|
|
51
53
|
DnsReturnCode2[DnsReturnCode2["QueryFormatError"] = 1] = "QueryFormatError";
|
|
52
54
|
DnsReturnCode2[DnsReturnCode2["ServerFailed"] = 2] = "ServerFailed";
|
|
@@ -57,30 +59,29 @@ var DnsReturnCode = /* @__PURE__ */ ((DnsReturnCode2) => {
|
|
|
57
59
|
DnsReturnCode2[DnsReturnCode2["RRSetShouldNotExist"] = 7] = "RRSetShouldNotExist";
|
|
58
60
|
DnsReturnCode2[DnsReturnCode2["NotAuthoratative"] = 8] = "NotAuthoratative";
|
|
59
61
|
DnsReturnCode2[DnsReturnCode2["NotInZone"] = 9] = "NotInZone";
|
|
60
|
-
|
|
61
|
-
})(DnsReturnCode || {});
|
|
62
|
+
})(DnsReturnCode || (DnsReturnCode = {}));
|
|
62
63
|
|
|
63
64
|
// src/googleDnsOverHttps.ts
|
|
64
65
|
var import_axios = require("@xylabs/axios");
|
|
65
|
-
var googleDnsOverHttps = async (name, type =
|
|
66
|
+
var googleDnsOverHttps = /* @__PURE__ */ __name(async (name, type = DnsRecordType.A) => {
|
|
66
67
|
return (await import_axios.axios.get(`https://dns.google/resolve?name=${name}&type=${type}`)).data;
|
|
67
|
-
};
|
|
68
|
+
}, "googleDnsOverHttps");
|
|
68
69
|
|
|
69
70
|
// src/domainResolve.ts
|
|
70
|
-
var domainResolve = async (domain, type =
|
|
71
|
+
var domainResolve = /* @__PURE__ */ __name(async (domain, type = DnsRecordType.A) => {
|
|
71
72
|
if (domain) {
|
|
72
73
|
const dnsResult = await googleDnsOverHttps(domain, type);
|
|
73
74
|
return dnsResult;
|
|
74
75
|
}
|
|
75
|
-
};
|
|
76
|
+
}, "domainResolve");
|
|
76
77
|
|
|
77
78
|
// src/domainExists.ts
|
|
78
|
-
var domainExists = async (domain) => {
|
|
79
|
+
var domainExists = /* @__PURE__ */ __name(async (domain) => {
|
|
79
80
|
if (domain === void 0)
|
|
80
81
|
return false;
|
|
81
82
|
const dnsResult = await domainResolve(domain);
|
|
82
|
-
return (dnsResult == null ? void 0 : dnsResult.Status) ===
|
|
83
|
-
};
|
|
83
|
+
return (dnsResult == null ? void 0 : dnsResult.Status) === DnsReturnCode.NoError;
|
|
84
|
+
}, "domainExists");
|
|
84
85
|
// Annotate the CommonJS export names for ESM import in node:
|
|
85
86
|
0 && (module.exports = {
|
|
86
87
|
DnsRecordType,
|
package/dist/node/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/DnsRecordType.ts","../../src/DnsReturnCode.ts","../../src/googleDnsOverHttps.ts","../../src/domainResolve.ts","../../src/domainExists.ts"],"sourcesContent":["export * from './DnsRecordType'\nexport * from './DnsReturnCode'\nexport * from './domainExists'\nexport * from './domainResolve'\nexport * from './googleDnsOverHttps'\nexport * from './GoogleDnsResult'\nexport * from './GoogleDnsResultAnswer'\nexport * from './GoogleDnsResultQuestion'\n","export enum DnsRecordType {\n A = 1,\n AAAA = 28,\n CAA = 257,\n CNAME = 5,\n DNAME = 39,\n MX = 15,\n NS = 2,\n PTR = 12,\n SOA = 6,\n SPF = 99,\n SRV = 33,\n TXT = 16,\n}\n","enum DnsReturnCode {\n NoError = 0,\n QueryFormatError = 1,\n ServerFailed = 2,\n DomainDoesNotExist = 3,\n NotImplemented = 4,\n Refused = 5,\n NameShouldNotExist = 6,\n RRSetShouldNotExist = 7,\n NotAuthoratative = 8,\n NotInZone = 9,\n}\n\nexport { DnsReturnCode }\n","import { axios } from '@xylabs/axios'\n\nimport { DnsRecordType } from './DnsRecordType'\nimport { GoogleDnsResult } from './GoogleDnsResult'\n\nconst googleDnsOverHttps = async (name: string, type = DnsRecordType.A) => {\n return (await axios.get<GoogleDnsResult>(`https://dns.google/resolve?name=${name}&type=${type}`)).data\n}\n\nexport { googleDnsOverHttps }\n","import { DnsRecordType } from './DnsRecordType'\nimport { googleDnsOverHttps } from './googleDnsOverHttps'\n\n/**\n * Resolves DNS information (resolves using DNS)\n * @param domain - string\n * @returns GoogleDnsResult\n */\nconst domainResolve = async (domain?: string, type = DnsRecordType.A) => {\n if (domain) {\n const dnsResult = await googleDnsOverHttps(domain, type)\n return dnsResult\n }\n}\n\nexport { domainResolve }\n","import { DnsReturnCode } from './DnsReturnCode'\nimport { domainResolve } from './domainResolve'\n\n/**\n * Checks if a domain exists (resolves using DNS)\n * @param domain - string\n * @returns boolean\n */\nconst domainExists = async (domain?: string) => {\n if (domain === undefined) return false\n const dnsResult = await domainResolve(domain)\n return dnsResult?.Status === DnsReturnCode.NoError\n}\n\nexport { domainExists }\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/DnsRecordType.ts","../../src/DnsReturnCode.ts","../../src/googleDnsOverHttps.ts","../../src/domainResolve.ts","../../src/domainExists.ts"],"sourcesContent":["export * from './DnsRecordType'\nexport * from './DnsReturnCode'\nexport * from './domainExists'\nexport * from './domainResolve'\nexport * from './googleDnsOverHttps'\nexport * from './GoogleDnsResult'\nexport * from './GoogleDnsResultAnswer'\nexport * from './GoogleDnsResultQuestion'\n","export enum DnsRecordType {\n A = 1,\n AAAA = 28,\n CAA = 257,\n CNAME = 5,\n DNAME = 39,\n MX = 15,\n NS = 2,\n PTR = 12,\n SOA = 6,\n SPF = 99,\n SRV = 33,\n TXT = 16,\n}\n","enum DnsReturnCode {\n NoError = 0,\n QueryFormatError = 1,\n ServerFailed = 2,\n DomainDoesNotExist = 3,\n NotImplemented = 4,\n Refused = 5,\n NameShouldNotExist = 6,\n RRSetShouldNotExist = 7,\n NotAuthoratative = 8,\n NotInZone = 9,\n}\n\nexport { DnsReturnCode }\n","import { axios } from '@xylabs/axios'\n\nimport { DnsRecordType } from './DnsRecordType'\nimport { GoogleDnsResult } from './GoogleDnsResult'\n\nconst googleDnsOverHttps = async (name: string, type = DnsRecordType.A) => {\n return (await axios.get<GoogleDnsResult>(`https://dns.google/resolve?name=${name}&type=${type}`)).data\n}\n\nexport { googleDnsOverHttps }\n","import { DnsRecordType } from './DnsRecordType'\nimport { googleDnsOverHttps } from './googleDnsOverHttps'\n\n/**\n * Resolves DNS information (resolves using DNS)\n * @param domain - string\n * @returns GoogleDnsResult\n */\nconst domainResolve = async (domain?: string, type = DnsRecordType.A) => {\n if (domain) {\n const dnsResult = await googleDnsOverHttps(domain, type)\n return dnsResult\n }\n}\n\nexport { domainResolve }\n","import { DnsReturnCode } from './DnsReturnCode'\nimport { domainResolve } from './domainResolve'\n\n/**\n * Checks if a domain exists (resolves using DNS)\n * @param domain - string\n * @returns boolean\n */\nconst domainExists = async (domain?: string) => {\n if (domain === undefined) return false\n const dnsResult = await domainResolve(domain)\n return dnsResult?.Status === DnsReturnCode.NoError\n}\n\nexport { domainExists }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;UCAYA,gBAAAA;;;;;;;;;;;;;GAAAA,kBAAAA,gBAAAA,CAAAA,EAAAA;;;;UCAPC,gBAAAA;;;;;;;;;;;GAAAA,kBAAAA,gBAAAA,CAAAA,EAAAA;;;ACAL,mBAAsB;AAKtB,IAAMC,qBAAqB,8BAAOC,MAAcC,OAAOC,cAAcC,MAAC;AACpE,UAAQ,MAAMC,mBAAMC,IAAqB,mCAAmCL,IAAAA,SAAaC,IAAAA,EAAM,GAAGK;AACpG,GAF2B;;;ACG3B,IAAMC,gBAAgB,8BAAOC,QAAiBC,OAAOC,cAAcC,MAAC;AAClE,MAAIH,QAAQ;AACV,UAAMI,YAAY,MAAMC,mBAAmBL,QAAQC,IAAAA;AACnD,WAAOG;EACT;AACF,GALsB;;;ACAtB,IAAME,eAAe,8BAAOC,WAAAA;AAC1B,MAAIA,WAAWC;AAAW,WAAO;AACjC,QAAMC,YAAY,MAAMC,cAAcH,MAAAA;AACtC,UAAOE,uCAAWE,YAAWC,cAAcC;AAC7C,GAJqB;","names":["DnsRecordType","DnsReturnCode","googleDnsOverHttps","name","type","DnsRecordType","A","axios","get","data","domainResolve","domain","type","DnsRecordType","A","dnsResult","googleDnsOverHttps","domainExists","domain","undefined","dnsResult","domainResolve","Status","DnsReturnCode","NoError"]}
|
package/dist/node/index.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
|
|
1
4
|
// src/DnsRecordType.ts
|
|
2
|
-
var DnsRecordType
|
|
5
|
+
var DnsRecordType;
|
|
6
|
+
(function(DnsRecordType2) {
|
|
3
7
|
DnsRecordType2[DnsRecordType2["A"] = 1] = "A";
|
|
4
8
|
DnsRecordType2[DnsRecordType2["AAAA"] = 28] = "AAAA";
|
|
5
9
|
DnsRecordType2[DnsRecordType2["CAA"] = 257] = "CAA";
|
|
@@ -12,11 +16,11 @@ var DnsRecordType = /* @__PURE__ */ ((DnsRecordType2) => {
|
|
|
12
16
|
DnsRecordType2[DnsRecordType2["SPF"] = 99] = "SPF";
|
|
13
17
|
DnsRecordType2[DnsRecordType2["SRV"] = 33] = "SRV";
|
|
14
18
|
DnsRecordType2[DnsRecordType2["TXT"] = 16] = "TXT";
|
|
15
|
-
|
|
16
|
-
})(DnsRecordType || {});
|
|
19
|
+
})(DnsRecordType || (DnsRecordType = {}));
|
|
17
20
|
|
|
18
21
|
// src/DnsReturnCode.ts
|
|
19
|
-
var DnsReturnCode
|
|
22
|
+
var DnsReturnCode;
|
|
23
|
+
(function(DnsReturnCode2) {
|
|
20
24
|
DnsReturnCode2[DnsReturnCode2["NoError"] = 0] = "NoError";
|
|
21
25
|
DnsReturnCode2[DnsReturnCode2["QueryFormatError"] = 1] = "QueryFormatError";
|
|
22
26
|
DnsReturnCode2[DnsReturnCode2["ServerFailed"] = 2] = "ServerFailed";
|
|
@@ -27,30 +31,29 @@ var DnsReturnCode = /* @__PURE__ */ ((DnsReturnCode2) => {
|
|
|
27
31
|
DnsReturnCode2[DnsReturnCode2["RRSetShouldNotExist"] = 7] = "RRSetShouldNotExist";
|
|
28
32
|
DnsReturnCode2[DnsReturnCode2["NotAuthoratative"] = 8] = "NotAuthoratative";
|
|
29
33
|
DnsReturnCode2[DnsReturnCode2["NotInZone"] = 9] = "NotInZone";
|
|
30
|
-
|
|
31
|
-
})(DnsReturnCode || {});
|
|
34
|
+
})(DnsReturnCode || (DnsReturnCode = {}));
|
|
32
35
|
|
|
33
36
|
// src/googleDnsOverHttps.ts
|
|
34
37
|
import { axios } from "@xylabs/axios";
|
|
35
|
-
var googleDnsOverHttps = async (name, type =
|
|
38
|
+
var googleDnsOverHttps = /* @__PURE__ */ __name(async (name, type = DnsRecordType.A) => {
|
|
36
39
|
return (await axios.get(`https://dns.google/resolve?name=${name}&type=${type}`)).data;
|
|
37
|
-
};
|
|
40
|
+
}, "googleDnsOverHttps");
|
|
38
41
|
|
|
39
42
|
// src/domainResolve.ts
|
|
40
|
-
var domainResolve = async (domain, type =
|
|
43
|
+
var domainResolve = /* @__PURE__ */ __name(async (domain, type = DnsRecordType.A) => {
|
|
41
44
|
if (domain) {
|
|
42
45
|
const dnsResult = await googleDnsOverHttps(domain, type);
|
|
43
46
|
return dnsResult;
|
|
44
47
|
}
|
|
45
|
-
};
|
|
48
|
+
}, "domainResolve");
|
|
46
49
|
|
|
47
50
|
// src/domainExists.ts
|
|
48
|
-
var domainExists = async (domain) => {
|
|
51
|
+
var domainExists = /* @__PURE__ */ __name(async (domain) => {
|
|
49
52
|
if (domain === void 0)
|
|
50
53
|
return false;
|
|
51
54
|
const dnsResult = await domainResolve(domain);
|
|
52
|
-
return (dnsResult == null ? void 0 : dnsResult.Status) ===
|
|
53
|
-
};
|
|
55
|
+
return (dnsResult == null ? void 0 : dnsResult.Status) === DnsReturnCode.NoError;
|
|
56
|
+
}, "domainExists");
|
|
54
57
|
export {
|
|
55
58
|
DnsRecordType,
|
|
56
59
|
DnsReturnCode,
|
package/dist/node/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/DnsRecordType.ts","../../src/DnsReturnCode.ts","../../src/googleDnsOverHttps.ts","../../src/domainResolve.ts","../../src/domainExists.ts"],"sourcesContent":["export enum DnsRecordType {\n A = 1,\n AAAA = 28,\n CAA = 257,\n CNAME = 5,\n DNAME = 39,\n MX = 15,\n NS = 2,\n PTR = 12,\n SOA = 6,\n SPF = 99,\n SRV = 33,\n TXT = 16,\n}\n","enum DnsReturnCode {\n NoError = 0,\n QueryFormatError = 1,\n ServerFailed = 2,\n DomainDoesNotExist = 3,\n NotImplemented = 4,\n Refused = 5,\n NameShouldNotExist = 6,\n RRSetShouldNotExist = 7,\n NotAuthoratative = 8,\n NotInZone = 9,\n}\n\nexport { DnsReturnCode }\n","import { axios } from '@xylabs/axios'\n\nimport { DnsRecordType } from './DnsRecordType'\nimport { GoogleDnsResult } from './GoogleDnsResult'\n\nconst googleDnsOverHttps = async (name: string, type = DnsRecordType.A) => {\n return (await axios.get<GoogleDnsResult>(`https://dns.google/resolve?name=${name}&type=${type}`)).data\n}\n\nexport { googleDnsOverHttps }\n","import { DnsRecordType } from './DnsRecordType'\nimport { googleDnsOverHttps } from './googleDnsOverHttps'\n\n/**\n * Resolves DNS information (resolves using DNS)\n * @param domain - string\n * @returns GoogleDnsResult\n */\nconst domainResolve = async (domain?: string, type = DnsRecordType.A) => {\n if (domain) {\n const dnsResult = await googleDnsOverHttps(domain, type)\n return dnsResult\n }\n}\n\nexport { domainResolve }\n","import { DnsReturnCode } from './DnsReturnCode'\nimport { domainResolve } from './domainResolve'\n\n/**\n * Checks if a domain exists (resolves using DNS)\n * @param domain - string\n * @returns boolean\n */\nconst domainExists = async (domain?: string) => {\n if (domain === undefined) return false\n const dnsResult = await domainResolve(domain)\n return dnsResult?.Status === DnsReturnCode.NoError\n}\n\nexport { domainExists }\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/DnsRecordType.ts","../../src/DnsReturnCode.ts","../../src/googleDnsOverHttps.ts","../../src/domainResolve.ts","../../src/domainExists.ts"],"sourcesContent":["export enum DnsRecordType {\n A = 1,\n AAAA = 28,\n CAA = 257,\n CNAME = 5,\n DNAME = 39,\n MX = 15,\n NS = 2,\n PTR = 12,\n SOA = 6,\n SPF = 99,\n SRV = 33,\n TXT = 16,\n}\n","enum DnsReturnCode {\n NoError = 0,\n QueryFormatError = 1,\n ServerFailed = 2,\n DomainDoesNotExist = 3,\n NotImplemented = 4,\n Refused = 5,\n NameShouldNotExist = 6,\n RRSetShouldNotExist = 7,\n NotAuthoratative = 8,\n NotInZone = 9,\n}\n\nexport { DnsReturnCode }\n","import { axios } from '@xylabs/axios'\n\nimport { DnsRecordType } from './DnsRecordType'\nimport { GoogleDnsResult } from './GoogleDnsResult'\n\nconst googleDnsOverHttps = async (name: string, type = DnsRecordType.A) => {\n return (await axios.get<GoogleDnsResult>(`https://dns.google/resolve?name=${name}&type=${type}`)).data\n}\n\nexport { googleDnsOverHttps }\n","import { DnsRecordType } from './DnsRecordType'\nimport { googleDnsOverHttps } from './googleDnsOverHttps'\n\n/**\n * Resolves DNS information (resolves using DNS)\n * @param domain - string\n * @returns GoogleDnsResult\n */\nconst domainResolve = async (domain?: string, type = DnsRecordType.A) => {\n if (domain) {\n const dnsResult = await googleDnsOverHttps(domain, type)\n return dnsResult\n }\n}\n\nexport { domainResolve }\n","import { DnsReturnCode } from './DnsReturnCode'\nimport { domainResolve } from './domainResolve'\n\n/**\n * Checks if a domain exists (resolves using DNS)\n * @param domain - string\n * @returns boolean\n */\nconst domainExists = async (domain?: string) => {\n if (domain === undefined) return false\n const dnsResult = await domainResolve(domain)\n return dnsResult?.Status === DnsReturnCode.NoError\n}\n\nexport { domainExists }\n"],"mappings":";;;;;UAAYA,gBAAAA;;;;;;;;;;;;;GAAAA,kBAAAA,gBAAAA,CAAAA,EAAAA;;;;UCAPC,gBAAAA;;;;;;;;;;;GAAAA,kBAAAA,gBAAAA,CAAAA,EAAAA;;;ACAL,SAASC,aAAa;AAKtB,IAAMC,qBAAqB,8BAAOC,MAAcC,OAAOC,cAAcC,MAAC;AACpE,UAAQ,MAAMC,MAAMC,IAAqB,mCAAmCL,IAAAA,SAAaC,IAAAA,EAAM,GAAGK;AACpG,GAF2B;;;ACG3B,IAAMC,gBAAgB,8BAAOC,QAAiBC,OAAOC,cAAcC,MAAC;AAClE,MAAIH,QAAQ;AACV,UAAMI,YAAY,MAAMC,mBAAmBL,QAAQC,IAAAA;AACnD,WAAOG;EACT;AACF,GALsB;;;ACAtB,IAAME,eAAe,8BAAOC,WAAAA;AAC1B,MAAIA,WAAWC;AAAW,WAAO;AACjC,QAAMC,YAAY,MAAMC,cAAcH,MAAAA;AACtC,UAAOE,uCAAWE,YAAWC,cAAcC;AAC7C,GAJqB;","names":["DnsRecordType","DnsReturnCode","axios","googleDnsOverHttps","name","type","DnsRecordType","A","axios","get","data","domainResolve","domain","type","DnsRecordType","A","dnsResult","googleDnsOverHttps","domainExists","domain","undefined","dnsResult","domainResolve","Status","DnsReturnCode","NoError"]}
|