@xyo-network/dns 5.3.30 → 5.4.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/README.md CHANGED
@@ -38,475 +38,6 @@ bun add {{name}}
38
38
 
39
39
  See the [LICENSE](LICENSE) file for license rights and limitations (LGPL-3.0-only).
40
40
 
41
- ## Reference
42
-
43
- ### packages
44
-
45
- ### sdk-utils
46
-
47
- ### packages
48
-
49
- ### dns
50
-
51
- ### .temp-typedoc
52
-
53
- ### functions
54
-
55
- ### <a id="domainExists"></a>domainExists
56
-
57
- [**@xyo-network/dns**](#../README)
58
-
59
- ***
60
-
61
- ```ts
62
- function domainExists(domain?): Promise<boolean>;
63
- ```
64
-
65
- Checks if a domain exists (resolves using DNS)
66
-
67
- ## Parameters
68
-
69
- ### domain?
70
-
71
- `string`
72
-
73
- string
74
-
75
- ## Returns
76
-
77
- `Promise`\<`boolean`\>
78
-
79
- boolean
80
-
81
- ### <a id="domainResolve"></a>domainResolve
82
-
83
- [**@xyo-network/dns**](#../README)
84
-
85
- ***
86
-
87
- ```ts
88
- function domainResolve(domain?, type?): Promise<GoogleDnsResult | undefined>;
89
- ```
90
-
91
- Resolves DNS information (resolves using DNS)
92
-
93
- ## Parameters
94
-
95
- ### domain?
96
-
97
- `string`
98
-
99
- string
100
-
101
- ### type?
102
-
103
- [`DnsRecordType`](#../type-aliases/DnsRecordType) = `DnsRecordType.A`
104
-
105
- ## Returns
106
-
107
- `Promise`\<[`GoogleDnsResult`](#../interfaces/GoogleDnsResult) \| `undefined`\>
108
-
109
- GoogleDnsResult
110
-
111
- ### <a id="googleDnsOverHttps"></a>googleDnsOverHttps
112
-
113
- [**@xyo-network/dns**](#../README)
114
-
115
- ***
116
-
117
- ```ts
118
- function googleDnsOverHttps(name, type?): Promise<GoogleDnsResult>;
119
- ```
120
-
121
- ## Parameters
122
-
123
- ### name
124
-
125
- `string`
126
-
127
- ### type?
128
-
129
- [`DnsRecordType`](#../type-aliases/DnsRecordType) = `DnsRecordType.A`
130
-
131
- ## Returns
132
-
133
- `Promise`\<[`GoogleDnsResult`](#../interfaces/GoogleDnsResult)\>
134
-
135
- ### interfaces
136
-
137
- ### <a id="GoogleDnsResult"></a>GoogleDnsResult
138
-
139
- [**@xyo-network/dns**](#../README)
140
-
141
- ***
142
-
143
- ## Properties
144
-
145
- ### AD?
146
-
147
- ```ts
148
- optional AD?: boolean;
149
- ```
150
-
151
- ***
152
-
153
- ### Answer?
154
-
155
- ```ts
156
- optional Answer?: GoogleDnsResultAnswer[];
157
- ```
158
-
159
- ***
160
-
161
- ### Authority?
162
-
163
- ```ts
164
- optional Authority?: GoogleDnsResultAnswer[];
165
- ```
166
-
167
- ***
168
-
169
- ### CD?
170
-
171
- ```ts
172
- optional CD?: boolean;
173
- ```
174
-
175
- ***
176
-
177
- ### Comment?
178
-
179
- ```ts
180
- optional Comment?: string;
181
- ```
182
-
183
- ***
184
-
185
- ### Question?
186
-
187
- ```ts
188
- optional Question?: GoogleDnsResultQuestion[];
189
- ```
190
-
191
- ***
192
-
193
- ### RA?
194
-
195
- ```ts
196
- optional RA?: boolean;
197
- ```
198
-
199
- ***
200
-
201
- ### RD?
202
-
203
- ```ts
204
- optional RD?: boolean;
205
- ```
206
-
207
- ***
208
-
209
- ### Status?
210
-
211
- ```ts
212
- optional Status?: number;
213
- ```
214
-
215
- ***
216
-
217
- ### TC?
218
-
219
- ```ts
220
- optional TC?: boolean;
221
- ```
222
-
223
- ***
224
-
225
- ### edns\_client\_subnet?
226
-
227
- ```ts
228
- optional edns_client_subnet?: string;
229
- ```
230
-
231
- ### <a id="GoogleDnsResultAnswer"></a>GoogleDnsResultAnswer
232
-
233
- [**@xyo-network/dns**](#../README)
234
-
235
- ***
236
-
237
- ## Properties
238
-
239
- ### TTL?
240
-
241
- ```ts
242
- optional TTL?: number;
243
- ```
244
-
245
- ***
246
-
247
- ### data?
248
-
249
- ```ts
250
- optional data?: string;
251
- ```
252
-
253
- ***
254
-
255
- ### name?
256
-
257
- ```ts
258
- optional name?: string;
259
- ```
260
-
261
- ***
262
-
263
- ### type?
264
-
265
- ```ts
266
- optional type?: DnsRecordType;
267
- ```
268
-
269
- ### <a id="GoogleDnsResultQuestion"></a>GoogleDnsResultQuestion
270
-
271
- [**@xyo-network/dns**](#../README)
272
-
273
- ***
274
-
275
- ## Properties
276
-
277
- ### cd?
278
-
279
- ```ts
280
- optional cd?: boolean;
281
- ```
282
-
283
- ***
284
-
285
- ### ct?
286
-
287
- ```ts
288
- optional ct?: string;
289
- ```
290
-
291
- ***
292
-
293
- ### do?
294
-
295
- ```ts
296
- optional do?: boolean;
297
- ```
298
-
299
- ***
300
-
301
- ### edns\_client\_subnet?
302
-
303
- ```ts
304
- optional edns_client_subnet?: string;
305
- ```
306
-
307
- ***
308
-
309
- ### name?
310
-
311
- ```ts
312
- optional name?: string;
313
- ```
314
-
315
- ***
316
-
317
- ### random\_padding?
318
-
319
- ```ts
320
- optional random_padding?: string;
321
- ```
322
-
323
- ***
324
-
325
- ### type?
326
-
327
- ```ts
328
- optional type?: DnsRecordType;
329
- ```
330
-
331
- ### type-aliases
332
-
333
- ### <a id="DnsRecordType"></a>DnsRecordType
334
-
335
- [**@xyo-network/dns**](#../README)
336
-
337
- ***
338
-
339
- ```ts
340
- type DnsRecordType = typeof DnsRecordType[keyof typeof DnsRecordType];
341
- ```
342
-
343
- ### <a id="DnsReturnCode"></a>DnsReturnCode
344
-
345
- [**@xyo-network/dns**](#../README)
346
-
347
- ***
348
-
349
- ```ts
350
- type DnsReturnCode = typeof DnsReturnCode[keyof typeof DnsReturnCode];
351
- ```
352
-
353
- ### variables
354
-
355
- ### <a id="DnsRecordType"></a>DnsRecordType
356
-
357
- [**@xyo-network/dns**](#../README)
358
-
359
- ***
360
-
361
- ```ts
362
- const DnsRecordType: object;
363
- ```
364
-
365
- ## Type Declaration
366
-
367
- ### A
368
-
369
- ```ts
370
- readonly A: 1 = 1;
371
- ```
372
-
373
- ### AAAA
374
-
375
- ```ts
376
- readonly AAAA: 28 = 28;
377
- ```
378
-
379
- ### CAA
380
-
381
- ```ts
382
- readonly CAA: 257 = 257;
383
- ```
384
-
385
- ### CNAME
386
-
387
- ```ts
388
- readonly CNAME: 5 = 5;
389
- ```
390
-
391
- ### DNAME
392
-
393
- ```ts
394
- readonly DNAME: 39 = 39;
395
- ```
396
-
397
- ### MX
398
-
399
- ```ts
400
- readonly MX: 15 = 15;
401
- ```
402
-
403
- ### NS
404
-
405
- ```ts
406
- readonly NS: 2 = 2;
407
- ```
408
-
409
- ### PTR
410
-
411
- ```ts
412
- readonly PTR: 12 = 12;
413
- ```
414
-
415
- ### SOA
416
-
417
- ```ts
418
- readonly SOA: 6 = 6;
419
- ```
420
-
421
- ### SPF
422
-
423
- ```ts
424
- readonly SPF: 99 = 99;
425
- ```
426
-
427
- ### SRV
428
-
429
- ```ts
430
- readonly SRV: 33 = 33;
431
- ```
432
-
433
- ### TXT
434
-
435
- ```ts
436
- readonly TXT: 16 = 16;
437
- ```
438
-
439
- ### <a id="DnsReturnCode"></a>DnsReturnCode
440
-
441
- [**@xyo-network/dns**](#../README)
442
-
443
- ***
444
-
445
- ```ts
446
- const DnsReturnCode: object;
447
- ```
448
-
449
- ## Type Declaration
450
-
451
- ### NoError
452
-
453
- ```ts
454
- NoError: number = 0;
455
- ```
456
-
457
- ### QueryFormatError
458
-
459
- ```ts
460
- QueryFormatError: number = 1;
461
- ```
462
-
463
- ### ServerFailed
464
-
465
- ```ts
466
- ServerFailed: number = 2;
467
- ```
468
-
469
- ### DomainDoesNotExist
470
-
471
- ```ts
472
- DomainDoesNotExist: number = 3;
473
- ```
474
-
475
- ### NotImplemented
476
-
477
- ```ts
478
- NotImplemented: number = 4;
479
- ```
480
-
481
- ### Refused
482
-
483
- ```ts
484
- Refused: number = 5;
485
- ```
486
-
487
- ### NameShouldNotExist
488
-
489
- ```ts
490
- NameShouldNotExist: number = 6;
491
- ```
492
-
493
- ### RRSetShouldNotExist
494
-
495
- ```ts
496
- RRSetShouldNotExist: number = 7;
497
- ```
498
-
499
- ### NotAuthoritative
500
-
501
- ```ts
502
- NotAuthoritative: number = 8;
503
- ```
504
-
505
- ### NotInZone
506
-
507
- ```ts
508
- NotInZone: number = 9;
509
- ```
510
41
 
511
42
 
512
43
  [logo]: https://cdn.xy.company/img/brand/XYO_full_colored.png
@@ -1,5 +1,5 @@
1
1
  import { DnsRecordType } from './DnsRecordType.ts';
2
2
  import type { GoogleDnsResult } from './GoogleDnsResult.ts';
3
- declare const googleDnsOverHttps: (name: string, type?: DnsRecordType) => Promise<GoogleDnsResult>;
3
+ declare const googleDnsOverHttps: (name: string, type?: DnsRecordType) => Promise<GoogleDnsResult | undefined>;
4
4
  export { googleDnsOverHttps };
5
5
  //# sourceMappingURL=googleDnsOverHttps.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"googleDnsOverHttps.d.ts","sourceRoot":"","sources":["../../src/googleDnsOverHttps.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAE3D,QAAA,MAAM,kBAAkB,GAAU,MAAM,MAAM,EAAE,OAAM,aAA+B,6BAEpF,CAAA;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAA"}
1
+ {"version":3,"file":"googleDnsOverHttps.d.ts","sourceRoot":"","sources":["../../src/googleDnsOverHttps.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAE3D,QAAA,MAAM,kBAAkB,GAAU,MAAM,MAAM,EAAE,OAAM,aAA+B,KAAG,OAAO,CAAC,eAAe,GAAG,SAAS,CAE1H,CAAA;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAA"}
@@ -32,9 +32,9 @@ var DnsReturnCode = {
32
32
  import { isDefined } from "@xylabs/sdk-js";
33
33
 
34
34
  // src/googleDnsOverHttps.ts
35
- import { axiosJson } from "@xylabs/sdk-js";
35
+ import { fetchJson } from "@xylabs/sdk-js";
36
36
  var googleDnsOverHttps = async (name, type = DnsRecordType.A) => {
37
- return (await axiosJson.get(`https://dns.google/resolve?name=${name}&type=${type}`)).data;
37
+ return (await fetchJson(`https://dns.google/resolve?name=${name}&type=${type}`)).data ?? void 0;
38
38
  };
39
39
 
40
40
  // src/domainResolve.ts
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/DnsRecordType.ts","../../src/DnsReturnCode.ts","../../src/domainResolve.ts","../../src/googleDnsOverHttps.ts","../../src/domainExists.ts"],"sourcesContent":["export const 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} as const\n\nexport type DnsRecordType = typeof DnsRecordType[keyof typeof DnsRecordType]\n","export const 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 NotAuthoritative: 8,\n NotInZone: 9,\n}\n\nexport type DnsReturnCode = typeof DnsReturnCode[keyof typeof DnsReturnCode]\n","import { isDefined } from '@xylabs/sdk-js'\n\nimport { DnsRecordType } from './DnsRecordType.ts'\nimport { googleDnsOverHttps } from './googleDnsOverHttps.ts'\n\n/**\n * Resolves DNS information (resolves using DNS)\n * @param domain - string\n * @returns GoogleDnsResult\n */\nconst domainResolve = async (domain?: string, type: DnsRecordType = DnsRecordType.A) => {\n if (isDefined(domain)) {\n return await googleDnsOverHttps(domain, type)\n }\n}\n\nexport { domainResolve }\n","import { axiosJson } from '@xylabs/sdk-js'\n\nimport { DnsRecordType } from './DnsRecordType.ts'\nimport type { GoogleDnsResult } from './GoogleDnsResult.ts'\n\nconst googleDnsOverHttps = async (name: string, type: DnsRecordType = DnsRecordType.A) => {\n return (await axiosJson.get<GoogleDnsResult>(`https://dns.google/resolve?name=${name}&type=${type}`)).data\n}\n\nexport { googleDnsOverHttps }\n","import { DnsReturnCode } from './DnsReturnCode.ts'\nimport { domainResolve } from './domainResolve.ts'\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":";AAAO,IAAM,gBAAgB;AAAA,EAC3B,GAAG;AAAA,EACH,MAAM;AAAA,EACN,KAAK;AAAA,EACL,OAAO;AAAA,EACP,OAAO;AAAA,EACP,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AACP;;;ACbO,IAAM,gBAAgB;AAAA,EAC3B,SAAS;AAAA,EACT,kBAAkB;AAAA,EAClB,cAAc;AAAA,EACd,oBAAoB;AAAA,EACpB,gBAAgB;AAAA,EAChB,SAAS;AAAA,EACT,oBAAoB;AAAA,EACpB,qBAAqB;AAAA,EACrB,kBAAkB;AAAA,EAClB,WAAW;AACb;;;ACXA,SAAS,iBAAiB;;;ACA1B,SAAS,iBAAiB;AAK1B,IAAM,qBAAqB,OAAO,MAAc,OAAsB,cAAc,MAAM;AACxF,UAAQ,MAAM,UAAU,IAAqB,mCAAmC,IAAI,SAAS,IAAI,EAAE,GAAG;AACxG;;;ADGA,IAAM,gBAAgB,OAAO,QAAiB,OAAsB,cAAc,MAAM;AACtF,MAAI,UAAU,MAAM,GAAG;AACrB,WAAO,MAAM,mBAAmB,QAAQ,IAAI;AAAA,EAC9C;AACF;;;AENA,IAAM,eAAe,OAAO,WAAoB;AAC9C,MAAI,WAAW,OAAW,QAAO;AACjC,QAAM,YAAY,MAAM,cAAc,MAAM;AAC5C,SAAO,WAAW,WAAW,cAAc;AAC7C;","names":[]}
1
+ {"version":3,"sources":["../../src/DnsRecordType.ts","../../src/DnsReturnCode.ts","../../src/domainResolve.ts","../../src/googleDnsOverHttps.ts","../../src/domainExists.ts"],"sourcesContent":["export const 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} as const\n\nexport type DnsRecordType = typeof DnsRecordType[keyof typeof DnsRecordType]\n","export const 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 NotAuthoritative: 8,\n NotInZone: 9,\n}\n\nexport type DnsReturnCode = typeof DnsReturnCode[keyof typeof DnsReturnCode]\n","import { isDefined } from '@xylabs/sdk-js'\n\nimport { DnsRecordType } from './DnsRecordType.ts'\nimport { googleDnsOverHttps } from './googleDnsOverHttps.ts'\n\n/**\n * Resolves DNS information (resolves using DNS)\n * @param domain - string\n * @returns GoogleDnsResult\n */\nconst domainResolve = async (domain?: string, type: DnsRecordType = DnsRecordType.A) => {\n if (isDefined(domain)) {\n return await googleDnsOverHttps(domain, type)\n }\n}\n\nexport { domainResolve }\n","import { fetchJson } from '@xylabs/sdk-js'\n\nimport { DnsRecordType } from './DnsRecordType.ts'\nimport type { GoogleDnsResult } from './GoogleDnsResult.ts'\n\nconst googleDnsOverHttps = async (name: string, type: DnsRecordType = DnsRecordType.A): Promise<GoogleDnsResult | undefined> => {\n return (await fetchJson<GoogleDnsResult>(`https://dns.google/resolve?name=${name}&type=${type}`)).data ?? undefined\n}\n\nexport { googleDnsOverHttps }\n","import { DnsReturnCode } from './DnsReturnCode.ts'\nimport { domainResolve } from './domainResolve.ts'\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":";AAAO,IAAM,gBAAgB;AAAA,EAC3B,GAAG;AAAA,EACH,MAAM;AAAA,EACN,KAAK;AAAA,EACL,OAAO;AAAA,EACP,OAAO;AAAA,EACP,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AACP;;;ACbO,IAAM,gBAAgB;AAAA,EAC3B,SAAS;AAAA,EACT,kBAAkB;AAAA,EAClB,cAAc;AAAA,EACd,oBAAoB;AAAA,EACpB,gBAAgB;AAAA,EAChB,SAAS;AAAA,EACT,oBAAoB;AAAA,EACpB,qBAAqB;AAAA,EACrB,kBAAkB;AAAA,EAClB,WAAW;AACb;;;ACXA,SAAS,iBAAiB;;;ACA1B,SAAS,iBAAiB;AAK1B,IAAM,qBAAqB,OAAO,MAAc,OAAsB,cAAc,MAA4C;AAC9H,UAAQ,MAAM,UAA2B,mCAAmC,IAAI,SAAS,IAAI,EAAE,GAAG,QAAQ;AAC5G;;;ADGA,IAAM,gBAAgB,OAAO,QAAiB,OAAsB,cAAc,MAAM;AACtF,MAAI,UAAU,MAAM,GAAG;AACrB,WAAO,MAAM,mBAAmB,QAAQ,IAAI;AAAA,EAC9C;AACF;;;AENA,IAAM,eAAe,OAAO,WAAoB;AAC9C,MAAI,WAAW,OAAW,QAAO;AACjC,QAAM,YAAY,MAAM,cAAc,MAAM;AAC5C,SAAO,WAAW,WAAW,cAAc;AAC7C;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/dns",
3
- "version": "5.3.30",
3
+ "version": "5.4.0",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -22,12 +22,10 @@
22
22
  "exports": {
23
23
  ".": {
24
24
  "types": "./dist/neutral/index.d.ts",
25
- "import": "./dist/neutral/index.mjs",
26
25
  "default": "./dist/neutral/index.mjs"
27
26
  },
28
27
  "./package.json": "./package.json"
29
28
  },
30
- "types": "dist/neutral/index.d.ts",
31
29
  "files": [
32
30
  "dist",
33
31
  "!**/*.bench.*",
@@ -37,17 +35,15 @@
37
35
  ],
38
36
  "devDependencies": {
39
37
  "@opentelemetry/api": "^1.9.1",
40
- "@xylabs/sdk-js": "~5.0.95",
41
- "@xylabs/ts-scripts-common": "~7.8.7",
42
- "@xylabs/ts-scripts-pnpm": "~7.8.7",
43
- "@xylabs/tsconfig": "~7.8.7",
44
- "axios": "^1.14.0",
38
+ "@xylabs/sdk-js": "~5.0.97",
39
+ "@xylabs/toolchain": "~7.10.8",
40
+ "@xylabs/tsconfig": "~7.10.8",
45
41
  "pako": "~2.1.0",
46
42
  "typescript": "~5.9.3",
47
43
  "zod": "^4.3.6"
48
44
  },
49
45
  "peerDependencies": {
50
- "@xylabs/sdk-js": "^5"
46
+ "@xylabs/sdk-js": "^5.0.97"
51
47
  },
52
48
  "publishConfig": {
53
49
  "access": "public"