@xyo-network/dns 5.3.22 → 5.3.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +7 -11
- package/src/DnsRecordType.ts +0 -16
- package/src/DnsReturnCode.ts +0 -14
- package/src/GoogleDnsResult.ts +0 -17
- package/src/GoogleDnsResultAnswer.ts +0 -8
- package/src/GoogleDnsResultQuestion.ts +0 -11
- package/src/domainExists.ts +0 -15
- package/src/domainResolve.ts +0 -17
- package/src/googleDnsOverHttps.ts +0 -10
- package/src/index.ts +0 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/dns",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.25",
|
|
4
4
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -30,7 +30,6 @@
|
|
|
30
30
|
"types": "dist/neutral/index.d.ts",
|
|
31
31
|
"files": [
|
|
32
32
|
"dist",
|
|
33
|
-
"src",
|
|
34
33
|
"!**/*.bench.*",
|
|
35
34
|
"!**/*.spec.*",
|
|
36
35
|
"!**/*.test.*",
|
|
@@ -39,16 +38,13 @@
|
|
|
39
38
|
"devDependencies": {
|
|
40
39
|
"@opentelemetry/api": "^1.9.1",
|
|
41
40
|
"@types/node": "^25.5.0",
|
|
42
|
-
"@xylabs/sdk-js": "~5.0.
|
|
43
|
-
"@xylabs/ts-scripts-common": "~7.6.
|
|
44
|
-
"@xylabs/ts-scripts-
|
|
45
|
-
"@xylabs/tsconfig": "~7.6.
|
|
41
|
+
"@xylabs/sdk-js": "~5.0.93",
|
|
42
|
+
"@xylabs/ts-scripts-common": "~7.6.16",
|
|
43
|
+
"@xylabs/ts-scripts-pnpm": "~7.6.16",
|
|
44
|
+
"@xylabs/tsconfig": "~7.6.16",
|
|
46
45
|
"acorn": "^8.16.0",
|
|
47
46
|
"axios": "^1.14.0",
|
|
48
|
-
"
|
|
49
|
-
"esbuild": "^0.27.4",
|
|
50
|
-
"eslint": "^10.1.0",
|
|
51
|
-
"rollup": "^4.60.1",
|
|
47
|
+
"esbuild": "^0.28.0",
|
|
52
48
|
"typescript": "~5.9.3",
|
|
53
49
|
"zod": "^4.3.6"
|
|
54
50
|
},
|
|
@@ -59,4 +55,4 @@
|
|
|
59
55
|
"publishConfig": {
|
|
60
56
|
"access": "public"
|
|
61
57
|
}
|
|
62
|
-
}
|
|
58
|
+
}
|
package/src/DnsRecordType.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export const DnsRecordType = {
|
|
2
|
-
A: 1,
|
|
3
|
-
AAAA: 28,
|
|
4
|
-
CAA: 257,
|
|
5
|
-
CNAME: 5,
|
|
6
|
-
DNAME: 39,
|
|
7
|
-
MX: 15,
|
|
8
|
-
NS: 2,
|
|
9
|
-
PTR: 12,
|
|
10
|
-
SOA: 6,
|
|
11
|
-
SPF: 99,
|
|
12
|
-
SRV: 33,
|
|
13
|
-
TXT: 16,
|
|
14
|
-
} as const
|
|
15
|
-
|
|
16
|
-
export type DnsRecordType = typeof DnsRecordType[keyof typeof DnsRecordType]
|
package/src/DnsReturnCode.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export const DnsReturnCode = {
|
|
2
|
-
NoError: 0,
|
|
3
|
-
QueryFormatError: 1,
|
|
4
|
-
ServerFailed: 2,
|
|
5
|
-
DomainDoesNotExist: 3,
|
|
6
|
-
NotImplemented: 4,
|
|
7
|
-
Refused: 5,
|
|
8
|
-
NameShouldNotExist: 6,
|
|
9
|
-
RRSetShouldNotExist: 7,
|
|
10
|
-
NotAuthoritative: 8,
|
|
11
|
-
NotInZone: 9,
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export type DnsReturnCode = typeof DnsReturnCode[keyof typeof DnsReturnCode]
|
package/src/GoogleDnsResult.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { DnsReturnCode } from './DnsReturnCode.ts'
|
|
2
|
-
import type { GoogleDnsResultAnswer } from './GoogleDnsResultAnswer.ts'
|
|
3
|
-
import type { GoogleDnsResultQuestion } from './GoogleDnsResultQuestion.ts'
|
|
4
|
-
|
|
5
|
-
export interface GoogleDnsResult {
|
|
6
|
-
AD?: boolean // Validated with DNSSEC
|
|
7
|
-
Answer?: GoogleDnsResultAnswer[]
|
|
8
|
-
Authority?: GoogleDnsResultAnswer[]
|
|
9
|
-
CD?: boolean // DNSSEC disabled
|
|
10
|
-
Comment?: string
|
|
11
|
-
Question?: GoogleDnsResultQuestion[]
|
|
12
|
-
RA?: boolean
|
|
13
|
-
RD?: boolean
|
|
14
|
-
Status?: DnsReturnCode
|
|
15
|
-
TC?: boolean // Truncated
|
|
16
|
-
edns_client_subnet?: string
|
|
17
|
-
}
|
package/src/domainExists.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { DnsReturnCode } from './DnsReturnCode.ts'
|
|
2
|
-
import { domainResolve } from './domainResolve.ts'
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Checks if a domain exists (resolves using DNS)
|
|
6
|
-
* @param domain - string
|
|
7
|
-
* @returns boolean
|
|
8
|
-
*/
|
|
9
|
-
const domainExists = async (domain?: string) => {
|
|
10
|
-
if (domain === undefined) return false
|
|
11
|
-
const dnsResult = await domainResolve(domain)
|
|
12
|
-
return dnsResult?.Status === DnsReturnCode.NoError
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export { domainExists }
|
package/src/domainResolve.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { isDefined } from '@xylabs/sdk-js'
|
|
2
|
-
|
|
3
|
-
import { DnsRecordType } from './DnsRecordType.ts'
|
|
4
|
-
import { googleDnsOverHttps } from './googleDnsOverHttps.ts'
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Resolves DNS information (resolves using DNS)
|
|
8
|
-
* @param domain - string
|
|
9
|
-
* @returns GoogleDnsResult
|
|
10
|
-
*/
|
|
11
|
-
const domainResolve = async (domain?: string, type: DnsRecordType = DnsRecordType.A) => {
|
|
12
|
-
if (isDefined(domain)) {
|
|
13
|
-
return await googleDnsOverHttps(domain, type)
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export { domainResolve }
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { axiosJson } from '@xylabs/sdk-js'
|
|
2
|
-
|
|
3
|
-
import { DnsRecordType } from './DnsRecordType.ts'
|
|
4
|
-
import type { GoogleDnsResult } from './GoogleDnsResult.ts'
|
|
5
|
-
|
|
6
|
-
const googleDnsOverHttps = async (name: string, type: DnsRecordType = DnsRecordType.A) => {
|
|
7
|
-
return (await axiosJson.get<GoogleDnsResult>(`https://dns.google/resolve?name=${name}&type=${type}`)).data
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export { googleDnsOverHttps }
|
package/src/index.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export * from './DnsRecordType.ts'
|
|
2
|
-
export * from './DnsReturnCode.ts'
|
|
3
|
-
export * from './domainExists.ts'
|
|
4
|
-
export * from './domainResolve.ts'
|
|
5
|
-
export * from './googleDnsOverHttps.ts'
|
|
6
|
-
export * from './GoogleDnsResult.ts'
|
|
7
|
-
export * from './GoogleDnsResultAnswer.ts'
|
|
8
|
-
export * from './GoogleDnsResultQuestion.ts'
|