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