namecheap-ts 1.0.5 โ 1.1.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 +228 -64
- package/dist/index.d.mts +51 -51
- package/dist/index.d.ts +51 -51
- package/dist/index.js +151 -212
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +148 -212
- package/dist/index.mjs.map +1 -1
- package/package.json +17 -9
package/README.md
CHANGED
|
@@ -1,129 +1,293 @@
|
|
|
1
|
-
# Namecheap-ts
|
|
1
|
+
# Namecheap-ts
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/namecheap-ts)
|
|
4
|
+
[](https://opensource.org/licenses/ISC)
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
A modern TypeScript/JavaScript wrapper for the Namecheap API. Simplify domain management, registration, pricing, and account operations with full type safety.
|
|
7
|
+
|
|
8
|
+
## Features
|
|
6
9
|
|
|
7
|
-
|
|
10
|
+
โจ **Full TypeScript Support** - Complete type definitions for all methods and responses
|
|
11
|
+
๐ฏ **Simple API** - Intuitive methods for common operations
|
|
12
|
+
๐ **Type-Safe** - Catch errors at compile time, not runtime
|
|
13
|
+
๐งช **Sandbox Support** - Test your integration without affecting production
|
|
14
|
+
๐ฆ **Zero Config** - Works out of the box with ESM and CommonJS
|
|
15
|
+
โก **Lightweight** - Minimal dependencies (axios, xml2js)
|
|
8
16
|
|
|
9
|
-
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
```bash
|
|
10
20
|
npm install namecheap-ts
|
|
11
21
|
```
|
|
12
22
|
|
|
13
|
-
|
|
23
|
+
```bash
|
|
24
|
+
yarn add namecheap-ts
|
|
25
|
+
```
|
|
14
26
|
|
|
15
|
-
|
|
27
|
+
```bash
|
|
28
|
+
pnpm add namecheap-ts
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Quick Start
|
|
16
32
|
|
|
17
33
|
```typescript
|
|
18
34
|
import Namecheap, { INamecheapConfig } from "namecheap-ts";
|
|
35
|
+
|
|
36
|
+
// Configure the client
|
|
19
37
|
const config: INamecheapConfig = {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
username: "
|
|
23
|
-
clientIp: "
|
|
38
|
+
apiUser: "your-api-username",
|
|
39
|
+
apiKey: "your-api-key",
|
|
40
|
+
username: "your-username",
|
|
41
|
+
clientIp: "your-whitelisted-ip",
|
|
24
42
|
};
|
|
25
43
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const payload = { DomainList: "mezoishere.net" };
|
|
29
|
-
const { data } = await api.call("namecheap.domains.check", payload);
|
|
44
|
+
// Create an instance (set second parameter to true for sandbox)
|
|
45
|
+
const namecheap = new Namecheap(config, false);
|
|
30
46
|
|
|
31
|
-
|
|
32
|
-
|
|
47
|
+
// Check domain availability
|
|
48
|
+
const { data } = await namecheap.checkDomain("example.com");
|
|
49
|
+
console.log(`Available: ${data.available}, Premium: ${data.premium}`);
|
|
33
50
|
```
|
|
34
51
|
|
|
35
|
-
##
|
|
52
|
+
## Configuration
|
|
53
|
+
|
|
54
|
+
### INamecheapConfig
|
|
36
55
|
|
|
37
|
-
|
|
56
|
+
| Property | Type | Required | Description |
|
|
57
|
+
| ---------- | -------- | -------- | ------------------------------- |
|
|
58
|
+
| `apiUser` | `string` | โ
| Your Namecheap API username |
|
|
59
|
+
| `apiKey` | `string` | โ
| Your Namecheap API key |
|
|
60
|
+
| `username` | `string` | โ
| Your Namecheap account username |
|
|
61
|
+
| `clientIp` | `string` | โ
| Your whitelisted IP address |
|
|
38
62
|
|
|
39
|
-
|
|
63
|
+
### Sandbox Mode
|
|
40
64
|
|
|
41
|
-
|
|
65
|
+
Pass `true` as the second parameter to use the Namecheap sandbox environment:
|
|
42
66
|
|
|
43
67
|
```typescript
|
|
44
|
-
const namecheap = new Namecheap(config, true);
|
|
68
|
+
const namecheap = new Namecheap(config, true); // Sandbox mode
|
|
45
69
|
```
|
|
46
70
|
|
|
47
|
-
|
|
71
|
+
## API Reference
|
|
48
72
|
|
|
49
|
-
|
|
73
|
+
### `checkDomain(domainName: string)`
|
|
50
74
|
|
|
51
|
-
|
|
52
|
-
import { Commands } from "namecheap-ts";
|
|
53
|
-
const response = await namecheap.call(Commands.DOMAINS_CHECK, {
|
|
54
|
-
DomainList: "example.com",
|
|
55
|
-
});
|
|
75
|
+
Check if a domain is available for registration and whether it's a premium domain.
|
|
56
76
|
|
|
57
|
-
|
|
58
|
-
```
|
|
77
|
+
**Returns:** `Promise<ICheckDomainResponse>`
|
|
59
78
|
|
|
60
|
-
|
|
79
|
+
```typescript
|
|
80
|
+
const result = await namecheap.checkDomain("example.com");
|
|
81
|
+
|
|
82
|
+
if (result.data.available) {
|
|
83
|
+
console.log("Domain is available!");
|
|
84
|
+
if (result.data.premium) {
|
|
85
|
+
console.log("This is a premium domain");
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
```
|
|
61
89
|
|
|
62
|
-
|
|
90
|
+
### `getDomainPrice(domainName: string, action: DomainPriceAction)`
|
|
63
91
|
|
|
64
|
-
|
|
65
|
-
const { data } = await namecheap.checkDomain("example.com");
|
|
92
|
+
Get pricing information for a domain based on the action type.
|
|
66
93
|
|
|
67
|
-
|
|
68
|
-
```
|
|
94
|
+
**Parameters:**
|
|
69
95
|
|
|
70
|
-
|
|
96
|
+
- `domainName` - The domain name (e.g., "example.com")
|
|
97
|
+
- `action` - One of: `DomainPriceActions.REGISTER`, `RENEW`, `REACTIVATE`, `TRANSFER`
|
|
71
98
|
|
|
72
|
-
|
|
99
|
+
**Returns:** `Promise<IResponse<object[]>>`
|
|
73
100
|
|
|
74
101
|
```typescript
|
|
75
|
-
import {
|
|
76
|
-
|
|
102
|
+
import { DomainPriceActions } from "namecheap-ts";
|
|
103
|
+
|
|
104
|
+
const pricing = await namecheap.getDomainPrice(
|
|
77
105
|
"example.com",
|
|
78
|
-
|
|
106
|
+
DomainPriceActions.REGISTER,
|
|
79
107
|
);
|
|
80
108
|
|
|
81
|
-
console.log(
|
|
109
|
+
console.log(pricing.data);
|
|
82
110
|
```
|
|
83
111
|
|
|
84
|
-
|
|
112
|
+
### `registerDomain(payload: Payload)`
|
|
113
|
+
|
|
114
|
+
Register a new domain with Namecheap.
|
|
85
115
|
|
|
86
|
-
|
|
116
|
+
**Returns:** `Promise<IRegisterDomainResponse>`
|
|
87
117
|
|
|
88
118
|
```typescript
|
|
89
119
|
const payload = {
|
|
90
|
-
DomainName: "
|
|
91
|
-
Years:
|
|
92
|
-
//
|
|
120
|
+
DomainName: "example.com",
|
|
121
|
+
Years: 1,
|
|
122
|
+
// Add required registration fields according to Namecheap API docs
|
|
123
|
+
RegistrantFirstName: "John",
|
|
124
|
+
RegistrantLastName: "Doe",
|
|
125
|
+
RegistrantAddress1: "123 Main St",
|
|
126
|
+
RegistrantCity: "New York",
|
|
127
|
+
RegistrantStateProvince: "NY",
|
|
128
|
+
RegistrantPostalCode: "10001",
|
|
129
|
+
RegistrantCountry: "US",
|
|
130
|
+
RegistrantPhone: "+1.2125551234",
|
|
131
|
+
RegistrantEmailAddress: "john@example.com",
|
|
132
|
+
// ... additional required fields
|
|
93
133
|
};
|
|
94
134
|
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
console.log(
|
|
135
|
+
const result = await namecheap.registerDomain(payload);
|
|
136
|
+
console.log(`Domain registered: ${result.data.domain}`);
|
|
137
|
+
console.log(`Order ID: ${result.data.orderID}`);
|
|
98
138
|
```
|
|
99
139
|
|
|
100
|
-
|
|
140
|
+
### `addFundsRequest(payload: AddFundsRequestPayload)`
|
|
141
|
+
|
|
142
|
+
Create a request to add funds to your Namecheap account.
|
|
101
143
|
|
|
102
|
-
|
|
144
|
+
**Returns:** `Promise<IAddFundsRequestResponse>`
|
|
103
145
|
|
|
104
146
|
```typescript
|
|
105
147
|
const payload = {
|
|
106
|
-
username: "username",
|
|
148
|
+
username: "your-username",
|
|
107
149
|
paymentType: "creditcard",
|
|
108
|
-
amount:
|
|
109
|
-
returnURL: "
|
|
150
|
+
amount: 100,
|
|
151
|
+
returnURL: "https://yoursite.com/payment-complete",
|
|
110
152
|
};
|
|
111
153
|
|
|
112
|
-
const
|
|
154
|
+
const result = await namecheap.addFundsRequest(payload);
|
|
155
|
+
console.log(`Token ID: ${result.data.tokenId}`);
|
|
156
|
+
console.log(`Redirect to: ${result.data.redirectURL}`);
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### `getFundsStatus(tokenId: string)`
|
|
160
|
+
|
|
161
|
+
Check the status of a funds request.
|
|
162
|
+
|
|
163
|
+
**Returns:** `Promise<IGetFundsStatusResponse>`
|
|
113
164
|
|
|
114
|
-
|
|
165
|
+
```typescript
|
|
166
|
+
const tokenId = "abc123-token-id";
|
|
167
|
+
const result = await namecheap.getFundsStatus(tokenId);
|
|
168
|
+
|
|
169
|
+
console.log(`Status: ${result.data.status}`);
|
|
170
|
+
console.log(`Amount: ${result.data.amount}`);
|
|
115
171
|
```
|
|
116
172
|
|
|
117
|
-
|
|
173
|
+
### `call(command: Command, payload: Payload)`
|
|
118
174
|
|
|
119
|
-
|
|
175
|
+
Make a direct API call to any Namecheap command.
|
|
176
|
+
|
|
177
|
+
**Returns:** `Promise<IResponse>`
|
|
120
178
|
|
|
121
179
|
```typescript
|
|
122
|
-
|
|
180
|
+
import { Commands } from "namecheap-ts";
|
|
123
181
|
|
|
124
|
-
const response = await namecheap.
|
|
182
|
+
const response = await namecheap.call(Commands.DOMAINS_CHECK, {
|
|
183
|
+
DomainList: "example.com,test.com",
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
console.log(response.data);
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## Type Definitions
|
|
190
|
+
|
|
191
|
+
### Available Commands
|
|
192
|
+
|
|
193
|
+
Import the `Commands` enum for type-safe command names:
|
|
194
|
+
|
|
195
|
+
```typescript
|
|
196
|
+
import { Commands } from "namecheap-ts";
|
|
197
|
+
|
|
198
|
+
// Examples:
|
|
199
|
+
Commands.DOMAINS_CHECK;
|
|
200
|
+
Commands.DOMAINS_CREATE;
|
|
201
|
+
Commands.USERS_GET_PRICING;
|
|
202
|
+
Commands.USERS_CREATE_ADD_FUNDS_REQUEST;
|
|
203
|
+
Commands.USERS_GET_ADD_FUNDS_STATUS;
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### Domain Price Actions
|
|
207
|
+
|
|
208
|
+
```typescript
|
|
209
|
+
import { DomainPriceActions } from "namecheap-ts";
|
|
210
|
+
|
|
211
|
+
DomainPriceActions.REGISTER;
|
|
212
|
+
DomainPriceActions.RENEW;
|
|
213
|
+
DomainPriceActions.REACTIVATE;
|
|
214
|
+
DomainPriceActions.TRANSFER;
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
## Error Handling
|
|
218
|
+
|
|
219
|
+
```typescript
|
|
220
|
+
try {
|
|
221
|
+
const result = await namecheap.checkDomain("example.com");
|
|
222
|
+
console.log(result.data);
|
|
223
|
+
} catch (error) {
|
|
224
|
+
if (error instanceof InvalidDomainNameException) {
|
|
225
|
+
console.error("Invalid domain name provided");
|
|
226
|
+
} else {
|
|
227
|
+
console.error("API error:", error.message);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
## Complete Example
|
|
125
233
|
|
|
126
|
-
|
|
234
|
+
```typescript
|
|
235
|
+
import Namecheap, { INamecheapConfig, DomainPriceActions } from "namecheap-ts";
|
|
236
|
+
|
|
237
|
+
async function main() {
|
|
238
|
+
const config: INamecheapConfig = {
|
|
239
|
+
apiUser: process.env.NAMECHEAP_API_USER!,
|
|
240
|
+
apiKey: process.env.NAMECHEAP_API_KEY!,
|
|
241
|
+
username: process.env.NAMECHEAP_USERNAME!,
|
|
242
|
+
clientIp: process.env.NAMECHEAP_CLIENT_IP!,
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
const namecheap = new Namecheap(config, true); // Sandbox mode
|
|
246
|
+
|
|
247
|
+
// Check domain availability
|
|
248
|
+
const domain = "example.com";
|
|
249
|
+
const availabilityCheck = await namecheap.checkDomain(domain);
|
|
250
|
+
|
|
251
|
+
if (availabilityCheck.data.available) {
|
|
252
|
+
// Get pricing
|
|
253
|
+
const pricing = await namecheap.getDomainPrice(
|
|
254
|
+
domain,
|
|
255
|
+
DomainPriceActions.REGISTER,
|
|
256
|
+
);
|
|
257
|
+
|
|
258
|
+
console.log("Domain is available!");
|
|
259
|
+
console.log("Pricing:", pricing.data);
|
|
260
|
+
} else {
|
|
261
|
+
console.log("Domain is not available");
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
main();
|
|
127
266
|
```
|
|
128
267
|
|
|
129
|
-
|
|
268
|
+
## Requirements
|
|
269
|
+
|
|
270
|
+
- Node.js 14 or higher
|
|
271
|
+
- A Namecheap account with API access enabled
|
|
272
|
+
- Whitelisted IP address for API access
|
|
273
|
+
|
|
274
|
+
## Getting API Credentials
|
|
275
|
+
|
|
276
|
+
1. Log in to your Namecheap account
|
|
277
|
+
2. Navigate to Profile โ Tools โ API Access
|
|
278
|
+
3. Enable API access and whitelist your IP address
|
|
279
|
+
4. Copy your API key and username
|
|
280
|
+
|
|
281
|
+
## Resources
|
|
282
|
+
|
|
283
|
+
- [Namecheap API Documentation](https://www.namecheap.com/support/api/intro/)
|
|
284
|
+
- [API Method Reference](https://www.namecheap.com/support/api/methods/)
|
|
285
|
+
- [GitHub Repository](https://github.com/abdulrahmanKanakri/namecheap-ts)
|
|
286
|
+
|
|
287
|
+
## License
|
|
288
|
+
|
|
289
|
+
ISC ยฉ Abdulrahman Kanakri
|
|
290
|
+
|
|
291
|
+
## Contributing
|
|
292
|
+
|
|
293
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
package/dist/index.d.mts
CHANGED
|
@@ -1,92 +1,92 @@
|
|
|
1
1
|
declare enum Commands {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
DOMAINS_GET_LIST = "namecheap.domains.getList",
|
|
3
|
+
DOMAINS_GET_CONTACTS = "namecheap.domains.getContacts",
|
|
4
4
|
DOMAINS_CREATE = "namecheap.domains.create",
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
DOMAINS_GET_TLD_LIST = "namecheap.domains.getTldList",
|
|
6
|
+
DOMAINS_SET_CONTACTS = "namecheap.domains.setContacts",
|
|
7
7
|
DOMAINS_CHECK = "namecheap.domains.check",
|
|
8
8
|
DOMAINS_REACTIVATE = "namecheap.domains.reactivate",
|
|
9
9
|
DOMAINS_RENEW = "namecheap.domains.renew",
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
10
|
+
DOMAINS_GET_REGISTRAR_LOCK = "namecheap.domains.getRegistrarLock",
|
|
11
|
+
DOMAINS_SET_REGISTRAR_LOCK = "namecheap.domains.setRegistrarLock",
|
|
12
|
+
DOMAINS_GET_INFO = "namecheap.domains.getInfo",
|
|
13
|
+
DOMAINS_DNS_SET_DEFAULT = "namecheap.domains.dns.setDefault",
|
|
14
|
+
DOMAINS_DNS_SET_CUSTOM = "namecheap.domains.dns.setCustom",
|
|
15
|
+
DOMAINS_DNS_GET_LIST = "namecheap.domains.dns.getList",
|
|
16
|
+
DOMAINS_DNS_GET_HOSTS = "namecheap.domains.dns.getHosts",
|
|
17
|
+
DOMAINS_DNS_GET_EMAIL_FORWARDING = "namecheap.domains.dns.getEmailForwarding",
|
|
18
|
+
DOMAINS_DNS_SET_EMAIL_FORWARDING = "namecheap.domains.dns.setEmailForwarding",
|
|
19
|
+
DOMAINS_DNS_SET_HOSTS = "namecheap.domains.dns.setHosts",
|
|
20
20
|
DOMAINS_NS_CREATE = "namecheap.domains.ns.create",
|
|
21
21
|
DOMAINS_NS_DELETE = "namecheap.domains.ns.delete",
|
|
22
|
-
|
|
22
|
+
DOMAINS_NS_GET_INFO = "namecheap.domains.ns.getInfo",
|
|
23
23
|
DOMAINS_NS_UPDATE = "namecheap.domains.ns.update",
|
|
24
24
|
DOMAINS_TRANSFER_CREATE = "namecheap.domains.transfer.create",
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
DOMAINS_TRANSFER_GET_STATUS = "namecheap.domains.transfer.getStatus",
|
|
26
|
+
DOMAINS_TRANSFER_UPDATE_STATUS = "namecheap.domains.transfer.updateStatus",
|
|
27
|
+
DOMAINS_TRANSFER_GET_LIST = "namecheap.domains.transfer.getList",
|
|
28
28
|
SSL_CREATE = "namecheap.ssl.create",
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
SSL_GET_LIST = "namecheap.ssl.getList",
|
|
30
|
+
SSL_PARSE_CSR = "namecheap.ssl.parseCSR",
|
|
31
|
+
SSL_GET_APPROVER_EMAIL_LIST = "namecheap.ssl.getApproverEmailList",
|
|
32
32
|
SSL_ACTIVATE = "namecheap.ssl.activate",
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
SSL_RESEND_APPROVER_EMAIL = "namecheap.ssl.resendApproverEmail",
|
|
34
|
+
SSL_GET_INFO = "namecheap.ssl.getInfo",
|
|
35
35
|
SSL_RENEW = "namecheap.ssl.renew",
|
|
36
36
|
SSL_REISSUE = "namecheap.ssl.reissue",
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
37
|
+
SSL_RESEND_FULFILLMENT_EMAIL = "namecheap.ssl.resendfulfillmentemail",
|
|
38
|
+
SSL_PURCHASE_MORE_SANS = "namecheap.ssl.purchasemoresans",
|
|
39
|
+
SSL_REVOKE_CERTIFICATE = "namecheap.ssl.revokecertificate",
|
|
40
|
+
SSL_EDIT_DCV_METHOD = "namecheap.ssl.editDCVMethod",
|
|
41
|
+
USERS_GET_PRICING = "namecheap.users.getPricing",
|
|
42
|
+
USERS_GET_BALANCES = "namecheap.users.getBalances",
|
|
43
|
+
USERS_CHANGE_PASSWORD = "namecheap.users.changePassword",
|
|
44
44
|
USERS_UPDATE = "namecheap.users.update",
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
USERS_CREATE_ADD_FUNDS_REQUEST = "namecheap.users.createaddfundsrequest",
|
|
46
|
+
USERS_GET_ADD_FUNDS_STATUS = "namecheap.users.getAddFundsStatus",
|
|
47
47
|
USERS_CREATE = "namecheap.users.create",
|
|
48
48
|
USERS_LOGIN = "namecheap.users.login",
|
|
49
|
-
|
|
49
|
+
USERS_RESET_PASSWORD = "namecheap.users.resetPassword",
|
|
50
50
|
USERS_ADDRESS_CREATE = "namecheap.users.address.create",
|
|
51
51
|
USERS_ADDRESS_DELETE = "namecheap.users.address.delete",
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
USERS_ADDRESS_GET_INFO = "namecheap.users.address.getInfo",
|
|
53
|
+
USERS_ADDRESS_GET_LIST = "namecheap.users.address.getList",
|
|
54
|
+
USERS_ADDRESS_SET_DEFAULT = "namecheap.users.address.setDefault",
|
|
55
55
|
USERS_ADDRESS_UPDATE = "namecheap.users.address.update",
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
WHO_IS_GUARD_CHANGE_EMAIL_ADDRESS = "Namecheap.Whoisguard.changeemailaddress",
|
|
57
|
+
WHO_IS_GUARD_ENABLE = "Namecheap.Whoisguard.enable",
|
|
58
|
+
WHO_IS_GUARD_DISABLE = "Namecheap.Whoisguard.disable",
|
|
59
|
+
WHO_IS_GUARD_GET_LIST = "Namecheap.Whoisguard.getList",
|
|
60
|
+
WHO_IS_GUARD_RENEW = "Namecheap.Whoisguard.renew"
|
|
61
61
|
}
|
|
62
62
|
type Command = `${Commands}`;
|
|
63
63
|
|
|
64
64
|
type Payload = Record<string, string | number>;
|
|
65
|
-
interface
|
|
65
|
+
interface IResponse<T = any> {
|
|
66
66
|
data: T;
|
|
67
67
|
status: number;
|
|
68
68
|
}
|
|
69
|
-
type ICheckDomainResponse =
|
|
70
|
-
|
|
69
|
+
type ICheckDomainResponse = IResponse<{
|
|
70
|
+
available: boolean;
|
|
71
71
|
premium: boolean;
|
|
72
72
|
}>;
|
|
73
|
-
type IRegisterDomainResponse =
|
|
73
|
+
type IRegisterDomainResponse = IResponse<{
|
|
74
74
|
domain: string;
|
|
75
75
|
registered: boolean;
|
|
76
76
|
chargedAmount: number;
|
|
77
77
|
domainID: string;
|
|
78
78
|
orderID: string;
|
|
79
79
|
transactionID: string;
|
|
80
|
-
|
|
80
|
+
whoIsGuardEnable: boolean;
|
|
81
81
|
freePositiveSSL: boolean;
|
|
82
82
|
nonRealTimeDomain: boolean;
|
|
83
83
|
}>;
|
|
84
|
-
type IAddFundsRequestResponse =
|
|
84
|
+
type IAddFundsRequestResponse = IResponse<{
|
|
85
85
|
tokenId: string;
|
|
86
86
|
returnURL: string;
|
|
87
87
|
redirectURL: string;
|
|
88
88
|
}>;
|
|
89
|
-
type IGetFundsStatusResponse =
|
|
89
|
+
type IGetFundsStatusResponse = IResponse<{
|
|
90
90
|
status: string;
|
|
91
91
|
amount: number;
|
|
92
92
|
}>;
|
|
@@ -114,12 +114,12 @@ declare class Namecheap {
|
|
|
114
114
|
private readonly config;
|
|
115
115
|
private readonly apiClient;
|
|
116
116
|
constructor(config: INamecheapConfig, sandbox?: boolean);
|
|
117
|
-
call(command: Command, payload: Payload): Promise<
|
|
117
|
+
call(command: Command, payload: Payload): Promise<IResponse>;
|
|
118
118
|
checkDomain(domainName: string): Promise<ICheckDomainResponse>;
|
|
119
|
-
getDomainPrice(domainName: string, action: DomainPriceAction): Promise<
|
|
119
|
+
getDomainPrice(domainName: string, action: DomainPriceAction): Promise<IResponse<object[]>>;
|
|
120
120
|
registerDomain(payload: Payload): Promise<IRegisterDomainResponse>;
|
|
121
121
|
addFundsRequest(payload: AddFundsRequestPayload): Promise<IAddFundsRequestResponse>;
|
|
122
122
|
getFundsStatus(tokenId: string): Promise<IGetFundsStatusResponse>;
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
export { AddFundsRequestPayload, Command, Commands, DomainPriceAction, DomainPriceActions, IAddFundsRequestResponse, ICheckDomainResponse, IGetFundsStatusResponse, INamecheapConfig, IRegisterDomainResponse,
|
|
125
|
+
export { type AddFundsRequestPayload, type Command, Commands, type DomainPriceAction, DomainPriceActions, type IAddFundsRequestResponse, type ICheckDomainResponse, type IGetFundsStatusResponse, type INamecheapConfig, type IRegisterDomainResponse, type IResponse, type Payload, Namecheap as default };
|