@fwgapps/namecheap 0.4.1 → 0.6.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 +7 -17
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +87 -123
- package/dist/index.d.ts +87 -123
- package/dist/index.global.js +5 -0
- package/dist/index.global.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +12 -6
package/dist/index.d.cts
CHANGED
|
@@ -14,7 +14,7 @@ interface NamecheapProps {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
interface Paging {
|
|
17
|
-
|
|
17
|
+
totalItems: number;
|
|
18
18
|
currentPage: number;
|
|
19
19
|
pageSize: number;
|
|
20
20
|
paging: boolean;
|
|
@@ -40,22 +40,22 @@ interface Contacts {
|
|
|
40
40
|
auxBilling: ContactDetail;
|
|
41
41
|
}
|
|
42
42
|
interface ContactDetail {
|
|
43
|
-
organizationName
|
|
44
|
-
jobTitle
|
|
43
|
+
organizationName?: string;
|
|
44
|
+
jobTitle?: string;
|
|
45
45
|
firstName: string;
|
|
46
46
|
lastName: string;
|
|
47
47
|
address1: string;
|
|
48
|
-
address2
|
|
48
|
+
address2?: string;
|
|
49
49
|
city: string;
|
|
50
50
|
stateProvince: string;
|
|
51
|
-
stateProvinceChoice
|
|
52
|
-
postalCode: number;
|
|
51
|
+
stateProvinceChoice?: string;
|
|
52
|
+
postalCode: string | number;
|
|
53
53
|
country: string;
|
|
54
|
-
phone: number;
|
|
55
|
-
fax
|
|
54
|
+
phone: string | number;
|
|
55
|
+
fax?: number;
|
|
56
56
|
emailAddress: string;
|
|
57
|
-
phoneExt
|
|
58
|
-
readOnly
|
|
57
|
+
phoneExt?: number;
|
|
58
|
+
readOnly?: boolean;
|
|
59
59
|
}
|
|
60
60
|
interface CurrentAttributes {
|
|
61
61
|
registrantNexus: string;
|
|
@@ -73,9 +73,9 @@ interface DomainCreateResult {
|
|
|
73
73
|
domain: string;
|
|
74
74
|
registered: boolean;
|
|
75
75
|
chargedAmount: number;
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
domainId: number;
|
|
77
|
+
orderId: number;
|
|
78
|
+
transactionId: number;
|
|
79
79
|
whoisguardEnable: boolean;
|
|
80
80
|
nonRealTimeDomain: boolean;
|
|
81
81
|
}
|
|
@@ -84,15 +84,16 @@ interface Category {
|
|
|
84
84
|
sequenceNumber: number;
|
|
85
85
|
}
|
|
86
86
|
interface TLD {
|
|
87
|
+
value: string;
|
|
87
88
|
name: string;
|
|
88
89
|
nonRealTime: boolean;
|
|
89
90
|
minRegisterYears: number;
|
|
90
91
|
maxRegisterYears: number;
|
|
91
92
|
minRenewYears: number;
|
|
92
93
|
maxRenewYears: number;
|
|
93
|
-
renewalMinDays
|
|
94
|
-
renewalMaxDays
|
|
95
|
-
reactivateMaxDays
|
|
94
|
+
renewalMinDays?: number;
|
|
95
|
+
renewalMaxDays?: number;
|
|
96
|
+
reactivateMaxDays?: number;
|
|
96
97
|
minTransferYears: number;
|
|
97
98
|
maxTransferYears: number;
|
|
98
99
|
isApiRegisterable: boolean;
|
|
@@ -100,21 +101,21 @@ interface TLD {
|
|
|
100
101
|
isApiTransferable: boolean;
|
|
101
102
|
isEppRequired: boolean;
|
|
102
103
|
isDisableModContact: boolean;
|
|
103
|
-
|
|
104
|
+
isDisableWgAllot: boolean;
|
|
104
105
|
isIncludeInExtendedSearchOnly: boolean;
|
|
105
106
|
sequenceNumber: number;
|
|
106
107
|
type: string;
|
|
107
|
-
subType
|
|
108
|
-
|
|
108
|
+
subType?: string;
|
|
109
|
+
isSupportsIdn: boolean;
|
|
109
110
|
category: string;
|
|
110
|
-
supportsRegistrarLock
|
|
111
|
-
addGracePeriodDays
|
|
112
|
-
whoisVerification
|
|
113
|
-
providerApiDelete
|
|
114
|
-
tldState
|
|
115
|
-
searchGroup
|
|
116
|
-
registry
|
|
117
|
-
categories
|
|
111
|
+
supportsRegistrarLock?: boolean;
|
|
112
|
+
addGracePeriodDays?: number;
|
|
113
|
+
whoisVerification?: boolean;
|
|
114
|
+
providerApiDelete?: boolean;
|
|
115
|
+
tldState?: string;
|
|
116
|
+
searchGroup?: string;
|
|
117
|
+
registry?: string;
|
|
118
|
+
categories?: Array<Category>;
|
|
118
119
|
}
|
|
119
120
|
interface DomainCheckResult {
|
|
120
121
|
domain: string;
|
|
@@ -151,31 +152,23 @@ interface DomainRenewResult {
|
|
|
151
152
|
interface DomainGetRegistrarLockResult {
|
|
152
153
|
domain: string;
|
|
153
154
|
registrarLockStatus: boolean;
|
|
154
|
-
isClientUpdateProhibited
|
|
155
|
-
isClientDeleteProhibited
|
|
156
|
-
isClientHold
|
|
157
|
-
}
|
|
158
|
-
interface DomainSetRegistrarLockResult {
|
|
159
|
-
domain: string;
|
|
160
|
-
isSuccess: boolean;
|
|
161
|
-
registrarLockStatus: boolean;
|
|
162
|
-
isRegistrarLockStatusUpdated: boolean;
|
|
163
|
-
isClientUpdateProhibitedUpdated: boolean;
|
|
164
|
-
isClientDeleteProhibitedUpdated: boolean;
|
|
165
|
-
isClientHoldUpdated: boolean;
|
|
155
|
+
isClientUpdateProhibited?: boolean;
|
|
156
|
+
isClientDeleteProhibited?: boolean;
|
|
157
|
+
isClientHold?: boolean;
|
|
166
158
|
}
|
|
167
159
|
interface DomainGetInfoResult {
|
|
168
160
|
domainDetails: {
|
|
169
161
|
createdDate: string;
|
|
170
162
|
expiredDate: string;
|
|
171
|
-
numYears
|
|
163
|
+
numYears?: number;
|
|
172
164
|
domainDetails: boolean;
|
|
173
165
|
};
|
|
174
166
|
whoisguard: {
|
|
175
167
|
id: number;
|
|
168
|
+
expiredDate: string;
|
|
176
169
|
enabled: string;
|
|
177
170
|
};
|
|
178
|
-
premiumDnsSubscription
|
|
171
|
+
premiumDnsSubscription?: {
|
|
179
172
|
useAutoRenew: boolean;
|
|
180
173
|
subscriptionId: number;
|
|
181
174
|
createdDate: string;
|
|
@@ -184,13 +177,13 @@ interface DomainGetInfoResult {
|
|
|
184
177
|
premiumDnsSubscription: boolean;
|
|
185
178
|
};
|
|
186
179
|
dnsDetails: {
|
|
187
|
-
nameserver
|
|
180
|
+
nameserver?: Array<string>;
|
|
188
181
|
providerType: string;
|
|
189
|
-
isUsingOurDns
|
|
190
|
-
hostCount
|
|
191
|
-
emailType
|
|
192
|
-
dynamicDnsStatus
|
|
193
|
-
isFailover
|
|
182
|
+
isUsingOurDns?: boolean;
|
|
183
|
+
hostCount?: number;
|
|
184
|
+
emailType?: string;
|
|
185
|
+
dynamicDnsStatus?: boolean;
|
|
186
|
+
isFailover?: boolean;
|
|
194
187
|
};
|
|
195
188
|
modificationrights: {
|
|
196
189
|
all: boolean;
|
|
@@ -485,17 +478,17 @@ interface CreateDomainParams extends Contacts {
|
|
|
485
478
|
promoCode?: string;
|
|
486
479
|
billing?: Partial<ContactDetail>;
|
|
487
480
|
idnCode?: IdnCode;
|
|
488
|
-
extendedAttributes
|
|
481
|
+
extendedAttributes?: string;
|
|
489
482
|
nameservers?: string;
|
|
490
483
|
addFreeWhoisguard?: string;
|
|
491
484
|
WGEnabled?: string;
|
|
492
485
|
isPremiumDomain?: boolean;
|
|
493
486
|
premiumPrice?: number;
|
|
494
|
-
|
|
487
|
+
eapFee?: number;
|
|
495
488
|
}
|
|
496
489
|
interface ContactDomainParams extends Contacts {
|
|
497
490
|
domainName: string;
|
|
498
|
-
extendedAttributes
|
|
491
|
+
extendedAttributes?: string;
|
|
499
492
|
}
|
|
500
493
|
interface ReactivateDomainParams {
|
|
501
494
|
domainName: string;
|
|
@@ -511,27 +504,64 @@ interface RenewDomainParams {
|
|
|
511
504
|
isPremiumDomain?: boolean;
|
|
512
505
|
premiumPrice?: number;
|
|
513
506
|
}
|
|
514
|
-
interface SetRegistrarLockParams {
|
|
515
|
-
domainName: string;
|
|
516
|
-
lockAction: LockAction;
|
|
517
|
-
}
|
|
518
507
|
|
|
519
508
|
declare class Domains {
|
|
520
509
|
private readonly config;
|
|
521
510
|
constructor(config: NamecheapProps);
|
|
511
|
+
/**
|
|
512
|
+
* Returns a list of domains for the particular user
|
|
513
|
+
* @note IMPORTANT: Namecheap API privacy service provider recently changed to WithheldforPrivacy. We want to avoid service interruption for namecheap API users, so please note that in some cases, you may still see Whoisguard in the API parameter names.
|
|
514
|
+
*/
|
|
522
515
|
getList(params?: GetListParams$1): Promise<{
|
|
523
516
|
data: Array<DomainGetListResult>;
|
|
524
517
|
paging: Paging;
|
|
525
518
|
}>;
|
|
519
|
+
/**
|
|
520
|
+
* Gets contact information for the requested domain
|
|
521
|
+
* @note IMPORTANT: Namecheap API privacy service provider recently changed to WithheldforPrivacy. We want to avoid service interruption for our API users, so please note that in some cases, you may still see Whoisguard in the API parameter names.
|
|
522
|
+
*/
|
|
526
523
|
getContacts(domainName: string): Promise<DomainContactsResult>;
|
|
524
|
+
/**
|
|
525
|
+
* Registers a new domain
|
|
526
|
+
* @note IMPORTANT: Namecheap API privacy service provider recently changed to WithheldforPrivacy. We want to avoid service interruption for our API users, so please note that in some cases, you may still see Whoisguard in the API parameter names.
|
|
527
|
+
* @note For successful registration of an IDN domain, you need to send the IdnCode parameter and provide the domain name in the Punycode format (Example: xn--sdkhjsdhfkdh.com), as we do not support native code.
|
|
528
|
+
*/
|
|
527
529
|
create(domain: string, params: Omit<CreateDomainParams, "domainName">): Promise<DomainCreateResult>;
|
|
530
|
+
/**
|
|
531
|
+
* Returns a list of TLDs
|
|
532
|
+
* @note IMPORTANT: Namecheap API privacy service provider recently changed to WithheldforPrivacy. We want to avoid service interruption for our API users, so please note that in some cases, you may still see Whoisguard in the API parameter names.
|
|
533
|
+
* @note We strongly recommend that you cache this API response to avoid repeated calls.
|
|
534
|
+
*
|
|
535
|
+
*/
|
|
528
536
|
getTldList(): Promise<Array<TLD>>;
|
|
537
|
+
/**
|
|
538
|
+
* Sets contact information for the requested domain
|
|
539
|
+
*/
|
|
529
540
|
setContacts(domain: string, params: Omit<ContactDomainParams, "domainName">): Promise<string>;
|
|
530
|
-
|
|
541
|
+
/**
|
|
542
|
+
* Checks the availability of domains
|
|
543
|
+
*/
|
|
544
|
+
check(domains: Array<string>): Promise<Array<DomainCheckResult>>;
|
|
545
|
+
/**
|
|
546
|
+
* Reactivates an expired domain
|
|
547
|
+
*/
|
|
531
548
|
reactivate(domain: string, params?: Omit<ReactivateDomainParams, "domainName">): Promise<DomainReactivateResult>;
|
|
549
|
+
/**
|
|
550
|
+
* Renews an expiring domain
|
|
551
|
+
*/
|
|
532
552
|
renew(domain: string, params: Omit<RenewDomainParams, "domainName">): Promise<DomainRenewResult>;
|
|
553
|
+
/**
|
|
554
|
+
* Gets the Registrar Lock status for the requested domain
|
|
555
|
+
*/
|
|
533
556
|
getRegistrarLock(domain: string): Promise<DomainGetRegistrarLockResult>;
|
|
534
|
-
|
|
557
|
+
/**
|
|
558
|
+
* Sets the Registrar Lock status for a domain
|
|
559
|
+
*/
|
|
560
|
+
setRegistrarLock(domain: string, lockAction?: LockAction): Promise<string>;
|
|
561
|
+
/**
|
|
562
|
+
* Returns information about the requested domain
|
|
563
|
+
* @note IMPORTANT: Namecheap API privacy service provider recently changed to WithheldforPrivacy. We want to avoid service interruption for Namecheap API users, so please note that in some cases, you may still see Whoisguard in the API parameter names.
|
|
564
|
+
*/
|
|
535
565
|
getInfo(domain: string, hostName?: string): Promise<DomainGetInfoResult>;
|
|
536
566
|
}
|
|
537
567
|
|
|
@@ -589,103 +619,37 @@ interface SetDNSHostsParams {
|
|
|
589
619
|
|
|
590
620
|
declare class DomainsDNS {
|
|
591
621
|
private readonly config;
|
|
592
|
-
/**
|
|
593
|
-
* @constructor initial configuration to use global settings
|
|
594
|
-
* @param {NamecheapProps} config Namecheap credentials
|
|
595
|
-
*/
|
|
596
622
|
constructor(config: NamecheapProps);
|
|
597
623
|
/**
|
|
598
|
-
* Sets domain to use
|
|
624
|
+
* Sets domain to use namecheap api default DNS servers.
|
|
599
625
|
* Required for free services like Host record management, URL forwarding, email forwarding, dynamic dns and other value added services.
|
|
600
|
-
* @param {string} sld SLD of the DomainName
|
|
601
|
-
* @param {string} tld TLD of the DomainName
|
|
602
|
-
* @returns {Promise<>string>} Returns the domain name that you are trying to set default nameservers for.
|
|
603
626
|
*/
|
|
604
627
|
setDefault(sld: string, tld: string): Promise<string>;
|
|
605
628
|
/**
|
|
606
629
|
* Sets domain to use custom DNS servers.
|
|
607
630
|
* @note Services like URL forwarding, Email forwarding, Dynamic DNS will not work for domains using custom nameservers
|
|
608
|
-
* @param {string} sld SLD of the DomainName
|
|
609
|
-
* @param {string} tld TLD of the DomainName
|
|
610
|
-
* @param {Array<string>} nameservers A list of name servers to be associated with this domain
|
|
611
|
-
* @returns {Promise<string>} Returns the domain name that you are trying to set custom nameservers for.
|
|
612
631
|
*/
|
|
613
632
|
setCustom(sld: string, tld: string, nameservers: Array<string>): Promise<string>;
|
|
614
633
|
/**
|
|
615
634
|
* Gets a list of DNS servers associated with the requested domain.
|
|
616
|
-
* @param {string} sld SLD of the DomainName
|
|
617
|
-
* @param {string} tld TLD of the DomainName
|
|
618
|
-
* @returns List of DNS info (see {@link DomainDnsGetListResult})
|
|
619
635
|
*/
|
|
620
636
|
getList(sld: string, tld: string): Promise<DomainDnsGetListResult>;
|
|
621
637
|
/**
|
|
622
638
|
* Retrieves DNS host record settings for the requested domain.
|
|
623
|
-
* @param {string} sld SLD of the DomainName
|
|
624
|
-
* @param {string} tld TLD of the DomainName
|
|
625
|
-
* @returns DNS host records info (see {@link DomainDnsGetHostsResult})
|
|
626
639
|
*/
|
|
627
640
|
getHosts(sld: string, tld: string): Promise<DomainDnsGetHostsResult>;
|
|
628
641
|
/**
|
|
629
642
|
* Gets email forwarding settings for the requested domain.
|
|
630
|
-
* @param {string} domain Domain name to get settings
|
|
631
|
-
* @returns Email forwarding info (see {@link DomainDnsGetEmailForwardingResult})
|
|
632
643
|
*/
|
|
633
644
|
getEmailForwarding(domain: string): Promise<DomainDnsGetEmailForwardingResult>;
|
|
634
645
|
/**
|
|
635
646
|
* Sets email forwarding for a domain name.
|
|
636
|
-
* @param {string} domain Domain name to set settings
|
|
637
|
-
* @param {SetDNSEmailForwardingParams} params Set mailbox and forwards
|
|
638
|
-
* - mailBox: for which you wish to set email forwarding.
|
|
639
|
-
* - forwardTo: Email address to forward to
|
|
640
|
-
* @example
|
|
641
|
-
* setEmailForwarding("mydomain.com", {
|
|
642
|
-
* mailBox: ["example@namecheap.com"],
|
|
643
|
-
* forwardTo: ["example:example@gmail.com"]
|
|
644
|
-
* })
|
|
645
|
-
* @returns Return email affected
|
|
646
647
|
*/
|
|
647
648
|
setEmailForwarding(domain: string, params: Omit<SetDNSEmailForwardingParams, "domainName">): Promise<string>;
|
|
648
649
|
/**
|
|
649
650
|
* Sets DNS host records settings for the requested domain.
|
|
650
651
|
* @note If you set more than 10 hosts the request will be done by POST method otherwise by GET method.
|
|
651
652
|
* @note All host records that are not included into the API call will be deleted, so add them in addition to new host records.
|
|
652
|
-
* @param {string} sld
|
|
653
|
-
* @param {string} tld
|
|
654
|
-
* @param {Omit<
|
|
655
|
-
* SetDNSHostsParams,
|
|
656
|
-
* "sld" | "tld" | "address" | "hostname" | "mxpref" | "recordType" | "ttl"
|
|
657
|
-
* > & { hosts: Array<Host> }} params Host record configuration object:
|
|
658
|
-
* - emailType?: The type of email service to use.
|
|
659
|
-
* - MXE: to set up your custom MXE record.
|
|
660
|
-
* - MX: to set up custom MX records of your mail provider.
|
|
661
|
-
* - FWD: to set up MX records for our Free Email Forwarding service.
|
|
662
|
-
* - OX: to set up MX records for our Private Email service.
|
|
663
|
-
* - flag?: Is an unsigned integer between 0 and 255. The flag value is an 8-bit number, the most significant bit of which indicates the criticality of understanding of a record by a CA. It's recommended to use `0`
|
|
664
|
-
* - tag?: A non-zero sequence of US-ASCII letters and numbers in lower case. The tag value can be one of the following values:
|
|
665
|
-
* - issue — specifies the certification authority that is authorized to issue a certificate for the domain name or subdomain record used in the title.
|
|
666
|
-
* - issuewild — specifies the certification authority that is allowed to issue a wildcard certificate for the domain name or subdomain record used in the title. The certificate applies to the domain name or subdomain directly and to all its subdomains.
|
|
667
|
-
* - iodef — specifies the e-mail address or URL (compliant with RFC 5070) a CA should use to notify a client if any issuance policy violation spotted by this CA.
|
|
668
|
-
* - hosts: Array with host properties
|
|
669
|
-
* - hostname: Sub-domain/hostname to create the record for
|
|
670
|
-
* - recordType: Record type to that host, possible values
|
|
671
|
-
* - A
|
|
672
|
-
* - AAAA
|
|
673
|
-
* - ALIAS
|
|
674
|
-
* - CAA
|
|
675
|
-
* - CNAME
|
|
676
|
-
* - MX
|
|
677
|
-
* - MXE
|
|
678
|
-
* - NS
|
|
679
|
-
* - TXT
|
|
680
|
-
* - URL
|
|
681
|
-
* - URL301
|
|
682
|
-
* - FRAME
|
|
683
|
-
* - address: The value for this parameter is based on RecordType. Possible values:
|
|
684
|
-
* - URL
|
|
685
|
-
* - IP address
|
|
686
|
-
* - mxpref?: MX preference for host. Applicable for MX records only.
|
|
687
|
-
* - ttl?: Time to live for all record types.
|
|
688
|
-
* @returns Return host list affected
|
|
689
653
|
*/
|
|
690
654
|
setHosts(sld: string, tld: string, params: Omit<SetDNSHostsParams, "sld" | "tld" | "address" | "hostname" | "mxpref" | "recordType" | "ttl"> & {
|
|
691
655
|
hosts: Array<Host>;
|