@aoxborrow/registrar-client 0.2.0 → 0.3.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 +1 -0
- package/dist/index.cjs +18 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +18 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/src/client.ts +4 -2
- package/src/registrar.ts +6 -0
- package/src/registrars/dynadot.ts +4 -0
- package/src/registrars/godaddy.ts +4 -0
- package/src/registrars/namesilo.ts +4 -0
- package/src/registrars/spaceship.ts +4 -0
- package/src/types.ts +7 -0
package/README.md
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
5
|
[](https://nodejs.org)
|
|
6
6
|
[](https://www.typescriptlang.org)
|
|
7
|
+
[](https://github.com/sponsors/aoxborrow)
|
|
7
8
|
|
|
8
9
|
> One consistent, fully-typed TypeScript interface to many domain registrar APIs.
|
|
9
10
|
|
package/dist/index.cjs
CHANGED
|
@@ -258,7 +258,7 @@ var RegistrarClient = class {
|
|
|
258
258
|
try {
|
|
259
259
|
const detail = await this.provider.getDomain(name, opts);
|
|
260
260
|
let merged = { ...domains[index], ...detail };
|
|
261
|
-
if (merged.nameservers.length === 0) {
|
|
261
|
+
if (merged.nameservers.length === 0 && this.provider.requiresNameserversFetch) {
|
|
262
262
|
try {
|
|
263
263
|
const nameservers = normalizeNameservers(
|
|
264
264
|
await this.provider.getNameservers(name, opts)
|
|
@@ -646,6 +646,11 @@ var BaseRegistrar = class {
|
|
|
646
646
|
supports(feature) {
|
|
647
647
|
return this.features.includes(feature);
|
|
648
648
|
}
|
|
649
|
+
// See Registrar.requiresNameserversFetch. Defaults true, so a provider
|
|
650
|
+
// whose getNameservers hits a real endpoint keeps the enrichment fallback
|
|
651
|
+
// without opting in; the providers whose getNameservers just re-reads getDomain
|
|
652
|
+
// override this to false to drop the redundant call.
|
|
653
|
+
requiresNameserversFetch = true;
|
|
649
654
|
constructor(credentials, httpConfig, options) {
|
|
650
655
|
const { environment = "production", ...clientOptions } = options ?? {};
|
|
651
656
|
this.credentials = credentials;
|
|
@@ -1716,6 +1721,9 @@ ${bodyStr}`;
|
|
|
1716
1721
|
if (!data.domain_info) throw new NotFoundError(`Dynadot: domain '${domainName}' not found`);
|
|
1717
1722
|
return data.domain_info;
|
|
1718
1723
|
}
|
|
1724
|
+
// getNameservers re-reads getDomain (domain_info carries NS inline; no separate
|
|
1725
|
+
// endpoint), so listing enrichment gains nothing from the fallback — skip it.
|
|
1726
|
+
requiresNameserversFetch = false;
|
|
1719
1727
|
async getNameservers(domainName, opts) {
|
|
1720
1728
|
const domain = await this.getDomain(domainName, opts);
|
|
1721
1729
|
return domain.nameservers;
|
|
@@ -3159,6 +3167,9 @@ var GoDaddyRegistrar = class _GoDaddyRegistrar extends BaseRegistrar {
|
|
|
3159
3167
|
});
|
|
3160
3168
|
return this.toDomain(d);
|
|
3161
3169
|
}
|
|
3170
|
+
// getNameservers re-reads getDomain (GoDaddy has no dedicated NS endpoint), so
|
|
3171
|
+
// listing enrichment gains nothing from the fallback — skip it.
|
|
3172
|
+
requiresNameserversFetch = false;
|
|
3162
3173
|
async getNameservers(domainName, opts) {
|
|
3163
3174
|
const domain = await this.getDomain(domainName, opts);
|
|
3164
3175
|
return domain.nameservers;
|
|
@@ -5060,6 +5071,9 @@ var NameSiloRegistrar = class extends BaseRegistrar {
|
|
|
5060
5071
|
nameservers: extractNsHosts(r.nameservers)
|
|
5061
5072
|
});
|
|
5062
5073
|
}
|
|
5074
|
+
// getNameservers re-reads getDomain (getDomainInfo carries NS; no separate
|
|
5075
|
+
// endpoint), so listing enrichment gains nothing from the fallback — skip it.
|
|
5076
|
+
requiresNameserversFetch = false;
|
|
5063
5077
|
async getNameservers(domainName, opts) {
|
|
5064
5078
|
const domain = await this.getDomain(domainName, opts);
|
|
5065
5079
|
return domain.nameservers;
|
|
@@ -6301,6 +6315,9 @@ var SpaceshipRegistrar = class extends BaseRegistrar {
|
|
|
6301
6315
|
async getDomain(domainName, opts) {
|
|
6302
6316
|
return this.toDomain(await this.getRaw(domainName, opts));
|
|
6303
6317
|
}
|
|
6318
|
+
// getNameservers reads the same getRaw payload as getDomain (no dedicated NS
|
|
6319
|
+
// endpoint), so listing enrichment gains nothing from the fallback — skip it.
|
|
6320
|
+
requiresNameserversFetch = false;
|
|
6304
6321
|
async getNameservers(domainName, opts) {
|
|
6305
6322
|
const d = await this.getRaw(domainName, opts);
|
|
6306
6323
|
return d.nameservers?.hosts ?? [];
|