@aoxborrow/registrar-client 0.2.0 → 0.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 +1 -0
- package/dist/index.cjs +35 -6
- 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 +35 -6
- 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 +25 -13
- 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;
|
|
@@ -3036,12 +3044,24 @@ var GoDaddyRegistrar = class _GoDaddyRegistrar extends BaseRegistrar {
|
|
|
3036
3044
|
name = "godaddy";
|
|
3037
3045
|
static displayName = "GoDaddy";
|
|
3038
3046
|
static website = "godaddy.com";
|
|
3039
|
-
static helpText =
|
|
3047
|
+
static helpText = "Create a Personal Access Token (PAT) at https://developer.godaddy.com and paste it here. The PAT is GoDaddy's modern credential: it unlocks the v3 API (discovery, registration, DNS, nameservers) and also authenticates the legacy v1 API for management operations (renew, transfer, auto-renew, lock, privacy, contacts) \u2014 one token covers everything.";
|
|
3048
|
+
// Only the PAT is exposed for configuration — it is the sole credential
|
|
3049
|
+
// GoDaddy recommends going forward, and it covers every production operation.
|
|
3050
|
+
//
|
|
3051
|
+
// The legacy `apiKey` + `apiSecret` (sso-key) pair and the `customerId` field
|
|
3052
|
+
// are intentionally NOT advertised here. The code that consumes them is kept
|
|
3053
|
+
// (see `authHeader`, `useV3`, `resolveCustomerId`, and the forwarding methods)
|
|
3054
|
+
// so OTE/sandbox testing and direct programmatic use still work when those
|
|
3055
|
+
// values are passed in credentials explicitly. But because they are no longer
|
|
3056
|
+
// configurable, two capabilities are effectively unreachable through normal
|
|
3057
|
+
// (config-driven) setup:
|
|
3058
|
+
// - OTE/sandbox, which needs an sso-key (`apiKey` + `apiSecret`), and
|
|
3059
|
+
// - domain forwarding, which needs `customerId` (a customer UUID), plus an
|
|
3060
|
+
// sso-key to resolve a numeric shopper ID to that UUID.
|
|
3061
|
+
// GoDaddy is deprecating the sso-key scheme in 2026, so this is the direction
|
|
3062
|
+
// of travel regardless.
|
|
3040
3063
|
static configFields = [
|
|
3041
|
-
{ name: "apiToken", label: "API Token (PAT)", type: "password", required:
|
|
3042
|
-
{ name: "apiKey", label: "API Key", type: "password", required: false },
|
|
3043
|
-
{ name: "apiSecret", label: "API Secret", type: "password", required: false },
|
|
3044
|
-
{ name: "customerId", label: "Customer ID or Shopper ID", type: "text", required: false }
|
|
3064
|
+
{ name: "apiToken", label: "API Token (PAT)", type: "password", required: true }
|
|
3045
3065
|
];
|
|
3046
3066
|
// GoDaddy's OTE ("Operational Test Environment") is its sandbox
|
|
3047
3067
|
static supportsSandbox = true;
|
|
@@ -3159,6 +3179,9 @@ var GoDaddyRegistrar = class _GoDaddyRegistrar extends BaseRegistrar {
|
|
|
3159
3179
|
});
|
|
3160
3180
|
return this.toDomain(d);
|
|
3161
3181
|
}
|
|
3182
|
+
// getNameservers re-reads getDomain (GoDaddy has no dedicated NS endpoint), so
|
|
3183
|
+
// listing enrichment gains nothing from the fallback — skip it.
|
|
3184
|
+
requiresNameserversFetch = false;
|
|
3162
3185
|
async getNameservers(domainName, opts) {
|
|
3163
3186
|
const domain = await this.getDomain(domainName, opts);
|
|
3164
3187
|
return domain.nameservers;
|
|
@@ -5060,6 +5083,9 @@ var NameSiloRegistrar = class extends BaseRegistrar {
|
|
|
5060
5083
|
nameservers: extractNsHosts(r.nameservers)
|
|
5061
5084
|
});
|
|
5062
5085
|
}
|
|
5086
|
+
// getNameservers re-reads getDomain (getDomainInfo carries NS; no separate
|
|
5087
|
+
// endpoint), so listing enrichment gains nothing from the fallback — skip it.
|
|
5088
|
+
requiresNameserversFetch = false;
|
|
5063
5089
|
async getNameservers(domainName, opts) {
|
|
5064
5090
|
const domain = await this.getDomain(domainName, opts);
|
|
5065
5091
|
return domain.nameservers;
|
|
@@ -6301,6 +6327,9 @@ var SpaceshipRegistrar = class extends BaseRegistrar {
|
|
|
6301
6327
|
async getDomain(domainName, opts) {
|
|
6302
6328
|
return this.toDomain(await this.getRaw(domainName, opts));
|
|
6303
6329
|
}
|
|
6330
|
+
// getNameservers reads the same getRaw payload as getDomain (no dedicated NS
|
|
6331
|
+
// endpoint), so listing enrichment gains nothing from the fallback — skip it.
|
|
6332
|
+
requiresNameserversFetch = false;
|
|
6304
6333
|
async getNameservers(domainName, opts) {
|
|
6305
6334
|
const d = await this.getRaw(domainName, opts);
|
|
6306
6335
|
return d.nameservers?.hosts ?? [];
|