@aoxborrow/registrar-client 0.8.0 → 0.9.1
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 +78 -43
- package/dist/index.cjs +903 -32
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +62 -1
- package/dist/index.d.ts +62 -1
- package/dist/index.js +891 -33
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/dns-records.ts +544 -0
- package/src/index.ts +4 -0
- package/src/registrars/domain101.ts +727 -0
- package/src/registrars/index.ts +12 -10
- package/src/types.ts +3 -0
package/dist/index.d.cts
CHANGED
|
@@ -68,6 +68,7 @@ interface ConnectionResult {
|
|
|
68
68
|
interface OperationResult {
|
|
69
69
|
success: boolean;
|
|
70
70
|
message: string;
|
|
71
|
+
pending?: boolean;
|
|
71
72
|
outcome?: 'unknown';
|
|
72
73
|
}
|
|
73
74
|
interface ConfigField {
|
|
@@ -474,6 +475,31 @@ declare class CloudflareRegistrar extends BaseRegistrar {
|
|
|
474
475
|
private patchDomain;
|
|
475
476
|
}
|
|
476
477
|
|
|
478
|
+
declare class Domain101Registrar extends BaseRegistrar {
|
|
479
|
+
readonly name = "101domain";
|
|
480
|
+
static readonly safeMethods: readonly string[];
|
|
481
|
+
static readonly displayName = "101domain";
|
|
482
|
+
static readonly website = "101domain.com";
|
|
483
|
+
static readonly supportsSandbox = false;
|
|
484
|
+
static readonly configFields: ConfigField[];
|
|
485
|
+
static readonly helpText: string;
|
|
486
|
+
static readonly extendedFeatures: readonly RegistrarFeature[];
|
|
487
|
+
constructor(credentials: RegistrarCredentials, options?: RegistrarOptions);
|
|
488
|
+
testConnection(opts?: RequestOptions): Promise<ConnectionResult>;
|
|
489
|
+
listDomains(opts?: ListDomainsOptions): Promise<Domain[]>;
|
|
490
|
+
getDomain(domainName: string, opts?: RequestOptions): Promise<Domain>;
|
|
491
|
+
getNameservers(domainName: string, opts?: RequestOptions): Promise<string[]>;
|
|
492
|
+
updateNameservers(domainName: string, nameservers: string[], opts?: RequestOptions): Promise<OperationResult>;
|
|
493
|
+
checkAvailability(domainNames: string[], opts?: RequestOptions): Promise<DomainAvailability[]>;
|
|
494
|
+
getPricing(tldOrDomain: string, opts?: RequestOptions): Promise<TldPricing>;
|
|
495
|
+
getDnsRecords(domainName: string, opts?: RequestOptions): Promise<DnsRecord[]>;
|
|
496
|
+
setDnsRecords(domainName: string, records: DnsRecord[], opts?: RequestOptions): Promise<OperationResult>;
|
|
497
|
+
getDomainForwarding(domainName: string, opts?: RequestOptions): Promise<DomainForward[]>;
|
|
498
|
+
setDomainForwarding(domainName: string, forwards: DomainForward[], opts?: RequestOptions): Promise<OperationResult>;
|
|
499
|
+
private request;
|
|
500
|
+
private rawRecords;
|
|
501
|
+
}
|
|
502
|
+
|
|
477
503
|
declare class DynadotRegistrar extends BaseRegistrar {
|
|
478
504
|
readonly name = "dynadot";
|
|
479
505
|
static readonly safeMethods: readonly string[];
|
|
@@ -830,6 +856,7 @@ declare class SpaceshipRegistrar extends BaseRegistrar {
|
|
|
830
856
|
}
|
|
831
857
|
|
|
832
858
|
declare const registrars: {
|
|
859
|
+
'101domain': typeof Domain101Registrar;
|
|
833
860
|
cloudflare: typeof CloudflareRegistrar;
|
|
834
861
|
dynadot: typeof DynadotRegistrar;
|
|
835
862
|
gandi: typeof GandiRegistrar;
|
|
@@ -844,6 +871,40 @@ declare const registrars: {
|
|
|
844
871
|
type RegistrarName = keyof typeof registrars;
|
|
845
872
|
declare function createRegistrar(name: RegistrarName, credentials: RegistrarCredentials, options?: RegistrarOptions): Registrar;
|
|
846
873
|
|
|
874
|
+
declare class DnsSyntaxError extends Error {
|
|
875
|
+
constructor(message: string);
|
|
876
|
+
}
|
|
877
|
+
interface DnsEntry {
|
|
878
|
+
owner: string;
|
|
879
|
+
kind: string;
|
|
880
|
+
ttl: number;
|
|
881
|
+
rdata: string;
|
|
882
|
+
}
|
|
883
|
+
interface RecordClash {
|
|
884
|
+
owner: string;
|
|
885
|
+
kind: string;
|
|
886
|
+
detail: string;
|
|
887
|
+
}
|
|
888
|
+
type NameRole = 'owner' | 'target';
|
|
889
|
+
type LabelMapper = (label: string) => string | null;
|
|
890
|
+
interface DelegationSigner {
|
|
891
|
+
keyTag: number;
|
|
892
|
+
algorithm: number;
|
|
893
|
+
digestType: number;
|
|
894
|
+
digest: string;
|
|
895
|
+
}
|
|
896
|
+
declare function useLabelMapper(mapper: LabelMapper): void;
|
|
897
|
+
declare function resetLabelMapper(): void;
|
|
898
|
+
declare function prepareName(input: string, role?: NameRole): string;
|
|
899
|
+
declare function isIpv4(text: string): boolean;
|
|
900
|
+
declare function isIpv6(text: string): boolean;
|
|
901
|
+
declare function readDelegationSigner(rdata: string): DelegationSigner;
|
|
902
|
+
declare function prepareRdata(kind: string, rdata: string, owner?: string): string;
|
|
903
|
+
declare function prepareEntry(entry: DnsEntry): DnsEntry;
|
|
904
|
+
declare function findCnameConflicts(entries: readonly DnsEntry[]): RecordClash[];
|
|
905
|
+
declare function findRepeatedRecords(entries: readonly DnsEntry[]): RecordClash[];
|
|
906
|
+
declare function toDnsEntry(record: DnsRecord, defaultTtl?: number): DnsEntry;
|
|
907
|
+
|
|
847
908
|
declare function parseXml<T = unknown>(xml: string, options?: Partial<X2jOptions>): T;
|
|
848
909
|
declare function ensureArray<T>(value: T | T[] | undefined | null): T[];
|
|
849
910
|
|
|
@@ -865,4 +926,4 @@ declare function normalizeNameservers(nameservers: unknown): string[];
|
|
|
865
926
|
declare function createDomain(data?: DomainInput): Domain;
|
|
866
927
|
declare function asRead<T extends RequestOptions>(opts?: T): T;
|
|
867
928
|
|
|
868
|
-
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 };
|
|
929
|
+
export { ALL_FEATURES, AbortError, AuthenticationError, AuthorizationError, BaseRegistrar, CORE_FEATURES, CloudflareRegistrar, type ConfigField, ConfigurationError, ConnectionError, type ConnectionResult, ConsentRequiredError, type Contact, type ContactSet, DEFAULT_OPTIONS, type DelegationSigner, type DnsEntry, type DnsRecord, DnsSyntaxError, type DnssecStatus, type Domain, Domain101Registrar, 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 LabelMapper, type ListDomainsOptions, MASKED_FORWARD_UNSUPPORTED, NameBrightRegistrar, type NameRole, NameSiloRegistrar, NamecheapRegistrar, NamecomRegistrar, NotFoundError, NotImplementedError, type OperationResult, OutcomeUnknownError, ParsingError, PorkbunRegistrar, type PortfolioError, type PortfolioResult, REST_SAFE_METHODS, RateLimitError, type RecordClash, 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, findCnameConflicts, findRepeatedRecords, isCoreFeature, isIpv4, isIpv6, listPortfolio, markNotSent, normalizeDomain, normalizeNameservers, parseDate, parseXml, prepareEntry, prepareName, prepareRdata, readDelegationSigner, registrars, requireConsent, resetLabelMapper, selectBaseUrl, settableForwards, sleep, toDnsEntry, toRegistrarError, useLabelMapper, wasNotSent };
|
package/dist/index.d.ts
CHANGED
|
@@ -68,6 +68,7 @@ interface ConnectionResult {
|
|
|
68
68
|
interface OperationResult {
|
|
69
69
|
success: boolean;
|
|
70
70
|
message: string;
|
|
71
|
+
pending?: boolean;
|
|
71
72
|
outcome?: 'unknown';
|
|
72
73
|
}
|
|
73
74
|
interface ConfigField {
|
|
@@ -474,6 +475,31 @@ declare class CloudflareRegistrar extends BaseRegistrar {
|
|
|
474
475
|
private patchDomain;
|
|
475
476
|
}
|
|
476
477
|
|
|
478
|
+
declare class Domain101Registrar extends BaseRegistrar {
|
|
479
|
+
readonly name = "101domain";
|
|
480
|
+
static readonly safeMethods: readonly string[];
|
|
481
|
+
static readonly displayName = "101domain";
|
|
482
|
+
static readonly website = "101domain.com";
|
|
483
|
+
static readonly supportsSandbox = false;
|
|
484
|
+
static readonly configFields: ConfigField[];
|
|
485
|
+
static readonly helpText: string;
|
|
486
|
+
static readonly extendedFeatures: readonly RegistrarFeature[];
|
|
487
|
+
constructor(credentials: RegistrarCredentials, options?: RegistrarOptions);
|
|
488
|
+
testConnection(opts?: RequestOptions): Promise<ConnectionResult>;
|
|
489
|
+
listDomains(opts?: ListDomainsOptions): Promise<Domain[]>;
|
|
490
|
+
getDomain(domainName: string, opts?: RequestOptions): Promise<Domain>;
|
|
491
|
+
getNameservers(domainName: string, opts?: RequestOptions): Promise<string[]>;
|
|
492
|
+
updateNameservers(domainName: string, nameservers: string[], opts?: RequestOptions): Promise<OperationResult>;
|
|
493
|
+
checkAvailability(domainNames: string[], opts?: RequestOptions): Promise<DomainAvailability[]>;
|
|
494
|
+
getPricing(tldOrDomain: string, opts?: RequestOptions): Promise<TldPricing>;
|
|
495
|
+
getDnsRecords(domainName: string, opts?: RequestOptions): Promise<DnsRecord[]>;
|
|
496
|
+
setDnsRecords(domainName: string, records: DnsRecord[], opts?: RequestOptions): Promise<OperationResult>;
|
|
497
|
+
getDomainForwarding(domainName: string, opts?: RequestOptions): Promise<DomainForward[]>;
|
|
498
|
+
setDomainForwarding(domainName: string, forwards: DomainForward[], opts?: RequestOptions): Promise<OperationResult>;
|
|
499
|
+
private request;
|
|
500
|
+
private rawRecords;
|
|
501
|
+
}
|
|
502
|
+
|
|
477
503
|
declare class DynadotRegistrar extends BaseRegistrar {
|
|
478
504
|
readonly name = "dynadot";
|
|
479
505
|
static readonly safeMethods: readonly string[];
|
|
@@ -830,6 +856,7 @@ declare class SpaceshipRegistrar extends BaseRegistrar {
|
|
|
830
856
|
}
|
|
831
857
|
|
|
832
858
|
declare const registrars: {
|
|
859
|
+
'101domain': typeof Domain101Registrar;
|
|
833
860
|
cloudflare: typeof CloudflareRegistrar;
|
|
834
861
|
dynadot: typeof DynadotRegistrar;
|
|
835
862
|
gandi: typeof GandiRegistrar;
|
|
@@ -844,6 +871,40 @@ declare const registrars: {
|
|
|
844
871
|
type RegistrarName = keyof typeof registrars;
|
|
845
872
|
declare function createRegistrar(name: RegistrarName, credentials: RegistrarCredentials, options?: RegistrarOptions): Registrar;
|
|
846
873
|
|
|
874
|
+
declare class DnsSyntaxError extends Error {
|
|
875
|
+
constructor(message: string);
|
|
876
|
+
}
|
|
877
|
+
interface DnsEntry {
|
|
878
|
+
owner: string;
|
|
879
|
+
kind: string;
|
|
880
|
+
ttl: number;
|
|
881
|
+
rdata: string;
|
|
882
|
+
}
|
|
883
|
+
interface RecordClash {
|
|
884
|
+
owner: string;
|
|
885
|
+
kind: string;
|
|
886
|
+
detail: string;
|
|
887
|
+
}
|
|
888
|
+
type NameRole = 'owner' | 'target';
|
|
889
|
+
type LabelMapper = (label: string) => string | null;
|
|
890
|
+
interface DelegationSigner {
|
|
891
|
+
keyTag: number;
|
|
892
|
+
algorithm: number;
|
|
893
|
+
digestType: number;
|
|
894
|
+
digest: string;
|
|
895
|
+
}
|
|
896
|
+
declare function useLabelMapper(mapper: LabelMapper): void;
|
|
897
|
+
declare function resetLabelMapper(): void;
|
|
898
|
+
declare function prepareName(input: string, role?: NameRole): string;
|
|
899
|
+
declare function isIpv4(text: string): boolean;
|
|
900
|
+
declare function isIpv6(text: string): boolean;
|
|
901
|
+
declare function readDelegationSigner(rdata: string): DelegationSigner;
|
|
902
|
+
declare function prepareRdata(kind: string, rdata: string, owner?: string): string;
|
|
903
|
+
declare function prepareEntry(entry: DnsEntry): DnsEntry;
|
|
904
|
+
declare function findCnameConflicts(entries: readonly DnsEntry[]): RecordClash[];
|
|
905
|
+
declare function findRepeatedRecords(entries: readonly DnsEntry[]): RecordClash[];
|
|
906
|
+
declare function toDnsEntry(record: DnsRecord, defaultTtl?: number): DnsEntry;
|
|
907
|
+
|
|
847
908
|
declare function parseXml<T = unknown>(xml: string, options?: Partial<X2jOptions>): T;
|
|
848
909
|
declare function ensureArray<T>(value: T | T[] | undefined | null): T[];
|
|
849
910
|
|
|
@@ -865,4 +926,4 @@ declare function normalizeNameservers(nameservers: unknown): string[];
|
|
|
865
926
|
declare function createDomain(data?: DomainInput): Domain;
|
|
866
927
|
declare function asRead<T extends RequestOptions>(opts?: T): T;
|
|
867
928
|
|
|
868
|
-
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 };
|
|
929
|
+
export { ALL_FEATURES, AbortError, AuthenticationError, AuthorizationError, BaseRegistrar, CORE_FEATURES, CloudflareRegistrar, type ConfigField, ConfigurationError, ConnectionError, type ConnectionResult, ConsentRequiredError, type Contact, type ContactSet, DEFAULT_OPTIONS, type DelegationSigner, type DnsEntry, type DnsRecord, DnsSyntaxError, type DnssecStatus, type Domain, Domain101Registrar, 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 LabelMapper, type ListDomainsOptions, MASKED_FORWARD_UNSUPPORTED, NameBrightRegistrar, type NameRole, NameSiloRegistrar, NamecheapRegistrar, NamecomRegistrar, NotFoundError, NotImplementedError, type OperationResult, OutcomeUnknownError, ParsingError, PorkbunRegistrar, type PortfolioError, type PortfolioResult, REST_SAFE_METHODS, RateLimitError, type RecordClash, 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, findCnameConflicts, findRepeatedRecords, isCoreFeature, isIpv4, isIpv6, listPortfolio, markNotSent, normalizeDomain, normalizeNameservers, parseDate, parseXml, prepareEntry, prepareName, prepareRdata, readDelegationSigner, registrars, requireConsent, resetLabelMapper, selectBaseUrl, settableForwards, sleep, toDnsEntry, toRegistrarError, useLabelMapper, wasNotSent };
|