@aoxborrow/registrar-client 0.10.1 → 0.12.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 +26 -0
- package/dist/index.cjs +276 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +35 -3
- package/dist/index.d.ts +35 -3
- package/dist/index.js +276 -14
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/features.ts +9 -0
- package/src/registrar.ts +13 -0
- package/src/registrars/dynadot.ts +137 -3
- package/src/registrars/gandi.ts +91 -3
- package/src/registrars/godaddy.ts +136 -8
- package/src/types.ts +38 -0
package/dist/index.d.cts
CHANGED
|
@@ -20,6 +20,9 @@ declare const Feature: {
|
|
|
20
20
|
readonly GetDnsRecords: "getDnsRecords";
|
|
21
21
|
readonly SetDnsRecords: "setDnsRecords";
|
|
22
22
|
readonly GetAuthCode: "getAuthCode";
|
|
23
|
+
readonly GetTransferOut: "getTransferOut";
|
|
24
|
+
readonly ApproveTransferOut: "approveTransferOut";
|
|
25
|
+
readonly RejectTransferOut: "rejectTransferOut";
|
|
23
26
|
readonly GetDnssec: "getDnssec";
|
|
24
27
|
readonly DisableDnssec: "disableDnssec";
|
|
25
28
|
readonly GetEmailForwarding: "getEmailForwarding";
|
|
@@ -29,8 +32,8 @@ declare const Feature: {
|
|
|
29
32
|
};
|
|
30
33
|
type RegistrarFeature = (typeof Feature)[keyof typeof Feature];
|
|
31
34
|
declare const CORE_FEATURES: readonly ["testConnection", "listDomains", "getDomain", "checkAvailability", "getPricing", "registerDomain", "renewDomain", "setAutoRenew", "transferIn", "updateNameservers", "getNameservers", "lockDomain", "unlockDomain", "setPrivacy", "getContacts", "updateContacts", "getDnsRecords", "setDnsRecords"];
|
|
32
|
-
declare const EXTENDED_FEATURES: readonly ["getAuthCode", "getDnssec", "disableDnssec", "getEmailForwarding", "setEmailForwarding", "getDomainForwarding", "setDomainForwarding"];
|
|
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"];
|
|
35
|
+
declare const EXTENDED_FEATURES: readonly ["getAuthCode", "getTransferOut", "approveTransferOut", "rejectTransferOut", "getDnssec", "disableDnssec", "getEmailForwarding", "setEmailForwarding", "getDomainForwarding", "setDomainForwarding"];
|
|
36
|
+
declare const ALL_FEATURES: readonly ["testConnection", "listDomains", "getDomain", "checkAvailability", "getPricing", "registerDomain", "renewDomain", "setAutoRenew", "transferIn", "updateNameservers", "getNameservers", "lockDomain", "unlockDomain", "setPrivacy", "getContacts", "updateContacts", "getDnsRecords", "setDnsRecords", "getAuthCode", "getTransferOut", "approveTransferOut", "rejectTransferOut", "getDnssec", "disableDnssec", "getEmailForwarding", "setEmailForwarding", "getDomainForwarding", "setDomainForwarding"];
|
|
34
37
|
declare function isCoreFeature(feature: RegistrarFeature): boolean;
|
|
35
38
|
declare const FEATURE_CALLS: Record<RegistrarFeature, {
|
|
36
39
|
intent: 'read' | 'write';
|
|
@@ -195,6 +198,16 @@ interface DnssecStatus {
|
|
|
195
198
|
enabled: boolean;
|
|
196
199
|
dsRecords: DsRecord[];
|
|
197
200
|
}
|
|
201
|
+
type TransferOutStatus = 'pending' | 'approved' | 'rejected' | 'completed' | 'cancelled' | 'unknown';
|
|
202
|
+
interface TransferOut {
|
|
203
|
+
status: TransferOutStatus;
|
|
204
|
+
rawStatus: string;
|
|
205
|
+
id?: string;
|
|
206
|
+
gainingRegistrar?: string;
|
|
207
|
+
requestedDate: Date | null;
|
|
208
|
+
expirationDate: Date | null;
|
|
209
|
+
completedDate: Date | null;
|
|
210
|
+
}
|
|
198
211
|
interface Registrar {
|
|
199
212
|
readonly name: string;
|
|
200
213
|
readonly environment: RegistrarEnvironment;
|
|
@@ -224,6 +237,9 @@ interface Registrar {
|
|
|
224
237
|
getDomainForwarding(domainName: string, opts?: RequestOptions): Promise<DomainForward[]>;
|
|
225
238
|
setDomainForwarding(domainName: string, forwards: DomainForward[], opts?: RequestOptions): Promise<OperationResult>;
|
|
226
239
|
getAuthCode(domainName: string, opts?: RequestOptions): Promise<string>;
|
|
240
|
+
getTransferOut(domainName: string, opts?: RequestOptions): Promise<TransferOut | null>;
|
|
241
|
+
approveTransferOut(domainName: string, opts?: RequestOptions): Promise<OperationResult>;
|
|
242
|
+
rejectTransferOut(domainName: string, opts?: RequestOptions): Promise<OperationResult>;
|
|
227
243
|
getDnssec(domainName: string, opts?: RequestOptions): Promise<DnssecStatus>;
|
|
228
244
|
disableDnssec(domainName: string, opts?: RequestOptions): Promise<OperationResult>;
|
|
229
245
|
}
|
|
@@ -427,6 +443,9 @@ declare abstract class BaseRegistrar implements Registrar {
|
|
|
427
443
|
getDomainForwarding(_domainName: string, _opts?: RequestOptions): Promise<DomainForward[]>;
|
|
428
444
|
setDomainForwarding(_domainName: string, _forwards: DomainForward[], _opts?: RequestOptions): Promise<OperationResult>;
|
|
429
445
|
getAuthCode(_domainName: string, _opts?: RequestOptions): Promise<string>;
|
|
446
|
+
getTransferOut(_domainName: string, _opts?: RequestOptions): Promise<TransferOut | null>;
|
|
447
|
+
approveTransferOut(_domainName: string, _opts?: RequestOptions): Promise<OperationResult>;
|
|
448
|
+
rejectTransferOut(_domainName: string, _opts?: RequestOptions): Promise<OperationResult>;
|
|
430
449
|
getDnssec(_domainName: string, _opts?: RequestOptions): Promise<DnssecStatus>;
|
|
431
450
|
disableDnssec(_domainName: string, _opts?: RequestOptions): Promise<OperationResult>;
|
|
432
451
|
protected notImplemented(method: string): Promise<never>;
|
|
@@ -538,6 +557,10 @@ declare class DynadotRegistrar extends BaseRegistrar {
|
|
|
538
557
|
updateContacts(domainName: string, contacts: ContactSet, opts?: RequestOptions): Promise<OperationResult>;
|
|
539
558
|
setDnsRecords(domainName: string, records: DnsRecord[], opts?: RequestOptions): Promise<OperationResult>;
|
|
540
559
|
getAuthCode(domainName: string, opts?: RequestOptions): Promise<string>;
|
|
560
|
+
getTransferOut(domainName: string, opts?: RequestOptions): Promise<TransferOut | null>;
|
|
561
|
+
approveTransferOut(domainName: string, opts?: RequestOptions): Promise<OperationResult>;
|
|
562
|
+
rejectTransferOut(domainName: string, opts?: RequestOptions): Promise<OperationResult>;
|
|
563
|
+
private authorizeTransferAway;
|
|
541
564
|
getDnssec(domainName: string, opts?: RequestOptions): Promise<DnssecStatus>;
|
|
542
565
|
disableDnssec(domainName: string, opts?: RequestOptions): Promise<OperationResult>;
|
|
543
566
|
getEmailForwarding(domainName: string, opts?: RequestOptions): Promise<EmailForward[]>;
|
|
@@ -571,6 +594,10 @@ declare class GandiRegistrar extends BaseRegistrar {
|
|
|
571
594
|
lockDomain(domainName: string, opts?: RequestOptions): Promise<OperationResult>;
|
|
572
595
|
unlockDomain(domainName: string, opts?: RequestOptions): Promise<OperationResult>;
|
|
573
596
|
getAuthCode(domainName: string, opts?: RequestOptions): Promise<string>;
|
|
597
|
+
getTransferOut(domainName: string, opts?: RequestOptions): Promise<TransferOut | null>;
|
|
598
|
+
approveTransferOut(domainName: string, opts?: RequestOptions): Promise<OperationResult>;
|
|
599
|
+
rejectTransferOut(domainName: string, opts?: RequestOptions): Promise<OperationResult>;
|
|
600
|
+
private answerTransferOut;
|
|
574
601
|
getDnssec(domainName: string, opts?: RequestOptions): Promise<DnssecStatus>;
|
|
575
602
|
disableDnssec(domainName: string, opts?: RequestOptions): Promise<OperationResult>;
|
|
576
603
|
getEmailForwarding(domainName: string, opts?: RequestOptions): Promise<EmailForward[]>;
|
|
@@ -630,6 +657,11 @@ declare class GoDaddyRegistrar extends BaseRegistrar {
|
|
|
630
657
|
getDomainForwarding(domainName: string, opts?: RequestOptions): Promise<DomainForward[]>;
|
|
631
658
|
setDomainForwarding(domainName: string, forwards: DomainForward[], opts?: RequestOptions): Promise<OperationResult>;
|
|
632
659
|
private forwardPath;
|
|
660
|
+
private domainPathV2;
|
|
661
|
+
getTransferOut(domainName: string, opts?: RequestOptions): Promise<TransferOut | null>;
|
|
662
|
+
approveTransferOut(domainName: string, opts?: RequestOptions): Promise<OperationResult>;
|
|
663
|
+
rejectTransferOut(domainName: string, opts?: RequestOptions): Promise<OperationResult>;
|
|
664
|
+
private answerTransferOut;
|
|
633
665
|
getAuthCode(domainName: string, opts?: RequestOptions): Promise<string>;
|
|
634
666
|
private toDomain;
|
|
635
667
|
private toDomainV3;
|
|
@@ -931,4 +963,4 @@ declare function createDomain(data?: DomainInput): Domain;
|
|
|
931
963
|
declare function asRead<T extends RequestOptions>(opts?: T): T;
|
|
932
964
|
|
|
933
965
|
export { ALL_FEATURES, AbortError, AuthenticationError, AuthorizationError, BaseRegistrar, CORE_FEATURES, CloudflareRegistrar, ConfigurationError, ConnectionError, ConsentRequiredError, DEFAULT_OPTIONS, DnsSyntaxError, Domain101Registrar, DynadotRegistrar, EXTENDED_FEATURES, FEATURE_CALLS, Feature, GandiRegistrar, GoDaddyRegistrar, HttpClient, InvalidResponseError, MASKED_FORWARD_UNSUPPORTED, NameBrightRegistrar, NameSiloRegistrar, NamecheapRegistrar, NamecomRegistrar, NotFoundError, NotImplementedError, OutcomeUnknownError, ParsingError, PorkbunRegistrar, REST_SAFE_METHODS, RateLimitError, RegistrarClient, RegistrarError, RetryableRegistrarError, SpaceshipRegistrar, TimeoutError, 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, unsupportedForwardHttps, useLabelMapper, wasNotSent };
|
|
934
|
-
export type { ConfigField, ConnectionResult, Contact, ContactSet, DelegationSigner, DnsEntry, DnsRecord, DnssecStatus, Domain, DomainAvailability, DomainForward, DomainForwardHttps, DomainForwardType, DomainInput, DomainSource, DsRecord, EmailForward, FeatureCall, HttpClientConfig, LabelMapper, ListDomainsOptions, NameRole, OperationResult, PortfolioError, PortfolioResult, RecordClash, RegisterDomainInput, Registrar, RegistrarClientOptions, RegistrarConstructor, RegistrarCredentials, RegistrarEnvironment, RegistrarFeature, RegistrarName, RegistrarOptions, RegistrationConsent, RequestConfig, RequestIntent, RequestOptions, SettableDomainForward, TldPricing, TransferDomainInput };
|
|
966
|
+
export type { ConfigField, ConnectionResult, Contact, ContactSet, DelegationSigner, DnsEntry, DnsRecord, DnssecStatus, Domain, DomainAvailability, DomainForward, DomainForwardHttps, DomainForwardType, DomainInput, DomainSource, DsRecord, EmailForward, FeatureCall, HttpClientConfig, LabelMapper, ListDomainsOptions, NameRole, OperationResult, PortfolioError, PortfolioResult, RecordClash, RegisterDomainInput, Registrar, RegistrarClientOptions, RegistrarConstructor, RegistrarCredentials, RegistrarEnvironment, RegistrarFeature, RegistrarName, RegistrarOptions, RegistrationConsent, RequestConfig, RequestIntent, RequestOptions, SettableDomainForward, TldPricing, TransferDomainInput, TransferOut, TransferOutStatus };
|
package/dist/index.d.ts
CHANGED
|
@@ -20,6 +20,9 @@ declare const Feature: {
|
|
|
20
20
|
readonly GetDnsRecords: "getDnsRecords";
|
|
21
21
|
readonly SetDnsRecords: "setDnsRecords";
|
|
22
22
|
readonly GetAuthCode: "getAuthCode";
|
|
23
|
+
readonly GetTransferOut: "getTransferOut";
|
|
24
|
+
readonly ApproveTransferOut: "approveTransferOut";
|
|
25
|
+
readonly RejectTransferOut: "rejectTransferOut";
|
|
23
26
|
readonly GetDnssec: "getDnssec";
|
|
24
27
|
readonly DisableDnssec: "disableDnssec";
|
|
25
28
|
readonly GetEmailForwarding: "getEmailForwarding";
|
|
@@ -29,8 +32,8 @@ declare const Feature: {
|
|
|
29
32
|
};
|
|
30
33
|
type RegistrarFeature = (typeof Feature)[keyof typeof Feature];
|
|
31
34
|
declare const CORE_FEATURES: readonly ["testConnection", "listDomains", "getDomain", "checkAvailability", "getPricing", "registerDomain", "renewDomain", "setAutoRenew", "transferIn", "updateNameservers", "getNameservers", "lockDomain", "unlockDomain", "setPrivacy", "getContacts", "updateContacts", "getDnsRecords", "setDnsRecords"];
|
|
32
|
-
declare const EXTENDED_FEATURES: readonly ["getAuthCode", "getDnssec", "disableDnssec", "getEmailForwarding", "setEmailForwarding", "getDomainForwarding", "setDomainForwarding"];
|
|
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"];
|
|
35
|
+
declare const EXTENDED_FEATURES: readonly ["getAuthCode", "getTransferOut", "approveTransferOut", "rejectTransferOut", "getDnssec", "disableDnssec", "getEmailForwarding", "setEmailForwarding", "getDomainForwarding", "setDomainForwarding"];
|
|
36
|
+
declare const ALL_FEATURES: readonly ["testConnection", "listDomains", "getDomain", "checkAvailability", "getPricing", "registerDomain", "renewDomain", "setAutoRenew", "transferIn", "updateNameservers", "getNameservers", "lockDomain", "unlockDomain", "setPrivacy", "getContacts", "updateContacts", "getDnsRecords", "setDnsRecords", "getAuthCode", "getTransferOut", "approveTransferOut", "rejectTransferOut", "getDnssec", "disableDnssec", "getEmailForwarding", "setEmailForwarding", "getDomainForwarding", "setDomainForwarding"];
|
|
34
37
|
declare function isCoreFeature(feature: RegistrarFeature): boolean;
|
|
35
38
|
declare const FEATURE_CALLS: Record<RegistrarFeature, {
|
|
36
39
|
intent: 'read' | 'write';
|
|
@@ -195,6 +198,16 @@ interface DnssecStatus {
|
|
|
195
198
|
enabled: boolean;
|
|
196
199
|
dsRecords: DsRecord[];
|
|
197
200
|
}
|
|
201
|
+
type TransferOutStatus = 'pending' | 'approved' | 'rejected' | 'completed' | 'cancelled' | 'unknown';
|
|
202
|
+
interface TransferOut {
|
|
203
|
+
status: TransferOutStatus;
|
|
204
|
+
rawStatus: string;
|
|
205
|
+
id?: string;
|
|
206
|
+
gainingRegistrar?: string;
|
|
207
|
+
requestedDate: Date | null;
|
|
208
|
+
expirationDate: Date | null;
|
|
209
|
+
completedDate: Date | null;
|
|
210
|
+
}
|
|
198
211
|
interface Registrar {
|
|
199
212
|
readonly name: string;
|
|
200
213
|
readonly environment: RegistrarEnvironment;
|
|
@@ -224,6 +237,9 @@ interface Registrar {
|
|
|
224
237
|
getDomainForwarding(domainName: string, opts?: RequestOptions): Promise<DomainForward[]>;
|
|
225
238
|
setDomainForwarding(domainName: string, forwards: DomainForward[], opts?: RequestOptions): Promise<OperationResult>;
|
|
226
239
|
getAuthCode(domainName: string, opts?: RequestOptions): Promise<string>;
|
|
240
|
+
getTransferOut(domainName: string, opts?: RequestOptions): Promise<TransferOut | null>;
|
|
241
|
+
approveTransferOut(domainName: string, opts?: RequestOptions): Promise<OperationResult>;
|
|
242
|
+
rejectTransferOut(domainName: string, opts?: RequestOptions): Promise<OperationResult>;
|
|
227
243
|
getDnssec(domainName: string, opts?: RequestOptions): Promise<DnssecStatus>;
|
|
228
244
|
disableDnssec(domainName: string, opts?: RequestOptions): Promise<OperationResult>;
|
|
229
245
|
}
|
|
@@ -427,6 +443,9 @@ declare abstract class BaseRegistrar implements Registrar {
|
|
|
427
443
|
getDomainForwarding(_domainName: string, _opts?: RequestOptions): Promise<DomainForward[]>;
|
|
428
444
|
setDomainForwarding(_domainName: string, _forwards: DomainForward[], _opts?: RequestOptions): Promise<OperationResult>;
|
|
429
445
|
getAuthCode(_domainName: string, _opts?: RequestOptions): Promise<string>;
|
|
446
|
+
getTransferOut(_domainName: string, _opts?: RequestOptions): Promise<TransferOut | null>;
|
|
447
|
+
approveTransferOut(_domainName: string, _opts?: RequestOptions): Promise<OperationResult>;
|
|
448
|
+
rejectTransferOut(_domainName: string, _opts?: RequestOptions): Promise<OperationResult>;
|
|
430
449
|
getDnssec(_domainName: string, _opts?: RequestOptions): Promise<DnssecStatus>;
|
|
431
450
|
disableDnssec(_domainName: string, _opts?: RequestOptions): Promise<OperationResult>;
|
|
432
451
|
protected notImplemented(method: string): Promise<never>;
|
|
@@ -538,6 +557,10 @@ declare class DynadotRegistrar extends BaseRegistrar {
|
|
|
538
557
|
updateContacts(domainName: string, contacts: ContactSet, opts?: RequestOptions): Promise<OperationResult>;
|
|
539
558
|
setDnsRecords(domainName: string, records: DnsRecord[], opts?: RequestOptions): Promise<OperationResult>;
|
|
540
559
|
getAuthCode(domainName: string, opts?: RequestOptions): Promise<string>;
|
|
560
|
+
getTransferOut(domainName: string, opts?: RequestOptions): Promise<TransferOut | null>;
|
|
561
|
+
approveTransferOut(domainName: string, opts?: RequestOptions): Promise<OperationResult>;
|
|
562
|
+
rejectTransferOut(domainName: string, opts?: RequestOptions): Promise<OperationResult>;
|
|
563
|
+
private authorizeTransferAway;
|
|
541
564
|
getDnssec(domainName: string, opts?: RequestOptions): Promise<DnssecStatus>;
|
|
542
565
|
disableDnssec(domainName: string, opts?: RequestOptions): Promise<OperationResult>;
|
|
543
566
|
getEmailForwarding(domainName: string, opts?: RequestOptions): Promise<EmailForward[]>;
|
|
@@ -571,6 +594,10 @@ declare class GandiRegistrar extends BaseRegistrar {
|
|
|
571
594
|
lockDomain(domainName: string, opts?: RequestOptions): Promise<OperationResult>;
|
|
572
595
|
unlockDomain(domainName: string, opts?: RequestOptions): Promise<OperationResult>;
|
|
573
596
|
getAuthCode(domainName: string, opts?: RequestOptions): Promise<string>;
|
|
597
|
+
getTransferOut(domainName: string, opts?: RequestOptions): Promise<TransferOut | null>;
|
|
598
|
+
approveTransferOut(domainName: string, opts?: RequestOptions): Promise<OperationResult>;
|
|
599
|
+
rejectTransferOut(domainName: string, opts?: RequestOptions): Promise<OperationResult>;
|
|
600
|
+
private answerTransferOut;
|
|
574
601
|
getDnssec(domainName: string, opts?: RequestOptions): Promise<DnssecStatus>;
|
|
575
602
|
disableDnssec(domainName: string, opts?: RequestOptions): Promise<OperationResult>;
|
|
576
603
|
getEmailForwarding(domainName: string, opts?: RequestOptions): Promise<EmailForward[]>;
|
|
@@ -630,6 +657,11 @@ declare class GoDaddyRegistrar extends BaseRegistrar {
|
|
|
630
657
|
getDomainForwarding(domainName: string, opts?: RequestOptions): Promise<DomainForward[]>;
|
|
631
658
|
setDomainForwarding(domainName: string, forwards: DomainForward[], opts?: RequestOptions): Promise<OperationResult>;
|
|
632
659
|
private forwardPath;
|
|
660
|
+
private domainPathV2;
|
|
661
|
+
getTransferOut(domainName: string, opts?: RequestOptions): Promise<TransferOut | null>;
|
|
662
|
+
approveTransferOut(domainName: string, opts?: RequestOptions): Promise<OperationResult>;
|
|
663
|
+
rejectTransferOut(domainName: string, opts?: RequestOptions): Promise<OperationResult>;
|
|
664
|
+
private answerTransferOut;
|
|
633
665
|
getAuthCode(domainName: string, opts?: RequestOptions): Promise<string>;
|
|
634
666
|
private toDomain;
|
|
635
667
|
private toDomainV3;
|
|
@@ -931,4 +963,4 @@ declare function createDomain(data?: DomainInput): Domain;
|
|
|
931
963
|
declare function asRead<T extends RequestOptions>(opts?: T): T;
|
|
932
964
|
|
|
933
965
|
export { ALL_FEATURES, AbortError, AuthenticationError, AuthorizationError, BaseRegistrar, CORE_FEATURES, CloudflareRegistrar, ConfigurationError, ConnectionError, ConsentRequiredError, DEFAULT_OPTIONS, DnsSyntaxError, Domain101Registrar, DynadotRegistrar, EXTENDED_FEATURES, FEATURE_CALLS, Feature, GandiRegistrar, GoDaddyRegistrar, HttpClient, InvalidResponseError, MASKED_FORWARD_UNSUPPORTED, NameBrightRegistrar, NameSiloRegistrar, NamecheapRegistrar, NamecomRegistrar, NotFoundError, NotImplementedError, OutcomeUnknownError, ParsingError, PorkbunRegistrar, REST_SAFE_METHODS, RateLimitError, RegistrarClient, RegistrarError, RetryableRegistrarError, SpaceshipRegistrar, TimeoutError, 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, unsupportedForwardHttps, useLabelMapper, wasNotSent };
|
|
934
|
-
export type { ConfigField, ConnectionResult, Contact, ContactSet, DelegationSigner, DnsEntry, DnsRecord, DnssecStatus, Domain, DomainAvailability, DomainForward, DomainForwardHttps, DomainForwardType, DomainInput, DomainSource, DsRecord, EmailForward, FeatureCall, HttpClientConfig, LabelMapper, ListDomainsOptions, NameRole, OperationResult, PortfolioError, PortfolioResult, RecordClash, RegisterDomainInput, Registrar, RegistrarClientOptions, RegistrarConstructor, RegistrarCredentials, RegistrarEnvironment, RegistrarFeature, RegistrarName, RegistrarOptions, RegistrationConsent, RequestConfig, RequestIntent, RequestOptions, SettableDomainForward, TldPricing, TransferDomainInput };
|
|
966
|
+
export type { ConfigField, ConnectionResult, Contact, ContactSet, DelegationSigner, DnsEntry, DnsRecord, DnssecStatus, Domain, DomainAvailability, DomainForward, DomainForwardHttps, DomainForwardType, DomainInput, DomainSource, DsRecord, EmailForward, FeatureCall, HttpClientConfig, LabelMapper, ListDomainsOptions, NameRole, OperationResult, PortfolioError, PortfolioResult, RecordClash, RegisterDomainInput, Registrar, RegistrarClientOptions, RegistrarConstructor, RegistrarCredentials, RegistrarEnvironment, RegistrarFeature, RegistrarName, RegistrarOptions, RegistrationConsent, RequestConfig, RequestIntent, RequestOptions, SettableDomainForward, TldPricing, TransferDomainInput, TransferOut, TransferOutStatus };
|
package/dist/index.js
CHANGED
|
@@ -683,6 +683,12 @@ var Feature = {
|
|
|
683
683
|
// --- extended (opt-in; declared per provider) ---
|
|
684
684
|
GetAuthCode: "getAuthCode",
|
|
685
685
|
// retrieve transfer auth/EPP code (transfer out)
|
|
686
|
+
GetTransferOut: "getTransferOut",
|
|
687
|
+
// read an outbound transfer another registrar requested
|
|
688
|
+
ApproveTransferOut: "approveTransferOut",
|
|
689
|
+
// release a pending outbound transfer now
|
|
690
|
+
RejectTransferOut: "rejectTransferOut",
|
|
691
|
+
// refuse a pending outbound transfer
|
|
686
692
|
GetDnssec: "getDnssec",
|
|
687
693
|
// read whether DNSSEC is enabled (DS / key records)
|
|
688
694
|
DisableDnssec: "disableDnssec",
|
|
@@ -718,6 +724,9 @@ var CORE_FEATURES = [
|
|
|
718
724
|
];
|
|
719
725
|
var EXTENDED_FEATURES = [
|
|
720
726
|
Feature.GetAuthCode,
|
|
727
|
+
Feature.GetTransferOut,
|
|
728
|
+
Feature.ApproveTransferOut,
|
|
729
|
+
Feature.RejectTransferOut,
|
|
721
730
|
Feature.GetDnssec,
|
|
722
731
|
Feature.DisableDnssec,
|
|
723
732
|
Feature.GetEmailForwarding,
|
|
@@ -750,6 +759,9 @@ var FEATURE_CALLS = {
|
|
|
750
759
|
getDnsRecords: { intent: "read", optsIndex: 1 },
|
|
751
760
|
setDnsRecords: { intent: "write", optsIndex: 2 },
|
|
752
761
|
getAuthCode: { intent: "write", optsIndex: 1 },
|
|
762
|
+
getTransferOut: { intent: "read", optsIndex: 1 },
|
|
763
|
+
approveTransferOut: { intent: "write", optsIndex: 1 },
|
|
764
|
+
rejectTransferOut: { intent: "write", optsIndex: 1 },
|
|
753
765
|
getDnssec: { intent: "read", optsIndex: 1 },
|
|
754
766
|
disableDnssec: { intent: "write", optsIndex: 1 },
|
|
755
767
|
getEmailForwarding: { intent: "read", optsIndex: 1 },
|
|
@@ -911,6 +923,15 @@ var BaseRegistrar = class {
|
|
|
911
923
|
getAuthCode(_domainName, _opts) {
|
|
912
924
|
return this.notImplemented("getAuthCode");
|
|
913
925
|
}
|
|
926
|
+
getTransferOut(_domainName, _opts) {
|
|
927
|
+
return this.notImplemented("getTransferOut");
|
|
928
|
+
}
|
|
929
|
+
approveTransferOut(_domainName, _opts) {
|
|
930
|
+
return this.notImplemented("approveTransferOut");
|
|
931
|
+
}
|
|
932
|
+
rejectTransferOut(_domainName, _opts) {
|
|
933
|
+
return this.notImplemented("rejectTransferOut");
|
|
934
|
+
}
|
|
914
935
|
getDnssec(_domainName, _opts) {
|
|
915
936
|
return this.notImplemented("getDnssec");
|
|
916
937
|
}
|
|
@@ -2331,11 +2352,16 @@ var DynadotRegistrar = class extends BaseRegistrar {
|
|
|
2331
2352
|
];
|
|
2332
2353
|
static supportsSandbox = true;
|
|
2333
2354
|
// api-sandbox.dynadot.com mirrors the API
|
|
2334
|
-
// On top of core: transfer-out auth code, DNSSEC read/disable,
|
|
2335
|
-
// domain (URL) forwarding. All implemented on the v2 transport and
|
|
2336
|
-
// the Dynadot sandbox
|
|
2355
|
+
// On top of core: transfer-out auth code and approval, DNSSEC read/disable,
|
|
2356
|
+
// and email + domain (URL) forwarding. All implemented on the v2 transport and
|
|
2357
|
+
// verified in the Dynadot sandbox (transfer-out approval only up to "no such
|
|
2358
|
+
// order": the sandbox can't create an outbound transfer; a real pending
|
|
2359
|
+
// one's read was checked in production).
|
|
2337
2360
|
static extendedFeatures = [
|
|
2338
2361
|
Feature.GetAuthCode,
|
|
2362
|
+
Feature.GetTransferOut,
|
|
2363
|
+
Feature.ApproveTransferOut,
|
|
2364
|
+
Feature.RejectTransferOut,
|
|
2339
2365
|
Feature.GetDnssec,
|
|
2340
2366
|
Feature.DisableDnssec,
|
|
2341
2367
|
Feature.GetEmailForwarding,
|
|
@@ -2806,6 +2832,64 @@ ${bodyStr}`;
|
|
|
2806
2832
|
);
|
|
2807
2833
|
return data.auth_code ?? "";
|
|
2808
2834
|
}
|
|
2835
|
+
/**
|
|
2836
|
+
* The domain's latest outbound transfer via GET .../transfer_status with
|
|
2837
|
+
* `transfer_type=transfer_away`, which lists its transfer-away orders. Dynadot
|
|
2838
|
+
* answers 404 when there are none (and for a domain not in the account), read
|
|
2839
|
+
* here as null. An open order wins over a newer finished one, so approve and
|
|
2840
|
+
* reject act on the order that can still be answered.
|
|
2841
|
+
*/
|
|
2842
|
+
async getTransferOut(domainName, opts) {
|
|
2843
|
+
let env;
|
|
2844
|
+
try {
|
|
2845
|
+
env = await this.signedRequest(
|
|
2846
|
+
"GET",
|
|
2847
|
+
`/restful/v2/domains/${encodeURIComponent(domainName)}/transfer_status?transfer_type=transfer_away`,
|
|
2848
|
+
void 0,
|
|
2849
|
+
opts
|
|
2850
|
+
);
|
|
2851
|
+
} catch (error) {
|
|
2852
|
+
if (error instanceof NotFoundError) return null;
|
|
2853
|
+
throw error;
|
|
2854
|
+
}
|
|
2855
|
+
if (env.code === 404) return null;
|
|
2856
|
+
if (!isOk(env.code)) {
|
|
2857
|
+
throw new Error(env.error?.description ?? env.message ?? "Dynadot request failed");
|
|
2858
|
+
}
|
|
2859
|
+
const transfers = (env.data?.domain_transfer_status_list ?? []).map(toTransferOut).sort((a, b) => (b.requestedDate?.getTime() ?? 0) - (a.requestedDate?.getTime() ?? 0));
|
|
2860
|
+
return transfers.find((t) => OPEN_TRANSFER_OUT.has(t.status)) ?? transfers[0] ?? null;
|
|
2861
|
+
}
|
|
2862
|
+
/**
|
|
2863
|
+
* Approves the pending outbound transfer, releasing the domain now instead of
|
|
2864
|
+
* after Dynadot's 5-day wait. Answers the order `getTransferOut` reports.
|
|
2865
|
+
*/
|
|
2866
|
+
async approveTransferOut(domainName, opts) {
|
|
2867
|
+
return this.authorizeTransferAway(domainName, true, opts);
|
|
2868
|
+
}
|
|
2869
|
+
// Denies the pending outbound transfer; the domain stays in the account.
|
|
2870
|
+
async rejectTransferOut(domainName, opts) {
|
|
2871
|
+
return this.authorizeTransferAway(domainName, false, opts);
|
|
2872
|
+
}
|
|
2873
|
+
// POST /orders/{order_id}/authorize_transfer_away with `approve` true or
|
|
2874
|
+
// false. Dynadot answers 409 when the order is no longer waiting on the owner.
|
|
2875
|
+
async authorizeTransferAway(domainName, approve, opts) {
|
|
2876
|
+
let transfer;
|
|
2877
|
+
try {
|
|
2878
|
+
transfer = await this.getTransferOut(domainName, opts);
|
|
2879
|
+
} catch (error) {
|
|
2880
|
+
return { success: false, message: toRegistrarError(error).message };
|
|
2881
|
+
}
|
|
2882
|
+
if (!transfer?.id) {
|
|
2883
|
+
return { success: false, message: `No transfer-out of ${domainName} to answer` };
|
|
2884
|
+
}
|
|
2885
|
+
return this.mutate(
|
|
2886
|
+
"POST",
|
|
2887
|
+
`/restful/v2/orders/${encodeURIComponent(transfer.id)}/authorize_transfer_away`,
|
|
2888
|
+
{ domain_name: domainName, approve },
|
|
2889
|
+
`Transfer of ${domainName} ${approve ? "approved" : "rejected"}`,
|
|
2890
|
+
opts
|
|
2891
|
+
);
|
|
2892
|
+
}
|
|
2809
2893
|
/**
|
|
2810
2894
|
* DNSSEC status via GET .../dnssec, which returns a list of DS records
|
|
2811
2895
|
* (`dnssec_info_list`); a non-empty list means DNSSEC is enabled. `algorithm`
|
|
@@ -2954,6 +3038,32 @@ async function hmacSha256Base64(secret, message) {
|
|
|
2954
3038
|
for (const byte of new Uint8Array(signature)) binary += String.fromCharCode(byte);
|
|
2955
3039
|
return btoa(binary);
|
|
2956
3040
|
}
|
|
3041
|
+
var OPEN_TRANSFER_OUT = /* @__PURE__ */ new Set(["pending", "unknown"]);
|
|
3042
|
+
function toTransferOut(t) {
|
|
3043
|
+
const rawStatus = t.transfer_status ?? "";
|
|
3044
|
+
let status = transferOutStatus(rawStatus);
|
|
3045
|
+
if (status === "unknown" && msDate(t.order_completed_date)) status = "completed";
|
|
3046
|
+
return {
|
|
3047
|
+
status,
|
|
3048
|
+
rawStatus,
|
|
3049
|
+
id: str(t.order_id) || void 0,
|
|
3050
|
+
requestedDate: msDate(t.order_created_date),
|
|
3051
|
+
expirationDate: msDate(t.expiration_date),
|
|
3052
|
+
completedDate: msDate(t.order_completed_date)
|
|
3053
|
+
};
|
|
3054
|
+
}
|
|
3055
|
+
function transferOutStatus(label) {
|
|
3056
|
+
const s = label.toLowerCase();
|
|
3057
|
+
if (/den(y|ied)|reject|refus|not approved|nack/.test(s)) return "rejected";
|
|
3058
|
+
if (/cancel|fail|expire|time ?out|abort/.test(s)) return "cancelled";
|
|
3059
|
+
if (/complete|transferr?ed|success/.test(s)) return "completed";
|
|
3060
|
+
if (/pend|wait|await|need|request|none|new|process|hold|review/.test(s)) return "pending";
|
|
3061
|
+
if (/approv|authori[sz]|accept/.test(s)) return "approved";
|
|
3062
|
+
return "unknown";
|
|
3063
|
+
}
|
|
3064
|
+
function msDate(ms) {
|
|
3065
|
+
return typeof ms === "number" && ms > 0 ? new Date(ms) : null;
|
|
3066
|
+
}
|
|
2957
3067
|
function isOk(code) {
|
|
2958
3068
|
return code != null && code >= 200 && code < 300;
|
|
2959
3069
|
}
|
|
@@ -3100,9 +3210,9 @@ var GandiRegistrar = class extends BaseRegistrar {
|
|
|
3100
3210
|
];
|
|
3101
3211
|
// Gandi's v5 API offers a sandbox at api.sandbox.gandi.net (separate account)
|
|
3102
3212
|
static supportsSandbox = true;
|
|
3103
|
-
// On top of core: transfer-out auth code (`authinfo`), DNSSEC
|
|
3104
|
-
// (LiveDNS keys), email forwarding, and web/URL forwarding
|
|
3105
|
-
// per host, apex included). Note core `setPrivacy` disabling is a no-op for
|
|
3213
|
+
// On top of core: transfer-out auth code (`authinfo`) and approval, DNSSEC
|
|
3214
|
+
// read/disable (LiveDNS keys), email forwarding, and web/URL forwarding
|
|
3215
|
+
// (webredirs; per host, apex included). Note core `setPrivacy` disabling is a no-op for
|
|
3106
3216
|
// individual (natural-person) registrants — Gandi keeps WHOIS obfuscation on
|
|
3107
3217
|
// for GDPR regardless of the request.
|
|
3108
3218
|
static extendedFeatures = [
|
|
@@ -3112,7 +3222,10 @@ var GandiRegistrar = class extends BaseRegistrar {
|
|
|
3112
3222
|
Feature.GetEmailForwarding,
|
|
3113
3223
|
Feature.SetEmailForwarding,
|
|
3114
3224
|
Feature.GetDomainForwarding,
|
|
3115
|
-
Feature.SetDomainForwarding
|
|
3225
|
+
Feature.SetDomainForwarding,
|
|
3226
|
+
Feature.GetTransferOut,
|
|
3227
|
+
Feature.ApproveTransferOut,
|
|
3228
|
+
Feature.RejectTransferOut
|
|
3116
3229
|
];
|
|
3117
3230
|
constructor(credentials, options) {
|
|
3118
3231
|
super(
|
|
@@ -3364,6 +3477,58 @@ var GandiRegistrar = class extends BaseRegistrar {
|
|
|
3364
3477
|
});
|
|
3365
3478
|
return d.authinfo ?? "";
|
|
3366
3479
|
}
|
|
3480
|
+
/**
|
|
3481
|
+
* The domain's pending outbound transfer. Gandi has no transfer-out resource
|
|
3482
|
+
* to read: a domain in the account carries the documented `pendingTransfer`
|
|
3483
|
+
* EPP status while another registrar's request waits (inbound transfers live
|
|
3484
|
+
* under /domain/transferin, so on a domain you hold it's outbound — inferred,
|
|
3485
|
+
* not documented). Gandi reports no dates for it, and nothing once it's
|
|
3486
|
+
* answered or done, so this reads `pending` or null.
|
|
3487
|
+
*/
|
|
3488
|
+
async getTransferOut(domainName, opts) {
|
|
3489
|
+
const d = await this.http.request({
|
|
3490
|
+
path: `/domain/domains/${domainName}`,
|
|
3491
|
+
...opts
|
|
3492
|
+
});
|
|
3493
|
+
return pendingTransferOut(d);
|
|
3494
|
+
}
|
|
3495
|
+
/**
|
|
3496
|
+
* Approves the pending outbound transfer, releasing the domain now instead of
|
|
3497
|
+
* after Gandi's five days: POST .../transferout with `accept: true` and the
|
|
3498
|
+
* domain's current auth code, which Gandi requires back (→ 202).
|
|
3499
|
+
*/
|
|
3500
|
+
async approveTransferOut(domainName, opts) {
|
|
3501
|
+
return this.answerTransferOut(domainName, true, opts);
|
|
3502
|
+
}
|
|
3503
|
+
// Declines the pending outbound transfer (`accept: false`, no reason); the
|
|
3504
|
+
// domain stays in the account.
|
|
3505
|
+
async rejectTransferOut(domainName, opts) {
|
|
3506
|
+
return this.answerTransferOut(domainName, false, opts);
|
|
3507
|
+
}
|
|
3508
|
+
// One read for both the pending status and the auth code the answer needs.
|
|
3509
|
+
async answerTransferOut(domainName, accept, opts) {
|
|
3510
|
+
let d;
|
|
3511
|
+
try {
|
|
3512
|
+
d = await this.http.request({
|
|
3513
|
+
path: `/domain/domains/${domainName}`,
|
|
3514
|
+
...opts
|
|
3515
|
+
});
|
|
3516
|
+
} catch (error) {
|
|
3517
|
+
return { success: false, message: toRegistrarError(error).message };
|
|
3518
|
+
}
|
|
3519
|
+
if (!pendingTransferOut(d)) {
|
|
3520
|
+
return { success: false, message: `No transfer-out of ${domainName} to answer` };
|
|
3521
|
+
}
|
|
3522
|
+
return this.mutate(
|
|
3523
|
+
{
|
|
3524
|
+
method: "POST",
|
|
3525
|
+
path: `/domain/domains/${domainName}/transferout`,
|
|
3526
|
+
body: { accept, authinfo: d.authinfo ?? "" }
|
|
3527
|
+
},
|
|
3528
|
+
`Transfer of ${domainName} ${accept ? "approved" : "rejected"}`,
|
|
3529
|
+
opts
|
|
3530
|
+
);
|
|
3531
|
+
}
|
|
3367
3532
|
/**
|
|
3368
3533
|
* DNSSEC status via Gandi LiveDNS keys (GET /livedns/domains/{fqdn}/keys). A
|
|
3369
3534
|
* non-deleted key means DNSSEC is enabled; each key's `ds` field is the full DS
|
|
@@ -3731,6 +3896,17 @@ var GandiRegistrar = class extends BaseRegistrar {
|
|
|
3731
3896
|
}
|
|
3732
3897
|
}
|
|
3733
3898
|
};
|
|
3899
|
+
function pendingTransferOut(d) {
|
|
3900
|
+
const statuses = Array.isArray(d.status) ? d.status : d.status ? [d.status] : [];
|
|
3901
|
+
if (!statuses.includes("pendingTransfer")) return null;
|
|
3902
|
+
return {
|
|
3903
|
+
status: "pending",
|
|
3904
|
+
rawStatus: "pendingTransfer",
|
|
3905
|
+
requestedDate: null,
|
|
3906
|
+
expirationDate: null,
|
|
3907
|
+
completedDate: null
|
|
3908
|
+
};
|
|
3909
|
+
}
|
|
3734
3910
|
function toGandiContact(c) {
|
|
3735
3911
|
const contact = {
|
|
3736
3912
|
given: c.firstName,
|
|
@@ -3871,17 +4047,22 @@ var GoDaddyRegistrar = class _GoDaddyRegistrar extends BaseRegistrar {
|
|
|
3871
4047
|
];
|
|
3872
4048
|
// GoDaddy's OTE ("Operational Test Environment") is its sandbox
|
|
3873
4049
|
static supportsSandbox = true;
|
|
3874
|
-
// Beyond core: domain forwarding
|
|
3875
|
-
// field on the v1 domain-detail response)
|
|
3876
|
-
// customer-scoped route
|
|
3877
|
-
//
|
|
3878
|
-
//
|
|
4050
|
+
// Beyond core: domain forwarding, transfer-out auth code (the `authCode`
|
|
4051
|
+
// field on the v1 domain-detail response) and transfer-out approval.
|
|
4052
|
+
// Forwarding uses the v2 customer-scoped route
|
|
4053
|
+
// /v2/customers/{customerId}/domains/forwards/{fqdn} (the old v1
|
|
4054
|
+
// /v1/domains/forwards routes now 404); it requires `customerId` to be
|
|
4055
|
+
// configured — verified live 2026-08-29. Transfer-out approval is v2
|
|
4056
|
+
// customer-scoped too, so it needs `customerId` as well. DNSSEC has no dedicated
|
|
3879
4057
|
// endpoint (DS records go through the generic DNS API), and there's no
|
|
3880
4058
|
// glue-record, email, or push-webhook API.
|
|
3881
4059
|
static extendedFeatures = [
|
|
3882
4060
|
Feature.GetAuthCode,
|
|
3883
4061
|
Feature.GetDomainForwarding,
|
|
3884
|
-
Feature.SetDomainForwarding
|
|
4062
|
+
Feature.SetDomainForwarding,
|
|
4063
|
+
Feature.GetTransferOut,
|
|
4064
|
+
Feature.ApproveTransferOut,
|
|
4065
|
+
Feature.RejectTransferOut
|
|
3885
4066
|
];
|
|
3886
4067
|
// true → prefer the v3 API (production + PAT). false → all calls use v1
|
|
3887
4068
|
// (sso-key auth, or OTE/sandbox where v3 does not exist).
|
|
@@ -4482,7 +4663,7 @@ var GoDaddyRegistrar = class _GoDaddyRegistrar extends BaseRegistrar {
|
|
|
4482
4663
|
const configured = this.credentials.customerId?.trim();
|
|
4483
4664
|
if (!configured) {
|
|
4484
4665
|
throw new ConfigurationError(
|
|
4485
|
-
`${this.name}: domain forwarding
|
|
4666
|
+
`${this.name}: domain forwarding and transfer-out approval use the v2 customer-scoped API, which requires a customer ID. Set \`customerId\` to your GoDaddy customer UUID (or your numeric shopper/account ID, which will be resolved to the UUID).`
|
|
4486
4667
|
);
|
|
4487
4668
|
}
|
|
4488
4669
|
if (UUID_RE.test(configured)) return configured;
|
|
@@ -4582,6 +4763,52 @@ var GoDaddyRegistrar = class _GoDaddyRegistrar extends BaseRegistrar {
|
|
|
4582
4763
|
forwardPath(customerId, fqdn) {
|
|
4583
4764
|
return `/v2/customers/${encodeURIComponent(customerId)}/domains/forwards/${encodeURIComponent(fqdn)}`;
|
|
4584
4765
|
}
|
|
4766
|
+
// the v2 customer-scoped path for a domain
|
|
4767
|
+
domainPathV2(customerId, domainName) {
|
|
4768
|
+
return `/v2/customers/${encodeURIComponent(customerId)}/domains/${encodeURIComponent(domainName)}`;
|
|
4769
|
+
}
|
|
4770
|
+
/**
|
|
4771
|
+
* The domain's latest outbound transfer, read from its recent actions
|
|
4772
|
+
* (GET /v2/customers/{customerId}/domains/{domain}/actions): the TRANSFER_OUT
|
|
4773
|
+
* action, and an accept or reject logged after it. Null when there is no
|
|
4774
|
+
* TRANSFER_OUT on record. GoDaddy reports no expiry; left alone, it releases
|
|
4775
|
+
* the domain within seven days. Shapes from the published v2 spec; a real
|
|
4776
|
+
* transfer-out is not yet seen live.
|
|
4777
|
+
*/
|
|
4778
|
+
async getTransferOut(domainName, opts) {
|
|
4779
|
+
const customerId = await this.resolveCustomerId(opts);
|
|
4780
|
+
const actions = await this.http.request({
|
|
4781
|
+
path: `${this.domainPathV2(customerId, domainName)}/actions`,
|
|
4782
|
+
...opts
|
|
4783
|
+
});
|
|
4784
|
+
return toTransferOut2(Array.isArray(actions) ? actions : []);
|
|
4785
|
+
}
|
|
4786
|
+
/**
|
|
4787
|
+
* Approves the pending outbound transfer, releasing the domain now
|
|
4788
|
+
* (POST .../transferOutAccept → 202). GoDaddy answers 409 when none is
|
|
4789
|
+
* pending.
|
|
4790
|
+
*/
|
|
4791
|
+
async approveTransferOut(domainName, opts) {
|
|
4792
|
+
return this.answerTransferOut(domainName, "transferOutAccept", "approved", opts);
|
|
4793
|
+
}
|
|
4794
|
+
// Rejects the pending outbound transfer (POST .../transferOutReject, with no
|
|
4795
|
+
// reason); the domain stays in the account.
|
|
4796
|
+
async rejectTransferOut(domainName, opts) {
|
|
4797
|
+
return this.answerTransferOut(domainName, "transferOutReject", "rejected", opts);
|
|
4798
|
+
}
|
|
4799
|
+
async answerTransferOut(domainName, action, answer, opts) {
|
|
4800
|
+
let customerId;
|
|
4801
|
+
try {
|
|
4802
|
+
customerId = await this.resolveCustomerId(opts);
|
|
4803
|
+
} catch (error) {
|
|
4804
|
+
return { success: false, message: toRegistrarError(error).message };
|
|
4805
|
+
}
|
|
4806
|
+
return this.mutate(
|
|
4807
|
+
{ method: "POST", path: `${this.domainPathV2(customerId, domainName)}/${action}` },
|
|
4808
|
+
`Transfer of ${domainName} ${answer}`,
|
|
4809
|
+
opts
|
|
4810
|
+
);
|
|
4811
|
+
}
|
|
4585
4812
|
/**
|
|
4586
4813
|
* Transfer authorization (EPP) code. GoDaddy exposes it as the `authCode`
|
|
4587
4814
|
* field on the v1 domain-detail response; transfers were never moved to v3,
|
|
@@ -4638,6 +4865,41 @@ var GoDaddyRegistrar = class _GoDaddyRegistrar extends BaseRegistrar {
|
|
|
4638
4865
|
}
|
|
4639
4866
|
}
|
|
4640
4867
|
};
|
|
4868
|
+
function toTransferOut2(actions) {
|
|
4869
|
+
const time = (a) => parseDate(a.createdAt)?.getTime() ?? 0;
|
|
4870
|
+
const byLatest = (types) => actions.filter((a) => types.includes(a.type ?? "")).sort((a, b) => time(b) - time(a));
|
|
4871
|
+
const transfer = byLatest(["TRANSFER_OUT"])[0];
|
|
4872
|
+
if (!transfer) return null;
|
|
4873
|
+
const answer = byLatest(["TRANSFER_OUT_ACCEPT", "TRANSFER_OUT_REJECT"]).find(
|
|
4874
|
+
(a) => time(a) >= time(transfer) && !/^(FAILED|CANCELLED)$/i.test(a.status ?? "")
|
|
4875
|
+
);
|
|
4876
|
+
const rejected = answer?.type === "TRANSFER_OUT_REJECT";
|
|
4877
|
+
const rawStatus = transfer.status ?? "";
|
|
4878
|
+
let status;
|
|
4879
|
+
switch (rawStatus.toUpperCase()) {
|
|
4880
|
+
case "ACCEPTED":
|
|
4881
|
+
case "AWAITING":
|
|
4882
|
+
case "PENDING":
|
|
4883
|
+
status = !answer ? "pending" : rejected ? "rejected" : "approved";
|
|
4884
|
+
break;
|
|
4885
|
+
case "SUCCESS":
|
|
4886
|
+
status = "completed";
|
|
4887
|
+
break;
|
|
4888
|
+
case "FAILED":
|
|
4889
|
+
case "CANCELLED":
|
|
4890
|
+
status = rejected ? "rejected" : "cancelled";
|
|
4891
|
+
break;
|
|
4892
|
+
default:
|
|
4893
|
+
status = "unknown";
|
|
4894
|
+
}
|
|
4895
|
+
return {
|
|
4896
|
+
status,
|
|
4897
|
+
rawStatus,
|
|
4898
|
+
requestedDate: parseDate(transfer.createdAt),
|
|
4899
|
+
expirationDate: null,
|
|
4900
|
+
completedDate: status === "completed" ? parseDate(transfer.completedAt) : null
|
|
4901
|
+
};
|
|
4902
|
+
}
|
|
4641
4903
|
function fromGoDaddyContact(c) {
|
|
4642
4904
|
if (!c) return void 0;
|
|
4643
4905
|
const a = c.addressMailing ?? {};
|