@vercel/cli-support 65.4.0 → 65.5.0-snapshot-8a613d8ad85d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -0
- package/dist/chunks/add-6UOKR26K.js +8 -0
- package/dist/chunks/add-GULZ6EGJ.js +8 -0
- package/dist/chunks/add-RPAOJH5O.js +8 -0
- package/dist/chunks/build-MLAKPRSC.js +7 -0
- package/dist/chunks/{chunk-ADLBLGT3.js → chunk-26QK3I2S.js} +1 -1
- package/dist/chunks/chunk-2BKALEOP.js +7 -0
- package/dist/chunks/chunk-2FHZYQPY.js +7 -0
- package/dist/chunks/{chunk-TIPQQ4TG.js → chunk-2QIJEHNE.js} +1 -1
- package/dist/chunks/{chunk-JP33AIDQ.js → chunk-36NK2Z3C.js} +1 -1
- package/dist/chunks/{chunk-D6REP5QQ.js → chunk-3E364MJE.js} +1 -1
- package/dist/chunks/{chunk-EEUJLJEJ.js → chunk-3H36RI7C.js} +1 -1
- package/dist/chunks/{chunk-JUSR7V2L.js → chunk-3NG2EYQ5.js} +1 -1
- package/dist/chunks/{chunk-AYUUSAB7.js → chunk-4G7ZQONX.js} +1 -1
- package/dist/chunks/{chunk-SYFG2RM6.js → chunk-4HJGSSSZ.js} +1 -1
- package/dist/chunks/{chunk-CWM2F235.js → chunk-55H6G46X.js} +1 -1
- package/dist/chunks/{chunk-6TXEVQA4.js → chunk-5CZNUB7Y.js} +1 -1
- package/dist/chunks/{chunk-ZN6CQWVP.js → chunk-5EMSOR2P.js} +1 -1
- package/dist/chunks/{chunk-NAX6IARA.js → chunk-5K426HWC.js} +1 -1
- package/dist/chunks/{chunk-773GOZIR.js → chunk-5SIC5273.js} +1 -1
- package/dist/chunks/chunk-5WYPJ2T5.js +25 -0
- package/dist/chunks/{chunk-MBEKRUTQ.js → chunk-6IATT2ID.js} +2 -2
- package/dist/chunks/{chunk-KPQLUGFI.js → chunk-6WMO5G45.js} +3 -3
- package/dist/chunks/{chunk-6OVX3PWM.js → chunk-75JI2SZX.js} +1 -1
- package/dist/chunks/{chunk-ECEDD646.js → chunk-7G4PQR6J.js} +1 -1
- package/dist/chunks/chunk-7SAEZ4NC.js +7 -0
- package/dist/chunks/{chunk-363SJ4TN.js → chunk-7VTPAXDC.js} +1 -1
- package/dist/chunks/chunk-A2UZ2O7H.js +7 -0
- package/dist/chunks/{chunk-3LIKVGFT.js → chunk-A3RU52F4.js} +1 -1
- package/dist/chunks/{chunk-CC6FLKIP.js → chunk-AIRQFG5A.js} +1 -1
- package/dist/chunks/{chunk-IOZ3I765.js → chunk-AOC6XXOO.js} +1 -1
- package/dist/chunks/{chunk-EISD3RG7.js → chunk-ARQMFBV4.js} +1 -1
- package/dist/chunks/{chunk-UHBMX3OK.js → chunk-AUY363W7.js} +1 -1
- package/dist/chunks/chunk-BGWS5R5R.js +9 -0
- package/dist/chunks/chunk-C6IITJ5S.js +7 -0
- package/dist/chunks/{chunk-OHEOYFBU.js → chunk-CLVEFWEX.js} +1 -1
- package/dist/chunks/{chunk-KGBIRIFF.js → chunk-CU2FTX57.js} +1 -1
- package/dist/chunks/{chunk-YHULP2KK.js → chunk-CWO4HMKU.js} +1 -1
- package/dist/chunks/{chunk-EU2GBIPC.js → chunk-CZINAGH6.js} +1 -1
- package/dist/chunks/{chunk-QIVX6SCR.js → chunk-DAUAVRFC.js} +1 -1
- package/dist/chunks/{chunk-GA277JFB.js → chunk-DPM33VFZ.js} +1 -1
- package/dist/chunks/{chunk-Q5ODLDCU.js → chunk-DSY2S2YT.js} +1 -1
- package/dist/chunks/{chunk-XP3FT56R.js → chunk-DWOJP4ST.js} +3 -3
- package/dist/chunks/chunk-ED3VA7D4.js +7 -0
- package/dist/chunks/{chunk-GG5RME4X.js → chunk-EE2FTI3R.js} +1 -1
- package/dist/chunks/{chunk-QVZAAMGQ.js → chunk-EFEQQXRU.js} +1 -1
- package/dist/chunks/{chunk-DKJL2KV7.js → chunk-EPO7P734.js} +1 -1
- package/dist/chunks/{chunk-7QAGSRCU.js → chunk-EQT2VHL2.js} +1 -1
- package/dist/chunks/chunk-ETEVOJQJ.js +8 -0
- package/dist/chunks/chunk-EWP5WICJ.js +10 -0
- package/dist/chunks/chunk-F22QLVTX.js +7 -0
- package/dist/chunks/{chunk-XC46OAAT.js → chunk-FAEC4BER.js} +1 -1
- package/dist/chunks/{chunk-LSQREJXO.js → chunk-FAELJM4F.js} +1 -1
- package/dist/chunks/{chunk-7R6TRRG5.js → chunk-FNA4MIOH.js} +1 -1
- package/dist/chunks/{chunk-L3JYCXVB.js → chunk-GFD6UAAO.js} +2 -2
- package/dist/chunks/{chunk-U2OBPULW.js → chunk-GP55VEOQ.js} +1 -1
- package/dist/chunks/{chunk-FSPPKNKN.js → chunk-GVPVWHFK.js} +1 -1
- package/dist/chunks/{chunk-527GBU3K.js → chunk-HMWDOAWO.js} +1 -1
- package/dist/chunks/{chunk-7L2K4OKM.js → chunk-HVDGNAPM.js} +1 -1
- package/dist/chunks/{chunk-QVHXFHBV.js → chunk-I2WEQWCA.js} +1 -1
- package/dist/chunks/{chunk-JRPNHWA3.js → chunk-IC3THLYP.js} +1 -1
- package/dist/chunks/{chunk-IQKGQ2Y2.js → chunk-J6L5MDTX.js} +1 -1
- package/dist/chunks/{chunk-YMZ6WBKB.js → chunk-JCGEXU7T.js} +3 -3
- package/dist/chunks/{chunk-7L5QUDUR.js → chunk-JGMJP4T3.js} +1 -1
- package/dist/chunks/{chunk-ZQBSAMFL.js → chunk-JHNLBVO2.js} +1 -1
- package/dist/chunks/{chunk-HTXDC7E2.js → chunk-JMLKK7RL.js} +2 -2
- package/dist/chunks/{chunk-T6243EDS.js → chunk-JSAY52FE.js} +1 -1
- package/dist/chunks/{chunk-C7FQMC6D.js → chunk-JWUXHL35.js} +1 -1
- package/dist/chunks/{chunk-KQCROPL3.js → chunk-JXAEI2GJ.js} +1 -1
- package/dist/chunks/{chunk-VNIKIQVE.js → chunk-KHADRPBJ.js} +1 -1
- package/dist/chunks/{chunk-GCZVIDNG.js → chunk-KWKEBKUR.js} +1 -1
- package/dist/chunks/chunk-KY7LDQRX.js +7 -0
- package/dist/chunks/{chunk-YEZJNXQX.js → chunk-L4XLDN6T.js} +1 -1
- package/dist/chunks/{chunk-EGNR2DEI.js → chunk-LOO42IMZ.js} +1 -1
- package/dist/chunks/{chunk-CBVKB3DT.js → chunk-LT5UZRMK.js} +1 -1
- package/dist/chunks/{chunk-FUX6LKNP.js → chunk-LUX4PBJL.js} +1 -1
- package/dist/chunks/chunk-M7LUSXMG.js +7 -0
- package/dist/chunks/{chunk-ANMDN3EG.js → chunk-MFW6IJIK.js} +1 -1
- package/dist/chunks/{chunk-UGNIIDHR.js → chunk-MLGQ233X.js} +1 -1
- package/dist/chunks/chunk-MY4MONOH.js +7 -0
- package/dist/chunks/{chunk-N6JBQMOF.js → chunk-MZQEDXOH.js} +1 -1
- package/dist/chunks/chunk-N5CXIFE2.js +7 -0
- package/dist/chunks/{chunk-LQVSU5HR.js → chunk-NM44RWS6.js} +1 -1
- package/dist/chunks/{chunk-FHU2O7ZJ.js → chunk-NVNE3W7S.js} +1 -1
- package/dist/chunks/chunk-NZPGWZLV.js +9 -0
- package/dist/chunks/{chunk-462YCCJZ.js → chunk-O7COT3YB.js} +1 -1
- package/dist/chunks/{chunk-KY335KWI.js → chunk-ODAV7Z2H.js} +1 -1
- package/dist/chunks/{chunk-HCRD3JFL.js → chunk-OKNDHNH6.js} +1 -1
- package/dist/chunks/{chunk-Q4KTAQB3.js → chunk-OQX4YVGU.js} +1 -1
- package/dist/chunks/chunk-ORJBK5FT.js +9 -0
- package/dist/chunks/{chunk-5KUUMQ3M.js → chunk-OTYF3ZZW.js} +1 -1
- package/dist/chunks/{chunk-FGFLTLEA.js → chunk-P6ZTEDX2.js} +1 -1
- package/dist/chunks/{chunk-O72YDZKD.js → chunk-PHHZ6J7Q.js} +1 -1
- package/dist/chunks/{chunk-RMZTB2IU.js → chunk-PRFIFS3Q.js} +1 -1
- package/dist/chunks/{chunk-R2XHJDAP.js → chunk-QDPYU6KS.js} +1 -1
- package/dist/chunks/{chunk-JLEJB6KM.js → chunk-QHM6OK76.js} +1 -1
- package/dist/chunks/{chunk-CR3NBTHV.js → chunk-QNL22LAW.js} +1 -1
- package/dist/chunks/{chunk-5V53NA6C.js → chunk-QUSEBFDO.js} +1 -1
- package/dist/chunks/{chunk-DQ2SVW4R.js → chunk-R3BEQTZZ.js} +1 -1
- package/dist/chunks/{chunk-BUJITHGZ.js → chunk-RCUDI7OF.js} +1 -1
- package/dist/chunks/{chunk-Y5ZMKL7E.js → chunk-RMW2FDXS.js} +1 -1
- package/dist/chunks/{chunk-KRPY5FHJ.js → chunk-RQVIMYKN.js} +1 -1
- package/dist/chunks/chunk-RWPQOJTT.js +22 -0
- package/dist/chunks/{chunk-2TUVL6WE.js → chunk-SDOPVIKJ.js} +1 -1
- package/dist/chunks/{chunk-3XW7N4W3.js → chunk-SKSOCUDZ.js} +1 -1
- package/dist/chunks/chunk-SLDWAIO3.js +18 -0
- package/dist/chunks/{chunk-JWCEHQQF.js → chunk-SW3JRXUW.js} +1 -1
- package/dist/chunks/{chunk-M2NXKZKX.js → chunk-TGOGYSBO.js} +1 -1
- package/dist/chunks/chunk-TZT3VYZ3.js +7 -0
- package/dist/chunks/{chunk-F6EBOT64.js → chunk-UJQ6PBRF.js} +1 -1
- package/dist/chunks/{chunk-BVGGTBYE.js → chunk-UWMPVTXG.js} +1 -1
- package/dist/chunks/{chunk-R6BEOVTU.js → chunk-VAWZZK3Y.js} +1 -1
- package/dist/chunks/{chunk-4N6LMERQ.js → chunk-VLYVVC3P.js} +11 -11
- package/dist/chunks/{chunk-HSFKISDH.js → chunk-VQ755MPP.js} +1 -1
- package/dist/chunks/{chunk-QB7F3UAP.js → chunk-VUQWLLNI.js} +1 -1
- package/dist/chunks/chunk-VWHIWUGJ.js +7 -0
- package/dist/chunks/chunk-WDUHDLUA.js +14 -0
- package/dist/chunks/{chunk-K5U47EVH.js → chunk-WICRM2JL.js} +1 -1
- package/dist/chunks/{chunk-KJA2GKPT.js → chunk-WSVYZKI6.js} +1 -1
- package/dist/chunks/{chunk-N2FLYCCO.js → chunk-XAU3KTPX.js} +1 -1
- package/dist/chunks/chunk-XCKUJZUG.js +10 -0
- package/dist/chunks/{chunk-WDXW6A4H.js → chunk-XE24Y6NM.js} +2 -2
- package/dist/chunks/{chunk-RW3X523R.js → chunk-XSQVCDSD.js} +1 -1
- package/dist/chunks/{chunk-KW6GSQXV.js → chunk-XTKGBVSF.js} +1 -1
- package/dist/chunks/{chunk-2K3ISCQ6.js → chunk-YALEYPMP.js} +1 -1
- package/dist/chunks/chunk-YCJHUYBJ.js +19 -0
- package/dist/chunks/{chunk-TEYREL44.js → chunk-YIRSRF6D.js} +1 -1
- package/dist/chunks/chunk-YQDOADMG.js +10 -0
- package/dist/chunks/{chunk-PFPJLIFF.js → chunk-YT3QAZQF.js} +1 -1
- package/dist/chunks/{chunk-R2BUF6Z7.js → chunk-ZQUVDDPB.js} +1 -1
- package/dist/chunks/{chunk-XVDRGWXM.js → chunk-ZUNQHI5Y.js} +1 -1
- package/dist/chunks/{chunk-KQCFC2JL.js → chunk-ZUYPTLVO.js} +1 -1
- package/dist/chunks/clear-UZWOOGOH.js +8 -0
- package/dist/chunks/compile-vercel-config-2RQDL3RD.js +7 -0
- package/dist/chunks/config-C76IGJ6B.js +8 -0
- package/dist/chunks/config-RMJWRS7O.js +7 -0
- package/dist/chunks/{connect-git-provider-FS5Q2HO4.js → connect-git-provider-IQ7N2NPY.js} +1 -1
- package/dist/chunks/delete-2WBR5JQW.js +9 -0
- package/dist/chunks/delete-OKOBDL7Z.js +10 -0
- package/dist/chunks/{detect-projects-OD4JEAW2.js → detect-projects-XPB3R7VS.js} +1 -1
- package/dist/chunks/detect-services-DRHV22O5.js +7 -0
- package/dist/chunks/disable-DFEABU2Z.js +7 -0
- package/dist/chunks/discard-KGBEMNFT.js +14 -0
- package/dist/chunks/edit-5XIRLUKG.js +9 -0
- package/dist/chunks/edit-PJIDMKUS.js +8 -0
- package/dist/chunks/enable-UDWDPFOI.js +7 -0
- package/dist/chunks/{exec-OZSY46V6.js → exec-PX4GTZNE.js} +1 -1
- package/dist/chunks/{export-EPLYZF2Q.js → export-W75EA6EQ.js} +1 -1
- package/dist/chunks/future-PHSAEQIE.js +7 -0
- package/dist/chunks/generate-cert-for-deploy-C67VL5Z6.js +7 -0
- package/dist/chunks/image-U5CV2PRP.js +7 -0
- package/dist/chunks/import-builders-PHIIX7HW.js +7 -0
- package/dist/chunks/inspect-AU3MX7E2.js +13 -0
- package/dist/chunks/{inspect-CZ7WXYE5.js → inspect-DQQI3PM7.js} +1 -1
- package/dist/chunks/inspect-LJK7I6RZ.js +9 -0
- package/dist/chunks/{inspect-T2AIREYK.js → inspect-RNWLPR7I.js} +1 -1
- package/dist/chunks/{inspect-HFDGZNWC.js → inspect-WHPWW4BI.js} +1 -1
- package/dist/chunks/list-JV26NNYL.js +16 -0
- package/dist/chunks/{list-ON4YTQRN.js → list-QNRFVMMQ.js} +1 -1
- package/dist/chunks/list-YF4FXWUZ.js +12 -0
- package/dist/chunks/login-A4KNOUNA.js +9 -0
- package/dist/chunks/login-COGE7JQU.js +7 -0
- package/dist/chunks/logs-KMQATUYR.js +7 -0
- package/dist/chunks/{ls-FK5XEJEU.js → ls-DTFLHFOW.js} +1 -1
- package/dist/chunks/{ls-A7K4XDQB.js → ls-FOKMPVIB.js} +1 -1
- package/dist/chunks/ls-HMYU2ZGA.js +11 -0
- package/dist/chunks/{ls-2HUJHVLA.js → ls-IHF33MQP.js} +1 -1
- package/dist/chunks/{ls-QGUKJJY5.js → ls-QD54I4S7.js} +1 -1
- package/dist/chunks/{ls-3DVM5HLK.js → ls-RNRMYD3V.js} +1 -1
- package/dist/chunks/ls-ZQLCDIQJ.js +8 -0
- package/dist/chunks/mutate-RMIFQOF6.js +9 -0
- package/dist/chunks/notifications-BFBNV2HY.js +7 -0
- package/dist/chunks/open-L6HEXHAI.js +7 -0
- package/dist/chunks/openapi-6JKCOR7K.js +7 -0
- package/dist/chunks/permissions-UYGTYRKA.js +7 -0
- package/dist/chunks/{plugin-offer-TEGYA3TA.js → plugin-offer-NBHRXMNR.js} +1 -1
- package/dist/chunks/prompt-missing-credentials-2IYIF2JI.js +7 -0
- package/dist/chunks/publish-T2VSTPG4.js +15 -0
- package/dist/chunks/pull-4GL47Z2S.js +7 -0
- package/dist/chunks/purchase-domain-if-available-BHFBD3LW.js +7 -0
- package/dist/chunks/push-CQPIDVTL.js +7 -0
- package/dist/chunks/{query-FXXLX6UB.js → query-HN45ORIB.js} +1 -1
- package/dist/chunks/reauthenticate-FTHGAWK3.js +7 -0
- package/dist/chunks/reorder-7BD5JZKQ.js +10 -0
- package/dist/chunks/reply-2INQJ5KM.js +9 -0
- package/dist/chunks/resolve-DHAJC3I7.js +12 -0
- package/dist/chunks/resolve-agent-team-KGYPHN5F.js +7 -0
- package/dist/chunks/restore-OQKNWEFQ.js +16 -0
- package/dist/chunks/rm-CTP4UZH7.js +8 -0
- package/dist/chunks/rm-GFHEXQQW.js +8 -0
- package/dist/chunks/rm-OG3OXA6H.js +8 -0
- package/dist/chunks/rm-PFZYHXEN.js +8 -0
- package/dist/chunks/rm-XAW3WJ3I.js +8 -0
- package/dist/chunks/{routes-PKTWMDWQ.js → routes-XKEWEA3P.js} +1 -1
- package/dist/chunks/rule-inspect-MKQE5IVJ.js +8 -0
- package/dist/chunks/{schema-ZWE5MNMG.js → schema-TFN5PSYE.js} +2 -2
- package/dist/chunks/schema-XFER2RCF.js +14 -0
- package/dist/chunks/select-org-PFTR6HQZ.js +7 -0
- package/dist/chunks/set-KWOZNGRL.js +7 -0
- package/dist/chunks/setup-and-link-BRYK42L7.js +7 -0
- package/dist/chunks/{skills-RKIGVVNM.js → skills-2MOFBKIE.js} +1 -1
- package/dist/chunks/tags-BHZUQTOQ.js +7 -0
- package/dist/chunks/{types-YM7TMHXW.js → types-IWO5QLAV.js} +1 -1
- package/dist/chunks/{update-BGDQ5TXO.js → update-LP7ZZUFZ.js} +1 -1
- package/dist/commands/build/index.js +2 -2
- package/dist/commands/deploy/index.js +8 -8
- package/dist/commands/dev/index.js +6 -6
- package/dist/commands/env/index.js +3 -3
- package/dist/commands/link/index.js +2 -2
- package/dist/commands/list/index.js +1 -1
- package/dist/commands/project/index.js +4 -4
- package/dist/commands-account.js +18 -18
- package/dist/commands-ai.js +12 -12
- package/dist/commands-blob.js +7 -7
- package/dist/commands-core.js +23 -23
- package/dist/commands-deployments.js +3 -3
- package/dist/commands-flags.js +29 -29
- package/dist/commands-integrations.js +98 -83
- package/dist/commands-observability.js +4 -4
- package/dist/commands-routing.js +23 -23
- package/dist/help.js +1 -1
- package/dist/index.js +7 -7
- package/dist/internal-build.js +2 -2
- package/dist/native-download.js +7 -0
- package/dist/package.json +27 -26
- package/dist/root-help-commands.mjs +1 -1
- package/dist/vc.js +172 -17
- package/dist/version.mjs +1 -1
- package/package.json +20 -19
- package/dist/chunks/add-7NS6HIWC.js +0 -8
- package/dist/chunks/add-NMYFDVXW.js +0 -8
- package/dist/chunks/add-PMJ5BECU.js +0 -8
- package/dist/chunks/build-BCY6HQJG.js +0 -7
- package/dist/chunks/chunk-5IWFRZQT.js +0 -10
- package/dist/chunks/chunk-6I6QJHCY.js +0 -7
- package/dist/chunks/chunk-6VH56CX2.js +0 -19
- package/dist/chunks/chunk-6YXIWZ3X.js +0 -25
- package/dist/chunks/chunk-7E3WREH5.js +0 -7
- package/dist/chunks/chunk-EAXMWCOL.js +0 -63
- package/dist/chunks/chunk-EKZTFGDX.js +0 -7
- package/dist/chunks/chunk-FLHO75XC.js +0 -8
- package/dist/chunks/chunk-GYVJIIYL.js +0 -7
- package/dist/chunks/chunk-JLE7K4SY.js +0 -9
- package/dist/chunks/chunk-KCKYPLIH.js +0 -7
- package/dist/chunks/chunk-LOBA3E72.js +0 -7
- package/dist/chunks/chunk-LW4N3CW6.js +0 -9
- package/dist/chunks/chunk-NGKO2OOU.js +0 -8
- package/dist/chunks/chunk-NW7WWUCQ.js +0 -9
- package/dist/chunks/chunk-O4WNSKQR.js +0 -15
- package/dist/chunks/chunk-OZCQTXI4.js +0 -7
- package/dist/chunks/chunk-QVXS234E.js +0 -7
- package/dist/chunks/chunk-SLGUYM42.js +0 -10
- package/dist/chunks/chunk-TAISZMA2.js +0 -7
- package/dist/chunks/chunk-WEH6XC4Y.js +0 -22
- package/dist/chunks/chunk-WVHCBDTB.js +0 -7
- package/dist/chunks/clear-FKVWDCVA.js +0 -8
- package/dist/chunks/compile-vercel-config-GWAJE44R.js +0 -7
- package/dist/chunks/config-5WVLG5SE.js +0 -8
- package/dist/chunks/config-RMOHN5YT.js +0 -7
- package/dist/chunks/delete-5WMB4WFR.js +0 -9
- package/dist/chunks/delete-EM4JZPFA.js +0 -10
- package/dist/chunks/detect-services-BSJGB4RM.js +0 -7
- package/dist/chunks/disable-QOM7UHQC.js +0 -7
- package/dist/chunks/discard-L5ZH7P5B.js +0 -14
- package/dist/chunks/edit-F3VJGCG2.js +0 -9
- package/dist/chunks/edit-TM7YCWBU.js +0 -8
- package/dist/chunks/enable-72C3QX34.js +0 -7
- package/dist/chunks/future-V77DRMQG.js +0 -7
- package/dist/chunks/generate-cert-for-deploy-Y3YHBMPU.js +0 -7
- package/dist/chunks/image-CVXEXU5R.js +0 -7
- package/dist/chunks/import-builders-PGRKJOOE.js +0 -7
- package/dist/chunks/inspect-BTRNXRJT.js +0 -9
- package/dist/chunks/inspect-FGDVWAQP.js +0 -13
- package/dist/chunks/list-CKRRHAOE.js +0 -12
- package/dist/chunks/list-FLREMGJR.js +0 -16
- package/dist/chunks/login-55LJ5ZA6.js +0 -9
- package/dist/chunks/login-DQRZSD4Z.js +0 -7
- package/dist/chunks/logs-2HQXWOHM.js +0 -7
- package/dist/chunks/ls-4B3QYHCI.js +0 -8
- package/dist/chunks/ls-VTKHPDWS.js +0 -11
- package/dist/chunks/mutate-7ADZBCZM.js +0 -9
- package/dist/chunks/notifications-XZJXE2K4.js +0 -7
- package/dist/chunks/open-EE5IZQD7.js +0 -7
- package/dist/chunks/openapi-QBX62ZXC.js +0 -7
- package/dist/chunks/permissions-VYJ4LL5R.js +0 -7
- package/dist/chunks/prompt-missing-credentials-VP6OVCFM.js +0 -7
- package/dist/chunks/publish-2HEK5UMJ.js +0 -15
- package/dist/chunks/pull-WRTTSY7J.js +0 -7
- package/dist/chunks/purchase-domain-if-available-6S3NLTUI.js +0 -7
- package/dist/chunks/push-L3QRGGLC.js +0 -7
- package/dist/chunks/reauthenticate-IXQDC4UZ.js +0 -7
- package/dist/chunks/reorder-B4OXSYCI.js +0 -10
- package/dist/chunks/reply-F637K6XH.js +0 -9
- package/dist/chunks/resolve-E3F6NYQZ.js +0 -12
- package/dist/chunks/resolve-agent-team-EIPCH766.js +0 -7
- package/dist/chunks/restore-Q25KRZPH.js +0 -16
- package/dist/chunks/rm-FWD2NUGX.js +0 -8
- package/dist/chunks/rm-JMQ4QKCC.js +0 -8
- package/dist/chunks/rm-PPG7P3GN.js +0 -8
- package/dist/chunks/rm-SH3DYKNS.js +0 -8
- package/dist/chunks/rm-UEBLKFVC.js +0 -8
- package/dist/chunks/rule-inspect-LKQA5I4V.js +0 -8
- package/dist/chunks/schema-FBV42W7N.js +0 -14
- package/dist/chunks/select-org-WMB752Z6.js +0 -7
- package/dist/chunks/set-UTYIPOLC.js +0 -7
- package/dist/chunks/setup-and-link-ZLY5XQW5.js +0 -7
- package/dist/chunks/tags-UCLZ5UMX.js +0 -7
|
@@ -1,13 +0,0 @@
|
|
|
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{formatTriggerOperator,getGroupStartedAt,getGroupTitle,getGroupType,humanizeReference,normalizeTimestamp,renderAlertTable}from"./chunk-3XW7N4W3.js";import{resolveRulesTeam}from"./chunk-RMZTB2IU.js";import{resolveAlertsScope,scopeFromLinkedProject}from"./chunk-KGBIRIFF.js";import{formatGranularity}from"./chunk-IVSSTHB6.js";import"./chunk-GHAY4PSD.js";import{outputError}from"./chunk-RW3X523R.js";import{truncateEnd,truncateMiddle}from"./chunk-ID663OJ7.js";import{formatDate}from"./chunk-HRR57QNP.js";import"./chunk-GZNDA6SV.js";import"./chunk-PFD7LETF.js";import{inspectSubcommand}from"./chunk-UHBMX3OK.js";import"./chunk-773GOZIR.js";import{printError}from"./chunk-HSFKISDH.js";import"./chunk-67GZ5REA.js";import"./chunk-BS32OUOC.js";import"./chunk-K5U47EVH.js";import"./chunk-MXTC4ZAQ.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-WDXW6A4H.js";import"./chunk-DKJL2KV7.js";import{getLinkedProject}from"./chunk-4N6LMERQ.js";import"./chunk-ADLBLGT3.js";import"./chunk-CWM2F235.js";import"./chunk-4NTBYNFR.js";import{parseArguments}from"./chunk-KCKYPLIH.js";import"./chunk-F53OKXYI.js";import{getFlagsSpecification,validateJsonOutput}from"./chunk-QVXS234E.js";import"./chunk-FUX6LKNP.js";import"./chunk-OPORM35X.js";import"./chunk-4SAVH3H7.js";import{isAPIError}from"./chunk-6VH56CX2.js";import{packageName}from"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-XP3FT56R.js";import"./chunk-BLUPZPAS.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);var aggregationLabels={sum:"Sum",avg:"Average",min:"Min",max:"Max",p50:"P50",p75:"P75",p90:"P90",p95:"P95",p99:"P99",stddev:"Std Dev",unique:"Unique",persecond:"Per Second",percent:"Percent"},formatCustomAlertRatioBelowFivePercent=new Intl.NumberFormat("en-US",{maximumFractionDigits:2,minimumFractionDigits:2,style:"percent"}),formatCustomAlertRatioThresholdValue=new Intl.NumberFormat("en-US",{maximumFractionDigits:4,minimumFractionDigits:0,style:"percent"});function getGroupStatus(group){if(group.status)return group.status;let alerts=group.alerts??[];return alerts.some(alert=>alert.status==="active")?"active":alerts.length>0?"resolved":"-"}function humanizeLabel(value){return humanizeReference(value,{case:"title"})}function formatAlertFieldValue(value,maxLength=64){if(value==null)return;let displayValue=typeof value=="number"?formatNumber(value):String(value);if(displayValue)return truncateMiddle(displayValue,maxLength)}function formatNumber(value){let absValue=Math.abs(value),sign=value<0?"-":"";for(let[threshold,suffix]of[[1e9,"B"],[1e6,"M"],[1e3,"k"]])if(absValue>=threshold)return`${sign}${(absValue/threshold).toFixed(1).replace(/\.0$/,"")}${suffix}`;return Number.isInteger(value)?String(value):value.toFixed(2).replace(/\.?0+$/,"")}function parseFormattedNumber(value){let trimmed=value.trim();if(!trimmed)return;let number=Number(trimmed.replace(/,/g,""));return Number.isFinite(number)?number:void 0}function formatRatio(value){if(value.trim().endsWith("%"))return value;let number=parseFormattedNumber(value);if(number===void 0)return value;let percent=number*100;return percent>=5?`${Math.floor(percent)}%`:formatCustomAlertRatioBelowFivePercent.format(number)}function formatRatioThreshold(value){if(value.trim().endsWith("%"))return value;let number=parseFormattedNumber(value);return number===void 0?value:formatCustomAlertRatioThresholdValue.format(number)}function getAlertSonarQuery(alert){return alert.sonarQuery??alert.data?.sonarQuery}function getCustomAlertBaselineTitle(alert){let granularity=getAlertSonarQuery(alert)?.granularity;return(granularity&&("hours"in granularity||"days"in granularity)?"7-day baseline":"24-hour baseline").replace(/\b[a-z]/g,character=>character.toUpperCase())}function appendUnit(value,unit){return!unit||unit==="score"?value:unit==="ratio"?formatRatio(value):unit==="%"?value.endsWith("%")?value:`${value}%`:value.toLowerCase().includes(unit.toLowerCase())?value:`${value} ${unit}`}function formatThreshold(alert){let data=alert.data,formatted=alert.formattedValues?.formattedThreshold??(data?.triggerThreshold===void 0?void 0:formatNumber(data.triggerThreshold));if(!formatted)return;let operator=formatTriggerOperator(data?.triggerOperator),threshold=data?.triggerType==="anomaly"?`${formatted} z-score`:alert.unit==="ratio"?formatRatioThreshold(formatted):appendUnit(formatted,alert.unit);return[operator,threshold].filter(Boolean).join(" ")}function getRuleIds(alert){let ids=new Set,dataRuleId=alert.data?.ruleId;dataRuleId&&ids.add(dataRuleId);for(let ruleId of alert.rules??[])ruleId&&ids.add(ruleId);return[...ids]}function getAlertResolvedAt(alert){return normalizeTimestamp(alert.recordedResolvedAt??alert.resolvedAt)}function getSignalRows(alert){let rows=[],formattedValues=alert.formattedValues??{},observed=formattedValues.formattedCount,baseline=formattedValues.formattedAvg,change=[formattedValues.changeDirection,formattedValues.changeAmount].filter(Boolean).join(" "),zscore=alert.data?.zscore,threshold=formatThreshold(alert),minThreshold=alert.data?.minThreshold,isRatioFormulaAlert=!!getCustomAlertFormula(alert);return alert.eventLabel&&rows.push(["Event",alert.eventLabel]),alert.measureLabel&&rows.push(["Measure",alert.measureLabel]),observed&&rows.push(["Observed Value",appendUnit(observed,alert.unit)]),baseline&&rows.push([alert.type==="custom_alert"&&alert.data?.triggerType==="anomaly"?getCustomAlertBaselineTitle(alert):"Baseline",appendUnit(baseline,alert.unit)]),change&&rows.push(["Change",change]),zscore!==void 0&&rows.push(["Observed Deviation",`${formatNumber(zscore)} z-score`]),threshold&&rows.push(["Threshold",threshold]),minThreshold!==void 0&&!isRatioFormulaAlert&&rows.push(["Minimum",alert.unit==="ratio"?formatNumber(minThreshold):appendUnit(formatNumber(minThreshold),alert.unit)]),formattedValues.errorRate&&rows.push(["Error Rate",formattedValues.errorRate]),formattedValues.avgErrorRate&&rows.push(["Baseline Error Rate",formattedValues.avgErrorRate]),rows.push(...getFieldRows(alert)),rows}function getFieldRows(alert){let fields=alert.data?.fields;if(!fields)return[];let groupBy=getAlertSonarQuery(alert)?.groupBy??[];return[...groupBy,...Object.keys(fields).filter(key=>!groupBy.includes(key))].flatMap(key=>{let value=fields[key],displayValue=formatAlertFieldValue(value);return displayValue?[[humanizeLabel(key),displayValue]]:[]})}function formatAggregation(value){return value?aggregationLabels[value]??humanizeLabel(value):void 0}function formatQueryReference(value){return value?humanizeLabel(value):void 0}function formatRollupDetail(rollup,fallbackMeasure){if(!rollup)return;let aggregation=formatAggregation(rollup.aggregation),measure=fallbackMeasure??formatQueryReference(rollup.measure);return[aggregation,measure].filter(Boolean).join(" ")||void 0}function getPrimaryRollup(rollups){return Object.values(rollups??{})[0]}function getCustomAlertFormula(alert){let formula=alert.data?.formula;if(formula?.operator==="divide"&&formula.left&&formula.right)return{operator:formula.operator,left:formula.left,right:formula.right}}function getQueryRows(alert){if(alert.type!=="custom_alert")return[];let query=getAlertSonarQuery(alert);if(!query)return[];let formula=getCustomAlertFormula(alert),rows=[],addRow=(label,value)=>{value&&rows.push([label,truncateMiddle(value,120)])};if(addRow("Event",alert.eventLabel??formatQueryReference(query.event)),formula)addRow("Numerator",formatRollupDetail(query.rollups?.[formula.left])),addRow("Denominator",formatRollupDetail(query.rollups?.[formula.right]));else{let primaryRollup=getPrimaryRollup(query.rollups);addRow("Measure",alert.measureLabel??formatQueryReference(primaryRollup?.measure)),addRow("Aggregation",formatAggregation(primaryRollup?.aggregation))}addRow("Granularity",formatGranularity(query.granularity));let groupBy=query.groupBy?.filter(Boolean)??[];if(groupBy.length>0&&addRow("Group by",groupBy.map(humanizeLabel).join(", ")),formula&&typeof alert.data?.minThreshold=="number"&&addRow("Minimum Numerator",formatNumber(alert.data.minThreshold)),addRow("Filter by",query.filter?.trim()),formula)for(let[label,rollupName]of[["Numerator filter",formula.left],["Denominator filter",formula.right]])addRow(label,query.rollups?.[rollupName]?.filter?.trim());return rows}function getDetailRows(alert){let data=alert.data;if(!data)return[];let rows=[],addRow=(label,value)=>{let displayValue=formatAlertFieldValue(value);displayValue&&rows.push([label,displayValue])};return addRow("Route",data.route),addRow("Status Group",data.statusGroup),addRow("Deployment ID",data.deploymentId),rows}function renderAlertSections(alert){let lines=[],signalRows=getSignalRows(alert);signalRows.length>0&&(lines.push(import_chalk.default.cyan("Signals")),lines.push(renderAlertTable(signalRows,3)));let queryRows=getQueryRows(alert);return queryRows.length>0&&(lines.push(import_chalk.default.cyan("Query")),lines.push(renderAlertTable(queryRows,3))),lines.join(`
|
|
8
|
-
`)}function renderAlert(alert,index,totalAlerts){let title=alert.title||`Alert ${index+1}`,ruleIds=getRuleIds(alert),resolvedAt=getAlertResolvedAt(alert),sections=renderAlertSections(alert),summaryRows=[["Alert id",alert.id||"-"],["Type",alert.type||"-"],["Status",alert.status||"-"],["Started At",formatDate(normalizeTimestamp(alert.recordedStartedAt??alert.startedAt))],...resolvedAt!==void 0?[["Resolved At",formatDate(resolvedAt)]]:[],...ruleIds.length>0?[["Rule id",ruleIds.map(id=>truncateMiddle(id,48)).join(", ")]]:[],...getDetailRows(alert)];return[import_chalk.default.bold(totalAlerts>1?`Alert ${index+1}: ${title}`:title),renderAlertTable(summaryRows,3),...sections?[sections]:[]].join(`
|
|
9
|
-
`)}function printAlertGroup(group,groupId){let alerts=group.alerts??[],singleAlert=alerts.length===1?alerts[0]:void 0,singleAlertRuleIds=singleAlert?getRuleIds(singleAlert):[],singleAlertResolvedAt=singleAlert?getAlertResolvedAt(singleAlert):void 0,summaryRows=[["Title",truncateEnd(getGroupTitle(group),80)],["Group id",group.id||groupId],["Type",getGroupType(group)],["Status",getGroupStatus(group)],["Started At",formatDate(getGroupStartedAt(group))],...singleAlertResolvedAt!==void 0?[["Resolved At",formatDate(singleAlertResolvedAt)]]:[],["Alerts",String(alerts.length)],...singleAlert?.id?[["Alert id",singleAlert.id]]:[],...singleAlertRuleIds.length>0?[["Rule id",singleAlertRuleIds.map(id=>truncateMiddle(id,48)).join(", ")]]:[],...singleAlert?getDetailRows(singleAlert):[]],renderedAlerts=alerts.length>0?alerts.length===1?renderAlertSections(alerts[0]):alerts.map((alert,index)=>renderAlert(alert,index,alerts.length)).join(`
|
|
10
|
-
|
|
11
|
-
`):"No alerts in this group.";output_manager_default.print(["",`${import_chalk.default.bold("Alert group")} ${import_chalk.default.cyan(group.id||groupId)}`,renderAlertTable(summaryRows,3),"",renderedAlerts,""].join(`
|
|
12
|
-
`))}async function inspect(client,argv){let parsedArgs,spec=getFlagsSpecification(inspectSubcommand.options);try{parsedArgs=parseArguments(argv,spec)}catch(e){let msg=e instanceof Error?e.message:String(e),projectFlagMissingArg=msg.includes("--project")&&msg.includes("requires argument");return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:projectFlagMissingArg?"`--project` requires a project name or id (for example `--project my-app`).":msg,next:projectFlagMissingArg?[{command:buildCommandWithGlobalFlags(client.argv,"alerts inspect <groupId> --project <name-or-id>"),when:"Re-run with placeholders replaced"}]:[{command:buildCommandWithGlobalFlags(client.argv,"alerts inspect --help"),when:"See valid `alerts inspect` usage"}]},2),printError(e),2}let groupId=parsedArgs.args[0],fr=validateJsonOutput(parsedArgs.flags);if(!fr.valid)return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:fr.error},2),output_manager_default.error(fr.error),2;if(!groupId)return outputAgentError(client,{status:"error",reason:AGENT_REASON.MISSING_ARGUMENTS,message:`Missing group id. Example: ${packageName} alerts inspect <groupId>`,next:[{command:buildCommandWithGlobalFlags(client.argv,"alerts inspect <groupId>"),when:"Replace <groupId> with a group id from `vercel alerts`"}]},2),outputError(client,fr.jsonOutput,"MISSING_ARGUMENTS","Usage: `vercel alerts inspect <groupId>`");let scope=await resolveInspectScope(client,{project:parsedArgs.flags["--project"],all:parsedArgs.flags["--all"],jsonOutput:fr.jsonOutput,command:`alerts inspect ${groupId}`});if(typeof scope=="number")return scope;let query=new URLSearchParams({teamId:scope.teamId});scope.projectId&&query.set("projectId",scope.projectId);let path=`/alerts/v3/groups/${encodeURIComponent(groupId)}?${query.toString()}`;output_manager_default.spinner("Fetching alert group...");try{let group=await client.fetch(path);return fr.jsonOutput?client.stdout.write(`${JSON.stringify({group},null,2)}
|
|
13
|
-
`):printAlertGroup(group,groupId),0}catch(err){if(isAPIError(err)){let msg=err.serverMessage||`API error (${err.status}).`,reason=err.status===401?"not_authorized":err.status===403?"forbidden":err.status===404?AGENT_REASON.NOT_FOUND:err.status===429?"rate_limited":AGENT_REASON.API_ERROR;return outputAgentError(client,{status:"error",reason,message:msg,...err.status===401||err.status===403||err.status===404?{hint:scope.projectId?"The request was scoped to a project. Use --all, and --scope <team-slug> if the group belongs to another team.":"Confirm team scope; use --scope <team-slug> if the group belongs to another team.",next:[{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"See current user and team"},{command:buildCommandWithGlobalFlags(client.argv,scope.projectId?`alerts inspect ${groupId} --all`:`alerts inspect ${groupId}`),when:"Retry after fixing scope or permissions"}]}:{}},1),outputError(client,fr.jsonOutput,err.code||"API_ERROR",msg)}throw err}finally{output_manager_default.stopSpinner()}}async function resolveInspectScope(client,opts){if(opts.project||opts.all)return resolveAlertsScope(client,opts);let linkedProject=await getLinkedProject(client);return linkedProject.status==="error"?linkedProject.exitCode:linkedProject.status==="linked"?scopeFromLinkedProject(linkedProject):resolveRulesTeam(client,opts.jsonOutput)}export{inspect as default};
|
|
@@ -1,12 +0,0 @@
|
|
|
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{renderThreadRow}from"./chunk-GA277JFB.js";import{handleCommentsParseError,inferBranch,listThreads,resolveCommentsScope}from"./chunk-JUSR7V2L.js";import{applyDeprecatedGitBranchFlag}from"./chunk-EU2GBIPC.js";import"./chunk-F4KY2TOK.js";import{handleValidationError,outputError,validateIntegerRangeWithDefault}from"./chunk-RW3X523R.js";import"./chunk-ID663OJ7.js";import"./chunk-JP33AIDQ.js";import"./chunk-2TUVL6WE.js";import{printNextPageCommand}from"./chunk-VNIKIQVE.js";import{getRenamedOption,withWarnings}from"./chunk-T6243EDS.js";import{listSubcommand}from"./chunk-5KUUMQ3M.js";import"./chunk-HSFKISDH.js";import"./chunk-BS32OUOC.js";import{getScope}from"./chunk-K5U47EVH.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-WDXW6A4H.js";import"./chunk-DKJL2KV7.js";import"./chunk-4N6LMERQ.js";import"./chunk-ADLBLGT3.js";import"./chunk-CWM2F235.js";import"./chunk-4NTBYNFR.js";import{parseArguments}from"./chunk-KCKYPLIH.js";import"./chunk-F53OKXYI.js";import{getFlagsSpecification,stripSensitiveAuthArgs,validateJsonOutput}from"./chunk-QVXS234E.js";import"./chunk-FUX6LKNP.js";import"./chunk-OPORM35X.js";import"./chunk-4SAVH3H7.js";import{isAPIError}from"./chunk-6VH56CX2.js";import{getCommandName,getCommandNamePlain}from"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-XP3FT56R.js";import"./chunk-BLUPZPAS.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);function validateStatus(value){let status=value??"unresolved";if(["unresolved","resolved","all"].includes(status))return status}async function resolveAuthors(client,authors,jsonOutput){if(!authors||authors.length===0)return;if(!authors.includes("me"))return authors;let{user}=await getScope(client);return user?authors.map(author=>author==="me"?user.id:author):outputError(client,jsonOutput,"USER_REQUIRED","Can't resolve `--author me` when authenticated as an app. Use an author ID with `--author`, or authenticate with a user token.")}function statusWord(status){return status==="all"?"":` ${status}`}function printActiveFilters(flags){let parts=[];flags["--author"]?.length&&parts.push(`--author ${flags["--author"].join(", ")} (takes a user ID or \`me\` \u2014 usernames match nothing)`);let pagePaths=flags["--page-path"]??flags["--page"];pagePaths?.length&&parts.push(`--page-path ${pagePaths.join(", ")}`),flags["--query"]&&parts.push(`--query ${flags["--query"]}`),flags["--content"]?.length&&parts.push(`--content ${flags["--content"].join(", ")}`),parts.length>0&&output_manager_default.log(`Filters: ${parts.join(" \xB7 ")}`)}function countLine(count,status){return`${count}${statusWord(status)} comment${count===1?"":"s"}`}var SCOPE_FLAG_NAMES=new Set(["--scope","-S","--project","-p","--team","-T"]);function argvFlagTokens(client){return stripSensitiveAuthArgs(client.argv.slice(3))}function scopeFlagsSuffix(client){let tokens=argvFlagTokens(client),out=[];for(let i=0;i<tokens.length;i++){let token=tokens[i],name=token.split("=")[0];SCOPE_FLAG_NAMES.has(name)&&(out.push(token),!token.includes("=")&&i+1<tokens.length&&out.push(tokens[++i]))}return out.length>0?` ${out.join(" ")}`:""}var RENAMED_LIST_FLAGS={"--page":"--page-path","--branch":"--git-branch","--content-id":"--content","--search":"--query"};function nextPageFlagsSuffix(client){let tokens=argvFlagTokens(client),out=[];for(let i=0;i<tokens.length;i++){let token=tokens[i];if(!token.startsWith("-"))continue;let name=token.split("=")[0];if(name==="--next"||name==="-N"){!token.includes("=")&&i+1<tokens.length&&i++;continue}let renamed=RENAMED_LIST_FLAGS[name];out.push(renamed?`${renamed}${token.slice(name.length)}`:token),!token.includes("=")&&i+1<tokens.length&&!tokens[i+1].startsWith("-")&&out.push(tokens[++i])}return out.length>0?` ${out.join(" ")}`:""}function shellSafe(value){return/^[A-Za-z0-9._/-]+$/.test(value)?value:`'${value.replace(/'/g,"'\\''")}'`}async function printEmptyState(client,scope,focus,params,status,flags){let probe;try{probe=await listThreads(client,scope.teamId,{...params,branch:void 0,cursor:void 0,limit:20})}catch{output_manager_default.log(`No${statusWord(status)} comments on ${focus.value}.`);return}let branches=new Map;for(let thread of probe.threads){let branch=thread.branch??"(no branch)";branches.set(branch,(branches.get(branch)??0)+1)}if(branches.size===0){output_manager_default.log(`No${statusWord(status)} comments in ${scope.projectName??"this project"} on any branch.`),printActiveFilters(flags);return}output_manager_default.log(`No${statusWord(status)} comments on ${focus.value}.`);let suffix=probe.pagination.nextCursor?"+":"",scopeSuffix=scopeFlagsSuffix(client);if(branches.size===1){let[branch,count]=[...branches.entries()][0];output_manager_default.log(`${count}${suffix}${statusWord(status)} on ${import_chalk.default.bold(branch)} \u2014 run ${getCommandName(`comments --git-branch ${shellSafe(branch)}${scopeSuffix}`)}`);return}let total=[...branches.values()].reduce((a,b)=>a+b,0);output_manager_default.log(`${total}${suffix}${statusWord(status)} on other branches \u2014 run ${getCommandName(`comments --all-branches${scopeSuffix}`)}`)}async function list(client,telemetry,defaultInvocation){let parsedArgs,flagsSpecification=getFlagsSpecification(listSubcommand.options);try{parsedArgs=parseArguments(client.argv.slice(2),flagsSpecification)}catch(err){return handleCommentsParseError(err,"list")}let flags=parsedArgs.flags,pagePaths=flags["--page-path"]??flags["--page"],expectedPositionals=defaultInvocation?1:2;if(parsedArgs.args.length>expectedPositionals)return output_manager_default.error(`Unknown ${defaultInvocation?"subcommand":"argument"} "${parsedArgs.args[expectedPositionals]}". Run \`vercel comments --help\` for usage.`),1;let formatResult=validateJsonOutput(flags);if(!formatResult.valid)return output_manager_default.error(formatResult.error),2;let jsonOutput=formatResult.jsonOutput;telemetry.trackCliOptionProject(flags["--project"]),telemetry.trackCliOptionGitBranch(flags["--git-branch"]),telemetry.trackCliOptionBranch(flags["--branch"]),telemetry.trackCliFlagAllBranches(flags["--all-branches"]),telemetry.trackCliOptionStatus(flags["--status"]),telemetry.trackCliOptionPagePath(flags["--page-path"]),telemetry.trackCliOptionPage(flags["--page"]),telemetry.trackCliOptionAuthor(flags["--author"]),telemetry.trackCliOptionContent(flags["--content"]),telemetry.trackCliOptionContentId(flags["--content-id"]),telemetry.trackCliOptionQuery(flags["--query"]),telemetry.trackCliOptionSearch(flags["--search"]),telemetry.trackCliOptionLimit(flags["--limit"]),telemetry.trackCliOptionNext(flags["--next"]),telemetry.trackCliOptionFormat(flags["--format"]);let branchError=applyDeprecatedGitBranchFlag(client,flags,"--branch");if(branchError)return outputError(client,jsonOutput,"MUTUAL_EXCLUSIVITY",branchError);let content=getRenamedOption(parsedArgs.flags,"--content","--content-id",{json:jsonOutput});if("error"in content)return outputError(client,jsonOutput,"INVALID_ARGUMENTS",content.error);let query=getRenamedOption(parsedArgs.flags,"--query","--search",{json:jsonOutput});if("error"in query)return outputError(client,jsonOutput,"INVALID_ARGUMENTS",query.error);flags["--content"]=content.value,delete flags["--content-id"],flags["--query"]=query.value,delete flags["--search"];let status=validateStatus(flags["--status"]);if(!status)return outputError(client,jsonOutput,"INVALID_STATUS",`Invalid --status "${flags["--status"]}". Valid values: unresolved, resolved, all.`);let limitResult=validateIntegerRangeWithDefault(flags["--limit"],{flag:"--limit",min:1,max:100,defaultValue:20});if(!limitResult.valid)return handleValidationError(limitResult,jsonOutput,client);if(flags["--git-branch"]&&flags["--all-branches"])return outputError(client,jsonOutput,"MUTUAL_EXCLUSIVITY","Cannot specify both --git-branch and --all-branches.");let scope=await resolveCommentsScope(client,{project:flags["--project"],requireProject:!0,jsonOutput});if(typeof scope=="number")return scope;let focus,branchFilter;if(flags["--git-branch"]&&flags["--git-branch"].length>0)branchFilter=flags["--git-branch"],focus={value:branchFilter.join(", "),source:"flag"};else if(!flags["--all-branches"]&&scope.linked){let inferred=inferBranch(client.cwd);inferred&&(focus=inferred,branchFilter=[inferred.value])}let authors=await resolveAuthors(client,flags["--author"],jsonOutput);if(typeof authors=="number")return authors;let params={projectId:scope.projectId,branch:branchFilter,status:status==="all"?void 0:status,page:pagePaths,author:authors,contentId:flags["--content"],search:flags["--query"],limit:limitResult.value,cursor:flags["--next"]};jsonOutput||output_manager_default.spinner("Fetching comments\u2026");let response;try{response=await listThreads(client,scope.teamId,params)}catch(err){if(isAPIError(err))return outputError(client,jsonOutput,err.code||"API_ERROR",err.serverMessage||`API error (${err.status}).`);throw err}finally{output_manager_default.stopSpinner()}let threads=response.threads??[],nextCursor=response.pagination?.nextCursor??null;if(jsonOutput){let envelope={scope:{teamId:scope.teamId,...scope.teamSlug&&{teamSlug:scope.teamSlug},...scope.projectId&&{projectId:scope.projectId},...scope.projectName&&{projectName:scope.projectName},...focus&&focus.source!=="flag"&&{inferredBranch:focus.value}},filters:{...status!=="all"&&{status},...focus&&{branch:{value:focus.value,source:focus.source}}},pagination:{nextCursor,next:nextCursor},threads};return client.stdout.write(`${JSON.stringify(withWarnings(envelope,[content.warning,query.warning]),null,2)}
|
|
8
|
-
`),0}let branchLabel=focus?focus.value:"all branches";if(output_manager_default.log(`Comments in ${import_chalk.default.bold(scope.projectName??scope.projectId??"")} \xB7 ${branchLabel}`),threads.length===0)return focus?await printEmptyState(client,scope,focus,params,status,flags):(output_manager_default.log(`No${statusWord(status)} comments in ${scope.projectName??"this project"}.`),printActiveFilters(flags)),0;output_manager_default.print(`
|
|
9
|
-
`);for(let thread of threads)output_manager_default.print(`${renderThreadRow(thread,{showBranch:!focus})}
|
|
10
|
-
|
|
11
|
-
`);return output_manager_default.log(countLine(threads.length,status)),output_manager_default.log(`To read a thread, run ${getCommandName(`comments inspect <id>${scopeFlagsSuffix(client)}`)}`),nextCursor&&(output_manager_default.print(`
|
|
12
|
-
`),printNextPageCommand(getCommandNamePlain(`comments${nextPageFlagsSuffix(client)} --next ${nextCursor}`))),0}export{list as default};
|
|
@@ -1,16 +0,0 @@
|
|
|
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{getGroupStartedAt,getGroupTitle,getGroupType,normalizeTimestamp,renderAlertTable}from"./chunk-3XW7N4W3.js";import{resolveAlertsScope}from"./chunk-KGBIRIFF.js";import"./chunk-GHAY4PSD.js";import{handleValidationError,normalizeRepeatableStringFilters,outputError,validateAllProjectMutualExclusivity,validateOptionalIntegerRange,validateTimeBound,validateTimeOrder}from"./chunk-RW3X523R.js";import{truncateEnd}from"./chunk-ID663OJ7.js";import{formatDate}from"./chunk-HRR57QNP.js";import"./chunk-GZNDA6SV.js";import"./chunk-PFD7LETF.js";import{alertsCommand}from"./chunk-UHBMX3OK.js";import"./chunk-773GOZIR.js";import{printError}from"./chunk-HSFKISDH.js";import"./chunk-67GZ5REA.js";import"./chunk-BS32OUOC.js";import"./chunk-K5U47EVH.js";import{require_ms}from"./chunk-MXTC4ZAQ.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError,shouldEmitNonInteractiveCommandError}from"./chunk-WDXW6A4H.js";import"./chunk-DKJL2KV7.js";import"./chunk-4N6LMERQ.js";import"./chunk-ADLBLGT3.js";import"./chunk-CWM2F235.js";import"./chunk-4NTBYNFR.js";import{parseArguments}from"./chunk-KCKYPLIH.js";import"./chunk-F53OKXYI.js";import{getFlagsSpecification,validateJsonOutput}from"./chunk-QVXS234E.js";import"./chunk-FUX6LKNP.js";import"./chunk-OPORM35X.js";import"./chunk-4SAVH3H7.js";import{isAPIError}from"./chunk-6VH56CX2.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-XP3FT56R.js";import"./chunk-BLUPZPAS.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_ms=__toESM(require_ms(),1),import_chalk=__toESM(require_source(),1);function handleApiError(err,jsonOutput,client){let message=err.status===401||err.status===403?"You do not have access to alerts in this scope. Pass --token <TOKEN> and --scope <team-slug> with Alerts read access.":err.status>=500?`The alerts endpoint failed on the server (${err.status}). Re-run with --debug and share the x-vercel-id from the failed request.`:err.serverMessage||`API error (${err.status}).`,reason=err.status===401?"not_authorized":err.status===403?"forbidden":err.status===404?AGENT_REASON.NOT_FOUND:err.status===429?"rate_limited":AGENT_REASON.API_ERROR;return outputAgentError(client,{status:"error",reason,message,...err.status===401||err.status===403?{hint:"Confirm team scope; use --scope <team-slug> if alerts belong to another team.",next:[{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"See current user and team"},{command:buildCommandWithGlobalFlags(client.argv,"alerts"),when:"Retry listing alerts after fixing scope or permissions"}]}:{}},1),outputError(client,jsonOutput,err.code||"API_ERROR",message)}function getDefaultRange(){let to=new Date;return{from:new Date(to.getTime()-24*60*60*1e3).toISOString(),to:to.toISOString()}}function getStartedAt(group){return formatDate(getGroupStartedAt(group))}function getGroupResolvedAt(group){let resolvedTimes=(group.alerts??[]).map(alert=>normalizeTimestamp(alert.recordedResolvedAt??alert.resolvedAt)).filter(time=>time!==void 0);if(resolvedTimes.length>0)return Math.max(...resolvedTimes)}function getStatus(group){let normalizedStatus=(group.status||"").toLowerCase();if(normalizedStatus==="active")return"active";if(normalizedStatus==="resolved"){let startedAt=getGroupStartedAt(group),resolvedAt=getGroupResolvedAt(group);return startedAt&&resolvedAt&&resolvedAt>=startedAt?`resolved after ${(0,import_ms.default)(resolvedAt-startedAt)}`:"resolved"}return group.status||"-"}function getResolvedAt(group){return(group.status||"").toLowerCase()==="active"?"active":formatDate(getGroupResolvedAt(group))}function getAlertsCount(group){return String(group.alerts?.length??0)}function validationFailureForAgents(client,result,jsonOutput){return shouldEmitNonInteractiveCommandError(client)&&outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:result.message,next:[{command:buildCommandWithGlobalFlags(client.argv,"alerts --help"),when:"See valid `alerts` list flags and examples"}]},2),handleValidationError(result,jsonOutput,client)}function printGroups(groups){if(groups.length===0){output_manager_default.log("No alerts found.");return}let rows=[["Title","Group id","Started At","Type","Status","Alerts"].map(h=>import_chalk.default.cyan(h)),...groups.map(group=>{let row=[import_chalk.default.bold(truncateEnd(getGroupTitle(group),80)),import_chalk.default.dim(group.id||"-"),getStartedAt(group),getGroupType(group)];return row.push(getStatus(group),getAlertsCount(group)),row})];output_manager_default.print(`
|
|
8
|
-
${renderAlertTable(rows,3)}
|
|
9
|
-
`)}function printAiSections(groups){if(groups.length===0){output_manager_default.log("No alerts found.");return}let rendered=groups.map(group=>{let title=getGroupTitle(group),summary=group.ai?.currentSummary||"N/A",findings=group.ai?.keyFindings?.filter(Boolean)??[],findingsOutput=findings.length>0?findings.map(finding=>` - ${finding}`).join(`
|
|
10
|
-
`):" - N/A";return[import_chalk.default.bold(title),` ${import_chalk.default.cyan("Resolved At:")} ${getResolvedAt(group)}`,` ${import_chalk.default.cyan("Summary:")} ${summary}`,` ${import_chalk.default.cyan("Key Findings:")}`,findingsOutput].join(`
|
|
11
|
-
`)}).join(`
|
|
12
|
-
|
|
13
|
-
`);output_manager_default.print(`
|
|
14
|
-
${rendered}
|
|
15
|
-
`)}function trackTelemetry(flags,types,telemetry){telemetry.trackCliOptionType(types.length>0?types:void 0),telemetry.trackCliOptionSince(flags["--since"]),telemetry.trackCliOptionUntil(flags["--until"]),telemetry.trackCliOptionProject(flags["--project"]),telemetry.trackCliFlagAll(flags["--all"]),telemetry.trackCliFlagAi(flags["--ai"]),telemetry.trackCliOptionLimit(flags["--limit"]),telemetry.trackCliOptionFormat(flags["--format"])}function parseFlags(client){let flagsSpecification=getFlagsSpecification(alertsCommand.options);try{return parseArguments(client.argv.slice(2),flagsSpecification).flags}catch(err){let msg=err instanceof Error?err.message:String(err),projectFlagMissingArg=msg.includes("--project")&&msg.includes("requires argument");return shouldEmitNonInteractiveCommandError(client)&&outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:projectFlagMissingArg?"`--project` requires a project name or id (for example `--project my-app`).":msg,next:projectFlagMissingArg?[{command:buildCommandWithGlobalFlags(client.argv,"alerts --project <name-or-id>"),when:"Re-run with a project name or id (replace placeholder)"},{command:buildCommandWithGlobalFlags(client.argv,"alerts --help"),when:"See all `alerts` flags and examples"}]:[{command:buildCommandWithGlobalFlags(client.argv,"alerts --help"),when:"See valid flags and examples"}]},2),printError(err),2}}function resolveValidatedInputs(flags,client,jsonOutput){let types=normalizeRepeatableStringFilters(flags["--type"]),limitResult=validateOptionalIntegerRange(flags["--limit"],{flag:"--limit",min:1,max:100});if(!limitResult.valid)return validationFailureForAgents(client,limitResult,jsonOutput);let mutualResult=validateAllProjectMutualExclusivity(flags["--all"],flags["--project"]);if(!mutualResult.valid)return validationFailureForAgents(client,mutualResult,jsonOutput);let sinceResult=validateTimeBound(flags["--since"]);if(!sinceResult.valid)return validationFailureForAgents(client,sinceResult,jsonOutput);let untilResult=validateTimeBound(flags["--until"]);if(!untilResult.valid)return validationFailureForAgents(client,untilResult,jsonOutput);let timeOrderResult=validateTimeOrder(sinceResult.value,untilResult.value);return timeOrderResult.valid?{limit:limitResult.value,types,since:sinceResult.value,until:untilResult.value}:validationFailureForAgents(client,timeOrderResult,jsonOutput)}function buildAlertsQuery(scope,inputs){let query=new URLSearchParams({teamId:scope.teamId});scope.projectId&&query.set("projectId",scope.projectId),inputs.limit&&query.set("limit",String(inputs.limit));for(let type of inputs.types)query.append("types",type);if(inputs.since&&query.set("from",inputs.since.toISOString()),inputs.until&&query.set("to",inputs.until.toISOString()),!inputs.since&&!inputs.until){let defaultRange=getDefaultRange();query.set("from",defaultRange.from),query.set("to",defaultRange.to)}return query}async function list(client,telemetry){let flags=parseFlags(client);if(typeof flags=="number")return flags;let formatResult=validateJsonOutput(flags);if(!formatResult.valid)return output_manager_default.error(formatResult.error),2;let jsonOutput=formatResult.jsonOutput,types=normalizeRepeatableStringFilters(flags["--type"]);trackTelemetry(flags,types,telemetry);let validatedInputs=resolveValidatedInputs(flags,client,jsonOutput);if(typeof validatedInputs=="number")return validatedInputs;let scope=await resolveAlertsScope(client,{project:flags["--project"],all:flags["--all"],jsonOutput});if(typeof scope=="number")return scope;let requestPath=`/alerts/v3/groups?${buildAlertsQuery(scope,validatedInputs).toString()}`;output_manager_default.debug(`Fetching alerts from ${requestPath}`),output_manager_default.spinner("Fetching alerts...");try{let groups=await client.fetch(requestPath);return jsonOutput?client.stdout.write(`${JSON.stringify({groups},null,2)}
|
|
16
|
-
`):flags["--ai"]?printAiSections(groups):printGroups(groups),0}catch(err){if(isAPIError(err))return handleApiError(err,jsonOutput,client);output_manager_default.debug(err);let message=`Failed to fetch alerts: ${err.message||String(err)}`;return outputError(client,jsonOutput,"UNEXPECTED_ERROR",message)}finally{output_manager_default.stopSpinner()}}export{list as default};
|
|
@@ -1,9 +0,0 @@
|
|
|
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{AUTH_FAILURE,CREDENTIAL_STORE_CONFLICT,VCR_ENGINES,VCR_LOGIN_USERNAME,emitVcrArgParseError,engineLogin,engineLogout,handleVcrApiError,isEngineInstalled,resolveRegistry,resolveVcrScope,stderrTail,validateVcrChoice,validateVcrJsonOutput}from"./chunk-SYFG2RM6.js";import{outputError}from"./chunk-RW3X523R.js";import"./chunk-BUJITHGZ.js";import"./chunk-FBYA6LLM.js";import"./chunk-GD7AV7BO.js";import"./chunk-SCV7XEEO.js";import{loginSubcommand}from"./chunk-527GBU3K.js";import"./chunk-CR3NBTHV.js";import"./chunk-BVGGTBYE.js";import"./chunk-6TXEVQA4.js";import{printError}from"./chunk-HSFKISDH.js";import"./chunk-K5U47EVH.js";import"./chunk-MXTC4ZAQ.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-WDXW6A4H.js";import"./chunk-DKJL2KV7.js";import"./chunk-4N6LMERQ.js";import"./chunk-ADLBLGT3.js";import"./chunk-CWM2F235.js";import"./chunk-4NTBYNFR.js";import{parseArguments}from"./chunk-KCKYPLIH.js";import"./chunk-F53OKXYI.js";import{getFlagsSpecification}from"./chunk-QVXS234E.js";import"./chunk-FUX6LKNP.js";import"./chunk-OPORM35X.js";import"./chunk-4SAVH3H7.js";import{isAPIError}from"./chunk-6VH56CX2.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-XP3FT56R.js";import"./chunk-BLUPZPAS.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BZENIQ7N.js";var LOGIN_VALID_HOURS=12;async function login(client,argv,telemetry){let parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(loginSubcommand.options))}catch(err){return emitVcrArgParseError(client,err,"vcr login <engine> --project <name-or-id>"),printError(err),2}let fr=validateVcrJsonOutput(client,parsedArgs.flags);if(typeof fr=="number")return fr;let engineArg=parsedArgs.args[0],project=parsedArgs.flags["--project"];if(telemetry.trackCliArgumentEngine(engineArg),telemetry.trackCliOptionProject(project),telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]),!engineArg){let message=`Missing engine. Choose one of: ${VCR_ENGINES.join(", ")}.`;return outputAgentError(client,{status:"error",reason:AGENT_REASON.MISSING_ARGUMENTS,message,next:[{command:buildCommandWithGlobalFlags(client.argv,"vcr login docker"),when:"Replace docker with the container tool you use"}]},2),outputError(client,fr.jsonOutput,"MISSING_ARGUMENTS",message)}let choiceError=validateVcrChoice(client,"engine",engineArg,VCR_ENGINES,fr.jsonOutput);if(typeof choiceError=="number")return choiceError;let engine=engineArg;if(!isEngineInstalled(engine)){let message=`\`${engine}\` is not installed or not on your PATH. Install it and try again.`;return outputAgentError(client,{status:"error",reason:"engine_not_found",message},1),outputError(client,fr.jsonOutput,"ENGINE_NOT_FOUND",message)}let scope=await resolveVcrScope(client,{project,jsonOutput:fr.jsonOutput});if(typeof scope=="number")return scope;let registry=resolveRegistry();output_manager_default.spinner(`Authenticating ${engine} with ${registry}...`);try{let{token}=await client.fetch(`/projects/${scope.projectId}/token`,{method:"POST",accountId:scope.teamId,body:JSON.stringify({source:"vercel-cli"}),headers:{"Content-Type":"application/json"}}),result=await engineLogin(engine,registry,token);if(result.exitCode!==0&&CREDENTIAL_STORE_CONFLICT.test(result.stderr)&&(output_manager_default.debug(`Stale ${registry} credential in the ${engine} credential store; running \`${engine} logout\` and retrying`),await engineLogout(engine,registry),result=await engineLogin(engine,registry,token)),result.exitCode!==0){let message=AUTH_FAILURE.test(result.stderr)?`Authentication to ${registry} as "${VCR_LOGIN_USERNAME}" was rejected. The OIDC token may be expired or lack access to this project.`:`\`${engine} login\` failed (exit code ${result.exitCode}).${stderrTail(result.stderr)?`
|
|
8
|
-
${stderrTail(result.stderr)}`:""}`;return outputAgentError(client,{status:"error",reason:AUTH_FAILURE.test(result.stderr)?"not_authorized":"command_failed",message,next:[{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"See current user and team"}]},1),outputError(client,fr.jsonOutput,AUTH_FAILURE.test(result.stderr)?"NOT_AUTHORIZED":"COMMAND_FAILED",message)}return fr.jsonOutput?client.stdout.write(`${JSON.stringify({status:"success",engine,registry,username:VCR_LOGIN_USERNAME,validForHours:LOGIN_VALID_HOURS},null,2)}
|
|
9
|
-
`):(output_manager_default.success(`Logged in to ${registry} as ${VCR_LOGIN_USERNAME} (${engine}).`),output_manager_default.log(`Credentials are valid for ~${LOGIN_VALID_HOURS} hours. Re-run \`${buildCommandWithGlobalFlags(client.argv,`vcr login ${engine}`)}\` to refresh.`)),0}catch(err){if(isAPIError(err))return handleVcrApiError(client,err,fr.jsonOutput);throw err}finally{output_manager_default.stopSpinner()}}export{login as default};
|
|
@@ -1,7 +0,0 @@
|
|
|
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{login}from"./chunk-NGKO2OOU.js";import"./chunk-WEH6XC4Y.js";import"./chunk-PVASGBEF.js";import"./chunk-FGFLTLEA.js";import"./chunk-LFOWP74R.js";import"./chunk-FLHO75XC.js";import"./chunk-773GOZIR.js";import"./chunk-HSFKISDH.js";import"./chunk-67GZ5REA.js";import"./chunk-BS32OUOC.js";import"./chunk-6YXIWZ3X.js";import"./chunk-PUKYAALC.js";import"./chunk-NWGBDBZI.js";import"./chunk-WDXW6A4H.js";import"./chunk-DKJL2KV7.js";import"./chunk-4N6LMERQ.js";import"./chunk-ADLBLGT3.js";import"./chunk-CWM2F235.js";import"./chunk-4NTBYNFR.js";import"./chunk-KCKYPLIH.js";import"./chunk-F53OKXYI.js";import"./chunk-QVXS234E.js";import"./chunk-FUX6LKNP.js";import"./chunk-OPORM35X.js";import"./chunk-4SAVH3H7.js";import"./chunk-6VH56CX2.js";import"./chunk-JESNVRVR.js";import"./chunk-XP3FT56R.js";import"./chunk-BLUPZPAS.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BZENIQ7N.js";export{login as default};
|
|
@@ -1,7 +0,0 @@
|
|
|
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{collectBuildLogs,displayBuildLogs,displayBuildLogsUntilFinalError,parseLogLines}from"./chunk-NAX6IARA.js";import"./chunk-N2FLYCCO.js";import"./chunk-R6BEOVTU.js";import"./chunk-HCRD3JFL.js";import"./chunk-BS32OUOC.js";import"./chunk-K5U47EVH.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-WDXW6A4H.js";import"./chunk-DKJL2KV7.js";import"./chunk-4N6LMERQ.js";import"./chunk-ADLBLGT3.js";import"./chunk-CWM2F235.js";import"./chunk-4NTBYNFR.js";import"./chunk-KCKYPLIH.js";import"./chunk-F53OKXYI.js";import"./chunk-QVXS234E.js";import"./chunk-FUX6LKNP.js";import"./chunk-OPORM35X.js";import"./chunk-4SAVH3H7.js";import"./chunk-6VH56CX2.js";import"./chunk-JESNVRVR.js";import"./chunk-XP3FT56R.js";import"./chunk-BLUPZPAS.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BZENIQ7N.js";export{collectBuildLogs,displayBuildLogs,displayBuildLogsUntilFinalError,parseLogLines};
|
|
@@ -1,8 +0,0 @@
|
|
|
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{printRules}from"./chunk-QVZAAMGQ.js";import"./chunk-3XW7N4W3.js";import{parseRulesFlagsAndScope}from"./chunk-RMZTB2IU.js";import"./chunk-KGBIRIFF.js";import{emitRulesArgParseError,handleRulesApiError,outputRulesError,rulesCollectionPath}from"./chunk-XC46OAAT.js";import"./chunk-GHAY4PSD.js";import{normalizeRepeatableStringFilters}from"./chunk-RW3X523R.js";import"./chunk-ID663OJ7.js";import"./chunk-HRR57QNP.js";import"./chunk-GZNDA6SV.js";import"./chunk-PFD7LETF.js";import{monitorsLsSubcommand}from"./chunk-NW7WWUCQ.js";import"./chunk-773GOZIR.js";import{printError}from"./chunk-HSFKISDH.js";import"./chunk-67GZ5REA.js";import"./chunk-BS32OUOC.js";import"./chunk-K5U47EVH.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-WDXW6A4H.js";import"./chunk-DKJL2KV7.js";import"./chunk-4N6LMERQ.js";import"./chunk-ADLBLGT3.js";import"./chunk-CWM2F235.js";import"./chunk-4NTBYNFR.js";import{parseArguments}from"./chunk-KCKYPLIH.js";import"./chunk-F53OKXYI.js";import{getFlagsSpecification,validateJsonOutput}from"./chunk-QVXS234E.js";import"./chunk-FUX6LKNP.js";import"./chunk-OPORM35X.js";import"./chunk-4SAVH3H7.js";import{isAPIError}from"./chunk-6VH56CX2.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-XP3FT56R.js";import"./chunk-BLUPZPAS.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BZENIQ7N.js";var BUILT_IN_ALERT_TYPES=["usage_anomaly","error_anomaly","botId_anomaly","firewallSystemRule_anomaly","firewallCustomRule_anomaly","testAlert_anomaly","buildTime_anomaly"];var BUILT_IN_ALERT_TYPE_SET=new Set(BUILT_IN_ALERT_TYPES);function parseRuleTypeFilter(client,values,jsonOutput){let types=normalizeRepeatableStringFilters(values);if(types.length===0)return;let invalidType=types.find(type=>type!=="built-in"&&type!=="custom"&&type!=="custom_alert"&&!BUILT_IN_ALERT_TYPE_SET.has(type));if(invalidType)return outputRulesError(client,jsonOutput,"INVALID_RULE_TYPE",`Invalid monitor type "${invalidType}". Expected a supported monitor type or built-in trigger type.`);let includeCustom=types.includes("custom")||types.includes("custom_alert"),includeAllBuiltIn=types.includes("built-in"),builtInAlertTypes=new Set(types.filter(type=>BUILT_IN_ALERT_TYPE_SET.has(type))),includeBuiltIn=includeAllBuiltIn||builtInAlertTypes.size>0;return{apiType:includeCustom===includeBuiltIn?void 0:includeCustom?"custom":"built-in",matches(rule){return rule.type==="custom"?includeCustom:includeAllBuiltIn?!0:includeBuiltIn?rule.triggers.mode==="all"?!0:rule.triggers.items.some(trigger=>builtInAlertTypes.has(trigger.type)):!1}}}async function ls(client,argv,api,telemetry){let parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(monitorsLsSubcommand.options))}catch(error){return emitRulesArgParseError(client,error,"monitors ls --project <name-or-id>"),printError(error),2}let flags=parsedArgs.flags;telemetry?.trackCliOptionType(flags["--type"]),telemetry?.trackCliFlagAll(flags["--all"]),telemetry?.trackCliFlagJson(flags["--json"]);let format=validateJsonOutput(flags);if(!format.valid)return outputRulesError(client,!1,"INVALID_ARGUMENTS",format.error);let typeFilter=parseRuleTypeFilter(client,flags["--type"],format.jsonOutput);if(typeof typeFilter=="number")return typeFilter;let scope=await parseRulesFlagsAndScope(client,{"--project":flags["--project"],"--all":flags["--all"]},format.jsonOutput,"monitors ls");if(typeof scope=="number")return scope;output_manager_default.spinner("Fetching monitors\u2026");try{let rules=[],cursor;do{let page=await client.fetch(rulesCollectionPath(api,scope.teamId,{limit:100,cursor,projectId:scope.projectId,type:typeFilter?.apiType}));rules.push(...page[api.listKey]),cursor=page.pagination.next??void 0}while(cursor);let filteredRules=typeFilter?rules.filter(typeFilter.matches):rules;return format.jsonOutput?client.stdout.write(`${JSON.stringify({[api.listKey]:filteredRules},null,2)}
|
|
8
|
-
`):filteredRules.length===0?output_manager_default.log("No monitors found for this scope"):printRules(filteredRules),0}catch(error){if(isAPIError(error))return handleRulesApiError(client,error,format.jsonOutput);throw error}finally{output_manager_default.stopSpinner()}}export{ls as default};
|
|
@@ -1,11 +0,0 @@
|
|
|
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{printRuleNotifications,printRulesNotifications}from"./chunk-QIVX6SCR.js";import{resolveRulesTeam}from"./chunk-RMZTB2IU.js";import"./chunk-KGBIRIFF.js";import{emitRulesArgParseError,handleRulesApiError,outputRulesError,ruleNotificationsPath,rulesNotificationsPath}from"./chunk-XC46OAAT.js";import"./chunk-RW3X523R.js";import{monitorsNotificationsLsSubcommand}from"./chunk-NW7WWUCQ.js";import{printError}from"./chunk-HSFKISDH.js";import"./chunk-K5U47EVH.js";import"./chunk-MXTC4ZAQ.js";import{AGENT_STATUS,buildCommandWithGlobalFlags}from"./chunk-WDXW6A4H.js";import"./chunk-DKJL2KV7.js";import"./chunk-4N6LMERQ.js";import"./chunk-ADLBLGT3.js";import"./chunk-CWM2F235.js";import"./chunk-4NTBYNFR.js";import{parseArguments}from"./chunk-KCKYPLIH.js";import{quoteArg}from"./chunk-F53OKXYI.js";import{getFlagsSpecification,validateJsonOutput}from"./chunk-QVXS234E.js";import"./chunk-FUX6LKNP.js";import"./chunk-OPORM35X.js";import"./chunk-4SAVH3H7.js";import{isAPIError}from"./chunk-6VH56CX2.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-XP3FT56R.js";import"./chunk-BLUPZPAS.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BZENIQ7N.js";var PAGE_LIMIT=100;async function fetchRulesNotifications(client,api,teamId){let notifications={},cursor;do{let page=await client.fetch(rulesNotificationsPath(api,teamId,{limit:PAGE_LIMIT,cursor}));Object.assign(notifications,page.notifications),cursor=page.pagination.next??void 0}while(cursor);return{notifications}}async function ls(client,argv,api){let parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(monitorsNotificationsLsSubcommand.options))}catch(error){return emitRulesArgParseError(client,error,"monitors notifications [monitor-id]"),printError(error),2}let format=validateJsonOutput(parsedArgs.flags);if(!format.valid)return outputRulesError(client,!1,"INVALID_ARGUMENTS",format.error);let[ruleId,extraArg]=parsedArgs.args;if(extraArg)return outputRulesError(client,format.jsonOutput,"INVALID_ARGUMENTS","Expected exactly one monitor ID.");let scope=await resolveRulesTeam(client,format.jsonOutput);if(typeof scope=="number")return scope;client.nonInteractive||output_manager_default.spinner(ruleId?"Fetching notification destinations\u2026":"Fetching monitor notification destinations\u2026");try{if(!ruleId){let result=await fetchRulesNotifications(client,api,scope.teamId);if(client.nonInteractive){let ruleCount=Object.keys(result.notifications).length,notificationCount=Object.values(result.notifications).reduce((count,notifications)=>count+notifications.length,0);client.stdout.write(`${JSON.stringify({status:AGENT_STATUS.OK,...result,message:`Listed ${notificationCount} notification destination${notificationCount===1?"":"s"} across ${ruleCount} readable monitor${ruleCount===1?"":"s"}.`,next:[{command:buildCommandWithGlobalFlags(client.argv,"monitors notifications link <monitor-id> --slack-channel <channel-id> --slack-installation-id <installation-id>"),when:"Link a Slack channel to a monitor"},{command:buildCommandWithGlobalFlags(client.argv,"monitors notifications link <monitor-id> --webhook <webhook-id>"),when:"Link an account webhook to a monitor"}]},null,2)}
|
|
8
|
-
`)}else format.jsonOutput?client.stdout.write(`${JSON.stringify(result,null,2)}
|
|
9
|
-
`):printRulesNotifications(result);return 0}let response=await client.fetch(ruleNotificationsPath(api,scope.teamId,ruleId));if(client.nonInteractive){let count=response.notifications.length;client.stdout.write(`${JSON.stringify({status:AGENT_STATUS.OK,[api.idKey]:ruleId,notifications:response.notifications,message:`${count} notification destination${count===1?"":"s"} linked to monitor ${ruleId}.`,next:[{command:buildCommandWithGlobalFlags(client.argv,`monitors notifications link ${quoteArg(ruleId)} --webhook <webhook-id>`),when:"Link an account webhook"},{command:buildCommandWithGlobalFlags(client.argv,`monitors notifications link ${quoteArg(ruleId)} --slack-channel <channel-id>`),when:"Link a Slack channel"}]},null,2)}
|
|
10
|
-
`)}else format.jsonOutput?client.stdout.write(`${JSON.stringify(response,null,2)}
|
|
11
|
-
`):printRuleNotifications(ruleId,response.notifications);return 0}catch(error){if(isAPIError(error))return handleRulesApiError(client,error,format.jsonOutput);throw error}finally{client.nonInteractive||output_manager_default.stopSpinner()}}export{ls as default};
|
|
@@ -1,9 +0,0 @@
|
|
|
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{buildRuleNotificationsInspectCommand,printRuleNotificationMutationReceipt}from"./chunk-QIVX6SCR.js";import{resolveRulesTeam}from"./chunk-RMZTB2IU.js";import"./chunk-KGBIRIFF.js";import{emitRulesArgParseError,handleRulesApiError,outputRulesError,rulesNotificationLinksPath}from"./chunk-XC46OAAT.js";import"./chunk-RW3X523R.js";import{monitorsNotificationsLinkSubcommand,monitorsNotificationsUnlinkSubcommand,monitorsNotificationsUpdateSubcommand}from"./chunk-NW7WWUCQ.js";import{printError}from"./chunk-HSFKISDH.js";import"./chunk-K5U47EVH.js";import"./chunk-MXTC4ZAQ.js";import{AGENT_STATUS}from"./chunk-WDXW6A4H.js";import"./chunk-DKJL2KV7.js";import"./chunk-4N6LMERQ.js";import"./chunk-ADLBLGT3.js";import"./chunk-CWM2F235.js";import"./chunk-4NTBYNFR.js";import{parseArguments}from"./chunk-KCKYPLIH.js";import"./chunk-F53OKXYI.js";import{getFlagsSpecification,validateJsonOutput}from"./chunk-QVXS234E.js";import"./chunk-FUX6LKNP.js";import"./chunk-OPORM35X.js";import"./chunk-4SAVH3H7.js";import{isAPIError}from"./chunk-6VH56CX2.js";import{packageName}from"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-XP3FT56R.js";import"./chunk-BLUPZPAS.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BZENIQ7N.js";var API_SLACK_INSTALLATION_REQUIRED_MESSAGE="configId is required unless the team has exactly one Slack configuration.",CLI_SLACK_INSTALLATION_REQUIRED_MESSAGE="A Slack installation ID is required unless the team has exactly one completed Slack installation. Pass --slack-installation-id <installation-id>.";function getTarget(client,flags,jsonOutput){let webhookId=flags["--webhook"],channelId=flags["--slack-channel"],configId=flags["--slack-installation-id"];return webhookId&&(channelId||configId)?outputRulesError(client,jsonOutput,"INVALID_ARGUMENTS","Specify either --webhook or --slack-channel, not both."):configId&&!channelId?outputRulesError(client,jsonOutput,"INVALID_ARGUMENTS","--slack-installation-id requires --slack-channel."):webhookId?{type:"webhook",webhookId}:channelId?configId?{type:"slack",channelId,configId}:{type:"slack",channelId}:outputRulesError(client,jsonOutput,"MISSING_ARGUMENTS","Specify a notification destination with --webhook or --slack-channel.")}function applyDeliverySetting(client,target,flags,action,jsonOutput){let criticalOnly=flags["--critical-only"],noCriticalOnly=flags["--no-critical-only"];return criticalOnly&&noCriticalOnly?outputRulesError(client,jsonOutput,"MUTUAL_EXCLUSIVITY","Specify either --critical-only or --no-critical-only, not both."):action==="update"&&!criticalOnly&&!noCriticalOnly?outputRulesError(client,jsonOutput,"MISSING_ARGUMENTS","Specify --critical-only or --no-critical-only."):criticalOnly?{...target,minimumSeverityLevel:"critical"}:action==="update"&&noCriticalOnly?{...target,minimumSeverityLevel:null}:target}async function mutate(client,argv,api,action){let command={link:monitorsNotificationsLinkSubcommand,update:monitorsNotificationsUpdateSubcommand,unlink:monitorsNotificationsUnlinkSubcommand}[action],parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(command.options))}catch(error){return emitRulesArgParseError(client,error,`monitors notifications ${action} <monitor-id> --webhook <webhook-id>`),printError(error),2}let flags=parsedArgs.flags,format=validateJsonOutput(flags);if(!format.valid)return outputRulesError(client,!1,"INVALID_ARGUMENTS",format.error);let[ruleId,extraArg]=parsedArgs.args;if(!ruleId)return outputRulesError(client,format.jsonOutput,"MISSING_ARGUMENTS",`Missing monitor ID. Example: ${packageName} monitors notifications ${action} <monitor-id> --webhook <webhook-id>`);if(extraArg)return outputRulesError(client,format.jsonOutput,"INVALID_ARGUMENTS","Expected exactly one monitor ID.");let target=getTarget(client,flags,format.jsonOutput);if(typeof target=="number")return target;let notification=applyDeliverySetting(client,target,flags,action,format.jsonOutput);if(typeof notification=="number")return notification;let scope=await resolveRulesTeam(client,format.jsonOutput);if(typeof scope=="number")return scope;client.nonInteractive||output_manager_default.spinner(`${action==="link"?"Linking":action==="update"?"Updating":"Unlinking"} notification destination\u2026`);try{let response=await client.fetch(rulesNotificationLinksPath(api,scope.teamId,ruleId),{method:action==="link"?"POST":action==="update"?"PATCH":"DELETE",body:notification});if(client.nonInteractive){let actionPastTense=action==="link"?"Linked":action==="update"?"Updated":"Unlinked",preposition=action==="link"?"to":action==="update"?"for":"from";client.stdout.write(`${JSON.stringify({status:AGENT_STATUS.OK,success:response.success,action,[api.idKey]:ruleId,notification:response.notification,message:`${actionPastTense} notification destination ${preposition} monitor ${ruleId}.`,next:[{command:buildRuleNotificationsInspectCommand(client.argv,ruleId),when:"Inspect linked notification destinations"}]},null,2)}
|
|
8
|
-
`)}else format.jsonOutput?client.stdout.write(`${JSON.stringify(response,null,2)}
|
|
9
|
-
`):printRuleNotificationMutationReceipt(action==="link"?"Linked":action==="update"?"Updated":"Unlinked",ruleId,notification,client.argv);return 0}catch(error){if(isAPIError(error))return error.serverMessage===API_SLACK_INSTALLATION_REQUIRED_MESSAGE?outputRulesError(client,format.jsonOutput,error.code||"bad_request",CLI_SLACK_INSTALLATION_REQUIRED_MESSAGE):handleRulesApiError(client,error,format.jsonOutput);throw error}finally{client.nonInteractive||output_manager_default.stopSpinner()}}export{mutate as default};
|
|
@@ -1,7 +0,0 @@
|
|
|
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{monitorsRoutingFlags}from"./chunk-7E3WREH5.js";import{getSubcommand}from"./chunk-ETV3C2CV.js";import"./chunk-NW7WWUCQ.js";import"./chunk-6YXIWZ3X.js";import"./chunk-PUKYAALC.js";import"./chunk-NWGBDBZI.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-WDXW6A4H.js";import"./chunk-DKJL2KV7.js";import"./chunk-4NTBYNFR.js";import{takeCommand}from"./chunk-KCKYPLIH.js";import"./chunk-F53OKXYI.js";import{warnDeprecatedSubcommand}from"./chunk-QVXS234E.js";import"./chunk-4SAVH3H7.js";import"./chunk-6VH56CX2.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-XP3FT56R.js";import"./chunk-BLUPZPAS.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BZENIQ7N.js";var NOTIFICATIONS_CONFIG={ls:["ls","list"],link:["link"],update:["update","patch"],unlink:["unlink"]};async function notifications(client,argv,api,telemetry){let{command,args:argsWithoutCommand}=takeCommand(argv,monitorsRoutingFlags);if(!command||command.startsWith("ar_"))return telemetry.trackCliSubcommandNotifications(command?"inspect":"ls"),(await import("./ls-VTKHPDWS.js")).default(client,argv,api);let{subcommand,subcommandOriginal}=getSubcommand([command],NOTIFICATIONS_CONFIG),args=argsWithoutCommand;if(subcommand==null)return telemetry.trackCliSubcommandNotifications("unknown"),outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:`Unknown "monitors notifications" subcommand "${command}".`,next:[{command:buildCommandWithGlobalFlags(client.argv,"monitors notifications --help"),when:"Show valid notification subcommands"}]},2),output_manager_default.error(`Unknown "monitors notifications" subcommand "${command}". Run \`vercel monitors notifications --help\`.`),2;switch(subcommand){case"ls":return telemetry.trackCliSubcommandNotifications(args[0]?.startsWith("ar_")?"inspect":"ls"),(await import("./ls-VTKHPDWS.js")).default(client,args,api);case"link":case"update":case"unlink":return telemetry.trackCliSubcommandNotifications(subcommandOriginal),subcommandOriginal==="patch"&&warnDeprecatedSubcommand(client,"monitors notifications patch","monitors notifications update"),(await import("./mutate-7ADZBCZM.js")).default(client,args,api,subcommand);default:return output_manager_default.error(`Unhandled notifications subcommand: ${String(subcommand)}`),1}}export{notifications as default};
|
|
@@ -1,7 +0,0 @@
|
|
|
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{parseThreadArg}from"./chunk-2S6PE6GB.js";import{getThread,handleCommentsParseError,resolveCommentsScope,threadNotFoundMessage,toApiErrorParts}from"./chunk-JUSR7V2L.js";import{outputError}from"./chunk-RW3X523R.js";import"./chunk-JP33AIDQ.js";import{require_open}from"./chunk-PVASGBEF.js";import"./chunk-2TUVL6WE.js";import{openSubcommand}from"./chunk-5KUUMQ3M.js";import"./chunk-HSFKISDH.js";import"./chunk-K5U47EVH.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-WDXW6A4H.js";import"./chunk-DKJL2KV7.js";import"./chunk-4N6LMERQ.js";import"./chunk-ADLBLGT3.js";import"./chunk-CWM2F235.js";import"./chunk-4NTBYNFR.js";import{parseArguments}from"./chunk-KCKYPLIH.js";import"./chunk-F53OKXYI.js";import{getFlagsSpecification}from"./chunk-QVXS234E.js";import"./chunk-FUX6LKNP.js";import"./chunk-OPORM35X.js";import"./chunk-4SAVH3H7.js";import{isAPIError}from"./chunk-6VH56CX2.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-XP3FT56R.js";import"./chunk-BLUPZPAS.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_open=__toESM(require_open(),1);async function openThread(client,telemetry){let parsedArgs,flagsSpecification=getFlagsSpecification(openSubcommand.options);try{parsedArgs=parseArguments(client.argv.slice(2),flagsSpecification)}catch(err){return handleCommentsParseError(err,"open")}let threadInput=parsedArgs.args[2];if(telemetry.trackCliArgumentThread(threadInput),!threadInput)return output_manager_default.error("Pass a thread ID or URL: `vercel comments open <thread>`."),2;let threadRef=parseThreadArg(threadInput);if(!threadRef)return output_manager_default.error(`Could not extract a thread ID from "${threadInput}". Pass the thread ID or its vercel.com URL.`),2;let threadId=threadRef.id;telemetry.trackCliOptionProject(parsedArgs.flags["--project"]);let scope=await resolveCommentsScope(client,{project:parsedArgs.flags["--project"],requireProject:!1,jsonOutput:!1,urlTeamSlug:threadRef.teamSlug});if(typeof scope=="number")return scope;let webUrl;try{webUrl=(await getThread(client,scope.teamId,threadId)).webUrl}catch(err){if(isAPIError(err)){let{code,message}=toApiErrorParts(err);return outputError(client,!1,code,err.status===404?threadNotFoundMessage(threadId,scope):message)}throw err}return webUrl?(output_manager_default.log(`Opening ${webUrl}`),await(0,import_open.default)(webUrl),0):(output_manager_default.error(`The API returned no web URL for ${threadId}.`),1)}export{openThread as default};
|
|
@@ -1,7 +0,0 @@
|
|
|
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{createOpenApiCache,fetchSpecUrl,foldNamingStyle,formatAsCard,formatAsDataTable,inferCliSubcommandAliases,operationIdToKebabCase,resolveEndpointByTagAndOperationId,tryOpenApiFallback}from"./chunk-KPQLUGFI.js";import{humanReadableColumnLabel,humanizeIdentifier}from"./chunk-GHAY4PSD.js";import{CACHE_FILE,CACHE_TTL_MS,FETCH_TIMEOUT_MS,MAX_OPENAPI_SPEC_BYTES,OPENAPI_URL,OpenApiCache,SSO_API_URL,VERCEL_CLI_ROOT_DISPLAY_KEY,assertAllowedSpecUrl,matchesCliApiTag,readSpecResponse,resolveOpenApiTagForProjectsCli}from"./chunk-363SJ4TN.js";import"./chunk-F6EBOT64.js";import"./chunk-FLHO75XC.js";import"./chunk-773GOZIR.js";import"./chunk-HSFKISDH.js";import"./chunk-67GZ5REA.js";import"./chunk-BS32OUOC.js";import"./chunk-6YXIWZ3X.js";import"./chunk-PUKYAALC.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-NWGBDBZI.js";import"./chunk-WDXW6A4H.js";import"./chunk-DKJL2KV7.js";import"./chunk-CWM2F235.js";import"./chunk-4NTBYNFR.js";import"./chunk-KCKYPLIH.js";import"./chunk-F53OKXYI.js";import"./chunk-QVXS234E.js";import"./chunk-4SAVH3H7.js";import"./chunk-6VH56CX2.js";import"./chunk-JESNVRVR.js";import"./chunk-XP3FT56R.js";import"./chunk-BLUPZPAS.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BZENIQ7N.js";export{CACHE_FILE,CACHE_TTL_MS,FETCH_TIMEOUT_MS,MAX_OPENAPI_SPEC_BYTES,OPENAPI_URL,OpenApiCache,SSO_API_URL,VERCEL_CLI_ROOT_DISPLAY_KEY,assertAllowedSpecUrl,createOpenApiCache,fetchSpecUrl,foldNamingStyle,formatAsCard,formatAsDataTable,humanReadableColumnLabel,humanizeIdentifier,inferCliSubcommandAliases,matchesCliApiTag,operationIdToKebabCase,readSpecResponse,resolveEndpointByTagAndOperationId,resolveOpenApiTagForProjectsCli,tryOpenApiFallback};
|
|
@@ -1,7 +0,0 @@
|
|
|
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{getSubcommand}from"./chunk-ETV3C2CV.js";import{PERMISSIONS_ACTIONS,permissionsClearSubcommand,permissionsLsSubcommand}from"./chunk-CR3NBTHV.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-WDXW6A4H.js";import"./chunk-DKJL2KV7.js";import{parseArguments}from"./chunk-KCKYPLIH.js";import"./chunk-F53OKXYI.js";import{getFlagsSpecification}from"./chunk-QVXS234E.js";import"./chunk-6VH56CX2.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-XP3FT56R.js";import"./chunk-BLUPZPAS.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BZENIQ7N.js";var USAGE="vcr permissions <repository> <ls|add|remove|clear>",ROUTING_OPTIONS=[...permissionsLsSubcommand.options,...permissionsClearSubcommand.options];async function permissions(client,argv,telemetry){let positionals;try{positionals=parseArguments(argv,getFlagsSpecification(ROUTING_OPTIONS),{permissive:!0}).args}catch{positionals=argv.filter(arg=>!arg.startsWith("-"))}let repository=positionals[0],{subcommand}=getSubcommand(positionals.slice(1),PERMISSIONS_ACTIONS);if(!repository||subcommand==null){let message=repository?positionals.length<2?`Please specify an action. Usage: \`vercel ${USAGE}\`.`:`Unknown "vcr permissions" action "${positionals[1]}". Usage: \`vercel ${USAGE}\`.`:`Missing repository. Usage: \`vercel ${USAGE}\`.`;return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message,next:[{command:buildCommandWithGlobalFlags(client.argv,"vcr permissions --help"),when:"Show valid permissions actions"}]},2),output_manager_default.error(`${message} Run \`vercel vcr permissions --help\`.`),2}switch(subcommand){case"ls":return(await import("./ls-2HUJHVLA.js")).default(client,argv,telemetry);case"add":return(await import("./add-NMYFDVXW.js")).default(client,argv,telemetry);case"rm":return(await import("./rm-FWD2NUGX.js")).default(client,argv,telemetry);case"clear":return(await import("./clear-FKVWDCVA.js")).default(client,argv,telemetry);default:return output_manager_default.error(`Unhandled permissions action: ${subcommand}`),1}}export{permissions as default};
|
|
@@ -1,7 +0,0 @@
|
|
|
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{login}from"./chunk-NGKO2OOU.js";import{require_ci_info}from"./chunk-2EYYB6YN.js";import"./chunk-WEH6XC4Y.js";import"./chunk-PVASGBEF.js";import"./chunk-FGFLTLEA.js";import"./chunk-LFOWP74R.js";import"./chunk-FLHO75XC.js";import"./chunk-773GOZIR.js";import{printError}from"./chunk-HSFKISDH.js";import"./chunk-67GZ5REA.js";import"./chunk-BS32OUOC.js";import{param}from"./chunk-3G3FQYMW.js";import"./chunk-6YXIWZ3X.js";import"./chunk-PUKYAALC.js";import"./chunk-NWGBDBZI.js";import"./chunk-WDXW6A4H.js";import"./chunk-DKJL2KV7.js";import{humanizePath}from"./chunk-4N6LMERQ.js";import"./chunk-ADLBLGT3.js";import{getGlobalPathConfig}from"./chunk-CWM2F235.js";import"./chunk-4NTBYNFR.js";import"./chunk-KCKYPLIH.js";import"./chunk-F53OKXYI.js";import"./chunk-QVXS234E.js";import"./chunk-FUX6LKNP.js";import"./chunk-OPORM35X.js";import"./chunk-4SAVH3H7.js";import"./chunk-6VH56CX2.js";import{getCommandName}from"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-XP3FT56R.js";import"./chunk-BLUPZPAS.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_ci_info=__toESM(require_ci_info(),1);async function promptMissingCredentials(client,onLoginError){let isTTY=process.stdout.isTTY;if(!import_ci_info.default.isCI&&(isTTY||client.isAgent)){output_manager_default.log(isTTY?"No existing credentials found. Please log in:":"No existing credentials found. Starting login flow...");try{let result=await login(client,{shouldParseArgs:!1});if(result!==0)return result}catch(error){return printError(error),onLoginError?.(error),1}return output_manager_default.debug(`Saved credentials in "${humanizePath(getGlobalPathConfig())}"`),0}return output_manager_default.prettyError({message:`No existing credentials found. Please run ${getCommandName("login")} or pass ${param("--token")}`,link:"https://err.sh/vercel/no-credentials-found"}),1}export{promptMissingCredentials as default};
|
|
@@ -1,15 +0,0 @@
|
|
|
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{updateRouteVersion}from"./chunk-6QKS6QK7.js";import{getRouteVersions}from"./chunk-BVH2AEFE.js";import{confirmAction,getRoutes,parseSubcommandArgs,printDiffSummary,withGlobalFlags}from"./chunk-M2NXKZKX.js";import{requireProjectContext}from"./chunk-YEZJNXQX.js";import{stamp_default}from"./chunk-A2RZZQEP.js";import"./chunk-Q7D7RGXM.js";import"./chunk-JP33AIDQ.js";import"./chunk-2TUVL6WE.js";import{publishSubcommand}from"./chunk-462YCCJZ.js";import"./chunk-HSFKISDH.js";import"./chunk-K5U47EVH.js";import"./chunk-MXTC4ZAQ.js";import{outputAgentError}from"./chunk-WDXW6A4H.js";import"./chunk-DKJL2KV7.js";import"./chunk-4N6LMERQ.js";import"./chunk-ADLBLGT3.js";import"./chunk-CWM2F235.js";import"./chunk-4NTBYNFR.js";import"./chunk-KCKYPLIH.js";import"./chunk-F53OKXYI.js";import"./chunk-QVXS234E.js";import"./chunk-FUX6LKNP.js";import"./chunk-OPORM35X.js";import"./chunk-4SAVH3H7.js";import"./chunk-6VH56CX2.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-XP3FT56R.js";import"./chunk-BLUPZPAS.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);async function publish(client,argv){let parsed=await parseSubcommandArgs(argv,publishSubcommand,client);if(typeof parsed=="number")return parsed;let link=await requireProjectContext(client,"routes",parsed.flags["--project"]);if(typeof link=="number")return link;let{project,org}=link,teamId=org.type==="team"?org.id:void 0;output_manager_default.spinner(`Fetching route versions for ${import_chalk.default.bold(project.name)}`);let{versions}=await getRouteVersions(client,project.id,{teamId}),version=versions.find(v=>v.isStaging);if(!version)return output_manager_default.warn(`No staged changes to publish. Make changes first with ${import_chalk.default.cyan(withGlobalFlags(client,"routes add"))}.`),0;output_manager_default.spinner("Fetching changes");let{routes:diffRoutes}=await getRoutes(client,project.id,{teamId,versionId:version.id,diff:!0}),changedRoutes=diffRoutes.filter(r=>r.action!==void 0);if(changedRoutes.length>0?(output_manager_default.print(`
|
|
8
|
-
${import_chalk.default.bold("Changes to be published:")}
|
|
9
|
-
|
|
10
|
-
`),printDiffSummary(changedRoutes),output_manager_default.print(`
|
|
11
|
-
`)):output_manager_default.print(`
|
|
12
|
-
${import_chalk.default.gray("No changes detected from current production version.")}
|
|
13
|
-
|
|
14
|
-
`),!await confirmAction(client,parsed.flags["--yes"],"Publish these changes to production?",`This will make them live for ${import_chalk.default.bold(project.name)}.`))return output_manager_default.log("Canceled"),0;let updateStamp=stamp_default();output_manager_default.spinner("Publishing to production");try{let{version:newVersion}=await updateRouteVersion(client,project.id,version.id,"promote",{teamId});return output_manager_default.log(`${import_chalk.default.cyan("Success!")} Routes published to production ${import_chalk.default.gray(updateStamp())}`),newVersion.ruleCount!==void 0&&output_manager_default.print(` ${import_chalk.default.bold("Active routes:")} ${newVersion.ruleCount}
|
|
15
|
-
`),0}catch(e){let msg=e.message||"Failed to publish routes";return client.nonInteractive?(outputAgentError(client,{status:"error",reason:"api_error",message:msg,next:[{command:withGlobalFlags(client,"routes publish --yes")}]}),process.exit(1),1):(output_manager_default.error(msg),1)}}export{publish as default};
|
|
@@ -1,7 +0,0 @@
|
|
|
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{SENSITIVE_PLACEHOLDER,envPullCommandLogic,pull}from"./chunk-L3JYCXVB.js";import"./chunk-C7FQMC6D.js";import"./chunk-6Y2ZL5XJ.js";import"./chunk-7QAGSRCU.js";import"./chunk-25565AGS.js";import"./chunk-JP33AIDQ.js";import"./chunk-WEH6XC4Y.js";import"./chunk-7YKFF6CE.js";import"./chunk-6OVX3PWM.js";import"./chunk-HTXDC7E2.js";import"./chunk-PVASGBEF.js";import"./chunk-2TUVL6WE.js";import"./chunk-R6BEOVTU.js";import"./chunk-HCRD3JFL.js";import"./chunk-T6243EDS.js";import"./chunk-FGFLTLEA.js";import"./chunk-OZCQTXI4.js";import"./chunk-HSFKISDH.js";import"./chunk-3G3FQYMW.js";import"./chunk-6YXIWZ3X.js";import"./chunk-PUKYAALC.js";import"./chunk-K5U47EVH.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-NWGBDBZI.js";import"./chunk-WDXW6A4H.js";import"./chunk-DKJL2KV7.js";import"./chunk-4N6LMERQ.js";import"./chunk-ADLBLGT3.js";import"./chunk-CWM2F235.js";import"./chunk-4NTBYNFR.js";import"./chunk-KCKYPLIH.js";import"./chunk-F53OKXYI.js";import"./chunk-QVXS234E.js";import"./chunk-FUX6LKNP.js";import"./chunk-OPORM35X.js";import"./chunk-4SAVH3H7.js";import"./chunk-6VH56CX2.js";import"./chunk-JESNVRVR.js";import"./chunk-XP3FT56R.js";import"./chunk-BLUPZPAS.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BZENIQ7N.js";export{SENSITIVE_PLACEHOLDER,pull as default,envPullCommandLogic};
|
|
@@ -1,7 +0,0 @@
|
|
|
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{purchaseDomainIfAvailable}from"./chunk-AYUUSAB7.js";import"./chunk-IOZ3I765.js";import"./chunk-A2RZZQEP.js";import"./chunk-Q7D7RGXM.js";import"./chunk-3G3FQYMW.js";import"./chunk-K5U47EVH.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-WDXW6A4H.js";import"./chunk-DKJL2KV7.js";import"./chunk-4N6LMERQ.js";import"./chunk-ADLBLGT3.js";import"./chunk-CWM2F235.js";import"./chunk-4NTBYNFR.js";import"./chunk-KCKYPLIH.js";import"./chunk-F53OKXYI.js";import"./chunk-QVXS234E.js";import"./chunk-FUX6LKNP.js";import"./chunk-OPORM35X.js";import"./chunk-4SAVH3H7.js";import"./chunk-6VH56CX2.js";import"./chunk-JESNVRVR.js";import"./chunk-XP3FT56R.js";import"./chunk-BLUPZPAS.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BZENIQ7N.js";export{purchaseDomainIfAvailable as default};
|
|
@@ -1,7 +0,0 @@
|
|
|
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{DEFAULT_TAG,buildRepositoryReference,parseNameArg,validateImageParts}from"./chunk-HEGJZJO7.js";import{VCR_ENGINES,emitVcrArgParseError,isEngineInstalled,pushCompressionArgs,reportEnginePushFailure,resolveRegistry,resolveVcrScope,runEngine,splitPassthrough,validateVcrChoice}from"./chunk-SYFG2RM6.js";import{outputError}from"./chunk-RW3X523R.js";import"./chunk-BUJITHGZ.js";import"./chunk-FBYA6LLM.js";import"./chunk-GD7AV7BO.js";import"./chunk-SCV7XEEO.js";import{pushSubcommand}from"./chunk-527GBU3K.js";import"./chunk-CR3NBTHV.js";import"./chunk-BVGGTBYE.js";import"./chunk-6TXEVQA4.js";import{printError}from"./chunk-HSFKISDH.js";import"./chunk-K5U47EVH.js";import"./chunk-MXTC4ZAQ.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-WDXW6A4H.js";import"./chunk-DKJL2KV7.js";import"./chunk-4N6LMERQ.js";import"./chunk-ADLBLGT3.js";import"./chunk-CWM2F235.js";import"./chunk-4NTBYNFR.js";import{parseArguments}from"./chunk-KCKYPLIH.js";import"./chunk-F53OKXYI.js";import{getFlagsSpecification}from"./chunk-QVXS234E.js";import"./chunk-FUX6LKNP.js";import"./chunk-OPORM35X.js";import"./chunk-4SAVH3H7.js";import"./chunk-6VH56CX2.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-XP3FT56R.js";import"./chunk-BLUPZPAS.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BZENIQ7N.js";async function push(client,telemetry){let{own,passthrough}=splitPassthrough(client.argv),parsedArgs;try{parsedArgs=parseArguments(own,getFlagsSpecification(pushSubcommand.options))}catch(err){return emitVcrArgParseError(client,err,"vcr push <engine> [name[:tag]]"),printError(err),2}let[engineArg,nameArg]=parsedArgs.args.slice(2),project=parsedArgs.flags["--project"];if(telemetry.trackCliArgumentEngine(engineArg),telemetry.trackCliArgumentName(nameArg),telemetry.trackCliOptionProject(project),!engineArg){let message=`Missing engine. Choose one of: ${VCR_ENGINES.join(", ")}.`;return outputAgentError(client,{status:"error",reason:AGENT_REASON.MISSING_ARGUMENTS,message,next:[{command:buildCommandWithGlobalFlags(client.argv,"vcr push docker"),when:"Replace docker with the container tool you use"}]},2),outputError(client,!1,"MISSING_ARGUMENTS",message)}let choiceError=validateVcrChoice(client,"engine",engineArg,VCR_ENGINES,!1);if(typeof choiceError=="number")return choiceError;let engine=engineArg;if(!isEngineInstalled(engine)){let message=`\`${engine}\` is not installed or not on your PATH. Install it and try again.`;return outputAgentError(client,{status:"error",reason:"engine_not_found",message},1),outputError(client,!1,"ENGINE_NOT_FOUND",message)}let scope=await resolveVcrScope(client,{project,jsonOutput:!1});if(typeof scope=="number")return scope;let parsed=parseNameArg(nameArg,scope.projectName);if("error"in parsed)return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:parsed.error},2),outputError(client,!1,"INVALID_ARGUMENTS",parsed.error);let validationError=validateImageParts(parsed);if(validationError)return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:validationError},2),outputError(client,!1,"INVALID_ARGUMENTS",validationError);let ref=`${buildRepositoryReference({registry:resolveRegistry(),teamSlug:scope.teamSlug,projectName:scope.projectName,repository:parsed.repository})}:${parsed.tag??DEFAULT_TAG}`,engineArgs=["push",...pushCompressionArgs(engine),...passthrough,ref];output_manager_default.log(`Running: ${engine} ${engineArgs.join(" ")}`);let result=await runEngine(engine,engineArgs,{cwd:client.cwd,captureStderr:!0});return result.exitCode!==0?reportEnginePushFailure(client,engine,"push",result):(output_manager_default.success(`Pushed ${ref}`),0)}export{push as default};
|
|
@@ -1,7 +0,0 @@
|
|
|
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{performDeviceCodeFlow}from"./chunk-WEH6XC4Y.js";import"./chunk-PVASGBEF.js";import"./chunk-FGFLTLEA.js";import"./chunk-HSFKISDH.js";import"./chunk-WDXW6A4H.js";import"./chunk-DKJL2KV7.js";import"./chunk-4N6LMERQ.js";import"./chunk-ADLBLGT3.js";import"./chunk-CWM2F235.js";import"./chunk-4NTBYNFR.js";import"./chunk-KCKYPLIH.js";import"./chunk-F53OKXYI.js";import"./chunk-QVXS234E.js";import"./chunk-FUX6LKNP.js";import"./chunk-OPORM35X.js";import"./chunk-4SAVH3H7.js";import"./chunk-6VH56CX2.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-XP3FT56R.js";import"./chunk-BLUPZPAS.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);async function reauthenticate(client,error){let{tokenSource}=client.authConfig,reauthAction=error.enforced?"SAML re-authentication is required":"Re-authentication is required";if(tokenSource==="flag")throw new Error(`${reauthAction} for ${(0,import_chalk.bold)(error.scope)} scope, but the token provided via \`--token\` does not have access. Provide a token that is authorized for that scope.`);if(tokenSource==="env")throw new Error(`${reauthAction} for ${(0,import_chalk.bold)(error.scope)} scope, but the token provided via the VERCEL_TOKEN environment variable does not have access. Set VERCEL_TOKEN to a token that is authorized for that scope.`);if(!client.stdin.isTTY&&process.env.CI)throw new Error(`${reauthAction} for ${(0,import_chalk.bold)(error.scope)} scope, but the current environment is non-interactive so the device-code flow cannot be completed. Run \`vercel login\` in an interactive shell, or set VERCEL_TOKEN / pass \`--token\` with a token that is authorized for that scope.`);error.teamId&&error.enforced?output_manager_default.log(`You must re-authenticate with SAML to use ${(0,import_chalk.bold)(error.scope)} scope.`):output_manager_default.log(`You must re-authenticate to use ${(0,import_chalk.bold)(error.scope)} scope.`);let tokens=await performDeviceCodeFlow(client,{teamId:error.teamId||void 0});return tokens?(client.updateAuthConfig({token:tokens.access_token,userId:void 0,expiresAt:Math.floor(Date.now()/1e3)+tokens.expires_in,refreshToken:tokens.refresh_token}),client.persistAuthConfig(),output_manager_default.success(`Authentication complete for ${(0,import_chalk.bold)(error.scope)} scope.`),{token:tokens.access_token,email:""}):1}export{reauthenticate as default};
|
|
@@ -1,10 +0,0 @@
|
|
|
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{getRouteVersions}from"./chunk-BVH2AEFE.js";import{getRoutes,offerAutoPromote,parsePosition,parseSubcommandArgs,resolveRoute,shellQuoteRouteIdentifierForSuggestion,withGlobalFlags}from"./chunk-M2NXKZKX.js";import{requireProjectContext}from"./chunk-YEZJNXQX.js";import{stamp_default}from"./chunk-A2RZZQEP.js";import"./chunk-Q7D7RGXM.js";import"./chunk-JP33AIDQ.js";import"./chunk-2TUVL6WE.js";import{reorderSubcommand}from"./chunk-462YCCJZ.js";import"./chunk-HSFKISDH.js";import"./chunk-K5U47EVH.js";import"./chunk-MXTC4ZAQ.js";import{outputAgentError}from"./chunk-WDXW6A4H.js";import"./chunk-DKJL2KV7.js";import"./chunk-4N6LMERQ.js";import"./chunk-ADLBLGT3.js";import"./chunk-CWM2F235.js";import"./chunk-4NTBYNFR.js";import"./chunk-KCKYPLIH.js";import"./chunk-F53OKXYI.js";import"./chunk-QVXS234E.js";import"./chunk-FUX6LKNP.js";import"./chunk-OPORM35X.js";import"./chunk-4SAVH3H7.js";import"./chunk-6VH56CX2.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-XP3FT56R.js";import"./chunk-BLUPZPAS.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);async function stageRoutes(client,projectId,routes,overwrite,options={}){let{teamId}=options,query=new URLSearchParams;teamId&&query.set("teamId",teamId);let queryString=query.toString(),url=`/v1/projects/${projectId}/routes${queryString?`?${queryString}`:""}`;return await client.fetch(url,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({routes,overwrite})})}async function reorder(client,argv){let parsed=await parseSubcommandArgs(argv,reorderSubcommand,client);if(typeof parsed=="number")return parsed;let link=await requireProjectContext(client,"routes",parsed.flags["--project"]);if(typeof link=="number")return link;let{project,org}=link,teamId=org.type==="team"?org.id:void 0,{args,flags}=parsed,skipConfirmation=flags["--yes"],identifier=args[0];if(!identifier)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"missing_arguments",message:"Route name or ID and position are required.",next:[{command:withGlobalFlags(client,"routes move <name-or-id> --position <pos> --yes"),when:"replace placeholders; --first/--last or numeric position"}]},2),output_manager_default.error(`Route name or ID is required. Usage: ${withGlobalFlags(client,"routes move <name-or-id> --position <pos>")}`),2;let{versions}=await getRouteVersions(client,project.id,{teamId}),existingStagingVersion=versions.find(v=>v.isStaging);output_manager_default.spinner("Fetching routes");let{routes}=await getRoutes(client,project.id,{teamId});if(output_manager_default.stopSpinner(),routes.length===0)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"not_found",message:"No routes found in this project."},1),output_manager_default.error("No routes found in this project."),1;if(routes.length===1)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"invalid_arguments",message:"Cannot move a route when there is only one route."},2),output_manager_default.error("Cannot move a route when there is only one route."),2;let route=await resolveRoute(client,routes,identifier);if(!route)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"not_found",message:`No route found matching "${identifier}".`,next:[{command:withGlobalFlags(client,"routes list"),when:"list routes"}]},1),output_manager_default.error(`No route found matching "${identifier}". Run ${import_chalk.default.cyan(withGlobalFlags(client,"routes list"))} to see all routes.`),1;let currentIndex=routes.findIndex(r=>r.id===route.id),currentPosition=currentIndex+1,targetIndex,positionFlag=flags["--position"],firstFlag=flags["--first"],lastFlag=flags["--last"];if(firstFlag)targetIndex=0;else if(lastFlag)targetIndex=routes.length;else if(positionFlag)if(positionFlag==="first")targetIndex=0;else if(positionFlag==="last")targetIndex=routes.length;else{let num=parseInt(positionFlag,10);if(!isNaN(num)&&String(num)===positionFlag){if(num<1){let msg="Position must be 1 or greater. Positions are 1-based (e.g. --position 1 for first). Use --first or --last instead of 0.";return client.nonInteractive?(outputAgentError(client,{status:"error",reason:"invalid_arguments",message:msg,next:[{command:withGlobalFlags(client,`routes move ${shellQuoteRouteIdentifierForSuggestion(identifier)} --first --yes`),when:"move to first position"},{command:withGlobalFlags(client,`routes move ${shellQuoteRouteIdentifierForSuggestion(identifier)} --position 1 --yes`),when:"same as first (1-based index)"},{command:withGlobalFlags(client,`routes move ${shellQuoteRouteIdentifierForSuggestion(identifier)} --last --yes`),when:"move to last position"}],hint:"Numeric --position uses 1-based indices; there is no position 0."},2),2):(output_manager_default.error(msg),2)}targetIndex=Math.min(num-1,routes.length)}else try{let pos=parsePosition(positionFlag);if(pos.placement==="start")targetIndex=0;else if(pos.placement==="end")targetIndex=routes.length;else if(pos.placement==="after"&&pos.referenceId){let refIndex=routes.findIndex(r=>r.id===pos.referenceId);if(refIndex===-1)return output_manager_default.error(`Reference route "${pos.referenceId}" not found. Run ${import_chalk.default.cyan(withGlobalFlags(client,"routes list"))} to see route IDs.`),1;targetIndex=refIndex+1}else if(pos.placement==="before"&&pos.referenceId){let refIndex=routes.findIndex(r=>r.id===pos.referenceId);if(refIndex===-1)return output_manager_default.error(`Reference route "${pos.referenceId}" not found. Run ${import_chalk.default.cyan(withGlobalFlags(client,"routes list"))} to see route IDs.`),1;targetIndex=refIndex}else return output_manager_default.error("Invalid position specification."),1}catch(e){return output_manager_default.error(`${e instanceof Error?e.message:"Invalid position"}. Usage: ${withGlobalFlags(client,"routes move <name-or-id> --position <pos>")}`),2}}else{client.nonInteractive&&outputAgentError(client,{status:"error",reason:"missing_arguments",message:"Target position is required. Use --position <n|first|last|after:id|before:id> or --first / --last.",next:[{command:withGlobalFlags(client,`routes move ${shellQuoteRouteIdentifierForSuggestion(identifier)} --position <pos> --yes`),when:"replace <pos> with numeric position or first/last"}]},2),output_manager_default.print(`
|
|
8
|
-
`),output_manager_default.log("Current route order:");for(let i=0;i<routes.length;i++){let r=routes[i],isCurrent=r.id===route.id,prefix=isCurrent?import_chalk.default.cyan("\u2192"):" ",num=import_chalk.default.gray(`${i+1}.`),name=isCurrent?import_chalk.default.bold(r.name):r.name,src=import_chalk.default.gray(`(${r.route.src})`),marker=isCurrent?import_chalk.default.cyan(" \u2190 current"):"";output_manager_default.print(` ${prefix} ${num} ${name} ${src}${marker}
|
|
9
|
-
`)}output_manager_default.print(`
|
|
10
|
-
`);let input=await client.input.text({message:`Move "${route.name}" to position (1-${routes.length}, "first", or "last"):`,validate:val=>{if(!val)return"Position is required";if(val==="first"||val==="last")return!0;let num=parseInt(val,10);return isNaN(num)||num<1||num>routes.length?`Enter a number between 1 and ${routes.length}, "first", or "last"`:!0}});input==="first"?targetIndex=0:input==="last"?targetIndex=routes.length:targetIndex=parseInt(input,10)-1}let adjustedTarget=currentIndex<targetIndex?targetIndex-1:targetIndex,clampedTarget=Math.max(0,Math.min(adjustedTarget,routes.length-1));if(currentIndex===clampedTarget)return output_manager_default.log(`Route "${route.name}" is already at position ${currentPosition}.`),0;let finalPosition=clampedTarget+1;if(!skipConfirmation&&(client.nonInteractive&&outputAgentError(client,{status:"error",reason:"confirmation_required",message:"Move requires confirmation. Pass --yes in non-interactive mode.",next:[{command:withGlobalFlags(client,`routes move ${shellQuoteRouteIdentifierForSuggestion(identifier)} --position ${finalPosition} --yes`),when:"re-run with --yes"}]},1),!await client.input.confirm(`Move "${route.name}" from position ${currentPosition} to position ${finalPosition}?`,!0)))return output_manager_default.log("Aborted."),0;let reordered=[...routes];reordered.splice(currentIndex,1),reordered.splice(clampedTarget,0,route);let reorderStamp=stamp_default();output_manager_default.spinner(`Moving route "${route.name}"`);try{let{version}=await stageRoutes(client,project.id,reordered,!0,{teamId});return output_manager_default.log(`${import_chalk.default.cyan("Moved")} "${route.name}" from position ${currentPosition} to ${finalPosition} ${import_chalk.default.gray(reorderStamp())}`),await offerAutoPromote(client,project.id,version,!!existingStagingVersion,{teamId,skipPrompts:skipConfirmation}),0}catch(e){let error=e;return output_manager_default.error(error.message||"Failed to move route"),1}}export{reorder as default};
|
|
@@ -1,9 +0,0 @@
|
|
|
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{resolveMessageContent}from"./chunk-Q5ODLDCU.js";import{parseThreadArg}from"./chunk-2S6PE6GB.js";import{addMessage,handleCommentsParseError,resolveCommentsScope,threadNotFoundMessage,toApiErrorParts}from"./chunk-JUSR7V2L.js";import{outputError}from"./chunk-RW3X523R.js";import"./chunk-JP33AIDQ.js";import"./chunk-2TUVL6WE.js";import"./chunk-IQ7FPAI4.js";import{replySubcommand}from"./chunk-5KUUMQ3M.js";import"./chunk-HSFKISDH.js";import"./chunk-K5U47EVH.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-WDXW6A4H.js";import"./chunk-DKJL2KV7.js";import"./chunk-4N6LMERQ.js";import"./chunk-ADLBLGT3.js";import"./chunk-CWM2F235.js";import"./chunk-4NTBYNFR.js";import{parseArguments}from"./chunk-KCKYPLIH.js";import"./chunk-F53OKXYI.js";import{getFlagsSpecification,validateJsonOutput}from"./chunk-QVXS234E.js";import"./chunk-FUX6LKNP.js";import"./chunk-OPORM35X.js";import"./chunk-4SAVH3H7.js";import{isAPIError}from"./chunk-6VH56CX2.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-XP3FT56R.js";import"./chunk-BLUPZPAS.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);function validateAttachments(attach){if(!(!attach||attach.length===0)){if(attach.length>10)return"A message can have at most 10 attachments.";for(let url of attach)if(!/^https:\/\//i.test(url))return`Attachments must be https URLs (the API fetches them); got "${url}". Local file upload is not supported by the API.`}}async function reply(client,telemetry){let parsedArgs,flagsSpecification=getFlagsSpecification(replySubcommand.options);try{parsedArgs=parseArguments(client.argv.slice(2),flagsSpecification)}catch(err){return handleCommentsParseError(err,"reply")}let formatResult=validateJsonOutput(parsedArgs.flags);if(!formatResult.valid)return output_manager_default.error(formatResult.error),2;let jsonOutput=formatResult.jsonOutput;telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]),telemetry.trackCliOptionMessage(parsedArgs.flags["--message"]),telemetry.trackCliOptionFile(parsedArgs.flags["--file"]),telemetry.trackCliOptionAttach(parsedArgs.flags["--attach"]);let threadInput=parsedArgs.args[2];if(telemetry.trackCliArgumentThread(threadInput),!threadInput)return outputError(client,jsonOutput,"MISSING_THREAD","Pass a thread ID or URL: `vercel comments reply <thread> --message <text>`.");let threadRef=parseThreadArg(threadInput);if(!threadRef)return outputError(client,jsonOutput,"INVALID_THREAD",`Could not extract a thread ID from "${threadInput}". Pass the thread ID or its vercel.com URL.`);let threadId=threadRef.id,attach=parsedArgs.flags["--attach"],attachError=validateAttachments(attach);if(attachError)return outputError(client,jsonOutput,"INVALID_ATTACHMENT",attachError);let content=await resolveMessageContent(client,{message:parsedArgs.flags["--message"],file:parsedArgs.flags["--file"],hasAttachments:!!(attach&&attach.length>0)},jsonOutput);if(typeof content=="number")return content;telemetry.trackCliOptionProject(parsedArgs.flags["--project"]);let scope=await resolveCommentsScope(client,{project:parsedArgs.flags["--project"],requireProject:!1,jsonOutput,urlTeamSlug:threadRef.teamSlug});if(typeof scope=="number")return scope;jsonOutput||output_manager_default.spinner("Posting reply\u2026");try{let message=await addMessage(client,scope.teamId,threadId,{...content!==void 0&&{markdown:content},...attach&&attach.length>0&&{attachments:attach.map(url=>({url}))}});return jsonOutput?(client.stdout.write(`${JSON.stringify(message,null,2)}
|
|
8
|
-
`),0):(output_manager_default.print(`${import_chalk.default.green("\u2713")} Replied to ${threadId}
|
|
9
|
-
`),0)}catch(err){if(isAPIError(err)){let{code,message}=toApiErrorParts(err);return outputError(client,jsonOutput,code,err.status===404?threadNotFoundMessage(threadId,scope):message)}throw err}finally{output_manager_default.stopSpinner()}}export{reply as default};
|
|
@@ -1,12 +0,0 @@
|
|
|
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{parseThreadArg}from"./chunk-2S6PE6GB.js";import{addMessage,handleCommentsParseError,resolveCommentsScope,threadNotFoundMessage,toApiErrorParts,updateThread}from"./chunk-JUSR7V2L.js";import{outputError}from"./chunk-RW3X523R.js";import"./chunk-JP33AIDQ.js";import"./chunk-2TUVL6WE.js";import{canPrompt}from"./chunk-IQ7FPAI4.js";import{reopenSubcommand,resolveSubcommand}from"./chunk-5KUUMQ3M.js";import"./chunk-HSFKISDH.js";import"./chunk-K5U47EVH.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-WDXW6A4H.js";import"./chunk-DKJL2KV7.js";import"./chunk-4N6LMERQ.js";import"./chunk-ADLBLGT3.js";import"./chunk-CWM2F235.js";import"./chunk-4NTBYNFR.js";import{parseArguments}from"./chunk-KCKYPLIH.js";import"./chunk-F53OKXYI.js";import{getFlagsSpecification,validateJsonOutput}from"./chunk-QVXS234E.js";import"./chunk-FUX6LKNP.js";import"./chunk-OPORM35X.js";import"./chunk-4SAVH3H7.js";import{isAPIError}from"./chunk-6VH56CX2.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-XP3FT56R.js";import"./chunk-BLUPZPAS.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);async function resolveThreads(client,telemetry,resolved){let subcommand=resolved?resolveSubcommand:reopenSubcommand,verb=resolved?"resolve":"reopen",pastVerb=resolved?"resolved":"reopened",parsedArgs,flagsSpecification=getFlagsSpecification(subcommand.options);try{parsedArgs=parseArguments(client.argv.slice(2),flagsSpecification)}catch(err){return handleCommentsParseError(err,subcommand.name)}let formatResult=validateJsonOutput(parsedArgs.flags);if(!formatResult.valid)return output_manager_default.error(formatResult.error),2;let jsonOutput=formatResult.jsonOutput,closingMessage=resolved?parsedArgs.flags["--message"]:void 0,yes=!!parsedArgs.flags["--yes"];telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]),telemetry.trackCliFlagYes(parsedArgs.flags["--yes"]),resolved&&telemetry.trackCliOptionMessage(closingMessage);let threadInputs=parsedArgs.args.slice(2);if(telemetry.trackCliArgumentThread(threadInputs[0]),threadInputs.length===0)return outputError(client,jsonOutput,"MISSING_THREAD",`Pass at least one thread ID or URL: \`vercel comments ${verb} <thread>\`.`);let threadIds=[],urlTeamSlug;for(let input of threadInputs){let ref=parseThreadArg(input);if(!ref)return outputError(client,jsonOutput,"INVALID_THREAD",`Could not extract a thread ID from "${input}".`);if(ref.teamSlug){if(urlTeamSlug&&urlTeamSlug!==ref.teamSlug)return outputError(client,jsonOutput,"MIXED_TEAMS",`The URLs belong to different teams (${urlTeamSlug}, ${ref.teamSlug}). Run once per team.`);urlTeamSlug=ref.teamSlug}threadIds.push(ref.id)}if(closingMessage!==void 0&&threadIds.length>1)return outputError(client,jsonOutput,"MESSAGE_WITH_MULTIPLE_THREADS","Cannot use --message with multiple threads. Resolve one thread with a closing message, or resolve multiple threads without --message.");let scope=await resolveCommentsScope(client,{project:parsedArgs.flags["--project"],requireProject:!1,jsonOutput,urlTeamSlug});if(typeof scope=="number")return scope;if(threadIds.length>1&&!yes){if(!canPrompt(client)||jsonOutput)return outputError(client,jsonOutput,"CONFIRMATION_REQUIRED",`Pass --yes to ${verb} ${threadIds.length} comments non-interactively.`);if(!await client.input.confirm(`${import_chalk.default.bold(String(threadIds.length))} comments will be ${pastVerb} in team ${scope.teamSlug??scope.teamId}. Continue?`,!1))return output_manager_default.log("Canceled."),0}if(telemetry.trackCliOptionProject(parsedArgs.flags["--project"]),threadIds.length===1){let threadId=threadIds[0],replied=!1;try{closingMessage!==void 0&&(await addMessage(client,scope.teamId,threadId,{markdown:closingMessage}),replied=!0);let thread=await updateThread(client,scope.teamId,threadId,resolved);return jsonOutput?(client.stdout.write(`${JSON.stringify({thread,replied},null,2)}
|
|
8
|
-
`),0):(output_manager_default.print(`${import_chalk.default.green("\u2713")} ${threadId} ${pastVerb}${replied?" (with closing reply)":""}
|
|
9
|
-
`),0)}catch(err){if(isAPIError(err)){let{code,message}=toApiErrorParts(err),friendly=err.status===404?threadNotFoundMessage(threadId,scope):message;return outputError(client,jsonOutput,code,replied?`Replied, but ${verb} failed: ${friendly} Run \`vercel comments resolve ${threadId}\` (without -m) to finish without duplicating the reply.`:friendly)}throw err}}let results=[];for(let threadId of threadIds)try{await updateThread(client,scope.teamId,threadId,resolved),results.push({id:threadId,ok:!0})}catch(err){if(isAPIError(err)){let{message}=toApiErrorParts(err);results.push({id:threadId,ok:!1,error:message})}else throw err}let failed=results.filter(result=>!result.ok);if(jsonOutput)return client.stdout.write(`${JSON.stringify({results},null,2)}
|
|
10
|
-
`),failed.length>0?1:0;for(let result of results)result.ok?output_manager_default.print(`${import_chalk.default.green("\u2713")} ${result.id} ${pastVerb}
|
|
11
|
-
`):output_manager_default.print(`${import_chalk.default.yellow("!")} ${result.id} ${result.error}
|
|
12
|
-
`);return failed.length>0?1:0}export{resolveThreads as default};
|
|
@@ -1,7 +0,0 @@
|
|
|
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{selectOrg}from"./chunk-7L5QUDUR.js";import{getTeams}from"./chunk-FGFLTLEA.js";import"./chunk-3G3FQYMW.js";import{assertOrgIdMatchesAppTeam,getAppTokenTeamId,getLocalOrgId,isAppPrincipalEnabled}from"./chunk-K5U47EVH.js";import"./chunk-MXTC4ZAQ.js";import{AGENT_REASON,outputAgentError}from"./chunk-WDXW6A4H.js";import"./chunk-DKJL2KV7.js";import{getUser}from"./chunk-4N6LMERQ.js";import"./chunk-ADLBLGT3.js";import"./chunk-CWM2F235.js";import"./chunk-4NTBYNFR.js";import"./chunk-KCKYPLIH.js";import"./chunk-F53OKXYI.js";import"./chunk-QVXS234E.js";import"./chunk-FUX6LKNP.js";import"./chunk-OPORM35X.js";import"./chunk-4SAVH3H7.js";import"./chunk-6VH56CX2.js";import"./chunk-JESNVRVR.js";import{output_manager_default,require_build_utils}from"./chunk-XP3FT56R.js";import"./chunk-BLUPZPAS.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_build_utils=__toESM(require_build_utils(),1);async function resolveAgentTeam(client,{ask}){let envOrgId=(0,import_build_utils.getPlatformEnv)("ORG_ID");if(isAppPrincipalEnabled()){let appTeamId=await getAppTokenTeamId(client);if(appTeamId)return assertOrgIdMatchesAppTeam(client,appTeamId),appTeamId}let orgId=envOrgId??await getLocalOrgId(client);if(orgId){if(orgId.startsWith("team_"))return orgId;if((await getUser(client)).id===orgId)return;failScope(client,envOrgId?`VERCEL_ORG_ID is set to "${orgId}", which isn't a team ID or your account ID. Use the team's ID, which starts with "team_", or pass --scope <team>.`:`This directory's link points to ${orgId}, which isn't a team or your account. Pass --scope <team>.`)}if(!ask)return getOnlyChoice(client);let org=await selectOrg(client,"Which team?");return org.type==="team"?org.id:void 0}async function getOnlyChoice(client){try{let[user,teams]=await Promise.all([getUser(client),getTeams(client)]),hasPersonalAccount=user.version!=="northstar";if(teams.length===1&&!hasPersonalAccount)return teams[0].id;if(teams.length===0&&hasPersonalAccount)return}catch(err){output_manager_default.debug(`Couldn't list teams to choose one: ${err}`)}return null}function failScope(client,message){throw outputAgentError(client,{status:"error",reason:AGENT_REASON.SCOPE_NOT_ACCESSIBLE,message}),new Error(message)}export{resolveAgentTeam};
|
|
@@ -1,16 +0,0 @@
|
|
|
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{updateRouteVersion}from"./chunk-6QKS6QK7.js";import{getRouteVersions}from"./chunk-BVH2AEFE.js";import{confirmAction,findVersionById,getRoutes,parseSubcommandArgs,printDiffSummary,withGlobalFlags}from"./chunk-M2NXKZKX.js";import{requireProjectContext,validateRequiredArguments}from"./chunk-YEZJNXQX.js";import{stamp_default}from"./chunk-A2RZZQEP.js";import"./chunk-Q7D7RGXM.js";import"./chunk-JP33AIDQ.js";import"./chunk-2TUVL6WE.js";import{restoreSubcommand}from"./chunk-462YCCJZ.js";import"./chunk-HSFKISDH.js";import"./chunk-K5U47EVH.js";import"./chunk-MXTC4ZAQ.js";import{outputAgentError}from"./chunk-WDXW6A4H.js";import"./chunk-DKJL2KV7.js";import"./chunk-4N6LMERQ.js";import"./chunk-ADLBLGT3.js";import"./chunk-CWM2F235.js";import"./chunk-4NTBYNFR.js";import"./chunk-KCKYPLIH.js";import"./chunk-F53OKXYI.js";import"./chunk-QVXS234E.js";import"./chunk-FUX6LKNP.js";import"./chunk-OPORM35X.js";import"./chunk-4SAVH3H7.js";import"./chunk-6VH56CX2.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-XP3FT56R.js";import"./chunk-BLUPZPAS.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);async function restore(client,argv){let parsed=await parseSubcommandArgs(argv,restoreSubcommand,client);if(typeof parsed=="number")return parsed;let error=validateRequiredArguments(parsed.args,["version-id"]);if(error)return client.nonInteractive?(outputAgentError(client,{status:"error",reason:"missing_arguments",message:error,next:[{command:withGlobalFlags(client,"routes restore <version-id> --yes")},{command:withGlobalFlags(client,"routes list-versions")}]}),process.exit(1),2):(output_manager_default.error(error),2);let link=await requireProjectContext(client,"routes",parsed.flags["--project"]);if(typeof link=="number")return link;let{project,org}=link,teamId=org.type==="team"?org.id:void 0,[versionIdentifier]=parsed.args;output_manager_default.spinner(`Fetching route versions for ${import_chalk.default.bold(project.name)}`);let{versions}=await getRouteVersions(client,project.id,{teamId}),result=findVersionById(client,versions,versionIdentifier);if(result.error)return client.nonInteractive?(outputAgentError(client,{status:"error",reason:"invalid_arguments",message:result.error,next:[{command:withGlobalFlags(client,"routes list-versions")}]}),process.exit(1),2):(output_manager_default.error(result.error),2);let version=result.version;if(!version)return client.nonInteractive?(outputAgentError(client,{status:"error",reason:"not_found",message:"Version not found.",next:[{command:withGlobalFlags(client,"routes list-versions")}]}),process.exit(1),1):(output_manager_default.error("Version not found."),1);if(version.isLive){let liveMsg=`Version ${version.id.slice(0,12)} is currently live. You cannot restore the live version. Run ${withGlobalFlags(client,"routes list-versions")} to see previous versions you can restore.`;return client.nonInteractive?(outputAgentError(client,{status:"error",reason:"invalid_arguments",message:liveMsg,next:[{command:withGlobalFlags(client,"routes list-versions")}]}),process.exit(1),2):(output_manager_default.error(`Version ${import_chalk.default.bold(version.id.slice(0,12))} is currently live. You cannot restore the live version.
|
|
8
|
-
Run ${import_chalk.default.cyan(withGlobalFlags(client,"routes list-versions"))} to see previous versions you can restore.`),2)}if(version.isStaging){let stagingMsg=`Version ${version.id.slice(0,12)} is staged. Use ${withGlobalFlags(client,"routes publish")} to publish it instead.`;return client.nonInteractive?(outputAgentError(client,{status:"error",reason:"invalid_arguments",message:stagingMsg,next:[{command:withGlobalFlags(client,"routes publish --yes")}]}),process.exit(1),2):(output_manager_default.error(`Version ${import_chalk.default.bold(version.id.slice(0,12))} is staged. Use ${import_chalk.default.cyan(withGlobalFlags(client,"routes publish"))} to publish it instead.`),2)}output_manager_default.spinner("Fetching changes");let{routes:diffRoutes}=await getRoutes(client,project.id,{teamId,versionId:version.id,diff:!0}),changedRoutes=diffRoutes.filter(r=>r.action!==void 0);if(changedRoutes.length>0?(output_manager_default.print(`
|
|
9
|
-
${import_chalk.default.bold("Changes to be restored:")}
|
|
10
|
-
|
|
11
|
-
`),printDiffSummary(changedRoutes),output_manager_default.print(`
|
|
12
|
-
`)):output_manager_default.print(`
|
|
13
|
-
${import_chalk.default.gray("No changes detected from current production version.")}
|
|
14
|
-
|
|
15
|
-
`),!await confirmAction(client,parsed.flags["--yes"],`Restore version ${import_chalk.default.bold(version.id.slice(0,12))} to production?`,`This will replace the current live routes for ${import_chalk.default.bold(project.name)}.`))return output_manager_default.log("Canceled"),0;let updateStamp=stamp_default();output_manager_default.spinner(`Restoring version ${import_chalk.default.bold(version.id.slice(0,12))}`);try{let{version:newVersion}=await updateRouteVersion(client,project.id,version.id,"restore",{teamId});return output_manager_default.log(`${import_chalk.default.cyan("Success!")} Version ${import_chalk.default.bold(newVersion.id.slice(0,12))} restored to production ${import_chalk.default.gray(updateStamp())}`),newVersion.ruleCount!==void 0&&output_manager_default.print(` ${import_chalk.default.bold("Active routes:")} ${newVersion.ruleCount}
|
|
16
|
-
`),0}catch(e){let msg=e.message||"Failed to restore version";return client.nonInteractive?(outputAgentError(client,{status:"error",reason:"api_error",message:msg,next:[{command:withGlobalFlags(client,`routes restore ${versionIdentifier} --yes`)}]}),process.exit(1),1):(output_manager_default.error(msg),1)}}export{restore as default};
|
|
@@ -1,8 +0,0 @@
|
|
|
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{parseTeamRefs,teamRefBody}from"./chunk-LSF7FY6X.js";import{repositoryPermissionsPath}from"./chunk-DFVNL5ML.js";import{emitVcrArgParseError,resolveVcrScope,validateVcrJsonOutput}from"./chunk-SYFG2RM6.js";import{outputError}from"./chunk-RW3X523R.js";import{require_async_sema}from"./chunk-NZ2TFADV.js";import"./chunk-BUJITHGZ.js";import"./chunk-FBYA6LLM.js";import"./chunk-GD7AV7BO.js";import"./chunk-SCV7XEEO.js";import{permissionsRmSubcommand}from"./chunk-CR3NBTHV.js";import{printError}from"./chunk-HSFKISDH.js";import"./chunk-K5U47EVH.js";import"./chunk-MXTC4ZAQ.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-WDXW6A4H.js";import"./chunk-DKJL2KV7.js";import"./chunk-4N6LMERQ.js";import"./chunk-ADLBLGT3.js";import"./chunk-CWM2F235.js";import"./chunk-4NTBYNFR.js";import{parseArguments}from"./chunk-KCKYPLIH.js";import"./chunk-F53OKXYI.js";import{getFlagsSpecification}from"./chunk-QVXS234E.js";import"./chunk-FUX6LKNP.js";import"./chunk-OPORM35X.js";import"./chunk-4SAVH3H7.js";import{isAPIError}from"./chunk-6VH56CX2.js";import{packageName}from"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-XP3FT56R.js";import"./chunk-BLUPZPAS.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_async_sema=__toESM(require_async_sema(),1);var USAGE="vcr permissions <repository> remove <team>[,<team>...]";async function rm(client,argv,telemetry){let parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(permissionsRmSubcommand.options))}catch(err){return emitVcrArgParseError(client,err,USAGE),printError(err),2}let fr=validateVcrJsonOutput(client,parsedArgs.flags);if(typeof fr=="number")return fr;let repository=parsedArgs.args[0],teamRefs=parseTeamRefs(parsedArgs.args.slice(2)),project=parsedArgs.flags["--project"];if(telemetry.trackCliOptionProject(project),telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]),teamRefs.length===0)return outputAgentError(client,{status:"error",reason:AGENT_REASON.MISSING_ARGUMENTS,message:`Missing team. Example: ${packageName} vcr permissions ${repository} remove team_1a2b3c4d`,next:[{command:buildCommandWithGlobalFlags(client.argv,`vcr permissions ${repository} ls`),when:"List teams with access to pick one to remove"}]},2),outputError(client,fr.jsonOutput,"MISSING_ARGUMENTS",`Usage: \`vercel ${USAGE}\``);let scope=await resolveVcrScope(client,{project,jsonOutput:fr.jsonOutput});if(typeof scope=="number")return scope;let path=repositoryPermissionsPath(scope,repository),removed=[],failed=[];output_manager_default.spinner(`Removing access to ${repository} for ${teamRefs.length===1?teamRefs[0]:`${teamRefs.length} teams`}...`);let sema=new import_async_sema.default(10),results;try{results=await Promise.all(teamRefs.map(async team=>{await sema.acquire();try{return await client.fetch(path,{method:"DELETE",body:teamRefBody(team)}),{ok:!0,team}}catch(err){if(!isAPIError(err))throw err;let message=err.serverMessage||`API error (${err.status}).`;return{ok:!1,team,failure:{team,code:err.code||"API_ERROR",message}}}finally{sema.release()}}))}finally{output_manager_default.stopSpinner()}for(let result of results)result.ok?(removed.push(result.team),fr.jsonOutput||output_manager_default.success(`Removed access to ${repository} for ${result.team}`)):(failed.push(result.failure),fr.jsonOutput||output_manager_default.error(`Failed to remove access to ${repository} for ${result.team}: ${result.failure.message}`));return failed.length>0&&outputAgentError(client,{status:"error",reason:AGENT_REASON.API_ERROR,message:`Failed to remove access to ${repository} for ${failed.map(f=>`${f.team} (${f.message})`).join(", ")}`},1),fr.jsonOutput&&client.stdout.write(`${JSON.stringify({removed,failed},null,2)}
|
|
8
|
-
`),failed.length>0?1:0}export{rm as default};
|
|
@@ -1,8 +0,0 @@
|
|
|
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{repositoryPath}from"./chunk-DFVNL5ML.js";import{emitVcrArgParseError,handleVcrApiError,requireVcrRepository,resolveVcrScope,validateVcrJsonOutput}from"./chunk-SYFG2RM6.js";import"./chunk-RW3X523R.js";import"./chunk-BUJITHGZ.js";import"./chunk-FBYA6LLM.js";import"./chunk-GD7AV7BO.js";import"./chunk-SCV7XEEO.js";import{removeSubcommand}from"./chunk-527GBU3K.js";import"./chunk-CR3NBTHV.js";import"./chunk-BVGGTBYE.js";import"./chunk-6TXEVQA4.js";import{printError}from"./chunk-HSFKISDH.js";import"./chunk-K5U47EVH.js";import"./chunk-MXTC4ZAQ.js";import{AGENT_REASON,buildCommandWithYes,outputAgentError}from"./chunk-WDXW6A4H.js";import"./chunk-DKJL2KV7.js";import"./chunk-4N6LMERQ.js";import"./chunk-ADLBLGT3.js";import"./chunk-CWM2F235.js";import"./chunk-4NTBYNFR.js";import{parseArguments}from"./chunk-KCKYPLIH.js";import"./chunk-F53OKXYI.js";import{getFlagsSpecification}from"./chunk-QVXS234E.js";import"./chunk-FUX6LKNP.js";import"./chunk-OPORM35X.js";import"./chunk-4SAVH3H7.js";import{isAPIError}from"./chunk-6VH56CX2.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-XP3FT56R.js";import"./chunk-BLUPZPAS.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BZENIQ7N.js";async function rm(client,argv,telemetry){let parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(removeSubcommand.options))}catch(err){return emitVcrArgParseError(client,err,"vcr delete <repository> --project <name-or-id>"),printError(err),2}let fr=validateVcrJsonOutput(client,parsedArgs.flags);if(typeof fr=="number")return fr;let repository=parsedArgs.args[0],project=parsedArgs.flags["--project"],skipConfirmation=!!parsedArgs.flags["--yes"];telemetry.trackCliOptionProject(project),telemetry.trackCliFlagYes(parsedArgs.flags["--yes"]),telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]);let missingRepository=requireVcrRepository(client,repository,fr.jsonOutput,"vcr delete <repository>");if(typeof missingRepository=="number")return missingRepository;let scope=await resolveVcrScope(client,{project,jsonOutput:fr.jsonOutput});if(typeof scope=="number")return scope;if(!skipConfirmation&&(outputAgentError(client,{status:"error",reason:AGENT_REASON.CONFIRMATION_REQUIRED,message:"Deleting a repository deletes it and all of its images. Re-run with --yes.",next:[{command:buildCommandWithYes(client.argv)}]},1),!await client.input.confirm(`Delete repository ${repository} and all of its images? This cannot be undone.`,!1)))return output_manager_default.log("Canceled"),0;let path=repositoryPath(scope,repository);output_manager_default.spinner("Deleting repository...");try{return await client.fetch(path,{method:"DELETE"}),fr.jsonOutput?client.stdout.write(`${JSON.stringify({repository,deleted:!0},null,2)}
|
|
8
|
-
`):output_manager_default.success(`Repository ${repository} deleted`),0}catch(err){if(isAPIError(err))return handleVcrApiError(client,err,fr.jsonOutput);throw err}finally{output_manager_default.stopSpinner()}}export{rm as default};
|