@fwgapps/namecheap 0.6.0 → 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/dist/index.d.cts CHANGED
@@ -1,26 +1,220 @@
1
- interface ConfigType {
2
- apiUser: string;
3
- apiKey: string;
4
- clientIp: string;
5
- sandbox: boolean;
6
- username?: string;
1
+ interface XmlNode {
2
+ readonly name: string;
3
+ readonly attrs: Readonly<Record<string, string>>;
4
+ readonly text: string;
5
+ readonly children: readonly XmlNode[];
6
+ }
7
+
8
+ /** Typed, read-only view over an XML node. Error messages never include attribute values. */
9
+ declare class El {
10
+ private readonly node;
11
+ readonly name: string;
12
+ constructor(node: XmlNode);
13
+ text(): string;
14
+ all(name: string): El[];
15
+ /** All direct child elements in document order, whatever their names. */
16
+ children(): El[];
17
+ /** Text of the first child element called `name`, or `undefined` when there is none. */
18
+ optionalText(name: string): string | undefined;
19
+ one(name: string): El;
20
+ optional(name: string): El | undefined;
21
+ string(attr: string): string;
22
+ optionalString(attr: string): string | undefined;
23
+ number(attr: string): number;
24
+ optionalNumber(attr: string): number | undefined;
25
+ boolean(attr: string): boolean;
26
+ optionalBoolean(attr: string): boolean | undefined;
27
+ /**
28
+ * Never throws: the plain decimal value of an attribute, or `undefined` when it is
29
+ * absent or not acceptable. For undocumented responses of billed or account-changing
30
+ * commands, where a parse failure after the action succeeded would invite a retry.
31
+ */
32
+ lenientNumber(attr: string): number | undefined;
33
+ /** Never throws: `true`/`false` (any case), or `undefined` when absent or anything else. */
34
+ lenientBoolean(attr: string): boolean | undefined;
35
+ /** Element text as a plain decimal number (for numeric child elements). */
36
+ numberText(): number;
37
+ /** Element text as `true`/`false` (for boolean child elements). */
38
+ booleanText(): boolean;
39
+ attributes(): Record<string, string>;
40
+ private parseNumber;
41
+ private parseBoolean;
7
42
  }
8
- interface NamecheapProps {
43
+
44
+ type ArrayStyle = "bracket" | "suffix";
45
+
46
+ interface TransportConfig {
9
47
  apiUser: string;
10
48
  apiKey: string;
49
+ userName?: string;
11
50
  clientIp: string;
12
- apiUrl: string;
13
- username: string;
51
+ sandbox?: boolean;
52
+ fetch?: typeof fetch;
53
+ timeoutMs?: number;
54
+ }
55
+ interface CommandRequest {
56
+ command: string;
57
+ params: Array<[string, string]>;
58
+ }
59
+ type Send = (req: CommandRequest) => Promise<El>;
60
+ /**
61
+ * Creates the function that sends one command as a form-encoded POST and returns the
62
+ * `CommandResponse` element. Error messages are fixed strings: they never contain the
63
+ * URL, the API key, the request body or the response body.
64
+ */
65
+ declare function createTransport(config: TransportConfig): Send;
66
+
67
+ interface CommandDef<P, R> {
68
+ /** Namecheap command name, e.g. `namecheap.domains.check`. */
69
+ name: string;
70
+ arrayStyle?: ArrayStyle;
71
+ /** Maps a dotted camelCase path to an exact parameter name. */
72
+ keys?: Readonly<Record<string, string>>;
73
+ /** Runs before serializing; throw to reject the call without sending anything. */
74
+ validate?: (params: P) => void;
75
+ /** Receives the CommandResponse element returned by `send`. */
76
+ parse: (cr: El) => R;
77
+ }
78
+ interface Command<P, R> extends CommandDef<P, R> {
79
+ /** Phantom field carrying the params type; never set at runtime. */
80
+ readonly _params?: P;
81
+ }
82
+ type Group<C> = {
83
+ [K in keyof C]: C[K] extends Command<infer P, infer R> ? {} extends P ? (params?: P) => Promise<R> : (params: P) => Promise<R> : never;
84
+ };
85
+ /**
86
+ * Runs one command: validates, serializes, sends and parses.
87
+ *
88
+ * This is the tree-shakeable entry point: importing only `createTransport`, one
89
+ * standalone command (for example `domainsCheck`) and `run` bundles just those, not the
90
+ * whole command catalog that `new Namecheap(...)` carries.
91
+ */
92
+ declare function run<P, R>(command: Command<P, R>, send: Send, ...args: {} extends P ? [params?: P] : [params: P]): Promise<R>;
93
+
94
+ declare class Namecheap {
95
+ readonly domains: Group<{
96
+ getList: Command<DomainsGetListParams, DomainsGetListResult>;
97
+ check: Command<DomainsCheckParams, DomainsCheckResult>;
98
+ getRegistrarLock: Command<DomainsGetRegistrarLockParams, DomainsGetRegistrarLockResult>;
99
+ setRegistrarLock: Command<DomainsSetRegistrarLockParams, DomainsSetRegistrarLockResult>;
100
+ reactivate: Command<DomainsReactivateParams, DomainsReactivateResult>;
101
+ renew: Command<DomainsRenewParams, DomainsRenewResult>;
102
+ setContacts: Command<DomainsSetContactsParams, DomainsSetContactsResult>;
103
+ create: Command<DomainsCreateParams, DomainsCreateResult>;
104
+ getTldList: Command<Record<string, never>, DomainsGetTldListResult>;
105
+ getContacts: Command<DomainsGetContactsParams, DomainsGetContactsResult>;
106
+ getInfo: Command<DomainsGetInfoParams, DomainsGetInfoResult>;
107
+ }>;
108
+ readonly dns: Group<{
109
+ setDefault: Command<DnsSetDefaultParams, DnsSetDefaultResult>;
110
+ setCustom: Command<DnsSetCustomParams, DnsSetCustomResult>;
111
+ getList: Command<DnsGetListParams, DnsGetListResult>;
112
+ getHosts: Command<DnsGetHostsParams, DnsGetHostsResult>;
113
+ getEmailForwarding: Command<DnsGetEmailForwardingParams, DnsGetEmailForwardingResult>;
114
+ setEmailForwarding: Command<DnsSetEmailForwardingParams, DnsSetEmailForwardingResult>;
115
+ setHosts: Command<DnsSetHostsParams, DnsSetHostsResult>;
116
+ }>;
117
+ readonly ns: Group<{
118
+ create: Command<NsCreateParams, NsCreateResult>;
119
+ delete: Command<NsDeleteParams, NsDeleteResult>;
120
+ getInfo: Command<NsGetInfoParams, NsGetInfoResult>;
121
+ update: Command<NsUpdateParams, NsUpdateResult>;
122
+ }>;
123
+ readonly transfer: Group<{
124
+ create: Command<TransferCreateParams, TransferCreateResult>;
125
+ getStatus: Command<TransferGetStatusParams, TransferGetStatusResult>;
126
+ updateStatus: Command<TransferUpdateStatusParams, TransferUpdateStatusResult>;
127
+ getList: Command<TransferGetListParams, TransferGetListResult>;
128
+ }>;
129
+ readonly ssl: Group<{
130
+ create: Command<SslCreateParams, SslCreateResult>;
131
+ getList: Command<SslGetListParams, SslGetListResult>;
132
+ parseCSR: Command<SslParseCsrParams, SslParseCsrResult>;
133
+ getApproverEmailList: Command<SslGetApproverEmailListParams, SslGetApproverEmailListResult>;
134
+ activate: Command<SslActivateParams, SslActivateResult>;
135
+ resendApproverEmail: Command<SslResendApproverEmailParams, SslResendResult>;
136
+ reissue: Command<SslReissueParams, SslActivateResult>;
137
+ resendFulfillmentEmail: Command<SslResendFulfillmentEmailParams, SslResendResult>;
138
+ editDCVMethod: Command<SslEditDcvMethodParams, SslActivateResult>;
139
+ getInfo: Command<SslGetInfoParams, SslGetInfoResult>;
140
+ renew: Command<SslRenewParams, SslRenewResult>;
141
+ purchaseMoreSans: Command<SslPurchaseMoreSansParams, SslPurchaseMoreSansResult>;
142
+ revokeCertificate: Command<SslRevokeCertificateParams, SslRevokeCertificateResult>;
143
+ }>;
144
+ readonly users: Group<{
145
+ getBalances: Command<Record<string, never>, UsersGetBalancesResult>;
146
+ getPricing: Command<UsersGetPricingParams, UsersGetPricingResult>;
147
+ changePassword: Command<UsersChangePasswordParams, UsersChangePasswordResult>;
148
+ update: Command<UsersUpdateParams, UsersUpdateResult>;
149
+ createAddFundsRequest: Command<UsersCreateAddFundsRequestParams, UsersCreateAddFundsRequestResult>;
150
+ getAddFundsStatus: Command<UsersGetAddFundsStatusParams, UsersGetAddFundsStatusResult>;
151
+ create: Command<UsersCreateParams, UsersCreateResult>;
152
+ login: Command<UsersLoginParams, UsersLoginResult>;
153
+ resetPassword: Command<UsersResetPasswordParams, UsersResetPasswordResult>;
154
+ }>;
155
+ readonly usersAddress: Group<{
156
+ create: Command<UsersAddressCreateParams, UsersAddressCreateResult>;
157
+ delete: Command<UsersAddressDeleteParams, UsersAddressDeleteResult>;
158
+ getInfo: Command<UsersAddressGetInfoParams, UsersAddressGetInfoResult>;
159
+ getList: Command<Record<string, never>, UsersAddressGetListResult>;
160
+ setDefault: Command<UsersAddressSetDefaultParams, UsersAddressSetDefaultResult>;
161
+ update: Command<UsersAddressUpdateParams, UsersAddressUpdateResult>;
162
+ }>;
163
+ readonly whoisGuard: Group<{
164
+ changeEmailAddress: Command<WhoisguardChangeEmailAddressParams, WhoisguardChangeEmailAddressResult>;
165
+ enable: Command<WhoisguardEnableParams, WhoisguardEnableResult>;
166
+ disable: Command<WhoisguardDisableParams, WhoisguardDisableResult>;
167
+ getList: Command<WhoisguardGetListParams, WhoisguardGetListResult>;
168
+ renew: Command<WhoisguardRenewParams, WhoisguardRenewResult>;
169
+ }>;
170
+ constructor(config: TransportConfig);
171
+ }
172
+
173
+ type ApiErrorItem = {
174
+ code: number;
175
+ message: string;
176
+ };
177
+ /** Thrown when the Namecheap API answers with `Status="ERROR"`. */
178
+ declare class NamecheapError extends Error {
179
+ readonly code: number;
180
+ readonly errors: readonly ApiErrorItem[];
181
+ constructor(errors: readonly ApiErrorItem[]);
182
+ }
183
+ /** Thrown when the HTTP request fails or answers with a non-2xx status. */
184
+ declare class NamecheapHttpError extends Error {
185
+ readonly status: number | undefined;
186
+ readonly statusText: string;
187
+ constructor(message: string, init?: {
188
+ status?: number;
189
+ statusText?: string;
190
+ cause?: unknown;
191
+ });
192
+ }
193
+ /** Thrown when a response body cannot be parsed or has an unexpected shape. */
194
+ declare class NamecheapParseError extends Error {
195
+ constructor(message: string, init?: {
196
+ cause?: unknown;
197
+ });
14
198
  }
15
199
 
16
200
  interface Paging {
17
201
  totalItems: number;
18
202
  currentPage: number;
19
203
  pageSize: number;
20
- paging: boolean;
21
204
  }
22
205
 
23
- interface DomainGetListResult {
206
+ type DomainsListType = "ALL" | "EXPIRING" | "EXPIRED";
207
+ type DomainsSortBy = "NAME" | "NAME_DESC" | "EXPIREDATE" | "EXPIREDATE_DESC" | "CREATEDATE" | "CREATEDATE_DESC";
208
+ interface DomainsGetListParams {
209
+ listType?: DomainsListType;
210
+ /** Keyword to look for in the domain list. */
211
+ searchTerm?: string;
212
+ page?: number;
213
+ /** Min 10, max 100. */
214
+ pageSize?: number;
215
+ sortBy?: DomainsSortBy;
216
+ }
217
+ interface DomainsListItem {
24
218
  id: number;
25
219
  name: string;
26
220
  user: string;
@@ -31,943 +225,940 @@ interface DomainGetListResult {
31
225
  autoRenew: boolean;
32
226
  whoisGuard: string;
33
227
  isPremium: boolean;
34
- isOurDns: boolean;
228
+ isOurDNS: boolean;
35
229
  }
36
- interface Contacts {
37
- registrant: ContactDetail;
38
- tech: ContactDetail;
39
- admin: ContactDetail;
40
- auxBilling: ContactDetail;
230
+ interface DomainsGetListResult {
231
+ domains: DomainsListItem[];
232
+ paging: Paging;
41
233
  }
42
- interface ContactDetail {
43
- organizationName?: string;
44
- jobTitle?: string;
234
+ declare const getList$5: Command<DomainsGetListParams, DomainsGetListResult>;
235
+ interface DomainsCheckParams {
236
+ /** Comma-separated list of domains to check (max 50). */
237
+ domainList: string;
238
+ }
239
+ interface DomainsCheckItem {
240
+ domain: string;
241
+ available: boolean;
242
+ /** Present in recorded responses, not in the reference. */
243
+ errorNo?: number;
244
+ /** Present in recorded responses, not in the reference. */
245
+ description?: string;
246
+ isPremiumName: boolean;
247
+ premiumRegistrationPrice: number;
248
+ premiumRenewalPrice: number;
249
+ premiumRestorePrice: number;
250
+ premiumTransferPrice: number;
251
+ icannFee: number;
252
+ eapFee: number;
253
+ }
254
+ type DomainsCheckResult = DomainsCheckItem[];
255
+ declare const check: Command<DomainsCheckParams, DomainsCheckResult>;
256
+ interface DomainsGetRegistrarLockParams {
257
+ domainName: string;
258
+ }
259
+ interface DomainsGetRegistrarLockResult {
260
+ domain: string;
261
+ registrarLockStatus: boolean;
262
+ }
263
+ declare const getRegistrarLock: Command<DomainsGetRegistrarLockParams, DomainsGetRegistrarLockResult>;
264
+ type DomainsLockAction = "LOCK" | "UNLOCK";
265
+ interface DomainsSetRegistrarLockParams {
266
+ domainName: string;
267
+ /** Default: LOCK. */
268
+ lockAction?: DomainsLockAction;
269
+ }
270
+ interface DomainsSetRegistrarLockResult {
271
+ domain: string;
272
+ isSuccess: boolean;
273
+ }
274
+ declare const setRegistrarLock: Command<DomainsSetRegistrarLockParams, DomainsSetRegistrarLockResult>;
275
+ /**
276
+ * @remarks Billed: this command charges your Namecheap account.
277
+ */
278
+ interface DomainsReactivateParams {
279
+ domainName: string;
280
+ promotionCode?: string;
281
+ /** Number of years to add after expiry. */
282
+ yearsToAdd?: number;
283
+ isPremiumDomain?: boolean;
284
+ /** Reactivation price for a premium domain. */
285
+ premiumPrice?: number | string;
286
+ }
287
+ interface DomainsReactivateResult {
288
+ domain: string;
289
+ isSuccess: boolean;
290
+ chargedAmount: number;
291
+ orderID: number;
292
+ transactionID: number;
293
+ }
294
+ declare const reactivate: Command<DomainsReactivateParams, DomainsReactivateResult>;
295
+ /**
296
+ * @remarks Billed: this command charges your Namecheap account.
297
+ */
298
+ interface DomainsRenewParams {
299
+ domainName: string;
300
+ years: number;
301
+ promotionCode?: string;
302
+ isPremiumDomain?: boolean;
303
+ /** Renewal price for a premium domain. */
304
+ premiumPrice?: number | string;
305
+ }
306
+ interface DomainsRenewResult {
307
+ domainName: string;
308
+ domainID: number;
309
+ renew: boolean;
310
+ chargedAmount: number;
311
+ orderID: number;
312
+ transactionID: number;
313
+ domainDetails: {
314
+ /** Date and time as sent by the server, e.g. `12/14/2034 1:01:07 PM`. */
315
+ expiredDate: string;
316
+ numYears: number;
317
+ };
318
+ }
319
+ declare const renew$2: Command<DomainsRenewParams, DomainsRenewResult>;
320
+ /**
321
+ * One contact block of a request. Nested under `registrant`, `tech`, `admin` or
322
+ * `auxBilling`, so `registrant.firstName` is sent as `RegistrantFirstName`.
323
+ */
324
+ interface DomainsContactParams {
45
325
  firstName: string;
46
326
  lastName: string;
47
327
  address1: string;
48
- address2?: string;
49
328
  city: string;
50
329
  stateProvince: string;
51
- stateProvinceChoice?: string;
52
- postalCode: string | number;
330
+ postalCode: string;
53
331
  country: string;
54
- phone: string | number;
55
- fax?: number;
332
+ /** Format +NNN.NNNNNNNNNN. */
333
+ phone: string;
56
334
  emailAddress: string;
57
- phoneExt?: number;
58
- readOnly?: boolean;
335
+ organizationName?: string;
336
+ jobTitle?: string;
337
+ address2?: string;
59
338
  }
60
- interface CurrentAttributes {
61
- registrantNexus: string;
62
- registrantPurpose: string;
339
+ interface DomainsSetContactsParams {
340
+ domainName: string;
341
+ registrant: DomainsContactParams;
342
+ tech: DomainsContactParams;
343
+ admin: DomainsContactParams;
344
+ auxBilling: DomainsContactParams;
63
345
  }
64
- interface DomainContactsResult extends Contacts {
65
- currentAttributes: CurrentAttributes;
66
- whoisGuardContact: Contacts & {
67
- whoisGuardContact: boolean;
68
- };
346
+ interface DomainsSetContactsResult {
69
347
  domain: string;
70
- domainnameid: number;
348
+ isSuccess: boolean;
349
+ }
350
+ declare const setContacts: Command<DomainsSetContactsParams, DomainsSetContactsResult>;
351
+ /**
352
+ * @remarks Billed: this command charges your Namecheap account.
353
+ */
354
+ interface DomainsCreateParams {
355
+ domainName: string;
356
+ years: number;
357
+ promotionCode?: string;
358
+ registrant: DomainsContactParams;
359
+ tech: DomainsContactParams;
360
+ admin: DomainsContactParams;
361
+ auxBilling: DomainsContactParams;
362
+ /** Comma-separated custom nameservers. */
363
+ nameservers?: string;
364
+ /** Add free domain privacy, `Yes` or `No`. Default: Yes. */
365
+ addFreeWhoisguard?: string;
366
+ /** Enable domain privacy, `Yes` or `No`. Default: No. */
367
+ wgEnabled?: string;
368
+ isPremiumDomain?: boolean;
369
+ /** Registration price for a premium domain. */
370
+ premiumPrice?: number | string;
371
+ /** Purchase fee for a premium domain during EAP. */
372
+ eapFee?: number | string;
71
373
  }
72
- interface DomainCreateResult {
374
+ interface DomainsCreateResult {
73
375
  domain: string;
74
376
  registered: boolean;
75
377
  chargedAmount: number;
76
- domainId: number;
77
- orderId: number;
78
- transactionId: number;
79
- whoisguardEnable: boolean;
80
- nonRealTimeDomain: boolean;
81
- }
82
- interface Category {
378
+ domainID: number;
379
+ orderID: number;
380
+ transactionID: number;
381
+ /** Present in recorded responses, not in the reference's response table. */
382
+ whoisguardEnable?: boolean;
383
+ /** Present in recorded responses, not in the reference's response table. */
384
+ nonRealTimeDomain?: boolean;
385
+ }
386
+ declare const create$5: Command<DomainsCreateParams, DomainsCreateResult>;
387
+ interface DomainsTld {
83
388
  name: string;
84
- sequenceNumber: number;
85
- }
86
- interface TLD {
87
- value: string;
88
- name: string;
89
- nonRealTime: boolean;
389
+ nonRealTimeDomain: boolean;
90
390
  minRegisterYears: number;
91
391
  maxRegisterYears: number;
92
392
  minRenewYears: number;
93
393
  maxRenewYears: number;
94
- renewalMinDays?: number;
95
- renewalMaxDays?: number;
96
- reactivateMaxDays?: number;
97
394
  minTransferYears: number;
98
395
  maxTransferYears: number;
99
396
  isApiRegisterable: boolean;
100
397
  isApiRenewable: boolean;
101
398
  isApiTransferable: boolean;
102
399
  isEppRequired: boolean;
103
- isDisableModContact: boolean;
104
- isDisableWgAllot: boolean;
105
- isIncludeInExtendedSearchOnly: boolean;
106
- sequenceNumber: number;
107
- type: string;
108
- subType?: string;
109
- isSupportsIdn: boolean;
110
- category: string;
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>;
119
- }
120
- interface DomainCheckResult {
121
- domain: string;
122
- available: boolean;
123
- errorNo: number;
124
- isPremiumName: boolean;
125
- premiumRegistrationPrice: number;
126
- premiumRenewalPrice: number;
127
- premiumRestorePrice: number;
128
- premiumTransferPrice: number;
129
- icannFee: number;
130
- eapFee: number;
400
+ /** Text content of the `Tld` element, e.g. `.com domain`. */
401
+ description: string;
131
402
  }
132
- interface DomainReactivateResult {
133
- domain: string;
134
- isSuccess: boolean;
135
- chargedAmount: number;
136
- orderId: number;
137
- transactionId: number;
138
- }
139
- interface DomainRenewResult {
140
- domainDetails: {
141
- expiredDate: string;
142
- numYears: number;
143
- domainDetails: boolean;
144
- };
403
+ type DomainsGetTldListResult = DomainsTld[];
404
+ declare const getTldList: Command<Record<string, never>, DomainsGetTldListResult>;
405
+ interface DomainsGetContactsParams {
145
406
  domainName: string;
146
- domainId: number;
147
- renew: true;
148
- orderId: number;
149
- transactionId: number;
150
- chargedAmount: number;
151
407
  }
152
- interface DomainGetRegistrarLockResult {
408
+ /** A contact as returned by getContacts; the API omits fields it has no value for. */
409
+ interface DomainsContact {
410
+ organizationName?: string;
411
+ jobTitle?: string;
412
+ firstName?: string;
413
+ lastName?: string;
414
+ address1?: string;
415
+ address2?: string;
416
+ city?: string;
417
+ stateProvince?: string;
418
+ postalCode?: string;
419
+ country?: string;
420
+ phone?: string;
421
+ emailAddress?: string;
422
+ }
423
+ interface DomainsGetContactsResult {
153
424
  domain: string;
154
- registrarLockStatus: boolean;
155
- isClientUpdateProhibited?: boolean;
156
- isClientDeleteProhibited?: boolean;
157
- isClientHold?: boolean;
425
+ /** Sent as the lower-case attribute `domainnameid`. */
426
+ domainnameid: number;
427
+ /** Absent in live responses, which carry ReadOnly on each contact block instead. */
428
+ readonly?: boolean;
429
+ registrant?: DomainsContact;
430
+ tech?: DomainsContact;
431
+ admin?: DomainsContact;
432
+ auxBilling?: DomainsContact;
433
+ }
434
+ declare const getContacts: Command<DomainsGetContactsParams, DomainsGetContactsResult>;
435
+ interface DomainsGetInfoParams {
436
+ domainName: string;
437
+ /** Hosted domain name for which domain info is requested. */
438
+ hostName?: string;
158
439
  }
159
- interface DomainGetInfoResult {
440
+ interface DomainsGetInfoResult {
441
+ /** Documented as OK, Locked or Expired; absent from the recorded response. */
442
+ status?: string;
443
+ id: number;
444
+ domainName: string;
445
+ ownerName: string;
446
+ isOwner: boolean;
447
+ isPremium: boolean;
160
448
  domainDetails: {
161
- createdDate: string;
162
- expiredDate: string;
163
- numYears?: number;
164
- domainDetails: boolean;
449
+ /** `MM/DD/YYYY`. */
450
+ createdDate?: string;
451
+ /** `MM/DD/YYYY`. */
452
+ expiredDate?: string;
453
+ numYears: number;
165
454
  };
166
455
  whoisguard: {
167
- id: number;
168
- expiredDate: string;
456
+ /** `True`, `False` or `NotAlloted`. */
169
457
  enabled: string;
458
+ /** 0 means not alloted. */
459
+ id: number;
460
+ expiredDate?: string;
461
+ emailDetails?: {
462
+ whoisGuardEmail: string;
463
+ forwardedTo: string;
464
+ lastAutoEmailChangeDate: string;
465
+ autoEmailChangeFrequencyDays: number;
466
+ };
170
467
  };
171
- premiumDnsSubscription?: {
468
+ premiumDnsSubscription: {
172
469
  useAutoRenew: boolean;
470
+ /** -1 means no subscription. */
173
471
  subscriptionId: number;
472
+ /** ISO without zone; `0001-01-01T00:00:00` means never. */
174
473
  createdDate: string;
175
474
  expirationDate: string;
176
475
  isActive: boolean;
177
- premiumDnsSubscription: boolean;
178
476
  };
179
477
  dnsDetails: {
180
- nameserver?: Array<string>;
181
478
  providerType: string;
182
- isUsingOurDns?: boolean;
183
- hostCount?: number;
184
- emailType?: string;
185
- dynamicDnsStatus?: boolean;
186
- isFailover?: boolean;
479
+ isUsingOurDNS: boolean;
480
+ hostCount: number;
481
+ emailType: string;
482
+ dynamicDNSStatus: boolean;
483
+ isFailover: boolean;
484
+ nameservers: string[];
187
485
  };
188
486
  modificationrights: {
189
- all: boolean;
487
+ all?: boolean;
488
+ rights: Array<{
489
+ type: string;
490
+ value: string;
491
+ }>;
190
492
  };
191
- status: string;
192
- id: number;
193
- domainName: string;
194
- ownerName: string;
195
- isOwner: boolean;
196
- isPremium: boolean;
197
493
  }
198
-
199
- declare const RecordType: {
200
- readonly A: "A";
201
- readonly AAAA: "AAAA";
202
- readonly ALIAS: "ALIAS";
203
- readonly CAA: "CAA";
204
- readonly CNAME: "CNAME";
205
- readonly MX: "MX";
206
- readonly MXE: "MXE";
207
- readonly NS: "NS";
208
- readonly TXT: "TXT";
209
- readonly URL: "URL";
210
- readonly URL301: "URL301";
211
- readonly FRAME: "FRAME";
212
- };
213
- type RecordType = (typeof RecordType)[keyof typeof RecordType];
214
- declare const EmailType: {
215
- readonly MXE: "MXE";
216
- readonly MX: "MX";
217
- readonly FWD: "FWD";
218
- readonly OX: "OX";
219
- };
220
- type EmailType = (typeof EmailType)[keyof typeof EmailType];
221
- declare const LockAction: {
222
- readonly Lock: "LOCK";
223
- readonly Unlock: "UNLOCK";
224
- };
225
- type LockAction = (typeof LockAction)[keyof typeof LockAction];
226
- declare const DomainListType: {
227
- readonly All: "ALL";
228
- readonly Expiring: "EXPIRING";
229
- readonly Expired: "EXPIRED";
230
- };
231
- type DomainListType = (typeof DomainListType)[keyof typeof DomainListType];
232
- declare const DomainListSortBy: {
233
- readonly NameAsc: "NAME";
234
- readonly NameDesc: "NAME_DESC";
235
- readonly ExpireDateAsc: "EXPIREDATE";
236
- readonly ExpireDateDesc: "EXPIREDATE_DESC";
237
- readonly CreateDateAsc: "CREATEDATE";
238
- readonly CreateDateDesc: "CREATEDATE_DESC";
239
- };
240
- type DomainListSortBy = (typeof DomainListSortBy)[keyof typeof DomainListSortBy];
241
- declare const IdnCode: {
242
- readonly AFR: "afr";
243
- readonly ALB: "alb";
244
- readonly ARA: "ara";
245
- readonly ARG: "arg";
246
- readonly ARM: "arm";
247
- readonly ASM: "asm";
248
- readonly AST: "ast";
249
- readonly AVE: "ave";
250
- readonly AWA: "awa";
251
- readonly AZE: "aze";
252
- readonly BAK: "bak";
253
- readonly BAL: "bal";
254
- readonly BAN: "ban";
255
- readonly BAQ: "baq";
256
- readonly BAS: "bas";
257
- readonly BEL: "bel";
258
- readonly BEN: "ben";
259
- readonly BHO: "bho";
260
- readonly BOS: "bos";
261
- readonly BUL: "bul";
262
- readonly BUR: "bur";
263
- readonly CAR: "car";
264
- readonly CAT: "cat";
265
- readonly CHE: "che";
266
- readonly CHI: "chi";
267
- readonly CHV: "chv";
268
- readonly COP: "cop";
269
- readonly COS: "cos";
270
- readonly CZE: "cze";
271
- readonly DAN: "dan";
272
- readonly DIV: "div";
273
- readonly DOI: "doi";
274
- readonly DUT: "dut";
275
- readonly ENG: "eng";
276
- readonly EST: "est";
277
- readonly FAO: "fao";
278
- readonly FIJ: "fij";
279
- readonly FIN: "fin";
280
- readonly FRE: "fre";
281
- readonly FRY: "fry";
282
- readonly GEO: "geo";
283
- readonly GER: "ger";
284
- readonly GLA: "gla";
285
- readonly GLE: "gle";
286
- readonly GON: "gon";
287
- readonly GRE: "gre";
288
- readonly GUJ: "guj";
289
- readonly HEB: "heb";
290
- readonly HIN: "hin";
291
- readonly HUN: "hun";
292
- readonly INC: "inc";
293
- readonly IND: "ind";
294
- readonly INH: "inh";
295
- readonly ISL: "isl";
296
- readonly ITA: "ita";
297
- readonly JAV: "jav";
298
- readonly JPN: "jpn";
299
- readonly KAS: "kas";
300
- readonly KAZ: "kaz";
301
- readonly KHM: "khm";
302
- readonly KIR: "kir";
303
- readonly KOR: "kor";
304
- readonly KUR: "kur";
305
- readonly LAO: "lao";
306
- readonly LAV: "lav";
307
- readonly LIT: "lit";
308
- readonly LTZ: "ltz";
309
- readonly MAL: "mal";
310
- readonly MKD: "mkd";
311
- readonly MLT: "mlt";
312
- readonly MOL: "mol";
313
- readonly MON: "mon";
314
- readonly MRI: "mri";
315
- readonly MSA: "msa";
316
- readonly NEP: "nep";
317
- readonly NOR: "nor";
318
- readonly ORI: "ori";
319
- readonly OSS: "oss";
320
- readonly PAN: "pan";
321
- readonly PER: "per";
322
- readonly POL: "pol";
323
- readonly POR: "por";
324
- readonly PUS: "pus";
325
- readonly RAJ: "raj";
326
- readonly RUM: "rum";
327
- readonly RUS: "rus";
328
- readonly SAN: "san";
329
- readonly SCR: "scr";
330
- readonly SIN: "sin";
331
- readonly SLO: "slo";
332
- readonly SLV: "slv";
333
- readonly SMO: "smo";
334
- readonly SND: "snd";
335
- readonly SOM: "som";
336
- readonly SPA: "spa";
337
- readonly SRD: "srd";
338
- readonly SRP: "srp";
339
- readonly SWA: "swa";
340
- readonly SWE: "swe";
341
- readonly SYR: "syr";
342
- readonly TAM: "tam";
343
- readonly TEL: "tel";
344
- readonly TGK: "tgk";
345
- readonly THA: "tha";
346
- readonly TIB: "tib";
347
- readonly TUR: "tur";
348
- readonly UKR: "ukr";
349
- readonly URD: "urd";
350
- readonly UZB: "uzb";
351
- readonly VIE: "vie";
352
- readonly WEL: "wel";
353
- readonly YID: "yid";
354
- };
355
- type IdnCode = (typeof IdnCode)[keyof typeof IdnCode];
356
- declare const DomainTransferListType: {
357
- readonly All: "ALL";
358
- readonly InProgress: "INPROGRESS";
359
- readonly Cancelled: "CANCELLED";
360
- readonly Completed: "COMPLETED";
361
- };
362
- type DomainTransferListType = (typeof DomainTransferListType)[keyof typeof DomainTransferListType];
363
- declare const DomainTransferSortBy: {
364
- readonly DomainName: "DOMAINNAME";
365
- readonly DomainNameDesc: "DOMAINNAME_DESC";
366
- readonly TransferDate: "TRANSFERDATE";
367
- readonly TransferDateDesc: "TRANSFERDATE_DESC";
368
- readonly StatusDate: "STATUSDATE";
369
- readonly StatusDateDesc: "STATUSDATE_DESC";
370
- };
371
- type DomainTransferSortBy = (typeof DomainTransferSortBy)[keyof typeof DomainTransferSortBy];
372
- declare const SSLType: {
373
- readonly PositiveSSL: "PositiveSSL";
374
- readonly EssentialSSL: "EssentialSSL";
375
- readonly InstantSSL: "InstantSSL";
376
- readonly InstantSSLPro: "InstantSSL Pro";
377
- readonly PremiumSSL: "PremiumSSL";
378
- readonly EVSSL: "EV SSL";
379
- readonly PositiveSSLWildcard: "PositiveSSL Wildcard";
380
- readonly EssentialSSLWildcard: "EssentialSSL Wildcard";
381
- readonly PremiumSSLWildcard: "PremiumSSL Wildcard";
382
- readonly PositiveSSLMultiDomain: "PositiveSSL Multi Domain";
383
- readonly MultiDomainSSL: "Multi Domain SSL";
384
- readonly UnifiedCommunications: "Unified Communications";
385
- readonly EVMultiDomainSSL: "EV Multi Domain SSL";
494
+ declare const getInfo$3: Command<DomainsGetInfoParams, DomainsGetInfoResult>;
495
+ /**
496
+ * The command table behind `client.domains`. Advanced use only: it is exported for custom
497
+ * integrations and is not covered by semver stability.
498
+ */
499
+ declare const domainsCommands: {
500
+ getList: Command<DomainsGetListParams, DomainsGetListResult>;
501
+ check: Command<DomainsCheckParams, DomainsCheckResult>;
502
+ getRegistrarLock: Command<DomainsGetRegistrarLockParams, DomainsGetRegistrarLockResult>;
503
+ setRegistrarLock: Command<DomainsSetRegistrarLockParams, DomainsSetRegistrarLockResult>;
504
+ reactivate: Command<DomainsReactivateParams, DomainsReactivateResult>;
505
+ renew: Command<DomainsRenewParams, DomainsRenewResult>;
506
+ setContacts: Command<DomainsSetContactsParams, DomainsSetContactsResult>;
507
+ create: Command<DomainsCreateParams, DomainsCreateResult>;
508
+ getTldList: Command<Record<string, never>, DomainsGetTldListResult>;
509
+ getContacts: Command<DomainsGetContactsParams, DomainsGetContactsResult>;
510
+ getInfo: Command<DomainsGetInfoParams, DomainsGetInfoResult>;
386
511
  };
387
- type SSLType = (typeof SSLType)[keyof typeof SSLType];
388
- declare const SSLListType: {
389
- readonly ALL: "ALL";
390
- readonly Processing: "Processing";
391
- readonly EmailSent: "EmailSent";
392
- readonly TechnicalProblem: "TechnicalProblem";
393
- readonly InProgress: "InProgress";
394
- readonly Completed: "Completed";
395
- readonly Deactivated: "Deactivated";
396
- readonly Active: "Active";
397
- readonly Cancelled: "Cancelled";
398
- readonly NewPurchase: "NewPurchase";
399
- readonly NewRenewal: "NewRenewal";
400
- };
401
- type SSLListType = (typeof SSLListType)[keyof typeof SSLListType];
402
- declare const SSLListSortBy: {
403
- readonly PurchaseDate: "PURCHASEDATE";
404
- readonly PurchaseDateDesc: "PURCHASEDATE_DESC";
405
- readonly SSLType: "SSLTYPE";
406
- readonly SSLTypeDesc: "SSLTYPE_DESC";
407
- readonly ExpireDateTime: "EXPIREDATETIME";
408
- readonly ExpireDateTimeDesc: "EXPIREDATETIME_DESC";
409
- readonly Hostname: "Host_Name";
410
- readonly HostnameDesc: "Host_Name_DESC";
411
- };
412
- type SSLListSortBy = (typeof SSLListSortBy)[keyof typeof SSLListSortBy];
413
- declare const UserProductType: {
414
- readonly Domain: "DOMAIN";
415
- readonly SslCertificate: "SSLCERTIFICATE";
416
- };
417
- type UserProductType = (typeof UserProductType)[keyof typeof UserProductType];
418
- declare const UserProductCategory: {
419
- readonly Domains: "DOMAINS";
420
- readonly Comodo: "COMODO";
421
- };
422
- type UserProductCategory = (typeof UserProductCategory)[keyof typeof UserProductCategory];
423
- declare const UserActionName: {
424
- readonly Register: "REGISTER";
425
- readonly Renew: "RENEW";
426
- readonly Reactivate: "REACTIVATE";
427
- readonly Transfer: "TRANSFER";
428
- readonly Purchase: "PURCHASE";
429
- };
430
- type UserActionName = (typeof UserActionName)[keyof typeof UserActionName];
431
- declare const UserProductName: {
432
- readonly COM: "COM";
433
- readonly InstantSsl: "INSTANTSSL";
434
- };
435
- type UserProductName = (typeof UserProductName)[keyof typeof UserProductName];
436
- declare const UserPaymentType: {
437
- readonly CreditCard: "Creditcard";
438
- };
439
- type UserPaymentType = (typeof UserPaymentType)[keyof typeof UserPaymentType];
440
- declare const UserListFindBy: {
441
- readonly EmailAddress: "EMAILADDRESS";
442
- readonly DomainName: "DOMAINNAME";
443
- readonly Username: "USERNAME";
444
- };
445
- type UserListFindBy = (typeof UserListFindBy)[keyof typeof UserListFindBy];
446
- declare const WhoIsListType: {
447
- readonly All: "ALL";
448
- readonly Alloted: "ALLOTED";
449
- readonly Free: "FREE";
450
- readonly Discard: "DISCARD";
451
- };
452
- type WhoIsListType = (typeof WhoIsListType)[keyof typeof WhoIsListType];
453
- declare const GetAddFundsStatus: {
454
- readonly Created: "CREATED";
455
- readonly Submitted: "SUBMITTED";
456
- readonly Completed: "COMPLETED";
457
- readonly Failed: "FAILED";
458
- readonly Expired: "EXPIRED";
459
- };
460
- type GetAddFundsStatus = (typeof GetAddFundsStatus)[keyof typeof GetAddFundsStatus];
461
- declare const DomainDnsTag: {
462
- Issue: string;
463
- IssueWild: string;
464
- IODEF: string;
465
- };
466
- type DomainDnsTag = (typeof DomainDnsTag)[keyof typeof DomainDnsTag];
467
512
 
468
- interface GetListParams$1 {
469
- listType?: DomainListType;
470
- searchTerm?: string;
471
- page?: number;
472
- pageSize?: number;
473
- sortBy?: DomainListSortBy;
474
- }
475
- interface CreateDomainParams extends Contacts {
476
- domainName: string;
477
- years: number;
478
- promoCode?: string;
479
- billing?: Partial<ContactDetail>;
480
- idnCode?: IdnCode;
481
- extendedAttributes?: string;
482
- nameservers?: string;
483
- addFreeWhoisguard?: string;
484
- WGEnabled?: string;
485
- isPremiumDomain?: boolean;
486
- premiumPrice?: number;
487
- eapFee?: number;
513
+ interface DnsSetDefaultParams {
514
+ /** SLD of the domain name. */
515
+ sld: string;
516
+ /** TLD of the domain name. */
517
+ tld: string;
488
518
  }
489
- interface ContactDomainParams extends Contacts {
490
- domainName: string;
491
- extendedAttributes?: string;
519
+ interface DnsSetDefaultResult {
520
+ domain: string;
521
+ updated: boolean;
492
522
  }
493
- interface ReactivateDomainParams {
494
- domainName: string;
495
- promotionCode?: string;
496
- yearsToAdd?: number;
497
- isPremiumDomain?: boolean;
498
- premiumPrice?: number;
523
+ declare const setDefault$1: Command<DnsSetDefaultParams, DnsSetDefaultResult>;
524
+ interface DnsSetCustomParams {
525
+ sld: string;
526
+ tld: string;
527
+ /** Comma-separated list of nameservers. */
528
+ nameservers: string;
499
529
  }
500
- interface RenewDomainParams {
501
- domainName: string;
502
- years: number;
503
- promotionCode?: string;
504
- isPremiumDomain?: boolean;
505
- premiumPrice?: number;
530
+ interface DnsSetCustomResult {
531
+ domain: string;
532
+ updated: boolean;
506
533
  }
507
-
508
- declare class Domains {
509
- private readonly config;
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
- */
515
- getList(params?: GetListParams$1): Promise<{
516
- data: Array<DomainGetListResult>;
517
- paging: Paging;
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
- */
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
- */
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
- */
536
- getTldList(): Promise<Array<TLD>>;
537
- /**
538
- * Sets contact information for the requested domain
539
- */
540
- setContacts(domain: string, params: Omit<ContactDomainParams, "domainName">): Promise<string>;
541
- /**
542
- * Checks the availability of domains
543
- */
544
- check(domains: Array<string>): Promise<Array<DomainCheckResult>>;
545
- /**
546
- * Reactivates an expired domain
547
- */
548
- reactivate(domain: string, params?: Omit<ReactivateDomainParams, "domainName">): Promise<DomainReactivateResult>;
549
- /**
550
- * Renews an expiring domain
551
- */
552
- renew(domain: string, params: Omit<RenewDomainParams, "domainName">): Promise<DomainRenewResult>;
553
- /**
554
- * Gets the Registrar Lock status for the requested domain
555
- */
556
- getRegistrarLock(domain: string): Promise<DomainGetRegistrarLockResult>;
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
- */
565
- getInfo(domain: string, hostName?: string): Promise<DomainGetInfoResult>;
534
+ declare const setCustom: Command<DnsSetCustomParams, DnsSetCustomResult>;
535
+ interface DnsGetListParams {
536
+ sld: string;
537
+ tld: string;
566
538
  }
567
-
568
- interface DomainDnsGetListResult {
569
- nameserver: Array<string>;
539
+ interface DnsGetListResult {
570
540
  domain: string;
571
- isUsingOurDns: boolean;
541
+ isUsingOurDNS: boolean;
542
+ /** Present in recorded responses, not in the reference. */
543
+ isPremiumDNS?: boolean;
544
+ /** Present in recorded responses, not in the reference. */
545
+ isUsingFreeDNS?: boolean;
546
+ /** Taken from the recorded responses (not in the reference's response table); empty when none are listed. */
547
+ nameservers: string[];
548
+ }
549
+ declare const getList$4: Command<DnsGetListParams, DnsGetListResult>;
550
+ interface DnsGetHostsParams {
551
+ sld: string;
552
+ tld: string;
572
553
  }
573
- interface Host$1 {
554
+ interface DnsHost {
555
+ /** The reference spells the attribute `HostID`; responses carry `HostId`. */
574
556
  hostId: number;
575
557
  name: string;
576
558
  type: string;
577
559
  address: string;
578
560
  mxPref: number;
579
561
  ttl: number;
580
- }
581
- interface DomainDnsGetHostsResult {
582
- host: Array<Host$1>;
562
+ /** Present in recorded responses, not in the reference. */
563
+ associatedAppTitle?: string;
564
+ /** Present in recorded responses, not in the reference. */
565
+ friendlyName?: string;
566
+ /** Present in recorded responses, not in the reference. */
567
+ isActive?: boolean;
568
+ /** Present in recorded responses, not in the reference. */
569
+ isDDNSEnabled?: boolean;
570
+ }
571
+ interface DnsGetHostsResult {
583
572
  domain: string;
584
- isUsingOurDns: boolean;
573
+ /** Present in recorded responses, not in the reference. */
574
+ emailType?: string;
575
+ isUsingOurDNS: boolean;
576
+ hosts: DnsHost[];
577
+ }
578
+ declare const getHosts: Command<DnsGetHostsParams, DnsGetHostsResult>;
579
+ interface DnsGetEmailForwardingParams {
580
+ /** Domain name to get settings for. */
581
+ domainName: string;
585
582
  }
586
- interface Forward {
587
- value: string;
583
+ interface DnsEmailForward {
588
584
  mailbox: string;
585
+ /** Present in recorded responses, not in the reference. */
586
+ forwardTo?: string;
589
587
  }
590
- interface DomainDnsGetEmailForwardingResult {
591
- forward: Array<Forward>;
588
+ interface DnsGetEmailForwardingResult {
592
589
  domain: string;
590
+ forwards: DnsEmailForward[];
593
591
  }
594
-
595
- interface SetDNSEmailForwardingParams {
592
+ declare const getEmailForwarding: Command<DnsGetEmailForwardingParams, DnsGetEmailForwardingResult>;
593
+ /** One forwarding rule, sent as `MailBox<n>` and `ForwardTo<n>`. */
594
+ interface DnsEmailForwardRecord {
595
+ /** Mailbox for email forwarding (e.g. `example@domain.com`). */
596
+ mailBox: string;
597
+ /** Email address to forward to (e.g. `example@gmail.com`). */
598
+ forwardTo: string;
599
+ }
600
+ interface DnsSetEmailForwardingParams {
596
601
  domainName: string;
597
- mailBox: Array<string>;
598
- forwardTo: Array<string>;
602
+ /** An empty list is allowed and clears the domain's email forwarding. */
603
+ forwards: DnsEmailForwardRecord[];
599
604
  }
600
- interface Host {
601
- hostname: string;
602
- recordType: RecordType;
605
+ interface DnsSetEmailForwardingResult {
606
+ domain: string;
607
+ isSuccess: boolean;
608
+ }
609
+ declare const setEmailForwarding: Command<DnsSetEmailForwardingParams, DnsSetEmailForwardingResult>;
610
+ type DnsRecordType = "A" | "AAAA" | "ALIAS" | "CAA" | "CNAME" | "MX" | "MXE" | "NS" | "TXT" | "URL" | "URL301" | "FRAME";
611
+ type DnsEmailType = "NONE" | "MXE" | "MX" | "FWD" | "OX" | "GMAIL";
612
+ /** One host record, sent as `HostName<n>`, `RecordType<n>`, `Address<n>`, `MXPref<n>`, `TTL<n>`. */
613
+ interface DnsHostRecord {
614
+ /** Sub-domain/hostname for the record. */
615
+ hostName: string;
616
+ recordType: DnsRecordType;
617
+ /** URL or IP address, depending on the record type. */
603
618
  address: string;
604
- mxpref?: string;
619
+ /** MX preference (MX records only). Required by the reference, but optional on the wire. */
620
+ mxPref?: number;
621
+ /** Time to live (300-60000). */
605
622
  ttl?: number;
606
623
  }
607
- interface SetDNSHostsParams {
624
+ interface DnsSetHostsParams {
608
625
  sld: string;
609
626
  tld: string;
610
- emailType?: EmailType;
611
- flag?: number;
612
- tag?: DomainDnsTag;
613
- hostname: Array<string>;
614
- ttl: Array<number>;
615
- address: Array<string>;
616
- mxpref: Array<string>;
617
- recordType: Array<RecordType>;
618
- }
619
-
620
- declare class DomainsDNS {
621
- private readonly config;
622
- constructor(config: NamecheapProps);
623
- /**
624
- * Sets domain to use namecheap api default DNS servers.
625
- * Required for free services like Host record management, URL forwarding, email forwarding, dynamic dns and other value added services.
626
- */
627
- setDefault(sld: string, tld: string): Promise<string>;
628
- /**
629
- * Sets domain to use custom DNS servers.
630
- * @note Services like URL forwarding, Email forwarding, Dynamic DNS will not work for domains using custom nameservers
631
- */
632
- setCustom(sld: string, tld: string, nameservers: Array<string>): Promise<string>;
633
- /**
634
- * Gets a list of DNS servers associated with the requested domain.
635
- */
636
- getList(sld: string, tld: string): Promise<DomainDnsGetListResult>;
637
- /**
638
- * Retrieves DNS host record settings for the requested domain.
639
- */
640
- getHosts(sld: string, tld: string): Promise<DomainDnsGetHostsResult>;
641
- /**
642
- * Gets email forwarding settings for the requested domain.
643
- */
644
- getEmailForwarding(domain: string): Promise<DomainDnsGetEmailForwardingResult>;
645
- /**
646
- * Sets email forwarding for a domain name.
647
- */
648
- setEmailForwarding(domain: string, params: Omit<SetDNSEmailForwardingParams, "domainName">): Promise<string>;
649
627
  /**
650
- * Sets DNS host records settings for the requested domain.
651
- * @note If you set more than 10 hosts the request will be done by POST method otherwise by GET method.
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.
628
+ * Omitted keeps the zone's current mode.
629
+ *
630
+ * @remarks The reference warns that MX records are silently discarded unless the
631
+ * resulting email mode is `MX`. `setHosts` replaces the whole zone, so a call that
632
+ * lists MX hosts under another mode loses the mail routing.
653
633
  */
654
- setHosts(sld: string, tld: string, params: Omit<SetDNSHostsParams, "sld" | "tld" | "address" | "hostname" | "mxpref" | "recordType" | "ttl"> & {
655
- hosts: Array<Host>;
656
- }): Promise<Array<string>>;
634
+ emailType?: DnsEmailType;
635
+ /** Replaces the whole zone: records not listed are deleted, so at least one is required. */
636
+ hosts: [DnsHostRecord, ...DnsHostRecord[]];
657
637
  }
658
-
659
- interface GenericDomain {
638
+ interface DnsSetHostsResult {
660
639
  domain: string;
640
+ /** Present in recorded responses, not in the reference. */
641
+ emailType?: string;
642
+ isSuccess: boolean;
643
+ }
644
+ declare const setHosts: Command<DnsSetHostsParams, DnsSetHostsResult>;
645
+ /**
646
+ * The command table behind `client.dns`. Advanced use only: it is exported for custom
647
+ * integrations and is not covered by semver stability.
648
+ */
649
+ declare const dnsCommands: {
650
+ setDefault: Command<DnsSetDefaultParams, DnsSetDefaultResult>;
651
+ setCustom: Command<DnsSetCustomParams, DnsSetCustomResult>;
652
+ getList: Command<DnsGetListParams, DnsGetListResult>;
653
+ getHosts: Command<DnsGetHostsParams, DnsGetHostsResult>;
654
+ getEmailForwarding: Command<DnsGetEmailForwardingParams, DnsGetEmailForwardingResult>;
655
+ setEmailForwarding: Command<DnsSetEmailForwardingParams, DnsSetEmailForwardingResult>;
656
+ setHosts: Command<DnsSetHostsParams, DnsSetHostsResult>;
657
+ };
658
+
659
+ interface NsCreateParams {
660
+ /** SLD of the domain name. */
661
+ sld: string;
662
+ /** TLD of the domain name. */
663
+ tld: string;
664
+ /** Nameserver to create. */
661
665
  nameserver: string;
666
+ /** Nameserver IP address. */
667
+ ip: string;
662
668
  }
663
- interface DomainNsCreateResult extends GenericDomain {
669
+ interface NsCreateResult {
670
+ domain: string;
671
+ nameserver: string;
664
672
  ip: string;
665
673
  isSuccess: boolean;
666
674
  }
667
- interface DomainNsDeleteResult extends GenericDomain {
675
+ declare const create$4: Command<NsCreateParams, NsCreateResult>;
676
+ interface NsDeleteParams {
677
+ sld: string;
678
+ tld: string;
679
+ /** Nameserver to delete. */
680
+ nameserver: string;
681
+ }
682
+ interface NsDeleteResult {
683
+ domain: string;
684
+ nameserver: string;
668
685
  isSuccess: boolean;
669
686
  }
670
- interface DomainNsInfoResult extends GenericDomain {
671
- nameserverStatuses: Array<string>;
687
+ declare const deleteNs: Command<NsDeleteParams, NsDeleteResult>;
688
+ interface NsGetInfoParams {
689
+ sld: string;
690
+ tld: string;
691
+ /** Nameserver to get info for. */
692
+ nameserver: string;
672
693
  }
673
- interface DomainNsUpdateResult {
694
+ interface NsGetInfoResult {
674
695
  domain: string;
675
- nameserverStatuses: Array<string>;
676
- isSuccess: boolean;
696
+ nameserver: string;
697
+ ip: string;
698
+ /** Present in recorded responses, not in the reference. */
699
+ nameserverStatuses?: string[];
677
700
  }
678
-
679
- declare class DomainsNS {
680
- private readonly config;
681
- constructor(config: NamecheapProps);
682
- create(sld: string, tld: string, nameserver: string, ip: string): Promise<DomainNsCreateResult>;
683
- delete(sld: string, tld: string, nameserver: string): Promise<DomainNsDeleteResult>;
684
- getInfo(sld: string, tld: string, nameserver: string): Promise<DomainNsInfoResult>;
685
- update(sld: string, tld: string, nameserver: string, ip: string, oldIp: string): Promise<DomainNsUpdateResult>;
701
+ declare const getInfo$2: Command<NsGetInfoParams, NsGetInfoResult>;
702
+ interface NsUpdateParams {
703
+ sld: string;
704
+ tld: string;
705
+ /** Nameserver to update. */
706
+ nameserver: string;
707
+ /** Existing IP address. */
708
+ oldIP: string;
709
+ /** New IP address. */
710
+ ip: string;
686
711
  }
712
+ interface NsUpdateResult {
713
+ domain: string;
714
+ nameserver: string;
715
+ isSuccess: boolean;
716
+ }
717
+ declare const update$2: Command<NsUpdateParams, NsUpdateResult>;
718
+ /**
719
+ * The command table behind `client.ns`. Advanced use only: it is exported for custom
720
+ * integrations and is not covered by semver stability.
721
+ */
722
+ declare const nsCommands: {
723
+ create: Command<NsCreateParams, NsCreateResult>;
724
+ delete: Command<NsDeleteParams, NsDeleteResult>;
725
+ getInfo: Command<NsGetInfoParams, NsGetInfoResult>;
726
+ update: Command<NsUpdateParams, NsUpdateResult>;
727
+ };
687
728
 
688
- interface CreateTransferParams {
729
+ /**
730
+ * @remarks Billed: this command charges your Namecheap account.
731
+ */
732
+ interface TransferCreateParams {
733
+ /** Domain name to transfer. */
689
734
  domainName: string;
735
+ /** Should be set to 1 year only. */
690
736
  years: number;
737
+ /** EPP (authorization) code, required for most TLDs. */
691
738
  eppCode: string;
692
- promotionCode: string;
693
- addFreeWhoisGuard: boolean;
694
- wGenable: boolean;
695
- }
696
- interface GetListTransferParams {
697
- listType?: DomainTransferListType;
698
- searchTerm?: string;
699
- page?: number;
700
- pageSize?: number;
701
- sortBy?: DomainTransferSortBy;
739
+ promotionCode?: string;
740
+ /** Add free domain privacy, `Yes` or `No`. Default: Yes. */
741
+ addFreeWhoisguard?: string;
742
+ /** Enable domain privacy, `Yes` or `No`. Default: No. Sent as `WGenable`. */
743
+ wgEnable?: string;
702
744
  }
703
-
704
- interface DomainTransferCreateResult {
705
- domainname: string;
706
- transfer: boolean;
707
- transferId: number;
708
- statusId: number;
709
- orderId: number;
710
- transactionId: number;
745
+ interface TransferCreateResult {
746
+ domainName: string;
747
+ transferID: number;
748
+ statusID: number;
749
+ orderID: number;
750
+ transactionID: number;
711
751
  chargedAmount: number;
712
- statusCode: number;
713
752
  }
714
- interface DomainTransferGetStatusResult {
715
- transferId: number;
753
+ declare const create$3: Command<TransferCreateParams, TransferCreateResult>;
754
+ interface TransferGetStatusParams {
755
+ transferID: number;
756
+ }
757
+ interface TransferGetStatusResult {
758
+ transferID: number;
759
+ statusID: number;
716
760
  status: string;
717
- statusId: number;
718
761
  }
719
- interface TransferGetResult {
720
- id: number;
721
- domainname: string;
762
+ declare const getStatus: Command<TransferGetStatusParams, TransferGetStatusResult>;
763
+ interface TransferUpdateStatusParams {
764
+ transferID: number;
765
+ /** `true` resubmits the transfer. */
766
+ resubmit: boolean;
767
+ }
768
+ interface TransferUpdateStatusResult {
769
+ transferID: number;
770
+ resubmit: boolean;
771
+ }
772
+ declare const updateStatus: Command<TransferUpdateStatusParams, TransferUpdateStatusResult>;
773
+ type TransferListType = "ALL" | "INPROGRESS" | "CANCELLED" | "COMPLETED";
774
+ type TransferSortBy = "DOMAINNAME" | "DOMAINNAME_DESC" | "TRANSFERDATE" | "TRANSFERDATE_DESC" | "STATUSDATE" | "STATUSDATE_DESC";
775
+ interface TransferGetListParams {
776
+ /** Default: ALL. */
777
+ listType?: TransferListType;
778
+ /** Keyword (domain name) to search. */
779
+ searchTerm?: string;
780
+ page?: number;
781
+ /** Min 10, max 100. */
782
+ pageSize?: number;
783
+ sortBy?: TransferSortBy;
784
+ }
785
+ interface TransferListItem {
786
+ transferID: number;
787
+ /** The reference spells this column `Domainname`; the fixture uses `DomainName`. */
788
+ domainName: string;
722
789
  user: string;
723
790
  transferDate: string;
724
- orderId: number;
725
- statusId: number;
791
+ /** Absent while the transfer is still queued. */
792
+ orderID?: number;
793
+ statusID: number;
726
794
  status: string;
727
- statusDate: string;
728
- statusDescription: string;
729
- }
730
-
731
- declare class DomainsTransfer {
732
- private readonly config;
733
- constructor(config: NamecheapProps);
734
- create(domain: string, params: Omit<CreateTransferParams, "domainName">): Promise<DomainTransferCreateResult>;
735
- getStatus(id: number): Promise<DomainTransferGetStatusResult>;
736
- updateStatus(id: number, resubmit: boolean): Promise<number>;
737
- getList(params?: GetListTransferParams): Promise<{
738
- data: Array<TransferGetResult>;
739
- paging: Paging;
740
- }>;
741
795
  }
796
+ interface TransferGetListResult {
797
+ transfers: TransferListItem[];
798
+ paging: Paging;
799
+ }
800
+ declare const getList$3: Command<TransferGetListParams, TransferGetListResult>;
801
+ /**
802
+ * The command table behind `client.transfer`. Advanced use only: it is exported for custom
803
+ * integrations and is not covered by semver stability.
804
+ */
805
+ declare const transferCommands: {
806
+ create: Command<TransferCreateParams, TransferCreateResult>;
807
+ getStatus: Command<TransferGetStatusParams, TransferGetStatusResult>;
808
+ updateStatus: Command<TransferUpdateStatusParams, TransferUpdateStatusResult>;
809
+ getList: Command<TransferGetListParams, TransferGetListResult>;
810
+ };
742
811
 
743
- type CreateSSLYearLimit = 1 | 2 | 3 | 4 | 5;
744
- interface CreateSSLParams {
745
- year: CreateSSLYearLimit;
746
- type: SSLType;
747
- sansToADD?: number;
812
+ /**
813
+ * @remarks Billed: this command charges your Namecheap account.
814
+ */
815
+ interface SslCreateParams {
816
+ /** Number of years for the certificate. Allowed values: 1 to 5. */
817
+ years: number;
818
+ /**
819
+ * SSL product name. Since July 11, 2026 use one of: `Standard SSL SSLcom`,
820
+ * `Standard Wildcard SSL SSLcom`, `SAN Certificate SSL SSLcom`, `High Assurance SSL SSLcom`,
821
+ * `OV Wildcard SSL SSLcom`, `OV Multi-domain SSL SSLcom`, `EV SSL SSLcom`,
822
+ * `EV Multi Domain SSL SSLcom`. Older names (`PositiveSSL`, `InstantSSL`, ...) are deprecated:
823
+ * the API still accepts them and issues an equivalent new type.
824
+ */
825
+ type: string;
826
+ /** Number of add-on domains for multi-domain certificates. Sent as `SANStoADD`. */
827
+ sansToAdd?: number;
748
828
  promotionCode?: string;
749
829
  }
750
- interface GetListSSLParams {
751
- listType?: SSLListType;
830
+ /** Every field is optional: the response shape of this billed command is not documented. */
831
+ interface SslCreateResult {
832
+ isSuccess?: boolean;
833
+ orderID?: number;
834
+ transactionID?: number;
835
+ chargedAmount?: number;
836
+ certificateID?: number;
837
+ created?: string;
838
+ sslType?: string;
839
+ status?: string;
840
+ }
841
+ declare const create$2: Command<SslCreateParams, SslCreateResult>;
842
+ type SslListType = "ALL" | "Processing" | "EmailSent" | "TechnicalProblem" | "InProgress" | "Completed" | "Deactivated" | "Active" | "Cancelled" | "NewPurchase" | "NewRenewal";
843
+ type SslSortBy = "PURCHASEDATE" | "PURCHASEDATE_DESC" | "SSLTYPE" | "SSLTYPE_DESC" | "EXPIREDATETIME" | "EXPIREDATETIME_DESC" | "Host_Name" | "Host_Name_DESC";
844
+ interface SslGetListParams {
845
+ /** Default: ALL. */
846
+ listType?: SslListType;
847
+ /** Keyword to look for. */
752
848
  searchTerm?: string;
753
849
  page?: number;
850
+ /** Min 10, max 100. Default: 20. */
754
851
  pageSize?: number;
755
- sortBy?: SSLListSortBy;
852
+ sortBy?: SslSortBy;
756
853
  }
757
- interface ActivateSSLCommonParams {
758
- certificateId: number;
759
- csr: string;
760
- adminEmailAddress: string;
761
- webServerType?: string;
762
- uniqueValue?: string;
763
- }
764
- interface SSLDCVParams extends ActivateSSLCommonParams {
765
- approverEmail?: string;
766
- HTTPDCValidation?: boolean;
767
- DNSDCValidation?: boolean;
768
- }
769
- interface SSLMultiDomainParams extends ActivateSSLCommonParams {
770
- DNSNames?: string;
771
- DNSApproverEmails?: string;
772
- }
773
- interface SSLOVAndEVParams extends ActivateSSLCommonParams {
774
- adminOrganizationName?: string;
775
- organizationDepartment?: string;
776
- DNSNames?: string;
777
- DNSApproverEmails?: string;
778
- adminCountry?: string;
779
- adminStateProvince?: string;
780
- adminCity?: string;
781
- adminAddress1?: string;
782
- adminAddress2?: string;
783
- adminPostalCode?: string;
784
- adminPhone?: string;
785
- organizationDUNS?: string;
786
- }
787
- interface SSLEVParams extends ActivateSSLCommonParams {
788
- companyIncorporationCountry: string;
789
- companyIncorporationStateProvince?: string;
790
- companyIncorporationLocality?: string;
791
- companyIncorporationDate?: string;
792
- companyDBA?: string;
793
- companyRegistrationNumber?: string;
794
- }
795
- interface SSLOVParams extends ActivateSSLCommonParams {
796
- organizationRepFirstName?: string;
797
- organizationRepLastName?: string;
798
- organizationRepTitle?: string;
799
- organizationRepPhone?: string;
800
- organizationRepEmailAddress?: string;
801
- }
802
- type SSLParams = SSLDCVParams | SSLMultiDomainParams | SSLOVAndEVParams | SSLEVParams | SSLOVParams;
803
- type ActivateSSLParams = SSLParams;
804
- type ReissueSSLParams = SSLParams;
805
- interface RenewSSLParams {
806
- certificateId: number;
807
- years: number;
808
- sslType: SSLType;
809
- promotionCode?: string;
810
- }
811
- interface EditDCVMethodParams {
812
- certificateId: number;
813
- DCVMethod: string;
814
- DNSNames: string;
815
- DCVMethods: string;
816
- }
817
-
818
- interface SSLCertificate {
819
- certificateId: number;
820
- created: string;
821
- sslType: string;
822
- years: number;
823
- status: string;
824
- }
825
- interface SSLCreateResult {
826
- sslCertificate: SSLCertificate;
827
- isSuccess: boolean;
828
- orderId: number;
829
- transactionId: number;
830
- chargedAmount: number;
831
- }
832
- interface SSLResult {
833
- certificateId: number;
854
+ interface SslListItem {
855
+ certificateID: number;
834
856
  hostName: string;
835
857
  sslType: string;
836
858
  purchaseDate: string;
837
859
  expireDate: string;
838
- activationExpireDate: string;
839
- isExpiredYn: boolean;
840
- status: string;
860
+ /** Present in the fixtures but not in the reference table. */
861
+ status?: string;
841
862
  }
842
- interface SSLParseCsrResult {
863
+ interface SslGetListResult {
864
+ certificates: SslListItem[];
865
+ paging: Paging;
866
+ }
867
+ declare const getList$2: Command<SslGetListParams, SslGetListResult>;
868
+ interface SslParseCsrParams {
869
+ /** Certificate Signing Request (PEM text). Sent as the lowercase `csr`. */
870
+ csr: string;
871
+ certificateType?: string;
872
+ }
873
+ interface SslParseCsrResult {
843
874
  commonName: string;
844
875
  domainName: string;
845
- country: string;
846
- organisationUnit: string;
847
- organisation: string;
848
- validTrueDomain: boolean;
849
- state: string;
850
- locality: string;
851
- email: string;
852
- dnsNames: string;
853
- csrDetails: boolean;
876
+ country?: string;
877
+ organisationUnit?: string;
878
+ organisation?: string;
879
+ state?: string;
880
+ locality?: string;
881
+ email?: string;
882
+ }
883
+ declare const parseCSR: Command<SslParseCsrParams, SslParseCsrResult>;
884
+ interface SslGetApproverEmailListParams {
885
+ domainName: string;
886
+ certificateType: string;
887
+ }
888
+ interface SslGetApproverEmailListResult {
889
+ /** Domain WHOIS email addresses (`Domainemails`). */
890
+ domainEmails: string[];
891
+ /** Generic email addresses for the domain (`Genericemails`). */
892
+ genericEmails: string[];
893
+ /** Additional emails from the provider (`Manualemails`). */
894
+ manualEmails: string[];
895
+ }
896
+ declare const getApproverEmailList: Command<SslGetApproverEmailListParams, SslGetApproverEmailListResult>;
897
+ /** File to publish on the domain for HTTP domain control validation. */
898
+ interface SslHttpDcEntry {
899
+ domain?: string;
900
+ fileName?: string;
901
+ fileContent?: string;
902
+ }
903
+ interface SslHttpDcValidation {
904
+ /** True when HTTP_CSR_HASH was set for at least one domain. */
905
+ valueAvailable: boolean;
906
+ /** From the first entry; the live API nests them in a `<DNS domain>` element per domain. */
907
+ fileName?: string;
908
+ fileContent?: string;
909
+ /** One entry per domain, when the response lists them. */
910
+ entries?: SslHttpDcEntry[];
911
+ }
912
+ /** DNS record to create for DNS domain control validation. */
913
+ interface SslDnsDcEntry {
914
+ domain?: string;
915
+ hostName?: string;
916
+ target?: string;
917
+ }
918
+ interface SslDnsDcValidation {
919
+ valueAvailable: boolean;
920
+ hostName?: string;
921
+ target?: string;
922
+ entries?: SslDnsDcEntry[];
923
+ }
924
+ interface SslActivateParams {
925
+ certificateID: number;
926
+ /** Certificate Signing Request (PEM text, may span several lines). */
927
+ csr: string;
928
+ /** Email to send the signed certificate file to. */
929
+ adminEmailAddress: string;
930
+ /** Server software type, e.g. `apacheopenssl`, `nginx`, `iis`. */
931
+ webServerType?: string;
932
+ uniqueValue?: string;
933
+ /** Email address that approves the request (e-mail domain control validation). Sent as `ApproverEmail`. */
934
+ approverEmail?: string;
935
+ /** Validate by publishing a file over HTTP. Sent as `HTTPDCValidation`. */
936
+ httpDcValidation?: boolean;
937
+ /** Validate by creating a DNS record. Sent as `DNSDCValidation`. */
938
+ dnsDcValidation?: boolean;
854
939
  }
855
- interface GetApproverEmailListResult {
856
- domainemails: string;
857
- genericemails: Array<string>;
858
- domain: string;
940
+ interface SslActivateResult {
941
+ id: number;
942
+ isSuccess: boolean;
943
+ /** Present when the response carries an HTTP DCV block. */
944
+ httpDCValidation?: SslHttpDcValidation;
945
+ /** Present when the response carries a DNS DCV block. */
946
+ dnsDCValidation?: SslDnsDcValidation;
859
947
  }
860
- interface SSLActivateResult {
861
- httpDcValidation: {
862
- fileName: string;
863
- fileContent: string;
864
- domain: string;
865
- };
866
- dnsdcValidation: {
867
- hostName: string;
868
- target: string;
869
- domain: string;
870
- };
948
+ declare const activate: Command<SslActivateParams, SslActivateResult>;
949
+ interface SslResendApproverEmailParams {
950
+ certificateID: number;
951
+ }
952
+ /** The `{ id, isSuccess }` result shared by the two resend commands. */
953
+ interface SslResendResult {
871
954
  id: number;
872
955
  isSuccess: boolean;
873
956
  }
874
- interface SSLGetInfoResult {
875
- certificateDetails: {
876
- csr: string;
877
- approverEmail: string;
878
- commonName: string;
879
- administratorName: string;
880
- administratorEmail: string;
881
- certificates: {
882
- certificate: string;
883
- caCertificates: Array<{
884
- certificate: string;
885
- type: string;
886
- }>;
887
- certificateReturned: boolean;
888
- returnType: string;
889
- };
890
- certificateDetails: boolean;
891
- };
892
- provider: {
893
- orderId: number;
894
- name: string;
895
- provider: boolean;
896
- };
957
+ type SslResendApproverEmailResult = SslResendResult;
958
+ declare const resendApproverEmail: Command<SslResendApproverEmailParams, SslResendResult>;
959
+ interface SslReissueParams {
960
+ certificateID: number;
961
+ /** Certificate Signing Request (PEM text, may span several lines). */
962
+ csr: string;
963
+ /** Cannot be changed from the initial activation. */
964
+ adminEmailAddress?: string;
965
+ webServerType?: string;
966
+ uniqueValue?: string;
967
+ /** Email address that approves the request (e-mail domain control validation). Sent as `ApproverEmail`. */
968
+ approverEmail?: string;
969
+ /** Validate by publishing a file over HTTP. Sent as `HTTPDCValidation`. */
970
+ httpDcValidation?: boolean;
971
+ /** Validate by creating a DNS record. Sent as `DNSDCValidation`. */
972
+ dnsDcValidation?: boolean;
973
+ }
974
+ type SslReissueResult = SslActivateResult;
975
+ declare const reissue: Command<SslReissueParams, SslActivateResult>;
976
+ interface SslResendFulfillmentEmailParams {
977
+ certificateID: number;
978
+ }
979
+ type SslResendFulfillmentEmailResult = SslResendResult;
980
+ declare const resendFulfillmentEmail: Command<SslResendFulfillmentEmailParams, SslResendResult>;
981
+ /** Either one `dcvMethod` for the whole certificate, or `dnsNames` plus `dcvMethods` per domain. */
982
+ type SslEditDcvMethodParams = {
983
+ certificateID: number;
984
+ /** DCV method used to validate domain control. */
985
+ dcvMethod: string;
986
+ } | {
987
+ certificateID: number;
988
+ /** Comma-separated list of domain names. */
989
+ dnsNames: string;
990
+ /** Comma-separated list of DCV methods, one per domain name. */
991
+ dcvMethods: string;
992
+ };
993
+ type SslEditDcvMethodResult = SslActivateResult;
994
+ declare const editDCVMethod: Command<SslEditDcvMethodParams, SslActivateResult>;
995
+ type SslReturnType = "Individual" | "PKCS7";
996
+ interface SslGetInfoParams {
997
+ certificateID: number;
998
+ /**
999
+ * Flag for returning the certificate in the response. Sent as `Returncertificate`.
1000
+ *
1001
+ * @remarks The response shape for the certificate body is undocumented, so 1.0 does
1002
+ * not parse it: the result never contains the certificate.
1003
+ */
1004
+ returnCertificate?: string;
1005
+ /** Format of the returned certificate. Sent as `Returntype`. */
1006
+ returnType?: SslReturnType;
1007
+ }
1008
+ interface SslGetInfoResult {
1009
+ /** Absent in live responses; the reference lists it. */
1010
+ certificateID?: number;
1011
+ /** For example `Active`, `Newpurchase`, `Purchased`, `Cancelled`. */
897
1012
  status: string;
898
- statusDescription: string;
899
- type: string;
900
- issuedOn: string;
901
- expires: string;
902
- orderId: number;
903
- replacedBy: number;
904
- sansCount: number;
905
- }
906
- interface SSLRenewResult {
907
- certificateId: number;
908
- sslType: string;
1013
+ /** The attributes below are in the fixture but not in the reference. */
1014
+ type?: string;
1015
+ commonName?: string;
1016
+ provider?: string;
1017
+ issuedOn?: string;
1018
+ expires?: string;
1019
+ }
1020
+ declare const getInfo$1: Command<SslGetInfoParams, SslGetInfoResult>;
1021
+ /**
1022
+ * @remarks Billed: this command charges your Namecheap account.
1023
+ */
1024
+ interface SslRenewParams {
1025
+ certificateID: number;
1026
+ /** Allowed values: 1 to 5. */
909
1027
  years: number;
910
- orderId: number;
911
- transactionId: number;
912
- chargedAmount: number;
1028
+ /** SSL product name. */
1029
+ sslType: string;
1030
+ promotionCode?: string;
913
1031
  }
914
- interface SSLPurchaseMoreSansResult {
915
- sslCertificate: {
916
- certificateId: number;
917
- sslType: string;
918
- years: number;
919
- status: string;
920
- sansCount: number;
921
- };
1032
+ /** Every field is optional: the response shape of this billed command is not documented. */
1033
+ interface SslRenewResult {
1034
+ certificateID?: number;
1035
+ years?: number;
1036
+ orderID?: number;
1037
+ transactionID?: number;
1038
+ chargedAmount?: number;
1039
+ }
1040
+ declare const renew$1: Command<SslRenewParams, SslRenewResult>;
1041
+ /**
1042
+ * @remarks Billed: this command charges your Namecheap account.
1043
+ */
1044
+ interface SslPurchaseMoreSansParams {
1045
+ certificateID: number;
1046
+ /** Number of add-on domains to order. Sent as `NumberOfSANSToAdd`. */
1047
+ numberOfSansToAdd: number;
1048
+ }
1049
+ /** Every field is optional: the response shape of this billed command is not documented. */
1050
+ interface SslPurchaseMoreSansResult {
1051
+ isSuccess?: boolean;
1052
+ orderID?: number;
1053
+ transactionID?: number;
1054
+ chargedAmount?: number;
1055
+ certificateID?: number;
1056
+ sslType?: string;
1057
+ /** Number of add-on domains (`SANSCount`). */
1058
+ sansCount?: number;
1059
+ }
1060
+ declare const purchaseMoreSans: Command<SslPurchaseMoreSansParams, SslPurchaseMoreSansResult>;
1061
+ /**
1062
+ * @remarks Irreversible: a revoked certificate cannot be restored.
1063
+ */
1064
+ interface SslRevokeCertificateParams {
1065
+ certificateID: number;
1066
+ certificateType: string;
1067
+ }
1068
+ interface SslRevokeCertificateResult {
922
1069
  isSuccess: boolean;
923
- orderId: number;
924
- transactionId: number;
925
- chargedAmount: number;
1070
+ certificateID: number;
1071
+ }
1072
+ declare const revokeCertificate: Command<SslRevokeCertificateParams, SslRevokeCertificateResult>;
1073
+ /**
1074
+ * The command table behind `client.ssl`. Advanced use only: it is exported for custom
1075
+ * integrations and is not covered by semver stability.
1076
+ */
1077
+ declare const sslCommands: {
1078
+ create: Command<SslCreateParams, SslCreateResult>;
1079
+ getList: Command<SslGetListParams, SslGetListResult>;
1080
+ parseCSR: Command<SslParseCsrParams, SslParseCsrResult>;
1081
+ getApproverEmailList: Command<SslGetApproverEmailListParams, SslGetApproverEmailListResult>;
1082
+ activate: Command<SslActivateParams, SslActivateResult>;
1083
+ resendApproverEmail: Command<SslResendApproverEmailParams, SslResendResult>;
1084
+ reissue: Command<SslReissueParams, SslActivateResult>;
1085
+ resendFulfillmentEmail: Command<SslResendFulfillmentEmailParams, SslResendResult>;
1086
+ editDCVMethod: Command<SslEditDcvMethodParams, SslActivateResult>;
1087
+ getInfo: Command<SslGetInfoParams, SslGetInfoResult>;
1088
+ renew: Command<SslRenewParams, SslRenewResult>;
1089
+ purchaseMoreSans: Command<SslPurchaseMoreSansParams, SslPurchaseMoreSansResult>;
1090
+ revokeCertificate: Command<SslRevokeCertificateParams, SslRevokeCertificateResult>;
1091
+ };
1092
+
1093
+ interface UsersGetBalancesResult {
1094
+ currency: string;
1095
+ availableBalance: string;
1096
+ accountBalance: string;
1097
+ earnedAmount: string;
1098
+ withdrawableAmount: string;
1099
+ fundsRequiredForAutoRenew: string;
1100
+ }
1101
+ declare const getBalances: Command<Record<string, never>, UsersGetBalancesResult>;
1102
+ interface UsersGetPricingParams {
1103
+ /** Product type, e.g. `DOMAIN` or `SSLCERTIFICATE` (the reference gives examples, not a closed set). */
1104
+ productType: string;
1105
+ productCategory?: string;
1106
+ promotionCode?: string;
1107
+ /** Action, e.g. `REGISTER`, `RENEW` or `TRANSFER` (examples, not a closed set). */
1108
+ actionName?: string;
1109
+ productName?: string;
926
1110
  }
927
- interface SSLEditDcvMethodResult {
928
- httpDcValidation: {
929
- fileName: string;
930
- fileContent: string;
931
- valueAvailable: boolean;
932
- };
933
- dnsdcValidation: {
934
- hostName: string;
935
- target: string;
936
- valueAvailable: boolean;
937
- };
938
- domains: {
939
- domains: boolean;
940
- };
941
- id: number;
942
- isSuccess: boolean;
1111
+ interface PricingPrice {
1112
+ duration: number;
1113
+ durationType: string;
1114
+ /** Final price. May be an empty string. */
1115
+ price: string;
1116
+ regularPrice: string;
1117
+ yourPrice: string;
1118
+ currency: string;
1119
+ /** Present in the fixture but not in the reference table. */
1120
+ pricingType?: string;
1121
+ /** Present in the fixture but not in the reference table. */
1122
+ regularPriceType?: string;
1123
+ /** Present in the fixture but not in the reference table. */
1124
+ yourPriceType?: string;
1125
+ /** Documented; present only when a promotion applies to the tier. */
1126
+ promotionPrice?: string;
1127
+ }
1128
+ interface PricingProduct {
1129
+ name: string;
1130
+ prices: PricingPrice[];
943
1131
  }
944
-
945
- declare class SSL {
946
- private readonly config;
947
- constructor(config: NamecheapProps);
948
- create(params: CreateSSLParams): Promise<SSLCreateResult>;
949
- getList(params: GetListSSLParams): Promise<Array<SSLResult>>;
950
- parseCSR(csr: string, certificateType?: SSLType): Promise<SSLParseCsrResult>;
951
- getApproverEmailList(domainName: string, certificateType?: SSLType): Promise<GetApproverEmailListResult>;
952
- activate(certificateId: number, params: Omit<ActivateSSLParams, "certificateId">): Promise<SSLActivateResult>;
953
- resendApproverEmail(certificateId: number): Promise<number>;
954
- getInfo(certificateId: number): Promise<SSLGetInfoResult>;
955
- renew(certificateId: number, params: Omit<RenewSSLParams, "certificateId">): Promise<SSLRenewResult>;
956
- reissue(certificateId: number, params: Omit<ReissueSSLParams, "certificateId">): Promise<SSLActivateResult>;
957
- resendFulfillmentEmail(certificateId: number): Promise<number>;
958
- purchaseMoreSANS(certificateId: number, numberOfSANSToAdd: number): Promise<SSLPurchaseMoreSansResult>;
959
- revokeCertificate(certificateId: number, certificateType: SSLType): Promise<number>;
960
- editDCVMethod(certificateId: number, params: Omit<EditDCVMethodParams, "certificateId">): Promise<SSLEditDcvMethodResult>;
1132
+ interface PricingProductCategory {
1133
+ name: string;
1134
+ products: PricingProduct[];
961
1135
  }
962
-
963
- interface GetPricingUserParams {
964
- productType: UserProductType;
965
- productCategory?: UserProductCategory;
966
- promotionCode?: string;
967
- actionName?: UserActionName;
968
- productName?: UserProductName;
1136
+ interface PricingProductType {
1137
+ name: string;
1138
+ productCategories: PricingProductCategory[];
1139
+ }
1140
+ interface UsersGetPricingResult {
1141
+ productTypes: PricingProductType[];
1142
+ }
1143
+ declare const getPricing: Command<UsersGetPricingParams, UsersGetPricingResult>;
1144
+ /**
1145
+ * Credential-bearing: changes the password of a real account. Either the old
1146
+ * password (method 1) or a reset code from `resetPassword` (method 2).
1147
+ */
1148
+ type UsersChangePasswordParams = {
1149
+ oldPassword: string;
1150
+ newPassword: string;
1151
+ } | {
1152
+ resetCode: string;
1153
+ newPassword: string;
1154
+ };
1155
+ /** Never echoes a password or reset code. */
1156
+ interface UsersChangePasswordResult {
1157
+ success: boolean;
1158
+ userID?: number;
969
1159
  }
970
- interface UpdateParams {
1160
+ declare const changePassword: Command<UsersChangePasswordParams, UsersChangePasswordResult>;
1161
+ interface UsersUpdateParams {
971
1162
  firstName: string;
972
1163
  lastName: string;
973
1164
  jobTitle?: string;
@@ -977,26 +1168,63 @@ interface UpdateParams {
977
1168
  city: string;
978
1169
  stateProvince: string;
979
1170
  zip: string;
1171
+ /** Two-letter country code. */
980
1172
  country: string;
981
1173
  emailAddress: string;
1174
+ /** Format +NNN.NNNNNNNNNN. */
982
1175
  phone: string;
983
1176
  phoneExt?: string;
1177
+ /** Format +NNN.NNNNNNNNNN. */
984
1178
  fax?: string;
985
1179
  }
986
- interface CreateAddFundsRequestParams {
987
- username: string;
988
- paymentType: typeof UserPaymentType.CreditCard;
989
- amount: number;
1180
+ interface UsersUpdateResult {
1181
+ success: boolean;
1182
+ }
1183
+ declare const update$1: Command<UsersUpdateParams, UsersUpdateResult>;
1184
+ /** The only documented payment type. */
1185
+ type UsersPaymentType = "Creditcard";
1186
+ /**
1187
+ * The documented `Username` parameter is not exposed: the transport always sends
1188
+ * the configured account as `UserName`.
1189
+ *
1190
+ * @remarks Billed: this command creates a request to add money to your Namecheap account balance.
1191
+ */
1192
+ interface UsersCreateAddFundsRequestParams {
1193
+ paymentType: UsersPaymentType;
1194
+ /** Amount to add. */
1195
+ amount: number | string;
1196
+ /** URL to redirect the user to after payment. Sent as `ReturnUrl`. */
990
1197
  returnUrl: string;
991
1198
  }
992
- interface CreateUserParams {
1199
+ interface UsersCreateAddFundsRequestResult {
1200
+ tokenID: string;
1201
+ redirectURL: string;
1202
+ returnURL: string;
1203
+ }
1204
+ declare const createAddFundsRequest: Command<UsersCreateAddFundsRequestParams, UsersCreateAddFundsRequestResult>;
1205
+ interface UsersGetAddFundsStatusParams {
1206
+ /** Token from `createAddFundsRequest`. Sent as `TokenId` (not `TokenID`). */
1207
+ tokenId: string;
1208
+ }
1209
+ interface UsersGetAddFundsStatusResult {
1210
+ transactionID: number;
1211
+ amount: string;
1212
+ /** One of CREATED, SUBMITTED, COMPLETED, FAILED, EXPIRED. */
1213
+ status: string;
1214
+ }
1215
+ declare const getAddFundsStatus: Command<UsersGetAddFundsStatusParams, UsersGetAddFundsStatusResult>;
1216
+ /** Credential-bearing: creates a real account under the ApiUser with its password. */
1217
+ interface UsersCreateParams {
993
1218
  newUserName: string;
994
1219
  newUserPassword: string;
995
1220
  emailAddress: string;
1221
+ /** Whether to skip the duplicate e-mail check. Default: Yes. */
996
1222
  ignoreDuplicateEmailAddress?: string;
997
1223
  firstName: string;
998
1224
  lastName: string;
1225
+ /** Must be 1 to accept the terms. */
999
1226
  acceptTerms: number;
1227
+ /** 1 to receive newsletters, 0 to opt out. */
1000
1228
  acceptNews?: number;
1001
1229
  jobTitle?: string;
1002
1230
  organization?: string;
@@ -1005,117 +1233,128 @@ interface CreateUserParams {
1005
1233
  city: string;
1006
1234
  stateProvince: string;
1007
1235
  zip: string;
1236
+ /** Two-letter country code. */
1008
1237
  country: string;
1238
+ /** Format +NNN.NNNNNNNNNN. */
1009
1239
  phone: string;
1010
1240
  phoneExt?: string;
1011
1241
  fax?: string;
1012
1242
  }
1013
- interface ResetPasswordParams {
1014
- findBy: UserListFindBy;
1243
+ /**
1244
+ * Neither the reference nor the SDK documents a response for this command, so the
1245
+ * attributes of the first element inside `CommandResponse` are returned as-is
1246
+ * (empty when there is none). Parsing never throws: the account may already exist.
1247
+ */
1248
+ type UsersCreateResult = Record<string, string>;
1249
+ declare const create$1: Command<UsersCreateParams, UsersCreateResult>;
1250
+ /**
1251
+ * Credential-bearing. Validates the password of an account created via
1252
+ * `users.create` (the account is the configured `userName`).
1253
+ */
1254
+ interface UsersLoginParams {
1255
+ password: string;
1256
+ }
1257
+ /**
1258
+ * The response shape is not documented anywhere; the documented attributes are read
1259
+ * from the first element inside `CommandResponse`, whatever its name, and left
1260
+ * out when absent.
1261
+ */
1262
+ interface UsersLoginResult {
1263
+ username?: string;
1264
+ loginSuccess?: boolean;
1265
+ }
1266
+ declare const login: Command<UsersLoginParams, UsersLoginResult>;
1267
+ type UsersResetPasswordFindBy = "EMAILADDRESS" | "DOMAINNAME" | "USERNAME";
1268
+ /** Credential-bearing: e-mails a password reset link for a real account. */
1269
+ interface UsersResetPasswordParams {
1270
+ findBy: UsersResetPasswordFindBy;
1271
+ /** The username, e-mail address or domain to search by. */
1015
1272
  findByValue: string;
1273
+ /** Sender name in the reset e-mail. Default: namecheap.com. */
1016
1274
  emailFromName?: string;
1275
+ /** Sender address. Default: support@namecheap.com. */
1017
1276
  emailFrom?: string;
1277
+ /** URL pattern containing the `[RESETCODE]` placeholder. Sent as `URLPattern`. */
1018
1278
  urlPattern?: string;
1019
1279
  }
1280
+ /** The response shape is not documented anywhere; read tolerantly from the first child of `CommandResponse`. */
1281
+ interface UsersResetPasswordResult {
1282
+ success?: boolean;
1283
+ }
1284
+ declare const resetPassword: Command<UsersResetPasswordParams, UsersResetPasswordResult>;
1285
+ /**
1286
+ * The command table behind `client.users`. Advanced use only: it is exported for custom
1287
+ * integrations and is not covered by semver stability.
1288
+ */
1289
+ declare const usersCommands: {
1290
+ getBalances: Command<Record<string, never>, UsersGetBalancesResult>;
1291
+ getPricing: Command<UsersGetPricingParams, UsersGetPricingResult>;
1292
+ changePassword: Command<UsersChangePasswordParams, UsersChangePasswordResult>;
1293
+ update: Command<UsersUpdateParams, UsersUpdateResult>;
1294
+ createAddFundsRequest: Command<UsersCreateAddFundsRequestParams, UsersCreateAddFundsRequestResult>;
1295
+ getAddFundsStatus: Command<UsersGetAddFundsStatusParams, UsersGetAddFundsStatusResult>;
1296
+ create: Command<UsersCreateParams, UsersCreateResult>;
1297
+ login: Command<UsersLoginParams, UsersLoginResult>;
1298
+ resetPassword: Command<UsersResetPasswordParams, UsersResetPasswordResult>;
1299
+ };
1020
1300
 
1021
- interface Product {
1022
- duration: number;
1023
- durationType: string;
1024
- price: number;
1025
- regularPrice: number;
1026
- yourPrice: number;
1027
- currency: string;
1028
- }
1029
- interface ProductCategory {
1030
- product: Array<Product>;
1031
- name: string;
1032
- }
1033
- interface UserGetPricingResult {
1034
- productCategory: Array<ProductCategory>;
1035
- name: string;
1036
- }
1037
- interface UserGetBalancesResult {
1038
- currency: string;
1039
- availableBalance: number;
1040
- accountBalance: number;
1041
- earnedAmount: number;
1042
- withdrawableAmount: number;
1043
- fundsRequiredForAutoRenew: number;
1044
- }
1045
- interface UserCreateAddFundsRequest {
1046
- tokenId: string;
1047
- returnUrl: string;
1048
- redirectUrl: string;
1049
- }
1050
- interface GetAddFundsStatusResult {
1051
- transactionId: number;
1052
- amount: number;
1053
- status: GetAddFundsStatus;
1054
- }
1055
-
1056
- declare class Users {
1057
- private readonly config;
1058
- constructor(config: NamecheapProps);
1059
- getPricing(params: GetPricingUserParams): Promise<UserGetPricingResult>;
1060
- getBalances(): Promise<UserGetBalancesResult>;
1061
- changePassword(oldPassword: string, newPassword: string): Promise<string>;
1062
- update(params: UpdateParams): Promise<string>;
1063
- createAddFundsRequest(username: string, params: Omit<CreateAddFundsRequestParams, "username">): Promise<UserCreateAddFundsRequest>;
1064
- getAddFundsStatus(tokenId: string): Promise<GetAddFundsStatusResult>;
1065
- create(param: CreateUserParams): Promise<number>;
1066
- login(password: string): Promise<string>;
1067
- resetPassword(params: ResetPasswordParams): Promise<string>;
1068
- }
1069
-
1070
- interface AddressCreateResult {
1071
- success: boolean;
1072
- addressId: number;
1073
- addressName: string;
1074
- }
1075
- interface AddressDeleteResult {
1076
- success: boolean;
1077
- profileId: number;
1078
- userName: string;
1079
- }
1080
- interface GetAddressInfoResult {
1081
- addressId: number;
1082
- userName: string;
1301
+ interface UsersAddressCreateParams {
1302
+ /** Address name/label (max 20 characters). */
1083
1303
  addressName: string;
1084
- defaultYn: boolean;
1304
+ /** 1 to set as the default address, 0 otherwise. */
1305
+ defaultYN?: number;
1306
+ emailAddress: string;
1085
1307
  firstName: string;
1086
1308
  lastName: string;
1087
- jobTitle: string;
1088
- organization: string;
1309
+ jobTitle?: string;
1310
+ organization?: string;
1089
1311
  address1: string;
1090
- address2: string;
1312
+ address2?: string;
1091
1313
  city: string;
1092
1314
  stateProvince: string;
1093
1315
  stateProvinceChoice: string;
1094
- zip: number;
1316
+ zip: string;
1317
+ /** Two-letter country code. */
1095
1318
  country: string;
1096
- phone: number;
1097
- fax: number;
1098
- phoneExt: number;
1099
- emailAddress: string;
1100
- getAddressInfoResult: boolean;
1319
+ /** Format +NNN.NNNNNNNNNN. */
1320
+ phone: string;
1321
+ phoneExt?: string;
1322
+ /** Format +NNN.NNNNNNNNNN. */
1323
+ fax?: string;
1101
1324
  }
1102
- interface AddressGetListResult {
1325
+ interface UsersAddressCreateResult {
1326
+ success: boolean;
1103
1327
  addressId: number;
1104
1328
  addressName: string;
1105
1329
  }
1106
- interface AddressUpdateResult {
1330
+ declare const create: Command<UsersAddressCreateParams, UsersAddressCreateResult>;
1331
+ interface UsersAddressDeleteParams {
1332
+ /** Sent as `AddressId`. */
1333
+ addressId: number;
1334
+ }
1335
+ interface UsersAddressDeleteResult {
1107
1336
  success: boolean;
1337
+ /** Id of the deleted address profile (`ProfileId`). */
1338
+ profileId: number;
1339
+ /** Listed in the official docs; absent from the captured response. */
1340
+ username?: string;
1341
+ }
1342
+ declare const deleteAddress: Command<UsersAddressDeleteParams, UsersAddressDeleteResult>;
1343
+ interface UsersAddressGetInfoParams {
1344
+ /** Sent as `AddressId`; 0 is the primary address. */
1108
1345
  addressId: number;
1109
- addressName: string;
1110
1346
  }
1111
-
1112
- interface CreateUserAddressParams {
1347
+ /** Fields the reference says are omitted (not sent empty) when they have no value are optional. */
1348
+ interface UsersAddressGetInfoResult {
1349
+ addressId: number;
1350
+ userName: string;
1113
1351
  addressName: string;
1114
- defaultYN?: number;
1115
- emailAddress: string;
1352
+ /** From the `Default_YN` element. */
1353
+ defaultYN: boolean;
1116
1354
  firstName: string;
1117
1355
  lastName: string;
1118
1356
  jobTitle?: string;
1357
+ /** Not listed as omitted in the reference, but optional on the API side. */
1119
1358
  organization?: string;
1120
1359
  address1: string;
1121
1360
  address2?: string;
@@ -1127,79 +1366,141 @@ interface CreateUserAddressParams {
1127
1366
  phone: string;
1128
1367
  phoneExt?: string;
1129
1368
  fax?: string;
1369
+ emailAddress: string;
1130
1370
  }
1131
- interface UpdateUserAddressParams extends CreateUserAddressParams {
1371
+ /** Text of an optional child element. */
1372
+ declare const getInfo: Command<UsersAddressGetInfoParams, UsersAddressGetInfoResult>;
1373
+ interface UsersAddressListItem {
1132
1374
  addressId: number;
1375
+ addressName: string;
1376
+ isDefault: boolean;
1133
1377
  }
1134
-
1135
- declare class UsersAddress {
1136
- private readonly config;
1137
- constructor(config: NamecheapProps);
1138
- create(param: CreateUserAddressParams): Promise<AddressCreateResult>;
1139
- delete(addressId: number): Promise<AddressDeleteResult>;
1140
- getInfo(addressId: number): Promise<GetAddressInfoResult>;
1141
- getList(): Promise<AddressGetListResult>;
1142
- setDefault(addressId: number): Promise<number>;
1143
- update(addressId: number, params: Omit<UpdateUserAddressParams, "addressId">): Promise<AddressUpdateResult>;
1378
+ /** The response has no `Paging` element, so the result is a bare array (empty when there are no `List` elements). */
1379
+ type UsersAddressGetListResult = UsersAddressListItem[];
1380
+ declare const getList$1: Command<Record<string, never>, UsersAddressGetListResult>;
1381
+ interface UsersAddressSetDefaultParams {
1382
+ /** Sent as `AddressId`; 0 makes the primary address the default again. */
1383
+ addressId: number;
1384
+ }
1385
+ interface UsersAddressSetDefaultResult {
1386
+ success: boolean;
1387
+ addressId: number;
1388
+ }
1389
+ declare const setDefault: Command<UsersAddressSetDefaultParams, UsersAddressSetDefaultResult>;
1390
+ /** Same fields as `create`; omitting `defaultYN` leaves the default flag unchanged. */
1391
+ interface UsersAddressUpdateParams extends UsersAddressCreateParams {
1392
+ /** Sent as `AddressId`. */
1393
+ addressId: number;
1394
+ }
1395
+ interface UsersAddressUpdateResult {
1396
+ success: boolean;
1397
+ addressId: number;
1398
+ addressName: string;
1144
1399
  }
1400
+ declare const update: Command<UsersAddressUpdateParams, UsersAddressUpdateResult>;
1401
+ /**
1402
+ * The command table behind `client.usersAddress`. Advanced use only: it is exported for custom
1403
+ * integrations and is not covered by semver stability.
1404
+ */
1405
+ declare const usersAddressCommands: {
1406
+ create: Command<UsersAddressCreateParams, UsersAddressCreateResult>;
1407
+ delete: Command<UsersAddressDeleteParams, UsersAddressDeleteResult>;
1408
+ getInfo: Command<UsersAddressGetInfoParams, UsersAddressGetInfoResult>;
1409
+ getList: Command<Record<string, never>, UsersAddressGetListResult>;
1410
+ setDefault: Command<UsersAddressSetDefaultParams, UsersAddressSetDefaultResult>;
1411
+ update: Command<UsersAddressUpdateParams, UsersAddressUpdateResult>;
1412
+ };
1145
1413
 
1146
- interface WhoIsGuardChangeEmailAddressResult {
1414
+ interface WhoisguardChangeEmailAddressParams {
1415
+ /** Unique domain privacy ID to change. Sent as `WhoisguardID`. */
1416
+ whoisguardID: number;
1417
+ }
1418
+ interface WhoisguardChangeEmailAddressResult {
1419
+ /** Unique integer representing the domain privacy subscription. */
1147
1420
  id: number;
1148
1421
  isSuccess: boolean;
1422
+ /** New domain privacy email address. */
1149
1423
  wgEmail: string;
1424
+ /** Old domain privacy email address. */
1150
1425
  wgOldEmail: string;
1151
1426
  }
1152
- interface WhoIsGuardGetListResult {
1153
- id: number;
1154
- created: string;
1155
- expires: string;
1156
- status: string;
1427
+ declare const changeEmailAddress: Command<WhoisguardChangeEmailAddressParams, WhoisguardChangeEmailAddressResult>;
1428
+ interface WhoisguardEnableParams {
1429
+ /** Unique domain privacy ID to enable. Sent as `WhoisguardID`. */
1430
+ whoisguardID: number;
1431
+ /** Email address to forward domain privacy emails to (max 70 characters). */
1432
+ forwardedToEmail: string;
1157
1433
  }
1158
- interface WhoIsGuardRenewResult {
1159
- whoisguardId: number;
1160
- years: number;
1161
- renew: boolean;
1162
- orderId: number;
1163
- transactionId: number;
1164
- chargedAmount: number;
1434
+ interface WhoisguardEnableResult {
1435
+ domainName: string;
1436
+ isSuccess: boolean;
1165
1437
  }
1166
-
1167
- interface GetListParams {
1168
- listType?: WhoIsListType;
1438
+ declare const enable: Command<WhoisguardEnableParams, WhoisguardEnableResult>;
1439
+ interface WhoisguardDisableParams {
1440
+ /** Unique domain privacy ID to disable. Sent as `WhoisguardID`. */
1441
+ whoisguardID: number;
1442
+ }
1443
+ interface WhoisguardDisableResult {
1444
+ /** The reference spells this `Domainname`; the fixture uses `DomainName`. */
1445
+ domainName: string;
1446
+ isSuccess: boolean;
1447
+ }
1448
+ declare const disable: Command<WhoisguardDisableParams, WhoisguardDisableResult>;
1449
+ /** `ALLOTED` is the API's own (nonstandard) spelling and is sent verbatim. */
1450
+ type WhoisguardListType = "ALL" | "ALLOTED" | "FREE" | "DISCARD";
1451
+ interface WhoisguardGetListParams {
1452
+ /** Default: ALL. */
1453
+ listType?: WhoisguardListType;
1454
+ /** Default: 1. */
1169
1455
  page?: number;
1456
+ /** Min 2, max 100. */
1170
1457
  pageSize?: number;
1171
1458
  }
1172
-
1173
- declare class WhoIsGuard {
1174
- private readonly config;
1175
- constructor(config: NamecheapProps);
1176
- changeEmailAddress(whoIsGuardId: number): Promise<WhoIsGuardChangeEmailAddressResult>;
1177
- enable(whoIsGuardId: number, forwardedToEmail: string): Promise<string>;
1178
- disable(whoIsGuardId: number): Promise<string>;
1179
- getList(param: GetListParams): Promise<{
1180
- data: Array<WhoIsGuardGetListResult>;
1181
- paging: Paging;
1182
- }>;
1183
- renew(whoIsGuardId: string, year: number, promotionCode?: number): Promise<WhoIsGuardRenewResult>;
1459
+ interface WhoisguardListItem {
1460
+ /** Unique integer representing the subscription (the reference column is "Whoisguard ID"). */
1461
+ id: number;
1462
+ /** The reference spells this column `Domainname`; the fixture uses `DomainName`. Empty for a FREE subscription. */
1463
+ domainName: string;
1464
+ created: string;
1465
+ expires: string;
1466
+ status: string;
1184
1467
  }
1185
-
1186
- declare class Namecheap {
1187
- private readonly apiUrl;
1188
- private readonly apiUser;
1189
- private readonly apiKey;
1190
- private readonly username;
1191
- private readonly clientIp;
1192
- readonly domains: Domains;
1193
- readonly domainsDns: DomainsDNS;
1194
- readonly domainsNs: DomainsNS;
1195
- readonly domainsTransfer: DomainsTransfer;
1196
- readonly ssl: SSL;
1197
- readonly users: Users;
1198
- readonly usersAddress: UsersAddress;
1199
- readonly whoIsGuard: WhoIsGuard;
1200
- get domainPrivacy(): WhoIsGuard;
1201
- constructor(config: ConfigType);
1202
- private getConfig;
1468
+ interface WhoisguardGetListResult {
1469
+ whoisguards: WhoisguardListItem[];
1470
+ paging: Paging;
1471
+ }
1472
+ declare const getList: Command<WhoisguardGetListParams, WhoisguardGetListResult>;
1473
+ /**
1474
+ * @remarks Billed: this command charges your Namecheap account.
1475
+ */
1476
+ interface WhoisguardRenewParams {
1477
+ /** Domain privacy ID to renew. Sent as `WhoisguardID`. */
1478
+ whoisguardID: number;
1479
+ /** Number of years to renew. Default: 1. */
1480
+ years: number;
1481
+ promotionCode?: string;
1203
1482
  }
1483
+ interface WhoisguardRenewResult {
1484
+ whoisguardID?: number;
1485
+ years?: number;
1486
+ /** Omitted when the attribute is absent or not `true`/`false`. */
1487
+ renew?: boolean;
1488
+ orderID?: number;
1489
+ transactionID?: number;
1490
+ chargedAmount?: number;
1491
+ }
1492
+ declare const renew: Command<WhoisguardRenewParams, WhoisguardRenewResult>;
1493
+ /**
1494
+ * The command table behind `client.whoisGuard`. Advanced use only: it is exported for custom
1495
+ * integrations and is not covered by semver stability.
1496
+ */
1497
+ declare const whoisGuardCommands: {
1498
+ changeEmailAddress: Command<WhoisguardChangeEmailAddressParams, WhoisguardChangeEmailAddressResult>;
1499
+ enable: Command<WhoisguardEnableParams, WhoisguardEnableResult>;
1500
+ disable: Command<WhoisguardDisableParams, WhoisguardDisableResult>;
1501
+ getList: Command<WhoisguardGetListParams, WhoisguardGetListResult>;
1502
+ renew: Command<WhoisguardRenewParams, WhoisguardRenewResult>;
1503
+ };
1204
1504
 
1205
- export { DomainDnsTag, DomainListSortBy, DomainListType, DomainTransferListType, DomainTransferSortBy, EmailType, GetAddFundsStatus, IdnCode, LockAction, RecordType, SSLListSortBy, SSLListType, SSLType, UserActionName, UserListFindBy, UserPaymentType, UserProductCategory, UserProductName, UserProductType, WhoIsListType, Namecheap as default };
1505
+ export { Namecheap, NamecheapError, NamecheapHttpError, NamecheapParseError, createTransport, Namecheap as default, dnsCommands, getEmailForwarding as dnsGetEmailForwarding, getHosts as dnsGetHosts, getList$4 as dnsGetList, setCustom as dnsSetCustom, setDefault$1 as dnsSetDefault, setEmailForwarding as dnsSetEmailForwarding, setHosts as dnsSetHosts, check as domainsCheck, domainsCommands, create$5 as domainsCreate, getContacts as domainsGetContacts, getInfo$3 as domainsGetInfo, getList$5 as domainsGetList, getRegistrarLock as domainsGetRegistrarLock, getTldList as domainsGetTldList, reactivate as domainsReactivate, renew$2 as domainsRenew, setContacts as domainsSetContacts, setRegistrarLock as domainsSetRegistrarLock, nsCommands, create$4 as nsCreate, deleteNs as nsDelete, getInfo$2 as nsGetInfo, update$2 as nsUpdate, run, activate as sslActivate, sslCommands, create$2 as sslCreate, editDCVMethod as sslEditDCVMethod, getApproverEmailList as sslGetApproverEmailList, getInfo$1 as sslGetInfo, getList$2 as sslGetList, parseCSR as sslParseCSR, purchaseMoreSans as sslPurchaseMoreSans, reissue as sslReissue, renew$1 as sslRenew, resendApproverEmail as sslResendApproverEmail, resendFulfillmentEmail as sslResendFulfillmentEmail, revokeCertificate as sslRevokeCertificate, transferCommands, create$3 as transferCreate, getList$3 as transferGetList, getStatus as transferGetStatus, updateStatus as transferUpdateStatus, usersAddressCommands, create as usersAddressCreate, deleteAddress as usersAddressDelete, getInfo as usersAddressGetInfo, getList$1 as usersAddressGetList, setDefault as usersAddressSetDefault, update as usersAddressUpdate, changePassword as usersChangePassword, usersCommands, create$1 as usersCreate, createAddFundsRequest as usersCreateAddFundsRequest, getAddFundsStatus as usersGetAddFundsStatus, getBalances as usersGetBalances, getPricing as usersGetPricing, login as usersLogin, resetPassword as usersResetPassword, update$1 as usersUpdate, changeEmailAddress as whoisGuardChangeEmailAddress, whoisGuardCommands, disable as whoisGuardDisable, enable as whoisGuardEnable, getList as whoisGuardGetList, renew as whoisGuardRenew };
1506
+ export type { Command, DnsEmailForward, DnsEmailForwardRecord, DnsEmailType, DnsGetEmailForwardingParams, DnsGetEmailForwardingResult, DnsGetHostsParams, DnsGetHostsResult, DnsGetListParams, DnsGetListResult, DnsHost, DnsHostRecord, DnsRecordType, DnsSetCustomParams, DnsSetCustomResult, DnsSetDefaultParams, DnsSetDefaultResult, DnsSetEmailForwardingParams, DnsSetEmailForwardingResult, DnsSetHostsParams, DnsSetHostsResult, DomainsCheckItem, DomainsCheckParams, DomainsCheckResult, DomainsContact, DomainsContactParams, DomainsCreateParams, DomainsCreateResult, DomainsGetContactsParams, DomainsGetContactsResult, DomainsGetInfoParams, DomainsGetInfoResult, DomainsGetListParams, DomainsGetListResult, DomainsGetRegistrarLockParams, DomainsGetRegistrarLockResult, DomainsGetTldListResult, DomainsListItem, DomainsListType, DomainsLockAction, DomainsReactivateParams, DomainsReactivateResult, DomainsRenewParams, DomainsRenewResult, DomainsSetContactsParams, DomainsSetContactsResult, DomainsSetRegistrarLockParams, DomainsSetRegistrarLockResult, DomainsSortBy, DomainsTld, TransportConfig as NamecheapConfig, NsCreateParams, NsCreateResult, NsDeleteParams, NsDeleteResult, NsGetInfoParams, NsGetInfoResult, NsUpdateParams, NsUpdateResult, PricingPrice, PricingProduct, PricingProductCategory, PricingProductType, Send, SslActivateParams, SslActivateResult, SslCreateParams, SslCreateResult, SslDnsDcEntry, SslDnsDcValidation, SslEditDcvMethodParams, SslEditDcvMethodResult, SslGetApproverEmailListParams, SslGetApproverEmailListResult, SslGetInfoParams, SslGetInfoResult, SslGetListParams, SslGetListResult, SslHttpDcEntry, SslHttpDcValidation, SslListItem, SslListType, SslParseCsrParams, SslParseCsrResult, SslPurchaseMoreSansParams, SslPurchaseMoreSansResult, SslReissueParams, SslReissueResult, SslRenewParams, SslRenewResult, SslResendApproverEmailParams, SslResendApproverEmailResult, SslResendFulfillmentEmailParams, SslResendFulfillmentEmailResult, SslResendResult, SslReturnType, SslRevokeCertificateParams, SslRevokeCertificateResult, SslSortBy, TransferCreateParams, TransferCreateResult, TransferGetListParams, TransferGetListResult, TransferGetStatusParams, TransferGetStatusResult, TransferListItem, TransferListType, TransferSortBy, TransferUpdateStatusParams, TransferUpdateStatusResult, UsersAddressCreateParams, UsersAddressCreateResult, UsersAddressDeleteParams, UsersAddressDeleteResult, UsersAddressGetInfoParams, UsersAddressGetInfoResult, UsersAddressGetListResult, UsersAddressListItem, UsersAddressSetDefaultParams, UsersAddressSetDefaultResult, UsersAddressUpdateParams, UsersAddressUpdateResult, UsersChangePasswordParams, UsersChangePasswordResult, UsersCreateAddFundsRequestParams, UsersCreateAddFundsRequestResult, UsersCreateParams, UsersCreateResult, UsersGetAddFundsStatusParams, UsersGetAddFundsStatusResult, UsersGetBalancesResult, UsersGetPricingParams, UsersGetPricingResult, UsersLoginParams, UsersLoginResult, UsersPaymentType, UsersResetPasswordFindBy, UsersResetPasswordParams, UsersResetPasswordResult, UsersUpdateParams, UsersUpdateResult, WhoisguardChangeEmailAddressParams, WhoisguardChangeEmailAddressResult, WhoisguardDisableParams, WhoisguardDisableResult, WhoisguardEnableParams, WhoisguardEnableResult, WhoisguardGetListParams, WhoisguardGetListResult, WhoisguardListItem, WhoisguardListType, WhoisguardRenewParams, WhoisguardRenewResult };