@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/dist/index.d.cts CHANGED
@@ -181,6 +181,7 @@ interface Registrar {
181
181
  readonly name: string;
182
182
  readonly environment: RegistrarEnvironment;
183
183
  readonly features: readonly RegistrarFeature[];
184
+ readonly requiresNameserversFetch: boolean;
184
185
  supports(feature: RegistrarFeature): boolean;
185
186
  testConnection(opts?: RequestOptions): Promise<ConnectionResult>;
186
187
  listDomains(opts?: ListDomainsOptions): Promise<Domain[]>;
@@ -361,6 +362,7 @@ declare abstract class BaseRegistrar implements Registrar {
361
362
  static get features(): readonly RegistrarFeature[];
362
363
  get features(): readonly RegistrarFeature[];
363
364
  supports(feature: RegistrarFeature): boolean;
365
+ readonly requiresNameserversFetch: boolean;
364
366
  constructor(credentials: RegistrarCredentials, httpConfig: Omit<HttpClientConfig, 'options'>, options?: RegistrarOptions);
365
367
  testConnection(_opts?: RequestOptions): Promise<ConnectionResult>;
366
368
  listDomains(_opts?: ListDomainsOptions): Promise<Domain[]>;
@@ -450,6 +452,7 @@ declare class DynadotRegistrar extends BaseRegistrar {
450
452
  listDomains(opts?: ListDomainsOptions): Promise<Domain[]>;
451
453
  getDomain(domainName: string, opts?: RequestOptions): Promise<Domain>;
452
454
  private domainInfo;
455
+ readonly requiresNameserversFetch = false;
453
456
  getNameservers(domainName: string, opts?: RequestOptions): Promise<string[]>;
454
457
  getContacts(domainName: string, opts?: RequestOptions): Promise<ContactSet>;
455
458
  getDnsRecords(domainName: string, opts?: RequestOptions): Promise<DnsRecord[]>;
@@ -532,6 +535,7 @@ declare class GoDaddyRegistrar extends BaseRegistrar {
532
535
  private listDomainsV3;
533
536
  private listDomainsV1;
534
537
  getDomain(domainName: string, opts?: RequestOptions): Promise<Domain>;
538
+ readonly requiresNameserversFetch = false;
535
539
  getNameservers(domainName: string, opts?: RequestOptions): Promise<string[]>;
536
540
  checkAvailability(domainNames: string[], opts?: RequestOptions): Promise<DomainAvailability[]>;
537
541
  getPricing(tldOrDomain: string, opts?: RequestOptions): Promise<TldPricing>;
@@ -647,6 +651,7 @@ declare class NameSiloRegistrar extends BaseRegistrar {
647
651
  testConnection(opts?: RequestOptions): Promise<ConnectionResult>;
648
652
  listDomains(opts?: ListDomainsOptions): Promise<Domain[]>;
649
653
  getDomain(domainName: string, opts?: RequestOptions): Promise<Domain>;
654
+ readonly requiresNameserversFetch = false;
650
655
  getNameservers(domainName: string, opts?: RequestOptions): Promise<string[]>;
651
656
  getContacts(domainName: string, opts?: RequestOptions): Promise<ContactSet>;
652
657
  getDnsRecords(domainName: string, opts?: RequestOptions): Promise<DnsRecord[]>;
@@ -716,6 +721,7 @@ declare class SpaceshipRegistrar extends BaseRegistrar {
716
721
  testConnection(opts?: RequestOptions): Promise<ConnectionResult>;
717
722
  listDomains(opts?: ListDomainsOptions): Promise<Domain[]>;
718
723
  getDomain(domainName: string, opts?: RequestOptions): Promise<Domain>;
724
+ readonly requiresNameserversFetch = false;
719
725
  getNameservers(domainName: string, opts?: RequestOptions): Promise<string[]>;
720
726
  getAuthCode(domainName: string, opts?: RequestOptions): Promise<string>;
721
727
  checkAvailability(domainNames: string[], opts?: RequestOptions): Promise<DomainAvailability[]>;
package/dist/index.d.ts CHANGED
@@ -181,6 +181,7 @@ interface Registrar {
181
181
  readonly name: string;
182
182
  readonly environment: RegistrarEnvironment;
183
183
  readonly features: readonly RegistrarFeature[];
184
+ readonly requiresNameserversFetch: boolean;
184
185
  supports(feature: RegistrarFeature): boolean;
185
186
  testConnection(opts?: RequestOptions): Promise<ConnectionResult>;
186
187
  listDomains(opts?: ListDomainsOptions): Promise<Domain[]>;
@@ -361,6 +362,7 @@ declare abstract class BaseRegistrar implements Registrar {
361
362
  static get features(): readonly RegistrarFeature[];
362
363
  get features(): readonly RegistrarFeature[];
363
364
  supports(feature: RegistrarFeature): boolean;
365
+ readonly requiresNameserversFetch: boolean;
364
366
  constructor(credentials: RegistrarCredentials, httpConfig: Omit<HttpClientConfig, 'options'>, options?: RegistrarOptions);
365
367
  testConnection(_opts?: RequestOptions): Promise<ConnectionResult>;
366
368
  listDomains(_opts?: ListDomainsOptions): Promise<Domain[]>;
@@ -450,6 +452,7 @@ declare class DynadotRegistrar extends BaseRegistrar {
450
452
  listDomains(opts?: ListDomainsOptions): Promise<Domain[]>;
451
453
  getDomain(domainName: string, opts?: RequestOptions): Promise<Domain>;
452
454
  private domainInfo;
455
+ readonly requiresNameserversFetch = false;
453
456
  getNameservers(domainName: string, opts?: RequestOptions): Promise<string[]>;
454
457
  getContacts(domainName: string, opts?: RequestOptions): Promise<ContactSet>;
455
458
  getDnsRecords(domainName: string, opts?: RequestOptions): Promise<DnsRecord[]>;
@@ -532,6 +535,7 @@ declare class GoDaddyRegistrar extends BaseRegistrar {
532
535
  private listDomainsV3;
533
536
  private listDomainsV1;
534
537
  getDomain(domainName: string, opts?: RequestOptions): Promise<Domain>;
538
+ readonly requiresNameserversFetch = false;
535
539
  getNameservers(domainName: string, opts?: RequestOptions): Promise<string[]>;
536
540
  checkAvailability(domainNames: string[], opts?: RequestOptions): Promise<DomainAvailability[]>;
537
541
  getPricing(tldOrDomain: string, opts?: RequestOptions): Promise<TldPricing>;
@@ -647,6 +651,7 @@ declare class NameSiloRegistrar extends BaseRegistrar {
647
651
  testConnection(opts?: RequestOptions): Promise<ConnectionResult>;
648
652
  listDomains(opts?: ListDomainsOptions): Promise<Domain[]>;
649
653
  getDomain(domainName: string, opts?: RequestOptions): Promise<Domain>;
654
+ readonly requiresNameserversFetch = false;
650
655
  getNameservers(domainName: string, opts?: RequestOptions): Promise<string[]>;
651
656
  getContacts(domainName: string, opts?: RequestOptions): Promise<ContactSet>;
652
657
  getDnsRecords(domainName: string, opts?: RequestOptions): Promise<DnsRecord[]>;
@@ -716,6 +721,7 @@ declare class SpaceshipRegistrar extends BaseRegistrar {
716
721
  testConnection(opts?: RequestOptions): Promise<ConnectionResult>;
717
722
  listDomains(opts?: ListDomainsOptions): Promise<Domain[]>;
718
723
  getDomain(domainName: string, opts?: RequestOptions): Promise<Domain>;
724
+ readonly requiresNameserversFetch = false;
719
725
  getNameservers(domainName: string, opts?: RequestOptions): Promise<string[]>;
720
726
  getAuthCode(domainName: string, opts?: RequestOptions): Promise<string>;
721
727
  checkAvailability(domainNames: string[], opts?: RequestOptions): Promise<DomainAvailability[]>;
package/dist/index.js CHANGED
@@ -256,7 +256,7 @@ var RegistrarClient = class {
256
256
  try {
257
257
  const detail = await this.provider.getDomain(name, opts);
258
258
  let merged = { ...domains[index], ...detail };
259
- if (merged.nameservers.length === 0) {
259
+ if (merged.nameservers.length === 0 && this.provider.requiresNameserversFetch) {
260
260
  try {
261
261
  const nameservers = normalizeNameservers(
262
262
  await this.provider.getNameservers(name, opts)
@@ -644,6 +644,11 @@ var BaseRegistrar = class {
644
644
  supports(feature) {
645
645
  return this.features.includes(feature);
646
646
  }
647
+ // See Registrar.requiresNameserversFetch. Defaults true, so a provider
648
+ // whose getNameservers hits a real endpoint keeps the enrichment fallback
649
+ // without opting in; the providers whose getNameservers just re-reads getDomain
650
+ // override this to false to drop the redundant call.
651
+ requiresNameserversFetch = true;
647
652
  constructor(credentials, httpConfig, options) {
648
653
  const { environment = "production", ...clientOptions } = options ?? {};
649
654
  this.credentials = credentials;
@@ -1714,6 +1719,9 @@ ${bodyStr}`;
1714
1719
  if (!data.domain_info) throw new NotFoundError(`Dynadot: domain '${domainName}' not found`);
1715
1720
  return data.domain_info;
1716
1721
  }
1722
+ // getNameservers re-reads getDomain (domain_info carries NS inline; no separate
1723
+ // endpoint), so listing enrichment gains nothing from the fallback — skip it.
1724
+ requiresNameserversFetch = false;
1717
1725
  async getNameservers(domainName, opts) {
1718
1726
  const domain = await this.getDomain(domainName, opts);
1719
1727
  return domain.nameservers;
@@ -3034,12 +3042,24 @@ var GoDaddyRegistrar = class _GoDaddyRegistrar extends BaseRegistrar {
3034
3042
  name = "godaddy";
3035
3043
  static displayName = "GoDaddy";
3036
3044
  static website = "godaddy.com";
3037
- static helpText = 'Authenticate one of two ways. For production, create a Personal Access Token (PAT) at https://developer.godaddy.com and pass it as `apiToken` \u2014 this enables the modern v3 API. For sandbox testing, create OTE (test environment) keys and pass `apiKey` + `apiSecret` with { environment: "sandbox" }; OTE only exposes the legacy v1 API. The sso-key (API Key/Secret) scheme is deprecated by GoDaddy in 2026. Domain forwarding uses the v2 customer-scoped API \u2014 set `customerId` to your GoDaddy customer UUID, or to your numeric shopper/account ID (which the client resolves to the UUID via an sso-key-authenticated lookup).';
3045
+ 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.";
3046
+ // Only the PAT is exposed for configuration — it is the sole credential
3047
+ // GoDaddy recommends going forward, and it covers every production operation.
3048
+ //
3049
+ // The legacy `apiKey` + `apiSecret` (sso-key) pair and the `customerId` field
3050
+ // are intentionally NOT advertised here. The code that consumes them is kept
3051
+ // (see `authHeader`, `useV3`, `resolveCustomerId`, and the forwarding methods)
3052
+ // so OTE/sandbox testing and direct programmatic use still work when those
3053
+ // values are passed in credentials explicitly. But because they are no longer
3054
+ // configurable, two capabilities are effectively unreachable through normal
3055
+ // (config-driven) setup:
3056
+ // - OTE/sandbox, which needs an sso-key (`apiKey` + `apiSecret`), and
3057
+ // - domain forwarding, which needs `customerId` (a customer UUID), plus an
3058
+ // sso-key to resolve a numeric shopper ID to that UUID.
3059
+ // GoDaddy is deprecating the sso-key scheme in 2026, so this is the direction
3060
+ // of travel regardless.
3038
3061
  static configFields = [
3039
- { name: "apiToken", label: "API Token (PAT)", type: "password", required: false },
3040
- { name: "apiKey", label: "API Key", type: "password", required: false },
3041
- { name: "apiSecret", label: "API Secret", type: "password", required: false },
3042
- { name: "customerId", label: "Customer ID or Shopper ID", type: "text", required: false }
3062
+ { name: "apiToken", label: "API Token (PAT)", type: "password", required: true }
3043
3063
  ];
3044
3064
  // GoDaddy's OTE ("Operational Test Environment") is its sandbox
3045
3065
  static supportsSandbox = true;
@@ -3157,6 +3177,9 @@ var GoDaddyRegistrar = class _GoDaddyRegistrar extends BaseRegistrar {
3157
3177
  });
3158
3178
  return this.toDomain(d);
3159
3179
  }
3180
+ // getNameservers re-reads getDomain (GoDaddy has no dedicated NS endpoint), so
3181
+ // listing enrichment gains nothing from the fallback — skip it.
3182
+ requiresNameserversFetch = false;
3160
3183
  async getNameservers(domainName, opts) {
3161
3184
  const domain = await this.getDomain(domainName, opts);
3162
3185
  return domain.nameservers;
@@ -5058,6 +5081,9 @@ var NameSiloRegistrar = class extends BaseRegistrar {
5058
5081
  nameservers: extractNsHosts(r.nameservers)
5059
5082
  });
5060
5083
  }
5084
+ // getNameservers re-reads getDomain (getDomainInfo carries NS; no separate
5085
+ // endpoint), so listing enrichment gains nothing from the fallback — skip it.
5086
+ requiresNameserversFetch = false;
5061
5087
  async getNameservers(domainName, opts) {
5062
5088
  const domain = await this.getDomain(domainName, opts);
5063
5089
  return domain.nameservers;
@@ -6299,6 +6325,9 @@ var SpaceshipRegistrar = class extends BaseRegistrar {
6299
6325
  async getDomain(domainName, opts) {
6300
6326
  return this.toDomain(await this.getRaw(domainName, opts));
6301
6327
  }
6328
+ // getNameservers reads the same getRaw payload as getDomain (no dedicated NS
6329
+ // endpoint), so listing enrichment gains nothing from the fallback — skip it.
6330
+ requiresNameserversFetch = false;
6302
6331
  async getNameservers(domainName, opts) {
6303
6332
  const d = await this.getRaw(domainName, opts);
6304
6333
  return d.nameservers?.hosts ?? [];