@fwgapps/namecheap 0.6.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/README.md +314 -60
- package/dist/index.cjs +1660 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1211 -954
- package/dist/index.d.ts +1211 -954
- package/dist/index.js +1561 -1
- package/dist/index.js.map +1 -1
- package/package.json +31 -26
- package/dist/index.global.js +0 -5
- package/dist/index.global.js.map +0 -1
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/utils/service.ts","../src/utils/xml.ts","../src/types/enum.ts","../src/methods/domains/index.ts","../src/methods/domains/dns.ts","../src/methods/domains/ns.ts","../src/methods/domains/transfer.ts","../src/methods/ssl/index.ts","../src/methods/users/index.ts","../src/methods/users/address.ts","../src/methods/whois-guard/index.ts"],"sourcesContent":["import { ConfigType, type NamecheapProps } from \"./types/config.type\";\nimport { getNamecheapHost } from \"./utils/service\";\nimport { Domains } from \"./methods/domains\";\nimport { DomainsDNS } from \"@fwg/methods/domains/dns\";\nimport { DomainsNS } from \"@fwg/methods/domains/ns\";\nimport { DomainsTransfer } from \"@fwg/methods/domains/transfer\";\nimport { SSL } from \"@fwg/methods/ssl\";\nimport { Users } from \"@fwg/methods/users\";\nimport { UsersAddress } from \"@fwg/methods/users/address\";\nimport { WhoIsGuard } from \"src/methods/whois-guard\";\n\nexport default class Namecheap {\n private readonly apiUrl: string;\n private readonly apiUser: string;\n private readonly apiKey: string;\n private readonly username: string;\n private readonly clientIp: string;\n\n public readonly domains: Domains;\n public readonly domainsDns: DomainsDNS;\n public readonly domainsNs: DomainsNS;\n public readonly domainsTransfer: DomainsTransfer;\n\n public readonly ssl: SSL;\n\n public readonly users: Users;\n public readonly usersAddress: UsersAddress;\n public readonly whoIsGuard: WhoIsGuard;\n\n public get domainPrivacy(): WhoIsGuard {\n return this.whoIsGuard;\n }\n\n constructor(config: ConfigType) {\n const { apiUser, apiKey, username, clientIp, sandbox } = config;\n\n this.apiUser = apiUser;\n this.apiKey = apiKey;\n this.username = username || apiUser;\n this.clientIp = clientIp;\n this.apiUrl = getNamecheapHost(sandbox);\n\n this.domains = new Domains(this.getConfig());\n this.domainsDns = new DomainsDNS(this.getConfig());\n this.domainsNs = new DomainsNS(this.getConfig());\n this.domainsTransfer = new DomainsTransfer(this.getConfig());\n this.ssl = new SSL(this.getConfig());\n this.users = new Users(this.getConfig());\n this.usersAddress = new UsersAddress(this.getConfig());\n this.whoIsGuard = new WhoIsGuard(this.getConfig());\n }\n\n private getConfig(): NamecheapProps {\n return {\n apiUser: this.apiUser,\n apiKey: this.apiKey,\n username: this.username,\n clientIp: this.clientIp,\n apiUrl: this.apiUrl,\n };\n }\n}\n\nexport * from \"./types/enum\";\n","import { XMLParser } from \"fast-xml-parser\";\nimport { camelCase, pascalCase } from \"change-case-all\";\nimport { simplifyObject } from \"./xml\";\nimport type { NamecheapProps } from \"../types/config.type\";\nimport {\n NamecheapXMLParsedBase,\n NamecheapXMLParsedFail,\n NamecheapXMLParsedSuccess,\n RequestValues,\n} from \"../types/methods/base.type\";\nimport {\n MappedResponseSuccess,\n NamecheapParamsMap,\n NamecheapPostParamsMap,\n NamecheapRootParamsMap,\n} from \"../types/methods/mapped.type\";\n\nexport const getNamecheapHost = (isSandbox: boolean): string => {\n const host = !isSandbox ? \"api.namecheap.com\" : \"api.sandbox.namecheap.com\";\n return `https://${host}/xml.response`;\n};\n\nconst checkRequestError = (response: NamecheapXMLParsedBase | NamecheapXMLParsedFail): boolean =>\n response.status === \"ERROR\" ||\n (Object.hasOwnProperty.call(response, \"errors\") &&\n (!!(response as NamecheapXMLParsedFail).errors.number ||\n !!(response as NamecheapXMLParsedFail).errors.value));\n\n/* eslint-disable */\nconst flattenObjectToArray = (\n input: Record<string, any>,\n prefix: string = \"\",\n arrayFormat = true,\n): Array<[string, string]> => {\n const result: Array<[string, string]> = [];\n\n Object.entries(input).forEach(([key, value]) => {\n const capitalizedKey = pascalCase(`${prefix} ${key}`);\n\n if (typeof value === \"object\" && value !== null && !Array.isArray(value)) {\n result.push(...flattenObjectToArray(value, capitalizedKey));\n } else if (typeof value === \"object\" && value !== null && Array.isArray(value)) {\n value.forEach((item, index) => {\n if (arrayFormat) {\n result.push([`${capitalizedKey}[${index + 1}]`, String(item)]);\n } else {\n result.push([`${capitalizedKey}${index + 1}`, String(item)]);\n }\n });\n } else if (value !== undefined && value !== null) {\n result.push([capitalizedKey, String(value)]);\n }\n });\n\n return result;\n};\n\nconst tagNamesArray = [\n \"apiResponse.commandResponse.tlds.tld\",\n \"apiResponse.commandResponse.tlds.tld.categories\",\n \"apiResponse.commandResponse.domainGetListResult.domain\",\n \"apiResponse.commandResponse.domainCheckResult\",\n \"apiResponse.commandResponse.userGetPricingResult.productType.productCategory\",\n \"apiResponse.commandResponse.userGetPricingResult.productType.productCategory.product\",\n \"apiResponse.commandResponse.userGetPricingResult.productType.productCategory.product.price\",\n \"apiResponse.commandResponse.whoisguardGetListResult.whoisguardGetListResult.whoisguard\",\n \"apiResponse.commandResponse.domainDnsGetEmailForwardingResult.forward\",\n \"apiResponse.commandResponse.domainDnsSetHostsResult\",\n];\n\nconst parser = new XMLParser({\n allowBooleanAttributes: true,\n attributeNamePrefix: \"\",\n ignoreAttributes: false,\n processEntities: true,\n parseTagValue: true,\n parseAttributeValue: true,\n trimValues: true,\n isArray: (_tagName, jPath) => {\n return tagNamesArray.includes(jPath);\n },\n transformTagName: (tagName) => camelCase(tagName),\n transformAttributeName: (attributeName) => camelCase(attributeName),\n});\n\nexport async function request<T extends keyof MappedResponseSuccess>(\n namecheapProps: NamecheapProps,\n command: T,\n params: NamecheapParamsMap[T] = {} as NamecheapParamsMap[T],\n): Promise<NamecheapXMLParsedSuccess<MappedResponseSuccess[T]>> {\n const { apiUser, apiKey, apiUrl, username, clientIp } = namecheapProps;\n\n let url = new URL(apiUrl);\n url.searchParams.append(\"ApiUser\", apiUser);\n url.searchParams.append(\"ApiKey\", apiKey);\n url.searchParams.append(\"UserName\", username);\n url.searchParams.append(\"ClientIp\", clientIp);\n url.searchParams.append(\"Command\", command);\n\n flattenObjectToArray(params).forEach(([key, value]) => {\n url.searchParams.append(key, value);\n });\n\n const response = await fetch(url.toString());\n\n if (!response.ok) {\n throw new Error(`Error in API Namecheap: ${response.statusText}`);\n }\n\n const xmlData = await response.text();\n const parsedValue: { apiResponse: MappedResponseSuccess[T] } = parser.parse(xmlData);\n const json: NamecheapXMLParsedBase = simplifyObject(parsedValue.apiResponse);\n\n if (checkRequestError(json)) {\n const error = (json as NamecheapXMLParsedFail).errors;\n throw {\n code: error.number || -1,\n message: error.value || \"Unknown Error\",\n };\n }\n\n return json as NamecheapXMLParsedSuccess<MappedResponseSuccess[T]>;\n}\n\nexport async function requestPost<T extends keyof MappedResponseSuccess>(\n namecheapProps: NamecheapProps,\n command: T,\n rootParams: NamecheapRootParamsMap[T] = {} as NamecheapRootParamsMap[T],\n params: NamecheapPostParamsMap[T] = {} as NamecheapPostParamsMap[T],\n): Promise<NamecheapXMLParsedSuccess<MappedResponseSuccess[T]>> {\n const { apiUser, apiKey, apiUrl, username, clientIp } = namecheapProps;\n\n let url = new URL(apiUrl);\n url.searchParams.append(\"ApiUser\", apiUser);\n url.searchParams.append(\"ApiKey\", apiKey);\n url.searchParams.append(\"UserName\", username);\n url.searchParams.append(\"ClientIp\", clientIp);\n url.searchParams.append(\"Command\", command);\n\n const requestValues: Array<RequestValues> = [];\n\n flattenObjectToArray(rootParams).forEach(([key, value]) => {\n url.searchParams.append(key, value);\n });\n\n flattenObjectToArray(params, \"\", false).forEach(([key, value]) => {\n requestValues.push({\n Key: key,\n Value: value,\n });\n });\n\n const body = {\n request: {\n RequestValues: requestValues,\n },\n };\n\n const response = await fetch(url.toString(), {\n method: \"POST\",\n body: JSON.stringify(body),\n });\n\n if (!response.ok) {\n throw new Error(`Error in API Namecheap: ${response.statusText}`);\n }\n\n const xmlData = await response.text();\n const parsedValue: { apiResponse: MappedResponseSuccess[T] } = parser.parse(xmlData);\n const json: NamecheapXMLParsedBase = simplifyObject(parsedValue.apiResponse);\n\n if (checkRequestError(json)) {\n const error = (json as NamecheapXMLParsedFail).errors;\n throw {\n code: error.number,\n message: error.value,\n };\n }\n\n return json as NamecheapXMLParsedSuccess<MappedResponseSuccess[T]>;\n}\n","// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const simplifyObject = (obj: any): any => {\n if (Array.isArray(obj)) {\n return obj\n .map(simplifyObject)\n .filter((item) => item !== null && item !== undefined && item !== \"\");\n } else if (typeof obj === \"object\" && obj !== null) {\n const keys = Object.keys(obj);\n\n if (\n keys.length === 2 &&\n keys.includes(\"#text\") &&\n keys.some((key) => key !== \"#text\" && obj[key] === true)\n ) {\n return obj[\"#text\"];\n }\n\n if (keys.length === 2 && keys.some((key) => obj[key] === true)) {\n const keyWithValue = keys.find((key) => obj[key] !== true);\n return simplifyObject(obj[keyWithValue!]);\n }\n\n return Object.keys(obj).reduce(\n (acc, key) => {\n const newKey = key === \"#text\" ? \"value\" : key;\n const simplifiedValue = simplifyObject(obj[key]);\n\n if (simplifiedValue !== null && simplifiedValue !== undefined && simplifiedValue !== \"\") {\n acc[newKey] = simplifiedValue;\n }\n\n return acc;\n },\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n {} as Record<string, any>,\n );\n }\n\n return obj;\n};\n","export const RecordType = {\n A: \"A\",\n AAAA: \"AAAA\",\n ALIAS: \"ALIAS\",\n CAA: \"CAA\",\n CNAME: \"CNAME\",\n MX: \"MX\",\n MXE: \"MXE\",\n NS: \"NS\",\n TXT: \"TXT\",\n URL: \"URL\",\n URL301: \"URL301\",\n FRAME: \"FRAME\",\n} as const;\nexport type RecordType = (typeof RecordType)[keyof typeof RecordType];\n\nexport const EmailType = {\n MXE: \"MXE\",\n MX: \"MX\",\n FWD: \"FWD\",\n OX: \"OX\",\n} as const;\nexport type EmailType = (typeof EmailType)[keyof typeof EmailType];\n\nexport const LockAction = {\n Lock: \"LOCK\",\n Unlock: \"UNLOCK\",\n} as const;\nexport type LockAction = (typeof LockAction)[keyof typeof LockAction];\n\nexport const DomainListType = {\n All: \"ALL\",\n Expiring: \"EXPIRING\",\n Expired: \"EXPIRED\",\n} as const;\nexport type DomainListType = (typeof DomainListType)[keyof typeof DomainListType];\n\nexport const DomainListSortBy = {\n NameAsc: \"NAME\",\n NameDesc: \"NAME_DESC\",\n ExpireDateAsc: \"EXPIREDATE\",\n ExpireDateDesc: \"EXPIREDATE_DESC\",\n CreateDateAsc: \"CREATEDATE\",\n CreateDateDesc: \"CREATEDATE_DESC\",\n} as const;\nexport type DomainListSortBy = (typeof DomainListSortBy)[keyof typeof DomainListSortBy];\n\nexport const IdnCode = {\n AFR: \"afr\",\n ALB: \"alb\",\n ARA: \"ara\",\n ARG: \"arg\",\n ARM: \"arm\",\n ASM: \"asm\",\n AST: \"ast\",\n AVE: \"ave\",\n AWA: \"awa\",\n AZE: \"aze\",\n BAK: \"bak\",\n BAL: \"bal\",\n BAN: \"ban\",\n BAQ: \"baq\",\n BAS: \"bas\",\n BEL: \"bel\",\n BEN: \"ben\",\n BHO: \"bho\",\n BOS: \"bos\",\n BUL: \"bul\",\n BUR: \"bur\",\n CAR: \"car\",\n CAT: \"cat\",\n CHE: \"che\",\n CHI: \"chi\",\n CHV: \"chv\",\n COP: \"cop\",\n COS: \"cos\",\n CZE: \"cze\",\n DAN: \"dan\",\n DIV: \"div\",\n DOI: \"doi\",\n DUT: \"dut\",\n ENG: \"eng\",\n EST: \"est\",\n FAO: \"fao\",\n FIJ: \"fij\",\n FIN: \"fin\",\n FRE: \"fre\",\n FRY: \"fry\",\n GEO: \"geo\",\n GER: \"ger\",\n GLA: \"gla\",\n GLE: \"gle\",\n GON: \"gon\",\n GRE: \"gre\",\n GUJ: \"guj\",\n HEB: \"heb\",\n HIN: \"hin\",\n HUN: \"hun\",\n INC: \"inc\",\n IND: \"ind\",\n INH: \"inh\",\n ISL: \"isl\",\n ITA: \"ita\",\n JAV: \"jav\",\n JPN: \"jpn\",\n KAS: \"kas\",\n KAZ: \"kaz\",\n KHM: \"khm\",\n KIR: \"kir\",\n KOR: \"kor\",\n KUR: \"kur\",\n LAO: \"lao\",\n LAV: \"lav\",\n LIT: \"lit\",\n LTZ: \"ltz\",\n MAL: \"mal\",\n MKD: \"mkd\",\n MLT: \"mlt\",\n MOL: \"mol\",\n MON: \"mon\",\n MRI: \"mri\",\n MSA: \"msa\",\n NEP: \"nep\",\n NOR: \"nor\",\n ORI: \"ori\",\n OSS: \"oss\",\n PAN: \"pan\",\n PER: \"per\",\n POL: \"pol\",\n POR: \"por\",\n PUS: \"pus\",\n RAJ: \"raj\",\n RUM: \"rum\",\n RUS: \"rus\",\n SAN: \"san\",\n SCR: \"scr\",\n SIN: \"sin\",\n SLO: \"slo\",\n SLV: \"slv\",\n SMO: \"smo\",\n SND: \"snd\",\n SOM: \"som\",\n SPA: \"spa\",\n SRD: \"srd\",\n SRP: \"srp\",\n SWA: \"swa\",\n SWE: \"swe\",\n SYR: \"syr\",\n TAM: \"tam\",\n TEL: \"tel\",\n TGK: \"tgk\",\n THA: \"tha\",\n TIB: \"tib\",\n TUR: \"tur\",\n UKR: \"ukr\",\n URD: \"urd\",\n UZB: \"uzb\",\n VIE: \"vie\",\n WEL: \"wel\",\n YID: \"yid\",\n} as const;\nexport type IdnCode = (typeof IdnCode)[keyof typeof IdnCode];\n\nexport const DomainTransferListType = {\n All: \"ALL\",\n InProgress: \"INPROGRESS\",\n Cancelled: \"CANCELLED\",\n Completed: \"COMPLETED\",\n} as const;\nexport type DomainTransferListType =\n (typeof DomainTransferListType)[keyof typeof DomainTransferListType];\n\nexport const DomainTransferSortBy = {\n DomainName: \"DOMAINNAME\",\n DomainNameDesc: \"DOMAINNAME_DESC\",\n TransferDate: \"TRANSFERDATE\",\n TransferDateDesc: \"TRANSFERDATE_DESC\",\n StatusDate: \"STATUSDATE\",\n StatusDateDesc: \"STATUSDATE_DESC\",\n} as const;\nexport type DomainTransferSortBy = (typeof DomainTransferSortBy)[keyof typeof DomainTransferSortBy];\n\nexport const SSLType = {\n PositiveSSL: \"PositiveSSL\",\n EssentialSSL: \"EssentialSSL\",\n InstantSSL: \"InstantSSL\",\n InstantSSLPro: \"InstantSSL Pro\",\n PremiumSSL: \"PremiumSSL\",\n EVSSL: \"EV SSL\",\n PositiveSSLWildcard: \"PositiveSSL Wildcard\",\n EssentialSSLWildcard: \"EssentialSSL Wildcard\",\n PremiumSSLWildcard: \"PremiumSSL Wildcard\",\n PositiveSSLMultiDomain: \"PositiveSSL Multi Domain\",\n MultiDomainSSL: \"Multi Domain SSL\",\n UnifiedCommunications: \"Unified Communications\",\n EVMultiDomainSSL: \"EV Multi Domain SSL\",\n} as const;\nexport type SSLType = (typeof SSLType)[keyof typeof SSLType];\n\nexport const SSLListType = {\n ALL: \"ALL\",\n Processing: \"Processing\",\n EmailSent: \"EmailSent\",\n TechnicalProblem: \"TechnicalProblem\",\n InProgress: \"InProgress\",\n Completed: \"Completed\",\n Deactivated: \"Deactivated\",\n Active: \"Active\",\n Cancelled: \"Cancelled\",\n NewPurchase: \"NewPurchase\",\n NewRenewal: \"NewRenewal\",\n} as const;\nexport type SSLListType = (typeof SSLListType)[keyof typeof SSLListType];\n\nexport const SSLListSortBy = {\n PurchaseDate: \"PURCHASEDATE\",\n PurchaseDateDesc: \"PURCHASEDATE_DESC\",\n SSLType: \"SSLTYPE\",\n SSLTypeDesc: \"SSLTYPE_DESC\",\n ExpireDateTime: \"EXPIREDATETIME\",\n ExpireDateTimeDesc: \"EXPIREDATETIME_DESC\",\n Hostname: \"Host_Name\",\n HostnameDesc: \"Host_Name_DESC\",\n} as const;\nexport type SSLListSortBy = (typeof SSLListSortBy)[keyof typeof SSLListSortBy];\n\nexport const UserProductType = {\n Domain: \"DOMAIN\",\n SslCertificate: \"SSLCERTIFICATE\",\n} as const;\nexport type UserProductType = (typeof UserProductType)[keyof typeof UserProductType];\n\nexport const UserProductCategory = {\n Domains: \"DOMAINS\",\n Comodo: \"COMODO\",\n} as const;\nexport type UserProductCategory = (typeof UserProductCategory)[keyof typeof UserProductCategory];\n\nexport const UserActionName = {\n Register: \"REGISTER\",\n Renew: \"RENEW\",\n Reactivate: \"REACTIVATE\",\n Transfer: \"TRANSFER\",\n Purchase: \"PURCHASE\",\n} as const;\nexport type UserActionName = (typeof UserActionName)[keyof typeof UserActionName];\n\nexport const UserProductName = {\n COM: \"COM\",\n InstantSsl: \"INSTANTSSL\",\n} as const;\nexport type UserProductName = (typeof UserProductName)[keyof typeof UserProductName];\n\nexport const UserPaymentType = {\n CreditCard: \"Creditcard\",\n} as const;\nexport type UserPaymentType = (typeof UserPaymentType)[keyof typeof UserPaymentType];\n\nexport const UserListFindBy = {\n EmailAddress: \"EMAILADDRESS\",\n DomainName: \"DOMAINNAME\",\n Username: \"USERNAME\",\n} as const;\nexport type UserListFindBy = (typeof UserListFindBy)[keyof typeof UserListFindBy];\n\nexport const WhoIsListType = {\n All: \"ALL\",\n Alloted: \"ALLOTED\",\n Free: \"FREE\",\n Discard: \"DISCARD\",\n} as const;\nexport type WhoIsListType = (typeof WhoIsListType)[keyof typeof WhoIsListType];\n\nexport const GetAddFundsStatus = {\n Created: \"CREATED\",\n Submitted: \"SUBMITTED\",\n Completed: \"COMPLETED\",\n Failed: \"FAILED\",\n Expired: \"EXPIRED\",\n} as const;\nexport type GetAddFundsStatus = (typeof GetAddFundsStatus)[keyof typeof GetAddFundsStatus];\n\nexport const DomainDnsTag = {\n Issue: \"issue\",\n IssueWild: \"issuewild\",\n IODEF: \"iodef\",\n};\nexport type DomainDnsTag = (typeof DomainDnsTag)[keyof typeof DomainDnsTag];\n","import { NamecheapProps } from \"@fwg/types/config.type\";\nimport { request } from \"@fwg/utils/service\";\nimport { CommandsDomain } from \"@fwg/utils/commands\";\nimport {\n DomainCheckResult,\n DomainContactsResult,\n DomainCreateResult,\n DomainGetInfoResult,\n DomainGetListResult,\n DomainGetRegistrarLockResult,\n DomainReactivateResult,\n DomainRenewResult,\n TLD,\n} from \"@fwg/types/methods/response/domains.type\";\nimport type {\n ContactDomainParams,\n CreateDomainParams,\n GetListParams,\n ReactivateDomainParams,\n RenewDomainParams,\n} from \"@fwg/types/methods/params/domains-params.type\";\nimport { Paging } from \"@fwg/types/methods/base.type\";\nimport { DomainListType, LockAction } from \"@fwg/types/enum\";\n\nexport class Domains {\n private readonly config: NamecheapProps;\n\n constructor(config: NamecheapProps) {\n this.config = config;\n }\n\n /**\n * Returns a list of domains for the particular user\n * @note IMPORTANT: Namecheap API privacy service provider recently changed to WithheldforPrivacy. We want to avoid service interruption for namecheap API users, so please note that in some cases, you may still see Whoisguard in the API parameter names.\n */\n async getList(\n params: GetListParams = {\n listType: DomainListType.All,\n page: 1,\n pageSize: 20,\n },\n ): Promise<{\n data: Array<DomainGetListResult>;\n paging: Paging;\n }> {\n const response = await request(this.config, CommandsDomain.GetList, params);\n return {\n data: response.commandResponse.domainGetListResult,\n paging: response.commandResponse.paging,\n };\n }\n\n /**\n * Gets contact information for the requested domain\n * @note IMPORTANT: Namecheap API privacy service provider recently changed to WithheldforPrivacy. We want to avoid service interruption for our API users, so please note that in some cases, you may still see Whoisguard in the API parameter names.\n */\n async getContacts(domainName: string): Promise<DomainContactsResult> {\n const response = await request(this.config, CommandsDomain.GetContact, {\n domainName,\n });\n return response.commandResponse.domainContactsResult;\n }\n\n /**\n * Registers a new domain\n * @note IMPORTANT: Namecheap API privacy service provider recently changed to WithheldforPrivacy. We want to avoid service interruption for our API users, so please note that in some cases, you may still see Whoisguard in the API parameter names.\n * @note For successful registration of an IDN domain, you need to send the IdnCode parameter and provide the domain name in the Punycode format (Example: xn--sdkhjsdhfkdh.com), as we do not support native code.\n */\n async create(\n domain: string,\n params: Omit<CreateDomainParams, \"domainName\">,\n ): Promise<DomainCreateResult> {\n const response = await request(this.config, CommandsDomain.Create, {\n ...params,\n domainName: domain,\n });\n\n return response.commandResponse.domainCreateResult;\n }\n\n /**\n * Returns a list of TLDs\n * @note IMPORTANT: Namecheap API privacy service provider recently changed to WithheldforPrivacy. We want to avoid service interruption for our API users, so please note that in some cases, you may still see Whoisguard in the API parameter names.\n * @note We strongly recommend that you cache this API response to avoid repeated calls.\n *\n */\n async getTldList(): Promise<Array<TLD>> {\n const response = await request(this.config, CommandsDomain.GetTldList);\n return response.commandResponse.tlds;\n }\n\n /**\n * Sets contact information for the requested domain\n */\n async setContacts(\n domain: string,\n params: Omit<ContactDomainParams, \"domainName\">,\n ): Promise<string> {\n const response = await request(this.config, CommandsDomain.SetContact, {\n ...params,\n domainName: domain,\n });\n\n return response.commandResponse.domainSetContactResult;\n }\n\n /**\n * Checks the availability of domains\n */\n async check(domains: Array<string>): Promise<Array<DomainCheckResult>> {\n const response = await request(this.config, CommandsDomain.Check, {\n domainList: domains.join(),\n });\n\n return response.commandResponse.domainCheckResult;\n }\n\n /**\n * Reactivates an expired domain\n */\n async reactivate(\n domain: string,\n params: Omit<ReactivateDomainParams, \"domainName\"> = {},\n ): Promise<DomainReactivateResult> {\n const response = await request(this.config, CommandsDomain.Reactivate, {\n ...params,\n domainName: domain,\n });\n\n return response.commandResponse.domainReactivateResult;\n }\n\n /**\n * Renews an expiring domain\n */\n async renew(\n domain: string,\n params: Omit<RenewDomainParams, \"domainName\">,\n ): Promise<DomainRenewResult> {\n const response = await request(this.config, CommandsDomain.Renew, {\n ...params,\n domainName: domain,\n });\n\n return response.commandResponse.domainRenewResult;\n }\n\n /**\n * Gets the Registrar Lock status for the requested domain\n */\n async getRegistrarLock(domain: string): Promise<DomainGetRegistrarLockResult> {\n const response = await request(this.config, CommandsDomain.GetRegistrarLock, {\n domainName: domain,\n });\n\n return response.commandResponse.domainGetRegistrarLockResult;\n }\n\n /**\n * Sets the Registrar Lock status for a domain\n */\n async setRegistrarLock(\n domain: string,\n lockAction: LockAction = LockAction.Lock,\n ): Promise<string> {\n const response = await request(this.config, CommandsDomain.SetRegistrarLock, {\n domainName: domain,\n lockAction,\n });\n\n return response.commandResponse.domainSetRegistrarLockResult;\n }\n\n /**\n * Returns information about the requested domain\n * @note IMPORTANT: Namecheap API privacy service provider recently changed to WithheldforPrivacy. We want to avoid service interruption for Namecheap API users, so please note that in some cases, you may still see Whoisguard in the API parameter names.\n */\n async getInfo(domain: string, hostName?: string): Promise<DomainGetInfoResult> {\n const response = await request(this.config, CommandsDomain.GetInfo, {\n domainName: domain,\n hostName,\n });\n\n return response.commandResponse.domainGetInfoResult;\n }\n}\n","import type { NamecheapProps } from \"@fwg/types/config.type\";\nimport {\n DomainDnsGetEmailForwardingResult,\n DomainDnsGetHostsResult,\n DomainDnsGetListResult,\n} from \"@fwg/types/methods/response/domains-dns.type\";\nimport { request, requestPost } from \"@fwg/utils/service\";\nimport { CommandsDomainDNS } from \"@fwg/utils/commands\";\nimport {\n Host,\n SetDNSEmailForwardingParams,\n SetDNSHostsParams,\n} from \"@fwg/types/methods/params/domains-dns-params.type\";\nimport { RecordType } from \"@fwg/types/enum\";\n\nexport class DomainsDNS {\n private readonly config: NamecheapProps;\n\n constructor(config: NamecheapProps) {\n this.config = config;\n }\n\n /**\n * Sets domain to use namecheap api default DNS servers.\n * Required for free services like Host record management, URL forwarding, email forwarding, dynamic dns and other value added services.\n */\n async setDefault(sld: string, tld: string): Promise<string> {\n const response = await request(this.config, CommandsDomainDNS.SetDefault, {\n sld,\n tld,\n });\n\n return response.commandResponse.domainDnsSetDefaultResult;\n }\n\n /**\n * Sets domain to use custom DNS servers.\n * @note Services like URL forwarding, Email forwarding, Dynamic DNS will not work for domains using custom nameservers\n */\n async setCustom(sld: string, tld: string, nameservers: Array<string>): Promise<string> {\n const response = await request(this.config, CommandsDomainDNS.SetCustom, {\n sld,\n tld,\n nameservers,\n });\n\n return response.commandResponse.domainDNSSetCustomResult;\n }\n\n /**\n * Gets a list of DNS servers associated with the requested domain.\n */\n async getList(sld: string, tld: string): Promise<DomainDnsGetListResult> {\n const response = await request(this.config, CommandsDomainDNS.GetList, {\n sld,\n tld,\n });\n\n return response.commandResponse.domainDnsGetListResult;\n }\n\n /**\n * Retrieves DNS host record settings for the requested domain.\n */\n async getHosts(sld: string, tld: string): Promise<DomainDnsGetHostsResult> {\n const response = await request(this.config, CommandsDomainDNS.GetHosts, {\n sld,\n tld,\n });\n\n return response.commandResponse.domainDnsGetHostsResult;\n }\n\n /**\n * Gets email forwarding settings for the requested domain.\n */\n async getEmailForwarding(domain: string): Promise<DomainDnsGetEmailForwardingResult> {\n const response = await request(this.config, CommandsDomainDNS.GetEmailForwarding, {\n domainName: domain,\n });\n\n return response.commandResponse.domainDnsGetEmailForwardingResult;\n }\n\n /**\n * Sets email forwarding for a domain name.\n */\n async setEmailForwarding(\n domain: string,\n params: Omit<SetDNSEmailForwardingParams, \"domainName\">,\n ): Promise<string> {\n const response = await request(this.config, CommandsDomainDNS.SetEmailForwarding, {\n ...params,\n domainName: domain,\n });\n\n return response.commandResponse.domainDnsSetEmailForwardingResult;\n }\n\n /**\n * Sets DNS host records settings for the requested domain.\n * @note If you set more than 10 hosts the request will be done by POST method otherwise by GET method.\n * @note All host records that are not included into the API call will be deleted, so add them in addition to new host records.\n */\n async setHosts(\n sld: string,\n tld: string,\n params: Omit<\n SetDNSHostsParams,\n \"sld\" | \"tld\" | \"address\" | \"hostname\" | \"mxpref\" | \"recordType\" | \"ttl\"\n > & { hosts: Array<Host> },\n ): Promise<Array<string>> {\n const { hosts } = params;\n const paramsFormatted = hosts.reduce(\n (acc, host, i) => {\n Object.entries(host).forEach(([key, value]) => {\n // @ts-expect-error is a safe setter\n acc[key][i] = value;\n });\n\n return acc;\n },\n {\n hostname: [] as Array<string>,\n ttl: [] as Array<number>,\n address: [] as Array<string>,\n mxpref: [] as Array<string>,\n recordType: [] as Array<RecordType>,\n },\n );\n let response;\n\n if (hosts.length > 10) {\n response = await requestPost(\n this.config,\n CommandsDomainDNS.SetHosts,\n {\n SLD: sld,\n TLD: tld,\n },\n {\n ...paramsFormatted,\n tag: params.tag,\n flag: params.flag,\n emailType: params.emailType,\n },\n );\n } else {\n response = await request(this.config, CommandsDomainDNS.SetHosts, {\n ...paramsFormatted,\n sld,\n tld,\n tag: params.tag,\n flag: params.flag,\n emailType: params.emailType,\n });\n }\n\n return response.commandResponse.domainDnsSetHostsResult;\n }\n}\n","import type { NamecheapProps } from \"@fwg/types/config.type\";\nimport { request } from \"@fwg/utils/service\";\nimport { CommandsDomainNS } from \"@fwg/utils/commands\";\nimport {\n DomainNsCreateResult,\n DomainNsDeleteResult,\n DomainNsInfoResult,\n DomainNsUpdateResult,\n} from \"@fwg/types/methods/response/domains-ns.type\";\n\nexport class DomainsNS {\n private readonly config: NamecheapProps;\n\n constructor(config: NamecheapProps) {\n this.config = config;\n }\n\n async create(\n sld: string,\n tld: string,\n nameserver: string,\n ip: string,\n ): Promise<DomainNsCreateResult> {\n const response = await request(this.config, CommandsDomainNS.Create, {\n sld,\n tld,\n nameserver,\n ip,\n });\n\n return response.commandResponse.domainNsCreateResult;\n }\n\n async delete(sld: string, tld: string, nameserver: string): Promise<DomainNsDeleteResult> {\n const response = await request(this.config, CommandsDomainNS.Delete, {\n sld,\n tld,\n nameserver,\n });\n\n return response.commandResponse.domainNsDeleteResult;\n }\n\n async getInfo(sld: string, tld: string, nameserver: string): Promise<DomainNsInfoResult> {\n const response = await request(this.config, CommandsDomainNS.GetInfo, {\n sld,\n tld,\n nameserver,\n });\n\n return response.commandResponse.domainNsInfoResult;\n }\n\n async update(\n sld: string,\n tld: string,\n nameserver: string,\n ip: string,\n oldIp: string,\n ): Promise<DomainNsUpdateResult> {\n const response = await request(this.config, CommandsDomainNS.Update, {\n sld,\n tld,\n nameserver,\n ip,\n oldIp,\n });\n\n return response.commandResponse.domainNsUpdateResult;\n }\n}\n","import type { NamecheapProps } from \"@fwg/types/config.type\";\nimport { request } from \"@fwg/utils/service\";\nimport { CommandsDomainTransfer } from \"@fwg/utils/commands\";\nimport {\n CreateTransferParams,\n GetListTransferParams,\n} from \"@fwg/types/methods/params/domains-transfer-params.type\";\nimport {\n DomainTransferCreateResult,\n DomainTransferGetStatusResult,\n TransferGetResult,\n} from \"@fwg/types/methods/response/domains-transfer.type\";\nimport { Paging } from \"@fwg/types/methods/base.type\";\nimport { DomainTransferListType, DomainTransferSortBy } from \"@fwg/types/enum\";\n\nexport class DomainsTransfer {\n private readonly config: NamecheapProps;\n\n constructor(config: NamecheapProps) {\n this.config = config;\n }\n\n async create(\n domain: string,\n params: Omit<CreateTransferParams, \"domainName\">,\n ): Promise<DomainTransferCreateResult> {\n const response = await request(this.config, CommandsDomainTransfer.Create, {\n domainName: domain,\n ...params,\n });\n return response.commandResponse.domainTransferCreateResult;\n }\n\n async getStatus(id: number): Promise<DomainTransferGetStatusResult> {\n const response = await request(this.config, CommandsDomainTransfer.GetStatus, {\n transferID: id,\n });\n\n return response.commandResponse.domainTransferGetStatusResult;\n }\n\n async updateStatus(id: number, resubmit: boolean): Promise<number> {\n const response = await request(this.config, CommandsDomainTransfer.UpdateStatus, {\n transferID: id,\n resubmit,\n });\n\n return response.commandResponse.domainTransferUpdateStatusResult;\n }\n\n async getList(\n params: GetListTransferParams = {\n listType: DomainTransferListType.All,\n page: 1,\n pageSize: 10,\n sortBy: DomainTransferSortBy.DomainName,\n },\n ): Promise<{\n data: Array<TransferGetResult>;\n paging: Paging;\n }> {\n const response = await request(this.config, CommandsDomainTransfer.GetList, params);\n\n return {\n data: response.commandResponse.transferGetListResult,\n paging: response.commandResponse.paging,\n };\n }\n}\n","import { NamecheapProps } from \"@fwg/types/config.type\";\nimport {\n ActivateSSLParams,\n CreateSSLParams,\n EditDCVMethodParams,\n GetListSSLParams,\n ReissueSSLParams,\n RenewSSLParams,\n} from \"@fwg/types/methods/params/ssl-params.type\";\nimport { request, requestPost } from \"@fwg/utils/service\";\nimport { CommandsSSL } from \"@fwg/utils/commands\";\nimport {\n GetApproverEmailListResult,\n SSLActivateResult,\n SSLCreateResult,\n SSLEditDcvMethodResult,\n SSLGetInfoResult,\n SSLParseCsrResult,\n SSLPurchaseMoreSansResult,\n SSLRenewResult,\n SSLResult,\n} from \"@fwg/types/methods/response/ssl.type\";\nimport { SSLType } from \"@fwg/types/enum\";\n\nexport class SSL {\n private readonly config: NamecheapProps;\n\n constructor(config: NamecheapProps) {\n this.config = config;\n }\n\n async create(params: CreateSSLParams): Promise<SSLCreateResult> {\n const response = await request(this.config, CommandsSSL.Create, params);\n return response.commandResponse.sslCreateResult;\n }\n\n async getList(params: GetListSSLParams): Promise<Array<SSLResult>> {\n const response = await request(this.config, CommandsSSL.GetList, params);\n return response.commandResponse.sslListResult;\n }\n\n async parseCSR(csr: string, certificateType?: SSLType): Promise<SSLParseCsrResult> {\n const response = await requestPost(this.config, CommandsSSL.ParseCRS, {\n csr,\n certificateType,\n });\n\n return response.commandResponse.sslParseCsrResult;\n }\n\n async getApproverEmailList(\n domainName: string,\n certificateType?: SSLType,\n ): Promise<GetApproverEmailListResult> {\n const response = await request(this.config, CommandsSSL.GetApproverEmailList, {\n domainName,\n certificateType,\n });\n return response.commandResponse.getApproverEmailListResult;\n }\n\n async activate(\n certificateId: number,\n params: Omit<ActivateSSLParams, \"certificateId\">,\n ): Promise<SSLActivateResult> {\n const response = await request(this.config, CommandsSSL.Activate, {\n certificateId,\n ...params,\n });\n\n return response.commandResponse.sslActivateResult;\n }\n\n async resendApproverEmail(certificateId: number): Promise<number> {\n const response = await request(this.config, CommandsSSL.ResendApproverEmail, {\n certificateId,\n });\n\n return response.commandResponse.sslResendApproverEmailResult;\n }\n\n async getInfo(certificateId: number): Promise<SSLGetInfoResult> {\n const response = await request(this.config, CommandsSSL.GetInfo, {\n certificateId,\n });\n\n return response.commandResponse.sslGetInfoResult;\n }\n\n async renew(\n certificateId: number,\n params: Omit<RenewSSLParams, \"certificateId\">,\n ): Promise<SSLRenewResult> {\n const response = await request(this.config, CommandsSSL.Renew, {\n certificateId,\n ...params,\n });\n\n return response.commandResponse.sslRenewResult;\n }\n\n async reissue(\n certificateId: number,\n params: Omit<ReissueSSLParams, \"certificateId\">,\n ): Promise<SSLActivateResult> {\n const response = await request(this.config, CommandsSSL.Reissue, {\n certificateId,\n ...params,\n });\n\n return response.commandResponse.sslActivateResult;\n }\n\n async resendFulfillmentEmail(certificateId: number): Promise<number> {\n const response = await request(this.config, CommandsSSL.ResendFulfillmentEmail, {\n certificateId,\n });\n\n return response.commandResponse.sslResendFulfillmentEmailResult;\n }\n\n async purchaseMoreSANS(\n certificateId: number,\n numberOfSANSToAdd: number,\n ): Promise<SSLPurchaseMoreSansResult> {\n const response = await request(this.config, CommandsSSL.PurchaseMoreSANS, {\n certificateId,\n numberOfSANSToAdd,\n });\n\n return response.commandResponse.sslPurchaseMoreSansResult;\n }\n\n async revokeCertificate(certificateId: number, certificateType: SSLType): Promise<number> {\n const response = await request(this.config, CommandsSSL.RevokeCertificate, {\n certificateId,\n certificateType,\n });\n\n return response.commandResponse.revokeCertificateResult;\n }\n\n async editDCVMethod(\n certificateId: number,\n params: Omit<EditDCVMethodParams, \"certificateId\">,\n ): Promise<SSLEditDcvMethodResult> {\n const response = await request(this.config, CommandsSSL.EditDCVMethod, {\n certificateId,\n ...params,\n });\n\n return response.commandResponse.sslEditDcvMethodResult;\n }\n}\n","import { NamecheapProps } from \"@fwg/types/config.type\";\nimport {\n CreateAddFundsRequestParams,\n CreateUserParams,\n GetPricingUserParams,\n ResetPasswordParams,\n UpdateParams,\n} from \"@fwg/types/methods/params/users-params.type\";\nimport { request } from \"@fwg/utils/service\";\nimport { CommandsUser } from \"@fwg/utils/commands\";\nimport {\n GetAddFundsStatusResult,\n UserCreateAddFundsRequest,\n UserGetBalancesResult,\n UserGetPricingResult,\n} from \"@fwg/types/methods/response/users.type\";\n\nexport class Users {\n private readonly config: NamecheapProps;\n\n constructor(config: NamecheapProps) {\n this.config = config;\n }\n\n async getPricing(params: GetPricingUserParams): Promise<UserGetPricingResult> {\n const response = await request(this.config, CommandsUser.GetPricing, params);\n return response.commandResponse.userGetPricingResult;\n }\n\n async getBalances(): Promise<UserGetBalancesResult> {\n const response = await request(this.config, CommandsUser.GetBalances);\n return response.commandResponse.userGetBalancesResult;\n }\n\n async changePassword(oldPassword: string, newPassword: string): Promise<string> {\n const response = await request(this.config, CommandsUser.ChangePassword, {\n oldPassword,\n newPassword,\n });\n return response.commandResponse.userChangePasswordResult;\n }\n\n async update(params: UpdateParams): Promise<string> {\n const response = await request(this.config, CommandsUser.Update, params);\n return response.commandResponse.userUpdateResult;\n }\n\n async createAddFundsRequest(\n username: string,\n params: Omit<CreateAddFundsRequestParams, \"username\">,\n ): Promise<UserCreateAddFundsRequest> {\n const response = await request(this.config, CommandsUser.CreateAddFundsRequest, {\n ...params,\n username,\n });\n\n return response.commandResponse.createaddfundsrequestresult;\n }\n\n async getAddFundsStatus(tokenId: string): Promise<GetAddFundsStatusResult> {\n const response = await request(this.config, CommandsUser.GetAddFundsStatus, {\n tokenId,\n });\n\n return response.commandResponse.getAddFundsStatusResult;\n }\n\n async create(param: CreateUserParams): Promise<number> {\n const response = await request(this.config, CommandsUser.Create, param);\n\n return response.commandResponse.userCreateResult;\n }\n\n async login(password: string): Promise<string> {\n const response = await request(this.config, CommandsUser.Login, {\n password,\n });\n\n return response.commandResponse.userLoginResult;\n }\n\n async resetPassword(params: ResetPasswordParams): Promise<string> {\n const response = await request(this.config, CommandsUser.ResetPassword, params);\n\n return response.commandResponse.userResetPasswordResult;\n }\n}\n","import { NamecheapProps } from \"@fwg/types/config.type\";\nimport { request } from \"@fwg/utils/service\";\nimport { CommandsUserAddress } from \"@fwg/utils/commands\";\nimport {\n AddressCreateResult,\n AddressDeleteResult,\n AddressGetListResult,\n AddressUpdateResult,\n GetAddressInfoResult,\n} from \"@fwg/types/methods/response/users-address.type\";\nimport {\n CreateUserAddressParams,\n UpdateUserAddressParams,\n} from \"@fwg/types/methods/params/users-address-params.type\";\n\nexport class UsersAddress {\n private readonly config: NamecheapProps;\n\n constructor(config: NamecheapProps) {\n this.config = config;\n }\n\n async create(param: CreateUserAddressParams): Promise<AddressCreateResult> {\n const response = await request(this.config, CommandsUserAddress.Create, param);\n return response.commandResponse.addressCreateResult;\n }\n\n async delete(addressId: number): Promise<AddressDeleteResult> {\n const response = await request(this.config, CommandsUserAddress.Delete, {\n addressId,\n });\n\n return response.commandResponse.addressDeleteResult;\n }\n\n async getInfo(addressId: number): Promise<GetAddressInfoResult> {\n const response = await request(this.config, CommandsUserAddress.GetInfo, {\n addressId,\n });\n\n return response.commandResponse.getAddressInfoResult;\n }\n\n async getList(): Promise<AddressGetListResult> {\n const response = await request(this.config, CommandsUserAddress.GetList);\n\n return response.commandResponse.addressGetListResult;\n }\n\n async setDefault(addressId: number): Promise<number> {\n const response = await request(this.config, CommandsUserAddress.SetDefault, {\n addressId,\n });\n\n return response.commandResponse.addressSetDefaultResult;\n }\n\n async update(\n addressId: number,\n params: Omit<UpdateUserAddressParams, \"addressId\">,\n ): Promise<AddressUpdateResult> {\n const response = await request(this.config, CommandsUserAddress.Update, {\n ...params,\n addressId,\n });\n\n return response.commandResponse.addressUpdateResult;\n }\n}\n","import { NamecheapProps } from \"@fwg/types/config.type\";\nimport { request } from \"@fwg/utils/service\";\nimport { CommandsWhoIsGuard } from \"@fwg/utils/commands\";\nimport {\n WhoIsGuardChangeEmailAddressResult,\n WhoIsGuardGetListResult,\n WhoIsGuardRenewResult,\n} from \"@fwg/types/methods/response/whois-guard.type\";\nimport { GetListParams } from \"@fwg/types/methods/params/whois-guard-params.type\";\nimport { Paging } from \"@fwg/types/methods/base.type\";\n\nexport class WhoIsGuard {\n private readonly config: NamecheapProps;\n\n constructor(config: NamecheapProps) {\n this.config = config;\n }\n\n async changeEmailAddress(whoIsGuardId: number): Promise<WhoIsGuardChangeEmailAddressResult> {\n const response = await request(this.config, CommandsWhoIsGuard.ChangeEmailAddress, {\n whoIsGuardId,\n });\n\n return response.commandResponse.whoisguardChangeEmailAddressResult;\n }\n\n async enable(whoIsGuardId: number, forwardedToEmail: string): Promise<string> {\n const response = await request(this.config, CommandsWhoIsGuard.Enable, {\n whoIsGuardId,\n forwardedToEmail,\n });\n\n return response.commandResponse.whoisguardEnableResult;\n }\n\n async disable(whoIsGuardId: number): Promise<string> {\n const response = await request(this.config, CommandsWhoIsGuard.Disable, {\n whoIsGuardId,\n });\n\n return response.commandResponse.whoisguardDisableResult;\n }\n\n async getList(param: GetListParams): Promise<{\n data: Array<WhoIsGuardGetListResult>;\n paging: Paging;\n }> {\n const response = await request(this.config, CommandsWhoIsGuard.GetList, param);\n\n return {\n data: response.commandResponse.whoisguardGetListResult,\n paging: response.commandResponse.paging,\n };\n }\n\n async renew(\n whoIsGuardId: string,\n year: number,\n promotionCode?: number,\n ): Promise<WhoIsGuardRenewResult> {\n const response = await request(this.config, CommandsWhoIsGuard.Renew, {\n whoIsGuardId,\n year,\n promotionCode,\n });\n\n return response.commandResponse.whoisguardRenewResult;\n }\n}\n"],"mappings":"yaAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,kBAAAE,GAAA,qBAAAC,EAAA,mBAAAC,EAAA,2BAAAC,EAAA,yBAAAC,EAAA,cAAAC,EAAA,sBAAAC,GAAA,YAAAC,EAAA,eAAAC,EAAA,eAAAC,EAAA,kBAAAC,GAAA,gBAAAC,EAAA,YAAAC,EAAA,mBAAAC,GAAA,mBAAAC,GAAA,oBAAAC,GAAA,wBAAAC,GAAA,oBAAAC,GAAA,oBAAAC,GAAA,kBAAAC,GAAA,YAAAC,IAAA,eAAAC,EAAAvB,ICAA,IAAAwB,EAA0B,2BAC1BC,EAAsC,2BCA/B,IAAMC,EAAkBC,GAAkB,CAC/C,GAAI,MAAM,QAAQA,CAAG,EACnB,OAAOA,EACJ,IAAID,CAAc,EAClB,OAAQE,GAASA,GAAS,MAA8BA,IAAS,EAAE,EACjE,GAAI,OAAOD,GAAQ,UAAYA,IAAQ,KAAM,CAClD,IAAME,EAAO,OAAO,KAAKF,CAAG,EAE5B,GACEE,EAAK,SAAW,GAChBA,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gBAAkB,IAAIC,EAAgB,KAAK,UAAU,CAAC,EAC3D,KAAK,IAAM,IAAIC,EAAI,KAAK,UAAU,CAAC,EACnC,KAAK,MAAQ,IAAIC,EAAM,KAAK,UAAU,CAAC,EACvC,KAAK,aAAe,IAAIC,EAAa,KAAK,UAAU,CAAC,EACrD,KAAK,WAAa,IAAIC,EAAW,KAAK,UAAU,CAAC,CACnD,CAEQ,WAA4B,CAClC,MAAO,CACL,QAAS,KAAK,QACd,OAAQ,KAAK,OACb,SAAU,KAAK,SACf,SAAU,KAAK,SACf,OAAQ,KAAK,MACf,CACF,CACF","names":["index_exports","__export","DomainDnsTag","DomainListSortBy","DomainListType","DomainTransferListType","DomainTransferSortBy","EmailType","GetAddFundsStatus","IdnCode","LockAction","RecordType","SSLListSortBy","SSLListType","SSLType","UserActionName","UserListFindBy","UserPaymentType","UserProductCategory","UserProductName","UserProductType","WhoIsListType","Namecheap","__toCommonJS","import_fast_xml_parser","import_change_case_all","simplifyObject","obj","item","keys","key","keyWithValue","acc","newKey","simplifiedValue","getNamecheapHost","isSandbox","checkRequestError","response","flattenObjectToArray","input","prefix","arrayFormat","result","key","value","capitalizedKey","item","index","tagNamesArray","parser","_tagName","jPath","tagName","attributeName","request","namecheapProps","command","params","apiUser","apiKey","apiUrl","username","clientIp","url","xmlData","parsedValue","json","simplifyObject","error","requestPost","rootParams","requestValues","body","RecordType","EmailType","LockAction","DomainListType","DomainListSortBy","IdnCode","DomainTransferListType","DomainTransferSortBy","SSLType","SSLListType","SSLListSortBy","UserProductType","UserProductCategory","UserActionName","UserProductName","UserPaymentType","UserListFindBy","WhoIsListType","GetAddFundsStatus","DomainDnsTag","Domains","config","params","DomainListType","response","request","domainName","domain","domains","lockAction","LockAction","hostName","DomainsDNS","config","sld","tld","request","nameservers","domain","params","hosts","paramsFormatted","acc","host","i","key","value","response","requestPost","DomainsNS","config","sld","tld","nameserver","ip","request","oldIp","DomainsTransfer","config","domain","params","request","id","resubmit","DomainTransferListType","DomainTransferSortBy","response","SSL","config","params","request","csr","certificateType","requestPost","domainName","certificateId","numberOfSANSToAdd","Users","config","params","request","oldPassword","newPassword","username","tokenId","param","password","UsersAddress","config","param","request","addressId","params","WhoIsGuard","config","whoIsGuardId","request","forwardedToEmail","param","response","year","promotionCode","Namecheap","config","apiUser","apiKey","username","clientIp","sandbox","getNamecheapHost","Domains","DomainsDNS","DomainsNS","DomainsTransfer","SSL","Users","UsersAddress","WhoIsGuard"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/core/errors.ts","../src/core/serialize.ts","../src/core/define.ts","../src/core/fields.ts","../src/commands/dns.ts","../src/core/paging.ts","../src/commands/domains.ts","../src/commands/ns.ts","../src/commands/ssl.ts","../src/commands/transfer.ts","../src/commands/users.ts","../src/commands/users-address.ts","../src/commands/whoisguard.ts","../src/core/element.ts","../src/core/xml.ts","../src/core/envelope.ts","../src/core/transport.ts","../src/client.ts"],"sourcesContent":["import Namecheap from \"./client\";\n\nexport default Namecheap;\nexport { Namecheap };\nexport { NamecheapError, NamecheapHttpError, NamecheapParseError } from \"./core/errors\";\nexport type { TransportConfig as NamecheapConfig } from \"./core/transport\";\n// Tree-shakeable building blocks: `run(domainsCheck, createTransport(config), params)`.\nexport { createTransport } from \"./core/transport\";\nexport type { Send } from \"./core/transport\";\nexport { run } from \"./core/define\";\nexport type { Command } from \"./core/define\";\nexport * from \"./commands/domains\";\nexport * from \"./commands/dns\";\nexport * from \"./commands/ns\";\nexport * from \"./commands/transfer\";\nexport * from \"./commands/ssl\";\nexport * from \"./commands/users\";\nexport * from \"./commands/users-address\";\nexport * from \"./commands/whoisguard\";\n","export type ApiErrorItem = { code: number; message: string };\n\n/** Thrown when the Namecheap API answers with `Status=\"ERROR\"`. */\nexport class NamecheapError extends Error {\n readonly code: number;\n readonly errors: readonly ApiErrorItem[];\n\n constructor(errors: readonly ApiErrorItem[]) {\n const first = errors[0];\n super(\n first === undefined\n ? \"Unknown Namecheap error\"\n : first.message.trim() === \"\"\n ? `Namecheap error ${first.code}`\n : first.message,\n );\n this.name = \"NamecheapError\";\n this.code = first?.code ?? -1;\n this.errors = errors;\n }\n}\n\n/** Thrown when the HTTP request fails or answers with a non-2xx status. */\nexport class NamecheapHttpError extends Error {\n readonly status: number | undefined;\n readonly statusText: string;\n\n constructor(message: string, init?: { status?: number; statusText?: string; cause?: unknown }) {\n super(message, init?.cause === undefined ? undefined : { cause: init.cause });\n this.name = \"NamecheapHttpError\";\n this.status = init?.status;\n this.statusText = init?.statusText ?? \"\";\n }\n}\n\n/** Thrown when a response body cannot be parsed or has an unexpected shape. */\nexport class NamecheapParseError extends Error {\n constructor(message: string, init?: { cause?: unknown }) {\n super(message, init?.cause === undefined ? undefined : { cause: init.cause });\n this.name = \"NamecheapParseError\";\n }\n}\n","export const ACRONYMS: readonly string[] = [\n \"SLD\",\n \"TLD\",\n \"IP\",\n \"ID\",\n \"DNS\",\n \"WG\",\n \"MX\",\n \"TTL\",\n \"EPP\",\n \"CSR\",\n \"DCV\",\n \"SSL\",\n];\n\nexport type ArrayStyle = \"bracket\" | \"suffix\";\n\nexport interface SerializeOptions {\n arrayStyle?: ArrayStyle;\n /** Maps a dotted camelCase path (e.g. `registrant.firstName`) to an exact parameter name. */\n keys?: Readonly<Record<string, string>>;\n}\n\nconst hasOwn = (obj: object, key: string): boolean =>\n Object.prototype.hasOwnProperty.call(obj, key);\n\nfunction splitWords(key: string): string[] {\n return key\n .replace(/([a-z0-9])([A-Z])/g, \"$1 $2\")\n .replace(/([A-Z]+)([A-Z][a-z])/g, \"$1 $2\")\n .split(/[\\s_]+/)\n .filter((word) => word.length > 0);\n}\n\nfunction toWord(word: string): string {\n const upper = word.toUpperCase();\n if (ACRONYMS.includes(upper)) return upper;\n return word.charAt(0).toUpperCase() + word.slice(1);\n}\n\nexport function toParamName(key: string): string {\n return splitWords(key).map(toWord).join(\"\");\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n if (typeof value !== \"object\" || value === null) return false;\n const proto: unknown = Object.getPrototypeOf(value);\n return proto === Object.prototype || proto === null;\n}\n\nfunction isObject(value: unknown): value is object {\n return typeof value === \"object\" && value !== null;\n}\n\nexport function serializeParams(\n params: object,\n opts: SerializeOptions = {},\n): Array<[string, string]> {\n const arrayStyle = opts.arrayStyle ?? \"bracket\";\n const keys = opts.keys ?? {};\n const out: Array<[string, string]> = [];\n\n const walk = (obj: object, path: string[], prefix: string): void => {\n for (const [key, value] of Object.entries(obj)) {\n if (value === undefined || value === null) continue;\n const keyPath = [...path, key];\n const dotted = keyPath.join(\".\");\n const name = (hasOwn(keys, dotted) ? keys[dotted] : undefined) ?? prefix + toParamName(key);\n\n if (Array.isArray(value)) {\n if (value.some((item) => isPlainObject(item))) {\n // Records: element i (1-based, by position) field f becomes `<Field><i>`; the\n // array's own name is not part of the wire name.\n value.forEach((item, position) => {\n if (item === undefined || item === null) {\n throw new TypeError(\n `Array parameter \"${dotted}\" cannot contain null or undefined records`,\n );\n }\n if (!isPlainObject(item)) {\n throw new TypeError(`Array parameter \"${dotted}\" cannot mix objects and scalars`);\n }\n for (const [field, fieldValue] of Object.entries(item)) {\n if (fieldValue === undefined || fieldValue === null) continue;\n if (isObject(fieldValue)) {\n throw new TypeError(\n `Array parameter \"${dotted}\" field \"${field}\" must be a scalar value`,\n );\n }\n out.push([`${toParamName(field)}${position + 1}`, String(fieldValue)]);\n }\n });\n continue;\n }\n let index = 0;\n for (const item of value) {\n if (item === undefined || item === null) continue;\n if (isObject(item)) {\n throw new TypeError(\n `Array parameter \"${dotted}\" cannot contain nested arrays or non-plain objects`,\n );\n }\n index += 1;\n out.push([\n arrayStyle === \"bracket\" ? `${name}[${index}]` : `${name}${index}`,\n String(item),\n ]);\n }\n } else if (isObject(value)) {\n // A mapped parent name replaces the concatenated prefix for its children.\n walk(value, keyPath, name);\n } else {\n out.push([name, String(value)]);\n }\n }\n };\n\n walk(params, [], \"\");\n return out;\n}\n","/* eslint-disable @typescript-eslint/no-empty-object-type -- `{}` is the intended \"all params optional\" check */\nimport type { El } from \"./element\";\nimport { NamecheapParseError } from \"./errors\";\nimport { serializeParams } from \"./serialize\";\nimport type { ArrayStyle } from \"./serialize\";\nimport type { Send } from \"./transport\";\n\n/** Wire names the transport sets itself; a caller must never add a second copy. */\nconst RESERVED_NAMES = new Set([\"apiuser\", \"apikey\", \"username\", \"clientip\", \"command\"]);\n\nexport interface CommandDef<P, R> {\n /** Namecheap command name, e.g. `namecheap.domains.check`. */\n name: string;\n arrayStyle?: ArrayStyle;\n /** Maps a dotted camelCase path to an exact parameter name. */\n keys?: Readonly<Record<string, string>>;\n /** Runs before serializing; throw to reject the call without sending anything. */\n validate?: (params: P) => void;\n /** Receives the CommandResponse element returned by `send`. */\n parse: (cr: El) => R;\n}\n\nexport interface Command<P, R> extends CommandDef<P, R> {\n /** Phantom field carrying the params type; never set at runtime. */\n readonly _params?: P;\n}\n\nexport function defineCommand<P, R>(def: CommandDef<P, R>): Command<P, R> {\n return def;\n}\n\nexport type Group<C> = {\n [K in keyof C]: C[K] extends Command<infer P, infer R>\n ? {} extends P\n ? (params?: P) => Promise<R>\n : (params: P) => Promise<R>\n : never;\n};\n\n/**\n * Runs one command: validates, serializes, sends and parses.\n *\n * This is the tree-shakeable entry point: importing only `createTransport`, one\n * standalone command (for example `domainsCheck`) and `run` bundles just those, not the\n * whole command catalog that `new Namecheap(...)` carries.\n */\nexport async function run<P, R>(\n command: Command<P, R>,\n send: Send,\n ...args: {} extends P ? [params?: P] : [params: P]\n): Promise<R> {\n const params = (args[0] ?? {}) as P & object;\n command.validate?.(params);\n const options: { arrayStyle?: ArrayStyle; keys?: Readonly<Record<string, string>> } = {};\n if (command.arrayStyle !== undefined) options.arrayStyle = command.arrayStyle;\n if (command.keys !== undefined) options.keys = command.keys;\n const serialized = serializeParams(params, options);\n for (const [name] of serialized) {\n if (RESERVED_NAMES.has(name.toLowerCase())) {\n throw new TypeError(`Parameter \"${name}\" is reserved: the client sets it itself`);\n }\n }\n const el = await send({ command: command.name, params: serialized });\n try {\n return command.parse(el);\n } catch (error) {\n if (error instanceof NamecheapParseError) {\n throw new NamecheapParseError(\n `${command.name}: Namecheap reported success but the response could not be read; the action may have been performed, verify before retrying`,\n { cause: error },\n );\n }\n throw error;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function group<C extends Record<string, Command<any, any>>>(\n commands: C,\n send: Send,\n): Group<C> {\n const out: Record<string, (params?: object) => Promise<unknown>> = {};\n for (const [key, command] of Object.entries(commands)) {\n out[key] = (params) => run(command, send, params as never);\n }\n return out as Group<C>;\n}\n","import type { El } from \"./element\";\n\n/** Spreads `{ [key]: value }` only when the value is present. */\nexport function optionalField<K extends string, V>(key: K, value: V | undefined): { [P in K]?: V } {\n return value === undefined ? {} : ({ [key]: value } as { [P in K]?: V });\n}\n\n/**\n * The lenient number of the first of `names` that is present on `el` (a present but\n * malformed value yields `undefined`, never a throw). For response attributes whose\n * spelling varies, such as `OrderId` and `OrderID`.\n */\nexport function firstLenientNumber(el: El, ...names: string[]): number | undefined {\n for (const name of names) {\n if (el.optionalString(name) !== undefined) return el.lenientNumber(name);\n }\n return undefined;\n}\n","import { defineCommand } from \"../core/define\";\nimport type { El } from \"../core/element\";\nimport { optionalField } from \"../core/fields\";\n\n// ---------------------------------------------------------------------------\n// namecheap.domains.dns.setDefault\n// ---------------------------------------------------------------------------\n\nexport interface DnsSetDefaultParams {\n /** SLD of the domain name. */\n sld: string;\n /** TLD of the domain name. */\n tld: string;\n}\n\nexport interface DnsSetDefaultResult {\n domain: string;\n updated: boolean;\n}\n\nconst setDefault = /* @__PURE__ */ defineCommand<DnsSetDefaultParams, DnsSetDefaultResult>({\n name: \"namecheap.domains.dns.setDefault\",\n parse: (cr) => {\n const result = cr.one(\"DomainDNSSetDefaultResult\");\n return { domain: result.string(\"Domain\"), updated: result.boolean(\"Updated\") };\n },\n});\n\n// ---------------------------------------------------------------------------\n// namecheap.domains.dns.setCustom\n// ---------------------------------------------------------------------------\n\nexport interface DnsSetCustomParams {\n sld: string;\n tld: string;\n /** Comma-separated list of nameservers. */\n nameservers: string;\n}\n\nexport interface DnsSetCustomResult {\n domain: string;\n updated: boolean;\n}\n\nconst setCustom = /* @__PURE__ */ defineCommand<DnsSetCustomParams, DnsSetCustomResult>({\n name: \"namecheap.domains.dns.setCustom\",\n parse: (cr) => {\n const result = cr.one(\"DomainDNSSetCustomResult\");\n return { domain: result.string(\"Domain\"), updated: result.boolean(\"Updated\") };\n },\n});\n\n// ---------------------------------------------------------------------------\n// namecheap.domains.dns.getList\n// ---------------------------------------------------------------------------\n\nexport interface DnsGetListParams {\n sld: string;\n tld: string;\n}\n\nexport interface DnsGetListResult {\n domain: string;\n isUsingOurDNS: boolean;\n /** Present in recorded responses, not in the reference. */\n isPremiumDNS?: boolean;\n /** Present in recorded responses, not in the reference. */\n isUsingFreeDNS?: boolean;\n /** Taken from the recorded responses (not in the reference's response table); empty when none are listed. */\n nameservers: string[];\n}\n\nconst getList = /* @__PURE__ */ defineCommand<DnsGetListParams, DnsGetListResult>({\n name: \"namecheap.domains.dns.getList\",\n parse: (cr) => {\n const result = cr.one(\"DomainDNSGetListResult\");\n return {\n domain: result.string(\"Domain\"),\n isUsingOurDNS: result.boolean(\"IsUsingOurDNS\"),\n ...optionalField(\"isPremiumDNS\", result.optionalBoolean(\"IsPremiumDNS\")),\n ...optionalField(\"isUsingFreeDNS\", result.optionalBoolean(\"IsUsingFreeDNS\")),\n nameservers: result.all(\"Nameserver\").map((ns) => ns.text()),\n };\n },\n});\n\n// ---------------------------------------------------------------------------\n// namecheap.domains.dns.getHosts\n// ---------------------------------------------------------------------------\n\nexport interface DnsGetHostsParams {\n sld: string;\n tld: string;\n}\n\nexport interface DnsHost {\n /** The reference spells the attribute `HostID`; responses carry `HostId`. */\n hostId: number;\n name: string;\n type: string;\n address: string;\n mxPref: number;\n ttl: number;\n /** Present in recorded responses, not in the reference. */\n associatedAppTitle?: string;\n /** Present in recorded responses, not in the reference. */\n friendlyName?: string;\n /** Present in recorded responses, not in the reference. */\n isActive?: boolean;\n /** Present in recorded responses, not in the reference. */\n isDDNSEnabled?: boolean;\n}\n\nexport interface DnsGetHostsResult {\n domain: string;\n /** Present in recorded responses, not in the reference. */\n emailType?: string;\n isUsingOurDNS: boolean;\n hosts: DnsHost[];\n}\n\nfunction parseHost(host: El): DnsHost {\n return {\n hostId: host.number(\"HostId\"),\n name: host.string(\"Name\"),\n type: host.string(\"Type\"),\n address: host.string(\"Address\"),\n mxPref: host.number(\"MXPref\"),\n ttl: host.number(\"TTL\"),\n ...optionalField(\"associatedAppTitle\", host.optionalString(\"AssociatedAppTitle\")),\n ...optionalField(\"friendlyName\", host.optionalString(\"FriendlyName\")),\n ...optionalField(\"isActive\", host.optionalBoolean(\"IsActive\")),\n ...optionalField(\"isDDNSEnabled\", host.optionalBoolean(\"IsDDNSEnabled\")),\n };\n}\n\nconst getHosts = /* @__PURE__ */ defineCommand<DnsGetHostsParams, DnsGetHostsResult>({\n name: \"namecheap.domains.dns.getHosts\",\n parse: (cr) => {\n const result = cr.one(\"DomainDNSGetHostsResult\");\n return {\n domain: result.string(\"Domain\"),\n ...optionalField(\"emailType\", result.optionalString(\"EmailType\")),\n isUsingOurDNS: result.boolean(\"IsUsingOurDNS\"),\n hosts: result.all(\"host\").map(parseHost),\n };\n },\n});\n\n// ---------------------------------------------------------------------------\n// namecheap.domains.dns.getEmailForwarding\n// ---------------------------------------------------------------------------\n\nexport interface DnsGetEmailForwardingParams {\n /** Domain name to get settings for. */\n domainName: string;\n}\n\nexport interface DnsEmailForward {\n mailbox: string;\n /** Present in recorded responses, not in the reference. */\n forwardTo?: string;\n}\n\nexport interface DnsGetEmailForwardingResult {\n domain: string;\n forwards: DnsEmailForward[];\n}\n\nconst getEmailForwarding = /* @__PURE__ */ defineCommand<\n DnsGetEmailForwardingParams,\n DnsGetEmailForwardingResult\n>({\n name: \"namecheap.domains.dns.getEmailForwarding\",\n parse: (cr) => {\n const result = cr.one(\"DomainEmailForwardingResult\");\n return {\n domain: result.string(\"Domain\"),\n forwards: result.all(\"Forward\").map((forward) => ({\n mailbox: forward.string(\"mailbox\"),\n ...optionalField(\"forwardTo\", forward.optionalString(\"ForwardTo\")),\n })),\n };\n },\n});\n\n// ---------------------------------------------------------------------------\n// namecheap.domains.dns.setEmailForwarding\n// ---------------------------------------------------------------------------\n\n/** One forwarding rule, sent as `MailBox<n>` and `ForwardTo<n>`. */\nexport interface DnsEmailForwardRecord {\n /** Mailbox for email forwarding (e.g. `example@domain.com`). */\n mailBox: string;\n /** Email address to forward to (e.g. `example@gmail.com`). */\n forwardTo: string;\n}\n\nexport interface DnsSetEmailForwardingParams {\n domainName: string;\n /** An empty list is allowed and clears the domain's email forwarding. */\n forwards: DnsEmailForwardRecord[];\n}\n\nexport interface DnsSetEmailForwardingResult {\n domain: string;\n isSuccess: boolean;\n}\n\nconst setEmailForwarding = /* @__PURE__ */ defineCommand<\n DnsSetEmailForwardingParams,\n DnsSetEmailForwardingResult\n>({\n name: \"namecheap.domains.dns.setEmailForwarding\",\n parse: (cr) => {\n const result = cr.one(\"DomainEmailForwardingResult\");\n return { domain: result.string(\"Domain\"), isSuccess: result.boolean(\"IsSuccess\") };\n },\n});\n\n// ---------------------------------------------------------------------------\n// namecheap.domains.dns.setHosts\n// ---------------------------------------------------------------------------\n\nexport type DnsRecordType =\n | \"A\"\n | \"AAAA\"\n | \"ALIAS\"\n | \"CAA\"\n | \"CNAME\"\n | \"MX\"\n | \"MXE\"\n | \"NS\"\n | \"TXT\"\n | \"URL\"\n | \"URL301\"\n | \"FRAME\";\n\nexport type DnsEmailType = \"NONE\" | \"MXE\" | \"MX\" | \"FWD\" | \"OX\" | \"GMAIL\";\n\n/** One host record, sent as `HostName<n>`, `RecordType<n>`, `Address<n>`, `MXPref<n>`, `TTL<n>`. */\nexport interface DnsHostRecord {\n /** Sub-domain/hostname for the record. */\n hostName: string;\n recordType: DnsRecordType;\n /** URL or IP address, depending on the record type. */\n address: string;\n /** MX preference (MX records only). Required by the reference, but optional on the wire. */\n mxPref?: number;\n /** Time to live (300-60000). */\n ttl?: number;\n}\n\nexport interface DnsSetHostsParams {\n sld: string;\n tld: string;\n /**\n * Omitted keeps the zone's current mode.\n *\n * @remarks The reference warns that MX records are silently discarded unless the\n * resulting email mode is `MX`. `setHosts` replaces the whole zone, so a call that\n * lists MX hosts under another mode loses the mail routing.\n */\n emailType?: DnsEmailType;\n /** Replaces the whole zone: records not listed are deleted, so at least one is required. */\n hosts: [DnsHostRecord, ...DnsHostRecord[]];\n}\n\nexport interface DnsSetHostsResult {\n domain: string;\n /** Present in recorded responses, not in the reference. */\n emailType?: string;\n isSuccess: boolean;\n}\n\nconst setHosts = /* @__PURE__ */ defineCommand<DnsSetHostsParams, DnsSetHostsResult>({\n name: \"namecheap.domains.dns.setHosts\",\n validate: (params) => {\n if (!params.hosts?.some((host) => host !== undefined && host !== null)) {\n throw new TypeError(\n \"dns.setHosts requires at least one host record: it replaces the whole zone, so an empty list would delete every record\",\n );\n }\n },\n parse: (cr) => {\n const result = cr.one(\"DomainDNSSetHostsResult\");\n return {\n domain: result.string(\"Domain\"),\n ...optionalField(\"emailType\", result.optionalString(\"EmailType\")),\n isSuccess: result.boolean(\"IsSuccess\"),\n };\n },\n});\n\n/**\n * The command table behind `client.dns`. Advanced use only: it is exported for custom\n * integrations and is not covered by semver stability.\n */\nexport const dnsCommands = {\n setDefault,\n setCustom,\n getList,\n getHosts,\n getEmailForwarding,\n setEmailForwarding,\n setHosts,\n};\n\n/**\n * Every command of this group as a standalone export (`<group><Method>`), for\n * tree-shaken use with `run(command, send, params)`; see the README.\n */\nexport {\n setDefault as dnsSetDefault,\n setCustom as dnsSetCustom,\n getList as dnsGetList,\n getHosts as dnsGetHosts,\n getEmailForwarding as dnsGetEmailForwarding,\n setEmailForwarding as dnsSetEmailForwarding,\n setHosts as dnsSetHosts,\n};\n","import type { El } from \"./element\";\n\nexport interface Paging {\n totalItems: number;\n currentPage: number;\n pageSize: number;\n}\n\n/** Reads a `<Paging>` element whose fields are child elements holding plain numbers. */\nexport function parsePaging(el: El): Paging {\n return {\n totalItems: el.one(\"TotalItems\").numberText(),\n currentPage: el.one(\"CurrentPage\").numberText(),\n pageSize: el.one(\"PageSize\").numberText(),\n };\n}\n","import { defineCommand } from \"../core/define\";\nimport type { El } from \"../core/element\";\nimport { optionalField } from \"../core/fields\";\nimport { parsePaging } from \"../core/paging\";\nimport type { Paging } from \"../core/paging\";\n\n// ---------------------------------------------------------------------------\n// namecheap.domains.getList\n// ---------------------------------------------------------------------------\n\nexport type DomainsListType = \"ALL\" | \"EXPIRING\" | \"EXPIRED\";\n\nexport type DomainsSortBy =\n \"NAME\" | \"NAME_DESC\" | \"EXPIREDATE\" | \"EXPIREDATE_DESC\" | \"CREATEDATE\" | \"CREATEDATE_DESC\";\n\nexport interface DomainsGetListParams {\n listType?: DomainsListType;\n /** Keyword to look for in the domain list. */\n searchTerm?: string;\n page?: number;\n /** Min 10, max 100. */\n pageSize?: number;\n sortBy?: DomainsSortBy;\n}\n\nexport interface DomainsListItem {\n id: number;\n name: string;\n user: string;\n created: string;\n expires: string;\n isExpired: boolean;\n isLocked: boolean;\n autoRenew: boolean;\n whoisGuard: string;\n isPremium: boolean;\n isOurDNS: boolean;\n}\n\nexport interface DomainsGetListResult {\n domains: DomainsListItem[];\n paging: Paging;\n}\n\nfunction parseListItem(domain: El): DomainsListItem {\n return {\n id: domain.number(\"ID\"),\n name: domain.string(\"Name\"),\n user: domain.string(\"User\"),\n created: domain.string(\"Created\"),\n expires: domain.string(\"Expires\"),\n isExpired: domain.boolean(\"IsExpired\"),\n isLocked: domain.boolean(\"IsLocked\"),\n autoRenew: domain.boolean(\"AutoRenew\"),\n whoisGuard: domain.string(\"WhoisGuard\"),\n isPremium: domain.boolean(\"IsPremium\"),\n isOurDNS: domain.boolean(\"IsOurDNS\"),\n };\n}\n\nconst getList = /* @__PURE__ */ defineCommand<DomainsGetListParams, DomainsGetListResult>({\n name: \"namecheap.domains.getList\",\n parse: (cr) => ({\n domains: (cr.optional(\"DomainGetListResult\")?.all(\"Domain\") ?? []).map(parseListItem),\n paging: parsePaging(cr.one(\"Paging\")),\n }),\n});\n\n// ---------------------------------------------------------------------------\n// namecheap.domains.check\n// ---------------------------------------------------------------------------\n\nexport interface DomainsCheckParams {\n /** Comma-separated list of domains to check (max 50). */\n domainList: string;\n}\n\nexport interface DomainsCheckItem {\n domain: string;\n available: boolean;\n /** Present in recorded responses, not in the reference. */\n errorNo?: number;\n /** Present in recorded responses, not in the reference. */\n description?: string;\n isPremiumName: boolean;\n premiumRegistrationPrice: number;\n premiumRenewalPrice: number;\n premiumRestorePrice: number;\n premiumTransferPrice: number;\n icannFee: number;\n eapFee: number;\n}\n\nexport type DomainsCheckResult = DomainsCheckItem[];\n\nconst check = /* @__PURE__ */ defineCommand<DomainsCheckParams, DomainsCheckResult>({\n name: \"namecheap.domains.check\",\n parse: (cr) =>\n cr.all(\"DomainCheckResult\").map((item) => ({\n domain: item.string(\"Domain\"),\n available: item.boolean(\"Available\"),\n ...optionalField(\"errorNo\", item.optionalNumber(\"ErrorNo\")),\n ...optionalField(\"description\", item.optionalString(\"Description\")),\n isPremiumName: item.boolean(\"IsPremiumName\"),\n premiumRegistrationPrice: item.number(\"PremiumRegistrationPrice\"),\n premiumRenewalPrice: item.number(\"PremiumRenewalPrice\"),\n premiumRestorePrice: item.number(\"PremiumRestorePrice\"),\n premiumTransferPrice: item.number(\"PremiumTransferPrice\"),\n icannFee: item.number(\"IcannFee\"),\n eapFee: item.number(\"EapFee\"),\n })),\n});\n\n// ---------------------------------------------------------------------------\n// namecheap.domains.getRegistrarLock / setRegistrarLock\n// ---------------------------------------------------------------------------\n\nexport interface DomainsGetRegistrarLockParams {\n domainName: string;\n}\n\nexport interface DomainsGetRegistrarLockResult {\n domain: string;\n registrarLockStatus: boolean;\n}\n\nconst getRegistrarLock = /* @__PURE__ */ defineCommand<\n DomainsGetRegistrarLockParams,\n DomainsGetRegistrarLockResult\n>({\n name: \"namecheap.domains.getRegistrarLock\",\n parse: (cr) => {\n const result = cr.one(\"DomainGetRegistrarLockResult\");\n return {\n domain: result.string(\"Domain\"),\n registrarLockStatus: result.boolean(\"RegistrarLockStatus\"),\n };\n },\n});\n\nexport type DomainsLockAction = \"LOCK\" | \"UNLOCK\";\n\nexport interface DomainsSetRegistrarLockParams {\n domainName: string;\n /** Default: LOCK. */\n lockAction?: DomainsLockAction;\n}\n\nexport interface DomainsSetRegistrarLockResult {\n domain: string;\n isSuccess: boolean;\n}\n\nconst setRegistrarLock = /* @__PURE__ */ defineCommand<\n DomainsSetRegistrarLockParams,\n DomainsSetRegistrarLockResult\n>({\n name: \"namecheap.domains.setRegistrarLock\",\n parse: (cr) => {\n const result = cr.one(\"DomainSetRegistrarLockResult\");\n return { domain: result.string(\"Domain\"), isSuccess: result.boolean(\"IsSuccess\") };\n },\n});\n\n// ---------------------------------------------------------------------------\n// namecheap.domains.reactivate\n// ---------------------------------------------------------------------------\n\n/**\n * @remarks Billed: this command charges your Namecheap account.\n */\nexport interface DomainsReactivateParams {\n domainName: string;\n promotionCode?: string;\n /** Number of years to add after expiry. */\n yearsToAdd?: number;\n isPremiumDomain?: boolean;\n /** Reactivation price for a premium domain. */\n premiumPrice?: number | string;\n}\n\nexport interface DomainsReactivateResult {\n domain: string;\n isSuccess: boolean;\n chargedAmount: number;\n orderID: number;\n transactionID: number;\n}\n\nconst reactivate = /* @__PURE__ */ defineCommand<DomainsReactivateParams, DomainsReactivateResult>({\n name: \"namecheap.domains.reactivate\",\n parse: (cr) => {\n const result = cr.one(\"DomainReactivateResult\");\n return {\n domain: result.string(\"Domain\"),\n isSuccess: result.boolean(\"IsSuccess\"),\n chargedAmount: result.number(\"ChargedAmount\"),\n orderID: result.number(\"OrderID\"),\n transactionID: result.number(\"TransactionID\"),\n };\n },\n});\n\n// ---------------------------------------------------------------------------\n// namecheap.domains.renew\n// ---------------------------------------------------------------------------\n\n/**\n * @remarks Billed: this command charges your Namecheap account.\n */\nexport interface DomainsRenewParams {\n domainName: string;\n years: number;\n promotionCode?: string;\n isPremiumDomain?: boolean;\n /** Renewal price for a premium domain. */\n premiumPrice?: number | string;\n}\n\nexport interface DomainsRenewResult {\n domainName: string;\n domainID: number;\n renew: boolean;\n chargedAmount: number;\n orderID: number;\n transactionID: number;\n domainDetails: {\n /** Date and time as sent by the server, e.g. `12/14/2034 1:01:07 PM`. */\n expiredDate: string;\n numYears: number;\n };\n}\n\nconst renew = /* @__PURE__ */ defineCommand<DomainsRenewParams, DomainsRenewResult>({\n name: \"namecheap.domains.renew\",\n parse: (cr) => {\n const result = cr.one(\"DomainRenewResult\");\n const details = result.one(\"DomainDetails\");\n return {\n domainName: result.string(\"DomainName\"),\n domainID: result.number(\"DomainID\"),\n renew: result.boolean(\"Renew\"),\n chargedAmount: result.number(\"ChargedAmount\"),\n orderID: result.number(\"OrderID\"),\n transactionID: result.number(\"TransactionID\"),\n domainDetails: {\n expiredDate: details.one(\"ExpiredDate\").text(),\n numYears: details.one(\"NumYears\").numberText(),\n },\n };\n },\n});\n\n// ---------------------------------------------------------------------------\n// namecheap.domains.setContacts\n// ---------------------------------------------------------------------------\n\n/**\n * One contact block of a request. Nested under `registrant`, `tech`, `admin` or\n * `auxBilling`, so `registrant.firstName` is sent as `RegistrantFirstName`.\n */\nexport interface DomainsContactParams {\n firstName: string;\n lastName: string;\n address1: string;\n city: string;\n stateProvince: string;\n postalCode: string;\n country: string;\n /** Format +NNN.NNNNNNNNNN. */\n phone: string;\n emailAddress: string;\n organizationName?: string;\n jobTitle?: string;\n address2?: string;\n}\n\nexport interface DomainsSetContactsParams {\n domainName: string;\n registrant: DomainsContactParams;\n tech: DomainsContactParams;\n admin: DomainsContactParams;\n auxBilling: DomainsContactParams;\n}\n\nexport interface DomainsSetContactsResult {\n domain: string;\n isSuccess: boolean;\n}\n\nconst setContacts = /* @__PURE__ */ defineCommand<\n DomainsSetContactsParams,\n DomainsSetContactsResult\n>({\n name: \"namecheap.domains.setContacts\",\n parse: (cr) => {\n const result = cr.one(\"DomainSetContactResult\");\n return { domain: result.string(\"Domain\"), isSuccess: result.boolean(\"IsSuccess\") };\n },\n});\n\n// ---------------------------------------------------------------------------\n// namecheap.domains.create\n// ---------------------------------------------------------------------------\n\n/**\n * @remarks Billed: this command charges your Namecheap account.\n */\nexport interface DomainsCreateParams {\n domainName: string;\n years: number;\n promotionCode?: string;\n registrant: DomainsContactParams;\n tech: DomainsContactParams;\n admin: DomainsContactParams;\n auxBilling: DomainsContactParams;\n /** Comma-separated custom nameservers. */\n nameservers?: string;\n /** Add free domain privacy, `Yes` or `No`. Default: Yes. */\n addFreeWhoisguard?: string;\n /** Enable domain privacy, `Yes` or `No`. Default: No. */\n wgEnabled?: string;\n isPremiumDomain?: boolean;\n /** Registration price for a premium domain. */\n premiumPrice?: number | string;\n /** Purchase fee for a premium domain during EAP. */\n eapFee?: number | string;\n}\n\nexport interface DomainsCreateResult {\n domain: string;\n registered: boolean;\n chargedAmount: number;\n domainID: number;\n orderID: number;\n transactionID: number;\n /** Present in recorded responses, not in the reference's response table. */\n whoisguardEnable?: boolean;\n /** Present in recorded responses, not in the reference's response table. */\n nonRealTimeDomain?: boolean;\n}\n\nconst create = /* @__PURE__ */ defineCommand<DomainsCreateParams, DomainsCreateResult>({\n name: \"namecheap.domains.create\",\n parse: (cr) => {\n const result = cr.one(\"DomainCreateResult\");\n return {\n domain: result.string(\"Domain\"),\n registered: result.boolean(\"Registered\"),\n chargedAmount: result.number(\"ChargedAmount\"),\n domainID: result.number(\"DomainID\"),\n orderID: result.number(\"OrderID\"),\n transactionID: result.number(\"TransactionID\"),\n ...optionalField(\"whoisguardEnable\", result.lenientBoolean(\"WhoisguardEnable\")),\n ...optionalField(\"nonRealTimeDomain\", result.lenientBoolean(\"NonRealTimeDomain\")),\n };\n },\n});\n\n// ---------------------------------------------------------------------------\n// namecheap.domains.getTldList\n// ---------------------------------------------------------------------------\n\nexport interface DomainsTld {\n name: string;\n nonRealTimeDomain: boolean;\n minRegisterYears: number;\n maxRegisterYears: number;\n minRenewYears: number;\n maxRenewYears: number;\n minTransferYears: number;\n maxTransferYears: number;\n isApiRegisterable: boolean;\n isApiRenewable: boolean;\n isApiTransferable: boolean;\n isEppRequired: boolean;\n /** Text content of the `Tld` element, e.g. `.com domain`. */\n description: string;\n}\n\nexport type DomainsGetTldListResult = DomainsTld[];\n\nconst getTldList = /* @__PURE__ */ defineCommand<Record<string, never>, DomainsGetTldListResult>({\n name: \"namecheap.domains.getTldList\",\n parse: (cr) =>\n (cr.optional(\"Tlds\")?.all(\"Tld\") ?? []).map((tld) => ({\n name: tld.string(\"Name\"),\n nonRealTimeDomain: tld.boolean(\"NonRealTimeDomain\"),\n minRegisterYears: tld.number(\"MinRegisterYears\"),\n maxRegisterYears: tld.number(\"MaxRegisterYears\"),\n minRenewYears: tld.number(\"MinRenewYears\"),\n maxRenewYears: tld.number(\"MaxRenewYears\"),\n minTransferYears: tld.number(\"MinTransferYears\"),\n maxTransferYears: tld.number(\"MaxTransferYears\"),\n isApiRegisterable: tld.boolean(\"IsApiRegisterable\"),\n isApiRenewable: tld.boolean(\"IsApiRenewable\"),\n isApiTransferable: tld.boolean(\"IsApiTransferable\"),\n isEppRequired: tld.boolean(\"IsEppRequired\"),\n description: tld.text(),\n })),\n});\n\n// ---------------------------------------------------------------------------\n// namecheap.domains.getContacts\n// ---------------------------------------------------------------------------\n\nexport interface DomainsGetContactsParams {\n domainName: string;\n}\n\n/** A contact as returned by getContacts; the API omits fields it has no value for. */\nexport interface DomainsContact {\n organizationName?: string;\n jobTitle?: string;\n firstName?: string;\n lastName?: string;\n address1?: string;\n address2?: string;\n city?: string;\n stateProvince?: string;\n postalCode?: string;\n country?: string;\n phone?: string;\n emailAddress?: string;\n}\n\nexport interface DomainsGetContactsResult {\n domain: string;\n /** Sent as the lower-case attribute `domainnameid`. */\n domainnameid: number;\n readonly: boolean;\n registrant?: DomainsContact;\n tech?: DomainsContact;\n admin?: DomainsContact;\n auxBilling?: DomainsContact;\n}\n\nfunction parseContact(contact: El): DomainsContact {\n const text = (name: string) => contact.optionalText(name);\n return {\n ...optionalField(\"organizationName\", text(\"OrganizationName\")),\n ...optionalField(\"jobTitle\", text(\"JobTitle\")),\n ...optionalField(\"firstName\", text(\"FirstName\")),\n ...optionalField(\"lastName\", text(\"LastName\")),\n ...optionalField(\"address1\", text(\"Address1\")),\n ...optionalField(\"address2\", text(\"Address2\")),\n ...optionalField(\"city\", text(\"City\")),\n ...optionalField(\"stateProvince\", text(\"StateProvince\")),\n ...optionalField(\"postalCode\", text(\"PostalCode\")),\n ...optionalField(\"country\", text(\"Country\")),\n ...optionalField(\"phone\", text(\"Phone\")),\n ...optionalField(\"emailAddress\", text(\"EmailAddress\")),\n };\n}\n\nconst getContacts = /* @__PURE__ */ defineCommand<\n DomainsGetContactsParams,\n DomainsGetContactsResult\n>({\n name: \"namecheap.domains.getContacts\",\n parse: (cr) => {\n const result = cr.one(\"DomainContactsResult\");\n const contact = (name: string) => {\n const found = result.optional(name);\n return found === undefined ? undefined : parseContact(found);\n };\n return {\n domain: result.string(\"Domain\"),\n domainnameid: result.number(\"domainnameid\"),\n readonly: result.boolean(\"Readonly\"),\n ...optionalField(\"registrant\", contact(\"Registrant\")),\n ...optionalField(\"tech\", contact(\"Tech\")),\n ...optionalField(\"admin\", contact(\"Admin\")),\n ...optionalField(\"auxBilling\", contact(\"AuxBilling\")),\n };\n },\n});\n\n// ---------------------------------------------------------------------------\n// namecheap.domains.getInfo\n// ---------------------------------------------------------------------------\n\nexport interface DomainsGetInfoParams {\n domainName: string;\n /** Hosted domain name for which domain info is requested. */\n hostName?: string;\n}\n\nexport interface DomainsGetInfoResult {\n /** Documented as OK, Locked or Expired; absent from the recorded response. */\n status?: string;\n id: number;\n domainName: string;\n ownerName: string;\n isOwner: boolean;\n isPremium: boolean;\n domainDetails: {\n /** `MM/DD/YYYY`. */\n createdDate?: string;\n /** `MM/DD/YYYY`. */\n expiredDate?: string;\n numYears: number;\n };\n whoisguard: {\n /** `True`, `False` or `NotAlloted`. */\n enabled: string;\n /** 0 means not alloted. */\n id: number;\n expiredDate?: string;\n emailDetails?: {\n whoisGuardEmail: string;\n forwardedTo: string;\n lastAutoEmailChangeDate: string;\n autoEmailChangeFrequencyDays: number;\n };\n };\n premiumDnsSubscription: {\n useAutoRenew: boolean;\n /** -1 means no subscription. */\n subscriptionId: number;\n /** ISO without zone; `0001-01-01T00:00:00` means never. */\n createdDate: string;\n expirationDate: string;\n isActive: boolean;\n };\n dnsDetails: {\n providerType: string;\n isUsingOurDNS: boolean;\n hostCount: number;\n emailType: string;\n dynamicDNSStatus: boolean;\n isFailover: boolean;\n nameservers: string[];\n };\n modificationrights: {\n all?: boolean;\n rights: Array<{ type: string; value: string }>;\n };\n}\n\nfunction parseWhoisguard(whoisguard: El): DomainsGetInfoResult[\"whoisguard\"] {\n const emailDetails = whoisguard.optional(\"EmailDetails\");\n return {\n enabled: whoisguard.string(\"Enabled\"),\n id: whoisguard.one(\"ID\").numberText(),\n ...optionalField(\"expiredDate\", whoisguard.optionalText(\"ExpiredDate\")),\n ...optionalField(\n \"emailDetails\",\n emailDetails === undefined\n ? undefined\n : {\n whoisGuardEmail: emailDetails.string(\"WhoisGuardEmail\"),\n forwardedTo: emailDetails.string(\"ForwardedTo\"),\n lastAutoEmailChangeDate: emailDetails.string(\"LastAutoEmailChangeDate\"),\n autoEmailChangeFrequencyDays: emailDetails.number(\"AutoEmailChangeFrequencyDays\"),\n },\n ),\n };\n}\n\nconst getInfo = /* @__PURE__ */ defineCommand<DomainsGetInfoParams, DomainsGetInfoResult>({\n name: \"namecheap.domains.getInfo\",\n parse: (cr) => {\n const result = cr.one(\"DomainGetInfoResult\");\n const details = result.one(\"DomainDetails\");\n const premiumDns = result.one(\"PremiumDnsSubscription\");\n const dns = result.one(\"DnsDetails\");\n const rights = result.one(\"Modificationrights\");\n return {\n ...optionalField(\"status\", result.optionalString(\"Status\")),\n id: result.number(\"ID\"),\n domainName: result.string(\"DomainName\"),\n ownerName: result.string(\"OwnerName\"),\n isOwner: result.boolean(\"IsOwner\"),\n isPremium: result.boolean(\"IsPremium\"),\n domainDetails: {\n ...optionalField(\"createdDate\", details.optionalText(\"CreatedDate\")),\n ...optionalField(\"expiredDate\", details.optionalText(\"ExpiredDate\")),\n numYears: details.one(\"NumYears\").numberText(),\n },\n whoisguard: parseWhoisguard(result.one(\"Whoisguard\")),\n premiumDnsSubscription: {\n useAutoRenew: premiumDns.one(\"UseAutoRenew\").booleanText(),\n subscriptionId: premiumDns.one(\"SubscriptionId\").numberText(),\n createdDate: premiumDns.one(\"CreatedDate\").text(),\n expirationDate: premiumDns.one(\"ExpirationDate\").text(),\n isActive: premiumDns.one(\"IsActive\").booleanText(),\n },\n dnsDetails: {\n providerType: dns.string(\"ProviderType\"),\n isUsingOurDNS: dns.boolean(\"IsUsingOurDNS\"),\n hostCount: dns.number(\"HostCount\"),\n emailType: dns.string(\"EmailType\"),\n dynamicDNSStatus: dns.boolean(\"DynamicDNSStatus\"),\n isFailover: dns.boolean(\"IsFailover\"),\n nameservers: dns.all(\"Nameserver\").map((nameserver) => nameserver.text()),\n },\n modificationrights: {\n ...optionalField(\"all\", rights.optionalBoolean(\"All\")),\n rights: rights.all(\"Rights\").map((right) => ({\n type: right.string(\"Type\"),\n value: right.text(),\n })),\n },\n };\n },\n});\n\n/**\n * The command table behind `client.domains`. Advanced use only: it is exported for custom\n * integrations and is not covered by semver stability.\n */\nexport const domainsCommands = {\n getList,\n check,\n getRegistrarLock,\n setRegistrarLock,\n reactivate,\n renew,\n setContacts,\n create,\n getTldList,\n getContacts,\n getInfo,\n};\n\n/**\n * Every command of this group as a standalone export (`<group><Method>`), for\n * tree-shaken use with `run(command, send, params)`; see the README.\n */\nexport {\n getList as domainsGetList,\n check as domainsCheck,\n getRegistrarLock as domainsGetRegistrarLock,\n setRegistrarLock as domainsSetRegistrarLock,\n reactivate as domainsReactivate,\n renew as domainsRenew,\n setContacts as domainsSetContacts,\n create as domainsCreate,\n getTldList as domainsGetTldList,\n getContacts as domainsGetContacts,\n getInfo as domainsGetInfo,\n};\n","import { defineCommand } from \"../core/define\";\nimport { optionalField } from \"../core/fields\";\n\n// ---------------------------------------------------------------------------\n// namecheap.domains.ns.create\n// ---------------------------------------------------------------------------\n\nexport interface NsCreateParams {\n /** SLD of the domain name. */\n sld: string;\n /** TLD of the domain name. */\n tld: string;\n /** Nameserver to create. */\n nameserver: string;\n /** Nameserver IP address. */\n ip: string;\n}\n\nexport interface NsCreateResult {\n domain: string;\n nameserver: string;\n ip: string;\n isSuccess: boolean;\n}\n\nconst create = /* @__PURE__ */ defineCommand<NsCreateParams, NsCreateResult>({\n name: \"namecheap.domains.ns.create\",\n parse: (cr) => {\n const result = cr.one(\"DomainNSCreateResult\");\n return {\n domain: result.string(\"Domain\"),\n nameserver: result.string(\"Nameserver\"),\n ip: result.string(\"IP\"),\n isSuccess: result.boolean(\"IsSuccess\"),\n };\n },\n});\n\n// ---------------------------------------------------------------------------\n// namecheap.domains.ns.delete\n// ---------------------------------------------------------------------------\n\nexport interface NsDeleteParams {\n sld: string;\n tld: string;\n /** Nameserver to delete. */\n nameserver: string;\n}\n\nexport interface NsDeleteResult {\n domain: string;\n nameserver: string;\n isSuccess: boolean;\n}\n\n// No `validate`: this removes exactly the one named nameserver (targeted delete,\n// not replace-all), and all three params are required by the type.\nconst deleteNs = /* @__PURE__ */ defineCommand<NsDeleteParams, NsDeleteResult>({\n name: \"namecheap.domains.ns.delete\",\n parse: (cr) => {\n const result = cr.one(\"DomainNSDeleteResult\");\n return {\n domain: result.string(\"Domain\"),\n nameserver: result.string(\"Nameserver\"),\n isSuccess: result.boolean(\"IsSuccess\"),\n };\n },\n});\n\n// ---------------------------------------------------------------------------\n// namecheap.domains.ns.getInfo\n// ---------------------------------------------------------------------------\n\nexport interface NsGetInfoParams {\n sld: string;\n tld: string;\n /** Nameserver to get info for. */\n nameserver: string;\n}\n\nexport interface NsGetInfoResult {\n domain: string;\n nameserver: string;\n ip: string;\n /** Present in recorded responses, not in the reference. */\n nameserverStatuses?: string[];\n}\n\nconst getInfo = /* @__PURE__ */ defineCommand<NsGetInfoParams, NsGetInfoResult>({\n name: \"namecheap.domains.ns.getInfo\",\n parse: (cr) => {\n const result = cr.one(\"DomainNSInfoResult\");\n const statuses = result.optional(\"NameserverStatuses\");\n return {\n domain: result.string(\"Domain\"),\n nameserver: result.string(\"Nameserver\"),\n ip: result.string(\"IP\"),\n ...optionalField(\n \"nameserverStatuses\",\n statuses?.all(\"Status\").map((status) => status.text()),\n ),\n };\n },\n});\n\n// ---------------------------------------------------------------------------\n// namecheap.domains.ns.update\n// ---------------------------------------------------------------------------\n\nexport interface NsUpdateParams {\n sld: string;\n tld: string;\n /** Nameserver to update. */\n nameserver: string;\n /** Existing IP address. */\n oldIP: string;\n /** New IP address. */\n ip: string;\n}\n\nexport interface NsUpdateResult {\n domain: string;\n nameserver: string;\n isSuccess: boolean;\n}\n\nconst update = /* @__PURE__ */ defineCommand<NsUpdateParams, NsUpdateResult>({\n name: \"namecheap.domains.ns.update\",\n parse: (cr) => {\n const result = cr.one(\"DomainNSUpdateResult\");\n return {\n domain: result.string(\"Domain\"),\n nameserver: result.string(\"Nameserver\"),\n isSuccess: result.boolean(\"IsSuccess\"),\n };\n },\n});\n\n/**\n * The command table behind `client.ns`. Advanced use only: it is exported for custom\n * integrations and is not covered by semver stability.\n */\nexport const nsCommands = { create, delete: deleteNs, getInfo, update };\n\n/**\n * Every command of this group as a standalone export (`<group><Method>`), for\n * tree-shaken use with `run(command, send, params)`; see the README.\n */\nexport { create as nsCreate, deleteNs as nsDelete, getInfo as nsGetInfo, update as nsUpdate };\n","import { defineCommand } from \"../core/define\";\nimport type { El } from \"../core/element\";\nimport { firstLenientNumber, optionalField } from \"../core/fields\";\nimport { parsePaging } from \"../core/paging\";\nimport type { Paging } from \"../core/paging\";\n\n// ---------------------------------------------------------------------------\n// namecheap.ssl.create\n// ---------------------------------------------------------------------------\n\n/**\n * @remarks Billed: this command charges your Namecheap account.\n */\nexport interface SslCreateParams {\n /** Number of years for the certificate. Allowed values: 1 to 5. */\n years: number;\n /** SSL product name. */\n type: string;\n /** Number of add-on domains for multi-domain certificates. Sent as `SANStoADD`. */\n sansToAdd?: number;\n promotionCode?: string;\n}\n\n/** Every field is optional: the response shape of this billed command is not documented. */\nexport interface SslCreateResult {\n isSuccess?: boolean;\n orderID?: number;\n transactionID?: number;\n chargedAmount?: number;\n certificateID?: number;\n created?: string;\n sslType?: string;\n status?: string;\n}\n\nconst create = /* @__PURE__ */ defineCommand<SslCreateParams, SslCreateResult>({\n name: \"namecheap.ssl.create\",\n keys: { sansToAdd: \"SANStoADD\" },\n parse: (cr) => {\n const wrapper = cr.optional(\"SSLCreateResult\") ?? cr.children()[0];\n if (wrapper === undefined) return {};\n const nested = wrapper.optional(\"SSLCertificate\");\n const sources = nested === undefined ? [wrapper] : [wrapper, nested];\n const pick = <T>(read: (el: El) => T | undefined): T | undefined =>\n sources.map(read).find((value) => value !== undefined);\n return {\n ...optionalField(\"isSuccess\", wrapper.lenientBoolean(\"IsSuccess\")),\n ...optionalField(\"orderID\", firstLenientNumber(wrapper, \"OrderID\", \"OrderId\")),\n ...optionalField(\n \"transactionID\",\n firstLenientNumber(wrapper, \"TransactionID\", \"TransactionId\"),\n ),\n ...optionalField(\"chargedAmount\", wrapper.lenientNumber(\"ChargedAmount\")),\n ...optionalField(\n \"certificateID\",\n pick((el) => el.lenientNumber(\"CertificateID\")),\n ),\n ...optionalField(\n \"created\",\n pick((el) => el.optionalString(\"Created\")),\n ),\n ...optionalField(\n \"sslType\",\n pick((el) => el.optionalString(\"SSLType\")),\n ),\n ...optionalField(\n \"status\",\n pick((el) => el.optionalString(\"Status\")),\n ),\n };\n },\n});\n\n// ---------------------------------------------------------------------------\n// namecheap.ssl.getList\n// ---------------------------------------------------------------------------\n\nexport type SslListType =\n | \"ALL\"\n | \"Processing\"\n | \"EmailSent\"\n | \"TechnicalProblem\"\n | \"InProgress\"\n | \"Completed\"\n | \"Deactivated\"\n | \"Active\"\n | \"Cancelled\"\n | \"NewPurchase\"\n | \"NewRenewal\";\n\nexport type SslSortBy =\n | \"PURCHASEDATE\"\n | \"PURCHASEDATE_DESC\"\n | \"SSLTYPE\"\n | \"SSLTYPE_DESC\"\n | \"EXPIREDATETIME\"\n | \"EXPIREDATETIME_DESC\"\n | \"Host_Name\"\n | \"Host_Name_DESC\";\n\nexport interface SslGetListParams {\n /** Default: ALL. */\n listType?: SslListType;\n /** Keyword to look for. */\n searchTerm?: string;\n page?: number;\n /** Min 10, max 100. Default: 20. */\n pageSize?: number;\n sortBy?: SslSortBy;\n}\n\nexport interface SslListItem {\n certificateID: number;\n hostName: string;\n sslType: string;\n purchaseDate: string;\n expireDate: string;\n /** Present in the fixtures but not in the reference table. */\n status?: string;\n}\n\nexport interface SslGetListResult {\n certificates: SslListItem[];\n paging: Paging;\n}\n\nfunction parseListItem(ssl: El): SslListItem {\n return {\n certificateID: ssl.number(\"CertificateID\"),\n hostName: ssl.string(\"HostName\"),\n sslType: ssl.string(\"SSLType\"),\n purchaseDate: ssl.string(\"PurchaseDate\"),\n expireDate: ssl.string(\"ExpireDate\"),\n ...optionalField(\"status\", ssl.optionalString(\"Status\")),\n };\n}\n\nconst getList = /* @__PURE__ */ defineCommand<SslGetListParams, SslGetListResult>({\n name: \"namecheap.ssl.getList\",\n parse: (cr) => ({\n certificates: (cr.optional(\"SSLListResult\")?.all(\"SSL\") ?? []).map(parseListItem),\n paging: parsePaging(cr.one(\"Paging\")),\n }),\n});\n\n// ---------------------------------------------------------------------------\n// namecheap.ssl.parseCSR\n// ---------------------------------------------------------------------------\n\nexport interface SslParseCsrParams {\n /** Certificate Signing Request (PEM text). Sent as the lowercase `csr`. */\n csr: string;\n certificateType?: string;\n}\n\nexport interface SslParseCsrResult {\n commonName: string;\n domainName: string;\n country: string;\n organisationUnit: string;\n organisation: string;\n state: string;\n locality: string;\n email: string;\n}\n\nconst parseCSR = /* @__PURE__ */ defineCommand<SslParseCsrParams, SslParseCsrResult>({\n name: \"namecheap.ssl.parseCSR\",\n keys: { csr: \"csr\" },\n parse: (cr) => {\n const details = cr.one(\"SSLParseCSRResult\").one(\"CSRDetails\");\n return {\n commonName: details.one(\"CommonName\").text(),\n domainName: details.one(\"DomainName\").text(),\n country: details.one(\"Country\").text(),\n organisationUnit: details.one(\"OrganisationUnit\").text(),\n organisation: details.one(\"Organisation\").text(),\n state: details.one(\"State\").text(),\n locality: details.one(\"Locality\").text(),\n email: details.one(\"Email\").text(),\n };\n },\n});\n\n// ---------------------------------------------------------------------------\n// namecheap.ssl.getApproverEmailList\n// ---------------------------------------------------------------------------\n\nexport interface SslGetApproverEmailListParams {\n domainName: string;\n certificateType: string;\n}\n\nexport interface SslGetApproverEmailListResult {\n /** Domain WHOIS email addresses (`Domainemails`). */\n domainEmails: string[];\n /** Generic email addresses for the domain (`Genericemails`). */\n genericEmails: string[];\n /** Additional emails from the provider (`Manualemails`). */\n manualEmails: string[];\n}\n\nfunction emails(result: El, group: string): string[] {\n return (result.optional(group)?.all(\"email\") ?? []).map((email) => email.text());\n}\n\nconst getApproverEmailList = /* @__PURE__ */ defineCommand<\n SslGetApproverEmailListParams,\n SslGetApproverEmailListResult\n>({\n name: \"namecheap.ssl.getApproverEmailList\",\n parse: (cr) => {\n const result = cr.one(\"GetApproverEmailListResult\");\n return {\n domainEmails: emails(result, \"Domainemails\"),\n genericEmails: emails(result, \"Genericemails\"),\n manualEmails: emails(result, \"Manualemails\"),\n };\n },\n});\n\n// ---------------------------------------------------------------------------\n// Shared: HTTP DCV block and the { id, isSuccess } result\n// ---------------------------------------------------------------------------\n\nexport interface SslHttpDcValidation {\n /** True when HTTP_CSR_HASH was set for at least one domain. */\n valueAvailable: boolean;\n fileName?: string;\n fileContent?: string;\n}\n\nfunction parseHttpDcValidation(result: El): SslHttpDcValidation | undefined {\n const validation = result.optional(\"HttpDCValidation\");\n if (validation === undefined) return undefined;\n return {\n valueAvailable: validation.boolean(\"ValueAvailable\"),\n ...optionalField(\"fileName\", validation.optionalText(\"FileName\")),\n ...optionalField(\"fileContent\", validation.optionalText(\"FileContent\")),\n };\n}\n\n// ---------------------------------------------------------------------------\n// namecheap.ssl.activate\n// ---------------------------------------------------------------------------\n\nexport interface SslActivateParams {\n certificateID: number;\n /** Certificate Signing Request (PEM text, may span several lines). */\n csr: string;\n /** Email to send the signed certificate file to. */\n adminEmailAddress: string;\n /** Server software type, e.g. `apacheopenssl`, `nginx`, `iis`. */\n webServerType?: string;\n uniqueValue?: string;\n}\n\nexport interface SslActivateResult {\n id: number;\n isSuccess: boolean;\n /** Present when the response carries an HTTP DCV block. */\n httpDCValidation?: SslHttpDcValidation;\n}\n\nfunction parseActivation(result: El): SslActivateResult {\n return {\n id: result.number(\"ID\"),\n isSuccess: result.boolean(\"IsSuccess\"),\n ...optionalField(\"httpDCValidation\", parseHttpDcValidation(result)),\n };\n}\n\nconst activate = /* @__PURE__ */ defineCommand<SslActivateParams, SslActivateResult>({\n name: \"namecheap.ssl.activate\",\n parse: (cr) => parseActivation(cr.one(\"SSLActivateResult\")),\n});\n\n// ---------------------------------------------------------------------------\n// namecheap.ssl.resendApproverEmail\n// ---------------------------------------------------------------------------\n\nexport interface SslResendApproverEmailParams {\n certificateID: number;\n}\n\n/** The `{ id, isSuccess }` result shared by the two resend commands. */\nexport interface SslResendResult {\n id: number;\n isSuccess: boolean;\n}\n\nfunction parseResend(result: El): SslResendResult {\n return { id: result.number(\"ID\"), isSuccess: result.boolean(\"IsSuccess\") };\n}\n\nexport type SslResendApproverEmailResult = SslResendResult;\n\nconst resendApproverEmail = /* @__PURE__ */ defineCommand<\n SslResendApproverEmailParams,\n SslResendApproverEmailResult\n>({\n name: \"namecheap.ssl.resendApproverEmail\",\n parse: (cr) => parseResend(cr.one(\"SSLResendApproverEmailResult\")),\n});\n\n// ---------------------------------------------------------------------------\n// namecheap.ssl.reissue\n// ---------------------------------------------------------------------------\n\nexport interface SslReissueParams {\n certificateID: number;\n /** Certificate Signing Request (PEM text, may span several lines). */\n csr: string;\n /** Cannot be changed from the initial activation. */\n adminEmailAddress?: string;\n webServerType?: string;\n uniqueValue?: string;\n}\n\nexport type SslReissueResult = SslActivateResult;\n\nconst reissue = /* @__PURE__ */ defineCommand<SslReissueParams, SslReissueResult>({\n name: \"namecheap.ssl.reissue\",\n parse: (cr) => parseActivation(cr.one(\"SSLReissueResult\")),\n});\n\n// ---------------------------------------------------------------------------\n// namecheap.ssl.resendfulfillmentemail\n// ---------------------------------------------------------------------------\n\nexport interface SslResendFulfillmentEmailParams {\n certificateID: number;\n}\n\nexport type SslResendFulfillmentEmailResult = SslResendResult;\n\nconst resendFulfillmentEmail = /* @__PURE__ */ defineCommand<\n SslResendFulfillmentEmailParams,\n SslResendFulfillmentEmailResult\n>({\n name: \"namecheap.ssl.resendfulfillmentemail\",\n parse: (cr) => parseResend(cr.one(\"SSLResendFulfillmentEmailResult\")),\n});\n\n// ---------------------------------------------------------------------------\n// namecheap.ssl.editDCVMethod\n// ---------------------------------------------------------------------------\n\n/** Either one `dcvMethod` for the whole certificate, or `dnsNames` plus `dcvMethods` per domain. */\nexport type SslEditDcvMethodParams =\n | {\n certificateID: number;\n /** DCV method used to validate domain control. */\n dcvMethod: string;\n }\n | {\n certificateID: number;\n /** Comma-separated list of domain names. */\n dnsNames: string;\n /** Comma-separated list of DCV methods, one per domain name. */\n dcvMethods: string;\n };\n\nexport type SslEditDcvMethodResult = SslActivateResult;\n\nconst editDCVMethod = /* @__PURE__ */ defineCommand<SslEditDcvMethodParams, SslEditDcvMethodResult>(\n {\n name: \"namecheap.ssl.editDCVMethod\",\n parse: (cr) => parseActivation(cr.one(\"SSLEditDCVMethodResult\")),\n },\n);\n\n// ---------------------------------------------------------------------------\n// namecheap.ssl.getInfo\n// ---------------------------------------------------------------------------\n\nexport type SslReturnType = \"Individual\" | \"PKCS7\";\n\nexport interface SslGetInfoParams {\n certificateID: number;\n /**\n * Flag for returning the certificate in the response. Sent as `Returncertificate`.\n *\n * @remarks The response shape for the certificate body is undocumented, so 1.0 does\n * not parse it: the result never contains the certificate.\n */\n returnCertificate?: string;\n /** Format of the returned certificate. Sent as `Returntype`. */\n returnType?: SslReturnType;\n}\n\nexport interface SslGetInfoResult {\n certificateID: number;\n /** For example `Active`, `Newpurchase`, `Purchased`, `Cancelled`. */\n status: string;\n /** The attributes below are in the fixture but not in the reference. */\n type?: string;\n commonName?: string;\n provider?: string;\n issuedOn?: string;\n expires?: string;\n}\n\nconst getInfo = /* @__PURE__ */ defineCommand<SslGetInfoParams, SslGetInfoResult>({\n name: \"namecheap.ssl.getInfo\",\n keys: { returnCertificate: \"Returncertificate\", returnType: \"Returntype\" },\n parse: (cr) => {\n const result = cr.one(\"SSLGetInfoResult\");\n return {\n certificateID: result.number(\"CertificateID\"),\n status: result.string(\"Status\"),\n ...optionalField(\"type\", result.optionalString(\"Type\")),\n ...optionalField(\"commonName\", result.optionalString(\"CommonName\")),\n ...optionalField(\"provider\", result.optionalString(\"Provider\")),\n ...optionalField(\"issuedOn\", result.optionalString(\"IssuedOn\")),\n ...optionalField(\"expires\", result.optionalString(\"Expires\")),\n };\n },\n});\n\n// ---------------------------------------------------------------------------\n// namecheap.ssl.renew\n// ---------------------------------------------------------------------------\n\n/**\n * @remarks Billed: this command charges your Namecheap account.\n */\nexport interface SslRenewParams {\n certificateID: number;\n /** Allowed values: 1 to 5. */\n years: number;\n /** SSL product name. */\n sslType: string;\n promotionCode?: string;\n}\n\n/** Every field is optional: the response shape of this billed command is not documented. */\nexport interface SslRenewResult {\n certificateID?: number;\n years?: number;\n orderID?: number;\n transactionID?: number;\n chargedAmount?: number;\n}\n\nconst renew = /* @__PURE__ */ defineCommand<SslRenewParams, SslRenewResult>({\n name: \"namecheap.ssl.renew\",\n parse: (cr) => {\n const result = cr.optional(\"SSLRenewResult\") ?? cr.children()[0];\n if (result === undefined) return {};\n return {\n ...optionalField(\"certificateID\", result.lenientNumber(\"CertificateID\")),\n ...optionalField(\"years\", result.lenientNumber(\"Years\")),\n ...optionalField(\"orderID\", firstLenientNumber(result, \"OrderID\", \"OrderId\")),\n ...optionalField(\n \"transactionID\",\n firstLenientNumber(result, \"TransactionID\", \"TransactionId\"),\n ),\n ...optionalField(\"chargedAmount\", result.lenientNumber(\"ChargedAmount\")),\n };\n },\n});\n\n// ---------------------------------------------------------------------------\n// namecheap.ssl.purchasemoresans\n// ---------------------------------------------------------------------------\n\n/**\n * @remarks Billed: this command charges your Namecheap account.\n */\nexport interface SslPurchaseMoreSansParams {\n certificateID: number;\n /** Number of add-on domains to order. Sent as `NumberOfSANSToAdd`. */\n numberOfSansToAdd: number;\n}\n\n/** Every field is optional: the response shape of this billed command is not documented. */\nexport interface SslPurchaseMoreSansResult {\n isSuccess?: boolean;\n orderID?: number;\n transactionID?: number;\n chargedAmount?: number;\n certificateID?: number;\n sslType?: string;\n /** Number of add-on domains (`SANSCount`). */\n sansCount?: number;\n}\n\nconst purchaseMoreSans = /* @__PURE__ */ defineCommand<\n SslPurchaseMoreSansParams,\n SslPurchaseMoreSansResult\n>({\n name: \"namecheap.ssl.purchasemoresans\",\n keys: { numberOfSansToAdd: \"NumberOfSANSToAdd\" },\n parse: (cr) => {\n const result = cr.optional(\"SSLPurchaseMoreSansResult\") ?? cr.children()[0];\n if (result === undefined) return {};\n return {\n ...optionalField(\"isSuccess\", result.lenientBoolean(\"IsSuccess\")),\n ...optionalField(\"orderID\", firstLenientNumber(result, \"OrderID\", \"OrderId\")),\n ...optionalField(\n \"transactionID\",\n firstLenientNumber(result, \"TransactionID\", \"TransactionId\"),\n ),\n ...optionalField(\"chargedAmount\", result.lenientNumber(\"ChargedAmount\")),\n ...optionalField(\"certificateID\", result.lenientNumber(\"CertificateID\")),\n ...optionalField(\"sslType\", result.optionalString(\"SSLType\")),\n ...optionalField(\"sansCount\", result.lenientNumber(\"SANSCount\")),\n };\n },\n});\n\n// ---------------------------------------------------------------------------\n// namecheap.ssl.revokecertificate\n// ---------------------------------------------------------------------------\n\n/**\n * @remarks Irreversible: a revoked certificate cannot be restored.\n */\nexport interface SslRevokeCertificateParams {\n certificateID: number;\n certificateType: string;\n}\n\nexport interface SslRevokeCertificateResult {\n isSuccess: boolean;\n certificateID: number;\n}\n\nconst revokeCertificate = /* @__PURE__ */ defineCommand<\n SslRevokeCertificateParams,\n SslRevokeCertificateResult\n>({\n name: \"namecheap.ssl.revokecertificate\",\n parse: (cr) => {\n const result = cr.one(\"SSLRevokeCertificateResult\");\n return {\n isSuccess: result.boolean(\"IsSuccess\"),\n certificateID: result.number(\"CertificateID\"),\n };\n },\n});\n\n/**\n * The command table behind `client.ssl`. Advanced use only: it is exported for custom\n * integrations and is not covered by semver stability.\n */\nexport const sslCommands = {\n create,\n getList,\n parseCSR,\n getApproverEmailList,\n activate,\n resendApproverEmail,\n reissue,\n resendFulfillmentEmail,\n editDCVMethod,\n getInfo,\n renew,\n purchaseMoreSans,\n revokeCertificate,\n};\n\n/**\n * Every command of this group as a standalone export (`<group><Method>`), for\n * tree-shaken use with `run(command, send, params)`; see the README.\n */\nexport {\n create as sslCreate,\n getList as sslGetList,\n parseCSR as sslParseCSR,\n getApproverEmailList as sslGetApproverEmailList,\n activate as sslActivate,\n resendApproverEmail as sslResendApproverEmail,\n reissue as sslReissue,\n resendFulfillmentEmail as sslResendFulfillmentEmail,\n editDCVMethod as sslEditDCVMethod,\n getInfo as sslGetInfo,\n renew as sslRenew,\n purchaseMoreSans as sslPurchaseMoreSans,\n revokeCertificate as sslRevokeCertificate,\n};\n","import { defineCommand } from \"../core/define\";\nimport type { El } from \"../core/element\";\nimport { parsePaging } from \"../core/paging\";\nimport type { Paging } from \"../core/paging\";\n\n// ---------------------------------------------------------------------------\n// namecheap.domains.transfer.create\n// ---------------------------------------------------------------------------\n\n/**\n * @remarks Billed: this command charges your Namecheap account.\n */\nexport interface TransferCreateParams {\n /** Domain name to transfer. */\n domainName: string;\n /** Should be set to 1 year only. */\n years: number;\n /** EPP (authorization) code, required for most TLDs. */\n eppCode: string;\n promotionCode?: string;\n /** Add free domain privacy, `Yes` or `No`. Default: Yes. */\n addFreeWhoisguard?: string;\n /** Enable domain privacy, `Yes` or `No`. Default: No. Sent as `WGenable`. */\n wgEnable?: string;\n}\n\nexport interface TransferCreateResult {\n domainName: string;\n transferID: number;\n statusID: number;\n orderID: number;\n transactionID: number;\n chargedAmount: number;\n}\n\nconst create = /* @__PURE__ */ defineCommand<TransferCreateParams, TransferCreateResult>({\n name: \"namecheap.domains.transfer.create\",\n keys: { wgEnable: \"WGenable\" },\n parse: (cr) => {\n const result = cr.one(\"DomainTransferCreateResult\");\n return {\n domainName: result.string(\"DomainName\"),\n transferID: result.number(\"TransferID\"),\n statusID: result.number(\"StatusID\"),\n orderID: result.number(\"OrderID\"),\n transactionID: result.number(\"TransactionID\"),\n chargedAmount: result.number(\"ChargedAmount\"),\n };\n },\n});\n\n// ---------------------------------------------------------------------------\n// namecheap.domains.transfer.getStatus\n// ---------------------------------------------------------------------------\n\nexport interface TransferGetStatusParams {\n transferID: number;\n}\n\nexport interface TransferGetStatusResult {\n transferID: number;\n statusID: number;\n status: string;\n}\n\nconst getStatus = /* @__PURE__ */ defineCommand<TransferGetStatusParams, TransferGetStatusResult>({\n name: \"namecheap.domains.transfer.getStatus\",\n parse: (cr) => {\n const result = cr.one(\"DomainTransferGetStatusResult\");\n return {\n transferID: result.number(\"TransferID\"),\n statusID: result.number(\"StatusID\"),\n status: result.string(\"Status\"),\n };\n },\n});\n\n// ---------------------------------------------------------------------------\n// namecheap.domains.transfer.updateStatus\n// ---------------------------------------------------------------------------\n\nexport interface TransferUpdateStatusParams {\n transferID: number;\n /** `true` resubmits the transfer. */\n resubmit: boolean;\n}\n\nexport interface TransferUpdateStatusResult {\n transferID: number;\n resubmit: boolean;\n}\n\nconst updateStatus = /* @__PURE__ */ defineCommand<\n TransferUpdateStatusParams,\n TransferUpdateStatusResult\n>({\n name: \"namecheap.domains.transfer.updateStatus\",\n parse: (cr) => {\n const result = cr.one(\"DomainTransferUpdateStatusResult\");\n return {\n transferID: result.number(\"TransferID\"),\n resubmit: result.boolean(\"Resubmit\"),\n };\n },\n});\n\n// ---------------------------------------------------------------------------\n// namecheap.domains.transfer.getList\n// ---------------------------------------------------------------------------\n\nexport type TransferListType = \"ALL\" | \"INPROGRESS\" | \"CANCELLED\" | \"COMPLETED\";\n\nexport type TransferSortBy =\n | \"DOMAINNAME\"\n | \"DOMAINNAME_DESC\"\n | \"TRANSFERDATE\"\n | \"TRANSFERDATE_DESC\"\n | \"STATUSDATE\"\n | \"STATUSDATE_DESC\";\n\nexport interface TransferGetListParams {\n /** Default: ALL. */\n listType?: TransferListType;\n /** Keyword (domain name) to search. */\n searchTerm?: string;\n page?: number;\n /** Min 10, max 100. */\n pageSize?: number;\n sortBy?: TransferSortBy;\n}\n\nexport interface TransferListItem {\n transferID: number;\n /** The reference spells this column `Domainname`; the fixture uses `DomainName`. */\n domainName: string;\n user: string;\n transferDate: string;\n orderID: number;\n statusID: number;\n status: string;\n}\n\nexport interface TransferGetListResult {\n transfers: TransferListItem[];\n paging: Paging;\n}\n\nfunction parseListItem(transfer: El): TransferListItem {\n return {\n transferID: transfer.number(\"TransferID\"),\n domainName: transfer.string(\"DomainName\"),\n user: transfer.string(\"User\"),\n transferDate: transfer.string(\"TransferDate\"),\n orderID: transfer.number(\"OrderID\"),\n statusID: transfer.number(\"StatusID\"),\n status: transfer.string(\"Status\"),\n };\n}\n\nconst getList = /* @__PURE__ */ defineCommand<TransferGetListParams, TransferGetListResult>({\n name: \"namecheap.domains.transfer.getList\",\n parse: (cr) => ({\n transfers: (cr.optional(\"TransferGetListResult\")?.all(\"Transfer\") ?? []).map(parseListItem),\n paging: parsePaging(cr.one(\"Paging\")),\n }),\n});\n\n/**\n * The command table behind `client.transfer`. Advanced use only: it is exported for custom\n * integrations and is not covered by semver stability.\n */\nexport const transferCommands = { create, getStatus, updateStatus, getList };\n\n/**\n * Every command of this group as a standalone export (`<group><Method>`), for\n * tree-shaken use with `run(command, send, params)`; see the README.\n */\nexport {\n create as transferCreate,\n getStatus as transferGetStatus,\n updateStatus as transferUpdateStatus,\n getList as transferGetList,\n};\n","import { defineCommand } from \"../core/define\";\nimport { optionalField } from \"../core/fields\";\n\n// Money values are returned as the strings the API sends: the reference does not\n// type them numeric and a fixture carries an empty price.\n\n// ---------------------------------------------------------------------------\n// namecheap.users.getBalances\n// ---------------------------------------------------------------------------\n\nexport interface UsersGetBalancesResult {\n currency: string;\n availableBalance: string;\n accountBalance: string;\n earnedAmount: string;\n withdrawableAmount: string;\n fundsRequiredForAutoRenew: string;\n}\n\nconst getBalances = /* @__PURE__ */ defineCommand<Record<string, never>, UsersGetBalancesResult>({\n name: \"namecheap.users.getBalances\",\n parse: (cr) => {\n const result = cr.one(\"UserGetBalancesResult\");\n return {\n currency: result.string(\"Currency\"),\n availableBalance: result.string(\"AvailableBalance\"),\n accountBalance: result.string(\"AccountBalance\"),\n earnedAmount: result.string(\"EarnedAmount\"),\n withdrawableAmount: result.string(\"WithdrawableAmount\"),\n fundsRequiredForAutoRenew: result.string(\"FundsRequiredForAutoRenew\"),\n };\n },\n});\n\n// ---------------------------------------------------------------------------\n// namecheap.users.getPricing\n// ---------------------------------------------------------------------------\n\nexport interface UsersGetPricingParams {\n /** Product type, e.g. `DOMAIN` or `SSLCERTIFICATE` (the reference gives examples, not a closed set). */\n productType: string;\n productCategory?: string;\n promotionCode?: string;\n /** Action, e.g. `REGISTER`, `RENEW` or `TRANSFER` (examples, not a closed set). */\n actionName?: string;\n productName?: string;\n}\n\nexport interface PricingPrice {\n duration: number;\n durationType: string;\n /** Final price. May be an empty string. */\n price: string;\n regularPrice: string;\n yourPrice: string;\n currency: string;\n /** Present in the fixture but not in the reference table. */\n pricingType?: string;\n /** Present in the fixture but not in the reference table. */\n regularPriceType?: string;\n /** Present in the fixture but not in the reference table. */\n yourPriceType?: string;\n /** Documented; present only when a promotion applies to the tier. */\n promotionPrice?: string;\n}\n\nexport interface PricingProduct {\n name: string;\n prices: PricingPrice[];\n}\n\nexport interface PricingProductCategory {\n name: string;\n products: PricingProduct[];\n}\n\nexport interface PricingProductType {\n name: string;\n productCategories: PricingProductCategory[];\n}\n\nexport interface UsersGetPricingResult {\n productTypes: PricingProductType[];\n}\n\nconst getPricing = /* @__PURE__ */ defineCommand<UsersGetPricingParams, UsersGetPricingResult>({\n name: \"namecheap.users.getPricing\",\n parse: (cr) => ({\n productTypes: cr\n .one(\"UserGetPricingResult\")\n .all(\"ProductType\")\n .map((type) => ({\n name: type.string(\"Name\"),\n productCategories: type.all(\"ProductCategory\").map((category) => ({\n name: category.string(\"Name\"),\n products: category.all(\"Product\").map((product) => ({\n name: product.string(\"Name\"),\n prices: product.all(\"Price\").map((price) => ({\n duration: price.number(\"Duration\"),\n durationType: price.string(\"DurationType\"),\n price: price.string(\"Price\"),\n regularPrice: price.string(\"RegularPrice\"),\n yourPrice: price.string(\"YourPrice\"),\n currency: price.string(\"Currency\"),\n ...optionalField(\"pricingType\", price.optionalString(\"PricingType\")),\n ...optionalField(\"regularPriceType\", price.optionalString(\"RegularPriceType\")),\n ...optionalField(\"yourPriceType\", price.optionalString(\"YourPriceType\")),\n ...optionalField(\"promotionPrice\", price.optionalString(\"PromotionPrice\")),\n })),\n })),\n })),\n })),\n }),\n});\n\n// ---------------------------------------------------------------------------\n// namecheap.users.changePassword\n// ---------------------------------------------------------------------------\n\n/**\n * Credential-bearing: changes the password of a real account. Either the old\n * password (method 1) or a reset code from `resetPassword` (method 2).\n */\nexport type UsersChangePasswordParams =\n { oldPassword: string; newPassword: string } | { resetCode: string; newPassword: string };\n\n/** Never echoes a password or reset code. */\nexport interface UsersChangePasswordResult {\n success: boolean;\n userID: number;\n}\n\nconst changePassword = /* @__PURE__ */ defineCommand<\n UsersChangePasswordParams,\n UsersChangePasswordResult\n>({\n name: \"namecheap.users.changePassword\",\n parse: (cr) => {\n const result = cr.one(\"UserChangePasswordResult\");\n return { success: result.boolean(\"Success\"), userID: result.number(\"UserID\") };\n },\n});\n// ---------------------------------------------------------------------------\n// namecheap.users.update\n// ---------------------------------------------------------------------------\n\nexport interface UsersUpdateParams {\n firstName: string;\n lastName: string;\n jobTitle?: string;\n organization?: string;\n address1: string;\n address2?: string;\n city: string;\n stateProvince: string;\n zip: string;\n /** Two-letter country code. */\n country: string;\n emailAddress: string;\n /** Format +NNN.NNNNNNNNNN. */\n phone: string;\n phoneExt?: string;\n /** Format +NNN.NNNNNNNNNN. */\n fax?: string;\n}\n\nexport interface UsersUpdateResult {\n success: boolean;\n}\n\nconst update = /* @__PURE__ */ defineCommand<UsersUpdateParams, UsersUpdateResult>({\n name: \"namecheap.users.update\",\n parse: (cr) => ({ success: cr.one(\"UserUpdateResult\").boolean(\"Success\") }),\n});\n// ---------------------------------------------------------------------------\n// namecheap.users.createaddfundsrequest\n// ---------------------------------------------------------------------------\n\n/** The only documented payment type. */\nexport type UsersPaymentType = \"Creditcard\";\n\n/**\n * The documented `Username` parameter is not exposed: the transport always sends\n * the configured account as `UserName`.\n *\n * @remarks Billed: this command creates a request to add money to your Namecheap account balance.\n */\nexport interface UsersCreateAddFundsRequestParams {\n paymentType: UsersPaymentType;\n /** Amount to add. */\n amount: number | string;\n /** URL to redirect the user to after payment. Sent as `ReturnUrl`. */\n returnUrl: string;\n}\n\nexport interface UsersCreateAddFundsRequestResult {\n tokenID: string;\n redirectURL: string;\n returnURL: string;\n}\n\nconst createAddFundsRequest = /* @__PURE__ */ defineCommand<\n UsersCreateAddFundsRequestParams,\n UsersCreateAddFundsRequestResult\n>({\n name: \"namecheap.users.createaddfundsrequest\",\n parse: (cr) => {\n const result = cr.one(\"CreateAddFundsRequestResult\");\n return {\n tokenID: result.string(\"TokenID\"),\n redirectURL: result.string(\"RedirectURL\"),\n returnURL: result.string(\"ReturnURL\"),\n };\n },\n});\n// ---------------------------------------------------------------------------\n// namecheap.users.getAddFundsStatus\n// ---------------------------------------------------------------------------\n\nexport interface UsersGetAddFundsStatusParams {\n /** Token from `createAddFundsRequest`. Sent as `TokenId` (not `TokenID`). */\n tokenId: string;\n}\n\nexport interface UsersGetAddFundsStatusResult {\n transactionID: number;\n amount: string;\n /** One of CREATED, SUBMITTED, COMPLETED, FAILED, EXPIRED. */\n status: string;\n}\n\nconst getAddFundsStatus = /* @__PURE__ */ defineCommand<\n UsersGetAddFundsStatusParams,\n UsersGetAddFundsStatusResult\n>({\n name: \"namecheap.users.getAddFundsStatus\",\n keys: { tokenId: \"TokenId\" },\n parse: (cr) => {\n const result = cr.one(\"GetAddFundsStatusResult\");\n return {\n transactionID: result.number(\"TransactionID\"),\n amount: result.string(\"Amount\"),\n status: result.string(\"Status\"),\n };\n },\n});\n// ---------------------------------------------------------------------------\n// namecheap.users.create\n// ---------------------------------------------------------------------------\n\n/** Credential-bearing: creates a real account under the ApiUser with its password. */\nexport interface UsersCreateParams {\n newUserName: string;\n newUserPassword: string;\n emailAddress: string;\n /** Whether to skip the duplicate e-mail check. Default: Yes. */\n ignoreDuplicateEmailAddress?: string;\n firstName: string;\n lastName: string;\n /** Must be 1 to accept the terms. */\n acceptTerms: number;\n /** 1 to receive newsletters, 0 to opt out. */\n acceptNews?: number;\n jobTitle?: string;\n organization?: string;\n address1: string;\n address2?: string;\n city: string;\n stateProvince: string;\n zip: string;\n /** Two-letter country code. */\n country: string;\n /** Format +NNN.NNNNNNNNNN. */\n phone: string;\n phoneExt?: string;\n fax?: string;\n}\n\n/**\n * Neither the reference nor the SDK documents a response for this command, so the\n * attributes of the first element inside `CommandResponse` are returned as-is\n * (empty when there is none). Parsing never throws: the account may already exist.\n */\nexport type UsersCreateResult = Record<string, string>;\n\nconst create = /* @__PURE__ */ defineCommand<UsersCreateParams, UsersCreateResult>({\n name: \"namecheap.users.create\",\n parse: (cr) => cr.children()[0]?.attributes() ?? {},\n});\n// ---------------------------------------------------------------------------\n// namecheap.users.login\n// ---------------------------------------------------------------------------\n\n/**\n * Credential-bearing. Validates the password of an account created via\n * `users.create` (the account is the configured `userName`).\n */\nexport interface UsersLoginParams {\n password: string;\n}\n\n/**\n * The response shape is not documented anywhere; the documented attributes are read\n * from the first element inside `CommandResponse`, whatever its name, and left\n * out when absent.\n */\nexport interface UsersLoginResult {\n username?: string;\n loginSuccess?: boolean;\n}\n\nconst login = /* @__PURE__ */ defineCommand<UsersLoginParams, UsersLoginResult>({\n name: \"namecheap.users.login\",\n parse: (cr) => {\n const result = cr.children()[0];\n return {\n ...optionalField(\"username\", result?.optionalString(\"Username\")),\n ...optionalField(\"loginSuccess\", result?.lenientBoolean(\"LoginSuccess\")),\n };\n },\n});\n// ---------------------------------------------------------------------------\n// namecheap.users.resetPassword\n// ---------------------------------------------------------------------------\n\nexport type UsersResetPasswordFindBy = \"EMAILADDRESS\" | \"DOMAINNAME\" | \"USERNAME\";\n\n/** Credential-bearing: e-mails a password reset link for a real account. */\nexport interface UsersResetPasswordParams {\n findBy: UsersResetPasswordFindBy;\n /** The username, e-mail address or domain to search by. */\n findByValue: string;\n /** Sender name in the reset e-mail. Default: namecheap.com. */\n emailFromName?: string;\n /** Sender address. Default: support@namecheap.com. */\n emailFrom?: string;\n /** URL pattern containing the `[RESETCODE]` placeholder. Sent as `URLPattern`. */\n urlPattern?: string;\n}\n\n/** The response shape is not documented anywhere; read tolerantly from the first child of `CommandResponse`. */\nexport interface UsersResetPasswordResult {\n success?: boolean;\n}\n\nconst resetPassword = /* @__PURE__ */ defineCommand<\n UsersResetPasswordParams,\n UsersResetPasswordResult\n>({\n name: \"namecheap.users.resetPassword\",\n keys: { urlPattern: \"URLPattern\" },\n parse: (cr) => ({\n ...optionalField(\"success\", cr.children()[0]?.lenientBoolean(\"Success\")),\n }),\n});\n/**\n * The command table behind `client.users`. Advanced use only: it is exported for custom\n * integrations and is not covered by semver stability.\n */\nexport const usersCommands = {\n getBalances,\n getPricing,\n changePassword,\n update,\n createAddFundsRequest,\n getAddFundsStatus,\n create,\n login,\n resetPassword,\n};\n\n/**\n * Every command of this group as a standalone export (`<group><Method>`), for\n * tree-shaken use with `run(command, send, params)`; see the README.\n */\nexport {\n getBalances as usersGetBalances,\n getPricing as usersGetPricing,\n changePassword as usersChangePassword,\n update as usersUpdate,\n createAddFundsRequest as usersCreateAddFundsRequest,\n getAddFundsStatus as usersGetAddFundsStatus,\n create as usersCreate,\n login as usersLogin,\n resetPassword as usersResetPassword,\n};\n","import { defineCommand } from \"../core/define\";\nimport { optionalField } from \"../core/fields\";\n\n// `AddressId` is sent with a lowercase `d` (the reference spelling), while the `ID`\n// acronym would produce `AddressID`; every command that takes it carries a keys map.\n\n// ---------------------------------------------------------------------------\n// namecheap.users.address.create\n// ---------------------------------------------------------------------------\n\nexport interface UsersAddressCreateParams {\n /** Address name/label (max 20 characters). */\n addressName: string;\n /** 1 to set as the default address, 0 otherwise. */\n defaultYN?: number;\n emailAddress: string;\n firstName: string;\n lastName: string;\n jobTitle?: string;\n organization?: string;\n address1: string;\n address2?: string;\n city: string;\n stateProvince: string;\n stateProvinceChoice: string;\n zip: string;\n /** Two-letter country code. */\n country: string;\n /** Format +NNN.NNNNNNNNNN. */\n phone: string;\n phoneExt?: string;\n /** Format +NNN.NNNNNNNNNN. */\n fax?: string;\n}\n\nexport interface UsersAddressCreateResult {\n success: boolean;\n addressId: number;\n addressName: string;\n}\n\nconst create = /* @__PURE__ */ defineCommand<UsersAddressCreateParams, UsersAddressCreateResult>({\n name: \"namecheap.users.address.create\",\n parse: (cr) => {\n const result = cr.one(\"AddressCreateResult\");\n return {\n success: result.boolean(\"Success\"),\n addressId: result.number(\"AddressId\"),\n addressName: result.string(\"AddressName\"),\n };\n },\n});\n\n// ---------------------------------------------------------------------------\n// namecheap.users.address.delete\n// ---------------------------------------------------------------------------\n\nexport interface UsersAddressDeleteParams {\n /** Sent as `AddressId`. */\n addressId: number;\n}\n\nexport interface UsersAddressDeleteResult {\n success: boolean;\n /** Id of the deleted address profile (`ProfileId`). */\n profileId: number;\n /** Listed in the official docs; absent from the captured response. */\n username?: string;\n}\n\nconst deleteAddress = /* @__PURE__ */ defineCommand<\n UsersAddressDeleteParams,\n UsersAddressDeleteResult\n>({\n name: \"namecheap.users.address.delete\",\n keys: { addressId: \"AddressId\" },\n parse: (cr) => {\n const result = cr.one(\"AddressDeleteResult\");\n return {\n success: result.boolean(\"Success\"),\n profileId: result.number(\"ProfileId\"),\n ...optionalField(\"username\", result.optionalString(\"Username\")),\n };\n },\n});\n\n// ---------------------------------------------------------------------------\n// namecheap.users.address.getInfo\n// ---------------------------------------------------------------------------\n\nexport interface UsersAddressGetInfoParams {\n /** Sent as `AddressId`; 0 is the primary address. */\n addressId: number;\n}\n\n/** Fields the reference says are omitted (not sent empty) when they have no value are optional. */\nexport interface UsersAddressGetInfoResult {\n addressId: number;\n userName: string;\n addressName: string;\n /** From the `Default_YN` element. */\n defaultYN: boolean;\n firstName: string;\n lastName: string;\n jobTitle?: string;\n /** Not listed as omitted in the reference, but optional on the API side. */\n organization?: string;\n address1: string;\n address2?: string;\n city: string;\n stateProvince: string;\n stateProvinceChoice: string;\n zip: string;\n country: string;\n phone: string;\n phoneExt?: string;\n fax?: string;\n emailAddress: string;\n}\n\n/** Text of an optional child element. */\n\nconst getInfo = /* @__PURE__ */ defineCommand<UsersAddressGetInfoParams, UsersAddressGetInfoResult>(\n {\n name: \"namecheap.users.address.getInfo\",\n keys: { addressId: \"AddressId\" },\n parse: (cr) => {\n const result = cr.one(\"GetAddressInfoResult\");\n return {\n addressId: result.one(\"AddressId\").numberText(),\n userName: result.one(\"UserName\").text(),\n addressName: result.one(\"AddressName\").text(),\n defaultYN: result.one(\"Default_YN\").booleanText(),\n firstName: result.one(\"FirstName\").text(),\n lastName: result.one(\"LastName\").text(),\n ...optionalField(\"jobTitle\", result.optionalText(\"JobTitle\")),\n ...optionalField(\"organization\", result.optionalText(\"Organization\")),\n address1: result.one(\"Address1\").text(),\n ...optionalField(\"address2\", result.optionalText(\"Address2\")),\n city: result.one(\"City\").text(),\n stateProvince: result.one(\"StateProvince\").text(),\n stateProvinceChoice: result.one(\"StateProvinceChoice\").text(),\n zip: result.one(\"Zip\").text(),\n country: result.one(\"Country\").text(),\n phone: result.one(\"Phone\").text(),\n ...optionalField(\"phoneExt\", result.optionalText(\"PhoneExt\")),\n ...optionalField(\"fax\", result.optionalText(\"Fax\")),\n emailAddress: result.one(\"EmailAddress\").text(),\n };\n },\n },\n);\n\n// ---------------------------------------------------------------------------\n// namecheap.users.address.getList\n// ---------------------------------------------------------------------------\n\nexport interface UsersAddressListItem {\n addressId: number;\n addressName: string;\n isDefault: boolean;\n}\n\n/** The response has no `Paging` element, so the result is a bare array (empty when there are no `List` elements). */\nexport type UsersAddressGetListResult = UsersAddressListItem[];\n\nconst getList = /* @__PURE__ */ defineCommand<Record<string, never>, UsersAddressGetListResult>({\n name: \"namecheap.users.address.getList\",\n parse: (cr) =>\n (cr.optional(\"AddressGetListResult\")?.all(\"List\") ?? []).map((item) => ({\n addressId: item.number(\"AddressId\"),\n addressName: item.string(\"AddressName\"),\n isDefault: item.boolean(\"IsDefault\"),\n })),\n});\n\n// ---------------------------------------------------------------------------\n// namecheap.users.address.setDefault\n// ---------------------------------------------------------------------------\n\nexport interface UsersAddressSetDefaultParams {\n /** Sent as `AddressId`; 0 makes the primary address the default again. */\n addressId: number;\n}\n\nexport interface UsersAddressSetDefaultResult {\n success: boolean;\n addressId: number;\n}\n\nconst setDefault = /* @__PURE__ */ defineCommand<\n UsersAddressSetDefaultParams,\n UsersAddressSetDefaultResult\n>({\n name: \"namecheap.users.address.setDefault\",\n keys: { addressId: \"AddressId\" },\n parse: (cr) => {\n const result = cr.one(\"AddressSetDefaultResult\");\n return { success: result.boolean(\"Success\"), addressId: result.number(\"AddressId\") };\n },\n});\n\n// ---------------------------------------------------------------------------\n// namecheap.users.address.update\n// ---------------------------------------------------------------------------\n\n/** Same fields as `create`; omitting `defaultYN` leaves the default flag unchanged. */\nexport interface UsersAddressUpdateParams extends UsersAddressCreateParams {\n /** Sent as `AddressId`. */\n addressId: number;\n}\n\nexport interface UsersAddressUpdateResult {\n success: boolean;\n addressId: number;\n addressName: string;\n}\n\nconst update = /* @__PURE__ */ defineCommand<UsersAddressUpdateParams, UsersAddressUpdateResult>({\n name: \"namecheap.users.address.update\",\n keys: { addressId: \"AddressId\" },\n parse: (cr) => {\n const result = cr.one(\"AddressUpdateResult\");\n return {\n success: result.boolean(\"Success\"),\n addressId: result.number(\"AddressId\"),\n addressName: result.string(\"AddressName\"),\n };\n },\n});\n\n/**\n * The command table behind `client.usersAddress`. Advanced use only: it is exported for custom\n * integrations and is not covered by semver stability.\n */\nexport const usersAddressCommands = {\n create,\n delete: deleteAddress,\n getInfo,\n getList,\n setDefault,\n update,\n};\n\n/**\n * Every command of this group as a standalone export (`<group><Method>`), for\n * tree-shaken use with `run(command, send, params)`; see the README.\n */\nexport {\n create as usersAddressCreate,\n deleteAddress as usersAddressDelete,\n getInfo as usersAddressGetInfo,\n getList as usersAddressGetList,\n setDefault as usersAddressSetDefault,\n update as usersAddressUpdate,\n};\n","import { defineCommand } from \"../core/define\";\nimport type { El } from \"../core/element\";\nimport { firstLenientNumber, optionalField } from \"../core/fields\";\nimport { parsePaging } from \"../core/paging\";\nimport type { Paging } from \"../core/paging\";\n\n// The service was renamed WithheldforPrivacy, but the API commands keep the\n// `whoisguard` spelling (all lowercase in the reference).\n\n// ---------------------------------------------------------------------------\n// namecheap.whoisguard.changeemailaddress\n// ---------------------------------------------------------------------------\n\nexport interface WhoisguardChangeEmailAddressParams {\n /** Unique domain privacy ID to change. Sent as `WhoisguardID`. */\n whoisguardID: number;\n}\n\nexport interface WhoisguardChangeEmailAddressResult {\n /** Unique integer representing the domain privacy subscription. */\n id: number;\n isSuccess: boolean;\n /** New domain privacy email address. */\n wgEmail: string;\n /** Old domain privacy email address. */\n wgOldEmail: string;\n}\n\nconst changeEmailAddress = /* @__PURE__ */ defineCommand<\n WhoisguardChangeEmailAddressParams,\n WhoisguardChangeEmailAddressResult\n>({\n name: \"namecheap.whoisguard.changeemailaddress\",\n parse: (cr) => {\n const result = cr.one(\"WhoisguardChangeEmailAddressResult\");\n return {\n id: result.number(\"ID\"),\n isSuccess: result.boolean(\"IsSuccess\"),\n wgEmail: result.string(\"WGEmail\"),\n wgOldEmail: result.string(\"WGOldEmail\"),\n };\n },\n});\n\n// ---------------------------------------------------------------------------\n// namecheap.whoisguard.enable\n// ---------------------------------------------------------------------------\n\nexport interface WhoisguardEnableParams {\n /** Unique domain privacy ID to enable. Sent as `WhoisguardID`. */\n whoisguardID: number;\n /** Email address to forward domain privacy emails to (max 70 characters). */\n forwardedToEmail: string;\n}\n\nexport interface WhoisguardEnableResult {\n domainName: string;\n isSuccess: boolean;\n}\n\nconst enable = /* @__PURE__ */ defineCommand<WhoisguardEnableParams, WhoisguardEnableResult>({\n name: \"namecheap.whoisguard.enable\",\n parse: (cr) => {\n const result = cr.one(\"WhoisguardEnableResult\");\n return {\n domainName: result.string(\"DomainName\"),\n isSuccess: result.boolean(\"IsSuccess\"),\n };\n },\n});\n\n// ---------------------------------------------------------------------------\n// namecheap.whoisguard.disable\n// ---------------------------------------------------------------------------\n\nexport interface WhoisguardDisableParams {\n /** Unique domain privacy ID to disable. Sent as `WhoisguardID`. */\n whoisguardID: number;\n}\n\nexport interface WhoisguardDisableResult {\n /** The reference spells this `Domainname`; the fixture uses `DomainName`. */\n domainName: string;\n isSuccess: boolean;\n}\n\nconst disable = /* @__PURE__ */ defineCommand<WhoisguardDisableParams, WhoisguardDisableResult>({\n name: \"namecheap.whoisguard.disable\",\n parse: (cr) => {\n const result = cr.one(\"WhoisguardDisableResult\");\n return {\n domainName: result.string(\"DomainName\"),\n isSuccess: result.boolean(\"IsSuccess\"),\n };\n },\n});\n\n// ---------------------------------------------------------------------------\n// namecheap.whoisguard.getlist\n// ---------------------------------------------------------------------------\n\n/** `ALLOTED` is the API's own (nonstandard) spelling and is sent verbatim. */\nexport type WhoisguardListType = \"ALL\" | \"ALLOTED\" | \"FREE\" | \"DISCARD\";\n\nexport interface WhoisguardGetListParams {\n /** Default: ALL. */\n listType?: WhoisguardListType;\n /** Default: 1. */\n page?: number;\n /** Min 2, max 100. */\n pageSize?: number;\n}\n\nexport interface WhoisguardListItem {\n /** Unique integer representing the subscription (the reference column is \"Whoisguard ID\"). */\n id: number;\n /** The reference spells this column `Domainname`; the fixture uses `DomainName`. Empty for a FREE subscription. */\n domainName: string;\n created: string;\n expires: string;\n status: string;\n}\n\nexport interface WhoisguardGetListResult {\n whoisguards: WhoisguardListItem[];\n paging: Paging;\n}\n\nfunction parseListItem(item: El): WhoisguardListItem {\n return {\n id: item.number(\"ID\"),\n domainName: item.string(\"DomainName\"),\n created: item.string(\"Created\"),\n expires: item.string(\"Expires\"),\n status: item.string(\"Status\"),\n };\n}\n\nconst getList = /* @__PURE__ */ defineCommand<WhoisguardGetListParams, WhoisguardGetListResult>({\n name: \"namecheap.whoisguard.getlist\",\n parse: (cr) => ({\n whoisguards: (cr.optional(\"WhoisguardGetListResult\")?.all(\"Whoisguard\") ?? []).map(\n parseListItem,\n ),\n paging: parsePaging(cr.one(\"Paging\")),\n }),\n});\n\n// ---------------------------------------------------------------------------\n// namecheap.whoisguard.renew\n// ---------------------------------------------------------------------------\n\n/**\n * @remarks Billed: this command charges your Namecheap account.\n */\nexport interface WhoisguardRenewParams {\n /** Domain privacy ID to renew. Sent as `WhoisguardID`. */\n whoisguardID: number;\n /** Number of years to renew. Default: 1. */\n years: number;\n promotionCode?: string;\n}\n\n// Billed command whose response shape is NOT documented: the reference lists only\n// column labels (\"WhoisGuard ID\", \"Renew\", \"OrderId\", ...), the Go SDK has no renew\n// and no fixture exists. The parser therefore never throws once the charge went\n// through: it reads the first child element, whatever its name, and returns only\n// the attributes it finds and can read (never throwing on a present but unexpected value). The spellings below are guesses.\nexport interface WhoisguardRenewResult {\n whoisguardID?: number;\n years?: number;\n /** Omitted when the attribute is absent or not `true`/`false`. */\n renew?: boolean;\n orderID?: number;\n transactionID?: number;\n chargedAmount?: number;\n}\n\nconst renew = /* @__PURE__ */ defineCommand<WhoisguardRenewParams, WhoisguardRenewResult>({\n name: \"namecheap.whoisguard.renew\",\n parse: (cr) => {\n const result = cr.children()[0];\n return {\n ...optionalField(\n \"whoisguardID\",\n result && firstLenientNumber(result, \"WhoisguardID\", \"WhoisguardId\"),\n ),\n ...optionalField(\"years\", result?.lenientNumber(\"Years\")),\n ...optionalField(\"renew\", result?.lenientBoolean(\"Renew\")),\n ...optionalField(\"orderID\", result && firstLenientNumber(result, \"OrderID\", \"OrderId\")),\n ...optionalField(\n \"transactionID\",\n result && firstLenientNumber(result, \"TransactionID\", \"TransactionId\"),\n ),\n ...optionalField(\"chargedAmount\", result?.lenientNumber(\"ChargedAmount\")),\n };\n },\n});\n\n/**\n * The command table behind `client.whoisGuard`. Advanced use only: it is exported for custom\n * integrations and is not covered by semver stability.\n */\nexport const whoisGuardCommands = { changeEmailAddress, enable, disable, getList, renew };\n\n/**\n * Every command of this group as a standalone export (`<group><Method>`), for\n * tree-shaken use with `run(command, send, params)`; see the README.\n */\nexport {\n changeEmailAddress as whoisGuardChangeEmailAddress,\n enable as whoisGuardEnable,\n disable as whoisGuardDisable,\n getList as whoisGuardGetList,\n renew as whoisGuardRenew,\n};\n","import { NamecheapParseError } from \"./errors\";\nimport type { XmlNode } from \"./xml\";\n\nconst PLAIN_DECIMAL = /^[+-]?\\d+(\\.\\d+)?$/;\n\n/** Typed, read-only view over an XML node. Error messages never include attribute values. */\nexport class El {\n readonly name: string;\n\n constructor(private readonly node: XmlNode) {\n this.name = node.name;\n }\n\n text(): string {\n return this.node.text;\n }\n\n all(name: string): El[] {\n return this.node.children.filter((child) => child.name === name).map((child) => new El(child));\n }\n\n /** All direct child elements in document order, whatever their names. */\n children(): El[] {\n return this.node.children.map((child) => new El(child));\n }\n\n /** Text of the first child element called `name`, or `undefined` when there is none. */\n optionalText(name: string): string | undefined {\n return this.optional(name)?.text();\n }\n\n one(name: string): El {\n const found = this.optional(name);\n if (found === undefined) {\n throw new NamecheapParseError(`${this.name}: missing element \"${name}\"`);\n }\n return found;\n }\n\n optional(name: string): El | undefined {\n const child = this.node.children.find((candidate) => candidate.name === name);\n return child === undefined ? undefined : new El(child);\n }\n\n string(attr: string): string {\n const value = this.optionalString(attr);\n if (value === undefined) {\n throw new NamecheapParseError(`${this.name}: missing attribute \"${attr}\"`);\n }\n return value;\n }\n\n optionalString(attr: string): string | undefined {\n return Object.hasOwn(this.node.attrs, attr) ? this.node.attrs[attr] : undefined;\n }\n\n number(attr: string): number {\n return this.parseNumber(attr, this.string(attr));\n }\n\n optionalNumber(attr: string): number | undefined {\n const value = this.optionalString(attr);\n return value === undefined ? undefined : this.parseNumber(attr, value);\n }\n\n boolean(attr: string): boolean {\n return this.parseBoolean(attr, this.string(attr));\n }\n\n optionalBoolean(attr: string): boolean | undefined {\n const value = this.optionalString(attr);\n return value === undefined ? undefined : this.parseBoolean(attr, value);\n }\n\n /**\n * Never throws: the plain decimal value of an attribute, or `undefined` when it is\n * absent or not acceptable. For undocumented responses of billed or account-changing\n * commands, where a parse failure after the action succeeded would invite a retry.\n */\n lenientNumber(attr: string): number | undefined {\n const value = this.optionalString(attr);\n if (value === undefined || !PLAIN_DECIMAL.test(value)) return undefined;\n const parsed = Number(value);\n return Number.isFinite(parsed) ? parsed : undefined;\n }\n\n /** Never throws: `true`/`false` (any case), or `undefined` when absent or anything else. */\n lenientBoolean(attr: string): boolean | undefined {\n const lower = this.optionalString(attr)?.toLowerCase();\n if (lower === \"true\") return true;\n if (lower === \"false\") return false;\n return undefined;\n }\n\n /** Element text as a plain decimal number (for numeric child elements). */\n numberText(): number {\n return this.parseNumber(`text`, this.text(), `${this.name}: text is not a number`);\n }\n\n /** Element text as `true`/`false` (for boolean child elements). */\n booleanText(): boolean {\n return this.parseBoolean(`text`, this.text(), `${this.name}: text is not a boolean`);\n }\n\n attributes(): Record<string, string> {\n return { ...this.node.attrs };\n }\n\n private parseNumber(attr: string, value: string, message?: string): number {\n const parsed = PLAIN_DECIMAL.test(value) ? Number(value) : Number.NaN;\n if (!Number.isFinite(parsed)) {\n throw new NamecheapParseError(message ?? `${this.name}: attribute \"${attr}\" is not a number`);\n }\n return parsed;\n }\n\n private parseBoolean(attr: string, value: string, message?: string): boolean {\n const lower = value.toLowerCase();\n if (lower === \"true\") return true;\n if (lower === \"false\") return false;\n throw new NamecheapParseError(message ?? `${this.name}: attribute \"${attr}\" is not a boolean`);\n }\n}\n","import { NamecheapParseError } from \"./errors\";\n\nexport interface XmlNode {\n readonly name: string;\n readonly attrs: Readonly<Record<string, string>>;\n readonly text: string;\n readonly children: readonly XmlNode[];\n}\n\ninterface Builder {\n name: string;\n attrs: Record<string, string>;\n text: string;\n children: XmlNode[];\n}\n\nconst NAMED_ENTITIES: Readonly<Record<string, string>> = {\n amp: \"&\",\n lt: \"<\",\n gt: \">\",\n quot: '\"',\n apos: \"'\",\n};\n\nconst NAME_START = /[A-Za-z_:]/;\nconst NAME_CHAR = /[A-Za-z0-9_:.-]/;\n\nfunction fail(message: string, position: number): never {\n throw new NamecheapParseError(`Invalid XML at position ${position}: ${message}`);\n}\n\nfunction isSpace(ch: string | undefined): boolean {\n return ch === \" \" || ch === \"\\t\" || ch === \"\\n\" || ch === \"\\r\";\n}\n\nfunction decodeEntities(raw: string, position: number): string {\n if (!raw.includes(\"&\")) return raw;\n let out = \"\";\n let i = 0;\n while (i < raw.length) {\n const amp = raw.indexOf(\"&\", i);\n if (amp === -1) {\n out += raw.slice(i);\n break;\n }\n out += raw.slice(i, amp);\n const semi = raw.indexOf(\";\", amp);\n if (semi === -1) fail(\"unterminated entity\", position + amp);\n const body = raw.slice(amp + 1, semi);\n let decoded: string | undefined;\n if (body.startsWith(\"#x\") || body.startsWith(\"#X\")) {\n decoded = codePoint(body.slice(2), 16);\n } else if (body.startsWith(\"#\")) {\n decoded = codePoint(body.slice(1), 10);\n } else {\n decoded = Object.hasOwn(NAMED_ENTITIES, body) ? NAMED_ENTITIES[body] : undefined;\n }\n if (decoded === undefined) {\n const shown = body.length > 32 ? `${body.slice(0, 32)}…` : body;\n fail(`unknown entity &${shown};`, position + amp);\n }\n out += decoded;\n i = semi + 1;\n }\n return out;\n}\n\nfunction codePoint(digits: string, radix: 10 | 16): string | undefined {\n const pattern = radix === 10 ? /^[0-9]{1,7}$/ : /^[0-9A-Fa-f]{1,6}$/;\n if (!pattern.test(digits)) return undefined;\n const value = Number.parseInt(digits, radix);\n if (value > 0x10ffff || (value >= 0xd800 && value <= 0xdfff)) return undefined;\n return String.fromCodePoint(value);\n}\n\n/**\n * Parses an XML document and returns its root element.\n *\n * Supports elements, attributes, text, CDATA, comments, processing instructions and the five\n * predefined entities plus numeric character references. DTDs and custom entities are rejected.\n */\nexport function parseXml(input: string): XmlNode {\n const length = input.length;\n let pos = 0;\n let root: XmlNode | undefined;\n const stack: Builder[] = [];\n\n const skipSpace = (): void => {\n while (pos < length && isSpace(input[pos])) pos++;\n };\n\n const readName = (): string => {\n const start = pos;\n if (pos >= length || !NAME_START.test(input[pos] as string)) fail(\"expected a name\", pos);\n pos++;\n while (pos < length && NAME_CHAR.test(input[pos] as string)) pos++;\n return input.slice(start, pos);\n };\n\n const skipUntil = (terminator: string, what: string): void => {\n const end = input.indexOf(terminator, pos);\n if (end === -1) fail(`unterminated ${what}`, pos);\n pos = end + terminator.length;\n };\n\n const readAttributes = (attrs: Record<string, string>): boolean => {\n for (;;) {\n const before = pos;\n skipSpace();\n const ch = input[pos];\n if (ch === undefined) fail(\"unterminated start tag\", pos);\n if (ch === \">\") {\n pos++;\n return false;\n }\n if (ch === \"/\") {\n if (input[pos + 1] !== \">\") fail(\"expected '>' after '/'\", pos);\n pos += 2;\n return true;\n }\n if (pos === before) fail(\"expected whitespace before attribute\", pos);\n const name = readName();\n skipSpace();\n if (input[pos] !== \"=\") fail(`attribute ${name} has no value`, pos);\n pos++;\n skipSpace();\n const quote = input[pos];\n if (quote !== '\"' && quote !== \"'\") fail(`attribute ${name} value is not quoted`, pos);\n pos++;\n const end = input.indexOf(quote, pos);\n if (end === -1) fail(\"unterminated attribute value\", pos);\n const raw = input.slice(pos, end);\n if (raw.includes(\"<\")) fail(\"'<' in attribute value\", pos);\n if (Object.hasOwn(attrs, name)) fail(`duplicate attribute ${name}`, pos);\n attrs[name] = decodeEntities(raw, pos);\n pos = end + 1;\n }\n };\n\n const closeElement = (builder: Builder): void => {\n const node: XmlNode = {\n name: builder.name,\n attrs: builder.attrs,\n text: builder.text.trim(),\n children: builder.children,\n };\n const parent = stack[stack.length - 1];\n if (parent) parent.children.push(node);\n else root = node;\n };\n\n while (pos < length) {\n const current = stack[stack.length - 1];\n\n if (input[pos] !== \"<\") {\n const next = input.indexOf(\"<\", pos);\n const end = next === -1 ? length : next;\n const raw = input.slice(pos, end);\n if (current) {\n current.text += decodeEntities(raw, pos);\n } else if (raw.trim() !== \"\") {\n fail(\"text outside the root element\", pos);\n }\n pos = end;\n continue;\n }\n\n if (input.startsWith(\"<!--\", pos)) {\n pos += 4;\n skipUntil(\"-->\", \"comment\");\n } else if (input.startsWith(\"<![CDATA[\", pos)) {\n if (!current) fail(\"CDATA outside the root element\", pos);\n pos += 9;\n const end = input.indexOf(\"]]>\", pos);\n if (end === -1) fail(\"unterminated CDATA section\", pos);\n current.text += input.slice(pos, end);\n pos = end + 3;\n } else if (input.startsWith(\"<?\", pos)) {\n pos += 2;\n skipUntil(\"?>\", \"processing instruction\");\n } else if (input.startsWith(\"<!\", pos)) {\n fail(\"DTD and entity declarations are not supported\", pos);\n } else if (input.startsWith(\"</\", pos)) {\n pos += 2;\n const name = readName();\n skipSpace();\n if (input[pos] !== \">\") fail(\"expected '>' in end tag\", pos);\n pos++;\n if (!current) fail(`unexpected end tag </${name}>`, pos);\n if (current.name !== name) {\n fail(`end tag </${name}> does not match <${current.name}>`, pos);\n }\n stack.pop();\n closeElement(current);\n } else {\n if (!current && root) fail(\"more than one root element\", pos);\n pos++;\n const builder: Builder = { name: readName(), attrs: {}, text: \"\", children: [] };\n const selfClosing = readAttributes(builder.attrs);\n if (selfClosing) closeElement(builder);\n else stack.push(builder);\n }\n }\n\n if (stack.length > 0) fail(`unclosed element <${stack[stack.length - 1]?.name}>`, pos);\n if (!root) fail(\"no root element\", pos);\n return root;\n}\n","import { El } from \"./element\";\nimport { NamecheapError, NamecheapParseError, type ApiErrorItem } from \"./errors\";\nimport { parseXml } from \"./xml\";\n\nconst INTEGER = /^-?\\d+$/;\n\nfunction toErrorItem(error: El): ApiErrorItem {\n const number = error.optionalString(\"Number\")?.trim();\n return {\n code: number !== undefined && INTEGER.test(number) ? Number(number) : -1,\n message: error.text().trim(),\n };\n}\n\n/**\n * Parses a Namecheap response body and returns its `CommandResponse` element.\n * Throws `NamecheapError` for API errors and `NamecheapParseError` for malformed envelopes.\n */\nexport function readEnvelope(xml: string): El {\n const root = new El(parseXml(xml));\n if (root.name !== \"ApiResponse\") {\n throw new NamecheapParseError(`Unexpected response root element \"${root.name}\"`);\n }\n const errors = root.optional(\"Errors\")?.all(\"Error\") ?? [];\n if (root.optionalString(\"Status\") === \"ERROR\" || errors.length > 0) {\n throw new NamecheapError(errors.map(toErrorItem));\n }\n const command = root.optional(\"CommandResponse\");\n if (command === undefined) {\n throw new NamecheapParseError(\"Response has no CommandResponse element\");\n }\n return command;\n}\n","import type { El } from \"./element\";\nimport { readEnvelope } from \"./envelope\";\nimport { NamecheapHttpError } from \"./errors\";\n\nexport interface TransportConfig {\n apiUser: string;\n apiKey: string;\n userName?: string;\n clientIp: string;\n sandbox?: boolean;\n fetch?: typeof fetch;\n timeoutMs?: number;\n}\n\nexport interface CommandRequest {\n command: string;\n params: Array<[string, string]>;\n}\n\nexport type Send = (req: CommandRequest) => Promise<El>;\n\nconst PRODUCTION_URL = \"https://api.namecheap.com/xml.response\";\nconst SANDBOX_URL = \"https://api.sandbox.namecheap.com/xml.response\";\n\n/**\n * Creates the function that sends one command as a form-encoded POST and returns the\n * `CommandResponse` element. Error messages are fixed strings: they never contain the\n * URL, the API key, the request body or the response body.\n */\nexport function createTransport(config: TransportConfig): Send {\n if (config.sandbox !== undefined && typeof config.sandbox !== \"boolean\") {\n throw new TypeError(\"NamecheapConfig.sandbox must be a boolean\");\n }\n const url = config.sandbox === true ? SANDBOX_URL : PRODUCTION_URL;\n const fetchImpl = config.fetch ?? globalThis.fetch;\n\n return async ({ command, params }) => {\n const body = new URLSearchParams();\n body.append(\"ApiUser\", config.apiUser);\n body.append(\"ApiKey\", config.apiKey);\n body.append(\"UserName\", config.userName ?? config.apiUser);\n body.append(\"ClientIp\", config.clientIp);\n body.append(\"Command\", command);\n for (const [name, value] of params) body.append(name, value);\n\n const init: RequestInit = {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/x-www-form-urlencoded\" },\n body: body.toString(),\n redirect: \"error\",\n };\n if (config.timeoutMs !== undefined) init.signal = AbortSignal.timeout(config.timeoutMs);\n\n let response: Response;\n try {\n response = await fetchImpl(url, init);\n } catch (cause) {\n throw new NamecheapHttpError(\"Request to Namecheap failed\", { cause });\n }\n\n if (!response.ok) {\n throw new NamecheapHttpError(`Namecheap responded with HTTP ${response.status}`, {\n status: response.status,\n statusText: response.statusText,\n });\n }\n\n let text: string;\n try {\n text = await response.text();\n } catch (cause) {\n throw new NamecheapHttpError(\"Request to Namecheap failed\", { cause });\n }\n return readEnvelope(text);\n };\n}\n","import { dnsCommands } from \"./commands/dns\";\nimport { domainsCommands } from \"./commands/domains\";\nimport { nsCommands } from \"./commands/ns\";\nimport { sslCommands } from \"./commands/ssl\";\nimport { transferCommands } from \"./commands/transfer\";\nimport { usersCommands } from \"./commands/users\";\nimport { usersAddressCommands } from \"./commands/users-address\";\nimport { whoisGuardCommands } from \"./commands/whoisguard\";\nimport { group } from \"./core/define\";\nimport { createTransport } from \"./core/transport\";\nimport type { TransportConfig } from \"./core/transport\";\n\nexport default class Namecheap {\n readonly domains;\n readonly dns;\n readonly ns;\n readonly transfer;\n readonly ssl;\n readonly users;\n readonly usersAddress;\n readonly whoisGuard;\n\n constructor(config: TransportConfig) {\n const send = createTransport(config);\n this.domains = group(domainsCommands, send);\n this.dns = group(dnsCommands, send);\n this.ns = group(nsCommands, send);\n this.transfer = group(transferCommands, send);\n this.ssl = group(sslCommands, send);\n this.users = group(usersCommands, send);\n this.usersAddress = group(usersAddressCommands, send);\n this.whoisGuard = group(whoisGuardCommands, send);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAAC;AAAA,EAAA;AAAA,mBAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA,mBAAAD;AAAA,EAAA;AAAA;AAAA,oBAAAC;AAAA,EAAA,kBAAAF;AAAA,EAAA;AAAA;AAAA;AAAA,kBAAAG;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA,wBAAAF;AAAA,EAAA,uBAAAD;AAAA,EAAA;AAAA;AAAA;AAAA,4BAAAC;AAAA,EAAA;AAAA,6BAAAC;AAAA,EAAA,2BAAAF;AAAA,EAAA,8BAAAI;AAAA,EAAA,0BAAAC;AAAA,EAAA;AAAA;AAAA,qBAAAJ;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAAI;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA,2BAAAL;AAAA,EAAA,uBAAAG;AAAA;AAAA;;;ACGO,IAAM,iBAAN,cAA6B,MAAM;AAAA,EAC/B;AAAA,EACA;AAAA,EAET,YAAY,QAAiC;AAC3C,UAAM,QAAQ,OAAO,CAAC;AACtB;AAAA,MACE,UAAU,SACN,4BACA,MAAM,QAAQ,KAAK,MAAM,KACvB,mBAAmB,MAAM,IAAI,KAC7B,MAAM;AAAA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A;AAAA,EACA;AAAA,EAET,YAAY,QAAyB;AACnC,UAAM,OAAO,gBAAgB,MAAM;AACnC,SAAK,UAAU,MAAM,iBAAiB,IAAI;AAC1C,SAAK,MAAM,MAAM,aAAa,IAAI;AAClC,SAAK,KAAK,MAAM,YAAY,IAAI;AAChC,SAAK,WAAW,MAAM,kBAAkB,IAAI;AAC5C,SAAK,MAAM,MAAM,aAAa,IAAI;AAClC,SAAK,QAAQ,MAAM,eAAe,IAAI;AACtC,SAAK,eAAe,MAAM,sBAAsB,IAAI;AACpD,SAAK,aAAa,MAAM,oBAAoB,IAAI;AAAA,EAClD;AACF;;;AlB/BA,IAAO,gBAAQ;","names":["getList","create","getInfo","renew","setDefault","update","getList","create","getInfo","create","parseListItem","getList","group","getInfo","renew","create","parseListItem","getList","update","create","create","getInfo","getList","setDefault","update","parseListItem","getList","renew"]}
|