@aoxborrow/registrar-client 0.5.0 → 0.7.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 +181 -33
- package/dist/index.cjs +742 -56
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +85 -3
- package/dist/index.d.ts +85 -3
- package/dist/index.js +736 -57
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/errors.ts +69 -1
- package/src/features.ts +42 -0
- package/src/http.ts +76 -5
- package/src/index.ts +10 -2
- package/src/registrar.ts +47 -2
- package/src/registrars/cloudflare.ts +3 -0
- package/src/registrars/dynadot.ts +3 -0
- package/src/registrars/gandi.ts +3 -0
- package/src/registrars/godaddy.ts +3 -0
- package/src/registrars/index.ts +2 -0
- package/src/registrars/namebright.ts +6 -2
- package/src/registrars/namecheap.ts +6 -1
- package/src/registrars/namecom.ts +708 -0
- package/src/registrars/namesilo.ts +4 -4
- package/src/registrars/porkbun.ts +3 -3
- package/src/registrars/spaceship.ts +3 -0
- package/src/types.ts +30 -1
- package/src/utils.ts +16 -1
package/dist/index.d.cts
CHANGED
|
@@ -32,14 +32,27 @@ declare const CORE_FEATURES: readonly ["testConnection", "listDomains", "getDoma
|
|
|
32
32
|
declare const EXTENDED_FEATURES: readonly ["getAuthCode", "getDnssec", "disableDnssec", "getEmailForwarding", "setEmailForwarding", "getDomainForwarding", "setDomainForwarding"];
|
|
33
33
|
declare const ALL_FEATURES: readonly ["testConnection", "listDomains", "getDomain", "checkAvailability", "getPricing", "registerDomain", "renewDomain", "setAutoRenew", "transferIn", "updateNameservers", "getNameservers", "lockDomain", "unlockDomain", "setPrivacy", "getContacts", "updateContacts", "getDnsRecords", "setDnsRecords", "getAuthCode", "getDnssec", "disableDnssec", "getEmailForwarding", "setEmailForwarding", "getDomainForwarding", "setDomainForwarding"];
|
|
34
34
|
declare function isCoreFeature(feature: RegistrarFeature): boolean;
|
|
35
|
+
declare const FEATURE_CALLS: Record<RegistrarFeature, {
|
|
36
|
+
intent: 'read' | 'write';
|
|
37
|
+
optsIndex: number;
|
|
38
|
+
}>;
|
|
35
39
|
|
|
36
40
|
interface RegistrarClientOptions {
|
|
37
41
|
timeout: number;
|
|
38
42
|
retries: number;
|
|
39
43
|
backoff: number;
|
|
40
44
|
signal?: AbortSignal;
|
|
45
|
+
fetch?: typeof globalThis.fetch;
|
|
46
|
+
}
|
|
47
|
+
type RequestIntent = 'read' | 'write';
|
|
48
|
+
interface FeatureCall {
|
|
49
|
+
intent: RequestIntent;
|
|
50
|
+
feature?: string;
|
|
51
|
+
outcomeUnknown?: Error;
|
|
52
|
+
}
|
|
53
|
+
interface RequestOptions extends Partial<RegistrarClientOptions> {
|
|
54
|
+
call?: FeatureCall;
|
|
41
55
|
}
|
|
42
|
-
type RequestOptions = Partial<RegistrarClientOptions>;
|
|
43
56
|
interface ListDomainsOptions extends RequestOptions {
|
|
44
57
|
search?: string;
|
|
45
58
|
detailed?: boolean;
|
|
@@ -55,6 +68,7 @@ interface ConnectionResult {
|
|
|
55
68
|
interface OperationResult {
|
|
56
69
|
success: boolean;
|
|
57
70
|
message: string;
|
|
71
|
+
outcome?: 'unknown';
|
|
58
72
|
}
|
|
59
73
|
interface ConfigField {
|
|
60
74
|
name: string;
|
|
@@ -276,8 +290,22 @@ declare class TimeoutError extends RetryableRegistrarError {
|
|
|
276
290
|
}
|
|
277
291
|
declare class ConnectionError extends RetryableRegistrarError {
|
|
278
292
|
status: number;
|
|
279
|
-
|
|
293
|
+
notSent: boolean;
|
|
294
|
+
constructor(message: string, details?: {
|
|
295
|
+
notSent?: boolean;
|
|
296
|
+
});
|
|
280
297
|
}
|
|
298
|
+
declare class OutcomeUnknownError extends RegistrarError {
|
|
299
|
+
status: number;
|
|
300
|
+
feature?: string;
|
|
301
|
+
cause?: unknown;
|
|
302
|
+
constructor(message: string, details?: {
|
|
303
|
+
feature?: string;
|
|
304
|
+
cause?: unknown;
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
declare function markNotSent<T>(error: T): T;
|
|
308
|
+
declare function wasNotSent(error: unknown): boolean;
|
|
281
309
|
declare class AuthenticationError extends RegistrarError {
|
|
282
310
|
status: number;
|
|
283
311
|
constructor(message: string);
|
|
@@ -325,7 +353,9 @@ interface HttpClientConfig {
|
|
|
325
353
|
baseUrl: string;
|
|
326
354
|
headers?: Record<string, string>;
|
|
327
355
|
options: RegistrarClientOptions;
|
|
356
|
+
safeMethods?: readonly string[];
|
|
328
357
|
}
|
|
358
|
+
declare const REST_SAFE_METHODS: readonly string[];
|
|
329
359
|
interface RequestConfig {
|
|
330
360
|
method?: string;
|
|
331
361
|
path: string;
|
|
@@ -336,6 +366,8 @@ interface RequestConfig {
|
|
|
336
366
|
retries?: number;
|
|
337
367
|
backoff?: number;
|
|
338
368
|
signal?: AbortSignal;
|
|
369
|
+
fetch?: typeof globalThis.fetch;
|
|
370
|
+
call?: FeatureCall;
|
|
339
371
|
}
|
|
340
372
|
declare class HttpClient {
|
|
341
373
|
protected config: HttpClientConfig;
|
|
@@ -343,6 +375,7 @@ declare class HttpClient {
|
|
|
343
375
|
request<T = unknown>(req: RequestConfig): Promise<T>;
|
|
344
376
|
requestText(req: RequestConfig): Promise<string>;
|
|
345
377
|
protected withRetries<T>(req: RequestConfig, attemptFn: () => Promise<T>): Promise<T>;
|
|
378
|
+
protected intentOf(req: RequestConfig): 'read' | 'write';
|
|
346
379
|
protected buildUrl(req: RequestConfig): string;
|
|
347
380
|
protected send(req: RequestConfig): Promise<string>;
|
|
348
381
|
protected toStatusError(response: Response, url: string): Promise<RegistrarError>;
|
|
@@ -360,10 +393,12 @@ declare abstract class BaseRegistrar implements Registrar {
|
|
|
360
393
|
readonly environment: RegistrarEnvironment;
|
|
361
394
|
static readonly extendedFeatures: readonly RegistrarFeature[];
|
|
362
395
|
static get features(): readonly RegistrarFeature[];
|
|
396
|
+
static readonly safeMethods: readonly string[];
|
|
363
397
|
get features(): readonly RegistrarFeature[];
|
|
364
398
|
supports(feature: RegistrarFeature): boolean;
|
|
365
399
|
readonly requiresNameserversFetch: boolean;
|
|
366
400
|
constructor(credentials: RegistrarCredentials, httpConfig: Omit<HttpClientConfig, 'options'>, options?: RegistrarOptions);
|
|
401
|
+
private threadFeatureCalls;
|
|
367
402
|
testConnection(_opts?: RequestOptions): Promise<ConnectionResult>;
|
|
368
403
|
listDomains(_opts?: ListDomainsOptions): Promise<Domain[]>;
|
|
369
404
|
renewDomain(_domainName: string, _years?: number, _opts?: RequestOptions): Promise<OperationResult>;
|
|
@@ -394,6 +429,7 @@ declare abstract class BaseRegistrar implements Registrar {
|
|
|
394
429
|
|
|
395
430
|
declare class CloudflareRegistrar extends BaseRegistrar {
|
|
396
431
|
readonly name = "cloudflare";
|
|
432
|
+
static readonly safeMethods: readonly string[];
|
|
397
433
|
static readonly displayName = "Cloudflare";
|
|
398
434
|
static readonly website = "cloudflare.com";
|
|
399
435
|
static readonly helpText: string;
|
|
@@ -438,6 +474,7 @@ declare class CloudflareRegistrar extends BaseRegistrar {
|
|
|
438
474
|
|
|
439
475
|
declare class DynadotRegistrar extends BaseRegistrar {
|
|
440
476
|
readonly name = "dynadot";
|
|
477
|
+
static readonly safeMethods: readonly string[];
|
|
441
478
|
static readonly displayName = "Dynadot";
|
|
442
479
|
static readonly website = "dynadot.com";
|
|
443
480
|
static readonly helpText: string;
|
|
@@ -482,6 +519,7 @@ declare class DynadotRegistrar extends BaseRegistrar {
|
|
|
482
519
|
|
|
483
520
|
declare class GandiRegistrar extends BaseRegistrar {
|
|
484
521
|
readonly name = "gandi";
|
|
522
|
+
static readonly safeMethods: readonly string[];
|
|
485
523
|
static readonly displayName = "Gandi.net";
|
|
486
524
|
static readonly website = "gandi.net";
|
|
487
525
|
static readonly helpText: string;
|
|
@@ -520,6 +558,7 @@ declare class GandiRegistrar extends BaseRegistrar {
|
|
|
520
558
|
|
|
521
559
|
declare class GoDaddyRegistrar extends BaseRegistrar {
|
|
522
560
|
readonly name = "godaddy";
|
|
561
|
+
static readonly safeMethods: readonly string[];
|
|
523
562
|
static readonly displayName = "GoDaddy";
|
|
524
563
|
static readonly website = "godaddy.com";
|
|
525
564
|
static readonly helpText: string;
|
|
@@ -568,6 +607,7 @@ declare class GoDaddyRegistrar extends BaseRegistrar {
|
|
|
568
607
|
|
|
569
608
|
declare class NameBrightRegistrar extends BaseRegistrar {
|
|
570
609
|
readonly name = "namebright";
|
|
610
|
+
static readonly safeMethods: readonly string[];
|
|
571
611
|
static readonly displayName = "NameBright";
|
|
572
612
|
static readonly website = "namebright.com";
|
|
573
613
|
static readonly helpText: string;
|
|
@@ -638,6 +678,45 @@ declare class NamecheapRegistrar extends BaseRegistrar {
|
|
|
638
678
|
setDomainForwarding(domainName: string, forwards: DomainForward[], opts?: RequestOptions): Promise<OperationResult>;
|
|
639
679
|
}
|
|
640
680
|
|
|
681
|
+
declare class NamecomRegistrar extends BaseRegistrar {
|
|
682
|
+
readonly name = "namecom";
|
|
683
|
+
static readonly safeMethods: readonly string[];
|
|
684
|
+
static readonly displayName = "Name.com";
|
|
685
|
+
static readonly website = "name.com";
|
|
686
|
+
static readonly supportsSandbox = true;
|
|
687
|
+
static readonly configFields: ConfigField[];
|
|
688
|
+
static readonly helpText: string;
|
|
689
|
+
static readonly extendedFeatures: readonly RegistrarFeature[];
|
|
690
|
+
readonly requiresNameserversFetch = false;
|
|
691
|
+
constructor(credentials: RegistrarCredentials, options?: RegistrarOptions);
|
|
692
|
+
testConnection(opts?: RequestOptions): Promise<ConnectionResult>;
|
|
693
|
+
listDomains(opts?: ListDomainsOptions): Promise<Domain[]>;
|
|
694
|
+
getDomain(domainName: string, opts?: RequestOptions): Promise<Domain>;
|
|
695
|
+
getNameservers(domainName: string, opts?: RequestOptions): Promise<string[]>;
|
|
696
|
+
getAuthCode(domainName: string, opts?: RequestOptions): Promise<string>;
|
|
697
|
+
checkAvailability(domainNames: string[], opts?: RequestOptions): Promise<DomainAvailability[]>;
|
|
698
|
+
getPricing(tldOrDomain: string, opts?: RequestOptions): Promise<TldPricing>;
|
|
699
|
+
registerDomain(domainName: string, input: RegisterDomainInput, opts?: RequestOptions): Promise<OperationResult>;
|
|
700
|
+
renewDomain(domainName: string, years?: number, opts?: RequestOptions): Promise<OperationResult>;
|
|
701
|
+
transferIn(domainName: string, input: TransferDomainInput, opts?: RequestOptions): Promise<OperationResult>;
|
|
702
|
+
setAutoRenew(domainName: string, enabled: boolean, opts?: RequestOptions): Promise<OperationResult>;
|
|
703
|
+
lockDomain(domainName: string, opts?: RequestOptions): Promise<OperationResult>;
|
|
704
|
+
unlockDomain(domainName: string, opts?: RequestOptions): Promise<OperationResult>;
|
|
705
|
+
setPrivacy(domainName: string, enabled: boolean, opts?: RequestOptions): Promise<OperationResult>;
|
|
706
|
+
updateNameservers(domainName: string, nameservers: string[], opts?: RequestOptions): Promise<OperationResult>;
|
|
707
|
+
getContacts(domainName: string, opts?: RequestOptions): Promise<ContactSet>;
|
|
708
|
+
updateContacts(domainName: string, contacts: ContactSet, opts?: RequestOptions): Promise<OperationResult>;
|
|
709
|
+
getDnsRecords(domainName: string, opts?: RequestOptions): Promise<DnsRecord[]>;
|
|
710
|
+
setDnsRecords(domainName: string, records: DnsRecord[], opts?: RequestOptions): Promise<OperationResult>;
|
|
711
|
+
private patchDomain;
|
|
712
|
+
private rawDomain;
|
|
713
|
+
private domainPricing;
|
|
714
|
+
private toDomain;
|
|
715
|
+
private pages;
|
|
716
|
+
private mutate;
|
|
717
|
+
private purchase;
|
|
718
|
+
}
|
|
719
|
+
|
|
641
720
|
declare class NameSiloRegistrar extends BaseRegistrar {
|
|
642
721
|
readonly name = "namesilo";
|
|
643
722
|
static readonly displayName = "NameSilo";
|
|
@@ -711,6 +790,7 @@ declare class PorkbunRegistrar extends BaseRegistrar {
|
|
|
711
790
|
|
|
712
791
|
declare class SpaceshipRegistrar extends BaseRegistrar {
|
|
713
792
|
readonly name = "spaceship";
|
|
793
|
+
static readonly safeMethods: readonly string[];
|
|
714
794
|
static readonly displayName = "Spaceship";
|
|
715
795
|
static readonly website = "spaceship.com";
|
|
716
796
|
static readonly helpText: string;
|
|
@@ -754,6 +834,7 @@ declare const registrars: {
|
|
|
754
834
|
godaddy: typeof GoDaddyRegistrar;
|
|
755
835
|
namebright: typeof NameBrightRegistrar;
|
|
756
836
|
namecheap: typeof NamecheapRegistrar;
|
|
837
|
+
namecom: typeof NamecomRegistrar;
|
|
757
838
|
namesilo: typeof NameSiloRegistrar;
|
|
758
839
|
porkbun: typeof PorkbunRegistrar;
|
|
759
840
|
spaceship: typeof SpaceshipRegistrar;
|
|
@@ -780,5 +861,6 @@ declare function backoffDelay(backoff: number, attempt: number): number;
|
|
|
780
861
|
declare function parseDate(value: Date | string | number | null | undefined): Date | null;
|
|
781
862
|
declare function normalizeNameservers(nameservers: unknown): string[];
|
|
782
863
|
declare function createDomain(data?: DomainInput): Domain;
|
|
864
|
+
declare function asRead<T extends RequestOptions>(opts?: T): T;
|
|
783
865
|
|
|
784
|
-
export { ALL_FEATURES, AbortError, AuthenticationError, AuthorizationError, BaseRegistrar, CORE_FEATURES, CloudflareRegistrar, type ConfigField, ConfigurationError, ConnectionError, type ConnectionResult, ConsentRequiredError, type Contact, type ContactSet, DEFAULT_OPTIONS, type DnsRecord, type DnssecStatus, type Domain, type DomainAvailability, type DomainForward, type DomainForwardType, type DomainInput, type DomainSource, type DsRecord, DynadotRegistrar, EXTENDED_FEATURES, type EmailForward, Feature, GandiRegistrar, GoDaddyRegistrar, HttpClient, type HttpClientConfig, InvalidResponseError, type ListDomainsOptions, MASKED_FORWARD_UNSUPPORTED, NameBrightRegistrar, NameSiloRegistrar, NamecheapRegistrar, NotFoundError, NotImplementedError, type OperationResult, ParsingError, PorkbunRegistrar, type PortfolioError, type PortfolioResult, RateLimitError, type RegisterDomainInput, type Registrar, RegistrarClient, type RegistrarClientOptions, type RegistrarConstructor, type RegistrarCredentials, type RegistrarEnvironment, RegistrarError, type RegistrarFeature, type RegistrarName, type RegistrarOptions, type RegistrationConsent, type RequestConfig, type RequestOptions, RetryableRegistrarError, type SettableDomainForward, SpaceshipRegistrar, TimeoutError, type TldPricing, type TransferDomainInput, USER_AGENT, backoffDelay, createDomain, createRegistrar, ensureArray, filterDomains, isCoreFeature, listPortfolio, normalizeDomain, normalizeNameservers, parseDate, parseXml, registrars, requireConsent, selectBaseUrl, settableForwards, sleep, toRegistrarError };
|
|
866
|
+
export { ALL_FEATURES, AbortError, AuthenticationError, AuthorizationError, BaseRegistrar, CORE_FEATURES, CloudflareRegistrar, type ConfigField, ConfigurationError, ConnectionError, type ConnectionResult, ConsentRequiredError, type Contact, type ContactSet, DEFAULT_OPTIONS, type DnsRecord, type DnssecStatus, type Domain, type DomainAvailability, type DomainForward, type DomainForwardType, type DomainInput, type DomainSource, type DsRecord, DynadotRegistrar, EXTENDED_FEATURES, type EmailForward, FEATURE_CALLS, Feature, type FeatureCall, GandiRegistrar, GoDaddyRegistrar, HttpClient, type HttpClientConfig, InvalidResponseError, type ListDomainsOptions, MASKED_FORWARD_UNSUPPORTED, NameBrightRegistrar, NameSiloRegistrar, NamecheapRegistrar, NamecomRegistrar, NotFoundError, NotImplementedError, type OperationResult, OutcomeUnknownError, ParsingError, PorkbunRegistrar, type PortfolioError, type PortfolioResult, REST_SAFE_METHODS, RateLimitError, type RegisterDomainInput, type Registrar, RegistrarClient, type RegistrarClientOptions, type RegistrarConstructor, type RegistrarCredentials, type RegistrarEnvironment, RegistrarError, type RegistrarFeature, type RegistrarName, type RegistrarOptions, type RegistrationConsent, type RequestConfig, type RequestIntent, type RequestOptions, RetryableRegistrarError, type SettableDomainForward, SpaceshipRegistrar, TimeoutError, type TldPricing, type TransferDomainInput, USER_AGENT, asRead, backoffDelay, createDomain, createRegistrar, ensureArray, filterDomains, isCoreFeature, listPortfolio, markNotSent, normalizeDomain, normalizeNameservers, parseDate, parseXml, registrars, requireConsent, selectBaseUrl, settableForwards, sleep, toRegistrarError, wasNotSent };
|
package/dist/index.d.ts
CHANGED
|
@@ -32,14 +32,27 @@ declare const CORE_FEATURES: readonly ["testConnection", "listDomains", "getDoma
|
|
|
32
32
|
declare const EXTENDED_FEATURES: readonly ["getAuthCode", "getDnssec", "disableDnssec", "getEmailForwarding", "setEmailForwarding", "getDomainForwarding", "setDomainForwarding"];
|
|
33
33
|
declare const ALL_FEATURES: readonly ["testConnection", "listDomains", "getDomain", "checkAvailability", "getPricing", "registerDomain", "renewDomain", "setAutoRenew", "transferIn", "updateNameservers", "getNameservers", "lockDomain", "unlockDomain", "setPrivacy", "getContacts", "updateContacts", "getDnsRecords", "setDnsRecords", "getAuthCode", "getDnssec", "disableDnssec", "getEmailForwarding", "setEmailForwarding", "getDomainForwarding", "setDomainForwarding"];
|
|
34
34
|
declare function isCoreFeature(feature: RegistrarFeature): boolean;
|
|
35
|
+
declare const FEATURE_CALLS: Record<RegistrarFeature, {
|
|
36
|
+
intent: 'read' | 'write';
|
|
37
|
+
optsIndex: number;
|
|
38
|
+
}>;
|
|
35
39
|
|
|
36
40
|
interface RegistrarClientOptions {
|
|
37
41
|
timeout: number;
|
|
38
42
|
retries: number;
|
|
39
43
|
backoff: number;
|
|
40
44
|
signal?: AbortSignal;
|
|
45
|
+
fetch?: typeof globalThis.fetch;
|
|
46
|
+
}
|
|
47
|
+
type RequestIntent = 'read' | 'write';
|
|
48
|
+
interface FeatureCall {
|
|
49
|
+
intent: RequestIntent;
|
|
50
|
+
feature?: string;
|
|
51
|
+
outcomeUnknown?: Error;
|
|
52
|
+
}
|
|
53
|
+
interface RequestOptions extends Partial<RegistrarClientOptions> {
|
|
54
|
+
call?: FeatureCall;
|
|
41
55
|
}
|
|
42
|
-
type RequestOptions = Partial<RegistrarClientOptions>;
|
|
43
56
|
interface ListDomainsOptions extends RequestOptions {
|
|
44
57
|
search?: string;
|
|
45
58
|
detailed?: boolean;
|
|
@@ -55,6 +68,7 @@ interface ConnectionResult {
|
|
|
55
68
|
interface OperationResult {
|
|
56
69
|
success: boolean;
|
|
57
70
|
message: string;
|
|
71
|
+
outcome?: 'unknown';
|
|
58
72
|
}
|
|
59
73
|
interface ConfigField {
|
|
60
74
|
name: string;
|
|
@@ -276,8 +290,22 @@ declare class TimeoutError extends RetryableRegistrarError {
|
|
|
276
290
|
}
|
|
277
291
|
declare class ConnectionError extends RetryableRegistrarError {
|
|
278
292
|
status: number;
|
|
279
|
-
|
|
293
|
+
notSent: boolean;
|
|
294
|
+
constructor(message: string, details?: {
|
|
295
|
+
notSent?: boolean;
|
|
296
|
+
});
|
|
280
297
|
}
|
|
298
|
+
declare class OutcomeUnknownError extends RegistrarError {
|
|
299
|
+
status: number;
|
|
300
|
+
feature?: string;
|
|
301
|
+
cause?: unknown;
|
|
302
|
+
constructor(message: string, details?: {
|
|
303
|
+
feature?: string;
|
|
304
|
+
cause?: unknown;
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
declare function markNotSent<T>(error: T): T;
|
|
308
|
+
declare function wasNotSent(error: unknown): boolean;
|
|
281
309
|
declare class AuthenticationError extends RegistrarError {
|
|
282
310
|
status: number;
|
|
283
311
|
constructor(message: string);
|
|
@@ -325,7 +353,9 @@ interface HttpClientConfig {
|
|
|
325
353
|
baseUrl: string;
|
|
326
354
|
headers?: Record<string, string>;
|
|
327
355
|
options: RegistrarClientOptions;
|
|
356
|
+
safeMethods?: readonly string[];
|
|
328
357
|
}
|
|
358
|
+
declare const REST_SAFE_METHODS: readonly string[];
|
|
329
359
|
interface RequestConfig {
|
|
330
360
|
method?: string;
|
|
331
361
|
path: string;
|
|
@@ -336,6 +366,8 @@ interface RequestConfig {
|
|
|
336
366
|
retries?: number;
|
|
337
367
|
backoff?: number;
|
|
338
368
|
signal?: AbortSignal;
|
|
369
|
+
fetch?: typeof globalThis.fetch;
|
|
370
|
+
call?: FeatureCall;
|
|
339
371
|
}
|
|
340
372
|
declare class HttpClient {
|
|
341
373
|
protected config: HttpClientConfig;
|
|
@@ -343,6 +375,7 @@ declare class HttpClient {
|
|
|
343
375
|
request<T = unknown>(req: RequestConfig): Promise<T>;
|
|
344
376
|
requestText(req: RequestConfig): Promise<string>;
|
|
345
377
|
protected withRetries<T>(req: RequestConfig, attemptFn: () => Promise<T>): Promise<T>;
|
|
378
|
+
protected intentOf(req: RequestConfig): 'read' | 'write';
|
|
346
379
|
protected buildUrl(req: RequestConfig): string;
|
|
347
380
|
protected send(req: RequestConfig): Promise<string>;
|
|
348
381
|
protected toStatusError(response: Response, url: string): Promise<RegistrarError>;
|
|
@@ -360,10 +393,12 @@ declare abstract class BaseRegistrar implements Registrar {
|
|
|
360
393
|
readonly environment: RegistrarEnvironment;
|
|
361
394
|
static readonly extendedFeatures: readonly RegistrarFeature[];
|
|
362
395
|
static get features(): readonly RegistrarFeature[];
|
|
396
|
+
static readonly safeMethods: readonly string[];
|
|
363
397
|
get features(): readonly RegistrarFeature[];
|
|
364
398
|
supports(feature: RegistrarFeature): boolean;
|
|
365
399
|
readonly requiresNameserversFetch: boolean;
|
|
366
400
|
constructor(credentials: RegistrarCredentials, httpConfig: Omit<HttpClientConfig, 'options'>, options?: RegistrarOptions);
|
|
401
|
+
private threadFeatureCalls;
|
|
367
402
|
testConnection(_opts?: RequestOptions): Promise<ConnectionResult>;
|
|
368
403
|
listDomains(_opts?: ListDomainsOptions): Promise<Domain[]>;
|
|
369
404
|
renewDomain(_domainName: string, _years?: number, _opts?: RequestOptions): Promise<OperationResult>;
|
|
@@ -394,6 +429,7 @@ declare abstract class BaseRegistrar implements Registrar {
|
|
|
394
429
|
|
|
395
430
|
declare class CloudflareRegistrar extends BaseRegistrar {
|
|
396
431
|
readonly name = "cloudflare";
|
|
432
|
+
static readonly safeMethods: readonly string[];
|
|
397
433
|
static readonly displayName = "Cloudflare";
|
|
398
434
|
static readonly website = "cloudflare.com";
|
|
399
435
|
static readonly helpText: string;
|
|
@@ -438,6 +474,7 @@ declare class CloudflareRegistrar extends BaseRegistrar {
|
|
|
438
474
|
|
|
439
475
|
declare class DynadotRegistrar extends BaseRegistrar {
|
|
440
476
|
readonly name = "dynadot";
|
|
477
|
+
static readonly safeMethods: readonly string[];
|
|
441
478
|
static readonly displayName = "Dynadot";
|
|
442
479
|
static readonly website = "dynadot.com";
|
|
443
480
|
static readonly helpText: string;
|
|
@@ -482,6 +519,7 @@ declare class DynadotRegistrar extends BaseRegistrar {
|
|
|
482
519
|
|
|
483
520
|
declare class GandiRegistrar extends BaseRegistrar {
|
|
484
521
|
readonly name = "gandi";
|
|
522
|
+
static readonly safeMethods: readonly string[];
|
|
485
523
|
static readonly displayName = "Gandi.net";
|
|
486
524
|
static readonly website = "gandi.net";
|
|
487
525
|
static readonly helpText: string;
|
|
@@ -520,6 +558,7 @@ declare class GandiRegistrar extends BaseRegistrar {
|
|
|
520
558
|
|
|
521
559
|
declare class GoDaddyRegistrar extends BaseRegistrar {
|
|
522
560
|
readonly name = "godaddy";
|
|
561
|
+
static readonly safeMethods: readonly string[];
|
|
523
562
|
static readonly displayName = "GoDaddy";
|
|
524
563
|
static readonly website = "godaddy.com";
|
|
525
564
|
static readonly helpText: string;
|
|
@@ -568,6 +607,7 @@ declare class GoDaddyRegistrar extends BaseRegistrar {
|
|
|
568
607
|
|
|
569
608
|
declare class NameBrightRegistrar extends BaseRegistrar {
|
|
570
609
|
readonly name = "namebright";
|
|
610
|
+
static readonly safeMethods: readonly string[];
|
|
571
611
|
static readonly displayName = "NameBright";
|
|
572
612
|
static readonly website = "namebright.com";
|
|
573
613
|
static readonly helpText: string;
|
|
@@ -638,6 +678,45 @@ declare class NamecheapRegistrar extends BaseRegistrar {
|
|
|
638
678
|
setDomainForwarding(domainName: string, forwards: DomainForward[], opts?: RequestOptions): Promise<OperationResult>;
|
|
639
679
|
}
|
|
640
680
|
|
|
681
|
+
declare class NamecomRegistrar extends BaseRegistrar {
|
|
682
|
+
readonly name = "namecom";
|
|
683
|
+
static readonly safeMethods: readonly string[];
|
|
684
|
+
static readonly displayName = "Name.com";
|
|
685
|
+
static readonly website = "name.com";
|
|
686
|
+
static readonly supportsSandbox = true;
|
|
687
|
+
static readonly configFields: ConfigField[];
|
|
688
|
+
static readonly helpText: string;
|
|
689
|
+
static readonly extendedFeatures: readonly RegistrarFeature[];
|
|
690
|
+
readonly requiresNameserversFetch = false;
|
|
691
|
+
constructor(credentials: RegistrarCredentials, options?: RegistrarOptions);
|
|
692
|
+
testConnection(opts?: RequestOptions): Promise<ConnectionResult>;
|
|
693
|
+
listDomains(opts?: ListDomainsOptions): Promise<Domain[]>;
|
|
694
|
+
getDomain(domainName: string, opts?: RequestOptions): Promise<Domain>;
|
|
695
|
+
getNameservers(domainName: string, opts?: RequestOptions): Promise<string[]>;
|
|
696
|
+
getAuthCode(domainName: string, opts?: RequestOptions): Promise<string>;
|
|
697
|
+
checkAvailability(domainNames: string[], opts?: RequestOptions): Promise<DomainAvailability[]>;
|
|
698
|
+
getPricing(tldOrDomain: string, opts?: RequestOptions): Promise<TldPricing>;
|
|
699
|
+
registerDomain(domainName: string, input: RegisterDomainInput, opts?: RequestOptions): Promise<OperationResult>;
|
|
700
|
+
renewDomain(domainName: string, years?: number, opts?: RequestOptions): Promise<OperationResult>;
|
|
701
|
+
transferIn(domainName: string, input: TransferDomainInput, opts?: RequestOptions): Promise<OperationResult>;
|
|
702
|
+
setAutoRenew(domainName: string, enabled: boolean, opts?: RequestOptions): Promise<OperationResult>;
|
|
703
|
+
lockDomain(domainName: string, opts?: RequestOptions): Promise<OperationResult>;
|
|
704
|
+
unlockDomain(domainName: string, opts?: RequestOptions): Promise<OperationResult>;
|
|
705
|
+
setPrivacy(domainName: string, enabled: boolean, opts?: RequestOptions): Promise<OperationResult>;
|
|
706
|
+
updateNameservers(domainName: string, nameservers: string[], opts?: RequestOptions): Promise<OperationResult>;
|
|
707
|
+
getContacts(domainName: string, opts?: RequestOptions): Promise<ContactSet>;
|
|
708
|
+
updateContacts(domainName: string, contacts: ContactSet, opts?: RequestOptions): Promise<OperationResult>;
|
|
709
|
+
getDnsRecords(domainName: string, opts?: RequestOptions): Promise<DnsRecord[]>;
|
|
710
|
+
setDnsRecords(domainName: string, records: DnsRecord[], opts?: RequestOptions): Promise<OperationResult>;
|
|
711
|
+
private patchDomain;
|
|
712
|
+
private rawDomain;
|
|
713
|
+
private domainPricing;
|
|
714
|
+
private toDomain;
|
|
715
|
+
private pages;
|
|
716
|
+
private mutate;
|
|
717
|
+
private purchase;
|
|
718
|
+
}
|
|
719
|
+
|
|
641
720
|
declare class NameSiloRegistrar extends BaseRegistrar {
|
|
642
721
|
readonly name = "namesilo";
|
|
643
722
|
static readonly displayName = "NameSilo";
|
|
@@ -711,6 +790,7 @@ declare class PorkbunRegistrar extends BaseRegistrar {
|
|
|
711
790
|
|
|
712
791
|
declare class SpaceshipRegistrar extends BaseRegistrar {
|
|
713
792
|
readonly name = "spaceship";
|
|
793
|
+
static readonly safeMethods: readonly string[];
|
|
714
794
|
static readonly displayName = "Spaceship";
|
|
715
795
|
static readonly website = "spaceship.com";
|
|
716
796
|
static readonly helpText: string;
|
|
@@ -754,6 +834,7 @@ declare const registrars: {
|
|
|
754
834
|
godaddy: typeof GoDaddyRegistrar;
|
|
755
835
|
namebright: typeof NameBrightRegistrar;
|
|
756
836
|
namecheap: typeof NamecheapRegistrar;
|
|
837
|
+
namecom: typeof NamecomRegistrar;
|
|
757
838
|
namesilo: typeof NameSiloRegistrar;
|
|
758
839
|
porkbun: typeof PorkbunRegistrar;
|
|
759
840
|
spaceship: typeof SpaceshipRegistrar;
|
|
@@ -780,5 +861,6 @@ declare function backoffDelay(backoff: number, attempt: number): number;
|
|
|
780
861
|
declare function parseDate(value: Date | string | number | null | undefined): Date | null;
|
|
781
862
|
declare function normalizeNameservers(nameservers: unknown): string[];
|
|
782
863
|
declare function createDomain(data?: DomainInput): Domain;
|
|
864
|
+
declare function asRead<T extends RequestOptions>(opts?: T): T;
|
|
783
865
|
|
|
784
|
-
export { ALL_FEATURES, AbortError, AuthenticationError, AuthorizationError, BaseRegistrar, CORE_FEATURES, CloudflareRegistrar, type ConfigField, ConfigurationError, ConnectionError, type ConnectionResult, ConsentRequiredError, type Contact, type ContactSet, DEFAULT_OPTIONS, type DnsRecord, type DnssecStatus, type Domain, type DomainAvailability, type DomainForward, type DomainForwardType, type DomainInput, type DomainSource, type DsRecord, DynadotRegistrar, EXTENDED_FEATURES, type EmailForward, Feature, GandiRegistrar, GoDaddyRegistrar, HttpClient, type HttpClientConfig, InvalidResponseError, type ListDomainsOptions, MASKED_FORWARD_UNSUPPORTED, NameBrightRegistrar, NameSiloRegistrar, NamecheapRegistrar, NotFoundError, NotImplementedError, type OperationResult, ParsingError, PorkbunRegistrar, type PortfolioError, type PortfolioResult, RateLimitError, type RegisterDomainInput, type Registrar, RegistrarClient, type RegistrarClientOptions, type RegistrarConstructor, type RegistrarCredentials, type RegistrarEnvironment, RegistrarError, type RegistrarFeature, type RegistrarName, type RegistrarOptions, type RegistrationConsent, type RequestConfig, type RequestOptions, RetryableRegistrarError, type SettableDomainForward, SpaceshipRegistrar, TimeoutError, type TldPricing, type TransferDomainInput, USER_AGENT, backoffDelay, createDomain, createRegistrar, ensureArray, filterDomains, isCoreFeature, listPortfolio, normalizeDomain, normalizeNameservers, parseDate, parseXml, registrars, requireConsent, selectBaseUrl, settableForwards, sleep, toRegistrarError };
|
|
866
|
+
export { ALL_FEATURES, AbortError, AuthenticationError, AuthorizationError, BaseRegistrar, CORE_FEATURES, CloudflareRegistrar, type ConfigField, ConfigurationError, ConnectionError, type ConnectionResult, ConsentRequiredError, type Contact, type ContactSet, DEFAULT_OPTIONS, type DnsRecord, type DnssecStatus, type Domain, type DomainAvailability, type DomainForward, type DomainForwardType, type DomainInput, type DomainSource, type DsRecord, DynadotRegistrar, EXTENDED_FEATURES, type EmailForward, FEATURE_CALLS, Feature, type FeatureCall, GandiRegistrar, GoDaddyRegistrar, HttpClient, type HttpClientConfig, InvalidResponseError, type ListDomainsOptions, MASKED_FORWARD_UNSUPPORTED, NameBrightRegistrar, NameSiloRegistrar, NamecheapRegistrar, NamecomRegistrar, NotFoundError, NotImplementedError, type OperationResult, OutcomeUnknownError, ParsingError, PorkbunRegistrar, type PortfolioError, type PortfolioResult, REST_SAFE_METHODS, RateLimitError, type RegisterDomainInput, type Registrar, RegistrarClient, type RegistrarClientOptions, type RegistrarConstructor, type RegistrarCredentials, type RegistrarEnvironment, RegistrarError, type RegistrarFeature, type RegistrarName, type RegistrarOptions, type RegistrationConsent, type RequestConfig, type RequestIntent, type RequestOptions, RetryableRegistrarError, type SettableDomainForward, SpaceshipRegistrar, TimeoutError, type TldPricing, type TransferDomainInput, USER_AGENT, asRead, backoffDelay, createDomain, createRegistrar, ensureArray, filterDomains, isCoreFeature, listPortfolio, markNotSent, normalizeDomain, normalizeNameservers, parseDate, parseXml, registrars, requireConsent, selectBaseUrl, settableForwards, sleep, toRegistrarError, wasNotSent };
|