@vercel/cli-support 68.3.0 → 68.4.0-snapshot-12a52bb14e02
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{add-LVSBBBNT.js → add-D2RVJIWA.js} +1 -1
- package/dist/chunks/{add-QNZUJVW3.js → add-NNRQGYMJ.js} +1 -1
- package/dist/chunks/{add-6QNDJVXV.js → add-X5BG5K7E.js} +1 -1
- package/dist/chunks/{alerts-TCS56TZU.js → alerts-VIZYTXZW.js} +1 -1
- package/dist/chunks/{build-KKE7LLGT.js → build-6QBDH5NU.js} +1 -1
- package/dist/chunks/{chunk-DPQLHYC5.js → chunk-2KJYAJ5R.js} +1 -1
- package/dist/chunks/{chunk-W6KIUTKO.js → chunk-4CZGKJNW.js} +1 -1
- package/dist/chunks/{chunk-KNQPKVDP.js → chunk-4ESCOWWX.js} +1 -1
- package/dist/chunks/{chunk-MHIH4NVP.js → chunk-5426Z2JE.js} +1 -1
- package/dist/chunks/{chunk-MSKKM36B.js → chunk-5HZOQZZA.js} +1 -1
- package/dist/chunks/{chunk-JZXT53LT.js → chunk-5RP35CP7.js} +1 -1
- package/dist/chunks/{chunk-GJQ3G7OG.js → chunk-5WEPILUN.js} +1 -1
- package/dist/chunks/{chunk-EYH6WGF2.js → chunk-5ZEFNVK4.js} +1 -1
- package/dist/chunks/{chunk-MUJDAD73.js → chunk-6DLSV6MR.js} +4 -4
- package/dist/chunks/{chunk-KTWVMMXL.js → chunk-6DYIE4YH.js} +1 -1
- package/dist/chunks/{chunk-XJVTGNAB.js → chunk-6IHHEJSP.js} +1 -1
- package/dist/chunks/{chunk-GIRRO4QV.js → chunk-7WTYSBYS.js} +1 -1
- package/dist/chunks/{chunk-OHK7TSWE.js → chunk-AAM6ROBN.js} +1 -1
- package/dist/chunks/{chunk-NZU43SVD.js → chunk-ABXP6CZC.js} +1 -1
- package/dist/chunks/{chunk-TTGD6NBN.js → chunk-AD2TGHUA.js} +1 -1
- package/dist/chunks/{chunk-TXQFB44P.js → chunk-BJKRV7BZ.js} +1 -1
- package/dist/chunks/{chunk-DFZRZPCJ.js → chunk-BQ6CQAJV.js} +1 -1
- package/dist/chunks/{chunk-MDSJKFYU.js → chunk-CPLBFAJG.js} +1 -1
- package/dist/chunks/{chunk-ZZTCTVBJ.js → chunk-CZT4KM5Q.js} +1 -1
- package/dist/chunks/{chunk-OCIRBXJK.js → chunk-EKMHS6C7.js} +1 -1
- package/dist/chunks/{chunk-GVQEICZZ.js → chunk-EL4BU63M.js} +1 -1
- package/dist/chunks/{chunk-XTDL6VDZ.js → chunk-FE43D3RY.js} +1 -1
- package/dist/chunks/{chunk-YSOO56PM.js → chunk-G7YTJ7R3.js} +1 -1
- package/dist/chunks/{chunk-I3EXVLOR.js → chunk-GHXTY666.js} +1 -1
- package/dist/chunks/{chunk-GXTN6ATK.js → chunk-GJPJ2PPR.js} +1 -1
- package/dist/chunks/{chunk-YDWOGOYQ.js → chunk-GOVKH2SU.js} +1 -1
- package/dist/chunks/{chunk-4ZZEDEMN.js → chunk-GRVIM22S.js} +1 -1
- package/dist/chunks/{chunk-BSPLBWAX.js → chunk-GS4JE5IQ.js} +1 -1
- package/dist/chunks/{chunk-HOYNGN6Y.js → chunk-HHSDWBZT.js} +1 -1
- package/dist/chunks/{chunk-24L6BDAY.js → chunk-I5REFXOD.js} +1 -1
- package/dist/chunks/{chunk-UL6BYW6P.js → chunk-IVUJSORE.js} +1 -1
- package/dist/chunks/{chunk-6562FIUX.js → chunk-J3V72KJT.js} +1 -1
- package/dist/chunks/{chunk-3TOEU3F6.js → chunk-JX562QLD.js} +1 -1
- package/dist/chunks/{chunk-X2LS3YDZ.js → chunk-JYQASNBC.js} +1 -1
- package/dist/chunks/{chunk-67H6BT7B.js → chunk-KBHH5ZD5.js} +1 -1
- package/dist/chunks/{chunk-FRBBC5I7.js → chunk-KLZMXCMT.js} +1 -1
- package/dist/chunks/{chunk-5VVIXI7N.js → chunk-LEMFN5R3.js} +1 -1
- package/dist/chunks/{chunk-5KLSANRW.js → chunk-LYOMLFWU.js} +1 -1
- package/dist/chunks/{chunk-GROKZBM5.js → chunk-MEKWGM7P.js} +1 -1
- package/dist/chunks/{chunk-FEO3KPCN.js → chunk-NJK6BMRX.js} +2 -2
- package/dist/chunks/{chunk-PYXGCPOE.js → chunk-NU3MHAAM.js} +1 -1
- package/dist/chunks/{chunk-HCFEUT2S.js → chunk-NUQXJEM3.js} +1 -1
- package/dist/chunks/{chunk-2CDYSI2W.js → chunk-NVR7CZXV.js} +1 -1
- package/dist/chunks/{chunk-HH7YFAAX.js → chunk-QIAXQ5E7.js} +1 -1
- package/dist/chunks/{chunk-DSFXR6UL.js → chunk-QJZ32EQI.js} +1 -1
- package/dist/chunks/{chunk-NBMLJM3J.js → chunk-QUCSJ4GA.js} +1 -1
- package/dist/chunks/{chunk-IXRTZRJN.js → chunk-QUDPFC2I.js} +1 -1
- package/dist/chunks/{chunk-LCM7GAHQ.js → chunk-RD752RFM.js} +1 -1
- package/dist/chunks/{chunk-3CK5SHI4.js → chunk-S7CL46EL.js} +1 -1
- package/dist/chunks/{chunk-H3NVQYY6.js → chunk-SAPXVTTO.js} +1 -1
- package/dist/chunks/{chunk-SUZXGVMN.js → chunk-SO5KJGBC.js} +1 -1
- package/dist/chunks/{chunk-HHV7F6W4.js → chunk-U7H33V47.js} +1 -1
- package/dist/chunks/{chunk-SP73R4DW.js → chunk-UVQLLOIX.js} +1 -1
- package/dist/chunks/{chunk-NNYSREF6.js → chunk-UZS7ZVR7.js} +1 -1
- package/dist/chunks/{chunk-V2BCAK3I.js → chunk-V6IXFL2N.js} +1 -1
- package/dist/chunks/{chunk-TTSA4CGZ.js → chunk-WBGU7T5P.js} +1 -1
- package/dist/chunks/{chunk-5NRYTFUS.js → chunk-WKLFESIP.js} +1 -1
- package/dist/chunks/{chunk-N4J3R7KS.js → chunk-XLBELNZD.js} +1 -1
- package/dist/chunks/{chunk-H3K7IR5S.js → chunk-Z5BC4PSX.js} +1 -1
- package/dist/chunks/{chunk-T2DXWRDM.js → chunk-ZDQDXOZR.js} +1 -1
- package/dist/chunks/{chunk-Z7B7PFAR.js → chunk-ZHPUHC7H.js} +2 -2
- package/dist/chunks/{clear-CHK647GV.js → clear-E2QY2YIU.js} +1 -1
- package/dist/chunks/{compile-vercel-config-HAQYXHPB.js → compile-vercel-config-Q3UIMEYG.js} +1 -1
- package/dist/chunks/{config-X6N2ECGU.js → config-4RQZE3FO.js} +1 -1
- package/dist/chunks/{config-ROLBZC3E.js → config-T7YMSL26.js} +1 -1
- package/dist/chunks/{delete-MC7BC7NX.js → delete-HH6FFUHB.js} +1 -1
- package/dist/chunks/{delete-A3ZN3JL2.js → delete-RR44WMDV.js} +1 -1
- package/dist/chunks/{describe-MF3QA4XP.js → describe-Y7OHZYFR.js} +1 -1
- package/dist/chunks/{detect-services-V6P6RNRY.js → detect-services-HE7JZAIS.js} +1 -1
- package/dist/chunks/{disable-GKANXOTL.js → disable-EYYJLVBO.js} +1 -1
- package/dist/chunks/{discard-2WY2RBN3.js → discard-WTZ7YRJK.js} +1 -1
- package/dist/chunks/{edit-DXAJX6I2.js → edit-DHBSFSKX.js} +1 -1
- package/dist/chunks/{edit-U4VYAWI2.js → edit-VE27DQG2.js} +1 -1
- package/dist/chunks/{enable-LLHUA7RH.js → enable-BEYYBDLQ.js} +1 -1
- package/dist/chunks/{export-4DW4AQ46.js → export-GMMD2WFZ.js} +1 -1
- package/dist/chunks/{future-WJEMZHER.js → future-O5RVBPBM.js} +1 -1
- package/dist/chunks/{generate-cert-for-deploy-EHPJUMRI.js → generate-cert-for-deploy-SPK4RZB7.js} +1 -1
- package/dist/chunks/{group-actions-MVWNYISJ.js → group-actions-KRESFEUS.js} +1 -1
- package/dist/chunks/{image-XXG2UE6K.js → image-KQTEYWEC.js} +1 -1
- package/dist/chunks/{import-builders-JZ2W4AKZ.js → import-builders-MZCCQIVY.js} +1 -1
- package/dist/chunks/{inspect-23F7OG7O.js → inspect-3AD2PDIN.js} +1 -1
- package/dist/chunks/{inspect-CMX764GE.js → inspect-FJAUC2CH.js} +1 -1
- package/dist/chunks/{inspect-2YUBT5J7.js → inspect-LRAQ3R2D.js} +1 -1
- package/dist/chunks/{inspect-NIW6SLTJ.js → inspect-T4S2RNCA.js} +1 -1
- package/dist/chunks/{inspect-FBFB4673.js → inspect-UYUST4YR.js} +1 -1
- package/dist/chunks/{list-4HCIH7ZT.js → list-DHKWGQVS.js} +1 -1
- package/dist/chunks/{list-LBLSWS4G.js → list-T3KR5JK5.js} +1 -1
- package/dist/chunks/{list-5EN5BQGX.js → list-U7ALJAHR.js} +1 -1
- package/dist/chunks/{login-FCE6ZNVP.js → login-E2E7A3JG.js} +1 -1
- package/dist/chunks/{login-7B6WUTZA.js → login-VHOSHZ4C.js} +1 -1
- package/dist/chunks/{logs-UCFAA573.js → logs-65QXVNTD.js} +1 -1
- package/dist/chunks/{ls-AFD7VVPV.js → ls-AUW2OT4A.js} +1 -1
- package/dist/chunks/{ls-JF5IEJRG.js → ls-C5TSPC7C.js} +1 -1
- package/dist/chunks/{ls-VX6NJEQ5.js → ls-G3UDAUFP.js} +1 -1
- package/dist/chunks/{ls-M3AULXSF.js → ls-LOEQMD63.js} +1 -1
- package/dist/chunks/{ls-22KCD6XH.js → ls-QBD45VI4.js} +1 -1
- package/dist/chunks/{ls-74UF3GAZ.js → ls-U5IZPT7S.js} +1 -1
- package/dist/chunks/{ls-TZVW6K64.js → ls-ZNBYGUOO.js} +1 -1
- package/dist/chunks/{migrate-experimental-services-DPLTGN7G.js → migrate-experimental-services-FBEYFPS5.js} +1 -1
- package/dist/chunks/{mutate-ANP4MINN.js → mutate-ESBM5LRQ.js} +1 -1
- package/dist/chunks/{notifications-ZLM75IM7.js → notifications-7D3TVPGL.js} +1 -1
- package/dist/chunks/{open-BTVG7PAR.js → open-4KWLVSCN.js} +1 -1
- package/dist/chunks/{permissions-R2VXNC7P.js → permissions-AGJCRYBT.js} +1 -1
- package/dist/chunks/{plugin-offer-TOGG57CN.js → plugin-offer-B2M2K6ND.js} +1 -1
- package/dist/chunks/{prompt-missing-credentials-M3MJ23CT.js → prompt-missing-credentials-NK2LVTLD.js} +1 -1
- package/dist/chunks/{publish-ZE5QH5IK.js → publish-U64BOK7P.js} +1 -1
- package/dist/chunks/{pull-THZVVRD5.js → pull-E76DBNKF.js} +1 -1
- package/dist/chunks/{purchase-domain-if-available-JCYJIHA3.js → purchase-domain-if-available-UCAVWKBZ.js} +1 -1
- package/dist/chunks/{push-3IMAJJIA.js → push-H3SF3QIY.js} +1 -1
- package/dist/chunks/{query-JS46X4HV.js → query-GYIMXS6L.js} +1 -1
- package/dist/chunks/{raw-query-4K6JHAQG.js → raw-query-BNKDA4IK.js} +1 -1
- package/dist/chunks/{reauthenticate-5WD77AFG.js → reauthenticate-2DCO4INA.js} +1 -1
- package/dist/chunks/{remove-KOF4XIZ7.js → remove-HF2GZCIK.js} +1 -1
- package/dist/chunks/{reorder-3NXXZRZO.js → reorder-UBEPKIWG.js} +1 -1
- package/dist/chunks/{reply-JNYYMJN5.js → reply-HI3WFA2M.js} +1 -1
- package/dist/chunks/{resolve-RGGB7NDY.js → resolve-W2DL5JG2.js} +1 -1
- package/dist/chunks/{resolve-agent-team-ZB6AGD4A.js → resolve-agent-team-SO3F25DJ.js} +1 -1
- package/dist/chunks/{restore-7TLQ4OQL.js → restore-36KMCOTN.js} +1 -1
- package/dist/chunks/{rm-NUEUIXWD.js → rm-CVYH6MYF.js} +1 -1
- package/dist/chunks/{rm-GKRLNTNG.js → rm-DDHPGAMJ.js} +1 -1
- package/dist/chunks/{rm-TR7263R7.js → rm-Q2K5LZL6.js} +1 -1
- package/dist/chunks/{rm-GG4YAYEG.js → rm-R2ZHIF3V.js} +1 -1
- package/dist/chunks/{rm-LVENOOH4.js → rm-UACAV5IJ.js} +1 -1
- package/dist/chunks/{rule-inspect-7VXXJWNZ.js → rule-inspect-YU5L7PRZ.js} +1 -1
- package/dist/chunks/{schema-LZGI5ZTU.js → schema-CCADGZ24.js} +1 -1
- package/dist/chunks/{schema-HCNHCZ3R.js → schema-PNIIEG36.js} +1 -1
- package/dist/chunks/{select-org-HKSE2YDF.js → select-org-BC733EUT.js} +1 -1
- package/dist/chunks/{set-7UNVXHZM.js → set-AURC7UX5.js} +1 -1
- package/dist/chunks/{setup-and-link-L47YL6MP.js → setup-and-link-6BLHO3WH.js} +1 -1
- package/dist/chunks/{tags-NXBLJZJF.js → tags-NNXRQPVV.js} +1 -1
- package/dist/chunks/{update-BCBWJ565.js → update-7CW2XQSW.js} +1 -1
- package/dist/chunks/{usage-G4CJ3ZOH.js → usage-A7K3CN7K.js} +1 -1
- package/dist/chunks/{views-QU3K2TSP.js → views-OC2PB7RL.js} +1 -1
- package/dist/commands/build/index.js +1 -1
- package/dist/commands/deploy/index.js +5 -5
- package/dist/commands/dev/index.js +4 -4
- package/dist/commands/env/index.js +1 -1
- package/dist/commands/link/index.js +1 -1
- package/dist/commands/list/index.js +1 -1
- package/dist/commands/project/index.js +1 -1
- package/dist/commands/tunnel/index.js +1 -1
- package/dist/commands-account.js +2 -2
- package/dist/commands-ai.js +1 -1
- package/dist/commands-blob.js +1 -1
- package/dist/commands-core.js +16 -24
- package/dist/commands-deployments.js +1 -1
- package/dist/commands-flags.js +1 -1
- package/dist/commands-integrations.js +1 -1
- package/dist/commands-observability.js +2 -2
- package/dist/commands-routing.js +2 -2
- package/dist/index.js +3 -3
- package/dist/internal-build.js +1 -1
- package/dist/package.json +40 -40
- package/dist/version.mjs +1 -1
- package/package.json +42 -42
|
@@ -4,7 +4,7 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{isGuidanceEnabled}from"./chunk-TAAWMNNL.js";import{jsonNextStep,writeJsonFailure}from"./chunk-
|
|
7
|
+
import{isGuidanceEnabled}from"./chunk-TAAWMNNL.js";import{jsonNextStep,writeJsonFailure}from"./chunk-6DLSV6MR.js";import{ua_default}from"./chunk-QRPBDCDH.js";import{fetch}from"./chunk-MY4MONOH.js";import{AGENT_REASON,AGENT_STATUS,getExitCodeForReason,omitGlobalFlagsFromArgs}from"./chunk-3QTP26QS.js";import{output_manager_default}from"./chunk-RIXTYUYN.js";import{remoteText}from"./chunk-AUCQKYL2.js";import{require_source}from"./chunk-UJ7YUIEJ.js";import{__toESM}from"./chunk-NBPLUP7C.js";var import_chalk=__toESM(require_source(),1);function styledCommand(step){return step.template?step.command:import_chalk.default.cyan(step.command)}function formatNextSteps(steps){if(steps.length===0)return"";if(steps.length===1)return`
|
|
8
8
|
${steps[0].label}:
|
|
9
9
|
${styledCommand(steps[0])}
|
|
10
10
|
`;let list=steps.map(step=>` ${step.label}:
|
|
@@ -4,7 +4,7 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{require_cjs}from"./chunk-SUZXGVMN.js";import{CONTACT_FIELDS,billingFieldsUsed,collectContactInformation,getBillingContact,getDomainPrice,getDomainStatus,isPurchasedSince,mergeContact,missingContactFields,purchaseDomain,readContactFlags}from"./chunk-HHV7F6W4.js";import{stamp_default}from"./chunk-LY3EY2VG.js";import{amountMatchesPrice,canPromptForCharge,chargeFailureReason,chargeFlagWithValue,formatAmountArg,formatTerm,orderStatusStep,parseAmount,parseOrderWait,printChargeRecovery,refuseUnnamedTeam,reportChargeFailure,reportOrderPending,reportPriceChanged,reportUnknownOutcome,reportUsageError,trackApprovalOutcome,writeChargeAction}from"./chunk-5NRYTFUS.js";import{formatUsd}from"./chunk-ZUWIJMH2.js";import{param}from"./chunk-ERMHTPO4.js";import{buySubcommand}from"./chunk-DFZRZPCJ.js";import{getScope}from"./chunk-3TOEU3F6.js";import{TelemetryClient}from"./chunk-QROPMCL2.js";import{printError}from"./chunk-QI7BWXRV.js";import{parseArguments}from"./chunk-E7ICSU45.js";import{AGENT_ACTION,AGENT_REASON,AGENT_STATUS,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-3QTP26QS.js";import{validateJsonOutput}from"./chunk-BDLZ6WL2.js";import{DomainChargeOutcomeUnknown,DomainPaymentAuthenticationRequired,DomainPriceChanged,DomainPurchaseInProgress,isAPIError}from"./chunk-UNAQQ5DF.js";import{getCommandName,getCommandNamePlain}from"./chunk-EFGZK6OY.js";import{output_manager_default,recordCliError}from"./chunk-RIXTYUYN.js";import{require_dist}from"./chunk-4SIQE2W4.js";import{getFlagsSpecification,getGlobalFlagsFromArgs,quoteArg}from"./chunk-CUO3CYU3.js";import{require_source}from"./chunk-UJ7YUIEJ.js";import{require_strip_ansi}from"./chunk-LPYHYTYI.js";import{__toESM}from"./chunk-NBPLUP7C.js";var import_chalk=__toESM(require_source(),1),import_strip_ansi=__toESM(require_strip_ansi(),1),import_tldts=__toESM(require_cjs(),1),import_error_utils=__toESM(require_dist(),1);var DomainsBuyTelemetryClient=class extends TelemetryClient{trackCliArgumentDomain(v){v&&this.trackCliArgument({arg:"domain",value:this.redactedValue})}trackCliOptionAmount(v){this.trackRedactedCliOption("amount",v)}trackCliFlagUseBillingDetails(v){v&&this.trackCliFlag("use-billing-details")}trackCliOptionFirstName(v){this.trackRedactedCliOption("first-name",v)}trackCliOptionLastName(v){this.trackRedactedCliOption("last-name",v)}trackCliOptionEmail(v){this.trackRedactedCliOption("email",v)}trackCliOptionPhone(v){this.trackRedactedCliOption("phone",v)}trackCliOptionAddress(v){this.trackRedactedCliOption("address",v)}trackCliOptionCity(v){this.trackRedactedCliOption("city",v)}trackCliOptionState(v){this.trackRedactedCliOption("state",v)}trackCliOptionZip(v){this.trackRedactedCliOption("zip",v)}trackCliOptionCountry(v){this.trackRedactedCliOption("country",v)}trackCliOptionCompany(v){this.trackRedactedCliOption("company",v)}trackCliFlagAutoRenew(v){v&&this.trackCliFlag("auto-renew")}trackCliFlagNoAutoRenew(v){v&&this.trackCliFlag("no-auto-renew")}trackCliFlagJson(v){v&&this.trackCliFlag("json")}trackCliOptionTimeout(timeout){timeout&&this.trackCliOption({option:"timeout",value:"[TIME]"})}trackCliFlagNoWait(noWait){noWait&&this.trackCliFlag("no-wait")}};function buildBuyCommand(client,domain,opts){let parts=[`domains buy ${domain}`];opts.team&&parts.push(`--scope ${opts.team}`),opts.amount!==void 0&&parts.push(`--amount ${formatAmountArg(opts.amount)}`),opts.useBilling&&parts.push("--use-billing-details");for(let{field,flag}of CONTACT_FIELDS){let value=opts.contact[field];value!==void 0?parts.push(`${flag} ${quoteArg(value)}`):opts.missing.includes(field)&&parts.push(`${flag} <${flag.slice(2)}>`)}return opts.autoRenew===!0&&parts.push("--auto-renew"),opts.autoRenew===!1&&parts.push("--no-auto-renew"),opts.wait?.noWait?parts.push("--no-wait"):opts.wait?.timeout&&parts.push(`--timeout ${quoteArg(opts.wait.timeout)}`),opts.json&&parts.push("--json"),buildCommandWithGlobalFlags(client.argv,parts.join(" "))}function flagFor(field){return CONTACT_FIELDS.find(f=>f.field===field).flag}function usageError(client,message){return reportUsageError(client,AGENT_REASON.INVALID_ARGUMENTS,message)}async function buy(client,argv){let telemetry=new DomainsBuyTelemetryClient({opts:{store:client.telemetryEventStore}}),parsedArgs,flagsSpecification=getFlagsSpecification(buySubcommand.options);try{parsedArgs=parseArguments(argv,flagsSpecification)}catch(error){return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"invalid_arguments",message:error instanceof Error?error.message:String(error)},2),printError(error),2}let{args,flags}=parsedArgs,[domainName]=args;if(telemetry.trackCliArgumentDomain(domainName),telemetry.trackCliOptionAmount(flags["--amount"]),telemetry.trackCliFlagUseBillingDetails(flags["--use-billing-details"]),telemetry.trackCliOptionFirstName(flags["--first-name"]),telemetry.trackCliOptionLastName(flags["--last-name"]),telemetry.trackCliOptionEmail(flags["--email"]),telemetry.trackCliOptionPhone(flags["--phone"]),telemetry.trackCliOptionAddress(flags["--address"]),telemetry.trackCliOptionCity(flags["--city"]),telemetry.trackCliOptionState(flags["--state"]),telemetry.trackCliOptionZip(flags["--zip"]),telemetry.trackCliOptionCountry(flags["--country"]),telemetry.trackCliOptionCompany(flags["--company"]),telemetry.trackCliFlagAutoRenew(flags["--auto-renew"]),telemetry.trackCliFlagNoAutoRenew(flags["--no-auto-renew"]),telemetry.trackCliOptionTimeout(flags["--timeout"]),telemetry.trackCliFlagNoWait(flags["--no-wait"]),telemetry.trackCliOptionFormat(flags["--format"]),telemetry.trackCliFlagJson(flags["--json"]),!domainName){if(client.nonInteractive){let globalFlags=getGlobalFlagsFromArgs(client.argv.slice(2)),cmd=getCommandNamePlain(`domains buy <domain> ${globalFlags.join(" ")}`.trim());outputAgentError(client,{status:"error",reason:"missing_arguments",message:`Missing domain name. Run: ${cmd}`,next:[{command:cmd,when:"Replace <domain> with the domain to buy"}]},2)}return recordCliError({code:AGENT_REASON.MISSING_ARGUMENTS}),output_manager_default.error(`Missing domain name. Run ${getCommandName("domains --help")}`),2}if(args.length>1){let extra=args[1].toLowerCase();return usageError(client,extra==="true"||extra==="false"?"Unexpected extra argument. On/off options like --auto-renew don't take a value: pass --auto-renew or --no-auto-renew.":'Unexpected extra argument. domains buy takes one domain; quote option values that contain spaces, like --address "1 Main St".')}let formatResult=validateJsonOutput(flags);if(!formatResult.valid)return usageError(client,formatResult.error);let asJson=formatResult.jsonOutput,{domain:rootDomain,subdomain}=(0,import_tldts.parse)(domainName);if(subdomain||!rootDomain)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"invalid_domain",message:`Invalid domain name '${domainName}'. Use a registrable root domain (no subdomain).`},1),recordCliError({code:AGENT_REASON.INVALID_DOMAIN}),output_manager_default.error(`Invalid domain name "${domainName}". Run ${getCommandName("domains --help")}`),1;let amount=parseAmount(flags["--amount"]);if(amount instanceof Error)return usageError(client,amount.message);let wait=parseOrderWait(flags);if(typeof wait=="string")return usageError(client,wait);let fromFlags=readContactFlags(flags);if(typeof fromFlags=="string")return usageError(client,fromFlags);let valuedFlag=chargeFlagWithValue(argv,["--auto-renew","--no-auto-renew","--use-billing-details"]);if(valuedFlag)return usageError(client,valuedFlag);let useBilling=!!flags["--use-billing-details"];if(flags["--auto-renew"]&&flags["--no-auto-renew"])return usageError(client,"Can't use --auto-renew with --no-auto-renew.");let autoRenewChoice=flags["--auto-renew"]?!0:flags["--no-auto-renew"]?!1:void 0,{contextName,team}=await getScope(client),commandOptions={team:team?.slug,useBilling,contact:fromFlags,autoRenew:autoRenewChoice,wait:{noWait:wait.noWait,timeout:flags["--timeout"]===void 0?void 0:wait.timeout},json:asJson},availableStamp=stamp_default(),[domainPrice,domainStatus]=await Promise.all([getDomainPrice(client,domainName),getDomainStatus(client,domainName)]);if(!domainStatus.available){if(await isPurchasedSince(client,domainName,0)){if(!canPromptForCharge(client,asJson)&&team){let refused=refuseUnnamedTeam(client,asJson,{verb:"buy",domain:domainName,team,nextCommand:buildBuyCommand(client,domainName,{...commandOptions,amount,missing:[]})});if(refused!==void 0)return refused}return reportAlreadyOwned(client,asJson,domainName,contextName,{autoRenew:autoRenewChoice})}return reportChargeFailure(client,asJson,{reason:AGENT_REASON.DOMAIN_NOT_AVAILABLE,message:`The domain ${domainName} is unavailable.`})}if(domainPrice instanceof Error)return reportChargeFailure(client,asJson,{reason:chargeFailureReason(domainPrice),message:domainPrice.message});let{years,purchasePrice,renewalPrice}=domainPrice;if(purchasePrice===null||renewalPrice===null)return reportChargeFailure(client,asJson,{reason:AGENT_REASON.API_ERROR,message:`The price of ${domainName} was not found.`});output_manager_default.log(`The domain ${param(domainName)} is ${import_chalk.default.underline("available")} to buy under ${import_chalk.default.bold(contextName)}! ${availableStamp()}`);let billing=getBillingContact(team),contact=mergeContact(fromFlags,useBilling?billing:{});if(amount!==void 0&&!amountMatchesPrice(amount,purchasePrice))return reportPriceChanged(client,{verb:"buy",domain:domainName,amount,price:purchasePrice,nextCommand:buildBuyCommand(client,domainName,{...commandOptions,amount:purchasePrice,missing:missingContactFields(contact)}),json:asJson});let autoRenew,contactInformation;if(canPromptForCharge(client,asJson)){if(amount===void 0&&!await client.input.confirm(`Buy now for ${import_chalk.default.bold(formatUsd(purchasePrice))} (${formatTerm(years)})?`,!1))return trackApprovalOutcome(client,"purchase","declined"),0;autoRenew=autoRenewChoice??await client.input.confirm(years===1?`Auto renew yearly for ${import_chalk.default.bold(formatUsd(renewalPrice))}?`:`Auto renew every ${years} years for ${import_chalk.default.bold(formatUsd(renewalPrice))}?`,!0),contactInformation=await collectContactInformation(client,{provided:contact,defaults:mergeContact(fromFlags,billing)})}else{let missing=missingContactFields(contact);if(amount===void 0||missing.length>0||autoRenewChoice===void 0)return refuseWithoutApproval(client,{domain:domainName,team:team?.slug,contextName,price:purchasePrice,renewalPrice,years,amount,fromFlags,billing,useBilling,autoRenew:autoRenewChoice,wait:commandOptions.wait,json:asJson});if(team){let refused=refuseUnnamedTeam(client,asJson,{verb:"buy",domain:domainName,team,nextCommand:buildBuyCommand(client,domainName,{...commandOptions,amount,missing:[]})});if(refused!==void 0)return refused}autoRenew=autoRenewChoice,contactInformation={...contact,companyName:contact.companyName||void 0}}let inspectCommand=buildCommandWithGlobalFlags(client.argv,`domains inspect ${domainName}`),buyResult,purchaseStamp=stamp_default();output_manager_default.spinner("Purchasing");try{buyResult=await purchaseDomain(client,domainName,purchasePrice,years,autoRenew,contactInformation,{waitMs:wait.waitMs,onOrderAccepted:orderId=>{asJson||wait.noWait||(output_manager_default.stopSpinner(),output_manager_default.log(`Order ${orderId} accepted.`),output_manager_default.spinner(`Waiting on the registrar to register ${domainName}`))}})}catch(err){output_manager_default.stopSpinner(),output_manager_default.debug(`Server response: ${(0,import_error_utils.errorToString)(err)}`);let apiError=isAPIError(err)?err:void 0;return reportChargeFailure(client,asJson,{reason:AGENT_REASON.API_ERROR,message:apiError?`Couldn't buy ${domainName}. The API returned an error (${apiError.code}). Nothing was charged.`:`Couldn't buy ${domainName}. The order wasn't sent, so nothing was charged.`},{apiMessage:apiError?.serverMessage})}if(output_manager_default.stopSpinner(),buyResult instanceof DomainPriceChanged)return reportPriceChanged(client,{verb:"buy",domain:domainName,amount:purchasePrice,nextCommand:buildBuyCommand(client,domainName,{...commandOptions,missing:[]}),json:asJson});if(buyResult instanceof DomainChargeOutcomeUnknown)return reportUnknownOutcome(client,asJson,{verb:"buy",domain:domainName,inspectCommand,cause:buyResult.meta.cause,orderId:buyResult.meta.orderId});if(buyResult instanceof DomainPurchaseInProgress){let{orderId}=buyResult.meta;return reportChargeFailure(client,asJson,{reason:AGENT_REASON.PURCHASE_IN_PROGRESS,message:buyResult.message,retryable:!1,data:{domain:domainName,remote:"none",...orderId&&{orderId}},next:[...orderId?[orderStatusStep(client,{verb:"buy",domain:domainName,orderId})]:[],{command:inspectCommand,when:"Once that order finishes, see the domain"}]})}return buyResult instanceof DomainPaymentAuthenticationRequired?reportChargeFailure(client,asJson,{reason:AGENT_REASON.PAYMENT_AUTHENTICATION_REQUIRED,message:buyResult.message,userActionRequired:!0,verification_uri:buyResult.meta.url}):buyResult instanceof Error?reportChargeFailure(client,asJson,{reason:chargeFailureReason(buyResult),message:buyResult.message}):buyResult.status==="already_owned"?reportAlreadyOwned(client,asJson,domainName,contextName,{autoRenew,duplicate:{orderId:buyResult.orderId,orderOutcome:buyResult.orderOutcome}}):buyResult.status==="pending"?reportOrderPending(client,asJson,{verb:"buy",domain:domainName,orderId:buyResult.orderId,lastStatus:buyResult.lastStatus,readError:buyResult.readError,inspectCommand,wait}):asJson?(client.stdout.write(`${JSON.stringify({status:AGENT_STATUS.OK,domain:domainName,years,charge:{amount:purchasePrice,currency:"USD"},orderId:buyResult.orderId,autoRenew,renewalPrice,message:`Domain ${domainName} purchased.`},null,2)}
|
|
7
|
+
import{require_cjs}from"./chunk-SO5KJGBC.js";import{CONTACT_FIELDS,billingFieldsUsed,collectContactInformation,getBillingContact,getDomainPrice,getDomainStatus,isPurchasedSince,mergeContact,missingContactFields,purchaseDomain,readContactFlags}from"./chunk-U7H33V47.js";import{stamp_default}from"./chunk-LY3EY2VG.js";import{amountMatchesPrice,canPromptForCharge,chargeFailureReason,chargeFlagWithValue,formatAmountArg,formatTerm,orderStatusStep,parseAmount,parseOrderWait,printChargeRecovery,refuseUnnamedTeam,reportChargeFailure,reportOrderPending,reportPriceChanged,reportUnknownOutcome,reportUsageError,trackApprovalOutcome,writeChargeAction}from"./chunk-WKLFESIP.js";import{formatUsd}from"./chunk-ZUWIJMH2.js";import{param}from"./chunk-ERMHTPO4.js";import{buySubcommand}from"./chunk-BQ6CQAJV.js";import{getScope}from"./chunk-JX562QLD.js";import{TelemetryClient}from"./chunk-QROPMCL2.js";import{printError}from"./chunk-QI7BWXRV.js";import{parseArguments}from"./chunk-E7ICSU45.js";import{AGENT_ACTION,AGENT_REASON,AGENT_STATUS,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-3QTP26QS.js";import{validateJsonOutput}from"./chunk-BDLZ6WL2.js";import{DomainChargeOutcomeUnknown,DomainPaymentAuthenticationRequired,DomainPriceChanged,DomainPurchaseInProgress,isAPIError}from"./chunk-UNAQQ5DF.js";import{getCommandName,getCommandNamePlain}from"./chunk-EFGZK6OY.js";import{output_manager_default,recordCliError}from"./chunk-RIXTYUYN.js";import{require_dist}from"./chunk-4SIQE2W4.js";import{getFlagsSpecification,getGlobalFlagsFromArgs,quoteArg}from"./chunk-CUO3CYU3.js";import{require_source}from"./chunk-UJ7YUIEJ.js";import{require_strip_ansi}from"./chunk-LPYHYTYI.js";import{__toESM}from"./chunk-NBPLUP7C.js";var import_chalk=__toESM(require_source(),1),import_strip_ansi=__toESM(require_strip_ansi(),1),import_tldts=__toESM(require_cjs(),1),import_error_utils=__toESM(require_dist(),1);var DomainsBuyTelemetryClient=class extends TelemetryClient{trackCliArgumentDomain(v){v&&this.trackCliArgument({arg:"domain",value:this.redactedValue})}trackCliOptionAmount(v){this.trackRedactedCliOption("amount",v)}trackCliFlagUseBillingDetails(v){v&&this.trackCliFlag("use-billing-details")}trackCliOptionFirstName(v){this.trackRedactedCliOption("first-name",v)}trackCliOptionLastName(v){this.trackRedactedCliOption("last-name",v)}trackCliOptionEmail(v){this.trackRedactedCliOption("email",v)}trackCliOptionPhone(v){this.trackRedactedCliOption("phone",v)}trackCliOptionAddress(v){this.trackRedactedCliOption("address",v)}trackCliOptionCity(v){this.trackRedactedCliOption("city",v)}trackCliOptionState(v){this.trackRedactedCliOption("state",v)}trackCliOptionZip(v){this.trackRedactedCliOption("zip",v)}trackCliOptionCountry(v){this.trackRedactedCliOption("country",v)}trackCliOptionCompany(v){this.trackRedactedCliOption("company",v)}trackCliFlagAutoRenew(v){v&&this.trackCliFlag("auto-renew")}trackCliFlagNoAutoRenew(v){v&&this.trackCliFlag("no-auto-renew")}trackCliFlagJson(v){v&&this.trackCliFlag("json")}trackCliOptionTimeout(timeout){timeout&&this.trackCliOption({option:"timeout",value:"[TIME]"})}trackCliFlagNoWait(noWait){noWait&&this.trackCliFlag("no-wait")}};function buildBuyCommand(client,domain,opts){let parts=[`domains buy ${domain}`];opts.team&&parts.push(`--scope ${opts.team}`),opts.amount!==void 0&&parts.push(`--amount ${formatAmountArg(opts.amount)}`),opts.useBilling&&parts.push("--use-billing-details");for(let{field,flag}of CONTACT_FIELDS){let value=opts.contact[field];value!==void 0?parts.push(`${flag} ${quoteArg(value)}`):opts.missing.includes(field)&&parts.push(`${flag} <${flag.slice(2)}>`)}return opts.autoRenew===!0&&parts.push("--auto-renew"),opts.autoRenew===!1&&parts.push("--no-auto-renew"),opts.wait?.noWait?parts.push("--no-wait"):opts.wait?.timeout&&parts.push(`--timeout ${quoteArg(opts.wait.timeout)}`),opts.json&&parts.push("--json"),buildCommandWithGlobalFlags(client.argv,parts.join(" "))}function flagFor(field){return CONTACT_FIELDS.find(f=>f.field===field).flag}function usageError(client,message){return reportUsageError(client,AGENT_REASON.INVALID_ARGUMENTS,message)}async function buy(client,argv){let telemetry=new DomainsBuyTelemetryClient({opts:{store:client.telemetryEventStore}}),parsedArgs,flagsSpecification=getFlagsSpecification(buySubcommand.options);try{parsedArgs=parseArguments(argv,flagsSpecification)}catch(error){return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"invalid_arguments",message:error instanceof Error?error.message:String(error)},2),printError(error),2}let{args,flags}=parsedArgs,[domainName]=args;if(telemetry.trackCliArgumentDomain(domainName),telemetry.trackCliOptionAmount(flags["--amount"]),telemetry.trackCliFlagUseBillingDetails(flags["--use-billing-details"]),telemetry.trackCliOptionFirstName(flags["--first-name"]),telemetry.trackCliOptionLastName(flags["--last-name"]),telemetry.trackCliOptionEmail(flags["--email"]),telemetry.trackCliOptionPhone(flags["--phone"]),telemetry.trackCliOptionAddress(flags["--address"]),telemetry.trackCliOptionCity(flags["--city"]),telemetry.trackCliOptionState(flags["--state"]),telemetry.trackCliOptionZip(flags["--zip"]),telemetry.trackCliOptionCountry(flags["--country"]),telemetry.trackCliOptionCompany(flags["--company"]),telemetry.trackCliFlagAutoRenew(flags["--auto-renew"]),telemetry.trackCliFlagNoAutoRenew(flags["--no-auto-renew"]),telemetry.trackCliOptionTimeout(flags["--timeout"]),telemetry.trackCliFlagNoWait(flags["--no-wait"]),telemetry.trackCliOptionFormat(flags["--format"]),telemetry.trackCliFlagJson(flags["--json"]),!domainName){if(client.nonInteractive){let globalFlags=getGlobalFlagsFromArgs(client.argv.slice(2)),cmd=getCommandNamePlain(`domains buy <domain> ${globalFlags.join(" ")}`.trim());outputAgentError(client,{status:"error",reason:"missing_arguments",message:`Missing domain name. Run: ${cmd}`,next:[{command:cmd,when:"Replace <domain> with the domain to buy"}]},2)}return recordCliError({code:AGENT_REASON.MISSING_ARGUMENTS}),output_manager_default.error(`Missing domain name. Run ${getCommandName("domains --help")}`),2}if(args.length>1){let extra=args[1].toLowerCase();return usageError(client,extra==="true"||extra==="false"?"Unexpected extra argument. On/off options like --auto-renew don't take a value: pass --auto-renew or --no-auto-renew.":'Unexpected extra argument. domains buy takes one domain; quote option values that contain spaces, like --address "1 Main St".')}let formatResult=validateJsonOutput(flags);if(!formatResult.valid)return usageError(client,formatResult.error);let asJson=formatResult.jsonOutput,{domain:rootDomain,subdomain}=(0,import_tldts.parse)(domainName);if(subdomain||!rootDomain)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"invalid_domain",message:`Invalid domain name '${domainName}'. Use a registrable root domain (no subdomain).`},1),recordCliError({code:AGENT_REASON.INVALID_DOMAIN}),output_manager_default.error(`Invalid domain name "${domainName}". Run ${getCommandName("domains --help")}`),1;let amount=parseAmount(flags["--amount"]);if(amount instanceof Error)return usageError(client,amount.message);let wait=parseOrderWait(flags);if(typeof wait=="string")return usageError(client,wait);let fromFlags=readContactFlags(flags);if(typeof fromFlags=="string")return usageError(client,fromFlags);let valuedFlag=chargeFlagWithValue(argv,["--auto-renew","--no-auto-renew","--use-billing-details"]);if(valuedFlag)return usageError(client,valuedFlag);let useBilling=!!flags["--use-billing-details"];if(flags["--auto-renew"]&&flags["--no-auto-renew"])return usageError(client,"Can't use --auto-renew with --no-auto-renew.");let autoRenewChoice=flags["--auto-renew"]?!0:flags["--no-auto-renew"]?!1:void 0,{contextName,team}=await getScope(client),commandOptions={team:team?.slug,useBilling,contact:fromFlags,autoRenew:autoRenewChoice,wait:{noWait:wait.noWait,timeout:flags["--timeout"]===void 0?void 0:wait.timeout},json:asJson},availableStamp=stamp_default(),[domainPrice,domainStatus]=await Promise.all([getDomainPrice(client,domainName),getDomainStatus(client,domainName)]);if(!domainStatus.available){if(await isPurchasedSince(client,domainName,0)){if(!canPromptForCharge(client,asJson)&&team){let refused=refuseUnnamedTeam(client,asJson,{verb:"buy",domain:domainName,team,nextCommand:buildBuyCommand(client,domainName,{...commandOptions,amount,missing:[]})});if(refused!==void 0)return refused}return reportAlreadyOwned(client,asJson,domainName,contextName,{autoRenew:autoRenewChoice})}return reportChargeFailure(client,asJson,{reason:AGENT_REASON.DOMAIN_NOT_AVAILABLE,message:`The domain ${domainName} is unavailable.`})}if(domainPrice instanceof Error)return reportChargeFailure(client,asJson,{reason:chargeFailureReason(domainPrice),message:domainPrice.message});let{years,purchasePrice,renewalPrice}=domainPrice;if(purchasePrice===null||renewalPrice===null)return reportChargeFailure(client,asJson,{reason:AGENT_REASON.API_ERROR,message:`The price of ${domainName} was not found.`});output_manager_default.log(`The domain ${param(domainName)} is ${import_chalk.default.underline("available")} to buy under ${import_chalk.default.bold(contextName)}! ${availableStamp()}`);let billing=getBillingContact(team),contact=mergeContact(fromFlags,useBilling?billing:{});if(amount!==void 0&&!amountMatchesPrice(amount,purchasePrice))return reportPriceChanged(client,{verb:"buy",domain:domainName,amount,price:purchasePrice,nextCommand:buildBuyCommand(client,domainName,{...commandOptions,amount:purchasePrice,missing:missingContactFields(contact)}),json:asJson});let autoRenew,contactInformation;if(canPromptForCharge(client,asJson)){if(amount===void 0&&!await client.input.confirm(`Buy now for ${import_chalk.default.bold(formatUsd(purchasePrice))} (${formatTerm(years)})?`,!1))return trackApprovalOutcome(client,"purchase","declined"),0;autoRenew=autoRenewChoice??await client.input.confirm(years===1?`Auto renew yearly for ${import_chalk.default.bold(formatUsd(renewalPrice))}?`:`Auto renew every ${years} years for ${import_chalk.default.bold(formatUsd(renewalPrice))}?`,!0),contactInformation=await collectContactInformation(client,{provided:contact,defaults:mergeContact(fromFlags,billing)})}else{let missing=missingContactFields(contact);if(amount===void 0||missing.length>0||autoRenewChoice===void 0)return refuseWithoutApproval(client,{domain:domainName,team:team?.slug,contextName,price:purchasePrice,renewalPrice,years,amount,fromFlags,billing,useBilling,autoRenew:autoRenewChoice,wait:commandOptions.wait,json:asJson});if(team){let refused=refuseUnnamedTeam(client,asJson,{verb:"buy",domain:domainName,team,nextCommand:buildBuyCommand(client,domainName,{...commandOptions,amount,missing:[]})});if(refused!==void 0)return refused}autoRenew=autoRenewChoice,contactInformation={...contact,companyName:contact.companyName||void 0}}let inspectCommand=buildCommandWithGlobalFlags(client.argv,`domains inspect ${domainName}`),buyResult,purchaseStamp=stamp_default();output_manager_default.spinner("Purchasing");try{buyResult=await purchaseDomain(client,domainName,purchasePrice,years,autoRenew,contactInformation,{waitMs:wait.waitMs,onOrderAccepted:orderId=>{asJson||wait.noWait||(output_manager_default.stopSpinner(),output_manager_default.log(`Order ${orderId} accepted.`),output_manager_default.spinner(`Waiting on the registrar to register ${domainName}`))}})}catch(err){output_manager_default.stopSpinner(),output_manager_default.debug(`Server response: ${(0,import_error_utils.errorToString)(err)}`);let apiError=isAPIError(err)?err:void 0;return reportChargeFailure(client,asJson,{reason:AGENT_REASON.API_ERROR,message:apiError?`Couldn't buy ${domainName}. The API returned an error (${apiError.code}). Nothing was charged.`:`Couldn't buy ${domainName}. The order wasn't sent, so nothing was charged.`},{apiMessage:apiError?.serverMessage})}if(output_manager_default.stopSpinner(),buyResult instanceof DomainPriceChanged)return reportPriceChanged(client,{verb:"buy",domain:domainName,amount:purchasePrice,nextCommand:buildBuyCommand(client,domainName,{...commandOptions,missing:[]}),json:asJson});if(buyResult instanceof DomainChargeOutcomeUnknown)return reportUnknownOutcome(client,asJson,{verb:"buy",domain:domainName,inspectCommand,cause:buyResult.meta.cause,orderId:buyResult.meta.orderId});if(buyResult instanceof DomainPurchaseInProgress){let{orderId}=buyResult.meta;return reportChargeFailure(client,asJson,{reason:AGENT_REASON.PURCHASE_IN_PROGRESS,message:buyResult.message,retryable:!1,data:{domain:domainName,remote:"none",...orderId&&{orderId}},next:[...orderId?[orderStatusStep(client,{verb:"buy",domain:domainName,orderId})]:[],{command:inspectCommand,when:"Once that order finishes, see the domain"}]})}return buyResult instanceof DomainPaymentAuthenticationRequired?reportChargeFailure(client,asJson,{reason:AGENT_REASON.PAYMENT_AUTHENTICATION_REQUIRED,message:buyResult.message,userActionRequired:!0,verification_uri:buyResult.meta.url}):buyResult instanceof Error?reportChargeFailure(client,asJson,{reason:chargeFailureReason(buyResult),message:buyResult.message}):buyResult.status==="already_owned"?reportAlreadyOwned(client,asJson,domainName,contextName,{autoRenew,duplicate:{orderId:buyResult.orderId,orderOutcome:buyResult.orderOutcome}}):buyResult.status==="pending"?reportOrderPending(client,asJson,{verb:"buy",domain:domainName,orderId:buyResult.orderId,lastStatus:buyResult.lastStatus,readError:buyResult.readError,inspectCommand,wait}):asJson?(client.stdout.write(`${JSON.stringify({status:AGENT_STATUS.OK,domain:domainName,years,charge:{amount:purchasePrice,currency:"USD"},orderId:buyResult.orderId,autoRenew,renewalPrice,message:`Domain ${domainName} purchased.`},null,2)}
|
|
8
8
|
`),0):(client.stdout.write(`${domainName}
|
|
9
9
|
`),output_manager_default.success(`Domain ${param(domainName)} purchased ${purchaseStamp()}`),output_manager_default.log(`Charged ${formatUsd(purchasePrice)} for ${formatTerm(years)}. Registered to ${contactInformation.firstName} ${contactInformation.lastName} (${contactInformation.email}).`),output_manager_default.note(`You may now use your domain as an alias to your deployments. Run ${getCommandName("alias --help")}`),0)}function reportAlreadyOwned(client,json,domain,contextName,opts={}){let{duplicate,autoRenew}=opts,autoRenewCommand=autoRenew===void 0?void 0:buildCommandWithGlobalFlags(client.argv,`domains auto-renew ${autoRenew?"enable":"disable"} ${domain}`),message=[duplicate?`${domain} is already registered to ${contextName} by an earlier purchase. This run's order ${duplicate.orderId} ${duplicate.orderOutcome==="refunded"?"failed, and its charge was refunded":"failed"}.`:`${domain} is already registered to ${contextName}. Nothing was charged.`,autoRenewCommand?`This run didn't change its auto-renew setting; to turn it ${autoRenew?"on":"off"}, run ${autoRenewCommand}.`:""].filter(Boolean).join(" ");return json?(client.stdout.write(`${JSON.stringify({status:AGENT_STATUS.OK,domain,outcome:"unchanged",...duplicate&&{orderId:duplicate.orderId,orderStatus:duplicate.orderOutcome},message,...autoRenewCommand&&{next:[{command:autoRenewCommand,when:`To turn auto-renew ${autoRenew?"on":"off"} for the existing registration`}]}},null,2)}
|
|
10
10
|
`),0):(client.stdout.write(`${domain}
|
|
@@ -4,5 +4,5 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{canPrompt}from"./chunk-IQ7FPAI4.js";import{require_lib}from"./chunk-
|
|
7
|
+
import{canPrompt}from"./chunk-IQ7FPAI4.js";import{require_lib}from"./chunk-6DLSV6MR.js";import{AGENT_REASON,AGENT_STATUS,outputActionRequired}from"./chunk-3QTP26QS.js";import{humanizePath}from"./chunk-UNAQQ5DF.js";import{output_manager_default}from"./chunk-RIXTYUYN.js";import{require_source}from"./chunk-UJ7YUIEJ.js";import{__toESM}from"./chunk-NBPLUP7C.js";var import_fs_extra=__toESM(require_lib(),1),import_chalk=__toESM(require_source(),1);import{homedir}from"os";import{resolve,sep}from"path";import{realpath as realpathCallback}from"node:fs";import*as fs from"node:fs/promises";import{promisify}from"node:util";var realpathInJavaScript=promisify(realpathCallback);async function validateRootDirectory(cwd,path,errorSuffix=""){let pathStat=await(0,import_fs_extra.lstat)(path).catch(()=>null),suffix=errorSuffix?` ${errorSuffix}`:"";return pathStat?pathStat.isDirectory()?await resolvesInside(cwd,path)?!0:(output_manager_default.error(`The provided path ${import_chalk.default.cyan(`\u201C${humanizePath(path)}\u201D`)} is outside of the project.${suffix}`),!1):(output_manager_default.error(`The provided path ${import_chalk.default.cyan(`\u201C${humanizePath(path)}\u201D`)} is a file, but expected a directory.${suffix}`),!1):(output_manager_default.error(`The provided path ${import_chalk.default.cyan(`\u201C${humanizePath(path)}\u201D`)} does not exist.${suffix}`),!1)}async function validatePaths(client,paths,{allowFiles=!1}={}){if(paths.length>1)return output_manager_default.error("Can't deploy more than one path."),{valid:!1,exitCode:1};let path=paths[0],pathStat=await(0,import_fs_extra.lstat)(path).catch(()=>null);if(!pathStat)return output_manager_default.error(`Could not find ${import_chalk.default.cyan(`\u201C${humanizePath(path)}\u201D`)}`),{valid:!1,exitCode:1};let isFile=pathStat.isFile();if(!pathStat.isDirectory()&&!(allowFiles&&isFile))return output_manager_default.fatal(allowFiles?"Deploy a regular file or directory. Symbolic links and special files are not supported as deployment paths.":"This command requires a directory. Use `vercel <file>` to deploy a single file."),{valid:!1,exitCode:1};let refusal=await confirmHomeDirectory(client,path);return refusal||{valid:!0,path,isFile}}async function validateUploadRoot(client,path,repoRoot){if(!repoRoot||repoRoot===path)return{valid:!0,path};let[resolvedRoot,resolvedPath]=await Promise.all([resolveLinks(repoRoot),resolveLinks(path)]);return resolvedRoot===resolvedPath?{valid:!0,path:repoRoot}:rootContains(repoRoot,path,resolvedRoot,resolvedPath)?await confirmHomeDirectory(client,repoRoot,`The repository link ${humanizePath(resolve(repoRoot,".vercel","repo.json"))} makes your home directory the directory to deploy.`)??{valid:!0,path:repoRoot}:(output_manager_default.error(repoRootOutsideMessage("deploy",path,repoRoot)),{valid:!1,exitCode:1})}async function repoRootContains(repoRoot,path){let[resolvedRoot,resolvedPath]=await Promise.all([resolveLinks(repoRoot),resolveLinks(path)]);return rootContains(repoRoot,path,resolvedRoot,resolvedPath)}function rootContains(repoRoot,path,resolvedRoot,resolvedPath){return isInside(repoRoot,path)||isInside(resolvedRoot,resolvedPath)}function repoRootOutsideMessage(action,path,repoRoot){return`Can't ${action} ${humanizePath(path)}. Git reports the repository root ${humanizePath(repoRoot)}, which does not contain this directory. Check \`core.worktree\` in the Git configuration and the \`GIT_WORK_TREE\` environment variable.`}async function resolvesInside(directory,path){let[base,target]=await Promise.all([resolveExisting(directory),resolveExisting(path)]);return base!==null&&target!==null&&isInside(base,target)}async function resolvesToDirectoryInside(directory,path){return!!(await fs.stat(path).catch(()=>null))?.isDirectory()&&await resolvesInside(directory,path)}async function resolveExisting(path){try{return await fs.realpath(path)}catch{return realpathInJavaScript(path).catch(()=>null)}}async function confirmHomeDirectory(client,path,cause){if(!await isHomeDirectory(path))return null;if(!canPrompt(client)){let message=`Can't deploy your home directory without interactive confirmation. ${cause?`${cause} Run`:"Run from your project directory, or run"} in a terminal to confirm deploying your home directory.`;return outputActionRequired(client,{status:AGENT_STATUS.ACTION_REQUIRED,reason:AGENT_REASON.INTERACTIVE_CONFIRMATION_REQUIRED,message,userActionRequired:!0},2),output_manager_default.error(message),{valid:!1,exitCode:2}}return cause&&output_manager_default.warning(cause),await client.input.confirm("You are deploying your home directory. Do you want to continue?",!1)?null:(output_manager_default.print(`Canceled
|
|
8
8
|
`),{valid:!1,exitCode:0})}async function isHomeDirectory(path){let home=homedir();return path===home||await resolveLinks(path)===await resolveLinks(home)}function resolveLinks(path){return fs.realpath(path).catch(()=>path)}function isInside(directory,path){let base=resolve(directory),target=resolve(path);return target===base||target.startsWith(base.endsWith(sep)?base:base+sep)}export{validateRootDirectory,validatePaths,validateUploadRoot,repoRootContains,repoRootOutsideMessage,resolvesInside,resolvesToDirectoryInside};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{pullEnvRecords}from"./chunk-
|
|
7
|
+
import{pullEnvRecords}from"./chunk-NU3MHAAM.js";import{output_manager_default}from"./chunk-RIXTYUYN.js";var INTEGRATIONS_POLL_INTERVAL_MS=5e3,INTEGRATIONS_POLL_TIMEOUT_MS=3*60*1e3;async function fetchDeploymentBuildEnv(client,deploymentId,{quiet=!1}={}){let deadline=Date.now()+INTEGRATIONS_POLL_TIMEOUT_MS,isPolling=!1;for(;Date.now()<deadline;)try{return await pullEnvRecords(client,deploymentId,"vercel-cli:pull")}catch(err){if(err&&typeof err=="object"&&"integrationsStatus"in err&&err.integrationsStatus==="pending"){!isPolling&&!quiet&&(output_manager_default.spinner("Waiting for deployment integrations to finish provisioning..."),isPolling=!0),await new Promise(resolve=>setTimeout(resolve,INTEGRATIONS_POLL_INTERVAL_MS));continue}throw err}throw new Error("Timed out waiting for deployment integrations to complete provisioning.")}export{fetchDeploymentBuildEnv};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{resolveRulesTeam}from"./chunk-
|
|
7
|
+
import{resolveRulesTeam}from"./chunk-5426Z2JE.js";import{resolveAlertsScope,scopeFromLinkedProject}from"./chunk-QUDPFC2I.js";import{detectExplicitScope}from"./chunk-JX562QLD.js";import{getLinkedProject}from"./chunk-6DLSV6MR.js";async function resolveGroupScope(client,opts){if(opts.project||opts.all)return resolveAlertsScope(client,opts);if(detectExplicitScope(client))return resolveRulesTeam(client,opts.jsonOutput);let linkedProject=await getLinkedProject(client);return linkedProject.status==="error"?linkedProject.exitCode:linkedProject.status==="linked"?scopeFromLinkedProject(linkedProject):resolveRulesTeam(client,opts.jsonOutput)}export{resolveGroupScope};
|