@vercel/cli-support 68.1.0-snapshot-f8c293166d1f → 68.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/add-57EE2LQO.js +8 -0
- package/dist/chunks/{add-CDHMIDYR.js → add-DNRNPUU7.js} +1 -1
- package/dist/chunks/{add-JC2KSFHX.js → add-FLVE2M3L.js} +1 -1
- package/dist/chunks/{alerts-TMFON3SU.js → alerts-26PDHRBL.js} +1 -1
- package/dist/chunks/{build-ALEGEJFV.js → build-6WTRWW2M.js} +1 -1
- package/dist/chunks/{chunk-B6QW2OXJ.js → chunk-2STLJAXZ.js} +1 -1
- package/dist/chunks/{chunk-ELQO7254.js → chunk-2TUJJIYU.js} +1 -1
- package/dist/chunks/{chunk-4SI66IFC.js → chunk-2XQO6C7Q.js} +1 -1
- package/dist/chunks/{chunk-HMNIFPU2.js → chunk-33ETNP4M.js} +1 -1
- package/dist/chunks/{chunk-GTBPHJRJ.js → chunk-3F3WNT5K.js} +1 -1
- package/dist/chunks/{chunk-PNTKMD3A.js → chunk-42RUDD27.js} +1 -1
- package/dist/chunks/{chunk-2ACABADL.js → chunk-4MAA4BQD.js} +1 -1
- package/dist/chunks/{chunk-GHZ4YQCI.js → chunk-4OOHXEKI.js} +1 -1
- package/dist/chunks/{chunk-HJCMNBDK.js → chunk-4R7ICESH.js} +1 -1
- package/dist/chunks/{chunk-F6BUBFV2.js → chunk-54W7S4EV.js} +1 -1
- package/dist/chunks/{chunk-CX6QYE3Y.js → chunk-6KI5LJIB.js} +1 -1
- package/dist/chunks/{chunk-ZEGUFI44.js → chunk-6XXXPJBV.js} +1 -1
- package/dist/chunks/{chunk-PG3WQGEK.js → chunk-732HWE3P.js} +1 -1
- package/dist/chunks/{chunk-J7DIPT7M.js → chunk-76AOTUM2.js} +1 -1
- package/dist/chunks/{chunk-VV5TYUAT.js → chunk-76XUBFXI.js} +1 -1
- package/dist/chunks/{chunk-5RRSLENO.js → chunk-7CLATJZX.js} +1 -1
- package/dist/chunks/{chunk-Y2J2ESAE.js → chunk-7EI554V5.js} +1 -1
- package/dist/chunks/{chunk-YTBNOSND.js → chunk-7IHVCKUV.js} +1 -1
- package/dist/chunks/{chunk-TNNCGRBK.js → chunk-7OOCSVWT.js} +1 -1
- package/dist/chunks/{chunk-F2VXECRT.js → chunk-7TREJIPV.js} +1 -1
- package/dist/chunks/{chunk-VUB4NBD4.js → chunk-7ZCM4LWL.js} +1 -1
- package/dist/chunks/{chunk-FWYKEEQK.js → chunk-A7XRIU6Z.js} +1 -1
- package/dist/chunks/{chunk-SWWLPWX7.js → chunk-AASXSNBW.js} +1 -1
- package/dist/chunks/{chunk-PROENC6V.js → chunk-B7LM2BNN.js} +1 -1
- package/dist/chunks/{chunk-XBT7X2Q4.js → chunk-BB27VKHS.js} +1 -1
- package/dist/chunks/{chunk-IR3E37HD.js → chunk-BDLZ6WL2.js} +1 -1
- package/dist/chunks/{chunk-EYCKXHL4.js → chunk-C2R5IEN6.js} +1 -1
- package/dist/chunks/{chunk-I3NEZRVW.js → chunk-CHTFRAXA.js} +1 -1
- package/dist/chunks/{chunk-AJJIPBAG.js → chunk-CNGI6Z2G.js} +1 -1
- package/dist/chunks/{chunk-HG7NRFC5.js → chunk-CRPZYLIL.js} +1 -1
- package/dist/chunks/{chunk-DORCX7UB.js → chunk-CUO3CYU3.js} +1 -1
- package/dist/chunks/{chunk-2DH6LTUI.js → chunk-DRDY2UZX.js} +1 -1
- package/dist/chunks/{chunk-VSDLCOK3.js → chunk-DWA7B7TB.js} +1 -1
- package/dist/chunks/chunk-E6VQXHBD.js +11 -0
- package/dist/chunks/chunk-E7ICSU45.js +7 -0
- package/dist/chunks/{chunk-X5ZBXCCY.js → chunk-EDXNAXEZ.js} +1 -1
- package/dist/chunks/{chunk-O7FAYZU6.js → chunk-EGXRQ73P.js} +1 -1
- package/dist/chunks/chunk-EK7U42I4.js +9 -0
- package/dist/chunks/{chunk-UXAPG6IX.js → chunk-EPCRR72R.js} +1 -1
- package/dist/chunks/{chunk-VBCWRNS4.js → chunk-EZ3HXFLB.js} +1 -1
- package/dist/chunks/{chunk-AULX6RDR.js → chunk-FMLRVSWK.js} +1 -1
- package/dist/chunks/chunk-FO7OSSLI.js +13 -0
- package/dist/chunks/{chunk-PQQRSUUG.js → chunk-FSM7YM4W.js} +1 -1
- package/dist/chunks/{chunk-6ZD6IARJ.js → chunk-FSMZPHAA.js} +1 -1
- package/dist/chunks/chunk-FUH5PBGR.js +7 -0
- package/dist/chunks/{chunk-SSOWIDKG.js → chunk-GILTW5RJ.js} +1 -1
- package/dist/chunks/{chunk-6SYKGWTJ.js → chunk-GNQ7KLCN.js} +1 -1
- package/dist/chunks/{chunk-3YD5WA5R.js → chunk-GO64LSUW.js} +1 -1
- package/dist/chunks/{chunk-PKWSWWVW.js → chunk-GPVXJI6X.js} +1 -1
- package/dist/chunks/{chunk-ICPRMAKB.js → chunk-H43XHICL.js} +1 -1
- package/dist/chunks/{chunk-H2O53DAZ.js → chunk-HAAKXJ4V.js} +1 -1
- package/dist/chunks/{chunk-G7RQVFID.js → chunk-HDKEES7E.js} +4 -4
- package/dist/chunks/{chunk-CX4WJVNY.js → chunk-HT3CQEAF.js} +1 -1
- package/dist/chunks/{chunk-ZEBOIM34.js → chunk-HT5EXCYX.js} +1 -1
- package/dist/chunks/{chunk-Z3YQZSU4.js → chunk-HXIOR7P6.js} +1 -1
- package/dist/chunks/{chunk-KMTQYFJF.js → chunk-IKOVY76G.js} +1 -1
- package/dist/chunks/{chunk-MDWUJ7TA.js → chunk-ILNTOWHG.js} +1 -1
- package/dist/chunks/{chunk-MJ2HLVVL.js → chunk-ILUU3SGP.js} +3 -3
- package/dist/chunks/{chunk-2KJIWBJQ.js → chunk-IMZD7QEB.js} +2 -2
- package/dist/chunks/{chunk-57H5KQGN.js → chunk-IZOKMWU5.js} +1 -1
- package/dist/chunks/{chunk-7MBJ4YIK.js → chunk-JGEJY7AC.js} +1 -1
- package/dist/chunks/chunk-JJTAADC5.js +7 -0
- package/dist/chunks/{chunk-J4WXRM2Y.js → chunk-JK3NTR7T.js} +1 -1
- package/dist/chunks/{chunk-K45TGFUJ.js → chunk-JM7KUCBM.js} +1 -1
- package/dist/chunks/chunk-JPJ6HGAN.js +7 -0
- package/dist/chunks/{chunk-72CSJCJX.js → chunk-JRUL67UC.js} +2 -2
- package/dist/chunks/{chunk-P5IKPNRJ.js → chunk-K4J43D5J.js} +1 -1
- package/dist/chunks/{chunk-NFPO75IP.js → chunk-KDCLHZYL.js} +1 -1
- package/dist/chunks/{chunk-5KGALAC2.js → chunk-KDIICSD5.js} +1 -1
- package/dist/chunks/{chunk-DTEWQLNP.js → chunk-KNKGJD5J.js} +1 -1
- package/dist/chunks/{chunk-V7EJ7O6E.js → chunk-LBJ7EOZM.js} +1 -1
- package/dist/chunks/{chunk-WU22X5RO.js → chunk-LHK6B4ER.js} +1 -1
- package/dist/chunks/{chunk-NXFYKZVZ.js → chunk-LKFQMY5V.js} +1 -1
- package/dist/chunks/{chunk-HLJ2UIG6.js → chunk-LVPY2RTU.js} +1 -1
- package/dist/chunks/chunk-M3LYYAQ6.js +7 -0
- package/dist/chunks/{chunk-VG44VJB5.js → chunk-MEF5BUJ5.js} +1 -1
- package/dist/chunks/{chunk-AI32LWRL.js → chunk-MJKDKZ2J.js} +1 -1
- package/dist/chunks/{chunk-4HYZZASG.js → chunk-N4FZIVIS.js} +1 -1
- package/dist/chunks/{chunk-UE6M2VKP.js → chunk-NFBFXM6X.js} +1 -1
- package/dist/chunks/{chunk-JEACGNHI.js → chunk-O256QMQM.js} +1 -1
- package/dist/chunks/{chunk-NQPQRYHS.js → chunk-OICSITNU.js} +1 -1
- package/dist/chunks/{chunk-6SX4TE7Y.js → chunk-OXQKWOLS.js} +1 -1
- package/dist/chunks/chunk-P7GA2C6N.js +7 -0
- package/dist/chunks/{chunk-NNPXYFMY.js → chunk-PG5BHJVH.js} +1 -1
- package/dist/chunks/{chunk-XXPUBGJZ.js → chunk-PIGJVJNM.js} +2 -2
- package/dist/chunks/chunk-PP7BNCIG.js +7 -0
- package/dist/chunks/{chunk-AJ3KPZLM.js → chunk-PSMKLDLV.js} +1 -1
- package/dist/chunks/{chunk-BLA6V5UN.js → chunk-Q3R4HAAA.js} +1 -1
- package/dist/chunks/chunk-Q4W3R6U2.js +12 -0
- package/dist/chunks/{chunk-A4LOQ3UK.js → chunk-QAVUE3TR.js} +1 -1
- package/dist/chunks/{chunk-JJNTYM7J.js → chunk-QMI7GTT2.js} +1 -1
- package/dist/chunks/{chunk-UAPEASRH.js → chunk-QPNYOR6O.js} +1 -1
- package/dist/chunks/{chunk-UVBRWYYJ.js → chunk-QPPFQREO.js} +1 -1
- package/dist/chunks/{chunk-LNRKGW7S.js → chunk-QROPMCL2.js} +1 -1
- package/dist/chunks/{chunk-WPWGH5CA.js → chunk-QYAXCGZA.js} +1 -1
- package/dist/chunks/{chunk-UJINL7VK.js → chunk-R3ZPLQDI.js} +1 -1
- package/dist/chunks/{chunk-QDSDYOMV.js → chunk-R5KBPWWS.js} +1 -1
- package/dist/chunks/{chunk-C6AOL5RF.js → chunk-RACUGILV.js} +1 -1
- package/dist/chunks/{chunk-PKECY4JZ.js → chunk-RJB5Y7M4.js} +1 -1
- package/dist/chunks/{chunk-SHLKM7EZ.js → chunk-SWABNAKZ.js} +1 -1
- package/dist/chunks/{chunk-245QYIHU.js → chunk-T2IZUTGY.js} +1 -1
- package/dist/chunks/{chunk-3YNMC7FF.js → chunk-TL4AEZXF.js} +1 -1
- package/dist/chunks/chunk-TUPVVZ4I.js +7 -0
- package/dist/chunks/{chunk-B4IOZL3K.js → chunk-U3IPJYB6.js} +1 -1
- package/dist/chunks/{chunk-4JPDCF2O.js → chunk-UFE4RBZV.js} +1 -1
- package/dist/chunks/chunk-UK3VTHT5.js +7 -0
- package/dist/chunks/{chunk-X3A324UF.js → chunk-V2J5U5KQ.js} +1 -1
- package/dist/chunks/{chunk-X72FHJ6W.js → chunk-V7VHLSYL.js} +1 -1
- package/dist/chunks/{chunk-A3WRF4AB.js → chunk-VTAH7VMY.js} +1 -1
- package/dist/chunks/{chunk-NUS3WWST.js → chunk-WA4CPW3H.js} +1 -1
- package/dist/chunks/chunk-WKEDN5SX.js +9 -0
- package/dist/chunks/{chunk-Q2FGBONA.js → chunk-WQBNOQUT.js} +1 -1
- package/dist/chunks/{chunk-OD4RCBDD.js → chunk-WRTBYD4I.js} +1 -1
- package/dist/chunks/{chunk-GOH7QCG3.js → chunk-WS6UOPMS.js} +1 -1
- package/dist/chunks/chunk-X2UJGCIC.js +9 -0
- package/dist/chunks/{chunk-TR3M42DX.js → chunk-XHWA436J.js} +1 -1
- package/dist/chunks/{chunk-OVIWCH3S.js → chunk-XL6PE4AA.js} +1 -1
- package/dist/chunks/{chunk-AP2JY545.js → chunk-XPWLEGWA.js} +1 -1
- package/dist/chunks/{chunk-SPPOQ54P.js → chunk-XY2GGCHC.js} +1 -1
- package/dist/chunks/{chunk-T5DQCNBC.js → chunk-XZYVBYUY.js} +1 -1
- package/dist/chunks/{chunk-7JQBC2HB.js → chunk-Y45NZT7C.js} +1 -1
- package/dist/chunks/{chunk-4D4IP557.js → chunk-YATYCZQJ.js} +1 -1
- package/dist/chunks/{chunk-CKPY7TAQ.js → chunk-YIKXLWSR.js} +1 -1
- package/dist/chunks/{chunk-MHVM4VKT.js → chunk-YVWIDLY4.js} +5 -5
- package/dist/chunks/{chunk-RTIVLPN7.js → chunk-Z2NPMUPM.js} +1 -1
- package/dist/chunks/{chunk-EFQCGYZF.js → chunk-Z62G57GC.js} +1 -1
- package/dist/chunks/{chunk-KEFF3BL3.js → chunk-ZG7A4P5U.js} +1 -1
- package/dist/chunks/{chunk-RIVRPVTH.js → chunk-ZSJU5MJP.js} +1 -1
- package/dist/chunks/{chunk-YNNU3GPR.js → chunk-ZWPASRC2.js} +1 -1
- package/dist/chunks/{clear-FQ4L2ACT.js → clear-4MDTHLLE.js} +1 -1
- package/dist/chunks/{cli-embedded-CZYKFQ6U.js → cli-embedded-OYBJM5SA.js} +1 -1
- package/dist/chunks/{commands-Bx-lrmie-KJI5MSFW.js → commands-Bx-lrmie-W7FCFL4P.js} +1 -1
- package/dist/chunks/{compile-vercel-config-GUTXMJOP.js → compile-vercel-config-A2DMFB2R.js} +1 -1
- package/dist/chunks/{config-EEYAOPDR.js → config-4R62ATWJ.js} +1 -1
- package/dist/chunks/{config-4KECSIYK.js → config-A7DCP25J.js} +1 -1
- package/dist/chunks/{config-HiWLfXRQ-G4JC3PIR.js → config-HiWLfXRQ-D7JA4E3D.js} +1 -1
- package/dist/chunks/{connect-U3yG4EtI-KWEUMGCU.js → connect-U3yG4EtI-XYHDJQT7.js} +1 -1
- package/dist/chunks/{cp-aFe-HVrK-JGQPCT5R.js → cp-aFe-HVrK-UAGAR2BC.js} +1 -1
- package/dist/chunks/{create-ilHWvzSk-MPW7HE43.js → create-ilHWvzSk-7KWZXBE2.js} +1 -1
- package/dist/chunks/{create-project-FMUOSSNP.js → create-project-OA7KBPVU.js} +1 -1
- package/dist/chunks/{delete-LP4N4BXX.js → delete-DN53BRH7.js} +1 -1
- package/dist/chunks/{delete-JRMGVHFJ.js → delete-G4MAUBXZ.js} +1 -1
- package/dist/chunks/{describe-5M3XKRMV.js → describe-Q5D5GYVG.js} +1 -1
- package/dist/chunks/{detect-services-HCUFI3RJ.js → detect-services-VBKVN4A2.js} +1 -1
- package/dist/chunks/{disable-ZFDARZAF.js → disable-CG3R2VAL.js} +1 -1
- package/dist/chunks/{discard-PE5SSIDJ.js → discard-REGFZXFU.js} +1 -1
- package/dist/chunks/{dist-BGUQ47VG.js → dist-4F3LAB5Z.js} +1 -1
- package/dist/chunks/{dist-E4BMK7BO.js → dist-T2AURD3P.js} +1 -1
- package/dist/chunks/{domain-DGvr_U55-AZYOJW3J.js → domain-DGvr_U55-PNXSOVDO.js} +1 -1
- package/dist/chunks/{drives-Bi-Mnt2z-JAGBYE6W.js → drives-Bi-Mnt2z-Z4T2YY4P.js} +1 -1
- package/dist/chunks/{edit-BATH6ETJ.js → edit-7AUE6GXE.js} +1 -1
- package/dist/chunks/{edit-7S67WBSE.js → edit-HHLQDVOP.js} +1 -1
- package/dist/chunks/{enable-JWLWXAZP.js → enable-BV3N6GEL.js} +1 -1
- package/dist/chunks/{exec-Bwv4MDyN-SMCC4JHS.js → exec-Bwv4MDyN-7YUAVBB2.js} +1 -1
- package/dist/chunks/{exec-6WGVP2E2.js → exec-NYLXYXB5.js} +2 -2
- package/dist/chunks/{export-DASZMUUD.js → export-WUPMMHSX.js} +1 -1
- package/dist/chunks/{extend-D9tq9Cot-Z4ORB3B2.js → extend-D9tq9Cot-QT72AXGH.js} +1 -1
- package/dist/chunks/{fork-DQ6qfKqB-AJCZOGQR.js → fork-DQ6qfKqB-XXTHHUMZ.js} +1 -1
- package/dist/chunks/{future-CNLTCF2D.js → future-DJOUGRV4.js} +1 -1
- package/dist/chunks/{generate-cert-for-deploy-TCH3OY6G.js → generate-cert-for-deploy-PZHDFX3W.js} +1 -1
- package/dist/chunks/{groups-B8JVEeKk-J5CCQYWU.js → groups-B8JVEeKk-K57VTXSS.js} +1 -1
- package/dist/chunks/{image-CDRXKTJG.js → image-DX2IAUKJ.js} +1 -1
- package/dist/chunks/{import-builders-XI6CYID6.js → import-builders-IUEC2WN2.js} +1 -1
- package/dist/chunks/{inspect-FODCPYHT.js → inspect-BS5UPI6W.js} +1 -1
- package/dist/chunks/{inspect-I7NZH44Z.js → inspect-GJXLYJC7.js} +1 -1
- package/dist/chunks/{inspect-DSTHAT43.js → inspect-IHVP2M4H.js} +1 -1
- package/dist/chunks/{inspect-RSSQ5YKF.js → inspect-PBSKPN4W.js} +1 -1
- package/dist/chunks/{inspect-FCJC7XCN.js → inspect-Y7VXJEI2.js} +1 -1
- package/dist/chunks/{inspect-JFRSCAAW.js → inspect-YGVXE4HR.js} +1 -1
- package/dist/chunks/{list-NT2RHNIB.js → list-27R4USBV.js} +1 -1
- package/dist/chunks/{list-HWDVPR4V.js → list-2ZCNO6DY.js} +1 -1
- package/dist/chunks/{list-7K3LEJXV.js → list-TUST62E6.js} +1 -1
- package/dist/chunks/{list-QDBAXYKL.js → list-ZSQVIQXC.js} +1 -1
- package/dist/chunks/{list-iqQFvOHx-EWWTMITV.js → list-iqQFvOHx-PNAUIUQL.js} +1 -1
- package/dist/chunks/{login-WHXNCPDU.js → login-CUEQHDT5.js} +1 -1
- package/dist/chunks/login-YCOZROC2.js +7 -0
- package/dist/chunks/{logs-RDOQVAER.js → logs-W4GZLDHE.js} +1 -1
- package/dist/chunks/ls-27K5BB7Z.js +11 -0
- package/dist/chunks/{ls-ASWAYYAI.js → ls-EEJQIKNI.js} +1 -1
- package/dist/chunks/ls-PAL6FQB6.js +8 -0
- package/dist/chunks/{ls-7DUE3OKC.js → ls-TDYTE4HM.js} +1 -1
- package/dist/chunks/{ls-2PCKZKR7.js → ls-UMSUUQCG.js} +1 -1
- package/dist/chunks/{ls-PEFQHSG3.js → ls-W7C5I555.js} +1 -1
- package/dist/chunks/{ls-UQZB42CA.js → ls-XYEJ5MR6.js} +1 -1
- package/dist/chunks/{migrate-experimental-services-2E5TRQU6.js → migrate-experimental-services-556MHJWK.js} +1 -1
- package/dist/chunks/mutate-IELSY6ED.js +9 -0
- package/dist/chunks/{notifications-F2BUWHH4.js → notifications-GZH7CFZY.js} +1 -1
- package/dist/chunks/{open-5FUW57NF.js → open-EVYPUPNZ.js} +1 -1
- package/dist/chunks/{openapi-NZLMBOMR.js → openapi-S6F32ZQD.js} +1 -1
- package/dist/chunks/{permissions-ABXSL4I4.js → permissions-EHF5MNZP.js} +1 -1
- package/dist/chunks/{plugin-offer-IMTYE365.js → plugin-offer-RZADKNYF.js} +1 -1
- package/dist/chunks/{prompt-missing-credentials-3MKVB7HN.js → prompt-missing-credentials-OSAV5B7N.js} +1 -1
- package/dist/chunks/{publish-5AE7VXIO.js → publish-ZB2Q2YSB.js} +1 -1
- package/dist/chunks/pull-WUFIVXEG.js +7 -0
- package/dist/chunks/{purchase-domain-if-available-MU5TGXLG.js → purchase-domain-if-available-YVVGT7MZ.js} +1 -1
- package/dist/chunks/{push-SBTMPRZE.js → push-YWKZ6SOO.js} +1 -1
- package/dist/chunks/{query-5Q6ZV2TP.js → query-G62G25HV.js} +1 -1
- package/dist/chunks/{raw-query-OAYC3OTN.js → raw-query-WTKAOYCP.js} +1 -1
- package/dist/chunks/{read-BTA5slYO-TGRGDUB5.js → read-BTA5slYO-IJLWMNSS.js} +1 -1
- package/dist/chunks/{reauthenticate-PXEYMV7G.js → reauthenticate-WQZ5HISG.js} +1 -1
- package/dist/chunks/remove-7PSNAEDY.js +9 -0
- package/dist/chunks/{remove-CCa99nz9-52C5X3OV.js → remove-CCa99nz9-LCSNBDLT.js} +1 -1
- package/dist/chunks/{reorder-DT32UBAI.js → reorder-OLCKSATY.js} +1 -1
- package/dist/chunks/{reply-AMZ3Y3U5.js → reply-OVHQNEBO.js} +1 -1
- package/dist/chunks/{resolve-NPE5HKCT.js → resolve-TUHO4FHT.js} +1 -1
- package/dist/chunks/{resolve-agent-team-75WZ2VDR.js → resolve-agent-team-NQCRA6ER.js} +1 -1
- package/dist/chunks/{restore-IZHGW3NV.js → restore-5RLBSVYQ.js} +1 -1
- package/dist/chunks/{rm-MBWOLQZJ.js → rm-5RGN33Y5.js} +1 -1
- package/dist/chunks/rm-D7CWGBTV.js +8 -0
- package/dist/chunks/{rm-ILDCA66K.js → rm-FYU3GBLC.js} +1 -1
- package/dist/chunks/rm-HA752TW6.js +8 -0
- package/dist/chunks/{rm-G4U54YJT.js → rm-P6AGSBXP.js} +1 -1
- package/dist/chunks/{routes-GTTTHCOL.js → routes-7VLRHXT4.js} +1 -1
- package/dist/chunks/rule-inspect-Y2MX7LQN.js +8 -0
- package/dist/chunks/{run-D8obqfKw-VBME5UHC.js → run-D8obqfKw-D2EGHTU2.js} +1 -1
- package/dist/chunks/{schema-SKHPOMD7.js → schema-AJAHECZG.js} +1 -1
- package/dist/chunks/{schema-5FNNQEU5.js → schema-UVTYLX6L.js} +2 -2
- package/dist/chunks/{select-org-YRCPH5Z5.js → select-org-JBKKKZSN.js} +1 -1
- package/dist/chunks/{sessions-cvWvPgzc-XIYLOGFI.js → sessions-cvWvPgzc-FBOQQPU5.js} +1 -1
- package/dist/chunks/{set-V6QX5AZQ.js → set-774P7GEL.js} +1 -1
- package/dist/chunks/{set-WWREM57F.js → set-OWNTI5SM.js} +1 -1
- package/dist/chunks/setup-and-link-3LD4LQGE.js +7 -0
- package/dist/chunks/{sh-7olsIyJh-PKP4FF4F.js → sh-7olsIyJh-NFO2QYTK.js} +1 -1
- package/dist/chunks/{skills-5TXXGKN5.js → skills-W45E2EWS.js} +1 -1
- package/dist/chunks/{snapshot-D9MAspub-SROFKNVE.js → snapshot-D9MAspub-UAVA2YSK.js} +1 -1
- package/dist/chunks/{snapshots-DQjvm6St-4DTYO2IQ.js → snapshots-DQjvm6St-DBG4H2HS.js} +1 -1
- package/dist/chunks/{stop-SQX-uC-Q-MCMKSJVQ.js → stop-SQX-uC-Q-CRDQOA5M.js} +1 -1
- package/dist/chunks/{tags-SVOY7QEN.js → tags-DEIOW5MM.js} +1 -1
- package/dist/chunks/{types-NX7G6YBW.js → types-SYUZH46V.js} +1 -1
- package/dist/chunks/update-VG2LHBRV.js +8 -0
- package/dist/chunks/usage-NF6S3DAZ.js +17 -0
- package/dist/chunks/{users-CGEsQ4G8-BEKXN56N.js → users-CGEsQ4G8-POYTVZJV.js} +1 -1
- package/dist/chunks/{write-DixEhGqz-D34NI34B.js → write-DixEhGqz-YYDLLSJE.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 +2 -2
- 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 +101 -67
- package/dist/commands-ai.js +12 -12
- package/dist/commands-blob.js +1 -1
- package/dist/commands-core.js +7 -7
- package/dist/commands-deployments.js +1 -1
- package/dist/commands-flags.js +7 -7
- package/dist/commands-integrations.js +1 -1
- package/dist/commands-observability.js +2 -2
- package/dist/commands-routing.js +2 -2
- package/dist/help.js +1 -1
- package/dist/index.js +10 -8
- package/dist/internal-build.js +1 -1
- package/dist/package.json +8 -8
- package/dist/root-help-commands.mjs +1 -1
- package/dist/version.mjs +1 -1
- package/package.json +17 -17
- package/dist/chunks/add-56T4ON6W.js +0 -8
- package/dist/chunks/chunk-2V5IP6A5.js +0 -7
- package/dist/chunks/chunk-4HNNFJLO.js +0 -7
- package/dist/chunks/chunk-AWB4IKVC.js +0 -9
- package/dist/chunks/chunk-HI5PLVKM.js +0 -12
- package/dist/chunks/chunk-KVZR24QI.js +0 -7
- package/dist/chunks/chunk-NVU7XTNI.js +0 -11
- package/dist/chunks/chunk-OCX4QZ3X.js +0 -9
- package/dist/chunks/chunk-OK52DDU5.js +0 -9
- package/dist/chunks/chunk-PNN2Y2ZQ.js +0 -7
- package/dist/chunks/chunk-RDTWDVFO.js +0 -7
- package/dist/chunks/chunk-RWVYBRVF.js +0 -13
- package/dist/chunks/chunk-V45KKYNK.js +0 -7
- package/dist/chunks/chunk-XGCCTSBW.js +0 -7
- package/dist/chunks/chunk-XO2CZXGA.js +0 -7
- package/dist/chunks/login-RWXYD2CO.js +0 -7
- package/dist/chunks/ls-2OYMFZIB.js +0 -8
- package/dist/chunks/ls-XJZFHHWA.js +0 -11
- package/dist/chunks/mutate-QXTPOGVD.js +0 -9
- package/dist/chunks/pull-MGQ2TMA3.js +0 -7
- package/dist/chunks/remove-WSK5OYNV.js +0 -9
- package/dist/chunks/rm-HVDZJXME.js +0 -8
- package/dist/chunks/rm-JWMYMOKD.js +0 -8
- package/dist/chunks/rule-inspect-KZ7FNV26.js +0 -8
- package/dist/chunks/setup-and-link-STBOP67J.js +0 -7
- package/dist/chunks/update-AVWVPYK5.js +0 -8
- package/dist/chunks/usage-RUCM3AMF.js +0 -15
- /package/dist/chunks/{chunk-COOA33HY.js → chunk-OTIERMC7.js} +0 -0
- /package/dist/chunks/{chunk-O7AF7CLE.js → chunk-TIU3WJH7.js} +0 -0
|
@@ -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{getOrCreateDeploymentProtectionToken}from"./chunk-CKPY7TAQ.js";import{getProtectionForProductionDomain,readEnabledProtection}from"./chunk-VNS4Z72T.js";import{ensureLink}from"./chunk-2KJIWBJQ.js";import{toHost}from"./chunk-MMMX3KE2.js";import{getTeams}from"./chunk-SSOWIDKG.js";import{curlCommand}from"./chunk-MJ2HLVVL.js";import{detectExplicitScope,getScope}from"./chunk-HG7NRFC5.js";import{TelemetryClient}from"./chunk-LNRKGW7S.js";import{getLinkedProject,getUser,introspectToken,resolveAppFromToken}from"./chunk-G7RQVFID.js";import{getGlobalPathConfig}from"./chunk-4D4IP557.js";import{printError}from"./chunk-Y2J2ESAE.js";import{parseArguments}from"./chunk-RDTWDVFO.js";import{InvalidToken,isAPIError}from"./chunk-MTPHHAPR.js";import{cmd,getCommandName}from"./chunk-EFGZK6OY.js";import{output_manager_default}from"./chunk-RIXTYUYN.js";import{require_dist}from"./chunk-4SIQE2W4.js";import{createHelpTheme,help,helpCommand}from"./chunk-F2VXECRT.js";import{CONTROL_CHARACTERS,FORMAT_CHARACTERS}from"./chunk-AUCQKYL2.js";import{getFlagsSpecification,normalizeFlagName}from"./chunk-DORCX7UB.js";import{require_source}from"./chunk-UJ7YUIEJ.js";import{__toESM}from"./chunk-NBPLUP7C.js";import{spawn as spawn2}from"child_process";var CURL_SHORT_OPTIONS_WITH_VALUE="EKCbcdDFPHhmoUQreXYytzTuAwx",CURL_LONG_OPTIONS_WITH_VALUE=new Set(["--aws-sigv4","--cert","--config","--continue-at","--cookie","--cookie-jar","--data","--data-ascii","--data-binary","--data-raw","--data-urlencode","--dump-header","--form","--form-string","--ftp-port","--header","--json","--key","--max-time","--oauth2-bearer","--output","--pass","--proxy","--proxy-cert","--proxy-header","--proxy-key","--proxy-pass","--proxy-user","--quote","--range","--referer","--request","--speed-limit","--speed-time","--telnet-option","--time-cond","--upload-file","--url","--url-query","--user","--user-agent","--variable","--write-out"]),LONG_OPTION_NAME=/^--[A-Za-z0-9][A-Za-z0-9.-]*$/,SHORT_OPTIONS=/^-[A-Za-z0-9:#]+$/,REDACTED="[REDACTED]",HEADER_OPTIONS=new Set(["--header","-H","--proxy-header"]),KEPT_VALUE_OPTIONS=new Set(["--url"]),HEADER_NAME=/^([!#$%&'*+.^_`|~0-9A-Za-z-]+):/;function redactValue(value,option){if(option!==void 0&&KEPT_VALUE_OPTIONS.has(option))return value;if(option!==void 0&&HEADER_OPTIONS.has(option)){let name=HEADER_NAME.exec(value)?.[1];if(name)return`${name}: ${REDACTED}`}return REDACTED}function redactCurlArgs(args){let out=[],option,takesNext=!1;for(let arg of args){if(takesNext){out.push(redactValue(arg,option)),option=void 0,takesNext=!1;continue}let name=normalizeFlagName(arg);if(LONG_OPTION_NAME.test(name)){arg.includes("=")?(out.push(`${name}=${redactValue(arg.slice(name.length+1),name)}`),option=void 0):(out.push(name),option=name,takesNext=CURL_LONG_OPTIONS_WITH_VALUE.has(name));continue}if(arg!=="--"&&SHORT_OPTIONS.test(arg.slice(0,2))){option=void 0;let short=SHORT_OPTIONS.test(arg)?arg:REDACTED;for(let i=1;i<arg.length;i++){if(!CURL_SHORT_OPTIONS_WITH_VALUE.includes(arg[i]))continue;let letter=`-${arg[i]}`;i===arg.length-1?(option=letter,takesNext=!0):short=`${arg.slice(0,i+1)}${redactValue(arg.slice(i+1),letter)}`;break}out.push(short);continue}out.push(arg==="--"?arg:redactValue(arg,option)),option=void 0}return out}var requoteArgs=arg=>arg.includes(" ")?arg.includes('"')?`'${arg}'`:`"${arg}"`:arg;var CurlTelemetryClient=class extends TelemetryClient{trackCliArgumentPath(path){if(path){let value=path.startsWith("/")?"slash":"no-slash";this.trackCliArgument({arg:"path",value})}}trackCliOptionDeployment(deploymentId){if(deploymentId){let value=deploymentId.startsWith("http://")||deploymentId.startsWith("https://")?"url":deploymentId.startsWith("dpl_")?"dpl_":"no-prefix";this.trackCliOption({option:"deployment",value})}}trackCliOptionProtectionBypass(secret){secret&&this.trackCliOption({option:"protection-bypass",value:this.redactedValue})}trackCliFlagYes(yes){yes&&this.trackCliFlag("yes")}trackCliFlagTrace(trace2){trace2&&this.trackCliFlag("trace")}trackCliFlagJson(json){json&&this.trackCliFlag("json")}trackCliFlagYesOnProduction(value){value&&this.trackCliFlag("yes-on-production")}};var import_chalk=__toESM(require_source(),1),import_error_utils=__toESM(require_dist(),1);function getDeploymentSelectorUrl(selector){try{return new URL(selector.startsWith("http://")||selector.startsWith("https://")?selector:`https://${selector}`)}catch{return null}}function getDeploymentLookupHost(selector){return selector.includes(".")?getDeploymentSelectorUrl(selector)?.hostname??selector:selector}async function getDeploymentAccounts(client){if(detectExplicitScope(client))return client.config.currentTeam?[client.config.currentTeam]:[];let currentTeam=client.config.currentTeam;try{return(await getTeams(client)).filter(team=>!team.limited).map(team=>team.id).sort((a,b)=>+(b===currentTeam)-+(a===currentTeam))}catch(err){if(!(err instanceof InvalidToken))throw err;let token=await introspectToken(client).catch(()=>null);if(token&&resolveAppFromToken(token))return token.team?[token.team.id]:[];if(currentTeam)return[currentTeam];throw err}}async function resolveDeployment(client,selector,accountId){let hostOrId=getDeploymentLookupHost(selector),endpoint=`/v13/deployments/${encodeURIComponent(hostOrId)}`,lookup=async accountId2=>{try{let deployment2=await client.fetch(endpoint,{useCurrentTeam:!1,...accountId2?{accountId:accountId2}:{},bailOn429:!0});return deployment2?{...deployment2,ownerId:deployment2.ownerId??deployment2.team?.id}:null}catch(err){if(!isAPIError(err)||err.status!==403&&err.status!==404)throw err;return output_manager_default.debug(`Deployment lookup failed for ${hostOrId}: ${err}`),null}};if(accountId||detectExplicitScope(client))return lookup(accountId??client.config.currentTeam);let deployment=await lookup();if(deployment?.projectId&&deployment.ownerId)return deployment;let accounts;try{accounts=await getDeploymentAccounts(client)}catch(err){if(deployment?.url)return deployment;throw err}for(let account of accounts){let scoped=await lookup(account);if(scoped?.projectId&&scoped.ownerId)return scoped;deployment??=scoped}return deployment}async function getDeploymentUrlById(client,deploymentIdOrUrl,accountId){try{if(deploymentIdOrUrl.startsWith("http://")||deploymentIdOrUrl.startsWith("https://"))try{return new URL(deploymentIdOrUrl).origin}catch{return output_manager_default.debug(`Invalid deployment URL provided: ${deploymentIdOrUrl}`),null}if(deploymentIdOrUrl.includes("vercel.app")){let url=getDeploymentSelectorUrl(deploymentIdOrUrl);return url?url.origin:(output_manager_default.debug(`Invalid deployment URL provided: ${deploymentIdOrUrl}`),null)}let fullDeploymentId=deploymentIdOrUrl;fullDeploymentId.startsWith("dpl_")||(fullDeploymentId=`dpl_${deploymentIdOrUrl}`);let deployment=await resolveDeployment(client,fullDeploymentId,accountId);return!deployment||!deployment.url?null:`https://${deployment.url}`}catch(error){return output_manager_default.debug(`Failed to fetch deployment by ID: ${error}`),null}}function looksLikeHostname(path){let firstSegment=path.split("/")[0];return firstSegment.includes(".")&&!firstSegment.startsWith(".")}function orgFromOwner(id,slug=id){return{type:id.startsWith("team_")?"team":"user",id,slug}}var VC_STRING_FLAGS=new Set(["--deployment","--protection-bypass"]),VC_IGNORED_STRING_FLAGS=new Set(["--scope","--team","--token","-t"]),VC_IGNORED_BOOLEAN_FLAGS=new Set(["--debug"]),VC_BOOLEAN_FLAGS=new Set(["--yes","--help","--trace","--json"]);function flagName(arg){let eqIdx=arg.indexOf("=");return eqIdx===-1?arg:arg.slice(0,eqIdx)}function flagValue(args,index){let arg=args[index],eqIdx=arg.indexOf("=");if(eqIdx!==-1)return arg.slice(eqIdx+1);let next=args[index+1];return next&&!next.startsWith("-")?next:void 0}function getCurlLikeArgs(rawArgs,commandName){if(rawArgs[0]===commandName)return rawArgs.slice(1);let commandIndex=0;for(;commandIndex<rawArgs.length;){let arg=rawArgs[commandIndex];if(VC_IGNORED_BOOLEAN_FLAGS.has(flagName(arg))){commandIndex++;continue}if(!VC_IGNORED_STRING_FLAGS.has(flagName(arg)))break;commandIndex++,!arg.includes("=")&&commandIndex<rawArgs.length&&commandIndex++}return rawArgs[commandIndex]===commandName?rawArgs.slice(commandIndex+1):[...rawArgs]}function parseCurlLikeArgs(rawArgs,commandName){let result={target:void 0,deployment:void 0,protectionBypass:void 0,yes:!1,help:!1,trace:!1,json:!1,toolFlags:[]},args=getCurlLikeArgs(rawArgs,commandName),separatorIndex=args.indexOf("--"),beforeSeparator=separatorIndex===-1?args:args.slice(0,separatorIndex),afterSeparator=separatorIndex===-1?[]:args.slice(separatorIndex+1);for(let i=0;i<beforeSeparator.length;i++){let arg=beforeSeparator[i],name=flagName(arg);if(VC_STRING_FLAGS.has(name)){let value=flagValue(beforeSeparator,i);!arg.includes("=")&&value!==void 0&&i++,name==="--deployment"?result.deployment=value:result.protectionBypass=value;continue}if(!VC_IGNORED_BOOLEAN_FLAGS.has(name)){if(VC_IGNORED_STRING_FLAGS.has(name)){let value=flagValue(beforeSeparator,i);!arg.includes("=")&&value!==void 0&&i++;continue}if(VC_BOOLEAN_FLAGS.has(name)){name==="--yes"?result.yes=!0:name==="--trace"?result.trace=!0:name==="--json"?result.json=!0:result.help=!0;continue}if(!result.target&&name==="--url"){let value=flagValue(beforeSeparator,i);!arg.includes("=")&&value!==void 0&&i++,result.target=value;continue}!result.target&&!arg.startsWith("-")?result.target=arg:result.toolFlags.push(arg)}}return result.toolFlags.push(...afterSeparator),result}function setupCurlLikeCommand(client,command,telemetryClient,options={}){let{print}=output_manager_default;if(options.allowFullUrl){let parsed=parseCurlLikeArgs(options.args??client.argv.slice(2),command.name);if(parsed.help)return print(help(command,{stream:client.stderr,columns:client.stderr.columns})),0;let path2=parsed.target;if(telemetryClient.trackCliArgumentPath(path2),parsed.deployment&&telemetryClient.trackCliOptionDeployment(parsed.deployment),parsed.protectionBypass&&telemetryClient.trackCliOptionProtectionBypass(parsed.protectionBypass),!path2)return output_manager_default.error(`${getCommandName(`${command.name} <url|path>`)} requires a URL or API path (e.g., 'https://example.vercel.app/api/hello' or '/api/hello')`),print(help(command,{stream:client.stderr,columns:client.stderr.columns})),2;let isFullUrl2=path2.startsWith("http://")||path2.startsWith("https://");return!isFullUrl2&&looksLikeHostname(path2)&&(isFullUrl2=!0),output_manager_default.debug(`${command.name} options (${parsed.toolFlags.length} args): ${JSON.stringify(redactCurlArgs(parsed.toolFlags))}`),{path:isFullUrl2&&!path2.startsWith("http")?`https://${path2}`:path2,isFullUrl:isFullUrl2,deploymentFlag:parsed.deployment,protectionBypassFlag:parsed.protectionBypass,toolFlags:parsed.toolFlags,yes:parsed.yes,trace:parsed.trace,json:parsed.json}}let parsedArgs=null,flagsSpecification=getFlagsSpecification(command.options);try{parsedArgs=parseArguments(client.argv.slice(2),flagsSpecification)}catch(err){return printError(err),2}let{flags}=parsedArgs;if(parsedArgs.flags["--help"])return print(help(command,{stream:client.stderr,columns:client.stderr.columns})),0;parsedArgs.args[0]===command.name&&parsedArgs.args.shift();let separatorIndex=process.argv.indexOf("--"),path=parsedArgs.args[0];telemetryClient.trackCliArgumentPath(path);let deploymentFlag=flags["--deployment"];deploymentFlag&&telemetryClient.trackCliOptionDeployment(deploymentFlag);let protectionBypassFlag=flags["--protection-bypass"];if(protectionBypassFlag&&telemetryClient.trackCliOptionProtectionBypass(protectionBypassFlag),!path||path==="--"||path.startsWith("-"))return options.allowFullUrl?output_manager_default.error(`${getCommandName(`${command.name} <url|path>`)} requires a URL or API path (e.g., 'https://example.vercel.app/api/hello' or '/api/hello')`):output_manager_default.error(`${getCommandName(`${command.name} <path>`)} requires an API path (e.g., '/' or '/api/hello' or 'api/hello')`),print(help(command,{stream:client.stderr,columns:client.stderr.columns})),1;let isFullUrl=path.startsWith("http://")||path.startsWith("https://");if(!isFullUrl&&looksLikeHostname(path)&&(isFullUrl=!0),isFullUrl&&!options.allowFullUrl)return output_manager_default.error("The <path> argument must be a relative API path (e.g., '/' or '/api/hello'), not a full URL."),output_manager_default.print("To target a specific deployment within the currently linked project, use the --deployment <id|url> option."),print(help(command,{stream:client.stderr,columns:client.stderr.columns})),1;let toolFlags=separatorIndex!==-1?process.argv.slice(separatorIndex+1):[];return output_manager_default.debug(`${command.name} options (${toolFlags.length} args): ${JSON.stringify(redactCurlArgs(toolFlags))}`),{path:isFullUrl&&!path.startsWith("http")?`https://${path}`:path,isFullUrl,deploymentFlag,protectionBypassFlag,toolFlags,yes:!!flags["--yes"],trace:!!flags["--trace"],json:!!flags["--json"]}}function requestHost(url){let authority=/^[a-z][a-z0-9+.-]*:\/\/([^/?#]*)/i.exec(url)?.[1];if(!authority)return null;try{let parsed=new URL(url);return parsed.hostname===authority.toLowerCase()?parsed.hostname:null}catch{return null}}async function resolveProjectFromUrl(client,host){try{let deployment=await resolveDeployment(client,host);if(deployment){let link=await linkFromDeployment(client,deployment);if(link)return link}}catch(err){if(output_manager_default.debug(`Deployment lookup failed for ${host}: ${err}`),isAPIError(err)&&err.status===429)return null}try{let aliasUrl=`/now/aliases/${encodeURIComponent(host)}`;try{let alias=await client.fetch(aliasUrl,{useCurrentTeam:!1,...detectExplicitScope(client)?{accountId:client.config.currentTeam}:{}});if(alias.projectId&&alias.ownerId)return{status:"linked",project:await client.fetch(`/v9/projects/${encodeURIComponent(alias.projectId)}`,{accountId:alias.ownerId}),org:orgFromOwner(alias.ownerId)}}catch(err){output_manager_default.debug(`User alias lookup failed for ${host}: ${err}`)}for(let accountId of await getDeploymentAccounts(client))try{let alias=await client.fetch(aliasUrl,{accountId}),projectId=alias.projectId,ownerId=alias.ownerId||accountId;if(projectId)return{status:"linked",project:await client.fetch(`/v9/projects/${encodeURIComponent(projectId)}`,{accountId:ownerId}),org:orgFromOwner(ownerId)}}catch(err){output_manager_default.debug(`Alias lookup failed for ${host} in ${accountId}: ${err}`)}}catch(err){output_manager_default.debug(`Team lookup failed for ${host}: ${err}`)}return null}async function getFullUrlAndToken(client,fullUrl,protectionBypassFlag){if(protectionBypassFlag)return{fullUrl,deploymentProtectionToken:omitBypassOnPlainHttp(fullUrl,protectionBypassFlag),link:null};if(process.env.VERCEL_AUTOMATION_BYPASS_SECRET){let secret=process.env.VERCEL_AUTOMATION_BYPASS_SECRET;return await isEnvironmentSecretBoundTo(client,fullUrl,secret)?(output_manager_default.debug("Using protection bypass secret from environment variable"),{fullUrl,deploymentProtectionToken:secret,link:null}):(output_manager_default.warn("Not sending VERCEL_AUTOMATION_BYPASS_SECRET: the URL is not an HTTPS deployment or alias of the project that owns it."),{fullUrl,deploymentProtectionToken:null,link:null})}let url;try{url=new URL(fullUrl)}catch{return{fullUrl,deploymentProtectionToken:null,link:null}}let link=await resolveProjectFromUrl(client,url.hostname),deploymentProtectionToken=null;if(link&&isHttpsUrl(fullUrl))try{deploymentProtectionToken=await getOrCreateDeploymentProtectionToken(client,link,{readinessUrl:url.href})}catch(err){output_manager_default.debug(`Failed to get deployment protection bypass token: ${err}`)}return{fullUrl:url.href,deploymentProtectionToken,link}}async function linkFromDeployment(client,deployment){return!deployment.projectId||!deployment.ownerId?null:{status:"linked",project:await client.fetch(`/v9/projects/${encodeURIComponent(deployment.projectId)}`,{accountId:deployment.ownerId}),org:orgFromOwner(deployment.ownerId)}}async function resolveTargetProject(client,deployment,deploymentFlag){try{let link=await linkFromDeployment(client,deployment);return link||output_manager_default.warn(`Deployment "${deploymentFlag}" is missing project metadata; proceeding without an automatic protection bypass token.`),link}catch(err){return output_manager_default.debug(`Failed to resolve deployment project: ${err}`),output_manager_default.warn(`Failed to load project for deployment "${deploymentFlag}"; proceeding without an automatic protection bypass token.`),null}}async function tryGetDeployment(client,selector){try{return await resolveDeployment(client,selector)}catch(err){return output_manager_default.debug(`Failed to resolve deployment: ${err}`),null}}async function tryLinkFromSelector(client,selector){try{let deployment=await resolveDeployment(client,selector);return deployment?await linkFromDeployment(client,deployment):null}catch(err){return output_manager_default.debug(`Failed to resolve trace project context: ${err}`),null}}async function getLinkedProjectOrNull(client){try{let linked=await getLinkedProject(client,{cwd:client.cwd});return linked.status==="linked"?linked:null}catch(err){return output_manager_default.debug(`Failed to load linked project: ${err}`),null}}function hasAutomationBypassToken(project){return Object.values(project.protectionBypass??{}).some(token=>token.scope==="automation-bypass")}function isHttpsUrl(url){try{return new URL(url).protocol==="https:"}catch{return!1}}function omitBypassOnPlainHttp(fullUrl,token){return token&&!isHttpsUrl(fullUrl)?(output_manager_default.warn("Not sending the protection bypass secret over a non-HTTPS URL."),null):token}async function isEnvironmentSecretBoundTo(client,fullUrl,secret){if(!isHttpsUrl(fullUrl))return!1;let host=requestHost(fullUrl);if(!host)return!1;let link=await resolveProjectFromUrl(client,host);return link!==null&&link.project.protectionBypass?.[secret]?.scope==="automation-bypass"}async function getDeploymentUrlAndToken(client,commandName,path,options){let{deploymentFlag,protectionBypassFlag,autoConfirm,resolveProjectForTrace}=options,environmentProtectionBypass=deploymentFlag&&!protectionBypassFlag&&process.env.VERCEL_AUTOMATION_BYPASS_SECRET||void 0,suppliedProtectionBypass=deploymentFlag?protectionBypassFlag??environmentProtectionBypass:protectionBypassFlag,link=null,createProtectionBypassIfMissing=!deploymentFlag,baseUrl;if(deploymentFlag){let requestedBaseUrl=deploymentFlag.startsWith("http://")||deploymentFlag.startsWith("https://")||deploymentFlag.includes("vercel.app")?await getDeploymentUrlById(client,deploymentFlag):null,deploymentSelector=deploymentFlag.includes(".")||deploymentFlag.startsWith("dpl_")?deploymentFlag:`dpl_${deploymentFlag}`;if(suppliedProtectionBypass!==void 0){if(baseUrl=requestedBaseUrl??await getDeploymentUrlById(client,deploymentFlag)??"",!baseUrl)return output_manager_default.error(`No deployment found for ID "${deploymentFlag}"`),1;resolveProjectForTrace&&(link=await tryLinkFromSelector(client,deploymentSelector)??await getLinkedProjectOrNull(client))}else{let deployment=await tryGetDeployment(client,deploymentSelector);if(baseUrl=requestedBaseUrl??(deployment?.url?`https://${deployment.url}`:""),!baseUrl)return output_manager_default.error(`No deployment found for ID "${deploymentFlag}"`),1;deployment?(link=await resolveTargetProject(client,deployment,deploymentFlag),link&&!hasAutomationBypassToken(link.project)&&(createProtectionBypassIfMissing=(await getLinkedProjectOrNull(client))?.project.id===link.project.id)):output_manager_default.warn(`Could not resolve project information for deployment "${deploymentFlag}"; proceeding without an automatic protection bypass token.`)}}else{try{await getScope(client)}catch(err){if((0,import_error_utils.isErrnoException)(err)&&(err.code==="NOT_AUTHORIZED"||err.code==="TEAM_DELETED"))return output_manager_default.error(err.message),1;throw err}let ensuredLink;try{ensuredLink=await ensureLink(commandName,client,client.cwd,{autoConfirm})}catch(err){if((0,import_error_utils.isErrnoException)(err)&&err.code==="NOT_AUTHORIZED")return output_manager_default.error(err.message),1;throw err}if(typeof ensuredLink=="number")return ensuredLink;link=ensuredLink;let{project}=ensuredLink;if(!project.targets&&!project.latestDeployments){let linkedProject=await getLinkedProject(client,{cwd:client.cwd});if(linkedProject.status!=="linked")return output_manager_default.error("This command requires a linked project. Please run:"),output_manager_default.print(" vercel link"),1;if(!linkedProject.project||!linkedProject.org)return output_manager_default.error("Failed to get project information"),1;project=linkedProject.project}let preferredAlias=project.targets?.production?.alias?.[0],backupAlias=project.latestDeployments?.[0]?.url,target=preferredAlias||backupAlias;if(!target)throw new Error("No deployment URL found for the project");baseUrl=`https://${target}`}let fullUrl=`${baseUrl}${path.startsWith("/")?path:`/${path}`}`;output_manager_default.debug(`${import_chalk.default.cyan("Target URL:")} ${import_chalk.default.bold(fullUrl)}`);let deploymentProtectionToken=suppliedProtectionBypass??null;if(suppliedProtectionBypass===void 0&&link?.project.id&&isHttpsUrl(fullUrl))try{deploymentProtectionToken=await getOrCreateDeploymentProtectionToken(client,link,{createIfMissing:createProtectionBypassIfMissing,readinessUrl:fullUrl})}catch(err){return output_manager_default.error(`Failed to get deployment protection bypass token: ${err instanceof Error?err.message:String(err)}`),1}return environmentProtectionBypass?await isEnvironmentSecretBoundTo(client,fullUrl,environmentProtectionBypass)||(output_manager_default.warn("Not sending VERCEL_AUTOMATION_BYPASS_SECRET: the URL is not an HTTPS deployment or alias of the project that owns it."),deploymentProtectionToken=null):deploymentProtectionToken=omitBypassOnPlainHttp(fullUrl,deploymentProtectionToken),{fullUrl,deploymentProtectionToken,link}}function traceCurl(root){let span=root?.child("vc.cli.curl"),finished=!1;return code=>{finished||(finished=!0,code!==0&&span?.setAttributes({error:"true"}),span?.stop())}}var import_error_utils2=__toESM(require_dist(),1);import{spawn}from"child_process";import{tmpdir}from"os";import{join as join2}from"path";import{mkdtemp,readFile as readFile2,rm}from"fs/promises";async function confirmProduction(client,{deploymentTarget,yes,isTTY}){return deploymentTarget!=="production"||yes?"proceed":isTTY?await client.input.confirm("You are about to capture a trace against a production deployment. Continue?",!1)?"proceed":"declined":(output_manager_default.error("Use --yes to capture traces on production from non-interactive contexts."),"non-tty-no-yes")}import{createHash}from"crypto";import{chmod,mkdir,readFile,unlink,writeFile}from"fs/promises";import{dirname,join}from"path";var FALLBACK_TTL_MS=5*60*1e3,EXPIRY_BUFFER_MS=30*1e3,CACHE_SCHEMA_VERSION=1;function resolveCacheDir(override){return override||join(getGlobalPathConfig(),"cache","traces")}function cacheFilename(teamId,host){let key=`${teamId??""}:${host}`;return`${createHash("sha256").update(key).digest("hex")}.json`}function cachePath(cacheDir,teamId,host){return join(cacheDir,cacheFilename(teamId,host))}async function readCache(path){let raw;try{raw=await readFile(path,"utf8")}catch{return null}try{let parsed=JSON.parse(raw);return!parsed||typeof parsed.token!="string"||typeof parsed.expiresAt!="number"||parsed.schemaVersion!==CACHE_SCHEMA_VERSION?null:parsed}catch{return output_manager_default.debug(`Trace cookie cache file is corrupt at ${path}; re-issuing.`),null}}async function writeCache(path,entry){await mkdir(dirname(path),{recursive:!0}),await writeFile(path,JSON.stringify(entry),{mode:384}),await chmod(path,384)}async function issueToken(client,{teamId,projectId,hostname}){let body=JSON.stringify({projectId,hostname}),response=await client.fetch("/v1/projects/traces/session",{method:"POST",body,headers:{"Content-Type":"application/json"},accountId:teamId});if(!response?.token)throw new Error("Trace session response is missing a token");let expiresAt=typeof response.expiresAt=="number"?response.expiresAt:Date.now()+FALLBACK_TTL_MS;return{token:response.token,expiresAt}}async function getTraceSessionToken({client,teamId,projectId,host,evictedToken,cacheDir}){let dir=resolveCacheDir(cacheDir),hostname=toHost(host),path=cachePath(dir,teamId,hostname),cached=await readCache(path);if(cached&&evictedToken&&cached.token===evictedToken)await unlink(path).catch(()=>{});else if(cached&&Date.now()<cached.expiresAt-EXPIRY_BUFFER_MS)return{token:cached.token,expiresAt:cached.expiresAt,fromCache:!0};let issued=await issueToken(client,{teamId,projectId,hostname});try{await writeCache(path,{token:issued.token,expiresAt:issued.expiresAt,schemaVersion:CACHE_SCHEMA_VERSION})}catch(err){output_manager_default.debug(`Failed to write trace cookie cache: ${err}`)}return{token:issued.token,expiresAt:issued.expiresAt,fromCache:!1}}var TRACE_COOKIE_NAME="_vercel_tracing",SESSION_COOKIE_NAME="_vercel_session";async function lookupDeployment(client,fullUrl,accountId){let deployment=await resolveDeployment(client,fullUrl,accountId);if(!deployment)throw new Error("Deployment not found");return deployment}function resolveTeamId(link,deployment){if(link?.org.type==="team")return link.org.id;if(deployment.ownerId?.startsWith("team_"))return deployment.ownerId}function extractVercelId(headerDump){let lines=headerDump.split(/\r?\n/),lastValue;for(let line of lines){let idx=line.indexOf(":");if(idx===-1)continue;line.slice(0,idx).trim().toLowerCase()==="x-vercel-id"&&(lastValue=line.slice(idx+1).trim())}if(!lastValue)return;let sepIdx=lastValue.lastIndexOf("::");return sepIdx===-1?lastValue:lastValue.slice(sepIdx+2)}function extractFinalStatus(headerDump){let lines=headerDump.split(/\r?\n/),lastStatus;for(let line of lines){let match=line.match(/^HTTP\/[\d.]+\s+(\d{3})/);match&&(lastStatus=Number(match[1]))}return lastStatus}async function runCurlAndCaptureHeaders(client,curlFlags,json){let tmpDir=await mkdtemp(join2(tmpdir(),"vc-curl-trace-")),headerFile=join2(tmpDir,"headers"),flags=["--dump-header",headerFile,...curlFlags];try{let{exitCode,capturedBody}=await new Promise(resolve=>{let finishTrace=traceCurl(client.telemetryEventStore.enabled?client.rootSpan:void 0),child=spawn("curl",flags,{stdio:json?["inherit","pipe","inherit"]:"inherit",shell:!1}),buf="";json&&child.stdout&&(child.stdout.setEncoding("utf8"),child.stdout.on("data",chunk=>{buf+=chunk})),child.on("error",err=>{finishTrace(1),err.code==="ENOENT"?output_manager_default.error("curl command not found. Please install curl."):output_manager_default.error(`Failed to execute curl: ${err.message}`),resolve({exitCode:1,capturedBody:buf})}),child.on("close",code=>{finishTrace(code),resolve({exitCode:code??1,capturedBody:buf})})}),headerDump="";try{headerDump=await readFile2(headerFile,"utf8")}catch(err){output_manager_default.debug(`Failed to read curl header dump: ${err}`)}return{exitCode,headerDump,capturedBody}}finally{await rm(tmpDir,{recursive:!0,force:!0}).catch(()=>{})}}async function trace(client,{fullUrl,link,curlFlags,json,yes,telemetry}){telemetry.trackCliFlagTrace(!0),json&&telemetry.trackCliFlagJson(!0);let accountId=link?.org.id,deployment;try{deployment=await lookupDeployment(client,fullUrl,accountId)}catch(err){return output_manager_default.error(`Failed to look up deployment for tracing: ${err instanceof Error?err.message:String(err)}`),1}let projectId=link?.project.id??deployment.projectId;if(!projectId)return output_manager_default.error("Could not resolve project for trace session. Run `vercel link` and retry."),1;let teamId=resolveTeamId(link,deployment),userId;try{userId=client.authConfig.userId??(await getUser(client)).id}catch(err){return output_manager_default.error(`Failed to resolve user for trace session: ${(0,import_error_utils2.errorToString)(err)}`),1}let deploymentTarget=deployment.target==="production"?"production":"preview",confirmation=await confirmProduction(client,{deploymentTarget,yes,isTTY:!!client.stdin.isTTY});if(confirmation==="non-tty-no-yes")return 1;if(confirmation==="declined")return output_manager_default.log("Trace cancelled."),0;deploymentTarget==="production"&&yes&&telemetry.trackCliFlagYesOnProduction(!0);let session;try{session=await getTraceSessionToken({client,teamId,projectId,host:fullUrl})}catch(err){return output_manager_default.error(`Failed to acquire trace session: ${err instanceof Error?err.message:String(err)}`),1}let{exitCode,headerDump,capturedBody}=await runCurlWithCookie(client,session.token,userId,curlFlags,json);if(session.fromCache&&extractFinalStatus(headerDump)===401&&exitCode===0){output_manager_default.debug("Trace cookie returned 401; evicting cache and retrying.");let refreshed;try{refreshed=await getTraceSessionToken({client,teamId,projectId,host:fullUrl,evictedToken:session.token})}catch(err){return output_manager_default.error(`Failed to refresh trace session after 401: ${err instanceof Error?err.message:String(err)}`),1}({exitCode,headerDump,capturedBody}=await runCurlWithCookie(client,refreshed.token,userId,curlFlags,json))}let requestId=extractVercelId(headerDump);return json?(client.stdout.write(`${JSON.stringify({response:capturedBody,requestId:requestId??null},null,2)}
|
|
7
|
+
import{getOrCreateDeploymentProtectionToken}from"./chunk-YIKXLWSR.js";import{getProtectionForProductionDomain,readEnabledProtection}from"./chunk-VNS4Z72T.js";import{ensureLink}from"./chunk-IMZD7QEB.js";import{toHost}from"./chunk-MMMX3KE2.js";import{getTeams}from"./chunk-GILTW5RJ.js";import{curlCommand}from"./chunk-ILUU3SGP.js";import{detectExplicitScope,getScope}from"./chunk-CRPZYLIL.js";import{TelemetryClient}from"./chunk-QROPMCL2.js";import{getLinkedProject,getUser,introspectToken,resolveAppFromToken}from"./chunk-HDKEES7E.js";import{getGlobalPathConfig}from"./chunk-YATYCZQJ.js";import{printError}from"./chunk-7EI554V5.js";import{parseArguments}from"./chunk-E7ICSU45.js";import{InvalidToken,isAPIError}from"./chunk-MTPHHAPR.js";import{cmd,getCommandName}from"./chunk-EFGZK6OY.js";import{output_manager_default}from"./chunk-RIXTYUYN.js";import{require_dist}from"./chunk-4SIQE2W4.js";import{createHelpTheme,help,helpCommand}from"./chunk-7TREJIPV.js";import{CONTROL_CHARACTERS,FORMAT_CHARACTERS}from"./chunk-AUCQKYL2.js";import{getFlagsSpecification,normalizeFlagName}from"./chunk-CUO3CYU3.js";import{require_source}from"./chunk-UJ7YUIEJ.js";import{__toESM}from"./chunk-NBPLUP7C.js";import{spawn as spawn2}from"child_process";var CURL_SHORT_OPTIONS_WITH_VALUE="EKCbcdDFPHhmoUQreXYytzTuAwx",CURL_LONG_OPTIONS_WITH_VALUE=new Set(["--aws-sigv4","--cert","--config","--continue-at","--cookie","--cookie-jar","--data","--data-ascii","--data-binary","--data-raw","--data-urlencode","--dump-header","--form","--form-string","--ftp-port","--header","--json","--key","--max-time","--oauth2-bearer","--output","--pass","--proxy","--proxy-cert","--proxy-header","--proxy-key","--proxy-pass","--proxy-user","--quote","--range","--referer","--request","--speed-limit","--speed-time","--telnet-option","--time-cond","--upload-file","--url","--url-query","--user","--user-agent","--variable","--write-out"]),LONG_OPTION_NAME=/^--[A-Za-z0-9][A-Za-z0-9.-]*$/,SHORT_OPTIONS=/^-[A-Za-z0-9:#]+$/,REDACTED="[REDACTED]",HEADER_OPTIONS=new Set(["--header","-H","--proxy-header"]),KEPT_VALUE_OPTIONS=new Set(["--url"]),HEADER_NAME=/^([!#$%&'*+.^_`|~0-9A-Za-z-]+):/;function redactValue(value,option){if(option!==void 0&&KEPT_VALUE_OPTIONS.has(option))return value;if(option!==void 0&&HEADER_OPTIONS.has(option)){let name=HEADER_NAME.exec(value)?.[1];if(name)return`${name}: ${REDACTED}`}return REDACTED}function redactCurlArgs(args){let out=[],option,takesNext=!1;for(let arg of args){if(takesNext){out.push(redactValue(arg,option)),option=void 0,takesNext=!1;continue}let name=normalizeFlagName(arg);if(LONG_OPTION_NAME.test(name)){arg.includes("=")?(out.push(`${name}=${redactValue(arg.slice(name.length+1),name)}`),option=void 0):(out.push(name),option=name,takesNext=CURL_LONG_OPTIONS_WITH_VALUE.has(name));continue}if(arg!=="--"&&SHORT_OPTIONS.test(arg.slice(0,2))){option=void 0;let short=SHORT_OPTIONS.test(arg)?arg:REDACTED;for(let i=1;i<arg.length;i++){if(!CURL_SHORT_OPTIONS_WITH_VALUE.includes(arg[i]))continue;let letter=`-${arg[i]}`;i===arg.length-1?(option=letter,takesNext=!0):short=`${arg.slice(0,i+1)}${redactValue(arg.slice(i+1),letter)}`;break}out.push(short);continue}out.push(arg==="--"?arg:redactValue(arg,option)),option=void 0}return out}var requoteArgs=arg=>arg.includes(" ")?arg.includes('"')?`'${arg}'`:`"${arg}"`:arg;var CurlTelemetryClient=class extends TelemetryClient{trackCliArgumentPath(path){if(path){let value=path.startsWith("/")?"slash":"no-slash";this.trackCliArgument({arg:"path",value})}}trackCliOptionDeployment(deploymentId){if(deploymentId){let value=deploymentId.startsWith("http://")||deploymentId.startsWith("https://")?"url":deploymentId.startsWith("dpl_")?"dpl_":"no-prefix";this.trackCliOption({option:"deployment",value})}}trackCliOptionProtectionBypass(secret){secret&&this.trackCliOption({option:"protection-bypass",value:this.redactedValue})}trackCliFlagYes(yes){yes&&this.trackCliFlag("yes")}trackCliFlagTrace(trace2){trace2&&this.trackCliFlag("trace")}trackCliFlagJson(json){json&&this.trackCliFlag("json")}trackCliFlagYesOnProduction(value){value&&this.trackCliFlag("yes-on-production")}};var import_chalk=__toESM(require_source(),1),import_error_utils=__toESM(require_dist(),1);function getDeploymentSelectorUrl(selector){try{return new URL(selector.startsWith("http://")||selector.startsWith("https://")?selector:`https://${selector}`)}catch{return null}}function getDeploymentLookupHost(selector){return selector.includes(".")?getDeploymentSelectorUrl(selector)?.hostname??selector:selector}async function getDeploymentAccounts(client){if(detectExplicitScope(client))return client.config.currentTeam?[client.config.currentTeam]:[];let currentTeam=client.config.currentTeam;try{return(await getTeams(client)).filter(team=>!team.limited).map(team=>team.id).sort((a,b)=>+(b===currentTeam)-+(a===currentTeam))}catch(err){if(!(err instanceof InvalidToken))throw err;let token=await introspectToken(client).catch(()=>null);if(token&&resolveAppFromToken(token))return token.team?[token.team.id]:[];if(currentTeam)return[currentTeam];throw err}}async function resolveDeployment(client,selector,accountId){let hostOrId=getDeploymentLookupHost(selector),endpoint=`/v13/deployments/${encodeURIComponent(hostOrId)}`,lookup=async accountId2=>{try{let deployment2=await client.fetch(endpoint,{useCurrentTeam:!1,...accountId2?{accountId:accountId2}:{},bailOn429:!0});return deployment2?{...deployment2,ownerId:deployment2.ownerId??deployment2.team?.id}:null}catch(err){if(!isAPIError(err)||err.status!==403&&err.status!==404)throw err;return output_manager_default.debug(`Deployment lookup failed for ${hostOrId}: ${err}`),null}};if(accountId||detectExplicitScope(client))return lookup(accountId??client.config.currentTeam);let deployment=await lookup();if(deployment?.projectId&&deployment.ownerId)return deployment;let accounts;try{accounts=await getDeploymentAccounts(client)}catch(err){if(deployment?.url)return deployment;throw err}for(let account of accounts){let scoped=await lookup(account);if(scoped?.projectId&&scoped.ownerId)return scoped;deployment??=scoped}return deployment}async function getDeploymentUrlById(client,deploymentIdOrUrl,accountId){try{if(deploymentIdOrUrl.startsWith("http://")||deploymentIdOrUrl.startsWith("https://"))try{return new URL(deploymentIdOrUrl).origin}catch{return output_manager_default.debug(`Invalid deployment URL provided: ${deploymentIdOrUrl}`),null}if(deploymentIdOrUrl.includes("vercel.app")){let url=getDeploymentSelectorUrl(deploymentIdOrUrl);return url?url.origin:(output_manager_default.debug(`Invalid deployment URL provided: ${deploymentIdOrUrl}`),null)}let fullDeploymentId=deploymentIdOrUrl;fullDeploymentId.startsWith("dpl_")||(fullDeploymentId=`dpl_${deploymentIdOrUrl}`);let deployment=await resolveDeployment(client,fullDeploymentId,accountId);return!deployment||!deployment.url?null:`https://${deployment.url}`}catch(error){return output_manager_default.debug(`Failed to fetch deployment by ID: ${error}`),null}}function looksLikeHostname(path){let firstSegment=path.split("/")[0];return firstSegment.includes(".")&&!firstSegment.startsWith(".")}function orgFromOwner(id,slug=id){return{type:id.startsWith("team_")?"team":"user",id,slug}}var VC_STRING_FLAGS=new Set(["--deployment","--protection-bypass"]),VC_IGNORED_STRING_FLAGS=new Set(["--scope","--team","--token","-t"]),VC_IGNORED_BOOLEAN_FLAGS=new Set(["--debug"]),VC_BOOLEAN_FLAGS=new Set(["--yes","--help","--trace","--json"]);function flagName(arg){let eqIdx=arg.indexOf("=");return eqIdx===-1?arg:arg.slice(0,eqIdx)}function flagValue(args,index){let arg=args[index],eqIdx=arg.indexOf("=");if(eqIdx!==-1)return arg.slice(eqIdx+1);let next=args[index+1];return next&&!next.startsWith("-")?next:void 0}function getCurlLikeArgs(rawArgs,commandName){if(rawArgs[0]===commandName)return rawArgs.slice(1);let commandIndex=0;for(;commandIndex<rawArgs.length;){let arg=rawArgs[commandIndex];if(VC_IGNORED_BOOLEAN_FLAGS.has(flagName(arg))){commandIndex++;continue}if(!VC_IGNORED_STRING_FLAGS.has(flagName(arg)))break;commandIndex++,!arg.includes("=")&&commandIndex<rawArgs.length&&commandIndex++}return rawArgs[commandIndex]===commandName?rawArgs.slice(commandIndex+1):[...rawArgs]}function parseCurlLikeArgs(rawArgs,commandName){let result={target:void 0,deployment:void 0,protectionBypass:void 0,yes:!1,help:!1,trace:!1,json:!1,toolFlags:[]},args=getCurlLikeArgs(rawArgs,commandName),separatorIndex=args.indexOf("--"),beforeSeparator=separatorIndex===-1?args:args.slice(0,separatorIndex),afterSeparator=separatorIndex===-1?[]:args.slice(separatorIndex+1);for(let i=0;i<beforeSeparator.length;i++){let arg=beforeSeparator[i],name=flagName(arg);if(VC_STRING_FLAGS.has(name)){let value=flagValue(beforeSeparator,i);!arg.includes("=")&&value!==void 0&&i++,name==="--deployment"?result.deployment=value:result.protectionBypass=value;continue}if(!VC_IGNORED_BOOLEAN_FLAGS.has(name)){if(VC_IGNORED_STRING_FLAGS.has(name)){let value=flagValue(beforeSeparator,i);!arg.includes("=")&&value!==void 0&&i++;continue}if(VC_BOOLEAN_FLAGS.has(name)){name==="--yes"?result.yes=!0:name==="--trace"?result.trace=!0:name==="--json"?result.json=!0:result.help=!0;continue}if(!result.target&&name==="--url"){let value=flagValue(beforeSeparator,i);!arg.includes("=")&&value!==void 0&&i++,result.target=value;continue}!result.target&&!arg.startsWith("-")?result.target=arg:result.toolFlags.push(arg)}}return result.toolFlags.push(...afterSeparator),result}function setupCurlLikeCommand(client,command,telemetryClient,options={}){let{print}=output_manager_default;if(options.allowFullUrl){let parsed=parseCurlLikeArgs(options.args??client.argv.slice(2),command.name);if(parsed.help)return print(help(command,{stream:client.stderr,columns:client.stderr.columns})),0;let path2=parsed.target;if(telemetryClient.trackCliArgumentPath(path2),parsed.deployment&&telemetryClient.trackCliOptionDeployment(parsed.deployment),parsed.protectionBypass&&telemetryClient.trackCliOptionProtectionBypass(parsed.protectionBypass),!path2)return output_manager_default.error(`${getCommandName(`${command.name} <url|path>`)} requires a URL or API path (e.g., 'https://example.vercel.app/api/hello' or '/api/hello')`),print(help(command,{stream:client.stderr,columns:client.stderr.columns})),2;let isFullUrl2=path2.startsWith("http://")||path2.startsWith("https://");return!isFullUrl2&&looksLikeHostname(path2)&&(isFullUrl2=!0),output_manager_default.debug(`${command.name} options (${parsed.toolFlags.length} args): ${JSON.stringify(redactCurlArgs(parsed.toolFlags))}`),{path:isFullUrl2&&!path2.startsWith("http")?`https://${path2}`:path2,isFullUrl:isFullUrl2,deploymentFlag:parsed.deployment,protectionBypassFlag:parsed.protectionBypass,toolFlags:parsed.toolFlags,yes:parsed.yes,trace:parsed.trace,json:parsed.json}}let parsedArgs=null,flagsSpecification=getFlagsSpecification(command.options);try{parsedArgs=parseArguments(client.argv.slice(2),flagsSpecification)}catch(err){return printError(err),2}let{flags}=parsedArgs;if(parsedArgs.flags["--help"])return print(help(command,{stream:client.stderr,columns:client.stderr.columns})),0;parsedArgs.args[0]===command.name&&parsedArgs.args.shift();let separatorIndex=process.argv.indexOf("--"),path=parsedArgs.args[0];telemetryClient.trackCliArgumentPath(path);let deploymentFlag=flags["--deployment"];deploymentFlag&&telemetryClient.trackCliOptionDeployment(deploymentFlag);let protectionBypassFlag=flags["--protection-bypass"];if(protectionBypassFlag&&telemetryClient.trackCliOptionProtectionBypass(protectionBypassFlag),!path||path==="--"||path.startsWith("-"))return options.allowFullUrl?output_manager_default.error(`${getCommandName(`${command.name} <url|path>`)} requires a URL or API path (e.g., 'https://example.vercel.app/api/hello' or '/api/hello')`):output_manager_default.error(`${getCommandName(`${command.name} <path>`)} requires an API path (e.g., '/' or '/api/hello' or 'api/hello')`),print(help(command,{stream:client.stderr,columns:client.stderr.columns})),1;let isFullUrl=path.startsWith("http://")||path.startsWith("https://");if(!isFullUrl&&looksLikeHostname(path)&&(isFullUrl=!0),isFullUrl&&!options.allowFullUrl)return output_manager_default.error("The <path> argument must be a relative API path (e.g., '/' or '/api/hello'), not a full URL."),output_manager_default.print("To target a specific deployment within the currently linked project, use the --deployment <id|url> option."),print(help(command,{stream:client.stderr,columns:client.stderr.columns})),1;let toolFlags=separatorIndex!==-1?process.argv.slice(separatorIndex+1):[];return output_manager_default.debug(`${command.name} options (${toolFlags.length} args): ${JSON.stringify(redactCurlArgs(toolFlags))}`),{path:isFullUrl&&!path.startsWith("http")?`https://${path}`:path,isFullUrl,deploymentFlag,protectionBypassFlag,toolFlags,yes:!!flags["--yes"],trace:!!flags["--trace"],json:!!flags["--json"]}}function requestHost(url){let authority=/^[a-z][a-z0-9+.-]*:\/\/([^/?#]*)/i.exec(url)?.[1];if(!authority)return null;try{let parsed=new URL(url);return parsed.hostname===authority.toLowerCase()?parsed.hostname:null}catch{return null}}async function resolveProjectFromUrl(client,host){try{let deployment=await resolveDeployment(client,host);if(deployment){let link=await linkFromDeployment(client,deployment);if(link)return link}}catch(err){if(output_manager_default.debug(`Deployment lookup failed for ${host}: ${err}`),isAPIError(err)&&err.status===429)return null}try{let aliasUrl=`/now/aliases/${encodeURIComponent(host)}`;try{let alias=await client.fetch(aliasUrl,{useCurrentTeam:!1,...detectExplicitScope(client)?{accountId:client.config.currentTeam}:{}});if(alias.projectId&&alias.ownerId)return{status:"linked",project:await client.fetch(`/v9/projects/${encodeURIComponent(alias.projectId)}`,{accountId:alias.ownerId}),org:orgFromOwner(alias.ownerId)}}catch(err){output_manager_default.debug(`User alias lookup failed for ${host}: ${err}`)}for(let accountId of await getDeploymentAccounts(client))try{let alias=await client.fetch(aliasUrl,{accountId}),projectId=alias.projectId,ownerId=alias.ownerId||accountId;if(projectId)return{status:"linked",project:await client.fetch(`/v9/projects/${encodeURIComponent(projectId)}`,{accountId:ownerId}),org:orgFromOwner(ownerId)}}catch(err){output_manager_default.debug(`Alias lookup failed for ${host} in ${accountId}: ${err}`)}}catch(err){output_manager_default.debug(`Team lookup failed for ${host}: ${err}`)}return null}async function getFullUrlAndToken(client,fullUrl,protectionBypassFlag){if(protectionBypassFlag)return{fullUrl,deploymentProtectionToken:omitBypassOnPlainHttp(fullUrl,protectionBypassFlag),link:null};if(process.env.VERCEL_AUTOMATION_BYPASS_SECRET){let secret=process.env.VERCEL_AUTOMATION_BYPASS_SECRET;return await isEnvironmentSecretBoundTo(client,fullUrl,secret)?(output_manager_default.debug("Using protection bypass secret from environment variable"),{fullUrl,deploymentProtectionToken:secret,link:null}):(output_manager_default.warn("Not sending VERCEL_AUTOMATION_BYPASS_SECRET: the URL is not an HTTPS deployment or alias of the project that owns it."),{fullUrl,deploymentProtectionToken:null,link:null})}let url;try{url=new URL(fullUrl)}catch{return{fullUrl,deploymentProtectionToken:null,link:null}}let link=await resolveProjectFromUrl(client,url.hostname),deploymentProtectionToken=null;if(link&&isHttpsUrl(fullUrl))try{deploymentProtectionToken=await getOrCreateDeploymentProtectionToken(client,link,{readinessUrl:url.href})}catch(err){output_manager_default.debug(`Failed to get deployment protection bypass token: ${err}`)}return{fullUrl:url.href,deploymentProtectionToken,link}}async function linkFromDeployment(client,deployment){return!deployment.projectId||!deployment.ownerId?null:{status:"linked",project:await client.fetch(`/v9/projects/${encodeURIComponent(deployment.projectId)}`,{accountId:deployment.ownerId}),org:orgFromOwner(deployment.ownerId)}}async function resolveTargetProject(client,deployment,deploymentFlag){try{let link=await linkFromDeployment(client,deployment);return link||output_manager_default.warn(`Deployment "${deploymentFlag}" is missing project metadata; proceeding without an automatic protection bypass token.`),link}catch(err){return output_manager_default.debug(`Failed to resolve deployment project: ${err}`),output_manager_default.warn(`Failed to load project for deployment "${deploymentFlag}"; proceeding without an automatic protection bypass token.`),null}}async function tryGetDeployment(client,selector){try{return await resolveDeployment(client,selector)}catch(err){return output_manager_default.debug(`Failed to resolve deployment: ${err}`),null}}async function tryLinkFromSelector(client,selector){try{let deployment=await resolveDeployment(client,selector);return deployment?await linkFromDeployment(client,deployment):null}catch(err){return output_manager_default.debug(`Failed to resolve trace project context: ${err}`),null}}async function getLinkedProjectOrNull(client){try{let linked=await getLinkedProject(client,{cwd:client.cwd});return linked.status==="linked"?linked:null}catch(err){return output_manager_default.debug(`Failed to load linked project: ${err}`),null}}function hasAutomationBypassToken(project){return Object.values(project.protectionBypass??{}).some(token=>token.scope==="automation-bypass")}function isHttpsUrl(url){try{return new URL(url).protocol==="https:"}catch{return!1}}function omitBypassOnPlainHttp(fullUrl,token){return token&&!isHttpsUrl(fullUrl)?(output_manager_default.warn("Not sending the protection bypass secret over a non-HTTPS URL."),null):token}async function isEnvironmentSecretBoundTo(client,fullUrl,secret){if(!isHttpsUrl(fullUrl))return!1;let host=requestHost(fullUrl);if(!host)return!1;let link=await resolveProjectFromUrl(client,host);return link!==null&&link.project.protectionBypass?.[secret]?.scope==="automation-bypass"}async function getDeploymentUrlAndToken(client,commandName,path,options){let{deploymentFlag,protectionBypassFlag,autoConfirm,resolveProjectForTrace}=options,environmentProtectionBypass=deploymentFlag&&!protectionBypassFlag&&process.env.VERCEL_AUTOMATION_BYPASS_SECRET||void 0,suppliedProtectionBypass=deploymentFlag?protectionBypassFlag??environmentProtectionBypass:protectionBypassFlag,link=null,createProtectionBypassIfMissing=!deploymentFlag,baseUrl;if(deploymentFlag){let requestedBaseUrl=deploymentFlag.startsWith("http://")||deploymentFlag.startsWith("https://")||deploymentFlag.includes("vercel.app")?await getDeploymentUrlById(client,deploymentFlag):null,deploymentSelector=deploymentFlag.includes(".")||deploymentFlag.startsWith("dpl_")?deploymentFlag:`dpl_${deploymentFlag}`;if(suppliedProtectionBypass!==void 0){if(baseUrl=requestedBaseUrl??await getDeploymentUrlById(client,deploymentFlag)??"",!baseUrl)return output_manager_default.error(`No deployment found for ID "${deploymentFlag}"`),1;resolveProjectForTrace&&(link=await tryLinkFromSelector(client,deploymentSelector)??await getLinkedProjectOrNull(client))}else{let deployment=await tryGetDeployment(client,deploymentSelector);if(baseUrl=requestedBaseUrl??(deployment?.url?`https://${deployment.url}`:""),!baseUrl)return output_manager_default.error(`No deployment found for ID "${deploymentFlag}"`),1;deployment?(link=await resolveTargetProject(client,deployment,deploymentFlag),link&&!hasAutomationBypassToken(link.project)&&(createProtectionBypassIfMissing=(await getLinkedProjectOrNull(client))?.project.id===link.project.id)):output_manager_default.warn(`Could not resolve project information for deployment "${deploymentFlag}"; proceeding without an automatic protection bypass token.`)}}else{try{await getScope(client)}catch(err){if((0,import_error_utils.isErrnoException)(err)&&(err.code==="NOT_AUTHORIZED"||err.code==="TEAM_DELETED"))return output_manager_default.error(err.message),1;throw err}let ensuredLink;try{ensuredLink=await ensureLink(commandName,client,client.cwd,{autoConfirm})}catch(err){if((0,import_error_utils.isErrnoException)(err)&&err.code==="NOT_AUTHORIZED")return output_manager_default.error(err.message),1;throw err}if(typeof ensuredLink=="number")return ensuredLink;link=ensuredLink;let{project}=ensuredLink;if(!project.targets&&!project.latestDeployments){let linkedProject=await getLinkedProject(client,{cwd:client.cwd});if(linkedProject.status!=="linked")return output_manager_default.error("This command requires a linked project. Please run:"),output_manager_default.print(" vercel link"),1;if(!linkedProject.project||!linkedProject.org)return output_manager_default.error("Failed to get project information"),1;project=linkedProject.project}let preferredAlias=project.targets?.production?.alias?.[0],backupAlias=project.latestDeployments?.[0]?.url,target=preferredAlias||backupAlias;if(!target)throw new Error("No deployment URL found for the project");baseUrl=`https://${target}`}let fullUrl=`${baseUrl}${path.startsWith("/")?path:`/${path}`}`;output_manager_default.debug(`${import_chalk.default.cyan("Target URL:")} ${import_chalk.default.bold(fullUrl)}`);let deploymentProtectionToken=suppliedProtectionBypass??null;if(suppliedProtectionBypass===void 0&&link?.project.id&&isHttpsUrl(fullUrl))try{deploymentProtectionToken=await getOrCreateDeploymentProtectionToken(client,link,{createIfMissing:createProtectionBypassIfMissing,readinessUrl:fullUrl})}catch(err){return output_manager_default.error(`Failed to get deployment protection bypass token: ${err instanceof Error?err.message:String(err)}`),1}return environmentProtectionBypass?await isEnvironmentSecretBoundTo(client,fullUrl,environmentProtectionBypass)||(output_manager_default.warn("Not sending VERCEL_AUTOMATION_BYPASS_SECRET: the URL is not an HTTPS deployment or alias of the project that owns it."),deploymentProtectionToken=null):deploymentProtectionToken=omitBypassOnPlainHttp(fullUrl,deploymentProtectionToken),{fullUrl,deploymentProtectionToken,link}}function traceCurl(root){let span=root?.child("vc.cli.curl"),finished=!1;return code=>{finished||(finished=!0,code!==0&&span?.setAttributes({error:"true"}),span?.stop())}}var import_error_utils2=__toESM(require_dist(),1);import{spawn}from"child_process";import{tmpdir}from"os";import{join as join2}from"path";import{mkdtemp,readFile as readFile2,rm}from"fs/promises";async function confirmProduction(client,{deploymentTarget,yes,isTTY}){return deploymentTarget!=="production"||yes?"proceed":isTTY?await client.input.confirm("You are about to capture a trace against a production deployment. Continue?",!1)?"proceed":"declined":(output_manager_default.error("Use --yes to capture traces on production from non-interactive contexts."),"non-tty-no-yes")}import{createHash}from"crypto";import{chmod,mkdir,readFile,unlink,writeFile}from"fs/promises";import{dirname,join}from"path";var FALLBACK_TTL_MS=5*60*1e3,EXPIRY_BUFFER_MS=30*1e3,CACHE_SCHEMA_VERSION=1;function resolveCacheDir(override){return override||join(getGlobalPathConfig(),"cache","traces")}function cacheFilename(teamId,host){let key=`${teamId??""}:${host}`;return`${createHash("sha256").update(key).digest("hex")}.json`}function cachePath(cacheDir,teamId,host){return join(cacheDir,cacheFilename(teamId,host))}async function readCache(path){let raw;try{raw=await readFile(path,"utf8")}catch{return null}try{let parsed=JSON.parse(raw);return!parsed||typeof parsed.token!="string"||typeof parsed.expiresAt!="number"||parsed.schemaVersion!==CACHE_SCHEMA_VERSION?null:parsed}catch{return output_manager_default.debug(`Trace cookie cache file is corrupt at ${path}; re-issuing.`),null}}async function writeCache(path,entry){await mkdir(dirname(path),{recursive:!0}),await writeFile(path,JSON.stringify(entry),{mode:384}),await chmod(path,384)}async function issueToken(client,{teamId,projectId,hostname}){let body=JSON.stringify({projectId,hostname}),response=await client.fetch("/v1/projects/traces/session",{method:"POST",body,headers:{"Content-Type":"application/json"},accountId:teamId});if(!response?.token)throw new Error("Trace session response is missing a token");let expiresAt=typeof response.expiresAt=="number"?response.expiresAt:Date.now()+FALLBACK_TTL_MS;return{token:response.token,expiresAt}}async function getTraceSessionToken({client,teamId,projectId,host,evictedToken,cacheDir}){let dir=resolveCacheDir(cacheDir),hostname=toHost(host),path=cachePath(dir,teamId,hostname),cached=await readCache(path);if(cached&&evictedToken&&cached.token===evictedToken)await unlink(path).catch(()=>{});else if(cached&&Date.now()<cached.expiresAt-EXPIRY_BUFFER_MS)return{token:cached.token,expiresAt:cached.expiresAt,fromCache:!0};let issued=await issueToken(client,{teamId,projectId,hostname});try{await writeCache(path,{token:issued.token,expiresAt:issued.expiresAt,schemaVersion:CACHE_SCHEMA_VERSION})}catch(err){output_manager_default.debug(`Failed to write trace cookie cache: ${err}`)}return{token:issued.token,expiresAt:issued.expiresAt,fromCache:!1}}var TRACE_COOKIE_NAME="_vercel_tracing",SESSION_COOKIE_NAME="_vercel_session";async function lookupDeployment(client,fullUrl,accountId){let deployment=await resolveDeployment(client,fullUrl,accountId);if(!deployment)throw new Error("Deployment not found");return deployment}function resolveTeamId(link,deployment){if(link?.org.type==="team")return link.org.id;if(deployment.ownerId?.startsWith("team_"))return deployment.ownerId}function extractVercelId(headerDump){let lines=headerDump.split(/\r?\n/),lastValue;for(let line of lines){let idx=line.indexOf(":");if(idx===-1)continue;line.slice(0,idx).trim().toLowerCase()==="x-vercel-id"&&(lastValue=line.slice(idx+1).trim())}if(!lastValue)return;let sepIdx=lastValue.lastIndexOf("::");return sepIdx===-1?lastValue:lastValue.slice(sepIdx+2)}function extractFinalStatus(headerDump){let lines=headerDump.split(/\r?\n/),lastStatus;for(let line of lines){let match=line.match(/^HTTP\/[\d.]+\s+(\d{3})/);match&&(lastStatus=Number(match[1]))}return lastStatus}async function runCurlAndCaptureHeaders(client,curlFlags,json){let tmpDir=await mkdtemp(join2(tmpdir(),"vc-curl-trace-")),headerFile=join2(tmpDir,"headers"),flags=["--dump-header",headerFile,...curlFlags];try{let{exitCode,capturedBody}=await new Promise(resolve=>{let finishTrace=traceCurl(client.telemetryEventStore.enabled?client.rootSpan:void 0),child=spawn("curl",flags,{stdio:json?["inherit","pipe","inherit"]:"inherit",shell:!1}),buf="";json&&child.stdout&&(child.stdout.setEncoding("utf8"),child.stdout.on("data",chunk=>{buf+=chunk})),child.on("error",err=>{finishTrace(1),err.code==="ENOENT"?output_manager_default.error("curl command not found. Please install curl."):output_manager_default.error(`Failed to execute curl: ${err.message}`),resolve({exitCode:1,capturedBody:buf})}),child.on("close",code=>{finishTrace(code),resolve({exitCode:code??1,capturedBody:buf})})}),headerDump="";try{headerDump=await readFile2(headerFile,"utf8")}catch(err){output_manager_default.debug(`Failed to read curl header dump: ${err}`)}return{exitCode,headerDump,capturedBody}}finally{await rm(tmpDir,{recursive:!0,force:!0}).catch(()=>{})}}async function trace(client,{fullUrl,link,curlFlags,json,yes,telemetry}){telemetry.trackCliFlagTrace(!0),json&&telemetry.trackCliFlagJson(!0);let accountId=link?.org.id,deployment;try{deployment=await lookupDeployment(client,fullUrl,accountId)}catch(err){return output_manager_default.error(`Failed to look up deployment for tracing: ${err instanceof Error?err.message:String(err)}`),1}let projectId=link?.project.id??deployment.projectId;if(!projectId)return output_manager_default.error("Could not resolve project for trace session. Run `vercel link` and retry."),1;let teamId=resolveTeamId(link,deployment),userId;try{userId=client.authConfig.userId??(await getUser(client)).id}catch(err){return output_manager_default.error(`Failed to resolve user for trace session: ${(0,import_error_utils2.errorToString)(err)}`),1}let deploymentTarget=deployment.target==="production"?"production":"preview",confirmation=await confirmProduction(client,{deploymentTarget,yes,isTTY:!!client.stdin.isTTY});if(confirmation==="non-tty-no-yes")return 1;if(confirmation==="declined")return output_manager_default.log("Trace cancelled."),0;deploymentTarget==="production"&&yes&&telemetry.trackCliFlagYesOnProduction(!0);let session;try{session=await getTraceSessionToken({client,teamId,projectId,host:fullUrl})}catch(err){return output_manager_default.error(`Failed to acquire trace session: ${err instanceof Error?err.message:String(err)}`),1}let{exitCode,headerDump,capturedBody}=await runCurlWithCookie(client,session.token,userId,curlFlags,json);if(session.fromCache&&extractFinalStatus(headerDump)===401&&exitCode===0){output_manager_default.debug("Trace cookie returned 401; evicting cache and retrying.");let refreshed;try{refreshed=await getTraceSessionToken({client,teamId,projectId,host:fullUrl,evictedToken:session.token})}catch(err){return output_manager_default.error(`Failed to refresh trace session after 401: ${err instanceof Error?err.message:String(err)}`),1}({exitCode,headerDump,capturedBody}=await runCurlWithCookie(client,refreshed.token,userId,curlFlags,json))}let requestId=extractVercelId(headerDump);return json?(client.stdout.write(`${JSON.stringify({response:capturedBody,requestId:requestId??null},null,2)}
|
|
8
8
|
`),requestId?exitCode:exitCode===0?1:exitCode):requestId?(client.stderr.write(`
|
|
9
9
|
Run \`vercel traces inspect ${requestId}\` to fetch the trace.
|
|
10
10
|
`),exitCode):(output_manager_default.error("Trace cookie was set but the response did not include an x-vercel-id header."),exitCode===0?1:exitCode)}async function runCurlWithCookie(client,token,userId,curlFlags,json){let flagsWithCookie=["--header",`Cookie: ${TRACE_COOKIE_NAME}=${token}; ${SESSION_COOKIE_NAME}=${userId}`,...curlFlags];return output_manager_default.debug(`Executing: curl ${redactCurlArgs(flagsWithCookie).map(requoteArgs).join(" ")}`),runCurlAndCaptureHeaders(client,flagsWithCookie,json)}async function curl(client){return runCurl(client,{})}async function runCurl(client,{forceTrace=!1,args}){let telemetryClient=new CurlTelemetryClient({opts:{store:client.telemetryEventStore}}),setup=setupCurlLikeCommand(client,curlCommand,telemetryClient,{allowFullUrl:!0,args});if(typeof setup=="number")return setup;let{path,isFullUrl,deploymentFlag,protectionBypassFlag,toolFlags,json:jsonFlag}=setup,unsupportedFlag=toolFlags.find(escapesRedirectLimit);if(unsupportedFlag)return output_manager_default.error(`${cmd(unsupportedFlag)} is not supported by ${getCommandName("curl")}.`),2;let traceFlag=forceTrace||setup.trace,result=isFullUrl?await getFullUrlAndToken(client,path,protectionBypassFlag):await getDeploymentUrlAndToken(client,"curl",path,{deploymentFlag,protectionBypassFlag,autoConfirm:setup.yes,resolveProjectForTrace:traceFlag});if(typeof result=="number")return result;let{fullUrl,deploymentProtectionToken}=result;if(deploymentProtectionToken){let secondDestination=toolFlags.find(isSecondDestination);if(secondDestination)return output_manager_default.error(`${nameSecondDestination(secondDestination)} would be a second destination, and every destination receives the Deployment Protection header. Pass one URL per request.`),2}if((deploymentProtectionToken||traceFlag)&&(hasAdditionalDestination(toolFlags)||toolFlags.some(reroutesRequest)))return output_manager_default.error(`${getCommandName("curl")} sends a bypass secret or trace cookie to one URL per run. Run it once per URL.`),2;let curlFlags=[...toolFlags];if(deploymentProtectionToken&&(curlFlags.unshift("--header",`x-vercel-protection-bypass: ${deploymentProtectionToken}`),curlFlags.push("--max-redirs","0")),curlFlags.unshift("--url",fullUrl),traceFlag)return trace(client,{fullUrl,link:result.link??null,curlFlags,json:jsonFlag,yes:setup.yes,telemetry:telemetryClient});if(output_manager_default.debug(`Executing: curl ${redactCurlArgs(curlFlags).map(requoteArgs).join(" ")}`),deploymentProtectionToken&&bypassesProtection(result.link,fullUrl)){output_manager_default.warning("This request bypasses Deployment Protection, so its response doesn't show whether the URL is public.");let hint=helpCommand(`curl ${shellQuote(encodeHiddenCharacters(fullUrl))}`,[],createHelpTheme(client.stderr));output_manager_default.print(`
|
|
@@ -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{packageName}from"./chunk-EFGZK6OY.js";import{confirmNameOption,jsonOption,limitOption,projectOption,yesOption}from"./chunk-DORCX7UB.js";var listSubcommand={name:"list",aliases:["ls"],description:"List all routing rules for the current project. These routes apply to all deployments and environments.",arguments:[],options:[projectOption,jsonOption,{name:"query",description:"Search by name, description, source, or destination",shorthand:"q",type:String,argument:"TEXT",deprecated:!1},{name:"search",description:"Deprecated alias for `--query`",shorthand:"s",type:String,argument:"QUERY",deprecated:!0},{name:"type",description:"Filter by type: rewrite, redirect, set_status, transform",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"filter",description:"Deprecated alias for `--type`",shorthand:"f",type:String,argument:"TYPE",deprecated:!0},{name:"production",description:"List routes from the live production version",shorthand:null,type:Boolean,deprecated:!1},{name:"routes-version",description:"List routes from a specific version",shorthand:null,type:String,argument:"VERSION",deprecated:!1},{name:"version-id",description:"Deprecated alias for `--routes-version`",shorthand:null,type:String,argument:"VERSION_ID",deprecated:!0},{name:"diff",description:"Compare staged changes against production. Use with --routes-version to compare a specific version.",shorthand:null,type:Boolean,deprecated:!1},{name:"expand",description:"Show expanded details for each route",shorthand:null,deprecatedShorthand:"e",type:Boolean,deprecated:!1}],examples:[{name:"List all routes",value:`${packageName} routes list`},{name:"Search for routes",value:`${packageName} routes list --query "api"`},{name:"Filter by type",value:`${packageName} routes list --type rewrite`},{name:"Show staged changes",value:`${packageName} routes list --diff`},{name:"Show live production routes",value:`${packageName} routes list --production`},{name:"Show expanded details",value:`${packageName} routes list --expand`}]},listVersionsSubcommand={name:"list-versions",aliases:["ls-versions"],description:"List all versions of routing rules",arguments:[],options:[projectOption,jsonOption,{...limitOption,description:"Number of versions to fetch (default: 20, max: 100)"},{name:"count",description:"Deprecated alias for `--limit`",shorthand:null,type:Number,argument:"NUMBER",deprecated:!0}],examples:[{name:"List route versions",value:`${packageName} routes list-versions`},{name:"List more versions",value:`${packageName} routes list-versions --limit 50`}]},inspectSubcommand={name:"inspect",aliases:[],description:"Show detailed information about a specific route",arguments:[{name:"name-or-id",required:!0}],options:[projectOption,jsonOption,{name:"diff",description:"Compare staged changes against production for this route",shorthand:null,type:Boolean,deprecated:!1}],examples:[{name:"Inspect a route by name",value:`${packageName} routes inspect "API rewrite"`},{name:"Inspect a route by ID",value:`${packageName} routes inspect abc123`},{name:"Show staged changes for a route",value:`${packageName} routes inspect "My route" --diff`}]},addSubcommand={name:"add",aliases:[],description:"Add a new routing rule to the project",arguments:[{name:"name",required:!1}],options:[projectOption,{name:"src",description:"Path pattern (required in non-interactive mode)",shorthand:null,type:String,argument:"PATTERN",deprecated:!1},{name:"src-syntax",description:"Path syntax: regex, path-to-regexp, equals (default: regex)",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"action",description:"Action type: rewrite, redirect, or set-status (required with --dest/--status)",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"dest",description:"Destination URL for rewrite or redirect",shorthand:null,type:String,argument:"URL",deprecated:!1},{name:"status",description:"Status code (301/302/307/308 for redirect, or any for set-status)",shorthand:null,type:Number,argument:"CODE",deprecated:!1},{name:"set-response-header",description:"Set response header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"append-response-header",description:"Append to response header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"delete-response-header",description:"Delete response header: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"set-request-header",description:"Set request header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"append-request-header",description:"Append to request header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"delete-request-header",description:"Delete request header: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"set-request-query",description:"Set query parameter: key=value (repeatable)",shorthand:null,type:[String],argument:"PARAM",deprecated:!1},{name:"append-request-query",description:"Append to query parameter: key=value (repeatable)",shorthand:null,type:[String],argument:"PARAM",deprecated:!1},{name:"delete-request-query",description:"Delete query parameter: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"has",description:"Condition that must match: type:key or type:key:value (repeatable)",shorthand:null,type:[String],argument:"CONDITION",deprecated:!1},{name:"missing",description:'"Does not have" condition: type:key or type:key:value (repeatable)',shorthand:null,type:[String],argument:"CONDITION",deprecated:!1},{name:"description",description:"Route description (max 1024 chars)",shorthand:null,type:String,argument:"TEXT",deprecated:!1},{name:"no-enable",description:"Add the route turned off (default: on)",shorthand:null,type:Boolean,deprecated:!1},{name:"disabled",description:"Deprecated alias for `--no-enable`",shorthand:null,type:Boolean,deprecated:!0},{name:"ai",description:"Generate route from a natural language description (AI-powered)",shorthand:null,type:String,argument:"PROMPT",deprecated:!1},{name:"position",description:"Position: start, end, after:<id>, before:<id>",shorthand:null,type:String,argument:"POSITION",deprecated:!1},{name:"yes",description:"Skip confirmation prompts",shorthand:"y",type:Boolean,deprecated:!1}],examples:[{name:"Interactive mode",value:`${packageName} routes add`},{name:"Create with AI",value:`${packageName} routes add --ai "Rewrite /api/* to https://backend.internal/*"`},{name:"Add a rewrite",value:`${packageName} routes add "API Proxy" --src "/api/:path*" --src-syntax path-to-regexp --action rewrite --dest "https://api.example.com/:path*" --yes`},{name:"Add a redirect",value:`${packageName} routes add "Old Blog" --src "/blog" --src-syntax equals --action redirect --dest "/articles" --status 301 --yes`},{name:"Add CORS headers",value:`${packageName} routes add "CORS" --src "^/api/.*$" --set-response-header "Access-Control-Allow-Origin=*" --yes`},{name:"Block access (set status)",value:`${packageName} routes add "Block Admin" --src "^/admin/.*$" --action set-status --status 403 --yes`},{name:"Conditional redirect",value:`${packageName} routes add "Auth Required" --src "/protected/:path*" --src-syntax path-to-regexp --action redirect --dest "/login" --status 307 --missing "cookie:session" --yes`},{name:"Rewrite with request headers",value:`${packageName} routes add "Backend Proxy" --src "/backend/:path*" --src-syntax path-to-regexp --action rewrite --dest "https://internal.example.com/:path*" --set-request-header "X-Forwarded-Host=myapp.com" --yes`},{name:"Add route at start",value:`${packageName} routes add "Priority Route" --src "/priority" --src-syntax equals --action rewrite --dest "/handler" --position start --yes`}]},publishSubcommand={name:"publish",aliases:[],description:"Publish all staged routing changes to production",arguments:[],options:[projectOption,{...yesOption,description:"Skip the confirmation prompt when publishing"}],examples:[{name:"Publish staged changes",value:`${packageName} routes publish`},{name:"Publish without confirmation",value:`${packageName} routes publish --yes`}]},restoreSubcommand={name:"restore",aliases:[],description:"Restore a previous routing version to production",arguments:[{name:"version-id",required:!0}],options:[projectOption,{...yesOption,description:"Skip the confirmation prompt when restoring"}],examples:[{name:"Restore a previous version",placeholders:["<version-id>"],value:`${packageName} routes restore <version-id>`},{name:"Restore without confirmation",placeholders:["<version-id>"],value:`${packageName} routes restore <version-id> --yes`}]},discardSubcommand={name:"discard-staging",aliases:[],description:"Discard staged routing changes",arguments:[],options:[projectOption,{...yesOption,description:"Skip the confirmation prompt when discarding"}],examples:[{name:"Discard staged changes",value:`${packageName} routes discard-staging`},{name:"Discard without confirmation",value:`${packageName} routes discard-staging --yes`}]},deleteSubcommand={name:"remove",aliases:["rm","delete"],description:"Remove one or more routing rules",arguments:[{name:"name-or-id",required:!0,multiple:!0}],options:[projectOption,{...confirmNameOption,type:[String],description:"Approve the removal by naming each route ID. Repeat it once for each"},{...yesOption,description:"Deprecated: use --confirm-name. Agents can't approve with --yes"}],examples:[{name:"Remove a route by name",value:`${packageName} routes remove "Old Redirect"`},{name:"Remove a route by ID",value:`${packageName} routes remove abc123`},{name:"Remove multiple routes",value:`${packageName} routes remove "Route A" "Route B"`},{name:"Remove without a prompt, once a person approves",value:`${packageName} routes remove "Old Route" --confirm-name abc123`}],consequence:"destructive"},enableSubcommand={name:"enable",aliases:[],description:"Enable a disabled routing rule",arguments:[{name:"name-or-id",required:!0}],options:[projectOption],examples:[{name:"Enable a route by name",value:`${packageName} routes enable "API Proxy"`},{name:"Enable a route by ID",value:`${packageName} routes enable abc123`}]},disableSubcommand={name:"disable",aliases:[],description:"Disable a routing rule without deleting it",arguments:[{name:"name-or-id",required:!0}],options:[projectOption],examples:[{name:"Disable a route by name",value:`${packageName} routes disable "API Proxy"`},{name:"Disable a route by ID",value:`${packageName} routes disable abc123`}]},reorderSubcommand={name:"move",aliases:["reorder"],description:"Move a routing rule to a different position",arguments:[{name:"name-or-id",required:!0}],options:[projectOption,{name:"position",description:"Target position: start, end, a number (1-based), before:<id>, after:<id>",shorthand:null,type:String,argument:"POSITION",deprecated:!1},{name:"first",description:"Move to the first position (highest priority)",shorthand:null,type:Boolean,deprecated:!1},{name:"last",description:"Move to the last position (lowest priority)",shorthand:null,type:Boolean,deprecated:!1},{...confirmNameOption,description:"Approve the move by naming the route ID"},{...yesOption,description:"Deprecated: use --confirm-name. Agents can't approve with --yes"}],examples:[{name:"Move to first position",value:`${packageName} routes move "Catch All" --first`},{name:"Move to last position",value:`${packageName} routes move "Catch All" --last`},{name:"Move to a specific position",value:`${packageName} routes move "API Proxy" --position 3`},{name:"Move after another route",value:`${packageName} routes move "API Proxy" --position after:route-id-123`},{name:"Interactive move (prompts for position)",value:`${packageName} routes move "API Proxy"`},{name:"Move without a prompt, once a person approves",value:`${packageName} routes move "API Proxy" --first --confirm-name abc123`}],consequence:"destructive"},editSubcommand={name:"update",aliases:["edit"],description:"Update an existing routing rule",arguments:[{name:"name-or-id",required:!0}],options:[projectOption,{name:"name",description:"Change route name",shorthand:null,type:String,argument:"NAME",deprecated:!1},{name:"description",description:'Change description (use "" to clear)',shorthand:null,type:String,argument:"TEXT",deprecated:!1},{name:"src",description:"Change source path pattern",shorthand:null,type:String,argument:"PATTERN",deprecated:!1},{name:"src-syntax",description:"Change path syntax: regex, path-to-regexp, equals",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"action",description:"Set action type: rewrite, redirect, or set-status (required when switching types)",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"dest",description:"Set destination URL",shorthand:null,type:String,argument:"URL",deprecated:!1},{name:"status",description:"Set status code",shorthand:null,type:Number,argument:"CODE",deprecated:!1},{name:"no-dest",description:"Remove destination",shorthand:null,type:Boolean,deprecated:!1},{name:"no-status",description:"Remove status code",shorthand:null,type:Boolean,deprecated:!1},{name:"set-response-header",description:"Set response header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"append-response-header",description:"Append to response header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"delete-response-header",description:"Delete response header: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"set-request-header",description:"Set request header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"append-request-header",description:"Append to request header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"delete-request-header",description:"Delete request header: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"set-request-query",description:"Set query parameter: key=value (repeatable)",shorthand:null,type:[String],argument:"PARAM",deprecated:!1},{name:"append-request-query",description:"Append to query parameter: key=value (repeatable)",shorthand:null,type:[String],argument:"PARAM",deprecated:!1},{name:"delete-request-query",description:"Delete query parameter: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"has",description:"Add a has condition: type:key or type:key:value (repeatable)",shorthand:null,type:[String],argument:"CONDITION",deprecated:!1},{name:"missing",description:'Add a "does not have" condition: type:key or type:key:value (repeatable)',shorthand:null,type:[String],argument:"CONDITION",deprecated:!1},{name:"clear-conditions",description:"Remove all has/does-not-have conditions",shorthand:null,type:Boolean,deprecated:!1},{name:"clear-headers",description:"Remove all response headers",shorthand:null,type:Boolean,deprecated:!1},{name:"clear-transforms",description:"Remove all transforms (request headers, request query)",shorthand:null,type:Boolean,deprecated:!1},{name:"ai",description:"Describe changes using natural language (AI-powered)",shorthand:null,type:String,argument:"PROMPT",deprecated:!1},{...yesOption,description:"Skip confirmation prompts"}],examples:[{name:"Interactive mode",value:`${packageName} routes update "API Proxy"`},{name:"Update with AI",value:`${packageName} routes update "API Proxy" --ai "Add CORS headers and change status to 308"`},{name:"Change destination",value:`${packageName} routes update "API Proxy" --dest "https://new-api.example.com/:path*"`},{name:"Switch to redirect",value:`${packageName} routes update "Old Route" --action redirect --dest "/new" --status 301`},{name:"Add a response header",value:`${packageName} routes update "My Route" --set-response-header "Cache-Control=public, max-age=3600"`},{name:"Clear all conditions and add new ones",value:`${packageName} routes update "My Route" --clear-conditions --has "header:Authorization"`}]},exportSubcommand={name:"export",aliases:[],description:"Export routes to a vercel.json or vercel.ts file",arguments:[{name:"name-or-id",required:!1}],options:[projectOption,{name:"output",description:"Output file format: .json or .ts (default: .json)",shorthand:"o",type:String,argument:"json|ts",deprecated:!1}],examples:[{name:"Export as vercel.json format",value:`${packageName} routes export`},{name:"Export as vercel.ts format",value:`${packageName} routes export --output ts`},{name:"Export a specific route",value:`${packageName} routes export "API Proxy"`},{name:"Export to a file",value:`${packageName} routes export > routes.json`}]},routesCommand={name:"routes",aliases:[],description:"Manage routing rules for a project. Routes managed at the project level apply to all deployments and environments.",arguments:[],subcommands:[listSubcommand,listVersionsSubcommand,inspectSubcommand,addSubcommand,editSubcommand,deleteSubcommand,enableSubcommand,disableSubcommand,reorderSubcommand,exportSubcommand,publishSubcommand,restoreSubcommand,discardSubcommand],options:[],examples:[]};export{listSubcommand,listVersionsSubcommand,inspectSubcommand,addSubcommand,publishSubcommand,restoreSubcommand,discardSubcommand,deleteSubcommand,enableSubcommand,disableSubcommand,reorderSubcommand,editSubcommand,exportSubcommand,routesCommand};
|
|
7
|
+
import{packageName}from"./chunk-EFGZK6OY.js";import{confirmNameOption,jsonOption,limitOption,projectOption,yesOption}from"./chunk-CUO3CYU3.js";var listSubcommand={name:"list",aliases:["ls"],description:"List all routing rules for the current project. These routes apply to all deployments and environments.",arguments:[],options:[projectOption,jsonOption,{name:"query",description:"Search by name, description, source, or destination",shorthand:"q",type:String,argument:"TEXT",deprecated:!1},{name:"search",description:"Deprecated alias for `--query`",shorthand:"s",type:String,argument:"QUERY",deprecated:!0},{name:"type",description:"Filter by type: rewrite, redirect, set_status, transform",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"filter",description:"Deprecated alias for `--type`",shorthand:"f",type:String,argument:"TYPE",deprecated:!0},{name:"production",description:"List routes from the live production version",shorthand:null,type:Boolean,deprecated:!1},{name:"routes-version",description:"List routes from a specific version",shorthand:null,type:String,argument:"VERSION",deprecated:!1},{name:"version-id",description:"Deprecated alias for `--routes-version`",shorthand:null,type:String,argument:"VERSION_ID",deprecated:!0},{name:"diff",description:"Compare staged changes against production. Use with --routes-version to compare a specific version.",shorthand:null,type:Boolean,deprecated:!1},{name:"expand",description:"Show expanded details for each route",shorthand:null,deprecatedShorthand:"e",type:Boolean,deprecated:!1}],examples:[{name:"List all routes",value:`${packageName} routes list`},{name:"Search for routes",value:`${packageName} routes list --query "api"`},{name:"Filter by type",value:`${packageName} routes list --type rewrite`},{name:"Show staged changes",value:`${packageName} routes list --diff`},{name:"Show live production routes",value:`${packageName} routes list --production`},{name:"Show expanded details",value:`${packageName} routes list --expand`}]},listVersionsSubcommand={name:"list-versions",aliases:["ls-versions"],description:"List all versions of routing rules",arguments:[],options:[projectOption,jsonOption,{...limitOption,description:"Number of versions to fetch (default: 20, max: 100)"},{name:"count",description:"Deprecated alias for `--limit`",shorthand:null,type:Number,argument:"NUMBER",deprecated:!0}],examples:[{name:"List route versions",value:`${packageName} routes list-versions`},{name:"List more versions",value:`${packageName} routes list-versions --limit 50`}]},inspectSubcommand={name:"inspect",aliases:[],description:"Show detailed information about a specific route",arguments:[{name:"name-or-id",required:!0}],options:[projectOption,jsonOption,{name:"diff",description:"Compare staged changes against production for this route",shorthand:null,type:Boolean,deprecated:!1}],examples:[{name:"Inspect a route by name",value:`${packageName} routes inspect "API rewrite"`},{name:"Inspect a route by ID",value:`${packageName} routes inspect abc123`},{name:"Show staged changes for a route",value:`${packageName} routes inspect "My route" --diff`}]},addSubcommand={name:"add",aliases:[],description:"Add a new routing rule to the project",arguments:[{name:"name",required:!1}],options:[projectOption,{name:"src",description:"Path pattern (required in non-interactive mode)",shorthand:null,type:String,argument:"PATTERN",deprecated:!1},{name:"src-syntax",description:"Path syntax: regex, path-to-regexp, equals (default: regex)",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"action",description:"Action type: rewrite, redirect, or set-status (required with --dest/--status)",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"dest",description:"Destination URL for rewrite or redirect",shorthand:null,type:String,argument:"URL",deprecated:!1},{name:"status",description:"Status code (301/302/307/308 for redirect, or any for set-status)",shorthand:null,type:Number,argument:"CODE",deprecated:!1},{name:"set-response-header",description:"Set response header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"append-response-header",description:"Append to response header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"delete-response-header",description:"Delete response header: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"set-request-header",description:"Set request header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"append-request-header",description:"Append to request header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"delete-request-header",description:"Delete request header: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"set-request-query",description:"Set query parameter: key=value (repeatable)",shorthand:null,type:[String],argument:"PARAM",deprecated:!1},{name:"append-request-query",description:"Append to query parameter: key=value (repeatable)",shorthand:null,type:[String],argument:"PARAM",deprecated:!1},{name:"delete-request-query",description:"Delete query parameter: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"has",description:"Condition that must match: type:key or type:key:value (repeatable)",shorthand:null,type:[String],argument:"CONDITION",deprecated:!1},{name:"missing",description:'"Does not have" condition: type:key or type:key:value (repeatable)',shorthand:null,type:[String],argument:"CONDITION",deprecated:!1},{name:"description",description:"Route description (max 1024 chars)",shorthand:null,type:String,argument:"TEXT",deprecated:!1},{name:"no-enable",description:"Add the route turned off (default: on)",shorthand:null,type:Boolean,deprecated:!1},{name:"disabled",description:"Deprecated alias for `--no-enable`",shorthand:null,type:Boolean,deprecated:!0},{name:"ai",description:"Generate route from a natural language description (AI-powered)",shorthand:null,type:String,argument:"PROMPT",deprecated:!1},{name:"position",description:"Position: start, end, after:<id>, before:<id>",shorthand:null,type:String,argument:"POSITION",deprecated:!1},{name:"yes",description:"Skip confirmation prompts",shorthand:"y",type:Boolean,deprecated:!1}],examples:[{name:"Interactive mode",value:`${packageName} routes add`},{name:"Create with AI",value:`${packageName} routes add --ai "Rewrite /api/* to https://backend.internal/*"`},{name:"Add a rewrite",value:`${packageName} routes add "API Proxy" --src "/api/:path*" --src-syntax path-to-regexp --action rewrite --dest "https://api.example.com/:path*" --yes`},{name:"Add a redirect",value:`${packageName} routes add "Old Blog" --src "/blog" --src-syntax equals --action redirect --dest "/articles" --status 301 --yes`},{name:"Add CORS headers",value:`${packageName} routes add "CORS" --src "^/api/.*$" --set-response-header "Access-Control-Allow-Origin=*" --yes`},{name:"Block access (set status)",value:`${packageName} routes add "Block Admin" --src "^/admin/.*$" --action set-status --status 403 --yes`},{name:"Conditional redirect",value:`${packageName} routes add "Auth Required" --src "/protected/:path*" --src-syntax path-to-regexp --action redirect --dest "/login" --status 307 --missing "cookie:session" --yes`},{name:"Rewrite with request headers",value:`${packageName} routes add "Backend Proxy" --src "/backend/:path*" --src-syntax path-to-regexp --action rewrite --dest "https://internal.example.com/:path*" --set-request-header "X-Forwarded-Host=myapp.com" --yes`},{name:"Add route at start",value:`${packageName} routes add "Priority Route" --src "/priority" --src-syntax equals --action rewrite --dest "/handler" --position start --yes`}]},publishSubcommand={name:"publish",aliases:[],description:"Publish all staged routing changes to production",arguments:[],options:[projectOption,{...yesOption,description:"Skip the confirmation prompt when publishing"}],examples:[{name:"Publish staged changes",value:`${packageName} routes publish`},{name:"Publish without confirmation",value:`${packageName} routes publish --yes`}]},restoreSubcommand={name:"restore",aliases:[],description:"Restore a previous routing version to production",arguments:[{name:"version-id",required:!0}],options:[projectOption,{...yesOption,description:"Skip the confirmation prompt when restoring"}],examples:[{name:"Restore a previous version",placeholders:["<version-id>"],value:`${packageName} routes restore <version-id>`},{name:"Restore without confirmation",placeholders:["<version-id>"],value:`${packageName} routes restore <version-id> --yes`}]},discardSubcommand={name:"discard-staging",aliases:[],description:"Discard staged routing changes",arguments:[],options:[projectOption,{...yesOption,description:"Skip the confirmation prompt when discarding"}],examples:[{name:"Discard staged changes",value:`${packageName} routes discard-staging`},{name:"Discard without confirmation",value:`${packageName} routes discard-staging --yes`}]},deleteSubcommand={name:"remove",aliases:["rm","delete"],description:"Remove one or more routing rules",arguments:[{name:"name-or-id",required:!0,multiple:!0}],options:[projectOption,{...confirmNameOption,type:[String],description:"Approve the removal by naming each route ID. Repeat it once for each"},{...yesOption,description:"Deprecated: use --confirm-name. Agents can't approve with --yes"}],examples:[{name:"Remove a route by name",value:`${packageName} routes remove "Old Redirect"`},{name:"Remove a route by ID",value:`${packageName} routes remove abc123`},{name:"Remove multiple routes",value:`${packageName} routes remove "Route A" "Route B"`},{name:"Remove without a prompt, once a person approves",value:`${packageName} routes remove "Old Route" --confirm-name abc123`}],consequence:"destructive"},enableSubcommand={name:"enable",aliases:[],description:"Enable a disabled routing rule",arguments:[{name:"name-or-id",required:!0}],options:[projectOption],examples:[{name:"Enable a route by name",value:`${packageName} routes enable "API Proxy"`},{name:"Enable a route by ID",value:`${packageName} routes enable abc123`}]},disableSubcommand={name:"disable",aliases:[],description:"Disable a routing rule without deleting it",arguments:[{name:"name-or-id",required:!0}],options:[projectOption],examples:[{name:"Disable a route by name",value:`${packageName} routes disable "API Proxy"`},{name:"Disable a route by ID",value:`${packageName} routes disable abc123`}]},reorderSubcommand={name:"move",aliases:["reorder"],description:"Move a routing rule to a different position",arguments:[{name:"name-or-id",required:!0}],options:[projectOption,{name:"position",description:"Target position: start, end, a number (1-based), before:<id>, after:<id>",shorthand:null,type:String,argument:"POSITION",deprecated:!1},{name:"first",description:"Move to the first position (highest priority)",shorthand:null,type:Boolean,deprecated:!1},{name:"last",description:"Move to the last position (lowest priority)",shorthand:null,type:Boolean,deprecated:!1},{...confirmNameOption,description:"Approve the move by naming the route ID"},{...yesOption,description:"Deprecated: use --confirm-name. Agents can't approve with --yes"}],examples:[{name:"Move to first position",value:`${packageName} routes move "Catch All" --first`},{name:"Move to last position",value:`${packageName} routes move "Catch All" --last`},{name:"Move to a specific position",value:`${packageName} routes move "API Proxy" --position 3`},{name:"Move after another route",value:`${packageName} routes move "API Proxy" --position after:route-id-123`},{name:"Interactive move (prompts for position)",value:`${packageName} routes move "API Proxy"`},{name:"Move without a prompt, once a person approves",value:`${packageName} routes move "API Proxy" --first --confirm-name abc123`}],consequence:"destructive"},editSubcommand={name:"update",aliases:["edit"],description:"Update an existing routing rule",arguments:[{name:"name-or-id",required:!0}],options:[projectOption,{name:"name",description:"Change route name",shorthand:null,type:String,argument:"NAME",deprecated:!1},{name:"description",description:'Change description (use "" to clear)',shorthand:null,type:String,argument:"TEXT",deprecated:!1},{name:"src",description:"Change source path pattern",shorthand:null,type:String,argument:"PATTERN",deprecated:!1},{name:"src-syntax",description:"Change path syntax: regex, path-to-regexp, equals",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"action",description:"Set action type: rewrite, redirect, or set-status (required when switching types)",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"dest",description:"Set destination URL",shorthand:null,type:String,argument:"URL",deprecated:!1},{name:"status",description:"Set status code",shorthand:null,type:Number,argument:"CODE",deprecated:!1},{name:"no-dest",description:"Remove destination",shorthand:null,type:Boolean,deprecated:!1},{name:"no-status",description:"Remove status code",shorthand:null,type:Boolean,deprecated:!1},{name:"set-response-header",description:"Set response header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"append-response-header",description:"Append to response header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"delete-response-header",description:"Delete response header: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"set-request-header",description:"Set request header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"append-request-header",description:"Append to request header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"delete-request-header",description:"Delete request header: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"set-request-query",description:"Set query parameter: key=value (repeatable)",shorthand:null,type:[String],argument:"PARAM",deprecated:!1},{name:"append-request-query",description:"Append to query parameter: key=value (repeatable)",shorthand:null,type:[String],argument:"PARAM",deprecated:!1},{name:"delete-request-query",description:"Delete query parameter: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"has",description:"Add a has condition: type:key or type:key:value (repeatable)",shorthand:null,type:[String],argument:"CONDITION",deprecated:!1},{name:"missing",description:'Add a "does not have" condition: type:key or type:key:value (repeatable)',shorthand:null,type:[String],argument:"CONDITION",deprecated:!1},{name:"clear-conditions",description:"Remove all has/does-not-have conditions",shorthand:null,type:Boolean,deprecated:!1},{name:"clear-headers",description:"Remove all response headers",shorthand:null,type:Boolean,deprecated:!1},{name:"clear-transforms",description:"Remove all transforms (request headers, request query)",shorthand:null,type:Boolean,deprecated:!1},{name:"ai",description:"Describe changes using natural language (AI-powered)",shorthand:null,type:String,argument:"PROMPT",deprecated:!1},{...yesOption,description:"Skip confirmation prompts"}],examples:[{name:"Interactive mode",value:`${packageName} routes update "API Proxy"`},{name:"Update with AI",value:`${packageName} routes update "API Proxy" --ai "Add CORS headers and change status to 308"`},{name:"Change destination",value:`${packageName} routes update "API Proxy" --dest "https://new-api.example.com/:path*"`},{name:"Switch to redirect",value:`${packageName} routes update "Old Route" --action redirect --dest "/new" --status 301`},{name:"Add a response header",value:`${packageName} routes update "My Route" --set-response-header "Cache-Control=public, max-age=3600"`},{name:"Clear all conditions and add new ones",value:`${packageName} routes update "My Route" --clear-conditions --has "header:Authorization"`}]},exportSubcommand={name:"export",aliases:[],description:"Export routes to a vercel.json or vercel.ts file",arguments:[{name:"name-or-id",required:!1}],options:[projectOption,{name:"output",description:"Output file format: .json or .ts (default: .json)",shorthand:"o",type:String,argument:"json|ts",deprecated:!1}],examples:[{name:"Export as vercel.json format",value:`${packageName} routes export`},{name:"Export as vercel.ts format",value:`${packageName} routes export --output ts`},{name:"Export a specific route",value:`${packageName} routes export "API Proxy"`},{name:"Export to a file",value:`${packageName} routes export > routes.json`}]},routesCommand={name:"routes",aliases:[],description:"Manage routing rules for a project. Routes managed at the project level apply to all deployments and environments.",arguments:[],subcommands:[listSubcommand,listVersionsSubcommand,inspectSubcommand,addSubcommand,editSubcommand,deleteSubcommand,enableSubcommand,disableSubcommand,reorderSubcommand,exportSubcommand,publishSubcommand,restoreSubcommand,discardSubcommand],options:[],examples:[]};export{listSubcommand,listVersionsSubcommand,inspectSubcommand,addSubcommand,publishSubcommand,restoreSubcommand,discardSubcommand,deleteSubcommand,enableSubcommand,disableSubcommand,reorderSubcommand,editSubcommand,exportSubcommand,routesCommand};
|
|
@@ -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{ORGANIZATION_ID_PREFIX,OrganizationResponseError,getOrganization,isPrefixedId,listOrganizations}from"./chunk-
|
|
7
|
+
import{ORGANIZATION_ID_PREFIX,OrganizationResponseError,getOrganization,isPrefixedId,listOrganizations}from"./chunk-PG5BHJVH.js";import{isAPIError}from"./chunk-MTPHHAPR.js";import{getCommandName}from"./chunk-EFGZK6OY.js";async function findOrganization(client,value){if(value.startsWith(ORGANIZATION_ID_PREFIX)&&!isPrefixedId(value,ORGANIZATION_ID_PREFIX))return{error:"Provide a valid organization ID."};let organization;try{organization=value.startsWith(ORGANIZATION_ID_PREFIX)?await getOrganization(client,value):(await listOrganizations(client)).organizations.find(org=>org.slug===value)}catch(err){if(isAPIError(err)&&err.status===404)organization=void 0;else{if(isAPIError(err)||err instanceof OrganizationResponseError)return{error:err.message};throw err}}return organization?{value:{id:organization.organizationId,slug:organization.slug}}:{error:`Couldn't find organization ${value}. List yours with ${getCommandName("organizations list")}.`}}export{findOrganization};
|