@xyo-network/dns 2.107.3 → 2.107.4
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 +83 -1
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.js +62 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/neutral/index.cjs +83 -1
- package/dist/neutral/index.cjs.map +1 -1
- package/dist/neutral/index.js +62 -1
- package/dist/neutral/index.js.map +1 -1
- package/dist/node/index.cjs +91 -1
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.js +62 -1
- package/dist/node/index.js.map +1 -1
- package/package.json +3 -3
package/dist/browser/index.cjs
CHANGED
|
@@ -1,2 +1,84 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/index.ts
|
|
22
|
+
var src_exports = {};
|
|
23
|
+
__export(src_exports, {
|
|
24
|
+
DnsRecordType: () => DnsRecordType,
|
|
25
|
+
DnsReturnCode: () => DnsReturnCode,
|
|
26
|
+
domainExists: () => domainExists,
|
|
27
|
+
domainResolve: () => domainResolve,
|
|
28
|
+
googleDnsOverHttps: () => googleDnsOverHttps
|
|
29
|
+
});
|
|
30
|
+
module.exports = __toCommonJS(src_exports);
|
|
31
|
+
|
|
32
|
+
// src/DnsRecordType.ts
|
|
33
|
+
var DnsRecordType;
|
|
34
|
+
(function(DnsRecordType2) {
|
|
35
|
+
DnsRecordType2[DnsRecordType2["A"] = 1] = "A";
|
|
36
|
+
DnsRecordType2[DnsRecordType2["AAAA"] = 28] = "AAAA";
|
|
37
|
+
DnsRecordType2[DnsRecordType2["CAA"] = 257] = "CAA";
|
|
38
|
+
DnsRecordType2[DnsRecordType2["CNAME"] = 5] = "CNAME";
|
|
39
|
+
DnsRecordType2[DnsRecordType2["DNAME"] = 39] = "DNAME";
|
|
40
|
+
DnsRecordType2[DnsRecordType2["MX"] = 15] = "MX";
|
|
41
|
+
DnsRecordType2[DnsRecordType2["NS"] = 2] = "NS";
|
|
42
|
+
DnsRecordType2[DnsRecordType2["PTR"] = 12] = "PTR";
|
|
43
|
+
DnsRecordType2[DnsRecordType2["SOA"] = 6] = "SOA";
|
|
44
|
+
DnsRecordType2[DnsRecordType2["SPF"] = 99] = "SPF";
|
|
45
|
+
DnsRecordType2[DnsRecordType2["SRV"] = 33] = "SRV";
|
|
46
|
+
DnsRecordType2[DnsRecordType2["TXT"] = 16] = "TXT";
|
|
47
|
+
})(DnsRecordType || (DnsRecordType = {}));
|
|
48
|
+
|
|
49
|
+
// src/DnsReturnCode.ts
|
|
50
|
+
var DnsReturnCode;
|
|
51
|
+
(function(DnsReturnCode2) {
|
|
52
|
+
DnsReturnCode2[DnsReturnCode2["NoError"] = 0] = "NoError";
|
|
53
|
+
DnsReturnCode2[DnsReturnCode2["QueryFormatError"] = 1] = "QueryFormatError";
|
|
54
|
+
DnsReturnCode2[DnsReturnCode2["ServerFailed"] = 2] = "ServerFailed";
|
|
55
|
+
DnsReturnCode2[DnsReturnCode2["DomainDoesNotExist"] = 3] = "DomainDoesNotExist";
|
|
56
|
+
DnsReturnCode2[DnsReturnCode2["NotImplemented"] = 4] = "NotImplemented";
|
|
57
|
+
DnsReturnCode2[DnsReturnCode2["Refused"] = 5] = "Refused";
|
|
58
|
+
DnsReturnCode2[DnsReturnCode2["NameShouldNotExist"] = 6] = "NameShouldNotExist";
|
|
59
|
+
DnsReturnCode2[DnsReturnCode2["RRSetShouldNotExist"] = 7] = "RRSetShouldNotExist";
|
|
60
|
+
DnsReturnCode2[DnsReturnCode2["NotAuthoratative"] = 8] = "NotAuthoratative";
|
|
61
|
+
DnsReturnCode2[DnsReturnCode2["NotInZone"] = 9] = "NotInZone";
|
|
62
|
+
})(DnsReturnCode || (DnsReturnCode = {}));
|
|
63
|
+
|
|
64
|
+
// src/googleDnsOverHttps.ts
|
|
65
|
+
var import_axios = require("@xylabs/axios");
|
|
66
|
+
var googleDnsOverHttps = /* @__PURE__ */ __name(async (name, type = DnsRecordType.A) => {
|
|
67
|
+
return (await import_axios.axios.get(`https://dns.google/resolve?name=${name}&type=${type}`)).data;
|
|
68
|
+
}, "googleDnsOverHttps");
|
|
69
|
+
|
|
70
|
+
// src/domainResolve.ts
|
|
71
|
+
var domainResolve = /* @__PURE__ */ __name(async (domain, type = DnsRecordType.A) => {
|
|
72
|
+
if (domain) {
|
|
73
|
+
const dnsResult = await googleDnsOverHttps(domain, type);
|
|
74
|
+
return dnsResult;
|
|
75
|
+
}
|
|
76
|
+
}, "domainResolve");
|
|
77
|
+
|
|
78
|
+
// src/domainExists.ts
|
|
79
|
+
var domainExists = /* @__PURE__ */ __name(async (domain) => {
|
|
80
|
+
if (domain === void 0) return false;
|
|
81
|
+
const dnsResult = await domainResolve(domain);
|
|
82
|
+
return dnsResult?.Status === DnsReturnCode.NoError;
|
|
83
|
+
}, "domainExists");
|
|
2
84
|
//# 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,OAAW,QAAO;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,2 +1,63 @@
|
|
|
1
|
-
var
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
|
|
4
|
+
// src/DnsRecordType.ts
|
|
5
|
+
var DnsRecordType;
|
|
6
|
+
(function(DnsRecordType2) {
|
|
7
|
+
DnsRecordType2[DnsRecordType2["A"] = 1] = "A";
|
|
8
|
+
DnsRecordType2[DnsRecordType2["AAAA"] = 28] = "AAAA";
|
|
9
|
+
DnsRecordType2[DnsRecordType2["CAA"] = 257] = "CAA";
|
|
10
|
+
DnsRecordType2[DnsRecordType2["CNAME"] = 5] = "CNAME";
|
|
11
|
+
DnsRecordType2[DnsRecordType2["DNAME"] = 39] = "DNAME";
|
|
12
|
+
DnsRecordType2[DnsRecordType2["MX"] = 15] = "MX";
|
|
13
|
+
DnsRecordType2[DnsRecordType2["NS"] = 2] = "NS";
|
|
14
|
+
DnsRecordType2[DnsRecordType2["PTR"] = 12] = "PTR";
|
|
15
|
+
DnsRecordType2[DnsRecordType2["SOA"] = 6] = "SOA";
|
|
16
|
+
DnsRecordType2[DnsRecordType2["SPF"] = 99] = "SPF";
|
|
17
|
+
DnsRecordType2[DnsRecordType2["SRV"] = 33] = "SRV";
|
|
18
|
+
DnsRecordType2[DnsRecordType2["TXT"] = 16] = "TXT";
|
|
19
|
+
})(DnsRecordType || (DnsRecordType = {}));
|
|
20
|
+
|
|
21
|
+
// src/DnsReturnCode.ts
|
|
22
|
+
var DnsReturnCode;
|
|
23
|
+
(function(DnsReturnCode2) {
|
|
24
|
+
DnsReturnCode2[DnsReturnCode2["NoError"] = 0] = "NoError";
|
|
25
|
+
DnsReturnCode2[DnsReturnCode2["QueryFormatError"] = 1] = "QueryFormatError";
|
|
26
|
+
DnsReturnCode2[DnsReturnCode2["ServerFailed"] = 2] = "ServerFailed";
|
|
27
|
+
DnsReturnCode2[DnsReturnCode2["DomainDoesNotExist"] = 3] = "DomainDoesNotExist";
|
|
28
|
+
DnsReturnCode2[DnsReturnCode2["NotImplemented"] = 4] = "NotImplemented";
|
|
29
|
+
DnsReturnCode2[DnsReturnCode2["Refused"] = 5] = "Refused";
|
|
30
|
+
DnsReturnCode2[DnsReturnCode2["NameShouldNotExist"] = 6] = "NameShouldNotExist";
|
|
31
|
+
DnsReturnCode2[DnsReturnCode2["RRSetShouldNotExist"] = 7] = "RRSetShouldNotExist";
|
|
32
|
+
DnsReturnCode2[DnsReturnCode2["NotAuthoratative"] = 8] = "NotAuthoratative";
|
|
33
|
+
DnsReturnCode2[DnsReturnCode2["NotInZone"] = 9] = "NotInZone";
|
|
34
|
+
})(DnsReturnCode || (DnsReturnCode = {}));
|
|
35
|
+
|
|
36
|
+
// src/googleDnsOverHttps.ts
|
|
37
|
+
import { axios } from "@xylabs/axios";
|
|
38
|
+
var googleDnsOverHttps = /* @__PURE__ */ __name(async (name, type = DnsRecordType.A) => {
|
|
39
|
+
return (await axios.get(`https://dns.google/resolve?name=${name}&type=${type}`)).data;
|
|
40
|
+
}, "googleDnsOverHttps");
|
|
41
|
+
|
|
42
|
+
// src/domainResolve.ts
|
|
43
|
+
var domainResolve = /* @__PURE__ */ __name(async (domain, type = DnsRecordType.A) => {
|
|
44
|
+
if (domain) {
|
|
45
|
+
const dnsResult = await googleDnsOverHttps(domain, type);
|
|
46
|
+
return dnsResult;
|
|
47
|
+
}
|
|
48
|
+
}, "domainResolve");
|
|
49
|
+
|
|
50
|
+
// src/domainExists.ts
|
|
51
|
+
var domainExists = /* @__PURE__ */ __name(async (domain) => {
|
|
52
|
+
if (domain === void 0) return false;
|
|
53
|
+
const dnsResult = await domainResolve(domain);
|
|
54
|
+
return dnsResult?.Status === DnsReturnCode.NoError;
|
|
55
|
+
}, "domainExists");
|
|
56
|
+
export {
|
|
57
|
+
DnsRecordType,
|
|
58
|
+
DnsReturnCode,
|
|
59
|
+
domainExists,
|
|
60
|
+
domainResolve,
|
|
61
|
+
googleDnsOverHttps
|
|
62
|
+
};
|
|
2
63
|
//# sourceMappingURL=index.js.map
|
|
@@ -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,OAAW,QAAO;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/neutral/index.cjs
CHANGED
|
@@ -1,2 +1,84 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/index.ts
|
|
22
|
+
var src_exports = {};
|
|
23
|
+
__export(src_exports, {
|
|
24
|
+
DnsRecordType: () => DnsRecordType,
|
|
25
|
+
DnsReturnCode: () => DnsReturnCode,
|
|
26
|
+
domainExists: () => domainExists,
|
|
27
|
+
domainResolve: () => domainResolve,
|
|
28
|
+
googleDnsOverHttps: () => googleDnsOverHttps
|
|
29
|
+
});
|
|
30
|
+
module.exports = __toCommonJS(src_exports);
|
|
31
|
+
|
|
32
|
+
// src/DnsRecordType.ts
|
|
33
|
+
var DnsRecordType;
|
|
34
|
+
(function(DnsRecordType2) {
|
|
35
|
+
DnsRecordType2[DnsRecordType2["A"] = 1] = "A";
|
|
36
|
+
DnsRecordType2[DnsRecordType2["AAAA"] = 28] = "AAAA";
|
|
37
|
+
DnsRecordType2[DnsRecordType2["CAA"] = 257] = "CAA";
|
|
38
|
+
DnsRecordType2[DnsRecordType2["CNAME"] = 5] = "CNAME";
|
|
39
|
+
DnsRecordType2[DnsRecordType2["DNAME"] = 39] = "DNAME";
|
|
40
|
+
DnsRecordType2[DnsRecordType2["MX"] = 15] = "MX";
|
|
41
|
+
DnsRecordType2[DnsRecordType2["NS"] = 2] = "NS";
|
|
42
|
+
DnsRecordType2[DnsRecordType2["PTR"] = 12] = "PTR";
|
|
43
|
+
DnsRecordType2[DnsRecordType2["SOA"] = 6] = "SOA";
|
|
44
|
+
DnsRecordType2[DnsRecordType2["SPF"] = 99] = "SPF";
|
|
45
|
+
DnsRecordType2[DnsRecordType2["SRV"] = 33] = "SRV";
|
|
46
|
+
DnsRecordType2[DnsRecordType2["TXT"] = 16] = "TXT";
|
|
47
|
+
})(DnsRecordType || (DnsRecordType = {}));
|
|
48
|
+
|
|
49
|
+
// src/DnsReturnCode.ts
|
|
50
|
+
var DnsReturnCode;
|
|
51
|
+
(function(DnsReturnCode2) {
|
|
52
|
+
DnsReturnCode2[DnsReturnCode2["NoError"] = 0] = "NoError";
|
|
53
|
+
DnsReturnCode2[DnsReturnCode2["QueryFormatError"] = 1] = "QueryFormatError";
|
|
54
|
+
DnsReturnCode2[DnsReturnCode2["ServerFailed"] = 2] = "ServerFailed";
|
|
55
|
+
DnsReturnCode2[DnsReturnCode2["DomainDoesNotExist"] = 3] = "DomainDoesNotExist";
|
|
56
|
+
DnsReturnCode2[DnsReturnCode2["NotImplemented"] = 4] = "NotImplemented";
|
|
57
|
+
DnsReturnCode2[DnsReturnCode2["Refused"] = 5] = "Refused";
|
|
58
|
+
DnsReturnCode2[DnsReturnCode2["NameShouldNotExist"] = 6] = "NameShouldNotExist";
|
|
59
|
+
DnsReturnCode2[DnsReturnCode2["RRSetShouldNotExist"] = 7] = "RRSetShouldNotExist";
|
|
60
|
+
DnsReturnCode2[DnsReturnCode2["NotAuthoratative"] = 8] = "NotAuthoratative";
|
|
61
|
+
DnsReturnCode2[DnsReturnCode2["NotInZone"] = 9] = "NotInZone";
|
|
62
|
+
})(DnsReturnCode || (DnsReturnCode = {}));
|
|
63
|
+
|
|
64
|
+
// src/googleDnsOverHttps.ts
|
|
65
|
+
var import_axios = require("@xylabs/axios");
|
|
66
|
+
var googleDnsOverHttps = /* @__PURE__ */ __name(async (name, type = DnsRecordType.A) => {
|
|
67
|
+
return (await import_axios.axios.get(`https://dns.google/resolve?name=${name}&type=${type}`)).data;
|
|
68
|
+
}, "googleDnsOverHttps");
|
|
69
|
+
|
|
70
|
+
// src/domainResolve.ts
|
|
71
|
+
var domainResolve = /* @__PURE__ */ __name(async (domain, type = DnsRecordType.A) => {
|
|
72
|
+
if (domain) {
|
|
73
|
+
const dnsResult = await googleDnsOverHttps(domain, type);
|
|
74
|
+
return dnsResult;
|
|
75
|
+
}
|
|
76
|
+
}, "domainResolve");
|
|
77
|
+
|
|
78
|
+
// src/domainExists.ts
|
|
79
|
+
var domainExists = /* @__PURE__ */ __name(async (domain) => {
|
|
80
|
+
if (domain === void 0) return false;
|
|
81
|
+
const dnsResult = await domainResolve(domain);
|
|
82
|
+
return dnsResult?.Status === DnsReturnCode.NoError;
|
|
83
|
+
}, "domainExists");
|
|
2
84
|
//# 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,OAAW,QAAO;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/neutral/index.js
CHANGED
|
@@ -1,2 +1,63 @@
|
|
|
1
|
-
var
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
|
|
4
|
+
// src/DnsRecordType.ts
|
|
5
|
+
var DnsRecordType;
|
|
6
|
+
(function(DnsRecordType2) {
|
|
7
|
+
DnsRecordType2[DnsRecordType2["A"] = 1] = "A";
|
|
8
|
+
DnsRecordType2[DnsRecordType2["AAAA"] = 28] = "AAAA";
|
|
9
|
+
DnsRecordType2[DnsRecordType2["CAA"] = 257] = "CAA";
|
|
10
|
+
DnsRecordType2[DnsRecordType2["CNAME"] = 5] = "CNAME";
|
|
11
|
+
DnsRecordType2[DnsRecordType2["DNAME"] = 39] = "DNAME";
|
|
12
|
+
DnsRecordType2[DnsRecordType2["MX"] = 15] = "MX";
|
|
13
|
+
DnsRecordType2[DnsRecordType2["NS"] = 2] = "NS";
|
|
14
|
+
DnsRecordType2[DnsRecordType2["PTR"] = 12] = "PTR";
|
|
15
|
+
DnsRecordType2[DnsRecordType2["SOA"] = 6] = "SOA";
|
|
16
|
+
DnsRecordType2[DnsRecordType2["SPF"] = 99] = "SPF";
|
|
17
|
+
DnsRecordType2[DnsRecordType2["SRV"] = 33] = "SRV";
|
|
18
|
+
DnsRecordType2[DnsRecordType2["TXT"] = 16] = "TXT";
|
|
19
|
+
})(DnsRecordType || (DnsRecordType = {}));
|
|
20
|
+
|
|
21
|
+
// src/DnsReturnCode.ts
|
|
22
|
+
var DnsReturnCode;
|
|
23
|
+
(function(DnsReturnCode2) {
|
|
24
|
+
DnsReturnCode2[DnsReturnCode2["NoError"] = 0] = "NoError";
|
|
25
|
+
DnsReturnCode2[DnsReturnCode2["QueryFormatError"] = 1] = "QueryFormatError";
|
|
26
|
+
DnsReturnCode2[DnsReturnCode2["ServerFailed"] = 2] = "ServerFailed";
|
|
27
|
+
DnsReturnCode2[DnsReturnCode2["DomainDoesNotExist"] = 3] = "DomainDoesNotExist";
|
|
28
|
+
DnsReturnCode2[DnsReturnCode2["NotImplemented"] = 4] = "NotImplemented";
|
|
29
|
+
DnsReturnCode2[DnsReturnCode2["Refused"] = 5] = "Refused";
|
|
30
|
+
DnsReturnCode2[DnsReturnCode2["NameShouldNotExist"] = 6] = "NameShouldNotExist";
|
|
31
|
+
DnsReturnCode2[DnsReturnCode2["RRSetShouldNotExist"] = 7] = "RRSetShouldNotExist";
|
|
32
|
+
DnsReturnCode2[DnsReturnCode2["NotAuthoratative"] = 8] = "NotAuthoratative";
|
|
33
|
+
DnsReturnCode2[DnsReturnCode2["NotInZone"] = 9] = "NotInZone";
|
|
34
|
+
})(DnsReturnCode || (DnsReturnCode = {}));
|
|
35
|
+
|
|
36
|
+
// src/googleDnsOverHttps.ts
|
|
37
|
+
import { axios } from "@xylabs/axios";
|
|
38
|
+
var googleDnsOverHttps = /* @__PURE__ */ __name(async (name, type = DnsRecordType.A) => {
|
|
39
|
+
return (await axios.get(`https://dns.google/resolve?name=${name}&type=${type}`)).data;
|
|
40
|
+
}, "googleDnsOverHttps");
|
|
41
|
+
|
|
42
|
+
// src/domainResolve.ts
|
|
43
|
+
var domainResolve = /* @__PURE__ */ __name(async (domain, type = DnsRecordType.A) => {
|
|
44
|
+
if (domain) {
|
|
45
|
+
const dnsResult = await googleDnsOverHttps(domain, type);
|
|
46
|
+
return dnsResult;
|
|
47
|
+
}
|
|
48
|
+
}, "domainResolve");
|
|
49
|
+
|
|
50
|
+
// src/domainExists.ts
|
|
51
|
+
var domainExists = /* @__PURE__ */ __name(async (domain) => {
|
|
52
|
+
if (domain === void 0) return false;
|
|
53
|
+
const dnsResult = await domainResolve(domain);
|
|
54
|
+
return dnsResult?.Status === DnsReturnCode.NoError;
|
|
55
|
+
}, "domainExists");
|
|
56
|
+
export {
|
|
57
|
+
DnsRecordType,
|
|
58
|
+
DnsReturnCode,
|
|
59
|
+
domainExists,
|
|
60
|
+
domainResolve,
|
|
61
|
+
googleDnsOverHttps
|
|
62
|
+
};
|
|
2
63
|
//# sourceMappingURL=index.js.map
|
|
@@ -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,OAAW,QAAO;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
|
@@ -1,2 +1,92 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/index.ts
|
|
22
|
+
var src_exports = {};
|
|
23
|
+
__export(src_exports, {
|
|
24
|
+
DnsRecordType: () => DnsRecordType,
|
|
25
|
+
DnsReturnCode: () => DnsReturnCode,
|
|
26
|
+
domainExists: () => domainExists,
|
|
27
|
+
domainResolve: () => domainResolve,
|
|
28
|
+
googleDnsOverHttps: () => googleDnsOverHttps
|
|
29
|
+
});
|
|
30
|
+
module.exports = __toCommonJS(src_exports);
|
|
31
|
+
|
|
32
|
+
// src/DnsRecordType.ts
|
|
33
|
+
var DnsRecordType;
|
|
34
|
+
(function(DnsRecordType2) {
|
|
35
|
+
DnsRecordType2[DnsRecordType2["A"] = 1] = "A";
|
|
36
|
+
DnsRecordType2[DnsRecordType2["AAAA"] = 28] = "AAAA";
|
|
37
|
+
DnsRecordType2[DnsRecordType2["CAA"] = 257] = "CAA";
|
|
38
|
+
DnsRecordType2[DnsRecordType2["CNAME"] = 5] = "CNAME";
|
|
39
|
+
DnsRecordType2[DnsRecordType2["DNAME"] = 39] = "DNAME";
|
|
40
|
+
DnsRecordType2[DnsRecordType2["MX"] = 15] = "MX";
|
|
41
|
+
DnsRecordType2[DnsRecordType2["NS"] = 2] = "NS";
|
|
42
|
+
DnsRecordType2[DnsRecordType2["PTR"] = 12] = "PTR";
|
|
43
|
+
DnsRecordType2[DnsRecordType2["SOA"] = 6] = "SOA";
|
|
44
|
+
DnsRecordType2[DnsRecordType2["SPF"] = 99] = "SPF";
|
|
45
|
+
DnsRecordType2[DnsRecordType2["SRV"] = 33] = "SRV";
|
|
46
|
+
DnsRecordType2[DnsRecordType2["TXT"] = 16] = "TXT";
|
|
47
|
+
})(DnsRecordType || (DnsRecordType = {}));
|
|
48
|
+
|
|
49
|
+
// src/DnsReturnCode.ts
|
|
50
|
+
var DnsReturnCode;
|
|
51
|
+
(function(DnsReturnCode2) {
|
|
52
|
+
DnsReturnCode2[DnsReturnCode2["NoError"] = 0] = "NoError";
|
|
53
|
+
DnsReturnCode2[DnsReturnCode2["QueryFormatError"] = 1] = "QueryFormatError";
|
|
54
|
+
DnsReturnCode2[DnsReturnCode2["ServerFailed"] = 2] = "ServerFailed";
|
|
55
|
+
DnsReturnCode2[DnsReturnCode2["DomainDoesNotExist"] = 3] = "DomainDoesNotExist";
|
|
56
|
+
DnsReturnCode2[DnsReturnCode2["NotImplemented"] = 4] = "NotImplemented";
|
|
57
|
+
DnsReturnCode2[DnsReturnCode2["Refused"] = 5] = "Refused";
|
|
58
|
+
DnsReturnCode2[DnsReturnCode2["NameShouldNotExist"] = 6] = "NameShouldNotExist";
|
|
59
|
+
DnsReturnCode2[DnsReturnCode2["RRSetShouldNotExist"] = 7] = "RRSetShouldNotExist";
|
|
60
|
+
DnsReturnCode2[DnsReturnCode2["NotAuthoratative"] = 8] = "NotAuthoratative";
|
|
61
|
+
DnsReturnCode2[DnsReturnCode2["NotInZone"] = 9] = "NotInZone";
|
|
62
|
+
})(DnsReturnCode || (DnsReturnCode = {}));
|
|
63
|
+
|
|
64
|
+
// src/googleDnsOverHttps.ts
|
|
65
|
+
var import_axios = require("@xylabs/axios");
|
|
66
|
+
var googleDnsOverHttps = /* @__PURE__ */ __name(async (name, type = DnsRecordType.A) => {
|
|
67
|
+
return (await import_axios.axios.get(`https://dns.google/resolve?name=${name}&type=${type}`)).data;
|
|
68
|
+
}, "googleDnsOverHttps");
|
|
69
|
+
|
|
70
|
+
// src/domainResolve.ts
|
|
71
|
+
var domainResolve = /* @__PURE__ */ __name(async (domain, type = DnsRecordType.A) => {
|
|
72
|
+
if (domain) {
|
|
73
|
+
const dnsResult = await googleDnsOverHttps(domain, type);
|
|
74
|
+
return dnsResult;
|
|
75
|
+
}
|
|
76
|
+
}, "domainResolve");
|
|
77
|
+
|
|
78
|
+
// src/domainExists.ts
|
|
79
|
+
var domainExists = /* @__PURE__ */ __name(async (domain) => {
|
|
80
|
+
if (domain === void 0) return false;
|
|
81
|
+
const dnsResult = await domainResolve(domain);
|
|
82
|
+
return (dnsResult == null ? void 0 : dnsResult.Status) === DnsReturnCode.NoError;
|
|
83
|
+
}, "domainExists");
|
|
84
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
85
|
+
0 && (module.exports = {
|
|
86
|
+
DnsRecordType,
|
|
87
|
+
DnsReturnCode,
|
|
88
|
+
domainExists,
|
|
89
|
+
domainResolve,
|
|
90
|
+
googleDnsOverHttps
|
|
91
|
+
});
|
|
2
92
|
//# sourceMappingURL=index.cjs.map
|
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,OAAW,QAAO;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,2 +1,63 @@
|
|
|
1
|
-
var
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
|
|
4
|
+
// src/DnsRecordType.ts
|
|
5
|
+
var DnsRecordType;
|
|
6
|
+
(function(DnsRecordType2) {
|
|
7
|
+
DnsRecordType2[DnsRecordType2["A"] = 1] = "A";
|
|
8
|
+
DnsRecordType2[DnsRecordType2["AAAA"] = 28] = "AAAA";
|
|
9
|
+
DnsRecordType2[DnsRecordType2["CAA"] = 257] = "CAA";
|
|
10
|
+
DnsRecordType2[DnsRecordType2["CNAME"] = 5] = "CNAME";
|
|
11
|
+
DnsRecordType2[DnsRecordType2["DNAME"] = 39] = "DNAME";
|
|
12
|
+
DnsRecordType2[DnsRecordType2["MX"] = 15] = "MX";
|
|
13
|
+
DnsRecordType2[DnsRecordType2["NS"] = 2] = "NS";
|
|
14
|
+
DnsRecordType2[DnsRecordType2["PTR"] = 12] = "PTR";
|
|
15
|
+
DnsRecordType2[DnsRecordType2["SOA"] = 6] = "SOA";
|
|
16
|
+
DnsRecordType2[DnsRecordType2["SPF"] = 99] = "SPF";
|
|
17
|
+
DnsRecordType2[DnsRecordType2["SRV"] = 33] = "SRV";
|
|
18
|
+
DnsRecordType2[DnsRecordType2["TXT"] = 16] = "TXT";
|
|
19
|
+
})(DnsRecordType || (DnsRecordType = {}));
|
|
20
|
+
|
|
21
|
+
// src/DnsReturnCode.ts
|
|
22
|
+
var DnsReturnCode;
|
|
23
|
+
(function(DnsReturnCode2) {
|
|
24
|
+
DnsReturnCode2[DnsReturnCode2["NoError"] = 0] = "NoError";
|
|
25
|
+
DnsReturnCode2[DnsReturnCode2["QueryFormatError"] = 1] = "QueryFormatError";
|
|
26
|
+
DnsReturnCode2[DnsReturnCode2["ServerFailed"] = 2] = "ServerFailed";
|
|
27
|
+
DnsReturnCode2[DnsReturnCode2["DomainDoesNotExist"] = 3] = "DomainDoesNotExist";
|
|
28
|
+
DnsReturnCode2[DnsReturnCode2["NotImplemented"] = 4] = "NotImplemented";
|
|
29
|
+
DnsReturnCode2[DnsReturnCode2["Refused"] = 5] = "Refused";
|
|
30
|
+
DnsReturnCode2[DnsReturnCode2["NameShouldNotExist"] = 6] = "NameShouldNotExist";
|
|
31
|
+
DnsReturnCode2[DnsReturnCode2["RRSetShouldNotExist"] = 7] = "RRSetShouldNotExist";
|
|
32
|
+
DnsReturnCode2[DnsReturnCode2["NotAuthoratative"] = 8] = "NotAuthoratative";
|
|
33
|
+
DnsReturnCode2[DnsReturnCode2["NotInZone"] = 9] = "NotInZone";
|
|
34
|
+
})(DnsReturnCode || (DnsReturnCode = {}));
|
|
35
|
+
|
|
36
|
+
// src/googleDnsOverHttps.ts
|
|
37
|
+
import { axios } from "@xylabs/axios";
|
|
38
|
+
var googleDnsOverHttps = /* @__PURE__ */ __name(async (name, type = DnsRecordType.A) => {
|
|
39
|
+
return (await axios.get(`https://dns.google/resolve?name=${name}&type=${type}`)).data;
|
|
40
|
+
}, "googleDnsOverHttps");
|
|
41
|
+
|
|
42
|
+
// src/domainResolve.ts
|
|
43
|
+
var domainResolve = /* @__PURE__ */ __name(async (domain, type = DnsRecordType.A) => {
|
|
44
|
+
if (domain) {
|
|
45
|
+
const dnsResult = await googleDnsOverHttps(domain, type);
|
|
46
|
+
return dnsResult;
|
|
47
|
+
}
|
|
48
|
+
}, "domainResolve");
|
|
49
|
+
|
|
50
|
+
// src/domainExists.ts
|
|
51
|
+
var domainExists = /* @__PURE__ */ __name(async (domain) => {
|
|
52
|
+
if (domain === void 0) return false;
|
|
53
|
+
const dnsResult = await domainResolve(domain);
|
|
54
|
+
return (dnsResult == null ? void 0 : dnsResult.Status) === DnsReturnCode.NoError;
|
|
55
|
+
}, "domainExists");
|
|
56
|
+
export {
|
|
57
|
+
DnsRecordType,
|
|
58
|
+
DnsReturnCode,
|
|
59
|
+
domainExists,
|
|
60
|
+
domainResolve,
|
|
61
|
+
googleDnsOverHttps
|
|
62
|
+
};
|
|
2
63
|
//# sourceMappingURL=index.js.map
|
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,OAAW,QAAO;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"]}
|
package/package.json
CHANGED
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"@xylabs/axios": "^3.5.1"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@xylabs/ts-scripts-yarn3": "^3.11.
|
|
18
|
-
"@xylabs/tsconfig": "^3.11.
|
|
17
|
+
"@xylabs/ts-scripts-yarn3": "^3.11.10",
|
|
18
|
+
"@xylabs/tsconfig": "^3.11.10",
|
|
19
19
|
"typescript": "^5.5.2"
|
|
20
20
|
},
|
|
21
21
|
"exports": {
|
|
@@ -56,6 +56,6 @@
|
|
|
56
56
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
|
|
57
57
|
},
|
|
58
58
|
"sideEffects": false,
|
|
59
|
-
"version": "2.107.
|
|
59
|
+
"version": "2.107.4",
|
|
60
60
|
"type": "module"
|
|
61
61
|
}
|