@vercel/cli-support 65.10.0-snapshot-c80a43d75dc7 → 65.10.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-RFPJCD35.js → add-4MTUAI2X.js} +1 -1
- package/dist/chunks/{add-A3SN7KWS.js → add-JYLWBVVQ.js} +1 -1
- package/dist/chunks/{add-TOKTANDW.js → add-T5ERJ62Z.js} +1 -1
- package/dist/chunks/{build-25I6XOV7.js → build-OGWTTFLG.js} +1 -1
- package/dist/chunks/{chunk-SHY7P3C6.js → chunk-36XHIIUT.js} +1 -1
- package/dist/chunks/{chunk-3AX7ZZJ7.js → chunk-3PKL2PTF.js} +1 -1
- package/dist/chunks/{chunk-2HLYY3KF.js → chunk-3QFBVAHL.js} +1 -1
- package/dist/chunks/chunk-3QYXC4PH.js +11 -0
- package/dist/chunks/{chunk-BT5C6MCY.js → chunk-42J2KCDF.js} +1 -1
- package/dist/chunks/{chunk-NLKM5LR5.js → chunk-4E6BGQWR.js} +1 -1
- package/dist/chunks/{chunk-FAVZ6WVS.js → chunk-4U6ACPA4.js} +1 -1
- package/dist/chunks/{chunk-NAEY6HG5.js → chunk-4WXVKR43.js} +1 -1
- package/dist/chunks/{chunk-MKYFAYCD.js → chunk-52X4YVSG.js} +1 -1
- package/dist/chunks/{chunk-3WYSEF57.js → chunk-5IZ33FNL.js} +1 -1
- package/dist/chunks/{chunk-GPISCZ2P.js → chunk-5MPZSRYG.js} +1 -1
- package/dist/chunks/{chunk-AX3V7N44.js → chunk-5RSSGN2Q.js} +1 -1
- package/dist/chunks/{chunk-7ULLVH2G.js → chunk-5RYQH3XW.js} +1 -1
- package/dist/chunks/{chunk-KNAOHPOI.js → chunk-6NUH6ZPE.js} +6 -6
- package/dist/chunks/{chunk-EJ34DLV4.js → chunk-6RMW63GB.js} +1 -1
- package/dist/chunks/{chunk-BB5UMZMF.js → chunk-6UMVJ7RL.js} +1 -1
- package/dist/chunks/{chunk-HR462OEG.js → chunk-6YAYCEDT.js} +2 -2
- package/dist/chunks/{chunk-VYRMHE34.js → chunk-75DUL7VI.js} +1 -1
- package/dist/chunks/{chunk-TNNEKGGF.js → chunk-7LSH3MEB.js} +1 -1
- package/dist/chunks/{chunk-LQAQD5LG.js → chunk-7TR6H6NE.js} +3 -3
- package/dist/chunks/chunk-7VGBGUX7.js +7 -0
- package/dist/chunks/chunk-A3C67PNC.js +7 -0
- package/dist/chunks/{chunk-CKTLP5GX.js → chunk-AMPJ6RWT.js} +1 -1
- package/dist/chunks/{chunk-IZ4GFKGR.js → chunk-AO6AMYBF.js} +1 -1
- package/dist/chunks/chunk-AUIV7YJO.js +11 -0
- package/dist/chunks/chunk-AY523IYR.js +7 -0
- package/dist/chunks/{chunk-DBPN2VGJ.js → chunk-B4XGTAFO.js} +1 -1
- package/dist/chunks/{chunk-DRLGZXAL.js → chunk-BIRSJSAO.js} +1 -1
- package/dist/chunks/{chunk-WHUZRBYL.js → chunk-BK3TNLWO.js} +5 -5
- package/dist/chunks/chunk-BZIC36KP.js +7 -0
- package/dist/chunks/chunk-CBMWPDOL.js +8 -0
- package/dist/chunks/{chunk-G2BNLRPU.js → chunk-CHIYT3V4.js} +1 -1
- package/dist/chunks/chunk-CJ6XPDSS.js +11 -0
- package/dist/chunks/{chunk-T7HE23VK.js → chunk-CU3LNJZV.js} +1 -1
- package/dist/chunks/chunk-DIHB5BUY.js +8 -0
- package/dist/chunks/{chunk-TZ6MSTOI.js → chunk-DNLE3KPC.js} +1 -1
- package/dist/chunks/{chunk-R3D4M5RE.js → chunk-DQASZDQT.js} +1 -1
- package/dist/chunks/{chunk-TNUQME3L.js → chunk-DQNP7OQ5.js} +1 -1
- package/dist/chunks/{chunk-NGHFFOD2.js → chunk-DUCCC22H.js} +1 -1
- package/dist/chunks/{chunk-QCIIUQV3.js → chunk-E7WULWMX.js} +1 -1
- package/dist/chunks/{chunk-CZOD25BC.js → chunk-ECFLIVEE.js} +1 -1
- package/dist/chunks/{chunk-FI5O4WHD.js → chunk-ECGY67NB.js} +1 -1
- package/dist/chunks/{chunk-S5JBQCBA.js → chunk-EJN55YDV.js} +1 -1
- package/dist/chunks/{chunk-3PXE5BLH.js → chunk-ER7L7HYA.js} +1 -1
- package/dist/chunks/{chunk-7UFI6OYF.js → chunk-FOWAVQOH.js} +1 -1
- package/dist/chunks/{chunk-4JWAXIIN.js → chunk-FPREO4VS.js} +1 -1
- package/dist/chunks/{chunk-PXQAWH7E.js → chunk-FSJFWVUY.js} +1 -1
- package/dist/chunks/{chunk-Y57DK3ZN.js → chunk-FXHB7TTL.js} +1 -1
- package/dist/chunks/chunk-FYE7ILRR.js +7 -0
- package/dist/chunks/{chunk-V32V4SXB.js → chunk-GQ4CQDIL.js} +1 -1
- package/dist/chunks/{chunk-W634OFUG.js → chunk-GZLYNPNU.js} +6 -5
- package/dist/chunks/chunk-HTPNGLPH.js +7 -0
- package/dist/chunks/{chunk-W5GHMAHP.js → chunk-IHTWZEQW.js} +1 -1
- package/dist/chunks/{chunk-4LGAV2WN.js → chunk-IIGNDMLO.js} +1 -1
- package/dist/chunks/{chunk-F2LNGJOZ.js → chunk-JA6IGJ67.js} +1 -1
- package/dist/chunks/chunk-JBU72NEQ.js +7 -0
- package/dist/chunks/{chunk-U6XJYQJS.js → chunk-JLNF2QTR.js} +1 -1
- package/dist/chunks/{chunk-SODZSOOL.js → chunk-K5KVSA2A.js} +1 -1
- package/dist/chunks/{chunk-VD2FK6OF.js → chunk-K7ARJYAG.js} +1 -1
- package/dist/chunks/{chunk-5TI3ZXW3.js → chunk-KBVYN635.js} +1 -1
- package/dist/chunks/chunk-KKE55LTK.js +7 -0
- package/dist/chunks/{chunk-G5T6UQAL.js → chunk-KV3QXTRZ.js} +1 -1
- package/dist/chunks/{chunk-3F5BOG4A.js → chunk-KZLRIAAT.js} +1 -1
- package/dist/chunks/{chunk-L4QQTYUI.js → chunk-LE72YLCC.js} +2 -2
- package/dist/chunks/{chunk-HJ45TAM4.js → chunk-LIEWXPUC.js} +1 -1
- package/dist/chunks/{chunk-ANCWFEOM.js → chunk-M3R7F2N4.js} +1 -1
- package/dist/chunks/{chunk-MUNGQJGO.js → chunk-M3Z6NSC2.js} +1 -1
- package/dist/chunks/{chunk-VPUYTI5E.js → chunk-MBXLL2HF.js} +1 -1
- package/dist/chunks/{chunk-C24IKNZN.js → chunk-MKTZDEOJ.js} +1 -1
- package/dist/chunks/{chunk-VZGTL3YC.js → chunk-N5AN4JZL.js} +1 -1
- package/dist/chunks/{chunk-EJZNJN4N.js → chunk-N65H4JMJ.js} +1 -1
- package/dist/chunks/{chunk-LC4BSDDG.js → chunk-NAN5IE3B.js} +1 -1
- package/dist/chunks/{chunk-TD7AL545.js → chunk-NE6PKR2J.js} +1 -1
- package/dist/chunks/{chunk-2EFBGKRC.js → chunk-NLTZGQB2.js} +1 -1
- package/dist/chunks/{chunk-TL4ZLZ2Q.js → chunk-NMIZSQDN.js} +1 -1
- package/dist/chunks/{chunk-22UXDTCE.js → chunk-NZRBJB6T.js} +1 -1
- package/dist/chunks/chunk-OII46FDN.js +12 -0
- package/dist/chunks/{chunk-YOWMZJPA.js → chunk-OJWI6QJ3.js} +1 -1
- package/dist/chunks/{chunk-GKALP6QD.js → chunk-OYIDWI5Y.js} +1 -1
- package/dist/chunks/{chunk-QVMU7ZKQ.js → chunk-P24YBQ6H.js} +1 -1
- package/dist/chunks/{chunk-2JCJP43W.js → chunk-P6J22UJQ.js} +1 -1
- package/dist/chunks/{chunk-E7DYXF6G.js → chunk-PFZCGMJ7.js} +1 -1
- package/dist/chunks/{chunk-64UCX5JM.js → chunk-PKNEWN4W.js} +1 -1
- package/dist/chunks/{chunk-Q4GX2UTG.js → chunk-PKZK23PR.js} +1 -1
- package/dist/chunks/{chunk-56UH6NQ3.js → chunk-PL6IOUKW.js} +1 -1
- package/dist/chunks/{chunk-MBL7MWP5.js → chunk-Q2JNATRP.js} +1 -1
- package/dist/chunks/{chunk-KMPDQE4Q.js → chunk-Q46Q4Y4R.js} +1 -1
- package/dist/chunks/{chunk-NAJCRBQB.js → chunk-QXL353OB.js} +1 -1
- package/dist/chunks/{chunk-VR5ROBAO.js → chunk-RI6DJAFI.js} +1 -1
- package/dist/chunks/{chunk-2DHDKWYN.js → chunk-RIJ45N7C.js} +1 -1
- package/dist/chunks/{chunk-6AJWRPTY.js → chunk-RUBMVRT6.js} +1 -1
- package/dist/chunks/{chunk-6RUAAORO.js → chunk-S535FZTA.js} +1 -1
- package/dist/chunks/{chunk-5I7CC45F.js → chunk-SBEWZ65N.js} +1 -1
- package/dist/chunks/{chunk-GJCVOEC2.js → chunk-SDYCW5JM.js} +1 -1
- package/dist/chunks/chunk-SNGM6NSO.js +7 -0
- package/dist/chunks/chunk-SNNJRKD6.js +10 -0
- package/dist/chunks/{chunk-DX2OHM56.js → chunk-SR7BZA6N.js} +1 -1
- package/dist/chunks/{chunk-QXYCICNB.js → chunk-STKZTUGE.js} +1 -1
- package/dist/chunks/{chunk-XGOELSYA.js → chunk-SXYA7JSX.js} +1 -1
- package/dist/chunks/chunk-TILI4QBL.js +11 -0
- package/dist/chunks/{chunk-PMEYNJU2.js → chunk-TZE4CS4K.js} +1 -1
- package/dist/chunks/{chunk-BZV2S4H6.js → chunk-U2TQFAO3.js} +1 -1
- package/dist/chunks/chunk-U2ZNF6HN.js +8 -0
- package/dist/chunks/chunk-UIMJNASP.js +7 -0
- package/dist/chunks/{chunk-FQVIWQ6M.js → chunk-UQNBUXQA.js} +1 -1
- package/dist/chunks/{chunk-C4N4LKPM.js → chunk-US7YJ2RQ.js} +1 -1
- package/dist/chunks/{chunk-JVNIDSP5.js → chunk-V5TOMLK4.js} +1 -1
- package/dist/chunks/{chunk-L6CZL2IQ.js → chunk-VQSSVB6V.js} +1 -1
- package/dist/chunks/chunk-VTITZEPW.js +9 -0
- package/dist/chunks/chunk-WFS3XBAA.js +8 -0
- package/dist/chunks/{chunk-XEXOSJIU.js → chunk-WKIDCYKL.js} +1 -1
- package/dist/chunks/{chunk-UVHKXCR5.js → chunk-WKSXBH7X.js} +1 -2
- package/dist/chunks/{chunk-77LSSWXL.js → chunk-WTFD4MDT.js} +1 -1
- package/dist/chunks/{chunk-YO6SJCZP.js → chunk-WYGOYE6C.js} +1 -1
- package/dist/chunks/{chunk-UNASHUWQ.js → chunk-XFUUALZS.js} +1 -1
- package/dist/chunks/{chunk-SXEOJSZQ.js → chunk-XS3MNHFR.js} +1 -1
- package/dist/chunks/{chunk-ZGQNI22M.js → chunk-YGYUPPAL.js} +2 -2
- package/dist/chunks/{chunk-Q25FOMOX.js → chunk-YKLTNKQJ.js} +1 -1
- package/dist/chunks/{chunk-WFCGAYP5.js → chunk-YUHKH4TK.js} +1 -1
- package/dist/chunks/{chunk-D4TD2KWH.js → chunk-YZKARZ2B.js} +1 -1
- package/dist/chunks/chunk-ZCUUCYID.js +13 -0
- package/dist/chunks/{chunk-FPYHB76H.js → chunk-ZEUREQ4E.js} +1 -1
- package/dist/chunks/chunk-ZIC7VWFC.js +14 -0
- package/dist/chunks/{chunk-QGZZL6YY.js → chunk-ZPJHONCZ.js} +1 -1
- package/dist/chunks/{chunk-R2P4PNRQ.js → chunk-ZQXXESKG.js} +1 -1
- package/dist/chunks/{clear-B764MEAM.js → clear-Z5OO6URI.js} +1 -1
- package/dist/chunks/cli-embedded-Y74S252S.js +66 -0
- package/dist/chunks/{compile-vercel-config-EWCB7SIC.js → compile-vercel-config-ZKUTSDWV.js} +1 -1
- package/dist/chunks/{config-D4WY2HG4.js → config-AUTTHXQO.js} +1 -1
- package/dist/chunks/config-RJ7PLFQD.js +7 -0
- package/dist/chunks/{connect-git-provider-AWEOEEOO.js → connect-git-provider-YIX5ZOU6.js} +1 -1
- package/dist/chunks/{delete-W3GMFAKA.js → delete-QQOC63HV.js} +1 -1
- package/dist/chunks/{delete-SKYFHUWD.js → delete-WIGSOZR3.js} +1 -1
- package/dist/chunks/{detect-services-3TRRRLES.js → detect-services-J4LGLAHC.js} +1 -1
- package/dist/chunks/{disable-EBPZ2LYC.js → disable-L54VGY5A.js} +1 -1
- package/dist/chunks/{discard-SMVPENSP.js → discard-Q5UPTZR2.js} +1 -1
- package/dist/chunks/{edit-CGTNGJKY.js → edit-FRGMYBW3.js} +1 -1
- package/dist/chunks/{edit-A3M3GBGP.js → edit-QEDNQ33T.js} +1 -1
- package/dist/chunks/{enable-6A5THWDP.js → enable-TGQZWSBG.js} +1 -1
- package/dist/chunks/engine-DkdkXQEy-FDYYIXY7.js +17 -0
- package/dist/chunks/{exec-UV73J2ZB.js → exec-H3X7U4P3.js} +1 -1
- package/dist/chunks/{export-R5IUWAW5.js → export-YYQ2J5AT.js} +1 -1
- package/dist/chunks/{future-CPJUUZTU.js → future-RYEYLPCG.js} +1 -1
- package/dist/chunks/{generate-cert-for-deploy-Z3HCAR5H.js → generate-cert-for-deploy-Y4KDIFF2.js} +1 -1
- package/dist/chunks/image-PDPRURMH.js +7 -0
- package/dist/chunks/{import-builders-GPJQAMXT.js → import-builders-H54QCMQ4.js} +1 -1
- package/dist/chunks/{inspect-WC2C4MDP.js → inspect-6IBPIBIJ.js} +1 -1
- package/dist/chunks/{inspect-WWOHWQKS.js → inspect-AHHXHIIP.js} +1 -1
- package/dist/chunks/{inspect-BO2ACFEG.js → inspect-Q7FYDFL7.js} +1 -1
- package/dist/chunks/{inspect-6FEL5DYV.js → inspect-RPCDGIP3.js} +1 -1
- package/dist/chunks/{inspect-TEPB7KVC.js → inspect-SFM3NWDF.js} +1 -1
- package/dist/chunks/{list-C5GUZ35P.js → list-7WWUYCE6.js} +1 -1
- package/dist/chunks/{list-EZWZSVM4.js → list-GSVERG4S.js} +1 -1
- package/dist/chunks/{list-4KSJEP23.js → list-NXZXKKAR.js} +1 -1
- package/dist/chunks/{login-ZNCCVA4H.js → login-HEHHQO3F.js} +1 -1
- package/dist/chunks/{login-PDZT4PQR.js → login-XKLPSZNN.js} +1 -1
- package/dist/chunks/{logs-YKQMUTMG.js → logs-NJ46ZSNZ.js} +1 -1
- package/dist/chunks/{ls-3HUS6KS6.js → ls-5SKRXNSI.js} +1 -1
- package/dist/chunks/{ls-WX4BJRDV.js → ls-FOFJU2JJ.js} +1 -1
- package/dist/chunks/{ls-TASQJDLF.js → ls-ITWXAWSZ.js} +1 -1
- package/dist/chunks/{ls-LYVPEIIT.js → ls-LCUOBWY2.js} +1 -1
- package/dist/chunks/{ls-KQJYKADC.js → ls-MWGIT2YH.js} +1 -1
- package/dist/chunks/{ls-RBPRE6BF.js → ls-OY5YTZGN.js} +1 -1
- package/dist/chunks/{ls-ZP7OBTTV.js → ls-TZN53EJL.js} +1 -1
- package/dist/chunks/{mutate-5N6DMBYS.js → mutate-ZYXVL22A.js} +1 -1
- package/dist/chunks/{native-self-update-7OAY4AVR.js → native-self-update-DEVBYOH2.js} +1 -1
- package/dist/chunks/{notifications-OVFMQLHL.js → notifications-XAPB2F2T.js} +1 -1
- package/dist/chunks/{open-DOBOKUEK.js → open-WPRHI6ND.js} +1 -1
- package/dist/chunks/{openapi-YAZA3237.js → openapi-UUFKDKGC.js} +1 -1
- package/dist/chunks/{permissions-PHCOVDWK.js → permissions-FU5OET67.js} +1 -1
- package/dist/chunks/{plugin-offer-M7KJSJU6.js → plugin-offer-E5JOW442.js} +1 -1
- package/dist/chunks/{prompt-missing-credentials-RTNCHH6Y.js → prompt-missing-credentials-ZZVTEQQB.js} +1 -1
- package/dist/chunks/{publish-JIFRJNDV.js → publish-R5IV2BH2.js} +1 -1
- package/dist/chunks/pull-CQVHIIAN.js +7 -0
- package/dist/chunks/{purchase-domain-if-available-3EBONBX3.js → purchase-domain-if-available-VMWCMYC2.js} +1 -1
- package/dist/chunks/{push-ZN6CBJLJ.js → push-Y5CUOISM.js} +1 -1
- package/dist/chunks/{query-MT6ID6C7.js → query-VMKIOI3W.js} +1 -1
- package/dist/chunks/{reauthenticate-OXFB64PS.js → reauthenticate-5K7LBTOW.js} +1 -1
- package/dist/chunks/{reorder-N2L43LXD.js → reorder-W3MXHSGZ.js} +1 -1
- package/dist/chunks/{reply-WBR3XXBJ.js → reply-YH7HRIWQ.js} +1 -1
- package/dist/chunks/{resolve-NMR24Y67.js → resolve-FWVMWJTG.js} +1 -1
- package/dist/chunks/{resolve-agent-team-KRTLBC5D.js → resolve-agent-team-6L7AQUA2.js} +1 -1
- package/dist/chunks/{restore-AKAVSLAK.js → restore-I7L3EOS4.js} +1 -1
- package/dist/chunks/{rm-Q3ZXEMGI.js → rm-AWUMNWQU.js} +1 -1
- package/dist/chunks/{rm-DGMHU3CU.js → rm-HVGUK55W.js} +1 -1
- package/dist/chunks/{rm-ERBTFH3G.js → rm-M3EMCKSN.js} +1 -1
- package/dist/chunks/{rm-H2T7HB3F.js → rm-RFCTWU5R.js} +1 -1
- package/dist/chunks/{rm-TNGYCAFJ.js → rm-VREBRM5D.js} +1 -1
- package/dist/chunks/{routes-4WGST7VN.js → routes-BP54NO3Z.js} +1 -1
- package/dist/chunks/{rule-inspect-ZVHPS2PL.js → rule-inspect-SQUCRRGA.js} +1 -1
- package/dist/chunks/{schema-TSHU5NN6.js → schema-AKVIKCFT.js} +1 -1
- package/dist/chunks/{schema-YUXTIJSB.js → schema-S36QQNJP.js} +1 -1
- package/dist/chunks/{select-org-35NFUKXO.js → select-org-PRWYXAWW.js} +1 -1
- package/dist/chunks/serving-DKny38LK-UNINNTL5.js +8 -0
- package/dist/chunks/{set-PP5K4NBO.js → set-ZJAC44LV.js} +1 -1
- package/dist/chunks/{setup-and-link-ACSPPTME.js → setup-and-link-VD53JFQI.js} +1 -1
- package/dist/chunks/{skills-X5TPVYXW.js → skills-JG4MGVKX.js} +1 -1
- package/dist/chunks/{tags-6QB3FP3B.js → tags-4Y4UBA5S.js} +1 -1
- package/dist/chunks/token-3ILJZPAZ.js +7 -0
- package/dist/chunks/token-JJLQVXPI.js +7 -0
- package/dist/chunks/{token-util-JDQI37VN.js → token-util-A4BSB3KP.js} +1 -1
- package/dist/chunks/token-util-KL35LHLQ.js +7 -0
- package/dist/chunks/{types-SENK43U4.js → types-DSN6Q6HW.js} +1 -1
- package/dist/chunks/{update-QA3NLSTV.js → update-R42CXSVE.js} +1 -1
- package/dist/commands/build/index.js +1 -1
- package/dist/commands/deploy/index.js +9 -9
- package/dist/commands/dev/index.js +2 -2
- package/dist/commands/env/index.js +12 -12
- package/dist/commands/link/index.js +4 -4
- package/dist/commands/list/index.js +1 -1
- package/dist/commands/project/index.js +8 -14
- package/dist/commands-account.js +2 -2
- package/dist/commands-ai.js +4 -4
- package/dist/commands-blob.js +7 -7
- package/dist/commands-core.js +62 -32
- package/dist/commands-deployments.js +4 -4
- package/dist/commands-flags.js +3 -3
- package/dist/commands-integrations.js +1 -1
- package/dist/commands-observability.js +2 -2
- package/dist/commands-routing.js +5 -5
- package/dist/help.js +1 -1
- package/dist/index.js +5 -5
- package/dist/internal-build.js +1 -1
- package/dist/launcher-errors.js +1 -1
- package/dist/package.json +31 -30
- package/dist/version.mjs +1 -1
- package/package.json +22 -21
- package/dist/chunks/chunk-5KE67O45.js +0 -7
- package/dist/chunks/chunk-CFYTFXX6.js +0 -7
- package/dist/chunks/chunk-CUBRYWA2.js +0 -7
- package/dist/chunks/chunk-FOQD62WW.js +0 -17
- package/dist/chunks/chunk-FTACGWII.js +0 -14
- package/dist/chunks/chunk-FY4ORPZH.js +0 -7
- package/dist/chunks/chunk-G7H33IKQ.js +0 -10
- package/dist/chunks/chunk-KWXJIVBG.js +0 -7
- package/dist/chunks/chunk-MOF4QNZH.js +0 -9
- package/dist/chunks/chunk-O4CQRV2G.js +0 -7
- package/dist/chunks/chunk-UWJ3UPS5.js +0 -11
- package/dist/chunks/chunk-ZUI5EMXD.js +0 -11
- package/dist/chunks/config-CW4JO67Q.js +0 -7
- package/dist/chunks/image-VNSN2SKE.js +0 -7
- package/dist/chunks/pull-HLJSW3W4.js +0 -7
- package/dist/chunks/token-W6P2KNI5.js +0 -7
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{warnDeprecatedInput}from"./chunk-SDYCW5JM.js";import{packageName,require_lib}from"./chunk-VRH7LWOC.js";import{require_dist}from"./chunk-PUKYAALC.js";import{deploymentOption,environmentOption,forceOption,formatOption,gitBranchOption,jsonOption,projectOption,yesOption}from"./chunk-AMPJ6RWT.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_constants=__toESM(require_dist(),1),import_title=__toESM(require_lib(),1);var envTargetChoices=import_constants.PROJECT_ENV_TARGET.map(t=>({name:(0,import_title.default)(t),value:t}));function isValidEnvTarget(target){return typeof target>"u"||envTargetChoices.map(c=>c.value).includes(target)}function getEnvTargetPlaceholder(){return`<${envTargetChoices.map(c=>c.value).join(" | ")}>`}function parseEnvTargetArg(arg){return Array.from(new Set(arg.split(",").map(t=>t.trim()).filter(Boolean)))}function resolveEnvTargetInput(client,input){let environment=Array.isArray(input.environment)?input.environment.join(","):input.environment;return input.legacyEnvironment!==void 0&&environment!==void 0?{error:"Can't use an environment argument with --environment. Use --environment, and --git-branch for a Git branch."}:input.legacyGitBranch!==void 0&&input.gitBranch!==void 0?{error:"Can't use a Git branch argument with --git-branch. Use --git-branch."}:(input.legacyEnvironment!==void 0&&warnDeprecatedInput(client,"The environment argument","--environment"),input.legacyGitBranch!==void 0&&warnDeprecatedInput(client,"The Git branch argument","--git-branch"),{environment:environment??input.legacyEnvironment,gitBranch:input.gitBranch??input.legacyGitBranch})}var targetPlaceholder=getEnvTargetPlaceholder(),listSubcommand={name:"list",aliases:["ls"],description:"List all Environment Variables for a Project",arguments:[],options:[{...environmentOption,description:"List only the variables for this environment"},{...gitBranchOption,description:"List only the variables for this Git branch"},{...formatOption,description:"Specify the output format (json, including readable Environment Variable values)"},{...jsonOption,description:"Output as JSON, including readable Environment Variable values"},projectOption,{name:"guidance",description:"Receive command suggestions once command is complete",shorthand:null,type:Boolean,deprecated:!1}],examples:[]},addSubcommand={name:"add",aliases:[],description:"Add an Environment Variable",arguments:[{name:"name",required:!0}],options:[projectOption,{...environmentOption,type:[String],description:"Environments to add the variable to; repeatable or comma-separated. Prompts when omitted"},{...gitBranchOption,description:"Set the Git branch for a Preview Environment Variable"},{name:"sensitive",description:"Store the value as a Secret",shorthand:null,type:Boolean,deprecated:!1},{name:"no-sensitive",description:"Store the value as Config",shorthand:null,type:Boolean,deprecated:!1},{name:"type",description:"Set the Environment Variable type (`config` or `secret`)",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"visibility",description:"Deprecated alias for `--type`",shorthand:null,type:String,argument:"VISIBILITY",deprecated:!0},{...forceOption,description:"Overwrite an existing variable in the same environment",shorthand:null},{...yesOption,description:"Accept default choices when adding an Environment Variable"},{name:"guidance",description:"Show command suggestions after completion",shorthand:null,type:Boolean,deprecated:!1},{name:"value",description:"Set the variable value for non-interactive use; otherwise use stdin or the prompt",shorthand:null,type:String,argument:"VALUE",deprecated:!1},jsonOption],examples:[{name:"Add a new variable (prompts for value and Environments)",placeholders:["<name>"],value:`${packageName} env add <name>`},{name:"Add a new Environment Variable to a specific Environment",placeholders:["<name>",targetPlaceholder],value:`${packageName} env add <name> --environment ${targetPlaceholder}`},{name:"Add one variable to multiple Environments (comma-separated)",placeholders:["<name>","<environment>"],value:`${packageName} env add <name> --environment <environment>[,<environment>]`},{name:"Override an existing Environment Variable in the same environment (production, preview, development)",value:`${packageName} env add API_TOKEN --force`},{name:"Add a Config Environment Variable that remains readable later",value:`${packageName} env add API_TOKEN --no-sensitive`},{name:"Add a new Environment Variable for a specific Environment and Git Branch",placeholders:["<name>","<BRANCH>",targetPlaceholder],value:`${packageName} env add <name> --environment ${targetPlaceholder} --git-branch <BRANCH>`},{name:"Add a variable from piped input",placeholders:["<file>","<name>",targetPlaceholder],value:`cat <file> | ${packageName} env add <name> --environment ${targetPlaceholder}`},{name:"Add a variable from a file",placeholders:["<file>","<name>",targetPlaceholder],value:`${packageName} env add <name> --environment ${targetPlaceholder} < <file>`},{name:"Add with --value for non-interactive use",placeholders:["<value>"],value:`${packageName} env add API_TOKEN --environment production --value "<value>" --yes`}]},removeSubcommand={name:"remove",aliases:["rm"],description:"Remove an Environment Variable (see examples below)",arguments:[{name:"name",required:!0}],options:[projectOption,{...environmentOption,description:"Remove the variable from this environment only. Without it, the variable is removed from all of its environments"},{...gitBranchOption,description:"Remove the variable for this Git branch only"},{...yesOption,description:"Skip the confirmation prompt when removing an Environment Variable"},jsonOption],examples:[{name:"Remove a variable from multiple Environments",placeholders:["<name>"],value:`${packageName} env remove <name>`},{name:"Remove a variable from a specific Environment",placeholders:["<name>",targetPlaceholder],value:`${packageName} env remove <name> --environment ${targetPlaceholder}`},{name:"Remove a variable from a specific Environment and Git Branch",placeholders:["<name>","<BRANCH>",targetPlaceholder],value:`${packageName} env remove <name> --environment ${targetPlaceholder} --git-branch <BRANCH>`}]},pullSubcommand={name:"pull",aliases:[],description:"Pull Environment Variables into a local file (default: .env.local)",arguments:[{name:"filename",required:!1}],options:[projectOption,{name:"environment",description:"Select the environment to pull (default: development)",shorthand:"e",type:String,argument:"ENVIRONMENT",deprecated:!1},{...gitBranchOption,description:"Specify the Git branch to pull specific Environment Variables for"},{...deploymentOption,description:"Pull Environment Variables for a specific deployment (e.g. dpl_xxx)"},{name:"id",shorthand:null,type:String,deprecated:!0},{...yesOption,description:"Skip the confirmation prompt when overwriting an existing file"}],examples:[{name:"Pull Development Environment Variables into a custom file (check .gitignore)",placeholders:["<file>"],value:`${packageName} env pull <file>`},{name:"Pull Environment Variables for a specific deployment",value:`${packageName} env pull --deployment dpl_xxx`}]},runSubcommand={name:"run",aliases:[],description:"Run a command with environment variables from the linked Vercel project",arguments:[{name:"command",required:!0,multiple:!0}],options:[projectOption,{name:"environment",description:"Specify the environment to pull variables from (default: development)",shorthand:"e",type:String,argument:"ENVIRONMENT",deprecated:!1},{...gitBranchOption,description:"Specify the Git branch to pull specific Environment Variables for"}],examples:[{name:"Run Next.js dev server with development environment variables",value:`${packageName} env run -- next dev`},{name:"Run tests with preview environment variables for a specific branch",value:`${packageName} env run -e preview --git-branch feature-x -- npm test`}]},updateSubcommand={name:"update",aliases:[],description:"Update the value of an existing Environment Variable (see examples below)",arguments:[{name:"name",required:!0}],options:[projectOption,{...environmentOption,description:"Pick the variable to update by an environment it covers. The new value applies to all of its environments"},{...gitBranchOption,description:"Pick the variable to update by its Git branch"},{name:"sensitive",description:"Store the updated value as a Secret",shorthand:null,type:Boolean,deprecated:!1},{name:"type",description:"Set the Environment Variable type (`config` or `secret`)",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"visibility",description:"Deprecated alias for `--type`",shorthand:null,type:String,argument:"VISIBILITY",deprecated:!0},{...yesOption,description:"Skip the confirmation prompt when updating an Environment Variable"},{name:"value",description:"New value for the variable (non-interactive). Otherwise use stdin or you will be prompted.",shorthand:null,type:String,argument:"VALUE",deprecated:!1}],examples:[{name:"Update a variable in all Environments",placeholders:["<name>"],value:`${packageName} env update <name>`},{name:"Update the variable that covers a specific Environment",placeholders:["<name>",targetPlaceholder],value:`${packageName} env update <name> --environment ${targetPlaceholder}`},{name:"Update the variable for a specific Environment and Git Branch",placeholders:["<name>","<BRANCH>",targetPlaceholder],value:`${packageName} env update <name> --environment ${targetPlaceholder} --git-branch <BRANCH>`},{name:"Update a variable from piped input",placeholders:["<file>","<name>",targetPlaceholder],value:`cat <file> | ${packageName} env update <name> --environment ${targetPlaceholder}`},{name:"Update a variable from a file",placeholders:["<file>","<name>",targetPlaceholder],value:`${packageName} env update <name> --environment ${targetPlaceholder} < <file>`}]},envCommand={name:"env",aliases:[],description:"Interact with Environment Variables for a Project",arguments:[],subcommands:[addSubcommand,listSubcommand,pullSubcommand,removeSubcommand,runSubcommand,updateSubcommand],options:[],examples:[{name:"Run a command with Environment Variables from the linked Project",placeholders:["<command>"],value:`${packageName} env run -- <command>`},{name:"Add one variable to multiple Environments",value:`${packageName} env add API_URL --environment production,preview,development`}]};export{envTargetChoices,isValidEnvTarget,getEnvTargetPlaceholder,parseEnvTargetArg,resolveEnvTargetInput,listSubcommand,addSubcommand,removeSubcommand,pullSubcommand,runSubcommand,updateSubcommand,envCommand};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{writeJsonError}from"./chunk-E7WULWMX.js";import{printError}from"./chunk-PKZK23PR.js";import{packageName}from"./chunk-VRH7LWOC.js";import{output_manager_default}from"./chunk-GZLYNPNU.js";import{require_dist}from"./chunk-RM3ZDRYE.js";import{getGlobalFlagsFromArgs,quoteArg}from"./chunk-AMPJ6RWT.js";import{AGENT_REASON,AGENT_STATUS,getExitCodeForReason}from"./chunk-JBU72NEQ.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_error_utils=__toESM(require_dist(),1);function startJsonOutput(client){client.nonInteractive=!0,client.jsonMode={errorWritten:!1},output_manager_default.initialize({quiet:!0})}function writeJsonResult(client,document){output_manager_default.stopSpinner();let indent=client.stdout.isTTY?2:void 0;return client.stdout.write(`${JSON.stringify(document,null,indent)}
|
|
8
|
+
`),0}function writeJsonFailure(client,payload,exitCode=getExitCodeForReason(payload.reason)){return client.jsonMode&&(client.jsonMode.errorWritten=!0),writeJsonError(client,payload,exitCode)}function writeJsonUsageError(client,err){return startJsonOutput(client),writeJsonFailure(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.INVALID_ARGUMENTS,message:(0,import_error_utils.errorToString)(err)},2)}function jsonNextStep(client,args,when){let argv=[packageName,...args,...getGlobalFlagsFromArgs(client.argv.slice(2))];return{command:argv.map(quoteArg).join(" "),argv,...when?{when}:{}}}async function runWithJsonOutput(client,run){startJsonOutput(client);let exitCode;try{exitCode=await run()}catch(err){if(client.jsonMode?.errorWritten)throw err;if(printError(err,client),client.jsonMode?.errorWritten)return 1;let code=(0,import_error_utils.isErrnoException)(err)&&typeof err.code=="string"?err.code:"";return writeJsonFailure(client,{status:AGENT_STATUS.ERROR,reason:code?code.toLowerCase().replace(/^err_/,""):AGENT_REASON.INTERNAL_ERROR,message:(0,import_error_utils.errorToString)(err)},1)}return exitCode!==0&&!client.jsonMode?.errorWritten&&writeJsonFailure(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.COMMAND_FAILED,message:output_manager_default.quietError??"The command failed."},exitCode),exitCode}export{writeJsonResult,writeJsonFailure,writeJsonUsageError,jsonNextStep,runWithJsonOutput};
|
|
@@ -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{ellipsis}from"./chunk-AKOYIH3A.js";import{ALIGNED_LABEL_WIDTH}from"./chunk-
|
|
7
|
+
import{ellipsis}from"./chunk-AKOYIH3A.js";import{ALIGNED_LABEL_WIDTH}from"./chunk-PKNEWN4W.js";import{require_ms}from"./chunk-MXTC4ZAQ.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1),import_ms=__toESM(require_ms(),1);function alignedRow(label,value){return` ${import_chalk.default.bold(label.padEnd(ALIGNED_LABEL_WIDTH))}${value}`}function actorLabel(actor){if(!actor)return"-";let base=actor.name||actor.username||actor.id;return actor.type==="app"?`${base} (app)`:base}function relativeAge(timestamp){if(!timestamp||!Number.isFinite(timestamp))return"-";let delta=Date.now()-timestamp;return delta<1e3?"now":(0,import_ms.default)(delta)}function displayPath(thread){let href=thread.context?.href;if(href)try{return new URL(href).pathname}catch{}return thread.context?.path||"/"}function truncate(text,max){return ellipsis(text.replace(/\s+/g," ").trim(),max)}function firstMessageText(thread){return thread.messages[0]?.text??""}function threadAge(thread){return relativeAge(thread.messages[0]?.timestamp)}function renderThreadSummary(thread,complete){let replies=thread.messageCount-1,rootAuthorId=complete?thread.messages[0]?.author.id:void 0,names=[],seen=new Set;for(let message of thread.messages){let{author}=message;author.id===rootAuthorId||seen.has(author.id)||(seen.add(author.id),names.push(actorLabel(author)))}let shown=names.slice(0,3),overflow=names.length-shown.length,participants=shown.length>0?`${shown.join(", ")}${overflow>0?` +${overflow} more`:""}`:void 0,lastTimestamp=thread.messages[thread.messages.length-1]?.timestamp,parts=[`\u2192 ${replies} ${replies===1?"reply":"replies"}`];return participants&&parts.push(participants),parts.push(`last ${relativeAge(lastTimestamp)} ago`),parts.join(" \xB7 ")}function renderThreadRow(thread,opts){let complete=thread.messageCount<=thread.messages.length,dot=thread.resolved?import_chalk.default.dim("\u25CB"):"\u25CF",author=complete?actorLabel(thread.messages[0]?.author):"\u2026",columns=[dot,thread.id,import_chalk.default.dim(threadAge(thread)),author,displayPath(thread)];opts.showBranch&&thread.branch&&columns.push(import_chalk.default.dim(thread.branch)),thread.isLocalhost&&columns.push(import_chalk.default.dim("localhost"));let lines=[` ${columns.join(" ")}`];if(complete){let excerpt=truncate(firstMessageText(thread),80);excerpt&&lines.push(` \u201C${excerpt}\u201D`)}else lines.push(import_chalk.default.dim(" (long thread \u2014 inspect for the full conversation)"));let selection=thread.context?.selection;selection&&lines.push(import_chalk.default.dim(` \u2192 selected: \u201C${truncate(selection,60)}\u201D`)),thread.messageCount>1&&lines.push(import_chalk.default.dim(` ${renderThreadSummary(thread,complete)}`));let meta=[],reactionCount=thread.messages.reduce((acc,message)=>acc+(message.reactions?.length??0),0);reactionCount>0&&meta.push(`${reactionCount} ${reactionCount===1?"reaction":"reactions"}`);let attachmentCount=thread.messages.reduce((acc,message)=>acc+(message.attachments?.length??0),0);return attachmentCount>0&&meta.push(`${attachmentCount} ${attachmentCount===1?"attachment":"attachments"}`),thread.resolved&&meta.push(`resolved by ${actorLabel(thread.resolvedBy)}`),meta.length>0&&lines.push(import_chalk.default.dim(` ${meta.join(" \xB7 ")}`)),lines.join(`
|
|
8
8
|
`)}function renderReactions(message){if(!(!message.reactions||message.reactions.length===0))return message.reactions.map(r=>`${r.emoji} ${r.name} \xB7 ${r.users.length}`).join(" ")}function renderMessage(message){let lines=[`${import_chalk.default.bold(actorLabel(message.author))} \xB7 ${relativeAge(message.timestamp)} ago \xB7 ${import_chalk.default.dim(message.id)}`];for(let textLine of message.text.split(`
|
|
9
9
|
`))lines.push(` ${textLine}`);for(let attachment of message.attachments??[]){let dimensions=attachment.width&&attachment.height?` (${attachment.width}\xD7${attachment.height})`:"";lines.push(`${import_chalk.default.dim(` \u2192 attachment ${attachment.filename}${dimensions}`)} ${import_chalk.default.cyan(attachment.url)}`)}let reactions=renderReactions(message);return reactions&&lines.push(` ${reactions}`),lines.join(`
|
|
10
10
|
`)}function renderThreadDetail(thread,messages,opts){let sections=[],status=thread.resolved?import_chalk.default.dim(`resolved by ${actorLabel(thread.resolvedBy)}`):"unresolved",headline=[import_chalk.default.bold(thread.id),status];thread.branch&&headline.push(import_chalk.default.dim(thread.branch)),thread.isLocalhost&&headline.push(import_chalk.default.dim("localhost")),sections.push(headline.join(" \xB7 "));let headerLines=[],path=displayPath(thread),pageTitle=thread.context?.pageTitle;headerLines.push(pageTitle?`${path} \u2014 \u201C${pageTitle}\u201D`:path),thread.context?.href&&headerLines.push(import_chalk.default.cyan(thread.context.href)),sections.push(headerLines.join(`
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{HttpError,Labels,MESSAGE_TEXT_MAX,MessageId}from"./chunk-WFS3XBAA.js";import{external_exports}from"./chunk-2AMO2VMV.js";var ExternalTarget=external_exports.string().min(3).max(300),Origin=external_exports.object({channel:ExternalTarget.optional(),thread:ExternalTarget,subthread:ExternalTarget.nullable(),message:external_exports.string().min(1).max(300),context:external_exports.string().max(300).nullable()}),LinkSnapshot=external_exports.object({author:external_exports.string().min(1).max(256),text:external_exports.string().max(MESSAGE_TEXT_MAX),createdAt:external_exports.string().max(64).nullable(),files:external_exports.array(external_exports.object({name:external_exports.string().min(1).max(1e3),url:external_exports.string().max(4e3).nullable()})).max(20)}),Link=external_exports.object({url:external_exports.string().min(1).max(4e3),message:MessageId.nullable(),snapshot:LinkSnapshot.nullable(),unavailable:external_exports.string().max(300).nullable()}),ExternalAuthor=external_exports.object({id:external_exports.string().min(1),handle:external_exports.string().min(1),name:external_exports.string().min(1),avatar:external_exports.string().nullable(),isBot:external_exports.boolean()}),ExternalFile=external_exports.object({type:external_exports.enum(["image","file","video","audio"]),name:external_exports.string().max(1e3).optional(),mimeType:external_exports.string().max(255).optional(),size:external_exports.number().int().nonnegative().optional(),url:external_exports.string().max(4e3).optional(),fetchMetadata:external_exports.record(external_exports.string(),external_exports.string().max(4e3)).optional()}),ExternalLink=external_exports.object({url:external_exports.string().min(1).max(4e3),thread:ExternalTarget,message:external_exports.string().min(1).max(300),snapshot:LinkSnapshot.nullable()}),ExternalLocation=external_exports.object({channel:ExternalTarget,thread:ExternalTarget,subthread:ExternalTarget.nullable()}),ExternalEvent=external_exports.discriminatedUnion("kind",[external_exports.object({kind:external_exports.literal("message"),...ExternalLocation.shape,message:external_exports.string(),isRoot:external_exports.boolean(),text:external_exports.string(),context:external_exports.string().nullable(),author:ExternalAuthor,files:external_exports.array(ExternalFile).max(20).optional(),links:external_exports.array(ExternalLink).max(10).optional()}),external_exports.object({kind:external_exports.literal("edited"),...ExternalLocation.shape,message:external_exports.string(),text:external_exports.string(),author:ExternalAuthor,links:external_exports.array(ExternalLink).max(10).optional(),linksOnly:external_exports.boolean().optional()}),external_exports.object({kind:external_exports.literal("deleted"),...ExternalLocation.shape,message:external_exports.string()}),external_exports.object({kind:external_exports.literal("reaction"),...ExternalLocation.shape,message:external_exports.string(),emoji:external_exports.string(),added:external_exports.boolean(),author:ExternalAuthor}),external_exports.object({kind:external_exports.literal("lifecycle"),...ExternalLocation.omit({subthread:!0}).shape,type:external_exports.string(),title:external_exports.string(),url:external_exports.string().nullable(),body:external_exports.string().nullable().optional(),labels:external_exports.record(external_exports.string(),external_exports.string()),unset:external_exports.array(external_exports.string()),owns:external_exports.array(external_exports.string()).optional(),reply:external_exports.string().nullable(),createRoot:external_exports.boolean(),retitled:external_exports.boolean().optional(),author:ExternalAuthor})]),isThreadTarget=target=>target.slice(target.indexOf(":")+1).includes(":"),channelOf=externalThread=>{let at=externalThread.indexOf(":"),colon=externalThread.slice(at+1).indexOf(":");return colon===-1?externalThread:externalThread.slice(0,at+1+colon)},externalMessageKey=(thread,message)=>`${thread}|${message}`;var hex=bytes=>Array.from(bytes,byte=>byte.toString(16).padStart(2,"0")).join("");async function sha256(text){return hex(new Uint8Array(await crypto.subtle.digest("SHA-256",new TextEncoder().encode(text))))}async function derivedId(...parts){let bytes=new Uint8Array(await crypto.subtle.digest("SHA-256",new TextEncoder().encode(JSON.stringify(parts)))).slice(0,16);bytes[6]=bytes[6]&15|128,bytes[8]=bytes[8]&63|128;let text=hex(bytes);return`${text.slice(0,8)}-${text.slice(8,12)}-${text.slice(12,16)}-${text.slice(16,20)}-${text.slice(20,32)}`}var DERIVED_ID=/^[0-9a-f]{8}-[0-9a-f]{4}-8[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/,keyId=async(principal,derived)=>`key:${principal}:${(await sha256(`board-key${derived}`)).slice(0,32)}`;function waitUntil(task){try{Reflect.get(globalThis,Symbol.for("@vercel/request-context"))?.get?.()?.waitUntil?.(task)}catch{}}var FENCED_CODE=/```[\s\S]*?```/g,INLINE_CODE=/`[^`\n]*`/g,NAME="[a-z0-9](?:[a-z0-9._-]*[a-z0-9])?",MENTION=new RegExp(`(?<![\\w@.-])@(${NAME}(?:/${NAME})?)(?!:|[a-z0-9_/-]|\\.(?=[a-z0-9]))`,"gi"),EXACT=/(?<![\w@.-])@\[([^\]\s]+)\]/g,proseOnly=text=>text.replace(FENCED_CODE,match=>" ".repeat(match.length)).replace(INLINE_CODE,match=>" ".repeat(match.length));function extractMentions(text){let prose=proseOnly(text),found=[];for(let match of prose.matchAll(EXACT)){let actor=match[1];actor!==void 0&&found.push({index:match.index,token:{kind:"actor",actor},key:`actor:${actor}`})}for(let match of prose.replace(EXACT,m=>" ".repeat(m.length)).matchAll(MENTION)){let handle=match[1]?.toLowerCase();handle!==void 0&&found.push({index:match.index,token:{kind:"handle",handle},key:`handle:${handle}`})}let seen=new Set;return found.sort((a,b)=>a.index-b.index).filter(({key})=>!seen.has(key)&&seen.add(key)).map(({token})=>token)}function replaceMentions(text,replace){let prose=proseOnly(text),found=[];for(let match of prose.matchAll(EXACT))found.push({index:match.index,length:match[0].length,token:{kind:"actor",actor:match[1]}});for(let match of prose.replace(EXACT,m=>" ".repeat(m.length)).matchAll(MENTION))found.push({index:match.index,length:match[0].length,token:{kind:"handle",handle:match[1].toLowerCase()}});let out="",at=0;for(let{index,length,token}of found.sort((a,b)=>a.index-b.index)){let written=text.slice(index,index+length);out+=text.slice(at,index)+(replace(token,written)??written),at=index+length}return out+text.slice(at)}var DroppedError=class extends HttpError{responses;constructor(responses){super(422,"dropped",responses.join(`
|
|
8
|
+
`)||"the board dropped this message"),this.responses=responses}},Patch=external_exports.object({text:external_exports.string().max(MESSAGE_TEXT_MAX).optional(),labels:Labels.optional()}).strict();async function runMiddleware(middleware,input,commit){let responses=[],committed=null,step=async(i,write)=>{if(i===middleware.length){if(write.text.trim()===""&&(write.kind==="edit"||write.attachments.length===0))return;committed={value:await commit(write)};return}let next=null;await middleware[i]({write:Object.freeze({...write}),author:Object.freeze({...input.author}),source:Object.freeze({...input.source}),board:input.board(),respond:async text=>{responses.push(text)},next:(patch={})=>{if(next)throw new Error("next() was already called");let{text,labels}=Patch.parse(patch);return next=step(i+1,{...write,...text!==void 0?{text}:{},...write.kind==="post"&&labels?{labels:{...write.labels,...labels}}:{}}),next}}),next&&await next};if(await step(0,input.write),!committed)throw new DroppedError(responses);return committed.value}var VERCEL_MARKER=/^\[vc\]: #\S*\r?\n/,LINK=/\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)/g,STATUS=/!\[([^\]]+)\]\(https:\/\/vercel\.com\/static\/status\/[^)]+\)\s*(?:\[[^\]]*\]\((https?:\/\/[^)\s]+)\))?/;function vercelDeployments(text){if(!VERCEL_MARKER.test(text))return null;let skippedAt=text.search(/<details><summary>\d+ Skipped Deployments?<\/summary>/),deployments=[],offset=0;for(let line of text.split(/\r?\n/)){let at=offset;if(offset=text.indexOf(`
|
|
9
|
+
`,offset)+1||text.length,!line.startsWith("|")||/^\|\s*(Project|Name)\s*\|/.test(line)||/^\|\s*:?-/.test(line))continue;let cells=line.split("|").slice(1,-1).map(cell=>cell.trim());if(cells.length<2)continue;let status=STATUS.exec(cells[1]);if(!status)continue;let projectLink=[...cells[0].matchAll(LINK)].at(-1),project=projectLink?.[1]??cells[0].replace(/<[^>]*>/g,"").trim();if(!project)continue;let preview=cells[2]?[...cells[2].matchAll(LINK)].find(link2=>/preview/i.test(link2[1])):void 0,updated=cells[3]?.match(/<relative-time[^>]*>([^<]+)<\/relative-time>/)?.[1]?.trim()??(cells[3]?.replace(/<[^>]*>/g,"").trim()||null);deployments.push({project,projectUrl:projectLink?.[2]??null,status:status[1].trim(),deploymentUrl:status[2]??null,previewUrl:preview?.[2]??null,updated,skipped:skippedAt!==-1&&at>skippedAt})}return deployments.length>0?deployments:null}var ICONS={ready:"\u2705",building:"\u23F3",queued:"\u23F3",initializing:"\u23F3",error:"\u274C",failed:"\u274C",canceled:"\u26AA",ignored:"\u26AA"},link=(label,url)=>url?`[${label}](${url})`:label;function formatVercelDeployments(deployments){return deployments.map(d=>`- ${[`${ICONS[d.status.toLowerCase()]??"\u25B2"} **${link(d.project,d.projectUrl)}**`,`${link(d.status,d.deploymentUrl)}${d.skipped?" (skipped)":""}`,...d.previewUrl?[link("Preview",d.previewUrl)]:[],...d.updated?[d.updated]:[]].join(" \xB7 ")}`).join(`
|
|
10
|
+
`)}function displayText(text,actor){let deployments=actor==="github:user:35613825"?vercelDeployments(text):null;return deployments?`**\u25B2 Vercel**
|
|
11
|
+
${formatVercelDeployments(deployments)}`:text}export{ExternalTarget,Origin,Link,ExternalAuthor,ExternalLocation,ExternalEvent,isThreadTarget,channelOf,externalMessageKey,sha256,derivedId,DERIVED_ID,keyId,waitUntil,extractMentions,replaceMentions,DroppedError,runMiddleware,displayText};
|
|
@@ -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{require_dist as require_dist2}from"./chunk-JALVF3C2.js";import{packageName}from"./chunk-VRH7LWOC.js";import{require_dist}from"./chunk-RM3ZDRYE.js";import{confirmOption,projectOption,yesOption}from"./chunk-
|
|
7
|
+
import{require_dist as require_dist2}from"./chunk-JALVF3C2.js";import{packageName}from"./chunk-VRH7LWOC.js";import{require_dist}from"./chunk-RM3ZDRYE.js";import{confirmOption,projectOption,yesOption}from"./chunk-AMPJ6RWT.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_async_listen=__toESM(require_dist2(),1),import_error_utils=__toESM(require_dist(),1),DEV_QUEUE_API_PREFIX="/api/v3/topic/",DEV_QUEUE_PROXY_PREFIX="/_svc/_queues",DEV_QUEUE_DEFAULT_PORT=4782,DEV_RUNTIME_CACHE_DEFAULT_PORT=4783,DEV_SCHEDULES_DEFAULT_PORT=4784,DEV_SCHEDULES_PROXY_PREFIX="/_svc/_schedules",DEV_RESOURCE_TOKEN="vc-dev-token";function isValidDevResourceHost(origin,host){let port=new URL(origin).port,suffix=port?`:${port}`:"",normalizedHost=host?.toLowerCase();return normalizedHost===`127.0.0.1${suffix}`||normalizedHost===`localhost${suffix}`}async function listenOnDevResourcePort(server,options){let isPinned=options.port!==void 0,reservedPorts=new Set(options.reservedPorts),port=options.port??options.defaultPort;for(;;){if(!isPinned&&reservedPorts.has(port)){if(port>=65535)throw new Error(`${options.name} could not find an available port at or above 127.0.0.1:${options.defaultPort}. Choose another port with ${options.flag}.`);port++;continue}try{let address=await(0,import_async_listen.listen)(server,port,"127.0.0.1"),url=new URL(address.toString()),serverAddress=server.address(),actualPort=serverAddress&&typeof serverAddress!="string"?serverAddress.port:Number(url.port);return{origin:url.origin,port:actualPort,...port!==options.defaultPort&&!isPinned?{defaultPort:options.defaultPort}:{}}}catch(err){if(!(0,import_error_utils.isErrnoException)(err)||err.code!=="EADDRINUSE")throw err;if(isPinned||port>=65535)throw new Error(`${options.name} could not listen on 127.0.0.1:${port} because the port is already in use. Choose another port with ${options.flag}.`);port++}}}function getDevQueueEnv(baseUrl,hasWorkerServices=!0){return{...hasWorkerServices?{VERCEL_HAS_WORKER_SERVICES:"1"}:{},VERCEL_QUEUE_BASE_URL:baseUrl,VERCEL_QUEUE_TOKEN:DEV_RESOURCE_TOKEN,VERCEL_REGION:"dev1"}}function getDevSchedulesEnv(baseUrl,container=!1){if(!baseUrl)return{};let endpoint=new URL(baseUrl);return container&&["localhost","127.0.0.1","[::1]"].includes(endpoint.hostname)&&(endpoint.hostname="host.docker.internal"),{VERCEL_SCHEDULE_BASE_URL:endpoint.toString().replace(/\/$/,""),VERCEL_SCHEDULE_TOKEN:DEV_RESOURCE_TOKEN,VERCEL_SCHEDULE_DEV_API_VERSION:"1"}}var devCommand={name:"dev",aliases:["develop"],description:`Starts the \`${packageName} dev\` server.`,arguments:[{name:"dir",required:!1}],options:[{name:"listen",description:"Specify a URI endpoint on which to listen (default: 0.0.0.0:3000)",argument:"URI",shorthand:null,deprecatedShorthand:"l",type:String,deprecated:!1},{name:"local",shorthand:null,deprecatedShorthand:"L",type:Boolean,deprecated:!1,description:"Start the dev server without linking to a Vercel project"},{name:"queue-port",description:`Specify the local Vercel Queues server port (default: ${DEV_QUEUE_DEFAULT_PORT})`,argument:"PORT",shorthand:null,type:String,deprecated:!1},{name:"runtime-cache-port",description:`Specify the local Runtime Cache server port (default: ${DEV_RUNTIME_CACHE_DEFAULT_PORT})`,argument:"PORT",shorthand:null,type:String,deprecated:!1},{name:"tunnel",shorthand:null,type:Boolean,deprecated:!1},{name:"schedules-port",description:`Specify the local Vercel Schedules server port (default: ${DEV_SCHEDULES_DEFAULT_PORT})`,argument:"PORT",shorthand:null,type:String,deprecated:!1},yesOption,{name:"port",shorthand:"p",type:String,deprecated:!0},confirmOption,{...projectOption,shorthand:null}],examples:[{name:`Start the \`${packageName} dev\` server on port 8080`,value:`${packageName} dev --listen 8080`},{name:"Make the `vercel dev` server bind to localhost on port 5000",value:`${packageName} dev --listen 127.0.0.1:5000 `},{name:"Pin local resource server ports",value:`${packageName} dev --queue-port 5782 --runtime-cache-port 5783 --schedules-port 5784`}]};export{DEV_QUEUE_API_PREFIX,DEV_QUEUE_PROXY_PREFIX,DEV_QUEUE_DEFAULT_PORT,DEV_RUNTIME_CACHE_DEFAULT_PORT,DEV_SCHEDULES_DEFAULT_PORT,DEV_SCHEDULES_PROXY_PREFIX,DEV_RESOURCE_TOKEN,isValidDevResourceHost,listenOnDevResourcePort,getDevQueueEnv,getDevSchedulesEnv,devCommand};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{require_dist}from"./chunk-WKSXBH7X.js";import{__commonJS,__require}from"./chunk-BZENIQ7N.js";var require_token_error=__commonJS({"../../node_modules/.pnpm/@vercel+oidc@3.8.10/node_modules/@vercel/oidc/dist/token-error.js"(exports,module){"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),token_error_exports={};__export(token_error_exports,{VercelOidcTokenError:()=>VercelOidcTokenError});module.exports=__toCommonJS(token_error_exports);var VercelOidcTokenError=class extends Error{constructor(message,cause){super(message),this.name="VercelOidcTokenError",this.cause=cause}toString(){return this.cause?`${this.name}: ${this.message}: ${this.cause}`:`${this.name}: ${this.message}`}}}});var require_token_io=__commonJS({"../../node_modules/.pnpm/@vercel+oidc@3.8.10/node_modules/@vercel/oidc/dist/token-io.js"(exports,module){"use strict";var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),token_io_exports={};__export(token_io_exports,{findRootDir:()=>findRootDir,getUserDataDir:()=>getUserDataDir});module.exports=__toCommonJS(token_io_exports);var import_path=__toESM(__require("path")),import_fs=__toESM(__require("fs")),import_os=__toESM(__require("os")),import_token_error=require_token_error();function findRootDir(){try{let dir=process.cwd();for(;dir!==import_path.default.dirname(dir);){let pkgPath=import_path.default.join(dir,".vercel");if(import_fs.default.existsSync(pkgPath))return dir;dir=import_path.default.dirname(dir)}}catch{throw new import_token_error.VercelOidcTokenError("Token refresh only supported in node server environments")}return null}function getUserDataDir(){if(process.env.XDG_DATA_HOME)return process.env.XDG_DATA_HOME;switch(import_os.default.platform()){case"darwin":return import_path.default.join(import_os.default.homedir(),"Library/Application Support");case"linux":return import_path.default.join(import_os.default.homedir(),".local/share");case"win32":return process.env.LOCALAPPDATA?process.env.LOCALAPPDATA:null;default:return null}}}});var require_oauth=__commonJS({"../../node_modules/.pnpm/@vercel+oidc@3.8.10/node_modules/@vercel/oidc/dist/oauth.js"(exports,module){"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),oauth_exports={};__export(oauth_exports,{processTokenResponse:()=>processTokenResponse,refreshTokenRequest:()=>refreshTokenRequest});module.exports=__toCommonJS(oauth_exports);var import_os=__require("os"),VERCEL_ISSUER="https://vercel.com",VERCEL_CLI_CLIENT_ID="cl_HYyOPBNtFMfHhaUn9L4QPfTZz6TP47bp",userAgent=`@vercel/oidc node-${process.version} ${(0,import_os.platform)()} (${(0,import_os.arch)()}) ${(0,import_os.hostname)()}`,_tokenEndpoint=null;async function getTokenEndpoint(){if(_tokenEndpoint)return _tokenEndpoint;let discoveryUrl=`${VERCEL_ISSUER}/.well-known/openid-configuration`,response=await fetch(discoveryUrl,{headers:{"user-agent":userAgent}});if(!response.ok)throw new Error("Failed to discover OAuth endpoints");let metadata=await response.json();if(!metadata||typeof metadata.token_endpoint!="string")throw new Error("Invalid OAuth discovery response");let endpoint=metadata.token_endpoint;return _tokenEndpoint=endpoint,endpoint}async function refreshTokenRequest(options){let tokenEndpoint=await getTokenEndpoint();return await fetch(tokenEndpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","user-agent":userAgent},body:new URLSearchParams({client_id:VERCEL_CLI_CLIENT_ID,grant_type:"refresh_token",...options})})}async function processTokenResponse(response){let json=await response.json();if(!response.ok){let errorMsg=typeof json=="object"&&json&&"error"in json?String(json.error):"Token refresh failed";return[new Error(errorMsg)]}return typeof json!="object"||json===null?[new Error("Invalid token response")]:typeof json.access_token!="string"?[new Error("Missing access_token in response")]:json.token_type!=="Bearer"?[new Error("Invalid token_type in response")]:typeof json.expires_in!="number"?[new Error("Missing expires_in in response")]:[null,json]}}});var require_auth_errors=__commonJS({"../../node_modules/.pnpm/@vercel+oidc@3.8.10/node_modules/@vercel/oidc/dist/auth-errors.js"(exports,module){"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),auth_errors_exports={};__export(auth_errors_exports,{AccessTokenMissingError:()=>AccessTokenMissingError,RefreshAccessTokenFailedError:()=>RefreshAccessTokenFailedError});module.exports=__toCommonJS(auth_errors_exports);var AccessTokenMissingError=class extends Error{constructor(){super("No authentication found. Please log in with the Vercel CLI (vercel login)."),this.name="AccessTokenMissingError"}},RefreshAccessTokenFailedError=class extends Error{constructor(cause){super("Failed to refresh authentication token."),this.name="RefreshAccessTokenFailedError",cause!==void 0&&(this.cause=cause)}}}});var require_token_util=__commonJS({"../../node_modules/.pnpm/@vercel+oidc@3.8.10/node_modules/@vercel/oidc/dist/token-util.js"(exports,module){var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),token_util_exports={};__export(token_util_exports,{assertVercelOidcTokenResponse:()=>assertVercelOidcTokenResponse,findProjectInfo:()=>findProjectInfo,getTokenPayload:()=>getTokenPayload,getVercelOidcToken:()=>getVercelOidcToken,getVercelOidcTokenFromCli:()=>getVercelOidcTokenFromCli,getVercelToken:()=>getVercelToken,isExpired:()=>isExpired,loadToken:()=>loadToken,saveToken:()=>saveToken});module.exports=__toCommonJS(token_util_exports);var path=__toESM(__require("path")),fs=__toESM(__require("fs")),import_cli_exec=require_dist(),import_cli_config=__require("@vercel/cli-config"),import_token_error=require_token_error(),import_token_io=require_token_io(),import_oauth=require_oauth(),import_auth_errors=require_auth_errors();async function getVercelToken(options){let configDir=(0,import_cli_config.getGlobalPathConfig)(),authConfig=(0,import_cli_config.tryReadAuthConfig)(configDir);if(!authConfig||!authConfig.token&&!authConfig.refreshToken)throw new import_auth_errors.AccessTokenMissingError;if(isValidAccessToken(authConfig,options?.expirationBufferMs))return authConfig.token;if(!authConfig.refreshToken)throw(0,import_cli_config.writeAuthConfig)(configDir,{}),new import_auth_errors.RefreshAccessTokenFailedError("No refresh token available");try{let tokenResponse=await(0,import_oauth.refreshTokenRequest)({refresh_token:authConfig.refreshToken}),[tokensError,tokens]=await(0,import_oauth.processTokenResponse)(tokenResponse);if(tokensError||!tokens)throw(0,import_cli_config.writeAuthConfig)(configDir,{}),new import_auth_errors.RefreshAccessTokenFailedError(tokensError);let updatedConfig={token:tokens.access_token,expiresAt:Math.floor(Date.now()/1e3)+tokens.expires_in,refreshToken:tokens.refresh_token};return(0,import_cli_config.writeAuthConfig)(configDir,updatedConfig),updatedConfig.token}catch(error){throw(0,import_cli_config.writeAuthConfig)(configDir,{}),error instanceof import_auth_errors.AccessTokenMissingError||error instanceof import_auth_errors.RefreshAccessTokenFailedError?error:new import_auth_errors.RefreshAccessTokenFailedError(error)}}function isValidAccessToken(authConfig,expirationBufferMs=0){if(!authConfig.token)return!1;if(typeof authConfig.expiresAt!="number")return!0;let nowInSeconds=Math.floor(Date.now()/1e3),bufferInSeconds=expirationBufferMs/1e3;return authConfig.expiresAt>=nowInSeconds+bufferInSeconds}async function getVercelOidcTokenFromCli(projectId,teamId){let args=["project","token",projectId,"--format=json"];teamId&&args.push("--scope",teamId);try{let{stdout}=await(0,import_cli_exec.execVercelCli)(args),parsedOutput;if(typeof stdout!="string")throw new import_token_error.VercelOidcTokenError("Failed to refresh OIDC token: `vercel project token` did not return stdout");try{parsedOutput=JSON.parse(stdout)}catch{throw new import_token_error.VercelOidcTokenError("Failed to refresh OIDC token: `vercel project token` returned invalid JSON: "+stdout)}return assertVercelOidcTokenResponse(parsedOutput),parsedOutput}catch(error){if(error instanceof import_token_error.VercelOidcTokenError)throw error;let message=error instanceof Error?error.message:"",stderr=error instanceof import_cli_exec.VercelCliError?error.stderr?.trim():void 0;throw stderr&&!message.includes(stderr)&&(message=`${message}
|
|
8
|
+
${stderr}`.trim()),new import_token_error.VercelOidcTokenError(message?`Failed to refresh OIDC token with the Vercel CLI: ${message}`:"Failed to refresh OIDC token with the Vercel CLI")}}async function getVercelOidcToken(authToken,projectId,teamId){let url=`https://api.vercel.com/v1/projects/${projectId}/token?source=vercel-oidc-refresh${teamId?`&teamId=${teamId}`:""}`,res=await fetch(url,{method:"POST",headers:{Authorization:`Bearer ${authToken}`}});if(!res.ok)throw new import_token_error.VercelOidcTokenError(`Failed to refresh OIDC token: ${res.statusText}`);let tokenRes=await res.json();return assertVercelOidcTokenResponse(tokenRes),tokenRes}function assertVercelOidcTokenResponse(res){if(!res||typeof res!="object")throw new TypeError("Vercel OIDC token is malformed. Expected an object.");if(!("token"in res)||typeof res.token!="string")throw new TypeError("Vercel OIDC token is malformed. Expected a string-valued token property.")}function findProjectInfo(){let dir=(0,import_token_io.findRootDir)();if(!dir)throw new import_token_error.VercelOidcTokenError("Unable to find project root directory. Have you linked your project with `vc link?`");let prjPath=path.join(dir,".vercel","project.json");if(!fs.existsSync(prjPath))throw new import_token_error.VercelOidcTokenError("project.json not found, have you linked your project with `vc link?`");let prj=JSON.parse(fs.readFileSync(prjPath,"utf8"));if(typeof prj.projectId!="string"&&typeof prj.orgId!="string")throw new TypeError("Expected a string-valued projectId property. Try running `vc link` to re-link your project.");return{projectId:prj.projectId,teamId:prj.orgId}}function saveToken(token,projectId){let dir=(0,import_token_io.getUserDataDir)();if(!dir)throw new import_token_error.VercelOidcTokenError("Unable to find user data directory. Please reach out to Vercel support.");let tokenPath=path.join(dir,"com.vercel.token",`${projectId}.json`),tokenJson=JSON.stringify(token);fs.mkdirSync(path.dirname(tokenPath),{mode:504,recursive:!0}),fs.writeFileSync(tokenPath,tokenJson),fs.chmodSync(tokenPath,432)}function loadToken(projectId){let dir=(0,import_token_io.getUserDataDir)();if(!dir)throw new import_token_error.VercelOidcTokenError("Unable to find user data directory. Please reach out to Vercel support.");let tokenPath=path.join(dir,"com.vercel.token",`${projectId}.json`);if(!fs.existsSync(tokenPath))return null;let token=JSON.parse(fs.readFileSync(tokenPath,"utf8"));return assertVercelOidcTokenResponse(token),token}function getTokenPayload(token){let tokenParts=token.split(".");if(tokenParts.length!==3)throw new import_token_error.VercelOidcTokenError("Invalid token.");let base64=tokenParts[1].replace(/-/g,"+").replace(/_/g,"/"),padded=base64.padEnd(base64.length+(4-base64.length%4)%4,"=");return JSON.parse(Buffer.from(padded,"base64").toString("utf8"))}function isExpired(token,bufferMs=0){return token.exp*1e3<Date.now()+bufferMs}}});export{require_token_error,require_auth_errors,require_token_util};
|
|
@@ -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{outputAgentError}from"./chunk-
|
|
7
|
+
import{outputAgentError}from"./chunk-AUIV7YJO.js";import{findProjectsFromPath,getConfigFilePath,getLinkFromDir,getRepoLink,getUser,getVercelDirectory,inspectTokenRequest,processInspectTokenResponse}from"./chunk-6NUH6ZPE.js";import{getTeamByIdOrSlug}from"./chunk-2VBFQZ72.js";import{require_ms}from"./chunk-MXTC4ZAQ.js";import{require_cli_config}from"./chunk-4SAVH3H7.js";import{InvalidToken,TeamDeleted}from"./chunk-T2FCF46I.js";import{output_manager_default}from"./chunk-GZLYNPNU.js";import{require_build_utils}from"./chunk-5MDNVAE6.js";import{AGENT_REASON}from"./chunk-JBU72NEQ.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_build_utils=__toESM(require_build_utils(),1);var VERCEL_API_ORIGIN="https://api.vercel.com";async function introspectToken(client){let token=client.authConfig.token;if(!token)throw new Error("No token to introspect");if(new URL(client.apiUrl).origin!==VERCEL_API_ORIGIN)throw new Error("Token introspection is unavailable for custom API origins");let[error,introspection]=await processInspectTokenResponse(await inspectTokenRequest(token));if(error)throw error;return introspection}function isAppPrincipalEnabled(){return!!process.env.APP_PRINCIPAL_ENABLED}function resolveAppFromToken(token){return!token.active||!token.client_id?null:{id:token.client_id,name:token.client_name}}async function getAppTokenTeamId(client){try{await getUser(client);return}catch{let token=await introspectToken(client).catch(()=>null);return token&&resolveAppFromToken(token)?token.team?.id:void 0}}function assertOrgIdMatchesAppTeam(client,appTeamId){let envOrgId=(0,import_build_utils.getPlatformEnv)("ORG_ID");if(!envOrgId||envOrgId===appTeamId)return;let message=`This token only works with team ${appTeamId}, but VERCEL_ORG_ID is set to ${envOrgId}.`;throw outputAgentError(client,{status:"error",reason:AGENT_REASON.SCOPE_NOT_ACCESSIBLE,message}),new Error(message)}async function resolveAppTokenScope(client,scope){let token=await introspectToken(client).catch(()=>null),app=token?resolveAppFromToken(token):null,team=token?.team;return!app||!team||team.id!==scope&&team.slug!==scope?!1:(client.config.currentTeam=team.id,!0)}async function isActiveAppToken(client){let token=await introspectToken(client).catch(()=>null);return!!(token&&resolveAppFromToken(token))}var import_cli_config=__toESM(require_cli_config(),1),import_ms=__toESM(require_ms(),1);var TEAM_SLUG_TTL_MS=(0,import_ms.default)("1d");function getCachedTeamSlug(config,teamId,now=Date.now()){let saved=config.cachedTeamSlugs?.[teamId];if(!isSavedTeamSlug(saved))return;let age=now-saved.savedAt;return age>=0&&age<TEAM_SLUG_TTL_MS?saved.slug:void 0}function setCachedTeamSlug(client,teamId,slug){if(getCachedTeamSlug(client.config,teamId)===slug)return;let saved={slug,savedAt:Date.now()};updateCachedTeamSlugs(client,slugs=>({...slugs,[teamId]:saved}))}function forgetCachedTeamSlug(client,teamId){let slugs=client.config.cachedTeamSlugs;!slugs||!(teamId in slugs)||updateCachedTeamSlugs(client,saved=>{let rest={...saved};return delete rest[teamId],rest})}function isSavedTeamSlug(value){return typeof value=="object"&&value!==null&&typeof value.slug=="string"&&typeof value.savedAt=="number"}function updateCachedTeamSlugs(client,update){try{let configPath=getConfigFilePath(),savedConfig=(0,import_cli_config.readGlobalConfigFile)(configPath),cachedTeamSlugs=update(savedConfig.cachedTeamSlugs??{}),config={...savedConfig,cachedTeamSlugs};(0,import_cli_config.writeGlobalConfigFile)(configPath,config),client.config.cachedTeamSlugs=cachedTeamSlugs}catch{output_manager_default.debug("Failed to persist cached team slugs.")}}var import_build_utils2=__toESM(require_build_utils(),1);import{relative}from"path";async function getScope(client,opts={}){let{user,app,token}=await getPrincipal(client),defaultTeamId=user?.version==="northstar"&&!client.ignoresSavedTeam?user.defaultTeamId:void 0,appTeamId=!user&&app?token?.team?.id:void 0;if(!user&&app&&opts.getTeam===!1)throw new Error("App principal scope resolution requires a team lookup.");!user&&app&&(client.ignoresSavedTeam&&appTeamId&&assertOrgIdMatchesAppTeam(client,appTeamId),client.config.currentTeam=appTeamId),!client.config.currentTeam&&defaultTeamId&&(client.config.currentTeam=defaultTeamId),client.isTeamUnchosen()&&await client.chooseTeam({ask:opts.chooseTeam!==!1});let teamId=client.config.currentTeam||defaultTeamId,team=teamId&&opts.getTeam!==!1?await getTeam(client,teamId):null,contextName=team?.slug||user?.username||user?.email;if(!contextName)throw new Error("Unable to determine context name");return opts.resolveLocalScope?resolveLocalScopeContext(client,{user,app,team}):{contextName,team,user,app}}async function getContextName(client,opts={}){let teamId=client.config.currentTeam,cachedSlug=teamId&&!client.authConfig.tokenSource?getCachedTeamSlug(client.config,teamId):void 0;if(cachedSlug&&!(opts.resolveLocalScope&&await hasLocalScope(client)))return output_manager_default.debug(`Using saved name "${cachedSlug}" for team ${teamId}`),cachedSlug;let{contextName,team}=opts.resolveLocalScope?await getScope(client,{resolveLocalScope:!0}):await getScope(client);return team&&!client.authConfig.tokenSource&&setCachedTeamSlug(client,team.id,team.slug),contextName}async function hasLocalScope(client){if(detectExplicitScope(client))return!1;let{localOrgId,isCrossTeamRepo}=await findLocalLink(client);return!!localOrgId||isCrossTeamRepo}async function getPrincipal(client){if(!isAppPrincipalEnabled())return{user:await getUser(client),app:null,token:null};let[userResult,tokenResult]=await Promise.allSettled([getUser(client),introspectToken(client)]),token=tokenResult.status==="fulfilled"?tokenResult.value:null,app=token?resolveAppFromToken(token):null;if(userResult.status==="rejected"&&!(app&&userResult.reason instanceof InvalidToken))throw userResult.reason;return{user:userResult.status==="fulfilled"?userResult.value:null,app,token}}async function resolveLocalScopeContext(client,{user,app,team}){let explicitScopeProvided=detectExplicitScope(client)||client.ignoresSavedTeam&&!!(0,import_build_utils2.getPlatformEnv)("ORG_ID"),globalTeamId=client.config.currentTeam,{localOrgId,linkedRepo,isCrossTeamRepo}=await findLocalLink(client),isAppPrincipal=!user&&!!app,effectiveLocalOrgId=isAppPrincipal?void 0:localOrgId,scopeMismatch=!!(effectiveLocalOrgId&&globalTeamId&&globalTeamId!==effectiveLocalOrgId);!isAppPrincipal&&!explicitScopeProvided&&!effectiveLocalOrgId&&isCrossTeamRepo&&output_manager_default.warn("This repository has projects across multiple teams. Use `--scope` to specify which team, or `cd` into a project directory.");let resolvedTeam=!explicitScopeProvided&&effectiveLocalOrgId?await applyLocalOrg(client,effectiveLocalOrgId):team,{org,contextName}=resolveOrg(resolvedTeam,user);return{org,contextName,user,team:resolvedTeam,app,globalTeam:team,linkedRepo,isCrossTeamRepo,localOrgId:effectiveLocalOrgId,scopeMismatch,explicitScopeProvided}}async function applyLocalOrg(client,localOrgId){return client.config.currentTeam=localOrgId.startsWith("team_")?localOrgId:void 0,client.config.currentTeam?await getTeamByIdOrSlug(client,client.config.currentTeam):null}async function getTeam(client,teamId){let team=await getTeamByIdOrSlug(client,teamId);if(!team)throw new TeamDeleted;return team}function resolveOrg(team,user){if(team)return{org:{type:"team",id:team.id,slug:team.slug},contextName:team.slug};if(user)return{org:{type:"user",id:user.id,slug:user.username},contextName:user.username||user.email};throw new Error("Unable to determine scope: no team or personal account is available for this token. Use `--scope` to specify a team.")}async function getLocalOrgId(client){return(await findLocalLink(client)).localOrgId}async function findLocalLink(client){let[projectLink,repoLink]=await Promise.all([findProjectLink(client),findRepoLink(client)]);return{localOrgId:findLocalOrgId(client.cwd,projectLink,repoLink),linkedRepo:repoLink?.repoConfig?{repoConfig:repoLink.repoConfig,rootPath:repoLink.rootPath}:null,isCrossTeamRepo:detectCrossTeamRepo(repoLink?.repoConfig)}}async function findProjectLink(client){try{return await getLinkFromDir(getVercelDirectory(client.cwd))}catch{return null}}async function findRepoLink(client){try{return await getRepoLink(client,client.cwd)}catch{return null}}function findLocalOrgId(cwd,projectLink,repoLink){if(projectLink)return projectLink.orgId;if(repoLink?.repoConfig)return findRepoOrgId(repoLink.repoConfig,relative(repoLink.rootPath,cwd))}function findRepoOrgId(repoConfig,pathFromRepoRoot){let matchedProjects=findProjectsFromPath(repoConfig.projects,pathFromRepoRoot),projects=matchedProjects.length===0&&pathFromRepoRoot===""?repoConfig.projects:matchedProjects,orgIds=new Set(projects.map(p=>p.orgId??repoConfig.orgId??""));if(orgIds.size!==1)return;let[orgId]=orgIds;return orgId||void 0}function scopeFlagPassed(argv){for(let arg of argv){if(arg==="--")break;if(arg==="--scope"||arg==="--team"||arg.startsWith("--scope=")||arg.startsWith("--team=")||arg==="-S"||arg==="-T")return!0}return!1}function detectExplicitScope(client){return scopeFlagPassed(client.argv)||!!client.localConfig?.scope}function detectCrossTeamRepo(repoConfig){if(!repoConfig?.projects||repoConfig.projects.length<2)return!1;let orgIds=new Set;for(let project of repoConfig.projects){let orgId=project.orgId??repoConfig.orgId;orgId&&orgIds.add(orgId)}return orgIds.size>1}export{introspectToken,isAppPrincipalEnabled,resolveAppFromToken,getAppTokenTeamId,assertOrgIdMatchesAppTeam,resolveAppTokenScope,isActiveAppToken,forgetCachedTeamSlug,getScope,getContextName,resolveOrg,getLocalOrgId,scopeFlagPassed,detectExplicitScope};
|
|
@@ -4,7 +4,7 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{require_semver}from"./chunk-BPUANOGW.js";import{getInstallRoot,isNativeBinaryInstall}from"./chunk-NWGBDBZI.js";import{output_manager_default}from"./chunk-
|
|
7
|
+
import{require_semver}from"./chunk-BPUANOGW.js";import{getInstallRoot,isNativeBinaryInstall}from"./chunk-NWGBDBZI.js";import{output_manager_default}from"./chunk-GZLYNPNU.js";import{require_tar_fs}from"./chunk-KRPY5FHJ.js";import{fetch,toNodeReadable}from"./chunk-MY4MONOH.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_tar_fs=__toESM(require_tar_fs(),1),import_semver=__toESM(require_semver(),1);import{createGunzip}from"node:zlib";import{createHash as createHash2}from"node:crypto";import{createWriteStream}from"node:fs";import{tmpdir}from"node:os";import{join as join2,sep as sep2}from"node:path";import{pipeline}from"node:stream/promises";import{chmod,copyFile,mkdir as mkdir3,mkdtemp,realpath,rename as rename3,rm as rm3,stat as stat2,writeFile as writeFile3}from"node:fs/promises";import{randomUUID as randomUUID2}from"node:crypto";import{join,relative,resolve,sep}from"node:path";import{mkdir as mkdir2,readFile as readFile2,readlink,rename as rename2,rm as rm2,stat,symlink,writeFile as writeFile2}from"node:fs/promises";import{createHash,randomUUID}from"node:crypto";import{dirname}from"node:path";import{link,mkdir,readFile,rename,rm,writeFile}from"node:fs/promises";var DEFAULT_WAIT_MS=3e4,DEFAULT_RETRY_MS=50,RELEASE_OWNER_CHECK_ATTEMPTS=3,RELEASE_OWNER_CHECK_RETRY_MS=10;async function readOwnerRaw(lockPath){let value=JSON.parse(await readFile(lockPath,"utf8"));if(!(typeof value.token!="string"||value.token.length===0||!Number.isSafeInteger(value.pid)||(value.pid??0)<=0||typeof value.createdAt!="number"||!Number.isFinite(value.createdAt)||value.createdAt<=0))return value}async function readOwner(lockPath){try{return await readOwnerRaw(lockPath)}catch{return}}async function stillOwnsLock(ownerPath,token){for(let attempt=0;;attempt++)try{return(await readOwnerRaw(ownerPath))?.token===token}catch(error){if(error.code==="ENOENT")return!1;if(attempt>=RELEASE_OWNER_CHECK_ATTEMPTS-1)return!0;await new Promise(resolve2=>setTimeout(resolve2,RELEASE_OWNER_CHECK_RETRY_MS))}}function processExists(pid){try{return process.kill(pid,0),!0}catch(error){return error.code==="EPERM"}}async function moveAbandonedDirectoryLock(lockPath,abandonedAfterMs){let owner=await readOwner(`${lockPath}/owner.json`);if(!owner||Date.now()-owner.createdAt<abandonedAfterMs||processExists(owner.pid))return!1;let generation=createHash("sha256").update(owner.token).digest("hex"),tombstone=`${lockPath}.abandoned-${generation}`;try{return await rename(lockPath,tombstone),!0}catch(error){if(isContentionError(error,["ENOENT","EEXIST","ENOTEMPTY"]))return!1;throw error}}function isContentionError(error,expectedCodes){let code=error.code;return!!(code&&expectedCodes.includes(code)||process.platform==="win32"&&code==="EPERM")}async function waitForRetry(startedAt,lockPath,{waitMs,retryMs,busyMessage}){if(waitMs===0||Date.now()-startedAt>=waitMs)throw new Error(busyMessage(lockPath,waitMs!==0));await new Promise(resolveTimeout=>setTimeout(resolveTimeout,Math.min(retryMs,waitMs)))}async function withFileLock(lockPath,action,{waitMs=DEFAULT_WAIT_MS,retryMs=DEFAULT_RETRY_MS,busyMessage}){await mkdir(dirname(lockPath),{recursive:!0});let owner={token:randomUUID(),pid:process.pid,createdAt:Date.now()},claim=`${lockPath}.claim-${owner.token}`,released=`${lockPath}.released-${owner.token}`,startedAt=Date.now(),acquired=!1;await writeFile(claim,`${JSON.stringify(owner)}
|
|
8
8
|
`,{flag:"wx"});try{for(;;)try{await link(claim,lockPath),acquired=!0;break}catch(error){if(!isContentionError(error,["EEXIST"]))throw error;await waitForRetry(startedAt,lockPath,{waitMs,retryMs,busyMessage})}return await rm(claim,{force:!0}).catch(()=>{}),await action()}finally{acquired&&await stillOwnsLock(lockPath,owner.token)&&(await rename(lockPath,released).then(()=>!0).catch(()=>!1)?await rm(released,{force:!0}):await rm(lockPath,{force:!0})),await rm(claim,{force:!0})}}async function withDirectoryLock(lockPath,action,{waitMs=DEFAULT_WAIT_MS,retryMs=DEFAULT_RETRY_MS,busyMessage,abandonedAfterMs}){await mkdir(dirname(lockPath),{recursive:!0});let owner={token:randomUUID(),pid:process.pid,createdAt:Date.now()},claim=`${lockPath}.claim-${owner.token}`,ownerPath=`${claim}/owner.json`,startedAt=Date.now(),acquired=!1;await mkdir(claim),await writeFile(ownerPath,`${JSON.stringify(owner)}
|
|
9
9
|
`);try{for(;;)try{await rename(claim,lockPath),acquired=!0;break}catch(error){if(!isContentionError(error,["EEXIST","ENOTEMPTY"]))throw error;if(abandonedAfterMs!==void 0&&await moveAbandonedDirectoryLock(lockPath,abandonedAfterMs))continue;await waitForRetry(startedAt,lockPath,{waitMs,retryMs,busyMessage})}return await action()}finally{if(acquired&&await stillOwnsLock(`${lockPath}/owner.json`,owner.token)){let released=`${lockPath}.released-${owner.token}`;await rename(lockPath,released).then(()=>!0).catch(()=>!1)?await rm(released,{recursive:!0,force:!0}):await rm(lockPath,{recursive:!0,force:!0})}await rm(claim,{recursive:!0,force:!0})}}var SLOTS=["a","b"],LOCK_RETRY_MS=50;function tracksDir(root){return join(root,"versions","tracks")}function slotDir(root,track,slot){return join(tracksDir(root),track,slot)}function isTrack(value){return value==="production"||value==="pr"}function isSlot(value){return value==="a"||value==="b"}async function atomicSymlink(target,path){let temporary=`${path}.tmp-${randomUUID2()}`;await symlink(target,temporary);try{await rename2(temporary,path)}catch(error){throw await rm2(temporary,{force:!0}),error}}async function atomicWrite(path,contents){let temporary=`${path}.tmp-${randomUUID2()}`;await writeFile2(temporary,contents);try{await rename2(temporary,path)}catch(error){throw await rm2(temporary,{force:!0}),error}}async function readSlotMetadata(root,track,slot){try{let value=JSON.parse(await readFile2(join(slotDir(root,track,slot),"metadata.json"),"utf8"));return value.track!==track||value.slot!==slot||typeof value.version!="string"?void 0:value}catch{return}}async function readPointer(root,path){try{let target=resolve(root,await readlink(path)),rel=relative(tracksDir(root),target).split(sep);return rel.length!==2||!isTrack(rel[0])||!isSlot(rel[1])?void 0:{track:rel[0],slot:rel[1]}}catch{return}}async function readActivePointer(root){return readPointer(root,join(root,"active"))}async function readTrackPointer(root,track){try{let slot=(await readlink(join(tracksDir(root),track,"active"))).split(sep).pop();return slot&&isSlot(slot)?slot:void 0}catch{return}}async function readNativeInstallState(root){let pointer=await readActivePointer(root);if(!pointer)return;let active=await readSlotMetadata(root,pointer.track,pointer.slot);if(!active)return;let pendingProduction;try{let pending=JSON.parse(await readFile2(join(root,"pending-production.json"),"utf8"));pending.slot&&isSlot(pending.slot)&&pending.version&&(await readSlotMetadata(root,"production",pending.slot))?.version===pending.version&&!(pointer.track==="production"&&pointer.slot===pending.slot)&&(pendingProduction={slot:pending.slot,version:pending.version})}catch{}return{...active,pendingProduction}}async function ensureNativeBinLinks(root){let bin=join(root,"bin");await mkdir2(bin,{recursive:!0});for(let name of["vercel","vc"]){let path=join(bin,name),expected=join("..","active","vercel");await readlink(path).catch(()=>{})!==expected&&await atomicSymlink(expected,path)}}async function markPendingProduction(root,slot,version){await atomicWrite(join(root,"pending-production.json"),`${JSON.stringify({slot,version})}
|
|
10
10
|
`)}async function activateSlot(root,track,slot){let metadata=await readSlotMetadata(root,track,slot),binary=await stat(join(slotDir(root,track,slot),"vercel")).catch(()=>{});if(!metadata||!binary?.isFile())throw new Error(`Cannot activate incomplete ${track}/${slot} slot`);let trackDir=join(tracksDir(root),track);await mkdir2(trackDir,{recursive:!0}),await atomicSymlink(slot,join(trackDir,"active")),await atomicSymlink(relative(root,slotDir(root,track,slot)),join(root,"active")),track==="production"&&await rm2(join(root,"pending-production.json"),{force:!0}),await ensureNativeBinLinks(root)}async function getInactiveSlot(root,track){let active=await readActivePointer(root);return(active?.track===track?active.slot:await readTrackPointer(root,track))==="a"?"b":"a"}async function writeTrackSlot(root,metadata,prepare,{signal}={}){signal?.throwIfAborted();let slot=await getInactiveSlot(root,metadata.track),trackDir=join(tracksDir(root),metadata.track),destination=slotDir(root,metadata.track,slot),temporary=join(trackDir,`.slot-${slot}-${randomUUID2()}`),backup=join(trackDir,`.old-${slot}-${randomUUID2()}`);signal?.throwIfAborted(),await mkdir2(temporary,{recursive:!0});try{if(signal?.throwIfAborted(),await prepare(temporary),signal?.throwIfAborted(),!(await stat(join(temporary,"vercel")).catch(()=>{}))?.isFile())throw new Error("Prepared slot does not contain a Vercel CLI binary");signal?.throwIfAborted(),await atomicWrite(join(temporary,"metadata.json"),`${JSON.stringify({...metadata,slot})}
|
|
@@ -4,6 +4,6 @@ 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{getDeployment}from"./chunk-VU3RBRDH.js";import{getScope}from"./chunk-
|
|
7
|
+
import{getDeployment}from"./chunk-VU3RBRDH.js";import{getScope}from"./chunk-DNLE3KPC.js";import{require_dist}from"./chunk-6NUH6ZPE.js";import{output_manager_default}from"./chunk-GZLYNPNU.js";import{require_ansi_escapes}from"./chunk-YHPPP3SF.js";import{toNodeReadable}from"./chunk-MY4MONOH.js";import{__commonJS,__require,__toESM}from"./chunk-BZENIQ7N.js";var require_parser=__commonJS({"../../node_modules/.pnpm/jsonlines@0.1.1/node_modules/jsonlines/lib/parser.js"(exports,module){var Transform=__require("stream").Transform;function Parser(options){if(!(this instanceof Parser))throw new TypeError("Cannot call a class as a function");options=options||{},Transform.call(this,{objectMode:!0}),this._memory="",this._emitInvalidLines=options.emitInvalidLines||!1}Parser.prototype=Object.create(Transform.prototype);Parser.prototype._handleLines=function(lines,cb){for(var i=0;i<lines.length;i++)if(lines[i]!==""){var err=null,json=null;try{json=JSON.parse(lines[i])}catch(_err){_err.source=lines[i],err=_err}if(err)if(this._emitInvalidLines)this.emit("invalid-line",err);else return cb(err);else this.push(json)}cb(null)};Parser.prototype._transform=function(chunk,encoding,cb){var lines=(this._memory+chunk.toString()).split(`
|
|
8
8
|
`);this._memory=lines.pop(),this._handleLines(lines,cb)};Parser.prototype._flush=function(cb){if(!this._memory)return cb(null);var line=this._memory;this._memory="",this._handleLines([line],cb)};module.exports=Parser}});var require_stringifier=__commonJS({"../../node_modules/.pnpm/jsonlines@0.1.1/node_modules/jsonlines/lib/stringifier.js"(exports,module){var Transform=__require("stream").Transform;function Stringifier(){if(!(this instanceof Stringifier))throw new TypeError("Cannot call a class as a function");Transform.call(this,{objectMode:!0})}Stringifier.prototype=Object.create(Transform.prototype);Stringifier.prototype._transform=function(data,_,cb){var value;try{value=JSON.stringify(data)}catch(err){return err.source=data,cb(err)}cb(null,value+`
|
|
9
9
|
`)};module.exports=Stringifier}});var require_jsonlines=__commonJS({"../../node_modules/.pnpm/jsonlines@0.1.1/node_modules/jsonlines/index.js"(exports){var Parser=require_parser(),Stringifier=require_stringifier();exports.parse=function(options){return new Parser(options)};exports.stringify=function(){return new Stringifier}}});var import_async_retry=__toESM(require_dist(),1),import_jsonlines=__toESM(require_jsonlines(),1),import_ansi_escapes=__toESM(require_ansi_escapes(),1);import{URLSearchParams}from"url";async function printEvents(client,urlOrDeploymentId,{mode,onEvent,onAliasAssigned,quiet,findOpts},abortController){let{log,debug}=output_manager_default,scope=mode==="deploy"?await getScope(client):null,o=0;await(0,import_async_retry.default)(async(bail,attemptNumber)=>{if(abortController?.signal.aborted)return;attemptNumber>1&&debug("Retrying events");let query=new URLSearchParams({direction:findOpts.direction,follow:findOpts.follow?"1":"",format:"lines"});findOpts.limit&&query.set("limit",String(findOpts.limit)),findOpts.since&&query.set("since",String(findOpts.since)),findOpts.until&&query.set("until",String(findOpts.until));let eventsUrl=`/v3/now/deployments/${urlOrDeploymentId}/events?${query}`;try{let eventsRes=await client.fetch(eventsUrl,{json:!1,signal:abortController?.signal});if(eventsRes.ok){let readable=toNodeReadable(eventsRes.body);return new Promise((resolve,reject)=>{let stream=readable.pipe(import_jsonlines.default.parse()),poller;mode==="deploy"&&(poller=function startPoller(){return setTimeout(async()=>{try{if((await getDeployment(client,scope.contextName,urlOrDeploymentId)).readyState==="READY"){stream.end(),finish();return}poller=startPoller()}catch(err2){stream.end(),finish(err2)}},5e3)}());let finishCalled=!1;function finish(err2){finishCalled||(finishCalled=!0,clearTimeout(poller),err2?reject(err2):resolve())}let latestLogDate=0,onData=data=>{if(data.type==="alias-assigned"){data.deploymentId===urlOrDeploymentId&&onAliasAssigned?.(data);return}let{event,payload,date}=data;event==="state"&&payload.value==="READY"?mode==="deploy"&&(stream.end(),finish()):(latestLogDate=Math.max(latestLogDate,date),onEvent(data))},onErrorCalled=!1,onError=err2=>{if(finishCalled||onErrorCalled)return;if(err2.name==="AbortError"){finish();return}onErrorCalled=!0,o++;let errorMessage=`Deployment event stream error: ${err2.message}`;if(!findOpts.follow){log(errorMessage);return}debug(errorMessage),clearTimeout(poller),stream.destroy(err2);let retryFindOpts={...findOpts,since:latestLogDate},retryTimeout=setTimeout(()=>{abortController?.signal.removeEventListener("abort",onAbort),!abortController?.signal.aborted&&printEvents(client,urlOrDeploymentId,{mode,onEvent,onAliasAssigned,quiet,findOpts:retryFindOpts},abortController).then(resolve,reject)},2e3);onAliasAssigned&&retryTimeout.unref?.();let onAbort=()=>{clearTimeout(retryTimeout),finish()};abortController?.signal.addEventListener("abort",onAbort,{once:!0})};stream.on("end",finish),stream.on("data",onData),stream.on("error",onError),readable.on("error",onError)})}let err=new Error(`Deployment events status ${eventsRes.status}`);if(eventsRes.status<500)bail(err);else throw err}catch(err){if(err instanceof Error&&err.name==="AbortError")return;throw err}},{retries:4,unref:!!onAliasAssigned,onRetry:err=>{!quiet&&o&&(process.stdout.write((0,import_ansi_escapes.eraseLines)(o+1)),o=0),log(`Deployment events polling error: ${err.message}`)}})}var events_default=printEvents;export{events_default};
|
|
@@ -4,6 +4,6 @@ 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{RULE_ENVIRONMENTS}from"./chunk-
|
|
7
|
+
import{RULE_ENVIRONMENTS}from"./chunk-IHTWZEQW.js";import{warnDeprecatedInput}from"./chunk-SDYCW5JM.js";import{AGENT_STATUS}from"./chunk-JBU72NEQ.js";function writeConfigJson(client,{project,bare,envelope,message,next}){if(!client.nonInteractive){client.stdout.write(`${JSON.stringify(bare,null,2)}
|
|
8
8
|
`);return}client.stdout.write(`${JSON.stringify({status:AGENT_STATUS.OK,projectId:project.id,projectName:project.name,...envelope,message,next},null,2)}
|
|
9
9
|
`)}var RULE_LIMIT=10,MIN_SAMPLE_RATE=1,MAX_SAMPLE_RATE=100;function isRuleEnvironment(value){return RULE_ENVIRONMENTS.includes(value)}var ENVIRONMENT_ERROR=`\`environment\` must be one of: ${RULE_ENVIRONMENTS.join(", ")}.`,RATE_ERROR=`\`rate\` must be a whole number from ${MIN_SAMPLE_RATE} to ${MAX_SAMPLE_RATE}.`,EMPTY_PATH_ERROR="`requestPath` cannot be empty.";function parseSampleRate(value){if(!/^\d+$/.test(value.trim()))return;let rate=Number(value);return rate>=MIN_SAMPLE_RATE&&rate<=MAX_SAMPLE_RATE?rate:void 0}function toRow(rule){return{environment:rule.env??"any",requestPath:rule.requestPath??null,sampleRate:Math.round(rule.rate*100)}}function toApiRate(sampleRate){return sampleRate/100}function toRule(row){return{type:"head_sampling",rate:toApiRate(row.sampleRate),...row.environment==="any"?{}:{env:row.environment},...row.requestPath===null?{}:{requestPath:row.requestPath}}}var ALL_PATHS_LABEL="(all paths)";function formatPath(requestPath){return requestPath??ALL_PATHS_LABEL}function formatRate(sampleRate){return`${sampleRate}%`}function formatRuleTarget(environment,requestPath){return`${environment} ${formatPath(requestPath)}`}function formatRuleLine(row){return`${formatRuleTarget(row.environment,row.requestPath)} ${formatRate(row.sampleRate)}`}var COMMAND_WORD_COUNT=3;function subcommandArguments(positional){return positional.slice(COMMAND_WORD_COUNT)}function resolveRuleEnvironment(client,environmentFlag,args){if(environmentFlag===void 0){let[environment,...rest]=args;return environment!==void 0&&isRuleEnvironment(environment)?(warnDeprecatedInput(client,"The environment argument","--environment"),{environment,args:rest}):{environment:void 0,args}}return args[0]!==void 0&&isRuleEnvironment(args[0])?{error:"Can't use an environment argument with --environment. Use --environment."}:{environment:environmentFlag,args}}function hasSameKey(a,b){return a.environment===b.environment&&a.requestPath===b.requestPath}async function readTracingConfig({client,teamId,projectId,projectName}){let config=await client.fetch(`/v1/drains/tracing/config?${new URLSearchParams({projectId})}`,{accountId:teamId}),sampling=config.enabled&&config.sampling.length===0?[{type:"head_sampling",rate:1}]:config.sampling;return{project:{id:projectId,name:projectName},enabled:config.enabled,entries:sampling.map(rule=>({rule,row:toRow(rule)}))}}async function writeSamplingRules({client,teamId,projectId,rules}){await client.fetch(`/v1/drains/tracing/config?${new URLSearchParams({projectId})}`,{accountId:teamId,method:"PUT",body:{enabled:rules.length>0,...rules.length>0?{sampling:rules}:{}}})}export{writeConfigJson,RULE_LIMIT,isRuleEnvironment,ENVIRONMENT_ERROR,RATE_ERROR,EMPTY_PATH_ERROR,parseSampleRate,toApiRate,toRule,formatPath,formatRate,formatRuleTarget,formatRuleLine,subcommandArguments,resolveRuleEnvironment,hasSameKey,readTracingConfig,writeSamplingRules};
|
|
@@ -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{agentErrorMetadata,trackAgentError}from"./chunk-
|
|
7
|
+
import{agentErrorMetadata,trackAgentError}from"./chunk-AUIV7YJO.js";import{recordCliError}from"./chunk-GZLYNPNU.js";import{require_strip_ansi}from"./chunk-BULSRTQE.js";import{getExitCodeForReason}from"./chunk-JBU72NEQ.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_strip_ansi=__toESM(require_strip_ansi(),1);function recordLine(type,data){return`${JSON.stringify({type,data})}
|
|
8
8
|
`}function summaryLine(progress){return`${JSON.stringify({type:"summary",...progress})}
|
|
9
9
|
`}function writeJsonError(client,payload,exitCode=getExitCodeForReason(payload.reason)){let{status,reason,message,...rest}=payload,document={status,reason,message:(0,import_strip_ansi.default)(message),...rest,...rest.hint?{hint:(0,import_strip_ansi.default)(rest.hint)}:{},...agentErrorMetadata(client)};return recordCliError({code:payload.reason,reportOnSuccess:!0}),trackAgentError(client,document),client.stderr.write(`${JSON.stringify(document)}
|
|
10
10
|
`),exitCode}export{recordLine,summaryLine,writeJsonError};
|
|
@@ -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-VRH7LWOC.js";import{jsonOption,limitOption,projectOption,yesOption}from"./chunk-CKTLP5GX.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,{...yesOption,description:"Skip the confirmation prompt when removing"}],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 confirmation",value:`${packageName} routes remove "Old Route" --yes`}]},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},{...yesOption,description:"Skip the confirmation prompt when moving"}],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"`}]},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-VRH7LWOC.js";import{jsonOption,limitOption,projectOption,yesOption}from"./chunk-AMPJ6RWT.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,{...yesOption,description:"Skip the confirmation prompt when removing"}],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 confirmation",value:`${packageName} routes remove "Old Route" --yes`}]},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},{...yesOption,description:"Skip the confirmation prompt when moving"}],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"`}]},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{external_exports}from"./chunk-2AMO2VMV.js";import{PaginationError}from"./chunk-
|
|
7
|
+
import{external_exports}from"./chunk-2AMO2VMV.js";import{PaginationError}from"./chunk-TZE4CS4K.js";var positionSchema=external_exports.object({cursor:external_exports.string().min(1).optional(),offset:external_exports.number().int().min(0)});function encodeListCursor(position){return Buffer.from(JSON.stringify(position)).toString("base64url")}function decodeListCursor(value){try{let decoded=JSON.parse(Buffer.from(value,"base64url").toString()),parsed=positionSchema.safeParse(decoded);return parsed.success?parsed.data:void 0}catch{return}}function sliceList(items,start,limit){if(start.cursor!==void 0)return;let end=start.offset+limit;return{items:items.slice(start.offset,end),next:end<items.length?encodeListCursor({offset:end}):null}}async function collectList(fetchPage,start,limit,{maxPages=100}={}){let items=[],seen=new Set,position=start;for(let pages=0;pages<maxPages;pages++){let page=await fetchPage(position.cursor),remaining=page.items.slice(position.offset),taken=remaining.slice(0,limit-items.length);if(items.push(...taken),taken.length<remaining.length){let offset=position.offset+taken.length;return{items,next:encodeListCursor({cursor:position.cursor,offset})}}if(!page.cursor)return{items,next:null};if(seen.has(page.cursor))throw new PaginationError("Pagination returned a cursor it already returned. The list is incomplete.");if(seen.add(page.cursor),position={cursor:page.cursor,offset:0},items.length===limit)return{items,next:encodeListCursor(position)}}return{items,next:encodeListCursor(position)}}export{decodeListCursor,sliceList,collectList};
|
|
@@ -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-VRH7LWOC.js";import{formatOption,jsonOption}from"./chunk-
|
|
7
|
+
import{packageName}from"./chunk-VRH7LWOC.js";import{formatOption,jsonOption}from"./chunk-AMPJ6RWT.js";var specUrlOption={name:"spec-url",shorthand:null,type:String,argument:"URL",deprecated:!1,description:"Fetch endpoints from a custom OpenAPI spec URL instead of the public Vercel spec"},listSubcommand={name:"list",aliases:["ls"],description:"List all available API endpoints",arguments:[],options:[formatOption,jsonOption,specUrlOption,{name:"refresh",shorthand:null,type:Boolean,deprecated:!1,description:"Force refresh the cached OpenAPI spec"}],examples:[{name:"List all endpoints in table format",value:`${packageName} api list`},{name:"List all endpoints as JSON",value:`${packageName} api list --json`},{name:"List endpoints from a custom OpenAPI spec",value:`${packageName} api list --spec-url https://openapi-internal.vercel.sh --refresh`}]},apiCommand={name:"api",aliases:[],description:"Make authenticated HTTP requests to the Vercel API",arguments:[{name:"endpoint",required:!1}],subcommands:[listSubcommand],options:[{name:"method",shorthand:"X",type:String,argument:"METHOD",deprecated:!1,description:"HTTP method (GET, POST, PUT, PATCH, DELETE) (default: GET, or POST if body is provided)"},{name:"field",shorthand:"F",type:[String],argument:"KEY=VALUE",deprecated:!1,description:"Add a typed parameter (numbers, booleans parsed). Use @file for file contents"},{name:"raw-field",shorthand:"f",type:[String],argument:"KEY=VALUE",deprecated:!1,description:"Add a string option (no type parsing)"},{name:"header",shorthand:"H",type:[String],argument:"KEY:VALUE",deprecated:!1,description:"Add a custom HTTP header"},{name:"input",shorthand:null,type:String,argument:"FILE",deprecated:!1,description:"Read request body from file (use - for stdin)"},{name:"paginate",shorthand:null,type:Boolean,deprecated:!1,description:"Fetch all pages of results"},{name:"include",shorthand:"i",type:Boolean,deprecated:!1,description:"Include response headers in output"},{name:"silent",shorthand:null,type:Boolean,deprecated:!1,description:"Suppress response output"},{name:"verbose",shorthand:null,type:Boolean,deprecated:!1,description:"Show debug information including full request/response"},{name:"raw",shorthand:null,type:Boolean,deprecated:!1,description:"Output raw JSON without pretty-printing (default: on when output is piped)"},{name:"refresh",shorthand:null,type:Boolean,deprecated:!1,description:"Force refresh the cached OpenAPI spec"},specUrlOption,{name:"generate",shorthand:null,type:String,argument:"FORMAT",deprecated:!1,description:"Generate output instead of executing (e.g., --generate=curl)"},{name:"dangerously-skip-permissions",shorthand:null,type:Boolean,deprecated:!1,description:"Skip confirmation prompts for DELETE operations (use with caution)"}],examples:[{name:"Get current user information",value:`${packageName} api /v2/user`},{name:"List projects with team scope",value:`${packageName} api /v9/projects --scope my-team`},{name:"Create a new project",value:`${packageName} api /v10/projects -X POST -F name=my-project`},{name:"Delete a deployment",value:`${packageName} api /v13/deployments/dpl_abc123 -X DELETE`},{name:"Paginate through all deployments",value:`${packageName} api /v6/deployments --paginate`},{name:"Post JSON from file",value:`${packageName} api /v10/projects -X POST --input config.json`},{name:"Add custom header",value:`${packageName} api /v2/user -H "X-Custom-Header: value"`},{name:"Interactive mode (select endpoint)",value:`${packageName} api`},{name:"Interactive mode with a custom OpenAPI spec",value:`${packageName} api --spec-url https://openapi-internal.vercel.sh --refresh`}]};export{listSubcommand,apiCommand};
|
|
@@ -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{getSubcommand}from"./chunk-ETV3C2CV.js";import{monitorsCommand,monitorsNotificationsAggregateCommand}from"./chunk-
|
|
7
|
+
import{getSubcommand}from"./chunk-ETV3C2CV.js";import{monitorsCommand,monitorsNotificationsAggregateCommand}from"./chunk-N65H4JMJ.js";import{TelemetryClient}from"./chunk-MBXLL2HF.js";import{buildCommandWithGlobalFlags,outputAgentError}from"./chunk-AUIV7YJO.js";import{takeCommand}from"./chunk-US7YJ2RQ.js";import{warnDeprecatedSubcommand}from"./chunk-SDYCW5JM.js";import{output_manager_default}from"./chunk-GZLYNPNU.js";import{getFlagsSpecification}from"./chunk-AMPJ6RWT.js";import{AGENT_REASON}from"./chunk-JBU72NEQ.js";var MonitorsTelemetryClient=class extends TelemetryClient{trackCliSubcommandLs(actual){this.trackCliSubcommand({subcommand:"ls",value:actual})}trackCliSubcommandSchema(actual){this.trackCliSubcommand({subcommand:"schema",value:actual})}trackCliSubcommandAdd(actual){this.trackCliSubcommand({subcommand:"add",value:actual})}trackCliSubcommandInspect(actual){this.trackCliSubcommand({subcommand:"inspect",value:actual})}trackCliSubcommandRemove(actual){this.trackCliSubcommand({subcommand:"remove",value:actual})}trackCliSubcommandUpdate(actual){this.trackCliSubcommand({subcommand:"update",value:actual})}trackCliSubcommandNotifications(actual){this.trackCliSubcommand({subcommand:"notifications",value:actual})}trackCliOptionType(v){v&&v.length>0&&this.trackCliOption({option:"type",value:v.join(",")})}trackCliFlagAll(v){v&&this.trackCliFlag("all")}trackCliFlagJson(v){v&&this.trackCliFlag("json")}};var MONITORS_CONFIG={ls:["ls","list"],schema:["schema"],add:["add","create"],inspect:["inspect","get"],remove:["remove","rm","delete"],update:["update","patch"],notifications:["notifications"]},monitorsRoutingFlags=getFlagsSpecification([...monitorsCommand.subcommands,...monitorsNotificationsAggregateCommand.subcommands].flatMap(command=>[...command.options]));async function runMonitors(client,argv,api){let{command,args:argsWithoutCommand}=takeCommand(argv,monitorsRoutingFlags),found=command?getSubcommand([command],MONITORS_CONFIG):void 0;if(command&&found?.subcommand==null)return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:`Unknown "monitors" subcommand "${command}".`,next:[{command:buildCommandWithGlobalFlags(client.argv,"monitors --help"),when:"Show valid monitors subcommands"}]},2),output_manager_default.error(`Unknown "monitors" subcommand "${command}". Run \`vercel monitors --help\`.`),2;let resolved=found?.subcommand??"ls",original=found?.subcommandOriginal??"ls",args=found?argsWithoutCommand:argv,telemetry=new MonitorsTelemetryClient({opts:{store:client.telemetryEventStore}});switch(resolved){case"ls":return telemetry.trackCliSubcommandLs(original),(await import("./ls-MWGIT2YH.js")).default(client,args,api,telemetry);case"schema":return telemetry.trackCliSubcommandSchema(original),(await import("./schema-AKVIKCFT.js")).default(client,args,api);case"add":return telemetry.trackCliSubcommandAdd(original),original==="create"&&warnDeprecatedSubcommand(client,"monitors create","monitors add"),(await import("./add-JYLWBVVQ.js")).default(client,args,api);case"inspect":return telemetry.trackCliSubcommandInspect(original),original==="get"&&warnDeprecatedSubcommand(client,"monitors get","monitors inspect"),(await import("./rule-inspect-SQUCRRGA.js")).default(client,args,api);case"remove":return telemetry.trackCliSubcommandRemove(original),original==="delete"&&warnDeprecatedSubcommand(client,"monitors delete","monitors remove"),(await import("./rm-VREBRM5D.js")).default(client,args,api);case"update":return telemetry.trackCliSubcommandUpdate(original),original==="patch"&&warnDeprecatedSubcommand(client,"monitors patch","monitors update"),(await import("./update-R42CXSVE.js")).default(client,args,api);case"notifications":return(await import("./notifications-XAPB2F2T.js")).default(client,args,api,telemetry);default:return output_manager_default.error(`Unhandled monitors subcommand: ${String(resolved)}`),1}}export{monitorsRoutingFlags,runMonitors};
|